@nebula.js/sn-funnel-chart 1.9.36 → 1.9.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api-specifications/plugins.json +1 -1
- package/api-specifications/properties.json +1 -1
- package/core/esm/index.js +3 -3
- package/dist/sn-funnel-chart.js +3 -3
- package/dist/sn-funnel-chart.systemjs.js +2 -2
- package/package.json +1 -1
- package/sn-funnel-chart-ext/dist/sn-funnel-chart.js +3 -3
- package/sn-funnel-chart-ext/sn-funnel-chart.qext +1 -1
@@ -1,13 +1,13 @@
|
|
1
1
|
/*
|
2
|
-
* @nebula.js/sn-funnel-chart v1.9.
|
2
|
+
* @nebula.js/sn-funnel-chart v1.9.37
|
3
3
|
* Copyright (c) 2025 QlikTech International AB
|
4
4
|
* Released under the MIT license.
|
5
5
|
*/
|
6
6
|
|
7
7
|
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("@nebula.js/stardust")):"function"==typeof define&&define.amd?define(["@nebula.js/stardust"],t):(e="undefined"!=typeof globalThis?globalThis:e||self)["sn-funnel-chart"]=t(e.stardust)}(this,(function(e){"use strict";var t={properties_dataPoints_labelmode_share:{id:"properties.dataPoints.labelmode.share",locale:{"en-US":"Share","zh-TW":"佔有率","zh-CN":"份额","tr-TR":"Pay","sv-SE":"Andel","it-IT":"Percentuale","es-ES":"Cuota","de-DE":"Anteil","pl-PL":"Udział","nl-NL":"Aandeel","ko-KR":"공유","pt-BR":"Percentual","fr-FR":"Part","ja-JP":"割合","ru-RU":"Доля"}},Tooltip_selections_locked:{id:"Tooltip.selections.locked",locale:{"en-US":"Selections on this dimension are locked","zh-TW":"已鎖定此維度上的選項","zh-CN":"相关维度的选择已锁定","tr-TR":"Bu boyuttaki seçimler kilitli","sv-SE":"Urval i den här dimensionen är låsta","it-IT":"Le selezioni in questa dimensione sono bloccate","es-ES":"Las selecciones de esta dimensión están bloqueadas.","de-DE":"Auswahlen sind für diese Dimension gesperrt","pl-PL":"Selekcje dotyczące tego wymiaru są zablokowane","nl-NL":"Selecties voor deze dimensie zijn vergrendeld","ko-KR":"이 차원의 선택은 잠겨 있습니다.","pt-BR":"Seleções estão bloqueadas nesta dimensão","fr-FR":"Sélections verrouillées pour cette dimension","ja-JP":"この軸での選択はロックされています","ru-RU":"Выборки для данного измерения заблокированы"}},Tooltip_dimensions_drilldown:{id:"Tooltip.dimensions.drilldown",locale:{"en-US":"Drill-down dimension","zh-TW":"向下探查維度","zh-CN":"下钻维度","tr-TR":"Detaya inme boyutu","sv-SE":"Hierarkisk dimension","it-IT":"Dimensione di drill-down","es-ES":"Dimensión jerárquica","de-DE":"Drilldown-Dimension:","pl-PL":"Wymiar hierarchiczny","nl-NL":"Drill-downdimensie","ko-KR":"드릴다운 차원","pt-BR":"Dimensão da hierarquia","fr-FR":"Descendre dans la hiérarchie de la dimension","ja-JP":"軸のドリルダウン","ru-RU":"Измерение с детализацией"}},Object_ErrorMessage_MissingDimension:{id:"Object.ErrorMessage.MissingDimension",locale:{"en-US":"Dimension not found","zh-TW":"找不到維度","zh-CN":"未找到维度","tr-TR":"Boyut bulunamadı","sv-SE":"Dimensionen hittades inte","it-IT":"Dimensione non trovata","es-ES":"No se ha encontrado la dimensión","de-DE":"Dimension nicht gefunden","pl-PL":"Wymiar nie został znaleziony","nl-NL":"Dimensie niet gevonden","ko-KR":"차원을 찾지 못했습니다.","pt-BR":"Dimensão não encontrada","fr-FR":"Dimension introuvable","ja-JP":"軸が見つかりません","ru-RU":"Измерение не найдено"}},Object_ErrorMessage_MissingMeasure:{id:"Object.ErrorMessage.MissingMeasure",locale:{"en-US":"Measure not found","zh-TW":"找不到量值","zh-CN":"未找到度量","tr-TR":"Hesaplama bulunamadı","sv-SE":"Måttet hittades inte","it-IT":"Misura non trovata","es-ES":"No se ha encontrado la medida","de-DE":"Kennzahl nicht gefunden","pl-PL":"Miara nie została znaleziona","nl-NL":"Meting niet gevonden","ko-KR":"측정값을 찾지 못했습니다.","pt-BR":"Medida não encontrada","fr-FR":"Mesure introuvable","ja-JP":"メジャーが見つかりません","ru-RU":"Мера не найдена"}},Object_Disclaimer_LimitedData:{id:"Object.Disclaimer.LimitedData",locale:{"en-US":"Currently showing a limited data set.","zh-TW":"目前顯示的是有限的資料集。","zh-CN":"当前正显示有限的数据集。","tr-TR":"Şu anda sınırlı bir veri kümesi gösteriliyor.","sv-SE":"Just nu visas en begränsad uppsättning data.","it-IT":"Attualmente viene visualizzata una serie di dati limitata.","es-ES":"Mostrando actualmente un conjunto limitado de datos.","de-DE":"Zurzeit wird nur ein beschränkter Datensatz angezeigt.","pl-PL":"Aktualnie przedstawiany jest ograniczony zestaw danych.","nl-NL":"Momenteel wordt een beperkte gegevensverzameling getoond.","ko-KR":"현재 제한된 데이터 집합을 표시하고 있습니다.","pt-BR":"Mostrando um conjunto de dados limitado.","fr-FR":"Affichage d'un ensemble de données limité pour l'instant.","ja-JP":"現在、限定的なデータ セットを表示しています。","ru-RU":"В настоящее время отображается ограниченный набор данных."}},Object_Disclaimer_OnlyNegativeOrZeroValues:{id:"Object.Disclaimer.OnlyNegativeOrZeroValues",locale:{"en-US":"The chart is not displayed because it contains only negative or zero values.","zh-TW":"系統不會顯示圖表,因為該圖表僅包含負值或零值。","zh-CN":"未显示图表,因为它仅包含负值或零值。","tr-TR":"Yalnızca negatif veya sıfır değerlerini içermesi nedeniyle grafik görüntülenmiyor.","sv-SE":"Diagrammet visas inte eftersom det enbart innehåller negativa eller nollvärden","it-IT":"Il grafico non viene visualizzato poiché contiene solo valori negativi o uguali a zero.","es-ES":"El gráfico no se muestra porque sólo contiene valores negativos o valores cero.","de-DE":"Das Diagramm wird nicht angezeigt, da es nur negative oder 0-Werte enthält.","pl-PL":"Wykres nie jest wyświetlany, ponieważ zawiera wartości ujemne lub zerowe.","nl-NL":"De grafiek wordt niet weergegeven omdat het alleen negatieve waarden of nulwaarden bevat.","ko-KR":"음수 또는 zero 값만 포함되어 있으므로 차트가 표시되지 않습니다.","pt-BR":"O gráfico não foi exibido, porque contém apenas valores negativos ou zero.","fr-FR":"Le graphique n'est pas affiché, car il contient uniquement des valeurs négatives ou égales à zéro.","ja-JP":"チャートは負の値またはゼロ値しか含まれていないため、表示されていません。","ru-RU":"Диаграмма не отображается, поскольку она содержит только отрицательные или нулевые значения."}},Object_Disclaimer_NegativeOrZeroValues:{id:"Object.Disclaimer.NegativeOrZeroValues",locale:{"en-US":"The data set contains negative or zero values that cannot be shown in this chart.","zh-TW":"資料集包含無法在此圖表中顯示的負值或零值。","zh-CN":"数据集中包含无法在此图表中显示的负值或零值。","tr-TR":"Veri kümesi, bu grafikte gösterilemeyen negatif veya sıfır değerlerini içeriyor.","sv-SE":"Datauppsättningen innehåller negativa värden eller nollvärden som inte kan visas i detta diagram.","it-IT":"La serie di dati contiene valori negativi o uguali a zero che non possono essere visualizzati in questo grafico.","es-ES":"El conjunto de datos contiene valores negativos o cero que no se pueden mostrar en este gráfico.","de-DE":"Die in den Datensätzen enthaltenen negativen oder 0-Werte können nicht in diesem Diagramm dargestellt werden.","pl-PL":"Zestaw danych zawiera wartości ujemne lub zerowe, których nie można przedstawić w tym wykresie.","nl-NL":"De gegevensverzameling bevat negatieve waarden of nulwaarden die niet kunnen worden weergegeven in deze grafiek.","ko-KR":"데이터 집합에 해당 차트에 표시할 수 없는 음수 값 또는 zero 값이 포함되어 있습니다.","pt-BR":"O conjunto de dados contém valores negativos ou iguais a zero que não podem ser mostrados neste gráfico.","fr-FR":"L'ensemble de données contient des valeurs négatives ou égales à zéro impossibles à afficher dans ce graphique.","ja-JP":"データ セットには、本チャートに表示できない負の値またはゼロ値が含まれています。","ru-RU":"Набор данных содержит отрицательные или нулевые значения, которые невозможно показать в этой диаграмме."}},Object_Disclaimer_DataRangeIncludingZero:{id:"Object.Disclaimer.DataRangeIncludingZero",locale:{"en-US":"The logarithmic scale has been replaced by a linear scale because the data range includes zero.","zh-TW":"對數刻度已遭線性刻度取代,因為資料範圍包含零。","zh-CN":"对数刻度已替换为线性刻度,因为该数据范围包括零。","tr-TR":"Veri aralığı sıfır değerini içerdiğinden, logaritmik ölçek yerine doğrusal ölçek kullanıldı.","sv-SE":"Den logaritmiska skalan har ersatts av en linjär skala eftersom dataintervallet innehåller värdet noll.","it-IT":"La scala logaritmica è stata sostituita da una scala lineare perché l'intervallo di dati include zero.","es-ES":"La escala logarítmica ha sido reemplazada por una escala lineal porque el rango de datos incluye cero.","de-DE":"Die logarithmische Skala wurde durch die lineare Skala ersetzt, weil der Datenbereich NULL enthält.","pl-PL":"Skala logarytmiczna została zastąpiona liniową, ponieważ zakres danych zawiera zero.","nl-NL":"De logaritmische schaal is vervangen door een lineaire schaal omdat het gegevensbereik nullen bevat.","ko-KR":"데이터 범위에 0이 포함되어 있으므로 로그 눈금이 선형 눈금으로 바뀌었습니다.","pt-BR":"A escala logarítmica foi substituída por uma escala linear, pois o intervalo de dados inclui zero.","fr-FR":"L'échelle logarithmique a été remplacée par une échelle linéaire, car la plage de données comprend la valeur zéro.","ja-JP":"データ範囲にゼロが含まれるため、Log スケールは Linear スケールで置換されています。","ru-RU":"Логарифмический масштаб заменен линейным масштабом, поскольку диапазон данных включает ноль."}},Object_Disclaimer_NoDataExist:{id:"Object.Disclaimer.NoDataExist",locale:{"en-US":"The selections generated no data for this chart.","zh-TW":"此選項無法產生任何適用於此圖表的資料。","zh-CN":"选择未生成此图表的数据。","tr-TR":"Seçimler bu grafik için hiç veri oluşturmadı.","sv-SE":"Urvalen genererade inga data för detta diagram.","it-IT":"Le selezioni non hanno generato dati per questo grafico.","es-ES":"Las selecciones no han generado datos para este gráfico.","de-DE":"Die Auswahlen haben für dieses Diagramm keine Daten generiert.","pl-PL":"Selekcje nie spowodowały wygenerowania danych dla tego wykresu.","nl-NL":"De selecties hebben geen gegevens voor de grafiek gegenereerd.","ko-KR":"선택 내용으로 해당 차트에 대한 데이터가 생성되지 않았습니다.","pt-BR":"As seleções não geraram dados para este gráfico.","fr-FR":"Les sélections n'ont pas généré de données pour ce graphique.","ja-JP":"このチャートには選択からデータが生成されませんでした。","ru-RU":"В результате выборок данные для этой диаграммы не созданы."}},Object_Disclaimer_OnlyNanData:{id:"Object.Disclaimer.OnlyNanData",locale:{"en-US":"The chart is not displayed because it contains only undefined values.","zh-TW":"系統不會顯示圖表,因為該圖表僅包含未定義的值。","zh-CN":"未显示图表,因为它仅包含未定义的值。","tr-TR":"Yalnızca tanımsız değerleri içermesi nedeniyle grafik görüntülenmiyor.","sv-SE":"Diagrammet visas inte eftersom det enbart innehåller odefinierade värden.","it-IT":"Il grafico non è visualizzato poiché contiene solo valori non definiti.","es-ES":"El gráfico no se muestra porque solo contiene valores indefinidos.","de-DE":"Das Diagramm wird nicht angezeigt, da es nur nicht definierte Werte enthält.","pl-PL":"Wykres nie jest wyświetlany, ponieważ zawiera wartości niezdefiniowane.","nl-NL":"De grafiek wordt niet weergegeven omdat deze alleen ongedefinieerde waarden bevat.","ko-KR":"정의되지 않은 값만 포함되어 있으므로 차트가 표시되지 않습니다.","pt-BR":"O gráfico não foi exibido, porque contém apenas valores não definidos.","fr-FR":"Le graphique n'est pas affiché, car il contient uniquement des valeurs non définies.","ja-JP":"未定義の値しか含まれていないため、チャートは表示されていません。","ru-RU":"Диаграмма не отображается, поскольку она содержит только неопределенные значения."}},Object_Disclaimer_OnlyNegativeValues:{id:"Object.Disclaimer.OnlyNegativeValues",locale:{"en-US":"The chart is not displayed because it contains only negative values.","zh-TW":"系統不會顯示圖表,因為該圖表僅包含負值。","zh-CN":"未显示图表,因为它仅包含负值。","tr-TR":"Yalnızca negatif değerleri içermesi nedeniyle grafik görüntülenmiyor.","sv-SE":"Diagrammet visas inte eftersom det endast innehåller negativa värden.","it-IT":"Il grafico non viene visualizzato poiché contiene solo valori negativi.","es-ES":"El gráfico no se muestra porque solo contiene valores negativos.","de-DE":"Das Diagramm wird nicht angezeigt, da es nur negative oder Werte enthält.","pl-PL":"Wykres nie jest wyświetlany, ponieważ zawiera wyłącznie wartości ujemne.","nl-NL":"Het diagram wordt niet weergegeven omdat deze alleen negatieve waarden bevat.","ko-KR":"음수 값만 포함되어 있으므로 차트가 표시되지 않습니다.","pt-BR":"O gráfico não é exibido porque contém apenas valores negativos.","fr-FR":"Le graphique n'est pas affiché, car il contient uniquement des valeurs négatives.","ja-JP":"負の値しか含まれていないため、チャートは表示されていません。","ru-RU":"Диаграмма не отображается, поскольку она содержит только отрицательные значения."}},Object_Disclaimer_NegativeValues:{id:"Object.Disclaimer.NegativeValues",locale:{"en-US":"The data set contains negative values that cannot be shown in this chart.","zh-TW":"資料集包含無法在此圖表中顯示的負值。","zh-CN":"数据集包含无法在此图表中显示的负值。","tr-TR":"Veri kümesi, bu grafikte gösterilemeyen negatif değerleri içeriyor.","sv-SE":"Datauppsättningen innehåller negativa värden som inte kan visas i det här diagrammet.","it-IT":"Il set di dati contiene valori negativi che non possono essere visualizzati in questo grafico.","es-ES":"El conjunto de datos contiene valores negativos que no se pueden mostrar en este gráfico.","de-DE":"Die in den Datensätzen enthaltenen negativen Werte können nicht in diesem Diagramm dargestellt werden.","pl-PL":"Zestaw danych zawiera wartości ujemne, których nie można przedstawić na tym wykresie.","nl-NL":"De gegevensverzameling bevat negatieve waarden die niet kunnen worden weergegeven in dit diagram.","ko-KR":"데이터 집합에 해당 차트에 표시할 수 없는 음수 값이 포함되어 있습니다.","pt-BR":"O conjunto de dados contém valores negativos que não podem ser mostrados neste gráfico.","fr-FR":"Le jeu de données contient des valeurs négatives impossibles à afficher dans ce graphique.","ja-JP":"このチャートには表示できない負の値がデータ セットに含まれています。","ru-RU":"Набор данных содержит отрицательные значения, которые нельзя отобразить на этой диаграмме."}},Object_ChartTooltip_NMore:{id:"Object.ChartTooltip.NMore",locale:{"en-US":"+{0} more","zh-TW":"再加 {0} 個","zh-CN":"+{0} 个","tr-TR":"+{0} öğe daha","sv-SE":"+{0} till","it-IT":"Altre +{0}","es-ES":"+{0} más","de-DE":"+{0} mehr","pl-PL":"+ {0} więcej","nl-NL":"+ {0} meer","ko-KR":"+추가 {0}개","pt-BR":"+{0} mais","fr-FR":"+ {0} de plus","ja-JP":"さらに {0}","ru-RU":"+ дополнительно: {0}"}},Object_ChartTooltip_sumOfPositives:{id:"Object.ChartTooltip.sumOfPositives",locale:{"en-US":"Sum of positives","zh-TW":"正數總和","zh-CN":"正值总和","tr-TR":"Pozitif değerlerin toplamı","sv-SE":"Summan av positiva","it-IT":"Somma valori positivi","es-ES":"Suma de positivos","de-DE":"Summe positiver Werte","pl-PL":"Suma dodatnich","nl-NL":"Som positieven","ko-KR":"양수 합계","pt-BR":"Soma de positivos","fr-FR":"Sommes des valeurs positives","ja-JP":"正の合計","ru-RU":"Сумма положительных значений"}},Object_ChartTooltip_sumOfNegatives:{id:"Object.ChartTooltip.sumOfNegatives",locale:{"en-US":"Sum of negatives","zh-TW":"負數總和","zh-CN":"负值总和","tr-TR":"Negatif değerlerin toplamı","sv-SE":"Summan av negativa","it-IT":"Somma valori negativi","es-ES":"Suma de negativos","de-DE":"Summe negativer Werte","pl-PL":"Suma ujemnych","nl-NL":"Som negatieven","ko-KR":"음수 합계","pt-BR":"Soma de negativos","fr-FR":"Somme des valeurs négatives","ja-JP":"負の合計","ru-RU":"Сумма отрицательных значений"}},Object_ChartTooltip_ColorExpression:{id:"Object.ChartTooltip.ColorExpression",locale:{"en-US":"Color expression","zh-TW":"色彩運算式","zh-CN":"颜色表达式","tr-TR":"Renk ifadesi","sv-SE":"Färguttryck","it-IT":"Espressione colore","es-ES":"Expresión de color","de-DE":"Farbformel","pl-PL":"Wyrażenie koloru","nl-NL":"Kleuruitdrukking","ko-KR":"색상 표현식","pt-BR":"Expressão de cor","fr-FR":"Expression de couleur","ja-JP":"カラー表現","ru-RU":"Выражение для цвета"}},Object_Disclaimer_OnlyNanColor:{id:"Object.Disclaimer.OnlyNanColor",locale:{"en-US":"The data used to color this visualization only contains undefined values.","zh-TW":"用以定義此視覺化的色彩的資料只包含未定義的值。","zh-CN":"用于将该可视化着色的数据仅包含未定义的值。","tr-TR":"Bu görselleştirmeyi renklendirmek için kullanılan veriler yalnızca tanımlanmamış değerler içeriyor.","sv-SE":"Data som används för att färgsätta denna visualisering innehåller enbart odefinierade värden.","it-IT":"I dati utilizzati per colorare questa visualizzazione contengono solo valori non definiti.","es-ES":"Los datos utilizados para colorear esta visualización solo contienen valores indefinidos.","de-DE":"Die verwendeten Daten für die Farbgebung dieser Visualisierung enthalten undefinierte Werte.","pl-PL":"Dane używane do kolorowania tej wizualizacji zawierają wyłącznie niezdefiniowane wartości.","nl-NL":"De gegevens die worden gebruikt om deze visualisatie kleur te geven bevatten uitsluitend ongedefinieerde waarden.","ko-KR":"이 시각화에 색을 지정하는 데 사용된 데이터에는 정의되지 않은 값만 포함되어 있습니다.","pt-BR":"Os dados usados para colorir esse visualização contém somente valores indefinidos.","fr-FR":"Les données utilisées pour colorer cette visualisation ne comportent que des valeurs non définies.","ja-JP":"このビジュアライゼーションの色の割り当てに使用したデータには、未定義の値が含まれています。","ru-RU":"Данные, используемые для выбора цвета визуализации, содержат только неопределенные значения."}},properties_trendlines_types_average:{id:"properties.trendlines.types.average",locale:{"en-US":"Average","zh-TW":"平均值","zh-CN":"平均值","tr-TR":"Ortalama","sv-SE":"Medel","it-IT":"Media","es-ES":"Media","de-DE":"Durchschnitt","pl-PL":"Średnia","nl-NL":"Gemiddelde","ko-KR":"평균","pt-BR":"Média","fr-FR":"Moyenne","ja-JP":"平均値","ru-RU":"Среднее"}},properties_trendlines_types_linear:{id:"properties.trendlines.types.linear",locale:{"en-US":"Linear","zh-TW":"線性","zh-CN":"线性","tr-TR":"Doğrusal","sv-SE":"Linjär","it-IT":"Lineare","es-ES":"Lineal","de-DE":"Linear","pl-PL":"Liniowa","nl-NL":"Lineair","ko-KR":"선형","pt-BR":"Linear","fr-FR":"Linéaire","ja-JP":"線形","ru-RU":"Линейный"}},properties_trendlines_types_polynomial2:{id:"properties.trendlines.types.polynomial2",locale:{"en-US":"Second degree polynomial","zh-TW":"第二度多項式","zh-CN":"二次多项式","tr-TR":"İkinci derece polinom","sv-SE":"Polynomial, andra graden","it-IT":"Polinomio di secondo grado","es-ES":"Polinómica de segundo grado","de-DE":"Polynom zweiten Grades","pl-PL":"Wielomianowa drugiego stopnia","nl-NL":"Tweedegraadspolynoom","ko-KR":"2차 다항식","pt-BR":"Polinômio de segundo grau","fr-FR":"Polynomial du 2ème degré","ja-JP":"2 番目の角度の多項式近似","ru-RU":"Полиномиальный второй степени"}},properties_trendlines_types_polynomial3:{id:"properties.trendlines.types.polynomial3",locale:{"en-US":"Third degree polynomial","zh-TW":"第三度多項式","zh-CN":"三次多项式","tr-TR":"Üçüncü derece polinom","sv-SE":"Polynomial, tredje graden","it-IT":"Polinomio di terzo grado","es-ES":"Polinómica de tercer grado","de-DE":"Polynom dritten Grades","pl-PL":"Wielomianowa trzeciego stopnia","nl-NL":"Derdegraadspolynoom","ko-KR":"3차 다항식","pt-BR":"Polinômio de terceiro grau","fr-FR":"Polynomial du 3ème degré","ja-JP":"3 番目の角度の多項式近似","ru-RU":"Полиномиальный третьей степени"}},properties_trendlines_types_polynomial4:{id:"properties.trendlines.types.polynomial4",locale:{"en-US":"Fourth degree polynomial","zh-TW":"第四度多項式","zh-CN":"四次多项式","tr-TR":"Dördüncü derece polinom","sv-SE":"Polynomial, fjärde graden","it-IT":"Polinomio di quarto grado","es-ES":"Polinómica de cuarto grado","de-DE":"Polynom vierten Grades","pl-PL":"Wielomianowa czwartego stopnia","nl-NL":"Vierdegraadspolynoom","ko-KR":"4차 다항식","pt-BR":"Polinômio de quarto grau","fr-FR":"Polynomial du 4ème degré","ja-JP":"4 番目の角度の多項式近似","ru-RU":"Полиномиальный четвертой степени"}},properties_trendlines_types_exponential:{id:"properties.trendlines.types.exponential",locale:{"en-US":"Exponential","zh-TW":"指數","zh-CN":"指数","tr-TR":"Üstel","sv-SE":"Exponentiell","it-IT":"Esponenziale","es-ES":"Exponencial","de-DE":"Exponentiell","pl-PL":"Wykładnicze","nl-NL":"Exponentieel","ko-KR":"지수","pt-BR":"Exponencial","fr-FR":"Exponentiel","ja-JP":"指数","ru-RU":"Экспоненциальный"}},properties_trendlines_types_logarithmic:{id:"properties.trendlines.types.logarithmic",locale:{"en-US":"Logarithmic","zh-TW":"對數","zh-CN":"对数","tr-TR":"Logaritmik","sv-SE":"Logaritmisk","it-IT":"Logaritmica","es-ES":"Logarítmica","de-DE":"Logarithmisch","pl-PL":"Logarytmiczna","nl-NL":"Logaritmisch","ko-KR":"로그","pt-BR":"Logarítmico","fr-FR":"Logarithmique","ja-JP":"対数","ru-RU":"Логарифмический"}},properties_trendlines_types_power:{id:"properties.trendlines.types.power",locale:{"en-US":"Power","zh-TW":"乘冪","zh-CN":"幂","tr-TR":"Üs","sv-SE":"Potens","it-IT":"Potenza","es-ES":"Potencia","de-DE":"Potenz","pl-PL":"Potęgowa","nl-NL":"Macht","ko-KR":"거듭제곱","pt-BR":"Potência","fr-FR":"Puissance","ja-JP":"累乗","ru-RU":"Силовой"}},Common_Measures:{id:"Common.Measures",locale:{"en-US":"Measures","de-DE":"Kennzahlen","fr-FR":"Mesures","it-IT":"Misure","ja-JP":"メジャー","ko-KR":"측정값","es-ES":"Medidas","nl-NL":"Metingen","pl-PL":"Miary","pt-BR":"Medidas","sv-SE":"Mått","tr-TR":"Hesaplamalar","zh-CN":"度量","zh-TW":"量值","ru-RU":"Меры"}},Tooltip_ToggleOnLassoSelection:{id:"Tooltip.ToggleOnLassoSelection",locale:{"en-US":"Turn on lasso selection","de-DE":"Lasso-Auswahl aktivieren","fr-FR":"Activer la sélection au lasso","it-IT":"Attiva selezione lazo","ja-JP":"囲み選択をオンにする","ko-KR":"올가미 선택 켜기","es-ES":"Activar la selección de contorno","nl-NL":"Lassoselectie inschakelen","pl-PL":"Włącz zaznaczenie lasso","pt-BR":"Ativar seleção de laço","sv-SE":"Slå på lassourval","tr-TR":"Serbest seçimi aç","zh-CN":"开启套索选择方法","zh-TW":"開啟套索選取","ru-RU":"Включить выбор лассо"}},Tooltip_ToggleOffLassoSelection:{id:"Tooltip.ToggleOffLassoSelection",locale:{"en-US":"Turn off lasso selection","de-DE":"Lasso-Auswahl deaktivieren","fr-FR":"Désactiver la sélection au lasso","it-IT":"Disattiva selezione lazo","ja-JP":"囲み選択をオフにする","ko-KR":"올가미 선택 끄기","es-ES":"Desactivar la selección de contorno","nl-NL":"Lassoselectie uitschakelen","pl-PL":"Wyłącz zaznaczenie lasso","pt-BR":"Desativar seleção de laço","sv-SE":"Stäng av lassourval","tr-TR":"Serbest seçimi kapat","zh-CN":"关闭套索选择方法","zh-TW":"關閉套索選取","ru-RU":"Выключить выбор лассо"}}};var n=Object.prototype.hasOwnProperty,i=Object.prototype.toString,r=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===i.call(e)},s=function(e){if(!e||"[object Object]"!==i.call(e))return!1;var t,r=n.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!r&&!o)return!1;for(t in e);return void 0===t||n.call(e,t)},l=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},c=function(e,t){if("__proto__"===t){if(!n.call(e,t))return;if(o)return o(e,t).value}return e[t]},u=function e(){var t,n,i,r,o,u,h=arguments[0],d=1,f=arguments.length,p=!1;for("boolean"==typeof h&&(p=h,h=arguments[1]||{},d=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)i=c(h,n),h!==(r=c(t,n))&&(p&&r&&(s(r)||(o=a(r)))?(o?(o=!1,u=i&&a(i)?i:[]):u=i&&s(i)?i:{},l(h,{name:n,newValue:e(p,u,r)})):void 0!==r&&l(h,{name:n,newValue:r}));return h},h="2.8.2";function d(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t);if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach((function(t){d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function g(e){return!!e.changedTouches}function m(e){return"number"==typeof e&&!isNaN(e)}function y(e){return"number"!=typeof e||isNaN(e)}function v(e){const t=e.length;let n=NaN,i=NaN,r=NaN,o=NaN;for(let a=0;a<t;a++)n=isNaN(n)?e[a].x:Math.min(n,e[a].x),i=isNaN(i)?e[a].x:Math.max(i,e[a].x),r=isNaN(r)?e[a].y:Math.min(r,e[a].y),o=isNaN(o)?e[a].y:Math.max(o,e[a].y);return[n,r,i,o]}function x(e){return[{x:e.x1||0,y:e.y1||0},{x:e.x2||0,y:e.y2||0}]}function b(e){return[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}]}function w(e){const[t,n,i,r]=v(e);return{x:t,y:n,width:i-t,height:r-n}}function k(e){return{x1:e[0].x,y1:e[0].y,x2:e[1].x,y2:e[1].y}}function _(e){const{x:t,y:n,width:i,height:r,x1:o,x2:a,y1:s,y2:l,cx:c,cy:u,r:h,vertices:d}=e||{};return m(c)&&m(u)&&m(h)?"circle":m(o)&&m(a)&&m(s)&&m(l)?"line":m(t)&&m(n)&&m(i)&&m(r)?"rect":m(t)&&m(n)?"point":Array.isArray(d)?d.every((e=>Array.isArray(e)))?"geopolygon":"polygon":null}function M(e,t){return{x:t.x-e,y:t.y-e,width:t.width+e,height:t.height+e}}var S=Math.PI,R=2*S,C=1e-6,N=R-C;function D(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function q(){return new D}function E(e){return function(){return e}}D.prototype=q.prototype={constructor:D,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,n,i){this._+="Q"+ +e+","+ +t+","+(this._x1=+n)+","+(this._y1=+i)},bezierCurveTo:function(e,t,n,i,r,o){this._+="C"+ +e+","+ +t+","+ +n+","+ +i+","+(this._x1=+r)+","+(this._y1=+o)},arcTo:function(e,t,n,i,r){e=+e,t=+t,n=+n,i=+i,r=+r;var o=this._x1,a=this._y1,s=n-e,l=i-t,c=o-e,u=a-t,h=c*c+u*u;if(r<0)throw new Error("negative radius: "+r);if(null===this._x1)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(h>C)if(Math.abs(u*s-l*c)>C&&r){var d=n-o,f=i-a,p=s*s+l*l,g=d*d+f*f,m=Math.sqrt(p),y=Math.sqrt(h),v=r*Math.tan((S-Math.acos((p+h-g)/(2*m*y)))/2),x=v/y,b=v/m;Math.abs(x-1)>C&&(this._+="L"+(e+x*c)+","+(t+x*u)),this._+="A"+r+","+r+",0,0,"+ +(u*d>c*f)+","+(this._x1=e+b*s)+","+(this._y1=t+b*l)}else this._+="L"+(this._x1=e)+","+(this._y1=t);else;},arc:function(e,t,n,i,r,o){e=+e,t=+t,o=!!o;var a=(n=+n)*Math.cos(i),s=n*Math.sin(i),l=e+a,c=t+s,u=1^o,h=o?i-r:r-i;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+l+","+c:(Math.abs(this._x1-l)>C||Math.abs(this._y1-c)>C)&&(this._+="L"+l+","+c),n&&(h<0&&(h=h%R+R),h>N?this._+="A"+n+","+n+",0,1,"+u+","+(e-a)+","+(t-s)+"A"+n+","+n+",0,1,"+u+","+(this._x1=l)+","+(this._y1=c):h>C&&(this._+="A"+n+","+n+",0,"+ +(h>=S)+","+u+","+(this._x1=e+n*Math.cos(r))+","+(this._y1=t+n*Math.sin(r))))},rect:function(e,t,n,i){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +n+"v"+ +i+"h"+-n+"Z"},toString:function(){return this._}};var O=Math.abs,z=Math.atan2,A=Math.cos,T=Math.max,I=Math.min,j=Math.sin,P=Math.sqrt,F=1e-12,L=Math.PI,$=L/2,B=2*L;function H(e){return e>=1?$:e<=-1?-$:Math.asin(e)}function W(e){return e.innerRadius}function V(e){return e.outerRadius}function U(e){return e.startAngle}function Y(e){return e.endAngle}function K(e){return e&&e.padAngle}function X(e,t,n,i,r,o,a){var s=e-n,l=t-i,c=(a?o:-o)/P(s*s+l*l),u=c*l,h=-c*s,d=e+u,f=t+h,p=n+u,g=i+h,m=(d+p)/2,y=(f+g)/2,v=p-d,x=g-f,b=v*v+x*x,w=r-o,k=d*g-p*f,_=(x<0?-1:1)*P(T(0,w*w*b-k*k)),M=(k*x-v*_)/b,S=(-k*v-x*_)/b,R=(k*x+v*_)/b,C=(-k*v+x*_)/b,N=M-m,D=S-y,q=R-m,E=C-y;return N*N+D*D>q*q+E*E&&(M=R,S=C),{cx:M,cy:S,x01:-u,y01:-h,x11:M*(r/w-1),y11:S*(r/w-1)}}function G(){var e=W,t=V,n=E(0),i=null,r=U,o=Y,a=K,s=null;function l(){var l,c,u=+e.apply(this,arguments),h=+t.apply(this,arguments),d=r.apply(this,arguments)-$,f=o.apply(this,arguments)-$,p=O(f-d),g=f>d;if(s||(s=l=q()),h<u&&(c=h,h=u,u=c),h>F)if(p>B-F)s.moveTo(h*A(d),h*j(d)),s.arc(0,0,h,d,f,!g),u>F&&(s.moveTo(u*A(f),u*j(f)),s.arc(0,0,u,f,d,g));else{var m,y,v=d,x=f,b=d,w=f,k=p,_=p,M=a.apply(this,arguments)/2,S=M>F&&(i?+i.apply(this,arguments):P(u*u+h*h)),R=I(O(h-u)/2,+n.apply(this,arguments)),C=R,N=R;if(S>F){var D=H(S/u*j(M)),E=H(S/h*j(M));(k-=2*D)>F?(b+=D*=g?1:-1,w-=D):(k=0,b=w=(d+f)/2),(_-=2*E)>F?(v+=E*=g?1:-1,x-=E):(_=0,v=x=(d+f)/2)}var T=h*A(v),W=h*j(v),V=u*A(w),U=u*j(w);if(R>F){var Y,K=h*A(x),G=h*j(x),J=u*A(b),Z=u*j(b);if(p<L&&(Y=function(e,t,n,i,r,o,a,s){var l=n-e,c=i-t,u=a-r,h=s-o,d=h*l-u*c;if(!(d*d<F))return[e+(d=(u*(t-o)-h*(e-r))/d)*l,t+d*c]}(T,W,J,Z,K,G,V,U))){var Q=T-Y[0],ee=W-Y[1],te=K-Y[0],ne=G-Y[1],ie=1/j(function(e){return e>1?0:e<-1?L:Math.acos(e)}((Q*te+ee*ne)/(P(Q*Q+ee*ee)*P(te*te+ne*ne)))/2),re=P(Y[0]*Y[0]+Y[1]*Y[1]);C=I(R,(u-re)/(ie-1)),N=I(R,(h-re)/(ie+1))}}_>F?N>F?(m=X(J,Z,T,W,h,N,g),y=X(K,G,V,U,h,N,g),s.moveTo(m.cx+m.x01,m.cy+m.y01),N<R?s.arc(m.cx,m.cy,N,z(m.y01,m.x01),z(y.y01,y.x01),!g):(s.arc(m.cx,m.cy,N,z(m.y01,m.x01),z(m.y11,m.x11),!g),s.arc(0,0,h,z(m.cy+m.y11,m.cx+m.x11),z(y.cy+y.y11,y.cx+y.x11),!g),s.arc(y.cx,y.cy,N,z(y.y11,y.x11),z(y.y01,y.x01),!g))):(s.moveTo(T,W),s.arc(0,0,h,v,x,!g)):s.moveTo(T,W),u>F&&k>F?C>F?(m=X(V,U,K,G,u,-C,g),y=X(T,W,J,Z,u,-C,g),s.lineTo(m.cx+m.x01,m.cy+m.y01),C<R?s.arc(m.cx,m.cy,C,z(m.y01,m.x01),z(y.y01,y.x01),!g):(s.arc(m.cx,m.cy,C,z(m.y01,m.x01),z(m.y11,m.x11),!g),s.arc(0,0,u,z(m.cy+m.y11,m.cx+m.x11),z(y.cy+y.y11,y.cx+y.x11),g),s.arc(y.cx,y.cy,C,z(y.y11,y.x11),z(y.y01,y.x01),!g))):s.arc(0,0,u,w,b,g):s.lineTo(V,U)}else s.moveTo(0,0);if(s.closePath(),l)return s=null,l+""||null}return l.centroid=function(){var n=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,i=(+r.apply(this,arguments)+ +o.apply(this,arguments))/2-L/2;return[A(i)*n,j(i)*n]},l.innerRadius=function(t){return arguments.length?(e="function"==typeof t?t:E(+t),l):e},l.outerRadius=function(e){return arguments.length?(t="function"==typeof e?e:E(+e),l):t},l.cornerRadius=function(e){return arguments.length?(n="function"==typeof e?e:E(+e),l):n},l.padRadius=function(e){return arguments.length?(i=null==e?null:"function"==typeof e?e:E(+e),l):i},l.startAngle=function(e){return arguments.length?(r="function"==typeof e?e:E(+e),l):r},l.endAngle=function(e){return arguments.length?(o="function"==typeof e?e:E(+e),l):o},l.padAngle=function(e){return arguments.length?(a="function"==typeof e?e:E(+e),l):a},l.context=function(e){return arguments.length?(s=null==e?null:e,l):s},l}function J(e){this._context=e}function Z(e){return new J(e)}function Q(e){return e[0]}function ee(e){return e[1]}function te(){var e=Q,t=null,n=E(0),i=ee,r=E(!0),o=null,a=Z,s=null;function l(l){var c,u,h,d,f,p=l.length,g=!1,m=new Array(p),y=new Array(p);for(null==o&&(s=a(f=q())),c=0;c<=p;++c){if(!(c<p&&r(d=l[c],c,l))===g)if(g=!g)u=c,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),h=c-1;h>=u;--h)s.point(m[h],y[h]);s.lineEnd(),s.areaEnd()}g&&(m[c]=+e(d,c,l),y[c]=+n(d,c,l),s.point(t?+t(d,c,l):m[c],i?+i(d,c,l):y[c]))}if(f)return s=null,f+""||null}function c(){return function(){var e=Q,t=ee,n=E(!0),i=null,r=Z,o=null;function a(a){var s,l,c,u=a.length,h=!1;for(null==i&&(o=r(c=q())),s=0;s<=u;++s)!(s<u&&n(l=a[s],s,a))===h&&((h=!h)?o.lineStart():o.lineEnd()),h&&o.point(+e(l,s,a),+t(l,s,a));if(c)return o=null,c+""||null}return a.x=function(t){return arguments.length?(e="function"==typeof t?t:E(+t),a):e},a.y=function(e){return arguments.length?(t="function"==typeof e?e:E(+e),a):t},a.defined=function(e){return arguments.length?(n="function"==typeof e?e:E(!!e),a):n},a.curve=function(e){return arguments.length?(r=e,null!=i&&(o=r(i)),a):r},a.context=function(e){return arguments.length?(null==e?i=o=null:o=r(i=e),a):i},a}().defined(r).curve(a).context(o)}return l.x=function(n){return arguments.length?(e="function"==typeof n?n:E(+n),t=null,l):e},l.x0=function(t){return arguments.length?(e="function"==typeof t?t:E(+t),l):e},l.x1=function(e){return arguments.length?(t=null==e?null:"function"==typeof e?e:E(+e),l):t},l.y=function(e){return arguments.length?(n="function"==typeof e?e:E(+e),i=null,l):n},l.y0=function(e){return arguments.length?(n="function"==typeof e?e:E(+e),l):n},l.y1=function(e){return arguments.length?(i=null==e?null:"function"==typeof e?e:E(+e),l):i},l.lineX0=l.lineY0=function(){return c().x(e).y(n)},l.lineY1=function(){return c().x(e).y(i)},l.lineX1=function(){return c().x(t).y(n)},l.defined=function(e){return arguments.length?(r="function"==typeof e?e:E(!!e),l):r},l.curve=function(e){return arguments.length?(a=e,null!=o&&(s=a(o)),l):a},l.context=function(e){return arguments.length?(null==e?o=s=null:s=a(o=e),l):o},l}function ne(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function ie(e){return e}J.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}};var re=Array.prototype.slice;function oe(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function ae(e){this._context=e}function se(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function le(e,t){this._context=e,this._k=(1-t)/6}ae.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:oe(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:oe(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},le.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:se(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:se(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var ce=function e(t){function n(e){return new le(e,t)}return n.tension=function(t){return e(+t)},n}(0);function ue(e,t){this._context=e,this._alpha=t}ue.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:!function(e,t,n){var i=e._x1,r=e._y1,o=e._x2,a=e._y2;if(e._l01_a>F){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);i=(i*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,r=(r*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>F){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*c+e._x1*e._l23_2a-t*e._l12_2a)/u,a=(a*c+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(i,r,o,a,e._x2,e._y2)}(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var he=function e(t){function n(e){return t?new ue(e,t):new le(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function de(e){return e<0?-1:1}function fe(e,t,n){var i=e._x1-e._x0,r=t-e._x1,o=(e._y1-e._y0)/(i||r<0&&-0),a=(n-e._y1)/(r||i<0&&-0),s=(o*r+a*i)/(i+r);return(de(o)+de(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function pe(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function ge(e,t,n){var i=e._x0,r=e._y0,o=e._x1,a=e._y1,s=(o-i)/3;e._context.bezierCurveTo(i+s,r+s*t,o-s,a-s*n,o,a)}function me(e){this._context=e}function ye(e){this._context=new ve(e)}function ve(e){this._context=e}function xe(e){this._context=e}function be(e){var t,n,i=e.length-1,r=new Array(i),o=new Array(i),a=new Array(i);for(r[0]=0,o[0]=2,a[0]=e[0]+2*e[1],t=1;t<i-1;++t)r[t]=1,o[t]=4,a[t]=4*e[t]+2*e[t+1];for(r[i-1]=2,o[i-1]=7,a[i-1]=8*e[i-1]+e[i],t=1;t<i;++t)n=r[t]/o[t-1],o[t]-=n,a[t]-=n*a[t-1];for(r[i-1]=a[i-1]/o[i-1],t=i-2;t>=0;--t)r[t]=(a[t]-r[t+1])/o[t];for(o[i-1]=(e[i]+r[i-1])/2,t=0;t<i-1;++t)o[t]=2*e[t+1]-r[t+1];return[r,o]}function we(e,t){this._context=e,this._t=t}function ke(e,t){if((r=e.length)>1)for(var n,i,r,o=1,a=e[t[0]],s=a.length;o<r;++o)for(i=a,a=e[t[o]],n=0;n<s;++n)a[n][1]+=a[n][0]=isNaN(i[n][1])?i[n][0]:i[n][1]}function _e(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function Me(e,t){return e[t]}function Se(e){for(var t,n=-1,i=0,r=e.length,o=-1/0;++n<r;)(t=+e[n][1])>o&&(o=t,i=n);return i}function Re(e){for(var t,n=0,i=-1,r=e.length;++i<r;)(t=+e[i][1])&&(n+=t);return n}function Ce(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unspecified",i=arguments.length>2?arguments[2]:void 0;const r={},o=e||{get:()=>{},has:()=>!1,default:()=>{}};function a(e,t){if(!e||"string"!=typeof e)throw new TypeError("Invalid argument: key must be a non-empty string");return!(e in r)&&(r[e]=t,!0)}function s(e){return r[e]||o.get(e)}function l(e,r){if(void 0!==r)return a(e,r);const o=s(e);return i&&void 0===o&&i.warn("".concat(e," does not exist in ").concat(n," registry")),o||s(t)}return t=o.default(),l.add=a,l.get=s,l.has=function(e){return!!r[e]||o.has(e)},l.remove=function(e){const t=r[e];return delete r[e],t},l.getKeys=function(){return Object.keys(r)},l.getValues=function(){return Object.keys(r).map((e=>r[e]))},l.default=function(e){return void 0!==e&&(t=e),t},l.register=a,l}function Ne(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,i=e.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+e.slice(n+1)]}function De(e){return(e=Ne(Math.abs(e)))?e[1]:NaN}me.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:ge(this,this._t0,pe(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(t=+t,(e=+e)!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,ge(this,pe(this,n=fe(this,e,t)),n);break;default:ge(this,this._t0,n=fe(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}},(ye.prototype=Object.create(me.prototype)).point=function(e,t){me.prototype.point.call(this,t,e)},ve.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,i,r,o){this._context.bezierCurveTo(t,e,i,n,o,r)}},xe.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),2===n)this._context.lineTo(e[1],t[1]);else for(var i=be(e),r=be(t),o=0,a=1;a<n;++o,++a)this._context.bezierCurveTo(i[0][o],r[0][o],i[1][o],r[1][o],e[a],t[a]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}},we.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}};var qe,Ee=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Oe(e){if(!(t=Ee.exec(e)))throw new Error("invalid format: "+e);var t;return new ze({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function ze(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function Ae(e,t){var n=Ne(e,t);if(!n)return e+"";var i=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")}Oe.prototype=ze.prototype,ze.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var Te={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>Ae(100*e,t),r:Ae,s:function(e,t){var n=Ne(e,t);if(!n)return e+"";var i=n[0],r=n[1],o=r-(qe=3*Math.max(-8,Math.min(8,Math.floor(r/3))))+1,a=i.length;return o===a?i:o>a?i+new Array(o-a+1).join("0"):o>0?i.slice(0,o)+"."+i.slice(o):"0."+new Array(1-o).join("0")+Ne(e,Math.max(0,t+o-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Ie(e){return e}var je,Pe,Fe,Le=Array.prototype.map,$e=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Be(e){var t,n,i=void 0===e.grouping||void 0===e.thousands?Ie:(t=Le.call(e.grouping,Number),n=e.thousands+"",function(e,i){for(var r=e.length,o=[],a=0,s=t[0],l=0;r>0&&s>0&&(l+s+1>i&&(s=Math.max(1,i-l)),o.push(e.substring(r-=s,r+s)),!((l+=s+1)>i));)s=t[a=(a+1)%t.length];return o.reverse().join(n)}),r=void 0===e.currency?"":e.currency[0]+"",o=void 0===e.currency?"":e.currency[1]+"",a=void 0===e.decimal?".":e.decimal+"",s=void 0===e.numerals?Ie:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(Le.call(e.numerals,String)),l=void 0===e.percent?"%":e.percent+"",c=void 0===e.minus?"−":e.minus+"",u=void 0===e.nan?"NaN":e.nan+"";function h(e){var t=(e=Oe(e)).fill,n=e.align,h=e.sign,d=e.symbol,f=e.zero,p=e.width,g=e.comma,m=e.precision,y=e.trim,v=e.type;"n"===v?(g=!0,v="g"):Te[v]||(void 0===m&&(m=12),y=!0,v="g"),(f||"0"===t&&"="===n)&&(f=!0,t="0",n="=");var x="$"===d?r:"#"===d&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",b="$"===d?o:/[%p]/.test(v)?l:"",w=Te[v],k=/[defgprs%]/.test(v);function _(e){var r,o,l,d=x,_=b;if("c"===v)_=w(e)+_,e="";else{var M=(e=+e)<0||1/e<0;if(e=isNaN(e)?u:w(Math.abs(e),m),y&&(e=function(e){e:for(var t,n=e.length,i=1,r=-1;i<n;++i)switch(e[i]){case".":r=t=i;break;case"0":0===r&&(r=i),t=i;break;default:if(!+e[i])break e;r>0&&(r=0)}return r>0?e.slice(0,r)+e.slice(t+1):e}(e)),M&&0==+e&&"+"!==h&&(M=!1),d=(M?"("===h?h:c:"-"===h||"("===h?"":h)+d,_=("s"===v?$e[8+qe/3]:"")+_+(M&&"("===h?")":""),k)for(r=-1,o=e.length;++r<o;)if(48>(l=e.charCodeAt(r))||l>57){_=(46===l?a+e.slice(r+1):e.slice(r))+_,e=e.slice(0,r);break}}g&&!f&&(e=i(e,1/0));var S=d.length+e.length+_.length,R=S<p?new Array(p-S+1).join(t):"";switch(g&&f&&(e=i(R+e,R.length?p-_.length:1/0),R=""),n){case"<":e=d+e+_+R;break;case"=":e=d+R+e+_;break;case"^":e=R.slice(0,S=R.length>>1)+d+e+_+R.slice(S);break;default:e=R+d+e+_}return s(e)}return m=void 0===m?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),_.toString=function(){return e+""},_}return{format:h,formatPrefix:function(e,t){var n=h(((e=Oe(e)).type="f",e)),i=3*Math.max(-8,Math.min(8,Math.floor(De(t)/3))),r=Math.pow(10,-i),o=$e[8+i/3];return function(e){return n(r*e)+o}}}}!function(e){je=Be(e),Pe=je.format,Fe=je.formatPrefix}({thousands:",",grouping:[3],currency:["$",""]});const He=new Date,We=new Date;function Ve(e,t,n,i){function r(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return r.floor=t=>(e(t=new Date(+t)),t),r.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),r.round=e=>{const t=r(e),n=r.ceil(e);return e-t<n-e?t:n},r.offset=(e,n)=>(t(e=new Date(+e),null==n?1:Math.floor(n)),e),r.range=(n,i,o)=>{const a=[];if(n=r.ceil(n),o=null==o?1:Math.floor(o),!(n<i&&o>0))return a;let s;do{a.push(s=new Date(+n)),t(n,o),e(n)}while(s<n&&n<i);return a},r.filter=n=>Ve((t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)}),((e,i)=>{if(e>=e)if(i<0)for(;++i<=0;)for(;t(e,-1),!n(e););else for(;--i>=0;)for(;t(e,1),!n(e););})),n&&(r.count=(t,i)=>(He.setTime(+t),We.setTime(+i),e(He),e(We),Math.floor(n(He,We))),r.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?r.filter(i?t=>i(t)%e==0:t=>r.count(0,t)%e==0):r:null)),r}const Ue=6e4,Ye=864e5,Ke=6048e5,Xe=Ve((e=>e.setHours(0,0,0,0)),((e,t)=>e.setDate(e.getDate()+t)),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Ue)/Ye),(e=>e.getDate()-1));Xe.range;const Ge=Ve((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/Ye),(e=>e.getUTCDate()-1));Ge.range;const Je=Ve((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/Ye),(e=>Math.floor(e/Ye)));function Ze(e){return Ve((t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),((e,t)=>{e.setDate(e.getDate()+7*t)}),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Ue)/Ke))}Je.range;const Qe=Ze(0),et=Ze(1),tt=Ze(2),nt=Ze(3),it=Ze(4),rt=Ze(5),ot=Ze(6);function at(e){return Ve((t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+7*t)}),((e,t)=>(t-e)/Ke))}Qe.range,et.range,tt.range,nt.range,it.range,rt.range,ot.range;const st=at(0),lt=at(1),ct=at(2),ut=at(3),ht=at(4),dt=at(5),ft=at(6);st.range,lt.range,ct.range,ut.range,ht.range,dt.range,ft.range;const pt=Ve((e=>{e.setMonth(0,1),e.setHours(0,0,0,0)}),((e,t)=>{e.setFullYear(e.getFullYear()+t)}),((e,t)=>t.getFullYear()-e.getFullYear()),(e=>e.getFullYear()));pt.every=e=>isFinite(e=Math.floor(e))&&e>0?Ve((t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),((t,n)=>{t.setFullYear(t.getFullYear()+n*e)})):null,pt.range;const gt=Ve((e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)}),((e,t)=>t.getUTCFullYear()-e.getUTCFullYear()),(e=>e.getUTCFullYear()));function mt(e,t){return null==e||null==t?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function yt(e,t){return null==e||null==t?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function vt(e){let t,n,i;function r(e,i,r=0,o=e.length){if(r<o){if(0!==t(i,i))return o;do{const t=r+o>>>1;n(e[t],i)<0?r=t+1:o=t}while(r<o)}return r}return 2!==e.length?(t=mt,n=(t,n)=>mt(e(t),n),i=(t,n)=>e(t)-n):(t=e===mt||e===yt?e:xt,n=e,i=e),{left:r,center:function(e,t,n=0,o=e.length){const a=r(e,t,n,o-1);return a>n&&i(e[a-1],t)>-i(e[a],t)?a-1:a},right:function(e,i,r=0,o=e.length){if(r<o){if(0!==t(i,i))return o;do{const t=r+o>>>1;n(e[t],i)<=0?r=t+1:o=t}while(r<o)}return r}}}function xt(){return 0}gt.every=e=>isFinite(e=Math.floor(e))&&e>0?Ve((t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),((t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)})):null,gt.range;const bt=vt(mt).right;vt((function(e){return null===e?NaN:+e})).center;var wt=bt;class kt extends Map{constructor(e,t=Mt){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),null!=e)for(const[t,n]of e)this.set(t,n)}get(e){return super.get(_t(this,e))}has(e){return super.has(_t(this,e))}set(e,t){return super.set(function({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):(e.set(i,n),n)}(this,e),t)}delete(e){return super.delete(function({_intern:e,_key:t},n){const i=t(n);e.has(i)&&(n=e.get(i),e.delete(i));return n}(this,e))}}function _t({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):n}function Mt(e){return null!==e&&"object"==typeof e?e.valueOf():e}const St=Math.sqrt(50),Rt=Math.sqrt(10),Ct=Math.sqrt(2);function Nt(e,t,n){const i=(t-e)/Math.max(0,n),r=Math.floor(Math.log10(i)),o=i/Math.pow(10,r),a=o>=St?10:o>=Rt?5:o>=Ct?2:1;let s,l,c;return r<0?(c=Math.pow(10,-r)/a,s=Math.round(e*c),l=Math.round(t*c),s/c<e&&++s,l/c>t&&--l,c=-c):(c=Math.pow(10,r)*a,s=Math.round(e/c),l=Math.round(t/c),s*c<e&&++s,l*c>t&&--l),l<s&&.5<=n&&n<2?Nt(e,t,2*n):[s,l,c]}function Dt(e,t,n){return Nt(e=+e,t=+t,n=+n)[2]}function qt(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Et(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Ot(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function zt(e){var t=e.dateTime,n=e.date,i=e.time,r=e.periods,o=e.days,a=e.shortDays,s=e.months,l=e.shortMonths,c=Lt(r),u=$t(r),h=Lt(o),d=$t(o),f=Lt(a),p=$t(a),g=Lt(s),m=$t(s),y=Lt(l),v=$t(l),x={a:function(e){return a[e.getDay()]},A:function(e){return o[e.getDay()]},b:function(e){return l[e.getMonth()]},B:function(e){return s[e.getMonth()]},c:null,d:cn,e:cn,f:pn,g:Sn,G:Cn,H:un,I:hn,j:dn,L:fn,m:gn,M:mn,p:function(e){return r[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:Gn,s:Jn,S:yn,u:vn,U:xn,V:wn,w:kn,W:_n,x:null,X:null,y:Mn,Y:Rn,Z:Nn,"%":Xn},b={a:function(e){return a[e.getUTCDay()]},A:function(e){return o[e.getUTCDay()]},b:function(e){return l[e.getUTCMonth()]},B:function(e){return s[e.getUTCMonth()]},c:null,d:Dn,e:Dn,f:An,g:Vn,G:Yn,H:qn,I:En,j:On,L:zn,m:Tn,M:In,p:function(e){return r[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:Gn,s:Jn,S:jn,u:Pn,U:Fn,V:$n,w:Bn,W:Hn,x:null,X:null,y:Wn,Y:Un,Z:Kn,"%":Xn},w={a:function(e,t,n){var i=f.exec(t.slice(n));return i?(e.w=p.get(i[0].toLowerCase()),n+i[0].length):-1},A:function(e,t,n){var i=h.exec(t.slice(n));return i?(e.w=d.get(i[0].toLowerCase()),n+i[0].length):-1},b:function(e,t,n){var i=y.exec(t.slice(n));return i?(e.m=v.get(i[0].toLowerCase()),n+i[0].length):-1},B:function(e,t,n){var i=g.exec(t.slice(n));return i?(e.m=m.get(i[0].toLowerCase()),n+i[0].length):-1},c:function(e,n,i){return M(e,t,n,i)},d:Zt,e:Zt,f:on,g:Kt,G:Yt,H:en,I:en,j:Qt,L:rn,m:Jt,M:tn,p:function(e,t,n){var i=c.exec(t.slice(n));return i?(e.p=u.get(i[0].toLowerCase()),n+i[0].length):-1},q:Gt,Q:sn,s:ln,S:nn,u:Ht,U:Wt,V:Vt,w:Bt,W:Ut,x:function(e,t,i){return M(e,n,t,i)},X:function(e,t,n){return M(e,i,t,n)},y:Kt,Y:Yt,Z:Xt,"%":an};function k(e,t){return function(n){var i,r,o,a=[],s=-1,l=0,c=e.length;for(n instanceof Date||(n=new Date(+n));++s<c;)37===e.charCodeAt(s)&&(a.push(e.slice(l,s)),null!=(r=At[i=e.charAt(++s)])?i=e.charAt(++s):r="e"===i?" ":"0",(o=t[i])&&(i=o(n,r)),a.push(i),l=s+1);return a.push(e.slice(l,s)),a.join("")}}function _(e,t){return function(n){var i,r,o=Ot(1900,void 0,1);if(M(o,e,n+="",0)!=n.length)return null;if("Q"in o)return new Date(o.Q);if("s"in o)return new Date(1e3*o.s+("L"in o?o.L:0));if(t&&!("Z"in o)&&(o.Z=0),"p"in o&&(o.H=o.H%12+12*o.p),void 0===o.m&&(o.m="q"in o?o.q:0),"V"in o){if(o.V<1||o.V>53)return null;"w"in o||(o.w=1),"Z"in o?(r=(i=Et(Ot(o.y,0,1))).getUTCDay(),i=r>4||0===r?lt.ceil(i):lt(i),i=Ge.offset(i,7*(o.V-1)),o.y=i.getUTCFullYear(),o.m=i.getUTCMonth(),o.d=i.getUTCDate()+(o.w+6)%7):(r=(i=qt(Ot(o.y,0,1))).getDay(),i=r>4||0===r?et.ceil(i):et(i),i=Xe.offset(i,7*(o.V-1)),o.y=i.getFullYear(),o.m=i.getMonth(),o.d=i.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),r="Z"in o?Et(Ot(o.y,0,1)).getUTCDay():qt(Ot(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(r+5)%7:o.w+7*o.U-(r+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,Et(o)):qt(o)}}function M(e,t,n,i){for(var r,o,a=0,s=t.length,l=n.length;a<s;){if(i>=l)return-1;if(37===(r=t.charCodeAt(a++))){if(r=t.charAt(a++),!(o=w[r in At?t.charAt(a++):r])||(i=o(e,n,i))<0)return-1}else if(r!=n.charCodeAt(i++))return-1}return i}return x.x=k(n,x),x.X=k(i,x),x.c=k(t,x),b.x=k(n,b),b.X=k(i,b),b.c=k(t,b),{format:function(e){var t=k(e+="",x);return t.toString=function(){return e},t},parse:function(e){var t=_(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=k(e+="",b);return t.toString=function(){return e},t},utcParse:function(e){var t=_(e+="",!0);return t.toString=function(){return e},t}}}var At={"-":"",_:" ",0:"0"},Tt=/^\s*\d+/,It=/^%/,jt=/[\\^$*+?|[\]().{}]/g;function Pt(e,t,n){var i=e<0?"-":"",r=(i?-e:e)+"",o=r.length;return i+(o<n?new Array(n-o+1).join(t)+r:r)}function Ft(e){return e.replace(jt,"\\$&")}function Lt(e){return new RegExp("^(?:"+e.map(Ft).join("|")+")","i")}function $t(e){return new Map(e.map(((e,t)=>[e.toLowerCase(),t])))}function Bt(e,t,n){var i=Tt.exec(t.slice(n,n+1));return i?(e.w=+i[0],n+i[0].length):-1}function Ht(e,t,n){var i=Tt.exec(t.slice(n,n+1));return i?(e.u=+i[0],n+i[0].length):-1}function Wt(e,t,n){var i=Tt.exec(t.slice(n,n+2));return i?(e.U=+i[0],n+i[0].length):-1}function Vt(e,t,n){var i=Tt.exec(t.slice(n,n+2));return i?(e.V=+i[0],n+i[0].length):-1}function Ut(e,t,n){var i=Tt.exec(t.slice(n,n+2));return i?(e.W=+i[0],n+i[0].length):-1}function Yt(e,t,n){var i=Tt.exec(t.slice(n,n+4));return i?(e.y=+i[0],n+i[0].length):-1}function Kt(e,t,n){var i=Tt.exec(t.slice(n,n+2));return i?(e.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function Xt(e,t,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return i?(e.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function Gt(e,t,n){var i=Tt.exec(t.slice(n,n+1));return i?(e.q=3*i[0]-3,n+i[0].length):-1}function Jt(e,t,n){var i=Tt.exec(t.slice(n,n+2));return i?(e.m=i[0]-1,n+i[0].length):-1}function Zt(e,t,n){var i=Tt.exec(t.slice(n,n+2));return i?(e.d=+i[0],n+i[0].length):-1}function Qt(e,t,n){var i=Tt.exec(t.slice(n,n+3));return i?(e.m=0,e.d=+i[0],n+i[0].length):-1}function en(e,t,n){var i=Tt.exec(t.slice(n,n+2));return i?(e.H=+i[0],n+i[0].length):-1}function tn(e,t,n){var i=Tt.exec(t.slice(n,n+2));return i?(e.M=+i[0],n+i[0].length):-1}function nn(e,t,n){var i=Tt.exec(t.slice(n,n+2));return i?(e.S=+i[0],n+i[0].length):-1}function rn(e,t,n){var i=Tt.exec(t.slice(n,n+3));return i?(e.L=+i[0],n+i[0].length):-1}function on(e,t,n){var i=Tt.exec(t.slice(n,n+6));return i?(e.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function an(e,t,n){var i=It.exec(t.slice(n,n+1));return i?n+i[0].length:-1}function sn(e,t,n){var i=Tt.exec(t.slice(n));return i?(e.Q=+i[0],n+i[0].length):-1}function ln(e,t,n){var i=Tt.exec(t.slice(n));return i?(e.s=+i[0],n+i[0].length):-1}function cn(e,t){return Pt(e.getDate(),t,2)}function un(e,t){return Pt(e.getHours(),t,2)}function hn(e,t){return Pt(e.getHours()%12||12,t,2)}function dn(e,t){return Pt(1+Xe.count(pt(e),e),t,3)}function fn(e,t){return Pt(e.getMilliseconds(),t,3)}function pn(e,t){return fn(e,t)+"000"}function gn(e,t){return Pt(e.getMonth()+1,t,2)}function mn(e,t){return Pt(e.getMinutes(),t,2)}function yn(e,t){return Pt(e.getSeconds(),t,2)}function vn(e){var t=e.getDay();return 0===t?7:t}function xn(e,t){return Pt(Qe.count(pt(e)-1,e),t,2)}function bn(e){var t=e.getDay();return t>=4||0===t?it(e):it.ceil(e)}function wn(e,t){return e=bn(e),Pt(it.count(pt(e),e)+(4===pt(e).getDay()),t,2)}function kn(e){return e.getDay()}function _n(e,t){return Pt(et.count(pt(e)-1,e),t,2)}function Mn(e,t){return Pt(e.getFullYear()%100,t,2)}function Sn(e,t){return Pt((e=bn(e)).getFullYear()%100,t,2)}function Rn(e,t){return Pt(e.getFullYear()%1e4,t,4)}function Cn(e,t){var n=e.getDay();return Pt((e=n>=4||0===n?it(e):it.ceil(e)).getFullYear()%1e4,t,4)}function Nn(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Pt(t/60|0,"0",2)+Pt(t%60,"0",2)}function Dn(e,t){return Pt(e.getUTCDate(),t,2)}function qn(e,t){return Pt(e.getUTCHours(),t,2)}function En(e,t){return Pt(e.getUTCHours()%12||12,t,2)}function On(e,t){return Pt(1+Ge.count(gt(e),e),t,3)}function zn(e,t){return Pt(e.getUTCMilliseconds(),t,3)}function An(e,t){return zn(e,t)+"000"}function Tn(e,t){return Pt(e.getUTCMonth()+1,t,2)}function In(e,t){return Pt(e.getUTCMinutes(),t,2)}function jn(e,t){return Pt(e.getUTCSeconds(),t,2)}function Pn(e){var t=e.getUTCDay();return 0===t?7:t}function Fn(e,t){return Pt(st.count(gt(e)-1,e),t,2)}function Ln(e){var t=e.getUTCDay();return t>=4||0===t?ht(e):ht.ceil(e)}function $n(e,t){return e=Ln(e),Pt(ht.count(gt(e),e)+(4===gt(e).getUTCDay()),t,2)}function Bn(e){return e.getUTCDay()}function Hn(e,t){return Pt(lt.count(gt(e)-1,e),t,2)}function Wn(e,t){return Pt(e.getUTCFullYear()%100,t,2)}function Vn(e,t){return Pt((e=Ln(e)).getUTCFullYear()%100,t,2)}function Un(e,t){return Pt(e.getUTCFullYear()%1e4,t,4)}function Yn(e,t){var n=e.getUTCDay();return Pt((e=n>=4||0===n?ht(e):ht.ceil(e)).getUTCFullYear()%1e4,t,4)}function Kn(){return"+0000"}function Xn(){return"%"}function Gn(e){return+e}function Jn(e){return Math.floor(+e/1e3)}const Zn=Ce();Zn("d3-number",(function(e,t,n){let i,r;function o(e){return r(e)}function a(){o.locale({decimal:n||".",thousands:t||",",grouping:[3],currency:["$",""]})}return o.locale=function(t){return i=Be(t),r=i.format(e),this},a(),o.format=function(e,r,o,s){return(o||s)&&(t=o,n=s,a()),i.format(e)(r)},o.pattern=function(t){return t&&(e=t,r=i.format(t)),e},o})),Zn("d3-time",(function(e){let t=zt({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}),n=t.format(e);function i(e){return n(e)}return i.format=function(e,n){return t.format(e)(n)},i.locale=function(){return t=zt(...arguments),n=t.format(e),this},i.parse=function(e,n){return t.parse(e)(n)},i.parsePattern=function(e){return t.parse(e)},i}));const Qn={id:e=>"".concat(e.source,"/").concat(e.key||e.title),key:e=>String(e.key||e.title),tags:e=>e.tags,min:e=>e.min,max:e=>e.max,type:e=>e.type,title:e=>String(e.title),values:e=>e.values,value:e=>e,label:e=>e,formatter:e=>(e=>{if("function"==typeof e.formatter)return e.formatter();const t=e.formatter||{};return Zn(t.type||"d3-number")(t.format||"")})(e)};function ei(e){let{id:t=Qn.id,key:n=Qn.key,min:i=Qn.min,max:r=Qn.max,type:o=Qn.type,tags:a=Qn.tags,title:s=Qn.title,values:l=Qn.values,value:c=Qn.value,label:u=Qn.label,formatter:h=Qn.formatter}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{id:()=>t(e),key:()=>n(e),raw:()=>e,tags:()=>a(e),type:()=>o(e),min:()=>i(e),max:()=>r(e),title:()=>s(e),items:()=>l(e),formatter:()=>h(e),value:c,label:u}}const ti=e=>e.filter((e=>"number"==typeof e&&!isNaN(e))),ni=e=>e.reduce(((e,t)=>e+t),0),ii={first:e=>e[0],last:e=>e[e.length-1],min:e=>{const t=ti(e);return t.length?Math.min.apply(null,t):NaN},max:e=>{const t=ti(e);return t.length?Math.max.apply(null,t):NaN},sum:e=>{const t=ti(e);return t.length?t.reduce(((e,t)=>e+t),0):NaN},avg:e=>{const t=ti(e),n=t.length;return n?ni(t)/n:NaN}};function ri(e,t,n,i){const r={},o=i.field||(void 0!==e.field?t.field(e.field):null);return Object.keys(n).forEach((a=>{const s=n[a],l=r[a]={};-1!==["number","string","boolean"].indexOf(typeof s)?(l.type="primitive",l.value=s):"function"==typeof s?(l.type="function",l.value=s,l.label=s,l.field=o):"object"==typeof s&&(s.fields?l.fields=s.fields.map((n=>ri(e,t,{main:n},i).main)):void 0!==s.field?(l.type="field",l.field=t.field(s.field),l.value=l.field.value,l.label=l.field.label):o&&(l.value=o.value,l.label=o.label,l.field=o),"function"==typeof s.filter&&(l.filter=s.filter),void 0!==s.value&&(l.value=s.value),void 0!==s.label&&(l.label=s.label),"function"==typeof s.reduce?l.reduce=s.reduce:s.reduce?l.reduce=ii[s.reduce]:l.field&&l.field.reduce&&(l.reduce="string"==typeof l.field.reduce?ii[l.field.reduce]:l.field.reduce),"function"==typeof s.reduceLabel?l.reduceLabel=s.reduceLabel:s.reduceLabel?l.reduceLabel=ii[s.reduceLabel]:l.field&&l.field.reduceLabel&&(l.reduceLabel="string"==typeof l.field.reduceLabel?ii[l.field.reduceLabel]:l.field.reduceLabel))})),r}function oi(e,t){const{main:n}=ri(e,t,{main:{value:e.value,label:e.label,reduce:e.reduce,filter:e.filter}},{});return{props:ri(e,t,e.props||{},n),main:n}}function ai(e,t,n,i){const r=Array(e.length),o=Array(e.length);let a;for(let t=0;t<e.length;t++)a=i?e[t][i]:e[t],r[t]=a.value,o[t]=a.label;const s=t.reduce,l=t.reduceLabel,c=s?s(r):r,u={value:c,label:l?l(o,c):n?n(c):String(c)};return i&&e[0][i].source?(u.source=e[0][i].source,u):!i&&e[0].source?(u.source=e[0].source,u):u}function si(e,t){let{main:n,propsArr:i,props:r}=t,o=[];const a=n.field.formatter(),s={};return i.forEach((e=>{s[e]=r[e].field?r[e].field.formatter():e=>e})),o.push(...e.map((e=>{const t=ai(e.items,n,a);return i.forEach((n=>{t[n]=ai(e.items,r[n],s[n],n)})),t}))),o}function li(e){let{cfg:t,itemData:n,obj:i,target:r,tracker:o,trackType:a}=e;const s="function"===a?t.trackBy(n):n[t.trackBy];let l=o[s];l||(l=o[s]={items:[],id:s},r.push(l)),l.items.push(i)}function ci(e){if(e.length<1e4)return Math.max(...e);let t=-1/0;const n=e.length;for(let i=0;i<n;i++)t<e[i]&&(t=e[i]);return t}function ui(e){if(e.length<1e4)return Math.min(...e);let t=1/0;const n=e.length;for(let i=0;i<n;i++)t>e[i]&&(t=e[i]);return t}const hi={diverging:function(e,t){if((s=e.length)>0)for(var n,i,r,o,a,s,l=0,c=e[t[0]].length;l<c;++l)for(o=a=0,n=0;n<s;++n)(r=(i=e[t[n]][l])[1]-i[0])>=0?(i[0]=o,i[1]=o+=r):r<0?(i[1]=a,i[0]=a+=r):i[0]=o},none:ke,silhouette:function(e,t){if((n=e.length)>0){for(var n,i=0,r=e[t[0]],o=r.length;i<o;++i){for(var a=0,s=0;a<n;++a)s+=e[a][i][1]||0;r[i][1]+=r[i][0]=-s/2}ke(e,t)}},expand:function(e,t){if((i=e.length)>0){for(var n,i,r,o=0,a=e[0].length;o<a;++o){for(r=n=0;n<i;++n)r+=e[n][o][1]||0;if(r)for(n=0;n<i;++n)e[n][o][1]/=r}ke(e,t)}},wiggle:function(e,t){if((r=e.length)>0&&(i=(n=e[t[0]]).length)>0){for(var n,i,r,o=0,a=1;a<i;++a){for(var s=0,l=0,c=0;s<r;++s){for(var u=e[t[s]],h=u[a][1]||0,d=(h-(u[a-1][1]||0))/2,f=0;f<s;++f){var p=e[t[f]];d+=(p[a][1]||0)-(p[a-1][1]||0)}l+=h,c+=d*h}n[a-1][1]+=n[a-1][0]=o,l&&(o-=c/l)}n[a-1][1]+=n[a-1][0]=o,ke(e,t)}}},di={ascending:function(e){var t=e.map(Re);return _e(e).sort((function(e,n){return t[e]-t[n]}))},insideout:function(e){var t,n,i=e.length,r=e.map(Re),o=function(e){var t=e.map(Se);return _e(e).sort((function(e,n){return t[e]-t[n]}))}(e),a=0,s=0,l=[],c=[];for(t=0;t<i;++t)n=o[t],a<s?(a+=r[n],l.push(n)):(s+=r[n],c.push(n));return c.reverse().concat(l)},none:_e,reverse:function(e){return _e(e).reverse()}};function fi(e,t,n){const i={},r=t.stackKey,o=t.value,a=t.startProp||"start",s=t.endProp||"end",l=t.offset||"none",c=t.order||"none",u=t.valueRef||"";let h=0,d={};for(let t=0;t<e.items.length;t++){let n=e.items[t],o=u?n[u]:null;if(o&&o.source){let e="".concat(o.source.key||"","/").concat(o.source.field);d[e]||(d[e]=o.source)}let a=r(n);i[a]=i[a]||{items:[]},i[a].items.push(n),h=Math.max(h,i[a].items.length)}const f=Array.apply(null,{length:h}).map(Number.call,Number),p=Object.keys(i).map((e=>i[e].items)),g=function(){var e=E([]),t=_e,n=ke,i=Me;function r(r){var o,a,s=e.apply(this,arguments),l=r.length,c=s.length,u=new Array(c);for(o=0;o<c;++o){for(var h,d=s[o],f=u[o]=new Array(l),p=0;p<l;++p)f[p]=h=[0,+i(r[p],d,p,r)],h.data=r[p];f.key=d}for(o=0,a=t(u);o<c;++o)u[a[o]].index=o;return n(u,a),u}return r.keys=function(t){return arguments.length?(e="function"==typeof t?t:E(re.call(t)),r):e},r.value=function(e){return arguments.length?(i="function"==typeof e?e:E(+e),r):i},r.order=function(e){return arguments.length?(t=null==e?_e:"function"==typeof e?e:E(re.call(e)),r):t},r.offset=function(e){return arguments.length?(n=null==e?ke:e,r):n},r}().keys(f).value(((e,t)=>e[t]?o(e[t]):0)).order(di[c]).offset(hi[l]);let m=g(p),y=[];for(let e=0;e<m.length;e++){let t=m[e];for(let e=0;e<t.length;e++){let n=t[e],i=t[e].data[t.key];i&&(i[a]={value:n[0]},i[s]={value:n[1]},y.push(n[0],n[1]))}}let v=Object.keys(d).map((e=>{let t=n(d[e].key);return t?t.field(d[e].field):null})).filter((e=>!!e));const x=ei({title:v.map((e=>e.title())).join(", "),min:ui(y),max:ci(y),type:"measure",formatter:v[0]?v[0].formatter:void 0});e.fields.push(x)}function pi(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={};const i=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).logger;if(Array.isArray(e))n.items=e.map((e=>({value:e,label:String(e)})));else if(e){if("collection"in e)n=p({},t.collection(e.collection));else{const r=t.dataset?t.dataset(e.source):null;let o=e.value||(e=>e),a=e.label||(e=>e);if(e.groupBy||e.mapTo)i.warn('Deprecated "data" configuration',e),n.items=[];else if(e.hierarchy)n.root=r.hierarchy?r.hierarchy(e.hierarchy):null,n.fields=r.fields();else if(e.items)n.items=e.skipNormalize?e.items:e.items.map((e=>({value:o(e),label:String(a(e))})));else if(e.extract){const i=Array.isArray(e.extract)?e.extract:[e.extract];n.items=[];const o=[];i.forEach((e=>{const i=e.source?t.dataset(e.source):r;i&&(n.items=[...n.items,...i.extract(e)],void 0!==e.field&&o.push(i.field(e.field)))})),o.length&&(n.fields=o),e.amend&&Array.isArray(e.amend)&&(n.items=[...n.items,...e.amend])}else if(void 0!==e.field&&r){const t=r.field(e.field);t&&(n.fields||(n.fields=[]),n.fields.push(t),"value"in e||(o=t.value||(e=>e),a=t.label||(e=>e),n.value=o),n.items=t.items().map((t=>({value:o(t),label:String(a(t)),source:{field:e.field}}))))}else e.fields&&e.fields.forEach((e=>{const i="object"==typeof e&&e.source?t.dataset(e.source):r;if(!i)return;let o;o="object"==typeof e&&void 0!==e.field?i.field(e.field):i.field(e),o&&(n.fields||(n.fields=[]),n.fields.push(o))}));n.items&&e.map&&(n.items=n.items.map(e.map))}e&&e.stack&&fi(n,e.stack,t.dataset)}return e&&!Array.isArray(e)&&"function"==typeof e.filter&&n.items&&(n.items=n.items.filter(e.filter)),e&&!Array.isArray(e)&&"function"==typeof e.sort&&n.items&&(n.items=n.items.sort(e.sort)),n}function gi(e,t,n){let i,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:pi;if(e.data){const i=r(e.data,t,n);if(i&&i.fields&&i.fields[0])return i.fields[0].formatter()}if(i=e.formatter?"".concat(e.formatter,"-").concat(e.type||"number"):e.type||"d3-number",n.formatter.has(i)){return n.formatter.get(i)(e.format||"")}throw new Error("Formatter of type '".concat(i,"' was not found"))}function mi(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}const yi=Symbol("implicit");function vi(){var e=new kt,t=[],n=[],i=yi;function r(r){let o=e.get(r);if(void 0===o){if(i!==yi)return i;e.set(r,o=t.push(r)-1)}return n[o%n.length]}return r.domain=function(n){if(!arguments.length)return t.slice();t=[],e=new kt;for(const i of n)e.has(i)||e.set(i,t.push(i)-1);return r},r.range=function(e){return arguments.length?(n=Array.from(e),r):n.slice()},r.unknown=function(e){return arguments.length?(i=e,r):i},r.copy=function(){return vi(t,n).unknown(i)},mi.apply(r,arguments),r}function xi(){var e,t,n=vi().unknown(void 0),i=n.domain,r=n.range,o=0,a=1,s=!1,l=0,c=0,u=.5;function h(){var n=i().length,h=a<o,d=h?a:o,f=h?o:a;e=(f-d)/Math.max(1,n-l+2*c),s&&(e=Math.floor(e)),d+=(f-d-e*(n-l))*u,t=e*(1-l),s&&(d=Math.round(d),t=Math.round(t));var p=function(e,t,n){e=+e,t=+t,n=(r=arguments.length)<2?(t=e,e=0,1):r<3?1:+n;for(var i=-1,r=0|Math.max(0,Math.ceil((t-e)/n)),o=new Array(r);++i<r;)o[i]=e+i*n;return o}(n).map((function(t){return d+e*t}));return r(h?p.reverse():p)}return delete n.unknown,n.domain=function(e){return arguments.length?(i(e),h()):i()},n.range=function(e){return arguments.length?([o,a]=e,o=+o,a=+a,h()):[o,a]},n.rangeRound=function(e){return[o,a]=e,o=+o,a=+a,s=!0,h()},n.bandwidth=function(){return t},n.step=function(){return e},n.round=function(e){return arguments.length?(s=!!e,h()):s},n.padding=function(e){return arguments.length?(l=Math.min(1,c=+e),h()):l},n.paddingInner=function(e){return arguments.length?(l=Math.min(1,e),h()):l},n.paddingOuter=function(e){return arguments.length?(c=+e,h()):c},n.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),h()):u},n.copy=function(){return xi(i(),[o,a]).round(s).paddingInner(l).paddingOuter(c).align(u)},mi.apply(h(),arguments)}function bi(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function wi(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function ki(){}var _i=.7,Mi=1/_i,Si="\\s*([+-]?\\d+)\\s*",Ri="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ci="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ni=/^#([0-9a-f]{3,8})$/,Di=new RegExp(`^rgb\\(${Si},${Si},${Si}\\)$`),qi=new RegExp(`^rgb\\(${Ci},${Ci},${Ci}\\)$`),Ei=new RegExp(`^rgba\\(${Si},${Si},${Si},${Ri}\\)$`),Oi=new RegExp(`^rgba\\(${Ci},${Ci},${Ci},${Ri}\\)$`),zi=new RegExp(`^hsl\\(${Ri},${Ci},${Ci}\\)$`),Ai=new RegExp(`^hsla\\(${Ri},${Ci},${Ci},${Ri}\\)$`),Ti={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Ii(){return this.rgb().formatHex()}function ji(){return this.rgb().formatRgb()}function Pi(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Ni.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?Fi(t):3===n?new Bi(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Li(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Li(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=Di.exec(e))?new Bi(t[1],t[2],t[3],1):(t=qi.exec(e))?new Bi(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Ei.exec(e))?Li(t[1],t[2],t[3],t[4]):(t=Oi.exec(e))?Li(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=zi.exec(e))?Ki(t[1],t[2]/100,t[3]/100,1):(t=Ai.exec(e))?Ki(t[1],t[2]/100,t[3]/100,t[4]):Ti.hasOwnProperty(e)?Fi(Ti[e]):"transparent"===e?new Bi(NaN,NaN,NaN,0):null}function Fi(e){return new Bi(e>>16&255,e>>8&255,255&e,1)}function Li(e,t,n,i){return i<=0&&(e=t=n=NaN),new Bi(e,t,n,i)}function $i(e,t,n,i){return 1===arguments.length?function(e){return e instanceof ki||(e=Pi(e)),e?new Bi((e=e.rgb()).r,e.g,e.b,e.opacity):new Bi}(e):new Bi(e,t,n,null==i?1:i)}function Bi(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}function Hi(){return`#${Yi(this.r)}${Yi(this.g)}${Yi(this.b)}`}function Wi(){const e=Vi(this.opacity);return`${1===e?"rgb(":"rgba("}${Ui(this.r)}, ${Ui(this.g)}, ${Ui(this.b)}${1===e?")":`, ${e})`}`}function Vi(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ui(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Yi(e){return((e=Ui(e))<16?"0":"")+e.toString(16)}function Ki(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Gi(e,t,n,i)}function Xi(e){if(e instanceof Gi)return new Gi(e.h,e.s,e.l,e.opacity);if(e instanceof ki||(e=Pi(e)),!e)return new Gi;if(e instanceof Gi)return e;var t=(e=e.rgb()).r/255,n=e.g/255,i=e.b/255,r=Math.min(t,n,i),o=Math.max(t,n,i),a=NaN,s=o-r,l=(o+r)/2;return s?(a=t===o?(n-i)/s+6*(n<i):n===o?(i-t)/s+2:(t-n)/s+4,s/=l<.5?o+r:2-o-r,a*=60):s=l>0&&l<1?0:a,new Gi(a,s,l,e.opacity)}function Gi(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}function Ji(e){return(e=(e||0)%360)<0?e+360:e}function Zi(e){return Math.max(0,Math.min(1,e||0))}function Qi(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}bi(ki,Pi,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Ii,formatHex:Ii,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Xi(this).formatHsl()},formatRgb:ji,toString:ji}),bi(Bi,$i,wi(ki,{brighter(e){return e=null==e?Mi:Math.pow(Mi,e),new Bi(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?_i:Math.pow(_i,e),new Bi(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Bi(Ui(this.r),Ui(this.g),Ui(this.b),Vi(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Hi,formatHex:Hi,formatHex8:function(){return`#${Yi(this.r)}${Yi(this.g)}${Yi(this.b)}${Yi(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Wi,toString:Wi})),bi(Gi,(function(e,t,n,i){return 1===arguments.length?Xi(e):new Gi(e,t,n,null==i?1:i)}),wi(ki,{brighter(e){return e=null==e?Mi:Math.pow(Mi,e),new Gi(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?_i:Math.pow(_i,e),new Gi(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*t,r=2*n-i;return new Bi(Qi(e>=240?e-240:e+120,r,i),Qi(e,r,i),Qi(e<120?e+240:e-120,r,i),this.opacity)},clamp(){return new Gi(Ji(this.h),Zi(this.s),Zi(this.l),Vi(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Vi(this.opacity);return`${1===e?"hsl(":"hsla("}${Ji(this.h)}, ${100*Zi(this.s)}%, ${100*Zi(this.l)}%${1===e?")":`, ${e})`}`}}));var er=e=>()=>e;function tr(e){return 1==(e=+e)?nr:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(i){return Math.pow(e+i*t,n)}}(t,n,e):er(isNaN(t)?n:t)}}function nr(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):er(isNaN(e)?t:e)}var ir=function e(t){var n=tr(t);function i(e,t){var i=n((e=$i(e)).r,(t=$i(t)).r),r=n(e.g,t.g),o=n(e.b,t.b),a=nr(e.opacity,t.opacity);return function(t){return e.r=i(t),e.g=r(t),e.b=o(t),e.opacity=a(t),e+""}}return i.gamma=e,i}(1);function rr(e,t){t||(t=[]);var n,i=e?Math.min(t.length,e.length):0,r=t.slice();return function(o){for(n=0;n<i;++n)r[n]=e[n]*(1-o)+t[n]*o;return r}}function or(e,t){var n,i=t?t.length:0,r=e?Math.min(i,e.length):0,o=new Array(r),a=new Array(i);for(n=0;n<r;++n)o[n]=dr(e[n],t[n]);for(;n<i;++n)a[n]=t[n];return function(e){for(n=0;n<r;++n)a[n]=o[n](e);return a}}function ar(e,t){var n=new Date;return e=+e,t=+t,function(i){return n.setTime(e*(1-i)+t*i),n}}function sr(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function lr(e,t){var n,i={},r={};for(n in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)n in e?i[n]=dr(e[n],t[n]):r[n]=t[n];return function(e){for(n in i)r[n]=i[n](e);return r}}var cr=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ur=new RegExp(cr.source,"g");function hr(e,t){var n,i,r,o=cr.lastIndex=ur.lastIndex=0,a=-1,s=[],l=[];for(e+="",t+="";(n=cr.exec(e))&&(i=ur.exec(t));)(r=i.index)>o&&(r=t.slice(o,r),s[a]?s[a]+=r:s[++a]=r),(n=n[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,l.push({i:a,x:sr(n,i)})),o=ur.lastIndex;return o<t.length&&(r=t.slice(o),s[a]?s[a]+=r:s[++a]=r),s.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var n,i=0;i<t;++i)s[(n=l[i]).i]=n.x(e);return s.join("")})}function dr(e,t){var n,i=typeof t;return null==t||"boolean"===i?er(t):("number"===i?sr:"string"===i?(n=Pi(t))?(t=n,ir):hr:t instanceof Pi?ir:t instanceof Date?ar:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(t)?rr:Array.isArray(t)?or:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?lr:sr)(e,t)}function fr(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function pr(e){return+e}var gr=[0,1];function mr(e){return e}function yr(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:function(e){return function(){return e}}(isNaN(t)?NaN:.5)}function vr(e,t,n){var i=e[0],r=e[1],o=t[0],a=t[1];return r<i?(i=yr(r,i),o=n(a,o)):(i=yr(i,r),o=n(o,a)),function(e){return o(i(e))}}function xr(e,t,n){var i=Math.min(e.length,t.length)-1,r=new Array(i),o=new Array(i),a=-1;for(e[i]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<i;)r[a]=yr(e[a],e[a+1]),o[a]=n(t[a],t[a+1]);return function(t){var n=wt(e,t,1,i)-1;return o[n](r[n](t))}}function br(){var e,t,n,i,r,o,a=gr,s=gr,l=dr,c=mr;function u(){var e=Math.min(a.length,s.length);return c!==mr&&(c=function(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}(a[0],a[e-1])),i=e>2?xr:vr,r=o=null,h}function h(t){return null==t||isNaN(t=+t)?n:(r||(r=i(a.map(e),s,l)))(e(c(t)))}return h.invert=function(n){return c(t((o||(o=i(s,a.map(e),sr)))(n)))},h.domain=function(e){return arguments.length?(a=Array.from(e,pr),u()):a.slice()},h.range=function(e){return arguments.length?(s=Array.from(e),u()):s.slice()},h.rangeRound=function(e){return s=Array.from(e),l=fr,u()},h.clamp=function(e){return arguments.length?(c=!!e||mr,u()):c!==mr},h.interpolate=function(e){return arguments.length?(l=e,u()):l},h.unknown=function(e){return arguments.length?(n=e,h):n},function(n,i){return e=n,t=i,u()}}function wr(e,t,n,i){var r,o=function(e,t,n){n=+n;const i=(t=+t)<(e=+e),r=i?Dt(t,e,n):Dt(e,t,n);return(i?-1:1)*(r<0?1/-r:r)}(e,t,n);switch((i=Oe(null==i?",f":i)).type){case"s":var a=Math.max(Math.abs(e),Math.abs(t));return null!=i.precision||isNaN(r=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(De(t)/3)))-De(Math.abs(e)))}(o,a))||(i.precision=r),Fe(i,a);case"":case"e":case"g":case"p":case"r":null!=i.precision||isNaN(r=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,De(t)-De(e))+1}(o,Math.max(Math.abs(e),Math.abs(t))))||(i.precision=r-("e"===i.type));break;case"f":case"%":null!=i.precision||isNaN(r=function(e){return Math.max(0,-De(Math.abs(e)))}(o))||(i.precision=r-2*("%"===i.type))}return Pe(i)}function kr(e){var t=e.domain;return e.ticks=function(e){var n=t();return function(e,t,n){if(!((n=+n)>0))return[];if((e=+e)==(t=+t))return[e];const i=t<e,[r,o,a]=i?Nt(t,e,n):Nt(e,t,n);if(!(o>=r))return[];const s=o-r+1,l=new Array(s);if(i)if(a<0)for(let e=0;e<s;++e)l[e]=(o-e)/-a;else for(let e=0;e<s;++e)l[e]=(o-e)*a;else if(a<0)for(let e=0;e<s;++e)l[e]=(r+e)/-a;else for(let e=0;e<s;++e)l[e]=(r+e)*a;return l}(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var i=t();return wr(i[0],i[i.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var i,r,o=t(),a=0,s=o.length-1,l=o[a],c=o[s],u=10;for(c<l&&(r=l,l=c,c=r,r=a,a=s,s=r);u-- >0;){if((r=Dt(l,c,n))===i)return o[a]=l,o[s]=c,t(o);if(r>0)l=Math.floor(l/r)*r,c=Math.ceil(c/r)*r;else{if(!(r<0))break;l=Math.ceil(l*r)/r,c=Math.floor(c*r)/r}i=r}return e},e}function _r(){var e=br()(mr,mr);return e.copy=function(){return t=e,_r().domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown());var t},mi.apply(e,arguments),kr(e)}function Mr(){var e,t=[.5],n=[0,1],i=1;function r(r){return null!=r&&r<=r?n[wt(t,r,0,i)]:e}return r.domain=function(e){return arguments.length?(t=Array.from(e),i=Math.min(t.length,n.length-1),r):t.slice()},r.range=function(e){return arguments.length?(n=Array.from(e),i=Math.min(t.length,n.length-1),r):n.slice()},r.invertExtent=function(e){var i=n.indexOf(e);return[t[i-1],t[i]]},r.unknown=function(t){return arguments.length?(e=t,r):e},r.copy=function(){return Mr().domain(t).range(n).unknown(e)},mi.apply(r,arguments)}function Sr(e){return void 0===e?e=>e:t=>e(t)}function Rr(e){return Math.max(0,Math.min(1,e))}function Cr(e){return"object"==typeof e}function Nr(e,t,n){const i=Math.abs(t-n)/(e+1),r=[];for(let o=1;o<=e;o++){const e=o*i;r.push(t<n?t+e:t-e)}return r}function Dr(e,t,n){if(1===e.length)return e;const i=e.concat([]);for(let r=0;r<e.length;r++){let o=e[r],a=e[r+1];0===r&&o!==n.start()?(i.push(...Nr(t,o,a)),o-=a-o,a=e[r],i.push(...Nr(t,o,a))):r===e.length-1&&a!==n.end()?(a=o+(o-e[r-1]),i.push(...Nr(t,o,a))):i.push(...Nr(t,o,a))}return i.filter((e=>e>=n.min()&&e<=n.max()))}function qr(e){let{distance:t,scale:n,minorCount:i=0,unitDivider:r=100,formatter:o}=e;const a=y(r)||y(t)?2:Math.max(t/r,2),s=Math.min(1e3,Math.round(a));let l=n.ticks(s);l.length<=1&&(l=n.ticks(s+1));const c=i>0?Dr(l,i,n):l;c.sort(((e,t)=>e-t));const u=c.map(Sr(o));return c.map(((e,t)=>{const i=n(e);return{position:i,start:i,end:i,label:u[t],value:e,isMinor:-1===l.indexOf(e)}}))}function Er(e){let{distance:t,scale:n,minorCount:i=0,unitDivider:r=100,formatter:o}=e;const a=y(r)||y(t)?2:Math.max(t/r,2),s=Math.min(1e3,Math.round(a)),l=s>10?10:s;n.nice(l);const c=n.ticks(s),u=i>0?Dr(c,i,n):c;u.sort(((e,t)=>e-t));const h=u.map(Sr(o));return u.map(((e,t)=>{const i=n(e);return{position:i,start:i,end:i,label:h[t],value:e,isMinor:-1===c.indexOf(e)}}))}function Or(e){let t,{settings:n,scale:i,distance:r,formatter:o=e=>e}=e;const a=n.minorTicks&&!y(n.minorTicks.count)?Math.min(100,n.minorTicks.count):0;if(Array.isArray(n.ticks.values)){const e=n.ticks.values.filter((e=>"object"==typeof e?!y(e.value):!y(e)));t=function(e){let{values:t,scale:n,formatter:i=e=>e}=e;return t.sort(((e,t)=>(Cr(e)?e.value:e)-(Cr(t)?t.value:t))).filter(((e,t,i)=>{const r=Cr(e)?e.value:e;return r<=n.max()&&r>=n.min()&&i.indexOf(e)===t})).map((e=>{const t=Cr(e),r=t?e.value:e,o=n(r);return{position:o,value:r,label:t&&void 0!==e.label?e.label:i(r),isMinor:!!t&&!!e.isMinor,start:t&&!isNaN(e.start)?Rr(n(e.start)):o,end:t&&!isNaN(e.end)?Rr(n(e.end)):o}}))}({values:e,scale:i.copy(),formatter:o})}else if(y(n.ticks.count)){t=(n.ticks.tight?Er:qr)({distance:r,minorCount:a,unitDivider:n.ticks.distance,scale:i,formatter:o}),n.ticks.forceBounds&&function(e,t,n){const i=e.map((e=>e.position)),r=t.range();-1===i.indexOf(r[0])?e.splice(0,0,{position:r[0],start:r[0],end:r[0],label:n(t.start()),isMinor:!1,value:t.start()}):e[0]&&e[0].isMinor&&(e[0].isMinor=!1);const o=e[e.length-1];-1===i.indexOf(r[1])?e.push({position:r[1],start:r[1],end:r[1],label:n(t.end()),isMinor:!1,value:t.end()}):o&&o.isMinor&&(o.isMinor=!1)}(t,i,o)}else{t=function(e){let{count:t,minorCount:n,scale:i,formatter:r}=e;return i.ticks((t-1)*n+t).map(((e,t)=>{const o=i(e);return{position:o,start:o,end:o,label:r(e),isMinor:t%(n+1)!=0,value:e}}))}({count:Math.min(1e3,n.ticks.count),minorCount:a,scale:i.copy(),formatter:o})}return t}function zr(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i={};return Object.keys(t).forEach((r=>{const o=typeof e[r];i[r]="function"===o?e[r](n):"undefined"===o?t[r]:e[r]})),i}const Ar={min:NaN,max:NaN,expand:NaN,include:[],invert:!1},Tr={tight:!1,forceBounds:!1,values:void 0,count:NaN,distance:100},Ir={count:NaN};function jr(e,t){e.instance||(e.instance=t.copy(),e.instance.domain([t.start(),t.end()]),e.instance.clamp(!0),e.instance.range(e.invert?[1,0]:[0,1]))}function Pr(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=_r(),r={instance:null,invert:!1},o={data:t,resources:n},a=zr(e,Ar,o);let s;function l(e){return y(e)?NaN:i(e)}a.ticks=zr(e.ticks,Tr,o),a.minorTicks=zr(e.minorTicks,Ir,o),l.data=()=>t,l.invert=function(e){return i.invert(e)},l.rangeRound=function(e){return i.rangeRound(e),l},l.clamp=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return i.clamp(e),l},l.cachedTicks=function(){return s},l.clearTicksCache=function(){return s=void 0,this},l.ticks=function(e){return null!==e&&"object"==typeof e?(e.settings=e.settings||{},e.settings=u(!0,{},a,e.settings),e.scale=l,s=Or(e),s):(s=i.ticks(e),s)},l.nice=function(e){return i.nice(e),l},l.tickFormat=function(e,t){return i.tickFormat(e,t)},l.interpolate=function(e){return i.interpolate(e),l},l.domain=function(e){return arguments.length?(i.domain(e),r.instance&&r.instance.domain([l.start(),l.end()]),l):i.domain()},l.range=function(e){return arguments.length?(i.range(e),l):i.range()},l.start=function(){return l.domain()[0]},l.end=function(){return l.domain()[this.domain().length-1]},l.min=function(){return Math.min(this.start(),this.end())},l.max=function(){return Math.max(this.start(),this.end())},l.classify=function(e){let t=(l.start()-l.end())/e,n=[l.end()],i=[],r=t/2;for(let o=0;o<e;o++){let e=n[n.length-1]||0,o=e+t,a=l(e+r);n.push(o,o),i.push(a,a)}return n.pop(),l.domain(n),l.range(i),l},l.copy=function(){const r=Pr(e,t,n);return r.domain(l.domain()),r.range(l.range()),r.clamp(i.clamp()),r},l.norm=function(e){return jr(r,l),r.instance(e)},l.normInvert=function(e){return jr(r,l),r.instance.invert(e)};const{mini:c,maxi:h}=function(e,t){const n=+e.min,i=+e.max;let r=0,o=1;if(t&&t[0]){const n=t.map((e=>e.min())).filter((e=>!isNaN(e))),i=t.map((e=>e.max())).filter((e=>!isNaN(e)));if(r=n.length?Math.min(...n):Number.NaN,o=i.length?Math.max(...i):Number.NaN,isNaN(r)||isNaN(o))r=-1,o=1;else if(r===o&&0===r)r=-1,o=1;else if(r===o&&r)r-=Math.abs(.1*r),o+=Math.abs(.1*o);else if(!isNaN(e.expand)){const t=o-r;r-=t*e.expand,o+=t*e.expand}if(Array.isArray(e.include)){const t=e.include.filter((e=>!isNaN(e)));r=Math.min(...t,r),o=Math.max(...t,o)}}return{mini:isNaN(n)?r:n,maxi:isNaN(i)?o:i}}(a,t?t.fields:[]);return l.domain([c,h]),l.range(a.invert?[1,0]:[0,1]),r.invert=a.invert,l}const Fr={padding:0,paddingInner:NaN,paddingOuter:NaN,align:.5,invert:!1,maxPxStep:NaN,range:[0,1]};function Lr(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n={data:t,resources:arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}},i=zr(e,Fr,n),r=t.items||[],o={},a=[],s=[];function l(e,n){e.data=()=>t,e.datum=e=>r[o[e]],e.start=function(){return e.domain()[0]},e.end=function(){return e.domain()[e.domain().length-1]},e.labels=()=>s,e.ticks=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.scale=e,function(e){let{scale:t}=e;const n=t.domain(),i=t.data().items,r=t.labels?t.labels():n,o=t.bandwidth();return n.map(((e,n)=>{const a=t(e);return{position:a+o/2,label:"".concat(r[n]),data:i?i[n]:void 0,start:a,end:a+o}}))}(t,n.trackBy)}}const c=xi();l(c,e),c.pxScale=function(t){const n=i.maxPxStep;if(isNaN(n))return c;const r=c.domain().length,o=Math.max(1,r-c.paddingInner()+2*c.paddingOuter());if(o*n>=t)return c;const a=c.copy();a.type=c.type,l(a,e);const s=o*n/t,u=(1-s)*c.align();return a.range(i.invert?[s+u,u]:[u,s+u]),a};const h="function"==typeof e.value?e.value:e=>e.datum.value,d="function"==typeof e.label?e.label:e=>e.datum.label;for(let e=0;e<r.length;e++){const t=u({datum:r[e]},n),i=h(t,e);-1===a.indexOf(i)&&(a.push(i),s.push(d(t,e)),o[i]=e)}return c.domain(a),c.range(i.invert?i.range.slice().reverse():i.range),c.padding(isNaN(i.padding)?0:i.padding),isNaN(i.paddingInner)||c.paddingInner(i.paddingInner),isNaN(i.paddingOuter)||c.paddingOuter(i.paddingOuter),c.align(isNaN(i.align)?.5:i.align),c}const $r={depth:0};function Br(e,t,n){return e.ancestors().map((e=>t(u({datum:e.data},n)))).reverse().slice(1).toString()}const Hr=e=>e.min(),Wr=e=>e.max();function Vr(e,t){const n=e&&!isNaN(e.min),i=e&&!isNaN(e.max);let r=n?+e.min:0,o=i?+e.max:1;if(t&&t.length){if(!n){const e=t.map(Hr).filter(m);r=e.length?Math.min(...e):r}if(!i){const e=t.map(Wr).filter(m);o=e.length?Math.max(...e):o}}return[r,o]}const Ur={domain:[],range:[],invert:!1,min:NaN,max:NaN};function Yr(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=Pr(e,t,n).clamp(!0).interpolate(ir),r=zr(e,Ur,{data:t,resources:n}),o=Array.isArray(r.domain)&&r.domain.length,a=Array.isArray(r.range)&&r.range.length,s=i;u(!0,s,i);const[l,c]=Vr(r,t?t.fields:[]),h=o?r.domain.length:-1,d=n.theme?n.theme.palette("sequential",h>0?h:2):[],f=a?r.range:d;return s.range(r.invert?f.slice().reverse():f.slice()),s.domain(o?r.domain:function(e,t,n){const i=e.length;if(2===i)return[t,n];const r=[],o=(n-t)/(i-1);r.push(t);for(let e=1;e<i-1;e++)r.push(t+o*e);return r.push(n),r}(s.range(),l,c)),s}const Kr={domain:[],range:[],invert:!1,min:NaN,max:NaN,nice:!1};function Xr(e){const t=[];for(let n=0;n<e.length-1;n++)t.push((e[n]+e[n+1])/2);return t}const Gr={domain:[],range:[]};const Jr={domain:[],range:[],unknown:void 0},Zr={domain:[],range:[],override:!1};const Qr=Ce();function eo(e,t,n){let i=e.data;e.source&&(n.logger.warn("Deprecated: Scale data source configuration"),i={extract:[]},(Array.isArray(e.source)?e.source:[e.source]).forEach((e=>{i.extract.push({field:e})})));const r=pi(i,t,n);let o,a=e.type||function(e){return e.root?"h-band":e.fields&&e.fields[0]?function(e){const t=e.map((e=>"dimension"===e.type()?"band":"linear"));return-1!==t.indexOf("linear")?"linear":"band"}(e.fields):"linear"}(r);return"color"===a&&(a=r.fields&&r.fields[0]&&"dimension"===r.fields[0].type()?"categorical-color":"sequential-color"),n.scale.has(a)&&(o=n.scale.get(a),o=o(e,r,{theme:n.theme,logger:n.logger}),o.type=a),o}Qr("linear",Pr),Qr("band",Lr),Qr("h-band",(function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r={data:n,resources:i},o=zr(t,Fr,r);o.ticks=zr(t.ticks,$r,r),o.value="function"==typeof t.value?t.value:e=>e.datum.value,o.label="function"==typeof t.label?t.label:e=>e.datum.value;let a=Lr(o);const{values:s,labels:l,items:c,ticks:h}=function(e,t,n){const i=t.ticks.depth,r=t.value,o=t.label,a=[],s=[],l={},c=[];let h=0;if(!e)return{values:a,labels:s,items:l,ticks:c};e.eachAfter((e=>{if(e.depth>0){const t=Br(e,r,n),d=e.leaves()||[e],f=r(u({datum:e.data},n)),p=o(u({datum:e.data},n)),g=Array.isArray(e.children),m={key:t,count:d.length,value:f,label:p,leftEdge:Br(d[0],r,n),rightEdge:Br(d[Math.max(d.length-1,0)],r,n),node:e};g?(a.push("SPACER_".concat(h,"_SPACER")),h++):(a.push(t),s.push(p)),(i<=0&&!g||e.depth===i)&&c.push(m),l[t]=m}}));const d=e.height-1;return d>0&&a.splice(-d),{values:a,labels:s,items:l,ticks:c}}(n.root,o,r),d=function(e){const t=String(e),n=c[t];return a(n?o.invert?n.rightEdge:n.leftEdge:t)};u(!0,d,a),d.bandwidth=function(e){const t=c[String(e)],n=a.bandwidth();if(t&&!t.isLeaf){const e=d(t.leftEdge),i=d(t.rightEdge);return Math.abs(e-i)+n}return n},d.step=function(e){const t=c[String(e)],n=t?t.count:1;let i=a.step();return i*=n,i},d.data=()=>n,d.datum=e=>{const t=c[String(e)];return t?t.node.data:null},d.copy=()=>e(t,n,i),d.labels=()=>l,d.ticks=()=>h.map((e=>{const t=d(e.key),n=d.bandwidth(e.key);return{position:t+n/2,label:e.label,data:e.node.data,start:t,end:t+n}}));const f=a.pxScale;return d.pxScale=function(e){return a=f(e),d},d.domain(s),d})),Qr("sequential-color",Yr),Qr("threshold-color",(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=Mr(),r=zr(e,Kr,{data:t,resources:n}),o=Array.isArray(r.domain)&&r.domain.length,a=Array.isArray(r.range)&&r.range.length;function s(e){return y(e)?NaN:i(e)}Object.keys(i).forEach((e=>s[e]=i[e]));const l=t.fields,[c,u]=Vr(r,l),h=o?r.domain.length:-1,d=n.theme?n.theme.palette("sequential",h>0?h:2):[];let f=a?r.range:d,p=[];return p=o?r.domain:r.nice?function(e,t,n){const i=2===e.length?10:Math.max(1,e.length),r=_r().domain([t,n]).nice(i).ticks(i);if(!e||!e.length)return r;const o=Math.max(0,e.length-1);for(;r.length>o;)r[0]-t<=n-r[r.length-1]?r.shift():r.pop();return r}(f,c,u):[c+(u-c)/2],f.length>p.length+1?p=function(e,t,n){const i=e.length;if(2===i)return[t+(n-t)/2];const r=[],o=(n-t)/i;for(let e=1;e<i;e++)r.push(t+o*e);return r}(f,c,u):f.length<p.length+1&&(f=function(e,t,n,i){n=e[0],i=e&&e.length>=2?e[e.length-1]:i;const r=Yr().domain([n,i]).range(t);return[n,...Xr(e),i].map((e=>r(e)))}(p,f,c,u)),s.data=()=>t,s.range(r.invert?f.slice().reverse():f),s.domain(p),s})),Qr("categorical-color",(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=vi(),r={data:t,resources:n},o=zr(e,Gr,r),a="function"==typeof e.value?e.value:e=>e.datum.value,s="function"==typeof e.label?e.label:e=>e.datum.label,l=t.items||[],c={},h=[],d=[];for(let e=0;e<l.length;e++){const t=u({datum:l[e]},r),n=a(t,e);-1===h.indexOf(n)&&(h.push(n),d.push(s(t,e)),c[n]=e)}return i.data=()=>t,i.labels=()=>d,i.label=e=>d[h.indexOf(e)],i.datum=e=>l[c[e]],i.range(o.range),Array.isArray(o.domain)&&o.domain.length?i.domain(o.domain):i.domain(h),i}(e,t,n),r=n.theme,o=zr(e,Jr,{data:t,resources:n});let a;if(o.explicit=zr(e.explicit,Zr,{data:t,resources:n}),a=Array.isArray(o.range)&&0!==o.range.length?o.range.slice():r?r.palette("categorical",i.domain().length).slice():[],o.unknown)i.unknown(o.unknown);else if(r&&r.palette("unknown")){let e=r.palette("unknown");i.unknown(e[0])}if(Array.isArray(o.explicit.domain)&&o.explicit.domain.length){const e=i.domain().slice(),t=o.explicit.domain,n=Array.isArray(o.explicit.range)?o.explicit.range:[],r=Math.floor(e.length/a.length);for(let e=1;e<r+1;e*=2)a=a.concat(a);if(o.explicit.override)for(let i=0;i<t.length;i++){const r=e.indexOf(t[i]);r>-1&&(a[r]=n[i])}else{const i=t.map(((t,i)=>[e.indexOf(t),t,n[i]])).sort(((e,t)=>e[0]-t[0]));i.forEach((t=>{const n=e.indexOf(t[1]);-1!==n&&a.splice(n,0,t[2])}))}a.length=e.length}return i.range(a),i}));var to={};function no(){no.init.call(this)}to.isObject=function(e){return"object"==typeof e&&null!==e},to.isNumber=function(e){return"number"==typeof e},to.isUndefined=function(e){return void 0===e},to.isFunction=function(e){return"function"==typeof e};var io=no;no.EventEmitter=no,no.prototype._events=void 0,no.prototype._maxListeners=void 0,no.defaultMaxListeners=10,no.init=function(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0},no.prototype.setMaxListeners=function(e){if(!to.isNumber(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},no.prototype.emit=function(e){var t,n,i,r,o,a;if(this._events||(this._events={}),"error"===e&&!this._events.error)throw(t=arguments[1])instanceof Error?t:Error('Uncaught, unspecified "error" event.');if(n=this._events[e],to.isUndefined(n))return!1;if(to.isFunction(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:for(i=arguments.length,r=new Array(i-1),o=1;o<i;o++)r[o-1]=arguments[o];n.apply(this,r)}else if(to.isObject(n)){for(i=arguments.length,r=new Array(i-1),o=1;o<i;o++)r[o-1]=arguments[o];for(i=(a=n.slice()).length,o=0;o<i;o++)a[o].apply(this,r)}return!0},no.prototype.addListener=function(e,t){var n;if(!to.isFunction(t))throw TypeError("listener must be a function");(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,to.isFunction(t.listener)?t.listener:t),this._events[e]?to.isObject(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,to.isObject(this._events[e])&&!this._events[e].warned)&&((n=to.isUndefined(this._maxListeners)?no.defaultMaxListeners:this._maxListeners)&&n>0&&this._events[e].length>n&&(this._events[e].warned=!0,to.isFunction(console.error)&&console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),to.isFunction(console.trace)&&console.trace()));return this},no.prototype.on=no.prototype.addListener,no.prototype.once=function(e,t){if(!to.isFunction(t))throw TypeError("listener must be a function");var n=!1;function i(){this.removeListener(e,i),n||(n=!0,t.apply(this,arguments))}return i.listener=t,this.on(e,i),this},no.prototype.removeListener=function(e,t){var n,i,r,o;if(!to.isFunction(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(r=(n=this._events[e]).length,i=-1,n===t||to.isFunction(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(to.isObject(n)){for(o=r;o-- >0;)if(n[o]===t||n[o].listener&&n[o].listener===t){i=o;break}if(i<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(i,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},no.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],to.isFunction(n))this.removeListener(e,n);else if(Array.isArray(n))for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},no.prototype.listeners=function(e){return this._events&&this._events[e]?to.isFunction(this._events[e])?[this._events[e]]:this._events[e].slice():[]},no.listenerCount=function(e,t){return e._events&&e._events[t]?to.isFunction(e._events[t])?1:e._events[t].length:0};var ro={mixin:e=>(Object.keys(io.prototype).forEach((t=>{e[t]=io.prototype[t]})),io.init(e),e)};function oo(){let e=0,t=0,n=0,i=0;n=n||e;const r={move(e){this.moveTo(n+e)},moveTo(o){const a=Math.max(e,Math.min(t-i,o));n!==a&&(n=a,r.emit("update"))},update(o){let a=!1;({min:e=e,max:t=t}=o),void 0!==o.viewSize&&o.viewSize!==i&&(i=o.viewSize,a=!0);const s=Math.max(e,Math.min(t-i,n));n!==s&&(n=s,a=!0),a&&r.emit("update")},getState:()=>({min:e,max:t,start:n,viewSize:i})};return ro.mixin(r),r}function ao(e,t){const n=e.min||0,i=e.max||0,r=e.viewSize||0,o=t||oo();return o.update({min:n,max:i,viewSize:r}),o}function so(e,t){return e<=t}function lo(e,t){return e<t}function co(e,t,n){let i=0;for(;i<e.length&&t>e[i];)++i;return e[i]===t&&n&&++i,i}function uo(){let e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=[];function r(){}return r.configure=function(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{includeMax:i=!0,includeMin:r=!0}=n;e=i?so:lo,t=r?so:lo},r.add=e=>{let{min:t,max:n}=e;const r=co(i,t),o=co(i,n,!0),a=[r,o-r];r%2==0&&a.push(t),o%2==0&&a.push(n);const s=i.join(",");i.splice(...a);return s!==i.join(",")},r.remove=e=>{let{min:t,max:n}=e;const r=co(i,t),o=co(i,n,!0),a=[r,o-r];r%2==1&&a.push(t),o%2==1&&a.push(n);const s=i.join(",");i.splice(...a);return s!==i.join(",")},r.set=e=>{const t=i.join(",");i=[],Array.isArray(e)?e.forEach(r.add):r.add(e);return t!==i.join(",")},r.clear=()=>{const e=i.length>0;return i=[],e},r.containsValue=n=>function(e,t,n,i){const r=e.length;for(let o=1;o<r;o+=2)if(n(e[o-1],t)&&i(t,e[o]))return!0;return!1}(i,n,t,e),r.containsRange=e=>{let{min:t,max:n}=e;const r=co(i,t,!0),o=co(i,n);return r===o&&o%2==1},r.toggle=e=>r.containsRange(e)?r.remove(e):r.add(e),r.ranges=()=>{const e=[];for(let t=1;t<i.length;t+=2)e.push({min:i[t-1],max:i[t]});return e},r.configure(n),r}function ho(){let e=[];function t(){}return t.add=t=>-1===e.indexOf(t)&&(e.push(t),!0),t.remove=t=>{const n=e.indexOf(t);return-1!==n&&(e.splice(n,1),!0)},t.contains=t=>-1!==e.indexOf(t),t.values=()=>e.slice(),t.clear=()=>e=[],t.toString=()=>e.join(";"),t}const fo={key:void 0,includeMin:!0,includeMax:!0};function po(e){let{items:t,collection:n,vc:i}=e;const r={},o=[];let a,s;for(let e=0,o=t.length;e<o;e++){a=t[e].key,n[a]||(n[a]=i()),s=t[e].values||[t[e].value];for(let e=0;e<s.length;e++)n[a].add(s[e])&&(r[a]=r[a]||[],r[a].push(s[e]))}const l=Object.keys(r);for(let e=0,t=l.length;e<t;e++)a=l[e],o.push({id:a,values:r[a]});return o}function go(e){let{items:t,collection:n}=e;const i={},r=[];let o,a;for(let e=0,r=t.length;e<r;e++)if(o=t[e].key,n[o]){a=t[e].values||[t[e].value];for(let e=0;e<a.length;e++)n[o].remove(a[e])&&(i[o]=i[o]||[],i[o].push(a[e]))}const s=Object.keys(i);for(let e=0,t=s.length;e<t;e++)o=s[e],r.push({id:o,values:i[o]});return r}function mo(e){const t={};let n,i;for(let r=0,o=e.length;r<o;r++){n=e[r].key,i=e[r].values||[e[r].value],t[n]||(t[n]=[]);for(let e=0;e<i.length;e++){-1===t[n].indexOf(i[e])&&t[n].push(i[e])}}return t}function yo(e){let{key:t,collection:n,obj:i,fn:r,value:o}=e;n[t]||(n[t]=r()),i[t]=i[t]||[],i[t].push(o),n[t].add(o)}function vo(e,t){const n=[],i=Object.keys(e);let r,o;const a=e=>-1===t[r].indexOf(e);for(let s=0,l=i.length;s<l;s++)r=i[s],t[r]?(o=e[r].filter(a),o.length&&n.push({id:r,values:o})):n.push({id:r,values:e[r]});return n}function xo(e,t,n){const i=function(e,t){if(!Object.keys(t).length)return e;const n=e.length,i=Array(n);for(let r=0;r<n;r++)i[r]=e[r].key in t?u({},e[r],{key:t[e[r].key]}):e[r];return i}(t,n);return e&&e.length?e.reduce(((e,t)=>t(e)),i):i}function bo(e){return e.replace(/(-[a-z])/g,(e=>e.toUpperCase().replace("-","")))}function wo(e){return e.replace(/([A-Z])/g,(e=>"-".concat(e.toLowerCase())))}function ko(e,t,n){let{ranges:i,interceptors:r,rc:o,aliases:a,rangeConfig:s}=n;const l=xo(r["".concat(t,"Ranges")],e,a);let c=!1;return l.forEach((e=>{const n=e.key;if(i[n]||(i[n]=o(s.sources[n]||s.default)),"set"===t)c=i[n][t](e.ranges||e.range)||c;else{const r=e.ranges||[e.range];for(let e=0;e<r.length;e++)c=i[n][t](r[e])||c}})),c}function _o(){let{vc:e=ho,rc:t=uo}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=!1,i={},r={},o={},a={sources:{},default:u({},fo)};const s={addValues:[],removeValues:[],toggleValues:[],setValues:[],addRanges:[],setRanges:[],removeRanges:[],toggleRanges:[]},l=()=>{const e={values:{},ranges:{}};return Object.keys(r).forEach((t=>{e.values[t]=r[t].values()})),Object.keys(i).forEach((t=>{e.ranges[t]=i[t].ranges()})),e},c={ls:[],clear(){this.ls.forEach((e=>e.clear()))},start(){this.ls.forEach((e=>e.start()))},end(){this.ls.forEach((e=>e.end()))},update(){const e=l();this.ls.forEach((t=>t._state(e)))},updateValues(){const e=l();this.ls.forEach((t=>t._state({values:e.values})))},updateRanges(){const e=l();this.ls.forEach((t=>t._state({ranges:e.ranges})))}},h={configure:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Array.isArray(e.ranges)&&e.ranges.length&&(a={sources:{},default:u({},fo)},e.ranges.forEach((e=>{const t={};Object.keys(fo).filter((e=>"key"!==e)).forEach((n=>{t[n]=void 0!==e[n]?e[n]:fo[n]})),void 0!==e.key?a.sources[e.key]=t:a.default=t})),Object.keys(i).forEach((e=>i[e].configure(a.sources[e]||a.default))),h.emit("update",[],[]))},link:e=>{if(h===e)throw new Error("Can't link to self");c.ls.push(e),e._state(l())},_state:e=>{if(!e)return l();if(e.values){const t=[];Object.keys(e.values).forEach((n=>{r[n]&&e.values[n].join(";")===r[n].toString()||t.push({key:n,values:e.values[n]})})),Object.keys(r).forEach((n=>{e.values[n]||t.push({key:n,values:[]})})),t.length&&h.setValues(t)}if(e.ranges){const t=[];Object.keys(e.ranges).forEach((n=>{i[n]&&e.ranges[n].join(";")===i[n].toString()||t.push({key:n,ranges:e.ranges[n]})})),Object.keys(i).forEach((n=>{e.ranges[n]||t.push({key:n,ranges:[]})})),t.length&&h.setRanges(t)}},start:function(){if(!n){n=!0;for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];h.emit("start",...t),c.start()}},end:function(){if(n){n=!1,i={},r={};for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];h.emit("end",...t),c.end()}},isActive:()=>n,clear:()=>{const e=h.brushes().filter((e=>"value"===e.type&&e.brush.values().length)).map((e=>({id:e.id,values:e.brush.values()}))),t=Object.keys(i).length>0||e.length;i={},r={},t&&(h.emit("update",[],e),c.clear())},brushes:()=>{let e=[];return e=e.concat(Object.keys(i).map((e=>({type:"range",id:e,brush:i[e]})))),e=e.concat(Object.keys(r).map((e=>({type:"value",id:e,brush:r[e]})))),e},addValue:(e,t)=>{h.addValues([{key:e,value:t}])},addValues:t=>{const i=xo(s.addValues,t,o),a=po({vc:e,collection:r,items:i});h.emit("add-values",i),a.length&&(n||(n=!0,h.emit("start")),h.emit("update",a,[]),c.updateValues())}};return h.setValues=t=>{const i=xo(s.setValues,t,o),a=function(e){let{items:t,vCollection:n,vc:i}=e;const r={},o=mo(t);let a,s=[],l=[];const c={},u=Object.keys(n);for(let e=0,t=u.length;e<t;e++)a=u[e],c[a]=n[a].values().slice(),delete n[a];const h=e=>{n[a]&&n[a].contains(e)||yo({key:a,value:e,collection:n,obj:r,fn:i})},d=Object.keys(o);for(let e=0,t=d.length;e<t;e++)a=d[e],o[a].forEach(h);return l=vo(c,r),s=vo(r,c),[s,l]}({items:i,vCollection:r,vc:e});h.emit("set-values",i),(a[0].length>0||a[1].length>0)&&(n||(n=!0,h.emit("start")),h.emit("update",a[0],a[1]),c.updateValues())},h.removeValue=(e,t)=>{h.removeValues([{key:e,value:t}])},h.removeValues=e=>{const t=xo(s.removeValues,e,o),n=go({collection:r,items:t});h.emit("remove-values",t),n.length&&(h.emit("update",[],n),c.updateValues())},h.addAndRemoveValues=(t,i)=>{const a=xo(s.addValues,t,o),l=xo(s.removeValues,i,o),u=po({vc:e,collection:r,items:a}),d=go({collection:r,items:l});h.emit("add-values",a),h.emit("remove-values",l),(u.length||d.length)&&(n||(n=!0,h.emit("start")),h.emit("update",u,d),c.updateValues())},h.toggleValue=(e,t)=>{h.toggleValues([{key:e,value:t}])},h.toggleValues=t=>{const i=xo(s.toggleValues,t,o),a=function(e){let{items:t,values:n,vc:i}=e;const r={},o={},a=[],s=[],l=mo(t);let c,u,h;const d=Object.keys(l);for(let e=0,t=d.length;e<t;e++){c=d[e],h=l[c];for(let e=0,t=h.length;e<t;e++)u=h[e],n[c]&&n[c].contains(u)?n[c]&&n[c].contains(u)&&(o[c]=o[c]||[],o[c].push(u),n[c].remove(u)):yo({key:c,value:u,collection:n,obj:r,fn:i})}const f=Object.keys(r);for(let e=0,t=f.length;e<t;e++)c=f[e],a.push({id:c,values:r[c]});const p=Object.keys(o);for(let e=0,t=p.length;e<t;e++)c=p[e],s.push({id:c,values:o[c]});return[a,s]}({items:i,values:r,vc:e});h.emit("toggle-values",i),(a[0].length>0||a[1].length>0)&&(n||(n=!0,h.emit("start")),h.emit("update",a[0],a[1]),c.updateValues())},h.containsValue=(e,t)=>{let n=o[e]||e;return!!r[n]&&r[n].contains(t)},h.addRange=(e,t)=>{h.addRanges([{key:e,range:t}])},h.addRanges=e=>{ko(e,"add",{ranges:i,rc:t,interceptors:s,aliases:o,rangeConfig:a})&&(n||(n=!0,h.emit("start")),h.emit("update",[],[]),c.updateRanges())},h.removeRange=(e,t)=>{h.removeRanges([{key:e,range:t}])},h.removeRanges=e=>{ko(e,"remove",{ranges:i,rc:t,interceptors:s,aliases:o,rangeConfig:a})&&(n||(n=!0,h.emit("start")),h.emit("update",[],[]),c.updateRanges())},h.setRange=(e,t)=>{h.setRanges([{key:e,range:t}])},h.setRanges=e=>{ko(e,"set",{ranges:i,rc:t,interceptors:s,aliases:o,rangeConfig:a})&&(n||(n=!0,h.emit("start")),h.emit("update",[],[]),c.updateRanges())},h.toggleRange=(e,t)=>{h.toggleRanges([{key:e,range:t}])},h.toggleRanges=e=>{ko(e,"toggle",{ranges:i,rc:t,interceptors:s,aliases:o,rangeConfig:a})&&(n||(n=!0,h.emit("start")),h.emit("update",[],[]),c.updateRanges())},h.containsRangeValue=(e,t)=>{let n=o[e]||e;return!!i[n]&&i[n].containsValue(t)},h.containsRange=(e,t)=>{let n=o[e]||e;return!!i[n]&&i[n].containsRange(t)},h.containsMappedData=(e,t,n)=>{let a=[];const s=Object.keys(e);let l,c,u,h;for(let t=0,n=s.length;t<n;t++){if(l=s[t],"value"===l)c=e,a[t]={key:"",i:t,bool:!1};else{if("source"===l)continue;c=e[l],a[t]={key:l,i:t,bool:!1}}u=c.source&&c.source.field,void 0!==u&&(void 0!==c.source.key&&(u="".concat(c.source.key,"/").concat(u)),u in o&&(u=o[u]),h=c.value,i[u]?a[t].bool=Array.isArray(h)?i[u].containsRange({min:h[0],max:h[1]}):i[u].containsValue(h):r[u]&&r[u].contains(h)&&(a[t].bool=!0))}return t?(a=a.filter((e=>-1!==t.indexOf(e.key))),"and"===n?!!a.length&&!a.some((e=>!1===e.bool)):"xor"===n?!!a.length&&a.some((e=>e.bool))&&a.some((e=>!1===e.bool)):a.some((e=>e.bool))):a.some((e=>e.bool))},h.intercept=(e,t)=>{const n=bo(e);s[n]&&s[n].push(t)},h.removeInterceptor=(e,t)=>{const n=bo(e);if(!s[n])return;const i=s[n].indexOf(t);-1!==i&&s[n].splice(i,1)},h.removeAllInterceptors=e=>{const t=[];if(e){const n=bo(e);s[n]&&s[n].length&&t.push({name:e,handlers:s[n]})}else Object.keys(s).forEach((e=>{s[e].length&&t.push({name:wo(e),handlers:s[e]})}));t.forEach((e=>{e.handlers.slice().forEach((t=>h.removeInterceptor(e.name,t)))}))},h.addKeyAlias=(e,t)=>{o[e]=t},h.removeKeyAlias=e=>{delete o[e]},ro.mixin(h),h}function Mo(e){return e*e*e}function So(e){return--e*e*e+1}function Ro(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}Ce();const Co=["stroke","fill","color","backgroundColor","thumbColor"];function No(e,t){const n=t?t.length:0,i=e?Math.min(n,e.length):0,r=new Array(i),o=new Array(n);let a;for(a=0;a<i;++a)r[a]=Do(e[a],t[a]);for(;a<n;++a)o[a]=t[a];return function(e){for(a=0;a<i;++a)o[a]=r[a](e);return o}}function Do(e,t,n){const i=typeof t;let r;return null==t||"boolean"===i?function(e){return()=>e}(t):("number"===i?sr:"string"===i?(r=Pi(t))&&Co.includes(n)?(t=r,ir):hr:t instanceof Pi?ir:t instanceof Date?ar:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(t)?rr:Array.isArray(t)?No:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?qo:sr)(e,t)}function qo(e,t){const n={},i={};let r;for(r in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)r in e?n[r]=Do(e[r],t[r],r):i[r]=t[r];return function(e){for(r in n)i[r]=n[r](e);return i}}function Eo(e,t){return e.data?e.data.value:"text"===e.type?e.text:t}const Oo={fontFamily:"Arial",fontSize:"13px",color:"#595959",backgroundColor:"#ffffff",stroke:"#000000",strokeWidth:0,$fill:"#333333"},zo=/^\$/;function Ao(e){const t=typeof e;return"object"!==t&&"function"!==t&&"undefined"!==t}function To(e,t,n){const i=e[t];i&&i.scale&&i.scale.pxScale?i.scale=i.scale.pxScale(n):i&&i.pxScale&&(e[t]=i.pxScale(n))}function Io(e,t){return e.pxScale?e.pxScale(t):e}const jo={normalizeSettings:function(e,t,n){const i=u({},e),r=u({},t);return Object.keys(i).forEach((e=>{r[e]={};const o=i[e],a=typeof o;if("function"==typeof o)r[e].fn=o;else if(Ao(o)){let n=t[e];"string"==typeof n&&zo.test(n)&&(n=Oo[n]);const i=typeof n;r[e]="undefined"===i||i===a?o:n}else o&&"object"==typeof o&&("function"==typeof o.fn&&(r[e].fn=o.fn),void 0!==o.scale&&(r[e].scale=n.scale(o.scale)),"string"==typeof o.ref&&(r[e].ref=o.ref))})),Object.keys(t).forEach((e=>{if(e in i)return;const n=t[e];"string"===typeof n&&zo.test(n)?r[e]=Oo[n]:r[e]=n})),r},resolveForItem:function(e,t,n){const i={},r=Object.keys(t),o=r.length,a=e.datum,s=e.datum;for(let l=0;l<o;l++){const o=r[l],c=t[o],u="object"==typeof s&&void 0!==c,h=u&&"string"==typeof c.ref,d=u&&o in s,f=h?s[c.ref]:d?s[o]:a;Ao(c)?i[o]=c:u&&c.fn?(c.scale&&(e.scale=c.scale),i[o]=c.fn.call(null,e,n)):u&&c.scale&&f?(i[o]=c.scale(f.value),c.scale.bandwidth&&(i[o]+=c.scale.bandwidth()/2)):h&&f?i[o]=f.value:c.fn?i[o]=c.fn.call(null,e,n):i[o]=c}return i},updateScaleSize:To};function Po(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce(((e,t)=>Array.isArray(t.children)?(e.push(...Po(t.children)),e):(e.push(t),e)),[])}function Fo(e,t){let{context:n,data:i,style:r,filter:o,mode:a}=t;const s=e.chart.brush(n),l=i,c=r.active||{},h=r.inactive||{},d=[];Object.keys(c).forEach((e=>{d.push(e)})),Object.keys(h).forEach((e=>{-1===d.indexOf(e)&&d.push(e)}));const f=[];let p=!1;const g=()=>{let t=Po(e.nodes);return"function"==typeof o&&(t=t.filter(o)),t},m=()=>{const e=g(),t=e.length;let n,i=!1;const r="function"==typeof l?l({brush:s}):l;for(let i=0;i<t;i++){if(n=e[i].data,!n)continue;e[i].__style||(e[i].__style={},d.forEach((t=>{e[i].__style[t]=e[i][t]})));const t=s.containsMappedData(n,r,a),o=f.indexOf(e[i]);let l=!1;t&&-1===o?(f.push(e[i]),l=!0):t||-1===o||(f.splice(o,1),l=!0),e[i].needToUpdate=l||p,e[i].isActive=t}for(let r=0;r<t;r++)if(n=e[r].data,n){if(e[r].needToUpdate){const t=u({},e[r],e[r].__style),n=e[r].isActive;d.forEach((i=>{e[r][i]=n&&i in c?"function"==typeof c[i]?c[i].call(null,t,f):c[i]:!n&&i in h?"function"==typeof h[i]?h[i].call(null,t,f):h[i]:e[r].__style[i]})),i=!0}delete e[r].needToUpdate}return p=!1,i},y=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{suppressRender:!1};const{suppressRender:n}=t,i=g(),r=i.length;for(let e=0;e<r;e++)i[e].data&&(i[e].__style=i[e].__style||{},d.forEach((t=>{i[e].__style[t]=i[e][t],t in h&&(i[e][t]="function"==typeof h[t]?h[t].call(null,i[e]):h[t])})));p=!0,f.length=0,n||e.renderer.render(e.nodes)},v=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{suppressRender:!1};const{suppressRender:n}=t,i=g(),r=i.length;for(let e=0;e<r;e++)i[e].__style&&(Object.keys(i[e].__style).forEach((t=>{i[e][t]=i[e].__style[t]})),i[e].__style=void 0);f.length=0,n||e.renderer.render(e.nodes)},x=()=>{if(m()){const t="function"==typeof e.config.sortNodes?e.config.sortNodes(e):e.nodes;"function"==typeof e.config.customRender?e.config.customRender({render:e.renderer.render,nodes:t}):e.renderer.render(t)}};return s.on("start",y),s.on("end",v),s.on("update",x),{isActive:()=>s.isActive(),update:()=>{f.length=0,p=!0,m()},cleanUp:function(){s.removeListener("start",y),s.removeListener("end",v),s.removeListener("update",x)}}}function Lo(e){let{nodes:t,action:n,chart:i,trigger:r}=e;const o=[];for(let e=0;e<t.length;e++){let n=t[e].data;null!==n&&o.push(n)}!function(e){let{dataPoints:t,action:n,chart:i,trigger:r}=e;if(!r)return;const o=r.data||[""];let a={items:[],actionFn:"toggleRanges"},s={items:[],actionFn:"toggleValues"};-1!==["add","remove","set","toggle"].indexOf(n)&&(a.actionFn="".concat(n,"Ranges"),s.actionFn="".concat(n,"Values"));for(let e=0;e<t.length;e++){const n=t[e];n&&o.forEach((e=>{let t=n&&!e?n:n[e];if(t){let e={key:t.source.field};void 0!==t.source.key&&(e.key="".concat(t.source.key,"/").concat(t.source.field)),Array.isArray(t.value)?(e.range={min:t.value[0],max:t.value[1]},a.items.push(e)):(e.value=t.value,s.items.push(e))}}))}r.contexts.forEach((e=>{a.items.length?i.brush(e)[a.actionFn](a.items):i.brush(e)[s.actionFn](s.items)}))}({dataPoints:o,action:n,chart:i,trigger:r})}function $o(e){let{collisions:t,t:n,config:i,action:r}=e,o=[],a=!1;t.length>0&&(o=t,a=!0,"stop"===n.propagation&&(o=[t[t.length-1]]));const s=o.map((e=>e.node));return Lo({nodes:s,action:r,chart:i.chart,data:i.data,trigger:n}),a}function Bo(e,t,n){const i=n.element().getBoundingClientRect();let r=g(e)?function(e,t){return 1!==e.changedTouches.length?null:{x:e.changedTouches[0].clientX-t.left,y:e.changedTouches[0].clientY-t.top}}(e,i):function(e,t){return{x:e.clientX-t.left,y:e.clientY-t.top}}(e,i);return null===r||r.x<0||r.y<0||r.x>i.width||r.y>i.height?[]:(t.touchRadius>0&&g(e)?r={cx:r.x,cy:r.y,r:t.touchRadius}:t.mouseRadius>0&&!g(e)&&(r={cx:r.x,cy:r.y,r:t.mouseRadius}),n.itemsAt(r))}function Ho(e,t,n){return e?"function"==typeof e?e(t):e:n}const Wo={fill:"fill",stroke:"stroke",opacity:"opacity",strokeWidth:"stroke-width",strokeLinejoin:"stroke-linejoin",fontFamily:"font-family",fontSize:"font-size",fontStyle:"font-style",textDecoration:"text-decoration",fontWeight:"font-weight",baseline:"dominant-baseline",dominantBaseline:"dominant-baseline",anchor:"text-anchor",textAnchor:"text-anchor",maxWidth:"maxWidth",transform:"transform",strokeDasharray:"stroke-dasharray",id:"id"};function Vo(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n="";for(let t=0;t<e.length;t++){const i=e[t];n+=0===t?"M".concat(i.x," ").concat(i.y):"L".concat(i.x," ").concat(i.y),n+=" "}return t&&(n+="Z"),n}function Uo(e,t,n,i){const r=n/2,o=e-i/2,a=t-i/2,s=e-r,l=t-r;return[{x:o,y:a},{x:o,y:l},{x:o+i,y:l},{x:o+i,y:a},{x:s+n,y:a},{x:s+n,y:a+i},{x:o+i,y:a+i},{x:o+i,y:l+n},{x:o,y:l+n},{x:o,y:a+i},{x:s,y:a+i},{x:s,y:a}]}function Yo(e){return-e/180*Math.PI}function Ko(e){return function(e){let t=(.5*(Math.floor(e/Math.PI*2)+2)+.25)*Math.PI,n=Math.cos(Math.abs(t-e))*Math.sqrt(2),i=n*Math.cos(e),r=n*Math.sin(e);return{x1:i<0?1:0,y1:r<0?1:0,x2:i>=0?i:i+1,y2:r>=0?r:r+1}}(Yo(e))}function Xo(e,t){return{x:e.x+t.x,y:e.y+t.y}}function Go(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Jo(e,t){return{x:e.x*t,y:e.y*t}}function Zo(e,t){return e.x-t.x}function Qo(e,t){return e.y-t.y}function ea(e,t){return Zo(e,t)**2+Qo(e,t)**2}function ta(e,t){return Math.sqrt(ea(e,t))}function na(e,t){return e.x*t.x+e.y*t.y}function ia(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{x:0,y:0};const i=Math.cos(t),r=Math.sin(t),o=Go(e,n);return Xo({x:i*o.x-r*o.y,y:r*o.x+i*o.y},n)}const ra={up:0,down:180,left:90,right:-90};function oa(e){let{x:t,y:n,size:i}=e;const r=i/2;return{type:"rect",x:t-r,y:n-r,width:i,height:i}}const aa=Ce();aa.add("circle",(function(e){return{type:"circle",fill:"black",cx:e.x,cy:e.y,r:e.size/2}})),aa.add("diamond",(function(e){const t=e.size,n=e.x-t/2,i=e.y-t/2;return{type:"path",fill:"black",d:Vo([{x:n,y:i+t/2},{x:n+t/2,y:i},{x:n+t,y:i+t/2},{x:n+t/2,y:i+t},{x:n,y:i+t/2}])}})),aa.add("saltire",(function(e){const t=Yo(45),n=e.size/2,i=isNaN(e.width)?n/2:e.width,r=Math.min(i,n);let o=e.size;const a=Math.sin(Math.asin(-t))*(r/2);o+=2*(n/Math.sin(-t)-n),o-=2*a;const s={x:e.x,y:e.y},l=Uo(e.x,e.y,o,r).map((e=>ia(e,t,s)));return{type:"path",fill:"black",d:Vo(l)}})),aa.add("square",(function(e){const t=e.size;return{type:"rect",fill:"black",x:e.x-t/2,y:e.y-t/2,width:t,height:t}})),aa.add("triangle",(function(e){const t=e.size,n={x:e.x,y:e.y},i=ra[e.direction]||0,r=t/2,o=e.x-r,a=e.y-r;let s=[{x:o,y:a+t},{x:o+r,y:a},{x:o+t,y:a+t},{x:o,y:a+t}];const l=Yo(i);return s=s.map((e=>ia(e,l,n))),{type:"path",fill:"black",d:Vo(s)}})),aa.add("line",(function(e){const t="vertical"===e.direction,n=e.size/2,i=e.x,r=e.y;return{type:"line",stroke:"black",strokeWidth:1,x1:i-(t?0:n),y1:r-(t?n:0),x2:i+(t?0:n),y2:r+(t?n:0),collider:oa(e)}})),aa.add("star",(function(e){const t=e.size,n=[],i=t/2,r=e.points||5,o=Math.min(e.innerRadius||t/2,t)/2,a=isNaN(e.startAngle)?90:e.startAngle,s=360/r;for(let t=1;t<=r;t++){const r=s*t+a,l=Yo(r),c=Yo(r+s/2),u=Math.sin(l),h=Math.cos(l),d=Math.sin(c),f=Math.cos(c);n.push({x:e.x+h*i,y:e.y+u*i}),n.push({x:e.x+f*o,y:e.y+d*o})}return{type:"path",fill:"black",d:Vo(n)}})),aa.add("n-polygon",(function(e){const t=[],n=e.size/2,i=Math.max(isNaN(e.sides)?6:e.sides,3),r=360/i,o=isNaN(e.startAngle)?0:e.startAngle;for(let a=1;a<=i;a++){const i=Yo(r*a+o),s=Math.sin(i),l=Math.cos(i);t.push({x:e.x+l*n,y:e.y+s*n})}return{type:"path",fill:"black",d:Vo(t)}})),aa.add("cross",(function(e){const t=e.x,n=e.y,i=e.size/2,r=isNaN(e.width)?i/2:e.width,o=Math.min(r,i);return{type:"path",fill:"black",d:Vo(Uo(t,n,e.size,o))}})),aa.add("bar",(function(e){const t={x:e.x,y:e.y},n="vertical"===e.direction,i=e.size/2,r=i/2/2;let o=[{x:t.x-i,y:t.y+r},{x:t.x-i,y:t.y-r},{x:t.x+i,y:t.y-r},{x:t.x+i,y:t.y+r}];if(n){const e=Yo(90);o=o.map((n=>ia(n,e,t)))}const a=w(o);return a.type="rect",a.fill="black",a})),aa.add("rect",(function(e){const{x:t,y:n,size:i}=e,r=void 0===e.width?i:e.width,o=void 0===e.height?i:e.height;return{type:"rect",fill:"black",x:t-r/2,y:n-o/2,width:r,height:o}}));const sa=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:aa;return function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n=e.get(t.type);if(n){const e=n(t);return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object.keys(t).forEach((n=>{void 0!==Wo[n]&&"transform"!==n&&(e[n]=t[n])}))}(e,t),void 0!==t.data&&(e.data=t.data),e}return n}};function la(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{dock:n="center",displayOrder:i=0,prioOrder:r=0,preferredSize:o=0,minimumLayoutMode:a,show:s=!0}=e;n=n||"center";return{computePreferredSize(e){let{inner:n,outer:i,children:r}=e;return"function"==typeof o?o({inner:n,outer:i,children:r,dock:this.dock()},t):o},dock(e){return void 0!==e?(n=e,this):"function"==typeof n?n(t):n},displayOrder(e){return void 0!==e?(i=e,this):"function"==typeof i?i(t):i},prioOrder(e){return void 0!==e?(r=e,this):"function"==typeof r?r(t):r},minimumLayoutMode(e){return void 0!==e?(a=e,this):"function"==typeof a?a(t):a},show(e){return void 0!==e?(s=e,this):"function"==typeof s?s(t):s}}}function ca(e,t,n){const{require:i=[]}=t,r=t.mediator||{},{settings:o,formatter:a,scale:s,data:l,renderer:c,chart:u,dockConfig:h,mediator:d,instance:f,rect:p,style:g,registries:m,resolver:y,update:v,_DO_NOT_USE_getInfo:x,symbol:b,isVisible:w}=n;e.emit=()=>{},w&&(e.isVisible=w),Object.defineProperty(e,"settings",{get:o}),Object.defineProperty(e,"data",{get:l}),Object.defineProperty(e,"formatter",{get:a}),Object.defineProperty(e,"scale",{get:s}),Object.defineProperty(e,"mediator",{get:d}),Object.defineProperty(e,"style",{get:g}),Object.defineProperty(e,"registries",{get:m}),p&&Object.defineProperty(e,"rect",{get:p}),x&&(e._DO_NOT_USE_getInfo=x),Object.keys(t).forEach((n=>{var i;i=n,["on","preferredSize","created","beforeMount","mounted","resize","beforeUpdate","updated","beforeRender","render","beforeUnmount","beforeDestroy","destroyed","defaultSettings","data","settings","formatter","scale","chart","dockConfig","mediator","style","resolver","registries","_DO_NOT_USE_getInfo","symbol","isVisible"].some((e=>e===i))||("function"==typeof t[n]?e[n]=t[n].bind(e):e[n]=t[n])})),i.forEach((t=>{"renderer"===t?Object.defineProperty(e,"renderer",{get:c}):"chart"===t?Object.defineProperty(e,"chart",{get:u}):"dockConfig"===t?Object.defineProperty(e,"dockConfig",{get:h}):"instance"===t?Object.defineProperty(e,"instance",{get:f}):"update"===t&&v?Object.defineProperty(e,"update",{get:v}):"resolver"===t?Object.defineProperty(e,"resolver",{get:y}):"symbol"===t&&Object.defineProperty(e,"symbol",{get:b})})),Object.keys(r).forEach((t=>{e.mediator.on(t,r[t].bind(e))}))}function ua(e,t,n){const i=t=>e[t]?(n.warn("Deprecation Warning the ".concat(t," property should be moved into layout: {} property")),e[t]):e.layout?e.layout[t]:void 0,r={};return r.displayOrder=i("displayOrder"),r.dock=i("dock"),r.prioOrder=i("prioOrder"),r.minimumLayoutMode=i("minimumLayoutMode"),e.layout=e.layout||{},e.layout.displayOrder=void 0!==r.displayOrder?r.displayOrder:e.layout.displayOrder,e.layout.prioOrder=void 0!==r.prioOrder?r.prioOrder:e.layout.prioOrder,e.layout.dock=r.dock||e.layout.dock,e.layout.minimumLayoutMode=r.minimumLayoutMode||e.layout.minimumLayoutMode,r.show=e.show,r.preferredSize=t,r}function ha(e,t,n){Object.keys(n.on||{}).forEach((i=>{e.eventListeners=e.eventListeners||[];const r=n.on[i].bind(e);e.eventListeners.push({event:i,listener:r}),t.on(i,r)})),e.emit=function(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return t.emit(e,...i)}}function da(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{defaultSettings:n={},_DO_NOT_USE_getInfo:i=()=>({})}=e,{chart:r,container:o,mediator:a,registries:s,theme:l,renderer:c}=t,h=ro.mixin({});let d,f,g,m,y,v=t.settings||{},x=u(!0,{},n,v),b=[],w=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:jo,n={};return{resolve:function(i){let{data:r,settings:o,defaults:a={},scaled:s}=i;const l=n.norm=t.normalizeSettings(o,a,e.chart),c={scale:e.chart.scale,formatter:e.chart.formatter};s&&Object.keys(s).forEach((e=>{l[e]&&t.updateScaleSize(l,e,s[e])}));const u=[];if(!r||!Array.isArray(r.items)){const e={data:r,resources:c};let i=t.resolveForItem(e,n.norm,-1);return{settings:n.norm,item:i}}{let e;for(let i=0,o=r.items.length;i<o;i++){e={datum:r.items[i],data:r,resources:c};let o=t.resolveForItem(e,n.norm,i);o.data=r.items[i],u.push(o)}}return{settings:n.norm,items:u}}}}({chart:r}),k=!1;const _={nodes:[],chart:r,config:x.brush||{},renderer:null},M={tap:[],over:[]},S=[],R={},C=u({},v);function N(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{},i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(){const r=void 0!==e[t],o=void 0!==v[t];let a;for(var s=arguments.length,l=new Array(s),c=0;c<s;c++)l[c]=arguments[c];return r&&("function"==typeof e[t]?a=e[t].call(R,...l):i&&(a=e[t])),o&&("function"==typeof v[t]?a=v[t].call(C,...l):i&&(a=v[t])),r||o||(a=n.call(R,...l)),a}}const D=N("preferredSize",(()=>0),!0),q=N("resize",(e=>{let{inner:t}=e;return t})),E=N("created"),O=N("beforeMount"),z=N("mounted"),A=N("beforeUnmount"),T=N("beforeUpdate"),I=N("updated"),j=N("beforeRender"),P=N("beforeDestroy"),F=N("destroyed"),L=e.render,$=()=>{x.brush&&(x.brush.consume||[]).forEach((e=>{e.context&&e.style&&S.push(Fo(_,e))}))},B=()=>{x.brush&&(x.brush.trigger||[]).forEach((e=>{"over"===e.on?M.over.push(e):M.tap.push(e)}))};Object.defineProperty(_,"data",{get:()=>b});const H=x.renderer||e.renderer,W=H?c||s.renderer(H)():c||s.renderer()();"function"==typeof W.settings&&W.settings(x.rendererSettings),_.renderer=W;const V={resources:r.logger?{logger:r.logger()}:{}};let U=la(ua(x,D,r.logger()),V);const Y=e=>{e.key=x.key,e.element=W.element()},K=()=>{};K.dockConfig=()=>U,K.set=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e.settings&&(v=e.settings,x=u(!0,{},n,e.settings),U=la(ua(x,D,r.logger()),V),_.config=x.brush||{}),x.scale&&(d=r.scale(x.scale)),x.data){const{rendererSettings:e}=x,t="function"==typeof(null==e?void 0:e.progressive)&&e.progressive(),n=pi(x.data,{dataset:r.dataset,collection:r.dataCollection},{logger:r.logger()},r.dataCollection);t?t.isFirst?(b=n,b.items&&(b.items=[...n.items])):b.items&&(b.items=[...b.items,...n.items||[]]):b=n}else b=d?d.data():[];"string"==typeof x.formatter||"object"==typeof x.formatter?f=r.formatter(x.formatter):d&&d.data().fields&&(f=d.data().fields[0].formatter()),y=l.style(x.style||{})},K.resize=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=q({inner:e,outer:t});m=n?W.size(n):W.size(e),C.rect=u(!0,{computedPhysical:m.computedPhysical,computedOuter:t.computed||t,computedInner:e.computed||e},e),m=u(!0,{computedOuter:t.computed||t,computedInner:e.computed||e},m)},K.getRect=()=>C.rect;const X=()=>{const e=W.renderArgs?W.renderArgs.slice(0):[],{rendererSettings:t}=x;let n=b;const i="function"==typeof(null==t?void 0:t.progressive)&&t.progressive();return b.items&&i&&(n=p(p({},b),{},{items:b.items.slice(i.start,i.end)})),e.push({data:n}),e};let G,J,Z;function Q(e){const{rendererSettings:t}=x,n="function"==typeof(null==t?void 0:t.progressive)&&t.progressive();n?n.isFirst?_.nodes=[...e||[]]:_.nodes&&(_.nodes=[..._.nodes,...e||[]]):_.nodes=e}K.beforeMount=O,K.beforeRender=()=>{j({size:m})},K.render=()=>{const e=L.call(R,...X());Q(e),W.render(e),G=e,J=C.rect.computed},K.hide=()=>{K.unmount(),W.size({x:0,y:0,width:0,height:0}),W.clear()},K.beforeUpdate=()=>{T({settings:x,data:b})},K.update=()=>{Z&&Z.stop();const{rendererSettings:e,brush:t,animations:n}=x;if("function"==typeof(null==e?void 0:e.transform)&&e.transform())return W.render(),void(G=null);const i=L.call(R,...X());Q(i),S.forEach((e=>e.cleanUp())),S.length=0,M.tap=[],M.over=[],t&&($(),B()),S.forEach((e=>{e.isActive()&&e.update()})),G&&n&&("function"==typeof n.enabled?n.enabled():n.enabled)?(n.compensateForLayoutChanges&&n.compensateForLayoutChanges({currentNodes:G,currentRect:C.rect.computed,previousRect:J}),Z=function(e,t,n,i){let r,{old:o,current:a}=e,{renderer:s}=t,l=[],c={nodes:[],ips:[]},h={nodes:[],ips:[]},d={nodes:[],ips:[]},f=[],p=null;const g=n.trackBy||Eo,m={start(){let e={};if(o.forEach(((t,n)=>{let i=g(t,n);e[i]=t})),a.forEach(((t,n)=>{let i=g(t,n);if(e[i]){if("path"===t.type&&t.points&&t.points.length>0&&"trend"!==t.data.source.key){const n=function(e,t){const n=e.points.filter((e=>!e.dummy)),i=t.points.filter((e=>!e.dummy)),r=i.map((e=>e.data.major.value)),o=n.filter((e=>r.includes(e.data.major.value))).map((e=>e.data.major.value)),a=n.filter((e=>o.includes(e.data.major.value))),s=i.filter((e=>o.includes(e.data.major.value)));return{old:a,current:s}}(e[i],t);d.ips.push(qo(u({},e[i],{points:n.old}),u({},t,{points:n.current}))),l.push(u({},e[i],{commonPoints:n.old}))}else d.ips.push(qo(e[i],t)),l.push(e[i]);d.nodes.push(t),e[i]=!1}else c.nodes.push(t),c.ips.push(qo(u({},t,{r:.001,opacity:0}),t))})),Object.keys(e).forEach((t=>{e[t]&&(h.nodes.push(e[t]),h.ips.push(qo(e[t],u({},e[t],{r:1e-4,opacity:0}))))})),f.push({name:"exiting",easing:Mo,duration:200,tweens:h.ips,nodes:[...l]}),f.push({name:"updating",easing:Ro,duration:400,tweens:d.ips,nodes:[]}),f.push({name:"entering",easing:So,duration:200,tweens:c.ips,nodes:[...d.nodes]}),n.isMainComponent){var t;const e=null===(t=n.isMainComponent)||void 0===t?void 0:t.filterFn,r=e?l.filter(e).length:l.length,{isInit:o,shouldBeRemoved:a}=i.getValue("animations.updatingStageMeta");!1===o?(i.setValue("animations.updatingStageMeta.shouldBeRemoved",0===r),i.setValue("animations.updatingStageMeta.isInit",!0)):i.setValue("animations.updatingStageMeta.shouldBeRemoved",a&&0===r)}f.length&&(p=s.getScene(a),f[0].started=Date.now(),"undefined"!=typeof window&&(r=window.requestAnimationFrame(m.tick)))},tick(){let e=f[0];e||m.stop(),e.started||(e.started=Date.now());let t=(Date.now()-e.started)/e.duration,o=[],a=e.tweens.map((n=>n(e.easing(Math.min(1,t)))));const{adjustTweenedNodes:l}=n;if(l&&l(a),o.push(...a),o.push(...e.nodes),s.render(o),t>=1){f.shift();const{isInit:e,shouldBeRemoved:t}=i.getValue("animations.updatingStageMeta");f.length?"updating"===f[0].name&&t&&f.shift():(!0===e&&i.setValue("animations.updatingStageMeta.isInit",!1),m.stop())}r&&(r=window.requestAnimationFrame(m.tick))},stop(){r&&(window.cancelAnimationFrame(r),r=!1)},inProgress:()=>!!r,get targetScene(){return p}};return m}({old:G,current:i},{renderer:W},n,r.storage),Z.start()):W.render(i),G=i,J=C.rect.computed,W.setKey&&"string"==typeof v.key&&W.setKey(v.key)},K.updated=I,K.destroy=()=>{K.unmount(),P(g),W.destroy(),F(),g=null};const ee=e=>{_.nodes=e,S.forEach((e=>{e.isActive()&&e.update()})),W.render(e)};return ca(R,e,{settings:()=>x,data:()=>b,scale:()=>d,formatter:()=>f,renderer:()=>W,chart:()=>r,dockConfig:()=>U,mediator:()=>a,instance:()=>C,rect:()=>C.rect,style:()=>y,update:()=>ee,registries:()=>s,resolver:()=>w,symbol:()=>sa(s.symbol)}),ca(C,v,{settings:()=>x,data:()=>b,scale:()=>d,formatter:()=>f,renderer:()=>W,chart:()=>r,dockConfig:()=>U,mediator:()=>a,style:()=>y,_DO_NOT_USE_getInfo:i.bind(R),isVisible:()=>k}),K.getBrushedShapes=function(e,t,n){const i=[];if(x.brush&&x.brush.consume){const o=r.brush(e),a=W.findShapes("*");x.brush.consume.filter((t=>t.context===e)).forEach((e=>{for(let r=0;r<a.length;r++){const s=a[r];s.data&&o.containsMappedData(s.data,n||e.data,t)&&(Y(s),i.push(s),a.splice(r,1),r--)}}))}return i},K.findShapes=e=>{var t;const n=(null!==(t=Z)&&void 0!==t&&t.inProgress()?Z.targetScene:W).findShapes(e);for(let e=0,t=n.length;e<t;e++)Y(n[e]);return n},K.shapesAt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=W.itemsAt(e);let i;i=t&&"stop"===t.propagation&&n.length>0?[n.pop().node]:n.map((e=>e.node));for(let e=0,t=i.length;e<t;e++)Y(i[e]);return i},K.brushFromShapes=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.contexts=Array.isArray(t.contexts)?t.contexts:[];Lo({nodes:e,action:t.action||"toggle",trigger:t,chart:r,data:_.data})},K.mount=()=>{g=W.element&&W.element()?g:W.appendTo(o),W.setKey&&"string"==typeof v.key&&W.setKey(v.key),x.brush&&($(),B()),ha(C,h,v),ha(R,h,e),k=!0},K.mounted=()=>z(g),K.unmount=()=>{[C,R].forEach((e=>{!function(e,t){e.eventListeners&&(e.eventListeners.forEach((e=>{let{event:n,listener:i}=e;t.removeListener(n,i)})),e.eventListeners.length=0),e.emit=()=>{}}(e,h)})),M.tap=[],M.over=[],S.forEach((e=>{e.cleanUp()})),S.length=0,A(),k=!1},K.onBrushTap=e=>{M.tap.forEach((t=>{(function(e){let{e:t,t:n,config:i}=e;return $o({collisions:Bo(t,n,i.renderer),t:n,config:i,action:Ho(n.action,t,"toggle")})})({e:e,t:t,config:_})&&"stop"===t.globalPropagation&&r.toggleBrushing(!0)}))},K.onBrushOver=e=>{M.over.forEach((t=>{(function(e){let{e:t,t:n,config:i}=e;return $o({collisions:Bo(t,n,i.renderer),t:n,config:i,action:Ho(n.action,t,"set")})})({e:e,t:t,config:_})&&"stop"===t.globalPropagation&&r.toggleBrushing(!0)}))},K.def=R,K.ctx=C,K.renderer=()=>W,K.set({settings:v}),E(),K}function fa(e){const t=u(!0,{},e),n={getAll:()=>t,getValue:(e,n)=>function(e,t,n){if(void 0===e||void 0===t)return n;const i=t.split(".");let r=e;for(let e=0;e<i.length;++e){const t=i[e];if(void 0===r[t])return n;r=r[t]}return r}(t,e,n),setValue:(e,n)=>function(e,t,n){if(void 0===e||void 0===t)return;const i=t.split("."),r=i[i.length-1];let o=e;for(let e=0;e<i.length-1;++e){const t=i[e];void 0===o[t]&&(o[t]=Number.isNaN(+i[e+1])?{}:[]),o=o[t]}void 0!==n?o[r]=n:delete o[r]}(t,e,n)};return n}function pa(e,t,n){const i=Xo(function(e,t){const n=na(e,t)/na(t,t)||1;return{x:t.x*n,y:t.y*n}}(Go(n,e),Go(t,e)),e);return i}function ga(e,t,n){return ta(e,n)+ta(t,n)-ta(e,t)<1e-12}function ma(e,t){return e.x>=t.x&&e.x+e.width<=t.x+t.width&&e.y>=t.y&&e.y+e.height<=t.y+t.height}function ya(e){return e.x1===e.x2&&e.y1===e.y2}function va(e){return e.width<=0||e.height<=0}function xa(e){return e.r<=0}function ba(e){return e.edges.length<=2}function wa(e,t){let n=!1;for(let i=0,r=t.edges.length;i<r;i++)if(n=Na(e,k(t.edges[i])),!0===n)return!0;return!1}function ka(e,t){let n=!1;const{numPolygons:i,polygons:r}=t;for(let t=0;t<i;t++){if(n=ja(e,r[t]),!0===n)return!0}return!1}function _a(e,t){if(xa(e))return!1;return ea({x:e.cx,y:e.cy},t)<=e.r**2}function Ma(e,t){if(va(t)||xa(e))return!1;const n=t.width/2,i=t.height/2,r=t.x+n,o=t.y+i,a=e.r,s=e.cx,l=e.cy,c=Math.abs(s-r),u=Math.abs(l-o);if(c>n+a||u>i+a)return!1;if(c<=n||u<=i)return!0;return(c-n)**2+(u-i)**2<=a**2}function Sa(e,t){if(xa(e)||ya(t))return!1;const[n,i]=x(t);if(_a(e,n)||_a(e,i))return!0;const r={x:e.cx,y:e.cy},o=pa(n,i,r);return ea(o,r)<=e.r**2&&ga(n,i,o)}function Ra(e,t){if(ba(t)||xa(e))return!1;if(Ca(t,{x:e.cx,y:e.cy}))return!0;const n=t.edges.length;for(let i=0;i<n;i++){if(Sa(e,k(t.edges[i])))return!0}return!1}function Ca(e,t){if(ba(e)||!Oa(e.boundingRect(),t))return!1;const{x:n,y:i}=t,r=e.vertices;let o,a,s,l,c;for(o=!1,l=-1,a=r.length,s=a-1;++l<a;s=l){if(r[l].x===n&&r[l].y===i)return!0;if(r[l].y===r[s].y&&r[l].y===i&&(n-r[l].x)*(n-r[s].x)<=0)return!0;if(r[l].y<i&&i<=r[s].y||r[s].y<i&&i<=r[l].y){if(c=(r[s].x-r[l].x)*(i-r[l].y)/(r[s].y-r[l].y)+r[l].x,n===c)return!0;n<c&&(o=!o)}}return o}function Na(e,t){if(ba(e))return!1;for(let n=0,i=e.edges.length;n<i;n++){if(Aa(t,k(e.edges[n])))return!0}const[n,i]=x(t);return Ca(e,n)||Ca(e,i)}function Da(e,t){if(ba(e))return!1;for(let n=0,i=e.edges.length;n<i;n++){if(za(t,k(e.edges[n])))return!0}const[n,i,r,o]=b(t);return Ca(e,n)||Ca(e,i)||Ca(e,r)||Ca(e,o)}function qa(e,t){return!va(e)&&!va(t)&&(e.x<=t.x+t.width&&t.x<=e.x+e.width&&e.y<=t.y+t.height&&t.y<=e.y+e.height)}function Ea(e,t){if(va(e)||va(t))return!1;return[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}].every((t=>Oa(e,t)))}function Oa(e,t){return!va(e)&&(t.x>=e.x&&t.x<=e.x+e.width&&t.y>=e.y&&t.y<=e.y+e.height)}function za(e,t){if(ya(t)||va(e))return!1;const[n,i]=x(t);if(Oa(e,n)||Oa(e,i))return!0;const r=b(e);let o=r.length;for(let e=0;e<o;e++){if(Aa(k([r[e],r[3!==e?e+1:0]]),t))return!0}return!1}function Aa(e,t){const[n,i]=x(e),[r,o]=x(t),a=Zo(i,n),s=Qo(i,n),l=Zo(o,r),c=Qo(o,r),u=Zo(n,r),h=Qo(n,r);let d=c*a-l*s;const f=l*h-c*u,p=a*h-s*u;let g,m;if(0===a&&0===s)return!1;if(0===l&&0===c)return!1;if(0===d){if(0===f&&0===p){if(0===a){if(0===s)return n.x===i.x&&n.y===i.y;g=Qo(r,n)/s,m=Qo(o,n)/s}else g=(r.x-n.x)/a,m=(o.x-n.x)/a;return!(g<0&&m<0||g>1&&m>1)}return!1}const y=f/d;return d=p/d,y>=0&&y<=1&&d>=0&&d<=1}function Ta(e,t){if(ya(e))return!1;const[n,i]=x(e);return ga(n,i,t)}function Ia(e,t){const n=e.boundingRect(),i=t.boundingRect();return!!qa(n,i)&&(Ea(n,i)?wa(e,t):wa(t,e))}function ja(e,t){const n=e.boundingRect(),i=t.boundingRect();return!!qa(n,i)&&(Ea(i,n)?function(e,t){let n=!1;const{numPolygons:i,polygons:r}=e;for(let e=0;e<i;e++)if(n=Ia(t,r[e]),!0===n)return!0;return!1}(e,t):function(e,t){let n=!1;for(let i=0,r=t.edges.length;i<r;i++)if(n=La(e,k(t.edges[i])),!0===n)return!0;return!1}(e,t))}function Pa(e,t){if(xa(e))return!1;if(Fa(t,{x:e.cx,y:e.cy}))return!0;const{numPolygons:n,polygons:i}=t;for(let t=0;t<n;t++){const n=i[t],r=n.edges.length;for(let t=0;t<r;t++){if(Sa(e,k(n.edges[t])))return!0}}return!1}function Fa(e,t){if(!Oa(e.boundingRect(),t))return!1;const{x:n,y:i}=t,r=e.numPolygons;let o,a,s,l,c,u,h=!1;for(a=0;a<r;a++)for(o=e.vertices[a],c=-1,s=o.length,l=s-1;++c<s;l=c){if(o[c].x===n&&o[c].y===i)return!0;if(o[c].y===o[l].y&&o[c].y===i&&(n-o[c].x)*(n-o[l].x)<=0)return!0;if(o[c].y<i&&i<=o[l].y||o[l].y<i&&i<=o[c].y){if(u=(o[l].x-o[c].x)*(i-o[c].y)/(o[l].y-o[c].y)+o[c].x,n===u)return!0;n<u&&(h=!h)}}return h}function La(e,t){const[n,i]=x(t);if(Fa(e,n)||Fa(e,i))return!0;const{numPolygons:r,polygons:o}=e;for(let e=0;e<r;e++){const n=o[e];for(let e=0,i=n.edges.length;e<i;e++){if(Aa(t,k(n.edges[e])))return!0}}return!1}function $a(e,t){const[n,i,r,o]=b(t);if(Fa(e,n)||Fa(e,i)||Fa(e,r)||Fa(e,o))return!0;const{numPolygons:a,polygons:s}=e;for(let e=0;e<a;e++){const n=s[e];for(let e=0,i=n.edges.length;e<i;e++){if(za(t,k(n.edges[e])))return!0}}return!1}const Ba=/^\$/,Ha="@extend";function Wa(e){throw new Error('Cyclical reference for "'.concat(e,'"'))}function Va(e,t,n){if("string"==typeof e){let i=t[e];return-1!==n.indexOf(e)&&Wa(e),Ba.test(i)?(n.push(e),Va(i,t,n)):i}let i=e;const r=u(!0,{},t,e),o={};if(e[Ha]){const o=e[Ha];-1!==n.indexOf(o)&&Wa(o);let a=n.slice();a.push(o),i=u(!0,{},Va(r[o],t,a),e)}return Object.keys(i).forEach((e=>{let t=n.slice();if(e===Ha||Ba.test(e))return;o[e]=i[e];let a=o[e];Ba.test(a)&&a in r?(-1!==n.indexOf(a)&&Wa(a),t.push(a),a=r[a],"object"==typeof a||Ba.test(a)&&a in r?o[e]=Va(a,r,t):o[e]=a):"object"==typeof a&&(o[e]=Va(a,r,t))})),o}function Ua(e,t){return Va(e,t,[])}function Ya(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={},n=e;const i=e=>{e.forEach((e=>{const n=Array.isArray(e.colors[0])?e.colors:[e.colors];t[e.key]={colors:n,sizes:n.map((e=>e?e.length:0))}}))},r={palette:(e,n)=>((e,n)=>{const i=t[e];if(!i)return[];const r=i.sizes;for(let e=0;e<r.length;e++)if(n<=r[e])return i.colors[e];return i.colors[r.length-1]})(e,n),setPalettes:i,style:e=>Ua(e,n),setStyle:t=>{n=u({},e,t)}};return i(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]),r}function Ka(e){e.x=Math.floor(e.x),e.y=Math.floor(e.y),e.width=Math.floor(e.width),e.height=Math.floor(e.height)}function Xa(e){const t={center:{minWidthRatio:.5,minHeightRatio:.5,minWidth:0,minHeight:0}};return u(!0,t,e),t.center.minWidthRatio=Math.min(Math.max(t.center.minWidthRatio,0),1),t.center.minHeightRatio=Math.min(Math.max(t.center.minHeightRatio,0),1),t.center.minWidth=Math.max(t.center.minWidth,0),t.center.minHeight=Math.max(t.center.minHeight,0),t}function Ga(e,t,n,i,r){return{x:isNaN(e)?0:e,y:isNaN(e)?0:t,width:isNaN(e)?0:n,height:isNaN(e)?0:i,margin:isNaN(r)?0:r}}function Ja(e,t,n){if(void 0===e.cachedSize){const i=e.config.dock();let r,o=e.comp.preferredSize({inner:t,outer:n,dock:i});isNaN(o)?o&&!isNaN(o.size)&&(o.width=o.size,o.height=o.size):o={width:o,height:o},r="top"===i||"bottom"===i?o.height:"right"===i||"left"===i?o.width:Math.max(o.width,o.height),e.cachedSize=Math.ceil(r),e.edgeBleed=o.edgeBleed||0}return e.cachedSize}function Za(e,t){switch(t.config.dock()){case"top":e.y+=t.cachedSize,e.height-=t.cachedSize;break;case"bottom":e.height-=t.cachedSize;break;case"left":e.x+=t.cachedSize,e.width-=t.cachedSize;break;case"right":e.width-=t.cachedSize}}function Qa(e,t){const n=t.edgeBleed;n&&(e.left=Math.max(e.left,n.left||0),e.right=Math.max(e.right,n.right||0),e.top=Math.max(e.top,n.top||0),e.bottom=Math.max(e.bottom,n.bottom||0))}function es(e,t,n){t.x<n.left&&(t.width-=n.left-t.x,t.x=n.left);const i=e.width-(t.x+t.width);i<n.right&&(t.width-=n.right-i),t.y<n.top&&(t.height-=n.top-t.y,t.y=n.top);const r=e.height-(t.y+t.height);r<n.bottom&&(t.height-=n.bottom-r)}function ts(e,t,n,i,r){const o=u({},t),a=u({},n);Za(o,i),Qa(a,i),es(e,o,a);const s=function(e,t,n){const i=Math.min(n.center.minWidth,e.width)||Math.max(e.width*n.center.minWidthRatio,1),r=Math.min(n.center.minHeight,e.height)||Math.max(e.height*n.center.minHeightRatio,1);return t.width>=i&&t.height>=r}(e,o,r);return!!s&&(Za(t,i),Qa(n,i),!0)}function ns(e){return{x:e.margin.left+e.x*e.scaleRatio.x,y:e.margin.top+e.y*e.scaleRatio.y,width:e.width*e.scaleRatio.x,height:e.height*e.scaleRatio.y}}function is(e){return w([].concat(...e.map(b)))}function rs(e){let{visible:t,layoutRect:n,reducedRect:i,containerRect:r,translation:o}=e;const a=Ga(i.x,i.y,i.width,i.height),s=Ga(i.x,i.y,i.width,i.height),l={},c=t.slice(),u=c.slice().sort(((e,t)=>e.config.displayOrder()-t.config.displayOrder()));return t.sort(((e,t)=>{if(e.referencedDocks.length>0&&t.referencedDocks.length>0)return 0;if(t.referencedDocks.length>0)return-1;if(e.referencedDocks.length>0)return 1;const n=e.config.displayOrder()-t.config.displayOrder();return 0===n?c.indexOf(e)-c.indexOf(t):n})).forEach((e=>{let t={},c={};switch(e.config.dock()){case"top":t.height=c.height=e.cachedSize,t.width=n.width,c.width=a.width,t.x=n.x,c.x=a.x,t.y=c.y=a.y-e.cachedSize,a.y-=e.cachedSize,a.height+=e.cachedSize;break;case"bottom":t.x=n.x,c.x=a.x,t.y=c.y=a.y+a.height,t.width=n.width,c.width=a.width,t.height=c.height=e.cachedSize,a.height+=e.cachedSize;break;case"left":t.x=c.x=s.x-e.cachedSize,t.y=n.y,c.y=s.y,t.width=c.width=e.cachedSize,t.height=n.height,c.height=s.height,s.x-=e.cachedSize,s.width+=e.cachedSize;break;case"right":t.x=c.x=s.x+s.width,t.y=n.y,c.y=s.y,t.width=c.width=e.cachedSize,t.height=n.height,c.height=s.height,s.width+=e.cachedSize;break;case"center":t.x=c.x=i.x,t.y=c.y=i.y,t.width=c.width=i.width,t.height=c.height=i.height;break;default:if(e.referencedDocks.length>0){const n=e.referencedDocks.map((e=>l[e])).filter((e=>!!e));n.length>0&&(t=is(n.map((e=>e.outerRect))),c=is(n.map((e=>e.r))))}}e.key&&(l[e.key]={r:c,outerRect:t}),function(e,t,n,i){const r={x:i.width/n.width,y:i.height/n.height},o={left:0,top:0};if(n.preserveAspectRatio){const e=r.x<r.y,t=Math.min(r.x,r.y);r.x=t,r.y=t;const a=e?"height":"width",s=(i[a]-n[a]*r.x)*n.align;o.left=e?0:s,o.top=e?s:0}e.scaleRatio=r,e.margin=o,t.scaleRatio=r,t.margin=o,n.scaleRatio=r,n.margin=o}(c,t,n,r),c.edgeBleed=e.edgeBleed,c.computed=ns(c),t.edgeBleed=e.edgeBleed,t.computed=ns(t),c.x+=o.x,c.y+=o.y,t.x+=o.x,t.y+=o.y,e.comp.resize(c,t),e.cachedSize=void 0,e.edgeBleed=void 0})),u}function os(e,t,n){const i=e.layoutModes||{},r=t.minimumLayoutMode();let o=t.show();return o&&"object"==typeof r?o=i[r.width]&&i[r.height]&&n.width>=i[r.width].width&&n.height>=i[r.height].height:o&&void 0!==r&&(o=i[r]&&n.width>=i[r].width&&n.height>=i[r].height),o}function as(e){if(!e.resize||"function"!=typeof e.resize)throw new Error("Component is missing resize function");if(!e.dockConfig&&!e.preferredSize)throw new Error("Component is missing preferredSize function")}function ss(e){let t=Xa(e);const n={};return n.layout=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!e||isNaN(e.x)||isNaN(e.y)||isNaN(e.width)||isNaN(e.height))throw new Error("Invalid rect");if(!n.length)return{visible:[],hidden:[],ordered:[]};const{logicalContainerRect:i,containerRect:r}=function(e,t){const n={x:0,y:0,width:0,height:0},i={x:0,y:0,width:0,height:0};return n.width=e.width||0,n.height=e.height||0,void 0!==t.size&&(n.width=isNaN(t.size.width)?n.width:t.size.width,n.height=isNaN(t.size.height)?n.height:t.size.height),void 0!==t.logicalSize?(i.width=isNaN(t.logicalSize.width)?n.width:t.logicalSize.width,i.height=isNaN(t.logicalSize.height)?n.height:t.logicalSize.height,i.align=isNaN(t.logicalSize.align)?.5:Math.min(Math.max(t.logicalSize.align,0),1),i.preserveAspectRatio=t.logicalSize.preserveAspectRatio):(i.width=n.width,i.height=n.height,i.preserveAspectRatio=!1),Ka(i),Ka(n),{logicalContainerRect:i,containerRect:n}}(e,t),[o,a]=function(e,t,n){const i=[],r=[];for(let o=0;o<e.length;++o){const a=e[o];as(a);let s=a.dockConfig;const l=a.key,c=s.dock(),u=/@/.test(c)?c.split(",").map((e=>e.replace(/^\s*@/,""))):[];os(t,s,n)?i.push({comp:a,key:l,config:s,referencedDocks:u}):r.push({comp:a,key:l,config:s,referencedDocks:u})}return[i,r]}(n,t,i),s=function(e){let{layoutRect:t,visible:n,hidden:i,settings:r}=e;const o=Ga(t.x,t.y,t.width,t.height),a={left:0,right:0,top:0,bottom:0},s=n.slice();s.sort(((e,t)=>e.config.prioOrder()-t.config.prioOrder()));for(let e=0;e<s.length;++e){const n=s[e];Ja(n,o,t),ts(t,o,a,n,r)||(i.push(s.splice(e,1)[0]),--e)}!function(e,t){if(0!==t.length)for(let n=0;n<e.length;++n){let i=e[n];if(i.referencedDocks.length){const r=i.referencedDocks.every((e=>t.some((t=>t.key===e))));r&&t.push(e.splice(n,1)[0])}}}(n,i);const l=n.filter((e=>-1!==s.indexOf(e)));return n.length=0,n.push(...l),es(t,o,a),o}({layoutRect:i,visible:o,hidden:a,settings:t}),l=rs({visible:o,layoutRect:i,reducedRect:s,containerRect:r,translation:{x:e.x,y:e.y}});return a.forEach((e=>{e.comp.visible=!1;const t=Ga();e.comp.resize(t,t)})),{visible:o.map((e=>e.comp)),hidden:a.map((e=>e.comp)),ordered:l.map((e=>e.comp))}},n.settings=function(e){t=Xa(e)},n}const ls=(e,t)=>{for(let n=0;n<e.length;n++){const i=e[n];if(i.hasKey&&i.key===t)return e[n]}return null},cs=e=>null==e?void 0:e.map((e=>{const t=e.instance.dockConfig();return{preferredSize:n=>t.computePreferredSize(p(p({},n),{},{children:cs(e.children)}))}})),us=(e,t)=>({visible:[],hidden:t,ordered:[]}),hs=e=>(t,n)=>{var i;const r=n.map(((e,t)=>{const n=e.instance.dockConfig();return{index:t,key:e.key,dockConfig:n,resize:e.instance.resize,preferredSize:t=>n.computePreferredSize(p(p({},t),{},{children:cs(e.children)}))}})),o=e=>n[e.index],{visible:a=r,hidden:s=[],ordered:l=a}=null!==(i=e(t,r))&&void 0!==i?i:{};return{visible:a.map(o),hidden:s.map(o),ordered:l.map(o)}},ds=e=>"function"==typeof e?hs(e):(e=>{const t=ss(e);return hs(((e,n)=>t.layout(e,n)))})(e);function fs(e,t,n){const i=t.left-n.left,r=t.top-n.top,o=_(e),a=u(!0,{},e);switch(o){case"circle":a.cx+=i,a.cy+=r;break;case"polygon":for(let e=0,t=a.vertices.length;e<t;e++){const t=a.vertices[e];t.x+=i,t.y+=r}break;case"geopolygon":for(let e=0;e<a.vertices.length;e++){const t=a.vertices[e];for(let e=0,n=t.length;e<n;e++){const n=t[e];n.x+=i,n.y+=r}}break;case"line":a.x1+=i,a.y1+=r,a.x2+=i,a.y2+=r;break;case"point":case"rect":a.x+=i,a.y+=r}return a}function ps(e,t){const n=[];let i=0;t.forEach((e=>{n.push(i),i++;const t=e.instance.def.additionalElements&&e.instance.def.additionalElements();t&&(i+=t.length)})),t.forEach(((t,i)=>((e,t,n)=>{const i=t.instance.renderer().element();if(isNaN(n)||!i||!e||!e.children)return;const r=e.children[Math.max(0,n)];if(i===r)return;const o=t.instance.def.additionalElements&&t.instance.def.additionalElements().filter(Boolean);e.insertBefore&&void 0!==r?(e.insertBefore(i,r),o&&o.forEach((t=>{e.insertBefore(t,i)}))):(o&&o.forEach((t=>{e.appendChild(t,i)})),e.appendChild(i))})(e,t,n[i])))}function gs(e,t){let{element:n,data:i=[],settings:r={},on:o={}}=e;const a=t.registries,s=t.logger,l=Ya(t.style,t.palettes),c=[],h=u({},e),d=function(){const e={};return ro.mixin(e),e}();let f=[],m=null,y=null,v=null,x=[],b=()=>{},w=()=>{};const k={};let _=!1;const M=function(e){let{createComponent:t}=e;const n={};let i=[],r=[];const o=e=>{const n=t(e);return n&&(i.push(n),e.components&&(n.children=e.components.map((e=>o(e))).filter((e=>!!e)))),n},a=e=>{const t=i.indexOf(e);-1!==t&&i.splice(t,1)},s=(e,t)=>{for(let n=e.length-1;n>=0;n--){const i=e[n],r=t.find((e=>i.hasKey&&i.key===e.key));r?i.children&&r.components&&s(i.children,r.components):(e.splice(n,1),a(i),i.children&&s(i.children,[]),i.instance.destroy())}},l=e=>{let{compList:t,data:n,excludeFromUpdate:i,formatters:r,scales:a,settingsList:s}=e;return s.map((e=>{const s=ls(t,e.key);return i.indexOf(e.key)>-1?(delete s.updateWith,s):s?(e.rendererSettings&&"function"==typeof s.instance.renderer().settings&&s.instance.renderer().settings(e.rendererSettings),e.rendererSettings&&"function"==typeof e.rendererSettings.transform&&e.rendererSettings.transform()?(s.applyTransform=!0,s):(s.updateWith={formatters:r,scales:a,data:n,settings:e},e.components&&(s.children=l({compList:s.children||[],data:n,excludeFromUpdate:i,formatters:r,scales:a,settingsList:e.components})),s)):o(e)})).filter((e=>!!e))},c=e=>{let{components:t,hidden:n,layoutFn:i,ordered:r,rect:o,visible:a}=e;const{visible:s,hidden:l,ordered:u}=i(o,t);a.push(...s),n.push(...l),r.push(...u),s.forEach((e=>{if(e.children){var t,i;const o=ds(null!==(t=null===(i=e.settings)||void 0===i?void 0:i.strategy)&&void 0!==t?t:{});c({components:e.children,hidden:n,layoutFn:o,ordered:r,rect:e.instance.getRect(),visible:a})}})),l.forEach((e=>{e.children&&c({components:e.children,hidden:n,layoutFn:us,ordered:r,rect:null,visible:a})}))};return n.destroy=()=>{i.forEach((e=>e.instance.destroy())),i=[],r=[]},n.findComponentByKey=e=>ls(i,e),n.forEach=e=>{i.forEach(e)},n.layout=e=>{let{layoutSettings:t,rect:n}=e;const i=[],o=[],a=[],s=ds(t);return c({components:r,hidden:o,layoutFn:s,ordered:a,rect:n,visible:i}),{visible:i,hidden:o,ordered:a}},n.set=e=>{let{components:t}=e;r=t.map((e=>o(e))).filter((e=>!!e))},n.update=e=>{let{components:t,data:n,excludeFromUpdate:i,formatters:o,scales:a}=e;s(r,t),r=l({compList:r,data:n,excludeFromUpdate:i,formatters:o,scales:a,settingsList:t})},n}({createComponent:e=>{if(!a.component.has(e.type))return s.warn("Unknown component: ".concat(e.type)),!1;return{instance:da(a.component(e.type),{settings:e,chart:h,mediator:d,registries:a,theme:l,container:n}),settings:u(!0,{},e),key:e.key,hasKey:void 0!==e.key}}});function S(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{};return function(){const i="function"==typeof e[t];let r;for(var o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];return r=i?e[t].call(h,...a):n.call(h,...a),r}}const R=()=>{let e;r.dockLayout?(s.warn('Deprecation Warning: "dockLayout" property should be renamed to "strategy"'),e=r.dockLayout):e=r.strategy;const t=function(e){if("function"==typeof e.getBoundingClientRect){const{width:t,height:n}=e.getBoundingClientRect();return{x:0,y:0,width:t,height:n}}return{x:0,y:0,width:0,height:0}}(n);return M.layout({layoutSettings:e,rect:t})},C=S("created"),N=S("beforeMount"),D=S("mounted"),q=S("beforeUpdate"),E=S("updated"),O=S("beforeRender"),z=S("beforeDestroy"),A=S("destroyed"),T=function(e,t){let{partialData:n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{formatters:i={},scales:r={},scroll:o={}}=t;b=function(e,t){let{types:n,logger:i}=t;const r={},o=[];return Array.isArray(e)?o.push(...e):(i.warn('Deprecated: "data-source" configuration"'),o.push(e)),o.forEach(((e,t)=>{let o=n(e.type);if(o){let n=e.key;void 0===e.key&&(i.warn("Missing key for dataset. Using index '".concat(t,"' as key.")),n=t);let a=o({key:n,data:e.data,config:e.config});r[n]=a}})),e=>e?r[e]:r[Object.keys(r)[0]]}(e,{logger:s,types:a.data}),n||Object.keys(k).forEach((e=>k[e].clear())),t.palettes&&l.setPalettes(t.palettes),t.style&&l.setStyle(t.style),w=function(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:pi;const r={};return(e||[]).forEach((e=>{if(!e.key)throw new Error('Data collection is missing "key" property');if("object"==typeof e.data&&"collection"in e.data)throw new Error("Data config for collections may not reference other collections");r[e.key]=()=>i(e.data,t,n)})),e=>{let t,n;if("string"==typeof e?t=e:"object"==typeof e&&(t=e.key,n=e),!(t in r))throw new Error("Unknown data collection: ".concat(t));"function"==typeof r[t]&&(r[t]=r[t]());let i=r[t];if(n&&n.fields&&n.fields.filter){let e=i.fields.filter(n.fields.filter);i.fields.length!==e.length&&(i=u(i,{fields:e}))}return i}}(t.collections,{dataset:b},{logger:s});const c={theme:l,logger:s};m=function(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:eo;const r={};return{get(o){let a;return"string"==typeof o&&e[o]?a=o:"object"==typeof o&&"scale"in o&&e[o.scale]&&(a=o.scale),a?(r[a]=r[a]||i(e[a],t,n),r[a]):i(o,t,n)},all(){return Object.keys(e).forEach(this.get),r}}}(r,{dataset:b,collection:w},p(p({},c),{},{scale:a.scale})),y=function(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:gi;const r={};return{get(o){let a;return"string"==typeof o&&e[o]?a=o:"object"==typeof o&&"formatter"in o&&e[o.formatter]?a=o.formatter:"object"==typeof o&&"type"in o&&e[o.type]&&(a=o.type),a?(r[a]=r[a]||i(e[a],t,n),r[a]):i(o||{},t,n)},all(){return Object.keys(e).forEach(this.get),r}}}(i,{dataset:b,collection:w},p(p({},c),{},{formatter:a.formatter})),v=function(e,t){const n={};for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=ao(e[i],t?t[i]:null));return n}(o,v)};function I(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={},i=e.filter((e=>!!e.key)).map((e=>e.key));x.forEach((e=>{e.key&&-1!==i.indexOf(e.key)?t[e.key]=e:e.destroy()})),x=e.map((e=>{const i=e.key&&t[e.key]?t[e.key]:a.interaction(e.type)(h,d,n);return i.set(e),i}))}const j=e=>{const t=n.getBoundingClientRect(),i="clientX"in e?e.clientX:e.x,r="clientY"in e?e.clientY:e.y,o={x:i-t.left,y:r-t.top},a=[];return f.forEach((e=>{const t=e.instance.getRect();Oa(t.computedPhysical?t.computedPhysical:{x:t.margin.left+t.x*t.scaleRatio.x,y:t.margin.top+t.y*t.scaleRatio.y,width:t.width*t.scaleRatio.x,height:t.height*t.scaleRatio.y},o)&&a.push(e)})),a},P=()=>{if(c.length||!n)return;Object.keys(o).forEach((e=>{const t=o[e].bind(h);n.addEventListener(e,t),c.push({key:e,listener:t})}));const e={},t=t=>{t.touches?(e.x=t.touches[0].clientX,e.y=t.touches[0].clientY,e.multiTouch=t.touches.length>1):(e.x=t.clientX,e.y=t.clientY,e.multiTouch=!1),e.time=Date.now(),e.comps=j(e)},i=t=>{const n=e.comps||j(t);if(!n.every((e=>e.instance.def.disableTriggers))&&("touchend"===t.type&&t.preventDefault(),function(e,t){const n=g(e),i=n?e.changedTouches[0]:e,r=Date.now()-t.time,o=isNaN(t.x)?0:Math.abs(i.clientX-t.x),a=isNaN(t.y)?0:Math.abs(i.clientY-t.y);return(0===e.button||n)&&!t.multiTouch&&o<=12&&a<=12&&r<=300}(t,e)))for(let e=n.length-1;e>=0;e--){if(n[e].instance.onBrushTap(t),_){_=!1;break}}},r=[];var a;r.push({key:"mousedown",listener:t}),r.push({key:"mouseup",listener:i}),("ontouchstart"in(a=n)&&"ontouchend"in a||navigator.maxTouchPoints>1)&&(r.push({key:"touchstart",listener:t}),r.push({key:"touchend",listener:i})),r.push({key:"mousemove",listener:e=>{const t=j(e);for(let n=t.length-1;n>=0;n--){if(t[n].instance.onBrushOver(e),_){_=!1;break}}}}),r.forEach((e=>{n.addEventListener(e.key,e.listener),c.push(e)}))},F=()=>{c.forEach((e=>{let{key:t,listener:i}=e;return n.removeEventListener(t,i)})),c.length=0},L=()=>{n.innerHTML="",(()=>{const{components:e=[]}=r;O(),T(i,r),M.set({components:e});const{visible:t,hidden:o,ordered:a}=R();f=t,o.forEach((e=>{e.instance.hide(),e.visible=!1})),t.forEach((e=>e.instance.beforeMount())),t.forEach((e=>e.instance.mount())),t.forEach((e=>e.instance.beforeRender())),t.forEach((e=>e.instance.render())),t.forEach((e=>e.instance.mounted())),t.forEach((e=>{e.visible=!0})),ps(n,a)})(),P(),I(r.interactions)};return h.layoutComponents=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{excludeFromUpdate:t=[]}=e;e.data&&(i=e.data),e.settings&&(r=e.settings,I(e.settings.interactions)),q(),T(i,r);const{formatters:n,scales:o,components:a=[]}=r;M.update({components:a,data:i,excludeFromUpdate:t,formatters:n,scales:o}),M.forEach((e=>{e.updateWith&&e.instance.set(e.updateWith)})),M.forEach((e=>{e.updateWith&&e.instance.beforeUpdate()})),R()},h.update=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{partialData:t,excludeFromUpdate:o=[]}=e;let a;e.data&&(i=e.data),e.settings&&(r=e.settings,I(e.settings.interactions)),q(),T(i,r,{partialData:t});const{formatters:s,scales:l,components:c=[]}=r;M.update({components:c,data:i,excludeFromUpdate:o,formatters:s,scales:l}),M.forEach((e=>{e.updateWith&&e.instance.set(e.updateWith)})),M.forEach((e=>{e.updateWith&&e.instance.beforeUpdate()}));const u=[],h=[];let d;if(t)M.forEach((e=>{(e.updateWith||e.applyTransform)&&e.visible&&u.push(e)})),d=u;else{const{visible:e,hidden:t,ordered:n}=R();f=e,d=e,a=n,e.forEach((e=>{e.updateWith&&e.visible?u.push(e):h.push(e)})),t.forEach((e=>{e.instance.hide(),e.visible=!1,delete e.updateWith,e.applyTransform=!1}))}h.forEach((e=>e.instance.beforeMount())),h.forEach((e=>e.instance.mount())),d.forEach((e=>e.instance.beforeRender())),d.forEach((e=>{(e.updateWith||e.applyTransform)&&e.visible?e.instance.update():e.instance.render()})),t||ps(n,a),h.forEach((e=>e.instance.mounted())),u.forEach((e=>e.instance.updated())),f.forEach((e=>{delete e.updateWith,e.visible=!0,e.applyTransform=!1})),E()},h.destroy=()=>{z(),M.destroy(),F(),I(),delete h.update,delete h.destroy,A()},h.getAffectedShapes=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"and",n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,r=[];return f.filter((e=>null==i||e.key===i)).forEach((i=>{const o=i.instance.getBrushedShapes(e,t,n);r=[...r,...o]})),r},h.findShapes=e=>{let t=[];return f.forEach((n=>{const i=n.instance.findShapes(e);t=[...t,...i]})),t},h.componentsFromPoint=e=>j(e).map((e=>e.instance.ctx)),h.shapesAt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=[];const r=n.getBoundingClientRect();let o=f;if(Array.isArray(t.components)&&t.components.length>0){const e=t.components.map((e=>e.key));o=f.filter((t=>-1!==e.indexOf(t.key))).map((n=>({instance:n.instance,opts:t.components[e.indexOf(n.key)]})))}for(let n=o.length-1;n>=0;n--){const a=o[n],s=fs(e,r,a.instance.renderer().element().getBoundingClientRect()),l=a.instance.shapesAt(s,a.opts),c=l.length>0&&"stop"===t.propagation;if(i=[...i,...l],i.length>0&&c)return i}return i},h.brushFromShapes=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{components:[]};for(let n=0;n<t.components.length;n++){const i=t.components[n].key;f.filter((e=>i===e.key)).forEach((i=>{let r=e.filter((e=>e.key===i.key));i.instance.brushFromShapes(r,t.components[n])}))}},h.scroll=function(){return function(e,t){return t[e]||(t[e]=oo()),t[e]}(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",v)},h.dataset=e=>b(e),h.dataCollection=e=>w(e),h.scales=function(){return m.all()},h.formatters=function(){return y.all()},h.brush=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return k[e]||(k[e]=_o()),k[e]},h.scale=function(e){return m.get(e)},h.formatter=function(e){return y.get(e)},h.toggleBrushing=function(e){_=void 0!==e?e:!_},h.component=e=>{const t=M.findComponentByKey(e);return null==t?void 0:t.instance.ctx},h.logger=()=>s,h.theme=()=>l,h.storage=fa({animations:{updatingStageMeta:{isInit:!1,shouldBeRemoved:!1}}}),Object.defineProperty(h,"interactions",{get:()=>({instances:x,on(){P(),x.forEach((e=>e.on()))},off(){F(),x.forEach((e=>e.off()))}})}),C(),n&&(N(),L(),D(n),h.element=n),h}const ms=e=>{let t=Ce(e);return t.prio=e=>e?t.default(e[0]):[t.default()],t.types=()=>t.getKeys(),t};var ys=Ce();function vs(e,t,n){let{key:i}=n;const r={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return r.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(r.value),e.field&&(r.source={key:i,field:e.field.key()}),r}const xs=e=>e.filter((e=>"number"==typeof e&&!isNaN(e)));const bs=e=>{let{key:t,data:n,cache:i,config:r}=e;if(!n)return;let o=n;"string"==typeof o&&(o=(e=>{let{data:t,config:n}=e;const i=t.split("\n"),r=i[0],o=i[1];let a=",";if(n&&n.parse&&n.parse.delimiter)a=n.parse.delimiter;else if(r){const e=[/,/,/\t/,/;/];for(let t=0;t<e.length;t++){const n=e[t];if(r&&o){if(n.test(r)&&n.test(o)&&r.split(n).length===o.split(n).length){a=n;break}}else n.test(r)&&(a=n)}}return i.map((e=>e.split(a)))})({data:n,config:r})),Array.isArray(o)&&function(e){let t,{source:n,data:i,cache:r,config:o}=e,a=i;const s=o&&o.parse;Array.isArray(i[0])?s&&!1===s.headers?t=i[0].map(((e,t)=>t)):(t=i[0],a=i.slice(1)):t=Object.keys(i[0]);const l=!!s&&"function"==typeof s.row&&s.row;let c,h=t;h=s&&"function"==typeof s.fields?s.fields(h.slice()):t.map((e=>({key:e,title:e}))),Array.isArray(i[0])?c=h.map((()=>[])):(c={},h.forEach((e=>{c[e.key]=[]})));for(let e=0;e<a.length;e++){const t=l?l(a[e],e,h):a[e];if(t)if(Array.isArray(t))for(let e=0;e<h.length;e++)c[e].push(t[e]);else for(let e=0;e<h.length;e++)c[h[e].key].push(t[h[e].key])}const d=Array.isArray(c)?e=>c[e]:e=>c[h[e].key];for(let e=0;e<h.length;e++){const t=d(e),i=xs(t),o=i.length>0,a=o?"measure":"dimension",s=o?Math.min(...i):NaN,l=o?Math.max(...i):NaN;r.fields.push(ei(u({source:n,key:e,title:h[e].title,values:t,min:s,max:l,type:a},h[e]),{value:h[e].value,label:h[e].label}))}}({data:o,cache:i,source:t,config:r})};function ws(){let{key:e,data:t,config:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i={fields:[]},r={key:()=>e,raw:()=>t,field:e=>function(e,t){let{cache:n}=t;if("number"==typeof e)return n.fields[e];for(let t=0;t<n.fields.length;t++)if(n.fields[t].key()===e)return n.fields[t];for(let t=0;t<n.fields.length;t++)if(n.fields[t].title()===e)return n.fields[t];return null}(e,{cache:i}),fields:()=>i.fields.slice(),extract:e=>function(e,t){const n=Array.isArray(e)?e:[e];let i=[];return n.forEach((e=>{if(void 0!==e.field){const n=t.field(e.field),r=t.key();if(!n)throw Error("Field '".concat(e.field,"' not found"));const{props:o,main:a}=oi(e,t),s=Object.keys(o),l=!!e.trackBy,c=typeof e.trackBy,u={},h=[],d=n.items(),f=[];for(let t=0;t<d.length;t++){const n=d[t];if(a.filter&&!a.filter(n))continue;const i=vs(a,n,{key:r});s.forEach((e=>{const a=o[e];let s=a.field?a.field.items()[t]:n;i[e]=vs(a,s,{key:r})})),l&&li({cfg:e,itemData:n,obj:i,target:h,tracker:u,trackType:c}),f.push(i)}i=l?[...i,...si(h,{main:a,propsArr:s,props:o})]:[...i,...f]}})),i}(e,r),hierarchy:()=>null};return bs({key:e,data:t,config:n,cache:i}),r}ws.util={normalizeConfig:oi,collect:si,track:li};const ks=Ce();ks.default("matrix"),ks("matrix",ws),ks("default",ws);const _s=Ce();function Ms(e,t,n){return Math.max(e,Math.min(t,n))}function Ss(e){let{item:t,value:n,boxCenter:i,rendWidth:r,rendHeight:o,flipXY:a,symbol:s}=e,l="x",c="y",h=r,d=o,f=n<.5?90:-90;return a&&(l="y",c="x",h=o,d=r,f=n<.5?180:0),s(u({},t.oob,{[l]:i*h,[c]:Math.max(t.oob.size/2,Math.min(n*d,d-t.oob.size/2)),startAngle:f}))}function Rs(e){let{item:t,boxWidth:n,boxPadding:i,rendWidth:r,rendHeight:o,flipXY:a}=e,s="x",l="y",c="width",h="height",d=r,f=o;a&&(s="y",l="x",c="height",h="width",d=o,f=r);const{actualDiff:p,actualLow:g}=function(e){let{start:t,end:n,minPx:i=.1,maxPx:r=1}=e;const o=Math.max(t,n),a=Math.min(t,n),s=Ms(-.1,1.2,o),l=Ms(-.1,1.2,a),c=s*r-l*r,u=Math.max(i,c),h=(u-c)/2;return{actualDiff:u,startModifier:h,actualLow:l*r-h}}({start:t.start,end:t.end,minPx:t.box.minHeightPx,maxPx:f});return u({},t.box,{type:"rect",[s]:(i+t.major)*d,[l]:g,[h]:p,[c]:n*d,data:t.data||{},collider:{type:null}})}function Cs(e){let{item:t,from:n,to:i,boxCenter:r,rendWidth:o,rendHeight:a,flipXY:s}=e,l="x1",c="y1",h="x2",d="y2",f=o,p=a;return s&&(l="y1",c="x1",h="y2",d="x2",f=a,p=o),u({},t.line,{type:"line",[d]:Math.floor(n*p),[l]:r*f,[c]:Math.floor(i*p),[h]:r*f,data:t.data||{},collider:{type:null}})}function Ns(e){let{item:t,key:n,position:i,width:r,boxCenter:o,rendWidth:a,rendHeight:s,flipXY:l}=e,c="x1",h="y1",d="x2",f="y2",p=a,g=s;l&&(c="y1",h="x1",d="y2",f="x2",p=s,g=a);const m=r/2;return u({type:"line"},t[n],{[h]:Math.floor(i*g),[c]:(o-m)*p,[f]:Math.floor(i*g),[d]:(o+m)*p,r:m*p,cx:o*p,cy:i*g,width:r*p,data:t.data||{},collider:{type:null}})}function Ds(e,t,n){const{width:i,maxWidthPx:r,minWidthPx:o}=t.box,a=e>=0?1:-1;let s=Math.min(a*e*i,isNaN(r)?n:r/n);return s=isNaN(o)?s:Math.max(o/n,s),s*a}_s("native",(function(e,t,n){let i,r,o={chart:e,mediator:t,element:n},a=[],s=!0;function l(){"function"==typeof i.enable&&(i.enable=i.enable.bind(o)()),i.enable&&Object.keys(i.events).forEach((e=>{const t=i.events[e].bind(o);n.addEventListener(e,t),a.push({key:e,listener:t})}))}function c(){a.forEach((e=>{let{key:t,listener:i}=e;n.removeEventListener(t,i)})),a=[]}return{get key(){return r},set(e){!function(e){r=e.key,i=e,i.events=i.events||[],void 0===i.enable&&(i.enable=!0)}(e),c(),s&&l()},off(){s=!1,c()},on(){s=!0,0===a.length&&l()},destroy(){c(),o=null,i=null}}}));const qs={oob:{show:!0,type:"n-polygon",fill:"#999",stroke:"#000",strokeWidth:0,size:10,sides:3,startAngle:-90},box:{show:!0,fill:"#fff",stroke:"#000",strokeWidth:1,strokeLinejoin:"miter",width:1,maxWidthPx:void 0,minWidthPx:1,minHeightPx:1},line:{show:!0,stroke:"#000",strokeWidth:1},median:{show:!0,stroke:"#000",strokeWidth:1},whisker:{show:!0,stroke:"#000",strokeWidth:1,fill:"",type:"line",width:1}},Es=Object.keys(qs),Os={require:["chart","resolver","symbol"],defaultSettings:{settings:{},data:{},style:{box:"$shape",line:"$shape-guide",whisker:"$shape-guide",median:"$shape-guide--inverted"}},created(){this.state={}},render(e){let{data:t}=e;const{width:n,height:i}=this.rect,r="horizontal"===this.settings.settings.orientation,{style:o,resolver:a,symbol:s}=this,l=Es.filter((e=>!this.settings.settings[e]||!1!==this.settings.settings[e].show)),c={};l.forEach((e=>c[e]=qs[e]));const h=function(e){let{keys:t,data:n,defaultSettings:i,style:r,settings:o,width:a,height:s,resolver:l}=e;const c=u(!0,{},i||{},r||{}),h={major:"horizontal"===o.orientation?s:a,minor:"horizontal"===o.orientation?a:s},d=o.major;let f;f="object"==typeof d&&"object"==typeof d.ref&&void 0!==d.ref.start&&void 0!==d.ref.end?l.resolve({data:n,defaults:{start:0,end:1},scaled:h,settings:u(!0,{},{binStart:{scale:o.major.scale,ref:o.major.ref.start},binEnd:{scale:o.major.scale,ref:o.major.ref.end}})}):"object"==typeof d&&void 0!==d.binStart&&void 0!==d.binEnd?l.resolve({data:n,defaults:{start:0,end:1},scaled:h,settings:u(!0,{},{binStart:{scale:o.major.scale,ref:"binStart"},binEnd:{scale:o.major.scale,ref:"binEnd"}},o.major)}):l.resolve({data:n,scaled:h,defaults:{major:.5},settings:{major:o.major}});const p=o.minor||{},g={};["start","end","min","max","med"].forEach((e=>{(p[e]||n.items&&n.items.length&&n.items[0][e])&&(g[e]={scale:p.scale,ref:e})}));let m,y={major:f,minor:l.resolve({data:n,defaults:{start:0,end:1},scaled:h,settings:u(!0,{},g,p)})};for(let e=0,i=t.length;e<i;e++)o[m]&&!1===o[m].show||(m=t[e],y[m]=l.resolve({data:n,defaults:c[m],settings:o[m],scaled:h}));return y}({keys:l,data:t,defaultSettings:c,style:o,settings:this.settings.settings,width:n,height:i,resolver:a}),{settings:d,items:f}=h,p=function(e){let{width:t,height:n,flipXY:i,resolved:r,keys:o,symbol:a}=e;const s=[],l=r.major.items;if(!l.length)return s;const c=t,h=n,d=i?n:t,f=r.major.settings,p=["start","end","min","max","med"].filter((e=>void 0!==r.minor.settings[e])),g=p.length,y=o.filter((e=>"oob"!==e));let v,x,b,w,k,_,M,S,R;const C=o?o.length:0,N=y?y.length:0,D={box:function(){b.box&&m(b.start)&&m(b.end)&&v.push(Rs({item:b,boxWidth:w,boxPadding:k,rendWidth:c,rendHeight:h,flipXY:i}))},line:function(){m(b.min)&&m(b.start)&&v.push(Cs({item:b,from:b.min,to:b.start,boxCenter:_,rendWidth:c,rendHeight:h,flipXY:i})),m(b.max)&&m(b.end)&&v.push(Cs({item:b,from:b.max,to:b.end,boxCenter:_,rendWidth:c,rendHeight:h,flipXY:i}))},median:function(){b.median&&m(b.med)&&v.push(Ns({item:b,key:"median",position:b.med,width:w,boxCenter:_,rendWidth:c,rendHeight:h,flipXY:i}))},whisker:function(){if(b.whisker){const e=w*b.whisker.width;m(b.min)&&v.push(Ns({item:b,key:"whisker",position:b.min,width:e,boxCenter:_,rendWidth:c,rendHeight:h,flipXY:i})),m(b.max)&&v.push(Ns({item:b,key:"whisker",position:b.max,width:e,boxCenter:_,rendWidth:c,rendHeight:h,flipXY:i}))}}};function q(){let e,t=-Number.MAX_VALUE,n=Number.MAX_VALUE;for(let i=0;i<g;i++)e=b[p[i]],m(e)&&(t<e&&(t=e),n>e&&(n=e));M=t<0&&t!==-Number.MAX_VALUE,S=n>1&&n!==Number.MAX_VALUE,R=M||S}for(let e=0,t=l.length;e<t;e++){v=[],x=null;const t=l[e],n=t.data;let p=null,g=null;void 0!==f.binStart?(p=t.binStart,g=t.binEnd,x=f.binStart.scale):(x=f.major.scale,p=x?t.major:0);let m=0;x?x.bandwidth?(m=x.bandwidth(),p-=m/2):m=g-p:m=1,b=u({},{major:p,majorEnd:g},r.minor.items[e]);for(let t=0;t<C;t++)b[o[t]]=r[o[t]].items[e];if(w=Ds(m,b,d),k=(m-w)/2,_=k+b.major+w/2,q(),R)b.oob&&(M?v.push(Ss({item:b,value:0,boxCenter:_,rendWidth:c,rendHeight:h,flipXY:i,symbol:a})):S&&v.push(Ss({item:b,value:1,boxCenter:_,rendWidth:c,rendHeight:h,flipXY:i,symbol:a})));else for(let e=0;e<N;e++)b[y[e]]&&!1===b[y[e]].show||D[y[e]]();const E={type:"container",data:n,collider:{type:"bounds"},children:v};s.push(E)}return s}({width:n,height:i,flipXY:r,resolved:h,keys:l,symbol:s});return p}};const zs={shape:"saltire",width:2,size:.5,fill:"#333",stroke:"#333",strokeWidth:0},As=/px$/,Ts={shape:"circle",label:"",fill:"#333",stroke:"#ccc",strokeDasharray:"",strokeWidth:0,strokeLinejoin:"miter",opacity:1,x:.5,y:.5,size:1,show:!0},Is={maxPx:1e4,minPx:1,maxRelExtent:.1,minRelExtent:.01,maxRelDiscrete:1,minRelDiscrete:.1};function js(e,t){return e&&"function"==typeof e.bandwidth?{isBandwidth:!0,value:Math.max(1,e.bandwidth()*t)}:{isBandwidth:!1,value:Math.max(1,t)}}function Ps(e,t,n,i){let{width:r,height:o}=t;return e.filter((e=>!1!==e.show&&!isNaN(e.x+e.y))).map((e=>{let t=e,a=As.test(e.size)?parseInt(e.size,10):n.min+t.size*(n.max-n.min);y(a)&&(t=zs,a=n.min+t.size*(n.max-n.min));const[s,l]=function(e){let t=Ts.shape,n={};return"object"==typeof e.shape&&"string"==typeof e.shape.type?(t=e.shape.type,n=e.shape):"string"==typeof e.shape&&(t=e.shape),[t,n]}(t),c=p(p({},l),{},{type:s,label:e.label,x:e.x*r,y:e.y*o,fill:t.fill,size:Math.min(n.maxGlobal,Math.max(n.minGlobal,a)),stroke:t.stroke,strokeWidth:t.strokeWidth,strokeDasharray:t.strokeDasharray,opacity:t.opacity});t===e.errorShape&&(c.width=t.width);const u=i(c);return u.data=e.data,u}))}const Fs={require:["chart","resolver","symbol"],defaultSettings:{settings:{},data:{},animations:{enabled:!1,trackBy:e=>e.data.value},style:{item:"$shape"}},render(e){let{data:t}=e;const n=this.resolver.resolve({data:t,defaults:u({},Ts,this.style.item),settings:this.settings.settings,scaled:{x:this.rect.width,y:this.rect.height}}),{width:i,height:r}=this.rect,o=u({},Is,this.settings.settings.sizeLimits),a=n.items,s=function(e,t,n,i,r){const o=js(e?e.scale:void 0,n),a=js(t?t.scale:void 0,i);let s=Math.min(o.value*r[o.isBandwidth?"maxRelDiscrete":"maxRelExtent"],a.value*r[a.isBandwidth?"maxRelDiscrete":"maxRelExtent"]),l=Math.min(o.value*r[o.isBandwidth?"minRelDiscrete":"minRelExtent"],a.value*r[a.isBandwidth?"minRelDiscrete":"minRelExtent"]);return{min:Math.max(1,Math.floor(l)),max:Math.max(1,Math.floor(s)),maxGlobal:r.maxPx,minGlobal:r.minPx}}(n.settings.x,n.settings.y,i,r,o);return Ps(a,this.rect,s,this.settings.shapeFn||this.symbol)}};const Ls={label:"",arc:1,show:!0,fill:"#333",stroke:"#ccc",strokeWidth:1,strokeLinejoin:"round",opacity:1,innerRadius:0,outerRadius:.8,cornerRadius:0,offset:0};function $s(e,t,n,i){let{x:r,y:o,width:a,height:s}=t;const l=G(),c={x:r+a/2,y:o+s/2},u=Math.min(a,s)/2,h=Math.min(a,s)/2,d=h/100;return e.map(((e,t)=>{const r=n[t];r.type="path";const o=h*r.outerRadius,a=u*r.innerRadius,s=d*r.cornerRadius;l.innerRadius(a),l.outerRadius(o),l.cornerRadius(s),r.arcDatum=e;const f=l.centroid(e),p=r.offset?function(e,t,n,i){let[r,o]=e;const a=Math.sqrt(r*r+o*o);r/=a,o/=a;const s=n-i;return{x:r*t*s,y:o*t*s}}(f,r.offset,o,a):{x:0,y:0};return r.transform="translate(".concat(p.x,", ").concat(p.y,") translate(").concat(c.x,", ").concat(c.y,")"),r.desc={share:e.value/i,slice:{start:e.startAngle,end:e.endAngle,innerRadius:a,outerRadius:o,cornerRadius:s,offset:{x:c.x+p.x,y:c.y+p.y}}},r}))}function Bs(e,t){return e.slice&&"arc"in e.slice?t.arc:t.data.value}const Hs={require:["chart","resolver"],defaultSettings:{settings:{startAngle:0,endAngle:2*Math.PI,padAngle:0,slice:{}},style:{slice:"$shape"},data:{}},render(e){let{data:t}=e;const n=[],i=[],r=this.settings.settings,{items:o}=this.resolver.resolve({data:t,defaults:u({},Ls,this.style.slice),settings:r.slice});let a=0;for(let e=0,t=o.length;e<t;e++){const t=Bs(r,o[e]);t>0&&o[e].outerRadius>=o[e].innerRadius&&(n.push(t),i.push(o[e]),a+=t)}const s=function(){var e=ie,t=ne,n=null,i=E(0),r=E(B),o=E(0);function a(a){var s,l,c,u,h,d=a.length,f=0,p=new Array(d),g=new Array(d),m=+i.apply(this,arguments),y=Math.min(B,Math.max(-B,r.apply(this,arguments)-m)),v=Math.min(Math.abs(y)/d,o.apply(this,arguments)),x=v*(y<0?-1:1);for(s=0;s<d;++s)(h=g[p[s]=s]=+e(a[s],s,a))>0&&(f+=h);for(null!=t?p.sort((function(e,n){return t(g[e],g[n])})):null!=n&&p.sort((function(e,t){return n(a[e],a[t])})),s=0,c=f?(y-d*x)/f:0;s<d;++s,m=u)l=p[s],u=m+((h=g[l])>0?h*c:0)+x,g[l]={data:a[l],index:s,value:h,startAngle:m,endAngle:u,padAngle:v};return g}return a.value=function(t){return arguments.length?(e="function"==typeof t?t:E(+t),a):e},a.sortValues=function(e){return arguments.length?(t=e,n=null,a):t},a.sort=function(e){return arguments.length?(n=e,t=null,a):n},a.startAngle=function(e){return arguments.length?(i="function"==typeof e?e:E(+e),a):i},a.endAngle=function(e){return arguments.length?(r="function"==typeof e?e:E(+e),a):r},a.padAngle=function(e){return arguments.length?(o="function"==typeof e?e:E(+e),a):o},a}().sortValues(null);s.startAngle(r.startAngle),s.endAngle(r.endAngle),s.padAngle(r.padAngle);return $s(s(n),u({},this.rect,{x:0,y:0}),i,a)}};const Ws=function(e){function t(t){if(e[t.type]&&e[t.type].condition(t)){const n=e[t.type],i=void 0===n.conditionAppend||n.conditionAppend(t);n.items.forEach((e=>{const n=Math.round(t[e.key]),r=t[e.key]-n;t[e.key]=n,i&&"append"===e.type&&(r>0?t[e.key]+=.5:t[e.key]-=.5)}))}}return void 0===e&&((e={}).line={append:["x1","x2","y1","y2"],round:[],condition:e=>e.x1===e.x2||e.y1===e.y2,conditionAppend:e=>e.strokeWidth%2!=0},e.rect={append:["x","y"],round:["width","height"],condition:()=>!0,conditionAppend:e=>e.strokeWidth%2!=0}),Object.keys(e).forEach((t=>{const n=e[t];n.items=[],n.append.forEach((e=>{n.items.push({key:e,type:"append"})})),n.round.forEach((e=>{n.items.push({key:e,type:"round"})}))})),t.multiple=e=>e.forEach((e=>t(e))),t}();class Vs{constructor(){this.reset(),this.push(...arguments)}static evaluateKey(e,t){if(t){const t=e.substring(0,1),n=e.substring(1);if("x"===t)return"y".concat(n);if("y"===t)return"x".concat(n);if("cx"===e)return"cy";if("cy"===e)return"cx";if("width"===e)return"height";if("height"===e)return"width"}return e}transposeCoordinate(e,t,n){if("number"==typeof t&&isFinite(t)){const i=e.substring(0,1);if("x"===i||"cx"===e)return t*this.width;if("width"===e)return t*this.width;if("r"===e)return t*(n?this.height:this.width);if("y"===i||"cy"===e)return t*this.height;if("height"===e)return t*this.height}return t}push(){return this.storage.push(...arguments),this}processItem(e){let t={};const n=void 0!==e.flipXY?e.flipXY:this.flipXY,i=void 0!==e.crisp?e.crisp:this.crisp;if(e.fn&&"function"==typeof e.fn){let i=n?this.height:this.width,r=n?this.width:this.height;e=e.fn({width:i,height:r,flipXY:n});const o=Object.keys(e);for(let i=0,r=o.length;i<r;i++){let r=o[i];t[Vs.evaluateKey(r,n)]=e[r]}}else{const i=Object.keys(e);for(let r=0,o=i.length;r<o;r++){let o=i[r];const a=Vs.evaluateKey(o,n),s=this.transposeCoordinate(a,e[o],n);t[a]=s}}return i&&Ws(t),t}output(){let e=[];for(let t=0,n=this.storage.length;t<n;t++){let n=this.processItem(this.storage[t]);e.push(n)}return e}reset(){this.storage=[],this.flipXY=!1,this.crisp=!1,this.width=0,this.height=0}}function Us(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Vs(...t)}function Ys(e,t){return e&&t?e.cachedTicks&&e.cachedTicks()||e.ticks({distance:t}):[]}const Ks={created(){},require:["chart","renderer","resolver"],defaultSettings:{layout:{displayOrder:0},style:{ticks:"$guide-line",minorTicks:"$guide-line--minor"}},beforeRender(){this.blueprint=Us(),this.blueprint.width=this.rect.width,this.blueprint.height=this.rect.height,this.blueprint.x=this.rect.x,this.blueprint.y=this.rect.y,this.blueprint.crisp=!0},render(){if(this.x=this.settings.x?this.chart.scale(this.settings.x):null,this.y=this.settings.y?this.chart.scale(this.settings.y):null,To(this,"x",this.rect.width),To(this,"y",this.rect.height),!this.x&&!this.y)return[];this.settings.ticks=u({show:!0},this.style.ticks,this.settings.ticks||{}),this.settings.minorTicks=u({show:!1},this.style.minorTicks,this.settings.minorTicks||{}),this.lines={x:[],y:[]},this.lines.x=Ys(this.x,this.rect.width),this.lines.y=Ys(this.y,this.rect.height),this.lines.y=this.lines.y.map((e=>u(e,{flipXY:!0})));let e=e=>{let{dir:t,isMinor:n}=e,i=this.lines[t].filter((e=>!!e.isMinor===n)),r=n?this.settings.minorTicks:this.settings.ticks;this.resolver.resolve({settings:r,data:{items:i,dir:t}}).items.forEach((e=>{let n=e.data;var i,r;e.show&&this.blueprint.push({type:"line",x1:n.position,y1:0,x2:n.position,y2:1,stroke:e.stroke||"black",strokeWidth:void 0!==e.strokeWidth?e.strokeWidth:1,strokeDasharray:void 0!==e.strokeDasharray?e.strokeDasharray:void 0,flipXY:n.flipXY||!1,value:null!==(i=n.value)&&void 0!==i?i:null===(r=n.data)||void 0===r?void 0:r.value,dir:t})}))};return e({dir:"x",isMinor:!1}),e({dir:"x",isMinor:!0}),e({dir:"y",isMinor:!1}),e({dir:"y",isMinor:!0}),this.blueprint.output()}};function Xs(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"bottom";if(n*=.8,"left"===i||"right"===i){let r="right"===i;return"\n M ".concat(e," ").concat(t-n,"\n A ").concat(1.25*n," ").concat(1.25*n,", 0, 1, ").concat(r?0:1,", ").concat(e," ").concat(t+n,"\n L ").concat(r?e+n:e-n," ").concat(t," Z\n ")}let r="bottom"===i;return"\n M ".concat(e-n," ").concat(t,"\n A ").concat(1.25*n," ").concat(1.25*n,", 0, 1, ").concat(r?1:0,", ").concat(e+n," ").concat(t,"\n L ").concat(e," ").concat(r?t+n:t-n," Z\n ")}function Gs(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"bottom";if(n*=.75,"left"===i||"right"===i){let r="right"===i;return"\n M ".concat(e+=r?1.5*n:-1.5*n," ").concat(t-n,"\n L ").concat(e," ").concat(t+n,"\n L ").concat(r?e+n:e-n," ").concat(t," Z\n ")}let r="bottom"===i;return t+=r?1.5*n:-1.5*n,"\n M ".concat(e-n," ").concat(t,"\n L ").concat(e+n," ").concat(t,"\n L ").concat(e," ").concat(r?t+n:t-n," Z\n ")}function Js(e,t,n){return e<t||e>n}function Zs(e,t){if("string"==typeof e.formatter)return t.formatter(e.formatter);if("object"==typeof e.formatter)return t.formatter(e.formatter);if(void 0!==e.scale&&e.scale.data){const t=e.scale.data()&&e.scale.data().fields;return t&&t[0]?t[0].formatter():null}return null}function Qs(e){if(void 0===e)return 0;if("number"==typeof e&&isFinite(e))return e;if("string"==typeof e)switch(e){case"center":case"middle":return.5;case"bottom":case"right":return 1;default:return 0}return 0}function el(e){var t,n;let{chart:i,blueprint:r,renderer:o,p:a,settings:s,items:l,slopeLine:c}=e,h=!0,d=!1,f=!1,p=!1,g=!1,m=u(!0,{},s.style.line,a.line||{}),y=u(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,maxWidth:1,maxWidthPx:9999,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},s.style.label||{},{fill:m.stroke});if(d=c?r.processItem({type:"line",x1:c.x1,y1:c.y1,x2:c.x2,y2:c.y2,stroke:m.stroke||"black",strokeWidth:m.strokeWidth||1,strokeDasharray:m.strokeDasharray,flipXY:!1,value:a.valueInfo?a.valueInfo.id:a.value}):r.processItem({type:"line",x1:a.position,y1:0,x2:a.position,y2:1,stroke:m.stroke||"black",strokeWidth:m.strokeWidth||1,strokeDasharray:m.strokeDasharray,flipXY:a.flipXY||!1,value:a.valueInfo?a.valueInfo.id:a.value}),a.label&&!1!==a.label.show&&(null==c||!c.slope||0===c.slope)){const e=u(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,maxWidth:1,maxWidthPx:9999,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},s.style.label||{},{fill:m.stroke},a.label);let t,n={width:0,height:0},c="";t=Zs(a,i),!1!==a.label.showValue&&(t?c=" (".concat(t(a.value),")"):a.scale&&(c=" (".concat(a.value,")"))),c&&(n=o.measureText({text:c,fontFamily:e.fontFamily,fontSize:e.fontSize}));let d=o.measureText({text:e.text||"",fontFamily:e.fontFamily,fontSize:e.fontSize}),y={width:d.width+n.width,height:Math.max(d.height,n.height)},v=e.padding,x=Qs(a.flipXY?e.vAlign:e.align),b=Qs(a.flipXY?e.align:e.vAlign),w=Math.min(1+y.width+2*v,e.maxWidth*r.width,e.maxWidthPx),k=y.height+2*v,_=a.flipXY?k:w,M=a.flipXY?w:k;if(f=r.processItem({fn:t=>{let{width:n,height:i}=t,o=a.position*n-(a.flipXY?k:w)*(1-x);o=a.flipXY?o:Math.max(o,0);return{type:"rect",x:o,y:Math.max(Math.abs(b*i-M*b),0),width:a.flipXY?_:Math.min(_,r.width-o),height:M,stroke:e.background.stroke,strokeWidth:e.background.strokeWidth,fill:e.background.fill,opacity:e.background.opacity}},flipXY:a.flipXY||!1}),f.x<-1||f.x+f.width>r.width+1||f.y<-1||f.y+f.height>r.height+1)f=void 0;else{p={type:"text",text:e.text||"",fill:e.fill,opacity:e.opacity,fontFamily:e.fontFamily,fontSize:e.fontSize,x:f.x+v,y:f.y+f.height/2+y.height/3,maxWidth:f.width-2*v-n.width,anchor:"start"},c&&(g={type:"text",text:c||"",fill:e.fill,opacity:e.opacity,fontFamily:e.fontFamily,fontSize:e.fontSize,x:p.x+3+(f.width-(n.width+2*v)),y:p.y});for(let e=0,t=l.length;e<t;e++){let t=l[e];"rect"===t.type?qa(f,t)&&(h=!1):"line"===t.type&&a.flipXY===t.flipXY&&za(f,t)&&(h=!1)}}}if(d&&l.push(d),c&&0!==c.slope&&(!1!==(null===(t=c.label)||void 0===t?void 0:t.show)||!1!==(null===(n=c.label)||void 0===n?void 0:n.showValue))){var v,x,b;let e,t;const n=120;let s=!1!==(null===(v=c.label)||void 0===v?void 0:v.show)?null===(x=c.label)||void 0===x?void 0:x.text:"";if(!1!==(null===(b=c.label)||void 0===b?void 0:b.showValue)){var w;const t=Zs(a,i),n=t?t(c.value):c.value;e="(".concat(c.slope,"x + ").concat(n,")"),s+=null!==(w=c.label)&&void 0!==w&&w.text?" ".concat(e):e}if(s.length>1){var k,_,M;const e=o.measureText({text:s,fontFamily:y.fontFamily,fontSize:y.fontSize});e.width=e.width>n?n:e.width;const a=function(e,t,n){const i=e.scale({scale:"x"}),r=e.scale({scale:"y"});if(t>0){if(i.max()*t+n>=r.max())return!0}else if(t<0&&i.min()*t+n>=r.max())return!0;return!1}(i,c.slope,c.value)?function(e,t,n){const i=e.scale({scale:"x"}),r=e.scale({scale:"y"});return i((r.max()-n)/t)}(i,c.slope,c.value):void 0,u=void 0===a||c.isRtl?y.padding:3*y.padding,h=void 0!==a||c.slope>0?3*y.padding:y.padding,f=function(e,t,n,i,r,o){let a=0;if(void 0!==n){if(n<.8)return a=e.slope<0||e.isRtl?3*o.padding:2*o.padding,e.isRtl,n*r.width+a;if(1===n)return e.isRtl?n*r.width-(i.width+3*o.padding):n*r.width-(i.width+6*o.padding);if(n>.8)return e.isRtl?n*r.width-(i.width+3*o.padding):n*r.width-(i.width+6*o.padding)}else if(e.slope>0)return t.x2-(i.width+2*o.padding);return e.isRtl?t.x1-(i.width+2*o.padding):t.x1}(c,d,a,e,r,y),p=Math.min(d.y1,d.y2);null!==(k=c.label)&&void 0!==k&&k.stroke&&(t={type:"rect",x:c.isRtl?Math.max(f,u)-2:Math.max(f,u)+2,y:Math.abs(Math.max(p,h)-e.height),rx:3,ry:3,width:e.width+y.padding,height:e.height-2,stroke:m.stroke,fill:m.stroke});const g={type:"text",text:s,fill:null!==(_=null===(M=c.label)||void 0===M?void 0:M.stroke)&&void 0!==_?_:m.stroke,opacity:y.opacity,fontFamily:y.fontFamily,fontSize:y.fontSize,x:t?t.x+2:Math.max(f,u)+2,y:t?t.y+e.height-y.padding:Math.abs(Math.max(p,h)-y.padding/2),anchor:"start",title:s,maxWidth:n,width:e.width};(function(e,t,n,i,r){for(let o=0,a=e.length;o<a;o++){const a=e[o];if("text"===(null==a?void 0:a.type)&&Math.abs(a.x-t.x)<Math.max(a.width+i,t.width+i)&&Math.abs(a.y-t.y)<n.height+r)return!0}return!1})(l,g,e,u,h)||(t&&l.push(t),l.push(g))}}h&&f&&p&&(l.push(f,p),g&&l.push(g))}function tl(e){const t={value:e.value};return e.label&&(t.label=e.label.text),t}function nl(e){return void 0!==("function"==typeof e.value?e.value():e.value)}function il(e,t){const n=e.min();if(n===e.max()){const i=function(e){const t=e.range();return 2===(null==t?void 0:t.length)&&t[0]>t[1]}(e);if(t<n)return i?2:-1;if(t>n)return i?-1:2}return e(t)}function rl(e,t){return e&&t&&Math.abs(e.x-t.x)<1e-15&&Math.abs(e.y-t.y)<1e-15}const ol={require:["chart","renderer"],defaultSettings:{layout:{displayOrder:0},style:{oob:{show:!0,width:10,fill:"#1A1A1A",stroke:"transparent",strokeWidth:0,opacity:1,text:{fontFamily:"Arial",stroke:"transparent",fill:"#fff",strokeWidth:0,opacity:1},triangle:{fill:"#4D4D4D",stroke:"transparent",strokeWidth:0,opacity:1},padding:{x:28,y:5}},line:{stroke:"#000"},label:{strokeWidth:0}}},preferredSize:()=>30,beforeRender(){this.blueprint=Us(),this.blueprint.width=this.rect.width,this.blueprint.height=this.rect.height,this.blueprint.x=this.rect.x,this.blueprint.y=this.rect.y,this.blueprint.crisp=!0},render(){let e=this.settings;if(this.lines={x:[],y:[]},this.lines.x=e.lines&&e.lines.x||[],this.lines.y=e.lines&&e.lines.y||[],0===this.lines.x.length&&0===this.lines.y.length)return[];const t={x0:[],x1:[],y0:[],y1:[]};this.lines.x=this.lines.x.filter(nl).map((e=>{if("function"==typeof e.value&&(e.value=e.value()),e.scale){let t=this.chart.scale(e.scale);const n=il(t,e.value);return u(e,{scale:t,position:n})}return u(e,{position:e.value})})),this.lines.y=this.lines.y.filter(nl).map((e=>{if("function"==typeof e.value&&(e.value=e.value()),e.scale){let t=this.chart.scale(e.scale);const n=il(t,e.value);return u(e,{scale:t,position:n,flipXY:!0})}return u(e,{position:e.value,flipXY:!0})})),this.lines.x=this.lines.x.filter((e=>!(e.position<0||e.position>1)||(t["x".concat(e.position>1?1:0)].push(tl(e)),!1))),this.lines.y=this.lines.y.filter((e=>!(!e.slope||0===e.slope)||(!(e.position<0||e.position>1)||(t["y".concat(e.position>1?1:0)].push(tl(e)),!1))));let n=[];return[...this.lines.x,...this.lines.y].forEach((i=>{if(!0===i.show||void 0===i.show){let r;if(i.slope&&0!==i.slope){const e=this.chart.scale({scale:"x"}),n=this.chart.scale({scale:"y"}),o=e.min(),a=e.max(),s=n.min(),l=n.max();r=p(p({},i),{},{x1:void 0,y1:void 0,x2:void 0,y2:void 0});const c=o*i.slope+i.value,u=a*i.slope+i.value,h=(s-i.value)/i.slope,d=(l-i.value)/i.slope;let f=[];Js(c,s,l)||(f[0]={x:il(e,o),y:il(n,c)}),Js(h,o,a)||(f[1]={x:il(e,h),y:1}),Js(u,s,l)||(f[2]={x:il(e,a),y:il(n,u)}),Js(d,o,a)||(f[3]={x:il(e,d),y:0});if(f.filter((e=>!!e)).length>2&&function(e){rl(e[0],e[1])&&(e[1]=void 0),rl(e[1],e[2])&&(e[2]=void 0),rl(e[2],e[3])&&(e[3]=void 0),rl(e[3],e[0])&&(e[3]=void 0)}(f),f=f.filter((e=>!!e)),f.length<2)return void t["y".concat(c>l?0:1)].push(tl(i));r.x1=f[0].x,r.y1=f[0].y,r.x2=f[1].x,r.y2=f[1].y}else r=void 0;el({chart:this.chart,blueprint:this.blueprint,renderer:this.renderer,p:i,settings:e,items:n,slopeLine:r})}})),e.style.oob.show&&function(e){let{blueprint:t,oob:n,settings:i,items:r}=e;const o=Object.keys(n);let a=i.style.oob||{};for(let e=0,i=o.length;e<i;e++){const i=o[e],s=n[i];if(s.length>0){let e=i.charAt(1),n="y"===i.charAt(0),o=a.padding.x+a.width,l=a.padding.y+a.width,c="bottom";c=n?"1"===e?"bottom":"top":"1"===e?"right":"left";let u=t.processItem({fn:t=>{let{width:i,height:r}=t,u=e*i+("1"===e?-o:o),h=n?l:r-l;return"arc"===a.type?{type:"path",d:Xs(n?h:u,n?u:h,a.width,c),x:u,y:h,stroke:a.stroke,fill:a.fill,strokeWidth:a.strokeWidth||0}:{type:"circle",cx:u,cy:h,r:a.width,stroke:a.stroke,fill:a.fill,strokeWidth:a.strokeWidth||0,opacity:a.opacity,data:s}},flipXY:n}),h=u.cx||u.x,d=u.cy||u.y;const f=s.map((e=>e.label?"".concat(e.label," (").concat(e.value,")"):"(".concat(e.value,")"))),p=f.reduce(((e,t,n)=>0===n?t:"".concat(e,"\n\n").concat(t)),"");let g={type:"text",text:s.length||"",title:p,x:h-.4*a.width,y:d+.4*a.width,fontFamily:a.text.fontFamily,fontSize:"".concat(1.3*a.width,"px"),stroke:a.text.stroke,fill:a.text.fill,strokeWidth:a.text.strokeWidth||0,opacity:a.text.opacity},m={type:"path",d:Gs(h,d,a.width,c),x:h,y:d,stroke:a.triangle.stroke,fill:a.triangle.fill,strokeWidth:a.triangle.strokeWidth||0,opacity:a.triangle.opacity};r.push(u,g,m)}}}({blueprint:this.blueprint,oob:t,settings:e,items:n}),n}};function al(e){const t={type:"line",x1:0,x2:0,y1:0,y2:0,collider:{type:null}};return"top"===e.align||"bottom"===e.align?(t.x1=e.innerRect.x-e.outerRect.x,t.x2=t.x1+e.innerRect.width,t.y1=t.y2="top"===e.align?e.innerRect.height-e.padding:e.padding):(t.x1=t.x2="left"===e.align?e.innerRect.width-e.padding:e.padding,t.y1=e.innerRect.y-e.outerRect.y,t.y2=t.y1+e.innerRect.height),function(e,t){u(e,t.style)}(t,e),t}function sl(e){return"string"==typeof e||"number"==typeof e?e:"-"}function ll(e,t,n){n.layered||!n.stepSize?function(e,t){t.collider={type:"polygon",vertices:[{x:t.boundingRect.x,y:t.boundingRect.y},{x:t.boundingRect.x+t.boundingRect.width,y:t.boundingRect.y},{x:t.boundingRect.x+t.boundingRect.width,y:t.boundingRect.y+t.boundingRect.height},{x:t.boundingRect.x,y:t.boundingRect.y+t.boundingRect.height}]}}(0,t):n.tilted?function(e,t,n){const i=n.angle*(Math.PI/180),r=Math.max(n.stepSize/2,t.boundingRect.height/2),o="start"===t.anchor,a="end"===t.anchor&&i<0,s="start"===t.anchor&&i>=0,l=t.boundingRect.y+(s||a?t.boundingRect.height:0),c=[{x:t.x-r,y:l},{x:t.x+r,y:l}].map((e=>ia(e,i,{x:t.x,y:t.y}))),u={x:o?t.boundingRect.x+t.boundingRect.width+10:t.boundingRect.x-10,y:t.boundingRect.y+t.boundingRect.height},h={x:o?t.boundingRect.x+t.boundingRect.width+10:t.boundingRect.x-10,y:t.boundingRect.y},d=i>=0?[u,h]:[h,u];c.push(...d),t.collider={type:"polygon",vertices:c}}(0,t,n):function(e,t,n){if("bottom"===n.align||"top"===n.align){const i=e.position*n.innerRect.width+(n.innerRect.x-n.outerRect.x-n.stepSize/2);t.collider={type:"rect",x:i,y:0,width:i<0?n.stepSize+i:n.stepSize,height:n.innerRect.height}}else{const i=e.position*n.innerRect.height+(n.innerRect.y-n.outerRect.y-n.stepSize/2);t.collider={type:"rect",x:0,y:i,width:n.innerRect.width,height:i<0?n.stepSize+i:n.stepSize}}const i=t.collider;i.x=Math.max(i.x,0),i.y=Math.max(i.y,0);const r=i.x+i.width-(n.outerRect.x+n.outerRect.width);i.width=r>0?i.width-r:i.width;const o=i.y+i.height-(n.outerRect.y+n.outerRect.height);i.height=o>0?i.height-o:i.height}(e,t,n)}function cl(e,t){const n=isNaN(e.style.align)?.5:Math.min(Math.max(e.style.align,0),1);let i=0;if(e.tilted)i=e.stepSize*n;else{const r=t?e.textRect.height:e.textRect.width;i=Math.max(0,e.stepSize-r)*n}return i}function ul(e,t){var n,i;const r={type:"text",text:sl(e.label),x:0,y:0,maxWidth:t.maxWidth,maxHeight:t.maxHeight,tickValue:null!==(n=e.value)&&void 0!==n?n:null===(i=e.data)||void 0===i?void 0:i.value};return"top"===t.align||"bottom"===t.align?(r.x=e.start*t.innerRect.width+(t.innerRect.x-t.outerRect.x)+cl(t,!1),r.y="top"===t.align?t.innerRect.height:0,r.anchor=t.stepSize?"start":"middle",r.x+=isNaN(t.style.offset)?0:+t.style.offset):(r.y=e.start*t.innerRect.height+(t.innerRect.y-t.outerRect.y)+cl(t,!0),r.x="left"===t.align?t.innerRect.width:0,r.anchor="left"===t.align?"end":"start",r.baseline=t.stepSize?"text-before-edge":"central",r.y+=isNaN(t.style.offset)?0:+t.style.offset),function(e,t){["fill","fontSize","fontFamily"].forEach((n=>{e[n]=t.style[n]}))}(r,t),function(e,t){if(!t.tilted&&!t.stepSize)if("top"===t.align||"bottom"===t.align){const n=0,i=t.outerRect.width,r=Math.min(t.maxWidth/2,t.textRect.width/2),o=e.x-r,a=e.x+r;o<n?(e.anchor="start",e.x=t.innerRect.x-t.outerRect.x):a>i&&(e.anchor="end",e.x=t.innerRect.width+t.innerRect.x)}else{const n=0,i=t.outerRect.height,r=t.maxHeight/2,o=e.y-r,a=e.y+r;o<n?(e.y=t.innerRect.y-t.outerRect.y,e.baseline="text-before-edge"):a>i&&(e.y=t.innerRect.height+(t.innerRect.y-t.outerRect.y),e.baseline="text-after-edge")}}(r,t),function(e,t){"top"===t.align?e.y-=t.padding:"bottom"===t.align?e.y+=t.padding+t.maxHeight:"left"===t.align?e.x-=t.padding:"right"===t.align&&(e.x+=t.padding)}(r,t),function(e,t){if(t.tilted){const n=-t.angle,i=n*(Math.PI/180);"bottom"===t.align?(e.x-=t.maxHeight*Math.sin(i)/2,e.y-=t.maxHeight,e.y+=t.maxHeight*Math.cos(i)/2):e.x-=t.maxHeight*Math.sin(i)/3,e.transform="rotate(".concat(n,", ").concat(e.x,", ").concat(e.y,")"),e.anchor="bottom"===t.align==t.angle<0?"start":"end";const r=Math.cos(i)*t.maxWidth;if("bottom"===t.align==t.angle<0){const n=t.outerRect.width-t.paddingEnd;e.x+r>n&&(e.maxWidth=(n-e.x-10)/Math.cos(i))}else{const n=t.paddingEnd;e.x-r<n&&(e.maxWidth=(e.x-n-10)/Math.cos(i))}}}(r,t),function(e,t){e.boundingRect=t.textBounds(e)}(r,t),ll(e,r,t),r}function hl(e,t){const n={type:"line",x1:0,x2:0,y1:0,y2:0,collider:{type:null},tickValue:e.value};return"top"===t.align||"bottom"===t.align?(n.x1=n.x2=e.position*t.innerRect.width+(t.innerRect.x-t.outerRect.x),n.y1="top"===t.align?t.innerRect.height:0,n.y2="top"===t.align?n.y1-t.tickSize:n.y1+t.tickSize):(n.y1=n.y2=e.position*t.innerRect.height+(t.innerRect.y-t.outerRect.y),n.x1="left"===t.align?t.innerRect.width:0,n.x2="left"===t.align?n.x1-t.tickSize:n.x1+t.tickSize),function(e,t){u(e,t.style)}(n,t),function(e,t){"top"===t.align?(e.y1-=t.padding,e.y2-=t.padding):"bottom"===t.align?(e.y1+=t.padding,e.y2+=t.padding):"left"===t.align?(e.x1-=t.padding,e.x2-=t.padding):"right"===t.align&&(e.x1+=t.padding,e.x2+=t.padding)}(n,t),function(e,t){const n=e.strokeWidth/2;e.x1===t.innerRect.width?(e.x1-=n,e.x2-=n):0===e.x1?(e.x1+=n,e.x2+=n):e.y1===t.innerRect.height?(e.y1-=n,e.y2-=n):0===e.y1&&(e.y1+=n,e.y2+=n)}(n,t),n}function dl(e){return!e.isMinor&&e.position>=0&&e.position<=1}function fl(e){let{rect:t,state:n,majorTicks:i,measure:r,horizontal:o}=e;return o?function(e){let{majorTicks:t,measureText:n,rect:i,state:r}=e;const o="layered"===r.labels.activeMode?2:1,a=i.width,s=t.map((e=>e.label)).map((e=>"".concat(e.slice(0,1)).concat(e.length>1?"…":""))).map(n).map((e=>e.width));for(let e=0;e<t.length;++e){const n=t[e];if(o*a*Math.abs(n.start-n.end)<s[e])return!0}return!1}({majorTicks:i,measureText:r,rect:t,state:n}):function(e){let{majorTicks:t,measureText:n,rect:i}=e;const r=i.height,o=n("M").height;return!(t.length<2)&&r*Math.abs(t[0].position-t[1].position)<o}({majorTicks:i,measureText:r,rect:t})}function pl(e){let{value:t,maxValue:n,minValue:i,range:r,modifier:o}=e;return isNaN(r)||isNaN(o)||(t=r*o),t>n&&(t=n),t<i&&(t=i),t}function gl(e){let{isDiscrete:t,rect:n,formatter:i,measureText:r,scale:o,settings:a,state:s}=e,l=0;const c={left:0,top:0,right:0,bottom:0},{maxLengthPx:u,minLengthPx:h}=a.labels;if(a.labels.show){const e=a.align,d="top"===e||"bottom"===e,f=d?n.inner.width:n.inner.height,p=o.ticks({settings:a,distance:f,formatter:i}).filter(dl),g=e=>{const t=r({text:e,fontSize:a.labels.fontSize,fontFamily:a.labels.fontFamily});return t.width=pl({value:t.width,maxValue:u,minValue:h}),t};if(t&&d&&"auto"===a.labels.mode&&(!function(e){let{majorTicks:t,measure:n,rect:i,state:r,settings:o}=e;const a=o.labels.maxGlyphCount,s="layered"===r.labels.activeMode?2:1,l=o.labels.tiltThreshold?o.labels.tiltThreshold:.7,c=n("…").width,u=i.width;let h=0,d=0;if(isNaN(a))for(let e=0;e<t.length;e++){const i=t[e],r=i.label,o=n(r).width*(r.length>1?l:1);if(d=s*u*Math.abs(i.start-i.end),o+c>d)return!0}else if(d=s*u*t.reduce(((e,t)=>Math.min(Math.abs(t.start-t.end),e)),1/0),h=n("M").width*l*a,h+c>d)return!0;return!1}({majorTicks:p,measure:g,rect:n.inner,state:s,settings:a})?s.labels.activeMode="horizontal":s.labels.activeMode="tilted"),!a.labels.filterOverlapping&&"tilted"!==s.labels.activeMode&&fl({rect:n.inner,state:s,majorTicks:p,measure:g,horizontal:d})){return{size:Math.max(n.outer.width,n.outer.height),isToLarge:!0}}let m,y;if("tilted"===s.labels.activeMode){const e=Math.abs(a.labels.tiltAngle)*(Math.PI/180);m=t=>pl({value:t.width,maxValue:u,minValue:h})*Math.sin(e)+t.height*Math.cos(e)}else m=d?e=>e.height:e=>pl({value:e.width,maxValue:u,minValue:h});if(d&&"tilted"!==s.labels.activeMode)y=["M"];else if(isNaN(a.labels.maxGlyphCount))y=p.map((e=>e.label));else{let e="";for(let t=0;t<a.labels.maxGlyphCount;t++)e+="M";y=[e]}const v=y.map(g),x=v.map(m),b=Math.max(...x,0);if(l+=b,l+=a.labels.margin,"layered"===s.labels.activeMode&&(l*=2),"tilted"===s.labels.activeMode){const e="bottom"===a.align==a.labels.tiltAngle>=0,t=Math.abs(a.labels.tiltAngle)*(Math.PI/180),i=(b-g("M").height*Math.cos(t))/Math.sin(t),r=e=>Math.min(i,e.width)*Math.cos(t)+e.height,o=(t,i)=>{const r=p[i]?p[i].position:0;return e?t-r*n.inner.width:t-(1-r)*n.inner.width},s=Math.min(a.labels.maxEdgeBleed,Math.max(...v.map(r).map(o),0))+a.paddingEnd;if(c[e?"left":"right"]=s,!a.labels.filterOverlapping&&function(e){let{majorTicks:t,measureText:n,rect:i,bleedSize:r,angle:o}=e;if(t.length<2)return!1;if(0===o)return!0;const a=Math.abs(o),s=1/(Math.min(i.outer.width-r,i.inner.width)*Math.abs(t[0].position-t[1].position));return n("M").height>Math.sin(a*(Math.PI/180))/s}({majorTicks:p,measureText:g,rect:n,bleedSize:s,angle:a.labels.tiltAngle})){return{size:Math.max(n.outer.width,n.outer.height),isToLarge:!0}}}}return{size:l,edgeBleed:c}}const ml=(e,t,n)=>e.width*Math.abs(t.position-n.position);function yl(e){let{layered:t,major:n,innerRect:i,outerRect:r,tick:o,index:a}=e;const s=t?2:1,l=n[a-s],c=n[a+s],u=l?ml(i,o,l)/2-2:1/0,h=c?ml(i,o,c)/2-2:1/0;return n.length<2?i.width:l?c?2*Math.min(u,h):(e=>{let{innerRect:t,outerRect:n,tick:i,prevWidth:r}=e;const o=t.x-n.x,a=n.width-t.width-o,s=t.width-t.width*i.position+a,l=2*Math.min(r,s),c=1===i.position?t.width/2-2:0;return Math.max(r,l,c)})({innerRect:i,outerRect:r,tick:o,prevWidth:u}):(e=>{let{innerRect:t,outerRect:n,tick:i,nextWidth:r}=e;const o=t.x-n.x,a=t.width*i.position+o,s=2*Math.min(r,a),l=0===i.position?t.width/2-2:0;return Math.max(r,s,l)})({innerRect:i,outerRect:r,tick:o,nextWidth:h})}function vl(e){const t=e.innerRect,n={cx:t.width/2,cy:t.height/2},i=Math.min(t.height,t.width)/2*e.radius,r=i+e.style.strokeWidth,o={visible:!0,type:"path",arcDatum:{startAngle:e.startAngle,endAngle:e.endAngle},transform:"translate(0, 0) translate(".concat(n.cx,", ").concat(n.cy,")"),desc:{share:1,slice:{cornerRadius:0,innerRadius:i,outerRadius:r}},ticks:[]};return function(e,t){u(e,t.style)}(o,e),o}function xl(e,t,n,i){return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}function bl(e,t){const n=t.innerRect,i={cx:n.width/2,cy:n.height/2},r=Math.min(n.height,n.width)/2*t.radius+t.padding,o=t.startAngle,a=t.endAngle,s=t.tickSize,l=a-o;let c=a-e.position*l;c-=Math.PI/2;const h=xl(i.cx,i.cy,r+s,c),d=xl(i.cx,i.cy,r,c),f={type:"line",x1:h.x,y1:h.y,x2:d.x,y2:d.y,value:e.value};return function(e,t){const n=p({},t.style);u(e,n)}(f,t),f}function wl(e){return"string"==typeof e||"number"==typeof e?e:"-"}function kl(e,t,n){let i;return i="left"===t?n.x:"right"===t?e.outerRect.width-n.x:Math.max(n.x,e.outerRect.width-n.x),i}function _l(e,t){const n=t.innerRect,i={cx:n.width/2,cy:n.height/2},r=Math.min(n.height,n.width)/2*t.radius+t.padding,o=t.startAngle,a=t.endAngle,s=t.tickSize,l=a-o,c=.2;let u,h;u="top"===t.align||"bottom"===t.align?a-e.position*l:o+e.position*l,h=u<-.2&&u>-Math.PI+c?"left":u>.2&&u<Math.PI-c?"right":"center",u-=Math.PI/2;const d=function(e,t,n,i){return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}(i.cx,i.cy,r+s+6,u);let f;f="left"===h?"end":"right"===h?"start":"middle";const p={type:"text",text:wl(e.label),align:h,x:d.x,y:d.y,maxHeight:t.maxHeight,maxWidth:kl(t,h,d),anchor:f,baseline:"middle"};return function(e,t){["fill","fontSize","fontFamily"].forEach((n=>{e[n]=t.style[n]}))}(p,t),function(e,t){e.boundingRect=t.textBounds(e)}(p,t),function(e,t,n){let i,r;const o=parseFloat(n.fontSize)||0;i=t.y-o/2,r=e.innerRect.height-(t.y+o/2),(i<0||r<0)&&(n.text="")}(t,d,p),p}function Ml(e){let t=0;return t+=e.paddingStart,t+=e.line.show?e.line.strokeWidth/2:0,t+=e.ticks.show?e.ticks.margin:0,t}function Sl(e){let t=0;return t+=e.line.show?e.line.strokeWidth/2:0,t+=e.ticks.show?e.ticks.margin:0,t}function Rl(e){let t=0;return t+=e.ticks.show?e.ticks.tickSize:0,t+=Ml(e)+e.labels.margin,t}function Cl(e,t){return e.map((e=>hl(e,t)))}function Nl(e,t){return t?Math.abs(t.end-t.start):e.bandwidth()}function Dl(e){let{textMetrics:t,settings:n,innerRect:i,scale:r,tilted:o,layered:a,tick:s}=e;const l=t.height,c=Nl(r,s),u={width:0,height:l};if("left"===n.align||"right"===n.align)u.width=i.width-Rl(n)-n.paddingEnd;else if(a)u.width=c*i.width*2;else if(o){const e=Math.abs(n.labels.tiltAngle)*(Math.PI/180);u.width=(i.height-Rl(n)-n.paddingEnd-l*Math.cos(e))/Math.sin(e)}else u.width=c*i.width;return u.width=pl({value:u.width,maxValue:n.labels.maxLengthPx,minValue:n.labels.minLengthPx}),u}function ql(e){let{textMetrics:t,settings:n,innerRect:i,outerRect:r,tilted:o,layered:a,tick:s,index:l,major:c}=e;const u=t.height,h={width:0,height:u};if("left"===n.align||"right"===n.align)h.width=i.width-Rl(n)-n.paddingEnd;else if(o){const e=Math.abs(n.labels.tiltAngle)*(Math.PI/180);h.width=(i.height-Rl(n)-n.paddingEnd-u*Math.cos(e))/Math.sin(e)}else h.width=yl({layered:a,major:c,innerRect:i,outerRect:r,tick:s,index:l});return h.width=pl({value:h.width,maxValue:n.labels.maxLengthPx,minValue:n.labels.minLengthPx}),h}function El(e){let t;function n(){return t=ql,n}function i(){return t=Dl,i}function r(e){let{settings:n,scale:i,innerRect:r,outerRect:o,measureText:a,ticks:s,state:l,textBounds:c}=e;const u=[],h=function(e){return e.filter((e=>!e.isMinor))}(s),d=function(e){return e.filter((e=>e.isMinor))}(s),f={innerRect:r,align:n.align,outerRect:o},p="tilted"===l.labels.activeMode,g="layered"===l.labels.activeMode;let m;if(n.arc&&(f.startAngle=n.arc.startAngle,f.endAngle=n.arc.endAngle,f.radius=n.arc.radius),n.line.show&&(f.style=n.line,f.padding=n.paddingStart,n.arc?u.push(vl(f)):u.push(al(f))),n.ticks.show&&(f.style=n.ticks,f.tickSize=n.ticks.tickSize,f.padding=Ml(n),n.arc?(f.padding=Sl(n),m=function(e,t){return e.map((e=>bl(e,t)))}(h,f)):m=Cl(h,f)),n.labels.show){const e=Rl(n);f.style=n.labels,f.padding=e,f.tilted=p,f.layered=g,f.angle=n.labels.tiltAngle,f.paddingEnd=n.paddingEnd,f.textBounds=c;const s=(e,s)=>{f.textRect=function(e){let{style:t,measureText:n,tick:i}=e;return n({text:i.label,fontSize:t.fontSize,fontFamily:t.fontFamily})}({tick:e,measureText:a,style:f.style});const l=t({textMetrics:f.textRect,settings:n,innerRect:r,outerRect:o,scale:i,tilted:p,layered:g,tick:e,major:h,index:s});f.maxWidth=l.width,f.maxHeight=l.height,f.stepSize=function(e){let{innerRect:t,scale:n,settings:i,tick:r}=e;return("top"===i.align||"bottom"===i.align?t.width:t.height)*Nl(n,r)}({innerRect:r,scale:i,settings:n,tick:e})};let l=[];n.arc?(f.padding=function(e){let t=0;return t+=e.ticks.show?e.ticks.tickSize:0,t+=Sl(e)+e.labels.margin,t}(n),l=function(e,t,n){return e.map(((e,i)=>{n(e,i);const r=_l(e,t);return r.data=e.data,r}))}(h,f,s)):l=!g||"top"!==n.align&&"bottom"!==n.align?function(e,t,n){return e.map(((e,i)=>{n(e,i);const r=ul(e,t);return r.data=e.data,r}))}(h,f,s):function(e,t,n,i){const r=t.padding,o=Rl(n);return e.map(((e,a)=>{i(e,a);const s=o+t.maxHeight+n.labels.margin;t.layer=a%2,t.padding=a%2==0?r:s;const l=ul(e,t);return l.data=e.data,l}))}(h,f,n,s),n.labels.filterOverlapping&&function(e,t,n){let i=(t,n)=>qa(M(1,e[t].boundingRect),M(1,e[n].boundingRect));if(n&&n.tilted){const t=Math.abs(n.angle);i=(n,i)=>{const r=1/Math.abs(e[n].x-e[i].x),o=Math.sin(t*(Math.PI/180))/r;return e[n].boundingRect.height>o}}for(let n=0;n<=e.length-1;n++)for(let r=n+1;r<=Math.min(n+5,n+(e.length-1));r++)e[n]&&e[r]&&i(n,r)&&(r===e.length-1?(e.splice(n,1),t&&t.splice(n,1)):(e.splice(r,1),t&&t.splice(r,1)),r--,n--)}(l,m,f),u.push(...l)}return n.minorTicks&&n.minorTicks.show&&d.length>0&&(f.style=n.minorTicks,f.tickSize=n.minorTicks.tickSize,f.padding=function(e){return e.line.strokeWidth+e.minorTicks.margin}(n),u.push(...Cl(d,f))),m&&u.push(...m),u}return n.build=r,i.build=r,e?i():n()}const Ol={labels:{show:!0,tiltAngle:40,tiltThreshold:.7,maxEdgeBleed:1/0,margin:4,maxLengthPx:150,minLengthPx:0,mode:"auto",maxGlyphCount:NaN,align:.5,offset:0,filterOverlapping:!1},ticks:{show:!1,margin:0,tickSize:4},line:{show:!1},paddingStart:0,paddingEnd:10,align:"auto"},zl={labels:{show:!0,margin:4,maxLengthPx:150,minLengthPx:0,align:.5,offset:0,filterOverlapping:!0},ticks:{show:!0,margin:0,tickSize:8},minorTicks:{show:!1,tickSize:3,margin:0},line:{show:!0},paddingStart:0,paddingEnd:10,align:"auto"};const Al={require:["chart","renderer","dockConfig"],defaultSettings:{layout:{displayOrder:0,prioOrder:0},settings:{},style:{labels:"$label",ticks:"$guide-line",minorTicks:"$guide-line--minor",line:"$guide-line"}},created(){this.state={isDiscrete:!!this.scale.bandwidth,isHorizontal:!1,labels:{activeMode:"horizontal"},ticks:[],innerRect:{width:0,height:0,x:0,y:0},outerRect:{width:0,height:0,x:0,y:0},defaultDock:void 0,concreteNodeBuilder:void 0,settings:void 0},this.state.isDiscrete?this.state.defaultDock="bottom":this.state.defaultDock="left",this.setState(this.settings)},setState(){this.state.isDiscrete=!!this.scale.bandwidth,this.state.settings=function(e){let{state:t,style:n,settings:i}=e;const r=u(!0,{},t.isDiscrete?Ol:zl,n),o=u(!0,{},r,i.settings),a=i.layout.dock||t.defaultDock;o.dock=a,o.align=function(e,t){const n=["top","bottom"],i=["left","right"];return-1!==n.indexOf(e)&&-1===i.indexOf(t)||-1!==i.indexOf(e)&&-1===n.indexOf(t)?e:t}(i.settings.align,a),o.labels.tiltAngle=Math.max(-90,Math.min(o.labels.tiltAngle,90));const{paddingStart:s,paddingEnd:l}=o;return o.paddingStart="function"==typeof s?s.call(null):s,o.paddingEnd="function"==typeof l?l.call(null):l,o}(this),this.state.concreteNodeBuilder=El(this.state.isDiscrete),this.dockConfig.dock(this.state.settings.dock),this.state.isHorizontal="top"===this.state.settings.align||"bottom"===this.state.settings.align,this.state.labels.activeMode=function(e,t,n){const i=t.labels.mode;return n&&e.isHorizontal?"auto"===i?e.labels.activeMode:-1!==["layered","tilted"].indexOf(t.labels.mode)&&-1!==["top","bottom"].indexOf(t.dock)?i:"horizontal":"horizontal"}(this.state,this.state.settings,this.state.isDiscrete)},preferredSize(e){const{formatter:t,state:n,scale:i}=this,r=this.state.isHorizontal?e.inner.width:e.inner.height;this.state.pxScale=Io(i,r);const o=function(e){let{isDiscrete:t,rect:n,formatter:i,measureText:r,scale:o,settings:a,state:s}=e,l=0;const{size:c,edgeBleed:u,isToLarge:h}=gl({isDiscrete:t,rect:n,formatter:i,measureText:r,scale:o,settings:a,state:s});if(l+=c,h)return{size:l};if(a.ticks.show&&(l+=a.ticks.margin,l+=a.ticks.tickSize),a.minorTicks&&a.minorTicks.show){const e=a.minorTicks.margin+a.minorTicks.tickSize;e>l&&(l=e)}if(a.line.show){const e=a.line.strokeWidth/2;l+=e,u[function(e){switch(e){case"top":return"bottom";case"bottom":return"top";case"left":return"right";case"right":return"left";default:return e}}(a.align)]=Math.ceil(e)}return l+=a.paddingStart,l+=a.paddingEnd,{size:l,edgeBleed:u}}({isDiscrete:this.state.isDiscrete,rect:{inner:e.inner,outer:e.outer},formatter:t,measureText:this.renderer.measureText,scale:this.state.pxScale,settings:this.state.settings,state:n});return o},beforeUpdate(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{settings:t}=e;this.setState(t)},resize(e){const{inner:t,outer:n}=e,i=u({},t,function(e){let{align:t,inner:n}=e;return"left"===t?{x:n.width+n.x}:"right"===t||"bottom"===t?n:{y:n.y+n.height}}({align:this.state.settings.align,inner:t})),r=n||i;return u(this.state.innerRect,i),u(this.state.outerRect,r),n},beforeRender(){const{scale:e,formatter:t}=this,n=this.state.isHorizontal?this.state.innerRect.width:this.state.innerRect.height;this.state.pxScale=Io(e,n),this.state.ticks=this.state.pxScale.ticks({distance:n,formatter:t}).filter((e=>e.position>=0&&e.position<=1))},render(){const{state:e}=this,t=[];return t.push(...this.state.concreteNodeBuilder.build({settings:this.state.settings,scale:this.state.pxScale,innerRect:this.state.innerRect,outerRect:this.state.outerRect,measureText:this.renderer.measureText,textBounds:this.renderer.textBounds,ticks:this.state.ticks,state:e})),Ws.multiple(t),t}};const Tl={render:()=>[]};function Il(e,t,n){let i="";if("function"==typeof e)i=e();else if("string"==typeof e)i=e;else if(n){const e=(n.data().fields||[]).map((e=>e.title()));i=e.join(t)}return i}function jl(e,t){let n="middle";return"left"===e?"top"===t?n="end":"bottom"===t&&(n="start"):"right"===e?"top"===t?n="start":"bottom"===t&&(n="end"):"left"===t?n="start":"right"===t&&(n="end"),n}const Pl={require:["renderer","chart"],defaultSettings:{layout:{dock:"bottom",displayOrder:0,prioOrder:0},settings:{paddingStart:5,paddingEnd:5,paddingLeft:0,paddingRight:0,anchor:"center",join:", ",maxLengthPx:NaN},style:{text:"$title"}},created(){this.definitionSettings=this.settings.settings;const e=this.settings.text,t=this.definitionSettings.join;this.title=Il(e,t,this.scale)},preferredSize(){return this.renderer.measureText({text:this.title,fontSize:this.style.text.fontSize,fontFamily:this.style.text.fontFamily}).height+this.definitionSettings.paddingStart+this.definitionSettings.paddingEnd},render(){const{title:e,definitionSettings:t,rect:n}=this,i=[];return i.push(function(e){let{title:t,definitionSettings:n,dock:i,rect:r,measureText:o,style:a}=e;const s={type:"text",text:t,x:0,y:0,dx:0,dy:0,anchor:jl(i,n.anchor),baseline:"alphabetical",stroke:"transparent",strokeWidth:0,fontWeight:"normal"};u(s,a.text);const l=o(s);if("top"===i||"bottom"===i){let e=r.width/2;"left"===n.anchor?e=n.paddingLeft||0:"right"===n.anchor&&(e=r.width-(n.paddingRight||0)),s.x=e,s.y="top"===i?r.height-n.paddingStart:n.paddingStart+l.height,s.dy="top"===i?-l.height/6:-l.height/3,s.maxWidth=.8*r.width}else{let e=r.height/2;"top"===n.anchor?e=n.paddingStart:"bottom"===n.anchor&&(e=r.height-n.paddingStart),s.y=e,s.x="left"===i?r.width-n.paddingStart:n.paddingStart,s.dx="left"===i?-l.height/3:l.height/3;const t="left"===i?270:90;s.transform="rotate(".concat(t,", ").concat(s.x+s.dx,", ").concat(s.y+s.dy,")"),s.maxWidth=.8*r.height}return isNaN(n.maxLengthPx)||(s.maxWidth=Math.min(s.maxWidth,n.maxLengthPx)),s}({title:e,dock:this.settings.layout.dock,definitionSettings:t,rect:n,measureText:this.renderer.measureText,style:this.style})),i},beforeUpdate(e){e.settings&&(u(this.settings,e.settings),this.definitionSettings=e.settings.settings);const t=this.settings.text,n=this.definitionSettings.join;this.title=Il(t,n,this.scale)}};function Fl(e,t){const n=e.settings.layout.dock,i=e.settings.settings.invert,r="top"===n||"bottom"===n,o=r?"width":"height",a=e.rect[o],s=e.chart.scroll(e.settings.scroll);let l;{let e=t[r?"x":"y"];i&&(e=a-e);const n=s.getState();l={startOffset:e,startScroll:n.start,swipe:!1};const o=e/a*(n.max-n.min)+n.min;o<n.start?l.startScroll=o:o>n.start+n.viewSize&&(l.startScroll=o-n.viewSize)}return{update:e=>{let t=e[r?"x":"y"];if(i&&(t=a-t),!l.swipe){if(Math.abs(l.startOffset-t)<=1)return;l.swipe=!0}const n=s.getState(),o=(t-l.startOffset)/a*(n.max-n.min),c=l.startScroll+o;s.moveTo(c)},end:e=>{let t=e[r?"x":"y"];i&&(t=a-t);const n=s.getState();if(l.swipe){const e=(t-l.startOffset)/a*(n.max-n.min),i=l.startScroll+e;s.moveTo(i)}else{const e=t/a*(n.max-n.min)+n.min-n.viewSize/2;s.moveTo(e)}}}}function Ll(e,t){const n=t.element().getBoundingClientRect();return{x:e.center.x-n.left,y:e.center.y-n.top}}const $l={require:["chart","renderer"],on:{panStart(e){const t=Ll(e,this.renderer),n={x:t.x-e.deltaX,y:t.y-e.deltaY};this.currentMove=Fl(this,n),this.currentMove.update(t)},panMove(e){if(!this.currentMove)return;const t=Ll(e,this.renderer);this.currentMove.update(t)},panEnd(e){if(!this.currentMove)return;const t=Ll(e,this.renderer);this.currentMove.end(t),this.currentMove=null},panCancel(){this.currentMove=null},tap(e){const t=Ll(e,this.renderer);Fl(this,t).end(t)}},defaultSettings:{settings:{backgroundColor:"#eee",thumbColor:"#ccc",width:16}},preferredSize:function(e){const t=this.chart.scroll(this.settings.scroll).getState();if(t.viewSize>=t.max-t.min){return Math.max(e.width,e.height)}return this.settings.settings.width},render:function(e){const t=this.settings.layout.dock,n=this.settings.settings.invert,i="top"===t||"bottom"===t,r=i?"width":"height",o=this.rect[r],a=this.chart.scroll(this.settings.scroll).getState();let s=o*(a.start-a.min)/(a.max-a.min);const l=o*a.viewSize/(a.max-a.min);return n&&(s=o-s-l),e("div",{style:{position:"relative",width:"100%",height:"100%",background:this.settings.settings.backgroundColor,pointerEvents:"auto"}},[].concat(e("div",{class:"scroller",style:{position:"absolute",[i?"left":"top"]:"".concat(s,"px"),[i?"top":"left"]:"25%",[i?"height":"width"]:"50%",[r]:"".concat(Math.max(1,l),"px"),background:this.settings.settings.thumbColor}})))},renderer:"dom"};function Bl(e){let{h:t,isVertical:n,value:i,pos:r,align:o,borderHit:a,state:s,idx:l}=e;const c="end"!==o,h=c?{left:"0",top:"0"}:{right:"0",bottom:"0"};let d=0,f="100%",p="100%";return s.targetRect&&"start"===s.settings.bubbles.align?(f="".concat(s.targetRect.x+s.targetRect.width,"px"),p="".concat(s.targetRect.y+s.targetRect.height,"px")):s.targetRect&&"end"===s.settings.bubbles.align&&(d=n?s.targetRect.x:s.targetRect.y,f="".concat(s.rect.width-d,"px"),p="".concat(s.rect.height-d,"px")),c||(r-=a),t("div",{onmouseover(e){e.srcElement.children[0].style.backgroundColor="#000",e.srcElement.children[0].style[n?"height":"width"]="2px"},onmouseout(e){e.srcElement.children[0].style.backgroundColor=s.style.line.stroke,e.srcElement.children[0].style[n?"height":"width"]="1px"},"data-value":i,"data-key":[s.key,"edge",l].join("-"),style:{cursor:n?"ns-resize":"ew-resize",position:"absolute",left:"".concat(n?d:r,"px"),top:"".concat(n?r:d,"px"),height:n?"".concat(a,"px"):p,width:n?f:"".concat(a,"px"),pointerEvents:"auto"}},[t("div",{style:u({backgroundColor:s.style.line.stroke,position:"absolute",height:n?"".concat(1,"px"):"100%",width:n?"100%":"".concat(1,"px"),pointerEvents:"none"},h)})])}function Hl(e){let{h:t,isVertical:n,label:i,otherValue:r,rangeIdx:o,idx:a,pos:s,align:l,state:c,value:u}=e;const h="end"!==l,d="outside"===c.settings.bubbles.placement;let f,g="none";n?(f=h?"left":"right",d&&(g=h?"translate(-100%, 0px)":"translate(100%, 0px)")):(f=h?"top":"bottom",d&&(g=h?"translate(0px, -100%)":"translate(0px, 100%)"));let m=c.edit&&c.edit.rangeIdx===o&&c.edit.bubbleIdx===a;const y={position:"relative",borderRadius:"".concat(c.style.bubble.borderRadius,"px"),border:"".concat(c.style.bubble.strokeWidth,"px solid ").concat(c.style.bubble.stroke),backgroundColor:c.style.bubble.fill,color:c.style.bubble.color,fontFamily:c.style.bubble.fontFamily,fontSize:c.style.bubble.fontSize,padding:"4px 8px",textAlign:"center",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"150px",minWidth:"50px",minHeight:"1em",pointerEvents:"auto",transform:n?"translate(0,-50%)":"translate(-50%,0)",cursor:n?"ns-resize":"ew-resize"};let v=c.style.bubble.stroke;const x=m?t("input",{type:"text",value:u,style:p(p({},y),{},{textAlign:"start",textOverflow:"",fontSize:"13px"}),onkeyup(e){if("Enter"===e.key){e.preventDefault(),e.stopPropagation();const t=parseFloat(e.target.value);isNaN(t)?(v="rgba(230, 78, 78, 0.6)",e.target.style.border="".concat(c.style.bubble.strokeWidth,"px solid ").concat(v)):c.onEditConfirmed(o,t,r)}else"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),c.onEditCanceled())}}):t("div",{"data-key":[c.key,"bubble",o,a].join("-"),"data-other-value":r,"data-idx":o,"data-bidx":a,style:y},[i]);return t("div",{style:{position:"absolute",[f]:"0",[n?"top":"left"]:"".concat(s,"px"),transform:g}},[x])}function Wl(e){let{h:t,isVertical:n,top:i,height:r,color:o,on:a,opacity:s}=e;return t("div",u({style:{backgroundColor:o,opacity:s,position:"absolute",left:n?0:"".concat(i,"px"),top:n?"".concat(i,"px"):0,height:n?"".concat(r,"px"):"100%",width:n?"100%":"".concat(r,"px"),pointerEvents:"auto"}},a),[])}function Vl(e){let{borderHit:t,els:n,isVertical:i,state:r,vStart:o,vEnd:a,idx:s}=e,l=0;r.targetRect&&(l=i?r.targetRect.y:r.targetRect.x);const c=!!r.scale,u=c?r.scale.norm(o)*r.size:o,h=c?r.scale.norm(a)*r.size:a,d=Math.abs(u-h),f=Math.min(u,h)+l,p=f+d;if(r.targetRect){const e=r.targetFillRect||r.targetRect,t=i?e.height:e.width,s=c?r.scale.norm(o)*t:o,l=c?r.scale.norm(a)*t:a,u=Math.abs(s-l),h=Math.min(s,l),d={h:r.h,isVertical:i,top:h,height:u,color:r.style.target.fill,opacity:r.style.target.opacity};r.style.target.opacity<.8&&(d.on={onmouseover(e){e.srcElement.style.opacity=r.style.target.opacity+.1},onmouseout(e){e.srcElement.style.opacity=r.style.target.opacity}}),n.push(r.h("div",{style:{position:"absolute",left:"".concat(e.x,"px"),top:"".concat(e.y,"px"),height:"".concat(e.height,"px"),width:"".concat(e.width,"px")}},[Wl(d)]))}const g=u<h?o:a,m=u<h?a:o,[y,v]=c?r.scale.domain():[Math.min(o,a),Math.max(o,a)],x=g+1e-5>=y&&g-1e-5<=v,b=m-1e-5<=v&&m+1e-5>=y;x&&n.push(Bl({h:r.h,isVertical:i,borderHit:t,value:g,pos:f,align:"start",state:r,idx:s})),b&&n.push(Bl({h:r.h,isVertical:i,borderHit:t,value:m,pos:p,align:"end",state:r,idx:s}));const w=r.settings.bubbles;if(w&&w.show){w.fontSize,w.fontFamily,w.fill;const e=[o,a];x&&n.push(Hl({h:r.h,isVertical:i,align:w.align,rangeIdx:s,idx:0,otherValue:m,value:g,label:"".concat(r.format(g,e)),pos:f,state:r})),b&&n.push(Hl({h:r.h,isVertical:i,align:w.align,rangeIdx:s,idx:1,otherValue:g,value:m,label:"".concat(r.format(m,e)),pos:p,state:r}))}}function Ul(e){const t=e.active.limitHigh-e.active.end,n=e.active.limitLow-e.active.start;let i=e.current-e.start;return i=i<0?Math.max(i,n):Math.min(i,t),i}function Yl(e){let t=[];const n=0===e.direction;if(Array.isArray(e.ranges)&&e.ranges.forEach(((i,r)=>{e.active&&r===e.active.idx||Vl({borderHit:5,els:t,isVertical:n,state:e,vStart:Math.min(i.min,i.max),vEnd:Math.max(i.min,i.max),idx:r})})),e.active){let i=e.start,r=e.current;if(-1!==e.active.idx)if("foo"===e.active.mode)i=Math.min(e.active.start,e.active.end),r=Math.max(e.active.start,e.active.end);else if("modify"===e.active.mode)i=Math.min(e.start,e.current),r=Math.max(e.start,e.current);else{const t=Ul(e);i=e.active.start+t,r=e.active.end+t}Vl({borderHit:5,els:t,isVertical:n,state:e,vStart:i,vEnd:r,idx:e.active.idx})}return t}function Kl(e){return{min:e.scale.min(),max:e.scale.max()}}function Xl(e){return{min:0,max:e.direction?e.rect.width:e.rect.height}}function Gl(e,t,n){let i,r,o=e.ranges,a=-1;for(i=0;i<o.length;i++){if(o[i].min<=t&&t<=o[i].max){a=i,n.min=i?o[i-1].max:n.min,n.max=i+1<o.length?o[i+1].min:n.max;break}if(t<o[i].min){n.max=o[i].min,n.min=i?o[i-1].max:n.min;break}}-1===a&&o.length&&i>=o.length&&(n.min=o[o.length-1].max),-1!==a&&(r={idx:a,start:o[a].min,end:o[a].max,limitLow:n.min,limitHigh:n.max,mode:"foo"}),e.active=r}function Jl(e){e.renderer.render(Yl(e))}function Zl(e,t){if(!t||!t.isActive())return[];const n=e.scale.data(),i=(n&&n.fields||[]).map((e=>e.id())),r=t.brushes().filter((e=>"range"===e.type&&-1!==i.indexOf(e.id)))[0];return r?r.brush.ranges():[]}function Ql(e,t){let n,i=1/0;const r=t.domain(),o=t.bandwidth()/2;for(let a=0;a<r.length;++a){const s=Math.abs(e-o-t(r[a]));s<i&&(i=s,n=r[a])}return n}function ec(e,t){return Math.min(...e)<=Math.max(...t)&&Math.max(...e)>=Math.min(...t)}function tc(e){return w(e.reduce(((e,t)=>(e.push(...b(t.bounds)),e)),[]))}const nc={require:["chart","settings","renderer"],defaultSettings:{settings:{bubbles:{show:!0,align:"start"}},style:{bubble:"$label-overlay",line:"$shape-guide--inverted",target:"$selection-area-target"}},renderer:"dom",on:{rangeStart(e){this.start(e)},rangeMove(e){this.move(e)},rangeEnd(e){this.end(e)},rangeClear(e){this.clear(e)},bubbleStart(e){this.bubbleStart(e)}},created(){this.state={key:this.settings.key||"brush-range"}},beforeRender(e){this.state.rect=e.size.computedInner},renderRanges(){this.state.started||(this.state.ranges=Zl(this.state,this.state.brushInstance),this.state.active=null,Jl(this.state))},render(e){const t=this.settings.settings;this.state.direction="vertical"===t.direction?0:1;const n=this.renderer.element().getBoundingClientRect(),i=this.state.rect[0===this.state.direction?"height":"width"];let r=Io(this.chart.scale(t.scale),i);const o=function(e){const t={targetRect:null,targetFillRect:null,scale:null,size:null},n=e.settings.settings,i=n.target&&(n.target.components||(n.target.component?[n.target.component]:[])).map((t=>e.chart.component(t))).filter((e=>!!e&&!!e.rect)),r=n.target&&n.target.selector?e.chart.findShapes(n.target.selector):[],o=n.target&&n.target.fillSelector?e.chart.findShapes(n.target.fillSelector):[];if(r.length>0){const i=tc(r);if(t.size=i[0===e.state.direction?"height":"width"],t.scale=Io(e.chart.scale(n.scale),t.size),t.targetRect=i,o.length>0){const e=tc(o);t.targetFillRect=e}}else if(i&&i.length>0){const n=i.slice(1).reduce(((e,t)=>({x0:Math.min(e.x0,t.rect.computedInner.x),y0:Math.min(e.y0,t.rect.computedInner.y),x1:Math.max(e.x1,t.rect.computedInner.x+t.rect.computedInner.width),y1:Math.max(e.y1,t.rect.computedInner.y+t.rect.computedInner.height)})),{x0:i[0].rect.computedInner.x,y0:i[0].rect.computedInner.y,x1:i[0].rect.computedInner.x+i[0].rect.computedInner.width,y1:i[0].rect.computedInner.y+i[0].rect.computedInner.height});t.targetRect={x:n.x0-e.state.rect.x,y:n.y0-e.state.rect.y,width:n.x1-n.x0,height:n.y1-n.y0}}return t}(this);if(r=o.scale?o.scale:r,this.state.targetRect=o.targetRect,this.state.targetFillRect=o.targetFillRect,this.state.size=null===o.size?i:o.size,this.state.settings=t,this.state.style=this.style,this.state.offset=n,this.state.brush="object"==typeof t.brush?t.brush.context:t.brush,this.state.brushInstance=this.chart.brush(this.state.brush),this.state.renderer=this.renderer,this.state.multi=!!t.multiple,this.state.h=e,this.state.onEditConfirmed=(e,t,n)=>{this.state.edit=null,function(e,t,n,i){let r=e.ranges.map((e=>({min:e.min,max:e.max})));const o=e.scale.min(),a=e.scale.max();r[t]={min:Math.max(o,Math.min(n,i)),max:Math.min(a,Math.max(n,i))},e.ranges[t]=p({},r[t]);const s=e.scale.data();s&&s.fields&&s.fields.forEach((t=>{e.fauxBrushInstance||e.brushInstance.setRange(t.id(),r)}))}(this.state,e,t,n),this.emit("bubbleEnd"),Jl(this.state)},this.state.onEditCanceled=()=>{this.state.edit=null,Jl(this.state)},this.state.cssCoord={offset:0===this.state.direction?"top":"left",coord:0===this.state.direction?"y":"x",pos:0===this.state.direction?"deltaY":"deltaX"},this.state.format="function"==typeof t.bubbles.label&&((e,n)=>t.bubbles.label.call(void 0,{datum:e,data:n,scale:r,resources:{scale:this.chart.scale,formatter:this.chart.formatter}})),{}.hasOwnProperty.call(r,"norm")){this.state.editable=!0,this.state.observeBrush="object"==typeof t.brush&&t.brush.observe,this.state.fauxBrushInstance=null,this.state.findValues=null,this.state.scale=r;const e=this.state.scale.data();!this.state.format&&e&&e.fields&&e.fields[0]&&(this.state.format=e.fields[0].formatter())}else this.state.editable=!1,this.state.scale=Pr(),this.state.scale.data=r.data,this.state.format||(this.state.format=(e,t)=>ec(r.range(),t)?function(e,t){const n=t.ticks(),i=t.domain().indexOf(Ql(e,t));return-1!==i?n[i].label:"-"}(e,r):"-"),this.state.fauxBrushInstance=_o(),this.state.findValues=e=>function(e,t){const n=t.domain(),i=t.range(),r=[];return e.forEach((e=>{if(!ec(i,[e.min,e.max]))return;const o=n.indexOf(Ql(e.min,t)),a=n.indexOf(Ql(e.max,t));r.push.apply(r,n.slice(Math.min(o,a),Math.max(o,a)+1))})),r}(e,r);return this.state.ranges=Zl(this.state,this.state.brushInstance),this.state.observeBrush||this.state.sourcedFromThisComponent?[Yl(this.state)]:[]},mounted(){this.state.observeBrush&&this.state.brushInstance&&this.state.brushInstance.on("update",this.renderRanges)},beforeDestroy(){this.state.observeBrush&&this.state.brushInstance&&this.state.brushInstance.removeListener("update",this.renderRanges)},start(e){!function(e){let{state:t,e:n,renderer:i,ranges:r,targetSize:o}=e;if(t.started)return;t.edit=null;const a=n.center.x-n.deltaX,s=n.center.y-n.deltaY;let l=document.elementFromPoint(a,s);i.element().contains(l)||(l=null);const c={started:!0};t.offset=u({},i.element().getBoundingClientRect());const h=a-t.offset.left,d=s-t.offset.top;t.offset.left+=t.targetRect?t.targetRect.x:0,t.offset.top+=t.targetRect?t.targetRect.y:0,t.ranges=r(t,t.fauxBrushInstance||t.brushInstance);const f=n.center[t.cssCoord.coord]-n[t.cssCoord.pos]-t.offset[t.cssCoord.offset],p=n.center[t.cssCoord.coord]-t.offset[t.cssCoord.offset];c.current=t.scale.normInvert(p/t.size),c.start=t.scale.normInvert(f/t.size);let g=t.ranges;const m=Kl(t);let y,v,x=-1;if(l&&l.hasAttribute("data-idx"))x=parseInt(l.getAttribute("data-idx"),10),m.min=x>0?g[x-1].max:m.min,m.max=x+1<g.length?g[x+1].min:m.max;else{for(y=0;y<g.length;y++){if(g[y].min<=c.start&&c.start<=g[y].max){x=y,m.min=y?g[y-1].max:m.min,m.max=y+1<g.length?g[y+1].min:m.max;break}if(c.start<g[y].min){m.max=g[y].min,m.min=y?g[y-1].max:m.min;break}}-1===x&&g.length&&y>=g.length&&(m.min=g[g.length-1].max)}if(-1!==x||t.multi||(c.ranges=[],m.min=t.scale.min(),m.max=t.scale.max()),-1!==x)if(v={idx:x,start:g[x].min,end:g[x].max,limitLow:m.min,limitHigh:m.max,mode:"move"},l&&l.hasAttribute("data-other-value"))c.start=parseFloat(l.getAttribute("data-other-value")),v.mode="modify";else{let e=t.scale.norm(v.start)*t.size,n=t.scale.norm(v.end)*t.size;Math.abs(f-e)<=o?(c.start=v.end,v.mode="modify"):Math.abs(f-n)<=o&&(c.start=v.start,v.mode="modify")}else v={idx:-1,start:c.start,end:c.current,limitLow:m.min,limitHigh:m.max,mode:"current"};c.active=v,"modify"!==v.mode&&t.targetRect&&!Oa(t.targetRect,{x:h,y:d})||Object.keys(c).forEach((e=>t[e]=c[e]))}({e:e,state:this.state,renderer:this.renderer,ranges:Zl,targetSize:5})},end(){this.state.started&&(!function(e,t){e.started=!1,e.ranges=t(e,e.fauxBrushInstance||e.brushInstance);const n=Kl(e);Gl(e,e.current,n)}(this.state,Zl),Jl(this.state),this.state.sourcedFromThisComponent=!0,this.state.active=null)},move(e){this.state.started&&(!function(e,t){const n=(t.center[e.cssCoord.coord]-e.offset[e.cssCoord.offset])/e.size,i=e.scale.normInvert(n);e.current=Math.max(Math.min(i,e.active.limitHigh),e.active.limitLow)}(this.state,e),function(e){let t=e.ranges.map((e=>({min:e.min,max:e.max})));if(-1!==e.active.idx)if("modify"===e.active.mode)t[e.active.idx].min=Math.min(e.start,e.current),t[e.active.idx].max=Math.max(e.start,e.current);else{const n=Ul(e);t[e.active.idx].min+=n,t[e.active.idx].max+=n}else t.push({min:Math.min(e.start,e.current),max:Math.max(e.start,e.current)});const n=e.scale.data();n&&n.fields&&n.fields.forEach((n=>{if(e.fauxBrushInstance){let i=Zl(e,e.fauxBrushInstance),r=e.findValues(i),o=e.findValues(t),a=o.filter((e=>-1===r.indexOf(e))),s=r.filter((e=>-1===o.indexOf(e))),l=a.map((e=>({key:n.id(),value:e}))),c=s.map((e=>({key:n.id(),value:e})));e.brushInstance.addAndRemoveValues(l,c),e.fauxBrushInstance.setRange(n.id(),t)}else e.brushInstance.setRange(n.id(),t)}))}(this.state),Jl(this.state))},clear(){this.state.fauxBrushInstance&&this.state.fauxBrushInstance.clear(),this.state.renderer.render([]),this.state.started=!1,this.state.active=null,this.state.sourcedFromThisComponent=!1},bubbleStart(e){if(!this.state.editable)return;const t=e.srcEvent||e,n=t.target,i={rangeIdx:parseInt(n.getAttribute("data-idx"),10),bubbleIdx:parseInt(n.getAttribute("data-bidx"),10)};if(isNaN(i.rangeIdx)||JSON.stringify(i)===JSON.stringify(this.state.edit))return;this.state.edit=i,t.stopPropagation(),t.stopImmediatePropagation(),t.preventDefault();const r=n.parentNode;Jl(this.state);const o=r.querySelector("input");o.focus(),o.select()}};function ic(e){e.renderer.render(Yl(e))}function rc(e){return e.rc.ranges()}function oc(e,t){const n={x:e.direction?t.min+e.rect.x:e.rect.x,y:e.direction?e.rect.y:t.min+e.rect.y,width:e.direction?t.max-t.min:e.rect.width+e.rect.x,height:e.direction?e.rect.height+e.rect.y:t.max-t.min};return e.chart.shapesAt(n,e.settings.brush)}const ac={require:["chart","settings","renderer"],defaultSettings:{settings:{bubbles:{show:!0,align:"start"}},style:{bubble:"$label-overlay",line:"$shape-guide--inverted",target:"$selection-area-target"}},renderer:"dom",on:{areaStart(e){this.start(e)},areaMove(e){this.move(e)},areaEnd(e){this.end(e)},areaClear(e){this.clear(e)}},created(){this.state={key:this.settings.key||"brush-area-dir"}},render(e){this.state.rect=this.rect;const t=this.settings.settings,n="vertical"===t.direction?0:1,i=this.state.rect[0===n?"height":"width"],r=this.renderer.element().getBoundingClientRect(),o=(t.target?t.target.components||[t.target.component]:[]).map((e=>this.chart.component(e))).filter((e=>!!e&&!!e.rect)),a=o[0]?o.slice(1).reduce(((e,t)=>({x0:Math.min(e.x0,t.rect.x),y0:Math.min(e.y0,t.rect.y),x1:Math.max(e.x1,t.rect.x+t.rect.width),y1:Math.max(e.y1,t.rect.y+t.rect.height)})),{x0:o[0].rect.x,y0:o[0].rect.y,x1:o[0].rect.x+o[0].rect.width,y1:o[0].rect.y+o[0].rect.height}):null;return this.state.targetRect=a?{x:a.x0-this.rect.x,y:a.y0-this.rect.y,width:a.x1-a.x0,height:a.y1-a.y0}:null,this.state.style=this.style,this.state.chart=this.chart,this.state.direction=n,this.state.settings=t,this.state.offset=r,this.state.rc=uo(),this.state.renderer=this.renderer,this.state.multi=!!t.multiple,this.state.h=e,this.state.size=i,this.state.cssCoord={offset:0===this.state.direction?"top":"left",coord:0===this.state.direction?"y":"x",pos:0===this.state.direction?"deltaY":"deltaX",area:0===this.state.direction?"height":"width"},this.state.format=function(e,t){return function(e,t,n){const i=Math.min(...n),r=Math.max(...n),o={x:e.direction?i+e.rect.x:e.rect.x,y:e.direction?e.rect.y:i+e.rect.y,width:e.direction?r-i:e.rect.width+e.rect.x,height:e.direction?e.rect.height+e.rect.y:r-i},a=e.chart.shapesAt(o,e.settings.brush);if(0===a.length)return"-";const s=a.reduce(((n,r)=>{const o=n.bounds,a=r.bounds;return t===i?o[e.cssCoord.coord]<=a[e.cssCoord.coord]?n:r:o[e.cssCoord.coord]+o[e.cssCoord.area]>=a[e.cssCoord.coord]+a[e.cssCoord.area]?n:r})),l=e.settings.brush.components.reduce(((e,t)=>e.key===s.key?e:t));return"function"==typeof e.settings.bubbles.label?e.settings.bubbles.label(s.data):Array.isArray(l.data)&&l.data.length?s.data[l.data[0]].label:s.data&&s.data.label?s.data.label:"-"}(this,e,t)},[]},start(e){!function(e){let{state:t,e:n,renderer:i,ranges:r,targetSize:o}=e;if(t.started)return;const a=n.center.x-n.deltaX,s=n.center.y-n.deltaY;let l=document.elementFromPoint(a,s);i.element().contains(l)||(l=null);const c={started:!0};t.offset=i.element().getBoundingClientRect(),t.ranges=r(t);const u=a-t.offset.left,h=s-t.offset.top,d=n.center[t.cssCoord.coord]-n[t.cssCoord.pos]-t.offset[t.cssCoord.offset],f=n.center[t.cssCoord.coord]-t.offset[t.cssCoord.offset];let p=f,g=d;c.start=d,c.current=f;let m=t.ranges;const y=Xl(t);let v,x,b=-1;if(l&&l.hasAttribute("data-idx"))b=parseInt(l.getAttribute("data-idx"),10),y.min=b>0?m[b-1].max:y.min,y.max=b+1<m.length?m[b+1].min:y.max;else{for(v=0;v<m.length;v++){if(m[v].min<=g&&g<=m[v].max){b=v,y.min=v?m[v-1].max:y.min,y.max=v+1<m.length?m[v+1].min:y.max;break}if(g<m[v].min){y.max=m[v].min,y.min=v?m[v-1].max:y.min;break}}-1===b&&m.length&&v>=m.length&&(y.min=m[m.length-1].max)}if(-1!==b||t.multi||(c.ranges=[],y.min=0,y.max=t.direction?t.rect.width:t.rect.height),-1!==b)if(x={idx:b,start:m[b].min,end:m[b].max,limitLow:y.min,limitHigh:y.max,mode:"move"},l&&l.hasAttribute("data-other-value"))c.start=parseFloat(l.getAttribute("data-other-value")),x.mode="modify";else{let e=x.start,t=x.end;Math.abs(d-e)<=o?(c.start=x.end,x.mode="modify"):Math.abs(d-t)<=o&&(c.start=x.start,x.mode="modify")}else x={idx:-1,start:g,end:p,limitLow:y.min,limitHigh:y.max,mode:"current"};c.active=x,"modify"!==x.mode&&t.targetRect&&!Oa(t.targetRect,{x:u,y:h})||Object.keys(c).forEach((e=>t[e]=c[e]))}({e:e,state:this.state,renderer:this.renderer,ranges:rc,targetSize:5})},end(){this.state.started&&(!function(e,t){e.started=!1,e.ranges=t(e);const n=Xl(e);Gl(e,e.current,n)}(this.state,rc),ic(this.state))},move(e){this.state.started&&(!function(e,t){const n=t.center[e.cssCoord.coord]-e.offset[e.cssCoord.offset];e.current=Math.max(Math.min(n,e.active.limitHigh),e.active.limitLow)}(this.state,e),function(e){const t=e.ranges.map((e=>({min:e.min,max:e.max})));if(-1!==e.active.idx)if("modify"===e.active.mode)t[e.active.idx].min=Math.min(e.start,e.current),t[e.active.idx].max=Math.max(e.start,e.current);else{const n=Ul(e);t[e.active.idx].min=e.active.start+n,t[e.active.idx].max=e.active.end+n}else t.push({min:Math.min(e.start,e.current),max:Math.max(e.start,e.current)});e.rc.set(t);let n=[];t.forEach((t=>{n=[...n,...oc(e,t)]})),function(e,t){e.chart.brushFromShapes(t,e.settings.brush)}(e,n)}(this.state),ic(this.state))},clear(){this.state.rc&&this.state.rc.clear(),this.state.renderer.render([])}};function sc(e){const t="vertical"===e.direction,n=e.rect[t?"height":"width"],i=e.rect[t?"width":"height"];return function(e){const t=e.brush;if(!t||!t.isActive())return[];const n=e.scale.data(),i=(n&&n.fields||[]).map((e=>e.id())),r=t.brushes().filter((e=>"range"===e.type&&-1!==i.indexOf(e.id)))[0];return r?r.brush.ranges():[]}(e).map((r=>{const o=e.scale(r.min)*n,a=e.scale(r.max)*n,s=Math.min(o,a),l=Math.abs(o-a);return{type:"rect",fill:e.fill,opacity:e.opacity,x:t?0:s,width:t?i:l,y:t?s:0,height:t?l:i}}))}function lc(e,t,n,i){function r(){!function(e){e.renderer.render(sc(e))}(e)}function o(){!function(e){e.renderer.render(sc(e))}(e)}function a(){!function(e){e.renderer.render(sc(e))}(e)}e.brush=t,t&&(t.on("start",r),t.on("update",o),t.on("end",a),e.start=r,e.update=o,e.end=a,e.brush=t,e.scale=n,e.renderer=i)}function cc(e){e.brush&&(e.brush.removeListener("start",e.start),e.brush.removeListener("update",e.update),e.brush.removeListener("end",e.end)),e.start=void 0,e.update=void 0,e.end=void 0,e.brush=void 0,e.scale=void 0,e.renderer=void 0}const uc={require:["chart","settings","renderer"],defaultSettings:{settings:{}},preferredSize:()=>50,created(){this.state={}},render(){const e=this.settings.settings,t=this.chart.brush(e.brush),n=e.direction||"horizontal",i="horizontal"===n?this.rect.width:this.rect.height,r=Io(this.chart.scale(e.scale),i);return cc(this.state),lc(this.state,t,r,this.renderer),this.state.rect=this.rect,this.state.fill=e.fill||"#ccc",this.state.opacity=void 0!==e.opacity?e.opacity:1,this.state.direction=n,sc(this.state)},beforeDestroy(){cc(this.state)}};function hc(e,t){const n=t.center.x,i=t.center.y;return{x:n-e.left,y:i-e.top}}function dc(e,t,n){return ea(e,t.points[0])<n.settings.snapIndicator.threshold**2}function fc(e,t){null==e.path.d?e.path.d="M".concat(t.x," ").concat(t.y," "):e.path.d+="L".concat(t.x," ").concat(t.y," "),e.points.push(t)}function pc(e){let{state:t,start:n=null,end:i=null}=e;null!==n&&(t.snapIndicator.x1=n.x,t.snapIndicator.y1=n.y),null!==i&&(t.snapIndicator.x2=i.x,t.snapIndicator.y2=i.y)}function gc(e,t){e.snapIndicator.visible=t}const mc={require:["chart","renderer","settings"],defaultSettings:{layout:{displayOrder:0},settings:{brush:{components:[]},snapIndicator:{threshold:75,strokeDasharray:"5, 5",stroke:"black",strokeWidth:2,opacity:.5},lasso:{fill:"transparent",stroke:"black",strokeWidth:2,opacity:.7,strokeDasharray:"20, 10"},startPoint:{r:10,fill:"green",stroke:"black",strokeWidth:1,opacity:1}}},on:{lassoStart(e){this.start(e)},lassoEnd(e){this.end(e)},lassoMove(e){this.move(e)},lassoCancel(){this.cancel()}},created(){this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}}},start(e){var t;this.state.active=!0,this.state.path={visible:!0,type:"path",d:null,fill:(t=this.settings.settings.lasso).fill,stroke:t.stroke,strokeWidth:t.strokeWidth,opacity:t.opacity,strokeDasharray:t.strokeDasharray,collider:{type:null}},this.state.snapIndicator=function(e){return{visible:!1,type:"line",x1:0,y1:0,x2:0,y2:0,strokeDasharray:e.strokeDasharray,stroke:e.stroke,strokeWidth:e.strokeWidth,opacity:e.opacity,collider:{type:null}}}(this.settings.settings.snapIndicator),this.state.startPoint=function(e){return{visible:!0,type:"circle",cx:0,cy:0,r:e.r,fill:e.fill,opacity:e.opacity,stroke:e.stroke,strokeWidth:e.strokeWidth,collider:{type:null}}}(this.settings.settings.startPoint),this.state.rendererBounds=this.renderer.element().getBoundingClientRect(),this.state.componentDelta=function(e,t){const n=e.element.getBoundingClientRect();return{x:t.left-n.left,y:t.top-n.top}}(this.chart,this.state.rendererBounds),this.state.brushConfig=this.settings.settings.brush.components.map((e=>({key:e.key,contexts:e.contexts||["lassoBrush"],data:e.data||[""],action:e.action||"add"})));const n=hc(this.state.rendererBounds,e);fc(this.state,n),pc({state:this.state,start:n}),function(e,t){e.startPoint.cx=t.x,e.startPoint.cy=t.y}(this.state,n)},move(e){if(!this.state.active)return;const t=hc(this.state.rendererBounds,e);dc(t,this.state,this.settings)?gc(this.state,!0):gc(this.state,!1),fc(this.state,t),pc({state:this.state,end:t}),function(e,t){const n=[e.startPoint,e.path,e.snapIndicator].filter((e=>e.visible));t.render(n)}(this.state,this.renderer),function(e,t){if(e.active){const n=e.points[e.points.length-2],i=e.points[e.points.length-1];e.lineBrushShape.x1=n.x+e.componentDelta.x,e.lineBrushShape.y1=n.y+e.componentDelta.y,e.lineBrushShape.x2=i.x+e.componentDelta.x,e.lineBrushShape.y2=i.y+e.componentDelta.y;const r=t.shapesAt(e.lineBrushShape,{components:e.brushConfig});t.brushFromShapes(r,{components:e.brushConfig})}}(this.state,this.chart)},end(e){if(!this.state.active)return;gc(this.state,!1);dc(hc(this.state.rendererBounds,e),this.state,this.settings)&&function(e,t){if(e.active){const n=e.componentDelta.x,i=e.componentDelta.y,r=e.points.map((e=>({x:e.x+n,y:e.y+i}))),o=t.shapesAt({vertices:r},{components:e.brushConfig});t.brushFromShapes(o,{components:e.brushConfig})}}(this.state,this.chart),this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}},this.renderer.render([])},cancel(){var e,t;this.state.active&&(e=this.state,t=this.chart,e.brushConfig.forEach((e=>{e.contexts.forEach((e=>{t.brush(e).end()}))})),this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}},this.renderer.render([]))},render(){}};function yc(e,t,n,i,r){let o,a=0,s=t.length-1;for(;a<s;){let l=Math.floor((a+s)/2);o=r(t[l]),o[n]+o[i]<e[n]?a=l+1:s=l}return a}function vc(e){let{orientation:t,targetNodes:n,labels:i,container:r}=e,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:yc;const a=[],s="v"===t?"x":"y",l="v"===t?"width":"height",c=e=>e.textBounds,u=e=>e.node.localBounds;return(e,t)=>{const{textBounds:h,node:d}=i[t];if(h[s]<r[s]||h[s]+h[l]>r[s]+r[l])return!1;for(let e=o(h,a,s,l,c);e<a.length;e++)if(qa(h,a[e].textBounds))return!1;const f=o(h,n,s,l,u),p=h[s]+h[l];for(let e=f;e<n.length;e++){const t=n[e].node;if(p<t.localBounds[s])break;if(qa(h,t.localBounds)&&d!==t)return!1}return a.push(i[t]),!0}}const xc=4;function bc(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function wc(e){const t=typeof e;return("string"===t||"number"===t)&&""!==e}function kc(e){return p(p({type:"rect",rx:2,ry:2,fill:e.backgroundColor},e.backgroundBounds),{},{data:"".concat(e.data," ").concat(e.text),rotation:e.transform&&e.transform.match(/rotate/gi)?"rotated":"horizontal"})}function _c(e,t,n){return n?e.width>=t.height:e.width>=t.width}function Mc(e,t,n){return n?e.height>=t.width:e.height>=t.height}function Sc(e,t,n,i,r){let o,a;return"v"===e?(o=i||r||_c(t,n,!0),a=Mc(t,n,!i)):(o=_c(t,n),a=r||Mc(t,n,!1)),o&&a}function Rc(e,t,n,i){return e+.5*t+(i-.5)*(t-n)-.5*n}function Cc(e,t,n){const i={type:"text",text:t,maxWidth:n.rotate?e.height:e.width,x:0,y:e.y,dx:0,dy:0,fill:n.fill,anchor:n.rotate?"end":"start",baseline:"central",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily},r=n.textMetrics;if(!n.overflow&&!function(e,t,n){return _c(e,t,n.rotate)&&Mc(e,t,n.rotate)}(e,r,n))return!1;const o=.5*r.height;return n.rotate?(i.x=Rc(e.x,e.width,r.height,n.align)+o,i.y=Rc(e.y,e.height,r.width,n.justify),"right"===n.dock?i.transform="rotate(90, ".concat(i.x+i.dx,", ").concat(i.y+i.dy,") translate(").concat(r.width,", 0)"):i.transform="rotate(-90, ".concat(i.x+i.dx,", ").concat(i.y+i.dy,")")):(i.x=Rc(e.x,e.width,r.width,n.align),i.y=Rc(e.y,e.height,r.height,n.justify)+o),i}function Nc(e){let{bar:t,view:n,direction:i,position:r,padding:o=xc,measured:a}=e;const s={};if(u(s,t),r&&"inside"!==r)if("up"===i||"down"===i){const e=Math.max(0,Math.min(t.y,n.height)),o=Math.max(0,Math.min(t.y+t.height,n.height));"outside"===r&&"up"===i||"opposite"===r&&"down"===i?(s.y=0,s.height=e):("outside"===r&&"down"===i||"opposite"===r&&"up"===i)&&(s.y=o,s.height=n.height-o)}else{const e=Math.max(0,Math.min(t.x,n.width)),o=Math.max(0,Math.min(t.x+t.width,n.width));"outside"===r&&"left"===i||"opposite"===r&&"right"===i?(s.x=0,s.width=e):("outside"===r&&"right"===i||"opposite"===r&&"left"===i)&&(s.x=o,s.width=n.width-o)}else;return function(e,t){const n=Math.max(0,Math.min(e.y,t.height)),i=Math.max(0,Math.min(e.y+e.height,t.height)),r=Math.max(0,Math.min(e.x,t.width)),o=Math.max(0,Math.min(e.x+e.width,t.width));e.x=r,e.width=o-r,e.y=n,e.height=i-n}(s,n),function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{top:i=xc,bottom:r=xc,left:o=xc,right:a=xc}=n,s="function"==typeof o?o(t):o,l="function"==typeof a?a(t):a,c="function"==typeof i?i(t):i,u="function"==typeof r?r(t):r;e.x+=s,e.width-=s+l,e.y+=c,e.height-=c+u}(s,a,o),s}function Dc(e){let t,n,i,r,o,{direction:a,fitsHorizontally:s,measured:l,node:c,orientation:u,placementSettings:h,rect:d}=e,f=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Nc;const p=[],g="h"===u?"width":"height";for(o=0;o<h.length;o++)if(i=h[o],r=f({bar:c.localBounds,view:d,direction:a,position:i.position,padding:i.padding,measured:l}),p.push(r),t=!o||r[g]>t[g]?r:t,Sc(u,r,l,s,i.overflow)){n=r;break}return n||(n=t,o=p.indexOf(n)),i=h[o],{bounds:n,placement:i}}function qc(e,t,n,i){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};const{top:o=xc,bottom:a=xc,left:s=xc,right:l=xc}=r,c="function"==typeof s?s(t):s,u="function"==typeof l?l(t):l,h="function"==typeof o?o(t):o,d="function"==typeof a?a(t):a,f=e.x+e.dx,p=e.y+e.dy,g=n?Math.min(t.width,i.height):Math.min(t.height,i.width),m=n?Math.min(t.height,i.height):Math.min(t.width,i.width),y=.5*t.height,v=1e-9;return{x:(n?f-y:f)-c-v,y:(n?p:p-y)-h-v,width:m+(c+u)-v,height:g+(h+d)-v}}function Ec(e){let{chart:t,targetNodes:n,rect:i,fitsHorizontally:r,collectiveOrientation:o}=e,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Dc,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Cc,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:vc;const c=[],u={container:i,targetNodes:n,labels:[],orientation:o};let h,d,f,g,m,y,v,x,b,w,k,_,M,S;for(let e=0,l=n.length;e<l;e++){y=null,d=n[e],f=d.node,M=bc(f,t),b=d.direction,S="left"===b||"right"===b?"h":"v";for(let t=0;t<d.texts.length;t++){if(g=d.texts[t],!wc(g))continue;w=d.labelSettings[t],x=d.measurements[t],_=w.placements;const n=a({direction:b,fitsHorizontally:r,lblStngs:w,measured:x,node:f,orientation:S,placements:_,placementSettings:d.placementSettings[t],rect:i});if(y=n.bounds,k=n.placement,y&&k){var R;m=k.justify;const t="function"==typeof w.linkData?w.linkData(M,e):void 0,n="function"==typeof k.overflow?k.overflow(M,e):k.overflow;"up"===b&&(m=1-m),"opposite"===k.position&&(m=1-m),"left"===b&&(m=1-m);const i=!("h"===o||r);if(h=s(y,g,{justify:"h"===S?k.align:m,align:"h"===S?m:k.align,fontSize:w.fontSize,fontFamily:w.fontFamily,textMetrics:x,rotate:i,overflow:!!n,dock:null!==(R=w.dock)&&void 0!==R?R:"left"}),h){const n=qc(h,x,i,y,k.padding);v="function"==typeof k.fill?k.fill(p(p({},M),{},{textBounds:n}),e):k.fill,h.fill=v,void 0!==t&&(h.data=t),"object"==typeof k.background&&(h.backgroundColor="function"==typeof k.background.fill?k.background.fill(p(p({},M),{},{textBounds:n}),e):k.background.fill,void 0!==h.backgroundColor&&(h.backgroundBounds=qc(h,x,i,y,k.background.padding))),c.push(h),u.labels.push({node:f,textBounds:n})}}}}const C=c.filter(l(u));return[...C.filter((e=>void 0!==e.backgroundBounds)).map(kc),...C]}function Oc(e){const t=2*Math.PI;return(e%t+t)%t}function zc(e,t){e.x+=t,e.width-=2*t,e.y+=t,e.height-=2*t}function Ac(e){return{x:e.x,y:e.y-e.height/2,width:e.width,height:e.height}}function Tc(e,t,n){let{x:i,y:r}=t;if(i*i+r*r>e*e)return null;let o=Math.sin(n),a=Math.cos(n),s=i*a-r*o,l=e*e-s*s;if(l<0)return null;let c=Math.sqrt(l);return{x:s*a+o*c,y:-s*o+a*c}}function Ic(e){let t,n,{radius:i,size:r,angle:o}=e,{width:a,height:s}=r,l={x:a/2,y:s/2};switch(Math.floor(o/(Math.PI/2))){case 0:if(t=Tc(i,l,o),!t)return null;t.y*=-1,n={x:-a,y:0};break;case 1:if(t=Tc(i,l,Math.PI-o),!t)return null;n={x:-a,y:-s};break;case 2:if(t=Tc(i,l,o-Math.PI),!t)return null;t.x*=-1,n={x:0,y:-s};break;case 3:if(t=Tc(i,l,2*Math.PI-o),!t)return null;t.x*=-1,t.y*=-1,n={x:0,y:0};break;default:throw new Error("invalid angle")}return{x:t.x+n.x,y:t.y+n.y,width:a,height:s}}function jc(e){let{slice:t,measured:n,padding:i}=e,{start:r,end:o,innerRadius:a,outerRadius:s}=t,l=s-a-2*i,c=o-r;if(c<Math.PI){let e=(n.height/2+i)/Math.tan(c/2);e>a&&(l=s-e-2*i)}if(l<0||l<n.minReqWidth)return null;const u=Oc((r+o)/2);let h=s-i,d={x:Math.sin(u)*h,y:-Math.cos(u)*h,width:l,height:n.height};return u<Math.PI?(d.angle=u-Math.PI/2,d.anchor="end"):(d.angle=u+Math.PI/2,d.anchor="start"),d}function Pc(e){let{context:t,node:n,bounds:i}=e;let{start:r,end:o}=n.desc.slice;const a=Oc((r+o)/2);switch(Math.floor(a/(Math.PI/2))){case 0:t.q1maxY=i.y-2,void 0===t.q2minY&&(t.q2minY=i.y+i.height+2);break;case 1:t.q2minY=i.y+i.height+2;break;case 2:t.q3minY=i.y+i.height+2;break;case 3:t.q4maxY=i.y-2,void 0===t.q3minY&&(t.q3minY=i.y+i.height+2)}}function Fc(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function Lc(e,t,n){const i={type:"text",text:t,maxWidth:e.width,x:e.x,y:e.y+("top"===e.baseline?e.height/2:0),fill:n.fill,anchor:e.anchor||"start",baseline:"middle",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily};if(!isNaN(e.angle)){let t=e.angle*(360/(2*Math.PI));i.transform="rotate(".concat(t,", ").concat(i.x,", ").concat(i.y,")")}return i}function $c(e){let t,n,{slice:i,direction:r,position:o,padding:a,measured:s,view:l,context:c,store:u}=e,{start:h,end:d,innerRadius:f,offset:p}=i;switch(o){case"into":t="rotate"===r?jc({slice:i,measured:s,padding:a}):function(e){let{slice:t,padding:n,measured:i}=e,{start:r,end:o,innerRadius:a,outerRadius:s}=t;const l=Oc((r+o)/2);let c=Ic({radius:s,size:{width:i.width+2*n+1,height:i.height+2*n},angle:l});return c?(c.baseline="top",za(c,{x1:0,y1:0,x2:Math.sin(r)*s,y2:-Math.cos(r)*s})||za(c,{x1:0,y1:0,x2:Math.sin(o)*s,y2:-Math.cos(o)*s})||Ma({cx:0,cy:0,r:a},c)?null:(zc(c,n),c)):null}({slice:i,measured:s,padding:a});break;case"inside":n={start:h,end:d,innerRadius:0,outerRadius:f},t="rotate"===r?jc({slice:n,measured:s,padding:a}):function(e){let{slice:t,padding:n,measured:i,store:r}=e;const{start:o,end:a,outerRadius:s}=t,l=Oc((o+a)/2);let c=Ic({radius:s,size:{width:i.width+2*n+1,height:i.height+2*n},angle:l});return c?(c.baseline="top",zc(c,n),r.insideLabelBounds.some((e=>qa(e,c)))?null:(r.insideLabelBounds.push({x:c.x-4,y:c.y,width:c.width+8,height:c.height}),c)):null}({slice:n,measured:s,padding:a,store:u});break;case"outside":t="rotate"===r?function(e){let{slice:t,measured:n,padding:i,view:r}=e,{start:o,end:a,outerRadius:s,offset:l}=t,c=s+i,u=a-o;if(u<Math.PI&&(n.height/2+i)/Math.tan(u/2)>c)return null;const h=Oc((o+a)/2);let d=Math.sin(h)*c,f=-Math.cos(h)*c,p=n.width+1,g=h%Math.PI;if(g>Math.PI/2&&(g=Math.PI-g),Math.cos(g)>.001){let e=f<0?r.y:r.y+r.height,t=Math.abs(e-l.y)/Math.cos(g)-Math.tan(g)*(n.height/2)-2*i-s;t<p&&(p=t)}if(Math.sin(g)>.001){let e=d<0?r.x:r.x+r.width,t=Math.abs(e-l.x)/Math.sin(g)-n.height/2/Math.tan(g)-2*i-s;t<p&&(p=t)}if(p<=0||p<n.minReqWidth)return null;let m={x:d,y:f,width:p,height:n.height};return h<Math.PI?(m.angle=h-Math.PI/2,m.anchor="start"):(m.angle=h+Math.PI/2,m.anchor="end"),m}({slice:i,measured:s,padding:a,view:l}):function(e){let{slice:t,measured:n,padding:i,view:r,context:o}=e,{start:a,end:s,outerRadius:l,offset:c}=t;const u=Oc((a+s)/2);if(function(e,t,n){switch(t){case 0:return e.q1maxY<0;case 1:return e.q2minY>n.height;case 2:return e.q3minY>n.height;case 3:return e.q4maxY<0;default:return!0}}(o,Math.floor(u/(Math.PI/2)),r))return null;let h=l+i+n.height/2,d=Math.sin(u)*h,f=-Math.cos(u)*h,p=n.width+1;if(u<Math.PI){let e=Math.abs(r.x+r.width-(d+c.x));e<p&&(p=e)}else{let e=Math.abs(r.x-(d+c.x));e<p&&(p=e)}if(p<n.minReqWidth)return null;let g={x:d,y:f,width:p,height:n.height};return u<Math.PI?g.anchor="start":g.anchor="end",g}({slice:i,measured:s,padding:a,view:l,context:c});break;default:throw new Error("not implemented")}return t&&(t.x+=p.x,t.y+=p.y,"outside"===o&&"rotate"!==r&&function(e,t,n){const{start:i,end:r,offset:o,outerRadius:a}=n,s=Oc((i+r)/2);switch(Math.floor(s/(Math.PI/2))){case 0:if(void 0!==t.q1maxY){let n=Math.min(e.y,t.q1maxY-e.height),i=e.y-n;if(e.y=n,i>1){let t=a+2;e.line={type:"line",x1:e.x-2,y1:e.y+2,x2:o.x+Math.sin(s)*t,y2:o.y-Math.cos(s)*t,strokeWidth:1}}}break;case 1:if(void 0!==t.q2minY){let n=Math.max(e.y,t.q2minY),i=n-e.y;if(e.y=n,i>1){let t=a+2;e.line={type:"line",x1:e.x-2,y1:e.y-2,x2:o.x+Math.sin(s)*t,y2:o.y-Math.cos(s)*t,strokeWidth:1}}}break;case 2:if(void 0!==t.q3minY){let n=Math.max(e.y,t.q3minY),i=n-e.y;if(e.y=n,i>1){let t=a+2;e.line={type:"line",x1:e.x+2,y1:e.y-2,x2:o.x+Math.sin(s)*t,y2:o.y-Math.cos(s)*t,strokeWidth:1}}}break;case 3:if(void 0!==t.q4maxY){let n=Math.min(e.y,t.q4maxY-e.height),i=e.y-n;if(e.y=n,i>1){let t=a+2;e.line={type:"line",x1:e.x+2,y1:e.y+2,x2:o.x+Math.sin(s)*t,y2:o.y-Math.cos(s)*t,strokeWidth:1}}}}}(t,c,i)),t}function Bc(e){let{context:t,direction:n,measured:i,node:r,placementSettings:o,rect:a,store:s}=e,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:$c;for(let e=0;e<o.length;e++){let c=o[e],u=l({context:t,slice:r.desc.slice,view:a,direction:n,position:c.position,measured:i,padding:c.padding,store:s});if(u)return{bounds:u,placement:c}}return{bounds:null,placement:null}}function Hc(e,t,n){const i=t.fontFamily,r="".concat(t.fontSize,"px"),o=n.measureText({text:e,fontFamily:i,fontSize:r});return o.minReqWidth=Math.min(o.width,n.measureText({text:"".concat(e[0],"…"),fontFamily:i,fontSize:r}).width),o}const Wc=/\n+|\r+|\r\n/,Vc=/\s/,Uc=/[a-zA-Z\u00C0-\u00F6\u00F8-\u00FF\u00AD]/;function Yc(e){return"string"==typeof e?-1!==e.search(Wc):-1!==String(e).search(Wc)}function Kc(e){return-1!==e.search(Vc)}function Xc(e){return-1!==e.search(Uc)}function Gc(e,t,n){return Math.max(t,Math.min(n,e))}function Jc(){let{string:e,separator:t="",reverse:n=!1,measureText:i=e=>({width:e.length,height:1}),mandatoryBreakIdentifiers:r=[Yc],noBreakAllowedIdentifiers:o=[],suppressIdentifier:a=[Kc,Yc,e=>""===e],hyphenationIdentifiers:s=[Xc]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const l=String(e).split(t);!function(e){""===e[0]&&e.shift(),""===e[e.length-1]&&e.pop()}(l);const c=l.length,u=n?e=>e>=0:e=>e<c;let h=n?c:-1;function d(e){const t=Gc(e,0,c-1),n=l[t],u=i(n),h=function(e,t,n,i,r){return i.some((i=>i(e,t,n)))?1:r.some((i=>i(e,t,n)))?0:2}(n,t,l,r,o);return{index:t,value:n,breakOpportunity:h,suppress:a.some((e=>e(n,t,l))),hyphenation:s.some((e=>e(n,t,l))),width:u.width,height:u.height,done:!1}}return{next:function(e){return isNaN(e)?n?h--:h++:h=Gc(e,0,c-1),u(h)?d(h):{done:!0}},peek:d,length:c}}const Zc="…",Qc=/^\s*\d+(\.\d+)?px\s*$/i;function eu(e){return"string"===typeof e&&Qc.test(e)}function tu(e){const t=e["font-size"]||e.fontSize;return eu(t)?parseFloat(t)*Math.max(isNaN(e.lineHeight)?1.2:e.lineHeight,0):19.2}function nu(e){const t=e.maxHeight,n=Math.max(e.maxLines,1)||1/0;if(isNaN(t))return n;const i=tu(e);return Math.max(1,Math.min(Math.floor(t/i),n))}function iu(e,t){return{lines:[],line:"",width:0,maxLines:nu(e),maxWidth:e.maxWidth,hyphens:{enabled:"auto"===e.hyphens,char:"‐",metrics:t("‐")}}}function ru(e){e.lines.push(e.line),e.line="",e.width=0}function ou(e,t){e.line+=t.value,e.width+=t.width}function au(e,t,n){if(t.width>e.maxWidth)return t;const i=t.index;for(let r=1;r<5;r++){const o=n.peek(t.index-1);if(!t.hyphenation||!o.hyphenation||0===t.index)return t;if(e.width+e.hyphens.metrics.width<=e.maxWidth)return e.line+=e.hyphens.char,t;if(1===e.line.length)return t;t=n.next(i-r),e.line=e.line.slice(0,-1),e.width-=t.width}return t}function su(e,t,n){const i=Jc({string:t.value,measureText:n});for(;e.lines.length<e.maxLines;){let t=i.next();if(t.done)break;e.width+t.width>e.maxWidth&&2===t.breakOpportunity&&e.line.length>0?(t=e.hyphens.enabled?au(e,t,i):t,ru(e),ou(e,t)):ou(e,t)}}function lu(e,t){const n=Jc({string:e.text,separator:"",measureText:t,noBreakAllowedIdentifiers:[(e,t)=>0===t]}),i=iu(e,t);let r=!0;for(;i.lines.length<i.maxLines;){let e=n.next();if(e.done){ru(i),r=!1;break}1===e.breakOpportunity?ru(i):i.width+e.width>i.maxWidth&&2===e.breakOpportunity?e.suppress?i.width+=e.width:(e=i.hyphens.enabled?au(i,e,n):e,ru(i),ou(i,e)):ou(i,e)}return{lines:i.lines,reduced:r}}function cu(e,t){const n=Jc({string:e.text,separator:/(\s|-|\u2010)/,measureText:t}),i=iu(e,t);let r=!0;for(;i.lines.length<i.maxLines;){let e=n.next();if(e.done){ru(i),r=!1;break}1===e.breakOpportunity?ru(i):i.width+e.width>i.maxWidth&&2===e.breakOpportunity?e.suppress?ru(i):e.width>i.maxWidth?su(i,e,t):(ru(i),ou(i,e)):ou(i,e)}return{lines:i.lines,reduced:r}}function uu(e){return{"break-all":lu,"break-word":cu}[e.wordBreak]}function hu(e){return t=>{const n=t.node;if(function(e){return"text"===e.type&&!e._lineBreak}(n)){const i=uu(n);if(!i)return;const r=e(n);if(r.width>n.maxWidth||Yc(n.text)){const o=(tu(n)-r.height)/2,a=i(n,function(e,t){return n=>t({text:n,fontSize:e.fontSize,fontFamily:e.fontFamily})}(n,e));t.node=function(e,t,n,i){const r={type:"container",children:[]};void 0!==t.id&&(r.id=t.id);let o=0;return e.lines.forEach(((a,s)=>{const l=u({},t);l.text=a,l._lineBreak=!0,o+=n,e.reduced&&s===e.lines.length-1?l.text+=Zc:delete l.maxWidth,l.dy=isNaN(l.dy)?o:l.dy+o,o+=i,o+=n,r.children.push(l)})),r}(a,n,o,r.height)}}}}function du(e,t){const n=e["font-family"]||e.fontFamily,i=e["font-size"]||e.fontSize,r="string"==typeof e.text?e.text:"".concat(e.text),{maxWidth:o}=e;if(void 0===o)return r;let a=t({text:r,fontSize:i,fontFamily:n}).width;if(a<=o)return r;let s=0,l=r.length-1;for(;s<=l;){let e=Math.floor((s+l)/2);a=t({text:r.substr(0,e)+Zc,fontSize:i,fontFamily:n}).width,a<=o?s=e+1:l=e-1}return r.substr(0,l)+Zc}function fu(e){const t=e.baseline||e["dominant-baseline"];let n=0;const i=parseInt(e.fontSize||e["font-size"],10)||0;switch(t){case"hanging":n=.75*i;break;case"text-before-edge":n=.85*i;break;case"middle":n=.25*i;break;case"central":n=.35*i;break;case"mathemetical":n=i/2;break;case"text-after-edge":case"ideographic":n=.2*-i;break;default:n=0}return n}const pu={},gu={},mu={fontSize:void 0,fontFamily:void 0};let yu;function vu(e,t){return!e&&!t||e===t}function xu(e){let{text:t,fontWeight:n,fontSize:i,fontFamily:r}=e;const o="".concat(t," ").concat(n," ").concat(i," ").concat(r);return"number"!=typeof gu[o]&&(yu=yu||document.createElement("canvas").getContext("2d"),function(e){let{fontWeight:t,fontSize:n,fontFamily:i}=e;vu(mu.fontWeight,t)&&vu(mu.fontSize,n)&&vu(mu.fontFamily,i)||(yu.font=[t,n,i].filter((e=>!!e)).join(" "),mu.fontWeight=t,mu.fontSize=n,mu.fontFamily=i)}({fontWeight:n,fontSize:i,fontFamily:r}),gu[o]=yu.measureText(t).width),gu[o]}function bu(e){return"number"!=typeof pu[e]&&(pu[e]=function(e){if(eu(e)){const t=parseFloat(e);return t+4*Math.ceil((t+1e-12)/24)}return 16}(e)),pu[e]}function wu(e){let{text:t,fontWeight:n,fontSize:i,fontFamily:r}=e;return{width:xu({text:t,fontWeight:n,fontSize:i,fontFamily:r}),height:bu(i)}}function ku(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:wu;const n=e["font-size"]||e.fontSize,i=e["font-family"]||e.fontFamily,r=t({text:e.text,fontFamily:i,fontSize:n}),o=Math.min(e.maxWidth||r.width,r.width),a=e.x||0,s=e.y||0,l=e.dx||0,c={x:0,y:s+((e.dy||0)+fu(e))-.75*r.height,width:o,height:r.height},u=e["text-anchor"]||e.anchor;return c.x="middle"===u?a+l-o/2:"end"===u?a+l-o:a+l,c}function _u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:wu;const n=uu(e),i=e["font-size"]||e.fontSize,r=e["font-family"]||e.fontFamily,o=t({text:e.text,fontFamily:r,fontSize:i});if(n&&(o.width>e.maxWidth||Yc(e.text))){const o=n(e,(e=>t({text:e,fontFamily:r,fontSize:i}))),a=u({},e);let s=0,l="";for(let e=0,n=o.lines.length;e<n;e++){let a=o.lines[e];a+=e===n-1&&o.reduced?Zc:"";const c=t({text:a,fontSize:i,fontFamily:r}).width;c>=s&&(s=c,l=a)}a.text=l;const c=ku(a,t);return c.height=tu(e)*o.lines.length,c}return ku(e,t)}function Mu(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function Su(e,t,n){const i={type:"text",text:t,maxWidth:e.width,x:0,y:e.y,dx:0,dy:0,fill:n.fill,anchor:"start",baseline:"alphabetical",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily},r=n.textMetrics;if(e.width<n.fontSize)return!1;const o=Math.max(0,e.width-r.width);return i.x=e.x+n.align*o,i.y=e.y+r.height/1.2,i}function Ru(e){let{cx:t,cy:n,r:i}=e;return{type:"circle",bounds:{cx:t,cy:n,r:i}}}function Cu(e){return e.desc&&e.desc.slice?function(e){let{start:t,end:n,innerRadius:i,outerRadius:r,offset:o}=e;if(Math.abs(t+2*Math.PI-n)>1e-12)return{type:null,bounds:null};let a=0!==i?i:r;return Ru({cx:o.x,cy:o.y,r:a})}(e.desc.slice):"circle"===e.type?Ru(e.attrs):"rect"===e.type?{type:"rect",bounds:e.bounds}:{type:null,bounds:null}}var Nu={bar:function(e){let{settings:t,chart:n,nodes:i,rect:r,renderer:o,style:a}=e,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ec;const l=u({fontSize:12,fontFamily:"Arial",align:.5,justify:0,fill:"#333"},a.label);l.fontSize=parseInt(l.fontSize,10);const c=t.labels.map((e=>u({},l,t,e))),h=t.labels.map((e=>e.placements.map((n=>u({},l,t,e,n))))),{fitsHorizontally:d,hasHorizontalDirection:f,targetNodes:p}=function(e){let{nodes:t,rect:n,chart:i,labelSettings:r,placementSettings:o,settings:a,renderer:s}=e;const l={},c=[];let u,h,d,f,p,g,m,y=!0,v=!1;for(let e=0;e<t.length;e++){if(h=t[e],f=h.localBounds,!qa(f,n))continue;let x=bc(h,i);u={node:h,texts:[],measurements:[],labelSettings:[],placementSettings:[]};for(let t=0;t<r.length;t++)g=r[t],d="function"==typeof g.label?g.label(x,e):void 0,wc(d)&&(m="function"==typeof a.direction?a.direction(x,e):a.direction||"up",v=v||"left"===m||"right"===m,l.fontFamily=g.fontFamily,l.fontSize="".concat(g.fontSize,"px"),l.text=d,p=s.measureText(l),u.measurements.push(p),u.texts.push(d),u.labelSettings.push(g),u.placementSettings.push(o[t]),u.direction=m,y=y&&p.width<=f.width-2*xc);c.push(u)}return{targetNodes:c,fitsHorizontally:y,hasHorizontalDirection:v}}({nodes:i,chart:n,renderer:o,settings:t,rect:r,labelSettings:c,placementSettings:h}),g=function(e){let{orientation:t="auto",defaultOrientation:n="h"}=e;switch(t.toLocaleLowerCase()){case"vertical":return"v";case"horizontal":return"h";default:return n}}({orientation:t.orientation,defaultOrientation:f?"h":"v"}),m="h"===g?"y":"x",y="h"===g?"height":"width";return p.sort(((e,t)=>e.node.localBounds[m]+e.node.localBounds[y]-(t.node.localBounds[m]+t.node.localBounds[y]))),s({chart:n,targetNodes:p,stngs:t,rect:r,fitsHorizontally:d,collectiveOrientation:g})},slice:function(e){let{settings:t,chart:n,nodes:i,rect:r,renderer:o,style:a}=e,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Bc,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Lc;const c=u({fontSize:12,fontFamily:"Arial",fill:"#333",padding:4,position:"into"},a.label);c.fontSize=parseInt(c.fontSize,10);const h=t.labels.map((e=>u({},c,t,e))),d=t.labels.map((e=>e.placements.map((n=>u({},c,t,e,n))))),f=[],p={insideLabelBounds:[]};i=function(e){const t=[],n=[],i=[],r=[];for(let o=0;o<e.length;++o){const{start:a,end:s}=e[o].desc.slice,l=Oc((a+s)/2);switch(Math.floor(l/(Math.PI/2))){case 0:t.push(e[o]);break;case 1:n.push(e[o]);break;case 2:i.push(e[o]);break;case 3:r.push(e[o])}}const o=(e,t)=>Oc((e.desc.slice.start+e.desc.slice.end)/2)-Oc((t.desc.slice.start+t.desc.slice.end)/2),a=(e,t)=>o(t,e);return t.sort(a),n.sort(o),i.sort(a),r.sort(o),t.concat(n,r,i)}(i);const g={};for(let e=0,t=i.length;e<t;e++){const t=i[e],a=Fc(t,n);for(let n=0;n<h.length;n++){const i=h[n],c="function"==typeof i.label?i.label(a,e):"";if(!c)continue;const u="function"==typeof i.direction?i.direction(a,e):i.direction||"horizontal",m="function"==typeof i.linkData?i.linkData(a,e):void 0,y=Hc(c,i,o),v=s({context:g,direction:u,lblStngs:i,measured:y,node:t,placementSettings:d[n],rect:r,store:p}),x=v.bounds,b=v.placement;if(x&&b){if("outside"===b.position&&"rotate"!==u){Pc({context:g,node:t,bounds:x});if(!ma(Ac(x),r))continue}const n="function"==typeof b.fill?b.fill(a,e):b.fill,o=l(x,c,{fill:n,fontSize:i.fontSize,fontFamily:i.fontFamily,textMetrics:y});o&&(void 0!==m&&(o.data=m),f.push(o),x.line&&(x.line.stroke=n,f.push(x.line)))}}}return f},rows:function(e){let{settings:t,chart:n,nodes:i,renderer:r,style:o}=e,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Su;const s=u({fontSize:12,fontFamily:"Arial",fill:"#333",padding:4,align:.5,justify:.5},o.label);s.fontSize=parseInt(s.fontSize,10);const l=u({},s,t),c=t.labels.map((e=>u({},l,e))),h={},d=[];for(let e=0,t=i.length;e<t;e++){let t=i[e],o=Mu(t,n),{type:s,bounds:u}=Cu(t);if(!u)continue;let f,p=0,g=[],m=[],y="circle"===s?2*u.r*.9:u.height;for(p+=l.padding,f=0;f<c.length;f++){let t=c[f],n="function"==typeof t.label?t.label(o,e):"";h.fontFamily=t.fontFamily,h.fontSize="".concat(t.fontSize,"px"),h.text=n;let i=r.measureText(h);if(p+=i.height+t.padding,p>y)break;m.push(n),g.push(i)}const v=f,x=Math.max(0,y-p);let b;for(b="circle"===s?u.cy-.9*u.r:u.y,b+=l.justify*x+l.padding,f=0;f<v;f++){let t,n=c[f];if("circle"===s){let e=Math.max(Math.abs(b-u.cy),Math.abs(b+g[f].height-u.cy)),n=Math.sqrt(u.r*u.r-e*e);t={x:u.cx-n+l.padding,y:b,width:2*n-2*l.padding,height:g[f].height}}else t={x:u.x+l.padding,y:b,width:u.width-2*l.padding,height:g[f].height};b+=g[f].height+l.padding;let i="function"==typeof n.fill?n.fill(o,e):n.fill;const h="function"==typeof n.linkData?n.linkData(o,e):void 0;let p=a(t,m[f],{fill:i,align:n.align,fontSize:n.fontSize,fontFamily:n.fontFamily,textMetrics:g[f]});if(p){if(p.text&&p.text!==Zc){const e=du(p,r.measureText);if(Zc===e)continue;p.ellipsed=e}void 0!==h&&(p.data=h),d.push(p)}}}return d}};const Du={require:["chart","renderer","settings"],defaultSettings:{settings:{},style:{label:"$label"}},render(){const e=this.settings.settings,t=[];return(e.sources||[]).forEach((e=>{e.strategy&&Nu[e.strategy.type]&&e.component&&t.push(...function(e,t){let{chart:n,source:i,rect:r,renderer:o,style:a}=e;if(!n.component(i.component))return[];const s=n.findShapes(i.selector).filter((e=>e.key===i.component));return t({chart:n,settings:i.strategy.settings,nodes:s,rect:{x:0,y:0,width:r.width,height:r.height},renderer:o,style:a})}({chart:this.chart,rect:this.rect,renderer:this.renderer,source:e,style:this.style},Nu[e.strategy.type]))})),t}};const qu={layout:{size:1,direction:"ltr",scrollOffset:0},item:{show:!0,label:{fontSize:"12px",fontFamily:"Arial",fill:"#595959",wordBreak:"none",maxLines:2,maxWidth:136,lineHeight:1.2},shape:{type:"square",size:12}},title:{show:!0,text:void 0,anchor:"start",fontSize:"16px",fontFamily:"Arial",fill:"#595959",wordBreak:"none",maxLines:2,maxWidth:156,lineHeight:1.25}};function Eu(e){let{x:t=0,y:n,item:i,globalMetrics:r,createSymbol:o,direction:a="ltr"}=e,s=i.label.displayObject,l=i.label.bounds,c=i.symbol.meta;const h="rtl"===a;let d={x:h?t+r.maxLabelBounds.width:t+r.maxSymbolSize+r.spacing,y:n,width:r.maxLabelBounds.width,height:Math.max(r.maxSymbolSize,r.maxLabelBounds.height)},f=function(e,t,n){const i=Math.max(0,e.width-t),r=Math.max(0,e.height-t);return{x:e.x+t/2+n.align*i,y:e.y+t/2+n.justify*r}}({x:h?t+r.maxLabelBounds.width+r.spacing:t,y:n,width:r.maxSymbolSize,height:d.height},c.size,{align:void 0===c.align?.5:c.align,justify:void 0===c.justify?.5:c.justify});const p=o(u({},c,f));return delete p.collider,s.anchor=h?"end":"start",function(e,t,n){const i=n.textMetrics;if(e.height<i.height)return!1;const r=Math.max(0,e.width-i.width);t.baseline="text-before-edge";const o=Math.max(0,e.height-i.height);t.x=e.x+n.align*r,t.y=e.y+n.justify*o+.175*parseInt(t.fontSize,10)}(d,s,{textMetrics:l,fontSize:parseInt(s.fontSize,10),align:0,justify:.5}),{item:{type:"container",data:i.label.displayObject.data,children:[p,s],collider:{type:"rect",x:t,y:n,width:r.maxItemBounds.width,height:r.maxItemBounds.height}},metrics:d}}function Ou(e,t){const n=e.items.length,i=Math.ceil(n/t),r="horizontal"===e.layout.orientation?"width":"height",o="width"===r?"horizontal":"vertical";return e.globalMetrics.maxItemBounds[r]*i+(i-1)*e.layout.margin[o]}function zu(e,t){let n,i,r,o,{onScroll:a=()=>{}}=t,s=null,l=0;const c={itemize:t=>{n=function(e,t){let n,i,{resolved:r,dock:o}=e,a=[],s=r.items.items,l=r.symbols.items,c=r.labels.items,h=0,d=0,f=0;for(let e=0;e<s.length;e++){if(!1===s[e].show)continue;const r=void 0!==c[e].text?c[e].text:c[e].data.label||"";n=u({},c[e],{type:"text",fontSize:"".concat(parseInt(c[e].fontSize,10),"px"),text:r,title:r}),i={symbol:{meta:l[e]},label:{displayObject:n,bounds:t.textBounds(n)}},a.push(i),h=Math.max(l[e].size,h),d=Math.max(i.label.bounds.width,d),f=Math.max(i.label.bounds.height,f)}return{items:a,globalMetrics:{spacing:8,maxSymbolSize:h,maxItemBounds:{height:Math.max(h,f),width:h+8+d},maxLabelBounds:{width:d,height:f}},layout:{margin:{vertical:void 0!==r.layout.item.vertical?r.layout.item.vertical:4,horizontal:void 0!==r.layout.item.horizontal?r.layout.item.horizontal:4},mode:r.layout.item.mode,size:r.layout.item.size,orientation:"top"===o||"bottom"===o?"horizontal":"vertical",direction:r.layout.item.direction,scrollOffset:r.layout.item.scrollOffset}}}(t,e.renderer),s=isNaN(n.layout.scrollOffset)?s:n.layout.scrollOffset},getItemsToRender:t=>{r=t.viewRect,l=c.getContentOverflow(r);const a=c.extent();s=Math.max(0,Math.min(s,l)),o=u({},r);const h="horizontal"===c.orientation()?"x":"y";return o[h]-=s,o["x"===h?"width":"height"]=a,function(e,t,n){let{viewRect:i}=e,{itemized:r,create:o=Eu,parallels:a,createSymbol:s}=n;const l=r.layout.direction,c=r.globalMetrics,u=r.items,h="horizontal"===r.layout.orientation;let d=0;const f=[],p=c.maxItemBounds.height,g=c.maxItemBounds.width,m=r.layout.margin.vertical+p,y=r.layout.margin.horizontal+g;let v=t.x,x=t.y,b=i.x-t.x;for(let e=0;e<u.length;e++){let n=o({y:x,x:"rtl"===l?i.x+b+i.width-g-(v-t.x):v,item:u[e],globalMetrics:c,direction:l,createSymbol:s});if((h&&v>=i.x-g||!h&&x>=i.y-p)&&f.push(n.item),d++,d>=a?(d=0,h?(v+=y,x=t.y):(x+=m,v=t.x)):h?x+=m:v+=y,!h&&x>i.y+i.height)break;if(h&&v>i.x+i.width)break}return f}(t,o,{itemized:n,parallels:i,createSymbol:e.symbol})},parallelize:(e,t)=>(i=function(e,t,n){const i=n.items.length,r="horizontal"===n.layout.orientation?"width":"height",o="width"===r?"horizontal":"vertical",a=n.globalMetrics.maxItemBounds[r]*i+(i-1)*n.layout.margin[o];let s=Math.ceil(a/e);if(null!=t){const e="horizontal"===n.layout.orientation?"height":"width",i="width"===e?"horizontal":"vertical",r=n.layout.margin[i]||4,o=Math.floor((t+r)/(r+n.globalMetrics.maxItemBounds[e]));s=Math.min(s,o)}const l=isNaN(n.layout.size)?1:n.layout.size;return Math.max(1,Math.min(s,l))}(e,t,n),i),hasContentOverflow:()=>{const e="horizontal"===n.layout.orientation?"width":"height";return Ou(n,i)>r[e]},getContentOverflow:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r;const t="horizontal"===n.layout.orientation?"width":"height";return Math.max(0,Ou(n,i)-e[t])},getNextSize:()=>{const e="horizontal"===n.layout.orientation?"width":"height",t="width"===e?"horizontal":"vertical";return n.globalMetrics.maxItemBounds[e]+n.layout.margin[t]},getPrevSize:()=>{const e="horizontal"===n.layout.orientation?"width":"height",t="width"===e?"horizontal":"vertical";return n.globalMetrics.maxItemBounds[e]+n.layout.margin[t]},hasNext:()=>"horizontal"===c.orientation()?r.x+r.width<o.x+o.width:r.y+r.height<o.y+o.height,hasPrev:()=>"horizontal"===c.orientation()?o.x<r.x:o.y<r.y,next:()=>{c.scroll(-c.getNextSize())},prev:()=>{c.scroll(c.getPrevSize())},scroll:e=>{const t=Math.max(0,Math.min(l,s-e));t!==s&&(s=t,a())},offset:()=>s,orientation:()=>n.layout.orientation,direction:()=>n.layout.direction,extent:()=>Ou(n,i),spread:()=>function(e,t){const n=t,i="horizontal"===e.layout.orientation?"height":"width",r="width"===i?"horizontal":"vertical";return e.globalMetrics.maxItemBounds[i]*n+(n-1)*e.layout.margin[r]}(n,i)};return c}function Au(e){return Object.keys(e).filter((t=>e[t])).join(" ")}const Tu={up:"▲",right:"▶",down:"▼",left:"◀"};function Iu(e,t){let{size:n,isActive:i,direction:r,nav:o,attrs:a}=t,s={},l="";const c=a;o&&o.button&&("function"==typeof o.button.class?s=o.button.class({direction:r}):o.button.class&&(s=o.button.class),"function"==typeof o.button.content&&(l=o.button.content(e,{direction:r})),void 0!==o.button.tabIndex&&(c.tabindex=o.button.tabIndex));const h={width:"".concat(n,"px"),minWidth:"".concat(n,"px"),height:"".concat(n,"px")};return Object.keys(s).length||(h.border="0",h.background="none"),(!i||o&&o.disabled)&&(c.disabled="disabled"),e("button",u({class:Au(s),style:h},c),[l||e("span",{style:{pointerEvents:"none"}},[Tu[r]])])}function ju(e){let t;const n={itemize:e=>{t=function(e){let{dock:t,navigation:n}=e;return{layout:{orientation:"top"===t||"bottom"===t?"vertical":"horizontal"},navigation:n}}(e)},render:i=>function(e,t,n,i){let{rect:r,itemRenderer:o}=t;if(!e||!e.renderArgs)return;e.size(r);const a=e.renderArgs[0],s="vertical"===n.layout.orientation,l="rtl"===o.direction(),c=o.hasNext(),u=o.hasPrev();if(!u&&!c)return void e.render([]);const h=s?["right","left"]:["down","up"];l&&s&&h.reverse();const d=[a("div",{style:{position:"relative",display:"flex","flex-direction":s?"column":"row","justify-content":"center",height:"100%",pointerEvents:"auto"},dir:l&&!s?"rtl":"ltr"},[Iu(a,{size:32,isActive:c,direction:h[0],attrs:{"data-action":"next","data-component-key":i.settings.key},nav:n.navigation}),Iu(a,{size:32,isActive:u,direction:h[1],attrs:{"data-action":"prev","data-component-key":i.settings.key},nav:n.navigation})])];e.render(d)}(n.renderer,i,t,e),extent:()=>32,spread:()=>64};return n}function Pu(e){let t;const n={itemize:n=>{t=function(e,t){let{resolved:n}=e;if(!1===n.title.item.show)return null;const i=u({},n.title.item,{type:"text"});if("rtl"===n.layout.item.direction&&(i.anchor&&"start"!==i.anchor?"end"===i.anchor&&(i.anchor="start"):i.anchor="end"),void 0===n.title.settings.text){const e=t.scale.data().fields;i.text=e&&e[0]?e[0].title():""}return{displayObject:i,bounds:t.renderer.textBounds(i)}}(n,e)},render:e=>{!function(e,t,n){let{rect:i}=e;if(!t)return;const r=[];if(t.size(i),n){const e={start:0,end:i.width,middle:i.width/2};r.push(u({},n.displayObject,{x:e[n.displayObject.anchor]||0,y:0,baseline:"text-before-edge",title:n.displayObject.text}))}t.render(r)}(e,n.renderer,t)},spread:()=>t?t.bounds.height:0,extent:()=>t?t.bounds.width:0};return n}function Fu(e,t,n,i){let r,o,a,{itemRenderer:s,navigationRenderer:l,titleRenderer:c,isPreliminary:h=!1}=i,d=0;const f={x:t.spacing,y:t.spacing,width:e.width-2*t.spacing,height:e.height-2*t.spacing};if(r={x:f.x,y:f.y,width:f.width,height:c.spread()},"horizontal"===n){r={x:f.x,y:f.y,width:c.extent(),height:c.spread()};const e=f.width-r.width-(r.width?t.spacing:0),n=f.height;s.parallelize(e,h?void 0:n);const i=s.extent()>e?l.extent():0,u=s.spread(),p=i?l.spread():0;o={x:r.x+r.width+(r.width?t.spacing:0),y:f.y+Math.max(0,(p-u)/2),width:f.width-i-r.width-(i?t.spacing:0)-(r.width?t.spacing:0),height:n},a={x:o.x+o.width+(i?t.spacing:0),y:f.y,width:i,height:f.height},r.y=o.y;"rtl"===s.direction()&&(a.x=f.x,o.x=a.x+a.width+(a.width?t.spacing:0),r.x=o.x+o.width+(r.width?t.spacing:0)),d=Math.max(r.height,p,s.spread())}else{const e=f.height-r.height-(r.height?t.spacing:0),n=f.width;s.parallelize(e,h?void 0:n);const i=s.extent()>e?l.extent():0;a={x:f.x,y:f.y+f.height-i,width:f.width,height:i},o={x:f.x,y:r.y+r.height+(r.height?t.spacing:0),width:f.width,height:f.height-r.height-(r.height?t.spacing:0)-a.height-(a.height?t.spacing:0)},d=Math.max(c.extent(),i?l.spread():0,s.spread())}return o=u({},e,{x:e.x+o.x,y:e.y+o.y,width:o.width,height:o.height}),a.x+=e.x,a.y+=e.y,r.x+=e.x,r.y+=e.y,{title:u({},e,r),content:u({},e,o),navigation:u({},e,a),orientation:n,preferredSize:d}}function Lu(e){e.state.resolved=function(e){const t=e.scale.domain();let n={items:[]};const i=e.settings.layout.dock;if("threshold-color"===e.scale.type){const r=e.scale.data().fields[0];let o=e=>String(e);e.settings.formatter?o=e.chart.formatter(e.settings.formatter):r&&(o=r.formatter());for(let e=0;e<t.length-1;e++){const i={value:t[e],label:"".concat(o(t[e])," - < ").concat(o(t[e+1]))};r&&(i.source={field:r.id()}),n.items.push(i)}"vertical"==("top"===i||"bottom"===i?"horizontal":"vertical")&&n.items.reverse()}else{const i=e.scale.labels?e.scale.labels():null;n.items=t.map(((t,n)=>{const r=e.scale.datum?u({},e.scale.datum(t)):{value:t};return r.value=t,e.scale.label?r.label=e.scale.label(t):i&&(r.label=i[n]),r}))}const r=e.resolver.resolve({data:{fields:e.scale.data().fields},defaults:u(!0,{},qu.title,e.style.title),settings:e.settings.settings.title}),o=e.resolver.resolve({data:{fields:e.scale.data().fields},defaults:qu.layout,settings:e.settings.settings.layout}),a=e.resolver.resolve({data:n,defaults:u(!0,{},qu.item.label,e.style.item.label),settings:(e.settings.settings.item||{}).label}),s=u(!0,{},(e.settings.settings.item||{}).shape);void 0===s.fill&&e.settings.scale&&(s.fill={scale:e.settings.scale});const l=e.resolver.resolve({data:n,defaults:u(!0,{},qu.item.shape,e.style.item.shape),settings:s}),c=e.resolver.resolve({data:n,defaults:u(!0,{},{show:qu.item.show}),settings:{show:(e.settings.settings.item||{}).show}});function h(e,n){let i=e.data.value,r=t[n+1];e.data.value=[i,r]}"threshold-color"===e.scale.type&&("vertical"==("top"===i||"bottom"===i?"horizontal":"vertical")?(c.items.reverse().forEach(h),c.items.reverse()):c.items.forEach(h));return{title:r,labels:a,symbols:l,items:c,layout:o}}(e),e.titleRenderer.itemize({resolved:e.state.resolved,dock:e.settings.layout.dock||"center"}),e.itemRenderer.itemize({resolved:e.state.resolved,dock:e.settings.layout.dock||"center"}),e.navigationRenderer.itemize({resolved:e.state.resolved,dock:e.settings.layout.dock||"center",navigation:e.settings.settings.navigation}),e.state.display={spacing:8}}function $u(e){const{rect:t,settings:n,state:i,itemRenderer:r,navigationRenderer:o,titleRenderer:a}=e,s=n.layout.dock,l="top"===s||"bottom"===s?"horizontal":"vertical",c=Fu(t,i.display,l,{itemRenderer:r,navigationRenderer:o,titleRenderer:a});e.renderer.size(c.content);let h=r.getItemsToRender({viewRect:u({},c.content,{x:0,y:0})});return o.render({rect:c.navigation,itemRenderer:r}),a.render({rect:c.title}),e.state.views={layout:c},h}const Bu={require:["chart","settings","renderer","update","resolver","registries","symbol"],defaultSettings:{settings:{},style:{item:{label:"$label",shape:"$shape"},title:"$title"}},mounted(e){e&&e.parentNode&&(this.navigationRenderer.renderer.appendTo(e.parentNode),this.titleRenderer.renderer.appendTo(e.parentNode),e.parentNode.insertBefore(this.navigationRenderer.renderer.element(),e),e.parentNode.insertBefore(this.titleRenderer.renderer.element(),e)),this.navigationRenderer.render({rect:this.state.views.layout.navigation,itemRenderer:this.itemRenderer}),this.titleRenderer.render({rect:this.state.views.layout.title})},beforeUnmount(){this.navigationRenderer.renderer.clear(),this.titleRenderer.renderer.clear()},on:{panstart(){if(this.state.interaction.started)return;this.itemRenderer.getContentOverflow()&&(this.state.interaction.started=!0,this.state.interaction.delta=0)},panmove(e){if(!this.state.interaction.started)return;const t="horizontal"===this.itemRenderer.orientation()?("rtl"===this.itemRenderer.direction()?-1:1)*e.deltaX:e.deltaY;this.itemRenderer.scroll(t-this.state.interaction.delta),this.state.interaction.delta=t},panend(){this.state.interaction.started=!1},scroll(e){this.itemRenderer.scroll(-e)},next(){this.itemRenderer.next()},prev(){this.itemRenderer.prev()}},created(){this.state={interaction:{}},this.onScroll=()=>{const e=$u(this);this.update(e)},this.itemRenderer=zu(this,{onScroll:this.onScroll}),this.navigationRenderer=ju(this),this.titleRenderer=Pu(this),this.navigationRenderer.renderer=this.registries.renderer("dom")(),this.titleRenderer.renderer=this.registries.renderer(this.settings.renderer)(),Lu(this)},preferredSize(e){return function(e,t){let n=0;const i=e.settings.layout.dock||"center",r="top"===i||"bottom"===i?"horizontal":"vertical",o=e.state.display,a=Fu(t.inner,o,r,{itemRenderer:e.itemRenderer,navigationRenderer:e.navigationRenderer,titleRenderer:e.titleRenderer,isPreliminary:!0});return n+=o.spacing,n+=a.preferredSize,n+=o.spacing,n}(this,e)},beforeUpdate(){Lu(this)},render(){return $u(this)},beforeDestroy(){this.navigationRenderer.renderer.destroy(),this.titleRenderer.renderer.destroy()},additionalElements(){return[this.titleRenderer.renderer.element(),this.navigationRenderer.renderer.element()]},_DO_NOT_USE_getInfo(){return{offset:this.itemRenderer.offset()}}};function Hu(e,t){let n=0;const i=e.state.isVertical?"justify":"align",r=e.state.isVertical?"y":"x",o=e.state.isVertical?"height":"width",a=e.state.isVertical?"requiredHeight":"requiredWidth";n=e.state.rect[o]-e.state.legend.length()-e.state.title[a](),n*=Math.min(1,Math.max(e.stgns[i],0)),t[r]+=n}function Wu(e,t,n){const i=n[e];return"object"==typeof i?-1!==i.valid.indexOf(t)?t:i.default:n.default}function Vu(e){return Wu(e.layout.dock,e.settings.title.anchor,{left:{valid:["top"],default:"top"},right:{valid:["top"],default:"top"},top:{valid:["left","right"],default:"left"},bottom:{valid:["left","right"],default:"left"},default:"top"})}function Uu(e,t){const n={x:0,y:0,width:0,height:0},i=e.stgns.padding;return n.x=i.left,n.y=i.top,n.width=t.width-i.left-i.right,n.height=t.height-i.top-i.bottom,n}function Yu(e){const t="top"!==e.settings.layout.dock&&"bottom"!==e.settings.layout.dock,n=e.stgns.title,i=e.chart.scale(e.stgns.fill),r=e.chart.scale(e.stgns.major),o=function(e,t){const n=t.domain();let i=n,r=e.stgns.tick.label;!r&&e.formatter?r=e.formatter:!r&&t.data().fields&&(r=t.data().fields[0].formatter()),"function"==typeof r&&(i=n.map(r).map(String));const o=n.map(((n,r)=>{const o=i[r];return{value:n,label:o,pos:t.norm(parseFloat(n,10)),textMetrics:e.renderer.measureText({text:o,fontSize:e.stgns.tick.fontSize,fontFamily:e.stgns.tick.fontFamily})}}));return o}(e,r),a=Wu((s=e.settings).layout.dock,s.settings.tick.anchor,{left:{valid:["left","right"],default:"left"},right:{valid:["left","right"],default:"right"},top:{valid:["top","bottom"],default:"top"},bottom:{valid:["top","bottom"],default:"bottom"},default:"right"});var s;if(void 0===n.text){const e=r.data().fields;n.text=e&&e[0]?e[0].title():""}const l=e.renderer.measureText({text:n.text,fontSize:n.fontSize,fontFamily:n.fontFamily}),c=e.renderer.textBounds({text:n.text,fontSize:n.fontSize,fontFamily:n.fontFamily,maxLines:n.maxLines,maxWidth:n.maxLengthPx,wordBreak:n.wordBreak,hyphens:n.hyphens,lineHeight:n.lineHeight}),u={isVertical:t,nodes:[],title:{anchor:Vu(e.settings),textMetrics:l,textBounds:c,requiredWidth:()=>{if(!n.show)return 0;let e=c.width,i=n.maxLengthPx;return t||(e+=n.padding,i+=n.padding),Math.min(e,i,u.rect.width)},requiredHeight:()=>{if(!n.show)return 0;let e=c.height;return t&&(e+=n.padding),Math.min(e,u.rect.height)}},ticks:{values:o,anchor:a,length:Math.min(Math.max(...o.map((e=>e.textMetrics.width))),e.stgns.tick.maxLengthPx),requiredHeight:()=>"top"===a?Math.max(...u.ticks.values.map((e=>e.textMetrics.height)))+e.stgns.tick.padding:0,height:Math.max(...o.map((e=>e.textMetrics.height)))},legend:{fillScale:i,majorScale:r,length:()=>{const n=t?"height":"width",i=t?"requiredHeight":"requiredWidth",r=Math.min(u.rect[n],u.rect[n]*e.stgns.length)-u.title[i]();return Math.max(0,Math.min(r,e.stgns.maxLengthPx))}}};return u}const Ku={require:["chart","settings","renderer"],defaultSettings:{layout:{displayOrder:0,dock:"right"},settings:{size:15,length:.5,maxLengthPx:250,align:.5,justify:0,padding:{left:5,right:5,top:5,bottom:5},tick:{label:null,fill:"#595959",fontSize:"12px",fontFamily:"Arial",maxLengthPx:100,anchor:null,padding:5},title:{show:!0,text:void 0,fill:"#595959",fontSize:"12px",fontFamily:"Arial",maxLengthPx:100,padding:5,maxLines:2,wordBreak:"none",lineHeight:1.2,hyphens:"auto",anchor:null}}},preferredSize(e){const t=this.state;t.rect=Uu(this,e.inner);let n=this.stgns.size;const i=t.isVertical?this.stgns.padding.left+this.stgns.padding.right:this.stgns.padding.top+this.stgns.padding.bottom;n+=i;const r=Math.max(e.inner.width,e.inner.height);if("left"===t.ticks.anchor||"right"===t.ticks.anchor){const e=t.ticks.values.reduce(((e,t)=>e+t.textMetrics.height),0);if(e>this.state.legend.length())return r;n+=t.ticks.length}else{if(t.ticks.length>this.state.legend.length())return r;n+=Math.max(...t.ticks.values.map((e=>e.textMetrics.height)))}return n+=this.stgns.tick.padding,this.stgns.title.show&&(n="left"===t.title.anchor||"right"===t.title.anchor?Math.max(t.title.textBounds.height+i,n):Math.max(n,t.title.requiredWidth()+i)),this.state.preferredSize=n,n},created(){this.stgns=this.settings.settings,this.state=Yu(this)},beforeUpdate(e){this.stgns=e.settings.settings,this.state=Yu(this)},beforeRender(e){if(this.state.nodes=[],this.state.rect=Uu(this,e.size),this.stgns.title.show){const e=function(e){const t=e.state,n=e.stgns,i="left"===t.ticks.anchor,r="top"===t.ticks.anchor;let o=t.rect.x,a=t.rect.y,s="start";"left"===t.title.anchor?(o+=t.title.requiredWidth()-n.title.padding,a+=t.title.textMetrics.height,a+=r?t.rect.height-t.title.textBounds.height:0,s="end"):"right"===t.title.anchor?(o+=t.legend.length(),o+=n.title.padding,a+=t.title.textMetrics.height,a+=r?t.rect.height-t.title.textBounds.height:0):"top"===t.title.anchor&&(o+=i?t.rect.width:0,a+=t.title.textMetrics.height,s=i?"end":"start");const l={tag:"legend-title",type:"text",x:o,y:Math.min(a,t.rect.y+t.rect.height),text:n.title.text,fill:n.title.fill,fontSize:n.title.fontSize,fontFamily:n.title.fontFamily,maxWidth:n.title.maxLengthPx,maxLines:n.title.maxLines,wordBreak:n.title.wordBreak,hyphens:n.title.hyphens,lineHeight:n.title.lineHeight,anchor:s,title:n.title.text};return Hu(e,l),l}(this);this.state.nodes.push(e)}const t=function(e){const t=e.state.legend.fillScale,n=e.state.legend.majorScale;return t.domain().map((e=>({type:"stop",color:t(e),offset:Math.min(1,Math.max(0,n.norm(e)))}))).sort(((e,t)=>e.offset-t.offset))}(this),n=function(e,t){const n=e.state,i=e.stgns,r=n.rect;let o=r.x,a=r.y,s=n.isVertical?i.size:n.legend.length(),l=n.isVertical?n.legend.length():i.size;"left"===n.ticks.anchor?o+=n.rect.width-i.size:"top"===n.ticks.anchor&&(a+=n.rect.height-i.size),"top"===n.title.anchor?a+=n.title.requiredHeight():"left"===n.title.anchor&&(o+=n.title.requiredWidth());const c={type:"rect",x:o,y:a,width:s,height:l,fill:{type:"gradient",stops:t,degree:n.isVertical?90:180}};return Hu(e,c),c}(this,t),i=function(e,t){const n=e.state,i=e.stgns;let r="start";const o={type:"rect",x:t.x,y:t.y,width:n.isVertical?0:t.width,height:n.isVertical?t.height:0,fill:"transparent"},a=n.ticks.values.map((a=>{let s=0,l=0,c=0,u="alphabetical";return n.isVertical?(l=t.y+t.height*a.pos,u=0===a.pos?"text-before-edge":"text-after-edge"):s=t.x+t.width*a.pos,"right"===n.ticks.anchor?(s=t.x+i.size+i.tick.padding,o.x=t.x+t.width):"left"===n.ticks.anchor?(s=t.x-i.tick.padding,r="end"):"top"===n.ticks.anchor?(l=t.y-i.tick.padding,c-=.25*a.textMetrics.height,r=0===a.pos?"start":"end"):"bottom"===n.ticks.anchor&&(l=t.y+t.height+i.tick.padding,c=.8*a.textMetrics.height,r=0===a.pos?"start":"end",o.y=t.y+t.height),{type:"text",x:s,y:l,dx:0,dy:c,text:a.label,fontSize:i.tick.fontSize,fontFamily:i.tick.fontFamily,fill:i.tick.fill,maxWidth:n.isVertical?i.tick.maxLengthPx:Math.min(i.tick.maxLengthPx,n.legend.length()/2),anchor:r,textBoundsFn:e.renderer.textBounds,title:a.label,baseline:u}}));return{type:"container",id:"legend-seq-ticks",children:[...a,o]}}(this,n),r={id:"legend-seq-target",type:"container",children:[n,i]};this.state.nodes.push(r)},render(){return this.state.nodes}};const Xu={coordinates:{minor:.5,major:.5,layerId:0,defined:!0},layers:{curve:"linear",show:!0,line:{stroke:"#ccc",strokeWidth:1,strokeLinejoin:"miter",strokeDasharray:void 0,opacity:1,show:!0,showMinor0:!0},area:{fill:"#ccc",opacity:.8,show:!0}}};function Gu(e,t){let{generatorType:n,item:i,data:r,major:o,minor:a,layerObj:s,stngs:l}=t,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const u={type:"path",points:e,generatorType:n,major:o,minor:a,layerObj:s,stngs:l,opacity:i.opacity,stroke:i.stroke,strokeWidth:i.strokeWidth,strokeLinejoin:i.strokeLinejoin,fill:c||i.fill,data:r};return i.strokeDasharray&&(u.strokeDasharray=i.strokeDasharray),u}function Ju(e){const{metaLayers:t,coordinates:n,layers:i,lines:r,areas:o}=function(e){let{data:t,stngs:n,rect:i,resolver:r,style:o,domain:a}=e;const{width:s,height:l}=i,c=r.resolve({data:t,defaults:Xu.coordinates,settings:n.coordinates||{},scaled:{major:"vertical"===n.orientation?l:s,minor:"vertical"===n.orientation?s:l}}),h=!n.connect&&a.length>2&&("function"==typeof n.coordinates.layerId||"object"==typeof n.coordinates.layerId),d={};let f=0;for(let e=0;e<c.items.length;e++){let t=c.items[e],n=t.layerId;if(h){const e=d[n]?d[n].items[d[n].items.length-1]:null,i=e?a.indexOf(e.data.major?e.data.major.value:e.data.value):null;e&&a.indexOf(t.data.major?t.data.major.value:t.data.value)-1!==i&&d[n].items.push({dummy:!0})}d[n]=d[n]||{order:f++,id:n,items:[],dataItems:[],consumableData:{}},d[n].dataItems.push(t.data),d[n].items.push(t)}const g=Object.keys(d).map((e=>(d[e].consumableData=p({points:d[e].dataItems},d[e].dataItems[0]),d[e]))),m={items:g.map((e=>e.consumableData))},y=n.layers||{};return{coordinates:c,metaLayers:g,layers:r.resolve({data:m,defaults:{curve:Xu.layers.curve,show:Xu.layers.show},settings:{curve:y.curve,show:y.show}}),lines:r.resolve({data:m,defaults:u({},Xu.layers.line,o.line),settings:y.line}),areas:r.resolve({data:m,defaults:u({},Xu.layers.area,o.area),settings:y.area})}}(e),a=[];return t.forEach(((t,s)=>{const l=i.items[s];if(!1===l.show)return;l.datum=l.data,l.data=[],l.id=t.id;const c=[],u=[];let h,d;for(let i=0;i<t.items.length;i++){if(h=t.items[i],d=h.data,!h.dummy){if(isNaN(h.major))continue;e.missingMinor0&&(h.minor0=n.settings.minor.scale?n.settings.minor.scale(d.minor0?d.minor0.value:0):0),isNaN(h.minor)||c.push(h.minor),l.data.push(h.data)}u.push(h)}const f=c.sort(((e,t)=>e-t))[Math.floor((c.length-1)/2)];a.push({layerObj:l,lineObj:r.items[s],areaObj:o.items[s],median:f,points:u,consumableData:t.consumableData})})),a}const Zu={require:["chart","resolver"],defaultSettings:{style:{area:"$shape",line:"$shape-outline"}},created(){},render(e){let{data:t}=e;const{width:n,height:i}=this.rect;this.stngs=this.settings.settings||{};const r=!this.stngs.coordinates||void 0===this.stngs.coordinates.minor0,o=Ju({data:t,stngs:this.stngs,rect:this.rect,resolver:this.resolver,style:this.style,missingMinor0:r,domain:this.stngs.coordinates&&this.stngs.coordinates.major&&this.stngs.coordinates.major.scale?this.chart.scale(this.stngs.coordinates.major.scale).domain():[]});if(this.stngs.layers&&this.stngs.layers.sort){const e=o.map((e=>({id:e.layerObj.id,data:e.layerObj.data}))).sort(this.stngs.layers.sort).map((e=>e.id));o.sort(((t,n)=>e.indexOf(t.layerObj.id)-e.indexOf(n.layerObj.id)))}else o.sort(((e,t)=>e.median-t.median));return function(e,t){let{width:n,height:i,missingMinor0:r,stngs:o}=t;const a=[],s=o.layers||{};return e.forEach((e=>{const{lineObj:t,layerObj:l,areaObj:c,points:h}=e;let d={size:i,p:"y"},f={size:n,p:"x"};if("vertical"===o.orientation){const e=u(!0,{},f);f=u(!0,{},d),d=u(!0,{},e)}s.area&&!1!==c.show&&a.push(Gu(h,{data:e.consumableData,item:c,generatorType:"area",major:f,minor:d,layerObj:l,stngs:o})),t&&!1!==t.show&&(a.push(Gu(h,{data:e.consumableData,item:t,generatorType:"line".concat(d.p.toUpperCase(),"1"),major:f,minor:d,layerObj:l,stngs:o},"none")),!r&&s.area&&!1!==c.show&&!1!==t.showMinor0&&a.push(Gu(h,{data:e.consumableData,item:t,generatorType:"line".concat(d.p.toUpperCase(),"0"),major:f,minor:d,layerObj:l,stngs:o},"none")))})),a}(o,{width:n,height:i,missingMinor0:r,stngs:this.stngs})}};function Qu(e,t){let n,i,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];"object"==typeof t.center?(n=t.center.x,i=t.center.y):(n=t.clientX,i=t.clientY);const o=n-e.state.boundingRect.left,a=i-e.state.boundingRect.top;return{x:r?Math.max(0,Math.min(o,e.rect.width)):o,y:r?Math.max(0,Math.min(a,e.rect.height)):a}}function eh(e,t){return{x:t.x+e.rect.x,y:t.y+e.rect.y}}function th(e,t){const n=Math.min(e.x,t.x),i=Math.min(e.y,t.y);return{x:n,y:i,width:Math.max(e.x,t.x)-n,height:Math.max(e.y,t.y)-i}}const nh={require:["chart","renderer"],defaultSettings:{layout:{displayOrder:99},settings:{brush:{components:[]}},style:{area:"$selection-area-target"}},on:{areaStart(e){this.start(e)},areaMove(e){this.move(e)},areaEnd(e){this.end(e)},areaCancel(){this.cancel()}},created(){this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1}},preferredSize:()=>0,render(){},start(e){this.state.boundingRect=this.renderer.element().getBoundingClientRect();const t=Qu(this,e,!1);Oa({x:0,y:0,width:this.rect.width,height:this.rect.height},t)&&(this.state.brushConfig=this.settings.settings.brush.components.map((e=>({key:e.key,contexts:e.contexts,data:e.data,action:e.action||"set"}))),this.state.start=Qu(this,e),this.state.active=!0)},move(e){var t;this.state.active&&(this.state.end=Qu(this,e),function(e){if(e.state.active){const t=eh(e,e.state.start),n=eh(e,e.state.end),i=e.chart.shapesAt(th(t,n),{components:e.state.brushConfig});e.chart.brushFromShapes(i,{components:e.state.brushConfig})}}(this),(t=this).renderer.render([u({type:"rect"},th(t.state.start,t.state.end),t.style.area)]))},end(){this.state.active&&(this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1},this.renderer.render([]))},cancel(){var e,t;this.state.active&&(e=this.state,t=this.chart,e.brushConfig.forEach((e=>{Array.isArray(e.contexts)&&e.contexts.forEach((e=>{t.brush(e).end()}))})),this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1},this.renderer.render([]))}};function ih(e,t,n){let{renderer:i,style:r,props:o,h:a}=n;const s=function(e,t){return{tooltip:"function"==typeof e.tooltipClass?e.tooltipClass({dock:t.dock}):e.tooltipClass,content:"function"==typeof e.contentClass?e.contentClass({dock:t.dock}):e.contentClass,arrow:"function"==typeof e.arrowClass?e.arrowClass({dock:t.dock}):e.arrowClass}}(o,t),l=function(e,t,n,i){return i.content({h:e,style:n,data:t})}(a,e,r,o),c=a("div",{dir:o.direction,class:Au(u({"pic-tooltip":!0},s.tooltip)),style:u({position:"relative",display:"inline-block"},t.computedTooltipStyle)},a("div",{style:r.content,class:Au(u({"pic-tooltip-content":!0},s.content))},l),a("div",{class:Au(u({"pic-tooltip-arrow":!0},s.arrow)),style:u({},r.arrow,r["arrow-".concat(t.dock)],t.computedArrowStyle)}));return i.render(c),i.element().children[0]}function rh(e){let{defaultDuration:t,defaultDelay:n}=e,i=null,r=null,o=!1;const a=function(){const e=function(){},t={pending:[],debounced:[],active:[],cancelled:[],rejected:[],fulfilled:[]};let n;return e.set=e=>{n=e,t[n].forEach((t=>t(e)))},e.on=(e,n)=>{Array.isArray(e)?e.forEach((e=>t[e].push(n))):t[e].push(n)},e.destroy=()=>{Object.keys(t).forEach((e=>{t[e].length=0}))},e}(),s=function(){},l=()=>{i=null,r=null,o=!1,a.set("fulfilled")};return s.invoke=function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n;i&&(clearTimeout(i),a.set("debounced")),a.set("pending"),i=setTimeout((()=>{e(),o=!0,i=null,a.set("active")}),c),s>0&&(r&&clearTimeout(r),r=setTimeout(l,s+Math.max(c,0)))},s.clear=()=>{o?a.set("cancelled"):i&&(clearTimeout(i),a.set("rejected")),r&&clearTimeout(r),i=null,r=null,o=!1},s.on=(e,t)=>{a.on(e,t)},s.destroy=()=>{s.clear(),a.destroy()},s}function oh(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return{left:"translate(-100%,-50%) translateX(".concat(-e,"px)"),right:"translate(".concat(e,"px, -50%)"),top:"translate(-50%, -100%) translateY(".concat(-e,"px)"),bottom:"translate(-50%, ".concat(e,"px)"),inside:"translate(-50%, -50%)"}}function ah(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return{left:{x:-e-n,y:-t/2},right:{x:n,y:-t/2},top:{x:-e/2,y:-t-n},bottom:{x:-e/2,y:n},inside:{x:-e/2,y:-t/2}}}function sh(e,t){const n=e>0?"-":"+";return e=Math.abs(e),void 0===t&&(t=e),{left:{left:"100%",top:"calc(50% ".concat(n," ").concat(e,"px)"),borderWidth:"".concat(t,"px")},right:{left:"".concat(2*-e,"px"),top:"calc(50% ".concat(n," ").concat(e,"px)"),borderWidth:"".concat(t,"px")},top:{left:"calc(50% ".concat(n," ").concat(e,"px)"),top:"100%",borderWidth:"".concat(t,"px")},bottom:{left:"calc(50% ".concat(n," ").concat(e,"px)"),top:"".concat(2*-e,"px"),borderWidth:"".concat(t,"px")},inside:{left:"0px",top:"0px",borderWidth:"0px"}}}function lh(e,t,n,i,r,o){const a=t+o.x,s=n+o.y,l=r;return!(a<0||s<0)&&!(a+i>e.width||s+l>e.height)}function ch(e){let{area:t,vx:n,vy:i,width:r,height:o,offset:a}=e;const s=n+a.x,l=i+a.y,c=r,u=o;let h=s<0?-s:0,d=l<0?-l:0;return h+=s+c>t.width?-(s+c-t.width):0,d+=l+u>t.height?-(l+u-t.height):0,{x:h,y:d}}function uh(e){let{options:t,pointer:n,width:i,height:r,dockOrder:o,x:a,y:s}=e;const{targetBounds:l}=n,c=oh(t.offset),u=c[t.dock];if(u)return{computedTooltipStyle:{left:"".concat(a,"px"),top:"".concat(s,"px"),transform:u},computedArrowStyle:sh(t.offset)[t.dock],dock:t.dock};const h={width:"target"===t.area?l.width:window.innerWidth,height:"target"===t.area?l.height:window.innerHeight},d=ah(i,r,t.offset),f=[],p="target"===t.area?a:l.left+a,g="target"===t.area?s:l.top+s;for(let e=0;e<o.length;e+=1){const n=o[e],l=ch({area:h,vx:p,vy:g,width:i,height:r,offset:d[n]}),u={left:"".concat(a,"px"),top:"".concat(s,"px"),transform:c[n]},m=sh(t.offset)[n];0!==l.x&&(u.width="".concat(i-20-Math.abs(l.x),"px"),"top"!==n&&"bottom"!==n||(u.left="".concat(a+l.x,"px"),m.left="calc(50% ".concat(l.x>0?"-":"+"," ").concat(Math.abs(l.x),"px)")));const y={computedTooltipStyle:u,computedArrowStyle:m,dock:n,rect:{width:i,height:r}};if(0===l.x&&0===l.y)return y;y.offset=l,f.push(y)}return f.sort(((e,t)=>Math.abs(e.offset.x)-Math.abs(t.offset.x))),f[0]}function hh(e,t,n){const i=e.key?n.component(e.key):n.componentsFromPoint({x:t.clientX,y:t.clientY})[0];if(!i)return{x:0,y:0,width:0,height:0,scaleRatio:{x:1,y:1}};const r=i.rect;return u({scaleRatio:r.scaleRatio},r.computedInner)}const dh={bounds:function(e){let{resources:t,nodes:n,pointer:i,width:r,height:o,options:a}=e;const{targetBounds:s}=i,{x:l,y:c,width:u,height:h}=t.getNodeBoundsRelativeToTarget(n[0]),d={left:{x:l,y:c+h/2},right:{x:l+u,y:c+h/2},top:{x:l+u/2,y:c},bottom:{x:l+u/2,y:c+h},inside:{x:l+u/2,y:c+h/2}},f=oh(a.offset),p=f[a.dock];if(p)return{computedTooltipStyle:{left:"".concat(d[a.dock].x,"px"),top:"".concat(d[a.dock].y,"px"),transform:p},computedArrowStyle:sh(a.offset)[a.dock],dock:a.dock};const g={width:"target"===a.area?s.width:window.innerWidth,height:"target"===a.area?s.height:window.innerHeight},m=ah(r,o,a.offset),y=["top","left","right","bottom","inside"];for(let e=0;e<y.length;e+=1){const t=y[e];if(lh(g,"target"===a.area?d[t].x:s.left+d[t].x,"target"===a.area?d[t].y:s.top+d[t].y,r,o,m[t]))return{computedTooltipStyle:{left:"".concat(d[t].x,"px"),top:"".concat(d[t].y,"px"),transform:f[t]},computedArrowStyle:sh(a.offset)[t],dock:t}}const v=function(e){let{options:t,docks:n,dockOffsets:i,targetBounds:r,area:o,width:a}=e;const s="top",l="target"===t.area?n[s].x:r.left+n[s].x,c=("target"===t.area?n[s].y:(r.top,n[s].y),i[s]),u=l+c.x,h=(c.y,a);let d=n.top.x;return u<0&&u+h>o.width||(u<0?d-=u:u+h>o.width&&(d-=u+h-o.width)),d}({options:a,docks:d,dockOffsets:m,targetBounds:s,area:g,width:r});return{computedTooltipStyle:{left:"".concat(v,"px"),top:"".concat(d.top.y,"px"),transform:f.top},computedArrowStyle:sh(a.offset+v-d.top.x,a.offset).top,dock:"top"}},pointer:function(e){let{options:t,pointer:n,width:i,height:r}=e;const{x:o,y:a}=n;return uh({x:o,y:a,pointer:n,width:i,height:r,options:t,dockOrder:["top","left","right","bottom"]})},slice:function(e){let{options:t,pointer:n,width:i,height:r,nodes:o,resources:a}=e;const s=o[0],{dx:l,dy:c}=n,u=a.getComponentBoundsFromNode(s),h=l+u.x+u.width/2,d=c+u.y+u.height/2,{start:f,end:p,outerRadius:g}=s.desc.slice,m=(f+p)/2-Math.PI/2,y=2*Math.PI,v=(m%y+y)%y;let x=["top","left","right","bottom"];return"auto"===t.dock&&(x=v<=Math.PI/4||v>=7*Math.PI/4?["right","top","bottom","left"]:v<=3*Math.PI/4?["bottom","left","right","top"]:v<=5*Math.PI/4?["left","top","bottom","right"]:["top","left","right","bottom"]),uh({x:h+g*u.scaleRatio.x*Math.cos(v),y:d+g*u.scaleRatio.y*Math.sin(v),pointer:n,width:i,height:r,options:t,dockOrder:x})}};function fh(e,t){let{width:n,height:i}=e,{chart:r,state:o,props:a}=t;const s={resources:{formatter:r.formatter,scale:r.scale,component:r.component,getComponentBoundsFromNode:e=>hh(e,o.pointer,r),getNodeBoundsRelativeToTarget:e=>function(e,t,n){const i=hh(e,t,n),r=e.bounds;return{x:i.x+t.dx+r.x,y:i.y+t.dy+r.y,width:r.width,height:r.height}}(e,o.pointer,r)},nodes:o.activeNodes,pointer:o.pointer,width:n,height:i},l=typeof a.placement;if("object"===l&&"function"==typeof a.placement.fn)return a.placement.fn(s);let c={type:"pointer",offset:8,dock:"auto",area:"viewport"};"function"===l&&(c=u(c,a.placement(s))),"object"===l&&dh[a.placement.type]?c=u(c,a.placement):"string"===l&&dh[a.placement]&&(c=u(c,{type:a.placement})),s.options=c;const h=dh[c.type](s);let{x:d,y:f,width:p,height:g}=s.resources.getComponentBoundsFromNode(s.nodes[0]);return d+=s.pointer.dx,p+=d,f+=s.pointer.dy,g+=f,h.computedTooltipStyle.left="".concat(Math.min(Math.max(0,d,parseFloat(h.computedTooltipStyle.left)),p),"px"),h.computedTooltipStyle.top="".concat(Math.min(Math.max(0,f,parseFloat(h.computedTooltipStyle.top)),g),"px"),h}let ph;function gh(){ph=null}const mh={duration:8e3,delay:500,filter:e=>e.filter((e=>e.data&&void 0!==e.data.value)),extract:e=>e.node.data.value,content:e=>{let{h:t,data:n}=e;return n.map((e=>t("div",{},e)))},isEqual:(e,t)=>e.length&&e.length===t.length&&e.every(((e,n)=>t[n]&&JSON.stringify(e.data)===JSON.stringify(t[n].data))),placement:{type:"pointer",dock:"auto",offset:8,area:"viewport"},tooltipClass:{},contentClass:{},arrowClass:{},direction:"ltr",appendTo:void 0,beforeShow:void 0,afterShow:void 0,beforeHide:void 0,onHide:void 0,afterHide:void 0};const yh={require:["chart","renderer"],defaultSettings:{settings:mh,style:{tooltip:{},content:{backgroundColor:"$gray-25",color:"$font-color--inverted",fontFamily:"$font-family",fontSize:"$font-size",lineHeight:"$line-height",borderRadius:"4px",padding:"8px",opacity:.9},arrow:{position:"absolute",width:"0px",height:"0px",borderStyle:"solid",color:"$gray-25",opacity:.9},"arrow-bottom":{borderTopColor:"transparent",borderLeftColor:"transparent",borderRightColor:"transparent"},"arrow-top":{borderBottomColor:"transparent",borderLeftColor:"transparent",borderRightColor:"transparent"},"arrow-right":{borderTopColor:"transparent",borderLeftColor:"transparent",borderBottomColor:"transparent"},"arrow-left":{borderTopColor:"transparent",borderBottomColor:"transparent",borderRightColor:"transparent"}}},renderer:"dom",on:{hide(){this.hide()},show(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.show(e,t)},prevent(e){this.prevent(e)}},hide(){this.dispatcher.clear(),this.state.activeNodes=[],this.state.pointer={}},show(e){let t,{nodes:n,duration:i,delay:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!this.state.prevent&&this.state.targetElement&&(this.state.pointer=function(e,t){let{chart:n,state:i}=t,r=0,o=0;e.center?(r+=e.center.x,o+=e.center.y):(r+=e.clientX,o+=e.clientY);const a=n.element.getBoundingClientRect(),s=i.targetElement.getBoundingClientRect(),l=r,c=o,u=a.left-s.left,h=a.top-s.top,d=r-a.left,f=o-a.top;return r-=s.left,o-=s.top,{x:r,y:o,dx:u,dy:h,cx:d,cy:f,clientX:l,clientY:c,targetBounds:s,chartBounds:a}}(e,this),t=Array.isArray(n)?this.props.filter(n):this.props.filter(this.chart.shapesAt({x:this.state.pointer.cx,y:this.state.pointer.cy})),this.props.isEqual(this.state.activeNodes,t)||(this.dispatcher.clear(),this.state.activeNodes=t,this.state.activeNodes.length&&this.dispatcher.invoke((()=>this.invokeRenderer(this.state.activeNodes)),i,r)))},prevent(e){this.state.prevent=!!e},init(e){this.state={activeNodes:[],pointer:{},targetElement:null,prevent:!1},this.props=e.settings,this.dispatcher=rh({defaultDuration:this.props.duration,defaultDelay:this.props.delay});const t=this.dispatcher.clear;this.dispatcher.on("pending",(()=>{!function(e){ph&&ph!==e&&ph()}(t),ph=t,"function"==typeof this.props.beforeShow&&this.props.beforeShow.call(void 0,{resources:{formatter:this.chart.formatter,scale:this.chart.scale}})})),this.dispatcher.on(["cancelled","fulfilled"],(()=>{const e={resources:{formatter:this.chart.formatter,scale:this.chart.scale}};"function"==typeof this.props.beforeHide&&this.props.beforeHide.call(void 0,u({element:this.state.tooltipElm},e)),"function"==typeof this.props.onHide?this.props.onHide.call(void 0,u({element:this.state.tooltipElm},e)):this.renderer.clear([]),"function"==typeof this.props.afterHide&&this.props.afterHide.call(void 0,e),ph===t&&(ph=null),this.state.tooltipElm=void 0})),this.dispatcher.on("active",(()=>{"function"==typeof this.props.afterShow&&this.props.afterShow.call(void 0,{element:this.state.tooltipElm,resources:{formatter:this.chart.formatter,scale:this.chart.scale}})}))},created(){this.init(this.settings)},beforeUpdate(e){let{settings:t}=e;this.dispatcher&&(this.dispatcher.destroy(),gh()),this.init(t)},render(e){return this.h=e,[]},beforeDestroy(){this.dispatcher.destroy(),gh()},appendTo(){if(this.props.appendTo){this.state.targetElement="function"==typeof this.props.appendTo?this.props.appendTo({resources:{formatter:this.chart.formatter,scale:this.chart.scale}}):this.props.appendTo;const{width:e,height:t}=this.state.targetElement.getBoundingClientRect();this.renderer.destroy(),this.renderer.size({width:e,height:t}),this.renderer.appendTo(this.state.targetElement)}else this.state.targetElement=this.renderer.element()},mounted(){this.appendTo()},updated(){this.appendTo()},invokeRenderer(e){const t=function(e,t){let{chart:n,scale:i,props:r,h:o}=t;const a={resources:{dataset:n.dataset,scale:n.scale,formatter:n.formatter},scale:i,h:o},s=[];return e.forEach((e=>{if("function"==typeof r.extract){const t=u({node:e},a);s.push(r.extract(t))}})),s}(e,this),n=fh(ih(t,{},this).getBoundingClientRect(),this);this.state.tooltipElm=ih(t,n,this)}};const vh={require:["renderer","chart"],defaultSettings:{settings:{target:"",selector:"*",fill:"rgba(0, 255, 0, 0.1)",stroke:"lime",opacity:1,useOuterRect:!1}},on:{update(){this.draw()}},draw(){const e=this.chart.findShapes(this.props.selector).filter((e=>e.key===this.props.target)),t=e.filter((e=>e.collider)).map((e=>e.collider));t.forEach((e=>{e.fill=this.props.fill,e.stroke=this.props.stroke,e.opacity=this.props.opacity,e.collider={type:null}})),this.renderer.render(t)},created(){this.props=this.settings.settings},resize(e){let{outer:t,inner:n}=e;return this.props.useOuterRect?t:n},render(){},mounted(){this.draw()},updated(){this.props=this.settings.settings,this.draw()}};var xh={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},bh=/([astvzqmhlc])([^astvzqmhlc]*)/gi,wh=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;function kh(e){const t=[],n=String(e).trim();return"M"!==n[0]&&"m"!==n[0]||n.replace(bh,((e,n,i)=>{const r=function(e){const t=e.match(wh);return t?t.map(Number):[]}(i);let o=n.toLowerCase(),a=n;if("m"===o&&r.length>2&&(t.push([a,...r.splice(0,2)]),o="l",a="m"===a?"l":"L"),r.length<xh[o])return"";for(t.push([a,...r.splice(0,xh[o])]);r.length>=xh[o]&&r.length&&xh[o];)t.push([a,...r.splice(0,xh[o])]);return""})),t}const _h=2*Math.PI;function Mh(e,t){return{x:.5*(e.x+t.x),y:.5*(e.y+t.y)}}function Sh(e,t,n,i,r){const o=1-e;return o**3*t+3*o**2*e*n+3*o*e**2*i+e**3*r}function Rh(e,t,n,i){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:8;if(o<1||function(e,t,n,i){return Math.abs(e.x+n.x-(t.x+t.x))+Math.abs(e.y+n.y-(t.y+t.y))+Math.abs(t.x+i.x-(n.x+n.x))+Math.abs(t.y+i.y-(n.y+n.y))}(e,t,n,i)<=10)return r[r.length-1]!==e&&r.push(e),r.push(i),r;const a=Mh(e,t),s=Mh(t,n),l=Mh(n,i),c={x:Sh(.5,e.x,t.x,n.x,i.x),y:Sh(.5,e.y,t.y,n.y,i.y)},u=Mh(a,s),h=Mh(s,l);return Rh(e,a,u,c,r,o-1),Rh(c,h,l,i,r,o-1),r}function Ch(e,t,n){const{cp1:i,cp2:r}=function(e,t,n){return{cp1:{x:e.x+2/3*(t.x-e.x),y:e.y+2/3*(t.y-e.y)},cp2:{x:n.x+2/3*(t.x-n.x),y:n.y+2/3*(t.y-n.y)}}}(e,t,n);return Rh(e,i,r,n)}function Nh(e,t,n){const i=[],r=!!e[4],o=!!e[5],a=e[3];let s,l,c,u,h=e[6],d=e[7],f=e[1],p=e[2];if("a"===e[0]&&(h+=t,d+=n),t===d&&n===d)return i;if(!f||!p)return i.push({x:h,y:d}),i;({cx:s,cy:l,rx:f,ry:p,sweepAngle:c,startAngle:u}=function(e,t,n,i,r,o,a,s,l){let c,u,h,d,f,p;const g=Yo(n%360),m=Math.cos(g),y=Math.sin(g),v=(s-o)/2,x=(l-a)/2,b=m*v+y*x,w=m*x-y*v;p=b**2/(e=Math.abs(e))**2+w**2/(t=Math.abs(t))**2,p>1&&(p=Math.sqrt(p),e*=p,t*=p);const k=e*w,_=t*b,M=k**2+_**2,S=(e*t)**2-M;let R=Math.sqrt(Math.max(S/M,0));i===r&&(R=-R);const C=R*(k/t),N=R*(-_/e);d=m*C-y*N+(s+o)/2,f=y*C+m*N+(l+a)/2;const D=(b-C)/e,q=(w-N)/t,E=(-b-C)/e,O=(-w-N)/t;return c=Math.atan2(q,D),c+=c<0?_h:0,u=Math.atan2(O,E),u+=u<0?_h:0,h=u-c,!r&&c<u?h-=_h:r&&u<c&&(h+=_h),h%=_h,{startAngle:c,sweepAngle:h,cx:d,cy:f,rx:e,ry:t}}(f,p,a,r,o,h,d,t,n));const g=Math.abs(c*Math.sqrt((f**2+p**2)/2)),m=Math.ceil(g/10),y=c/m;for(let e=1;e<=m;e++){const t=(u+y*e)%_h,n=Math.cos(t),r=Math.sin(t);i.push({x:s+n*f+-r*n,y:l+r*p+n*r})}return i}function Dh(e){const t=kh(e),n=[],i=[];let r=0,o=0,a=null,s=null,l=null,c=null;for(let e=0;e<t.length;++e){const u=t[e],h=u[0];switch("S"!==h&&"s"!==h&&"C"!==h&&"c"!==h&&(a=null,s=null),"T"!==h&&"t"!==h&&"Q"!==h&&"q"!==h&&(l=null,c=null),h){case"m":i.length&&n.push(i.splice(0));case"l":r+=u[1],o+=u[2],i.push({x:r,y:o});break;case"M":i.length&&n.push(i.splice(0));case"L":r=u[1],o=u[2],i.push({x:r,y:o});break;case"H":r=u[1],i.push({x:r,y:o});break;case"h":r+=u[1],i.push({x:r,y:o});break;case"V":o=u[1],i.push({x:r,y:o});break;case"v":o+=u[1],i.push({x:r,y:o});break;case"a":i.push(...Nh(u,r,o)),r+=u[6],o+=u[7];break;case"A":i.push(...Nh(u,r,o)),r=u[6],o=u[7];break;case"c":i.push(...Rh({x:r,y:o},{x:u[1]+r,y:u[2]+o},{x:u[3]+r,y:u[4]+o},{x:u[5]+r,y:u[6]+o})),a=u[3]+r,s=u[4]+o,r+=u[5],o+=u[6];break;case"C":i.push(...Rh({x:r,y:o},{x:u[1],y:u[2]},{x:u[3],y:u[4]},{x:u[5],y:u[6]})),a=u[3],s=u[4],r=u[5],o=u[6];break;case"s":null!==a&&null!==a||(a=r,s=o),i.push(...Rh({x:r,y:o},{x:2*r-a,y:2*o-s},{x:u[1]+r,y:u[2]+o},{x:u[3]+r,y:u[4]+o})),a=u[1]+r,s=u[2]+o,r+=u[3],o+=u[4];break;case"S":null!==a&&null!==a||(a=r,s=o),i.push(...Rh({x:r,y:o},{x:2*r-a,y:2*o-s},{x:u[1],y:u[2]},{x:u[3],y:u[4]})),a=u[1],s=u[2],r=u[3],o=u[4];break;case"Q":i.push(...Ch({x:r,y:o},{x:u[1],y:u[2]},{x:u[3],y:u[4]})),l=u[1],c=u[2],r=u[3],o=u[4];break;case"q":i.push(...Ch({x:r,y:o},{x:u[1]+r,y:u[2]+o},{x:u[3]+r,y:u[4]+o})),l=u[1]+r,c=u[2]+o,r+=u[3],o+=u[4];break;case"T":null!==l&&null!==l||(l=r,c=o),l=2*r-l,c=2*o-c,i.push(...Ch({x:r,y:o},{x:l,y:c},{x:u[1],y:u[2]})),r=u[1],o=u[2];break;case"t":null!==l&&null!==l||(l=r,c=o),l=2*r-l,c=2*o-c,i.push(...Ch({x:r,y:o},{x:l,y:c},{x:u[1]+r,y:u[2]+o})),r+=u[1],o+=u[2];break;case"z":case"Z":i.length&&i.push({x:i[0].x,y:i[0].y})}}return function(e){for(let t=0;t<e.length-1;t++){const n=e[t],i=e[t+1];Math.abs(n.x-i.x)<1e-12&&Math.abs(n.y-i.y)<1e-12&&(e.splice(t,1),t--)}}(i),n.push(i.splice(0)),n}const qh={require:["renderer","chart"],defaultSettings:{settings:{target:"",fill:"transparent",stroke:"lime",opacity:1,radius:2,useOuterRect:!1}},on:{update(){this.draw()}},draw(){const e=this.chart.findShapes("path").filter((e=>e.key===this.props.target)),t=[];e.forEach((e=>{Dh(e.attrs.d).forEach((e=>{e.forEach((e=>{t.push({type:"circle",cx:e.x,cy:e.y,r:this.props.radius,fill:this.props.fill,stroke:this.props.stroke,opacity:this.props.opacity,collider:{type:null}})}))}))})),this.renderer.render(t)},created(){this.props=this.settings.settings},resize(e){let{outer:t,inner:n}=e;return this.props.useOuterRect?t:n},render(){},mounted(){this.draw()},updated(){this.props=this.settings.settings,this.draw()}};var Eh=[function(e){e.component("box",Os),e.component("box-marker",Os)},function(e){e.component("point",Fs),e.component("point-marker",Fs)},function(e){e.component("pie",Hs)},function(e){e.component("grid-line",Ks)},function(e){e.component("ref-line",ol)},function(e){e.component("axis",Al)},function(e){e.component("container",Tl)},function(e){e.component("text",Pl)},function(e){e.component("scrollbar",$l)},function(e){e.component("brush-range",nc),e.component("brush-area-dir",ac)},function(e){e.component("range",uc)},function(e){e.component("brush-lasso",mc)},function(e){e.component("labels",Du)},function(e){e.component("legend-cat",Bu)},function(e){e.component("legend-seq",Ku)},function(e){e.component("line",Zu)},function(e){e.component("brush-area",nh)},function(e){e.component("tooltip",yh)},function(e){e.component("debug-collider",vh)},function(e){e.component("debug-path-to-points",qh)}];let Oh=class{constructor(e){this._parent=null,this._children=[],this._ancestors=null,this.type=e,this.data=null}detach(){return this._parent&&this._parent.removeChild(this),this}get parent(){return this._parent}get isBranch(){return this._children&&this._children.length}get children(){return this._children}get ancestors(){return this._ancestors||(this._ancestors=[],this.parent&&this._ancestors.push(this.parent,...this.parent.ancestors)),this._ancestors}get descendants(){let e=[];const t=this.children.length;let n,i;for(n=0;n<t;n++)i=this.children[n],e.push(i),i.children.length&&(e=[...e,...i.descendants]);return e}equals(e){const t=this.children,n=e.children;if(t.length!==n.length)return!1;for(let e=0;e<t.length;e++)if(!t[e].equals(n[e]))return!1;return!0}toJSON(){return{type:this.type,children:this.children.map((e=>e.toJSON()))}}};class zh{constructor(){let{x:e=0,y:t=0,width:n=0,height:i=0,minWidth:r=0,minHeight:o=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({x:e,y:t,width:n,height:i,minWidth:r,minHeight:o})}set(){let{x:e=0,y:t=0,width:n=0,height:i=0,minWidth:r=0,minHeight:o=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="rect",n>=0?(this.x=e,this.width=Math.max(n,r)):(this.x=e+Math.min(n,-r),this.width=-Math.min(n,-r)),i>=0?(this.y=t,this.height=Math.max(i,o)):(this.y=t+Math.min(i,-o),this.height=-Math.min(i,-o))}containsPoint(e){return Oa(this,e)}intersectsLine(e){return za(this,k(e))}intersectsRect(e){return qa(this,w(e))}intersectsCircle(e){return Ma(e,this)}intersectsPolygon(e){return Da(e,this)}intersectsGeoPolygon(e){return $a(e,this)}points(){return[{x:this.x,y:this.y},{x:this.x+this.width,y:this.y},{x:this.x+this.width,y:this.y+this.height},{x:this.x,y:this.y+this.height}]}}class Ah{constructor(){let{cx:e=0,cy:t=0,r:n=0,minRadius:i=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({cx:e,cy:t,r:n,minRadius:i})}set(){let{cx:e=0,cy:t=0,r:n=0,minRadius:i=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="circle",this.cx=e,this.cy=t,this.r=Math.max(n,i),this.vector={x:this.cx,y:this.cy}}containsPoint(e){return _a(this,e)}intersectsLine(e){return Sa(this,k(e))}intersectsRect(e){return Ma(this,w(e))}intersectsCircle(e){return n=e,!xa(t=this)&&!xa(n)&&(t.cx-n.cx)**2+(t.cy-n.cy)**2<=(t.r+n.r)**2;var t,n}intersectsPolygon(e){return Ra(this,e)}intersectsGeoPolygon(e){return Pa(this,e)}points(){return[{x:this.cx,y:this.cy}]}}class Th{constructor(){let{x1:e=0,y1:t=0,x2:n=0,y2:i=0,tolerance:r=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({x1:e,y1:t,x2:n,y2:i,tolerance:r})}set(){let{x1:e=0,y1:t=0,x2:n=0,y2:i=0,tolerance:r=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="line",this.x1=e,this.y1=t,this.x2=n,this.y2=i,this.tolerance=Math.max(0,Math.round(r)),this.vectors=this.points(),this.zeroSize=e===n&&t===i}containsPoint(e){if(this.tolerance>0){return Sa({cx:e.x,cy:e.y,r:this.tolerance},this)}return Ta(this,e)}intersectsLine(e){return Aa(this,k(e))}intersectsRect(e){return za(w(e),this)}intersectsCircle(e){return Sa(e,this)}intersectsPolygon(e){return Na(e,this)}intersectsGeoPolygon(e){return La(e,this)}points(){return[{x:this.x1,y:this.y1},{x:this.x2,y:this.y2}]}}class Ih{constructor(){let{vertices:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({vertices:e})}set(){let{vertices:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.type="polygon",this.vertices=e.slice(),this.edges=[],function(e){for(let t=0;t<e.length-1;t++){const n=e[t],i=e[t+1];n.x===i.x&&n.y===i.y&&(e.splice(t,1),t--)}}(this.vertices),!(this.vertices.length<=2)){!function(e){const t=e[0],n=e[e.length-1];t.x===n.x&&t.y===n.y||e.push(t)}(this.vertices),this.xMin=NaN,this.yMin=NaN,this.xMax=NaN,this.yMax=NaN;for(let e=0;e<this.vertices.length;e++)e<this.vertices.length-1&&this.edges.push([this.vertices[e],this.vertices[e+1]]),this.xMin=isNaN(this.xMin)?this.vertices[e].x:Math.min(this.xMin,this.vertices[e].x),this.xMax=isNaN(this.xMax)?this.vertices[e].x:Math.max(this.xMax,this.vertices[e].x),this.yMin=isNaN(this.yMin)?this.vertices[e].y:Math.min(this.yMin,this.vertices[e].y),this.yMax=isNaN(this.yMax)?this.vertices[e].y:Math.max(this.yMax,this.vertices[e].y);this._bounds=null,this._boundingRect=null}}containsPoint(e){return Ca(this,e)}intersectsCircle(e){return Ra(e,this)}intersectsLine(e){return Na(this,k(e))}intersectsRect(e){return Da(this,w(e))}intersectsPolygon(e){return Ia(this,e)}intersectsGeoPolygon(e){return ja(e,this)}points(){return this.vertices}bounds(){return this._bounds||(this._bounds=[{x:this.xMin,y:this.yMin},{x:this.xMax,y:this.yMin},{x:this.xMax,y:this.yMax},{x:this.xMin,y:this.yMax}]),this._bounds}boundingRect(){return this._boundingRect||(this._boundingRect={x:this.xMin,y:this.yMin,width:this.xMax-this.xMin,height:this.yMax-this.yMin}),this._boundingRect}}function jh(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Ih(...t)}function Ph(e){const t=e[0],n=e[e.length-1];t.x===n.x&&t.y===n.y||e.push(t)}function Fh(e){for(let t=0;t<e.length-1;t++){const n=e[t],i=e[t+1];n.x===i.x&&n.y===i.y&&(e.splice(t,1),t--)}}class Lh{constructor(){let{vertices:e=[[]]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({vertices:e})}set(){let{vertices:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="geopolygon",this.vertices=e.slice(),this.numPolygons=this.vertices.length,this.polygons=[],this.xMin=NaN,this.yMin=NaN,this.xMax=NaN,this.yMax=NaN;for(let e=0;e<this.numPolygons;e++)Fh(this.vertices[e]),this.vertices[e].length>2&&Ph(this.vertices[e]),this.polygons[e]=jh({vertices:this.vertices[e]}),this.xMin=isNaN(this.xMin)?this.polygons[e].xMin:Math.min(this.xMin,this.polygons[e].xMin),this.xMax=isNaN(this.xMax)?this.polygons[e].xMax:Math.max(this.xMax,this.polygons[e].xMax),this.yMin=isNaN(this.yMin)?this.polygons[e].yMin:Math.min(this.yMin,this.polygons[e].yMin),this.yMax=isNaN(this.yMax)?this.polygons[e].yMax:Math.max(this.yMax,this.polygons[e].yMax);this._bounds=null,this._boundingRect=null}containsPoint(e){return Fa(this,e)}intersectsCircle(e){return Pa(e,this)}intersectsLine(e){return La(this,k(e))}intersectsRect(e){return $a(this,w(e))}intersectsPolygon(e){return ja(this,e)}intersectsGeoPolygon(e){return function(e,t){const n=e.boundingRect(),i=t.boundingRect();return!!qa(n,i)&&(Ea(i,n)?ka(t,e):ka(e,t))}(this,e)}points(){return this.vertices}bounds(){return this._bounds||(this._bounds=[{x:this.xMin,y:this.yMin},{x:this.xMax,y:this.yMin},{x:this.xMax,y:this.yMax},{x:this.xMin,y:this.yMax}]),this._bounds}boundingRect(){return this._boundingRect||(this._boundingRect={x:this.xMin,y:this.yMin,width:this.xMax-this.xMin,height:this.yMax-this.yMin}),this._boundingRect}}function $h(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Lh(...t)}class Bh{constructor(){let{points:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({points:e})}set(){let{points:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.type="polyline",this.segments=[],this._points=e.slice(),this._points.length>1)for(let e=0,i=this._points.length-1;e<i;e++)t=this._points[e],n=this._points[e+1],(t.x!==n.x||t.y!==n.y)&&this.segments.push({x1:this._points[e].x,y1:this._points[e].y,x2:this._points[e+1].x,y2:this._points[e+1].y});var t,n}containsPoint(e){return this.segments.some((t=>Ta(t,e)))}intersectsCircle(e){return this.segments.some((t=>Sa(e,t)))}intersectsLine(e){const t=k(e);return this.segments.some((e=>Aa(e,t)))}intersectsRect(e){const t=w(e);return this.segments.some((e=>za(t,e)))}intersectsPolygon(e){return this.segments.some((t=>Na(e,t)))}intersectsGeoPolygon(e){return this.segments.some((t=>La(e,t)))}points(){return this._points}}const Hh=Ce();function Wh(e,t){return Hh.get(e)(t)}Hh.add("rect",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new zh(...t)})),Hh.add("circle",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Ah(...t)})),Hh.add("line",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Th(...t)})),Hh.add("polygon",jh),Hh.add("geopolygon",$h),Hh.add("polyline",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Bh(...t)}));class Vh{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.set(e)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.geometries=[],e.forEach((e=>{const t=Wh(e.type,e);t&&this.geometries.push(t)}))}containsPoint(e){return this.geometries.some((t=>t.containsPoint(e)))}intersectsLine(e){return this.geometries.some((t=>t.intersectsLine(e)))}intersectsRect(e){return this.geometries.some((t=>t.intersectsRect(e)))}intersectsCircle(e){return this.geometries.some((t=>t.intersectsCircle(e)))}intersectsPolygon(e){return this.geometries.some((t=>t.intersectsPolygon(e)))}intersectsGeoPolygon(e){return this.geometries.some((t=>t.intersectsGeoPolygon(e)))}}class Uh{constructor(){this._elements=[[1,0,0],[0,1,0],[0,0,1]],this._stack=[]}clone(){return(new Uh).multiply(this)}set(e){return this._elements=e,this}save(){return this._stack.push(this.elements),this}restore(){return this._stack.length&&(this._elements=this._stack.pop()),this}add(e){let t,n;for(t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)this._elements[t][n]+=e;return this}translate(e,t){return this.multiply([[1,0,e],[0,1,t],[0,0,1]]),this}rotate(e){let t=Math.cos(-e),n=Math.sin(-e);return this.multiply([[t,n,0],[-n,t,0],[0,0,1]]),this}multiply(e){let t,n,i,r;if(e instanceof Uh&&(e=e._elements),Array.isArray(e)){for(i=[[0,0,0],[0,0,0],[0,0,0]],t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)for(r=0;r<3;r++)i[t][n]+=this._elements[t][r]*e[r][n];this._elements=i}else for(t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)this._elements[t][n]*=e;return this}scale(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return this.multiply([[e,0,0],[0,t,0],[0,0,1]]),this}transform(e,t,n,i,r,o){return this.multiply([[e,n,r],[t,i,o],[0,0,1]]),this}determinant(){let e=this._elements[0][0],t=this._elements[0][1],n=this._elements[0][2],i=this._elements[1][0],r=this._elements[1][1],o=this._elements[1][2],a=this._elements[2][0],s=this._elements[2][1],l=this._elements[2][2],c=0;return c=e*r*l+t*o*a+n*i*s-n*r*a-t*i*l-e*o*s,c}invert(){let e=this.determinant(),t=this._elements[0][0],n=this._elements[0][1],i=this._elements[0][2],r=this._elements[1][0],o=this._elements[1][1],a=this._elements[1][2],s=this._elements[2][0],l=this._elements[2][1],c=this._elements[2][2];return this._elements=[[o*c-a*l,i*l-n*c,n*a-i*o],[a*s-r*c,t*c-i*s,i*r-t*a],[r*l-o*s,s*n-t*l,t*o-n*r]],this.multiply(1/e),this}transpose(){const e=Object.create(this._elements);return this._elements=[[e[0][0],e[1][0],e[2][0]],[e[0][1],e[1][1],e[2][1]],[e[0][2],e[1][2],e[2][2]]],this}identity(){return this._elements=[[1,0,0],[0,1,0],[0,0,1]],this}toString(){return"".concat(this._elements.map((e=>e.join("\t"))).join("\n"))}isIdentity(){const e=this._elements;return 1===e[0][0]&&0===e[0][1]&&0===e[0][2]&&0===e[1][0]&&1===e[1][1]&&0===e[1][2]&&0===e[2][0]&&0===e[2][1]&&1===e[2][2]}transformPoint(e){let t,n,i=[e.x,e.y,1],r=this._elements,o=[0,0,0];for(t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)o[t]+=i[n]*r[t][n];return{x:o[0],y:o[1]}}transformPoints(e){let t,n,i,r,o,a=this._elements,s=[];for(r=0;r<e.length;r++){for(t=[e[r].x,e[r].y,1],o=[0,0,0],n=0;n<this._elements.length;n++)for(i=0;i<this._elements[n].length;i++)o[n]+=t[i]*a[n][i];s.push({x:o[0],y:o[1]})}return s}get elements(){const e=this._elements;return[[e[0][0],e[0][1],e[0][2]],[e[1][0],e[1][1],e[1][2]],[e[2][0],e[2][1],e[2][2]]]}}const Yh=/(translate|scale|rotate|matrix)\(([0-9,.eE+-\s]+)(?:,|\s?)+\)/g;function Kh(e,t){const n=t.args[0]*(Math.PI/180);if(t.args.length>2){const i=t.args[1],r=t.args[2];e.translate(i,r),e.rotate(n),e.translate(-i,-r)}else 1===t.args.length&&e.rotate(n)}function Xh(e,t){const n=t.args[0],i=isNaN(t.args[1])?t.args[0]:t.args[1];e.scale(n,i)}function Gh(e,t){const n=t.args[0],i=isNaN(t.args[1])?0:t.args[1];e.translate(n,i)}function Jh(e,t){t.args.length>=6&&e.transform(...t.args)}function Zh(e,t){const n=function(e){let t,n=[];for(;null!==(t=Yh.exec(e));){const e=t[2].trim(),i=-1===e.indexOf(",")?e.split(" "):e.split(",");n.push({cmd:t[1],args:i.filter((e=>e.trim().length>0)).map((e=>Number(e)))})}return n}(e);let i;for(let e=0,r=n.length;e<r;e++)i=n[e],"rotate"===i.cmd?Kh(t,i):"scale"===i.cmd?Xh(t,i):"matrix"===i.cmd?Jh(t,i):"translate"===i.cmd&&Gh(t,i)}const Qh={type:/^\w[\w-]+/,attr:/^\[\w(?:[\w\._-]+)?(?:[!]?=['\"][\w\s*#_-]*['\"])?\]/,universal:/^(\*)/,tag:/^\.(\w+)/},ed={type:(e,t)=>t.filter((t=>{const n=t.type;return!!n&&n.toLowerCase()===e.toLowerCase()})),attr:(e,t,n,i)=>i.filter((i=>{const r=i.attrs[e];if(!t)return void 0!==r;if(void 0===r)return!1;switch(t){case"=":return n===String(r);case"!=":return n!==String(r);default:return!1}})),universal:e=>e,tag:(e,t)=>t.filter((t=>{const n=t.tag;return!!n&&-1!==n.trim().split(/\s+/).indexOf(e.replace(".",""))}))};function td(e,t){if(!t||!t.length||!e||"function"!=typeof ed[e.type])return[];switch(e.type){case"type":case"tag":return ed[e.type](e.value,t);case"attr":return ed[e.type](e.attribute,e.operator,e.attributeValue,t);case"universal":return ed[e.type](t);default:return[]}}var nd={find:function(e,t){const n=[],i=[];let r,o;if(t.isBranch){let a;r=function(e){const t=[];let n,i,r,o;return e.split(/\s*,\s*/).forEach((e=>{e=e.trim(),n=[];const a=t=>{r=e.match(Qh[t]),r&&(o=!0,e=e.slice(r[0].length),i={type:t,value:r[0]},"attr"===t&&(r=r[0].match(/\[(\w[\w\._-]+)?(?:([!]?=)['\"]([\w\s#_-]*)['\"])?\]/),i.attribute=r[1],i.operator=r[2],i.attributeValue=r[3]),n.push(i))};for(;e&&(o=!1,r=e.match(/^\s*([>+~]|\s)\s*/),r&&(o=!0,n.push({type:" ",value:r[0]}),e=e.slice(r[0].length)),Object.keys(Qh).forEach(a),n&&n.length&&t.indexOf(n)<0&&t.push(n),o););})),t}(e),o=t.descendants;for(let e=0,t=r.length;e<t;e++){a=r[e];const t=[];let n=o.slice(),s=!1;a.reverse().forEach((e=>{if(" "===e.type)return t.push(n),n=o.slice(),void(s=!1);n=td(e,n),s=!0})),s&&t.push(n);const l=t[0].filter((e=>{let n,i=e.parent;for(let e=1;e<t.length;e++){for(n=t[e].indexOf(i);i&&n<0;)i=i.parent,n=t[e].indexOf(i);if(n<0)return!1}return!0}));i.push(l)}for(let e=0,t=i.length;e<t;e++)for(let t=0,r=i[e].length;t<r;t++)n.indexOf(i[e][t])<0&&n.push(i[e][t])}return n||[]}};function id(e,t,n){const i=e.type;let r=e.points();n&&(r=r.every((e=>Array.isArray(e)))?r.map((e=>n.transformPoints(e))):n.transformPoints(r)),function(e,t){for(let n=0,i=e.length;n<i;n++)e[n].x/=t,e[n].y/=t}(r,t);let o=null;if("rect"===i||"bounds"===i)o=w(r),o.type=i;else if("circle"===i)o=function(e,t){return{cx:e[0].x,cy:e[0].y,r:t}}(r,e.r),o.type=i;else if("line"===i)o=k(r),o.type=i;else if("polygon"===i||"polyline"===i){o={type:"path",d:Vo(r,"polygon"===i)}}else if("geopolygon"===i){let e="";for(let t=0;t<r.length;t++)e+=Vo(r[t],!0);o={type:"path",d:e}}return o}class rd{constructor(e){this._bounds=function(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const{x:n,y:i,width:r,height:o}=e.boundingRect?e.boundingRect(t):{x:0,y:0,width:0,height:0};return{x:n,y:i,width:r,height:o}},this._attrs=e.attrs,this._type=e.type,this._data=e.data,this._dpi=e.stage?e.stage.dpi:1,this._collider=()=>function(e,t){if(e.collider){const n=e.modelViewMatrix;return"collection"===e.colliderType?{type:"container",children:e.collider.geometries.map((e=>id(e,t,n)))}:id(e.collider,t,n)}return null}(e,this._dpi),this._desc=e.desc,this._tag=e.tag,this._children=()=>e.children.map((e=>new rd(e))),this._parent=()=>e.parent?new rd(e.parent):null,this._cache={elementBoundingRect:null},this._getElementBoundingRect=()=>(!this._cache.elementBoundingRect&&this.element&&(this._cache.elementBoundingRect=this.element.getBoundingClientRect()),this._cache.elementBoundingRect||{left:0,top:0})}get children(){return this._children()}get parent(){return this._parent()}get type(){return this._type}get data(){return this._data}get attrs(){return this._attrs}set element(e){this._cache.elementBoundingRect=null,this._element=e}get element(){return this._element}set key(e){this._key=e}get key(){return this._key}get bounds(){const e=this._bounds();return e.x/=this._dpi,e.y/=this._dpi,e.width/=this._dpi,e.height/=this._dpi,e}get localBounds(){return this._bounds(!1)}boundsRelativeTo(e){const t=typeof e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?this.bounds:this.localBounds,i=this._getElementBoundingRect();let r=i.left,o=i.top;if("object"===t&&null!==e&&"function"==typeof e.getBoundingClientRect){const{left:t=0,top:n=0}=e.getBoundingClientRect();r-=t,o-=n}return n.x+=r,n.y+=o,n}get collider(){return this._collider()}get desc(){return this._desc}get tag(){return this._tag}}function od(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new rd(...t)}class ad{constructor(e){this._node=od(e),this._parent=null,this._input=null}get node(){return this._node}set parent(e){this._parent=e}get parent(){return this._parent}set input(e){this._input=e}get input(){return this._input}}function sd(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new ad(...t)}function ld(e,t){const n=e.parent;if(n&&"stage"!==n.type){t.parent=sd(n);const e=n.parent;e&&"stage"!==e.type&&ld(e,t.parent)}}function cd(e,t,n){if(null===e.colliderType)return null;const i=function(e,t){let n={};if(e.modelViewMatrix)if(Array.isArray(t))n=e.inverseModelViewMatrix.transformPoints(t);else if(isNaN(t.r))Array.isArray(t.vertices)?n.vertices=e.inverseModelViewMatrix.transformPoints(t.vertices):n=e.inverseModelViewMatrix.transformPoint(t);else{const i={x:t.cx,y:t.cy};({x:n.cx,y:n.cy}=e.inverseModelViewMatrix.transformPoint(i)),n.r=t.r}else n=t;return Array.isArray(n.vertices)&&(n=n.vertices.every((e=>Array.isArray(e)))?$h(n):jh(n)),n}(e,n);return"frontChild"===e.colliderType?function(e,t,n){for(let i=e.descendants.length-1;i>=0;i--){const r=e.descendants[i];if(null!==r.collider&&r.collider[t](n)){const e=sd(r);return ld(r,e),e}}return null}(e,t,i):function(e,t,n){if(e.collider[t](n)){const t=sd(e);return ld(e,t),t}return null}(e,t,i)}function ud(e,t,n,i){const r=e.length;for(let o=0;o<r;o++){const r=e[o],a=cd(r,t,i);a&&n.push(a),!r.children||a||r.collider||ud(r.children,t,n,i)}}function hd(e,t,n){const i=e.length;for(let r=0;r<i;r++){const i=e[r];if(null!==cd(i,t,n))return!0;if(i.children&&!i.collider)return hd(i.children,t,n)}return!1}function dd(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;let n={};switch(_(e)){case"circle":return n.cx=e.cx*t,n.cy=e.cy*t,n.r=e.r,["intersectsCircle",n];case"rect":return n=b(e).map((e=>Jo(e,t))),["intersectsRect",n];case"line":return n=x(e).map((e=>Jo(e,t))),["intersectsLine",n];case"point":return n=Jo(e,t),["containsPoint",n];case"polygon":return n.vertices=e.vertices.map((e=>Jo(e,t))),["intersectsPolygon",n];case"geopolygon":return n.vertices=e.vertices.map((e=>e.map((e=>Jo(e,t))))),["intersectsGeoPolygon",n];default:return[]}}function fd(e,t){const[n,i]=dd(t,e.dpi),r=[];return n&&(ud([e],n,r,i),function(e,t){for(let n=0,i=t.length;n<i;n++)t[n].input=e}(t,r)),r}function pd(e,t){const[n,i]=dd(t,e.dpi);return hd([e],n,i)}class gd extends Oh{constructor(e){super(e),this._stage=null,this._collider={type:null,definition:null,fn:null},this._attrs={},this._node=null}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.node=e;const{data:t,desc:n,tag:i,strokeReference:r,fillReference:o}=e;var a,s;a=this.attrs,s=e,Object.keys(Wo).forEach((e=>{const t=s[e];void 0!==t&&(a[Wo[e]]=t)})),void 0!==t&&(this.data=t),"object"==typeof n&&(this.desc=u(!0,{},n)),"string"==typeof i&&(this.tag=i),"string"==typeof r&&(this.strokeReference=r),"string"==typeof o&&(this.fillReference=o)}findShapes(e){return nd.find(e,this).map((e=>od(e)))}getItemsFrom(e){return fd(this,e)}containsPoint(e){return pd(this,e)}intersectsLine(e){return pd(this,e)}intersectsRect(e){return pd(this,e)}intersectsCircle(e){return pd(this,e)}intersectsPolygon(e){return pd(this,e)}intersectsGeoPolygon(e){return pd(this,e)}resolveLocalTransform(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Uh;void 0!==this.attrs.transform&&Zh(this.attrs.transform,e),this.modelViewMatrix=e.clone()}resolveGlobalTransform(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Uh;const t=this.ancestors;if(t.length>0)for(let n=t.length-1;n>=0;n--)t[n].resolveLocalTransform(e),e=t[n].modelViewMatrix;this.resolveLocalTransform(e)}attr(e){return this.attrs[e]}equals(e){const t=this.attrs,n=Object.keys(t),i=e.attrs,r=Object.keys(i);if(n.length!==r.length)return!1;for(let e=0;e<n.length;e++){const r=n[e];if(!Object.hasOwnProperty.call(i,r))return!1;if(t[r]!==i[r])return!1}return super.equals(e)}toJSON(){const e=super.toJSON();return e.attrs=this.attrs,e}get attrs(){return this._attrs}get stage(){return this._parent&&!this._stage?this._stage=this._parent.stage:this._parent||this._stage===this||(this._stage=null),this._stage}set modelViewMatrix(e){this._mvm=e,this._imvm=null}get modelViewMatrix(){return this._mvm}get inverseModelViewMatrix(){return this._imvm=this._imvm?this._imvm:this._mvm.clone().invert(),this._imvm}set node(e){this._node=e}get node(){return this._node}set collider(e){const t=Array.isArray(e)?"collection":e&&e.type;return"string"!=typeof t?(this._collider.type=null,this._collider.definition=null,void(this._collider.fn=null)):null!==this._collider&&this._collider.type===t&&null!==this._collider.fn?(this._collider.fn.set(e),void(this._collider.definition=e)):(this._collider.type=t,void(this._collider.definition=e))}get collider(){if(null!==this._collider.fn)return this._collider.fn;switch(this._collider.type){case"collection":this._collider.fn=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Vh(...t)}(this._collider.definition);break;case"frontChild":return!0;case"bounds":this._collider.fn=Wh("rect",this.boundingRect());break;case"line":case"rect":case"circle":case"polygon":case"geopolygon":case"polyline":this._collider.fn=Wh(this._collider.type,this._collider.definition);break;default:return null}return this._collider.fn}get colliderType(){return this._collider.type}}class md extends Oh{addChild(e){if(!(e&&e instanceof Oh))throw new TypeError("Expecting a Node as argument, but got ".concat(e));if(e===this)throw new Error("Can not add itself as child!");if(e._children&&e._children.length&&this.ancestors.indexOf(e)>=0)throw new Error("Can not add an ancestor as child!");return e._parent&&e._parent!==this&&e._parent.removeChild(e),this._children.push(e),e._parent=this,e._ancestors=null,this}addChildren(e){let t,n=e?e.length:0;for(t=0;t<n;t++)this.addChild(e[t]);return this}removeChild(e){const t=this._children.indexOf(e);return t>=0&&(this._children.splice(t,1),e._parent=null,e._ancestors=null),this}removeChildren(e){let t,n;if(!this._children)return this;if(e)for(n=e.length,t=0;t<n;t++)this.removeChild(e[t]);else for(;this._children.length;)this.removeChild(this._children[0]);return this}}const yd=md.prototype;class vd extends gd{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{type:t="container"}=e;super(t),this.set(e)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(e);const{collider:t}=e,n=u({type:null},t);this.collider=n,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}appendChildRect(e,t){if(void 0!==e.bounds){const n=this.__boundingRect[t]||{},[i,,r]=e.bounds(t),{x:o,y:a}=i,{x:s,y:l}=r,c=isNaN(n.width)?s:Math.max(s,n.width+n.x),u=isNaN(n.height)?l:Math.max(l,n.height+n.y);n.x=isNaN(n.x)?o:Math.min(o,n.x),n.y=isNaN(n.y)?a:Math.min(a,n.y),n.width=c-n.x,n.height=u-n.y,this.__boundingRect[t]=n}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=this.children.length;for(let n=0;n<t;n++)this.appendChildRect(this.children[n],e);return this.__boundingRect[e]=u({x:0,y:0,width:0,height:0},this.__boundingRect[e]),this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}addChild(e){const t=yd.addChild.call(this,e);if(this._collider&&"bounds"===this._collider.type){this.appendChildRect(e,!0);const t=u({type:"bounds",x:0,y:0,width:0,height:0},this.__boundingRect.true);this.collider=t}return t}addChildren(e){const t=yd.addChildren.call(this,e),n=e.length;if(this._collider&&"bounds"===this._collider.type&&n>0){for(let t=0;t<n;t++)this.appendChildRect(e[t],!0);const t=u({type:"bounds",x:0,y:0,width:0,height:0},this.__boundingRect.true);this.collider=t}return t}removeChild(e){e._stage=null;let t,n=e.descendants,i=n?n.length:0;for(t=0;t<i;t++)n[t]._stage=null;if(yd.removeChild.call(this,e),this._collider&&"bounds"===this._collider.type){this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null};const e=u(this.boundingRect(!0),{type:"bounds"});this.collider=e}return this}removeChildren(e){if(yd.removeChildren.call(this,e),this._collider&&"bounds"===this._collider.type){this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null};const e=u(this.boundingRect(!0),{type:"bounds"});this.collider=e}return this}}function xd(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new vd(...t)}class bd extends vd{constructor(e){super("stage"),this._stage=this,this._dpiRatio=e||1}get dpi(){return this._dpiRatio}}const wd=md.prototype,kd=["x1","x2","y1","y2","id","offset","style"];class _d extends gd{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{type:t="container"}=e;super(t),this.set(e),this._boundingRect={}}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(e);const t=this.attrs;let n="";for(let i=0,r=kd.length;i!==r;i++)n=kd[i],void 0!==e[n]&&(t[n]=e[n])}addChild(e){return wd.addChild.call(this,e)}addChildren(e){return wd.addChildren.call(this,e)}removeChild(e){e._stage=null;let t,n=e.descendants,i=n?n.length:0;for(t=0;t<i;t++)n[t]._stage=null;return wd.removeChild.call(this,e),this}removeChildren(e){return wd.removeChildren.call(this,e),this}}function Md(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new _d(...t)}const Sd=md.prototype,Rd=["patternUnits","x","y","width","height","id"];class Cd extends gd{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{type:t="container"}=e;super(t),this.set(e),this._boundingRect={}}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(e);const t=this.attrs;let n="";for(let i=0,r=Rd.length;i!==r;i++)n=Rd[i],void 0!==e[n]&&(t[n]=e[n])}addChild(e){return Sd.addChild.call(this,e)}addChildren(e){return Sd.addChildren.call(this,e)}removeChild(e){e._stage=null;let t,n=e.descendants,i=n?n.length:0;for(t=0;t<i;t++)n[t]._stage=null;return Sd.removeChild.call(this,e),this}removeChildren(e){return Sd.removeChildren.call(this,e),this}}class Nd extends gd{constructor(){super("rect"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{x:t=0,y:n=0,width:i=0,height:r=0,rx:o=0,ry:a=0,collider:s}=e,l=u({type:"rect",x:t,y:n,width:i,height:r},s);super.set(e),i>=0?(this.attrs.x=t,this.attrs.width=i):(this.attrs.x=t+i,this.attrs.width=-i),r>=0?(this.attrs.y=n,this.attrs.height=r):(this.attrs.y=n+r,this.attrs.height=-r),o>0&&(this.attrs.rx=o),a>0&&(this.attrs.ry=a),this.collider=l,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=b(this.attrs),n=e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(t):t,[i,r,o,a]=v(n);return this.__boundingRect[e]={x:i,y:r,width:o-i,height:a-r},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}class Dd extends gd{constructor(){super("circle"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{cx:t=0,cy:n=0,r:i=0,collider:r}=e,o=u({type:"circle",cx:t,cy:n,r:i},r);super.set(e),this.attrs.cx=t,this.attrs.cy=n,this.attrs.r=i,this.collider=o,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=this.bounds(e);return this.__boundingRect[e]={x:t[0].x,y:t[0].y,width:t[2].x-t[0].x,height:t[2].y-t[0].y},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const{cx:t,cy:n,r:i,r:r}=this.attrs,o=t-i,a=n-r;let s=2*i,l=2*r,c=[{x:o,y:a},{x:o+s,y:a},{x:o+s,y:a+l},{x:o,y:a+l}];if(e&&this.modelViewMatrix){c=this.modelViewMatrix.transformPoints(c);const[t,n,i,r]=v(c);s=i-t,l=r-n,this.__bounds[e]=[{x:t,y:n},{x:t+s,y:n},{x:t+s,y:n+l},{x:t,y:n+l}]}else this.__bounds[e]=c;return this.__bounds[e]}}class qd extends gd{constructor(){super("line"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{x1:t=0,y1:n=0,x2:i=0,y2:r=0,collider:o}=e;super.set(e),this.attrs.x1=t,this.attrs.y1=n,this.attrs.x2=i,this.attrs.y2=r;const a={type:"line",x1:t,y1:n,x2:i,y2:r};this.collider=u(a,o),this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];let t=x(this.attrs);e&&this.modelViewMatrix&&(t=this.modelViewMatrix.transformPoints(t));const[n,i,r,o]=v(t),a=n!==r||i!==o;return this.__boundingRect[e]={x:n,y:i,width:a?Math.max(1,r-n):0,height:a?Math.max(1,o-i):0},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}const Ed=Math.PI/2;function Od(e,t){const n=Math.atan2(t.y-e.y,t.x-e.x);return n<0?n+2*Math.PI:n}function zd(e,t,n){return{x:e.x+Math.cos(t)*n,y:e.y+Math.sin(t)*n}}const Ad={step:function(e){return new we(e,.5)},stepAfter:function(e){return new we(e,1)},stepBefore:function(e){return new we(e,0)},linear:Z,basis:function(e){return new ae(e)},cardinal:ce.tension(0),catmullRom:he,monotonex:function(e){return new me(e)},monotoney:function(e){return new ye(e)},natural:function(e){return new xe(e)}};function Td(e){if(e.length<2)return!1;const t=e[0],n=e[e.length-1];return Math.abs(t.x-n.x)<1e-12&&Math.abs(t.y-n.y)<1e-12}class Id extends gd{constructor(){super("path"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(super.set(e),this.segments=[],this.points=[],e.arcDatum){const t=G();t.innerRadius(e.desc.slice.innerRadius),t.outerRadius(e.desc.slice.outerRadius),t.cornerRadius(e.desc.slice.cornerRadius);const n=t(e.arcDatum);this.attrs.d=n}else if(e.points){const{major:t,minor:n,layerObj:i,points:r,stngs:o,generatorType:a}=e,s=te(),l=o.coordinates?o.coordinates.defined:null;s[t.p]((e=>e.major*t.size))["".concat(n.p,"1")]((e=>e.minor*n.size))["".concat(n.p,"0")]((e=>e.minor0*n.size)).curve(Ad["monotone"===i.curve?"monotone".concat(t.p):i.curve]),l?s.defined((e=>!e.dummy&&"number"==typeof e.minor&&!isNaN(e.minor)&&e.defined)):s.defined((e=>!e.dummy&&"number"==typeof e.minor&&!isNaN(e.minor)));const c=o.connect?r.filter(s.defined()):r,u=("area"===a?s:s[a]())(c);this.attrs.d=u}else e.d&&(this.attrs.d=e.d);if(this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null},Array.isArray(e.collider)||"object"==typeof e.collider&&void 0!==e.collider.type)this.collider=e.collider;else if(this.attrs.d){if(this.segments=Dh(this.attrs.d),this.segments.length>1&&this.segments.every((e=>Td(e))))return void(this.collider=u({type:"geopolygon",vertices:this.segments},e.collider));this.segments.forEach((t=>{if(t.length<=1);else if(Td(t))this.collider=u({type:"polygon",vertices:t},e.collider);else if("object"==typeof e.collider&&e.collider.visual){const n=this.attrs["stroke-width"]/2;this.collider=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=[],r=[];if("h"===n.forceOrientation){const t=e[0].x<e[1].x?-1:1,n=e[e.length-1].x>e[e.length-2].x?1:-1;e.unshift({x:e[0].x+t,y:e[0].y}),e.push({x:e[e.length-1].x+n,y:e[e.length-1].y})}else if("v"===n.forceOrientation){const t=e[0].y<e[1].y?-1:1,n=e[e.length-1].y>e[e.length-2].y?1:-1;e.unshift({x:e[0].x,y:e[0].y+t}),e.push({x:e[e.length-1].x,y:e[e.length-1].y+n})}const o=e.length-1;for(let n=1;n<o;n++){const a=e[n-1],s=e[n],l=e[n+1],c=Od(s,a),u=Od(s,l),h=(c+u)/2,d=h+Math.PI,f=Math.max(h,d),p=Math.min(h,d),g=c>u;if(1===n){const e=Od(a,s);i.push(zd(a,e-Ed,t)),r.unshift(zd(a,e+Ed,t))}const m=g?f:p,y=g?p:f;if(i.push(zd(s,m,t)),r.unshift(zd(s,y,t)),n===o-1){const e=Od(l,s);i.push(zd(l,e+Ed,t)),r.unshift(zd(l,e-Ed,t))}}return{type:"polygon",vertices:[...i,...r]}}(t,n,e.collider)}else this.collider=u({type:"polyline",points:t},e.collider)}))}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];this.points.length||(this.segments=this.segments.length?this.segments:Dh(this.attrs.d),this.points=function(e){const t=[];let n,i=e.length;for(let r=0;r<i;r++){n=e[r];for(let e=0;e<n.length;e++)t.push(n[e])}return t}(this.segments));const t=e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(this.points):this.points,[n,i,r,o]=v(t);return this.__boundingRect[e]={x:n||0,y:i||0,width:r-n||0,height:o-i||0},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}function jd(e){let{data:t,_boundingRect:n,_textBoundsFn:i}=e;return null!=t&&(n||i)}class Pd extends gd{constructor(){super("text"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{x:t=0,y:n=0,dx:i=0,dy:r=0,textBoundsFn:o,text:a,title:s,collider:l,boundingRect:c,ellipsed:h}=e;super.set(e),this.attrs.x=t,this.attrs.y=n,this.attrs.dx=i,this.attrs.dy=r,this.attrs.text=a,void 0!==s&&(this.attrs.title=String(s)),"object"==typeof c?this._textBoundsFn=()=>c:"function"==typeof o&&(this._textBoundsFn=o),"string"==typeof h&&(this.ellipsed=h),this.collider=u({type:jd(this)?"bounds":null},l),this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[t])return this.__boundingRect[t];if("function"!=typeof this._textBoundsFn)return{x:0,y:0,width:0,height:0};e=this._textBoundsFn(this.attrs);const n=b(e),i=t&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(n):n,[r,o,a,s]=v(i);return this.__boundingRect[t]={x:r,y:o,width:a-r,height:s-o},this.__boundingRect[t]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}const Fd=Ce();function Ld(e,t){return Fd.get(e)(t)}Fd.add("rect",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Nd(...t)})),Fd.add("circle",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Dd(...t)})),Fd.add("text",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Pd(...t)})),Fd.add("line",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new qd(...t)})),Fd.add("path",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Id(...t)})),Fd.add("stage",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new bd(...t)})),Fd.add("container",xd),Fd.add("defs",xd),Fd.add("linearGradient",Md),Fd.add("radialGradient",Md),Fd.add("conicGradient",Md),Fd.add("stop",Md),Fd.add("pattern",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Cd(...t)}));const $d=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=[{}];function n(){return t[t.length-1]}return n.save=function(){let i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=n(),o={};let a="";for(let t=0;t<e.length;t++)a=e[t],void 0!==r[a]&&(o[a]=r[a]);return u(o,i),t.push(o),n()},n.restore=function(){t.splice(t.length-1,1)},n}(["stroke","fill","strokeWidth","opacity","fontFamily","fontSize","baseline"]);function Bd(e,t){if(Array.isArray(t))for(let n=0,i=t.length;n<i;n++)t[n](e)}function Hd(e,t,n){e.node=n[t],e.index=t}function Wd(e,t,n,i){let r=!1;const o={siblings:e,node:null,index:0};for(let a=0,s=e.length;a<s;a++){if(Hd(o,a,e),Bd(o,i.create),r="function"==typeof o.node.disabled?o.node.disabled():o.node.disabled,r)continue;o.node=$d.save(o.node);const s=Ld(o.node.type,o.node);s&&(o.node.transform&&(n.save(),Zh(o.node.transform,n)),n.isIdentity()||(s.modelViewMatrix=n.clone()),t.addChild(s),o.node.children&&Wd(o.node.children,s,n,i),o.node.transform&&n.restore()),$d.restore()}}function Vd(e){let{items:t,stage:n,dpi:i,on:r={}}=e;return n||(n=Ld("stage",i)),Wd(t,n,new Uh,r),n}function Ud(e,t,n){const{orientation:i,degree:r,stops:o=[]}=n;let a=null;if("radial"===i){const n=t.boundingRect();a=e.createRadialGradient(n.x+n.width/2,n.y+n.height/2,1e-5,n.x+n.width/2,n.y+n.height/2,Math.max(n.width,n.height)/2)}else if("conic"===i){const t=n.startAngle||0,i=n.x||0,r=n.y||0;a=e.createConicGradient(t,i,r)}else{const i=Ko(r);["x1","x2","y1","y2"].forEach((e=>{e in n&&(i[e]=n[e])}));const o=t.boundingRect();a=e.createLinearGradient(o.x+i.x1*o.width,o.y+i.y1*o.height,o.x+i.x2*o.width,o.y+i.y2*o.height)}for(let e=0,t=o.length;e<t;e++){let t=o[e];a.addColorStop(t.offset,t.color)}return a}function Yd(e,t,n){return t.width=e.width,t.height=e.height,n.save(),n.fillStyle=e.fill,e.shapes.forEach((e=>{if("rect"===e.type)n.rect(e.x,e.y,e.width,e.height)})),n.fill(),n.restore(),n.createPattern(t,"repeat")}function Kd(){let{x:e,y:t,width:n,height:i,scaleRatio:r,margin:o,edgeBleed:a}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const s={x:0,y:0,width:0,height:0,scaleRatio:{x:1,y:1},margin:{left:0,top:0},edgeBleed:{left:0,right:0,top:0,bottom:0,bool:!1}};return s.x=isNaN(e)?s.x:e,s.y=isNaN(t)?s.y:t,s.width=isNaN(n)?s.width:n,s.height=isNaN(i)?s.height:i,void 0!==r&&(s.scaleRatio.x=isNaN(r.x)?s.scaleRatio.x:r.x,s.scaleRatio.y=isNaN(r.y)?s.scaleRatio.y:r.y),void 0!==o&&(s.margin.left=isNaN(o.left)?0:o.left,s.margin.top=isNaN(o.top)?0:o.top),"object"==typeof a&&["left","right","top","bottom"].forEach((e=>{!isNaN(a[e])&&a[e]>0&&(s.edgeBleed[e]=a[e],s.edgeBleed.bool=!0)})),s.computedPhysical={x:Math.round(s.margin.left+(s.x-s.edgeBleed.left)*s.scaleRatio.x),y:Math.round(s.margin.top+(s.y-s.edgeBleed.top)*s.scaleRatio.y),width:Math.round((s.width+s.edgeBleed.left+s.edgeBleed.right)*s.scaleRatio.x),height:Math.round((s.height+s.edgeBleed.top+s.edgeBleed.bottom)*s.scaleRatio.y)},s}function Xd(){const e={element:()=>{},root:()=>{},settings:()=>{},appendTo:()=>{},getScene:()=>[],render:()=>!1,itemsAt:()=>[],findShapes:()=>[],clear:()=>{},destory:()=>{},size:()=>{},measureText:wu,textBounds:_u,setKey:t=>{e.element().setAttribute("data-key",t)}};return e}function Gd(e){return t=>{let{node:n}=t;"text"===n.type&&function(e){return null!=e}(n.data)&&!n.textBoundsFn&&(n.textBoundsFn=e.textBounds)}}const Jd=200,Zd=200;class Qd{constructor(e){this.targetCanvas=e,this.bufferCanvas=e.cloneNode()}updateSize(e){let t,{rect:n,dpiRatio:i,canvasBufferSize:r}=e;t=r?"function"==typeof r?r(n):r:{width:n.computedPhysical.width+2*Jd,height:n.computedPhysical.height+2*Zd},this.bufferCanvas.style.width="".concat(t.width,"px"),this.bufferCanvas.style.height="".concat(t.height,"px"),this.bufferCanvas.width=Math.round(t.width*i),this.bufferCanvas.height=Math.round(t.height*i)}apply(){this.targetCanvas.getContext("2d").drawImage(this.bufferCanvas,0,0)}clear(){this.bufferCanvas.width=this.bufferCanvas.width}getContext(){return this.bufferCanvas.getContext("2d")}}const ef=Ce();function tf(e){return Array.isArray(e)?e:"string"==typeof e?-1!==e.indexOf(",")?e.split(","):e.split(" "):[]}function nf(e){return("undefined"==typeof window?1:window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)}function rf(e,t){t.setTransform(e[0][0],e[1][0],e[0][1],e[1][1],e[0][2],e[1][2])}function of(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const r=Object.keys(i);for(let r=0,o=n.length;r<o;r++){let o=n[r];const a=o[0],s=o[1],l=o[2];if(a in t.attrs&&!(s in i)&&e[s]!==t.attrs[a]){const n=l?l(t.attrs[a]):t.attrs[a];"function"==typeof e[s]?e[s](n):e[s]=n}}for(let t=0,n=r.length;t<n;t++){const n=r[t];e[n]=i[n]}}function af(e,t,n,i){for(let r=0,o=e.length;r<o;r++){let o=e[r],a={};t.save(),o.attrs&&(o.attrs.fill||o.attrs.stroke)&&(o.attrs.fill&&"object"==typeof o.attrs.fill&&"gradient"===o.attrs.fill.type?a.fillStyle=Ud(t,o,o.attrs.fill):o.attrs.fill&&"object"==typeof o.attrs.fill&&"pattern"===o.attrs.fill.type&&(a.fillStyle=i.patterns.create(o.attrs.fill)),o.attrs.stroke&&"object"==typeof o.attrs.stroke&&"gradient"===o.attrs.stroke.type?a.strokeStyle=Ud(t,o,o.attrs.stroke):o.attrs.stroke&&"object"==typeof o.attrs.stroke&&"pattern"===o.attrs.stroke.type&&(a.strokeStyle=i.patterns.create(o.attrs.stroke))),of(t,o,n,a),o.modelViewMatrix&&rf(o.modelViewMatrix.elements,t),ef.has(o.type)&&ef.get(o.type)(o.attrs,{g:t,doFill:"fill"in o.attrs&&"none"!==o.attrs.fill,doStroke:"stroke"in o.attrs&&0!==o.attrs["stroke-width"],ellipsed:o.ellipsed}),o.children&&af(o.children,t,n,i),t.restore()}}function sf(){let e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Vd;const i={transform:void 0,canvasBufferSize:void 0,progressive:void 0};let r,o=!1,a=Kd();const s=[["fill","fillStyle"],["stroke","strokeStyle"],["opacity","globalAlpha"],["globalAlpha","globalAlpha"],["stroke-width","lineWidth"],["stroke-linejoin","lineJoin"],["stroke-dasharray","setLineDash",tf]];let l;const c=Xd();return c.element=()=>e,c.root=()=>e,c.settings=e=>(e&&Object.keys(i).forEach((t=>{void 0!==e[t]&&(i[t]=e[t])})),i),c.appendTo=n=>(e||(e=n.ownerDocument.createElement("canvas"),e.style.position="absolute",e.style["-webkit-font-smoothing"]="antialiased",e.style["-moz-osx-font-smoothing"]="antialiased",e.style.pointerEvents="none"),"function"!=typeof i.transform||t||(t=new Qd(e)),n.appendChild(e),e),c.getScene=i=>{const r=nf(t&&t.getContext()||e.getContext("2d")),o=a.scaleRatio.x,s=a.scaleRatio.y,l={type:"container",children:i,transform:a.edgeBleed.bool?"translate(".concat(a.edgeBleed.left*r*o,", ").concat(a.edgeBleed.top*r*s,")"):""};return 1===r&&1===o&&1===s||(l.transform+="scale(".concat(r*o,", ").concat(r*s,")")),n({items:[l],dpi:r,on:{create:[hu(c.measureText),Gd(c)]}})},c.render=n=>{if(!e)return!1;l||(l=function(e){const t=e.createElement("canvas"),n=t.getContext("2d");let i={};return{create(e){const r=e.key;return r?(i[r]=i[r]||Yd(e,t,n),i[r]):Yd(e,t,n)},clear(){i={}}}}(e.ownerDocument));const u=t&&t.getContext()||e.getContext("2d"),h=nf(u),d=t&&i.transform();if(d)return e.width=e.width,function(e){let{el:t,dpiRatio:n,transform:i}=e;if("object"==typeof i){const e=[i.horizontalScaling,i.horizontalSkewing,i.verticalSkewing,i.verticalScaling,i.horizontalMoving*n,i.verticalMoving*n];t.getContext("2d").setTransform(...e)}}({el:e,dpiRatio:h,transform:d}),t.apply(),!0;o&&(e.style.left="".concat(a.computedPhysical.x,"px"),e.style.top="".concat(a.computedPhysical.y,"px"),e.style.width="".concat(a.computedPhysical.width,"px"),e.style.height="".concat(a.computedPhysical.height,"px"),e.width=Math.round(a.computedPhysical.width*h),e.height=Math.round(a.computedPhysical.height*h),t&&t.updateSize({rect:a,dpiRatio:h,canvasBufferSize:i.canvasBufferSize}));const f=c.getScene(n),p=!r||!f.equals(r);l.clear();const g=o||p,m="function"==typeof i.progressive&&i.progressive();return g&&(m&&!m.isFirst||c.clear(),af(f.children,u,s,{patterns:l})),t&&(e.width=e.width,t.apply()),o=!1,m&&!m.isFirst&&f.children.unshift(...r.children),r=f,g},c.itemsAt=e=>r?r.getItemsFrom(e):[],c.findShapes=e=>r?r.findShapes(e):[],c.clear=()=>(e&&(e.width=e.width),t&&t.clear(),r=null,c),c.size=e=>{if(e){const t=Kd(e);JSON.stringify(a)!==JSON.stringify(t)&&(o=!0,a=t)}return a},c.destroy=()=>{e&&(e.parentElement&&e.parentElement.removeChild(e),e=null),t&&(t=null),r=null},c}function lf(e,t){ef.add(e,t)}function cf(e,t){return Math.max(0,Math.min(e,t))}const uf=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),hf=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞יִײַ-ﬨשׁ-ﭏ]"),df=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]");function ff(e){return uf.test(e)}function pf(e){return hf.test(e)||df.test(e)}function gf(e){let t,n,i=e?e.length:0;for(t=0;t<i;t++){if(n=e[t],ff(n))return"ltr";if(pf(n))return"rtl"}return"ltr"}const mf={start:"end",end:"start",center:"center",middle:"middle"};function yf(e,t){return"rtl"===t?mf[e]:e}function vf(e,t){const n=[];let i;const r=[],o=[],a=[];let s,l;const c=e=>e.id,u=(e,t)=>{let n;return n="object"==typeof e?"id"in e?e.id:t:e,{content:e,id:"".concat(n,"__").concat(e.type||"")}};e.isTree||(e=e.map(u)),t=t.map(u),s=e.map(c),l=t.map(c);for(let e=0,i=t.length;e<i;e++){-1===s.indexOf(t[e].id)?n.push(t[e]):o.push(t[e])}for(let t=0,n=e.length;t<n;t++){-1===l.indexOf(e[t].id)?r.push(e[t]):a.push(e[t])}for(let e=0,t=n.length;e<t;e++)n[e].content.children&&(n[e].diff=vf([],n[e].content.children),n[e].children=n[e].diff.updatedNew.concat(n[e].diff.added),n[e].children.isTree=!0);for(let e=0,t=o.length;e<t;e++)o[e].diff=vf(a[e].children||[],o[e].content.children||[]),o[e].object=a[e].object,o[e].children=o[e].diff.items;return i=o.concat(n),n.isTree=!0,r.isTree=!0,o.isTree=!0,a.isTree=!0,i.isTree=!0,{added:n,updatedNew:o,updatedOld:a,removed:r,items:i}}function xf(e,t,n){for(let i=0,r=e.length;i<r;i++)e[i].object=n(e[i].content.type,t)}function bf(e,t){for(let n=0,i=e.length;n<i;n++)null!==e[n].object&&void 0!==e[n].object&&(t(e[n].object),e[n].object=null)}function wf(e,t,n,i){let r;for(let o=0,a=e.length;o<a;o++)r=e[o],null!==r.object&&void 0!==r.object&&(n(r.object,r.content),r.diff&&(xf(r.diff.added,r.object,t),bf(r.diff.removed,i),wf(r.diff.items,t,n,i)))}function kf(e,t,n,i,r,o){const a=vf(e,t);return xf(a.added,n,i),bf(a.removed,o),wf(a.items,i,r,o),a.items}lf("rect",(function(e,t){let{g:n,doFill:i,doStroke:r}=t;n.beginPath(),e.rx>0||e.ry>0?function(e,t,n,i,r,o,a){o=cf(i/2,o>0?o:a),a=cf(r/2,a>0?a:o),e.moveTo(t,n+a),e.lineTo(t,n+r-a),e.quadraticCurveTo(t,n+r,t+o,n+r),e.lineTo(t+i-o,n+r),e.quadraticCurveTo(t+i,n+r,t+i,n+r-a),e.lineTo(t+i,n+a),e.quadraticCurveTo(t+i,n,t+i-o,n),e.lineTo(t+o,n),e.quadraticCurveTo(t,n,t,n+a)}(n,e.x,e.y,e.width,e.height,e.rx,e.ry):n.rect(e.x,e.y,e.width,e.height),i&&n.fill(),r&&n.stroke()})),lf("circle",(function(e,t){let{g:n,doFill:i,doStroke:r}=t;n.beginPath(),n.moveTo(e.cx+e.r,e.cy),n.arc(e.cx,e.cy,e.r,0,2*Math.PI,!1),i&&n.fill(),r&&n.stroke()})),lf("line",(function(e,t){let{g:n,doStroke:i}=t;n.beginPath(),n.moveTo(e.x1,e.y1),n.lineTo(e.x2,e.y2),i&&n.stroke()})),lf("path",(function(e,t){let{g:n,doStroke:i,doFill:r}=t;const o=new Path2D(e.d);r&&n.fill(o),i&&n.stroke(o)})),lf("text",(function(e,t){let{g:n,ellipsed:i,doStroke:r}=t;const o=i||du(e,wu);n.font=[e["font-style"],e["font-weight"],e["font-size"],e["font-family"]].filter((e=>!!e)).join(" ");const a=gf(e.text);n.canvas.dir!==a&&(n.canvas.dir=a);const s=yf("middle"===e["text-anchor"]?"center":e["text-anchor"],n.canvas.dir);s&&n.textAlign!==s&&(n.textAlign=s);const l=fu(e);n.fillText(o,e.x+e.dx,e.y+e.dy+l),r&&n.strokeText(o,e.x+e.dx,e.y+e.dy+l)}));const _f="http://www.w3.org/2000/svg",Mf=(e,t)=>{if(!e||"string"!=typeof e)throw new Error("Invalid type: ".concat(e));const n=t.ownerDocument.createElementNS(_f,"container"===e?"g":e);return t.appendChild(n),n},Sf=e=>{e.parentNode&&e.parentNode.removeChild(e)},Rf=(e,t)=>{if((e=>{switch(e.type){case"circle":return!isNaN(e.attrs.cx)&&!isNaN(e.attrs.cy)&&!isNaN(e.attrs.r);case"line":return!(isNaN(e.attrs.x1)||isNaN(e.attrs.y1)||isNaN(e.attrs.x2)||isNaN(e.attrs.y2));case"rect":return!(isNaN(e.attrs.x)||isNaN(e.attrs.y)||isNaN(e.attrs.width)||isNaN(e.attrs.height));case"text":return!isNaN(e.attrs.x)&&!isNaN(e.attrs.y);default:return!0}})(t)){for(const n in t.attrs)if("stroke"===n&&t.strokeReference)e.setAttribute("stroke",t.strokeReference);else if("fill"===n&&t.fillReference)e.setAttribute("fill",t.fillReference);else if("text"===n){e.setAttribute("style","white-space: pre"),e.textContent=t.ellipsed||du(t.attrs,wu);const n=gf(t.attrs.text);"rtl"===n&&(e.setAttribute("direction","rtl"),e.setAttribute("dir","rtl"),e.setAttribute("text-anchor",yf(e.getAttribute("text-anchor"),n)))}else if("text"!==t.type||"dy"!==n&&"dominant-baseline"!==n)if("text"===t.type&&"title"===n&&t.attrs.title){const n=e.ownerDocument.createElementNS(_f,"title");n.textContent=t.attrs.title,e.appendChild(n)}else e.setAttribute(n,t.attrs[n]);else{const i=+e.getAttribute(n)||0;let r=0;r="dominant-baseline"===n?fu(t.attrs):t.attrs[n],e.setAttribute("dy",r+i)}if("string"==typeof t.data||"number"==typeof t.data||"boolean"==typeof t.data)e.setAttribute("data",t.data);else if("object"==typeof t.data&&null!==t.data)for(const n in t.data)"string"!=typeof t.data[n]&&"number"!=typeof t.data[n]&&"boolean"!=typeof t.data[n]||e.setAttribute("data-".concat(n),t.data[n])}};class Cf{constructor(e,t,n,i){this.create=e,this.nodeCreator=t,this.nodeMaintainer=n,this.nodeDestroyer=i}render(e,t){return this.create([],e,t,this.nodeCreator,this.nodeMaintainer,this.nodeDestroyer)}}function Nf(){return new Cf(kf,Mf,Rf,Sf)}function Df(e){let t,n,i,r=0;if(0===(e=JSON.stringify(e)).length)return r;for(t=0,i=e.length;t<i;t++)n=e.charCodeAt(t),r=(r<<5)-r+n,r&=r;return r}function qf(){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_f,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Vd;const n=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:Nf)();let i,r,o,a=!1,s=Kd();const l={transform:void 0,disableScreenReader:!1},c=Xd(),u={type:"defs",children:[]},h=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Df,n={},i=Date.now();const r={onCreate(r){let o={};r.node&&"object"==typeof r.node.fill&&"pattern"===r.node.fill.type&&r.node.fill.shapes&&(o.fill=r.node.fill),r.node&&"object"==typeof r.node.stroke&&"pattern"===r.node.stroke.type&&r.node.stroke.shapes&&(o.stroke=r.node.stroke),Object.keys(o).forEach((a=>{let s="";const l=o[a],c=t(l),u="picasso-pattern-".concat(i,"-").concat(c);if("undefined"!=typeof window&&(s=window.location.href.split("#")[0]),!n[c]){const t={patternUnits:"userSpaceOnUse",x:0,y:0,width:l.width,height:l.height,type:"pattern",id:u,children:[],fill:l.fill};l.shapes.forEach((e=>{t.children.push(e)})),e.push(t),n[c]=!0}r.node["".concat(a,"Reference")]="url('".concat(s,"#").concat(u,"')")}))},clear(){n={}}};return r}(u.children),d=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Df,n={},i=Date.now();const r={getOrCreateGradient(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"fill",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",s=t(r[o]),l="picasso-gradient-".concat(i,"-").concat(s);if(!n[s]){let{orientation:t,degree:i,stops:a=[]}=r[o],c={};void 0===i&&(i=90),"radial"===t?c.type="radialGradient":(c=Ko(i),["x1","x2","y1","y2"].forEach((e=>{e in r[o]&&(c[e]=r[o][e])})),c.type="linearGradient"),c.id=l,c.children=a.map((e=>{let{offset:t,color:n,opacity:i}=e;return{type:"stop",offset:"".concat(100*t,"%"),style:"stop-color:".concat(n,";stop-opacity:").concat(void 0!==i?i:1)}})),e.push(c),n[s]=l}return"url('".concat(a,"#").concat(l,"')")},onCreate(e){let t="";"undefined"!=typeof window&&(t=window.location.href.split("#")[0]);const n=e.node;n.fill&&"object"==typeof n.fill&&"gradient"===n.fill.type&&(n.fillReference=r.getOrCreateGradient(n,"fill",t)),n.stroke&&"object"==typeof n.stroke&&"gradient"===n.stroke.type&&(n.strokeReference=r.getOrCreateGradient(n,"stroke",t))},clear(){n={}}};return r}(u.children);return c.element=()=>i,c.root=()=>r,c.settings=e=>(e&&Object.keys(l).forEach((t=>{void 0!==e[t]&&(l[t]=e[t])})),l),c.appendTo=t=>(i||(i=t.ownerDocument.createElementNS(e,"svg"),i.style.position="absolute",i.style["-webkit-font-smoothing"]="antialiased",i.style["-moz-osx-font-smoothing"]="antialiased",i.style.pointerEvents="none",i.setAttribute("xmlns",e),r=t.ownerDocument.createElementNS(e,"g"),r.style.pointerEvents="auto",i.appendChild(r)),t.appendChild(i),i),c.getScene=e=>{const n=s.scaleRatio.x,i=s.scaleRatio.y,r={type:"container",children:Array.isArray(e)?[...e,u]:e,transform:s.edgeBleed.bool?"translate(".concat(s.edgeBleed.left*n,", ").concat(s.edgeBleed.top*i,")"):""};return 1===n&&1===i||(r.transform+="scale(".concat(n,", ").concat(i,")")),t({items:[r],on:{create:[e=>{e.node.fillReference=void 0,e.node.strokeReference=void 0},d.onCreate,h.onCreate,hu(c.measureText),Gd(c)]}})},c.render=e=>{if(!i)return!1;const t="function"==typeof l.transform&&l.transform();if(t){const{horizontalScaling:e,horizontalSkewing:n,verticalSkewing:i,verticalScaling:o,horizontalMoving:a,verticalMoving:s}=t;return r.style.transform="matrix(".concat(e,", ").concat(n,", ").concat(i,", ").concat(o,", ").concat(a,", ").concat(s,")"),!0}r.style.transform="";l.disableScreenReader&&i.setAttribute("aria-hidden",!0),a&&(i.style.left="".concat(s.computedPhysical.x,"px"),i.style.top="".concat(s.computedPhysical.y,"px"),i.setAttribute("width",s.computedPhysical.width),i.setAttribute("height",s.computedPhysical.height)),d.clear(),h.clear(),u.children.length=0;const f=c.getScene(e),p=!o||!f.equals(o),g=a||p;return g&&(c.clear(),n.render(f.children,r)),a=!1,o=f,g},c.itemsAt=e=>o?o.getItemsFrom(e):[],c.findShapes=e=>o?o.findShapes(e):[],c.clear=()=>{if(!r)return c;o=null;const e=r.cloneNode(!1);return i.replaceChild(e,r),r=e,c},c.destroy=()=>{i&&i.parentNode&&i.parentNode.removeChild(i),i=null,r=null},c.size=e=>{if(e){const t=Kd(e);JSON.stringify(s)!==JSON.stringify(t)&&(a=!0,s=t)}return s},c}var Ef,Of,zf,Af,Tf,If,jf,Pf={},Ff=[],Lf=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function $f(e,t){for(var n in t)e[n]=t[n];return e}function Bf(e){var t=e.parentNode;t&&t.removeChild(e)}function Hf(e,t,n){var i,r,o,a={};for(o in t)"key"==o?i=t[o]:"ref"==o?r=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?Ef.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===a[o]&&(a[o]=e.defaultProps[o]);return Wf(e,a,i,r,null)}function Wf(e,t,n,i,r){var o={type:e,props:t,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==r?++zf:r};return null==r&&null!=Of.vnode&&Of.vnode(o),o}function Vf(e){return e.children}function Uf(e,t){this.props=e,this.context=t}function Yf(e,t){if(null==t)return e.__?Yf(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?Yf(e):null}function Kf(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return Kf(e)}}function Xf(e){(!e.__d&&(e.__d=!0)&&Af.push(e)&&!Gf.__r++||Tf!==Of.debounceRendering)&&((Tf=Of.debounceRendering)||If)(Gf)}function Gf(){var e,t,n,i,r,o,a,s;for(Af.sort(jf);e=Af.shift();)e.__d&&(t=Af.length,i=void 0,r=void 0,a=(o=(n=e).__v).__e,(s=n.__P)&&(i=[],(r=$f({},o)).__v=o.__v+1,op(s,o,r,n.__n,void 0!==s.ownerSVGElement,null!=o.__h?[a]:null,i,null==a?Yf(o):a,o.__h),ap(i,o),o.__e!=a&&Kf(o)),Af.length>t&&Af.sort(jf));Gf.__r=0}function Jf(e,t,n,i,r,o,a,s,l,c){var u,h,d,f,p,g,m,y=i&&i.__k||Ff,v=y.length;for(n.__k=[],u=0;u<t.length;u++)if(null!=(f=n.__k[u]=null==(f=t[u])||"boolean"==typeof f||"function"==typeof f?null:"string"==typeof f||"number"==typeof f||"bigint"==typeof f?Wf(null,f,null,null,f):Array.isArray(f)?Wf(Vf,{children:f},null,null,null):f.__b>0?Wf(f.type,f.props,f.key,f.ref?f.ref:null,f.__v):f)){if(f.__=n,f.__b=n.__b+1,null===(d=y[u])||d&&f.key==d.key&&f.type===d.type)y[u]=void 0;else for(h=0;h<v;h++){if((d=y[h])&&f.key==d.key&&f.type===d.type){y[h]=void 0;break}d=null}op(e,f,d=d||Pf,r,o,a,s,l,c),p=f.__e,(h=f.ref)&&d.ref!=h&&(m||(m=[]),d.ref&&m.push(d.ref,null,f),m.push(h,f.__c||p,f)),null!=p?(null==g&&(g=p),"function"==typeof f.type&&f.__k===d.__k?f.__d=l=Zf(f,l,e):l=Qf(e,f,d,y,p,l),"function"==typeof n.type&&(n.__d=l)):l&&d.__e==l&&l.parentNode!=e&&(l=Yf(d))}for(n.__e=g,u=v;u--;)null!=y[u]&&("function"==typeof n.type&&null!=y[u].__e&&y[u].__e==n.__d&&(n.__d=ep(i).nextSibling),cp(y[u],y[u]));if(m)for(u=0;u<m.length;u++)lp(m[u],m[++u],m[++u])}function Zf(e,t,n){for(var i,r=e.__k,o=0;r&&o<r.length;o++)(i=r[o])&&(i.__=e,t="function"==typeof i.type?Zf(i,t,n):Qf(n,i,i,r,i.__e,t));return t}function Qf(e,t,n,i,r,o){var a,s,l;if(void 0!==t.__d)a=t.__d,t.__d=void 0;else if(null==n||r!=o||null==r.parentNode)e:if(null==o||o.parentNode!==e)e.appendChild(r),a=null;else{for(s=o,l=0;(s=s.nextSibling)&&l<i.length;l+=1)if(s==r)break e;e.insertBefore(r,o),a=o}return void 0!==a?a:r.nextSibling}function ep(e){var t,n,i;if(null==e.type||"string"==typeof e.type)return e.__e;if(e.__k)for(t=e.__k.length-1;t>=0;t--)if((n=e.__k[t])&&(i=ep(n)))return i;return null}function tp(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||Lf.test(t)?n:n+"px"}function np(e,t,n,i,r){var o;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof i&&(e.style.cssText=i=""),i)for(t in i)n&&t in n||tp(e.style,t,"");if(n)for(t in n)i&&n[t]===i[t]||tp(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?i||e.addEventListener(t,o?rp:ip,o):e.removeEventListener(t,o?rp:ip,o);else if("dangerouslySetInnerHTML"!==t){if(r)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,n))}}function ip(e){return this.l[e.type+!1](Of.event?Of.event(e):e)}function rp(e){return this.l[e.type+!0](Of.event?Of.event(e):e)}function op(e,t,n,i,r,o,a,s,l){var c,u,h,d,f,p,g,m,y,v,x,b,w,k,_,M=t.type;if(void 0!==t.constructor)return null;null!=n.__h&&(l=n.__h,s=t.__e=n.__e,t.__h=null,o=[s]),(c=Of.__b)&&c(t);try{e:if("function"==typeof M){if(m=t.props,y=(c=M.contextType)&&i[c.__c],v=c?y?y.props.value:c.__:i,n.__c?g=(u=t.__c=n.__c).__=u.__E:("prototype"in M&&M.prototype.render?t.__c=u=new M(m,v):(t.__c=u=new Uf(m,v),u.constructor=M,u.render=up),y&&y.sub(u),u.props=m,u.state||(u.state={}),u.context=v,u.__n=i,h=u.__d=!0,u.__h=[],u._sb=[]),null==u.__s&&(u.__s=u.state),null!=M.getDerivedStateFromProps&&(u.__s==u.state&&(u.__s=$f({},u.__s)),$f(u.__s,M.getDerivedStateFromProps(m,u.__s))),d=u.props,f=u.state,u.__v=t,h)null==M.getDerivedStateFromProps&&null!=u.componentWillMount&&u.componentWillMount(),null!=u.componentDidMount&&u.__h.push(u.componentDidMount);else{if(null==M.getDerivedStateFromProps&&m!==d&&null!=u.componentWillReceiveProps&&u.componentWillReceiveProps(m,v),!u.__e&&null!=u.shouldComponentUpdate&&!1===u.shouldComponentUpdate(m,u.__s,v)||t.__v===n.__v){for(t.__v!==n.__v&&(u.props=m,u.state=u.__s,u.__d=!1),u.__e=!1,t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),x=0;x<u._sb.length;x++)u.__h.push(u._sb[x]);u._sb=[],u.__h.length&&a.push(u);break e}null!=u.componentWillUpdate&&u.componentWillUpdate(m,u.__s,v),null!=u.componentDidUpdate&&u.__h.push((function(){u.componentDidUpdate(d,f,p)}))}if(u.context=v,u.props=m,u.__P=e,b=Of.__r,w=0,"prototype"in M&&M.prototype.render){for(u.state=u.__s,u.__d=!1,b&&b(t),c=u.render(u.props,u.state,u.context),k=0;k<u._sb.length;k++)u.__h.push(u._sb[k]);u._sb=[]}else do{u.__d=!1,b&&b(t),c=u.render(u.props,u.state,u.context),u.state=u.__s}while(u.__d&&++w<25);u.state=u.__s,null!=u.getChildContext&&(i=$f($f({},i),u.getChildContext())),h||null==u.getSnapshotBeforeUpdate||(p=u.getSnapshotBeforeUpdate(d,f)),_=null!=c&&c.type===Vf&&null==c.key?c.props.children:c,Jf(e,Array.isArray(_)?_:[_],t,n,i,r,o,a,s,l),u.base=t.__e,t.__h=null,u.__h.length&&a.push(u),g&&(u.__E=u.__=null),u.__e=!1}else null==o&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=sp(n.__e,t,n,i,r,o,a,l);(c=Of.diffed)&&c(t)}catch(e){t.__v=null,(l||null!=o)&&(t.__e=s,t.__h=!!l,o[o.indexOf(s)]=null),Of.__e(e,t,n)}}function ap(e,t){Of.__c&&Of.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){Of.__e(e,t.__v)}}))}function sp(e,t,n,i,r,o,a,s){var l,c,u,h=n.props,d=t.props,f=t.type,p=0;if("svg"===f&&(r=!0),null!=o)for(;p<o.length;p++)if((l=o[p])&&"setAttribute"in l==!!f&&(f?l.localName===f:3===l.nodeType)){e=l,o[p]=null;break}if(null==e){if(null===f)return document.createTextNode(d);e=r?document.createElementNS("http://www.w3.org/2000/svg",f):document.createElement(f,d.is&&d),o=null,s=!1}if(null===f)h===d||s&&e.data===d||(e.data=d);else{if(o=o&&Ef.call(e.childNodes),c=(h=n.props||Pf).dangerouslySetInnerHTML,u=d.dangerouslySetInnerHTML,!s){if(null!=o)for(h={},p=0;p<e.attributes.length;p++)h[e.attributes[p].name]=e.attributes[p].value;(u||c)&&(u&&(c&&u.__html==c.__html||u.__html===e.innerHTML)||(e.innerHTML=u&&u.__html||""))}if(function(e,t,n,i,r){var o;for(o in n)"children"===o||"key"===o||o in t||np(e,o,null,n[o],i);for(o in t)r&&"function"!=typeof t[o]||"children"===o||"key"===o||"value"===o||"checked"===o||n[o]===t[o]||np(e,o,t[o],n[o],i)}(e,d,h,r,s),u)t.__k=[];else if(p=t.props.children,Jf(e,Array.isArray(p)?p:[p],t,n,i,r&&"foreignObject"!==f,o,a,o?o[0]:n.__k&&Yf(n,0),s),null!=o)for(p=o.length;p--;)null!=o[p]&&Bf(o[p]);s||("value"in d&&void 0!==(p=d.value)&&(p!==e.value||"progress"===f&&!p||"option"===f&&p!==h.value)&&np(e,"value",p,h.value,!1),"checked"in d&&void 0!==(p=d.checked)&&p!==e.checked&&np(e,"checked",p,h.checked,!1))}return e}function lp(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){Of.__e(e,n)}}function cp(e,t,n){var i,r;if(Of.unmount&&Of.unmount(e),(i=e.ref)&&(i.current&&i.current!==e.__e||lp(i,null,t)),null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){Of.__e(e,t)}i.base=i.__P=null,e.__c=void 0}if(i=e.__k)for(r=0;r<i.length;r++)i[r]&&cp(i[r],t,n||"function"!=typeof e.type);n||null==e.__e||Bf(e.__e),e.__=e.__e=e.__d=void 0}function up(e,t,n){return this.constructor(e,n)}function hp(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{createElement:t=document.createElement.bind(document)}=e;let n,i,r=Kd();const o={transform:void 0,disableScreenReader:!1},a=Xd();return a.element=()=>n,a.root=()=>n,a.settings=e=>(e&&Object.keys(o).forEach((t=>{void 0!==e[t]&&(o[t]=e[t])})),o),a.appendTo=e=>(n||(n=t("div"),n.style.position="absolute",n.style["-webkit-font-smoothing"]="antialiased",n.style["-moz-osx-font-smoothing"]="antialiased",n.style.pointerEvents="none"),e.appendChild(n),n),a.render=e=>{if(!n)return!1;const t="function"==typeof o.transform&&o.transform();if(t){const{horizontalScaling:e,horizontalSkewing:i,verticalSkewing:r,verticalScaling:o,horizontalMoving:a,verticalMoving:s}=t;return n.style.transform="matrix(".concat(e,", ").concat(i,", ").concat(r,", ").concat(o,", ").concat(a,", ").concat(s,")"),!0}n.style.transform="";let a;return o.disableScreenReader&&n.setAttribute("aria-hidden",!0),n.style.left="".concat(r.computedPhysical.x,"px"),n.style.top="".concat(r.computedPhysical.y,"px"),n.style.width="".concat(r.computedPhysical.width,"px"),n.style.height="".concat(r.computedPhysical.height,"px"),a=Array.isArray(e)?Hf("div",null,e):e,i=function(e,t,n){var i,r,o;Of.__&&Of.__(e,t),r=(i="function"==typeof n)?null:n&&n.__k||t.__k,o=[],op(t,e=(!i&&n||t).__k=Hf(Vf,null,[e]),r||Pf,Pf,void 0!==t.ownerSVGElement,!i&&n?[n]:r?null:t.firstChild?Ef.call(t.childNodes):null,o,!i&&n?n:r?r.__e:t.firstChild,i),ap(o,e)}(a,n,i),!0},a.renderArgs=[Hf],a.clear=()=>{if(n){let e=n.firstChild;for(;e;)n.removeChild(e),e=n.firstChild;i=null}return a},a.destroy=()=>{n&&n.parentElement&&n.parentElement.removeChild(n),n=null,i=null},a.size=e=>(e&&(r=Kd(e)),r),a}Ef=Ff.slice,Of={__e:function(e,t,n,i){for(var r,o,a;t=t.__;)if((r=t.__c)&&!r.__)try{if((o=r.constructor)&&null!=o.getDerivedStateFromError&&(r.setState(o.getDerivedStateFromError(e)),a=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(e,i||{}),a=r.__d),a)return r.__E=r}catch(t){e=t}throw e}},zf=0,Uf.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=$f({},this.state),"function"==typeof e&&(e=e($f({},n),this.props)),e&&$f(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),Xf(this))},Uf.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Xf(this))},Uf.prototype.render=Vf,Af=[],If="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,jf=function(e,t){return e.__v.__b-t.__v.__b},Gf.__r=0;var dp=[function(e){e.renderer("svg",qf)},function(e){e.renderer("canvas",sf)},function(e){e.renderer("dom",hp)}];const fp={OFF:0,ERROR:1,WARN:2,INFO:3,DEBUG:4};const pp=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=function(){let{level:e=fp.OFF,pipe:t=console}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e;const i={[fp.OFF]:()=>{},[fp.ERROR]:function(){return t.error(...arguments)},[fp.WARN]:function(){return t.warn(...arguments)},[fp.INFO]:function(){return t.info(...arguments)},[fp.DEBUG]:function(){return t.log(...arguments)}},r=function(e){if(e&&!(n<e)){for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];(i[e]||i[fp.DEBUG])(...r)}};return{log:r,error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r(fp.ERROR,...t)},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r(fp.WARN,...t)},info:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r(fp.INFO,...t)},debug:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r(fp.DEBUG,...t)},level:e=>("number"==typeof e&&(n=e),n),LOG_LEVEL:fp}}(t.logger),r={component:Ce(n.component,"component",i),data:Ce(n.data,"data",i),formatter:Ce(n.formatter,"formatter",i),interaction:Ce(n.interaction,"interaction",i),renderer:ms(n.renderer),scale:Ce(n.scale,"scale",i),symbol:Ce(n.symbol,"symbol",i),logger:i};function o(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e({palettes:t.palettes.concat(n.palettes||[]),style:u({},t.style,n.style),logger:n.logger||t.logger,renderer:n.renderer||t.renderer},r)}return t.renderer&&t.renderer.prio&&r.renderer.default(t.renderer.prio[0]),o.use=function(e){return function(e){e(arguments.length>2?arguments[2]:void 0,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r)},o.chart=e=>gs(e,{registries:r,logger:i,style:t.style,palettes:t.palettes}),o.config=()=>t,Object.keys(r).forEach((e=>{o[e]=r[e]})),o.version=h,o}({renderer:{prio:["svg","canvas"]},logger:{level:0},style:{"$font-family":"'Source Sans Pro', Arial, sans-serif","$font-size":"12px","$line-height":"16px","$font-size--l":"16px","$font-weight":"normal","$gray-100":"#ffffff","$gray-98":"#f9f9f9","$gray-95":"#f2f2f2","$gray-90":"#e6e6e6","$gray-35":"#595959","$gray-30":"#4d4d4d","$gray-25":"#404040","$gray-20":"#333333","$border-95":"rgba(255, 255, 255, 0.05)","$border-90":"rgba(255, 255, 255, 0.1)","$border-80":"rgba(255, 255, 255, 0.2)","$border-20":"rgba(0, 0, 0, 0.2)","$border-10":"rgba(0, 0, 0, 0.1)","$border-5":"rgba(0, 0, 0, 0.05)","$primary-blue":"#3F8AB3","$primary-green":"#6CB33F","$primary-red":"#DC423F","$primary-orange":"#EF960F","$spacing--s":4,$spacing:8,"$spacing--l":12,"$font-color":"$gray-35","$font-color--inverted":"$gray-90","$guide-color":"$gray-90","$guide-color--inverted":"$gray-35",$border:"$border-80","$border--inverted":"$border-10",$shape:{fill:"$primary-blue",strokeWidth:1,stroke:"$border"},"$shape-outline":{stroke:"$primary-blue",strokeWidth:2},"$shape-guide":{stroke:"$guide-color",strokeWidth:1},"$shape-guide--inverted":{"@extend":"$shape-guide",stroke:"$guide-color--inverted"},$label:{fontSize:"$font-size",fontFamily:"$font-family",fill:"$font-color"},"$label--inverted":{$extend:"$label",fill:"$font-color--inverted"},"$label-overlay":{fontSize:"$font-size--l",fontFamily:"$font-family",fill:"$gray-100",color:"$font-color",stroke:"$guide-color--inverted",strokeWidth:1,borderRadius:4},$title:{"@extend":"$label",fontSize:"$font-size--l",fontWeight:"$font-weight",stroke:"$guide-color--inverted",strokeWidth:0},"$guide-line":{strokeWidth:1,stroke:"$guide-color"},"$guide-line--minor":{strokeWidth:1,stroke:"$gray-95"},"$padding--s":{left:"$spacing--s",right:"$spacing--s",top:"$spacing--s",bottom:"$spacing--s"},$padding:{left:"$spacing",right:"$spacing",top:"$spacing",bottom:"$spacing"},"$selection-area-target":{fill:"$primary-green",strokeWidth:0,opacity:.2}},palettes:[{key:"categorical",colors:[["#a54343","#d76c6c","#ec983d","#ecc43d","#f9ec86","#cbe989","#70ba6e","#578b60","#79d69f","#26a0a7","#138185","#65d3da"]]},{key:"diverging",colors:[["#3d52a1","#3a89c9","#77b7e5","#b4ddf7","#e6f5fe","#ffe3aa","#f9bd7e","#ed875e","#d24d3e","#ae1c3e"]]},{key:"sequential",colors:[["rgb(180,221,212)","rgb(34, 83, 90)"]]}]},{component:ys,data:ks,formatter:Zn,interaction:_s,renderer:ms(),scale:Qr,symbol:aa});function gp(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t);if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function yp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?mp(Object(n),!0).forEach((function(t){gp(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Eh.forEach(pp.use),dp.forEach(pp.use),[].forEach(pp.use);var vp=Object.prototype.hasOwnProperty,xp=Object.prototype.toString,bp=Object.defineProperty,wp=Object.getOwnPropertyDescriptor,kp=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===xp.call(e)},_p=function(e){if(!e||"[object Object]"!==xp.call(e))return!1;var t,n=vp.call(e,"constructor"),i=e.constructor&&e.constructor.prototype&&vp.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!i)return!1;for(t in e);return void 0===t||vp.call(e,t)},Mp=function(e,t){bp&&"__proto__"===t.name?bp(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},Sp=function(e,t){if("__proto__"===t){if(!vp.call(e,t))return;if(wp)return wp(e,t).value}return e[t]},Rp=function e(){var t,n,i,r,o,a,s=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof s&&(u=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)i=Sp(s,n),s!==(r=Sp(t,n))&&(u&&r&&(_p(r)||(o=kp(r)))?(o?(o=!1,a=i&&kp(i)?i:[]):a=i&&_p(i)?i:{},Mp(s,{name:n,newValue:e(u,a,r)})):void 0!==r&&Mp(s,{name:n,newValue:r}));return s};function Cp(e,t,n,i){if(!e)return-1;const r=n.cache,o=e.origin?e.origin():null;o&&(e=o);let a=r.fields.indexOf(e),s=-1,l=-1;if(-1===a)for(let t=0;t<r.wrappedFields.length;t++)if(l=r.wrappedFields[t].attrDims.map((e=>e.instance)).indexOf(e),s=r.wrappedFields[t].attrExps.map((e=>e.instance)).indexOf(e),-1!==l||-1!==s){a=t;break}if(Array.isArray(i)&&i.some(((e,t)=>e!==t))){const e=i.indexOf(a);-1!==e&&(a=e)}return a-=t.qArea.qLeft,a<0||a>=t.qArea.qWidth?-1:l>=0?e=>e[a].qAttrDims.qValues[l]:s>=0?e=>e[a].qAttrExps.qValues[s]:e=>e[a]}function Np(e,t,n){let{key:i}=n;const r={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return r.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(r.value),e.field&&(r.source={key:i,field:e.field.key()}),r}function Dp(e){let{cache:t,f:n,mainCell:i,p:r,page:o,rowIdx:a,row:s,sourceKey:l,target:c,targetProp:u,columnOrder:h}=e,d=i;if(r.field&&r.field!==n){const e=Cp(r.field,o,{cache:t},h);if(-1===e)return;d=Rp({qRow:a},e(s))}c[u]=Np(r,d,{key:l})}function qp(e,t,n,i){const r=Array.isArray(e)?e:[e];let o=[];for(let e=0;e<r.length;e++)if(void 0!==r[e].field){const a=t.raw(),s=t.key(),l="object"==typeof r[e].field?r[e].field:t.field(r[e].field),{props:c,main:u}=i.normalizeConfig(r[e],t),h=Object.keys(c),d=!!r[e].trackBy,f=typeof r[e].trackBy,p={},g=[],m=[];for(let t=0;t<a.qDataPages.length;t++){const o=Cp(l,a.qDataPages[t],{cache:n},a.qColumnOrder);if(-1!==o)for(let y=0;y<a.qDataPages[t].qMatrix.length;y++){const v=a.qDataPages[t].qArea.qTop+y,x=Rp({qRow:v},o(a.qDataPages[t].qMatrix[y])),b=Np(u,x,{key:s});if(!(u.filter&&!u.filter(x))){for(let e=0;e<h.length;e++){const i=c[h[e]];let r=i.fields||[i];i.fields&&(b[h[e]]=[]);for(let o=0;o<r.length;o++)Dp({cache:n,f:l,mainCell:x,p:r[o],prop:h[e],page:a.qDataPages[t],rowIdx:v,row:a.qDataPages[t].qMatrix[y],sourceKey:s,target:i.fields?b[h[e]]:b,targetProp:i.fields?o:h[e],columnOrder:a.qColumnOrder});if(i.fields){const t=b[h[e]].map((e=>e.value)),n=b[h[e]].map((e=>e.label));b[h[e]]={value:"function"==typeof i.value?i.value(t):void 0!==i.value?i.value:t,label:"function"==typeof i.label?i.label(n):void 0!==i.label?String(i.label):String(b[h[e]].value)}}}d&&i.track({cfg:r[e],itemData:x,obj:b,target:g,tracker:p,trackType:f}),m.push(b)}}}const y=d?i.collect(g,{main:u,propsArr:h,props:c}):m;o=[...o,...y]}return o}function Ep(e){var t=0,n=e.children,i=n&&n.length;if(i)for(;--i>=0;)t+=n[i].value;else t=1;e.value=t}function Op(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=Ap)):void 0===t&&(t=zp);for(var n,i,r,o,a,s=new jp(e),l=[s];n=l.pop();)if((r=t(n.data))&&(a=(r=Array.from(r)).length))for(n.children=r,o=a-1;o>=0;--o)l.push(i=r[o]=new jp(r[o])),i.parent=n,i.depth=n.depth+1;return s.eachBefore(Ip)}function zp(e){return e.children}function Ap(e){return Array.isArray(e)?e[1]:null}function Tp(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function Ip(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function jp(e){this.data=e,this.depth=this.height=0,this.parent=null}function Pp(e){return null==e?null:function(e){if("function"!=typeof e)throw new Error;return e}(e)}jp.prototype=Op.prototype={constructor:jp,count:function(){return this.eachAfter(Ep)},each:function(e,t){let n=-1;for(const i of this)e.call(t,i,++n,this);return this},eachAfter:function(e,t){for(var n,i,r,o=this,a=[o],s=[],l=-1;o=a.pop();)if(s.push(o),n=o.children)for(i=0,r=n.length;i<r;++i)a.push(n[i]);for(;o=s.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,i,r=this,o=[r],a=-1;r=o.pop();)if(e.call(t,r,++a,this),n=r.children)for(i=n.length-1;i>=0;--i)o.push(n[i]);return this},find:function(e,t){let n=-1;for(const i of this)if(e.call(t,i,++n,this))return i},sum:function(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,i=t.children,r=i&&i.length;--r>=0;)n+=i[r].value;t.value=n}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,n=function(e,t){if(e===t)return e;var n=e.ancestors(),i=t.ancestors(),r=null;e=n.pop(),t=i.pop();for(;e===t;)r=e,e=n.pop(),t=i.pop();return r}(t,e),i=[t];t!==n;)t=t.parent,i.push(t);for(var r=i.length;e!==n;)i.splice(r,0,e),e=e.parent;return i},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t},copy:function(){return Op(this).eachBefore(Tp)},[Symbol.iterator]:function*(){var e,t,n,i,r=this,o=[r];do{for(e=o.reverse(),o=[];r=e.pop();)if(yield r,t=r.children)for(n=0,i=t.length;n<i;++n)o.push(t[n])}while(o.length)}};var Fp={depth:-1},Lp={},$p={};function Bp(e){return e.id}function Hp(e){return e.parentId}function Wp(){var e,t=Bp,n=Hp;function i(i){var r,o,a,s,l,c,u,h,d=Array.from(i),f=t,p=n,g=new Map;if(null!=e){const t=d.map(((t,n)=>function(e){e=`${e}`;let t=e.length;Up(e,t-1)&&!Up(e,t-2)&&(e=e.slice(0,-1));return"/"===e[0]?e:`/${e}`}(e(t,n,i)))),n=t.map(Vp),r=new Set(t).add("");for(const e of n)r.has(e)||(r.add(e),t.push(e),n.push(Vp(e)),d.push($p));f=(e,n)=>t[n],p=(e,t)=>n[t]}for(a=0,r=d.length;a<r;++a)o=d[a],c=d[a]=new jp(o),null!=(u=f(o,a,i))&&(u+="")&&(h=c.id=u,g.set(h,g.has(h)?Lp:c)),null!=(u=p(o,a,i))&&(u+="")&&(c.parent=u);for(a=0;a<r;++a)if(u=(c=d[a]).parent){if(!(l=g.get(u)))throw new Error("missing: "+u);if(l===Lp)throw new Error("ambiguous: "+u);l.children?l.children.push(c):l.children=[c],c.parent=l}else{if(s)throw new Error("multiple roots");s=c}if(!s)throw new Error("no root");if(null!=e){for(;s.data===$p&&1===s.children.length;)s=s.children[0],--r;for(let e=d.length-1;e>=0&&(c=d[e]).data===$p;--e)c.data=null}if(s.parent=Fp,s.eachBefore((function(e){e.depth=e.parent.depth+1,--r})).eachBefore(Ip),s.parent=null,r>0)throw new Error("cycle");return s}return i.id=function(e){return arguments.length?(t=Pp(e),i):t},i.parentId=function(e){return arguments.length?(n=Pp(e),i):n},i.path=function(t){return arguments.length?(e=Pp(t),i):e},i}function Vp(e){let t=e.length;if(t<2)return"";for(;--t>1&&!Up(e,t););return e.slice(0,t)}function Up(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(!(1&n))return!0}return!1}function Yp(e,t){"/"===e.charAt(0)&&(e=e.substring(1));const n=e.split("/");let i,r=t;for(let e=0;e<n.length;e++){if("*"===n[e]&&Array.isArray(r)){const t=[];i=n.slice(e+1).join("/");for(let e=0;e<r.length;e++){let n=Yp(i,r[e]);Array.isArray(n)?t.push(...n):t.push(n)}return t}if(!n[e]&&Array.isArray(r)){const t=new Array(r.length);i=n.slice(e+1).join("/");for(let e=0;e<r.length;e++)t[e]=Yp(i,r[e]);return t}n[e]in r&&(r=r[n[e]])}return r}function Kp(e,t,n){let i=[];if(!e||!e.length)return i;if(t<=0){const t=n>=0?[e[n]]:e;i=[...i,...t]}else for(let r=0;r<e.length;r++)e[r].children&&e[r].children.length&&(i=[...i,...Kp(e[r].children,t-1,n)]);return i}function Xp(e,t,n){if(e===t)return e=>e;if(e>t){const n=Math.max(0,Math.min(100,e-t));return e=>{let t=e;for(let e=0;e<n;++e)t=t.parent;return t}}if(t>e){const i=Math.max(0,Math.min(100,t-e));return e=>Kp(e.children,i-1,n)}return!1}const Gp=/^qDimensionInfo(?:\/(\d+))?/,Jp=/^\/?qMeasureInfo\/(\d+)/,Zp=/\/qAttrExprInfo\/(\d+)/,Qp=/\/qAttrDimInfo\/(\d+)/;function eg(e){const t=e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map(((e,t)=>t));return t.filter((t=>t<e.qDimensionInfo.length))}function tg(e,t){let{cube:n}=t;if(!e)return-1;let i=e.origin&&e.origin()?e.origin().key():e.key(),r=!1,o=-1,a=-1,s=-1,l=-1,c=-1,u=-1,h=i;const d=n.qEffectiveInterColumnSortOrder,f=eg(n);return Gp.test(h)&&(r=!0,o=+Gp.exec(h)[1],h=i.replace(Gp,"")),Jp.test(h)&&("K"===n.qMode?c=+Jp.exec(h)[1]:d&&-1!==d.indexOf(-1)?(c=+Jp.exec(h)[1],u=0):u=+Jp.exec(h)[1],h=h.replace(Jp,"")),h&&(Qp.exec(h)?s=+Qp.exec(h)[1]:Zp.exec(h)&&(a=+Zp.exec(h)[1])),l=r?"S"===n.qMode?f[o]:d?d.indexOf(o):o:d&&-1!==d.indexOf(-1)?d.indexOf(-1):n.qDimensionInfo.length-("K"===n.qMode?0:1),{fieldDepth:l+1,pseudoMeasureIndex:c,measureIdx:u,attrDimIdx:s,attrIdx:a}}function ng(e,t){let n,i,r=Xp(e.fieldDepth,t.fieldDepth,t.pseudoMeasureIndex);return n=t.measureIdx>=0?e=>e.data.qValues[t.measureIdx]:e=>e.data,t.attrDimIdx>=0?i=e=>{var n;return null==e||null===(n=e.qAttrDims)||void 0===n?void 0:n.qValues[t.attrDimIdx]}:t.attrIdx>=0&&(i=e=>{var n;return null==e||null===(n=e.qAttrExps)||void 0===n?void 0:n.qValues[t.attrIdx]}),{nodeFn:r,attrFn:i,valueFn:n}}function ig(e,t,n){let{key:i}=n;const r={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return r.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(r.value),e.field&&(r.source={key:i,field:e.field.key()}),r}function rg(e){let{propsArr:t,props:n,item:i,itemData:r,ret:o,sourceKey:a}=e;for(let e=0;e<t.length;e++){const s=n[t[e]],l=s.fields||[s];let c,u;s.fields&&(c=[],u=[]);for(let n=0;n<l.length;n++){const h=l[n];let d,f,p,g,m,y;if("primitive"===h.type?(p=h.value,y=String(h.value)):("function"==typeof h.value&&(d=e=>h.value(e,i)),"function"==typeof h.label&&(f=e=>h.label(e,i)),h.accessor?(g=h.accessor(i),Array.isArray(g)?(m=g.map(h.valueAccessor),h.attrAccessor&&(m=m.map(h.attrAccessor)),d&&(p=m.map(d),d=null),f&&(y=m.map(f),f=null),p=h.reduce?h.reduce(p):p,y=h.reduceLabel?h.reduceLabel(y,p):String(p)):(p=h.attrAccessor?h.attrAccessor(h.valueAccessor(g)):h.valueAccessor(g),y=p)):(p=r,y=r)),s.fields){const e=d?d(p):p;c.push(e),u.push(f&&null!=y?f(y):null!=y?y:String(e))}else{const n=d?d(p):p;o[t[e]]={value:n,label:f?f(y):null!=y?y:String(n)},h.field&&(o[t[e]].source={field:h.field.key(),key:a})}}c&&(o[t[e]]={value:"function"==typeof s.value?s.value(c,i):c,label:"function"==typeof s.label?s.label(u,i):u})}}const og=(e,t,n)=>{const i="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",r="K"===e.qMode?"qSubNodes":"qNodes",o=Yp(i,e);return o&&o[0]?(t.tree=Op(o[0],n.children||(e=>e[r])),t.tree):null};const ag=e=>{let{propsArr:t,props:n,cube:i,cache:r,itemDepthObject:o,f:a}=e;for(let e=0;e<t.length;e++){const r=n[t[e]],s=r.fields?r.fields:[r];for(let e=0;e<s.length;e++){const t=s[e];if(t.field!==a){const e=ng(o,tg(t.field,{cube:i}));t.accessor=e.nodeFn,t.valueAccessor=e.valueFn,t.attrAccessor=e.attrFn}}}};function sg(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;const r=t.raw(),o=t.key(),a="S"===r.qMode?function(e){const t=e.raw().qDataPages.length?e.raw().qDataPages[0].qMatrix:[],n=function(e){const t=e.raw().qColumnOrder,n=e.fields();return t&&t.length===n.length?t:n.map(((e,t)=>t))}(e),i=e.fields(),r=e.fields().filter((e=>"dimension"===e.type())).map((e=>n.indexOf(i.indexOf(e)))),o=e.fields().filter((e=>"measure"===e.type())).map((e=>n.indexOf(i.indexOf(e)))),a={__root:{__id:"__root",qValues:[]}};for(let e=0;e<t.length;e++){const n=t[e];let i="__root",l=!1;for(let e=0;e<r.length;e++){var s;const t=n[r[e]],o="".concat(i,"__").concat(null!==(s=t.qElemNumber)&&void 0!==s?s:t.qElemNo);a[o]||(a[o]=yp({__id:o,__parent:i,qValues:[]},t),l=!0),i=o}if(l)for(let e=0;e<o.length;e++){const t=n[o[e]];a[i].qValues.push(t)}}const l=Object.keys(a).map((e=>a[e]));return Wp().id((e=>e.__id)).parentId((e=>e.__parent))(l)}(t):og(r,n,e);if(!a)return null;const s=a.height,l=[];for(let o=0;o<=s;o++){let a=null;if(o>0)if("S"===r.qMode){let e=eg(r)[o-1];a=n.fields[e]}else{let e=r.qEffectiveInterColumnSortOrder[o-1];o>r.qEffectiveInterColumnSortOrder.length&&(e=r.qDimensionInfo.length),a=n.fields[e]}const{props:s,main:c}=i.normalizeConfig(yp(yp({},e),{},{field:a?a.key():void 0}),t),u=Object.keys(s);l[o]={propsArr:u,props:s,main:c};const h=a?tg(a,{cube:r}):{fieldDepth:0};ag({propsArr:u,props:s,cube:r,cache:n,itemDepthObject:h,f:a})}const c=a.copy().descendants(),u=a.descendants();for(let e=0;e<u.length;e++){const t=l[u[e].depth].propsArr,n=l[u[e].depth].props,i=l[u[e].depth].main,r=c[e],a=r.data,s=ig(i,a,{key:o});rg({propsArr:t,props:n,item:r,itemData:a,ret:s,sourceKey:o}),u[e].data=s}return a}function lg(e,t,n,i){const r=Array.isArray(e)?e:[e];let o=[];for(let a=0;a<r.length;a++)if(void 0!==r[a].field){const s=t.raw(),l=t.key();if(!og(s,n,e))continue;const c="object"==typeof r[a].field?r[a].field:t.field(r[a].field),{props:u,main:h}=i.normalizeConfig(r[a],t),d=Object.keys(u),f=tg(c,{cube:s}),{nodeFn:p,attrFn:g,valueFn:m}=ng({fieldDepth:0},f);ag({propsArr:d,props:u,cube:s,cache:n,itemDepthObject:f,f:c});const y=!!r[a].trackBy,v=typeof r[a].trackBy,x={},b=[],w=p(n.tree),k=[];for(let e=0;e<w.length;e++){const t=w[e],n=g?g(m(t)):m(t);if(h.filter&&!h.filter(n))continue;const o=ig(h,n,{key:l});rg({propsArr:d,props:u,item:t,itemData:n,ret:o,sourceKey:l}),y&&i.track({cfg:r[a],itemData:n,obj:o,target:b,tracker:x,trackType:v}),k.push(o)}const _=y?i.collect(b,{main:h,propsArr:d,props:u}):k;o=[...o,..._]}return o}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var cg=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e){
|
8
8
|
/*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
|
9
|
-
e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,i,r,o,a,s,l,c,u,h,d=e.length,f=e.search(/[0-9\-\+#]/),p=f>0?e.substring(0,f):"",g=e.split("").reverse().join(""),m=g.search(/[0-9\-\+#]/),y=d-m,v=e.substring(y,y+1),x=y+("."===v||","===v?1:0),b=m>0?e.substring(x,d):"";if(n=(t="-"===(e=e.substring(f,x)).charAt(0)?-t:+t)<0?t=-t:0,r=(i=e.match(/[^\d\-\+#]/g))&&i[i.length-1]||".",o=i&&i[1]&&i[0]||",",e=e.split(r),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=s)&&(t=(+t).toFixed(s+1)),u=e[0].split(o),e[0]=u.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-a;)c[0]="0"+c[0];else 0==+c[0]&&(c[0]="");if((t=t.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(g="",y=(h=t[0]).length%l,d=h.length,x=0;x<d;x++)g+=h.charAt(x),!((x-y+1)%l)&&x<d-l&&(g+=o);t[0]=g}return t[1]=e[1]&&t[1]?r+t[1]:"","0"!==(i=t.join(""))&&""!==i||(n=!1),p+(n?"-":"")+i+b}}));function ug(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const hg={3:"k",6:"M",9:"G",12:"T",15:"P",18:"E",21:"Z",24:"Y","-3":"m","-6":"μ","-9":"n","-12":"p","-15":"f","-18":"a","-21":"z","-24":"y"},dg=/%\)?$/,fg=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,pg=/^\(oct\)/i,gg=/^\(dec\)/i,mg=/^\(hex\)/i,yg=/^\(bin\)/i,vg=/^\(rom\)/i,xg=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,bg=/#|0/g;function wg(e,t,n,i){return e=e.toString(t),n[1]===n[1].toUpperCase()&&(e=e.toUpperCase()),e.length-e.indexOf(".")>10&&(e=e.slice(0,e.indexOf(".")+11)),e.replace(".",i||".")}function kg(e,t,n){let i;return fg.test(t)?e=wg(e,Number(/\d{2}/.exec(t)[0]),t,n):pg.test(t)?e=wg(e,8,t,n):gg.test(t)?e=wg(e,10,t,n):mg.test(t)?e=wg(e,16,t,n):yg.test(t)?e=wg(e,2,t,n):vg.test(t)&&(i="",e<0&&(i="-",e=-e),0===(e=Math.floor(e))?e="0":e<=5e5?(e=function(e,t){let n,i="",r=Number(String(e).slice(-3)),o=(e-r)/1e3,a=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),s=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();for(;r>0;)for(n=0;n<a.length;n++)if(a[n]<=r){i+=s[n],r-=a[n];break}for(n=0;n<o;n++)i="M".concat(i);return t[1]!==t[1].toUpperCase()&&(i=i.toLowerCase()),i}(e,t),e=i+e):e=t+i+e.toExponential(0)),e}function _g(e,t,n){const i=ug(e);return n?i:new RegExp(i||"",t)}function Mg(e,t,n,i){let r,o,a,s,l,c,u,h,d,f=e.pattern;var p,g;i&&(e.abbreviate=!0),p=t,(g=n)&&(g=ug(g)),p&&(p=ug(p)),d=new RegExp("(?:[#0]+".concat(p,")?[#0]+(?:").concat(g,"[#0]+)?")),a=f.match(d),a=a?a[0]:"",s=a?f.substr(0,f.indexOf(a)):f,l=a?f.substring(f.indexOf(a)+a.length):"",a||(a=f?"#":"##########"),t&&t===n&&(r=a.split(n),o=r.pop(),a=r.join("")+n+o,t=""),c=t,t=/,/.test(n)?"¤":",",c&&(a=a.replace(_g(c,"g"),t)),u=n,n=".",u&&(a=a.replace(_g(u,"g"),n)),h=a.match(/#/g),h=h?h.length:0;const m=f.split(u);let y;m[1]&&(y=m[1].match(bg)),e.prefix=s||"",e.postfix=l||"",e.pattern=f,e.maxPrecision=y?y.length:2,e.percentage=dg.test(f),e.numericPattern=a||"",e.numericRegex=new RegExp("".concat(_g(t,null,!0),"|").concat(_g(n,null,!0)),"g"),e.groupTemp=c,e.decTemp=u,e.t=t,e.d=n,e.temp=h}class Sg{constructor(e,t,n,i,r){this.localeInfo=e,this.pattern=t,this.thousandDelimiter=n||",",this.decimalDelimiter=i||".",this.type=r||"numeric",this.patternSeparator=";",this.abbreviations=function(e,t){if(!e||!e.qNumericalAbbreviation)return hg;const n={};return e.qNumericalAbbreviation.split(t).forEach((e=>{let t=e.split(":");2===t.length&&(n[t[0]]=t[1])})),n}(e,this.patternSeparator),this.prepare()}clone(){const e=new Sg(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return e.subtype=this.subtype,e}format(e,t,n,i){return this.prepare(t,n,i),this.formatValue(e)}prepare(e,t,n){let i;if(void 0===e&&(e=this.pattern),void 0===t&&(t=this.thousandDelimiter),void 0===n&&(n=this.decimalDelimiter),!e)return void(this._prepared={pattern:!1});this._prepared={positive:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},negative:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},zero:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""}},i=this._prepared,e=e.split(this.patternSeparator),i.positive.pattern=e[0],i.negative.pattern=e[1],i.zero.pattern=e[2],xg.test(e[0])&&(i.positive.isFunctional=!0),e[1]?xg.test(e[1])&&(i.negative.isFunctional=!0):i.negative=!1,e[2]?xg.test(e[2])&&(i.zero.isFunctional=!0):i.zero=!1;const r="U"===this.type;i.positive.isFunctional||Mg(i.positive,t,n,r),i.negative&&!i.negative.isFunctional&&Mg(i.negative,t,n,r),i.zero&&!i.zero.isFunctional&&Mg(i.zero,t,n,r)}formatValue(e){let t,n,i,r,o,a,s,l,c,u=this._prepared,h="",d="",f=e;if(isNaN(e))return"".concat(f);if(e=+e,!1===u.pattern)return e.toString();if(0===e&&u.zero)return u=u.zero,u.pattern;if(e<0&&u.negative?(u=u.negative,e=-e):u=u.positive,o=u.d,a=u.t,u.isFunctional)e=kg(e,u.pattern,o);else{if(u.percentage&&(e*=100),u.abbreviate){const t=Object.keys(this.abbreviations).map((e=>parseInt(e,10))).sort(((e,t)=>e-t));let i,r,o=t[0];for(s=0,n=Number(Number(e).toExponential().split("e")[1]);o<=n&&s<t.length;)s++,o=t[s];s>0&&(i=t[s-1]),i&&n>0&&i>0?r=i:(n<0&&i<0||!i)&&(o<0&&o-n<=u.maxPrecision?r=o:i<=n&&!(o>0&&-n<=u.maxPrecision)&&(r=i)),r&&(h=this.abbreviations[r],e/=10**r)}if(i=Math.abs(e),t=u.temp,l=u.numericPattern,c=l.split(o)[1],"I"===this.type&&(e=Math.round(e)),r=e,c||"#"!==l.slice(-1)[0])if(i>=1e15||i>0&&i<=1e-14)e=i?i.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{const t=Number((e+1e-15*(e<0?-1:1)).toFixed(Math.min(20,c?c.length:0)).split(".")[0]);let n=l.split(o)[0];if(n+=o,e=cg(n,t)||"0",c){const t=Math.max(0,Math.min(14,c.length)),n=c.replace(/#+$/,"").length;let r=("I"===this.type?0:i%1+1e-15).toFixed(t).slice(2).replace(/0+$/,"");for(s=r.length;s<n;s++)r+="0";r&&(e+=o+r)}else 0===t&&(r=0)}else if(i>=10**t||i<1||i<1e-4)0===e?e="0":i<1e-4||i>=1e20?(e=(e=r.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),d=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(i)/Math.log(10)))),s=0;s<t;s++)l+="#";e=cg(l,e)}e=e.replace(u.numericRegex,(e=>e===a?u.groupTemp:e===o?u.decTemp:"")),r<0&&!/^-/.test(e)&&(e="-".concat(e))}return u.prefix+e+d+h+u.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function Rg(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{size:n=5e3,multipleArguments:i=!1,toKey:r=e=>e}=t;let o,a,s=Object.create(null),l=Object.create(null),c=0,u=0;return o=i?function(){return a=r(...arguments),o.has(a)?o.get(a):o.set(a,e(...arguments))}:t=>(a=r(t),o.has(a)?o.get(a):o.set(a,e(t))),o.set=(e,t)=>(c>=n&&(delete s[l[u]],delete l[u],c--,u++),s[e]=t,l[c]=e,c++,t),o.get=e=>s[e],o.has=e=>e in s,o.clear=()=>{s=Object.create(null),l=Object.create(null),c=0,u=0},o.size=()=>c,o}function Cg(e,t,n,i,r){const o=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Sg(...t)}(r,e,t,n,i),a=Rg(o.formatValue.bind(o),{toKey:e=>isNaN(e)?e:+e});function s(e){return a(e)}return s.format=function(e,t,n,i){return a.clear(),o.format(t,e,n,i)},s.pattern=function(e){return e&&(a.clear(),o.pattern=e,o.prepare()),o.pattern},s}const Ng="D",Dg="T",qg="TS",Eg="IV",Og=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],zg=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Ag=["January","February","March","April","May","June","July","August","September","October","November","December"],Tg=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ig(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function jg(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}function Pg(e,t){let n,i=function(e){const t=e,n=24*jg(t),i=60*jg(n),r=60*jg(i),o=1e3*jg(r);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(i),s:Math.floor(r),f:Math.round(o)}}(e),r=i.d,o=i.h,a=i.m,s=i.s,l=i.f,c=0;/w+|t+/gi.test(t)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(86400*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*r),/h+/gi.test(t)||(a+=60*o),/m+/gi.test(t)||(s+=60*a),/w+/gi.test(t)&&(c=n?n.getDay()-1:0,c<0&&(c=6));let u="";return n&&(u=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:c,date:r,h:o,m:a,s:s,f:l,t:u}}class Fg{constructor(e,t,n){const i=e||{};if(i.qCalendarStrings||(i.qCalendarStrings={qLongDayNames:Og,qDayNames:zg,qLongMonthNames:Ag,qMonthNames:Tg}),this.localeInfo=i,this.locale_days=i.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=i.qCalendarStrings.qDayNames.slice(),this.locale_months=i.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=i.qCalendarStrings.qMonthNames.slice(),!t){t={[Dg]:i.qTimeFmt||"hh:mm:ss",[Ng]:i.qDateFmt||"YYYY-MM-DD",[qg]:i.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]}this.pattern=t}clone(){const e=new Fg(this.localeInfo,this.pattern);return e.subtype=this.subtype,e}format(e,t){t||(t=this.pattern?this.pattern:"YYYY-MM-DD hh:mm:ss"),t=t.replace(/\[.+]|\[|]/g,"");const n=/t+/gi.test(t);let i;e instanceof Date?i=function(e,t){let n=e.getUTCHours(),i=e.getUTCDay()-1;return t&&(n%=12,n||(n=12)),i<0&&(i=6),{year:e.getUTCFullYear(),month:e.getUTCMonth(),day:i,date:e.getUTCDate(),h:n,m:e.getUTCMinutes(),s:e.getUTCSeconds(),f:e.getUTCMilliseconds(),t:e.getUTCHours()>=12?"pm":"am"}}(e,n):(e<0&&(e=-e,t="-".concat(t)),i=Pg(e,t));const r=(o=this,a=i,{"Y+|y+":{Y:"".concat(Number("".concat(a.year).slice(-2))),YY:Ig("".concat(a.year).slice(-2),2),YYY:Ig("".concat(a.year).slice(-3),3),def:e=>Ig("".concat(a.year),e.length)},"M+":{M:a.month+1,MM:Ig("".concat(a.month+1),2),MMM:o.locale_months_abbr[a.month],def:o.locale_months[a.month]},"W+|w+":{W:a.day,WW:Ig("".concat(a.day),2),WWW:o.locale_days_abbr[a.day],def:o.locale_days[a.day]},"D+|d+":{D:a.date,def:e=>Ig("".concat(a.date),e.length)},"h+|H+":{h:a.h,def:e=>Ig("".concat(a.h),e.length)},"m+":{m:a.m,def:e=>Ig("".concat(a.m),e.length)},"s+|S+":{s:a.s,def:e=>Ig("".concat(a.s),e.length)},"f+|F+":{def(e){let t="".concat(a.f),n=e.length-t.length;if(n>0)for(let e=0;e<n;e++)t+="0";else n<0&&(t=t.slice(0,e.length));return t}},"t{1,2}|T{1,2}":{def(e){let t=a.t;return e[0].toUpperCase()===e[0]&&(t=t.toUpperCase()),t=t.slice(0,e.length),t}}});var o,a;const s=[];for(const e in r)Object.prototype.hasOwnProperty.call(r,e)&&s.push(e);const l=new RegExp(s.join("|"),"g"),c=t.replace(l,(e=>{let t,n,i;for(n in r)if(Object.prototype.hasOwnProperty.call(r,n)&&(t=new RegExp(n),t.test(e)))break;if(!t)return"";for(const t in r[n])if(t===e||t.toLowerCase()===e){i=r[n][t],void 0===i&&(i=r[n][t.toLowerCase()]);break}return void 0===i&&(i=r[n].def),"function"==typeof i&&(i=i(e)),i}));return c}}function Lg(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Fg(...t)}function $g(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=Lg(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),i=Rg(n.format.bind(n),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function r(e){return t!==Eg?function(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(864e5*(e-Math.floor(e)))))}(e):e}function o(e){return e=r(e),i(e)}return o.format=function(e,t){return i.clear(),t=r(t),n.format(t,e)},o.locale=function(r){return n=Lg(r,e,t),i=Rg(n.format.bind(n),{toKey:e=>"object"==typeof e?e.getTime():e}),this},o.qtype=function(e){return void 0!==e&&(t=e,i.clear()),t},o}function Bg(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return $g(e.qNumFormat.qFmt,e.qNumFormat.qType,t);let n="#",i=t&&void 0!==t.qThousandSep?t.qThousandSep:",",r=t&&void 0!==t.qDecimalSep?t.qDecimalSep:".",o="U",a=e&&!!e.qIsAutoFormat;return e&&e.qNumFormat?(n=e.qNumFormat.qFmt||n,i=e.qNumFormat.qThou||i,r=e.qNumFormat.qDec||r,o=e.qNumFormat.qType||o,a=a&&-1===["M"].indexOf(e.qNumFormat.qType)):a=!0,(a||"U"===o)&&(n="#".concat(r,"##"),o="U"),Cg(n,i,r,o,t)}function Hg(){let e,{meta:t,id:n,key:i,localeInfo:r,fieldExtractor:o,value:a,type:s,sourceField:l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const c=a||("dimension"===s?e=>null==e?void 0:e.qElemNo:e=>null==e?void 0:e.qValue),u="dimension"===s?"first":"avg",h=Bg(t,r),d="dimension"===s?"first":(e,t)=>h(t),f={id:()=>n,key:()=>i,raw:()=>t,title:()=>t.qFallbackTitle||t.label,type:()=>s,origin:()=>l,items:()=>(e||(e=o(f)),e),min:()=>t.qMin,max:()=>t.qMax,value:c,label:e=>(null==e?void 0:e.qText)||"",reduce:u,reduceLabel:d,formatter:()=>h,tags:()=>t.qTags};return f}function Wg(e,t,n,i,r){return(t[e]||[]).map(((t,o)=>{const a="".concat(i?"".concat(i,"/"):"").concat(e,"/").concat(o),s={instance:Hg(Rp({id:"".concat(n?"".concat(n,"/"):"").concat(a),key:a,meta:t},r))};return s.attrDims=Wg("qAttrDimInfo",t,n,a,Rp({},r,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),s.attrExps=Wg("qAttrExprInfo",t,n,a,Rp({},r,{value:e=>null==e?void 0:e.qNum,type:"measure"})),s.measures=Wg("qMeasureInfo",t,n,a,Rp({},r,{value:e=>null==e?void 0:e.qValue,type:"measure"})),s}))}function Vg(){let{key:e,data:t,config:n={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},r=t;if(!r)throw new Error('Missing "data" input');if(!r.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const o=Vg.util,a={cache:i,cube:r,localeInfo:n.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:n.virtualFields},s={key:()=>e,raw:()=>r,field:e=>function(e,t){let{cache:n}=t;if("number"==typeof e)return n.fields[e];const i=n.allFields;if("function"==typeof e){for(let t=0;t<i.length;t++)if(e(i[t]))return i[t];return!1}if("string"==typeof e){for(let t=0;t<i.length;t++)if(i[t].key()===e||i[t].title()===e)return i[t]}else if(e&&-1!==i.indexOf(e))return e;throw Error("Field not found: ".concat(e))}(e,a),fields:()=>i.fields.slice(),extract:e=>a.extractor(e,s,i,o),hierarchy:e=>a.hierarchy(e,s,i,o),_cache:()=>i};"K"===r.qMode||"T"===r.qMode||!r.qMode&&r.qNodesOnDim?(a.extractor=lg,a.hierarchy=sg,a.pages="K"===r.qMode?r.qStackedDataPages:r.qTreeDataPages):"S"===r.qMode?(a.extractor=qp,a.pages=r.qDataPages,a.hierarchy=sg):a.extractor=()=>[],a.fieldExtractor=e=>a.extractor({field:e},s,i,o);const l="S"===r.qMode?e=>e.qElemNumber:void 0,c="S"===r.qMode?e=>e.qNum:void 0;i.wrappedFields.push(...Wg("qDimensionInfo",r,e,"",Rp({},a,{value:l,type:"dimension"}))),i.wrappedFields.push(...Wg("qMeasureInfo",r,e,"",Rp({},a,{value:c,type:"measure"}))),i.fields=i.wrappedFields.map((e=>e.instance));const u=e=>{e.forEach((e=>{i.allFields.push(e.instance),u(e.measures),u(e.attrDims),u(e.attrExps)}))};return u(i.wrappedFields),(n.virtualFields||[]).forEach((t=>{const n=s.field(t.from),r=Hg(yp({meta:n.raw(),id:"".concat(e,"/").concat(t.key),sourceField:n,fieldExtractor:e=>a.extractor({field:e},s,i,o),key:t.key,type:n.type(),localeInfo:a.localeInfo,value:n.value},t.override||{}));i.virtualFields.push(r)})),i.allFields.push(...i.virtualFields),s}const Ug=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],Yg=/\/qDimensionInfo(?:\/(\d+))?/,Kg=/\/qMeasureInfo\/(\d+)/,Xg=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,Gg=/\/qAttrExprInfo\/(\d+)/,Jg=/\/?qHyperCube/,Zg=/\/?qTreeData/,Qg=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),em=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function tm(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const i=t.byCells,r=t.primarySource,o=[],a={},s=e.isActive();let l=!1;if(e.brushes().forEach((e=>{const t=function(e,t){let n=e,i=-1,r=-1,o="",a=e=>e;Jg.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),a=Qg):Zg.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),a=em);let s=!0;if(Yg.test(e)&&(i=+Yg.exec(e)[1]),Kg.test(e)&&(r=+Kg.exec(e)[1]),Xg.test(e)){r=-1,i=0;const e=+Xg.exec(n)[2];isNaN(e)||(i=e,n=n.replace(/\/\d+$/,"")),s=!1}if(Gg.test(e)){const e=r;if(t){r=0;const a=Yp(o,t);r+=(a.qMeasureInfo||[]).length,i>-1?(r=a.qDimensionInfo.slice(0,i).reduce(((e,t)=>e+t.qAttrExprInfo.length),r),i=-1):(r=a.qDimensionInfo.reduce(((e,t)=>e+t.qAttrExprInfo.length),r),r=a.qMeasureInfo.slice(0,e).reduce(((e,t)=>e+t.qAttrExprInfo.length),r)),r+=+Gg.exec(n)[1]}else i>-1?(i=-1,r=+Gg.exec(n)[1]):r+=+Gg.exec(n)[1]+1}return Ug.forEach((e=>{let[t,i]=e;n=n.replace(t,i)})),s&&(n=a(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:r,dimensionIdx:i,path:n}}(e.id,n);if("range"===e.type&&t.measureIdx>-1&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.multiRangeSelectTreeDataValues||(a.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),n.forEach((e=>a.multiRangeSelectTreeDataValues.ranges.push({qMeasureIx:t.measureIdx,qDimensionIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}}))))}else{if("range"===e.type&&t.measureIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.rangeSelectHyperCubeValues||(a.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),n.forEach((e=>a.rangeSelectHyperCubeValues.ranges.push({qMeasureIx:t.measureIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}}))))}if("range"===e.type&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.selectHyperCubeContinuousRange||(a.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),n.forEach((e=>a.selectHyperCubeContinuousRange.ranges.push({qDimIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!1}}))))}if("value"===e.type&&t.dimensionIdx>-1)if(i)if(n&&n.qHyperCube&&("P"===n.qHyperCube.qMode||"T"===n.qHyperCube.qMode||"K"===n.qHyperCube.qMode)){const i=n.qHyperCube,o=i.qNoOfLeftDims,s=i.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(a.selectPivotCells||(a.selectPivotCells={path:t.path,cells:[]}),e.id===r||!r){const n=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e)));(0===o||s>=o)&&o>-1?n.forEach((e=>{a.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:s-o})})):n.forEach((e=>{a.selectPivotCells.cells.push({qType:"L",qCol:t.dimensionIdx,qRow:e})})),l=!!a.selectPivotCells.cells.length}}else a.selectHyperCubeCells||(a.selectHyperCubeCells={path:t.path,cols:[]}),a.selectHyperCubeCells.cols.push(t.dimensionIdx),e.id!==r&&(r||a.selectHyperCubeCells.values)||(a.selectHyperCubeCells.values=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e))),l=!!a.selectHyperCubeCells.values.length);else{const n=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e)));l=!!n.length,o.push({params:[t.path,t.dimensionIdx,n,!1],method:"selectHyperCubeValues"})}}})),!l&&s)return[{method:"resetMadeSelections",params:[]}];var c;a.rangeSelectHyperCubeValues&&o.push({method:"rangeSelectHyperCubeValues",params:[a.rangeSelectHyperCubeValues.path,a.rangeSelectHyperCubeValues.ranges,[],null===(c=t.orMode)||void 0===c||c]});return a.selectHyperCubeContinuousRange&&o.push({method:"selectHyperCubeContinuousRange",params:[a.selectHyperCubeContinuousRange.path,a.selectHyperCubeContinuousRange.ranges]}),a.selectHyperCubeCells&&o.push({method:"selectHyperCubeCells",params:[a.selectHyperCubeCells.path,a.selectHyperCubeCells.values,a.selectHyperCubeCells.cols]}),a.selectPivotCells&&o.push({method:"selectPivotCells",params:[a.selectPivotCells.path,a.selectPivotCells.cells]}),a.multiRangeSelectTreeDataValues&&o.push({method:"multiRangeSelectTreeDataValues",params:[a.multiRangeSelectTreeDataValues.path,a.multiRangeSelectTreeDataValues.ranges]}),o}function nm(e){Vg.util=e.data("matrix").util,e.data("q",Vg),e.formatter("q-number",Cg),e.formatter("q-time",$g)}nm.qBrushHelper=tm,nm.selections=tm;const im={fill:"steelblue",num:1},rm=.9,om=150,am=(e,t,n)=>{let i=0,r=0,o=0,a={},s=0;if("labelCenter"===e)i=t.bottomLeft.x,r=t.topRight.y,o=t.bottomRight.x-t.bottomLeft.x,s=t.bottomRight.y-t.topRight.y,a={share:n.share,fill:n.fill};else{const e=180/Math.PI*Math.atan((t.bottomRight.y-t.topRight.y)/(t.topRight.x-t.bottomRight.x));i=e<15&&e>=0?t.topRight.x:e>-15&&e<0?t.bottomRight.x:e<-15?(t.bottomRight.x-t.topRight.x)/2+t.topRight.x+15:(t.topRight.x-t.bottomRight.x)/2+t.bottomRight.x+15,r=t.topRight.y,o=t.width-i,s=t.bottomRight.y-t.topRight.y,a={fill:n.fill}}return{tag:e,type:"rect",x:i,y:r,width:o,height:s,data:n.data,desc:a,fill:"none"}},sm=(e,t)=>{const n=(e=>{const t=(e=>{let t=0;return e.forEach((e=>{e.num>t&&(t=e.num)})),t})(e);let n=0;return e.slice().reverse().map((e=>{const i={datum:e,s:n/t,e:e.num/t};return n=e.num,i})).reverse()})(e),i=t.width*rm,r=t.height*rm,o=(t.width-i)/2,a=(t.height-r)/2,s=i-(i>om&&r>om?100:0),l=(r-1*(n.length-1))/n.length,c=[];return n.forEach(((e,i)=>{const r=(u=e.e,h=i<n.length-1?e.s:e.e,[.5-.5*u,.5+.5*u,.5+.5*h,.5-.5*h]).map((e=>Math.round(e*s+o)));var u,h;const d=l*i+1*i+a,f={bottomRight:{x:r[2],y:Math.round(d+l)},bottomLeft:{x:r[3],y:Math.round(d+l)},topRight:{x:r[1],y:Math.round(d)},topLeft:{x:r[0],y:Math.round(d)},width:t.width},p=`M${f.topLeft.x},${f.topLeft.y} L${f.topRight.x},${f.topRight.y} ${f.bottomRight.x},${f.bottomRight.y} ${f.bottomLeft.x},${f.bottomLeft.y}Z`;c.push({tag:"section",type:"path",d:p,data:e.datum.data,fill:e.datum.fill});const g={share:e.e,fill:e.datum.fill,data:e.datum.data};l>12&&(f.bottomRight.x-f.bottomLeft.x>32&&c.push(am("labelCenter",f,g)),c.push(am("labelLeft",f,g)))})),c},lm=(e,t,n,i)=>(i-e)/i*(t-n)+n,cm=(e,t,n)=>{const i=e.filter((e=>"NaN"!==e.num&&e.num>0)),r=i.length,o=n.width*rm,a=n.height*rm,s=Math.round((n.width-o)/2),l=Math.round((n.height-a)/2),c=o-(o>om&&a>om?100:0),u=a-1*(r-1),h=[],d=i[0].data.num.value;let f=l;return i.forEach(((e,i)=>{const r=t[i]*u,o=Math.round(lm(f-l,c,.2*c,a)/2),p=Math.round(lm(f-l+r,c,.2*c,a)/2),g=s+Math.round(c/2),m={bottomRight:{x:g+p,y:Math.round(f+r)},bottomLeft:{x:g-p,y:Math.round(f+r)},topRight:{x:g+o,y:f},topLeft:{x:g-o,y:f},width:n.width},y=`M${m.topLeft.x},${m.topLeft.y} L${m.topRight.x},${m.topRight.y} ${m.bottomRight.x},${m.bottomRight.y} ${m.bottomLeft.x},${m.bottomLeft.y}Z`;h.push({tag:"section",type:"path",d:y,data:e.data,fill:e.fill});const v={share:e.data.num.value/d,fill:e.fill,data:e.data};r>2&&(m.bottomRight.x-m.bottomLeft.x>32&&h.push(am("labelCenter",m,v)),h.push(am("labelLeft",m,v))),f+=r+1})),h},um=(e,t,n)=>{const i=e.filter((e=>"NaN"!==e.num&&e.num>0));if(i&&i.length>0)switch(t){case"WIDTH":default:return sm(i,n);case"ORDER":return cm(i,i.map((()=>1/i.length)),n);case"HEIGHT":return cm(i,(e=>{const t=e.reduce(((e,t)=>e+t.data.num.value),0);return e.map((e=>e.data.num.value/t))})(i),n);case"AREA":return cm(i,((e,t,n)=>{const i=e.reduce(((e,t)=>e+t.data.num.value),0),r=t.width*rm,o=t.height*rm,a=r*n,s=o*(r+a)/2,l=(r-a)/2/o,c=[];let u=0;for(let t=e.length-1;t>=0;t--){const n=e[t].data.num.value/i,r=2*l*u+a,h=-r/(2*l)+Math.sqrt(r*r/(4*l*l)+n*s/l);c[t]=h/o,u+=h}return c})(i,n,.2),n)}return[]};var hm={require:["resolver"],defaultSettings:{settings:{},data:{},style:{item:"$shape"}},render({data:e}){const t=this.resolver.resolve({data:e,defaults:{...im,...this.style.item},settings:this.settings.settings});return um(t.items,this.settings.settings.mode,this.rect)}};const dm={version:"1.9.36",color:{auto:!0,autoMinMax:!0,byDimDef:void 0,byMeasureDef:void 0,colorExpression:void 0,dimensionScheme:"12",expressionIsColor:!0,expressionLabel:"",measureMin:void 0,measureMax:void 0,measureScheme:"sg",mode:"primary",paletteColor:{index:6},persistent:!1,reverseScheme:!1,singleColor:void 0,useBaseColors:"off",useDimColVal:!0,useMeasureGradient:!0},dataPoint:{auto:!0,labelMode:"share"},footnote:"",funnel:{mode:"WIDTH"},qHyperCubeDef:{qDimensions:[],qMeasures:[],qInterColumnSortOrder:[],qInitialDataFetch:[{qWidth:2,qHeight:5e3}],qSuppressMissing:!0,qSuppressZero:!1},showDimensionTitle:!0,showTitles:!0,subtitle:"",title:""};function fm(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function pm(e,t,n,i,r,o,a){try{var s=e[o](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(i,r)}function gm(e){return function(){var t=this,n=arguments;return new Promise((function(i,r){var o=e.apply(t,n);function a(e){pm(o,i,r,a,s,"next",e)}function s(e){pm(o,i,r,a,s,"throw",e)}a(void 0)}))}}function mm(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t);if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ym(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function vm(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ym(Object(n),!0).forEach((function(t){mm(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ym(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function xm(e,t){if(null==e)return{};var n,i,r=function(e,t){if(null==e)return{};var n={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(-1!==t.indexOf(i))continue;n[i]=e[i]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)n=o[i],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function bm(){
|
9
|
+
e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,i,r,o,a,s,l,c,u,h,d=e.length,f=e.search(/[0-9\-\+#]/),p=f>0?e.substring(0,f):"",g=e.split("").reverse().join(""),m=g.search(/[0-9\-\+#]/),y=d-m,v=e.substring(y,y+1),x=y+("."===v||","===v?1:0),b=m>0?e.substring(x,d):"";if(n=(t="-"===(e=e.substring(f,x)).charAt(0)?-t:+t)<0?t=-t:0,r=(i=e.match(/[^\d\-\+#]/g))&&i[i.length-1]||".",o=i&&i[1]&&i[0]||",",e=e.split(r),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=s)&&(t=(+t).toFixed(s+1)),u=e[0].split(o),e[0]=u.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-a;)c[0]="0"+c[0];else 0==+c[0]&&(c[0]="");if((t=t.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(g="",y=(h=t[0]).length%l,d=h.length,x=0;x<d;x++)g+=h.charAt(x),!((x-y+1)%l)&&x<d-l&&(g+=o);t[0]=g}return t[1]=e[1]&&t[1]?r+t[1]:"","0"!==(i=t.join(""))&&""!==i||(n=!1),p+(n?"-":"")+i+b}}));function ug(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const hg={3:"k",6:"M",9:"G",12:"T",15:"P",18:"E",21:"Z",24:"Y","-3":"m","-6":"μ","-9":"n","-12":"p","-15":"f","-18":"a","-21":"z","-24":"y"},dg=/%\)?$/,fg=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,pg=/^\(oct\)/i,gg=/^\(dec\)/i,mg=/^\(hex\)/i,yg=/^\(bin\)/i,vg=/^\(rom\)/i,xg=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,bg=/#|0/g;function wg(e,t,n,i){return e=e.toString(t),n[1]===n[1].toUpperCase()&&(e=e.toUpperCase()),e.length-e.indexOf(".")>10&&(e=e.slice(0,e.indexOf(".")+11)),e.replace(".",i||".")}function kg(e,t,n){let i;return fg.test(t)?e=wg(e,Number(/\d{2}/.exec(t)[0]),t,n):pg.test(t)?e=wg(e,8,t,n):gg.test(t)?e=wg(e,10,t,n):mg.test(t)?e=wg(e,16,t,n):yg.test(t)?e=wg(e,2,t,n):vg.test(t)&&(i="",e<0&&(i="-",e=-e),0===(e=Math.floor(e))?e="0":e<=5e5?(e=function(e,t){let n,i="",r=Number(String(e).slice(-3)),o=(e-r)/1e3,a=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),s=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();for(;r>0;)for(n=0;n<a.length;n++)if(a[n]<=r){i+=s[n],r-=a[n];break}for(n=0;n<o;n++)i="M".concat(i);return t[1]!==t[1].toUpperCase()&&(i=i.toLowerCase()),i}(e,t),e=i+e):e=t+i+e.toExponential(0)),e}function _g(e,t,n){const i=ug(e);return n?i:new RegExp(i||"",t)}function Mg(e,t,n,i){let r,o,a,s,l,c,u,h,d,f=e.pattern;var p,g;i&&(e.abbreviate=!0),p=t,(g=n)&&(g=ug(g)),p&&(p=ug(p)),d=new RegExp("(?:[#0]+".concat(p,")?[#0]+(?:").concat(g,"[#0]+)?")),a=f.match(d),a=a?a[0]:"",s=a?f.substr(0,f.indexOf(a)):f,l=a?f.substring(f.indexOf(a)+a.length):"",a||(a=f?"#":"##########"),t&&t===n&&(r=a.split(n),o=r.pop(),a=r.join("")+n+o,t=""),c=t,t=/,/.test(n)?"¤":",",c&&(a=a.replace(_g(c,"g"),t)),u=n,n=".",u&&(a=a.replace(_g(u,"g"),n)),h=a.match(/#/g),h=h?h.length:0;const m=f.split(u);let y;m[1]&&(y=m[1].match(bg)),e.prefix=s||"",e.postfix=l||"",e.pattern=f,e.maxPrecision=y?y.length:2,e.percentage=dg.test(f),e.numericPattern=a||"",e.numericRegex=new RegExp("".concat(_g(t,null,!0),"|").concat(_g(n,null,!0)),"g"),e.groupTemp=c,e.decTemp=u,e.t=t,e.d=n,e.temp=h}class Sg{constructor(e,t,n,i,r){this.localeInfo=e,this.pattern=t,this.thousandDelimiter=n||",",this.decimalDelimiter=i||".",this.type=r||"numeric",this.patternSeparator=";",this.abbreviations=function(e,t){if(!e||!e.qNumericalAbbreviation)return hg;const n={};return e.qNumericalAbbreviation.split(t).forEach((e=>{let t=e.split(":");2===t.length&&(n[t[0]]=t[1])})),n}(e,this.patternSeparator),this.prepare()}clone(){const e=new Sg(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return e.subtype=this.subtype,e}format(e,t,n,i){return this.prepare(t,n,i),this.formatValue(e)}prepare(e,t,n){let i;if(void 0===e&&(e=this.pattern),void 0===t&&(t=this.thousandDelimiter),void 0===n&&(n=this.decimalDelimiter),!e)return void(this._prepared={pattern:!1});this._prepared={positive:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},negative:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},zero:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""}},i=this._prepared,e=e.split(this.patternSeparator),i.positive.pattern=e[0],i.negative.pattern=e[1],i.zero.pattern=e[2],xg.test(e[0])&&(i.positive.isFunctional=!0),e[1]?xg.test(e[1])&&(i.negative.isFunctional=!0):i.negative=!1,e[2]?xg.test(e[2])&&(i.zero.isFunctional=!0):i.zero=!1;const r="U"===this.type;i.positive.isFunctional||Mg(i.positive,t,n,r),i.negative&&!i.negative.isFunctional&&Mg(i.negative,t,n,r),i.zero&&!i.zero.isFunctional&&Mg(i.zero,t,n,r)}formatValue(e){let t,n,i,r,o,a,s,l,c,u=this._prepared,h="",d="",f=e;if(isNaN(e))return"".concat(f);if(e=+e,!1===u.pattern)return e.toString();if(0===e&&u.zero)return u=u.zero,u.pattern;if(e<0&&u.negative?(u=u.negative,e=-e):u=u.positive,o=u.d,a=u.t,u.isFunctional)e=kg(e,u.pattern,o);else{if(u.percentage&&(e*=100),u.abbreviate){const t=Object.keys(this.abbreviations).map((e=>parseInt(e,10))).sort(((e,t)=>e-t));let i,r,o=t[0];for(s=0,n=Number(Number(e).toExponential().split("e")[1]);o<=n&&s<t.length;)s++,o=t[s];s>0&&(i=t[s-1]),i&&n>0&&i>0?r=i:(n<0&&i<0||!i)&&(o<0&&o-n<=u.maxPrecision?r=o:i<=n&&!(o>0&&-n<=u.maxPrecision)&&(r=i)),r&&(h=this.abbreviations[r],e/=10**r)}if(i=Math.abs(e),t=u.temp,l=u.numericPattern,c=l.split(o)[1],"I"===this.type&&(e=Math.round(e)),r=e,c||"#"!==l.slice(-1)[0])if(i>=1e15||i>0&&i<=1e-14)e=i?i.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{const t=Number((e+1e-15*(e<0?-1:1)).toFixed(Math.min(20,c?c.length:0)).split(".")[0]);let n=l.split(o)[0];if(n+=o,e=cg(n,t)||"0",c){const t=Math.max(0,Math.min(14,c.length)),n=c.replace(/#+$/,"").length;let r=("I"===this.type?0:i%1+1e-15).toFixed(t).slice(2).replace(/0+$/,"");for(s=r.length;s<n;s++)r+="0";r&&(e+=o+r)}else 0===t&&(r=0)}else if(i>=10**t||i<1||i<1e-4)0===e?e="0":i<1e-4||i>=1e20?(e=(e=r.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),d=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(i)/Math.log(10)))),s=0;s<t;s++)l+="#";e=cg(l,e)}e=e.replace(u.numericRegex,(e=>e===a?u.groupTemp:e===o?u.decTemp:"")),r<0&&!/^-/.test(e)&&(e="-".concat(e))}return u.prefix+e+d+h+u.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function Rg(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{size:n=5e3,multipleArguments:i=!1,toKey:r=e=>e}=t;let o,a,s=Object.create(null),l=Object.create(null),c=0,u=0;return o=i?function(){return a=r(...arguments),o.has(a)?o.get(a):o.set(a,e(...arguments))}:t=>(a=r(t),o.has(a)?o.get(a):o.set(a,e(t))),o.set=(e,t)=>(c>=n&&(delete s[l[u]],delete l[u],c--,u++),s[e]=t,l[c]=e,c++,t),o.get=e=>s[e],o.has=e=>e in s,o.clear=()=>{s=Object.create(null),l=Object.create(null),c=0,u=0},o.size=()=>c,o}function Cg(e,t,n,i,r){const o=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Sg(...t)}(r,e,t,n,i),a=Rg(o.formatValue.bind(o),{toKey:e=>isNaN(e)?e:+e});function s(e){return a(e)}return s.format=function(e,t,n,i){return a.clear(),o.format(t,e,n,i)},s.pattern=function(e){return e&&(a.clear(),o.pattern=e,o.prepare()),o.pattern},s}const Ng="D",Dg="T",qg="TS",Eg="IV",Og=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],zg=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Ag=["January","February","March","April","May","June","July","August","September","October","November","December"],Tg=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ig(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function jg(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}function Pg(e,t){let n,i=function(e){const t=e,n=24*jg(t),i=60*jg(n),r=60*jg(i),o=1e3*jg(r);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(i),s:Math.floor(r),f:Math.round(o)}}(e),r=i.d,o=i.h,a=i.m,s=i.s,l=i.f,c=0;/w+|t+/gi.test(t)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(86400*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*r),/h+/gi.test(t)||(a+=60*o),/m+/gi.test(t)||(s+=60*a),/w+/gi.test(t)&&(c=n?n.getDay()-1:0,c<0&&(c=6));let u="";return n&&(u=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:c,date:r,h:o,m:a,s:s,f:l,t:u}}class Fg{constructor(e,t,n){const i=e||{};if(i.qCalendarStrings||(i.qCalendarStrings={qLongDayNames:Og,qDayNames:zg,qLongMonthNames:Ag,qMonthNames:Tg}),this.localeInfo=i,this.locale_days=i.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=i.qCalendarStrings.qDayNames.slice(),this.locale_months=i.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=i.qCalendarStrings.qMonthNames.slice(),!t){t={[Dg]:i.qTimeFmt||"hh:mm:ss",[Ng]:i.qDateFmt||"YYYY-MM-DD",[qg]:i.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]}this.pattern=t}clone(){const e=new Fg(this.localeInfo,this.pattern);return e.subtype=this.subtype,e}format(e,t){t||(t=this.pattern?this.pattern:"YYYY-MM-DD hh:mm:ss"),t=t.replace(/\[.+]|\[|]/g,"");const n=/t+/gi.test(t);let i;e instanceof Date?i=function(e,t){let n=e.getUTCHours(),i=e.getUTCDay()-1;return t&&(n%=12,n||(n=12)),i<0&&(i=6),{year:e.getUTCFullYear(),month:e.getUTCMonth(),day:i,date:e.getUTCDate(),h:n,m:e.getUTCMinutes(),s:e.getUTCSeconds(),f:e.getUTCMilliseconds(),t:e.getUTCHours()>=12?"pm":"am"}}(e,n):(e<0&&(e=-e,t="-".concat(t)),i=Pg(e,t));const r=(o=this,a=i,{"Y+|y+":{Y:"".concat(Number("".concat(a.year).slice(-2))),YY:Ig("".concat(a.year).slice(-2),2),YYY:Ig("".concat(a.year).slice(-3),3),def:e=>Ig("".concat(a.year),e.length)},"M+":{M:a.month+1,MM:Ig("".concat(a.month+1),2),MMM:o.locale_months_abbr[a.month],def:o.locale_months[a.month]},"W+|w+":{W:a.day,WW:Ig("".concat(a.day),2),WWW:o.locale_days_abbr[a.day],def:o.locale_days[a.day]},"D+|d+":{D:a.date,def:e=>Ig("".concat(a.date),e.length)},"h+|H+":{h:a.h,def:e=>Ig("".concat(a.h),e.length)},"m+":{m:a.m,def:e=>Ig("".concat(a.m),e.length)},"s+|S+":{s:a.s,def:e=>Ig("".concat(a.s),e.length)},"f+|F+":{def(e){let t="".concat(a.f),n=e.length-t.length;if(n>0)for(let e=0;e<n;e++)t+="0";else n<0&&(t=t.slice(0,e.length));return t}},"t{1,2}|T{1,2}":{def(e){let t=a.t;return e[0].toUpperCase()===e[0]&&(t=t.toUpperCase()),t=t.slice(0,e.length),t}}});var o,a;const s=[];for(const e in r)Object.prototype.hasOwnProperty.call(r,e)&&s.push(e);const l=new RegExp(s.join("|"),"g"),c=t.replace(l,(e=>{let t,n,i;for(n in r)if(Object.prototype.hasOwnProperty.call(r,n)&&(t=new RegExp(n),t.test(e)))break;if(!t)return"";for(const t in r[n])if(t===e||t.toLowerCase()===e){i=r[n][t],void 0===i&&(i=r[n][t.toLowerCase()]);break}return void 0===i&&(i=r[n].def),"function"==typeof i&&(i=i(e)),i}));return c}}function Lg(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Fg(...t)}function $g(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=Lg(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),i=Rg(n.format.bind(n),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function r(e){return t!==Eg?function(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(864e5*(e-Math.floor(e)))))}(e):e}function o(e){return e=r(e),i(e)}return o.format=function(e,t){return i.clear(),t=r(t),n.format(t,e)},o.locale=function(r){return n=Lg(r,e,t),i=Rg(n.format.bind(n),{toKey:e=>"object"==typeof e?e.getTime():e}),this},o.qtype=function(e){return void 0!==e&&(t=e,i.clear()),t},o}function Bg(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return $g(e.qNumFormat.qFmt,e.qNumFormat.qType,t);let n="#",i=t&&void 0!==t.qThousandSep?t.qThousandSep:",",r=t&&void 0!==t.qDecimalSep?t.qDecimalSep:".",o="U",a=e&&!!e.qIsAutoFormat;return e&&e.qNumFormat?(n=e.qNumFormat.qFmt||n,i=e.qNumFormat.qThou||i,r=e.qNumFormat.qDec||r,o=e.qNumFormat.qType||o,a=a&&-1===["M"].indexOf(e.qNumFormat.qType)):a=!0,(a||"U"===o)&&(n="#".concat(r,"##"),o="U"),Cg(n,i,r,o,t)}function Hg(){let e,{meta:t,id:n,key:i,localeInfo:r,fieldExtractor:o,value:a,type:s,sourceField:l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const c=a||("dimension"===s?e=>null==e?void 0:e.qElemNo:e=>null==e?void 0:e.qValue),u="dimension"===s?"first":"avg",h=Bg(t,r),d="dimension"===s?"first":(e,t)=>h(t),f={id:()=>n,key:()=>i,raw:()=>t,title:()=>t.qFallbackTitle||t.label,type:()=>s,origin:()=>l,items:()=>(e||(e=o(f)),e),min:()=>t.qMin,max:()=>t.qMax,value:c,label:e=>(null==e?void 0:e.qText)||"",reduce:u,reduceLabel:d,formatter:()=>h,tags:()=>t.qTags};return f}function Wg(e,t,n,i,r){return(t[e]||[]).map(((t,o)=>{const a="".concat(i?"".concat(i,"/"):"").concat(e,"/").concat(o),s={instance:Hg(Rp({id:"".concat(n?"".concat(n,"/"):"").concat(a),key:a,meta:t},r))};return s.attrDims=Wg("qAttrDimInfo",t,n,a,Rp({},r,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),s.attrExps=Wg("qAttrExprInfo",t,n,a,Rp({},r,{value:e=>null==e?void 0:e.qNum,type:"measure"})),s.measures=Wg("qMeasureInfo",t,n,a,Rp({},r,{value:e=>null==e?void 0:e.qValue,type:"measure"})),s}))}function Vg(){let{key:e,data:t,config:n={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},r=t;if(!r)throw new Error('Missing "data" input');if(!r.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const o=Vg.util,a={cache:i,cube:r,localeInfo:n.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:n.virtualFields},s={key:()=>e,raw:()=>r,field:e=>function(e,t){let{cache:n}=t;if("number"==typeof e)return n.fields[e];const i=n.allFields;if("function"==typeof e){for(let t=0;t<i.length;t++)if(e(i[t]))return i[t];return!1}if("string"==typeof e){for(let t=0;t<i.length;t++)if(i[t].key()===e||i[t].title()===e)return i[t]}else if(e&&-1!==i.indexOf(e))return e;throw Error("Field not found: ".concat(e))}(e,a),fields:()=>i.fields.slice(),extract:e=>a.extractor(e,s,i,o),hierarchy:e=>a.hierarchy(e,s,i,o),_cache:()=>i};"K"===r.qMode||"T"===r.qMode||!r.qMode&&r.qNodesOnDim?(a.extractor=lg,a.hierarchy=sg,a.pages="K"===r.qMode?r.qStackedDataPages:r.qTreeDataPages):"S"===r.qMode?(a.extractor=qp,a.pages=r.qDataPages,a.hierarchy=sg):a.extractor=()=>[],a.fieldExtractor=e=>a.extractor({field:e},s,i,o);const l="S"===r.qMode?e=>e.qElemNumber:void 0,c="S"===r.qMode?e=>e.qNum:void 0;i.wrappedFields.push(...Wg("qDimensionInfo",r,e,"",Rp({},a,{value:l,type:"dimension"}))),i.wrappedFields.push(...Wg("qMeasureInfo",r,e,"",Rp({},a,{value:c,type:"measure"}))),i.fields=i.wrappedFields.map((e=>e.instance));const u=e=>{e.forEach((e=>{i.allFields.push(e.instance),u(e.measures),u(e.attrDims),u(e.attrExps)}))};return u(i.wrappedFields),(n.virtualFields||[]).forEach((t=>{const n=s.field(t.from),r=Hg(yp({meta:n.raw(),id:"".concat(e,"/").concat(t.key),sourceField:n,fieldExtractor:e=>a.extractor({field:e},s,i,o),key:t.key,type:n.type(),localeInfo:a.localeInfo,value:n.value},t.override||{}));i.virtualFields.push(r)})),i.allFields.push(...i.virtualFields),s}const Ug=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],Yg=/\/qDimensionInfo(?:\/(\d+))?/,Kg=/\/qMeasureInfo\/(\d+)/,Xg=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,Gg=/\/qAttrExprInfo\/(\d+)/,Jg=/\/?qHyperCube/,Zg=/\/?qTreeData/,Qg=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),em=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function tm(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const i=t.byCells,r=t.primarySource,o=[],a={},s=e.isActive();let l=!1;if(e.brushes().forEach((e=>{const t=function(e,t){let n=e,i=-1,r=-1,o="",a=e=>e;Jg.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),a=Qg):Zg.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),a=em);let s=!0;if(Yg.test(e)&&(i=+Yg.exec(e)[1]),Kg.test(e)&&(r=+Kg.exec(e)[1]),Xg.test(e)){r=-1,i=0;const e=+Xg.exec(n)[2];isNaN(e)||(i=e,n=n.replace(/\/\d+$/,"")),s=!1}if(Gg.test(e)){const e=r;if(t){r=0;const a=Yp(o,t);r+=(a.qMeasureInfo||[]).length,i>-1?(r=a.qDimensionInfo.slice(0,i).reduce(((e,t)=>e+t.qAttrExprInfo.length),r),i=-1):(r=a.qDimensionInfo.reduce(((e,t)=>e+t.qAttrExprInfo.length),r),r=a.qMeasureInfo.slice(0,e).reduce(((e,t)=>e+t.qAttrExprInfo.length),r)),r+=+Gg.exec(n)[1]}else i>-1?(i=-1,r=+Gg.exec(n)[1]):r+=+Gg.exec(n)[1]+1}return Ug.forEach((e=>{let[t,i]=e;n=n.replace(t,i)})),s&&(n=a(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:r,dimensionIdx:i,path:n}}(e.id,n);if("range"===e.type&&t.measureIdx>-1&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.multiRangeSelectTreeDataValues||(a.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),n.forEach((e=>a.multiRangeSelectTreeDataValues.ranges.push({qMeasureIx:t.measureIdx,qDimensionIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}}))))}else{if("range"===e.type&&t.measureIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.rangeSelectHyperCubeValues||(a.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),n.forEach((e=>a.rangeSelectHyperCubeValues.ranges.push({qMeasureIx:t.measureIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}}))))}if("range"===e.type&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.selectHyperCubeContinuousRange||(a.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),n.forEach((e=>a.selectHyperCubeContinuousRange.ranges.push({qDimIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!1}}))))}if("value"===e.type&&t.dimensionIdx>-1)if(i)if(n&&n.qHyperCube&&("P"===n.qHyperCube.qMode||"T"===n.qHyperCube.qMode||"K"===n.qHyperCube.qMode)){const i=n.qHyperCube,o=i.qNoOfLeftDims,s=i.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(a.selectPivotCells||(a.selectPivotCells={path:t.path,cells:[]}),e.id===r||!r){const n=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e)));(0===o||s>=o)&&o>-1?n.forEach((e=>{a.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:s-o})})):n.forEach((e=>{a.selectPivotCells.cells.push({qType:"L",qCol:t.dimensionIdx,qRow:e})})),l=!!a.selectPivotCells.cells.length}}else a.selectHyperCubeCells||(a.selectHyperCubeCells={path:t.path,cols:[]}),a.selectHyperCubeCells.cols.push(t.dimensionIdx),e.id!==r&&(r||a.selectHyperCubeCells.values)||(a.selectHyperCubeCells.values=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e))),l=!!a.selectHyperCubeCells.values.length);else{const n=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e)));l=!!n.length,o.push({params:[t.path,t.dimensionIdx,n,!1],method:"selectHyperCubeValues"})}}})),!l&&s)return[{method:"resetMadeSelections",params:[]}];var c;a.rangeSelectHyperCubeValues&&o.push({method:"rangeSelectHyperCubeValues",params:[a.rangeSelectHyperCubeValues.path,a.rangeSelectHyperCubeValues.ranges,[],null===(c=t.orMode)||void 0===c||c]});return a.selectHyperCubeContinuousRange&&o.push({method:"selectHyperCubeContinuousRange",params:[a.selectHyperCubeContinuousRange.path,a.selectHyperCubeContinuousRange.ranges]}),a.selectHyperCubeCells&&o.push({method:"selectHyperCubeCells",params:[a.selectHyperCubeCells.path,a.selectHyperCubeCells.values,a.selectHyperCubeCells.cols]}),a.selectPivotCells&&o.push({method:"selectPivotCells",params:[a.selectPivotCells.path,a.selectPivotCells.cells]}),a.multiRangeSelectTreeDataValues&&o.push({method:"multiRangeSelectTreeDataValues",params:[a.multiRangeSelectTreeDataValues.path,a.multiRangeSelectTreeDataValues.ranges]}),o}function nm(e){Vg.util=e.data("matrix").util,e.data("q",Vg),e.formatter("q-number",Cg),e.formatter("q-time",$g)}nm.qBrushHelper=tm,nm.selections=tm;const im={fill:"steelblue",num:1},rm=.9,om=150,am=(e,t,n)=>{let i=0,r=0,o=0,a={},s=0;if("labelCenter"===e)i=t.bottomLeft.x,r=t.topRight.y,o=t.bottomRight.x-t.bottomLeft.x,s=t.bottomRight.y-t.topRight.y,a={share:n.share,fill:n.fill};else{const e=180/Math.PI*Math.atan((t.bottomRight.y-t.topRight.y)/(t.topRight.x-t.bottomRight.x));i=e<15&&e>=0?t.topRight.x:e>-15&&e<0?t.bottomRight.x:e<-15?(t.bottomRight.x-t.topRight.x)/2+t.topRight.x+15:(t.topRight.x-t.bottomRight.x)/2+t.bottomRight.x+15,r=t.topRight.y,o=t.width-i,s=t.bottomRight.y-t.topRight.y,a={fill:n.fill}}return{tag:e,type:"rect",x:i,y:r,width:o,height:s,data:n.data,desc:a,fill:"none"}},sm=(e,t)=>{const n=(e=>{const t=(e=>{let t=0;return e.forEach((e=>{e.num>t&&(t=e.num)})),t})(e);let n=0;return e.slice().reverse().map((e=>{const i={datum:e,s:n/t,e:e.num/t};return n=e.num,i})).reverse()})(e),i=t.width*rm,r=t.height*rm,o=(t.width-i)/2,a=(t.height-r)/2,s=i-(i>om&&r>om?100:0),l=(r-1*(n.length-1))/n.length,c=[];return n.forEach(((e,i)=>{const r=(u=e.e,h=i<n.length-1?e.s:e.e,[.5-.5*u,.5+.5*u,.5+.5*h,.5-.5*h]).map((e=>Math.round(e*s+o)));var u,h;const d=l*i+1*i+a,f={bottomRight:{x:r[2],y:Math.round(d+l)},bottomLeft:{x:r[3],y:Math.round(d+l)},topRight:{x:r[1],y:Math.round(d)},topLeft:{x:r[0],y:Math.round(d)},width:t.width},p=`M${f.topLeft.x},${f.topLeft.y} L${f.topRight.x},${f.topRight.y} ${f.bottomRight.x},${f.bottomRight.y} ${f.bottomLeft.x},${f.bottomLeft.y}Z`;c.push({tag:"section",type:"path",d:p,data:e.datum.data,fill:e.datum.fill});const g={share:e.e,fill:e.datum.fill,data:e.datum.data};l>12&&(f.bottomRight.x-f.bottomLeft.x>32&&c.push(am("labelCenter",f,g)),c.push(am("labelLeft",f,g)))})),c},lm=(e,t,n,i)=>(i-e)/i*(t-n)+n,cm=(e,t,n)=>{const i=e.filter((e=>"NaN"!==e.num&&e.num>0)),r=i.length,o=n.width*rm,a=n.height*rm,s=Math.round((n.width-o)/2),l=Math.round((n.height-a)/2),c=o-(o>om&&a>om?100:0),u=a-1*(r-1),h=[],d=i[0].data.num.value;let f=l;return i.forEach(((e,i)=>{const r=t[i]*u,o=Math.round(lm(f-l,c,.2*c,a)/2),p=Math.round(lm(f-l+r,c,.2*c,a)/2),g=s+Math.round(c/2),m={bottomRight:{x:g+p,y:Math.round(f+r)},bottomLeft:{x:g-p,y:Math.round(f+r)},topRight:{x:g+o,y:f},topLeft:{x:g-o,y:f},width:n.width},y=`M${m.topLeft.x},${m.topLeft.y} L${m.topRight.x},${m.topRight.y} ${m.bottomRight.x},${m.bottomRight.y} ${m.bottomLeft.x},${m.bottomLeft.y}Z`;h.push({tag:"section",type:"path",d:y,data:e.data,fill:e.fill});const v={share:e.data.num.value/d,fill:e.fill,data:e.data};r>2&&(m.bottomRight.x-m.bottomLeft.x>32&&h.push(am("labelCenter",m,v)),h.push(am("labelLeft",m,v))),f+=r+1})),h},um=(e,t,n)=>{const i=e.filter((e=>"NaN"!==e.num&&e.num>0));if(i&&i.length>0)switch(t){case"WIDTH":default:return sm(i,n);case"ORDER":return cm(i,i.map((()=>1/i.length)),n);case"HEIGHT":return cm(i,(e=>{const t=e.reduce(((e,t)=>e+t.data.num.value),0);return e.map((e=>e.data.num.value/t))})(i),n);case"AREA":return cm(i,((e,t,n)=>{const i=e.reduce(((e,t)=>e+t.data.num.value),0),r=t.width*rm,o=t.height*rm,a=r*n,s=o*(r+a)/2,l=(r-a)/2/o,c=[];let u=0;for(let t=e.length-1;t>=0;t--){const n=e[t].data.num.value/i,r=2*l*u+a,h=-r/(2*l)+Math.sqrt(r*r/(4*l*l)+n*s/l);c[t]=h/o,u+=h}return c})(i,n,.2),n)}return[]};var hm={require:["resolver"],defaultSettings:{settings:{},data:{},style:{item:"$shape"}},render({data:e}){const t=this.resolver.resolve({data:e,defaults:{...im,...this.style.item},settings:this.settings.settings});return um(t.items,this.settings.settings.mode,this.rect)}};const dm={version:"1.9.37",color:{auto:!0,autoMinMax:!0,byDimDef:void 0,byMeasureDef:void 0,colorExpression:void 0,dimensionScheme:"12",expressionIsColor:!0,expressionLabel:"",measureMin:void 0,measureMax:void 0,measureScheme:"sg",mode:"primary",paletteColor:{index:6},persistent:!1,reverseScheme:!1,singleColor:void 0,useBaseColors:"off",useDimColVal:!0,useMeasureGradient:!0},dataPoint:{auto:!0,labelMode:"share"},footnote:"",funnel:{mode:"WIDTH"},qHyperCubeDef:{qDimensions:[],qMeasures:[],qInterColumnSortOrder:[],qInitialDataFetch:[{qWidth:2,qHeight:5e3}],qSuppressMissing:!0,qSuppressZero:!1},showDimensionTitle:!0,showTitles:!0,subtitle:"",title:""};function fm(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function pm(e,t,n,i,r,o,a){try{var s=e[o](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(i,r)}function gm(e){return function(){var t=this,n=arguments;return new Promise((function(i,r){var o=e.apply(t,n);function a(e){pm(o,i,r,a,s,"next",e)}function s(e){pm(o,i,r,a,s,"throw",e)}a(void 0)}))}}function mm(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t);if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ym(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function vm(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ym(Object(n),!0).forEach((function(t){mm(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ym(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function xm(e,t){if(null==e)return{};var n,i,r=function(e,t){if(null==e)return{};var n={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(-1!==t.indexOf(i))continue;n[i]=e[i]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)n=o[i],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function bm(){
|
10
10
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
11
|
-
var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",r=n.toStringTag||"@@toStringTag";function o(n,i,r,o){var l=i&&i.prototype instanceof s?i:s,c=Object.create(l.prototype);return wm(c,"_invoke",function(n,i,r){var o,s,l,c=0,u=r||[],h=!1,d={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return o=t,s=0,l=e,d.n=n,a}};function f(n,i){for(s=n,l=i,t=0;!h&&c&&!r&&t<u.length;t++){var r,o=u[t],f=d.p,p=o[2];n>3?(r=p===i)&&(l=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=f&&((r=n<2&&f<o[1])?(s=0,d.v=i,d.n=o[1]):f<p&&(r=n<3||o[0]>i||i>p)&&(o[4]=n,o[5]=i,d.n=p,s=0))}if(r||n>1)return a;throw h=!0,i}return function(r,u,p){if(c>1)throw TypeError("Generator is already running");for(h&&1===u&&f(u,p),s=u,l=p;(t=s<2?e:l)||!h;){o||(s?s<3?(s>1&&(d.n=-1),f(s,l)):d.n=l:d.v=l);try{if(c=2,o){if(s||(r="next"),t=o[r]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(l=TypeError("The iterator does not provide a '"+r+"' method"),s=1);o=e}else if((t=(h=d.n<0)?l:n.call(i,d))!==a)break}catch(t){o=e,s=1,l=t}finally{c=1}}return{value:t,done:h}}}(n,r,o),!0),c}var a={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][i]?t(t([][i]())):(wm(t={},i,(function(){return this})),t),h=c.prototype=s.prototype=Object.create(u);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,wm(e,r,"GeneratorFunction")),e.prototype=Object.create(h),e}return l.prototype=c,wm(h,"constructor",c),wm(c,"constructor",l),l.displayName="GeneratorFunction",wm(c,r,"GeneratorFunction"),wm(h),wm(h,r,"Generator"),wm(h,i,(function(){return this})),wm(h,"toString",(function(){return"[object Generator]"})),(bm=function(){return{w:o,m:d}})()}function wm(e,t,n,i){var r=Object.defineProperty;try{r({},"",{})}catch(e){r=0}wm=function(e,t,n,i){if(t)r?r(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n;else{function o(t,n){wm(e,t,(function(e){return this._invoke(t,n,e)}))}o("next",0),o("throw",1),o("return",2)}},wm(e,t,n,i)}function km(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,r,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=o.call(n)).done)&&(s.push(i.value),s.length!==t);l=!0);}catch(e){c=!0,r=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return s}}(e,t)||Sm(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _m(e){return function(e){if(Array.isArray(e))return fm(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Sm(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Mm(e){return Mm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Mm(e)}function Sm(e,t){if(e){if("string"==typeof e)return fm(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?fm(e,t):void 0}}var Rm,Cm="top",Nm="top-right",Dm="right",qm="bottom-right",Em="bottom",Om="bottom-left",zm="left",Am="top-left";mm(mm(mm(mm(mm(mm(mm(mm(mm(mm(Rm={},"equal-equal",[Cm,Em]),"equal-higher",[Em,qm]),"equal-lower",[Cm,Nm]),"equal-void",[Cm,Em]),"higher-equal",[zm,Om,Cm,Nm]),"higher-higher-acute",[Em,Om,zm,Nm]),"higher-higher-obtuse",[Em,Cm]),"higher-lower-negative",[Cm,Nm,Dm]),"higher-lower-positive",[Em,Om,zm]),"higher-void",[Cm]),mm(mm(mm(mm(mm(mm(mm(mm(mm(mm(Rm,"lower-equal",[Cm]),"lower-higher-negative",[Cm,Am]),"lower-higher-positive",[qm]),"lower-lower-acute",[Cm,Am,zm,Nm,Dm]),"lower-lower-obtuse",[Cm,Em]),"lower-void",[Cm]),"void-equal",[Cm]),"void-higher",[Cm,Em]),"void-lower",[Cm,Em,zm]),"void-void",[Cm]),mm(Rm,"unclassified",[Cm,Em,Dm,zm,Nm,qm,Om,Am]);var Tm=["American Typewriter, serif","Andalé Mono, monospace","Arial Black, sans-serif","Arial, sans-serif","Bradley Hand, cursive","Brush Script MT, cursive","Comic Sans MS, cursive","Courier, monospace","Didot, serif","Georgia, serif","Impact, sans-serif","Lucida Console, monospace","Luminari, fantasy","Monaco, monospace","QlikView Sans, sans-serif","Source Sans Pro, sans-serif","Tahoma, sans-serif","Times New Roman, serif","Trebuchet MS, sans-serif","Verdana, sans-serif"],Im=["Abril Fatface, serif","Bangers, fantasy","Bebas Neue, sans serif","EB Garamond, serif","Fredoka One, fantasy","Graduate, fantasy","Gravitas One, serif","Indie Flower, fantasy","Inter, sans-serif","Lobster, fantasy","Montserrat, sans-serif","Nixie One, sans-serif","Noto Sans, sans-serif","Open Sans, sans-serif","PT Serif, serif","Pacifico, cursive","Permanent Marker, fantasy","QlikView Sans, sans-serif","Raleway, sans-serif","Rammetto One, fantasy","Roboto, sans-serif","Source Sans Pro, sans-serif","Titan One, fantasy","Yanone Kaffeesatz, sans-serif"];var jm=function(e){return{value:e,label:e.charAt(0).toUpperCase()+e.slice(1),groupHeader:!1,disabled:!1,styles:{fontFamily:e}}};function Pm(e){var t=e.theme,n=e.translator,i=e.defaultValue,r=e.flags,o=[],a=t.getStyle("","","fontFamilies");return Array.isArray(a)&&a.length?o.push.apply(o,_m(new Set([i].concat(_m(a.map((function(e){return e.split(",").map((function(e){return e.trim()})).map((function(e){return e.replace(/\s+/g," ").trim()})).filter(Boolean).join(", ")}))))))):o.push(i),[{value:"ThemeHeader",label:n.get("properties.themeFonts"),metaText:n.get("properties.theme"),groupHeader:!0}].concat(_m(o.map((function(e){return jm(e)}))),[{value:"DefaultHeader",label:n.get("properties.allFonts"),metaText:n.get("properties.default"),groupHeader:!0}],_m(function(e){return null!=e&&e.isEnabled("PS_20852_WYSIWYG_FONT_SUPPORT")?Im:Tm}(r).map((function(e){return jm(e)}))))}function Fm(e){var t=e.theme,n=e.translator,i=e.id,r=e.path,o=e.flags,a=function(){return t.getStyle(i,r,"fontFamily")};return{getDefaultValue:function(){return a()},getOptions:function(){return Pm({theme:t,translator:n,defaultValue:a(),flags:o})}}}var Lm,$m,Bm=["10px","11px","12px","13px","14px","15px","16px","17px","18px","19px","20px","21px","22px","23px","24px"],Hm=function(e){return{value:e,label:e,groupHeader:!1,disabled:!1}};function Wm(e){var t=e.theme,n=e.translator,i=e.id,r=e.path,o=function(){return t.getStyle(i,r,"fontSize")};return{getDefaultValue:function(){return o()},getOptions:function(){return function(e){var t=e.translator,n=e.defaultValue,i=[],r=e.theme.getStyle("","","fontSizes");return Array.isArray(r)&&r.length?i.push.apply(i,_m(new Set([n].concat(_m(r))))):i.push(n),[{value:"ThemeHeader",label:t.get("properties.themeFontSizes"),metaText:t.get("properties.theme"),groupHeader:!0}].concat(_m(i.map((function(e){return Hm(e)}))),[{value:"DefaultHeader",label:t.get("properties.allFontSizes"),metaText:t.get("properties.default"),groupHeader:!0}],_m(Bm.map((function(e){return Hm(e)}))))}({theme:t,translator:n,defaultValue:o()})}}}function Vm(e){var t=e.theme,n=e.translator,i=e.id,r=e.path;return{fontFamily:Fm({theme:t,translator:n,id:i,path:r,flags:e.flags}),fontSize:Wm({theme:t,translator:n,id:i,path:r})}}var Um,Ym=function(){if($m)return Lm;$m=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,r=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},o=function(n){if(!n||"[object Object]"!==t.call(n))return!1;var i,r=e.call(n,"constructor"),o=n.constructor&&n.constructor.prototype&&e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!r&&!o)return!1;for(i in n);return void 0===i||e.call(n,i)},a=function(e,t){n&&"__proto__"===t.name?n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},s=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(i)return i(t,n).value}return t[n]};return Lm=function e(){var t,n,i,l,c,u,h=arguments[0],d=1,f=arguments.length,p=!1;for("boolean"==typeof h&&(p=h,h=arguments[1]||{},d=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)i=s(h,n),h!==(l=s(t,n))&&(p&&l&&(o(l)||(c=r(l)))?(c?(c=!1,u=i&&r(i)?i:[]):u=i&&o(i)?i:{},a(h,{name:n,newValue:e(p,u,l)})):void 0!==l&&a(h,{name:n,newValue:l}));return h},Lm}(),Km=(Um=Ym)&&Um.__esModule&&Object.prototype.hasOwnProperty.call(Um,"default")?Um.default:Um;function Xm(e,t){return{range:function(e){var n=e.resources,i=e.data,r=n.theme.palette("categorical",0===t?i.items.length:t);return i.items.map((function(e){return r[e.value%r.length]}))},valueAccessor:e.value}}function Gm(e,t){return{range:function(e){var n=e.resources,i=e.data,r=n.theme.palette("categorical",0===t?i.items.length:t);return i.items.map((function(e){return r[e.row.value%r.length]}))},valueAccessor:e.value}}function Jm(e,t,n,i,r){var o,a,s=r.byRow,l=r.byElemNo;if(i&&(t.input.persistent||e.hc.qDimensionInfo.length>1||void 0===n.activeDimensionIndex&&e.hc.qSize.qcy>((null===(a=(o=e.hc).qDataPages[0]||o.qStackedDataPages[0])||void 0===a?void 0:a.qArea.qHeight)||0)))return l(i,i.raw().qCardinal);if(i){var c=t.pic.extract({field:i.key(),trackBy:i.value}).length;return s(i,c)}return{}}function Zm(e,t){var n=e.hc.qDimensionInfo,i=t.input.byDimDef||{activeDimensionIndex:n.length-1};if(i.activeDimensionIndex>=0){var r=n[i.activeDimensionIndex];i=r.coloring&&r.coloring.colorMapRef?{type:"libraryItem",key:r.coloring.colorMapRef,activeDimensionIndex:i.activeDimensionIndex}:{activeDimensionIndex:i.activeDimensionIndex}}return i}function Qm(e,t){var n;return t.activeDimensionIndex>=0?n=e.pic.fields().filter((function(e){return"dimension"===e.type()}))[t.activeDimensionIndex]:"libraryItem"===t.type?!1===(n=t.key?e.pic.field((function(e){return e.raw().colorMapRef===t.key})):void 0)&&(n=e.pic.field((function(e){return"colorByAlternative"===e.raw().id}))):"expression"===t.type&&(n=e.pic.field((function(e){return"colorByAlternative"===e.raw().id}))),n}function ey(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function ty(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function ny(){}var iy=1/.7,ry="\\s*([+-]?\\d+)\\s*",oy="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ay="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",sy=/^#([0-9a-f]{3,8})$/,ly=new RegExp(`^rgb\\(${ry},${ry},${ry}\\)$`),cy=new RegExp(`^rgb\\(${ay},${ay},${ay}\\)$`),uy=new RegExp(`^rgba\\(${ry},${ry},${ry},${oy}\\)$`),hy=new RegExp(`^rgba\\(${ay},${ay},${ay},${oy}\\)$`),dy=new RegExp(`^hsl\\(${oy},${ay},${ay}\\)$`),fy=new RegExp(`^hsla\\(${oy},${ay},${ay},${oy}\\)$`),py={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function gy(){return this.rgb().formatHex()}function my(){return this.rgb().formatRgb()}function yy(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=sy.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?vy(t):3===n?new ky(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?xy(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?xy(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=ly.exec(e))?new ky(t[1],t[2],t[3],1):(t=cy.exec(e))?new ky(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=uy.exec(e))?xy(t[1],t[2],t[3],t[4]):(t=hy.exec(e))?xy(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=dy.exec(e))?Ny(t[1],t[2]/100,t[3]/100,1):(t=fy.exec(e))?Ny(t[1],t[2]/100,t[3]/100,t[4]):py.hasOwnProperty(e)?vy(py[e]):"transparent"===e?new ky(NaN,NaN,NaN,0):null}function vy(e){return new ky(e>>16&255,e>>8&255,255&e,1)}function xy(e,t,n,i){return i<=0&&(e=t=n=NaN),new ky(e,t,n,i)}function by(e){return e instanceof ny||(e=yy(e)),e?new ky((e=e.rgb()).r,e.g,e.b,e.opacity):new ky}function wy(e,t,n,i){return 1===arguments.length?by(e):new ky(e,t,n,null==i?1:i)}function ky(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}function _y(){return`#${Cy(this.r)}${Cy(this.g)}${Cy(this.b)}`}function My(){const e=Sy(this.opacity);return`${1===e?"rgb(":"rgba("}${Ry(this.r)}, ${Ry(this.g)}, ${Ry(this.b)}${1===e?")":`, ${e})`}`}function Sy(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ry(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Cy(e){return((e=Ry(e))<16?"0":"")+e.toString(16)}function Ny(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new qy(e,t,n,i)}function Dy(e){if(e instanceof qy)return new qy(e.h,e.s,e.l,e.opacity);if(e instanceof ny||(e=yy(e)),!e)return new qy;if(e instanceof qy)return e;var t=(e=e.rgb()).r/255,n=e.g/255,i=e.b/255,r=Math.min(t,n,i),o=Math.max(t,n,i),a=NaN,s=o-r,l=(o+r)/2;return s?(a=t===o?(n-i)/s+6*(n<i):n===o?(i-t)/s+2:(t-n)/s+4,s/=l<.5?o+r:2-o-r,a*=60):s=l>0&&l<1?0:a,new qy(a,s,l,e.opacity)}function qy(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}function Ey(e){return(e=(e||0)%360)<0?e+360:e}function Oy(e){return Math.max(0,Math.min(1,e||0))}function zy(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}ey(ny,yy,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:gy,formatHex:gy,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Dy(this).formatHsl()},formatRgb:my,toString:my}),ey(ky,wy,ty(ny,{brighter(e){return e=null==e?iy:Math.pow(iy,e),new ky(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new ky(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ky(Ry(this.r),Ry(this.g),Ry(this.b),Sy(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:_y,formatHex:_y,formatHex8:function(){return`#${Cy(this.r)}${Cy(this.g)}${Cy(this.b)}${Cy(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:My,toString:My})),ey(qy,(function(e,t,n,i){return 1===arguments.length?Dy(e):new qy(e,t,n,null==i?1:i)}),ty(ny,{brighter(e){return e=null==e?iy:Math.pow(iy,e),new qy(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new qy(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*t,r=2*n-i;return new ky(zy(e>=240?e-240:e+120,r,i),zy(e,r,i),zy(e<120?e+240:e-120,r,i),this.opacity)},clamp(){return new qy(Ey(this.h),Oy(this.s),Oy(this.l),Sy(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Sy(this.opacity);return`${1===e?"hsl(":"hsla("}${Ey(this.h)}, ${100*Oy(this.s)}%, ${100*Oy(this.l)}%${1===e?")":`, ${e})`}`}}));const Ay=Math.PI/180,Ty=180/Math.PI,Iy=4/29,jy=6/29,Py=3*jy*jy;function Fy(e){if(e instanceof Ly)return new Ly(e.l,e.a,e.b,e.opacity);if(e instanceof Vy)return Uy(e);e instanceof ky||(e=by(e));var t,n,i=Wy(e.r),r=Wy(e.g),o=Wy(e.b),a=$y((.2225045*i+.7168786*r+.0606169*o)/1);return i===r&&r===o?t=n=a:(t=$y((.4360747*i+.3850649*r+.1430804*o)/.96422),n=$y((.0139322*i+.0971045*r+.7141733*o)/.82521)),new Ly(116*a-16,500*(t-a),200*(a-n),e.opacity)}function Ly(e,t,n,i){this.l=+e,this.a=+t,this.b=+n,this.opacity=+i}function $y(e){return e>.008856451679035631?Math.pow(e,1/3):e/Py+Iy}function By(e){return e>jy?e*e*e:Py*(e-Iy)}function Hy(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Wy(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Vy(e,t,n,i){this.h=+e,this.c=+t,this.l=+n,this.opacity=+i}function Uy(e){if(isNaN(e.h))return new Ly(e.l,0,0,e.opacity);var t=e.h*Ay;return new Ly(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}ey(Ly,(function(e,t,n,i){return 1===arguments.length?Fy(e):new Ly(e,t,n,null==i?1:i)}),ty(ny,{brighter(e){return new Ly(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new Ly(this.l-18*(null==e?1:e),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return new ky(Hy(3.1338561*(t=.96422*By(t))-1.6168667*(e=1*By(e))-.4906146*(n=.82521*By(n))),Hy(-.9787684*t+1.9161415*e+.033454*n),Hy(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),ey(Vy,(function(e,t,n,i){return 1===arguments.length?function(e){if(e instanceof Vy)return new Vy(e.h,e.c,e.l,e.opacity);if(e instanceof Ly||(e=Fy(e)),0===e.a&&0===e.b)return new Vy(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Ty;return new Vy(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new Vy(e,t,n,null==i?1:i)}),ty(ny,{brighter(e){return new Vy(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new Vy(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return Uy(this).rgb()}}));var Yy=e=>()=>e;function Ky(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):Yy(isNaN(e)?t:e)}var Xy=function e(t){var n=function(e){return 1==(e=+e)?Ky:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(i){return Math.pow(e+i*t,n)}}(t,n,e):Yy(isNaN(t)?n:t)}}(t);function i(e,t){var i=n((e=wy(e)).r,(t=wy(t)).r),r=n(e.g,t.g),o=n(e.b,t.b),a=Ky(e.opacity,t.opacity);return function(t){return e.r=i(t),e.g=r(t),e.b=o(t),e.opacity=a(t),e+""}}return i.gamma=e,i}(1),Gy=/^class(-pyramid)?/,Jy=function(e,t,n,i){var r=void 0!==n.min?n.min:i.min(),o=void 0!==n.max?n.max:i.max(),a=r,s=o,l=t.limits,c={},u="percent"===t.limitType?l.map((function(e){return r+(o-r)*e})):l,h=t.colors.map((function(t){return e.resolveUIColor(t)}));if(r=Math.min.apply(Math,[r].concat(_m(u))),o=Math.max.apply(Math,[o].concat(_m(u))),c.min=r,c.max=o,t.breakTypes&&-1===t.breakTypes.indexOf(!0))c.type="categorical",Object.assign(c,function(e){var t=e.min,n=e.max,i=e.limits,r=e.range,o=[],a=[];if(i.length)if(i[i.length-1]<t)a.push(t,n),o.push(r[r.length-1],r[r.length-1],r[r.length-1]);else if(i[0]>n)a.push(t,n),o.push(r[0],r[0],r[0]);else{if(i[0]>t)a.push(t),o.push(r[0]);else{a.push(t);for(var s=0;s<i.length;s++)if(t<i[s]){o.push(r[s]);break}}for(var l=0;l<i.length;l++)t<i[l]&&i[l]<n&&(a.push(i[l]),o.push(r[l]));if(i[i.length-1]<n)a.push(n),o.push(r[i.length]),o.push(r[i.length]);else{a.push(n);for(var c=0;c<i.length;c++)if(i[c]>n){o.push(r[c]),o.push(r[c]);break}}}else o.push(r[0]);return{min:t,max:n,range:o,domain:a}}({min:"percent"===t.limitType?r:a,max:"percent"===t.limitType?o:s,range:h,limits:"percent"===t.limitType?u:l}));else if(t.breakTypes){var d=t.breakTypes;c.type="continuous",c.domain=[r],c.range=[h[0]];for(var f=0;f<u.length;f+=1)if(d[f]){var p=h[f],g=h[f+1],m=Xy(p,g)(.5);c.range.push(m),c.domain.push(u[f]),f<u.length-1&&d[f+1]&&(c.range.push(h[f+1]),c.domain.push((u[f]+u[f+1])/2))}else c.range.push(h[f]),c.range.push(h[f+1]),c.domain.push(u[f]),c.domain.push(u[f]+Math.min(1e-6,(o-r)/1e6));c.range.push(h[h.length-1]),c.domain.push(o)}else c.domain=u,c.range=h;return c};function Zy(e,t,n,i,r){var o,a,s,l=0,c=[],u=(e-t)/(i+1);if(0===u)return 1;for(o=0;o<n.length;o+=1)a=.99*(n[o]-t),s=n[o]>e?Math.floor(e/u):n[o]<t?0:Math.floor(a/u),Number.isNaN(s)||(c[s]?c[s]+=1:c[s]=1);for(o=0;o<c.length;o+=1)c[o]&&(l+=1);return l<=i||l>=r?Math.max(l,i):Zy(e,t,n,i+1,r)}var Qy=function(e,t,n,i){var r,o,a=t.theme,s=t.hc,l=i.f,c={mode:"field",fieldType:"measure",field:l?l.key():void 0,reverse:n.input.reverseScheme||!1,type:"continuous",range:function(e){return e.resources.theme.palette("quant")}},u=[],h=!0;if(l){if(Number.isNaN(+l.min())||Number.isNaN(+l.max()))return{invalid:!0};(h=!("S"===(r=n.pic.raw()).qMode&&(r.qDataPages[0]&&r.qSize.qcy>r.qDataPages[0].qArea.qHeight||!r.qDataPages.length&&r.qSize.qcy>0)||"K"===r.qMode&&r.qStackedDataPages[0]&&r.qSize.qcy>r.qStackedDataPages[0].qArea.qHeight||"T"===r.qMode&&r.qSize.qcy>r.qTreeDataPages[0].qGroupSize))&&(u=n.pic.extract({field:0,props:{num:{field:l.key()},exclude:{fields:s.qDimensionInfo.map((function(e,t){return{field:"qDimensionInfo/".concat(t)}})),value:function(e){return Math.min.apply(Math,_m(e))<0}}}}).filter((function(e){return e.value>=0&&!e.exclude.value})).map((function(e){return e.num.value})).filter((function(e){return"number"==typeof e})))}if(!1===n.input.autoMinMax){if(c.min=n.input.measureMin,c.max=n.input.measureMax,c.max<c.min)return{invalid:!0}}else if(l&&!h)c.min=l.min(),c.max=l.max();else if(l){if(!u.length)return{invalid:!0};c.min=Math.min.apply(Math,_m(u)),c.max=Math.max.apply(Math,_m(u))}if(n.input.measureScheme&&(c.palettes={quant:n.input.measureScheme}),a){var d=a.getDataColorScales().filter((function(e){return e.key===n.input.measureScheme}))[0];c.type=d&&Gy.test(d.type)?"categorical":"continuous","categorical"===c.type&&(o=d.colors.some((function(e){return Array.isArray(e)}))?Math.max.apply(Math,_m(d.colors.map((function(e){return e?e.length:0})))):d.colors.length)}if("categorical"===c.type){for(var f=h?Zy(c.max,c.min,u,1,o):o,p=(c.max-c.min)/f,g=[],m=0;m<f+1;m+=1)g.push(c.min+p*m);c.domain=g,c.range=function(e){for(var t=e.resources.theme.palette("quant",f),n=Math.max(1,Math.floor(t.length/f)),i=[],r=0;r<f;r+=1)i.push(t[r*n]);return[i[0]].concat(i,[i[i.length-1]])}}return c};function ev(e,t){var n;return t.activeMeasureIndex>=0?n=e.pic.fields().filter((function(e){return"measure"===e.type()}))[t.activeMeasureIndex]:"libraryItem"===t.type?n=e.pic.field((function(e){return e.raw().colorMapRef===t.key&&void 0!==t.key})):"expression"===t.type&&(n=e.pic.field((function(e){return"colorByAlternative"===e.raw().id}))),n||(n=e.pic.field((function(e){return void 0!==e.raw().matchMeasure})))&&(n=e.pic.fields().filter((function(e){return"measure"===e.type()}))[n.raw().matchMeasure]),n}function tv(e){e.measureOverrides.every((function(e){return!e}))&&(e.measureOverrides=null)}function nv(e,t){for(var n=(null==t?void 0:t.domain)||[],i=(null==t?void 0:t.range)||[],r=[],o=0;o<e.length;++o){var a=e[o];if("constant"===(null==a?void 0:a.mode)){var s=n.indexOf(o);-1===s?(n.push(o),i.push(a.primary)):i[s]=a.primary,e[o]=null}else if(a){r.push(o);var l=n.indexOf(o);-1!==l&&(n.splice(l,1),i.splice(l,1))}}return{domain:n,range:i,exclude:r}}function iv(e,t,n,i){var r,o=function(e,t,n,i){if(t.input&&!t.input.auto){if("byMeasure"===t.input.mode)return function(e,t,n){var i=t.theme,r=t.hc,o=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).getCField,a=void 0===o?ev:o,s=n.input.byMeasureDef||{activeMeasureIndex:0},l=a(n,s),c=Qy(0,{theme:i,hc:r},n,{f:l});if(c.invalid)return c;"expression"===s.type&&(s.activeMeasureIndex<0||void 0===s.activeMeasureIndex)&&(c.label=s.label,l&&"color.altLabel"===l.raw().labelExpRef&&(c.label=n.input.altLabel)),!c.label&&l&&(c.label=l.title());var u=s.activeMeasureIndex>=0?l:null;if(!u&&l&&void 0!==l.raw().matchMeasure&&l.raw().matchMeasure>-1&&(u=n.pic.fields().filter((function(e){return"measure"===e.type()}))[l.raw().matchMeasure]),n.input.useMeasureGradient&&"libraryItem"===s.type)if(u){var h=u.raw().coloring;h&&h.gradient&&Km(c,Jy(e,h.gradient,c,u))}else c.auxiliary=s;return c}(e,n,t);if("byDimension"===t.input.mode)return function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=i.getCDef,o=void 0===r?Zm:r,a=i.getCByField,s=void 0===a?Qm:a,l=i.getPersistence,c=void 0===l?Jm:l,u=o(t,n),h=s(n,u),d=h?h.raw():{},f=n&&n.pic?n.pic.raw():{};if(d.qError||d.qSize&&0===d.qSize.qcy&&!f.qHasOtherValues)return{invalid:!0};var p={mode:"field",fieldType:"dimension",type:"categorical",field:h?h.key():void 0,isFieldLocked:d.qLocked};return("expression"===u.type||u.activeDimensionIndex<0)&&(p.label=u.label,"color.altLabel"===d.labelExpRef&&(p.label=n.input.altLabel)),!p.label&&h&&(p.label=h.title()),n.input.dimensionScheme&&(p.palettes={categorical:n.input.dimensionScheme}),n.input.useDimColVal&&"libraryItem"===u.type&&(p.auxiliary=u),Km(p,c(t,n,u,h,{byRow:Gm,byElemNo:Xm})),p}(e,n,t);if("byExpression"===t.input.mode)return function(e,t,n,i){var r=t.hc,o=t.theme,a=t.translator,s=n.pic.field((function(e){return"colorByExpression"===e.raw().id}));if(!s||!s.raw().qFallbackTitle&&!n.input.colorExpression||!(Number.isFinite(s.raw().qMin)&&Number.isFinite(s.raw().qMax)||n.input.expressionIsColor))return{mode:"constant",type:"constant",primary:i.nil};if(n.input.expressionIsColor)return{mode:"field",fieldType:"expression",field:s?s.key():void 0,type:"color"};var l=Qy(0,{hc:r,theme:o},n,{f:s});return l.invalid||(l.label=n.input.expressionLabel||a.get("Object.ChartTooltip.ColorExpression")),l}(0,n,t,i);if("byMultiple"===t.input.mode||"primary"===t.input.mode)return function(e,t,n,i){var r=t.hc,o=t.theme,a=t.translator,s=n.input.useBaseColors;if(("byMultiple"===n.input.mode||"primary"===n.input.mode&&"measure"===n.input.useBaseColors)&&r.qMeasureInfo.length>1&&(s="measure"),"measure"===s){var l=[],c=[];"measure"===n.input.useBaseColors&&r.qMeasureInfo.forEach((function(t,n){if(t.baseColor||t.coloring&&t.coloring.baseColor){l.push(n);var r=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===r?c.push(i.primary):c.push(r)}}));var u=n.input.dimensionScheme?{categorical:n.input.dimensionScheme}:void 0,h=o?o.getDataColorPalettes()[0]:void 0;return"measure"===n.input.useBaseColors&&h&&(u={categorical:h.key}),{mode:"measure",type:"categorical",palettes:u,label:a?a.get("Common.Measures"):void 0,explicit:l.length?{domain:l,range:c}:void 0}}if("dimension"===s){var d=[],f=[];return r.qDimensionInfo.forEach((function(t,n){if(t.baseColor||t.coloring&&t.coloring.baseColor){d.push(n);var r=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===r?f.push(i.primary):f.push(r)}})),{mode:"dimension",type:"categorical",field:d.length?d[0]:void 0,explicit:d.length?{domain:d,range:f}:void 0}}var p=i.primary;if(void 0!==n.input.paletteColor)n.input.paletteColor&&(p=e.resolveUIColor(n.input.paletteColor));else{var g=n.input.singleColor;"number"!=typeof g||Number.isNaN(g)||(p=["#b0afae","#7b7a78","#545352","#4477aa","#7db8da","#b6d7ea","#46c646","#f93f17","#ffcf02","#276e27","#ffffff","#000000"][g])}return{mode:"constant",type:"constant",primary:p}}(e,n,t,i)}return{}}(e,t,n,i);return null!==(r=t.input)&&void 0!==r&&r.measureOverrides?(o.measureOverrides=t.input.measureOverrides.map((function(n,r){return function(e){var t,n=e.cm,i=e.defaults,r=e.index,o=e.input,a=e.pic;if(!o||!o.on)return null;var s=null!==(t=o.mode)&&void 0!==t?t:"primary";return"primary"===s?function(e,t,n){var i=n.primary;return void 0!==t.paletteColor&&t.paletteColor&&(i=e.resolveUIColor(t.paletteColor)),vm(vm({},n),{},{mode:"constant",type:"constant",primary:i})}(n,o,i):"byExpression"===s?function(e,t,n){var i="qMeasureInfo/".concat(e,"/"),r=t.field((function(e){return e.id().startsWith(i)&&"colorByMeasureExpression"===e.raw().id})),o=r;return vm(vm({},n),{},o?{mode:"field",fieldType:"expression",field:r?r.key():void 0,type:"color"}:{mode:"constant",type:"constant",primary:n.nil})}(r,a,i):null}({cm:e,input:n,defaults:i,index:r,pic:t.pic})})),function(e,t){var n,i,r,o=t.translator;if(tv(e),1===(null===(n=e.measureOverrides)||void 0===n?void 0:n.length))return e.measureOverrides[0];if("measure"===e.mode&&e.measureOverrides&&(e.explicit=nv(e.measureOverrides,e.explicit),tv(e)),null!==(i=e.measureOverrides)&&void 0!==i&&i.every((function(e){return"constant"===(null==e?void 0:e.mode)}))){var a={mode:"measure",type:"categorical",label:null==o?void 0:o.get("Common.Measures")};return a.explicit=nv(e.measureOverrides),a}return null!==(r=e.measureOverrides)&&void 0!==r&&r.every((function(e){return e}))?{invalid:!0,measureOverrides:e.measureOverrides}:e}(o,n)):o}var rv=function(e,t){var n=e.fieldType,i={};if(t)if("measure"===n){var r=t.coloring;r&&(i.measureGradient=r.gradient)}else if("dimension"===n){var o=t[0],a=t[1];o&&(i.legendDataPage=o),a&&(i.dimValsData=a.colorMap)}return i},ov=function(e){throw e.isHandled=!0,e};function av(e){return function(t){return"object"===Mm(t.datum[e])?t.datum[e].value:void 0}}function sv(e){return"object"===Mm(e.datum.isNull)?e.datum.isNull.value:-2===e.datum.value}function lv(e){return-3===e.datum.value}var cv={COLOR:void 0,FONT_SIZE:"16px",FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"},uv={COLOR:void 0,FONT_SIZE:void 0,FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"};function hv(e){var t=e.theme,n=e.key,i=e.styleOverrides,r={title:{color:cv.COLOR,fontSize:cv.FONT_SIZE,fontFamily:cv.FONT_FAMILY},label:{color:uv.COLOR,fontSize:uv.FONT_SIZE,fontFamily:uv.FONT_FAMILY}};if(!t&&!i)return r;var o=i||{},a=o.title,s=o.label,l=function(e){var t=e.theme,n=e.key;return function(e,i,r,o){return void 0!==e?e:t?t.getStyle(n,i,r):o}}({theme:t,key:n});return r.title.color=l(null==a?void 0:a.color,"legend.title","color",cv.COLOR),r.title.fontSize=l(null==a?void 0:a.fontSize,"legend.title","fontSize",cv.FONT_SIZE),r.title.fontFamily=l(null==a?void 0:a.fontFamily,"legend.title","fontFamily",cv.FONT_FAMILY),r.label.color=l(null==s?void 0:s.color,"legend.label","color",uv.COLOR),r.label.fontSize=l(null==s?void 0:s.fontSize,"legend.label","fontSize",uv.FONT_SIZE),r.label.fontFamily=l(null==s?void 0:s.fontFamily,"legend.label","fontFamily",uv.FONT_FAMILY),r}var dv=function(e,t,n){var i=e&&e.dock||void 0;if("auto"!==i)return i||"right";if(t){var r=t.element.getBoundingClientRect();if(r.height>r.width)return"bottom"}return n?"left":"right"},fv=function(e,t,n){return!(n.invalid||"color"===n.type||"measure"===n.mode&&t.qMeasureInfo.length<=1||"dimension"===n.mode)&&("function"==typeof e.show?e.show():!1!==e.show)};function pv(e,t){var n=e.styleReference,i=e.styleOverrides,r=e.chart,o=e.rtl,a=t.legendProps,s=t.coloring,l=t.theme,c=t.hc,u=hv({theme:l,key:n,styleOverrides:i});return{layout:{minimumLayoutMode:"MEDIUM",dock:dv(a,r,o)},show:"function"==typeof a.show?function(){return fv(a,c,s)}:fv(a,c,s),renderer:"svg",mounted:function(e){e.childNodes[0].style.pointerEvents="none",e.style.overflow="hidden"},settings:{title:{show:!1!==a.showTitle,wordBreak:"break-word",maxLines:2,lineHeight:1.2,text:s.label||"",fill:u.title.color,fontSize:u.title.fontSize,fontFamily:u.title.fontFamily}}}}function gv(e,t,n){var i=[],r=[],o=function(e,t,n){return"categorical"===t.coloring.type?function(e,t,n){var i=pv(e,t);if(!i.show)return!1;var r,o=e.key,a=e.styleReference,s=e.styleOverrides,l=e.viewState,c=e.rtl,u=e.settings,h=e.style,d=t.scaleKey,f=t.theme,p=t.scales,g=hv({theme:f,key:a,styleOverrides:s}),m=i.layout.dock,y="left"===m||"right"===m?{maxLines:2,wordBreak:"break-word"}:{},v={up:"M13.6,11 L2.4,11 C2.28954305,11 2.2,10.9104569 2.2,10.8 C2.2,10.756726 2.21403557,10.7146192 2.24,10.68 L7.84,3.21333333 C7.90627417,3.12496777 8.03163444,3.10705916 8.12,3.17333333 C8.13516113,3.18470418 8.14862915,3.1981722 8.16,3.21333333 L13.76,10.68 C13.8262742,10.7683656 13.8083656,10.8937258 13.72,10.96 C13.6853808,10.9859644 13.643274,11 13.6,11 Z",down:"M2.4,4 L13.6,4 C13.7104569,4 13.8,4.08954305 13.8,4.2 C13.8,4.24327404 13.7859644,4.28538077 13.76,4.32 L8.16,11.7866667 C8.09372583,11.8750322 7.96836556,11.8929408 7.88,11.8266667 C7.86483887,11.8152958 7.85137085,11.8018278 7.84,11.7866667 L2.24,4.32 C2.17372583,4.23163444 2.19163444,4.10627417 2.28,4.04 C2.31461923,4.01403557 2.35672596,4 2.4,4 Z",left:"M11,2.4 L11,13.6 C11,13.7104569 10.9104569,13.8 10.8,13.8 C10.756726,13.8 10.7146192,13.7859644 10.68,13.76 L3.21333333,8.16 C3.12496777,8.09372583 3.10705916,7.96836556 3.17333333,7.88 C3.18470418,7.86483887 3.1981722,7.85137085 3.21333333,7.84 L10.68,2.24 C10.7683656,2.17372583 10.8937258,2.19163444 10.96,2.28 C10.9859644,2.31461923 11,2.35672596 11,2.4 Z",right:"M4,13.6 L4,2.4 C4,2.28954305 4.08954305,2.2 4.2,2.2 C4.24327404,2.2 4.28538077,2.21403557 4.32,2.24 L11.7866667,7.84 C11.8750322,7.90627417 11.8929408,8.03163444 11.8266667,8.12 C11.8152958,8.13516113 11.8018278,8.14862915 11.7866667,8.16 L4.32,13.76 C4.23163444,13.8262742 4.10627417,13.8083656 4.04,13.72 C4.01403557,13.6853808 4,13.643274 4,13.6 Z"};"dimension"===t.coloring.fieldType&&(r=function(e){return e.datum.value>=0||-3===e.datum.value});var x="".concat(d,"Legend");return Km(!0,i,{type:"legend-cat",key:"".concat(o,"-cat"),scale:x in p?x:d,settings:{layout:{scrollOffset:function(){return l?l.get("legendScrollOffset"):void 0},size:-1!==["top","bottom"].indexOf(i.layout.dock)?2:1,direction:c?"rtl":"ltr",horizontal:20},item:{show:r,label:vm({fill:g.label.color,fontSize:g.label.fontSize,fontFamily:g.label.fontFamily},y)},navigation:{disabled:n,button:{content:function(e,t){var n=t.direction;return e("i",{style:{"pointer-events":"none",fontSize:"12px",display:"inline-block",fontStyle:"normal",lineHeight:"0",textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizelegibility",margin:"0px"}},[e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor"},[e("path",{d:v[n]})])])}}}},brush:{consume:[{context:"selection",data:["",o],style:{inactive:{opacity:.3}}}]}},{settings:u,style:h})}(e,t,n):"continuous"===t.coloring.type&&function(e,t){var n,i=e.key,r=e.styleReference,o=e.styleOverrides,a=e.rtl,s=e.settings,l=e.style,c=t.scaleKey,u=t.theme,h="".concat(c,"Range"),d=pv(e,t);if(!d.show)return!1;var f=hv({theme:u,key:r,styleOverrides:o}),p=d.layout.dock,g="right"===p||"left"===p,m=null===(n=t.scales)||void 0===n?void 0:n[h];return g&&m&&(m.invert=!0),Km(!0,d,{type:"legend-seq",key:"".concat(i,"-seq"),settings:{fill:c,major:h,length:1,tick:{fill:f.label.color,fontSize:f.label.fontSize,fontFamily:f.label.fontFamily},title:{anchor:!a||"top"!==d.layout.dock&&"bottom"!==d.layout.dock?void 0:"right",padding:parseFloat(d.settings.title.fontSize)||16}}},{settings:s,style:l})}(e,t)}(e,t,n&&n.navigationDisabled);return i.push(o),o&&"legend-cat"===o.type&&(r.push(function(e){var t=e.key,n=e.requireFailure,i=e.recognizeWith,r=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:tap-".concat(t),type:"Tap",requireFailure:n,recognizeWith:i,options:{event:"legendtap",interval:10,pointers:1,enable:function(e,n){var i;if(!n)return!0;if(null!=r&&null!==(i=r.interact)&&void 0!==i&&i.enabled&&!r.interact.enabled())return!1;if(!this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some((function(e){return e.key==="".concat(t,"-cat")})))return!1;var o=n.srcEvent.target;return!!(o&&o.hasAttribute("data-action")&&o.hasAttribute("data-component-key"))||!(!o||!o.childNodes[0]||"BUTTON"!==o.childNodes[0].nodeName)}},events:{legendtap:function(e){e.preventDefault();var t=e.srcEvent.target;t&&t.hasAttribute("data-action")&&t.hasAttribute("data-component-key")&&this.chart.component(t.getAttribute("data-component-key")).emit(t.getAttribute("data-action"))}}}}(e,n)),r.push(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.eventName,n=e.key,i=e.requireFailure,r=e.recognizeWith,o=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:pan-".concat(n),type:"Pan",requireFailure:i,recognizeWith:r,options:{event:t,pointers:1,threshold:10,enable:function(e,i){var r;return this.started===t||!i||!(null!=o&&null!==(r=o.interact)&&void 0!==r&&r.enabled&&!o.interact.enabled())&&this.chart.componentsFromPoint({x:i.center.x,y:i.center.y}).some((function(e){return e.key==="".concat(n,"-cat")}))}},events:mm(mm(mm({},"".concat(t,"start"),(function(e){e.preventDefault(),this.started!==t&&(this.started=t,this.chart.component("".concat(n,"-cat")).emit("panstart",e))})),"".concat(t,"move"),(function(e){e.preventDefault(),this.chart.component("".concat(n,"-cat")).emit("panmove",e)})),"".concat(t,"end"),(function(e){e.preventDefault(),this.chart.component("".concat(n,"-cat")).emit("panend",e),this.started=!1}))}}(e,n))),{interactions:r,components:i}}function mv(e){var t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.auto,n=function(e){var t=vm({hc:null,colorProps:null,layout:null,theme:null},e),n={},i={auto:function(){return{mode:"primary"}},getDimensionColorMap:function(){return Promise.reject()},getMeasure:function(){return Promise.reject()},getAttributeDimension:function(){return Promise.reject()}},r={auto:function(e){return e?(i.auto=e,r):i.auto},getDimensionColorMap:function(e){return e?(i.getDimensionColorMap=e,r):i.getDimensionColorMap},getAttributeDimension:function(e){return e?(i.getAttributeDimension=e,r):i.getAttributeDimension},getMeasure:function(e){return e?(i.getMeasure=e,r):i.getMeasure},set:function(e){var r;if(!e.colorProps)throw new Error('Missing "colorProps"');if(Km(t,e),(n={pic:t.picasso.data("q")({data:t.hc,config:{localeInfo:t.localeInfo}}),input:t.colorProps}).input.auto){var o=i.auto(e.layout);n.input=Km(!0,{},n.input,o,{auto:!1});var a=t.theme?t.theme.getDataColorPalettes():[];a[0]&&(n.input.dimensionScheme=a[0].key);var s=0;n.input.byDimDef&&+n.input.byDimDef.activeDimensionIndex>=0&&(s=+n.input.byDimDef.activeDimensionIndex),t.hc&&t.hc.qDimensionInfo[s]&&t.hc.qDimensionInfo[s].coloring&&t.hc.qDimensionInfo[s].coloring.colorMapRef&&n.input.byDimDef&&(n.input.byDimDef.type="libraryItem",n.input.byDimDef.key=t.hc.qDimensionInfo[s].coloring.colorMapRef)}null!==(r=n.input.measureOverrides)&&void 0!==r&&r.every((function(e){return!e||!e.on}))&&(n.input=Km(!1,{},n.input,{measureOverrides:null}))},palettes:function(){if(!n.palettes){var e=t.theme,i=[];(e&&e.getDataColorPickerPalettes()||[]).forEach((function(e){i.push({key:"ui",colors:e.colors})})),n.palettes=i}return n.palettes},getAuxiliaryData:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/qHyperCubeDef";if(!e.auxiliary&&!/qAttrDimInfo/.test(e.field))return Promise.resolve();var r=(e.auxiliary||{}).key;if("measure"===e.fieldType)return i.getMeasure(r,t).catch((function(){}));if("dimension"===e.fieldType){var o="".concat(n,"/").concat(e.field).replace("qDimensionInfo","qDimensions").replace("qAttrDimInfo","qAttributeDimensions");return Promise.all([/qAttrDimInfo/.test(e.field)?i.getAttributeDimension(o,t).catch((function(){})):Promise.resolve(),r?i.getDimensionColorMap(r,t).catch((function(){})):Promise.resolve()])}return Promise.resolve()},getAuxiliarySettings:function(e,i){var r=this;return e.auxiliary||/qAttrDimInfo/.test(e.field)?(this.palettes(),this.getAuxiliaryData(e,i).then((function(i){if(!i)return{};if("measure"===e.fieldType){if(i.coloring&&i.coloring.gradient){var o=n.pic.field(e.field);return Jy(r,i.coloring.gradient,e,o)}return{}}if("dimension"===e.fieldType){var a={nil:e.nil,others:e.others},s=i[0],l=i[1]?i[1].colorMap:null;if(s){var c=t.picasso.data("q")({data:{qDimensionInfo:[n.pic.field(e.field).raw(),n.pic.field(e.field).raw()],qMeasureInfo:[],qDataPages:s,qInterColumnSortOrder:[0,1],qMode:"S"}});a.legendDataset=c}return l?function(e,t,n,i){var r=i.external,o=i.field,a=vm({},e);Km(a,Xm(o,o.raw().qCardinal));var s=r.theme?r.theme.getDataColorPalettes()[0]:null;return t.nul&&(a.nil=n.resolveUIColor(t.nul)),t.oth&&(a.others=n.resolveUIColor(t.oth)),t.usePal?(a.palettes={categorical:t.pal},s&&!t.pal&&(a.palettes.categorical=s.key,Km(a,Xm(o)))):!1===t.autoFill&&t.single?a.range=[n.resolveUIColor(t.single)]:t.autoFill&&(s&&(a.palettes={categorical:s.key}),Km(a,Xm(o))),t.colors&&t.colors.length&&(a.explicit=function(e,t,n){for(var i={},r=0;r<e.length;r+=1)i[e[r].value]=e[r].baseColor;var o=[];return{domain:function(e){var r=e.data,a=[];o=[];for(var s=0;s<r.items.length;s++){var l=r.items[s],c=(l.text||l).label;i[c]&&-1===a.indexOf(l.value)&&(a.push(l.value),o.push(t.resolveUIColor(i[c])))}return a.push(-3,-2),o.push(n.others),o.push(n.nil),a},range:function(){return o}}}(t.colors,n,a)),a}(a,l,r,{external:t,field:n.pic.field(e.field)}):a}return{}}))):Promise.resolve()},resolveUIColor:function(e){if(e.index<0||void 0===e.index)return e.color;if(void 0===n.uiPalette&&(n.uiPalette=this.palettes().filter((function(e){return"ui"===e.key}))[0]||!1),!n.uiPalette)return e.color;var t="none"===n.uiPalette.colors[0]?e.index:e.index-1;return void 0===n.uiPalette.colors[t]?e.color:n.uiPalette.colors[t]},settings:function(){if(this.palettes(),!n.settings){var e={primary:"steelblue",others:"#aaa",nil:"#ddd"},i=t.theme;i&&(e=vm(vm({},e),i.getDataColorSpecials())),n.settings=Km(e,iv(this,n,t,e))}return n.settings}};return r}(e.resources).auto(t||function(){return{mode:"byDimension",persistent:!1,useDimColVal:!0,byDimDef:{activeDimensionIndex:0,type:"expression",label:""}}}).getDimensionColorMap((function(e,t){return function(e,t){var n=t.layout,i=t.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.dimValsData?Promise.resolve({colorMap:n.snapshotData.content.chartData.dimValsData}):Promise.reject():i&&i.getObject?i.getObject("ColorMapModel_".concat(e)).then((function(e){return e.getLayout()})):Promise.reject()}(e,{layout:t.layout,app:t.app})})).getMeasure((function(e,t){return function(e,t){var n=t.layout,i=t.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.measureGradient?Promise.resolve({coloring:{gradient:n.snapshotData.content.chartData.measureGradient}}):Promise.reject():i&&i.getMeasure?i.getMeasure(e).then((function(e){return e.getMeasure()})):Promise.reject()}(e,{layout:t.layout,app:t.app})})).getAttributeDimension((function(e,t){return function(e,t){var n=t.layout,i=t.model,r=t.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.legendDataPage?Promise.resolve(n.snapshotData.content.chartData.legendDataPage):Promise.reject():i&&i.session&&r?i.getHyperCubeData(e,[{qHeight:100,qLeft:0,qTop:0,qWidth:2}]).catch(ov):Promise.reject()}(e,{layout:t.layout,model:t.model,app:t.app})}));return n.getSnapshotData=rv,n}({resources:e}),n={},i={},r=function(e){return i.settings||(e||console.warn("settings() called before auxiliarySettings()"),i.settings=t.settings()),i.settings},o={config:function(r){if(n=vm({},r),i={},!n.key)throw new Error("Missing key");t.set(vm(vm({},e),n))},auto:function(e){return e?(t.auto(e),o):t.auto()},getAuxiliarySettings:function(e){return i.auxiliarySettings?Promise.resolve(i.auxiliarySettings):t.getAuxiliarySettings(r(!0),e).then((function(e){return i.auxiliarySettings=e||{},i.settings=vm(vm({},i.settings),i.auxiliarySettings),i.scales=void 0,i.color=void 0,i.auxiliarySettings}))},getAuxiliaryData:function(){return t.getAuxiliaryData(r())},getSnapshotData:function(e){var n=r();return t.getAuxiliaryData(n,e).then((function(e){return t.getSnapshotData(n,e)}))},resolveUIColor:function(e){return t.resolveUIColor(e)},settings:function(){var e=r();return{mode:e.mode,type:e.type,label:e.label,field:e.field,fieldType:e.fieldType,nil:e.nil,others:e.others,primary:e.primary}},settingsForMeasure:function(e){var t;return(null===(t=r().measureOverrides)||void 0===t?void 0:t[e])||this.settings()},isSelectionLocked:function(e){var t=e.isMeasureSelectionLocked;return function(e,t){var n=t.isMeasureSelectionLocked;return"field"!==e.mode||("dimension"===e.fieldType?e.isFieldLocked:"measure"!==e.fieldType||n)}(r(),{isMeasureSelectionLocked:t})},palettes:function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.colorProps,n=e.coloring,i=e.theme,r=[];if(n&&n.palettes&&i){var o=n.palettes.categorical||t.dimensionScheme,a=i.getDataColorPalettes().filter((function(e){return e.key===o}))[0]||i.getDataColorPalettes()[0];o&&a&&r.push({key:"categorical",colors:a.colors});var s=n.palettes.metric||t.measureScheme,l=i.getDataColorScales().filter((function(e){return e.key===s}))[0]||i.getDataColorScales()[0];if(l){var c=l.colors[0]?l.colors:[[]].concat(_m(l.colors.slice(1)));c=Array.isArray(c[0])?c.map((function(e){return e.slice().reverse()})):c.slice().reverse(),r.push({key:"quant",colors:c})}}return r}({coloring:r(),colorProps:n.colorProps,theme:n.theme})},scales:function(){return i.scales=i.scales||function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.hc,n=e.coloring,i=e.rtl,r=e.key,o=e.source,a=e.picasso,s={},l=r;if(n){var c={override:!0,domain:n.explicit&&"function"==typeof n.explicit.domain?n.explicit.domain:[].concat(_m((n.explicit||{}).domain||[]),[-3,-2]),range:n.explicit&&"function"==typeof n.explicit.range?n.explicit.range:[].concat(_m((n.explicit||{}).range||[]),[n.others,n.nil])};if("field"===n.mode){if("dimension"===n.fieldType){var u,h=function(e){var t=e.hc,n=e.source,i=e.coloring,r={data:{extract:[{source:"dummy",field:0,filter:function(){return r.expando=t.qDataPages[0]?t.qDataPages[0].qArea.qTop:0,!1}},{source:n,field:i.field,trackBy:i.valueAccessor,reduce:"first",props:{row:{reduce:function(){return r.expando++}},text:{value:function(e){return e.qText},reduce:"first"}}}]},expando:0};return r}({hc:t,source:o,coloring:n}).data;if(n.legendDataset){var d=0,f={};a.data("q")({data:t}).extract({field:n.field,trackBy:n.valueAccessor,reduce:function(e){var t=e[0];return f[t]=d++,e[0]}}),u={source:"attrDim",extract:{field:"qDimensionInfo/0",filter:function(e){return e.qElemNumber>=0},props:{row:{value:function(e){return f[e.qElemNumber]}}}}}}var p={data:h,range:n.range,domain:n.domain,explicit:c,type:"categorical-color",label:function(e){return e.datum.text&&e.datum.text.value?e.datum.text.value:e.datum.label}};s[l]=p,u&&(s["".concat(l,"Legend")]=vm(vm({},p),{},{data:u})),t&&t.qHasOtherValues&&u&&((u||p.data).amend=[{label:t.qDimensionInfo[0].othersLabel,source:{key:"qHyperCube",field:"qDimensionInfo/0"},row:{value:-3},value:-3}])}else if("measure"===n.fieldType){var g={data:{field:n.field},min:n.min,max:n.max};s[l]=Km({},g,{type:"categorical"===n.type?"threshold-color":"sequential-color",range:n.range,domain:n.domain,invert:n.reverse}),"sequential-color"===s[l].type&&(s["".concat(l,"Range")]=Km({},g,{invert:!!i}))}else if("color"!==n.type)throw new Error("UNUSED FIELD")}else if("dimension"===n.mode){var m={data:t.qDimensionInfo.map((function(e,t){return t})),label:function(e){return t.qDimensionInfo[e.datum.value].qFallbackTitle},explicit:c,type:"categorical-color"};s[l]=m}else if("measure"===n.mode){var y={data:t.qMeasureInfo.map((function(e,t){return t})).filter((function(e){var t;return!(null!==(t=n.explicit)&&void 0!==t&&null!==(t=t.exclude)&&void 0!==t&&t.includes(e))})),label:function(e){return t.qMeasureInfo[e.datum.value].qFallbackTitle},explicit:c,type:"categorical-color"};s[l]=y}}return s}({hc:n.hc,coloring:r(),key:n.key,source:n.source,picasso:e.picasso}),i.scales},color:function(){return i.color=i.color||function(e){var t=e.coloring,n=e.scales,i=e.key,r=av(i),o=av("".concat(i,"IsAnOther")),a=function(e,t){var i=e.fieldType,a=e.invalid,s=e.mode,l=e.nil,c=e.others,u=e.primary,h=e.type;return a?function(e){return lv(e)||o(e)?c:l}:n[t]?function(e){return lv(e)?c:sv(e)||-2===r(e)&&"dimension"===i||"NaN"===r(e)?l:o(e)?c:e.resources.scale(t)(r(e))||c}:"constant"===s?function(e){return lv(e)||o(e)?c:sv(e)?l:u}:"color"===h?function(e){return lv(e)||o(e)?c:sv(e)?l:r(e)||c}:null},s=a(t,i);if(t.measureOverrides){var l=av("".concat(i,"MeasureIdx")),c=t.measureOverrides.map((function(e){return e&&a(e)}));return function(e){var t=l(e);return c[t]?c[t](e):s(e)}}return s}({coloring:r(),scales:this.scales(),key:n.key}),i.color},datumProps:function(e){return function(e){var t,n,i=e.hc,r=e.coloring,o=e.scales,a=e.key,s=e.addMeasureIx,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,c=a,u=r.nil;"field"===r.mode&&r.field?t=r.field:o[a]&&"field"===r.mode&&(t=o[a].data.field||r.field),t?(n={field:t,reduce:"first"},"color"===r.type&&(n.value=function(e){return"NaN"!==e.qNum?function(e){return"rgba(".concat([(16711680&e)>>16,(65280&e)>>8,255&e,((4278190080&e)>>>24)/255].join(","),")")}(e.qNum):e.qText&&yy(e.qText)?e.qText:u})):"dimension"===r.mode?n=void 0!==r.field?r.field:i.qDimensionInfo.length-1:"measure"===r.mode&&(n=l);var h=mm({},c,n);return i.qDimensionInfo.length>1&&(h["".concat(c,"IsAnOther")]={fields:i.qDimensionInfo.map((function(e,t){return{field:"qDimensionInfo/".concat(t)}})),value:function(e){return-1!==e.indexOf(-3)}}),s&&(h["".concat(c,"MeasureIdx")]=l),h}({coloring:this.settingsForMeasure(e),scales:this.scales(),key:n.key,hc:n.hc,addMeasureIx:r().measureOverrides},e)},data:function(){var e=r(),t={key:"dummy",data:[["field"],["a"]]};return e.legendDataset?[t,{type:"q",key:"attrDim",data:e.legendDataset.raw(),config:{localeInfo:n.localeInfo}}]:[t]},legend:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.eventName,i=e.key,o=e.viewState,a=e.chart,s=e.rtl,l=e.styleReference,c=void 0===l?"object.legend":l,u=e.styleOverrides,h=e.settings,d=void 0===h?{}:h,f=e.style,p=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return gv({eventName:t,key:i,rtl:s,viewState:o,chart:a,styleReference:c,styleOverrides:u,settings:d,style:void 0===f?{}:f},{legendProps:n.legendProps,scaleKey:n.key,coloring:r(),theme:n.theme,hc:n.hc,scales:this.scales()},p)}};return o}var yv=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function vv(e){var t=e.qHyperCube,n=t.qDimensionInfo,i=t.qMeasureInfo,r=n.some(yv),o=i.some(yv),a=e.color.useBaseColors;return"measure"===a&&!o||"dimension"===a&&!r?"off":a}var xv=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function bv(e){var t,n=e.qHyperCube.qDimensionInfo.some(xv),i=e.qHyperCube.qMeasureInfo.some(xv),r=n?"dimension":void 0;return{mode:"primary",useBaseColors:null!==(t=null!=r?r:i?"measure":void 0)&&void 0!==t?t:"off",paletteColor:null}}var wv=function(){};function kv(e){var t,n,i,r,o=e.picasso,a=e.model,s=e.app,l=e.translator,c=e.layoutService,u=void 0===c?void 0:c,h=e.createConfig,d=void 0===h?wv:h,f=e.config,p=void 0===f?{}:f,g=e.custom,m=void 0===g?{}:g,y=p.localeInfo,v=p.key,x=p.theme,b=void 0===x?void 0:x,w=p.auto,k=void 0===w?void 0:w,_=p.definitionPath,M=null==u||null===(t=u.getLayout)||void 0===t?void 0:t.call(u),S={theme:b,key:v,localeInfo:y,layout:M,hc:null==u||null===(n=u.getHyperCube)||void 0===n?void 0:n.call(u),legendProps:null==u||null===(i=u.getLayoutValue)||void 0===i?void 0:i.call(u,"legend"),colorProps:vm(vm({},null==u||null===(r=u.getLayoutValue)||void 0===r?void 0:r.call(u,"color")),{},{useBaseColors:M?vv(M):void 0})},R=mv({picasso:o,model:a,app:s,translator:l,auto:k});!1!==k&&R.auto((function(e){return k?k({layout:e,defaultAuto:bv}):bv(e)}));var C=!1,N={getColor:function(){return R.color()},getPaletteColor:function(e){var t=e.index,n=e.color;return R.resolveUIColor({index:t,color:n})},getData:function(){return R.data()},getDatumProps:function(e){return R.datumProps(e)},getSnapshotData:function(){return R.getSnapshotData(_)},getSettingsForMeasure:function(e){return R.settingsForMeasure(e)},getSettings:function(){return R.settings()},getLegend:function(e,t){return R.legend(e,t)},getScales:function(){return R.scales()},getPalettes:function(){return R.palettes()},isSelectionLocked:function(e){var t=e.isMeasureSelectionLocked;return R.isSelectionLocked({isMeasureSelectionLocked:t})},isInitialized:function(){return C},custom:vm({},m),initialize:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).createConfig,t=(void 0===e?d:e)({getUseBaseColors:vv}),n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return vm(vm(vm({},e),t),{},{colorProps:vm(vm({},e.colorProps),t.colorProps||{})})}(S,t);return R.config(n),R.getAuxiliarySettings(_).then((function(){C=!0}))}};return N}var _v="center",Mv="bottom";function Sv(e,t,n){if(void 0===e||void 0===t)return n;for(var i=t.split("."),r=e,o=0;o<i.length;++o){var a=i[o];if(void 0===r[a])return n;r=r[a]}return r}[{key:"NoDataExist",alignment:_v,condition:function(e){var t=e.layoutService;if(!t)return!1;var n=t.meta.size;return n.x*n.y==0}},{key:"OnlyNanDataMeasure",translationKey:"OnlyNanData",alignment:_v,condition:function(e){var t=e.layoutService;return!!t&&t.getHyperCubeValue("qMeasureInfo").every((function(e){return"NaN"===e.qMin&&"NaN"===e.qMax}))}},{key:"OnlyNanDataDimensionContinuous",translationKey:"OnlyNanData",alignment:_v,condition:function(e){var t=e.layoutService;if(!t)return!1;if(!t.meta.isContinuous)return!1;var n=t.getHyperCubeValue("qDimensionInfo.0");return n&&(n.qMax<n.qMin||"NaN"===n.qMax)}},{key:"OnlyNegativeOrZeroValues",alignment:_v},{key:"DataRangeIncludingZero",alignment:Mv},{key:"LimitedData",alignment:Mv},{key:"NegativeOrZeroValues",alignment:Mv}].reduce((function(e,t){return e[t.key]=t,e}),{});var Rv=["__proto__","constructor"];function Cv(e,t,n){if(void 0!==e&&void 0!==t){var i=t.split("."),r=i[i.length-1];if(!Rv.some((function(e){return i.includes(e)}))){for(var o=e,a=0;a<i.length-1;++a){var s=i[a];void 0===o[s]&&(o[s]=Number.isNaN(+i[a+1])?{}:[]),o=o[s]}void 0!==n?o[r]=n:delete o[r]}}}function Nv(e){var t=e.originalArray,n=e.newArray,i=e.matchKey;return Array.isArray(t)&&t.length?(n.forEach((function(e){var n=-1;t.some((function(t,r){return t[i]&&t[i]===e[i]&&(n=r),n})),n>-1?t[n]=e:t.push(e)})),t):n}function Dv(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t);if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Ev(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?qv(Object(n),!0).forEach((function(t){Dv(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qv(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ov=Object.prototype.hasOwnProperty,zv=Object.prototype.toString,Av=Object.defineProperty,Tv=Object.getOwnPropertyDescriptor,Iv=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===zv.call(e)},jv=function(e){if(!e||"[object Object]"!==zv.call(e))return!1;var t,n=Ov.call(e,"constructor"),i=e.constructor&&e.constructor.prototype&&Ov.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!i)return!1;for(t in e);return void 0===t||Ov.call(e,t)},Pv=function(e,t){Av&&"__proto__"===t.name?Av(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},Fv=function(e,t){if("__proto__"===t){if(!Ov.call(e,t))return;if(Tv)return Tv(e,t).value}return e[t]},Lv=function e(){var t,n,i,r,o,a,s=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof s&&(u=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)i=Fv(s,n),s!==(r=Fv(t,n))&&(u&&r&&(jv(r)||(o=Iv(r)))?(o?(o=!1,a=i&&Iv(i)?i:[]):a=i&&jv(i)?i:{},Pv(s,{name:n,newValue:e(u,a,r)})):void 0!==r&&Pv(s,{name:n,newValue:r}));return s};function $v(e,t,n,i){if(!e)return-1;const r=n.cache,o=e.origin?e.origin():null;o&&(e=o);let a=r.fields.indexOf(e),s=-1,l=-1;if(-1===a)for(let t=0;t<r.wrappedFields.length;t++)if(l=r.wrappedFields[t].attrDims.map((e=>e.instance)).indexOf(e),s=r.wrappedFields[t].attrExps.map((e=>e.instance)).indexOf(e),-1!==l||-1!==s){a=t;break}if(Array.isArray(i)&&i.some(((e,t)=>e!==t))){const e=i.indexOf(a);-1!==e&&(a=e)}return a-=t.qArea.qLeft,a<0||a>=t.qArea.qWidth?-1:l>=0?e=>e[a].qAttrDims.qValues[l]:s>=0?e=>e[a].qAttrExps.qValues[s]:e=>e[a]}function Bv(e,t,n){let{key:i}=n;const r={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return r.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(r.value),e.field&&(r.source={key:i,field:e.field.key()}),r}function Hv(e){let{cache:t,f:n,mainCell:i,p:r,page:o,rowIdx:a,row:s,sourceKey:l,target:c,targetProp:u,columnOrder:h}=e,d=i;if(r.field&&r.field!==n){const e=$v(r.field,o,{cache:t},h);if(-1===e)return;d=Lv({qRow:a},e(s))}c[u]=Bv(r,d,{key:l})}function Wv(e,t,n,i){const r=Array.isArray(e)?e:[e];let o=[];for(let e=0;e<r.length;e++)if(void 0!==r[e].field){const a=t.raw(),s=t.key(),l="object"==typeof r[e].field?r[e].field:t.field(r[e].field),{props:c,main:u}=i.normalizeConfig(r[e],t),h=Object.keys(c),d=!!r[e].trackBy,f=typeof r[e].trackBy,p={},g=[],m=[];for(let t=0;t<a.qDataPages.length;t++){const o=$v(l,a.qDataPages[t],{cache:n},a.qColumnOrder);if(-1!==o)for(let y=0;y<a.qDataPages[t].qMatrix.length;y++){const v=a.qDataPages[t].qArea.qTop+y,x=Lv({qRow:v},o(a.qDataPages[t].qMatrix[y])),b=Bv(u,x,{key:s});if(!u.filter||u.filter(x)){for(let e=0;e<h.length;e++){const i=c[h[e]];let r=i.fields||[i];i.fields&&(b[h[e]]=[]);for(let o=0;o<r.length;o++)Hv({cache:n,f:l,mainCell:x,p:r[o],prop:h[e],page:a.qDataPages[t],rowIdx:v,row:a.qDataPages[t].qMatrix[y],sourceKey:s,target:i.fields?b[h[e]]:b,targetProp:i.fields?o:h[e],columnOrder:a.qColumnOrder});if(i.fields){const t=b[h[e]].map((e=>e.value)),n=b[h[e]].map((e=>e.label));b[h[e]]={value:"function"==typeof i.value?i.value(t):void 0!==i.value?i.value:t,label:"function"==typeof i.label?i.label(n):void 0!==i.label?String(i.label):String(b[h[e]].value)}}}d&&i.track({cfg:r[e],itemData:x,obj:b,target:g,tracker:p,trackType:f}),m.push(b)}}}const y=d?i.collect(g,{main:u,propsArr:h,props:c}):m;o=[...o,...y]}return o}function Vv(e){var t=0,n=e.children,i=n&&n.length;if(i)for(;--i>=0;)t+=n[i].value;else t=1;e.value=t}function Uv(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=Kv)):void 0===t&&(t=Yv);for(var n,i,r,o,a,s=new Jv(e),l=[s];n=l.pop();)if((r=t(n.data))&&(a=(r=Array.from(r)).length))for(n.children=r,o=a-1;o>=0;--o)l.push(i=r[o]=new Jv(r[o])),i.parent=n,i.depth=n.depth+1;return s.eachBefore(Gv)}function Yv(e){return e.children}function Kv(e){return Array.isArray(e)?e[1]:null}function Xv(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function Gv(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function Jv(e){this.data=e,this.depth=this.height=0,this.parent=null}function Zv(e){return null==e?null:function(e){if("function"!=typeof e)throw new Error;return e}(e)}Jv.prototype=Uv.prototype={constructor:Jv,count:function(){return this.eachAfter(Vv)},each:function(e,t){let n=-1;for(const i of this)e.call(t,i,++n,this);return this},eachAfter:function(e,t){for(var n,i,r,o=this,a=[o],s=[],l=-1;o=a.pop();)if(s.push(o),n=o.children)for(i=0,r=n.length;i<r;++i)a.push(n[i]);for(;o=s.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,i,r=this,o=[r],a=-1;r=o.pop();)if(e.call(t,r,++a,this),n=r.children)for(i=n.length-1;i>=0;--i)o.push(n[i]);return this},find:function(e,t){let n=-1;for(const i of this)if(e.call(t,i,++n,this))return i},sum:function(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,i=t.children,r=i&&i.length;--r>=0;)n+=i[r].value;t.value=n}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,n=function(e,t){if(e===t)return e;var n=e.ancestors(),i=t.ancestors(),r=null;for(e=n.pop(),t=i.pop();e===t;)r=e,e=n.pop(),t=i.pop();return r}(t,e),i=[t];t!==n;)t=t.parent,i.push(t);for(var r=i.length;e!==n;)i.splice(r,0,e),e=e.parent;return i},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t},copy:function(){return Uv(this).eachBefore(Xv)},[Symbol.iterator]:function*(){var e,t,n,i,r=this,o=[r];do{for(e=o.reverse(),o=[];r=e.pop();)if(yield r,t=r.children)for(n=0,i=t.length;n<i;++n)o.push(t[n])}while(o.length)}};var Qv={depth:-1},ex={},tx={};function nx(e){return e.id}function ix(e){return e.parentId}function rx(e){let t=e.length;if(t<2)return"";for(;--t>1&&!ox(e,t););return e.slice(0,t)}function ox(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(!(1&n))return!0}return!1}function ax(e,t){"/"===e.charAt(0)&&(e=e.substring(1));const n=e.split("/");let i,r=t;for(let e=0;e<n.length;e++){if("*"===n[e]&&Array.isArray(r)){const t=[];i=n.slice(e+1).join("/");for(let e=0;e<r.length;e++){let n=ax(i,r[e]);Array.isArray(n)?t.push(...n):t.push(n)}return t}if(!n[e]&&Array.isArray(r)){const t=new Array(r.length);i=n.slice(e+1).join("/");for(let e=0;e<r.length;e++)t[e]=ax(i,r[e]);return t}n[e]in r&&(r=r[n[e]])}return r}function sx(e,t,n){let i=[];if(!e||!e.length)return i;if(t<=0){const t=n>=0?[e[n]]:e;i=[...i,...t]}else for(let r=0;r<e.length;r++)e[r].children&&e[r].children.length&&(i=[...i,...sx(e[r].children,t-1,n)]);return i}function lx(e,t,n){if(e===t)return e=>e;if(e>t){const n=Math.max(0,Math.min(100,e-t));return e=>{let t=e;for(let e=0;e<n;++e)t=t.parent;return t}}if(t>e){const i=Math.max(0,Math.min(100,t-e));return e=>sx(e.children,i-1,n)}return!1}const cx=/^qDimensionInfo(?:\/(\d+))?/,ux=/^\/?qMeasureInfo\/(\d+)/,hx=/\/qAttrExprInfo\/(\d+)/,dx=/\/qAttrDimInfo\/(\d+)/;function fx(e){return(e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map(((e,t)=>t))).filter((t=>t<e.qDimensionInfo.length))}function px(e,t){let{cube:n}=t;if(!e)return-1;let i=e.origin&&e.origin()?e.origin().key():e.key(),r=!1,o=-1,a=-1,s=-1,l=-1,c=-1,u=-1,h=i;const d=n.qEffectiveInterColumnSortOrder,f=fx(n);return cx.test(h)&&(r=!0,o=+cx.exec(h)[1],h=i.replace(cx,"")),ux.test(h)&&("K"===n.qMode?c=+ux.exec(h)[1]:d&&-1!==d.indexOf(-1)?(c=+ux.exec(h)[1],u=0):u=+ux.exec(h)[1],h=h.replace(ux,"")),h&&(dx.exec(h)?s=+dx.exec(h)[1]:hx.exec(h)&&(a=+hx.exec(h)[1])),l=r?"S"===n.qMode?f[o]:d?d.indexOf(o):o:d&&-1!==d.indexOf(-1)?d.indexOf(-1):n.qDimensionInfo.length-("K"===n.qMode?0:1),{fieldDepth:l+1,pseudoMeasureIndex:c,measureIdx:u,attrDimIdx:s,attrIdx:a}}function gx(e,t){let n,i,r=lx(e.fieldDepth,t.fieldDepth,t.pseudoMeasureIndex);return n=t.measureIdx>=0?e=>e.data.qValues[t.measureIdx]:e=>e.data,t.attrDimIdx>=0?i=e=>{var n;return null==e||null===(n=e.qAttrDims)||void 0===n?void 0:n.qValues[t.attrDimIdx]}:t.attrIdx>=0&&(i=e=>{var n;return null==e||null===(n=e.qAttrExps)||void 0===n?void 0:n.qValues[t.attrIdx]}),{nodeFn:r,attrFn:i,valueFn:n}}function mx(e,t,n){let{key:i}=n;const r={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return r.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(r.value),e.field&&(r.source={key:i,field:e.field.key()}),r}function yx(e){let{propsArr:t,props:n,item:i,itemData:r,ret:o,sourceKey:a}=e;for(let e=0;e<t.length;e++){const s=n[t[e]],l=s.fields||[s];let c,u;s.fields&&(c=[],u=[]);for(let n=0;n<l.length;n++){const h=l[n];let d,f,p,g,m,y;if("primitive"===h.type?(p=h.value,y=String(h.value)):("function"==typeof h.value&&(d=e=>h.value(e,i)),"function"==typeof h.label&&(f=e=>h.label(e,i)),h.accessor?(g=h.accessor(i),Array.isArray(g)?(m=g.map(h.valueAccessor),h.attrAccessor&&(m=m.map(h.attrAccessor)),d&&(p=m.map(d),d=null),f&&(y=m.map(f),f=null),p=h.reduce?h.reduce(p):p,y=h.reduceLabel?h.reduceLabel(y,p):String(p)):(p=h.attrAccessor?h.attrAccessor(h.valueAccessor(g)):h.valueAccessor(g),y=p)):(p=r,y=r)),s.fields){const e=d?d(p):p;c.push(e),u.push(f&&null!=y?f(y):null!=y?y:String(e))}else{const n=d?d(p):p;o[t[e]]={value:n,label:f?f(y):null!=y?y:String(n)},h.field&&(o[t[e]].source={field:h.field.key(),key:a})}}c&&(o[t[e]]={value:"function"==typeof s.value?s.value(c,i):c,label:"function"==typeof s.label?s.label(u,i):u})}}const vx=(e,t,n)=>{const i="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",r="K"===e.qMode?"qSubNodes":"qNodes",o=ax(i,e);return o&&o[0]?(t.tree=Uv(o[0],n.children||(e=>e[r])),t.tree):null};function xx(e){const t=e.raw().qDataPages.length?e.raw().qDataPages[0].qMatrix:[],n=function(e){const t=e.raw().qColumnOrder,n=e.fields();return t&&t.length===n.length?t:n.map(((e,t)=>t))}(e),i=e.fields(),r=e.fields().filter((e=>"dimension"===e.type())).map((e=>n.indexOf(i.indexOf(e)))),o=e.fields().filter((e=>"measure"===e.type())).map((e=>n.indexOf(i.indexOf(e)))),a={__root:{__id:"__root",qValues:[]}};for(let e=0;e<t.length;e++){const n=t[e];let i="__root",l=!1;for(let e=0;e<r.length;e++){var s;const t=n[r[e]],o="".concat(i,"__").concat(null!==(s=t.qElemNumber)&&void 0!==s?s:t.qElemNo);a[o]||(a[o]=Ev({__id:o,__parent:i,qValues:[]},t),l=!0),i=o}if(l)for(let e=0;e<o.length;e++){const t=n[o[e]];a[i].qValues.push(t)}}const l=Object.keys(a).map((e=>a[e]));return function(){var e,t=nx,n=ix;function i(i){var r,o,a,s,l,c,u,h,d=Array.from(i),f=t,p=n,g=new Map;if(null!=e){const t=d.map(((t,n)=>function(e){let t=(e=`${e}`).length;return ox(e,t-1)&&!ox(e,t-2)&&(e=e.slice(0,-1)),"/"===e[0]?e:`/${e}`}(e(t,n,i)))),n=t.map(rx),r=new Set(t).add("");for(const e of n)r.has(e)||(r.add(e),t.push(e),n.push(rx(e)),d.push(tx));f=(e,n)=>t[n],p=(e,t)=>n[t]}for(a=0,r=d.length;a<r;++a)o=d[a],c=d[a]=new Jv(o),null!=(u=f(o,a,i))&&(u+="")&&(h=c.id=u,g.set(h,g.has(h)?ex:c)),null!=(u=p(o,a,i))&&(u+="")&&(c.parent=u);for(a=0;a<r;++a)if(u=(c=d[a]).parent){if(!(l=g.get(u)))throw new Error("missing: "+u);if(l===ex)throw new Error("ambiguous: "+u);l.children?l.children.push(c):l.children=[c],c.parent=l}else{if(s)throw new Error("multiple roots");s=c}if(!s)throw new Error("no root");if(null!=e){for(;s.data===tx&&1===s.children.length;)s=s.children[0],--r;for(let e=d.length-1;e>=0&&(c=d[e]).data===tx;--e)c.data=null}if(s.parent=Qv,s.eachBefore((function(e){e.depth=e.parent.depth+1,--r})).eachBefore(Gv),s.parent=null,r>0)throw new Error("cycle");return s}return i.id=function(e){return arguments.length?(t=Zv(e),i):t},i.parentId=function(e){return arguments.length?(n=Zv(e),i):n},i.path=function(t){return arguments.length?(e=Zv(t),i):e},i}().id((e=>e.__id)).parentId((e=>e.__parent))(l)}const bx=e=>{let{propsArr:t,props:n,cube:i,cache:r,itemDepthObject:o,f:a}=e;for(let e=0;e<t.length;e++){const r=n[t[e]],s=r.fields?r.fields:[r];for(let e=0;e<s.length;e++){const t=s[e];if(t.field!==a){const e=gx(o,px(t.field,{cube:i}));t.accessor=e.nodeFn,t.valueAccessor=e.valueFn,t.attrAccessor=e.attrFn}}}};function wx(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;const r=t.raw(),o=t.key(),a="S"===r.qMode?xx(t):vx(r,n,e);if(!a)return null;const s=a.height,l=[];for(let o=0;o<=s;o++){let a=null;if(o>0)if("S"===r.qMode){let e=fx(r)[o-1];a=n.fields[e]}else{let e=r.qEffectiveInterColumnSortOrder[o-1];o>r.qEffectiveInterColumnSortOrder.length&&(e=r.qDimensionInfo.length),a=n.fields[e]}const{props:s,main:c}=i.normalizeConfig(Ev(Ev({},e),{},{field:a?a.key():void 0}),t),u=Object.keys(s);l[o]={propsArr:u,props:s,main:c};const h=a?px(a,{cube:r}):{fieldDepth:0};bx({propsArr:u,props:s,cube:r,cache:n,itemDepthObject:h,f:a})}const c=a.copy().descendants(),u=a.descendants();for(let e=0;e<u.length;e++){const t=l[u[e].depth].propsArr,n=l[u[e].depth].props,i=l[u[e].depth].main,r=c[e],a=r.data,s=mx(i,a,{key:o});yx({propsArr:t,props:n,item:r,itemData:a,ret:s,sourceKey:o}),u[e].data=s}return a}function kx(e,t,n,i){const r=Array.isArray(e)?e:[e];let o=[];for(let a=0;a<r.length;a++)if(void 0!==r[a].field){const s=t.raw(),l=t.key();if(!vx(s,n,e))continue;const c="object"==typeof r[a].field?r[a].field:t.field(r[a].field),{props:u,main:h}=i.normalizeConfig(r[a],t),d=Object.keys(u),f=px(c,{cube:s}),{nodeFn:p,attrFn:g,valueFn:m}=gx({fieldDepth:0},f);bx({propsArr:d,props:u,cube:s,cache:n,itemDepthObject:f,f:c});const y=!!r[a].trackBy,v=typeof r[a].trackBy,x={},b=[],w=p(n.tree),k=[];for(let e=0;e<w.length;e++){const t=w[e],n=g?g(m(t)):m(t);if(h.filter&&!h.filter(n))continue;const o=mx(h,n,{key:l});yx({propsArr:d,props:u,item:t,itemData:n,ret:o,sourceKey:l}),y&&i.track({cfg:r[a],itemData:n,obj:o,target:b,tracker:x,trackType:v}),k.push(o)}const _=y?i.collect(b,{main:h,propsArr:d,props:u}):k;o=[...o,..._]}return o}var _x,Mx,Sx=(_x=function(e){
|
11
|
+
var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",r=n.toStringTag||"@@toStringTag";function o(n,i,r,o){var l=i&&i.prototype instanceof s?i:s,c=Object.create(l.prototype);return wm(c,"_invoke",function(n,i,r){var o,s,l,c=0,u=r||[],h=!1,d={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return o=t,s=0,l=e,d.n=n,a}};function f(n,i){for(s=n,l=i,t=0;!h&&c&&!r&&t<u.length;t++){var r,o=u[t],f=d.p,p=o[2];n>3?(r=p===i)&&(l=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=f&&((r=n<2&&f<o[1])?(s=0,d.v=i,d.n=o[1]):f<p&&(r=n<3||o[0]>i||i>p)&&(o[4]=n,o[5]=i,d.n=p,s=0))}if(r||n>1)return a;throw h=!0,i}return function(r,u,p){if(c>1)throw TypeError("Generator is already running");for(h&&1===u&&f(u,p),s=u,l=p;(t=s<2?e:l)||!h;){o||(s?s<3?(s>1&&(d.n=-1),f(s,l)):d.n=l:d.v=l);try{if(c=2,o){if(s||(r="next"),t=o[r]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(l=TypeError("The iterator does not provide a '"+r+"' method"),s=1);o=e}else if((t=(h=d.n<0)?l:n.call(i,d))!==a)break}catch(t){o=e,s=1,l=t}finally{c=1}}return{value:t,done:h}}}(n,r,o),!0),c}var a={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][i]?t(t([][i]())):(wm(t={},i,(function(){return this})),t),h=c.prototype=s.prototype=Object.create(u);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,wm(e,r,"GeneratorFunction")),e.prototype=Object.create(h),e}return l.prototype=c,wm(h,"constructor",c),wm(c,"constructor",l),l.displayName="GeneratorFunction",wm(c,r,"GeneratorFunction"),wm(h),wm(h,r,"Generator"),wm(h,i,(function(){return this})),wm(h,"toString",(function(){return"[object Generator]"})),(bm=function(){return{w:o,m:d}})()}function wm(e,t,n,i){var r=Object.defineProperty;try{r({},"",{})}catch(e){r=0}wm=function(e,t,n,i){function o(t,n){wm(e,t,(function(e){return this._invoke(t,n,e)}))}t?r?r(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},wm(e,t,n,i)}function km(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,r,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=o.call(n)).done)&&(s.push(i.value),s.length!==t);l=!0);}catch(e){c=!0,r=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return s}}(e,t)||Sm(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _m(e){return function(e){if(Array.isArray(e))return fm(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Sm(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Mm(e){return Mm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Mm(e)}function Sm(e,t){if(e){if("string"==typeof e)return fm(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?fm(e,t):void 0}}var Rm,Cm="top",Nm="top-right",Dm="right",qm="bottom-right",Em="bottom",Om="bottom-left",zm="left",Am="top-left";mm(mm(mm(mm(mm(mm(mm(mm(mm(mm(Rm={},"equal-equal",[Cm,Em]),"equal-higher",[Em,qm]),"equal-lower",[Cm,Nm]),"equal-void",[Cm,Em]),"higher-equal",[zm,Om,Cm,Nm]),"higher-higher-acute",[Em,Om,zm,Nm]),"higher-higher-obtuse",[Em,Cm]),"higher-lower-negative",[Cm,Nm,Dm]),"higher-lower-positive",[Em,Om,zm]),"higher-void",[Cm]),mm(mm(mm(mm(mm(mm(mm(mm(mm(mm(Rm,"lower-equal",[Cm]),"lower-higher-negative",[Cm,Am]),"lower-higher-positive",[qm]),"lower-lower-acute",[Cm,Am,zm,Nm,Dm]),"lower-lower-obtuse",[Cm,Em]),"lower-void",[Cm]),"void-equal",[Cm]),"void-higher",[Cm,Em]),"void-lower",[Cm,Em,zm]),"void-void",[Cm]),mm(Rm,"unclassified",[Cm,Em,Dm,zm,Nm,qm,Om,Am]);var Tm=["American Typewriter, serif","Andalé Mono, monospace","Arial Black, sans-serif","Arial, sans-serif","Bradley Hand, cursive","Brush Script MT, cursive","Comic Sans MS, cursive","Courier, monospace","Didot, serif","Georgia, serif","Impact, sans-serif","Lucida Console, monospace","Luminari, fantasy","Monaco, monospace","QlikView Sans, sans-serif","Source Sans Pro, sans-serif","Tahoma, sans-serif","Times New Roman, serif","Trebuchet MS, sans-serif","Verdana, sans-serif"],Im=["Abril Fatface, serif","Bangers, fantasy","Bebas Neue, sans serif","EB Garamond, serif","Fredoka One, fantasy","Graduate, fantasy","Gravitas One, serif","Indie Flower, fantasy","Inter, sans-serif","Lobster, fantasy","Montserrat, sans-serif","Nixie One, sans-serif","Noto Sans, sans-serif","Open Sans, sans-serif","PT Serif, serif","Pacifico, cursive","Permanent Marker, fantasy","QlikView Sans, sans-serif","Raleway, sans-serif","Rammetto One, fantasy","Roboto, sans-serif","Source Sans Pro, sans-serif","Titan One, fantasy","Yanone Kaffeesatz, sans-serif"];var jm=function(e){return{value:e,label:e.charAt(0).toUpperCase()+e.slice(1),groupHeader:!1,disabled:!1,styles:{fontFamily:e}}};function Pm(e){var t=e.theme,n=e.translator,i=e.defaultValue,r=e.flags,o=[],a=t.getStyle("","","fontFamilies");return Array.isArray(a)&&a.length?o.push.apply(o,_m(new Set([i].concat(_m(a.map((function(e){return e.split(",").map((function(e){return e.trim()})).map((function(e){return e.replace(/\s+/g," ").trim()})).filter(Boolean).join(", ")}))))))):o.push(i),[{value:"ThemeHeader",label:n.get("properties.themeFonts"),metaText:n.get("properties.theme"),groupHeader:!0}].concat(_m(o.map((function(e){return jm(e)}))),[{value:"DefaultHeader",label:n.get("properties.allFonts"),metaText:n.get("properties.default"),groupHeader:!0}],_m(function(e){return null!=e&&e.isEnabled("PS_20852_WYSIWYG_FONT_SUPPORT")?Im:Tm}(r).map((function(e){return jm(e)}))))}function Fm(e){var t=e.theme,n=e.translator,i=e.id,r=e.path,o=e.flags,a=function(){return t.getStyle(i,r,"fontFamily")};return{getDefaultValue:function(){return a()},getOptions:function(){return Pm({theme:t,translator:n,defaultValue:a(),flags:o})}}}var Lm,$m,Bm=["10px","11px","12px","13px","14px","15px","16px","17px","18px","19px","20px","21px","22px","23px","24px"],Hm=function(e){return{value:e,label:e,groupHeader:!1,disabled:!1}};function Wm(e){var t=e.theme,n=e.translator,i=e.id,r=e.path,o=function(){return t.getStyle(i,r,"fontSize")};return{getDefaultValue:function(){return o()},getOptions:function(){return function(e){var t=e.translator,n=e.defaultValue,i=[],r=e.theme.getStyle("","","fontSizes");return Array.isArray(r)&&r.length?i.push.apply(i,_m(new Set([n].concat(_m(r))))):i.push(n),[{value:"ThemeHeader",label:t.get("properties.themeFontSizes"),metaText:t.get("properties.theme"),groupHeader:!0}].concat(_m(i.map((function(e){return Hm(e)}))),[{value:"DefaultHeader",label:t.get("properties.allFontSizes"),metaText:t.get("properties.default"),groupHeader:!0}],_m(Bm.map((function(e){return Hm(e)}))))}({theme:t,translator:n,defaultValue:o()})}}}function Vm(e){var t=e.theme,n=e.translator,i=e.id,r=e.path;return{fontFamily:Fm({theme:t,translator:n,id:i,path:r,flags:e.flags}),fontSize:Wm({theme:t,translator:n,id:i,path:r})}}var Um,Ym=function(){if($m)return Lm;$m=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,r=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},o=function(n){if(!n||"[object Object]"!==t.call(n))return!1;var i,r=e.call(n,"constructor"),o=n.constructor&&n.constructor.prototype&&e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!r&&!o)return!1;for(i in n);return void 0===i||e.call(n,i)},a=function(e,t){n&&"__proto__"===t.name?n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},s=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(i)return i(t,n).value}return t[n]};return Lm=function e(){var t,n,i,l,c,u,h=arguments[0],d=1,f=arguments.length,p=!1;for("boolean"==typeof h&&(p=h,h=arguments[1]||{},d=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)i=s(h,n),h!==(l=s(t,n))&&(p&&l&&(o(l)||(c=r(l)))?(c?(c=!1,u=i&&r(i)?i:[]):u=i&&o(i)?i:{},a(h,{name:n,newValue:e(p,u,l)})):void 0!==l&&a(h,{name:n,newValue:l}));return h},Lm}(),Km=(Um=Ym)&&Um.__esModule&&Object.prototype.hasOwnProperty.call(Um,"default")?Um.default:Um;function Xm(e,t){return{range:function(e){var n=e.resources,i=e.data,r=n.theme.palette("categorical",0===t?i.items.length:t);return i.items.map((function(e){return r[e.value%r.length]}))},valueAccessor:e.value}}function Gm(e,t){return{range:function(e){var n=e.resources,i=e.data,r=n.theme.palette("categorical",0===t?i.items.length:t);return i.items.map((function(e){return r[e.row.value%r.length]}))},valueAccessor:e.value}}function Jm(e,t,n,i,r){var o,a,s=r.byRow,l=r.byElemNo;if(i&&(t.input.persistent||e.hc.qDimensionInfo.length>1||void 0===n.activeDimensionIndex&&e.hc.qSize.qcy>((null===(a=(o=e.hc).qDataPages[0]||o.qStackedDataPages[0])||void 0===a?void 0:a.qArea.qHeight)||0)))return l(i,i.raw().qCardinal);if(i){var c=t.pic.extract({field:i.key(),trackBy:i.value}).length;return s(i,c)}return{}}function Zm(e,t){var n=e.hc.qDimensionInfo,i=t.input.byDimDef||{activeDimensionIndex:n.length-1};if(i.activeDimensionIndex>=0){var r=n[i.activeDimensionIndex];i=r.coloring&&r.coloring.colorMapRef?{type:"libraryItem",key:r.coloring.colorMapRef,activeDimensionIndex:i.activeDimensionIndex}:{activeDimensionIndex:i.activeDimensionIndex}}return i}function Qm(e,t){var n;return t.activeDimensionIndex>=0?n=e.pic.fields().filter((function(e){return"dimension"===e.type()}))[t.activeDimensionIndex]:"libraryItem"===t.type?!1===(n=t.key?e.pic.field((function(e){return e.raw().colorMapRef===t.key})):void 0)&&(n=e.pic.field((function(e){return"colorByAlternative"===e.raw().id}))):"expression"===t.type&&(n=e.pic.field((function(e){return"colorByAlternative"===e.raw().id}))),n}function ey(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function ty(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function ny(){}var iy=1/.7,ry="\\s*([+-]?\\d+)\\s*",oy="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ay="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",sy=/^#([0-9a-f]{3,8})$/,ly=new RegExp(`^rgb\\(${ry},${ry},${ry}\\)$`),cy=new RegExp(`^rgb\\(${ay},${ay},${ay}\\)$`),uy=new RegExp(`^rgba\\(${ry},${ry},${ry},${oy}\\)$`),hy=new RegExp(`^rgba\\(${ay},${ay},${ay},${oy}\\)$`),dy=new RegExp(`^hsl\\(${oy},${ay},${ay}\\)$`),fy=new RegExp(`^hsla\\(${oy},${ay},${ay},${oy}\\)$`),py={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function gy(){return this.rgb().formatHex()}function my(){return this.rgb().formatRgb()}function yy(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=sy.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?vy(t):3===n?new ky(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?xy(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?xy(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=ly.exec(e))?new ky(t[1],t[2],t[3],1):(t=cy.exec(e))?new ky(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=uy.exec(e))?xy(t[1],t[2],t[3],t[4]):(t=hy.exec(e))?xy(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=dy.exec(e))?Ny(t[1],t[2]/100,t[3]/100,1):(t=fy.exec(e))?Ny(t[1],t[2]/100,t[3]/100,t[4]):py.hasOwnProperty(e)?vy(py[e]):"transparent"===e?new ky(NaN,NaN,NaN,0):null}function vy(e){return new ky(e>>16&255,e>>8&255,255&e,1)}function xy(e,t,n,i){return i<=0&&(e=t=n=NaN),new ky(e,t,n,i)}function by(e){return e instanceof ny||(e=yy(e)),e?new ky((e=e.rgb()).r,e.g,e.b,e.opacity):new ky}function wy(e,t,n,i){return 1===arguments.length?by(e):new ky(e,t,n,null==i?1:i)}function ky(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}function _y(){return`#${Cy(this.r)}${Cy(this.g)}${Cy(this.b)}`}function My(){const e=Sy(this.opacity);return`${1===e?"rgb(":"rgba("}${Ry(this.r)}, ${Ry(this.g)}, ${Ry(this.b)}${1===e?")":`, ${e})`}`}function Sy(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ry(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Cy(e){return((e=Ry(e))<16?"0":"")+e.toString(16)}function Ny(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new qy(e,t,n,i)}function Dy(e){if(e instanceof qy)return new qy(e.h,e.s,e.l,e.opacity);if(e instanceof ny||(e=yy(e)),!e)return new qy;if(e instanceof qy)return e;var t=(e=e.rgb()).r/255,n=e.g/255,i=e.b/255,r=Math.min(t,n,i),o=Math.max(t,n,i),a=NaN,s=o-r,l=(o+r)/2;return s?(a=t===o?(n-i)/s+6*(n<i):n===o?(i-t)/s+2:(t-n)/s+4,s/=l<.5?o+r:2-o-r,a*=60):s=l>0&&l<1?0:a,new qy(a,s,l,e.opacity)}function qy(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}function Ey(e){return(e=(e||0)%360)<0?e+360:e}function Oy(e){return Math.max(0,Math.min(1,e||0))}function zy(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}ey(ny,yy,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:gy,formatHex:gy,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Dy(this).formatHsl()},formatRgb:my,toString:my}),ey(ky,wy,ty(ny,{brighter(e){return e=null==e?iy:Math.pow(iy,e),new ky(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new ky(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ky(Ry(this.r),Ry(this.g),Ry(this.b),Sy(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:_y,formatHex:_y,formatHex8:function(){return`#${Cy(this.r)}${Cy(this.g)}${Cy(this.b)}${Cy(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:My,toString:My})),ey(qy,(function(e,t,n,i){return 1===arguments.length?Dy(e):new qy(e,t,n,null==i?1:i)}),ty(ny,{brighter(e){return e=null==e?iy:Math.pow(iy,e),new qy(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new qy(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*t,r=2*n-i;return new ky(zy(e>=240?e-240:e+120,r,i),zy(e,r,i),zy(e<120?e+240:e-120,r,i),this.opacity)},clamp(){return new qy(Ey(this.h),Oy(this.s),Oy(this.l),Sy(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Sy(this.opacity);return`${1===e?"hsl(":"hsla("}${Ey(this.h)}, ${100*Oy(this.s)}%, ${100*Oy(this.l)}%${1===e?")":`, ${e})`}`}}));const Ay=Math.PI/180,Ty=180/Math.PI,Iy=4/29,jy=6/29,Py=3*jy*jy;function Fy(e){if(e instanceof Ly)return new Ly(e.l,e.a,e.b,e.opacity);if(e instanceof Vy)return Uy(e);e instanceof ky||(e=by(e));var t,n,i=Wy(e.r),r=Wy(e.g),o=Wy(e.b),a=$y((.2225045*i+.7168786*r+.0606169*o)/1);return i===r&&r===o?t=n=a:(t=$y((.4360747*i+.3850649*r+.1430804*o)/.96422),n=$y((.0139322*i+.0971045*r+.7141733*o)/.82521)),new Ly(116*a-16,500*(t-a),200*(a-n),e.opacity)}function Ly(e,t,n,i){this.l=+e,this.a=+t,this.b=+n,this.opacity=+i}function $y(e){return e>.008856451679035631?Math.pow(e,1/3):e/Py+Iy}function By(e){return e>jy?e*e*e:Py*(e-Iy)}function Hy(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Wy(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Vy(e,t,n,i){this.h=+e,this.c=+t,this.l=+n,this.opacity=+i}function Uy(e){if(isNaN(e.h))return new Ly(e.l,0,0,e.opacity);var t=e.h*Ay;return new Ly(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}ey(Ly,(function(e,t,n,i){return 1===arguments.length?Fy(e):new Ly(e,t,n,null==i?1:i)}),ty(ny,{brighter(e){return new Ly(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new Ly(this.l-18*(null==e?1:e),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return new ky(Hy(3.1338561*(t=.96422*By(t))-1.6168667*(e=1*By(e))-.4906146*(n=.82521*By(n))),Hy(-.9787684*t+1.9161415*e+.033454*n),Hy(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),ey(Vy,(function(e,t,n,i){return 1===arguments.length?function(e){if(e instanceof Vy)return new Vy(e.h,e.c,e.l,e.opacity);if(e instanceof Ly||(e=Fy(e)),0===e.a&&0===e.b)return new Vy(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Ty;return new Vy(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new Vy(e,t,n,null==i?1:i)}),ty(ny,{brighter(e){return new Vy(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new Vy(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return Uy(this).rgb()}}));var Yy=e=>()=>e;function Ky(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):Yy(isNaN(e)?t:e)}var Xy=function e(t){var n=function(e){return 1==(e=+e)?Ky:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(i){return Math.pow(e+i*t,n)}}(t,n,e):Yy(isNaN(t)?n:t)}}(t);function i(e,t){var i=n((e=wy(e)).r,(t=wy(t)).r),r=n(e.g,t.g),o=n(e.b,t.b),a=Ky(e.opacity,t.opacity);return function(t){return e.r=i(t),e.g=r(t),e.b=o(t),e.opacity=a(t),e+""}}return i.gamma=e,i}(1),Gy=/^class(-pyramid)?/,Jy=function(e,t,n,i){var r=void 0!==n.min?n.min:i.min(),o=void 0!==n.max?n.max:i.max(),a=r,s=o,l=t.limits,c={},u="percent"===t.limitType?l.map((function(e){return r+(o-r)*e})):l,h=t.colors.map((function(t){return e.resolveUIColor(t)}));if(r=Math.min.apply(Math,[r].concat(_m(u))),o=Math.max.apply(Math,[o].concat(_m(u))),c.min=r,c.max=o,t.breakTypes&&-1===t.breakTypes.indexOf(!0))c.type="categorical",Object.assign(c,function(e){var t=e.min,n=e.max,i=e.limits,r=e.range,o=[],a=[];if(i.length)if(i[i.length-1]<t)a.push(t,n),o.push(r[r.length-1],r[r.length-1],r[r.length-1]);else if(i[0]>n)a.push(t,n),o.push(r[0],r[0],r[0]);else{if(i[0]>t)a.push(t),o.push(r[0]);else{a.push(t);for(var s=0;s<i.length;s++)if(t<i[s]){o.push(r[s]);break}}for(var l=0;l<i.length;l++)t<i[l]&&i[l]<n&&(a.push(i[l]),o.push(r[l]));if(i[i.length-1]<n)a.push(n),o.push(r[i.length]),o.push(r[i.length]);else{a.push(n);for(var c=0;c<i.length;c++)if(i[c]>n){o.push(r[c]),o.push(r[c]);break}}}else o.push(r[0]);return{min:t,max:n,range:o,domain:a}}({min:"percent"===t.limitType?r:a,max:"percent"===t.limitType?o:s,range:h,limits:"percent"===t.limitType?u:l}));else if(t.breakTypes){var d=t.breakTypes;c.type="continuous",c.domain=[r],c.range=[h[0]];for(var f=0;f<u.length;f+=1)if(d[f]){var p=h[f],g=h[f+1],m=Xy(p,g)(.5);c.range.push(m),c.domain.push(u[f]),f<u.length-1&&d[f+1]&&(c.range.push(h[f+1]),c.domain.push((u[f]+u[f+1])/2))}else c.range.push(h[f]),c.range.push(h[f+1]),c.domain.push(u[f]),c.domain.push(u[f]+Math.min(1e-6,(o-r)/1e6));c.range.push(h[h.length-1]),c.domain.push(o)}else c.domain=u,c.range=h;return c};function Zy(e,t,n,i,r){var o,a,s,l=0,c=[],u=(e-t)/(i+1);if(0===u)return 1;for(o=0;o<n.length;o+=1)a=.99*(n[o]-t),s=n[o]>e?Math.floor(e/u):n[o]<t?0:Math.floor(a/u),Number.isNaN(s)||(c[s]?c[s]+=1:c[s]=1);for(o=0;o<c.length;o+=1)c[o]&&(l+=1);return l<=i||l>=r?Math.max(l,i):Zy(e,t,n,i+1,r)}var Qy=function(e,t,n,i){var r,o,a=t.theme,s=t.hc,l=i.f,c={mode:"field",fieldType:"measure",field:l?l.key():void 0,reverse:n.input.reverseScheme||!1,type:"continuous",range:function(e){return e.resources.theme.palette("quant")}},u=[],h=!0;if(l){if(Number.isNaN(+l.min())||Number.isNaN(+l.max()))return{invalid:!0};(h=!("S"===(r=n.pic.raw()).qMode&&(r.qDataPages[0]&&r.qSize.qcy>r.qDataPages[0].qArea.qHeight||!r.qDataPages.length&&r.qSize.qcy>0)||"K"===r.qMode&&r.qStackedDataPages[0]&&r.qSize.qcy>r.qStackedDataPages[0].qArea.qHeight||"T"===r.qMode&&r.qSize.qcy>r.qTreeDataPages[0].qGroupSize))&&(u=n.pic.extract({field:0,props:{num:{field:l.key()},exclude:{fields:s.qDimensionInfo.map((function(e,t){return{field:"qDimensionInfo/".concat(t)}})),value:function(e){return Math.min.apply(Math,_m(e))<0}}}}).filter((function(e){return e.value>=0&&!e.exclude.value})).map((function(e){return e.num.value})).filter((function(e){return"number"==typeof e})))}if(!1===n.input.autoMinMax){if(c.min=n.input.measureMin,c.max=n.input.measureMax,c.max<c.min)return{invalid:!0}}else if(l&&!h)c.min=l.min(),c.max=l.max();else if(l){if(!u.length)return{invalid:!0};c.min=Math.min.apply(Math,_m(u)),c.max=Math.max.apply(Math,_m(u))}if(n.input.measureScheme&&(c.palettes={quant:n.input.measureScheme}),a){var d=a.getDataColorScales().filter((function(e){return e.key===n.input.measureScheme}))[0];c.type=d&&Gy.test(d.type)?"categorical":"continuous","categorical"===c.type&&(o=d.colors.some((function(e){return Array.isArray(e)}))?Math.max.apply(Math,_m(d.colors.map((function(e){return e?e.length:0})))):d.colors.length)}if("categorical"===c.type){for(var f=h?Zy(c.max,c.min,u,1,o):o,p=(c.max-c.min)/f,g=[],m=0;m<f+1;m+=1)g.push(c.min+p*m);c.domain=g,c.range=function(e){for(var t=e.resources.theme.palette("quant",f),n=Math.max(1,Math.floor(t.length/f)),i=[],r=0;r<f;r+=1)i.push(t[r*n]);return[i[0]].concat(i,[i[i.length-1]])}}return c};function ev(e,t){var n;return t.activeMeasureIndex>=0?n=e.pic.fields().filter((function(e){return"measure"===e.type()}))[t.activeMeasureIndex]:"libraryItem"===t.type?n=e.pic.field((function(e){return e.raw().colorMapRef===t.key&&void 0!==t.key})):"expression"===t.type&&(n=e.pic.field((function(e){return"colorByAlternative"===e.raw().id}))),n||(n=e.pic.field((function(e){return void 0!==e.raw().matchMeasure})))&&(n=e.pic.fields().filter((function(e){return"measure"===e.type()}))[n.raw().matchMeasure]),n}function tv(e){e.measureOverrides.every((function(e){return!e}))&&(e.measureOverrides=null)}function nv(e,t){for(var n=(null==t?void 0:t.domain)||[],i=(null==t?void 0:t.range)||[],r=[],o=0;o<e.length;++o){var a=e[o];if("constant"===(null==a?void 0:a.mode)){var s=n.indexOf(o);-1===s?(n.push(o),i.push(a.primary)):i[s]=a.primary,e[o]=null}else if(a){r.push(o);var l=n.indexOf(o);-1!==l&&(n.splice(l,1),i.splice(l,1))}}return{domain:n,range:i,exclude:r}}function iv(e,t,n,i){var r,o=function(e,t,n,i){if(t.input&&!t.input.auto){if("byMeasure"===t.input.mode)return function(e,t,n){var i=t.theme,r=t.hc,o=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).getCField,a=void 0===o?ev:o,s=n.input.byMeasureDef||{activeMeasureIndex:0},l=a(n,s),c=Qy(0,{theme:i,hc:r},n,{f:l});if(c.invalid)return c;"expression"===s.type&&(s.activeMeasureIndex<0||void 0===s.activeMeasureIndex)&&(c.label=s.label,l&&"color.altLabel"===l.raw().labelExpRef&&(c.label=n.input.altLabel)),!c.label&&l&&(c.label=l.title());var u=s.activeMeasureIndex>=0?l:null;if(!u&&l&&void 0!==l.raw().matchMeasure&&l.raw().matchMeasure>-1&&(u=n.pic.fields().filter((function(e){return"measure"===e.type()}))[l.raw().matchMeasure]),n.input.useMeasureGradient&&"libraryItem"===s.type)if(u){var h=u.raw().coloring;h&&h.gradient&&Km(c,Jy(e,h.gradient,c,u))}else c.auxiliary=s;return c}(e,n,t);if("byDimension"===t.input.mode)return function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=i.getCDef,o=void 0===r?Zm:r,a=i.getCByField,s=void 0===a?Qm:a,l=i.getPersistence,c=void 0===l?Jm:l,u=o(t,n),h=s(n,u),d=h?h.raw():{},f=n&&n.pic?n.pic.raw():{};if(d.qError||d.qSize&&0===d.qSize.qcy&&!f.qHasOtherValues)return{invalid:!0};var p={mode:"field",fieldType:"dimension",type:"categorical",field:h?h.key():void 0,isFieldLocked:d.qLocked};return("expression"===u.type||u.activeDimensionIndex<0)&&(p.label=u.label,"color.altLabel"===d.labelExpRef&&(p.label=n.input.altLabel)),!p.label&&h&&(p.label=h.title()),n.input.dimensionScheme&&(p.palettes={categorical:n.input.dimensionScheme}),n.input.useDimColVal&&"libraryItem"===u.type&&(p.auxiliary=u),Km(p,c(t,n,u,h,{byRow:Gm,byElemNo:Xm})),p}(e,n,t);if("byExpression"===t.input.mode)return function(e,t,n,i){var r=t.hc,o=t.theme,a=t.translator,s=n.pic.field((function(e){return"colorByExpression"===e.raw().id}));if(!s||!s.raw().qFallbackTitle&&!n.input.colorExpression||!(Number.isFinite(s.raw().qMin)&&Number.isFinite(s.raw().qMax)||n.input.expressionIsColor))return{mode:"constant",type:"constant",primary:i.nil};if(n.input.expressionIsColor)return{mode:"field",fieldType:"expression",field:s?s.key():void 0,type:"color"};var l=Qy(0,{hc:r,theme:o},n,{f:s});return l.invalid||(l.label=n.input.expressionLabel||a.get("Object.ChartTooltip.ColorExpression")),l}(0,n,t,i);if("byMultiple"===t.input.mode||"primary"===t.input.mode)return function(e,t,n,i){var r=t.hc,o=t.theme,a=t.translator,s=n.input.useBaseColors;if(("byMultiple"===n.input.mode||"primary"===n.input.mode&&"measure"===n.input.useBaseColors)&&r.qMeasureInfo.length>1&&(s="measure"),"measure"===s){var l=[],c=[];"measure"===n.input.useBaseColors&&r.qMeasureInfo.forEach((function(t,n){if(t.baseColor||t.coloring&&t.coloring.baseColor){l.push(n);var r=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===r?c.push(i.primary):c.push(r)}}));var u=n.input.dimensionScheme?{categorical:n.input.dimensionScheme}:void 0,h=o?o.getDataColorPalettes()[0]:void 0;return"measure"===n.input.useBaseColors&&h&&(u={categorical:h.key}),{mode:"measure",type:"categorical",palettes:u,label:a?a.get("Common.Measures"):void 0,explicit:l.length?{domain:l,range:c}:void 0}}if("dimension"===s){var d=[],f=[];return r.qDimensionInfo.forEach((function(t,n){if(t.baseColor||t.coloring&&t.coloring.baseColor){d.push(n);var r=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===r?f.push(i.primary):f.push(r)}})),{mode:"dimension",type:"categorical",field:d.length?d[0]:void 0,explicit:d.length?{domain:d,range:f}:void 0}}var p=i.primary;if(void 0!==n.input.paletteColor)n.input.paletteColor&&(p=e.resolveUIColor(n.input.paletteColor));else{var g=n.input.singleColor;"number"!=typeof g||Number.isNaN(g)||(p=["#b0afae","#7b7a78","#545352","#4477aa","#7db8da","#b6d7ea","#46c646","#f93f17","#ffcf02","#276e27","#ffffff","#000000"][g])}return{mode:"constant",type:"constant",primary:p}}(e,n,t,i)}return{}}(e,t,n,i);return null!==(r=t.input)&&void 0!==r&&r.measureOverrides?(o.measureOverrides=t.input.measureOverrides.map((function(n,r){return function(e){var t,n=e.cm,i=e.defaults,r=e.index,o=e.input,a=e.pic;if(!o||!o.on)return null;var s=null!==(t=o.mode)&&void 0!==t?t:"primary";return"primary"===s?function(e,t,n){var i=n.primary;return void 0!==t.paletteColor&&t.paletteColor&&(i=e.resolveUIColor(t.paletteColor)),vm(vm({},n),{},{mode:"constant",type:"constant",primary:i})}(n,o,i):"byExpression"===s?function(e,t,n){var i="qMeasureInfo/".concat(e,"/"),r=t.field((function(e){return e.id().startsWith(i)&&"colorByMeasureExpression"===e.raw().id})),o=r;return vm(vm({},n),{},o?{mode:"field",fieldType:"expression",field:r?r.key():void 0,type:"color"}:{mode:"constant",type:"constant",primary:n.nil})}(r,a,i):null}({cm:e,input:n,defaults:i,index:r,pic:t.pic})})),function(e,t){var n,i,r,o=t.translator;if(tv(e),1===(null===(n=e.measureOverrides)||void 0===n?void 0:n.length))return e.measureOverrides[0];if("measure"===e.mode&&e.measureOverrides&&(e.explicit=nv(e.measureOverrides,e.explicit),tv(e)),null!==(i=e.measureOverrides)&&void 0!==i&&i.every((function(e){return"constant"===(null==e?void 0:e.mode)}))){var a={mode:"measure",type:"categorical",label:null==o?void 0:o.get("Common.Measures")};return a.explicit=nv(e.measureOverrides),a}return null!==(r=e.measureOverrides)&&void 0!==r&&r.every((function(e){return e}))?{invalid:!0,measureOverrides:e.measureOverrides}:e}(o,n)):o}var rv=function(e,t){var n=e.fieldType,i={};if(t)if("measure"===n){var r=t.coloring;r&&(i.measureGradient=r.gradient)}else if("dimension"===n){var o=t[0],a=t[1];o&&(i.legendDataPage=o),a&&(i.dimValsData=a.colorMap)}return i},ov=function(e){throw e.isHandled=!0,e};function av(e){return function(t){return"object"===Mm(t.datum[e])?t.datum[e].value:void 0}}function sv(e){return"object"===Mm(e.datum.isNull)?e.datum.isNull.value:-2===e.datum.value}function lv(e){return-3===e.datum.value}var cv={COLOR:void 0,FONT_SIZE:"16px",FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"},uv={COLOR:void 0,FONT_SIZE:void 0,FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"};function hv(e){var t=e.theme,n=e.key,i=e.styleOverrides,r={title:{color:cv.COLOR,fontSize:cv.FONT_SIZE,fontFamily:cv.FONT_FAMILY},label:{color:uv.COLOR,fontSize:uv.FONT_SIZE,fontFamily:uv.FONT_FAMILY}};if(!t&&!i)return r;var o=i||{},a=o.title,s=o.label,l=function(e){var t=e.theme,n=e.key;return function(e,i,r,o){return void 0!==e?e:t?t.getStyle(n,i,r):o}}({theme:t,key:n});return r.title.color=l(null==a?void 0:a.color,"legend.title","color",cv.COLOR),r.title.fontSize=l(null==a?void 0:a.fontSize,"legend.title","fontSize",cv.FONT_SIZE),r.title.fontFamily=l(null==a?void 0:a.fontFamily,"legend.title","fontFamily",cv.FONT_FAMILY),r.label.color=l(null==s?void 0:s.color,"legend.label","color",uv.COLOR),r.label.fontSize=l(null==s?void 0:s.fontSize,"legend.label","fontSize",uv.FONT_SIZE),r.label.fontFamily=l(null==s?void 0:s.fontFamily,"legend.label","fontFamily",uv.FONT_FAMILY),r}var dv=function(e,t,n){var i=e&&e.dock||void 0;if("auto"!==i)return i||"right";if(t){var r=t.element.getBoundingClientRect();if(r.height>r.width)return"bottom"}return n?"left":"right"},fv=function(e,t,n){return!(n.invalid||"color"===n.type||"measure"===n.mode&&t.qMeasureInfo.length<=1||"dimension"===n.mode)&&("function"==typeof e.show?e.show():!1!==e.show)};function pv(e,t){var n=e.styleReference,i=e.styleOverrides,r=e.chart,o=e.rtl,a=t.legendProps,s=t.coloring,l=t.theme,c=t.hc,u=hv({theme:l,key:n,styleOverrides:i});return{layout:{minimumLayoutMode:"MEDIUM",dock:dv(a,r,o)},show:"function"==typeof a.show?function(){return fv(a,c,s)}:fv(a,c,s),renderer:"svg",mounted:function(e){e.childNodes[0].style.pointerEvents="none",e.style.overflow="hidden"},settings:{title:{show:!1!==a.showTitle,wordBreak:"break-word",maxLines:2,lineHeight:1.2,text:s.label||"",fill:u.title.color,fontSize:u.title.fontSize,fontFamily:u.title.fontFamily}}}}function gv(e,t,n){var i=[],r=[],o=function(e,t,n){return"categorical"===t.coloring.type?function(e,t,n){var i=pv(e,t);if(!i.show)return!1;var r,o=e.key,a=e.styleReference,s=e.styleOverrides,l=e.viewState,c=e.rtl,u=e.settings,h=e.style,d=t.scaleKey,f=t.theme,p=t.scales,g=hv({theme:f,key:a,styleOverrides:s}),m=i.layout.dock,y="left"===m||"right"===m?{maxLines:2,wordBreak:"break-word"}:{},v={up:"M13.6,11 L2.4,11 C2.28954305,11 2.2,10.9104569 2.2,10.8 C2.2,10.756726 2.21403557,10.7146192 2.24,10.68 L7.84,3.21333333 C7.90627417,3.12496777 8.03163444,3.10705916 8.12,3.17333333 C8.13516113,3.18470418 8.14862915,3.1981722 8.16,3.21333333 L13.76,10.68 C13.8262742,10.7683656 13.8083656,10.8937258 13.72,10.96 C13.6853808,10.9859644 13.643274,11 13.6,11 Z",down:"M2.4,4 L13.6,4 C13.7104569,4 13.8,4.08954305 13.8,4.2 C13.8,4.24327404 13.7859644,4.28538077 13.76,4.32 L8.16,11.7866667 C8.09372583,11.8750322 7.96836556,11.8929408 7.88,11.8266667 C7.86483887,11.8152958 7.85137085,11.8018278 7.84,11.7866667 L2.24,4.32 C2.17372583,4.23163444 2.19163444,4.10627417 2.28,4.04 C2.31461923,4.01403557 2.35672596,4 2.4,4 Z",left:"M11,2.4 L11,13.6 C11,13.7104569 10.9104569,13.8 10.8,13.8 C10.756726,13.8 10.7146192,13.7859644 10.68,13.76 L3.21333333,8.16 C3.12496777,8.09372583 3.10705916,7.96836556 3.17333333,7.88 C3.18470418,7.86483887 3.1981722,7.85137085 3.21333333,7.84 L10.68,2.24 C10.7683656,2.17372583 10.8937258,2.19163444 10.96,2.28 C10.9859644,2.31461923 11,2.35672596 11,2.4 Z",right:"M4,13.6 L4,2.4 C4,2.28954305 4.08954305,2.2 4.2,2.2 C4.24327404,2.2 4.28538077,2.21403557 4.32,2.24 L11.7866667,7.84 C11.8750322,7.90627417 11.8929408,8.03163444 11.8266667,8.12 C11.8152958,8.13516113 11.8018278,8.14862915 11.7866667,8.16 L4.32,13.76 C4.23163444,13.8262742 4.10627417,13.8083656 4.04,13.72 C4.01403557,13.6853808 4,13.643274 4,13.6 Z"};"dimension"===t.coloring.fieldType&&(r=function(e){return e.datum.value>=0||-3===e.datum.value});var x="".concat(d,"Legend");return Km(!0,i,{type:"legend-cat",key:"".concat(o,"-cat"),scale:x in p?x:d,settings:{layout:{scrollOffset:function(){return l?l.get("legendScrollOffset"):void 0},size:-1!==["top","bottom"].indexOf(i.layout.dock)?2:1,direction:c?"rtl":"ltr",horizontal:20},item:{show:r,label:vm({fill:g.label.color,fontSize:g.label.fontSize,fontFamily:g.label.fontFamily},y)},navigation:{disabled:n,button:{content:function(e,t){var n=t.direction;return e("i",{style:{"pointer-events":"none",fontSize:"12px",display:"inline-block",fontStyle:"normal",lineHeight:"0",textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizelegibility",margin:"0px"}},[e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor"},[e("path",{d:v[n]})])])}}}},brush:{consume:[{context:"selection",data:["",o],style:{inactive:{opacity:.3}}}]}},{settings:u,style:h})}(e,t,n):"continuous"===t.coloring.type&&function(e,t){var n,i=e.key,r=e.styleReference,o=e.styleOverrides,a=e.rtl,s=e.settings,l=e.style,c=t.scaleKey,u=t.theme,h="".concat(c,"Range"),d=pv(e,t);if(!d.show)return!1;var f=hv({theme:u,key:r,styleOverrides:o}),p=d.layout.dock,g="right"===p||"left"===p,m=null===(n=t.scales)||void 0===n?void 0:n[h];return g&&m&&(m.invert=!0),Km(!0,d,{type:"legend-seq",key:"".concat(i,"-seq"),settings:{fill:c,major:h,length:1,tick:{fill:f.label.color,fontSize:f.label.fontSize,fontFamily:f.label.fontFamily},title:{anchor:!a||"top"!==d.layout.dock&&"bottom"!==d.layout.dock?void 0:"right",padding:parseFloat(d.settings.title.fontSize)||16}}},{settings:s,style:l})}(e,t)}(e,t,n&&n.navigationDisabled);return i.push(o),o&&"legend-cat"===o.type&&(r.push(function(e){var t=e.key,n=e.requireFailure,i=e.recognizeWith,r=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:tap-".concat(t),type:"Tap",requireFailure:n,recognizeWith:i,options:{event:"legendtap",interval:10,pointers:1,enable:function(e,n){var i;if(!n)return!0;if(null!=r&&null!==(i=r.interact)&&void 0!==i&&i.enabled&&!r.interact.enabled())return!1;if(!this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some((function(e){return e.key==="".concat(t,"-cat")})))return!1;var o=n.srcEvent.target;return!!(o&&o.hasAttribute("data-action")&&o.hasAttribute("data-component-key"))||!(!o||!o.childNodes[0]||"BUTTON"!==o.childNodes[0].nodeName)}},events:{legendtap:function(e){e.preventDefault();var t=e.srcEvent.target;t&&t.hasAttribute("data-action")&&t.hasAttribute("data-component-key")&&this.chart.component(t.getAttribute("data-component-key")).emit(t.getAttribute("data-action"))}}}}(e,n)),r.push(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.eventName,n=e.key,i=e.requireFailure,r=e.recognizeWith,o=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:pan-".concat(n),type:"Pan",requireFailure:i,recognizeWith:r,options:{event:t,pointers:1,threshold:10,enable:function(e,i){var r;return this.started===t||!i||!(null!=o&&null!==(r=o.interact)&&void 0!==r&&r.enabled&&!o.interact.enabled())&&this.chart.componentsFromPoint({x:i.center.x,y:i.center.y}).some((function(e){return e.key==="".concat(n,"-cat")}))}},events:mm(mm(mm({},"".concat(t,"start"),(function(e){e.preventDefault(),this.started!==t&&(this.started=t,this.chart.component("".concat(n,"-cat")).emit("panstart",e))})),"".concat(t,"move"),(function(e){e.preventDefault(),this.chart.component("".concat(n,"-cat")).emit("panmove",e)})),"".concat(t,"end"),(function(e){e.preventDefault(),this.chart.component("".concat(n,"-cat")).emit("panend",e),this.started=!1}))}}(e,n))),{interactions:r,components:i}}function mv(e){var t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.auto,n=function(e){var t=vm({hc:null,colorProps:null,layout:null,theme:null},e),n={},i={auto:function(){return{mode:"primary"}},getDimensionColorMap:function(){return Promise.reject()},getMeasure:function(){return Promise.reject()},getAttributeDimension:function(){return Promise.reject()}},r={auto:function(e){return e?(i.auto=e,r):i.auto},getDimensionColorMap:function(e){return e?(i.getDimensionColorMap=e,r):i.getDimensionColorMap},getAttributeDimension:function(e){return e?(i.getAttributeDimension=e,r):i.getAttributeDimension},getMeasure:function(e){return e?(i.getMeasure=e,r):i.getMeasure},set:function(e){var r;if(!e.colorProps)throw new Error('Missing "colorProps"');if(Km(t,e),(n={pic:t.picasso.data("q")({data:t.hc,config:{localeInfo:t.localeInfo}}),input:t.colorProps}).input.auto){var o=i.auto(e.layout);n.input=Km(!0,{},n.input,o,{auto:!1});var a=t.theme?t.theme.getDataColorPalettes():[];a[0]&&(n.input.dimensionScheme=a[0].key);var s=0;n.input.byDimDef&&+n.input.byDimDef.activeDimensionIndex>=0&&(s=+n.input.byDimDef.activeDimensionIndex),t.hc&&t.hc.qDimensionInfo[s]&&t.hc.qDimensionInfo[s].coloring&&t.hc.qDimensionInfo[s].coloring.colorMapRef&&n.input.byDimDef&&(n.input.byDimDef.type="libraryItem",n.input.byDimDef.key=t.hc.qDimensionInfo[s].coloring.colorMapRef)}null!==(r=n.input.measureOverrides)&&void 0!==r&&r.every((function(e){return!e||!e.on}))&&(n.input=Km(!1,{},n.input,{measureOverrides:null}))},palettes:function(){if(!n.palettes){var e=t.theme,i=[];(e&&e.getDataColorPickerPalettes()||[]).forEach((function(e){i.push({key:"ui",colors:e.colors})})),n.palettes=i}return n.palettes},getAuxiliaryData:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/qHyperCubeDef";if(!e.auxiliary&&!/qAttrDimInfo/.test(e.field))return Promise.resolve();var r=(e.auxiliary||{}).key;if("measure"===e.fieldType)return i.getMeasure(r,t).catch((function(){}));if("dimension"===e.fieldType){var o="".concat(n,"/").concat(e.field).replace("qDimensionInfo","qDimensions").replace("qAttrDimInfo","qAttributeDimensions");return Promise.all([/qAttrDimInfo/.test(e.field)?i.getAttributeDimension(o,t).catch((function(){})):Promise.resolve(),r?i.getDimensionColorMap(r,t).catch((function(){})):Promise.resolve()])}return Promise.resolve()},getAuxiliarySettings:function(e,i){var r=this;return e.auxiliary||/qAttrDimInfo/.test(e.field)?(this.palettes(),this.getAuxiliaryData(e,i).then((function(i){if(!i)return{};if("measure"===e.fieldType){if(i.coloring&&i.coloring.gradient){var o=n.pic.field(e.field);return Jy(r,i.coloring.gradient,e,o)}return{}}if("dimension"===e.fieldType){var a={nil:e.nil,others:e.others},s=i[0],l=i[1]?i[1].colorMap:null;if(s){var c=t.picasso.data("q")({data:{qDimensionInfo:[n.pic.field(e.field).raw(),n.pic.field(e.field).raw()],qMeasureInfo:[],qDataPages:s,qInterColumnSortOrder:[0,1],qMode:"S"}});a.legendDataset=c}return l?function(e,t,n,i){var r=i.external,o=i.field,a=vm({},e);Km(a,Xm(o,o.raw().qCardinal));var s=r.theme?r.theme.getDataColorPalettes()[0]:null;return t.nul&&(a.nil=n.resolveUIColor(t.nul)),t.oth&&(a.others=n.resolveUIColor(t.oth)),t.usePal?(a.palettes={categorical:t.pal},s&&!t.pal&&(a.palettes.categorical=s.key,Km(a,Xm(o)))):!1===t.autoFill&&t.single?a.range=[n.resolveUIColor(t.single)]:t.autoFill&&(s&&(a.palettes={categorical:s.key}),Km(a,Xm(o))),t.colors&&t.colors.length&&(a.explicit=function(e,t,n){for(var i={},r=0;r<e.length;r+=1)i[e[r].value]=e[r].baseColor;var o=[];return{domain:function(e){var r=e.data,a=[];o=[];for(var s=0;s<r.items.length;s++){var l=r.items[s],c=(l.text||l).label;i[c]&&-1===a.indexOf(l.value)&&(a.push(l.value),o.push(t.resolveUIColor(i[c])))}return a.push(-3,-2),o.push(n.others),o.push(n.nil),a},range:function(){return o}}}(t.colors,n,a)),a}(a,l,r,{external:t,field:n.pic.field(e.field)}):a}return{}}))):Promise.resolve()},resolveUIColor:function(e){if(e.index<0||void 0===e.index)return e.color;if(void 0===n.uiPalette&&(n.uiPalette=this.palettes().filter((function(e){return"ui"===e.key}))[0]||!1),!n.uiPalette)return e.color;var t="none"===n.uiPalette.colors[0]?e.index:e.index-1;return void 0===n.uiPalette.colors[t]?e.color:n.uiPalette.colors[t]},settings:function(){if(this.palettes(),!n.settings){var e={primary:"steelblue",others:"#aaa",nil:"#ddd"},i=t.theme;i&&(e=vm(vm({},e),i.getDataColorSpecials())),n.settings=Km(e,iv(this,n,t,e))}return n.settings}};return r}(e.resources).auto(t||function(){return{mode:"byDimension",persistent:!1,useDimColVal:!0,byDimDef:{activeDimensionIndex:0,type:"expression",label:""}}}).getDimensionColorMap((function(e,t){return function(e,t){var n=t.layout,i=t.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.dimValsData?Promise.resolve({colorMap:n.snapshotData.content.chartData.dimValsData}):Promise.reject():i&&i.getObject?i.getObject("ColorMapModel_".concat(e)).then((function(e){return e.getLayout()})):Promise.reject()}(e,{layout:t.layout,app:t.app})})).getMeasure((function(e,t){return function(e,t){var n=t.layout,i=t.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.measureGradient?Promise.resolve({coloring:{gradient:n.snapshotData.content.chartData.measureGradient}}):Promise.reject():i&&i.getMeasure?i.getMeasure(e).then((function(e){return e.getMeasure()})):Promise.reject()}(e,{layout:t.layout,app:t.app})})).getAttributeDimension((function(e,t){return function(e,t){var n=t.layout,i=t.model,r=t.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.legendDataPage?Promise.resolve(n.snapshotData.content.chartData.legendDataPage):Promise.reject():i&&i.session&&r?i.getHyperCubeData(e,[{qHeight:100,qLeft:0,qTop:0,qWidth:2}]).catch(ov):Promise.reject()}(e,{layout:t.layout,model:t.model,app:t.app})}));return n.getSnapshotData=rv,n}({resources:e}),n={},i={},r=function(e){return i.settings||(e||console.warn("settings() called before auxiliarySettings()"),i.settings=t.settings()),i.settings},o={config:function(r){if(n=vm({},r),i={},!n.key)throw new Error("Missing key");t.set(vm(vm({},e),n))},auto:function(e){return e?(t.auto(e),o):t.auto()},getAuxiliarySettings:function(e){return i.auxiliarySettings?Promise.resolve(i.auxiliarySettings):t.getAuxiliarySettings(r(!0),e).then((function(e){return i.auxiliarySettings=e||{},i.settings=vm(vm({},i.settings),i.auxiliarySettings),i.scales=void 0,i.color=void 0,i.auxiliarySettings}))},getAuxiliaryData:function(){return t.getAuxiliaryData(r())},getSnapshotData:function(e){var n=r();return t.getAuxiliaryData(n,e).then((function(e){return t.getSnapshotData(n,e)}))},resolveUIColor:function(e){return t.resolveUIColor(e)},settings:function(){var e=r();return{mode:e.mode,type:e.type,label:e.label,field:e.field,fieldType:e.fieldType,nil:e.nil,others:e.others,primary:e.primary}},settingsForMeasure:function(e){var t;return(null===(t=r().measureOverrides)||void 0===t?void 0:t[e])||this.settings()},isSelectionLocked:function(e){var t=e.isMeasureSelectionLocked;return function(e,t){var n=t.isMeasureSelectionLocked;return"field"!==e.mode||("dimension"===e.fieldType?e.isFieldLocked:"measure"!==e.fieldType||n)}(r(),{isMeasureSelectionLocked:t})},palettes:function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.colorProps,n=e.coloring,i=e.theme,r=[];if(n&&n.palettes&&i){var o=n.palettes.categorical||t.dimensionScheme,a=i.getDataColorPalettes().filter((function(e){return e.key===o}))[0]||i.getDataColorPalettes()[0];o&&a&&r.push({key:"categorical",colors:a.colors});var s=n.palettes.metric||t.measureScheme,l=i.getDataColorScales().filter((function(e){return e.key===s}))[0]||i.getDataColorScales()[0];if(l){var c=l.colors[0]?l.colors:[[]].concat(_m(l.colors.slice(1)));c=Array.isArray(c[0])?c.map((function(e){return e.slice().reverse()})):c.slice().reverse(),r.push({key:"quant",colors:c})}}return r}({coloring:r(),colorProps:n.colorProps,theme:n.theme})},scales:function(){return i.scales=i.scales||function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.hc,n=e.coloring,i=e.rtl,r=e.key,o=e.source,a=e.picasso,s={},l=r;if(n){var c={override:!0,domain:n.explicit&&"function"==typeof n.explicit.domain?n.explicit.domain:[].concat(_m((n.explicit||{}).domain||[]),[-3,-2]),range:n.explicit&&"function"==typeof n.explicit.range?n.explicit.range:[].concat(_m((n.explicit||{}).range||[]),[n.others,n.nil])};if("field"===n.mode){if("dimension"===n.fieldType){var u,h=function(e){var t=e.hc,n=e.source,i=e.coloring,r={data:{extract:[{source:"dummy",field:0,filter:function(){return r.expando=t.qDataPages[0]?t.qDataPages[0].qArea.qTop:0,!1}},{source:n,field:i.field,trackBy:i.valueAccessor,reduce:"first",props:{row:{reduce:function(){return r.expando++}},text:{value:function(e){return e.qText},reduce:"first"}}}]},expando:0};return r}({hc:t,source:o,coloring:n}).data;if(n.legendDataset){var d=0,f={};a.data("q")({data:t}).extract({field:n.field,trackBy:n.valueAccessor,reduce:function(e){var t=e[0];return f[t]=d++,e[0]}}),u={source:"attrDim",extract:{field:"qDimensionInfo/0",filter:function(e){return e.qElemNumber>=0},props:{row:{value:function(e){return f[e.qElemNumber]}}}}}}var p={data:h,range:n.range,domain:n.domain,explicit:c,type:"categorical-color",label:function(e){return e.datum.text&&e.datum.text.value?e.datum.text.value:e.datum.label}};s[l]=p,u&&(s["".concat(l,"Legend")]=vm(vm({},p),{},{data:u})),t&&t.qHasOtherValues&&u&&((u||p.data).amend=[{label:t.qDimensionInfo[0].othersLabel,source:{key:"qHyperCube",field:"qDimensionInfo/0"},row:{value:-3},value:-3}])}else if("measure"===n.fieldType){var g={data:{field:n.field},min:n.min,max:n.max};s[l]=Km({},g,{type:"categorical"===n.type?"threshold-color":"sequential-color",range:n.range,domain:n.domain,invert:n.reverse}),"sequential-color"===s[l].type&&(s["".concat(l,"Range")]=Km({},g,{invert:!!i}))}else if("color"!==n.type)throw new Error("UNUSED FIELD")}else if("dimension"===n.mode){var m={data:t.qDimensionInfo.map((function(e,t){return t})),label:function(e){return t.qDimensionInfo[e.datum.value].qFallbackTitle},explicit:c,type:"categorical-color"};s[l]=m}else if("measure"===n.mode){var y={data:t.qMeasureInfo.map((function(e,t){return t})).filter((function(e){var t;return!(null!==(t=n.explicit)&&void 0!==t&&null!==(t=t.exclude)&&void 0!==t&&t.includes(e))})),label:function(e){return t.qMeasureInfo[e.datum.value].qFallbackTitle},explicit:c,type:"categorical-color"};s[l]=y}}return s}({hc:n.hc,coloring:r(),key:n.key,source:n.source,picasso:e.picasso}),i.scales},color:function(){return i.color=i.color||function(e){var t=e.coloring,n=e.scales,i=e.key,r=av(i),o=av("".concat(i,"IsAnOther")),a=function(e,t){var i=e.fieldType,a=e.invalid,s=e.mode,l=e.nil,c=e.others,u=e.primary,h=e.type;return a?function(e){return lv(e)||o(e)?c:l}:n[t]?function(e){return lv(e)?c:sv(e)||-2===r(e)&&"dimension"===i||"NaN"===r(e)?l:o(e)?c:e.resources.scale(t)(r(e))||c}:"constant"===s?function(e){return lv(e)||o(e)?c:sv(e)?l:u}:"color"===h?function(e){return lv(e)||o(e)?c:sv(e)?l:r(e)||c}:null},s=a(t,i);if(t.measureOverrides){var l=av("".concat(i,"MeasureIdx")),c=t.measureOverrides.map((function(e){return e&&a(e)}));return function(e){var t=l(e);return c[t]?c[t](e):s(e)}}return s}({coloring:r(),scales:this.scales(),key:n.key}),i.color},datumProps:function(e){return function(e){var t,n,i=e.hc,r=e.coloring,o=e.scales,a=e.key,s=e.addMeasureIx,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,c=a,u=r.nil;"field"===r.mode&&r.field?t=r.field:o[a]&&"field"===r.mode&&(t=o[a].data.field||r.field),t?(n={field:t,reduce:"first"},"color"===r.type&&(n.value=function(e){return"NaN"!==e.qNum?function(e){return"rgba(".concat([(16711680&e)>>16,(65280&e)>>8,255&e,((4278190080&e)>>>24)/255].join(","),")")}(e.qNum):e.qText&&yy(e.qText)?e.qText:u})):"dimension"===r.mode?n=void 0!==r.field?r.field:i.qDimensionInfo.length-1:"measure"===r.mode&&(n=l);var h=mm({},c,n);return i.qDimensionInfo.length>1&&(h["".concat(c,"IsAnOther")]={fields:i.qDimensionInfo.map((function(e,t){return{field:"qDimensionInfo/".concat(t)}})),value:function(e){return-1!==e.indexOf(-3)}}),s&&(h["".concat(c,"MeasureIdx")]=l),h}({coloring:this.settingsForMeasure(e),scales:this.scales(),key:n.key,hc:n.hc,addMeasureIx:r().measureOverrides},e)},data:function(){var e=r(),t={key:"dummy",data:[["field"],["a"]]};return e.legendDataset?[t,{type:"q",key:"attrDim",data:e.legendDataset.raw(),config:{localeInfo:n.localeInfo}}]:[t]},legend:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.eventName,i=e.key,o=e.viewState,a=e.chart,s=e.rtl,l=e.styleReference,c=void 0===l?"object.legend":l,u=e.styleOverrides,h=e.settings,d=void 0===h?{}:h,f=e.style,p=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return gv({eventName:t,key:i,rtl:s,viewState:o,chart:a,styleReference:c,styleOverrides:u,settings:d,style:void 0===f?{}:f},{legendProps:n.legendProps,scaleKey:n.key,coloring:r(),theme:n.theme,hc:n.hc,scales:this.scales()},p)}};return o}var yv=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function vv(e){var t=e.qHyperCube,n=t.qDimensionInfo,i=t.qMeasureInfo,r=n.some(yv),o=i.some(yv),a=e.color.useBaseColors;return"measure"===a&&!o||"dimension"===a&&!r?"off":a}var xv=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function bv(e){var t,n=e.qHyperCube.qDimensionInfo.some(xv),i=e.qHyperCube.qMeasureInfo.some(xv),r=n?"dimension":void 0;return{mode:"primary",useBaseColors:null!==(t=null!=r?r:i?"measure":void 0)&&void 0!==t?t:"off",paletteColor:null}}var wv=function(){};function kv(e){var t,n,i,r,o=e.picasso,a=e.model,s=e.app,l=e.translator,c=e.layoutService,u=void 0===c?void 0:c,h=e.createConfig,d=void 0===h?wv:h,f=e.config,p=void 0===f?{}:f,g=e.custom,m=void 0===g?{}:g,y=p.localeInfo,v=p.key,x=p.theme,b=void 0===x?void 0:x,w=p.auto,k=void 0===w?void 0:w,_=p.definitionPath,M=null==u||null===(t=u.getLayout)||void 0===t?void 0:t.call(u),S={theme:b,key:v,localeInfo:y,layout:M,hc:null==u||null===(n=u.getHyperCube)||void 0===n?void 0:n.call(u),legendProps:null==u||null===(i=u.getLayoutValue)||void 0===i?void 0:i.call(u,"legend"),colorProps:vm(vm({},null==u||null===(r=u.getLayoutValue)||void 0===r?void 0:r.call(u,"color")),{},{useBaseColors:M?vv(M):void 0})},R=mv({picasso:o,model:a,app:s,translator:l,auto:k});!1!==k&&R.auto((function(e){return k?k({layout:e,defaultAuto:bv}):bv(e)}));var C=!1,N={getColor:function(){return R.color()},getPaletteColor:function(e){var t=e.index,n=e.color;return R.resolveUIColor({index:t,color:n})},getData:function(){return R.data()},getDatumProps:function(e){return R.datumProps(e)},getSnapshotData:function(){return R.getSnapshotData(_)},getSettingsForMeasure:function(e){return R.settingsForMeasure(e)},getSettings:function(){return R.settings()},getLegend:function(e,t){return R.legend(e,t)},getScales:function(){return R.scales()},getPalettes:function(){return R.palettes()},isSelectionLocked:function(e){var t=e.isMeasureSelectionLocked;return R.isSelectionLocked({isMeasureSelectionLocked:t})},isInitialized:function(){return C},custom:vm({},m),initialize:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).createConfig,t=(void 0===e?d:e)({getUseBaseColors:vv}),n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return vm(vm(vm({},e),t),{},{colorProps:vm(vm({},e.colorProps),t.colorProps||{})})}(S,t);return R.config(n),R.getAuxiliarySettings(_).then((function(){C=!0}))}};return N}var _v="center",Mv="bottom";function Sv(e,t,n){if(void 0===e||void 0===t)return n;for(var i=t.split("."),r=e,o=0;o<i.length;++o){var a=i[o];if(void 0===r[a])return n;r=r[a]}return r}[{key:"NoDataExist",alignment:_v,condition:function(e){var t=e.layoutService;if(!t)return!1;var n=t.meta.size;return n.x*n.y==0}},{key:"OnlyNanDataMeasure",translationKey:"OnlyNanData",alignment:_v,condition:function(e){var t=e.layoutService;return!!t&&t.getHyperCubeValue("qMeasureInfo").every((function(e){return"NaN"===e.qMin&&"NaN"===e.qMax}))}},{key:"OnlyNanDataDimensionContinuous",translationKey:"OnlyNanData",alignment:_v,condition:function(e){var t=e.layoutService;if(!t)return!1;if(!t.meta.isContinuous)return!1;var n=t.getHyperCubeValue("qDimensionInfo.0");return n&&(n.qMax<n.qMin||"NaN"===n.qMax)}},{key:"OnlyNegativeOrZeroValues",alignment:_v},{key:"DataRangeIncludingZero",alignment:Mv},{key:"LimitedData",alignment:Mv},{key:"NegativeOrZeroValues",alignment:Mv}].reduce((function(e,t){return e[t.key]=t,e}),{});var Rv=["__proto__","constructor"];function Cv(e,t,n){if(void 0!==e&&void 0!==t){var i=t.split("."),r=i[i.length-1];if(!Rv.some((function(e){return i.includes(e)}))){for(var o=e,a=0;a<i.length-1;++a){var s=i[a];void 0===o[s]&&(o[s]=Number.isNaN(+i[a+1])?{}:[]),o=o[s]}void 0!==n?o[r]=n:delete o[r]}}}function Nv(e){var t=e.originalArray,n=e.newArray,i=e.matchKey;return Array.isArray(t)&&t.length?(n.forEach((function(e){var n=-1;t.some((function(t,r){return t[i]&&t[i]===e[i]&&(n=r),n})),n>-1?t[n]=e:t.push(e)})),t):n}function Dv(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t);if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Ev(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?qv(Object(n),!0).forEach((function(t){Dv(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qv(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ov=Object.prototype.hasOwnProperty,zv=Object.prototype.toString,Av=Object.defineProperty,Tv=Object.getOwnPropertyDescriptor,Iv=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===zv.call(e)},jv=function(e){if(!e||"[object Object]"!==zv.call(e))return!1;var t,n=Ov.call(e,"constructor"),i=e.constructor&&e.constructor.prototype&&Ov.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!i)return!1;for(t in e);return void 0===t||Ov.call(e,t)},Pv=function(e,t){Av&&"__proto__"===t.name?Av(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},Fv=function(e,t){if("__proto__"===t){if(!Ov.call(e,t))return;if(Tv)return Tv(e,t).value}return e[t]},Lv=function e(){var t,n,i,r,o,a,s=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof s&&(u=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)i=Fv(s,n),s!==(r=Fv(t,n))&&(u&&r&&(jv(r)||(o=Iv(r)))?(o?(o=!1,a=i&&Iv(i)?i:[]):a=i&&jv(i)?i:{},Pv(s,{name:n,newValue:e(u,a,r)})):void 0!==r&&Pv(s,{name:n,newValue:r}));return s};function $v(e,t,n,i){if(!e)return-1;const r=n.cache,o=e.origin?e.origin():null;o&&(e=o);let a=r.fields.indexOf(e),s=-1,l=-1;if(-1===a)for(let t=0;t<r.wrappedFields.length;t++)if(l=r.wrappedFields[t].attrDims.map((e=>e.instance)).indexOf(e),s=r.wrappedFields[t].attrExps.map((e=>e.instance)).indexOf(e),-1!==l||-1!==s){a=t;break}if(Array.isArray(i)&&i.some(((e,t)=>e!==t))){const e=i.indexOf(a);-1!==e&&(a=e)}return a-=t.qArea.qLeft,a<0||a>=t.qArea.qWidth?-1:l>=0?e=>e[a].qAttrDims.qValues[l]:s>=0?e=>e[a].qAttrExps.qValues[s]:e=>e[a]}function Bv(e,t,n){let{key:i}=n;const r={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return r.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(r.value),e.field&&(r.source={key:i,field:e.field.key()}),r}function Hv(e){let{cache:t,f:n,mainCell:i,p:r,page:o,rowIdx:a,row:s,sourceKey:l,target:c,targetProp:u,columnOrder:h}=e,d=i;if(r.field&&r.field!==n){const e=$v(r.field,o,{cache:t},h);if(-1===e)return;d=Lv({qRow:a},e(s))}c[u]=Bv(r,d,{key:l})}function Wv(e,t,n,i){const r=Array.isArray(e)?e:[e];let o=[];for(let e=0;e<r.length;e++)if(void 0!==r[e].field){const a=t.raw(),s=t.key(),l="object"==typeof r[e].field?r[e].field:t.field(r[e].field),{props:c,main:u}=i.normalizeConfig(r[e],t),h=Object.keys(c),d=!!r[e].trackBy,f=typeof r[e].trackBy,p={},g=[],m=[];for(let t=0;t<a.qDataPages.length;t++){const o=$v(l,a.qDataPages[t],{cache:n},a.qColumnOrder);if(-1!==o)for(let y=0;y<a.qDataPages[t].qMatrix.length;y++){const v=a.qDataPages[t].qArea.qTop+y,x=Lv({qRow:v},o(a.qDataPages[t].qMatrix[y])),b=Bv(u,x,{key:s});if(!u.filter||u.filter(x)){for(let e=0;e<h.length;e++){const i=c[h[e]];let r=i.fields||[i];i.fields&&(b[h[e]]=[]);for(let o=0;o<r.length;o++)Hv({cache:n,f:l,mainCell:x,p:r[o],prop:h[e],page:a.qDataPages[t],rowIdx:v,row:a.qDataPages[t].qMatrix[y],sourceKey:s,target:i.fields?b[h[e]]:b,targetProp:i.fields?o:h[e],columnOrder:a.qColumnOrder});if(i.fields){const t=b[h[e]].map((e=>e.value)),n=b[h[e]].map((e=>e.label));b[h[e]]={value:"function"==typeof i.value?i.value(t):void 0!==i.value?i.value:t,label:"function"==typeof i.label?i.label(n):void 0!==i.label?String(i.label):String(b[h[e]].value)}}}d&&i.track({cfg:r[e],itemData:x,obj:b,target:g,tracker:p,trackType:f}),m.push(b)}}}const y=d?i.collect(g,{main:u,propsArr:h,props:c}):m;o=[...o,...y]}return o}function Vv(e){var t=0,n=e.children,i=n&&n.length;if(i)for(;--i>=0;)t+=n[i].value;else t=1;e.value=t}function Uv(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=Kv)):void 0===t&&(t=Yv);for(var n,i,r,o,a,s=new Jv(e),l=[s];n=l.pop();)if((r=t(n.data))&&(a=(r=Array.from(r)).length))for(n.children=r,o=a-1;o>=0;--o)l.push(i=r[o]=new Jv(r[o])),i.parent=n,i.depth=n.depth+1;return s.eachBefore(Gv)}function Yv(e){return e.children}function Kv(e){return Array.isArray(e)?e[1]:null}function Xv(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function Gv(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function Jv(e){this.data=e,this.depth=this.height=0,this.parent=null}function Zv(e){return null==e?null:function(e){if("function"!=typeof e)throw new Error;return e}(e)}Jv.prototype=Uv.prototype={constructor:Jv,count:function(){return this.eachAfter(Vv)},each:function(e,t){let n=-1;for(const i of this)e.call(t,i,++n,this);return this},eachAfter:function(e,t){for(var n,i,r,o=this,a=[o],s=[],l=-1;o=a.pop();)if(s.push(o),n=o.children)for(i=0,r=n.length;i<r;++i)a.push(n[i]);for(;o=s.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,i,r=this,o=[r],a=-1;r=o.pop();)if(e.call(t,r,++a,this),n=r.children)for(i=n.length-1;i>=0;--i)o.push(n[i]);return this},find:function(e,t){let n=-1;for(const i of this)if(e.call(t,i,++n,this))return i},sum:function(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,i=t.children,r=i&&i.length;--r>=0;)n+=i[r].value;t.value=n}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,n=function(e,t){if(e===t)return e;var n=e.ancestors(),i=t.ancestors(),r=null;for(e=n.pop(),t=i.pop();e===t;)r=e,e=n.pop(),t=i.pop();return r}(t,e),i=[t];t!==n;)t=t.parent,i.push(t);for(var r=i.length;e!==n;)i.splice(r,0,e),e=e.parent;return i},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t},copy:function(){return Uv(this).eachBefore(Xv)},[Symbol.iterator]:function*(){var e,t,n,i,r=this,o=[r];do{for(e=o.reverse(),o=[];r=e.pop();)if(yield r,t=r.children)for(n=0,i=t.length;n<i;++n)o.push(t[n])}while(o.length)}};var Qv={depth:-1},ex={},tx={};function nx(e){return e.id}function ix(e){return e.parentId}function rx(e){let t=e.length;if(t<2)return"";for(;--t>1&&!ox(e,t););return e.slice(0,t)}function ox(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(!(1&n))return!0}return!1}function ax(e,t){"/"===e.charAt(0)&&(e=e.substring(1));const n=e.split("/");let i,r=t;for(let e=0;e<n.length;e++){if("*"===n[e]&&Array.isArray(r)){const t=[];i=n.slice(e+1).join("/");for(let e=0;e<r.length;e++){let n=ax(i,r[e]);Array.isArray(n)?t.push(...n):t.push(n)}return t}if(!n[e]&&Array.isArray(r)){const t=new Array(r.length);i=n.slice(e+1).join("/");for(let e=0;e<r.length;e++)t[e]=ax(i,r[e]);return t}n[e]in r&&(r=r[n[e]])}return r}function sx(e,t,n){let i=[];if(!e||!e.length)return i;if(t<=0){const t=n>=0?[e[n]]:e;i=[...i,...t]}else for(let r=0;r<e.length;r++)e[r].children&&e[r].children.length&&(i=[...i,...sx(e[r].children,t-1,n)]);return i}function lx(e,t,n){if(e===t)return e=>e;if(e>t){const n=Math.max(0,Math.min(100,e-t));return e=>{let t=e;for(let e=0;e<n;++e)t=t.parent;return t}}if(t>e){const i=Math.max(0,Math.min(100,t-e));return e=>sx(e.children,i-1,n)}return!1}const cx=/^qDimensionInfo(?:\/(\d+))?/,ux=/^\/?qMeasureInfo\/(\d+)/,hx=/\/qAttrExprInfo\/(\d+)/,dx=/\/qAttrDimInfo\/(\d+)/;function fx(e){return(e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map(((e,t)=>t))).filter((t=>t<e.qDimensionInfo.length))}function px(e,t){let{cube:n}=t;if(!e)return-1;let i=e.origin&&e.origin()?e.origin().key():e.key(),r=!1,o=-1,a=-1,s=-1,l=-1,c=-1,u=-1,h=i;const d=n.qEffectiveInterColumnSortOrder,f=fx(n);return cx.test(h)&&(r=!0,o=+cx.exec(h)[1],h=i.replace(cx,"")),ux.test(h)&&("K"===n.qMode?c=+ux.exec(h)[1]:d&&-1!==d.indexOf(-1)?(c=+ux.exec(h)[1],u=0):u=+ux.exec(h)[1],h=h.replace(ux,"")),h&&(dx.exec(h)?s=+dx.exec(h)[1]:hx.exec(h)&&(a=+hx.exec(h)[1])),l=r?"S"===n.qMode?f[o]:d?d.indexOf(o):o:d&&-1!==d.indexOf(-1)?d.indexOf(-1):n.qDimensionInfo.length-("K"===n.qMode?0:1),{fieldDepth:l+1,pseudoMeasureIndex:c,measureIdx:u,attrDimIdx:s,attrIdx:a}}function gx(e,t){let n,i,r=lx(e.fieldDepth,t.fieldDepth,t.pseudoMeasureIndex);return n=t.measureIdx>=0?e=>e.data.qValues[t.measureIdx]:e=>e.data,t.attrDimIdx>=0?i=e=>{var n;return null==e||null===(n=e.qAttrDims)||void 0===n?void 0:n.qValues[t.attrDimIdx]}:t.attrIdx>=0&&(i=e=>{var n;return null==e||null===(n=e.qAttrExps)||void 0===n?void 0:n.qValues[t.attrIdx]}),{nodeFn:r,attrFn:i,valueFn:n}}function mx(e,t,n){let{key:i}=n;const r={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return r.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(r.value),e.field&&(r.source={key:i,field:e.field.key()}),r}function yx(e){let{propsArr:t,props:n,item:i,itemData:r,ret:o,sourceKey:a}=e;for(let e=0;e<t.length;e++){const s=n[t[e]],l=s.fields||[s];let c,u;s.fields&&(c=[],u=[]);for(let n=0;n<l.length;n++){const h=l[n];let d,f,p,g,m,y;if("primitive"===h.type?(p=h.value,y=String(h.value)):("function"==typeof h.value&&(d=e=>h.value(e,i)),"function"==typeof h.label&&(f=e=>h.label(e,i)),h.accessor?(g=h.accessor(i),Array.isArray(g)?(m=g.map(h.valueAccessor),h.attrAccessor&&(m=m.map(h.attrAccessor)),d&&(p=m.map(d),d=null),f&&(y=m.map(f),f=null),p=h.reduce?h.reduce(p):p,y=h.reduceLabel?h.reduceLabel(y,p):String(p)):(p=h.attrAccessor?h.attrAccessor(h.valueAccessor(g)):h.valueAccessor(g),y=p)):(p=r,y=r)),s.fields){const e=d?d(p):p;c.push(e),u.push(f&&null!=y?f(y):null!=y?y:String(e))}else{const n=d?d(p):p;o[t[e]]={value:n,label:f?f(y):null!=y?y:String(n)},h.field&&(o[t[e]].source={field:h.field.key(),key:a})}}c&&(o[t[e]]={value:"function"==typeof s.value?s.value(c,i):c,label:"function"==typeof s.label?s.label(u,i):u})}}const vx=(e,t,n)=>{const i="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",r="K"===e.qMode?"qSubNodes":"qNodes",o=ax(i,e);return o&&o[0]?(t.tree=Uv(o[0],n.children||(e=>e[r])),t.tree):null};function xx(e){const t=e.raw().qDataPages.length?e.raw().qDataPages[0].qMatrix:[],n=function(e){const t=e.raw().qColumnOrder,n=e.fields();return t&&t.length===n.length?t:n.map(((e,t)=>t))}(e),i=e.fields(),r=e.fields().filter((e=>"dimension"===e.type())).map((e=>n.indexOf(i.indexOf(e)))),o=e.fields().filter((e=>"measure"===e.type())).map((e=>n.indexOf(i.indexOf(e)))),a={__root:{__id:"__root",qValues:[]}};for(let e=0;e<t.length;e++){const n=t[e];let i="__root",l=!1;for(let e=0;e<r.length;e++){var s;const t=n[r[e]],o="".concat(i,"__").concat(null!==(s=t.qElemNumber)&&void 0!==s?s:t.qElemNo);a[o]||(a[o]=Ev({__id:o,__parent:i,qValues:[]},t),l=!0),i=o}if(l)for(let e=0;e<o.length;e++){const t=n[o[e]];a[i].qValues.push(t)}}const l=Object.keys(a).map((e=>a[e]));return function(){var e,t=nx,n=ix;function i(i){var r,o,a,s,l,c,u,h,d=Array.from(i),f=t,p=n,g=new Map;if(null!=e){const t=d.map(((t,n)=>function(e){let t=(e=`${e}`).length;return ox(e,t-1)&&!ox(e,t-2)&&(e=e.slice(0,-1)),"/"===e[0]?e:`/${e}`}(e(t,n,i)))),n=t.map(rx),r=new Set(t).add("");for(const e of n)r.has(e)||(r.add(e),t.push(e),n.push(rx(e)),d.push(tx));f=(e,n)=>t[n],p=(e,t)=>n[t]}for(a=0,r=d.length;a<r;++a)o=d[a],c=d[a]=new Jv(o),null!=(u=f(o,a,i))&&(u+="")&&(h=c.id=u,g.set(h,g.has(h)?ex:c)),null!=(u=p(o,a,i))&&(u+="")&&(c.parent=u);for(a=0;a<r;++a)if(u=(c=d[a]).parent){if(!(l=g.get(u)))throw new Error("missing: "+u);if(l===ex)throw new Error("ambiguous: "+u);l.children?l.children.push(c):l.children=[c],c.parent=l}else{if(s)throw new Error("multiple roots");s=c}if(!s)throw new Error("no root");if(null!=e){for(;s.data===tx&&1===s.children.length;)s=s.children[0],--r;for(let e=d.length-1;e>=0&&(c=d[e]).data===tx;--e)c.data=null}if(s.parent=Qv,s.eachBefore((function(e){e.depth=e.parent.depth+1,--r})).eachBefore(Gv),s.parent=null,r>0)throw new Error("cycle");return s}return i.id=function(e){return arguments.length?(t=Zv(e),i):t},i.parentId=function(e){return arguments.length?(n=Zv(e),i):n},i.path=function(t){return arguments.length?(e=Zv(t),i):e},i}().id((e=>e.__id)).parentId((e=>e.__parent))(l)}const bx=e=>{let{propsArr:t,props:n,cube:i,cache:r,itemDepthObject:o,f:a}=e;for(let e=0;e<t.length;e++){const r=n[t[e]],s=r.fields?r.fields:[r];for(let e=0;e<s.length;e++){const t=s[e];if(t.field!==a){const e=gx(o,px(t.field,{cube:i}));t.accessor=e.nodeFn,t.valueAccessor=e.valueFn,t.attrAccessor=e.attrFn}}}};function wx(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;const r=t.raw(),o=t.key(),a="S"===r.qMode?xx(t):vx(r,n,e);if(!a)return null;const s=a.height,l=[];for(let o=0;o<=s;o++){let a=null;if(o>0)if("S"===r.qMode){let e=fx(r)[o-1];a=n.fields[e]}else{let e=r.qEffectiveInterColumnSortOrder[o-1];o>r.qEffectiveInterColumnSortOrder.length&&(e=r.qDimensionInfo.length),a=n.fields[e]}const{props:s,main:c}=i.normalizeConfig(Ev(Ev({},e),{},{field:a?a.key():void 0}),t),u=Object.keys(s);l[o]={propsArr:u,props:s,main:c};const h=a?px(a,{cube:r}):{fieldDepth:0};bx({propsArr:u,props:s,cube:r,cache:n,itemDepthObject:h,f:a})}const c=a.copy().descendants(),u=a.descendants();for(let e=0;e<u.length;e++){const t=l[u[e].depth].propsArr,n=l[u[e].depth].props,i=l[u[e].depth].main,r=c[e],a=r.data,s=mx(i,a,{key:o});yx({propsArr:t,props:n,item:r,itemData:a,ret:s,sourceKey:o}),u[e].data=s}return a}function kx(e,t,n,i){const r=Array.isArray(e)?e:[e];let o=[];for(let a=0;a<r.length;a++)if(void 0!==r[a].field){const s=t.raw(),l=t.key();if(!vx(s,n,e))continue;const c="object"==typeof r[a].field?r[a].field:t.field(r[a].field),{props:u,main:h}=i.normalizeConfig(r[a],t),d=Object.keys(u),f=px(c,{cube:s}),{nodeFn:p,attrFn:g,valueFn:m}=gx({fieldDepth:0},f);bx({propsArr:d,props:u,cube:s,cache:n,itemDepthObject:f,f:c});const y=!!r[a].trackBy,v=typeof r[a].trackBy,x={},b=[],w=p(n.tree),k=[];for(let e=0;e<w.length;e++){const t=w[e],n=g?g(m(t)):m(t);if(h.filter&&!h.filter(n))continue;const o=mx(h,n,{key:l});yx({propsArr:d,props:u,item:t,itemData:n,ret:o,sourceKey:l}),y&&i.track({cfg:r[a],itemData:n,obj:o,target:b,tracker:x,trackType:v}),k.push(o)}const _=y?i.collect(b,{main:h,propsArr:d,props:u}):k;o=[...o,..._]}return o}var _x,Mx,Sx=(_x=function(e){
|
12
12
|
/*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
|
13
13
|
e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,i,r,o,a,s,l,c,u,h,d=e.length,f=e.search(/[0-9\-\+#]/),p=f>0?e.substring(0,f):"",g=e.split("").reverse().join(""),m=g.search(/[0-9\-\+#]/),y=d-m,v=e.substring(y,y+1),x=y+("."===v||","===v?1:0),b=m>0?e.substring(x,d):"";if(n=(t="-"===(e=e.substring(f,x)).charAt(0)?-t:+t)<0?t=-t:0,r=(i=e.match(/[^\d\-\+#]/g))&&i[i.length-1]||".",o=i&&i[1]&&i[0]||",",e=e.split(r),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=s)&&(t=(+t).toFixed(s+1)),u=e[0].split(o),e[0]=u.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-a;)c[0]="0"+c[0];else 0==+c[0]&&(c[0]="");if((t=t.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(g="",y=(h=t[0]).length%l,d=h.length,x=0;x<d;x++)g+=h.charAt(x),!((x-y+1)%l)&&x<d-l&&(g+=o);t[0]=g}return t[1]=e[1]&&t[1]?r+t[1]:"","0"!==(i=t.join(""))&&""!==i||(n=!1),p+(n?"-":"")+i+b}},_x(Mx={exports:{}}),Mx.exports);function Rx(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const Cx={3:"k",6:"M",9:"G",12:"T",15:"P",18:"E",21:"Z",24:"Y","-3":"m","-6":"μ","-9":"n","-12":"p","-15":"f","-18":"a","-21":"z","-24":"y"},Nx=/%\)?$/,Dx=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,qx=/^\(oct\)/i,Ex=/^\(dec\)/i,Ox=/^\(hex\)/i,zx=/^\(bin\)/i,Ax=/^\(rom\)/i,Tx=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,Ix=/#|0/g;function jx(e,t,n,i){return e=e.toString(t),n[1]===n[1].toUpperCase()&&(e=e.toUpperCase()),e.length-e.indexOf(".")>10&&(e=e.slice(0,e.indexOf(".")+11)),e.replace(".",i||".")}function Px(e,t,n){const i=Rx(e);return n?i:new RegExp(i||"",t)}function Fx(e,t,n,i){let r,o,a,s,l,c,u,h,d,f=e.pattern;var p,g;i&&(e.abbreviate=!0),p=t,(g=n)&&(g=Rx(g)),p&&(p=Rx(p)),d=new RegExp("(?:[#0]+".concat(p,")?[#0]+(?:").concat(g,"[#0]+)?")),a=f.match(d),a=a?a[0]:"",s=a?f.substr(0,f.indexOf(a)):f,l=a?f.substring(f.indexOf(a)+a.length):"",a||(a=f?"#":"##########"),t&&t===n&&(r=a.split(n),o=r.pop(),a=r.join("")+n+o,t=""),c=t,t=/,/.test(n)?"¤":",",c&&(a=a.replace(Px(c,"g"),t)),u=n,n=".",u&&(a=a.replace(Px(u,"g"),n)),h=a.match(/#/g),h=h?h.length:0;const m=f.split(u);let y;m[1]&&(y=m[1].match(Ix)),e.prefix=s||"",e.postfix=l||"",e.pattern=f,e.maxPrecision=y?y.length:2,e.percentage=Nx.test(f),e.numericPattern=a||"",e.numericRegex=new RegExp("".concat(Px(t,null,!0),"|").concat(Px(n,null,!0)),"g"),e.groupTemp=c,e.decTemp=u,e.t=t,e.d=n,e.temp=h}class Lx{constructor(e,t,n,i,r){this.localeInfo=e,this.pattern=t,this.thousandDelimiter=n||",",this.decimalDelimiter=i||".",this.type=r||"numeric",this.patternSeparator=";",this.abbreviations=function(e,t){if(!e||!e.qNumericalAbbreviation)return Cx;const n={};return e.qNumericalAbbreviation.split(t).forEach((e=>{let t=e.split(":");2===t.length&&(n[t[0]]=t[1])})),n}(e,this.patternSeparator),this.prepare()}clone(){const e=new Lx(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return e.subtype=this.subtype,e}format(e,t,n,i){return this.prepare(t,n,i),this.formatValue(e)}prepare(e,t,n){let i;if(void 0===e&&(e=this.pattern),void 0===t&&(t=this.thousandDelimiter),void 0===n&&(n=this.decimalDelimiter),!e)return void(this._prepared={pattern:!1});this._prepared={positive:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},negative:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},zero:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""}},i=this._prepared,e=e.split(this.patternSeparator),i.positive.pattern=e[0],i.negative.pattern=e[1],i.zero.pattern=e[2],Tx.test(e[0])&&(i.positive.isFunctional=!0),e[1]?Tx.test(e[1])&&(i.negative.isFunctional=!0):i.negative=!1,e[2]?Tx.test(e[2])&&(i.zero.isFunctional=!0):i.zero=!1;const r="U"===this.type;i.positive.isFunctional||Fx(i.positive,t,n,r),i.negative&&!i.negative.isFunctional&&Fx(i.negative,t,n,r),i.zero&&!i.zero.isFunctional&&Fx(i.zero,t,n,r)}formatValue(e){let t,n,i,r,o,a,s,l,c,u=this._prepared,h="",d="",f=e;if(isNaN(e))return"".concat(f);if(e=+e,!1===u.pattern)return e.toString();if(0===e&&u.zero)return u=u.zero,u.pattern;if(e<0&&u.negative?(u=u.negative,e=-e):u=u.positive,o=u.d,a=u.t,u.isFunctional)e=function(e,t,n){let i;return Dx.test(t)?e=jx(e,Number(/\d{2}/.exec(t)[0]),t,n):qx.test(t)?e=jx(e,8,t,n):Ex.test(t)?e=jx(e,10,t,n):Ox.test(t)?e=jx(e,16,t,n):zx.test(t)?e=jx(e,2,t,n):Ax.test(t)&&(i="",e<0&&(i="-",e=-e),0===(e=Math.floor(e))?e="0":e<=5e5?(e=function(e,t){let n,i="",r=Number(String(e).slice(-3)),o=(e-r)/1e3,a=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),s=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();for(;r>0;)for(n=0;n<a.length;n++)if(a[n]<=r){i+=s[n],r-=a[n];break}for(n=0;n<o;n++)i="M".concat(i);return t[1]!==t[1].toUpperCase()&&(i=i.toLowerCase()),i}(e,t),e=i+e):e=t+i+e.toExponential(0)),e}(e,u.pattern,o);else{if(u.percentage&&(e*=100),u.abbreviate){const t=Object.keys(this.abbreviations).map((e=>parseInt(e,10))).sort(((e,t)=>e-t));let i,r,o=t[0];for(s=0,n=Number(Number(e).toExponential().split("e")[1]);o<=n&&s<t.length;)s++,o=t[s];s>0&&(i=t[s-1]),i&&n>0&&i>0?r=i:(n<0&&i<0||!i)&&(o<0&&o-n<=u.maxPrecision?r=o:i<=n&&!(o>0&&-n<=u.maxPrecision)&&(r=i)),r&&(h=this.abbreviations[r],e/=10**r)}if(i=Math.abs(e),t=u.temp,l=u.numericPattern,c=l.split(o)[1],"I"===this.type&&(e=Math.round(e)),r=e,c||"#"!==l.slice(-1)[0])if(i>=1e15||i>0&&i<=1e-14)e=i?i.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{const t=Number((e+1e-15*(e<0?-1:1)).toFixed(Math.min(20,c?c.length:0)).split(".")[0]);let n=l.split(o)[0];if(n+=o,e=Sx(n,t)||"0",c){const t=Math.max(0,Math.min(14,c.length)),n=c.replace(/#+$/,"").length;let r=("I"===this.type?0:i%1+1e-15).toFixed(t).slice(2).replace(/0+$/,"");for(s=r.length;s<n;s++)r+="0";r&&(e+=o+r)}else 0===t&&(r=0)}else if(i>=10**t||i<1||i<1e-4)0===e?e="0":i<1e-4||i>=1e20?(e=(e=r.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),d=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(i)/Math.log(10)))),s=0;s<t;s++)l+="#";e=Sx(l,e)}e=e.replace(u.numericRegex,(e=>e===a?u.groupTemp:e===o?u.decTemp:"")),r<0&&!/^-/.test(e)&&(e="-".concat(e))}return u.prefix+e+d+h+u.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function $x(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{size:n=5e3,multipleArguments:i=!1,toKey:r=e=>e}=t;let o,a,s=Object.create(null),l=Object.create(null),c=0,u=0;return o=i?function(){return a=r(...arguments),o.has(a)?o.get(a):o.set(a,e(...arguments))}:t=>(a=r(t),o.has(a)?o.get(a):o.set(a,e(t))),o.set=(e,t)=>(c>=n&&(delete s[l[u]],delete l[u],c--,u++),s[e]=t,l[c]=e,c++,t),o.get=e=>s[e],o.has=e=>e in s,o.clear=()=>{s=Object.create(null),l=Object.create(null),c=0,u=0},o.size=()=>c,o}function Bx(e,t,n,i,r){const o=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Lx(...t)}(r,e,t,n,i),a=$x(o.formatValue.bind(o),{toKey:e=>isNaN(e)?e:+e});function s(e){return a(e)}return s.format=function(e,t,n,i){return a.clear(),o.format(t,e,n,i)},s.pattern=function(e){return e&&(a.clear(),o.pattern=e,o.prepare()),o.pattern},s}const Hx="D",Wx="T",Vx="TS",Ux=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Yx=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Kx=["January","February","March","April","May","June","July","August","September","October","November","December"],Xx=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Gx(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function Jx(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}class Zx{constructor(e,t,n){const i=e||{};i.qCalendarStrings||(i.qCalendarStrings={qLongDayNames:Ux,qDayNames:Yx,qLongMonthNames:Kx,qMonthNames:Xx}),this.localeInfo=i,this.locale_days=i.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=i.qCalendarStrings.qDayNames.slice(),this.locale_months=i.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=i.qCalendarStrings.qMonthNames.slice(),t||(t={[Wx]:i.qTimeFmt||"hh:mm:ss",[Hx]:i.qDateFmt||"YYYY-MM-DD",[Vx]:i.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]),this.pattern=t}clone(){const e=new Zx(this.localeInfo,this.pattern);return e.subtype=this.subtype,e}format(e,t){t||(t=this.pattern?this.pattern:"YYYY-MM-DD hh:mm:ss"),t=t.replace(/\[.+]|\[|]/g,"");const n=/t+/gi.test(t);let i;e instanceof Date?i=function(e,t){let n=e.getUTCHours(),i=e.getUTCDay()-1;return t&&(n%=12,n||(n=12)),i<0&&(i=6),{year:e.getUTCFullYear(),month:e.getUTCMonth(),day:i,date:e.getUTCDate(),h:n,m:e.getUTCMinutes(),s:e.getUTCSeconds(),f:e.getUTCMilliseconds(),t:e.getUTCHours()>=12?"pm":"am"}}(e,n):(e<0&&(e=-e,t="-".concat(t)),i=function(e,t){let n,i=function(e){const t=e,n=24*Jx(t),i=60*Jx(n),r=60*Jx(i),o=1e3*Jx(r);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(i),s:Math.floor(r),f:Math.round(o)}}(e),r=i.d,o=i.h,a=i.m,s=i.s,l=i.f,c=0;/w+|t+/gi.test(t)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(86400*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*r),/h+/gi.test(t)||(a+=60*o),/m+/gi.test(t)||(s+=60*a),/w+/gi.test(t)&&(c=n?n.getDay()-1:0,c<0&&(c=6));let u="";return n&&(u=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:c,date:r,h:o,m:a,s:s,f:l,t:u}}(e,t));const r=(o=this,a=i,{"Y+|y+":{Y:"".concat(Number("".concat(a.year).slice(-2))),YY:Gx("".concat(a.year).slice(-2),2),YYY:Gx("".concat(a.year).slice(-3),3),def:e=>Gx("".concat(a.year),e.length)},"M+":{M:a.month+1,MM:Gx("".concat(a.month+1),2),MMM:o.locale_months_abbr[a.month],def:o.locale_months[a.month]},"W+|w+":{W:a.day,WW:Gx("".concat(a.day),2),WWW:o.locale_days_abbr[a.day],def:o.locale_days[a.day]},"D+|d+":{D:a.date,def:e=>Gx("".concat(a.date),e.length)},"h+|H+":{h:a.h,def:e=>Gx("".concat(a.h),e.length)},"m+":{m:a.m,def:e=>Gx("".concat(a.m),e.length)},"s+|S+":{s:a.s,def:e=>Gx("".concat(a.s),e.length)},"f+|F+":{def(e){let t="".concat(a.f),n=e.length-t.length;if(n>0)for(let e=0;e<n;e++)t+="0";else n<0&&(t=t.slice(0,e.length));return t}},"t{1,2}|T{1,2}":{def(e){let t=a.t;return e[0].toUpperCase()===e[0]&&(t=t.toUpperCase()),t=t.slice(0,e.length),t}}});var o,a;const s=[];for(const e in r)Object.prototype.hasOwnProperty.call(r,e)&&s.push(e);const l=new RegExp(s.join("|"),"g");return t.replace(l,(e=>{let t,n,i;for(n in r)if(Object.prototype.hasOwnProperty.call(r,n)&&(t=new RegExp(n),t.test(e)))break;if(!t)return"";for(const t in r[n])if(t===e||t.toLowerCase()===e){i=r[n][t],void 0===i&&(i=r[n][t.toLowerCase()]);break}return void 0===i&&(i=r[n].def),"function"==typeof i&&(i=i(e)),i}))}}function Qx(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Zx(...t)}function eb(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=Qx(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),i=$x(n.format.bind(n),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function r(e){return"IV"!==t?function(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(864e5*(e-Math.floor(e)))))}(e):e}function o(e){return e=r(e),i(e)}return o.format=function(e,t){return i.clear(),t=r(t),n.format(t,e)},o.locale=function(r){return n=Qx(r,e,t),i=$x(n.format.bind(n),{toKey:e=>"object"==typeof e?e.getTime():e}),this},o.qtype=function(e){return void 0!==e&&(t=e,i.clear()),t},o}function tb(){let e,{meta:t,id:n,key:i,localeInfo:r,fieldExtractor:o,value:a,type:s,sourceField:l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const c=a||("dimension"===s?e=>null==e?void 0:e.qElemNo:e=>null==e?void 0:e.qValue),u="dimension"===s?"first":"avg",h=function(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return eb(e.qNumFormat.qFmt,e.qNumFormat.qType,t);let n="#",i=t&&void 0!==t.qThousandSep?t.qThousandSep:",",r=t&&void 0!==t.qDecimalSep?t.qDecimalSep:".",o="U",a=e&&!!e.qIsAutoFormat;return e&&e.qNumFormat?(n=e.qNumFormat.qFmt||n,i=e.qNumFormat.qThou||i,r=e.qNumFormat.qDec||r,o=e.qNumFormat.qType||o,a=a&&-1===["M"].indexOf(e.qNumFormat.qType)):a=!0,(a||"U"===o)&&(n="#".concat(r,"##"),o="U"),Bx(n,i,r,o,t)}(t,r),d="dimension"===s?"first":(e,t)=>h(t),f={id:()=>n,key:()=>i,raw:()=>t,title:()=>t.qFallbackTitle||t.label,type:()=>s,origin:()=>l,items:()=>(e||(e=o(f)),e),min:()=>t.qMin,max:()=>t.qMax,value:c,label:e=>(null==e?void 0:e.qText)||"",reduce:u,reduceLabel:d,formatter:()=>h,tags:()=>t.qTags};return f}function nb(e,t,n,i,r){return(t[e]||[]).map(((t,o)=>{const a="".concat(i?"".concat(i,"/"):"").concat(e,"/").concat(o),s={instance:tb(Lv({id:"".concat(n?"".concat(n,"/"):"").concat(a),key:a,meta:t},r))};return s.attrDims=nb("qAttrDimInfo",t,n,a,Lv({},r,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),s.attrExps=nb("qAttrExprInfo",t,n,a,Lv({},r,{value:e=>null==e?void 0:e.qNum,type:"measure"})),s.measures=nb("qMeasureInfo",t,n,a,Lv({},r,{value:e=>null==e?void 0:e.qValue,type:"measure"})),s}))}function ib(){let{key:e,data:t,config:n={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},r=t;if(!r)throw new Error('Missing "data" input');if(!r.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const o=ib.util,a={cache:i,cube:r,localeInfo:n.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:n.virtualFields},s={key:()=>e,raw:()=>r,field:e=>function(e,t){let{cache:n}=t;if("number"==typeof e)return n.fields[e];const i=n.allFields;if("function"==typeof e){for(let t=0;t<i.length;t++)if(e(i[t]))return i[t];return!1}if("string"==typeof e){for(let t=0;t<i.length;t++)if(i[t].key()===e||i[t].title()===e)return i[t]}else if(e&&-1!==i.indexOf(e))return e;throw Error("Field not found: ".concat(e))}(e,a),fields:()=>i.fields.slice(),extract:e=>a.extractor(e,s,i,o),hierarchy:e=>a.hierarchy(e,s,i,o),_cache:()=>i};"K"===r.qMode||"T"===r.qMode||!r.qMode&&r.qNodesOnDim?(a.extractor=kx,a.hierarchy=wx,a.pages="K"===r.qMode?r.qStackedDataPages:r.qTreeDataPages):"S"===r.qMode?(a.extractor=Wv,a.pages=r.qDataPages,a.hierarchy=wx):a.extractor=()=>[],a.fieldExtractor=e=>a.extractor({field:e},s,i,o);const l="S"===r.qMode?e=>e.qElemNumber:void 0,c="S"===r.qMode?e=>e.qNum:void 0;i.wrappedFields.push(...nb("qDimensionInfo",r,e,"",Lv({},a,{value:l,type:"dimension"}))),i.wrappedFields.push(...nb("qMeasureInfo",r,e,"",Lv({},a,{value:c,type:"measure"}))),i.fields=i.wrappedFields.map((e=>e.instance));const u=e=>{e.forEach((e=>{i.allFields.push(e.instance),u(e.measures),u(e.attrDims),u(e.attrExps)}))};return u(i.wrappedFields),(n.virtualFields||[]).forEach((t=>{const n=s.field(t.from),r=tb(Ev({meta:n.raw(),id:"".concat(e,"/").concat(t.key),sourceField:n,fieldExtractor:e=>a.extractor({field:e},s,i,o),key:t.key,type:n.type(),localeInfo:a.localeInfo,value:n.value},t.override||{}));i.virtualFields.push(r)})),i.allFields.push(...i.virtualFields),s}const rb=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],ob=/\/qDimensionInfo(?:\/(\d+))?/,ab=/\/qMeasureInfo\/(\d+)/,sb=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,lb=/\/qAttrExprInfo\/(\d+)/,cb=/\/?qHyperCube/,ub=/\/?qTreeData/,hb=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),db=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function fb(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const i=t.byCells,r=t.primarySource,o=[],a={},s=e.isActive();let l=!1;return e.brushes().forEach((e=>{const t=function(e,t){let n=e,i=-1,r=-1,o="",a=e=>e;cb.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),a=hb):ub.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),a=db);let s=!0;if(ob.test(e)&&(i=+ob.exec(e)[1]),ab.test(e)&&(r=+ab.exec(e)[1]),sb.test(e)){r=-1,i=0;const e=+sb.exec(n)[2];isNaN(e)||(i=e,n=n.replace(/\/\d+$/,"")),s=!1}if(lb.test(e)){const e=r;if(t){r=0;const a=ax(o,t);r+=(a.qMeasureInfo||[]).length,i>-1?(r=a.qDimensionInfo.slice(0,i).reduce(((e,t)=>e+t.qAttrExprInfo.length),r),i=-1):(r=a.qDimensionInfo.reduce(((e,t)=>e+t.qAttrExprInfo.length),r),r=a.qMeasureInfo.slice(0,e).reduce(((e,t)=>e+t.qAttrExprInfo.length),r)),r+=+lb.exec(n)[1]}else i>-1?(i=-1,r=+lb.exec(n)[1]):r+=+lb.exec(n)[1]+1}return rb.forEach((e=>{let[t,i]=e;n=n.replace(t,i)})),s&&(n=a(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:r,dimensionIdx:i,path:n}}(e.id,n);if("range"===e.type&&t.measureIdx>-1&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.multiRangeSelectTreeDataValues||(a.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),n.forEach((e=>a.multiRangeSelectTreeDataValues.ranges.push({qMeasureIx:t.measureIdx,qDimensionIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}}))))}else{if("range"===e.type&&t.measureIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.rangeSelectHyperCubeValues||(a.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),n.forEach((e=>a.rangeSelectHyperCubeValues.ranges.push({qMeasureIx:t.measureIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}}))))}if("range"===e.type&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.selectHyperCubeContinuousRange||(a.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),n.forEach((e=>a.selectHyperCubeContinuousRange.ranges.push({qDimIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!1}}))))}if("value"===e.type&&t.dimensionIdx>-1)if(i)if(n&&n.qHyperCube&&("P"===n.qHyperCube.qMode||"T"===n.qHyperCube.qMode||"K"===n.qHyperCube.qMode)){const i=n.qHyperCube,o=i.qNoOfLeftDims,s=i.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(a.selectPivotCells||(a.selectPivotCells={path:t.path,cells:[]}),e.id===r||!r){const n=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e)));(0===o||s>=o)&&o>-1?n.forEach((e=>{a.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:s-o})})):n.forEach((e=>{a.selectPivotCells.cells.push({qType:"L",qCol:t.dimensionIdx,qRow:e})})),l=!!a.selectPivotCells.cells.length}}else a.selectHyperCubeCells||(a.selectHyperCubeCells={path:t.path,cols:[]}),a.selectHyperCubeCells.cols.push(t.dimensionIdx),e.id!==r&&(r||a.selectHyperCubeCells.values)||(a.selectHyperCubeCells.values=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e))),l=!!a.selectHyperCubeCells.values.length);else{const n=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e)));l=!!n.length,o.push({params:[t.path,t.dimensionIdx,n,!1],method:"selectHyperCubeValues"})}}})),!l&&s?[{method:"resetMadeSelections",params:[]}]:(a.rangeSelectHyperCubeValues&&o.push({method:"rangeSelectHyperCubeValues",params:[a.rangeSelectHyperCubeValues.path,a.rangeSelectHyperCubeValues.ranges,[],null===(c=t.orMode)||void 0===c||c]}),a.selectHyperCubeContinuousRange&&o.push({method:"selectHyperCubeContinuousRange",params:[a.selectHyperCubeContinuousRange.path,a.selectHyperCubeContinuousRange.ranges]}),a.selectHyperCubeCells&&o.push({method:"selectHyperCubeCells",params:[a.selectHyperCubeCells.path,a.selectHyperCubeCells.values,a.selectHyperCubeCells.cols]}),a.selectPivotCells&&o.push({method:"selectPivotCells",params:[a.selectPivotCells.path,a.selectPivotCells.cells]}),a.multiRangeSelectTreeDataValues&&o.push({method:"multiRangeSelectTreeDataValues",params:[a.multiRangeSelectTreeDataValues.path,a.multiRangeSelectTreeDataValues.ranges]}),o);var c}function pb(e){ib.util=e.data("matrix").util,e.data("q",ib),e.formatter("q-number",Bx),e.formatter("q-time",eb)}function gb(e){var t=Sv(e.layout||{},e.path.split("/").join("."));if(!t)return!1;var n=t.qIsOneAndOnlyOne;return void 0!==n&&n}function mb(e){var t=e.brush,n=e.colorField,i=e.legendAlias,r=e.useLegendCube,o=void 0!==r&&r;!n||/qAttrDimInfo/.test(n)?(t.removeKeyAlias("attrDim/qDimensionInfo/0"),i&&t.removeKeyAlias(i),t.addKeyAlias("attrDim/qDimensionInfo/0","qHyperCube/".concat(n))):o&&t.addKeyAlias(i,"qHyperCube/".concat(n))}pb.qBrushHelper=fb,pb.selections=fb;var yb="Shift";var vb=function(e,t){return t[e]?vb(e+1,t):e},xb=function(e,t){var n=t.reduce((function(e,t){return e[t]=!0,e}),{});return e.reduce((function(e,t,i){var r=vb(i,n);return n[r]=!0,e[i]=r,e}),{})};function bb(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.layout,n=e.filtered,i=void 0===n?{}:n,r=(null==t?void 0:t.qHyperCube)||{},o=r.qDimensionInfo,a=void 0===o?[]:o,s=r.qMeasureInfo,l=void 0===s?[]:s;return{dimensions:xb(a,i.dimensions||[]),measures:xb(l,i.measures||[])}}function wb(e){var t=e.selection,n=e.fieldMap,i=t.method,r=t.params;if("selectHyperCubeValues"===i){var o=n.dimensions[r[1]];void 0!==o&&(r[1]=o)}return"selectHyperCubeContinuousRange"===i&&r[1].forEach((function(e){var t=n.dimensions[e.qDimIx];void 0!==t&&(e.qDimIx=t)})),t}var kb=[],_b=0,Mb=function(e){var t=kb.filter((function(e){var t;return null===(t=e.selections)||void 0===t?void 0:t.isActive()}));t.length&&("Enter"===e.key?t.forEach((function(e){return e.selections.confirm()})):"Escape"!==e.key&&"Esc"!==e.key||t.forEach((function(e){return e.selections.cancel()})))};function Sb(e){var t=e.chart,n=e.document,i=e.selectionInfo,r=e.eventName,o=e.componentName,a=e.brushName,s=void 0===a?"selection":a,l=e.emit,c=void 0===l?"rangeClear":l,u=i.event===r,h=n.querySelector("[data-key='".concat(o,"-edge-0']"));if(u||!h)return!1;var d=t.component(o);return!!d&&(d.emit(c),"string"==typeof s&&t.brush(s).clear(),d)}var Rb=["chart","document","selections","selectionInfo"],Cb=function(e){e.chart,e.document,e.selections,e.selectionInfo;var t=xm(e,Rb);t.clearDiscrete(),t.clearContinuous(),t.clearMinor(),t.clearRange(),t.clearTap(),t.clearLegend()};function Nb(e){var t,n=e.lasso;null!=n&&null!==(t=n.active)&&void 0!==t&&t.call(n)&&(null==n||n.action(!1))}function Db(e){var t,n=e.chart,i=e.selectionInfo,r=e.selectionActions,o=e.actions,a=void 0===o?{}:o,s=e.selections,l=e.selectionEvents;if(!1===r||!1===l)return function(){};var c=r.reset,u=void 0===c?Nb:c,h=r.clear,d=!1!==h&&function(e){var t=e.clear,n=void 0===t?Cb:t,i=e.selections,r=e.selectionInfo,o=e.chart;return function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).cleared,t={selections:i,selectionInfo:r,chart:o,document:document,cleared:e};return n(vm({clearDiscrete:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var t=e.selectionInfo,n=e.chart,i=e.document,r=e.eventName,o=void 0===r?"discreteRange":r,a=e.componentName,s=void 0===a?"discrete-range-brush":a,l=e.cleared;return Sb({selectionInfo:t,chart:n,document:i,eventName:void 0!==l&&l?void 0:o,componentName:s,emit:"areaClear",brushName:e.brushName})}(vm(vm({},t),e))},clearContinuous:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var t=e.selectionInfo,n=e.chart,i=e.document,r=e.eventName,o=void 0===r?"continuousRange":r,a=e.componentName,s=void 0===a?"continuous-range-brush":a,l=e.cleared;return Sb({selectionInfo:t,chart:n,document:i,eventName:void 0!==l&&l?void 0:o,componentName:s,brushName:e.brushName})}(vm(vm({},t),e))},clearMinor:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var t=e.selectionInfo,n=e.chart,i=e.document,r=e.componentName,o=void 0===r?"minor-range-brush":r,a=e.eventName,s=void 0===a?"minorRange":a,l=e.cleared,c=void 0!==l&&l,u=e.brushName,h=Sb({selectionInfo:t,chart:n,document:i,eventName:c?void 0:s,componentName:o,brushName:void 0!==u&&u});if(h){var d=h.settings.settings,f=d.scale,p=d.brush,g=n.scale(f).data().fields.map((function(e){return e.id()})),m=n.brush(p),y=m.brushes().filter((function(e){return"range"===e.type&&g.some((function(t){return t===e.id}))}));m&&y.length&&y.forEach((function(e){m.removeRanges(e.brush.ranges().map((function(t){return{key:e.id,range:t}})))}))}}(vm(vm({},t),e))},clearRange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var t=e.selectionInfo,n=e.chart,i=e.document,r=e.selections,o=e.eventName,a=void 0===o?"xAxis":o,s=e.cleared;Sb({selectionInfo:t,chart:n,document:i,eventName:void 0!==s&&s?void 0:a,componentName:"".concat(a,"-range-brush"),emit:"areaClear",brushName:!1})&&r.clear()}(vm(vm({},t),e))},clearTap:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var t=e.chart,n=e.selectionInfo,i=e.selections,r=e.events,o=void 0===r?["tap"]:r,a=e.brushNames,s=void 0===a?[]:a;if(n&&o.includes(n.event)){var l=n.currentComponent;n.previousComponent!==l&&(i.clear(),s.forEach((function(e){return t.brush(e).end()})))}}(vm(vm({},t),e))},clearLegend:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var t=e.selectionInfo,n=e.chart,i=e.document,r=e.selections,o=e.eventName,a=void 0===o?"legendRange":o,s=e.componentName,l=void 0===s?"legend-range-brush":s,c=e.cleared,u=void 0!==c&&c,h=e.brushName;Sb({selectionInfo:t,chart:n,document:i,eventName:u?void 0:a,componentName:l,brushName:void 0!==h&&h})&&r.clear()}(vm(vm({},t),e))}},t))}}({clear:h,selections:s,selectionInfo:i,chart:n}),f=function(e){var t=e.chart,n=e.actions,i=e.reset,r=e.clear,o=!1,a={deactivated:function(e){var t=(n||{}).lasso;i({e:e,lasso:void 0!==t&&t})},canceled:function(e){var o=(n||{}).lasso;i({e:e,lasso:void 0!==o&&o}),r({e:e,chart:t,document:document})},cleared:function(e){o||(o=!0,r({e:e,chart:t,document:document,cleared:!0}),o=!1)}};return!1===i&&delete a.deactivated,!1===r&&delete a.cleared,!1===i&&!1===r&&delete a.canceled,a}({chart:n,clear:d,reset:u,actions:a}),p={};Object.entries(f).forEach((function(e){var t=km(e,2),n=t[0],i=t[1];p[n]=function(e,t){return t?function(n){return t({event:n,defaultFunc:e})}:e}(i,l[n])}));var g=function(e){var t=e.selectionEvents,n=e.selections,i=e.selectionInfo,r=e.clear,o=e.chart,a=e.document,s=t.start,l={selections:n,selectionInfo:i,chart:o,document:a},c=function(e){return Object.assign(i,e||{})},u=function(e){var t=e.event,n=e.components;return function(){return function(e){var t=e.selectionInfo,n=e.clear,i=e.event,r=e.components,o=void 0===r?[]:r;(0,e.setSelectionInfo)(vm(vm({},void 0===t?{}:t),{},{event:i,components:o.map((function(e){return e.key})).filter(Boolean)})),n()}({event:t,components:n,clear:r,selectionInfo:i,setSelectionInfo:c})}};return"function"==typeof s?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];s(vm(vm({defaultFunc:u({event:e,components:t}),setSelectionInfo:c,clear:r},l),{},{event:e,components:t}))}:function(e){u({event:e,components:arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]})()}}({selectionEvents:l,selections:s,selectionInfo:i,clear:d,chart:n,document:document});return null==a||null===(t=a.select)||void 0===t||t.on("start",g),Object.entries(p).forEach((function(e){var t=km(e,2),n=t[0],i=t[1];null==s||s.on(n,i)})),function(){var e;null==a||null===(e=a.select)||void 0===e||e.removeListener("start",g),Object.entries(p).forEach((function(e){var t=km(e,2),n=t[0],i=t[1];null==s||s.removeListener(n,i)}))}}var qb=[{key:"qHyperCube/qDimensionInfo/0:numeric",includeMax:!1}];function Eb(e){var t=e.chart,n=e.actions,i=e.selections,r=e.picassoQ,o=e.config,a=o.allowSimultaneous,s=void 0!==a&&a,l=o.majorScale,c=void 0===l?void 0:l,u=o.selectionActions,h=void 0===u?{}:u,d=h.clear,f=h.reset,p=o.selectionEvents,g=void 0===p?{deactivated:void 0,canceled:void 0,cleared:void 0,start:void 0}:p,m=o.brushEvents,y=void 0===m?{}:m,v=o.brushName,x=void 0===v?"selection":v,b=o.brushMaxListeners,w=void 0===b?20:b,k=o.brushRanges,_=void 0!==k&&k,M=o.interceptors,S=void 0===M?{}:M,R=o.selectionsFn,C=void 0===R?r.selections:R,N=t.brush(x);if("number"==typeof w&&N.setMaxListeners(w),_){var D=!0===_?qb:_;N.configure({ranges:D})}var q={canSelect:!0,getIsSelectionLocked:!1,isInnerDimensionLocked:!1,lockedDimensions:[],singleSelectIndex:0,selectionInfo:{colorField:void 0,components:[],event:void 0,currentComponent:void 0,previousComponent:void 0}},E=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.selections,i=t.brush,r=t.majorScale,o=t.actions,a=t.selectionsFn,s=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).path,l=void 0===s?"/qHyperCubeDef":s;if(!n)return{layout:function(){},filteredFields:function(){},allowSimultaneous:function(){},release:function(){}};var c=++_b,u=null,h={dimensions:[],measures:[]},d=[],f={};n.on=n.on.bind(n),n.isActive=n.isActive.bind(n),n.addListener=n.addListener.bind(n),n.removeListener=n.removeListener.bind(n);var p=function(e){var t=e.brush,n=e.getConfig;return{interceptor:function(e){var i=t.brushes(),r=n(),o=r.allowSimultaneous,a=r.layout,s=void 0===a?{}:a;i.forEach((function(n){var i,r,a;("range"===n.type||null!==(i=e[0])&&void 0!==i&&i.key&&(null===(r=e[0])||void 0===r?void 0:r.key)!==n.id&&0!==o.indexOf(null===(a=e[0])||void 0===a?void 0:a.key))&&t.clear([])}));var l=e.filter((function(e){return-2!==e.value}));if(l.length>1){var c=function(e){var t=e.layout,n=void 0===t?{}:t,i=e.values,r=void 0===i?[]:i;if(null==r||!r.length)return[];var o=Array.from(new Set(r.map((function(e){return e.key})))),a=[];return o.forEach((function(e){var t=gb({layout:n,path:e}),i=r.filter((function(t){return t.key===e})),o=t?[i.pop()]:i;a.push.apply(a,_m(o))})),a.filter(Boolean)}({layout:s,values:l});return c}return l},rangeInterceptor:function(e){var i=t.brushes(),r=n().allowSimultaneous;return i.filter((function(e){return"value"===e.type})).length?(t.clear([]),e):(i.forEach((function(n){var i=n.id===e[0].key||r.includes(n.id)&&r.includes(e[0].key);"range"!==n.type||i||t.clear([])})),e)}}}({brush:i,getConfig:function(){return{layout:u,allowSimultaneous:d}}}),g=p.rangeInterceptor,m=p.interceptor;i.intercept("set-ranges",g),i.intercept("toggle-ranges",g),i.intercept("toggle-values",m),i.intercept("set-values",m),i.intercept("add-values",m),i.on("start",(function(){return n.begin(l)}));var y={activate:function(){},deactivated:function(){return i.end()},cleared:function(){return i.clear()},canceled:function(){return i.end()}};!function(e,t){Object.keys(t).forEach((function(n){e.on(n,t[n])}))}(n,y);var v=null==r||null===(e=r.max)||void 0===e?void 0:e.call(r);return null!=o&&o.select?(o.select.on("start",(function(){var e;i.start(),"function"==typeof o.select.getBrushOptions&&(f=(e=o.select).getBrushOptions.apply(e,arguments))})),o.select.on("end",(function(){var e=a(i,f,u),t=bb({layout:u,filtered:h});e.forEach((function(e){var i=wb({selection:e,fieldMap:t});(function(e,t,n){if(t&&void 0!==n&&"selectHyperCubeContinuousRange"===e.method){var i=e.params;if(i&&i[1]&&i[1][0]){var r=i[1][0],o=r.qDimIx,a=r.qRange;"undefined"!==o&&a&&!1===a.qMaxInclEq&&a.qMax>=n&&(a.qMaxInclEq=!0)}}})(i,o.select.brushSelectionIncludeMax,v),n.select(i)}))}))):i.on("update",(function(){var e=a(i,f,u),t=bb({layout:u,filtered:h});e.forEach((function(e){n.select(wb({selection:e,fieldMap:t}))}))})),0===kb.length&&document.addEventListener("keyup",Mb),kb.push({key:c,selections:n}),{layout:function(e){u=e},filteredFields:function(e){h=e},allowSimultaneous:function(e){d=e},release:function(){u=null;var e=kb.indexOf(kb.filter((function(e){return e.key===c}))[0]);-1!==e&&kb.splice(e,1),kb.length||document.removeEventListener("keyup",Mb),function(e,t){Object.keys(t).forEach((function(n){e.removeListener(n,t[n])}))}(n,y)}}}({brush:N,majorScale:c,actions:n,selections:i,picassoQ:r,selectionsFn:C});!function(e){var t=e.brush,n=e.interceptors,i=void 0===n?{}:n;Object.entries(i).forEach((function(e){var n=km(e,2),i=n[0],r=n[1];(Array.isArray(r)?r:[r]).forEach((function(e){t.intercept(i,e)}))}))}({brush:N,interceptors:S});var O=function(e){var t=e.chart,n=e.selectionActions,i=e.brush,r=e.actions,o=e.selectionInfo,a=e.selections,s=e.selectionEvents,l=function(e){var t=e.brush,n=e.chart,i=e.selectionInfo,r=e.brushEvents,o=void 0===r?{}:r,a=Object.entries(o).map((function(e){var r=km(e,2),o=r[0],a=r[1],s=function(){return a({chart:n,selectionInfo:i})};return t.on(o,s),[o,s]}));return function(){a.forEach((function(e){var n=km(e,2),i=n[0],r=n[1];t.removeListener(i,r)}))}}({brush:i,chart:t,selectionInfo:o,brushEvents:e.brushEvents}),c=Db({chart:t,selectionInfo:o,selectionActions:n,actions:r,selections:a,selectionEvents:s}),u=function(e){var t=e.actions;if(null==t||!t.lasso)return function(){};var n=!1,i=function(e){n||e.key!==yb||(t.lasso.action(!0),n=!0)},r=function(e){e.key===yb&&(t.lasso.action(!1),n=!1)};return document.addEventListener("keydown",i),document.addEventListener("keyup",r),function(){document.removeEventListener("keydown",i),document.removeEventListener("keyup",r)}}({actions:r});return function(){l(),c(),u()}}({chart:t,brush:N,actions:n,selections:i,selectionInfo:q.selectionInfo,selectionActions:{clear:d,reset:f},selectionEvents:g,brushEvents:y});if(s){var z=!0===s?_m(Array(15)).map((function(e,t){return"qHyperCube/qMeasureInfo/".concat(t)})):s;E.allowSimultaneous(z)}return{unbindEvents:O,state:q,picassoSelections:E,brush:N}}var Ob=["colorField","useLegendCube"];function zb(e){var t=e.chart,n=e.selections,i=e.actions,r=void 0!==i&&i,o=e.config,a=void 0===o?{}:o,s=Eb({chart:t,actions:r,selections:n,picassoQ:pb,config:a}),l=s.unbindEvents,c=s.state,u=s.picassoSelections,h=s.brush,d=a.custom,f=void 0===d?{}:d,p=a.legendAlias,g=void 0===p?void 0:p,m=a.setBrushAliases,y=void 0===m?mb:m;return{getIsDimensionLocked:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return c.lockedDimensions[e]},getIsSelectionLocked:function(){var e,t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return null!==(e=null==n||null===(t=n.isLocked)||void 0===t?void 0:t.call(n))&&void 0!==e?e:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(null==e||!e.length)return!1;var t=e.filter((function(e){return"object"===Mm(e.data)&&Array.isArray(e.data.fields)})).every((function(e){return e.data.fields.every((function(e){var t=e.raw();return!(!t.qLocked&&t.qCardinal)}))}));return t}(i)},getIsSingleSelect:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:c.singleSelectIndex;return c.singleSelectDimensions[e]},getCanSelect:function(){return c.canSelect},getSelectionsObject:function(){return n},getSelectionInfo:function(){return c.selectionInfo},setLayout:function(e){var t=function(e){var t,n,i,r=e.selections,o=e.picassoSelections,a=e.layout,s={lockedDimensions:[],singleSelectDimensions:[]};null!=r&&null!==(t=r.isModal)&&void 0!==t&&t.call(r)&&r.confirm(),o.layout(a);var l=(null!==(n=null==a?void 0:a.qHyperCube)&&void 0!==n?n:{}).qDimensionInfo,c=void 0===l?[]:l;return s.lockedDimensions=c.map((function(e){return!!e.qLocked})),s.singleSelectDimensions=c.map((function(e,t){return gb({layout:a,path:"qHyperCube/qDimensionInfo/".concat(t)})})),s.singleSelectIndex=function(e){var t,n=((null==e?void 0:e.qHyperCube)||{}).qDimensionInfo,i=void 0===n?[]:n,r=i.map((function(e,t){var n;return!(e.qLocked||(null===(n=e.qCardinalities)||void 0===n?void 0:n.qHypercubeCardinal)<=1)&&t})).filter((function(e){return"number"==typeof e}));return null!==(t=r[0])&&void 0!==t?t:Math.max(i.length-1,0)}(a),s.canSelect=0===c.length||c.some((function(e){return!e.qLocked})),s.dimensionLocked=!(null===(i=c[0])||void 0===i||!i.qLocked),s}({selections:n,picassoSelections:u,layout:e});Object.assign(c,t)},setFilteredFields:function(e){u.filteredFields(e)},setBrushAliases:function(e){var t=e.colorField,n=e.useLegendCube,i=void 0!==n&&n,r=xm(e,Ob),o=vm({useLegendCube:i,colorField:t,brush:h,legendAlias:g},r);y(vm(vm({},o),{},{defaultFunc:function(){return mb(o)}}))},destroy:function(){l(),u.release()},custom:vm({},f)}}var Ab="'Source Sans Pro', 'Arial', 'sans-serif'",Tb="#333333",Ib="#595959",jb="#737373",Pb="#cccccc",Fb="#e6e6e6";function Lb(e){var t={};return[].concat(_m(e),_m([["","","color"],["object","","fontFamily"],["object","axis.label.name","color",Ib],["object","axis.label.name","fontFamily",Ab],["object","axis.label.name","fontSize","12px"],["object","axis.line.major","color",Pb],["object","axis.line.minor","color",Fb],["object","axis.title","color"],["object","axis.title","fontFamily",Ab],["object","axis.title","fontSize","13px"],["object","grid.line.highContrast","color",Fb],["object","grid.line.major","color",Pb],["object","grid.line.minor","color",Fb],["object","label.value","color",Ib],["object","label.value","fontFamily",Ab],["object","label.value","fontSize","12px"],[!1,"label.value","darkColor",Ib],[!1,"label.value","lightColor",Fb],["object","outOfRange","color","#999"],["object","legend.title","color",Tb],["object","legend.title","fontFamily",Ab],["object","legend.title","fontSize","15px"],["object","legend.label","color",Ib],["object","legend.label","fontFamily",Ab],["object","legend.label","fontSize","13px"],["object","referenceLine.label.name","color",Tb],["object","referenceLine.label.name","fontFamily",Ab],["object","referenceLine.label.name","fontSize","12px"],["object","referenceLine.outOfBounds","color",Fb],["object","referenceLine.outOfBounds","fontFamily",Ab],["object","referenceLine.outOfBounds","fontSize","12px"],["object","referenceLine.outOfBounds","backgroundColor",jb,function(e){return"transparent"===e?jb:e}]])).reduce((function(e,n){var i="".concat(n[0],"-").concat(n[1],"-").concat(n[2],"}");return t[i]||(t[i]=!0,e.push(n)),e}),[]).sort((function(e,t){return(e[0].split?e[0].split(".").length:0)-(t[0].split?t[0].split(".").length:0)}))}var $b=function(e){return e};function Bb(e){var t=e.theme,n=e.id,i=e.transform,r=e.extend,o=e.matrix,a={},s=i.reduce((function(e,t){var n=km(t,2),i=n[0],r=n[1];return e[i]=r,e}),{});return o.forEach((function(e){var i=km(e,5),r=i[0],o=i[1],l=i[2],c=i[3],u=i[4],h=void 0===u?function(e){return e}:u,d=function(e){var t=e.theme,n=e.base,i=e.path,r=e.attribute,o=e.defaultValue,a=void 0===o?void 0:o;if(!t||!1===n)return a;var s=t.getStyle(n,i,r);return void 0===s?a:s}({theme:t,base:"object"===r&&n?"".concat("object",".").concat(n):r,path:o,attribute:l,defaultValue:c}),f=(s["".concat(o,".").concat(l)]||$b)(h(d));Cv(a,[o,l].filter(Boolean).join("."),f)})),r.forEach((function(e){var t=km(e,2),n=t[0],i=t[1];Cv(a,n,i)})),a}function Hb(e,t,n){const i=`${e}.fontFamily`,r=`${e}.fontSize`;return{fontFamilyItem:{component:"dropdown",ref:i,options:()=>t.getOptions(i),defaultValue:()=>t.getDefaultValue(i)},fontWrapperItem:{component:"inline-wrapper",items:{fontSizeItem:{component:"dropdown",ref:r,options:()=>t.getOptions(r),defaultValue:()=>t.getDefaultValue(r)},fontColorItem:{component:"color-picker",width:!1,ref:`${e}.color`,defaultValue:()=>({color:n.getStyle("object.funnelChart",e,"color")})}}}}}function Wb(e,t,n){const i=function(e){var t=e.theme,n=e.translator,i=e.config,r=void 0===i?{}:i,o=e.flags,a=function(e){var t=e.config,n=void 0===t?{}:t,i=n.id,r=n.paths;return{id:void 0===i?"object":"".concat("object",".").concat(i),paths:Array.isArray(r)?r:[]}}({config:r}),s=a.id,l=a.paths,c={};l.forEach((function(e){for(var i=e.split("."),r=c,a=0;a<i.length;a++){var l=i[a];a===i.length-1?r[l]=Vm({theme:t,translator:n,id:s,path:e,flags:o}):void 0===r[l]&&(r[l]={}),r=r[l]}}));var u=function(e){for(var t=e.split("."),n=c,i=0;i<t.length;i++){var r=t[i];if(void 0===n[r])throw new Error("font-resolver: Path '".concat(e,"' could not be resolved."));n=n[r]}return n};return c.getDefaultValue=function(e){return u(e).getDefaultValue()},c.getOptions=function(e){return u(e).getOptions()},c}({theme:e,translator:n,flags:t,config:{id:"funnelChart",paths:["axis.title","axis.label.name","label.value"]}});return{component:"styling-panel",show:!0,chartType:"funnelchart",translation:"LayerStyleEditor.component.styling",chartTitle:"Object.FunnelChart",subtitle:"LayerStyleEditor.component.styling",useGeneral:!0,useBackground:!0,items:{axisTitleSection:{component:"panel-section",label:"Dimension title",items:{dimensionTitleItems:{component:"items",ref:"components",key:"axis",items:Hb("axis.title",i,e)}}},labelNameSection:{component:"panel-section",label:"Dimension value label",items:{dimensionTitleItems:{component:"items",ref:"components",key:"axis",items:Hb("axis.label.name",i,e)}}},labelValueSection:{component:"panel-section",label:"Value Label",items:{labelItems:{component:"items",ref:"components",key:"label",items:{...Hb("label.value",i,e),contrastColor:{component:"checkbox",type:"boolean",ref:"label.value.useContrastColor",translation:"properties.dataPoints.valuelabel.contrast",defaultValue:!0}}}}}}}}const Vb={uses:"sorting"},Ub=(e,t,n)=>{var i;const r=null==n||null===(i=n.sense)||void 0===i?void 0:i.theme;return{uses:"settings",items:{presentation:{type:"items",label:"Presentation",grouped:!0,items:{...(null==t?void 0:t.isEnabled("SENSECLIENT_IM_4897_VIZBUNDLE_STYLING"))&&{funnelStyling:Wb(r,t,e)},funnelmode:{ref:"funnel.mode",label:"Funnel Mode",type:"string",component:"dropdown",options:[{value:"AREA",label:"Area"},{value:"HEIGHT",label:"Height"},{value:"WIDTH",label:"Width"},{value:"ORDER",label:"Ordering"}],defaultValue:"WIDTH"},dimensionTitle:{ref:"showDimensionTitle",type:"boolean",component:"switch",label:"Dimension title",defaultValue:!0,options:[{value:!0,label:"Auto"},{value:!1,label:"Off"}]},valuesAuto:{ref:"dataPoint.auto",type:"boolean",label:"Value labels",component:"switch",defaultValue:!0,options:[{value:!0,label:"Auto"},{value:!1,label:"Custom"}]},labelMode:{ref:"dataPoint.labelMode",type:"string",component:"dropdown",options:[{value:"none",label:"None"},{value:"share",label:"Share"},{value:"value",label:"Values"}],defaultValue:"share",show:e=>!e.dataPoint.auto}}},colorsAndLegend:{uses:"colorsAndLegend",translation:"Colors",items:{colors:{items:{colorByLabel:{show:!1},expressionLabel:{show:!1}}},legend:{show:!1}}}}}},Yb={uses:"data",items:{dimensions:{uses:"dimensions",items:{others:{items:{suppressOther:{defaultValue:!0,show:!1}}}},disabledRef:""},measures:{uses:"measures",disabledRef:""}}};function Kb({translator:e,flags:t,anything:n}){return{type:"items",component:"accordion",items:{data:Yb,sorting:Vb,settings:Ub(e,t,n)}}}function Xb(e){return{definition:Kb(e),support:{export:!0,exportData:!0,snapshot:!0,viewData:!1},importProperties:null,exportProperties:null}}const Gb=[{path:"/qHyperCubeDef",dimensions:{min:1,max:1,description:()=>"Segments"},measures:{min:1,max:1,description(e){switch(e.funnel.mode){case"WIDTH":return"Width";case"AREA":return"Area";case"HEIGHT":return"Height";case"ORDER":return"Order";default:return""}},added(e,t){2===t.qHyperCubeDef.qInterColumnSortOrder.length&&1!==t.qHyperCubeDef.qInterColumnSortOrder[0]&&(t.qHyperCubeDef.qInterColumnSortOrder=[1,0])}}}];function Jb(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Zb=Object.prototype.hasOwnProperty,Qb=Object.prototype.toString,ew=Object.defineProperty,tw=Object.getOwnPropertyDescriptor,nw=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===Qb.call(e)},iw=function(e){if(!e||"[object Object]"!==Qb.call(e))return!1;var t,n=Zb.call(e,"constructor"),i=e.constructor&&e.constructor.prototype&&Zb.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!i)return!1;for(t in e);return void 0===t||Zb.call(e,t)},rw=function(e,t){ew&&"__proto__"===t.name?ew(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},ow=function(e,t){if("__proto__"===t){if(!Zb.call(e,t))return;if(tw)return tw(e,t).value}return e[t]},aw=function e(){var t,n,i,r,o,a,s=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof s&&(u=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)i=ow(s,n),s!==(r=ow(t,n))&&(u&&r&&(iw(r)||(o=nw(r)))?(o?(o=!1,a=i&&nw(i)?i:[]):a=i&&iw(i)?i:{},rw(s,{name:n,newValue:e(u,a,r)})):void 0!==r&&rw(s,{name:n,newValue:r}));return s},sw=Jb(aw),lw={dataRelatedPropertiesPaths:["qHyperCube.qGrandTotalRow","qHyperCube.qHasOtherValues","qHyperCube.qSize","qHyperCube.qDimensionInfo[].qAttrDimInfo","qHyperCube.qDimensionInfo[].qAttrExprInfo","qHyperCube.qDimensionInfo[].qCardinalities","qHyperCube.qDimensionInfo[].qMax","qHyperCube.qDimensionInfo[].qMin","qHyperCube.qDimensionInfo[].qStateCounts","qHyperCube.qMeasureInfo[].qApprMaxGlyphCount","qHyperCube.qMeasureInfo[].qAttrExprInfo","qHyperCube.qMeasureInfo[].qMax","qHyperCube.qMeasureInfo[].qMin","qHyperCube.qMeasureInfo[].qTrendLines","qHyperCube.qTreeNodesOnDim","qSelectionInfo"]};function cw(e){const{qHyperCube:t,...n}=e,{qAxisData:i,qDataPages:r,qStackedDataPages:o,qTreeDataPages:a,...s}=t,l=sw(!0,{},{...n,qHyperCube:{...s,qAxisData:null,qDataPages:null,qStackedDataPages:null,qTreeDataPages:null}}),{dataRelatedPropertiesPaths:c}=lw;return c.forEach((e=>{const t=e.split("[");if(1===t.length)void 0!==Sv(l,e)&&Cv(l,e,null);else{const e=t[0],n=t[1].split("].")[1];Sv(l,e,[]).forEach((e=>{void 0!==Sv(e,n)&&Cv(e,n,null)}))}})),l}var uw={axes:{trackBy:function({isTime:e,isContinuous:t,isMeasure:n,isMajor:i}){return r=>{if(e||t||n){var o;if("line"===r.type)return null!==(o=r.tickValue)&&void 0!==o?o:"axis";if("text"===r.type)return`${r.tickValue} ${r.text}`;if("container"===r.type){const e=r.children.filter((e=>"text"===e.type)).map((e=>e.text));return`${r.data.value} ${e.join("")}`}return Math.random()}if(i){if("line"===r.type&&void 0===r.tickValue)return"axis";const e=r.transform&&r.transform.match(/rotate/gi)?"rotated":"horizontal";return`${r.data.group?`${r.data.group.value} `:""}${r.data.value} ${r.text} ${e}`}return Math.random()}},compensateForLayoutChanges:function({isMeasure:e,isTime:t,isContinuous:n,isHorizontal:i,dock:r}){return({currentNodes:o,currentRect:a,previousRect:s})=>{const l=a.x-s.x,c=a.y-s.y,u=a.width-s.width,h=a.height-s.height;e?("left"===r&&o.forEach((e=>{"line"===e.type?(e.x1+=u,e.x2+=u):"text"===e.type&&(e.x+=u)})),"left"!==r&&"right"!==r||o.forEach((e=>{var t;("line"===e.type&&(e.x1===e.x2?(e.y1=a.y,e.y2=e.y1+a.height):(Math.round(e.y1)<a.y||e.y1>a.y+a.height)&&(e.strokeWidth=0)),"text"===e.type)&&((e.y<a.y||e.y>a.y+a.height)&&(e.fontSize="1px","#"===(null===(t=e.fill)||void 0===t?void 0:t[0])&&(e.fill=`${e.fill.slice(0,1)}00${e.fill.slice(1)}`)))})),"top"!==r&&"bottom"!==r||o.forEach((e=>{var t;("line"===e.type&&(e.y1===e.y2?(e.x1=a.x,e.x2=e.x1+a.width):(Math.round(e.x1)<a.x||e.x1>a.x+a.width)&&(e.strokeWidth=0)),"text"===e.type)&&((e.x<a.x||e.x>a.x+a.width)&&(e.fontSize="1px","#"===(null===(t=e.fill)||void 0===t?void 0:t[0])&&(e.fill=`${e.fill.slice(0,1)}00${e.fill.slice(1)}`)))}))):t?o.forEach((e=>{"line"===e.type?e.y1===e.y2?e.x2+=u:e.x1===e.x2&&(e.x1-=l,e.x2-=l):"text"===e.type&&(e.x-=l)})):n||i?o.forEach((e=>{"line"===e.type&&e.y1===e.y2&&(e.x1+=l,e.x2+=l+u)})):o.forEach((e=>{"line"===e.type&&e.x1===e.x2&&(e.y1+=c,e.y2+=c+h)}))}}},bars:{trackBy:function(e){return e.data.typeIndex?`${e.data.value} ${e.data.typeIndex.value}`:e.data.measureIndex?`${e.data.value} ${e.data.measureIndex.value}`:e.data.group?`${e.data.value} ${e.data.group.value}`:e.data.stack?`${e.data.value} ${e.data.stack.value}`:`${e.data.value}`},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const i=t.x-n.x,r=t.y-n.y;0===i&&0===r||e.forEach((e=>{e.children&&e.children.length>0&&e.children.forEach((e=>{void 0!==e.x&&void 0!==e.y?(e.x-=i,e.y-=r):e.transform=`translate(${-i}, ${-r})`}))}))}},barOobs:{compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const i=t.x-n.x;0===t.y-n.y&&0===i||e.forEach((e=>{e.children&&e.children.length>0&&e.children.forEach((e=>{e.opacity=0}))}))}},labels:{trackBy:function(e){if("rect"===e.type)return"-3"===e.data?Math.random():`${e.type} ${e.data} ${e.rotation}`;const t=e.transform&&e.transform.match(/rotate/gi)?"rotated":"horizontal";return`${e.type} ${e.data} ${e.text} ${t}`},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const i=t.x-n.x,r=t.y-n.y;0===i&&0===r||e.forEach((e=>{e.transform&&e.transform.match(/rotate\(-90/gi)?(e.x+=r,e.y-=i):(e.x-=i,e.y-=r)}))},linkData:function(e){return e.data.measureIndex?`${e.data.value} ${e.data.measureIndex.value}`:e.data.group?`${e.data.value} ${e.data.group.value}`:e.data.stack?`${e.data.value} ${e.data.stack.value}`:`${e.data.value}`}},lines:{trackBy:function(e){var t;return"line"===e.type?null!==(t=e.value)&&void 0!==t?t:Math.random():"path"===e.type?`${e.generatorType} ${e.layerObj.id} ${e.data.source.key}`:Math.random()},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const i=t.x-n.x,r=t.y-n.y;e.forEach((e=>{if(void 0!==e.x1&&void 0!==e.y1)e.y1===e.y2?(e.x2=e.x1+t.width,e.y1-=r,e.y2-=r):e.x1===e.x2&&(e.y2=e.y1+t.height,e.x1-=i,e.x2-=i);else{const t="x"===e.major.p?i/e.major.size:r/e.major.size,n="y"===e.minor.p?r/e.minor.size:i/e.minor.size;e.points.forEach((e=>{e.modified||(e.major-=t,e.minor-=n,e.minor0-=n,e.modified=!0)}))}}))}},lineOobs:{compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const i=t.x-n.x;0===t.y-n.y&&0===i||e.forEach((e=>{e.opacity=0}))}},markers:{trackBy:function(e){return e.data.line?`${e.data.line.value} ${e.data.major.value}`:`${e.data.major.value}`},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const i=t.x-n.x,r=t.y-n.y;0===i&&0===r||e.forEach((e=>{switch(e.type){case"circle":e.cx-=i,e.cy-=r;break;case"rect":e.x-=i,e.y-=r;break;case"path":e.transform=`translate(${-i}, ${-r})`}}))}},points:{trackBy:function(e){return e.data.line?`${e.data.line.value} ${e.data.major.value}`:`${e.data.major.value}`},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const i=t.x-n.x,r=t.y-n.y;0===i&&0===r||e.forEach((e=>{e.cx-=i,e.cy-=r}))}},refLineLabels:{trackBy:function(e){if(void 0!==e.value){if("rect"===e.type)return`${e.value}`;if("text"===e.type)return`${e.value} ${e.text}`}return Math.random()},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const i=t.x-n.x,r=t.y-n.y,o=t.width-n.width,a=t.height-n.height;let s=-i,l=-r;e.forEach((e=>{switch(e.dock){case"right":i>0&&(s=t.width);break;case"left":o<0&&(s=-n.width);break;case"top":a<0&&(l=-n.height);break;case"bottom":r>0&&(l=t.height)}switch(e.type){case"text":case"rect":e.x+=s,e.y+=l;break;case"circle":e.cx+=s,e.cy+=l;break;case"path":e.transform=`translate(${s}, ${l})`}}))}},shadowBars:{trackBy:function(){return Math.random()}},cacheProperties:function({viewCache:e,layout:t}){const n=cw(t);e.set("dataIndependentProperties",JSON.stringify(n))},propertiesHaveChanged:function({viewCache:e,layout:t}){const n=cw(t);return e.get("dataIndependentProperties")!==JSON.stringify(n)},nonUpdatingNode:{trackBy:function(){return Math.random()}}};function hw(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function dw(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function fw(){}[["FULL",{width:550,height:450}],["MEDIUM",{width:400,height:220}],["SMALL",{width:300,height:150}],["XSMALL",{width:150,height:75}],["SPARK",{width:0,height:0}]].forEach((([e,{width:t,height:n}])=>{}));var pw=.7,gw=1/pw,mw="\\s*([+-]?\\d+)\\s*",yw="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",vw="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",xw=/^#([0-9a-f]{3,8})$/,bw=new RegExp(`^rgb\\(${mw},${mw},${mw}\\)$`),ww=new RegExp(`^rgb\\(${vw},${vw},${vw}\\)$`),kw=new RegExp(`^rgba\\(${mw},${mw},${mw},${yw}\\)$`),_w=new RegExp(`^rgba\\(${vw},${vw},${vw},${yw}\\)$`),Mw=new RegExp(`^hsl\\(${yw},${vw},${vw}\\)$`),Sw=new RegExp(`^hsla\\(${yw},${vw},${vw},${yw}\\)$`),Rw={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Cw(){return this.rgb().formatHex()}function Nw(){return this.rgb().formatRgb()}function Dw(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=xw.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?qw(t):3===n?new zw(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Ew(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Ew(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=bw.exec(e))?new zw(t[1],t[2],t[3],1):(t=ww.exec(e))?new zw(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=kw.exec(e))?Ew(t[1],t[2],t[3],t[4]):(t=_w.exec(e))?Ew(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Mw.exec(e))?Fw(t[1],t[2]/100,t[3]/100,1):(t=Sw.exec(e))?Fw(t[1],t[2]/100,t[3]/100,t[4]):Rw.hasOwnProperty(e)?qw(Rw[e]):"transparent"===e?new zw(NaN,NaN,NaN,0):null}function qw(e){return new zw(e>>16&255,e>>8&255,255&e,1)}function Ew(e,t,n,i){return i<=0&&(e=t=n=NaN),new zw(e,t,n,i)}function Ow(e){return e instanceof fw||(e=Dw(e)),e?new zw((e=e.rgb()).r,e.g,e.b,e.opacity):new zw}function zw(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}function Aw(){return`#${Pw(this.r)}${Pw(this.g)}${Pw(this.b)}`}function Tw(){const e=Iw(this.opacity);return`${1===e?"rgb(":"rgba("}${jw(this.r)}, ${jw(this.g)}, ${jw(this.b)}${1===e?")":`, ${e})`}`}function Iw(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function jw(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Pw(e){return((e=jw(e))<16?"0":"")+e.toString(16)}function Fw(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new $w(e,t,n,i)}function Lw(e){if(e instanceof $w)return new $w(e.h,e.s,e.l,e.opacity);if(e instanceof fw||(e=Dw(e)),!e)return new $w;if(e instanceof $w)return e;var t=(e=e.rgb()).r/255,n=e.g/255,i=e.b/255,r=Math.min(t,n,i),o=Math.max(t,n,i),a=NaN,s=o-r,l=(o+r)/2;return s?(a=t===o?(n-i)/s+6*(n<i):n===o?(i-t)/s+2:(t-n)/s+4,s/=l<.5?o+r:2-o-r,a*=60):s=l>0&&l<1?0:a,new $w(a,s,l,e.opacity)}function $w(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}function Bw(e){return(e=(e||0)%360)<0?e+360:e}function Hw(e){return Math.max(0,Math.min(1,e||0))}function Ww(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}hw(fw,Dw,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Cw,formatHex:Cw,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Lw(this).formatHsl()},formatRgb:Nw,toString:Nw}),hw(zw,(function(e,t,n,i){return 1===arguments.length?Ow(e):new zw(e,t,n,null==i?1:i)}),dw(fw,{brighter(e){return e=null==e?gw:Math.pow(gw,e),new zw(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?pw:Math.pow(pw,e),new zw(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new zw(jw(this.r),jw(this.g),jw(this.b),Iw(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Aw,formatHex:Aw,formatHex8:function(){return`#${Pw(this.r)}${Pw(this.g)}${Pw(this.b)}${Pw(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Tw,toString:Tw})),hw($w,(function(e,t,n,i){return 1===arguments.length?Lw(e):new $w(e,t,n,null==i?1:i)}),dw(fw,{brighter(e){return e=null==e?gw:Math.pow(gw,e),new $w(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?pw:Math.pow(pw,e),new $w(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*t,r=2*n-i;return new zw(Ww(e>=240?e-240:e+120,r,i),Ww(e,r,i),Ww(e<120?e+240:e-120,r,i),this.opacity)},clamp(){return new $w(Bw(this.h),Hw(this.s),Hw(this.l),Iw(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Iw(this.opacity);return`${1===e?"hsl(":"hsla("}${Bw(this.h)}, ${100*Hw(this.s)}%, ${100*Hw(this.l)}%${1===e?")":`, ${e})`}`}}));const Vw=Math.PI/180,Uw=180/Math.PI,Yw=.96422,Kw=.82521,Xw=4/29,Gw=6/29,Jw=3*Gw*Gw,Zw=Gw*Gw*Gw;function Qw(e){if(e instanceof ek)return new ek(e.l,e.a,e.b,e.opacity);if(e instanceof ak)return sk(e);e instanceof zw||(e=Ow(e));var t,n,i=rk(e.r),r=rk(e.g),o=rk(e.b),a=tk((.2225045*i+.7168786*r+.0606169*o)/1);return i===r&&r===o?t=n=a:(t=tk((.4360747*i+.3850649*r+.1430804*o)/Yw),n=tk((.0139322*i+.0971045*r+.7141733*o)/Kw)),new ek(116*a-16,500*(t-a),200*(a-n),e.opacity)}function ek(e,t,n,i){this.l=+e,this.a=+t,this.b=+n,this.opacity=+i}function tk(e){return e>Zw?Math.pow(e,1/3):e/Jw+Xw}function nk(e){return e>Gw?e*e*e:Jw*(e-Xw)}function ik(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function rk(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function ok(e,t,n,i){return 1===arguments.length?function(e){if(e instanceof ak)return new ak(e.h,e.c,e.l,e.opacity);if(e instanceof ek||(e=Qw(e)),0===e.a&&0===e.b)return new ak(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Uw;return new ak(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new ak(e,t,n,null==i?1:i)}function ak(e,t,n,i){this.h=+e,this.c=+t,this.l=+n,this.opacity=+i}function sk(e){if(isNaN(e.h))return new ek(e.l,0,0,e.opacity);var t=e.h*Vw;return new ek(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}hw(ek,(function(e,t,n,i){return 1===arguments.length?Qw(e):new ek(e,t,n,null==i?1:i)}),dw(fw,{brighter(e){return new ek(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new ek(this.l-18*(null==e?1:e),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return new zw(ik(3.1338561*(t=Yw*nk(t))-1.6168667*(e=1*nk(e))-.4906146*(n=Kw*nk(n))),ik(-.9787684*t+1.9161415*e+.033454*n),ik(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),hw(ak,ok,dw(fw,{brighter(e){return new ak(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new ak(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return sk(this).rgb()}}));var lk,ck={isDark:function(e){return ok(e).l<70}};function uk(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}1===(lk=uk).length&&(lk=function(e){return function(t,n){return uk(e(t),n)}}(lk));var hk="$";function dk(){}function fk(e,t){var n=new dk;if(e instanceof dk)e.each((function(e,t){n.set(t,e)}));else if(Array.isArray(e)){var i,r=-1,o=e.length;if(null==t)for(;++r<o;)n.set(r,e[r]);else for(;++r<o;)n.set(t(i=e[r],r,e),i)}else if(e)for(var a in e)n.set(a,e[a]);return n}function pk(){}dk.prototype=fk.prototype={constructor:dk,has:function(e){return hk+e in this},get:function(e){return this[hk+e]},set:function(e,t){return this[hk+e]=t,this},remove:function(e){var t=hk+e;return t in this&&delete this[t]},clear:function(){for(var e in this)e[0]===hk&&delete this[e]},keys:function(){var e=[];for(var t in this)t[0]===hk&&e.push(t.slice(1));return e},values:function(){var e=[];for(var t in this)t[0]===hk&&e.push(this[t]);return e},entries:function(){var e=[];for(var t in this)t[0]===hk&&e.push({key:t.slice(1),value:this[t]});return e},size:function(){var e=0;for(var t in this)t[0]===hk&&++e;return e},empty:function(){for(var e in this)if(e[0]===hk)return!1;return!0},each:function(e){for(var t in this)t[0]===hk&&e(this[t],t.slice(1),this)}};var gk=fk.prototype;pk.prototype={constructor:pk,has:gk.has,add:function(e){return this[hk+(e+="")]=e,this},remove:gk.remove,clear:gk.clear,values:gk.keys,size:gk.size,empty:gk.empty,each:gk.each},sw.bind(null,!0);const mk=[[2,4,6],[2,4],[3]],yk=[,[,,[[1,2]],[[1,2,3],[1,3]],[[1,2,4],[1,4]],[[1,2,4],[1,5]],[[1,2,4,6],[2,4,6],[1,3,6],[1,6]],[[1,2,4,6],[2,4,6],[1,3,6],[1,7]],[[1,2,4,8],[2,4,8],[1,8]],[[1,2,4,8],[2,4,8],[1,3,9],[1,9]],[[1,2,4,6,10],[1,2,4,10],[1,3,10],[3,10],[1,10]]],[,,,[[2,3]],[[2,3,4],[2,4]],[[2,3,4],[2,4],[2,5]],[[2,4,6],[2,6]],[[2,4,6],[2,6],[2,7]],[[2,4,8],[2,8]],[[2,4,8],[2,8],[2,9]],[[2,4,6,10],[2,4,10],[5,10],[3,10]]],[,,,,[[3,4]],[[3,4,5],[3,5]],[[3,4,5,6],[3,6]],[[3,4,5,6],[3,5,7],[3,7]],[[3,4,5,6,8],[3,5,7],[4,8],[3,8]],[[3,4,5,6,8],[3,4,6,9],[3,4,6,8],[3,6,9],[4,8],[3,9]],[[4,6,10],[5,10],[3,10]]],[,,,,,[[4,5]],[[4,5,6],[4,6]],[[4,5,6,7],[4,5,6],[4,6]],[[4,5,6,7,8],[4,5,6,7],[4,6,8],[4,8]],[[4,5,6,7,8],[4,6,9],[4,6,8],[4,8]],[[4,6,10],[5,7,9],[5,10],[4,10]]],[,,,,,,[[5,6]],[[5,6,7],[5,7]],[[5,6,7,8],[5,6,7],[6,8]],[[5,6,7,8,9],[5,6,7,8],[5,7,9],[5,9]],[[6,8,10],[5,10]]],[,,,,,,,[[6,7]],[[6,7,8],[6,8]],[[6,7,8,9],[6,7,8],[6,9]],[[6,7,8,9,10],[6,8,10],[6,10]]],[,,,,,,,,[[7,8]],[[7,8,9],[7,9]],[[7,8,9,10],[8,10],[7,10],[7,9]]],[,,,,,,,,,[[8,9]],[[8,9,10],[8,10]]],[,,,,,,,,,,[[9,10]]]];function vk(e,t,n){const i=e?e.length:0;let r,o=void 0===t?Number.MAX_VALUE:e[0]/t;for(r=1;r<i;r++)o=Math.min(o,e[r]/e[r-1]);void 0!==n&&(o=Math.min(o,n/e[i-1])),e.splice(0,0,o)}function xk(e,t,n){let i;const r=e?e.length:0;for(i=0;i<r;i++)vk(e[i],t,n)}function bk(e,t=!1){const n=t?"IM_5791_SVG_LABEL_RENDERING":"IM_4962_SVG_CHART_LABELS";if(null!=e&&e.isEnabled(n))return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?void 0:"svg"}function wk(e){const t=e.node.desc&&e.node.desc.share;return t?e.formatter("share")(t):""}function kk(e){return e.formatter("num")(e.node.data.num.value)}function _k({data:e}){return e?e.label:""}function Mk(e){if(e.dataPoint.auto)return wk;switch(e.dataPoint.labelMode){case"share":default:return wk;case"value":return kk;case"none":return null}}function Sk(e,t,n,i,r){const o=r.axis.label.getStyle(),a=r.label.value.getStyle(),s=n.getStyles().label.value;return{type:"labels",key:"funnel-labels",renderer:bk(e,!0),layout:{displayOrder:2},settings:{sources:[{component:"fun",selector:".labelLeft",strategy:{type:"rows",settings:{align:0,fill:o.fill,fontSize:parseInt(o.fontSize,10),fontFamily:o.fontFamily,labels:[{label:_k}],linkData:e=>`${e.data.value} ${_k(e)}`}}},{component:"fun",selector:".labelCenter",strategy:{type:"rows",settings:{align:.5,fill:a.useContrastColor?({node:e})=>(e=>ck.isDark(e.desc.fill)?s.lightColor:s.darkColor)(e):a.fill,fontSize:parseInt(a.fontSize,10),fontFamily:a.fontFamily,labels:[{label:Mk(t)}],linkData:e=>"none"===t.dataPoint.labelMode?Math.random():`${e.data.value} ${Mk(t)(e)}`}}}]},animations:{enabled:i,trackBy:e=>e.data}}}function Rk(e,t,n){if(!t.showDimensionTitle||!t.qHyperCube.qDimensionInfo[0].qFallbackTitle)return!1;const i=t.qHyperCube.qDimensionInfo[0].qFallbackTitle,r=n.axis.title.getStyle();return{type:"text",key:"dimension-title",renderer:bk(e,!0),text:i,layout:{dock:"top"},style:{text:{fill:r.fill,fontSize:r.fontSize,fontFamily:r.fontFamily}}}}function Ck({picasso:t,flags:n}){const i=e.useStaleLayout(),r=e.useTheme(),o=e.useConstraints(),a=e.useRect(),s=e.usePlugins(),l=e.useAppLayout().qLocaleInfo,[c,u,h,d]=function({picasso:t}){const n=e.useElement(),i=e.useSelections(),r=e.useModel(),o=e.useApp(),a=e.useTranslator(),s=e.useOptions(),[l,c]=e.useState(),[u,h]=e.useState(),[d,f]=e.useState(),[p,g]=e.useState();return e.useEffect((()=>{const e=kv({picasso:t,model:r,app:o,translator:a,config:{auto:!1,key:"fill"}});n.style.overflow="hidden";const l=t({renderer:{prio:[s.renderer||"svg"]}}).chart({element:n,data:[],settings:{}}),u=zb({chart:l,selections:i,config:{selectionActions:!1}});return f(u),h(e),c(l),g(function(){var e={};return{get:function(t){return e[t]},set:function(t,n){return e[t]=n,n},has:function(t){return t in e},remove:function(t){delete e[t]},empty:function(){e={}}}}()),()=>{u.destroy(),l.destroy()}}),[]),[l,u,d,p]}({picasso:t}),f=e.useOptions(),p=()=>{const e=c.element.clientWidth!==d.get("width")||c.element.clientHeight!==d.get("height");return!1!==f.chartAnimations&&!e&&!uw.propertiesHaveChanged({viewCache:d,layout:i})},[g]=e.usePromise((()=>{if(!u)return Promise.resolve();const e=function(e){return{layout:e,keys:{SCALE:{FILL:"fill"},COMPONENT:{FUNNEL:"fun",FUNNEL_LABELS:"funnel-labels",DIMENSION_TITLE:"dimension-title"}}}}(i),n=function(e){var t=e.picassoInstance,n=e.plugins,i=e.pluginArgs,r=void 0===i?{}:i,o={initialized:!1,definitions:[]};return{initialize:function(){return gm(bm().m((function e(){var i,a,s,l;return bm().w((function(e){for(;;)switch(e.n){case 0:if(!o.initialized){e.n=1;break}return e.a(2);case 1:return a=Promise.all(n.filter((function(e){return"custom-component"===e.info.type})).map(function(){var e=gm(bm().m((function e(n){var i;return bm().w((function(e){for(;;)switch(e.n){case 0:if(n.info.componentName){e.n=1;break}throw new Error("plugin-service: Custom component is missing componentName");case 1:return e.n=2,n.fn(vm({},r));case 2:if("object"===Mm(i=e.v)){e.n=3;break}throw new Error("plugin-service: Custom component needs to be an object");case 3:t.component(n.info.componentName,i);case 4:return e.a(2)}}),e)})));return function(t){return e.apply(this,arguments)}}())),s=Promise.all(n.filter((function(e){return"component-definition"===e.info.type})).map((function(e){return e.fn(vm({},r))}))),e.n=2,Promise.all([a,s]);case 2:l=e.v,o.initialized=!0,(i=o.definitions).push.apply(i,_m(l[1]));case 3:return e.a(2)}}),e)})))()},extendComponents:function(e){return o.initialized?(o.definitions.filter(Boolean).forEach((function(t){var n=km(e.filter((function(e){return e.key&&e.key===t.key})),1)[0];if(n){var i=Km(!0,{},n.brush);Km(!0,n,t),t.brush&&(n.brush=function(e,t){return"object"===Mm(e)&&Object.keys(e).length?(Array.isArray(t.consume)&&(e.consume=Nv({originalArray:e.consume,newArray:t.consume,matchKey:"context"})),Array.isArray(t.trigger)&&(e.trigger=Nv({originalArray:e.trigger,newArray:t.trigger,matchKey:"on"})),e):t}(i,t.brush))}else e.push(t)})),e):e}}}({picassoInstance:t,plugins:s,pluginArgs:e});return Promise.all([u.initialize({createConfig:({getUseBaseColors:e})=>({theme:r,colorProps:{...i.color,useBaseColors:e(i)},layout:i,hc:i.qHyperCube})}),n.initialize()]).then((()=>n))}),[i,u]);e.useEffect((()=>{if(!c||!u||!g)return;const e=[{type:"q",key:"qHyperCube",data:i.qHyperCube,config:{localeInfo:l}},...u.getData()],t=function(e){var t=e.theme,n=e.config,i=void 0===n?{}:n,r=i.id,o=i.resolve,a=void 0===o?[]:o,s=i.transform,l=void 0===s?[]:s,c=i.extend,u=void 0===c?[]:c,h={theme:t,matrix:Lb(a),styles:void 0};return h.styles=Bb({theme:t,id:r,transform:l,extend:u,matrix:h.matrix}),{getStyles:function(){return h.styles},getTheme:function(){return h.theme},setTheme:function(e){h.theme=e,h.styles=Bb({theme:e,id:r,transform:l,extend:u,matrix:h.matrix})}}}({theme:r,config:{id:"funnelChart"}}),a=function({layout:e,themeService:t}){const n=t.getStyles(),i=t=>{var n,i;return null!==(n=null===(i=e.components)||void 0===i?void 0:i.find((e=>e.key===t)))&&void 0!==n?n:void 0};return{axis:{title:{getStyle:()=>{var e,t,r,o,a,s;return{fontFamily:null!==(e=null===(t=i("axis"))||void 0===t||null===(t=t.axis)||void 0===t||null===(t=t.title)||void 0===t?void 0:t.fontFamily)&&void 0!==e?e:n.axis.title.fontFamily,fontSize:null!==(r=null===(o=i("axis"))||void 0===o||null===(o=o.axis)||void 0===o||null===(o=o.title)||void 0===o?void 0:o.fontSize)&&void 0!==r?r:n.axis.title.fontSize,fill:null!==(a=null===(s=i("axis"))||void 0===s||null===(s=s.axis)||void 0===s||null===(s=s.title)||void 0===s||null===(s=s.color)||void 0===s?void 0:s.color)&&void 0!==a?a:n.axis.title.color}}},label:{getStyle:()=>{var e,t,r,o,a,s;return{fontSize:null!==(e=null===(t=i("axis"))||void 0===t||null===(t=t.axis)||void 0===t||null===(t=t.label)||void 0===t||null===(t=t.name)||void 0===t?void 0:t.fontSize)&&void 0!==e?e:n.axis.label.name.fontSize,fontFamily:null!==(r=null===(o=i("axis"))||void 0===o||null===(o=o.axis)||void 0===o||null===(o=o.label)||void 0===o||null===(o=o.name)||void 0===o?void 0:o.fontFamily)&&void 0!==r?r:n.axis.label.name.fontFamily,fill:null!==(a=null===(s=i("axis"))||void 0===s||null===(s=s.axis)||void 0===s||null===(s=s.label)||void 0===s||null===(s=s.name)||void 0===s||null===(s=s.color)||void 0===s?void 0:s.color)&&void 0!==a?a:n.axis.label.name.color}}}},label:{value:{getStyle:()=>{var e,t,r,o,a,s,l,c;return{fontSize:null!==(e=null===(t=i("label"))||void 0===t||null===(t=t.label)||void 0===t||null===(t=t.value)||void 0===t?void 0:t.fontSize)&&void 0!==e?e:n.label.value.fontSize,fontFamily:null!==(r=null===(o=i("label"))||void 0===o||null===(o=o.label)||void 0===o||null===(o=o.value)||void 0===o?void 0:o.fontFamily)&&void 0!==r?r:n.label.value.fontFamily,fill:null!==(a=null===(s=i("label"))||void 0===s||null===(s=s.label)||void 0===s||null===(s=s.value)||void 0===s||null===(s=s.color)||void 0===s?void 0:s.color)&&void 0!==a?a:n.label.value.color,useContrastColor:null===(l=null===(c=i("label"))||void 0===c||null===(c=c.label)||void 0===c||null===(c=c.value)||void 0===c?void 0:c.useContrastColor)||void 0===l||l}}}}}}({layout:i,themeService:t}),s=function({flags:e,layout:t,constraints:n,colorService:i,themeService:r,styleModel:o,pluginService:a,animationsEnabled:s}){const l=function(e){return{...e.getScales()}}(i),c=i.getPalettes(),u=function({layout:e,constraints:t,colorService:n,animationsEnabled:i}){const r=n.getDatumProps(),o=n.getColor();return{type:"funnel",key:"fun",data:{extract:{field:"qDimensionInfo/0",props:{num:{field:"qMeasureInfo/0"},...r}}},brush:t.select||t.active?{}:{trigger:[{contexts:["selection"],data:[""]}],consume:[{context:"selection",filter:e=>"section"===e.tag,style:{inactive:{opacity:.3}}}]},settings:{num:{ref:"num"},fill:o,mode:e.funnel.mode},animations:{enabled:i,isMainComponent:!0,trackBy:e=>`${e.tag}: ${e.data.value}`}}}({layout:t,constraints:n,colorService:i,animationsEnabled:s}),h=[u,Sk(e,t,r,s,o),Rk(e,t,o)];return{palettes:c,scales:l,components:a.extendComponents(h),formatters:{share:{type:"d3-number",format:".1%"},num:{data:{field:"qMeasureInfo/0"}}}}}({flags:n,layout:i,constraints:o,colorService:u,themeService:t,styleModel:a,pluginService:g,animationsEnabled:p});c.update({data:e,settings:s}),d.set("width",c.element.clientWidth),d.set("height",c.element.clientHeight),uw.cacheProperties({viewCache:d,layout:i})}),[c,u,r.name(),g,o]),e.useEffect((()=>{c&&(c.update(),d.set("width",c.element.clientWidth),d.set("height",c.element.clientHeight))}),[a.width,a.height]),e.useEffect((()=>{h&&h.setLayout(i)}),[i]),e.onTakeSnapshot((e=>u.getSnapshotData().then((t=>(e.snapshotData=e.snapshotData||{},e.snapshotData.content=e.snapshotData.content||{},e.snapshotData.content.chartData=t,e))).catch((()=>e))))}return function(){let e,t;for(xk(mk,1,10),e=0;e<yk.length;e++)if(yk[e])for(t=0;t<yk[e].length;t++)Array.isArray(yk[e][t])&&xk(yk[e][t])}(),function(e){!function(e){if(e&&e.get&&e.add){const n="Object.Disclaimer.LimitedData";if(e.get(n)!==n)return;Object.keys(t).forEach((n=>{e.add(t[n])}))}}(e.translator);const n=pp();n.use(nm),n.component("funnel",hm);const{flags:i}=e;return{ext:Xb(e),qae:{properties:{initial:dm},data:{targets:Gb}},component(){Ck({picasso:n,flags:i})}}}}));
|