/*
* @nebula.js/sn-line-chart v2.6.0
* Copyright (c) 2026 QlikTech International AB
* Released under the MIT license.
*/

!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-line-chart"]=t(e.stardust)}(this,function(e){"use strict";function t(e,t){return t.forEach(function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach(function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}})}),Object.freeze(e)}var n,r,i={Common_Measures:{id:"Common.Measures",locale:{"de-DE":"Kennzahlen","en-US":"Measures","es-ES":"Medidas","fr-FR":"Mesures","it-IT":"Misure","ja-JP":"メジャー","ko-KR":"측정값","nl-NL":"Metingen","pl-PL":"Miary","pt-BR":"Medidas","ru-RU":"Меры","sv-SE":"Mått","tr-TR":"Hesaplamalar","zh-CN":"度量","zh-TW":"量值"}},Object_ChartTooltip_ColorExpression:{id:"Object.ChartTooltip.ColorExpression",locale:{"de-DE":"Farbformel","en-US":"Color expression","es-ES":"Expresión de color","fr-FR":"Expression de couleur","it-IT":"Espressione colore","ja-JP":"カラー表現","ko-KR":"색상 표현식","nl-NL":"Kleuruitdrukking","pl-PL":"Wyrażenie koloru","pt-BR":"Expressão de cor","ru-RU":"Выражение для цвета","sv-SE":"Färguttryck","tr-TR":"Renk ifadesi","zh-CN":"颜色表达式","zh-TW":"色彩運算式"}},Object_ChartTooltip_NMore:{id:"Object.ChartTooltip.NMore",locale:{"de-DE":"+{0} mehr","en-US":"+{0} more","es-ES":"+{0} más","fr-FR":"+{0} plus","it-IT":"+{0} altre","ja-JP":"さらに +{0}","ko-KR":"{0} 이상","nl-NL":"+{0} meer","pl-PL":"Jeszcze {0}","pt-BR":"+{0} mais","ru-RU":"Еще +{0}","sv-SE":"Fler än {0} ytterligare","tr-TR":"+{0} daha","zh-CN":"+{0} 以上","zh-TW":"其他 +{0} 個"}},Object_ChartTooltip_sumOfNegatives:{id:"Object.ChartTooltip.sumOfNegatives",locale:{"de-DE":"Summe negativer Werte","en-US":"Sum of negatives","es-ES":"Suma de negativos","fr-FR":"Somme des valeurs négatives","it-IT":"Somma valori negativi","ja-JP":"負の合計","ko-KR":"음수 합계","nl-NL":"Som negatieven","pl-PL":"Suma ujemnych","pt-BR":"Soma de negativos","ru-RU":"Сумма отрицательных значений","sv-SE":"Summan av negativa","tr-TR":"Negatif değerlerin toplamı","zh-CN":"负值总和","zh-TW":"負數總和"}},Object_ChartTooltip_sumOfPositives:{id:"Object.ChartTooltip.sumOfPositives",locale:{"de-DE":"Summe positiver Werte","en-US":"Sum of positives","es-ES":"Suma de positivos","fr-FR":"Sommes des valeurs positives","it-IT":"Somma valori positivi","ja-JP":"正の合計","ko-KR":"양수 합계","nl-NL":"Som positieven","pl-PL":"Suma dodatnich","pt-BR":"Soma de positivos","ru-RU":"Сумма положительных значений","sv-SE":"Summan av positiva","tr-TR":"Pozitif değerlerin toplamı","zh-CN":"正值总和","zh-TW":"正數總和"}},Object_Disclaimer_DataRangeIncludingZero:{id:"Object.Disclaimer.DataRangeIncludingZero",locale:{"de-DE":"Die logarithmische Skala wurde durch die lineare Skala ersetzt, weil der Datenbereich NULL enthält.","en-US":"The logarithmic scale has been replaced by a linear scale because the data range includes zero.","es-ES":"La escala logarítmica ha sido reemplazada por una escala lineal porque el rango de datos incluye cero.","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.","it-IT":"La scala logaritmica è stata sostituita da una scala lineare perché l'intervallo di dati include zero.","ja-JP":"データ範囲にゼロが含まれるため、Log スケールは Linear スケールで置換されています。","ko-KR":"데이터 범위에 0이 포함되어 있으므로 로그 눈금이 선형 눈금으로 바뀌었습니다.","nl-NL":"De logaritmische schaal is vervangen door een lineaire schaal omdat het gegevensbereik nullen bevat.","pl-PL":"Skala logarytmiczna została zastąpiona liniową, ponieważ zakres danych zawiera zero.","pt-BR":"A escala logarítmica foi substituída por uma escala linear, pois o intervalo de dados inclui zero.","ru-RU":"Логарифмический масштаб заменен линейным масштабом, поскольку диапазон данных включает ноль.","sv-SE":"Den logaritmiska skalan har ersatts av en linjär skala eftersom dataintervallet innehåller värdet noll.","tr-TR":"Veri aralığı sıfır değerini içerdiğinden, logaritmik ölçek yerine doğrusal ölçek kullanıldı.","zh-CN":"对数刻度已替换为线性刻度，因为该数据范围包括零。","zh-TW":"對數刻度已遭線性刻度取代，因為資料範圍包含零。"}},Object_Disclaimer_LimitedData:{id:"Object.Disclaimer.LimitedData",locale:{"de-DE":"Zurzeit wird nur ein beschränkter Datensatz angezeigt.","en-US":"Currently showing a limited data set.","es-ES":"Mostrando actualmente un conjunto limitado de datos.","fr-FR":"Affichage d'un ensemble de données limité pour l'instant.","it-IT":"Attualmente viene visualizzata una serie di dati limitata.","ja-JP":"現在、限定的なデータ セットを表示しています。","ko-KR":"현재 제한된 데이터 집합을 표시하고 있습니다.","nl-NL":"Momenteel wordt een beperkte gegevensverzameling getoond.","pl-PL":"Aktualnie przedstawiany jest ograniczony zestaw danych.","pt-BR":"Mostrando um conjunto de dados limitado.","ru-RU":"В настоящее время отображается ограниченный набор данных.","sv-SE":"Just nu visas en begränsad datauppsättning.","tr-TR":"Şu anda sınırlı bir veri kümesi gösteriliyor.","zh-CN":"当前正显示有限的数据集。","zh-TW":"目前顯示的是有限的資料集。"}},Object_Disclaimer_NegativeOrZeroValues:{id:"Object.Disclaimer.NegativeOrZeroValues",locale:{"de-DE":"Die in den Datensätzen enthaltenen negativen oder 0-Werte können nicht in diesem Diagramm dargestellt werden.","en-US":"The data set contains negative or zero values that cannot be shown in this chart.","es-ES":"El conjunto de datos contiene valores cero o negativos que no se pueden mostrar en este gráfico.","fr-FR":"L'ensemble de données contient des valeurs négatives ou égales à zéro impossibles à afficher dans ce graphique.","it-IT":"La serie di dati contiene valori negativi o uguali a zero che non possono essere visualizzati in questo grafico.","ja-JP":"データ セットには、本チャートに表示できない負の値またはゼロ値が含まれています。","ko-KR":"데이터 집합에 해당 차트에 표시할 수 없는 음수 값 또는 zero 값이 포함되어 있습니다.","nl-NL":"De gegevensverzameling bevat negatieve waarden of nulwaarden die niet kunnen worden weergegeven in deze diagram.","pl-PL":"Zestaw danych zawiera wartości ujemne lub zerowe, których nie można przedstawić w tym wykresie.","pt-BR":"O conjunto de dados contém valores negativos ou iguais a zero que não podem ser mostrados neste gráfico.","ru-RU":"Набор данных содержит отрицательные или нулевые значения, которые невозможно показать в этой диаграмме.","sv-SE":"Datauppsättningen innehåller negativa värden eller nollvärden som inte kan visas i detta diagram.","tr-TR":"Veri kümesi, bu grafikte gösterilemeyen negatif veya sıfır değerlerini içeriyor.","zh-CN":"数据集中包含无法在此图表中显示的负值或零值。","zh-TW":"資料集包含無法在此圖表中顯示的負值或零值。"}},Object_Disclaimer_NegativeValues:{id:"Object.Disclaimer.NegativeValues",locale:{"de-DE":"Die in den Datensätzen enthaltenen negativen Werte können nicht in diesem Diagramm dargestellt werden.","en-US":"The data set contains negative values that cannot be shown in this chart.","es-ES":"El conjunto de datos contiene valores negativos que no se pueden mostrar en este gráfico.","fr-FR":"Le jeu de données contient des valeurs négatives impossibles à afficher dans ce graphique.","it-IT":"Il set di dati contiene valori negativi che non possono essere visualizzati in questo grafico.","ja-JP":"このチャートには表示できない負の値がデータ セットに含まれています。","ko-KR":"데이터 집합에 해당 차트에 표시할 수 없는 음수 값이 포함되어 있습니다.","nl-NL":"De gegevensverzameling bevat negatieve waarden die niet kunnen worden weergegeven in dit diagram.","pl-PL":"Zestaw danych zawiera wartości ujemne, których nie można przedstawić na tym wykresie.","pt-BR":"O conjunto de dados contém valores negativos que não podem ser mostrados neste gráfico.","ru-RU":"Набор данных содержит отрицательные значения, которые нельзя отобразить на этой диаграмме.","sv-SE":"Datauppsättningen innehåller negativa värden som inte kan visas i det här diagrammet.","tr-TR":"Veri kümesi, bu grafikte gösterilemeyen negatif değerleri içeriyor.","zh-CN":"数据集包含无法在此图表中显示的负值。","zh-TW":"資料集包含無法在此圖表中顯示的負值。"}},Object_Disclaimer_NoDataExist:{id:"Object.Disclaimer.NoDataExist",locale:{"de-DE":"Die Auswahlen haben für dieses Diagramm keine Daten generiert.","en-US":"The selections generated no data for this chart.","es-ES":"Las selecciones no han generado datos para este gráfico.","fr-FR":"Les sélections n'ont pas généré de données pour ce graphique.","it-IT":"Le selezioni non hanno generato dati per questo grafico.","ja-JP":"このチャートには選択からデータが生成されませんでした。","ko-KR":"선택 내용으로 이 차트에 대한 데이터가 생성되지 않았습니다.","nl-NL":"De selecties hebben geen gegevens voor de diagram gegenereerd.","pl-PL":"Wymiary nie spowodowały wygenerowania danych dla tego wykresu.","pt-BR":"As seleções não geraram dados para este gráfico.","ru-RU":"В результате выборок данные для этой диаграммы не созданы.","sv-SE":"Urvalen genererade inga data för detta diagram.","tr-TR":"Seçimler bu grafik için hiç veri oluşturmadı.","zh-CN":"选择未生成此图表的数据。","zh-TW":"此選項無法產生任何適用於此圖表的資料。"}},Object_Disclaimer_OnlyNanColor:{id:"Object.Disclaimer.OnlyNanColor",locale:{"de-DE":"Die verwendeten Daten für die Farbgebung dieser Visualisierung enthalten undefinierte Werte.","en-US":"The data used to color this visualization only contains undefined values.","es-ES":"Los datos utilizados para colorear esta visualización solo contienen valores indefinidos.","fr-FR":"Les données utilisées pour colorer cette visualisation ne comportent que des valeurs non définies.","it-IT":"I dati utilizzati per colorare questa visualizzazione contengono solo valori non definiti.","ja-JP":"このビジュアライゼーションの色の割り当てに使用したデータには、未定義の値が含まれています。","ko-KR":"이 시각화에 색을 지정하는 데 사용된 데이터에는 정의되지 않은 값만 포함되어 있습니다.","nl-NL":"De gegevens die worden gebruikt om deze visualisatie kleur te geven bevatten uitsluitend ongedefinieerde waarden.","pl-PL":"Dane używane do kolorowania tej wizualizacji zawierają wyłącznie niezdefiniowane wartości.","pt-BR":"Os dados usados para colorir esse visualização contém somente valores indefinidos.","ru-RU":"Данные, используемые для выбора цвета визуализации, содержат только неопределенные значения.","sv-SE":"Data som används för att färgsätta denna visualisering innehåller enbart odefinierade värden.","tr-TR":"Bu görselleştirmeyi renklendirmek için kullanılan veriler yalnızca tanımlanmamış değerler içeriyor.","zh-CN":"用于将该可视化着色的数据仅包含未定义的值。","zh-TW":"用以定義此視覺化的色彩的資料只包含未定義的值。"}},Object_Disclaimer_OnlyNanData:{id:"Object.Disclaimer.OnlyNanData",locale:{"de-DE":"Das Diagramm wird nicht angezeigt, da es nur nicht definierte Werte enthält.","en-US":"The chart is not displayed because it contains only undefined values.","es-ES":"El gráfico no se muestra porque solo contiene valores indefinidos.","fr-FR":"Le graphique n'est pas affiché, car il contient uniquement des valeurs non définies.","it-IT":"Il grafico non è visualizzato poiché contiene solo valori non definiti.","ja-JP":"未定義の値しか含まれていないため、チャートは表示されていません。","ko-KR":"정의되지 않은 값만 포함되어 있으므로 차트가 표시되지 않습니다.","nl-NL":"De diagram wordt niet weergegeven omdat deze alleen ongedefinieerde waarden bevat.","pl-PL":"Wykres nie jest wyświetlany, ponieważ zawiera wyłącznie wartości niezdefiniowane.","pt-BR":"O gráfico não foi exibido, porque contém apenas valores não definidos.","ru-RU":"Диаграмма не отображается, поскольку она содержит только неопределенные значения.","sv-SE":"Diagrammet visas inte eftersom det enbart innehåller odefinierade värden.","tr-TR":"Yalnızca tanımsız değerleri içermesi nedeniyle grafik görüntülenmiyor.","zh-CN":"未显示图表，因为它仅包含未定义的值。","zh-TW":"系統不會顯示圖表，因為該圖表僅包含未定義的值。"}},Object_Disclaimer_OnlyNegativeOrZeroValues:{id:"Object.Disclaimer.OnlyNegativeOrZeroValues",locale:{"de-DE":"Das Diagramm wird nicht angezeigt, da es nur negative oder 0-Werte enthält.","en-US":"The chart is not displayed because it contains only negative or zero values.","es-ES":"El gráfico no se muestra porque solo contiene valores negativos o valores cero.","fr-FR":"Le graphique n'est pas affiché, car il contient uniquement des valeurs négatives ou égales à zéro.","it-IT":"Il grafico non viene visualizzato poiché contiene solo valori negativi o uguali a zero.","ja-JP":"チャートは負の値またはゼロ値しか含まれていないため、表示されていません。","ko-KR":"음수 또는 zero 값만 포함되어 있으므로 차트가 표시되지 않습니다.","nl-NL":"De diagram wordt niet weergegeven omdat deze alleen negatieve waarden of nulwaarden bevat.","pl-PL":"Wykres nie jest wyświetlany, ponieważ zawiera wyłącznie wartości ujemne lub zerowe.","pt-BR":"O gráfico não foi exibido, porque contém apenas valores negativos ou zero.","ru-RU":"Диаграмма не отображается, поскольку она содержит только отрицательные или нулевые значения.","sv-SE":"Diagrammet visas inte eftersom det enbart innehåller negativa värden eller nollvärden","tr-TR":"Yalnızca negatif veya sıfır değerlerini içermesi nedeniyle grafik görüntülenmiyor.","zh-CN":"未显示图表，因为它仅包含负值或零值。","zh-TW":"系統不會顯示圖表，因為該圖表僅包含負值或零值。"}},Object_Disclaimer_OnlyNegativeValues:{id:"Object.Disclaimer.OnlyNegativeValues",locale:{"de-DE":"Das Diagramm wird nicht angezeigt, da es nur negative oder Werte enthält.","en-US":"The chart is not displayed because it contains only negative values.","es-ES":"El gráfico no se muestra porque solo contiene valores negativos.","fr-FR":"Le graphique n'est pas affiché, car il contient uniquement des valeurs négatives.","it-IT":"Il grafico non viene visualizzato poiché contiene solo valori negativi.","ja-JP":"負の値しか含まれていないため、チャートは表示されていません。","ko-KR":"음수 값만 포함되어 있으므로 차트가 표시되지 않습니다.","nl-NL":"Het diagram wordt niet weergegeven omdat deze alleen negatieve waarden bevat.","pl-PL":"Wykres nie jest wyświetlany, ponieważ zawiera wyłącznie wartości ujemne.","pt-BR":"O gráfico não é exibido porque contém apenas valores negativos.","ru-RU":"Диаграмма не отображается, поскольку она содержит только отрицательные значения.","sv-SE":"Diagrammet visas inte eftersom det endast innehåller negativa värden.","tr-TR":"Yalnızca negatif değerleri içermesi nedeniyle grafik görüntülenmiyor.","zh-CN":"未显示图表，因为它仅包含负值。","zh-TW":"系統不會顯示圖表，因為該圖表僅包含負值。"}},Object_ErrorMessage_MissingDimension:{id:"Object.ErrorMessage.MissingDimension",locale:{"de-DE":"Dimension nicht gefunden","en-US":"Dimension not found","es-ES":"No se ha encontrado la dimensión","fr-FR":"Dimension introuvable","it-IT":"Dimensione non trovata","ja-JP":"軸が見つかりません","ko-KR":"차원을 찾지 못했습니다.","nl-NL":"Dimensie niet gevonden","pl-PL":"Wymiar nie został znaleziony","pt-BR":"Dimensão não encontrada","ru-RU":"Измерение не найдено","sv-SE":"Dimensionen hittades inte","tr-TR":"Boyut bulunamadı","zh-CN":"未找到维度","zh-TW":"找不到維度"}},Object_ErrorMessage_MissingMeasure:{id:"Object.ErrorMessage.MissingMeasure",locale:{"de-DE":"Kennzahl nicht gefunden","en-US":"Measure not found","es-ES":"No se ha encontrado la medida","fr-FR":"Mesure introuvable","it-IT":"Misura non trovata","ja-JP":"メジャーが見つかりません","ko-KR":"측정값을 찾지 못했습니다.","nl-NL":"Meting niet gevonden","pl-PL":"Miara nie została znaleziona","pt-BR":"Medida não encontrada","ru-RU":"Мера не найдена","sv-SE":"Måttet hittades inte","tr-TR":"Hesaplama bulunamadı","zh-CN":"未找到度量","zh-TW":"找不到量值"}},Tooltip_ToggleOffLassoSelection:{id:"Tooltip.ToggleOffLassoSelection",locale:{"de-DE":"Lasso-Auswahl deaktivieren","en-US":"Turn off lasso selection","es-ES":"Desactivar la selección de contorno","fr-FR":"Désactiver la sélection au lasso","it-IT":"Disattiva selezione lazo","ja-JP":"囲み選択をオフにする","ko-KR":"올가미 선택 끄기","nl-NL":"Lassoselectie uitschakelen","pl-PL":"Wyłącz zaznaczenie lasso","pt-BR":"Desativar seleção de laço","ru-RU":"Выключить выбор лассо","sv-SE":"Stäng av lassourval","tr-TR":"Serbest seçimi kapat","zh-CN":"关闭套索选择方法","zh-TW":"關閉套索選取"}},Tooltip_ToggleOnLassoSelection:{id:"Tooltip.ToggleOnLassoSelection",locale:{"de-DE":"Lasso-Auswahl aktivieren","en-US":"Turn on lasso selection","es-ES":"Activar la selección de contorno","fr-FR":"Activer la sélection au lasso","it-IT":"Attiva selezione lazo","ja-JP":"囲み選択をオンにする","ko-KR":"올가미 선택 켜기","nl-NL":"Lassoselectie inschakelen","pl-PL":"Włącz zaznaczenie lasso","pt-BR":"Ativar seleção de laço","ru-RU":"Включить выбор лассо","sv-SE":"Slå på lassourval","tr-TR":"Serbest seçimi aç","zh-CN":"开启套索选择方法","zh-TW":"開啟套索選取"}},Tooltip_dimensions_cyclic:{id:"Tooltip.dimensions.cyclic",locale:{"de-DE":"Zyklische Dimension","en-US":"Cyclic dimension","es-ES":"Dimensión cíclica","fr-FR":"Dimension cyclique","it-IT":"Dimensione ciclica","ja-JP":"サイクリック軸","ko-KR":"순환 차원","nl-NL":"Cyclische dimensie","pl-PL":"Wymiar cykliczny","pt-BR":"Dimensão cíclica","ru-RU":"Циклическое измерение","sv-SE":"Cyklisk dimension","tr-TR":"Döngüsel boyut","zh-CN":"循环维度","zh-TW":"循環維度"}},Tooltip_dimensions_drilldown:{id:"Tooltip.dimensions.drilldown",locale:{"de-DE":"Drilldown-Dimension","en-US":"Drill-down dimension","es-ES":"Dimensión jerárquica","fr-FR":"Descendre dans la hiérarchie de la dimension","it-IT":"Dimensione di drill-down","ja-JP":"軸のドリルダウン","ko-KR":"드릴다운 차원","nl-NL":"Drill-downdimensie","pl-PL":"Wymiar hierarchiczny","pt-BR":"Dimensão da hierarquia","ru-RU":"Детализированное измерение","sv-SE":"Hierarkisk dimension","tr-TR":"Detaya inme boyutu","zh-CN":"下钻维度","zh-TW":"向下探查維度"}},Tooltip_selections_locked:{id:"Tooltip.selections.locked",locale:{"de-DE":"Auswahlen sind für diese Dimension gesperrt","en-US":"Selections on this dimension are locked","es-ES":"Las selecciones de esta dimensión están bloqueadas.","fr-FR":"Sélections verrouillées pour cette dimension","it-IT":"Le selezioni in questa dimensione sono bloccate","ja-JP":"この軸での選択はロックされています","ko-KR":"이 차원의 선택은 잠겨 있습니다.","nl-NL":"Selecties voor deze dimensie zijn vergrendeld","pl-PL":"Wybory dotyczące tego wymiaru są zablokowane","pt-BR":"Seleções estão bloqueadas nesta dimensão","ru-RU":"Выборки для данного измерения заблокированы","sv-SE":"Urval i den här dimensionen är låsta","tr-TR":"Bu boyuttaki seçimler kilitli","zh-CN":"相关维度的选择已锁定","zh-TW":"已鎖定此維度上的選項"}},Visualizations_Descriptions_Bars:{id:"Visualizations.Descriptions.Bars",locale:{"de-DE":"Balken","en-US":"Bars","es-ES":"Barras","fr-FR":"Barres","it-IT":"Barre","ja-JP":"棒","ko-KR":"막대","nl-NL":"Staven","pl-PL":"Słupki","pt-BR":"Barras","ru-RU":"Полосы","sv-SE":"Staplar","tr-TR":"Çubuklar","zh-CN":"条形","zh-TW":"長條"}},Visualizations_Descriptions_Group:{id:"Visualizations.Descriptions.Group",locale:{"de-DE":"Gruppe","en-US":"Group","es-ES":"Grupo","fr-FR":"Groupe","it-IT":"Gruppo","ja-JP":"グループ","ko-KR":"그룹","nl-NL":"Groep","pl-PL":"Grupa","pt-BR":"Grupo","ru-RU":"Группа","sv-SE":"Grupp","tr-TR":"Grup","zh-CN":"组","zh-TW":"群組"}},Visualizations_Descriptions_HeightLine:{id:"Visualizations.Descriptions.HeightLine",locale:{"de-DE":"Linienhöhe","en-US":"Height of line","es-ES":"Altura de línea","fr-FR":"Hauteur de ligne","it-IT":"Altezza della linea","ja-JP":"線の高さ","ko-KR":"선 높이","nl-NL":"Hoogte van lijn","pl-PL":"Wysokość linii","pt-BR":"Altura da linha","ru-RU":"Высота линии","sv-SE":"Linjens höjd","tr-TR":"Çizgi yüksekliği","zh-CN":"线高度","zh-TW":"折線高度"}},Visualizations_Descriptions_LengthBars:{id:"Visualizations.Descriptions.LengthBars",locale:{"de-DE":"Balkenlänge","en-US":"Length of bars","es-ES":"Longitud de barras","fr-FR":"Longueur des barres","it-IT":"Lunghezza delle barre","ja-JP":"棒の長さ","ko-KR":"막대 길이","nl-NL":"Lengte van staven","pl-PL":"Długość słupków","pt-BR":"Comprimento das barras","ru-RU":"Длина полос","sv-SE":"Staplarnas längd","tr-TR":"Çubuk uzunluğu","zh-CN":"条形长度","zh-TW":"長條長度"}},properties_dataPoints_labelmode_share:{id:"properties.dataPoints.labelmode.share",locale:{"de-DE":"Freigeben","en-US":"Share","es-ES":"Compartir","fr-FR":"Partage","it-IT":"Condividi","ja-JP":"共有","ko-KR":"공유","nl-NL":"Delen","pl-PL":"Udostępnij","pt-BR":"Compartilhar","ru-RU":"Совместное использование","sv-SE":"Dela","tr-TR":"Paylaş","zh-CN":"共享","zh-TW":"共用"}},properties_trendlines_types_average:{id:"properties.trendlines.types.average",locale:{"de-DE":"Durchschnitt","en-US":"Average","es-ES":"Media","fr-FR":"Moyenne","it-IT":"Media","ja-JP":"平均値","ko-KR":"평균","nl-NL":"Gemiddelde","pl-PL":"Średnia","pt-BR":"Média","ru-RU":"Среднее","sv-SE":"Medel","tr-TR":"Ortalama","zh-CN":"平均值","zh-TW":"平均值"}},properties_trendlines_types_exponential:{id:"properties.trendlines.types.exponential",locale:{"de-DE":"Exponentiell","en-US":"Exponential","es-ES":"Exponencial","fr-FR":"Exponentiel","it-IT":"Esponenziale","ja-JP":"指数","ko-KR":"지수","nl-NL":"Exponentieel","pl-PL":"Wykładnicze","pt-BR":"Exponencial","ru-RU":"Экспоненциальный","sv-SE":"Exponentiell","tr-TR":"Üstel","zh-CN":"指数","zh-TW":"指數"}},properties_trendlines_types_linear:{id:"properties.trendlines.types.linear",locale:{"de-DE":"Linear","en-US":"Linear","es-ES":"Lineal","fr-FR":"Linéaire","it-IT":"Lineare","ja-JP":"線形","ko-KR":"선형","nl-NL":"Lineair","pl-PL":"Liniowe","pt-BR":"Linear","ru-RU":"Линейный","sv-SE":"Linjär","tr-TR":"Doğrusal","zh-CN":"线性","zh-TW":"線性"}},properties_trendlines_types_logarithmic:{id:"properties.trendlines.types.logarithmic",locale:{"de-DE":"Logarithmisch","en-US":"Logarithmic","es-ES":"Logarítmica","fr-FR":"Logarithmique","it-IT":"Logaritmica","ja-JP":"対数","ko-KR":"로그","nl-NL":"Logaritmisch","pl-PL":"Logarytmiczne","pt-BR":"Logarítmico","ru-RU":"Логарифмический","sv-SE":"Logaritmisk","tr-TR":"Logaritmik","zh-CN":"对数","zh-TW":"對數"}},properties_trendlines_types_polynomial2:{id:"properties.trendlines.types.polynomial2",locale:{"de-DE":"Polynom zweiten Grades","en-US":"Second degree polynomial","es-ES":"Polinómica de segundo grado","fr-FR":"Polynomial du 2ème degré","it-IT":"Polinomio di secondo grado","ja-JP":"2 番目の角度の多項式近似","ko-KR":"2차 다항식","nl-NL":"Tweedegraadspolynoom","pl-PL":"Wielomianowe drugiego stopnia","pt-BR":"Polinômio de segundo grau","ru-RU":"Полиномиальный второй степени","sv-SE":"Polynomial, andra graden","tr-TR":"İkinci derece polinom","zh-CN":"二次多项式","zh-TW":"第二度多項式"}},properties_trendlines_types_polynomial3:{id:"properties.trendlines.types.polynomial3",locale:{"de-DE":"Polynom dritten Grades","en-US":"Third degree polynomial","es-ES":"Polinómica de tercer grado","fr-FR":"Polynomial du 3ème degré","it-IT":"Polinomio di terzo grado","ja-JP":"3 番目の角度の多項式近似","ko-KR":"3차 다항식","nl-NL":"Derdegraadspolynoom","pl-PL":"Wielomianowe trzeciego stopnia","pt-BR":"Polinômio de terceiro grau","ru-RU":"Полиномиальный третьей степени","sv-SE":"Polynomial, tredje graden","tr-TR":"Üçüncü derece polinom","zh-CN":"三次多项式","zh-TW":"第三度多項式"}},properties_trendlines_types_polynomial4:{id:"properties.trendlines.types.polynomial4",locale:{"de-DE":"Polynom vierten Grades","en-US":"Fourth degree polynomial","es-ES":"Polinómica de cuarto grado","fr-FR":"Polynomial du 4ème degré","it-IT":"Polinomio di quarto grado","ja-JP":"4 番目の角度の多項式近似","ko-KR":"4차 다항식","nl-NL":"Vierdegraadspolynoom","pl-PL":"Wielomianowe czwartego stopnia","pt-BR":"Polinômio de quarto grau","ru-RU":"Полиномиальный четвертой степени","sv-SE":"Polynomial, fjärde graden","tr-TR":"Dördüncü derece polinom","zh-CN":"四次多项式","zh-TW":"第四度多項式"}},properties_trendlines_types_power:{id:"properties.trendlines.types.power",locale:{"de-DE":"Potenz","en-US":"Power","es-ES":"Potencia","fr-FR":"Puissance","it-IT":"Potenza","ja-JP":"累乗","ko-KR":"거듭제곱","nl-NL":"Macht","pl-PL":"Potęgowe","pt-BR":"Potência","ru-RU":"Степенной","sv-SE":"Potens","tr-TR":"Üs","zh-CN":"幂","zh-TW":"乘冪"}}};function o(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function a(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if("function"==typeof t){var n=function e(){var n=!1;try{n=this instanceof e}catch{}return n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),n}var s=function(){if(r)return n;r=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,i=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},s=function(n){if(!n||"[object Object]"!==t.call(n))return!1;var r,i=e.call(n,"constructor"),o=n.constructor&&n.constructor.prototype&&e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!i&&!o)return!1;for(r in n);return void 0===r||e.call(n,r)},l=function(e,t){i&&"__proto__"===t.name?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},c=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(o)return o(t,n).value}return t[n]};return n=function e(){var t,n,r,i,o,u,d=arguments[0],f=1,h=arguments.length,p=!1;for("boolean"==typeof d&&(p=d,d=arguments[1]||{},f=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});f<h;++f)if(null!=(t=arguments[f]))for(n in t)r=c(d,n),d!==(i=c(t,n))&&(p&&i&&(s(i)||(o=a(i)))?(o?(o=!1,u=r&&a(r)?r:[]):u=r&&s(r)?r:{},l(d,{name:n,newValue:e(p,u,i)})):void 0!==i&&l(d,{name:n,newValue:i}));return d},n}(),l=o(s);const c=[["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}]],u={};c.forEach(([e,{width:t,height:n}])=>{u[e]={width:t,height:n}});const d={getLayoutModes:()=>u,getLayoutMode(e,t){let n;for(n=0;n<c.length;++n)if(e>=c[n][1].width&&t>=c[n][1].height)return c[n][0];return"SPARK"}};const f=["$date","$timestamp","$time"],h=["D","TS","T"],p={hasTimeTag:e=>!!(e&&e.qTags&&e.qTags.some(e=>f.some(t=>t===e))),hasUnknownFormat:e=>!(!e||!e.qNumFormat||"U"!==e.qNumFormat.qType),hasTimeFormat:e=>!!(e&&e.qNumFormat&&h.some(t=>t===e.qNumFormat.qType)),isTimeDimension:(e,t)=>!!(e&&t&&(p.hasTimeTag(t)&&p.hasUnknownFormat(t)||p.hasTimeFormat(t))),isTime:(e,t)=>!!(t&&t.qHyperCube.qDimensionInfo&&t.qHyperCube.qDimensionInfo.length)&&(e&&p.isTimeDimension(e,t.qHyperCube.qDimensionInfo.filter(e=>7005!==e.qError?.qErrorCode)[0])),canBeContinuousDimension(e){if(!e)return!1;const t=e.qTags||[];return!(!e.qContinuousAxes||!t.some(e=>"$numeric"===e))},canBeContinuous(e){const t=e?.qHyperCube?.qDimensionInfo?.filter(e=>7005!==e.qError?.qErrorCode);return!((t?.length??0)<1)&&p.canBeContinuousDimension(t[0])},maxNumberOfLines:12},m=/^[A-Z][A-z0-9_]*$/i,g={getChar(e){let t=e,n=-1;return t>9?(n=65+t-10,n>90&&(n+=6)):t=`${t}`.charCodeAt(0),[48,111,79,105,73,108].indexOf(n)>-1?this.getChar(t+1):String.fromCharCode(n)},base62(e){const t=this.getChar(e%62),n=Math.floor(e/62);return n>0?this.base62(n)+t:t},id(){return this.base62(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}},y={setValue:(e,t,n)=>{if(!t)return!1;const r=t.split("."),i=r[r.length-1];let o,a=e;for(o=0;o<r.length-1;++o)void 0===a[r[o]]&&(a[r[o]]=Number.isNaN(+r[o+1])?{}:[]),a=a[r[o]];if(void 0!==n){const e=a[i];return a[i]=n,{updated:n,previous:e}}return delete a[i],!1},getValue:(e,t,n)=>{const r=t.split(".");let i,o=e;if(void 0===o)return n;for(i=0;i<r.length;++i){if(void 0===o[r[i]])return n;o=o[r[i]]}return o},moveArrayElement:(e,t,n)=>{if(n>=e.length){let t=n-e.length;for(;1+t--;)e.push(void 0)}e.splice(n,0,e.splice(t,1)[0])},escapeField:e=>{let t;return t=!e||"]"===e||m.test(e)?e:`[${e.replace(/\]/g,"]]")}]`,t},deleteUndefinedProperties:e=>{Object.keys(e).forEach(t=>{void 0===e[t]&&delete e[t]})},generateId:()=>g.id(),shouldUseFormat:e=>!e.isCustomFormatted&&(e.qIsAutoFormat||"U"===e.qNumFormat.qType)},v=e=>y.getValue(e,"qHyperCube.qDimensionInfo",[]),b=e=>y.getValue(e,"qHyperCube.qMeasureInfo",[]),x=e=>y.getValue(e,"barGrouping.grouping"),S={continuous({layout:e,properties:t,auto:n}){if(!p.canBeContinuous(e))return!1;const r=t||e;return y.getValue(r,"dimensionAxis.continuousAuto")?"function"==typeof n?n():!!n:!!r?.preferContinuousAxis},dimensionless:e=>!v(e).length,grouped(e){return!this.dimensionless(e)&&"grouped"===x(e)&&(v(e).length>1||b(e).length>1)&&!this.continuous({layout:e})},groupedByDimension(e){return this.grouped(e)&&v(e).length>1&&1===b(e).length},groupedByMeasure(e){return this.grouped(e)&&1===v(e).length&&b(e).length>1},stacked(e){return(!this.dimensionless(e)&&"grouped"!==x(e)&&"butterfly"!==x(e)||this.continuous({layout:e}))&&(v(e).length>1||b(e).length>1)},stackedByDimension(e){return this.stacked(e)&&v(e).length>1&&1===b(e).length},stackedByMeasure(e){return this.stacked(e)&&1===v(e).length&&b(e).length>1},simple:e=>0===v(e).length||1===v(e).length&&1===b(e).length,snapshot:e=>!!y.getValue(e,"snapshotData")};function M(e,t){const n=e.component(t);return n&&n._DO_NOT_USE_getInfo&&n._DO_NOT_USE_getInfo().offset}const w=e=>{throw e.isHandled=!0,e};var k=(e,t)=>{if("function"==typeof t.defaultValue)return t.defaultValue();if(void 0!==t.defaultValue)return t.defaultValue;if(Array.isArray(t.options))return t.options[0].value;switch(e){case"array":return[];case"string":return"";case"integer":case"number":return 0;case"boolean":return!1;default:return null}};const E=166/26,C=12/11,N={stringWidthOverMWidth:e=>(12*Math.min(e,3)+Math.max(e-3,0)*E)/11,getCharacterRatios(e){if(!e)return{latin:0,cjk:0};let t=e.match(/[\u4E00-\u9FFF]/g),n=e.match(/[\u3040-\u309F]/g),r=e.match(/[\u30A0-\u30FF]/g);t=t?t.length:0,n=n?n.length:0,r=r?r.length:0;const i=t+n+r;return{latin:e.length-i,cjk:i}},getTotalCharacterRatios(e,t,n="qText"){if(!e)return{latinRatio:1,cjkRatio:0};const r={latin:0,cjk:0};let i;void 0===t?e.forEach(e=>{i=N.getCharacterRatios(e[n]),r.latin+=i.latin,r.cjk+=i.cjk}):e.forEach(e=>{i=N.getCharacterRatios(e[t][n]),r.latin+=i.latin,r.cjk+=i.cjk});const o=Math.max(1,r.latin+r.cjk);return r.latinRatio=r.latin/o,r.cjkRatio=r.cjk/o,r},getAdjustedMaxGlyphCount(e,t,n,r="qText"){const i=N.getTotalCharacterRatios(t,n,r),o=i.latinRatio*e,a=i.cjkRatio*e;return Math.ceil(N.stringWidthOverMWidth(o)+a*C)}},T="#la-vie-tooltip";function D(){if(!document.querySelector(T)){const e=document.createElement("div");e.id="la-vie-tooltip",e.setAttribute("data-qs-css",""),e.style.overflow="hidden",e.style.position="fixed",e.style.pointerEvents="none",e.style.left="0px",e.style.top="0px",e.style.width="100%",e.style.height="100%",e.style.zIndex=1020,document.body.appendChild(e)}}function q({key:e="tooltip",rtl:t}){return{show:!0,key:e,type:"tooltip",layout:{displayOrder:3},beforeMount(){D()},beforeUpdate(){D()},destroyed(){!function(){const e=document.querySelector(T);e&&e.parentElement&&e.childElementCount<1&&e.parentElement.removeChild(e)}()},settings:{appendTo:()=>document.querySelector(T),content:({h:e,data:t,style:n})=>t[0].map(t=>e("tr",{},function(e,{h:t,style:n}){return e.map(e=>{const r={style:{...n.cell||{},...e.style||{}},class:e.class};return e.colspan&&(r.colspan=e.colspan),t("td",r,e.content)})}(t,{h:e,style:n}))),direction:t?"rtl":"ltr"},style:{arrow:{color:"#404040"},content:{display:"table","border-spacing":"4px",background:"rgba(64, 64, 64, 0.9)",opacity:"1",fontSize:"13px",fontFamily:'"Source Sans Pro", "Arial", "sans-serif"',"empty-cells":"show"},cell:{"max-width":"180px","word-break":"break-word","word-wrap":"break-word","overflow-wrap":"break-word",hyphens:"auto"}}}}const O=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼ‎ⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗＡ-Ｚａ-ｚｦ-ￜ]"),I=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞‏יִײַ-ﬨשׁ-ﭏ]"),A=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]"),_={lrm:String.fromCharCode(8206),rlm:String.fromCharCode(8207),isLtrChar:e=>O.test(e),isRtlChar:e=>I.test(e)||A.test(e),detectTextDirection(e){const t=e?e.length:0;let n,r;for(n=0;n<t;n++){if(r=e[n],_.isLtrChar(r))return"ltr";if(_.isRtlChar(r))return"rtl"}return"ltr"}},L={getColorSymbol:(e,t)=>e.h("div",{style:{display:"inline-block",width:"10px",height:"10px","background-color":t.color.fill,margin:"0 8px"}}),getNodeFillColor:e=>e.attrs&&void 0!==e.attrs.fill?e.attrs.fill:e.children&&e.children[0]&&e.children[0].attrs&&void 0!==e.children[0].attrs.fill?e.children[0].attrs.fill:void 0,getColor(e,t,n){const r=t.data,i=e.resources.formatter,o=e.resources.dataset,a={};if(n.coloring.label&&(a.label=`${n.coloring.label}`),"color"!==n.coloring.type&&r.fillTooltip){const e=i("fill"),t="measure"===n.coloring.fieldType;if(a.value=t&&e?e(r.fillTooltip.value):r.fillTooltip.label?r.fillTooltip.label:r.fillTooltip.value,!n.coloring.label){const e=o(r.fillTooltip.source.key).field(r.fillTooltip.source.field).title();a.label=`${e}`}}return a.fill=void 0===r._fillColor?L.getNodeFillColor(t):r._fillColor,a},getMeasure:(e,t)=>({label:`${e(t.source.key).field(t.source.field).title()}`,value:""===t.label||"NaN"===t.label?"-":t.label,field:t.source.field}),hideColorRow:(e,t)=>void 0===e.color.value||e.measures.some(e=>e.field===t.coloring.field),getTitleRow(e,t){const n=_.detectTextDirection(e.title);return[{content:e.title,style:{"font-weight":"bold","text-align":t?"right":"left",direction:n,"white-space":"pre-wrap"},colspan:2},{}]},getDescriptionRow(e,t){const n=_.detectTextDirection(e.value);return[{content:e.value,style:{"text-align":t?"right":"left",direction:n,"white-space":"pre-wrap"},colspan:2},{}]},getNMoreRow(e,t,n){const r=t?t.get("Object.ChartTooltip.NMore",e):`+${e} more`;return[{content:r,style:{"font-weight":"bold","text-align":n?"right":"left",direction:_.detectTextDirection(r)},colspan:2},{}]},getSeparatorRow:()=>[{content:"",style:{"background-image":"linear-gradient(transparent 8px, rgba(255, 255, 255, 0.4) 8px, rgba(255, 255, 255, 0.4) 9.2px, transparent 9.2px)",height:"17px"},colspan:2},{}],getColorRow(e,t,n){const r=_.detectTextDirection(t.color.label),i=n?[":",t.color.label]:[t.color.label,":"],o=_.detectTextDirection(t.color.value);return[{content:i,style:{"text-align":n?"right":"left",direction:r}},{content:n?[t.color.value,L.getColorSymbol(e,t)]:[L.getColorSymbol(e,t),t.color.value],style:{"text-align":n?"left":"right",direction:o,"vertical-align":"middle"}}]},getMeasureRow(e,t,n,r,i=!1){const o=_.detectTextDirection(e.label),a=r?[":",e.label]:[e.label,":"],s=_.detectTextDirection(e.value);let l;return l=i?r?[e.value,L.getColorSymbol(t,n)]:[L.getColorSymbol(t,n),e.value]:[e.value],[{content:a,style:{"text-align":r?"right":"left",direction:o}},{content:l,style:{"text-align":r?"left":"right",direction:s,"vertical-align":"middle"}}]}};function P(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function R(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function F(){}var z=.7,j=1/z,$="\\s*([+-]?\\d+)\\s*",V="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",U="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",H=/^#([0-9a-f]{3,8})$/,B=new RegExp(`^rgb\\(${$},${$},${$}\\)$`),W=new RegExp(`^rgb\\(${U},${U},${U}\\)$`),Y=new RegExp(`^rgba\\(${$},${$},${$},${V}\\)$`),G=new RegExp(`^rgba\\(${U},${U},${U},${V}\\)$`),K=new RegExp(`^hsl\\(${V},${U},${U}\\)$`),X=new RegExp(`^hsla\\(${V},${U},${U},${V}\\)$`),J={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 Z(){return this.rgb().formatHex()}function Q(){return this.rgb().formatRgb()}function ee(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=H.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?te(t):3===n?new ie(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?ne(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?ne(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=B.exec(e))?new ie(t[1],t[2],t[3],1):(t=W.exec(e))?new ie(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Y.exec(e))?ne(t[1],t[2],t[3],t[4]):(t=G.exec(e))?ne(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=K.exec(e))?ue(t[1],t[2]/100,t[3]/100,1):(t=X.exec(e))?ue(t[1],t[2]/100,t[3]/100,t[4]):J.hasOwnProperty(e)?te(J[e]):"transparent"===e?new ie(NaN,NaN,NaN,0):null}function te(e){return new ie(e>>16&255,e>>8&255,255&e,1)}function ne(e,t,n,r){return r<=0&&(e=t=n=NaN),new ie(e,t,n,r)}function re(e){return e instanceof F||(e=ee(e)),e?new ie((e=e.rgb()).r,e.g,e.b,e.opacity):new ie}function ie(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function oe(){return`#${ce(this.r)}${ce(this.g)}${ce(this.b)}`}function ae(){const e=se(this.opacity);return`${1===e?"rgb(":"rgba("}${le(this.r)}, ${le(this.g)}, ${le(this.b)}${1===e?")":`, ${e})`}`}function se(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function le(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ce(e){return((e=le(e))<16?"0":"")+e.toString(16)}function ue(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new fe(e,t,n,r)}function de(e){if(e instanceof fe)return new fe(e.h,e.s,e.l,e.opacity);if(e instanceof F||(e=ee(e)),!e)return new fe;if(e instanceof fe)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(a=t===o?(n-r)/s+6*(n<r):n===o?(r-t)/s+2:(t-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new fe(a,s,l,e.opacity)}function fe(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function he(e){return(e=(e||0)%360)<0?e+360:e}function pe(e){return Math.max(0,Math.min(1,e||0))}function me(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}P(F,ee,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Z,formatHex:Z,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return de(this).formatHsl()},formatRgb:Q,toString:Q}),P(ie,function(e,t,n,r){return 1===arguments.length?re(e):new ie(e,t,n,null==r?1:r)},R(F,{brighter(e){return e=null==e?j:Math.pow(j,e),new ie(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?z:Math.pow(z,e),new ie(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ie(le(this.r),le(this.g),le(this.b),se(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:oe,formatHex:oe,formatHex8:function(){return`#${ce(this.r)}${ce(this.g)}${ce(this.b)}${ce(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:ae,toString:ae})),P(fe,function(e,t,n,r){return 1===arguments.length?de(e):new fe(e,t,n,null==r?1:r)},R(F,{brighter(e){return e=null==e?j:Math.pow(j,e),new fe(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?z:Math.pow(z,e),new fe(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,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new ie(me(e>=240?e-240:e+120,i,r),me(e,i,r),me(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new fe(he(this.h),pe(this.s),pe(this.l),se(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=se(this.opacity);return`${1===e?"hsl(":"hsla("}${he(this.h)}, ${100*pe(this.s)}%, ${100*pe(this.l)}%${1===e?")":`, ${e})`}`}}));const ge=Math.PI/180,ye=180/Math.PI,ve=.96422,be=.82521,xe=4/29,Se=6/29,Me=3*Se*Se,we=Se*Se*Se;function ke(e){if(e instanceof Ee)return new Ee(e.l,e.a,e.b,e.opacity);if(e instanceof Oe)return Ie(e);e instanceof ie||(e=re(e));var t,n,r=De(e.r),i=De(e.g),o=De(e.b),a=Ce((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=a:(t=Ce((.4360747*r+.3850649*i+.1430804*o)/ve),n=Ce((.0139322*r+.0971045*i+.7141733*o)/be)),new Ee(116*a-16,500*(t-a),200*(a-n),e.opacity)}function Ee(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function Ce(e){return e>we?Math.pow(e,1/3):e/Me+xe}function Ne(e){return e>Se?e*e*e:Me*(e-xe)}function Te(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function De(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function qe(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof Oe)return new Oe(e.h,e.c,e.l,e.opacity);if(e instanceof Ee||(e=ke(e)),0===e.a&&0===e.b)return new Oe(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*ye;return new Oe(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new Oe(e,t,n,null==r?1:r)}function Oe(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function Ie(e){if(isNaN(e.h))return new Ee(e.l,0,0,e.opacity);var t=e.h*ge;return new Ee(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}P(Ee,function(e,t,n,r){return 1===arguments.length?ke(e):new Ee(e,t,n,null==r?1:r)},R(F,{brighter(e){return new Ee(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new Ee(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 ie(Te(3.1338561*(t=ve*Ne(t))-1.6168667*(e=1*Ne(e))-.4906146*(n=be*Ne(n))),Te(-.9787684*t+1.9161415*e+.033454*n),Te(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),P(Oe,qe,R(F,{brighter(e){return new Oe(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new Oe(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return Ie(this).rgb()}}));var Ae={isDark:function(e){return qe(e).l<70}};function _e(e){const t=e.qDef;!0===t.autoSort&&t.qSortCriterias.forEach(e=>{e.qSortByNumeric=1,e.qSortByAscii=1})}function Le(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Pe(e){return 1===e.length&&(e=function(e){return function(t,n){return Le(e(t),n)}}(e)),{left:function(t,n,r,i){for(null==r&&(r=0),null==i&&(i=t.length);r<i;){var o=r+i>>>1;e(t[o],n)<0?r=o+1:i=o}return r},right:function(t,n,r,i){for(null==r&&(r=0),null==i&&(i=t.length);r<i;){var o=r+i>>>1;e(t[o],n)>0?i=o:r=o+1}return r}}}var Re=Pe(Le).right,Fe=Math.sqrt(50),ze=Math.sqrt(10),je=Math.sqrt(2);function $e(e,t,n){var r,i,o,a,s=-1;if(n=+n,(e=+e)===(t=+t)&&n>0)return[e];if((r=t<e)&&(i=e,e=t,t=i),0===(a=Ve(e,t,n))||!isFinite(a))return[];if(a>0)for(e=Math.ceil(e/a),t=Math.floor(t/a),o=new Array(i=Math.ceil(t-e+1));++s<i;)o[s]=(e+s)*a;else for(e=Math.floor(e*a),t=Math.ceil(t*a),o=new Array(i=Math.ceil(e-t+1));++s<i;)o[s]=(e-s)/a;return r&&o.reverse(),o}function Ve(e,t,n){var r=(t-e)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),o=r/Math.pow(10,i);return i>=0?(o>=Fe?10:o>=ze?5:o>=je?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=Fe?10:o>=ze?5:o>=je?2:1)}function Ue(e,t,n){var r=Math.abs(t-e)/Math.max(0,n),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=Fe?i*=10:o>=ze?i*=5:o>=je&&(i*=2),t<e?-i:i}function He(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}var Be="$";function We(){}function Ye(e,t){var n=new We;if(e instanceof We)e.each(function(e,t){n.set(t,e)});else if(Array.isArray(e)){var r,i=-1,o=e.length;if(null==t)for(;++i<o;)n.set(i,e[i]);else for(;++i<o;)n.set(t(r=e[i],i,e),r)}else if(e)for(var a in e)n.set(a,e[a]);return n}function Ge(){}We.prototype=Ye.prototype={constructor:We,has:function(e){return Be+e in this},get:function(e){return this[Be+e]},set:function(e,t){return this[Be+e]=t,this},remove:function(e){var t=Be+e;return t in this&&delete this[t]},clear:function(){for(var e in this)e[0]===Be&&delete this[e]},keys:function(){var e=[];for(var t in this)t[0]===Be&&e.push(t.slice(1));return e},values:function(){var e=[];for(var t in this)t[0]===Be&&e.push(this[t]);return e},entries:function(){var e=[];for(var t in this)t[0]===Be&&e.push({key:t.slice(1),value:this[t]});return e},size:function(){var e=0;for(var t in this)t[0]===Be&&++e;return e},empty:function(){for(var e in this)if(e[0]===Be)return!1;return!0},each:function(e){for(var t in this)t[0]===Be&&e(this[t],t.slice(1),this)}};var Ke=Ye.prototype;Ge.prototype={constructor:Ge,has:Ke.has,add:function(e){return this[Be+(e+="")]=e,this},remove:Ke.remove,clear:Ke.clear,values:Ke.keys,size:Ke.size,empty:Ke.empty,each:Ke.each};var Xe=Array.prototype,Je=Xe.map,Ze=Xe.slice;function Qe(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function et(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function tt(){}var nt=.7,rt=1/nt,it="\\s*([+-]?\\d+)\\s*",ot="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",at="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",st=/^#([0-9a-f]{3,8})$/,lt=new RegExp("^rgb\\("+[it,it,it]+"\\)$"),ct=new RegExp("^rgb\\("+[at,at,at]+"\\)$"),ut=new RegExp("^rgba\\("+[it,it,it,ot]+"\\)$"),dt=new RegExp("^rgba\\("+[at,at,at,ot]+"\\)$"),ft=new RegExp("^hsl\\("+[ot,at,at]+"\\)$"),ht=new RegExp("^hsla\\("+[ot,at,at,ot]+"\\)$"),pt={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 mt(){return this.rgb().formatHex()}function gt(){return this.rgb().formatRgb()}function yt(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=st.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?vt(t):3===n?new St(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?bt(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?bt(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=lt.exec(e))?new St(t[1],t[2],t[3],1):(t=ct.exec(e))?new St(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=ut.exec(e))?bt(t[1],t[2],t[3],t[4]):(t=dt.exec(e))?bt(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=ft.exec(e))?Et(t[1],t[2]/100,t[3]/100,1):(t=ht.exec(e))?Et(t[1],t[2]/100,t[3]/100,t[4]):pt.hasOwnProperty(e)?vt(pt[e]):"transparent"===e?new St(NaN,NaN,NaN,0):null}function vt(e){return new St(e>>16&255,e>>8&255,255&e,1)}function bt(e,t,n,r){return r<=0&&(e=t=n=NaN),new St(e,t,n,r)}function xt(e,t,n,r){return 1===arguments.length?function(e){return e instanceof tt||(e=yt(e)),e?new St((e=e.rgb()).r,e.g,e.b,e.opacity):new St}(e):new St(e,t,n,null==r?1:r)}function St(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function Mt(){return"#"+kt(this.r)+kt(this.g)+kt(this.b)}function wt(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===e?")":", "+e+")")}function kt(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function Et(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Nt(e,t,n,r)}function Ct(e){if(e instanceof Nt)return new Nt(e.h,e.s,e.l,e.opacity);if(e instanceof tt||(e=yt(e)),!e)return new Nt;if(e instanceof Nt)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(a=t===o?(n-r)/s+6*(n<r):n===o?(r-t)/s+2:(t-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new Nt(a,s,l,e.opacity)}function Nt(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function Tt(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}function Dt(e){return function(){return e}}function qt(e){return 1===(e=+e)?Ot: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(r){return Math.pow(e+r*t,n)}}(t,n,e):Dt(isNaN(t)?n:t)}}function Ot(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):Dt(isNaN(e)?t:e)}Qe(tt,yt,{copy:function(e){return Object.assign(new this.constructor,this,e)},displayable:function(){return this.rgb().displayable()},hex:mt,formatHex:mt,formatHsl:function(){return Ct(this).formatHsl()},formatRgb:gt,toString:gt}),Qe(St,xt,et(tt,{brighter:function(e){return e=null==e?rt:Math.pow(rt,e),new St(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=null==e?nt:Math.pow(nt,e),new St(this.r*e,this.g*e,this.b*e,this.opacity)},rgb:function(){return this},displayable:function(){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:Mt,formatHex:Mt,formatRgb:wt,toString:wt})),Qe(Nt,function(e,t,n,r){return 1===arguments.length?Ct(e):new Nt(e,t,n,null==r?1:r)},et(tt,{brighter:function(e){return e=null==e?rt:Math.pow(rt,e),new Nt(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?nt:Math.pow(nt,e),new Nt(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new St(Tt(e>=240?e-240:e+120,i,r),Tt(e,i,r),Tt(e<120?e+240:e-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===e?")":", "+e+")")}}));var It=function e(t){var n=qt(t);function r(e,t){var r=n((e=xt(e)).r,(t=xt(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=Ot(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1);function At(e,t){t||(t=[]);var n,r=e?Math.min(t.length,e.length):0,i=t.slice();return function(o){for(n=0;n<r;++n)i[n]=e[n]*(1-o)+t[n]*o;return i}}function _t(e,t){var n,r=t?t.length:0,i=e?Math.min(r,e.length):0,o=new Array(i),a=new Array(r);for(n=0;n<i;++n)o[n]=$t(e[n],t[n]);for(;n<r;++n)a[n]=t[n];return function(e){for(n=0;n<i;++n)a[n]=o[n](e);return a}}function Lt(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Pt(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Rt(e,t){var n,r={},i={};for(n in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)n in e?r[n]=$t(e[n],t[n]):i[n]=t[n];return function(e){for(n in r)i[n]=r[n](e);return i}}var Ft=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,zt=new RegExp(Ft.source,"g");function jt(e,t){var n,r,i,o=Ft.lastIndex=zt.lastIndex=0,a=-1,s=[],l=[];for(e+="",t+="";(n=Ft.exec(e))&&(r=zt.exec(t));)(i=r.index)>o&&(i=t.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,l.push({i:a,x:Pt(n,r)})),o=zt.lastIndex;return o<t.length&&(i=t.slice(o),s[a]?s[a]+=i:s[++a]=i),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,r=0;r<t;++r)s[(n=l[r]).i]=n.x(e);return s.join("")})}function $t(e,t){var n,r=typeof t;return null==t||"boolean"===r?Dt(t):("number"===r?Pt:"string"===r?(n=yt(t))?(t=n,It):jt:t instanceof yt?It:t instanceof Date?Lt:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(t)?At:Array.isArray(t)?_t:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?Rt:Pt)(e,t)}function Vt(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function Ut(e){return+e}var Ht=[0,1];function Bt(e){return e}function Wt(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:function(e){return function(){return e}}(isNaN(t)?NaN:.5)}function Yt(e){var t,n=e[0],r=e[e.length-1];return n>r&&(t=n,n=r,r=t),function(e){return Math.max(n,Math.min(r,e))}}function Gt(e,t,n){var r=e[0],i=e[1],o=t[0],a=t[1];return i<r?(r=Wt(i,r),o=n(a,o)):(r=Wt(r,i),o=n(o,a)),function(e){return o(r(e))}}function Kt(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),o=new Array(r),a=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<r;)i[a]=Wt(e[a],e[a+1]),o[a]=n(t[a],t[a+1]);return function(t){var n=Re(e,t,1,r)-1;return o[n](i[n](t))}}function Xt(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Jt(){var e,t,n,r,i,o,a=Ht,s=Ht,l=$t,c=Bt;function u(){return r=Math.min(a.length,s.length)>2?Kt:Gt,i=o=null,d}function d(t){return isNaN(t=+t)?n:(i||(i=r(a.map(e),s,l)))(e(c(t)))}return d.invert=function(n){return c(t((o||(o=r(s,a.map(e),Pt)))(n)))},d.domain=function(e){return arguments.length?(a=Je.call(e,Ut),c===Bt||(c=Yt(a)),u()):a.slice()},d.range=function(e){return arguments.length?(s=Ze.call(e),u()):s.slice()},d.rangeRound=function(e){return s=Ze.call(e),l=Vt,u()},d.clamp=function(e){return arguments.length?(c=e?Yt(a):Bt,d):c!==Bt},d.interpolate=function(e){return arguments.length?(l=e,u()):l},d.unknown=function(e){return arguments.length?(n=e,d):n},function(n,r){return e=n,t=r,u()}}function Zt(e,t){return Jt()(e,t)}function Qt(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function en(e){return(e=Qt(Math.abs(e)))?e[1]:NaN}var tn,nn=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function rn(e){if(!(t=nn.exec(e)))throw new Error("invalid format: "+e);var t;return new on({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 on(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 an(e,t){var n=Qt(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}rn.prototype=on.prototype,on.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 sn={"%":function(e,t){return(100*e).toFixed(t)},b:function(e){return Math.round(e).toString(2)},c:function(e){return e+""},d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},g:function(e,t){return e.toPrecision(t)},o:function(e){return Math.round(e).toString(8)},p:function(e,t){return an(100*e,t)},r:an,s:function(e,t){var n=Qt(e,t);if(!n)return e+"";var r=n[0],i=n[1],o=i-(tn=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+Qt(e,Math.max(0,t+o-1))[0]},X:function(e){return Math.round(e).toString(16).toUpperCase()},x:function(e){return Math.round(e).toString(16)}};function ln(e){return e}var cn,un,dn,fn=Array.prototype.map,hn=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function pn(e){var t=void 0===e.grouping||void 0===e.thousands?ln:function(e,t){return function(n,r){for(var i=n.length,o=[],a=0,s=e[0],l=0;i>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),o.push(n.substring(i-=s,i+s)),!((l+=s+1)>r));)s=e[a=(a+1)%e.length];return o.reverse().join(t)}}(fn.call(e.grouping,Number),e.thousands+""),n=void 0===e.currency?"":e.currency[0]+"",r=void 0===e.currency?"":e.currency[1]+"",i=e.decimal+"",o=void 0===e.numerals?ln:function(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}(fn.call(e.numerals,String)),a=void 0===e.percent?"%":e.percent+"",s=e.minus+"",l=void 0===e.nan?"NaN":e.nan+"";function c(e){var c=(e=rn(e)).fill,u=e.align,d=e.sign,f=e.symbol,h=e.zero,p=e.width,m=e.comma,g=e.precision,y=e.trim,v=e.type;"n"===v?(m=!0,v="g"):sn[v]||(void 0===g&&(g=12),y=!0,v="g"),(h||"0"===c&&"="===u)&&(h=!0,c="0",u="=");var b="$"===f?n:"#"===f&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",x="$"===f?r:/[%p]/.test(v)?a:"",S=sn[v],M=/[defgprs%]/.test(v);function w(e){var n,r,a,f=b,w=x;if("c"===v)w=S(e)+w,e="";else{var k=(e=+e)<0||1/e<0;if(e=isNaN(e)?l:S(Math.abs(e),g),y&&(e=function(e){e:for(var t,n=e.length,r=1,i=-1;r<n;++r)switch(e[r]){case".":i=t=r;break;case"0":0===i&&(i=r),t=r;break;default:if(!+e[r])break e;i>0&&(i=0)}return i>0?e.slice(0,i)+e.slice(t+1):e}(e)),k&&0===+e&&"+"!==d&&(k=!1),f=(k?"("===d?d:s:"-"===d||"("===d?"":d)+f,w=("s"===v?hn[8+tn/3]:"")+w+(k&&"("===d?")":""),M)for(n=-1,r=e.length;++n<r;)if(48>(a=e.charCodeAt(n))||a>57){w=(46===a?i+e.slice(n+1):e.slice(n))+w,e=e.slice(0,n);break}}m&&!h&&(e=t(e,1/0));var E=f.length+e.length+w.length,C=E<p?new Array(p-E+1).join(c):"";switch(m&&h&&(e=t(C+e,C.length?p-w.length:1/0),C=""),u){case"<":e=f+e+w+C;break;case"=":e=f+C+e+w;break;case"^":e=C.slice(0,E=C.length>>1)+f+e+w+C.slice(E);break;default:e=C+f+e+w}return o(e)}return g=void 0===g?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),w.toString=function(){return e+""},w}return{format:c,formatPrefix:function(e,t){var n=c(((e=rn(e)).type="f",e)),r=3*Math.max(-8,Math.min(8,Math.floor(en(t)/3))),i=Math.pow(10,-r),o=hn[8+r/3];return function(e){return n(i*e)+o}}}}function mn(e,t,n,r){var i,o=Ue(e,t,n);switch((r=rn(null==r?",f":r)).type){case"s":var a=Math.max(Math.abs(e),Math.abs(t));return null!=r.precision||isNaN(i=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(en(t)/3)))-en(Math.abs(e)))}(o,a))||(r.precision=i),dn(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,en(t)-en(e))+1}(o,Math.max(Math.abs(e),Math.abs(t))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=function(e){return Math.max(0,-en(Math.abs(e)))}(o))||(r.precision=i-2*("%"===r.type))}return un(r)}function gn(){var e=Zt(Bt,Bt);return e.copy=function(){return Xt(e,gn())},He.apply(e,arguments),function(e){var t=e.domain;return e.ticks=function(e){var n=t();return $e(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var r=t();return mn(r[0],r[r.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var r,i=t(),o=0,a=i.length-1,s=i[o],l=i[a];return l<s&&(r=s,s=l,l=r,r=o,o=a,a=r),(r=Ve(s,l,n))>0?r=Ve(s=Math.floor(s/r)*r,l=Math.ceil(l/r)*r,n):r<0&&(r=Ve(s=Math.ceil(s*r)/r,l=Math.floor(l*r)/r,n)),r>0?(i[o]=Math.floor(s/r)*r,i[a]=Math.ceil(l/r)*r,t(i)):r<0&&(i[o]=Math.ceil(s*r)/r,i[a]=Math.floor(l*r)/r,t(i)),e},e}(e)}function yn(e,t){var n,r=0,i=(e=e.slice()).length-1,o=e[r],a=e[i];return a<o&&(n=r,r=i,i=n,n=o,o=a,a=n),e[r]=t.floor(o),e[i]=t.ceil(a),e}function vn(e){return Math.log(e)}function bn(e){return Math.exp(e)}function xn(e){return-Math.log(-e)}function Sn(e){return-Math.exp(-e)}function Mn(e){return isFinite(e)?+("1e"+e):e<0?0:e}function wn(e){return function(t){return-e(-t)}}function kn(e){var t,n,r=e(vn,bn),i=r.domain,o=10;function a(){return t=function(e){return e===Math.E?Math.log:10===e&&Math.log10||2===e&&Math.log2||(e=Math.log(e),function(t){return Math.log(t)/e})}(o),n=function(e){return 10===e?Mn:e===Math.E?Math.exp:function(t){return Math.pow(e,t)}}(o),i()[0]<0?(t=wn(t),n=wn(n),e(xn,Sn)):e(vn,bn),r}return r.base=function(e){return arguments.length?(o=+e,a()):o},r.domain=function(e){return arguments.length?(i(e),a()):i()},r.ticks=function(e){var r,a=i(),s=a[0],l=a[a.length-1];(r=l<s)&&(f=s,s=l,l=f);var c,u,d,f=t(s),h=t(l),p=null==e?10:+e,m=[];if(!(o%1)&&h-f<p){if(f=Math.round(f)-1,h=Math.round(h)+1,s>0){for(;f<h;++f)for(u=1,c=n(f);u<o;++u)if(!((d=c*u)<s)){if(d>l)break;m.push(d)}}else for(;f<h;++f)for(u=o-1,c=n(f);u>=1;--u)if(!((d=c*u)<s)){if(d>l)break;m.push(d)}}else m=$e(f,h,Math.min(h-f,p)).map(n);return r?m.reverse():m},r.tickFormat=function(e,i){if(null==i&&(i=10===o?".0e":","),"function"!=typeof i&&(i=un(i)),e===1/0)return i;null==e&&(e=10);var a=Math.max(1,o*e/r.ticks().length);return function(e){var r=e/n(Math.round(t(e)));return r*o<o-.5&&(r*=o),r<=a?i(e):""}},r.nice=function(){return i(yn(i(),{floor:function(e){return n(Math.floor(t(e)))},ceil:function(e){return n(Math.ceil(t(e)))}}))},r}function En(){var e=kn(Jt()).domain([1,10]);return e.copy=function(){return Xt(e,En()).base(e.base())},He.apply(e,arguments),e}!function(e){cn=pn(e),un=cn.format,dn=cn.formatPrefix}({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});var Cn=new Date,Nn=new Date;function Tn(e,t,n,r){function i(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return i.floor=function(t){return e(t=new Date(+t)),t},i.ceil=function(n){return e(n=new Date(n-1)),t(n,1),e(n),n},i.round=function(e){var t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=function(e,n){return t(e=new Date(+e),null==n?1:Math.floor(n)),e},i.range=function(n,r,o){var a,s=[];if(n=i.ceil(n),o=null==o?1:Math.floor(o),!(n<r&&o>0))return s;do{s.push(a=new Date(+n)),t(n,o),e(n)}while(a<n&&n<r);return s},i.filter=function(n){return Tn(function(t){if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},function(e,r){if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););})},n&&(i.count=function(t,r){return Cn.setTime(+t),Nn.setTime(+r),e(Cn),e(Nn),Math.floor(n(Cn,Nn))},i.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(r?function(t){return r(t)%e===0}:function(t){return i.count(0,t)%e===0}):i:null}),i}var Dn=Tn(function(){},function(e,t){e.setTime(+e+t)},function(e,t){return t-e});Dn.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?Tn(function(t){t.setTime(Math.floor(t/e)*e)},function(t,n){t.setTime(+t+n*e)},function(t,n){return(n-t)/e}):Dn:null},Dn.range;var qn=6e4,On=36e5,In=864e5,An=6048e5,_n=Tn(function(e){e.setTime(e-e.getMilliseconds())},function(e,t){e.setTime(+e+1e3*t)},function(e,t){return(t-e)/1e3},function(e){return e.getUTCSeconds()});_n.range;var Ln=Tn(function(e){e.setHours(0,0,0,0)},function(e,t){e.setDate(e.getDate()+t)},function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*qn)/In},function(e){return e.getDate()-1});function Pn(e){return Tn(function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},function(e,t){e.setDate(e.getDate()+7*t)},function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*qn)/An})}Ln.range;var Rn=Pn(0),Fn=Pn(1),zn=Pn(2),jn=Pn(3),$n=Pn(4),Vn=Pn(5),Un=Pn(6);Rn.range,Fn.range,zn.range,jn.range,$n.range,Vn.range,Un.range;var Hn=Tn(function(e){e.setMonth(0,1),e.setHours(0,0,0,0)},function(e,t){e.setFullYear(e.getFullYear()+t)},function(e,t){return t.getFullYear()-e.getFullYear()},function(e){return e.getFullYear()});Hn.every=function(e){return isFinite(e=Math.floor(e))&&e>0?Tn(function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,n){t.setFullYear(t.getFullYear()+n*e)}):null},Hn.range;var Bn=Tn(function(e){e.setUTCSeconds(0,0)},function(e,t){e.setTime(+e+t*qn)},function(e,t){return(t-e)/qn},function(e){return e.getUTCMinutes()});Bn.range;var Wn=Tn(function(e){e.setUTCMinutes(0,0,0)},function(e,t){e.setTime(+e+t*On)},function(e,t){return(t-e)/On},function(e){return e.getUTCHours()});Wn.range;var Yn=Tn(function(e){e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCDate(e.getUTCDate()+t)},function(e,t){return(t-e)/In},function(e){return e.getUTCDate()-1});function Gn(e){return Tn(function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},function(e,t){e.setUTCDate(e.getUTCDate()+7*t)},function(e,t){return(t-e)/An})}Yn.range;var Kn=Gn(0),Xn=Gn(1),Jn=Gn(2),Zn=Gn(3),Qn=Gn(4),er=Gn(5),tr=Gn(6);Kn.range,Xn.range,Jn.range,Zn.range,Qn.range,er.range,tr.range;var nr=Tn(function(e){e.setUTCDate(1),e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCMonth(e.getUTCMonth()+t)},function(e,t){return t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear())},function(e){return e.getUTCMonth()});nr.range;var rr=Tn(function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)},function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()},function(e){return e.getUTCFullYear()});function ir(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 or(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 ar(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}rr.every=function(e){return isFinite(e=Math.floor(e))&&e>0?Tn(function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n*e)}):null},rr.range;var sr,lr,cr={"-":"",_:" ",0:"0"},ur=/^\s*\d+/,dr=/^%/,fr=/[\\^$*+?|[\]().{}]/g;function hr(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(t)+i:i)}function pr(e){return e.replace(fr,"\\$&")}function mr(e){return new RegExp("^(?:"+e.map(pr).join("|")+")","i")}function gr(e){for(var t={},n=-1,r=e.length;++n<r;)t[e[n].toLowerCase()]=n;return t}function yr(e,t,n){var r=ur.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function vr(e,t,n){var r=ur.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function br(e,t,n){var r=ur.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function xr(e,t,n){var r=ur.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Sr(e,t,n){var r=ur.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function Mr(e,t,n){var r=ur.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function wr(e,t,n){var r=ur.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function kr(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Er(e,t,n){var r=ur.exec(t.slice(n,n+1));return r?(e.q=3*r[0]-3,n+r[0].length):-1}function Cr(e,t,n){var r=ur.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function Nr(e,t,n){var r=ur.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Tr(e,t,n){var r=ur.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function Dr(e,t,n){var r=ur.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function qr(e,t,n){var r=ur.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Or(e,t,n){var r=ur.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Ir(e,t,n){var r=ur.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Ar(e,t,n){var r=ur.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function _r(e,t,n){var r=dr.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Lr(e,t,n){var r=ur.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Pr(e,t,n){var r=ur.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function Rr(e,t){return hr(e.getDate(),t,2)}function Fr(e,t){return hr(e.getHours(),t,2)}function zr(e,t){return hr(e.getHours()%12||12,t,2)}function jr(e,t){return hr(1+Ln.count(Hn(e),e),t,3)}function $r(e,t){return hr(e.getMilliseconds(),t,3)}function Vr(e,t){return $r(e,t)+"000"}function Ur(e,t){return hr(e.getMonth()+1,t,2)}function Hr(e,t){return hr(e.getMinutes(),t,2)}function Br(e,t){return hr(e.getSeconds(),t,2)}function Wr(e){var t=e.getDay();return 0===t?7:t}function Yr(e,t){return hr(Rn.count(Hn(e)-1,e),t,2)}function Gr(e){var t=e.getDay();return t>=4||0===t?$n(e):$n.ceil(e)}function Kr(e,t){return e=Gr(e),hr($n.count(Hn(e),e)+(4===Hn(e).getDay()),t,2)}function Xr(e){return e.getDay()}function Jr(e,t){return hr(Fn.count(Hn(e)-1,e),t,2)}function Zr(e,t){return hr(e.getFullYear()%100,t,2)}function Qr(e,t){return hr((e=Gr(e)).getFullYear()%100,t,2)}function ei(e,t){return hr(e.getFullYear()%1e4,t,4)}function ti(e,t){var n=e.getDay();return hr((e=n>=4||0===n?$n(e):$n.ceil(e)).getFullYear()%1e4,t,4)}function ni(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+hr(t/60|0,"0",2)+hr(t%60,"0",2)}function ri(e,t){return hr(e.getUTCDate(),t,2)}function ii(e,t){return hr(e.getUTCHours(),t,2)}function oi(e,t){return hr(e.getUTCHours()%12||12,t,2)}function ai(e,t){return hr(1+Yn.count(rr(e),e),t,3)}function si(e,t){return hr(e.getUTCMilliseconds(),t,3)}function li(e,t){return si(e,t)+"000"}function ci(e,t){return hr(e.getUTCMonth()+1,t,2)}function ui(e,t){return hr(e.getUTCMinutes(),t,2)}function di(e,t){return hr(e.getUTCSeconds(),t,2)}function fi(e){var t=e.getUTCDay();return 0===t?7:t}function hi(e,t){return hr(Kn.count(rr(e)-1,e),t,2)}function pi(e){var t=e.getUTCDay();return t>=4||0===t?Qn(e):Qn.ceil(e)}function mi(e,t){return e=pi(e),hr(Qn.count(rr(e),e)+(4===rr(e).getUTCDay()),t,2)}function gi(e){return e.getUTCDay()}function yi(e,t){return hr(Xn.count(rr(e)-1,e),t,2)}function vi(e,t){return hr(e.getUTCFullYear()%100,t,2)}function bi(e,t){return hr((e=pi(e)).getUTCFullYear()%100,t,2)}function xi(e,t){return hr(e.getUTCFullYear()%1e4,t,4)}function Si(e,t){var n=e.getUTCDay();return hr((e=n>=4||0===n?Qn(e):Qn.ceil(e)).getUTCFullYear()%1e4,t,4)}function Mi(){return"+0000"}function wi(){return"%"}function ki(e){return+e}function Ei(e){return Math.floor(+e/1e3)}!function(e){sr=function(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,o=e.days,a=e.shortDays,s=e.months,l=e.shortMonths,c=mr(i),u=gr(i),d=mr(o),f=gr(o),h=mr(a),p=gr(a),m=mr(s),g=gr(s),y=mr(l),v=gr(l),b={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:Rr,e:Rr,f:Vr,g:Qr,G:ti,H:Fr,I:zr,j:jr,L:$r,m:Ur,M:Hr,p:function(e){return i[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:ki,s:Ei,S:Br,u:Wr,U:Yr,V:Kr,w:Xr,W:Jr,x:null,X:null,y:Zr,Y:ei,Z:ni,"%":wi},x={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:ri,e:ri,f:li,g:bi,G:Si,H:ii,I:oi,j:ai,L:si,m:ci,M:ui,p:function(e){return i[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:ki,s:Ei,S:di,u:fi,U:hi,V:mi,w:gi,W:yi,x:null,X:null,y:vi,Y:xi,Z:Mi,"%":wi},S={a:function(e,t,n){var r=h.exec(t.slice(n));return r?(e.w=p[r[0].toLowerCase()],n+r[0].length):-1},A:function(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=f[r[0].toLowerCase()],n+r[0].length):-1},b:function(e,t,n){var r=y.exec(t.slice(n));return r?(e.m=v[r[0].toLowerCase()],n+r[0].length):-1},B:function(e,t,n){var r=m.exec(t.slice(n));return r?(e.m=g[r[0].toLowerCase()],n+r[0].length):-1},c:function(e,n,r){return k(e,t,n,r)},d:Nr,e:Nr,f:Ar,g:wr,G:Mr,H:Dr,I:Dr,j:Tr,L:Ir,m:Cr,M:qr,p:function(e,t,n){var r=c.exec(t.slice(n));return r?(e.p=u[r[0].toLowerCase()],n+r[0].length):-1},q:Er,Q:Lr,s:Pr,S:Or,u:vr,U:br,V:xr,w:yr,W:Sr,x:function(e,t,r){return k(e,n,t,r)},X:function(e,t,n){return k(e,r,t,n)},y:wr,Y:Mr,Z:kr,"%":_r};function M(e,t){return function(n){var r,i,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!=(i=cr[r=e.charAt(++s)])?r=e.charAt(++s):i="e"===r?" ":"0",(o=t[r])&&(r=o(n,i)),a.push(r),l=s+1);return a.push(e.slice(l,s)),a.join("")}}function w(e,t){return function(n){var r,i,o=ar(1900,void 0,1);if(k(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?(i=(r=or(ar(o.y,0,1))).getUTCDay(),r=i>4||0===i?Xn.ceil(r):Xn(r),r=Yn.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=ir(ar(o.y,0,1))).getDay(),r=i>4||0===i?Fn.ceil(r):Fn(r),r=Ln.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.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),i="Z"in o?or(ar(o.y,0,1)).getUTCDay():ir(ar(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,or(o)):ir(o)}}function k(e,t,n,r){for(var i,o,a=0,s=t.length,l=n.length;a<s;){if(r>=l)return-1;if(37===(i=t.charCodeAt(a++))){if(i=t.charAt(a++),!(o=S[i in cr?t.charAt(a++):i])||(r=o(e,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return b.x=M(n,b),b.X=M(r,b),b.c=M(t,b),x.x=M(n,x),x.X=M(r,x),x.c=M(t,x),{format:function(e){var t=M(e+="",b);return t.toString=function(){return e},t},parse:function(e){var t=w(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=M(e+="",x);return t.toString=function(){return e},t},utcParse:function(e){var t=w(e+="",!0);return t.toString=function(){return e},t}}}(e),sr.format,sr.parse,lr=sr.utcFormat,sr.utcParse}({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"]});var Ci=1e3,Ni=6e4,Ti=36e5,Di=864e5,qi=2592e6,Oi=31536e6;function Ii(e){return new Date(e)}function Ai(e){return e instanceof Date?+e:+new Date(+e)}function _i(e,t,n,r,i,o,a,s,l){var c=Zt(Bt,Bt),u=c.invert,d=c.domain,f=l(".%L"),h=l(":%S"),p=l("%I:%M"),m=l("%I %p"),g=l("%a %d"),y=l("%b %d"),v=l("%B"),b=l("%Y"),x=[[a,1,Ci],[a,5,5e3],[a,15,15e3],[a,30,3e4],[o,1,Ni],[o,5,3e5],[o,15,9e5],[o,30,18e5],[i,1,Ti],[i,3,108e5],[i,6,216e5],[i,12,432e5],[r,1,Di],[r,2,1728e5],[n,1,6048e5],[t,1,qi],[t,3,7776e6],[e,1,Oi]];function S(s){return(a(s)<s?f:o(s)<s?h:i(s)<s?p:r(s)<s?m:t(s)<s?n(s)<s?g:y:e(s)<s?v:b)(s)}function M(t,n,r,i){if(null==t&&(t=10),"number"==typeof t){var o=Math.abs(r-n)/t,a=Pe(function(e){return e[2]}).right(x,o);a===x.length?(i=Ue(n/Oi,r/Oi,t),t=e):a?(i=(a=x[o/x[a-1][2]<x[a][2]/o?a-1:a])[1],t=a[0]):(i=Math.max(Ue(n,r,t),1),t=s)}return null==i?t:t.every(i)}return c.invert=function(e){return new Date(u(e))},c.domain=function(e){return arguments.length?d(Je.call(e,Ai)):d().map(Ii)},c.ticks=function(e,t){var n,r=d(),i=r[0],o=r[r.length-1],a=o<i;return a&&(n=i,i=o,o=n),n=(n=M(e,i,o,t))?n.range(i,o+1):[],a?n.reverse():n},c.tickFormat=function(e,t){return null==t?S:l(t)},c.nice=function(e,t){var n=d();return(e=M(e,n[0],n[n.length-1],t))?d(yn(n,e)):c},c.copy=function(){return Xt(c,_i(e,t,n,r,i,o,a,s,l))},c}function Li(){return He.apply(_i(rr,nr,Kn,Yn,Wn,Bn,_n,Dn,lr).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}const Pi={horizontal:{major:"width",minor:"height",start:"left",end:"right",shadow:{startOffset:"12px 0",endOffset:"-12px 0"}},vertical:{major:"height",minor:"width",start:"top",end:"bottom",shadow:{startOffset:"0 12px",endOffset:"0 -12px"}}},Ri=e=>`${e} 12px -12px inset rgba(0, 0, 0, 0.0625)`;var Fi={defaultSettings:{settings:{orientation:"horizontal",rtl:!1,range:()=>[0,1]}},renderer:"dom",render(e){const{range:t,orientation:n,rtl:r}=this.settings.settings,[i,o]=t(),a=Math.abs(i)<1e-15,s=Math.abs(o-1)<1e-15,l=(e=>{const t=Pi[e];return{base:{position:"absolute",[t.major]:12,[t.minor]:"100%"},towardsStart:{[t.start]:0,[t.end]:"auto",boxShadow:Ri(t.shadow.startOffset)},towardsEnd:{[t.start]:"auto",[t.end]:0,boxShadow:Ri(t.shadow.endOffset)}}})(n),c="horizontal"===n&&r,u=[];return a||u.push(e("div",{style:{...l.base,...c?l.towardsEnd:l.towardsStart},class:"scroll-hint--towards-start"})),s||u.push(e("div",{style:{...l.base,...c?l.towardsStart:l.towardsEnd},class:"scroll-hint--towards-end"})),u}};function zi({viewState:e,viewCache:t,layoutService:n,dockService:r,rtl:i}){return!n.meta.isSnapshot&&{key:"scroll-hint",type:"scroll-hint",settings:{orientation:r.meta.major.orientation,rtl:i,range:()=>function({layoutService:e,viewState:t,viewCache:n}){return e.meta.isContinuous?function(e,t){const n=e.get("zoom"),r=t.get("continuousMin"),i=t.get("continuousMax");return[(n.min-r)/(i-r),(n.max-r)/(i-r)]}(t,n):function(e){return e.get("viewRange")}(t)}({layoutService:n,viewState:e,viewCache:t})}}}let ji;function $i(){ji=ji||document.createElement("canvas").getContext("2d")}const Vi={measureTextWidth(e){$i();const{width:t}=ji.measureText(e);return t},lineWrap(e,t,n,r){let i,o;$i();const a=e?e.split(/\n+|\r+|\r\n/):[],s=[];let l,c,u,d,f=e?e.split(/\s+/):[],h=a[0];if("number"!=typeof t||t<=0)return[e];if("number"==typeof r&&a.length>=r)return a.slice(0,r);for(n&&(ji.font=n),o=0;o<a.length;o++){for(d=a[o]||"",f=d.split(/\s+/),[h]=f,u="",i=1;i<f.length;i++)if(l=`${h} ${f[i]}`,c=Vi.measureTextWidth(l),c>t&&("number"!=typeof r||r>s.length)?(s.push(h),h=f[i]):h=l,"number"==typeof r&&s.length>=r){u=f.slice(i+1).join(" ");break}"number"!=typeof r||s.length<r?s.push(h):s[Math.max(0,s.length-1)]=`${s[Math.max(0,s.length-1)]||""} ${h} ${u}`}return s},wordWrap(e,t,n,r,i){if($i(),!e||!e.length)return[];n&&(ji.font=n);let o=[];const a=e.slice();let s,l,c,u;if(a.filter(e=>!!e),"number"!=typeof t||t<0)return e.slice();for(u=0;u<a.length;u++)c=a[u],l=null,c&&(c.length<=1||Vi.measureTextWidth(c)<=t?o.push(c):(s=Vi.splitWord(c,t,void 0,r-o.length),s.length<=1?o.push(s[0]):(l=s.pop(),o=o.concat(s),a[u+1]?Vi.measureTextWidth(`${l} ${a[u+1]}`)>t&&o.length+a.length-u<=r?a.splice(u+1,0,l):a[u+1]=`${l} ${a[u+1]}`:a.push(l))));return o.forEach((e,t,n)=>{n[t]=e?e.trim():e}),o.length>r?(o=o.splice(0,r),o[o.length-1]=Vi.truncate(o[o.length-1],t,n,i).text):(c=o[o.length-1],c&&c.length>1&&Vi.measureTextWidth(c)>t&&(o[o.length-1]=Vi.truncate(c,t,n,i).text)),o},truncate(e,t,n,r="…"){$i();let i,o,a,s,l=e;const c=Vi.measureTextWidth("i"),u=Math.ceil(t/c);if(n&&(ji.font=n),e&&t){if(Vi.measureTextWidth(l)>t){for(i=Math.min(u,l.length);i>0;i--)if(o=l.substring(0,i-1),a=o.trim()+r,Vi.measureTextWidth(a)<=t){s=l.substring(i-1),l=a;break}i||(s=l,l="…")}}else s=void 0;return{text:l,rest:s}},isNumber:e=>"number"==typeof e&&Number.isFinite(e),explodeWord(e,t,n,r){let i;$i();let o,a=e,s="",l=[];if(Vi.isNumber(n)&&n<=1)return[e];const c=Math.ceil(t/r);for(i=Math.min(e.length,c);i>0&&(a=e.substring(0,i),o=e.substring(i-1,i)," "===o?a=e.substring(0,i-1):a+="-",s=e.substring(i),!(Vi.measureTextWidth(a)<=t));i--);return(!i&&!a||Vi.measureTextWidth(a)>t)&&(a=e.substring(0,1),s=e.substring(1)),l.push(a),s?(Vi.measureTextWidth(s)>t?(s=Vi.explodeWord(s,t,n-1,r),l=l.concat(s)):l.push(s),l.filter(e=>""!==e.trim())):l},splitWord:(e,t,n,r)=>($i(),e&&t?(n&&(ji.font=n),Vi.explodeWord(e,t,r,Math.max(1,Vi.measureTextWidth("i")))):[]),wrapText(e,t,n,r,i){let o;return Number.isNaN(t)?[e]:(o=r>1?Vi.lineWrap(e,t,n,r):[e],o=Vi.wordWrap(o,t,n,r,i),o)},getFontHeight:e=>($i(),e&&(ji.font=e),1.5*Vi.measureTextWidth("m")),tokenize(e,t,n,r,i,o,a=1){$i(),t&&(ji.font=t);const s=Vi.getFontHeight(),l=a*s;let c=[],u=0,d=[];if(o<s)return[];const f=o?Math.max(1,Math.floor(o/l)):r||1;return Array.isArray(r)?(r.forEach(e=>{u+=Number.isNaN(e)||e<=0?0:e}),r.forEach(e=>{c.push(Number.isNaN(e)||e<=0?f-u:e)})):c=[Number.isNaN(r)||r<=0?f:Math.min(f,r)],Array.isArray(e)?e.forEach((e,n)=>{d.length<f&&(d=d.concat(Vi.wrapText(e,i,t,c[n])))}):d=Vi.wrapText(e,i,t,c[0],n),d}},Ui={getDefaultSettings:({size:e=10,fill:t="#999",alignment:n}={})=>({show:!0,type:"n-polygon",fill:t,stroke:"#000",strokeWidth:0,size:e,sides:3,startAngle:-90,alignment:n}),createOob({oob:e,dockValue:t,boxCenter:n,rendWidth:r,rendHeight:i,flipXY:o,symbol:a}){let s="x",c="y",u=r,d=i,f=t<.5?90:-90;return o&&(s="y",c="x",u=i,d=r,f=t<.5?180:0),a(l({},e,{[s]:n*u,[c]:Math.max(e.size/2,Math.min(t*d,d-e.size/2)),startAngle:f}))}},Hi=l.bind(null,!0),Bi={},{isArray:Wi}=Array;function Yi(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}function Gi(e){return void 0===e}function Ki(e,t){return function(e){return"function"==typeof e}(e[t])||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function Xi(e,t){const n=t.substring(1).split("/").slice(0,-1);let r;return n.forEach((t,i)=>{if(i===n.length)return;r=+t;const o=isNaN(r)?{}:[];e[r||t]=Gi(e[r||t])?o:e[t],e=e[r||t]}),e}function Ji(e,t){return t?Object.keys(e).filter(t=>void 0!==e[t]).length:Object.keys(e).length}function Zi(e,t,n){let r=!0;if(Yi(e)&&Yi(t))return Ji(e,n)===Ji(t,n)&&(Object.keys(e).forEach(i=>{Zi(e[i],t[i],n)||(r=!1)}),r);if(Wi(e)&&Wi(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r+=1)if(!Zi(e[r],t[r],n))return!1;return!0}return e===t}Bi.compare=Zi,Bi.generate=function(e,t,n){n=n||"";let r=[];return Object.keys(t).forEach(i=>{const o=function(e){return e?Hi({},{val:e}).val:e}(t[i]),a=e[i],s=`${n}/${i}`;Zi(o,a)||Ki(t,i)||(Gi(a)?r.push({op:"add",path:s,value:o}):Yi(o)&&Yi(a)?r=r.concat(Bi.generate(a,o,s)):Wi(o)&&Wi(a)?r=r.concat(function(e,t,n){let r=[];const i=e.slice();let o=-1;function a(e,t,n){if(e[n]&&Gi(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(let n=0,r=e.length;n<r;n+=1)if(e[n]&&e[n].qInfo.qId===t)return n;return-1}if(Zi(t,i))return r;if(!Gi(t[0])&&Gi(t[0].qInfo)||0===t.length)return r.push({op:"replace",path:n,value:t}),r;for(let e=i.length-1;e>=0;e-=1)o=a(t,i[e].qInfo&&i[e].qInfo.qId,e),-1===o?(r.push({op:"remove",path:`${n}/${e}`}),i.splice(e,1)):r=r.concat(Bi.generate(i[e],t[o],`${n}/${e}`));for(let e=0,s=t.length;e<s;e+=1)o=a(i,t[e].qInfo&&t[e].qInfo.qId),-1===o?(r.push({op:"add",path:`${n}/${e}`,value:t[e]}),i.splice(e,0,t[e])):o!==e&&(r.push({op:"move",path:`${n}/${e}`,from:`${n}/${o}`}),i.splice(e,0,i.splice(o,1)[0]));return r}(a,o,s)):r.push({op:"replace",path:`${n}/${i}`,value:o}))}),Object.keys(e).forEach(i=>{Gi(t[i])&&!Ki(e,i)&&r.push({op:"remove",path:`${n}/${i}`})}),r},Bi.apply=function(e,t){t.forEach(t=>{let n=Xi(e,t.path),r=t.path.split("/").splice(-1)[0],i=r&&isNaN(+r)?n[r]:n[+r]||n;const o=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(n=null,i=e),"add"===t.op||"replace"===t.op)if(Wi(n))"-"===r&&(r=n.length),n.splice(+r,"add"===t.op?0:1,t.value);else if(Wi(i)&&Wi(t.value)){const e=t.value.slice();i.length=0,i.push(...e)}else if(Yi(i)&&Yi(t.value))a=i,Object.keys(a).forEach(e=>{Object.getOwnPropertyDescriptor(a,e).configurable&&!Ki(a,e)&&delete a[e]}),Hi(i,t.value);else{if(!n)throw new Error("Patchee is not an object we can patch");n[r]=t.value}else if("move"===t.op){const i=Xi(e,t.from);Wi(n)?n.splice(+r,0,i.splice(+o,1)[0]):(n[r]=i[o],delete i[o])}else"remove"===t.op&&(Wi(n)?n.splice(+r,1):delete n[r]);var a})},Bi.clone=function(e){return Hi({},e)},Bi.createPatch=function(e,t,n){const r={op:e.toLowerCase(),path:n};return"move"===r.op?r.from=t:void 0!==t&&(r.value=t),r},Bi.updateObject=function(e,t){Object.keys(e).length?Bi.apply(e,Bi.generate(e,t)):Hi(e,t)};const Qi=Math.log(10);function eo(e){return 10**e}const to={pow10:eo,log:(e,t)=>e<=0||t<=0?NaN:Math.log(e)/Math.log(t),log10:e=>e<=0?NaN:Math.log(e)/Qi,eliminateFloatingError(e){const t=Math.round(e);return Math.abs(e-t)<1e-12?t:e},getNiceNumber(e){let t;if(0===e)return 0;const n=Math.floor(Math.log(Math.abs(e))/Qi),r=e/eo(n);return t=r<=1?1:r<=2?2:r<=5?5:10,t*eo(n)*(e<0?-1:1)},getSmallNiceNumber(e){let t,n;if(0===e)return 0;t=Math.floor(Math.log(Math.abs(e))/Qi);const r=e/eo(t);return r<1?(n=5,t--):n=r<2?1:r<5?2:5,n*eo(t)*(e<0?-1:1)},getMagnitude(e){if(0===e)return 0;return eo(Math.floor(Math.log(Math.abs(e))/Qi))},getFraction(e){if(0===e)return 0;return e/eo(Math.floor(Math.log(Math.abs(e))/Qi))},getGoodNumber(e){let t;if(0===e)return 0;const n=Math.floor(Math.log(Math.abs(e))/Qi),r=e/eo(n);return t=Math.ceil(r),7!==t&&9!==t||t++,r>1&&r<=1.5?t=1.5:r>2&&r<=2.5&&(t=2.5),t*eo(n)*(e<0?-1:1)},getValueWithOffset:(e,t=0)=>e+Math.abs(e)*t,isNumber:e=>"number"==typeof e&&!Number.isNaN(e)};function no(e){0===e.max&&(e.max=0),0===e.min&&(e.min=0),0===e.tickBaseValue&&(e.tickBaseValue=0)}function ro(e){let t;const n=0===e.explicitMax?1:to.getMagnitude(e.explicitMax),r=e.explicitMax;t=e.maxNumIntervals<2?r-n:r-2*n,t=Math.ceil(t/n)*n;const i=r-t;e.tickDataSpacing=Math.max(i/e.maxNumIntervals,e.minTickDataSpacing),e.tickSpacing=Math.max(n/10,to.getNiceNumber(e.tickDataSpacing)),e.max=r,e.min=t,e.range=i,e.maxNumIntervals<1&&(e.tickBaseValue=e.min)}function io(e){let t;const n=0===e.explicitMin?1:to.getMagnitude(e.explicitMin),r=e.explicitMin;t=e.maxNumIntervals<2?r+n:r+2*n,t=Math.floor(t/n)*n;const i=t-r;e.tickDataSpacing=Math.max(i/e.maxNumIntervals,e.minTickDataSpacing),e.tickSpacing=Math.max(n/10,to.getNiceNumber(e.tickDataSpacing)),e.max=t,e.min=r,e.range=i,e.maxNumIntervals<1&&(e.tickBaseValue=e.max-e.tickSpacing)}function oo(e){if(0===e.usedDataMax)e.maxNumIntervals<2?(e.min=0,e.max=1):(e.min=-1,e.max=1),e.range=e.max-e.min,e.tickDataSpacing=Math.max(e.range/e.maxNumIntervals,e.minTickDataSpacing),e.tickSpacing=Math.max(.1,to.getNiceNumber(e.tickDataSpacing)),e.tickMinIndex=Math.ceil(e.min/e.tickSpacing),e.tickMaxIndex=Math.floor(e.max/e.tickSpacing);else{const t=function(e,t){const n=to.getMagnitude(e),r=e/n,i=Math.floor(r),o=Math.round(r);let a,s,l=0;return t<2?(a=i*n,s=(i+1)*n,t<1&&(l=a)):(a=(o-1)*n,s=(o+1)*n),{min:a,max:s,tickBaseValue:l,magnitude:n}}(Math.abs(e.usedDataMax),e.maxNumIntervals);e.usedDataMax>0?(e.max=t.max,e.min=t.min,e.tickBaseValue=t.tickBaseValue):(e.max=-t.min,e.min=-t.max,e.tickBaseValue=-t.tickBaseValue),e.range=e.max-e.min,e.tickDataSpacing=Math.max(e.range/e.maxNumIntervals,e.minTickDataSpacing),e.tickSpacing=Math.max(t.magnitude/10,to.getNiceNumber(e.tickDataSpacing)),e.tickMinIndex=Math.floor((e.min-e.tickBaseValue)/e.tickSpacing),e.tickMaxIndex=Math.floor((e.max-e.tickBaseValue)/e.tickSpacing)}}function ao(e){null!==e.explicitMin&&null!==e.explicitMax?function(e){e.tickBaseValue=e.usedDataMin,e.min=e.usedDataMin,e.max=e.usedDataMin,e.range=0,e.tickSpacing=0===e.usedDataMin?1:Math.abs(e.usedDataMin),e.tickDataSpacing=e.tickSpacing,e.tickMinIndex=0,e.tickMaxIndex=0}(e):null===e.explicitMin&&null===e.explicitMax?oo(e):null===e.explicitMin&&null!==e.explicitMax?function(e){0===e.explicitMax?(e.max=0,e.min=-1,e.range=e.max-e.min,e.tickSpacing=Math.max(.1,to.getNiceNumber(e.range/e.maxNumIntervals))):ro(e)}(e):function(e){0===e.explicitMin?(e.max=1,e.min=0,e.range=e.max-e.min,e.tickSpacing=Math.max(.1,to.getNiceNumber(e.range/e.maxNumIntervals))):io(e)}(e)}function so({tickModel:e,minIsStrict:t,maxIsStrict:n}){void 0===t&&(t=null!==e.explicitMin),void 0===n&&(n=null!==e.explicitMax),e.tickMinIndex=t?Math.ceil(e.usedDataMin/e.tickSpacing):Math.floor(e.usedDataMin/e.tickSpacing),e.tickMaxIndex=n?Math.floor(e.usedDataMax/e.tickSpacing):Math.ceil(e.usedDataMax/e.tickSpacing),e.min=t?e.usedDataMin:e.tickMinIndex*e.tickSpacing,e.max=n?e.usedDataMax:e.tickMaxIndex*e.tickSpacing,e.range=e.max-e.min}function lo({tickModel:e,minIsStrict:t,maxIsStrict:n,usingGoodNumber:r}){e.tickSpacing=r?to.getGoodNumber(e.tickDataSpacing):to.getNiceNumber(e.tickDataSpacing),so({tickModel:e,minIsStrict:t,maxIsStrict:n})}function co(e){let t,n;lo({tickModel:e});const r=e.tickMaxIndex-e.tickMinIndex;if(t=(e.plotMaxCanBeTuned?e.usedDataMax:e.max)-(e.plotMinCanBeTuned?e.usedDataMin:e.min),e.spaceUseFactor=t/e.range,n=e.size*e.tickSpacing/e.range<e.minTickSpacingInPixel||e.spaceOptimizingEnabled&&e.spaceUseFactor<e.spaceUseLimit,n&&e.maxNumIntervals>=5){for(;e.tickDataSpacing<=e.absMax&&n;)e.tickDataSpacing=Math.max(1.1*e.tickSpacing,e.minTickDataSpacing),lo({tickModel:e}),t=(e.plotMaxCanBeTuned?e.usedDataMax:e.max)-(e.plotMinCanBeTuned?e.usedDataMin:e.min),e.spaceUseFactor=t/e.range,n=e.size*e.tickSpacing/e.range<e.minTickSpacingInPixel||e.spaceOptimizingEnabled&&e.spaceUseFactor<e.spaceUseLimit;if(!n)return}for(e.tickDataSpacing=Math.max(e.usedDataRange/e.maxNumIntervals,e.minTickDataSpacing),(n||r<=2&&e.maxNumIntervals>=2*r)&&lo({tickModel:e,usingGoodNumber:!0}),t=(e.plotMaxCanBeTuned?e.usedDataMax:e.max)-(e.plotMinCanBeTuned?e.usedDataMin:e.min),e.spaceUseFactor=t/e.range,n=e.size*e.tickSpacing/e.range<e.minTickSpacingInPixel||e.spaceOptimizingEnabled&&e.spaceUseFactor<e.spaceUseLimit;e.tickDataSpacing<=e.absMax&&n;)e.tickDataSpacing=Math.max(1.1*e.tickSpacing,e.minTickDataSpacing),lo({tickModel:e,usingGoodNumber:!0}),t=(e.plotMaxCanBeTuned?e.usedDataMax:e.max)-(e.plotMinCanBeTuned?e.usedDataMin:e.min),e.spaceUseFactor=t/e.range,n=e.size*e.tickSpacing/e.range<e.minTickSpacingInPixel||e.spaceOptimizingEnabled&&e.spaceUseFactor<e.spaceUseLimit}function uo({tickModel:e,useGoodNumber:t}){t?(e.tickSpacing=to.getGoodNumber(e.absMax),e.tickBaseValue=-e.tickSpacing,e.min=null===e.explicitMin?-e.tickSpacing:e.explicitMin,e.max=null===e.explicitMax?e.tickSpacing:e.explicitMax,e.tickMinIndex=null===e.explicitMin?0:1,e.tickMaxIndex=(e.explicitMax,1),e.tickSpacing*=2):(e.max=e.usedDataMax,e.min=e.usedDataMin,e.range=e.max-e.min,e.tickMinIndex=0,e.tickMaxIndex=0,e.tickSpacing=to.getNiceNumber(e.absMax),e.tickSpacing===e.absMax&&(e.tickSpacing=to.getNiceNumber(1.1*e.absMax)))}function fo(e){let t;e.tickSpacing=to.getNiceNumber(e.tickDataSpacing),e.min=e.usedDataMin,e.max=e.usedDataMax,e.range=e.max-e.min,e.tickMinIndex=0,e.tickMaxIndex=0,(e.usedDataMax<0||e.usedDataMin>0)&&(t=to.getSmallNiceNumber(e.range),e.tickBaseValue=Math.ceil(e.min/t)*t)}function ho(e){const t=e.usedDataMax>=-e.usedDataMin,n=t||null!==e.explicitMin,r=!t||null!==e.explicitMax;lo({tickModel:e,minIsStrict:n,maxIsStrict:r,usingGoodNumber:!0});const i=(e.absMax+(1-e.spaceUseLimit)*e.absMin)/e.spaceUseLimit*1.0001;for(;e.tickDataSpacing<=i&&e.size*e.tickSpacing/e.range<e.minTickSpacingInPixel;)e.tickDataSpacing=Math.max(1.1*e.tickSpacing,e.minTickDataSpacing),lo({tickModel:e,minIsStrict:n,maxIsStrict:r,usingGoodNumber:!0});const o=(e.plotMaxCanBeTuned?e.usedDataMax:e.max)-(e.plotMinCanBeTuned?e.usedDataMin:e.min);e.spaceUseFactor=o/e.range,e.spaceOptimizingEnabled&&e.spaceUseFactor<e.spaceUseLimit&&uo({tickModel:e})}function po(e){let t,n;if(e.values=[],e.secondaryValues=[],function(e){e.niceNumberEnabled&&e.max!==e.min&&0!==e.size?(e.minTickValue=e.tickBaseValue+e.tickMinIndex*e.tickSpacing,e.maxTickValue=e.tickBaseValue+e.tickMaxIndex*e.tickSpacing):(e.minTickValue=e.min,e.maxTickValue=e.max)}(e),0===e.size)return;if(!e.niceNumberEnabled){for(e.numIntervals=Math.floor(e.maxNumIntervals),e.tickDataSpacing=Math.max(e.usedDataRange/e.numIntervals,e.minTickDataSpacing),t=e.usedDataMin,n=0;n<=e.numIntervals;n++)e.values.push(t+n*e.tickDataSpacing);for(t=e.usedDataMin+e.tickDataSpacing/2,n=0;n<e.numIntervals;n++)e.secondaryValues.push(t+n*e.tickDataSpacing);return}t=e.tickBaseValue;const r=e.tickMaxIndex-e.tickMinIndex;if(r<1)e.values.push(t);else{for(n=0;n<=r;n++)e.values.push(t+(n+e.tickMinIndex)*e.tickSpacing);for(t=e.tickBaseValue+e.tickSpacing/2,n=0;n<r;n++)e.secondaryValues.push(t+(n+e.tickMinIndex)*e.tickSpacing)}}function mo(e){let t,n,r,i;const o=[.5],a=e.values[0];for(i=0;i<o.length;i++)if(t=a-e.tickSpacing*o[i],n=e.max-t,r=e.size*e.tickSpacing/n,r>3*e.fontHeight)return e.min=t,e.range=n,void e.values.splice(0,0,t)}function go(e){let t,n,r,i;const o=[.5],a=e.values[e.values.length-1];for(i=0;i<o.length;i++)if(t=a+e.tickSpacing*o[i],n=t-e.min,r=e.size*e.tickSpacing/n,r>3*e.fontHeight)return e.max=t,e.range=n,void e.values.push(t)}const yo={calculateTicks({size:e,dataMin:t,dataMax:n,explicitMin:r,explicitMax:i,minTickSpacingInPixel:o,fontHeight:a,niceNumberEnabled:s=!0,spaceOptimizingEnabled:l=!0,spaceUseLimit:c=.6,tickMinMaxCoverDataMinMax:u=!0,minTickDataSpacing:d}){let f,h=!1;Number.isNaN(+r)&&(r=null),Number.isNaN(+i)&&(i=null),t>n&&(f=t,t=n,n=f),null!==r&&null!==i&&r>i&&(f=r,r=i,i=f),d=d||0;const p=null!==r,m=null!==i,g=p?r:t,y=m?i:n,v=y-g,b=e/o,x=b+1,S=Math.max(v/b,d),M={size:e,dataMin:t,dataMax:n,explicitMin:r,explicitMax:i,minIsStrict:p,maxIsStrict:m,usedDataMin:g,usedDataMax:y,usedDataRange:v,minTickDataSpacing:d,minTickSpacingInPixel:o,maxNumIntervals:b,maxNumTicks:x,tickDataSpacing:S,fontHeight:a,niceNumberEnabled:s,spaceOptimizingEnabled:l,tickBaseValue:0};return M.absMax=Math.max(Math.abs(y),Math.abs(g)),M.absMin=Math.min(Math.abs(y),Math.abs(g)),M.spaceUseLimit=c,M.plotMaxCanBeTuned=null===i&&y>0,M.plotMinCanBeTuned=null===r&&g<0,s&&0!==e?(null!==M.explicitMax&&M.explicitMax<M.usedDataMin||null!==M.explicitMin&&M.explicitMin>M.usedDataMax?(h=!0,function(e){null!==e.explicitMax&&e.explicitMax<e.usedDataMin?ro(e):null!==e.explicitMin&&e.explicitMin>e.usedDataMax&&io(e)}(M)):0===M.usedDataRange?ao(M):M.maxNumIntervals<1?fo(M):(M.usedDataMax>0&&M.usedDataMin<0?1===M.maxNumIntervals?uo({tickModel:M,useGoodNumber:!0}):M.maxNumIntervals>=5?co(M):M.maxNumIntervals<2?ho(M):function(e){co(e);const t=(e.plotMaxCanBeTuned?e.usedDataMax:e.max)-(e.plotMinCanBeTuned?e.usedDataMin:e.min);e.spaceUseFactor=t/e.range,e.spaceOptimizingEnabled&&e.spaceUseFactor<e.spaceUseLimit&&(e.tickDataSpacing=Math.max(e.usedDataRange/e.maxNumIntervals,e.minTickDataSpacing),ho(e))}(M):co(M),M.tickMaxIndex<M.tickMinIndex?(M.tickDataSpacing=Math.max(M.usedDataRange/M.maxNumIntervals,M.minTickDataSpacing),fo(M)):function(e){const t=to.getNiceNumber(e.tickSpacing);if(e.tickSpacing===t||0!==e.tickBaseValue)return;const n=e.tickSpacing,r=e.tickMinIndex,i=e.tickMaxIndex,o=i-r,a=e.min,s=e.max;e.tickSpacing=t,so({tickModel:e});const l=(e.plotMaxCanBeTuned?e.usedDataMax:e.max)-(e.plotMinCanBeTuned?e.usedDataMin:e.min);e.spaceUseFactor=l/e.range;const c=e.size*e.tickSpacing/e.range<e.minTickSpacingInPixel||e.spaceOptimizingEnabled&&e.spaceUseFactor<e.spaceUseLimit,u=e.tickMaxIndex-e.tickMinIndex;!c&&(u===o||u>=10||u>=3&&1.5*u>=o)||(e.tickSpacing=n,e.tickMinIndex=r,e.tickMaxIndex=i,e.min=a,e.max=s,e.range=e.max-e.min)}(M)),po(M),u&&M.maxNumIntervals>=1&&!h&&(function(e){const t=e.min,n=e.max,r=e.tickMinIndex,i=e.tickMaxIndex,o=e.tickSpacing,a=e.tickMaxIndex-e.tickMinIndex,s=2*e.fontHeight,l=e.values?e.values.length:0,c=e.values[0],u=e.values[l-1];let d,f,h=!0,p=a;if(null===e.explicitMin&&c>e.dataMin&&p++,null===e.explicitMax&&u<e.dataMax&&p++,p!==a){for(f=0;h&&f<10;)e.tickSpacing=to.getSmallNiceNumber(.99*e.tickSpacing),so({tickModel:e}),d=e.tickMaxIndex-e.tickMinIndex,d>p&&(h=!1),f++;for(h=!0,f=0;e.tickSpacing<o&&h&&f<10;)e.tickSpacing=to.getGoodNumber(1.1*e.tickSpacing),so({tickModel:e}),d=e.tickMaxIndex-e.tickMinIndex,d===p&&e.size*e.tickSpacing/e.range>s&&(h=!1),f++;h?(e.min=t,e.max=n,e.tickMinIndex=r,e.tickMaxIndex=i,e.tickSpacing=o):po(e)}}(M),function(e){const t=e.values?e.values.length:0,n=e.values[0],r=e.values[t-1];null===e.explicitMin&&n>e.dataMin&&null===e.explicitMax&&r<e.dataMax?Math.abs(e.dataMin)<=Math.abs(e.dataMax)?(mo(e),go(e)):(go(e),mo(e)):null===e.explicitMin&&n>e.dataMin?mo(e):null===e.explicitMax&&r<e.dataMax&&go(e)}(M)),no(M),M):(M.min=g,M.max=y,M.tickSpacing=S,po(M),no(M),M)}},vo=Math.log(10),bo=1e-12,xo=Math.log(3)/vo,So=[[2,4,6],[2,4],[3]],Mo=[,[,,[[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]]]],wo=[,[,,[1,2],[1,3],[1,4],[1,5,1,6],[1,6],[1,10,1,8,1,7],[1,8,1,10],[1,10,1,9]],[,,,[2,3],[2,4],[2,6,2,5],[2,6,2,8],[2,8,2,7],[2,8,1,10],[1,10,2,10,2,9],[1,10,2,10]],[,,,,[3,4,2,4],[3,6,3,5],[3,6,2,6],[2,8,3,8,3,7],[2,8,3,8,3,9],[2,10,3,10,3,9]],[,,,,,[4,5,4,6,3,5],[4,6],[4,8,4,7],[4,8],[4,10,4,9,3,9],[4,10]],[,,,,,[5,6,4,6],[5,7,4,8],[4,8,5,8,5,10],[5,10,4,10,5,9],[5,10,4,10]],[,,,,,,[6,7,6,8],[6,8],[6,10,5,10,6,9],[6,10,5,10]],[,,,,,,,[7,8,6,8],[7,9,6,10],[6,10,7,10]],[,,,,,,,,[8,10,8,9],[8,10]],[,,,,,,,,,[9,10]]];function ko(e,t,n){const r=e?e.length:0;let i,o=void 0===t?Number.MAX_VALUE:e[0]/t;for(i=1;i<r;i++)o=Math.min(o,e[i]/e[i-1]);void 0!==n&&(o=Math.min(o,n/e[r-1])),e.splice(0,0,o)}function Eo(e,t,n){let r;const i=e?e.length:0;for(r=0;r<i;r++)ko(e[r],t,n)}function Co(e){let t,n,r,i,o,a,s=!0,l=0;t=e.tickDataSpacingLog;for(;s&&l<5;)t=0===l?Math.ceil(e.tickDataSpacingLog):Math.ceil(1.01*t),n=e.minIsStrict?Math.ceil(e.usedDataMinLog/t):Math.floor(e.usedDataMinLog/t),r=e.maxIsStrict?Math.floor(e.usedDataMaxLog/t):Math.ceil(e.usedDataMaxLog/t),i=e.minIsStrict?e.explicitPlotMinLog:n*t,o=e.maxIsStrict?e.explicitPlotMaxLog:r*t,a=o-i,s=t/a*e.size<e.minTickSpacingInPixel,l++;return s&&(t=Math.ceil(e.tickDataSpacingLog),n=e.minIsStrict?Math.ceil(e.usedDataMinLog/t):Math.floor(e.usedDataMinLog/t),r=e.maxIsStrict?Math.floor(e.usedDataMaxLog/t):Math.ceil(e.usedDataMaxLog/t),i=e.minIsStrict?e.explicitPlotMinLog:n*t,o=e.maxIsStrict?e.explicitPlotMaxLog:r*t),{plotMinLog:i,plotMaxLog:o,tickMinIndex:n,tickMaxIndex:r,tickDataSpacingNNLog:t,tickBaseValueLog:0,success:!s}}function No(e){const t=function(e){let t,n,r,i,o,a,s=!0,l=0;t=e.tickDataSpacingLog,n=0;const c=e.usedDataMinLogFloor;for(;s&&l<5;)t=0===l?Math.ceil(e.tickDataSpacingLog):Math.ceil(1.01*t),n=e.minIsStrict?Math.ceil((e.usedDataMinLog-c)/t):Math.floor((e.usedDataMinLog-c)/t),r=e.maxIsStrict?Math.floor((e.usedDataMaxLog-c)/t):Math.ceil((e.usedDataMaxLog-c)/t),i=e.minIsStrict?e.explicitPlotMinLog:n*t+c,o=e.maxIsStrict?e.explicitPlotMaxLog:r*t+c,a=o-i,s=t/a*e.size<e.minTickSpacingInPixel,l++;return s&&(t=0===l?Math.ceil(e.tickDataSpacingLog):Math.ceil(1.01*t),n=e.minIsStrict?Math.ceil((e.usedDataMinLog-c)/t):Math.floor((e.usedDataMinLog-c)/t),r=e.maxIsStrict?Math.floor((e.usedDataMaxLog-c)/t):Math.ceil((e.usedDataMaxLog-c)/t),i=e.minIsStrict?e.explicitPlotMinLog:n*t+c,o=e.maxIsStrict?e.explicitPlotMaxLog:r*t+c),{plotMinLog:i,plotMaxLog:o,tickMinIndex:n,tickMaxIndex:r,tickDataSpacingNNLog:t,tickBaseValueLog:c,success:!s}}(e);if(!t.success)return Co(e);const n=e.usedDataMaxLog-e.usedDataMinLog,r=n/(t.plotMaxLog-t.plotMinLog);if(1===r)return t;const i=Co(e);if(!i.success)return t;const o=n/(i.plotMaxLog-i.plotMinLog),a=i.tickMaxIndex-i.tickMinIndex,s=t.tickMaxIndex-t.tickMinIndex;return s>a||s===a&&r>o||s===a&&r===o&&t.plotMinLog<i.plotMinLog?t:i}function To(e,t,n,r,i){const o=to.getNiceNumber(1.1*i),a=e?Math.ceil(n/o):Math.floor(n/o),s=t?Math.floor(r/o):Math.ceil(r/o);return{min:e||0===a?n:a*o,max:t?r:s*o,tickSpacing:o,tickBaseValue:0}}function Do(e,t,n,r,i){let o,a;o=function(e,t){let n;for(n=0;n<e.length;n++)if(e[n]>=t)return n-1;return null}(e,t),a=function(e,t){let n;for(n=e.length-1;n>=0;n--)if(e[n]<=t)return n+1;return null}(e,n),null!==o&&!r&&void 0!==e[o+1]&&e[o+1]>t&&(o-=1),null!==a&&!i&&a>0&&void 0!==e[a-1]&&e[a-1]<n&&(a+=1),null!==a&&a<e.length&&e.splice(a,e.length-a),null!==o&&o>=0&&e.splice(0,o+1)}function qo(e,t,n,r,i){let o,a=Number.MAX_VALUE,s=-Number.MAX_VALUE;const l=to.log10(r),c=to.log10(n),u=l-c,d=t.map(to.log10),f=t?t.length:0;(null===i||Number.isNaN(+i))&&(i=1.71);for(let e=1;e<f;e++)o=d[e]-d[e-1],a=Math.min(a,o),s=Math.max(s,o);return s=Math.max(s,Math.abs(d[0]-c)),s=Math.max(s,Math.abs(l-d[f-1])),a/u*e.size>=e.minTickSpacingInPixel-bo&&s/a<=i&&t.length-1<=e.maxNumIntervals}function Oo(e,t){let n,r=Number.MAX_VALUE,i=-Number.MAX_VALUE;const{values:o}=t,a=o.map(to.log10),s=o?o.length:0;for(let e=1;e<s;e++)n=a[e]-a[e-1],r=Math.min(r,n),i=Math.max(i,n);t.maxTickSpacing=i,t.minTickSpacing=r,t.tickSpacingRatio=i/r,t.spaceUseFactor=e.usedDataRange/(t.max-t.min),t.factor=t.spaceUseFactor/(t.tickSpacingRatio*t.tickSpacingRatio)}function Io(e,t,n,r,i){let o,a,s,l;const c=(r+n)/2;return void 0===i?(o=Math.round(c),o>=n&&o<=r?to.pow10(o):(a=Math.floor(c),a>=n&&a<=r?to.pow10(a):(s=Math.ceil(c),s>=n&&s<=r?to.pow10(s):(l=to.getSmallNiceNumber(Math.max(1,t-e)),Math.ceil(e/l)*l)))):(a=to.pow10(Math.floor(c)),s=to.pow10(Math.ceil(c)),Math.abs(a-i)<Math.abs(s-i)?a:s)}function Ao(e,t,n,r,i,o){const a=i?Math.ceil((e-n)/r):Math.floor((e-n)/r),s=o?Math.floor((t-n)/r):Math.ceil((t-n)/r);let l,c;const u=[];for(l=a;l<=s;l++)c=l*r+n,c>0&&u.push(l*r+n);return u}function _o(e){e.sort((e,t)=>e-t)}function Lo(e,t,n,r){const i=t.length;let o;if(r){for(o=i-1;o>=0;o--)if(Math.abs(t[o]-n[o]*e.dataMinMagnitude)>bo)return!1;return!0}for(o=0;o<i;o++)if(Math.abs(t[o]-n[o]*e.dataMinMagnitude)>bo)return!1;return!0}function Po(e){let t,n,r,i={};if(e.maxIsStrict&&e.explicitMax<=e.usedDataMin?(e.dataMinLog=Math.ceil(e.explicitPlotMaxLog-(e.maxNumIntervals<2?1:2)),e.dataMin=to.pow10(e.dataMinLog)):e.minIsStrict&&e.explicitMin>=e.usedDataMax?(e.dataMaxLog=Math.floor(e.explicitPlotMinLog+(e.maxNumIntervals<2?1:2)),e.dataMax=to.pow10(e.dataMaxLog)):e.usedDataMin===e.usedDataMax&&(t=e.usedDataMin,e.dataMinLog=Math.floor(e.dataMinLog),e.dataMaxLog=e.dataMinLog+1,e.dataMin=to.pow10(e.dataMinLog),e.dataMax=to.pow10(e.dataMaxLog)),e.usedDataMin=e.minIsStrict?e.explicitMin:e.dataMin,e.usedDataMax=e.maxIsStrict?e.explicitMax:e.dataMax,e.usedDataMinLog=e.minIsStrict?e.explicitPlotMinLog:e.dataMinLog,e.usedDataMaxLog=e.maxIsStrict?e.explicitPlotMaxLog:e.dataMaxLog,e.maxNumIntervals<1)return{values:[Io(e.usedDataMin,e.usedDataMax,e.usedDataMinLog,e.usedDataMaxLog,t)],min:e.usedDataMin,max:e.usedDataMax};e.tickDataSpacingLog=(e.usedDataMaxLog-e.usedDataMinLog)/e.maxNumIntervals,e.usedDataMinLogFloor=Math.floor(e.usedDataMinLog),e.usedDataMaxLogFloor=Math.floor(e.usedDataMaxLog),e.dataMinMagnitude=to.pow10(e.usedDataMinLogFloor),e.fractionMinLog=e.usedDataMin/e.dataMinMagnitude,e.fractionMaxLog=e.usedDataMax/e.dataMinMagnitude;const o=Math.ceil(e.usedDataMaxLog);if(e.usedDataMinLog===e.usedDataMinLogFloor&&e.usedDataMaxLog===o&&e.maxNumIntervals>=2&&e.maxNumIntervals<3&&e.tickDataSpacingLog>1&&e.tickDataSpacingLog-Math.floor(e.tickDataSpacingLog)<xo){const t=Math.floor((e.usedDataMinLogFloor+o)/2);r=[to.pow10(e.usedDataMinLogFloor),3*to.pow10(t),to.pow10(o)],Do(r,e.usedDataMin,e.usedDataMax,e.minIsStrict,e.maxIsStrict);const n=e.minIsStrict?e.explicitMin:r[0],i=e.maxIsStrict?e.explicitMax:r[r.length-1];if(r.length>=2&&qo(e,r,n,i))return{values:r,min:n,max:i}}const a=No(e);if(!a.success)return{values:[Io(e.usedDataMin,e.usedDataMax,e.usedDataMinLog,e.usedDataMaxLog)],min:e.usedDataMin,max:e.usedDataMax};let{tickMinIndex:s,tickMaxIndex:l}=a;const{tickDataSpacingNNLog:c,tickBaseValueLog:u}=a;e.minIsStrict&&s--,e.maxIsStrict&&l++;const d=[];for(n=s;n<=l;n++)d.push(to.pow10(n*c+u));const f=to.pow10(e.tickDataSpacingLog),h=function(e){return e.usedDataMax>=10*e.usedDataMin?1:e.usedDataMaxLogFloor===e.usedDataMinLogFloor?e.maxIsStrict&&e.minIsStrict?2:3:1}(e);return 2===h?function(e,t,n){let r=!0;const i=Math.ceil(e.fractionMinLog),o=Math.floor(e.fractionMaxLog);let a,s,l=0;if(t[i]&&t[i][o]){const c=t[i][o],u=c.length;for(;l<u&&r;){if(n<=c[l][0]+bo&&c[l].length-2<=e.maxNumIntervals){for(s=[],a=1;a<c[l].length;a++)s.push(c[l][a]*e.dataMinMagnitude);r=!qo(e,s,e.usedDataMin,e.usedDataMax)}r&&l++}}return r&&(s=[Io(e.usedDataMin,e.usedDataMax,e.usedDataMinLog,e.usedDataMaxLog)]),{values:s,min:e.minIsStrict?e.explicitMin:s[0],max:e.maxIsStrict?e.explicitMax:s[s.length-1]}}(e,Mo,f):3===h?function(e,t,n){const r=e.minIsStrict?Math.ceil(e.fractionMinLog):Math.floor(e.fractionMinLog),i=e.maxIsStrict?Math.floor(e.fractionMaxLog):Math.ceil(e.fractionMaxLog);let o,a,s,l,c,u,d,f,h,p,m,g,y,v,b,x={};if(wo[r]&&wo[r][i])for(d=wo[r][i],f=Array.isArray(d)?d.length/2:0,x.values=[],o=0;o<f;o++)if(h=d[2*o],p=d[2*o+1],t[h]&&t[h][p])for(m=t[h][p],g=m.length,a=0;a<g;a++)if(y=n<=m[a][0]+bo&&m[a].length-2<=e.maxNumIntervals,v=m[a][1]*e.dataMinMagnitude,b=m[a][m[a].length-1]*e.dataMinMagnitude,y=e.minIsStrict?y&&v>=e.usedDataMin:y&&v<=e.usedDataMin,y=e.maxIsStrict?y&&b<=e.usedDataMax:y&&b>=e.usedDataMax,y){for(l=[],s=1;s<m[a].length;s++)l.push(m[a][s]*e.dataMinMagnitude);if(Do(l,e.usedDataMin,e.usedDataMax,e.minIsStrict,e.maxIsStrict),c=e.minIsStrict?e.explicitMin:l[0],u=e.maxIsStrict?e.explicitMax:l[l.length-1],qo(e,l,c,u)){x.values.length<l.length&&(x={values:l,min:c,max:u});break}}x.values&&0!==x.values.length||(x.values=[Io(e.usedDataMin,e.usedDataMax,e.usedDataMinLog,e.usedDataMaxLog)]);const S=x.values;return x.min=e.minIsStrict?e.explicitMin:S[0],x.max=e.maxIsStrict?e.explicitMax:S[S.length-1],x}(e,Mo,f):(i=function(e,t,n,r,i,o,a,s){let l,c,u,d,f,h=0;const p=[];for(h=0;h<t.length;h++)if(n<=t[h][0]+bo){for(u=r.concat(),l=i;l<o;l++)for(c=1;c<t[h].length;c++)u.push(t[h][c]*to.pow10(l*a+s));_o(u),Do(u,e.usedDataMin,e.usedDataMax,e.minIsStrict,e.maxIsStrict),d=e.minIsStrict?e.explicitMin:u[0],f=e.maxIsStrict?e.explicitMax:u[u.length-1],qo(e,u,d,f)&&p.push({values:u,min:d,max:f})}if(0===p.length)return u=r,Do(u,e.usedDataMin,e.usedDataMax,e.minIsStrict,e.maxIsStrict),d=e.minIsStrict?e.explicitMin:u[0],f=e.maxIsStrict?e.explicitMax:u[u.length-1],{values:u,min:d,max:f};if(1===p.length)return p[0];const m=r.length-1;for(h=0;h<p.length;h++){const e=p[h].values.length-1;if(p[h].values[0]===r[0]&&p[h].values[e]===r[m])return p[h]}return p[0]}(e,So,f,d,s,l,c,u),function(e,t){const{values:n}=t,r=n.length;let i,o;if(!(r<2||r>4)){if(o=5*e.dataMinMagnitude,(e.minIsStrict&&e.usedDataMin<=o||!e.minIsStrict&&e.usedDataMin>=o)&&(Lo(e,n,[6,10,20,40])||Lo(e,n,[4,10,20,40])))return[i]=n,n[0]=o,t.min=e.minIsStrict?e.explicitMin:n[0],void(qo(e,n,t.min,t.max)||(n[0]=i,t.min=e.minIsStrict?e.explicitMin:n[0]));o=80*e.dataMinMagnitude,(e.maxIsStrict&&e.usedDataMax>=o||!e.maxIsStrict&&e.usedDataMax<=o)&&Lo(e,n,[10,20,40,60],!0)&&(i=n[r-1],n[r-1]=o,t.max=e.maxIsStrict?e.explicitMax:n[r-1],qo(e,n,t.min,t.max)||(n[r-1]=i,t.max=e.maxIsStrict?e.explicitMax:n[r-1]))}}(e,i),i)}!function(){let e,t;for(Eo(So,1,10),e=0;e<Mo.length;e++)if(Mo[e])for(t=0;t<Mo[e].length;t++)Array.isArray(Mo[e][t])&&Eo(Mo[e][t])}();const Ro={calculateTicksLogPositive({size:e,dataMin:t,dataMax:n,explicitMin:r,explicitMax:i,minTickSpacingInPixel:o,fontHeight:a,niceNumberEnabled:s,spaceOptimizingEnabled:l}){let c;Number.isNaN(+r)&&(r=null),Number.isNaN(+i)&&(i=null),t>n&&(c=t,t=n,n=c),null!==r&&null!==i&&r>i&&(c=r,r=i,i=c);const u=null!==r,d=null!==i,f=u?r:t,h=d?i:n,p=e/o,m={size:e,dataMin:t,dataMax:n,explicitMin:r,explicitMax:i,minIsStrict:u,maxIsStrict:d,usedDataMin:f,usedDataMax:h,usedDataRange:h-f,minTickSpacingInPixel:o,maxNumIntervals:p,maxNumTicks:p+1,fontHeight:a,niceNumberEnabled:s,spaceOptimizingEnabled:l};if(m.explicitPlotMinLog=m.minIsStrict?to.eliminateFloatingError(to.log10(r)):null,m.explicitPlotMaxLog=m.maxIsStrict?to.eliminateFloatingError(to.log10(i)):null,m.dataMinLog=to.eliminateFloatingError(to.log10(t)),m.dataMaxLog=to.eliminateFloatingError(to.log10(n)),!s||0===e)return function(e){e.min=e.usedDataMin,e.max=e.usedDataMax;const t=Math.floor(e.maxNumIntervals),n=(e.dataMaxLog-e.dataMinLog)/t,r=[e.usedDataMin];for(let i=0;i<t;i++)r.push(to.pow10(e.dataMinLog+(i+1)*n));return{values:r,min:e.min,max:e.max}}(m);if(m.minIsStrict&&m.maxIsStrict&&m.explicitMin===m.explicitMax)return{values:[m.explicitMin],min:m.explicitMin,max:m.explicitMax};const g=Po(m);if(m.usedDataMax>=10*m.usedDataMin)return g;const y=function(e){const{dataMin:t,dataMax:n,explicitMin:r,explicitMax:i,minIsStrict:o,maxIsStrict:a,usedDataMin:s,usedDataMax:l}=e;let c,u,d,f=yo.calculateTicks(e),h=1;0===f.min&&(f.min=o?r:t);let{values:p}=f;for(c=o?r:Math.min(t,p[0]),u=a?i:Math.max(p[p.length-1],n);!qo(e,p,c,u)&&h<=20;)f=To(o||f.tickSpacing>s,a,s,l,f.tickSpacing),p=Ao(s,l,f.tickBaseValue,f.tickSpacing,o,a),c=o?r:Math.min(t,p[0]),u=a?i:Math.max(p[p.length-1],n),h++;return qo(e,p,c,u)?(d=to.getFraction(p[0])/2,2===p.length&&p[1]/p[0]===2&&p[0]/2>=c&&d===Math.floor(d)&&(p.splice(0,0,p[0]/2),d=to.getFraction(p[0])/2,p[0]/2>=c&&d===Math.floor(d)&&p.splice(0,0,p[0]/2))):p=[],f.values=p,f.numLoops=h,f}(m);return y.values.length<2?g:g.values.length<2?y:y.values.length===g.values.length?(Oo(m,y),Oo(m,g),y.factor>g.factor?y:g):y.values.length-1>=1.5*(g.values.length-1)&&y.values.length>g.values.length?y:g},calculateTicks({size:e,dataMin:t,dataMax:n,explicitMin:r,explicitMax:i,minTickSpacingInPixel:o,fontHeight:a,niceNumberEnabled:s=!0,spaceOptimizingEnabled:l=!0}){let c,u,d,f,h,p,m;if(Number.isNaN(+r)&&(r=null),Number.isNaN(+i)&&(i=null),t>n&&(c=t,t=n,n=c),null!==r&&null!==i&&r>i&&(c=r,r=i,i=c),t*n<=0&&(t=null===r?t:r,n=null===i?n:i),t>0&&n>0&&(null===r||r>0)&&(null===i||i>0))return u=Ro.calculateTicksLogPositive({size:e,dataMin:t,dataMax:n,explicitMin:r,explicitMax:i,minTickSpacingInPixel:o,fontHeight:a,niceNumberEnabled:s,spaceOptimizingEnabled:l}),u.sign=1,u;if(t<0&&n<0&&(null===r||r<0)&&(null===i||i<0)){for(d=Ro.calculateTicksLogPositive({size:e,dataMin:-n,dataMax:-t,explicitMin:null===i?null:-i,explicitMax:null===r?null:-r,minTickSpacingInPixel:o,fontHeight:a,niceNumberEnabled:s,spaceOptimizingEnabled:l}),u={},u.min=-d.max,u.max=-d.min,h=d.values,p=h?h.length:0,f=new Array(p),m=0;m<p;m++)f[m]=-h[p-1-m];return u.values=f,u.sign=-1,u}return{values:[],min:null===r?t:r,max:null===i?n:i}}},Fo={isInside(e,t,n,r){if(!r)return!0;const i=e.position-e.radius,o=e.position+e.radius;return i>=t&&o<=n},getCenterDistance:(e,t)=>Math.abs(e.center-t.center),getGap(e,t){const n=e.position<t.position?e:t,r=e.position<t.position?t:e;return r.position-r.radius-(n.position+n.radius)},findSegmentPositionMeetMax(e,t){const n=Math.max(0,e.max-t);return e.center-n},findSegmentPositionMeetMin(e,t){const n=Math.max(0,t-e.min);return e.center+n},findSegmentPositionMeetMinThenMax(e,t,n){const r=Fo.findSegmentPositionMeetMin(e,t);return Fo.findSegmentPositionMeetMax({center:r,max:r+e.radius},n)},findSegmentPositionMeetMaxThenMin(e,t,n){const r=Fo.findSegmentPositionMeetMax(e,n);return Fo.findSegmentPositionMeetMin({center:r,min:r-e.radius},t)},layoutPositionFromMin(e,t,n,r=0){const i=e.length-1;let o,a,s=t;for(let t=0;t<i;t++)o=e[t],a=e[t+1],o.position=Fo.findSegmentPositionMeetMaxThenMin(o,s,(o.center+a.center-r)/2),s=o.position+o.radius+r/2;a.position=Fo.findSegmentPositionMeetMaxThenMin(a,s,n)},adjustPositionFromMax(e,t,n,r=0){const i=e.length-1;let o,a,s;const l=Math.max(0,e[i].position+e[i].radius-n);if(0===l)return;let c,u=0;for(o=i;o>0&&(a=e[o],s=e[o-1],c=Math.max(0,Fo.getGap(s,a)-r),c-=Math.max(0,u+c-l),u+=c,a.move=c,!(u>=l));o--);for(u<l&&(c=Math.max(0,s.position-s.radius-t),c-=Math.max(0,u+c-l),u+=c,s.move=c),u=0,o=0;o<=i;o++)a=e[o],u+=a.move||0,a.move=u,a.position-=u},layout(e,t,n,r=0){const i=e.length-1;if(!(i<0)){if(0===i){const r=e[0];return void(r.position=Fo.findSegmentPositionMeetMaxThenMin(r,t,n))}Fo.layoutPositionFromMin(e,t,n,r),Fo.adjustPositionFromMax(e,t,n,r)}}},zo=(e,t,n,r=1)=>{const i=e.bandwidth();return n?"start"===t?i:"end"===t?i*(1-r):i*(2-r)/2:"start"===t?0:"end"===t?i*r:i*r/2},jo=e=>!1!==e.show&&0!==e.show&&"0"!==e.show,$o=e=>e.filter(jo),Vo=(e,t)=>$o(y.getValue(e,t,[])),Uo=e=>jo(e)&&(!1!==e.showValue||!1!==e.showLabel),Ho=e=>e.filter(Uo),Bo=(e,t)=>Ho(y.getValue(e,t,[])),Wo=({refLineLayout:e,layoutService:t})=>t.meta.canBeContinuous?e.refLineExpr.value:e.refLineExpr.stringValue,Yo=(e,t,n)=>{const{dimensionRefLineInfo:r}=t;if(r[e])return r[e][n]},Go=({label:e,dataPages:t})=>{const{qArea:n={}}=t||{},{qTop:r,qHeight:i}=n;return void 0!==r&&void 0!==i&&void 0!==e.valueInfo&&e.valueInfo.maxOrder<r},Ko=({label:e,dataPages:t})=>{const{qArea:n={}}=t||{},{qTop:r,qHeight:i}=n;return void 0!==r&&void 0!==i&&void 0!==e.valueInfo&&e.valueInfo.minOrder>=r+i},Xo=({value:e,qMin:t})=>"NaN"!==t&&e<t,Jo=({value:e,qMax:t})=>"NaN"!==t&&e>t,Zo={isRefLineVisible:jo,getVisibleRefLines:$o,getRefLines:Vo,getMeasureRefLines:e=>Vo(e,"refLine.refLines"),getDimensionRefLines:(e,t)=>t?[]:Vo(e,"refLine.dimRefLines"),isRefLineLabelVisible:Uo,getVisibleRefLineLabels:Ho,getRefLineLabels:Bo,getMeasureRefLineLabels:e=>Bo(e,"refLine.refLines"),getDimensionRefLineLabels:(e,t)=>t?[]:Bo(e,"refLine.dimRefLines"),getScaledPosition:({scale:e,size:t,value:n,valueInfo:r,align:i,invert:o=!1,layoutService:a,isContinuous:s})=>{if(!s){const s=e.pxScale(t);let l;if(a.meta.isGroupedByMeasure)return l=zo(s,i,o,a.meta.groupSize??a.meta.measureCount),s([n,0])+l;if(a.meta.isGroupedByDimension){if(!r)return NaN;const{innerValues:e,numInnerValues:t,minOrder:a}=r;let c;return l=zo(s,i,o,t),e&&e.length&&(c=(({pxScale:e,value:t,innerValues:n,invert:r,minOrder:i})=>{const o=(({pxScale:e,invert:t})=>e.bandwidth()*(t?-1:1))({pxScale:e,invert:r});for(let r=0;r<n.length;r++){const{id:a,order:s}=n[r],l=e([t,a]);if(void 0!==l)return l-o*(s-i)}})({pxScale:s,value:n,innerValues:e,invert:o,minOrder:a})),(void 0===c?s(n):c)+l}return l=zo(s,i,o),s(n)+l}return e(n)},getDimensionValuesInfo:({layout:e,canBeContinuous:t,discreteModel:n,layoutService:r})=>{const{isGroupedByDimension:i}=r.meta,o={},a=y.getValue(e,"qHyperCube"),s="K"===a.qMode,l=n?n.query.getCurrentDataPage():y.getValue(a,"S"===a.qMode?"qDataPages.0":"qStackedDataPages.0",[]);if(void 0===l?.qArea?.qTop)return o;const c=s?"qData.0.qSubNodes":"qMatrix",u=y.getValue(l,c,[]),d=((e,t)=>e?t?"qValue":"qNum":"qText")(t,s),f=(e=>e.qArea.qTop)(l);return s?(()=>{for(let e=0;e<u.length;e++){const t=u[e],n=e+f,r=t[d];o[r]||(o[r]={id:t.qElemNo,qText:t.qText,minOrder:n,maxOrder:n,dataNode:u[e]})}})():i?(()=>{let e;for(let t=0;t<u.length;t++){const n=u[t][0],r=u[t][1],i=t+f,a=n[d];o[a]?(o[a].minOrder=Math.min(o[a].minOrder,i),o[a].maxOrder=Math.max(o[a].maxOrder,i),o[a].innerValues[o[a].innerValues.length]={id:r.qElemNumber,order:i}):o[a]={id:n.qElemNumber,qText:n.qText,minOrder:i,maxOrder:i,innerValues:[{id:r.qElemNumber,order:i}],dataNode:u[t]},0===t?0===i&&(o[a].isMinOrderOk=!0):a!==e&&(o[a].isMinOrderOk=!0,o[e].isMaxOrderOk=!0),e=a}})():(()=>{for(let e=0;e<u.length;e++){const t=u[e][0],n=e+f,r=t[d];o[r]||(o[r]={id:t.qElemNumber,qText:t.qText,minOrder:n,maxOrder:n,dataNode:u[e]})}})(),o},getInputValue:Wo,extractInfoFromInputValue:Yo,resolveValue:({refLineLayout:e,refLineModel:t,layoutService:n})=>{const r=Wo({refLineLayout:e,layoutService:n});return Yo(r,t,"id")},isDiscreteMinOutOfBounds:Go,isDiscreteMaxOutOfBounds:Ko,isContinuousMinOutOfBounds:Xo,isContinuousMaxOutOfBounds:Jo,isOutOfRange:({value:e,qMin:t,qMax:n})=>Xo({value:e,qMin:t})||Jo({value:e,qMax:n}),isOutOfDataPages:({label:e,dataPages:t})=>e.valueInfo.isMinOrderOk&&Ko({label:e,dataPages:t})||e.valueInfo.isMaxOrderOk&&Go({label:e,dataPages:t}),getInvert:({orientation:e,rtl:t,isContinuous:n})=>"horizontal"===e?t:n},Qo=({label:e,labelStyle:t})=>[e?.fontStyle||t?.fontStyle,e?.fontWeight||t?.fontWeight,e?.fontSize||t?.fontSize,e?.fontFamily||t?.fontFamily].filter(e=>!!e).join(" ");function ea(e){return e.showValue?`… ${e.valueString}`:"…"}function ta(e,t,n=70){for(let r=0;r<e.length;r++){const i=e[r],o=Qo({label:i,labelStyle:t});i.lines=Vi.tokenize(i.title,o,ea(i),3,n),i.maxNumLines=i.lines.length}}function na({title:e,font:t,ellipsis:n,maxNumLines:r=5,maxWidth:i=200}){const o=Vi.tokenize(e,t,n,r,i),a=o.length;let s="";if(a){[s]=o;for(let e=1;e<a;e++)s=`${s}\n${o[e]}`}return s}function ra({oobs:e,font:t,ellipsis:n,maxNumLines:r=5,maxWidth:i=200}){const o=e.map(e=>na({title:e.title,font:t,ellipsis:`${n} ${e.valueString}`,maxNumLines:r,maxWidth:i})),a=o.length;let s="";if(a){[s]=o;for(let e=1;e<a;e++)s=`${s}\n\n${o[e]}`}return s}function ia(e,t="value"){e.sort((e,n)=>e[t]-n[t])}const oa=3,aa=2;function sa({inputValue:e,inputValueLabel:t,localeInfo:n}){if(void 0===e||void 0===t||e.toString()===t)return!1;if(!n)return!0;const r=`+-${n.qDecimalSep||""}${n.qThousandSep||""}`.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&");return t.replace(new RegExp(`[0-9e${r}]`,"g"),"").length>0||function(e){if(e.indexOf("e")>-1)return!1;const t=e.indexOf("-");return-1!==t&&(e.lastIndexOf("-")!==t||0!==t)}(t)}const la=({label:e,dataPages:t,qMin:n,qMax:r})=>{if(void 0!==n&&void 0!==r){const{inputValue:t}=e;if(Zo.isContinuousMaxOutOfBounds({value:t,qMax:r}))return 1;if(Zo.isContinuousMinOutOfBounds({value:t,qMin:n}))return-1}return Zo.isDiscreteMaxOutOfBounds({label:e,dataPages:t})?1:Zo.isDiscreteMinOutOfBounds({label:e,dataPages:t})?-1:0},ca={hasEngineFormat:sa,calculateLabelPositions({labels:e,scale:t,size:n,layoutService:r,orientation:i,rtl:o,isContinuous:a,isDimension:s}){const l=Zo.getInvert({orientation:i,rtl:o,isContinuous:a}),c="S"===r.getHyperCubeValue("qMode")?"qDataPages.0":"qStackedDataPages.0",u=r.getHyperCubeValue(c),{canBeContinuous:d}=r.meta;let f,h;if(s&&d){const e=r.getLayoutValue("qHyperCube.qDimensionInfo.0");f=e.qMin,h=e.qMax}for(let i=0;i<e.length;i++){const o=e[i],{value:s,align:c,valueInfo:d}=o,p=la({label:o,dataPages:u,qMin:f,qMax:h});o.scaledValue=1===p?l?-.1:1.1:-1===p?l?1.1:-.1:Zo.getScaledPosition({scale:t,size:n,value:s,valueInfo:d,align:c,invert:l,layoutService:r,isContinuous:a}),o.center=o.scaledValue*n}},getTitle:e=>!1!==e.showValue?!1!==e.showLabel?`${e.text} ${e.valueString}`:e.valueString:!1!==e.showLabel?e.text:"",addLabelTitles({labels:e,formatter:t,isContinuous:n,canBeContinuous:r,localeInfo:i}){let o;if(n)for(let n=0;n<e.length;n++){const r=e[n],{value:a,inputValue:s,inputValueLabel:l}=r;o=sa({inputValue:s,inputValueLabel:l,localeInfo:i})?l:t?t(a):a,r.valueString=`${_.lrm}(${o})${_.lrm}`,r.title=ca.getTitle(r)}else if(r)for(let t=0;t<e.length;t++){const n=e[t],{valueText:r,inputValue:a,inputValueLabel:s}=n;o=sa({inputValue:a,inputValueLabel:s,localeInfo:i})?s:r,n.valueString=`${_.lrm}(${o})${_.lrm}`,n.title=ca.getTitle(n)}else for(let t=0;t<e.length;t++){const n=e[t];o=n.valueText,n.valueString=`${_.lrm}(${o})${_.lrm}`,n.title=ca.getTitle(n)}},measureLabelsWidth(e,t){for(let n=0;n<e.length;n++){const r=e[n];r.totalWidth=t(r.title,r).width}},measureLabelMaxLineWidth(e,t){const n=Math.max(...e.lines.map(n=>t(n,e).width));return n},getMaxTextWidth(e){const t=e.map(e=>e.totalWidth);return Math.max(...t)},addLabelsNeighborInfo(e,t,n,r=0){const i=e.length-1;if(i<0)return;let o,a;if([o]=e,o.cMin=t,0!==i){for(let t=0;t<i;t++)o=e[t],a=e[t+1],o.cMax=(o.center+a.center-r)/2,a.cMin=o.cMax+r;a.cMax=n}else o.cMax=n},getTotalNumLines(e){let t=0;return e.forEach(e=>{t+=e.maxNumLines}),t},reduceLabelsHavingMaxNumLines(e,t,n){const r=t-1,i=e.filter(e=>e.maxNumLines===t),o=Math.min(n,i.length);for(let e=i.length-1;e>=i.length-o;e--)i[e].maxNumLines=r},reduceTotalMaxNumLines(e,t,n){const r=Math.floor(n/t);let i=3;do{const t=ca.getTotalNumLines(e)-r;if(t<=0)return;ca.reduceLabelsHavingMaxNumLines(e,i,t),i--}while(i>1)},reduceMaxNumLines(e,t,n=0){for(let r=0;r<e.length;r++){const i=e[r];i.maxNumLines=Math.max(1,Math.min(i.maxNumLines,Math.floor((Math.max(0,i.cMax-i.cMin)+n)/t)))}},addLabelsSize(e,t,n=15,r){for(let i=0;i<e.length;i++){const o=e[i];o.width=Math.min(t,ca.measureLabelMaxLineWidth(o,r)),o.height=o.lines.length*n}},addLabelSegments(e,t){for(let n=0;n<e.length;n++){const r=e[n],{center:i}=r,o=r[t],a=o/2;r.segment={center:i,range:o,min:i-a,max:i+a,radius:a}}},addLabelsInfo({labels:e,scale:t,majorSize:n,lowerLimit:r,upperLimit:i,gap:o,labelStyle:a,maxLabelWidth:s,lineHeight:l,majorDimension:c,orientation:u,measureText:d,rtl:f,layoutService:h,isContinuous:p,isDimension:m}){const g=e.map(e=>e),y=n;ca.calculateLabelPositions({labels:e,scale:t,size:y,layoutService:h,orientation:u,rtl:f,isContinuous:p,isDimension:m}),ia(e,"center"),ca.addLabelsNeighborInfo(e,r,i,o),ta(e,a,s),ca.reduceTotalMaxNumLines(g,l,i-(g.length-1)*o),"vertical"===u&&(ca.reduceMaxNumLines(e,l,.05*o),function(e,t,n=70){for(let r=0;r<e.length;r++){const i=e[r],o=Qo({label:i,labelStyle:t});i.lines.length>i.maxNumLines&&(i.lines=Vi.tokenize(i.title,o,ea(i),i.maxNumLines,n))}}(e,a,s)),ca.addLabelsSize(e,s,l,d),ca.addLabelSegments(e,c)},createLabels({labels:e,style:t,maxLabelWidth:n,areaProps:r,area:i,lineHeight:o=15,font:a}){const{majorAxis:s,minorAxis:l,dock:c}=r,{minorCenter:u}=i,{fontSize:d,fontFamily:f,fontStyle:h,fontWeight:p,textDecoration:m,background:g}=t;let y=[];return e.forEach(e=>{const{lines:t}=e,r=t.length,i=t.map((t,i)=>{const g={type:"text",text:t,title:na({title:e.title,font:a,ellipsis:ea(e)}),dx:0,dy:0,maxWidth:n,width:n,fontSize:e.fontSize||d,fontFamily:e.fontFamily||f,fontStyle:e.fontStyle||h,fontWeight:e.fontWeight||p,textDecoration:e.textDecoration||m,fill:e.fill,baseline:"central",anchor:"middle",value:e.value,dock:c};return g[l]=u,g[s]=e.segment.position,g.y+=(i-(r-1)/2)*o,g});e.background&&y.push(function({minorCenter:e,majorAxis:t,minorAxis:n,dock:r,label:i,lineHeight:o,background:a}){const{lines:s}=i,{borderRadius:l=oa,padding:c={}}=a,{top:u=aa,bottom:d=aa,left:f=aa,right:h=aa}=c,p=s.length,m={type:"rect",rx:l,ry:l,fill:i.background.fill,width:i.width+(f+h),height:i.height+(u+d),value:i.value,dock:r};return m[n]=e,m[t]=i.segment.position,m.x-=i.width/2+f,m.y-=p*o/2+u,m}({minorCenter:u,majorAxis:s,minorAxis:l,dock:c,label:e,lineHeight:o,background:g})),y=y.concat(i)}),y}};function ua(e,t,n){let r;const i=typeof t;if("string"===i||"object"===i)r=e.formatter(t);else if(void 0!==n&&n.data){const e=n.data()&&n.data().fields;r=e&&e[0]?e[0].formatter():null}return r}function da(e,t,n){return"top"===e||"bottom"===e?function(e,t){const{lineHeight:n,top:r,bottom:i,maxLabelWidth:o}=t;let a=1;return ca.getMaxTextWidth(e)>o&&(ta(e,t,o),a=Math.max(...e.map(e=>e.lines.length))),a*n+r+i}(t,n):function(e,t){const{left:n,right:r,maxLabelWidth:i}=t;return Math.min(i,ca.getMaxTextWidth(e))+n+r}(t,n)}function fa(e,t){return t?e.domain():[0,1]}function ha(e,t,n,r="value"){let i=e.filter(e=>e[r]>=t);i=i.filter(e=>e[r]<=n);const o=e.filter(e=>e[r]<t),a=e.filter(e=>e[r]>n);return{filteredLabels:i,minOobs:o,maxOobs:a,numMinOobs:o.length,numMaxOobs:a.length}}function pa(e){let t,n=0;for(let r=1;r<10;r++)t=e(r),n=Math.max(n,Math.sqrt(t.width*t.width+t.height*t.height));return t=e("9+"),[n,Math.max(n,Math.sqrt(t.width*t.width+t.height*t.height))]}function ma(e,t){return e>9?t[1]:t[0]}function ga({alignment:e,dockValue:t,oobs:n,style:r,rect:i,symbol:o,position:a,areaProps:s,radius:l,font:c}){const u=n?n.length:0;if(u<1)return[];const{flipXY:d,majorAxis:f,minorAxis:h,minorDimension:p,dock:m}=s,g=i[p],y=Ui.createOob({oob:Ui.getDefaultSettings({size:r.size,fill:r.fill,alignment:e}),dockValue:t,boxCenter:.5,rendWidth:i.width,rendHeight:i.height,flipXY:d,symbol:o});y.dock=m;const v=`c${f}`,b=`c${h}`,x={type:"circle",r:l,stroke:"transparent",fill:r.text.background.fill,strokeWidth:0,dock:m};x[b]=g/2,x[v]=a;const S={type:"text",text:u>9?"9+":u,title:ra({oobs:n,font:c,ellipsis:"…"}),dx:0,dy:0,maxWidth:g,width:g,fontSize:r.text.fontSize,fontFamily:r.text.fontFamily,fill:r.text.fill,baseline:"central",anchor:"middle",dock:m};return S[h]=g/2,S[f]=a,[y,x,S]}const ya=e=>{const t=Qo({labelStyle:e}),n=Vi.getFontHeight(t)*(e.lineHeightMultiplicator||1),r=e.gap||12,i=e.maxWidth||75,o=e.padding.top||0,a=e.padding.bottom||0,s=e.padding.left||0,l=e.padding.right||0;return{...e,font:t,lineHeight:n,gap:r,maxLabelWidth:i,top:o,bottom:a,left:s,right:l}},va=e=>e.map(e=>({...e,value:"function"==typeof e.value?e.value():e.value,valueText:"function"==typeof e.valueText?e.valueText():e.valueText,valueInfo:"function"==typeof e.valueInfo?e.valueInfo():e.valueInfo}));var ba={require:["renderer","chart","symbol"],defaultSettings:{layout:{displayOrder:0,prioOrder:0}},preferredSize(){const{scale:e}=this,{style:t,layoutService:n,isContinuous:r,localeInfo:i}=this.settings,o=!!r||n.meta.canBeContinuous,a=va(this.settings.labels),s=ua(this.chart,this.settings.formatter,e);ca.addLabelTitles({labels:a,formatter:s,isContinuous:r,canBeContinuous:o,localeInfo:i});const{numMaxOobs:l,numMinOobs:c,filteredLabels:u}=(({labels:e,scale:t,isContinuous:n,canBeContinuous:r,layoutService:i})=>{if(n){const[r,i]=fa(t,n);return ha(e,r,i)}if(r){const t=i.getLayoutValue("qHyperCube.qDimensionInfo.0"),{qMin:n,qMax:r}=t;if("NaN"!==n&&"NaN"!==r)return ha(e,n,r,"inputValue")}return{filteredLabels:e}})({labels:a,scale:e,isContinuous:r,canBeContinuous:o,layoutService:n});let d;if(this.measureText=(e,n)=>{const{fontSize:r,fontFamily:i,fontWeight:o}=n||{};return this.renderer.measureText({text:e,fontWeight:o||t.label.fontWeight,fontSize:r||t.label.fontSize,fontFamily:i||t.label.fontFamily})},u&&u.length){const e=ya(t.label),{dock:n}=this.settings.layout;return ca.measureLabelsWidth(u,this.measureText),d=da(n,u,e),d}const f=pa(this.measureText),h=l?ma(l,f):0,p=c?ma(c,f):0;return d=Math.max(h,p),d},render(){const{scale:e}=this;if(!e.domain().length)return;const{symbol:t}=this,{style:n,layoutService:r,theme:i,isContinuous:o,isDimension:a,localeInfo:s}=this.settings,l=!!o||r.meta.canBeContinuous,c=va(this.settings.labels),{dock:u,rtl:d}=this.settings.layout,{padding:f}=n.label,h=function(e){return"left"===e||"right"===e?(e=>({dock:e,orientation:"vertical",majorAxis:"y",minorAxis:"x",majorDimension:"height",minorDimension:"width",flipXY:!1}))(e):(e=>({dock:e,orientation:"horizontal",majorAxis:"x",minorAxis:"y",majorDimension:"width",minorDimension:"height",flipXY:!0}))(e)}(u),p=function(e,t,n){const r=e[t.minorDimension];return{minorSize:r,majorSize:e[t.majorDimension],minorCenter:"vertical"===t.orientation?(r-n.right-n.left)/2+n.left:(r-n.top-n.bottom)/2+n.top}}(this.rect,h,f),{orientation:m,majorDimension:g}=h,{majorSize:y}=p,v=ya(n.label),{font:b,lineHeight:x,gap:S,maxLabelWidth:M}=v,w=ua(this.chart,this.settings.formatter,e),k=y;ca.addLabelTitles({labels:c,formatter:w,isContinuous:o,canBeContinuous:l,localeInfo:s}),ca.calculateLabelPositions({labels:c,scale:e,size:k,layoutService:r,orientation:m,rtl:d,isContinuous:o,isDimension:a});const[E,C]=fa(e,o),{filteredLabels:N,lowerOobs:T,upperOobs:D,lowerCircleSize:q,upperCircleSize:O,lowerOobSpace:I,upperOobSpace:A}=function({labels:e,minValue:t,maxValue:n,orientation:r,rtl:i,isContinuous:o,style:a,padding:s,measureText:l,prop:c="value"}){const{maxOobs:u,minOobs:d,filteredLabels:f}=ha(e,t,n,c),h="scaledValue"!==c&&Zo.getInvert({orientation:r,rtl:i,isContinuous:o}),p=function(e,t,n){return n?t:e}(d,u,h),m=function(e,t,n){return n?e:t}(d,u,h),g=p.length,y=m.length,v=pa(l),b=ma(g,v),x=ma(y,v),S=function(e,t,n,r,i){return("vertical"===r?i.top:i.left)+(e>0?t+n:0)}(g,a.oob.size,b,r,s),M=function(e,t,n,r,i){return("vertical"===r?i.bottom:i.right)+(e>0?t+n:0)}(y,a.oob.size,x,r,s);return{filteredLabels:f,lowerOobs:p,upperOobs:m,lowerCircleSize:b,upperCircleSize:x,lowerOobSpace:S,upperOobSpace:M}}({labels:c,minValue:E,maxValue:C,orientation:m,rtl:d,isContinuous:o,style:n,padding:f,measureText:this.measureText,prop:o?"value":"scaledValue"}),_=I,L=y-A;ia(T),ia(D);const P=ga({alignment:0,dockValue:0,oobs:T,style:n.oob,rect:this.rect,symbol:t,position:n.oob.size+q/2,areaProps:h,radius:q/2,font:b}),R=ga({alignment:1,dockValue:1,oobs:D,style:n.oob,rect:this.rect,symbol:t,position:y-(n.oob.size+O/2),areaProps:h,radius:O/2,font:b});ca.addLabelsInfo({labels:N,scale:e,majorSize:y,lowerLimit:_,upperLimit:L,labelStyle:v,lineHeight:x,gap:S,maxLabelWidth:M,majorDimension:g,orientation:m,measureText:this.measureText,rtl:d,layoutService:r,isContinuous:o,isDimension:a}),Fo.layout(N.map(e=>e.segment),_,L,n.label.gap);const F=N.filter(e=>Fo.isInside(e.segment,_,L,o));return ca.createLabels({labels:F,style:n.label,maxLabelWidth:M,areaProps:h,area:p,lineHeight:x,font:b,theme:i}).concat([...P,...R])}};function xa(e){return null!==e&&"object"==typeof e&&"r"in e&&"number"==typeof e.r&&"g"in e&&"number"==typeof e.g&&"b"in e&&"number"==typeof e.b&&("number"==typeof e.a||void 0===e.a)}function Sa(e){if("object"==typeof e&&xa(e))return(e.r<<16)+(e.g<<8)+e.b;let t=0,n=0,r=0;if("string"==typeof e){let i;(i=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i.exec(e))?(t=parseInt(i[1],10),n=parseInt(i[2],10),r=parseInt(i[3],10)):(i=/^#([A-Fa-f0-9]{2})([A-Fa-f0-9]{2})([A-Fa-f0-9]{2})$/i.exec(e))?(t=parseInt(i[1],16),n=parseInt(i[2],16),r=parseInt(i[3],16)):(i=/^#([A-Fa-f0-9])([A-Fa-f0-9])([A-Fa-f0-9])$/i.exec(e))&&(t=parseInt(i[1]+i[1],16),n=parseInt(i[2]+i[2],16),r=parseInt(i[3]+i[3],16))}return(t<<16)+(n<<8)+r}const Ma={aliceblue:{r:240,g:248,b:255},antiquewhite:{r:250,g:235,b:215},aqua:{r:0,g:255,b:255},aquamarine:{r:127,g:255,b:212},azure:{r:240,g:255,b:255},beige:{r:245,g:245,b:220},bisque:{r:255,g:228,b:196},black:{r:0,g:0,b:0},blanchedalmond:{r:255,g:235,b:205},blue:{r:0,g:0,b:255},blueviolet:{r:138,g:43,b:226},brown:{r:165,g:42,b:42},burlywood:{r:222,g:184,b:135},cadetblue:{r:95,g:158,b:160},chartreuse:{r:127,g:255,b:0},chocolate:{r:210,g:105,b:30},coral:{r:255,g:127,b:80},cornflowerblue:{r:100,g:149,b:237},cornsilk:{r:255,g:248,b:220},crimson:{r:220,g:20,b:60},cyan:{r:0,g:255,b:255},darkblue:{r:0,g:0,b:139},darkcyan:{r:0,g:139,b:139},darkgoldenrod:{r:184,g:134,b:11},darkgray:{r:169,g:169,b:169},darkgreen:{r:0,g:100,b:0},darkgrey:{r:169,g:169,b:169},darkkhaki:{r:189,g:183,b:107},darkmagenta:{r:139,g:0,b:139},darkolivegreen:{r:85,g:107,b:47},darkorange:{r:255,g:140,b:0},darkorchid:{r:153,g:50,b:204},darkred:{r:139,g:0,b:0},darksalmon:{r:233,g:150,b:122},darkseagreen:{r:143,g:188,b:143},darkslateblue:{r:72,g:61,b:139},darkslategray:{r:47,g:79,b:79},darkslategrey:{r:47,g:79,b:79},darkturquoise:{r:0,g:206,b:209},darkviolet:{r:148,g:0,b:211},deeppink:{r:255,g:20,b:147},deepskyblue:{r:0,g:191,b:255},dimgray:{r:105,g:105,b:105},dimgrey:{r:105,g:105,b:105},dodgerblue:{r:30,g:144,b:255},firebrick:{r:178,g:34,b:34},floralwhite:{r:255,g:250,b:240},forestgreen:{r:34,g:139,b:34},fuchsia:{r:255,g:0,b:255},gainsboro:{r:220,g:220,b:220},ghostwhite:{r:248,g:248,b:255},gold:{r:255,g:215,b:0},goldenrod:{r:218,g:165,b:32},gray:{r:128,g:128,b:128},green:{r:0,g:128,b:0},greenyellow:{r:173,g:255,b:47},grey:{r:128,g:128,b:128},honeydew:{r:240,g:255,b:240},hotpink:{r:255,g:105,b:180},indianred:{r:205,g:92,b:92},indigo:{r:75,g:0,b:130},ivory:{r:255,g:255,b:240},khaki:{r:240,g:230,b:140},lavender:{r:230,g:230,b:250},lavenderblush:{r:255,g:240,b:245},lawngreen:{r:124,g:252,b:0},lemonchiffon:{r:255,g:250,b:205},lightblue:{r:173,g:216,b:230},lightcoral:{r:240,g:128,b:128},lightcyan:{r:224,g:255,b:255},lightgoldenrodyellow:{r:250,g:250,b:210},lightgray:{r:211,g:211,b:211},lightgreen:{r:144,g:238,b:144},lightgrey:{r:211,g:211,b:211},lightpink:{r:255,g:182,b:193},lightsalmon:{r:255,g:160,b:122},lightseagreen:{r:32,g:178,b:170},lightskyblue:{r:135,g:206,b:250},lightslategray:{r:119,g:136,b:153},lightslategrey:{r:119,g:136,b:153},lightsteelblue:{r:176,g:196,b:222},lightyellow:{r:255,g:255,b:224},lime:{r:0,g:255,b:0},limegreen:{r:50,g:205,b:50},linen:{r:250,g:240,b:230},magenta:{r:255,g:0,b:255},maroon:{r:128,g:0,b:0},mediumaquamarine:{r:102,g:205,b:170},mediumblue:{r:0,g:0,b:205},mediumorchid:{r:186,g:85,b:211},mediumpurple:{r:147,g:112,b:219},mediumseagreen:{r:60,g:179,b:113},mediumslateblue:{r:123,g:104,b:238},mediumspringgreen:{r:0,g:250,b:154},mediumturquoise:{r:72,g:209,b:204},mediumvioletred:{r:199,g:21,b:133},midnightblue:{r:25,g:25,b:112},mintcream:{r:245,g:255,b:250},mistyrose:{r:255,g:228,b:225},moccasin:{r:255,g:228,b:181},navajowhite:{r:255,g:222,b:173},navy:{r:0,g:0,b:128},oldlace:{r:253,g:245,b:230},olive:{r:128,g:128,b:0},olivedrab:{r:107,g:142,b:35},orange:{r:255,g:165,b:0},orangered:{r:255,g:69,b:0},orchid:{r:218,g:112,b:214},palegoldenrod:{r:238,g:232,b:170},palegreen:{r:152,g:251,b:152},paleturquoise:{r:175,g:238,b:238},palevioletred:{r:219,g:112,b:147},papayawhip:{r:255,g:239,b:213},peachpuff:{r:255,g:218,b:185},peru:{r:205,g:133,b:63},pink:{r:255,g:192,b:203},plum:{r:221,g:160,b:221},powderblue:{r:176,g:224,b:230},purple:{r:128,g:0,b:128},red:{r:255,g:0,b:0},rosybrown:{r:188,g:143,b:143},royalblue:{r:65,g:105,b:225},saddlebrown:{r:139,g:69,b:19},salmon:{r:250,g:128,b:114},sandybrown:{r:244,g:164,b:96},seagreen:{r:46,g:139,b:87},seashell:{r:255,g:245,b:238},sienna:{r:160,g:82,b:45},silver:{r:192,g:192,b:192},skyblue:{r:135,g:206,b:235},slateblue:{r:106,g:90,b:205},slategray:{r:112,g:128,b:144},slategrey:{r:112,g:128,b:144},snow:{r:255,g:250,b:250},springgreen:{r:0,g:255,b:127},steelblue:{r:70,g:130,b:180},tan:{r:210,g:180,b:140},teal:{r:0,g:128,b:128},thistle:{r:216,g:191,b:216},tomato:{r:255,g:99,b:71},transparent:{r:0,g:0,b:0,a:0},turquoise:{r:64,g:224,b:208},violet:{r:238,g:130,b:238},wheat:{r:245,g:222,b:179},white:{r:255,g:255,b:255},whitesmoke:{r:245,g:245,b:245},yellow:{r:255,g:255,b:0},yellowgreen:{r:154,g:205,b:50}},wa="qcm-color";function ka(...e){const t={type:wa,r:0,g:0,b:0,a:1,invalid:!1,spaces:{}};let n=0,r=0,i=0,o=1;if(null!==(a=e[0])&&"object"==typeof a&&"type"in a&&a.type===wa)({r:n,g:r,b:i,a:o}=e[0]),t.invalid=e[0].invalid,t.spaces={...e[0].spaces};else if(xa(e[0]))({r:n,g:r,b:i}=e[0]),"a"in e[0]&&({a:o}=e[0]);else if(e.length<3)if("string"==typeof e[0]){const a=e[0];let s;if(s=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i.exec(a))n=parseInt(s[1],10),r=parseInt(s[2],10),i=parseInt(s[3],10);else if(s=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d(\.\d+)?)\s*\)$/i.exec(a))n=parseInt(s[1],10),r=parseInt(s[2],10),i=parseInt(s[3],10),o=parseFloat(s[4]);else if(s=/^ARGB\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i.exec(a))o=parseInt(s[1],10)/255,n=parseInt(s[2],10),r=parseInt(s[3],10),i=parseInt(s[4],10);else if(s=/^#([A-Fa-f0-9]{2})([A-Fa-f0-9]{2})([A-Fa-f0-9]{2})$/i.exec(a))n=parseInt(s[1],16),r=parseInt(s[2],16),i=parseInt(s[3],16),o=1;else if(s=/^#([A-Fa-f0-9])([A-Fa-f0-9])([A-Fa-f0-9])$/i.exec(a))n=parseInt(s[1]+s[1],16),r=parseInt(s[2]+s[2],16),i=parseInt(s[3]+s[3],16),o=1;else if(s=/^hsl\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i.exec(a)){let e=parseFloat(s[1]),t=parseFloat(s[3]),a=parseFloat(s[5]);e%=360,t/=100,a/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,a=a<0?0:a>1?1:a;const l=a<=.5?2*a*t:(2-2*a)*t;let c=e/60;const u=l*(1-Math.abs(c%2-1));let d=[];switch(c=Math.floor(c),c){case 0:d=[l,u,0];break;case 1:d=[u,l,0];break;case 2:d=[0,l,u];break;case 3:d=[0,u,l];break;case 4:d=[u,0,l];break;case 5:d=[l,0,u];break;default:d=[0,0,0]}const f=a-.5*l;n=d[0]+f,r=d[1]+f,i=d[2]+f,n=Math.round(255*n),r=Math.round(255*r),i=Math.round(255*i),o=1}else if(s=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d(\.\d+)?)\s*\)$/i.exec(a)){let e=parseFloat(s[1]),t=parseFloat(s[3]),a=parseFloat(s[5]);o=parseFloat(s[7]),e%=360,t/=100,a/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,a=a<0?0:a>1?1:a;const l=a<=.5?2*a*t:(2-2*a)*t;let c=e/60;const u=l*(1-Math.abs(c%2-1));let d=[];switch(c=Math.floor(c),c){case 0:d=[l,u,0];break;case 1:d=[u,l,0];break;case 2:d=[0,l,u];break;case 3:d=[0,u,l];break;case 4:d=[u,0,l];break;case 5:d=[l,0,u];break;default:d=[0,0,0]}const f=a-.5*l;n=d[0]+f,r=d[1]+f,i=d[2]+f,n=Math.round(255*n),r=Math.round(255*r),i=Math.round(255*i)}else if(s=/^hsv\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i.exec(a)){let e=parseFloat(s[1]),t=parseFloat(s[3]),a=parseFloat(s[5]);e%=360,t/=100,a/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,a=a<0?0:a>1?1:a;const l=a*t;let c=e/60;const u=l*(1-Math.abs(c%2-1));let d=[];switch(c=Math.floor(c),c){case 0:d=[l,u,0];break;case 1:d=[u,l,0];break;case 2:d=[0,l,u];break;case 3:d=[0,u,l];break;case 4:d=[u,0,l];break;case 5:d=[l,0,u];break;default:d=[0,0,0]}const f=a-l;n=d[0]+f,r=d[1]+f,i=d[2]+f,n=Math.round(255*n),r=Math.round(255*r),i=Math.round(255*i),o=1}else{const e=a.toLowerCase();if(function(e){return e in Ma}(e)){const t=Ma[e];({r:n,g:r,b:i}=t),o="a"in t?t.a:1}else t.invalid=!0}}else"number"==typeof e[0]&&e[0]>=0&&"argb"===e[1]?(o=(4278190080&e[0])>>>24,o/=255,n=(16711680&e[0])>>16,r=(65280&e[0])>>8,i=255&e[0]):"number"==typeof e[0]&&e[0]>=0?(n=(16711680&e[0])>>16,r=(65280&e[0])>>8,i=255&e[0]):t.invalid=!0;else 3===e.length||4===e.length?(n=e[0],r=e[1],i=e[2],o=4===e.length?e[3]:1):t.invalid=!0;var a;return Number.isNaN(+n+r+i+o)&&(t.invalid=!0),t.r=Math.floor(n),t.g=Math.floor(r),t.b=Math.floor(i),t.a=o,t}function Ea(e){let t,n,r=0;const i="string"==typeof e?ka(e):e,o=i.r/255,a=i.g/255,s=i.b/255,{a:l}=i,c=Math.max(o,a,s),u=Math.min(o,a,s),d=(c+u)/2;if(c===u)t=0,r=0;else{switch(n=c-u,t=d>.5?n/(2-c-u):n/(c+u),c){case o:r=(a-s)/n+(a<s?6:0);break;case a:r=(s-o)/n+2;break;case s:r=(o-a)/n+4}r/=6}return{h:360*r,s:100*t,l:100*d,a:l}}function Ca(e){let t,n,r=0;const i="string"==typeof e?ka(e):e,o=i.r/255,a=i.g/255,s=i.b/255,l=Math.max(o,a,s),c=Math.min(o,a,s),u=l;if(l===c)t=0,r=0;else{switch(n=l-c,t=0===n?0:n/u,l){case o:r=(a-s)/n+(a<s?6:0);break;case a:r=(s-o)/n+2;break;case s:r=(o-a)/n+4}r/=6}return{h:360*r%360,s:100*t,v:100*u}}function Na(e){if(xa(e))return`rgb(${e.r}, ${e.g}, ${e.b})`;const t="string"==typeof e?Sa(e):e;return`rgb(${(16711680&t)>>16}, ${(65280&t)>>8}, ${255&t})`}function Ta(e,t){return xa(e)?`rgba(${e.r}, ${e.g}, ${e.b}, ${e.a})`:Ta(ka(e))}function Da(e){return xa(e)?1===e.a?Na(e):Ta(e):Da(ka(e))}const qa=e=>{const t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4};function Oa(...e){const t=ka(...e);return t.invalid||function(e){return.2126*qa(e.r)+.7152*qa(e.g)+.0722*qa(e.b)}(t)<.4}function Ia(...e){const t=ka(...e),n={type:t.type,r:t.r,g:t.g,b:t.b,a:t.a,invalid:t.invalid,spaces:t.spaces},r=()=>(n.spaces.hslaObject||(n.spaces.hslaObject=Ea(n)),n.spaces.hslaObject),i=e=>{const t=r(),{h:n,s:i,l:o,a:a}=t;return`hsla(${n}, ${i}, ${Math.max(0,Math.min(o+e,100))}, ${a})`};return{get type(){return n.type},isInvalid:()=>n.invalid,get r(){return n.r},get g(){return n.g},get b(){return n.b},get a(){return n.a},getR:()=>n.r,getG:()=>n.g,getB:()=>n.b,getAlpha:()=>n.a,setAlpha:e=>{n.a=e,n.spaces={}},isEqualTo:e=>{let t;if("string"==typeof e)t=ka(e);else{if(e.type!==n.type)return!1;t=e}return t.r===n.r&&t.g===n.g&&t.b===n.b&&t.a===n.a},isDark:()=>Oa(n),getRGB:()=>(n.spaces.rgb||(n.spaces.rgb=Na(n)),n.spaces.rgb),getRGBA:()=>(n.spaces.rgba||(n.spaces.rgba=Ta(n)),n.spaces.rgba),getString:()=>(n.spaces.string||(n.spaces.string=Da(n)),n.spaces.string),getHex:()=>(n.spaces.hex||(n.spaces.hex=function(e){let t,n,r;if(xa(e))return t=e.r.toString(16),n=e.g.toString(16),r=e.b.toString(16),1===t.length&&(t=`0${t}`),1===n.length&&(n=`0${n}`),1===r.length&&(r=`0${r}`),`#${[t,n,r].join("")}`;const i="string"==typeof e?Sa(e):e;return t=((16711680&i)>>16).toString(16),n=((65280&i)>>8).toString(16),r=(255&i).toString(16),1===t.length&&(t=`0${t}`),1===n.length&&(n=`0${n}`),1===r.length&&(r=`0${r}`),`#${t}${n}${r}`}(n)),n.spaces.hex),getHSL:()=>(n.spaces.hsl||(n.spaces.hsl=function(e){let t,n,r=0;const i="string"==typeof e?ka(e):e,o=i.r/255,a=i.g/255,s=i.b/255,l=Math.max(o,a,s),c=Math.min(o,a,s),u=(l+c)/2;if(l===c)t=0,r=0;else{switch(n=l-c,t=u>.5?n/(2-l-c):n/(l+c),l){case o:r=(a-s)/n+(a<s?6:0);break;case a:r=(s-o)/n+2;break;case s:r=(o-a)/n+4}r/=6}return`hsl(${360*r}, ${100*t}, ${100*u})`}(n)),n.spaces.hsl),getHSLA:()=>(n.spaces.hsla||(n.spaces.hsla=function(e){const{h:t,s:n,l:r,a:i}=Ea(e);return`hsla(${t}, ${n}, ${r}, ${i})`}(n)),n.spaces.hsla),getHSLAObject:r,getShiftedHSLA:i,getHSV:()=>(n.spaces.hsv||(n.spaces.hsv=function(e){const{h:t,s:n,v:r}=Ca(e);return`hsv(${t}, ${n}, ${r})`}(n)),n.spaces.hsv),getHSVObject:()=>(n.spaces.hsvObject||(n.spaces.hsvObject=Ca(n)),n.spaces.hsvObject),blend:(e,t)=>`rgba(${Math.floor(n.r+(e.r-n.r)*t)}, ${Math.floor(n.g+(e.g-n.g)*t)}, ${Math.floor(n.b+(e.b-n.b)*t)}, ${Math.floor(n.a+(e.getAlpha()-n.a)*t)})`,getBrightenedColor:(e=1)=>Ia(i(18*e)),getDarkenedColor:(e=1)=>Ia(i(18*-e))}}function Aa(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function _a(e,t,n,r,i,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(r,i)}function La(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){_a(o,r,i,a,s,"next",e)}function s(e){_a(o,r,i,a,s,"throw",e)}a(void 0)})}}function Pa(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 r=n.call(e,t);if("object"!=typeof r)return r;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 Ra(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Fa(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ra(Object(n),!0).forEach(function(t){Pa(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ra(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function za(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function ja(){
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var l=r&&r.prototype instanceof s?r:s,c=Object.create(l.prototype);return $a(c,"_invoke",function(n,r,i){var o,s,l,c=0,u=i||[],d=!1,f={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,s=0,l=e,f.n=n,a}};function h(n,r){for(s=n,l=r,t=0;!d&&c&&!i&&t<u.length;t++){var i,o=u[t],h=f.p,p=o[2];n>3?(i=p===r)&&(l=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=n<2&&h<o[1])?(s=0,f.v=r,f.n=o[1]):h<p&&(i=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,f.n=p,s=0))}if(i||n>1)return a;throw d=!0,r}return function(i,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&h(u,p),s=u,l=p;(t=s<2?e:l)||!d;){o||(s?s<3?(s>1&&(f.n=-1),h(s,l)):f.n=l:f.v=l);try{if(c=2,o){if(s||(i="next"),t=o[i]){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 '"+i+"' method"),s=1);o=e}else if((t=(d=f.n<0)?l:n.call(r,f))!==a)break}catch(t){o=e,s=1,l=t}finally{c=1}}return{value:t,done:d}}}(n,i,o),!0),c}var a={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):($a(t={},r,function(){return this}),t),d=c.prototype=s.prototype=Object.create(u);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,$a(e,i,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,$a(d,"constructor",c),$a(c,"constructor",l),l.displayName="GeneratorFunction",$a(c,i,"GeneratorFunction"),$a(d),$a(d,i,"Generator"),$a(d,r,function(){return this}),$a(d,"toString",function(){return"[object Generator]"}),(ja=function(){return{w:o,m:f}})()}function $a(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}$a=function(e,t,n,r){function o(t,n){$a(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},$a(e,t,n,r)}function Va(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 r,i,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=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,t)||Ba(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 Ua(e){return function(e){if(Array.isArray(e))return Aa(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Ba(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 Ha(e){return Ha="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},Ha(e)}function Ba(e,t){if(e){if("string"==typeof e)return Aa(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)?Aa(e,t):void 0}}var Wa="point-label-cross-placement",Ya="unclassified",Ga="equal-equal",Ka="equal-higher",Xa="equal-lower",Ja="equal-void",Za="higher-equal",Qa="higher-higher-acute",es="higher-higher-obtuse",ts="higher-lower-negative",ns="higher-lower-positive",rs="higher-void",is="lower-equal",os="lower-higher-negative",as="lower-higher-positive",ss="lower-lower-acute",ls="lower-lower-obtuse",cs="lower-void",us="void-equal",ds="void-higher",fs="void-lower",hs="void-void";function ps(e,t){return Math.atan2(t.y-e.y,t.x-e.x)*(180/Math.PI)}function ms(e,t,n){var r=Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)),i=Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2)),o=Math.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2));return Math.acos((i*i+r*r-o*o)/(2*i*r))*(180/Math.PI)}function gs(e){var t=e.previous,n=e.current,r=e.next,i=t&&t.value,o=n&&n.value,a=r&&r.value;return t||r?t?r?i===o?o===a?Ga:o<a?Ka:Xa:o===a?i>o?Za:is:i>o?o<a?ms(t,n,r)>90?es:Qa:ps(t,n)>ps(t,r)?ns:ts:o>a?ms(t,n,r)>90?ls:ss:ps(t,n)>ps(t,r)?as:os:i===o?Ja:i>o?rs:cs:o===a?us:o<a?ds:fs:hs}var ys,vs={TOP:"top",TOP_RIGHT:"top-right",RIGHT:"right",BOTTOM_RIGHT:"bottom-right",BOTTOM:"bottom",BOTTOM_LEFT:"bottom-left",LEFT:"left",TOP_LEFT:"top-left"};function bs(e){var t=e.bounds,n=e.size,r=t.x,i=t.y,o=t.width,a=t.height;return"center"===n.insideStrategy?Math.floor(r+o/2)>=0&&Math.ceil(r+o/2)<=n.width&&Math.floor(i+a/2)>=0&&Math.ceil(i+a/2)<=n.height:Math.floor(r+o)>0&&Math.ceil(r)<n.width&&Math.floor(i+a/2)>=0&&Math.ceil(i+a/2)<=n.height}function xs(){ys=ys||document.createElement("canvas").getContext("2d")}var Ss,Ms={measureTextWidth:function(e){return xs(),ys.measureText(e).width},lineWrap:function(e,t,n,r){var i,o;xs();var a,s,l=e?e.split(/\n+|\r+|\r\n/):[],c=[],u=e?e.split(/\s+/):[],d=l[0];if("number"!=typeof t||t<=0)return[e];if("number"==typeof r&&l.length>=r)return l.slice(0,r);for(n&&(ys.font=n),o=0;o<l.length;o++){for(d=Va(u=(l[o]||"").split(/\s+/),1)[0],s="",i=1;i<u.length;i++)if(a="".concat(d," ").concat(u[i]),Ms.measureTextWidth(a)>t&&("number"!=typeof r||r>c.length)?(c.push(d),d=u[i]):d=a,"number"==typeof r&&c.length>=r){s=u.slice(i+1).join(" ");break}"number"!=typeof r||c.length<r?c.push(d):c[Math.max(0,c.length-1)]="".concat(c[Math.max(0,c.length-1)]||""," ").concat(d," ").concat(s)}return c},wordWrap:function(e,t,n,r,i){if(xs(),!e||!e.length)return[];n&&(ys.font=n);var o,a,s,l,c=[],u=e.slice();if(u.filter(function(e){return!!e}),"number"!=typeof t||t<0)return e.slice();for(l=0;l<u.length;l++)a=null,(s=u[l])&&(s.length<=1||Ms.measureTextWidth(s)<=t?c.push(s):(o=Ms.splitWord(s,t,void 0,r-c.length)).length<=1?c.push(o[0]):(a=o.pop(),c=c.concat(o),u[l+1]?Ms.measureTextWidth("".concat(a," ").concat(u[l+1]))>t&&c.length+u.length-l<=r?u.splice(l+1,0,a):u[l+1]="".concat(a," ").concat(u[l+1]):u.push(a)));return c.forEach(function(e,t,n){n[t]=e?e.trim():e}),c.length>r?(c=c.splice(0,r))[c.length-1]=Ms.truncate(c[c.length-1],t,n,i).text:(s=c[c.length-1])&&s.length>1&&Ms.measureTextWidth(s)>t&&(c[c.length-1]=Ms.truncate(s,t,n,i).text),c},truncate:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"…";xs();var i,o,a,s=e,l=Ms.measureTextWidth("i"),c=Math.ceil(t/l);if(n&&(ys.font=n),e&&t){if(Ms.measureTextWidth(s)>t){for(i=Math.min(c,s.length);i>0;i--)if(o=s.substring(0,i-1).trim()+r,Ms.measureTextWidth(o)<=t){a=s.substring(i-1),s=o;break}i||(a=s,s="…")}}else a=void 0;return{text:s,rest:a}},isNumber:function(e){return"number"==typeof e&&Number.isFinite(e)},explodeWord:function(e,t,n,r){var i;xs();var o=e,a="",s=[];if(Ms.isNumber(n)&&n<=1)return[e];var l=Math.ceil(t/r);for(i=Math.min(e.length,l);i>0&&(o=e.substring(0,i)," "===e.substring(i-1,i)?o=e.substring(0,i-1):o+="-",a=e.substring(i),!(Ms.measureTextWidth(o)<=t));i--);return(!i&&!o||Ms.measureTextWidth(o)>t)&&(o=e.substring(0,1),a=e.substring(1)),s.push(o),a?(Ms.measureTextWidth(a)>t?(a=Ms.explodeWord(a,t,n-1,r),s=s.concat(a)):s.push(a),s.filter(function(e){return""!==e.trim()})):s},splitWord:function(e,t,n,r){return xs(),e&&t?(n&&(ys.font=n),Ms.explodeWord(e,t,r,Math.max(1,Ms.measureTextWidth("i")))):[]},wrapText:function(e,t,n,r,i){var o;return Number.isNaN(t)?[e]:(o=r>1?Ms.lineWrap(e,t,n,r):[e],o=Ms.wordWrap(o,t,n,r,i))},getFontHeight:function(e){return xs(),e&&(ys.font=e),1.5*Ms.measureTextWidth("m")},tokenize:function(e,t,n,r,i,o){var a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1;xs(),t&&(ys.font=t);var s=Ms.getFontHeight(),l=a*s,c=[],u=0,d=[];if(o<s)return[];var f=o?Math.max(1,Math.floor(o/l)):r||1;return Array.isArray(r)?(r.forEach(function(e){u+=Number.isNaN(e)||e<=0?0:e}),r.forEach(function(e){c.push(Number.isNaN(e)||e<=0?f-u:e)})):c=[Number.isNaN(r)||r<=0?f:Math.min(f,r)],Array.isArray(e)?e.forEach(function(e,n){d.length<f&&(d=d.concat(Ms.wrapText(e,i,t,c[n])))}):d=Ms.wrapText(e,i,t,c[0],n),d}};function ws(e){var t,n,r=e.config,i=e.crossPlacements,o=e.node,a=e.line,s=e.groupIndex,l=e.extract,c=e.style,u=e.measureText,d=e.size,f=e.horizontal,h=e.rtl,p=e.meta,m=e.showLabel,g=l.label(o.data);if("string"!=typeof g&&"number"!=typeof g||""===g)return!1;var y=function(){var e,t,n=u({fontFamily:c.fontFamily,fontSize:c.fontSize,text:g});if(null===(e=o.data)||void 0===e||null===(e=e.value)||void 0===e||!e.maxLabelWidth||n.width<=(null===(t=o.data)||void 0===t||null===(t=t.value)||void 0===t?void 0:t.maxLabelWidth))return n;var r="".concat(c.fontSize," ").concat(c.fontFamily),i=Ms.tokenize(g,r,"…",3,o.data.value.maxLabelWidth);return n.lines=i.map(function(e){return{text:e,size:u({fontFamily:c.fontFamily,fontSize:c.fontSize,text:e})}}),n.width=Math.max.apply(Math,Ua(n.lines.map(function(e){return e.size.width}))),n.height*=i.length,n}(),v=o.localBounds,b=o.attrs["stroke-width"],x=l.pointValue(o.data),S=!(null===(t=o.data)||void 0===t||null===(t=t.value)||void 0===t||!t.hasBackground),M=S?{X:3,Y:2}:{X:1,Y:0},w=S?{X:2,Y:2}:{X:0,Y:0},k={x:v.x+v.width/2,y:v.y+v.height/2,width:y.width+2*M.X+2*w.X,height:y.height+2*M.Y+2*w.Y},E="".concat(k.x,"-").concat(k.y),C=!f&&!h,N=f?d.height:d.width,T=(f?k.y:k.x)/N,D=(C?1-T:T)<=(N<=200?.25:.1),q=null===(n=o.data)||void 0===n||null===(n=n.value)||void 0===n||null===(n=n.label)||void 0===n?void 0:n.placement,O=Object.keys(vs).map(function(e){return vs[e]}),I={key:E,config:r,node:o,line:a,group:s,value:x,labelMeasurements:y,bounds:k,inside:bs({bounds:v,size:d}),border:b?b/2:0,classification:Ya,setClassification:function(e){I.classification=e},preferences:[],setPreferences:function(e){var t;(t=I.preferences).push.apply(t,Ua(e))},fixedPlacement:O.includes(q)?q:void 0,placement:void 0,setPlacement:function(e){I.placement=e,i.setPlacement(e)},duplicate:!1,setDuplicate:function(){I.duplicate=!0},extreme:p.getExtreme(E),elite:D,show:r.labels&&m(o)};return I}var ks=(Pa(Pa(Pa(Pa(Pa(Pa(Pa(Pa(Pa(Pa(Ss={},Ga,[vs.TOP,vs.BOTTOM]),Ka,[vs.BOTTOM,vs.BOTTOM_RIGHT]),Xa,[vs.TOP,vs.TOP_RIGHT]),Ja,[vs.TOP,vs.BOTTOM]),Za,[vs.LEFT,vs.BOTTOM_LEFT,vs.TOP,vs.TOP_RIGHT]),Qa,[vs.BOTTOM,vs.BOTTOM_LEFT,vs.LEFT,vs.TOP_RIGHT]),es,[vs.BOTTOM,vs.TOP]),ts,[vs.TOP,vs.TOP_RIGHT,vs.RIGHT]),ns,[vs.BOTTOM,vs.BOTTOM_LEFT,vs.LEFT]),rs,[vs.TOP]),Pa(Pa(Pa(Pa(Pa(Pa(Pa(Pa(Pa(Pa(Ss,is,[vs.TOP]),os,[vs.TOP,vs.TOP_LEFT]),as,[vs.BOTTOM_RIGHT]),ss,[vs.TOP,vs.TOP_LEFT,vs.LEFT,vs.TOP_RIGHT,vs.RIGHT]),ls,[vs.TOP,vs.BOTTOM]),cs,[vs.TOP]),us,[vs.TOP]),ds,[vs.TOP,vs.BOTTOM]),fs,[vs.TOP,vs.BOTTOM,vs.LEFT]),hs,[vs.TOP]),Pa(Ss,Ya,[vs.TOP,vs.BOTTOM,vs.RIGHT,vs.LEFT,vs.TOP_RIGHT,vs.BOTTOM_RIGHT,vs.BOTTOM_LEFT,vs.TOP_LEFT]));function Es(e){var t=function(e){var t=e.configs,n=e.crossPlacements,r=e.nodes,i=e.extract,o=e.style,a=e.measureText,s=e.size,l=e.horizontal,c=e.rtl,u=e.showLabel,d=function(e){var t={top:[],right:[],bottom:[],left:[]},n=e.nodes.map(function(e){var t=e.localBounds,n={x:t.x+t.width/2,y:t.y+t.height/2};return{key:"".concat(n.x,"-").concat(n.y),center:n}}),r=n.reduce(function(e,t){return(!e.top||t.center.y<e.top.center.y)&&(e.top=t),(!e.right||t.center.x>e.right.center.x)&&(e.right=t),(!e.bottom||t.center.y>e.bottom.center.y)&&(e.bottom=t),(!e.left||t.center.x<e.left.center.x)&&(e.left=t),e},{});return t.top=n.filter(function(e){return e.center.y===r.top.center.y}).map(function(e){return e.key}),t.right=n.filter(function(e){return e.center.x===r.right.center.x}).map(function(e){return e.key}),t.bottom=n.filter(function(e){return e.center.y===r.bottom.center.y}).map(function(e){return e.key}),t.left=n.filter(function(e){return e.center.x===r.left.center.x}).map(function(e){return e.key}),{getExtrema:function(e){return{top:-1!==t.top.indexOf(e),right:-1!==t.right.indexOf(e),bottom:-1!==t.bottom.indexOf(e),left:-1!==t.left.indexOf(e)}},getExtreme:function(e){return[t.top,t.right,t.bottom,t.left].some(function(t){return-1!==t.indexOf(e)})}}}({nodes:r}),f=function(e){var t=e.by,n=e.lineId,r=e.nodes.reduce(function(e,r,i){var o=t(r.data);return e[o]||(e[o]={items:[],index:i}),e[o].items.push({node:r,line:n(r)}),e},{});return Object.keys(r).map(function(e){return r[e]}).sort(function(e,t){return e.index-t.index}).map(function(e){return e.items})}({nodes:r,by:i.majorValue,lineId:i.lineId}).map(function(e,r){return e.map(function(e){return{line:e.line,item:ws({config:t.get(e.node.key),crossPlacements:n,node:e.node,line:e.line,groupIndex:r,extract:i,style:o,measureText:a,size:s,horizontal:l,rtl:c,meta:d,showLabel:u})}}).filter(function(e){return e.item}).reduce(function(e,t){return e[t.line]=t.item,e},{})});return f.filter(function(e){return Object.keys(e).length})}({configs:e.configs,crossPlacements:e.crossPlacements,nodes:e.nodes,extract:e.extract,style:e.style,measureText:e.measureText,size:e.size,horizontal:e.horizontal,rtl:e.rtl,showLabel:e.showLabel}),n=Ua(t.reduce(function(e,t){return e.push.apply(e,Ua(Object.keys(t).map(function(e){return t[e]}))),e},[])),r=Va(n,1)[0],i=function(e){for(var t=e.threshold,n=e.groups.map(function(e){return Object.keys(e).map(function(t){return e[t]})}),r={},i=0;i<=n.length;i++){var o=n[i];if(o)for(var a=0;a<o.length;a++){var s=o[a];if(s.config.lines){var l=s.line;r[l]||(r[l]=[]),r[l].push(s.bounds)}}}for(var c=Object.keys(r).map(function(e){return r[e]}),u=[],d=0;d<c.length;d++)for(var f=0;f<c[d].length-1;f++){var h=c[d][f],p=c[d][f+1],m={x1:h.x,y1:h.y,x2:p.x,y2:p.y},g=m.x1-m.x2,y=m.y1-m.y2;Math.sqrt(g*g+y*y)>t&&u.push(m)}return u}({groups:t,threshold:null==r?void 0:r.node.localBounds.height}),o={getItems:function(){return n},getLines:function(){return i}};return function(e){for(var t=e.groups,n=function(e){for(var n=Object.keys(t[e]).map(function(n){return t[e][n]}),r=0;r<n.length;r++){var i=n[r];if(!i.config.fixed){var o=gs({previous:t[e-1]&&t[e-1][i.line],current:i,next:t[e+1]&&t[e+1][i.line]});i.setClassification(o)}}},r=0;r<t.length;r++)n(r)}({groups:t}),o.getItems().forEach(function(e){e.setPreferences(ks[e.classification])}),o}function Cs(e){var t=e.item,n=e.placement,r=e.size;return n.x>=0-r.edgeBleed.left&&n.x<=r.width-t.bounds.width+r.edgeBleed.right&&n.y>=0-r.edgeBleed.top&&n.y<=r.height-t.bounds.height}function Ns(e){var t=e.line1,n=e.line2,r=(n.y2-n.y1)*(t.x2-t.x1)-(n.x2-n.x1)*(t.y2-t.y1);if(0===r)return!1;var i=((n.x2-n.x1)*(t.y1-n.y1)-(n.y2-n.y1)*(t.x1-n.x1))/r,o=((t.x2-t.x1)*(t.y1-n.y1)-(t.y2-t.y1)*(t.x1-n.x1))/r;return i>=0&&i<=1&&o>=0&&o<=1}var Ts={x:0,width:0,y:0,height:0},Ds=function(e){var t=e.item;return{x:t.bounds.x-t.bounds.width/2,y:t.bounds.y-t.bounds.height-t.node.localBounds.height/2-t.border}},qs=function(e){var t=e.item;return{x:t.bounds.x,y:t.bounds.y-t.bounds.height-t.node.localBounds.height/2-t.border}},Os=function(e){var t=e.item;return{x:t.bounds.x+t.node.localBounds.width/2+t.border,y:t.bounds.y-t.bounds.height/2}},Is=function(e){var t=e.item;return{x:t.bounds.x,y:t.bounds.y+t.node.localBounds.height/2+t.border}},As=function(e){var t=e.item;return{x:t.bounds.x-t.bounds.width/2,y:t.bounds.y+t.node.localBounds.height/2+t.border}},_s=function(e){var t=e.item;return{x:t.bounds.x-t.bounds.width,y:t.bounds.y+t.node.localBounds.height/2+t.border}},Ls=function(e){var t=e.item;return{x:t.bounds.x-t.bounds.width-t.node.localBounds.width/2-t.border,y:t.bounds.y-t.bounds.height/2}},Ps=function(e){var t=e.item;return{x:t.bounds.x-t.bounds.width,y:t.bounds.y-t.bounds.height-t.node.localBounds.height/2-t.border}},Rs=[vs.TOP,vs.TOP_LEFT,vs.TOP_RIGHT],Fs=[vs.BOTTOM,vs.BOTTOM_LEFT,vs.BOTTOM_RIGHT];function zs(e){var t=e.position,n={x:2.5,width:-5,y:0,height:0},r=Rs.indexOf(t)>-1,i=Fs.indexOf(t)>-1;return r&&(n.y=4,n.height=-4),i&&(n.height=-4),n}function js(e){var t=e.cx,n=e.cy,r=e.r,i=e.degrees*(Math.PI/180);return{x:Math.round(t+r*Math.sin(i)),y:Math.round(n+r*-Math.cos(i))}}function $s(e){var t=e.coordinates,n=e.degrees,r=e.item,i={x:t.x,y:t.y};return n<=90?i.y-=r.bounds.height:n>180&&n<=270?i.x-=r.bounds.width:n>270&&(i.y-=r.bounds.height,i.x-=r.bounds.width),i}var Vs=void 0;function Us(e){var t=e.item,n=e.validator,r=e.force,i=void 0!==r&&r,o=Pa(Pa(Pa(Pa(Pa(Pa(Pa(Pa({},vs.TOP,Ds),vs.TOP_RIGHT,qs),vs.RIGHT,Os),vs.BOTTOM_RIGHT,Is),vs.BOTTOM,As),vs.BOTTOM_LEFT,_s),vs.LEFT,Ls),vs.TOP_LEFT,Ps);if(t.fixedPlacement)return o[t.fixedPlacement]({item:t});for(var a=[].concat(Ua(t.preferences),Ua(Object.keys(vs).map(function(e){return vs[e]}).filter(function(e){return-1===t.preferences.indexOf(e)}))),s=[],l=0;l<a.length;l++){var c=a[l],u=o[c]({item:t}),d=zs({position:c}),f=n({item:t,placement:u,adjustment:d,ignoreLines:i});if(i&&f.inside&&s.push(u),f.valid)return u}var h=function(){return function(e){for(var t=e.item,n=e.validator,r=e.force,i=void 0!==r&&r,o=function(e){return[e.item.node.localBounds.height/2*Math.sqrt(2)]}({item:t}),a=t.bounds.x,s=t.bounds.y,l=0;l<o.length;l++){for(var c=o[l],u=40;u<=180;u+=15){var d=$s({coordinates:js({cx:a,cy:s,r:c,degrees:u}),degrees:u,item:t});if(n({item:t,placement:d,ignoreLines:i}).valid)return d}for(var f=320;f>180;f-=15){var h=$s({coordinates:js({cx:a,cy:s,r:c,degrees:f}),degrees:f,item:t});if(n({item:t,placement:h,ignoreLines:i}).valid)return h}}return!1}({item:t,validator:n,force:i})};return i?h()||s[0]||Vs:(t.extreme||t.elite)&&h()||Vs}function Hs(e){var t=e.configs,n=e.crossPlacements,r=e.model,i=e.size,o=e.all,a={},s=r.getItems(),l=[].concat(Ua(s.map(function(e){return{x:e.node.localBounds.x-e.border+1,y:e.node.localBounds.y-e.border+1,height:e.node.localBounds.height+2*e.border-2,width:e.node.localBounds.width+2*e.border-2}})),Ua(n.getPlacements({configs:t}))),c=[],u=r.getLines();s.forEach(function(e){var t=e.node.data;if(!(!e.show||!e.inside||t.null&&t.null.value||t.interpolated&&t.interpolated.value)){var n=e.key;if(!a[n]||e.config.duplicates){a[n]=!0;var r=function(e){var t=e.size,n=e.lines,r=e.placements;return function(e){var i=e.item,o=e.placement,a=e.adjustment,s=void 0===a?Ts:a,l=e.ignoreLines,c=void 0!==l&&l,u={inside:Cs({item:i,placement:o,size:t}),collides:!0,valid:!1};return u.inside?(u.collides=function(e){var t=e.candidate,n=e.lines;return!!e.rects.some(function(e){return function(e){var t=e.rect1,n=e.rect2;return!(n.x>t.x+t.width||n.x+n.width<t.x||n.y>t.y+t.height||n.y+n.height<t.y)}({rect1:e,rect2:t})})||n.some(function(e){return function(e){var t=e.line,n=e.rect,r={x:n.x,y:n.y},i={x:n.x+n.width,y:n.y},o={x:n.x+n.width,y:n.y+n.height},a={x:n.x,y:n.y+n.height},s={x1:i.x,y1:i.y,x2:o.x,y2:o.y},l={x1:o.x,y1:o.y,x2:a.x,y2:a.y},c={x1:a.x,y1:a.y,x2:r.x,y2:r.y};return Ns({line1:t,line2:{x1:r.x,y1:r.y,x2:i.x,y2:i.y}})||Ns({line1:t,line2:s})||Ns({line1:t,line2:l})||Ns({line1:t,line2:c})}({line:e,rect:t})})}({candidate:{x:o.x+s.x,y:o.y+s.y,width:i.bounds.width+s.width,height:i.bounds.height+s.height},lines:c?[]:n,rects:r}),u.valid=!u.collides,u):u}}({size:i,lines:u,placements:l}),s=Us({item:e,validator:r});s?(s.height=e.bounds.height,s.width=e.bounds.width,l.push(s),e.setPlacement(s)):o&&c.push({item:e,validator:r})}else e.setDuplicate()}}),c.forEach(function(e){var t=e.item,n=Us({item:t,validator:e.validator,force:!0});n&&(n.height=t.bounds.height,n.width=t.bounds.width,l.push(n),t.setPlacement(n))})}var Bs={require:["chart","renderer"],defaultSettings:{settings:{orientation:"horizontal",rtl:!1,all:!1,label:function(){},showLabel:function(){return!0},pointValue:function(){},majorValue:function(){},lineId:function(){},enabled:function(){return!0},configs:[],insideStrategy:"edge",labelSpace:{use:function(){return!1},size:10},cache:void 0},style:{fontFamily:'"Source Sans Pro", "Arial", "sans-serif"',fontSize:"12px",fill:"#333"}},created:function(){var e,t,n,r,i,o;this.crossPlacements=(e={cache:this.settings.settings.cache,key:this.settings.key},i=e.key,o={isPrimary:!1},null!=(r=e.cache)&&null!==(t=r.has)&&void 0!==t&&t.call(r,Wa)||(o.isPrimary=!0,null==r||null===(n=r.set)||void 0===n||n.call(r,Wa,{})),{reset:function(){var e,t=null==r||null===(e=r.get)||void 0===e?void 0:e.call(r,Wa);t&&(o.isPrimary&&Object.keys(t).forEach(function(e){return delete t[e]}),t[i]=[])},setPlacement:function(e){var t,n=null==r||null===(t=r.get)||void 0===t?void 0:t.call(r,Wa);n&&n[i].push(e)},getPlacements:function(e){var t,n=e.configs,o=null==r||null===(t=r.get)||void 0===t?void 0:t.call(r,Wa);if(!o)return[];var a=[],s=n.getCollection().filter(function(e){return!e.labels&&!!e.labelKeys.length}).reduce(function(e,t){return e.push.apply(e,Ua(t.labelKeys)),e},[]);return Object.keys(o).forEach(function(e){e!==i&&s.some(function(t){return t===e})&&a.push.apply(a,Ua(o[e]))}),a}})},preferredSize:function(){var e={edgeBleed:{top:0,right:0,left:0}},t=this.settings.settings,n=t.orientation,r=t.rtl,i=t.labelSpace,o=i.use,a=i.size;if(o()){var s="horizontal"===n;e.edgeBleed.top=s?a:0,e.edgeBleed[r?"left":"right"]=s?0:a}return e},render:function(){this.crossPlacements.reset();var e=this.settings.settings;if(!(0,e.enabled)())return[];var t=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).configs,t=void 0===e?[]:e,n={},r=[];return t.forEach(function(e){var t=e.key;n[t]={labels:void 0===e.labels||e.labels,labelKeys:Array.isArray(e.labelKeys)?e.labelKeys:[],lines:void 0===e.lines||e.lines,fixed:void 0!==e.fixed&&e.fixed,duplicates:void 0!==e.duplicates&&e.duplicates},r.push(n[t])}),{meta:{allKeys:t.map(function(e){return e.key})},getCollection:function(){return r},get:function(e){return n[e]},getFirstLabelKey:function(){var e;return null===(e=t.find(function(e){return e.labels}))||void 0===e?void 0:e.key}}}({configs:e.configs}),n=t.getFirstLabelKey();if(!n)return[];if(!this.chart.component(n))return[];var r=this.chart.findShapes("circle, path, rect").filter(function(e){return t.meta.allKeys.includes(e.key)});if(!r.length)return[];var i="horizontal"===e.orientation,o=i?"x":"y";r.sort(function(e,t){return e.localBounds[o]-t.localBounds[o]});var a={label:e.label,pointValue:e.pointValue,majorValue:e.majorValue,lineId:e.lineId},s=this.rect,l={height:s.height,width:s.width,edgeBleed:s.edgeBleed,insideStrategy:e.insideStrategy},c=this.crossPlacements,u=this.style,d=Es({configs:t,crossPlacements:c,nodes:r,extract:a,style:u,measureText:this.renderer.measureText,size:l,horizontal:i,rtl:e.rtl,showLabel:e.showLabel});({model:d}).model.getItems().sort(function(e,t){return e.extreme===t.extreme?0:e.extreme&&!t.extreme?-1:1}),Hs({configs:t,crossPlacements:c,model:d,size:l,all:e.all});var f=d.getItems(),h=[];f.filter(function(e){return e.placement}).forEach(function(e){var t,n,r,i,o,s=null!==(t=e.node.data.value)&&void 0!==t&&t.hasBackground?2:0,l=null!==(n=e.node.data.value)&&void 0!==n&&n.hasBackground?2:0,c=(null===(r=e.node.data.value)||void 0===r||null===(r=r.style)||void 0===r||null===(r=r.label)||void 0===r?void 0:r.fontSize)||u.fontSize,d=(null===(i=e.node.data.value)||void 0===i||null===(i=i.style)||void 0===i||null===(i=i.label)||void 0===i?void 0:i.fontFamily)||u.fontFamily,f=(null===(o=e.node.data.value)||void 0===o?void 0:o.labelColor)||u.fill;e.labelMeasurements.lines?e.labelMeasurements.lines.forEach(function(t,n){h.push({type:"text",x:e.placement.x+e.placement.width/2,y:e.placement.y+(n+.5)*t.size.height+s+l,fontSize:c,fontFamily:d,fill:f,text:t.text,data:e.node.data.value,baseline:"central",anchor:"middle"})}):h.push({type:"text",x:e.placement.x+e.placement.width/2,y:e.placement.y+e.labelMeasurements.height/2+s+l,fontSize:c,fontFamily:d,fill:f,text:a.label(e.node.data),data:e.node.data.value,baseline:"central",anchor:"middle"})});var p=f.filter(function(e){var t;return e.placement&&(null===(t=e.node.data.value)||void 0===t?void 0:t.hasBackground)}).map(function(e){var t;return{type:"rect",x:e.placement.x+2,y:e.placement.y+2,rx:3,ry:3,fill:null===(t=e.node.data.value)||void 0===t?void 0:t.labelBackgroundColor,width:e.placement.width-4,height:e.placement.height-4,data:e.node.data.value}});return[].concat(Ua(p),h)}},Ws={ACTIONS:{select:{enabled:function(){return!1}}},COMPONENT_KEY:"area-range-component",COMPONENTS:[],DOCK:"bottom",ENABLE:function(){return!0},EVENT_KEY:"area-range",EVENTS:function(){},FILL_TARGETS:[],TARGETS:[]},Ys={area:"area",continuous:"range"};function Gs(e){var t=e.config,n=e.type,r=void 0===n?"continuous":n,i=t.actions,o=t.componentKey,a=t.enable,s=t.eventKey,l=t.events,c=t.fillTargets;return{key:"event:".concat(o),type:"Pan",requireFailure:void 0,recognizeWith:void 0,options:{event:s,enable:function(e,t){if(!a())return!1;if(this.started===s||!t)return!0;if(!i.select.enabled())return!1;var n=this.chart.componentsFromPoint({x:t.center.x,y:t.center.y}).filter(function(e){return-1!==c.indexOf(e.key)}),r=0===n.length&&function(e,t){var n=e.srcEvent.target;return!(!n||0!==(n.getAttribute("data-key")||"").indexOf("".concat(t,"-")))}(t,o);return r?(this.started=s,!0):n.length>0}},events:Pa(Pa(Pa({},"".concat(s,"start"),function(e){void 0===this.chart.brushSelectionIncludeMax&&(this.chart.brushSelectionIncludeMax=!0,i.select.brushSelectionIncludeMax=!0),e.preventDefault(),i.select.emit("start",s),this.chart.component(o).emit("".concat(Ys[r],"Start"),e),this.started=s,l.onRangeStart({chart:this.chart})}),"".concat(s,"move"),function(e){e.preventDefault(),this.chart.component(o).emit("".concat(Ys[r],"Move"),e),l.onRangeMove({chart:this.chart})}),"".concat(s,"end"),function(e){void 0===this.chart.brushSelectionIncludeMax&&(this.chart.brushSelectionIncludeMax=!0,i.select.brushSelectionIncludeMax=!0),e.preventDefault(),this.chart.component(o).emit("".concat(Ys[r],"End"),e),i.select.emit("end",s),this.started=!1,l.onRangeEnd({chart:this.chart})})}}function Ks(e){return Gs({config:e,type:"continuous"})}var Xs={ACTIONS:{select:{enabled:function(){return!1}}},BUBBLES_PLACEMENT:"inside",COMPONENT_KEY:"continuous-range-component",DOCK:"bottom",ENABLE:function(){return!0},EVENT_KEY:"continuous-range",EVENTS:function(){},FILL_TARGETS:[],MULTIPLE:!1,OBSERVE_BRUSH:!1,SCALE:"scale",TARGETS:[]};function Js(e){var t=e.actions,n=e.componentKey,r=e.eventKey;if(!e.onEdited)return!1;var i="".concat(n,"-").concat(r,"-tap");return{prio:1,key:"event:".concat(n,"-tap"),type:"Tap",requireFailure:void 0,recognizeWith:void 0,options:{event:i,interval:10,pointers:1,enable:function(e,r){var i,o;return!(!r||!t.select.enabled()||"INPUT"!==(null===(i=r.target)||void 0===i?void 0:i.nodeName)&&(null===(o=r.target)||void 0===o||!o.hasAttribute("data-other-value")||(r.target.getAttribute("data-key")||"").split("-bubble")[0]!==n))}},events:Pa({},i,function(e){(e.target.getAttribute("data-key")||"").split("-bubble")[0]&&(e.preventDefault(),this.chart.component(n).emit("bubbleStart",e))})}}function Zs(e){var t=function(){var e,t,n,r,i,o,a,s,l,c,u,d,f,h,p,m,g,y=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{actions:null!==(e=y.actions)&&void 0!==e?e:Xs.ACTIONS,bubblesPlacement:null!==(t=y.bubblesPlacement)&&void 0!==t?t:Xs.BUBBLES_PLACEMENT,componentKey:null!==(n=y.componentKey)&&void 0!==n?n:Xs.COMPONENT_KEY,dock:null!==(r=y.dock)&&void 0!==r?r:Xs.DOCK,enable:null!==(i=y.enable)&&void 0!==i?i:Xs.ENABLE,eventKey:null!==(o=y.eventKey)&&void 0!==o?o:Xs.EVENT_KEY,events:{onRangeStart:null!==(a=null===(s=y.events)||void 0===s?void 0:s.onRangeStart)&&void 0!==a?a:Xs.EVENTS,onRangeMove:null!==(l=null===(c=y.events)||void 0===c?void 0:c.onRangeMove)&&void 0!==l?l:Xs.EVENTS,onRangeEnd:null!==(u=null===(d=y.events)||void 0===d?void 0:d.onRangeEnd)&&void 0!==u?u:Xs.EVENTS},fillTargets:null!==(f=y.fillTargets)&&void 0!==f?f:Xs.FILL_TARGETS,multiple:null!==(h=y.multiple)&&void 0!==h?h:Xs.MULTIPLE,observeBrush:null!==(p=y.observeBrush)&&void 0!==p?p:Xs.OBSERVE_BRUSH,onEdited:y.onEdited,scale:null!==(m=y.scale)&&void 0!==m?m:Xs.SCALE,targetFillSelector:y.targetFillSelector,targetSelector:y.targetSelector,targets:null!==(g=y.targets)&&void 0!==g?g:Xs.TARGETS,toLabel:y.toLabel}}(e),n=[Ks(t),Js(t)].filter(Boolean),r=function(e){var t=e.bubblesPlacement,n=e.componentKey,r=e.dock,i=e.fillTargets,o=e.multiple,a=e.observeBrush,s=e.onEdited,l=e.scale,c=e.targetFillSelector,u=e.targets,d=e.targetSelector,f=e.toLabel;return{key:n,type:"brush-range",layout:{dock:u.map(function(e){return"@".concat(e)}).join(",")},on:s?{bubbleEnd:function(){s()}}:{},settings:{brush:a?{context:"selection",observe:!0}:"selection",scale:l,multiple:o,direction:"left"===r||"right"===r?"vertical":"horizontal",bubbles:{align:"left"===r||"top"===r?"end":"start",placement:t,label:f},target:{components:i,selector:d,fillSelector:c,fill:"rgba(82,204,82,0.2)"}}}}(t);return{interactions:n,components:[r]}}var Qs={ACTIONS:{lasso:{enabled:function(){return!1},active:function(){return!1}},select:{enabled:function(){return!1}}},COMPONENT_KEY:"lasso",COMPONENTS:[],EVENTS:function(){},TARGET_KEYS:[]},el="lasso";var tl={ACTIONS:{select:{enabled:function(){return!1}}},COMPONENTS:[],EVENTS:function(){},HIT_RADIUS:0,IS_LOCKED:function(){return!1},TARGETS:[]},nl="tap";function rl(e){var t=e.actions,n=e.components,r=e.events,i=e.hitRadius,o=e.isLocked,a=e.shapesAt,s=e.targets,l={targetComponents:[]};return{key:"event:tap",type:"Tap",requireFailure:void 0,recognizeWith:void 0,options:{event:nl,interval:10,pointers:1,enable:function(e,n){return!n||!!t.select.enabled()&&(l.targetComponents=this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).filter(function(e){return-1!==s.indexOf(e.key)}),l.targetComponents.length>0)}},events:Pa({},nl,function(e){if(e.preventDefault(),!o(l.targetComponents)&&t.select.enabled()){var c,u,d,f,h=(c=e,f=this.chart.element.getBoundingClientRect(),c.center?(u=c.center.x,d=c.center.y):(u=void 0===c.clientX?Math.floor(c.srcEvent.clientX):c.clientX,d=void 0===c.clientY?Math.floor(c.srcEvent.clientY):c.clientY),{x:u-f.left,y:d-f.top}),p="function"==typeof i?i(l.targetComponents):i,m=p>0?{cx:h.x,cy:h.y,r:p}:h,g=a?a(m):this.chart.shapesAt(m,{components:s.map(function(e){return{key:e}})}),y=this.chart.componentsFromPoint({x:e.center.x,y:e.center.y}),v=y.some(function(e){return"legend-cat"===e.type});if(!g.length&&v||(this.chart.brushSelectionIncludeMax=!1,t.select.brushSelectionIncludeMax=!1,t.select.emit("start",nl,y),r.onSelectStart()),g.length&&n){this.chart.brushSelectionIncludeMax=!1,t.select.brushSelectionIncludeMax=!1;var b="function"==typeof n?n(e,g):n;this.chart.brushFromShapes(g,{components:b}),t.select.emit("end",nl),r.onSelectEnd({chart:this.chart})}}})}}var il="object",ol=["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 al=function(e){return{value:e,label:e.charAt(0).toUpperCase()+e.slice(1),groupHeader:!1,disabled:!1,styles:{fontFamily:e}}};function sl(e){var t=e.theme,n=e.translator,r=e.defaultValue,i=[],o=t.getStyle("","","fontFamilies");return Array.isArray(o)&&o.length?i.push.apply(i,Ua(new Set([r].concat(Ua(o.map(function(e){return e.split(",").map(function(e){return e.trim()}).map(function(e){return e.replace(/\s+/g," ").trim()}).filter(Boolean).join(", ")})))))):i.push(r),[{value:"ThemeHeader",label:n.get("properties.themeFonts"),metaText:n.get("properties.theme"),groupHeader:!0}].concat(Ua(i.map(function(e){return al(e)})),[{value:"DefaultHeader",label:n.get("properties.allFonts"),metaText:n.get("properties.default"),groupHeader:!0}],Ua(ol.map(function(e){return al(e)})))}function ll(e){var t=e.theme,n=e.translator,r=e.id,i=e.path,o=function(){return t.getStyle(r,i,"fontFamily")};return{getDefaultValue:function(){return o()},getOptions:function(){return sl({theme:t,translator:n,defaultValue:o()})}}}var cl=["10px","11px","12px","13px","14px","15px","16px","17px","18px","19px","20px","21px","22px","23px","24px"],ul=function(e){return{value:e,label:e,groupHeader:!1,disabled:!1}};function dl(e){var t=e.theme,n=e.translator,r=e.id,i=e.path,o=function(){return t.getStyle(r,i,"fontSize")};return{getDefaultValue:function(){return o()},getOptions:function(){return function(e){var t=e.translator,n=e.defaultValue,r=[],i=e.theme.getStyle("","","fontSizes");return Array.isArray(i)&&i.length?r.push.apply(r,Ua(new Set([n].concat(Ua(i))))):r.push(n),[{value:"ThemeHeader",label:t.get("properties.themeFontSizes"),metaText:t.get("properties.theme"),groupHeader:!0}].concat(Ua(r.map(function(e){return ul(e)})),[{value:"DefaultHeader",label:t.get("properties.allFontSizes"),metaText:t.get("properties.default"),groupHeader:!0}],Ua(cl.map(function(e){return ul(e)})))}({theme:t,translator:n,defaultValue:o()})}}}function fl(e){var t=e.theme,n=e.translator,r=e.id,i=e.path;return{fontFamily:ll({theme:t,translator:n,id:r,path:i}),fontSize:dl({theme:t,translator:n,id:r,path:i})}}var hl,pl,ml=["__proto__","constructor"],gl=function(e){if(ml.some(function(t){return e.includes(t)}))throw new Error("font-resolver: Forbidden property.")};function yl(e){return vl.apply(this,arguments)}function vl(){return(vl=La(ja().m(function e(t){var n,r,i,o;return ja().w(function(e){for(;;)switch(e.n){case 0:if(n=t.app,r=t.items,n.evaluateEx){e.n=1;break}return e.a(2,r);case 1:return e.n=2,Promise.all(r.filter(function(e){var t;return!(null===(t=e.qCalcCondition)||void 0===t||null===(t=t.qCond)||void 0===t||!t.qv)}).map(function(e){var t=e.qCalcCondition.qCond.qv;return n.evaluateEx(t).then(function(t){return 0===t.qNumber?e.qDef.cId:void 0}).catch(function(){return e.qDef.cId})}));case 2:return i=e.v,o=i.filter(Boolean),e.a(2,r.filter(function(e){return!o.includes(e.qDef.cId)}))}},e)}))).apply(this,arguments)}function bl(e){var t=e.app,n=e.translator,r=e.dimension,i={id:r.qDef.cId,text:n.get("Object.ErrorMessage.MissingDimension"),meta:{}},o=r.qLibraryId;if(o)return t.getDimension?t.getDimension(o).then(function(e){return e.getLayout()}).catch(function(){}).then(function(e){if(!e)return i;var t=e.qDim,n=t.qGrouping,o=t.qLabelExpression,a="C"===n,s="H"===n,l="N"===n;return{id:r.qDef.cId,text:o&&l?o:e.qDim.title,meta:{isCyclic:a,isDrillDown:s,isNormal:l}}}):i;var a=r.qDef,s=a.cId,l=a.qLabelExpression,c=a.qFieldLabels,u=a.qFieldDefs,d={isCyclic:!1,isDrillDown:!1,isNormal:!0};return l?t.evaluate?t.evaluate(l).then(function(e){return{id:s,text:e,meta:d}}):i:{id:s,text:c[0]||u[0],meta:d}}function xl(e){return Sl.apply(this,arguments)}function Sl(){return(Sl=La(ja().m(function e(t){var n,r,i,o,a,s,l,c;return ja().w(function(e){for(;;)switch(e.n){case 0:if(r=t.app,i=t.translator,o=t.properties,a=(null==o||null===(n=o.qHyperCubeDef)||void 0===n||null===(n=n.qLayoutExclude)||void 0===n?void 0:n.qHyperCubeDef)||{},s=a.qDimensions,(l=void 0===s?[]:s).length){e.n=1;break}return e.a(2,Promise.resolve([]));case 1:return e.n=2,yl({app:r,items:l});case 2:return c=e.v,e.a(2,Promise.all(c.map(function(e){return bl({app:r,translator:i,dimension:e})})))}},e)}))).apply(this,arguments)}function Ml(e){var t=e.app,n=e.translator,r=e.measure,i={id:r.qDef.cId,text:n.get("Object.ErrorMessage.MissingMeasure")},o=r.qLibraryId;if(o)return t.getMeasure?t.getMeasure(o).then(function(e){return e.getLayout()}).catch(function(){}).then(function(e){if(!e)return i;var t=e.qMeasure.qLabelExpression;return{id:r.qDef.cId,text:t||e.qMeasure.qLabel||e.qMeasure.qDef}}):i;var a=r.qDef,s=a.cId,l=a.qLabelExpression,c=a.qLabel,u=a.qDef;return l?t.evaluate?t.evaluate(l).then(function(e){return{id:s,text:e}}):i:{id:s,text:c||u}}function wl(e){return kl.apply(this,arguments)}function kl(){return(kl=La(ja().m(function e(t){var n,r,i,o,a,s,l,c;return ja().w(function(e){for(;;)switch(e.n){case 0:if(r=t.app,i=t.translator,o=t.properties,a=(null==o||null===(n=o.qHyperCubeDef)||void 0===n||null===(n=n.qLayoutExclude)||void 0===n?void 0:n.qHyperCubeDef)||{},s=a.qMeasures,(l=void 0===s?[]:s).length){e.n=1;break}return e.a(2,Promise.resolve([]));case 1:return e.n=2,yl({app:r,items:l});case 2:return c=e.v,e.a(2,Promise.all(c.map(function(e){return Ml({app:r,translator:i,measure:e})})))}},e)}))).apply(this,arguments)}var El=function(){if(pl)return hl;pl=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=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 r,i=e.call(n,"constructor"),o=n.constructor&&n.constructor.prototype&&e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!i&&!o)return!1;for(r in n);return void 0===r||e.call(n,r)},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(r)return r(t,n).value}return t[n]};return hl=function e(){var t,n,r,l,c,u,d=arguments[0],f=1,h=arguments.length,p=!1;for("boolean"==typeof d&&(p=d,d=arguments[1]||{},f=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});f<h;++f)if(null!=(t=arguments[f]))for(n in t)r=s(d,n),d!==(l=s(t,n))&&(p&&l&&(o(l)||(c=i(l)))?(c?(c=!1,u=r&&i(r)?r:[]):u=r&&o(r)?r:{},a(d,{name:n,newValue:e(p,u,l)})):void 0!==l&&a(d,{name:n,newValue:l}));return d},hl}(),Cl=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}(El);function Nl(e,t){return{range:function(e){var n=e.resources,r=e.data,i=n.theme.palette("categorical",0===t?r.items.length:t);return r.items.map(function(e){return i[e.value%i.length]})},valueAccessor:e.value}}function Tl(e,t){return{range:function(e){var n=e.resources,r=e.data,i=n.theme.palette("categorical",0===t?r.items.length:t);return r.items.map(function(e){return i[e.row.value%i.length]})},valueAccessor:e.value}}function Dl(e,t,n,r,i){var o,a,s=i.byRow,l=i.byElemNo;if(r&&(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(r,r.raw().qCardinal);if(r){var c=t.pic.extract({field:r.key(),trackBy:r.value}).length;return s(r,c)}return{}}function ql(e,t){var n=e.hc.qDimensionInfo,r=t.input.byDimDef||{activeDimensionIndex:n.length-1};if(r.activeDimensionIndex>=0){var i=n[r.activeDimensionIndex];r=i.coloring&&i.coloring.colorMapRef?{type:"libraryItem",key:i.coloring.colorMapRef,activeDimensionIndex:r.activeDimensionIndex}:{activeDimensionIndex:r.activeDimensionIndex}}return r}function Ol(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 Il(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Al(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function _l(){}var Ll=.7,Pl=1/Ll,Rl="\\s*([+-]?\\d+)\\s*",Fl="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",zl="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",jl=/^#([0-9a-f]{3,8})$/,$l=new RegExp(`^rgb\\(${Rl},${Rl},${Rl}\\)$`),Vl=new RegExp(`^rgb\\(${zl},${zl},${zl}\\)$`),Ul=new RegExp(`^rgba\\(${Rl},${Rl},${Rl},${Fl}\\)$`),Hl=new RegExp(`^rgba\\(${zl},${zl},${zl},${Fl}\\)$`),Bl=new RegExp(`^hsl\\(${Fl},${zl},${zl}\\)$`),Wl=new RegExp(`^hsla\\(${Fl},${zl},${zl},${Fl}\\)$`),Yl={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 Gl(){return this.rgb().formatHex()}function Kl(){return this.rgb().formatRgb()}function Xl(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=jl.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?Jl(t):3===n?new tc(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Zl(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Zl(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=$l.exec(e))?new tc(t[1],t[2],t[3],1):(t=Vl.exec(e))?new tc(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Ul.exec(e))?Zl(t[1],t[2],t[3],t[4]):(t=Hl.exec(e))?Zl(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Bl.exec(e))?sc(t[1],t[2]/100,t[3]/100,1):(t=Wl.exec(e))?sc(t[1],t[2]/100,t[3]/100,t[4]):Yl.hasOwnProperty(e)?Jl(Yl[e]):"transparent"===e?new tc(NaN,NaN,NaN,0):null}function Jl(e){return new tc(e>>16&255,e>>8&255,255&e,1)}function Zl(e,t,n,r){return r<=0&&(e=t=n=NaN),new tc(e,t,n,r)}function Ql(e){return e instanceof _l||(e=Xl(e)),e?new tc((e=e.rgb()).r,e.g,e.b,e.opacity):new tc}function ec(e,t,n,r){return 1===arguments.length?Ql(e):new tc(e,t,n,null==r?1:r)}function tc(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function nc(){return`#${ac(this.r)}${ac(this.g)}${ac(this.b)}`}function rc(){const e=ic(this.opacity);return`${1===e?"rgb(":"rgba("}${oc(this.r)}, ${oc(this.g)}, ${oc(this.b)}${1===e?")":`, ${e})`}`}function ic(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function oc(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ac(e){return((e=oc(e))<16?"0":"")+e.toString(16)}function sc(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new cc(e,t,n,r)}function lc(e){if(e instanceof cc)return new cc(e.h,e.s,e.l,e.opacity);if(e instanceof _l||(e=Xl(e)),!e)return new cc;if(e instanceof cc)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(a=t===o?(n-r)/s+6*(n<r):n===o?(r-t)/s+2:(t-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new cc(a,s,l,e.opacity)}function cc(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function uc(e){return(e=(e||0)%360)<0?e+360:e}function dc(e){return Math.max(0,Math.min(1,e||0))}function fc(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}Il(_l,Xl,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Gl,formatHex:Gl,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return lc(this).formatHsl()},formatRgb:Kl,toString:Kl}),Il(tc,ec,Al(_l,{brighter(e){return e=null==e?Pl:Math.pow(Pl,e),new tc(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?Ll:Math.pow(Ll,e),new tc(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new tc(oc(this.r),oc(this.g),oc(this.b),ic(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:nc,formatHex:nc,formatHex8:function(){return`#${ac(this.r)}${ac(this.g)}${ac(this.b)}${ac(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:rc,toString:rc})),Il(cc,function(e,t,n,r){return 1===arguments.length?lc(e):new cc(e,t,n,null==r?1:r)},Al(_l,{brighter(e){return e=null==e?Pl:Math.pow(Pl,e),new cc(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?Ll:Math.pow(Ll,e),new cc(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,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new tc(fc(e>=240?e-240:e+120,i,r),fc(e,i,r),fc(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new cc(uc(this.h),dc(this.s),dc(this.l),ic(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=ic(this.opacity);return`${1===e?"hsl(":"hsla("}${uc(this.h)}, ${100*dc(this.s)}%, ${100*dc(this.l)}%${1===e?")":`, ${e})`}`}}));const hc=Math.PI/180,pc=180/Math.PI,mc=.96422,gc=.82521,yc=4/29,vc=6/29,bc=3*vc*vc,xc=vc*vc*vc;function Sc(e){if(e instanceof Mc)return new Mc(e.l,e.a,e.b,e.opacity);if(e instanceof Nc)return Tc(e);e instanceof tc||(e=Ql(e));var t,n,r=Cc(e.r),i=Cc(e.g),o=Cc(e.b),a=wc((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=a:(t=wc((.4360747*r+.3850649*i+.1430804*o)/mc),n=wc((.0139322*r+.0971045*i+.7141733*o)/gc)),new Mc(116*a-16,500*(t-a),200*(a-n),e.opacity)}function Mc(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function wc(e){return e>xc?Math.pow(e,1/3):e/bc+yc}function kc(e){return e>vc?e*e*e:bc*(e-yc)}function Ec(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Cc(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Nc(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function Tc(e){if(isNaN(e.h))return new Mc(e.l,0,0,e.opacity);var t=e.h*hc;return new Mc(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}Il(Mc,function(e,t,n,r){return 1===arguments.length?Sc(e):new Mc(e,t,n,null==r?1:r)},Al(_l,{brighter(e){return new Mc(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new Mc(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 tc(Ec(3.1338561*(t=mc*kc(t))-1.6168667*(e=1*kc(e))-.4906146*(n=gc*kc(n))),Ec(-.9787684*t+1.9161415*e+.033454*n),Ec(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),Il(Nc,function(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof Nc)return new Nc(e.h,e.c,e.l,e.opacity);if(e instanceof Mc||(e=Sc(e)),0===e.a&&0===e.b)return new Nc(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*pc;return new Nc(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new Nc(e,t,n,null==r?1:r)},Al(_l,{brighter(e){return new Nc(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new Nc(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return Tc(this).rgb()}}));var Dc=e=>()=>e;function qc(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):Dc(isNaN(e)?t:e)}var Oc=function e(t){var n=function(e){return 1===(e=+e)?qc: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(r){return Math.pow(e+r*t,n)}}(t,n,e):Dc(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=ec(e)).r,(t=ec(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=qc(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1),Ic=/^class(-pyramid)?/,Ac=function(e,t,n,r){var i=void 0!==n.min?n.min:r.min(),o=void 0!==n.max?n.max:r.max(),a=i,s=o,l=t.limits,c={},u="percent"===t.limitType?l.map(function(e){return i+(o-i)*e}):l,d=t.colors.map(function(t){return e.resolveUIColor(t)});if(i=Math.min.apply(Math,[i].concat(Ua(u))),o=Math.max.apply(Math,[o].concat(Ua(u))),c.min=i,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,r=e.limits,i=e.range,o=[],a=[];if(r.length)if(r[r.length-1]<t)a.push(t,n),o.push(i[i.length-1],i[i.length-1],i[i.length-1]);else if(r[0]>n)a.push(t,n),o.push(i[0],i[0],i[0]);else{if(r[0]>t)a.push(t),o.push(i[0]);else{a.push(t);for(var s=0;s<r.length;s++)if(t<r[s]){o.push(i[s]);break}}for(var l=0;l<r.length;l++)t<r[l]&&r[l]<n&&(a.push(r[l]),o.push(i[l]));if(r[r.length-1]<n)a.push(n),o.push(i[r.length]),o.push(i[r.length]);else{a.push(n);for(var c=0;c<r.length;c++)if(r[c]>n){o.push(i[c]),o.push(i[c]);break}}}else o.push(i[0]);return{min:t,max:n,range:o,domain:a}}({min:"percent"===t.limitType?i:a,max:"percent"===t.limitType?o:s,range:d,limits:"percent"===t.limitType?u:l}));else if(t.breakTypes){var f=t.breakTypes;c.type="continuous",c.domain=[i],c.range=[d[0]];for(var h=0;h<u.length;h+=1)if(f[h]){var p=d[h],m=d[h+1],g=Oc(p,m)(.5);c.range.push(g),c.domain.push(u[h]),h<u.length-1&&f[h+1]&&(c.range.push(d[h+1]),c.domain.push((u[h]+u[h+1])/2))}else c.range.push(d[h]),c.range.push(d[h+1]),c.domain.push(u[h]),c.domain.push(u[h]+Math.min(1e-6,(o-i)/1e6));c.range.push(d[d.length-1]),c.domain.push(o)}else c.domain=u,c.range=d;return c};function _c(e,t,n,r,i){var o,a,s,l=0,c=[],u=(e-t)/(r+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<=r||l>=i?Math.max(l,r):_c(e,t,n,r+1,i)}var Lc=function(e,t,n,r){var i,o,a=t.theme,s=t.hc,l=r.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=[],d=!0;if(l){if(Number.isNaN(+l.min())||Number.isNaN(+l.max()))return{invalid:!0};(d=!("S"===(i=n.pic.raw()).qMode&&(i.qDataPages[0]&&i.qSize.qcy>i.qDataPages[0].qArea.qHeight||!i.qDataPages.length&&i.qSize.qcy>0)||"K"===i.qMode&&i.qStackedDataPages[0]&&i.qSize.qcy>i.qStackedDataPages[0].qArea.qHeight||"T"===i.qMode&&i.qSize.qcy>i.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,Ua(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&&!d)c.min=l.min(),c.max=l.max();else if(l){if(!u.length)return{invalid:!0};c.min=Math.min.apply(Math,Ua(u)),c.max=Math.max.apply(Math,Ua(u))}if(n.input.measureScheme&&(c.palettes={quant:n.input.measureScheme}),a){var f=a.getDataColorScales().filter(function(e){return e.key===n.input.measureScheme})[0];c.type=f&&Ic.test(f.type)?"categorical":"continuous","categorical"===c.type&&(o=f.colors.some(function(e){return Array.isArray(e)})?Math.max.apply(Math,Ua(f.colors.map(function(e){return e?e.length:0}))):f.colors.length)}if("categorical"===c.type){for(var h=d?_c(c.max,c.min,u,1,o):o,p=(c.max-c.min)/h,m=[],g=0;g<h+1;g+=1)m.push(c.min+p*g);c.domain=m,c.range=function(e){for(var t=e.resources.theme.palette("quant",h),n=Math.max(1,Math.floor(t.length/h)),r=[],i=0;i<h;i+=1)r.push(t[i*n]);return[r[0]].concat(r,[r[r.length-1]])}}return c};function Pc(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 Rc(e){e.measureOverrides.every(function(e){return!e})&&(e.measureOverrides=null)}function Fc(e,t){for(var n=(null==t?void 0:t.domain)||[],r=(null==t?void 0:t.range)||[],i=[],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),r.push(a.primary)):r[s]=a.primary,e[o]=null}else if(a){i.push(o);var l=n.indexOf(o);-1!==l&&(n.splice(l,1),r.splice(l,1))}}return{domain:n,range:r,exclude:i}}function zc(e,t,n,r){var i,o=function(e,t,n,r){if(t.input&&!t.input.auto){if("byMeasure"===t.input.mode)return function(e,t,n){var r=t.theme,i=t.hc,o=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).getCField,a=void 0===o?Pc:o,s=n.input.byMeasureDef||{activeMeasureIndex:0},l=a(n,s),c=Lc(0,{theme:r,hc:i},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 d=u.raw().coloring;d&&d.gradient&&Cl(c,Ac(e,d.gradient,c,u))}else c.auxiliary=s;return c}(e,n,t);if("byDimension"===t.input.mode)return function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=r.getCDef,o=void 0===i?ql:i,a=r.getCByField,s=void 0===a?Ol:a,l=r.getPersistence,c=void 0===l?Dl:l,u=o(t,n),d=s(n,u),f=d?d.raw():{},h=n&&n.pic?n.pic.raw():{};if(f.qError||f.qSize&&0===f.qSize.qcy&&!h.qHasOtherValues)return{invalid:!0};var p={mode:"field",fieldType:"dimension",type:"categorical",field:d?d.key():void 0,isFieldLocked:f.qLocked};return("expression"===u.type||u.activeDimensionIndex<0)&&(p.label=u.label,"color.altLabel"===f.labelExpRef&&(p.label=n.input.altLabel)),!p.label&&d&&(p.label=d.title()),n.input.dimensionScheme&&(p.palettes={categorical:n.input.dimensionScheme}),n.input.useDimColVal&&"libraryItem"===u.type&&(p.auxiliary=u),Cl(p,c(t,n,u,d,{byRow:Tl,byElemNo:Nl})),p}(e,n,t);if("byExpression"===t.input.mode)return function(e,t,n,r){var i=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:r.nil};if(n.input.expressionIsColor)return{mode:"field",fieldType:"expression",field:s?s.key():void 0,type:"color"};var l=Lc(0,{hc:i,theme:o},n,{f:s});return l.invalid||(l.label=n.input.expressionLabel||a.get("Object.ChartTooltip.ColorExpression")),l}(0,n,t,r);if("byMultiple"===t.input.mode||"primary"===t.input.mode)return function(e,t,n,r){var i=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)&&i.qMeasureInfo.length>1&&(s="measure"),"measure"===s){var l=[],c=[];"measure"===n.input.useBaseColors&&i.qMeasureInfo.forEach(function(t,n){if(t.baseColor||t.coloring&&t.coloring.baseColor){l.push(n);var i=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===i?c.push(r.primary):c.push(i)}});var u=n.input.dimensionScheme?{categorical:n.input.dimensionScheme}:void 0,d=o?o.getDataColorPalettes()[0]:void 0;return"measure"===n.input.useBaseColors&&d&&(u={categorical:d.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 f=[],h=[];return i.qDimensionInfo.forEach(function(t,n){if(t.baseColor||t.coloring&&t.coloring.baseColor){f.push(n);var i=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===i?h.push(r.primary):h.push(i)}}),{mode:"dimension",type:"categorical",field:f.length?f[0]:void 0,explicit:f.length?{domain:f,range:h}:void 0}}var p=r.primary;if(void 0!==n.input.paletteColor)n.input.paletteColor&&(p=e.resolveUIColor(n.input.paletteColor));else{var m=n.input.singleColor;"number"!=typeof m||Number.isNaN(m)||(p=["#b0afae","#7b7a78","#545352","#4477aa","#7db8da","#b6d7ea","#46c646","#f93f17","#ffcf02","#276e27","#ffffff","#000000"][m])}return{mode:"constant",type:"constant",primary:p}}(e,n,t,r)}return{}}(e,t,n,r);return null!==(i=t.input)&&void 0!==i&&i.measureOverrides?(o.measureOverrides=t.input.measureOverrides.map(function(n,i){return function(e){var t,n=e.cm,r=e.defaults,i=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 r=n.primary;return void 0!==t.paletteColor&&t.paletteColor&&(r=e.resolveUIColor(t.paletteColor)),Fa(Fa({},n),{},{mode:"constant",type:"constant",primary:r})}(n,o,r):"byExpression"===s?function(e,t,n){var r="qMeasureInfo/".concat(e,"/"),i=t.field(function(e){return e.id().startsWith(r)&&"colorByMeasureExpression"===e.raw().id}),o=i;return Fa(Fa({},n),{},o?{mode:"field",fieldType:"expression",field:i?i.key():void 0,type:"color"}:{mode:"constant",type:"constant",primary:n.nil})}(i,a,r):null}({cm:e,input:n,defaults:r,index:i,pic:t.pic})}),function(e,t){var n,r,i,o=t.translator;if(Rc(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=Fc(e.measureOverrides,e.explicit),Rc(e)),null!==(r=e.measureOverrides)&&void 0!==r&&r.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=Fc(e.measureOverrides),a}return null!==(i=e.measureOverrides)&&void 0!==i&&i.every(function(e){return e})?{invalid:!0,measureOverrides:e.measureOverrides}:e}(o,n)):o}var jc=function(e,t){var n=e.fieldType,r={};if(t)if("measure"===n){var i=t.coloring;i&&(r.measureGradient=i.gradient)}else if("dimension"===n){var o=t[0],a=t[1];o&&(r.legendDataPage=o),a&&(r.dimValsData=a.colorMap)}return r},$c=function(e){throw e.isHandled=!0,e};function Vc(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.auto,n=function(e){var t=Fa({hc:null,colorProps:null,layout:null,theme:null},e),n={},r={auto:function(){return{mode:"primary"}},getDimensionColorMap:function(){return Promise.reject()},getMeasure:function(){return Promise.reject()},getAttributeDimension:function(){return Promise.reject()}},i={auto:function(e){return e?(r.auto=e,i):r.auto},getDimensionColorMap:function(e){return e?(r.getDimensionColorMap=e,i):r.getDimensionColorMap},getAttributeDimension:function(e){return e?(r.getAttributeDimension=e,i):r.getAttributeDimension},getMeasure:function(e){return e?(r.getMeasure=e,i):r.getMeasure},set:function(e){var i;if(!e.colorProps)throw new Error('Missing "colorProps"');if(Cl(t,e),(n={pic:t.picasso.data("q")({data:t.hc,config:{localeInfo:t.localeInfo}}),input:t.colorProps}).input.auto){var o=r.auto(e.layout);n.input=Cl(!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!==(i=n.input.measureOverrides)&&void 0!==i&&i.every(function(e){return!e||!e.on})&&(n.input=Cl(!1,{},n.input,{measureOverrides:null}))},palettes:function(){if(!n.palettes){var e=t.theme,r=[];(e&&e.getDataColorPickerPalettes()||[]).forEach(function(e){r.push({key:"ui",colors:e.colors})}),n.palettes=r}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 i=(e.auxiliary||{}).key;if("measure"===e.fieldType)return r.getMeasure(i,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)?r.getAttributeDimension(o,t).catch(function(){}):Promise.resolve(),i?r.getDimensionColorMap(i,t).catch(function(){}):Promise.resolve()])}return Promise.resolve()},getAuxiliarySettings:function(e,r){var i=this;return e.auxiliary||/qAttrDimInfo/.test(e.field)?(this.palettes(),this.getAuxiliaryData(e,r).then(function(r){if(!r)return{};if("measure"===e.fieldType){if(r.coloring&&r.coloring.gradient){var o=n.pic.field(e.field);return Ac(i,r.coloring.gradient,e,o)}return{}}if("dimension"===e.fieldType){var a={nil:e.nil,others:e.others},s=r[0],l=r[1]?r[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,r){var i=r.external,o=r.field,a=Fa({},e);Cl(a,Nl(o,o.raw().qCardinal));var s=i.theme?i.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,Cl(a,Nl(o)))):!1===t.autoFill&&t.single?a.range=[n.resolveUIColor(t.single)]:t.autoFill&&(s&&(a.palettes={categorical:s.key}),Cl(a,Nl(o))),t.colors&&t.colors.length&&(a.explicit=function(e,t,n){for(var r={},i=0;i<e.length;i+=1)r[e[i].value]=e[i].baseColor;var o=[];return{domain:function(e){var i=e.data,a=[];o=[];for(var s=0;s<i.items.length;s++){var l=i.items[s],c=(l.text||l).label;r[c]&&-1===a.indexOf(l.value)&&(a.push(l.value),o.push(t.resolveUIColor(r[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,i,{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"},r=t.theme;r&&(e=Fa(Fa({},e),r.getDataColorSpecials())),n.settings=Cl(e,zc(this,n,t,e))}return n.settings}};return i}(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,r=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():r&&r.getObject?r.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,r=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():r&&r.getMeasure?r.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,r=t.model,i=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():r&&r.session&&i?r.getHyperCubeData(e,[{qHeight:100,qLeft:0,qTop:0,qWidth:2}]).catch($c):Promise.reject()}(e,{layout:t.layout,model:t.model,app:t.app})});return n.getSnapshotData=jc,n}function Uc(e){return function(t){return"object"===Ha(t.datum[e])?t.datum[e].value:void 0}}function Hc(e){return"object"===Ha(e.datum.isNull)?e.datum.isNull.value:-2===e.datum.value}function Bc(e){return-3===e.datum.value}var Wc={COLOR:void 0,FONT_SIZE:"16px",FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"},Yc={COLOR:void 0,FONT_SIZE:void 0,FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"},Gc="legend.title",Kc="legend.label";function Xc(e){var t=e.theme,n=e.key,r=e.styleOverrides,i={title:{color:Wc.COLOR,fontSize:Wc.FONT_SIZE,fontFamily:Wc.FONT_FAMILY},label:{color:Yc.COLOR,fontSize:Yc.FONT_SIZE,fontFamily:Yc.FONT_FAMILY}};if(!t&&!r)return i;var o=r||{},a=o.title,s=o.label,l=function(e){var t=e.theme,n=e.key;return function(e,r,i,o){return void 0!==e?e:t?t.getStyle(n,r,i):o}}({theme:t,key:n});return i.title.color=l(null==a?void 0:a.color,Gc,"color",Wc.COLOR),i.title.fontSize=l(null==a?void 0:a.fontSize,Gc,"fontSize",Wc.FONT_SIZE),i.title.fontFamily=l(null==a?void 0:a.fontFamily,Gc,"fontFamily",Wc.FONT_FAMILY),i.label.color=l(null==s?void 0:s.color,Kc,"color",Yc.COLOR),i.label.fontSize=l(null==s?void 0:s.fontSize,Kc,"fontSize",Yc.FONT_SIZE),i.label.fontFamily=l(null==s?void 0:s.fontFamily,Kc,"fontFamily",Yc.FONT_FAMILY),i}var Jc=function(e,t,n){var r=e&&e.dock||void 0;if("auto"!==r)return r||"right";if(t){var i=t.element.getBoundingClientRect();if(i.height>i.width)return"bottom"}return n?"left":"right"},Zc=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 Qc(e,t){var n=e.styleReference,r=e.styleOverrides,i=e.chart,o=e.rtl,a=t.legendProps,s=t.coloring,l=t.theme,c=t.hc,u=Xc({theme:l,key:n,styleOverrides:r});return{layout:{minimumLayoutMode:"MEDIUM",dock:Jc(a,i,o)},show:"function"==typeof a.show?function(){return Zc(a,c,s)}:Zc(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 eu(e,t,n){var r=[],i=[],o=function(e,t,n){return"categorical"===t.coloring.type?function(e,t,n){var r=Qc(e,t);if(!r.show)return!1;var i,o=e.key,a=e.styleReference,s=e.styleOverrides,l=e.viewState,c=e.rtl,u=e.settings,d=e.style,f=t.scaleKey,h=t.theme,p=t.scales,m=Xc({theme:h,key:a,styleOverrides:s}),g=r.layout.dock,y="left"===g||"right"===g?{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&&(i=function(e){return e.datum.value>=0||-3===e.datum.value});var b="".concat(f,"Legend");return Cl(!0,r,{type:"legend-cat",key:"".concat(o,"-cat"),scale:b in p?b:f,settings:{layout:{scrollOffset:function(){return l?l.get("legendScrollOffset"):void 0},size:-1!==["top","bottom"].indexOf(r.layout.dock)?2:1,direction:c?"rtl":"ltr",horizontal:20},item:{show:i,label:Fa({fill:m.label.color,fontSize:m.label.fontSize,fontFamily:m.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:d})}(e,t,n):"continuous"===t.coloring.type&&function(e,t){var n,r=e.key,i=e.styleReference,o=e.styleOverrides,a=e.rtl,s=e.settings,l=e.style,c=t.scaleKey,u=t.theme,d="".concat(c,"Range"),f=Qc(e,t);if(!f.show)return!1;var h=Xc({theme:u,key:i,styleOverrides:o}),p=f.layout.dock,m="right"===p||"left"===p,g=null===(n=t.scales)||void 0===n?void 0:n[d];return m&&g&&(g.invert=!0),Cl(!0,f,{type:"legend-seq",key:"".concat(r,"-seq"),settings:{fill:c,major:d,length:1,tick:{fill:h.label.color,fontSize:h.label.fontSize,fontFamily:h.label.fontFamily},title:{anchor:!a||"top"!==f.layout.dock&&"bottom"!==f.layout.dock?void 0:"right",padding:parseFloat(f.settings.title.fontSize)||16}}},{settings:s,style:l})}(e,t)}(e,t,n&&n.navigationDisabled);return r.push(o),o&&"legend-cat"===o.type&&(i.push(function(e){var t=e.key,n=e.requireFailure,r=e.recognizeWith,i=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:tap-".concat(t),type:"Tap",requireFailure:n,recognizeWith:r,options:{event:"legendtap",interval:10,pointers:1,enable:function(e,n){var r;if(!n)return!0;if(null!=i&&null!==(r=i.interact)&&void 0!==r&&r.enabled&&!i.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)),i.push(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.eventName,n=e.key,r=e.requireFailure,i=e.recognizeWith,o=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:pan-".concat(n),type:"Pan",requireFailure:r,recognizeWith:i,options:{event:t,pointers:1,threshold:10,enable:function(e,r){var i;return this.started===t||!r||!(null!=o&&null!==(i=o.interact)&&void 0!==i&&i.enabled&&!o.interact.enabled())&&this.chart.componentsFromPoint({x:r.center.x,y:r.center.y}).some(function(e){return e.key==="".concat(n,"-cat")})}},events:Pa(Pa(Pa({},"".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:i,components:r}}var tu=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function nu(e){var t=e.qHyperCube,n=t.qDimensionInfo,r=t.qMeasureInfo,i=n.some(tu),o=r.some(tu),a=e.color.useBaseColors;return"measure"===a&&!o||"dimension"===a&&!i?"off":a}var ru=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function iu(e){var t,n=e.qHyperCube.qDimensionInfo.some(ru),r=e.qHyperCube.qMeasureInfo.some(ru),i=n?"dimension":void 0;return{mode:"primary",useBaseColors:null!==(t=null!=i?i:r?"measure":void 0)&&void 0!==t?t:"off",paletteColor:null}}var ou=function(){};function au(e){var t,n,r,i,o=e.picasso,a=e.model,s=e.app,l=e.translator,c=e.layoutService,u=void 0===c?void 0:c,d=e.createConfig,f=void 0===d?ou:d,h=e.config,p=void 0===h?{}:h,m=e.custom,g=void 0===m?{}:m,y=p.localeInfo,v=p.key,b=p.theme,x=void 0===b?void 0:b,S=p.auto,M=void 0===S?void 0:S,w=p.definitionPath,k=null==u||null===(t=u.getLayout)||void 0===t?void 0:t.call(u),E={theme:x,key:v,localeInfo:y,layout:k,hc:null==u||null===(n=u.getHyperCube)||void 0===n?void 0:n.call(u),legendProps:null==u||null===(r=u.getLayoutValue)||void 0===r?void 0:r.call(u,"legend"),colorProps:Fa(Fa({},null==u||null===(i=u.getLayoutValue)||void 0===i?void 0:i.call(u,"color")),{},{useBaseColors:k?nu(k):void 0})},C=function(e){var t=Vc({resources:e}),n={},r={},i=function(e){return r.settings||(e||console.warn("settings() called before auxiliarySettings()"),r.settings=t.settings()),r.settings},o={config:function(i){if(n=Fa({},i),r={},!n.key)throw new Error("Missing key");t.set(Fa(Fa({},e),n))},auto:function(e){return e?(t.auto(e),o):t.auto()},getAuxiliarySettings:function(e){return r.auxiliarySettings?Promise.resolve(r.auxiliarySettings):t.getAuxiliarySettings(i(!0),e).then(function(e){return r.auxiliarySettings=e||{},r.settings=Fa(Fa({},r.settings),r.auxiliarySettings),r.scales=void 0,r.color=void 0,r.auxiliarySettings})},getAuxiliaryData:function(){return t.getAuxiliaryData(i())},getSnapshotData:function(e){var n=i();return t.getAuxiliaryData(n,e).then(function(e){return t.getSnapshotData(n,e)})},resolveUIColor:function(e){return t.resolveUIColor(e)},settings:function(){var e=i();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=i().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)}(i(),{isMeasureSelectionLocked:t})},palettes:function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.colorProps,n=e.coloring,r=e.theme,i=[];if(n&&n.palettes&&r){var o=n.palettes.categorical||t.dimensionScheme,a=r.getDataColorPalettes().filter(function(e){return e.key===o})[0]||r.getDataColorPalettes()[0];o&&a&&i.push({key:"categorical",colors:a.colors});var s=n.palettes.metric||t.measureScheme,l=r.getDataColorScales().filter(function(e){return e.key===s})[0]||r.getDataColorScales()[0];if(l){var c=l.colors[0]?l.colors:[[]].concat(Ua(l.colors.slice(1)));c=Array.isArray(c[0])?c.map(function(e){return e.slice().reverse()}):c.slice().reverse(),i.push({key:"quant",colors:c})}}return i}({coloring:i(),colorProps:n.colorProps,theme:n.theme})},scales:function(){return r.scales=r.scales||function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.hc,n=e.coloring,r=e.rtl,i=e.key,o=e.source,a=e.picasso,s={},l=i;if(n){var c={override:!0,domain:n.explicit&&"function"==typeof n.explicit.domain?n.explicit.domain:[].concat(Ua((n.explicit||{}).domain||[]),[-3,-2]),range:n.explicit&&"function"==typeof n.explicit.range?n.explicit.range:[].concat(Ua((n.explicit||{}).range||[]),[n.others,n.nil])};if("field"===n.mode){if("dimension"===n.fieldType){var u,d=function(e){var t=e.hc,n=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:e.source,field:n.field,trackBy:n.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}),f=d.data;if(n.legendDataset){var h=0,p={};a.data("q")({data:t}).extract({field:n.field,trackBy:n.valueAccessor,reduce:function(e){var t=e[0];return p[t]=h++,e[0]}}),u={source:"attrDim",extract:{field:"qDimensionInfo/0",filter:function(e){return e.qElemNumber>=0},props:{row:{value:function(e){return p[e.qElemNumber]}}}}}}var m={data:f,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]=m,u&&(s["".concat(l,"Legend")]=Fa(Fa({},m),{},{data:u})),t&&t.qHasOtherValues&&u&&((u||m.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]=Cl({},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")]=Cl({},g,{invert:!!r}))}else if("color"!==n.type)throw new Error("UNUSED FIELD")}else if("dimension"===n.mode){var y={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]=y}else if("measure"===n.mode){var v={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]=v}}return s}({hc:n.hc,coloring:i(),key:n.key,source:n.source,picasso:e.picasso}),r.scales},color:function(){return r.color=r.color||function(e){var t=e.coloring,n=e.scales,r=e.key,i=Uc(r),o=Uc("".concat(r,"IsAnOther")),a=function(e,t){var r=e.fieldType,a=e.invalid,s=e.mode,l=e.nil,c=e.others,u=e.primary,d=e.type;return a?function(e){return Bc(e)||o(e)?c:l}:n[t]?function(e){return Bc(e)?c:Hc(e)||-2===i(e)&&"dimension"===r||"NaN"===i(e)?l:o(e)?c:e.resources.scale(t)(i(e))||c}:"constant"===s?function(e){return Bc(e)||o(e)?c:Hc(e)?l:u}:"color"===d?function(e){return Bc(e)||o(e)?c:Hc(e)?l:i(e)||c}:null},s=a(t,r);if(t.measureOverrides){var l=Uc("".concat(r,"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:i(),scales:this.scales(),key:n.key}),r.color},datumProps:function(e){return function(e){var t,n,r=e.hc,i=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=i.nil;"field"===i.mode&&i.field?t=i.field:o[a]&&"field"===i.mode&&(t=o[a].data.field||i.field),t?(n={field:t,reduce:"first"},"color"===i.type&&(n.value=function(e){return"NaN"!==e.qNum?(t=e.qNum,"rgba(".concat([(16711680&t)>>16,(65280&t)>>8,255&t,((4278190080&t)>>>24)/255].join(","),")")):e.qText&&Xl(e.qText)?e.qText:u;var t})):"dimension"===i.mode?n=void 0!==i.field?i.field:r.qDimensionInfo.length-1:"measure"===i.mode&&(n=l);var d=Pa({},c,n);return r.qDimensionInfo.length>1&&(d["".concat(c,"IsAnOther")]={fields:r.qDimensionInfo.map(function(e,t){return{field:"qDimensionInfo/".concat(t)}}),value:function(e){return-1!==e.indexOf(-3)}}),s&&(d["".concat(c,"MeasureIdx")]=l),d}({coloring:this.settingsForMeasure(e),scales:this.scales(),key:n.key,hc:n.hc,addMeasureIx:i().measureOverrides},e)},data:function(){var e=i(),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,r=e.key,o=e.viewState,a=e.chart,s=e.rtl,l=e.styleReference,c=void 0===l?"object.legend":l,u=e.styleOverrides,d=e.settings,f=void 0===d?{}:d,h=e.style,p=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return eu({eventName:t,key:r,rtl:s,viewState:o,chart:a,styleReference:c,styleOverrides:u,settings:f,style:void 0===h?{}:h},{legendProps:n.legendProps,scaleKey:n.key,coloring:i(),theme:n.theme,hc:n.hc,scales:this.scales()},p)}};return o}({picasso:o,model:a,app:s,translator:l,auto:M});!1!==M&&C.auto(function(e){return M?M({layout:e,defaultAuto:iu}):iu(e)});var N=!1,T={getColor:function(){return C.color()},getPaletteColor:function(e){var t=e.index,n=e.color;return C.resolveUIColor({index:t,color:n})},getData:function(){return C.data()},getDatumProps:function(e){return C.datumProps(e)},getSnapshotData:function(){return C.getSnapshotData(w)},getSettingsForMeasure:function(e){return C.settingsForMeasure(e)},getSettings:function(){return C.settings()},getLegend:function(e,t){return C.legend(e,t)},getScales:function(){return C.scales()},getPalettes:function(){return C.palettes()},isSelectionLocked:function(e){var t=e.isMeasureSelectionLocked;return C.isSelectionLocked({isMeasureSelectionLocked:t})},isInitialized:function(){return N},custom:Fa({},g),initialize:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).createConfig,t=(void 0===e?f:e)({getUseBaseColors:nu}),n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Fa(Fa(Fa({},e),t),{},{colorProps:Fa(Fa({},e.colorProps),t.colorProps||{})})}(E,t);return C.config(n),C.getAuxiliarySettings(w).then(function(){N=!0})}};return T}var su="center",lu="bottom",cu=[{key:"NoDataExist",alignment:su,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:su,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:su,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:su},{key:"DataRangeIncludingZero",alignment:lu},{key:"LimitedData",alignment:lu},{key:"NegativeOrZeroValues",alignment:lu}].reduce(function(e,t){return e[t.key]=t,e},{}),uu=function(){return!1};function du(e){var t=e.chart,n=e.logicalSize;if(n)return n;var r=t?t.element.getBoundingClientRect():{};return{width:r.width,height:r.height}}var fu=[{key:"FULL",size:{width:550,height:450}},{key:"MEDIUM",size:{width:400,height:220}},{key:"SMALL",size:{width:300,height:150}},{key:"XSMALL",size:{width:150,height:75}}];function hu(e){var t=e.width,n=e.height,r=fu.filter(function(e){return t>=e.size.width&&n>=e.size.height}).shift();return r?r.key:"SPARK"}var pu={left:"right",right:"left",top:"bottom",bottom:"top",near:"far",far:"near"};function mu(e){var t=e.orientation,n=e.dock,r=e.btt,i=e.rtl,o="horizontal"===t?function(e){return"bottom"===e||"near"===e?"bottom":"top"}(n):function(e,t){var n="left"===e||"near"===e?"left":"right";return t?pu[n]:n}(n,i),a=function(e,t,n){return"vertical"===e?t?"bottom":"top":n?"right":"left"}(t,r,i);return{current:o,opposite:pu[o],start:a,end:pu[a]}}function gu(e){var t=e.chart,n=e.layoutService,r=e.config,i=void 0===r?{}:r,o=i.logicalSize,a=void 0!==o&&o,s=i.rtl,l=void 0!==s&&s,c={chart:{size:void 0,mode:void 0},x:{dock:void 0,opposite:void 0,size:void 0},y:{dock:void 0,opposite:void 0,size:void 0}},u={type:"x-y",config:Fa({},i),meta:c,update:function(e){c.chart.size={width:e.width,height:e.height},c.chart.mode=hu(e);var t=mu({orientation:"horizontal",dock:n.getLayoutValue("xAxis.dock"),btt:!1,rtl:l}),r=t.current,i=t.opposite;c.x.dock=r,c.x.opposite=i,c.x.size=e.width;var o=mu({orientation:"vertical",dock:n.getLayoutValue("yAxis.dock"),btt:!0,rtl:l}),a=o.current,s=o.opposite;c.y.dock=a,c.y.opposite=s,c.y.size=e.height}};return u.update(du({chart:t,logicalSize:a})),u}var yu="vertical",vu="horizontal";function bu(e){var t=e.chart,n=e.layoutService,r=e.config,i=void 0===r?{}:r,o=e.typeConfig,a=void 0===o?{}:o,s=i.logicalSize,l=void 0!==s&&s,c=i.rtl,u=void 0!==c&&c,d=a.fallback===yu?yu:vu,f=!!a.invert,h=a.measureAxes||[{ref:"measureAxis",name:"minor"}],p={chart:{orientation:void 0,size:void 0,mode:void 0},major:{orientation:void 0,dock:void 0,opposite:void 0,size:void 0}},m={type:"major-minor",config:Fa({},i),meta:p,update:function(e){p.chart.orientation=n.getLayoutValue("orientation",d),p.chart.size={width:e.width,height:e.height},p.chart.mode=hu(e),p.major.orientation=function(e){var t=e.chartOrientation,n=e.invert;return e.layoutService.meta.isContinuous?vu:n?t===yu?vu:yu:t}({layoutService:n,chartOrientation:p.chart.orientation,invert:f});var t=mu({orientation:p.major.orientation,dock:n.getLayoutValue("dimensionAxis.dock"),btt:!1,rtl:u}),r=t.current,i=t.opposite;p.major.dock=r,p.major.opposite=i,p.major.size=p.major.orientation===yu?e.height:e.width,h.forEach(function(t){var r={};r.orientation=p.major.orientation===yu?vu:yu;var i=mu({orientation:r.orientation,dock:n.getLayoutValue("".concat(t.ref,".dock")),btt:!0,rtl:u}),o=i.current,a=i.opposite,s=i.start,l=i.end;r.dock=o,r.opposite=a,r.start=s,r.end=l,r.size=r.orientation===yu?e.height:e.width,p[t.name]=r})}};return m.update(du({chart:t,logicalSize:l})),m}function xu(e){var t=e.chart,n=e.layoutService,r=e.config,i=void 0===r?{}:r,o=e.typeConfig,a=void 0===o?{}:o;return("x-y"===a.type?gu:bu)({chart:t,layoutService:n,config:i,typeConfig:a})}function Su(e,t,n){if(void 0===e||void 0===t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var a=r[o];if(void 0===i[a])return n;i=i[a]}return i}var Mu=["__proto__","constructor"];function wu(e,t,n){if(void 0!==e&&void 0!==t){var r=t.split("."),i=r[r.length-1];if(!Mu.some(function(e){return r.includes(e)})){for(var o=e,a=0;a<r.length-1;++a){var s=r[a];void 0===o[s]&&(o[s]=Number.isNaN(+r[a+1])?{}:[]),o=o[s]}void 0!==n?o[i]=n:delete o[i]}}}function ku(){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={}}}}function Eu(e){var t=Fa({},e),n={},r={},i=!1,o={get:function(e){return t[e]},set:function(e,o){var a=t[e];!i&&n[e]?t[e]=n[e](o,a):t[e]=o,!i&&r[e]&&r[e](t[e],a)},preventSet:function(e,t){i=!0,o.set(e,t),i=!1},intercept:function(e,t){n[e]=t},onChanged:function(e,t){r[e]=t}};return o}function Cu(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50;return function(){for(var r=this,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];clearTimeout(t),t=setTimeout(function(){return e.apply(r,o)},n)}}function Nu(e){var t,n,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50,o=0;return function(){t=this;for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];n=s;var c=Date.now()-o,u=function(){o=Date.now(),r=0,e.apply(t,n)};r||(c>=i?u():r=setTimeout(u,i-c))}}var Tu={ERROR_CODES:[7005],DIMENSION:"qDimensionInfo",MEASURE:"qMeasureInfo"},Du=function(e,t){return e[t].reduce(function(e,t,n){var r;return r=t,Tu.ERROR_CODES.some(function(e){var t;return e===(null===(t=r.qError)||void 0===t?void 0:t.qErrorCode)})?e.filtered.push(n):e.reduced.push(t),e},{reduced:[],filtered:[]})};function qu(e){var t;return((null==e||null===(t=e.qHyperCube)||void 0===t?void 0:t.qDimensionInfo)||[]).map(function(e){var t,n=null===(t=e.qCardinalities)||void 0===t?void 0:t.qHypercubeCardinal;if(n)return n;var r=e.qStateCounts||{},i=r.qLocked,o=void 0===i?0:i,a=r.qOption,s=void 0===a?0:a,l=r.qSelected;return o+s+(void 0===l?0:l)})}function Ou(e){switch(e.qHyperCube.qMode){case"S":return function(e){var t=e.qHyperCube.qSize;return{refs:{dataPages:"qHyperCube.qDataPages"},size:{x:t.qcx,y:t.qcy,dimensions:qu(e)}}}(e);case"K":return function(e){var t=qu(e);return{refs:{dataPages:"qHyperCube.qStackedDataPages"},size:{x:e.qHyperCube.qSize.qcx,y:t[0],dimensions:t}}}(e);case"T":return function(e){var t=qu(e);return{refs:{dataPages:"qHyperCube.qTreeDataPages"},size:{x:e.qHyperCube.qSize.qcx,y:t[0],dimensions:t}}}(e);default:throw new Error("Mode not supported")}}function Iu(e){var t=e.source,n=e.metaAdditionsFn,r=e.experimental,i=void 0===r?{filter:!1}:r,o=Cl(!0,{},t),a=i.filter?function(e){var t=e.qHyperCube,n=Du(t,Tu.DIMENSION),r=n.reduced,i=n.filtered;t[Tu.DIMENSION]=r;var o=Du(t,Tu.MEASURE),a=o.reduced,s=o.filtered;return t[Tu.MEASURE]=a,{dimensions:i,measures:s}}(o):{dimensions:[],measures:[]},s=Ou(o),l=function(){var e=function(e){var t=e.layout,n=e.additionsFn,r=void 0===n?function(){return{}}:n,i=e.additionsProps,o=void 0===i?{}:i,a=t.qHyperCube,s=a.qDimensionInfo,l=a.qMeasureInfo,c=a.qMode,u=s.length,d=l.length,f=Fa({mode:{S:"S"===c,P:"P"===c,K:"K"===c,T:"T"===c},dimensionCount:u,measureCount:d,hasMultipleDimensions:u>1,hasMultipleMeasures:d>1,isOneDimensional:1===u,isTwoDimensional:2===u},o);return Fa(Fa({},f),r({layout:t,meta:f}))}({layout:o,additionsFn:n,additionsProps:{size:s.size}});return e.filteredFields=a,e},c={refs:Fa({},s.refs),meta:l(),getLayout:function(){return o},getLayoutValue:function(e,t){return Su(o,e,t)},setLayoutValue:function(e,t){wu(o,e,t),s=Ou(o),c.meta=l()},getHyperCube:function(){return o.qHyperCube},getHyperCubeValue:function(e,t){return Su(o.qHyperCube,e,t)},setHyperCubeValue:function(e,t){wu(o.qHyperCube,e,t),s=Ou(o),c.meta=l()},getDataPages:function(){return Su(o,s.refs.dataPages)},setDataPages:function(e){wu(o,s.refs.dataPages,e),c.meta=l()}};return c}function Au(e){var t=e.originalArray,n=e.newArray,r=e.matchKey;return Array.isArray(t)&&t.length?(n.forEach(function(e){var n=-1;t.some(function(t,i){return t[r]&&t[r]===e[r]&&(n=i),n}),n>-1?t[n]=e:t.push(e)}),t):n}function _u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Lu(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 r=n.call(e,t);if("object"!=typeof r)return r;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 Pu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ru(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Pu(Object(n),!0).forEach(function(t){Lu(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pu(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Fu=Object.prototype.hasOwnProperty,zu=Object.prototype.toString,ju=Object.defineProperty,$u=Object.getOwnPropertyDescriptor,Vu=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===zu.call(e)},Uu=function(e){if(!e||"[object Object]"!==zu.call(e))return!1;var t,n=Fu.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&Fu.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||Fu.call(e,t)},Hu=function(e,t){ju&&"__proto__"===t.name?ju(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},Bu=function(e,t){if("__proto__"===t){if(!Fu.call(e,t))return;if($u)return $u(e,t).value}return e[t]},Wu=function e(){var t,n,r,i,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)r=Bu(s,n),s!==(i=Bu(t,n))&&(u&&i&&(Uu(i)||(o=Vu(i)))?(o?(o=!1,a=r&&Vu(r)?r:[]):a=r&&Uu(r)?r:{},Hu(s,{name:n,newValue:e(u,a,i)})):void 0!==i&&Hu(s,{name:n,newValue:i}));return s};function Yu(e,t,n,r){if(!e)return-1;const i=n.cache,o=e.origin?e.origin():null;o&&(e=o);let a=i.fields.indexOf(e),s=-1,l=-1;if(-1===a)for(let t=0;t<i.wrappedFields.length;t++)if(l=i.wrappedFields[t].attrDims.map(e=>e.instance).indexOf(e),s=i.wrappedFields[t].attrExps.map(e=>e.instance).indexOf(e),-1!==l||-1!==s){a=t;break}if(Array.isArray(r)&&r.some((e,t)=>e!==t)){const e=r.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 Gu(e,t,n){let r=n.key;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function Ku(e){let t=e.cache,n=e.f,r=e.mainCell,i=e.p,o=e.page,a=e.rowIdx,s=e.row,l=e.sourceKey,c=e.target,u=e.targetProp,d=e.columnOrder,f=r;if(i.field&&i.field!==n){const e=Yu(i.field,o,{cache:t},d);if(-1===e)return;f=Wu({qRow:a},e(s))}c[u]=Gu(i,f,{key:l})}function Xu(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let e=0;e<i.length;e++)if(void 0!==i[e].field){const a=t.raw(),s=t.key(),l="object"==typeof i[e].field?i[e].field:t.field(i[e].field),c=r.normalizeConfig(i[e],t),u=c.props,d=c.main,f=Object.keys(u),h=!!i[e].trackBy,p=typeof i[e].trackBy,m={},g=[],y=[];for(let t=0;t<a.qDataPages.length;t++){const o=Yu(l,a.qDataPages[t],{cache:n},a.qColumnOrder);if(-1!==o)for(let c=0;c<a.qDataPages[t].qMatrix.length;c++){const v=a.qDataPages[t].qArea.qTop+c,b=Wu({qRow:v},o(a.qDataPages[t].qMatrix[c])),x=Gu(d,b,{key:s});if(!d.filter||d.filter(b)){for(let e=0;e<f.length;e++){const r=u[f[e]];let i=r.fields||[r];r.fields&&(x[f[e]]=[]);for(let o=0;o<i.length;o++)Ku({cache:n,f:l,mainCell:b,p:i[o],prop:f[e],page:a.qDataPages[t],rowIdx:v,row:a.qDataPages[t].qMatrix[c],sourceKey:s,target:r.fields?x[f[e]]:x,targetProp:r.fields?o:f[e],columnOrder:a.qColumnOrder});if(r.fields){const t=x[f[e]].map(e=>e.value),n=x[f[e]].map(e=>e.label);x[f[e]]={value:"function"==typeof r.value?r.value(t):void 0!==r.value?r.value:t,label:"function"==typeof r.label?r.label(n):void 0!==r.label?String(r.label):String(x[f[e]].value)}}}h&&r.track({cfg:i[e],itemData:b,obj:x,target:g,tracker:m,trackType:p}),y.push(x)}}}const v=h?r.collect(g,{main:d,propsArr:f,props:u}):y;o=[...o,...v]}return o}function Ju(e){var t=0,n=e.children,r=n&&n.length;if(r)for(;--r>=0;)t+=n[r].value;else t=1;e.value=t}function Zu(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=ed)):void 0===t&&(t=Qu);for(var n,r,i,o,a,s=new rd(e),l=[s];n=l.pop();)if((i=t(n.data))&&(a=(i=Array.from(i)).length))for(n.children=i,o=a-1;o>=0;--o)l.push(r=i[o]=new rd(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(nd)}function Qu(e){return e.children}function ed(e){return Array.isArray(e)?e[1]:null}function td(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function nd(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function rd(e){this.data=e,this.depth=this.height=0,this.parent=null}function id(e){return null==e?null:function(e){if("function"!=typeof e)throw new Error;return e}(e)}rd.prototype=Zu.prototype={constructor:rd,count:function(){return this.eachAfter(Ju)},each:function(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this},eachAfter:function(e,t){for(var n,r,i,o=this,a=[o],s=[],l=-1;o=a.pop();)if(s.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r]);for(;o=s.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,r,i=this,o=[i],a=-1;i=o.pop();)if(e.call(t,i,++a,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this},find:function(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r},sum:function(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})},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(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r},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 Zu(this).eachBefore(td)},[Symbol.iterator]:function*(){var e,t,n,r,i=this,o=[i];do{for(e=o.reverse(),o=[];i=e.pop();)if(yield i,t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n])}while(o.length)}};var od={depth:-1},ad={},sd={};function ld(e){return e.id}function cd(e){return e.parentId}function ud(e){let t=e.length;if(t<2)return"";for(;--t>1&&!dd(e,t););return e.slice(0,t)}function dd(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(!(1&n))return!0}return!1}function fd(e,t){"/"===e.charAt(0)&&(e=e.substring(1));const n=e.split("/");let r,i=t;for(let e=0;e<n.length;e++){if("*"===n[e]&&Array.isArray(i)){const t=[];r=n.slice(e+1).join("/");for(let e=0;e<i.length;e++){let n=fd(r,i[e]);Array.isArray(n)?t.push(...n):t.push(n)}return t}if(!n[e]&&Array.isArray(i)){const t=new Array(i.length);r=n.slice(e+1).join("/");for(let e=0;e<i.length;e++)t[e]=fd(r,i[e]);return t}n[e]in i&&(i=i[n[e]])}return i}function hd(e,t,n){let r=[];if(!e||!e.length)return r;if(t<=0){const t=n>=0?[e[n]]:e;r=[...r,...t]}else for(let i=0;i<e.length;i++)e[i].children&&e[i].children.length&&(r=[...r,...hd(e[i].children,t-1,n)]);return r}function pd(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 r=Math.max(0,Math.min(100,t-e));return e=>hd(e.children,r-1,n)}return!1}const md=/^qDimensionInfo(?:\/(\d+))?/,gd=/^\/?qMeasureInfo\/(\d+)/,yd=/\/qAttrExprInfo\/(\d+)/,vd=/\/qAttrDimInfo\/(\d+)/;function bd(e){return(e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map((e,t)=>t)).filter(t=>t<e.qDimensionInfo.length)}function xd(e,t){let n=t.cube;if(!e)return-1;let r=e.origin&&e.origin()?e.origin().key():e.key(),i=!1,o=-1,a=-1,s=-1,l=-1,c=-1,u=-1,d=r;const f=n.qEffectiveInterColumnSortOrder,h=bd(n);return md.test(d)&&(i=!0,o=+md.exec(d)[1],d=r.replace(md,"")),gd.test(d)&&("K"===n.qMode?c=+gd.exec(d)[1]:f&&-1!==f.indexOf(-1)?(c=+gd.exec(d)[1],u=0):u=+gd.exec(d)[1],d=d.replace(gd,"")),d&&(vd.exec(d)?s=+vd.exec(d)[1]:yd.exec(d)&&(a=+yd.exec(d)[1])),l=i?"S"===n.qMode?h[o]:f?f.indexOf(o):o:f&&-1!==f.indexOf(-1)?f.indexOf(-1):n.qDimensionInfo.length-("K"===n.qMode?0:1),{fieldDepth:l+1,pseudoMeasureIndex:c,measureIdx:u,attrDimIdx:s,attrIdx:a}}function Sd(e,t){let n,r,i=pd(e.fieldDepth,t.fieldDepth,t.pseudoMeasureIndex);return n=t.measureIdx>=0?e=>e.data.qValues[t.measureIdx]:e=>e.data,t.attrDimIdx>=0?r=e=>{var n;return null==e||null===(n=e.qAttrDims)||void 0===n?void 0:n.qValues[t.attrDimIdx]}:t.attrIdx>=0&&(r=e=>{var n;return null==e||null===(n=e.qAttrExps)||void 0===n?void 0:n.qValues[t.attrIdx]}),{nodeFn:i,attrFn:r,valueFn:n}}function Md(e,t,n){let r=n.key;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function wd(e){let t=e.propsArr,n=e.props,r=e.item,i=e.itemData,o=e.ret,a=e.sourceKey;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 d=l[n];let f,h,p,m,g,y;if("primitive"===d.type?(p=d.value,y=String(d.value)):("function"==typeof d.value&&(f=e=>d.value(e,r)),"function"==typeof d.label&&(h=e=>d.label(e,r)),d.accessor?(m=d.accessor(r),Array.isArray(m)?(g=m.map(d.valueAccessor),d.attrAccessor&&(g=g.map(d.attrAccessor)),f&&(p=g.map(f),f=null),h&&(y=g.map(h),h=null),p=d.reduce?d.reduce(p):p,y=d.reduceLabel?d.reduceLabel(y,p):String(p)):(p=d.attrAccessor?d.attrAccessor(d.valueAccessor(m)):d.valueAccessor(m),y=p)):(p=i,y=i)),s.fields){const e=f?f(p):p;c.push(e),u.push(h&&null!=y?h(y):null!=y?y:String(e))}else{const n=f?f(p):p;o[t[e]]={value:n,label:h?h(y):null!=y?y:String(n)},d.field&&(o[t[e]].source={field:d.field.key(),key:a})}}c&&(o[t[e]]={value:"function"==typeof s.value?s.value(c,r):c,label:"function"==typeof s.label?s.label(u,r):u})}}const kd=(e,t,n)=>{const r="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",i="K"===e.qMode?"qSubNodes":"qNodes",o=fd(r,e);return o&&o[0]?(t.tree=Zu(o[0],n.children||(e=>e[i])),t.tree):null},Ed=e=>{let t=e.propsArr,n=e.props,r=e.cube;e.cache;let i=e.itemDepthObject,o=e.f;for(let e=0;e<t.length;e++){const a=n[t[e]],s=a.fields?a.fields:[a];for(let e=0;e<s.length;e++){const t=s[e];if(t.field!==o){const e=Sd(i,xd(t.field,{cube:r}));t.accessor=e.nodeFn,t.valueAccessor=e.valueFn,t.attrAccessor=e.attrFn}}}};function Cd(){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,r=arguments.length>3?arguments[3]:void 0;const i=t.raw(),o=t.key(),a="S"===i.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),r=e.fields(),i=e.fields().filter(e=>"dimension"===e.type()).map(e=>n.indexOf(r.indexOf(e))),o=e.fields().filter(e=>"measure"===e.type()).map(e=>n.indexOf(r.indexOf(e))),a={__root:{__id:"__root",qValues:[]}};for(let e=0;e<t.length;e++){const n=t[e];let r="__root",l=!1;for(let e=0;e<i.length;e++){var s;const t=n[i[e]],o="".concat(r,"__").concat(null!==(s=t.qElemNumber)&&void 0!==s?s:t.qElemNo);a[o]||(a[o]=Ru({__id:o,__parent:r,qValues:[]},t),l=!0),r=o}if(l)for(let e=0;e<o.length;e++){const t=n[o[e]];a[r].qValues.push(t)}}const l=Object.keys(a).map(e=>a[e]);return function(){var e,t=ld,n=cd;function r(r){var i,o,a,s,l,c,u,d,f=Array.from(r),h=t,p=n,m=new Map;if(null!=e){const t=f.map((t,n)=>function(e){let t=(e=`${e}`).length;return dd(e,t-1)&&!dd(e,t-2)&&(e=e.slice(0,-1)),"/"===e[0]?e:`/${e}`}(e(t,n,r))),n=t.map(ud),i=new Set(t).add("");for(const e of n)i.has(e)||(i.add(e),t.push(e),n.push(ud(e)),f.push(sd));h=(e,n)=>t[n],p=(e,t)=>n[t]}for(a=0,i=f.length;a<i;++a)o=f[a],c=f[a]=new rd(o),null!=(u=h(o,a,r))&&(u+="")&&(d=c.id=u,m.set(d,m.has(d)?ad:c)),null!=(u=p(o,a,r))&&(u+="")&&(c.parent=u);for(a=0;a<i;++a)if(u=(c=f[a]).parent){if(!(l=m.get(u)))throw new Error("missing: "+u);if(l===ad)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===sd&&1===s.children.length;)s=s.children[0],--i;for(let e=f.length-1;e>=0&&(c=f[e]).data===sd;--e)c.data=null}if(s.parent=od,s.eachBefore(function(e){e.depth=e.parent.depth+1,--i}).eachBefore(nd),s.parent=null,i>0)throw new Error("cycle");return s}return r.id=function(e){return arguments.length?(t=id(e),r):t},r.parentId=function(e){return arguments.length?(n=id(e),r):n},r.path=function(t){return arguments.length?(e=id(t),r):e},r}().id(e=>e.__id).parentId(e=>e.__parent)(l)}(t):kd(i,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"===i.qMode){let e=bd(i)[o-1];a=n.fields[e]}else{let e=i.qEffectiveInterColumnSortOrder[o-1];o>i.qEffectiveInterColumnSortOrder.length&&(e=i.qDimensionInfo.length),a=n.fields[e]}const s=r.normalizeConfig(Ru(Ru({},e),{},{field:a?a.key():void 0}),t),c=s.props,u=s.main,d=Object.keys(c);l[o]={propsArr:d,props:c,main:u};const f=a?xd(a,{cube:i}):{fieldDepth:0};Ed({propsArr:d,props:c,cube:i,cache:n,itemDepthObject:f,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,r=l[u[e].depth].main,i=c[e],a=i.data,s=Md(r,a,{key:o});wd({propsArr:t,props:n,item:i,itemData:a,ret:s,sourceKey:o}),u[e].data=s}return a}function Nd(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let a=0;a<i.length;a++)if(void 0!==i[a].field){const s=t.raw(),l=t.key();if(!kd(s,n,e))continue;const c="object"==typeof i[a].field?i[a].field:t.field(i[a].field),u=r.normalizeConfig(i[a],t),d=u.props,f=u.main,h=Object.keys(d),p=xd(c,{cube:s}),m=Sd({fieldDepth:0},p),g=m.nodeFn,y=m.attrFn,v=m.valueFn;Ed({propsArr:h,props:d,cube:s,cache:n,itemDepthObject:p,f:c});const b=!!i[a].trackBy,x=typeof i[a].trackBy,S={},M=[],w=g(n.tree),k=[];for(let e=0;e<w.length;e++){const t=w[e],n=y?y(v(t)):v(t);if(f.filter&&!f.filter(n))continue;const o=Md(f,n,{key:l});wd({propsArr:h,props:d,item:t,itemData:n,ret:o,sourceKey:l}),b&&r.track({cfg:i[a],itemData:n,obj:o,target:M,tracker:S,trackType:x}),k.push(o)}const E=b?r.collect(M,{main:f,propsArr:h,props:d}):k;o=[...o,...E]}return o}var Td,Dd,qd=(Td=function(e){
/*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,c,u,d,f=e.length,h=e.search(/[0-9\-\+#]/),p=h>0?e.substring(0,h):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),y=f-g,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=g>0?e.substring(b,f):"";if(n=(t="-"===(e=e.substring(h,b)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),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(m="",y=(d=t[0]).length%l,f=d.length,b=0;b<f;b++)m+=d.charAt(b),!((b-y+1)%l)&&b<f-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),p+(n?"-":"")+r+x}},Td(Dd={exports:{}}),Dd.exports);function Od(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const Id={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"},Ad=/%\)?$/,_d=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,Ld=/^\(oct\)/i,Pd=/^\(dec\)/i,Rd=/^\(hex\)/i,Fd=/^\(bin\)/i,zd=/^\(rom\)/i,jd=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,$d=/#|0/g;function Vd(e,t,n,r){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(".",r||".")}function Ud(e,t,n){const r=Od(e);return n?r:new RegExp(r||"",t)}function Hd(e,t,n,r){let i,o,a,s,l,c,u,d,f,h=e.pattern;var p,m;r&&(e.abbreviate=!0),p=t,(m=n)&&(m=Od(m)),p&&(p=Od(p)),f=new RegExp("(?:[#0]+".concat(p,")?[#0]+(?:").concat(m,"[#0]+)?")),a=h.match(f),a=a?a[0]:"",s=a?h.substr(0,h.indexOf(a)):h,l=a?h.substring(h.indexOf(a)+a.length):"",a||(a=h?"#":"##########"),t&&t===n&&(i=a.split(n),o=i.pop(),a=i.join("")+n+o,t=""),c=t,t=/,/.test(n)?"¤":",",c&&(a=a.replace(Ud(c,"g"),t)),u=n,n=".",u&&(a=a.replace(Ud(u,"g"),n)),d=a.match(/#/g),d=d?d.length:0;const g=h.split(u);let y;g[1]&&(y=g[1].match($d)),e.prefix=s||"",e.postfix=l||"",e.pattern=h,e.maxPrecision=y?y.length:2,e.percentage=Ad.test(h),e.numericPattern=a||"",e.numericRegex=new RegExp("".concat(Ud(t,null,!0),"|").concat(Ud(n,null,!0)),"g"),e.groupTemp=c,e.decTemp=u,e.t=t,e.d=n,e.temp=d}class Bd{constructor(e,t,n,r,i){this.localeInfo=e,this.pattern=t,this.thousandDelimiter=n||",",this.decimalDelimiter=r||".",this.type=i||"numeric",this.patternSeparator=";",this.abbreviations=function(e,t){if(!e||!e.qNumericalAbbreviation)return Id;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 Bd(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return e.subtype=this.subtype,e}format(e,t,n,r){return this.prepare(t,n,r),this.formatValue(e)}prepare(e,t,n){let r;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:""}},r=this._prepared,e=e.split(this.patternSeparator),r.positive.pattern=e[0],r.negative.pattern=e[1],r.zero.pattern=e[2],jd.test(e[0])&&(r.positive.isFunctional=!0),e[1]?jd.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?jd.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1;const i="U"===this.type;r.positive.isFunctional||Hd(r.positive,t,n,i),r.negative&&!r.negative.isFunctional&&Hd(r.negative,t,n,i),r.zero&&!r.zero.isFunctional&&Hd(r.zero,t,n,i)}formatValue(e){let t,n,r,i,o,a,s,l,c,u=this._prepared,d="",f="",h=e;if(isNaN(e))return"".concat(h);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 r;return _d.test(t)?e=Vd(e,Number(/\d{2}/.exec(t)[0]),t,n):Ld.test(t)?e=Vd(e,8,t,n):Pd.test(t)?e=Vd(e,10,t,n):Rd.test(t)?e=Vd(e,16,t,n):Fd.test(t)?e=Vd(e,2,t,n):zd.test(t)&&(r="",e<0&&(r="-",e=-e),0===(e=Math.floor(e))?e="0":e<=5e5?(e=function(e,t){let n,r="",i=Number(String(e).slice(-3)),o=(e-i)/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(;i>0;)for(n=0;n<a.length;n++)if(a[n]<=i){r+=s[n],i-=a[n];break}for(n=0;n<o;n++)r="M".concat(r);return t[1]!==t[1].toUpperCase()&&(r=r.toLowerCase()),r}(e,t),e=r+e):e=t+r+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 r,i,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&&(r=t[s-1]),r&&n>0&&r>0?i=r:(n<0&&r<0||!r)&&(o<0&&o-n<=u.maxPrecision?i=o:r<=n&&!(o>0&&-n<=u.maxPrecision)&&(i=r)),i&&(d=this.abbreviations[i],e/=10**i)}if(r=Math.abs(e),t=u.temp,l=u.numericPattern,c=l.split(o)[1],"I"===this.type&&(e=Math.round(e)),i=e,c||"#"!==l.slice(-1)[0])if(r>=1e15||r>0&&r<=1e-14)e=r?r.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=qd(n,t)||"0",c){const t=Math.max(0,Math.min(14,c.length)),n=c.replace(/#+$/,"").length;let i=("I"===this.type?0:r%1+1e-15).toFixed(t).slice(2).replace(/0+$/,"");for(s=i.length;s<n;s++)i+="0";i&&(e+=o+i)}else 0===t&&(i=0)}else if(r>=10**t||r<1||r<1e-4)0===e?e="0":r<1e-4||r>=1e20?(e=(e=i.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),f=""):(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(r)/Math.log(10)))),s=0;s<t;s++)l+="#";e=qd(l,e)}e=e.replace(u.numericRegex,e=>e===a?u.groupTemp:e===o?u.decTemp:""),i<0&&!/^-/.test(e)&&(e="-".concat(e))}return u.prefix+e+f+d+u.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function Wd(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=t.size,r=void 0===n?5e3:n,i=t.multipleArguments,o=void 0!==i&&i,a=t.toKey,s=void 0===a?e=>e:a;let l,c,u=Object.create(null),d=Object.create(null),f=0,h=0;return l=o?function(){return c=s(...arguments),l.has(c)?l.get(c):l.set(c,e(...arguments))}:t=>(c=s(t),l.has(c)?l.get(c):l.set(c,e(t))),l.set=(e,t)=>(f>=r&&(delete u[d[h]],delete d[h],f--,h++),u[e]=t,d[f]=e,f++,t),l.get=e=>u[e],l.has=e=>e in u,l.clear=()=>{u=Object.create(null),d=Object.create(null),f=0,h=0},l.size=()=>f,l}function Yd(e,t,n,r,i){const o=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Bd(...t)}(i,e,t,n,r),a=Wd(o.formatValue.bind(o),{toKey:e=>isNaN(e)?e:+e});function s(e){return a(e)}return s.format=function(e,t,n,r){return a.clear(),o.format(t,e,n,r)},s.pattern=function(e){return e&&(a.clear(),o.pattern=e,o.prepare()),o.pattern},s}const Gd="D",Kd="T",Xd="TS",Jd=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Zd=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Qd=["January","February","March","April","May","June","July","August","September","October","November","December"],ef=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function tf(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function nf(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}class rf{constructor(e,t,n){const r=e||{};r.qCalendarStrings||(r.qCalendarStrings={qLongDayNames:Jd,qDayNames:Zd,qLongMonthNames:Qd,qMonthNames:ef}),this.localeInfo=r,this.locale_days=r.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=r.qCalendarStrings.qDayNames.slice(),this.locale_months=r.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=r.qCalendarStrings.qMonthNames.slice(),t||(t={[Kd]:r.qTimeFmt||"hh:mm:ss",[Gd]:r.qDateFmt||"YYYY-MM-DD",[Xd]:r.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]),this.pattern=t}clone(){const e=new rf(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 r;e instanceof Date?r=function(e,t){let n=e.getUTCHours(),r=e.getUTCDay()-1;return t&&(n%=12,n||(n=12)),r<0&&(r=6),{year:e.getUTCFullYear(),month:e.getUTCMonth(),day:r,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)),r=function(e,t){let n,r=function(e){const t=e,n=24*nf(t),r=60*nf(n),i=60*nf(r),o=1e3*nf(i);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(r),s:Math.floor(i),f:Math.round(o)}}(e),i=r.d,o=r.h,a=r.m,s=r.s,l=r.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*i),/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:i,h:o,m:a,s:s,f:l,t:u}}(e,t));const i=(o=this,a=r,{"Y+|y+":{Y:"".concat(Number("".concat(a.year).slice(-2))),YY:tf("".concat(a.year).slice(-2),2),YYY:tf("".concat(a.year).slice(-3),3),def:e=>tf("".concat(a.year),e.length)},"M+":{M:a.month+1,MM:tf("".concat(a.month+1),2),MMM:o.locale_months_abbr[a.month],def:o.locale_months[a.month]},"W+|w+":{W:a.day,WW:tf("".concat(a.day),2),WWW:o.locale_days_abbr[a.day],def:o.locale_days[a.day]},"D+|d+":{D:a.date,def:e=>tf("".concat(a.date),e.length)},"h+|H+":{h:a.h,def:e=>tf("".concat(a.h),e.length)},"m+":{m:a.m,def:e=>tf("".concat(a.m),e.length)},"s+|S+":{s:a.s,def:e=>tf("".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 i)Object.prototype.hasOwnProperty.call(i,e)&&s.push(e);const l=new RegExp(s.join("|"),"g");return t.replace(l,e=>{let t,n,r;for(n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&(t=new RegExp(n),t.test(e)))break;if(!t)return"";for(const t in i[n])if(t===e||t.toLowerCase()===e){r=i[n][t],void 0===r&&(r=i[n][t.toLowerCase()]);break}return void 0===r&&(r=i[n].def),"function"==typeof r&&(r=r(e)),r})}}function of(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new rf(...t)}function af(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=of(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),r=Wd(n.format.bind(n),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function i(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=i(e),r(e)}return o.format=function(e,t){return r.clear(),t=i(t),n.format(t,e)},o.locale=function(i){return n=of(i,e,t),r=Wd(n.format.bind(n),{toKey:e=>"object"==typeof e?e.getTime():e}),this},o.qtype=function(e){return void 0!==e&&(t=e,r.clear()),t},o}function sf(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.meta,r=t.id,i=t.key,o=t.localeInfo,a=t.fieldExtractor,s=t.value,l=t.type,c=t.sourceField;const u=s||("dimension"===l?e=>null==e?void 0:e.qElemNo:e=>null==e?void 0:e.qValue),d="dimension"===l?"first":"avg",f=function(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return af(e.qNumFormat.qFmt,e.qNumFormat.qType,t);let n="#",r=t&&void 0!==t.qThousandSep?t.qThousandSep:",",i=t&&void 0!==t.qDecimalSep?t.qDecimalSep:".",o="U",a=e&&!!e.qIsAutoFormat;return e&&e.qNumFormat?(n=e.qNumFormat.qFmt||n,r=e.qNumFormat.qThou||r,i=e.qNumFormat.qDec||i,o=e.qNumFormat.qType||o,a=a&&-1===["M"].indexOf(e.qNumFormat.qType)):a=!0,(a||"U"===o)&&(n="#".concat(i,"##"),o="U"),Yd(n,r,i,o,t)}(n,o),h={id:()=>r,key:()=>i,raw:()=>n,title:()=>n.qFallbackTitle||n.label,type:()=>l,origin:()=>c,items:()=>(e||(e=a(h)),e),min:()=>n.qMin,max:()=>n.qMax,value:u,label:e=>(null==e?void 0:e.qText)||"",reduce:d,reduceLabel:"dimension"===l?"first":(e,t)=>f(t),formatter:()=>f,tags:()=>n.qTags};return h}function lf(e,t,n,r,i){return(t[e]||[]).map((t,o)=>{const a="".concat(r?"".concat(r,"/"):"").concat(e,"/").concat(o),s={instance:sf(Wu({id:"".concat(n?"".concat(n,"/"):"").concat(a),key:a,meta:t},i))};return s.attrDims=lf("qAttrDimInfo",t,n,a,Wu({},i,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),s.attrExps=lf("qAttrExprInfo",t,n,a,Wu({},i,{value:e=>null==e?void 0:e.qNum,type:"measure"})),s.measures=lf("qMeasureInfo",t,n,a,Wu({},i,{value:e=>null==e?void 0:e.qValue,type:"measure"})),s})}function cf(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.key,n=e.data,r=e.config,i=void 0===r?{}:r;const o={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},a=n;if(!a)throw new Error('Missing "data" input');if(!a.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const s=cf.util,l={cache:o,cube:a,localeInfo:i.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:i.virtualFields},c={key:()=>t,raw:()=>a,field:e=>function(e,t){let n=t.cache;if("number"==typeof e)return n.fields[e];const r=n.allFields;if("function"==typeof e){for(let t=0;t<r.length;t++)if(e(r[t]))return r[t];return!1}if("string"==typeof e){for(let t=0;t<r.length;t++)if(r[t].key()===e||r[t].title()===e)return r[t]}else if(e&&-1!==r.indexOf(e))return e;throw Error("Field not found: ".concat(e))}(e,l),fields:()=>o.fields.slice(),extract:e=>l.extractor(e,c,o,s),hierarchy:e=>l.hierarchy(e,c,o,s),_cache:()=>o};"K"===a.qMode||"T"===a.qMode||!a.qMode&&a.qNodesOnDim?(l.extractor=Nd,l.hierarchy=Cd,l.pages="K"===a.qMode?a.qStackedDataPages:a.qTreeDataPages):"S"===a.qMode?(l.extractor=Xu,l.pages=a.qDataPages,l.hierarchy=Cd):l.extractor=()=>[],l.fieldExtractor=e=>l.extractor({field:e},c,o,s);const u="S"===a.qMode?e=>e.qElemNumber:void 0,d="S"===a.qMode?e=>e.qNum:void 0;o.wrappedFields.push(...lf("qDimensionInfo",a,t,"",Wu({},l,{value:u,type:"dimension"}))),o.wrappedFields.push(...lf("qMeasureInfo",a,t,"",Wu({},l,{value:d,type:"measure"}))),o.fields=o.wrappedFields.map(e=>e.instance);const f=e=>{e.forEach(e=>{o.allFields.push(e.instance),f(e.measures),f(e.attrDims),f(e.attrExps)})};return f(o.wrappedFields),(i.virtualFields||[]).forEach(e=>{const n=c.field(e.from),r=sf(Ru({meta:n.raw(),id:"".concat(t,"/").concat(e.key),sourceField:n,fieldExtractor:e=>l.extractor({field:e},c,o,s),key:e.key,type:n.type(),localeInfo:l.localeInfo,value:n.value},e.override||{}));o.virtualFields.push(r)}),o.allFields.push(...o.virtualFields),c}const uf=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],df=/\/qDimensionInfo(?:\/(\d+))?/,ff=/\/qMeasureInfo\/(\d+)/,hf=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,pf=/\/qAttrExprInfo\/(\d+)/,mf=/\/?qHyperCube/,gf=/\/?qTreeData/,yf=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),vf=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function bf(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const r=t.byCells,i=t.primarySource,o=[],a={},s=e.isActive();let l=!1;return e.brushes().forEach(e=>{const t=function(e,t){let n=e,r=-1,i=-1,o="",a=e=>e;mf.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),a=yf):gf.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),a=vf);let s=!0;if(df.test(e)&&(r=+df.exec(e)[1]),ff.test(e)&&(i=+ff.exec(e)[1]),hf.test(e)){i=-1,r=0;const e=+hf.exec(n)[2];isNaN(e)||(r=e,n=n.replace(/\/\d+$/,"")),s=!1}if(pf.test(e)){const e=i;if(t){i=0;const a=fd(o,t);i+=(a.qMeasureInfo||[]).length,r>-1?(i=a.qDimensionInfo.slice(0,r).reduce((e,t)=>e+t.qAttrExprInfo.length,i),r=-1):(i=a.qDimensionInfo.reduce((e,t)=>e+t.qAttrExprInfo.length,i),i=a.qMeasureInfo.slice(0,e).reduce((e,t)=>e+t.qAttrExprInfo.length,i)),i+=+pf.exec(n)[1]}else r>-1?(r=-1,i=+pf.exec(n)[1]):i+=+pf.exec(n)[1]+1}return uf.forEach(e=>{let t=function(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 r,i,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t);else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return _u(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)?_u(e,t):void 0}}(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.")}()}(e,2),r=t[0],i=t[1];n=n.replace(r,i)}),s&&(n=a(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:i,dimensionIdx:r,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(r)if(n&&n.qHyperCube&&("P"===n.qHyperCube.qMode||"T"===n.qHyperCube.qMode||"K"===n.qHyperCube.qMode)){const r=n.qHyperCube,o=r.qNoOfLeftDims,s=r.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(a.selectPivotCells||(a.selectPivotCells={path:t.path,cells:[]}),e.id===i||!i){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!==i&&(i||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 xf(e){cf.util=e.data("matrix").util,e.data("q",cf),e.formatter("q-number",Yd),e.formatter("q-time",af)}function Sf(e){var t=Su(e.layout||{},e.path.split("/").join("."));if(!t)return!1;var n=t.qIsOneAndOnlyOne;return void 0!==n&&n}function Mf(e){var t=e.brush,n=e.colorField,r=e.legendAlias,i=e.useLegendCube,o=void 0!==i&&i;!n||/qAttrDimInfo/.test(n)?(t.removeKeyAlias("attrDim/qDimensionInfo/0"),r&&t.removeKeyAlias(r),t.addKeyAlias("attrDim/qDimensionInfo/0","qHyperCube/".concat(n))):o&&t.addKeyAlias(r,"qHyperCube/".concat(n))}xf.qBrushHelper=bf,xf.selections=bf;var wf="Shift";var kf=function(e,t){return t[e]?kf(e+1,t):e},Ef=function(e,t){var n=t.reduce(function(e,t){return e[t]=!0,e},{});return e.reduce(function(e,t,r){var i=kf(r,n);return n[i]=!0,e[r]=i,e},{})};function Cf(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.layout,n=e.filtered,r=void 0===n?{}:n,i=(null==t?void 0:t.qHyperCube)||{},o=i.qDimensionInfo,a=void 0===o?[]:o,s=i.qMeasureInfo,l=void 0===s?[]:s;return{dimensions:Ef(a,r.dimensions||[]),measures:Ef(l,r.measures||[])}}function Nf(e){var t=e.selection,n=e.fieldMap,r=t.method,i=t.params;if("selectHyperCubeValues"===r){var o=n.dimensions[i[1]];void 0!==o&&(i[1]=o)}return"selectHyperCubeContinuousRange"===r&&i[1].forEach(function(e){var t=n.dimensions[e.qDimIx];void 0!==t&&(e.qDimIx=t)}),t}var Tf=[],Df=0,qf=function(e){var t=Tf.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 Of(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.selections,r=t.brush,i=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=++Df,u=null,d={dimensions:[],measures:[]},f=[],h={};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 r=t.brushes(),i=n(),o=i.allowSimultaneous,a=i.layout,s=void 0===a?{}:a;r.forEach(function(n){var r,i,a;("range"===n.type||null!==(r=e[0])&&void 0!==r&&r.key&&(null===(i=e[0])||void 0===i?void 0:i.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,r=e.values,i=void 0===r?[]:r;if(null==i||!i.length)return[];var o=Array.from(new Set(i.map(function(e){return e.key}))),a=[];return o.forEach(function(e){var t=Sf({layout:n,path:e}),r=i.filter(function(t){return t.key===e}),o=t?[r.pop()]:r;a.push.apply(a,Ua(o))}),a.filter(Boolean)}({layout:s,values:l});return c}return l},rangeInterceptor:function(e){var r=t.brushes(),i=n().allowSimultaneous;return r.filter(function(e){return"value"===e.type}).length?(t.clear([]),e):(r.forEach(function(n){var r=n.id===e[0].key||i.includes(n.id)&&i.includes(e[0].key);"range"!==n.type||r||t.clear([])}),e)}}}({brush:r,getConfig:function(){return{layout:u,allowSimultaneous:f}}}),m=p.rangeInterceptor,g=p.interceptor;r.intercept("set-ranges",m),r.intercept("toggle-ranges",m),r.intercept("toggle-values",g),r.intercept("set-values",g),r.intercept("add-values",g),r.on("start",function(){return n.begin(l)});var y,v,b={activate:function(){},deactivated:function(){return r.end()},cleared:function(){return r.clear()},canceled:function(){return r.end()}};y=n,v=b,Object.keys(v).forEach(function(e){y.on(e,v[e])});var x=null==i||null===(e=i.max)||void 0===e?void 0:e.call(i);return null!=o&&o.select?(o.select.on("start",function(){var e;r.start(),"function"==typeof o.select.getBrushOptions&&(h=(e=o.select).getBrushOptions.apply(e,arguments))}),o.select.on("end",function(){var e=a(r,h,u),t=Cf({layout:u,filtered:d});e.forEach(function(e){var r=Nf({selection:e,fieldMap:t});!function(e,t,n){if(t&&void 0!==n&&"selectHyperCubeContinuousRange"===e.method){var r=e.params;if(r&&r[1]&&r[1][0]){var i=r[1][0],o=i.qDimIx,a=i.qRange;"undefined"!==o&&a&&!1===a.qMaxInclEq&&a.qMax>=n&&(a.qMaxInclEq=!0)}}}(r,o.select.brushSelectionIncludeMax,x),n.select(r)})})):r.on("update",function(){var e=a(r,h,u),t=Cf({layout:u,filtered:d});e.forEach(function(e){n.select(Nf({selection:e,fieldMap:t}))})}),0===Tf.length&&document.addEventListener("keyup",qf),Tf.push({key:c,selections:n}),{layout:function(e){u=e},filteredFields:function(e){d=e},allowSimultaneous:function(e){f=e},release:function(){u=null;var e=Tf.indexOf(Tf.filter(function(e){return e.key===c})[0]);-1!==e&&Tf.splice(e,1),Tf.length||document.removeEventListener("keyup",qf),function(e,t){Object.keys(t).forEach(function(n){e.removeListener(n,t[n])})}(n,b)}}}function If(e){var t=e.chart,n=e.document,r=e.selectionInfo,i=e.eventName,o=e.componentName,a=e.brushName,s=void 0===a?"selection":a,l=e.emit,c=void 0===l?"rangeClear":l,u=r.event===i,d=n.querySelector("[data-key='".concat(o,"-edge-0']"));if(u||!d)return!1;var f=t.component(o);return!!f&&(f.emit(c),"string"==typeof s&&t.brush(s).clear(),f)}var Af=["chart","document","selections","selectionInfo"],_f=function(e){e.chart,e.document,e.selections,e.selectionInfo;var t=za(e,Af);t.clearDiscrete(),t.clearContinuous(),t.clearMinor(),t.clearRange(),t.clearTap(),t.clearLegend()};function Lf(e){var t,n=e.lasso;null!=n&&null!==(t=n.active)&&void 0!==t&&t.call(n)&&(null==n||n.action(!1))}function Pf(e){var t,n=e.chart,r=e.selectionInfo,i=e.selectionActions,o=e.actions,a=void 0===o?{}:o,s=e.selections,l=e.selectionEvents;if(!1===i||!1===l)return function(){};var c=i.reset,u=void 0===c?Lf:c,d=i.clear,f=!1!==d&&function(e){var t=e.clear,n=void 0===t?_f:t,r=e.selections,i=e.selectionInfo,o=e.chart;return function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).cleared,t={selections:r,selectionInfo:i,chart:o,document:document,cleared:e};return n(Fa({clearDiscrete:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var t=e.selectionInfo,n=e.chart,r=e.document,i=e.eventName,o=void 0===i?"discreteRange":i,a=e.componentName,s=void 0===a?"discrete-range-brush":a,l=e.cleared;return If({selectionInfo:t,chart:n,document:r,eventName:void 0!==l&&l?void 0:o,componentName:s,emit:"areaClear",brushName:e.brushName})}(Fa(Fa({},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,r=e.document,i=e.eventName,o=void 0===i?"continuousRange":i,a=e.componentName,s=void 0===a?"continuous-range-brush":a,l=e.cleared;return If({selectionInfo:t,chart:n,document:r,eventName:void 0!==l&&l?void 0:o,componentName:s,brushName:e.brushName})}(Fa(Fa({},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,r=e.document,i=e.componentName,o=void 0===i?"minor-range-brush":i,a=e.eventName,s=void 0===a?"minorRange":a,l=e.cleared,c=void 0!==l&&l,u=e.brushName,d=If({selectionInfo:t,chart:n,document:r,eventName:c?void 0:s,componentName:o,brushName:void 0!==u&&u});if(d){var f=d.settings.settings,h=f.scale,p=f.brush,m=n.scale(h).data().fields.map(function(e){return e.id()}),g=n.brush(p),y=g.brushes().filter(function(e){return"range"===e.type&&m.some(function(t){return t===e.id})});g&&y.length&&y.forEach(function(e){g.removeRanges(e.brush.ranges().map(function(t){return{key:e.id,range:t}}))})}}(Fa(Fa({},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,r=e.document,i=e.selections,o=e.eventName,a=void 0===o?"xAxis":o,s=e.cleared;If({selectionInfo:t,chart:n,document:r,eventName:void 0!==s&&s?void 0:a,componentName:"".concat(a,"-range-brush"),emit:"areaClear",brushName:!1})&&i.clear()}(Fa(Fa({},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,r=e.selections,i=e.events,o=void 0===i?["tap"]:i,a=e.brushNames,s=void 0===a?[]:a;if(n&&o.includes(n.event)){var l=n.currentComponent;n.previousComponent!==l&&(r.clear(),s.forEach(function(e){return t.brush(e).end()}))}}(Fa(Fa({},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,r=e.document,i=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,d=e.brushName;If({selectionInfo:t,chart:n,document:r,eventName:u?void 0:a,componentName:l,brushName:void 0!==d&&d})&&i.clear()}(Fa(Fa({},t),e))}},t))}}({clear:d,selections:s,selectionInfo:r,chart:n}),h=function(e){var t=e.chart,n=e.actions,r=e.reset,i=e.clear,o=!1,a={deactivated:function(e){var t=(n||{}).lasso;r({e:e,lasso:void 0!==t&&t})},canceled:function(e){var o=(n||{}).lasso;r({e:e,lasso:void 0!==o&&o}),i({e:e,chart:t,document:document})},cleared:function(e){o||(o=!0,i({e:e,chart:t,document:document,cleared:!0}),o=!1)}};return!1===r&&delete a.deactivated,!1===i&&delete a.cleared,!1===r&&!1===i&&delete a.canceled,a}({chart:n,clear:f,reset:u,actions:a}),p={};Object.entries(h).forEach(function(e){var t=Va(e,2),n=t[0],r=t[1];p[n]=function(e,t){return t?function(n){return t({event:n,defaultFunc:e})}:e}(r,l[n])});var m=function(e){var t=e.selectionEvents,n=e.selections,r=e.selectionInfo,i=e.clear,o=e.chart,a=e.document,s=t.start,l={selections:n,selectionInfo:r,chart:o,document:a},c=function(e){return Object.assign(r,e||{})},u=function(e){var t=e.event,n=e.components;return function(){return function(e){var t=e.selectionInfo,n=e.clear,r=e.event,i=e.components,o=void 0===i?[]:i;(0,e.setSelectionInfo)(Fa(Fa({},void 0===t?{}:t),{},{event:r,components:o.map(function(e){return e.key}).filter(Boolean)})),n()}({event:t,components:n,clear:i,selectionInfo:r,setSelectionInfo:c})}};return"function"==typeof s?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];s(Fa(Fa({defaultFunc:u({event:e,components:t}),setSelectionInfo:c,clear:i},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:r,clear:f,chart:n,document:document});return null==a||null===(t=a.select)||void 0===t||t.on("start",m),Object.entries(p).forEach(function(e){var t=Va(e,2),n=t[0],r=t[1];null==s||s.on(n,r)}),function(){var e;null==a||null===(e=a.select)||void 0===e||e.removeListener("start",m),Object.entries(p).forEach(function(e){var t=Va(e,2),n=t[0],r=t[1];null==s||s.removeListener(n,r)})}}var Rf=[{key:"qHyperCube/qDimensionInfo/0:numeric",includeMax:!1}];function Ff(e){var t=e.chart,n=e.actions,r=e.selections,i=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,d=void 0===u?{}:u,f=d.clear,h=d.reset,p=o.selectionEvents,m=void 0===p?{deactivated:void 0,canceled:void 0,cleared:void 0,start:void 0}:p,g=o.brushEvents,y=void 0===g?{}:g,v=o.brushName,b=void 0===v?"selection":v,x=o.brushMaxListeners,S=void 0===x?20:x,M=o.brushRanges,w=void 0!==M&&M,k=o.interceptors,E=void 0===k?{}:k,C=o.selectionsFn,N=void 0===C?i.selections:C,T=t.brush(b);if("number"==typeof S&&T.setMaxListeners(S),w){var D=!0===w?Rf:w;T.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}},O=Of({brush:T,majorScale:c,actions:n,selections:r,picassoQ:i,selectionsFn:N});!function(e){var t=e.brush,n=e.interceptors,r=void 0===n?{}:n;Object.entries(r).forEach(function(e){var n=Va(e,2),r=n[0],i=n[1];(Array.isArray(i)?i:[i]).forEach(function(e){t.intercept(r,e)})})}({brush:T,interceptors:E});var I=function(e){var t=e.chart,n=e.selectionActions,r=e.brush,i=e.actions,o=e.selectionInfo,a=e.selections,s=e.selectionEvents,l=function(e){var t=e.brush,n=e.chart,r=e.selectionInfo,i=e.brushEvents,o=void 0===i?{}:i,a=Object.entries(o).map(function(e){var i=Va(e,2),o=i[0],a=i[1],s=function(){return a({chart:n,selectionInfo:r})};return t.on(o,s),[o,s]});return function(){a.forEach(function(e){var n=Va(e,2),r=n[0],i=n[1];t.removeListener(r,i)})}}({brush:r,chart:t,selectionInfo:o,brushEvents:e.brushEvents}),c=Pf({chart:t,selectionInfo:o,selectionActions:n,actions:i,selections:a,selectionEvents:s}),u=function(e){var t=e.actions;if(null==t||!t.lasso)return function(){};var n=!1,r=function(e){n||e.key!==wf||(t.lasso.action(!0),n=!0)},i=function(e){e.key===wf&&(t.lasso.action(!1),n=!1)};return document.addEventListener("keydown",r),document.addEventListener("keyup",i),function(){document.removeEventListener("keydown",r),document.removeEventListener("keyup",i)}}({actions:i});return function(){l(),c(),u()}}({chart:t,brush:T,actions:n,selections:r,selectionInfo:q.selectionInfo,selectionActions:{clear:f,reset:h},selectionEvents:m,brushEvents:y});if(s){var A=!0===s?Ua(Array(15)).map(function(e,t){return"qHyperCube/qMeasureInfo/".concat(t)}):s;O.allowSimultaneous(A)}return{unbindEvents:I,state:q,picassoSelections:O,brush:T}}var zf=["colorField","useLegendCube"];function jf(e){var t=e.chart,n=e.selections,r=e.actions,i=void 0!==r&&r,o=e.config,a=void 0===o?{}:o,s=Ff({chart:t,actions:i,selections:n,picassoQ:xf,config:a}),l=s.unbindEvents,c=s.state,u=s.picassoSelections,d=s.brush,f=a.custom,h=void 0===f?{}:f,p=a.legendAlias,m=void 0===p?void 0:p,g=a.setBrushAliases,y=void 0===g?Mf:g;return{getIsDimensionLocked:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return c.lockedDimensions[e]},getIsSelectionLocked:function(){var e,t,r=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]:[];return!(null==e||!e.length)&&e.filter(function(e){return"object"===Ha(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)})})}(r)},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,r,i=e.selections,o=e.picassoSelections,a=e.layout,s={lockedDimensions:[],singleSelectDimensions:[]};null!=i&&null!==(t=i.isModal)&&void 0!==t&&t.call(i)&&i.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 Sf({layout:a,path:"qHyperCube/qDimensionInfo/".concat(t)})}),s.singleSelectIndex=function(e){var t,n=((null==e?void 0:e.qHyperCube)||{}).qDimensionInfo,r=void 0===n?[]:n,i=r.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=i[0])&&void 0!==t?t:Math.max(r.length-1,0)}(a),s.canSelect=0===c.length||c.some(function(e){return!e.qLocked}),s.dimensionLocked=!(null===(r=c[0])||void 0===r||!r.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,r=void 0!==n&&n,i=za(e,zf),o=Fa({useLegendCube:r,colorField:t,brush:d,legendAlias:m},i);y(Fa(Fa({},o),{},{defaultFunc:function(){return Mf(o)}}))},destroy:function(){l(),u.release()},custom:Fa({},h)}}var $f="'Source Sans Pro', 'Arial', 'sans-serif'",Vf="#333333",Uf="#595959",Hf="#737373",Bf="#cccccc",Wf="#e6e6e6";function Yf(e){var t={};return[].concat(Ua(e),Ua([["","","color"],["object","","fontFamily"],["object","axis.label.name","color",Uf],["object","axis.label.name","fontFamily",$f],["object","axis.label.name","fontSize","12px"],["object","axis.line.major","color",Bf],["object","axis.line.minor","color",Wf],["object","axis.title","color"],["object","axis.title","fontFamily",$f],["object","axis.title","fontSize","13px"],["object","grid.line.highContrast","color",Wf],["object","grid.line.major","color",Bf],["object","grid.line.minor","color",Wf],["object","label.value","color",Uf],["object","label.value","fontFamily",$f],["object","label.value","fontSize","12px"],[!1,"label.value","darkColor",Uf],[!1,"label.value","lightColor",Wf],["object","outOfRange","color","#999"],["object","legend.title","color",Vf],["object","legend.title","fontFamily",$f],["object","legend.title","fontSize","15px"],["object","legend.label","color",Uf],["object","legend.label","fontFamily",$f],["object","legend.label","fontSize","13px"],["object","referenceLine.label.name","color",Vf],["object","referenceLine.label.name","fontFamily",$f],["object","referenceLine.label.name","fontSize","12px"],["object","referenceLine.outOfBounds","color",Wf],["object","referenceLine.outOfBounds","fontFamily",$f],["object","referenceLine.outOfBounds","fontSize","12px"],["object","referenceLine.outOfBounds","backgroundColor",Hf,function(e){return"transparent"===e?Hf:e}]])).reduce(function(e,n){var r="".concat(n[0],"-").concat(n[1],"-").concat(n[2],"}");return t[r]||(t[r]=!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 Gf="object",Kf=function(e){return e};function Xf(e){var t=e.theme,n=e.id,r=e.transform,i=e.extend,o=e.matrix,a={},s=r.reduce(function(e,t){var n=Va(t,2),r=n[0],i=n[1];return e[r]=i,e},{});return o.forEach(function(e){var r=Va(e,5),i=r[0],o=r[1],l=r[2],c=r[3],u=r[4],d=void 0===u?function(e){return e}:u,f=function(e){var t=e.theme,n=e.base,r=e.path,i=e.attribute,o=e.defaultValue,a=void 0===o?void 0:o;if(!t||!1===n)return a;var s=t.getStyle(n,r,i);return void 0===s?a:s}({theme:t,base:i===Gf&&n?"".concat(Gf,".").concat(n):i,path:o,attribute:l,defaultValue:c}),h=(s["".concat(o,".").concat(l)]||Kf)(d(f));wu(a,[o,l].filter(Boolean).join("."),h)}),i.forEach(function(e){var t=Va(e,2),n=t[0],r=t[1];wu(a,n,r)}),a}var Jf={NOOP:function(){},FALSE:function(){return!1},ARRAY:function(){return[]},OBJECT:function(){return{}}},Zf="chart-modules-tooltip",Qf="#".concat(Zf);function eh(){if(!document.querySelector(Qf)){var e=document.createElement("div");e.id=Zf,e.setAttribute("data-qs-css",""),e.style.overflow="hidden",e.style.position="fixed",e.style.pointerEvents="none",e.style.left="0px",e.style.top="0px",e.style.width="100%",e.style.height="100%",e.style.zIndex=1020,document.body.appendChild(e)}}function th(e){return{show:!0,key:e.key,type:"tooltip",layout:{displayOrder:3},beforeMount:function(){eh()},beforeUpdate:function(){eh()},destroyed:function(){var e;null!=(e=document.querySelector(Qf))&&e.parentElement&&e.childElementCount<1&&e.parentElement.removeChild(e)},settings:{appendTo:function(){return document.querySelector(Qf)},direction:e.rtl?"rtl":"ltr",duration:e.duration},style:{arrow:{color:"#404040"},content:{display:"table","border-spacing":"4px",background:"rgba(64, 64, 64, 0.9)",opacity:"1",fontSize:"13px",fontFamily:"'Source Sans Pro', 'Arial', 'sans-serif'","empty-cells":"show"},cell:{"max-width":"180px","word-break":"break-word","word-wrap":"break-word","overflow-wrap":"break-word",hyphens:"auto"}}}}var nh="position",rh={bar:"rect",diamond:"path",point:"circle",square:"rect",triangle:"path","n-polygon":"path",slice:"path"},ih=function(e){return e.data.value},oh=function(e){var t,n=e.data;return null==n||null===(t=n.major)||void 0===t?void 0:t.value};function ah(e){var t=e.chart,n=e.expando,r=e.nodes,i=e.collectConfig,o=e.collectibles,a=e.meta,s=i.from,l={chart:t,expando:n,nodes:r,collectConfig:i,collectibles:o,meta:a};switch("function"==typeof s?"custom":s){case"single":return function(e){var t=Va(e.nodes,1)[0];if("container"===t.type&&t.children[0]){var n=Va(t.children,1)[0];return n.key=t.key,[n]}return[t]}(l);case"position":return function(e){var t=e.collectibles,n=e.meta;return e.chart.shapesAt(n.position.absolute,{components:t.map(function(e){return{key:e.key}})})}(l);case"dimension":return function(e){var t=e.chart,n=e.nodes,r=e.collectConfig,i=e.collectibles,o=e.meta,a=Va(n,1)[0],s=r.filter,l=r.after,c="function"==typeof s?s:function(){return!0},u="function"==typeof l?l:function(){},d=i.reduce(function(e,n){var i=rh[n.type]||n.type;return e.push.apply(e,Ua(t.findShapes(i).filter(function(e){return e.key===n.key&&e.data&&function(e){var t=e.meta,n=e.collectible,r=e.nodes,i=e.collectConfig.by,o=void 0===i?ih:i,a=n.major,s=void 0===a?oh:a,l=o({data:r.triggerer.data}),c=s({data:r.candidate.data,meta:t}),u=Array.isArray(l),d=Array.isArray(c);return u&&d?l.length===c.length&&l.every(function(e,t){return e===c[t]}):!u&&!d&&l===c}({collectConfig:r,meta:o,collectible:n,nodes:{triggerer:a,candidate:e}})}))),e},[]).filter(c);return u({collected:d,triggerer:a}),d}(l);case"radius":return function(e){var t=e.chart,n=e.collectConfig,r=e.collectibles,i=e.meta,o=Va(e.nodes,1)[0].localBounds,a=n.distance,s=n.filter,l="function"==typeof s?s:function(){return!0},c=r.map(function(e){return e.key});return t.shapesAt({cx:i.position.absolute.x,cy:i.position.absolute.y,r:a||Math.max(o.width,o.height)},{components:c.map(function(e){return{key:e}})}).filter(l)}(l);case"custom":return function(e){var t=e.chart,n=e.expando,r=e.nodes,i=e.meta;return e.collectConfig.from({chart:t,expando:n,nodes:r,meta:i})}(l);default:return[]}}var sh=Number.MAX_VALUE;function lh(e){var t=e.nodes.filter(function(e){return e.bounds.height+e.bounds.width!==0}).reduce(function(e,t){var n=t.bounds;return e.xMin=Math.min(e.xMin,n.x,n.x+n.width),e.yMin=Math.min(e.yMin,n.y,n.y+n.height),e.xMax=Math.max(e.xMax,n.x,n.x+n.width),e.yMax=Math.max(e.yMax,n.y,n.y+n.height),e},{xMin:sh,xMax:-sh,yMin:sh,yMax:-sh}),n=t.xMin,r=t.xMax,i=t.yMin;return{x:n,y:i,width:r-n,height:t.yMax-i}}function ch(e){var t=e.chart,n=e.config,r=e.expando,i=e.internal,o=e.nodes;if(!o.length)return[];var a=Va(o,1)[0].key,s=n.main.collectibles.filter(function(e){return!e.if||e.if()});if(!s.length)return[];var l=n.main.triggers.find(function(e){return-1!==e.keys.indexOf(a)})||{},c=l.collect,u=l.placement;if(!c||!c.from||!u)return[];var d={triggerer:a,position:i.get(nh)},f=(ah({chart:t,expando:r,nodes:o,collectConfig:c,collectibles:s,meta:d})||[]).map(function(e){return e.children.length?e.children[0]:e});return f.length?function(e){var t=e.chart,n=e.config,r=e.expando,i=e.placementConfig,o=e.hovered,a=e.collected,s=e.meta,l=function(e){for(var t=e.chart,n=e.config,r=e.expando,i=e.placementConfig,o=e.hovered,a=e.collected,s=e.meta,l=Va(o,1)[0],c=Array.isArray(i)?i:[i],u={bounds:l.bounds,key:l.key},d=lh({nodes:a}),f=0;f<c.length;f++){var h=c[f];if("function"==typeof h){var p=h({chart:t,expando:r,hovered:o,collected:Ua(a),meta:s,collectedBounds:d,combineBounds:lh});if(p)return p}if("trigger"===h)return u;if("collectible"===h){var m=n.main.placements.collectible;return{bounds:"function"==typeof m?m({collected:Ua(a)}):d,key:a[0].key}}}return u}({chart:t,config:n,expando:r,placementConfig:i,hovered:o,collected:a,meta:s}),c=l.bounds,u=l.key,d=Va(a,1)[0].desc;return[{bounds:c,nodes:a,data:a.map(function(e){return e.data}),key:u,meta:s,desc:d}]}({chart:t,config:n,expando:r,placementConfig:u,hovered:o,collected:f,meta:d}):[]}var uh=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼ‎ⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗＡ-Ｚａ-ｚｦ-ￜ]"),dh=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞‏יִײַ-ﬨשׁ-ﭏ]"),fh=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]"),hh=function(e){return uh.test(e)},ph=function(e){return dh.test(e)||fh.test(e)};function mh(e){for(var t=e?e.length:0,n=0;n<t;n++){var r=e[n];if(hh(r))return"ltr";if(ph(r))return"rtl"}return"ltr"}function gh(e){var t=e.config,n=e.h,r=e.context,i={section:function(e){return function(e){return{type:"section",content:e.content}}({content:e.content})},text:function(e){var n=e.value,r=e.style,i=e.survive,o=e.visibility;return function(e){var t=e.config,n=e.value,r=e.style,i=void 0===r?{}:r,o=i.bold,a=void 0!==o&&o,s=i.italic,l=e.survive,c=e.visibility;return{type:"text",content:[{content:n,style:{"font-weight":a?"bold":"normal","font-style":void 0!==s&&s?"italic":"normal","text-align":t.rtl?"right":"left",direction:mh(n),"white-space":"pre-wrap"},colspan:2}],survive:Fa(Fa({},{visibility:!1}),l),visibility:Fa(Fa({},{count:!0,force:!1}),c)}}({config:t,value:n,style:r,survive:i,visibility:o})},measure:function(e){var r=e.label,i=e.value,o=e.color,a=e.style,s=e.survive,l=e.visibility;return function(e){var t,n,r,i,o=e.h,a=e.label,s=e.value,l=e.color,c=e.style,u=e.survive,d=e.visibility,f=e.config.rtl,h=o("div",{style:{display:"inline-block",width:10,height:10,"background-color":l,margin:"0 8px"}});return{type:"measure",label:a,value:s,content:[{content:f?[":",a]:[a,":"],style:{"text-align":f?"right":"left","font-weight":null!=c&&null!==(t=c.label)&&void 0!==t&&t.bold?"bold":"normal","font-style":null!=c&&null!==(n=c.label)&&void 0!==n&&n.italic?"italic":"normal",direction:mh(a)}},{content:l?f?[s,h]:[h,s]:s,style:{"text-align":f?"left":"right","vertical-align":"middle","font-weight":null!=c&&null!==(r=c.value)&&void 0!==r&&r.bold?"bold":"normal","font-style":null!=c&&null!==(i=c.value)&&void 0!==i&&i.italic?"italic":"normal",direction:mh(s)}}],survive:Fa(Fa({},{color:!1,duplicate:!1,visibility:!1}),u),visibility:Fa(Fa({},{count:!0,force:!1}),d)}}({config:t,h:n,label:r,value:i,color:o,style:a,survive:s,visibility:l})},divider:function(){return function(e){var t=e.visibility;return{type:"divider",content:[{content:"",style:{"background-image":"linear-gradient(transparent 8px, rgba(255, 255, 255, 0.4) 8px, rgba(255, 255, 255, 0.4) 9.2px, transparent 9.2px)",height:"17px"},colspan:2}],survive:{visibility:!1},visibility:Fa(Fa({},{count:!1,force:!1}),t)}}({visibility:(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).visibility})},row:function(e){return function(e){var t=e.survive,n=e.visibility;return{type:"row",content:[{content:e.content,style:e.style,colspan:e.colspan}],survive:Fa(Fa({},{visibility:!1}),t),visibility:Fa(Fa({},{count:!0}),n)}}({content:e.content,style:e.style,colspan:e.colspan,survive:e.survive,visibility:e.visibility})},raw:function(e){return function(e){var t=e.survive,n=e.visibility;return{type:"raw",content:e.value,survive:Fa(Fa({},{visibility:!1}),t),visibility:Fa(Fa({},{count:!0}),n)}}({value:e.value,survive:e.survive,visibility:e.visibility})},color:function(e){var i=e.nodes,o=e.property,a=e.filter,s=void 0===a||a,l=e.visibility,c=e.fillColor;return function(e){var t=e.config,n=e.h,r=e.context,i=e.nodes,o=e.property,a=e.filter,s=e.visibility,l=e.fillColor,c=t.rtl,u={type:"color",label:void 0,value:void 0,content:[],filter:a,survive:{visibility:!1},visibility:Fa(Fa({},{count:!0}),s)},d=t.getColorSettings();if("color"===d.type||!d.fieldType)return u;var f=Va(i,1)[0];if(u.value=function(e){var t=e.config,n=e.context,r=e.property,i=e.node,o=i.data[r];if(o){if(-3===i.data.value)return i.data.label;var a=n.resources.dataset(o.source.key).field(o.source.field).formatter(),s=o.value,l=o.label,c=t.getColorSettings();if(a&&"measure"===c.fieldType)return Number.isNaN(+s)?"-":a(o.value);var u=l||s;return void 0===u||Number.isNaN(u)||"NaN"===u?"-":u}}({config:t,context:r,property:o,node:f}),void 0===u.value)return u;u.label=function(e){var t=e.context,n=e.property,r=e.node,i=e.config.getColorSettings();if(i.label)return i.label;var o=r.data[n];if(o&&"color"!==i.type){var a=t.resources.dataset,s=o.source,l=s.key,c=s.field;return a(l).field(c).title()}}({config:t,context:r,property:o,node:f});var h=null!=l?l:function(e){var t=e.node.attrs;return(null==t?void 0:t.fill)||"#ddd"}({node:f}),p=n("div",{style:{display:"inline-block",width:10,height:10,"background-color":h,margin:"0 8px"}});return u.content.push({content:c?[":",u.label]:[u.label,":"],style:{"text-align":c?"right":"left",direction:mh(u.label)}},{content:c?[u.value,p]:[p,u.value],style:{"text-align":c?"left":"right","vertical-align":"middle",direction:mh(u.value)}}),u}({config:t,h:n,context:r,nodes:i,property:o,filter:s,visibility:l,fillColor:c})}};return i}function yh(e){var t=e.chart,n=e.translator,r=e.config,i=e.expando,o=e.h,a=e.data,s=e.style,l=Va(a,1)[0],c=function(e){var t=e.config,n=e.nodes.reduce(function(e,n){var r=t.main.getGroupByValue({data:n.data});return e[r]||(e[r]={sorting:Object.keys(e).length,items:[]}),e[r].items.push(n),e},{});return Object.keys(n).map(function(e){return n[e]}).sort(function(e,t){return e.sorting-t.sorting}).map(function(e){return e.items})}({config:r,nodes:l.node.nodes}),u=function(e){var t=e.chart,n=e.config,r=e.expando,i=e.h,o=e.context,a=e.groups,s=o.node.meta,l=o.resources,c=l.dataset,u=l.formatter,d=gh({config:n,h:i,context:o}),f=function(e){var t=e.dataset;return{dataset:{title:function(e,n){return t(e).field(n).title()}}}}({dataset:c}),h=a.map(function(e){var t=d.section({content:Ua((n.main.section({expando:r,h:i,nodes:e,dataset:c,formatter:u,meta:s,create:d,util:f})||[]).filter(function(e){var t;return null===(t=e.content)||void 0===t?void 0:t.length})).filter(Boolean)});return t.content=function(e){var t=e.config,n=e.content,r=n.find(function(e){return"color"===e.type&&e.filter}),i=r?n.filter(function(e){return"measure"!==e.type||e.survive.color||e.label!==r.label||e.value!==r.value}):n;return t.main.showDuplicateMeasures?i:i.reduce(function(e,t){var n=t.type,r=t.survive;if("measure"!==n||r.duplicate)return e.filtered.push(t),e;var i="".concat(t.label,"-").concat(t.value);return e.memory[i]||(e.memory[i]=!0,e.filtered.push(t)),e},{memory:{},filtered:[]}).filtered}({config:n,content:t.content}),t});return n.main.sections({chart:t,expando:r,h:i,nodes:o.node.nodes,dataset:c,formatter:u,meta:s,create:d,util:f,sections:h}),h.filter(Boolean)}({chart:t,config:r,expando:i,h:o,context:l,groups:c}),d=function(e){var t=e.translator,n=e.config,r=e.context,i=e.templates,o=n.main.layout,a=o.rows,s=o.grouping,l=o.single,c=function(e){var t=e.limit,n=e.grouping,r=e.single,i={count:0,overflow:0,index:{started:void 0,group:void 0},single:{found:!1,index:0}};return{process:function(e){var o=e.survive,a=e.visibility,s=e.index;if(a.force)return!0;if(i.single.found||(i.single.found=!0,i.single.index=s),r&&s!==i.single.index)return n?(i.index.started!==s&&i.index.group!==s&&(i.overflow++,i.index.group=s),!1):(i.overflow++,!1);if(i.count>=t&&(null==o||!o.visibility)){if(!n)return i.overflow++,!1;if(i.index.started!==s)return i.index.group!==s&&(i.overflow++,i.index.group=s),!1}return a.count&&i.count++,n&&(i.index.started=s),!0},overflow:function(){return i.overflow}}}({limit:a,grouping:s,single:"function"==typeof l?l({meta:r.node.meta,sections:i}):l}),u=i.reduce(function(e,t,n){var r=t.type,o=t.content;"section"===r&&(void 0===o?[]:o).forEach(function(t){c.process({survive:t.survive,visibility:t.visibility,index:n})&&e.push(t.content)});var a=n===i.length-1;return"divider"!==r||a||c.process({survive:t.survive,visibility:t.visibility,index:n})&&e.push(t.content),e},[]).filter(function(e){return e.length}),d=c.overflow();return d&&u.push(function(e){var t=e.translator,n=e.config,r=e.count,i=t?t.get("Object.ChartTooltip.NMore",r):"+".concat(r," more"),o=mh(i);return[{content:i,style:{"font-weight":"bold","text-align":n.rtl?"right":"left",direction:o},colspan:2}]}({translator:t,config:n,count:d})),u}({translator:n,config:r,context:l,templates:u});return d.length?function(e){var t=e.h,n=e.style;return e.rows.map(function(e){return t("tr",{},e.map(function(e){var r={style:Fa(Fa({},n.cell||{}),e.style||{}),class:e.class};return e.colspan&&(r.colspan=e.colspan),t("td",r,e.content)}))})}({h:o,style:s,rows:d}):function(e){var t=e.h;return t("tr",{},t("td",{style:{fontStyle:"italic",opacity:.75}},"Empty"))}({h:o})}var vh="collected";function bh(e){var t=e.chart,n=e.translator,r=e.config,i=e.expando,o=e.internal;if(!r.main.key)return!1;var a=ku(),s=th({key:r.main.key,rtl:r.rtl,duration:r.duration}),l=r.main.events.tooltip,c=l.afterShow,u=l.afterHide,d=function(){var e=a.get(vh);return{expando:i,nodes:e.nodes,meta:e.meta}};return Cl(!0,s,{settings:{filter:function(e){return ch({chart:t,config:r,expando:i,internal:o,nodes:e})},extract:function(e){return a.set(vh,e.node),e},content:function(e){var o=e.h,a=e.data,s=e.style;return yh({chart:t,translator:n,config:r,expando:i,h:o,data:a,style:s})},placement:function(e){var t=e.nodes;return r.main.placement({meta:t[0].meta})},afterShow:function(){return c(d())},afterHide:function(){return u(d())}},style:{arrow:{color:r.style.background},content:r.style}})}function xh(e){var t=e.config,n=t.legend.keys;if(!n.tooltip||!n.component)return!1;if("categorical"!==t.getColorSettings().type)return!1;var r=th({key:n.tooltip,rtl:t.rtl,duration:t.duration});return Cl(!0,r,{settings:{filter:function(e){return e.filter(function(e){return e.data&&e.key===n.component})},extract:function(e){return e},content:function(e){var t=e.h,n=e.data;return[t("tr",{},[t("td",{style:Fa(Fa({},e.style.cell||{}),{"font-weight":"bold","text-align":"left"}),colspan:2},n[0].node.data.label)])]},placement:"pointer"},style:{arrow:{color:t.style.background},content:t.style}})}function Sh(e){var t=e.config.main.triggers.reduce(function(e,t){return t.keys.forEach(function(n){var r=t.distance||0;e.distance[n]=r,e.distances.includes(r)||e.distances.push(r),e.key[n]=!0,e.keys[r]||(e.keys[r]=[]),e.keys[r].push(n)}),e},{distance:{},distances:[],key:{},keys:{}});return function(e){return e.components.filter(function(e){return t.key[e.key]}).reduce(function(e,n){e.any=!0,e.components.push(n.key);var r=t.distance[n.key];return 0===r?e.position.push(n.key):(e.distances.includes(r)||(e.distances.push(r),e.distanceKeys[r]=[]),e.distanceKeys[r].push(n.key)),e},{any:!1,components:[],position:[],distances:[],distanceKeys:{}})}}var Mh=function(){return!0};function wh(e){var t=e.config.main.triggers.reduce(function(e,t){var n=t.filter;return t.keys.forEach(function(t){e[t]="function"==typeof n?n:Mh}),e},{});return function(e){var n=t[e.key];return!n||n(e)}}function kh(e){var t=e.chart,n=e.event,r=e.component,i={absolute:{x:0,y:0},relative:{x:0,y:0}},o=t.element.getBoundingClientRect(),a=o.left,s=o.top;i.absolute.x=(void 0===n.clientX?Math.floor(n.srcEvent.clientX):n.clientX)-a,i.absolute.y=(void 0===n.clientY?Math.floor(n.srcEvent.clientY):n.clientY)-s;var l=t.component(r);if(l){var c=l.rect.computedInner;i.relative.x=i.absolute.x-c.x,i.relative.y=i.absolute.y-c.y}return i}function Eh(e){var t=e.chart,n=e.filter,r=e.hits,i=e.position,o=[];if(r.position.length&&o.push.apply(o,Ua(t.shapesAt(i.absolute,{components:r.position.map(function(e){return{key:e}})}).filter(n))),!o.length&&r.distances.length){var a=[];r.distances.forEach(function(e){a.push.apply(a,Ua(t.shapesAt({cx:i.absolute.x,cy:i.absolute.y,r:e},{components:r.distanceKeys[e].map(function(e){return{key:e}})}).filter(n)))}),a.length&&o.push(function(e){var t=e.nodes,n=e.origin,r=t.find(function(e){return"path"===e.type});if(r)return r;var i=function(e){var t=Math.abs(n.x-(e.localBounds.x+e.localBounds.width/2)),r=Math.abs(n.y-(e.localBounds.y+e.localBounds.height/2));return Math.sqrt(t*t+r*r)};return t.slice(1).reduce(function(e,t){var n=i(t);return n<e.distance&&(e.distance=n,e.node=t),e},{node:t[0],distance:i(t[0])}).node}({nodes:a,origin:i.relative}))}return o}var Ch="tooltipTap";function Nh(e){var t=e.chart,n=e.config,r=e.expando,i=e.internal,o=e.facade,a=n.delay.tap,s=Sh({config:n}),l=wh({config:n}),c=n.main.triggers.reduce(function(e,t){return e.push.apply(e,Ua(t.keys)),e},[]);return{key:"event:".concat(Ch),type:"Tap",options:{event:Ch,enable:function(e,r){return!r||!!n.enable({event:r})&&t.componentsFromPoint({x:r.center.x,y:r.center.y}).filter(function(e){return-1!==c.indexOf(e.key)}).length>0}},recognizeWith:"tap",events:Pa({},Ch,function(e){if(e.preventDefault(),"mouse"!==e.pointerType&&!n.main.suppress({event:e})){var c=t.component(n.main.key);if(c&&c.show){var u=t.componentsFromPoint({x:e.center.x,y:e.center.y}),d=s({components:u});if(d.any){var f=Va(d.components,1)[0],h=kh({chart:t,event:e,component:f});i.set(nh,h);var p=Eh({chart:t,filter:l,hits:d,position:h});if(p.length){var m=p[0].key;n.main.events.tooltip.beforeShow({expando:r,event:e,collectNodes:function(){return o.collectNodes({nodes:p})},meta:{triggerer:m,position:h}}).then(function(){c.emit("show",e,{nodes:p,delay:a})}).catch(function(){})}else c.emit("hide")}else c.emit("hide")}}})}}function Th(e){var t=e.chart,n=e.config,r=e.expando,i=e.internal,o=e.facade,a=Sh({config:n}),s=wh({config:n}),l=function(e){var t=e.config,n=e.expando,r=e.internal,i=e.facade,o=t.main.events.tooltip.beforeShow,a=t.delay.hover,s={ongoing:{},latest:void 0};return function(e){var t=e.event,l=e.tooltip,c=e.nodes,u=function(e){var t=e.nodes;return JSON.stringify(t.map(function(e){var t;return{key:e.key,bounds:e.bounds,value:null===(t=e.data)||void 0===t?void 0:t.value}}))}({nodes:c});if(!s.ongoing[u]){s.ongoing[u]=!0,s.latest=u;var d=c[0].key;o({expando:n,event:t,collectNodes:function(){return i.collectNodes({nodes:c})},meta:{triggerer:d,position:r.get(nh)}}).then(function(){u===s.latest&&l.emit("show",t,{nodes:c,delay:a})}).catch(function(){l.emit("show")}).finally(function(){delete s.ongoing[u],u===s.latest&&(s.latest=void 0)})}}}({config:n,expando:r,internal:i,facade:o}),c=[n.main.key,n.legend.keys.tooltip].filter(Boolean),u=function(){c.forEach(function(e){var n=t.component(e);null!=n&&n.show&&n.emit("hide")})};return{type:"native",events:{mousemove:function(e){if(n.enable({event:e})&&!n.main.suppress({event:e})){var r=t.componentsFromPoint({x:e.clientX,y:e.clientY}),o=t.component(n.main.key);if(o&&o.show){var c=a({components:r});if(c.any){var u=Va(c.components,1)[0],d=kh({chart:t,event:e,component:u});i.set(nh,d);var f=Eh({chart:t,filter:s,hits:c,position:d});if(!f.length)return void o.emit("hide");l({event:e,tooltip:o,nodes:f})}else o.emit("hide")}var h=n.legend;if(h.keys.tooltip&&h.keys.component){var p=t.component(h.keys.tooltip);p&&p.show&&(r.some(function(e){return e.key===h.keys.component})?p.emit("show",e):p.emit("hide"))}}},mouseup:function(e){2===e.button&&u()},mouseleave:function(){n.main.events.interaction.mouseleave({expando:r}),u()},wheel:function(){u()}}}}function Dh(e){var t=e.chart,n=e.translator,r=function(e){var t=e.config;return Cl(!0,{},{rtl:!1,enable:Jf.FALSE,getColorSettings:Jf.OBJECT,style:{fontSize:void 0,fontFamily:void 0,color:void 0,background:void 0},delay:{hover:500,tap:0},duration:8e3,main:{key:void 0,suppress:Jf.FALSE,getGroupByValue:Jf.NOOP,collectibles:[],triggers:[],placement:function(){return{type:"bounds"}},placements:{collectible:"combine"},showDuplicateMeasures:!1,layout:{rows:7,grouping:!1,single:!1},section:Jf.ARRAY,sections:Jf.NOOP,events:{tooltip:{beforeShow:function(){return Promise.resolve()},afterShow:Jf.NOOP,afterHide:Jf.NOOP},interaction:{mouseleave:Jf.NOOP}}},legend:{keys:{tooltip:void 0,component:void 0}}},void 0===t?{}:t)}({config:e.config}),i=ku(),o=ku(),a={components:void 0,interactions:void 0};return{getComponents:function(){return a.components||(a.components=function(e){var t=e.config;return[bh({chart:e.chart,translator:e.translator,config:t,expando:e.expando,internal:e.internal}),xh({config:t})].filter(Boolean)}({chart:t,translator:n,config:r,expando:i,internal:o})),a.components},getInteractions:function(){return a.interactions||(a.interactions=function(e){var t=e.chart,n=e.config,r=e.expando,i=e.internal,o=function(e){var t=e.chart,n=e.config,r=e.expando,i=e.internal;return{collectNodes:function(e){var o=e.nodes,a=Va(ch({chart:t,config:n,expando:r,internal:i,nodes:o}),1)[0];return(void 0===a?{nodes:[]}:a).nodes}}}({chart:t,config:n,expando:r,internal:i});return{gestures:[Nh({chart:t,config:n,expando:r,internal:i,facade:o})],native:Th({chart:t,config:n,expando:r,internal:i,facade:o})}}({chart:t,config:r,expando:i,internal:o})),a.interactions},expando:i}}var qh={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","plugins[].validMeasureValue","plugins[].labelBackgroundColor","plugins[].labelColor","plugins[].hasBackground","plugins[].maxLabelWidth","plugins[].points[].validMeasureValue","plugins[].points[].labelBackgroundColor","plugins[].points[].labelColor","plugins[].points[].hasBackground","plugins[].points[].maxLabelWidth"]};function Oh(e){const{qHyperCube:t,...n}=e,{qAxisData:r,qDataPages:i,qStackedDataPages:o,qTreeDataPages:a,...s}=t,c=l(!0,{},{...n,qHyperCube:{...s}}),{dataRelatedPropertiesPaths:u}=qh;function d(e,t){const n=t.indexOf("[]");if(-1===n)return void(void 0!==Su(e,t)&&wu(e,t,void 0));const r=t.substring(0,n),i=t.substring(n+2),o=i.startsWith(".")?i.substring(1):i;Su(e,r,[]).forEach(e=>{o&&d(e,o)})}return u.forEach(e=>{d(c,e)}),c}var Ih={axes:{trackBy:function({isTime:e,isContinuous:t,isMeasure:n,isMajor:r}){return i=>{if(e||t||n){if("line"===i.type)return i.tickValue??"axis";if("text"===i.type)return`${i.tickValue} ${i.text}`;if("container"===i.type){const e=i.children.filter(e=>"text"===e.type).map(e=>e.text);return`${i.data.value} ${e.join("")}`}return Math.random()}if(r){if("line"===i.type&&void 0===i.tickValue)return"axis";const e=i.transform&&i.transform.match(/rotate/gi)?"rotated":"horizontal";return`${i.data.group?`${i.data.group.value} `:""}${i.data.value} ${i.text} ${e}`}return Math.random()}},compensateForLayoutChanges:function({isMeasure:e,isTime:t,isContinuous:n,isHorizontal:r,dock:i}){return({currentNodes:o,currentRect:a,previousRect:s})=>{const l=a.x-s.x,c=a.y-s.y,u=a.width-s.width,d=a.height-s.height;e?("left"===i&&o.forEach(e=>{"line"===e.type?(e.x1+=u,e.x2+=u):"text"===e.type&&(e.x+=u)}),"left"!==i&&"right"!==i||o.forEach(e=>{"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","#"===e.fill?.[0]&&(e.fill=`${e.fill.slice(0,1)}00${e.fill.slice(1)}`))}),"top"!==i&&"bottom"!==i||o.forEach(e=>{"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","#"===e.fill?.[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||r?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+d)})}}},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 r=t.x-n.x,i=t.y-n.y;0===r&&0===i||e.forEach(e=>{e.children&&e.children.length>0&&e.children.forEach(e=>{void 0!==e.x&&void 0!==e.y?(e.x-=r,e.y-=i):e.transform=`translate(${-r}, ${-i})`})})}},barOobs:{compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x;0===t.y-n.y&&0===r||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 r=t.x-n.x,i=t.y-n.y;0===r&&0===i||e.forEach(e=>{e.transform&&e.transform.match(/rotate\(-90/gi)?(e.x+=i,e.y-=r):(e.x-=r,e.y-=i)})},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){return"line"===e.type?e.value??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 r=t.x-n.x,i=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-=i,e.y2-=i):e.x1===e.x2&&(e.y2=e.y1+t.height,e.x1-=r,e.x2-=r);else{const t="x"===e.major.p?r/e.major.size:i/e.major.size,n="y"===e.minor.p?i/e.minor.size:r/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 r=t.x-n.x;0===t.y-n.y&&0===r||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 r=t.x-n.x,i=t.y-n.y;0===r&&0===i||e.forEach(e=>{switch(e.type){case"circle":e.cx-=r,e.cy-=i;break;case"rect":e.x-=r,e.y-=i;break;case"path":e.transform=`translate(${-r}, ${-i})`}})}},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 r=t.x-n.x,i=t.y-n.y;0===r&&0===i||e.forEach(e=>{"image"===e.type?(e.x-=r,e.y-=i):(e.cx-=r,e.cy-=i)})}},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 r=t.x-n.x,i=t.y-n.y,o=t.width-n.width,a=t.height-n.height;let s=-r,l=-i;e.forEach(e=>{switch(e.dock){case"right":r>0&&(s=t.width);break;case"left":o<0&&(s=-n.width);break;case"top":a<0&&(l=-n.height);break;case"bottom":i>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=Oh(t);e.set("dataIndependentProperties",JSON.stringify(n))},propertiesHaveChanged:function({viewCache:e,layout:t}){const n=Oh(t);return e.get("dataIndependentProperties")!==JSON.stringify(n)},nonUpdatingNode:{trackBy:function(){return Math.random()}}};const{getInputValue:Ah,extractInfoFromInputValue:_h,resolveValue:Lh}=Zo;var Ph={resolveValue:Lh,resolveInnerValues:({refLineLayout:e,refLineModel:t,layoutService:n})=>{if(n.meta.isGroupedByDimension){const r=Ah({refLineLayout:e,layoutService:n});return _h(r,t,"innerValues")}},resolveNumInnerValues:({refLineLayout:e,refLineModel:t,layoutService:n})=>{if(n.meta.mode.K)return 0;const r=Ah({refLineLayout:e,layoutService:n});return _h(r,t,"numInnerValues")||0},resolveValueText:({refLineLayout:e,refLineModel:t,layoutService:n})=>{const{dimensionValuesInfo:r}=t,{canBeContinuous:i}=n.meta,o=Ah({refLineLayout:e,layoutService:n});return r[o]&&i?r[o].qText:o},resolveValueInfo:({refLineLayout:e,refLineModel:t,layoutService:n})=>{const r=Ah({refLineLayout:e,layoutService:n}),{dimensionRefLineInfo:i}=t;return i[r]}};function Rh({isDimension:e,refLineModel:t={},layoutService:n,colorModel:r,dockService:i,animationsEnabled:o,chart:a,scale:s,axis:l,rtl:c,key:u,mainComponentKey:d,path:f,minimumLayoutMode:h}){const p=e?t.dimensionRefLines:f?t.query.getRefLines(f):t.measureRefLines;if(!p.length)return!1;const m={key:u,type:"ref-line",layout:{minimumLayoutMode:h},lines:{y:[],x:[]},style:{oob:{show:!1}},preferredSize:()=>({size:0,edgeBleed:{left:1,right:1,top:1,bottom:1}}),animations:{enabled:o,trackBy:Ih.lines.trackBy,compensateForLayoutChanges:Ih.lines.compensateForLayoutChanges}},g=!(!e||"horizontal"!==i.meta.major.orientation||!c),y=!e||n.meta.isContinuous;return p.forEach(o=>{m.lines[l].push((({isDimension:e,refLineLayout:t,refLineModel:n,layoutService:r,colorModel:i,dockService:o,chart:a,scale:s,axis:l,invert:c,component:u,isContinuous:d})=>{const f={dir:l,line:{strokeWidth:t?.style?.lineThickness||2,strokeDasharray:t?.style?.lineType,stroke:i.resolveUIColor(t.paletteColor||{index:t.color})}};return!e||r.meta.isContinuous?(f.scale=s,f.value=t.refLineExpr.value):(f.valueInfo=Ph.resolveValueInfo({refLineLayout:t,refLineModel:n,layoutService:r}),f.value=()=>{const e=Zo.getScaledPosition({scale:a.scale(s),value:Ph.resolveValue({refLineLayout:t,refLineModel:n,layoutService:r}),valueInfo:f.valueInfo,size:a.component(u)?.rect["horizontal"===o.meta.major.orientation?"width":"height"],align:t.align,invert:c,layoutService:r,isContinuous:d});return Number.isNaN(e)?void 0:e}),f})({isDimension:e,refLineLayout:o,refLineModel:t,layoutService:n,colorModel:r,dockService:i,chart:a,scale:s,axis:l,invert:g,component:d,isContinuous:y}))}),m}function Fh({isDimension:e,refLineModel:t={},layoutService:n,colorModel:r,animationsEnabled:i,dock:o,scale:a,style:s,formatter:l,theme:c,localeInfo:u,rtl:d,key:f,path:h}){const p=e?t.dimensionRefLineLabels:h?t.query.getRefLineLabels(h):t.measureRefLineLabels;if(!p.length)return[];const m=[],g=!e||n.meta.isContinuous,y=p.map(e=>(({refLineLayout:e,refLineModel:t,layoutService:n,colorModel:r,scale:i,theme:o,isContinuous:a})=>{const s=r.resolveUIColor(e.paletteColor||{index:e.color}),{align:l,style:c}=e,{fontSize:u,fontFamily:d,fontStyle:f,fontWeight:h,textDecoration:p}=c||{},m={align:l,text:e.label,fill:e.coloredBackground?o.getContrastingColorTo(s):s,fontSize:u,fontFamily:d,fontStyle:f,fontWeight:h,textDecoration:p,showValue:!1!==e.showValue,showLabel:!1!==e.showLabel,inputValue:e.refLineExpr.value,inputValueLabel:e.refLineExpr.label};return e.coloredBackground&&(m.background={fill:s}),a?(m.scale=i,m.value=e.refLineExpr.value):(m.value=()=>Ph.resolveValue({refLineLayout:e,refLineModel:t,layoutService:n}),m.valueText=()=>Ph.resolveValueText({refLineLayout:e,refLineModel:t,layoutService:n}),m.valueInfo=()=>Ph.resolveValueInfo({refLineLayout:e,refLineModel:t,layoutService:n})),m})({refLineLayout:e,refLineModel:t,layoutService:n,colorModel:r,scale:a,theme:c,isContinuous:g}));return m.push((({isDimension:e,layoutService:t,animationsEnabled:n,style:r,labels:i,scale:o,formatter:a,dock:s,key:l,rtl:c,theme:u,isContinuous:d,localeInfo:f})=>({key:l,type:"reference-line-labels",renderer:"svg",labels:i,formatter:a,scale:o,layoutService:t,layout:{dock:s,rtl:c},theme:u,isContinuous:d,isDimension:e,localeInfo:f,style:{label:{fontFamily:r.referenceLine.label.name.fontFamily,fontSize:r.referenceLine.label.name.fontSize,fontStyle:r.referenceLine.label.name.fontStyle,fontWeight:r.referenceLine.label.name.fontWeight,textDecoration:r.referenceLine.label.name.textDecoration,padding:{top:2,bottom:2,left:c?2:4,right:c?4:2},background:{padding:{top:1,bottom:1,left:2,right:2}},maxWidth:100,gap:"left"===s||"right"===s?10:16},oob:{size:8,fill:r.referenceLine.outOfBounds.backgroundColor,text:{fontFamily:r.referenceLine.outOfBounds.fontFamily,fontSize:r.referenceLine.outOfBounds.fontSize,fill:r.referenceLine.outOfBounds.color,background:{fill:r.referenceLine.outOfBounds.backgroundColor}}}},animations:{enabled:n,trackBy:Ih.refLineLabels.trackBy,compensateForLayoutChanges:Ih.refLineLabels.compensateForLayoutChanges}}))({isDimension:e,rtl:d,style:s,dock:o,key:f,labels:y,scale:a,formatter:l,layoutService:n,animationsEnabled:i,theme:c,isContinuous:g,localeInfo:u})),m}function zh({layoutService:e,discreteModel:t}){const{isContinuous:n,canBeContinuous:r,isGroupedByDimension:i}=e.meta,o=e.getLayout(),a="K"===o.qHyperCube.qMode,s=S.dimensionless(o),l=Zo.getMeasureRefLines(o),c=Zo.getDimensionRefLines(o,s),u=Zo.getMeasureRefLineLabels(o),d=Zo.getDimensionRefLineLabels(o,s);let f={},h={};const p=()=>!(!c||!c.length)&&!c.every(t=>{const o=Zo.getInputValue({refLineLayout:t,layoutService:e});return(t=>{if(r){const n=e.getLayoutValue("qHyperCube.qDimensionInfo.0"),{qMin:r,qMax:i}=n;return Zo.isOutOfRange({value:t,qMin:r,qMax:i})}return!1})(o)||(t=>{if(!h[t])return!1;if(!n&&i){const n={valueInfo:h[t]},r="S"===e.getHyperCubeValue("qMode")?"qDataPages.0":"qStackedDataPages.0",i=e.getHyperCubeValue(r);return Zo.isOutOfDataPages({label:n,dataPages:i})}return!0})(o)}),m={isKMode:a,canBeContinuous:r,measureRefLines:l,dimensionRefLines:c,measureRefLineLabels:u,dimensionRefLineLabels:d,dimensionRefLineInfo:h,dimensionValuesInfo:f,query:{getRefLines:e=>Zo.getRefLines(o,e),getRefLineLabels:e=>Zo.getRefLineLabels(o,e)},update:()=>{h=m.dimensionRefLineInfo,p()&&(f=Zo.getDimensionValuesInfo({layout:o,canBeContinuous:r,discreteModel:t,layoutService:e}),m.dimensionValuesInfo=f,c.forEach(t=>{const n=Zo.getInputValue({refLineLayout:t,layoutService:e});f[n]&&(h[n]?(h[n].innerValues=f[n].innerValues,h[n].minOrder=Math.min(h[n].minOrder,f[n].minOrder),h[n].maxOrder=Math.max(h[n].maxOrder,f[n].maxOrder),h[n].isMinOrderOk=h[n].isMinOrderOk||f[n].isMinOrderOk,h[n].isMaxOrderOk=h[n].isMaxOrderOk||f[n].isMaxOrderOk):h[n]={id:f[n].id,qText:f[n].qText,innerValues:f[n].innerValues,minOrder:f[n].minOrder,maxOrder:f[n].maxOrder,isMinOrderOk:f[n].isMinOrderOk,isMaxOrderOk:f[n].isMaxOrderOk},h[n].numInnerValues=(h[n].maxOrder||0)-(h[n].minOrder||0)+1)}))}};return m.update(),m}function jh(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?void 0:"svg"}const $h={ref:null,refFn:e=>{const t=e.qHyperCubeDef.qMeasures?.findIndex(e=>"colorByExpression"===e.qAttributeExpressions?.[0]?.id);return`qHyperCubeDef.qMeasures.${-1===t?0:t}.qAttributeExpressions.0.qExpression`},change(e){const t=e.qHyperCubeDef?.qMeasures?.findIndex(e=>"colorByExpression"===e.qAttributeExpressions?.[0]?.id),n=y.getValue(e,`qHyperCubeDef.qMeasures.${-1===t?0:t}.qAttributeExpressions.0`),r=y.getValue(e,"color");n&&(n.id="colorByExpression",r&&(r.colorExpression=n.qExpression))}};function Vh({color:e,colorModel:t}){if(!e)return;const n=t.resolveUIColor(e);if("none"===n)return"transparent";const r=Ia(n);return r.setAlpha(e?.alpha>=0?e.alpha:1),r.isInvalid()?void 0:r.getRGBA()}function Uh({point:e,dimensionValueInfo:t,layoutService:n}){const{dimensionValue:r}=e,i=""===e.measureValue?void 0:+e.measureValue;if(to.isNumber(i))return i;const{dimensionCount:o,measureCount:a}=n.meta;if(2===o)return 0;const s=e.measureIndex?+e.measureIndex:0;return to.isNumber(s)&&!(s>=a||0===o)&&1===o?t[r]?.dataNode[s+1]?.qNum:void 0}const Hh={index:-1,color:"#595959"};function Bh({chart:e,chartModel:t,discreteModel:n,colorService:r,themeService:i,layoutService:o,dockService:a,rtl:s,majorScale:l,minorScale:c,mainComponentKey:u,data:d,key:f}){if(!Array.isArray(d)||0===d.length)return!1;const h={resolveUIColor:r.getMain().getPaletteColor},p=i.getTheme(),m="horizontal"===a.meta.major.orientation,g=!(!m||!s),{canBeContinuous:y,isContinuous:v,isButterfly:b}=o.meta,x=o.getLayout(),S=function({layout:e,colorModel:t}){const n=e?.components?.find(e=>"general"===e.key);if(n?.bgColor?.useColorExpression){const e=Ia(n?.bgColor?.colorExpression);return e.isInvalid()?void 0:e.getRGBA()}const r=n?.bgColor?.color;return Vh({color:r,colorModel:t})}({layout:x,colorModel:h})??p.getStyle("object","","backgroundColor"),M=Zo.getDimensionValuesInfo({layout:x,canBeContinuous:y,discreteModel:n,layoutService:o}),w=v?d:d.filter(e=>!!M[e.dimensionValue]),k={},E=w.map(e=>e.dimensionValue);E.forEach(e=>{M[e]&&(k[e]?(k[e].innerValues=M[e].innerValues,k[e].minOrder=Math.min(k[e].minOrder,M[e].minOrder),k[e].maxOrder=Math.max(k[e].maxOrder,M[e].maxOrder),k[e].isMinOrderOk=k[e].isMinOrderOk||M[e].isMinOrderOk,k[e].isMaxOrderOk=k[e].isMaxOrderOk||M[e].isMaxOrderOk):k[e]={id:M[e].id,dataNode:M[e].dataNode,qText:M[e].qText,innerValues:M[e].innerValues,minOrder:M[e].minOrder,maxOrder:M[e].maxOrder,isMinOrderOk:M[e].isMinOrderOk,isMaxOrderOk:M[e].isMaxOrderOk},k[e].numInnerValues=(k[e].maxOrder||0)-(k[e].minOrder||0)+1)}),w.forEach(e=>{const t=Uh({point:e,dimensionValueInfo:k,layoutService:o});if(e.validMeasureValue=b&&1===e.measureIndex?-t:t,o?.meta?.isStacked){const t=k[e.dimensionValue]?.dataNode;if(Array.isArray(t)&&void 0!==e.measureIndex){const n=t.slice(0,e.measureIndex+2),r=t[e.measureIndex+1]?.qNum;if("number"==typeof r&&0!==r){const t=Math.sign(r);e.validMeasureValue=n.reduce((e,n)=>{const r=n.qNum;return"number"==typeof r&&Math.sign(r)===t?e+r:e},0)}}}const n=Vh({colorModel:h,color:e.style?.label?.color||Hh}),r=!!e.style?.label?.coloredBackground;e.labelBackgroundColor=r?n:void 0,e.labelColor=r?i.getTheme().getContrastingColorTo(n):n,e.hasBackground=r,e.maxLabelWidth=100});const C={scale:l,fn:({datum:t})=>{const n=e.scale(l),r=t.value.dimensionValue;if(v)return n("string"==typeof r?""===r?void 0:+r:r);if(void 0===k[r])return;return Zo.getScaledPosition({scale:n,value:k[r].id,valueInfo:k[r],size:e.component(u)?.rect[m?"width":"height"],align:"center",invert:g,layoutService:o,isContinuous:v})}},N={scale:c,fn:({datum:e,scale:t})=>t(e.value.validMeasureValue)},T={key:f,type:"point",data:w,settings:{x:m?C:N,y:m?N:C,strokeWidth:({datum:e})=>e.value.style?.outlineWidth??e.value.style?.lineThickness??2,stroke:({datum:e})=>Vh({colorModel:h,color:e.value.style?.lineColor?.color?e.value.style?.lineColor:{index:-1,color:"#000"}}),fill:({datum:e})=>e.value.style?.fill?.color?Vh({colorModel:h,color:e.value.style?.fill}):S,size:({datum:e})=>`${e.value.style?.dataPointSize??12}px`,shape:({datum:e})=>e.value.style?.symbol||"circle"},animations:{enabled:t.query.animationsEnabled,trackBy:e=>e.data.value.cId,compensateForLayoutChanges:Ih.points.compensateForLayoutChanges}};return T}const Wh=e=>e?.qHyperCube?.qDimensionInfo?.filter(e=>7005!==e.qError?.qErrorCode).length||0,Yh=e=>e?.qHyperCube?.qMeasureInfo?.filter(e=>7005!==e.qError?.qErrorCode).length||0,Gh=!0,Kh=!1,Xh={index:0,color:"none"},Jh={index:-1,color:"#595959"},Zh={index:-1,color:"#595959"},Qh=e=>{!e.dimensionValue?.qValueExpression&&e.dimensionValue?.qStringExpression&&(e.dimensionValue.qValueExpression=e.dimensionValue.qStringExpression,delete e.dimensionValue.qStringExpression)},ep=e=>{e.dimensionValue?.qValueExpression&&!e.dimensionValue?.qStringExpression&&(e.dimensionValue.qStringExpression=e.dimensionValue.qValueExpression,delete e.dimensionValue.qValueExpression)},tp=e=>{switch(e.type){case"image":break;case"point":delete e.points,delete e.style?.lineType,delete e.showPoints,delete e.style?.lineCurve;break;case"line":delete e.dimensionValue,delete e.measureValue,delete e.measureIndex,delete e.style?.dataPointSize,delete e.style?.fill,delete e.style?.symbol,delete e.style?.label;break;default:delete e.points,delete e.dimensionValue,delete e.measureValue,delete e.measureIndex,delete e.style?.lineType,delete e.style?.lineThickness,delete e.style?.lineColor,delete e.style?.dataPointSize,delete e.style?.fill}},np=({translator:e})=>({label:{ref:"label.value",translation:"Common.Label",component:"string",expression:"optional",defaultValue:""},dimensionNumberValue:{ref:"dimensionValue",translation:"properties.dimensionReferenceLines.dimensionValue",type:"number",expressionType:"ValueExpression",expression:"optional",defaultValue:0,show:(e,t,n)=>p.canBeContinuous(n.layout)},dimensionStringValue:{ref:"dimensionValue",translation:"properties.dimensionReferenceLines.dimensionValue",component:"string",expression:"optional",defaultValue:"",show:(e,t,n)=>!p.canBeContinuous(n.layout)},measureInputType:{type:"number",component:"dropdown",translation:"properties.plugins.measureInputType",show:(e,t,n)=>1===Wh(n.layout),convertFunctions:{get:(e,t,n,r)=>void 0===r.measureValue?1:0,set(e,t,n,r,i){0===e?(i.measureValue=0,delete i.measureIndex):(i.measureIndex=0,delete i.measureValue)}},options:[{value:0,translation:e.get("properties.plugins.measureInputType.measureValue")},{value:1,translation:e.get("properties.plugins.measureInputType.measureIndex")}]},measureValue:{ref:"measureValue",translation:"properties.plugins.measureInputType.measureValue",type:"number",expressionType:"ValueExpression",expression:"optional",defaultValue:0,schemaIgnore:!0,show:(e,t,n)=>void 0!==e.measureValue||2===Wh(n.layout)},measureIndex:{ref:"measureIndex",translation:"properties.plugins.measureInputType.measureIndex",type:"number",expressionType:"ValueExpression",expression:"optional",defaultValue:0,show:(e,t,n)=>void 0===e.measureValue&&1===Wh(n.layout),invalid:(e,t,n)=>e.measureIndex<0||e.measureIndex>=Yh(n.layout)}}),rp=e=>({symbol:{type:"string",component:"dropdown",ref:"style.symbol",translation:"Object.GridChart.Symbol",options:[{value:"circle",translation:"Object.GridChart.Symbol.Circle"},{value:"cross",translation:"Object.GridChart.Symbol.Cross"},{value:"diamond",translation:"Object.GridChart.Symbol.Diamond"},{value:"saltire",translation:"Object.GridChart.Symbol.Saltire"},{value:"square",translation:"Object.GridChart.Symbol.Square"},{value:"star",translation:"Object.GridChart.Symbol.Star"},{value:"triangle",translation:"Object.GridChart.Symbol.Triangle"}]},labelPlacement:{type:"string",component:"dropdown",ref:"label.placement",translation:"geo.properties.labelPosition",options:[{value:"auto",translation:"properties.axis.displaymode.auto"},{value:"top",translation:"geo.properties.labelPosition.above"},{value:"bottom",translation:"geo.properties.labelPosition.below"}]},fillColor:{ref:"style.fill",translation:"properties.distributionPlot.pointColor",type:"object",component:"color-picker",disableNone:Kh,showAlpha:Gh,defaultValue:Xh},lineColor:{ref:"style.lineColor",translation:"LayerStyleEditor.style.strokeColor",type:"object",component:"color-picker",disableNone:Kh,showAlpha:Gh,defaultValue:Jh},labelColor:{ref:"style.label.color",translation:"properties.plugins.label.color",type:"object",component:"color-picker",disableNone:Kh,showAlpha:Gh,defaultValue:Zh},colorBackground:{ref:"style.label.coloredBackground",translation:"properties.referenceLines.coloredBackground",type:"boolean",defaultValue:!1,show:!0},outlineWidth:{component:"slider",type:"number",expression:"optional",ref:"style.outlineWidth",translation:"LayerStyleEditor.style.strokeWidth",show:!0,defaultValue:2,min:1,max:6,step:1},dataPointSize:{component:"slider",type:"number",expression:"optional",ref:"style.dataPointSize",translation:"LayerStyleEditor.style.dataPointSize",show:!0,defaultValue:e?12:10,min:3,max:30,step:1}}),ip=({translator:e,pluginOptions:t,supportNewStyles:n=!1})=>{const r={type:"array",ref:"plugins",filter:e=>e.filter(e=>["point","line"].includes(e.type)),translation:"properties.shapes",show:e=>(e?.qHyperCubeDef?.qDimensions||[]).length>0,itemTitleRef:e=>t.filter(t=>t.value===e.type)[0].translation+(e.label?.value?`: ${e.label.value}`:""),allowAdd:!0,allowRemove:!0,allowMove:!0,allowDuplicate:!0,dialog:{ref:"type",options:t},add(e,t){void 0===t.plugins&&(t.plugins=[]),tp(e)},addTranslation:"properties.shapes.addShape",globalChange:(e,t,n)=>{e.plugins&&(e.plugins.forEach(tp),p.canBeContinuous(n.layout)?e.plugins.forEach(e=>{switch(e.type){case"point":Qh(e);break;case"line":(e=>{e.points?.forEach(Qh)})(e)}}):e.plugins.forEach(e=>{switch(e.type){case"point":ep(e);break;case"line":(e=>{e.points?.forEach(ep)})(e)}}))},items:{point:{component:"items",show:e=>"point"===e.type,items:{dataSection:{component:"items",items:np({translator:e})},styleSection:{component:"items",items:rp(n)}}},line:{type:"items",show:e=>"line"===e.type,items:{dataSection:{component:"items",items:{label:{ref:"label.value",translation:"Common.Label",component:"string",expression:"optional",defaultValue:""},points:{type:"array",ref:"points",titleTranslation:"properties.plugins.Points",itemTitleRef:(t,n)=>e.get("properties.plugins.Points.Point",n+1)+(t.label?.value?`: ${t.label.value}`:""),allowAdd:!0,allowRemove:!0,allowMove:!0,allowDuplicate:!0,addTranslation:"properties.plugins.Points.addPoint",items:{dataSection:{component:"items",items:np({translator:e})},styleSection:{component:"items",items:rp(n),show:(e,t,n)=>{const r=((e,t)=>{if(!t)return null;for(let n=0;n<t.length;n+=1)if("line"===t[n].type&&t[n].points.includes(e))return t[n];return null})(e,n.properties.plugins);return r?.showPoints}}}}}},styleSection:{component:"items",items:{lineColor:{ref:"style.lineColor",translation:"Object.Table.Representation.MiniChart.Colors.Line",type:"object",component:"color-picker",disableNone:Kh,showAlpha:Gh,defaultValue:Jh},lineThickness:{component:"slider",type:"number",expression:"optional",ref:"style.lineThickness",translation:"LayerStyleEditor.style.lineThickness",show:!0,defaultValue:n?3:2,min:1,max:6,step:1},lineType:{component:"dropdown",type:"string",expression:"optional",ref:"style.lineType",translation:"LayerStyleEditor.style.lineType",show:!0,defaultValue:"",options:[{value:"",translation:"LayerStyleEditor.style.solid"},{value:"8 4",translation:"LayerStyleEditor.style.dashed"}],convertFunctions:{get(e,t){const n=e(t.type);return void 0===n||""===n?"":"8 4"}}},lineCurve:{translation:"LayerStyleEditor.style.lineCurve",type:"string",ref:"style.lineCurve",component:"dropdown",defaultValue:n?"monotone":"linear",expression:"optional",options:[{value:"linear",translation:"LayerStyleEditor.style.linear"},{value:"monotone",translation:"LayerStyleEditor.style.monotone"}]}}},showPoints:{ref:"showPoints",translation:"properties.dataPoints.showDataPoints",type:"boolean",defaultValue:!1}}}}};return r},op=/^data:(?<!\s)\s*(image\/[\w+-.]+)(?<!\s)\s*(;.*?){0,1}(?<!\s)\s*,(.*)/i,ap=5e6,sp=5e5;const lp={fromSearchString:function(e){if(!e)return[];"?"===e[0]&&(e=e.substr(1));const t=[];return e.split("&").forEach(e=>{if(!e)return;const n=e.indexOf("=");let r,i="",o=!1;-1===n?r=e:(r=e.slice(0,n),i=e.slice(n+1),o=!0),t.push(function(e,t,n){return{key:cp(e),value:cp(t.replace(/%2B/g,"shouldNotDecodePlus")),useEqualSign:n}}(r,i,o))}),t}};function cp(e){try{return decodeURIComponent(e)}catch{return e}}function up(e){if(!(this instanceof up))throw new Error("Url needs to be called with the new keyword");if(!e)throw new Error("Url needs a string to operate on");const t=function(e){const t={authorityAndPath:"",search:"",hash:""};let n=e.indexOf("#");-1!==n&&(t.hash=e.substr(n),e=e.substr(0,n));n=e.indexOf("?"),-1!==n&&(t.search=e.substr(n),e=e.substr(0,n));return t.authorityAndPath=e,t}(e);Object.defineProperties(this,{authorityAndPath:{value:t.authorityAndPath},search:{value:t.search},hash:{value:t.hash},searchParams:{get:()=>lp.fromSearchString(t.search)}})}function dp(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%2B/gi,"+").replace(/shouldNotDecodePlus/gi,"%2B")}up.encodeAuthorityAndPath=function(e){return encodeURI(e).replace(/%5B/gi,"[").replace(/%5D/gi,"]").replace(/%25/gi,"%")},up.encodeSearchParams=function(e){let t,n="";for(let r=0;r<e.length;r++)t=e[r],n+=0===r?"?":"&",n+=dp(t.key),t.value?n+=`=${dp(t.value)}`:n+=t.useEqualSign?"=":"";return n};var fp=class{_hasNext(){return null!=this._input&&(0!==this._input.length&&this._index<this._input.length)}constructor(e){this._input=e,this._pushback=null,this._temp=null,this._index=0,this._mark=0}pushback(e){this._pushback=e}index(){return this._index}hasNext(){return null!=this._pushback||this._hasNext()}next(){if(null!=this._pushback){const e=this._pushback;return this._pushback=null,e}return this._hasNext()?this._input.charAt(this._index++):null}nextHex(){const e=this.next();return null==e?null:e.match(/[0-9A-Fa-f]/)?e:null}peek(e){return e?!(!this._pushback||this._pushback!==e)||!!this._hasNext()&&this._input.charAt(this._index)===e:this._pushback?this._pushback:this._hasNext()?this._input.charAt(this._index):null}mark(){this._temp=this._pushback,this._mark=this._index}reset(){this._pushback=this._temp,this._index=this._mark}remainder(){let e=this._input.substr(this._index);return null!=this._pushback&&(e=this._pushback+e),e}},hp=class{decode(e){let t="";const n=new fp(e);let r;for(;n.hasNext();)r=this.decodeCharacter(n),t+=null!=r?r:n.next();return t}decodeCharacter(e){return e.next()}};const pp=e=>e>=0&&e<=1114111,mp=e=>e.match(/[\s]/);var gp=class extends hp{decodeCharacter(e){e.mark();const t=e.next();let n,r,i;if(null==t||"\\"!==t)return e.reset(),null;const o=e.next();if(null==o)return e.reset(),null;switch(o){case"\r":e.peek("\n")&&e.next();case"\n":case"\f":case"\0":return this.decodeCharacter(e)}if("NaN"===parseInt(o,16))return o;for(n=o,r=0;r<5&&(i=e.next(),null!=i&&!mp(i));r++){if("NaN"===parseInt(i,16)){e.pushback(i);break}n+=i}const a=parseInt(n,16);return pp(a)?String.fromCharCode(a):"�"}},yp=class e{constructor(e,t){this._key=e,this._value=t}getKey(){return this._key}getValue(){return this._value}equals(t){return t instanceof e&&(this._key===t._key&&this._value===t._value)}static newInstanceIfNeeded(){let t,n,r=arguments[0];return"string"==typeof arguments[1]?(t=arguments[1],n=r.length):(n=arguments[1],t=arguments[2]),t&&r?(r.length>n&&(r=r.substr(0,n)),new e(r,t)):null}},vp=class e{setValue(e){this._nextMap=null,this._value=e}getNextNode(e){return this._nextMap?this._nextMap[e]:null}put(t,n,r){let i,o;if(t.length===n)return o=this._value,this.setValue(r),o;const a=t.charAt(n);return this._nextMap?(i=this._nextMap[a],i||(i=new e,this._nextMap[a]=i)):(this._nextMap={},i=new e,this._nextMap[a]=i),i.put(t,n+1,r)}get(e,t){if(e.length<=t)return this._value;const n=this.getNextNode(e.charAt(t));return n?n.get(e,t+1):null}getLongestMatch(e,t){if(e.length<=t)return yp.newInstanceIfNeeded(e,this._value);const n=this.getNextNode(e.charAt(t));if(!n)return yp.newInstanceIfNeeded(e,t,this._value);const r=n.getLongestMatch(e,t+1);return r||yp.newInstanceIfNeeded(e,t,this._value)}},bp=class{constructor(){this.clear()}getLongestMatch(e){return this.root&&e?this.root.getLongestMatch(e,0):null}getMaxKeyLength(){return this.maxKeyLen}clear(){this.root=null,this.maxKeyLen=0,this.size=0}put(e,t){this.root||(this.root=new vp);const n=this.root.put(e,0,t);return n||(e.length>this.maxKeyLen&&(this.maxKeyLen=e.length),this.size++,null)}};const xp=(()=>{const e=[],t=[],n=new bp;let r,i,o;for(r in e["&quot"]="34",e["&amp"]="38",e["&lt"]="60",e["&gt"]="62",e["&nbsp"]="160",e["&iexcl"]="161",e["&cent"]="162",e["&pound"]="163",e["&curren"]="164",e["&yen"]="165",e["&brvbar"]="166",e["&sect"]="167",e["&uml"]="168",e["&copy"]="169",e["&ordf"]="170",e["&laquo"]="171",e["&not"]="172",e["&shy"]="173",e["&reg"]="174",e["&macr"]="175",e["&deg"]="176",e["&plusmn"]="177",e["&sup2"]="178",e["&sup3"]="179",e["&acute"]="180",e["&micro"]="181",e["&para"]="182",e["&middot"]="183",e["&cedil"]="184",e["&sup1"]="185",e["&ordm"]="186",e["&raquo"]="187",e["&frac14"]="188",e["&frac12"]="189",e["&frac34"]="190",e["&iquest"]="191",e["&Agrave"]="192",e["&Aacute"]="193",e["&Acirc"]="194",e["&Atilde"]="195",e["&Auml"]="196",e["&Aring"]="197",e["&AElig"]="198",e["&Ccedil"]="199",e["&Egrave"]="200",e["&Eacute"]="201",e["&Ecirc"]="202",e["&Euml"]="203",e["&Igrave"]="204",e["&Iacute"]="205",e["&Icirc"]="206",e["&Iuml"]="207",e["&ETH"]="208",e["&Ntilde"]="209",e["&Ograve"]="210",e["&Oacute"]="211",e["&Ocirc"]="212",e["&Otilde"]="213",e["&Ouml"]="214",e["&times"]="215",e["&Oslash"]="216",e["&Ugrave"]="217",e["&Uacute"]="218",e["&Ucirc"]="219",e["&Uuml"]="220",e["&Yacute"]="221",e["&THORN"]="222",e["&szlig"]="223",e["&agrave"]="224",e["&aacute"]="225",e["&acirc"]="226",e["&atilde"]="227",e["&auml"]="228",e["&aring"]="229",e["&aelig"]="230",e["&ccedil"]="231",e["&egrave"]="232",e["&eacute"]="233",e["&ecirc"]="234",e["&euml"]="235",e["&igrave"]="236",e["&iacute"]="237",e["&icirc"]="238",e["&iuml"]="239",e["&eth"]="240",e["&ntilde"]="241",e["&ograve"]="242",e["&oacute"]="243",e["&ocirc"]="244",e["&otilde"]="245",e["&ouml"]="246",e["&divide"]="247",e["&oslash"]="248",e["&ugrave"]="249",e["&uacute"]="250",e["&ucirc"]="251",e["&uuml"]="252",e["&yacute"]="253",e["&thorn"]="254",e["&yuml"]="255",e["&OElig"]="338",e["&oelig"]="339",e["&Scaron"]="352",e["&scaron"]="353",e["&Yuml"]="376",e["&fnof"]="402",e["&circ"]="710",e["&tilde"]="732",e["&Alpha"]="913",e["&Beta"]="914",e["&Gamma"]="915",e["&Delta"]="916",e["&Epsilon"]="917",e["&Zeta"]="918",e["&Eta"]="919",e["&Theta"]="920",e["&Iota"]="921",e["&Kappa"]="922",e["&Lambda"]="923",e["&Mu"]="924",e["&Nu"]="925",e["&Xi"]="926",e["&Omicron"]="927",e["&Pi"]="928",e["&Rho"]="929",e["&Sigma"]="931",e["&Tau"]="932",e["&Upsilon"]="933",e["&Phi"]="934",e["&Chi"]="935",e["&Psi"]="936",e["&Omega"]="937",e["&alpha"]="945",e["&beta"]="946",e["&gamma"]="947",e["&delta"]="948",e["&epsilon"]="949",e["&zeta"]="950",e["&eta"]="951",e["&theta"]="952",e["&iota"]="953",e["&kappa"]="954",e["&lambda"]="955",e["&mu"]="956",e["&nu"]="957",e["&xi"]="958",e["&omicron"]="959",e["&pi"]="960",e["&rho"]="961",e["&sigmaf"]="962",e["&sigma"]="963",e["&tau"]="964",e["&upsilon"]="965",e["&phi"]="966",e["&chi"]="967",e["&psi"]="968",e["&omega"]="969",e["&thetasym"]="977",e["&upsih"]="978",e["&piv"]="982",e["&ensp"]="8194",e["&emsp"]="8195",e["&thinsp"]="8201",e["&zwnj"]="8204",e["&zwj"]="8205",e["&lrm"]="8206",e["&rlm"]="8207",e["&ndash"]="8211",e["&mdash"]="8212",e["&lsquo"]="8216",e["&rsquo"]="8217",e["&sbquo"]="8218",e["&ldquo"]="8220",e["&rdquo"]="8221",e["&bdquo"]="8222",e["&dagger"]="8224",e["&Dagger"]="8225",e["&bull"]="8226",e["&hellip"]="8230",e["&permil"]="8240",e["&prime"]="8242",e["&Prime"]="8243",e["&lsaquo"]="8249",e["&rsaquo"]="8250",e["&oline"]="8254",e["&frasl"]="8260",e["&euro"]="8364",e["&image"]="8365",e["&weierp"]="8472",e["&real"]="8476",e["&trade"]="8482",e["&alefsym"]="8501",e["&larr"]="8592",e["&uarr"]="8593",e["&rarr"]="8594",e["&darr"]="8595",e["&harr"]="8596",e["&crarr"]="8629",e["&lArr"]="8656",e["&uArr"]="8657",e["&rArr"]="8658",e["&dArr"]="8659",e["&hArr"]="8660",e["&forall"]="8704",e["&part"]="8706",e["&exist"]="8707",e["&empty"]="8709",e["&nabla"]="8711",e["&isin"]="8712",e["&notin"]="8713",e["&ni"]="8715",e["&prod"]="8719",e["&sum"]="8721",e["&minus"]="8722",e["&lowast"]="8727",e["&radic"]="8730",e["&prop"]="8733",e["&infin"]="8734",e["&ang"]="8736",e["&and"]="8743",e["&or"]="8744",e["&cap"]="8745",e["&cup"]="8746",e["&int"]="8747",e["&there4"]="8756",e["&sim"]="8764",e["&cong"]="8773",e["&asymp"]="8776",e["&ne"]="8800",e["&equiv"]="8801",e["&le"]="8804",e["&ge"]="8805",e["&sub"]="8834",e["&sup"]="8835",e["&nsub"]="8836",e["&sube"]="8838",e["&supe"]="8839",e["&oplus"]="8853",e["&otimes"]="8855",e["&perp"]="8869",e["&sdot"]="8901",e["&lceil"]="8968",e["&rceil"]="8969",e["&lfloor"]="8970",e["&rfloor"]="8971",e["&lang"]="9001",e["&rang"]="9002",e["&loz"]="9674",e["&spades"]="9824",e["&clubs"]="9827",e["&hearts"]="9829",e["&diams"]="9830",e)"function"!=typeof e[r]&&e.hasOwnProperty(r)&&(t[e[r]]=r);for(i in t)"function"!=typeof t[i]&&t.hasOwnProperty(i)&&(o=t[i].toLowerCase().substr(1),n.put(o,String.fromCharCode(i)));return n})();var Sp=class extends hp{decodeCharacter(e){let t;e.mark();const n=e.next();if(null==n||"&"!==n)return e.reset(),null;const r=e.next();if(null==r)return e.reset(),null;if("#"===r){if(t=this._getNumericEntity(e),null!=t)return t}else if(r.match(/[A-Za-z]/)&&(e.pushback(r),t=this._getNamedEntity(e),null!=t))return t;return e.reset(),null}_getNamedEntity(e){let t,n,r,i="";for(t=Math.min(e.remainder().length,xp.getMaxKeyLength()),r=0;r<t;r++)i+=e.next().toLowerCase();const o=xp.getLongestMatch(i);if(null==o)return null;for(e.reset(),e.next(),t=o.getKey().length,n=0;n<t;n++)e.next();return e.peek(";")&&e.next(),o.getValue()}_getNumericEntity(e){const t=e.peek();return null==t?null:"x"===t||"X"===t?(e.next(),this._parseHex(e)):this._parseNumber(e)}_parseHex(e){let t,n="";for(;e.hasNext();){if(t=e.peek(),Number.isNaN(+parseInt(t,16))){if(";"===t){e.next();break}break}n+=t,e.next()}const r=parseInt(n,16);return!Number.isNaN(+r)&&pp(r)?String.fromCharCode(r):null}_parseNumber(e){let t,n="";for(;e.hasNext();){if(t=e.peek(),Number.isNaN(+parseInt(t,10))){if(";"===t){e.next();break}break}n+=t,e.next()}const r=parseInt(n,10);return!Number.isNaN(+r)&&pp(r)?String.fromCharCode(r):null}},Mp=class extends hp{decodeCharacter(e){e.mark();const t=e.next();let n,r,i,o;if(null==t)return e.reset(),null;if("%"!==t)return e.reset(),null;for(n="",r=0;r<2;r++)i=e.nextHex(),null!=i&&(n+=i);return 2===n.length&&(o=parseInt(n,16),pp(o))?String.fromCharCode(o):(e.reset(),null)}};let wp;"undefined"!=typeof document&&(wp=document.createElement("div"));const kp=Array.prototype.indexOf,Ep=[",",".","_"," "],Cp=[",",".","-","_"," "],Np={width:["%"],height:["%"]},Tp={default:["-"," ","%"],color:["#"," ","(",")"],image:["(",")",":","/","?","&","-",".",'"',"="," "]},Dp={background:["(",")",":","%","/","?","&","-"," ",".",'"',"=","#"],"background-image":Tp.image,"background-color":Tp.color,"border-color":Tp.color,"border-image":Tp.image,color:Tp.color,icon:Tp.image,"list-style-image":Tp.image,"outline-color":Tp.color},qp={attr_name:["^on[a-z]{1,}","style","href","src"],attr_val:["javascript:","data:"],css_key:["behavior","-moz-behavior","-ms-behavior"],css_val:["expression"]};function Op(e,t,n){let r;if(t){if(kp)return kp.call(t,e,n);for(r=t.length,n=n?n<0?Math.max(0,r+n):n:0;n<r;n++)if(n in t&&t[n]===e)return n}return-1}function Ip(e){if(null==e)return"";let t="";const n=document.createTextNode(e);return wp.appendChild(n),t=wp.innerHTML,wp.removeChild(n),t}function Ap(e,t,n){let r,i,o,a,s,l,c,u,d;for(e=Lp(e).toLowerCase(),t=Lp(t),o=0;o<qp.attr_name.length;o++)if(e.match(qp.attr_name[o]))throw new Error(`Unsafe attribute name used: ${e}`);for(o=0;o<qp.attr_val.length;o++)if(t.toLowerCase().match(qp.attr_val[o]))throw new Error(`Unsafe attribute value used: ${t}`);if(r=Np[e],r||(r=Cp),i="",!n){for(a=0;a<e.length;a++){if(s=e.charAt(a),!s.match(/[a-zA-Z\-0-9]/))throw new Error("Invalid attribute name specified");i+=s}i+='="'}for(l=0;l<t.length;l++)c=t.charAt(l),u=t.charCodeAt(l),!c.match(/[a-zA-Z0-9]/)&&Op(c,r)<0?(d=u.toString(16),i+=`&#x${d};`):i+=c;return n||(i+='"'),i}function _p(e,t,n){let r,i,o,a,s,l,c,u,d,f;if(e=Lp(e).toLowerCase(),t=Lp(t),Op(e,qp.css_key)>=0)throw new Error(`Unsafe property name used: ${e}`);for(r=0;r<qp.css_val.length;r++)if(t.toLowerCase().indexOf(qp.css_val[r])>=0)throw new Error(`Unsafe property value used: ${t}`);if(i=Dp[e],i||(i=Tp.default),o="",!n){for(a=0;a<e.length;a++){if(s=e.charAt(a),!s.match(/[a-zA-Z-]/))throw new Error("Invalid Property Name specified");o+=s}o+=": "}for(l=0;l<t.length;l++)c=t.charAt(l),u=t.charCodeAt(l),!c.match(/[a-zA-Z0-9]/)&&Op(c,i)<0?(d=u.toString(16),f="000000".substr(d.length),o+=`\\${f}${d}`):o+=c;return o}function Lp(e,t){let n,r,i,o,a=!1;if(null===e)return null;n=e,r=e,i=0;const s=[new Sp,new Mp,new gp];for(;!a;){r=n;for(let e=0;e<s.length;e++)o=s[e].decode(n),o!==n&&(i++,n=o);r!==n||(a=!0)}if(t&&i>1)throw new Error("Attack Detected - Multiple/Double Encodings used in input");return n}const Pp=[];for(let e=0;e<255;e++)Pp[e]=e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122?null:e.toString(16);const Rp={html:e=>Ip(e.unsafe),css(e){let t,n=[];const r=[],i={};let o="";for(t in e.map?n=e.map:n[e.name]=e.unsafe,n)"function"!=typeof n[t]&&n.hasOwnProperty(t)&&(r[t]=_p(t,n[t],!0),o+=_p(t,n[t],!0),i[t]=r[t]);return e.map?i:o},attr(e){let t=[];const n=[],r={};let i="";e.map?t=e.map:t[e.name]=e.unsafe;for(const e in t)"function"!=typeof t[e]&&t.hasOwnProperty(e)&&(n[e]=Ap(e,t[e],!0),i+=Ap(e,t[e],!0),r[e]=n[e]);return e.map?r:i}};function Fp(e,t){throw new Error(t)}var zp={canonicalize:Lp,encode:function(){const e={context:"html",unsafe:null,name:null,map:null,setter:null,strict:!0};return 1===arguments.length&&"object"==typeof arguments[0]?function(){let e,t,n;const r=arguments[0]||{};let i=1;const o=arguments.length;for(;i<o;i++)if(null!=(e=arguments[i]))for(t in e)if(e.hasOwnProperty(t)){if(n=e[t],r===n)continue;void 0!==n&&(r[t]=n)}}(e,arguments[0]):(e.context=arguments[0],2===arguments.length?"html"===e.context?e.unsafe=arguments[1]:"attr"!==e.context&&"css"!==e.context||(e.map=arguments[1]):(e.name=arguments[2],e.unsafe=arguments[1])),"html"===e.context?Rp.html(e):"css"===e.context?(null!=e.map&&"object"!=typeof e.map&&Fp(this,"Invalid parameter type"),Rp.css(e)):"attr"===e.context?(null!=e.map&&"object"!=typeof e.map&&Fp(this,"Invalid parameter type"),Rp.attr(e)):void Fp(this,"Invalid parameter type")},encodeForAttr:Ap,encodeForAttr2:function(e){return Ap("nonsens",e,!0)},encodeForCSS:_p,encodeForHref:function(e){Lp(e),0!==e.search("[a-zA-Z0-9]+:")&&(e=`http://${e}`);const t=new up(e),n=up.encodeAuthorityAndPath(t.authorityAndPath),r=t.searchParams;e=n+up.encodeSearchParams(r)+t.hash;const i=decodeURI(e).toLowerCase();if(-1!==i.indexOf("javascript:"))throw new Error("Attack Detected - Javascript in input");if(-1!==i.indexOf("data:"))throw new Error("Attack Detected - data in input");return e},encodeForJS:function(e,t){let n,r,i,o,a,s;for(t||(t=Ep),s="",n=0;n<e.length;n++)i=e.charAt(n),o=e.charCodeAt(n),Op(i,t)>=0||null==Pp[o]?s+=i:(r=o.toString(16),o<256?(a="00".substr(r.length),s+=`\\x${a}${r.toUpperCase()}`):(a="0000".substr(r.length),s+=`\\u${a}${r.toUpperCase()}`));return s},encodeForHTML:Ip,encodeForURL:function(e,t){let n="";return t&&(t.match(/^[A-Za-z\-0-9]{1,}$/)?n+=Lp(t).toLowerCase():Fp(this,"Illegal Attribute Name Specified"),n+='="'),n+=encodeURIComponent(e).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A"),n+=t?'"':"",n},isSafeDataURL:(e,t)=>{const{maxByteSizeSvg:n=sp,maxByteSizeImage:r=ap}=t??{},{mimeType:i,encoding:o,data:a}=(e=>{const[,t,n,r]=op.exec(e.trim())??[];return{encoding:n,data:r,mimeType:t?.toLocaleLowerCase()}})(e);if(!a)return!0;const s=((e,t,n)=>{const r={type:e};if(t?.includes(";base64"))try{return new Blob([atob(n)],r).size}catch{return new Blob([n],r).size}return"image/svg+xml"===e?new Blob([n],r).size:0})(i,o,a);return"image/svg+xml"===i?s<=n:s<=r},validateURI:function(e){if(""===e||function(e){if("canParse"in URL)return URL.canParse(e);try{return new URL(e),!0}catch{return!1}}(e))return!1;const t=e.replace(/%2E/gi,".");if(t.match(/[#&=: ]/))return!1;const n=function(e){let t=e,n="";for(;t.length>0;)if(t.startsWith("../")||t.startsWith("./"))t=t.replace(/^\.\.?\//,"");else if(t.startsWith("/./"))t=t.replace(/^\/\.\//,"/");else if("/."===t)t="/";else if(t.startsWith("/../")){t=t.replace(/^\/\.\.\//,"/");const e=n.lastIndexOf("/");-1!==e&&(n=n.slice(0,e))}else if("/.."===t){t="/";const e=n.lastIndexOf("/");-1!==e&&(n=n.slice(0,e))}else if("."===t||".."===t)t="";else{const e=t.match(/^\/?[^/]*/),r=e?e[0]:"";t=t.slice(r.length),n+=r}return n}(t);return""!==n&&"/"!==n&&n}};function jp(e,t){try{return e?.host?new URL(e.host):function(e){if(e?.session?.config)try{const{config:t}=e.session,n=new URL(t.url);n.protocol="wss:"===n.protocol?"https:":"http:";const r=n.pathname.split("/").filter(Boolean);return n.pathname="app"===r[0]?"":`/${r[0]}`,n}catch{return}}(t)}catch{return}}function $p({app:e,chart:t,chartModel:n,discreteModel:r,colorService:i,themeService:o,layoutService:a,dockService:s,flags:l,rtl:c,majorScale:u,minorScale:d,mainComponentKey:f,key:h,image:p,queryParams:m,hostConfig:g}){const y=Bh({chart:t,chartModel:n,discreteModel:r,colorService:i,themeService:o,layoutService:a,dockService:s,rtl:c,majorScale:u,minorScale:d,mainComponentKey:f,data:[p],key:h}),v={imageSrc:void 0,size:void 0,position:void 0,symbol:void 0,imageScalingFactor:void 0};let b;if(b=p.image?.url?.qStaticContentUrl?.qUrl?function(e,t,n,r){const i=jp(t,n);if(!i)return;let o=e.replace(/^\.\.\//i,"/");o=o.replace(/\\/g,"\\\\"),o=o.replace(/"/g,'\\"'),o=o.replace(/'/g,"\\'"),o="/"===o[0]?o.substring(1):o;const a=`${i.pathname}/${o}`.replace(/\/+/g,"/");try{const e=new URL(a,i.origin);return r&&Object.entries(r).forEach(([t,n])=>{e.searchParams.append(t,n)}),e.href}catch{return}}(p.image.url.qStaticContentUrl.qUrl,g,e,m):p.image?.url?.expressionUrl,!b)return!1;const x=p.size.simpleSize||1;"custom"===p.size.option?(v.width="rectangle"===p.style?.symbol?p.size.customWidth:p.size.customRadius,v.height="rectangle"===p.style?.symbol?p.size.customHeight:p.size.customRadius):v.imageScalingFactor=x;const S=p.image?.position||"center-center",M=p.style?.symbol||"rectangle";return!(p.image.url.expressionUrl&&!function(e){if(!e||"string"!=typeof e)return!1;try{return zp.canonicalize(e,!0),!e.startsWith("data:")||zp.isSafeDataURL(e)}catch{return!1}}(p.image.url.expressionUrl))&&(v.imageSrc=b,v.size=x,y.settings.shape="image",y.settings.strokeWidth=()=>0,v.position=S,v.symbol=M,y.settings.opacity=p.style?.opacity||1,y.settings.imageSettings=v,y)}const Vp={MINI_CHART:{value:"miniChart",translation:"properties.scrollbar.miniChart"},BAR:{value:"bar",translation:"properties.scrollbar.bar"},NONE:{value:"none",translation:"properties.scrollbar.none"}};var Up={OPTIONS:Vp,DEFAULT:Vp.MINI_CHART};function Hp({layoutService:e,discrete:t}){return({h:n,rect:r,orientation:i,minThumbSize:o})=>{const a=t.query.getCurrentDataPage(),s=e.meta.size.y,l="horizontal"===i,c=r[l?"width":"height"];let u=a.qArea.qTop/s*c,d=a.qArea.qHeight/s*c;if(d<o){const e=(o-d)/2;u=u-e+(Math.max(0,0-(u-e))-Math.max(0,u+d+e-c)),d=o}return n("div",{style:{position:"absolute",right:0,bottom:0,background:"red",opacity:.2,...l?{top:0,left:u,width:d}:{top:u,left:0,height:d}}})}}function Bp({layoutService:e,viewState:t,viewCache:n}){return e.meta.isContinuous?function(e,t){const n=e.get("zoom"),r=t.get("continuousMin"),i=t.get("continuousMax");return[(n.min-r)/(i-r),(n.max-r)/(i-r)]}(t,n):function(e){return e.get("viewRange")}(t)}const Wp=e=>({miniChart:e===Up.OPTIONS.MINI_CHART.value,bar:e===Up.OPTIONS.BAR.value,none:e===Up.OPTIONS.NONE.value});function Yp({layoutService:e,override:t}){const n=(({layoutService:e})=>{const t=e.getLayoutValue("scrollbar");if(t)return Wp(t);const n=e.getLayoutValue("showMiniChartForContinuousAxis");if(void 0===n)return Wp(Up.DEFAULT.value);const r=e.getLayoutValue("dimensionAxis.continuousAuto"),i=e.getLayoutValue("preferContinuousAxis");return Wp(!n&&(r||!r&&i)?Up.OPTIONS.NONE.value:Up.OPTIONS.MINI_CHART.value)})({layoutService:e});return t&&t.predicate({layoutService:e,scrollbar:n})&&(n.miniChart=t.value===Up.OPTIONS.MINI_CHART.value,n.bar=t.value===Up.OPTIONS.BAR.value,n.none=t.value===Up.OPTIONS.NONE.value),n}function Gp({componentKey:e,chart:t,viewState:n,viewCache:r,layoutService:i,dockService:o,rtl:a}){return s=>{const{x:l,y:c}=s.center,u=t.element.getBoundingClientRect(),d=t.component(e),f="horizontal"===o.meta.major.orientation,h=f?l-u.left-d.rect.computedInner.x:c-u.top-d.rect.computedInner.y,p=f?d.rect.computedInner.width:d.rect.computedInner.height,m=f&&a?p-h:h,g=Math.max(0,Math.min(m/p,1)),[y,v]=Bp({layoutService:i,viewState:n,viewCache:r}),b=g<y,x=g>v,S=!b&&!x;return{pixel:m,relative:g,thumb:S?m-y*p:0,beforeThumb:b,afterThumb:x,onThumb:S}}}function Kp({componentKey:e,chart:t,viewState:n,viewCache:r,layoutService:i,dockService:o}){return()=>{const a=t.component(e),{orientation:s}=o.meta.major,{width:l,height:c}=a.rect.computedInner,u="horizontal"===s?l:c,[d,f]=Bp({layoutService:i,viewState:n,viewCache:r});return{size:u,thumbSize:(f-d)*u}}}function Xp({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l}){const c=Gp({componentKey:e,chart:t,viewState:r,viewCache:i,layoutService:o,dockService:a,rtl:l}),u=Kp({componentKey:e,chart:t,viewState:r,viewCache:i,layoutService:o,dockService:a});return{type:"Tap",options:{event:"scrollbarTap",enable:(r,i)=>!i||!!n.scroll.enabled()&&t.componentsFromPoint({x:i.center.x,y:i.center.y}).some(t=>t.key===e)},events:{scrollbarTap(n){n.preventDefault();const a=c(n);if(o.meta.isContinuous){const e=r.get("zoom"),t=e.max-e.min,n=i.get("continuousMin"),o=i.get("continuousMax"),s=n+(o-n)*a.relative;r.set("zoom",{min:Math.min(s-t/2,o-t),max:Math.max(s+t/2,n+t)})}else{const e=u(),t=a.pixel-e.thumbSize/2,n=Math.max(0,t/e.size);s.command.scrollTo(n)}t.component(e).emit("render")}}}}const Jp="data-scrollbar-handle";function Zp({e:e}){return(e.srcEvent||e).srcElement.getAttribute(Jp)||""}const Qp="scrollbarResize";function em({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,rtl:s}){const l=Gp({componentKey:e,chart:t,viewState:r,viewCache:i,layoutService:o,dockService:a,rtl:s});return{type:"Pan",key:`event:${Qp}`,options:{event:Qp,threshold:0,enable(e,t){return!(!o.meta.isContinuous||!n.scroll.enabled())&&(!t||(this[Qp]=this[Qp]||{},(e=>{const[t]=e.changedPointers;return t&&("pointerdown"===t.type||"mousedown"===t.type)})(t)&&Zp({e:t})&&(this[Qp].panningEvent=t.srcEvent),!!this[Qp].panningEvent))}},events:{[`${Qp}start`](n){n.preventDefault(),this[Qp]=this[Qp]||{},this[Qp].panningEvent&&t.component(e).emit("dragStart",this[Qp].panningEvent)},[`${Qp}move`](n){if(n.preventDefault(),this[Qp]=this[Qp]||{},!this[Qp].panningEvent)return;const o=r.get("zoom"),a=i.get("continuousMin"),s=i.get("continuousMax"),c=i.get("minimiumZoomSpan"),u=(s-a)*l(n).relative+a,d=Zp({e:this[Qp].panningEvent});let f="start"===d?Math.min(u,o.max):o.min,h="end"===d?Math.max(u,o.min):o.max;f===h&&(f-="start"===d?c:0,h+="end"===d?c:0),r.set("zoom",{min:f,max:h}),t.component(e).emit("render")},[`${Qp}end`](n){n.preventDefault(),this[Qp]=this[Qp]||{},delete this[Qp].panningEvent,t.component(e).emit("dragEnd")},[`${Qp}cancel`](n){n.preventDefault(),this[Qp]=this[Qp]||{},delete this[Qp].panningEvent,t.component(e).emit("dragEnd")}}}}const tm="scrollbarPan";function nm({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l}){const c=Gp({componentKey:e,chart:t,viewState:r,viewCache:i,layoutService:o,dockService:a,rtl:l}),u=Kp({componentKey:e,chart:t,viewState:r,viewCache:i,layoutService:o,dockService:a});return{type:"Pan",key:`event:${tm}`,options:{event:tm,threshold:0,enable(r,i){return this[tm]=this[tm]||{},!(i&&!this[tm].isPanning)||!!n.scroll.enabled()&&((!i||i.target===t.element)&&t.componentsFromPoint({x:i.center.x,y:i.center.y}).some(t=>t.key===e))}},events:{[`${tm}start`](n){n.preventDefault();const a=c(n);if(this[tm]=this[tm]||{},this[tm].isPanning=!0,t.component(e).emit("lockState"),o.meta.isContinuous){const e=r.get("zoom"),t=e.max-e.min,n=i.get("continuousMin"),o=i.get("continuousMax"),s=n+(o-n)*a.relative;s<e.min?r.set("zoom",{min:Math.min(s,o-t),max:Math.max(s+t,n+t)}):s>e.max&&r.set("zoom",{min:Math.min(s-t,o-t),max:Math.max(s,n+t)}),this[tm].relative=a.relative,this[tm].zoom=r.get("zoom"),this[tm].zoom.span=this[tm].zoom.max-this[tm].zoom.min,this[tm].zoom.fullSpan=o-n}else if(a.onThumb)this[tm].offset=a.thumb;else{const e=u();this[tm].offset=a.beforeThumb?0:e.thumbSize}},[`${tm}move`](n){n.preventDefault();const a=c(n);if(this[tm]=this[tm]||{},o.meta.isContinuous){const e=a.relative-this[tm].relative,{fullSpan:t,span:n,min:o,max:s}=this[tm].zoom,l=i.get("continuousMin"),c=i.get("continuousMax");r.set("zoom",{min:Math.min(o+e*t,c-n),max:Math.max(s+e*t,l+n)})}else{const e=a.pixel-(this[tm].offset||0),t=u(),n=Math.max(0,e/t.size);s.command.scrollTo(n)}t.component(e).emit("render")},[`${tm}end`](n){n.preventDefault(),this[tm]=this[tm]||{},this[tm].isPanning=!1,t.component(e).emit("unlockState")},[`${tm}cancel`](n){n.preventDefault(),this[tm]=this[tm]||{},this[tm].isPanning=!1,t.component(e).emit("unlockState")}}}}function rm({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l}){return[Xp({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l}),em({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,rtl:l}),nm({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l})]}function im({componentKey:e,chart:t,actions:n,layoutService:r}){const i=(i,o)=>{if(!r.meta.isContinuous)return;const a=t.component(e);a&&a.emit&&n.scroll.enabled()&&a.emit(i,o)};return{type:"native",events:{mousemove:e=>i("hover",e),mouseleave:()=>i("leave")}}}const om={background:"rgba(0, 0, 0, 0.1)"},am={top:-1,bottom:-1,width:6},sm={width:2,background:"#595959"};var lm={before:om,after:om,thumb:{background:"transparent",border:"1px solid rgba(68, 68, 68, 0.4)"},startHandle:am,endHandle:am,startHandleBorder:sm,endHandleBorder:sm};const cm={background:"rgba(0, 0, 0, 0.1)"},um={top:-1,bottom:-1,width:6},dm={width:2,background:"#595959"};var fm={before:cm,after:cm,thumb:{background:"#B0AFAE",border:"transparent"},startHandle:um,endHandle:um,startHandleBorder:dm,endHandleBorder:dm};const hm={position:"absolute",top:0,right:0,bottom:0,left:0,boxSizing:"border-box"},pm={pointerEvents:"initial"},mm={pointerEvents:"none"};const gm="ew-resize",ym="default";function vm(){const{rect:e}=this,{settings:t}=this.settings,n="horizontal"===t.orientation,r=n?e.computedInner.width:e.computedInner.height,i=t.range(),o=n&&t.rtl;return{size:r,start:(o?1-i[1]:i[0])*r,end:(o?1-i[0]:i[1])*r}}function bm(){const e=this.state.hover.start||this.state.hover.end||this.state.drag.start||this.state.drag.end;this.renderer.element().ownerDocument.body.style.cursor=e?gm:ym}function xm(e,t,n){const{min:r}=this.settings.settings.size.thumb;if(n-t<r){const i=(r-(n-t))/2,o=Math.max(0,0-(t-i))-Math.max(0,n+i-e);return{size:e,start:t-i+o,end:n+i+o}}return{size:e,start:t,end:n}}function Sm(e){const t=(e.srcEvent||e).srcElement;return this.renderer.element().contains(t)}function Mm(){const{size:e,start:t,end:n}=vm.call(this);this.renderer.render(this.elements(this.h,xm.call(this,e,t,n)))}function wm(){const{state:e,settings:t,style:n}=this,r=t.settings.style;return e.style[r]||(e.style[r]=function({id:e,style:t}){const n="slim"===e?fm:lm;return{container:{...hm},before:{...hm,...n.before,...t.before},after:{...hm,...n.after,...t.after},thumb:{...hm,...n.thumb,...t.thumb},startHandle:{...hm,...pm,...n.startHandle},endHandle:{...hm,...pm,...n.endHandle},startHandleBorder:{...hm,...mm,...n.startHandleBorder},endHandleBorder:{...hm,...mm,...n.endHandleBorder}}}({id:t.settings.style,style:n[r]})),e.style[r]}var km={require:["renderer"],defaultSettings:{settings:{style:"standard",size:{area:{min:30,max:40,ratio:1/8},thumb:{min:4}},orientation:"horizontal",rtl:!1,isContinuous:!1,range:()=>[0,1],injections:()=>[]},style:{standard:{before:{},thumb:{},after:{}},slim:{before:{},thumb:{},after:{}}}},renderer:"dom",on:{render(){Mm.call(this)},lockState(){this.state.locked=!0},unlockState(){this.state.locked=!1},hover(e){if(this.state.locked||this.state.drag.start||this.state.drag.end||!Sm.call(this,e)&&this.state.hover.isPristine())return;this.state.hover.reset();const t=Zp({e:e});t&&(this.state.hover[t]=!0),bm.call(this),Mm.call(this)},leave(){this.state.locked||(this.state.hover.reset(),bm.call(this),Mm.call(this))},dragStart(e){if(this.state.locked)return;this.state.drag.reset();const t=Zp({e:e});t&&(this.state.drag[t]=!0),bm.call(this)},dragEnd(){this.state.locked||(this.state.drag.reset(),bm.call(this),Mm.call(this))}},preferredSize({outer:e}){const{min:t,max:n,ratio:r}=this.settings.settings.size.area,i="horizontal"===this.settings.settings.orientation?"height":"width";return Math.max(t,Math.min(n,e[i]*r))},created(){this.state={style:{},locked:!1,hover:{start:!1,end:!1,reset(){this.start=!1,this.end=!1},isPristine(){return!this.start&&!this.end}},drag:{start:!1,end:!1,reset(){this.start=!1,this.end=!1}}}},render(e){this.h=e;const{size:t,start:n,end:r}=vm.call(this);return this.elements(e,xm.call(this,t,n,r))},properties(){return"horizontal"===this.settings.settings.orientation?{start:"left",end:"right"}:{start:"top",end:"bottom"}},elements(e,{size:t,start:n,end:r}){const{settings:i}=this.settings,o=i.injections().map(t=>t({h:e,rect:this.rect,orientation:i.orientation,minThumbSize:i.size.thumb.min}));return function({h:e,size:t,start:n,end:r,properties:i,startHandleActive:o,endHandleActive:a,style:s,continuous:l,invert:c,injections:u}){const d={[i.end]:t-n},f={[i.start]:r},h={left:-3},p={left:1},m={right:-3,left:"auto"},g={left:3},y=e("div",{style:{...s.before,...c?f:d},class:"scrollbar--before"}),v=e("div",{style:{...s.after,...c?d:f},class:"scrollbar--after"}),b=[];if(l){const t=e("div",{style:{...s.startHandle,...c?m:h},class:"scrollbar--start-handle",[Jp]:"start"},o?e("div",{style:{...s.startHandleBorder,...c?g:p}}):void 0);b.push(t);const n=e("div",{style:{...s.endHandle,...c?h:m},class:"scrollbar--end-handle",[Jp]:"end"},a?e("div",{style:{...s.endHandleBorder,...c?p:g}}):void 0);b.push(n)}const x=e("div",{style:{...s.thumb,[i.start]:n,[i.end]:t-r},class:"scrollbar--thumb"},b);return e("div",{style:{...s.container}},[y,x,v,...u])}({h:e,size:t,start:n,end:r,properties:this.properties(),startHandleActive:this.state.hover.start||this.state.drag.start,endHandleActive:this.state.hover.end||this.state.drag.end,style:wm.call(this),continuous:i.isContinuous,invert:"horizontal"===i.orientation&&i.rtl,injections:o})}};const Em={FORECAST:"forecast",FORECAST_LOWER:"forecast_lower",FORECAST_UPPER:"forecast_upper"},Cm=Object.keys(Em).map(e=>Em[e]);var Nm={ATTRIBUTE:{KEYS:Em,IDS:Cm},STEPS:{NUM_STEPS:3,STEP_SIZE_MULTIPLIER:1,STEP_SIZE:{SECONDS:"seconds",MINUTES:"minutes",HOURS:"hours",DAYS:"days",WEEKS:"weeks",MONTHS:"months",YEARS:"years",NUMBER:"number"}},DEFAULT_METHOD:"ssa_forecast"};const{ATTRIBUTE:Tm}=Nm,Dm=e=>{if(e?.qHyperCubeDef){let t=!1;e.qHyperCubeDef.qMeasures.forEach(e=>{e.qDef.forecast?.enabled&&(t=!0,e.qDef.forecast.enabled=!1,e.qAttributeExpressions&&(e.qAttributeExpressions=e.qAttributeExpressions.filter(e=>Tm.IDS.indexOf(e.id)<0)))}),t&&(e=>{e.qHyperCubeDef.qDynamicScript?.length&&(e.qHyperCubeDef.qDynamicScript=[])})(e)}},qm=e=>{const t=(e?.qHyperCubeDef?.qMeasures||[]).concat(e?.qHyperCubeDef?.qLayoutExclude?.qHyperCubeDef?.qMeasures||[]).filter(e=>e.qDef.forecast?.enabled);return t},Om=(e,{properties:t})=>1===qm(t).length&&!e.qDef.forecast?.enabled,Im=(e,t,{effectiveProperties:n})=>1===qm(n).length&&!e.qDef.forecast?.enabled;function Am(e){const{qDimensions:t=[],qMeasures:n=[]}=e?.qHyperCubeDef||{},r=e=>e.qCalcCondition?.qCond?.qv;return t.some(r)||n.some(r)}const _m=(e,t,n)=>{const r=t?.properties;if(Am(r))return!1;if((e=>{const{qDimensions:t,qMeasures:n}=e?.qHyperCubeDef||{};return 1===t?.length&&n?.length>=1})(r)){if(!n?.layout)return!1;if((e=>{const{qMeasures:t}=e?.qHyperCubeDef||{};return!("area"!==e?.lineType)&&e.stackedArea&&t?.length>1})(r))return!1;const{layout:e}=n;if("H"===e.qHyperCube.qDimensionInfo[0]?.qGrouping)return!1;const t=e.qHyperCube.isHCEnabled;return((e,t,n=!1)=>!!p.canBeContinuous(e)&&(t?.dimensionAxis?.continuousAuto?"function"==typeof n?n():n:!!t?.preferContinuousAxis))(e,r,()=>p.isTime(!0,e))&&!t}return!1},Lm=(e,t,n)=>_m(0,n,n),Pm=(e,t)=>{const{properties:n}=e,{layout:r}=t;return n.qHyperCubeDef.qDimensions[0].qDef.cId===r.qHyperCube.qDimensionInfo[0].cId},Rm=(e,t,n)=>e.qDef.forecast?.enabled&&_m(0,t,n)&&Pm(t,n),Fm=(e,t,n)=>e.qDef.forecast?.enabled&&_m(0,n,n)&&Pm(n,n),{STEPS:zm}=Nm,jm=(e,t)=>t===zm.STEP_SIZE.NUMBER?`${e}`:`${e} ${t}`,{STEPS:$m}=Nm,Vm={getScript:({confidence:e=.95,measureIx:t,attrIx:n,steps:r=$m.NUM_STEPS,stepSize:i=$m.STEP_SIZE.DAYS,stepSizeMultiplier:o=1,interpolateNanValues:a=!0})=>n<1?"":`add load\n        "Time Stamp" as #hc1.dimension.1,\n        Forecast as #hc1.measure.${t}.attribute.${n},\n        "Lower Uncertainty" as #hc1.measure.${t}.attribute.${n+1},\n        "Upper Uncertainty" as #hc1.measure.${t}.attribute.${n+2}\n        Extension qlikml.ScriptEval('\n          {\n            "RequestType": "ssa_forecast",\n            "ReturnType": "forecast_and_last",\n            "ConfidenceLevel": ${e},\n            "Horizon": "${jm(r*o,i)}",\n            "TimeStep": "${jm(o,i)}",\n            "InterpolateNanValues": "${a}",\n            "ShouldCache": "false"\n          }', HC1{#hc1.dimension.1, #hc1.measure.${t}});`},{STEPS:Um}=Nm,Hm={getScript:({confidence:e=.95,measureIx:t,attrIx:n,steps:r=Um.NUM_STEPS,stepSize:i=Um.STEP_SIZE.DAYS,stepSizeMultiplier:o=1,interpolateNanValues:a=!0})=>n<1?"":`add load\n        "Time Stamp" as #hc1.dimension.1,\n        Forecast as #hc1.measure.${t}.attribute.${n}\n        Extension qlikml.ScriptEval('\n          {\n            "RequestType": "ols_forecast",\n            "ReturnType": "forecast",\n            "ConfidenceLevel": ${e},\n            "Horizon": "${jm(r*o,i)}",\n            "TimeStep": "${jm(o,i)}",\n            "InterpolateNanValues": "${a}",\n            "ShouldCache": "false"\n          }', HC1{#hc1.dimension.1, #hc1.measure.${t}});`},{ATTRIBUTE:Bm}=Nm,Wm={ssa_forecast:Vm,ols_forecast:Hm},Ym=({measure:e,index:t,steps:n,stepSize:r,stepSizeMultiplier:i,interpolateNanValues:o})=>{const{method:a,confidence:s}=e.qDef.forecast||{},l=a||"ssa_forecast",c=((e,t)=>{const{qAttributeExpressions:n=[]}=e;for(let e=0;e<n.length;e++)if(n[e].id===t)return e;return-1})(e,Bm.KEYS.FORECAST)+1,u=t+1;return Wm[l].getScript({confidence:s,measureIx:u,attrIx:c,steps:n,stepSize:r,stepSizeMultiplier:i,interpolateNanValues:o})},{ATTRIBUTE:Gm}=Nm,Km=(e,t)=>{const n=e?.qHyperCubeDef?.isHCEnabled;if(n)return!1;const r=[],{steps:i,stepSize:o,stepSizeMultiplier:a}=e.qHyperCubeDef.qDimensions[0]?.qDef?.forecast||{};for(let n=0;n<e.qHyperCubeDef.qMeasures.length;++n){const s=e.qHyperCubeDef.qMeasures[n],l=s.qAttributeExpressions?s.qAttributeExpressions.filter(e=>Gm.IDS.indexOf(e.id)<0):s.qAttributeExpressions;if(Rm(s,{properties:e},t)){s.qAttributeExpressions=[...l||[],{id:Gm.KEYS.FORECAST,qExpression:""},{id:Gm.KEYS.FORECAST_LOWER,qExpression:""},{id:Gm.KEYS.FORECAST_UPPER,qExpression:""}];const e="zero"!==t.layout?.nullMode;r.push(Ym({measure:s,index:n,steps:i,stepSize:o,stepSizeMultiplier:a,interpolateNanValues:e}))}else s.qAttributeExpressions=l}const s=!((e,t)=>{if(e){if(t){if(e.length===t.length){for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return!1}return!1}return!t})(e.qHyperCubeDef.qDynamicScript,r);return e.qHyperCubeDef.qDynamicScript=r,s},Xm=({enabledForecast:e,properties:t,layout:n})=>!t?.qHyperCubeDef?.isHCEnabled&&(e?Km(t,{layout:n}):!!t?.qHyperCubeDef?.qDynamicScript?.length&&(Dm(t),t.qHyperCubeDef.qDynamicScript=[],!0)),Jm=(e,t,n,r)=>e.qDef.forecast?.method===r&&Rm(e,t,n),Zm="properties.forecast.label",Qm="properties.forecast.steps",eg="properties.forecast.method.label",tg="properties.forecast.method.ssa",ng="properties.forecast.method.ols",rg="properties.forecast.measureDisclaimer",ig={TITLE:"properties.forecast.stepSize.label",SECONDS:"properties.forecast.stepUnit.seconds",MINUTES:"properties.forecast.stepUnit.minutes",HOURS:"properties.forecast.stepUnit.hours",DAYS:"properties.forecast.stepUnit.days",WEEKS:"properties.forecast.stepUnit.weeks",MONTHS:"properties.forecast.stepUnit.months",YEARS:"properties.forecast.stepUnit.years",NUMBER:"properties.forecast.stepUnit.number"},og={SHOW:"properties.forecast.showConfidence",LEVEL:"properties.forecast.confidence",COLOR:"properties.forecast.confidenceColor"},ag=(e,t,n)=>t.properties.qHyperCubeDef.qMeasures.some(e=>Rm(e,t,n)),sg=(e,t,n)=>(Km(e,n),e),{STEPS:lg}=Nm;const cg=(e,t,n)=>"ssa_forecast"===e.qDef.forecast?.method&&Rm(e,t,n),ug=e=>"ssa_forecast"===e?.method&&e?.showConfidence,dg=(e,t,n)=>!(!ug(e.qDef.forecast)||!Jm(e,t,n,"ssa_forecast")),fg=(e,t,n)=>!!ug(e.qDef.forecast)&&Jm(e,t,n,"ssa_forecast");const{DEFAULT_METHOD:hg}=Nm;function pg(e){const t=function(e){return{showConfidenceLevel:{translation:og.SHOW,type:"boolean",ref:"qDef.forecast.showConfidence",component:"switch",defaultValue:!0,options:[{value:!0,translation:"properties.on"},{value:!1,translation:"properties.off"}],show:cg,readOnly:Om},confidenceColor:e?.isEnabled("VIZ_245_CONFIDENCE_COLOR")?{translation:og.COLOR,type:"object",ref:"qDef.forecast.confidenceColor",component:"color-picker",dualOutput:!0,disableNone:!1,showAlpha:!0,show:fg}:void 0,ssaConfidenceLevel:{translation:og.LEVEL,type:"number",ref:"qDef.forecast.confidence",defaultValue:.95,min:1e-5,max:.99999,rollbackInvalid:!0,show:dg}}}(e),n={translation:eg,type:"string",ref:"qDef.forecast.method",component:"dropdown",defaultValue:hg,options:[{value:"ssa_forecast",translation:tg},{value:"ols_forecast",translation:ng}],show:Rm},r={translation:"properties.color",type:"object",ref:"qDef.forecast.paletteColor",component:"color-picker",defaultValue:()=>({index:0,color:"none"}),dualOutput:!0,disableNone:!1,show:Rm},i={translation:"LayerStyleEditor.style.lineThickness",type:"number",ref:"qDef.forecast.lineThickness",component:"slider",defaultValue:e?.isEnabled("TLV_1804_DEFAULT_CHART_SETTINGS")?3:1,expression:"optional",min:1,max:5,step:1,show:Rm},o={translation:"LayerStyleEditor.style.lineType",type:"string",ref:"qDef.forecast.lineType",component:"dropdown",defaultValue:"dashed",expression:"optional",options:[{value:"solid",translation:"LayerStyleEditor.style.solid"},{value:"dashed",translation:"LayerStyleEditor.style.dashed"}],styleMeasure:!0,show:Rm},a={translation:"LayerStyleEditor.style.lineCurve",type:"string",ref:"qDef.forecast.lineCurve",component:"dropdown",defaultValue:e?.isEnabled("TLV_1804_DEFAULT_CHART_SETTINGS")?"monotone":"linear",expression:"optional",options:[{value:"linear",translation:"LayerStyleEditor.style.linear"},{value:"monotone",translation:"LayerStyleEditor.style.monotone"}],styleMeasure:!0,show:Rm},s={translation:rg,component:"text",show:Om};const l={translation:Zm,type:"boolean",ref:"qDef.forecast.enabled",component:"switch",defaultValue:!1,options:[{value:!0,translation:"properties.on"},{value:!1,translation:"properties.off"}],show:_m,readOnly:Om,change:e=>{var a;(a=e.qDef.forecast)&&(void 0===a.method&&(a.method=n.defaultValue),void 0===a.paletteColor&&(a.paletteColor=r.defaultValue()),void 0===a.lineThickness&&(a.lineThickness=i.defaultValue),void 0===a.lineType&&(a.lineType=o.defaultValue),void 0===a.showConfidence&&(a.showConfidence=t.showConfidenceLevel.defaultValue))}};return{type:"items",translation:Zm,items:{enabled:l,method:n,paletteColor:r,lineThickness:i,lineType:o,lineCurve:a,...t,disclaimer:s}}}const mg=(e,t,n)=>!Am(n.properties)&&t.qHyperCube?.qMeasureInfo.some(e=>e?.forecast?.enabled),gg=(e,t,n)=>(Km(e,n),e),{STEPS:yg}=Nm;const{DEFAULT_METHOD:vg}=Nm;var bg,xg={exports:{}};var Sg=(bg||(bg=1,function(e){self,e.exports=(()=>{var e={909:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},a=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var r,i=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!o)return!1;for(r in e);return void 0===r||t.call(e,r)},s=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},l=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(i)return i(e,n).value}return e[n]};e.exports=function e(){var t,n,r,i,c,u,d=arguments[0],f=1,h=arguments.length,p=!1;for("boolean"==typeof d&&(p=d,d=arguments[1]||{},f=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});f<h;++f)if(null!=(t=arguments[f]))for(n in t)r=l(d,n),d!==(i=l(t,n))&&(p&&i&&(a(i)||(c=o(i)))?(c?(c=!1,u=r&&o(r)?r:[]):u=r&&a(r)?r:{},s(d,{name:n,newValue:e(p,u,i)})):void 0!==i&&s(d,{name:n,newValue:i}));return d}},8:(e,t)=>{(()=>{var e={229:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},a=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var r,i=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!o)return!1;for(r in e);return void 0===r||t.call(e,r)},s=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},l=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(i)return i(e,n).value}return e[n]};e.exports=function e(){var t,n,r,i,c,u,d=arguments[0],f=1,h=arguments.length,p=!1;for("boolean"==typeof d&&(p=d,d=arguments[1]||{},f=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});f<h;++f)if(null!=(t=arguments[f]))for(n in t)r=l(d,n),d!==(i=l(t,n))&&(p&&i&&(a(i)||(c=o(i)))?(c?(c=!1,u=r&&o(r)?r:[]):u=r&&a(r)?r:{},s(d,{name:n,newValue:e(p,u,i)})):void 0!==i&&s(d,{name:n,newValue:i}));return d}}},n={};function r(t){var i=n[t];if(void 0!==i)return i.exports;var o=n[t]={exports:{}};return e[t](o,o.exports,r),o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};(()=>{r.r(i),r.d(i,{default:()=>Oe});var e=r(229),t=r.n(e);const n=function(e,t,n){if(!t)return!1;var r,i=t.split("."),o=i[i.length-1],a=e;for(r=0;r<i.length-1;++r)void 0===a[i[r]]&&(a[i[r]]=Number.isNaN(+i[r+1])?{}:[]),a=a[i[r]];if(void 0!==n){var s=a[o];return a[o]=n,{updated:n,previous:s}}return delete a[o],!1},o=function(e,t,n){var r,i=t.split("."),o=e;if(void 0===o)return n;for(r=0;r<i.length;++r){if(void 0===o[i[r]])return n;o=o[i[r]]}return o},a={EXPRESSIONS:{observed:"",trend:"STL_Trend",seasonal:"STL_Seasonal",residual:"STL_Residual"},OPTIONS:[{value:"observed",translation:"cao.trendDecomposition.parameters.decomposition.observed"},{value:"trend",translation:"cao.trendDecomposition.parameters.decomposition.trend"},{value:"seasonal",translation:"cao.trendDecomposition.parameters.decomposition.seasonal"},{value:"residual",translation:"cao.trendDecomposition.parameters.decomposition.residual"}]};var s="".concat(" ","(").concat("　"),l="".concat("　",")").concat(" ");function c(e){return s+e+l}function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.qLibraryId){var n=function(e,t){if(!t)return null;var n,r;for(n=0;n<t.length;n++)if((r=t[n]).qInfo.qId===e)return r;return null}(e.qLibraryId,t.dimensionList);return n&&n.qData.info[0].qTags.indexOf("$numeric")>-1}var r=function(e,t){if(!t)return null;var n,r,i=function(e){var t=e.trim();"="===t.charAt(0)&&(t=(t=t.substring(1)).trim());var n=t.length-1;return"["===t.charAt(0)&&"]"===t.charAt(n)&&(t=(t=t.substring(1,n)).trim()),t}(e);for(n=0;n<t.length;n++){if((r=t[n]).qName===i)return r;if(r.qDerivedFieldData)for(var o=0;o<r.qDerivedFieldData.qDerivedFieldLists.length;++o)for(var a=r.qDerivedFieldData.qDerivedFieldLists[o],s=0;s<a.qFieldDefs.length;++s){var l=a.qFieldDefs[s];if(l.qName===i)return l}}return null}(e.qDef.qFieldDefs[0],t.fieldList);return r&&r.qTags.indexOf("$numeric")>-1}function d(e){return!(!e.fullAccumulation&&!e.fullRange)}function f(e,t){var n=e.crossAllDimensions;return 2===t&&n?"RowNo(Total)":"RowNo()"}function h(e){var t=function(e){return e?(e=function(e){return e.replace(/\/\*[^]*?\*\//g,"")}(e=function(e){return e.replace(/\/\/(.*)$/gm,"")}(e))).trim():""}(e),n=t.trim();return"="===n.substring(0,1)?n.substring(1).trim():n}function p(){return"[$(=Replace(GetObjectField(".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,"),']',']]'))]")}function m(e,t){var n=e.crossAllDimensions;return 2===t&&n?"Above(Total ":"Above("}function g(e){return void 0===e?")":", 0, ".concat(e,")")}function y(e){return"Replace(Replace(".concat(e,",'''',''''''),'$','$''&''')")}function v(e,t){return e?"".concat(t,'={">=$(=Min(').concat(t,"))<=$(=Max(").concat(t,'))"}'):"".concat(t,'={"=Only({1}').concat(t,")>='$(=").concat(y("MinString(".concat(t,")")),")' and Only({1}").concat(t,")<='$(=").concat(y("MaxString(".concat(t,")")),")'\"}")}function b(e){var t=e.modifier,n=void 0===t?{}:t,r=e.dimensions,i=e.dimensionAndFieldList,o=e.funcComp,a=void 0===o?"Sum":o,s=e.valueComp,l=void 0===s?"0":s;if(!n.showExcludedValues)return"";if(r&&1===r.length){var c=v(u(r[0],i),p(0));return"".concat(a,"({1<").concat(c,">}").concat(l,")")}if(r&&2===r.length){var d=u(r[0],i),f=u(r[1],i),h=p(0),m=p(1),g=v(d,h),y=v(f,m);return"".concat(a,"({1<").concat(g,",").concat(y,">}").concat(l,")")}return"".concat(a,"({1}").concat(l,")")}function x(e){return"".concat(e,"(")}function S(e){var t=e.properties,n=e.layout;return o(t,"qHyperCubeDef.qDimensions",o(n,"qHyperCube.qDimensionInfo",[])).length}const M={isFullRange:d,getNumDimensions:S,getExpressionWithExcludedComp:function(e){var t=e.expression,n=e.modifier,r=e.dimensions,i=e.dimensionAndFieldList,o=e.treatMissingAsNull,a=c(h(t));if(!n.showExcludedValues)return a;var s=b({modifier:n,dimensions:r,dimensionAndFieldList:i}),l=o?"":", 0";if(r&&1===r.length){var u=p(0);return"If(Count(".concat(u,") > 0, ").concat(a," + ").concat(s).concat(l,")")}if(r&&2===r.length){var d=p(0),f=p(1);return"If(Count(".concat(d,") * Count(").concat(f,") > 0, ").concat(a," + ").concat(s).concat(l,")")}return a},getRowNoComp:f,getNumStepComp:function(e,t){if(!d(e)){var n=e.steps;return"number"!=typeof n||Number.isNaN(n)?6:n}return f(e,t)},getAboveCompPrefix:m,getAboveCompSuffix:g,getAboveComp:function(e,t,n,r){return m(e,t)+n+g(r)},getFunctionPrefix:x,getFunctionSuffix:function(){return")"},getRangeComp:function(e,t){return x(e)+t+")"},getAggrComp:function(e,t,n){return"Aggr(".concat(e,", ").concat(t,", ").concat(n,")")},getExcludedComp:b,needDimension:function(e){var t=e.modifier,n=e.properties,r=e.layout,i=function(e){return void 0===e.primaryDimension?e.accumulationDimension:e.primaryDimension}(t);return 0===i&&2===S({properties:n,layout:r})},getDimComp:function(e,t){var n=function(e){return e[arguments.length>1&&void 0!==arguments[1]?arguments[1]:0].qDef.qSortCriterias[0]}(e,t),r=p(t);if(!n.qSortByExpression&&!n.qSortByNumeric&&!n.qSortByAscii)return r;var i=["Descending","Ascending"],o=n.qSortByNumeric?"(Numeric, ".concat(i[(n.qSortByNumeric+1)/2],")"):"",a=n.qSortByAscii?"(Text, ".concat(i[(n.qSortByAscii+1)/2],")"):"";return n.qSortByNumeric&&n.qSortByAscii?"(".concat(r,", ").concat(o,", ").concat(a,")"):n.qSortByNumeric?"(".concat(r,", ").concat(o,")"):n.qSortByAscii?"(".concat(r,", ").concat(a,")"):r},simplifyExpression:h,extractInputExpression:function(e){var t=e.outputExpression;if(e.modifier){var n=t.indexOf(s);if(-1!==n){var r=t.indexOf(l);if(-1!==r)return t.substring(n+s.length,r)}}},initModifier:function(e,t){Object.keys(t).forEach(function(n){void 0===e[n]&&(e[n]=t[n])})},isNumeric:u,isApplicable:function(e){var t=e.properties,n=e.layout,r=e.minDimensions,i=void 0===r?1:r,o=e.maxDimensions,a=void 0===o?2:o;if(!t&&!n)return!0;var s=S({properties:t,layout:n});return s>=i&&s<=a},getExpressionWithMarkers:c,canExtract:function(e){var t=e.indexOf(s),n=e.indexOf(l);return t>-1&&n>-1&&t<n},getDimDefWithWrapper:p,getFieldWithWrapper:function(e){var t=e?e.replace(/]/g,"]]"):e;return"[".concat(t,"]")},generateTSDExpression:function(e,t,n){var r=t||e.outputExpression;if(e.base&&e.base.qDef&&(r=t!==e.base.qDef?t:e.base.qDef),"observed"!==e.decomposition){var i=n.qHyperCubeDef.qMeasures.find(function(t){return t.qDef.base&&t.qDef.base.qLibraryId&&e.base&&e.base.qLibraryId?t.qDef.base.qLibraryId===e.base.qLibraryId:null});i&&t!==i.qDef.qLabel&&(r=i.qLibraryId||i.qDef.base.qLibraryId?"[".concat(i.qDef.qLabel,"]"):i.qDef.base.qDef);var o=function(e){var t=a.OPTIONS.find(function(t){return t.value===e.decomposition});return t?a.EXPRESSIONS[t.value]:""}(e);r=r.startsWith("=")?r.substr(1):r,r="".concat(o,"(").concat(r,", ").concat(e.steps,")")}return r},getDecomposition:function(e){var t="observed";return Object.values(a.EXPRESSIONS).find(function(n){var r=e.qDef.base.qDef.toLowerCase()||e.qDef.qDef.toLowerCase();return a.EXPRESSIONS[n]&&r.includes(a.EXPRESSIONS[n].toLowerCase())&&(t=n),n}),t}};function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function k(e){return k="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},k(e)}var E=t().bind(null,!0),C={},N=Array.isArray;function T(e){return null!=e&&!Array.isArray(e)&&"object"===k(e)}function D(e){return void 0===e}function q(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function O(e,t){var n,r=t.substring(1).split("/").slice(0,-1);return r.forEach(function(t,i){if(i!==r.length){n=+t;var o=Number.isNaN(n)?{}:[];e[n||t]=D(e[n||t])?o:e[t],e=e[n||t]}}),e}function I(e,t){var n=!0;if(T(e)&&T(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach(function(r){I(e[r],t[r])||(n=!1)}),n);if(N(e)&&N(t)){if(e.length!==t.length)return!1;for(var r=0,i=e.length;r<i;r+=1)if(!I(e[r],t[r]))return!1;return!0}return e===t}C.generate=function(e,t,n){n=n||"";var r=[];return Object.keys(t).forEach(function(i){var o=function(e){return e?E({},{val:e}).val:e}(t[i]),a=e[i],s="".concat(n,"/").concat(i);I(o,a)||q(t,i)||(D(a)?r.push({op:"add",path:s,value:o}):T(o)&&T(a)?r=r.concat(C.generate(a,o,s)):N(o)&&N(a)?r=r.concat(function(e,t,n){var r=[],i=e.slice(),o=-1;function a(e,t,n){if(e[n]&&D(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(var r=0,i=e.length;r<i;r+=1)if(e[r]&&e[r].qInfo.qId===t)return r;return-1}if(I(t,i))return r;if(!D(t[0])&&D(t[0].qInfo))return r.push({op:"replace",path:n,value:t}),r;for(var s=i.length-1;s>=0;s-=1)-1===(o=a(t,i[s].qInfo&&i[s].qInfo.qId,s))?(r.push({op:"remove",path:"".concat(n,"/").concat(s)}),i.splice(s,1)):r=r.concat(C.generate(i[s],t[o],"".concat(n,"/").concat(s)));for(var l=0,c=t.length;l<c;l+=1)-1===(o=a(i,t[l].qInfo&&t[l].qInfo.qId))?(r.push({op:"add",path:"".concat(n,"/").concat(l),value:t[l]}),i.splice(l,0,t[l])):o!==l&&(r.push({op:"move",path:"".concat(n,"/").concat(l),from:"".concat(n,"/").concat(o)}),i.splice(l,0,i.splice(o,1)[0]));return r}(a,o,s)):r.push({op:"replace",path:"".concat(n,"/").concat(i),value:o}))}),Object.keys(e).forEach(function(i){D(t[i])&&!q(e,i)&&r.push({op:"remove",path:"".concat(n,"/").concat(i)})}),r},C.apply=function(e,t){t.forEach(function(t){var n,r,i=O(e,t.path),o=t.path.split("/").splice(-1)[0],a=o&&Number.isNaN(+o)?i[o]:i[+o]||i,s=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(i=null,a=e),"add"===t.op||"replace"===t.op)if(N(i))"-"===o&&(o=i.length),i.splice(+o,"add"===t.op?0:1,t.value);else if(N(a)&&N(t.value)){var l,c=t.value.slice();a.length=0,(l=a).push.apply(l,function(e){if(Array.isArray(e))return w(e)}(r=c)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||function(e,t){if(e){if("string"==typeof e)return w(e,t);var n=Object.prototype.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)?w(e,t):void 0}}(r)||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.")}())}else if(T(a)&&T(t.value))n=a,Object.keys(n).forEach(function(e){Object.getOwnPropertyDescriptor(n,e).configurable&&!q(n,e)&&delete n[e]}),E(a,t.value);else{if(!i)throw new Error("Patchee is not an object we can patch");i[o]=t.value}else if("move"===t.op){var u=O(e,t.from);N(i)?i.splice(+o,0,u.splice(+s,1)[0]):(i[o]=u[s],delete u[s])}else"remove"===t.op&&(N(i)?i.splice(+o,1):delete i[o])})},C.clone=function(e){return E({},e)},C.createPatch=function(e,t,n){var r={op:e.toLowerCase(),path:n};return"move"===r.op?r.from=t:void 0!==t&&(r.value=t),r},C.updateObject=function(e,t){Object.keys(e).length?C.apply(e,C.generate(e,t)):E(e,t)};const A=C,_=function(e,n,r){if(!e)return Promise.resolve();var i=A.generate(n,r);return t()(!0,n,r),i&&i.length?(i=i.map(function(e){return{qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}}),e.applyPatches(i,!0)):Promise.resolve()};var L="accumulation";function P(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===L)return n[r]}function R(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===L)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var F={type:"accumulation",disabled:!1,accumulationDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullAccumulation:!1,steps:6,outputExpression:""};const z={translationKey:"properties.modifier.accumulation",needDimension:M.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return M.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=M.getNumDimensions({properties:r,layout:i}));var c=o(r,"qHyperCubeDef.qDimensions",[]),u=M.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:s}),d=M.getNumStepComp(n,l),f=M.getAboveComp(n,l,u,d),h=M.getRangeComp("RangeSum",f);if(M.needDimension({modifier:n,properties:r,layout:i})){var p=M.getDimComp(c,1),m=M.getDimComp(c,0),g=M.getAggrComp(h,p,m);h=n.showExcludedValues?M.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:s,valueComp:g}):g}return h},extractInputExpression:M.extractInputExpression,initModifier:function(e){M.initModifier(e,F)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.accumulation.disclaimer",show:function(e,t){return!M.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(R(t,e),".accumulationDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.accumulation.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map(function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}})},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(R(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.accumulation.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat(R(t,e),".fullAccumulation")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat(R(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=P(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=P(t,e);return n&&!n.fullAccumulation}},showExcludedValues:{refFn:function(t){return"".concat(R(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return M.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(L))return!1;var o=P(t,e);return o&&!o.disabled}};return n}};var j="movingAverage";function $(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===j)return n[r]}function V(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===j)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var U={type:"movingAverage",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullRange:!1,steps:6,outputExpression:"",nullSuppression:!1};const H={translationKey:"properties.modifier.movingAverage",needDimension:M.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return M.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t,n=e.expression,r=e.modifier,i=e.properties,a=e.layout,s=e.numDimensions,l=e.dimensionAndFieldList;if(!r)return n;var c=s;void 0===c&&(c=M.getNumDimensions({properties:i,layout:a}));var u=o(i,"qHyperCubeDef.qDimensions",[]),d=r.showExcludedValues&&r.nullSuppression,f=M.getExpressionWithExcludedComp({expression:n,modifier:r,dimensions:u,dimensionAndFieldList:l,treatMissingAsNull:d}),h=M.getNumStepComp(r,c),p=M.getAboveComp(r,c,f,h);if(r.nullSuppression)t=M.getRangeComp("RangeAvg",p);else{var m=M.getRangeComp("RangeSum",p),g=function(e,t){var n=M.getRowNoComp(e,t);if(!M.isFullRange(e)){var r=e.steps,i="number"!=typeof r||Number.isNaN(r)?6:r;return"RangeMin(".concat(i,", ").concat(n,")")}return n}(r,c);t="".concat(m," / ").concat(g)}var y=t;if(M.needDimension({modifier:r,properties:i,layout:a})){var v=M.getDimComp(u,1),b=M.getDimComp(u,0),x=M.getAggrComp(y,v,b);y=r.showExcludedValues?M.getExcludedComp({modifier:r,dimensions:u,dimensionAndFieldList:l,funcComp:"Only",valueComp:x}):x}return y},extractInputExpression:M.extractInputExpression,initModifier:function(e){M.initModifier(e,U)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.movingAverage.disclaimer",show:function(e,t){return!M.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(V(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.movingAverage.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map(function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}})},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(V(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.movingAverage.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat(V(t,e),".fullRange")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat(V(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=$(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=$(t,e);return n&&!n.fullRange}},showExcludedValues:{refFn:function(t){return"".concat(V(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0},nullSuppression:{refFn:function(t){return"".concat(V(t,e),".nullSuppression")},type:"boolean",translation:t.showNull||"properties.dimensions.showNull",schemaIgnore:!0,defaultValue:!1,inverted:!0}},show:function(e,t){return M.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(j))return!1;var o=$(t,e);return o&&!o.disabled}};return n}};var B="timeSeriesDecomposition";function W(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===B)return n[r]}function Y(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===B)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var G={type:"timeSeriesDecomposition",disabled:!1,decomposition:"",steps:2,outputExpression:""};const K={translationKey:"properties.modifier.timeSeriesDecomposition",needDimension:M.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return M.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties;return n?M.generateTSDExpression(n,t,r):t},extractInputExpression:M.extractInputExpression,initModifier:function(e,t){M.initModifier(e,G),""===e.decomposition&&t&&(e.decomposition=M.getDecomposition(t))},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.timeSeriesDecomposition||"properties.modifier.timeSeriesDecomposition",show:function(e,t){return!M.isApplicable({properties:t.properties})}},settings:{type:"items",items:{decomposition:{refFn:function(t){return"".concat(Y(t,e),".decomposition")},type:"string",translation:t.modifierTrendDecompositionDecomposition||"properties.modifier.trendDecomposition.decomposition",component:"dropdown",schemaIgnore:!0,defaultValue:t.trendDecompositionParametersDecompositionObserved||"cao.trendDecomposition.parameters.decomposition.observed",options:a.OPTIONS},steps:{refFn:function(t){return"".concat(Y(t,e),".steps")},type:"integer",translation:t.modifierTimeSeriesDecompositionPeriods||"properties.modifier.timeSeriesDecomposition.periods",schemaIgnore:!0,defaultValue:2,change:function(t,n){var r=W(t,e);if(r){var i=r.steps;r.steps="number"!=typeof i||Number.isNaN(i)?2:Math.abs(i),n.properties.qHyperCubeDef.qMeasures=n.properties.qHyperCubeDef.qMeasures.map(function(e){return e.qDef.modifiers.map(function(e){return"timeSeriesDecomposition"===e.type?e.steps=i:e.steps=e.steps,e}),e})}},show:function(t){var n=W(t,e);return n&&!n.fullRange}}},show:function(e,t){return M.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(B))return!1;var o=W(t,e);return o&&!o.disabled}};return n}};var X="difference";function J(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===X)return n[r]}function Z(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===X)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var Q={type:"difference",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,outputExpression:""};const ee={translationKey:"properties.modifier.difference",needDimension:M.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return M.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:M.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=M.getNumDimensions({properties:r,layout:i}));var c=o(r,"qHyperCubeDef.qDimensions",[]),u=M.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:s}),d=M.getAboveComp(n,l,u),f="".concat(u," - ").concat(d);if(M.needDimension({modifier:n,properties:r,layout:i})){var h=M.getDimComp(c,1),p=M.getDimComp(c,0),m=M.getAggrComp(f,h,p);f=n.showExcludedValues?M.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:s,funcComp:"Only",valueComp:m}):m}return f},initModifier:function(e){Object.keys(Q).forEach(function(t){void 0===e[t]&&(e[t]=Q[t])})},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.difference.disclaimer",show:function(e,t){return!M.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(Z(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.difference.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map(function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}})},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(Z(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.difference.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},showExcludedValues:{refFn:function(t){return"".concat(Z(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return M.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(X))return!1;var o=J(t,e);return o&&!o.disabled}};return n}};var te="normalization";function ne(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===te)return n[r]}function re(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===te)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}function ie(e,t){for(var n=0;n<e.length;n++)if(e[n].value===t)return n;return-1}var oe={type:"normalization",disabled:!1,primaryDimension:0,outputExpression:"",dimensionalScope:2,selectionScope:2};function ae(e){return 2===e?"{1}":""}function se(e,t,n){return 1===e?"{$<".concat(M.getFieldWithWrapper(t),"={'").concat(n,"'}>}"):""}function le(e,t){return 0===e&&t>1||2===e?"Total":""}function ce(e,t,n){return 0===e&&t>1?"<".concat(M.getDimDefWithWrapper(n),">"):""}const ue={translationKey:"properties.modifier.normalization",needDimension:function(){return!0},isApplicable:function(e){var t=e.properties,n=e.layout;return M.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:M.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=M.getNumDimensions({properties:r,layout:i}));var c=o(r,"qHyperCubeDef.qDimensions",[]),u=M.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:s}),d=n.selectionScope,f=n.dimensionalScope;return function(e,t,n,r,i,o,a){var s=ae(t),l=se(t,n,r),c=""===s&&""===l?"":s||l,u=le(i,o),d=ce(i,o,a),f=function(e){for(var t=[],n=0;n<e;n++)t[n]=M.getDimDefWithWrapper(n);return t.join(", ")}(o);return"".concat(e,"/ Sum(").concat(c," ").concat(u).concat(d," Aggr(").concat(c," ").concat(e,", ").concat(f,"))")}(u,d,n.field,n.value,f,l,n.primaryDimension)},initModifier:function(e){Object.keys(oe).forEach(function(t){void 0===e[t]&&(e[t]=oe[t])})},updateModifier:function(e,t){1===(t.qDimensions?t.qDimensions.length:0)&&0===e.dimensionalScope&&(e.dimensionalScope=2)},enableTotalsFunction:function(){return!0},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.normalization.disclaimer",show:function(e,t){return!M.isApplicable({properties:t.properties})}},settings:{type:"items",items:{selectionScope:{refFn:function(t){return"".concat(re(t,e),".selectionScope")},type:"string",translation:t.modifierSelectionScope||"properties.modifier.selectionScope",title:{translation:t.modifierSelectionScopeTooltip||"properties.modifier.selectionScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:2,options:function(n){return function(e,t,n){var r=[{value:0,translation:t.selectionScopeCurrentSelection||"properties.modifier.selectionScope.currentSelection"},{value:1,translation:t.selectionScopeSpecificValue||"properties.modifier.selectionScope.selectAField"},{value:2,translation:t.selectionScopeTotal||"properties.modifier.selectionScope.total"}];return r=function(e,t){if(1===e){var n=ie(t,0);t.splice(n,1)}return t}(ne(e,n).dimensionalScope,r),r}(n,t,e)}},field:{refFn:function(t){return"".concat(re(t,e),".field")},type:"string",component:"expression-with-dropdown",translation:"Common.Field",defaultValue:"",dropdownOnly:!0,options:function(e,t,n){return n.app.getFieldList().then(function(e){return e.map(function(e){return{label:e.qName,value:e.qName}})})},show:function(t){return 1===ne(t,e).selectionScope}},value:{refFn:function(t){return"".concat(re(t,e),".value")},type:"string",ref:"value",component:"string",translation:"properties.value",expression:"optional",show:function(t){return 1===ne(t,e).selectionScope}},dimensionalScope:{refFn:function(t){return"".concat(re(t,e),".dimensionalScope")},type:"string",translation:t.modifierDimensionalScope||"properties.modifier.dimensionalScope",title:{translation:t.modifierDimensionalScopeTooltip||"properties.modifier.dimensionalScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:2,supportTooltip:!0,options:function(n,r){return function(e,t,n,r){var i=t.layout.qHyperCube.qDimensionInfo.length,o=[{value:0,translation:n.dimensionalScopeOneDimension||"properties.modifier.dimensionalScope.respectOneDimension",tooltipTranslation:n.dimensionalScopeOneDimensionTooltip||"properties.modifier.dimensionalScope.respectOneDimension.tooltip"},{value:1,translation:n.dimensionalScopeAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension"),tooltipTranslation:n.dimensionalScopeAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension",".tooltip")},{value:2,translation:n.dimensionalScopeDisregardAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension"),tooltipTranslation:n.dimensionalScopeDisregardAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension",".tooltip")}];return o=function(e,t){if(e<2){var n=ie(t,0);t.splice(n,1)}return t}(i,o),o=function(e,t){if(0===e){var n=ie(t,1);t.splice(n,1)}return t}(ne(e,r).selectionScope,o),o}(n,r,t,e)}},primaryDimension:{refFn:function(t){return"".concat(re(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.normalization.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map(function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}})},show:function(t,n){return 0===(ne(t,e).dimensionalScope||0)&&n.layout.qHyperCube.qDimensionInfo.length>1}}},show:function(e,t){return M.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(te))return!1;var o=ne(t,e);return o&&!o.disabled}};return n},getDisregardSelectionComp:ae,getFieldSelectionComp:se,getTotalComp:le,getSelectedDimComp:ce};var de="qDef.base",fe="qDef.qDef",he="qDef.base.qDef",pe="qLibraryId",me="qDef.base.qLibraryId";const ge={getExpression:function(e){var t=o(e,he);return void 0!==t?t:o(e,fe)},getExpressionRef:function(e){return void 0!==o(e,he)?he:fe},getLibraryIdRef:function(e){return o(e,me)?me:pe},getLibraryId:function(e){return o(e,me)||o(e,pe)},getLabelRef:function(e){return o(e,de)?"qDef.base.qLabel":"qDef.qLabel"},getLabelExpressionRef:function(e){return o(e,de)?"qDef.base.qLabelExpression":"qDef.qLabelExpression"}};var ye="qDef.qDef",ve="qDef.base.qDef",be="qLibraryId",xe="qDef.base.qLibraryId",Se="qDef.qLabel",Me="qDef.qLabelExpression",we="qDef.base.qLabel",ke="qDef.base.qLabelExpression",Ee="qDef.qAggrFunc",Ce="qDef.base.qAggrFunc",Ne={initBase:function(e,t){(t||Ne.isValid(e))&&(n(e,ve,o(e,ye)),n(e,xe,o(e,be)),n(e,we,o(e,Se)),n(e,ke,o(e,Me)))},restoreBase:function(e){Ne.isValid(e)&&(n(e,ye,o(e,ve)),n(e,be,o(e,xe)),n(e,Se,o(e,we)),n(e,Me,o(e,ke)),o(e,Ee)&&o(e,Ce)&&n(e,Ee,o(e,Ce)),delete e.qDef.base)},isValid:function(e){var t=o(e,ve),n=o(e,xe);return void 0!==t||void 0!==n}};const Te=Ne;function De(e){return De="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},De(e)}var qe={accumulation:z,movingAverage:H,difference:ee,normalization:ue,timeSeriesDecomposition:K};const Oe={modifiers:qe,apply:Ae,applyModifiers:_e,cleanUpMeasure:Le,destroy:function(e){e&&Ie[e.id]&&Ie[e.id].masterItemSubscriber&&(Ie[e.id].masterItemSubscriber&&Ie[e.id].masterItemSubscriber.unsubscribe(),delete Ie[e.id])},hasActiveModifiers:Pe,getActiveModifier:Re,initBase:Te.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some(function(e){return qe[e]})},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some(function(e){return qe[e]&&qe[e].isApplicable({properties:n,layout:r})})},measureBase:ge,limitedSorting:function(e){var t=e.measures,n=e.properties,r=e.layout,i=!1,o=!1;return t.forEach(function(e){var t=je(e);Ye({modifiers:t,properties:n,layout:r})&&(i=!0,o=o||Ze({modifiers:t,properties:n,layout:r}))}),i&&!o},ifEnableTotalsFunction:Fe};var Ie={};function Ae(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.model,r=e.properties,i=e.isSnapshot,a=void 0!==i&&i,s=e.masterItem,l=!1;Ie[n.id]=Ie[n.id]||{isFirstTime:!0};var c=Ie[n.id].isFirstTime;if(Ie[n.id].isFirstTime=!1,r&&"object"===De(r))return _e({model:n,properties:r});var u=n?n.layout:void 0,d=o(u,"qSelectionInfo.qInSelections");if(a||d)return Promise.resolve(l);var f=o(u,"qHyperCube.qMeasureInfo"),h=Ie[n.id].lastReloadTime;if(Ie[n.id].lastReloadTime=o(n,"app.layout.qLastReloadTime"),Pe({measures:f,layout:u})){var p=function(e){var t=e.measures,n=e.layout,r=e.lastReloadTime;return o(e.model,"app.layout.qLastReloadTime")!==r&&function(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some(function(e){return We({measure:e,properties:n,layout:r})})}({measures:t,layout:n})}({measures:f,layout:u,model:n,lastReloadTime:h});return p||function(e){var t=e.measures,n=e.layout,r=e.masterItem,i=e.isFirstTime;return!!Array.isArray(t)&&(i||r||t.some(function(e){return function(e){var t=e.measure,n=e.layout;return Ye({modifiers:je(t),layout:n})?!t.base:!!t.base}({measure:e,layout:n})}))}({measures:f,layout:u,masterItem:s,isFirstTime:c})?n.getEffectiveProperties().then(function(e){var r=t()(!0,{},e);Ve(r);var i=Qe(r);return Ge({model:n}).then(function(t){return Ke({libraryIds:i,model:n}).then(function(i){return p&&function(e){var t=e.properties;ze(t).forEach(function(e){return function(e){var t=e.measure;if(We({measure:t,properties:e.properties})){var n=0,r=t.qDef.modifiers;Array.isArray(r)&&r.forEach(function(e){if("object"===De(e)&&!e.disabled){if(n++,"object"!==De(qe[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(n>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");var r=qe[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==r&&He(t)&&M.simplifyExpression(t.qDef.base.qDef)!==M.simplifyExpression(r)&&(t.qDef.base.qDef=r)}})}}({measure:e,properties:t})})}({properties:r}),_e({model:n,oldProperties:e,properties:r,runUpdateIfChange:!0,masterItem:s,libraryItemsProps:i,dimensionAndFieldList:t})})})}):Promise.resolve(l)}return function(e){return!!Array.isArray(e)&&e.some(function(e){return"object"===De(e.base)})}(f)?n.getEffectiveProperties().then(function(e){return function(e){var n=e.model,r=e.properties,i=Qe(r);return et({model:n,libraryIds:i}).then(function(){var e=t()(!0,{},r);return ze(r).forEach(function(e){return Le(e)}),Je({oldProperties:e,newProperties:r,model:n})})}({model:n,properties:e})}):Promise.resolve(l)}function _e(e){var n=e.model,r=e.oldProperties,i=e.properties,a=e.measures,s=e.runUpdateIfChange,l=void 0!==s&&s,c=e.masterItem,u=e.libraryItemsProps,d=e.dimensionAndFieldList;void 0===r&&(r=l?t()(!0,{},i):i),Ve(i);var f=Qe(i);return et({model:n,libraryIds:f,masterItem:c}).then(function(){return function(e){var n=e.measures,r=e.properties,i=e.model,a=e.libraryItemsProps,s=e.dimensionAndFieldList;if(n||(n=ze(r)),!n.length)return Promise.resolve();if(!Pe({measures:n,properties:r}))return n.forEach(function(e){return Le(e)}),Promise.resolve();var l=a?void 0:Qe(r);return Ge({model:i,dimensionAndFieldList:s}).then(function(e){return Ke({libraryIds:l,model:i,libraryItemsProps:a}).then(function(i){n.forEach(function(n){Ye({modifiers:n.qDef.modifiers,properties:r})?(function(e){var n=e.measure,r=e.properties,i=e.libraryItemsProps,a=e.dimensionAndFieldList,s=0;Te.isValid(n)||Te.initBase(n,!0);var l=n.qDef,c=l.modifiers,u=l.base;Array.isArray(c)&&c.forEach(function(e){if("object"===De(e)&&!e.disabled){if(s++,"object"!==De(qe[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(s>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");qe[e.type].initModifier(e,n);var l=n.qLibraryId||u&&u.qLibraryId;l?function(e){var n=e.measure,r=e.modifier,i=e.properties,o=e.dimensionAndFieldList,a=e.libraryItemsProps[e.libraryId],s=a.qMeasure.qDef,l=""===s?s:qe[r.type].generateExpression({expression:s,modifier:r,properties:i,dimensionAndFieldList:o});r.outputExpression=l,n.qDef.qDef=r.outputExpression,(n.qDef.qLabel||a.qMeasure.qLabel)&&(n.qDef.qLabel=a.qMeasure.qLabel),(n.qDef.qLabelExpression||a.qMeasure.qLabelExpression)&&(n.qDef.qLabelExpression=a.qMeasure.qLabelExpression),n.qDef.quarantine&&n.qDef.quarantine.qNumFormat&&a.qMeasure.qNumFormat&&(n.qDef.qNumFormat=a.qMeasure.qNumFormat,n.qDef.isCustomFormatted=a.qMeasure.isCustomFormatted),delete n.qLibraryId,n.qDef.coloring=a.qMeasure.coloring,r.base=t()(!0,{},n.qDef.base)}({measure:n,modifier:e,libraryId:l,properties:r,libraryItemsProps:i,dimensionAndFieldList:a}):function(e){var n=e.measure,r=e.modifier,i=e.properties,o=e.dimensionAndFieldList;"function"==typeof qe[r.type].updateModifier&&qe[r.type].updateModifier(r,i.qHyperCubeDef);var a=ge.getExpression(n),s=""===a?a:qe[r.type].generateExpression({expression:a,modifier:r,properties:i,dimensionAndFieldList:o});r.outputExpression=s,n.qDef.qDef=r.outputExpression,n.qDef.base.qLabelExpression?n.qDef.qLabelExpression=n.qDef.base.qLabelExpression:n.qDef.qLabel=n.qDef.base.qLabel||a,r.base=t()(!0,{},n.qDef.base)}({measure:n,modifier:e,properties:r,dimensionAndFieldList:a}),function(e){var t=o(e,"qDef.qAggrFunc");"Expr"!==t||Fe(e)?"None"!==t?delete e.qDef.base.qAggrFunc:"None"===t&&Fe(e)&&"Expr"===e.qDef.base.qAggrFunc&&(e.qDef.qAggrFunc="Expr",delete e.qDef.base.qAggrFunc):(e.qDef.qAggrFunc="None",e.qDef.base.qAggrFunc="Expr")}(n)}})}({measure:n,properties:r,libraryItemsProps:i,dimensionAndFieldList:e}),Ue(n)):Le(n)})})})}({measures:a,properties:i,model:n,libraryItemsProps:u,dimensionAndFieldList:d}).then(function(){return l?Je({oldProperties:r,newProperties:i,model:n}):Promise.resolve(!1)})})}function Le(e){!function(e){var t=je(e);return Array.isArray(t)&&t.some(function(e){return"object"===De(e)&&!e.disabled&&!qe[e.type]})}(e)?Te.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,Ue(e)}function Pe(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some(function(e){return Ye({modifiers:je(e),properties:n,layout:r})})}function Re(e){var t=je(e);if(Array.isArray(t))for(var n=0;n<t.length;n++){var r=t[n];if(qe[r.type]&&!r.disabled)return r}}function Fe(e){var t=Re(e);return!t||qe[t.type].enableTotalsFunction(e)}function ze(e){return o(e,"qHyperCubeDef.qMeasures",[]).concat(o(e,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",[]))}function je(e){return e.modifiers||e.qDef&&e.qDef.modifiers}function $e(e){return o(e,"outputExpression.qValueExpression.qExpr")||o(e,"outputExpression")}function Ve(e){ze(e).forEach(function(e){return function(e){var n=Re(e);n&&(void 0!==n.outputExpression&&$e(n)!==e.qDef.qDef?delete e.qDef.base:!Te.isValid(e)&&n.base&&(e.qDef.base=t()(!0,{},n.base)))}(e)})}function Ue(e){var t=je(e);Array.isArray(t)&&t.forEach(function(t){"object"===De(t)&&(t.disabled||!qe[t.type]&&$e(t)!==e.qDef.qDef)&&(t.disabled=!0,delete t.base)})}function He(e){return e.base||e.qDef&&e.qDef.base}function Be(e){var t=He(e);return e.qLibraryId||t&&t.qLibraryId}function We(e){var t=e.measure,n=e.properties,r=e.layout;return!Be(t)&&Ye({modifiers:je(t),properties:n,layout:r})}function Ye(e){var t=e.modifiers,n=e.properties,r=e.layout,i={};return Array.isArray(t)&&t.some(function(e){return!("object"!==De(e)||e.disabled||!qe[e.type])&&(void 0===i[e.type]&&(i[e.type]=qe[e.type].isApplicable({properties:n,layout:r})),i[e.type])})}function Ge(e){var t=e.model,n=e.dimensionAndFieldList;if(n)return Promise.resolve(n);var r=[],i={},o=t.app.getDimensionList().then(function(e){i.dimensionList=e});r.push(o);var a=t.app.getFieldList().then(function(e){i.fieldList=e});return r.push(a),Promise.all(r).then(function(){return i})}function Ke(e){var t=e.libraryIds,n=e.model,r=e.libraryItemsProps;if(r)return Promise.resolve(r);var i=t.measureLibraryIds,o=t.dimensionLibraryIds,a={},s=[];return i.forEach(function(e){var t=n.app.getMeasure(e).then(function(t){return t.getProperties().then(function(t){a[e]=t})});s.push(t)}),o.forEach(function(e){var t=n.app.getDimension(e).then(function(t){return t.getProperties().then(function(t){a[e]=t})});s.push(t)}),Promise.all(s).then(function(){return a})}function Xe(e,t){if(""!==t||-1===["qFmt","qDec","qThou"].indexOf(e))return t}function Je(e){var t=e.oldProperties,n=e.newProperties,r=e.model,i=JSON.stringify(o(t,"qHyperCubeDef.qMeasures"),Xe)!==JSON.stringify(o(n,"qHyperCubeDef.qMeasures"),Xe)||JSON.stringify(o(t,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Xe)!==JSON.stringify(o(n,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Xe);return i?function(e){var t=e.model,n=e.oldProperties,r=e.newProperties,i=t.layout;return i&&!i.qHasSoftPatches&&!i.qExtendsId&&o(i,"qMeta.privileges",[]).indexOf("update")>-1?t.setProperties(r):_(t,n,r)}({model:r,oldProperties:t,newProperties:n}).then(function(){return i}):Promise.resolve(i)}function Ze(e){var t=e.modifiers,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some(function(e){return"object"===De(e)&&!e.disabled&&qe[e.type]&&qe[e.type].needDimension({modifier:e,properties:n,layout:r})})}function Qe(e){var t=ze(e),n=[],r=[],i=!1;return t.forEach(function(t){var r=je(t);if(Ye({modifiers:r,properties:e})){var o=Be(t);o&&n.push(o),i=i||Ze({modifiers:r,properties:e})}}),o(e,"qHyperCubeDef.qDimensions",[]).forEach(function(e){var t=e.qLibraryId;t&&r.push(t)}),{measureLibraryIds:n,dimensionLibraryIds:r}}function et(e){var t=e.model,n=e.libraryIds;return!e.masterItem&&n&&(n.measureLibraryIds.length||n.dimensionLibraryIds.length)?(Ie[t.id].masterItemSubscriber=Ie[t.id].masterItemSubscriber||function(e){var t=e.model,n=e.callback,r={},i={},a={},s={dimension:["qDim.qFieldDefs"],measure:["qMeasure.qDef","qMeasure.qLabel","qMeasure.qLabelExpression","qMeasure.coloring","qMeasure.qNumFormat","qMeasure.isCustomFormatted"]};function l(e){var t={},n=o(e,"qInfo.qType");return n&&s[n]&&s[n].forEach(function(n){t[n]=o(e,n)}),JSON.stringify(t)}function c(e){var t=e.qInfo.qId;if(r[t]){var i=l(e);r[t].properties!==i&&(r[t].properties=i,"function"==typeof n&&r[t].enabled&&n(e)),r[t].enabled=!0}}function u(e,n){return t.app[n](e).then(function(t){r[e]={listener:t.layoutSubscribe(c),enabled:!1,properties:l(t.layout)}})}return{subscribe:function(e){var n=e.measureLibraryIds,o=e.dimensionLibraryIds,s=[];return function(e){var t=e.dimensionLibraryIds;i={},e.measureLibraryIds.forEach(function(e){i[e]=!0}),a={},t.forEach(function(e){a[e]=!0})}({measureLibraryIds:n,dimensionLibraryIds:o}),Object.keys(r).forEach(function(e){i[e]||a[e]||(r[e].listener.dispose(),delete r[e])}),t.app&&(Object.keys(i).forEach(function(e){i[e]&&!r[e]&&s.push(u(e,"getMeasure"))}),Object.keys(a).forEach(function(e){a[e]&&!r[e]&&s.push(u(e,"getDimension"))})),Promise.all(s)},unsubscribe:function(){Object.keys(r).forEach(function(e){r[e].listener.dispose()}),r={}}}}({model:t,callback:function(e){return Ae({model:t,masterItem:e}).then(function(){return t.app.clearUndoBuffer()})}}),Ie[t.id].masterItemSubscriber.subscribe(n)):Promise.resolve()}})(),t.default=i.default,Object.defineProperty(t,"__esModule",{value:!0})})()}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var r={};return(()=>{function e(t){var n,r=t;return r>9?(n=65+r-10)>90&&(n+=6):r="".concat(r).charCodeAt(0),[48,111,79,105,73,108].indexOf(n)>-1?e(r+1):String.fromCharCode(n)}function t(n){var r=e(n%62),i=Math.floor(n/62);return i>0?t(i)+r:r}function i(e){return i="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},i(e)}n.d(r,{default:()=>Ve});const o={getValue:function(e,t,n){if(null==e||null==t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var a=r[o];if(""!==a){if(void 0===i[a]||null===i[a])return n;i=i[a]}}return i},setValue:function(e,t,n){if(null!=e&&null!=t){for(var r=t.split("."),i=r[r.length-1],o=e,a=0;a<r.length-1;++a){var s=r[a];void 0!==o[s]&&null!==o[s]||(o[s]=Number.isNaN(+r[a+1])?{}:[]),o=o[s]}void 0!==n?o[i]=n:delete o[i]}},isEmpty:function(e){return 0===Object.keys(e).length&&e.constructor===Object},isAtomicValue:function(e){return/boolean|number|string/.test(i(e))},generateId:function(){return t(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}};function a(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.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)?s(e,t):void 0}}(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 s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function l(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return c(e,t);var n=Object.prototype.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)?c(e,t):void 0}}(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 c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function u(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return r;return-1}return-1}const d={isOrderedSubset:function(e,t){if(!(e&&t&&e.length&&t.length))return!1;var n=e.indexOf(t[0]);if(-1!==n){for(var r=0;r<t.length;r++){var i=e.indexOf(t[r]);if(n>i)return!1;n=i}return!0}return!1},indexAdded:function(e,t){var n;for(n=0;n<e.length;++n)e[n]>=0&&e[n]>=t&&++e[n];e.push(t)},indexRemoved:function(e,t){var n,r=0;for(n=0;n<e.length;++n)e[n]>t?--e[n]:e[n]===t&&(r=n);return e.splice(r,1),r},findItemByPropertyValue:function(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return e[r];return null}return null},findIndexByPropertyValue:u};var f=n(8),h=n.n(f);const p=function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.dimensions).push.apply(t,a(r.qDimensions));var s,l=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qDimensions");l&&(s=i.excludedDimensions).push.apply(s,a(l))},m=function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.measures).push.apply(t,l(r.qMeasures));var a,s=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qMeasures");s&&(a=i.excludedMeasures).push.apply(a,l(s))},g=function(e){var t=e.exportFormat,n=e.qHyperCubeDef,r=t.data[0];n.qInterColumnSortOrder||(n.qInterColumnSortOrder=[]),r.interColumnSortOrder=n.qInterColumnSortOrder.concat();var i=o.getValue(n,"qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder");i&&d.isOrderedSubset(i,r.interColumnSortOrder)&&(r.interColumnSortOrder=i.concat())},y=function(e){var t=e.exportFormat,n=e.properties;Object.keys(n).forEach(function(e){t.properties[e]=n[e]})},v=function(e){var t=e.exportFormat,n=e.properties;n.qLayoutExclude||(n.qLayoutExclude={}),n.qLayoutExclude.disabled&&(Object.keys(n.qLayoutExclude.disabled).forEach(function(e){t.properties.hasOwnProperty(e)||(t.properties[e]=n.qLayoutExclude.disabled[e])}),delete n.qLayoutExclude.disabled),n.qLayoutExclude.changed&&(function(e){Object.keys(e.qLayoutExclude.changed).forEach(function(t){e.qLayoutExclude.changed[t].to===o.getValue(e,t)&&o.setValue(e,t,e.qLayoutExclude.changed[t].from)})}(n),delete n.qLayoutExclude.changed),n.qLayoutExclude.quarantine&&!o.isEmpty(n.qLayoutExclude.quarantine)||delete n.qLayoutExclude},b=function(e){e.forEach(function(e){h().cleanUpMeasure(e),e.qDef.modifiers&&(e.store={modifiers:e.qDef.modifiers},delete e.qDef.modifiers)})};function x(e,t,n){var r,i,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=o.getValue(e,t);if(!o.isAtomicValue(s))try{if((i=(i=(r=JSON.stringify(s)).match(/:\{/g))?i.length:0)>2&&!a)return;s=JSON.parse(r)}catch(e){return}o.getValue(e,"qLayoutExclude.quarantine")||o.setValue(e,"qLayoutExclude.quarantine",{});var l=o.getValue(e,"qLayoutExclude.quarantine");l[n]||(l[n]={}),l[n][t]=s}var S=n(909),M=n.n(S);function w(e,t){var n=M()(!0,{},t,e);return o.getValue(n,"qOtherTotalSpec.qOtherCounted")||o.setValue(n,"qOtherTotalSpec.qOtherCounted",{qv:"10"}),o.getValue(n,"qOtherTotalSpec.qOtherLimit")||o.setValue(n,"qOtherTotalSpec.qOtherLimit",{qv:"0"}),n.hasOwnProperty("othersLabel")||(n.othersLabel="Others"),n}function k(e,t){return M()(!0,{},t,e)}function E(e,t,n){return"function"==typeof e?e(t):Number.isNaN(+e)?n:e}var C=Math.pow(2,53)-1;function N(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function T(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const D=function(e,t,n){var r="masterobject"===o.getValue(t,"properties.qInfo.qType")?"masterobject":o.getValue(n,"qInfo.qType");o.setValue(e,"qInfo.qType",r),e.visualization=n.visualization},q=function(e,t,n){t.hasOwnProperty(e)&&(n[e]=t[e])},O=function(e,t,n,r){t.hasOwnProperty(e)?n[e]=t[e]:n[e]=r},I=function(){return{qDef:{autoSort:!0,cId:"",othersLabel:"Others"},qLibraryId:"",qNullSuppression:!1,qOtherLabel:"Others",qOtherTotalSpec:{qOtherLimitMode:"OTHER_GE_LIMIT",qOtherMode:"OTHER_OFF",qOtherSortMode:"OTHER_SORT_DESCENDING",qSuppressOther:!1}}},A=function(){return{qDef:{autoSort:!0,cId:"",numFormatFromTemplate:!0},qLibraryId:"",qTrendLines:[]}},_=function(e){var t,n=e.exportFormat,r=e.maxDimensions,i=e.minDimensions,o=e.newHyperCubeDef,a=e.defaultDimension,s=n.data[0];for(t=0;t<s.dimensions.length;++t){var l=w(s.dimensions[t],a);o.qDimensions.length<r?o.qDimensions.push(l):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(l)}for(t=0;t<s.excludedDimensions.length;++t){var c=w(s.excludedDimensions[t],a);o.qDimensions.length<i?o.qDimensions.push(c):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(c)}},L=function(e){var t,n=e.exportFormat,r=e.maxMeasures,i=e.minMeasures,o=e.newHyperCubeDef,a=e.defaultMeasure,s=n.data[0];for(t=0;t<s.measures.length;++t){var l=k(s.measures[t],a);o.qMeasures.length<r?o.qMeasures.push(l):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(l)}for(t=0;t<s.excludedMeasures.length;++t){var c=k(s.excludedMeasures[t],a);o.qMeasures.length<i?o.qMeasures.push(c):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(c)}},P=function(e){var t=e.exportFormat,n=e.dataDefinition,r=void 0===n?{}:n,i=t.data[0],o=r.dimensions||{max:0},a=r.measures||{max:0},s=E(a.max,i.dimensions.length,C),l=E(a.min,i.dimensions.length,0);return{maxDimensions:E(o.max,s,C),minDimensions:E(o.min,l,0),maxMeasures:s,minMeasures:l}},R=function(e){var t=e.exportFormat,n=e.newHyperCubeDef,r=t.data[0],i=n.qDimensions.length+n.qMeasures.length;n.qInterColumnSortOrder=r.interColumnSortOrder.concat();var o=n.qInterColumnSortOrder.length;if(o!==i)for(n.qLayoutExclude&&(n.qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder=r.interColumnSortOrder.concat());o!==i;)o<i?(d.indexAdded(n.qInterColumnSortOrder,o),++o):(--o,d.indexRemoved(n.qInterColumnSortOrder,o))},F=function(e){var t=e.exportFormat,n=e.initialProperties,r=e.hypercubePath,i={qLayoutExclude:{disabled:{},quarantine:{}}};return Object.keys(t.properties).forEach(function(e){"qLayoutExclude"===e?t.properties[e].quarantine&&(i.qLayoutExclude.quarantine=M()(!0,{},t.properties[e].quarantine)):"qHyperCubeDef"===e&&r?o.setValue(i,"".concat(r,".qHyperCubeDef"),t.properties.qHyperCubeDef):n.hasOwnProperty(e)||-1!==["qMetaDef","descriptionExpression","labelExpression"].indexOf(e)||function(e,t){return"components"===t&&Array.isArray(e[t])&&e[t].some(function(e){return"general"===e.key})}(t.properties,e)?i[e]=t.properties[e]:i.qLayoutExclude.disabled[e]=t.properties[e]}),null===(i=M()(!0,{},n,i)).components&&(i.components=[]),i},z=function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,a=t.data[0];return a.dimensions.length>n&&n>0||a.measures.length>i&&i>0||a.excludedDimensions.length>0&&a.dimensions.length+a.excludedDimensions.length>r||a.excludedMeasures.length>0&&a.measures.length+a.excludedMeasures.length>o||!i&&a.measures.length>0||!n&&a.dimensions.length>0},j=function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,a=e.newHyperCubeDef,s=t.data[0];a.qLayoutExclude||(a.qLayoutExclude={}),a.qLayoutExclude.qHyperCubeDef||(a.qLayoutExclude.qHyperCubeDef={}),(s.dimensions.length>n&&n>0||s.excludedDimensions&&s.excludedDimensions.length&&s.dimensions.length+s.excludedDimensions.length>r)&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[])),(s.measures.length>i&&i>0||s.excludedMeasures&&s.excludedMeasures.length&&s.measures.length+s.excludedMeasures.length>o)&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!i&&s.measures.length&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!n&&s.dimensions.length&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[]))},$=function(e){var t,n=e.newProperties,r=e.dataDefinition,i=e.hypercubePath;if(r.dimensions&&"function"==typeof r.dimensions.added){var a=o.getValue(n,i||"").qHyperCubeDef,s=function(e){if(Array.isArray(e))return N(e)}(t=a.qDimensions)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return N(e,t);var n=Object.prototype.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)?N(e,t):void 0}}(t)||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.")}();a.qDimensions=[],s.forEach(function(e){a.qDimensions.push(e),r.dimensions.added(e,n)})}},V=function(e){var t,n=e.newProperties,r=e.dataDefinition,i=e.hypercubePath;if(r.measures&&"function"==typeof r.measures.added){var a=o.getValue(n,i||"").qHyperCubeDef,s=function(e){if(Array.isArray(e))return T(e)}(t=a.qMeasures)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return T(e,t);var n=Object.prototype.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)?T(e,t):void 0}}(t)||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.")}();a.qMeasures=[],s.forEach(function(e){a.qMeasures.push(e),r.measures.added(e,n)})}},U=function(e){var t=e.measures,n=e.modifierTypes;t&&n&&h().isSupportedModifiers(n)&&t.forEach(function(e){e.store&&e.store.modifiers&&(e.qDef.modifiers=e.store.modifiers),delete e.store})};function H(e,t){var n=o.getValue(e,"qLayoutExclude.quarantine",{})[t];return!!n&&(Object.keys(n).forEach(function(t){o.setValue(e,t,n[t])}),delete e.qLayoutExclude.quarantine[t],!0)}const B={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t={data:[],properties:{}},n=0;n<e;++n)t.data.push({dimensions:[],measures:[],excludedDimensions:[],excludedMeasures:[],interColumnSortOrder:[]});return t}(),a=t.qProperty,s=o.getValue(a,n||""),l=s.qHyperCubeDef;return l.qInterColumnSortOrder||(l.qInterColumnSortOrder=[]),p({exportFormat:i,qHyperCubeDef:l}),m({exportFormat:i,qHyperCubeDef:l}),g({exportFormat:i,qHyperCubeDef:l}),delete l.qLayoutExclude,y({exportFormat:i,properties:a}),n&&(i.properties.qHyperCubeDef=l,delete s.qHyperCubeDef),v({exportFormat:i,properties:a}),r||b(i.properties.qHyperCubeDef.qMeasures),Array.isArray(i.properties.filters)&&(x(i.properties,"filters","storedFilters",!0),delete i.properties.filters),i.properties.qHyperCubeDef.qContextSetExpression&&(x(i.properties,"qHyperCubeDef.qContextSetExpression","storedFilters"),i.properties.qHyperCubeDef.qContextSetExpression=""),i.properties.qHyperCubeDef.qDynamicScript&&i.properties.qHyperCubeDef.qDynamicScript.length&&(x(i.properties,"qHyperCubeDef.qDynamicScript","dynamicScript"),i.properties.qHyperCubeDef.qDynamicScript=[]),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=void 0===n?{}:n,i=e.dataDefinition,a=void 0===i?{}:i,s=e.defaultPropertyValues,l=void 0===s?{}:s,c=e.hypercubePath,u=e.extension,d=e.supportedFilters,f=void 0===d||d,h=e.isHCModifierSupported,p=void 0===h||h,m={qChildren:[]},g=F({exportFormat:t,initialProperties:r,hypercubePath:c}),y=o.getValue(r,c||"").qHyperCubeDef,v=o.getValue(g,c||"").qHyperCubeDef,b=P({exportFormat:t,dataDefinition:a}),x=b.maxDimensions,S=b.minDimensions,M=b.maxMeasures,w=b.minMeasures,k=l.defaultDimension,E=void 0===k?I():k,C=l.defaultMeasure,N=void 0===C?A():C;v.qDimensions.length=0,v.qMeasures.length=0,z({exportFormat:t,maxDimensions:x,minDimensions:S,maxMeasures:M,minMeasures:w})&&j({exportFormat:t,maxDimensions:x,minDimensions:S,maxMeasures:M,minMeasures:w,newHyperCubeDef:v}),_({exportFormat:t,maxDimensions:x,minDimensions:S,newHyperCubeDef:v,defaultDimension:E}),L({exportFormat:t,maxMeasures:M,minMeasures:w,newHyperCubeDef:v,defaultMeasure:N}),$({newProperties:g,dataDefinition:a,hypercubePath:c}),V({newProperties:g,dataDefinition:a,hypercubePath:c}),R({exportFormat:t,newHyperCubeDef:v}),q("qMaxStackedCells",y,v),q("qNoOfLeftDims",y,v),O("qInitialDataFetch",y,v,[{qTop:0,qLeft:0,qWidth:0,qHeight:0}]),O("qMode",y,v,"S"),O("qReductionMode",y,v,"N"),O("qSortbyYValue",y,v),O("qIndentMode",y,v),O("qShowTotalsAbove",y,v),D(g,t,r),m.qProperty=g;var T=o.getValue(u||{},"support.modifiers");return U({measures:v.qMeasures,modifierTypes:T}),f&&H(m.qProperty,"storedFilters"),"S"===v.qMode&&p&&H(m.qProperty,"dynamicScript"),m}};var W={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};function Y(e,t,n,r){t=t||[];var i=u(e,r,n),o=u(t,r,n);if(-1!==i&&-1===o){var a=e.splice(i,1);t.push(a[0])}return t}function G(e,t){return e.length!==t}const K={create:function(e,t){if(!e||!W[e])throw new Error("Attribute Expressions Util: ID required");var n={};return t&&Object.keys(t).forEach(function(e){n[e]=t[e]}),n.id=e,n.qAttribute=!0,n},moveByIdFromGroup:function(e,t,n,r,i){n=n||"qAttributeExpressions",i=i||"id";for(var o=0;o<e.length;o++){var a=e[o][n],s=t.length;if(Y(a,t,r,i),G(t,s))return t}return t},IDMAP:{CELL_BACKGROUND_COLOR:"cellBackgroundColor",CELL_FOREGROUND_COLOR:"cellForegroundColor",COLOR_BY_ALTERNATIVE:"colorByAlternative",COLOR_BY_EXPRESSION:"colorByExpression",TOOLTIP:"tooltip",CELL_LINK_LABEL:"urlLabel",CELL_LINK_URL:"url"}},X={getNumDimensions:function(e){return o.getValue(e,"qHyperCubeDef.qDimensions.length",0)},getNumMeasures:function(e){return o.getValue(e,"qHyperCubeDef.qMeasures.length",0)},wrapFieldName:function(e){return e.split(" ").length>1&&"="!==e[0]&&"["!==e[0]?"[".concat(e,"]"):e},getItemLabel:function(e){return e.label||e.name}},J={colorModeOptions:{primary:function(){return!0},dimension:function(e){return X.getNumDimensions(e)>0&&X.getNumMeasures(e)<=1},multiColor:function(e){return X.getNumMeasures(e)>1},measure:function(e){return X.getNumDimensions(e)>0},expression:function(e){return X.getNumMeasures(e)>=1}}},Z={colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return X.getNumMeasures(e)>=1}}};var Q={scatterplot:Z,"sn-scatter-plot":Z,piechart:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return X.getNumMeasures(e)>=1}}},linechart:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return X.getNumDimensions(e)>1},multiColor:function(e){return X.getNumMeasures(e)>1},measure:function(e){return X.getNumDimensions(e)<=1},expression:function(e){return X.getNumMeasures(e)>=1}}},map:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return X.getNumDimensions(e)>=1},multiColor:function(e){return X.getNumMeasures(e)>1},measure:function(e){return X.getNumDimensions(e)>=1},expression:function(e){return X.getNumDimensions(e)>=1}}},distributionplot:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return X.getNumDimensions(e)>=1}}}};function ee(e,t,n){if(Array.isArray(e[t])){var r=d.findIndexByPropertyValue(e[t],"id",n);r>=0&&e[t].splice(r,1)}else e[t]=[]}function te(e,t){var n=K.IDMAP.COLOR_BY_ALTERNATIVE;e.forEach(function(e){ee(e,"qAttributeDimensions",n),ee(e,"qAttributeExpressions",n)}),t.forEach(function(e){ee(e,"qAttributeDimensions",n),ee(e,"qAttributeExpressions",n)})}function ne(e,t){if(t){var n="="===t.charAt(0);e.color.altLabel=n?{qStringExpression:{qExpr:t.substr(1)}}:t}}function re(e){var t=e.properties,n=e.isDimension,r=e.dimensions,i=e.excludedDimensions,a=e.measures,s=e.label;te(r,i);var l=r[r.length-1];if(l){var c=n?o.getValue(t,"color.byDimDef"):o.getValue(t,"color.byMeasureDef"),u=o.getValue(t,"color.formatting.qNumFormat"),f=o.getValue(t,"color.formatting.isCustomFormatted");if(c){var h=K.create(K.IDMAP.COLOR_BY_ALTERNATIVE);switch(c.type){case"expression":!function(e){var t=e.attributeExpression,n=e.label,r=e.item,i=e.isDimension,o=e.qNumFormat,a=e.isCustomFormatted;t.label=n||r.label,i?t.qDef=r.key:(t.qExpression=r.key,o&&(t.qNumFormat=o,t.isCustomFormatted=a)),t.matchMeasure=r.activeMeasureIndex,t.label&&"="===t.label.charAt(0)&&(t.labelExpRef="color.altLabel")}({attributeExpression:h,label:s,item:c,isDimension:n,qNumFormat:u,isCustomFormatted:f});break;case"libraryItem":!function(e){var t=e.attributeExpression,n=e.measures,r=e.item,i=e.qNumFormat,o=e.isCustomFormatted;e.isDimension||(t.matchMeasure=d.findIndexByPropertyValue(n,"qLibraryId",r.key),i&&(t.qNumFormat=i,t.isCustomFormatted=o)),void 0!==r.expression?t.qExpression=r.expression:t.qLibraryId=r.key,t.colorMapRef=r.key}({attributeExpression:h,measures:a,item:c,isDimension:n,qNumFormat:u,isCustomFormatted:f})}n?(h.qSortBy={qSortByAscii:1},l.qAttributeDimensions.push(h)):l.qAttributeExpressions.push(h)}}}function ie(e,t,n,r){var i,o,a,s={};switch(e){case"dimension":n.qLibraryId?(s.type="dimension",s.name=n.qLibraryId,s.id=n.qLibraryId):(s.type="field",t?(s.name=n.label||n.qDef,s.id=n.qDef):(s.name=n.qDef.qFieldDefs[0],s.label=(a=n.qDef).qLabelExpression?a.qLabelExpression:a.qFieldLabels&&a.qFieldLabels[0]?a.qFieldLabels[0]:a.qFieldDefs[0]));break;case"measure":i=function(e,t){return t?e.qLibraryId:h().measureBase.getLibraryId(e)}(n,t),i?(s.type="measure",s.name=i,s.id=i,o=function(e,t){return h().hasActiveModifiers({measures:[e]})&&t?e.qDef.qDef:void 0}(n,r),o&&(s.expression=o)):(s.type="expression",t?(s.name=n.label||n.qExpression,s.id=n.qExpression):(s.name=n.qDef.qDef,s.label=function(e){var t=e.qDef;return t.qLabelExpression?t.qLabelExpression:t.qLabel?t.qLabel:t.qDef}(n)));break;default:throw new Error('columnType should be "dimension" or "measure"')}return s}const oe={useMasterNumberFormat:function(e){e.quarantine={qNumFormat:e.qNumFormat||{},isCustomFormatted:e.isCustomFormatted||!1},e.qNumFormat=null,e.isCustomFormatted=void 0}};function ae(e,t,n,r){var i=t.type,o=e.color,a=o.mode,s=X.getItemLabel(t);switch(ne(e,s||""),i){case"field":a="byDimension",o.byDimDef={label:t.label||X.wrapFieldName(t.name),key:X.wrapFieldName(t.name),type:"expression",activeDimensionIndex:t.activeDimensionIndex};break;case"expression":a="byMeasure",o.byMeasureDef={label:s,key:t.name,type:"expression",activeMeasureIndex:t.activeMeasureIndex};break;case"dimension":a="byDimension",o.byDimDef={label:t.name,key:t.id,type:"libraryItem",activeDimensionIndex:t.activeDimensionIndex};break;case"measure":a="byMeasure",o.byMeasureDef={label:t.name,key:t.id,expression:t.expression,type:"libraryItem",activeMeasureIndex:t.activeMeasureIndex},o.formatting&&oe.useMasterNumberFormat(o.formatting)}o.auto=!1,o.mode=a}function se(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),a=o.getValue(e,"color.byDimDef");if(a&&ne(e,a.label),function(e){return!!(e&&e.activeDimensionIndex>-1)}(a))!function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"color.byDimDef");r.activeDimensionIndex=Math.min(r.activeDimensionIndex,n.length-1);var i=ie("dimension",!1,n[r.activeDimensionIndex]);i.activeDimensionIndex=r.activeDimensionIndex,ae(e,i)}(e,t);else if(function(e){return!e||!e.key}(a)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=n[function(e,t,n){var r=o.getValue(t,"visualization"),i=n.split("."),a=Number(i[1]),s=o.getValue(t,"layers.".concat(a,".type"));return 2===e.length&&"map"===r&&"point"===s}(n,e,t)?0:n.length-1],i=K.IDMAP.COLOR_BY_ALTERNATIVE,a=d.findItemByPropertyValue(r.qAttributeDimensions,"id",i);return ae(e,ie("dimension",!!a,a||r)),!!a}(e,t))return;re({properties:e,isDimension:!0,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byDimDef.label")})}const le=function(e,t,n){o.setValue(e,t,n),o.isAtomicValue(n)&&function(e,t,n){var r=e.qLayoutExclude;r&&(r.changed||(r.changed={}),r.changed[t]={from:o.getValue(e,t),to:n})}(e,t,n)},ce=function(e,t){var n={primary:!0};if(e){var r=(Q[t]||J).colorModeOptions||J.colorModeOptions;n.byDimension=r.dimension(e),n.byMeasure=r.measure(e),n.byMultiple=r.multiColor(e),n.byExpression=r.expression(e)}return n},ue=function(e){var t=e.canColorBy,n=e.autoColor,r=e.colorMode,i=e.dimensions;return!(t[r]&&!n&&("byDimension"!==r&&"byMeasure"!==r||!i.length))},de=function(e,t){var n,r=o.getValue(e,"color.mode"),i=o.getValue(e,"color.auto"),a=o.getValue(e,"".concat(t,"qDimensions"),[]),s=o.getValue(e,"".concat(t,"qMeasures"),[]),l=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);i?te(a,l):!(n={auto:i,colorMode:r,dimensions:a}).auto&&"byDimension"===n.colorMode&&n.dimensions.length>0?se(e,t):function(e){var t=e.auto,n=e.colorMode,r=e.dimensions,i=e.measures,a=e.properties,s=o.getValue(a,"visualization");return!(t||"byMeasure"!==n||!r.length||"map"!==s&&!i.length)}({auto:i,colorMode:r,dimensions:a,measures:s,properties:e})?function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),a=o.getValue(e,"color.byMeasureDef");if(a&&ne(e,a.label),function(e){return!!(e&&e.activeMeasureIndex>-1)}(a))!function(e,t){var n=o.getValue(e,"".concat(t,"qMeasures"),[]),r=o.getValue(e,"color.byMeasureDef");if(r.activeMeasureIndex=Math.min(r.activeMeasureIndex,n.length-1),r.activeMeasureIndex>-1){var i=ie("measure",!1,n[r.activeMeasureIndex],!0);i.activeMeasureIndex=r.activeMeasureIndex,ae(e,i)}}(e,t);else if(function(e,t){return(!e||!e.key)&&t.length>0}(a,r)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=n[n.length-1],a=K.IDMAP.COLOR_BY_ALTERNATIVE,s=d.findItemByPropertyValue(i.qAttributeExpressions,"id",a);return ae(e,ie("measure",!!s,s||r[0])),!!s}(e,t))return;re({properties:e,isDimension:!1,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byMeasureDef.label")})}(e,t):function(e,t){var n=o.getValue(e,"color.mode"),r=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"".concat(t,"qMeasures"),[]),a=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);"byMultiple"===n&&i.length<2&&o.setValue(e,"color.mode","primary"),te(r,a)}(e,t)},fe=function(e){e.forEach(function(e){e.qOtherTotalSpec&&"qTotalMode"in e.qOtherTotalSpec&&delete e.qOtherTotalSpec.qTotalMode})},he=function(e){var t=e.shouldUpdateColorBy,n=e.properties,r=o.getValue(n,"qHyperCubeDef.qMeasures",[]),i=o.getValue(n,"color.mode","");return!t&&"byExpression"===i&&r.length>0},pe=function(e){var t=o.getValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",[]),n=o.getValue(e,"color.colorExpression","");t.splice(0,0,{qExpression:n,id:"colorByExpression"}),o.setValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",t)},me=function(e){o.setValue(e,"color.mode","primary"),o.setValue(e,"color.auto",!0)},ge=function(e){var t=o.getValue(e,"qHyperCubeDef.qDimensions",[]),n=o.getValue(e,"color.persistent",!1);return t.length>1&&!n},ye={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=B.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),o=i.data[0],a=o.dimensions.concat(o.excludedDimensions),s=o.measures.concat(o.excludedMeasures),l=K.IDMAP,c=l.COLOR_BY_ALTERNATIVE,u=l.COLOR_BY_EXPRESSION;return K.moveByIdFromGroup(a,[],"qAttributeDimensions",c),K.moveByIdFromGroup(a,[],"qAttributeExpressions",c),K.moveByIdFromGroup(s,[],"qAttributeExpressions",u),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,a=e.hypercubePath,s=e.extension,l=e.supportedFilters,c=e.isHCModifierSupported,u=B.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:a,extension:s,supportedFilters:l,isHCModifierSupported:c}),d=u.qProperty,f=o.getValue(d,"visualization"),h=o.getValue(d,"qHyperCubeDef.qDimensions",[]),p=o.getValue(d,"color.mode",""),m=o.getValue(d,"color.auto",""),g=ce(d,f),y=ue({canColorBy:g,autoColor:m,colorMode:p,dimensions:h});return g[p]?he({shouldUpdateColorBy:y,properties:d})&&pe(d):me(d),y&&de(d,"qHyperCubeDef."),ge(d)&&le(d,"color.persistent",!0),fe(h),u}};var ve=["bar","marker","line"];const be=function(e){var t=e.initialProperties,n=e.properties;t.measureAxis&&void 0===t.measureAxis.autoMinMax?H(n,"unsupportedAutoMinMax")||M()(n.measureAxis,t.measureAxis):H(n,"supportedAutoMinMax")||M()(n.measureAxis,t.measureAxis)},xe=function(e){var t,n=e.exportFormat,r=e.initialProperties,i=e.properties,o=e.measureType,a=i.qHyperCubeDef,s=i.measureAxis;if(function(e){var t=e.initialProperties;return!(!e.exportFormat.properties.measureAxes||t.measureAxes||!t.measureAxis||void 0===t.measureAxis.autoMinMax)}({exportFormat:n,initialProperties:r})){var l=function(e){var t=[];return e.qMeasures.length>0&&e.qMeasures.forEach(function(e){if(e.qDef.series){var n=e.qDef.series,r=n.type,i=n.axis;t[i]||(t[i]={axis:i,type:{line:0,marker:0,bar:0,total:0}}),ve.includes(r)&&t[i].type[r]++,t[i].type.total++}}),t}(a);l.length?(o&&(t=l.filter(function(e){return e.type[o]>0}).sort(function(e,t){return t.type[o]-e.type[o]})),t&&t.length||(t=l.sort(function(e,t){return t.type.total-e.type.total})),t&&t[0]&&M()(s,n.properties.measureAxes[t[0].axis])):M()(s,n.properties.measureAxes[0])}},Se=function(e){if(e.qDimensions.length>1){var t=e.qInterColumnSortOrder.indexOf(0);if(0!==t){var n=e.qInterColumnSortOrder[0];e.qInterColumnSortOrder[0]=0,e.qInterColumnSortOrder[t]=n}}},Me={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=e.supportedAutoMinMax,o=void 0===i||i,a=ye.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),s=a.properties;return o?(x(s,"measureAxis.min","supportedAutoMinMax"),x(s,"measureAxis.max","supportedAutoMinMax")):(x(s,"measureAxis.min","unsupportedAutoMinMax"),x(s,"measureAxis.max","unsupportedAutoMinMax")),a},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,o=e.hypercubePath,a=e.measureType,s=e.extension,l=e.supportedFilters,c=e.isHCModifierSupported,u=ye.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:o,extension:s,supportedFilters:l,isHCModifierSupported:c}),d=u.qProperty;return be({initialProperties:n,properties:d}),xe({exportFormat:t,initialProperties:n,properties:d,measureType:a}),Se(d.qHyperCubeDef),d.qHyperCubeDef.qColumnOrder=[],d.qHyperCubeDef.columnOrder=[],u}};function we(e,t,n){return"qLayoutExclude.quarantine.".concat(e,".").concat(t,".").concat(n)}function ke(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,a=e.itemPath;o.getValue(t,n,[]).forEach(function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,a=e.itemPath,s=o.getValue(i,a);if(void 0!==s){var l=o.getValue(i,"qDef.cId");l||(l=o.generateId(),o.setValue(i,"qDef.cId",l));var c=we(n,r,l);o.setValue(t,c,s),o.setValue(i,a,void 0)}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:a})})}function Ee(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,a=e.itemPath;o.getValue(t,n,[]).forEach(function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,a=e.itemPath,s=o.getValue(i,"qDef.cId");if(s){var l=we(n,r,s),c=o.getValue(t,l);void 0!==c&&(o.setValue(i,a,c),o.setValue(t,l,void 0))}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:a})})}var Ce="qHyperCubeDef.qMeasures",Ne="conditionalColoring",Te="measures",De="qDef.conditionalColoring";const qe={quarantine:function(e){ke({properties:e,arrayPath:Ce,quarantineName:Ne,arrayName:Te,itemPath:De})},unquarantine:function(e){Ee({properties:e,arrayPath:Ce,itemPath:De,arrayName:Te,quarantineName:Ne})}};var Oe="qHyperCubeDef.qMeasures",Ie="measures",Ae="qHyperCubeDef.qDimensions",_e="dimensions",Le="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",Pe="alternativeMeasures",Re="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",Fe="alternativeDimensions",ze="qCalcCondition",je="conditionalShowHide";const $e={quarantine:function(e){ke({properties:e,arrayPath:Oe,quarantineName:je,arrayName:Ie,itemPath:ze}),ke({properties:e,arrayPath:Ae,quarantineName:je,arrayName:_e,itemPath:ze})},unquarantine:function(e){Ee({properties:e,arrayPath:Oe,quarantineName:je,arrayName:Ie,itemPath:ze}),Ee({properties:e,arrayPath:Ae,quarantineName:je,arrayName:_e,itemPath:ze})},quarantineAlternative:function(e){ke({properties:e,arrayPath:Le,quarantineName:je,arrayName:Pe,itemPath:ze}),ke({properties:e,arrayPath:Re,quarantineName:je,arrayName:Fe,itemPath:ze})},unquarantineAlternative:function(e){Ee({properties:e,arrayPath:Le,quarantineName:je,arrayName:Pe,itemPath:ze}),Ee({properties:e,arrayPath:Re,quarantineName:je,arrayName:Fe,itemPath:ze})}},Ve={hypercube:B,colorChart:ye,axisChart:Me,quarantineProperty:x,unquarantineProperty:H,quarantineArrayProp:ke,unquarantineArrayProp:Ee,conditionalColoring:qe,conditionalShow:$e}})(),r.default})()}(xg)),xg.exports),Mg=o(Sg);var wg="AVERAGE",kg="LINEAR",Eg="POLYNOMIAL2",Cg="POLYNOMIAL3",Ng="POLYNOMIAL4",Tg="EXPONENTIAL",Dg="LOG",qg="POWER";function Og({dimValue:e,value:t,qTrendLine:n}){const{qType:r,qCoeff:i}=n,o={x:e,y:i[2]*t**2+i[1]*t+i[0]};switch(r){case Cg:return o.y+=i[3]*t**3,o;case Ng:return o.y+=i[4]*t**4+i[3]*t**3,o;default:return o}}var Ig={average:function({dimValue:e,qTrendLine:t}){return{x:e,y:t.qCoeff[0]}},linear:function({dimValue:e,value:t,qTrendLine:n}){return{x:e,y:n.qCoeff[1]*t+n.qCoeff[0]}},polynomial2:Og,polynomial3:Og,polynomial4:Og,exponential:function({dimValue:e,value:t,qTrendLine:n}){return{x:e,y:Math.exp(n.qCoeff[0]+t*n.qCoeff[1])}},log:function({dimValue:e,value:t,qTrendLine:n}){return{x:e,y:n.qCoeff[1]+n.qCoeff[0]*Math.log(t)}},power:function({dimValue:e,value:t,qTrendLine:n}){return{x:e,y:10**(n.qCoeff[0]+n.qCoeff[1]*Math.log(t)*Math.LOG10E)}}};function Ag(e,t){const n=Ig[t.qType.toLowerCase()],r=Math.max(1,e/500);let i=1/0,o=-1/0;for(let a=0;a<e;a+=r){const{y:e}=n({dimValue:null,value:a+1,qTrendLine:t});i=Math.min(e,i),o=Math.max(e,o)}return{min:i,max:o}}function _g(e){return Ig[e.qType.toLowerCase()]}function Lg(e,t){return e.meta.isContinuous?function(e,t){return{generate:(n,r,i)=>{const o=[],a=_g(n),s=t.get("zoom"),l=n.start??s.min,c=n.end??s.max,u=(c-l)/100,d=e.meta.isButterfly&&i>0;if(u>0){const e=e=>{const t=a({dimValue:e,value:e,qTrendLine:n});d&&(t.y=-t.y),t.layerId=r,t.measureIndex=i,t.dimValue=e,o.push(t)};let t=l;for(let n=l;n<=c;n+=u)e(n),t=n;t!==c&&e(c)}return o},calculate:(e,t)=>_g(e)({dimValue:t,value:t,qTrendLine:e}),findMinMax(e,t){const n=this.generate(t).map(({y:e})=>e);return{min:Math.min(...n),max:Math.max(...n)}}}}(e,t):e.meta.mode.K?function(e){return{generate:(t,n,r)=>{const i=[],o=e.getDataPages()[0],a=o.qData[0].qSubNodes,s=o.qArea.qTop,l=Ig[t.qType.toLowerCase()];for(let e=0;e<a.length;e++){const o=a[e],c=l({dimValue:o.qElemNo,value:e+s+1,qTrendLine:t});c.layerId=n,c.measureIndex=r,c.dimValue=o.qText,i.push(c)}return i},findMinMax:Ag}}(e):function(e){return{generate:(t,n,r)=>{const i=[],o=e.getDataPages()[0],a=o.qMatrix,s=o.qArea.qTop,l=Ig[t.qType.toLowerCase()],c=e.meta.isButterfly&&r>0;for(let e=0;e<a.length;e++){const o=a[e][0],u=e+s+1,d=l({dimValue:o.qElemNumber,value:u,qTrendLine:t});c&&(d.y=-d.y),d.layerId=n,d.measureIndex=r,d.dimValue=o.qText,i.push(d)}return i},calculate:(e,t,n)=>(0,Ig[e.qType.toLowerCase()])({dimValue:n,value:t,qTrendLine:e}),findMinMax:Ag}}(e)}var Pg={TYPES:{AVERAGE:"properties.trendlines.types.average",LINEAR:"properties.trendlines.types.linear",POLYNOMIAL2:"properties.trendlines.types.polynomial2",POLYNOMIAL3:"properties.trendlines.types.polynomial3",POLYNOMIAL4:"properties.trendlines.types.polynomial4",EXPONENTIAL:"properties.trendlines.types.exponential",LOG:"properties.trendlines.types.logarithmic",POWER:"properties.trendlines.types.power"},STYLE:{DASHED:"properties.trendlines.style.dashed"},TYPE:"properties.trendlines.type",HEADER:"properties.trendlines",ADD_BUTTON:"properties.trendlines.button.add"},Rg={color:"#f93f17",index:9};const{isDark:Fg}=Ae,zg={x:NaN,y:NaN,layerId:NaN,measureIndex:NaN},jg=({layoutService:e,viewState:t,colorModel:n,chart:r,env:i,keys:{colorScale:o},isEnabled:a=()=>!1})=>{const{translator:s}=i,l=[zg],c=[],u=[],d=Lg(e,t);e.getLayoutValue("qHyperCube.qMeasureInfo",[]).forEach((e,t)=>{Array.isArray(e.qTrendLines)&&(c.push(...e.qTrendLines),u.push(...e.qTrendLines.map(()=>t)))});const f=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e){return e},n=ku();return function(r){var i=t(r);return n.has(i)?n.get(i):n.set(i,e(r))}}(e=>{const{style:t}=c[e]||{},i=n.settings();if(t.autoColor){if("measure"===i.mode){const t=u[e],n=r.scale(o)(t);return Fg(n)?function(e){const t=qe(e);return t.l<30?t.l+=15:t.l<50?t.l+=10:t.l+=5,t.toString()}(n):function(e){const t=qe(e);return t.l-=5,t.toString()}(n)}return n.resolveUIColor(Rg)}return t.paletteColor?n.resolveUIColor(t.paletteColor):"none"});return{query:{hasTrendLines:()=>!!c.length&&a(),getData:()=>l,getStroke:f,getLineDash:e=>{const{style:t}=c[e]||{};return t?.lineDash},getLineThickness:e=>{const{style:t}=c[e]||{};return t?.lineThickness??2},getLabel:e=>(c[e]||{}).label,getType:e=>{const{qType:t}=c[e]||{};return s.get(Pg.TYPES[t])},getMinMax:()=>{let t=1/0,n=-1/0;return c.forEach(r=>{const i=d.findMinMax(e.meta.size.y,r);t=Math.min(i.min,t),n=Math.max(i.max,n)}),{min:t,max:n}},getCalculatedValue:(e,t,n)=>{const r=c[e];return d.calculate(r,t,n)}},command:{update:()=>{l.length=0,c.forEach((e,t)=>{const n=d.generate(e,t,u[t]);l.push(...n)})}}}};var $g={source:"trend",extract:{field:"x",props:{minor:{field:"y"},layer:{field:"layerId"},measureIndex:{field:"measureIndex"},dimValue:{field:"dimValue"}}}};const Vg=({meta:e})=>e.isContinuous?({scale:e,datum:t})=>e(t.value):e.isGroupedByMeasure?({scale:e,datum:t})=>e([t.value,t.measureIndex.value])+e.bandwidth()/2:({scale:e,datum:t})=>e(t.value)+e.bandwidth()/2,Ug=(e,{layoutService:t,trendLineModel:n,dockService:r,animationsEnabled:i})=>{if(!n.query.hasTrendLines())return[];const o=(({majorScale:e,minorScale:t},{trendLineModel:n,layoutService:r,dockService:i,animationsEnabled:o})=>{const a=Vg(r);return{key:"trend-lines",type:"line",layout:{dock:"center"},data:$g,settings:{connect:!0,orientation:i.meta.major.orientation,coordinates:{major:{scale:e,fn:a},minor:{scale:t},layerId:{ref:"layer"}},layers:{curve:"monotone",line:{strokeWidth:({datum:e})=>n.query.getLineThickness(e.layer.value),stroke:({datum:e})=>n.query.getStroke(e.layer.value),strokeDasharray:({datum:e})=>n.query.getLineDash(e.layer.value)}}},animations:{enabled:o,trackBy:Ih.nonUpdatingNode.trackBy,compensateForLayoutChanges:Ih.lines.compensateForLayoutChanges}}})(e,{trendLineModel:n,layoutService:t,dockService:r,animationsEnabled:i}),a=(({majorScale:e,minorScale:t,tooltipOverlay:n="trend-lines-tooltip-overlay"},{layoutService:r,dockService:i})=>{const o=Vg(r),a="horizontal"===i.meta.major.orientation,s={scale:e,fn:o},l={scale:t,ref:"minor"};return{key:n,type:"point",layout:{dock:"center"},data:$g,settings:{x:a?s:l,y:a?l:s,opacity:0,size:1,sizeLimits:{maxPx:8,minPx:8}}}})(e,{layoutService:t,dockService:r});return[o,a]};function Hg(e,t){const{getLabel:n,getType:r,getLineDash:i,getStroke:o}=t.query;return({node:t,resources:a})=>{const s={type:"icon",style:{stroke:o(t.data.layer.value),"min-width":"16px","vertical-align":"middle","stroke-dasharray":i(t.data.layer.value)}},l={content:[{content:n(t.data.layer.value),style:{"font-weight":"bold"}},{content:r(t.data.layer.value)}],style:{"min-width":"136px"}};return{title:t.data.dimValue.label,row:[s,l,{content:a.formatter(e.formatter)(t.data.minor.value)}]}}}function Bg(e,{h:t,style:n}){return e.map(e=>{const r={style:{direction:"string"==typeof e.content?_.detectTextDirection(e.content):void 0,...n.cell||{},...e.style||{}},class:e.class};e.colspan&&(r.colspan=e.colspan);const i=function(e,t){return Array.isArray(t.content)?e("div",{style:{display:"flex","flex-direction":"column"}},t.content.map(t=>e("span",{style:t.style,direction:_.detectTextDirection(t.content)},t.content))):"icon"===t.type?function(e){const t=e("line",{x1:"0px",y1:"16px",x2:"16px",y2:"0px","stroke-width":"3px"});return e("svg",{xlms:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16"},t)}(e):t.content}(t,e);return t("td",r,i)})}function Wg(e,t){return({h:n,data:r,style:i})=>{const o=r[0].title,a=r.filter(e=>e.title===o),s=function(e,t){const n=e("td",{colspan:3,style:{"font-weight":"bold"},direction:_.detectTextDirection(t)},t);return e("tr",{},n)}(n,o),l=[s];if(a.slice(0,2).forEach(e=>{l.push(n("tr",{},Bg(e.row,{h:n,style:i})))}),r.length>2){const i=r.length-2;l.push(...function(e,t,n,r){const i=t?t.get("Object.ChartTooltip.NMore",r):`+${r} more`,o=_.detectTextDirection(i);return[e("tr",{},e("td",{style:{"background-image":"linear-gradient(transparent 8px, rgba(255, 255, 255, 0.4) 8px, rgba(255, 255, 255, 0.4) 9.2px, transparent 9.2px)",height:"17px"},colspan:3},"")),e("tr",{},e("td",{style:{"font-weight":"bold","text-align":n?"right":"left",direction:o},colspan:3},i))]}(n,e,t,i))}return l}}function Yg(e,{trendLineModel:t,translator:n},r={}){if(!t.query.hasTrendLines())return!1;const{rtl:i}=r,o=q({key:e.tooltip,rtl:i});return l(!0,o,{settings:{extract:Hg(e,t),content:Wg(n,i),placement:"pointer",direction:r.rtl?"rtl":"ltr"}})}function Gg(e,t){const n=t.element.getBoundingClientRect();return{x:(e.center?e.center.x:e.clientX)-n.left,y:(e.center?e.center.y:e.clientY)-n.top}}function Kg(e,{chart:t,viewState:n,trendLineModel:r,layoutService:i,rtl:o}){const{isContinuous:a}=i.meta;let s={components:[{key:e.tooltipOverlay}],propagation:"stop"},l=e=>{const n=Gg(e,t);return t.shapesAt(n,s)};if(a){const{getCalculatedValue:i}=r.query;s={components:[{key:"trend-lines"}],propagation:"stop"},l=(r,a)=>{const l=Gg(r,t),c=t.shapesAt(function(e){return{cx:e.x,cy:e.y,r:3}}(l),s);if(c.length){const r=function(e,t,n,r){let i=(e.x-t.rect.computed.x)/t.rect.computed.width;i=r?1-i:i;const{min:o,max:a}=n.get("zoom");return o+(a-o)*i}(l,a,n,o),s=t.scale(e.majorInnerScale),u=(s?.formatter?s.formatter():t.formatter({data:{fields:["qDimensionInfo/0"]}}))(r);c.forEach(e=>{e.data.dimValue.value=r,e.data.dimValue.label=u,e.data.minor.value=i(e.data.layer.value,r).y})}return c}}return n=>{const r=t.component(e.tooltip);if(r&&(n=>t.componentsFromPoint({x:n.center?n.center.x:n.clientX,y:n.center?n.center.y:n.clientY}).some(t=>t.key===e.tooltipOverlay))(n)){const e=l(n,r);return e.length?(r.emit("show",n,{nodes:e}),!0):(r.emit("hide"),!1)}return!1}}const Xg=e=>{e.style.dashed?e.style.lineDash="8, 4":e.style.lineDash=""},Jg=e=>{Xg(e),e.qMultiDimMode="Sum",e.qXColIx=0};function Zg(e={}){const{translator:t,events:n={onGlobalChange:()=>{}},allowStackedByDimension:r=!1}=e;return{show:(e,t,{layout:n})=>!S.dimensionless(n)&&!S.groupedByDimension(n)&&(r||!S.stackedByDimension(n)),type:"array",ref:"qTrendLines",titleTranslation:Pg.HEADER,itemTitleRef:e=>{const n=typeof e.label;return"string"===n&&e.label?e.label:"object"===n?e.label.qStringExpression?e.label.qStringExpression.qExpr:e.label.qValueExpression.qExpr:t.get(Pg.TYPES[e.qType])},max:8,allowAdd:!0,allowRemove:!0,allowMove:!1,addTranslation:Pg.ADD_BUTTON,add:Jg,globalChange:e=>{const t=Su(e,"qHyperCubeDef.qMeasures",[]).reduce((e,t)=>(Array.isArray(t.qTrendLines)&&e.push(...t.qTrendLines),e),[]),r=(e=>!Su(e,"dimensionAxis.continuousAuto",!1)&&e.preferContinuousAxis)(e)?"Possible":"Never";t.forEach(e=>{e.qContinuousXAxis=r}),n.onGlobalChange(e,t)},items:{label:{ref:"label",type:"string",expression:"optional",translation:"Common.Label",defaultValue:""},type:{ref:"qType",type:"string",component:"dropdown",translation:Pg.TYPE,options:[{value:wg,translation:Pg.TYPES.AVERAGE},{value:kg,translation:Pg.TYPES.LINEAR},{value:Eg,translation:Pg.TYPES.POLYNOMIAL2},{value:Cg,translation:Pg.TYPES.POLYNOMIAL3},{value:Ng,translation:Pg.TYPES.POLYNOMIAL4},{value:Tg,translation:Pg.TYPES.EXPONENTIAL},{value:Dg,translation:Pg.TYPES.LOG},{value:qg,translation:Pg.TYPES.POWER}],defaultValue:wg},autoColor:{ref:"style.autoColor",type:"boolean",translation:"properties.colors",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},paletteColor:{ref:"style.paletteColor",translation:"properties.color",type:"object",component:"color-picker",dualOutput:!0,defaultValue:Rg,show:e=>!e.style.autoColor},dashed:{ref:"style.dashed",translation:Pg.STYLE.DASHED,type:"boolean",defaultValue:!0,change:Xg}}}}const Qg=e=>({imageSize:{type:"items",items:{sizeOption:{ref:"size.option",type:"string",component:"buttongroup",translation:"properties.images.size",options:[{value:"simple",translation:"properties.images.size.simple"},{value:"custom",translation:"properties.images.size.custom"}],defaultValue:"simple"}}},simpleSize:{component:"slider",type:"number",expression:"optional",ref:"size.simpleSize",translation:"properties.images.size",defaultValue:1,min:.1,max:2,step:.1,show:e=>"simple"===e.size.option},customWidth:{ref:"size.customWidth",translation:"properties.images.size.custom.width",type:"number",expressionType:"ValueExpression",expression:"optional",defaultValue:100,show:e=>"custom"===e.size.option&&"rectangle"===e.style?.symbol},customHeight:{ref:"size.customHeight",translation:"properties.images.size.custom.height",type:"number",expressionType:"ValueExpression",expression:"optional",defaultValue:100,show:e=>"custom"===e.size.option&&"rectangle"===e.style?.symbol},customRadius:{ref:"size.customRadius",translation:"properties.images.size.custom.radius",type:"number",expressionType:"ValueExpression",expression:"optional",defaultValue:100,show:e=>"custom"===e.size.option&&"circle"===e.style?.symbol},symbol:{ref:"style.symbol",type:"string",component:"buttongroup",translation:"properties.images.shape",options:[{value:"rectangle",translation:"properties.images.shape.rectangle"},{value:"circle",translation:"properties.images.shape.circle"}],defaultValue:"rectangle"},opacity:{component:"slider",type:"number",expression:"optional",ref:"style.opacity",translation:"properties.opacity",defaultValue:1,min:.1,max:1,step:.1},positionGridItem:{component:"position-grid",ref:"image.position",label:e.get("properties.images.position"),defaultValue:"center-center"}}),ey=({translator:e})=>({dimensionNumberValue:{ref:"dimensionValue",translation:"properties.dimensionReferenceLines.dimensionValue",type:"number",expressionType:"ValueExpression",expression:"optional",defaultValue:0,show:(e,t,n)=>p.canBeContinuous(n.layout)},dimensionStringValue:{ref:"dimensionValue",translation:"properties.dimensionReferenceLines.dimensionValue",component:"string",expression:"optional",defaultValue:"",show:(e,t,n)=>!p.canBeContinuous(n.layout)},measureInputType:{type:"number",component:"dropdown",translation:"properties.plugins.measureInputType",show:(e,t,n)=>1===Wh(n.layout),convertFunctions:{get:(e,t,n,r)=>void 0===r.measureValue?1:0,set(e,t,n,r,i){0===e?(i.measureValue=0,delete i.measureIndex):(i.measureIndex=0,delete i.measureValue)}},options:[{value:0,translation:e.get("properties.plugins.measureInputType.measureValue")},{value:1,translation:e.get("properties.plugins.measureInputType.measureIndex")}]},measureValue:{ref:"measureValue",translation:"properties.plugins.measureInputType.measureValue",type:"number",expressionType:"ValueExpression",expression:"optional",defaultValue:0,schemaIgnore:!0,show:(e,t,n)=>void 0!==e.measureValue||2===Wh(n.layout)},measureIndex:{ref:"measureIndex",translation:"properties.plugins.measureInputType.measureIndex",type:"number",expressionType:"ValueExpression",expression:"optional",defaultValue:0,show:(e,t,n)=>void 0===e.measureValue&&1===Wh(n.layout),invalid:(e,t,n)=>e.measureIndex<0||e.measureIndex>=Yh(n.layout)}}),ty=({translator:e})=>{const t={type:"array",ref:"plugins",filter:e=>e.filter(e=>["image"].includes(e.type)),translation:"properties.images",show:!0,itemTitleRef:()=>e.get("properties.images.image"),allowAdd:!0,allowRemove:!0,allowMove:!0,allowDuplicate:!0,add(e,t){void 0===t.plugins&&(t.plugins=[]),e.type="image",e.size={option:"simple",customWidth:100,customHeight:100,customRadius:100,simpleSize:1},e.style={symbol:"rectangle"},e.measureIndex=0,e.measureValue=void 0,e.dimensionValue=""},addTranslation:"properties.images.addImage",items:{images:{component:"items",items:{source:{type:"number",component:"dropdown",translation:"properties.images.source",convertFunctions:{get:(e,t,n,r)=>void 0===r.url?"mediaLibrary":"expressionUrl",set(e,t,n,r,i){"expressionUrl"===e?(i.url=0,delete i.medialibrary,i.image?.url?.qStaticContentUrlDef&&(i.image.url.backupMediaUrl=i.image.url.qStaticContentUrlDef.qUrl,delete i.image.url.qStaticContentUrlDef.qUrl)):(i.medialibrary=0,delete i.url,i.image.url.backupMediaUrl&&(i.image=i.image||{},i.image.url=i.image.url||{},i.image.url.qStaticContentUrlDef={qUrl:i.image.url.backupMediaUrl},delete i.image.url.backupMediaUrl),delete i.image.url.expressionUrl)}},options:[{value:"mediaLibrary",translation:"MediaLibrary.Header"},{value:"expressionUrl",translation:"Background.byUrlExpression"}]},image:{type:"items",translation:"properties.backgroundImage",grouped:!0,items:{mediaUrl:{ref:"image.url.qStaticContentUrlDef.qUrl",layoutRefFn:(e,t)=>function(e,t,n="plugins"){const r=t?.[n]||[],i=r.filter(e=>"image"===e.type),o=i.findIndex(t=>t.cId===e.cId);if(-1!==o)return`${n}.${r.findIndex(e=>e.cId===i[o].cId)}.image.url.qStaticContentUrl.qUrl`;return""}(e,t.properties),schemaIgnore:!0,translation:"Common.Image",tooltip:{select:"properties.media.select",remove:"properties.media.removeBackground"},type:"string",component:"media",defaultValue:"",show:e=>void 0===e?.url},imageUrl:{component:"input-field-expression",ref:"image.url.expressionUrl",show:e=>void 0!==e?.url},point:{component:"items",show:e=>e.image?.url?.qStaticContentUrlDef?.qUrl||e.image?.url?.expressionUrl,items:{dataSection:{component:"items",items:ey({translator:e})}}},styling:{component:"items",show:e=>e.dimensionValue&&(e.image?.url?.qStaticContentUrlDef?.qUrl||e.image?.url?.expressionUrl),items:{dataSection:{component:"items",items:Qg(e)}}}}}}}}};return t},ny={component:"dropdown",type:"string",expression:"optional",ref:"style.lineType",translation:"LayerStyleEditor.style.lineType",show:!0,defaultValue:"solid",options:[{value:"solid",translation:"LayerStyleEditor.style.solid"},{value:"dashed",translation:"LayerStyleEditor.style.dashed"}]};const ry=(e,t,n)=>{const r=`${e}.fontFamily`,i=`${e}.fontSize`;return{fontFamilyItem:{component:"dropdown",ref:r,options:()=>t.getOptions(r),defaultValue:()=>t.getDefaultValue(r)},fontWrapperItem:{component:"inline-wrapper",items:{fontSizeItem:{component:"dropdown",ref:i,options:()=>t.getOptions(i),defaultValue:()=>t.getDefaultValue(i)},fontColorItem:{component:"color-picker",width:!1,ref:`${e}.color`,defaultValue:()=>({color:n.getStyle("object.lineChart",e,"color")})}}}}},iy=(e,t,n)=>{const r=function(e){var t=e.theme,n=e.translator,r=e.config,i=function(e){var t=e.config,n=void 0===t?{}:t,r=n.id,i=n.paths;return{id:void 0===r?il:"".concat(il,".").concat(r),paths:Array.isArray(i)?i:[]}}({config:void 0===r?{}:r}),o=i.id,a=i.paths,s={};a.forEach(function(e){var r=e.split(".");gl(r);for(var i=s,a=0;a<r.length;a++){var l=r[a];a===r.length-1?i[l]=fl({theme:t,translator:n,id:o,path:e}):void 0===i[l]&&(i[l]={}),i=i[l]}});var l=function(e){var t=e.split(".");gl(t);for(var n=s,r=0;r<t.length;r++){var i=t[r];if(void 0===n[i])throw new Error("font-resolver: Path '".concat(e,"' could not be resolved."));n=n[i]}return n};return s.getDefaultValue=function(e){return l(e).getDefaultValue()},s.getOptions=function(e){return l(e).getOptions()},s}({theme:t,translator:n,config:{id:"lineChart",paths:["axis.title","axis.label.name","label.value","legend.title","legend.label"]}});return{component:"styling-panel",translation:"LayerStyleEditor.component.styling",chartTitle:"Object.LineChart",subtitle:"LayerStyleEditor.component.styling",useGeneral:!0,useBackground:!0,items:{dataPointSizeSection:{translation:"LayerStyleEditor.style.dataPointSize",component:"panel-section",items:{dataPointSizeItem:{component:"items",ref:"components",key:"line",items:{dataPointSizeSlider:{component:"slider",ref:"style.dataPointSize",min:3,max:20,step:1,width:12,defaultValue:e?.isEnabled("TLV_1804_DEFAULT_CHART_SETTINGS")?8:6,styleMeasure:!0}}}}},lineOptionSection:{translation:"LayerStyleEditor.style.lineOptions",component:"panel-section",items:{lineOptionItem:{component:"items",ref:"components",key:"line",items:{lineThicknessText:{component:"text",translation:"LayerStyleEditor.style.lineThickness"},lineThickness:{component:"slider",ref:"style.lineThickness",min:1,max:5,step:1,width:12,defaultValue:e?.isEnabled("TLV_1804_DEFAULT_CHART_SETTINGS")?3:1,styleMeasure:!0},lineTypeWrapper:{component:"inline-wrapper",alignItems:"center",items:{lineTypeText:{component:"text",translation:"LayerStyleEditor.style.lineType"},lineTypeDropdown:{component:"dropdown",ref:"style.lineType",options:[{value:"solid",translation:"LayerStyleEditor.style.solid"},{value:"dashed",translation:"LayerStyleEditor.style.dashed"}],defaultValue:"solid",styleMeasure:!0}}},lineCurveWrapper:{component:"inline-wrapper",alignItems:"center",items:{lineCurveText:{component:"text",translation:"LayerStyleEditor.style.lineCurve"},lineCurveDropdown:{component:"dropdown",ref:"style.lineCurve",options:[{value:"linear",translation:"LayerStyleEditor.style.linear"},{value:"monotone",translation:"LayerStyleEditor.style.monotone"}],defaultValue:e?.isEnabled("TLV_1804_DEFAULT_CHART_SETTINGS")?"monotone":"linear",styleMeasure:!0}}}}}}},axisTitleSection:e?.isEnabled("CLIENT_IM_3050")?{translation:"properties.axis.title",component:"panel-section",items:{labelItems:{component:"items",ref:"components",key:"axis",items:ry("axis.title",r,t)}}}:void 0,axisLabelSection:e?.isEnabled("CLIENT_IM_3050")?{translation:"properties.axis.label",component:"panel-section",items:{labelItems:{component:"items",ref:"components",key:"axis",items:ry("axis.label.name",r,t)}}}:void 0,labelValueSection:e?.isEnabled("CLIENT_IM_3050")?{translation:"properties.value.label",component:"panel-section",items:{labelItems:{component:"items",ref:"components",key:"label",items:ry("label.value",r,t)}}}:void 0,legendTitleSection:e?.isEnabled("CLIENT_IM_3051")?{translation:"properties.legend.title",component:"panel-section",items:{labelItems:{component:"items",ref:"components",key:"legend",items:ry("legend.title",r,t)}}}:void 0,legendLabelSection:e?.isEnabled("CLIENT_IM_3051")?{translation:"properties.legend.label",component:"panel-section",items:{labelItems:{component:"items",ref:"components",key:"legend",items:ry("legend.label",r,t)}}}:void 0}}};var oy={MAX_NUM_POINTS:5e4,MAX_NUM_LINES:1e3,DEFAULT_NUM_POINTS:2e3,DEFAULT_NUM_LINES:12,LARGE_NUM_POINTS:1e4,LARGE_NUM_POINTS_ANIMATIONS:1e3,CHUNK_SIZE:3e3},ay=7005;const{MAX_NUM_POINTS:sy,MAX_NUM_LINES:ly,DEFAULT_NUM_POINTS:cy,DEFAULT_NUM_LINES:uy}=oy,dy=e=>e.qError?.qErrorCode!==ay,fy=e=>e.qHyperCube.qDimensionInfo.filter(e=>dy(e)),hy=e=>e.qHyperCube.qMeasureInfo.filter(e=>dy(e)),py=e=>fy(e).length&&hy(e).length,my=(e,t)=>"area"===e.lineType&&fy(t.layout).length+hy(t.layout).length>2,gy=e=>S.continuous({layout:e,auto:()=>p.isTime(!0,e)}),yy=(e,t)=>({type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{calcCond:{uses:"calcCond"}}},refLines:{uses:"reflines"},dimRefLines:{uses:"dimReflines"},plugins:ip({translator:t,pluginOptions:[{value:"point",translation:t.get("Visualizations.Descriptions.Point")},{value:"line",translation:t.get("Visualizations.Descriptions.Line")}],supportNewStyles:e?.isEnabled("TLV_1804_DEFAULT_CHART_SETTINGS")}),image:ty({translator:t})}}),vy=(e,t,n)=>{let r,i;return"measure"===n?(r="vertical"!==e.layout.orientation||gy(e.layout)?"y":"x",i=hy(e.layout).map(e=>e.qFallbackTitle||"").join(", ")):(r="vertical"!==e.layout.orientation||gy(e.layout)?"x":"y",i=fy(e.layout).map(e=>e.qFallbackTitle||"").join(", ")),i?t.get(`properties.${r}AxisWithInfo`,[i]):t.get(`properties.${r}Axis`)};function by({flags:e,isUnsupportedFeature:t,translator:n,theme:r,isCloud:i}){const o=t?.("trendlines")?void 0:Zg({translator:n,events:{onGlobalChange:(e,t)=>{let n="Multi",r="Never";"area"===e.lineType&&e.stackedArea&&(n="Sum"),Su(e,"dimensionAxis.continuousAuto",!1)?r="Time":e.preferContinuousAxis&&(r="Possible"),t.forEach(e=>{e.qMultiDimMode=n,e.qContinuousXAxis=r})}}}),a=function(e,t){const n=(e=>({component:"slider",type:"number",expression:"optional",ref:"style.dataPointSize",translation:"LayerStyleEditor.style.dataPointSize",show:!0,defaultValue:e?.isEnabled("TLV_1804_DEFAULT_CHART_SETTINGS")?8:6,min:3,max:20,step:1}))(t),r=(e=>({component:"slider",type:"number",expression:"optional",ref:"style.lineThickness",translation:"LayerStyleEditor.style.lineThickness",show:!0,defaultValue:e?.isEnabled("TLV_1804_DEFAULT_CHART_SETTINGS")?3:1,min:1,max:5,step:1}))(t),i=(e=>({component:"dropdown",type:"string",expression:"optional",ref:"style.lineCurve",translation:"LayerStyleEditor.style.lineCurve",show:!0,defaultValue:e?.isEnabled("TLV_1804_DEFAULT_CHART_SETTINGS")?"monotone":"linear",options:[{value:"linear",translation:"LayerStyleEditor.style.linear"},{value:"monotone",translation:"LayerStyleEditor.style.monotone"}]}))(t);return{type:"array",max:1,allowAdd:!0,allowRemove:!0,allowMove:!1,ref:"qDef.styling",itemTitleRef:()=>e.get("properties.lineStyle"),titleTranslation:"LayerStyleEditor.component.styling",addTranslation:"Object.Container.Props.Add",items:{dataPointSize:n,lineThickness:r,lineType:ny,lineCurve:i}}}(n,e),s={items:{simpleItems:{items:{colorMode:{options:(e,t)=>{const{length:n}=fy(t.layout),{length:r}=hy(t.layout),i=[{value:"primary",translation:"properties.colorMode.primary"}];switch(r>1&&i.push({value:"byMultiple",translation:"properties.colorMode.multicolored"}),n>1&&i.push({value:"byDimension",translation:"properties.colorMode.byDimension"}),e.color?.mode){case"byMeasure":i.push({value:"byMeasure",translation:"properties.colorMode.byMeasure"});break;case"byExpression":i.push({value:"byExpression",translation:"properties.colorMode.byExpression"})}return i}}}}}},l={items:{labels:{items:{header:{show:(e,t,n)=>py(n.layout)},pointLabels:{component:"checkbox",ref:"dataPoint.showLabels",type:"string",translation:"Simple.Label.Value",show:(e,t,n)=>py(n.layout),convertFunctions:{get:(e,t,n,r)=>r.dataPoint?.show&&!1!==r.dataPoint?.showLabels&&"none"!==r.dataPoint?.showLabels,set(e,t,n,r,i){wu(i,"dataPoint.showLabels",e?"auto":"none"),wu(i,"dataPoint.show",e)}},reset(e){wu(e,"dataPoint.show",!1),wu(e,"dataPoint.showLabels","auto")}},dimensionTitle:{component:"checkbox",ref:"dimensionAxis.show",type:"string",translation:"Simple.Label.Dimension.Hide",defaultValue:"all",show:(e,t,n)=>py(n.layout),convertFunctions:{get:(e,t,n,r)=>"labels"===r.dimensionAxis.show||"none"===r.dimensionAxis.show,set(e,t,n,r,i){i.dimensionAxis.show=e?"labels":"all"}}},measureTitle:{component:"checkbox",ref:"measureAxis.show",type:"string",translation:"Simple.Label.Measure.Hide",defaultValue:"all",show:(e,t,n)=>py(n.layout),convertFunctions:{get:(e,t,n,r)=>"labels"===r.measureAxis.show||"none"===r.measureAxis.show,set(e,t,n,r,i){i.measureAxis.show=e?"labels":"all"}}}}}}},c={uses:"settings",items:{simpleLabels:l,general:{items:{showDisclaimer:{translation:"properties.showDisclaimer",type:"boolean",ref:"showDisclaimer",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Show"},{value:!1,translation:"properties.hide"}]}}},presentation:{type:"items",translation:"properties.presentation",grouped:!0,items:{stylingPanel:iy(e,r,n),lineType:{ref:"lineType",type:"string",component:"item-selection-list",defaultValue:"line",horizontal:!0,items:[{icon:"line_chart_line",component:"icon-item",labelPlacement:"bottom",translation:"properties.style.line",value:"line"},{icon:"line_chart_area",component:"icon-item",labelPlacement:"bottom",translation:"properties.style.area",value:"area"}]},stackedProps:{type:"items",grouped:!1,items:{stackedArea:{ref:"stackedArea",translation:"properties.style.stackedArea",type:"boolean",defaultValue:!1,show:(e,t)=>my(e,t)},separateStacking:{ref:"separateStacking",translation:"properties.separateStacking",type:"boolean",defaultValue:!0,readOnly:e=>!e.stackedArea,show:(e,t)=>my(e,t)}}},orientation:{ref:"orientation",type:"string",component:"item-selection-list",defaultValue:"horizontal",horizontal:!0,items:[{component:"icon-item",icon:"direction_up_down",labelPlacement:"bottom",translation:"properties.orientation.vertical",value:"vertical"},{component:"icon-item",icon:"direction_left_right",labelPlacement:"bottom",translation:"Common.Horizontal",value:"horizontal"}],readOnly:(e,t,n)=>gy(n.layout),convertFunctions:(u="horizontal",{get:(e,t,n)=>gy(n.layout)?u:e(t.type),set(e,t,n,r){const i=k(n.type,n);t(n.type,gy(r.layout)?u:e,i)}})},scroll:{type:"items",items:{scrollbar:{type:"string",component:"dropdown",ref:"scrollbar",translation:"properties.scrollbar",options:Object.keys(Up.OPTIONS).map(e=>Up.OPTIONS[e]),defaultValue:Up.DEFAULT.value},scrollStartPos:{ref:"scrollStartPos",type:"number",translation:"properties.ScrollAlignment",component:"dropdown",defaultValue:0,options:[{value:0,translation:"properties.ScrollAlignStart"},{value:1,translation:"properties.ScrollAlignEnd"}],show:(e,t,n)=>!gy(n.layout)}}},nullMode:{type:"string",component:"dropdown",ref:"nullMode",translation:"properties.nullMode",options:[{value:"gap",translation:"properties.nullMode.gap"},{value:"connect",translation:"properties.nullMode.connect"},{value:"zero",translation:"properties.nullMode.zero"}],defaultValue:"gap"},dataPointSettings:{type:"items",grouped:!1,snapshot:{tid:"property-dataPoint"},items:{dataPoints:{ref:"dataPoint.show",translation:"properties.dataPoints.showDataPoints",type:"boolean",defaultValue:!1},showDataPointLabels:{ref:"dataPoint.showLabels",translation:"properties.dataPoints.labelmode",type:"string",component:"dropdown",defaultValue:"none",show:e=>!(!e.dataPoint||!e.dataPoint.show),options:[{value:"none",translation:"Common.None"},{value:"auto",translation:"Common.Auto"},{value:"all",translation:"Common.All"}],convertFunctions:{get(e,t,n){const{showLabels:r}=n.properties?.dataPoint||{};return!1===r?"none":!0===r?"auto":e(t.type)}}}}},maxNumPoints:{type:"integer",expression:"optional",ref:"maxNumPoints",translation:"properties.dataPoints.maxVisiblePoints",defaultValue:cy,show:(e,t,n)=>gy(n.layout),min:cy,max:sy},maxNumLines:{type:"integer",expression:"optional",ref:"maxNumLines",translation:"properties.dataPoints.maxVisibleLines",defaultValue:uy,show(e,t,n){const r=gy(n.layout),i=2===fy(n.layout).length;return r&&i},min:1,max:ly},gridLines:{type:"items",snapshot:{tid:"property-gridLines"},items:{showGridLines:{ref:"gridLine.auto",type:"boolean",translation:"properties.gridLine.spacing",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},gridSpacing:{ref:"gridLine.spacing",type:"number",component:"dropdown",defaultValue:2,options:[{value:0,translation:"properties.gridLine.noLines"},{value:1,translation:"properties.gridLine.wide"},{value:2,translation:"properties.gridLine.medium"},{value:3,translation:"properties.gridLine.narrow"}],show:e=>e.gridLine&&!e.gridLine.auto}}}}},colorsAndLegend:{uses:"colorsAndLegend",items:{colors:{items:{attributeExpression:$h,colorMode:{options(e,t,n){const{length:r}=fy(n.layout),{length:i}=hy(n.layout),o=[{value:"primary",translation:"properties.colorMode.primary"}];return i>1&&o.push({value:"byMultiple",translation:"properties.colorMode.multicolored"}),r>1&&o.push({value:"byDimension",translation:"properties.colorMode.byDimension"}),r<=1&&o.push({value:"byMeasure",translation:"properties.colorMode.byMeasure"}),i>=1&&o.push({value:"byExpression",translation:"properties.colorMode.byExpression"}),o}}}},simpleColors:s,legend:{items:{show:{snapshot:{tid:"property-legend"}}}}}},dimensionAxis:{uses:"axis.dimensionAxis",label:(e,t)=>vy(t,n,"dimension"),items:{dimensionAxisTitle:{component:"header",type:"string",label:(e,t)=>vy(t,n,"dimension"),classification:{section:"axis",tags:["simple"],exclusive:!0}},othersGroup:{items:{label:{options:[{value:"auto",translation:"Common.Auto"},{value:"horizontal",translation:"Common.Horizontal"},{value:"tilted",translation:"properties.labels.tilted"},{value:"layered",translation:"properties.labels.layered"}],show(e,t,n){const r="vertical"!==n.layout.orientation,i=!(!e.dimensionAxis||"all"!==e.dimensionAxis.show&&"labels"!==e.dimensionAxis.show),o=gy(n.layout);return r&&i&&!o}},dock:{options(e,t,n){const r={value:"near",translation:"Common.Bottom"},i={value:"far",translation:"Common.Top"};return"vertical"!==n.layout.orientation||gy(n.layout)||(r.translation=n.yMirrorMode?"properties.dock.right":"properties.dock.left",i.translation=n.yMirrorMode?"properties.dock.left":"properties.dock.right"),[r,i]}}}},axisDisplaySettings:{type:"items",components:"items",show:(e,t,n)=>!gy(n.layout),items:{axisDisplayMode:{type:"string",translation:"properties.axis.displaymode",ref:"dimensionAxis.axisDisplayMode",component:"dropdown",defaultValue:"auto",options:[{value:"auto",translation:"properties.axis.displaymode.auto"},{value:"max",translation:"properties.axis.displaymode.max"},{value:"custom",translation:"properties.axis.displaymode.custom"}]},maxVisibleItems:{type:"integer",translation:"properties.axis.maxvisiblevalues",ref:"dimensionAxis.maxVisibleItems",expression:"optional",defaultValue:10,show:e=>"custom"===e.dimensionAxis.axisDisplayMode,invalid(e,t,n){const{maxVisibleItems:r}=e.dimensionAxis,i=fy(n.layout),o=hy(n.layout);return r<0||r>1e4/(i.length+o.length)},globalChange(e,t,n){if("custom"===e.dimensionAxis.axisDisplayMode){const{maxVisibleItems:t}=e.dimensionAxis,r=fy(n.layout),i=hy(n.layout);t<1?e.dimensionAxis.maxVisibleItems=10:t>1e4/(r.length+i.length)&&(e.dimensionAxis.maxVisibleItems=Math.min(t,Math.floor(1e4/(r.length+i.length))))}}},hint:{component:"text",translation:"properties.axis.maxvisiblevalues.hint",style:"hint",show:e=>["custom","max"].indexOf(e.dimensionAxis.axisDisplayMode)>-1}}},continuousGroup:{items:{miniChart:null},show:!t?.("continuousData")}}},measureAxis:{uses:"axis.flippableMeasureAxis",label:(e,t)=>vy(t,n,"measure"),items:{axis:{items:{measureAxisTitle:{component:"header",type:"string",label:(e,t)=>vy(t,n,"measure"),classification:{section:"axis",tags:["simple"],exclusive:!0}},dock:{options(e,t,n){const r={value:"near",translation:"Common.Bottom"},i={value:"far",translation:"Common.Top"};return("vertical"!==n.layout.orientation||gy(n.layout))&&(r.translation=n.yMirrorMode?"properties.dock.right":"properties.dock.left",i.translation=n.yMirrorMode?"properties.dock.left":"properties.dock.right"),[r,i]}}}},scale:{type:"items",items:{logScale:{ref:"measureAxis.logarithmic",component:"buttongroup",type:"string",options:[{value:!1,label:n.get("properties.axis.linear"),tooltipTranslation:"properties.axis.linear"},{value:!0,label:n.get("properties.axis.logarithmic"),tooltipTranslation:"properties.axis.logarithmic"}],defaultValue:!1,classification:{section:"axis",tags:["simple"]}},label:{component:"text",translation:"properties.axis.logarithmicScaleNote",show:e=>!(!e.measureAxis||!e.measureAxis.logarithmic)}}},startAt:{type:"string",component:"dropdown",translation:"properties.axis.startAt",readOnly:e=>!(e.measureAxis.autoMinMax||"min"===e.measureAxis.minMax&&0===e.measureAxis.min),options:[{value:"zero",translation:"properties.axis.startAt.zero"},{value:"lowest",translation:"properties.axis.startAt.lowest"}],defaultValue:"lowest",convertFunctions:{get(e,t,n,r){const{autoMinMax:i,minMax:o,min:a}=r?.measureAxis||{};return!0===i?"lowest":i||"min"!==o||0!==a?e(t.type):"zero"},set(e,t,n,r,i){"zero"===e?(wu(i,"measureAxis.autoMinMax",!1),wu(i,"measureAxis.minMax","min"),wu(i,"measureAxis.min",0)):wu(i,"measureAxis.autoMinMax",!0)}},classification:{section:"axis",tags:["simple"],exclusive:!0}}}},tooltip:{uses:"tooltip"}}};var u;const d={type:"items",component:"accordion",items:{data:{uses:"data",items:{dimensions:{items:{nullSuppression:{show(e,n,r){if(t?.("includeZeroValues"))return!1;const i=n.layout?.qHyperCube?.qDimensionInfo?.findIndex(e=>dy(e));return!(n.properties?.qHyperCubeDef?.qDimensions?.[i]===e)||!gy(r.layout)}},visibilityCondition:{type:"string",component:"expression",ref:"qCalcCondition.qCond",expression:"optional",expressionType:"ValueExpr",translation:"Object.Chart.Dimensions.VisibilityCondition",defaultValue:{qv:""},tid:"visibilityCondition",isExpression:e=>"string"==typeof e&&e.trim().length>0}}},measures:{items:{visibilityCondition:{type:"string",component:"expression",ref:"qCalcCondition.qCond",expression:"optional",expressionType:"ValueExpr",translation:"Object.Chart.Measures.VisibilityCondition",defaultValue:{qv:""},tid:"visibilityCondition",isExpression:e=>"string"==typeof e&&e.trim().length>0},trendLines:o,styling:a}}}},sorting:{type:"items",translation:"properties.sorting",items:{noContinuousSortingMessage:{component:"text",translation:"properties.sorting.noContinuousSortingMessage",show:(e,t,n)=>gy(n.layout),classification:{section:"sorting",tags:["simple"]}},defaultSorting:{uses:"sorting",show:(e,t,n)=>!gy(n.layout),items:{dimensions:{locked:(e,t,n)=>1===n.getMeasures().length&&2===n.getDimensions().length,items:{autoSort:{change(e){_e(e)}}}},measures:{locked:(e,t,n)=>1===n.getMeasures().length&&2===n.getDimensions().length}}}}},addons:yy(e,n),settings:c}};return i?(d.items.data.items.dimensions.items.forecast={type:"items",translation:Zm,items:{steps:{translation:Qm,type:"integer",defaultValue:lg.NUM_STEPS,schemaIgnore:!0,show:ag,ref:"qDef.forecast.steps",min:1,rollbackInvalid:!0,globalChange:sg},stepSize:{translation:ig.TITLE,type:"number",defaultValue:lg.STEP_SIZE_MULTIPLIER,schemaIgnore:!0,show:ag,ref:"qDef.forecast.stepSizeMultiplier",min:Number.EPSILON,rollbackInvalid:!0},unit:{type:"string",component:"dropdown",ref:"qDef.forecast.stepSize",show:ag,options:[{value:lg.STEP_SIZE.SECONDS,translation:ig.SECONDS},{value:lg.STEP_SIZE.MINUTES,translation:ig.MINUTES},{value:lg.STEP_SIZE.HOURS,translation:ig.HOURS},{value:lg.STEP_SIZE.DAYS,translation:ig.DAYS},{value:lg.STEP_SIZE.WEEKS,translation:ig.WEEKS},{value:lg.STEP_SIZE.MONTHS,translation:ig.MONTHS},{value:lg.STEP_SIZE.YEARS,translation:ig.YEARS},{value:lg.STEP_SIZE.NUMBER,translation:ig.NUMBER}],defaultValue:lg.STEP_SIZE.DAYS}}},d.items.data.items.measures.items.forecast=pg(e)):d.items.data.items.dimensions.items.forecast={show:!1,globalChange:(e,t)=>{const{layout:n}=t;Xm({enabledForecast:!1,properties:e,layout:n})}},d}const xy={CUSTOM:{EXPRESSION:"customTooltipExpression",TITLE:"customTooltipTitle",DESCRIPTION:"customTooltipDescription",QUARANTINE:"customTooltip",IMAGES:"customTooltipImages"},CHART:{CONTAINER_ID:"tooltipContainerId",STATE:"customTooltipSessionState",CHART_OBJECT_ID:"customTooltipSessionObjectId",CHART_PARENT_TYPE:"TooltipChartParent",CHART_CHILD_TYPE:"TooltipChart",STYLE:{small:"140px",medium:"200px",large:"340px"}}};function Sy(e){const t=e.split("/");return"qmem:"===t[0]&&""===t[1]}const My={getImageSize(e,t){let n;function r(){n&&(clearTimeout(n),n=null)}function i(e){const t=e;t.onload=null,t.onerror=null,r()}const o={small:50,medium:200,large:340,original:340};return new Promise(a=>{const s=new Image;s.referrerPolicy="no-referrer",s.onload=()=>{let e;const{height:n,width:l}=s,c=o[t]*(n>l?1:n/l),u=o[t]*(l>n?1:l/n);!n||!l||0===n&&0===l?(e={height:20,width:20,imageError:!0},i(s)):"original"===t?(e={height:Math.min(c,n),width:Math.min(u,l)},r()):(e={height:c,width:u},r()),a(e)},s.onerror=()=>{i(s),a({height:20,width:20,imageError:!0})},s.src=e,n=setTimeout(()=>{i(s),a({height:20,width:20,imageError:!0})},3e3)})}};async function wy(e,t,n){let r=e.ref.qStaticContentUrl.qUrl;const i=function(e){let t,n,r,i,o,a;if(e&&(e.session?.options||e.enigmaModel?.session?.sessionConfig||e.session?.config?.url)){if(t=e.session.options||e.enigmaModel?.session.sessionConfig,!t){t=e.session?.config;const n=new URL(t.url);t.host=n.hostname,t.port=n.port,t.isSecure="wss:"===n.protocol}return a=void 0!==t.secure?t.secure:t.isSecure,n=a?"https://":"http://",r=t.host||"localhost",i=t.port?`:${t.port}`:"",o=t.prefix?t.prefix:"/","/"!==o[o.length-1]&&(o=`${o}/`),n+r+i+o}return""}(n);i&&(!function(e,t){const n=e.replace(t,"").replace(/^\.\.\//i,"/");n[0]}(r,i),r=r.replace(/"/g,'\\"'),r=r.replace(/'/g,"\\'"),r=function(e,t){return t+("/"===e[0]?e.substr(1):e)}(r,i));const{height:o,width:a,imageError:s}=await My.getImageSize(r,t);return{src:r,size:t,height:o,width:a,imageError:s}}async function ky(e,t,n,r){const{app:i,flags:o}=t,a=e.layout?.tooltip?.imageComponents;if(!a)return[];const[s]=a,l=s.size||"small",c=s.type||"media";let u=-1;for(let e=0;e<n.length;e++)if(n[e].cId===s.cId){u=e;break}const d=r.data?.customTooltipAttrExps?.value||[];let f;if(-1!==u&&d[u]&&(f=d[u]),"media"===c&&s.ref?.qStaticContentUrl?.qUrl)return wy(s,l,i);if("url"===c)return async function(e,t,n,r,i){let o,a=n.ref;if(i&&i.label&&(a=i.label),t.isEnabled("IMAGE_BUNDLE_LOAD")&&e?.getImage&&Sy(a))try{const t=`data:image/png;base64, ${await e.getImage(a)}`,{height:n,width:i,imageError:s}=await My.getImageSize(t,r);o={src:t,size:r,height:n,width:i,imageError:s}}catch{}else{const{height:e,width:t,imageError:n}=await My.getImageSize(a,r);o={src:a,size:r,height:e,width:t,imageError:n}}return o}(i,o,s,l,f);if(o.isEnabled("IMAGE_BUNDLE_LOAD")&&"field"===c&&f&&f.label){return async function(e,t,n,r){let i;const o=r.label,a=`qmem://${t.qFallbackTitle}/${o}`;if(Sy(a))try{const t=await e.getImage(a);if(t){const e=`data:image/png;base64, ${t}`,{height:r,width:o,imageError:a}=await My.getImageSize(e,n);i={src:e,size:n,height:r,width:o,imageError:a}}}catch{}return i}(i,n[u],l,f)}return[]}const Ey={async addImagesToTheNodes({customTooltipModel:e,nodes:t,attrExps:n,opts:r}){const i=t,o=[];for(let t=0;t<i.length;t++)o.push(ky(e,r,n,i[t]));const a=await Promise.all(o);for(let e=0;e<i.length;e++)i[e].data.customTooltipImages=[a[e]];return i},checkIfPromisesExist({customTooltipModel:e}){const t=e.layout?.tooltip?.imageComponents;return!!t&&t.length>0}},Cy={async handlePromises({customTooltipModel:e,nodes:t,attrExps:n,opts:r}){let i=t;return i=await Ey.addImagesToTheNodes({customTooltipModel:e,nodes:t,attrExps:n,opts:r}),i},checkIfPromisesExist:({customTooltipModel:e})=>Ey.checkIfPromisesExist({customTooltipModel:e})};const Ny=(e,t)=>{const n=e?.qHyperCubeDef?.qDimensions,r=e?.qHyperCubeDef?.qMeasures,i=e?.qHyperCubeDef?.qInterColumnSortOrder,o=t;return{qInfo:{qType:xy.CHART.CHART_PARENT_TYPE,qId:xy.CHART.CHART_OBJECT_ID},qHyperCubeDef:{qDimensions:n,qMeasures:r,qInterColumnSortOrder:i,qInitialDataFetch:[{qWidth:0,qHeight:0}]},qStateName:o}},Ty=e=>{const t=e.tooltip?.chart?.object?.refId;return{qInfo:{qType:xy.CHART.CHART_CHILD_TYPE},qExtendsId:t}};const Dy={createContainer:({ctx:e,layout:t})=>{if(!(t.qHyperCube?.qDimensionInfo?.length<=0))return function(e,t){const n=t.tooltip?.chart?.style?.size??"medium",r=xy.CHART.STYLE[n];return[{content:[e.h("div",{style:{display:"flex",width:r,height:r,backgroundColor:"#FFFFFF",borderRadius:"5px",padding:"2px",color:"#595959"},colspan:2,id:xy.CHART.CONTAINER_ID})],colspan:2,style:{"text-align":e.rtl?"right":"left","max-width":r}},{}]}(e,t)},show:async({app:e,properties:t,selectedNodes:n,dimIndex:r,customTooltipModel:i,rtl:o})=>{const a=i,s=t?.tooltip?.chart?.object?.refId;if(a?.embed&&e.removeSessionAlternateState&&e.addSessionAlternateState&&s&&!(t.qHyperCubeDef.qDimensions.length<=0)){await Dy.hide({app:e,customTooltipModel:i});try{await async function({app:e,properties:t,customTooltipModel:n}){const r=n,i=xy.CHART.STATE,o=t.qStateName;r.miniChartToken.alternateState||(r.miniChartToken.alternateState=i,await e.addSessionAlternateState(i,o),r.miniChartToken.alternateState=i)}({app:e,properties:t,customTooltipModel:i});const s=await async function({app:e,properties:t,customTooltipModel:n}){const r=n;r.miniChartToken.sessionObj?.id&&await e.destroySessionObject(r.miniChartToken.sessionObj.id);const i=xy.CHART.STATE,o=Ny(t,i),a=await e.createSessionObject(o),s=Ty(t);if(a.id!==xy.CHART.CHART_OBJECT_ID)return void e.destroySessionObject(a.id);r.miniChartToken.sessionObj=a;const l=await a.createChild(s);if(r.miniChartToken.sessionObj&&r.miniChartToken.sessionObj.id===a.id)return r.miniChartToken.model=l,l;e.destroySessionObject(a.id)}({app:e,properties:t,customTooltipModel:i});if(a.miniChartToken.alternateState&&a.miniChartToken.sessionObj&&s){const e=n.length>0&&void 0!==n[0].data?.value?[n[0].data?.value]:[],s=void 0!==r?r:t.qHyperCubeDef.qDimensions.length-1;if(2===t.qHyperCubeDef.qDimensions.length&&void 0===r&&n.length>0){const e=n[0].data.selectionOuterDimension??n[0].data.selectionDimension;if(e?.source?.field){const t=e?.source?.field.split("/"),n=t[t.length-1],r=void 0!==e.value?[e.value]:[];r.length>0&&void 0!==n&&a.miniChartToken.sessionObj.selectHyperCubeValues("/qHyperCubeDef",Number(n),r,!1)}}e.length>0&&a.miniChartToken.sessionObj.selectHyperCubeValues("/qHyperCubeDef",s,e,!1);const l=document.getElementById(xy.CHART.CONTAINER_ID),c={direction:o?"rtl":"ltr",isReadonly:!0,isPopover:!0,navigation:!1,selections:!1};a.miniChartToken.vis=await i.embed.render({element:l,model:a.miniChartToken.model,options:c,id:a.miniChartToken.model?.id,type:a.miniChartToken.model?.genericType})}}catch{await Dy.hide({app:e,customTooltipModel:i})}}},hide:async({app:e,customTooltipModel:t})=>{const n=t;n?.embed&&(Dy.destroyVisualization({customTooltipModel:t}),await e.destroySessionObject(xy.CHART.CHART_OBJECT_ID),n.miniChartToken.sessionObj=void 0,await async function({app:e,customTooltipModel:t}){const n=t,r=xy.CHART.STATE;n.miniChartToken.alternateState=void 0,await e.removeSessionAlternateState(r)}({app:e,customTooltipModel:t}))},destroyVisualization:({customTooltipModel:e})=>{const t=e;"function"==typeof t.miniChartToken?.vis?.destroy&&(t.miniChartToken.vis.destroy(),t.miniChartToken.vis=void 0)}};function qy(e){const t=e.qHyperCubeDef?e.qHyperCubeDef.qDimensions:e.qHyperCube.qDimensionInfo;if(t&&t.length>0)return t}function Oy(){const{EXPRESSION:e,TITLE:t,DESCRIPTION:n,IMAGES:r}=xy.CUSTOM,i={};return i[e]=!0,i[t]=!0,i[n]=!0,i[r]=!0,i}function Iy(e){const t=Oy();return e.filter(e=>t[e.id])}const Ay={getNodes(e,t){const n=function(e,t){let n=0,r=0;e.center?(n+=e.center.x,r+=e.center.y):(n+=e.clientX,r+=e.clientY);const i=t.element.getBoundingClientRect();return{cx:n-i.left,cy:r-i.top}}(e,t);return t.shapesAt({x:n.cx,y:n.cy})},getDataNodes(e,t){let n,r=[];const i={container:{bar:!0,"bullet-axis":!0},circle:{"point-component":!0}};return t.forEach(t=>{const o=t.data?.selectionDimension??t.data;if(!o||t.data?.customTooltipAttrExps||i[t.type]){if(t.data?.customTooltipAttrExps&&!t.data.customTooltipImages){const e=t;e.data.customTooltipImages=[],r.push(e)}}else{n||(n=[],Object.keys(i).forEach(t=>{n=n.concat(e.findShapes(t).filter(e=>e.data&&e.data.customTooltipAttrExps&&!e.data.customTooltipImages&&i[t][e.key]))}));const t=n.filter(e=>{const t=e.data.stack??e.data.selectionOuterDimension??e.data.selectionDimension;return t&&t.value===o.value&&t.label===o.label});t.length>0&&(r=r.concat(t[0]))}}),r},displayTooltip(e,t,{nodes:n,opts:r={},customTooltipModel:i,extractedNodes:o=[],hide:a}){if(i&&!a){const{layout:a,chart:s}=i,{attrExps:l}=Ay.getAttrExprData(a);o.length||n.length?Cy.handlePromises({customTooltipModel:i,nodes:Ay.getDataNodes(s,o.length>0?o:n),attrExps:l,opts:r}).then(()=>{t.emit("show",e,n.length?{nodes:n}:void 0)}):t.emit("show",e,n.length?{nodes:n}:void 0)}else i?.miniChartToken?.alternateState&&Dy.hide({app:r.app,customTooltipModel:i}),t.emit("hide")},checkIfPromisesExist:({customTooltipModel:e})=>Cy.checkIfPromisesExist({customTooltipModel:e}),getAttrExps(e,t){const n=t,r=e.qHyperCubeDef?.qDimensions?"qAttributeExpressions":"qAttrExprInfo";return n[r]||(n[r]=[]),n[r]},getAttrExprData(e){let t=[],n="";const r=e.qHyperCube?.qDimensionInfo||[];if(r.length>0){const i=r.length-1;t=e.qHyperCube?.qDimensionInfo?.[i]?.qAttrExprInfo||[],n=`qDimensionInfo/${i}/qAttrExprInfo`}return{attrExps:t,fieldPath:n}},quarantineCustomTooltipAttrs(e,t={}){const n=e.qLayoutExclude?.quarantine?.[xy.CUSTOM.QUARANTINE];if(!n){!function(e,t){const n=t;let r=n.qLayoutExclude;r||(n.qLayoutExclude={quarantine:{}},r=n.qLayoutExclude),r.quarantine||(r.quarantine={}),r.quarantine[xy.CUSTOM.QUARANTINE]=[],e.forEach(e=>{r.quarantine[xy.CUSTOM.QUARANTINE].push(e)}),n.qLayoutExclude=r}(Iy(t.qAttributeExpressions||[]),e)}},unquarantineCustomTooltipAttrs(e){const t=e,n=e.qLayoutExclude?.quarantine?.[xy.CUSTOM.QUARANTINE];n&&delete t.qLayoutExclude.quarantine[xy.CUSTOM.QUARANTINE]},setAttrsFromQuarantine(e,t){const n=qy(e);if(!n)return;const r=void 0!==t?t:n.length-1;if(!n[r])return;const i=this.getAttrExps(e,n[r]);if(0===Iy(i).length){const t=e.qLayoutExclude?.quarantine?.customTooltip||[],n=[...i,...t],o=e;o.qHyperCubeDef?o.qHyperCubeDef.qDimensions[r].qAttributeExpressions=n:o.qHyperCube.qDimensionInfo[r].qAttrExprInfo=n}},moveCustomTooltipAttrs(e,t={},n=void 0){let r=[];const i=qy(e)||[];[...i,t].forEach(e=>{const t=Iy(e.qAttributeExpressions||[]);t.length>0&&(r=t)});const o=Oy(),a=i.map(e=>{const t=e,n=e.qAttributeExpressions||[];return t.qAttributeExpressions=n.filter(e=>!o[e.id]),t}),s=void 0!==n?n:a.length-1;a.length>0&&(a[s].qAttributeExpressions=a[s].qAttributeExpressions.concat(r));const l=e;e.qHyperCubeDef?l.qHyperCubeDef.qDimensions=a:l.qHyperCube.qDimensionInfo=a},addCallbackCustomTooltip(e){e.qHyperCubeDef.qDimensions.length>1?this.moveCustomTooltipAttrs(e):(this.setAttrsFromQuarantine(e),this.unquarantineCustomTooltipAttrs(e))},moveCallbackCustomTooltip(e,t){1===e.qHyperCubeDef.qDimensions.length&&(this.setAttrsFromQuarantine(e),this.unquarantineCustomTooltipAttrs(e)),e.qHyperCubeDef.qDimensions.length>1&&this.moveCustomTooltipAttrs(e,t)},removeCallbackCustomTooltip(e,t){e.qHyperCubeDef.qDimensions.length>0?this.moveCustomTooltipAttrs(e,t):this.quarantineCustomTooltipAttrs(e,t)},replaceCallbackCustomTooltip(e,t){e.qHyperCubeDef.qDimensions.length>1?this.moveCustomTooltipAttrs(e,t):(this.quarantineCustomTooltipAttrs(e,t),this.setAttrsFromQuarantine(e),this.unquarantineCustomTooltipAttrs(e))},shouldIgnoreDefaultRows:e=>e.tooltip?.hideBasic||0,DEBOUNCE_THRESHOLD:50,getFooterRow:(e,t)=>[{content:e,style:{"font-style":"italic","font-size":"12px","line-height":"16px",color:"rgba(255, 255, 255, 0.6)","text-align":t?"right":"left",direction:_.detectTextDirection(e)},colspan:2},{}],getImageRow(e,t){const n=_.detectTextDirection(e.src),r=[],i={style:{display:"block","margin-left":"auto","margin-right":"auto",overflow:"hidden",width:e.width,height:e.height}};if("original"===e.size||e.imageError){r.push(t.h("span",{style:{display:"inline-block",height:"100%","vertical-align":"middle"}}));const n=e.imageError?`${e.src}?${Math.random()}`:e.src;r.push(t.h("img",{style:{"max-width":e.width,"max-height":e.height,"vertical-align":"middle"},src:n,referrerpolicy:"no-referrer"})),i.style["text-align"]="center",i.style["white-space"]="nowrap"}else i.style["background-size"]="contain",i.style["background-repeat"]="no-repeat",i.style["background-position"]="center",i.style["background-image"]=`url('${e.src}')`;return[{content:[t.h("div",i,r),""],style:{"text-align":t.rtl?"right":"left",direction:n,"max-width":e.width},colspan:2},{}]}};function _y(e,t,n,r){const i=t.qHyperCube?.[n]?.[r]?.qAttrExprInfo||[],o=[],a=e.qSubNodes&&e.qSubNodes[r]?e.qSubNodes[r].qAttrExps:e.qAttrExps;return a?(i.forEach((e,t)=>{const i=a.qValues&&a.qValues[t]?a.qValues[t]:void 0,s=void 0===i?"NaN":function(e,t){let n;switch(e.id){case xy.CUSTOM.EXPRESSION:n="NaN"===t.qNum||e.isCustomFormatted?void 0===t.qText?"NaN":t.qText:t.qNum;break;case xy.CUSTOM.TITLE:case xy.CUSTOM.DESCRIPTION:case xy.CUSTOM.IMAGES:n=void 0===t.qText?e.qFallbackTitle:t.qText;break;default:n="NaN"}return n}(e,i);o.push({source:{key:"qHyperCube",field:`${n}/${r}/qAttrExprInfo/${t}`},label:s,value:"value"})}),o):o}const Ly={getNode(e,{dimensionCount:t}){if(!t||t<1)return;const n=t-1,r="qDimensionInfo";return{field:`${r}/${n}`,value:t=>_y(t,e,r,n)}}};const Py={getCustomAttrExps(e,t,n){const r={customTooltipAttrExpsArr:[],customTooltipInfoAttrExpsArr:[]},i=t.data?.customTooltipAttrExps?.value||[];if(Number.isNaN(i))return r;return function(e,t,n,r){const i={[xy.CUSTOM.TITLE]:!0,[xy.CUSTOM.DESCRIPTION]:!0},{attrExps:o,fieldPath:a}=Ay.getAttrExprData(e);return 0===t.length||0===o.length||""===a||o.forEach((e,o)=>{const s=t[o];if(e.id===xy.CUSTOM.EXPRESSION&&s){const t=e.qFallbackTitle,i="NaN"===s.value||e.isCustomFormatted?s.value:n("qHyperCube").field(`${a}/${o}`).formatter()(s.value);r.customTooltipAttrExpsArr.push({label:t,value:i})}else if(i[e.id]&&s){const t="-"!==s.value&&"NaN"!==s.value?s.value:s.label;t&&"undefined"!==t&&r.customTooltipInfoAttrExpsArr.push({...e.id===xy.CUSTOM.TITLE&&{title:t},value:t,id:e.id})}}),r}(n,i.map(t=>L.getMeasure(e,t)),e,r)}};function Ry({nodes:e,layout:t,dataset:n}){const r=function(e,t,n){const r=[];return e.forEach(e=>{r.push(Py.getCustomAttrExps(n,e,t))}),r}(e,t,n);return r.reduce((e,t)=>({customTooltipAttrExpsArr:e.customTooltipAttrExpsArr.concat(t.customTooltipAttrExpsArr),customTooltipInfoAttrExpsArr:e.customTooltipInfoAttrExpsArr.concat(t.customTooltipInfoAttrExpsArr)}),{customTooltipAttrExpsArr:[],customTooltipInfoAttrExpsArr:[]})}const{CUSTOM:Fy}=xy;function zy({flags:e,layout:t,app:n,model:r,picasso:i,chart:o,translator:a,localeInfo:s,embed:l,options:c}){const u={properties:void 0},d=function({layout:e,app:t,picasso:n,model:r,chart:i,translator:o,localeInfo:a,embed:s}){return{layout:e,app:t,picasso:n,model:r,chart:i,translator:o,localeInfo:a,useCustomTooltip:e.tooltip&&!e.tooltip.auto,utils:Ay,miniChartToken:{},embed:s}}({layout:t,app:n,model:r,picasso:i,chart:o,translator:a,localeInfo:s,embed:l}),f="rtl"===c.direction,h=()=>{const e=!!u.properties?.qHyperCubeDef?.qDimensions.some(e=>e.qCalcCondition?.qCond?.qv);return!(!t.tooltip||t.tooltip.auto||e)};return{setProperties:e=>{u.properties=e},isEnabled:()=>h(),hideBasic:()=>h()&&Su(t,"tooltip.hideBasic",!1),getAttributes:({dataset:e,nodes:n})=>{const r=Ry({dataset:e,nodes:n,layout:t});return{title:r.customTooltipInfoAttrExpsArr.find(e=>e.id===Fy.TITLE)?.title,description:r.customTooltipInfoAttrExpsArr.find(e=>e.id===Fy.DESCRIPTION)?.value,measures:r.customTooltipAttrExpsArr}},hasImages:()=>Ay.checkIfPromisesExist({customTooltipModel:d}),createImageRow:({value:e,h:t})=>Ay.getImageRow(e,{h:t,rtl:f}),addImages:({nodes:r})=>{const i=Ay.getDataNodes(o,r),{attrExps:a}=Ay.getAttrExprData(t);return Cy.handlePromises({customTooltipModel:d,nodes:i,attrExps:a,opts:{flags:e,app:n}})},chart:{isEnabled:()=>!!(h()&&t.tooltip?.chart?.object?.refId&&l&&"function"==typeof r?.getEffectiveProperties),hasLimitation:()=>!!n?.isInModalSelection?.(),createContainer:({h:e})=>Dy.createContainer({layout:t,ctx:{h:e,rtl:f}}),createLimitationRow:()=>Ay.getFooterRow(a.get("properties.tooltip.notselectedmessage"),f),show:({nodes:e,properties:t})=>Dy.show({app:n,properties:t,selectedNodes:e,customTooltipModel:d,rtl:f}),hasAlternateState:()=>!!d.miniChartToken?.alternateState,hide:()=>Dy.hide({app:n,customTooltipModel:d}),destroy:()=>Dy.destroyVisualization({customTooltipModel:d})}}}const jy=e=>e.qHyperCube.qDimensionInfo.filter(e=>(e=>e.qError?.qErrorCode!==ay)(e)),$y=e=>{const{qDimensions:t,qMeasures:n}=e.qHyperCubeDef,{qInterColumnSortOrder:r}=e.qHyperCubeDef;if(1===t.length&&1===n.length)0!==r[0]&&y.moveArrayElement(r,1,0);else if(t.length>1&&1===n.length){const e=r.indexOf(0);0!==e&&y.moveArrayElement(r,e,0)}},Vy=e=>{const t=e.qHyperCubeDef.qDimensions,n=e.qHyperCubeDef.qMeasures,{color:{mode:r}}=e;t.length>1&&wu(e,"color.persistent",!0),"byMeasure"===r&&t.length>1?wu(e,"color.mode","byDimension"):("byDimension"===r&&t.length<=1&&n.length<=1||"byExpression"===r&&0===n.length)&&wu(e,"color.mode","primary")};function Uy({translator:e}){return{dimensions:{min:1,max:e=>e>=2?1:2,description(t,n,r,i){let o;return o=(i?jy(i.layout).length:t.qHyperCubeDef.qDimensions.length)>1&&0===n?"area"===t.lineType&&!0===t.stackedArea?"Visualizations.Descriptions.Stack":"Visualizations.Descriptions.Group":"area"===t.lineType?"Visualizations.Descriptions.Area":"Visualizations.Descriptions.Line",e.get(o)},added(e,t){t.qHyperCubeDef.qDimensions.length>1&&(t.qHyperCubeDef.qMode="K",t.qHyperCubeDef.qAlwaysFullyExpanded=!0),$y(t),Vy(t),Ay.addCallbackCustomTooltip(t)},moved(e,t,n){jy(n.layout).length>1&&(t.qHyperCubeDef.qMode="K",t.qHyperCubeDef.qAlwaysFullyExpanded=!0),$y(t),Vy(t),Ay.moveCallbackCustomTooltip(t,e)},removed(e,t){const n=t.qHyperCubeDef.qDimensions;Vy(t),1===n.length&&(t.qHyperCubeDef.qMode="S"),Ay.removeCallbackCustomTooltip(t,e)},replaced(e,t,n,r){Ay.replaceCallbackCustomTooltip(r,t)}},measures:{min:1,max:e=>e>=2?1:15,description:()=>e.get("Visualizations.Descriptions.HeightLine"),added(e,t){$y(t),Vy(t),function(e,t){const n=(t.qHyperCubeDef.qMeasures||[]).concat(t.qHyperCubeDef.qLayoutExclude?.qHyperCubeDef?.qMeasures||[]).filter(e=>e.qDef.forecast?.enabled);e.qDef.forecast?.enabled&&n.length>1&&(e.qDef.forecast.enabled=!1)}(e,t)},moved(e,t){$y(t),Vy(t)},removed(e,t){const n=t.qHyperCubeDef.qDimensions;Vy(t),n.length>1?(t.qHyperCubeDef.qMode="K",t.qHyperCubeDef.qAlwaysFullyExpanded=!0):1===n.length&&(t.qHyperCubeDef.qMode="S")}}}}const Hy=e=>e.qError?.qErrorCode!==ay,By=e=>e.qHyperCube.qDimensionInfo.filter(e=>Hy(e)),Wy=e=>e.qHyperCube.qMeasureInfo.filter(e=>Hy(e));function Yy({isCloud:e}){const t={type:"items",component:"accordion",items:{data:{uses:"data",items:{dimensions:{items:{}},measures:{items:{}}}},sort:{uses:"sort",show:(e,t)=>!S.continuous({layout:t,auto:()=>p.isTime(!0,t)}),items:{dimensions:{locked:(e,t,n)=>2===By(n).length&&1===Wy(n).length},measures:{locked:(e,t,n)=>2===By(n).length&&1===Wy(n).length}}},presentation:{uses:"presentation",items:{valueLabels:{type:"string",component:"radio-list",translation:"properties.dataPoints.labelmode",diffs:["dataPoint.show","dataPoint.showLabels"],options:[{value:"none",translation:"Common.None"},{value:"auto",translation:"Common.Auto"},{value:"all",translation:"Common.All"}],setPropertyValue(e,t){e.dataPoint.show=!0===t||"auto"===t||"all"===t,e.dataPoint.showLabels=t},getValue(e){const{showLabels:t}=e?.dataPoint||{};return!1===t?"none":!0===t?"auto":t}},orientation:{ref:"orientation",type:"string",component:"item-selection-list",defaultValue:"horizontal",horizontal:!0,items:[{component:"icon-item",icon:"direction_up_down",labelPlacement:"bottom",translation:"properties.orientation.vertical",value:"vertical"},{component:"icon-item",icon:"direction_left_right",labelPlacement:"bottom",translation:"Common.Horizontal",value:"horizontal"}],show:(e,t)=>!(e=>S.continuous({layout:e,auto:()=>p.isTime(!0,e)}))(t)},lineType:{ref:"lineType",type:"string",component:"item-selection-list",horizontal:!0,items:[{icon:"line_chart_line",component:"icon-item",labelPlacement:"bottom",translation:"properties.style.line",value:"line"},{icon:"line_chart_area",component:"icon-item",labelPlacement:"bottom",translation:"properties.style.area",value:"area"}]},logarithmic:{type:"boolean",component:"switch",translation:"properties.axis.logarithmicScale",ref:"measureAxis.logarithmic",options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}]}}},color:{uses:"color",items:{mode:{options(e,t){const{length:n}=By(t.layout),{length:r}=Wy(t.layout),i=[{value:"auto",translation:"Common.Auto"},{value:"primary",translation:"properties.colorMode.primary"}];return r>1&&i.push({value:"byMultiple",translation:"properties.colorMode.multicolored"}),n>1&&i.push({value:"byDimension",translation:"properties.colorMode.byDimension"}),n<=1&&i.push({value:"byMeasure",translation:"properties.colorMode.byMeasure"}),i}}}}}};return e&&(t.items.data.items.dimensions.items.forecast={type:"items",translation:Zm,items:{steps:{translation:Qm,type:"integer",defaultValue:yg.NUM_STEPS,schemaIgnore:!0,show:mg,ref:"qDef.forecast.steps",min:1,rollbackInvalid:!0,globalChange:gg},stepSize:{translation:ig.TITLE,type:"number",defaultValue:yg.STEP_SIZE_MULTIPLIER,schemaIgnore:!0,show:mg,ref:"qDef.forecast.stepSizeMultiplier",min:Number.EPSILON,rollbackInvalid:!0},unit:{type:"string",component:"dropdown",ref:"qDef.forecast.stepSize",show:mg,options:[{value:yg.STEP_SIZE.SECONDS,translation:ig.SECONDS},{value:yg.STEP_SIZE.MINUTES,translation:ig.MINUTES},{value:yg.STEP_SIZE.HOURS,translation:ig.HOURS},{value:yg.STEP_SIZE.DAYS,translation:ig.DAYS},{value:yg.STEP_SIZE.WEEKS,translation:ig.WEEKS},{value:yg.STEP_SIZE.MONTHS,translation:ig.MONTHS},{value:yg.STEP_SIZE.YEARS,translation:ig.YEARS},{value:yg.STEP_SIZE.NUMBER,translation:ig.NUMBER}],defaultValue:yg.STEP_SIZE.DAYS}}},t.items.data.items.measures.items.forecast={type:"items",translation:Zm,items:{enabled:{translation:Zm,type:"boolean",ref:"qDef.forecast.enabled",component:"switch",defaultValue:!1,options:[{value:!0,translation:"properties.on"},{value:!1,translation:"properties.off"}],show:Lm,readOnly:Im},method:{translation:eg,type:"string",ref:"qDef.forecast.method",component:"dropdown",defaultValue:vg,options:[{value:"ssa_forecast",translation:tg},{value:"ols_forecast",translation:ng}],show:Fm},disclaimer:{translation:rg,component:"text",show:Im}}}),t}function Gy(e){const t={},n=Su(e,"tooltip");if(n){t.chart_tooltip_custom=!n.auto;const e=Su(n,"chart.object.refId");!n.auto&&e&&(t.chart_tooltip_custom_mini_chart=e)}return t}const Ky={ACCUMULATIONS:"accumulation",MOVING_AVERAGE:"movingAverage",DIFFERENCE:"difference",NORMALIZATION:"normalization",TIME_SERIES_DECOMPOSITION:"timeSeriesDecomposition"},Xy=e=>!!(e&&e.qHyperCube.qSize.qcy>0),Jy=()=>{const e=[];return Object.keys(Ky).forEach(t=>{e.push(Ky[t])}),e};function Zy(e){const{flags:t={isEnabled:()=>!1},isUnsupportedFeature:n=()=>!1,translator:r,sense:i,anything:o}=e,a=i?.theme,s=o?.platform?.isCloud;return{definition:by({flags:t,isUnsupportedFeature:n,translator:r,theme:a,isCloud:s}),softDefinition:Yy({isCloud:s}),support:{snapshot:Xy,export:Xy,exportData:!0,sharing:Xy,viewData:!0,effects:!0,modifiers:Jy()},importProperties:(t,n,r,i)=>{r.mapProperties({layout:{templateId:n.templateId}});const o={defaultDimension:r.getDefaultDimensionProperties(),defaultMeasure:r.getDefaultMeasureProperties()},a=Mg.axisChart.importProperties({exportFormat:t,initialProperties:n,dataDefinition:Uy(e),defaultPropertyValues:o,hypercubePath:i,extension:r}),{qProperty:s}=a;s.qHyperCubeDef.qDimensions.length>1&&(s.qHyperCubeDef.qMode="K");const{qDimensions:l,qMeasures:c}=s.qHyperCubeDef;return s.color&&"byDimension"===s.color.mode&&l.length<=1&&c.length<=1&&(s.color.mode="primary"),Mg.conditionalShow.unquarantine(s),Mg.conditionalShow.unquarantineAlternative(s),a},exportProperties:(e,t,n)=>{Mg.conditionalShow.quarantine(e.qProperty),Mg.conditionalShow.quarantineAlternative(e.qProperty),Dm(e?.qProperty);const r=Mg.axisChart.exportProperties({propertyTree:e,hypercubePath:t,viewDataMode:n}),{showLabels:i}=r.properties.dataPoint;return r.properties.dataPoint.showLabels=!0===i||"auto"===i||"all"===i,r},onSoftPropertyChange(e,t,n){Km(t,{layout:n})},migrate:{properties:e=>(e.qExtendsId||(function(e){e.qHyperCubeDef.qDimensions.forEach(_e),e.qHyperCubeDef.qLayoutExclude?.qHyperCubeDef?.qDimensions&&e.qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions.forEach(_e)}(e),function({properties:e}){const{scrollbar:t,dimensionAxis:n,preferContinuousAxis:r,showMiniChartForContinuousAxis:i}=e;if(t||!1!==i)return;const{continuousAuto:o}=n;(o||!o&&r)&&(e.scrollbar=Up.OPTIONS.NONE.value)}({properties:e})),e)},extendMetrics:Gy}}function Qy(e){return{properties:{version:"2.6.0",color:{auto:!0,autoMinMax:!0,byDimDef:void 0,byMeasureDef:void 0,colorExpression:void 0,dimensionScheme:"12",expressionIsColor:!0,expressionLabel:"",formatting:{numFormatFromTemplate:!0,isCustomFormatted:void 0},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},components:[],dataPoint:{show:!1,showLabels:!1},dimensionAxis:{axisDisplayMode:"auto",continuousAuto:!0,dock:"near",label:"auto",maxVisibleItems:10,show:"all"},footnote:"",gridLine:{auto:!0,spacing:2},legend:{dock:"auto",show:!0,showTitle:!0},lineType:"line",measureAxis:{autoMinMax:!0,dock:"near",logarithmic:!1,max:10,min:0,minMax:"min",show:"all",spacing:1},orientation:"horizontal",preferContinuousAxis:!0,qHyperCubeDef:{qAlwaysFullyExpanded:!0,qDimensions:[],qMeasures:[],qInitialDataFetch:[{qWidth:17,qHeight:500}],qSuppressMissing:!0,qSuppressZero:!1,qDynamicScript:[]},refLine:{refLines:[],dimRefLines:[]},scrollbar:"miniChart",scrollStartPos:0,separateStacking:!0,showDetails:!0,showDisclaimer:!0,showMiniChartForContinuousAxis:!0,stackedArea:!1,nullMode:"gap",showTitles:!0,subtitle:"",title:"",tooltip:{auto:!0,hideBasic:!1,title:"",description:"",chart:void 0,imageComponents:void 0}},data:{targets:[{path:"/qHyperCubeDef",...Uy(e)}]}}}const ev=e=>"[object Object]"===Object.prototype.toString.call(e),tv=e=>Array.isArray(e);function nv(e,t){if(e===t)return!0;if(tv(e)){if(!tv(t))return!1;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!nv(e[n],t[n]))return!1;return!0}if(ev(e)){if(!ev(t))return!1;const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r=0;r<n.length;r++){if(!Object.hasOwn(t,n[r]))return!1;if(!nv(e[n[r]],t[n[r]]))return!1}return!0}return e===t}function rv({enable:t=!0}={}){const n=e.useModel(),r=()=>Date.now().toString()+Math.random(),[i,o]=e.useState(r()),a={properties:void 0};return e.useEffect(()=>{if(!n||!n.getEffectiveProperties||!t)return()=>{};const e=()=>{n.getEffectiveProperties().then(e=>{const t=l(!0,{},e);if(!a.properties)return void(a.properties=t);const n=function(e,t){const n={properties:!1,exclude:!1};if(e===t)return n;const r=l(!0,{},e),i=l(!0,{},t);return n.exclude=!nv(r.qHyperCubeDef?.qLayoutExclude,i.qHyperCubeDef?.qLayoutExclude),delete r.qHyperCubeDef?.qLayoutExclude,delete i.qHyperCubeDef?.qLayoutExclude,n.properties=!nv(r,i),n}(a.properties,t);a.properties=t,n.exclude&&!n.properties&&o(r())})};return n.on("changed",e),e(),()=>{n.removeListener("changed",e)}},[t]),i}function iv(e){return!e.qHyperCube.qError&&e.qHyperCube.qMeasureInfo.some(e=>e.qAttrExprInfo.some(e=>"forecast"===e.id))}function ov({model:e,properties:t,layoutService:n}){const r=l(!0,{},t);((e,t)=>{const{qDimensionInfo:n,qMeasureInfo:r}=t.qHyperCube,{color:{mode:i}}=e;n.length>1&&wu(e,"color.persistent",!0),"byMeasure"===i&&n.length>1?wu(e,"color.mode","byDimension"):("byDimension"===i&&n.length<=1&&r.length<=1||"byExpression"===i&&0===r.length)&&wu(e,"color.mode","primary")})(t,n.getLayout());const{dimensionCount:i,isContinuous:o}=n.meta;o||1===i?t.qHyperCubeDef.qMode="S":2===i&&(t.qHyperCubeDef.qMode="K");const a=n.getLayout();return e.colorSupport?.colorByUpdater?.(t,"qHyperCubeDef.",a),function({properties:e,layoutService:t}){const{filteredFields:n}=t.meta;if(!(n.measures.length>0))return;const{mode:r}=e.color||{};if("byExpression"===r){const r=t.getLayout();if("colorByExpression"===r.qHyperCube.qMeasureInfo?.[0]?.qAttrExprInfo?.[0]?.id)return;const{current:i,target:o}=function({properties:e,filtered:t}){const{qMeasures:n}=e.qHyperCubeDef||[],{current:r,target:i}=n.reduce((e,n,r)=>("colorByExpression"===n.qAttributeExpressions[0]?.id&&(e.current=r),void 0!==e.target||t.includes(r)||(e.target=r),e),{current:void 0,target:void 0});return{current:r,target:i}}({properties:e,filtered:n.measures});if(void 0===i)return;const a=e.qHyperCubeDef.qMeasures[i].qAttributeExpressions[0];e.qHyperCubeDef.qMeasures[i].qAttributeExpressions.splice(0,1),e.qHyperCubeDef.qMeasures[o].qAttributeExpressions.splice(0,0,a)}}({properties:t,layoutService:n}),!Bi.compare(r,t,!0)&&JSON.stringify(r)!==JSON.stringify(t)&&(t.hash=Math.random(),!0)}function av({app:e,model:t,properties:n,layoutService:r}){const i=l(!0,{},n),o=r.getLayout();return{shouldUpdate:()=>function({model:e,properties:t,layoutService:n}){const r=n.getLayout();return!!Xm({enabledForecast:iv(r),properties:t,layout:r})||ov({model:e,properties:t,layoutService:n})}({model:t,properties:n,layoutService:r}),update:async()=>(e=>!(!e||e.qHasSoftPatches||e.qExtendsId||!((e.qMeta?.privileges||[]).indexOf("update")>-1)))(o)?t.setProperties(n).then(()=>{e.clearUndoBuffer()}):((e,t,n)=>{if(!e)return Promise.resolve();let r=Bi.generate(t,n);return l(!0,t,n),r&&r.length?(r=r.map(e=>({qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path})),e.applyPatches(r,!0)):Promise.resolve()})(t,i,n)}}var sv={MAX_NUM_POINTS:5e4,DEFAULT_NUM_POINTS:2e3,DEFAULT_NUM_LINES:12};const{DEFAULT_NUM_POINTS:lv}=sv;function cv({layoutService:e,largeDataService:t}){const{maxNumPoints:n=lv}=t?.meta||{},{qHyperCube:r}=e.getLayout();return r.qSize.qcy*r.qMeasureInfo.length>n}const{DEFAULT_NUM_LINES:uv}=sv,dv=({layoutService:e,largeDataService:t})=>{const{maxNumLines:n=uv}=t?.meta||{},{qHyperCube:r}=e.getLayout();return r.qDimensionInfo.length>1&&!cv({layoutService:e,largeDataService:t})?e.meta.size.dimensions[1]+1:n},{DEFAULT_NUM_POINTS:fv}=sv,{MAX_NUM_POINTS:hv,DEFAULT_NUM_POINTS:pv,DEFAULT_NUM_LINES:mv}=sv,{DEFAULT_NUM_POINTS:gv}=sv,yv=({layoutService:e,largeDataService:t})=>{if(!cv({layoutService:e,largeDataService:t})){const{maxNumPoints:e=gv}=t?.meta||{};return e}const{dimensionCount:n}=e.meta;return n>1?(({layoutService:e,largeDataService:t})=>{const{dimensions:n=[]}=e?.meta?.size||{},{maxNumLines:r=mv,maxNumPoints:i=pv,hasInjectedData:o=!1}=t?.meta||{};if(dv({layoutService:e,largeDataService:t})*n[0]<=i)return n[0];const a=Math.max(1,Math.min(r,n[1])),s=i/a,l=Math.floor(n[0]<=s?s:s/4),c=2*a*(a+1);return o&&(a>mv||i>pv)?Math.min(l,Math.ceil(hv/c)):l})({layoutService:e,largeDataService:t}):(({layoutService:e,largeDataService:t})=>{const{maxNumPoints:n=fv}=t?.meta||{},{measureCount:r=1}=e?.meta||{},i=4+2*(r-1);return Math.floor(n/(r*i))})({layoutService:e,largeDataService:t})};function vv({model:e,layoutService:t,largeDataService:n,definitionPath:r="/qHyperCubeDef"}){return{shouldFetchReduced:()=>cv({layoutService:t,largeDataService:n}),computeNbrOfBins:()=>yv({layoutService:t,largeDataService:n}),computeMaxNumberLines:()=>dv({layoutService:t,largeDataService:n}),fetch:(i,o)=>(({start:e,end:t,model:n,layoutService:r,largeDataService:i,definitionPath:o})=>{const a={qStart:e,qEnd:t,qNbrPoints:yv({layoutService:r,largeDataService:i}),qMaxNbrTicks:300,qMaxNumberLines:dv({layoutService:r,largeDataService:i})};return n.getHyperCubeContinuousData(o,a,!1)})({start:i,end:o,model:e,layoutService:t,largeDataService:n,definitionPath:r})}}function bv(e={}){const{cache:t={}}=e;return{fetch:()=>Promise.resolve(t.merged)}}function xv({layoutService:e,viewCache:t}){return{fetch:()=>{const{qAxisData:t,qDataPages:n}=e.getHyperCube();return Promise.resolve({qAxisData:t,qDataPages:n})},getSnapshotData(){const n=e.getLayoutValue("snapshotData.content.chartData",{});return"zoom"in n&&"min"in n.zoom&&"max"in n.zoom?function({zoom:e}){return{zoom:e}}(n):function({scrollOffset:e=0,viewRange:t=0},n){let r=n+e,i=r+t;return 1===t&&0===e&&(r=n-.5,i=n+.5),{zoom:{min:r,max:i}}}(n,t.get("continuousMin"))}}}function Sv(){const e=()=>{},t=[],n={};return e.set=(e,r)=>{const i=t.indexOf(e);i>-1&&t.splice(i,1),t.push(e),n[e]=r},e.forEach=e=>{t.forEach((t,r)=>e(n[t],r))},e.has=e=>e in n,e}function Mv(e,t,n){return n[0]&&n[0][1]&&n[0][1].qElemNumber>-1?function({start:e,end:t,matrix:n}){const r=[],i=Sv(),o=Sv();for(let a=0;a<n.length;a++){const s=n[a],l=s[1].qElemNumber.toString();s[0].qNum<e?i.set(l,s):s[0].qNum>t&&(o.has(l)||o.set(l,s)),s[0].qNum>=e&&s[0].qNum<=t&&r.push(s)}return i.forEach((e,t)=>r.splice(t,0,e)),o.forEach(e=>r.push(e)),r}({start:e,end:t,matrix:n}):function({start:e,end:t,matrix:n}){const r=[];let i,o;for(let a=0;a<n.length;a++){const s=n[a];s[0].qNum<e?i=s:s[0].qNum>t&&(o||(o=s)),s[0].qNum>=e&&s[0].qNum<=t&&r.push(s)}return i&&r.unshift(i),o&&r.push(o),r}({start:e,end:t,matrix:n})}function wv(e,t){return{...e,qWidth:t[0]?t[0].length:0,qHeight:t.length}}function kv(e,t,n){const r={qDataPages:(n.qDataPages||[]).map(n=>{const r=Mv(e,t,n.qMatrix),i=wv(n.qArea,r);return{...n,qArea:i,qMatrix:r}})};return n.qAxisData&&n.qAxisData.qAxis&&(r.qAxisData=function(e,t,n){return{qAxis:n.qAxis.map(n=>({qName:n.qName,qTags:n.qTags,qTicks:n.qTicks.reduce((n,r)=>((r.qStart>=e&&r.qStart<=t||r.qEnd>=e&&r.qEnd<=t||r.qStart<e&&r.qEnd>t)&&n.push(r),n),[])}))}}(e,t,n.qAxisData)),r}const Ev=2**.5,Cv=1/Ev,Nv=Cv**44;function Tv(e){return e.qIsOtherCell}function Dv({qDataPages:e=[]}={},t={}){const n=e.length?e[0].qMatrix:[];return t.isStackedByDimension?function(e){const t={};return e.forEach(e=>{if(!e.some(Tv)){const n=e[0].qElemNumber;t[n]=void 0}}),Object.keys(t).length}(n):function(e){let t=0;return e.forEach(e=>{e.some(Tv)||t++}),t}(n)}const qv={query:{getShouldProcess:()=>!1},command:{processDataPage:()=>{}}};var Ov={created(){this.state={}},beforeUpdate(){this.state={}},beforeRender({size:e}){this.state.ticks=this.scale.ticks({distance:e.width}).filter(e=>!e.isMinor),"linear"===this.scale.type&&function(e,t){const[,n]=e.domain();for(let e=0;e<t.length;e++){const r=t[e],i=t[e+1];r.data={},i||1===r.end?i?(r.data.start=r.value,r.data.end=i.value,r.end=i.position):(r.data.start=r.value,r.data.end=r.value):(r.data.start=r.value,r.data.end=n,r.end=1)}}(this.scale,this.state.ticks)},render(){const e=this.scale.data().fields.length?this.scale.data().fields[0].id():"",{ticks:t}=this.state,n=t.map(t=>({type:"rect",fill:"none",data:{source:{field:e},value:[t.data.start,t.data.end]},x:t.start*this.rect.width,y:0,width:(t.end-t.start)*this.rect.width,height:this.rect.height}));if(t.length&&t[0].start>0){const r=t[0];n.unshift({type:"rect",fill:"none",data:{source:{field:e},value:[this.scale.domain()[0],r.data.start]},x:0,y:0,width:r.start*this.rect.width,height:this.rect.height})}return n}};function Iv(e,t=1){if(t%2==0)return e;let n=Math.round(e);return e-n>0?n+=.5:n-=.5,n}function Av(e,t){return e.x<t.x?e.x+e.width>=t.x:t.x+t.width>=e.x}function _v(e,t){const{localProps:{size:n},props:{anchor:r}}=t,i=function({props:e,localProps:{size:t},style:n,renderer:r}){const i=e.label.padding,o=Math.max(0,Math.min(e.label.justify,1)),a=Math.max(0,Math.min(e.label.align,1)),s=e=>r.measureText({text:e,fontSize:n.label.fontSize,fontFamily:n.label.fontFamily});return{resolve:(e,r)=>{const l="string"==typeof e.label?e.label:"",c=s(l);let{x:u,width:d}=r;e.start===e.end&&(d=c.width+2*i,1===e.end&&(u-=d));const f={x:u+i,y:i,width:d-2*i,height:t.height-2*i},h=s(`${l[0]}…`).width,p=Math.max(0,f.width-c.width),m=Math.max(0,f.height-c.height),g=o*p,y=a*m;return{show:f.width>=Math.min(h,c.width),text:l,dx:g,dy:y,rect:f,style:n.label,segment:{x:u+g,width:c.width+2*i},tickValue:e.value}}}}(t),o=function({localProps:{size:e},style:t,scale:n,props:r}){const[i,o]=n.domain(),a=Math.max(0,Math.min(1,r.guideLine.major.justify));return{resolve:(n,r)=>{const s=a*r.width,l=Iv(r.x+s,t.majorGuideLine.strokeWidth);return{show:n.value>=i&&n.value<=o,x1:l,y1:0,x2:l,y2:Iv(e.height,t.majorGuideLine.strokeWidth),style:t.majorGuideLine,tickValue:n.value}}}}(t),a=e.map(e=>{const t=function(e,t,n){const r=Math.abs(Math.max(e.start,0)-Math.min(e.end,1))*t.width;return{x:Math.max(e[n],0)*t.width,y:0,width:r,height:t.height}}(e,n,r);return{rect:t,label:i.resolve(e,t),guideLine:o.resolve(e,t)}});return function(e,t){const n=e.length;if(n<2)return;const r=e[n-1],i=t[n-1].label;if(r&&r.start===r.end)for(let e=n-2;e>-1;e--){const n=t[e].label;n.show=n.show&&!Av(n.segment,i.segment)}}(e,a),a}function Lv(e,t){const n=function({localProps:{size:e},props:t,style:n}){return{resolve:r=>{const i=Math.max(e.height-t.guideLine.minor.size,0)*Math.max(0,Math.min(t.guideLine.minor.align,1)),o=Iv(r.position*e.width,n.minorGuideLine.strokeWidth);return{guideLine:{show:!0,x1:o,y1:Iv(i,n.minorGuideLine.strokeWidth),x2:o,y2:Iv(t.guideLine.minor.size+i,n.minorGuideLine.strokeWidth),style:n.minorGuideLine}}}}}(t);return t.props.guideLine.minor.show?e.map(n.resolve):[]}function Pv(e){return e.filter(e=>e.show).map(e=>l({strokeWidth:1},e.style,{type:"line",x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,tickValue:e.tickValue}))}var Rv={require:["renderer"],defaultSettings:{layout:{displayOrder:0,prioOrder:0},settings:{anchor:"start",label:{show:!0,padding:4,align:0,justify:0},line:{show:!0},guideLine:{major:{justify:0},minor:{show:!0,size:4,align:0}}},style:{label:"$label",line:"$guide-line",majorGuideLine:"$guide-line",minorGuideLine:"$guide-line"}},preferredSize:()=>({size:30,edgeBleed:{left:1,right:1}}),init(){this.props=this.settings.settings,this.localProps={},this.state={major:[],minor:[]}},created(){this.init()},beforeUpdate(){this.init()},beforeRender({size:e}){this.localProps.size=e;const t=this.scale.ticks({distance:e.width}),n=t.filter(e=>!e.isMinor),r=t.filter(e=>e.isMinor);this.state.line=function({localProps:{size:e},style:t,props:n}){const r=Iv(1,t.line.strokeWidth);return{show:n.line.show,x1:Iv(0,t.line.strokeWidth),y1:r,x2:Iv(e.width,t.line.strokeWidth),y2:r,style:t.line}}(this),this.state.major=_v(n,this),this.state.minor=Lv(r,this)},render(){return[...Pv([this.state.line]),...(e=this.state.major.map(e=>e.label),e.filter(e=>e.show).map(e=>l({},e.style,{type:"text",x:e.rect.x,y:e.rect.y,dx:e.dx,dy:e.dy,maxWidth:e.rect.width,text:e.text,title:e.text,baseline:"text-before-edge",tickValue:e.tickValue}))),...Pv(this.state.major.map(e=>e.guideLine)),...Pv(this.state.minor.map(e=>e.guideLine))];var e}};function Fv(e,t){return e&&t&&e.qTicks.length===t.qTicks.length&&e.qTicks.every((e,n)=>e.qStart===t.qTicks[n].qStart&&e.qEnd===t.qTicks[n].qEnd)}function zv(e){return e.qTags.indexOf("$qualified")>-1}function jv({qAxis:e}){const t=[],n=[];for(let r=0;r<e.length;r++){const i=r+1,o=e[r],a=e[i];Fv(o,a)?(zv(a)?(t.push(i),n.push(r)):(t.push(r),n.push(i)),r++):(t.push(r),n.push(r))}return{qualified:t,nonQualified:n}}function $v({qualifiedMeta:e,nonQualifiedMeta:t}){return{resolve(n){let r,i=NaN,o=NaN,a=NaN,s=!1;for(let l=e.length-1;l>=0;l--){const c=e[l];if(c.queries.outer(n)){const e=t[l+1];if(i=c.index,r=l,c.attrs.isDayOrShorter()&&c.queries.canFitHalfDayTicks(n)){o="auto",s=!0;break}if(e&&e.queries.inner(n)){o=e.index;const r=t[l+2];r&&r.queries.minor(n)&&(a=r.index);break}}}if(!Number.isNaN(i)&&Number.isNaN(o)&&"auto"!==o){o=i,i=NaN;const e=t[r+1];e&&e.queries.minor(n)&&(a=e.index)}else Number.isNaN(i)&&(i="auto",o="auto");return{outer:i,inner:o,minor:a,isDayOrShorter:s}}}}function Vv({qTicks:e,measureText:t=()=>({width:0}),cache:n={},scale:r}){const i=n;return{isDayOrShorter:()=>(i.isDayOrShorter=e.length>0&&Math.abs(e[0].qStart-e[0].qEnd)<=1,i.isDayOrShorter),count:()=>e.length,maxRange:()=>(i.maxRange=e.length?Math.max(...e.map(e=>Math.abs(r(e.qStart)-r(e.qEnd)))):0,i.maxRange),rangeAndWidth(){const n=r.clamp();return r.clamp(!1),i.rangeAndWidth=e.map(e=>({range:Math.abs(r(e.qStart)-r(e.qEnd)),width:t(`${e.qText}`).width+16})),r.clamp(n),i.rangeAndWidth}}}function Uv({attrs:e,reqAutoFitWidth:t}){return{outer:t=>!e.rangeAndWidth().some(({width:e,range:n})=>e>n*t),inner:t=>!e.rangeAndWidth().some(({width:e,range:n})=>e>n*t),minor:t=>e.maxRange()*t>=6,canFitHalfDayTicks:n=>n>=t*e.count()}}function Hv({qualified:e,nonQualified:t,qAxis:n,measureText:r,reqAutoFitWidth:i,scale:o},{attributesFactory:a=Vv,queryFactory:s=Uv}={attributesFactory:Vv,queryFactory:Uv}){const l=n.map((e,t)=>function(e,t){const{qTicks:n}=e,l=a({qTicks:n,measureText:r,scale:o});return{data:e,index:t,attrs:l,queries:s({attrs:l,reqAutoFitWidth:i})}}(e,t)),c=e.map(e=>l[e]),u=t.map(e=>l[e]);return{qAxisMeta:l,qualifiedMeta:c,nonQualifiedMeta:u}}function Bv({qAxis:e=[],measureText:t=()=>({width:0}),cache:n={},reqAutoFitWidth:r=0,scale:i},{metaFactory:o=Hv,mapper:a=jv,resolver:s=$v}={metaFactory:Hv,mapper:jv,resolver:$v}){const{qualified:l,nonQualified:c}=a({qAxis:e}),{qualifiedMeta:u,nonQualifiedMeta:d}=o({qAxis:e,qualified:l,nonQualified:c,measureText:t,reqAutoFitWidth:r,scale:i}),f=s({qualifiedMeta:u,nonQualifiedMeta:d});return{resolve:t=>{const r=n.key({distance:t});if(n.get(r))return n.get(r);if(function(e){return!Array.isArray(e)||0===e.length||e.every(e=>0===e.qTicks.length)}(e))return{outer:"auto",inner:"auto",minor:NaN,isDayOrShorter:!1};const i=f.resolve(t);return n.set(r,i),i}}}function Wv(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(864e5*(e-Math.floor(e)))))}const Yv=Wv(0).getTime();function Gv(e){return(e.getTime()-Yv)/86400/1e3}const Kv=new Date,Xv=new Date;function Jv(e,t,n,r){function i(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return i.floor=t=>(e(t=new Date(+t)),t),i.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),i.round=e=>{const t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=(e,n)=>(t(e=new Date(+e),null==n?1:Math.floor(n)),e),i.range=(n,r,o)=>{const a=[];if(n=i.ceil(n),o=null==o?1:Math.floor(o),!(n<r&&o>0))return a;let s;do{a.push(s=new Date(+n)),t(n,o),e(n)}while(s<n&&n<r);return a},i.filter=n=>Jv(t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},(e,r)=>{if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}),n&&(i.count=(t,r)=>(Kv.setTime(+t),Xv.setTime(+r),e(Kv),e(Xv),Math.floor(n(Kv,Xv))),i.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(r?t=>r(t)%e===0:t=>i.count(0,t)%e===0):i:null)),i}const Zv=1e3,Qv=6e4,eb=36e5,tb=864e5,nb=6048e5,rb=Jv(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Zv)},(e,t)=>(t-e)/Zv,e=>e.getUTCSeconds());rb.range;const ib=Jv(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Zv)},(e,t)=>{e.setTime(+e+t*Qv)},(e,t)=>(t-e)/Qv,e=>e.getMinutes());ib.range;const ob=Jv(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Qv)},(e,t)=>(t-e)/Qv,e=>e.getUTCMinutes());ob.range;const ab=Jv(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Zv-e.getMinutes()*Qv)},(e,t)=>{e.setTime(+e+t*eb)},(e,t)=>(t-e)/eb,e=>e.getHours());ab.range;const sb=Jv(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*eb)},(e,t)=>(t-e)/eb,e=>e.getUTCHours());sb.range;const lb=Jv(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Qv)/tb,e=>e.getDate()-1);lb.range;const cb=Jv(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/tb,e=>e.getUTCDate()-1);cb.range;const ub=Jv(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/tb,e=>Math.floor(e/tb));function db(e){return Jv(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())*Qv)/nb)}ub.range;const fb=db(0),hb=db(1),pb=db(2),mb=db(3),gb=db(4),yb=db(5),vb=db(6);function bb(e){return Jv(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)/nb)}fb.range,hb.range,pb.range,mb.range,gb.range,yb.range,vb.range;const xb=bb(0),Sb=bb(1),Mb=bb(2),wb=bb(3),kb=bb(4),Eb=bb(5),Cb=bb(6);xb.range,Sb.range,Mb.range,wb.range,kb.range,Eb.range,Cb.range;const Nb=Jv(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear()),e=>e.getMonth());Nb.range;const Tb=Jv(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear()),e=>e.getUTCMonth());Tb.range;const Db=Jv(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());Db.every=e=>isFinite(e=Math.floor(e))&&e>0?Jv(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,Db.range;const qb=Jv(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());qb.every=e=>isFinite(e=Math.floor(e))&&e>0?Jv(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,qb.range;const Ob=1,Ib=2,Ab=3,_b=4,Lb=5,Pb=6;function Rb({timeScale:e,labels:t,distance:n,isDayOrShorter:r,cache:i,timeOnly:o,initialMin:a}){const[s,l]=e.domain(),c=i.key({distance:n});let u;i.get(c,1)?u=i.get(c,1):(u=function(e,t,n,r,i,o){function a(e){return qb.filter(t=>(t.getUTCFullYear()-o.getUTCFullYear())%e===0)}const s=rb.count(e,t),l=ob.count(e,t),c=sb.count(e,t),u=cb.count(e,t),d=xb.count(e,t),f=Tb.count(e,t),h=qb.count(e,t),p=n/r.second.width-1,m=n/r.minute.width-1,g=n/r.date.width-1,y=n/r.year.width-1,v={type:"year",desc:"year",count:h,interval:qb.every(1),formatter:r.year.formatter,offset:e=>qb.offset(e,-1),floor:qb.floor};if(s<=p)v.type=Ob,v.desc="second",v.count=s,v.interval=rb.every(1),v.formatter=r.second.formatter,v.offset=e=>rb.offset(e,-1),v.floor=rb.floor;else if(s/2<=p)v.type=Ob,v.desc="every other second",v.count=s/2,v.interval=rb.every(2),v.formatter=r.second.formatter,v.offset=e=>rb.offset(e,-2),v.floor=rb.floor;else if(s/5<=p)v.type=Ob,v.desc="every 5 second",v.count=s/5,v.interval=rb.every(5),v.formatter=r.second.formatter,v.offset=e=>rb.offset(e,-5),v.floor=rb.floor;else if(s/15<=p)v.type=Ob,v.desc="every 15 second",v.count=s/15,v.interval=rb.every(15),v.formatter=r.second.formatter,v.offset=e=>rb.offset(e,-15),v.floor=rb.floor;else if(s/30<=p)v.type=Ob,v.desc="every 30 second",v.count=s/30,v.interval=rb.every(30),v.formatter=r.second.formatter,v.offset=e=>rb.offset(e,-30),v.floor=rb.floor;else if(l<=m)v.type=Ib,v.desc="minute",v.count=l,v.interval=ob.every(1),v.formatter=r.minute.formatter,v.offset=e=>ob.offset(e,-1),v.floor=ob.floor;else if(l/2<=m)v.type=Ib,v.desc="every 2 minute",v.count=l/2,v.interval=ob.every(2),v.formatter=r.minute.formatter,v.offset=e=>ob.offset(e,-2),v.floor=ob.floor;else if(l/5<=m)v.type=Ib,v.desc="every 5 minute",v.count=l/5,v.interval=ob.every(5),v.formatter=r.minute.formatter,v.offset=e=>ob.offset(e,-5),v.floor=ob.floor;else if(l/10<=m)v.type=Ib,v.desc="every 10 minute",v.count=l/10,v.interval=ob.every(10),v.formatter=r.minute.formatter,v.offset=e=>ob.offset(e,-10),v.floor=ob.floor;else if(l/15<=m)v.type=Ib,v.desc="every 15 minute",v.count=l/15,v.interval=ob.every(15),v.formatter=r.minute.formatter,v.offset=e=>ob.offset(e,-15),v.floor=ob.floor;else if(l/30<=m)v.type=Ib,v.desc="every 30 minute",v.count=l/30,v.interval=ob.every(30),v.formatter=r.minute.formatter,v.offset=e=>ob.offset(e,-30),v.floor=ob.floor;else if(c<=m)v.type=Ab,v.desc="hour",v.count=c,v.interval=sb.every(1),v.formatter=r.minute.formatter,v.offset=e=>sb.offset(e,-1),v.floor=sb.floor;else if(c/2<=m)v.type=Ab,v.desc="every 2 hour",v.count=c/2,v.interval=sb.every(2),v.formatter=r.minute.formatter,v.offset=e=>sb.offset(e,-2),v.floor=sb.floor;else if(c/3<=m)v.type=Ab,v.desc="every 3 hour",v.count=c/3,v.interval=sb.every(3),v.formatter=r.minute.formatter,v.offset=e=>sb.offset(e,-3),v.floor=sb.floor;else if(c/6<=m)v.type=Ab,v.desc="every 6 hour",v.count=c/6,v.interval=sb.every(6),v.formatter=r.minute.formatter,v.offset=e=>sb.offset(e,-6),v.floor=sb.floor;else if(c/12<=m||i)v.type=Ab,v.desc="every 12 hour",v.count=c/12,v.interval=sb.every(12),v.formatter=r.minute.formatter,v.offset=e=>sb.offset(e,-12),v.floor=sb.floor;else if(u<=g)v.type=_b,v.desc="day",v.count=u,v.interval=cb.every(1),v.formatter=r.date.formatter,v.offset=e=>cb.offset(e,-1),v.floor=cb.floor;else if(u/2<=g)v.type=_b,v.desc="every 2 day",v.count=u/2,v.interval=cb.every(2),v.formatter=r.date.formatter,v.offset=e=>cb.offset(e,-2),v.floor=cb.floor;else if(u/3<=g)v.type=_b,v.desc="every 3 day",v.count=u/3,v.interval=cb.every(3),v.formatter=r.date.formatter,v.offset=e=>cb.offset(e,-3),v.floor=cb.floor;else if(d<=g)v.type=_b,v.desc="week",v.count=d,v.interval=xb.every(1),v.formatter=r.date.formatter,v.offset=e=>xb.offset(e,-1),v.floor=cb.floor;else if(d/2<=g)v.type=_b,v.desc="every 2 week",v.count=d/2,v.interval=xb.every(2),v.formatter=r.date.formatter,v.offset=e=>xb.offset(e,-2),v.floor=cb.floor;else if(f<=g)v.type=Lb,v.desc="month",v.count=f,v.interval=Tb.every(1),v.formatter=r.date.formatter,v.offset=e=>Tb.offset(e,-1),v.floor=cb.floor;else if(f/3<=g)v.type=Lb,v.desc="quarter",v.count=f/3,v.interval=Tb.every(3),v.formatter=r.date.formatter,v.offset=e=>Tb.offset(e,-3),v.floor=cb.floor;else if(f/6<=g)v.type=Lb,v.desc="half year",v.count=f/6,v.interval=Tb.every(6),v.formatter=r.date.formatter,v.offset=e=>Tb.offset(e,-6),v.floor=cb.floor;else if(h<=y)v.type=Pb,v.desc="year",v.count=h,v.interval=qb.every(1),v.formatter=r.year.formatter,v.offset=e=>qb.offset(e,-1),v.floor=qb.floor;else if(h/2<=y)v.type=Pb,v.desc="every 2 year",v.count=h/2,v.interval=a(2),v.formatter=r.year.formatter,v.offset=e=>qb.offset(e,-2),v.floor=qb.floor;else if(h/5<=y)v.type=Pb,v.desc="every 5 year",v.count=h/5,v.interval=a(5),v.formatter=r.year.formatter,v.offset=e=>qb.offset(e,-5),v.floor=qb.floor;else if(h/10<=y)v.type=Pb,v.desc="every 10 year",v.count=h/10,v.interval=a(10),v.formatter=r.year.formatter,v.offset=e=>qb.offset(e,-10),v.floor=qb.floor;else{const e=Math.max(1,Math.floor(h/y));v.type=Pb,v.desc="every nth year",v.count=e,v.interval=a(e),v.formatter=r.year.formatter,v.offset=t=>qb.offset(t,-e),v.floor=qb.floor}return v}(s,l,n,t.all(),r,a),i.set(c,u,1));const d=e.ticks(u.interval);d.length?s.getTime()!==d[0].getTime()&&d.unshift(u.offset(d[0])):d.push(u.floor(s));const f=d.map((e,t,n)=>{const r=n[t+1]?n[t+1]-e:l-e;return{start:e,end:new Date(e.getTime()+r),formatter:u.formatter}});let h=[];if(!o&&u.type<=Ab){const n=t.getFormat("date"),r=e.ticks(cb.every(1));r.length&&s.getUTCDate()!==r[0].getUTCDate()&&r.unshift(cb.offset(r[0],-1)),h=(r.length?r:[cb.floor(s)]).map((e,t,r)=>{const i=r[t+1]?r[t+1]-e:l-e;return{start:e,end:new Date(e.getTime()+i),formatter:n.formatter}})}return{inner:f,outer:h}}const Fb=86400,zb=1440,jb={};function $b(e,t,n,r){return{type:e,start:new Date(Date.UTC(...t)),end:new Date(Date.UTC(...n)),formatter:r}}function Vb(e,t,n){const{generator:r,anchor:i,clamp:o,level:a}=t.ticks,{qNumFormat:s}=t.formatter;e.clamp(o);const[l,c]=e.domain(),u=Li().domain([Wv(l),Wv(c)]);u.clamp(o),u.range(t.invert?[1,0]:[0,1]);const d="object"==typeof r?r:{type:r};let f;f="d3"===d.type?(e,i)=>Rb({timeScale:u,labels:n,distance:e,isDayOrShorter:i,cache:t.cache,timeOnly:"T"===s.qType,initialMin:void 0===d.initialMin?u.domain()[0]:Wv(r.initialMin)}):e=>function(e,t,n,r,i,o=!1){if(jb[[t,n,r,r,o]])return jb[[t,n,r,r,o]];const a={year:e.getFormat("year"),date:e.getFormat("date"),minute:e.getFormat("minute"),second:e.getFormat("second")},s=Wv(n),l=s.getFullYear(),c=s.getMonth(),u=s.getDate(),d=r-n,f=t/(i-r),h=f/1440,p=f/Fb,m=366*f,g=3*f*30,y=a.second.width/p,v=a.minute.width/h,b=a.date.width/g,x=a.year.width/m;let S,M,w,k=0,E=0,C=null,N=null,T=null,D=null,q=null,O=null;const I={outer:[],inner:[]};for(y<1?(C=1,E=1/Fb):y<2?(C=2,E=1/Fb*2):y<5?(C=5,E=1/Fb*5):y<10?(C=10,E=.00011574074074074073):y<30?(C=30,E=.0003472222222222222):v<1?(N=1,E=1/zb):v<2?(N=2,E=1/zb*2):v<5?(N=5,E=1/zb*5):v<10?(N=10,E=.006944444444444445):v<30?(N=30,E=.020833333333333336):v<60?(T=1,E=1/24):v<120?(T=2,E=2/24):v<360?(T=6,E=.25):v<720?(T=12,E=.5):b<1/90?(E=1,D=1):b<2/90?(E=2,D=2):b<7/90?(E=7,D=7):b<31/90?(q=1,E=31):b<1?(q=3,E=90):x<1?(O=1,E=366):x<2?(O=2,E=732):x<5?(O=5,E=1826.25):(O=10,E=3652.5),M=Math.floor((d+n%1)/E);k<i;){w=M+1,S=O?$b("year",[l+M*O,0,1],[l+w*O,0,1],a.year.formatter):q?$b("month",[l,c+M*q,1],[l,c+w*q,1],a.date.formatter):D?$b("day",[l,c,u+M*D],[l,c,u+w*D],a.date.formatter):T?$b("hour",[l,c,u,0+M*T],[l,c,u,0+w*T],a.minute.formatter):N?$b("minute",[l,c,u,0,0+M*N],[l,c,u,0,0+w*N],a.minute.formatter):$b("second",[l,c,u,0,0,0+M*C],[l,c,u,0,0,0+w*C],a.second.formatter),k=Gv(S.start),I.inner.push(S);const e=Math.floor(k);if(!(o||O||q||D)){const t={type:"day",start:Wv(e),end:Wv(e+1),formatter:a.date.formatter,qStart:e};I.outer[I.outer.length-1]&&I.outer[I.outer.length-1].qStart===t.qStart||I.outer.push(t)}M++}return I.min=r,I.max=i,jb[[t,n,r,r,o]]=I,I}(n,e,d.min,l,c,"T"===s.qType);const h={transform:(t=[],{isMinor:n=!1}={})=>t.map(t=>{let r;r="start"===i?t.qStart:"end"===i?t.qEnd:(t.qStart+t.qEnd)/2;const o=e.clamp();n&&e.clamp(!1);const a=e(r),s=e(t.qStart),l=e(t.qEnd);return e.clamp(o),{value:r,position:a,start:s,end:l,label:t.qText,isMinor:n,data:n?void 0:{start:t.qStart,end:t.qEnd,scaleStart:e.domain()[0]}}}).filter(e=>e.position>=0&&e.position<=1),generate:(t=100,n)=>f(t,n)[a].map(t=>{let n;return n="start"===i?Gv(t.start):"end"===i?Gv(t.end):(Gv(t.start)+Gv(t.end))/2,{position:u(t.start),start:u(t.start),end:u(t.end),value:n,label:t.formatter(n),isMinor:!1,data:{start:Gv(t.start),end:Gv(t.end),scaleStart:e.domain()[0]}}}).filter(e=>e.position>=0&&e.position<=1)};return h}const Ub=/t+/i;const Hb={min:NaN,max:NaN,invert:!1,qAxis:[],field:void 0,formatter:{fn:()=>e=>e,measureText:()=>({width:0,height:0}),localeInfo:{},qNumFormat:{}},ticks:{generator:"d3",level:"outer",anchor:void 0,clamp:!1},cache:{get:()=>!1,set:()=>{},key:()=>""}};function Bb(e,t){e.instance||(e.instance=t.copy(),e.instance.domain(t.domain()),e.instance.clamp(!0),e.instance.range(e.invert?[1,0]:[0,1]))}const Wb="continuousPan";var Yb={model:function({model:e,layoutService:t,largeDataService:n,dataProcessorModel:r=qv,viewCache:i,viewState:o,definitionPath:a},s={}){const{engineFetcherFactory:c=vv,snapshotFetcherFactory:u=xv,cacheFetcherFactory:d=bv,cache:f={initial:{},merged:{}}}=s,h=c({model:e,layoutService:t,largeDataService:n,definitionPath:a}),p=u({layoutService:t,viewCache:i}),m=d({cache:f}),g=e=>{throw e.isHandled=!0,e};let y,v,b;return{update(e){({initialMin:v,initialMax:b}=function(e={}){let{qMin:t,qMax:n}=e;return t=Number.isNaN(+t)?0:t,n=Number.isNaN(+n)?0:n,{initialMin:t,initialMax:n}}(e.qHyperCube.qDimensionInfo[0])),i.set("continuousMin",v),i.set("continuousMax",b),i.set("minimiumZoomSpan",function(e,t){return Math.max(1e-6,(t-e)*Nv)}(v,b)),y=t.meta.isSnapshot?p:h,t.meta.isSnapshot&&({zoom:{min:v,max:b}}=p.getSnapshotData()),o.preventSet("zoom",{min:v,max:b})},updateLayout(e){const{qDataPages:n,qAxisData:r}=e;return t.setHyperCubeValue("qDataPages",n),t.setHyperCubeValue("qAxisData",r),t.setHyperCubeValue("qMode","S"),t.setHyperCubeValue("qColumnOrder",[]),e},initialFetch(){return y.fetch(v,b).then(e=>{const t=function(e){return{qDataPages:e.qDataPages.map(e=>{const t=wv(e.qArea,e.qMatrix);return{...e,qArea:t}}),qAxisData:e.qAxisData}}(e);return r.command.processDataPage({dataPage:t.qDataPages.length?t.qDataPages[0]:[]}),f.initial=t,f.merged=t,e}).then(e=>kv(v,b,e)).then(e=>this.updateLayout(e)).catch(g)},fetch:(e,t)=>y.fetch(e,t).then(e=>function(e,t){const n={};return n.qDataPages=(e.qDataPages||[]).map((e,n)=>{const r=function(e,t){if(!t||!t.length||!t[0].length)return e;const n=t[0][0].qNum,r=t[t.length-1][0].qNum,i=[],o=[];for(let t=0,a=e.length;t<a;t++){const a=e[t][0];a.qNum<n?i.push(e[t]):a.qNum>r&&o.push(e[t])}return[...i,...t,...o]}(e.qMatrix,t.qDataPages[n].qMatrix),i=wv(e.qArea,r);return{...e,qArea:i,qMatrix:r}}),e.qAxisData&&e.qAxisData.qAxis&&(n.qAxisData=function(e,t){if(!t||!t.qAxis.length||t.qAxis.every(e=>!e.qTicks.length))return e;const n=t.qAxis.map(e=>e.qName),r=t.qAxis.map(e=>({start:e.qTicks[0].qStart,end:e.qTicks[e.qTicks.length-1].qStart})),i=t.qAxis.map(e=>({qName:e.qName,qTags:[...e.qTags],qTicks:[...e.qTicks]}));for(let t=0,o=e.qAxis.length;t<o;t++){const o=e.qAxis[t],a=n.indexOf(o.qName),s=[],l=[];if(a>-1){const{start:e,end:t}=r[a];for(let n=0,r=o.qTicks.length;n<r;n++){const r=o.qTicks[n];r.qStart<e?s.push(r):r.qStart>t&&l.push(r)}i[a].qTicks=[...s,...i[a].qTicks,...l]}}return{qAxis:i}}(e.qAxisData,t.qAxisData)),n}(f.initial,e)).then(e=>(r.command.processDataPage({dataPage:e.qDataPages.length?e.qDataPages[0]:[]}),f.merged=e,e)).then(n=>kv(e,t,n)).catch(g),fetchFromCache:(e,t)=>m.fetch(e,t).then(n=>kv(e,t,n)),fetchMinMaxData:()=>Promise.resolve(f.initial.qDataPages||[]),getInitialCube(){const e=t.getHyperCube();return l({},e,{...f.initial})},getInitialLayout(){const e=this.getInitialCube();return l({},t.getLayout(),{qHyperCube:e})},getDimensionCardinality:()=>Dv(f.initial,t.meta),setSnapshotData(e){const{qHyperCube:t}=e,n=r.query.getShouldProcess()?[r.query.getFilteredDataPage({dataPage:f.merged.qDataPages[0]})]:f.merged.qDataPages;t.qDataPages=n,t.qAxisData=f.merged.qAxisData}}},event:{onZoomChange:function(e,t){const{layoutService:n,continuousDataModel:r}=e;function i(e,n,i){return r[e](n,i).then(e=>(r.updateLayout(e),t(),e))}const o=Cu((e,t)=>i("fetch",e,t),50);return({min:e,max:t},{min:r,max:a})=>!n.meta.isContinuous||e===r&&t===a?Promise.resolve(null):i("fetchFromCache",e,t).then(n=>(o(e,t),n))},onZoomIntercept:function({viewCache:e}){let t=NaN,n=NaN,r=NaN;return(i,o)=>(t=e.get("continuousMin"),n=e.get("continuousMax"),r=e.get("minimiumZoomSpan"),Math.abs(i.max-i.min)<r?o:{min:Math.min(i.max,Math.max(t,i.min)),max:Math.max(i.min,Math.min(n,i.max))})},onZoom:function({viewCache:e,viewState:t,chart:n},{threshold:r=50,rtl:i=!1,targetKey:o}){const a=e.get("continuousMin"),s=e.get("continuousMax");return Nu((e,r)=>{const l=(e=>n.componentsFromPoint(e).filter(e=>e.key===o)[0])(e);if(l){const o=function(e,t,n){let{x:r}=e;return r-=t.element.getBoundingClientRect().left,r-=n.rect.x,Math.max(0,Math.min(1,r/n.rect.width))}(e,n,l),c=i?1-o:o,{min:u,max:d}=t.get("zoom"),f=Math.abs(d-u),h=f-(r>0?Cv:Ev)*f,p=u+h*c,m=d-h*(1-c),g=p<a?a-p:0,y=m>s?m-s:0;t.set("zoom",{min:Math.max(p-y,a),max:Math.min(m+g,s)})}},r)}},interactions:{areaPan:function({targetKey:e,chart:t,actions:n,viewState:r,viewCache:i}){return{type:"Pan",key:"continuous:pan",options:{event:Wb,pointers:1,threshold:10,enable(r,i){return this.started===Wb||!i||!!n.scroll.enabled()&&t.componentsFromPoint({x:i.center.x,y:i.center.y}).some(t=>t.key===e)}},events:{[`${Wb}start`](n){n.preventDefault(),this.started=Wb;const{min:i,max:o}=r.get("zoom");this[Wb]={min:i,max:o,size:t.component(e).rect.computedInner.width,span:o-i}},[`${Wb}move`](e){e.preventDefault();const{span:t,min:n,max:o,size:a}=this[Wb],s=-e.deltaX/a;r.set("zoom",{min:Math.min(n+s*t,i.get("continuousMax")-t),max:Math.max(o+s*t,i.get("continuousMin")+t)})},[`${Wb}end`](e){e.preventDefault(),this.started=!1},[`${Wb}cancel`](e){e.preventDefault(),this.started=!1}}}}},picassoComponents:{axisOverlay:Ov,timeAxis:Rv},picassoScales:{time:function e(t,n={}){const r=function(e,t,n){const r={};return Object.keys(t).forEach(i=>{const o=e[i],a=typeof o;"function"===a?r[i]=o(n):"object"!==a||Array.isArray(o)?r[i]="undefined"===a?t[i]:o:r[i]=l(!0,{},t[i],o)}),r}(t,Hb,n),{qAxis:i}=r,o=gn(),a={instance:null,invert:!1},{min:s,max:c}=function(e,t){let n=+e.min,r=+e.max;return Number.isNaN(n)&&Number.isNaN(r)&&Array.isArray(t)&&t.length&&(n=Math.min(...t[t.length-1].qTicks.map(e=>e.qStart)),r=Math.max(...t[t.length-1].qTicks.map(e=>e.qEnd))),n===r&&(n-=.5,r+=.5),{min:Number.isNaN(+n)?0:n,max:Number.isNaN(+r)?1:r}}(r,i);let u,d,f=[];const h=function(e){return Number.isNaN(+e)?NaN:o(e)};h.ticks=({distance:e,resolve:t=u.resolve}={})=>{const n=t(e),o=n[r.ticks.level];if(Number.isNaN(+o)||(f=d.transform(i[o].qTicks,{isMinor:!1})),!Number.isNaN(+n.minor)){const e=d.transform(i[n.minor].qTicks,{isMinor:!0});f=f.concat(e)}return"auto"===o&&(f=d.generate(e,n.isDayOrShorter)),f},h.invert=e=>o.invert(e),h.domain=e=>Array.isArray(e)?o.domain(e):o.domain(),h.range=e=>Array.isArray(e)?o.range(e):o.range(),h.norm=e=>(Bb(a,h),a.instance(e)),h.normInvert=e=>(Bb(a,h),a.instance.invert(e)),h.copy=()=>e(t,n),h.clamp=(e=!0)=>(o.clamp(e),o.clamp()),h.min=()=>Math.min(s,c),h.max=()=>Math.max(s,c),o.range(r.invert?[1,0]:[0,1]),o.domain([s,c]),a.invert=r.invert;const p=function(e){const t={},{measureText:n,fn:r,localeInfo:i}=e.formatter,o={second:{type:"second",pattern:"hh:mm:ss",width:60,formatter:void 0},minute:{type:"minute",pattern:"hh:mm",width:60,formatter:void 0},date:{type:"date",pattern:"YYYY-MM-DD",width:60,formatter:void 0},year:{type:"year",pattern:"YYYY",width:60,formatter:void 0}};return i&&Ub.test(i.qTimestampFmt)&&(o.minute.pattern+=" tt",o.second.pattern+=" tt"),o.date.pattern=i&&i.qDateFmt?i.qDateFmt:o.date.pattern,Object.keys(o).forEach(e=>{o[e].formatter=r(o[e].pattern),o[e].width=Math.max(o[e].width,n(o[e].formatter(41000.2343433)).width+16)}),t.getFormat=e=>o[e],t.all=()=>o,t.getFormatFromTicks=e=>{const t=e.filter(e=>!e.isMinor),{length:n}=t;if(!n)return o.date;const r=Wv(t[0].data.start),i=Wv(t[n-1].data.start);return cb.count(r,i)/n>=1?o.date:sb.count(r,i)/n>0?o.minute:ob.count(r,i)/n>0?o.second:o.date},t}(r);return d=Vb(o.copy(),r,p),u=Bv({qAxis:i,measureText:r.formatter.measureText,reqAutoFitWidth:2*p.getFormat("minute").width,cache:r.cache,scale:h}),h.data=()=>({fields:[{formatter:h.formatter,id:()=>`qHyperCube/${r.field}`,key:()=>r.field,raw:Su(n,"fields.0.raw",()=>({}))}]}),h.formatter=()=>p.getFormatFromTicks(f).formatter,h}}};var Gb={DATA:{MAIN:"qHyperCube",LEGEND:"legend-data",REDUCED:"reduced-data"},SCALE:{MAIN:{MINOR:"main-minor",MAJOR:"main-major",MAJOR_INNER:"main-major-inner",COLOR:"color",LEGEND_COLOR:"colorLegend"},REDUCED:{MINOR:"reduced-minor",MAJOR:"reduced-major",COLOR:"reduced-color"}},COMPONENT:{LINE:"line-component",POINT:"point-component",GHOST_POINT:"ghost-point-component",MAJOR_AXIS:"major-axis-component",MAJOR_AXIS_CONTINUOUS:"major-axis-continuous-component",MAJOR_AXIS_TIME_INNER:"major-axis-time-inner-component",MAJOR_AXIS_TIME_OUTER:"major-axis-time-outer-component",MINOR_AXIS:"minor-axis-component",MAJOR_AXIS_OVERLAY_CONTINUOUS:"major-axis-overlay-continuous-component",MAJOR_AXIS_OVERLAY_TIME_INNER:"major-axis-overlay-time-inner-component",MAJOR_AXIS_OVERLAY_TIME_OUTER:"major-axis-overlay-time-outer-component",REDUCED_LINE:"reduced-line-component",POINT_TOOLTIP:"tooltip-qcm",LABEL_SPACE:"label-space-component",LEGEND_TOOLTIP:"legend-tooltip",MAJOR_AXIS_TITLE:"major-axis-title",MINOR_AXIS_TITLE:"minor-axis-title",GRID_LINE:"grid-line",ZERO_LINE:"zero-line",MEASURE_REF_LINE:"mes-ref-line",DIMENSION_REF_LINE:"dim-ref-line",MEASURE_REF_LINE_LABEL:"mes-ref-line-label",DIMENSION_REF_LINE_LABEL:"dim-ref-line-label",LEGEND:"legend-color",LEGEND_CATEGORICAL:"legend-color-cat",OUT_OF_MAX_BOUNDS:"out-of-max-bounds-marker",OUT_OF_MIN_BOUNDS:"out-of-min-bounds-marker",TREND_LINES_TOOLTIP:"trend-lines-tooltip",TREND_LINES_TOOLTIP_OVERLAY:"trend-lines-tooltip-overlay",FORECAST_POINT:"forcast-points",FORECAST_POINT_LABEL:"forecast-point-label",FORECAST_LINE:"forcast-lines",FORECAST_CONFIDENCE:"forcast-confidence",FORECAST_OUT_OF_MAX_BOUNDS:"forecast-out-of-max-bounds-marker",FORECAST_OUT_OF_MIN_BOUNDS:"forecast-out-of-min-bounds-marker",FORECAST_REDUCED_LINE:"forcast-reduced-lines",FORECAST_REDUCED_CONFIDENCE:"forcast-reduced-confidence",BRUSH_HIGHLIGHTER:"brush-highlighter",POINT_LABEL:"point-label"},COLLECTION:{MAIN:"main-collection",REDUCED:"reduced-collection",FORECAST:"forecast-collection",REDUCED_FORECAST:"reduced-forecast-collection"},FORMATTER:{MINOR:"minor",COLOR:"color"},RANGE:{CONTINUOUS:"continuous-range-brush"}};function Kb(){return"undefined"!=typeof window&&void 0!==window.document&&void 0!==window.self}function Xb(){return!("undefined"==typeof process||!process.version||!process.versions.node)}function Jb(e){if(Array.isArray(e))return e.map(Jb);if(function(e){return"object"==typeof e&&null!==e&&e.constructor===Object}(e)){const t={};for(const n of Object.keys(e).sort())t[n]=Jb(e[n]);return t}return e}function Zb(e){if(Array.isArray(e))return e.map(e=>"object"==typeof e&&null!==e?Zb(e):e).filter(e=>"object"==typeof e&&null!==e?Object.keys(e).length>0:null!=e&&""!==e);if("object"==typeof e&&null!==e){const t={};for(const n of Object.keys(e)){const r=e[n];switch(typeof r){case"undefined":break;case"boolean":r&&(t[n]=r);break;case"string":{const e=r.trim();""!==e&&(t[n]=e);break}case"object":{if(null===r)break;const e=Zb(r);e&&(Array.isArray(e)&&e.length>0||"object"==typeof e&&Object.keys(e).length>0)&&(t[n]=e);break}case"function":case"number":t[n]=r;break;default:console.warn(`Unexpected type for key "${n}": ${typeof r}`),t[n]=r}}if(0===Object.keys(t).length)return;return t}return e}const Qb=Xb(),ex=(async()=>Qb?()=>{throw new Error("importRuntimeModule cannot be used in a Node.js context")}:(await Promise.resolve().then(function(){return p0})).importRuntimeModule)();async function tx(e){return Qb?Promise.resolve().then(function(){return J2}):(await ex)("auth@v1",e)}var nx={registerAuthModule:function(e,t){tx().then(n=>n.registerAuthModule(e,t))},setDefaultHostConfig:function(e){tx(e).then(t=>t.setDefaultHostConfig(e))},registerHostConfig:function(e,t){tx(t).then(n=>n.registerHostConfig(e,t))},unregisterHostConfig:function(e){tx().then(t=>t.unregisterHostConfig(e))},getAccessToken:async function({hostConfig:e}){return tx(e).then(t=>t.getAccessToken({hostConfig:e}))},getWebResourceAuthParams:async function({hostConfig:e}){return tx(e).then(t=>t.getWebResourceAuthParams({hostConfig:e}))}};function rx({core:t,services:n}){const r=e.useApp(),i=e.useModel(),o=e.useOptions(),a=e.useRenderState();!function({core:t}){e.useImperativeHandle(()=>({getViewState(){if(!t)return;const{chart:e,viewState:n}=t,r=e.component(Gb.COMPONENT.LEGEND_CATEGORICAL);return{scrollOffset:n.get("scrollOffset"),zoom:n.get("zoom"),legendScrollOffset:r?._DO_NOT_USE_getInfo?.().offset}}}),[t])}({core:t}),function({core:t,services:n}){e.onTakeSnapshot(e=>{if(!t||!n)return;const{chart:r,viewState:i}=t,{colorService:o,continuousModel:a,discreteModel:s,dockService:l,layoutService:c,reducedModel:u}=n,{isDiscrete:d,isSnapshot:f}=c.meta,{width:h,height:p}=l.meta.chart.size;return e.snapshotData=e.snapshotData||{},e.snapshotData.content={size:{w:h,h:p}},f?Promise.resolve():(e.snapshotData.content.chartData={scrollOffset:i.get("scrollOffset"),zoom:i.get("zoom"),legendScrollOffset:M(r,Gb.COMPONENT.LEGEND_CATEGORICAL)},d?(s.command.setSnapshotData(e),u.command.setSnapshotData(e)):a.setSnapshotData(e),o.getMain().getSnapshotData().then(t=>{e.snapshotData.content.chartData={...e.snapshotData.content.chartData,...t}}).catch(()=>{}))})}({core:t,services:n});const s=rv({enable:!1===n?.layoutService?.meta?.isSnapshot}),[l,c]=e.usePromise(()=>{if(!t||!n)return Promise.resolve();const{alternativeService:e,chartModel:s,colorService:l,continuousModel:c,customTooltipService:u,disclaimerService:d,extremumModel:f,layoutService:h,pluginService:p,reducedModel:m,selectionService:g,tooltipService:y,largeDataService:v}=n,{isContinuous:b,isSnapshot:x}=h.meta;!function({core:e,options:t,services:n}){const{viewCache:r,viewState:i}=e,{chartModel:o,continuousModel:a,discreteModel:s,layoutService:l,legendModel:c,refLineModel:u}=n,{isContinuous:d,isDiscrete:f,isSnapshot:h}=l.meta,p=t.viewState||{},m=h?l.getLayoutValue("snapshotData.content.chartData",{}):p;i.preventSet("scrollOffset",m.scrollOffset),i.preventSet("legendScrollOffset",m.legendScrollOffset||0),m.zoom&&i.preventSet("zoom",m.zoom);const{onZoomChange:g,onZoomIntercept:y}=Yb.event;f&&i.onChanged("scrollOffset",()=>{c.command.setDataPages([s.query.getCurrentDataPage()]),u.update(),o.command.updatePartial()}),d&&(i.intercept("zoom",y({viewCache:r})),i.onChanged("zoom",g({continuousDataModel:a,layoutService:l},o.command.updatePartial)))}({core:t,options:o,services:n});const S=[];return x||S.push(i.getEffectiveProperties()),b&&(v.clear(),S.push(c.initialFetch())),S.push(m.command.initialize()),S.push(async function({services:e,core:t}){const n=e?.layoutService?.getLayout()?.plugins?.some(e=>"image"===e.type),r=t?.hostConfig;if(!n||!r)return null;const{queryParams:i}=await nx.getWebResourceAuthParams({hostConfig:r});return i}({services:n,core:t})),Promise.all(S).then(async t=>{const n=t[0]||void 0,o=t[t.length-1]||void 0;if(n?.qHyperCubeDef){const e=av({app:r,model:i,properties:n,layoutService:h});if(e.shouldUpdate())return await e.update(),void a.pending();a.restore()}u.setProperties(n),y.expando.set("properties",n),await p.initialize(),await f.command.initialize(),await l.initialize(),await e.initialize({properties:n}),d.initialize(),s.command.initialize();const{field:c}=l.getMain().getSettings();return g.setBrushAliases({colorField:c,useLegendCube:s.query.getIsUsingLegendCube(),legendAlias:`${Gb.DATA.LEGEND}/${c}`}),{properties:n,queryParams:o}})},[t,n,s]);if(c&&!c.isHandled)throw c;return l}var ix={defaultSettings:{settings:{size:10}},preferredSize(){return this.settings.settings.size},render:()=>[]};const ox=({type:e,extremum:t,separateStacking:n,items:r})=>{const i="max"===e?e=>e>t:e=>e<t,o=n?e=>i(e.point.value<0?e.start.value:e.end.value):e=>i(e.end.value),a=r.filter(o),s=[],l=[];return a.forEach(e=>{const{value:t}=e.major;s[t]||(s[t]=!0,l.push(e))}),l};var ax,sx,lx={require:["resolver","symbol"],defaultSettings:{settings:{type:"max",extremum:()=>{},primaryextremum:()=>{},secondaryextremum:()=>{},separateStacking:!1,orientation:"horizontal",rtl:!1,lineSeries:[],major:{scale:"major-scale"},markerOffset:1,size:10},style:{fill:"#999"}},preferredSize(){return this.settings.settings.size},render(){const{items:e}=this.data;if(!e.length)return[];const{type:t,separateStacking:n,orientation:r,rtl:i,markerOffset:o,size:a,major:s,lineSeries:l}=this.settings.settings,c=this.settings.settings.extremum(),u=this.settings.settings.primaryextremum(),d=this.settings.settings.secondaryextremum();if(!l.length&&void 0===c)return[];if(l.length&&(void 0===u||void 0===d))return[];const f=function({type:e,extremum:t,primaryextremum:n,secondaryextremum:r,separateStacking:i,items:o,lineSeries:a}){const s=[];return a.length?a.forEach(t=>{const i=t.isPrimary?n:r,a=o.filter(e=>e.typeIndex.value===t.typeIndex);s.push(ox({type:e,extremum:i,items:a}))}):s.push(ox({type:e,extremum:t,separateStacking:i,items:o})),s.reduce((e,t)=>e.concat(t),[])}({type:t,extremum:c,primaryextremum:u,secondaryextremum:d,separateStacking:n,items:e,lineSeries:l});if(!f.length)return[];const h="horizontal"===r,p=this.rect[h?"width":"height"],m=this.resolver.resolve({data:{items:f},settings:{major:s},scaled:{major:p}}),g=("max"===t?90:-90)-(h?0:90)-(!h&&i?180:0),y=a/2*o,{fill:v}=this.settings.style,b=m.items.map(e=>function({symbol:e,size:t,fill:n,startAngle:r,x:i,y:o,data:a}){return e({type:"n-polygon",show:!0,size:t,fill:n,stroke:"#205891",strokeWidth:0,sides:3,startAngle:r,width:.7,x:i,y:o,data:a})}({symbol:this.symbol,size:a,fill:v,startAngle:g,x:h?p*e.major:y,y:h?y:p*e.major,data:e.data}));return b}},cx={exports:{}},ux={};function dx(){if(ax)return ux;ax=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),a=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),c=Symbol.for("react.memo"),u=Symbol.for("react.lazy"),d=Symbol.iterator;var f={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h=Object.assign,p={};function m(e,t,n){this.props=e,this.context=t,this.refs=p,this.updater=n||f}function g(){}function y(e,t,n){this.props=e,this.context=t,this.refs=p,this.updater=n||f}m.prototype.isReactComponent={},m.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},m.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},g.prototype=m.prototype;var v=y.prototype=new g;v.constructor=y,h(v,m.prototype),v.isPureReactComponent=!0;var b=Array.isArray,x=Object.prototype.hasOwnProperty,S={current:null},M={key:!0,ref:!0,__self:!0,__source:!0};function w(t,n,r){var i,o={},a=null,s=null;if(null!=n)for(i in void 0!==n.ref&&(s=n.ref),void 0!==n.key&&(a=""+n.key),n)x.call(n,i)&&!M.hasOwnProperty(i)&&(o[i]=n[i]);var l=arguments.length-2;if(1===l)o.children=r;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];o.children=c}if(t&&t.defaultProps)for(i in l=t.defaultProps)void 0===o[i]&&(o[i]=l[i]);return{$$typeof:e,type:t,key:a,ref:s,props:o,_owner:S.current}}function k(t){return"object"==typeof t&&null!==t&&t.$$typeof===e}var E=/\/+/g;function C(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(e){return t[e]})}(""+e.key):t.toString(36)}function N(n,r,i,o,a){var s=typeof n;"undefined"!==s&&"boolean"!==s||(n=null);var l=!1;if(null===n)l=!0;else switch(s){case"string":case"number":l=!0;break;case"object":switch(n.$$typeof){case e:case t:l=!0}}if(l)return a=a(l=n),n=""===o?"."+C(l,0):o,b(a)?(i="",null!=n&&(i=n.replace(E,"$&/")+"/"),N(a,r,i,"",function(e){return e})):null!=a&&(k(a)&&(a=function(t,n){return{$$typeof:e,type:t.type,key:n,ref:t.ref,props:t.props,_owner:t._owner}}(a,i+(!a.key||l&&l.key===a.key?"":(""+a.key).replace(E,"$&/")+"/")+n)),r.push(a)),1;if(l=0,o=""===o?".":o+":",b(n))for(var c=0;c<n.length;c++){var u=o+C(s=n[c],c);l+=N(s,r,i,u,a)}else if(u=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=d&&e[d]||e["@@iterator"])?e:null}(n),"function"==typeof u)for(n=u.call(n),c=0;!(s=n.next()).done;)l+=N(s=s.value,r,i,u=o+C(s,c++),a);else if("object"===s)throw r=String(n),Error("Objects are not valid as a React child (found: "+("[object Object]"===r?"object with keys {"+Object.keys(n).join(", ")+"}":r)+"). If you meant to render a collection of children, use an array instead.");return l}function T(e,t,n){if(null==e)return e;var r=[],i=0;return N(e,r,"","",function(e){return t.call(n,e,i++)}),r}function D(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)},function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var q={current:null},O={transition:null},I={ReactCurrentDispatcher:q,ReactCurrentBatchConfig:O,ReactCurrentOwner:S};function A(){throw Error("act(...) is not supported in production builds of React.")}return ux.Children={map:T,forEach:function(e,t,n){T(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return T(e,function(){t++}),t},toArray:function(e){return T(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},ux.Component=m,ux.Fragment=n,ux.Profiler=i,ux.PureComponent=y,ux.StrictMode=r,ux.Suspense=l,ux.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=I,ux.act=A,ux.cloneElement=function(t,n,r){if(null==t)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var i=h({},t.props),o=t.key,a=t.ref,s=t._owner;if(null!=n){if(void 0!==n.ref&&(a=n.ref,s=S.current),void 0!==n.key&&(o=""+n.key),t.type&&t.type.defaultProps)var l=t.type.defaultProps;for(c in n)x.call(n,c)&&!M.hasOwnProperty(c)&&(i[c]=void 0===n[c]&&void 0!==l?l[c]:n[c])}var c=arguments.length-2;if(1===c)i.children=r;else if(1<c){l=Array(c);for(var u=0;u<c;u++)l[u]=arguments[u+2];i.children=l}return{$$typeof:e,type:t.type,key:o,ref:a,props:i,_owner:s}},ux.createContext=function(e){return(e={$$typeof:a,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:o,_context:e},e.Consumer=e},ux.createElement=w,ux.createFactory=function(e){var t=w.bind(null,e);return t.type=e,t},ux.createRef=function(){return{current:null}},ux.forwardRef=function(e){return{$$typeof:s,render:e}},ux.isValidElement=k,ux.lazy=function(e){return{$$typeof:u,_payload:{_status:-1,_result:e},_init:D}},ux.memo=function(e,t){return{$$typeof:c,type:e,compare:void 0===t?null:t}},ux.startTransition=function(e){var t=O.transition;O.transition={};try{e()}finally{O.transition=t}},ux.unstable_act=A,ux.useCallback=function(e,t){return q.current.useCallback(e,t)},ux.useContext=function(e){return q.current.useContext(e)},ux.useDebugValue=function(){},ux.useDeferredValue=function(e){return q.current.useDeferredValue(e)},ux.useEffect=function(e,t){return q.current.useEffect(e,t)},ux.useId=function(){return q.current.useId()},ux.useImperativeHandle=function(e,t,n){return q.current.useImperativeHandle(e,t,n)},ux.useInsertionEffect=function(e,t){return q.current.useInsertionEffect(e,t)},ux.useLayoutEffect=function(e,t){return q.current.useLayoutEffect(e,t)},ux.useMemo=function(e,t){return q.current.useMemo(e,t)},ux.useReducer=function(e,t,n){return q.current.useReducer(e,t,n)},ux.useRef=function(e){return q.current.useRef(e)},ux.useState=function(e){return q.current.useState(e)},ux.useSyncExternalStore=function(e,t,n){return q.current.useSyncExternalStore(e,t,n)},ux.useTransition=function(){return q.current.useTransition()},ux.version="18.3.1",ux}function fx(){return sx||(sx=1,cx.exports=dx()),cx.exports}var hx=fx(),px=o(hx),mx=t({__proto__:null,default:px},[hx]);const gx={black:"#000",white:"#fff"},yx="#e57373",vx="#ef5350",bx="#f44336",xx="#d32f2f",Sx="#c62828",Mx="#f3e5f5",wx="#ce93d8",kx="#ba68c8",Ex="#ab47bc",Cx="#9c27b0",Nx="#7b1fa2",Tx="#e3f2fd",Dx="#90caf9",qx="#42a5f5",Ox="#1976d2",Ix="#1565c0",Ax="#4fc3f7",_x="#29b6f6",Lx="#03a9f4",Px="#0288d1",Rx="#01579b",Fx="#81c784",zx="#66bb6a",jx="#4caf50",$x="#388e3c",Vx="#2e7d32",Ux="#1b5e20",Hx="#ffb74d",Bx="#ffa726",Wx="#ff9800",Yx="#f57c00",Gx="#e65100",Kx={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"};function Xx(e){let t="https://mui.com/production-error/?code="+e;for(let e=1;e<arguments.length;e+=1)t+="&args[]="+encodeURIComponent(arguments[e]);return"Minified MUI error #"+e+"; visit "+t+" for the full message."}var Jx=Object.freeze({__proto__:null,default:Xx}),Zx="$$material";function Qx(){return Qx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Qx.apply(null,arguments)}function eS(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}var tS=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(t);try{n.insertRule(e,n.cssRules.length)}catch(e){}}else t.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach(function(e){var t;return null==(t=e.parentNode)?void 0:t.removeChild(e)}),this.tags=[],this.ctr=0},e}(),nS="-ms-",rS="-moz-",iS="-webkit-",oS="comm",aS="rule",sS="decl",lS="@keyframes",cS=Math.abs,uS=String.fromCharCode,dS=Object.assign;function fS(e){return e.trim()}function hS(e,t,n){return e.replace(t,n)}function pS(e,t){return e.indexOf(t)}function mS(e,t){return 0|e.charCodeAt(t)}function gS(e,t,n){return e.slice(t,n)}function yS(e){return e.length}function vS(e){return e.length}function bS(e,t){return t.push(e),e}var xS=1,SS=1,MS=0,wS=0,kS=0,ES="";function CS(e,t,n,r,i,o,a){return{value:e,root:t,parent:n,type:r,props:i,children:o,line:xS,column:SS,length:a,return:""}}function NS(e,t){return dS(CS("",null,null,"",null,null,0),e,{length:-e.length},t)}function TS(){return kS=wS>0?mS(ES,--wS):0,SS--,10===kS&&(SS=1,xS--),kS}function DS(){return kS=wS<MS?mS(ES,wS++):0,SS++,10===kS&&(SS=1,xS++),kS}function qS(){return mS(ES,wS)}function OS(){return wS}function IS(e,t){return gS(ES,e,t)}function AS(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function _S(e){return xS=SS=1,MS=yS(ES=e),wS=0,[]}function LS(e){return ES="",e}function PS(e){return fS(IS(wS-1,zS(91===e?e+2:40===e?e+1:e)))}function RS(e){for(;(kS=qS())&&kS<33;)DS();return AS(e)>2||AS(kS)>3?"":" "}function FS(e,t){for(;--t&&DS()&&!(kS<48||kS>102||kS>57&&kS<65||kS>70&&kS<97););return IS(e,OS()+(t<6&&32==qS()&&32==DS()))}function zS(e){for(;DS();)switch(kS){case e:return wS;case 34:case 39:34!==e&&39!==e&&zS(kS);break;case 40:41===e&&zS(e);break;case 92:DS()}return wS}function jS(e,t){for(;DS()&&e+kS!==57&&(e+kS!==84||47!==qS()););return"/*"+IS(t,wS-1)+"*"+uS(47===e?e:DS())}function $S(e){for(;!AS(qS());)DS();return IS(e,wS)}function VS(e){return LS(US("",null,null,null,[""],e=_S(e),0,[0],e))}function US(e,t,n,r,i,o,a,s,l){for(var c=0,u=0,d=a,f=0,h=0,p=0,m=1,g=1,y=1,v=0,b="",x=i,S=o,M=r,w=b;g;)switch(p=v,v=DS()){case 40:if(108!=p&&58==mS(w,d-1)){-1!=pS(w+=hS(PS(v),"&","&\f"),"&\f")&&(y=-1);break}case 34:case 39:case 91:w+=PS(v);break;case 9:case 10:case 13:case 32:w+=RS(p);break;case 92:w+=FS(OS()-1,7);continue;case 47:switch(qS()){case 42:case 47:bS(BS(jS(DS(),OS()),t,n),l);break;default:w+="/"}break;case 123*m:s[c++]=yS(w)*y;case 125*m:case 59:case 0:switch(v){case 0:case 125:g=0;case 59+u:-1==y&&(w=hS(w,/\f/g,"")),h>0&&yS(w)-d&&bS(h>32?WS(w+";",r,n,d-1):WS(hS(w," ","")+";",r,n,d-2),l);break;case 59:w+=";";default:if(bS(M=HS(w,t,n,c,u,i,s,b,x=[],S=[],d),o),123===v)if(0===u)US(w,t,M,M,x,o,d,s,S);else switch(99===f&&110===mS(w,3)?100:f){case 100:case 108:case 109:case 115:US(e,M,M,r&&bS(HS(e,M,M,0,0,i,s,b,i,x=[],d),S),i,S,d,s,r?x:S);break;default:US(w,M,M,M,[""],S,0,s,S)}}c=u=h=0,m=y=1,b=w="",d=a;break;case 58:d=1+yS(w),h=p;default:if(m<1)if(123==v)--m;else if(125==v&&0==m++&&125==TS())continue;switch(w+=uS(v),v*m){case 38:y=u>0?1:(w+="\f",-1);break;case 44:s[c++]=(yS(w)-1)*y,y=1;break;case 64:45===qS()&&(w+=PS(DS())),f=qS(),u=d=yS(b=w+=$S(OS())),v++;break;case 45:45===p&&2==yS(w)&&(m=0)}}return o}function HS(e,t,n,r,i,o,a,s,l,c,u){for(var d=i-1,f=0===i?o:[""],h=vS(f),p=0,m=0,g=0;p<r;++p)for(var y=0,v=gS(e,d+1,d=cS(m=a[p])),b=e;y<h;++y)(b=fS(m>0?f[y]+" "+v:hS(v,/&\f/g,f[y])))&&(l[g++]=b);return CS(e,t,n,0===i?aS:s,l,c,u)}function BS(e,t,n){return CS(e,t,n,oS,uS(kS),gS(e,2,-2),0)}function WS(e,t,n,r){return CS(e,t,n,sS,gS(e,0,r),gS(e,r+1,-1),r)}function YS(e,t){for(var n="",r=vS(e),i=0;i<r;i++)n+=t(e[i],i,e,t)||"";return n}function GS(e,t,n,r){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case sS:return e.return=e.return||e.value;case oS:return"";case lS:return e.return=e.value+"{"+YS(e.children,r)+"}";case aS:e.value=e.props.join(",")}return yS(n=YS(e.children,r))?e.return=e.value+"{"+n+"}":""}function KS(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var XS=function(e,t,n){for(var r=0,i=0;r=i,i=qS(),38===r&&12===i&&(t[n]=1),!AS(i);)DS();return IS(e,wS)},JS=function(e,t){return LS(function(e,t){var n=-1,r=44;do{switch(AS(r)){case 0:38===r&&12===qS()&&(t[n]=1),e[n]+=XS(wS-1,t,n);break;case 2:e[n]+=PS(r);break;case 4:if(44===r){e[++n]=58===qS()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=uS(r)}}while(r=DS());return e}(_S(e),t))},ZS=new WeakMap,QS=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,r=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||ZS.get(n))&&!r){ZS.set(e,!0);for(var i=[],o=JS(t,i),a=n.props,s=0,l=0;s<o.length;s++)for(var c=0;c<a.length;c++,l++)e.props[l]=i[s]?o[s].replace(/&\f/g,a[c]):a[c]+" "+o[s]}}},eM=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function tM(e,t){switch(function(e,t){return 45^mS(e,0)?(((t<<2^mS(e,0))<<2^mS(e,1))<<2^mS(e,2))<<2^mS(e,3):0}(e,t)){case 5103:return iS+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return iS+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return iS+e+rS+e+nS+e+e;case 6828:case 4268:return iS+e+nS+e+e;case 6165:return iS+e+nS+"flex-"+e+e;case 5187:return iS+e+hS(e,/(\w+).+(:[^]+)/,iS+"box-$1$2"+nS+"flex-$1$2")+e;case 5443:return iS+e+nS+"flex-item-"+hS(e,/flex-|-self/,"")+e;case 4675:return iS+e+nS+"flex-line-pack"+hS(e,/align-content|flex-|-self/,"")+e;case 5548:return iS+e+nS+hS(e,"shrink","negative")+e;case 5292:return iS+e+nS+hS(e,"basis","preferred-size")+e;case 6060:return iS+"box-"+hS(e,"-grow","")+iS+e+nS+hS(e,"grow","positive")+e;case 4554:return iS+hS(e,/([^-])(transform)/g,"$1"+iS+"$2")+e;case 6187:return hS(hS(hS(e,/(zoom-|grab)/,iS+"$1"),/(image-set)/,iS+"$1"),e,"")+e;case 5495:case 3959:return hS(e,/(image-set\([^]*)/,iS+"$1$`$1");case 4968:return hS(hS(e,/(.+:)(flex-)?(.*)/,iS+"box-pack:$3"+nS+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+iS+e+e;case 4095:case 3583:case 4068:case 2532:return hS(e,/(.+)-inline(.+)/,iS+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(yS(e)-1-t>6)switch(mS(e,t+1)){case 109:if(45!==mS(e,t+4))break;case 102:return hS(e,/(.+:)(.+)-([^]+)/,"$1"+iS+"$2-$3$1"+rS+(108==mS(e,t+3)?"$3":"$2-$3"))+e;case 115:return~pS(e,"stretch")?tM(hS(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==mS(e,t+1))break;case 6444:switch(mS(e,yS(e)-3-(~pS(e,"!important")&&10))){case 107:return hS(e,":",":"+iS)+e;case 101:return hS(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+iS+(45===mS(e,14)?"inline-":"")+"box$3$1"+iS+"$2$3$1"+nS+"$2box$3")+e}break;case 5936:switch(mS(e,t+11)){case 114:return iS+e+nS+hS(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return iS+e+nS+hS(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return iS+e+nS+hS(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return iS+e+nS+e+e}return e}var nM,rM,iM,oM,aM=[function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case sS:e.return=tM(e.value,e.length);break;case lS:return YS([NS(e,{value:hS(e.value,"@","@"+iS)})],r);case aS:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,function(t){switch(function(e,t){return(e=t.exec(e))?e[0]:e}(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return YS([NS(e,{props:[hS(t,/:(read-\w+)/,":-moz-$1")]})],r);case"::placeholder":return YS([NS(e,{props:[hS(t,/:(plac\w+)/,":"+iS+"input-$1")]}),NS(e,{props:[hS(t,/:(plac\w+)/,":-moz-$1")]}),NS(e,{props:[hS(t,/:(plac\w+)/,nS+"input-$1")]})],r)}return""})}}],sM=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))})}var r,i,o=e.stylisPlugins||aM,a={},s=[];r=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n<t.length;n++)a[t[n]]=!0;s.push(e)});var l,c,u=[GS,(c=function(e){l.insert(e)},function(e){e.root||(e=e.return)&&c(e)})],d=function(e){var t=vS(e);return function(n,r,i,o){for(var a="",s=0;s<t;s++)a+=e[s](n,r,i,o)||"";return a}}([QS,eM].concat(o,u));i=function(e,t,n,r){l=n,function(e){YS(VS(e),d)}(e?e+"{"+t.styles+"}":t.styles),r&&(f.inserted[t.name]=!0)};var f={key:t,sheet:new tS({key:t,container:r,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:a,registered:{},insert:i};return f.sheet.hydrate(s),f},lM={exports:{}},cM={};function uM(){return rM||(rM=1,lM.exports=function(){if(nM)return cM;nM=1;var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,h=e?Symbol.for("react.memo"):60115,p=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,v=e?Symbol.for("react.scope"):60119;function b(e){if("object"==typeof e&&null!==e){var f=e.$$typeof;switch(f){case t:switch(e=e.type){case l:case c:case r:case o:case i:case d:return e;default:switch(e=e&&e.$$typeof){case s:case u:case p:case h:case a:return e;default:return f}}case n:return f}}}function x(e){return b(e)===c}return cM.AsyncMode=l,cM.ConcurrentMode=c,cM.ContextConsumer=s,cM.ContextProvider=a,cM.Element=t,cM.ForwardRef=u,cM.Fragment=r,cM.Lazy=p,cM.Memo=h,cM.Portal=n,cM.Profiler=o,cM.StrictMode=i,cM.Suspense=d,cM.isAsyncMode=function(e){return x(e)||b(e)===l},cM.isConcurrentMode=x,cM.isContextConsumer=function(e){return b(e)===s},cM.isContextProvider=function(e){return b(e)===a},cM.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},cM.isForwardRef=function(e){return b(e)===u},cM.isFragment=function(e){return b(e)===r},cM.isLazy=function(e){return b(e)===p},cM.isMemo=function(e){return b(e)===h},cM.isPortal=function(e){return b(e)===n},cM.isProfiler=function(e){return b(e)===o},cM.isStrictMode=function(e){return b(e)===i},cM.isSuspense=function(e){return b(e)===d},cM.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===c||e===o||e===i||e===d||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===p||e.$$typeof===h||e.$$typeof===a||e.$$typeof===s||e.$$typeof===u||e.$$typeof===g||e.$$typeof===y||e.$$typeof===v||e.$$typeof===m)},cM.typeOf=b,cM}()),lM.exports}!function(){if(oM)return iM;oM=1;var e=uM(),t={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},n={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},r={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},i={};function o(n){return e.isMemo(n)?r:i[n.$$typeof]||t}i[e.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},i[e.Memo]=r;var a=Object.defineProperty,s=Object.getOwnPropertyNames,l=Object.getOwnPropertySymbols,c=Object.getOwnPropertyDescriptor,u=Object.getPrototypeOf,d=Object.prototype;iM=function e(t,r,i){if("string"!=typeof r){if(d){var f=u(r);f&&f!==d&&e(t,f,i)}var h=s(r);l&&(h=h.concat(l(r)));for(var p=o(t),m=o(r),g=0;g<h.length;++g){var y=h[g];if(!(n[y]||i&&i[y]||m&&m[y]||p&&p[y])){var v=c(r,y);try{a(t,y,v)}catch(e){}}}}return t}}();function dM(e,t,n){var r="";return n.split(" ").forEach(function(n){void 0!==e[n]?t.push(e[n]+";"):n&&(r+=n+" ")}),r}var fM=function(e,t,n){var r=e.key+"-"+t.name;!1===n&&void 0===e.registered[r]&&(e.registered[r]=t.styles)},hM=function(e,t,n){fM(e,t,n);var r=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var i=t;do{e.insert(t===i?"."+r:"",i,e.sheet,!0),i=i.next}while(void 0!==i)}};var pM={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},mM=/[A-Z]|^ms/g,gM=/_EMO_([^_]+?)_([^]*?)_EMO_/g,yM=function(e){return 45===e.charCodeAt(1)},vM=function(e){return null!=e&&"boolean"!=typeof e},bM=KS(function(e){return yM(e)?e:e.replace(mM,"-$&").toLowerCase()}),xM=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(gM,function(e,t,n){return MM={name:t,styles:n,next:MM},t})}return 1===pM[e]||yM(e)||"number"!=typeof t||0===t?t:t+"px"};function SM(e,t,n){if(null==n)return"";var r=n;if(void 0!==r.__emotion_styles)return r;switch(typeof n){case"boolean":return"";case"object":var i=n;if(1===i.anim)return MM={name:i.name,styles:i.styles,next:MM},i.name;var o=n;if(void 0!==o.styles){var a=o.next;if(void 0!==a)for(;void 0!==a;)MM={name:a.name,styles:a.styles,next:MM},a=a.next;return o.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i<n.length;i++)r+=SM(e,t,n[i])+";";else for(var o in n){var a=n[o];if("object"!=typeof a){var s=a;null!=t&&void 0!==t[s]?r+=o+"{"+t[s]+"}":vM(s)&&(r+=bM(o)+":"+xM(o,s)+";")}else if(!Array.isArray(a)||"string"!=typeof a[0]||null!=t&&void 0!==t[a[0]]){var l=SM(e,t,a);switch(o){case"animation":case"animationName":r+=bM(o)+":"+l+";";break;default:r+=o+"{"+l+"}"}}else for(var c=0;c<a.length;c++)vM(a[c])&&(r+=bM(o)+":"+xM(o,a[c])+";")}return r}(e,t,n);case"function":if(void 0!==e){var s=MM,l=n(e);return MM=s,SM(e,t,l)}}var c=n;if(null==t)return c;var u=t[c];return void 0!==u?u:c}var MM,wM=/label:\s*([^\s;{]+)\s*(;|$)/g;function kM(e,t,n){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var r=!0,i="";MM=void 0;var o=e[0];null==o||void 0===o.raw?(r=!1,i+=SM(n,t,o)):i+=o[0];for(var a=1;a<e.length;a++){if(i+=SM(n,t,e[a]),r)i+=o[a]}wM.lastIndex=0;for(var s,l="";null!==(s=wM.exec(i));)l+="-"+s[1];var c=function(e){for(var t,n=0,r=0,i=e.length;i>=4;++r,i-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(i){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)}(i)+l;return{name:c,styles:i,next:MM}}var EM,CM,NM=!!mx.useInsertionEffect&&mx.useInsertionEffect,TM=NM||function(e){return e()},DM=NM||hx.useLayoutEffect,qM=hx.createContext("undefined"!=typeof HTMLElement?sM({key:"css"}):null),OM=qM.Provider,IM=function(e){return hx.forwardRef(function(t,n){var r=hx.useContext(qM);return e(t,r,n)})},AM=hx.createContext({}),_M={}.hasOwnProperty,LM="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",PM=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return fM(t,n,r),TM(function(){return hM(t,n,r)}),null},RM=IM(function(e,t,n){var r=e.css;"string"==typeof r&&void 0!==t.registered[r]&&(r=t.registered[r]);var i=e[LM],o=[r],a="";"string"==typeof e.className?a=dM(t.registered,o,e.className):null!=e.className&&(a=e.className+" ");var s=kM(o,void 0,hx.useContext(AM));a+=t.key+"-"+s.name;var l={};for(var c in e)_M.call(e,c)&&"css"!==c&&c!==LM&&(l[c]=e[c]);return l.className=a,n&&(l.ref=n),hx.createElement(hx.Fragment,null,hx.createElement(PM,{cache:t,serialized:s,isStringTag:"string"==typeof i}),hx.createElement(i,l))}),FM=function(e,t){var n=arguments;if(null==t||!_M.call(t,"css"))return hx.createElement.apply(void 0,n);var r=n.length,i=new Array(r);i[0]=RM,i[1]=function(e,t){var n={};for(var r in t)_M.call(t,r)&&(n[r]=t[r]);return n[LM]=e,n}(e,t);for(var o=2;o<r;o++)i[o]=n[o];return hx.createElement.apply(null,i)};EM=FM||(FM={}),CM||(CM=EM.JSX||(EM.JSX={}));var zM=IM(function(e,t){var n=kM([e.styles],void 0,hx.useContext(AM)),r=hx.useRef();return DM(function(){var e=t.key+"-global",i=new t.sheet.constructor({key:e,nonce:t.sheet.nonce,container:t.sheet.container,speedy:t.sheet.isSpeedy}),o=!1,a=document.querySelector('style[data-emotion="'+e+" "+n.name+'"]');return t.sheet.tags.length&&(i.before=t.sheet.tags[0]),null!==a&&(o=!0,a.setAttribute("data-emotion",e),i.hydrate([a])),r.current=[i,o],function(){i.flush()}},[t]),DM(function(){var e=r.current,i=e[0];if(e[1])e[1]=!1;else{if(void 0!==n.next&&hM(t,n.next,!0),i.tags.length){var o=i.tags[i.tags.length-1].nextElementSibling;i.before=o,i.flush()}t.insert("",n,i,!1)}},[t,n.name]),null});function jM(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return kM(t)}function $M(){var e=jM.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}var VM=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,UM=KS(function(e){return VM.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}),HM=function(e){return"theme"!==e},BM=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?UM:HM},WM=function(e,t,n){var r;if(t){var i=t.shouldForwardProp;r=e.__emotion_forwardProp&&i?function(t){return e.__emotion_forwardProp(t)&&i(t)}:i}return"function"!=typeof r&&n&&(r=e.__emotion_forwardProp),r},YM=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return fM(t,n,r),TM(function(){return hM(t,n,r)}),null},GM=function e(t,n){var r,i,o=t.__emotion_real===t,a=o&&t.__emotion_base||t;void 0!==n&&(r=n.label,i=n.target);var s=WM(t,n,o),l=s||BM(a),c=!l("as");return function(){var u=arguments,d=o&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==r&&d.push("label:"+r+";"),null==u[0]||void 0===u[0].raw)d.push.apply(d,u);else{var f=u[0];d.push(f[0]);for(var h=u.length,p=1;p<h;p++)d.push(u[p],f[p])}var m=IM(function(e,t,n){var r=c&&e.as||a,o="",u=[],f=e;if(null==e.theme){for(var h in f={},e)f[h]=e[h];f.theme=hx.useContext(AM)}"string"==typeof e.className?o=dM(t.registered,u,e.className):null!=e.className&&(o=e.className+" ");var p=kM(d.concat(u),t.registered,f);o+=t.key+"-"+p.name,void 0!==i&&(o+=" "+i);var m=c&&void 0===s?BM(r):l,g={};for(var y in e)c&&"as"===y||m(y)&&(g[y]=e[y]);return g.className=o,n&&(g.ref=n),hx.createElement(hx.Fragment,null,hx.createElement(YM,{cache:t,serialized:p,isStringTag:"string"==typeof r}),hx.createElement(r,g))});return m.displayName=void 0!==r?r:"Styled("+("string"==typeof a?a:a.displayName||a.name||"Component")+")",m.defaultProps=t.defaultProps,m.__emotion_real=m,m.__emotion_base=a,m.__emotion_styles=d,m.__emotion_forwardProp=s,Object.defineProperty(m,"toString",{value:function(){return"."+i}}),m.withComponent=function(t,r){return e(t,Qx({},n,r,{shouldForwardProp:WM(m,r,!0)})).apply(void 0,d)},m}}.bind(null);["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach(function(e){GM[e]=GM(e)});var KM,XM,JM={exports:{}},ZM={};var QM=(XM||(XM=1,JM.exports=function(){if(KM)return ZM;KM=1;var e=fx(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function a(e,n,a){var s,l={},c=null,u=null;for(s in void 0!==a&&(c=""+a),void 0!==n.key&&(c=""+n.key),void 0!==n.ref&&(u=n.ref),n)r.call(n,s)&&!o.hasOwnProperty(s)&&(l[s]=n[s]);if(e&&e.defaultProps)for(s in n=e.defaultProps)void 0===l[s]&&(l[s]=n[s]);return{$$typeof:t,type:e,key:c,ref:u,props:l,_owner:i.current}}return ZM.Fragment=n,ZM.jsx=a,ZM.jsxs=a,ZM}()),JM.exports);const ew=new Map;function tw(e){const{styles:t,defaultTheme:n={}}=e,r="function"==typeof t?e=>{return t(null==(r=e)||0===Object.keys(r).length?n:e);var r}:t;return QM.jsx(zM,{styles:r})}
/**
   * @mui/styled-engine v5.18.0
   *
   * @license MIT
   * This source code is licensed under the MIT license found in the
   * LICENSE file in the root directory of this source tree.
   */const nw=[];function rw(e){return nw[0]=e,kM(nw)}var iw=Object.freeze({__proto__:null,GlobalStyles:tw,StyledEngineProvider:function(e){const{injectFirst:t,enableCssLayer:n,children:r}=e,i=hx.useMemo(()=>{const e=`${t}-${n}`;if("object"==typeof document&&ew.has(e))return ew.get(e);const r=function(e,t){const n=sM({key:"css",prepend:e});if(t){const e=n.insert;n.insert=(...t)=>(t[1].styles.match(/^@layer\s+[^{]*$/)||(t[1].styles=`@layer mui {${t[1].styles}}`),e(...t))}return n}(t,n);return ew.set(e,r),r},[t,n]);return t||n?QM.jsx(OM,{value:i,children:r}):r},ThemeContext:AM,css:jM,default:function(e,t){return GM(e,t)},internal_processStyles:(e,t)=>{Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))},internal_serializeStyles:rw,keyframes:$M});function ow(e){if("object"!=typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)}function aw(e){if(hx.isValidElement(e)||!ow(e))return e;const t={};return Object.keys(e).forEach(n=>{t[n]=aw(e[n])}),t}function sw(e,t,n={clone:!0}){const r=n.clone?Qx({},e):e;return ow(e)&&ow(t)&&Object.keys(t).forEach(i=>{hx.isValidElement(t[i])?r[i]=t[i]:ow(t[i])&&Object.prototype.hasOwnProperty.call(e,i)&&ow(e[i])?r[i]=sw(e[i],t[i],n):n.clone?r[i]=ow(t[i])?aw(t[i]):t[i]:r[i]=t[i]}),r}var lw=Object.freeze({__proto__:null,default:sw,isPlainObject:ow});const cw=["values","unit","step"];function uw(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5}=e,i=eS(e,cw),o=(e=>{const t=Object.keys(e).map(t=>({key:t,val:e[t]}))||[];return t.sort((e,t)=>e.val-t.val),t.reduce((e,t)=>Qx({},e,{[t.key]:t.val}),{})})(t),a=Object.keys(o);function s(e){return`@media (min-width:${"number"==typeof t[e]?t[e]:e}${n})`}function l(e){return`@media (max-width:${("number"==typeof t[e]?t[e]:e)-r/100}${n})`}function c(e,i){const o=a.indexOf(i);return`@media (min-width:${"number"==typeof t[e]?t[e]:e}${n}) and (max-width:${(-1!==o&&"number"==typeof t[a[o]]?t[a[o]]:i)-r/100}${n})`}return Qx({keys:a,values:o,up:s,down:l,between:c,only:function(e){return a.indexOf(e)+1<a.length?c(e,a[a.indexOf(e)+1]):s(e)},not:function(e){const t=a.indexOf(e);return 0===t?s(a[1]):t===a.length-1?l(a[t]):c(e,a[a.indexOf(e)+1]).replace("@media","@media not all and")},unit:n},i)}const dw={borderRadius:4};function fw(e,t){return t?sw(e,t,{clone:!1}):e}const hw={xs:0,sm:600,md:900,lg:1200,xl:1536},pw={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${hw[e]}px)`};function mw(e,t,n){const r=e.theme||{};if(Array.isArray(t)){const e=r.breakpoints||pw;return t.reduce((r,i,o)=>(r[e.up(e.keys[o])]=n(t[o]),r),{})}if("object"==typeof t){const e=r.breakpoints||pw;return Object.keys(t).reduce((r,i)=>{if(-1!==Object.keys(e.values||hw).indexOf(i)){r[e.up(i)]=n(t[i],i)}else{const e=i;r[e]=t[e]}return r},{})}return n(t)}function gw(e,t){return e.reduce((e,t)=>{const n=e[t];return(!n||0===Object.keys(n).length)&&delete e[t],e},t)}function yw(e){if("string"!=typeof e)throw new Error(Xx(7));return e.charAt(0).toUpperCase()+e.slice(1)}var vw=Object.freeze({__proto__:null,default:yw});function bw(e,t,n=!0){if(!t||"string"!=typeof t)return null;if(e&&e.vars&&n){const n=`vars.${t}`.split(".").reduce((e,t)=>e&&e[t]?e[t]:null,e);if(null!=n)return n}return t.split(".").reduce((e,t)=>e&&null!=e[t]?e[t]:null,e)}function xw(e,t,n,r=n){let i;return i="function"==typeof e?e(n):Array.isArray(e)?e[n]||r:bw(e,n)||r,t&&(i=t(i,r,e)),i}function Sw(e){const{prop:t,cssProperty:n=e.prop,themeKey:r,transform:i}=e,o=e=>{if(null==e[t])return null;const o=e[t],a=bw(e.theme,r)||{};return mw(e,o,e=>{let r=xw(a,i,e);return e===r&&"string"==typeof e&&(r=xw(a,i,`${t}${"default"===e?"":yw(e)}`,e)),!1===n?r:{[n]:r}})};return o.propTypes={},o.filterProps=[t],o}const Mw={m:"margin",p:"padding"},ww={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},kw={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},Ew=function(e){const t={};return n=>(void 0===t[n]&&(t[n]=e(n)),t[n])}(e=>{if(e.length>2){if(!kw[e])return[e];e=kw[e]}const[t,n]=e.split(""),r=Mw[t],i=ww[n]||"";return Array.isArray(i)?i.map(e=>r+e):[r+i]}),Cw=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],Nw=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];function Tw(e,t,n,r){var i;const o=null!=(i=bw(e,t,!1))?i:n;return"number"==typeof o?e=>"string"==typeof e?e:o*e:Array.isArray(o)?e=>"string"==typeof e?e:o[e]:"function"==typeof o?o:()=>{}}function Dw(e){return Tw(e,"spacing",8)}function qw(e,t){if("string"==typeof t||null==t)return t;const n=e(Math.abs(t));return t>=0?n:"number"==typeof n?-n:`-${n}`}function Ow(e,t,n,r){if(-1===t.indexOf(n))return null;const i=function(e,t){return n=>e.reduce((e,r)=>(e[r]=qw(t,n),e),{})}(Ew(n),r);return mw(e,e[n],i)}function Iw(e,t){const n=Dw(e.theme);return Object.keys(e).map(r=>Ow(e,t,r,n)).reduce(fw,{})}function Aw(e){return Iw(e,Cw)}function _w(e){return Iw(e,Nw)}function Lw(...e){const t=e.reduce((e,t)=>(t.filterProps.forEach(n=>{e[n]=t}),e),{}),n=e=>Object.keys(e).reduce((n,r)=>t[r]?fw(n,t[r](e)):n,{});return n.propTypes={},n.filterProps=e.reduce((e,t)=>e.concat(t.filterProps),[]),n}function Pw(e){return"number"!=typeof e?e:`${e}px solid`}function Rw(e,t){return Sw({prop:e,themeKey:"borders",transform:t})}Aw.propTypes={},Aw.filterProps=Cw,_w.propTypes={},_w.filterProps=Nw;const Fw=Rw("border",Pw),zw=Rw("borderTop",Pw),jw=Rw("borderRight",Pw),$w=Rw("borderBottom",Pw),Vw=Rw("borderLeft",Pw),Uw=Rw("borderColor"),Hw=Rw("borderTopColor"),Bw=Rw("borderRightColor"),Ww=Rw("borderBottomColor"),Yw=Rw("borderLeftColor"),Gw=Rw("outline",Pw),Kw=Rw("outlineColor"),Xw=e=>{if(void 0!==e.borderRadius&&null!==e.borderRadius){const t=Tw(e.theme,"shape.borderRadius",4),n=e=>({borderRadius:qw(t,e)});return mw(e,e.borderRadius,n)}return null};Xw.propTypes={},Xw.filterProps=["borderRadius"],Lw(Fw,zw,jw,$w,Vw,Uw,Hw,Bw,Ww,Yw,Xw,Gw,Kw);const Jw=e=>{if(void 0!==e.gap&&null!==e.gap){const t=Tw(e.theme,"spacing",8),n=e=>({gap:qw(t,e)});return mw(e,e.gap,n)}return null};Jw.propTypes={},Jw.filterProps=["gap"];const Zw=e=>{if(void 0!==e.columnGap&&null!==e.columnGap){const t=Tw(e.theme,"spacing",8),n=e=>({columnGap:qw(t,e)});return mw(e,e.columnGap,n)}return null};Zw.propTypes={},Zw.filterProps=["columnGap"];const Qw=e=>{if(void 0!==e.rowGap&&null!==e.rowGap){const t=Tw(e.theme,"spacing",8),n=e=>({rowGap:qw(t,e)});return mw(e,e.rowGap,n)}return null};Qw.propTypes={},Qw.filterProps=["rowGap"];function ek(e,t){return"grey"===t?t:e}Lw(Jw,Zw,Qw,Sw({prop:"gridColumn"}),Sw({prop:"gridRow"}),Sw({prop:"gridAutoFlow"}),Sw({prop:"gridAutoColumns"}),Sw({prop:"gridAutoRows"}),Sw({prop:"gridTemplateColumns"}),Sw({prop:"gridTemplateRows"}),Sw({prop:"gridTemplateAreas"}),Sw({prop:"gridArea"}));function tk(e){return e<=1&&0!==e?100*e+"%":e}Lw(Sw({prop:"color",themeKey:"palette",transform:ek}),Sw({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:ek}),Sw({prop:"backgroundColor",themeKey:"palette",transform:ek}));const nk=Sw({prop:"width",transform:tk}),rk=e=>{if(void 0!==e.maxWidth&&null!==e.maxWidth){const t=t=>{var n,r;const i=(null==(n=e.theme)||null==(n=n.breakpoints)||null==(n=n.values)?void 0:n[t])||hw[t];return i?"px"!==(null==(r=e.theme)||null==(r=r.breakpoints)?void 0:r.unit)?{maxWidth:`${i}${e.theme.breakpoints.unit}`}:{maxWidth:i}:{maxWidth:tk(t)}};return mw(e,e.maxWidth,t)}return null};rk.filterProps=["maxWidth"];const ik=Sw({prop:"minWidth",transform:tk}),ok=Sw({prop:"height",transform:tk}),ak=Sw({prop:"maxHeight",transform:tk}),sk=Sw({prop:"minHeight",transform:tk});Sw({prop:"size",cssProperty:"width",transform:tk}),Sw({prop:"size",cssProperty:"height",transform:tk});Lw(nk,rk,ik,ok,ak,sk,Sw({prop:"boxSizing"}));const lk={border:{themeKey:"borders",transform:Pw},borderTop:{themeKey:"borders",transform:Pw},borderRight:{themeKey:"borders",transform:Pw},borderBottom:{themeKey:"borders",transform:Pw},borderLeft:{themeKey:"borders",transform:Pw},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:Pw},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:Xw},color:{themeKey:"palette",transform:ek},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:ek},backgroundColor:{themeKey:"palette",transform:ek},p:{style:_w},pt:{style:_w},pr:{style:_w},pb:{style:_w},pl:{style:_w},px:{style:_w},py:{style:_w},padding:{style:_w},paddingTop:{style:_w},paddingRight:{style:_w},paddingBottom:{style:_w},paddingLeft:{style:_w},paddingX:{style:_w},paddingY:{style:_w},paddingInline:{style:_w},paddingInlineStart:{style:_w},paddingInlineEnd:{style:_w},paddingBlock:{style:_w},paddingBlockStart:{style:_w},paddingBlockEnd:{style:_w},m:{style:Aw},mt:{style:Aw},mr:{style:Aw},mb:{style:Aw},ml:{style:Aw},mx:{style:Aw},my:{style:Aw},margin:{style:Aw},marginTop:{style:Aw},marginRight:{style:Aw},marginBottom:{style:Aw},marginLeft:{style:Aw},marginX:{style:Aw},marginY:{style:Aw},marginInline:{style:Aw},marginInlineStart:{style:Aw},marginInlineEnd:{style:Aw},marginBlock:{style:Aw},marginBlockStart:{style:Aw},marginBlockEnd:{style:Aw},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:Jw},rowGap:{style:Qw},columnGap:{style:Zw},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:tk},maxWidth:{style:rk},minWidth:{transform:tk},height:{transform:tk},maxHeight:{transform:tk},minHeight:{transform:tk},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function ck(){function e(e,t,n,r){const i={[e]:t,theme:n},o=r[e];if(!o)return{[e]:t};const{cssProperty:a=e,themeKey:s,transform:l,style:c}=o;if(null==t)return null;if("typography"===s&&"inherit"===t)return{[e]:t};const u=bw(n,s)||{};if(c)return c(i);return mw(i,t,t=>{let n=xw(u,l,t);return t===n&&"string"==typeof t&&(n=xw(u,l,`${e}${"default"===t?"":yw(t)}`,t)),!1===a?n:{[a]:n}})}return function t(n){var r;const{sx:i,theme:o={},nested:a}=n||{};if(!i)return null;const s=null!=(r=o.unstable_sxConfig)?r:lk;function l(n){let r=n;if("function"==typeof n)r=n(o);else if("object"!=typeof n)return n;if(!r)return null;const i=function(e={}){var t;return(null==(t=e.keys)?void 0:t.reduce((t,n)=>(t[e.up(n)]={},t),{}))||{}}(o.breakpoints),l=Object.keys(i);let c=i;return Object.keys(r).forEach(n=>{const i=(a=r[n],l=o,"function"==typeof a?a(l):a);var a,l;if(null!=i)if("object"==typeof i)if(s[n])c=fw(c,e(n,i,o,s));else{const e=mw({theme:o},i,e=>({[n]:e}));!function(...e){const t=e.reduce((e,t)=>e.concat(Object.keys(t)),[]),n=new Set(t);return e.every(e=>n.size===Object.keys(e).length)}(e,i)?c=fw(c,e):c[n]=t({sx:i,theme:o,nested:!0})}else c=fw(c,e(n,i,o,s))}),!a&&o.modularCssLayers?{"@layer sx":gw(l,c)}:gw(l,c)}return Array.isArray(i)?i.map(l):l(i)}}const uk=ck();function dk(e,t){const n=this;if(n.vars&&"function"==typeof n.getColorSchemeSelector){const r=n.getColorSchemeSelector(e).replace(/(\[[^\]]+\])/,"*:where($1)");return{[r]:t}}return n.palette.mode===e?t:{}}uk.filterProps=["sx"];const fk=["breakpoints","palette","spacing","shape"];function hk(e={},...t){const{breakpoints:n={},palette:r={},spacing:i,shape:o={}}=e,a=eS(e,fk),s=uw(n),l=function(e=8){if(e.mui)return e;const t=Dw({spacing:e}),n=(...e)=>(0===e.length?[1]:e).map(e=>{const n=t(e);return"number"==typeof n?`${n}px`:n}).join(" ");return n.mui=!0,n}(i);let c=sw({breakpoints:s,direction:"ltr",components:{},palette:Qx({mode:"light"},r),spacing:l,shape:Qx({},dw,o)},a);return c.applyStyles=dk,c=t.reduce((e,t)=>sw(e,t),c),c.unstable_sxConfig=Qx({},lk,null==a?void 0:a.unstable_sxConfig),c.unstable_sx=function(e){return uk({sx:e,theme:this})},c}var pk=Object.freeze({__proto__:null,default:hk,private_createBreakpoints:uw,unstable_applyStyles:dk});function mk(e=null){const t=hx.useContext(AM);return t&&(n=t,0!==Object.keys(n).length)?t:e;var n}const gk=hk();function yk(e=gk){return mk(e)}function vk(e){const t=rw(e);return e!==t&&t.styles?(t.styles.match(/^@layer\s+[^{]*$/)||(t.styles=`@layer global{${t.styles}}`),t):e}function bk({styles:e,themeId:t,defaultTheme:n={}}){const r=yk(n),i=t&&r[t]||r;let o="function"==typeof e?e(i):e;return i.modularCssLayers&&(o=Array.isArray(o)?o.map(e=>vk("function"==typeof e?e(i):e)):vk(o)),QM.jsx(tw,{styles:o})}const xk=["sx"];function Sk(e){const{sx:t}=e,n=eS(e,xk),{systemProps:r,otherProps:i}=(e=>{var t,n;const r={systemProps:{},otherProps:{}},i=null!=(t=null==e||null==(n=e.theme)?void 0:n.unstable_sxConfig)?t:lk;return Object.keys(e).forEach(t=>{i[t]?r.systemProps[t]=e[t]:r.otherProps[t]=e[t]}),r})(n);let o;return o=Array.isArray(t)?[r,...t]:"function"==typeof t?(...e)=>{const n=t(...e);return ow(n)?Qx({},r,n):r}:Qx({},r,t),Qx({},i,{sx:o})}var Mk=Object.freeze({__proto__:null,default:uk,extendSxProp:Sk,unstable_createStyleFunctionSx:ck,unstable_defaultSxConfig:lk});const wk=e=>e,kk=(()=>{let e=wk;return{configure(t){e=t},generate:t=>e(t),reset(){e=wk}}})();function Ek(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Ek(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Ck(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Ek(e))&&(r&&(r+=" "),r+=t);return r}const Nk={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function Tk(e,t,n="Mui"){const r=Nk[t];return r?`${n}-${r}`:`${kk.generate(e)}-${t}`}function Dk(e,t,n="Mui"){const r={};return t.forEach(t=>{r[t]=Tk(e,t,n)}),r}var qk,Ok,Ik={exports:{}},Ak={};function _k(){if(qk)return Ak;qk=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),a=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),u=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),f=Symbol.for("react.view_transition"),h=Symbol.for("react.client.reference");function p(h){if("object"==typeof h&&null!==h){var p=h.$$typeof;switch(p){case e:switch(h=h.type){case n:case i:case r:case l:case c:case f:return h;default:switch(h=h&&h.$$typeof){case a:case s:case d:case u:case o:return h;default:return p}}case t:return p}}}return Ak.ContextConsumer=o,Ak.ContextProvider=a,Ak.Element=e,Ak.ForwardRef=s,Ak.Fragment=n,Ak.Lazy=d,Ak.Memo=u,Ak.Portal=t,Ak.Profiler=i,Ak.StrictMode=r,Ak.Suspense=l,Ak.SuspenseList=c,Ak.isContextConsumer=function(e){return p(e)===o},Ak.isContextProvider=function(e){return p(e)===a},Ak.isElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===e},Ak.isForwardRef=function(e){return p(e)===s},Ak.isFragment=function(e){return p(e)===n},Ak.isLazy=function(e){return p(e)===d},Ak.isMemo=function(e){return p(e)===u},Ak.isPortal=function(e){return p(e)===t},Ak.isProfiler=function(e){return p(e)===i},Ak.isStrictMode=function(e){return p(e)===r},Ak.isSuspense=function(e){return p(e)===l},Ak.isSuspenseList=function(e){return p(e)===c},Ak.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===n||e===i||e===r||e===l||e===c||"object"==typeof e&&null!==e&&(e.$$typeof===d||e.$$typeof===u||e.$$typeof===a||e.$$typeof===o||e.$$typeof===s||e.$$typeof===h||void 0!==e.getModuleId)},Ak.typeOf=p,Ak}function Lk(){return Ok||(Ok=1,Ik.exports=_k()),Ik.exports}var Pk=Lk();const Rk=/^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/;function Fk(e){const t=`${e}`.match(Rk);return t&&t[1]||""}function zk(e,t=""){return e.displayName||e.name||Fk(e)||t}function jk(e,t,n){const r=zk(t);return e.displayName||(""!==r?`${n}(${r})`:n)}var $k=Object.freeze({__proto__:null,default:function(e){if(null!=e){if("string"==typeof e)return e;if("function"==typeof e)return zk(e,"Component");if("object"==typeof e)switch(e.$$typeof){case Pk.ForwardRef:return jk(e,e.render,"ForwardRef");case Pk.Memo:return jk(e,e.type,"memo");default:return}}},getFunctionName:Fk});function Vk(e,t){const n=Qx({},t);return Object.keys(e).forEach(r=>{if(r.toString().match(/^(components|slots)$/))n[r]=Qx({},e[r],n[r]);else if(r.toString().match(/^(componentsProps|slotProps)$/)){const i=e[r]||{},o=t[r];n[r]={},o&&Object.keys(o)?i&&Object.keys(i)?(n[r]=Qx({},o),Object.keys(i).forEach(e=>{n[r][e]=Vk(i[e],o[e])})):n[r]=o:n[r]=i}else void 0===n[r]&&(n[r]=e[r])}),n}const Uk="undefined"!=typeof window?hx.useLayoutEffect:hx.useEffect;var Hk=Object.freeze({__proto__:null,default:function(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}});function Bk(...e){return e.reduce((e,t)=>null==t?e:function(...n){e.apply(this,n),t.apply(this,n)},()=>{})}function Wk(e){return e&&e.ownerDocument||document}function Yk(e){return Wk(e).defaultView||window}function Gk(e,t){"function"==typeof e?e(t):e&&(e.current=t)}let Kk=0;const Xk=mx["useId".toString()];function Jk(e){if(void 0!==Xk){return Xk()}return function(e){const[t,n]=hx.useState(e),r=e||t;return hx.useEffect(()=>{null==t&&(Kk+=1,n(`mui-${Kk}`))},[t]),r}(e)}function Zk(e){const t=hx.useRef(e);return Uk(()=>{t.current=e}),hx.useRef((...e)=>(0,t.current)(...e)).current}function Qk(...e){return hx.useMemo(()=>e.every(e=>null==e)?null:t=>{e.forEach(e=>{Gk(e,t)})},e)}const eE={};const tE=[];class nE{constructor(){this.currentId=null,this.clear=()=>{null!==this.currentId&&(clearTimeout(this.currentId),this.currentId=null)},this.disposeEffect=()=>this.clear}static create(){return new nE}start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,t()},e)}}function rE(){const e=function(e,t){const n=hx.useRef(eE);return n.current===eE&&(n.current=e(t)),n}(nE.create).current;return function(e){hx.useEffect(e,tE)}(e.disposeEffect),e}let iE=!0,oE=!1;const aE=new nE,sE={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function lE(e){e.metaKey||e.altKey||e.ctrlKey||(iE=!0)}function cE(){iE=!1}function uE(){"hidden"===this.visibilityState&&oE&&(iE=!0)}function dE(e){const{target:t}=e;try{return t.matches(":focus-visible")}catch(e){}return iE||function(e){const{type:t,tagName:n}=e;return!("INPUT"!==n||!sE[t]||e.readOnly)||"TEXTAREA"===n&&!e.readOnly||!!e.isContentEditable}(t)}function fE(){const e=hx.useCallback(e=>{var t;null!=e&&((t=e.ownerDocument).addEventListener("keydown",lE,!0),t.addEventListener("mousedown",cE,!0),t.addEventListener("pointerdown",cE,!0),t.addEventListener("touchstart",cE,!0),t.addEventListener("visibilitychange",uE,!0))},[]),t=hx.useRef(!1);return{isFocusVisibleRef:t,onFocus:function(e){return!!dE(e)&&(t.current=!0,!0)},onBlur:function(){return!!t.current&&(oE=!0,aE.start(100,()=>{oE=!1}),t.current=!1,!0)},ref:e}}function hE(e,t,n=void 0){const r={};return Object.keys(e).forEach(i=>{r[i]=e[i].reduce((e,r)=>{if(r){const i=t(r);""!==i&&e.push(i),n&&n[r]&&e.push(n[r])}return e},[]).join(" ")}),r}function pE(e){return"string"==typeof e}function mE(e,t=[]){if(void 0===e)return{};const n={};return Object.keys(e).filter(n=>n.match(/^on[A-Z]/)&&"function"==typeof e[n]&&!t.includes(n)).forEach(t=>{n[t]=e[t]}),n}function gE(e){if(void 0===e)return{};const t={};return Object.keys(e).filter(t=>!(t.match(/^on[A-Z]/)&&"function"==typeof e[t])).forEach(n=>{t[n]=e[n]}),t}const yE=["elementType","externalSlotProps","ownerState","skipResolvingSlotProps"];function vE(e){var t;const{elementType:n,externalSlotProps:r,ownerState:i,skipResolvingSlotProps:o=!1}=e,a=eS(e,yE),s=o?{}:function(e,t,n){return"function"==typeof e?e(t,n):e}(r,i),{props:l,internalRef:c}=function(e){const{getSlotProps:t,additionalProps:n,externalSlotProps:r,externalForwardedProps:i,className:o}=e;if(!t){const e=Ck(null==n?void 0:n.className,o,null==i?void 0:i.className,null==r?void 0:r.className),t=Qx({},null==n?void 0:n.style,null==i?void 0:i.style,null==r?void 0:r.style),a=Qx({},n,i,r);return e.length>0&&(a.className=e),Object.keys(t).length>0&&(a.style=t),{props:a,internalRef:void 0}}const a=mE(Qx({},i,r)),s=gE(r),l=gE(i),c=t(a),u=Ck(null==c?void 0:c.className,null==n?void 0:n.className,o,null==i?void 0:i.className,null==r?void 0:r.className),d=Qx({},null==c?void 0:c.style,null==n?void 0:n.style,null==i?void 0:i.style,null==r?void 0:r.style),f=Qx({},c,n,l,s);return u.length>0&&(f.className=u),Object.keys(d).length>0&&(f.style=d),{props:f,internalRef:c.ref}}(Qx({},a,{externalSlotProps:s})),u=function(e,t,n){return void 0===e||pE(e)?t:Qx({},t,{ownerState:Qx({},t.ownerState,n)})}(n,Qx({},l,{ref:Qk(c,null==s?void 0:s.ref,null==(t=e.additionalProps)?void 0:t.ref)}),i);return u}function bE(e){var t;return parseInt(hx.version,10)>=19?(null==e||null==(t=e.props)?void 0:t.ref)||null:(null==e?void 0:e.ref)||null}const xE=hx.createContext(null);function SE(){return hx.useContext(xE)}var ME="function"==typeof Symbol&&Symbol.for?Symbol.for("mui.nested"):"__THEME_NESTED__";function wE(e){const{children:t,theme:n}=e,r=SE(),i=hx.useMemo(()=>{const e=null===r?n:function(e,t){if("function"==typeof t)return t(e);return Qx({},e,t)}(r,n);return null!=e&&(e[ME]=null!==r),e},[n,r]);return QM.jsx(xE.Provider,{value:i,children:t})}const kE=["value"],EE=hx.createContext();function CE(e){let{value:t}=e,n=eS(e,kE);return QM.jsx(EE.Provider,Qx({value:null==t||t},n))}const NE=hx.createContext(void 0);function TE({value:e,children:t}){return QM.jsx(NE.Provider,{value:e,children:t})}function DE({props:e,name:t}){return function(e){const{theme:t,name:n,props:r}=e;if(!t||!t.components||!t.components[n])return r;const i=t.components[n];return i.defaultProps?Vk(i.defaultProps,r):i.styleOverrides||i.variants?r:Vk(i,r)}({props:e,name:t,theme:{components:hx.useContext(NE)}})}const qE={};function OE(e,t,n,r=!1){return hx.useMemo(()=>{const i=e&&t[e]||t;if("function"==typeof n){const o=n(i),a=e?Qx({},t,{[e]:o}):o;return r?()=>a:a}return Qx({},t,e?{[e]:n}:n)},[e,t,n,r])}function IE(e){const{children:t,theme:n,themeId:r}=e,i=mk(qE),o=SE()||qE,a=OE(r,i,n),s=OE(r,o,n,!0),l="rtl"===a.direction,c=function(e){const t=mk(),n=Jk()||"",{modularCssLayers:r}=e;let i="mui.global, mui.components, mui.theme, mui.custom, mui.sx";return i=r&&null===t?"string"==typeof r?r.replace(/mui(?!\.)/g,i):`@layer ${i};`:"",Uk(()=>{const e=document.querySelector("head");if(!e)return;const t=e.firstChild;if(i){var r;if(t&&null!=(r=t.hasAttribute)&&r.call(t,"data-mui-layer-order")&&t.getAttribute("data-mui-layer-order")===n)return;const o=document.createElement("style");o.setAttribute("data-mui-layer-order",n),o.textContent=i,e.prepend(o)}else{var o;null==(o=e.querySelector(`style[data-mui-layer-order="${n}"]`))||o.remove()}},[i,n]),i?QM.jsx(bk,{styles:i}):null}(a);return QM.jsx(wE,{theme:s,children:QM.jsx(AM.Provider,{value:a,children:QM.jsx(CE,{value:l,children:QM.jsxs(TE,{value:null==a?void 0:a.components,children:[c,t]})})})})}var AE,_E={},LE={exports:{}};function PE(){return AE||(AE=1,function(e){e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports}(LE)),LE.exports}var RE,FE=a(Jx),zE=a(Hk);function jE(){if(RE)return _E;RE=1;var e=PE();Object.defineProperty(_E,"__esModule",{value:!0}),_E.alpha=u,_E.blend=function(e,t,n,r=1){const i=(e,t)=>Math.round((e**(1/r)*(1-n)+t**(1/r)*n)**r),a=o(e),l=o(t),c=[i(a.values[0],l.values[0]),i(a.values[1],l.values[1]),i(a.values[2],l.values[2])];return s({type:"rgb",values:c})},_E.colorChannel=void 0,_E.darken=d,_E.decomposeColor=o,_E.emphasize=h,_E.getContrastRatio=function(e,t){const n=c(e),r=c(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)},_E.getLuminance=c,_E.hexToRgb=i,_E.hslToRgb=l,_E.lighten=f,_E.private_safeAlpha=function(e,t,n){try{return u(e,t)}catch(t){return e}},_E.private_safeColorChannel=void 0,_E.private_safeDarken=function(e,t,n){try{return d(e,t)}catch(t){return e}},_E.private_safeEmphasize=function(e,t,n){try{return h(e,t)}catch(t){return e}},_E.private_safeLighten=function(e,t,n){try{return f(e,t)}catch(t){return e}},_E.recomposeColor=s,_E.rgbToHex=function(e){if(0===e.indexOf("#"))return e;const{values:t}=o(e);return`#${t.map((e,t)=>function(e){const t=e.toString(16);return 1===t.length?`0${t}`:t}(3===t?Math.round(255*e):e)).join("")}`};var t=e(FE),n=e(zE);function r(e,t=0,r=1){return(0,n.default)(e,t,r)}function i(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let n=e.match(t);return n&&1===n[0].length&&(n=n.map(e=>e+e)),n?`rgb${4===n.length?"a":""}(${n.map((e,t)=>t<3?parseInt(e,16):Math.round(parseInt(e,16)/255*1e3)/1e3).join(", ")})`:""}function o(e){if(e.type)return e;if("#"===e.charAt(0))return o(i(e));const n=e.indexOf("("),r=e.substring(0,n);if(-1===["rgb","rgba","hsl","hsla","color"].indexOf(r))throw new Error((0,t.default)(9,e));let a,s=e.substring(n+1,e.length-1);if("color"===r){if(s=s.split(" "),a=s.shift(),4===s.length&&"/"===s[3].charAt(0)&&(s[3]=s[3].slice(1)),-1===["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(a))throw new Error((0,t.default)(10,a))}else s=s.split(",");return s=s.map(e=>parseFloat(e)),{type:r,values:s,colorSpace:a}}const a=e=>{const t=o(e);return t.values.slice(0,3).map((e,n)=>-1!==t.type.indexOf("hsl")&&0!==n?`${e}%`:e).join(" ")};_E.colorChannel=a;function s(e){const{type:t,colorSpace:n}=e;let{values:r}=e;return-1!==t.indexOf("rgb")?r=r.map((e,t)=>t<3?parseInt(e,10):e):-1!==t.indexOf("hsl")&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),r=-1!==t.indexOf("color")?`${n} ${r.join(" ")}`:`${r.join(", ")}`,`${t}(${r})`}function l(e){e=o(e);const{values:t}=e,n=t[0],r=t[1]/100,i=t[2]/100,a=r*Math.min(i,1-i),l=(e,t=(e+n/30)%12)=>i-a*Math.max(Math.min(t-3,9-t,1),-1);let c="rgb";const u=[Math.round(255*l(0)),Math.round(255*l(8)),Math.round(255*l(4))];return"hsla"===e.type&&(c+="a",u.push(t[3])),s({type:c,values:u})}function c(e){let t="hsl"===(e=o(e)).type||"hsla"===e.type?o(l(e)).values:e.values;return t=t.map(t=>("color"!==e.type&&(t/=255),t<=.03928?t/12.92:((t+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function u(e,t){return e=o(e),t=r(t),"rgb"!==e.type&&"hsl"!==e.type||(e.type+="a"),"color"===e.type?e.values[3]=`/${t}`:e.values[3]=t,s(e)}function d(e,t){if(e=o(e),t=r(t),-1!==e.type.indexOf("hsl"))e.values[2]*=1-t;else if(-1!==e.type.indexOf("rgb")||-1!==e.type.indexOf("color"))for(let n=0;n<3;n+=1)e.values[n]*=1-t;return s(e)}function f(e,t){if(e=o(e),t=r(t),-1!==e.type.indexOf("hsl"))e.values[2]+=(100-e.values[2])*t;else if(-1!==e.type.indexOf("rgb"))for(let n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;else if(-1!==e.type.indexOf("color"))for(let n=0;n<3;n+=1)e.values[n]+=(1-e.values[n])*t;return s(e)}function h(e,t=.15){return c(e)>.5?d(e,t):f(e,t)}return _E.private_safeColorChannel=(e,t)=>{try{return a(e)}catch(t){return e}},_E}var $E=jE();const VE=["mode","contrastThreshold","tonalOffset"],UE={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:gx.white,default:gx.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},HE={text:{primary:gx.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:gx.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function BE(e,t,n,r){const i=r.light||r,o=r.dark||1.5*r;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:"light"===t?e.light=$E.lighten(e.main,i):"dark"===t&&(e.dark=$E.darken(e.main,o)))}function WE(e){const{mode:t="light",contrastThreshold:n=3,tonalOffset:r=.2}=e,i=eS(e,VE),o=e.primary||function(e="light"){return"dark"===e?{main:Dx,light:Tx,dark:qx}:{main:Ox,light:qx,dark:Ix}}(t),a=e.secondary||function(e="light"){return"dark"===e?{main:wx,light:Mx,dark:Ex}:{main:Cx,light:kx,dark:Nx}}(t),s=e.error||function(e="light"){return"dark"===e?{main:bx,light:yx,dark:xx}:{main:xx,light:vx,dark:Sx}}(t),l=e.info||function(e="light"){return"dark"===e?{main:_x,light:Ax,dark:Px}:{main:Px,light:Lx,dark:Rx}}(t),c=e.success||function(e="light"){return"dark"===e?{main:zx,light:Fx,dark:$x}:{main:Vx,light:jx,dark:Ux}}(t),u=e.warning||function(e="light"){return"dark"===e?{main:Bx,light:Hx,dark:Yx}:{main:"#ed6c02",light:Wx,dark:Gx}}(t);function d(e){return $E.getContrastRatio(e,HE.text.primary)>=n?HE.text.primary:UE.text.primary}const f=({color:e,name:t,mainShade:n=500,lightShade:i=300,darkShade:o=700})=>{if(!(e=Qx({},e)).main&&e[n]&&(e.main=e[n]),!e.hasOwnProperty("main"))throw new Error(Xx(11,t?` (${t})`:"",n));if("string"!=typeof e.main)throw new Error(Xx(12,t?` (${t})`:"",JSON.stringify(e.main)));return BE(e,"light",i,r),BE(e,"dark",o,r),e.contrastText||(e.contrastText=d(e.main)),e},h={dark:HE,light:UE};return sw(Qx({common:Qx({},gx),mode:t,primary:f({color:o,name:"primary"}),secondary:f({color:a,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:f({color:s,name:"error"}),warning:f({color:u,name:"warning"}),info:f({color:l,name:"info"}),success:f({color:c,name:"success"}),grey:Kx,contrastThreshold:n,getContrastText:d,augmentColor:f,tonalOffset:r},h[t]),i)}const YE=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];function GE(e){return Math.round(1e5*e)/1e5}const KE={textTransform:"uppercase"},XE='"Roboto", "Helvetica", "Arial", sans-serif';function JE(e,t){const n="function"==typeof t?t(e):t,{fontFamily:r=XE,fontSize:i=14,fontWeightLight:o=300,fontWeightRegular:a=400,fontWeightMedium:s=500,fontWeightBold:l=700,htmlFontSize:c=16,allVariants:u,pxToRem:d}=n,f=eS(n,YE),h=i/14,p=d||(e=>e/c*h+"rem"),m=(e,t,n,i,o)=>Qx({fontFamily:r,fontWeight:e,fontSize:p(t),lineHeight:n},r===XE?{letterSpacing:`${GE(i/t)}em`}:{},o,u),g={h1:m(o,96,1.167,-1.5),h2:m(o,60,1.2,-.5),h3:m(a,48,1.167,0),h4:m(a,34,1.235,.25),h5:m(a,24,1.334,0),h6:m(s,20,1.6,.15),subtitle1:m(a,16,1.75,.15),subtitle2:m(s,14,1.57,.1),body1:m(a,16,1.5,.15),body2:m(a,14,1.43,.15),button:m(s,14,1.75,.4,KE),caption:m(a,12,1.66,.4),overline:m(a,12,2.66,1,KE),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return sw(Qx({htmlFontSize:c,pxToRem:p,fontFamily:r,fontSize:i,fontWeightLight:o,fontWeightRegular:a,fontWeightMedium:s,fontWeightBold:l},g),f,{clone:!1})}function ZE(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,0.2)`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,0.14)`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,0.12)`].join(",")}const QE=["none",ZE(0,2,1,-1,0,1,1,0,0,1,3,0),ZE(0,3,1,-2,0,2,2,0,0,1,5,0),ZE(0,3,3,-2,0,3,4,0,0,1,8,0),ZE(0,2,4,-1,0,4,5,0,0,1,10,0),ZE(0,3,5,-1,0,5,8,0,0,1,14,0),ZE(0,3,5,-1,0,6,10,0,0,1,18,0),ZE(0,4,5,-2,0,7,10,1,0,2,16,1),ZE(0,5,5,-3,0,8,10,1,0,3,14,2),ZE(0,5,6,-3,0,9,12,1,0,3,16,2),ZE(0,6,6,-3,0,10,14,1,0,4,18,3),ZE(0,6,7,-4,0,11,15,1,0,4,20,3),ZE(0,7,8,-4,0,12,17,2,0,5,22,4),ZE(0,7,8,-4,0,13,19,2,0,5,24,4),ZE(0,7,9,-4,0,14,21,2,0,5,26,4),ZE(0,8,9,-5,0,15,22,2,0,6,28,5),ZE(0,8,10,-5,0,16,24,2,0,6,30,5),ZE(0,8,11,-5,0,17,26,2,0,6,32,5),ZE(0,9,11,-5,0,18,28,2,0,7,34,6),ZE(0,9,12,-6,0,19,29,2,0,7,36,6),ZE(0,10,13,-6,0,20,31,3,0,8,38,7),ZE(0,10,13,-6,0,21,33,3,0,8,40,7),ZE(0,10,14,-6,0,22,35,3,0,8,42,7),ZE(0,11,14,-7,0,23,36,3,0,9,44,8),ZE(0,11,15,-7,0,24,38,3,0,9,46,8)],eC=["duration","easing","delay"],tC={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},nC={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function rC(e){return`${Math.round(e)}ms`}function iC(e){if(!e)return 0;const t=e/36;return Math.round(10*(4+15*t**.25+t/5))}function oC(e){const t=Qx({},tC,e.easing),n=Qx({},nC,e.duration);return Qx({getAutoHeightDuration:iC,create:(e=["all"],r={})=>{const{duration:i=n.standard,easing:o=t.easeInOut,delay:a=0}=r;return eS(r,eC),(Array.isArray(e)?e:[e]).map(e=>`${e} ${"string"==typeof i?i:rC(i)} ${o} ${"string"==typeof a?a:rC(a)}`).join(",")}},e,{easing:t,duration:n})}const aC={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},sC=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function lC(e={},...t){const{mixins:n={},palette:r={},transitions:i={},typography:o={}}=e,a=eS(e,sC);if(e.vars&&void 0===e.generateCssVars)throw new Error(Xx(18));const s=WE(r),l=hk(e);let c=sw(l,{mixins:(u=l.breakpoints,d=n,Qx({toolbar:{minHeight:56,[u.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[u.up("sm")]:{minHeight:64}}},d)),palette:s,shadows:QE.slice(),typography:JE(s,o),transitions:oC(i),zIndex:Qx({},aC)});var u,d;return c=sw(c,a),c=t.reduce((e,t)=>sw(e,t),c),c.unstable_sxConfig=Qx({},lk,null==a?void 0:a.unstable_sxConfig),c.unstable_sx=function(e){return uk({sx:e,theme:this})},c}const cC=lC();function uC(){const e=yk(cC);return e[Zx]||e}var dC,fC={},hC={exports:{}};var pC,mC={exports:{}};var gC,yC=a(iw),vC=a(lw),bC=a(vw),xC=a($k),SC=a(pk),MC=a(Mk);function wC(){if(gC)return fC;gC=1;var e=PE();Object.defineProperty(fC,"__esModule",{value:!0}),fC.default=function(e={}){const{themeId:o,defaultTheme:s=h,rootShouldForwardProp:l=d,slotShouldForwardProp:u=d}=e,f=e=>(0,a.default)((0,t.default)({},e,{theme:m((0,t.default)({},e,{defaultTheme:s,themeId:o}))}));return f.__mui_systemSx=!0,(e,a={})=>{(0,r.internal_processStyles)(e,e=>e.filter(e=>!(null!=e&&e.__mui_systemSx)));const{name:h,slot:v,skipVariantsResolver:b,skipSx:x,overridesResolver:S=g(p(v))}=a,M=(0,n.default)(a,c),w=h&&h.startsWith("Mui")||v?"components":"custom",k=void 0!==b?b:v&&"Root"!==v&&"root"!==v||!1,E=x||!1;let C=d;"Root"===v||"root"===v?C=l:v?C=u:function(e){return"string"==typeof e&&e.charCodeAt(0)>96}(e)&&(C=void 0);const N=(0,r.default)(e,(0,t.default)({shouldForwardProp:C,label:void 0},M)),T=e=>"function"==typeof e&&e.__emotion_real!==e||(0,i.isPlainObject)(e)?n=>{const r=m({theme:n.theme,defaultTheme:s,themeId:o});return y(e,(0,t.default)({},n,{theme:r}),r.modularCssLayers?w:void 0)}:e,D=(n,...r)=>{let i=T(n);const a=r?r.map(T):[];h&&S&&a.push(e=>{const n=m((0,t.default)({},e,{defaultTheme:s,themeId:o}));if(!n.components||!n.components[h]||!n.components[h].styleOverrides)return null;const r=n.components[h].styleOverrides,i={};return Object.entries(r).forEach(([r,o])=>{i[r]=y(o,(0,t.default)({},e,{theme:n}),n.modularCssLayers?"theme":void 0)}),S(e,i)}),h&&!k&&a.push(e=>{var n;const r=m((0,t.default)({},e,{defaultTheme:s,themeId:o}));return y({variants:null==r||null==(n=r.components)||null==(n=n[h])?void 0:n.variants},(0,t.default)({},e,{theme:r}),r.modularCssLayers?"theme":void 0)}),E||a.push(f);const l=a.length-r.length;if(Array.isArray(n)&&l>0){const e=new Array(l).fill("");i=[...n,...e],i.raw=[...n.raw,...e]}const c=N(i,...a);return e.muiName&&(c.muiName=e.muiName),c};return N.withConfig&&(D.withConfig=N.withConfig),D}},fC.shouldForwardProp=d,fC.systemDefaultTheme=void 0;var t=e((dC||(dC=1,function(e){function t(){return e.exports=t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},e.exports.__esModule=!0,e.exports.default=e.exports,t.apply(null,arguments)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(hC)),hC.exports)),n=e((pC||(pC=1,function(e){e.exports=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n},e.exports.__esModule=!0,e.exports.default=e.exports}(mC)),mC.exports)),r=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=u(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}(yC),i=vC;e(bC),e(xC);var o=e(SC),a=e(MC);const s=["ownerState"],l=["variants"],c=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(u=function(e){return e?n:t})(e)}function d(e){return"ownerState"!==e&&"theme"!==e&&"sx"!==e&&"as"!==e}function f(e,t){return t&&e&&"object"==typeof e&&e.styles&&!e.styles.startsWith("@layer")&&(e.styles=`@layer ${t}{${String(e.styles)}}`),e}const h=fC.systemDefaultTheme=(0,o.default)(),p=e=>e?e.charAt(0).toLowerCase()+e.slice(1):e;function m({defaultTheme:e,theme:t,themeId:n}){return r=t,0===Object.keys(r).length?e:t[n]||t;var r}function g(e){return e?(t,n)=>n[e]:null}function y(e,i,o){let{ownerState:a}=i,c=(0,n.default)(i,s);const u="function"==typeof e?e((0,t.default)({ownerState:a},c)):e;if(Array.isArray(u))return u.flatMap(e=>y(e,(0,t.default)({ownerState:a},c),o));if(u&&"object"==typeof u&&Array.isArray(u.variants)){const{variants:e=[]}=u;let i=(0,n.default)(u,l);return e.forEach(e=>{let n=!0;if("function"==typeof e.props?n=e.props((0,t.default)({ownerState:a},c,a)):Object.keys(e.props).forEach(t=>{(null==a?void 0:a[t])!==e.props[t]&&c[t]!==e.props[t]&&(n=!1)}),n){Array.isArray(i)||(i=[i]);const n="function"==typeof e.style?e.style((0,t.default)({ownerState:a},c,a)):e.style;i.push(o?f((0,r.internal_serializeStyles)(n),o):n)}}),i}return o?f((0,r.internal_serializeStyles)(u),o):u}return fC}const kC=e=>function(e){return"ownerState"!==e&&"theme"!==e&&"sx"!==e&&"as"!==e}(e)&&"classes"!==e,EC=o(wC())({themeId:Zx,defaultTheme:cC,rootShouldForwardProp:kC}),CC=["theme"];function NC(e){let{theme:t}=e,n=eS(e,CC);const r=t[Zx];let i=r||t;return"function"!=typeof t&&(r&&!r.vars?i=Qx({},r,{vars:null}):t&&!t.vars&&(i=Qx({},t,{vars:null}))),QM.jsx(IE,Qx({},n,{themeId:r?Zx:void 0,theme:i}))}const TC=e=>{let t;return t=e<1?5.11916*e**2:4.5*Math.log(e+1)+2,(t/100).toFixed(2)};function DC(e){return DE(e)}function qC(e){return Tk("MuiSvgIcon",e)}Dk("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const OC=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"],IC=EC("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,"inherit"!==n.color&&t[`color${yw(n.color)}`],t[`fontSize${yw(n.fontSize)}`]]}})(({theme:e,ownerState:t})=>{var n,r,i,o,a,s,l,c,u,d,f,h,p;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:t.hasSvgAsChild?void 0:"currentColor",flexShrink:0,transition:null==(n=e.transitions)||null==(r=n.create)?void 0:r.call(n,"fill",{duration:null==(i=e.transitions)||null==(i=i.duration)?void 0:i.shorter}),fontSize:{inherit:"inherit",small:(null==(o=e.typography)||null==(a=o.pxToRem)?void 0:a.call(o,20))||"1.25rem",medium:(null==(s=e.typography)||null==(l=s.pxToRem)?void 0:l.call(s,24))||"1.5rem",large:(null==(c=e.typography)||null==(u=c.pxToRem)?void 0:u.call(c,35))||"2.1875rem"}[t.fontSize],color:null!=(d=null==(f=(e.vars||e).palette)||null==(f=f[t.color])?void 0:f.main)?d:{action:null==(h=(e.vars||e).palette)||null==(h=h.action)?void 0:h.active,disabled:null==(p=(e.vars||e).palette)||null==(p=p.action)?void 0:p.disabled,inherit:void 0}[t.color]}}),AC=hx.forwardRef(function(e,t){const n=DC({props:e,name:"MuiSvgIcon"}),{children:r,className:i,color:o="inherit",component:a="svg",fontSize:s="medium",htmlColor:l,inheritViewBox:c=!1,titleAccess:u,viewBox:d="0 0 24 24"}=n,f=eS(n,OC),h=hx.isValidElement(r)&&"svg"===r.type,p=Qx({},n,{color:o,component:a,fontSize:s,instanceFontSize:e.fontSize,inheritViewBox:c,viewBox:d,hasSvgAsChild:h}),m={};c||(m.viewBox=d);const g=(e=>{const{color:t,fontSize:n,classes:r}=e;return hE({root:["root","inherit"!==t&&`color${yw(t)}`,`fontSize${yw(n)}`]},qC,r)})(p);return QM.jsxs(IC,Qx({as:a,className:Ck(g.root,i),focusable:"false",color:l,"aria-hidden":!u||void 0,role:u?"img":void 0,ref:t},m,f,h&&r.props,{ownerState:p,children:[h?r.props.children:r,u?QM.jsx("title",{children:u}):null]}))});function _C(e,t){return _C=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},_C(e,t)}function LC(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,_C(e,t)}AC.muiName="SvgIcon";var PC,RC,FC,zC,jC={exports:{}},$C={},VC={exports:{}},UC={};function HC(){return RC||(RC=1,VC.exports=(PC||(PC=1,function(e){function t(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,o=e[r];if(!(0<i(o,t)))break e;e[r]=t,e[n]=o,n=r}}function n(e){return 0===e.length?null:e[0]}function r(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,o=e.length,a=o>>>1;r<a;){var s=2*(r+1)-1,l=e[s],c=s+1,u=e[c];if(0>i(l,n))c<o&&0>i(u,l)?(e[r]=u,e[c]=n,r=c):(e[r]=l,e[s]=n,r=s);else{if(!(c<o&&0>i(u,n)))break e;e[r]=u,e[c]=n,r=c}}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"==typeof performance&&"function"==typeof performance.now){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,s=a.now();e.unstable_now=function(){return a.now()-s}}var l=[],c=[],u=1,d=null,f=3,h=!1,p=!1,m=!1,g="function"==typeof setTimeout?setTimeout:null,y="function"==typeof clearTimeout?clearTimeout:null,v="undefined"!=typeof setImmediate?setImmediate:null;function b(e){for(var i=n(c);null!==i;){if(null===i.callback)r(c);else{if(!(i.startTime<=e))break;r(c),i.sortIndex=i.expirationTime,t(l,i)}i=n(c)}}function x(e){if(m=!1,b(e),!p)if(null!==n(l))p=!0,I(S);else{var t=n(c);null!==t&&A(x,t.startTime-e)}}function S(t,i){p=!1,m&&(m=!1,y(E),E=-1),h=!0;var o=f;try{for(b(i),d=n(l);null!==d&&(!(d.expirationTime>i)||t&&!T());){var a=d.callback;if("function"==typeof a){d.callback=null,f=d.priorityLevel;var s=a(d.expirationTime<=i);i=e.unstable_now(),"function"==typeof s?d.callback=s:d===n(l)&&r(l),b(i)}else r(l);d=n(l)}if(null!==d)var u=!0;else{var g=n(c);null!==g&&A(x,g.startTime-i),u=!1}return u}finally{d=null,f=o,h=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var M,w=!1,k=null,E=-1,C=5,N=-1;function T(){return!(e.unstable_now()-N<C)}function D(){if(null!==k){var t=e.unstable_now();N=t;var n=!0;try{n=k(!0,t)}finally{n?M():(w=!1,k=null)}}else w=!1}if("function"==typeof v)M=function(){v(D)};else if("undefined"!=typeof MessageChannel){var q=new MessageChannel,O=q.port2;q.port1.onmessage=D,M=function(){O.postMessage(null)}}else M=function(){g(D,0)};function I(e){k=e,w||(w=!0,M())}function A(t,n){E=g(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){p||h||(p=!0,I(S))},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):C=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,o){var a=e.unstable_now();switch(o="object"==typeof o&&null!==o&&"number"==typeof(o=o.delay)&&0<o?a+o:a,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return r={id:u++,callback:i,priorityLevel:r,startTime:o,expirationTime:s=o+s,sortIndex:-1},o>a?(r.sortIndex=o,t(c,r),null===n(l)&&r===n(c)&&(m?(y(E),E=-1):m=!0,A(x,o-a))):(r.sortIndex=s,t(l,r),p||h||(p=!0,I(S))),r},e.unstable_shouldYield=T,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}}(UC)),UC)),VC.exports}
/**
   * @license React
   * react-dom.production.min.js
   *
   * Copyright (c) Facebook, Inc. and its affiliates.
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE file in the root directory of this source tree.
   */function BC(){if(FC)return $C;FC=1;var e=fx(),t=HC();function n(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,i={};function o(e,t){a(e,t),a(e+"Capture",t)}function a(e,t){for(i[e]=t,e=0;e<t.length;e++)r.add(t[e])}var s=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),l=Object.prototype.hasOwnProperty,c=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,u={},d={};function f(e,t,n,r,i,o,a){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=a}var h={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){h[e]=new f(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];h[t]=new f(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){h[e]=new f(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){h[e]=new f(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){h[e]=new f(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){h[e]=new f(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){h[e]=new f(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){h[e]=new f(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){h[e]=new f(e,5,!1,e.toLowerCase(),null,!1,!1)});var p=/[\-:]([a-z])/g;function m(e){return e[1].toUpperCase()}function g(e,t,n,r){var i=h.hasOwnProperty(t)?h[t]:null;(null!==i?0!==i.type:r||!(2<t.length)||"o"!==t[0]&&"O"!==t[0]||"n"!==t[1]&&"N"!==t[1])&&(function(e,t,n,r){if(null==t||function(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,n,i,r)&&(n=null),r||null===i?function(e){return!!l.call(d,e)||!l.call(u,e)&&(c.test(e)?d[e]=!0:(u[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=null===n?3!==i.type&&"":n:(t=i.attributeName,r=i.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(i=i.type)||4===i&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(p,m);h[t]=new f(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(p,m);h[t]=new f(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(p,m);h[t]=new f(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){h[e]=new f(e,1,!1,e.toLowerCase(),null,!1,!1)}),h.xlinkHref=new f("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){h[e]=new f(e,1,!1,e.toLowerCase(),null,!0,!0)});var y=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,v=Symbol.for("react.element"),b=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),w=Symbol.for("react.provider"),k=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),N=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),q=Symbol.for("react.offscreen"),O=Symbol.iterator;function I(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=O&&e[O]||e["@@iterator"])?e:null}var A,_=Object.assign;function L(e){if(void 0===A)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);A=t&&t[1]||""}return"\n"+A+e}var P=!1;function R(e,t){if(!e||P)return"";P=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){var r=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){r=e}e.call(t.prototype)}else{try{throw Error()}catch(e){r=e}e()}}catch(t){if(t&&r&&"string"==typeof t.stack){for(var i=t.stack.split("\n"),o=r.stack.split("\n"),a=i.length-1,s=o.length-1;1<=a&&0<=s&&i[a]!==o[s];)s--;for(;1<=a&&0<=s;a--,s--)if(i[a]!==o[s]){if(1!==a||1!==s)do{if(a--,0>--s||i[a]!==o[s]){var l="\n"+i[a].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}}while(1<=a&&0<=s);break}}}finally{P=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?L(e):""}function F(e){switch(e.tag){case 5:return L(e.type);case 16:return L("Lazy");case 13:return L("Suspense");case 19:return L("SuspenseList");case 0:case 2:case 15:return e=R(e.type,!1);case 11:return e=R(e.type.render,!1);case 1:return e=R(e.type,!0);default:return""}}function z(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case x:return"Fragment";case b:return"Portal";case M:return"Profiler";case S:return"StrictMode";case C:return"Suspense";case N:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case k:return(e.displayName||"Context")+".Consumer";case w:return(e._context.displayName||"Context")+".Provider";case E:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case T:return null!==(t=e.displayName||null)?t:z(e.type)||"Memo";case D:t=e._payload,e=e._init;try{return z(e(t))}catch(e){}}return null}function j(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=(e=t.render).displayName||e.name||"",t.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return z(t);case 8:return t===S?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t}return null}function $(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function V(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function U(e){e._valueTracker||(e._valueTracker=function(e){var t=V(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==n&&"function"==typeof n.get&&"function"==typeof n.set){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=""+e,o.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function H(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=V(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function B(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function W(e,t){var n=t.checked;return _({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function Y(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=$(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function G(e,t){null!=(t=t.checked)&&g(e,"checked",t,!1)}function K(e,t){G(e,t);var n=$(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?J(e,t.type,n):t.hasOwnProperty("defaultValue")&&J(e,t.type,$(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function X(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function J(e,t,n){"number"===t&&B(e.ownerDocument)===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Z=Array.isArray;function Q(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+$(n),t=null,i=0;i<e.length;i++){if(e[i].value===n)return e[i].selected=!0,void(r&&(e[i].defaultSelected=!0));null!==t||e[i].disabled||(t=e[i])}null!==t&&(t.selected=!0)}}function ee(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(n(91));return _({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function te(e,t){var r=t.value;if(null==r){if(r=t.children,t=t.defaultValue,null!=r){if(null!=t)throw Error(n(92));if(Z(r)){if(1<r.length)throw Error(n(93));r=r[0]}t=r}null==t&&(t=""),r=t}e._wrapperState={initialValue:$(r)}}function ne(e,t){var n=$(t.value),r=$(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function re(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}function ie(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function oe(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?ie(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var ae,se=function(e){return"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n)})}:e}(function(e,t){if("http://www.w3.org/2000/svg"!==e.namespaceURI||"innerHTML"in e)e.innerHTML=t;else{for((ae=ae||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ae.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function le(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var ce={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ue=["Webkit","ms","Moz","O"];function de(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||ce.hasOwnProperty(e)&&ce[e]?(""+t).trim():t+"px"}function fe(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),i=de(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}Object.keys(ce).forEach(function(e){ue.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ce[t]=ce[e]})});var he=_({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function pe(e,t){if(t){if(he[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(n(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(n(60));if("object"!=typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(n(61))}if(null!=t.style&&"object"!=typeof t.style)throw Error(n(62))}}function me(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ge=null;function ye(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var ve=null,be=null,xe=null;function Se(e){if(e=mi(e)){if("function"!=typeof ve)throw Error(n(280));var t=e.stateNode;t&&(t=yi(t),ve(e.stateNode,e.type,t))}}function Me(e){be?xe?xe.push(e):xe=[e]:be=e}function we(){if(be){var e=be,t=xe;if(xe=be=null,Se(e),t)for(e=0;e<t.length;e++)Se(t[e])}}function ke(e,t){return e(t)}function Ee(){}var Ce=!1;function Ne(e,t,n){if(Ce)return e(t,n);Ce=!0;try{return ke(e,t,n)}finally{Ce=!1,(null!==be||null!==xe)&&(Ee(),we())}}function Te(e,t){var r=e.stateNode;if(null===r)return null;var i=yi(r);if(null===i)return null;r=i[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(i=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!i;break e;default:e=!1}if(e)return null;if(r&&"function"!=typeof r)throw Error(n(231,t,typeof r));return r}var De=!1;if(s)try{var qe={};Object.defineProperty(qe,"passive",{get:function(){De=!0}}),window.addEventListener("test",qe,qe),window.removeEventListener("test",qe,qe)}catch(e){De=!1}function Oe(e,t,n,r,i,o,a,s,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(e){this.onError(e)}}var Ie=!1,Ae=null,_e=!1,Le=null,Pe={onError:function(e){Ie=!0,Ae=e}};function Re(e,t,n,r,i,o,a,s,l){Ie=!1,Ae=null,Oe.apply(Pe,arguments)}function Fe(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{!!(4098&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function ze(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function je(e){if(Fe(e)!==e)throw Error(n(188))}function $e(e){return e=function(e){var t=e.alternate;if(!t){if(null===(t=Fe(e)))throw Error(n(188));return t!==e?null:e}for(var r=e,i=t;;){var o=r.return;if(null===o)break;var a=o.alternate;if(null===a){if(null!==(i=o.return)){r=i;continue}break}if(o.child===a.child){for(a=o.child;a;){if(a===r)return je(o),e;if(a===i)return je(o),t;a=a.sibling}throw Error(n(188))}if(r.return!==i.return)r=o,i=a;else{for(var s=!1,l=o.child;l;){if(l===r){s=!0,r=o,i=a;break}if(l===i){s=!0,i=o,r=a;break}l=l.sibling}if(!s){for(l=a.child;l;){if(l===r){s=!0,r=a,i=o;break}if(l===i){s=!0,i=a,r=o;break}l=l.sibling}if(!s)throw Error(n(189))}}if(r.alternate!==i)throw Error(n(190))}if(3!==r.tag)throw Error(n(188));return r.stateNode.current===r?e:t}(e),null!==e?Ve(e):null}function Ve(e){if(5===e.tag||6===e.tag)return e;for(e=e.child;null!==e;){var t=Ve(e);if(null!==t)return t;e=e.sibling}return null}var Ue=t.unstable_scheduleCallback,He=t.unstable_cancelCallback,Be=t.unstable_shouldYield,We=t.unstable_requestPaint,Ye=t.unstable_now,Ge=t.unstable_getCurrentPriorityLevel,Ke=t.unstable_ImmediatePriority,Xe=t.unstable_UserBlockingPriority,Je=t.unstable_NormalPriority,Ze=t.unstable_LowPriority,Qe=t.unstable_IdlePriority,et=null,tt=null;var nt=Math.clz32?Math.clz32:function(e){return e>>>=0,0===e?32:31-(rt(e)/it|0)|0},rt=Math.log,it=Math.LN2;var ot=64,at=4194304;function st(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function lt(e,t){var n=e.pendingLanes;if(0===n)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,a=268435455&n;if(0!==a){var s=a&~i;0!==s?r=st(s):0!==(o&=a)&&(r=st(o))}else 0!==(a=n&~i)?r=st(a):0!==o&&(r=st(o));if(0===r)return 0;if(0!==t&&t!==r&&0===(t&i)&&((i=r&-r)>=(o=t&-t)||16===i&&4194240&o))return t;if(4&r&&(r|=16&n),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0<t;)i=1<<(n=31-nt(t)),r|=e[n],t&=~i;return r}function ct(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return-1}}function ut(e){return 0!==(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function dt(){var e=ot;return!(4194240&(ot<<=1))&&(ot=64),e}function ft(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ht(e,t,n){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[t=31-nt(t)]=n}function pt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-nt(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var mt=0;function gt(e){return 1<(e&=-e)?4<e?268435455&e?16:536870912:4:1}var yt,vt,bt,xt,St,Mt=!1,wt=[],kt=null,Et=null,Ct=null,Nt=new Map,Tt=new Map,Dt=[],qt="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Ot(e,t){switch(e){case"focusin":case"focusout":kt=null;break;case"dragenter":case"dragleave":Et=null;break;case"mouseover":case"mouseout":Ct=null;break;case"pointerover":case"pointerout":Nt.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Tt.delete(t.pointerId)}}function It(e,t,n,r,i,o){return null===e||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[i]},null!==t&&(null!==(t=mi(t))&&vt(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,null!==i&&-1===t.indexOf(i)&&t.push(i),e)}function At(e){var t=pi(e.target);if(null!==t){var n=Fe(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=ze(n)))return e.blockedOn=t,void St(e.priority,function(){bt(n)})}else if(3===t&&n.stateNode.current.memoizedState.isDehydrated)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function _t(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=Bt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n)return null!==(t=mi(n))&&vt(t),e.blockedOn=n,!1;var r=new(n=e.nativeEvent).constructor(n.type,n);ge=r,n.target.dispatchEvent(r),ge=null,t.shift()}return!0}function Lt(e,t,n){_t(e)&&n.delete(t)}function Pt(){Mt=!1,null!==kt&&_t(kt)&&(kt=null),null!==Et&&_t(Et)&&(Et=null),null!==Ct&&_t(Ct)&&(Ct=null),Nt.forEach(Lt),Tt.forEach(Lt)}function Rt(e,n){e.blockedOn===n&&(e.blockedOn=null,Mt||(Mt=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Pt)))}function Ft(e){function t(t){return Rt(t,e)}if(0<wt.length){Rt(wt[0],e);for(var n=1;n<wt.length;n++){var r=wt[n];r.blockedOn===e&&(r.blockedOn=null)}}for(null!==kt&&Rt(kt,e),null!==Et&&Rt(Et,e),null!==Ct&&Rt(Ct,e),Nt.forEach(t),Tt.forEach(t),n=0;n<Dt.length;n++)(r=Dt[n]).blockedOn===e&&(r.blockedOn=null);for(;0<Dt.length&&null===(n=Dt[0]).blockedOn;)At(n),null===n.blockedOn&&Dt.shift()}var zt=y.ReactCurrentBatchConfig,jt=!0;function $t(e,t,n,r){var i=mt,o=zt.transition;zt.transition=null;try{mt=1,Ut(e,t,n,r)}finally{mt=i,zt.transition=o}}function Vt(e,t,n,r){var i=mt,o=zt.transition;zt.transition=null;try{mt=4,Ut(e,t,n,r)}finally{mt=i,zt.transition=o}}function Ut(e,t,n,r){if(jt){var i=Bt(e,t,n,r);if(null===i)jr(e,t,r,Ht,n),Ot(e,r);else if(function(e,t,n,r,i){switch(t){case"focusin":return kt=It(kt,e,t,n,r,i),!0;case"dragenter":return Et=It(Et,e,t,n,r,i),!0;case"mouseover":return Ct=It(Ct,e,t,n,r,i),!0;case"pointerover":var o=i.pointerId;return Nt.set(o,It(Nt.get(o)||null,e,t,n,r,i)),!0;case"gotpointercapture":return o=i.pointerId,Tt.set(o,It(Tt.get(o)||null,e,t,n,r,i)),!0}return!1}(i,e,t,n,r))r.stopPropagation();else if(Ot(e,r),4&t&&-1<qt.indexOf(e)){for(;null!==i;){var o=mi(i);if(null!==o&&yt(o),null===(o=Bt(e,t,n,r))&&jr(e,t,r,Ht,n),o===i)break;i=o}null!==i&&r.stopPropagation()}else jr(e,t,r,null,n)}}var Ht=null;function Bt(e,t,n,r){if(Ht=null,null!==(e=pi(e=ye(r))))if(null===(t=Fe(e)))e=null;else if(13===(n=t.tag)){if(null!==(e=ze(t)))return e;e=null}else if(3===n){if(t.stateNode.current.memoizedState.isDehydrated)return 3===t.tag?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Ht=e,null}function Wt(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Ge()){case Ke:return 1;case Xe:return 4;case Je:case Ze:return 16;case Qe:return 536870912;default:return 16}default:return 16}}var Yt=null,Gt=null,Kt=null;function Xt(){if(Kt)return Kt;var e,t,n=Gt,r=n.length,i="value"in Yt?Yt.value:Yt.textContent,o=i.length;for(e=0;e<r&&n[e]===i[e];e++);var a=r-e;for(t=1;t<=a&&n[r-t]===i[o-t];t++);return Kt=i.slice(e,1<t?1-t:void 0)}function Jt(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function Zt(){return!0}function Qt(){return!1}function en(e){function t(t,n,r,i,o){for(var a in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=o,this.currentTarget=null,e)e.hasOwnProperty(a)&&(t=e[a],this[a]=t?t(i):i[a]);return this.isDefaultPrevented=(null!=i.defaultPrevented?i.defaultPrevented:!1===i.returnValue)?Zt:Qt,this.isPropagationStopped=Qt,this}return _(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=Zt)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=Zt)},persist:function(){},isPersistent:Zt}),t}var tn,nn,rn,on={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},an=en(on),sn=_({},on,{view:0,detail:0}),ln=en(sn),cn=_({},sn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Sn,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==rn&&(rn&&"mousemove"===e.type?(tn=e.screenX-rn.screenX,nn=e.screenY-rn.screenY):nn=tn=0,rn=e),tn)},movementY:function(e){return"movementY"in e?e.movementY:nn}}),un=en(cn),dn=en(_({},cn,{dataTransfer:0})),fn=en(_({},sn,{relatedTarget:0})),hn=en(_({},on,{animationName:0,elapsedTime:0,pseudoElement:0})),pn=_({},on,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),mn=en(pn),gn=en(_({},on,{data:0})),yn={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},vn={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},bn={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function xn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=bn[e])&&!!t[e]}function Sn(){return xn}var Mn=_({},sn,{key:function(e){if(e.key){var t=yn[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=Jt(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?vn[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Sn,charCode:function(e){return"keypress"===e.type?Jt(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?Jt(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),wn=en(Mn),kn=en(_({},cn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),En=en(_({},sn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Sn})),Cn=en(_({},on,{propertyName:0,elapsedTime:0,pseudoElement:0})),Nn=_({},cn,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Tn=en(Nn),Dn=[9,13,27,32],qn=s&&"CompositionEvent"in window,On=null;s&&"documentMode"in document&&(On=document.documentMode);var In=s&&"TextEvent"in window&&!On,An=s&&(!qn||On&&8<On&&11>=On),_n=String.fromCharCode(32),Ln=!1;function Pn(e,t){switch(e){case"keyup":return-1!==Dn.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Rn(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var Fn=!1;var zn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function jn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!zn[e.type]:"textarea"===t}function $n(e,t,n,r){Me(r),0<(t=Vr(t,"onChange")).length&&(n=new an("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Vn=null,Un=null;function Hn(e){_r(e,0)}function Bn(e){if(H(gi(e)))return e}function Wn(e,t){if("change"===e)return t}var Yn=!1;if(s){var Gn;if(s){var Kn="oninput"in document;if(!Kn){var Xn=document.createElement("div");Xn.setAttribute("oninput","return;"),Kn="function"==typeof Xn.oninput}Gn=Kn}else Gn=!1;Yn=Gn&&(!document.documentMode||9<document.documentMode)}function Jn(){Vn&&(Vn.detachEvent("onpropertychange",Zn),Un=Vn=null)}function Zn(e){if("value"===e.propertyName&&Bn(Un)){var t=[];$n(t,Un,e,ye(e)),Ne(Hn,t)}}function Qn(e,t,n){"focusin"===e?(Jn(),Un=n,(Vn=t).attachEvent("onpropertychange",Zn)):"focusout"===e&&Jn()}function er(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Bn(Un)}function tr(e,t){if("click"===e)return Bn(t)}function nr(e,t){if("input"===e||"change"===e)return Bn(t)}var rr="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t};function ir(e,t){if(rr(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!l.call(t,i)||!rr(e[i],t[i]))return!1}return!0}function or(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ar(e,t){var n,r=or(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=or(r)}}function sr(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?sr(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function lr(){for(var e=window,t=B();t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(e){n=!1}if(!n)break;t=B((e=t.contentWindow).document)}return t}function cr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}function ur(e){var t=lr(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&sr(n.ownerDocument.documentElement,n)){if(null!==r&&cr(n))if(t=r.start,void 0===(e=r.end)&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if((e=(t=n.ownerDocument||document)&&t.defaultView||window).getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=void 0===r.end?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=ar(n,o);var a=ar(n,r);i&&a&&(1!==e.rangeCount||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&((t=t.createRange()).setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}for(t=[],e=n;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"==typeof n.focus&&n.focus(),n=0;n<t.length;n++)(e=t[n]).element.scrollLeft=e.left,e.element.scrollTop=e.top}}var dr=s&&"documentMode"in document&&11>=document.documentMode,fr=null,hr=null,pr=null,mr=!1;function gr(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;mr||null==fr||fr!==B(r)||("selectionStart"in(r=fr)&&cr(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},pr&&ir(pr,r)||(pr=r,0<(r=Vr(hr,"onSelect")).length&&(t=new an("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=fr)))}function yr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var vr={animationend:yr("Animation","AnimationEnd"),animationiteration:yr("Animation","AnimationIteration"),animationstart:yr("Animation","AnimationStart"),transitionend:yr("Transition","TransitionEnd")},br={},xr={};function Sr(e){if(br[e])return br[e];if(!vr[e])return e;var t,n=vr[e];for(t in n)if(n.hasOwnProperty(t)&&t in xr)return br[e]=n[t];return e}s&&(xr=document.createElement("div").style,"AnimationEvent"in window||(delete vr.animationend.animation,delete vr.animationiteration.animation,delete vr.animationstart.animation),"TransitionEvent"in window||delete vr.transitionend.transition);var Mr=Sr("animationend"),wr=Sr("animationiteration"),kr=Sr("animationstart"),Er=Sr("transitionend"),Cr=new Map,Nr="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Tr(e,t){Cr.set(e,t),o(t,[e])}for(var Dr=0;Dr<Nr.length;Dr++){var qr=Nr[Dr];Tr(qr.toLowerCase(),"on"+(qr[0].toUpperCase()+qr.slice(1)))}Tr(Mr,"onAnimationEnd"),Tr(wr,"onAnimationIteration"),Tr(kr,"onAnimationStart"),Tr("dblclick","onDoubleClick"),Tr("focusin","onFocus"),Tr("focusout","onBlur"),Tr(Er,"onTransitionEnd"),a("onMouseEnter",["mouseout","mouseover"]),a("onMouseLeave",["mouseout","mouseover"]),a("onPointerEnter",["pointerout","pointerover"]),a("onPointerLeave",["pointerout","pointerover"]),o("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),o("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),o("onBeforeInput",["compositionend","keypress","textInput","paste"]),o("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Or="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Ir=new Set("cancel close invalid load scroll toggle".split(" ").concat(Or));function Ar(e,t,r){var i=e.type||"unknown-event";e.currentTarget=r,function(e,t,r,i,o,a,s,l,c){if(Re.apply(this,arguments),Ie){if(!Ie)throw Error(n(198));var u=Ae;Ie=!1,Ae=null,_e||(_e=!0,Le=u)}}(i,t,void 0,e),e.currentTarget=null}function _r(e,t){t=!!(4&t);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var o=void 0;if(t)for(var a=r.length-1;0<=a;a--){var s=r[a],l=s.instance,c=s.currentTarget;if(s=s.listener,l!==o&&i.isPropagationStopped())break e;Ar(i,s,c),o=l}else for(a=0;a<r.length;a++){if(l=(s=r[a]).instance,c=s.currentTarget,s=s.listener,l!==o&&i.isPropagationStopped())break e;Ar(i,s,c),o=l}}}if(_e)throw e=Le,_e=!1,Le=null,e}function Lr(e,t){var n=t[di];void 0===n&&(n=t[di]=new Set);var r=e+"__bubble";n.has(r)||(zr(t,e,2,!1),n.add(r))}function Pr(e,t,n){var r=0;t&&(r|=4),zr(n,e,r,t)}var Rr="_reactListening"+Math.random().toString(36).slice(2);function Fr(e){if(!e[Rr]){e[Rr]=!0,r.forEach(function(t){"selectionchange"!==t&&(Ir.has(t)||Pr(t,!1,e),Pr(t,!0,e))});var t=9===e.nodeType?e:e.ownerDocument;null===t||t[Rr]||(t[Rr]=!0,Pr("selectionchange",!1,t))}}function zr(e,t,n,r){switch(Wt(t)){case 1:var i=$t;break;case 4:i=Vt;break;default:i=Ut}n=i.bind(null,t,n,e),i=void 0,!De||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(i=!0),r?void 0!==i?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):void 0!==i?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function jr(e,t,n,r,i){var o=r;if(!(1&t||2&t||null===r))e:for(;;){if(null===r)return;var a=r.tag;if(3===a||4===a){var s=r.stateNode.containerInfo;if(s===i||8===s.nodeType&&s.parentNode===i)break;if(4===a)for(a=r.return;null!==a;){var l=a.tag;if((3===l||4===l)&&((l=a.stateNode.containerInfo)===i||8===l.nodeType&&l.parentNode===i))return;a=a.return}for(;null!==s;){if(null===(a=pi(s)))return;if(5===(l=a.tag)||6===l){r=o=a;continue e}s=s.parentNode}}r=r.return}Ne(function(){var r=o,i=ye(n),a=[];e:{var s=Cr.get(e);if(void 0!==s){var l=an,c=e;switch(e){case"keypress":if(0===Jt(n))break e;case"keydown":case"keyup":l=wn;break;case"focusin":c="focus",l=fn;break;case"focusout":c="blur",l=fn;break;case"beforeblur":case"afterblur":l=fn;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":l=un;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":l=dn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":l=En;break;case Mr:case wr:case kr:l=hn;break;case Er:l=Cn;break;case"scroll":l=ln;break;case"wheel":l=Tn;break;case"copy":case"cut":case"paste":l=mn;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":l=kn}var u=!!(4&t),d=!u&&"scroll"===e,f=u?null!==s?s+"Capture":null:s;u=[];for(var h,p=r;null!==p;){var m=(h=p).stateNode;if(5===h.tag&&null!==m&&(h=m,null!==f&&(null!=(m=Te(p,f))&&u.push($r(p,m,h)))),d)break;p=p.return}0<u.length&&(s=new l(s,c,null,n,i),a.push({event:s,listeners:u}))}}if(!(7&t)){if(l="mouseout"===e||"pointerout"===e,(!(s="mouseover"===e||"pointerover"===e)||n===ge||!(c=n.relatedTarget||n.fromElement)||!pi(c)&&!c[ui])&&(l||s)&&(s=i.window===i?i:(s=i.ownerDocument)?s.defaultView||s.parentWindow:window,l?(l=r,null!==(c=(c=n.relatedTarget||n.toElement)?pi(c):null)&&(c!==(d=Fe(c))||5!==c.tag&&6!==c.tag)&&(c=null)):(l=null,c=r),l!==c)){if(u=un,m="onMouseLeave",f="onMouseEnter",p="mouse","pointerout"!==e&&"pointerover"!==e||(u=kn,m="onPointerLeave",f="onPointerEnter",p="pointer"),d=null==l?s:gi(l),h=null==c?s:gi(c),(s=new u(m,p+"leave",l,n,i)).target=d,s.relatedTarget=h,m=null,pi(i)===r&&((u=new u(f,p+"enter",c,n,i)).target=h,u.relatedTarget=d,m=u),d=m,l&&c)e:{for(f=c,p=0,h=u=l;h;h=Ur(h))p++;for(h=0,m=f;m;m=Ur(m))h++;for(;0<p-h;)u=Ur(u),p--;for(;0<h-p;)f=Ur(f),h--;for(;p--;){if(u===f||null!==f&&u===f.alternate)break e;u=Ur(u),f=Ur(f)}u=null}else u=null;null!==l&&Hr(a,s,l,u,!1),null!==c&&null!==d&&Hr(a,d,c,u,!0)}if("select"===(l=(s=r?gi(r):window).nodeName&&s.nodeName.toLowerCase())||"input"===l&&"file"===s.type)var g=Wn;else if(jn(s))if(Yn)g=nr;else{g=er;var y=Qn}else(l=s.nodeName)&&"input"===l.toLowerCase()&&("checkbox"===s.type||"radio"===s.type)&&(g=tr);switch(g&&(g=g(e,r))?$n(a,g,n,i):(y&&y(e,s,r),"focusout"===e&&(y=s._wrapperState)&&y.controlled&&"number"===s.type&&J(s,"number",s.value)),y=r?gi(r):window,e){case"focusin":(jn(y)||"true"===y.contentEditable)&&(fr=y,hr=r,pr=null);break;case"focusout":pr=hr=fr=null;break;case"mousedown":mr=!0;break;case"contextmenu":case"mouseup":case"dragend":mr=!1,gr(a,n,i);break;case"selectionchange":if(dr)break;case"keydown":case"keyup":gr(a,n,i)}var v;if(qn)e:{switch(e){case"compositionstart":var b="onCompositionStart";break e;case"compositionend":b="onCompositionEnd";break e;case"compositionupdate":b="onCompositionUpdate";break e}b=void 0}else Fn?Pn(e,n)&&(b="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(b="onCompositionStart");b&&(An&&"ko"!==n.locale&&(Fn||"onCompositionStart"!==b?"onCompositionEnd"===b&&Fn&&(v=Xt()):(Gt="value"in(Yt=i)?Yt.value:Yt.textContent,Fn=!0)),0<(y=Vr(r,b)).length&&(b=new gn(b,e,null,n,i),a.push({event:b,listeners:y}),v?b.data=v:null!==(v=Rn(n))&&(b.data=v))),(v=In?function(e,t){switch(e){case"compositionend":return Rn(t);case"keypress":return 32!==t.which?null:(Ln=!0,_n);case"textInput":return(e=t.data)===_n&&Ln?null:e;default:return null}}(e,n):function(e,t){if(Fn)return"compositionend"===e||!qn&&Pn(e,t)?(e=Xt(),Kt=Gt=Yt=null,Fn=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return An&&"ko"!==t.locale?null:t.data}}(e,n))&&(0<(r=Vr(r,"onBeforeInput")).length&&(i=new gn("onBeforeInput","beforeinput",null,n,i),a.push({event:i,listeners:r}),i.data=v))}_r(a,t)})}function $r(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Vr(e,t){for(var n=t+"Capture",r=[];null!==e;){var i=e,o=i.stateNode;5===i.tag&&null!==o&&(i=o,null!=(o=Te(e,n))&&r.unshift($r(e,o,i)),null!=(o=Te(e,t))&&r.push($r(e,o,i))),e=e.return}return r}function Ur(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag);return e||null}function Hr(e,t,n,r,i){for(var o=t._reactName,a=[];null!==n&&n!==r;){var s=n,l=s.alternate,c=s.stateNode;if(null!==l&&l===r)break;5===s.tag&&null!==c&&(s=c,i?null!=(l=Te(n,o))&&a.unshift($r(n,l,s)):i||null!=(l=Te(n,o))&&a.push($r(n,l,s))),n=n.return}0!==a.length&&e.push({event:t,listeners:a})}var Br=/\r\n?/g,Wr=/\u0000|\uFFFD/g;function Yr(e){return("string"==typeof e?e:""+e).replace(Br,"\n").replace(Wr,"")}function Gr(e,t,r){if(t=Yr(t),Yr(e)!==t&&r)throw Error(n(425))}function Kr(){}var Xr=null,Jr=null;function Zr(e,t){return"textarea"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var Qr="function"==typeof setTimeout?setTimeout:void 0,ei="function"==typeof clearTimeout?clearTimeout:void 0,ti="function"==typeof Promise?Promise:void 0,ni="function"==typeof queueMicrotask?queueMicrotask:void 0!==ti?function(e){return ti.resolve(null).then(e).catch(ri)}:Qr;function ri(e){setTimeout(function(){throw e})}function ii(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&8===i.nodeType)if("/$"===(n=i.data)){if(0===r)return e.removeChild(i),void Ft(t);r--}else"$"!==n&&"$?"!==n&&"$!"!==n||r++;n=i}while(n);Ft(t)}function oi(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){if("$"===(t=e.data)||"$!"===t||"$?"===t)break;if("/$"===t)return null}}return e}function ai(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var si=Math.random().toString(36).slice(2),li="__reactFiber$"+si,ci="__reactProps$"+si,ui="__reactContainer$"+si,di="__reactEvents$"+si,fi="__reactListeners$"+si,hi="__reactHandles$"+si;function pi(e){var t=e[li];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ui]||n[li]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=ai(e);null!==e;){if(n=e[li])return n;e=ai(e)}return t}n=(e=n).parentNode}return null}function mi(e){return!(e=e[li]||e[ui])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function gi(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(n(33))}function yi(e){return e[ci]||null}var vi=[],bi=-1;function xi(e){return{current:e}}function Si(e){0>bi||(e.current=vi[bi],vi[bi]=null,bi--)}function Mi(e,t){bi++,vi[bi]=e.current,e.current=t}var wi={},ki=xi(wi),Ei=xi(!1),Ci=wi;function Ni(e,t){var n=e.type.contextTypes;if(!n)return wi;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i,o={};for(i in n)o[i]=t[i];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Ti(e){return null!=(e=e.childContextTypes)}function Di(){Si(Ei),Si(ki)}function qi(e,t,r){if(ki.current!==wi)throw Error(n(168));Mi(ki,t),Mi(Ei,r)}function Oi(e,t,r){var i=e.stateNode;if(t=t.childContextTypes,"function"!=typeof i.getChildContext)return r;for(var o in i=i.getChildContext())if(!(o in t))throw Error(n(108,j(e)||"Unknown",o));return _({},r,i)}function Ii(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||wi,Ci=ki.current,Mi(ki,e),Mi(Ei,Ei.current),!0}function Ai(e,t,r){var i=e.stateNode;if(!i)throw Error(n(169));r?(e=Oi(e,t,Ci),i.__reactInternalMemoizedMergedChildContext=e,Si(Ei),Si(ki),Mi(ki,e)):Si(Ei),Mi(Ei,r)}var _i=null,Li=!1,Pi=!1;function Ri(e){null===_i?_i=[e]:_i.push(e)}function Fi(){if(!Pi&&null!==_i){Pi=!0;var e=0,t=mt;try{var n=_i;for(mt=1;e<n.length;e++){var r=n[e];do{r=r(!0)}while(null!==r)}_i=null,Li=!1}catch(t){throw null!==_i&&(_i=_i.slice(e+1)),Ue(Ke,Fi),t}finally{mt=t,Pi=!1}}return null}var zi=[],ji=0,$i=null,Vi=0,Ui=[],Hi=0,Bi=null,Wi=1,Yi="";function Gi(e,t){zi[ji++]=Vi,zi[ji++]=$i,$i=e,Vi=t}function Ki(e,t,n){Ui[Hi++]=Wi,Ui[Hi++]=Yi,Ui[Hi++]=Bi,Bi=e;var r=Wi;e=Yi;var i=32-nt(r)-1;r&=~(1<<i),n+=1;var o=32-nt(t)+i;if(30<o){var a=i-i%5;o=(r&(1<<a)-1).toString(32),r>>=a,i-=a,Wi=1<<32-nt(t)+i|n<<i|r,Yi=o+e}else Wi=1<<o|n<<i|r,Yi=e}function Xi(e){null!==e.return&&(Gi(e,1),Ki(e,1,0))}function Ji(e){for(;e===$i;)$i=zi[--ji],zi[ji]=null,Vi=zi[--ji],zi[ji]=null;for(;e===Bi;)Bi=Ui[--Hi],Ui[Hi]=null,Yi=Ui[--Hi],Ui[Hi]=null,Wi=Ui[--Hi],Ui[Hi]=null}var Zi=null,Qi=null,eo=!1,to=null;function no(e,t){var n=Nc(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,null===(t=e.deletions)?(e.deletions=[n],e.flags|=16):t.push(n)}function ro(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,Zi=e,Qi=oi(t.firstChild),!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,Zi=e,Qi=null,!0);case 13:return null!==(t=8!==t.nodeType?null:t)&&(n=null!==Bi?{id:Wi,overflow:Yi}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},(n=Nc(18,null,null,0)).stateNode=t,n.return=e,e.child=n,Zi=e,Qi=null,!0);default:return!1}}function io(e){return!(!(1&e.mode)||128&e.flags)}function oo(e){if(eo){var t=Qi;if(t){var r=t;if(!ro(e,t)){if(io(e))throw Error(n(418));t=oi(r.nextSibling);var i=Zi;t&&ro(e,t)?no(i,r):(e.flags=-4097&e.flags|2,eo=!1,Zi=e)}}else{if(io(e))throw Error(n(418));e.flags=-4097&e.flags|2,eo=!1,Zi=e}}}function ao(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;Zi=e}function so(e){if(e!==Zi)return!1;if(!eo)return ao(e),eo=!0,!1;var t;if((t=3!==e.tag)&&!(t=5!==e.tag)&&(t="head"!==(t=e.type)&&"body"!==t&&!Zr(e.type,e.memoizedProps)),t&&(t=Qi)){if(io(e))throw lo(),Error(n(418));for(;t;)no(e,t),t=oi(t.nextSibling)}if(ao(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(n(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var r=e.data;if("/$"===r){if(0===t){Qi=oi(e.nextSibling);break e}t--}else"$"!==r&&"$!"!==r&&"$?"!==r||t++}e=e.nextSibling}Qi=null}}else Qi=Zi?oi(e.stateNode.nextSibling):null;return!0}function lo(){for(var e=Qi;e;)e=oi(e.nextSibling)}function co(){Qi=Zi=null,eo=!1}function uo(e){null===to?to=[e]:to.push(e)}var fo=y.ReactCurrentBatchConfig;function ho(e,t,r){if(null!==(e=r.ref)&&"function"!=typeof e&&"object"!=typeof e){if(r._owner){if(r=r._owner){if(1!==r.tag)throw Error(n(309));var i=r.stateNode}if(!i)throw Error(n(147,e));var o=i,a=""+e;return null!==t&&null!==t.ref&&"function"==typeof t.ref&&t.ref._stringRef===a?t.ref:(t=function(e){var t=o.refs;null===e?delete t[a]:t[a]=e},t._stringRef=a,t)}if("string"!=typeof e)throw Error(n(284));if(!r._owner)throw Error(n(290,e))}return e}function po(e,t){throw e=Object.prototype.toString.call(t),Error(n(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function mo(e){return(0,e._init)(e._payload)}function go(e){function t(t,n){if(e){var r=t.deletions;null===r?(t.deletions=[n],t.flags|=16):r.push(n)}}function r(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function i(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function o(e,t){return(e=Dc(e,t)).index=0,e.sibling=null,e}function a(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.flags|=2,n):r:(t.flags|=2,n):(t.flags|=1048576,n)}function s(t){return e&&null===t.alternate&&(t.flags|=2),t}function l(e,t,n,r){return null===t||6!==t.tag?((t=Ac(n,e.mode,r)).return=e,t):((t=o(t,n)).return=e,t)}function c(e,t,n,r){var i=n.type;return i===x?d(e,t,n.props.children,r,n.key):null!==t&&(t.elementType===i||"object"==typeof i&&null!==i&&i.$$typeof===D&&mo(i)===t.type)?((r=o(t,n.props)).ref=ho(e,t,n),r.return=e,r):((r=qc(n.type,n.key,n.props,null,e.mode,r)).ref=ho(e,t,n),r.return=e,r)}function u(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=_c(n,e.mode,r)).return=e,t):((t=o(t,n.children||[])).return=e,t)}function d(e,t,n,r,i){return null===t||7!==t.tag?((t=Oc(n,e.mode,r,i)).return=e,t):((t=o(t,n)).return=e,t)}function f(e,t,n){if("string"==typeof t&&""!==t||"number"==typeof t)return(t=Ac(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case v:return(n=qc(t.type,t.key,t.props,null,e.mode,n)).ref=ho(e,null,t),n.return=e,n;case b:return(t=_c(t,e.mode,n)).return=e,t;case D:return f(e,(0,t._init)(t._payload),n)}if(Z(t)||I(t))return(t=Oc(t,e.mode,n,null)).return=e,t;po(e,t)}return null}function h(e,t,n,r){var i=null!==t?t.key:null;if("string"==typeof n&&""!==n||"number"==typeof n)return null!==i?null:l(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case v:return n.key===i?c(e,t,n,r):null;case b:return n.key===i?u(e,t,n,r):null;case D:return h(e,t,(i=n._init)(n._payload),r)}if(Z(n)||I(n))return null!==i?null:d(e,t,n,r,null);po(e,n)}return null}function p(e,t,n,r,i){if("string"==typeof r&&""!==r||"number"==typeof r)return l(t,e=e.get(n)||null,""+r,i);if("object"==typeof r&&null!==r){switch(r.$$typeof){case v:return c(t,e=e.get(null===r.key?n:r.key)||null,r,i);case b:return u(t,e=e.get(null===r.key?n:r.key)||null,r,i);case D:return p(e,t,n,(0,r._init)(r._payload),i)}if(Z(r)||I(r))return d(t,e=e.get(n)||null,r,i,null);po(t,r)}return null}function m(n,o,s,l){for(var c=null,u=null,d=o,m=o=0,g=null;null!==d&&m<s.length;m++){d.index>m?(g=d,d=null):g=d.sibling;var y=h(n,d,s[m],l);if(null===y){null===d&&(d=g);break}e&&d&&null===y.alternate&&t(n,d),o=a(y,o,m),null===u?c=y:u.sibling=y,u=y,d=g}if(m===s.length)return r(n,d),eo&&Gi(n,m),c;if(null===d){for(;m<s.length;m++)null!==(d=f(n,s[m],l))&&(o=a(d,o,m),null===u?c=d:u.sibling=d,u=d);return eo&&Gi(n,m),c}for(d=i(n,d);m<s.length;m++)null!==(g=p(d,n,m,s[m],l))&&(e&&null!==g.alternate&&d.delete(null===g.key?m:g.key),o=a(g,o,m),null===u?c=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(n,e)}),eo&&Gi(n,m),c}function g(o,s,l,c){var u=I(l);if("function"!=typeof u)throw Error(n(150));if(null==(l=u.call(l)))throw Error(n(151));for(var d=u=null,m=s,g=s=0,y=null,v=l.next();null!==m&&!v.done;g++,v=l.next()){m.index>g?(y=m,m=null):y=m.sibling;var b=h(o,m,v.value,c);if(null===b){null===m&&(m=y);break}e&&m&&null===b.alternate&&t(o,m),s=a(b,s,g),null===d?u=b:d.sibling=b,d=b,m=y}if(v.done)return r(o,m),eo&&Gi(o,g),u;if(null===m){for(;!v.done;g++,v=l.next())null!==(v=f(o,v.value,c))&&(s=a(v,s,g),null===d?u=v:d.sibling=v,d=v);return eo&&Gi(o,g),u}for(m=i(o,m);!v.done;g++,v=l.next())null!==(v=p(m,o,g,v.value,c))&&(e&&null!==v.alternate&&m.delete(null===v.key?g:v.key),s=a(v,s,g),null===d?u=v:d.sibling=v,d=v);return e&&m.forEach(function(e){return t(o,e)}),eo&&Gi(o,g),u}return function e(n,i,a,l){if("object"==typeof a&&null!==a&&a.type===x&&null===a.key&&(a=a.props.children),"object"==typeof a&&null!==a){switch(a.$$typeof){case v:e:{for(var c=a.key,u=i;null!==u;){if(u.key===c){if((c=a.type)===x){if(7===u.tag){r(n,u.sibling),(i=o(u,a.props.children)).return=n,n=i;break e}}else if(u.elementType===c||"object"==typeof c&&null!==c&&c.$$typeof===D&&mo(c)===u.type){r(n,u.sibling),(i=o(u,a.props)).ref=ho(n,u,a),i.return=n,n=i;break e}r(n,u);break}t(n,u),u=u.sibling}a.type===x?((i=Oc(a.props.children,n.mode,l,a.key)).return=n,n=i):((l=qc(a.type,a.key,a.props,null,n.mode,l)).ref=ho(n,i,a),l.return=n,n=l)}return s(n);case b:e:{for(u=a.key;null!==i;){if(i.key===u){if(4===i.tag&&i.stateNode.containerInfo===a.containerInfo&&i.stateNode.implementation===a.implementation){r(n,i.sibling),(i=o(i,a.children||[])).return=n,n=i;break e}r(n,i);break}t(n,i),i=i.sibling}(i=_c(a,n.mode,l)).return=n,n=i}return s(n);case D:return e(n,i,(u=a._init)(a._payload),l)}if(Z(a))return m(n,i,a,l);if(I(a))return g(n,i,a,l);po(n,a)}return"string"==typeof a&&""!==a||"number"==typeof a?(a=""+a,null!==i&&6===i.tag?(r(n,i.sibling),(i=o(i,a)).return=n,n=i):(r(n,i),(i=Ac(a,n.mode,l)).return=n,n=i),s(n)):r(n,i)}}var yo=go(!0),vo=go(!1),bo=xi(null),xo=null,So=null,Mo=null;function wo(){Mo=So=xo=null}function ko(e){var t=bo.current;Si(bo),e._currentValue=t}function Eo(e,t,n){for(;null!==e;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==r&&(r.childLanes|=t)):null!==r&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Co(e,t){xo=e,Mo=So=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!==(e.lanes&t)&&(ms=!0),e.firstContext=null)}function No(e){var t=e._currentValue;if(Mo!==e)if(e={context:e,memoizedValue:t,next:null},null===So){if(null===xo)throw Error(n(308));So=e,xo.dependencies={lanes:0,firstContext:e}}else So=So.next=e;return t}var To=null;function Do(e){null===To?To=[e]:To.push(e)}function qo(e,t,n,r){var i=t.interleaved;return null===i?(n.next=n,Do(t)):(n.next=i.next,i.next=n),t.interleaved=n,Oo(e,r)}function Oo(e,t){e.lanes|=t;var n=e.alternate;for(null!==n&&(n.lanes|=t),n=e,e=e.return;null!==e;)e.childLanes|=t,null!==(n=e.alternate)&&(n.childLanes|=t),n=e,e=e.return;return 3===n.tag?n.stateNode:null}var Io=!1;function Ao(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function _o(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Lo(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Po(e,t,n){var r=e.updateQueue;if(null===r)return null;if(r=r.shared,2&kl){var i=r.pending;return null===i?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Oo(e,n)}return null===(i=r.interleaved)?(t.next=t,Do(r)):(t.next=i.next,i.next=t),r.interleaved=t,Oo(e,n)}function Ro(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,4194240&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,pt(e,n)}}function Fo(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var i=null,o=null;if(null!==(n=n.firstBaseUpdate)){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===o?i=o=a:o=o.next=a,n=n.next}while(null!==n);null===o?i=o=t:o=o.next=t}else i=o=t;return n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function zo(e,t,n,r){var i=e.updateQueue;Io=!1;var o=i.firstBaseUpdate,a=i.lastBaseUpdate,s=i.shared.pending;if(null!==s){i.shared.pending=null;var l=s,c=l.next;l.next=null,null===a?o=c:a.next=c,a=l;var u=e.alternate;null!==u&&((s=(u=u.updateQueue).lastBaseUpdate)!==a&&(null===s?u.firstBaseUpdate=c:s.next=c,u.lastBaseUpdate=l))}if(null!==o){var d=i.baseState;for(a=0,u=c=l=null,s=o;;){var f=s.lane,h=s.eventTime;if((r&f)===f){null!==u&&(u=u.next={eventTime:h,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var p=e,m=s;switch(f=t,h=n,m.tag){case 1:if("function"==typeof(p=m.payload)){d=p.call(h,d,f);break e}d=p;break e;case 3:p.flags=-65537&p.flags|128;case 0:if(null==(f="function"==typeof(p=m.payload)?p.call(h,d,f):p))break e;d=_({},d,f);break e;case 2:Io=!0}}null!==s.callback&&0!==s.lane&&(e.flags|=64,null===(f=i.effects)?i.effects=[s]:f.push(s))}else h={eventTime:h,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},null===u?(c=u=h,l=d):u=u.next=h,a|=f;if(null===(s=s.next)){if(null===(s=i.shared.pending))break;s=(f=s).next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}if(null===u&&(l=d),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=u,null!==(t=i.shared.interleaved)){i=t;do{a|=i.lane,i=i.next}while(i!==t)}else null===o&&(i.shared.lanes=0);Il|=a,e.lanes=a,e.memoizedState=d}}function jo(e,t,r){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var i=e[t],o=i.callback;if(null!==o){if(i.callback=null,i=r,"function"!=typeof o)throw Error(n(191,o));o.call(i)}}}var $o={},Vo=xi($o),Uo=xi($o),Ho=xi($o);function Bo(e){if(e===$o)throw Error(n(174));return e}function Wo(e,t){switch(Mi(Ho,t),Mi(Uo,e),Mi(Vo,$o),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:oe(null,"");break;default:t=oe(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}Si(Vo),Mi(Vo,t)}function Yo(){Si(Vo),Si(Uo),Si(Ho)}function Go(e){Bo(Ho.current);var t=Bo(Vo.current),n=oe(t,e.type);t!==n&&(Mi(Uo,e),Mi(Vo,n))}function Ko(e){Uo.current===e&&(Si(Vo),Si(Uo))}var Xo=xi(0);function Jo(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(128&t.flags)return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Zo=[];function Qo(){for(var e=0;e<Zo.length;e++)Zo[e]._workInProgressVersionPrimary=null;Zo.length=0}var ea=y.ReactCurrentDispatcher,ta=y.ReactCurrentBatchConfig,na=0,ra=null,ia=null,oa=null,aa=!1,sa=!1,la=0,ca=0;function ua(){throw Error(n(321))}function da(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!rr(e[n],t[n]))return!1;return!0}function fa(e,t,r,i,o,a){if(na=a,ra=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ea.current=null===e||null===e.memoizedState?Ka:Xa,e=r(i,o),sa){a=0;do{if(sa=!1,la=0,25<=a)throw Error(n(301));a+=1,oa=ia=null,t.updateQueue=null,ea.current=Ja,e=r(i,o)}while(sa)}if(ea.current=Ga,t=null!==ia&&null!==ia.next,na=0,oa=ia=ra=null,aa=!1,t)throw Error(n(300));return e}function ha(){var e=0!==la;return la=0,e}function pa(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===oa?ra.memoizedState=oa=e:oa=oa.next=e,oa}function ma(){if(null===ia){var e=ra.alternate;e=null!==e?e.memoizedState:null}else e=ia.next;var t=null===oa?ra.memoizedState:oa.next;if(null!==t)oa=t,ia=e;else{if(null===e)throw Error(n(310));e={memoizedState:(ia=e).memoizedState,baseState:ia.baseState,baseQueue:ia.baseQueue,queue:ia.queue,next:null},null===oa?ra.memoizedState=oa=e:oa=oa.next=e}return oa}function ga(e,t){return"function"==typeof t?t(e):t}function ya(e){var t=ma(),r=t.queue;if(null===r)throw Error(n(311));r.lastRenderedReducer=e;var i=ia,o=i.baseQueue,a=r.pending;if(null!==a){if(null!==o){var s=o.next;o.next=a.next,a.next=s}i.baseQueue=o=a,r.pending=null}if(null!==o){a=o.next,i=i.baseState;var l=s=null,c=null,u=a;do{var d=u.lane;if((na&d)===d)null!==c&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),i=u.hasEagerState?u.eagerState:e(i,u.action);else{var f={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};null===c?(l=c=f,s=i):c=c.next=f,ra.lanes|=d,Il|=d}u=u.next}while(null!==u&&u!==a);null===c?s=i:c.next=l,rr(i,t.memoizedState)||(ms=!0),t.memoizedState=i,t.baseState=s,t.baseQueue=c,r.lastRenderedState=i}if(null!==(e=r.interleaved)){o=e;do{a=o.lane,ra.lanes|=a,Il|=a,o=o.next}while(o!==e)}else null===o&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function va(e){var t=ma(),r=t.queue;if(null===r)throw Error(n(311));r.lastRenderedReducer=e;var i=r.dispatch,o=r.pending,a=t.memoizedState;if(null!==o){r.pending=null;var s=o=o.next;do{a=e(a,s.action),s=s.next}while(s!==o);rr(a,t.memoizedState)||(ms=!0),t.memoizedState=a,null===t.baseQueue&&(t.baseState=a),r.lastRenderedState=a}return[a,i]}function ba(){}function xa(e,t){var r=ra,i=ma(),o=t(),a=!rr(i.memoizedState,o);if(a&&(i.memoizedState=o,ms=!0),i=i.queue,Ia(wa.bind(null,r,i,e),[e]),i.getSnapshot!==t||a||null!==oa&&1&oa.memoizedState.tag){if(r.flags|=2048,Na(9,Ma.bind(null,r,i,o,t),void 0,null),null===El)throw Error(n(349));30&na||Sa(r,t,o)}return o}function Sa(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},null===(t=ra.updateQueue)?(t={lastEffect:null,stores:null},ra.updateQueue=t,t.stores=[e]):null===(n=t.stores)?t.stores=[e]:n.push(e)}function Ma(e,t,n,r){t.value=n,t.getSnapshot=r,ka(t)&&Ea(e)}function wa(e,t,n){return n(function(){ka(t)&&Ea(e)})}function ka(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!rr(e,n)}catch(e){return!0}}function Ea(e){var t=Oo(e,1);null!==t&&Zl(t,e,1,-1)}function Ca(e){var t=pa();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ga,lastRenderedState:e},t.queue=e,e=e.dispatch=Ha.bind(null,ra,e),[t.memoizedState,e]}function Na(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=ra.updateQueue)?(t={lastEffect:null,stores:null},ra.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Ta(){return ma().memoizedState}function Da(e,t,n,r){var i=pa();ra.flags|=e,i.memoizedState=Na(1|t,n,void 0,void 0===r?null:r)}function qa(e,t,n,r){var i=ma();r=void 0===r?null:r;var o=void 0;if(null!==ia){var a=ia.memoizedState;if(o=a.destroy,null!==r&&da(r,a.deps))return void(i.memoizedState=Na(t,n,o,r))}ra.flags|=e,i.memoizedState=Na(1|t,n,o,r)}function Oa(e,t){return Da(8390656,8,e,t)}function Ia(e,t){return qa(2048,8,e,t)}function Aa(e,t){return qa(4,2,e,t)}function _a(e,t){return qa(4,4,e,t)}function La(e,t){return"function"==typeof t?(e=e(),t(e),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function Pa(e,t,n){return n=null!=n?n.concat([e]):null,qa(4,4,La.bind(null,t,e),n)}function Ra(){}function Fa(e,t){var n=ma();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&da(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function za(e,t){var n=ma();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&da(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function ja(e,t,n){return 21&na?(rr(n,t)||(n=dt(),ra.lanes|=n,Il|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,ms=!0),e.memoizedState=n)}function $a(e,t){var n=mt;mt=0!==n&&4>n?n:4,e(!0);var r=ta.transition;ta.transition={};try{e(!1),t()}finally{mt=n,ta.transition=r}}function Va(){return ma().memoizedState}function Ua(e,t,n){var r=Jl(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Ba(e))Wa(t,n);else if(null!==(n=qo(e,t,n,r))){Zl(n,e,r,Xl()),Ya(n,t,r)}}function Ha(e,t,n){var r=Jl(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ba(e))Wa(t,i);else{var o=e.alternate;if(0===e.lanes&&(null===o||0===o.lanes)&&null!==(o=t.lastRenderedReducer))try{var a=t.lastRenderedState,s=o(a,n);if(i.hasEagerState=!0,i.eagerState=s,rr(s,a)){var l=t.interleaved;return null===l?(i.next=i,Do(t)):(i.next=l.next,l.next=i),void(t.interleaved=i)}}catch(e){}null!==(n=qo(e,t,i,r))&&(Zl(n,e,r,i=Xl()),Ya(n,t,r))}}function Ba(e){var t=e.alternate;return e===ra||null!==t&&t===ra}function Wa(e,t){sa=aa=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ya(e,t,n){if(4194240&n){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,pt(e,n)}}var Ga={readContext:No,useCallback:ua,useContext:ua,useEffect:ua,useImperativeHandle:ua,useInsertionEffect:ua,useLayoutEffect:ua,useMemo:ua,useReducer:ua,useRef:ua,useState:ua,useDebugValue:ua,useDeferredValue:ua,useTransition:ua,useMutableSource:ua,useSyncExternalStore:ua,useId:ua,unstable_isNewReconciler:!1},Ka={readContext:No,useCallback:function(e,t){return pa().memoizedState=[e,void 0===t?null:t],e},useContext:No,useEffect:Oa,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,Da(4194308,4,La.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Da(4194308,4,e,t)},useInsertionEffect:function(e,t){return Da(4,2,e,t)},useMemo:function(e,t){var n=pa();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=pa();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Ua.bind(null,ra,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},pa().memoizedState=e},useState:Ca,useDebugValue:Ra,useDeferredValue:function(e){return pa().memoizedState=e},useTransition:function(){var e=Ca(!1),t=e[0];return e=$a.bind(null,e[1]),pa().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var i=ra,o=pa();if(eo){if(void 0===r)throw Error(n(407));r=r()}else{if(r=t(),null===El)throw Error(n(349));30&na||Sa(i,t,r)}o.memoizedState=r;var a={value:r,getSnapshot:t};return o.queue=a,Oa(wa.bind(null,i,a,e),[e]),i.flags|=2048,Na(9,Ma.bind(null,i,a,r,t),void 0,null),r},useId:function(){var e=pa(),t=El.identifierPrefix;if(eo){var n=Yi;t=":"+t+"R"+(n=(Wi&~(1<<32-nt(Wi)-1)).toString(32)+n),0<(n=la++)&&(t+="H"+n.toString(32)),t+=":"}else t=":"+t+"r"+(n=ca++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Xa={readContext:No,useCallback:Fa,useContext:No,useEffect:Ia,useImperativeHandle:Pa,useInsertionEffect:Aa,useLayoutEffect:_a,useMemo:za,useReducer:ya,useRef:Ta,useState:function(){return ya(ga)},useDebugValue:Ra,useDeferredValue:function(e){return ja(ma(),ia.memoizedState,e)},useTransition:function(){return[ya(ga)[0],ma().memoizedState]},useMutableSource:ba,useSyncExternalStore:xa,useId:Va,unstable_isNewReconciler:!1},Ja={readContext:No,useCallback:Fa,useContext:No,useEffect:Ia,useImperativeHandle:Pa,useInsertionEffect:Aa,useLayoutEffect:_a,useMemo:za,useReducer:va,useRef:Ta,useState:function(){return va(ga)},useDebugValue:Ra,useDeferredValue:function(e){var t=ma();return null===ia?t.memoizedState=e:ja(t,ia.memoizedState,e)},useTransition:function(){return[va(ga)[0],ma().memoizedState]},useMutableSource:ba,useSyncExternalStore:xa,useId:Va,unstable_isNewReconciler:!1};function Za(e,t){if(e&&e.defaultProps){for(var n in t=_({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}return t}function Qa(e,t,n,r){n=null==(n=n(r,t=e.memoizedState))?t:_({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var es={isMounted:function(e){return!!(e=e._reactInternals)&&Fe(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Xl(),i=Jl(e),o=Lo(r,i);o.payload=t,null!=n&&(o.callback=n),null!==(t=Po(e,o,i))&&(Zl(t,e,i,r),Ro(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Xl(),i=Jl(e),o=Lo(r,i);o.tag=1,o.payload=t,null!=n&&(o.callback=n),null!==(t=Po(e,o,i))&&(Zl(t,e,i,r),Ro(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Xl(),r=Jl(e),i=Lo(n,r);i.tag=2,null!=t&&(i.callback=t),null!==(t=Po(e,i,r))&&(Zl(t,e,r,n),Ro(t,e,r))}};function ts(e,t,n,r,i,o,a){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,o,a):!t.prototype||!t.prototype.isPureReactComponent||(!ir(n,r)||!ir(i,o))}function ns(e,t,n){var r=!1,i=wi,o=t.contextType;return"object"==typeof o&&null!==o?o=No(o):(i=Ti(t)?Ci:ki.current,o=(r=null!=(r=t.contextTypes))?Ni(e,i):wi),t=new t(n,o),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=es,e.stateNode=t,t._reactInternals=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=o),t}function rs(e,t,n,r){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&es.enqueueReplaceState(t,t.state,null)}function is(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},Ao(e);var o=t.contextType;"object"==typeof o&&null!==o?i.context=No(o):(o=Ti(t)?Ci:ki.current,i.context=Ni(e,o)),i.state=e.memoizedState,"function"==typeof(o=t.getDerivedStateFromProps)&&(Qa(e,t,o,n),i.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof i.getSnapshotBeforeUpdate||"function"!=typeof i.UNSAFE_componentWillMount&&"function"!=typeof i.componentWillMount||(t=i.state,"function"==typeof i.componentWillMount&&i.componentWillMount(),"function"==typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount(),t!==i.state&&es.enqueueReplaceState(i,i.state,null),zo(e,n,i,r),i.state=e.memoizedState),"function"==typeof i.componentDidMount&&(e.flags|=4194308)}function os(e,t){try{var n="",r=t;do{n+=F(r),r=r.return}while(r);var i=n}catch(e){i="\nError generating stack: "+e.message+"\n"+e.stack}return{value:e,source:t,stack:i,digest:null}}function as(e,t,n){return{value:e,source:null,stack:null!=n?n:null,digest:null!=t?t:null}}function ss(e,t){try{console.error(t.value)}catch(e){setTimeout(function(){throw e})}}var ls="function"==typeof WeakMap?WeakMap:Map;function cs(e,t,n){(n=Lo(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){jl||(jl=!0,$l=r),ss(0,t)},n}function us(e,t,n){(n=Lo(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){ss(0,t)}}var o=e.stateNode;return null!==o&&"function"==typeof o.componentDidCatch&&(n.callback=function(){ss(0,t),"function"!=typeof r&&(null===Vl?Vl=new Set([this]):Vl.add(this));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}function ds(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new ls;var i=new Set;r.set(t,i)}else void 0===(i=r.get(t))&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=Sc.bind(null,e,t,n),t.then(e,e))}function fs(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e);return null}function hs(e,t,n,r,i){return 1&e.mode?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,1===n.tag&&(null===n.alternate?n.tag=17:((t=Lo(-1,1)).tag=2,Po(n,t,1))),n.lanes|=1),e)}var ps=y.ReactCurrentOwner,ms=!1;function gs(e,t,n,r){t.child=null===e?vo(t,null,n,r):yo(t,e.child,n,r)}function ys(e,t,n,r,i){n=n.render;var o=t.ref;return Co(t,i),r=fa(e,t,n,r,o,i),n=ha(),null===e||ms?(eo&&n&&Xi(t),t.flags|=1,gs(e,t,r,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,js(e,t,i))}function vs(e,t,n,r,i){if(null===e){var o=n.type;return"function"!=typeof o||Tc(o)||void 0!==o.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=qc(n.type,null,r,t,t.mode,i)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=o,bs(e,t,o,r,i))}if(o=e.child,0===(e.lanes&i)){var a=o.memoizedProps;if((n=null!==(n=n.compare)?n:ir)(a,r)&&e.ref===t.ref)return js(e,t,i)}return t.flags|=1,(e=Dc(o,r)).ref=t.ref,e.return=t,t.child=e}function bs(e,t,n,r,i){if(null!==e){var o=e.memoizedProps;if(ir(o,r)&&e.ref===t.ref){if(ms=!1,t.pendingProps=r=o,0===(e.lanes&i))return t.lanes=e.lanes,js(e,t,i);131072&e.flags&&(ms=!0)}}return Ms(e,t,n,r,i)}function xs(e,t,n){var r=t.pendingProps,i=r.children,o=null!==e?e.memoizedState:null;if("hidden"===r.mode)if(1&t.mode){if(!(1073741824&n))return e=null!==o?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Mi(Dl,Tl),Tl|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=null!==o?o.baseLanes:n,Mi(Dl,Tl),Tl|=r}else t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Mi(Dl,Tl),Tl|=n;else null!==o?(r=o.baseLanes|n,t.memoizedState=null):r=n,Mi(Dl,Tl),Tl|=r;return gs(e,t,i,n),t.child}function Ss(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Ms(e,t,n,r,i){var o=Ti(n)?Ci:ki.current;return o=Ni(t,o),Co(t,i),n=fa(e,t,n,r,o,i),r=ha(),null===e||ms?(eo&&r&&Xi(t),t.flags|=1,gs(e,t,n,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,js(e,t,i))}function ws(e,t,n,r,i){if(Ti(n)){var o=!0;Ii(t)}else o=!1;if(Co(t,i),null===t.stateNode)zs(e,t),ns(t,n,r),is(t,n,r,i),r=!0;else if(null===e){var a=t.stateNode,s=t.memoizedProps;a.props=s;var l=a.context,c=n.contextType;"object"==typeof c&&null!==c?c=No(c):c=Ni(t,c=Ti(n)?Ci:ki.current);var u=n.getDerivedStateFromProps,d="function"==typeof u||"function"==typeof a.getSnapshotBeforeUpdate;d||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(s!==r||l!==c)&&rs(t,a,r,c),Io=!1;var f=t.memoizedState;a.state=f,zo(t,r,a,i),l=t.memoizedState,s!==r||f!==l||Ei.current||Io?("function"==typeof u&&(Qa(t,n,u,r),l=t.memoizedState),(s=Io||ts(t,n,s,r,f,l,c))?(d||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||("function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"==typeof a.componentDidMount&&(t.flags|=4194308)):("function"==typeof a.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=c,r=s):("function"==typeof a.componentDidMount&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,_o(e,t),s=t.memoizedProps,c=t.type===t.elementType?s:Za(t.type,s),a.props=c,d=t.pendingProps,f=a.context,"object"==typeof(l=n.contextType)&&null!==l?l=No(l):l=Ni(t,l=Ti(n)?Ci:ki.current);var h=n.getDerivedStateFromProps;(u="function"==typeof h||"function"==typeof a.getSnapshotBeforeUpdate)||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(s!==d||f!==l)&&rs(t,a,r,l),Io=!1,f=t.memoizedState,a.state=f,zo(t,r,a,i);var p=t.memoizedState;s!==d||f!==p||Ei.current||Io?("function"==typeof h&&(Qa(t,n,h,r),p=t.memoizedState),(c=Io||ts(t,n,c,r,f,p,l)||!1)?(u||"function"!=typeof a.UNSAFE_componentWillUpdate&&"function"!=typeof a.componentWillUpdate||("function"==typeof a.componentWillUpdate&&a.componentWillUpdate(r,p,l),"function"==typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(r,p,l)),"function"==typeof a.componentDidUpdate&&(t.flags|=4),"function"==typeof a.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!=typeof a.componentDidUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=l,r=c):("function"!=typeof a.componentDidUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return ks(e,t,n,r,o,i)}function ks(e,t,n,r,i,o){Ss(e,t);var a=!!(128&t.flags);if(!r&&!a)return i&&Ai(t,n,!1),js(e,t,o);r=t.stateNode,ps.current=t;var s=a&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&a?(t.child=yo(t,e.child,null,o),t.child=yo(t,null,s,o)):gs(e,t,s,o),t.memoizedState=r.state,i&&Ai(t,n,!0),t.child}function Es(e){var t=e.stateNode;t.pendingContext?qi(0,t.pendingContext,t.pendingContext!==t.context):t.context&&qi(0,t.context,!1),Wo(e,t.containerInfo)}function Cs(e,t,n,r,i){return co(),uo(i),t.flags|=256,gs(e,t,n,r),t.child}var Ns,Ts,Ds,qs,Os={dehydrated:null,treeContext:null,retryLane:0};function Is(e){return{baseLanes:e,cachePool:null,transitions:null}}function As(e,t,r){var i,o=t.pendingProps,a=Xo.current,s=!1,l=!!(128&t.flags);if((i=l)||(i=(null===e||null!==e.memoizedState)&&!!(2&a)),i?(s=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(a|=1),Mi(Xo,1&a),null===e)return oo(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated)?(1&t.mode?"$!"===e.data?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(l=o.children,e=o.fallback,s?(o=t.mode,s=t.child,l={mode:"hidden",children:l},1&o||null===s?s=Ic(l,o,0,null):(s.childLanes=0,s.pendingProps=l),e=Oc(e,o,r,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=Is(r),t.memoizedState=Os,e):_s(t,l));if(null!==(a=e.memoizedState)&&null!==(i=a.dehydrated))return function(e,t,r,i,o,a,s){if(r)return 256&t.flags?(t.flags&=-257,Ls(e,t,s,i=as(Error(n(422))))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(a=i.fallback,o=t.mode,i=Ic({mode:"visible",children:i.children},o,0,null),(a=Oc(a,o,s,null)).flags|=2,i.return=t,a.return=t,i.sibling=a,t.child=i,1&t.mode&&yo(t,e.child,null,s),t.child.memoizedState=Is(s),t.memoizedState=Os,a);if(!(1&t.mode))return Ls(e,t,s,null);if("$!"===o.data){if(i=o.nextSibling&&o.nextSibling.dataset)var l=i.dgst;return i=l,Ls(e,t,s,i=as(a=Error(n(419)),i,void 0))}if(l=0!==(s&e.childLanes),ms||l){if(null!==(i=El)){switch(s&-s){case 4:o=2;break;case 16:o=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}0!==(o=0!==(o&(i.suspendedLanes|s))?0:o)&&o!==a.retryLane&&(a.retryLane=o,Oo(e,o),Zl(i,e,o,-1))}return dc(),Ls(e,t,s,i=as(Error(n(421))))}return"$?"===o.data?(t.flags|=128,t.child=e.child,t=wc.bind(null,e),o._reactRetry=t,null):(e=a.treeContext,Qi=oi(o.nextSibling),Zi=t,eo=!0,to=null,null!==e&&(Ui[Hi++]=Wi,Ui[Hi++]=Yi,Ui[Hi++]=Bi,Wi=e.id,Yi=e.overflow,Bi=t),t=_s(t,i.children),t.flags|=4096,t)}(e,t,l,o,i,a,r);if(s){s=o.fallback,l=t.mode,i=(a=e.child).sibling;var c={mode:"hidden",children:o.children};return 1&l||t.child===a?(o=Dc(a,c)).subtreeFlags=14680064&a.subtreeFlags:((o=t.child).childLanes=0,o.pendingProps=c,t.deletions=null),null!==i?s=Dc(i,s):(s=Oc(s,l,r,null)).flags|=2,s.return=t,o.return=t,o.sibling=s,t.child=o,o=s,s=t.child,l=null===(l=e.child.memoizedState)?Is(r):{baseLanes:l.baseLanes|r,cachePool:null,transitions:l.transitions},s.memoizedState=l,s.childLanes=e.childLanes&~r,t.memoizedState=Os,o}return e=(s=e.child).sibling,o=Dc(s,{mode:"visible",children:o.children}),!(1&t.mode)&&(o.lanes=r),o.return=t,o.sibling=null,null!==e&&(null===(r=t.deletions)?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=o,t.memoizedState=null,o}function _s(e,t){return(t=Ic({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function Ls(e,t,n,r){return null!==r&&uo(r),yo(t,e.child,null,n),(e=_s(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function Ps(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),Eo(e.return,t,n)}function Rs(e,t,n,r,i){var o=e.memoizedState;null===o?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i)}function Fs(e,t,n){var r=t.pendingProps,i=r.revealOrder,o=r.tail;if(gs(e,t,r.children,n),2&(r=Xo.current))r=1&r|2,t.flags|=128;else{if(null!==e&&128&e.flags)e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Ps(e,n,t);else if(19===e.tag)Ps(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Mi(Xo,r),1&t.mode)switch(i){case"forwards":for(n=t.child,i=null;null!==n;)null!==(e=n.alternate)&&null===Jo(e)&&(i=n),n=n.sibling;null===(n=i)?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Rs(t,!1,i,n,o);break;case"backwards":for(n=null,i=t.child,t.child=null;null!==i;){if(null!==(e=i.alternate)&&null===Jo(e)){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Rs(t,!0,n,null,o);break;case"together":Rs(t,!1,null,null,void 0);break;default:t.memoizedState=null}else t.memoizedState=null;return t.child}function zs(e,t){!(1&t.mode)&&null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function js(e,t,r){if(null!==e&&(t.dependencies=e.dependencies),Il|=t.lanes,0===(r&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(n(153));if(null!==t.child){for(r=Dc(e=t.child,e.pendingProps),t.child=r,r.return=t;null!==e.sibling;)e=e.sibling,(r=r.sibling=Dc(e,e.pendingProps)).return=t;r.sibling=null}return t.child}function $s(e,t){if(!eo)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Vs(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;null!==i;)n|=i.lanes|i.childLanes,r|=14680064&i.subtreeFlags,r|=14680064&i.flags,i.return=e,i=i.sibling;else for(i=e.child;null!==i;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Us(e,t,r){var o=t.pendingProps;switch(Ji(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Vs(t),null;case 1:case 17:return Ti(t.type)&&Di(),Vs(t),null;case 3:return o=t.stateNode,Yo(),Si(Ei),Si(ki),Qo(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),null!==e&&null!==e.child||(so(t)?t.flags|=4:null===e||e.memoizedState.isDehydrated&&!(256&t.flags)||(t.flags|=1024,null!==to&&(nc(to),to=null))),Ts(e,t),Vs(t),null;case 5:Ko(t);var a=Bo(Ho.current);if(r=t.type,null!==e&&null!=t.stateNode)Ds(e,t,r,o,a),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!o){if(null===t.stateNode)throw Error(n(166));return Vs(t),null}if(e=Bo(Vo.current),so(t)){o=t.stateNode,r=t.type;var s=t.memoizedProps;switch(o[li]=t,o[ci]=s,e=!!(1&t.mode),r){case"dialog":Lr("cancel",o),Lr("close",o);break;case"iframe":case"object":case"embed":Lr("load",o);break;case"video":case"audio":for(a=0;a<Or.length;a++)Lr(Or[a],o);break;case"source":Lr("error",o);break;case"img":case"image":case"link":Lr("error",o),Lr("load",o);break;case"details":Lr("toggle",o);break;case"input":Y(o,s),Lr("invalid",o);break;case"select":o._wrapperState={wasMultiple:!!s.multiple},Lr("invalid",o);break;case"textarea":te(o,s),Lr("invalid",o)}for(var l in pe(r,s),a=null,s)if(s.hasOwnProperty(l)){var c=s[l];"children"===l?"string"==typeof c?o.textContent!==c&&(!0!==s.suppressHydrationWarning&&Gr(o.textContent,c,e),a=["children",c]):"number"==typeof c&&o.textContent!==""+c&&(!0!==s.suppressHydrationWarning&&Gr(o.textContent,c,e),a=["children",""+c]):i.hasOwnProperty(l)&&null!=c&&"onScroll"===l&&Lr("scroll",o)}switch(r){case"input":U(o),X(o,s,!0);break;case"textarea":U(o),re(o);break;case"select":case"option":break;default:"function"==typeof s.onClick&&(o.onclick=Kr)}o=a,t.updateQueue=o,null!==o&&(t.flags|=4)}else{l=9===a.nodeType?a:a.ownerDocument,"http://www.w3.org/1999/xhtml"===e&&(e=ie(r)),"http://www.w3.org/1999/xhtml"===e?"script"===r?((e=l.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"==typeof o.is?e=l.createElement(r,{is:o.is}):(e=l.createElement(r),"select"===r&&(l=e,o.multiple?l.multiple=!0:o.size&&(l.size=o.size))):e=l.createElementNS(e,r),e[li]=t,e[ci]=o,Ns(e,t,!1,!1),t.stateNode=e;e:{switch(l=me(r,o),r){case"dialog":Lr("cancel",e),Lr("close",e),a=o;break;case"iframe":case"object":case"embed":Lr("load",e),a=o;break;case"video":case"audio":for(a=0;a<Or.length;a++)Lr(Or[a],e);a=o;break;case"source":Lr("error",e),a=o;break;case"img":case"image":case"link":Lr("error",e),Lr("load",e),a=o;break;case"details":Lr("toggle",e),a=o;break;case"input":Y(e,o),a=W(e,o),Lr("invalid",e);break;case"option":default:a=o;break;case"select":e._wrapperState={wasMultiple:!!o.multiple},a=_({},o,{value:void 0}),Lr("invalid",e);break;case"textarea":te(e,o),a=ee(e,o),Lr("invalid",e)}for(s in pe(r,a),c=a)if(c.hasOwnProperty(s)){var u=c[s];"style"===s?fe(e,u):"dangerouslySetInnerHTML"===s?null!=(u=u?u.__html:void 0)&&se(e,u):"children"===s?"string"==typeof u?("textarea"!==r||""!==u)&&le(e,u):"number"==typeof u&&le(e,""+u):"suppressContentEditableWarning"!==s&&"suppressHydrationWarning"!==s&&"autoFocus"!==s&&(i.hasOwnProperty(s)?null!=u&&"onScroll"===s&&Lr("scroll",e):null!=u&&g(e,s,u,l))}switch(r){case"input":U(e),X(e,o,!1);break;case"textarea":U(e),re(e);break;case"option":null!=o.value&&e.setAttribute("value",""+$(o.value));break;case"select":e.multiple=!!o.multiple,null!=(s=o.value)?Q(e,!!o.multiple,s,!1):null!=o.defaultValue&&Q(e,!!o.multiple,o.defaultValue,!0);break;default:"function"==typeof a.onClick&&(e.onclick=Kr)}switch(r){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}}o&&(t.flags|=4)}null!==t.ref&&(t.flags|=512,t.flags|=2097152)}return Vs(t),null;case 6:if(e&&null!=t.stateNode)qs(e,t,e.memoizedProps,o);else{if("string"!=typeof o&&null===t.stateNode)throw Error(n(166));if(r=Bo(Ho.current),Bo(Vo.current),so(t)){if(o=t.stateNode,r=t.memoizedProps,o[li]=t,(s=o.nodeValue!==r)&&null!==(e=Zi))switch(e.tag){case 3:Gr(o.nodeValue,r,!!(1&e.mode));break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&Gr(o.nodeValue,r,!!(1&e.mode))}s&&(t.flags|=4)}else(o=(9===r.nodeType?r:r.ownerDocument).createTextNode(o))[li]=t,t.stateNode=o}return Vs(t),null;case 13:if(Si(Xo),o=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(eo&&null!==Qi&&1&t.mode&&!(128&t.flags))lo(),co(),t.flags|=98560,s=!1;else if(s=so(t),null!==o&&null!==o.dehydrated){if(null===e){if(!s)throw Error(n(318));if(!(s=null!==(s=t.memoizedState)?s.dehydrated:null))throw Error(n(317));s[li]=t}else co(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;Vs(t),s=!1}else null!==to&&(nc(to),to=null),s=!0;if(!s)return 65536&t.flags?t:null}return 128&t.flags?(t.lanes=r,t):((o=null!==o)!==(null!==e&&null!==e.memoizedState)&&o&&(t.child.flags|=8192,1&t.mode&&(null===e||1&Xo.current?0===ql&&(ql=3):dc())),null!==t.updateQueue&&(t.flags|=4),Vs(t),null);case 4:return Yo(),Ts(e,t),null===e&&Fr(t.stateNode.containerInfo),Vs(t),null;case 10:return ko(t.type._context),Vs(t),null;case 19:if(Si(Xo),null===(s=t.memoizedState))return Vs(t),null;if(o=!!(128&t.flags),null===(l=s.rendering))if(o)$s(s,!1);else{if(0!==ql||null!==e&&128&e.flags)for(e=t.child;null!==e;){if(null!==(l=Jo(e))){for(t.flags|=128,$s(s,!1),null!==(o=l.updateQueue)&&(t.updateQueue=o,t.flags|=4),t.subtreeFlags=0,o=r,r=t.child;null!==r;)e=o,(s=r).flags&=14680066,null===(l=s.alternate)?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=l.childLanes,s.lanes=l.lanes,s.child=l.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=l.memoizedProps,s.memoizedState=l.memoizedState,s.updateQueue=l.updateQueue,s.type=l.type,e=l.dependencies,s.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return Mi(Xo,1&Xo.current|2),t.child}e=e.sibling}null!==s.tail&&Ye()>Fl&&(t.flags|=128,o=!0,$s(s,!1),t.lanes=4194304)}else{if(!o)if(null!==(e=Jo(l))){if(t.flags|=128,o=!0,null!==(r=e.updateQueue)&&(t.updateQueue=r,t.flags|=4),$s(s,!0),null===s.tail&&"hidden"===s.tailMode&&!l.alternate&&!eo)return Vs(t),null}else 2*Ye()-s.renderingStartTime>Fl&&1073741824!==r&&(t.flags|=128,o=!0,$s(s,!1),t.lanes=4194304);s.isBackwards?(l.sibling=t.child,t.child=l):(null!==(r=s.last)?r.sibling=l:t.child=l,s.last=l)}return null!==s.tail?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=Ye(),t.sibling=null,r=Xo.current,Mi(Xo,o?1&r|2:1&r),t):(Vs(t),null);case 22:case 23:return sc(),o=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==o&&(t.flags|=8192),o&&1&t.mode?!!(1073741824&Tl)&&(Vs(t),6&t.subtreeFlags&&(t.flags|=8192)):Vs(t),null;case 24:case 25:return null}throw Error(n(156,t.tag))}function Hs(e,t){switch(Ji(t),t.tag){case 1:return Ti(t.type)&&Di(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return Yo(),Si(Ei),Si(ki),Qo(),65536&(e=t.flags)&&!(128&e)?(t.flags=-65537&e|128,t):null;case 5:return Ko(t),null;case 13:if(Si(Xo),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(n(340));co()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return Si(Xo),null;case 4:return Yo(),null;case 10:return ko(t.type._context),null;case 22:case 23:return sc(),null;default:return null}}Ns=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Ts=function(){},Ds=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,Bo(Vo.current);var a,s=null;switch(n){case"input":o=W(e,o),r=W(e,r),s=[];break;case"select":o=_({},o,{value:void 0}),r=_({},r,{value:void 0}),s=[];break;case"textarea":o=ee(e,o),r=ee(e,r),s=[];break;default:"function"!=typeof o.onClick&&"function"==typeof r.onClick&&(e.onclick=Kr)}for(u in pe(n,r),n=null,o)if(!r.hasOwnProperty(u)&&o.hasOwnProperty(u)&&null!=o[u])if("style"===u){var l=o[u];for(a in l)l.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else"dangerouslySetInnerHTML"!==u&&"children"!==u&&"suppressContentEditableWarning"!==u&&"suppressHydrationWarning"!==u&&"autoFocus"!==u&&(i.hasOwnProperty(u)?s||(s=[]):(s=s||[]).push(u,null));for(u in r){var c=r[u];if(l=null!=o?o[u]:void 0,r.hasOwnProperty(u)&&c!==l&&(null!=c||null!=l))if("style"===u)if(l){for(a in l)!l.hasOwnProperty(a)||c&&c.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in c)c.hasOwnProperty(a)&&l[a]!==c[a]&&(n||(n={}),n[a]=c[a])}else n||(s||(s=[]),s.push(u,n)),n=c;else"dangerouslySetInnerHTML"===u?(c=c?c.__html:void 0,l=l?l.__html:void 0,null!=c&&l!==c&&(s=s||[]).push(u,c)):"children"===u?"string"!=typeof c&&"number"!=typeof c||(s=s||[]).push(u,""+c):"suppressContentEditableWarning"!==u&&"suppressHydrationWarning"!==u&&(i.hasOwnProperty(u)?(null!=c&&"onScroll"===u&&Lr("scroll",e),s||l===c||(s=[])):(s=s||[]).push(u,c))}n&&(s=s||[]).push("style",n);var u=s;(t.updateQueue=u)&&(t.flags|=4)}},qs=function(e,t,n,r){n!==r&&(t.flags|=4)};var Bs=!1,Ws=!1,Ys="function"==typeof WeakSet?WeakSet:Set,Gs=null;function Ks(e,t){var n=e.ref;if(null!==n)if("function"==typeof n)try{n(null)}catch(n){xc(e,t,n)}else n.current=null}function Xs(e,t,n){try{n()}catch(n){xc(e,t,n)}}var Js=!1;function Zs(e,t,n){var r=t.updateQueue;if(null!==(r=null!==r?r.lastEffect:null)){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,void 0!==o&&Xs(t,n,o)}i=i.next}while(i!==r)}}function Qs(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function el(e){var t=e.ref;if(null!==t){var n=e.stateNode;e.tag,e=n,"function"==typeof t?t(e):t.current=e}}function tl(e){var t=e.alternate;null!==t&&(e.alternate=null,tl(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&(delete t[li],delete t[ci],delete t[di],delete t[fi],delete t[hi])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function nl(e){return 5===e.tag||3===e.tag||4===e.tag}function rl(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||nl(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function il(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?8===n.nodeType?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(8===n.nodeType?(t=n.parentNode).insertBefore(e,n):(t=n).appendChild(e),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=Kr));else if(4!==r&&null!==(e=e.child))for(il(e,t,n),e=e.sibling;null!==e;)il(e,t,n),e=e.sibling}function ol(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&null!==(e=e.child))for(ol(e,t,n),e=e.sibling;null!==e;)ol(e,t,n),e=e.sibling}var al=null,sl=!1;function ll(e,t,n){for(n=n.child;null!==n;)cl(e,t,n),n=n.sibling}function cl(e,t,n){if(tt&&"function"==typeof tt.onCommitFiberUnmount)try{tt.onCommitFiberUnmount(et,n)}catch(e){}switch(n.tag){case 5:Ws||Ks(n,t);case 6:var r=al,i=sl;al=null,ll(e,t,n),sl=i,null!==(al=r)&&(sl?(e=al,n=n.stateNode,8===e.nodeType?e.parentNode.removeChild(n):e.removeChild(n)):al.removeChild(n.stateNode));break;case 18:null!==al&&(sl?(e=al,n=n.stateNode,8===e.nodeType?ii(e.parentNode,n):1===e.nodeType&&ii(e,n),Ft(e)):ii(al,n.stateNode));break;case 4:r=al,i=sl,al=n.stateNode.containerInfo,sl=!0,ll(e,t,n),al=r,sl=i;break;case 0:case 11:case 14:case 15:if(!Ws&&(null!==(r=n.updateQueue)&&null!==(r=r.lastEffect))){i=r=r.next;do{var o=i,a=o.destroy;o=o.tag,void 0!==a&&(2&o||4&o)&&Xs(n,t,a),i=i.next}while(i!==r)}ll(e,t,n);break;case 1:if(!Ws&&(Ks(n,t),"function"==typeof(r=n.stateNode).componentWillUnmount))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(e){xc(n,t,e)}ll(e,t,n);break;case 21:ll(e,t,n);break;case 22:1&n.mode?(Ws=(r=Ws)||null!==n.memoizedState,ll(e,t,n),Ws=r):ll(e,t,n);break;default:ll(e,t,n)}}function ul(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new Ys),t.forEach(function(t){var r=kc.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}function dl(e,t){var r=t.deletions;if(null!==r)for(var i=0;i<r.length;i++){var o=r[i];try{var a=e,s=t,l=s;e:for(;null!==l;){switch(l.tag){case 5:al=l.stateNode,sl=!1;break e;case 3:case 4:al=l.stateNode.containerInfo,sl=!0;break e}l=l.return}if(null===al)throw Error(n(160));cl(a,s,o),al=null,sl=!1;var c=o.alternate;null!==c&&(c.return=null),o.return=null}catch(e){xc(o,t,e)}}if(12854&t.subtreeFlags)for(t=t.child;null!==t;)fl(t,e),t=t.sibling}function fl(e,t){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(dl(t,e),hl(e),4&i){try{Zs(3,e,e.return),Qs(3,e)}catch(t){xc(e,e.return,t)}try{Zs(5,e,e.return)}catch(t){xc(e,e.return,t)}}break;case 1:dl(t,e),hl(e),512&i&&null!==r&&Ks(r,r.return);break;case 5:if(dl(t,e),hl(e),512&i&&null!==r&&Ks(r,r.return),32&e.flags){var o=e.stateNode;try{le(o,"")}catch(t){xc(e,e.return,t)}}if(4&i&&null!=(o=e.stateNode)){var a=e.memoizedProps,s=null!==r?r.memoizedProps:a,l=e.type,c=e.updateQueue;if(e.updateQueue=null,null!==c)try{"input"===l&&"radio"===a.type&&null!=a.name&&G(o,a),me(l,s);var u=me(l,a);for(s=0;s<c.length;s+=2){var d=c[s],f=c[s+1];"style"===d?fe(o,f):"dangerouslySetInnerHTML"===d?se(o,f):"children"===d?le(o,f):g(o,d,f,u)}switch(l){case"input":K(o,a);break;case"textarea":ne(o,a);break;case"select":var h=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!a.multiple;var p=a.value;null!=p?Q(o,!!a.multiple,p,!1):h!==!!a.multiple&&(null!=a.defaultValue?Q(o,!!a.multiple,a.defaultValue,!0):Q(o,!!a.multiple,a.multiple?[]:"",!1))}o[ci]=a}catch(t){xc(e,e.return,t)}}break;case 6:if(dl(t,e),hl(e),4&i){if(null===e.stateNode)throw Error(n(162));o=e.stateNode,a=e.memoizedProps;try{o.nodeValue=a}catch(t){xc(e,e.return,t)}}break;case 3:if(dl(t,e),hl(e),4&i&&null!==r&&r.memoizedState.isDehydrated)try{Ft(t.containerInfo)}catch(t){xc(e,e.return,t)}break;case 4:default:dl(t,e),hl(e);break;case 13:dl(t,e),hl(e),8192&(o=e.child).flags&&(a=null!==o.memoizedState,o.stateNode.isHidden=a,!a||null!==o.alternate&&null!==o.alternate.memoizedState||(Rl=Ye())),4&i&&ul(e);break;case 22:if(d=null!==r&&null!==r.memoizedState,1&e.mode?(Ws=(u=Ws)||d,dl(t,e),Ws=u):dl(t,e),hl(e),8192&i){if(u=null!==e.memoizedState,(e.stateNode.isHidden=u)&&!d&&1&e.mode)for(Gs=e,d=e.child;null!==d;){for(f=Gs=d;null!==Gs;){switch(p=(h=Gs).child,h.tag){case 0:case 11:case 14:case 15:Zs(4,h,h.return);break;case 1:Ks(h,h.return);var m=h.stateNode;if("function"==typeof m.componentWillUnmount){i=h,r=h.return;try{t=i,m.props=t.memoizedProps,m.state=t.memoizedState,m.componentWillUnmount()}catch(e){xc(i,r,e)}}break;case 5:Ks(h,h.return);break;case 22:if(null!==h.memoizedState){yl(f);continue}}null!==p?(p.return=h,Gs=p):yl(f)}d=d.sibling}e:for(d=null,f=e;;){if(5===f.tag){if(null===d){d=f;try{o=f.stateNode,u?"function"==typeof(a=o.style).setProperty?a.setProperty("display","none","important"):a.display="none":(l=f.stateNode,s=null!=(c=f.memoizedProps.style)&&c.hasOwnProperty("display")?c.display:null,l.style.display=de("display",s))}catch(t){xc(e,e.return,t)}}}else if(6===f.tag){if(null===d)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(t){xc(e,e.return,t)}}else if((22!==f.tag&&23!==f.tag||null===f.memoizedState||f===e)&&null!==f.child){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;null===f.sibling;){if(null===f.return||f.return===e)break e;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:dl(t,e),hl(e),4&i&&ul(e);case 21:}}function hl(e){var t=e.flags;if(2&t){try{e:{for(var r=e.return;null!==r;){if(nl(r)){var i=r;break e}r=r.return}throw Error(n(160))}switch(i.tag){case 5:var o=i.stateNode;32&i.flags&&(le(o,""),i.flags&=-33),ol(e,rl(e),o);break;case 3:case 4:var a=i.stateNode.containerInfo;il(e,rl(e),a);break;default:throw Error(n(161))}}catch(t){xc(e,e.return,t)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function pl(e,t,n){Gs=e,ml(e)}function ml(e,t,n){for(var r=!!(1&e.mode);null!==Gs;){var i=Gs,o=i.child;if(22===i.tag&&r){var a=null!==i.memoizedState||Bs;if(!a){var s=i.alternate,l=null!==s&&null!==s.memoizedState||Ws;s=Bs;var c=Ws;if(Bs=a,(Ws=l)&&!c)for(Gs=i;null!==Gs;)l=(a=Gs).child,22===a.tag&&null!==a.memoizedState?vl(i):null!==l?(l.return=a,Gs=l):vl(i);for(;null!==o;)Gs=o,ml(o),o=o.sibling;Gs=i,Bs=s,Ws=c}gl(e)}else 8772&i.subtreeFlags&&null!==o?(o.return=i,Gs=o):gl(e)}}function gl(e){for(;null!==Gs;){var t=Gs;if(8772&t.flags){var r=t.alternate;try{if(8772&t.flags)switch(t.tag){case 0:case 11:case 15:Ws||Qs(5,t);break;case 1:var i=t.stateNode;if(4&t.flags&&!Ws)if(null===r)i.componentDidMount();else{var o=t.elementType===t.type?r.memoizedProps:Za(t.type,r.memoizedProps);i.componentDidUpdate(o,r.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;null!==a&&jo(t,a,i);break;case 3:var s=t.updateQueue;if(null!==s){if(r=null,null!==t.child)switch(t.child.tag){case 5:case 1:r=t.child.stateNode}jo(t,s,r)}break;case 5:var l=t.stateNode;if(null===r&&4&t.flags){r=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&r.focus();break;case"img":c.src&&(r.src=c.src)}}break;case 6:case 4:case 12:case 19:case 17:case 21:case 22:case 23:case 25:break;case 13:if(null===t.memoizedState){var u=t.alternate;if(null!==u){var d=u.memoizedState;if(null!==d){var f=d.dehydrated;null!==f&&Ft(f)}}}break;default:throw Error(n(163))}Ws||512&t.flags&&el(t)}catch(e){xc(t,t.return,e)}}if(t===e){Gs=null;break}if(null!==(r=t.sibling)){r.return=t.return,Gs=r;break}Gs=t.return}}function yl(e){for(;null!==Gs;){var t=Gs;if(t===e){Gs=null;break}var n=t.sibling;if(null!==n){n.return=t.return,Gs=n;break}Gs=t.return}}function vl(e){for(;null!==Gs;){var t=Gs;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Qs(4,t)}catch(e){xc(t,n,e)}break;case 1:var r=t.stateNode;if("function"==typeof r.componentDidMount){var i=t.return;try{r.componentDidMount()}catch(e){xc(t,i,e)}}var o=t.return;try{el(t)}catch(e){xc(t,o,e)}break;case 5:var a=t.return;try{el(t)}catch(e){xc(t,a,e)}}}catch(e){xc(t,t.return,e)}if(t===e){Gs=null;break}var s=t.sibling;if(null!==s){s.return=t.return,Gs=s;break}Gs=t.return}}var bl,xl=Math.ceil,Sl=y.ReactCurrentDispatcher,Ml=y.ReactCurrentOwner,wl=y.ReactCurrentBatchConfig,kl=0,El=null,Cl=null,Nl=0,Tl=0,Dl=xi(0),ql=0,Ol=null,Il=0,Al=0,_l=0,Ll=null,Pl=null,Rl=0,Fl=1/0,zl=null,jl=!1,$l=null,Vl=null,Ul=!1,Hl=null,Bl=0,Wl=0,Yl=null,Gl=-1,Kl=0;function Xl(){return 6&kl?Ye():-1!==Gl?Gl:Gl=Ye()}function Jl(e){return 1&e.mode?2&kl&&0!==Nl?Nl&-Nl:null!==fo.transition?(0===Kl&&(Kl=dt()),Kl):0!==(e=mt)?e:e=void 0===(e=window.event)?16:Wt(e.type):1}function Zl(e,t,r,i){if(50<Wl)throw Wl=0,Yl=null,Error(n(185));ht(e,r,i),2&kl&&e===El||(e===El&&(!(2&kl)&&(Al|=r),4===ql&&rc(e,Nl)),Ql(e,i),1===r&&0===kl&&!(1&t.mode)&&(Fl=Ye()+500,Li&&Fi()))}function Ql(e,t){var n=e.callbackNode;!function(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,o=e.pendingLanes;0<o;){var a=31-nt(o),s=1<<a,l=i[a];-1===l?0!==(s&n)&&0===(s&r)||(i[a]=ct(s,t)):l<=t&&(e.expiredLanes|=s),o&=~s}}(e,t);var r=lt(e,e===El?Nl:0);if(0===r)null!==n&&He(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(null!=n&&He(n),1===t)0===e.tag?function(e){Li=!0,Ri(e)}(ic.bind(null,e)):Ri(ic.bind(null,e)),ni(function(){!(6&kl)&&Fi()}),n=null;else{switch(gt(r)){case 1:n=Ke;break;case 4:n=Xe;break;case 16:default:n=Je;break;case 536870912:n=Qe}n=Ec(n,ec.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function ec(e,t){if(Gl=-1,Kl=0,6&kl)throw Error(n(327));var r=e.callbackNode;if(vc()&&e.callbackNode!==r)return null;var i=lt(e,e===El?Nl:0);if(0===i)return null;if(30&i||0!==(i&e.expiredLanes)||t)t=fc(e,i);else{t=i;var o=kl;kl|=2;var a=uc();for(El===e&&Nl===t||(zl=null,Fl=Ye()+500,lc(e,t));;)try{pc();break}catch(t){cc(e,t)}wo(),Sl.current=a,kl=o,null!==Cl?t=0:(El=null,Nl=0,t=ql)}if(0!==t){if(2===t&&(0!==(o=ut(e))&&(i=o,t=tc(e,o))),1===t)throw r=Ol,lc(e,0),rc(e,i),Ql(e,Ye()),r;if(6===t)rc(e,i);else{if(o=e.current.alternate,!(30&i||function(e){for(var t=e;;){if(16384&t.flags){var n=t.updateQueue;if(null!==n&&null!==(n=n.stores))for(var r=0;r<n.length;r++){var i=n[r],o=i.getSnapshot;i=i.value;try{if(!rr(o(),i))return!1}catch(e){return!1}}}if(n=t.child,16384&t.subtreeFlags&&null!==n)n.return=t,t=n;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}(o)||(t=fc(e,i),2===t&&(a=ut(e),0!==a&&(i=a,t=tc(e,a))),1!==t)))throw r=Ol,lc(e,0),rc(e,i),Ql(e,Ye()),r;switch(e.finishedWork=o,e.finishedLanes=i,t){case 0:case 1:throw Error(n(345));case 2:case 5:yc(e,Pl,zl);break;case 3:if(rc(e,i),(130023424&i)===i&&10<(t=Rl+500-Ye())){if(0!==lt(e,0))break;if(((o=e.suspendedLanes)&i)!==i){Xl(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=Qr(yc.bind(null,e,Pl,zl),t);break}yc(e,Pl,zl);break;case 4:if(rc(e,i),(4194240&i)===i)break;for(t=e.eventTimes,o=-1;0<i;){var s=31-nt(i);a=1<<s,(s=t[s])>o&&(o=s),i&=~a}if(i=o,10<(i=(120>(i=Ye()-i)?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*xl(i/1960))-i)){e.timeoutHandle=Qr(yc.bind(null,e,Pl,zl),i);break}yc(e,Pl,zl);break;default:throw Error(n(329))}}}return Ql(e,Ye()),e.callbackNode===r?ec.bind(null,e):null}function tc(e,t){var n=Ll;return e.current.memoizedState.isDehydrated&&(lc(e,t).flags|=256),2!==(e=fc(e,t))&&(t=Pl,Pl=n,null!==t&&nc(t)),e}function nc(e){null===Pl?Pl=e:Pl.push.apply(Pl,e)}function rc(e,t){for(t&=~_l,t&=~Al,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-nt(t),r=1<<n;e[n]=-1,t&=~r}}function ic(e){if(6&kl)throw Error(n(327));vc();var t=lt(e,0);if(!(1&t))return Ql(e,Ye()),null;var r=fc(e,t);if(0!==e.tag&&2===r){var i=ut(e);0!==i&&(t=i,r=tc(e,i))}if(1===r)throw r=Ol,lc(e,0),rc(e,t),Ql(e,Ye()),r;if(6===r)throw Error(n(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,yc(e,Pl,zl),Ql(e,Ye()),null}function oc(e,t){var n=kl;kl|=1;try{return e(t)}finally{0===(kl=n)&&(Fl=Ye()+500,Li&&Fi())}}function ac(e){null!==Hl&&0===Hl.tag&&!(6&kl)&&vc();var t=kl;kl|=1;var n=wl.transition,r=mt;try{if(wl.transition=null,mt=1,e)return e()}finally{mt=r,wl.transition=n,!(6&(kl=t))&&Fi()}}function sc(){Tl=Dl.current,Si(Dl)}function lc(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,ei(n)),null!==Cl)for(n=Cl.return;null!==n;){var r=n;switch(Ji(r),r.tag){case 1:null!=(r=r.type.childContextTypes)&&Di();break;case 3:Yo(),Si(Ei),Si(ki),Qo();break;case 5:Ko(r);break;case 4:Yo();break;case 13:case 19:Si(Xo);break;case 10:ko(r.type._context);break;case 22:case 23:sc()}n=n.return}if(El=e,Cl=e=Dc(e.current,null),Nl=Tl=t,ql=0,Ol=null,_l=Al=Il=0,Pl=Ll=null,null!==To){for(t=0;t<To.length;t++)if(null!==(r=(n=To[t]).interleaved)){n.interleaved=null;var i=r.next,o=n.pending;if(null!==o){var a=o.next;o.next=i,r.next=a}n.pending=r}To=null}return e}function cc(e,t){for(;;){var r=Cl;try{if(wo(),ea.current=Ga,aa){for(var i=ra.memoizedState;null!==i;){var o=i.queue;null!==o&&(o.pending=null),i=i.next}aa=!1}if(na=0,oa=ia=ra=null,sa=!1,la=0,Ml.current=null,null===r||null===r.return){ql=1,Ol=t,Cl=null;break}e:{var a=e,s=r.return,l=r,c=t;if(t=Nl,l.flags|=32768,null!==c&&"object"==typeof c&&"function"==typeof c.then){var u=c,d=l,f=d.tag;if(!(1&d.mode||0!==f&&11!==f&&15!==f)){var h=d.alternate;h?(d.updateQueue=h.updateQueue,d.memoizedState=h.memoizedState,d.lanes=h.lanes):(d.updateQueue=null,d.memoizedState=null)}var p=fs(s);if(null!==p){p.flags&=-257,hs(p,s,l,0,t),1&p.mode&&ds(a,u,t),c=u;var m=(t=p).updateQueue;if(null===m){var g=new Set;g.add(c),t.updateQueue=g}else m.add(c);break e}if(!(1&t)){ds(a,u,t),dc();break e}c=Error(n(426))}else if(eo&&1&l.mode){var y=fs(s);if(null!==y){!(65536&y.flags)&&(y.flags|=256),hs(y,s,l,0,t),uo(os(c,l));break e}}a=c=os(c,l),4!==ql&&(ql=2),null===Ll?Ll=[a]:Ll.push(a),a=s;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t,Fo(a,cs(0,c,t));break e;case 1:l=c;var v=a.type,b=a.stateNode;if(!(128&a.flags||"function"!=typeof v.getDerivedStateFromError&&(null===b||"function"!=typeof b.componentDidCatch||null!==Vl&&Vl.has(b)))){a.flags|=65536,t&=-t,a.lanes|=t,Fo(a,us(a,l,t));break e}}a=a.return}while(null!==a)}gc(r)}catch(e){t=e,Cl===r&&null!==r&&(Cl=r=r.return);continue}break}}function uc(){var e=Sl.current;return Sl.current=Ga,null===e?Ga:e}function dc(){0!==ql&&3!==ql&&2!==ql||(ql=4),null===El||!(268435455&Il)&&!(268435455&Al)||rc(El,Nl)}function fc(e,t){var r=kl;kl|=2;var i=uc();for(El===e&&Nl===t||(zl=null,lc(e,t));;)try{hc();break}catch(t){cc(e,t)}if(wo(),kl=r,Sl.current=i,null!==Cl)throw Error(n(261));return El=null,Nl=0,ql}function hc(){for(;null!==Cl;)mc(Cl)}function pc(){for(;null!==Cl&&!Be();)mc(Cl)}function mc(e){var t=bl(e.alternate,e,Tl);e.memoizedProps=e.pendingProps,null===t?gc(e):Cl=t,Ml.current=null}function gc(e){var t=e;do{var n=t.alternate;if(e=t.return,32768&t.flags){if(null!==(n=Hs(n,t)))return n.flags&=32767,void(Cl=n);if(null===e)return ql=6,void(Cl=null);e.flags|=32768,e.subtreeFlags=0,e.deletions=null}else if(null!==(n=Us(n,t,Tl)))return void(Cl=n);if(null!==(t=t.sibling))return void(Cl=t);Cl=t=e}while(null!==t);0===ql&&(ql=5)}function yc(e,t,r){var i=mt,o=wl.transition;try{wl.transition=null,mt=1,function(e,t,r,i){do{vc()}while(null!==Hl);if(6&kl)throw Error(n(327));r=e.finishedWork;var o=e.finishedLanes;if(null===r)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(n(177));e.callbackNode=null,e.callbackPriority=0;var a=r.lanes|r.childLanes;if(function(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-nt(n),o=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~o}}(e,a),e===El&&(Cl=El=null,Nl=0),!(2064&r.subtreeFlags)&&!(2064&r.flags)||Ul||(Ul=!0,Ec(Je,function(){return vc(),null})),a=!!(15990&r.flags),!!(15990&r.subtreeFlags)||a){a=wl.transition,wl.transition=null;var s=mt;mt=1;var l=kl;kl|=4,Ml.current=null,function(e,t){if(Xr=jt,cr(e=lr())){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{var i=(r=(r=e.ownerDocument)&&r.defaultView||window).getSelection&&r.getSelection();if(i&&0!==i.rangeCount){r=i.anchorNode;var o=i.anchorOffset,a=i.focusNode;i=i.focusOffset;try{r.nodeType,a.nodeType}catch(e){r=null;break e}var s=0,l=-1,c=-1,u=0,d=0,f=e,h=null;t:for(;;){for(var p;f!==r||0!==o&&3!==f.nodeType||(l=s+o),f!==a||0!==i&&3!==f.nodeType||(c=s+i),3===f.nodeType&&(s+=f.nodeValue.length),null!==(p=f.firstChild);)h=f,f=p;for(;;){if(f===e)break t;if(h===r&&++u===o&&(l=s),h===a&&++d===i&&(c=s),null!==(p=f.nextSibling))break;h=(f=h).parentNode}f=p}r=-1===l||-1===c?null:{start:l,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(Jr={focusedElem:e,selectionRange:r},jt=!1,Gs=t;null!==Gs;)if(e=(t=Gs).child,1028&t.subtreeFlags&&null!==e)e.return=t,Gs=e;else for(;null!==Gs;){t=Gs;try{var m=t.alternate;if(1024&t.flags)switch(t.tag){case 0:case 11:case 15:case 5:case 6:case 4:case 17:break;case 1:if(null!==m){var g=m.memoizedProps,y=m.memoizedState,v=t.stateNode,b=v.getSnapshotBeforeUpdate(t.elementType===t.type?g:Za(t.type,g),y);v.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var x=t.stateNode.containerInfo;1===x.nodeType?x.textContent="":9===x.nodeType&&x.documentElement&&x.removeChild(x.documentElement);break;default:throw Error(n(163))}}catch(e){xc(t,t.return,e)}if(null!==(e=t.sibling)){e.return=t.return,Gs=e;break}Gs=t.return}m=Js,Js=!1}(e,r),fl(r,e),ur(Jr),jt=!!Xr,Jr=Xr=null,e.current=r,pl(r),We(),kl=l,mt=s,wl.transition=a}else e.current=r;if(Ul&&(Ul=!1,Hl=e,Bl=o),a=e.pendingLanes,0===a&&(Vl=null),function(e){if(tt&&"function"==typeof tt.onCommitFiberRoot)try{tt.onCommitFiberRoot(et,e,void 0,!(128&~e.current.flags))}catch(e){}}(r.stateNode),Ql(e,Ye()),null!==t)for(i=e.onRecoverableError,r=0;r<t.length;r++)o=t[r],i(o.value,{componentStack:o.stack,digest:o.digest});if(jl)throw jl=!1,e=$l,$l=null,e;!!(1&Bl)&&0!==e.tag&&vc(),a=e.pendingLanes,1&a?e===Yl?Wl++:(Wl=0,Yl=e):Wl=0,Fi()}(e,t,r,i)}finally{wl.transition=o,mt=i}return null}function vc(){if(null!==Hl){var e=gt(Bl),t=wl.transition,r=mt;try{if(wl.transition=null,mt=16>e?16:e,null===Hl)var i=!1;else{if(e=Hl,Hl=null,Bl=0,6&kl)throw Error(n(331));var o=kl;for(kl|=4,Gs=e.current;null!==Gs;){var a=Gs,s=a.child;if(16&Gs.flags){var l=a.deletions;if(null!==l){for(var c=0;c<l.length;c++){var u=l[c];for(Gs=u;null!==Gs;){var d=Gs;switch(d.tag){case 0:case 11:case 15:Zs(8,d,a)}var f=d.child;if(null!==f)f.return=d,Gs=f;else for(;null!==Gs;){var h=(d=Gs).sibling,p=d.return;if(tl(d),d===u){Gs=null;break}if(null!==h){h.return=p,Gs=h;break}Gs=p}}}var m=a.alternate;if(null!==m){var g=m.child;if(null!==g){m.child=null;do{var y=g.sibling;g.sibling=null,g=y}while(null!==g)}}Gs=a}}if(2064&a.subtreeFlags&&null!==s)s.return=a,Gs=s;else e:for(;null!==Gs;){if(2048&(a=Gs).flags)switch(a.tag){case 0:case 11:case 15:Zs(9,a,a.return)}var v=a.sibling;if(null!==v){v.return=a.return,Gs=v;break e}Gs=a.return}}var b=e.current;for(Gs=b;null!==Gs;){var x=(s=Gs).child;if(2064&s.subtreeFlags&&null!==x)x.return=s,Gs=x;else e:for(s=b;null!==Gs;){if(2048&(l=Gs).flags)try{switch(l.tag){case 0:case 11:case 15:Qs(9,l)}}catch(e){xc(l,l.return,e)}if(l===s){Gs=null;break e}var S=l.sibling;if(null!==S){S.return=l.return,Gs=S;break e}Gs=l.return}}if(kl=o,Fi(),tt&&"function"==typeof tt.onPostCommitFiberRoot)try{tt.onPostCommitFiberRoot(et,e)}catch(e){}i=!0}return i}finally{mt=r,wl.transition=t}}return!1}function bc(e,t,n){e=Po(e,t=cs(0,t=os(n,t),1),1),t=Xl(),null!==e&&(ht(e,1,t),Ql(e,t))}function xc(e,t,n){if(3===e.tag)bc(e,e,n);else for(;null!==t;){if(3===t.tag){bc(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===Vl||!Vl.has(r))){t=Po(t,e=us(t,e=os(n,e),1),1),e=Xl(),null!==t&&(ht(t,1,e),Ql(t,e));break}}t=t.return}}function Sc(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),t=Xl(),e.pingedLanes|=e.suspendedLanes&n,El===e&&(Nl&n)===n&&(4===ql||3===ql&&(130023424&Nl)===Nl&&500>Ye()-Rl?lc(e,0):_l|=n),Ql(e,t)}function Mc(e,t){0===t&&(1&e.mode?(t=at,!(130023424&(at<<=1))&&(at=4194304)):t=1);var n=Xl();null!==(e=Oo(e,t))&&(ht(e,t,n),Ql(e,n))}function wc(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),Mc(e,n)}function kc(e,t){var r=0;switch(e.tag){case 13:var i=e.stateNode,o=e.memoizedState;null!==o&&(r=o.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(n(314))}null!==i&&i.delete(t),Mc(e,r)}function Ec(e,t){return Ue(e,t)}function Cc(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Nc(e,t,n,r){return new Cc(e,t,n,r)}function Tc(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Dc(e,t){var n=e.alternate;return null===n?((n=Nc(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=14680064&e.flags,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function qc(e,t,r,i,o,a){var s=2;if(i=e,"function"==typeof e)Tc(e)&&(s=1);else if("string"==typeof e)s=5;else e:switch(e){case x:return Oc(r.children,o,a,t);case S:s=8,o|=8;break;case M:return(e=Nc(12,r,t,2|o)).elementType=M,e.lanes=a,e;case C:return(e=Nc(13,r,t,o)).elementType=C,e.lanes=a,e;case N:return(e=Nc(19,r,t,o)).elementType=N,e.lanes=a,e;case q:return Ic(r,o,a,t);default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case w:s=10;break e;case k:s=9;break e;case E:s=11;break e;case T:s=14;break e;case D:s=16,i=null;break e}throw Error(n(130,null==e?e:typeof e,""))}return(t=Nc(s,r,t,o)).elementType=e,t.type=i,t.lanes=a,t}function Oc(e,t,n,r){return(e=Nc(7,e,r,t)).lanes=n,e}function Ic(e,t,n,r){return(e=Nc(22,e,r,t)).elementType=q,e.lanes=n,e.stateNode={isHidden:!1},e}function Ac(e,t,n){return(e=Nc(6,e,null,t)).lanes=n,e}function _c(e,t,n){return(t=Nc(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Lc(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ft(0),this.expirationTimes=ft(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ft(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Pc(e,t,n,r,i,o,a,s,l){return e=new Lc(e,t,n,s,l),1===t?(t=1,!0===o&&(t|=8)):t=0,o=Nc(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ao(o),e}function Rc(e){if(!e)return wi;e:{if(Fe(e=e._reactInternals)!==e||1!==e.tag)throw Error(n(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ti(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(null!==t);throw Error(n(171))}if(1===e.tag){var r=e.type;if(Ti(r))return Oi(e,r,t)}return t}function Fc(e,t,n,r,i,o,a,s,l){return(e=Pc(n,r,!0,e,0,o,0,s,l)).context=Rc(null),n=e.current,(o=Lo(r=Xl(),i=Jl(n))).callback=null!=t?t:null,Po(n,o,i),e.current.lanes=i,ht(e,i,r),Ql(e,r),e}function zc(e,t,n,r){var i=t.current,o=Xl(),a=Jl(i);return n=Rc(n),null===t.context?t.context=n:t.pendingContext=n,(t=Lo(o,a)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),null!==(e=Po(i,t,a))&&(Zl(e,i,a,o),Ro(e,i,a)),a}function jc(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function $c(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function Vc(e,t){$c(e,t),(e=e.alternate)&&$c(e,t)}bl=function(e,t,r){if(null!==e)if(e.memoizedProps!==t.pendingProps||Ei.current)ms=!0;else{if(0===(e.lanes&r)&&!(128&t.flags))return ms=!1,function(e,t,n){switch(t.tag){case 3:Es(t),co();break;case 5:Go(t);break;case 1:Ti(t.type)&&Ii(t);break;case 4:Wo(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;Mi(bo,r._currentValue),r._currentValue=i;break;case 13:if(null!==(r=t.memoizedState))return null!==r.dehydrated?(Mi(Xo,1&Xo.current),t.flags|=128,null):0!==(n&t.child.childLanes)?As(e,t,n):(Mi(Xo,1&Xo.current),null!==(e=js(e,t,n))?e.sibling:null);Mi(Xo,1&Xo.current);break;case 19:if(r=0!==(n&t.childLanes),128&e.flags){if(r)return Fs(e,t,n);t.flags|=128}if(null!==(i=t.memoizedState)&&(i.rendering=null,i.tail=null,i.lastEffect=null),Mi(Xo,Xo.current),r)break;return null;case 22:case 23:return t.lanes=0,xs(e,t,n)}return js(e,t,n)}(e,t,r);ms=!!(131072&e.flags)}else ms=!1,eo&&1048576&t.flags&&Ki(t,Vi,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;zs(e,t),e=t.pendingProps;var o=Ni(t,ki.current);Co(t,r),o=fa(null,t,i,e,o,r);var a=ha();return t.flags|=1,"object"==typeof o&&null!==o&&"function"==typeof o.render&&void 0===o.$$typeof?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ti(i)?(a=!0,Ii(t)):a=!1,t.memoizedState=null!==o.state&&void 0!==o.state?o.state:null,Ao(t),o.updater=es,t.stateNode=o,o._reactInternals=t,is(t,i,e,r),t=ks(null,t,i,!0,a,r)):(t.tag=0,eo&&a&&Xi(t),gs(null,t,o,r),t=t.child),t;case 16:i=t.elementType;e:{switch(zs(e,t),e=t.pendingProps,i=(o=i._init)(i._payload),t.type=i,o=t.tag=function(e){if("function"==typeof e)return Tc(e)?1:0;if(null!=e){if((e=e.$$typeof)===E)return 11;if(e===T)return 14}return 2}(i),e=Za(i,e),o){case 0:t=Ms(null,t,i,e,r);break e;case 1:t=ws(null,t,i,e,r);break e;case 11:t=ys(null,t,i,e,r);break e;case 14:t=vs(null,t,i,Za(i.type,e),r);break e}throw Error(n(306,i,""))}return t;case 0:return i=t.type,o=t.pendingProps,Ms(e,t,i,o=t.elementType===i?o:Za(i,o),r);case 1:return i=t.type,o=t.pendingProps,ws(e,t,i,o=t.elementType===i?o:Za(i,o),r);case 3:e:{if(Es(t),null===e)throw Error(n(387));i=t.pendingProps,o=(a=t.memoizedState).element,_o(e,t),zo(t,i,null,r);var s=t.memoizedState;if(i=s.element,a.isDehydrated){if(a={element:i,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=a,t.memoizedState=a,256&t.flags){t=Cs(e,t,i,r,o=os(Error(n(423)),t));break e}if(i!==o){t=Cs(e,t,i,r,o=os(Error(n(424)),t));break e}for(Qi=oi(t.stateNode.containerInfo.firstChild),Zi=t,eo=!0,to=null,r=vo(t,null,i,r),t.child=r;r;)r.flags=-3&r.flags|4096,r=r.sibling}else{if(co(),i===o){t=js(e,t,r);break e}gs(e,t,i,r)}t=t.child}return t;case 5:return Go(t),null===e&&oo(t),i=t.type,o=t.pendingProps,a=null!==e?e.memoizedProps:null,s=o.children,Zr(i,o)?s=null:null!==a&&Zr(i,a)&&(t.flags|=32),Ss(e,t),gs(e,t,s,r),t.child;case 6:return null===e&&oo(t),null;case 13:return As(e,t,r);case 4:return Wo(t,t.stateNode.containerInfo),i=t.pendingProps,null===e?t.child=yo(t,null,i,r):gs(e,t,i,r),t.child;case 11:return i=t.type,o=t.pendingProps,ys(e,t,i,o=t.elementType===i?o:Za(i,o),r);case 7:return gs(e,t,t.pendingProps,r),t.child;case 8:case 12:return gs(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(i=t.type._context,o=t.pendingProps,a=t.memoizedProps,s=o.value,Mi(bo,i._currentValue),i._currentValue=s,null!==a)if(rr(a.value,s)){if(a.children===o.children&&!Ei.current){t=js(e,t,r);break e}}else for(null!==(a=t.child)&&(a.return=t);null!==a;){var l=a.dependencies;if(null!==l){s=a.child;for(var c=l.firstContext;null!==c;){if(c.context===i){if(1===a.tag){(c=Lo(-1,r&-r)).tag=2;var u=a.updateQueue;if(null!==u){var d=(u=u.shared).pending;null===d?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}a.lanes|=r,null!==(c=a.alternate)&&(c.lanes|=r),Eo(a.return,r,t),l.lanes|=r;break}c=c.next}}else if(10===a.tag)s=a.type===t.type?null:a.child;else if(18===a.tag){if(null===(s=a.return))throw Error(n(341));s.lanes|=r,null!==(l=s.alternate)&&(l.lanes|=r),Eo(s,r,t),s=a.sibling}else s=a.child;if(null!==s)s.return=a;else for(s=a;null!==s;){if(s===t){s=null;break}if(null!==(a=s.sibling)){a.return=s.return,s=a;break}s=s.return}a=s}gs(e,t,o.children,r),t=t.child}return t;case 9:return o=t.type,i=t.pendingProps.children,Co(t,r),i=i(o=No(o)),t.flags|=1,gs(e,t,i,r),t.child;case 14:return o=Za(i=t.type,t.pendingProps),vs(e,t,i,o=Za(i.type,o),r);case 15:return bs(e,t,t.type,t.pendingProps,r);case 17:return i=t.type,o=t.pendingProps,o=t.elementType===i?o:Za(i,o),zs(e,t),t.tag=1,Ti(i)?(e=!0,Ii(t)):e=!1,Co(t,r),ns(t,i,o),is(t,i,o,r),ks(null,t,i,!0,e,r);case 19:return Fs(e,t,r);case 22:return xs(e,t,r)}throw Error(n(156,t.tag))};var Uc="function"==typeof reportError?reportError:function(e){console.error(e)};function Hc(e){this._internalRoot=e}function Bc(e){this._internalRoot=e}function Wc(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}function Yc(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function Gc(){}function Kc(e,t,n,r,i){var o=n._reactRootContainer;if(o){var a=o;if("function"==typeof i){var s=i;i=function(){var e=jc(a);s.call(e)}}zc(t,a,e,i)}else a=function(e,t,n,r,i){if(i){if("function"==typeof r){var o=r;r=function(){var e=jc(a);o.call(e)}}var a=Fc(t,r,e,0,null,!1,0,"",Gc);return e._reactRootContainer=a,e[ui]=a.current,Fr(8===e.nodeType?e.parentNode:e),ac(),a}for(;i=e.lastChild;)e.removeChild(i);if("function"==typeof r){var s=r;r=function(){var e=jc(l);s.call(e)}}var l=Pc(e,0,!1,null,0,!1,0,"",Gc);return e._reactRootContainer=l,e[ui]=l.current,Fr(8===e.nodeType?e.parentNode:e),ac(function(){zc(t,l,n,r)}),l}(n,t,e,i,r);return jc(a)}Bc.prototype.render=Hc.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(n(409));zc(e,t,null,null)},Bc.prototype.unmount=Hc.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;ac(function(){zc(null,e,null,null)}),t[ui]=null}},Bc.prototype.unstable_scheduleHydration=function(e){if(e){var t=xt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Dt.length&&0!==t&&t<Dt[n].priority;n++);Dt.splice(n,0,e),0===n&&At(e)}},yt=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=st(t.pendingLanes);0!==n&&(pt(t,1|n),Ql(t,Ye()),!(6&kl)&&(Fl=Ye()+500,Fi()))}break;case 13:ac(function(){var t=Oo(e,1);if(null!==t){var n=Xl();Zl(t,e,1,n)}}),Vc(e,1)}},vt=function(e){if(13===e.tag){var t=Oo(e,134217728);if(null!==t)Zl(t,e,134217728,Xl());Vc(e,134217728)}},bt=function(e){if(13===e.tag){var t=Jl(e),n=Oo(e,t);if(null!==n)Zl(n,e,t,Xl());Vc(e,t)}},xt=function(){return mt},St=function(e,t){var n=mt;try{return mt=e,t()}finally{mt=n}},ve=function(e,t,r){switch(t){case"input":if(K(e,r),t=r.name,"radio"===r.type&&null!=t){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var i=r[t];if(i!==e&&i.form===e.form){var o=yi(i);if(!o)throw Error(n(90));H(i),K(i,o)}}}break;case"textarea":ne(e,r);break;case"select":null!=(t=r.value)&&Q(e,!!r.multiple,t,!1)}},ke=oc,Ee=ac;var Xc={usingClientEntryPoint:!1,Events:[mi,gi,yi,Me,we,oc]},Jc={findFiberByHostInstance:pi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Zc={bundleType:Jc.bundleType,version:Jc.version,rendererPackageName:Jc.rendererPackageName,rendererConfig:Jc.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:y.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=$e(e))?null:e.stateNode},findFiberByHostInstance:Jc.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var Qc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Qc.isDisabled&&Qc.supportsFiber)try{et=Qc.inject(Zc),tt=Qc}catch(e){}}return $C.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Xc,$C.createPortal=function(e,t){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!Wc(t))throw Error(n(200));return function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:b,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,t,null,r)},$C.createRoot=function(e,t){if(!Wc(e))throw Error(n(299));var r=!1,i="",o=Uc;return null!=t&&(!0===t.unstable_strictMode&&(r=!0),void 0!==t.identifierPrefix&&(i=t.identifierPrefix),void 0!==t.onRecoverableError&&(o=t.onRecoverableError)),t=Pc(e,1,!1,null,0,r,0,i,o),e[ui]=t.current,Fr(8===e.nodeType?e.parentNode:e),new Hc(t)},$C.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(n(188));throw e=Object.keys(e).join(","),Error(n(268,e))}return e=null===(e=$e(t))?null:e.stateNode},$C.flushSync=function(e){return ac(e)},$C.hydrate=function(e,t,r){if(!Yc(t))throw Error(n(200));return Kc(null,e,t,!0,r)},$C.hydrateRoot=function(e,t,r){if(!Wc(e))throw Error(n(405));var i=null!=r&&r.hydratedSources||null,o=!1,a="",s=Uc;if(null!=r&&(!0===r.unstable_strictMode&&(o=!0),void 0!==r.identifierPrefix&&(a=r.identifierPrefix),void 0!==r.onRecoverableError&&(s=r.onRecoverableError)),t=Fc(t,null,e,1,null!=r?r:null,o,0,a,s),e[ui]=t.current,Fr(e),i)for(e=0;e<i.length;e++)o=(o=(r=i[e])._getVersion)(r._source),null==t.mutableSourceEagerHydrationData?t.mutableSourceEagerHydrationData=[r,o]:t.mutableSourceEagerHydrationData.push(r,o);return new Bc(t)},$C.render=function(e,t,r){if(!Yc(t))throw Error(n(200));return Kc(null,e,t,!1,r)},$C.unmountComponentAtNode=function(e){if(!Yc(e))throw Error(n(40));return!!e._reactRootContainer&&(ac(function(){Kc(null,null,e,!1,function(){e._reactRootContainer=null,e[ui]=null})}),!0)},$C.unstable_batchedUpdates=oc,$C.unstable_renderSubtreeIntoContainer=function(e,t,r,i){if(!Yc(r))throw Error(n(200));if(null==e||void 0===e._reactInternals)throw Error(n(38));return Kc(e,t,r,!1,i)},$C.version="18.3.1-next-f1338f8080-20240426",$C}var WC=(zC||(zC=1,function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),jC.exports=BC()),jC.exports),YC=o(WC),GC=!1,KC=px.createContext(null),XC="unmounted",JC="exited",ZC="entering",QC="entered",eN="exiting",tN=function(e){function t(t,n){var r;r=e.call(this,t,n)||this;var i,o=n&&!n.isMounting?t.enter:t.appear;return r.appearStatus=null,t.in?o?(i=JC,r.appearStatus=ZC):i=QC:i=t.unmountOnExit||t.mountOnEnter?XC:JC,r.state={status:i},r.nextCallback=null,r}LC(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===XC?{status:JC}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==ZC&&n!==QC&&(t=ZC):n!==ZC&&n!==QC||(t=eN)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,n,r=this.props.timeout;return e=t=n=r,null!=r&&"number"!=typeof r&&(e=r.exit,t=r.enter,n=void 0!==r.appear?r.appear:t),{exit:e,enter:t,appear:n}},n.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t)if(this.cancelNextCallback(),t===ZC){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:YC.findDOMNode(this);n&&function(e){e.scrollTop}(n)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===JC&&this.setState({status:XC})},n.performEnter=function(e){var t=this,n=this.props.enter,r=this.context?this.context.isMounting:e,i=this.props.nodeRef?[r]:[YC.findDOMNode(this),r],o=i[0],a=i[1],s=this.getTimeouts(),l=r?s.appear:s.enter;!e&&!n||GC?this.safeSetState({status:QC},function(){t.props.onEntered(o)}):(this.props.onEnter(o,a),this.safeSetState({status:ZC},function(){t.props.onEntering(o,a),t.onTransitionEnd(l,function(){t.safeSetState({status:QC},function(){t.props.onEntered(o,a)})})}))},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),r=this.props.nodeRef?void 0:YC.findDOMNode(this);t&&!GC?(this.props.onExit(r),this.safeSetState({status:eN},function(){e.props.onExiting(r),e.onTransitionEnd(n.exit,function(){e.safeSetState({status:JC},function(){e.props.onExited(r)})})})):this.safeSetState({status:JC},function(){e.props.onExited(r)})},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:YC.findDOMNode(this),r=null==e&&!this.props.addEndListener;if(n&&!r){if(this.props.addEndListener){var i=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],o=i[0],a=i[1];this.props.addEndListener(o,a)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},n.render=function(){var e=this.state.status;if(e===XC)return null;var t=this.props,n=t.children;t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef;var r=eS(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return px.createElement(KC.Provider,{value:null},"function"==typeof n?n(e,r):px.cloneElement(px.Children.only(n),r))},t}(px.Component);function nN(){}function rN(e,t){var n=Object.create(null);return e&&hx.Children.map(e,function(e){return e}).forEach(function(e){n[e.key]=function(e){return t&&hx.isValidElement(e)?t(e):e}(e)}),n}function iN(e,t,n){return null!=n[t]?n[t]:e.props[t]}function oN(e,t,n){var r=rN(e.children),i=function(e,t){function n(n){return n in t?t[n]:e[n]}e=e||{},t=t||{};var r,i=Object.create(null),o=[];for(var a in e)a in t?o.length&&(i[a]=o,o=[]):o.push(a);var s={};for(var l in t){if(i[l])for(r=0;r<i[l].length;r++){var c=i[l][r];s[i[l][r]]=n(c)}s[l]=n(l)}for(r=0;r<o.length;r++)s[o[r]]=n(o[r]);return s}(t,r);return Object.keys(i).forEach(function(o){var a=i[o];if(hx.isValidElement(a)){var s=o in t,l=o in r,c=t[o],u=hx.isValidElement(c)&&!c.props.in;!l||s&&!u?l||!s||u?l&&s&&hx.isValidElement(c)&&(i[o]=hx.cloneElement(a,{onExited:n.bind(null,a),in:c.props.in,exit:iN(a,"exit",e),enter:iN(a,"enter",e)})):i[o]=hx.cloneElement(a,{in:!1}):i[o]=hx.cloneElement(a,{onExited:n.bind(null,a),in:!0,exit:iN(a,"exit",e),enter:iN(a,"enter",e)})}}),i}tN.contextType=KC,tN.propTypes={},tN.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:nN,onEntering:nN,onEntered:nN,onExit:nN,onExiting:nN,onExited:nN},tN.UNMOUNTED=XC,tN.EXITED=JC,tN.ENTERING=ZC,tN.ENTERED=QC,tN.EXITING=eN;var aN=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},sN=function(e){function t(t,n){var r,i=(r=e.call(this,t,n)||this).handleExited.bind(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(r));return r.state={contextValue:{isMounting:!0},handleExited:i,firstRender:!0},r}LC(t,e);var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(e,t){var n,r,i=t.children,o=t.handleExited;return{children:t.firstRender?(n=e,r=o,rN(n.children,function(e){return hx.cloneElement(e,{onExited:r.bind(null,e),in:!0,appear:iN(e,"appear",n),enter:iN(e,"enter",n),exit:iN(e,"exit",n)})})):oN(e,i,o),firstRender:!1}},n.handleExited=function(e,t){var n=rN(this.props.children);e.key in n||(e.props.onExited&&e.props.onExited(t),this.mounted&&this.setState(function(t){var n=Qx({},t.children);return delete n[e.key],{children:n}}))},n.render=function(){var e=this.props,t=e.component,n=e.childFactory,r=eS(e,["component","childFactory"]),i=this.state.contextValue,o=aN(this.state.children).map(n);return delete r.appear,delete r.enter,delete r.exit,null===t?px.createElement(KC.Provider,{value:i},o):px.createElement(KC.Provider,{value:i},px.createElement(t,r,o))},t}(px.Component);sN.propTypes={},sN.defaultProps={component:"div",childFactory:function(e){return e}};const lN=e=>e.scrollTop;function cN(e,t){var n,r;const{timeout:i,easing:o,style:a={}}=e;return{duration:null!=(n=a.transitionDuration)?n:"number"==typeof i?i:i[t.mode]||0,easing:null!=(r=a.transitionTimingFunction)?r:"object"==typeof o?o[t.mode]:o,delay:a.transitionDelay}}function uN(e){return Tk("MuiPaper",e)}Dk("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);const dN=["className","component","elevation","square","variant"],fN=EC("div",{name:"MuiPaper",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],!n.square&&t.rounded,"elevation"===n.variant&&t[`elevation${n.elevation}`]]}})(({theme:e,ownerState:t})=>{var n;return Qx({backgroundColor:(e.vars||e).palette.background.paper,color:(e.vars||e).palette.text.primary,transition:e.transitions.create("box-shadow")},!t.square&&{borderRadius:e.shape.borderRadius},"outlined"===t.variant&&{border:`1px solid ${(e.vars||e).palette.divider}`},"elevation"===t.variant&&Qx({boxShadow:(e.vars||e).shadows[t.elevation]},!e.vars&&"dark"===e.palette.mode&&{backgroundImage:`linear-gradient(${$E.alpha("#fff",TC(t.elevation))}, ${$E.alpha("#fff",TC(t.elevation))})`},e.vars&&{backgroundImage:null==(n=e.vars.overlays)?void 0:n[t.elevation]}))}),hN=hx.forwardRef(function(e,t){const n=DC({props:e,name:"MuiPaper"}),{className:r,component:i="div",elevation:o=1,square:a=!1,variant:s="elevation"}=n,l=eS(n,dN),c=Qx({},n,{component:i,elevation:o,square:a,variant:s}),u=(e=>{const{square:t,elevation:n,variant:r,classes:i}=e;return hE({root:["root",r,!t&&"rounded","elevation"===r&&`elevation${n}`]},uN,i)})(c);return QM.jsx(fN,Qx({as:i,ownerState:c,className:Ck(u.root,r),ref:t},l))});const pN=Dk("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),mN=["center","classes","className"];let gN,yN,vN,bN,xN=e=>e;const SN=$M(gN||(gN=xN`
  0% {
    transform: scale(0);
    opacity: 0.1;
  }

  100% {
    transform: scale(1);
    opacity: 0.3;
  }
`)),MN=$M(yN||(yN=xN`
  0% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
`)),wN=$M(vN||(vN=xN`
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(0.92);
  }

  100% {
    transform: scale(1);
  }
`)),kN=EC("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),EN=EC(function(e){const{className:t,classes:n,pulsate:r=!1,rippleX:i,rippleY:o,rippleSize:a,in:s,onExited:l,timeout:c}=e,[u,d]=hx.useState(!1),f=Ck(t,n.ripple,n.rippleVisible,r&&n.ripplePulsate),h={width:a,height:a,top:-a/2+o,left:-a/2+i},p=Ck(n.child,u&&n.childLeaving,r&&n.childPulsate);return s||u||d(!0),hx.useEffect(()=>{if(!s&&null!=l){const e=setTimeout(l,c);return()=>{clearTimeout(e)}}},[l,s,c]),QM.jsx("span",{className:f,style:h,children:QM.jsx("span",{className:p})})},{name:"MuiTouchRipple",slot:"Ripple"})(bN||(bN=xN`
  opacity: 0;
  position: absolute;

  &.${0} {
    opacity: 0.3;
    transform: scale(1);
    animation-name: ${0};
    animation-duration: ${0}ms;
    animation-timing-function: ${0};
  }

  &.${0} {
    animation-duration: ${0}ms;
  }

  & .${0} {
    opacity: 1;
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: currentColor;
  }

  & .${0} {
    opacity: 0;
    animation-name: ${0};
    animation-duration: ${0}ms;
    animation-timing-function: ${0};
  }

  & .${0} {
    position: absolute;
    /* @noflip */
    left: 0px;
    top: 0;
    animation-name: ${0};
    animation-duration: 2500ms;
    animation-timing-function: ${0};
    animation-iteration-count: infinite;
    animation-delay: 200ms;
  }
`),pN.rippleVisible,SN,550,({theme:e})=>e.transitions.easing.easeInOut,pN.ripplePulsate,({theme:e})=>e.transitions.duration.shorter,pN.child,pN.childLeaving,MN,550,({theme:e})=>e.transitions.easing.easeInOut,pN.childPulsate,wN,({theme:e})=>e.transitions.easing.easeInOut),CN=hx.forwardRef(function(e,t){const n=DC({props:e,name:"MuiTouchRipple"}),{center:r=!1,classes:i={},className:o}=n,a=eS(n,mN),[s,l]=hx.useState([]),c=hx.useRef(0),u=hx.useRef(null);hx.useEffect(()=>{u.current&&(u.current(),u.current=null)},[s]);const d=hx.useRef(!1),f=rE(),h=hx.useRef(null),p=hx.useRef(null),m=hx.useCallback(e=>{const{pulsate:t,rippleX:n,rippleY:r,rippleSize:o,cb:a}=e;l(e=>[...e,QM.jsx(EN,{classes:{ripple:Ck(i.ripple,pN.ripple),rippleVisible:Ck(i.rippleVisible,pN.rippleVisible),ripplePulsate:Ck(i.ripplePulsate,pN.ripplePulsate),child:Ck(i.child,pN.child),childLeaving:Ck(i.childLeaving,pN.childLeaving),childPulsate:Ck(i.childPulsate,pN.childPulsate)},timeout:550,pulsate:t,rippleX:n,rippleY:r,rippleSize:o},c.current)]),c.current+=1,u.current=a},[i]),g=hx.useCallback((e={},t={},n=()=>{})=>{const{pulsate:i=!1,center:o=r||t.pulsate,fakeElement:a=!1}=t;if("mousedown"===(null==e?void 0:e.type)&&d.current)return void(d.current=!1);"touchstart"===(null==e?void 0:e.type)&&(d.current=!0);const s=a?null:p.current,l=s?s.getBoundingClientRect():{width:0,height:0,left:0,top:0};let c,u,g;if(o||void 0===e||0===e.clientX&&0===e.clientY||!e.clientX&&!e.touches)c=Math.round(l.width/2),u=Math.round(l.height/2);else{const{clientX:t,clientY:n}=e.touches&&e.touches.length>0?e.touches[0]:e;c=Math.round(t-l.left),u=Math.round(n-l.top)}if(o)g=Math.sqrt((2*l.width**2+l.height**2)/3),g%2==0&&(g+=1);else{const e=2*Math.max(Math.abs((s?s.clientWidth:0)-c),c)+2,t=2*Math.max(Math.abs((s?s.clientHeight:0)-u),u)+2;g=Math.sqrt(e**2+t**2)}null!=e&&e.touches?null===h.current&&(h.current=()=>{m({pulsate:i,rippleX:c,rippleY:u,rippleSize:g,cb:n})},f.start(80,()=>{h.current&&(h.current(),h.current=null)})):m({pulsate:i,rippleX:c,rippleY:u,rippleSize:g,cb:n})},[r,m,f]),y=hx.useCallback(()=>{g({},{pulsate:!0})},[g]),v=hx.useCallback((e,t)=>{if(f.clear(),"touchend"===(null==e?void 0:e.type)&&h.current)return h.current(),h.current=null,void f.start(0,()=>{v(e,t)});h.current=null,l(e=>e.length>0?e.slice(1):e),u.current=t},[f]);return hx.useImperativeHandle(t,()=>({pulsate:y,start:g,stop:v}),[y,g,v]),QM.jsx(kN,Qx({className:Ck(pN.root,i.root,o),ref:p},a,{children:QM.jsx(sN,{component:null,exit:!0,children:s})}))});function NN(e){return Tk("MuiButtonBase",e)}const TN=Dk("MuiButtonBase",["root","disabled","focusVisible"]),DN=["action","centerRipple","children","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","LinkComponent","onBlur","onClick","onContextMenu","onDragLeave","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","tabIndex","TouchRippleProps","touchRippleRef","type"],qN=EC("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${TN.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),ON=hx.forwardRef(function(e,t){const n=DC({props:e,name:"MuiButtonBase"}),{action:r,centerRipple:i=!1,children:o,className:a,component:s="button",disabled:l=!1,disableRipple:c=!1,disableTouchRipple:u=!1,focusRipple:d=!1,LinkComponent:f="a",onBlur:h,onClick:p,onContextMenu:m,onDragLeave:g,onFocus:y,onFocusVisible:v,onKeyDown:b,onKeyUp:x,onMouseDown:S,onMouseLeave:M,onMouseUp:w,onTouchEnd:k,onTouchMove:E,onTouchStart:C,tabIndex:N=0,TouchRippleProps:T,touchRippleRef:D,type:q}=n,O=eS(n,DN),I=hx.useRef(null),A=hx.useRef(null),_=Qk(A,D),{isFocusVisibleRef:L,onFocus:P,onBlur:R,ref:F}=fE(),[z,j]=hx.useState(!1);l&&z&&j(!1),hx.useImperativeHandle(r,()=>({focusVisible:()=>{j(!0),I.current.focus()}}),[]);const[$,V]=hx.useState(!1);hx.useEffect(()=>{V(!0)},[]);const U=$&&!c&&!l;function H(e,t,n=u){return Zk(r=>{t&&t(r);return!n&&A.current&&A.current[e](r),!0})}hx.useEffect(()=>{z&&d&&!c&&$&&A.current.pulsate()},[c,d,z,$]);const B=H("start",S),W=H("stop",m),Y=H("stop",g),G=H("stop",w),K=H("stop",e=>{z&&e.preventDefault(),M&&M(e)}),X=H("start",C),J=H("stop",k),Z=H("stop",E),Q=H("stop",e=>{R(e),!1===L.current&&j(!1),h&&h(e)},!1),ee=Zk(e=>{I.current||(I.current=e.currentTarget),P(e),!0===L.current&&(j(!0),v&&v(e)),y&&y(e)}),te=()=>{const e=I.current;return s&&"button"!==s&&!("A"===e.tagName&&e.href)},ne=hx.useRef(!1),re=Zk(e=>{d&&!ne.current&&z&&A.current&&" "===e.key&&(ne.current=!0,A.current.stop(e,()=>{A.current.start(e)})),e.target===e.currentTarget&&te()&&" "===e.key&&e.preventDefault(),b&&b(e),e.target===e.currentTarget&&te()&&"Enter"===e.key&&!l&&(e.preventDefault(),p&&p(e))}),ie=Zk(e=>{d&&" "===e.key&&A.current&&z&&!e.defaultPrevented&&(ne.current=!1,A.current.stop(e,()=>{A.current.pulsate(e)})),x&&x(e),p&&e.target===e.currentTarget&&te()&&" "===e.key&&!e.defaultPrevented&&p(e)});let oe=s;"button"===oe&&(O.href||O.to)&&(oe=f);const ae={};"button"===oe?(ae.type=void 0===q?"button":q,ae.disabled=l):(O.href||O.to||(ae.role="button"),l&&(ae["aria-disabled"]=l));const se=Qk(t,F,I),le=Qx({},n,{centerRipple:i,component:s,disabled:l,disableRipple:c,disableTouchRipple:u,focusRipple:d,tabIndex:N,focusVisible:z}),ce=(e=>{const{disabled:t,focusVisible:n,focusVisibleClassName:r,classes:i}=e,o=hE({root:["root",t&&"disabled",n&&"focusVisible"]},NN,i);return n&&r&&(o.root+=` ${r}`),o})(le);return QM.jsxs(qN,Qx({as:oe,className:Ck(ce.root,a),ownerState:le,onBlur:Q,onClick:p,onContextMenu:W,onFocus:ee,onKeyDown:re,onKeyUp:ie,onMouseDown:B,onMouseLeave:K,onMouseUp:G,onDragLeave:Y,onTouchEnd:J,onTouchMove:Z,onTouchStart:X,ref:se,tabIndex:l?-1:N,type:q},ae,O,{children:[o,U?QM.jsx(CN,Qx({ref:_,center:i},T)):null]}))});function IN(e){return Tk("MuiTypography",e)}Dk("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const AN=["align","className","component","gutterBottom","noWrap","paragraph","variant","variantMapping"],_N=EC("span",{name:"MuiTypography",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.variant&&t[n.variant],"inherit"!==n.align&&t[`align${yw(n.align)}`],n.noWrap&&t.noWrap,n.gutterBottom&&t.gutterBottom,n.paragraph&&t.paragraph]}})(({theme:e,ownerState:t})=>Qx({margin:0},"inherit"===t.variant&&{font:"inherit"},"inherit"!==t.variant&&e.typography[t.variant],"inherit"!==t.align&&{textAlign:t.align},t.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t.gutterBottom&&{marginBottom:"0.35em"},t.paragraph&&{marginBottom:16})),LN={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},PN={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},RN=hx.forwardRef(function(e,t){const n=DC({props:e,name:"MuiTypography"}),r=(e=>PN[e]||e)(n.color),i=Sk(Qx({},n,{color:r})),{align:o="inherit",className:a,component:s,gutterBottom:l=!1,noWrap:c=!1,paragraph:u=!1,variant:d="body1",variantMapping:f=LN}=i,h=eS(i,AN),p=Qx({},i,{align:o,color:r,className:a,component:s,gutterBottom:l,noWrap:c,paragraph:u,variant:d,variantMapping:f}),m=s||(u?"p":f[d]||LN[d])||"span",g=(e=>{const{align:t,gutterBottom:n,noWrap:r,paragraph:i,variant:o,classes:a}=e;return hE({root:["root",o,"inherit"!==e.align&&`align${yw(t)}`,n&&"gutterBottom",r&&"noWrap",i&&"paragraph"]},IN,a)})(p);return QM.jsx(_N,Qx({as:m,ref:t,ownerState:p,className:Ck(g.root,a)},h))});const FN=hx.forwardRef(function(e,t){const{children:n,container:r,disablePortal:i=!1}=e,[o,a]=hx.useState(null),s=Qk(hx.isValidElement(n)?bE(n):null,t);if(Uk(()=>{i||a(function(e){return"function"==typeof e?e():e}(r)||document.body)},[r,i]),Uk(()=>{if(o&&!i)return Gk(t,o),()=>{Gk(t,null)}},[t,o,i]),i){if(hx.isValidElement(n)){const e={ref:s};return hx.cloneElement(n,e)}return QM.jsx(hx.Fragment,{children:n})}return QM.jsx(hx.Fragment,{children:o?WC.createPortal(n,o):o})}),zN=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"],jN={entering:{opacity:1},entered:{opacity:1}},$N=hx.forwardRef(function(e,t){const n=uC(),r={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{addEndListener:i,appear:o=!0,children:a,easing:s,in:l,onEnter:c,onEntered:u,onEntering:d,onExit:f,onExited:h,onExiting:p,style:m,timeout:g=r,TransitionComponent:y=tN}=e,v=eS(e,zN),b=hx.useRef(null),x=Qk(b,bE(a),t),S=e=>t=>{if(e){const n=b.current;void 0===t?e(n):e(n,t)}},M=S(d),w=S((e,t)=>{lN(e);const r=cN({style:m,timeout:g,easing:s},{mode:"enter"});e.style.webkitTransition=n.transitions.create("opacity",r),e.style.transition=n.transitions.create("opacity",r),c&&c(e,t)}),k=S(u),E=S(p),C=S(e=>{const t=cN({style:m,timeout:g,easing:s},{mode:"exit"});e.style.webkitTransition=n.transitions.create("opacity",t),e.style.transition=n.transitions.create("opacity",t),f&&f(e)}),N=S(h);return QM.jsx(y,Qx({appear:o,in:l,nodeRef:b,onEnter:w,onEntered:k,onEntering:M,onExit:C,onExited:N,onExiting:E,addEndListener:e=>{i&&i(b.current,e)},timeout:g},v,{children:(e,t)=>hx.cloneElement(a,Qx({style:Qx({opacity:0,visibility:"exited"!==e||l?void 0:"hidden"},jN[e],m,a.props.style),ref:x},t))}))});function VN(e){return Tk("MuiBackdrop",e)}Dk("MuiBackdrop",["root","invisible"]);const UN=["children","className","component","components","componentsProps","invisible","open","slotProps","slots","TransitionComponent","transitionDuration"],HN=EC("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.invisible&&t.invisible]}})(({ownerState:e})=>Qx({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent"},e.invisible&&{backgroundColor:"transparent"})),BN=hx.forwardRef(function(e,t){var n,r,i;const o=DC({props:e,name:"MuiBackdrop"}),{children:a,className:s,component:l="div",components:c={},componentsProps:u={},invisible:d=!1,open:f,slotProps:h={},slots:p={},TransitionComponent:m=$N,transitionDuration:g}=o,y=eS(o,UN),v=Qx({},o,{component:l,invisible:d}),b=(e=>{const{classes:t,invisible:n}=e;return hE({root:["root",n&&"invisible"]},VN,t)})(v),x=null!=(n=h.root)?n:u.root;return QM.jsx(m,Qx({in:f,timeout:g},y,{children:QM.jsx(HN,Qx({"aria-hidden":!0},x,{as:null!=(r=null!=(i=p.root)?i:c.Root)?r:l,className:Ck(b.root,s,null==x?void 0:x.className),ownerState:Qx({},v,null==x?void 0:x.ownerState),classes:b,ref:t,children:a}))}))});function WN(e){return Tk("MuiButton",e)}const YN=Dk("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge"]),GN=hx.createContext({}),KN=hx.createContext(void 0),XN=["children","color","component","className","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"],JN=e=>Qx({},"small"===e.size&&{"& > *:nth-of-type(1)":{fontSize:18}},"medium"===e.size&&{"& > *:nth-of-type(1)":{fontSize:20}},"large"===e.size&&{"& > *:nth-of-type(1)":{fontSize:22}}),ZN=EC(ON,{shouldForwardProp:e=>kC(e)||"classes"===e,name:"MuiButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`${n.variant}${yw(n.color)}`],t[`size${yw(n.size)}`],t[`${n.variant}Size${yw(n.size)}`],"inherit"===n.color&&t.colorInherit,n.disableElevation&&t.disableElevation,n.fullWidth&&t.fullWidth]}})(({theme:e,ownerState:t})=>{var n,r;const i="light"===e.palette.mode?e.palette.grey[300]:e.palette.grey[800],o="light"===e.palette.mode?e.palette.grey.A100:e.palette.grey[700];return Qx({},e.typography.button,{minWidth:64,padding:"6px 16px",borderRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create(["background-color","box-shadow","border-color","color"],{duration:e.transitions.duration.short}),"&:hover":Qx({textDecoration:"none",backgroundColor:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.hoverOpacity})`:$E.alpha(e.palette.text.primary,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},"text"===t.variant&&"inherit"!==t.color&&{backgroundColor:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:$E.alpha(e.palette[t.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},"outlined"===t.variant&&"inherit"!==t.color&&{border:`1px solid ${(e.vars||e).palette[t.color].main}`,backgroundColor:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:$E.alpha(e.palette[t.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},"contained"===t.variant&&{backgroundColor:e.vars?e.vars.palette.Button.inheritContainedHoverBg:o,boxShadow:(e.vars||e).shadows[4],"@media (hover: none)":{boxShadow:(e.vars||e).shadows[2],backgroundColor:(e.vars||e).palette.grey[300]}},"contained"===t.variant&&"inherit"!==t.color&&{backgroundColor:(e.vars||e).palette[t.color].dark,"@media (hover: none)":{backgroundColor:(e.vars||e).palette[t.color].main}}),"&:active":Qx({},"contained"===t.variant&&{boxShadow:(e.vars||e).shadows[8]}),[`&.${YN.focusVisible}`]:Qx({},"contained"===t.variant&&{boxShadow:(e.vars||e).shadows[6]}),[`&.${YN.disabled}`]:Qx({color:(e.vars||e).palette.action.disabled},"outlined"===t.variant&&{border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`},"contained"===t.variant&&{color:(e.vars||e).palette.action.disabled,boxShadow:(e.vars||e).shadows[0],backgroundColor:(e.vars||e).palette.action.disabledBackground})},"text"===t.variant&&{padding:"6px 8px"},"text"===t.variant&&"inherit"!==t.color&&{color:(e.vars||e).palette[t.color].main},"outlined"===t.variant&&{padding:"5px 15px",border:"1px solid currentColor"},"outlined"===t.variant&&"inherit"!==t.color&&{color:(e.vars||e).palette[t.color].main,border:e.vars?`1px solid rgba(${e.vars.palette[t.color].mainChannel} / 0.5)`:`1px solid ${$E.alpha(e.palette[t.color].main,.5)}`},"contained"===t.variant&&{color:e.vars?e.vars.palette.text.primary:null==(n=(r=e.palette).getContrastText)?void 0:n.call(r,e.palette.grey[300]),backgroundColor:e.vars?e.vars.palette.Button.inheritContainedBg:i,boxShadow:(e.vars||e).shadows[2]},"contained"===t.variant&&"inherit"!==t.color&&{color:(e.vars||e).palette[t.color].contrastText,backgroundColor:(e.vars||e).palette[t.color].main},"inherit"===t.color&&{color:"inherit",borderColor:"currentColor"},"small"===t.size&&"text"===t.variant&&{padding:"4px 5px",fontSize:e.typography.pxToRem(13)},"large"===t.size&&"text"===t.variant&&{padding:"8px 11px",fontSize:e.typography.pxToRem(15)},"small"===t.size&&"outlined"===t.variant&&{padding:"3px 9px",fontSize:e.typography.pxToRem(13)},"large"===t.size&&"outlined"===t.variant&&{padding:"7px 21px",fontSize:e.typography.pxToRem(15)},"small"===t.size&&"contained"===t.variant&&{padding:"4px 10px",fontSize:e.typography.pxToRem(13)},"large"===t.size&&"contained"===t.variant&&{padding:"8px 22px",fontSize:e.typography.pxToRem(15)},t.fullWidth&&{width:"100%"})},({ownerState:e})=>e.disableElevation&&{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${YN.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${YN.disabled}`]:{boxShadow:"none"}}),QN=EC("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.startIcon,t[`iconSize${yw(n.size)}`]]}})(({ownerState:e})=>Qx({display:"inherit",marginRight:8,marginLeft:-4},"small"===e.size&&{marginLeft:-2},JN(e))),eT=EC("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.endIcon,t[`iconSize${yw(n.size)}`]]}})(({ownerState:e})=>Qx({display:"inherit",marginRight:-4,marginLeft:8},"small"===e.size&&{marginRight:-2},JN(e))),tT=hx.forwardRef(function(e,t){const n=hx.useContext(GN),r=hx.useContext(KN),i=DC({props:Vk(n,e),name:"MuiButton"}),{children:o,color:a="primary",component:s="button",className:l,disabled:c=!1,disableElevation:u=!1,disableFocusRipple:d=!1,endIcon:f,focusVisibleClassName:h,fullWidth:p=!1,size:m="medium",startIcon:g,type:y,variant:v="text"}=i,b=eS(i,XN),x=Qx({},i,{color:a,component:s,disabled:c,disableElevation:u,disableFocusRipple:d,fullWidth:p,size:m,type:y,variant:v}),S=(e=>{const{color:t,disableElevation:n,fullWidth:r,size:i,variant:o,classes:a}=e;return Qx({},a,hE({root:["root",o,`${o}${yw(t)}`,`size${yw(i)}`,`${o}Size${yw(i)}`,`color${yw(t)}`,n&&"disableElevation",r&&"fullWidth"],label:["label"],startIcon:["icon","startIcon",`iconSize${yw(i)}`],endIcon:["icon","endIcon",`iconSize${yw(i)}`]},WN,a))})(x),M=g&&QM.jsx(QN,{className:S.startIcon,ownerState:x,children:g}),w=f&&QM.jsx(eT,{className:S.endIcon,ownerState:x,children:f}),k=r||"";return QM.jsxs(ZN,Qx({ownerState:x,className:Ck(n.className,S.root,l,k),component:s,disabled:c,focusRipple:!d,focusVisibleClassName:Ck(S.focusVisible,h),ref:t,type:y},b,{classes:S,children:[M,o,w]}))});function nT(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function rT(e){return parseInt(Yk(e).getComputedStyle(e).paddingRight,10)||0}function iT(e,t,n,r,i){const o=[t,n,...r];[].forEach.call(e.children,e=>{const t=-1===o.indexOf(e),n=!function(e){const t=-1!==["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].indexOf(e.tagName),n="INPUT"===e.tagName&&"hidden"===e.getAttribute("type");return t||n}(e);t&&n&&nT(e,i)})}function oT(e,t){let n=-1;return e.some((e,r)=>!!t(e)&&(n=r,!0)),n}function aT(e,t){const n=[],r=e.container;if(!t.disableScrollLock){if(function(e){const t=Wk(e);return t.body===e?Yk(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}(r)){const e=function(e){const t=e.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}(Wk(r));n.push({value:r.style.paddingRight,property:"padding-right",el:r}),r.style.paddingRight=`${rT(r)+e}px`;const t=Wk(r).querySelectorAll(".mui-fixed");[].forEach.call(t,t=>{n.push({value:t.style.paddingRight,property:"padding-right",el:t}),t.style.paddingRight=`${rT(t)+e}px`})}let e;if(r.parentNode instanceof DocumentFragment)e=Wk(r).body;else{const t=r.parentElement,n=Yk(r);e="HTML"===(null==t?void 0:t.nodeName)&&"scroll"===n.getComputedStyle(t).overflowY?t:r}n.push({value:e.style.overflow,property:"overflow",el:e},{value:e.style.overflowX,property:"overflow-x",el:e},{value:e.style.overflowY,property:"overflow-y",el:e}),e.style.overflow="hidden"}return()=>{n.forEach(({value:e,el:t,property:n})=>{e?t.style.setProperty(n,e):t.style.removeProperty(n)})}}const sT=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function lT(e){const t=[],n=[];return Array.from(e.querySelectorAll(sT)).forEach((e,r)=>{const i=function(e){const t=parseInt(e.getAttribute("tabindex")||"",10);return Number.isNaN(t)?"true"===e.contentEditable||("AUDIO"===e.nodeName||"VIDEO"===e.nodeName||"DETAILS"===e.nodeName)&&null===e.getAttribute("tabindex")?0:e.tabIndex:t}(e);-1!==i&&function(e){return!(e.disabled||"INPUT"===e.tagName&&"hidden"===e.type||function(e){if("INPUT"!==e.tagName||"radio"!==e.type)return!1;if(!e.name)return!1;const t=t=>e.ownerDocument.querySelector(`input[type="radio"]${t}`);let n=t(`[name="${e.name}"]:checked`);return n||(n=t(`[name="${e.name}"]`)),n!==e}(e))}(e)&&(0===i?t.push(e):n.push({documentOrder:r,tabIndex:i,node:e}))}),n.sort((e,t)=>e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex).map(e=>e.node).concat(t)}function cT(){return!0}function uT(e){const{children:t,disableAutoFocus:n=!1,disableEnforceFocus:r=!1,disableRestoreFocus:i=!1,getTabbable:o=lT,isEnabled:a=cT,open:s}=e,l=hx.useRef(!1),c=hx.useRef(null),u=hx.useRef(null),d=hx.useRef(null),f=hx.useRef(null),h=hx.useRef(!1),p=hx.useRef(null),m=Qk(bE(t),p),g=hx.useRef(null);hx.useEffect(()=>{s&&p.current&&(h.current=!n)},[n,s]),hx.useEffect(()=>{if(!s||!p.current)return;const e=Wk(p.current);return p.current.contains(e.activeElement)||(p.current.hasAttribute("tabIndex")||p.current.setAttribute("tabIndex","-1"),h.current&&p.current.focus()),()=>{i||(d.current&&d.current.focus&&(l.current=!0,d.current.focus()),d.current=null)}},[s]),hx.useEffect(()=>{if(!s||!p.current)return;const e=Wk(p.current),t=t=>{g.current=t,!r&&a()&&"Tab"===t.key&&e.activeElement===p.current&&t.shiftKey&&(l.current=!0,u.current&&u.current.focus())},n=()=>{const t=p.current;if(null===t)return;if(!e.hasFocus()||!a()||l.current)return void(l.current=!1);if(t.contains(e.activeElement))return;if(r&&e.activeElement!==c.current&&e.activeElement!==u.current)return;if(e.activeElement!==f.current)f.current=null;else if(null!==f.current)return;if(!h.current)return;let n=[];if(e.activeElement!==c.current&&e.activeElement!==u.current||(n=o(p.current)),n.length>0){var i,s;const e=Boolean((null==(i=g.current)?void 0:i.shiftKey)&&"Tab"===(null==(s=g.current)?void 0:s.key)),t=n[0],r=n[n.length-1];"string"!=typeof t&&"string"!=typeof r&&(e?r.focus():t.focus())}else t.focus()};e.addEventListener("focusin",n),e.addEventListener("keydown",t,!0);const i=setInterval(()=>{e.activeElement&&"BODY"===e.activeElement.tagName&&n()},50);return()=>{clearInterval(i),e.removeEventListener("focusin",n),e.removeEventListener("keydown",t,!0)}},[n,r,i,a,s,o]);const y=e=>{null===d.current&&(d.current=e.relatedTarget),h.current=!0};return QM.jsxs(hx.Fragment,{children:[QM.jsx("div",{tabIndex:s?0:-1,onFocus:y,ref:c,"data-testid":"sentinelStart"}),hx.cloneElement(t,{ref:m,onFocus:e=>{null===d.current&&(d.current=e.relatedTarget),h.current=!0,f.current=e.target;const n=t.props.onFocus;n&&n(e)}}),QM.jsx("div",{tabIndex:s?0:-1,onFocus:y,ref:u,"data-testid":"sentinelEnd"})]})}const dT=new class{constructor(){this.containers=void 0,this.modals=void 0,this.modals=[],this.containers=[]}add(e,t){let n=this.modals.indexOf(e);if(-1!==n)return n;n=this.modals.length,this.modals.push(e),e.modalRef&&nT(e.modalRef,!1);const r=function(e){const t=[];return[].forEach.call(e.children,e=>{"true"===e.getAttribute("aria-hidden")&&t.push(e)}),t}(t);iT(t,e.mount,e.modalRef,r,!0);const i=oT(this.containers,e=>e.container===t);return-1!==i?(this.containers[i].modals.push(e),n):(this.containers.push({modals:[e],container:t,restore:null,hiddenSiblings:r}),n)}mount(e,t){const n=oT(this.containers,t=>-1!==t.modals.indexOf(e)),r=this.containers[n];r.restore||(r.restore=aT(r,t))}remove(e,t=!0){const n=this.modals.indexOf(e);if(-1===n)return n;const r=oT(this.containers,t=>-1!==t.modals.indexOf(e)),i=this.containers[r];if(i.modals.splice(i.modals.indexOf(e),1),this.modals.splice(n,1),0===i.modals.length)i.restore&&i.restore(),e.modalRef&&nT(e.modalRef,t),iT(i.container,e.mount,e.modalRef,i.hiddenSiblings,!1),this.containers.splice(r,1);else{const e=i.modals[i.modals.length-1];e.modalRef&&nT(e.modalRef,!1)}return n}isTopModal(e){return this.modals.length>0&&this.modals[this.modals.length-1]===e}};function fT(e){const{container:t,disableEscapeKeyDown:n=!1,disableScrollLock:r=!1,manager:i=dT,closeAfterTransition:o=!1,onTransitionEnter:a,onTransitionExited:s,children:l,onClose:c,open:u,rootRef:d}=e,f=hx.useRef({}),h=hx.useRef(null),p=hx.useRef(null),m=Qk(p,d),[g,y]=hx.useState(!u),v=function(e){return!!e&&e.props.hasOwnProperty("in")}(l);let b=!0;"false"!==e["aria-hidden"]&&!1!==e["aria-hidden"]||(b=!1);const x=()=>(f.current.modalRef=p.current,f.current.mount=h.current,f.current),S=()=>{i.mount(x(),{disableScrollLock:r}),p.current&&(p.current.scrollTop=0)},M=Zk(()=>{const e=function(e){return"function"==typeof e?e():e}(t)||Wk(h.current).body;i.add(x(),e),p.current&&S()}),w=hx.useCallback(()=>i.isTopModal(x()),[i]),k=Zk(e=>{h.current=e,e&&(u&&w()?S():p.current&&nT(p.current,b))}),E=hx.useCallback(()=>{i.remove(x(),b)},[b,i]);hx.useEffect(()=>()=>{E()},[E]),hx.useEffect(()=>{u?M():v&&o||E()},[u,E,v,o,M]);const C=e=>t=>{var r;null==(r=e.onKeyDown)||r.call(e,t),"Escape"===t.key&&229!==t.which&&w()&&(n||(t.stopPropagation(),c&&c(t,"escapeKeyDown")))},N=e=>t=>{var n;null==(n=e.onClick)||n.call(e,t),t.target===t.currentTarget&&c&&c(t,"backdropClick")};return{getRootProps:(t={})=>{const n=mE(e);delete n.onTransitionEnter,delete n.onTransitionExited;const r=Qx({},n,t);return Qx({role:"presentation"},r,{onKeyDown:C(r),ref:m})},getBackdropProps:(e={})=>Qx({"aria-hidden":!0},e,{onClick:N(e),open:u}),getTransitionProps:()=>({onEnter:Bk(()=>{y(!1),a&&a()},null==l?void 0:l.props.onEnter),onExited:Bk(()=>{y(!0),s&&s(),o&&E()},null==l?void 0:l.props.onExited)}),rootRef:m,portalRef:k,isTopModal:w,exited:g,hasTransition:v}}function hT(e){return Tk("MuiModal",e)}Dk("MuiModal",["root","hidden","backdrop"]);const pT=["BackdropComponent","BackdropProps","classes","className","closeAfterTransition","children","container","component","components","componentsProps","disableAutoFocus","disableEnforceFocus","disableEscapeKeyDown","disablePortal","disableRestoreFocus","disableScrollLock","hideBackdrop","keepMounted","onBackdropClick","onClose","onTransitionEnter","onTransitionExited","open","slotProps","slots","theme"],mT=EC("div",{name:"MuiModal",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.open&&n.exited&&t.hidden]}})(({theme:e,ownerState:t})=>Qx({position:"fixed",zIndex:(e.vars||e).zIndex.modal,right:0,bottom:0,top:0,left:0},!t.open&&t.exited&&{visibility:"hidden"})),gT=EC(BN,{name:"MuiModal",slot:"Backdrop",overridesResolver:(e,t)=>t.backdrop})({zIndex:-1}),yT=hx.forwardRef(function(e,t){var n,r,i,o,a,s;const l=DC({name:"MuiModal",props:e}),{BackdropComponent:c=gT,BackdropProps:u,className:d,closeAfterTransition:f=!1,children:h,container:p,component:m,components:g={},componentsProps:y={},disableAutoFocus:v=!1,disableEnforceFocus:b=!1,disableEscapeKeyDown:x=!1,disablePortal:S=!1,disableRestoreFocus:M=!1,disableScrollLock:w=!1,hideBackdrop:k=!1,keepMounted:E=!1,onBackdropClick:C,open:N,slotProps:T,slots:D}=l,q=eS(l,pT),O=Qx({},l,{closeAfterTransition:f,disableAutoFocus:v,disableEnforceFocus:b,disableEscapeKeyDown:x,disablePortal:S,disableRestoreFocus:M,disableScrollLock:w,hideBackdrop:k,keepMounted:E}),{getRootProps:I,getBackdropProps:A,getTransitionProps:_,portalRef:L,isTopModal:P,exited:R,hasTransition:F}=fT(Qx({},O,{rootRef:t})),z=Qx({},O,{exited:R}),j=(e=>{const{open:t,exited:n,classes:r}=e;return hE({root:["root",!t&&n&&"hidden"],backdrop:["backdrop"]},hT,r)})(z),$={};if(void 0===h.props.tabIndex&&($.tabIndex="-1"),F){const{onEnter:e,onExited:t}=_();$.onEnter=e,$.onExited=t}const V=null!=(n=null!=(r=null==D?void 0:D.root)?r:g.Root)?n:mT,U=null!=(i=null!=(o=null==D?void 0:D.backdrop)?o:g.Backdrop)?i:c,H=null!=(a=null==T?void 0:T.root)?a:y.root,B=null!=(s=null==T?void 0:T.backdrop)?s:y.backdrop,W=vE({elementType:V,externalSlotProps:H,externalForwardedProps:q,getSlotProps:I,additionalProps:{ref:t,as:m},ownerState:z,className:Ck(d,null==H?void 0:H.className,null==j?void 0:j.root,!z.open&&z.exited&&(null==j?void 0:j.hidden))}),Y=vE({elementType:U,externalSlotProps:B,additionalProps:u,getSlotProps:e=>A(Qx({},e,{onClick:t=>{C&&C(t),null!=e&&e.onClick&&e.onClick(t)}})),className:Ck(null==B?void 0:B.className,null==u?void 0:u.className,null==j?void 0:j.backdrop),ownerState:z});return E||N||F&&!R?QM.jsx(FN,{ref:L,container:p,disablePortal:S,children:QM.jsxs(V,Qx({},W,{children:[!k&&c?QM.jsx(U,Qx({},Y)):null,QM.jsx(uT,{disableEnforceFocus:b,disableAutoFocus:v,disableRestoreFocus:M,isEnabled:P,open:N,children:hx.cloneElement(h,$)})]}))}):null});function vT(e){return Tk("MuiDivider",e)}Dk("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]);const bT=["absolute","children","className","component","flexItem","light","orientation","role","textAlign","variant"],xT=EC("div",{name:"MuiDivider",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.absolute&&t.absolute,t[n.variant],n.light&&t.light,"vertical"===n.orientation&&t.vertical,n.flexItem&&t.flexItem,n.children&&t.withChildren,n.children&&"vertical"===n.orientation&&t.withChildrenVertical,"right"===n.textAlign&&"vertical"!==n.orientation&&t.textAlignRight,"left"===n.textAlign&&"vertical"!==n.orientation&&t.textAlignLeft]}})(({theme:e,ownerState:t})=>Qx({margin:0,flexShrink:0,borderWidth:0,borderStyle:"solid",borderColor:(e.vars||e).palette.divider,borderBottomWidth:"thin"},t.absolute&&{position:"absolute",bottom:0,left:0,width:"100%"},t.light&&{borderColor:e.vars?`rgba(${e.vars.palette.dividerChannel} / 0.08)`:$E.alpha(e.palette.divider,.08)},"inset"===t.variant&&{marginLeft:72},"middle"===t.variant&&"horizontal"===t.orientation&&{marginLeft:e.spacing(2),marginRight:e.spacing(2)},"middle"===t.variant&&"vertical"===t.orientation&&{marginTop:e.spacing(1),marginBottom:e.spacing(1)},"vertical"===t.orientation&&{height:"100%",borderBottomWidth:0,borderRightWidth:"thin"},t.flexItem&&{alignSelf:"stretch",height:"auto"}),({ownerState:e})=>Qx({},e.children&&{display:"flex",whiteSpace:"nowrap",textAlign:"center",border:0,borderTopStyle:"solid",borderLeftStyle:"solid","&::before, &::after":{content:'""',alignSelf:"center"}}),({theme:e,ownerState:t})=>Qx({},t.children&&"vertical"!==t.orientation&&{"&::before, &::after":{width:"100%",borderTop:`thin solid ${(e.vars||e).palette.divider}`,borderTopStyle:"inherit"}}),({theme:e,ownerState:t})=>Qx({},t.children&&"vertical"===t.orientation&&{flexDirection:"column","&::before, &::after":{height:"100%",borderLeft:`thin solid ${(e.vars||e).palette.divider}`,borderLeftStyle:"inherit"}}),({ownerState:e})=>Qx({},"right"===e.textAlign&&"vertical"!==e.orientation&&{"&::before":{width:"90%"},"&::after":{width:"10%"}},"left"===e.textAlign&&"vertical"!==e.orientation&&{"&::before":{width:"10%"},"&::after":{width:"90%"}})),ST=EC("span",{name:"MuiDivider",slot:"Wrapper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.wrapper,"vertical"===n.orientation&&t.wrapperVertical]}})(({theme:e,ownerState:t})=>Qx({display:"inline-block",paddingLeft:`calc(${e.spacing(1)} * 1.2)`,paddingRight:`calc(${e.spacing(1)} * 1.2)`},"vertical"===t.orientation&&{paddingTop:`calc(${e.spacing(1)} * 1.2)`,paddingBottom:`calc(${e.spacing(1)} * 1.2)`})),MT=hx.forwardRef(function(e,t){const n=DC({props:e,name:"MuiDivider"}),{absolute:r=!1,children:i,className:o,component:a=(i?"div":"hr"),flexItem:s=!1,light:l=!1,orientation:c="horizontal",role:u=("hr"!==a?"separator":void 0),textAlign:d="center",variant:f="fullWidth"}=n,h=eS(n,bT),p=Qx({},n,{absolute:r,component:a,flexItem:s,light:l,orientation:c,role:u,textAlign:d,variant:f}),m=(e=>{const{absolute:t,children:n,classes:r,flexItem:i,light:o,orientation:a,textAlign:s,variant:l}=e;return hE({root:["root",t&&"absolute",l,o&&"light","vertical"===a&&"vertical",i&&"flexItem",n&&"withChildren",n&&"vertical"===a&&"withChildrenVertical","right"===s&&"vertical"!==a&&"textAlignRight","left"===s&&"vertical"!==a&&"textAlignLeft"],wrapper:["wrapper","vertical"===a&&"wrapperVertical"]},vT,r)})(p);return QM.jsx(xT,Qx({as:a,className:Ck(m.root,o),role:u,ref:t,ownerState:p},h,{children:i?QM.jsx(ST,{className:m.wrapper,ownerState:p,children:i}):null}))});MT.muiSkipListHighlight=!0;const wT=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function kT(e){return`scale(${e}, ${e**2})`}const ET={entering:{opacity:1,transform:kT(1)},entered:{opacity:1,transform:"none"}},CT="undefined"!=typeof navigator&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),NT=hx.forwardRef(function(e,t){const{addEndListener:n,appear:r=!0,children:i,easing:o,in:a,onEnter:s,onEntered:l,onEntering:c,onExit:u,onExited:d,onExiting:f,style:h,timeout:p="auto",TransitionComponent:m=tN}=e,g=eS(e,wT),y=rE(),v=hx.useRef(),b=uC(),x=hx.useRef(null),S=Qk(x,bE(i),t),M=e=>t=>{if(e){const n=x.current;void 0===t?e(n):e(n,t)}},w=M(c),k=M((e,t)=>{lN(e);const{duration:n,delay:r,easing:i}=cN({style:h,timeout:p,easing:o},{mode:"enter"});let a;"auto"===p?(a=b.transitions.getAutoHeightDuration(e.clientHeight),v.current=a):a=n,e.style.transition=[b.transitions.create("opacity",{duration:a,delay:r}),b.transitions.create("transform",{duration:CT?a:.666*a,delay:r,easing:i})].join(","),s&&s(e,t)}),E=M(l),C=M(f),N=M(e=>{const{duration:t,delay:n,easing:r}=cN({style:h,timeout:p,easing:o},{mode:"exit"});let i;"auto"===p?(i=b.transitions.getAutoHeightDuration(e.clientHeight),v.current=i):i=t,e.style.transition=[b.transitions.create("opacity",{duration:i,delay:n}),b.transitions.create("transform",{duration:CT?i:.666*i,delay:CT?n:n||.333*i,easing:r})].join(","),e.style.opacity=0,e.style.transform=kT(.75),u&&u(e)}),T=M(d);return QM.jsx(m,Qx({appear:r,in:a,nodeRef:x,onEnter:k,onEntered:E,onEntering:w,onExit:N,onExited:T,onExiting:C,addEndListener:e=>{"auto"===p&&y.start(v.current||0,e),n&&n(x.current,e)},timeout:"auto"===p?null:p},g,{children:(e,t)=>hx.cloneElement(i,Qx({style:Qx({opacity:0,transform:kT(.75),visibility:"exited"!==e||a?void 0:"hidden"},ET[e],h,i.props.style),ref:S},t))}))});NT.muiSupportAuto=!0;const TT=hx.createContext({});function DT(e){return Tk("MuiList",e)}Dk("MuiList",["root","padding","dense","subheader"]);const qT=["children","className","component","dense","disablePadding","subheader"],OT=EC("ul",{name:"MuiList",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disablePadding&&t.padding,n.dense&&t.dense,n.subheader&&t.subheader]}})(({ownerState:e})=>Qx({listStyle:"none",margin:0,padding:0,position:"relative"},!e.disablePadding&&{paddingTop:8,paddingBottom:8},e.subheader&&{paddingTop:0})),IT=hx.forwardRef(function(e,t){const n=DC({props:e,name:"MuiList"}),{children:r,className:i,component:o="ul",dense:a=!1,disablePadding:s=!1,subheader:l}=n,c=eS(n,qT),u=hx.useMemo(()=>({dense:a}),[a]),d=Qx({},n,{component:o,dense:a,disablePadding:s}),f=(e=>{const{classes:t,disablePadding:n,dense:r,subheader:i}=e;return hE({root:["root",!n&&"padding",r&&"dense",i&&"subheader"]},DT,t)})(d);return QM.jsx(TT.Provider,{value:u,children:QM.jsxs(OT,Qx({as:o,className:Ck(f.root,i),ref:t,ownerState:d},c,{children:[l,r]}))})});function AT(e){return Tk("MuiListItemButton",e)}const _T=Dk("MuiListItemButton",["root","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","selected"]),LT=["alignItems","autoFocus","component","children","dense","disableGutters","divider","focusVisibleClassName","selected","className"],PT=EC(ON,{shouldForwardProp:e=>kC(e)||"classes"===e,name:"MuiListItemButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.dense&&t.dense,"flex-start"===n.alignItems&&t.alignItemsFlexStart,n.divider&&t.divider,!n.disableGutters&&t.gutters]}})(({theme:e,ownerState:t})=>Qx({display:"flex",flexGrow:1,justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minWidth:0,boxSizing:"border-box",textAlign:"left",paddingTop:8,paddingBottom:8,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${_T.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:$E.alpha(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${_T.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:$E.alpha(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},[`&.${_T.selected}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:$E.alpha(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:$E.alpha(e.palette.primary.main,e.palette.action.selectedOpacity)}},[`&.${_T.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${_T.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity}},t.divider&&{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"},"flex-start"===t.alignItems&&{alignItems:"flex-start"},!t.disableGutters&&{paddingLeft:16,paddingRight:16},t.dense&&{paddingTop:4,paddingBottom:4})),RT=hx.forwardRef(function(e,t){const n=DC({props:e,name:"MuiListItemButton"}),{alignItems:r="center",autoFocus:i=!1,component:o="div",children:a,dense:s=!1,disableGutters:l=!1,divider:c=!1,focusVisibleClassName:u,selected:d=!1,className:f}=n,h=eS(n,LT),p=hx.useContext(TT),m=hx.useMemo(()=>({dense:s||p.dense||!1,alignItems:r,disableGutters:l}),[r,p.dense,s,l]),g=hx.useRef(null);Uk(()=>{i&&g.current&&g.current.focus()},[i]);const y=Qx({},n,{alignItems:r,dense:m.dense,disableGutters:l,divider:c,selected:d}),v=(e=>{const{alignItems:t,classes:n,dense:r,disabled:i,disableGutters:o,divider:a,selected:s}=e;return Qx({},n,hE({root:["root",r&&"dense",!o&&"gutters",a&&"divider",i&&"disabled","flex-start"===t&&"alignItemsFlexStart",s&&"selected"]},AT,n))})(y),b=Qk(g,t);return QM.jsx(TT.Provider,{value:m,children:QM.jsx(PT,Qx({ref:b,href:h.href||h.to,component:(h.href||h.to)&&"div"===o?"button":o,focusVisibleClassName:Ck(v.focusVisible,u),ownerState:y,className:Ck(v.root,f)},h,{classes:v,children:a}))})});function FT(e){return Tk("MuiListItemIcon",e)}Dk("MuiListItemIcon",["root","alignItemsFlexStart"]);const zT=["className"],jT=EC("div",{name:"MuiListItemIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,"flex-start"===n.alignItems&&t.alignItemsFlexStart]}})(({theme:e,ownerState:t})=>Qx({minWidth:56,color:(e.vars||e).palette.action.active,flexShrink:0,display:"inline-flex"},"flex-start"===t.alignItems&&{marginTop:8})),$T=hx.forwardRef(function(e,t){const n=DC({props:e,name:"MuiListItemIcon"}),{className:r}=n,i=eS(n,zT),o=Qx({},n,{alignItems:hx.useContext(TT).alignItems}),a=(e=>{const{alignItems:t,classes:n}=e;return hE({root:["root","flex-start"===t&&"alignItemsFlexStart"]},FT,n)})(o);return QM.jsx(jT,Qx({className:Ck(a.root,r),ownerState:o,ref:t},i))});function VT(e){return Tk("MuiListItemText",e)}const UT=Dk("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]),HT=["children","className","disableTypography","inset","primary","primaryTypographyProps","secondary","secondaryTypographyProps"],BT=EC("div",{name:"MuiListItemText",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${UT.primary}`]:t.primary},{[`& .${UT.secondary}`]:t.secondary},t.root,n.inset&&t.inset,n.primary&&n.secondary&&t.multiline,n.dense&&t.dense]}})(({ownerState:e})=>Qx({flex:"1 1 auto",minWidth:0,marginTop:4,marginBottom:4},e.primary&&e.secondary&&{marginTop:6,marginBottom:6},e.inset&&{paddingLeft:56})),WT=hx.forwardRef(function(e,t){const n=DC({props:e,name:"MuiListItemText"}),{children:r,className:i,disableTypography:o=!1,inset:a=!1,primary:s,primaryTypographyProps:l,secondary:c,secondaryTypographyProps:u}=n,d=eS(n,HT),{dense:f}=hx.useContext(TT);let h=null!=s?s:r,p=c;const m=Qx({},n,{disableTypography:o,inset:a,primary:!!h,secondary:!!p,dense:f}),g=(e=>{const{classes:t,inset:n,primary:r,secondary:i,dense:o}=e;return hE({root:["root",n&&"inset",o&&"dense",r&&i&&"multiline"],primary:["primary"],secondary:["secondary"]},VT,t)})(m);return null==h||h.type===RN||o||(h=QM.jsx(RN,Qx({variant:f?"body2":"body1",className:g.primary,component:null!=l&&l.variant?void 0:"span",display:"block"},l,{children:h}))),null==p||p.type===RN||o||(p=QM.jsx(RN,Qx({variant:"body2",className:g.secondary,color:"text.secondary",display:"block"},u,{children:p}))),QM.jsxs(BT,Qx({className:Ck(g.root,i),ownerState:m,ref:t},d,{children:[h,p]}))});function YT(e){return Tk("MuiPopover",e)}Dk("MuiPopover",["root","paper"]);const GT=["onEntering"],KT=["action","anchorEl","anchorOrigin","anchorPosition","anchorReference","children","className","container","elevation","marginThreshold","open","PaperProps","slots","slotProps","transformOrigin","TransitionComponent","transitionDuration","TransitionProps","disableScrollLock"],XT=["slotProps"];function JT(e,t){let n=0;return"number"==typeof t?n=t:"center"===t?n=e.height/2:"bottom"===t&&(n=e.height),n}function ZT(e,t){let n=0;return"number"==typeof t?n=t:"center"===t?n=e.width/2:"right"===t&&(n=e.width),n}function QT(e){return[e.horizontal,e.vertical].map(e=>"number"==typeof e?`${e}px`:e).join(" ")}function eD(e){return"function"==typeof e?e():e}const tD=EC(yT,{name:"MuiPopover",slot:"Root",overridesResolver:(e,t)=>t.root})({}),nD=EC(hN,{name:"MuiPopover",slot:"Paper",overridesResolver:(e,t)=>t.paper})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),rD=hx.forwardRef(function(e,t){var n,r,i;const o=DC({props:e,name:"MuiPopover"}),{action:a,anchorEl:s,anchorOrigin:l={vertical:"top",horizontal:"left"},anchorPosition:c,anchorReference:u="anchorEl",children:d,className:f,container:h,elevation:p=8,marginThreshold:m=16,open:g,PaperProps:y={},slots:v,slotProps:b,transformOrigin:x={vertical:"top",horizontal:"left"},TransitionComponent:S=NT,transitionDuration:M="auto",TransitionProps:{onEntering:w}={},disableScrollLock:k=!1}=o,E=eS(o.TransitionProps,GT),C=eS(o,KT),N=null!=(n=null==b?void 0:b.paper)?n:y,T=hx.useRef(),D=Qk(T,N.ref),q=Qx({},o,{anchorOrigin:l,anchorReference:u,elevation:p,marginThreshold:m,externalPaperSlotProps:N,transformOrigin:x,TransitionComponent:S,transitionDuration:M,TransitionProps:E}),O=(e=>{const{classes:t}=e;return hE({root:["root"],paper:["paper"]},YT,t)})(q),I=hx.useCallback(()=>{if("anchorPosition"===u)return c;const e=eD(s),t=(e&&1===e.nodeType?e:Wk(T.current).body).getBoundingClientRect();return{top:t.top+JT(t,l.vertical),left:t.left+ZT(t,l.horizontal)}},[s,l.horizontal,l.vertical,c,u]),A=hx.useCallback(e=>({vertical:JT(e,x.vertical),horizontal:ZT(e,x.horizontal)}),[x.horizontal,x.vertical]),_=hx.useCallback(e=>{const t={width:e.offsetWidth,height:e.offsetHeight},n=A(t);if("none"===u)return{top:null,left:null,transformOrigin:QT(n)};const r=I();let i=r.top-n.vertical,o=r.left-n.horizontal;const a=i+t.height,l=o+t.width,c=Yk(eD(s)),d=c.innerHeight-m,f=c.innerWidth-m;if(null!==m&&i<m){const e=i-m;i-=e,n.vertical+=e}else if(null!==m&&a>d){const e=a-d;i-=e,n.vertical+=e}if(null!==m&&o<m){const e=o-m;o-=e,n.horizontal+=e}else if(l>f){const e=l-f;o-=e,n.horizontal+=e}return{top:`${Math.round(i)}px`,left:`${Math.round(o)}px`,transformOrigin:QT(n)}},[s,u,I,A,m]),[L,P]=hx.useState(g),R=hx.useCallback(()=>{const e=T.current;if(!e)return;const t=_(e);null!==t.top&&(e.style.top=t.top),null!==t.left&&(e.style.left=t.left),e.style.transformOrigin=t.transformOrigin,P(!0)},[_]);hx.useEffect(()=>(k&&window.addEventListener("scroll",R),()=>window.removeEventListener("scroll",R)),[s,k,R]);hx.useEffect(()=>{g&&R()}),hx.useImperativeHandle(a,()=>g?{updatePosition:()=>{R()}}:null,[g,R]),hx.useEffect(()=>{if(!g)return;const e=function(e,t=166){let n;function r(...r){clearTimeout(n),n=setTimeout(()=>{e.apply(this,r)},t)}return r.clear=()=>{clearTimeout(n)},r}(()=>{R()}),t=Yk(s);return t.addEventListener("resize",e),()=>{e.clear(),t.removeEventListener("resize",e)}},[s,g,R]);let F=M;"auto"!==M||S.muiSupportAuto||(F=void 0);const z=h||(s?Wk(eD(s)).body:void 0),j=null!=(r=null==v?void 0:v.root)?r:tD,$=null!=(i=null==v?void 0:v.paper)?i:nD,V=vE({elementType:$,externalSlotProps:Qx({},N,{style:L?N.style:Qx({},N.style,{opacity:0})}),additionalProps:{elevation:p,ref:D},ownerState:q,className:Ck(O.paper,null==N?void 0:N.className)}),U=vE({elementType:j,externalSlotProps:(null==b?void 0:b.root)||{},externalForwardedProps:C,additionalProps:{ref:t,slotProps:{backdrop:{invisible:!0}},container:z,open:g},ownerState:q,className:Ck(O.root,f)}),{slotProps:H}=U,B=eS(U,XT);return QM.jsx(j,Qx({},B,!pE(j)&&{slotProps:H,disableScrollLock:k},{children:QM.jsx(S,Qx({appear:!0,in:g,onEntering:(e,t)=>{w&&w(e,t),R()},onExited:()=>{P(!1)},timeout:F},E,{children:QM.jsx($,Qx({},V,{children:d}))}))}))});function iD(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function oD(e,t,n,r,i,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(r,i)}function aD(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 r=n.call(e,t);if("object"!=typeof r)return r;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 sD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function lD(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?sD(Object(n),!0).forEach(function(t){aD(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sD(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function cD(){
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var l=r&&r.prototype instanceof s?r:s,c=Object.create(l.prototype);return uD(c,"_invoke",function(n,r,i){var o,s,l,c=0,u=i||[],d=!1,f={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,s=0,l=e,f.n=n,a}};function h(n,r){for(s=n,l=r,t=0;!d&&c&&!i&&t<u.length;t++){var i,o=u[t],h=f.p,p=o[2];n>3?(i=p===r)&&(l=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=n<2&&h<o[1])?(s=0,f.v=r,f.n=o[1]):h<p&&(i=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,f.n=p,s=0))}if(i||n>1)return a;throw d=!0,r}return function(i,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&h(u,p),s=u,l=p;(t=s<2?e:l)||!d;){o||(s?s<3?(s>1&&(f.n=-1),h(s,l)):f.n=l:f.v=l);try{if(c=2,o){if(s||(i="next"),t=o[i]){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 '"+i+"' method"),s=1);o=e}else if((t=(d=f.n<0)?l:n.call(r,f))!==a)break}catch(t){o=e,s=1,l=t}finally{c=1}}return{value:t,done:d}}}(n,i,o),!0),c}var a={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(uD(t={},r,function(){return this}),t),d=c.prototype=s.prototype=Object.create(u);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,uD(e,i,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,uD(d,"constructor",c),uD(c,"constructor",l),l.displayName="GeneratorFunction",uD(c,i,"GeneratorFunction"),uD(d),uD(d,i,"Generator"),uD(d,r,function(){return this}),uD(d,"toString",function(){return"[object Generator]"}),(cD=function(){return{w:o,m:f}})()}function uD(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}uD=function(e,t,n,r){function o(t,n){uD(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},uD(e,t,n,r)}function dD(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 r,i,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t);else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,t)||pD(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 fD(e){return function(e){if(Array.isArray(e))return iD(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||pD(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 hD(e){return hD="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},hD(e)}function pD(e,t){if(e){if("string"==typeof e)return iD(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)?iD(e,t):void 0}}function mD(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var gD,yD,vD={exports:{}},bD={},xD=(yD||(yD=1,vD.exports=function(){if(gD)return bD;gD=1;var e=px,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function a(e,n,a){var s,l={},c=null,u=null;for(s in void 0!==a&&(c=""+a),void 0!==n.key&&(c=""+n.key),void 0!==n.ref&&(u=n.ref),n)r.call(n,s)&&!o.hasOwnProperty(s)&&(l[s]=n[s]);if(e&&e.defaultProps)for(s in n=e.defaultProps)void 0===l[s]&&(l[s]=n[s]);return{$$typeof:t,type:e,key:c,ref:u,props:l,_owner:i.current}}return bD.Fragment=n,bD.jsx=a,bD.jsxs=a,bD}()),vD.exports),SD=function(e){var t=e.className,n=e.title,r=e.path,i=e.fillRule;return xD.jsxs(AC,{className:t,viewBox:"0 0 16 16",fontSize:"small",role:"img",style:{height:12,width:12},children:[xD.jsx("path",{d:r}),n?xD.jsx("title",{children:n}):void 0,i?xD.jsx("use",{fillRule:i}):void 0]})},MD={STYLE:{ELLIPSIS:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},FOCUS:{boxShadow:"inset 0 0 0 2px #177FE6"},ICONS:{COLOR:{PRIMARY:"rgba(89, 89, 89)",SECONDARY:"rgba(89, 89, 89, 0.8)",DISABLED:"rgba(89, 89, 89, 0.4)"}}}},wD={L:new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼ‎ⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗＡ-Ｚａ-ｚｦ-ￜ]"),R:new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞‏יִײַ-ﬨשׁ-ﭏ]"),AL:new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]")},kD=function(e){return wD.L.test(e)},ED=function(e){return wD.R.test(e)||wD.AL.test(e)};function CD(e){for(var t,n=e?e.length:0,r=0;r<n;r++){if(t=e[r],kD(t))return"ltr";if(ED(t))return"rtl"}return"ltr"}var ND,TD,DD,qD,OD=EC(tT,{shouldForwardProp:function(e){return"direction"!==e&&"padding"!==e&&"styling"!==e}})(function(e){var t=e.direction,n=e.padding,r=e.styling,i=r.fontSize,o=r.fontFamily,a=r.color;return{fontWeight:"normal",lineHeight:"normal",fontSize:"".concat(i," !important"),fontFamily:"".concat(o," !important"),color:"".concat(a," !important"),height:"100%",minWidth:"0px",maxWidth:"640px",padding:n,"&:disabled":{color:a,opacity:1},"& .MuiButton-startIcon":{margin:"ltr"===t?"0 2px":void 0},"& .MuiButton-endIcon":{margin:"rtl"===t?"0 2px":void 0}}}),ID=EC(function(e){var t=e.className;return xD.jsx(SD,{className:t,path:"M13,7 L8,7 L13,7 L13,4.98151367 C13,2.23029964 10.7614237,0 8,0 C5.23857625,0 3,2.23029964 3,4.98151367 L3,7 L3.75,7 L3,7 L4.5,7 L4.5,5.33193359 C4.5,3.21561511 5.54860291,1.5 8,1.5 C10.4513971,1.5 11.5,3.21561511 11.5,5.33193359 L11.5,7 L12.25,7 L3,7 C2.44771525,7 2,7.44771525 2,8 L2,15 C2,15.5522847 2.44771525,16 3,16 L13,16 C13.5522847,16 14,15.5522847 14,15 L14,8 C14,7.44771525 13.5522847,7 13,7 L3,7 L13,7 Z",fillRule:"evenodd"})})(function(){return{color:MD.STYLE.ICONS.COLOR.SECONDARY,marginTop:"1px"}}),AD=EC(function(e){var t=e.className;return xD.jsx(SD,{className:t,path:"m8 9 4.5-4.5L14 6l-4.5 4.5L8 12 2 6l1.5-1.5L8 9Z"})})(function(){return{color:MD.STYLE.ICONS.COLOR.SECONDARY,marginTop:"1px","&.disabled":{color:MD.STYLE.ICONS.COLOR.DISABLED,opacity:.6}}}),_D=function(e){var t=e.isOpen,n=e.onClick,r=e.popoverId,i=e.source,o=i.styling,a=i.info.text,s=i.layout.direction,l=i.meta,c=l.allowed,u=l.hasAlternatives,d=l.hasCyclic,f=l.hasMultiple,h=l.index,p=l.isCyclic,m=l.isLocked,g=i.resources.translator,y=i.services.focus,v=i.settings.isDisabled,b=i.state.inSelections,x=!(!c.change||!u),S=!(!c.reload||!p),M=(x||S)&&!b&&!v(),w={pointerEvents:M?"auto":"none"},k=function(e){var t=e.allowed,n=e.canChange,r=e.canReload,i=e.direction,o=e.hasCyclic,a=e.isLocked,s={top:"8px",right:"6px",bottom:"8px",left:"6px"};if(!e.hasMultiple)return"".concat(s.top," ").concat(s.right," ").concat(s.bottom," ").concat(s.left);var l=o&&t.reload;return"ltr"===i&&(a?s.left="0px":r||!n&&l?s.left="4px":n||(s.left="2px"),n||r||(s.right="0px")),"rtl"===i&&(a?s.right="0px":r||!n&&l?s.right="4px":n||(s.right="2px"),n||r||(s.left="0px")),"".concat(s.top," ").concat(s.right," ").concat(s.bottom," ").concat(s.left)}({allowed:c,canChange:x,canReload:S,direction:s,hasCyclic:d,hasMultiple:f,isLocked:m}),E=aD(aD({},"rtl"===s?"endIcon":"startIcon",m&&xD.jsx(ID,{height:12})),"rtl"===s?"startIcon":"endIcon",(x||S)&&xD.jsx(AD,{className:"".concat(b||v()?"disabled":"")})),C=hx.useRef(),N=hx.useRef();hx.useEffect(function(){t||y.shouldFor(h)&&(C.current.focus(),N.current.focusVisible())});var T=CD(a),D="Accessibility.".concat(M?"Alternative":"Normal",".Instructions");return xD.jsx(OD,lD(lD({action:N,"aria-describedby":r,"aria-label":g.get(D),color:"inherit",direction:s,disabled:!M||v()||b,onClick:function(e){M&&n(e)},padding:k,ref:C,style:w,styling:o.title,title:a},E),{},{children:xD.jsx("span",{dir:T,style:MD.STYLE.ELLIPSIS,children:a})}))},LD=function(e){var t=e.className,n=e.title;return xD.jsx(SD,{className:t,title:n,path:"M 6 2 h 10 V 1 H 6 Z m 5 5 h 5 V 6 h -5 Z m 5 5 h -5 v -1 h 5 Z M 5 10 h 1 v 2.663 a 3.5 3.5 0 1 0 -2.922 0.036 l -0.406 0.914 A 4.501 4.501 0 1 1 7.329 13 H 9 v 1 H 5 Z"})},PD=EC(tT,{shouldForwardProp:function(e){return"direction"!==e&&"isFirst"!==e&&"isLast"!==e&&"styling"!==e}})(function(e){var t=e.direction,n=e.isFirst,r=e.isLast,i=e.styling.color;return{fontWeight:"normal",lineHeight:"normal",color:i,height:"24px",width:"24px",padding:0,marginLeft:"ltr"!==t||n?void 0:"4px",marginRight:"rtl"!==t||r?void 0:"4px","&:disabled":{color:i,opacity:1}}}),RD=EC(LD,{shouldForwardProp:function(e){return"direction"!==e&&"isFirst"!==e&&"isLast"!==e}})(function(e){var t=e.direction,n=e.isFirst,r=e.isLast;return{color:MD.STYLE.ICONS.COLOR.PRIMARY,marginTop:"1px",marginLeft:"ltr"!==t||n?void 0:"4px",marginRight:"rtl"!==t||r?void 0:"4px"}}),FD=EC(function(e){var t=e.className,n=e.title;return xD.jsx(SD,{className:t,title:n,path:"M1 8a7 7 0 1 1 10 6.326V11h-1v5h5v-1h-3.124A8 8 0 1 0 8 16v-1a7 7 0 0 1-7-7Z"})},{})(function(){return{color:MD.STYLE.ICONS.COLOR.SECONDARY,"&.disabled":{color:MD.STYLE.ICONS.COLOR.DISABLED}}}),zD=function(e){var t=e.source;if(!t.meta.isCyclic)return null;var n=dD(hx.useState(!1),2),r=n[0],i=n[1],o=t.styling,a=t.action.stepCycle,s=t.info,l=s.position,c=s.tooltip,u=t.layout.direction,d=t.meta,f=d.allowed,h=d.isFirst,p=d.isLast,m=t.settings.isDisabled,g=t.state.inSelections;return hx.useEffect(function(){r&&i(!1)},[l]),f.reload?xD.jsx(PD,{direction:u,disabled:r||g||m(),isFirst:h,isLast:p,onClick:function(){return i(!0),void a()},styling:o.title,title:c,variant:"outlined",children:xD.jsx(FD,{className:"".concat(r||g||m()?"disabled":"")})}):xD.jsx(RD,{direction:u,isFirst:h,isLast:p,style:{flexShrink:0},title:c})},jD=function(e){var t=e.className,n=e.title;return xD.jsx(SD,{className:t,title:n,path:"M7 4h9v1H7V4ZM9 8h7v1H9V8ZM11 12h5v1h-5v-1ZM1 4v3.526a3.5 3.5 0 0 0 3.5 3.5h2.31L5.22 9.402l.715-.7L8.7 11.527 5.935 14.35l-.714-.7 1.59-1.624H4.5a4.5 4.5 0 0 1-4.5-4.5V4h1Z"})},$D=EC(tT,{shouldForwardProp:function(e){return"styling"!==e}})(function(e){var t=e.styling,n=t.fontSize,r=t.fontFamily,i=t.color;return{fontWeight:"normal",lineHeight:"normal",fontSize:"".concat(n," !important"),fontFamily:"".concat(r," !important"),color:"".concat(i," !important"),padding:"0px 5px",height:"100%",minWidth:"45px","&:disabled":{color:i}}}),VD={color:MD.STYLE.ICONS.COLOR.SECONDARY,marginTop:"1px","&.disabled":{color:MD.STYLE.ICONS.COLOR.DISABLED}},UD=EC(function(e){var t=e.className;return xD.jsx(SD,{className:t,path:"M8.5 8 4 3.5 5.5 2l6 6-6 6L4 12.5 8.5 8z"})})(function(){return VD}),HD=EC(function(e){var t=e.className;return xD.jsx(SD,{className:t,path:"m7 8 4.5 4.5L10 14 4 8l6-6 1.5 1.5z"})})(function(){return VD}),BD=EC(jD,{shouldForwardProp:function(e){return"direction"!==e&&"isFirst"!==e&&"isLast"!==e}})(function(e){var t=e.direction,n=e.isFirst,r=e.isLast;return{color:MD.STYLE.ICONS.COLOR.PRIMARY,marginTop:"1px",marginLeft:"ltr"!==t||n?void 0:"4px",marginRight:"rtl"!==t||r?void 0:"4px"}}),WD=function(e){var t=e.source;if(!t.meta.isDrillDown)return null;var n=t.styling,r=t.action.drillUp,i=t.info,o=i.breadcrumbs,a=i.tooltip,s=t.layout.direction,l=t.meta,c=l.isFirst,u=l.isLast,d=t.settings.isDisabled,f=t.state.inSelections,h=d()||f?"disabled":null,p=aD({},"rtl"===s?"startIcon":"endIcon","rtl"===s?xD.jsx(HD,{className:h}):xD.jsx(UD,{className:h})),m=o.map(function(e,t){var i=CD(e);return xD.jsx($D,lD(lD({disabled:d()||f,onClick:function(){return function(e){r({steps:o.length-e})}(t)},styling:n.title,title:e},p),{},{children:xD.jsx("span",{dir:i,style:MD.STYLE.ELLIPSIS,children:e})}),"breadcrumb-".concat(e))});return xD.jsxs(xD.Fragment,{children:["rtl"===s?m.reverse():void 0,xD.jsx(BD,{direction:s,isFirst:c,isLast:u,style:{flexShrink:0},title:a}),"rtl"===s?void 0:m]})},YD=EC(RT,{shouldForwardProp:function(e){return"nested"!==e&&"rtl"!==e}})(function(e){var t=e.nested,n=e.rtl;return{padding:"4px ".concat(t&&n?"32px":"16px"," 4px ").concat(t&&!n?"32px":"16px"),"&:focus":lD({},MD.STYLE.FOCUS)}}),GD=EC($T)(function(){return{marginRight:0,justifyContent:"center"}}),KD=EC(function(e){var t=e.className;return xD.jsx(SD,{className:t,path:"m6 10 7-7 2 2-7 7-2 2-5-5 2-2 3 3Z"})})(function(){return{color:MD.STYLE.ICONS.COLOR.SECONDARY}}),XD=EC(LD)(function(){return{color:MD.STYLE.ICONS.COLOR.SECONDARY}}),JD=EC(jD)(function(){return{color:MD.STYLE.ICONS.COLOR.SECONDARY,fontWeight:600}}),ZD=function(e){var t=e.meta;return e.selected?xD.jsx(KD,{height:12}):null!=t&&t.isCyclic?xD.jsx(XD,{height:12}):null!=t&&t.isDrillDown?xD.jsx(JD,{height:12}):void 0},QD=function(e){var t=e.id,n=e.meta,r=e.nested,i=e.onClick,o=e.selected,a=e.source,s=e.text,l=a.styling,c=a.settings.isRTL,u=lD({fontWeight:!n||n.isNormal?"normal":600,lineHeight:"normal",fontSize:l.popover.fontSize,fontFamily:l.popover.fontFamily,color:l.popover.color,textAlign:c?"end":"start"},MD.STYLE.ELLIPSIS),d=CD(s),f=xD.jsx(GD,{sx:c?{paddingRight:"12px"}:{paddingLeft:"12px"},children:ZD({meta:n,selected:o})});return xD.jsx(px.Fragment,{children:xD.jsxs(YD,{autoFocus:o,nested:r,onClick:function(e){return null==i?void 0:i(e)},rtl:c,title:s,children:[c&&f,xD.jsx(WT,{dir:d,primaryTypographyProps:{style:u},children:s}),!c&&f]})},t)},eq=EC(MT)(function(){return{marginTop:"-1px"}}),tq=function(e){var t=e.anchor,n=e.id,r=e.onClose,i=e.open,o=e.source,a=o.action,s=a.changeTo,l=a.drillUp,c=a.setActiveField,u=o.info,d=u.breadcrumbs,f=u.group,h=u.id,p=u.text,m=o.data.alternatives,g=o.meta,y=g.index,v=g.isCyclic,b=g.isDrillDown,x=o.resources.translator,S=o.services.focus,M={isChanging:!1},w=hx.useRef(),k=function(){var e,t=document.activeElement;null!=w&&null!==(e=w.current)&&void 0!==e&&e.contains(t)&&t.blur(),r()},E=v||b,C=xD.jsx(QD,{id:h,meta:o.meta,onClick:k,selected:!E,source:o,text:E?f.name:p},h),N=E&&f.items.map(function(e){return xD.jsx(QD,{id:e.id,nested:!0,onClick:function(t){return function(e,t){M.isChanging||(M.isChanging=!0,"keydown"!==e.type&&"keyup"!==e.type||S.queueFor(y),v&&c({fieldIndex:t.index}),b&&l({steps:d.length-t.index}))}(t,e)},selected:e.current,source:o,text:e.text})}),T=m.map(function(e,t){return xD.jsxs(px.Fragment,{children:[xD.jsx(QD,{id:e.id,meta:e.meta,onClick:function(t){return n=t,r=e.id,void(M.isChanging||(M.isChanging=!0,"keydown"!==n.type&&"keyup"!==n.type||S.queueFor(y),s({id:r})));var n,r},source:o,text:e.text},e.id),t<m.length-1&&xD.jsx(eq,{},"divider-".concat(e.id))]},e.id)});return xD.jsx(rD,{anchorEl:t,anchorOrigin:{vertical:"top",horizontal:"center"},disableRestoreFocus:!0,id:n,onClose:k,open:i,ref:w,slotProps:{paper:{style:{minWidth:"250px",maxWidth:"640px",maxHeight:"300px"}}},transformOrigin:{vertical:"bottom",horizontal:"center"},children:xD.jsxs(IT,{"aria-label":x.get("Accessibility.Popover.Instructions"),dense:!0,children:[C,N,xD.jsx(eq,{},"divider-".concat(h)),T]})})},nq=function(e){var t=e.source,n=dD(hx.useState(null),2),r=n[0],i=n[1],o={id:r?"alternatives-popover":void 0,isOpen:Boolean(r)},a=t.layout.direction,s=t.meta.index,l=t.services.focus,c=function(){i(null)};hx.useEffect(function(){o.isOpen&&c()},[t.info.key]);var u=xD.jsx(zD,{source:t}),d=xD.jsx(WD,{source:t});return xD.jsxs(xD.Fragment,{children:["rtl"===a?void 0:d,"rtl"===a?void 0:u,xD.jsx(_D,{onClick:function(e){var t=e.currentTarget;t.classList.contains("qcm-focus-visible")&&l.queueFor(s),i(t)},isOpen:o.isOpen,popoverId:o.id,source:t}),xD.jsx(tq,{anchor:r,id:o.id,onClose:c,open:o.isOpen,source:t}),"rtl"===a?d:void 0,"rtl"===a?u:void 0]})},rq=function(){if(TD)return ND;TD=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=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 r,i=e.call(n,"constructor"),o=n.constructor&&n.constructor.prototype&&e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!i&&!o)return!1;for(r in n);return void 0===r||e.call(n,r)},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(r)return r(t,n).value}return t[n]};return ND=function e(){var t,n,r,l,c,u,d=arguments[0],f=1,h=arguments.length,p=!1;for("boolean"==typeof d&&(p=d,d=arguments[1]||{},f=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});f<h;++f)if(null!=(t=arguments[f]))for(n in t)r=s(d,n),d!==(l=s(t,n))&&(p&&l&&(o(l)||(c=i(l)))?(c?(c=!1,u=r&&i(r)?r:[]):u=r&&o(r)?r:{},a(d,{name:n,newValue:e(p,u,l)})):void 0!==l&&a(d,{name:n,newValue:l}));return d},ND}(),iq=mD(rq),oq={},aq=mD((DD||(DD=1,qD=oq,(()=>{var e={370:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},a=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var r,i=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!o)return!1;for(r in e);return void 0===r||t.call(e,r)},s=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},l=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(i)return i(e,n).value}return e[n]};e.exports=function e(){var t,n,r,i,c,u,d=arguments[0],f=1,h=arguments.length,p=!1;for("boolean"==typeof d&&(p=d,d=arguments[1]||{},f=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});f<h;++f)if(null!=(t=arguments[f]))for(n in t)r=l(d,n),d!==(i=l(t,n))&&(p&&i&&(a(i)||(c=o(i)))?(c?(c=!1,u=r&&o(r)?r:[]):u=r&&a(r)?r:{},s(d,{name:n,newValue:e(p,u,i)})):void 0!==i&&s(d,{name:n,newValue:i}));return d}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};n.r(r),n.d(r,{default:()=>Te});var i=n(370),o=n.n(i);const a=function(e,t,n){if(!t)return!1;var r,i=t.split("."),o=i[i.length-1],a=e;for(r=0;r<i.length-1;++r)void 0===a[i[r]]&&(a[i[r]]=Number.isNaN(+i[r+1])?{}:[]),a=a[i[r]];if(void 0!==n){var s=a[o];return a[o]=n,{updated:n,previous:s}}return delete a[o],!1},s=function(e,t,n){var r,i=t.split("."),o=e;if(void 0===o)return n;for(r=0;r<i.length;++r){if(void 0===o[i[r]])return n;o=o[i[r]]}return o},l={EXPRESSIONS:{observed:"",trend:"STL_Trend",seasonal:"STL_Seasonal",residual:"STL_Residual"},OPTIONS:[{value:"observed",translation:"cao.trendDecomposition.parameters.decomposition.observed"},{value:"trend",translation:"cao.trendDecomposition.parameters.decomposition.trend"},{value:"seasonal",translation:"cao.trendDecomposition.parameters.decomposition.seasonal"},{value:"residual",translation:"cao.trendDecomposition.parameters.decomposition.residual"}]};var c="".concat(" ","(").concat("　"),u="".concat("　",")").concat(" ");function d(e){return c+e+u}function f(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.qLibraryId){var n=function(e,t){if(!t)return null;var n,r;for(n=0;n<t.length;n++)if((r=t[n]).qInfo.qId===e)return r;return null}(e.qLibraryId,t.dimensionList);return n&&n.qData.info[0].qTags.indexOf("$numeric")>-1}var r=function(e,t){if(!t)return null;var n,r,i=function(e){var t=e.trim();"="===t.charAt(0)&&(t=(t=t.substring(1)).trim());var n=t.length-1;return"["===t.charAt(0)&&"]"===t.charAt(n)&&(t=(t=t.substring(1,n)).trim()),t}(e);for(n=0;n<t.length;n++){if((r=t[n]).qName===i)return r;if(r.qDerivedFieldData)for(var o=0;o<r.qDerivedFieldData.qDerivedFieldLists.length;++o)for(var a=r.qDerivedFieldData.qDerivedFieldLists[o],s=0;s<a.qFieldDefs.length;++s){var l=a.qFieldDefs[s];if(l.qName===i)return l}}return null}(e.qDef.qFieldDefs[0],t.fieldList);return r&&r.qTags.indexOf("$numeric")>-1}function h(e){return!(!e.fullAccumulation&&!e.fullRange)}function p(e,t){var n=e.crossAllDimensions;return 2===t&&n?"RowNo(Total)":"RowNo()"}function m(e){var t=function(e){return e?(e=function(e){return e.replace(/\/\*[^]*?\*\//g,"")}(e=function(e){return e.replace(/\/\/(.*)$/gm,"")}(e))).trim():""}(e),n=t.trim();return"="===n.substring(0,1)?n.substring(1).trim():n}function g(){return"[$(=Replace(GetObjectField(".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,"),']',']]'))]")}function y(e,t){var n=e.crossAllDimensions;return 2===t&&n?"Above(Total ":"Above("}function v(e){return void 0===e?")":", 0, ".concat(e,")")}function b(e){return"Replace(Replace(".concat(e,",'''',''''''),'$','$''&''')")}function x(e,t){return e?"".concat(t,'={">=$(=Min(').concat(t,"))<=$(=Max(").concat(t,'))"}'):"".concat(t,'={"=Only({1}').concat(t,")>='$(=").concat(b("MinString(".concat(t,")")),")' and Only({1}").concat(t,")<='$(=").concat(b("MaxString(".concat(t,")")),")'\"}")}function S(e){var t=e.modifier,n=void 0===t?{}:t,r=e.dimensions,i=e.dimensionAndFieldList,o=e.funcComp,a=void 0===o?"Sum":o,s=e.valueComp,l=void 0===s?"0":s;if(!n.showExcludedValues)return"";if(r&&1===r.length){var c=x(f(r[0],i),g(0));return"".concat(a,"({1<").concat(c,">}").concat(l,")")}if(r&&2===r.length){var u=f(r[0],i),d=f(r[1],i),h=g(0),p=g(1),m=x(u,h),y=x(d,p);return"".concat(a,"({1<").concat(m,",").concat(y,">}").concat(l,")")}return"".concat(a,"({1}").concat(l,")")}function M(e){return"".concat(e,"(")}function w(e){var t=e.properties,n=e.layout;return s(t,"qHyperCubeDef.qDimensions",s(n,"qHyperCube.qDimensionInfo",[])).length}const k={isFullRange:h,getNumDimensions:w,getExpressionWithExcludedComp:function(e){var t=e.expression,n=e.modifier,r=e.dimensions,i=e.dimensionAndFieldList,o=e.treatMissingAsNull,a=d(m(t));if(!n.showExcludedValues)return a;var s=S({modifier:n,dimensions:r,dimensionAndFieldList:i}),l=o?"":", 0";if(r&&1===r.length){var c=g(0);return"If(Count(".concat(c,") > 0, ").concat(a," + ").concat(s).concat(l,")")}if(r&&2===r.length){var u=g(0),f=g(1);return"If(Count(".concat(u,") * Count(").concat(f,") > 0, ").concat(a," + ").concat(s).concat(l,")")}return a},getRowNoComp:p,getNumStepComp:function(e,t){if(!h(e)){var n=e.steps;return"number"!=typeof n||Number.isNaN(n)?6:n}return p(e,t)},getAboveCompPrefix:y,getAboveCompSuffix:v,getAboveComp:function(e,t,n,r){return y(e,t)+n+v(r)},getFunctionPrefix:M,getFunctionSuffix:function(){return")"},getRangeComp:function(e,t){return M(e)+t+")"},getAggrComp:function(e,t,n){return"Aggr(".concat(e,", ").concat(t,", ").concat(n,")")},getExcludedComp:S,needDimension:function(e){var t=e.modifier,n=e.properties,r=e.layout;return 0===function(e){return void 0===e.primaryDimension?e.accumulationDimension:e.primaryDimension}(t)&&2===w({properties:n,layout:r})},getDimComp:function(e,t){var n=function(e){return e[arguments.length>1&&void 0!==arguments[1]?arguments[1]:0].qDef.qSortCriterias[0]}(e,t),r=g(t);if(!n.qSortByExpression&&!n.qSortByNumeric&&!n.qSortByAscii)return r;var i=["Descending","Ascending"],o=n.qSortByNumeric?"(Numeric, ".concat(i[(n.qSortByNumeric+1)/2],")"):"",a=n.qSortByAscii?"(Text, ".concat(i[(n.qSortByAscii+1)/2],")"):"";return n.qSortByNumeric&&n.qSortByAscii?"(".concat(r,", ").concat(o,", ").concat(a,")"):n.qSortByNumeric?"(".concat(r,", ").concat(o,")"):n.qSortByAscii?"(".concat(r,", ").concat(a,")"):r},simplifyExpression:m,extractInputExpression:function(e){var t=e.outputExpression;if(e.modifier){var n=t.indexOf(c);if(-1!==n){var r=t.indexOf(u);if(-1!==r)return t.substring(n+c.length,r)}}},initModifier:function(e,t){Object.keys(t).forEach(function(n){void 0===e[n]&&(e[n]=t[n])})},isNumeric:f,isApplicable:function(e){var t=e.properties,n=e.layout,r=e.minDimensions,i=void 0===r?1:r,o=e.maxDimensions,a=void 0===o?2:o;if(!t&&!n)return!0;var s=w({properties:t,layout:n});return s>=i&&s<=a},getExpressionWithMarkers:d,canExtract:function(e){var t=e.indexOf(c),n=e.indexOf(u);return t>-1&&n>-1&&t<n},getDimDefWithWrapper:g,getFieldWithWrapper:function(e){var t=e?e.replace(/]/g,"]]"):e;return"[".concat(t,"]")},generateTSDExpression:function(e,t,n){var r=t||e.outputExpression;if(e.base&&e.base.qDef&&(r=t!==e.base.qDef?t:e.base.qDef),"observed"!==e.decomposition){var i=n.qHyperCubeDef.qMeasures.find(function(t){return t.qDef.base&&t.qDef.base.qLibraryId&&e.base&&e.base.qLibraryId?t.qDef.base.qLibraryId===e.base.qLibraryId:null});i&&t!==i.qDef.qLabel&&(r=i.qLibraryId||i.qDef.base.qLibraryId?"[".concat(i.qDef.qLabel,"]"):i.qDef.base.qDef);var o=function(e){var t=l.OPTIONS.find(function(t){return t.value===e.decomposition});return t?l.EXPRESSIONS[t.value]:""}(e);r=r.startsWith("=")?r.substr(1):r,r="".concat(o,"(").concat(r,", ").concat(e.steps,")")}return r},getDecomposition:function(e){var t="observed";return Object.values(l.EXPRESSIONS).find(function(n){var r=e.qDef.base.qDef.toLowerCase()||e.qDef.qDef.toLowerCase();return l.EXPRESSIONS[n]&&r.includes(l.EXPRESSIONS[n].toLowerCase())&&(t=n),n}),t}};function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function C(e){return C="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},C(e)}var N=o().bind(null,!0),T={},D=Array.isArray;function q(e){return null!=e&&!Array.isArray(e)&&"object"===C(e)}function O(e){return void 0===e}function I(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function A(e,t){var n,r=t.substring(1).split("/").slice(0,-1);return r.forEach(function(t,i){if(i!==r.length){n=+t;var o=Number.isNaN(n)?{}:[];e[n||t]=O(e[n||t])?o:e[t],e=e[n||t]}}),e}function _(e,t){var n=!0;if(q(e)&&q(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach(function(r){_(e[r],t[r])||(n=!1)}),n);if(D(e)&&D(t)){if(e.length!==t.length)return!1;for(var r=0,i=e.length;r<i;r+=1)if(!_(e[r],t[r]))return!1;return!0}return e===t}T.generate=function(e,t,n){n=n||"";var r=[];return Object.keys(t).forEach(function(i){var o=function(e){return e?N({},{val:e}).val:e}(t[i]),a=e[i],s="".concat(n,"/").concat(i);_(o,a)||I(t,i)||(O(a)?r.push({op:"add",path:s,value:o}):q(o)&&q(a)?r=r.concat(T.generate(a,o,s)):D(o)&&D(a)?r=r.concat(function(e,t,n){var r=[],i=e.slice(),o=-1;function a(e,t,n){if(e[n]&&O(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(var r=0,i=e.length;r<i;r+=1)if(e[r]&&e[r].qInfo.qId===t)return r;return-1}if(_(t,i))return r;if(!O(t[0])&&O(t[0].qInfo))return r.push({op:"replace",path:n,value:t}),r;for(var s=i.length-1;s>=0;s-=1)-1===(o=a(t,i[s].qInfo&&i[s].qInfo.qId,s))?(r.push({op:"remove",path:"".concat(n,"/").concat(s)}),i.splice(s,1)):r=r.concat(T.generate(i[s],t[o],"".concat(n,"/").concat(s)));for(var l=0,c=t.length;l<c;l+=1)-1===(o=a(i,t[l].qInfo&&t[l].qInfo.qId))?(r.push({op:"add",path:"".concat(n,"/").concat(l),value:t[l]}),i.splice(l,0,t[l])):o!==l&&(r.push({op:"move",path:"".concat(n,"/").concat(l),from:"".concat(n,"/").concat(o)}),i.splice(l,0,i.splice(o,1)[0]));return r}(a,o,s)):r.push({op:"replace",path:"".concat(n,"/").concat(i),value:o}))}),Object.keys(e).forEach(function(i){O(t[i])&&!I(e,i)&&r.push({op:"remove",path:"".concat(n,"/").concat(i)})}),r},T.apply=function(e,t){t.forEach(function(t){var n,r,i=A(e,t.path),o=t.path.split("/").splice(-1)[0],a=o&&Number.isNaN(+o)?i[o]:i[+o]||i,s=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(i=null,a=e),"add"===t.op||"replace"===t.op)if(D(i))"-"===o&&(o=i.length),i.splice(+o,"add"===t.op?0:1,t.value);else if(D(a)&&D(t.value)){var l,c=t.value.slice();a.length=0,(l=a).push.apply(l,function(e){if(Array.isArray(e))return E(e)}(r=c)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||function(e,t){if(e){if("string"==typeof e)return E(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)?E(e,t):void 0}}(r)||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.")}())}else if(q(a)&&q(t.value))n=a,Object.keys(n).forEach(function(e){Object.getOwnPropertyDescriptor(n,e).configurable&&!I(n,e)&&delete n[e]}),N(a,t.value);else{if(!i)throw new Error("Patchee is not an object we can patch");i[o]=t.value}else if("move"===t.op){var u=A(e,t.from);D(i)?i.splice(+o,0,u.splice(+s,1)[0]):(i[o]=u[s],delete u[s])}else"remove"===t.op&&(D(i)?i.splice(+o,1):delete i[o])})},T.clone=function(e){return N({},e)},T.createPatch=function(e,t,n){var r={op:e.toLowerCase(),path:n};return"move"===r.op?r.from=t:void 0!==t&&(r.value=t),r},T.updateObject=function(e,t){Object.keys(e).length?T.apply(e,T.generate(e,t)):N(e,t)};const L=T;var P="accumulation";function R(e,t){var n=s(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===P)return n[r]}function F(e,t){var n=function(e,t){var n=s(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===P)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var z={type:"accumulation",disabled:!1,accumulationDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullAccumulation:!1,steps:6,outputExpression:""};const j={translationKey:"properties.modifier.accumulation",needDimension:k.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return k.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,o=e.numDimensions,a=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=k.getNumDimensions({properties:r,layout:i}));var c=s(r,"qHyperCubeDef.qDimensions",[]),u=k.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),d=k.getNumStepComp(n,l),f=k.getAboveComp(n,l,u,d),h=k.getRangeComp("RangeSum",f);if(k.needDimension({modifier:n,properties:r,layout:i})){var p=k.getDimComp(c,1),m=k.getDimComp(c,0),g=k.getAggrComp(h,p,m);h=n.showExcludedValues?k.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:a,valueComp:g}):g}return h},extractInputExpression:k.extractInputExpression,initModifier:function(e){k.initModifier(e,z)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.accumulation.disclaimer",show:function(e,t){return!k.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(F(t,e),".accumulationDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.accumulation.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map(function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}})},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(F(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.accumulation.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat(F(t,e),".fullAccumulation")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat(F(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=R(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=R(t,e);return n&&!n.fullAccumulation}},showExcludedValues:{refFn:function(t){return"".concat(F(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return k.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(P))return!1;var o=R(t,e);return o&&!o.disabled}}}};var $="movingAverage";function V(e,t){var n=s(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===$)return n[r]}function U(e,t){var n=function(e,t){var n=s(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===$)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var H={type:"movingAverage",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullRange:!1,steps:6,outputExpression:"",nullSuppression:!1};const B={translationKey:"properties.modifier.movingAverage",needDimension:k.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return k.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t,n=e.expression,r=e.modifier,i=e.properties,o=e.layout,a=e.numDimensions,l=e.dimensionAndFieldList;if(!r)return n;var c=a;void 0===c&&(c=k.getNumDimensions({properties:i,layout:o}));var u=s(i,"qHyperCubeDef.qDimensions",[]),d=r.showExcludedValues&&r.nullSuppression,f=k.getExpressionWithExcludedComp({expression:n,modifier:r,dimensions:u,dimensionAndFieldList:l,treatMissingAsNull:d}),h=k.getNumStepComp(r,c),p=k.getAboveComp(r,c,f,h);if(r.nullSuppression)t=k.getRangeComp("RangeAvg",p);else{var m=k.getRangeComp("RangeSum",p),g=function(e,t){var n=k.getRowNoComp(e,t);if(!k.isFullRange(e)){var r=e.steps,i="number"!=typeof r||Number.isNaN(r)?6:r;return"RangeMin(".concat(i,", ").concat(n,")")}return n}(r,c);t="".concat(m," / ").concat(g)}var y=t;if(k.needDimension({modifier:r,properties:i,layout:o})){var v=k.getDimComp(u,1),b=k.getDimComp(u,0),x=k.getAggrComp(y,v,b);y=r.showExcludedValues?k.getExcludedComp({modifier:r,dimensions:u,dimensionAndFieldList:l,funcComp:"Only",valueComp:x}):x}return y},extractInputExpression:k.extractInputExpression,initModifier:function(e){k.initModifier(e,H)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.movingAverage.disclaimer",show:function(e,t){return!k.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(U(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.movingAverage.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map(function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}})},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(U(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.movingAverage.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat(U(t,e),".fullRange")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat(U(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=V(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=V(t,e);return n&&!n.fullRange}},showExcludedValues:{refFn:function(t){return"".concat(U(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0},nullSuppression:{refFn:function(t){return"".concat(U(t,e),".nullSuppression")},type:"boolean",translation:t.showNull||"properties.dimensions.showNull",schemaIgnore:!0,defaultValue:!1,inverted:!0}},show:function(e,t){return k.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf($))return!1;var o=V(t,e);return o&&!o.disabled}}}};var W="timeSeriesDecomposition";function Y(e,t){var n=s(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===W)return n[r]}function G(e,t){var n=function(e,t){var n=s(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===W)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var K={type:"timeSeriesDecomposition",disabled:!1,decomposition:"",steps:2,outputExpression:""};const X={translationKey:"properties.modifier.timeSeriesDecomposition",needDimension:k.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return k.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties;return n?k.generateTSDExpression(n,t,r):t},extractInputExpression:k.extractInputExpression,initModifier:function(e,t){k.initModifier(e,K),""===e.decomposition&&t&&(e.decomposition=k.getDecomposition(t))},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{type:"items",items:{disclaimer:{component:"text",translation:t.timeSeriesDecomposition||"properties.modifier.timeSeriesDecomposition",show:function(e,t){return!k.isApplicable({properties:t.properties})}},settings:{type:"items",items:{decomposition:{refFn:function(t){return"".concat(G(t,e),".decomposition")},type:"string",translation:t.modifierTrendDecompositionDecomposition||"properties.modifier.trendDecomposition.decomposition",component:"dropdown",schemaIgnore:!0,defaultValue:t.trendDecompositionParametersDecompositionObserved||"cao.trendDecomposition.parameters.decomposition.observed",options:l.OPTIONS},steps:{refFn:function(t){return"".concat(G(t,e),".steps")},type:"integer",translation:t.modifierTimeSeriesDecompositionPeriods||"properties.modifier.timeSeriesDecomposition.periods",schemaIgnore:!0,defaultValue:2,change:function(t,n){var r=Y(t,e);if(r){var i=r.steps;r.steps="number"!=typeof i||Number.isNaN(i)?2:Math.abs(i),n.properties.qHyperCubeDef.qMeasures=n.properties.qHyperCubeDef.qMeasures.map(function(e){return e.qDef.modifiers.map(function(e){return"timeSeriesDecomposition"===e.type?e.steps=i:e.steps=e.steps,e}),e})}},show:function(t){var n=Y(t,e);return n&&!n.fullRange}}},show:function(e,t){return k.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(W))return!1;var o=Y(t,e);return o&&!o.disabled}}}};var J="difference";function Z(e,t){var n=function(e,t){var n=s(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===J)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var Q={type:"difference",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,outputExpression:""};const ee={translationKey:"properties.modifier.difference",needDimension:k.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return k.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:k.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,o=e.numDimensions,a=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=k.getNumDimensions({properties:r,layout:i}));var c=s(r,"qHyperCubeDef.qDimensions",[]),u=k.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),d=k.getAboveComp(n,l,u),f="".concat(u," - ").concat(d);if(k.needDimension({modifier:n,properties:r,layout:i})){var h=k.getDimComp(c,1),p=k.getDimComp(c,0),m=k.getAggrComp(f,h,p);f=n.showExcludedValues?k.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:a,funcComp:"Only",valueComp:m}):m}return f},initModifier:function(e){Object.keys(Q).forEach(function(t){void 0===e[t]&&(e[t]=Q[t])})},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.difference.disclaimer",show:function(e,t){return!k.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(Z(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.difference.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map(function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}})},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(Z(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.difference.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},showExcludedValues:{refFn:function(t){return"".concat(Z(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return k.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(J))return!1;var o=function(e,t){var n=s(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===J)return n[r]}(t,e);return o&&!o.disabled}}}};var te="normalization";function ne(e,t){var n=s(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===te)return n[r]}function re(e,t){var n=function(e,t){var n=s(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===te)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}function ie(e,t){for(var n=0;n<e.length;n++)if(e[n].value===t)return n;return-1}var oe={type:"normalization",disabled:!1,primaryDimension:0,outputExpression:"",dimensionalScope:2,selectionScope:2};function ae(e){return 2===e?"{1}":""}function se(e,t,n){return 1===e?"{$<".concat(k.getFieldWithWrapper(t),"={'").concat(n,"'}>}"):""}function le(e,t){return 0===e&&t>1||2===e?"Total":""}function ce(e,t,n){return 0===e&&t>1?"<".concat(k.getDimDefWithWrapper(n),">"):""}const ue={translationKey:"properties.modifier.normalization",needDimension:function(){return!0},isApplicable:function(e){var t=e.properties,n=e.layout;return k.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:k.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,o=e.numDimensions,a=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=k.getNumDimensions({properties:r,layout:i}));var c=s(r,"qHyperCubeDef.qDimensions",[]),u=k.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),d=n.selectionScope,f=n.dimensionalScope;return function(e,t,n,r,i,o,a,s){var l=ae(t),c=se(t,n,r),u=""===l&&""===c?"":l||c,d=le(i,o),f=ce(i,o,a),h=function(e){for(var t=[],n=0;n<e;n++)t[n]=k.getDimDefWithWrapper(n);return t.join(", ")}(o);return s?"(If(".concat(e," < 0, null(), ").concat(e,"))/ Sum(").concat(u," ").concat(d).concat(f," Aggr(").concat(u," RangeMax( 0, ").concat(e,"), ").concat(h,"))"):"".concat(e,"/ Sum(").concat(u," ").concat(d).concat(f," Aggr(").concat(u," ").concat(e,", ").concat(h,"))")}(u,d,n.field,n.value,f,l,n.primaryDimension,n.ignoreNegative)},initModifier:function(e){Object.keys(oe).forEach(function(t){void 0===e[t]&&(e[t]=oe[t])})},updateModifier:function(e,t){1===(t.qDimensions?t.qDimensions.length:0)&&0===e.dimensionalScope&&(e.dimensionalScope=2)},enableTotalsFunction:function(){return!0},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.normalization.disclaimer",show:function(e,t){return!k.isApplicable({properties:t.properties})}},settings:{type:"items",items:{selectionScope:{refFn:function(t){return"".concat(re(t,e),".selectionScope")},type:"string",translation:t.modifierSelectionScope||"properties.modifier.selectionScope",title:{translation:t.modifierSelectionScopeTooltip||"properties.modifier.selectionScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:2,options:function(n){return function(e,t,n){var r=[{value:0,translation:t.selectionScopeCurrentSelection||"properties.modifier.selectionScope.currentSelection"},{value:1,translation:t.selectionScopeSpecificValue||"properties.modifier.selectionScope.selectAField"},{value:2,translation:t.selectionScopeTotal||"properties.modifier.selectionScope.total"}];return r=function(e,t){if(1===e){var n=ie(t,0);t.splice(n,1)}return t}(ne(e,n).dimensionalScope,r),r}(n,t,e)}},field:{refFn:function(t){return"".concat(re(t,e),".field")},type:"string",component:"expression-with-dropdown",translation:"Common.Field",defaultValue:"",dropdownOnly:!0,options:function(e,t,n){return n.app.getFieldList().then(function(e){return e.map(function(e){return{label:e.qName,value:e.qName}})})},show:function(t){return 1===ne(t,e).selectionScope}},value:{refFn:function(t){return"".concat(re(t,e),".value")},type:"string",ref:"value",component:"string",translation:"properties.value",expression:"optional",show:function(t){return 1===ne(t,e).selectionScope}},dimensionalScope:{refFn:function(t){return"".concat(re(t,e),".dimensionalScope")},type:"string",translation:t.modifierDimensionalScope||"properties.modifier.dimensionalScope",title:{translation:t.modifierDimensionalScopeTooltip||"properties.modifier.dimensionalScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:2,supportTooltip:!0,options:function(n,r){return function(e,t,n,r){var i=t.layout.qHyperCube.qDimensionInfo.length,o=[{value:0,translation:n.dimensionalScopeOneDimension||"properties.modifier.dimensionalScope.respectOneDimension",tooltipTranslation:n.dimensionalScopeOneDimensionTooltip||"properties.modifier.dimensionalScope.respectOneDimension.tooltip"},{value:1,translation:n.dimensionalScopeAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension"),tooltipTranslation:n.dimensionalScopeAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension",".tooltip")},{value:2,translation:n.dimensionalScopeDisregardAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension"),tooltipTranslation:n.dimensionalScopeDisregardAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension",".tooltip")}];return o=function(e,t){if(e<2){var n=ie(t,0);t.splice(n,1)}return t}(i,o),o=function(e,t){if(0===e){var n=ie(t,1);t.splice(n,1)}return t}(ne(e,r).selectionScope,o),o}(n,r,t,e)}},primaryDimension:{refFn:function(t){return"".concat(re(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.normalization.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map(function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}})},show:function(t,n){return 0===(ne(t,e).dimensionalScope||0)&&n.layout.qHyperCube.qDimensionInfo.length>1}}},show:function(e,t){return k.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(te))return!1;var o=ne(t,e);return o&&!o.disabled}}},getDisregardSelectionComp:ae,getFieldSelectionComp:se,getTotalComp:le,getSelectedDimComp:ce};var de="library id deleted",fe="qDef.qDef",he="qDef.base.qDef",pe="qLibraryId",me="qDef.base.qLibraryId",ge="qDef.qLabel",ye="qDef.qLabelExpression",ve="qDef.base.qLabel",be="qDef.base.qLabelExpression",xe="qDef.qAggrFunc",Se="qDef.base.qAggrFunc",Me="qDef.base";const we={getExpression:function(e){var t=s(e,he);return void 0!==t?t:s(e,fe)},getExpressionRef:function(e){return void 0!==s(e,he)?he:fe},getLibraryIdRef:function(e){return s(e,me)?me:pe},getLibraryId:function(e){return s(e,me)||s(e,pe)},getLabelRef:function(e){return s(e,Me)?ve:ge},getLabelExpressionRef:function(e){return s(e,Me)?be:ye}};var ke={initBase:function(e,t){(t||ke.isValid(e))&&(a(e,he,s(e,fe)),a(e,me,s(e,pe)),a(e,ve,s(e,ge)),a(e,be,s(e,ye)))},restoreBase:function(e){ke.isValid(e)&&(a(e,fe,s(e,he)),a(e,pe,s(e,me)),a(e,ge,s(e,ve)),a(e,ye,s(e,be)),s(e,xe)&&s(e,Se)&&a(e,xe,s(e,Se)),delete e.qDef.base)},isValid:function(e){var t=s(e,he),n=s(e,me);return void 0!==t||void 0!==n}};const Ee=ke;function Ce(e){return Ce="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},Ce(e)}var Ne={accumulation:j,movingAverage:B,difference:ee,normalization:ue,timeSeriesDecomposition:X};const Te={modifiers:Ne,apply:qe,applyModifiers:Oe,cleanUpMeasure:Ie,destroy:function(e){e&&De[e.id]&&De[e.id].masterItemSubscriber&&(De[e.id].masterItemSubscriber&&De[e.id].masterItemSubscriber.unsubscribe(),delete De[e.id])},hasActiveModifiers:Ae,getActiveModifier:_e,initBase:Ee.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some(function(e){return Ne[e]})},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some(function(e){return Ne[e]&&Ne[e].isApplicable({properties:n,layout:r})})},measureBase:we,limitedSorting:function(e){var t=e.measures,n=e.properties,r=e.layout,i=!1,o=!1;return t.forEach(function(e){var t=Re(e);He({modifiers:t,properties:n,layout:r})&&(i=!0,o=o||Ke({modifiers:t,properties:n,layout:r}))}),i&&!o},ifEnableTotalsFunction:Le};var De={};function qe(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.model,n=e.properties,r=e.isSnapshot,i=void 0!==r&&r,a=e.masterItem,l=!1;De[t.id]=De[t.id]||{isFirstTime:!0};var c=De[t.id].isFirstTime;if(De[t.id].isFirstTime=!1,n&&"object"===Ce(n))return Oe({model:t,properties:n});var u=t?t.layout:void 0,d=s(u,"qSelectionInfo.qInSelections");if(i||d)return Promise.resolve(l);var f=s(u,"qHyperCube.qMeasureInfo"),h=De[t.id].lastReloadTime;if(De[t.id].lastReloadTime=s(t,"app.layout.qLastReloadTime"),Ae({measures:f,layout:u})){var p=function(e){var t=e.measures,n=e.layout,r=e.lastReloadTime;return s(e.model,"app.layout.qLastReloadTime")!==r&&function(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some(function(e){return Ue({measure:e,properties:n,layout:r})})}({measures:t,layout:n})}({measures:f,layout:u,model:t,lastReloadTime:h});return p||function(e){var t=e.measures,n=e.layout,r=e.masterItem,i=e.isFirstTime;return!!Array.isArray(t)&&(i||r||t.some(function(e){return function(e){var t=e.measure,n=e.layout;return He({modifiers:Re(t),layout:n})?!t.base:!!t.base}({measure:e,layout:n})}))}({measures:f,layout:u,masterItem:a,isFirstTime:c})?t.getEffectiveProperties().then(function(e){var n=o()(!0,{},e);ze(n);var r=Xe(n);return Be({model:t}).then(function(i){return We({libraryIds:r,model:t}).then(function(r){return p&&function(e){var t=e.properties;Pe(t).forEach(function(e){return function(e){var t=e.measure;if(Ue({measure:t,properties:e.properties})){var n=0,r=t.qDef.modifiers;Array.isArray(r)&&r.forEach(function(e){if("object"===Ce(e)&&!e.disabled){if(n++,"object"!==Ce(Ne[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(n>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");var r=Ne[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==r&&$e(t)&&k.simplifyExpression(t.qDef.base.qDef)!==k.simplifyExpression(r)&&(t.qDef.base.qDef=r)}})}}({measure:e,properties:t})})}({properties:n}),Oe({model:t,oldProperties:e,properties:n,runUpdateIfChange:!0,masterItem:a,libraryItemsProps:r,dimensionAndFieldList:i})})}).catch(function(){return Promise.resolve(l)})}):Promise.resolve(l)}return function(e){return!!Array.isArray(e)&&e.some(function(e){return"object"===Ce(e.base)})}(f)?t.getEffectiveProperties().then(function(e){return function(e){var t=e.model,n=e.properties,r=Xe(n);return Je({model:t,libraryIds:r}).then(function(){var e=o()(!0,{},n);return Pe(n).forEach(function(e){return Ie(e)}),Ge({oldProperties:e,newProperties:n,model:t})})}({model:t,properties:e})}):Promise.resolve(l)}function Oe(e){var t=e.model,n=e.oldProperties,r=e.properties,i=e.measures,a=e.runUpdateIfChange,l=void 0!==a&&a,c=e.masterItem,u=e.libraryItemsProps,d=e.dimensionAndFieldList;void 0===n&&(n=l?o()(!0,{},r):r),ze(r);var f=Xe(r);return Je({model:t,libraryIds:f,masterItem:c}).then(function(){return function(e){var t=e.measures,n=e.properties,r=e.model,i=e.libraryItemsProps,a=e.dimensionAndFieldList;if(t||(t=Pe(n)),!t.length)return Promise.resolve();if(!i&&!Ae({measures:t,properties:n}))return t.forEach(function(e){return Ie(e)}),Promise.resolve();var l=i?void 0:Xe(n);return Be({model:r,dimensionAndFieldList:a}).then(function(e){return We({libraryIds:l,model:r,libraryItemsProps:i}).then(function(r){t.forEach(function(t){var i=t.qDef.modifiers;r&&He({modifiers:i,properties:n})?(function(e){var t=e.measure,n=e.properties,r=e.libraryItemsProps,i=e.dimensionAndFieldList,a=0;Ee.isValid(t)||Ee.initBase(t,!0);var l=t.qDef,c=l.modifiers,u=l.base;Array.isArray(c)&&c.forEach(function(e){if("object"===Ce(e)&&!e.disabled){if(a++,"object"!==Ce(Ne[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(a>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");Ne[e.type].initModifier(e,t);var l=t.qLibraryId||u&&u.qLibraryId;l?function(e){var t=e.measure,n=e.modifier,r=e.properties,i=e.dimensionAndFieldList,a=e.libraryItemsProps[e.libraryId],s=a.qMeasure.qDef,l=""===s?s:Ne[n.type].generateExpression({expression:s,modifier:n,properties:r,dimensionAndFieldList:i});n.outputExpression=l,t.qDef.qDef=n.outputExpression,(t.qDef.qLabel||a.qMeasure.qLabel)&&(t.qDef.qLabel=t.qDef.base.qLabel||a.qMeasure.qLabel),(t.qDef.qLabelExpression||a.qMeasure.qLabelExpression)&&(t.qDef.qLabelExpression=a.qMeasure.qLabelExpression),t.qDef.quarantine&&t.qDef.quarantine.qNumFormat&&a.qMeasure.qNumFormat&&(t.qDef.qNumFormat=t.qDef.base.qNumFormat||a.qMeasure.qNumFormat,t.qDef.isCustomFormatted=a.qMeasure.isCustomFormatted),delete t.qLibraryId,t.qDef.coloring=a.qMeasure.coloring,n.base=o()(!0,{},t.qDef.base)}({measure:t,modifier:e,libraryId:l,properties:n,libraryItemsProps:r,dimensionAndFieldList:i}):function(e){var t=e.measure,n=e.modifier,r=e.properties,i=e.dimensionAndFieldList;"function"==typeof Ne[n.type].updateModifier&&Ne[n.type].updateModifier(n,r.qHyperCubeDef);var a=we.getExpression(t),s=""===a?a:Ne[n.type].generateExpression({expression:a,modifier:n,properties:r,dimensionAndFieldList:i});n.outputExpression=s,t.qDef.qDef=n.outputExpression,t.qDef.base.qLabelExpression?t.qDef.qLabelExpression=t.qDef.base.qLabelExpression:t.qDef.qLabel=t.qDef.base.qLabel||a,n.base=o()(!0,{},t.qDef.base)}({measure:t,modifier:e,properties:n,dimensionAndFieldList:i}),function(e){var t=s(e,"qDef.qAggrFunc");"Expr"!==t||Le(e)?"None"!==t?delete e.qDef.base.qAggrFunc:"None"===t&&Le(e)&&"Expr"===e.qDef.base.qAggrFunc&&(e.qDef.qAggrFunc="Expr",delete e.qDef.base.qAggrFunc):(e.qDef.qAggrFunc="None",e.qDef.base.qAggrFunc="Expr")}(t)}})}({measure:t,properties:n,libraryItemsProps:r,dimensionAndFieldList:e}),je(t)):Ie(t)})})})}({measures:i,properties:r,model:t,libraryItemsProps:u,dimensionAndFieldList:d}).then(function(){return l?Ge({oldProperties:n,newProperties:r,model:t}):Promise.resolve(!1)})}).catch(function(){return Promise.resolve(!1)})}function Ie(e){!function(e){var t=Re(e);return Array.isArray(t)&&t.some(function(e){return"object"===Ce(e)&&!e.disabled&&!Ne[e.type]})}(e)?Ee.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,je(e)}function Ae(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some(function(e){return He({modifiers:Re(e),properties:n,layout:r})})}function _e(e){var t=Re(e);if(Array.isArray(t))for(var n=0;n<t.length;n++){var r=t[n];if(Ne[r.type]&&!r.disabled)return r}}function Le(e){var t=_e(e);return!t||Ne[t.type].enableTotalsFunction(e)}function Pe(e){return s(e,"qHyperCubeDef.qMeasures",[]).concat(s(e,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",[]))}function Re(e){return e.modifiers||e.qDef&&e.qDef.modifiers}function Fe(e){return s(e,"outputExpression.qValueExpression.qExpr")||s(e,"outputExpression")}function ze(e){Pe(e).forEach(function(e){return function(e){var t=_e(e);t&&(void 0!==t.outputExpression&&Fe(t)!==e.qDef.qDef?delete e.qDef.base:!Ee.isValid(e)&&t.base&&(e.qDef.base=o()(!0,{},t.base)))}(e)})}function je(e){var t=Re(e);Array.isArray(t)&&t.forEach(function(t){"object"===Ce(t)&&(t.disabled||!Ne[t.type]&&Fe(t)!==e.qDef.qDef)&&(t.disabled=!0,delete t.base)})}function $e(e){return e.base||e.qDef&&e.qDef.base}function Ve(e){var t=$e(e);return e.qLibraryId||t&&t.qLibraryId}function Ue(e){var t=e.measure,n=e.properties,r=e.layout;return!Ve(t)&&He({modifiers:Re(t),properties:n,layout:r})}function He(e){var t=e.modifiers,n=e.properties,r=e.layout,i={};return Array.isArray(t)&&t.some(function(e){return!("object"!==Ce(e)||e.disabled||!Ne[e.type])&&(void 0===i[e.type]&&(i[e.type]=Ne[e.type].isApplicable({properties:n,layout:r})),i[e.type])})}function Be(e){var t=e.model,n=e.dimensionAndFieldList;if(n)return Promise.resolve(n);var r=[],i={},o=t.app.getDimensionList().then(function(e){i.dimensionList=e});r.push(o);var a=t.app.getFieldList().then(function(e){i.fieldList=e});return r.push(a),Promise.all(r).then(function(){return i})}function We(e){var t=e.libraryIds,n=e.model,r=e.libraryItemsProps;if(r)return Promise.resolve(r);var i=t.measureLibraryIds,o=t.dimensionLibraryIds,a={},s=[];return i.forEach(function(e){var t=n.app.getMeasure(e).then(function(t){return t.getProperties().then(function(t){a[e]=t})});s.push(t)}),o.forEach(function(e){var t=n.app.getDimension(e).then(function(t){return t.getProperties().then(function(t){a[e]=t})});s.push(t)}),Promise.all(s).then(function(){return a}).catch(function(){return null})}function Ye(e,t){if(""!==t||-1===["qFmt","qDec","qThou"].indexOf(e))return t}function Ge(e){var t=e.oldProperties,n=e.newProperties,r=e.model,i=JSON.stringify(s(t,"qHyperCubeDef.qMeasures"),Ye)!==JSON.stringify(s(n,"qHyperCubeDef.qMeasures"),Ye)||JSON.stringify(s(t,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Ye)!==JSON.stringify(s(n,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Ye);return i?function(e){var t=e.model,n=e.oldProperties,r=e.newProperties,i=t.layout;return i&&!i.qHasSoftPatches&&!i.qExtendsId&&s(i,"qMeta.privileges",[]).indexOf("update")>-1?t.setProperties(r):function(e,t,n){if(!e)return Promise.resolve();var r=L.generate(t,n);return o()(!0,t,n),r&&r.length?(r=r.map(function(e){return{qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}}),e.applyPatches(r,!0)):Promise.resolve()}(t,n,r)}({model:r,oldProperties:t,newProperties:n}).then(function(){return i}):Promise.resolve(i)}function Ke(e){var t=e.modifiers,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some(function(e){return"object"===Ce(e)&&!e.disabled&&Ne[e.type]&&Ne[e.type].needDimension({modifier:e,properties:n,layout:r})})}function Xe(e){var t=Pe(e),n=[],r=[],i=!1;return t.forEach(function(t){var r=Re(t);if(He({modifiers:r,properties:e})){var o=Ve(t);o&&n.push(o),i=i||Ke({modifiers:r,properties:e})}}),s(e,"qHyperCubeDef.qDimensions",[]).forEach(function(e){var t=e.qLibraryId;t&&r.push(t)}),{measureLibraryIds:n,dimensionLibraryIds:r}}function Je(e){var t=e.model,n=e.libraryIds,r=e.masterItem;return!r&&r!==de&&n&&(n.measureLibraryIds.length||n.dimensionLibraryIds.length)?(De[t.id].masterItemSubscriber=De[t.id].masterItemSubscriber||function(e){var t=e.model,n=e.callback,r={},i={},o={},a={dimension:["qDim.qFieldDefs"],measure:["qMeasure.qDef","qMeasure.qLabel","qMeasure.qLabelExpression","qMeasure.coloring","qMeasure.qNumFormat","qMeasure.isCustomFormatted"]};function l(e){var t={},n=s(e,"qInfo.qType");return n&&a[n]&&a[n].forEach(function(n){t[n]=s(e,n)}),JSON.stringify(t)}function c(e){var t=e.qInfo.qId;if(r[t]){var i=l(e);r[t].properties!==i&&(r[t].properties=i,"function"==typeof n&&r[t].enabled&&n(e)),r[t].enabled=!0}}function u(){Object.keys(r).forEach(function(e){i[e]||o[e]||(r[e].listener.dispose(),r[e].unbindCloseListnener(),delete r[e])})}var d=function(e,t){return e.once("closed",t),function(){return e.removeListener("closed",t)}};function f(e,i){return t.app[i](e).then(function(t){r[e]={listener:t.layoutSubscribe(c),unbindCloseListnener:d(t,function(){return e=t.id,n(de),delete r[e],void u();var e}),enabled:!1,properties:l(t.layout)}}).catch(function(){})}return{subscribe:function(e){var n=e.measureLibraryIds,a=e.dimensionLibraryIds,s=[];return function(e){var t=e.dimensionLibraryIds;i={},e.measureLibraryIds.forEach(function(e){i[e]=!0}),o={},t.forEach(function(e){o[e]=!0})}({measureLibraryIds:n,dimensionLibraryIds:a}),u(),t.app&&(Object.keys(i).forEach(function(e){i[e]&&!r[e]&&s.push(f(e,"getMeasure"))}),Object.keys(o).forEach(function(e){o[e]&&!r[e]&&s.push(f(e,"getDimension"))})),Promise.all(s)},unsubscribe:function(){Object.keys(r).forEach(function(e){r[e].listener.dispose(),r[e].unbindCloseListnener()}),r={}}}}({model:t,callback:function(e){return qe({model:t,masterItem:e}).then(function(){return t.app.clearUndoBuffer()})}}),De[t.id].masterItemSubscriber.subscribe(n)):Promise.resolve()}for(var Ze in qD.default=r.default,r)-1===["default"].indexOf(Ze)&&(qD[Ze]=r[Ze]);Object.defineProperty(qD,"__esModule",{value:!0})})()),oq));function sq(e){var t=e.model,n=e.properties;return e.noModelDependencies?aq.apply({model:t,properties:n}):t.modifiers?t.modifiers.apply({model:t,properties:n}):Promise.resolve()}function lq(e){return Array.isArray(e)}function cq(e){return null!=e&&!Array.isArray(e)&&"object"===hD(e)}function uq(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function dq(e){return void 0===e}function fq(e,t){if(cq(e)&&cq(t)){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n=Object.keys(e),r=0,i=n.length;r<i;r+=1)if(!fq(e[n[r]],t[n[r]]))return!1;return!0}if(lq(e)&&lq(t)){if(e.length!==t.length)return!1;for(var o=0,a=e.length;o<a;o+=1)if(!fq(e[o],t[o]))return!1;return!0}return e===t}function hq(e){var t=e.oldData,n=void 0===t?{}:t,r=e.newData,i=void 0===r?{}:r,o=e.basePath,a=void 0===o?"":o,s=[];return Object.keys(i).forEach(function(e){var t=function(e){return e?iq(!0,{},{value:e}).value:e}(i[e]),r=n[e],o="".concat(a,"/").concat(e);fq(t,r)||uq(i,e)||(dq(r)?s.push({op:"add",path:o,value:t}):cq(t)&&cq(r)?s.push.apply(s,fD(hq({oldData:r,newData:t,basePath:o}))):lq(t)&&lq(r)?s.push.apply(s,fD(function(e){var t=e.newArray,n=e.basePath,r=[];return fq(t,e.oldArray.slice())||(!dq(t[0])&&dq(t[0].qInfo)||0===t.length)&&r.push({op:"replace",path:n,value:t}),r}({oldArray:r,newArray:t,basePath:o}))):s.push({op:"replace",path:o,value:t}))}),Object.keys(n).forEach(function(e){dq(i[e])&&!uq(n,e)&&s.push({op:"remove",path:"".concat(a,"/").concat(e)})}),s}function pq(e){var t=e.model,n=hq({oldData:e.oldProperties,newData:e.newProperties});null!=t&&t.applyPatches&&null!=n&&n.length&&t.applyPatches(n.map(function(e){return{qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}}),!0)}function mq(e){var t=e.properties,n=e.container,r=e.filtered,i=t.color;if(i){var o=i.auto,a=i.mode;if(!o){var s,l=r.map(function(e){var r;return null===(r=t.qHyperCubeDef[n][e])||void 0===r?void 0:r.qDef.cId}).filter(function(e){return void 0!==e}),c=t.qHyperCubeDef[n].filter(function(e){return!l.includes(e.qDef.cId)});if("byDimension"===a&&"qDimensions"===n){var u=i.byDimDef;if(!u)return;var d=void 0===u.activeDimensionIndex?-1:u.activeDimensionIndex;if(d<0)return;var f=c[d];if(!f)return;if(f.qLibraryId)i.byDimDef={type:"libraryItem",key:f.qLibraryId,label:f.qLibraryId,activeDimensionIndex:d};else{var h=f.qDef,p=h.qLabelExpression||h.qFieldLabels&&h.qFieldLabels[0]||h.qFieldDefs[0],m=(s=f.qDef.qFieldDefs[0]).split(" ").length>1&&"="!==s[0]&&"["!==s[0]?"[".concat(s,"]"):s;i.byDimDef={type:"expression",key:m,label:p||m,activeDimensionIndex:d}}}if("byMeasure"===a&&"qMeasures"===n){var g=i.byMeasureDef;if(!g)return;var y=void 0===g.activeMeasureIndex?-1:g.activeMeasureIndex;if(y<0)return;var v=c[y];if(!v)return;var b=aq.measureBase.getLibraryId(v);if(b){i.byMeasureDef={type:"libraryItem",key:b,label:b,activeMeasureIndex:y};var x=aq.hasActiveModifiers({measures:[v]})?v.qDef.qDef:void 0;x&&(i.byMeasureDef.expression=x)}else{var S=v.qDef;i.byMeasureDef={type:"expression",key:S.qDef,label:S.qLabelExpression||S.qLabel||S.qDef,activeMeasureIndex:y}}}}}}function gq(e){return yq.apply(this,arguments)}function yq(){var e;return e=cD().m(function e(t){var n,r,i,o,a,s,l,c,u,d,f,h,p,m;return cD().w(function(e){for(;;)switch(e.n){case 0:if(n=t.from,r=t.to,i=t.model,o=t.container,a=t.filtered,s=t.noModelDependencies,l=t.skipAttributeExpressions,c=t.onChange,i){e.n=1;break}return e.a(2);case 1:return e.n=2,i.getEffectiveProperties();case 2:return u=e.v,d=u.qHyperCubeDef[o].findIndex(function(e){return e.qDef.cId===n}),f=u.qHyperCubeDef.qLayoutExclude.qHyperCubeDef[o].findIndex(function(e){return e.qDef.cId===r}),h=iq(!0,{},u),p=h.qHyperCubeDef[o][d],(m=h.qHyperCubeDef.qLayoutExclude.qHyperCubeDef[o][f]).qAttributeDimensions=p.qAttributeDimensions,p.qAttributeDimensions=[],l||(m.qAttributeExpressions=p.qAttributeExpressions,p.qAttributeExpressions=[]),h.qHyperCubeDef[o][d]=m,h.qHyperCubeDef.qLayoutExclude.qHyperCubeDef[o][f]=p,c({fromItem:p,toItem:m,oldProperties:u,newProperties:h,model:i}),e.n=3,sq({model:i,properties:h,noModelDependencies:s});case 3:s?mq({properties:h,container:o,filtered:a}):i.colorSupport&&i.colorSupport.colorByUpdater(h,"qHyperCubeDef."),pq({model:i,oldProperties:u,newProperties:h});case 4:return e.a(2)}},e)}),yq=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){oD(o,r,i,a,s,"next",e)}function s(e){oD(o,r,i,a,s,"throw",e)}a(void 0)})},yq.apply(this,arguments)}function vq(e){var t=e.callbacks,n=e.data,r=e.resources,i=e.settings,o=t.onChange,a=n.infos,s=n.filtered,l=r.app,c=r.model,u=r.translator,d=i.noModelDependencies,f=i.skipAttributeExpressions;return a.map(function(e,t){var n=e.cId,r=e.qGrouping,i=e.qGroupFallbackTitles,a=e.qGroupPos,h=e.qFallbackTitle,p=e.qLocked,m=e.title,g="C"===r,y="H"===r,v="N"===r,b="number"==typeof e.explicitColumn?e.explicitColumn:t,x=function(t,n){g&&l&&l.getDimension&&l.getDimension(e.qLibraryId).then(function(e){null==e||e[t](n)}).catch(function(){})};return{meta:{isCyclic:g,isDrillDown:y,isLocked:!!p,isNormal:v},info:{id:n,key:"".concat(n,"-").concat(a),text:v?h:i[a],position:a,breadcrumbs:i.slice(0,e.qGroupPos),group:{name:m,items:i.slice(0,y?e.qGroupPos+1:i.length).map(function(e,t){return{id:"".concat(n,"-item-").concat(t),text:e,current:a===t,index:t}})},tooltip:v?void 0:u.get(g?"Tooltip.dimensions.cyclic":"Tooltip.dimensions.drilldown")},action:{changeTo:function(e){var t=e.id;return gq({from:n,to:t,container:"qDimensions",model:c,filtered:s,noModelDependencies:d,skipAttributeExpressions:f,onChange:o})},drillUp:function(e){var t=e.steps;y&&c&&(null==c||c.drillUp("/qHyperCubeDef",b,t))},stepCycle:function(){return x("stepCycle",1)},setActiveField:function(e){var t=e.fieldIndex;return x("setActiveField",t)}}}})}function bq(e){var t=e.callbacks,n=e.data,r=e.resources,i=e.settings,o=t.onChange,a=n.infos,s=n.filtered,l=r.model,c=i.noModelDependencies,u=i.skipAttributeExpressions;return a.map(function(e){var t=e.cId,n=e.qFallbackTitle;return{meta:{isNormal:!0},info:{id:t,key:t,text:n},action:{changeTo:function(e){var n=e.id;return gq({from:t,to:n,container:"qMeasures",model:l,filtered:s,noModelDependencies:c,skipAttributeExpressions:u,onChange:o})}}}})}function xq(e){var t=e.callbacks,n=e.data,r=e.dock,i=e.key,o=e.rect,a=e.resources,s=e.settings,l=e.state,c=e.styling,u=function(e){var t=e.dock,n=e.rect,r={pointerEvents:"auto",display:"flex",justifyContent:"center",alignItems:"center",height:"100%"};return"left"!==t&&"right"!==t||(r.width="".concat(n.height,"px"),r.height="".concat(n.width,"px"),r.transformOrigin="top left"),"left"===t&&(r.transform="rotate(-90deg) translate(-".concat(n.height,"px, 0)")),"right"===t&&(r.transform="rotate(90deg) translate(0, -".concat(n.width,"px)")),r}({dock:r,rect:o}),d=function(e){var t=e.callbacks,n=e.data,r=e.dock,i=e.key,o=e.resources,a=e.settings,s=e.state,l=e.styling,c=n.alternatives,u=n.infos,d=o.app,f=o.cache,h=o.model,p=a.isRTL,m=a.isSnapshot,g=a.noModelDependencies,y=a.type,v=function(e){var t=e.dock;return"top"!==t&&"bottom"!==t||!e.isRTL?"ltr":"rtl"}({dock:r,isRTL:p}),b=function(e){var t=e.cache,n="axis-title-auto-focus_"+e.key;return{queueFor:function(e){var r;return null==t||null===(r=t.set)||void 0===r?void 0:r.call(t,n,{focus:!0,index:e})},shouldFor:function(e){var r,i,o=null==t||null===(r=t.get)||void 0===r?void 0:r.call(t,n),a=!(null==o||!o.focus||(null==o?void 0:o.index)!==e);return a&&(null==t||null===(i=t.set)||void 0===i||i.call(t,n,{focus:!1})),a}}}({cache:f,key:i}),x=("dimension"===y?vq:bq)({callbacks:t,data:n,resources:o,settings:a});"rtl"===v&&x.reverse();var S={allowed:{change:g?!m:!(null==h||!h.modifiers||null==h||!h.colorSupport||m),reload:!!d&&!m},hasAlternatives:!!c.length,hasCyclic:x.some(function(e){return e.meta.isCyclic}),hasMultiple:u.length>1};return x.map(function(e,t){return lD(lD({data:n,layout:{direction:v},resources:{translator:o.translator},services:{focus:b},settings:a,state:s,styling:l},e),{},{meta:lD(lD(lD({},S),e.meta),{},{index:t,isFirst:0===t,isLast:t===x.length-1})})})}({callbacks:t,data:n,dock:r,key:i,resources:a,settings:s,state:l,styling:c});return xD.jsx("div",{style:u,children:d.map(function(e){return xD.jsxs(px.Fragment,{children:[xD.jsx(nq,{source:e}),!e.meta.isLast&&xD.jsx("span",{dir:e.layout.direction,style:lD(lD({},c.title),{},{lineHeight:"normal"}),children:", "})]},e.info.id)})})}var Sq,Mq='"Source Sans Pro", "Arial", "sans-serif"',wq="12px",kq=function(e){var t=e.rect,n=e.state,r=e.settings,i=r.callbacks,o=r.data,a=r.key,s=r.layout,l=r.resources,c=r.settings,u=r.style;return xq({callbacks:i,data:o,dock:s.dock,key:a,rect:t,resources:l,settings:c,state:n,styling:u})},Eq={renderer:"react",require:["renderer"],disableTriggers:!0,key:"axis-title",defaultSettings:{callbacks:{onChange:function(){}},data:{alternatives:[],infos:[],filtered:[]},resources:{app:void 0,cache:void 0,model:void 0,selections:void 0,translator:void 0},settings:{isDisabled:function(){return!1},isRTL:!1,isSnapshot:!1,noModelDependencies:!1,skipAttributeExpressions:!1,type:"dimension"},style:{title:{color:"#333",fontFamily:Mq,fontSize:wq},popover:{color:"#595959CC",fontFamily:Mq,fontSize:wq}}},preferredSize:function(){var e=this.settings,t=e.data,n=e.settings,r=e.style,i=t.alternatives,o=n.type,a=r.title,s=a.fontSize,l=a.fontFamily,c=i.length||"measure"!==o?28:20,u=this.registries.renderer("svg")().measureText({text:"M",fontSize:s,fontFamily:l}).height;return Math.max(c,u)},created:function(){var e=this;this.state={inSelections:!1},this.listeners={onSelectionsActivated:function(){e.state.inSelections=!0,e.renderer.render(kq(e))},onSelectionsDeactivated:function(){e.state.inSelections=!1}}},beforeMount:function(){var e=this.settings.resources.selections;e&&(e.addListener("activated",this.listeners.onSelectionsActivated),e.addListener("deactivated",this.listeners.onSelectionsDeactivated),e.addListener("canceled",this.listeners.onSelectionsDeactivated))},render:function(){return kq(this)},beforeUnmount:function(){var e=this.settings.resources.selections;e&&(e.removeListener("activated",this.listeners.onSelectionsActivated),e.removeListener("deactivated",this.listeners.onSelectionsDeactivated),e.removeListener("canceled",this.listeners.onSelectionsDeactivated))}},Cq=function(e){var t=e.dock,n=e.settings.label,r="center"===t,i=r?{}:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"};return xD.jsx("span",{style:i,title:n,children:r?n:"* ".concat(n)})},Nq={renderer:"react",disableTriggers:!0,key:"disclaimer",defaultSettings:{settings:{isRTL:!1,label:void 0},style:{fontFamily:'"Source Sans Pro", "Arial", "sans-serif"'}},preferredSize:function(){return 22},render:function(){var e=this.rect,t=this.settings,n=t.layout,r=t.settings,i=t.style;return function(e){var t=e.dock,n=e.rect,r=e.settings,i=e.styling,o=function(e){var t=e.dock;return"top"!==t&&"bottom"!==t||!e.isRTL?"ltr":"rtl"}({dock:t,isRTL:r.isRTL}),a=function(e){var t=e.dock,n=e.rect,r={pointerEvents:"auto",display:"flex",justifyContent:"center",alignItems:"center",color:"#404040",fontStyle:"italic",fontSize:"13px",fontFamily:e.styling.fontFamily};return"left"===t&&(r.width="".concat(n.height,"px"),r.transform="rotate(-90deg) translate(-".concat(n.height,"px, 0)"),r.transformOrigin="top left"),"right"===t&&(r.width="".concat(n.height,"px"),r.transform="rotate(90deg) translate(0, -".concat(n.width,"px)"),r.transformOrigin="top left"),"center"===t&&(r.width="".concat(n.width,"px"),r.height="".concat(n.height,"px"),r.color="#404040",r.fontStyle="normal",r.fontSize="1.2em",r.textAlign="center"),"bottom"!==t&&"top"!==t||(r.justifyContent="flex-start",r.alignItems="flex-start"),r}({dock:t,rect:n,styling:i});return xD.jsx("div",{dir:o,style:a,children:xD.jsx(Cq,{dock:t,settings:r})})}({dock:n.dock,rect:e,settings:r,styling:i})}},Tq={},Dq=function(){if(Sq)return Tq;Sq=1;var e=YC;return Tq.createRoot=e.createRoot,Tq.hydrateRoot=e.hydrateRoot,Tq}(),qq=lC({spacing:8,shadows:["none","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)"],transitions:{easing:{easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},duration:{standard:300,short:250,enteringScreen:225,shorter:200,leavingScreen:195,shortest:150,complex:375}},typography:{fontSize:14,fontWeightLight:300,fontWeightRegular:400,fontWeightMedium:600,fontWeightBold:700,htmlFontSize:14,fontFamily:"'Source Sans Pro', 'HelveticaNeue', 'Helvetica Neue', Helvetica, Arial, sans-serif",button:{fontWeight:600,fontSize:14,textTransform:"none"}},shape:{borderRadius:3},components:{MuiButtonBase:{defaultProps:{disableRipple:!0,disableTouchRipple:!0,focusVisibleClassName:"qcm-focus-visible"}},MuiButton:{defaultProps:{color:"inherit",disableRipple:!0,focusVisibleClassName:"qcm-focus-visible"},styleOverrides:{root:{height:"32px",lineHeight:"16px",minWidth:"24px",fontSize:141,borderRadius:3,"& > i:only-child, & > svg:only-child":{marginLeft:"-9px",marginRight:"-9px"}},text:{padding:"8px 16px","&:active":{backgroundColor:"rgba(0, 0, 0, 0.1)"},"&.Mui-focusVisible":{boxShadow:"inset 0 0 0 2px ".concat("#177FE6")}},outlined:{border:"1px solid rgba(0, 0, 0, 0.15)"},sizeSmall:{fontSize:12,height:"24px","& > svg:only-child, & > i:only-child":{marginLeft:"-7px",marginRight:"-7px"}},sizeLarge:{fontSize:16,height:"40px",lineHeight:"20px","& > i:only-child, & > svg:only-child":{marginLeft:"-9px",marginRight:"-9px"}},textSizeSmall:{padding:"4px 11px"},textSizeLarge:{padding:"10px 19px"}},variants:[]},MuiList:{styleOverrides:{padding:{paddingTop:"0px",paddingBottom:"0px"}}},MuiListItemButton:{styleOverrides:{root:{fontSize:14,height:"32px"}}},MuiListItemIcon:{styleOverrides:{root:{color:"#404040",minWidth:"16px",marginRight:"16px"}}},MuiListItemText:{styleOverrides:{root:{fontSize:"12px"},primary:{fontSize:14,color:"#404040",lineHeight:"16px",fontWeight:600},secondary:{fontSize:12,color:"#737373",fontWeight:400,lineHeight:"16px"}}}}});function Oq(e){var t={x:0,y:0,width:0,height:0,scaleRatio:{x:1,y:1},margin:{left:0,top:0}},n=e||{},r=n.x,i=n.y,o=n.width,a=n.height,s=n.scaleRatio,l=n.margin;return t.x=Number.isNaN(r)||void 0===r?t.x:r,t.y=Number.isNaN(i)||void 0===i?t.y:i,t.width=Number.isNaN(o)||void 0===o?t.width:o,t.height=Number.isNaN(a)||void 0===a?t.height:a,void 0!==s&&(t.scaleRatio.x=Number.isNaN(s.x)?t.scaleRatio.x:s.x,t.scaleRatio.y=Number.isNaN(s.y)?t.scaleRatio.y:s.y),void 0!==l&&(t.margin.left=Number.isNaN(l.left)?0:l.left,t.margin.top=Number.isNaN(l.top)?0:l.top),t}function Iq(){var e={rendererBox:Oq(),container:void 0,root:void 0},t=function(){var t,n;null===(t=e.root)||void 0===t||t.unmount(),null===(n=e.container)||void 0===n||null===(n=n.parentElement)||void 0===n||n.removeChild(e.container),e.container=void 0};return{size:function(t){return t&&(e.rendererBox=Oq(t)),e.rendererBox},element:function(){return e.container},appendTo:function(t){return e.container||(e.container=document.createElement("div"),e.container.style.position="absolute",e.container.style["-webkit-font-smoothing"]="antialiased",e.container.style["-moz-osx-font-smoothing"]="antialiased",e.container.style.pointerEvents="none",e.root=Dq.createRoot(e.container)),t.appendChild(e.container),e.container},setKey:function(t){e.container&&e.container.setAttribute("data-key",t)},render:function(t){if(!e.container)return!1;var n=e.rendererBox,r=n.scaleRatio.x,i=n.scaleRatio.y;return e.container.style.left="".concat(Math.round(n.margin.left+n.x*r),"px"),e.container.style.top="".concat(Math.round(n.margin.top+n.y*i),"px"),e.container.style.width="".concat(Math.round(n.width),"px"),e.container.style.height="".concat(Math.round(n.height),"px"),e.container.style.transform="scale(".concat(r,", ").concat(i,")"),e.container.style.transformOrigin="top left",e.root.render(function(e){var t=e.nodes;return xD.jsx(px.StrictMode,{children:xD.jsx(NC,{theme:qq,children:t})})}({nodes:t})),!0},findShapes:function(){return[]},itemsAt:function(){return[]},clear:function(){t()},destroy:function(){t()}}}var Aq,_q={exports:{}};
/*! Hammer.JS - v2.0.7 - 2016-04-22
   * http://hammerjs.github.io/
   *
   * Copyright (c) 2016 Jorik Tangelder;
   * Licensed under the MIT license */var Lq=(Aq||(Aq=1,function(e){!function(t,n,r,i){var o,a=["","webkit","Moz","MS","ms","o"],s=n.createElement("div"),l=Math.round,c=Math.abs,u=Date.now;function d(e,t,n){return setTimeout(v(e,n),t)}function f(e,t,n){return!!Array.isArray(e)&&(h(e,n[t],n),!0)}function h(e,t,n){var r;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==i)for(r=0;r<e.length;)t.call(n,e[r],r,e),r++;else for(r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r,e)}function p(e,n,r){var i="DEPRECATED METHOD: "+n+"\n"+r+" AT \n";return function(){var n=new Error("get-stack-trace"),r=n&&n.stack?n.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=t.console&&(t.console.warn||t.console.log);return o&&o.call(t.console,i,r),e.apply(this,arguments)}}o="function"!=typeof Object.assign?function(e){if(e===i||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(r!==i&&null!==r)for(var o in r)r.hasOwnProperty(o)&&(t[o]=r[o])}return t}:Object.assign;var m=p(function(e,t,n){for(var r=Object.keys(t),o=0;o<r.length;)(!n||n&&e[r[o]]===i)&&(e[r[o]]=t[r[o]]),o++;return e},"extend","Use `assign`."),g=p(function(e,t){return m(e,t,!0)},"merge","Use `assign`.");function y(e,t,n){var r,i=t.prototype;(r=e.prototype=Object.create(i)).constructor=e,r._super=i,n&&o(r,n)}function v(e,t){return function(){return e.apply(t,arguments)}}function b(e,t){return"function"==typeof e?e.apply(t&&t[0]||i,t):e}function x(e,t){return e===i?t:e}function S(e,t,n){h(E(t),function(t){e.addEventListener(t,n,!1)})}function M(e,t,n){h(E(t),function(t){e.removeEventListener(t,n,!1)})}function w(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}function k(e,t){return e.indexOf(t)>-1}function E(e){return e.trim().split(/\s+/g)}function C(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var r=0;r<e.length;){if(n&&e[r][n]==t||!n&&e[r]===t)return r;r++}return-1}function N(e){return Array.prototype.slice.call(e,0)}function T(e,t,n){for(var r=[],i=[],o=0;o<e.length;){var a=e[o][t];C(i,a)<0&&r.push(e[o]),i[o]=a,o++}return r=r.sort(function(e,n){return e[t]>n[t]}),r}function D(e,t){for(var n,r,o=t[0].toUpperCase()+t.slice(1),s=0;s<a.length;){if((r=(n=a[s])?n+o:t)in e)return r;s++}return i}var q=1;function O(e){var n=e.ownerDocument||e;return n.defaultView||n.parentWindow||t}var I="ontouchstart"in t,A=D(t,"PointerEvent")!==i,_=I&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),L="touch",P="mouse",R=24,F=["x","y"],z=["clientX","clientY"];function j(e,t){var n=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){b(e.options.enable,[e])&&n.handler(t)},this.init()}function $(e,t,n){var r=n.pointers.length,o=n.changedPointers.length,a=1&t&&r-o===0,s=12&t&&r-o===0;n.isFirst=!!a,n.isFinal=!!s,a&&(e.session={}),n.eventType=t,function(e,t){var n=e.session,r=t.pointers,o=r.length;n.firstInput||(n.firstInput=V(t)),o>1&&!n.firstMultiple?n.firstMultiple=V(t):1===o&&(n.firstMultiple=!1);var a=n.firstInput,s=n.firstMultiple,l=s?s.center:a.center,d=t.center=U(r);t.timeStamp=u(),t.deltaTime=t.timeStamp-a.timeStamp,t.angle=Y(l,d),t.distance=W(l,d),function(e,t){var n=t.center,r=e.offsetDelta||{},i=e.prevDelta||{},o=e.prevInput||{};1!==t.eventType&&4!==o.eventType||(i=e.prevDelta={x:o.deltaX||0,y:o.deltaY||0},r=e.offsetDelta={x:n.x,y:n.y}),t.deltaX=i.x+(n.x-r.x),t.deltaY=i.y+(n.y-r.y)}(n,t),t.offsetDirection=B(t.deltaX,t.deltaY);var f=H(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=f.x,t.overallVelocityY=f.y,t.overallVelocity=c(f.x)>c(f.y)?f.x:f.y,t.scale=s?function(e,t){return W(t[0],t[1],z)/W(e[0],e[1],z)}(s.pointers,r):1,t.rotation=s?function(e,t){return Y(t[1],t[0],z)+Y(e[1],e[0],z)}(s.pointers,r):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,function(e,t){var n,r,o,a,s=e.lastInterval||t,l=t.timeStamp-s.timeStamp;if(8!=t.eventType&&(l>25||s.velocity===i)){var u=t.deltaX-s.deltaX,d=t.deltaY-s.deltaY,f=H(l,u,d);r=f.x,o=f.y,n=c(f.x)>c(f.y)?f.x:f.y,a=B(u,d),e.lastInterval=t}else n=s.velocity,r=s.velocityX,o=s.velocityY,a=s.direction;t.velocity=n,t.velocityX=r,t.velocityY=o,t.direction=a}(n,t);var h=e.element;w(t.srcEvent.target,h)&&(h=t.srcEvent.target),t.target=h}(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function V(e){for(var t=[],n=0;n<e.pointers.length;)t[n]={clientX:l(e.pointers[n].clientX),clientY:l(e.pointers[n].clientY)},n++;return{timeStamp:u(),pointers:t,center:U(t),deltaX:e.deltaX,deltaY:e.deltaY}}function U(e){var t=e.length;if(1===t)return{x:l(e[0].clientX),y:l(e[0].clientY)};for(var n=0,r=0,i=0;i<t;)n+=e[i].clientX,r+=e[i].clientY,i++;return{x:l(n/t),y:l(r/t)}}function H(e,t,n){return{x:t/e||0,y:n/e||0}}function B(e,t){return e===t?1:c(e)>=c(t)?e<0?2:4:t<0?8:16}function W(e,t,n){n||(n=F);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.sqrt(r*r+i*i)}function Y(e,t,n){n||(n=F);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return 180*Math.atan2(i,r)/Math.PI}j.prototype={handler:function(){},init:function(){this.evEl&&S(this.element,this.evEl,this.domHandler),this.evTarget&&S(this.target,this.evTarget,this.domHandler),this.evWin&&S(O(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&M(this.element,this.evEl,this.domHandler),this.evTarget&&M(this.target,this.evTarget,this.domHandler),this.evWin&&M(O(this.element),this.evWin,this.domHandler)}};var G={mousedown:1,mousemove:2,mouseup:4},K="mousedown",X="mousemove mouseup";function J(){this.evEl=K,this.evWin=X,this.pressed=!1,j.apply(this,arguments)}y(J,j,{handler:function(e){var t=G[e.type];1&t&&0===e.button&&(this.pressed=!0),2&t&&1!==e.which&&(t=4),this.pressed&&(4&t&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:P,srcEvent:e}))}});var Z={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},Q={2:L,3:"pen",4:P,5:"kinect"},ee="pointerdown",te="pointermove pointerup pointercancel";function ne(){this.evEl=ee,this.evWin=te,j.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}t.MSPointerEvent&&!t.PointerEvent&&(ee="MSPointerDown",te="MSPointerMove MSPointerUp MSPointerCancel"),y(ne,j,{handler:function(e){var t=this.store,n=!1,r=e.type.toLowerCase().replace("ms",""),i=Z[r],o=Q[e.pointerType]||e.pointerType,a=o==L,s=C(t,e.pointerId,"pointerId");1&i&&(0===e.button||a)?s<0&&(t.push(e),s=t.length-1):12&i&&(n=!0),s<0||(t[s]=e,this.callback(this.manager,i,{pointers:t,changedPointers:[e],pointerType:o,srcEvent:e}),n&&t.splice(s,1))}});var re={touchstart:1,touchmove:2,touchend:4,touchcancel:8};function ie(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,j.apply(this,arguments)}function oe(e,t){var n=N(e.touches),r=N(e.changedTouches);return 12&t&&(n=T(n.concat(r),"identifier")),[n,r]}y(ie,j,{handler:function(e){var t=re[e.type];if(1===t&&(this.started=!0),this.started){var n=oe.call(this,e,t);12&t&&n[0].length-n[1].length===0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:L,srcEvent:e})}}});var ae={touchstart:1,touchmove:2,touchend:4,touchcancel:8},se="touchstart touchmove touchend touchcancel";function le(){this.evTarget=se,this.targetIds={},j.apply(this,arguments)}function ce(e,t){var n=N(e.touches),r=this.targetIds;if(3&t&&1===n.length)return r[n[0].identifier]=!0,[n,n];var i,o,a=N(e.changedTouches),s=[],l=this.target;if(o=n.filter(function(e){return w(e.target,l)}),1===t)for(i=0;i<o.length;)r[o[i].identifier]=!0,i++;for(i=0;i<a.length;)r[a[i].identifier]&&s.push(a[i]),12&t&&delete r[a[i].identifier],i++;return s.length?[T(o.concat(s),"identifier"),s]:void 0}function ue(){j.apply(this,arguments);var e=v(this.handler,this);this.touch=new le(this.manager,e),this.mouse=new J(this.manager,e),this.primaryTouch=null,this.lastTouches=[]}function de(e,t){1&e?(this.primaryTouch=t.changedPointers[0].identifier,fe.call(this,t)):12&e&&fe.call(this,t)}function fe(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var n={x:t.clientX,y:t.clientY};this.lastTouches.push(n);var r=this.lastTouches;setTimeout(function(){var e=r.indexOf(n);e>-1&&r.splice(e,1)},2500)}}function he(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,r=0;r<this.lastTouches.length;r++){var i=this.lastTouches[r],o=Math.abs(t-i.x),a=Math.abs(n-i.y);if(o<=25&&a<=25)return!0}return!1}y(le,j,{handler:function(e){var t=ae[e.type],n=ce.call(this,e,t);n&&this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:L,srcEvent:e})}}),y(ue,j,{handler:function(e,t,n){var r=n.pointerType==L,i=n.pointerType==P;if(!(i&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(r)de.call(this,t,n);else if(i&&he.call(this,n))return;this.callback(e,t,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var pe=D(s.style,"touchAction"),me=pe!==i,ge="compute",ye="auto",ve="manipulation",be="none",xe="pan-x",Se="pan-y",Me=function(){if(!me)return!1;var e={},n=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(r){e[r]=!n||t.CSS.supports("touch-action",r)}),e}();function we(e,t){this.manager=e,this.set(t)}we.prototype={set:function(e){e==ge&&(e=this.compute()),me&&this.manager.element.style&&Me[e]&&(this.manager.element.style[pe]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var e=[];return h(this.manager.recognizers,function(t){b(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))}),function(e){if(k(e,be))return be;var t=k(e,xe),n=k(e,Se);return t&&n?be:t||n?t?xe:Se:k(e,ve)?ve:ye}(e.join(" "))},preventDefaults:function(e){var t=e.srcEvent,n=e.offsetDirection;if(this.manager.session.prevented)t.preventDefault();else{var r=this.actions,i=k(r,be)&&!Me[be],o=k(r,Se)&&!Me[Se],a=k(r,xe)&&!Me[xe];if(i){var s=1===e.pointers.length,l=e.distance<2,c=e.deltaTime<250;if(s&&l&&c)return}if(!a||!o)return i||o&&6&n||a&&n&R?this.preventSrc(t):void 0}},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};var ke=32;function Ee(e){this.options=o({},this.defaults,e||{}),this.id=q++,this.manager=null,this.options.enable=x(this.options.enable,!0),this.state=1,this.simultaneous={},this.requireFail=[]}function Ce(e){return 16&e?"cancel":8&e?"end":4&e?"move":2&e?"start":""}function Ne(e){return 16==e?"down":8==e?"up":2==e?"left":4==e?"right":""}function Te(e,t){var n=t.manager;return n?n.get(e):e}function De(){Ee.apply(this,arguments)}function qe(){De.apply(this,arguments),this.pX=null,this.pY=null}function Oe(){De.apply(this,arguments)}function Ie(){Ee.apply(this,arguments),this._timer=null,this._input=null}function Ae(){De.apply(this,arguments)}function _e(){De.apply(this,arguments)}function Le(){Ee.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function Pe(e,t){return(t=t||{}).recognizers=x(t.recognizers,Pe.defaults.preset),new Re(e,t)}function Re(e,t){var n;this.options=o({},Pe.defaults,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=new((n=this).options.inputClass||(A?ne:_?le:I?ue:J))(n,$),this.touchAction=new we(this,this.options.touchAction),Fe(this,!0),h(this.options.recognizers,function(e){var t=this.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])},this)}function Fe(e,t){var n,r=e.element;r.style&&(h(e.options.cssProps,function(i,o){n=D(r.style,o),t?(e.oldCssProps[n]=r.style[n],r.style[n]=i):r.style[n]=e.oldCssProps[n]||""}),t||(e.oldCssProps={}))}Ee.prototype={defaults:{},set:function(e){return o(this.options,e),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(e){if(f(e,"recognizeWith",this))return this;var t=this.simultaneous;return t[(e=Te(e,this)).id]||(t[e.id]=e,e.recognizeWith(this)),this},dropRecognizeWith:function(e){return f(e,"dropRecognizeWith",this)||(e=Te(e,this),delete this.simultaneous[e.id]),this},requireFailure:function(e){if(f(e,"requireFailure",this))return this;var t=this.requireFail;return-1===C(t,e=Te(e,this))&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(f(e,"dropRequireFailure",this))return this;e=Te(e,this);var t=C(this.requireFail,e);return t>-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){var t=this,n=this.state;function r(n){t.manager.emit(n,e)}n<8&&r(t.options.event+Ce(n)),r(t.options.event),e.additionalEvent&&r(e.additionalEvent),n>=8&&r(t.options.event+Ce(n))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=ke},canEmit:function(){for(var e=0;e<this.requireFail.length;){if(!(33&this.requireFail[e].state))return!1;e++}return!0},recognize:function(e){var t=o({},e);if(!b(this.options.enable,[this,t]))return this.reset(),void(this.state=ke);56&this.state&&(this.state=1),this.state=this.process(t),30&this.state&&this.tryEmit(t)},process:function(e){},getTouchAction:function(){},reset:function(){}},y(De,Ee,{defaults:{pointers:1},attrTest:function(e){var t=this.options.pointers;return 0===t||e.pointers.length===t},process:function(e){var t=this.state,n=e.eventType,r=6&t,i=this.attrTest(e);return r&&(8&n||!i)?16|t:r||i?4&n?8|t:2&t?4|t:2:ke}}),y(qe,De,{defaults:{event:"pan",threshold:10,pointers:1,direction:30},getTouchAction:function(){var e=this.options.direction,t=[];return 6&e&&t.push(Se),e&R&&t.push(xe),t},directionTest:function(e){var t=this.options,n=!0,r=e.distance,i=e.direction,o=e.deltaX,a=e.deltaY;return i&t.direction||(6&t.direction?(i=0===o?1:o<0?2:4,n=o!=this.pX,r=Math.abs(e.deltaX)):(i=0===a?1:a<0?8:16,n=a!=this.pY,r=Math.abs(e.deltaY))),e.direction=i,n&&r>t.threshold&&i&t.direction},attrTest:function(e){return De.prototype.attrTest.call(this,e)&&(2&this.state||!(2&this.state)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=Ne(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),y(Oe,De,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[be]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),y(Ie,Ee,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[ye]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,i=e.deltaTime>t.time;if(this._input=e,!r||!n||12&e.eventType&&!i)this.reset();else if(1&e.eventType)this.reset(),this._timer=d(function(){this.state=8,this.tryEmit()},t.time,this);else if(4&e.eventType)return 8;return ke},reset:function(){clearTimeout(this._timer)},emit:function(e){8===this.state&&(e&&4&e.eventType?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=u(),this.manager.emit(this.options.event,this._input)))}}),y(Ae,De,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[be]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),y(_e,De,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return qe.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return 30&n?t=e.overallVelocity:6&n?t=e.overallVelocityX:n&R&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&c(t)>this.options.velocity&&4&e.eventType},emit:function(e){var t=Ne(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),y(Le,Ee,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ve]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,i=e.deltaTime<t.time;if(this.reset(),1&e.eventType&&0===this.count)return this.failTimeout();if(r&&i&&n){if(4!=e.eventType)return this.failTimeout();var o=!this.pTime||e.timeStamp-this.pTime<t.interval,a=!this.pCenter||W(this.pCenter,e.center)<t.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,a&&o?this.count+=1:this.count=1,this._input=e,0===this.count%t.taps)return this.hasRequireFailures()?(this._timer=d(function(){this.state=8,this.tryEmit()},t.interval,this),2):8}return ke},failTimeout:function(){return this._timer=d(function(){this.state=ke},this.options.interval,this),ke},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),Pe.VERSION="2.0.7",Pe.defaults={domEvents:!1,touchAction:ge,enable:!0,inputTarget:null,inputClass:null,preset:[[Ae,{enable:!1}],[Oe,{enable:!1},["rotate"]],[_e,{direction:6}],[qe,{direction:6},["swipe"]],[Le],[Le,{event:"doubletap",taps:2},["tap"]],[Ie]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},Re.prototype={set:function(e){return o(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},stop:function(e){this.session.stopped=e?2:1},recognize:function(e){var t=this.session;if(!t.stopped){var n;this.touchAction.preventDefaults(e);var r=this.recognizers,i=t.curRecognizer;(!i||i&&8&i.state)&&(i=t.curRecognizer=null);for(var o=0;o<r.length;)n=r[o],2===t.stopped||i&&n!=i&&!n.canRecognizeWith(i)?n.reset():n.recognize(e),!i&&14&n.state&&(i=t.curRecognizer=n),o++}},get:function(e){if(e instanceof Ee)return e;for(var t=this.recognizers,n=0;n<t.length;n++)if(t[n].options.event==e)return t[n];return null},add:function(e){if(f(e,"add",this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},remove:function(e){if(f(e,"remove",this))return this;if(e=this.get(e)){var t=this.recognizers,n=C(t,e);-1!==n&&(t.splice(n,1),this.touchAction.update())}return this},on:function(e,t){if(e!==i&&t!==i){var n=this.handlers;return h(E(e),function(e){n[e]=n[e]||[],n[e].push(t)}),this}},off:function(e,t){if(e!==i){var n=this.handlers;return h(E(e),function(e){t?n[e]&&n[e].splice(C(n[e],t),1):delete n[e]}),this}},emit:function(e,t){this.options.domEvents&&function(e,t){var r=n.createEvent("Event");r.initEvent(e,!0,!0),r.gesture=t,t.target.dispatchEvent(r)}(e,t);var r=this.handlers[e]&&this.handlers[e].slice();if(r&&r.length){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()};for(var i=0;i<r.length;)r[i](t),i++}},destroy:function(){this.element&&Fe(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},o(Pe,{INPUT_START:1,INPUT_MOVE:2,INPUT_END:4,INPUT_CANCEL:8,STATE_POSSIBLE:1,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:ke,DIRECTION_NONE:1,DIRECTION_LEFT:2,DIRECTION_RIGHT:4,DIRECTION_UP:8,DIRECTION_DOWN:16,DIRECTION_HORIZONTAL:6,DIRECTION_VERTICAL:R,DIRECTION_ALL:30,Manager:Re,Input:j,TouchAction:we,TouchInput:le,MouseInput:J,PointerEventInput:ne,TouchMouseInput:ue,SingleTouchInput:ie,Recognizer:Ee,AttrRecognizer:De,Tap:Le,Pan:qe,Swipe:_e,Pinch:Oe,Rotate:Ae,Press:Ie,on:S,off:M,each:h,merge:g,extend:m,assign:o,inherit:y,bindFn:v,prefixed:D}),(void 0!==t?t:"undefined"!=typeof self?self:{}).Hammer=Pe,e.exports?e.exports=Pe:t.Hammer=Pe}(window,document)}(_q)),_q.exports),Pq=o(Lq);const Rq={click:"Tap",Click:"Tap",tap:"Tap",pan:"Pan",swipe:"Swipe",rotate:"Rotate",press:"Press",pinch:"Pinch"};function Fq(e){return Rq[e]||e}function zq(e){return function(t,n,r){let i,o,a,s,l=[],c=!0;function u(){"function"==typeof i.enable&&(i.enable=i.enable.bind(o)()),i.enable&&(i.gestures.forEach(t=>{t.options=t.options||{},void 0===t.options.enable&&(t.options.enable=!0),"function"==typeof t.options.enable&&(t.options.enable=t.options.enable.bind(o));const n=Fq(t.type);e&&e[n]&&(t.options.event=t.options.event||t.type.toLowerCase(),a=a||new e.Manager(r),a.add(new e[n](t.options)),Object.keys(t.events).forEach(e=>{t.events[e]=t.events[e].bind(o),a.on(e,t.events[e])}),l.push(t))}),i.gestures.forEach(t=>{const n=Fq(t.type);e&&e[n]&&(t.recognizeWith&&a.get(t.options.event).recognizeWith(t.recognizeWith.split(" ").filter(e=>""!==e)),t.requireFailure&&a.get(t.options.event).requireFailure(t.requireFailure.split(" ").filter(e=>""!==e)))}))}function d(){l.forEach(e=>{Object.keys(e.events).forEach(t=>{a.off(t,e.events[t])}),a.remove(e.options.event)}),l=[]}return{get key(){return s},set(e){!function(e){s=e.key,i=e,o={chart:t,mediator:n,settings:i},i.gestures=i.gestures||[],void 0===i.enable&&(i.enable=!0)}(e),d(),c&&u()},off(){c=!1,d()},on(){c=!0,0===l.length&&u()},destroy(){d(),a&&a.destroy(),a=null,o=null,i=null}}}}var jq=Object.prototype.hasOwnProperty,$q=Object.prototype.toString,Vq=Object.defineProperty,Uq=Object.getOwnPropertyDescriptor,Hq=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===$q.call(e)},Bq=function(e){if(!e||"[object Object]"!==$q.call(e))return!1;var t,n=jq.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&jq.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||jq.call(e,t)},Wq=function(e,t){Vq&&"__proto__"===t.name?Vq(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},Yq=function(e,t){if("__proto__"===t){if(!jq.call(e,t))return;if(Uq)return Uq(e,t).value}return e[t]},Gq=function e(){var t,n,r,i,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)r=Yq(s,n),s!==(i=Yq(t,n))&&(u&&i&&(Bq(i)||(o=Hq(i)))?(o?(o=!1,a=r&&Hq(r)?r:[]):a=r&&Bq(r)?r:{},Wq(s,{name:n,newValue:e(u,a,i)})):void 0!==i&&Wq(s,{name:n,newValue:i}));return s},Kq="2.11.5";function Xq(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Jq(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 r=n.call(e,t);if("object"!=typeof r)return r;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 Zq(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Qq(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Zq(Object(n),!0).forEach(function(t){Jq(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Zq(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function eO(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 r,i,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=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Xq(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)?Xq(e,t):void 0}}(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 tO(e){return!!e.changedTouches}function nO(e){return"number"==typeof e&&!isNaN(e)}function rO(e){return"number"!=typeof e||isNaN(e)}function iO(e){const t=e.length;let n=NaN,r=NaN,i=NaN,o=NaN;for(let a=0;a<t;a++)n=isNaN(n)?e[a].x:Math.min(n,e[a].x),r=isNaN(r)?e[a].x:Math.max(r,e[a].x),i=isNaN(i)?e[a].y:Math.min(i,e[a].y),o=isNaN(o)?e[a].y:Math.max(o,e[a].y);return[n,i,r,o]}function oO(e){return[{x:e.x1||0,y:e.y1||0},{x:e.x2||0,y:e.y2||0}]}function aO(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 sO(e){const t=eO(iO(e),4),n=t[0],r=t[1];return{x:n,y:r,width:t[2]-n,height:t[3]-r}}function lO(e){return{x1:e[0].x,y1:e[0].y,x2:e[1].x,y2:e[1].y}}function cO(e){const t=e||{},n=t.x,r=t.y,i=t.width,o=t.height,a=t.x1,s=t.x2,l=t.y1,c=t.y2,u=t.cx,d=t.cy,f=t.r,h=t.vertices;return nO(u)&&nO(d)&&nO(f)?"circle":nO(a)&&nO(s)&&nO(l)&&nO(c)?"line":nO(n)&&nO(r)&&nO(i)&&nO(o)?"rect":nO(n)&&nO(r)?"point":Array.isArray(h)?h.every(e=>Array.isArray(e))?"geopolygon":"polygon":null}function uO(e,t){return{x:t.x-e,y:t.y-e,width:t.width+e,height:t.height+e}}function dO(e){return function(){return e}}const fO=Math.abs,hO=Math.atan2,pO=Math.cos,mO=Math.max,gO=Math.min,yO=Math.sin,vO=Math.sqrt,bO=1e-12,xO=Math.PI,SO=xO/2,MO=2*xO;function wO(e){return e>=1?SO:e<=-1?-SO:Math.asin(e)}const kO=Math.PI,EO=2*kO,CO=1e-6,NO=EO-CO;function TO(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}class DO{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==e?TO:function(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return TO;const n=10**t;return function(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=Math.round(arguments[t]*n)/n+e[t]}}(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,n,r){this._append`Q${+e},${+t},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(e,t,n,r,i,o){this._append`C${+e},${+t},${+n},${+r},${this._x1=+i},${this._y1=+o}`}arcTo(e,t,n,r,i){if(e=+e,t=+t,n=+n,r=+r,(i=+i)<0)throw new Error(`negative radius: ${i}`);let o=this._x1,a=this._y1,s=n-e,l=r-t,c=o-e,u=a-t,d=c*c+u*u;if(null===this._x1)this._append`M${this._x1=e},${this._y1=t}`;else if(d>CO)if(Math.abs(u*s-l*c)>CO&&i){let f=n-o,h=r-a,p=s*s+l*l,m=f*f+h*h,g=Math.sqrt(p),y=Math.sqrt(d),v=i*Math.tan((kO-Math.acos((p+d-m)/(2*g*y)))/2),b=v/y,x=v/g;Math.abs(b-1)>CO&&this._append`L${e+b*c},${t+b*u}`,this._append`A${i},${i},0,0,${+(u*f>c*h)},${this._x1=e+x*s},${this._y1=t+x*l}`}else this._append`L${this._x1=e},${this._y1=t}`;else;}arc(e,t,n,r,i,o){if(e=+e,t=+t,o=!!o,(n=+n)<0)throw new Error(`negative radius: ${n}`);let a=n*Math.cos(r),s=n*Math.sin(r),l=e+a,c=t+s,u=1^o,d=o?r-i:i-r;null===this._x1?this._append`M${l},${c}`:(Math.abs(this._x1-l)>CO||Math.abs(this._y1-c)>CO)&&this._append`L${l},${c}`,n&&(d<0&&(d=d%EO+EO),d>NO?this._append`A${n},${n},0,1,${u},${e-a},${t-s}A${n},${n},0,1,${u},${this._x1=l},${this._y1=c}`:d>CO&&this._append`A${n},${n},0,${+(d>=kO)},${u},${this._x1=e+n*Math.cos(i)},${this._y1=t+n*Math.sin(i)}`)}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}}function qO(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(null==n)t=null;else{const e=Math.floor(n);if(!(e>=0))throw new RangeError(`invalid digits: ${n}`);t=e}return e},()=>new DO(t)}function OO(e){return e.innerRadius}function IO(e){return e.outerRadius}function AO(e){return e.startAngle}function _O(e){return e.endAngle}function LO(e){return e&&e.padAngle}function PO(e,t,n,r,i,o,a){var s=e-n,l=t-r,c=(a?o:-o)/vO(s*s+l*l),u=c*l,d=-c*s,f=e+u,h=t+d,p=n+u,m=r+d,g=(f+p)/2,y=(h+m)/2,v=p-f,b=m-h,x=v*v+b*b,S=i-o,M=f*m-p*h,w=(b<0?-1:1)*vO(mO(0,S*S*x-M*M)),k=(M*b-v*w)/x,E=(-M*v-b*w)/x,C=(M*b+v*w)/x,N=(-M*v+b*w)/x,T=k-g,D=E-y,q=C-g,O=N-y;return T*T+D*D>q*q+O*O&&(k=C,E=N),{cx:k,cy:E,x01:-u,y01:-d,x11:k*(i/S-1),y11:E*(i/S-1)}}function RO(){var e=OO,t=IO,n=dO(0),r=null,i=AO,o=_O,a=LO,s=null,l=qO(c);function c(){var c,u,d=+e.apply(this,arguments),f=+t.apply(this,arguments),h=i.apply(this,arguments)-SO,p=o.apply(this,arguments)-SO,m=fO(p-h),g=p>h;if(s||(s=c=l()),f<d&&(u=f,f=d,d=u),f>bO)if(m>MO-bO)s.moveTo(f*pO(h),f*yO(h)),s.arc(0,0,f,h,p,!g),d>bO&&(s.moveTo(d*pO(p),d*yO(p)),s.arc(0,0,d,p,h,g));else{var y,v,b=h,x=p,S=h,M=p,w=m,k=m,E=a.apply(this,arguments)/2,C=E>bO&&(r?+r.apply(this,arguments):vO(d*d+f*f)),N=gO(fO(f-d)/2,+n.apply(this,arguments)),T=N,D=N;if(C>bO){var q=wO(C/d*yO(E)),O=wO(C/f*yO(E));(w-=2*q)>bO?(S+=q*=g?1:-1,M-=q):(w=0,S=M=(h+p)/2),(k-=2*O)>bO?(b+=O*=g?1:-1,x-=O):(k=0,b=x=(h+p)/2)}var I=f*pO(b),A=f*yO(b),_=d*pO(M),L=d*yO(M);if(N>bO){var P,R=f*pO(x),F=f*yO(x),z=d*pO(S),j=d*yO(S);if(m<xO)if(P=function(e,t,n,r,i,o,a,s){var l=n-e,c=r-t,u=a-i,d=s-o,f=d*l-u*c;if(!(f*f<bO))return[e+(f=(u*(t-o)-d*(e-i))/f)*l,t+f*c]}(I,A,z,j,R,F,_,L)){var $=I-P[0],V=A-P[1],U=R-P[0],H=F-P[1],B=1/yO(function(e){return e>1?0:e<-1?xO:Math.acos(e)}(($*U+V*H)/(vO($*$+V*V)*vO(U*U+H*H)))/2),W=vO(P[0]*P[0]+P[1]*P[1]);T=gO(N,(d-W)/(B-1)),D=gO(N,(f-W)/(B+1))}else T=D=0}k>bO?D>bO?(y=PO(z,j,I,A,f,D,g),v=PO(R,F,_,L,f,D,g),s.moveTo(y.cx+y.x01,y.cy+y.y01),D<N?s.arc(y.cx,y.cy,D,hO(y.y01,y.x01),hO(v.y01,v.x01),!g):(s.arc(y.cx,y.cy,D,hO(y.y01,y.x01),hO(y.y11,y.x11),!g),s.arc(0,0,f,hO(y.cy+y.y11,y.cx+y.x11),hO(v.cy+v.y11,v.cx+v.x11),!g),s.arc(v.cx,v.cy,D,hO(v.y11,v.x11),hO(v.y01,v.x01),!g))):(s.moveTo(I,A),s.arc(0,0,f,b,x,!g)):s.moveTo(I,A),d>bO&&w>bO?T>bO?(y=PO(_,L,R,F,d,-T,g),v=PO(I,A,z,j,d,-T,g),s.lineTo(y.cx+y.x01,y.cy+y.y01),T<N?s.arc(y.cx,y.cy,T,hO(y.y01,y.x01),hO(v.y01,v.x01),!g):(s.arc(y.cx,y.cy,T,hO(y.y01,y.x01),hO(y.y11,y.x11),!g),s.arc(0,0,d,hO(y.cy+y.y11,y.cx+y.x11),hO(v.cy+v.y11,v.cx+v.x11),g),s.arc(v.cx,v.cy,T,hO(v.y11,v.x11),hO(v.y01,v.x01),!g))):s.arc(0,0,d,M,S,g):s.lineTo(_,L)}else s.moveTo(0,0);if(s.closePath(),c)return s=null,c+""||null}return c.centroid=function(){var n=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +o.apply(this,arguments))/2-xO/2;return[pO(r)*n,yO(r)*n]},c.innerRadius=function(t){return arguments.length?(e="function"==typeof t?t:dO(+t),c):e},c.outerRadius=function(e){return arguments.length?(t="function"==typeof e?e:dO(+e),c):t},c.cornerRadius=function(e){return arguments.length?(n="function"==typeof e?e:dO(+e),c):n},c.padRadius=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:dO(+e),c):r},c.startAngle=function(e){return arguments.length?(i="function"==typeof e?e:dO(+e),c):i},c.endAngle=function(e){return arguments.length?(o="function"==typeof e?e:dO(+e),c):o},c.padAngle=function(e){return arguments.length?(a="function"==typeof e?e:dO(+e),c):a},c.context=function(e){return arguments.length?(s=null==e?null:e,c):s},c}function FO(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}function zO(e){this._context=e}function jO(e){return new zO(e)}function $O(e){return e[0]}function VO(e){return e[1]}function UO(e,t,n){var r=null,i=dO(!0),o=null,a=jO,s=null,l=qO(c);function c(c){var u,d,f,h,p,m=(c=FO(c)).length,g=!1,y=new Array(m),v=new Array(m);for(null==o&&(s=a(p=l())),u=0;u<=m;++u){if(!(u<m&&i(h=c[u],u,c))===g)if(g=!g)d=u,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),f=u-1;f>=d;--f)s.point(y[f],v[f]);s.lineEnd(),s.areaEnd()}g&&(y[u]=+e(h,u,c),v[u]=+t(h,u,c),s.point(r?+r(h,u,c):y[u],n?+n(h,u,c):v[u]))}if(p)return s=null,p+""||null}function u(){return function(e,t){var n=dO(!0),r=null,i=jO,o=null,a=qO(s);function s(s){var l,c,u,d=(s=FO(s)).length,f=!1;for(null==r&&(o=i(u=a())),l=0;l<=d;++l)!(l<d&&n(c=s[l],l,s))===f&&((f=!f)?o.lineStart():o.lineEnd()),f&&o.point(+e(c,l,s),+t(c,l,s));if(u)return o=null,u+""||null}return e="function"==typeof e?e:void 0===e?$O:dO(e),t="function"==typeof t?t:void 0===t?VO:dO(t),s.x=function(t){return arguments.length?(e="function"==typeof t?t:dO(+t),s):e},s.y=function(e){return arguments.length?(t="function"==typeof e?e:dO(+e),s):t},s.defined=function(e){return arguments.length?(n="function"==typeof e?e:dO(!!e),s):n},s.curve=function(e){return arguments.length?(i=e,null!=r&&(o=i(r)),s):i},s.context=function(e){return arguments.length?(null==e?r=o=null:o=i(r=e),s):r},s}().defined(i).curve(a).context(o)}return e="function"==typeof e?e:void 0===e?$O:dO(+e),t="function"==typeof t?t:dO(void 0===t?0:+t),n="function"==typeof n?n:void 0===n?VO:dO(+n),c.x=function(t){return arguments.length?(e="function"==typeof t?t:dO(+t),r=null,c):e},c.x0=function(t){return arguments.length?(e="function"==typeof t?t:dO(+t),c):e},c.x1=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:dO(+e),c):r},c.y=function(e){return arguments.length?(t="function"==typeof e?e:dO(+e),n=null,c):t},c.y0=function(e){return arguments.length?(t="function"==typeof e?e:dO(+e),c):t},c.y1=function(e){return arguments.length?(n=null==e?null:"function"==typeof e?e:dO(+e),c):n},c.lineX0=c.lineY0=function(){return u().x(e).y(t)},c.lineY1=function(){return u().x(e).y(n)},c.lineX1=function(){return u().x(r).y(t)},c.defined=function(e){return arguments.length?(i="function"==typeof e?e:dO(!!e),c):i},c.curve=function(e){return arguments.length?(a=e,null!=o&&(s=a(o)),c):a},c.context=function(e){return arguments.length?(null==e?o=s=null:s=a(o=e),c):o},c}function HO(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function BO(e){return e}function WO(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 YO(e){this._context=e}function GO(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 KO(e,t){this._context=e,this._k=(1-t)/6}zO.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)}}},YO.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:WO(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:WO(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},KO.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:GO(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:GO(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 XO=function e(t){function n(e){return new KO(e,t)}return n.tension=function(t){return e(+t)},n}(0);function JO(e,t){this._context=e,this._alpha=t}JO.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,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:!function(e,t,n){var r=e._x1,i=e._y1,o=e._x2,a=e._y2;if(e._l01_a>bO){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);r=(r*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,i=(i*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>bO){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(r,i,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 ZO=function e(t){function n(e){return t?new JO(e,t):new KO(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function QO(e){return e<0?-1:1}function eI(e,t,n){var r=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(r||i<0&&-0),a=(n-e._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return(QO(o)+QO(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function tI(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function nI(e,t,n){var r=e._x0,i=e._y0,o=e._x1,a=e._y1,s=(o-r)/3;e._context.bezierCurveTo(r+s,i+s*t,o-s,a-s*n,o,a)}function rI(e){this._context=e}function iI(e){this._context=new oI(e)}function oI(e){this._context=e}function aI(e){this._context=e}function sI(e){var t,n,r=e.length-1,i=new Array(r),o=new Array(r),a=new Array(r);for(i[0]=0,o[0]=2,a[0]=e[0]+2*e[1],t=1;t<r-1;++t)i[t]=1,o[t]=4,a[t]=4*e[t]+2*e[t+1];for(i[r-1]=2,o[r-1]=7,a[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=i[t]/o[t-1],o[t]-=n,a[t]-=n*a[t-1];for(i[r-1]=a[r-1]/o[r-1],t=r-2;t>=0;--t)i[t]=(a[t]-i[t+1])/o[t];for(o[r-1]=(e[r]+i[r-1])/2,t=0;t<r-1;++t)o[t]=2*e[t+1]-i[t+1];return[i,o]}function lI(e,t){this._context=e,this._t=t}function cI(e,t){if((i=e.length)>1)for(var n,r,i,o=1,a=e[t[0]],s=a.length;o<i;++o)for(r=a,a=e[t[o]],n=0;n<s;++n)a[n][1]+=a[n][0]=isNaN(r[n][1])?r[n][0]:r[n][1]}function uI(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function dI(e,t){return e[t]}function fI(e){const t=[];return t.key=e,t}function hI(e){for(var t,n=-1,r=0,i=e.length,o=-1/0;++n<i;)(t=+e[n][1])>o&&(o=t,r=n);return r}function pI(e){for(var t,n=0,r=-1,i=e.length;++r<i;)(t=+e[r][1])&&(n+=t);return n}function mI(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unspecified",r=arguments.length>2?arguments[2]:void 0;const i={},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 i)&&(i[e]=t,!0)}function s(e){return i[e]||o.get(e)}function l(e,i){if(void 0!==i)return a(e,i);const o=s(e);return r&&void 0===o&&r.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!!i[e]||o.has(e)},l.remove=function(e){const t=i[e];return delete i[e],t},l.getKeys=function(){return Object.keys(i)},l.getValues=function(){return Object.keys(i).map(e=>i[e])},l.default=function(e){return void 0!==e&&(t=e),t},l.register=a,l}function gI(e,t){if(!isFinite(e)||0===e)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function yI(e){return(e=gI(Math.abs(e)))?e[1]:NaN}rI.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:nI(this,this._t0,tI(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,nI(this,tI(this,n=eI(this,e,t)),n);break;default:nI(this,this._t0,n=eI(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}},(iI.prototype=Object.create(rI.prototype)).point=function(e,t){rI.prototype.point.call(this,t,e)},oI.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,o){this._context.bezierCurveTo(t,e,r,n,o,i)}},aI.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 r=sI(e),i=sI(t),o=0,a=1;a<n;++o,++a)this._context.bezierCurveTo(r[0][o],i[0][o],r[1][o],i[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)}},lI.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 vI,bI=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function xI(e){if(!(t=bI.exec(e)))throw new Error("invalid format: "+e);var t;return new SI({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 SI(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 MI(e,t){var n=gI(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}xI.prototype=SI.prototype,SI.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 wI={"%":(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)=>MI(100*e,t),r:MI,s:function(e,t){var n=gI(e,t);if(!n)return vI=void 0,e.toPrecision(t);var r=n[0],i=n[1],o=i-(vI=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+gI(e,Math.max(0,t+o-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function kI(e){return e}var EI,CI,NI,TI=Array.prototype.map,DI=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function qI(e){var t=void 0===e.grouping||void 0===e.thousands?kI:function(e,t){return function(n,r){for(var i=n.length,o=[],a=0,s=e[0],l=0;i>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),o.push(n.substring(i-=s,i+s)),!((l+=s+1)>r));)s=e[a=(a+1)%e.length];return o.reverse().join(t)}}(TI.call(e.grouping,Number),e.thousands+""),n=void 0===e.currency?"":e.currency[0]+"",r=void 0===e.currency?"":e.currency[1]+"",i=void 0===e.decimal?".":e.decimal+"",o=void 0===e.numerals?kI:function(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}(TI.call(e.numerals,String)),a=void 0===e.percent?"%":e.percent+"",s=void 0===e.minus?"−":e.minus+"",l=void 0===e.nan?"NaN":e.nan+"";function c(e,c){var u=(e=xI(e)).fill,d=e.align,f=e.sign,h=e.symbol,p=e.zero,m=e.width,g=e.comma,y=e.precision,v=e.trim,b=e.type;"n"===b?(g=!0,b="g"):wI[b]||(void 0===y&&(y=12),v=!0,b="g"),(p||"0"===u&&"="===d)&&(p=!0,u="0",d="=");var x=(c&&void 0!==c.prefix?c.prefix:"")+("$"===h?n:"#"===h&&/[boxX]/.test(b)?"0"+b.toLowerCase():""),S=("$"===h?r:/[%p]/.test(b)?a:"")+(c&&void 0!==c.suffix?c.suffix:""),M=wI[b],w=/[defgprs%]/.test(b);function k(e){var n,r,a,c=x,h=S;if("c"===b)h=M(e)+h,e="";else{var k=(e=+e)<0||1/e<0;if(e=isNaN(e)?l:M(Math.abs(e),y),v&&(e=function(e){e:for(var t,n=e.length,r=1,i=-1;r<n;++r)switch(e[r]){case".":i=t=r;break;case"0":0===i&&(i=r),t=r;break;default:if(!+e[r])break e;i>0&&(i=0)}return i>0?e.slice(0,i)+e.slice(t+1):e}(e)),k&&0===+e&&"+"!==f&&(k=!1),c=(k?"("===f?f:s:"-"===f||"("===f?"":f)+c,h=("s"!==b||isNaN(e)||void 0===vI?"":DI[8+vI/3])+h+(k&&"("===f?")":""),w)for(n=-1,r=e.length;++n<r;)if(48>(a=e.charCodeAt(n))||a>57){h=(46===a?i+e.slice(n+1):e.slice(n))+h,e=e.slice(0,n);break}}g&&!p&&(e=t(e,1/0));var E=c.length+e.length+h.length,C=E<m?new Array(m-E+1).join(u):"";switch(g&&p&&(e=t(C+e,C.length?m-h.length:1/0),C=""),d){case"<":e=c+e+h+C;break;case"=":e=c+C+e+h;break;case"^":e=C.slice(0,E=C.length>>1)+c+e+h+C.slice(E);break;default:e=C+c+e+h}return o(e)}return y=void 0===y?6:/[gprs]/.test(b)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y)),k.toString=function(){return e+""},k}return{format:c,formatPrefix:function(e,t){var n=3*Math.max(-8,Math.min(8,Math.floor(yI(t)/3))),r=Math.pow(10,-n),i=c(((e=xI(e)).type="f",e),{suffix:DI[8+n/3]});return function(e){return i(r*e)}}}}!function(e){EI=qI(e),CI=EI.format,NI=EI.formatPrefix}({thousands:",",grouping:[3],currency:["$",""]});const OI=new Date,II=new Date;function AI(e,t,n,r){function i(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return i.floor=t=>(e(t=new Date(+t)),t),i.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),i.round=e=>{const t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=(e,n)=>(t(e=new Date(+e),null==n?1:Math.floor(n)),e),i.range=(n,r,o)=>{const a=[];if(n=i.ceil(n),o=null==o?1:Math.floor(o),!(n<r&&o>0))return a;let s;do{a.push(s=new Date(+n)),t(n,o),e(n)}while(s<n&&n<r);return a},i.filter=n=>AI(t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},(e,r)=>{if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}),n&&(i.count=(t,r)=>(OI.setTime(+t),II.setTime(+r),e(OI),e(II),Math.floor(n(OI,II))),i.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(r?t=>r(t)%e===0:t=>i.count(0,t)%e===0):i:null)),i}const _I=6e4,LI=864e5,PI=6048e5,RI=AI(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*_I)/LI,e=>e.getDate()-1);RI.range;const FI=AI(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/LI,e=>e.getUTCDate()-1);FI.range;const zI=AI(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/LI,e=>Math.floor(e/LI));function jI(e){return AI(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())*_I)/PI)}zI.range;const $I=jI(0),VI=jI(1),UI=jI(2),HI=jI(3),BI=jI(4),WI=jI(5),YI=jI(6);function GI(e){return AI(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)/PI)}$I.range,VI.range,UI.range,HI.range,BI.range,WI.range,YI.range;const KI=GI(0),XI=GI(1),JI=GI(2),ZI=GI(3),QI=GI(4),eA=GI(5),tA=GI(6);KI.range,XI.range,JI.range,ZI.range,QI.range,eA.range,tA.range;const nA=AI(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());nA.every=e=>isFinite(e=Math.floor(e))&&e>0?AI(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,nA.range;const rA=AI(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 iA(e,t){return null==e||null==t?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function oA(e,t){return null==e||null==t?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function aA(e){let t,n,r;function i(e,r,i=0,o=e.length){if(i<o){if(0!==t(r,r))return o;do{const t=i+o>>>1;n(e[t],r)<0?i=t+1:o=t}while(i<o)}return i}return 2!==e.length?(t=iA,n=(t,n)=>iA(e(t),n),r=(t,n)=>e(t)-n):(t=e===iA||e===oA?e:sA,n=e,r=e),{left:i,center:function(e,t,n=0,o=e.length){const a=i(e,t,n,o-1);return a>n&&r(e[a-1],t)>-r(e[a],t)?a-1:a},right:function(e,r,i=0,o=e.length){if(i<o){if(0!==t(r,r))return o;do{const t=i+o>>>1;n(e[t],r)<=0?i=t+1:o=t}while(i<o)}return i}}}function sA(){return 0}rA.every=e=>isFinite(e=Math.floor(e))&&e>0?AI(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,rA.range;const lA=aA(iA).right;aA(function(e){return null===e?NaN:+e}).center;var cA=lA;class uA extends Map{constructor(e,t=fA){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(dA(this,e))}has(e){return super.has(dA(this,e))}set(e,t){return super.set(function({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}(this,e),t)}delete(e){return super.delete(function({_intern:e,_key:t},n){const r=t(n);e.has(r)&&(n=e.get(r),e.delete(r));return n}(this,e))}}function dA({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function fA(e){return null!==e&&"object"==typeof e?e.valueOf():e}const hA=Math.sqrt(50),pA=Math.sqrt(10),mA=Math.sqrt(2);function gA(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=hA?10:o>=pA?5:o>=mA?2:1;let s,l,c;return i<0?(c=Math.pow(10,-i)/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,i)*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?gA(e,t,2*n):[s,l,c]}function yA(e,t,n){return gA(e=+e,t=+t,n=+n)[2]}function vA(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 bA(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 xA(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function SA(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,o=e.days,a=e.shortDays,s=e.months,l=e.shortMonths,c=TA(i),u=DA(i),d=TA(o),f=DA(o),h=TA(a),p=DA(a),m=TA(s),g=DA(s),y=TA(l),v=DA(l),b={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:XA,e:XA,f:t_,g:f_,G:p_,H:JA,I:ZA,j:QA,L:e_,m:n_,M:r_,p:function(e){return i[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:R_,s:F_,S:i_,u:o_,U:a_,V:l_,w:c_,W:u_,x:null,X:null,y:d_,Y:h_,Z:m_,"%":P_},x={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:g_,e:g_,f:S_,g:I_,G:__,H:y_,I:v_,j:b_,L:x_,m:M_,M:w_,p:function(e){return i[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:R_,s:F_,S:k_,u:E_,U:C_,V:T_,w:D_,W:q_,x:null,X:null,y:O_,Y:A_,Z:L_,"%":P_},S={a:function(e,t,n){var r=h.exec(t.slice(n));return r?(e.w=p.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=f.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(e,t,n){var r=y.exec(t.slice(n));return r?(e.m=v.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(e,t,n){var r=m.exec(t.slice(n));return r?(e.m=g.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(e,n,r){return k(e,t,n,r)},d:jA,e:jA,f:WA,g:PA,G:LA,H:VA,I:VA,j:$A,L:BA,m:zA,M:UA,p:function(e,t,n){var r=c.exec(t.slice(n));return r?(e.p=u.get(r[0].toLowerCase()),n+r[0].length):-1},q:FA,Q:GA,s:KA,S:HA,u:OA,U:IA,V:AA,w:qA,W:_A,x:function(e,t,r){return k(e,n,t,r)},X:function(e,t,n){return k(e,r,t,n)},y:PA,Y:LA,Z:RA,"%":YA};function M(e,t){return function(n){var r,i,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!=(i=MA[r=e.charAt(++s)])?r=e.charAt(++s):i="e"===r?" ":"0",(o=t[r])&&(r=o(n,i)),a.push(r),l=s+1);return a.push(e.slice(l,s)),a.join("")}}function w(e,t){return function(n){var r,i,o=xA(1900,void 0,1);if(k(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?(i=(r=bA(xA(o.y,0,1))).getUTCDay(),r=i>4||0===i?XI.ceil(r):XI(r),r=FI.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=vA(xA(o.y,0,1))).getDay(),r=i>4||0===i?VI.ceil(r):VI(r),r=RI.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.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),i="Z"in o?bA(xA(o.y,0,1)).getUTCDay():vA(xA(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,bA(o)):vA(o)}}function k(e,t,n,r){for(var i,o,a=0,s=t.length,l=n.length;a<s;){if(r>=l)return-1;if(37===(i=t.charCodeAt(a++))){if(i=t.charAt(a++),!(o=S[i in MA?t.charAt(a++):i])||(r=o(e,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return b.x=M(n,b),b.X=M(r,b),b.c=M(t,b),x.x=M(n,x),x.X=M(r,x),x.c=M(t,x),{format:function(e){var t=M(e+="",b);return t.toString=function(){return e},t},parse:function(e){var t=w(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=M(e+="",x);return t.toString=function(){return e},t},utcParse:function(e){var t=w(e+="",!0);return t.toString=function(){return e},t}}}var MA={"-":"",_:" ",0:"0"},wA=/^\s*\d+/,kA=/^%/,EA=/[\\^$*+?|[\]().{}]/g;function CA(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(t)+i:i)}function NA(e){return e.replace(EA,"\\$&")}function TA(e){return new RegExp("^(?:"+e.map(NA).join("|")+")","i")}function DA(e){return new Map(e.map((e,t)=>[e.toLowerCase(),t]))}function qA(e,t,n){var r=wA.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function OA(e,t,n){var r=wA.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function IA(e,t,n){var r=wA.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function AA(e,t,n){var r=wA.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function _A(e,t,n){var r=wA.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function LA(e,t,n){var r=wA.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function PA(e,t,n){var r=wA.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function RA(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function FA(e,t,n){var r=wA.exec(t.slice(n,n+1));return r?(e.q=3*r[0]-3,n+r[0].length):-1}function zA(e,t,n){var r=wA.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function jA(e,t,n){var r=wA.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function $A(e,t,n){var r=wA.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function VA(e,t,n){var r=wA.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function UA(e,t,n){var r=wA.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function HA(e,t,n){var r=wA.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function BA(e,t,n){var r=wA.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function WA(e,t,n){var r=wA.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function YA(e,t,n){var r=kA.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function GA(e,t,n){var r=wA.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function KA(e,t,n){var r=wA.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function XA(e,t){return CA(e.getDate(),t,2)}function JA(e,t){return CA(e.getHours(),t,2)}function ZA(e,t){return CA(e.getHours()%12||12,t,2)}function QA(e,t){return CA(1+RI.count(nA(e),e),t,3)}function e_(e,t){return CA(e.getMilliseconds(),t,3)}function t_(e,t){return e_(e,t)+"000"}function n_(e,t){return CA(e.getMonth()+1,t,2)}function r_(e,t){return CA(e.getMinutes(),t,2)}function i_(e,t){return CA(e.getSeconds(),t,2)}function o_(e){var t=e.getDay();return 0===t?7:t}function a_(e,t){return CA($I.count(nA(e)-1,e),t,2)}function s_(e){var t=e.getDay();return t>=4||0===t?BI(e):BI.ceil(e)}function l_(e,t){return e=s_(e),CA(BI.count(nA(e),e)+(4===nA(e).getDay()),t,2)}function c_(e){return e.getDay()}function u_(e,t){return CA(VI.count(nA(e)-1,e),t,2)}function d_(e,t){return CA(e.getFullYear()%100,t,2)}function f_(e,t){return CA((e=s_(e)).getFullYear()%100,t,2)}function h_(e,t){return CA(e.getFullYear()%1e4,t,4)}function p_(e,t){var n=e.getDay();return CA((e=n>=4||0===n?BI(e):BI.ceil(e)).getFullYear()%1e4,t,4)}function m_(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+CA(t/60|0,"0",2)+CA(t%60,"0",2)}function g_(e,t){return CA(e.getUTCDate(),t,2)}function y_(e,t){return CA(e.getUTCHours(),t,2)}function v_(e,t){return CA(e.getUTCHours()%12||12,t,2)}function b_(e,t){return CA(1+FI.count(rA(e),e),t,3)}function x_(e,t){return CA(e.getUTCMilliseconds(),t,3)}function S_(e,t){return x_(e,t)+"000"}function M_(e,t){return CA(e.getUTCMonth()+1,t,2)}function w_(e,t){return CA(e.getUTCMinutes(),t,2)}function k_(e,t){return CA(e.getUTCSeconds(),t,2)}function E_(e){var t=e.getUTCDay();return 0===t?7:t}function C_(e,t){return CA(KI.count(rA(e)-1,e),t,2)}function N_(e){var t=e.getUTCDay();return t>=4||0===t?QI(e):QI.ceil(e)}function T_(e,t){return e=N_(e),CA(QI.count(rA(e),e)+(4===rA(e).getUTCDay()),t,2)}function D_(e){return e.getUTCDay()}function q_(e,t){return CA(XI.count(rA(e)-1,e),t,2)}function O_(e,t){return CA(e.getUTCFullYear()%100,t,2)}function I_(e,t){return CA((e=N_(e)).getUTCFullYear()%100,t,2)}function A_(e,t){return CA(e.getUTCFullYear()%1e4,t,4)}function __(e,t){var n=e.getUTCDay();return CA((e=n>=4||0===n?QI(e):QI.ceil(e)).getUTCFullYear()%1e4,t,4)}function L_(){return"+0000"}function P_(){return"%"}function R_(e){return+e}function F_(e){return Math.floor(+e/1e3)}const z_=mI();z_("d3-number",function(e,t,n){let r,i;function o(e){return i(e)}function a(){o.locale({decimal:n||".",thousands:t||",",grouping:[3],currency:["$",""]})}return o.locale=function(t){return r=qI(t),i=r.format(e),this},a(),o.format=function(e,i,o,s){return(o||s)&&(t=o,n=s,a()),r.format(e)(i)},o.pattern=function(t){return t&&(e=t,i=r.format(t)),e},o}),z_("d3-time",function(e){let t=SA({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 r(e){return n(e)}return r.format=function(e,n){return t.format(e)(n)},r.locale=function(){return t=SA(...arguments),n=t.format(e),this},r.parse=function(e,n){return t.parse(e)(n)},r.parsePattern=function(e){return t.parse(e)},r});const j_={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 z_(t.type||"d3-number")(t.format||"")})(e)};function $_(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.id,r=void 0===n?j_.id:n,i=t.key,o=void 0===i?j_.key:i,a=t.min,s=void 0===a?j_.min:a,l=t.max,c=void 0===l?j_.max:l,u=t.type,d=void 0===u?j_.type:u,f=t.tags,h=void 0===f?j_.tags:f,p=t.title,m=void 0===p?j_.title:p,g=t.values,y=void 0===g?j_.values:g,v=t.value,b=void 0===v?j_.value:v,x=t.label,S=void 0===x?j_.label:x,M=t.formatter,w=void 0===M?j_.formatter:M;return{id:()=>r(e),key:()=>o(e),raw:()=>e,tags:()=>h(e),type:()=>d(e),min:()=>s(e),max:()=>c(e),title:()=>m(e),items:()=>y(e),formatter:()=>w(e),value:b,label:S}}const V_=e=>e.filter(e=>"number"==typeof e&&!isNaN(e)),U_=e=>e.reduce((e,t)=>e+t,0),H_={first:e=>e[0],last:e=>e[e.length-1],min:e=>{const t=V_(e);return t.length?Math.min.apply(null,t):NaN},max:e=>{const t=V_(e);return t.length?Math.max.apply(null,t):NaN},sum:e=>{const t=V_(e);return t.length?t.reduce((e,t)=>e+t,0):NaN},avg:e=>{const t=V_(e),n=t.length;return n?U_(t)/n:NaN}};function B_(e,t,n,r){const i={},o=r.field||(void 0!==e.field?t.field(e.field):null);return Object.keys(n).forEach(a=>{const s=n[a],l=i[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=>B_(e,t,{main:n},r).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=H_[s.reduce]:l.field&&l.field.reduce&&(l.reduce="string"==typeof l.field.reduce?H_[l.field.reduce]:l.field.reduce),"function"==typeof s.reduceLabel?l.reduceLabel=s.reduceLabel:s.reduceLabel?l.reduceLabel=H_[s.reduceLabel]:l.field&&l.field.reduceLabel&&(l.reduceLabel="string"==typeof l.field.reduceLabel?H_[l.field.reduceLabel]:l.field.reduceLabel))}),i}function W_(e,t){const n=B_(e,t,{main:{value:e.value,label:e.label,reduce:e.reduce,filter:e.filter}},{}).main;return{props:B_(e,t,e.props||{},n),main:n}}function Y_(e,t,n,r){const i=Array(e.length),o=Array(e.length);let a;for(let t=0;t<e.length;t++)a=r?e[t][r]:e[t],i[t]=a.value,o[t]=a.label;const s=t.reduce,l=t.reduceLabel,c=s?s(i):i,u={value:c,label:l?l(o,c):n?n(c):String(c)};return r&&e[0][r].source?(u.source=e[0][r].source,u):!r&&e[0].source?(u.source=e[0].source,u):u}function G_(e,t){let n=t.main,r=t.propsArr,i=t.props,o=[];const a=n.field.formatter(),s={};return r.forEach(e=>{s[e]=i[e].field?i[e].field.formatter():e=>e}),o.push(...e.map(e=>{const t=Y_(e.items,n,a);return r.forEach(n=>{t[n]=Y_(e.items,i[n],s[n],n)}),t})),o}function K_(e){let t=e.cfg,n=e.itemData,r=e.obj,i=e.target,o=e.tracker;const a="function"===e.trackType?t.trackBy(n):n[t.trackBy];let s=o[a];s||(s=o[a]={items:[],id:a},i.push(s)),s.items.push(r)}function X_(e){if(e.length<1e4)return Math.max(...e);let t=-1/0;const n=e.length;for(let r=0;r<n;r++)t<e[r]&&(t=e[r]);return t}function J_(e){if(e.length<1e4)return Math.min(...e);let t=1/0;const n=e.length;for(let r=0;r<n;r++)t>e[r]&&(t=e[r]);return t}const Z_={diverging:function(e,t){const n=e.length;if(n<=0)return;const r=e[t[0]].length;for(let i=0;i<r;++i){let r=0,o=0;for(let a=0;a<n;++a){const n=e[t[a]][i],s=n[1]-n[0];s>=0?(n[0]=r,r+=s,n[1]=r):s<0?(n[1]=o,o+=s,n[0]=o):n[0]=r}}},none:cI,silhouette:function(e,t){if((n=e.length)>0){for(var n,r=0,i=e[t[0]],o=i.length;r<o;++r){for(var a=0,s=0;a<n;++a)s+=e[a][r][1]||0;i[r][1]+=i[r][0]=-s/2}cI(e,t)}},expand:function(e,t){if((r=e.length)>0){for(var n,r,i,o=0,a=e[0].length;o<a;++o){for(i=n=0;n<r;++n)i+=e[n][o][1]||0;if(i)for(n=0;n<r;++n)e[n][o][1]/=i}cI(e,t)}},wiggle:function(e,t){if((i=e.length)>0&&(r=(n=e[t[0]]).length)>0){for(var n,r,i,o=0,a=1;a<r;++a){for(var s=0,l=0,c=0;s<i;++s){for(var u=e[t[s]],d=u[a][1]||0,f=(d-(u[a-1][1]||0))/2,h=0;h<s;++h){var p=e[t[h]];f+=(p[a][1]||0)-(p[a-1][1]||0)}l+=d,c+=f*d}n[a-1][1]+=n[a-1][0]=o,l&&(o-=c/l)}n[a-1][1]+=n[a-1][0]=o,cI(e,t)}}},Q_={ascending:function(e){var t=e.map(pI);return uI(e).sort(function(e,n){return t[e]-t[n]})},insideout:function(e){var t,n,r=e.length,i=e.map(pI),o=function(e){var t=e.map(hI);return uI(e).sort(function(e,n){return t[e]-t[n]})}(e),a=0,s=0,l=[],c=[];for(t=0;t<r;++t)n=o[t],a<s?(a+=i[n],l.push(n)):(s+=i[n],c.push(n));return c.reverse().concat(l)},none:uI,reverse:function(e){return uI(e).reverse()}};function eL(e,t,n,r){const i=r||e.items,o={},a=t.stackKey,s=t.value,l=t.startProp||"start",c=t.endProp||"end",u=t.offset||"none",d=t.order||"none",f=t.valueRef||"";let h=0,p={};for(let e=0;e<i.length;e++){let t=i[e],n=f?t[f]:null;if(n&&n.source){let e="".concat(n.source.key||"","/").concat(n.source.field);p[e]||(p[e]=n.source)}let r=a(t);o[r]=o[r]||{items:[]},o[r].items.push(t),h=Math.max(h,o[r].items.length)}const m=Array.apply(null,{length:h}).map(Number.call,Number),g=Object.keys(o).map(e=>o[e].items),y=function(){var e=dO([]),t=uI,n=cI,r=dI;function i(i){var o,a,s=Array.from(e.apply(this,arguments),fI),l=s.length,c=-1;for(const e of i)for(o=0,++c;o<l;++o)(s[o][c]=[0,+r(e,s[o].key,c,i)]).data=e;for(o=0,a=FO(t(s));o<l;++o)s[a[o]].index=o;return n(s,a),s}return i.keys=function(t){return arguments.length?(e="function"==typeof t?t:dO(Array.from(t)),i):e},i.value=function(e){return arguments.length?(r="function"==typeof e?e:dO(+e),i):r},i.order=function(e){return arguments.length?(t=null==e?uI:"function"==typeof e?e:dO(Array.from(e)),i):t},i.offset=function(e){return arguments.length?(n=null==e?cI:e,i):n},i}().keys(m).value((e,t)=>e[t]?s(e[t]):0).order(Q_[d]).offset(Z_[u]);let v=y(g),b=[];for(let e=0;e<v.length;e++){let t=v[e];for(let e=0;e<t.length;e++){let n=t[e],r=t[e].data[t.key];r&&(r[l]={value:n[0]},r[c]={value:n[1]},b.push(n[0],n[1]))}}let x=Object.keys(p).map(e=>{let t=n(p[e].key);return t?t.field(p[e].field):null}).filter(e=>!!e);const S=$_({title:x.map(e=>e.title()).join(", "),min:J_(b),max:X_(b),type:"measure",formatter:x[0]?x[0].formatter:void 0});e.fields.push(S)}function tL(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={};const r=(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=Qq({},t.collection(e.collection));else{const i=t.dataset?t.dataset(e.source):null;let o=e.value||(e=>e),a=e.label||(e=>e);if(e.groupBy||e.mapTo)r.warn('Deprecated "data" configuration',e),n.items=[];else if(e.hierarchy)n.root=i.hierarchy?i.hierarchy(e.hierarchy):null,n.fields=i.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 r=Array.isArray(e.extract)?e.extract:[e.extract];n.items=[];const o=[];r.forEach(e=>{const r=e.source?t.dataset(e.source):i;r&&(n.items=[...n.items,...r.extract(e)],void 0!==e.field&&o.push(r.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&&i){const t=i.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 r="object"==typeof e&&e.source?t.dataset(e.source):i;if(!r)return;let o;o="object"==typeof e&&void 0!==e.field?r.field(e.field):r.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&&(Array.isArray(e.stack.stackByKey)?e.stack.stackByKey.forEach(r=>{const i=n.items.filter(e=>{var t;return(null===(t=e.key)||void 0===t?void 0:t.value)&&e.key.value===r});eL(n,e.stack,t.dataset,i)}):eL(n,e.stack,t.dataset,n.items))}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 nL(e,t,n){let r,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:tL;if(e.data){const r=i(e.data,t,n);if(r&&r.fields&&r.fields[0])return r.fields[0].formatter()}if(r=e.formatter?"".concat(e.formatter,"-").concat(e.type||"number"):e.type||"d3-number",n.formatter.has(r)){return n.formatter.get(r)(e.format||"")}throw new Error("Formatter of type '".concat(r,"' was not found"))}function rL(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}const iL=Symbol("implicit");function oL(){var e=new uA,t=[],n=[],r=iL;function i(i){let o=e.get(i);if(void 0===o){if(r!==iL)return r;e.set(i,o=t.push(i)-1)}return n[o%n.length]}return i.domain=function(n){if(!arguments.length)return t.slice();t=[],e=new uA;for(const r of n)e.has(r)||e.set(r,t.push(r)-1);return i},i.range=function(e){return arguments.length?(n=Array.from(e),i):n.slice()},i.unknown=function(e){return arguments.length?(r=e,i):r},i.copy=function(){return oL(t,n).unknown(r)},rL.apply(i,arguments),i}function aL(){var e,t,n=oL().unknown(void 0),r=n.domain,i=n.range,o=0,a=1,s=!1,l=0,c=0,u=.5;function d(){var n=r().length,d=a<o,f=d?a:o,h=d?o:a;e=(h-f)/Math.max(1,n-l+2*c),s&&(e=Math.floor(e)),f+=(h-f-e*(n-l))*u,t=e*(1-l),s&&(f=Math.round(f),t=Math.round(t));var p=function(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((t-e)/n)),o=new Array(i);++r<i;)o[r]=e+r*n;return o}(n).map(function(t){return f+e*t});return i(d?p.reverse():p)}return delete n.unknown,n.domain=function(e){return arguments.length?(r(e),d()):r()},n.range=function(e){return arguments.length?([o,a]=e,o=+o,a=+a,d()):[o,a]},n.rangeRound=function(e){return[o,a]=e,o=+o,a=+a,s=!0,d()},n.bandwidth=function(){return t},n.step=function(){return e},n.round=function(e){return arguments.length?(s=!!e,d()):s},n.padding=function(e){return arguments.length?(l=Math.min(1,c=+e),d()):l},n.paddingInner=function(e){return arguments.length?(l=Math.min(1,e),d()):l},n.paddingOuter=function(e){return arguments.length?(c=+e,d()):c},n.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),d()):u},n.copy=function(){return aL(r(),[o,a]).round(s).paddingInner(l).paddingOuter(c).align(u)},rL.apply(d(),arguments)}function sL(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function lL(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function cL(){}var uL=.7,dL=1/uL,fL="\\s*([+-]?\\d+)\\s*",hL="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",pL="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",mL=/^#([0-9a-f]{3,8})$/,gL=new RegExp(`^rgb\\(${fL},${fL},${fL}\\)$`),yL=new RegExp(`^rgb\\(${pL},${pL},${pL}\\)$`),vL=new RegExp(`^rgba\\(${fL},${fL},${fL},${hL}\\)$`),bL=new RegExp(`^rgba\\(${pL},${pL},${pL},${hL}\\)$`),xL=new RegExp(`^hsl\\(${hL},${pL},${pL}\\)$`),SL=new RegExp(`^hsla\\(${hL},${pL},${pL},${hL}\\)$`),ML={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 wL(){return this.rgb().formatHex()}function kL(){return this.rgb().formatRgb()}function EL(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=mL.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?CL(t):3===n?new DL(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?NL(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?NL(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=gL.exec(e))?new DL(t[1],t[2],t[3],1):(t=yL.exec(e))?new DL(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=vL.exec(e))?NL(t[1],t[2],t[3],t[4]):(t=bL.exec(e))?NL(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=xL.exec(e))?LL(t[1],t[2]/100,t[3]/100,1):(t=SL.exec(e))?LL(t[1],t[2]/100,t[3]/100,t[4]):ML.hasOwnProperty(e)?CL(ML[e]):"transparent"===e?new DL(NaN,NaN,NaN,0):null}function CL(e){return new DL(e>>16&255,e>>8&255,255&e,1)}function NL(e,t,n,r){return r<=0&&(e=t=n=NaN),new DL(e,t,n,r)}function TL(e,t,n,r){return 1===arguments.length?function(e){return e instanceof cL||(e=EL(e)),e?new DL((e=e.rgb()).r,e.g,e.b,e.opacity):new DL}(e):new DL(e,t,n,null==r?1:r)}function DL(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function qL(){return`#${_L(this.r)}${_L(this.g)}${_L(this.b)}`}function OL(){const e=IL(this.opacity);return`${1===e?"rgb(":"rgba("}${AL(this.r)}, ${AL(this.g)}, ${AL(this.b)}${1===e?")":`, ${e})`}`}function IL(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function AL(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function _L(e){return((e=AL(e))<16?"0":"")+e.toString(16)}function LL(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new RL(e,t,n,r)}function PL(e){if(e instanceof RL)return new RL(e.h,e.s,e.l,e.opacity);if(e instanceof cL||(e=EL(e)),!e)return new RL;if(e instanceof RL)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(a=t===o?(n-r)/s+6*(n<r):n===o?(r-t)/s+2:(t-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new RL(a,s,l,e.opacity)}function RL(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function FL(e){return(e=(e||0)%360)<0?e+360:e}function zL(e){return Math.max(0,Math.min(1,e||0))}function jL(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}sL(cL,EL,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:wL,formatHex:wL,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return PL(this).formatHsl()},formatRgb:kL,toString:kL}),sL(DL,TL,lL(cL,{brighter(e){return e=null==e?dL:Math.pow(dL,e),new DL(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?uL:Math.pow(uL,e),new DL(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new DL(AL(this.r),AL(this.g),AL(this.b),IL(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:qL,formatHex:qL,formatHex8:function(){return`#${_L(this.r)}${_L(this.g)}${_L(this.b)}${_L(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:OL,toString:OL})),sL(RL,function(e,t,n,r){return 1===arguments.length?PL(e):new RL(e,t,n,null==r?1:r)},lL(cL,{brighter(e){return e=null==e?dL:Math.pow(dL,e),new RL(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?uL:Math.pow(uL,e),new RL(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,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new DL(jL(e>=240?e-240:e+120,i,r),jL(e,i,r),jL(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new RL(FL(this.h),zL(this.s),zL(this.l),IL(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=IL(this.opacity);return`${1===e?"hsl(":"hsla("}${FL(this.h)}, ${100*zL(this.s)}%, ${100*zL(this.l)}%${1===e?")":`, ${e})`}`}}));var $L=e=>()=>e;function VL(e){return 1===(e=+e)?UL: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(r){return Math.pow(e+r*t,n)}}(t,n,e):$L(isNaN(t)?n:t)}}function UL(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):$L(isNaN(e)?t:e)}var HL=function e(t){var n=VL(t);function r(e,t){var r=n((e=TL(e)).r,(t=TL(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=UL(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1);function BL(e,t){t||(t=[]);var n,r=e?Math.min(t.length,e.length):0,i=t.slice();return function(o){for(n=0;n<r;++n)i[n]=e[n]*(1-o)+t[n]*o;return i}}function WL(e,t){var n,r=t?t.length:0,i=e?Math.min(r,e.length):0,o=new Array(i),a=new Array(r);for(n=0;n<i;++n)o[n]=QL(e[n],t[n]);for(;n<r;++n)a[n]=t[n];return function(e){for(n=0;n<i;++n)a[n]=o[n](e);return a}}function YL(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function GL(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function KL(e,t){var n,r={},i={};for(n in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)n in e?r[n]=QL(e[n],t[n]):i[n]=t[n];return function(e){for(n in r)i[n]=r[n](e);return i}}var XL=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,JL=new RegExp(XL.source,"g");function ZL(e,t){var n,r,i,o=XL.lastIndex=JL.lastIndex=0,a=-1,s=[],l=[];for(e+="",t+="";(n=XL.exec(e))&&(r=JL.exec(t));)(i=r.index)>o&&(i=t.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,l.push({i:a,x:GL(n,r)})),o=JL.lastIndex;return o<t.length&&(i=t.slice(o),s[a]?s[a]+=i:s[++a]=i),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,r=0;r<t;++r)s[(n=l[r]).i]=n.x(e);return s.join("")})}function QL(e,t){var n,r=typeof t;return null==t||"boolean"===r?$L(t):("number"===r?GL:"string"===r?(n=EL(t))?(t=n,HL):ZL:t instanceof EL?HL:t instanceof Date?YL:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(t)?BL:Array.isArray(t)?WL:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?KL:GL)(e,t)}function eP(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function tP(e){return+e}var nP=[0,1];function rP(e){return e}function iP(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:function(e){return function(){return e}}(isNaN(t)?NaN:.5)}function oP(e,t,n){var r=e[0],i=e[1],o=t[0],a=t[1];return i<r?(r=iP(i,r),o=n(a,o)):(r=iP(r,i),o=n(o,a)),function(e){return o(r(e))}}function aP(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),o=new Array(r),a=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<r;)i[a]=iP(e[a],e[a+1]),o[a]=n(t[a],t[a+1]);return function(t){var n=cA(e,t,1,r)-1;return o[n](i[n](t))}}function sP(){var e,t,n,r,i,o,a=nP,s=nP,l=QL,c=rP;function u(){var e=Math.min(a.length,s.length);return c!==rP&&(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])),r=e>2?aP:oP,i=o=null,d}function d(t){return null==t||isNaN(t=+t)?n:(i||(i=r(a.map(e),s,l)))(e(c(t)))}return d.invert=function(n){return c(t((o||(o=r(s,a.map(e),GL)))(n)))},d.domain=function(e){return arguments.length?(a=Array.from(e,tP),u()):a.slice()},d.range=function(e){return arguments.length?(s=Array.from(e),u()):s.slice()},d.rangeRound=function(e){return s=Array.from(e),l=eP,u()},d.clamp=function(e){return arguments.length?(c=!!e||rP,u()):c!==rP},d.interpolate=function(e){return arguments.length?(l=e,u()):l},d.unknown=function(e){return arguments.length?(n=e,d):n},function(n,r){return e=n,t=r,u()}}function lP(e,t,n,r){var i,o=function(e,t,n){n=+n;const r=(t=+t)<(e=+e),i=r?yA(t,e,n):yA(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}(e,t,n);switch((r=xI(null==r?",f":r)).type){case"s":var a=Math.max(Math.abs(e),Math.abs(t));return null!=r.precision||isNaN(i=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(yI(t)/3)))-yI(Math.abs(e)))}(o,a))||(r.precision=i),NI(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,yI(t)-yI(e))+1}(o,Math.max(Math.abs(e),Math.abs(t))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=function(e){return Math.max(0,-yI(Math.abs(e)))}(o))||(r.precision=i-2*("%"===r.type))}return CI(r)}function cP(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 r=t<e,[i,o,a]=r?gA(t,e,n):gA(e,t,n);if(!(o>=i))return[];const s=o-i+1,l=new Array(s);if(r)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]=(i+e)/-a;else for(let e=0;e<s;++e)l[e]=(i+e)*a;return l}(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var r=t();return lP(r[0],r[r.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var r,i,o=t(),a=0,s=o.length-1,l=o[a],c=o[s],u=10;for(c<l&&(i=l,l=c,c=i,i=a,a=s,s=i);u-- >0;){if((i=yA(l,c,n))===r)return o[a]=l,o[s]=c,t(o);if(i>0)l=Math.floor(l/i)*i,c=Math.ceil(c/i)*i;else{if(!(i<0))break;l=Math.ceil(l*i)/i,c=Math.floor(c*i)/i}r=i}return e},e}function uP(){var e=sP()(rP,rP);return e.copy=function(){return t=e,uP().domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown());var t},rL.apply(e,arguments),cP(e)}function dP(){var e,t=[.5],n=[0,1],r=1;function i(i){return null!=i&&i<=i?n[cA(t,i,0,r)]:e}return i.domain=function(e){return arguments.length?(t=Array.from(e),r=Math.min(t.length,n.length-1),i):t.slice()},i.range=function(e){return arguments.length?(n=Array.from(e),r=Math.min(t.length,n.length-1),i):n.slice()},i.invertExtent=function(e){var r=n.indexOf(e);return[t[r-1],t[r]]},i.unknown=function(t){return arguments.length?(e=t,i):e},i.copy=function(){return dP().domain(t).range(n).unknown(e)},rL.apply(i,arguments)}function fP(e){return void 0===e?e=>e:t=>e(t)}function hP(e){return Math.max(0,Math.min(1,e))}function pP(e){return"object"==typeof e}function mP(e,t,n){const r=Math.abs(t-n)/(e+1),i=[];for(let o=1;o<=e;o++){const e=o*r;i.push(t<n?t+e:t-e)}return i}function gP(e,t,n){if(1===e.length)return e;const r=e.concat([]);for(let i=0;i<e.length;i++){let o=e[i],a=e[i+1];0===i&&o!==n.start()?(r.push(...mP(t,o,a)),o-=a-o,a=e[i],r.push(...mP(t,o,a))):i===e.length-1&&a!==n.end()?(a=o+(o-e[i-1]),r.push(...mP(t,o,a))):r.push(...mP(t,o,a))}return r.filter(e=>e>=n.min()&&e<=n.max())}function yP(e){let t=e.distance,n=e.scale,r=e.minorCount,i=void 0===r?0:r,o=e.unitDivider,a=void 0===o?100:o,s=e.formatter,l=void 0===s?void 0:s;const c=rO(a)||rO(t)?2:Math.max(t/a,2),u=Math.min(1e3,Math.round(c));let d=n.ticks(u);d.length<=1&&(d=n.ticks(u+1));const f=i>0?gP(d,i,n):d;f.sort((e,t)=>e-t);const h=f.map(fP(l));return f.map((e,t)=>{const r=n(e);return{position:r,start:r,end:r,label:h[t],value:e,isMinor:-1===d.indexOf(e)}})}function vP(e){let t=e.distance,n=e.scale,r=e.minorCount,i=void 0===r?0:r,o=e.unitDivider,a=void 0===o?100:o,s=e.formatter,l=void 0===s?void 0:s;const c=rO(a)||rO(t)?2:Math.max(t/a,2),u=Math.min(1e3,Math.round(c)),d=u>10?10:u;n.nice(d);const f=n.ticks(u),h=i>0?gP(f,i,n):f;h.sort((e,t)=>e-t);const p=h.map(fP(l));return h.map((e,t)=>{const r=n(e);return{position:r,start:r,end:r,label:p[t],value:e,isMinor:-1===f.indexOf(e)}})}function bP(e){let t,n=e.settings,r=e.scale,i=e.distance,o=e.formatter,a=void 0===o?e=>e:o;const s=n.minorTicks&&!rO(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?!rO(e.value):!rO(e));t=function(e){let t=e.values,n=e.scale,r=e.formatter,i=void 0===r?e=>e:r;return t.sort((e,t)=>(pP(e)?e.value:e)-(pP(t)?t.value:t)).filter((e,t,r)=>{const i=pP(e)?e.value:e;return i<=n.max()&&i>=n.min()&&r.indexOf(e)===t}).map(e=>{const t=pP(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)?hP(n(e.start)):o,end:t&&!isNaN(e.end)?hP(n(e.end)):o}})}({values:e,scale:r.copy(),formatter:a})}else if(rO(n.ticks.count)){t=(n.ticks.tight?vP:yP)({distance:i,minorCount:s,unitDivider:n.ticks.distance,scale:r,formatter:a}),n.ticks.forceBounds&&function(e,t,n){const r=e.map(e=>e.position),i=t.range();-1===r.indexOf(i[0])?e.splice(0,0,{position:i[0],start:i[0],end:i[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===r.indexOf(i[1])?e.push({position:i[1],start:i[1],end:i[1],label:n(t.end()),isMinor:!1,value:t.end()}):o&&o.isMinor&&(o.isMinor=!1)}(t,r,a)}else{t=function(e){let t=e.count,n=e.minorCount,r=e.scale,i=e.formatter;return r.ticks((t-1)*n+t).map((e,t)=>{const o=r(e);return{position:o,start:o,end:o,label:i(e),isMinor:t%(n+1)!==0,value:e}})}({count:Math.min(1e3,n.ticks.count),minorCount:s,scale:r.copy(),formatter:a})}return t}function xP(){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 r={};return Object.keys(t).forEach(i=>{const o=typeof e[i];r[i]="function"===o?e[i](n):"undefined"===o?t[i]:e[i]}),r}const SP={min:NaN,max:NaN,expand:NaN,include:[],invert:!1},MP={tight:!1,forceBounds:!1,values:void 0,count:NaN,distance:100},wP={count:NaN};function kP(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 EP(){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 r=uP(),i={instance:null,invert:!1},o={data:t,resources:n},a=xP(e,SP,o);let s;function l(e){return rO(e)?NaN:r(e)}a.ticks=xP(e.ticks,MP,o),a.minorTicks=xP(e.minorTicks,wP,o),l.data=()=>t,l.invert=function(e){return r.invert(e)},l.rangeRound=function(e){return r.rangeRound(e),l},l.clamp=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return r.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=Gq(!0,{},a,e.settings),e.scale=l,s=bP(e),s):(s=r.ticks(e),s)},l.nice=function(e){return r.nice(e),l},l.tickFormat=function(e,t){return r.tickFormat(e,t)},l.interpolate=function(e){return r.interpolate(e),l},l.domain=function(e){return arguments.length?(r.domain(e),i.instance&&i.instance.domain([l.start(),l.end()]),l):r.domain()},l.range=function(e){return arguments.length?(r.range(e),l):r.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()],r=[],i=t/2;for(let o=0;o<e;o++){let e=n[n.length-1]||0,o=e+t,a=l(e+i);n.push(o,o),r.push(a,a)}return n.pop(),l.domain(n),l.range(r),l},l.copy=function(){const i=EP(e,t,n);return i.domain(l.domain()),i.range(l.range()),i.clamp(r.clamp()),i},l.norm=function(e){return kP(i,l),i.instance(e)},l.normInvert=function(e){return kP(i,l),i.instance.invert(e)};const c=function(e,t){const n=+e.min,r=+e.max;let i=0,o=1;if(t&&t[0]){const n=t.map(e=>e.min()).filter(e=>!isNaN(e)),r=t.map(e=>e.max()).filter(e=>!isNaN(e));if(i=n.length?Math.min(...n):Number.NaN,o=r.length?Math.max(...r):Number.NaN,isNaN(i)||isNaN(o))i=-1,o=1;else if(i===o&&0===i)i=-1,o=1;else if(i===o&&i)i-=Math.abs(.1*i),o+=Math.abs(.1*o);else if(!isNaN(e.expand)){const t=o-i;i-=t*e.expand,o+=t*e.expand}if(Array.isArray(e.include)){const t=e.include.filter(e=>!isNaN(e));i=Math.min(...t,i),o=Math.max(...t,o)}}return{mini:isNaN(n)?i:n,maxi:isNaN(r)?o:r}}(a,t?t.fields:[]),u=c.mini,d=c.maxi;return l.domain([u,d]),l.range(a.invert?[1,0]:[0,1]),i.invert=a.invert,l}const CP={padding:0,paddingInner:NaN,paddingOuter:NaN,align:.5,invert:!1,maxPxStep:NaN,range:[0,1]};function NP(){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]:{}},r=xP(e,CP,n),i=t.items||[],o={},a=[],s=[];function l(e,n){e.data=()=>t,e.datum=e=>i[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 t=e.scale;const n=t.domain(),r=t.data().items,i=t.labels?t.labels():n,o=t.bandwidth();return n.map((e,n)=>{const a=t(e);return{position:a+o/2,label:"".concat(i[n]),data:r?r[n]:void 0,start:a,end:a+o}})}(t,n.trackBy)}}const c=aL();l(c,e),c.pxScale=function(t){const n=r.maxPxStep;if(isNaN(n))return c;const i=c.domain().length,o=Math.max(1,i-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(r.invert?[s+u,u]:[u,s+u]),a};const u="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<i.length;e++){const t=Gq({datum:i[e]},n),r=u(t,e);-1===a.indexOf(r)&&(a.push(r),s.push(d(t,e)),o[r]=e)}return c.domain(a),c.range(r.invert?r.range.slice().reverse():r.range),c.padding(isNaN(r.padding)?0:r.padding),isNaN(r.paddingInner)||c.paddingInner(r.paddingInner),isNaN(r.paddingOuter)||c.paddingOuter(r.paddingOuter),c.align(isNaN(r.align)?.5:r.align),c}const TP={depth:0};function DP(e,t,n){return e.ancestors().map(e=>t(Gq({datum:e.data},n))).reverse().slice(1).toString()}const qP=e=>e.min(),OP=e=>e.max();function IP(e,t){const n=e&&!isNaN(e.min),r=e&&!isNaN(e.max);let i=n?+e.min:0,o=r?+e.max:1;if(t&&t.length){if(!n){const e=t.map(qP).filter(nO);i=e.length?Math.min(...e):i}if(!r){const e=t.map(OP).filter(nO);o=e.length?Math.max(...e):o}}return[i,o]}const AP={domain:[],range:[],invert:!1,min:NaN,max:NaN};function _P(){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 r=EP(e,t,n).clamp(!0).interpolate(HL),i=xP(e,AP,{data:t,resources:n}),o=Array.isArray(i.domain)&&i.domain.length,a=Array.isArray(i.range)&&i.range.length,s=r;Gq(!0,s,r);const l=eO(IP(i,t?t.fields:[]),2),c=l[0],u=l[1],d=o?i.domain.length:-1,f=n.theme?n.theme.palette("sequential",d>0?d:2):[],h=a?i.range:f;return s.range(i.invert?h.slice().reverse():h.slice()),s.domain(o?i.domain:function(e,t,n){const r=e.length;if(2===r)return[t,n];const i=[],o=(n-t)/(r-1);i.push(t);for(let e=1;e<r-1;e++)i.push(t+o*e);return i.push(n),i}(s.range(),c,u)),s}const LP={domain:[],range:[],invert:!1,min:NaN,max:NaN,nice:!1};function PP(e){const t=[];for(let n=0;n<e.length-1;n++)t.push((e[n]+e[n+1])/2);return t}const RP={domain:[],range:[]};const FP={domain:[],range:[],unknown:void 0},zP={domain:[],range:[],override:!1};const jP=mI();function $P(e,t,n){let r=e.data;e.source&&(n.logger.warn("Deprecated: Scale data source configuration"),r={extract:[]},(Array.isArray(e.source)?e.source:[e.source]).forEach(e=>{r.extract.push({field:e})}));const i=tL(r,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"}(i);return"color"===a&&(a=i.fields&&i.fields[0]&&"dimension"===i.fields[0].type()?"categorical-color":"sequential-color"),n.scale.has(a)&&(o=n.scale.get(a),o=o(e,i,{theme:n.theme,logger:n.logger}),o.type=a),o}jP("linear",EP),jP("band",NP),jP("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]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i={data:n,resources:r},o=xP(t,CP,i);o.ticks=xP(t.ticks,TP,i),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=NP(o);const s=function(e,t,n){const r=t.ticks.depth,i=t.value,o=t.label,a=[],s=[],l={},c=[];let u=0;if(!e)return{values:a,labels:s,items:l,ticks:c};e.eachAfter(e=>{if(e.depth>0){const t=DP(e,i,n),d=e.leaves()||[e],f=i(Gq({datum:e.data},n)),h=o(Gq({datum:e.data},n)),p=Array.isArray(e.children),m={key:t,count:d.length,value:f,label:h,leftEdge:DP(d[0],i,n),rightEdge:DP(d[Math.max(d.length-1,0)],i,n),node:e};p?(a.push("SPACER_".concat(u,"_SPACER")),u++):(a.push(t),s.push(h)),(r<=0&&!p||e.depth===r)&&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,i),l=s.values,c=s.labels,u=s.items,d=s.ticks,f=function(e){const t=String(e),n=u[t];return a(n?o.invert?n.rightEdge:n.leftEdge:t)};Gq(!0,f,a),f.bandwidth=function(e){const t=u[String(e)],n=a.bandwidth();if(t&&!t.isLeaf){const e=f(t.leftEdge),r=f(t.rightEdge);return Math.abs(e-r)+n}return n},f.step=function(e){const t=u[String(e)],n=t?t.count:1;let r=a.step();return r*=n,r},f.data=()=>n,f.datum=e=>{const t=u[String(e)];return t?t.node.data:null},f.copy=()=>e(t,n,r),f.labels=()=>c,f.ticks=()=>d.map(e=>{const t=f(e.key),n=f.bandwidth(e.key);return{position:t+n/2,label:e.label,data:e.node.data,start:t,end:t+n}});const h=a.pxScale;return f.pxScale=function(e){return a=h(e),f},f.domain(l),f}),jP("sequential-color",_P),jP("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 r=dP(),i=xP(e,LP,{data:t,resources:n}),o=Array.isArray(i.domain)&&i.domain.length,a=Array.isArray(i.range)&&i.range.length;function s(e){return rO(e)?NaN:r(e)}Object.keys(r).forEach(e=>s[e]=r[e]);const l=eO(IP(i,t.fields),2),c=l[0],u=l[1],d=o?i.domain.length:-1,f=n.theme?n.theme.palette("sequential",d>0?d:2):[];let h=a?i.range:f,p=[];return p=o?i.domain:i.nice?function(e,t,n){const r=2===e.length?10:Math.max(1,e.length),i=uP().domain([t,n]).nice(r).ticks(r);if(!e||!e.length)return i;const o=Math.max(0,e.length-1);for(;i.length>o;)i[0]-t<=n-i[i.length-1]?i.shift():i.pop();return i}(h,c,u):[c+(u-c)/2],h.length>p.length+1?p=function(e,t,n){const r=e.length;if(2===r)return[t+(n-t)/2];const i=[],o=(n-t)/r;for(let e=1;e<r;e++)i.push(t+o*e);return i}(h,c,u):h.length<p.length+1&&(h=function(e,t,n,r){n=e[0],r=e&&e.length>=2?e[e.length-1]:r;const i=_P().domain([n,r]).range(t);return[n,...PP(e),r].map(e=>i(e))}(p,h,c,u)),s.data=()=>t,s.range(i.invert?h.slice().reverse():h),s.domain(p),s}),jP("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 r=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 r=oL(),i={data:t,resources:n},o=xP(e,RP,i),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={},u=[],d=[];for(let e=0;e<l.length;e++){const t=Gq({datum:l[e]},i),n=a(t,e);-1===u.indexOf(n)&&(u.push(n),d.push(s(t,e)),c[n]=e)}return r.data=()=>t,r.labels=()=>d,r.label=e=>d[u.indexOf(e)],r.datum=e=>l[c[e]],r.range(o.range),Array.isArray(o.domain)&&o.domain.length?r.domain(o.domain):r.domain(u),r}(e,t,n),i=n.theme,o=xP(e,FP,{data:t,resources:n});let a;if(o.explicit=xP(e.explicit,zP,{data:t,resources:n}),a=Array.isArray(o.range)&&0!==o.range.length?o.range.slice():i?i.palette("categorical",r.domain().length).slice():[],o.unknown)r.unknown(o.unknown);else if(i&&i.palette("unknown")){let e=i.palette("unknown");r.unknown(e[0])}if(Array.isArray(o.explicit.domain)&&o.explicit.domain.length){const e=r.domain().slice(),t=o.explicit.domain,n=Array.isArray(o.explicit.range)?o.explicit.range:[],i=Math.floor(e.length/a.length);for(let e=1;e<i+1;e*=2)a=a.concat(a);if(o.explicit.override)for(let r=0;r<t.length;r++){const i=e.indexOf(t[r]);i>-1&&(a[i]=n[r])}else{const r=t.map((t,r)=>[e.indexOf(t),t,n[r]]).sort((e,t)=>e[0]-t[0]);r.forEach(t=>{const n=e.indexOf(t[1]);-1!==n&&a.splice(n,0,t[2])})}a.length=e.length}return r.range(a),r});var VP={};function UP(){UP.init.call(this)}VP.isObject=function(e){return"object"==typeof e&&null!==e},VP.isNumber=function(e){return"number"==typeof e},VP.isUndefined=function(e){return void 0===e},VP.isFunction=function(e){return"function"==typeof e};var HP=UP;UP.EventEmitter=UP,UP.prototype._events=void 0,UP.prototype._maxListeners=void 0,UP.defaultMaxListeners=10,UP.init=function(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0},UP.prototype.setMaxListeners=function(e){if(!VP.isNumber(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},UP.prototype.emit=function(e){var t,n,r,i,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],VP.isUndefined(n))return!1;if(VP.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(r=arguments.length,i=new Array(r-1),o=1;o<r;o++)i[o-1]=arguments[o];n.apply(this,i)}else if(VP.isObject(n)){for(r=arguments.length,i=new Array(r-1),o=1;o<r;o++)i[o-1]=arguments[o];for(r=(a=n.slice()).length,o=0;o<r;o++)a[o].apply(this,i)}return!0},UP.prototype.addListener=function(e,t){var n;if(!VP.isFunction(t))throw TypeError("listener must be a function");(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,VP.isFunction(t.listener)?t.listener:t),this._events[e]?VP.isObject(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,VP.isObject(this._events[e])&&!this._events[e].warned)&&((n=VP.isUndefined(this._maxListeners)?UP.defaultMaxListeners:this._maxListeners)&&n>0&&this._events[e].length>n&&(this._events[e].warned=!0,VP.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),VP.isFunction(console.trace)&&console.trace()));return this},UP.prototype.on=UP.prototype.addListener,UP.prototype.once=function(e,t){if(!VP.isFunction(t))throw TypeError("listener must be a function");var n=!1;function r(){this.removeListener(e,r),n||(n=!0,t.apply(this,arguments))}return r.listener=t,this.on(e,r),this},UP.prototype.removeListener=function(e,t){var n,r,i,o;if(!VP.isFunction(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(i=(n=this._events[e]).length,r=-1,n===t||VP.isFunction(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(VP.isObject(n)){for(o=i;o-- >0;)if(n[o]===t||n[o].listener&&n[o].listener===t){r=o;break}if(r<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},UP.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],VP.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},UP.prototype.listeners=function(e){return this._events&&this._events[e]?VP.isFunction(this._events[e])?[this._events[e]]:this._events[e].slice():[]},UP.listenerCount=function(e,t){return e._events&&e._events[t]?VP.isFunction(e._events[t])?1:e._events[t].length:0};var BP={mixin:e=>(Object.keys(HP.prototype).forEach(t=>{e[t]=HP.prototype[t]}),HP.init(e),e)};function WP(){let e=0,t=0,n=0,r=0;n=n||e;const i={move(e){this.moveTo(n+e)},moveTo(o){const a=Math.max(e,Math.min(t-r,o));n!==a&&(n=a,i.emit("update"))},update(o){let a=!1;var s=o.min;e=void 0===s?e:s;var l=o.max;t=void 0===l?t:l,void 0!==o.viewSize&&o.viewSize!==r&&(r=o.viewSize,a=!0);const c=Math.max(e,Math.min(t-r,n));n!==c&&(n=c,a=!0),a&&i.emit("update")},getState:()=>({min:e,max:t,start:n,viewSize:r})};return BP.mixin(i),i}function YP(e,t){const n=e.min||0,r=e.max||0,i=e.viewSize||0,o=t||WP();return o.update({min:n,max:r,viewSize:i}),o}function GP(e,t){return e<=t}function KP(e,t){return e<t}function XP(e,t,n){let r=0;for(;r<e.length&&t>e[r];)++r;return e[r]===t&&n&&++r,r}function JP(){let e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=[];function i(){}return i.configure=function(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=n.includeMax,i=void 0===r||r,o=n.includeMin;e=i?GP:KP,t=void 0===o||o?GP:KP},i.add=e=>{let t=e.min,n=e.max;const i=XP(r,t),o=XP(r,n,!0),a=[i,o-i];i%2==0&&a.push(t),o%2==0&&a.push(n);const s=r.join(",");r.splice(...a);return s!==r.join(",")},i.remove=e=>{let t=e.min,n=e.max;const i=XP(r,t),o=XP(r,n,!0),a=[i,o-i];i%2==1&&a.push(t),o%2==1&&a.push(n);const s=r.join(",");r.splice(...a);return s!==r.join(",")},i.set=e=>{const t=r.join(",");r=[],Array.isArray(e)?e.forEach(i.add):i.add(e);return t!==r.join(",")},i.clear=()=>{const e=r.length>0;return r=[],e},i.containsValue=n=>function(e,t,n,r){const i=e.length;for(let o=1;o<i;o+=2)if(n(e[o-1],t)&&r(t,e[o]))return!0;return!1}(r,n,t,e),i.containsRange=e=>{let t=e.min,n=e.max;const i=XP(r,t,!0),o=XP(r,n);return i===o&&o%2==1},i.toggle=e=>i.containsRange(e)?i.remove(e):i.add(e),i.ranges=()=>{const e=[];for(let t=1;t<r.length;t+=2)e.push({min:r[t-1],max:r[t]});return e},i.configure(n),i}function ZP(){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 QP={key:void 0,includeMin:!0,includeMax:!0};function eR(e){let t=e.items,n=e.collection,r=e.vc;const i={},o=[];let a,s;for(let e=0,o=t.length;e<o;e++){a=t[e].key,n[a]||(n[a]=r()),s=t[e].values||[t[e].value];for(let e=0;e<s.length;e++)n[a].add(s[e])&&(i[a]=i[a]||[],i[a].push(s[e]))}const l=Object.keys(i);for(let e=0,t=l.length;e<t;e++)a=l[e],o.push({id:a,values:i[a]});return o}function tR(e){let t=e.items,n=e.collection;const r={},i=[];let o,a;for(let e=0,i=t.length;e<i;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])&&(r[o]=r[o]||[],r[o].push(a[e]))}const s=Object.keys(r);for(let e=0,t=s.length;e<t;e++)o=s[e],i.push({id:o,values:r[o]});return i}function nR(e){const t={};let n,r;for(let i=0,o=e.length;i<o;i++){n=e[i].key,r=e[i].values||[e[i].value],t[n]||(t[n]=[]);for(let e=0;e<r.length;e++){-1===t[n].indexOf(r[e])&&t[n].push(r[e])}}return t}function rR(e){let t=e.key,n=e.collection,r=e.obj,i=e.fn,o=e.value;n[t]||(n[t]=i()),r[t]=r[t]||[],r[t].push(o),n[t].add(o)}function iR(e,t){const n=[],r=Object.keys(e);let i,o;const a=e=>-1===t[i].indexOf(e);for(let s=0,l=r.length;s<l;s++)i=r[s],t[i]?(o=e[i].filter(a),o.length&&n.push({id:i,values:o})):n.push({id:i,values:e[i]});return n}function oR(e,t,n){const r=function(e,t){if(!Object.keys(t).length)return e;const n=e.length,r=Array(n);for(let i=0;i<n;i++)r[i]=e[i].key in t?Gq({},e[i],{key:t[e[i].key]}):e[i];return r}(t,n);return e&&e.length?e.reduce((e,t)=>t(e),r):r}function aR(e){return e.replace(/(-[a-z])/g,e=>e.toUpperCase().replace("-",""))}function sR(e){return e.replace(/([A-Z])/g,e=>"-".concat(e.toLowerCase()))}function lR(e,t,n){let r=n.ranges,i=n.interceptors,o=n.rc,a=n.aliases,s=n.rangeConfig;const l=oR(i["".concat(t,"Ranges")],e,a);let c=!1;return l.forEach(e=>{const n=e.key;if(r[n]||(r[n]=o(s.sources[n]||s.default)),"set"===t)c=r[n][t](e.ranges||e.range)||c;else{const i=e.ranges||[e.range];for(let e=0;e<i.length;e++)c=r[n][t](i[e])||c}}),c}function cR(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.vc,n=void 0===t?ZP:t,r=e.rc,i=void 0===r?JP:r,o=!1,a={},s={},l={},c={sources:{},default:Gq({},QP)};const u={addValues:[],removeValues:[],toggleValues:[],setValues:[],addRanges:[],setRanges:[],removeRanges:[],toggleRanges:[]},d=()=>{const e={values:{},ranges:{}};return Object.keys(s).forEach(t=>{e.values[t]=s[t].values()}),Object.keys(a).forEach(t=>{e.ranges[t]=a[t].ranges()}),e},f={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=d();this.ls.forEach(t=>t._state(e))},updateValues(){const e=d();this.ls.forEach(t=>t._state({values:e.values}))},updateRanges(){const e=d();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&&(c={sources:{},default:Gq({},QP)},e.ranges.forEach(e=>{const t={};Object.keys(QP).filter(e=>"key"!==e).forEach(n=>{t[n]=void 0!==e[n]?e[n]:QP[n]}),void 0!==e.key?c.sources[e.key]=t:c.default=t}),Object.keys(a).forEach(e=>a[e].configure(c.sources[e]||c.default)),h.emit("update",[],[]))},link:e=>{if(h===e)throw new Error("Can't link to self");f.ls.push(e),e._state(d())},_state:e=>{if(!e)return d();if(e.values){const t=[];Object.keys(e.values).forEach(n=>{s[n]&&e.values[n].join(";")===s[n].toString()||t.push({key:n,values:e.values[n]})}),Object.keys(s).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=>{a[n]&&e.ranges[n].join(";")===a[n].toString()||t.push({key:n,ranges:e.ranges[n]})}),Object.keys(a).forEach(n=>{e.ranges[n]||t.push({key:n,ranges:[]})}),t.length&&h.setRanges(t)}},start:function(){if(!o){o=!0;for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];h.emit("start",...t),f.start()}},end:function(){if(o){o=!1,a={},s={};for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];h.emit("end",...t),f.end()}},isActive:()=>o,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(a).length>0||e.length;a={},s={},t&&(h.emit("update",[],e),f.clear())},brushes:()=>{let e=[];return e=e.concat(Object.keys(a).map(e=>({type:"range",id:e,brush:a[e]}))),e=e.concat(Object.keys(s).map(e=>({type:"value",id:e,brush:s[e]}))),e},addValue:(e,t)=>{h.addValues([{key:e,value:t}])},addValues:e=>{const t=oR(u.addValues,e,l),r=eR({vc:n,collection:s,items:t});h.emit("add-values",t),r.length&&(o||(o=!0,h.emit("start")),h.emit("update",r,[]),f.updateValues())}};return h.setValues=e=>{const t=oR(u.setValues,e,l),r=function(e){let t=e.items,n=e.vCollection,r=e.vc;const i={},o=nR(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 d=e=>{n[a]&&n[a].contains(e)||rR({key:a,value:e,collection:n,obj:i,fn:r})},f=Object.keys(o);for(let e=0,t=f.length;e<t;e++)a=f[e],o[a].forEach(d);return l=iR(c,i),s=iR(i,c),[s,l]}({items:t,vCollection:s,vc:n});h.emit("set-values",t),(r[0].length>0||r[1].length>0)&&(o||(o=!0,h.emit("start")),h.emit("update",r[0],r[1]),f.updateValues())},h.removeValue=(e,t)=>{h.removeValues([{key:e,value:t}])},h.removeValues=e=>{const t=oR(u.removeValues,e,l),n=tR({collection:s,items:t});h.emit("remove-values",t),n.length&&(h.emit("update",[],n),f.updateValues())},h.addAndRemoveValues=(e,t)=>{const r=oR(u.addValues,e,l),i=oR(u.removeValues,t,l),a=eR({vc:n,collection:s,items:r}),c=tR({collection:s,items:i});h.emit("add-values",r),h.emit("remove-values",i),(a.length||c.length)&&(o||(o=!0,h.emit("start")),h.emit("update",a,c),f.updateValues())},h.toggleValue=(e,t)=>{h.toggleValues([{key:e,value:t}])},h.toggleValues=e=>{const t=oR(u.toggleValues,e,l),r=function(e){let t=e.items,n=e.values,r=e.vc;const i={},o={},a=[],s=[],l=nR(t);let c,u,d;const f=Object.keys(l);for(let e=0,t=f.length;e<t;e++){c=f[e],d=l[c];for(let e=0,t=d.length;e<t;e++)u=d[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)):rR({key:c,value:u,collection:n,obj:i,fn:r})}const h=Object.keys(i);for(let e=0,t=h.length;e<t;e++)c=h[e],a.push({id:c,values:i[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:t,values:s,vc:n});h.emit("toggle-values",t),(r[0].length>0||r[1].length>0)&&(o||(o=!0,h.emit("start")),h.emit("update",r[0],r[1]),f.updateValues())},h.containsValue=(e,t)=>{let n=l[e]||e;return!!s[n]&&s[n].contains(t)},h.addRange=(e,t)=>{h.addRanges([{key:e,range:t}])},h.addRanges=e=>{lR(e,"add",{ranges:a,rc:i,interceptors:u,aliases:l,rangeConfig:c})&&(o||(o=!0,h.emit("start")),h.emit("update",[],[]),f.updateRanges())},h.removeRange=(e,t)=>{h.removeRanges([{key:e,range:t}])},h.removeRanges=e=>{lR(e,"remove",{ranges:a,rc:i,interceptors:u,aliases:l,rangeConfig:c})&&(o||(o=!0,h.emit("start")),h.emit("update",[],[]),f.updateRanges())},h.setRange=(e,t)=>{h.setRanges([{key:e,range:t}])},h.setRanges=e=>{lR(e,"set",{ranges:a,rc:i,interceptors:u,aliases:l,rangeConfig:c})&&(o||(o=!0,h.emit("start")),h.emit("update",[],[]),f.updateRanges())},h.toggleRange=(e,t)=>{h.toggleRanges([{key:e,range:t}])},h.toggleRanges=e=>{lR(e,"toggle",{ranges:a,rc:i,interceptors:u,aliases:l,rangeConfig:c})&&(o||(o=!0,h.emit("start")),h.emit("update",[],[]),f.updateRanges())},h.containsRangeValue=(e,t)=>{let n=l[e]||e;return!!a[n]&&a[n].containsValue(t)},h.containsRange=(e,t)=>{let n=l[e]||e;return!!a[n]&&a[n].containsRange(t)},h.containsMappedData=(e,t,n)=>{let r=[];const i=Object.keys(e);let o,c,u,d;for(let t=0,n=i.length;t<n;t++){if(o=i[t],"value"===o)c=e,r[t]={key:"",i:t,bool:!1};else{if("source"===o)continue;c=e[o],r[t]={key:o,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 l&&(u=l[u]),d=c.value,a[u]?r[t].bool=Array.isArray(d)?a[u].containsRange({min:d[0],max:d[1]}):a[u].containsValue(d):s[u]&&s[u].contains(d)&&(r[t].bool=!0))}return t?(r=r.filter(e=>-1!==t.indexOf(e.key)),"and"===n?!!r.length&&!r.some(e=>!1===e.bool):"xor"===n?!!r.length&&r.some(e=>e.bool)&&r.some(e=>!1===e.bool):r.some(e=>e.bool)):r.some(e=>e.bool)},h.intercept=(e,t)=>{const n=aR(e);u[n]&&u[n].push(t)},h.removeInterceptor=(e,t)=>{const n=aR(e);if(!u[n])return;const r=u[n].indexOf(t);-1!==r&&u[n].splice(r,1)},h.removeAllInterceptors=e=>{const t=[];if(e){const n=aR(e);u[n]&&u[n].length&&t.push({name:e,handlers:u[n]})}else Object.keys(u).forEach(e=>{u[e].length&&t.push({name:sR(e),handlers:u[e]})});t.forEach(e=>{e.handlers.slice().forEach(t=>h.removeInterceptor(e.name,t))})},h.addKeyAlias=(e,t)=>{l[e]=t},h.removeKeyAlias=e=>{delete l[e]},BP.mixin(h),h}function uR(e){return e*e*e}function dR(e){return--e*e*e+1}function fR(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}mI();const hR=["stroke","fill","color","backgroundColor","thumbColor"];function pR(e,t){const n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),o=new Array(n);let a;for(a=0;a<r;++a)i[a]=mR(e[a],t[a]);for(;a<n;++a)o[a]=t[a];return function(e){for(a=0;a<r;++a)o[a]=i[a](e);return o}}function mR(e,t,n){const r=typeof t;let i;return null==t||"boolean"===r?function(e){return()=>e}(t):("number"===r?GL:"string"===r?(i=EL(t))&&hR.includes(n)?(t=i,HL):ZL:t instanceof EL?HL:t instanceof Date?YL:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(t)?BL:Array.isArray(t)?pR:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?gR:GL)(e,t)}function gR(e,t){const n={},r={};let i;for(i in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)i in e?n[i]=mR(e[i],t[i],i):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}function yR(e,t){return e.data?e.data.value:"text"===e.type?e.text:t}const vR={fontFamily:"Arial",fontSize:"13px",color:"#595959",backgroundColor:"#ffffff",stroke:"#000000",strokeWidth:0,$fill:"#333333"},bR=/^\$/;function xR(e){const t=typeof e;return"object"!==t&&"function"!==t&&"undefined"!==t}function SR(e,t,n){const r=e[t];r&&r.scale&&r.scale.pxScale?r.scale=r.scale.pxScale(n):r&&r.pxScale&&(e[t]=r.pxScale(n))}function MR(e,t){return e.pxScale?e.pxScale(t):e}const wR={normalizeSettings:function(e,t,n){const r=Gq({},e),i=Gq({},t);return Object.keys(r).forEach(e=>{i[e]={};const o=r[e],a=typeof o;if("function"==typeof o)i[e].fn=o;else if(xR(o)){let n=t[e];"string"==typeof n&&bR.test(n)&&(n=vR[n]);const r=typeof n;i[e]="undefined"===r||r===a?o:n}else o&&"object"==typeof o&&("function"==typeof o.fn&&(i[e].fn=o.fn),void 0!==o.scale&&(i[e].scale=n.scale(o.scale)),"string"==typeof o.ref&&(i[e].ref=o.ref))}),Object.keys(t).forEach(e=>{if(e in r)return;const n=t[e];"string"===typeof n&&bR.test(n)?i[e]=vR[n]:i[e]=n}),i},resolveForItem:function(e,t,n){const r={},i=Object.keys(t),o=i.length,a=e.datum,s=e.datum;for(let l=0;l<o;l++){const o=i[l],c=t[o],u="object"==typeof s&&void 0!==c,d=u&&"string"==typeof c.ref,f=u&&o in s,h=d?s[c.ref]:f?s[o]:a;xR(c)?r[o]=c:u&&c.fn?(c.scale&&(e.scale=c.scale),r[o]=c.fn.call(null,e,n)):u&&c.scale&&h?(r[o]=c.scale(h.value),c.scale.bandwidth&&(r[o]+=c.scale.bandwidth()/2)):d&&h?r[o]=h.value:c.fn?r[o]=c.fn.call(null,e,n):r[o]=c}return r},updateScaleSize:SR};function kR(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce((e,t)=>Array.isArray(t.children)?(e.push(...kR(t.children)),e):(e.push(t),e),[])}function ER(e,t){let n=t.context,r=t.data,i=t.style,o=t.filter,a=t.mode;const s=e.chart.brush(n),l=r,c=i.active||{},u=i.inactive||{},d=[];Object.keys(c).forEach(e=>{d.push(e)}),Object.keys(u).forEach(e=>{-1===d.indexOf(e)&&d.push(e)});const f=[];let h=!1;const p=()=>{let t=kR(e.nodes);return"function"==typeof o&&(t=t.filter(o)),t},m=()=>{const e=p(),t=e.length;let n,r=!1;const i="function"==typeof l?l({brush:s}):l;for(let r=0;r<t;r++){if(n=e[r].data,!n)continue;e[r].__style||(e[r].__style={},d.forEach(t=>{e[r].__style[t]=e[r][t]}));const t=s.containsMappedData(n,i,a),o=f.indexOf(e[r]);let l=!1;t&&-1===o?(f.push(e[r]),l=!0):t||-1===o||(f.splice(o,1),l=!0),e[r].needToUpdate=l||h,e[r].isActive=t}for(let i=0;i<t;i++)if(n=e[i].data,n){if(e[i].needToUpdate){const t=Gq({},e[i],e[i].__style),n=e[i].isActive;d.forEach(r=>{e[i][r]=n&&r in c?"function"==typeof c[r]?c[r].call(null,t,f):c[r]:!n&&r in u?"function"==typeof u[r]?u[r].call(null,t,f):u[r]:e[i].__style[r]}),r=!0}delete e[i].needToUpdate}return h=!1,r},g=function(){const t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{suppressRender:!1}).suppressRender,n=p(),r=n.length;for(let e=0;e<r;e++)n[e].data&&(n[e].__style=n[e].__style||{},d.forEach(t=>{n[e].__style[t]=n[e][t],t in u&&(n[e][t]="function"==typeof u[t]?u[t].call(null,n[e]):u[t])}));h=!0,f.length=0,t||e.renderer.render(e.nodes)},y=function(){const t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{suppressRender:!1}).suppressRender,n=p(),r=n.length;for(let e=0;e<r;e++)n[e].__style&&(Object.keys(n[e].__style).forEach(t=>{n[e][t]=n[e].__style[t]}),n[e].__style=void 0);f.length=0,t||e.renderer.render(e.nodes)},v=()=>{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",g),s.on("end",y),s.on("update",v),{isActive:()=>s.isActive(),update:()=>{f.length=0,h=!0,m()},cleanUp:function(){s.removeListener("start",g),s.removeListener("end",y),s.removeListener("update",v)}}}function CR(e){let t=e.nodes,n=e.action,r=e.chart,i=e.trigger;const o=[];for(let e=0;e<t.length;e++){let n=t[e].data;null!==n&&o.push(n)}!function(e){let t=e.dataPoints,n=e.action,r=e.chart,i=e.trigger;if(!i)return;const o=i.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))}})}i.contexts.forEach(e=>{a.items.length?r.brush(e)[a.actionFn](a.items):r.brush(e)[s.actionFn](s.items)})}({dataPoints:o,action:n,chart:r,trigger:i})}function NR(e){let t=e.collisions,n=e.t,r=e.config,i=e.action,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 CR({nodes:s,action:i,chart:r.chart,data:r.data,trigger:n}),a}function TR(e,t,n){const r=n.element().getBoundingClientRect();let i=tO(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,r):function(e,t){return{x:e.clientX-t.left,y:e.clientY-t.top}}(e,r);return null===i||i.x<0||i.y<0||i.x>r.width||i.y>r.height?[]:(t.touchRadius>0&&tO(e)?i={cx:i.x,cy:i.y,r:t.touchRadius}:t.mouseRadius>0&&!tO(e)&&(i={cx:i.x,cy:i.y,r:t.mouseRadius}),n.itemsAt(i))}function DR(e,t,n){return e?"function"==typeof e?e(t):e:n}const qR={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 OR(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n="";for(let t=0;t<e.length;t++){const r=e[t];n+=0===t?"M".concat(r.x," ").concat(r.y):"L".concat(r.x," ").concat(r.y),n+=" "}return t&&(n+="Z"),n}function IR(e,t,n,r){const i=n/2,o=e-r/2,a=t-r/2,s=e-i,l=t-i;return[{x:o,y:a},{x:o,y:l},{x:o+r,y:l},{x:o+r,y:a},{x:s+n,y:a},{x:s+n,y:a+r},{x:o+r,y:a+r},{x:o+r,y:l+n},{x:o,y:l+n},{x:o,y:a+r},{x:s,y:a+r},{x:s,y:a}]}function AR(e){return-e/180*Math.PI}function _R(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),r=n*Math.cos(e),i=n*Math.sin(e);return{x1:r<0?1:0,y1:i<0?1:0,x2:r>=0?r:r+1,y2:i>=0?i:i+1}}(AR(e))}function LR(e,t){return{x:e.x+t.x,y:e.y+t.y}}function PR(e,t){return{x:e.x-t.x,y:e.y-t.y}}function RR(e,t){return{x:e.x*t,y:e.y*t}}function FR(e,t){return e.x-t.x}function zR(e,t){return e.y-t.y}function jR(e,t){return FR(e,t)**2+zR(e,t)**2}function $R(e,t){return Math.sqrt(jR(e,t))}function VR(e,t){return e.x*t.x+e.y*t.y}function UR(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{x:0,y:0};const r=Math.cos(t),i=Math.sin(t),o=PR(e,n);return LR({x:r*o.x-i*o.y,y:i*o.x+r*o.y},n)}const HR={up:0,down:180,left:90,right:-90};function BR(e){let t=e.x,n=e.y,r=e.size;const i=r/2;return{type:"rect",x:t-i,y:n-i,width:r,height:r}}const WR=mI();WR.add("circle",function(e){return{type:"circle",fill:"black",cx:e.x,cy:e.y,r:e.size/2}}),WR.add("diamond",function(e){const t=e.size,n=e.x-t/2,r=e.y-t/2;return{type:"path",fill:"black",d:OR([{x:n,y:r+t/2},{x:n+t/2,y:r},{x:n+t,y:r+t/2},{x:n+t/2,y:r+t},{x:n,y:r+t/2}])}}),WR.add("saltire",function(e){const t=AR(45),n=e.size/2,r=isNaN(e.width)?n/2:e.width,i=Math.min(r,n);let o=e.size;const a=Math.sin(Math.asin(-t))*(i/2);o+=2*(n/Math.sin(-t)-n),o-=2*a;const s={x:e.x,y:e.y},l=IR(e.x,e.y,o,i).map(e=>UR(e,t,s));return{type:"path",fill:"black",d:OR(l)}}),WR.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}}),WR.add("triangle",function(e){const t=e.size,n={x:e.x,y:e.y},r=HR[e.direction]||0,i=t/2,o=e.x-i,a=e.y-i;let s=[{x:o,y:a+t},{x:o+i,y:a},{x:o+t,y:a+t},{x:o,y:a+t}];const l=AR(r);return s=s.map(e=>UR(e,l,n)),{type:"path",fill:"black",d:OR(s)}}),WR.add("line",function(e){const t="vertical"===e.direction,n=e.size/2,r=e.x,i=e.y;return{type:"line",stroke:"black",strokeWidth:1,x1:r-(t?0:n),y1:i-(t?n:0),x2:r+(t?0:n),y2:i+(t?n:0),collider:BR(e)}}),WR.add("star",function(e){const t=e.size,n=[],r=t/2,i=e.points||5,o=Math.min(e.innerRadius||t/2,t)/2,a=isNaN(e.startAngle)?90:e.startAngle,s=360/i;for(let t=1;t<=i;t++){const i=s*t+a,l=AR(i),c=AR(i+s/2),u=Math.sin(l),d=Math.cos(l),f=Math.sin(c),h=Math.cos(c);n.push({x:e.x+d*r,y:e.y+u*r}),n.push({x:e.x+h*o,y:e.y+f*o})}return{type:"path",fill:"black",d:OR(n)}}),WR.add("n-polygon",function(e){const t=[],n=e.size/2,r=Math.max(isNaN(e.sides)?6:e.sides,3),i=360/r,o=isNaN(e.startAngle)?0:e.startAngle;for(let a=1;a<=r;a++){const r=AR(i*a+o),s=Math.sin(r),l=Math.cos(r);t.push({x:e.x+l*n,y:e.y+s*n})}return{type:"path",fill:"black",d:OR(t)}}),WR.add("cross",function(e){const t=e.x,n=e.y,r=e.size/2,i=isNaN(e.width)?r/2:e.width,o=Math.min(i,r);return{type:"path",fill:"black",d:OR(IR(t,n,e.size,o))}}),WR.add("bar",function(e){const t={x:e.x,y:e.y},n="vertical"===e.direction,r=e.size/2,i=r/2/2;let o=[{x:t.x-r,y:t.y+i},{x:t.x-r,y:t.y-i},{x:t.x+r,y:t.y-i},{x:t.x+r,y:t.y+i}];if(n){const e=AR(90);o=o.map(n=>UR(n,e,t))}const a=sO(o);return a.type="rect",a.fill="black",a}),WR.add("rect",function(e){const t=e.x,n=e.y,r=e.size,i=void 0===e.width?r:e.width,o=void 0===e.height?r:e.height;return{type:"rect",fill:"black",x:t-i/2,y:n-o/2,width:i,height:o}}),WR.add("image",function(e){const t=e.x,n=e.y,r=e.imageSettings||{},i=r.width,o=r.height,a=r.imageSrc,s=r.position;return{type:"image",x:t,y:n,width:i,height:o,src:a,symbol:r.symbol,r:10,cx:0,cy:0,imageScalingFactor:r.imageScalingFactor,imagePosition:s}});const YR=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:WR;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!==qR[n]&&"transform"!==n&&(e[n]=t[n])})}(e,t),void 0!==t.data&&(e.data=t.data),e}return n}};function GR(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.dock,r=void 0===n?"center":n,i=e.displayOrder,o=void 0===i?0:i,a=e.prioOrder,s=void 0===a?0:a,l=e.preferredSize,c=void 0===l?0:l,u=e.minimumLayoutMode,d=e.show,f=void 0===d||d;r=r||"center";return{computePreferredSize(e){let n=e.inner,r=e.outer,i=e.children;return"function"==typeof c?c({inner:n,outer:r,children:i,dock:this.dock()},t):c},dock(e){return void 0!==e?(r=e,this):"function"==typeof r?r(t):r},displayOrder(e){return void 0!==e?(o=e,this):"function"==typeof o?o(t):o},prioOrder(e){return void 0!==e?(s=e,this):"function"==typeof s?s(t):s},minimumLayoutMode(e){return void 0!==e?(u=e,this):"function"==typeof u?u(t):u},show(e){return void 0!==e?(f=e,this):"function"==typeof f?f(t):f}}}function KR(e,t,n){const r=t.require,i=void 0===r?[]:r,o=t.mediator||{},a=n.settings,s=n.formatter,l=n.scale,c=n.data,u=n.renderer,d=n.chart,f=n.dockConfig,h=n.mediator,p=n.instance,m=n.rect,g=n.style,y=n.registries,v=n.resolver,b=n.update,x=n._DO_NOT_USE_getInfo,S=n.symbol,M=n.isVisible;e.emit=()=>{},M&&(e.isVisible=M),Object.defineProperty(e,"settings",{get:a}),Object.defineProperty(e,"data",{get:c}),Object.defineProperty(e,"formatter",{get:s}),Object.defineProperty(e,"scale",{get:l}),Object.defineProperty(e,"mediator",{get:h}),Object.defineProperty(e,"style",{get:g}),Object.defineProperty(e,"registries",{get:y}),m&&Object.defineProperty(e,"rect",{get:m}),x&&(e._DO_NOT_USE_getInfo=x),Object.keys(t).forEach(n=>{var r;r=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===r)||("function"==typeof t[n]?e[n]=t[n].bind(e):e[n]=t[n])}),i.forEach(t=>{"renderer"===t?Object.defineProperty(e,"renderer",{get:u}):"chart"===t?Object.defineProperty(e,"chart",{get:d}):"dockConfig"===t?Object.defineProperty(e,"dockConfig",{get:f}):"instance"===t?Object.defineProperty(e,"instance",{get:p}):"update"===t&&b?Object.defineProperty(e,"update",{get:b}):"resolver"===t?Object.defineProperty(e,"resolver",{get:v}):"symbol"===t&&Object.defineProperty(e,"symbol",{get:S})}),Object.keys(o).forEach(t=>{e.mediator.on(t,o[t].bind(e))})}function XR(e,t,n){const r=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,i={};return i.displayOrder=r("displayOrder"),i.dock=r("dock"),i.prioOrder=r("prioOrder"),i.minimumLayoutMode=r("minimumLayoutMode"),e.layout=e.layout||{},e.layout.displayOrder=void 0!==i.displayOrder?i.displayOrder:e.layout.displayOrder,e.layout.prioOrder=void 0!==i.prioOrder?i.prioOrder:e.layout.prioOrder,e.layout.dock=i.dock||e.layout.dock,e.layout.minimumLayoutMode=i.minimumLayoutMode||e.layout.minimumLayoutMode,i.show=e.show,i.preferredSize=t,i}function JR(e,t,n){Object.keys(n.on||{}).forEach(r=>{e.eventListeners=e.eventListeners||[];const i=n.on[r].bind(e);e.eventListeners.push({event:r,listener:i}),t.on(r,i)}),e.emit=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return t.emit(e,...r)}}function ZR(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=e.defaultSettings,r=void 0===n?{}:n,i=e._DO_NOT_USE_getInfo,o=void 0===i?()=>({}):i,a=t.chart,s=t.container,l=t.mediator,c=t.registries,u=t.theme,d=t.renderer,f=BP.mixin({});let h,p,m,g,y,v=t.settings||{},b=Gq(!0,{},r,v),x=[],S=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:wR,n={};return{resolve:function(r){let i=r.data,o=r.settings,a=r.defaults,s=void 0===a?{}:a,l=r.scaled;const c=n.norm=t.normalizeSettings(o,s,e.chart),u={scale:e.chart.scale,formatter:e.chart.formatter};l&&Object.keys(l).forEach(e=>{c[e]&&t.updateScaleSize(c,e,l[e])});const d=[];if(!i||!Array.isArray(i.items)){const e={data:i,resources:u};let r=t.resolveForItem(e,n.norm,-1);return{settings:n.norm,item:r}}{let e;for(let r=0,o=i.items.length;r<o;r++){e={datum:i.items[r],data:i,resources:u};let o=t.resolveForItem(e,n.norm,r);o.data=i.items[r],d.push(o)}}return{settings:n.norm,items:d}}}}({chart:a}),M=!1;const w={nodes:[],chart:a,config:b.brush||{},renderer:null},k={tap:[],over:[]},E=[],C={},N=Gq({},v);function T(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(){const i=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 i&&("function"==typeof e[t]?a=e[t].call(C,...l):r&&(a=e[t])),o&&("function"==typeof v[t]?a=v[t].call(N,...l):r&&(a=v[t])),i||o||(a=n.call(C,...l)),a}}const D=T("preferredSize",()=>0,!0),q=T("resize",e=>e.inner),O=T("created"),I=T("beforeMount"),A=T("mounted"),_=T("beforeUnmount"),L=T("beforeUpdate"),P=T("updated"),R=T("beforeRender"),F=T("beforeDestroy"),z=T("destroyed"),j=e.render,$=()=>{b.brush&&(b.brush.consume||[]).forEach(e=>{e.context&&e.style&&E.push(ER(w,e))})},V=()=>{b.brush&&(b.brush.trigger||[]).forEach(e=>{"over"===e.on?k.over.push(e):k.tap.push(e)})};Object.defineProperty(w,"data",{get:()=>x});const U=b.renderer||e.renderer,H=U?d||c.renderer(U)():d||c.renderer()();"function"==typeof H.settings&&H.settings(b.rendererSettings),w.renderer=H;const B={resources:a.logger?{logger:a.logger()}:{}};let W=GR(XR(b,D,a.logger()),B);const Y=e=>{e.key=b.key,e.element=H.element()},G=()=>{};G.dockConfig=()=>W,G.set=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e.settings&&(v=e.settings,b=Gq(!0,{},r,e.settings),W=GR(XR(b,D,a.logger()),B),w.config=b.brush||{}),b.scale&&(h=a.scale(b.scale)),b.data){const e=b.rendererSettings,t="function"==typeof(null==e?void 0:e.progressive)&&e.progressive(),n=tL(b.data,{dataset:a.dataset,collection:a.dataCollection},{logger:a.logger()},a.dataCollection);t?t.isFirst?(x=n,x.items&&(x.items=[...n.items])):x.items&&(x.items=[...x.items,...n.items||[]]):x=n}else x=h?h.data():[];"string"==typeof b.formatter||"object"==typeof b.formatter?p=a.formatter(b.formatter):h&&h.data().fields&&(p=h.data().fields[0].formatter()),y=u.style(b.style||{})},G.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});g=n?H.size(n):H.size(e),N.rect=Gq(!0,{computedPhysical:g.computedPhysical,computedOuter:t.computed||t,computedInner:e.computed||e},e),g=Gq(!0,{computedOuter:t.computed||t,computedInner:e.computed||e},g)},G.getRect=()=>N.rect;const K=()=>{const e=H.renderArgs?H.renderArgs.slice(0):[],t=b.rendererSettings;let n=x;const r="function"==typeof(null==t?void 0:t.progressive)&&t.progressive();return x.items&&r&&(n=Qq(Qq({},x),{},{items:x.items.slice(r.start,r.end)})),e.push({data:n}),e};let X,J,Z;function Q(e){const t=b.rendererSettings,n="function"==typeof(null==t?void 0:t.progressive)&&t.progressive();n?n.isFirst?w.nodes=[...e||[]]:w.nodes&&(w.nodes=[...w.nodes,...e||[]]):w.nodes=e}G.beforeMount=I,G.beforeRender=()=>{R({size:g})},G.render=()=>{const e=j.call(C,...K());Q(e),H.render(e),X=e,J=N.rect.computed},G.hide=()=>{G.unmount(),H.size({x:0,y:0,width:0,height:0}),H.clear()},G.beforeUpdate=()=>{L({settings:b,data:x})},G.update=()=>{Z&&Z.stop();const e=b,t=e.rendererSettings,n=e.brush,r=e.animations;if("function"==typeof(null==t?void 0:t.transform)&&t.transform())return H.render(),void(X=null);const i=j.call(C,...K());Q(i),E.forEach(e=>e.cleanUp()),E.length=0,k.tap=[],k.over=[],n&&($(),V()),E.forEach(e=>{e.isActive()&&e.update()}),X&&r&&("function"==typeof r.enabled?r.enabled():r.enabled)?(r.compensateForLayoutChanges&&r.compensateForLayoutChanges({currentNodes:X,currentRect:N.rect.computed,previousRect:J}),Z=function(e,t,n,r){let i,o=e.old,a=e.current,s=t.renderer,l=[],c={nodes:[],ips:[]},u={nodes:[],ips:[]},d={nodes:[],ips:[]},f=[],h=null;const p=n.trackBy||yR,m={start(){let e={};if(o.forEach((t,n)=>{let r=p(t,n);e[r]=t}),a.forEach((t,n)=>{let r=p(t,n);if(e[r]){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),r=t.points.filter(e=>!e.dummy),i=r.map(e=>e.data.major.value),o=n.filter(e=>i.includes(e.data.major.value)).map(e=>e.data.major.value),a=n.filter(e=>o.includes(e.data.major.value)),s=r.filter(e=>o.includes(e.data.major.value));return{old:a,current:s}}(e[r],t);d.ips.push(gR(Gq({},e[r],{points:n.old}),Gq({},t,{points:n.current}))),l.push(Gq({},e[r],{commonPoints:n.old}))}else d.ips.push(gR(e[r],t)),l.push(e[r]);d.nodes.push(t),e[r]=!1}else c.nodes.push(t),c.ips.push(gR(Gq({},t,{r:.001,opacity:0}),t))}),Object.keys(e).forEach(t=>{e[t]&&(u.nodes.push(e[t]),u.ips.push(gR(e[t],Gq({},e[t],{r:1e-4,opacity:0}))))}),f.push({name:"exiting",easing:uR,duration:200,tweens:u.ips,nodes:[...l]}),f.push({name:"updating",easing:fR,duration:400,tweens:d.ips,nodes:[]}),f.push({name:"entering",easing:dR,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,i=e?l.filter(e).length:l.length,o=r.getValue("animations.updatingStageMeta"),a=o.isInit,s=o.shouldBeRemoved;!1===a?(r.setValue("animations.updatingStageMeta.shouldBeRemoved",0===i),r.setValue("animations.updatingStageMeta.isInit",!0)):r.setValue("animations.updatingStageMeta.shouldBeRemoved",s&&0===i)}f.length&&(h=s.getScene(a),f[0].started=Date.now(),"undefined"!=typeof window&&(i=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 l=n.adjustTweenedNodes;if(l&&l(a),o.push(...a),o.push(...e.nodes),s.render(o),t>=1){f.shift();const e=r.getValue("animations.updatingStageMeta"),t=e.isInit,n=e.shouldBeRemoved;f.length?"updating"===f[0].name&&n&&f.shift():(!0===t&&r.setValue("animations.updatingStageMeta.isInit",!1),m.stop())}i&&(i=window.requestAnimationFrame(m.tick))},stop(){i&&(window.cancelAnimationFrame(i),i=!1)},inProgress:()=>!!i,get targetScene(){return h}};return m}({old:X,current:i},{renderer:H},r,a.storage),Z.start()):H.render(i),X=i,J=N.rect.computed,H.setKey&&"string"==typeof v.key&&H.setKey(v.key)},G.updated=P,G.destroy=()=>{G.unmount(),F(m),H.destroy(),z(),m=null};const ee=e=>{w.nodes=e,E.forEach(e=>{e.isActive()&&e.update()}),H.render(e)};return KR(C,e,{settings:()=>b,data:()=>x,scale:()=>h,formatter:()=>p,renderer:()=>H,chart:()=>a,dockConfig:()=>W,mediator:()=>l,instance:()=>N,rect:()=>N.rect,style:()=>y,update:()=>ee,registries:()=>c,resolver:()=>S,symbol:()=>YR(c.symbol)}),KR(N,v,{settings:()=>b,data:()=>x,scale:()=>h,formatter:()=>p,renderer:()=>H,chart:()=>a,dockConfig:()=>W,mediator:()=>l,style:()=>y,_DO_NOT_USE_getInfo:o.bind(C),isVisible:()=>M}),G.getBrushedShapes=function(e,t,n){const r=[];if(b.brush&&b.brush.consume){const i=a.brush(e),o=H.findShapes("*");b.brush.consume.filter(t=>t.context===e).forEach(e=>{for(let a=0;a<o.length;a++){const s=o[a];s.data&&i.containsMappedData(s.data,n||e.data,t)&&(Y(s),r.push(s),o.splice(a,1),a--)}})}return r},G.findShapes=e=>{var t;const n=(null!==(t=Z)&&void 0!==t&&t.inProgress()?Z.targetScene:H).findShapes(e);for(let e=0,t=n.length;e<t;e++)Y(n[e]);return n},G.shapesAt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=H.itemsAt(e);let r;r=t&&"stop"===t.propagation&&n.length>0?[n.pop().node]:n.map(e=>e.node);for(let e=0,t=r.length;e<t;e++)Y(r[e]);return r},G.brushFromShapes=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.contexts=Array.isArray(t.contexts)?t.contexts:[];CR({nodes:e,action:t.action||"toggle",trigger:t,chart:a,data:w.data})},G.mount=()=>{m=H.element&&H.element()?m:H.appendTo(s),H.setKey&&"string"==typeof v.key&&H.setKey(v.key),b.brush&&($(),V()),JR(N,f,v),JR(C,f,e),M=!0},G.mounted=()=>A(m),G.unmount=()=>{[N,C].forEach(e=>{!function(e,t){e.eventListeners&&(e.eventListeners.forEach(e=>{let n=e.event,r=e.listener;t.removeListener(n,r)}),e.eventListeners.length=0),e.emit=()=>{}}(e,f)}),k.tap=[],k.over=[],E.forEach(e=>{e.cleanUp()}),E.length=0,_(),M=!1},G.onBrushTap=e=>{k.tap.forEach(t=>{(function(e){let t=e.e,n=e.t,r=e.config;return NR({collisions:TR(t,n,r.renderer),t:n,config:r,action:DR(n.action,t,"toggle")})})({e:e,t:t,config:w})&&"stop"===t.globalPropagation&&a.toggleBrushing(!0)})},G.onBrushOver=e=>{k.over.forEach(t=>{(function(e){let t=e.e,n=e.t,r=e.config;return NR({collisions:TR(t,n,r.renderer),t:n,config:r,action:DR(n.action,t,"set")})})({e:e,t:t,config:w})&&"stop"===t.globalPropagation&&a.toggleBrushing(!0)})},G.def=C,G.ctx=N,G.renderer=()=>H,G.set({settings:v}),O(),G}function QR(e){const t=Gq(!0,{},e),n={getAll:()=>t,getValue:(e,n)=>function(e,t,n){if(void 0===e||void 0===t)return n;const r=t.split(".");let i=e;for(let e=0;e<r.length;++e){const t=r[e];if(void 0===i[t])return n;i=i[t]}return i}(t,e,n),setValue:(e,n)=>function(e,t,n){if(void 0===e||void 0===t)return;const r=t.split("."),i=r[r.length-1];let o=e;for(let e=0;e<r.length-1;++e){const t=r[e];void 0===o[t]&&(o[t]=Number.isNaN(+r[e+1])?{}:[]),o=o[t]}void 0!==n?o[i]=n:delete o[i]}(t,e,n)};return n}function eF(e,t,n){const r=LR(function(e,t){const n=VR(e,t)/VR(t,t)||1;return{x:t.x*n,y:t.y*n}}(PR(n,e),PR(t,e)),e);return r}function tF(e,t,n){return $R(e,n)+$R(t,n)-$R(e,t)<1e-12}function nF(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 rF(e){return e.x1===e.x2&&e.y1===e.y2}function iF(e){return e.width<=0||e.height<=0}function oF(e){return e.r<=0}function aF(e){return e.edges.length<=2}function sF(e,t){let n=!1;for(let r=0,i=t.edges.length;r<i;r++)if(n=pF(e,lO(t.edges[r])),!0===n)return!0;return!1}function lF(e,t){let n=!1;const r=t.numPolygons,i=t.polygons;for(let t=0;t<r;t++){if(n=wF(e,i[t]),!0===n)return!0}return!1}function cF(e,t){if(oF(e))return!1;return jR({x:e.cx,y:e.cy},t)<=e.r**2}function uF(e,t){if(iF(t)||oF(e))return!1;const n=t.width/2,r=t.height/2,i=t.x+n,o=t.y+r,a=e.r,s=e.cx,l=e.cy,c=Math.abs(s-i),u=Math.abs(l-o);if(c>n+a||u>r+a)return!1;if(c<=n||u<=r)return!0;return(c-n)**2+(u-r)**2<=a**2}function dF(e,t){if(oF(e)||rF(t))return!1;const n=eO(oO(t),2),r=n[0],i=n[1];if(cF(e,r)||cF(e,i))return!0;const o={x:e.cx,y:e.cy},a=eF(r,i,o);return jR(a,o)<=e.r**2&&tF(r,i,a)}function fF(e,t){if(aF(t)||oF(e))return!1;if(hF(t,{x:e.cx,y:e.cy}))return!0;const n=t.edges.length;for(let r=0;r<n;r++){if(dF(e,lO(t.edges[r])))return!0}return!1}function hF(e,t){if(aF(e)||!vF(e.boundingRect(),t))return!1;const n=t.x,r=t.y,i=e.vertices;let o,a,s,l,c;for(o=!1,l=-1,a=i.length,s=a-1;++l<a;s=l){if(i[l].x===n&&i[l].y===r)return!0;if(i[l].y===i[s].y&&i[l].y===r&&(n-i[l].x)*(n-i[s].x)<=0)return!0;if(i[l].y<r&&r<=i[s].y||i[s].y<r&&r<=i[l].y){if(c=(i[s].x-i[l].x)*(r-i[l].y)/(i[s].y-i[l].y)+i[l].x,n===c)return!0;n<c&&(o=!o)}}return o}function pF(e,t){if(aF(e))return!1;for(let n=0,r=e.edges.length;n<r;n++){if(xF(t,lO(e.edges[n])))return!0}const n=eO(oO(t),2),r=n[0],i=n[1];return hF(e,r)||hF(e,i)}function mF(e,t){if(aF(e))return!1;for(let n=0,r=e.edges.length;n<r;n++){if(bF(t,lO(e.edges[n])))return!0}const n=eO(aO(t),4),r=n[0],i=n[1],o=n[2],a=n[3];return hF(e,r)||hF(e,i)||hF(e,o)||hF(e,a)}function gF(e,t){return!iF(e)&&!iF(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 yF(e,t){if(iF(e)||iF(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=>vF(e,t))}function vF(e,t){return!iF(e)&&(t.x>=e.x&&t.x<=e.x+e.width&&t.y>=e.y&&t.y<=e.y+e.height)}function bF(e,t){if(rF(t)||iF(e))return!1;const n=eO(oO(t),2),r=n[0],i=n[1];if(vF(e,r)||vF(e,i))return!0;const o=aO(e);let a=o.length;for(let e=0;e<a;e++){if(xF(lO([o[e],o[3!==e?e+1:0]]),t))return!0}return!1}function xF(e,t){const n=eO(oO(e),2),r=n[0],i=n[1],o=eO(oO(t),2),a=o[0],s=o[1],l=FR(i,r),c=zR(i,r),u=FR(s,a),d=zR(s,a),f=FR(r,a),h=zR(r,a);let p=d*l-u*c;const m=u*h-d*f,g=l*h-c*f;let y,v;if(0===l&&0===c)return!1;if(0===u&&0===d)return!1;if(0===p){if(0===m&&0===g){if(0===l){if(0===c)return r.x===i.x&&r.y===i.y;y=zR(a,r)/c,v=zR(s,r)/c}else y=(a.x-r.x)/l,v=(s.x-r.x)/l;return!(y<0&&v<0||y>1&&v>1)}return!1}const b=m/p;return p=g/p,b>=0&&b<=1&&p>=0&&p<=1}function SF(e,t){if(rF(e))return!1;const n=eO(oO(e),2);return tF(n[0],n[1],t)}function MF(e,t){const n=e.boundingRect(),r=t.boundingRect();return!!gF(n,r)&&(yF(n,r)?sF(e,t):sF(t,e))}function wF(e,t){const n=e.boundingRect(),r=t.boundingRect();return!!gF(n,r)&&(yF(r,n)?function(e,t){let n=!1;const r=e.numPolygons,i=e.polygons;for(let e=0;e<r;e++)if(n=MF(t,i[e]),!0===n)return!0;return!1}(e,t):function(e,t){let n=!1;for(let r=0,i=t.edges.length;r<i;r++)if(n=CF(e,lO(t.edges[r])),!0===n)return!0;return!1}(e,t))}function kF(e,t){if(oF(e))return!1;if(EF(t,{x:e.cx,y:e.cy}))return!0;const n=t.numPolygons,r=t.polygons;for(let t=0;t<n;t++){const n=r[t],i=n.edges.length;for(let t=0;t<i;t++){if(dF(e,lO(n.edges[t])))return!0}}return!1}function EF(e,t){if(!vF(e.boundingRect(),t))return!1;const n=t.x,r=t.y,i=e.numPolygons;let o,a,s,l,c,u,d=!1;for(a=0;a<i;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===r)return!0;if(o[c].y===o[l].y&&o[c].y===r&&(n-o[c].x)*(n-o[l].x)<=0)return!0;if(o[c].y<r&&r<=o[l].y||o[l].y<r&&r<=o[c].y){if(u=(o[l].x-o[c].x)*(r-o[c].y)/(o[l].y-o[c].y)+o[c].x,n===u)return!0;n<u&&(d=!d)}}return d}function CF(e,t){const n=eO(oO(t),2),r=n[0],i=n[1];if(EF(e,r)||EF(e,i))return!0;const o=e.numPolygons,a=e.polygons;for(let e=0;e<o;e++){const n=a[e];for(let e=0,r=n.edges.length;e<r;e++){if(xF(t,lO(n.edges[e])))return!0}}return!1}function NF(e,t){const n=eO(aO(t),4),r=n[0],i=n[1],o=n[2],a=n[3];if(EF(e,r)||EF(e,i)||EF(e,o)||EF(e,a))return!0;const s=e.numPolygons,l=e.polygons;for(let e=0;e<s;e++){const n=l[e];for(let e=0,r=n.edges.length;e<r;e++){if(bF(t,lO(n.edges[e])))return!0}}return!1}const TF=/^\$/,DF="@extend";function qF(e){throw new Error('Cyclical reference for "'.concat(e,'"'))}function OF(e,t,n){if("string"==typeof e){let r=t[e];return-1!==n.indexOf(e)&&qF(e),TF.test(r)?(n.push(e),OF(r,t,n)):r}let r=e;const i=Gq(!0,{},t,e),o={};if(e[DF]){const o=e[DF];-1!==n.indexOf(o)&&qF(o);let a=n.slice();a.push(o),r=Gq(!0,{},OF(i[o],t,a),e)}return Object.keys(r).forEach(e=>{let t=n.slice();if(e===DF||TF.test(e))return;o[e]=r[e];let a=o[e];TF.test(a)&&a in i?(-1!==n.indexOf(a)&&qF(a),t.push(a),a=i[a],"object"==typeof a||TF.test(a)&&a in i?o[e]=OF(a,i,t):o[e]=a):"object"==typeof a&&(o[e]=OF(a,i,t))}),o}function IF(e,t){return OF(e,t,[])}function AF(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={},n=e;const r=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)}})},i={palette:(e,n)=>((e,n)=>{const r=t[e];if(!r)return[];const i=r.sizes;for(let e=0;e<i.length;e++)if(n<=i[e])return r.colors[e];return r.colors[i.length-1]})(e,n),setPalettes:r,style:e=>IF(e,n),setStyle:t=>{n=Gq({},e,t)}};return r(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]),i}function _F(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 LF(e){const t={center:{minWidthRatio:.5,minHeightRatio:.5,minWidth:0,minHeight:0}};return Gq(!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 PF(e,t,n,r,i){return{x:isNaN(e)?0:e,y:isNaN(e)?0:t,width:isNaN(e)?0:n,height:isNaN(e)?0:r,margin:isNaN(i)?0:i}}function RF(e,t,n){if(void 0===e.cachedSize){const r=e.config.dock();let i,o=e.comp.preferredSize({inner:t,outer:n,dock:r});isNaN(o)?o&&!isNaN(o.size)&&(o.width=o.size,o.height=o.size):o={width:o,height:o},i="top"===r||"bottom"===r?o.height:"right"===r||"left"===r?o.width:Math.max(o.width,o.height),e.cachedSize=Math.ceil(i),e.edgeBleed=o.edgeBleed||0}return e.cachedSize}function FF(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 zF(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 jF(e,t,n){t.x<n.left&&(t.width-=n.left-t.x,t.x=n.left);const r=e.width-(t.x+t.width);r<n.right&&(t.width-=n.right-r),t.y<n.top&&(t.height-=n.top-t.y,t.y=n.top);const i=e.height-(t.y+t.height);i<n.bottom&&(t.height-=n.bottom-i)}function $F(e,t,n,r,i){const o=Gq({},t),a=Gq({},n);FF(o,r),zF(a,r),jF(e,o,a);const s=function(e,t,n){const r=Math.min(n.center.minWidth,e.width)||Math.max(e.width*n.center.minWidthRatio,1),i=Math.min(n.center.minHeight,e.height)||Math.max(e.height*n.center.minHeightRatio,1);return t.width>=r&&t.height>=i}(e,o,i);return!!s&&(FF(t,r),zF(n,r),!0)}function VF(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 UF(e){return sO([].concat(...e.map(aO)))}function HF(e){let t=e.visible,n=e.layoutRect,r=e.reducedRect,i=e.containerRect,o=e.translation;const a=PF(r.x,r.y,r.width,r.height),s=PF(r.x,r.y,r.width,r.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=r.x,t.y=c.y=r.y,t.width=c.width=r.width,t.height=c.height=r.height;break;default:if(e.referencedDocks.length>0){const n=e.referencedDocks.map(e=>l[e]).filter(e=>!!e);n.length>0&&(t=UF(n.map(e=>e.outerRect)),c=UF(n.map(e=>e.r)))}}e.key&&(l[e.key]={r:c,outerRect:t}),function(e,t,n,r){const i={x:r.width/n.width,y:r.height/n.height},o={left:0,top:0};if(n.preserveAspectRatio){const e=i.x<i.y,t=Math.min(i.x,i.y);i.x=t,i.y=t;const a=e?"height":"width",s=(r[a]-n[a]*i.x)*n.align;o.left=e?0:s,o.top=e?s:0}e.scaleRatio=i,e.margin=o,t.scaleRatio=i,t.margin=o,n.scaleRatio=i,n.margin=o}(c,t,n,i),c.edgeBleed=e.edgeBleed,c.computed=VF(c),t.edgeBleed=e.edgeBleed,t.computed=VF(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 BF(e,t,n){const r=e.layoutModes||{},i=t.minimumLayoutMode();let o=t.show();return o&&"object"==typeof i?o=r[i.width]&&r[i.height]&&n.width>=r[i.width].width&&n.height>=r[i.height].height:o&&void 0!==i&&(o=r[i]&&n.width>=r[i].width&&n.height>=r[i].height),o}function WF(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 YF(e){let t=LF(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 r=function(e,t){const n={x:0,y:0,width:0,height:0},r={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?(r.width=isNaN(t.logicalSize.width)?n.width:t.logicalSize.width,r.height=isNaN(t.logicalSize.height)?n.height:t.logicalSize.height,r.align=isNaN(t.logicalSize.align)?.5:Math.min(Math.max(t.logicalSize.align,0),1),r.preserveAspectRatio=t.logicalSize.preserveAspectRatio):(r.width=n.width,r.height=n.height,r.preserveAspectRatio=!1),_F(r),_F(n),{logicalContainerRect:r,containerRect:n}}(e,t),i=r.logicalContainerRect,o=r.containerRect,a=function(e,t,n){const r=[],i=[];for(let o=0;o<e.length;++o){const a=e[o];WF(a);let s=a.dockConfig;const l=a.key,c=s.dock(),u=/@/.test(c)?c.split(",").map(e=>e.replace(/^\s*@/,"")):[];BF(t,s,n)?r.push({comp:a,key:l,config:s,referencedDocks:u}):i.push({comp:a,key:l,config:s,referencedDocks:u})}return[r,i]}(n,t,i),s=eO(a,2),l=s[0],c=s[1],u=function(e){let t=e.layoutRect,n=e.visible,r=e.hidden,i=e.settings;const o=PF(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];RF(n,o,t),$F(t,o,a,n,i)||(r.push(s.splice(e,1)[0]),--e)}!function(e,t){if(0!==t.length)for(let n=0;n<e.length;++n){let r=e[n];if(r.referencedDocks.length){const i=r.referencedDocks.every(e=>t.some(t=>t.key===e));i&&t.push(e.splice(n,1)[0])}}}(n,r);const l=n.filter(e=>-1!==s.indexOf(e));return n.length=0,n.push(...l),jF(t,o,a),o}({layoutRect:i,visible:l,hidden:c,settings:t}),d=HF({visible:l,layoutRect:i,reducedRect:u,containerRect:o,translation:{x:e.x,y:e.y}});return c.forEach(e=>{e.comp.visible=!1;const t=PF();e.comp.resize(t,t)}),{visible:l.map(e=>e.comp),hidden:c.map(e=>e.comp),ordered:d.map(e=>e.comp)}},n.settings=function(e){t=LF(e)},n}const GF=(e,t)=>{for(let n=0;n<e.length;n++){const r=e[n];if(r.hasKey&&r.key===t)return e[n]}return null},KF=e=>null==e?void 0:e.map(e=>{const t=e.instance.dockConfig();return{preferredSize:n=>t.computePreferredSize(Qq(Qq({},n),{},{children:KF(e.children)}))}}),XF=(e,t)=>({visible:[],hidden:t,ordered:[]}),JF=e=>(t,n)=>{var r;const i=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(Qq(Qq({},t),{},{children:KF(e.children)}))}}),o=e=>n[e.index],a=null!==(r=e(t,i))&&void 0!==r?r:{},s=a.visible,l=void 0===s?i:s,c=a.hidden,u=void 0===c?[]:c,d=a.ordered,f=void 0===d?l:d;return{visible:l.map(o),hidden:u.map(o),ordered:f.map(o)}},ZF=e=>"function"==typeof e?JF(e):(e=>{const t=YF(e);return JF((e,n)=>t.layout(e,n))})(e);function QF(e,t,n){const r=t.left-n.left,i=t.top-n.top,o=cO(e),a=Gq(!0,{},e);switch(o){case"circle":a.cx+=r,a.cy+=i;break;case"polygon":for(let e=0,t=a.vertices.length;e<t;e++){const t=a.vertices[e];t.x+=r,t.y+=i}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+=r,n.y+=i}}break;case"line":a.x1+=r,a.y1+=i,a.x2+=r,a.y2+=i;break;case"point":case"rect":a.x+=r,a.y+=i}return a}function ez(e,t){const n=[];let r=0;t.forEach(e=>{n.push(r),r++;const t=e.instance.def.additionalElements&&e.instance.def.additionalElements();t&&(r+=t.length)}),t.forEach((t,r)=>((e,t,n)=>{const r=t.instance.renderer().element();if(isNaN(n)||!r||!e||!e.children)return;const i=e.children[Math.max(0,n)];if(r===i)return;const o=t.instance.def.additionalElements&&t.instance.def.additionalElements().filter(Boolean);e.insertBefore&&void 0!==i?(e.insertBefore(r,i),o&&o.forEach(t=>{e.insertBefore(t,r)})):(o&&o.forEach(t=>{e.appendChild(t,r)}),e.appendChild(r))})(e,t,n[r]))}function tz(e,t){let n=e.element,r=e.data,i=void 0===r?[]:r,o=e.settings,a=void 0===o?{}:o,s=e.on,l=void 0===s?{}:s;const c=t.registries,u=t.logger,d=AF(t.style,t.palettes),f=[],h=Gq({},e),p=function(){const e={};return BP.mixin(e),e}();let m=[],g=null,y=null,v=null,b=[],x=()=>{},S=()=>{};const M={};let w=!1;const k=function(e){let t=e.createComponent;const n={};let r=[],i=[];const o=e=>{const n=t(e);return n&&(r.push(n),e.components&&(n.children=e.components.map(e=>o(e)).filter(e=>!!e))),n},a=e=>{const t=r.indexOf(e);-1!==t&&r.splice(t,1)},s=(e,t)=>{for(let n=e.length-1;n>=0;n--){const r=e[n],i=t.find(e=>r.hasKey&&r.key===e.key);i?r.children&&i.components&&s(r.children,i.components):(e.splice(n,1),a(r),r.children&&s(r.children,[]),r.instance.destroy())}},l=e=>{let t=e.compList,n=e.data,r=e.excludeFromUpdate,i=e.formatters,a=e.scales;return e.settingsList.map(e=>{const s=GF(t,e.key);return r.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:i,scales:a,data:n,settings:e},e.components&&(s.children=l({compList:s.children||[],data:n,excludeFromUpdate:r,formatters:i,scales:a,settingsList:e.components})),s)):o(e)}).filter(e=>!!e)},c=e=>{let t=e.components,n=e.hidden,r=e.layoutFn,i=e.ordered,o=e.rect,a=e.visible;const s=r(o,t),l=s.visible,u=s.hidden,d=s.ordered;a.push(...l),n.push(...u),i.push(...d),l.forEach(e=>{if(e.children){var t,r;const o=ZF(null!==(t=null===(r=e.settings)||void 0===r?void 0:r.strategy)&&void 0!==t?t:{});c({components:e.children,hidden:n,layoutFn:o,ordered:i,rect:e.instance.getRect(),visible:a})}}),u.forEach(e=>{e.children&&c({components:e.children,hidden:n,layoutFn:XF,ordered:i,rect:null,visible:a})})};return n.destroy=()=>{r.forEach(e=>e.instance.destroy()),r=[],i=[]},n.findComponentByKey=e=>GF(r,e),n.forEach=e=>{r.forEach(e)},n.layout=e=>{let t=e.layoutSettings,n=e.rect;const r=[],o=[],a=[],s=ZF(t);return c({components:i,hidden:o,layoutFn:s,ordered:a,rect:n,visible:r}),{visible:r,hidden:o,ordered:a}},n.set=e=>{let t=e.components;i=t.map(e=>o(e)).filter(e=>!!e)},n.update=e=>{let t=e.components,n=e.data,r=e.excludeFromUpdate,o=e.formatters,a=e.scales;s(i,t),i=l({compList:i,data:n,excludeFromUpdate:r,formatters:o,scales:a,settingsList:t})},n}({createComponent:e=>{if(!c.component.has(e.type))return u.warn("Unknown component: ".concat(e.type)),!1;return{instance:ZR(c.component(e.type),{settings:e,chart:h,mediator:p,registries:c,theme:d,container:n}),settings:Gq(!0,{},e),key:e.key,hasKey:void 0!==e.key}}});function E(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{};return function(){const r="function"==typeof e[t];let i;for(var o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];return i=r?e[t].call(h,...a):n.call(h,...a),i}}const C=()=>{let e;a.dockLayout?(u.warn('Deprecation Warning: "dockLayout" property should be renamed to "strategy"'),e=a.dockLayout):e=a.strategy;const t=function(e){if("function"==typeof e.getBoundingClientRect){const t=e.getBoundingClientRect();return{x:0,y:0,width:t.width,height:t.height}}return{x:0,y:0,width:0,height:0}}(n);return k.layout({layoutSettings:e,rect:t})},N=E("created"),T=E("beforeMount"),D=E("mounted"),q=E("beforeUpdate"),O=E("updated"),I=E("beforeRender"),A=E("beforeDestroy"),_=E("destroyed"),L=function(e,t){let n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).partialData;const r=t.formatters,i=void 0===r?{}:r,o=t.scales,a=void 0===o?{}:o,s=t.scroll,l=void 0===s?{}:s;x=function(e,t){let n=t.types,r=t.logger;const i={},o=[];return Array.isArray(e)?o.push(...e):(r.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&&(r.warn("Missing key for dataset. Using index '".concat(t,"' as key.")),n=t);let a=o({key:n,data:e.data,config:e.config});i[n]=a}}),e=>e?i[e]:i[Object.keys(i)[0]]}(e,{logger:u,types:c.data}),n||Object.keys(M).forEach(e=>M[e].clear()),t.palettes&&d.setPalettes(t.palettes),t.style&&d.setStyle(t.style),S=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:tL;const i={};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");i[e.key]=()=>r(e.data,t,n)}),e=>{let t,n;if("string"==typeof e?t=e:"object"==typeof e&&(t=e.key,n=e),!(t in i))throw new Error("Unknown data collection: ".concat(t));"function"==typeof i[t]&&(i[t]=i[t]());let r=i[t];if(n&&n.fields&&n.fields.filter){let e=r.fields.filter(n.fields.filter);r.fields.length!==e.length&&(r=Gq(r,{fields:e}))}return r}}(t.collections,{dataset:x},{logger:u});const f={theme:d,logger:u};g=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:$P;const i={};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?(i[a]=i[a]||r(e[a],t,n),i[a]):r(o,t,n)},all(){return Object.keys(e).forEach(this.get),i}}}(a,{dataset:x,collection:S},Qq(Qq({},f),{},{scale:c.scale})),y=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:nL;const i={};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?(i[a]=i[a]||r(e[a],t,n),i[a]):r(o||{},t,n)},all(){return Object.keys(e).forEach(this.get),i}}}(i,{dataset:x,collection:S},Qq(Qq({},f),{},{formatter:c.formatter})),v=function(e,t){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=YP(e[r],t?t[r]:null));return n}(l,v)};function P(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={},r=e.filter(e=>!!e.key).map(e=>e.key);b.forEach(e=>{e.key&&-1!==r.indexOf(e.key)?t[e.key]=e:e.destroy()}),b=e.map(e=>{const r=e.key&&t[e.key]?t[e.key]:c.interaction(e.type)(h,p,n);return r.set(e),r})}const R=e=>{const t=n.getBoundingClientRect(),r="clientX"in e?e.clientX:e.x,i="clientY"in e?e.clientY:e.y,o={x:r-t.left,y:i-t.top},a=[];return m.forEach(e=>{const t=e.instance.getRect();vF(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},F=()=>{if(f.length||!n)return;Object.keys(l).forEach(e=>{const t=l[e].bind(h);n.addEventListener(e,t),f.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=R(e)},r=t=>{const n=e.comps||R(t);if(!n.every(e=>e.instance.def.disableTriggers)&&("touchend"===t.type&&t.preventDefault(),function(e,t){const n=tO(e),r=n?e.changedTouches[0]:e,i=Date.now()-t.time,o=isNaN(t.x)?0:Math.abs(r.clientX-t.x),a=isNaN(t.y)?0:Math.abs(r.clientY-t.y);return(0===e.button||n)&&!t.multiTouch&&o<=12&&a<=12&&i<=300}(t,e)))for(let e=n.length-1;e>=0;e--){if(n[e].instance.onBrushTap(t),w){w=!1;break}}},i=[];i.push({key:"mousedown",listener:t}),i.push({key:"mouseup",listener:r}),function(e){return"ontouchstart"in e&&"ontouchend"in e||navigator.maxTouchPoints>1}(n)&&(i.push({key:"touchstart",listener:t}),i.push({key:"touchend",listener:r})),i.push({key:"mousemove",listener:e=>{const t=R(e);for(let n=t.length-1;n>=0;n--){if(t[n].instance.onBrushOver(e),w){w=!1;break}}}}),i.forEach(e=>{n.addEventListener(e.key,e.listener),f.push(e)})},z=()=>{f.forEach(e=>{let t=e.key,r=e.listener;return n.removeEventListener(t,r)}),f.length=0},j=()=>{n.innerHTML="",(()=>{const e=a.components,t=void 0===e?[]:e;I(),L(i,a),k.set({components:t});const r=C(),o=r.visible,s=r.hidden,l=r.ordered;m=o,s.forEach(e=>{e.instance.hide(),e.visible=!1}),o.forEach(e=>e.instance.beforeMount()),o.forEach(e=>e.instance.mount()),o.forEach(e=>e.instance.beforeRender()),o.forEach(e=>e.instance.render()),o.forEach(e=>e.instance.mounted()),o.forEach(e=>{e.visible=!0}),ez(n,l)})(),F(),P(a.interactions)};return h.layoutComponents=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.excludeFromUpdate,n=void 0===t?[]:t;e.data&&(i=e.data),e.settings&&(a=e.settings,P(e.settings.interactions)),q(),L(i,a);const r=a,o=r.formatters,s=r.scales,l=r.components,c=void 0===l?[]:l;k.update({components:c,data:i,excludeFromUpdate:n,formatters:o,scales:s}),k.forEach(e=>{e.updateWith&&e.instance.set(e.updateWith)}),k.forEach(e=>{e.updateWith&&e.instance.beforeUpdate()}),C()},h.update=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.partialData,r=e.excludeFromUpdate,o=void 0===r?[]:r;let s;e.data&&(i=e.data),e.settings&&(a=e.settings,P(e.settings.interactions)),q(),L(i,a,{partialData:t});const l=a,c=l.formatters,u=l.scales,d=l.components,f=void 0===d?[]:d;k.update({components:f,data:i,excludeFromUpdate:o,formatters:c,scales:u}),k.forEach(e=>{e.updateWith&&e.instance.set(e.updateWith)}),k.forEach(e=>{e.updateWith&&e.instance.beforeUpdate()});const h=[],p=[];let g;if(t)k.forEach(e=>{(e.updateWith||e.applyTransform)&&e.visible&&h.push(e)}),g=h;else{const e=C(),t=e.visible,n=e.hidden,r=e.ordered;m=t,g=t,s=r,t.forEach(e=>{e.updateWith&&e.visible?h.push(e):p.push(e)}),n.forEach(e=>{e.instance.hide(),e.visible=!1,delete e.updateWith,e.applyTransform=!1})}p.forEach(e=>e.instance.beforeMount()),p.forEach(e=>e.instance.mount()),g.forEach(e=>e.instance.beforeRender()),g.forEach(e=>{(e.updateWith||e.applyTransform)&&e.visible?e.instance.update():e.instance.render()}),t||ez(n,s),p.forEach(e=>e.instance.mounted()),h.forEach(e=>e.instance.updated()),m.forEach(e=>{delete e.updateWith,e.visible=!0,e.applyTransform=!1}),O()},h.destroy=()=>{A(),k.destroy(),z(),P(),delete h.update,delete h.destroy,_()},h.getAffectedShapes=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"and",n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=[];return m.filter(e=>null==r||e.key===r).forEach(r=>{const o=r.instance.getBrushedShapes(e,t,n);i=[...i,...o]}),i},h.findShapes=e=>{let t=[];return m.forEach(n=>{const r=n.instance.findShapes(e);t=[...t,...r]}),t},h.componentsFromPoint=e=>R(e).map(e=>e.instance.ctx),h.shapesAt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=[];const i=n.getBoundingClientRect();let o=m;if(Array.isArray(t.components)&&t.components.length>0){const e=t.components.map(e=>e.key);o=m.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=QF(e,i,a.instance.renderer().element().getBoundingClientRect()),l=a.instance.shapesAt(s,a.opts),c=l.length>0&&"stop"===t.propagation;if(r=[...r,...l],r.length>0&&c)return r}return r},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 r=t.components[n].key;m.filter(e=>r===e.key).forEach(r=>{let i=e.filter(e=>e.key===r.key);r.instance.brushFromShapes(i,t.components[n])})}},h.scroll=function(){return function(e,t){return t[e]||(t[e]=WP()),t[e]}(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",v)},h.dataset=e=>x(e),h.dataCollection=e=>S(e),h.scales=function(){return g.all()},h.formatters=function(){return y.all()},h.brush=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return M[e]||(M[e]=cR()),M[e]},h.scale=function(e){return g.get(e)},h.formatter=function(e){return y.get(e)},h.toggleBrushing=function(e){w=void 0!==e?e:!w},h.component=e=>{const t=k.findComponentByKey(e);return null==t?void 0:t.instance.ctx},h.logger=()=>u,h.theme=()=>d,h.storage=QR({animations:{updatingStageMeta:{isInit:!1,shouldBeRemoved:!1}}}),Object.defineProperty(h,"interactions",{get:()=>({instances:b,on(){F(),b.forEach(e=>e.on())},off(){z(),b.forEach(e=>e.off())}})}),N(),n&&(T(),j(),D(n),h.element=n),h}const nz=e=>{let t=mI(e);return t.prio=e=>e?t.default(e[0]):[t.default()],t.types=()=>t.getKeys(),t};var rz=mI();function iz(e,t,n){let r=n.key;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}const oz=e=>e.filter(e=>"number"==typeof e&&!isNaN(e));const az=e=>{let t=e.key,n=e.data,r=e.cache,i=e.config;if(!n)return;let o=n;"string"==typeof o&&(o=(e=>{let t=e.data,n=e.config;const r=t.split("\n"),i=r[0],o=r[1];let a=",";if(n&&n.parse&&n.parse.delimiter)a=n.parse.delimiter;else if(i){const e=[/,/,/\t/,/;/];for(let t=0;t<e.length;t++){const n=e[t];if(i&&o){if(n.test(i)&&n.test(o)&&i.split(n).length===o.split(n).length){a=n;break}}else n.test(i)&&(a=n)}}return r.map(e=>e.split(a))})({data:n,config:i})),Array.isArray(o)&&function(e){let t,n=e.source,r=e.data,i=e.cache,o=e.config,a=r;const s=o&&o.parse;Array.isArray(r[0])?s&&!1===s.headers?t=r[0].map((e,t)=>t):(t=r[0],a=r.slice(1)):t=Object.keys(r[0]);const l=!!s&&"function"==typeof s.row&&s.row;let c,u=t;u=s&&"function"==typeof s.fields?s.fields(u.slice()):t.map(e=>({key:e,title:e})),Array.isArray(r[0])?c=u.map(()=>[]):(c={},u.forEach(e=>{c[e.key]=[]}));for(let e=0;e<a.length;e++){const t=l?l(a[e],e,u):a[e];if(t)if(Array.isArray(t))for(let e=0;e<u.length;e++)c[e].push(t[e]);else for(let e=0;e<u.length;e++)c[u[e].key].push(t[u[e].key])}const d=Array.isArray(c)?e=>c[e]:e=>c[u[e].key];for(let e=0;e<u.length;e++){const t=d(e),r=oz(t),o=r.length>0,a=o?"measure":"dimension",s=o?Math.min(...r):NaN,l=o?Math.max(...r):NaN;i.fields.push($_(Gq({source:n,key:e,title:u[e].title,values:t,min:s,max:l,type:a},u[e]),{value:u[e].value,label:u[e].label}))}}({data:o,cache:r,source:t,config:i})};function sz(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.key,n=e.data,r=e.config;const i={fields:[]},o={key:()=>t,raw:()=>n,field:e=>function(e,t){let n=t.cache;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 r=[];return n.forEach(e=>{if(void 0!==e.field){const n=t.field(e.field),i=t.key();if(!n)throw Error("Field '".concat(e.field,"' not found"));const o=W_(e,t),a=o.props,s=o.main,l=Object.keys(a),c=!!e.trackBy,u=typeof e.trackBy,d={},f=[],h=n.items(),p=[];for(let t=0;t<h.length;t++){const n=h[t];if(s.filter&&!s.filter(n))continue;const r=iz(s,n,{key:i});l.forEach(e=>{const o=a[e];let s=o.field?o.field.items()[t]:n;r[e]=iz(o,s,{key:i})}),c&&K_({cfg:e,itemData:n,obj:r,target:f,tracker:d,trackType:u}),p.push(r)}r=c?[...r,...G_(f,{main:s,propsArr:l,props:a})]:[...r,...p]}}),r}(e,o),hierarchy:()=>null};return az({key:t,data:n,config:r,cache:i}),o}sz.util={normalizeConfig:W_,collect:G_,track:K_};const lz=mI();lz.default("matrix"),lz("matrix",sz),lz("default",sz);const cz=mI();function uz(e,t,n){return Math.max(e,Math.min(t,n))}function dz(e){let t=e.item,n=e.value,r=e.boxCenter,i=e.rendWidth,o=e.rendHeight,a="x",s="y",l=i,c=o,u=n<.5?90:-90;return e.flipXY&&(a="y",s="x",l=o,c=i,u=n<.5?180:0),(0,e.symbol)(Gq({},t.oob,{[a]:r*l,[s]:Math.max(t.oob.size/2,Math.min(n*c,c-t.oob.size/2)),startAngle:u}))}function fz(e){let t=e.item,n=e.boxWidth,r=e.boxPadding,i=e.rendWidth,o=e.rendHeight,a="x",s="y",l="width",c="height",u=i,d=o;e.flipXY&&(a="y",s="x",l="height",c="width",u=o,d=i);const f=function(e){let t=e.start,n=e.end,r=e.minPx,i=void 0===r?.1:r,o=e.maxPx,a=void 0===o?1:o;const s=Math.max(t,n),l=Math.min(t,n),c=uz(-.1,1.2,s),u=uz(-.1,1.2,l),d=c*a-u*a,f=Math.max(i,d),h=(f-d)/2;return{actualDiff:f,startModifier:h,actualLow:u*a-h}}({start:t.start,end:t.end,minPx:t.box.minHeightPx,maxPx:d}),h=f.actualDiff,p=f.actualLow;return Gq({},t.box,{type:"rect",[a]:(r+t.major)*u,[s]:p,[c]:h,[l]:n*u,data:t.data||{},collider:{type:null}})}function hz(e){let t=e.item,n=e.from,r=e.to,i=e.boxCenter,o=e.rendWidth,a=e.rendHeight,s="x1",l="y1",c="x2",u="y2",d=o,f=a;return e.flipXY&&(s="y1",l="x1",c="y2",u="x2",d=a,f=o),Gq({},t.line,{type:"line",[u]:Math.floor(n*f),[s]:i*d,[l]:Math.floor(r*f),[c]:i*d,data:t.data||{},collider:{type:null}})}function pz(e){let t=e.item,n=e.key,r=e.position,i=e.width,o=e.boxCenter,a=e.rendWidth,s=e.rendHeight,l="x1",c="y1",u="x2",d="y2",f=a,h=s;e.flipXY&&(l="y1",c="x1",u="y2",d="x2",f=s,h=a);const p=i/2;return Gq({type:"line"},t[n],{[c]:Math.floor(r*h),[l]:(o-p)*f,[d]:Math.floor(r*h),[u]:(o+p)*f,r:p*f,cx:o*f,cy:r*h,width:i*f,data:t.data||{},collider:{type:null}})}function mz(e,t,n){const r=t.box,i=r.width,o=r.maxWidthPx,a=r.minWidthPx,s=e>=0?1:-1;let l=Math.min(s*e*i,isNaN(o)?n:o/n);return l=isNaN(a)?l:Math.max(a/n,l),l*s}cz("native",function(e,t,n){let r,i,o={chart:e,mediator:t,element:n},a=[],s=!0;function l(){"function"==typeof r.enable&&(r.enable=r.enable.bind(o)()),r.enable&&Object.keys(r.events).forEach(e=>{const t=r.events[e].bind(o);n.addEventListener(e,t),a.push({key:e,listener:t})})}function c(){a.forEach(e=>{let t=e.key,r=e.listener;n.removeEventListener(t,r)}),a=[]}return{get key(){return i},set(e){!function(e){i=e.key,r=e,r.events=r.events||[],void 0===r.enable&&(r.enable=!0)}(e),c(),s&&l()},off(){s=!1,c()},on(){s=!0,0===a.length&&l()},destroy(){c(),o=null,r=null}}});const gz={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}},yz=Object.keys(gz),vz={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 t=e.data;const n=this.rect,r=n.width,i=n.height,o="horizontal"===this.settings.settings.orientation,a=this.style,s=this.resolver,l=this.symbol,c=yz.filter(e=>!this.settings.settings[e]||!1!==this.settings.settings[e].show),u={};c.forEach(e=>u[e]=gz[e]);const d=function(e){let t=e.keys,n=e.data,r=e.defaultSettings,i=e.style,o=e.settings,a=e.width,s=e.height,l=e.resolver;const c=Gq(!0,{},r||{},i||{}),u={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:u,settings:Gq(!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:u,settings:Gq(!0,{},{binStart:{scale:o.major.scale,ref:"binStart"},binEnd:{scale:o.major.scale,ref:"binEnd"}},o.major)}):l.resolve({data:n,scaled:u,defaults:{major:.5},settings:{major:o.major}});const h=o.minor||{},p={};["start","end","min","max","med"].forEach(e=>{(h[e]||n.items&&n.items.length&&n.items[0][e])&&(p[e]={scale:h.scale,ref:e})});let m,g={major:f,minor:l.resolve({data:n,defaults:{start:0,end:1},scaled:u,settings:Gq(!0,{},p,h)})};for(let e=0,r=t.length;e<r;e++)o[m]&&!1===o[m].show||(m=t[e],g[m]=l.resolve({data:n,defaults:c[m],settings:o[m],scaled:u}));return g}({keys:c,data:t,defaultSettings:u,style:a,settings:this.settings.settings,width:r,height:i,resolver:s});d.settings,d.items;const f=function(e){let t=e.width,n=e.height,r=e.flipXY,i=e.resolved,o=e.keys,a=e.symbol;const s=[],l=i.major.items;if(!l.length)return s;const c=t,u=n,d=r?n:t,f=i.major.settings,h=["start","end","min","max","med"].filter(e=>void 0!==i.minor.settings[e]),p=h.length,m=o.filter(e=>"oob"!==e);let g,y,v,b,x,S,M,w,k;const E=o?o.length:0,C=m?m.length:0;function N(){M?g.push(dz({item:v,value:0,boxCenter:S,rendWidth:c,rendHeight:u,flipXY:r,symbol:a})):w&&g.push(dz({item:v,value:1,boxCenter:S,rendWidth:c,rendHeight:u,flipXY:r,symbol:a}))}const T={box:function(){v.box&&nO(v.start)&&nO(v.end)&&g.push(fz({item:v,boxWidth:b,boxPadding:x,rendWidth:c,rendHeight:u,flipXY:r}))},line:function(){nO(v.min)&&nO(v.start)&&g.push(hz({item:v,from:v.min,to:v.start,boxCenter:S,rendWidth:c,rendHeight:u,flipXY:r})),nO(v.max)&&nO(v.end)&&g.push(hz({item:v,from:v.max,to:v.end,boxCenter:S,rendWidth:c,rendHeight:u,flipXY:r}))},median:function(){v.median&&nO(v.med)&&g.push(pz({item:v,key:"median",position:v.med,width:b,boxCenter:S,rendWidth:c,rendHeight:u,flipXY:r}))},whisker:function(){if(v.whisker){const e=b*v.whisker.width;nO(v.min)&&g.push(pz({item:v,key:"whisker",position:v.min,width:e,boxCenter:S,rendWidth:c,rendHeight:u,flipXY:r})),nO(v.max)&&g.push(pz({item:v,key:"whisker",position:v.max,width:e,boxCenter:S,rendWidth:c,rendHeight:u,flipXY:r}))}}};function D(){let e,t=-Number.MAX_VALUE,n=Number.MAX_VALUE;for(let r=0;r<p;r++)e=v[h[r]],nO(e)&&(t<e&&(t=e),n>e&&(n=e));M=t<0&&t!==-Number.MAX_VALUE,w=n>1&&n!==Number.MAX_VALUE,k=M||w}for(let e=0,t=l.length;e<t;e++){g=[],y=null;const t=l[e],n=t.data;let r=null,a=null;void 0!==f.binStart?(r=t.binStart,a=t.binEnd,y=f.binStart.scale):(y=f.major.scale,r=y?t.major:0);let c=0;y?y.bandwidth?(c=y.bandwidth(),r-=c/2):c=a-r:c=1,v=Gq({},{major:r,majorEnd:a},i.minor.items[e]);for(let t=0;t<E;t++)v[o[t]]=i[o[t]].items[e];if(b=mz(c,v,d),x=(c-b)/2,S=x+v.major+b/2,D(),k)v.oob&&N();else for(let e=0;e<C;e++)v[m[e]]&&!1===v[m[e]].show||T[m[e]]();const u={type:"container",data:n,collider:{type:"bounds"},children:g};s.push(u)}return s}({width:r,height:i,flipXY:o,resolved:d,keys:c,symbol:l});return f}};const bz={shape:"saltire",width:2,size:.5,fill:"#333",stroke:"#333",strokeWidth:0},xz=/px$/,Sz={shape:"circle",label:"",fill:"#333",stroke:"#ccc",strokeDasharray:"",strokeWidth:0,strokeLinejoin:"miter",opacity:1,x:.5,y:.5,size:1,show:!0},Mz={imageSrc:void 0,imageScalingFactor:void 0,position:"center-center",symbol:"rectangle",width:void 0,height:void 0},wz={maxPx:1e4,minPx:1,maxRelExtent:.1,minRelExtent:.01,maxRelDiscrete:1,minRelDiscrete:.1};function kz(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 Ez(e,t,n,r){let i=t.width,o=t.height;return e.filter(e=>!1!==e.show&&!isNaN(e.x+e.y)).map(e=>{let t=e,a=xz.test(e.size)?parseInt(e.size,10):n.min+t.size*(n.max-n.min);rO(a)&&(t=bz,a=n.min+t.size*(n.max-n.min));const s=function(e){let t=Sz.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),l=eO(s,2),c=l[0],u=Qq(Qq({},l[1]),{},{type:c,label:e.label,x:e.x*i,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,imageSettings:t.imageSettings});t===e.errorShape&&(u.width=t.width);const d=r(u);return d.data=e.data,d})}const Cz={require:["chart","resolver","symbol"],defaultSettings:{settings:{},data:{},animations:{enabled:!1,trackBy:e=>e.data.value},style:{item:"$shape"}},render(e){let t=e.data;const n=this.resolver.resolve({data:t,defaults:Gq({},Sz,this.style.item),settings:this.settings.settings,scaled:{x:this.rect.width,y:this.rect.height}}),r=this.rect,i=r.width,o=r.height,a=Gq({},wz,this.settings.settings.sizeLimits),s=n.items;s.length>0&&"image"===s[0].shape&&t.items.forEach((e,t)=>{s[t].imageSettings=Gq({},Mz,this.settings.settings.imageSettings)});const l=function(e,t,n,r,i){const o=kz(e?e.scale:void 0,n),a=kz(t?t.scale:void 0,r);let s=Math.min(o.value*i[o.isBandwidth?"maxRelDiscrete":"maxRelExtent"],a.value*i[a.isBandwidth?"maxRelDiscrete":"maxRelExtent"]),l=Math.min(o.value*i[o.isBandwidth?"minRelDiscrete":"minRelExtent"],a.value*i[a.isBandwidth?"minRelDiscrete":"minRelExtent"]);return{min:Math.max(1,Math.floor(l)),max:Math.max(1,Math.floor(s)),maxGlobal:i.maxPx,minGlobal:i.minPx}}(n.settings.x,n.settings.y,i,o,a);return Ez(s,this.rect,l,this.settings.shapeFn||this.symbol)}};const Nz={label:"",arc:1,show:!0,fill:"#333",stroke:"#ccc",strokeWidth:1,strokeLinejoin:"round",opacity:1,innerRadius:0,outerRadius:.8,cornerRadius:0,offset:0};function Tz(e,t,n,r){let i=t.x,o=t.y,a=t.width,s=t.height;const l=RO(),c={x:i+a/2,y:o+s/2},u=Math.min(a,s)/2,d=Math.min(a,s)/2,f=d/100;return e.map((e,t)=>{const i=n[t];i.type="path";const o=d*i.outerRadius,a=u*i.innerRadius,s=f*i.cornerRadius;l.innerRadius(a),l.outerRadius(o),l.cornerRadius(s),i.arcDatum=e;const h=l.centroid(e),p=i.offset?function(e,t,n,r){let i=eO(e,2),o=i[0],a=i[1];const s=Math.sqrt(o*o+a*a);o/=s,a/=s;const l=n-r;return{x:o*t*l,y:a*t*l}}(h,i.offset,o,a):{x:0,y:0};return i.transform="translate(".concat(p.x,", ").concat(p.y,") translate(").concat(c.x,", ").concat(c.y,")"),i.desc={share:e.value/r,slice:{start:e.startAngle,end:e.endAngle,innerRadius:a,outerRadius:o,cornerRadius:s,offset:{x:c.x+p.x,y:c.y+p.y}}},i})}function Dz(e,t){return e.slice&&"arc"in e.slice?t.arc:t.data.value}const qz={require:["chart","resolver"],defaultSettings:{settings:{startAngle:0,endAngle:2*Math.PI,padAngle:0,slice:{}},style:{slice:"$shape"},data:{}},render(e){let t=e.data;const n=[],r=[],i=this.settings.settings,o=this.resolver.resolve({data:t,defaults:Gq({},Nz,this.style.slice),settings:i.slice}).items;let a=0;for(let e=0,t=o.length;e<t;e++){const t=Dz(i,o[e]);t>0&&o[e].outerRadius>=o[e].innerRadius&&(n.push(t),r.push(o[e]),a+=t)}const s=function(){var e=BO,t=HO,n=null,r=dO(0),i=dO(MO),o=dO(0);function a(a){var s,l,c,u,d,f=(a=FO(a)).length,h=0,p=new Array(f),m=new Array(f),g=+r.apply(this,arguments),y=Math.min(MO,Math.max(-MO,i.apply(this,arguments)-g)),v=Math.min(Math.abs(y)/f,o.apply(this,arguments)),b=v*(y<0?-1:1);for(s=0;s<f;++s)(d=m[p[s]=s]=+e(a[s],s,a))>0&&(h+=d);for(null!=t?p.sort(function(e,n){return t(m[e],m[n])}):null!=n&&p.sort(function(e,t){return n(a[e],a[t])}),s=0,c=h?(y-f*b)/h:0;s<f;++s,g=u)l=p[s],u=g+((d=m[l])>0?d*c:0)+b,m[l]={data:a[l],index:s,value:d,startAngle:g,endAngle:u,padAngle:v};return m}return a.value=function(t){return arguments.length?(e="function"==typeof t?t:dO(+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?(r="function"==typeof e?e:dO(+e),a):r},a.endAngle=function(e){return arguments.length?(i="function"==typeof e?e:dO(+e),a):i},a.padAngle=function(e){return arguments.length?(o="function"==typeof e?e:dO(+e),a):o},a}().sortValues(null);s.startAngle(i.startAngle),s.endAngle(i.endAngle),s.padAngle(i.padAngle);return Tz(s(n),Gq({},this.rect,{x:0,y:0}),r,a)}};const Oz=function(e){function t(t){if(e[t.type]&&e[t.type].condition(t)){const n=e[t.type],r=void 0===n.conditionAppend||n.conditionAppend(t);n.items.forEach(e=>{const n=Math.round(t[e.key]),i=t[e.key]-n;t[e.key]=n,r&&"append"===e.type&&(i>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 Iz{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 r=e.substring(0,1);if("x"===r||"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"===r||"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,r=void 0!==e.crisp?e.crisp:this.crisp;if(e.fn&&"function"==typeof e.fn){let r=n?this.height:this.width,i=n?this.width:this.height;e=e.fn({width:r,height:i,flipXY:n});const o=Object.keys(e);for(let r=0,i=o.length;r<i;r++){let i=o[r];t[Iz.evaluateKey(i,n)]=e[i]}}else{const r=Object.keys(e);for(let i=0,o=r.length;i<o;i++){let o=r[i];const a=Iz.evaluateKey(o,n),s=this.transposeCoordinate(a,e[o],n);t[a]=s}}return r&&Oz(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 Az(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Iz(...t)}function _z(e,t){return e&&t?e.cachedTicks&&e.cachedTicks()||e.ticks({distance:t}):[]}const Lz={created(){},require:["chart","renderer","resolver"],defaultSettings:{layout:{displayOrder:0},style:{ticks:"$guide-line",minorTicks:"$guide-line--minor"}},beforeRender(){this.blueprint=Az(),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,SR(this,"x",this.rect.width),SR(this,"y",this.rect.height),!this.x&&!this.y)return[];this.settings.ticks=Gq({show:!0},this.style.ticks,this.settings.ticks||{}),this.settings.minorTicks=Gq({show:!1},this.style.minorTicks,this.settings.minorTicks||{}),this.lines={x:[],y:[]},this.lines.x=_z(this.x,this.rect.width),this.lines.y=_z(this.y,this.rect.height),this.lines.y=this.lines.y.map(e=>Gq(e,{flipXY:!0}));let e=e=>{let t=e.dir,n=e.isMinor,r=this.lines[t].filter(e=>!!e.isMinor===n),i=n?this.settings.minorTicks:this.settings.ticks;this.resolver.resolve({settings:i,data:{items:r,dir:t}}).items.forEach(e=>{let n=e.data;var r,i;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!==(r=n.value)&&void 0!==r?r:null===(i=n.data)||void 0===i?void 0:i.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 Pz(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"bottom";if(n*=.8,"left"===r||"right"===r){let i="right"===r;return"\n      M ".concat(e," ").concat(t-n,"\n      A ").concat(1.25*n," ").concat(1.25*n,", 0, 1, ").concat(i?0:1,", ").concat(e," ").concat(t+n,"\n      L ").concat(i?e+n:e-n," ").concat(t," Z\n    ")}let i="bottom"===r;return"\n    M ".concat(e-n," ").concat(t,"\n    A ").concat(1.25*n," ").concat(1.25*n,", 0, 1, ").concat(i?1:0,", ").concat(e+n," ").concat(t,"\n    L ").concat(e," ").concat(i?t+n:t-n," Z\n  ")}function Rz(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"bottom";if(n*=.75,"left"===r||"right"===r){let i="right"===r;return"\n      M ".concat(e+=i?1.5*n:-1.5*n," ").concat(t-n,"\n      L ").concat(e," ").concat(t+n,"\n      L ").concat(i?e+n:e-n," ").concat(t," Z\n    ")}let i="bottom"===r;return t+=i?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(i?t+n:t-n," Z\n  ")}function Fz(e,t,n){return e<t||e>n}function zz(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 jz(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 $z(e){var t,n;let r=e.chart,i=e.blueprint,o=e.renderer,a=e.p,s=e.settings,l=e.items,c=e.slopeLine,u=!0,d=!1,f=!1,h=!1,p=!1,m=Gq(!0,{},s.style.line,a.line||{}),g=Gq(!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?i.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}):i.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=Gq(!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=zz(a,r),!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}),g={width:d.width+n.width,height:Math.max(d.height,n.height)},y=e.padding,v=jz(a.flipXY?e.vAlign:e.align),b=jz(a.flipXY?e.align:e.vAlign),x=Math.min(1+g.width+2*y,e.maxWidth*i.width,e.maxWidthPx),S=g.height+2*y,M=a.flipXY?S:x,w=a.flipXY?x:S;if(f=i.processItem({fn:t=>{let n=t.width,r=t.height,o=a.position*n-(a.flipXY?S:x)*(1-v);o=a.flipXY?o:Math.max(o,0);return{type:"rect",x:o,y:Math.max(Math.abs(b*r-w*b),0),width:a.flipXY?M:Math.min(M,i.width-o),height:w,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>i.width+1||f.y<-1||f.y+f.height>i.height+1)f=void 0;else{h={type:"text",text:e.text||"",fill:e.fill,opacity:e.opacity,fontFamily:e.fontFamily,fontSize:e.fontSize,x:f.x+y,y:f.y+f.height/2+g.height/3,maxWidth:f.width-2*y-n.width,anchor:"start"},c&&(p={type:"text",text:c||"",fill:e.fill,opacity:e.opacity,fontFamily:e.fontFamily,fontSize:e.fontSize,x:h.x+3+(f.width-(n.width+2*y)),y:h.y});for(let e=0,t=l.length;e<t;e++){let t=l[e];"rect"===t.type?gF(f,t)&&(u=!1):"line"===t.type&&a.flipXY===t.flipXY&&bF(f,t)&&(u=!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 y,v,b;let e,t;const n=120;let s=!1!==(null===(y=c.label)||void 0===y?void 0:y.show)?null===(v=c.label)||void 0===v?void 0:v.text:"";if(!1!==(null===(b=c.label)||void 0===b?void 0:b.showValue)){var x;const t=zz(a,r),n=t?t(c.value):c.value;e="(".concat(c.slope,"x + ").concat(n,")"),s+=null!==(x=c.label)&&void 0!==x&&x.text?" ".concat(e):e}if(s.length>1){var S,M,w;const e=o.measureText({text:s,fontFamily:g.fontFamily,fontSize:g.fontSize});e.width=e.width>n?n:e.width;const a=function(e,t,n){const r=e.scale({scale:"x"}),i=e.scale({scale:"y"});if(t>0){if(r.max()*t+n>=i.max())return!0}else if(t<0&&r.min()*t+n>=i.max())return!0;return!1}(r,c.slope,c.value)?function(e,t,n){const r=e.scale({scale:"x"}),i=e.scale({scale:"y"});return r((i.max()-n)/t)}(r,c.slope,c.value):void 0,u=void 0===a||c.isRtl?g.padding:3*g.padding,f=void 0!==a||c.slope>0?3*g.padding:g.padding,h=function(e,t,n,r,i,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*i.width+a;if(1===n)return e.isRtl?n*i.width-(r.width+3*o.padding):n*i.width-(r.width+6*o.padding);if(n>.8)return e.isRtl?n*i.width-(r.width+3*o.padding):n*i.width-(r.width+6*o.padding)}else if(e.slope>0)return t.x2-(r.width+2*o.padding);return e.isRtl?t.x1-(r.width+2*o.padding):t.x1}(c,d,a,e,i,g),p=Math.min(d.y1,d.y2);null!==(S=c.label)&&void 0!==S&&S.stroke&&(t={type:"rect",x:c.isRtl?Math.max(h,u)-2:Math.max(h,u)+2,y:Math.abs(Math.max(p,f)-e.height),rx:3,ry:3,width:e.width+g.padding,height:e.height-2,stroke:m.stroke,fill:m.stroke});const y={type:"text",text:s,fill:null!==(M=null===(w=c.label)||void 0===w?void 0:w.stroke)&&void 0!==M?M:m.stroke,opacity:g.opacity,fontFamily:g.fontFamily,fontSize:g.fontSize,x:t?t.x+2:Math.max(h,u)+2,y:t?t.y+e.height-g.padding:Math.abs(Math.max(p,f)-g.padding/2),anchor:"start",title:s,maxWidth:n,width:e.width};(function(e,t,n,r,i){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+r,t.width+r)&&Math.abs(a.y-t.y)<n.height+i)return!0}return!1})(l,y,e,u,f)||(t&&l.push(t),l.push(y))}}u&&f&&h&&(l.push(f,h),p&&l.push(p))}function Vz(e){const t={value:e.value};return e.label&&(t.label=e.label.text),t}function Uz(e){return void 0!==("function"==typeof e.value?e.value():e.value)}function Hz(e,t){const n=e.min();if(n===e.max()){const r=function(e){const t=e.range();return 2===(null==t?void 0:t.length)&&t[0]>t[1]}(e);if(t<n)return r?2:-1;if(t>n)return r?-1:2}return e(t)}function Bz(e,t){return e&&t&&Math.abs(e.x-t.x)<1e-15&&Math.abs(e.y-t.y)<1e-15}const Wz={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=Az(),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(Uz).map(e=>{if("function"==typeof e.value&&(e.value=e.value()),e.scale){let t=this.chart.scale(e.scale);const n=Hz(t,e.value);return Gq(e,{scale:t,position:n})}return Gq(e,{position:e.value})}),this.lines.y=this.lines.y.filter(Uz).map(e=>{if("function"==typeof e.value&&(e.value=e.value()),e.scale){let t=this.chart.scale(e.scale);const n=Hz(t,e.value);return Gq(e,{scale:t,position:n,flipXY:!0})}return Gq(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(Vz(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(Vz(e)),!1)));let n=[];return[...this.lines.x,...this.lines.y].forEach(r=>{if(!0===r.show||void 0===r.show){let i;if(r.slope&&0!==r.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();i=Qq(Qq({},r),{},{x1:void 0,y1:void 0,x2:void 0,y2:void 0});const c=o*r.slope+r.value,u=a*r.slope+r.value,d=(s-r.value)/r.slope,f=(l-r.value)/r.slope;let h=[];Fz(c,s,l)||(h[0]={x:Hz(e,o),y:Hz(n,c)}),Fz(d,o,a)||(h[1]={x:Hz(e,d),y:1}),Fz(u,s,l)||(h[2]={x:Hz(e,a),y:Hz(n,u)}),Fz(f,o,a)||(h[3]={x:Hz(e,f),y:0});const p=h.filter(e=>!!e).length;if(p>2&&function(e){Bz(e[0],e[1])&&(e[1]=void 0),Bz(e[1],e[2])&&(e[2]=void 0),Bz(e[2],e[3])&&(e[3]=void 0),Bz(e[3],e[0])&&(e[3]=void 0)}(h),h=h.filter(e=>!!e),h.length<2)return void t["y".concat(c>l?0:1)].push(Vz(r));i.x1=h[0].x,i.y1=h[0].y,i.x2=h[1].x,i.y2=h[1].y}else i=void 0;$z({chart:this.chart,blueprint:this.blueprint,renderer:this.renderer,p:r,settings:e,items:n,slopeLine:i})}}),e.style.oob.show&&function(e){let t=e.blueprint,n=e.oob,r=e.settings,i=e.items;const o=Object.keys(n);let a=r.style.oob||{};for(let e=0,r=o.length;e<r;e++){const r=o[e],s=n[r];if(s.length>0){let e=r.charAt(1),n="y"===r.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 r=t.width,i=t.height,u=e*r+("1"===e?-o:o),d=n?l:i-l;return"arc"===a.type?{type:"path",d:Pz(n?d:u,n?u:d,a.width,c),x:u,y:d,stroke:a.stroke,fill:a.fill,strokeWidth:a.strokeWidth||0}:{type:"circle",cx:u,cy:d,r:a.width,stroke:a.stroke,fill:a.fill,strokeWidth:a.strokeWidth||0,opacity:a.opacity,data:s}},flipXY:n}),d=u.cx||u.x,f=u.cy||u.y;const h=s.map(e=>e.label?"".concat(e.label," (").concat(e.value,")"):"(".concat(e.value,")")),p=h.reduce((e,t,n)=>0===n?t:"".concat(e,"\n\n").concat(t),"");let m={type:"text",text:s.length||"",title:p,x:d-.4*a.width,y:f+.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},g={type:"path",d:Rz(d,f,a.width,c),x:d,y:f,stroke:a.triangle.stroke,fill:a.triangle.fill,strokeWidth:a.triangle.strokeWidth||0,opacity:a.triangle.opacity};i.push(u,m,g)}}}({blueprint:this.blueprint,oob:t,settings:e,items:n}),n}};function Yz(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){Gq(e,t.style)}(t,e),t}function Gz(e){return"string"==typeof e||"number"==typeof e?e:"-"}function Kz(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 r=n.angle*(Math.PI/180),i=Math.max(n.stepSize/2,t.boundingRect.height/2),o="start"===t.anchor,a="end"===t.anchor&&r<0,s="start"===t.anchor&&r>=0,l=t.boundingRect.y+(s||a?t.boundingRect.height:0),c=[{x:t.x-i,y:l},{x:t.x+i,y:l}].map(e=>UR(e,r,{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},d={x:o?t.boundingRect.x+t.boundingRect.width+10:t.boundingRect.x-10,y:t.boundingRect.y},f=r>=0?[u,d]:[d,u];c.push(...f),t.collider={type:"polygon",vertices:c}}(0,t,n):function(e,t,n){if("bottom"===n.align||"top"===n.align){const r=e.position*n.innerRect.width+(n.innerRect.x-n.outerRect.x-n.stepSize/2);t.collider={type:"rect",x:r,y:0,width:r<0?n.stepSize+r:n.stepSize,height:n.innerRect.height}}else{const r=e.position*n.innerRect.height+(n.innerRect.y-n.outerRect.y-n.stepSize/2);t.collider={type:"rect",x:0,y:r,width:n.innerRect.width,height:r<0?n.stepSize+r:n.stepSize}}const r=t.collider;r.x=Math.max(r.x,0),r.y=Math.max(r.y,0);const i=r.x+r.width-(n.outerRect.x+n.outerRect.width);r.width=i>0?r.width-i:r.width;const o=r.y+r.height-(n.outerRect.y+n.outerRect.height);r.height=o>0?r.height-o:r.height}(e,t,n)}function Xz(e,t){const n=isNaN(e.style.align)?.5:Math.min(Math.max(e.style.align,0),1);let r=0;if(e.tilted)r=e.stepSize*n;else{const i=t?e.textRect.height:e.textRect.width;r=Math.max(0,e.stepSize-i)*n}return r}function Jz(e,t){var n,r;const i={type:"text",text:Gz(e.label),x:0,y:0,maxWidth:t.maxWidth,maxHeight:t.maxHeight,tickValue:null!==(n=e.value)&&void 0!==n?n:null===(r=e.data)||void 0===r?void 0:r.value};return"top"===t.align||"bottom"===t.align?(i.x=e.start*t.innerRect.width+(t.innerRect.x-t.outerRect.x)+Xz(t,!1),i.y="top"===t.align?t.innerRect.height:0,i.anchor=t.stepSize?"start":"middle",i.x+=isNaN(t.style.offset)?0:+t.style.offset):(i.y=e.start*t.innerRect.height+(t.innerRect.y-t.outerRect.y)+Xz(t,!0),i.x="left"===t.align?t.innerRect.width:0,i.anchor="left"===t.align?"end":"start",i.baseline=t.stepSize?"text-before-edge":"central",i.y+=isNaN(t.style.offset)?0:+t.style.offset),function(e,t){["fill","fontSize","fontFamily"].forEach(n=>{e[n]=t.style[n]})}(i,t),function(e,t){if(!t.tilted&&!t.stepSize)if("top"===t.align||"bottom"===t.align){const n=0,r=t.outerRect.width,i=Math.min(t.maxWidth/2,t.textRect.width/2),o=e.x-i,a=e.x+i;o<n?(e.anchor="start",e.x=t.innerRect.x-t.outerRect.x):a>r&&(e.anchor="end",e.x=t.innerRect.width+t.innerRect.x)}else{const n=0,r=t.outerRect.height,i=t.maxHeight/2,o=e.y-i,a=e.y+i;o<n?(e.y=t.innerRect.y-t.outerRect.y,e.baseline="text-before-edge"):a>r&&(e.y=t.innerRect.height+(t.innerRect.y-t.outerRect.y),e.baseline="text-after-edge")}}(i,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)}(i,t),function(e,t){if(t.tilted){const n=-t.angle,r=n*(Math.PI/180);"bottom"===t.align?(e.x-=t.maxHeight*Math.sin(r)/2,e.y-=t.maxHeight,e.y+=t.maxHeight*Math.cos(r)/2):e.x-=t.maxHeight*Math.sin(r)/3,e.transform="rotate(".concat(n,", ").concat(e.x,", ").concat(e.y,")"),e.anchor="bottom"===t.align==t.angle<0?"start":"end";const i=Math.cos(r)*t.maxWidth;if("bottom"===t.align==t.angle<0){const n=t.outerRect.width-t.paddingEnd;e.x+i>n&&(e.maxWidth=(n-e.x-10)/Math.cos(r))}else{const n=t.paddingEnd;e.x-i<n&&(e.maxWidth=(e.x-n-10)/Math.cos(r))}}}(i,t),function(e,t){e.boundingRect=t.textBounds(e)}(i,t),Kz(e,i,t),i}function Zz(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){Gq(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 Qz(e){return!e.isMinor&&e.position>=0&&e.position<=1}function ej(e){let t=e.rect,n=e.state,r=e.majorTicks,i=e.measure;return e.horizontal?function(e){let t=e.majorTicks,n=e.measureText,r=e.rect;const i="layered"===e.state.labels.activeMode?2:1,o=r.width,a=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(i*o*Math.abs(n.start-n.end)<a[e])return!0}return!1}({majorTicks:r,measureText:i,rect:t,state:n}):function(e){let t=e.majorTicks,n=e.measureText;const r=e.rect.height,i=n("M").height;return!(t.length<2)&&r*Math.abs(t[0].position-t[1].position)<i}({majorTicks:r,measureText:i,rect:t})}function tj(e){let t=e.value,n=e.maxValue,r=e.minValue,i=e.range,o=e.modifier;return isNaN(i)||isNaN(o)||(t=i*o),t>n&&(t=n),t<r&&(t=r),t}function nj(e){let t=e.isDiscrete,n=e.rect,r=e.formatter,i=e.measureText,o=e.scale,a=e.settings,s=e.state,l=0;const c={left:0,top:0,right:0,bottom:0},u=a.labels,d=u.maxLengthPx,f=u.minLengthPx;if(a.labels.show){const e=a.align,u="top"===e||"bottom"===e,h=u?n.inner.width:n.inner.height,p=o.ticks({settings:a,distance:h,formatter:r}).filter(Qz),m=e=>{const t=i({text:e,fontSize:a.labels.fontSize,fontFamily:a.labels.fontFamily});return t.width=tj({value:t.width,maxValue:d,minValue:f}),t};if(t&&u&&"auto"===a.labels.mode&&(!function(e){let t=e.majorTicks,n=e.measure,r=e.rect,i=e.state,o=e.settings;const a=o.labels.maxGlyphCount,s="layered"===i.labels.activeMode?2:1,l=o.labels.tiltThreshold?o.labels.tiltThreshold:.7,c=n("…").width,u=r.width;let d=0,f=0;if(isNaN(a))for(let e=0;e<t.length;e++){const r=t[e],i=r.label,o=n(i).width*(i.length>1?l:1);if(f=s*u*Math.abs(r.start-r.end),o+c>f)return!0}else{const e=t.reduce((e,t)=>Math.min(Math.abs(t.start-t.end),e),1/0);if(f=s*u*e,d=n("M").width*l*a,d+c>f)return!0}return!1}({majorTicks:p,measure:m,rect:n.inner,state:s,settings:a})?s.labels.activeMode="horizontal":s.labels.activeMode="tilted"),!a.labels.filterOverlapping&&"tilted"!==s.labels.activeMode&&ej({rect:n.inner,state:s,majorTicks:p,measure:m,horizontal:u})){return{size:Math.max(n.outer.width,n.outer.height),isToLarge:!0}}let g,y;if("tilted"===s.labels.activeMode){const e=Math.abs(a.labels.tiltAngle)*(Math.PI/180);g=t=>tj({value:t.width,maxValue:d,minValue:f})*Math.sin(e)+t.height*Math.cos(e)}else g=u?e=>e.height:e=>tj({value:e.width,maxValue:d,minValue:f});if(u&&"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(m),b=v.map(g),x=Math.max(...b,0);if(l+=x,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),r=(x-m("M").height*Math.cos(t))/Math.sin(t),i=e=>Math.min(r,e.width)*Math.cos(t)+e.height,o=(t,r)=>{const i=p[r]?p[r].position:0;return e?t-i*n.inner.width:t-(1-i)*n.inner.width},s=Math.min(a.labels.maxEdgeBleed,Math.max(...v.map(i).map(o),0))+a.paddingEnd;if(c[e?"left":"right"]=s,!a.labels.filterOverlapping&&function(e){let t=e.majorTicks,n=e.measureText,r=e.rect,i=e.bleedSize,o=e.angle;if(t.length<2)return!1;if(0===o)return!0;const a=Math.abs(o),s=1/(Math.min(r.outer.width-i,r.inner.width)*Math.abs(t[0].position-t[1].position));return n("M").height>Math.sin(a*(Math.PI/180))/s}({majorTicks:p,measureText:m,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 rj=(e,t,n)=>e.width*Math.abs(t.position-n.position);function ij(e){let t=e.layered,n=e.major,r=e.innerRect,i=e.outerRect,o=e.tick,a=e.index;const s=t?2:1,l=n[a-s],c=n[a+s],u=l?rj(r,o,l)/2-2:1/0,d=c?rj(r,o,c)/2-2:1/0;return n.length<2?r.width:l?c?2*Math.min(u,d):(e=>{let t=e.innerRect,n=e.outerRect,r=e.tick,i=e.prevWidth;const o=t.x-n.x,a=n.width-t.width-o,s=t.width-t.width*r.position+a,l=2*Math.min(i,s),c=1===r.position?t.width/2-2:0;return Math.max(i,l,c)})({innerRect:r,outerRect:i,tick:o,prevWidth:u}):(e=>{let t=e.innerRect,n=e.outerRect,r=e.tick,i=e.nextWidth;const o=t.x-n.x,a=t.width*r.position+o,s=2*Math.min(i,a),l=0===r.position?t.width/2-2:0;return Math.max(i,s,l)})({innerRect:r,outerRect:i,tick:o,nextWidth:d})}function oj(e){const t=e.innerRect,n={cx:t.width/2,cy:t.height/2},r=Math.min(t.height,t.width)/2*e.radius,i=r+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:r,outerRadius:i}},ticks:[]};return function(e,t){Gq(e,t.style)}(o,e),o}function aj(e,t,n,r){return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}function sj(e,t){const n=t.innerRect,r={cx:n.width/2,cy:n.height/2},i=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 u=aj(r.cx,r.cy,i+s,c),d=aj(r.cx,r.cy,i,c),f={type:"line",x1:u.x,y1:u.y,x2:d.x,y2:d.y,value:e.value};return function(e,t){const n=Qq({},t.style);Gq(e,n)}(f,t),f}function lj(e){return"string"==typeof e||"number"==typeof e?e:"-"}function cj(e,t,n){let r;return r="left"===t?n.x:"right"===t?e.outerRect.width-n.x:Math.max(n.x,e.outerRect.width-n.x),r}function uj(e,t){const n=t.innerRect,r={cx:n.width/2,cy:n.height/2},i=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,d;u="top"===t.align||"bottom"===t.align?a-e.position*l:o+e.position*l,d=u<-.2&&u>-Math.PI+c?"left":u>.2&&u<Math.PI-c?"right":"center",u-=Math.PI/2;const f=function(e,t,n,r){return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}(r.cx,r.cy,i+s+6,u);let h;h="left"===d?"end":"right"===d?"start":"middle";const p={type:"text",text:lj(e.label),align:d,x:f.x,y:f.y,maxHeight:t.maxHeight,maxWidth:cj(t,d,f),anchor:h,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 r,i;const o=parseFloat(n.fontSize)||0;r=t.y-o/2,i=e.innerRect.height-(t.y+o/2),(r<0||i<0)&&(n.text="")}(t,f,p),p}function dj(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 fj(e){let t=0;return t+=e.line.show?e.line.strokeWidth/2:0,t+=e.ticks.show?e.ticks.margin:0,t}function hj(e){let t=0;return t+=e.ticks.show?e.ticks.tickSize:0,t+=dj(e)+e.labels.margin,t}function pj(e,t){return e.map(e=>Zz(e,t))}function mj(e,t){return t?Math.abs(t.end-t.start):e.bandwidth()}function gj(e){let t=e.textMetrics,n=e.settings,r=e.innerRect,i=e.scale,o=e.tilted,a=e.layered,s=e.tick;const l=t.height,c=mj(i,s),u={width:0,height:l};if("left"===n.align||"right"===n.align)u.width=r.width-hj(n)-n.paddingEnd;else if(a)u.width=c*r.width*2;else if(o){const e=Math.abs(n.labels.tiltAngle)*(Math.PI/180);u.width=(r.height-hj(n)-n.paddingEnd-l*Math.cos(e))/Math.sin(e)}else u.width=c*r.width;return u.width=tj({value:u.width,maxValue:n.labels.maxLengthPx,minValue:n.labels.minLengthPx}),u}function yj(e){let t=e.textMetrics,n=e.settings,r=e.innerRect,i=e.outerRect,o=e.tilted,a=e.layered,s=e.tick,l=e.index,c=e.major;const u=t.height,d={width:0,height:u};if("left"===n.align||"right"===n.align)d.width=r.width-hj(n)-n.paddingEnd;else if(o){const e=Math.abs(n.labels.tiltAngle)*(Math.PI/180);d.width=(r.height-hj(n)-n.paddingEnd-u*Math.cos(e))/Math.sin(e)}else d.width=ij({layered:a,major:c,innerRect:r,outerRect:i,tick:s,index:l});return d.width=tj({value:d.width,maxValue:n.labels.maxLengthPx,minValue:n.labels.minLengthPx}),d}function vj(e){let t;function n(){return t=yj,n}function r(){return t=gj,r}function i(e){let n=e.settings,r=e.scale,i=e.innerRect,o=e.outerRect,a=e.measureText,s=e.ticks,l=e.state,c=e.textBounds;const u=[],d=function(e){return e.filter(e=>!e.isMinor)}(s),f=function(e){return e.filter(e=>e.isMinor)}(s),h={innerRect:i,align:n.align,outerRect:o},p="tilted"===l.labels.activeMode,m="layered"===l.labels.activeMode;let g;if(n.arc&&(h.startAngle=n.arc.startAngle,h.endAngle=n.arc.endAngle,h.radius=n.arc.radius),n.line.show&&(h.style=n.line,h.padding=n.paddingStart,n.arc?u.push(oj(h)):u.push(Yz(h))),n.ticks.show&&(h.style=n.ticks,h.tickSize=n.ticks.tickSize,h.padding=dj(n),n.arc?(h.padding=fj(n),g=function(e,t){return e.map(e=>sj(e,t))}(d,h)):g=pj(d,h)),n.labels.show){const e=hj(n);h.style=n.labels,h.padding=e,h.tilted=p,h.layered=m,h.angle=n.labels.tiltAngle,h.paddingEnd=n.paddingEnd,h.textBounds=c;const s=(e,s)=>{h.textRect=function(e){let t=e.style;return(0,e.measureText)({text:e.tick.label,fontSize:t.fontSize,fontFamily:t.fontFamily})}({tick:e,measureText:a,style:h.style});const l=t({textMetrics:h.textRect,settings:n,innerRect:i,outerRect:o,scale:r,tilted:p,layered:m,tick:e,major:d,index:s});h.maxWidth=l.width,h.maxHeight=l.height,h.stepSize=function(e){let t=e.innerRect,n=e.scale,r=e.settings,i=e.tick;return("top"===r.align||"bottom"===r.align?t.width:t.height)*mj(n,i)}({innerRect:i,scale:r,settings:n,tick:e})};let l=[];n.arc?(h.padding=function(e){let t=0;return t+=e.ticks.show?e.ticks.tickSize:0,t+=fj(e)+e.labels.margin,t}(n),l=function(e,t,n){return e.map((e,r)=>{n(e,r);const i=uj(e,t);return i.data=e.data,i})}(d,h,s)):l=!m||"top"!==n.align&&"bottom"!==n.align?function(e,t,n){return e.map((e,r)=>{n(e,r);const i=Jz(e,t);return i.data=e.data,i})}(d,h,s):function(e,t,n,r){const i=t.padding,o=hj(n);return e.map((e,a)=>{r(e,a);const s=o+t.maxHeight+n.labels.margin;t.layer=a%2,t.padding=a%2==0?i:s;const l=Jz(e,t);return l.data=e.data,l})}(d,h,n,s),n.labels.filterOverlapping&&function(e,t,n){let r=(t,n)=>gF(uO(1,e[t].boundingRect),uO(1,e[n].boundingRect));if(n&&n.tilted){const t=Math.abs(n.angle);r=(n,r)=>{const i=1/Math.abs(e[n].x-e[r].x),o=Math.sin(t*(Math.PI/180))/i;return e[n].boundingRect.height>o}}for(let n=0;n<=e.length-1;n++)for(let i=n+1;i<=Math.min(n+5,n+(e.length-1));i++)e[n]&&e[i]&&r(n,i)&&(i===e.length-1?(e.splice(n,1),t&&t.splice(n,1)):(e.splice(i,1),t&&t.splice(i,1)),i--,n--)}(l,g,h),u.push(...l)}return n.minorTicks&&n.minorTicks.show&&f.length>0&&(h.style=n.minorTicks,h.tickSize=n.minorTicks.tickSize,h.padding=function(e){return e.line.strokeWidth+e.minorTicks.margin}(n),u.push(...pj(f,h))),g&&u.push(...g),u}return n.build=i,r.build=i,e?r():n()}const bj={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"},xj={labels:{show:!0,margin:4,maxLengthPx:150,minLengthPx:0,align:.5,offset:0,filterOverlapping:!0,centerEndLabels:!1},ticks:{show:!0,margin:0,tickSize:8},minorTicks:{show:!1,tickSize:3,margin:0},line:{show:!0},paddingStart:0,paddingEnd:10,align:"auto"};const Sj={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 t=e.state,n=e.style,r=e.settings;const i=Gq(!0,{},t.isDiscrete?bj:xj,n),o=Gq(!0,{},i,r.settings),a=r.layout.dock||t.defaultDock;o.dock=a,o.align=function(e,t){const n=["top","bottom"],r=["left","right"];return-1!==n.indexOf(e)&&-1===r.indexOf(t)||-1!==r.indexOf(e)&&-1===n.indexOf(t)?e:t}(r.settings.align,a),o.labels.tiltAngle=Math.max(-90,Math.min(o.labels.tiltAngle,90));const s=o.paddingStart,l=o.paddingEnd;return o.paddingStart="function"==typeof s?s.call(null):s,o.paddingEnd="function"==typeof l?l.call(null):l,o}(this),this.state.concreteNodeBuilder=vj(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 r=t.labels.mode;return n&&e.isHorizontal?"auto"===r?e.labels.activeMode:-1!==["layered","tilted"].indexOf(t.labels.mode)&&-1!==["top","bottom"].indexOf(t.dock)?r:"horizontal":"horizontal"}(this.state,this.state.settings,this.state.isDiscrete)},preferredSize(e){const t=this.formatter,n=this.state,r=this.scale,i=this.state.isHorizontal?e.inner.width:e.inner.height;this.state.pxScale=MR(r,i);const o=function(e){let t=e.isDiscrete,n=e.rect,r=e.formatter,i=e.measureText,o=e.scale,a=e.settings,s=0;const l=nj({isDiscrete:t,rect:n,formatter:r,measureText:i,scale:o,settings:a,state:e.state}),c=l.size,u=l.edgeBleed;if(s+=c,l.isToLarge)return{size:s};if(a.ticks.show&&(s+=a.ticks.margin,s+=a.ticks.tickSize),a.minorTicks&&a.minorTicks.show){const e=a.minorTicks.margin+a.minorTicks.tickSize;e>s&&(s=e)}if(a.line.show){const e=a.line.strokeWidth/2;s+=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 s+=a.paddingStart,s+=a.paddingEnd,{size:s,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(){const e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).settings;this.setState(e)},resize(e){const t=e.inner,n=e.outer,r=Gq({},t,function(e){let t=e.align,n=e.inner;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})),i=n||r;return Gq(this.state.innerRect,r),Gq(this.state.outerRect,i),n},beforeRender(){const e=this.scale,t=this.formatter,n=this.state.isHorizontal?this.state.innerRect.width:this.state.innerRect.height;this.state.pxScale=MR(e,n),this.state.ticks=this.state.pxScale.ticks({distance:n,formatter:t}).filter(e=>e.position>=0&&e.position<=1)},render(){const e=this.state,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})),Oz.multiple(t),t}};const Mj={render:()=>[]};function wj(e,t,n){let r="";if("function"==typeof e)r=e();else if("string"==typeof e)r=e;else if(n){const e=(n.data().fields||[]).map(e=>e.title());r=e.join(t)}return r}function kj(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 Ej={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=wj(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 e=this.title,t=this.definitionSettings,n=this.rect,r=[];return r.push(function(e){let t=e.title,n=e.definitionSettings,r=e.dock,i=e.rect,o=e.measureText,a=e.style;const s={type:"text",text:t,x:0,y:0,dx:0,dy:0,anchor:kj(r,n.anchor),baseline:"alphabetical",stroke:"transparent",strokeWidth:0,fontWeight:"normal"};Gq(s,a.text);const l=o(s);if("top"===r||"bottom"===r){let e=i.width/2;"left"===n.anchor?e=n.paddingLeft||0:"right"===n.anchor&&(e=i.width-(n.paddingRight||0)),s.x=e,s.y="top"===r?i.height-n.paddingStart:n.paddingStart+l.height,s.dy="top"===r?-l.height/6:-l.height/3,s.maxWidth=.8*i.width}else{let e=i.height/2;"top"===n.anchor?e=n.paddingStart:"bottom"===n.anchor&&(e=i.height-n.paddingStart),s.y=e,s.x="left"===r?i.width-n.paddingStart:n.paddingStart,s.dx="left"===r?-l.height/3:l.height/3;const t="left"===r?270:90;s.transform="rotate(".concat(t,", ").concat(s.x+s.dx,", ").concat(s.y+s.dy,")"),s.maxWidth=.8*i.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})),r},beforeUpdate(e){e.settings&&(Gq(this.settings,e.settings),this.definitionSettings=e.settings.settings);const t=this.settings.text,n=this.definitionSettings.join;this.title=wj(t,n,this.scale)}};function Cj(e,t){const n=e.settings.layout.dock,r=e.settings.settings.invert,i="top"===n||"bottom"===n,o=i?"width":"height",a=e.rect[o],s=e.chart.scroll(e.settings.scroll);let l;{let e=t[i?"x":"y"];r&&(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[i?"x":"y"];if(r&&(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[i?"x":"y"];r&&(t=a-t);const n=s.getState();if(l.swipe){const e=(t-l.startOffset)/a*(n.max-n.min),r=l.startScroll+e;s.moveTo(r)}else{const e=t/a*(n.max-n.min)+n.min-n.viewSize/2;s.moveTo(e)}}}}function Nj(e,t){const n=t.element().getBoundingClientRect();return{x:e.center.x-n.left,y:e.center.y-n.top}}const Tj={require:["chart","renderer"],on:{panStart(e){const t=Nj(e,this.renderer),n={x:t.x-e.deltaX,y:t.y-e.deltaY};this.currentMove=Cj(this,n),this.currentMove.update(t)},panMove(e){if(!this.currentMove)return;const t=Nj(e,this.renderer);this.currentMove.update(t)},panEnd(e){if(!this.currentMove)return;const t=Nj(e,this.renderer);this.currentMove.end(t),this.currentMove=null},panCancel(){this.currentMove=null},tap(e){const t=Nj(e,this.renderer);Cj(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,r="top"===t||"bottom"===t,i=r?"width":"height",o=this.rect[i],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",[r?"left":"top"]:"".concat(s,"px"),[r?"top":"left"]:"25%",[r?"height":"width"]:"50%",[i]:"".concat(Math.max(1,l),"px"),background:this.settings.settings.thumbColor}})))},renderer:"dom"};function Dj(e){let t=e.h,n=e.isVertical,r=e.value,i=e.pos,o=e.align,a=e.borderHit,s=e.state,l=e.idx;const c="end"!==o,u=c?{left:"0",top:"0"}:{right:"0",bottom:"0"};let d=0,f="100%",h="100%";return s.targetRect&&"start"===s.settings.bubbles.align?(f="".concat(s.targetRect.x+s.targetRect.width,"px"),h="".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"),h="".concat(s.rect.height-d,"px")),c||(i-=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":r,"data-key":[s.key,"edge",l].join("-"),style:{cursor:n?"ns-resize":"ew-resize",position:"absolute",left:"".concat(n?d:i,"px"),top:"".concat(n?i:d,"px"),height:n?"".concat(a,"px"):h,width:n?f:"".concat(a,"px"),pointerEvents:"auto"}},[t("div",{style:Gq({backgroundColor:s.style.line.stroke,position:"absolute",height:n?"".concat(1,"px"):"100%",width:n?"100%":"".concat(1,"px"),pointerEvents:"none"},u)})])}function qj(e){let t=e.h,n=e.isVertical,r=e.label,i=e.otherValue,o=e.rangeIdx,a=e.idx,s=e.pos,l=e.align,c=e.state,u=e.value;const d="end"!==l,f="outside"===c.settings.bubbles.placement;let h,p="none";n?(h=d?"left":"right",f&&(p=d?"translate(-100%,  0px)":"translate(100%,  0px)")):(h=d?"top":"bottom",f&&(p=d?"translate(0px, -100%)":"translate(0px,  100%)"));let m=c.edit&&c.edit.rangeIdx===o&&c.edit.bubbleIdx===a;const g={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 y=c.style.bubble.stroke;const v=m?t("input",{type:"text",value:u,style:Qq(Qq({},g),{},{textAlign:"start",textOverflow:"",fontSize:"13px"}),onkeyup(e){if("Enter"===e.key){e.preventDefault(),e.stopPropagation();const t=parseFloat(e.target.value);isNaN(t)?(y="rgba(230, 78, 78, 0.6)",e.target.style.border="".concat(c.style.bubble.strokeWidth,"px solid ").concat(y)):c.onEditConfirmed(o,t,i)}else"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),c.onEditCanceled())}}):t("div",{"data-key":[c.key,"bubble",o,a].join("-"),"data-other-value":i,"data-idx":o,"data-bidx":a,style:g},[r]);return t("div",{style:{position:"absolute",[h]:"0",[n?"top":"left"]:"".concat(s,"px"),transform:p}},[v])}function Oj(e){let t=e.h,n=e.isVertical,r=e.top,i=e.height,o=e.color,a=e.on,s=e.opacity;return t("div",Gq({style:{backgroundColor:o,opacity:s,position:"absolute",left:n?0:"".concat(r,"px"),top:n?"".concat(r,"px"):0,height:n?"".concat(i,"px"):"100%",width:n?"100%":"".concat(i,"px"),pointerEvents:"auto"}},a),[])}function Ij(e){let t=e.borderHit,n=e.els,r=e.isVertical,i=e.state,o=e.vStart,a=e.vEnd,s=e.idx,l=0;i.targetRect&&(l=r?i.targetRect.y:i.targetRect.x);const c=!!i.scale,u=c?i.scale.norm(o)*i.size:o,d=c?i.scale.norm(a)*i.size:a,f=Math.abs(u-d),h=Math.min(u,d)+l,p=h+f;if(i.targetRect){const e=i.targetFillRect||i.targetRect,t=r?e.height:e.width,s=c?i.scale.norm(o)*t:o,l=c?i.scale.norm(a)*t:a,u=Math.abs(s-l),d=Math.min(s,l),f={h:i.h,isVertical:r,top:d,height:u,color:i.style.target.fill,opacity:i.style.target.opacity};i.style.target.opacity<.8&&(f.on={onmouseover(e){e.srcElement.style.opacity=i.style.target.opacity+.1},onmouseout(e){e.srcElement.style.opacity=i.style.target.opacity}}),n.push(i.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")}},[Oj(f)]))}const m=u<d?o:a,g=u<d?a:o,y=eO(c?i.scale.domain():[Math.min(o,a),Math.max(o,a)],2),v=y[0],b=y[1],x=m+1e-5>=v&&m-1e-5<=b,S=g-1e-5<=b&&g+1e-5>=v;x&&n.push(Dj({h:i.h,isVertical:r,borderHit:t,value:m,pos:h,align:"start",state:i,idx:s})),S&&n.push(Dj({h:i.h,isVertical:r,borderHit:t,value:g,pos:p,align:"end",state:i,idx:s}));const M=i.settings.bubbles;if(M&&M.show){M.fontSize,M.fontFamily,M.fill;const e=[o,a];x&&n.push(qj({h:i.h,isVertical:r,align:M.align,rangeIdx:s,idx:0,otherValue:g,value:m,label:"".concat(i.format(m,e)),pos:h,state:i})),S&&n.push(qj({h:i.h,isVertical:r,align:M.align,rangeIdx:s,idx:1,otherValue:m,value:g,label:"".concat(i.format(g,e)),pos:p,state:i}))}}function Aj(e){const t=e.active.limitHigh-e.active.end,n=e.active.limitLow-e.active.start;let r=e.current-e.start;return r=r<0?Math.max(r,n):Math.min(r,t),r}function _j(e){let t=[];const n=0===e.direction;if(Array.isArray(e.ranges)&&e.ranges.forEach((r,i)=>{e.active&&i===e.active.idx||Ij({borderHit:5,els:t,isVertical:n,state:e,vStart:Math.min(r.min,r.max),vEnd:Math.max(r.min,r.max),idx:i})}),e.active){let r=e.start,i=e.current;if(-1!==e.active.idx)if("foo"===e.active.mode)r=Math.min(e.active.start,e.active.end),i=Math.max(e.active.start,e.active.end);else if("modify"===e.active.mode)r=Math.min(e.start,e.current),i=Math.max(e.start,e.current);else{const t=Aj(e);r=e.active.start+t,i=e.active.end+t}Ij({borderHit:5,els:t,isVertical:n,state:e,vStart:r,vEnd:i,idx:e.active.idx})}return t}function Lj(e){return{min:e.scale.min(),max:e.scale.max()}}function Pj(e){return{min:0,max:e.direction?e.rect.width:e.rect.height}}function Rj(e,t,n){let r,i,o=e.ranges,a=-1;for(r=0;r<o.length;r++){if(o[r].min<=t&&t<=o[r].max){a=r,n.min=r?o[r-1].max:n.min,n.max=r+1<o.length?o[r+1].min:n.max;break}if(t<o[r].min){n.max=o[r].min,n.min=r?o[r-1].max:n.min;break}}-1===a&&o.length&&r>=o.length&&(n.min=o[o.length-1].max),-1!==a&&(i={idx:a,start:o[a].min,end:o[a].max,limitLow:n.min,limitHigh:n.max,mode:"foo"}),e.active=i}function Fj(e){e.renderer.render(_j(e))}function zj(e,t){if(!t||!t.isActive())return[];const n=e.scale.data(),r=(n&&n.fields||[]).map(e=>e.id()),i=t.brushes().filter(e=>"range"===e.type&&-1!==r.indexOf(e.id))[0];return i?i.brush.ranges():[]}function jj(e,t){let n,r=1/0;const i=t.domain(),o=t.bandwidth()/2;for(let a=0;a<i.length;++a){const s=Math.abs(e-o-t(i[a]));s<r&&(r=s,n=i[a])}return n}function $j(e,t){return Math.min(...e)<=Math.max(...t)&&Math.max(...e)>=Math.min(...t)}function Vj(e){const t=e.reduce((e,t)=>(e.push(...aO(t.bounds)),e),[]);return sO(t)}const Uj={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=zj(this.state,this.state.brushInstance),this.state.active=null,Fj(this.state))},render(e){const t=this.settings.settings;this.state.direction="vertical"===t.direction?0:1;const n=this.renderer.element().getBoundingClientRect(),r=this.state.rect[0===this.state.direction?"height":"width"];let i=MR(this.chart.scale(t.scale),r);const o=function(e){const t={targetRect:null,targetFillRect:null,scale:null,size:null},n=e.settings.settings,r=n.target&&(n.target.components||(n.target.component?[n.target.component]:[])).map(t=>e.chart.component(t)).filter(e=>!!e&&!!e.rect),i=n.target&&n.target.selector?e.chart.findShapes(n.target.selector):[],o=n.target&&n.target.fillSelector?e.chart.findShapes(n.target.fillSelector):[];if(i.length>0){const r=Vj(i);if(t.size=r[0===e.state.direction?"height":"width"],t.scale=MR(e.chart.scale(n.scale),t.size),t.targetRect=r,o.length>0){const e=Vj(o);t.targetFillRect=e}}else if(r&&r.length>0){const n=r.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:r[0].rect.computedInner.x,y0:r[0].rect.computedInner.y,x1:r[0].rect.computedInner.x+r[0].rect.computedInner.width,y1:r[0].rect.computedInner.y+r[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(i=o.scale?o.scale:i,this.state.targetRect=o.targetRect,this.state.targetFillRect=o.targetFillRect,this.state.size=null===o.size?r: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,r){let i=e.ranges.map(e=>({min:e.min,max:e.max}));const o=e.scale.min(),a=e.scale.max();i[t]={min:Math.max(o,Math.min(n,r)),max:Math.min(a,Math.max(n,r))},e.ranges[t]=Qq({},i[t]);const s=e.scale.data();s&&s.fields&&s.fields.forEach(t=>{e.fauxBrushInstance||e.brushInstance.setRange(t.id(),i)})}(this.state,e,t,n),this.emit("bubbleEnd"),Fj(this.state)},this.state.onEditCanceled=()=>{this.state.edit=null,Fj(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:i,resources:{scale:this.chart.scale,formatter:this.chart.formatter}})),{}.hasOwnProperty.call(i,"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=i;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=EP(),this.state.scale.data=i.data,this.state.format||(this.state.format=(e,t)=>$j(i.range(),t)?function(e,t){const n=t.ticks(),r=t.domain().indexOf(jj(e,t));return-1!==r?n[r].label:"-"}(e,i):"-"),this.state.fauxBrushInstance=cR(),this.state.findValues=e=>function(e,t){const n=t.domain(),r=t.range(),i=[];return e.forEach(e=>{if(!$j(r,[e.min,e.max]))return;const o=n.indexOf(jj(e.min,t)),a=n.indexOf(jj(e.max,t));i.push.apply(i,n.slice(Math.min(o,a),Math.max(o,a)+1))}),i}(e,i);return this.state.ranges=zj(this.state,this.state.brushInstance),this.state.observeBrush||this.state.sourcedFromThisComponent?[_j(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 t=e.state,n=e.e,r=e.renderer,i=e.ranges,o=e.targetSize;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);r.element().contains(l)||(l=null);const c={started:!0};t.offset=Gq({},r.element().getBoundingClientRect());const u=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=i(t,t.fauxBrushInstance||t.brushInstance);const f=n.center[t.cssCoord.coord]-n[t.cssCoord.pos]-t.offset[t.cssCoord.offset],h=n.center[t.cssCoord.coord]-t.offset[t.cssCoord.offset];c.current=t.scale.normInvert(h/t.size),c.start=t.scale.normInvert(f/t.size);let p=t.ranges;const m=Lj(t);let g,y,v=-1;if(l&&l.hasAttribute("data-idx"))v=parseInt(l.getAttribute("data-idx"),10),m.min=v>0?p[v-1].max:m.min,m.max=v+1<p.length?p[v+1].min:m.max;else{for(g=0;g<p.length;g++){if(p[g].min<=c.start&&c.start<=p[g].max){v=g,m.min=g?p[g-1].max:m.min,m.max=g+1<p.length?p[g+1].min:m.max;break}if(c.start<p[g].min){m.max=p[g].min,m.min=g?p[g-1].max:m.min;break}}-1===v&&p.length&&g>=p.length&&(m.min=p[p.length-1].max)}if(-1!==v||t.multi||(c.ranges=[],m.min=t.scale.min(),m.max=t.scale.max()),-1!==v)if(y={idx:v,start:p[v].min,end:p[v].max,limitLow:m.min,limitHigh:m.max,mode:"move"},l&&l.hasAttribute("data-other-value"))c.start=parseFloat(l.getAttribute("data-other-value")),y.mode="modify";else{let e=t.scale.norm(y.start)*t.size,n=t.scale.norm(y.end)*t.size;Math.abs(f-e)<=o?(c.start=y.end,y.mode="modify"):Math.abs(f-n)<=o&&(c.start=y.start,y.mode="modify")}else y={idx:-1,start:c.start,end:c.current,limitLow:m.min,limitHigh:m.max,mode:"current"};c.active=y,"modify"!==y.mode&&t.targetRect&&!vF(t.targetRect,{x:u,y:d})||Object.keys(c).forEach(e=>t[e]=c[e])}({e:e,state:this.state,renderer:this.renderer,ranges:zj,targetSize:5})},end(){this.state.started&&(!function(e,t){e.started=!1,e.ranges=t(e,e.fauxBrushInstance||e.brushInstance);const n=Lj(e);Rj(e,e.current,n)}(this.state,zj),Fj(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,r=e.scale.normInvert(n);e.current=Math.max(Math.min(r,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=Aj(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 r=zj(e,e.fauxBrushInstance),i=e.findValues(r),o=e.findValues(t),a=o.filter(e=>-1===i.indexOf(e)),s=i.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),Fj(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,r={rangeIdx:parseInt(n.getAttribute("data-idx"),10),bubbleIdx:parseInt(n.getAttribute("data-bidx"),10)};if(isNaN(r.rangeIdx)||JSON.stringify(r)===JSON.stringify(this.state.edit))return;this.state.edit=r,t.stopPropagation(),t.stopImmediatePropagation(),t.preventDefault();const i=n.parentNode;Fj(this.state);const o=i.querySelector("input");o.focus(),o.select()}};function Hj(e){e.renderer.render(_j(e))}function Bj(e){return e.rc.ranges()}function Wj(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 Yj={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,r=this.state.rect[0===n?"height":"width"],i=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=i,this.state.rc=JP(),this.state.renderer=this.renderer,this.state.multi=!!t.multiple,this.state.h=e,this.state.size=r,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 r=Math.min(...n),i=Math.max(...n),o={x:e.direction?r+e.rect.x:e.rect.x,y:e.direction?e.rect.y:r+e.rect.y,width:e.direction?i-r:e.rect.width+e.rect.x,height:e.direction?e.rect.height+e.rect.y:i-r},a=e.chart.shapesAt(o,e.settings.brush);if(0===a.length)return"-";const s=a.reduce((n,i)=>{const o=n.bounds,a=i.bounds;return t===r?o[e.cssCoord.coord]<=a[e.cssCoord.coord]?n:i:o[e.cssCoord.coord]+o[e.cssCoord.area]>=a[e.cssCoord.coord]+a[e.cssCoord.area]?n:i}),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 t=e.state,n=e.e,r=e.renderer,i=e.ranges,o=e.targetSize;if(t.started)return;const a=n.center.x-n.deltaX,s=n.center.y-n.deltaY;let l=document.elementFromPoint(a,s);r.element().contains(l)||(l=null);const c={started:!0};t.offset=r.element().getBoundingClientRect(),t.ranges=i(t);const u=a-t.offset.left,d=s-t.offset.top,f=n.center[t.cssCoord.coord]-n[t.cssCoord.pos]-t.offset[t.cssCoord.offset],h=n.center[t.cssCoord.coord]-t.offset[t.cssCoord.offset];let p=h,m=f;c.start=f,c.current=h;let g=t.ranges;const y=Pj(t);let v,b,x=-1;if(l&&l.hasAttribute("data-idx"))x=parseInt(l.getAttribute("data-idx"),10),y.min=x>0?g[x-1].max:y.min,y.max=x+1<g.length?g[x+1].min:y.max;else{for(v=0;v<g.length;v++){if(g[v].min<=m&&m<=g[v].max){x=v,y.min=v?g[v-1].max:y.min,y.max=v+1<g.length?g[v+1].min:y.max;break}if(m<g[v].min){y.max=g[v].min,y.min=v?g[v-1].max:y.min;break}}-1===x&&g.length&&v>=g.length&&(y.min=g[g.length-1].max)}if(-1!==x||t.multi||(c.ranges=[],y.min=0,y.max=t.direction?t.rect.width:t.rect.height),-1!==x)if(b={idx:x,start:g[x].min,end:g[x].max,limitLow:y.min,limitHigh:y.max,mode:"move"},l&&l.hasAttribute("data-other-value"))c.start=parseFloat(l.getAttribute("data-other-value")),b.mode="modify";else{let e=b.start,t=b.end;Math.abs(f-e)<=o?(c.start=b.end,b.mode="modify"):Math.abs(f-t)<=o&&(c.start=b.start,b.mode="modify")}else b={idx:-1,start:m,end:p,limitLow:y.min,limitHigh:y.max,mode:"current"};c.active=b,"modify"!==b.mode&&t.targetRect&&!vF(t.targetRect,{x:u,y:d})||Object.keys(c).forEach(e=>t[e]=c[e])}({e:e,state:this.state,renderer:this.renderer,ranges:Bj,targetSize:5})},end(){this.state.started&&(!function(e,t){e.started=!1,e.ranges=t(e);const n=Pj(e);Rj(e,e.current,n)}(this.state,Bj),Hj(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=Aj(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,...Wj(e,t)]}),function(e,t){e.chart.brushFromShapes(t,e.settings.brush)}(e,n)}(this.state),Hj(this.state))},clear(){this.state.rc&&this.state.rc.clear(),this.state.renderer.render([])}};function Gj(e){const t="vertical"===e.direction,n=e.rect[t?"height":"width"],r=e.rect[t?"width":"height"];return function(e){const t=e.brush;if(!t||!t.isActive())return[];const n=e.scale.data(),r=(n&&n.fields||[]).map(e=>e.id()),i=t.brushes().filter(e=>"range"===e.type&&-1!==r.indexOf(e.id))[0];return i?i.brush.ranges():[]}(e).map(i=>{const o=e.scale(i.min)*n,a=e.scale(i.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?r:l,y:t?s:0,height:t?l:r}})}function Kj(e,t,n,r){function i(){!function(e){e.renderer.render(Gj(e))}(e)}function o(){!function(e){e.renderer.render(Gj(e))}(e)}function a(){!function(e){e.renderer.render(Gj(e))}(e)}e.brush=t,t&&(t.on("start",i),t.on("update",o),t.on("end",a),e.start=i,e.update=o,e.end=a,e.brush=t,e.scale=n,e.renderer=r)}function Xj(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 Jj={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",r="horizontal"===n?this.rect.width:this.rect.height,i=MR(this.chart.scale(e.scale),r);return Xj(this.state),Kj(this.state,t,i,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,Gj(this.state)},beforeDestroy(){Xj(this.state)}};function Zj(e,t){const n=t.center.x,r=t.center.y;return{x:n-e.left,y:r-e.top}}function Qj(e,t,n){return jR(e,t.points[0])<n.settings.snapIndicator.threshold**2}function e$(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 t$(e){let t=e.state,n=e.start,r=void 0===n?null:n,i=e.end,o=void 0===i?null:i;null!==r&&(t.snapIndicator.x1=r.x,t.snapIndicator.y1=r.y),null!==o&&(t.snapIndicator.x2=o.x,t.snapIndicator.y2=o.y)}function n$(e,t){e.snapIndicator.visible=t}const r$={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=Zj(this.state.rendererBounds,e);e$(this.state,n),t$({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=Zj(this.state.rendererBounds,e);Qj(t,this.state,this.settings)?n$(this.state,!0):n$(this.state,!1),e$(this.state,t),t$({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],r=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=r.x+e.componentDelta.x,e.lineBrushShape.y2=r.y+e.componentDelta.y;const i=t.shapesAt(e.lineBrushShape,{components:e.brushConfig});t.brushFromShapes(i,{components:e.brushConfig})}}(this.state,this.chart)},end(e){if(!this.state.active)return;n$(this.state,!1);Qj(Zj(this.state.rendererBounds,e),this.state,this.settings)&&function(e,t){if(e.active){const n=e.componentDelta.x,r=e.componentDelta.y,i=e.points.map(e=>({x:e.x+n,y:e.y+r})),o=t.shapesAt({vertices:i},{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(){this.state.active&&(!function(e,t){e.brushConfig.forEach(e=>{e.contexts.forEach(e=>{t.brush(e).end()})})}(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([]))},render(){}};function i$(e,t,n,r,i){let o,a=0,s=t.length-1;for(;a<s;){let l=Math.floor((a+s)/2);o=i(t[l]),o[n]+o[r]<e[n]?a=l+1:s=l}return a}function o$(e){let t=e.orientation,n=e.targetNodes,r=e.labels,i=e.container,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i$;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 d=r[t],f=d.textBounds,h=d.node;if(f[s]<i[s]||f[s]+f[l]>i[s]+i[l])return!1;for(let e=o(f,a,s,l,c);e<a.length;e++)if(gF(f,a[e].textBounds))return!1;const p=o(f,n,s,l,u),m=f[s]+f[l];for(let e=p;e<n.length;e++){const t=n[e].node;if(m<t.localBounds[s])break;if(gF(f,t.localBounds)&&h!==t)return!1}return a.push(r[t]),!0}}function a$(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function s$(e){const t=typeof e;return("string"===t||"number"===t)&&""!==e}function l$(e){return Qq(Qq({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 u$(e,t,n){return n?e.height>=t.width:e.height>=t.height}function d$(e,t,n,r,i){let o,a;return"v"===e?(o=r||i||c$(t,n,!0),a=u$(t,n,!r)):(o=c$(t,n),a=i||u$(t,n,!1)),o&&a}function f$(e,t,n,r){return e+.5*t+(r-.5)*(t-n)-.5*n}function h$(e,t,n){const r={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},i=n.textMetrics;if(!n.overflow&&!function(e,t,n){return c$(e,t,n.rotate)&&u$(e,t,n.rotate)}(e,i,n))return!1;const o=.5*i.height;return n.rotate?(r.x=f$(e.x,e.width,i.height,n.align)+o,r.y=f$(e.y,e.height,i.width,n.justify),"right"===n.dock?r.transform="rotate(90, ".concat(r.x+r.dx,", ").concat(r.y+r.dy,") translate(").concat(i.width,", 0)"):r.transform="rotate(-90, ".concat(r.x+r.dx,", ").concat(r.y+r.dy,")")):(r.x=f$(e.x,e.width,i.width,n.align),r.y=f$(e.y,e.height,i.height,n.justify)+o),r}function p$(e){let t=e.bar,n=e.view,r=e.direction,i=e.position,o=e.padding,a=void 0===o?4:o,s=e.measured;const l={};if(Gq(l,t),i&&"inside"!==i)if("up"===r||"down"===r){const e=Math.max(0,Math.min(t.y,n.height)),o=Math.max(0,Math.min(t.y+t.height,n.height));"outside"===i&&"up"===r||"opposite"===i&&"down"===r?(l.y=0,l.height=e):("outside"===i&&"down"===r||"opposite"===i&&"up"===r)&&(l.y=o,l.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"===i&&"left"===r||"opposite"===i&&"right"===r?(l.x=0,l.width=e):("outside"===i&&"right"===r||"opposite"===i&&"left"===r)&&(l.x=o,l.width=n.width-o)}else;return function(e,t){const n=Math.max(0,Math.min(e.y,t.height)),r=Math.max(0,Math.min(e.y+e.height,t.height)),i=Math.max(0,Math.min(e.x,t.width)),o=Math.max(0,Math.min(e.x+e.width,t.width));e.x=i,e.width=o-i,e.y=n,e.height=r-n}(l,n),function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=n.top,i=void 0===r?4:r,o=n.bottom,a=void 0===o?4:o,s=n.left,l=void 0===s?4:s,c=n.right,u=void 0===c?4:c,d="function"==typeof l?l(t):l,f="function"==typeof u?u(t):u,h="function"==typeof i?i(t):i,p="function"==typeof a?a(t):a;e.x+=d,e.width-=d+f,e.y+=h,e.height-=h+p}(l,s,a),l}function m$(e){let t,n,r,i,o,a=e.direction,s=e.fitsHorizontally,l=e.measured,c=e.node,u=e.orientation,d=e.placementSettings,f=e.rect,h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p$;const p=[],m="h"===u?"width":"height";for(o=0;o<d.length;o++)if(r=d[o],i=h({bar:c.localBounds,view:f,direction:a,position:r.position,padding:r.padding,measured:l}),p.push(i),t=!o||i[m]>t[m]?i:t,d$(u,i,l,s,r.overflow)){n=i;break}return n||(n=t,o=p.indexOf(n)),r=d[o],{bounds:n,placement:r}}function g$(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};const o=i.top,a=void 0===o?4:o,s=i.bottom,l=void 0===s?4:s,c=i.left,u=void 0===c?4:c,d=i.right,f=void 0===d?4:d,h="function"==typeof u?u(t):u,p="function"==typeof f?f(t):f,m="function"==typeof a?a(t):a,g="function"==typeof l?l(t):l,y=e.x+e.dx,v=e.y+e.dy,b=n?Math.min(t.width,r.height):Math.min(t.height,r.width),x=n?Math.min(t.height,r.height):Math.min(t.width,r.width),S=.5*t.height,M=1e-9;return{x:(n?y-S:y)-h-M,y:(n?v:v-S)-m-M,width:x+(h+p)-M,height:b+(m+g)-M}}function y$(e){let t=e.chart,n=e.targetNodes,r=e.rect,i=e.fitsHorizontally,o=e.collectiveOrientation,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:m$,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:h$,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:o$;const c=[],u={container:r,targetNodes:n,labels:[],orientation:o};let d,f,h,p,m,g,y,v,b,x,S,M,w,k;for(let e=0,l=n.length;e<l;e++){g=null,f=n[e],h=f.node,w=a$(h,t),b=f.direction,k="left"===b||"right"===b?"h":"v";for(let t=0;t<f.texts.length;t++){if(p=f.texts[t],!s$(p))continue;x=f.labelSettings[t],v=f.measurements[t],M=x.placements;const n=a({direction:b,fitsHorizontally:i,lblStngs:x,measured:v,node:h,orientation:k,placements:M,placementSettings:f.placementSettings[t],rect:r});if(g=n.bounds,S=n.placement,g&&S){var E;m=S.justify;const t="function"==typeof x.linkData?x.linkData(w,e):void 0,n="function"==typeof S.overflow?S.overflow(w,e):S.overflow;"up"===b&&(m=1-m),"opposite"===S.position&&(m=1-m),"left"===b&&(m=1-m);const r=!("h"===o||i);if(d=s(g,p,{justify:"h"===k?S.align:m,align:"h"===k?m:S.align,fontSize:x.fontSize,fontFamily:x.fontFamily,textMetrics:v,rotate:r,overflow:!!n,dock:null!==(E=x.dock)&&void 0!==E?E:"left"}),d){const n=g$(d,v,r,g,S.padding);y="function"==typeof S.fill?S.fill(Qq(Qq({},w),{},{textBounds:n}),e):S.fill,d.fill=y,void 0!==t&&(d.data=t),"object"==typeof S.background&&(d.backgroundColor="function"==typeof S.background.fill?S.background.fill(Qq(Qq({},w),{},{textBounds:n}),e):S.background.fill,void 0!==d.backgroundColor&&(d.backgroundBounds=g$(d,v,r,g,S.background.padding))),c.push(d),u.labels.push({node:h,textBounds:n})}}}}const C=c.filter(l(u));return[...C.filter(e=>void 0!==e.backgroundBounds).map(l$),...C]}function v$(e){const t=2*Math.PI;return(e%t+t)%t}function b$(e,t){e.x+=t,e.width-=2*t,e.y+=t,e.height-=2*t}function x$(e){return{x:e.x,y:e.y-e.height/2,width:e.width,height:e.height}}function S$(e,t,n){let r=t.x,i=t.y;if(r*r+i*i>e*e)return null;let o=Math.sin(n),a=Math.cos(n),s=r*a-i*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 M$(e){let t,n,r=e.radius,i=e.size,o=e.angle,a=i.width,s=i.height,l={x:a/2,y:s/2};switch(Math.floor(o/(Math.PI/2))){case 0:if(t=S$(r,l,o),!t)return null;t.y*=-1,n={x:-a,y:0};break;case 1:if(t=S$(r,l,Math.PI-o),!t)return null;n={x:-a,y:-s};break;case 2:if(t=S$(r,l,o-Math.PI),!t)return null;t.x*=-1,n={x:0,y:-s};break;case 3:if(t=S$(r,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 w$(e){let t=e.slice,n=e.measured,r=e.padding,i=t.start,o=t.end,a=t.innerRadius,s=t.outerRadius,l=s-a-2*r,c=o-i;if(c<Math.PI){let e=(n.height/2+r)/Math.tan(c/2);e>a&&(l=s-e-2*r)}if(l<0||l<n.minReqWidth)return null;const u=v$((i+o)/2);let d=s-r,f={x:Math.sin(u)*d,y:-Math.cos(u)*d,width:l,height:n.height};return u<Math.PI?(f.angle=u-Math.PI/2,f.anchor="end"):(f.angle=u+Math.PI/2,f.anchor="start"),f}function k$(e){let t=e.context,n=e.node,r=e.bounds;let i=n.desc.slice;const o=v$((i.start+i.end)/2);switch(Math.floor(o/(Math.PI/2))){case 0:t.q1maxY=r.y-2,void 0===t.q2minY&&(t.q2minY=r.y+r.height+2);break;case 1:t.q2minY=r.y+r.height+2;break;case 2:t.q3minY=r.y+r.height+2;break;case 3:t.q4maxY=r.y-2,void 0===t.q3minY&&(t.q3minY=r.y+r.height+2)}}function E$(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function C$(e,t,n){const r={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));r.transform="rotate(".concat(t,", ").concat(r.x,", ").concat(r.y,")")}return r}function N$(e){let t,n,r=e.slice,i=e.direction,o=e.position,a=e.padding,s=e.measured,l=e.view,c=e.context,u=e.store,d=r.start,f=r.end,h=r.innerRadius,p=r.offset;switch(o){case"into":t="rotate"===i?w$({slice:r,measured:s,padding:a}):function(e){let t=e.slice,n=e.padding,r=e.measured,i=t.start,o=t.end,a=t.innerRadius,s=t.outerRadius;const l=v$((i+o)/2);let c=M$({radius:s,size:{width:r.width+2*n+1,height:r.height+2*n},angle:l});return c?(c.baseline="top",bF(c,{x1:0,y1:0,x2:Math.sin(i)*s,y2:-Math.cos(i)*s})||bF(c,{x1:0,y1:0,x2:Math.sin(o)*s,y2:-Math.cos(o)*s})||uF({cx:0,cy:0,r:a},c)?null:(b$(c,n),c)):null}({slice:r,measured:s,padding:a});break;case"inside":n={start:d,end:f,innerRadius:0,outerRadius:h},t="rotate"===i?w$({slice:n,measured:s,padding:a}):function(e){let t=e.slice,n=e.padding,r=e.measured,i=e.store;const o=t.start,a=t.end,s=t.outerRadius,l=v$((o+a)/2);let c=M$({radius:s,size:{width:r.width+2*n+1,height:r.height+2*n},angle:l});return c?(c.baseline="top",b$(c,n),i.insideLabelBounds.some(e=>gF(e,c))?null:(i.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"===i?function(e){let t=e.slice,n=e.measured,r=e.padding,i=e.view,o=t.start,a=t.end,s=t.outerRadius,l=t.offset,c=s+r,u=a-o;if(u<Math.PI&&(n.height/2+r)/Math.tan(u/2)>c)return null;const d=v$((o+a)/2);let f=Math.sin(d)*c,h=-Math.cos(d)*c,p=n.width+1,m=d%Math.PI;if(m>Math.PI/2&&(m=Math.PI-m),Math.cos(m)>.001){let e=h<0?i.y:i.y+i.height,t=Math.abs(e-l.y)/Math.cos(m)-Math.tan(m)*(n.height/2)-2*r-s;t<p&&(p=t)}if(Math.sin(m)>.001){let e=f<0?i.x:i.x+i.width,t=Math.abs(e-l.x)/Math.sin(m)-n.height/2/Math.tan(m)-2*r-s;t<p&&(p=t)}if(p<=0||p<n.minReqWidth)return null;let g={x:f,y:h,width:p,height:n.height};return d<Math.PI?(g.angle=d-Math.PI/2,g.anchor="start"):(g.angle=d+Math.PI/2,g.anchor="end"),g}({slice:r,measured:s,padding:a,view:l}):function(e){let t=e.slice,n=e.measured,r=e.padding,i=e.view,o=e.context,a=t.start,s=t.end,l=t.outerRadius,c=t.offset;const u=v$((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)),i))return null;let d=l+r+n.height/2,f=Math.sin(u)*d,h=-Math.cos(u)*d,p=n.width+1;if(u<Math.PI){let e=Math.abs(i.x+i.width-(f+c.x));e<p&&(p=e)}else{let e=Math.abs(i.x-(f+c.x));e<p&&(p=e)}if(p<n.minReqWidth)return null;let m={x:f,y:h,width:p,height:n.height};return u<Math.PI?m.anchor="start":m.anchor="end",m}({slice:r,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"!==i&&function(e,t,n){const r=n.start,i=n.end,o=n.offset,a=n.outerRadius,s=v$((r+i)/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),r=e.y-n;if(e.y=n,r>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),r=n-e.y;if(e.y=n,r>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),r=n-e.y;if(e.y=n,r>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),r=e.y-n;if(e.y=n,r>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,r)),t}function T$(e){let t=e.context,n=e.direction,r=e.measured,i=e.node,o=e.placementSettings,a=e.rect,s=e.store,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:N$;for(let e=0;e<o.length;e++){let c=o[e],u=l({context:t,slice:i.desc.slice,view:a,direction:n,position:c.position,measured:r,padding:c.padding,store:s});if(u)return{bounds:u,placement:c}}return{bounds:null,placement:null}}function D$(e,t,n){const r=t.fontFamily,i="".concat(t.fontSize,"px"),o=n.measureText({text:e,fontFamily:r,fontSize:i});return o.minReqWidth=Math.min(o.width,n.measureText({text:"".concat(e[0],"…"),fontFamily:r,fontSize:i}).width),o}const q$=/\n+|\r+|\r\n/,O$=/\s/,I$=/[a-zA-Z\u00C0-\u00F6\u00F8-\u00FF\u00AD]/;function A$(e){return"string"==typeof e?-1!==e.search(q$):-1!==String(e).search(q$)}function _$(e){return-1!==e.search(O$)}function L$(e){return-1!==e.search(I$)}function P$(e,t,n){return Math.max(t,Math.min(n,e))}function R$(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.string,n=e.separator,r=void 0===n?"":n,i=e.reverse,o=void 0!==i&&i,a=e.measureText,s=void 0===a?e=>({width:e.length,height:1}):a,l=e.mandatoryBreakIdentifiers,c=void 0===l?[A$]:l,u=e.noBreakAllowedIdentifiers,d=void 0===u?[]:u,f=e.suppressIdentifier,h=void 0===f?[_$,A$,e=>""===e]:f,p=e.hyphenationIdentifiers,m=void 0===p?[L$]:p;const g=String(t).split(r);!function(e){""===e[0]&&e.shift(),""===e[e.length-1]&&e.pop()}(g);const y=g.length,v=o?e=>e>=0:e=>e<y;let b=o?y:-1;function x(e){const t=P$(e,0,y-1),n=g[t],r=s(n),i=function(e,t,n,r,i){return r.some(r=>r(e,t,n))?1:i.some(r=>r(e,t,n))?0:2}(n,t,g,c,d);return{index:t,value:n,breakOpportunity:i,suppress:h.some(e=>e(n,t,g)),hyphenation:m.some(e=>e(n,t,g)),width:r.width,height:r.height,done:!1}}return{next:function(e){return isNaN(e)?o?b--:b++:b=P$(e,0,y-1),v(b)?x(b):{done:!0}},peek:x,length:y}}const F$="…",z$=/^\s*\d+(\.\d+)?px\s*$/i;function j$(e){return"string"===typeof e&&z$.test(e)}function $$(e){const t=e["font-size"]||e.fontSize;return j$(t)?parseFloat(t)*Math.max(isNaN(e.lineHeight)?1.2:e.lineHeight,0):19.2}function V$(e){const t=e.maxHeight,n=Math.max(e.maxLines,1)||1/0;if(isNaN(t))return n;const r=$$(e);return Math.max(1,Math.min(Math.floor(t/r),n))}function U$(e,t){return{lines:[],line:"",width:0,maxLines:V$(e),maxWidth:e.maxWidth,hyphens:{enabled:"auto"===e.hyphens,char:"‐",metrics:t("‐")}}}function H$(e){e.lines.push(e.line),e.line="",e.width=0}function B$(e,t){e.line+=t.value,e.width+=t.width}function W$(e,t,n){if(t.width>e.maxWidth)return t;const r=t.index;for(let i=1;i<5;i++){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(r-i),e.line=e.line.slice(0,-1),e.width-=t.width}return t}function Y$(e,t,n){const r=R$({string:t.value,measureText:n});for(;e.lines.length<e.maxLines;){let t=r.next();if(t.done)break;e.width+t.width>e.maxWidth&&2===t.breakOpportunity&&e.line.length>0?(t=e.hyphens.enabled?W$(e,t,r):t,H$(e),B$(e,t)):B$(e,t)}}function G$(e,t){const n=R$({string:e.text,separator:"",measureText:t,noBreakAllowedIdentifiers:[(e,t)=>0===t]}),r=U$(e,t);let i=!0;for(;r.lines.length<r.maxLines;){let e=n.next();if(e.done){H$(r),i=!1;break}1===e.breakOpportunity?H$(r):r.width+e.width>r.maxWidth&&2===e.breakOpportunity?e.suppress?r.width+=e.width:(e=r.hyphens.enabled?W$(r,e,n):e,H$(r),B$(r,e)):B$(r,e)}return{lines:r.lines,reduced:i}}function K$(e,t){const n=R$({string:e.text,separator:/(\s|-|\u2010)/,measureText:t}),r=U$(e,t);let i=!0;for(;r.lines.length<r.maxLines;){let e=n.next();if(e.done){H$(r),i=!1;break}1===e.breakOpportunity?H$(r):r.width+e.width>r.maxWidth&&2===e.breakOpportunity?e.suppress?H$(r):e.width>r.maxWidth?Y$(r,e,t):(H$(r),B$(r,e)):B$(r,e)}return{lines:r.lines,reduced:i}}function X$(e){return{"break-all":G$,"break-word":K$}[e.wordBreak]}function J$(e){return t=>{const n=t.node;if(function(e){return"text"===e.type&&!e._lineBreak}(n)){const r=X$(n);if(!r)return;const i=e(n);if(i.width>n.maxWidth||A$(n.text)){const o=($$(n)-i.height)/2,a=r(n,function(e,t){return n=>t({text:n,fontSize:e.fontSize,fontFamily:e.fontFamily})}(n,e));t.node=function(e,t,n,r){const i={type:"container",children:[]};void 0!==t.id&&(i.id=t.id);let o=0;return e.lines.forEach((a,s)=>{const l=Gq({},t);l.text=a,l._lineBreak=!0,o+=n,e.reduced&&s===e.lines.length-1?l.text+=F$:delete l.maxWidth,l.dy=isNaN(l.dy)?o:l.dy+o,o+=r,o+=n,i.children.push(l)}),i}(a,n,o,i.height)}}}}function Z$(e,t){const n=e["font-family"]||e.fontFamily,r=e["font-size"]||e.fontSize,i="string"==typeof e.text?e.text:"".concat(e.text),o=e.maxWidth;if(void 0===o)return i;let a=t({text:i,fontSize:r,fontFamily:n}).width;if(a<=o)return i;let s=0,l=i.length-1;for(;s<=l;){let e=Math.floor((s+l)/2);a=t({text:i.substr(0,e)+F$,fontSize:r,fontFamily:n}).width,a<=o?s=e+1:l=e-1}return i.substr(0,l)+F$}function Q$(e){const t=e.baseline||e["dominant-baseline"];let n=0;const r=parseInt(e.fontSize||e["font-size"],10)||0;switch(t){case"hanging":n=.75*r;break;case"text-before-edge":n=.85*r;break;case"middle":n=.25*r;break;case"central":n=.35*r;break;case"mathemetical":n=r/2;break;case"text-after-edge":case"ideographic":n=.2*-r;break;default:n=0}return n}const eV={},tV={},nV={fontSize:void 0,fontFamily:void 0};let rV;function iV(e,t){return!e&&!t||e===t}function oV(e){let t=e.text,n=e.fontWeight,r=e.fontSize,i=e.fontFamily;const o="".concat(t," ").concat(n," ").concat(r," ").concat(i);return"number"!=typeof tV[o]&&(rV=rV||document.createElement("canvas").getContext("2d"),function(e){let t=e.fontWeight,n=e.fontSize,r=e.fontFamily;iV(nV.fontWeight,t)&&iV(nV.fontSize,n)&&iV(nV.fontFamily,r)||(rV.font=[t,n,r].filter(e=>!!e).join(" "),nV.fontWeight=t,nV.fontSize=n,nV.fontFamily=r)}({fontWeight:n,fontSize:r,fontFamily:i}),tV[o]=rV.measureText(t).width),tV[o]}function aV(e){return"number"!=typeof eV[e]&&(eV[e]=function(e){if(j$(e)){const t=parseFloat(e);return t+4*Math.ceil((t+1e-12)/24)}return 16}(e)),eV[e]}function sV(e){let t=e.text,n=e.fontWeight,r=e.fontSize;return{width:oV({text:t,fontWeight:n,fontSize:r,fontFamily:e.fontFamily}),height:aV(r)}}function lV(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:sV;const n=e["font-size"]||e.fontSize,r=e["font-family"]||e.fontFamily,i=t({text:e.text,fontFamily:r,fontSize:n}),o=Math.min(e.maxWidth||i.width,i.width),a=e.x||0,s=e.y||0,l=e.dx||0,c={x:0,y:s+((e.dy||0)+Q$(e))-.75*i.height,width:o,height:i.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 cV(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:sV;const n=X$(e),r=e["font-size"]||e.fontSize,i=e["font-family"]||e.fontFamily,o=t({text:e.text,fontFamily:i,fontSize:r});if(n&&(o.width>e.maxWidth||A$(e.text))){const o=n(e,e=>t({text:e,fontFamily:i,fontSize:r})),a=Gq({},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?F$:"";const c=t({text:a,fontSize:r,fontFamily:i}).width;c>=s&&(s=c,l=a)}a.text=l;const c=lV(a,t);return c.height=$$(e)*o.lines.length,c}return lV(e,t)}function uV(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function dV(e,t,n){const r={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},i=n.textMetrics;if(e.width<n.fontSize)return!1;const o=Math.max(0,e.width-i.width);return r.x=e.x+n.align*o,r.y=e.y+i.height/1.2,r}function fV(e){return{type:"circle",bounds:{cx:e.cx,cy:e.cy,r:e.r}}}function hV(e){return e.desc&&e.desc.slice?function(e){let t=e.start,n=e.end,r=e.innerRadius,i=e.outerRadius,o=e.offset;if(Math.abs(t+2*Math.PI-n)>1e-12)return{type:null,bounds:null};let a=0!==r?r:i;return fV({cx:o.x,cy:o.y,r:a})}(e.desc.slice):"circle"===e.type?fV(e.attrs):"rect"===e.type?{type:"rect",bounds:e.bounds}:{type:null,bounds:null}}var pV={bar:function(e){let t=e.settings,n=e.chart,r=e.nodes,i=e.rect,o=e.renderer,a=e.style,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:y$;const l=Gq({fontSize:12,fontFamily:"Arial",align:.5,justify:0,fill:"#333"},a.label);l.fontSize=parseInt(l.fontSize,10);const c=t.labels.map(e=>Gq({},l,t,e)),u=t.labels.map(e=>e.placements.map(n=>Gq({},l,t,e,n))),d=function(e){let t=e.nodes,n=e.rect,r=e.chart,i=e.labelSettings,o=e.placementSettings,a=e.settings,s=e.renderer;const l={},c=[];let u,d,f,h,p,m,g,y=!0,v=!1;for(let e=0;e<t.length;e++){if(d=t[e],h=d.localBounds,!gF(h,n))continue;let b=a$(d,r);u={node:d,texts:[],measurements:[],labelSettings:[],placementSettings:[]};for(let t=0;t<i.length;t++)m=i[t],f="function"==typeof m.label?m.label(b,e):void 0,s$(f)&&(g="function"==typeof a.direction?a.direction(b,e):a.direction||"up",v=v||"left"===g||"right"===g,l.fontFamily=m.fontFamily,l.fontSize="".concat(m.fontSize,"px"),l.text=f,p=s.measureText(l),u.measurements.push(p),u.texts.push(f),u.labelSettings.push(m),u.placementSettings.push(o[t]),u.direction=g,y=y&&p.width<=h.width-8);c.push(u)}return{targetNodes:c,fitsHorizontally:y,hasHorizontalDirection:v}}({nodes:r,chart:n,renderer:o,settings:t,rect:i,labelSettings:c,placementSettings:u}),f=d.fitsHorizontally,h=d.hasHorizontalDirection,p=d.targetNodes,m=function(e){let t=e.orientation,n=void 0===t?"auto":t,r=e.defaultOrientation,i=void 0===r?"h":r;switch(n.toLocaleLowerCase()){case"vertical":return"v";case"horizontal":return"h";default:return i}}({orientation:t.orientation,defaultOrientation:h?"h":"v"}),g="h"===m?"y":"x",y="h"===m?"height":"width";return p.sort((e,t)=>e.node.localBounds[g]+e.node.localBounds[y]-(t.node.localBounds[g]+t.node.localBounds[y])),s({chart:n,targetNodes:p,stngs:t,rect:i,fitsHorizontally:f,collectiveOrientation:m})},slice:function(e){let t=e.settings,n=e.chart,r=e.nodes,i=e.rect,o=e.renderer,a=e.style,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:T$,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:C$;const c=Gq({fontSize:12,fontFamily:"Arial",fill:"#333",padding:4,position:"into"},a.label);c.fontSize=parseInt(c.fontSize,10);const u=t.labels.map(e=>Gq({},c,t,e)),d=t.labels.map(e=>e.placements.map(n=>Gq({},c,t,e,n))),f=[],h={insideLabelBounds:[]};r=function(e){const t=[],n=[],r=[],i=[];for(let o=0;o<e.length;++o){const a=e[o].desc.slice,s=v$((a.start+a.end)/2);switch(Math.floor(s/(Math.PI/2))){case 0:t.push(e[o]);break;case 1:n.push(e[o]);break;case 2:r.push(e[o]);break;case 3:i.push(e[o])}}const o=(e,t)=>v$((e.desc.slice.start+e.desc.slice.end)/2)-v$((t.desc.slice.start+t.desc.slice.end)/2),a=(e,t)=>o(t,e);return t.sort(a),n.sort(o),r.sort(a),i.sort(o),t.concat(n,i,r)}(r);const p={};for(let e=0,t=r.length;e<t;e++){const t=r[e],a=E$(t,n);for(let n=0;n<u.length;n++){const r=u[n],c="function"==typeof r.label?r.label(a,e):"";if(!c)continue;const m="function"==typeof r.direction?r.direction(a,e):r.direction||"horizontal",g="function"==typeof r.linkData?r.linkData(a,e):void 0,y=D$(c,r,o),v=s({context:p,direction:m,lblStngs:r,measured:y,node:t,placementSettings:d[n],rect:i,store:h}),b=v.bounds,x=v.placement;if(b&&x){if("outside"===x.position&&"rotate"!==m){k$({context:p,node:t,bounds:b});if(!nF(x$(b),i))continue}const n="function"==typeof x.fill?x.fill(a,e):x.fill,o=l(b,c,{fill:n,fontSize:r.fontSize,fontFamily:r.fontFamily,textMetrics:y});o&&(void 0!==g&&(o.data=g),f.push(o),b.line&&(b.line.stroke=n,f.push(b.line)))}}}return f},rows:function(e){let t=e.settings,n=e.chart,r=e.nodes,i=e.renderer,o=e.style,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:dV;const s=Gq({fontSize:12,fontFamily:"Arial",fill:"#333",padding:4,align:.5,justify:.5},o.label);s.fontSize=parseInt(s.fontSize,10);const l=Gq({},s,t),c=t.labels.map(e=>Gq({},l,e)),u={},d=[];for(let e=0,t=r.length;e<t;e++){let t=r[e],o=uV(t,n),s=hV(t),f=s.type,h=s.bounds;if(!h)continue;let p,m=0,g=[],y=[],v="circle"===f?2*h.r*.9:h.height;for(m+=l.padding,p=0;p<c.length;p++){let t=c[p],n="function"==typeof t.label?t.label(o,e):"";u.fontFamily=t.fontFamily,u.fontSize="".concat(t.fontSize,"px"),u.text=n;let r=i.measureText(u);if(m+=r.height+t.padding,m>v)break;y.push(n),g.push(r)}const b=p,x=Math.max(0,v-m);let S;for(S="circle"===f?h.cy-.9*h.r:h.y,S+=l.justify*x+l.padding,p=0;p<b;p++){let t,n=c[p];if("circle"===f){let e=Math.max(Math.abs(S-h.cy),Math.abs(S+g[p].height-h.cy)),n=Math.sqrt(h.r*h.r-e*e);t={x:h.cx-n+l.padding,y:S,width:2*n-2*l.padding,height:g[p].height}}else t={x:h.x+l.padding,y:S,width:h.width-2*l.padding,height:g[p].height};S+=g[p].height+l.padding;let r="function"==typeof n.fill?n.fill(o,e):n.fill;const s="function"==typeof n.linkData?n.linkData(o,e):void 0;let u=a(t,y[p],{fill:r,align:n.align,fontSize:n.fontSize,fontFamily:n.fontFamily,textMetrics:g[p]});if(u){if(u.text&&u.text!==F$){const e=Z$(u,i.measureText);if(F$===e)continue;u.ellipsed=e}void 0!==s&&(u.data=s),d.push(u)}}}return d}};const mV={require:["chart","renderer","settings"],defaultSettings:{settings:{},style:{label:"$label"}},render(){const e=this.settings.settings,t=[];return(e.sources||[]).forEach(e=>{e.strategy&&pV[e.strategy.type]&&e.component&&t.push(...function(e,t){let n=e.chart,r=e.source,i=e.rect,o=e.renderer,a=e.style;if(!n.component(r.component))return[];const s=n.findShapes(r.selector).filter(e=>e.key===r.component);return t({chart:n,settings:r.strategy.settings,nodes:s,rect:{x:0,y:0,width:i.width,height:i.height},renderer:o,style:a})}({chart:this.chart,rect:this.rect,renderer:this.renderer,source:e,style:this.style},pV[e.strategy.type]))}),t}};const gV={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 yV(e){let t=e.x,n=void 0===t?0:t,r=e.y,i=e.item,o=e.globalMetrics,a=e.createSymbol,s=e.direction,l=void 0===s?"ltr":s,c=i.label.displayObject,u=i.label.bounds,d=i.symbol.meta;const f="rtl"===l;let h={x:f?n+o.maxLabelBounds.width:n+o.maxSymbolSize+o.spacing,y:r,width:o.maxLabelBounds.width,height:Math.max(o.maxSymbolSize,o.maxLabelBounds.height)},p=function(e,t,n){const r=Math.max(0,e.width-t),i=Math.max(0,e.height-t);return{x:e.x+t/2+n.align*r,y:e.y+t/2+n.justify*i}}({x:f?n+o.maxLabelBounds.width+o.spacing:n,y:r,width:o.maxSymbolSize,height:h.height},d.size,{align:void 0===d.align?.5:d.align,justify:void 0===d.justify?.5:d.justify});const m=a(Gq({},d,p));return delete m.collider,c.anchor=f?"end":"start",function(e,t,n){const r=n.textMetrics;if(e.height<r.height)return!1;const i=Math.max(0,e.width-r.width);t.baseline="text-before-edge";const o=Math.max(0,e.height-r.height);t.x=e.x+n.align*i,t.y=e.y+n.justify*o+.175*parseInt(t.fontSize,10)}(h,c,{textMetrics:u,fontSize:parseInt(c.fontSize,10),align:0,justify:.5}),{item:{type:"container",data:i.label.displayObject.data,children:[m,c],collider:{type:"rect",x:n,y:r,width:o.maxItemBounds.width,height:o.maxItemBounds.height}},metrics:h}}function vV(e,t){const n=e.items.length,r=Math.ceil(n/t),i="horizontal"===e.layout.orientation?"width":"height",o="width"===i?"horizontal":"vertical";return e.globalMetrics.maxItemBounds[i]*r+(r-1)*e.layout.margin[o]}function bV(e,t){let n,r,i,o,a=t.onScroll,s=void 0===a?()=>{}:a,l=null,c=0;const u={itemize:t=>{n=function(e,t){let n,r,i=e.resolved,o=e.dock,a=[],s=i.items.items,l=i.symbols.items,c=i.labels.items,u=0,d=0,f=0;for(let e=0;e<s.length;e++){if(!1===s[e].show)continue;const i=void 0!==c[e].text?c[e].text:c[e].data.label||"";n=Gq({},c[e],{type:"text",fontSize:"".concat(parseInt(c[e].fontSize,10),"px"),text:i,title:i}),r={symbol:{meta:l[e]},label:{displayObject:n,bounds:t.textBounds(n)}},a.push(r),u=Math.max(l[e].size,u),d=Math.max(r.label.bounds.width,d),f=Math.max(r.label.bounds.height,f)}return{items:a,globalMetrics:{spacing:8,maxSymbolSize:u,maxItemBounds:{height:Math.max(u,f),width:u+8+d},maxLabelBounds:{width:d,height:f}},layout:{margin:{vertical:void 0!==i.layout.item.vertical?i.layout.item.vertical:4,horizontal:void 0!==i.layout.item.horizontal?i.layout.item.horizontal:4},mode:i.layout.item.mode,size:i.layout.item.size,orientation:"top"===o||"bottom"===o?"horizontal":"vertical",direction:i.layout.item.direction,scrollOffset:i.layout.item.scrollOffset}}}(t,e.renderer),l=isNaN(n.layout.scrollOffset)?l:n.layout.scrollOffset},getItemsToRender:t=>{i=t.viewRect,c=u.getContentOverflow(i);const a=u.extent();l=Math.max(0,Math.min(l,c)),o=Gq({},i);const s="horizontal"===u.orientation()?"x":"y";return o[s]-=l,o["x"===s?"width":"height"]=a,function(e,t,n){let r=e.viewRect,i=n.itemized,o=n.create,a=void 0===o?yV:o,s=n.parallels,l=n.createSymbol;const c=i.layout.direction,u=i.globalMetrics,d=i.items,f="horizontal"===i.layout.orientation;let h=0;const p=[],m=u.maxItemBounds.height,g=u.maxItemBounds.width,y=i.layout.margin.vertical+m,v=i.layout.margin.horizontal+g;let b=t.x,x=t.y,S=r.x-t.x;for(let e=0;e<d.length;e++){let n=a({y:x,x:"rtl"===c?r.x+S+r.width-g-(b-t.x):b,item:d[e],globalMetrics:u,direction:c,createSymbol:l});if((f&&b>=r.x-g||!f&&x>=r.y-m)&&p.push(n.item),h++,h>=s?(h=0,f?(b+=v,x=t.y):(x+=y,b=t.x)):f?x+=y:b+=v,!f&&x>r.y+r.height)break;if(f&&b>r.x+r.width)break}return p}(t,o,{itemized:n,parallels:r,createSymbol:e.symbol})},parallelize:(e,t)=>(r=function(e,t,n){const r=n.items.length,i="horizontal"===n.layout.orientation?"width":"height",o="width"===i?"horizontal":"vertical",a=n.globalMetrics.maxItemBounds[i]*r+(r-1)*n.layout.margin[o];let s=Math.ceil(a/e);if(null!=t){const e="horizontal"===n.layout.orientation?"height":"width",r="width"===e?"horizontal":"vertical",i=n.layout.margin[r]||4,o=Math.floor((t+i)/(i+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),r),hasContentOverflow:()=>{const e="horizontal"===n.layout.orientation?"width":"height";return vV(n,r)>i[e]},getContentOverflow:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i;const t="horizontal"===n.layout.orientation?"width":"height";return Math.max(0,vV(n,r)-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"===u.orientation()?i.x+i.width<o.x+o.width:i.y+i.height<o.y+o.height,hasPrev:()=>"horizontal"===u.orientation()?o.x<i.x:o.y<i.y,next:()=>{u.scroll(-u.getNextSize())},prev:()=>{u.scroll(u.getPrevSize())},scroll:e=>{const t=Math.max(0,Math.min(c,l-e));t!==l&&(l=t,s())},offset:()=>l,orientation:()=>n.layout.orientation,direction:()=>n.layout.direction,extent:()=>vV(n,r),spread:()=>function(e,t){const n=t,r="horizontal"===e.layout.orientation?"height":"width",i="width"===r?"horizontal":"vertical";return e.globalMetrics.maxItemBounds[r]*n+(n-1)*e.layout.margin[i]}(n,r)};return u}function xV(e){return Object.keys(e).filter(t=>e[t]).join(" ")}const SV={up:"▲",right:"▶",down:"▼",left:"◀"};function MV(e,t){let n=t.size,r=t.isActive,i=t.direction,o=t.nav,a={},s="";const l=t.attrs;o&&o.button&&("function"==typeof o.button.class?a=o.button.class({direction:i}):o.button.class&&(a=o.button.class),"function"==typeof o.button.content&&(s=o.button.content(e,{direction:i})),void 0!==o.button.tabIndex&&(l.tabindex=o.button.tabIndex));const c={width:"".concat(n,"px"),minWidth:"".concat(n,"px"),height:"".concat(n,"px")};return Object.keys(a).length||(c.border="0",c.background="none"),(!r||o&&o.disabled)&&(l.disabled="disabled"),e("button",Gq({class:xV(a),style:c},l),[s||e("span",{style:{pointerEvents:"none"}},[SV[i]])])}function wV(e){let t;const n={itemize:e=>{t=function(e){let t=e.dock;return{layout:{orientation:"top"===t||"bottom"===t?"vertical":"horizontal"},navigation:e.navigation}}(e)},render:r=>function(e,t,n,r){let i=t.rect,o=t.itemRenderer;if(!e||!e.renderArgs)return;e.size(i);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 d=s?["right","left"]:["down","up"];l&&s&&d.reverse();const f=[a("div",{style:{position:"relative",display:"flex","flex-direction":s?"column":"row","justify-content":"center",height:"100%",pointerEvents:"auto"},dir:l&&!s?"rtl":"ltr"},[MV(a,{size:32,isActive:c,direction:d[0],attrs:{"data-action":"next","data-component-key":r.settings.key},nav:n.navigation}),MV(a,{size:32,isActive:u,direction:d[1],attrs:{"data-action":"prev","data-component-key":r.settings.key},nav:n.navigation})])];e.render(f)}(n.renderer,r,t,e),extent:()=>32,spread:()=>64};return n}function kV(e){let t;const n={itemize:n=>{t=function(e,t){let n=e.resolved;if(!1===n.title.item.show)return null;const r=Gq({},n.title.item,{type:"text"});if("rtl"===n.layout.item.direction&&(r.anchor&&"start"!==r.anchor?"end"===r.anchor&&(r.anchor="start"):r.anchor="end"),void 0===n.title.settings.text){const e=t.scale.data().fields;r.text=e&&e[0]?e[0].title():""}return{displayObject:r,bounds:t.renderer.textBounds(r)}}(n,e)},render:e=>{!function(e,t,n){let r=e.rect;if(!t)return;const i=[];if(t.size(r),n){const e={start:0,end:r.width,middle:r.width/2};i.push(Gq({},n.displayObject,{x:e[n.displayObject.anchor]||0,y:0,baseline:"text-before-edge",title:n.displayObject.text}))}t.render(i)}(e,n.renderer,t)},spread:()=>t?t.bounds.height:0,extent:()=>t?t.bounds.width:0};return n}function EV(e,t,n,r){let i,o,a,s=r.itemRenderer,l=r.navigationRenderer,c=r.titleRenderer,u=r.isPreliminary,d=void 0!==u&&u,f=0;const h={x:t.spacing,y:t.spacing,width:e.width-2*t.spacing,height:e.height-2*t.spacing};if(i={x:h.x,y:h.y,width:h.width,height:c.spread()},"horizontal"===n){i={x:h.x,y:h.y,width:c.extent(),height:c.spread()};const e=h.width-i.width-(i.width?t.spacing:0),n=h.height;s.parallelize(e,d?void 0:n);const r=s.extent()>e?l.extent():0,u=s.spread(),p=r?l.spread():0;o={x:i.x+i.width+(i.width?t.spacing:0),y:h.y+Math.max(0,(p-u)/2),width:h.width-r-i.width-(r?t.spacing:0)-(i.width?t.spacing:0),height:n},a={x:o.x+o.width+(r?t.spacing:0),y:h.y,width:r,height:h.height},i.y=o.y;"rtl"===s.direction()&&(a.x=h.x,o.x=a.x+a.width+(a.width?t.spacing:0),i.x=o.x+o.width+(i.width?t.spacing:0)),f=Math.max(i.height,p,s.spread())}else{const e=h.height-i.height-(i.height?t.spacing:0),n=h.width;s.parallelize(e,d?void 0:n);const r=s.extent()>e?l.extent():0;a={x:h.x,y:h.y+h.height-r,width:h.width,height:r},o={x:h.x,y:i.y+i.height+(i.height?t.spacing:0),width:h.width,height:h.height-i.height-(i.height?t.spacing:0)-a.height-(a.height?t.spacing:0)},f=Math.max(c.extent(),r?l.spread():0,s.spread())}return o=Gq({},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,i.x+=e.x,i.y+=e.y,{title:Gq({},e,i),content:Gq({},e,o),navigation:Gq({},e,a),orientation:n,preferredSize:f}}function CV(e){e.state.resolved=function(e){const t=e.scale.domain();let n={items:[]};const r=e.settings.layout.dock;if("threshold-color"===e.scale.type){const i=e.scale.data().fields[0];let o=e=>String(e);e.settings.formatter?o=e.chart.formatter(e.settings.formatter):i&&(o=i.formatter());for(let e=0;e<t.length-1;e++){const r={value:t[e],label:"".concat(o(t[e])," - < ").concat(o(t[e+1]))};i&&(r.source={field:i.id()}),n.items.push(r)}"vertical"==("top"===r||"bottom"===r?"horizontal":"vertical")&&n.items.reverse()}else{const r=e.scale.labels?e.scale.labels():null;n.items=t.map((t,n)=>{const i=e.scale.datum?Gq({},e.scale.datum(t)):{value:t};return i.value=t,e.scale.label?i.label=e.scale.label(t):r&&(i.label=r[n]),i})}const i=e.resolver.resolve({data:{fields:e.scale.data().fields},defaults:Gq(!0,{},gV.title,e.style.title),settings:e.settings.settings.title}),o=e.resolver.resolve({data:{fields:e.scale.data().fields},defaults:gV.layout,settings:e.settings.settings.layout}),a=e.resolver.resolve({data:n,defaults:Gq(!0,{},gV.item.label,e.style.item.label),settings:(e.settings.settings.item||{}).label}),s=Gq(!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:Gq(!0,{},gV.item.shape,e.style.item.shape),settings:s}),c=e.resolver.resolve({data:n,defaults:Gq(!0,{},{show:gV.item.show}),settings:{show:(e.settings.settings.item||{}).show}});function u(e,n){let r=e.data.value,i=t[n+1];e.data.value=[r,i]}"threshold-color"===e.scale.type&&("vertical"==("top"===r||"bottom"===r?"horizontal":"vertical")?(c.items.reverse().forEach(u),c.items.reverse()):c.items.forEach(u));return{title:i,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 NV(e){const t=e.rect,n=e.settings,r=e.state,i=e.itemRenderer,o=e.navigationRenderer,a=e.titleRenderer,s=n.layout.dock,l="top"===s||"bottom"===s?"horizontal":"vertical",c=EV(t,r.display,l,{itemRenderer:i,navigationRenderer:o,titleRenderer:a});e.renderer.size(c.content);let u=i.getItemsToRender({viewRect:Gq({},c.content,{x:0,y:0})});return o.render({rect:c.navigation,itemRenderer:i}),a.render({rect:c.title}),e.state.views={layout:c},u}const TV={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=NV(this);this.update(e)},this.itemRenderer=bV(this,{onScroll:this.onScroll}),this.navigationRenderer=wV(this),this.titleRenderer=kV(this),this.navigationRenderer.renderer=this.registries.renderer("dom")(),this.titleRenderer.renderer=this.registries.renderer(this.settings.renderer)(),CV(this)},preferredSize(e){return function(e,t){let n=0;const r=e.settings.layout.dock||"center",i="top"===r||"bottom"===r?"horizontal":"vertical",o=e.state.display,a=EV(t.inner,o,i,{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(){CV(this)},render(){return NV(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 DV(e,t){let n=0;const r=e.state.isVertical?"justify":"align",i=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[r],0)),t[i]+=n}function qV(e,t,n){const r=n[e];return"object"==typeof r?-1!==r.valid.indexOf(t)?t:r.default:n.default}function OV(e){return qV(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 IV(e,t){const n={x:0,y:0,width:0,height:0},r=e.stgns.padding;return n.x=r.left,n.y=r.top,n.width=t.width-r.left-r.right,n.height=t.height-r.top-r.bottom,n}function AV(e){const t="top"!==e.settings.layout.dock&&"bottom"!==e.settings.layout.dock,n=e.stgns.title,r=e.chart.scale(e.stgns.fill),i=e.chart.scale(e.stgns.major),o=function(e,t){const n=t.domain();let r=n,i=e.stgns.tick.label;!i&&e.formatter?i=e.formatter:!i&&t.data().fields&&(i=t.data().fields[0].formatter()),"function"==typeof i&&(r=n.map(i).map(String));const o=n.map((n,i)=>{const o=r[i];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,i),a=qV((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=i.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:OV(e.settings),textMetrics:l,textBounds:c,requiredWidth:()=>{if(!n.show)return 0;let e=c.width,r=n.maxLengthPx;return t||(e+=n.padding,r+=n.padding),Math.min(e,r,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:r,majorScale:i,length:()=>{const n=t?"height":"width",r=t?"requiredHeight":"requiredWidth",i=Math.min(u.rect[n],u.rect[n]*e.stgns.length)-u.title[r]();return Math.max(0,Math.min(i,e.stgns.maxLengthPx))}}};return u}const _V={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=IV(this,e.inner);let n=this.stgns.size;const r=t.isVertical?this.stgns.padding.left+this.stgns.padding.right:this.stgns.padding.top+this.stgns.padding.bottom;n+=r;const i=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 i;n+=t.ticks.length}else{if(t.ticks.length>this.state.legend.length())return i;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+r,n):Math.max(n,t.title.requiredWidth()+r)),this.state.preferredSize=n,n},created(){this.stgns=this.settings.settings,this.state=AV(this)},beforeUpdate(e){this.stgns=e.settings.settings,this.state=AV(this)},beforeRender(e){if(this.state.nodes=[],this.state.rect=IV(this,e.size),this.stgns.title.show){const e=function(e){const t=e.state,n=e.stgns,r="left"===t.ticks.anchor,i="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+=i?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+=i?t.rect.height-t.title.textBounds.height:0):"top"===t.title.anchor&&(o+=r?t.rect.width:0,a+=t.title.textMetrics.height,s=r?"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 DV(e,l),l}(this);this.state.nodes.push(e)}const t=function(e){const t=e.state.legend.fillScale,n=e.state.legend.majorScale,r=t.domain().map(e=>({type:"stop",color:t(e),offset:Math.min(1,Math.max(0,n.norm(e)))}));return r.sort((e,t)=>e.offset-t.offset)}(this),n=function(e,t){const n=e.state,r=e.stgns,i=n.rect;let o=i.x,a=i.y,s=n.isVertical?r.size:n.legend.length(),l=n.isVertical?n.legend.length():r.size;"left"===n.ticks.anchor?o+=n.rect.width-r.size:"top"===n.ticks.anchor&&(a+=n.rect.height-r.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 DV(e,c),c}(this,t),r=function(e,t){const n=e.state,r=e.stgns;let i="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+r.size+r.tick.padding,o.x=t.x+t.width):"left"===n.ticks.anchor?(s=t.x-r.tick.padding,i="end"):"top"===n.ticks.anchor?(l=t.y-r.tick.padding,c-=.25*a.textMetrics.height,i=0===a.pos?"start":"end"):"bottom"===n.ticks.anchor&&(l=t.y+t.height+r.tick.padding,c=.8*a.textMetrics.height,i=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:r.tick.fontSize,fontFamily:r.tick.fontFamily,fill:r.tick.fill,maxWidth:n.isVertical?r.tick.maxLengthPx:Math.min(r.tick.maxLengthPx,n.legend.length()/2),anchor:i,textBoundsFn:e.renderer.textBounds,title:a.label,baseline:u}});return{type:"container",id:"legend-seq-ticks",children:[...a,o]}}(this,n),i={id:"legend-seq-target",type:"container",children:[n,r]};this.state.nodes.push(i)},render(){return this.state.nodes}};const LV={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 PV(e,t){let n=t.generatorType,r=t.item,i=t.data,o=t.major,a=t.minor,s=t.layerObj,l=t.stngs,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:r.opacity,stroke:r.stroke,strokeWidth:r.strokeWidth,strokeLinejoin:r.strokeLinejoin,fill:c||r.fill,data:i};return r.strokeDasharray&&(u.strokeDasharray=r.strokeDasharray),u}function RV(e){const t=function(e){let t=e.data,n=e.stngs,r=e.rect,i=e.resolver,o=e.style,a=e.domain;const s=r.width,l=r.height,c=i.resolve({data:t,defaults:LV.coordinates,settings:n.coordinates||{},scaled:{major:"vertical"===n.orientation?l:s,minor:"vertical"===n.orientation?s:l}}),u=!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(u){const e=d[n]?d[n].items[d[n].items.length-1]:null,r=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!==r&&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 h=Object.keys(d).map(e=>(d[e].consumableData=Qq({points:d[e].dataItems},d[e].dataItems[0]),d[e])),p={items:h.map(e=>e.consumableData)},m=n.layers||{};return{coordinates:c,metaLayers:h,layers:i.resolve({data:p,defaults:{curve:LV.layers.curve,show:LV.layers.show},settings:{curve:m.curve,show:m.show}}),lines:i.resolve({data:p,defaults:Gq({},LV.layers.line,o.line),settings:m.line}),areas:i.resolve({data:p,defaults:Gq({},LV.layers.area,o.area),settings:m.area})}}(e),n=t.metaLayers,r=t.coordinates,i=t.layers,o=t.lines,a=t.areas,s=[];return n.forEach((t,n)=>{const l=i.items[n];if(!1===l.show)return;l.datum=l.data,l.data=[],l.id=t.id;const c=[],u=[];let d,f;for(let n=0;n<t.items.length;n++){if(d=t.items[n],f=d.data,!d.dummy){if(isNaN(d.major))continue;e.missingMinor0&&(d.minor0=r.settings.minor.scale?r.settings.minor.scale(f.minor0?f.minor0.value:0):0),isNaN(d.minor)||c.push(d.minor),l.data.push(d.data)}u.push(d)}const h=c.sort((e,t)=>e-t)[Math.floor((c.length-1)/2)];s.push({layerObj:l,lineObj:o.items[n],areaObj:a.items[n],median:h,points:u,consumableData:t.consumableData})}),s}const FV={require:["chart","resolver"],defaultSettings:{style:{area:"$shape",line:"$shape-outline"}},created(){},render(e){let t=e.data;const n=this.rect,r=n.width,i=n.height;this.stngs=this.settings.settings||{};const o=!this.stngs.coordinates||void 0===this.stngs.coordinates.minor0,a=RV({data:t,stngs:this.stngs,rect:this.rect,resolver:this.resolver,style:this.style,missingMinor0:o,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=a.map(e=>({id:e.layerObj.id,data:e.layerObj.data})).sort(this.stngs.layers.sort).map(e=>e.id);a.sort((t,n)=>e.indexOf(t.layerObj.id)-e.indexOf(n.layerObj.id))}else a.sort((e,t)=>e.median-t.median);return function(e,t){let n=t.width,r=t.height,i=t.missingMinor0,o=t.stngs;const a=[],s=o.layers||{};return e.forEach(e=>{const t=e.lineObj,l=e.layerObj,c=e.areaObj,u=e.points;let d={size:r,p:"y"},f={size:n,p:"x"};if("vertical"===o.orientation){const e=Gq(!0,{},f);f=Gq(!0,{},d),d=Gq(!0,{},e)}s.area&&!1!==c.show&&a.push(PV(u,{data:e.consumableData,item:c,generatorType:"area",major:f,minor:d,layerObj:l,stngs:o})),t&&!1!==t.show&&(a.push(PV(u,{data:e.consumableData,item:t,generatorType:"line".concat(d.p.toUpperCase(),"1"),major:f,minor:d,layerObj:l,stngs:o},"none")),!i&&s.area&&!1!==c.show&&!1!==t.showMinor0&&a.push(PV(u,{data:e.consumableData,item:t,generatorType:"line".concat(d.p.toUpperCase(),"0"),major:f,minor:d,layerObj:l,stngs:o},"none")))}),a}(a,{width:r,height:i,missingMinor0:o,stngs:this.stngs})}};function zV(e,t){let n,r,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];"object"==typeof t.center?(n=t.center.x,r=t.center.y):(n=t.clientX,r=t.clientY);const o=n-e.state.boundingRect.left,a=r-e.state.boundingRect.top;return{x:i?Math.max(0,Math.min(o,e.rect.width)):o,y:i?Math.max(0,Math.min(a,e.rect.height)):a}}function jV(e,t){return{x:t.x+e.rect.x,y:t.y+e.rect.y}}function $V(e,t){const n=Math.min(e.x,t.x),r=Math.min(e.y,t.y);return{x:n,y:r,width:Math.max(e.x,t.x)-n,height:Math.max(e.y,t.y)-r}}const VV={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=zV(this,e,!1);vF({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=zV(this,e),this.state.active=!0)},move(e){var t;this.state.active&&(this.state.end=zV(this,e),function(e){if(e.state.active){const t=jV(e,e.state.start),n=jV(e,e.state.end),r=e.chart.shapesAt($V(t,n),{components:e.state.brushConfig});e.chart.brushFromShapes(r,{components:e.state.brushConfig})}}(this),(t=this).renderer.render([Gq({type:"rect"},$V(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(){this.state.active&&(!function(e,t){e.brushConfig.forEach(e=>{Array.isArray(e.contexts)&&e.contexts.forEach(e=>{t.brush(e).end()})})}(this.state,this.chart),this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1},this.renderer.render([]))}};function UV(e,t,n){let r=n.renderer,i=n.style,o=n.props,a=n.h;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,r){return r.content({h:e,style:n,data:t})}(a,e,i,o),c=a("div",{dir:o.direction,class:xV(Gq({"pic-tooltip":!0},s.tooltip)),style:Gq({position:"relative",display:"inline-block"},t.computedTooltipStyle)},a("div",{style:i.content,class:xV(Gq({"pic-tooltip-content":!0},s.content))},l),a("div",{class:xV(Gq({"pic-tooltip-arrow":!0},s.arrow)),style:Gq({},i.arrow,i["arrow-".concat(t.dock)],t.computedArrowStyle)}));return r.render(c),r.element().children[0]}function HV(e){let t=e.defaultDuration,n=e.defaultDelay,r=null,i=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=()=>{r=null,i=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;r&&(clearTimeout(r),a.set("debounced")),a.set("pending"),r=setTimeout(()=>{e(),o=!0,r=null,a.set("active")},c),s>0&&(i&&clearTimeout(i),i=setTimeout(l,s+Math.max(c,0)))},s.clear=()=>{o?a.set("cancelled"):r&&(clearTimeout(r),a.set("rejected")),i&&clearTimeout(i),r=null,i=null,o=!1},s.on=(e,t)=>{a.on(e,t)},s.destroy=()=>{s.clear(),a.destroy()},s}function BV(){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 WV(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 YV(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 GV(e,t,n,r,i,o){const a=t+o.x,s=n+o.y,l=i;return!(a<0||s<0)&&!(a+r>e.width||s+l>e.height)}function KV(e){let t=e.area,n=e.vx,r=e.vy,i=e.width,o=e.height,a=e.offset;const s=n+a.x,l=r+a.y,c=i,u=o;let d=s<0?-s:0,f=l<0?-l:0;return d+=s+c>t.width?-(s+c-t.width):0,f+=l+u>t.height?-(l+u-t.height):0,{x:d,y:f}}function XV(e){let t=e.options,n=e.pointer,r=e.width,i=e.height,o=e.dockOrder,a=e.x,s=e.y;const l=n.targetBounds,c=BV(t.offset),u=c[t.dock];if(u)return{computedTooltipStyle:{left:"".concat(a,"px"),top:"".concat(s,"px"),transform:u},computedArrowStyle:YV(t.offset)[t.dock],dock:t.dock};const d={width:"target"===t.area?l.width:window.innerWidth,height:"target"===t.area?l.height:window.innerHeight},f=WV(r,i,t.offset),h=[],p="target"===t.area?a:l.left+a,m="target"===t.area?s:l.top+s;for(let e=0;e<o.length;e+=1){const n=o[e],l=KV({area:d,vx:p,vy:m,width:r,height:i,offset:f[n]}),u={left:"".concat(a,"px"),top:"".concat(s,"px"),transform:c[n]},g=YV(t.offset)[n];0!==l.x&&(u.width="".concat(r-20-Math.abs(l.x),"px"),"top"!==n&&"bottom"!==n||(u.left="".concat(a+l.x,"px"),g.left="calc(50% ".concat(l.x>0?"-":"+"," ").concat(Math.abs(l.x),"px)")));const y={computedTooltipStyle:u,computedArrowStyle:g,dock:n,rect:{width:r,height:i}};if(0===l.x&&0===l.y)return y;y.offset=l,h.push(y)}return h.sort((e,t)=>Math.abs(e.offset.x)-Math.abs(t.offset.x)),h[0]}function JV(e,t,n){const r=e.key?n.component(e.key):n.componentsFromPoint({x:t.clientX,y:t.clientY})[0];if(!r)return{x:0,y:0,width:0,height:0,scaleRatio:{x:1,y:1}};const i=r.rect;return Gq({scaleRatio:i.scaleRatio},i.computedInner)}const ZV={bounds:function(e){let t=e.resources,n=e.nodes,r=e.pointer,i=e.width,o=e.height,a=e.options;const s=r.targetBounds,l=t.getNodeBoundsRelativeToTarget(n[0]),c=l.x,u=l.y,d=l.width,f=l.height,h={left:{x:c,y:u+f/2},right:{x:c+d,y:u+f/2},top:{x:c+d/2,y:u},bottom:{x:c+d/2,y:u+f},inside:{x:c+d/2,y:u+f/2}},p=BV(a.offset),m=p[a.dock];if(m)return{computedTooltipStyle:{left:"".concat(h[a.dock].x,"px"),top:"".concat(h[a.dock].y,"px"),transform:m},computedArrowStyle:YV(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},y=WV(i,o,a.offset),v=["top","left","right","bottom","inside"];for(let e=0;e<v.length;e+=1){const t=v[e];if(GV(g,"target"===a.area?h[t].x:s.left+h[t].x,"target"===a.area?h[t].y:s.top+h[t].y,i,o,y[t]))return{computedTooltipStyle:{left:"".concat(h[t].x,"px"),top:"".concat(h[t].y,"px"),transform:p[t]},computedArrowStyle:YV(a.offset)[t],dock:t}}const b=function(e){let t=e.options,n=e.docks,r=e.dockOffsets,i=e.targetBounds,o=e.area,a=e.width;const s="top",l="target"===t.area?n[s].x:i.left+n[s].x,c=("target"===t.area?n[s].y:(i.top,n[s].y),r[s]),u=l+c.x,d=(c.y,a);let f=n.top.x;return u<0&&u+d>o.width||(u<0?f-=u:u+d>o.width&&(f-=u+d-o.width)),f}({options:a,docks:h,dockOffsets:y,targetBounds:s,area:g,width:i});return{computedTooltipStyle:{left:"".concat(b,"px"),top:"".concat(h.top.y,"px"),transform:p.top},computedArrowStyle:YV(a.offset+b-h.top.x,a.offset).top,dock:"top"}},pointer:function(e){let t=e.options,n=e.pointer,r=e.width,i=e.height;return XV({x:n.x,y:n.y,pointer:n,width:r,height:i,options:t,dockOrder:["top","left","right","bottom"]})},slice:function(e){let t=e.options,n=e.pointer,r=e.width,i=e.height,o=e.nodes,a=e.resources;const s=o[0],l=n.dx,c=n.dy,u=a.getComponentBoundsFromNode(s),d=l+u.x+u.width/2,f=c+u.y+u.height/2,h=s.desc.slice,p=h.start,m=h.end,g=h.outerRadius,y=(p+m)/2-Math.PI/2,v=2*Math.PI,b=(y%v+v)%v;let x=["top","left","right","bottom"];return"auto"===t.dock&&(x=b<=Math.PI/4||b>=7*Math.PI/4?["right","top","bottom","left"]:b<=3*Math.PI/4?["bottom","left","right","top"]:b<=5*Math.PI/4?["left","top","bottom","right"]:["top","left","right","bottom"]),XV({x:d+g*u.scaleRatio.x*Math.cos(b),y:f+g*u.scaleRatio.y*Math.sin(b),pointer:n,width:r,height:i,options:t,dockOrder:x})}};function QV(e,t){let n=e.width,r=e.height,i=t.chart,o=t.state,a=t.props;const s={resources:{formatter:i.formatter,scale:i.scale,component:i.component,getComponentBoundsFromNode:e=>JV(e,o.pointer,i),getNodeBoundsRelativeToTarget:e=>function(e,t,n){const r=JV(e,t,n),i=e.bounds;return{x:r.x+t.dx+i.x,y:r.y+t.dy+i.y,width:i.width,height:i.height}}(e,o.pointer,i)},nodes:o.activeNodes,pointer:o.pointer,width:n,height:r},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=Gq(c,a.placement(s))),"object"===l&&ZV[a.placement.type]?c=Gq(c,a.placement):"string"===l&&ZV[a.placement]&&(c=Gq(c,{type:a.placement})),s.options=c;const u=ZV[c.type](s);let d=s.resources.getComponentBoundsFromNode(s.nodes[0]),f=d.x,h=d.y,p=d.width,m=d.height;return f+=s.pointer.dx,p+=f,h+=s.pointer.dy,m+=h,u.computedTooltipStyle.left="".concat(Math.min(Math.max(0,f,parseFloat(u.computedTooltipStyle.left)),p),"px"),u.computedTooltipStyle.top="".concat(Math.min(Math.max(0,h,parseFloat(u.computedTooltipStyle.top)),m),"px"),u}let eU;function tU(){eU=null}const nU={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 t=e.h;return e.data.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 rU={require:["chart","renderer"],defaultSettings:{settings:nU,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,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.nodes,i=n.duration,o=n.delay;!this.state.prevent&&this.state.targetElement&&(this.state.pointer=function(e,t){let n=t.chart,r=t.state,i=0,o=0;e.center?(i+=e.center.x,o+=e.center.y):(i+=e.clientX,o+=e.clientY);const a=n.element.getBoundingClientRect(),s=r.targetElement.getBoundingClientRect(),l=i,c=o,u=a.left-s.left,d=a.top-s.top,f=i-a.left,h=o-a.top;return i-=s.left,o-=s.top,{x:i,y:o,dx:u,dy:d,cx:f,cy:h,clientX:l,clientY:c,targetBounds:s,chartBounds:a}}(e,this),t=Array.isArray(r)?this.props.filter(r):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,o)))},prevent(e){this.state.prevent=!!e},init(e){this.state={activeNodes:[],pointer:{},targetElement:null,prevent:!1},this.props=e.settings,this.dispatcher=HV({defaultDuration:this.props.duration,defaultDelay:this.props.delay});const t=this.dispatcher.clear;this.dispatcher.on("pending",()=>{!function(e){eU&&eU!==e&&eU()}(t),eU=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,Gq({element:this.state.tooltipElm},e)),"function"==typeof this.props.onHide?this.props.onHide.call(void 0,Gq({element:this.state.tooltipElm},e)):this.renderer.clear([]),"function"==typeof this.props.afterHide&&this.props.afterHide.call(void 0,e),eU===t&&(eU=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 t=e.settings;this.dispatcher&&(this.dispatcher.destroy(),tU()),this.init(t)},render(e){return this.h=e,[]},beforeDestroy(){this.dispatcher.destroy(),tU()},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 e=this.state.targetElement.getBoundingClientRect(),t=e.width,n=e.height;this.renderer.destroy(),this.renderer.size({width:t,height:n}),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 n=t.chart,r=t.scale,i=t.props,o=t.h;const a={resources:{dataset:n.dataset,scale:n.scale,formatter:n.formatter},scale:r,h:o},s=[];return e.forEach(e=>{if("function"==typeof i.extract){const t=Gq({node:e},a);s.push(i.extract(t))}}),s}(e,this),n=QV(UV(t,{},this).getBoundingClientRect(),this);this.state.tooltipElm=UV(t,n,this)}};const iU={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 t=e.outer,n=e.inner;return this.props.useOuterRect?t:n},render(){},mounted(){this.draw()},updated(){this.props=this.settings.settings,this.draw()}};var oU={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},aU=/([astvzqmhlc])([^astvzqmhlc]*)/gi,sU=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;function lU(e){const t=[],n=String(e).trim();return"M"!==n[0]&&"m"!==n[0]||n.replace(aU,(e,n,r)=>{const i=function(e){const t=e.match(sU);return t?t.map(Number):[]}(r);let o=n.toLowerCase(),a=n;if("m"===o&&i.length>2&&(t.push([a,...i.splice(0,2)]),o="l",a="m"===a?"l":"L"),i.length<oU[o])return"";for(t.push([a,...i.splice(0,oU[o])]);i.length>=oU[o]&&i.length&&oU[o];)t.push([a,...i.splice(0,oU[o])]);return""}),t}const cU=2*Math.PI;function uU(e,t){return{x:.5*(e.x+t.x),y:.5*(e.y+t.y)}}function dU(e,t,n,r,i){const o=1-e;return o**3*t+3*o**2*e*n+3*o*e**2*r+e**3*i}function fU(e,t,n,r){let i=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,r){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+r.x-(n.x+n.x))+Math.abs(t.y+r.y-(n.y+n.y))}(e,t,n,r)<=10)return i[i.length-1]!==e&&i.push(e),i.push(r),i;const a=uU(e,t),s=uU(t,n),l=uU(n,r),c={x:dU(.5,e.x,t.x,n.x,r.x),y:dU(.5,e.y,t.y,n.y,r.y)},u=uU(a,s),d=uU(s,l);return fU(e,a,u,c,i,o-1),fU(c,d,l,r,i,o-1),i}function hU(e,t,n){const 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 fU(e,r.cp1,r.cp2,n)}function pU(e,t,n){const r=[],i=!!e[4],o=!!e[5],a=e[3];let s,l,c,u,d=e[6],f=e[7],h=e[1],p=e[2];if("a"===e[0]&&(d+=t,f+=n),t===f&&n===f)return r;if(!h||!p)return r.push({x:d,y:f}),r;var m=function(e,t,n,r,i,o,a,s,l){let c,u,d,f,h,p;const m=AR(n%360),g=Math.cos(m),y=Math.sin(m),v=(s-o)/2,b=(l-a)/2,x=g*v+y*b,S=g*b-y*v;p=x**2/(e=Math.abs(e))**2+S**2/(t=Math.abs(t))**2,p>1&&(p=Math.sqrt(p),e*=p,t*=p);const M=e*S,w=t*x,k=M**2+w**2,E=(e*t)**2-k;let C=Math.sqrt(Math.max(E/k,0));r===i&&(C=-C);const N=C*(M/t),T=C*(-w/e);f=g*N-y*T+(s+o)/2,h=y*N+g*T+(l+a)/2;const D=(x-N)/e,q=(S-T)/t,O=(-x-N)/e,I=(-S-T)/t;return c=Math.atan2(q,D),c+=c<0?cU:0,u=Math.atan2(I,O),u+=u<0?cU:0,d=u-c,!i&&c<u?d-=cU:i&&u<c&&(d+=cU),d%=cU,{startAngle:c,sweepAngle:d,cx:f,cy:h,rx:e,ry:t}}(h,p,a,i,o,d,f,t,n);s=m.cx,l=m.cy,h=m.rx,p=m.ry,c=m.sweepAngle,u=m.startAngle;const g=Math.abs(c*Math.sqrt((h**2+p**2)/2)),y=Math.ceil(g/10),v=c/y;for(let e=1;e<=y;e++){const t=(u+v*e)%cU,n=Math.cos(t),i=Math.sin(t);r.push({x:s+n*h+-i*n,y:l+i*p+n*i})}return r}function mU(e){const t=lU(e),n=[],r=[];let i=0,o=0,a=null,s=null,l=null,c=null;for(let e=0;e<t.length;++e){const u=t[e],d=u[0];switch("S"!==d&&"s"!==d&&"C"!==d&&"c"!==d&&(a=null,s=null),"T"!==d&&"t"!==d&&"Q"!==d&&"q"!==d&&(l=null,c=null),d){case"m":r.length&&n.push(r.splice(0));case"l":i+=u[1],o+=u[2],r.push({x:i,y:o});break;case"M":r.length&&n.push(r.splice(0));case"L":i=u[1],o=u[2],r.push({x:i,y:o});break;case"H":i=u[1],r.push({x:i,y:o});break;case"h":i+=u[1],r.push({x:i,y:o});break;case"V":o=u[1],r.push({x:i,y:o});break;case"v":o+=u[1],r.push({x:i,y:o});break;case"a":r.push(...pU(u,i,o)),i+=u[6],o+=u[7];break;case"A":r.push(...pU(u,i,o)),i=u[6],o=u[7];break;case"c":r.push(...fU({x:i,y:o},{x:u[1]+i,y:u[2]+o},{x:u[3]+i,y:u[4]+o},{x:u[5]+i,y:u[6]+o})),a=u[3]+i,s=u[4]+o,i+=u[5],o+=u[6];break;case"C":r.push(...fU({x:i,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],i=u[5],o=u[6];break;case"s":null!==a&&null!==a||(a=i,s=o),r.push(...fU({x:i,y:o},{x:2*i-a,y:2*o-s},{x:u[1]+i,y:u[2]+o},{x:u[3]+i,y:u[4]+o})),a=u[1]+i,s=u[2]+o,i+=u[3],o+=u[4];break;case"S":null!==a&&null!==a||(a=i,s=o),r.push(...fU({x:i,y:o},{x:2*i-a,y:2*o-s},{x:u[1],y:u[2]},{x:u[3],y:u[4]})),a=u[1],s=u[2],i=u[3],o=u[4];break;case"Q":r.push(...hU({x:i,y:o},{x:u[1],y:u[2]},{x:u[3],y:u[4]})),l=u[1],c=u[2],i=u[3],o=u[4];break;case"q":r.push(...hU({x:i,y:o},{x:u[1]+i,y:u[2]+o},{x:u[3]+i,y:u[4]+o})),l=u[1]+i,c=u[2]+o,i+=u[3],o+=u[4];break;case"T":null!==l&&null!==l||(l=i,c=o),l=2*i-l,c=2*o-c,r.push(...hU({x:i,y:o},{x:l,y:c},{x:u[1],y:u[2]})),i=u[1],o=u[2];break;case"t":null!==l&&null!==l||(l=i,c=o),l=2*i-l,c=2*o-c,r.push(...hU({x:i,y:o},{x:l,y:c},{x:u[1]+i,y:u[2]+o})),i+=u[1],o+=u[2];break;case"z":case"Z":r.length&&r.push({x:r[0].x,y:r[0].y})}}return function(e){for(let t=0;t<e.length-1;t++){const n=e[t],r=e[t+1];Math.abs(n.x-r.x)<1e-12&&Math.abs(n.y-r.y)<1e-12&&(e.splice(t,1),t--)}}(r),n.push(r.splice(0)),n}const gU={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=>{mU(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 t=e.outer,n=e.inner;return this.props.useOuterRect?t:n},render(){},mounted(){this.draw()},updated(){this.props=this.settings.settings,this.draw()}};var yU=[function(e){e.component("box",vz),e.component("box-marker",vz)},function(e){e.component("point",Cz),e.component("point-marker",Cz)},function(e){e.component("pie",qz)},function(e){e.component("grid-line",Lz)},function(e){e.component("ref-line",Wz)},function(e){e.component("axis",Sj)},function(e){e.component("container",Mj)},function(e){e.component("text",Ej)},function(e){e.component("scrollbar",Tj)},function(e){e.component("brush-range",Uj),e.component("brush-area-dir",Yj)},function(e){e.component("range",Jj)},function(e){e.component("brush-lasso",r$)},function(e){e.component("labels",mV)},function(e){e.component("legend-cat",TV)},function(e){e.component("legend-seq",_V)},function(e){e.component("line",FV)},function(e){e.component("brush-area",VV)},function(e){e.component("tooltip",rU)},function(e){e.component("debug-collider",iU)},function(e){e.component("debug-path-to-points",gU)}];let vU=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,r;for(n=0;n<t;n++)r=this.children[n],e.push(r),r.children.length&&(e=[...e,...r.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 bU{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.x,n=void 0===t?0:t,r=e.y,i=void 0===r?0:r,o=e.width,a=void 0===o?0:o,s=e.height,l=void 0===s?0:s,c=e.minWidth,u=void 0===c?0:c,d=e.minHeight,f=void 0===d?0:d;this.set({x:n,y:i,width:a,height:l,minWidth:u,minHeight:f})}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.x,n=void 0===t?0:t,r=e.y,i=void 0===r?0:r,o=e.width,a=void 0===o?0:o,s=e.height,l=void 0===s?0:s,c=e.minWidth,u=void 0===c?0:c,d=e.minHeight,f=void 0===d?0:d;this.type="rect",a>=0?(this.x=n,this.width=Math.max(a,u)):(this.x=n+Math.min(a,-u),this.width=-Math.min(a,-u)),l>=0?(this.y=i,this.height=Math.max(l,f)):(this.y=i+Math.min(l,-f),this.height=-Math.min(l,-f))}containsPoint(e){return vF(this,e)}intersectsLine(e){return bF(this,lO(e))}intersectsRect(e){return gF(this,sO(e))}intersectsCircle(e){return uF(e,this)}intersectsPolygon(e){return mF(e,this)}intersectsGeoPolygon(e){return NF(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 xU{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.cx,n=void 0===t?0:t,r=e.cy,i=void 0===r?0:r,o=e.r,a=void 0===o?0:o,s=e.minRadius,l=void 0===s?0:s;this.set({cx:n,cy:i,r:a,minRadius:l})}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.cx,n=void 0===t?0:t,r=e.cy,i=void 0===r?0:r,o=e.r,a=void 0===o?0:o,s=e.minRadius,l=void 0===s?0:s;this.type="circle",this.cx=n,this.cy=i,this.r=Math.max(a,l),this.vector={x:this.cx,y:this.cy}}containsPoint(e){return cF(this,e)}intersectsLine(e){return dF(this,lO(e))}intersectsRect(e){return uF(this,sO(e))}intersectsCircle(e){return n=e,!oF(t=this)&&!oF(n)&&(t.cx-n.cx)**2+(t.cy-n.cy)**2<=(t.r+n.r)**2;var t,n}intersectsPolygon(e){return fF(this,e)}intersectsGeoPolygon(e){return kF(this,e)}points(){return[{x:this.cx,y:this.cy}]}}class SU{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.x1,n=void 0===t?0:t,r=e.y1,i=void 0===r?0:r,o=e.x2,a=void 0===o?0:o,s=e.y2,l=void 0===s?0:s,c=e.tolerance,u=void 0===c?0:c;this.set({x1:n,y1:i,x2:a,y2:l,tolerance:u})}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.x1,n=void 0===t?0:t,r=e.y1,i=void 0===r?0:r,o=e.x2,a=void 0===o?0:o,s=e.y2,l=void 0===s?0:s,c=e.tolerance,u=void 0===c?0:c;this.type="line",this.x1=n,this.y1=i,this.x2=a,this.y2=l,this.tolerance=Math.max(0,Math.round(u)),this.vectors=this.points(),this.zeroSize=n===a&&i===l}containsPoint(e){if(this.tolerance>0){return dF({cx:e.x,cy:e.y,r:this.tolerance},this)}return SF(this,e)}intersectsLine(e){return xF(this,lO(e))}intersectsRect(e){return bF(sO(e),this)}intersectsCircle(e){return dF(e,this)}intersectsPolygon(e){return pF(e,this)}intersectsGeoPolygon(e){return CF(e,this)}points(){return[{x:this.x1,y:this.y1},{x:this.x2,y:this.y2}]}}class MU{constructor(){let e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).vertices,t=void 0===e?[]:e;this.set({vertices:t})}set(){let e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).vertices,t=void 0===e?[]:e;if(this.type="polygon",this.vertices=t.slice(),this.edges=[],function(e){for(let t=0;t<e.length-1;t++){const n=e[t],r=e[t+1];n.x===r.x&&n.y===r.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 hF(this,e)}intersectsCircle(e){return fF(e,this)}intersectsLine(e){return pF(this,lO(e))}intersectsRect(e){return mF(this,sO(e))}intersectsPolygon(e){return MF(this,e)}intersectsGeoPolygon(e){return wF(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 wU(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new MU(...t)}function kU(e){const t=e[0],n=e[e.length-1];t.x===n.x&&t.y===n.y||e.push(t)}function EU(e){for(let t=0;t<e.length-1;t++){const n=e[t],r=e[t+1];n.x===r.x&&n.y===r.y&&(e.splice(t,1),t--)}}class CU{constructor(){let e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).vertices,t=void 0===e?[[]]:e;this.set({vertices:t})}set(){let e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).vertices,t=void 0===e?[]:e;this.type="geopolygon",this.vertices=t.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++)EU(this.vertices[e]),this.vertices[e].length>2&&kU(this.vertices[e]),this.polygons[e]=wU({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 EF(this,e)}intersectsCircle(e){return kF(e,this)}intersectsLine(e){return CF(this,lO(e))}intersectsRect(e){return NF(this,sO(e))}intersectsPolygon(e){return wF(this,e)}intersectsGeoPolygon(e){return function(e,t){const n=e.boundingRect(),r=t.boundingRect();return!!gF(n,r)&&(yF(r,n)?lF(t,e):lF(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 NU(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new CU(...t)}function TU(e,t){return e.x!==t.x||e.y!==t.y}class DU{constructor(){let e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).points,t=void 0===e?[]:e;this.set({points:t})}set(){let e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).points,t=void 0===e?[]:e;if(this.type="polyline",this.segments=[],this._points=t.slice(),this._points.length>1)for(let e=0,t=this._points.length-1;e<t;e++)TU(this._points[e],this._points[e+1])&&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})}containsPoint(e){return this.segments.some(t=>SF(t,e))}intersectsCircle(e){return this.segments.some(t=>dF(e,t))}intersectsLine(e){const t=lO(e);return this.segments.some(e=>xF(e,t))}intersectsRect(e){const t=sO(e);return this.segments.some(e=>bF(t,e))}intersectsPolygon(e){return this.segments.some(t=>pF(e,t))}intersectsGeoPolygon(e){return this.segments.some(t=>CF(e,t))}points(){return this._points}}const qU=mI();function OU(e,t){return qU.get(e)(t)}qU.add("rect",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new bU(...t)}),qU.add("circle",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new xU(...t)}),qU.add("line",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new SU(...t)}),qU.add("polygon",wU),qU.add("geopolygon",NU),qU.add("polyline",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new DU(...t)});class IU{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=OU(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 AU{constructor(){this._elements=[[1,0,0],[0,1,0],[0,0,1]],this._stack=[]}clone(){return(new AU).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,r,i;if(e instanceof AU&&(e=e._elements),Array.isArray(e)){for(r=[[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(i=0;i<3;i++)r[t][n]+=this._elements[t][i]*e[i][n];this._elements=r}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,r,i,o){return this.multiply([[e,n,i],[t,r,o],[0,0,1]]),this}determinant(){let e=this._elements[0][0],t=this._elements[0][1],n=this._elements[0][2],r=this._elements[1][0],i=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*i*l+t*o*a+n*r*s-n*i*a-t*r*l-e*o*s,c}invert(){let e=this.determinant(),t=this._elements[0][0],n=this._elements[0][1],r=this._elements[0][2],i=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,r*l-n*c,n*a-r*o],[a*s-i*c,t*c-r*s,r*i-t*a],[i*l-o*s,s*n-t*l,t*o-n*i]],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,r=[e.x,e.y,1],i=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]+=r[n]*i[t][n];return{x:o[0],y:o[1]}}transformPoints(e){let t,n,r,i,o,a=this._elements,s=[];for(i=0;i<e.length;i++){for(t=[e[i].x,e[i].y,1],o=[0,0,0],n=0;n<this._elements.length;n++)for(r=0;r<this._elements[n].length;r++)o[n]+=t[r]*a[n][r];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 _U=/(translate|scale|rotate|matrix)\(([0-9,.eE+-\s]+)(?:,|\s?)+\)/g;function LU(e,t){const n=t.args[0]*(Math.PI/180);if(t.args.length>2){const r=t.args[1],i=t.args[2];e.translate(r,i),e.rotate(n),e.translate(-r,-i)}else 1===t.args.length&&e.rotate(n)}function PU(e,t){const n=t.args[0],r=isNaN(t.args[1])?t.args[0]:t.args[1];e.scale(n,r)}function RU(e,t){const n=t.args[0],r=isNaN(t.args[1])?0:t.args[1];e.translate(n,r)}function FU(e,t){t.args.length>=6&&e.transform(...t.args)}function zU(e,t){const n=function(e){let t,n=[];for(;null!==(t=_U.exec(e));){const e=t[2].trim(),r=-1===e.indexOf(",")?e.split(" "):e.split(",");n.push({cmd:t[1],args:r.filter(e=>e.trim().length>0).map(e=>Number(e))})}return n}(e);let r;for(let e=0,i=n.length;e<i;e++)r=n[e],"rotate"===r.cmd?LU(t,r):"scale"===r.cmd?PU(t,r):"matrix"===r.cmd?FU(t,r):"translate"===r.cmd&&RU(t,r)}const jU={type:/^\w[\w-]+/,attr:/^\[\w(?:[\w\._-]+)?(?:[!]?=['\"][\w\s*#_-]*['\"])?\]/,universal:/^(\*)/,tag:/^\.(\w+)/},$U={type:(e,t)=>t.filter(t=>{const n=t.type;return!!n&&n.toLowerCase()===e.toLowerCase()}),attr:(e,t,n,r)=>r.filter(r=>{const i=r.attrs[e];if(!t)return void 0!==i;if(void 0===i)return!1;switch(t){case"=":return n===String(i);case"!=":return n!==String(i);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 VU(e,t){if(!t||!t.length||!e||"function"!=typeof $U[e.type])return[];switch(e.type){case"type":case"tag":return $U[e.type](e.value,t);case"attr":return $U[e.type](e.attribute,e.operator,e.attributeValue,t);case"universal":return $U[e.type](t);default:return[]}}var UU={find:function(e,t){const n=[],r=[];let i,o;if(t.isBranch){let a;i=function(e){const t=[];let n,r,i,o;return e.split(/\s*,\s*/).forEach(e=>{e=e.trim(),n=[];const a=t=>{i=e.match(jU[t]),i&&(o=!0,e=e.slice(i[0].length),r={type:t,value:i[0]},"attr"===t&&(i=i[0].match(/\[(\w[\w\._-]+)?(?:([!]?=)['\"]([\w\s#_-]*)['\"])?\]/),r.attribute=i[1],r.operator=i[2],r.attributeValue=i[3]),n.push(r))};for(;e&&(o=!1,i=e.match(/^\s*([>+~]|\s)\s*/),i&&(o=!0,n.push({type:" ",value:i[0]}),e=e.slice(i[0].length)),Object.keys(jU).forEach(a),n&&n.length&&t.indexOf(n)<0&&t.push(n),o););}),t}(e),o=t.descendants;for(let e=0,t=i.length;e<t;e++){a=i[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=VU(e,n),s=!0}),s&&t.push(n);const l=t[0].filter(e=>{let n,r=e.parent;for(let e=1;e<t.length;e++){for(n=t[e].indexOf(r);r&&n<0;)r=r.parent,n=t[e].indexOf(r);if(n<0)return!1}return!0});r.push(l)}for(let e=0,t=r.length;e<t;e++)for(let t=0,i=r[e].length;t<i;t++)n.indexOf(r[e][t])<0&&n.push(r[e][t])}return n||[]}};function HU(e,t,n){const r=e.type;let i=e.points();n&&(i=i.every(e=>Array.isArray(e))?i.map(e=>n.transformPoints(e)):n.transformPoints(i)),function(e,t){for(let n=0,r=e.length;n<r;n++)e[n].x/=t,e[n].y/=t}(i,t);let o=null;if("rect"===r||"bounds"===r)o=sO(i),o.type=r;else if("circle"===r)o=function(e,t){return{cx:e[0].x,cy:e[0].y,r:t}}(i,e.r),o.type=r;else if("line"===r)o=lO(i),o.type=r;else if("polygon"===r||"polyline"===r){o={type:"path",d:OR(i,"polygon"===r)}}else if("geopolygon"===r){let e="";for(let t=0;t<i.length;t++)e+=OR(i[t],!0);o={type:"path",d:e}}return o}class BU{constructor(e){this._bounds=function(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const n=e.boundingRect?e.boundingRect(t):{x:0,y:0,width:0,height:0};return{x:n.x,y:n.y,width:n.width,height:n.height}},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=>HU(e,t,n))}:HU(e.collider,t,n)}return null}(e,this._dpi),this._desc=e.desc,this._tag=e.tag,this._children=()=>e.children.map(e=>new BU(e)),this._parent=()=>e.parent?new BU(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,r=this._getElementBoundingRect();let i=r.left,o=r.top;if("object"===t&&null!==e&&"function"==typeof e.getBoundingClientRect){const t=e.getBoundingClientRect(),n=t.left,r=void 0===n?0:n,a=t.top;i-=r,o-=void 0===a?0:a}return n.x+=i,n.y+=o,n}get collider(){return this._collider()}get desc(){return this._desc}get tag(){return this._tag}}function WU(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new BU(...t)}class YU{constructor(e){this._node=WU(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 GU(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new YU(...t)}function KU(e,t){const n=e.parent;if(n&&"stage"!==n.type){t.parent=GU(n);const e=n.parent;e&&"stage"!==e.type&&KU(e,t.parent)}}function XU(e,t,n){if(null===e.colliderType)return null;const r=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};var r=e.inverseModelViewMatrix.transformPoint(i);n.cx=r.x,n.cy=r.y,n.r=t.r}else n=t;return Array.isArray(n.vertices)&&(n=n.vertices.every(e=>Array.isArray(e))?NU(n):wU(n)),n}(e,n);return"frontChild"===e.colliderType?function(e,t,n){for(let r=e.descendants.length-1;r>=0;r--){const i=e.descendants[r];if(null!==i.collider&&i.collider[t](n)){const e=GU(i);return KU(i,e),e}}return null}(e,t,r):function(e,t,n){if(e.collider[t](n)){const t=GU(e);return KU(e,t),t}return null}(e,t,r)}function JU(e,t,n,r){const i=e.length;for(let o=0;o<i;o++){const i=e[o],a=XU(i,t,r);a&&n.push(a),!i.children||a||i.collider||JU(i.children,t,n,r)}}function ZU(e,t,n){const r=e.length;for(let i=0;i<r;i++){const r=e[i];if(null!==XU(r,t,n))return!0;if(r.children&&!r.collider)return ZU(r.children,t,n)}return!1}function QU(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;let n={};switch(cO(e)){case"circle":return n.cx=e.cx*t,n.cy=e.cy*t,n.r=e.r,["intersectsCircle",n];case"rect":return n=aO(e).map(e=>RR(e,t)),["intersectsRect",n];case"line":return n=oO(e).map(e=>RR(e,t)),["intersectsLine",n];case"point":return n=RR(e,t),["containsPoint",n];case"polygon":return n.vertices=e.vertices.map(e=>RR(e,t)),["intersectsPolygon",n];case"geopolygon":return n.vertices=e.vertices.map(e=>e.map(e=>RR(e,t))),["intersectsGeoPolygon",n];default:return[]}}function eH(e,t){const n=eO(QU(t,e.dpi),2),r=n[0],i=n[1],o=[];return r&&(JU([e],r,o,i),function(e,t){for(let n=0,r=t.length;n<r;n++)t[n].input=e}(t,o)),o}function tH(e,t){const n=eO(QU(t,e.dpi),2);return ZU([e],n[0],n[1])}class nH extends vU{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 t=e.data,n=e.desc,r=e.tag,i=e.strokeReference,o=e.fillReference;var a,s;a=this.attrs,s=e,Object.keys(qR).forEach(e=>{const t=s[e];void 0!==t&&(a[qR[e]]=t)}),void 0!==t&&(this.data=t),"object"==typeof n&&(this.desc=Gq(!0,{},n)),"string"==typeof r&&(this.tag=r),"string"==typeof i&&(this.strokeReference=i),"string"==typeof o&&(this.fillReference=o)}findShapes(e){return UU.find(e,this).map(e=>WU(e))}getItemsFrom(e){return eH(this,e)}containsPoint(e){return tH(this,e)}intersectsLine(e){return tH(this,e)}intersectsRect(e){return tH(this,e)}intersectsCircle(e){return tH(this,e)}intersectsPolygon(e){return tH(this,e)}intersectsGeoPolygon(e){return tH(this,e)}resolveLocalTransform(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new AU;void 0!==this.attrs.transform&&zU(this.attrs.transform,e),this.modelViewMatrix=e.clone()}resolveGlobalTransform(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new AU;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),r=e.attrs,i=Object.keys(r);if(n.length!==i.length)return!1;for(let e=0;e<n.length;e++){const i=n[e];if(!Object.hasOwnProperty.call(r,i))return!1;if(t[i]!==r[i])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 IU(...t)}(this._collider.definition);break;case"frontChild":return!0;case"bounds":this._collider.fn=OU("rect",this.boundingRect());break;case"line":case"rect":case"circle":case"polygon":case"geopolygon":case"polyline":this._collider.fn=OU(this._collider.type,this._collider.definition);break;default:return null}return this._collider.fn}get colliderType(){return this._collider.type}}class rH extends vU{addChild(e){if(!(e&&e instanceof vU))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 iH=rH.prototype;class oH extends nH{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.type;super(void 0===t?"container":t),this.set(e)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(e);const t=e.collider,n=Gq({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]||{},r=eO(e.bounds(t),3),i=r[0],o=r[2],a=i.x,s=i.y,l=o.x,c=o.y,u=isNaN(n.width)?l:Math.max(l,n.width+n.x),d=isNaN(n.height)?c:Math.max(c,n.height+n.y);n.x=isNaN(n.x)?a:Math.min(a,n.x),n.y=isNaN(n.y)?s:Math.min(s,n.y),n.width=u-n.x,n.height=d-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]=Gq({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=iH.addChild.call(this,e);if(this._collider&&"bounds"===this._collider.type){this.appendChildRect(e,!0);const t=Gq({type:"bounds",x:0,y:0,width:0,height:0},this.__boundingRect.true);this.collider=t}return t}addChildren(e){const t=iH.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=Gq({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,r=n?n.length:0;for(t=0;t<r;t++)n[t]._stage=null;if(iH.removeChild.call(this,e),this._collider&&"bounds"===this._collider.type){this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null};const e=Gq(this.boundingRect(!0),{type:"bounds"});this.collider=e}return this}removeChildren(e){if(iH.removeChildren.call(this,e),this._collider&&"bounds"===this._collider.type){this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null};const e=Gq(this.boundingRect(!0),{type:"bounds"});this.collider=e}return this}}function aH(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new oH(...t)}class sH extends oH{constructor(e){super("stage"),this._stage=this,this._dpiRatio=e||1}get dpi(){return this._dpiRatio}}const lH=rH.prototype,cH=["x1","x2","y1","y2","id","offset","style"];class uH extends nH{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.type;super(void 0===t?"container":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 r=0,i=cH.length;r!==i;r++)n=cH[r],void 0!==e[n]&&(t[n]=e[n])}addChild(e){return lH.addChild.call(this,e)}addChildren(e){return lH.addChildren.call(this,e)}removeChild(e){e._stage=null;let t,n=e.descendants,r=n?n.length:0;for(t=0;t<r;t++)n[t]._stage=null;return lH.removeChild.call(this,e),this}removeChildren(e){return lH.removeChildren.call(this,e),this}}function dH(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new uH(...t)}const fH=rH.prototype,hH=["patternUnits","x","y","width","height","id"];class pH extends nH{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.type;super(void 0===t?"container":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 r=0,i=hH.length;r!==i;r++)n=hH[r],void 0!==e[n]&&(t[n]=e[n])}addChild(e){return fH.addChild.call(this,e)}addChildren(e){return fH.addChildren.call(this,e)}removeChild(e){e._stage=null;let t,n=e.descendants,r=n?n.length:0;for(t=0;t<r;t++)n[t]._stage=null;return fH.removeChild.call(this,e),this}removeChildren(e){return fH.removeChildren.call(this,e),this}}class mH extends nH{constructor(){super("rect"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.x,n=void 0===t?0:t,r=e.y,i=void 0===r?0:r,o=e.width,a=void 0===o?0:o,s=e.height,l=void 0===s?0:s,c=e.rx,u=void 0===c?0:c,d=e.ry,f=void 0===d?0:d,h=e.collider,p=Gq({type:"rect",x:n,y:i,width:a,height:l},h);super.set(e),a>=0?(this.attrs.x=n,this.attrs.width=a):(this.attrs.x=n+a,this.attrs.width=-a),l>=0?(this.attrs.y=i,this.attrs.height=l):(this.attrs.y=i+l,this.attrs.height=-l),u>0&&(this.attrs.rx=u),f>0&&(this.attrs.ry=f),this.collider=p,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=aO(this.attrs),n=eO(iO(e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(t):t),4),r=n[0],i=n[1],o=n[2],a=n[3];return this.__boundingRect[e]={x:r,y:i,width:o-r,height:a-i},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 gH extends nH{constructor(){super("circle"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.cx,n=void 0===t?0:t,r=e.cy,i=void 0===r?0:r,o=e.r,a=void 0===o?0:o,s=e.collider,l=Gq({type:"circle",cx:n,cy:i,r:a},s);super.set(e),this.attrs.cx=n,this.attrs.cy=i,this.attrs.r=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=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 t=this.attrs,n=t.cx,r=t.cy,i=t.r,o=t.r,a=n-i,s=r-o;let l=2*i,c=2*o,u=[{x:a,y:s},{x:a+l,y:s},{x:a+l,y:s+c},{x:a,y:s+c}];if(e&&this.modelViewMatrix){u=this.modelViewMatrix.transformPoints(u);const t=eO(iO(u),4),n=t[0],r=t[1];l=t[2]-n,c=t[3]-r,this.__bounds[e]=[{x:n,y:r},{x:n+l,y:r},{x:n+l,y:r+c},{x:n,y:r+c}]}else this.__bounds[e]=u;return this.__bounds[e]}}class yH extends nH{constructor(){super("line"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.x1,n=void 0===t?0:t,r=e.y1,i=void 0===r?0:r,o=e.x2,a=void 0===o?0:o,s=e.y2,l=void 0===s?0:s,c=e.collider;super.set(e),this.attrs.x1=n,this.attrs.y1=i,this.attrs.x2=a,this.attrs.y2=l;const u={type:"line",x1:n,y1:i,x2:a,y2:l};this.collider=Gq(u,c),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=oO(this.attrs);e&&this.modelViewMatrix&&(t=this.modelViewMatrix.transformPoints(t));const n=eO(iO(t),4),r=n[0],i=n[1],o=n[2],a=n[3],s=r!==o||i!==a;return this.__boundingRect[e]={x:r,y:i,width:s?Math.max(1,o-r):0,height:s?Math.max(1,a-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 vH=Math.PI/2;function bH(e,t){const n=Math.atan2(t.y-e.y,t.x-e.x);return n<0?n+2*Math.PI:n}function xH(e,t,n){return{x:e.x+Math.cos(t)*n,y:e.y+Math.sin(t)*n}}const SH={step:function(e){return new lI(e,.5)},stepAfter:function(e){return new lI(e,1)},stepBefore:function(e){return new lI(e,0)},linear:jO,basis:function(e){return new YO(e)},cardinal:XO.tension(0),catmullRom:ZO,monotonex:function(e){return new rI(e)},monotoney:function(e){return new iI(e)},natural:function(e){return new aI(e)}};function MH(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 wH extends nH{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=RO();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 t=e.major,n=e.minor,r=e.layerObj,i=e.points,o=e.stngs,a=e.generatorType,s=UO(),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(SH["monotone"===r.curve?"monotone".concat(t.p):r.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?i.filter(s.defined()):i,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=mU(this.attrs.d),this.segments.length>1&&this.segments.every(e=>MH(e)))return void(this.collider=Gq({type:"geopolygon",vertices:this.segments},e.collider));this.segments.forEach(t=>{if(t.length<=1);else if(MH(t))this.collider=Gq({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 r=[],i=[];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=bH(s,a),u=bH(s,l),d=(c+u)/2,f=d+Math.PI,h=Math.max(d,f),p=Math.min(d,f),m=c>u;if(1===n){const e=bH(a,s);r.push(xH(a,e-vH,t)),i.unshift(xH(a,e+vH,t))}const g=m?h:p,y=m?p:h;if(r.push(xH(s,g,t)),i.unshift(xH(s,y,t)),n===o-1){const e=bH(l,s);r.push(xH(l,e+vH,t)),i.unshift(xH(l,e-vH,t))}}return{type:"polygon",vertices:[...r,...i]}}(t,n,e.collider)}else this.collider=Gq({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:mU(this.attrs.d),this.points=function(e){const t=[];let n,r=e.length;for(let i=0;i<r;i++){n=e[i];for(let e=0;e<n.length;e++)t.push(n[e])}return t}(this.segments));const t=eO(iO(e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(this.points):this.points),4),n=t[0],r=t[1],i=t[2],o=t[3];return this.__boundingRect[e]={x:n||0,y:r||0,width:i-n||0,height:o-r||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 kH(e){let t=e.data,n=e._boundingRect,r=e._textBoundsFn;return null!=t&&(n||r)}class EH extends nH{constructor(){super("text"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.x,n=void 0===t?0:t,r=e.y,i=void 0===r?0:r,o=e.dx,a=void 0===o?0:o,s=e.dy,l=void 0===s?0:s,c=e.textBoundsFn,u=e.text,d=e.title,f=e.collider,h=e.boundingRect,p=e.ellipsed;super.set(e),this.attrs.x=n,this.attrs.y=i,this.attrs.dx=a,this.attrs.dy=l,this.attrs.text=u,void 0!==d&&(this.attrs.title=String(d)),"object"==typeof h?this._textBoundsFn=()=>h:"function"==typeof c&&(this._textBoundsFn=c),"string"==typeof p&&(this.ellipsed=p),this.collider=Gq({type:kH(this)?"bounds":null},f),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=aO(e),r=eO(iO(t&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(n):n),4),i=r[0],o=r[1],a=r[2],s=r[3];return this.__boundingRect[t]={x:i,y:o,width:a-i,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]}}class CH extends nH{constructor(){super("image"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.x,n=void 0===t?0:t,r=e.y,i=void 0===r?0:r,o=e.width,a=void 0===o?0:o,s=e.height,l=void 0===s?0:s,c=e.rx,u=void 0===c?0:c,d=e.ry,f=void 0===d?0:d,h=e.src,p=e.collider,m=e.cx,g=void 0===m?0:m,y=e.cy,v=void 0===y?0:y,b=e.r,x=void 0===b?0:b,S=e.opacity,M=e.imageScalingFactor,w=e.imagePosition,k=e.symbol;let E;E="circle"===e.symbol?Gq({type:"circle",cx:g,cy:v,r:x},p):Gq({type:"bounds",x:n,y:i,width:a,height:l},p),super.set(e),a>=0?(this.attrs.x=n,this.attrs.width=a):(this.attrs.x=n+a,this.attrs.width=-a),l>=0?(this.attrs.y=i,this.attrs.height=l):(this.attrs.y=i+l,this.attrs.height=-l),u>0&&(this.attrs.rx=u),f>0&&(this.attrs.ry=f),h&&(this.attrs.src=h),this.attrs.r=x,this.attrs.cx=g,this.attrs.cy=v,this.attrs.opacity=void 0!==S?S:1,this.attrs.imageScalingFactor=void 0!==M?M:1,this.attrs.imagePosition=w||"center-center",this.attrs.symbol=k||"rectangle",this.collider=E,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null},e.collider||(this.attrs.updateCollider=this.updateCollider.bind(this))}updateCollider(e){let t;t="circle"===e.symbol?Gq(this.collider,{type:"circle",cx:e.cx,cy:e.cy,r:e.r}):Gq(this.collider,{type:"bounds",x:e.x,y:e.y,width:e.width,height:e.height}),this.collider=t}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=aO(this.attrs),n=eO(iO(e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(t):t),4),r=n[0],i=n[1],o=n[2],a=n[3];return this.__boundingRect[e]={x:r,y:i,width:o-r,height:a-i},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];if("circle"===this._node.symbol){const t=this.boundingRect(e),n=Math.min(t.width,t.height)/2,r=t.x-n,i=t.y-n;let o=2*n,a=2*n,s=[{x:r,y:i},{x:r+o,y:i},{x:r+o,y:i+a},{x:r,y:i+a}];if(e&&this.modelViewMatrix){s=this.modelViewMatrix.transformPoints(s);const t=eO(iO(s),4),n=t[0],r=t[1];o=t[2]-n,a=t[3]-r,this.__bounds[e]=[{x:n,y:r},{x:n+o,y:r},{x:n+o,y:r+a},{x:n,y:r+a}]}else this.__bounds[e]=s;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 NH=mI();function TH(e,t){return NH.get(e)(t)}NH.add("rect",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new mH(...t)}),NH.add("circle",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new gH(...t)}),NH.add("text",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new EH(...t)}),NH.add("line",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new yH(...t)}),NH.add("path",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new wH(...t)}),NH.add("stage",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new sH(...t)}),NH.add("container",aH),NH.add("defs",aH),NH.add("linearGradient",dH),NH.add("radialGradient",dH),NH.add("conicGradient",dH),NH.add("stop",dH),NH.add("pattern",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new pH(...t)}),NH.add("image",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new CH(...t)});const DH=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 r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i=n(),o={};let a="";for(let t=0;t<e.length;t++)a=e[t],void 0!==i[a]&&(o[a]=i[a]);return Gq(o,r),t.push(o),n()},n.restore=function(){t.splice(t.length-1,1)},n}(["stroke","fill","strokeWidth","opacity","fontFamily","fontSize","baseline"]);function qH(e,t){if(Array.isArray(t))for(let n=0,r=t.length;n<r;n++)t[n](e)}function OH(e,t,n){e.node=n[t],e.index=t}function IH(e,t,n,r){let i=!1;const o={siblings:e,node:null,index:0};for(let a=0,s=e.length;a<s;a++){if(OH(o,a,e),qH(o,r.create),i="function"==typeof o.node.disabled?o.node.disabled():o.node.disabled,i)continue;o.node=DH.save(o.node);const s=TH(o.node.type,o.node);s&&(o.node.transform&&(n.save(),zU(o.node.transform,n)),n.isIdentity()||(s.modelViewMatrix=n.clone()),t.addChild(s),o.node.children&&IH(o.node.children,s,n,r),o.node.transform&&n.restore()),DH.restore()}}function AH(e){let t=e.items,n=e.stage,r=e.dpi,i=e.on,o=void 0===i?{}:i;return n||(n=TH("stage",r)),IH(t,n,new AU,o),n}function _H(e,t,n){const r=n.orientation,i=n.degree,o=n.stops,a=void 0===o?[]:o;let s=null;if("radial"===r){const n=t.boundingRect();s=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"===r){const t=n.startAngle||0,r=n.x||0,i=n.y||0;s=e.createConicGradient(t,r,i)}else{const r=_R(i);["x1","x2","y1","y2"].forEach(e=>{e in n&&(r[e]=n[e])});const o=t.boundingRect();s=e.createLinearGradient(o.x+r.x1*o.width,o.y+r.y1*o.height,o.x+r.x2*o.width,o.y+r.y2*o.height)}for(let e=0,t=a.length;e<t;e++){let t=a[e];s.addColorStop(t.offset,t.color)}return s}function LH(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 PH(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.x,n=e.y,r=e.width,i=e.height,o=e.scaleRatio,a=e.margin,s=e.edgeBleed;const l={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 l.x=isNaN(t)?l.x:t,l.y=isNaN(n)?l.y:n,l.width=isNaN(r)?l.width:r,l.height=isNaN(i)?l.height:i,void 0!==o&&(l.scaleRatio.x=isNaN(o.x)?l.scaleRatio.x:o.x,l.scaleRatio.y=isNaN(o.y)?l.scaleRatio.y:o.y),void 0!==a&&(l.margin.left=isNaN(a.left)?0:a.left,l.margin.top=isNaN(a.top)?0:a.top),"object"==typeof s&&["left","right","top","bottom"].forEach(e=>{!isNaN(s[e])&&s[e]>0&&(l.edgeBleed[e]=s[e],l.edgeBleed.bool=!0)}),l.computedPhysical={x:Math.round(l.margin.left+(l.x-l.edgeBleed.left)*l.scaleRatio.x),y:Math.round(l.margin.top+(l.y-l.edgeBleed.top)*l.scaleRatio.y),width:Math.round((l.width+l.edgeBleed.left+l.edgeBleed.right)*l.scaleRatio.x),height:Math.round((l.height+l.edgeBleed.top+l.edgeBleed.bottom)*l.scaleRatio.y)},l}function RH(){const e={element:()=>{},root:()=>{},settings:()=>{},appendTo:()=>{},getScene:()=>[],render:()=>!1,itemsAt:()=>[],findShapes:()=>[],clear:()=>{},destory:()=>{},size:()=>{},measureText:sV,textBounds:cV,setKey:t=>{e.element().setAttribute("data-key",t)}};return e}function FH(e){return t=>{let n=t.node;"text"===n.type&&function(e){return null!=e}(n.data)&&!n.textBoundsFn&&(n.textBoundsFn=e.textBounds)}}const zH=200,jH=200;class $H{constructor(e){this.targetCanvas=e,this.bufferCanvas=e.cloneNode()}updateSize(e){let t,n=e.rect,r=e.dpiRatio,i=e.canvasBufferSize;t=i?"function"==typeof i?i(n):i:{width:n.computedPhysical.width+2*zH,height:n.computedPhysical.height+2*jH},this.bufferCanvas.style.width="".concat(t.width,"px"),this.bufferCanvas.style.height="".concat(t.height,"px"),this.bufferCanvas.width=Math.round(t.width*r),this.bufferCanvas.height=Math.round(t.height*r)}apply(){this.targetCanvas.getContext("2d").drawImage(this.bufferCanvas,0,0)}clear(){this.bufferCanvas.width=this.bufferCanvas.width}getContext(){return this.bufferCanvas.getContext("2d")}}const VH=mI();function UH(e){return Array.isArray(e)?e:"string"==typeof e?-1!==e.indexOf(",")?e.split(","):e.split(" "):[]}function HH(e){return("undefined"==typeof window?1:window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)}function BH(e,t){t.setTransform(e[0][0],e[1][0],e[0][1],e[1][1],e[0][2],e[1][2])}function WH(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=Object.keys(r);for(let i=0,o=n.length;i<o;i++){let o=n[i];const a=o[0],s=o[1],l=o[2];if(a in t.attrs&&!(s in r)&&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=i.length;t<n;t++){const n=i[t];e[n]=r[n]}}function YH(e,t,n,r){for(let i=0,o=e.length;i<o;i++){let o=e[i],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=_H(t,o,o.attrs.fill):o.attrs.fill&&"object"==typeof o.attrs.fill&&"pattern"===o.attrs.fill.type&&(a.fillStyle=r.patterns.create(o.attrs.fill)),o.attrs.stroke&&"object"==typeof o.attrs.stroke&&"gradient"===o.attrs.stroke.type?a.strokeStyle=_H(t,o,o.attrs.stroke):o.attrs.stroke&&"object"==typeof o.attrs.stroke&&"pattern"===o.attrs.stroke.type&&(a.strokeStyle=r.patterns.create(o.attrs.stroke))),WH(t,o,n,a),o.modelViewMatrix&&BH(o.modelViewMatrix.elements,t),VH.has(o.type)&&VH.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&&YH(o.children,t,n,r),t.restore()}}function GH(){let e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:AH;const r={transform:void 0,canvasBufferSize:void 0,progressive:void 0};let i,o=!1,a=PH();const s=[["fill","fillStyle"],["stroke","strokeStyle"],["opacity","globalAlpha"],["globalAlpha","globalAlpha"],["stroke-width","lineWidth"],["stroke-linejoin","lineJoin"],["stroke-dasharray","setLineDash",UH]];let l;const c=RH();return c.element=()=>e,c.root=()=>e,c.settings=e=>(e&&Object.keys(r).forEach(t=>{void 0!==e[t]&&(r[t]=e[t])}),r),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 r.transform||t||(t=new $H(e)),n.appendChild(e),e),c.getScene=r=>{const i=HH(t&&t.getContext()||e.getContext("2d")),o=a.scaleRatio.x,s=a.scaleRatio.y,l={type:"container",children:r,transform:a.edgeBleed.bool?"translate(".concat(a.edgeBleed.left*i*o,", ").concat(a.edgeBleed.top*i*s,")"):""};return 1===i&&1===o&&1===s||(l.transform+="scale(".concat(i*o,", ").concat(i*s,")")),n({items:[l],dpi:i,on:{create:[J$(c.measureText),FH(c)]}})},c.render=n=>{if(!e)return!1;l||(l=function(e){const t=e.createElement("canvas"),n=t.getContext("2d");let r={};return{create(e){const i=e.key;return i?(r[i]=r[i]||LH(e,t,n),r[i]):LH(e,t,n)},clear(){r={}}}}(e.ownerDocument));const u=t&&t.getContext()||e.getContext("2d"),d=HH(u),f=t&&r.transform();if(f)return e.width=e.width,function(e){let t=e.el,n=e.dpiRatio,r=e.transform;if("object"==typeof r){const e=[r.horizontalScaling,r.horizontalSkewing,r.verticalSkewing,r.verticalScaling,r.horizontalMoving*n,r.verticalMoving*n];t.getContext("2d").setTransform(...e)}}({el:e,dpiRatio:d,transform:f}),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*d),e.height=Math.round(a.computedPhysical.height*d),t&&t.updateSize({rect:a,dpiRatio:d,canvasBufferSize:r.canvasBufferSize}));const h=c.getScene(n),p=!i||!h.equals(i);l.clear();const m=o||p,g="function"==typeof r.progressive&&r.progressive();return m&&(g&&!g.isFirst||c.clear(),YH(h.children,u,s,{patterns:l})),t&&(e.width=e.width,t.apply()),o=!1,g&&!g.isFirst&&h.children.unshift(...i.children),i=h,m},c.itemsAt=e=>i?i.getItemsFrom(e):[],c.findShapes=e=>i?i.findShapes(e):[],c.clear=()=>(e&&(e.width=e.width),t&&t.clear(),i=null,c),c.size=e=>{if(e){const t=PH(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),i=null},c}function KH(e,t){VH.add(e,t)}function XH(e,t){return Math.max(0,Math.min(e,t))}const JH=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼ‎ⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗＡ-Ｚａ-ｚｦ-ￜ]"),ZH=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞‏יִײַ-ﬨשׁ-ﭏ]"),QH=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]");function eB(e){return JH.test(e)}function tB(e){return ZH.test(e)||QH.test(e)}function nB(e){let t,n,r=e?e.length:0;for(t=0;t<r;t++){if(n=e[t],eB(n))return"ltr";if(tB(n))return"rtl"}return"ltr"}const rB={start:"end",end:"start",center:"center",middle:"middle"};function iB(e,t){return"rtl"===t?rB[e]:e}function oB(e,t){if(oB.cache[e])return void t(oB.cache[e]);const n=new Image;n.src=e,n.onload=()=>{oB.cache[e]=n,t(n)},n.onerror=e=>{console.error("Image load error",e)}}function aB(e,t){const n=[];let r;const i=[],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,r=t.length;e<r;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)?i.push(e[t]):a.push(e[t])}for(let e=0,t=n.length;e<t;e++)n[e].content.children&&(n[e].diff=aB([],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=aB(a[e].children||[],o[e].content.children||[]),o[e].object=a[e].object,o[e].children=o[e].diff.items;return r=o.concat(n),n.isTree=!0,i.isTree=!0,o.isTree=!0,a.isTree=!0,r.isTree=!0,{added:n,updatedNew:o,updatedOld:a,removed:i,items:r}}function sB(e,t,n){for(let r=0,i=e.length;r<i;r++)e[r].object=n(e[r].content.type,t)}function lB(e,t){for(let n=0,r=e.length;n<r;n++)null!==e[n].object&&void 0!==e[n].object&&(t(e[n].object),e[n].object=null)}function cB(e,t,n,r){let i;for(let o=0,a=e.length;o<a;o++)i=e[o],null!==i.object&&void 0!==i.object&&(n(i.object,i.content),i.diff&&(sB(i.diff.added,i.object,t),lB(i.diff.removed,r),cB(i.diff.items,t,n,r)))}function uB(e,t,n,r,i,o){const a=aB(e,t);return sB(a.added,n,r),lB(a.removed,o),cB(a.items,r,i,o),a.items}oB.cache={},KH("rect",function(e,t){let n=t.g,r=t.doFill,i=t.doStroke;n.beginPath(),e.rx>0||e.ry>0?function(e,t,n,r,i,o,a){o=XH(r/2,o>0?o:a),a=XH(i/2,a>0?a:o),e.moveTo(t,n+a),e.lineTo(t,n+i-a),e.quadraticCurveTo(t,n+i,t+o,n+i),e.lineTo(t+r-o,n+i),e.quadraticCurveTo(t+r,n+i,t+r,n+i-a),e.lineTo(t+r,n+a),e.quadraticCurveTo(t+r,n,t+r-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),r&&n.fill(),i&&n.stroke()}),KH("circle",function(e,t){let n=t.g,r=t.doFill,i=t.doStroke;n.beginPath(),n.moveTo(e.cx+e.r,e.cy),n.arc(e.cx,e.cy,e.r,0,2*Math.PI,!1),r&&n.fill(),i&&n.stroke()}),KH("line",function(e,t){let n=t.g,r=t.doStroke;n.beginPath(),n.moveTo(e.x1,e.y1),n.lineTo(e.x2,e.y2),r&&n.stroke()}),KH("path",function(e,t){let n=t.g,r=t.doStroke,i=t.doFill;const o=new Path2D(e.d);i&&n.fill(o),r&&n.stroke(o)}),KH("text",function(e,t){let n=t.g,r=t.ellipsed,i=t.doStroke;const o=r||Z$(e,sV);n.font=[e["font-style"],e["font-weight"],e["font-size"],e["font-family"]].filter(e=>!!e).join(" ");const a=nB(e.text);n.canvas.dir!==a&&(n.canvas.dir=a);const s=iB("middle"===e["text-anchor"]?"center":e["text-anchor"],n.canvas.dir);s&&n.textAlign!==s&&(n.textAlign=s);const l=Q$(e);n.fillText(o,e.x+e.dx,e.y+e.dy+l),i&&n.strokeText(o,e.x+e.dx,e.y+e.dy+l)}),KH("image",function(e,t){let n=t.g;const r=n.canvas,i=n.getTransform(),o=window.devicePixelRatio||1,a=r.clientWidth*o,s=r.clientHeight*o;r.width===a&&r.height===s||(r.width=a,r.height=s),oB(e.src,t=>{if(n.setTransform(1,0,0,1,0,0),n.clearRect(0,0,r.width,r.height),n.setTransform(i),n.globalAlpha=e.opacity,e.width||e.height||(e.width=t.naturalWidth*e.imageScalingFactor,e.height=t.naturalHeight*e.imageScalingFactor),function(e){const t=e.imagePosition||"center-center";let n=e.width,r=e.height;if("circle"===e.symbol){const t=Math.min(e.width,e.height)/2;n=2*t,r=2*t}switch(t){case"top-center":e.y-=r/2;break;case"center-left":e.x-=n/2;break;case"center-right":e.x+=n/2;break;case"top-left":e.x-=n/2,e.y-=r/2;break;case"top-right":e.x+=n/2,e.y-=r/2;break;case"bottom-left":e.x-=n/2,e.y+=r/2;break;case"bottom-right":e.x+=n/2,e.y+=r/2;break;case"bottom-center":e.y+=r/2}}(e),"circle"===e.symbol){const r=e.x,i=e.y;e.r=Math.min(e.width,e.height)/2;const o=r-e.width/2,a=i-e.height/2;n.save(),n.beginPath(),n.arc(r,i,e.r,0,2*Math.PI),n.clip(),n.drawImage(t,o,a,e.width,e.height),n.restore()}else e.x-=e.width/2,e.y-=e.height/2,n.drawImage(t,e.x,e.y,e.width,e.height);n.globalAlpha=1,e.updateCollider&&e.updateCollider(e)})});const dB="http://www.w3.org/2000/svg",fB=(e,t)=>{if(!e||"string"!=typeof e)throw new Error("Invalid type: ".concat(e));const n=t.ownerDocument.createElementNS(dB,"container"===e?"g":e);return t.appendChild(n),n},hB=e=>{e.parentNode&&e.parentNode.removeChild(e)};function pB(e){let t=e.element,n=e.attrs;return function(){const e=n.width,r=n.height,i=n.imagePosition,o=n.imageScalingFactor,a=n.symbol;let s=n.x,l=void 0===s?0:s,c=n.y,u=void 0===c?0:c,d=e>0?e:this.naturalWidth,f=r>0?r:this.naturalHeight;switch(o&&(d*=o,f*=o),i){case"top-center":u-=f/2;break;case"center-left":l-=d/2;break;case"center-right":l+=d/2;break;case"top-left":l-=d/2,u-=f/2;break;case"top-right":l+=d/2,u-=f/2;break;case"bottom-left":l-=d/2,u+=f/2;break;case"bottom-right":l+=d/2,u+=f/2;break;case"bottom-center":u+=f/2}if(t.setAttribute("width",d),t.setAttribute("height",f),t.setAttribute("x",l-d/2),t.setAttribute("y",u-f/2),t.setAttribute("preserveAspectRatio","none"),"circle"===a){const e=t.ownerSVGElement;if(!e)return;const n="clip-".concat(Math.random().toString(36).substr(2,9));if(!e.querySelector("#".concat(n))){const t=e.querySelector("defs")||e.insertBefore(document.createElementNS(dB,"defs"),e.firstChild),r=document.createElementNS(dB,"clipPath");r.setAttribute("id",n);const i=document.createElementNS(dB,"circle");i.setAttribute("cx",l),i.setAttribute("cy",u),i.setAttribute("r",Math.min(d,f)/2),r.appendChild(i),t.appendChild(r)}t.setAttribute("clip-path","url(#".concat(n,")"))}}}const mB=(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":case"image":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||Z$(t.attrs,sV);const n=nB(t.attrs.text);"rtl"===n&&(e.setAttribute("direction","rtl"),e.setAttribute("dir","rtl"),e.setAttribute("text-anchor",iB(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(dB,"title");n.textContent=t.attrs.title,e.appendChild(n)}else if("image"===t.type&&"src"===n){e.setAttributeNS("http://www.w3.org/1999/xlink","href",t.attrs.src);let n=new Image;n.src=t.attrs.src,n.onload=pB({element:e,attrs:t.attrs})}else e.setAttribute(n,t.attrs[n]);else{const r=+e.getAttribute(n)||0;let i=0;i="dominant-baseline"===n?Q$(t.attrs):t.attrs[n],e.setAttribute("dy",i+r)}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 gB{constructor(e,t,n,r){this.create=e,this.nodeCreator=t,this.nodeMaintainer=n,this.nodeDestroyer=r}render(e,t){return this.create([],e,t,this.nodeCreator,this.nodeMaintainer,this.nodeDestroyer)}}function yB(){return new gB(uB,fB,mB,hB)}function vB(e){let t,n,r,i=0;if(0===(e=JSON.stringify(e)).length)return i;for(t=0,r=e.length;t<r;t++)n=e.charCodeAt(t),i=(i<<5)-i+n,i&=i;return i}function bB(){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:dB,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:AH;const n=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:yB)();let r,i,o,a=!1,s=PH();const l={transform:void 0,disableScreenReader:!1},c=RH(),u={type:"defs",children:[]},d=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:vB,n={},r=Date.now();const i={onCreate(i){let o={};i.node&&"object"==typeof i.node.fill&&"pattern"===i.node.fill.type&&i.node.fill.shapes&&(o.fill=i.node.fill),i.node&&"object"==typeof i.node.stroke&&"pattern"===i.node.stroke.type&&i.node.stroke.shapes&&(o.stroke=i.node.stroke),Object.keys(o).forEach(a=>{let s="";const l=o[a],c=t(l),u="picasso-pattern-".concat(r,"-").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}i.node["".concat(a,"Reference")]="url('".concat(s,"#").concat(u,"')")})},clear(){n={}}};return i}(u.children),f=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:vB,n={},r=Date.now();const i={getOrCreateGradient(){let i=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(i[o]),l="picasso-gradient-".concat(r,"-").concat(s);if(!n[s]){let t=i[o],r=t.orientation,a=t.degree,c=t.stops,u=void 0===c?[]:c,d={};void 0===a&&(a=90),"radial"===r?d.type="radialGradient":(d=_R(a),["x1","x2","y1","y2"].forEach(e=>{e in i[o]&&(d[e]=i[o][e])}),d.type="linearGradient"),d.id=l,d.children=u.map(e=>{let t=e.offset,n=e.color,r=e.opacity;return{type:"stop",offset:"".concat(100*t,"%"),style:"stop-color:".concat(n,";stop-opacity:").concat(void 0!==r?r:1)}}),e.push(d),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=i.getOrCreateGradient(n,"fill",t)),n.stroke&&"object"==typeof n.stroke&&"gradient"===n.stroke.type&&(n.strokeReference=i.getOrCreateGradient(n,"stroke",t))},clear(){n={}}};return i}(u.children);return c.element=()=>r,c.root=()=>i,c.settings=e=>(e&&Object.keys(l).forEach(t=>{void 0!==e[t]&&(l[t]=e[t])}),l),c.appendTo=t=>(r||(r=t.ownerDocument.createElementNS(e,"svg"),r.style.position="absolute",r.style["-webkit-font-smoothing"]="antialiased",r.style["-moz-osx-font-smoothing"]="antialiased",r.style.pointerEvents="none",r.setAttribute("xmlns",e),i=t.ownerDocument.createElementNS(e,"g"),i.style.pointerEvents="auto",r.appendChild(i)),t.appendChild(r),r),c.getScene=e=>{const n=s.scaleRatio.x,r=s.scaleRatio.y,i={type:"container",children:Array.isArray(e)?[...e,u]:e,transform:s.edgeBleed.bool?"translate(".concat(s.edgeBleed.left*n,", ").concat(s.edgeBleed.top*r,")"):""};return 1===n&&1===r||(i.transform+="scale(".concat(n,", ").concat(r,")")),t({items:[i],on:{create:[e=>{e.node.fillReference=void 0,e.node.strokeReference=void 0},f.onCreate,d.onCreate,J$(c.measureText),FH(c)]}})},c.render=e=>{if(!r)return!1;const t="function"==typeof l.transform&&l.transform();if(t){const e=t.horizontalScaling,n=t.horizontalSkewing,r=t.verticalSkewing,o=t.verticalScaling,a=t.horizontalMoving,s=t.verticalMoving;return i.style.transform="matrix(".concat(e,", ").concat(n,", ").concat(r,", ").concat(o,", ").concat(a,", ").concat(s,")"),!0}i.style.transform="";l.disableScreenReader&&r.setAttribute("aria-hidden",!0),a&&(r.style.left="".concat(s.computedPhysical.x,"px"),r.style.top="".concat(s.computedPhysical.y,"px"),r.setAttribute("width",s.computedPhysical.width),r.setAttribute("height",s.computedPhysical.height)),f.clear(),d.clear(),u.children.length=0;const h=c.getScene(e),p=!o||!h.equals(o),m=a||p;return m&&(c.clear(),n.render(h.children,i)),a=!1,o=h,m},c.itemsAt=e=>o?o.getItemsFrom(e):[],c.findShapes=e=>o?o.findShapes(e):[],c.clear=()=>{if(!i)return c;o=null;const e=i.cloneNode(!1);return r.replaceChild(e,i),i=e,c},c.destroy=()=>{r&&r.parentNode&&r.parentNode.removeChild(r),r=null,i=null},c.size=e=>{if(e){const t=PH(e);JSON.stringify(s)!==JSON.stringify(t)&&(a=!0,s=t)}return s},c}var xB,SB,MB,wB,kB,EB,CB,NB={},TB=[],DB=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function qB(e,t){for(var n in t)e[n]=t[n];return e}function OB(e){var t=e.parentNode;t&&t.removeChild(e)}function IB(e,t,n){var r,i,o,a={};for(o in t)"key"==o?r=t[o]:"ref"==o?i=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?xB.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 AB(e,a,r,i,null)}function AB(e,t,n,r,i){var o={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==i?++MB:i};return null==i&&null!=SB.vnode&&SB.vnode(o),o}function _B(e){return e.children}function LB(e,t){this.props=e,this.context=t}function PB(e,t){if(null==t)return e.__?PB(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?PB(e):null}function RB(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 RB(e)}}function FB(e){(!e.__d&&(e.__d=!0)&&wB.push(e)&&!zB.__r++||kB!==SB.debounceRendering)&&((kB=SB.debounceRendering)||EB)(zB)}function zB(){var e,t,n,r,i,o,a,s;for(wB.sort(CB);e=wB.shift();)e.__d&&(t=wB.length,r=void 0,i=void 0,a=(o=(n=e).__v).__e,(s=n.__P)&&(r=[],(i=qB({},o)).__v=o.__v+1,GB(s,o,i,n.__n,void 0!==s.ownerSVGElement,null!=o.__h?[a]:null,r,null==a?PB(o):a,o.__h),KB(r,o),o.__e!=a&&RB(o)),wB.length>t&&wB.sort(CB));zB.__r=0}function jB(e,t,n,r,i,o,a,s,l,c){var u,d,f,h,p,m,g,y=r&&r.__k||TB,v=y.length;for(n.__k=[],u=0;u<t.length;u++)if(null!=(h=n.__k[u]=null==(h=t[u])||"boolean"==typeof h||"function"==typeof h?null:"string"==typeof h||"number"==typeof h||"bigint"==typeof h?AB(null,h,null,null,h):Array.isArray(h)?AB(_B,{children:h},null,null,null):h.__b>0?AB(h.type,h.props,h.key,h.ref?h.ref:null,h.__v):h)){if(h.__=n,h.__b=n.__b+1,null===(f=y[u])||f&&h.key==f.key&&h.type===f.type)y[u]=void 0;else for(d=0;d<v;d++){if((f=y[d])&&h.key==f.key&&h.type===f.type){y[d]=void 0;break}f=null}GB(e,h,f=f||NB,i,o,a,s,l,c),p=h.__e,(d=h.ref)&&f.ref!=d&&(g||(g=[]),f.ref&&g.push(f.ref,null,h),g.push(d,h.__c||p,h)),null!=p?(null==m&&(m=p),"function"==typeof h.type&&h.__k===f.__k?h.__d=l=$B(h,l,e):l=VB(e,h,f,y,p,l),"function"==typeof n.type&&(n.__d=l)):l&&f.__e==l&&l.parentNode!=e&&(l=PB(f))}for(n.__e=m,u=v;u--;)null!=y[u]&&("function"==typeof n.type&&null!=y[u].__e&&y[u].__e==n.__d&&(n.__d=UB(r).nextSibling),ZB(y[u],y[u]));if(g)for(u=0;u<g.length;u++)JB(g[u],g[++u],g[++u])}function $B(e,t,n){for(var r,i=e.__k,o=0;i&&o<i.length;o++)(r=i[o])&&(r.__=e,t="function"==typeof r.type?$B(r,t,n):VB(n,r,r,i,r.__e,t));return t}function VB(e,t,n,r,i,o){var a,s,l;if(void 0!==t.__d)a=t.__d,t.__d=void 0;else if(null==n||i!=o||null==i.parentNode)e:if(null==o||o.parentNode!==e)e.appendChild(i),a=null;else{for(s=o,l=0;(s=s.nextSibling)&&l<r.length;l+=1)if(s==i)break e;e.insertBefore(i,o),a=o}return void 0!==a?a:i.nextSibling}function UB(e){var t,n,r;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])&&(r=UB(n)))return r;return null}function HB(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||DB.test(t)?n:n+"px"}function BB(e,t,n,r,i){var o;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||HB(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||HB(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?r||e.addEventListener(t,o?YB:WB,o):e.removeEventListener(t,o?YB:WB,o);else if("dangerouslySetInnerHTML"!==t){if(i)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 WB(e){return this.l[e.type+!1](SB.event?SB.event(e):e)}function YB(e){return this.l[e.type+!0](SB.event?SB.event(e):e)}function GB(e,t,n,r,i,o,a,s,l){var c,u,d,f,h,p,m,g,y,v,b,x,S,M,w,k=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=SB.__b)&&c(t);try{e:if("function"==typeof k){if(g=t.props,y=(c=k.contextType)&&r[c.__c],v=c?y?y.props.value:c.__:r,n.__c?m=(u=t.__c=n.__c).__=u.__E:("prototype"in k&&k.prototype.render?t.__c=u=new k(g,v):(t.__c=u=new LB(g,v),u.constructor=k,u.render=QB),y&&y.sub(u),u.props=g,u.state||(u.state={}),u.context=v,u.__n=r,d=u.__d=!0,u.__h=[],u._sb=[]),null==u.__s&&(u.__s=u.state),null!=k.getDerivedStateFromProps&&(u.__s==u.state&&(u.__s=qB({},u.__s)),qB(u.__s,k.getDerivedStateFromProps(g,u.__s))),f=u.props,h=u.state,u.__v=t,d)null==k.getDerivedStateFromProps&&null!=u.componentWillMount&&u.componentWillMount(),null!=u.componentDidMount&&u.__h.push(u.componentDidMount);else{if(null==k.getDerivedStateFromProps&&g!==f&&null!=u.componentWillReceiveProps&&u.componentWillReceiveProps(g,v),!u.__e&&null!=u.shouldComponentUpdate&&!1===u.shouldComponentUpdate(g,u.__s,v)||t.__v===n.__v){for(t.__v!==n.__v&&(u.props=g,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)}),b=0;b<u._sb.length;b++)u.__h.push(u._sb[b]);u._sb=[],u.__h.length&&a.push(u);break e}null!=u.componentWillUpdate&&u.componentWillUpdate(g,u.__s,v),null!=u.componentDidUpdate&&u.__h.push(function(){u.componentDidUpdate(f,h,p)})}if(u.context=v,u.props=g,u.__P=e,x=SB.__r,S=0,"prototype"in k&&k.prototype.render){for(u.state=u.__s,u.__d=!1,x&&x(t),c=u.render(u.props,u.state,u.context),M=0;M<u._sb.length;M++)u.__h.push(u._sb[M]);u._sb=[]}else do{u.__d=!1,x&&x(t),c=u.render(u.props,u.state,u.context),u.state=u.__s}while(u.__d&&++S<25);u.state=u.__s,null!=u.getChildContext&&(r=qB(qB({},r),u.getChildContext())),d||null==u.getSnapshotBeforeUpdate||(p=u.getSnapshotBeforeUpdate(f,h)),w=null!=c&&c.type===_B&&null==c.key?c.props.children:c,jB(e,Array.isArray(w)?w:[w],t,n,r,i,o,a,s,l),u.base=t.__e,t.__h=null,u.__h.length&&a.push(u),m&&(u.__E=u.__=null),u.__e=!1}else null==o&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=XB(n.__e,t,n,r,i,o,a,l);(c=SB.diffed)&&c(t)}catch(e){t.__v=null,(l||null!=o)&&(t.__e=s,t.__h=!!l,o[o.indexOf(s)]=null),SB.__e(e,t,n)}}function KB(e,t){SB.__c&&SB.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){SB.__e(e,t.__v)}})}function XB(e,t,n,r,i,o,a,s){var l,c,u,d=n.props,f=t.props,h=t.type,p=0;if("svg"===h&&(i=!0),null!=o)for(;p<o.length;p++)if((l=o[p])&&"setAttribute"in l==!!h&&(h?l.localName===h:3===l.nodeType)){e=l,o[p]=null;break}if(null==e){if(null===h)return document.createTextNode(f);e=i?document.createElementNS("http://www.w3.org/2000/svg",h):document.createElement(h,f.is&&f),o=null,s=!1}if(null===h)d===f||s&&e.data===f||(e.data=f);else{if(o=o&&xB.call(e.childNodes),c=(d=n.props||NB).dangerouslySetInnerHTML,u=f.dangerouslySetInnerHTML,!s){if(null!=o)for(d={},p=0;p<e.attributes.length;p++)d[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,r,i){var o;for(o in n)"children"===o||"key"===o||o in t||BB(e,o,null,n[o],r);for(o in t)i&&"function"!=typeof t[o]||"children"===o||"key"===o||"value"===o||"checked"===o||n[o]===t[o]||BB(e,o,t[o],n[o],r)}(e,f,d,i,s),u)t.__k=[];else if(p=t.props.children,jB(e,Array.isArray(p)?p:[p],t,n,r,i&&"foreignObject"!==h,o,a,o?o[0]:n.__k&&PB(n,0),s),null!=o)for(p=o.length;p--;)null!=o[p]&&OB(o[p]);s||("value"in f&&void 0!==(p=f.value)&&(p!==e.value||"progress"===h&&!p||"option"===h&&p!==d.value)&&BB(e,"value",p,d.value,!1),"checked"in f&&void 0!==(p=f.checked)&&p!==e.checked&&BB(e,"checked",p,d.checked,!1))}return e}function JB(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){SB.__e(e,n)}}function ZB(e,t,n){var r,i;if(SB.unmount&&SB.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||JB(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){SB.__e(e,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&ZB(r[i],t,n||"function"!=typeof e.type);n||null==e.__e||OB(e.__e),e.__=e.__e=e.__d=void 0}function QB(e,t,n){return this.constructor(e,n)}function eW(){const e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).createElement,t=void 0===e?document.createElement.bind(document):e;let n,r,i=PH();const o={transform:void 0,disableScreenReader:!1},a=RH();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 e=t.horizontalScaling,r=t.horizontalSkewing,i=t.verticalSkewing,o=t.verticalScaling,a=t.horizontalMoving,s=t.verticalMoving;return n.style.transform="matrix(".concat(e,", ").concat(r,", ").concat(i,", ").concat(o,", ").concat(a,", ").concat(s,")"),!0}n.style.transform="";let a;return o.disableScreenReader&&n.setAttribute("aria-hidden",!0),n.style.left="".concat(i.computedPhysical.x,"px"),n.style.top="".concat(i.computedPhysical.y,"px"),n.style.width="".concat(i.computedPhysical.width,"px"),n.style.height="".concat(i.computedPhysical.height,"px"),a=Array.isArray(e)?IB("div",null,e):e,r=function(e,t,n){var r,i,o;SB.__&&SB.__(e,t),i=(r="function"==typeof n)?null:n&&n.__k||t.__k,o=[],GB(t,e=(!r&&n||t).__k=IB(_B,null,[e]),i||NB,NB,void 0!==t.ownerSVGElement,!r&&n?[n]:i?null:t.firstChild?xB.call(t.childNodes):null,o,!r&&n?n:i?i.__e:t.firstChild,r),KB(o,e)}(a,n,r),!0},a.renderArgs=[IB],a.clear=()=>{if(n){let e=n.firstChild;for(;e;)n.removeChild(e),e=n.firstChild;r=null}return a},a.destroy=()=>{n&&n.parentElement&&n.parentElement.removeChild(n),n=null,r=null},a.size=e=>(e&&(i=PH(e)),i),a}xB=TB.slice,SB={__e:function(e,t,n,r){for(var i,o,a;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(e)),a=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,r||{}),a=i.__d),a)return i.__E=i}catch(t){e=t}throw e}},MB=0,LB.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=qB({},this.state),"function"==typeof e&&(e=e(qB({},n),this.props)),e&&qB(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),FB(this))},LB.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),FB(this))},LB.prototype.render=_B,wB=[],EB="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,CB=function(e,t){return e.__v.__b-t.__v.__b},zB.__r=0;var tW=[function(e){e.renderer("svg",bB)},function(e){e.renderer("canvas",GH)},function(e){e.renderer("dom",eW)}];const nW={OFF:0,ERROR:1,WARN:2,INFO:3,DEBUG:4};const rW=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.level,n=void 0===t?nW.OFF:t,r=e.pipe,i=void 0===r?console:r,o=n;const a={[nW.OFF]:()=>{},[nW.ERROR]:function(){return i.error(...arguments)},[nW.WARN]:function(){return i.warn(...arguments)},[nW.INFO]:function(){return i.info(...arguments)},[nW.DEBUG]:function(){return i.log(...arguments)}},s=function(e){if(e&&!(o<e)){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];(a[e]||a[nW.DEBUG])(...n)}};return{log:s,error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return s(nW.ERROR,...t)},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return s(nW.WARN,...t)},info:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return s(nW.INFO,...t)},debug:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return s(nW.DEBUG,...t)},level:e=>("number"==typeof e&&(o=e),o),LOG_LEVEL:nW}}(t.logger),i={component:mI(n.component,"component",r),data:mI(n.data,"data",r),formatter:mI(n.formatter,"formatter",r),interaction:mI(n.interaction,"interaction",r),renderer:nz(n.renderer),scale:mI(n.scale,"scale",r),symbol:mI(n.symbol,"symbol",r),logger:r};function o(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e({palettes:t.palettes.concat(n.palettes||[]),style:Gq({},t.style,n.style),logger:n.logger||t.logger,renderer:n.renderer||t.renderer},i)}return t.renderer&&t.renderer.prio&&i.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]:{},i)},o.chart=e=>tz(e,{registries:i,logger:r,style:t.style,palettes:t.palettes}),o.config=()=>t,Object.keys(i).forEach(e=>{o[e]=i[e]}),o.version=Kq,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:rz,data:lz,formatter:z_,interaction:cz,renderer:nz(),scale:jP,symbol:WR});function iW(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function oW(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 r=n.call(e,t);if("object"!=typeof r)return r;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 aW(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function sW(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?aW(Object(n),!0).forEach(function(t){oW(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aW(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function lW(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 r,i,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t);else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return iW(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)?iW(e,t):void 0}}(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.")}()}yU.forEach(rW.use),tW.forEach(rW.use),[].forEach(rW.use);var cW=Object.prototype.hasOwnProperty,uW=Object.prototype.toString,dW=Object.defineProperty,fW=Object.getOwnPropertyDescriptor,hW=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===uW.call(e)},pW=function(e){if(!e||"[object Object]"!==uW.call(e))return!1;var t,n=cW.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&cW.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||cW.call(e,t)},mW=function(e,t){dW&&"__proto__"===t.name?dW(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},gW=function(e,t){if("__proto__"===t){if(!cW.call(e,t))return;if(fW)return fW(e,t).value}return e[t]},yW=function e(){var t,n,r,i,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)r=gW(s,n),s!==(i=gW(t,n))&&(u&&i&&(pW(i)||(o=hW(i)))?(o?(o=!1,a=r&&hW(r)?r:[]):a=r&&pW(r)?r:{},mW(s,{name:n,newValue:e(u,a,i)})):void 0!==i&&mW(s,{name:n,newValue:i}));return s};function vW(e,t,n,r){if(!e)return-1;const i=n.cache,o=e.origin?e.origin():null;o&&(e=o);let a=i.fields.indexOf(e),s=-1,l=-1;if(-1===a)for(let t=0;t<i.wrappedFields.length;t++)if(l=i.wrappedFields[t].attrDims.map(e=>e.instance).indexOf(e),s=i.wrappedFields[t].attrExps.map(e=>e.instance).indexOf(e),-1!==l||-1!==s){a=t;break}if(Array.isArray(r)&&r.some((e,t)=>e!==t)){const e=r.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 bW(e,t,n){let r=n.key;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function xW(e){let t=e.cache,n=e.f,r=e.mainCell,i=e.p,o=e.page,a=e.rowIdx,s=e.row,l=e.sourceKey,c=e.target,u=e.targetProp,d=e.columnOrder,f=r;if(i.field&&i.field!==n){const e=vW(i.field,o,{cache:t},d);if(-1===e)return;f=yW({qRow:a},e(s))}c[u]=bW(i,f,{key:l})}function SW(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let e=0;e<i.length;e++)if(void 0!==i[e].field){const a=t.raw(),s=t.key(),l="object"==typeof i[e].field?i[e].field:t.field(i[e].field),c=r.normalizeConfig(i[e],t),u=c.props,d=c.main,f=Object.keys(u),h=!!i[e].trackBy,p=typeof i[e].trackBy,m={},g=[],y=[];for(let t=0;t<a.qDataPages.length;t++){const o=vW(l,a.qDataPages[t],{cache:n},a.qColumnOrder);if(-1!==o)for(let c=0;c<a.qDataPages[t].qMatrix.length;c++){const v=a.qDataPages[t].qArea.qTop+c,b=yW({qRow:v},o(a.qDataPages[t].qMatrix[c])),x=bW(d,b,{key:s});if(!(d.filter&&!d.filter(b))){for(let e=0;e<f.length;e++){const r=u[f[e]];let i=r.fields||[r];r.fields&&(x[f[e]]=[]);for(let o=0;o<i.length;o++)xW({cache:n,f:l,mainCell:b,p:i[o],prop:f[e],page:a.qDataPages[t],rowIdx:v,row:a.qDataPages[t].qMatrix[c],sourceKey:s,target:r.fields?x[f[e]]:x,targetProp:r.fields?o:f[e],columnOrder:a.qColumnOrder});if(r.fields){const t=x[f[e]].map(e=>e.value),n=x[f[e]].map(e=>e.label);x[f[e]]={value:"function"==typeof r.value?r.value(t):void 0!==r.value?r.value:t,label:"function"==typeof r.label?r.label(n):void 0!==r.label?String(r.label):String(x[f[e]].value)}}}h&&r.track({cfg:i[e],itemData:b,obj:x,target:g,tracker:m,trackType:p}),y.push(x)}}}const v=h?r.collect(g,{main:d,propsArr:f,props:u}):y;o=[...o,...v]}return o}function MW(e){var t=0,n=e.children,r=n&&n.length;if(r)for(;--r>=0;)t+=n[r].value;else t=1;e.value=t}function wW(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=EW)):void 0===t&&(t=kW);for(var n,r,i,o,a,s=new TW(e),l=[s];n=l.pop();)if((i=t(n.data))&&(a=(i=Array.from(i)).length))for(n.children=i,o=a-1;o>=0;--o)l.push(r=i[o]=new TW(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(NW)}function kW(e){return e.children}function EW(e){return Array.isArray(e)?e[1]:null}function CW(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function NW(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function TW(e){this.data=e,this.depth=this.height=0,this.parent=null}function DW(e){return null==e?null:function(e){if("function"!=typeof e)throw new Error;return e}(e)}TW.prototype=wW.prototype={constructor:TW,count:function(){return this.eachAfter(MW)},each:function(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this},eachAfter:function(e,t){for(var n,r,i,o=this,a=[o],s=[],l=-1;o=a.pop();)if(s.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r]);for(;o=s.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,r,i=this,o=[i],a=-1;i=o.pop();)if(e.call(t,i,++a,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this},find:function(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r},sum:function(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})},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(),r=t.ancestors(),i=null;e=n.pop(),t=r.pop();for(;e===t;)i=e,e=n.pop(),t=r.pop();return i}(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r},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 wW(this).eachBefore(CW)},[Symbol.iterator]:function*(){var e,t,n,r,i=this,o=[i];do{for(e=o.reverse(),o=[];i=e.pop();)if(yield i,t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n])}while(o.length)}};var qW={depth:-1},OW={},IW={};function AW(e){return e.id}function _W(e){return e.parentId}function LW(){var e,t=AW,n=_W;function r(r){var i,o,a,s,l,c,u,d,f=Array.from(r),h=t,p=n,m=new Map;if(null!=e){const t=f.map((t,n)=>function(e){e=`${e}`;let t=e.length;RW(e,t-1)&&!RW(e,t-2)&&(e=e.slice(0,-1));return"/"===e[0]?e:`/${e}`}(e(t,n,r))),n=t.map(PW),i=new Set(t).add("");for(const e of n)i.has(e)||(i.add(e),t.push(e),n.push(PW(e)),f.push(IW));h=(e,n)=>t[n],p=(e,t)=>n[t]}for(a=0,i=f.length;a<i;++a)o=f[a],c=f[a]=new TW(o),null!=(u=h(o,a,r))&&(u+="")&&(d=c.id=u,m.set(d,m.has(d)?OW:c)),null!=(u=p(o,a,r))&&(u+="")&&(c.parent=u);for(a=0;a<i;++a)if(u=(c=f[a]).parent){if(!(l=m.get(u)))throw new Error("missing: "+u);if(l===OW)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===IW&&1===s.children.length;)s=s.children[0],--i;for(let e=f.length-1;e>=0&&(c=f[e]).data===IW;--e)c.data=null}if(s.parent=qW,s.eachBefore(function(e){e.depth=e.parent.depth+1,--i}).eachBefore(NW),s.parent=null,i>0)throw new Error("cycle");return s}return r.id=function(e){return arguments.length?(t=DW(e),r):t},r.parentId=function(e){return arguments.length?(n=DW(e),r):n},r.path=function(t){return arguments.length?(e=DW(t),r):e},r}function PW(e){let t=e.length;if(t<2)return"";for(;--t>1&&!RW(e,t););return e.slice(0,t)}function RW(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(!(1&n))return!0}return!1}function FW(e,t){"/"===e.charAt(0)&&(e=e.substring(1));const n=e.split("/");let r,i=t;for(let e=0;e<n.length;e++){if("*"===n[e]&&Array.isArray(i)){const t=[];r=n.slice(e+1).join("/");for(let e=0;e<i.length;e++){let n=FW(r,i[e]);Array.isArray(n)?t.push(...n):t.push(n)}return t}if(!n[e]&&Array.isArray(i)){const t=new Array(i.length);r=n.slice(e+1).join("/");for(let e=0;e<i.length;e++)t[e]=FW(r,i[e]);return t}n[e]in i&&(i=i[n[e]])}return i}function zW(e,t,n){let r=[];if(!e||!e.length)return r;if(t<=0){const t=n>=0?[e[n]]:e;r=[...r,...t]}else for(let i=0;i<e.length;i++)e[i].children&&e[i].children.length&&(r=[...r,...zW(e[i].children,t-1,n)]);return r}function jW(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 r=Math.max(0,Math.min(100,t-e));return e=>zW(e.children,r-1,n)}return!1}const $W=/^qDimensionInfo(?:\/(\d+))?/,VW=/^\/?qMeasureInfo\/(\d+)/,UW=/\/qAttrExprInfo\/(\d+)/,HW=/\/qAttrDimInfo\/(\d+)/;function BW(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 WW(e,t){let n=t.cube;if(!e)return-1;let r=e.origin&&e.origin()?e.origin().key():e.key(),i=!1,o=-1,a=-1,s=-1,l=-1,c=-1,u=-1,d=r;const f=n.qEffectiveInterColumnSortOrder,h=BW(n);return $W.test(d)&&(i=!0,o=+$W.exec(d)[1],d=r.replace($W,"")),VW.test(d)&&("K"===n.qMode?c=+VW.exec(d)[1]:f&&-1!==f.indexOf(-1)?(c=+VW.exec(d)[1],u=0):u=+VW.exec(d)[1],d=d.replace(VW,"")),d&&(HW.exec(d)?s=+HW.exec(d)[1]:UW.exec(d)&&(a=+UW.exec(d)[1])),l=i?"S"===n.qMode?h[o]:f?f.indexOf(o):o:f&&-1!==f.indexOf(-1)?f.indexOf(-1):n.qDimensionInfo.length-("K"===n.qMode?0:1),{fieldDepth:l+1,pseudoMeasureIndex:c,measureIdx:u,attrDimIdx:s,attrIdx:a}}function YW(e,t){let n,r,i=jW(e.fieldDepth,t.fieldDepth,t.pseudoMeasureIndex);return n=t.measureIdx>=0?e=>e.data.qValues[t.measureIdx]:e=>e.data,t.attrDimIdx>=0?r=e=>{var n;return null==e||null===(n=e.qAttrDims)||void 0===n?void 0:n.qValues[t.attrDimIdx]}:t.attrIdx>=0&&(r=e=>{var n;return null==e||null===(n=e.qAttrExps)||void 0===n?void 0:n.qValues[t.attrIdx]}),{nodeFn:i,attrFn:r,valueFn:n}}function GW(e,t,n){let r=n.key;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function KW(e){let t=e.propsArr,n=e.props,r=e.item,i=e.itemData,o=e.ret,a=e.sourceKey;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 d=l[n];let f,h,p,m,g,y;if("primitive"===d.type?(p=d.value,y=String(d.value)):("function"==typeof d.value&&(f=e=>d.value(e,r)),"function"==typeof d.label&&(h=e=>d.label(e,r)),d.accessor?(m=d.accessor(r),Array.isArray(m)?(g=m.map(d.valueAccessor),d.attrAccessor&&(g=g.map(d.attrAccessor)),f&&(p=g.map(f),f=null),h&&(y=g.map(h),h=null),p=d.reduce?d.reduce(p):p,y=d.reduceLabel?d.reduceLabel(y,p):String(p)):(p=d.attrAccessor?d.attrAccessor(d.valueAccessor(m)):d.valueAccessor(m),y=p)):(p=i,y=i)),s.fields){const e=f?f(p):p;c.push(e),u.push(h&&null!=y?h(y):null!=y?y:String(e))}else{const n=f?f(p):p;o[t[e]]={value:n,label:h?h(y):null!=y?y:String(n)},d.field&&(o[t[e]].source={field:d.field.key(),key:a})}}c&&(o[t[e]]={value:"function"==typeof s.value?s.value(c,r):c,label:"function"==typeof s.label?s.label(u,r):u})}}const XW=(e,t,n)=>{const r="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",i="K"===e.qMode?"qSubNodes":"qNodes",o=FW(r,e);return o&&o[0]?(t.tree=wW(o[0],n.children||(e=>e[i])),t.tree):null};const JW=e=>{let t=e.propsArr,n=e.props,r=e.cube;e.cache;let i=e.itemDepthObject,o=e.f;for(let e=0;e<t.length;e++){const a=n[t[e]],s=a.fields?a.fields:[a];for(let e=0;e<s.length;e++){const t=s[e];if(t.field!==o){const e=YW(i,WW(t.field,{cube:r}));t.accessor=e.nodeFn,t.valueAccessor=e.valueFn,t.attrAccessor=e.attrFn}}}};function ZW(){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,r=arguments.length>3?arguments[3]:void 0;const i=t.raw(),o=t.key(),a="S"===i.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),r=e.fields(),i=e.fields().filter(e=>"dimension"===e.type()).map(e=>n.indexOf(r.indexOf(e))),o=e.fields().filter(e=>"measure"===e.type()).map(e=>n.indexOf(r.indexOf(e))),a={__root:{__id:"__root",qValues:[]}};for(let e=0;e<t.length;e++){const n=t[e];let r="__root",l=!1;for(let e=0;e<i.length;e++){var s;const t=n[i[e]],o="".concat(r,"__").concat(null!==(s=t.qElemNumber)&&void 0!==s?s:t.qElemNo);a[o]||(a[o]=sW({__id:o,__parent:r,qValues:[]},t),l=!0),r=o}if(l)for(let e=0;e<o.length;e++){const t=n[o[e]];a[r].qValues.push(t)}}const l=Object.keys(a).map(e=>a[e]),c=LW().id(e=>e.__id).parentId(e=>e.__parent)(l);return c}(t):XW(i,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"===i.qMode){let e=BW(i)[o-1];a=n.fields[e]}else{let e=i.qEffectiveInterColumnSortOrder[o-1];o>i.qEffectiveInterColumnSortOrder.length&&(e=i.qDimensionInfo.length),a=n.fields[e]}const s=r.normalizeConfig(sW(sW({},e),{},{field:a?a.key():void 0}),t),c=s.props,u=s.main,d=Object.keys(c);l[o]={propsArr:d,props:c,main:u};const f=a?WW(a,{cube:i}):{fieldDepth:0};JW({propsArr:d,props:c,cube:i,cache:n,itemDepthObject:f,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,r=l[u[e].depth].main,i=c[e],a=i.data,s=GW(r,a,{key:o});KW({propsArr:t,props:n,item:i,itemData:a,ret:s,sourceKey:o}),u[e].data=s}return a}function QW(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let a=0;a<i.length;a++)if(void 0!==i[a].field){const s=t.raw(),l=t.key();if(!XW(s,n,e))continue;const c="object"==typeof i[a].field?i[a].field:t.field(i[a].field),u=r.normalizeConfig(i[a],t),d=u.props,f=u.main,h=Object.keys(d),p=WW(c,{cube:s}),m=YW({fieldDepth:0},p),g=m.nodeFn,y=m.attrFn,v=m.valueFn;JW({propsArr:h,props:d,cube:s,cache:n,itemDepthObject:p,f:c});const b=!!i[a].trackBy,x=typeof i[a].trackBy,S={},M=[],w=g(n.tree),k=[];for(let e=0;e<w.length;e++){const t=w[e],n=y?y(v(t)):v(t);if(f.filter&&!f.filter(n))continue;const o=GW(f,n,{key:l});KW({propsArr:h,props:d,item:t,itemData:n,ret:o,sourceKey:l}),b&&r.track({cfg:i[a],itemData:n,obj:o,target:M,tracker:S,trackType:x}),k.push(o)}const E=b?r.collect(M,{main:f,propsArr:h,props:d}):k;o=[...o,...E]}return o}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var eY=function(e,t){return e(t={exports:{}},t.exports),t.exports}(function(e){
/*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,c,u,d,f=e.length,h=e.search(/[0-9\-\+#]/),p=h>0?e.substring(0,h):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),y=f-g,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=g>0?e.substring(b,f):"";if(n=(t="-"===(e=e.substring(h,b)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),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(m="",y=(d=t[0]).length%l,f=d.length,b=0;b<f;b++)m+=d.charAt(b),!((b-y+1)%l)&&b<f-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),p+(n?"-":"")+r+x}});function tY(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const nY={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"},rY=/%\)?$/,iY=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,oY=/^\(oct\)/i,aY=/^\(dec\)/i,sY=/^\(hex\)/i,lY=/^\(bin\)/i,cY=/^\(rom\)/i,uY=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,dY=/#|0/g;function fY(e,t,n,r){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(".",r||".")}function hY(e,t,n){let r;return iY.test(t)?e=fY(e,Number(/\d{2}/.exec(t)[0]),t,n):oY.test(t)?e=fY(e,8,t,n):aY.test(t)?e=fY(e,10,t,n):sY.test(t)?e=fY(e,16,t,n):lY.test(t)?e=fY(e,2,t,n):cY.test(t)&&(r="",e<0&&(r="-",e=-e),0===(e=Math.floor(e))?e="0":e<=5e5?(e=function(e,t){let n,r="",i=Number(String(e).slice(-3)),o=(e-i)/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(;i>0;)for(n=0;n<a.length;n++)if(a[n]<=i){r+=s[n],i-=a[n];break}for(n=0;n<o;n++)r="M".concat(r);return t[1]!==t[1].toUpperCase()&&(r=r.toLowerCase()),r}(e,t),e=r+e):e=t+r+e.toExponential(0)),e}function pY(e,t,n){const r=tY(e);return n?r:new RegExp(r||"",t)}function mY(e,t,n,r){let i,o,a,s,l,c,u,d,f,h=e.pattern;var p,m;r&&(e.abbreviate=!0),p=t,(m=n)&&(m=tY(m)),p&&(p=tY(p)),f=new RegExp("(?:[#0]+".concat(p,")?[#0]+(?:").concat(m,"[#0]+)?")),a=h.match(f),a=a?a[0]:"",s=a?h.substr(0,h.indexOf(a)):h,l=a?h.substring(h.indexOf(a)+a.length):"",a||(a=h?"#":"##########"),t&&t===n&&(i=a.split(n),o=i.pop(),a=i.join("")+n+o,t=""),c=t,t=/,/.test(n)?"¤":",",c&&(a=a.replace(pY(c,"g"),t)),u=n,n=".",u&&(a=a.replace(pY(u,"g"),n)),d=a.match(/#/g),d=d?d.length:0;const g=h.split(u);let y;g[1]&&(y=g[1].match(dY)),e.prefix=s||"",e.postfix=l||"",e.pattern=h,e.maxPrecision=y?y.length:2,e.percentage=rY.test(h),e.numericPattern=a||"",e.numericRegex=new RegExp("".concat(pY(t,null,!0),"|").concat(pY(n,null,!0)),"g"),e.groupTemp=c,e.decTemp=u,e.t=t,e.d=n,e.temp=d}class gY{constructor(e,t,n,r,i){this.localeInfo=e,this.pattern=t,this.thousandDelimiter=n||",",this.decimalDelimiter=r||".",this.type=i||"numeric",this.patternSeparator=";",this.abbreviations=function(e,t){if(!e||!e.qNumericalAbbreviation)return nY;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 gY(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return e.subtype=this.subtype,e}format(e,t,n,r){return this.prepare(t,n,r),this.formatValue(e)}prepare(e,t,n){let r;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:""}},r=this._prepared,e=e.split(this.patternSeparator),r.positive.pattern=e[0],r.negative.pattern=e[1],r.zero.pattern=e[2],uY.test(e[0])&&(r.positive.isFunctional=!0),e[1]?uY.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?uY.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1;const i="U"===this.type;r.positive.isFunctional||mY(r.positive,t,n,i),r.negative&&!r.negative.isFunctional&&mY(r.negative,t,n,i),r.zero&&!r.zero.isFunctional&&mY(r.zero,t,n,i)}formatValue(e){let t,n,r,i,o,a,s,l,c,u=this._prepared,d="",f="",h=e;if(isNaN(e))return"".concat(h);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=hY(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 r,i,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&&(r=t[s-1]),r&&n>0&&r>0?i=r:(n<0&&r<0||!r)&&(o<0&&o-n<=u.maxPrecision?i=o:r<=n&&!(o>0&&-n<=u.maxPrecision)&&(i=r)),i&&(d=this.abbreviations[i],e/=10**i)}if(r=Math.abs(e),t=u.temp,l=u.numericPattern,c=l.split(o)[1],"I"===this.type&&(e=Math.round(e)),i=e,c||"#"!==l.slice(-1)[0])if(r>=1e15||r>0&&r<=1e-14)e=r?r.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=eY(n,t)||"0",c){const t=Math.max(0,Math.min(14,c.length)),n=c.replace(/#+$/,"").length;let i=("I"===this.type?0:r%1+1e-15).toFixed(t).slice(2).replace(/0+$/,"");for(s=i.length;s<n;s++)i+="0";i&&(e+=o+i)}else 0===t&&(i=0)}else if(r>=10**t||r<1||r<1e-4)0===e?e="0":r<1e-4||r>=1e20?(e=(e=i.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),f=""):(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(r)/Math.log(10)))),s=0;s<t;s++)l+="#";e=eY(l,e)}e=e.replace(u.numericRegex,e=>e===a?u.groupTemp:e===o?u.decTemp:""),i<0&&!/^-/.test(e)&&(e="-".concat(e))}return u.prefix+e+f+d+u.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function yY(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=t.size,r=void 0===n?5e3:n,i=t.multipleArguments,o=void 0!==i&&i,a=t.toKey,s=void 0===a?e=>e:a;let l,c,u=Object.create(null),d=Object.create(null),f=0,h=0;return l=o?function(){return c=s(...arguments),l.has(c)?l.get(c):l.set(c,e(...arguments))}:t=>(c=s(t),l.has(c)?l.get(c):l.set(c,e(t))),l.set=(e,t)=>(f>=r&&(delete u[d[h]],delete d[h],f--,h++),u[e]=t,d[f]=e,f++,t),l.get=e=>u[e],l.has=e=>e in u,l.clear=()=>{u=Object.create(null),d=Object.create(null),f=0,h=0},l.size=()=>f,l}function vY(e,t,n,r,i){const o=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new gY(...t)}(i,e,t,n,r),a=yY(o.formatValue.bind(o),{toKey:e=>isNaN(e)?e:+e});function s(e){return a(e)}return s.format=function(e,t,n,r){return a.clear(),o.format(t,e,n,r)},s.pattern=function(e){return e&&(a.clear(),o.pattern=e,o.prepare()),o.pattern},s}const bY="D",xY="T",SY="TS",MY="IV",wY=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],kY=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],EY=["January","February","March","April","May","June","July","August","September","October","November","December"],CY=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function NY(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function TY(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}function DY(e,t){let n,r=function(e){const t=e,n=24*TY(t),r=60*TY(n),i=60*TY(r),o=1e3*TY(i);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(r),s:Math.floor(i),f:Math.round(o)}}(e),i=r.d,o=r.h,a=r.m,s=r.s,l=r.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*i),/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:i,h:o,m:a,s:s,f:l,t:u}}class qY{constructor(e,t,n){const r=e||{};if(r.qCalendarStrings||(r.qCalendarStrings={qLongDayNames:wY,qDayNames:kY,qLongMonthNames:EY,qMonthNames:CY}),this.localeInfo=r,this.locale_days=r.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=r.qCalendarStrings.qDayNames.slice(),this.locale_months=r.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=r.qCalendarStrings.qMonthNames.slice(),!t){t={[xY]:r.qTimeFmt||"hh:mm:ss",[bY]:r.qDateFmt||"YYYY-MM-DD",[SY]:r.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]}this.pattern=t}clone(){const e=new qY(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 r;e instanceof Date?r=function(e,t){let n=e.getUTCHours(),r=e.getUTCDay()-1;return t&&(n%=12,n||(n=12)),r<0&&(r=6),{year:e.getUTCFullYear(),month:e.getUTCMonth(),day:r,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)),r=DY(e,t));const i=function(e,t){return{"Y+|y+":{Y:"".concat(Number("".concat(t.year).slice(-2))),YY:NY("".concat(t.year).slice(-2),2),YYY:NY("".concat(t.year).slice(-3),3),def:e=>NY("".concat(t.year),e.length)},"M+":{M:t.month+1,MM:NY("".concat(t.month+1),2),MMM:e.locale_months_abbr[t.month],def:e.locale_months[t.month]},"W+|w+":{W:t.day,WW:NY("".concat(t.day),2),WWW:e.locale_days_abbr[t.day],def:e.locale_days[t.day]},"D+|d+":{D:t.date,def:e=>NY("".concat(t.date),e.length)},"h+|H+":{h:t.h,def:e=>NY("".concat(t.h),e.length)},"m+":{m:t.m,def:e=>NY("".concat(t.m),e.length)},"s+|S+":{s:t.s,def:e=>NY("".concat(t.s),e.length)},"f+|F+":{def(e){let n="".concat(t.f),r=e.length-n.length;if(r>0)for(let e=0;e<r;e++)n+="0";else r<0&&(n=n.slice(0,e.length));return n}},"t{1,2}|T{1,2}":{def(e){let n=t.t;return e[0].toUpperCase()===e[0]&&(n=n.toUpperCase()),n=n.slice(0,e.length),n}}}}(this,r),o=[];for(const e in i)Object.prototype.hasOwnProperty.call(i,e)&&o.push(e);const a=new RegExp(o.join("|"),"g"),s=t.replace(a,e=>{let t,n,r;for(n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&(t=new RegExp(n),t.test(e)))break;if(!t)return"";for(const t in i[n])if(t===e||t.toLowerCase()===e){r=i[n][t],void 0===r&&(r=i[n][t.toLowerCase()]);break}return void 0===r&&(r=i[n].def),"function"==typeof r&&(r=r(e)),r});return s}}function OY(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new qY(...t)}function IY(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=OY(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),r=yY(n.format.bind(n),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function i(e){return t!==MY?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=i(e),r(e)}return o.format=function(e,t){return r.clear(),t=i(t),n.format(t,e)},o.locale=function(i){return n=OY(i,e,t),r=yY(n.format.bind(n),{toKey:e=>"object"==typeof e?e.getTime():e}),this},o.qtype=function(e){return void 0!==e&&(t=e,r.clear()),t},o}function AY(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return IY(e.qNumFormat.qFmt,e.qNumFormat.qType,t);let n="#",r=t&&void 0!==t.qThousandSep?t.qThousandSep:",",i=t&&void 0!==t.qDecimalSep?t.qDecimalSep:".",o="U",a=e&&!!e.qIsAutoFormat;return e&&e.qNumFormat?(n=e.qNumFormat.qFmt||n,r=e.qNumFormat.qThou||r,i=e.qNumFormat.qDec||i,o=e.qNumFormat.qType||o,a=a&&-1===["M"].indexOf(e.qNumFormat.qType)):a=!0,(a||"U"===o)&&(n="#".concat(i,"##"),o="U"),vY(n,r,i,o,t)}function _Y(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.meta,r=t.id,i=t.key,o=t.localeInfo,a=t.fieldExtractor,s=t.value,l=t.type,c=t.sourceField;const u=s||("dimension"===l?e=>null==e?void 0:e.qElemNo:e=>null==e?void 0:e.qValue),d="dimension"===l?"first":"avg",f=AY(n,o),h="dimension"===l?"first":(e,t)=>f(t),p={id:()=>r,key:()=>i,raw:()=>n,title:()=>n.qFallbackTitle||n.label,type:()=>l,origin:()=>c,items:()=>(e||(e=a(p)),e),min:()=>n.qMin,max:()=>n.qMax,value:u,label:e=>(null==e?void 0:e.qText)||"",reduce:d,reduceLabel:h,formatter:()=>f,tags:()=>n.qTags};return p}function LY(e,t,n,r,i){return(t[e]||[]).map((t,o)=>{const a="".concat(r?"".concat(r,"/"):"").concat(e,"/").concat(o),s={instance:_Y(yW({id:"".concat(n?"".concat(n,"/"):"").concat(a),key:a,meta:t},i))};return s.attrDims=LY("qAttrDimInfo",t,n,a,yW({},i,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),s.attrExps=LY("qAttrExprInfo",t,n,a,yW({},i,{value:e=>null==e?void 0:e.qNum,type:"measure"})),s.measures=LY("qMeasureInfo",t,n,a,yW({},i,{value:e=>null==e?void 0:e.qValue,type:"measure"})),s})}function PY(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.key,n=e.data,r=e.config,i=void 0===r?{}:r;const o={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},a=n;if(!a)throw new Error('Missing "data" input');if(!a.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const s=PY.util,l={cache:o,cube:a,localeInfo:i.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:i.virtualFields},c={key:()=>t,raw:()=>a,field:e=>function(e,t){let n=t.cache;if("number"==typeof e)return n.fields[e];const r=n.allFields;if("function"==typeof e){for(let t=0;t<r.length;t++)if(e(r[t]))return r[t];return!1}if("string"==typeof e){for(let t=0;t<r.length;t++)if(r[t].key()===e||r[t].title()===e)return r[t]}else if(e&&-1!==r.indexOf(e))return e;throw Error("Field not found: ".concat(e))}(e,l),fields:()=>o.fields.slice(),extract:e=>l.extractor(e,c,o,s),hierarchy:e=>l.hierarchy(e,c,o,s),_cache:()=>o};"K"===a.qMode||"T"===a.qMode||!a.qMode&&a.qNodesOnDim?(l.extractor=QW,l.hierarchy=ZW,l.pages="K"===a.qMode?a.qStackedDataPages:a.qTreeDataPages):"S"===a.qMode?(l.extractor=SW,l.pages=a.qDataPages,l.hierarchy=ZW):l.extractor=()=>[],l.fieldExtractor=e=>l.extractor({field:e},c,o,s);const u="S"===a.qMode?e=>e.qElemNumber:void 0,d="S"===a.qMode?e=>e.qNum:void 0;o.wrappedFields.push(...LY("qDimensionInfo",a,t,"",yW({},l,{value:u,type:"dimension"}))),o.wrappedFields.push(...LY("qMeasureInfo",a,t,"",yW({},l,{value:d,type:"measure"}))),o.fields=o.wrappedFields.map(e=>e.instance);const f=e=>{e.forEach(e=>{o.allFields.push(e.instance),f(e.measures),f(e.attrDims),f(e.attrExps)})};return f(o.wrappedFields),(i.virtualFields||[]).forEach(e=>{const n=c.field(e.from),r=_Y(sW({meta:n.raw(),id:"".concat(t,"/").concat(e.key),sourceField:n,fieldExtractor:e=>l.extractor({field:e},c,o,s),key:e.key,type:n.type(),localeInfo:l.localeInfo,value:n.value},e.override||{}));o.virtualFields.push(r)}),o.allFields.push(...o.virtualFields),c}const RY=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],FY=/\/qDimensionInfo(?:\/(\d+))?/,zY=/\/qMeasureInfo\/(\d+)/,jY=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,$Y=/\/qAttrExprInfo\/(\d+)/,VY=/\/?qHyperCube/,UY=/\/?qTreeData/,HY=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),BY=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function WY(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const r=t.byCells,i=t.primarySource,o=[],a={},s=e.isActive();let l=!1;if(e.brushes().forEach(e=>{const t=function(e,t){let n=e,r=-1,i=-1,o="",a=e=>e;VY.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),a=HY):UY.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),a=BY);let s=!0;if(FY.test(e)&&(r=+FY.exec(e)[1]),zY.test(e)&&(i=+zY.exec(e)[1]),jY.test(e)){i=-1,r=0;const e=+jY.exec(n)[2];isNaN(e)||(r=e,n=n.replace(/\/\d+$/,"")),s=!1}if($Y.test(e)){const e=i;if(t){i=0;const a=FW(o,t);i+=(a.qMeasureInfo||[]).length,r>-1?(i=a.qDimensionInfo.slice(0,r).reduce((e,t)=>e+t.qAttrExprInfo.length,i),r=-1):(i=a.qDimensionInfo.reduce((e,t)=>e+t.qAttrExprInfo.length,i),i=a.qMeasureInfo.slice(0,e).reduce((e,t)=>e+t.qAttrExprInfo.length,i)),i+=+$Y.exec(n)[1]}else r>-1?(r=-1,i=+$Y.exec(n)[1]):i+=+$Y.exec(n)[1]+1}return RY.forEach(e=>{let t=lW(e,2),r=t[0],i=t[1];n=n.replace(r,i)}),s&&(n=a(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:i,dimensionIdx:r,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(r)if(n&&n.qHyperCube&&("P"===n.qHyperCube.qMode||"T"===n.qHyperCube.qMode||"K"===n.qHyperCube.qMode)){const r=n.qHyperCube,o=r.qNoOfLeftDims,s=r.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(a.selectPivotCells||(a.selectPivotCells={path:t.path,cells:[]}),e.id===i||!i){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!==i&&(i||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 YY(e){PY.util=e.data("matrix").util,e.data("q",PY),e.formatter("q-number",vY),e.formatter("q-time",IY)}function GY({chart:e}){const t={paths:e.findShapes("path").filter(e=>e.key===Gb.COMPONENT.LINE),linePaths:[],areaPaths:[],lineMap:{},areaMap:{}};return t.paths.reduce((e,n)=>((Object.hasOwnProperty.call(n.attrs,"stroke-linejoin")?t.linePaths:t.areaPaths).push(n),e),t),{getLine:e=>{if(!t.lineMap[e]){const n=t.linePaths.filter(t=>t.data&&t.data.line.value===e);t.lineMap[e]=n.length>1?function({paths:e}){const[t]=e,n=e=>e.replace(/L|M|C|Z/g,""),r=e.reduce((e,t,r)=>{if(!t.attrs.d)return e;const i=t.attrs.d.split(/(?=[LMC])/),o={parts:i,first:n(i[0]),last:n(i[Math.max(0,i.length-1)])};if(e[r]=o,0===r)return e.combined=t.attrs.d,e;const a=e[e.previousIndex],s=a?.last===o.first,l=o.parts.slice(s?1:0).join("");return e.combined=`${e.combined}${l}`,e.previousIndex=r,e},{combined:"",previousIndex:0});return t._augmented={d:r.combined},t}({paths:n}):n[0]}return t.lineMap[e]},getArea:e=>{if(!t.areaMap[e]){const[n]=t.areaPaths.filter(t=>t.data&&t.data.line.value===e);t.areaMap[e]=n}return t.areaMap[e]}}}function KY({brush:e}){const t=e.brush.values();return function({value:e}){return-1!==t.indexOf(e)}}function XY({brush:e,chart:t}){const n=e.brush.ranges();if(!n.length)return!1;const r=t&&t.scale(Gb.SCALE.MAIN.MAJOR),i=r&&r.max&&r.max(),o="qHyperCube/qDimensionInfo/0:numeric"===e.id?(e,t)=>t===i?e<=t:e<t:(e,t)=>e<=t;return function({value:e}){return n.some(t=>t.min<=e&&o(e,t.max))}}function JY({brush:e,legendRange:t,minorRange:n,legendTap:r,items:i,selectionValues:o,colorByData:a,chart:s}){const l=e.brushes();if(!l.length)return[];const c=l[0];let u=[t?e=>e.color.value:o[c.id]].filter(Boolean);if(a&&n&&u.push(e=>e.color.value),!a&&r&&(u=[e=>e.color.value]),!u.length)return[];const d=function({brush:e,chart:t}){return("value"===e.type?KY:XY)({brush:e,chart:t})}({brush:c,chart:s});return d?i.reduce((e,t,n)=>(u.some(e=>d({value:e(t)}))&&e.push({item:t,index:n}),e),[]):[]}function ZY({d:e}){return e.replace("Z","").split(/(?=[LMC])/).map(e=>{const t=e.substring(0,1),n={letter:t,x:0,y:0,raw:e},r=e.substring(1).split(",");return"M"===t||"L"===t?([n.x]=r,[,n.y]=r):"C"===t&&([,,,,n.x]=r,[,,,,,n.y]=r),n})}function QY({chart:e,selected:t,connection:n,gradient:r,fallback:i,isArea:o}){const a=e.scale(Gb.SCALE.MAIN.COLOR),s=t.filter(e=>-1!==n.indexOf(e.index)).map(e=>e.item.end.value),l=Math.min(...s),c=Math.max(...s),u=o?Math.min(0,l):l,d=o?Math.max(0,c):c,f=d-u,h=0===f?1:f,p=a.domain().map(e=>({color:a(Math.min(d,Math.max(u,e)))||i,offset:Math.min(1,Math.max(0,(e-u)/h))})),m=p.map(e=>e.offset),g=m.lastIndexOf(0),y=m.indexOf(1),v=p.slice(-1===g?0:g,-1===y?p.length:y+1);return{type:"gradient",x1:r.x1,x2:r.x2,y1:r.y1,y2:r.y2,stops:v}}function eG({chart:e,selected:t,connection:n,gradient:r,fallback:i,isArea:o}){const a=e.scale(Gb.SCALE.MAIN.COLOR),s=t.filter(e=>-1!==n.indexOf(e.index)).map(e=>e.item.end.value),l=Math.min(...s),c=Math.max(...s),u=o?Math.min(0,l):l,d=(o?Math.max(0,c):c)-u,f=0===d?1:d,h=a.domain(),p=[];for(let e=0;e<h.length-1;e++){const t=h[e],n=a(t)||i;p.push({color:n,offset:Math.min(1,Math.max(0,(t-u)/f))});const r=h[e+1];p.push({color:n,offset:Math.min(1,Math.max(0,(r-u)/f))})}const m=p.map(e=>e.offset),g=m.lastIndexOf(0),y=m.indexOf(1),v=p.slice(-1===g?0:g,-1===y?p.length:y+1);return{type:"gradient",x1:r.x1,x2:r.x2,y1:r.y1,y2:r.y2,stops:v}}function tG({property:e,chart:t,connection:n,attrs:r,colorSettings:i,colorByData:o,isColorCode:a,selected:s,hasMultipleMeasures:l,orientation:c,rtl:u,isArea:d}){const f=r[e];if("gradient"!==f.type)return f;const{type:h,nil:p}=i;if(l||!o)return function({chart:e,selected:t,connection:n,gradient:r,fallback:i,orientation:o,isColorCode:a,rtl:s}){const l=e.scale(Gb.SCALE.MAIN.MAJOR),c=e.scale(Gb.SCALE.MAIN.COLOR),u=t.filter(e=>-1!==n.indexOf(e.index)),d=("horizontal"===o&&s?u.reverse():u).map(e=>e.item),f=d.map(e=>l(e.major.value)),h=Math.min(...f),p=Math.max(...f)-h,m=0===p?1:p,g=f.map((e,t)=>0===t?0:t===f.length-1?1:(e-h)/m),y=[];for(let e=0;e<d.length;e++){const t=d[e],n=a?t.color.value:c(t.color.value)||i,r=g[e];y.push({color:n,offset:0===e?0:Math.max(0,y[y.length-1].offset)}),y.push({color:n,offset:e===d.length-1?1:Math.max(0,parseFloat((r+(g[e+1]-r)/2).toFixed(5)))})}return{type:"gradient",x1:r.x1,x2:r.x2,y1:r.y1,y2:r.y2,stops:y}}({chart:t,selected:s,connection:n,gradient:f,fallback:p,orientation:c,isColorCode:a,rtl:u});return("continuous"===h?QY:eG)({chart:t,selected:s,connection:n,gradient:f,fallback:p,isArea:d})}function nG({chart:e,pathModel:t,colorSettings:n,colorByData:r,isColorCode:i,hasMultipleMeasures:o,orientation:a,lineKey:s,selected:l,connections:c,rtl:u,count:d}){const f=t.getLine(s),{attrs:h}=f,p=ZY({d:f._augmented?f._augmented.d:h.d}),m=c.map(t=>function({chart:e,colorSettings:t,colorByData:n,isColorCode:r,hasMultipleMeasures:i,orientation:o,selected:a,connection:s,commands:l,attrs:c,rtl:u,count:d}){const f=s.map((e,t)=>{const n=l[e];if(!n)throw new Error("command is undefined");return 0!==t||"M"===n.letter?n.raw:`M${n.x},${n.y}`}).join("");return{path:f,attrs:c,stroke:tG({property:"stroke",chart:e,connection:s,attrs:c,selected:a,colorSettings:t,colorByData:n,isColorCode:r,hasMultipleMeasures:i,orientation:o,rtl:u,isArea:!1})}}({chart:e,colorSettings:n,colorByData:r,isColorCode:i,hasMultipleMeasures:o,orientation:a,selected:l,connection:t,commands:p,attrs:h,rtl:u,count:d}));return{commands:p,lines:m}}function rG({chart:e,pathModel:t,colorSettings:n,colorByData:r,isColorCode:i,hasMultipleMeasures:o,orientation:a,isStacked:s,lineKey:l,selected:c,connections:u,commands:d,rtl:f,count:h}){const p=t.getArea(l);if(!p)return[];const{attrs:m}=p,g="horizontal"===a,y=e.component(Gb.COMPONENT.LINE).rect.computedInner[g?"height":"width"]*e.scale(Gb.SCALE.MAIN.MINOR)(0),v=[];let b;return u.forEach(e=>{e.forEach((t,n)=>{const r=d[t],i={x:r.x,y:r.y,raw:r.raw};if(0===n||"M"===r.letter||e[n-1]!==e[n]-1)v.push({lines:[i],first:{x:i.x,y:i.y},connection:[e[n]]});else{const t=v[v.length-1];t.lines.push(i),t.connection.push(e[n])}})}),s&&(b=ZY({d:m.d}).reduce((e,t,n)=>(0===n||"M"===t.letter?e.push([t]):e[e.length-1].push(t),e),[])),v.map(t=>{const{lines:l}=t,u=l.map((e,t)=>0===t?`M${e.x},${e.y}`:e.raw);if(s){const e=t.connection[0],n=b.reduce((t,n)=>(t.found||(t.counted+=n.length/2,e<t.counted&&(t.areaCommand=n,t.found=!0)),t),{counted:0,found:!1}),r=b.indexOf(n.areaCommand),i=b.reduce((e,t,n)=>(n<r&&(e+=t.length/2),e),0),o=n.areaCommand,a=o.slice(o.length/2,o.length).reverse();t.connection.map(e=>a[e-i].raw).reverse().forEach((e,t)=>{if(0===t&&"C"===e.charAt(0)){const t=e.substring(1).split(","),n={x:0,y:0};[,,,,n.x,n.y]=t,u.push(`L${n.x},${n.y}`)}else u.push(e)})}else{const e=l[l.length-1],n=g?e.x:y,r=g?y:e.y;u.push(`L${n},${r}`);const i=g?t.first.x:y,o=g?y:t.first.y;u.push(`L${i},${o}`)}return u.push("Z"),{path:`M${u.join("").substring(1)}`,attrs:m,fill:tG({property:"fill",chart:e,connection:t.connection,attrs:m,selected:c,colorSettings:n,colorByData:r,isColorCode:i,hasMultipleMeasures:o,orientation:a,rtl:f,isArea:!0})}})}function iG({chart:e,pathModel:t,brush:n,legendRange:r,minorRange:i,legendTap:o,items:a,selectionValues:s,colorSettings:l,colorByData:c,isColorCode:u,hasMultipleMeasures:d,isStacked:f,orientation:h,rtl:p,highlightArea:m}){const g=a.filter(e=>"NaN"!==e.end.value&&!Number.isNaN(e.end.value)),y=function({items:e}){const t=e.reduce((e,t,n)=>{const r=t.line.value;return e[r]||(e[r]={key:r,items:[],index:n}),e[r].items.push(t),e},{});return Object.keys(t).map(e=>t[e]).sort((e,t)=>e.index-t.index).map(e=>({lineKey:e.key,items:e.items}))}({items:g}),{lines:v,areas:b}=y.reduce((a,g)=>{const y=JY({brush:n,legendRange:r,minorRange:i,legendTap:o,items:g.items,selectionValues:s,colorByData:c,chart:e});if(y.length<2)return a;const v=function({selected:e}){return e.reduce((e,t)=>{const{index:n}=t;if(e.length){const t=e[e.length-1];n===t[t.length-1]+1?t.push(n):e.push([n])}else e.push([n]);return e},[]).filter(e=>e.length>1)}({selected:y});if(!v.length)return a;const{lines:b,areas:x}=function({chart:e,pathModel:t,colorSettings:n,colorByData:r,isColorCode:i,hasMultipleMeasures:o,orientation:a,isStacked:s,lineKey:l,selected:c,connections:u,rtl:d,highlightArea:f,count:h}){const{commands:p,lines:m}=nG({chart:e,pathModel:t,colorSettings:n,colorByData:r,isColorCode:i,hasMultipleMeasures:o,orientation:a,lineKey:l,selected:c,connections:u,rtl:d,count:h});return{lines:m,areas:f?rG({chart:e,pathModel:t,colorSettings:n,colorByData:r,isColorCode:i,hasMultipleMeasures:o,orientation:a,isStacked:s,lineKey:l,selected:c,connections:u,commands:p,rtl:d,count:h}):[]}}({chart:e,pathModel:t,colorSettings:l,colorByData:c,isColorCode:u,hasMultipleMeasures:d,orientation:h,isStacked:f,lineKey:g.lineKey,selected:y,connections:v,rtl:p,highlightArea:m,count:g.items.length});return a.lines.push(...b),m&&a.areas.push(...x),a},{lines:[],areas:[]}),x=[];return v.forEach(e=>x.push({type:"path",d:e.path,stroke:e.stroke,strokeLinejoin:e.attrs["stroke-linejoin"],strokeWidth:e.attrs["stroke-width"],strokeDasharray:e.attrs["stroke-dasharray"],fill:"none"})),m&&b.forEach(e=>x.push({type:"path",d:e.path,fill:e.fill,opacity:e.attrs.opacity})),x}YY.qBrushHelper=WY,YY.selections=WY;var oG={require:["chart","renderer"],defaultSettings:{settings:{enabled:()=>!0,highlightArea:()=>!0,getSelectionContext:()=>"selection",getSelectionInfo:void 0,selectionValues:{},colorSettings:void 0,colorByData:!1,isColorCode:!1,hasMultipleMeasures:!1,isStacked:!1,orientation:"horizontal",rtl:!1}},addListener(e,t){this.state.brush.addListener(e,t),this.state.listeners.push({type:e,fn:t})},removeListeners(){this.state.listeners.forEach(e=>this.state.brush.removeListener(e.type,e.fn)),this.state.listeners.length=0},created(){const e="function"==typeof this.settings.settings.getSelectionContext?this.settings.settings.getSelectionContext():"selection";this.state={pathModel:GY({chart:this.chart}),brush:this.chart.brush(e),listeners:[],legendRange:!1,minorRange:!1,legendTap:!1}},mounted(){this.addListener("update",()=>{if("function"==typeof this.settings.settings.enabled&&!this.settings.settings.enabled())return;const{legendRange:e=this.state.legendRange,minorRange:t=this.state.minorRange,legendTap:n=this.state.legendTap}=this.settings.settings.getSelectionInfo(),r=iG({chart:this.chart,pathModel:this.state.pathModel,brush:this.state.brush,legendRange:e,minorRange:t,legendTap:n,items:this.data.items,selectionValues:this.settings.settings.selectionValues,colorSettings:this.settings.settings.colorSettings,colorByData:this.settings.settings.colorByData,isColorCode:this.settings.settings.isColorCode,hasMultipleMeasures:this.settings.settings.hasMultipleMeasures,isStacked:this.settings.settings.isStacked,orientation:this.settings.settings.orientation,rtl:this.settings.settings.rtl,highlightArea:this.settings.settings.highlightArea()}),{getProgressiveRender:i}=this.settings.settings;if("function"==typeof i){i()({render:this.renderer.render,nodes:r})}else this.renderer.render(r)}),this.addListener("end",()=>{("function"!=typeof this.settings.settings.enabled||this.settings.settings.enabled())&&this.renderer.render([])})},render(){if("function"==typeof this.settings.settings.enabled&&!this.settings.settings.enabled())return[];this.state.pathModel=GY({chart:this.chart});const{legendRange:e=this.state.legendRange,minorRange:t=this.state.minorRange,legendTap:n=this.state.legendTap}=this.settings.settings.getSelectionInfo();return iG({chart:this.chart,pathModel:this.state.pathModel,brush:this.state.brush,legendRange:e,minorRange:t,legendTap:n,items:this.data.items,selectionValues:this.settings.settings.selectionValues,colorSettings:this.settings.settings.colorSettings,colorByData:this.settings.settings.colorByData,isColorCode:this.settings.settings.isColorCode,hasMultipleMeasures:this.settings.settings.hasMultipleMeasures,isStacked:this.settings.settings.isStacked,orientation:this.settings.settings.orientation,rtl:this.settings.settings.rtl,highlightArea:this.settings.settings.highlightArea()})},destroyed(){this.state.unregisterOnStart&&this.state.unregisterOnStart(),this.removeListeners()}},aG={require:["resolver"],defaultSettings:{settings:{orientation:"horizontal"}},render(){const{items:e}=this.data;if(!e.length)return[];const t=[],n=[];e.forEach(e=>{const{value:r}=e.major;t[r]||(t[r]=!0,n.push(e))});const r="horizontal"===this.settings.settings.orientation,i=this.rect[r?"width":"height"];return this.resolver.resolve({data:{items:n},settings:{major:{scale:Gb.SCALE.MAIN.MAJOR}},scaled:{major:i}}).items.map(e=>({type:"circle",fill:"none",cx:r?i*e.major:0,cy:r?0:i*e.major,r:1,data:e.data}))}};function sG({x:e,y:t,size:n,stroke:r,strokeWidth:i,fill:o}){return{type:"container",children:[{type:"line",stroke:r||o,strokeWidth:i,x1:e-n/2,y1:t,x2:e+n/2,y2:t},{type:"circle",strokeWidth:0,fill:o,cx:e,cy:t,r:.25*n}]}}function lG({settings:e={},defaultSettings:t={}}){const n={};return Object.keys(t).forEach(r=>{const i=typeof e[r];n[r]="function"===i?e[r]():"undefined"===i?t[r]:e[r]}),n}const cG={min:NaN,max:NaN},uG={values:void 0};function dG(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 fG(e={},t={},n={}){const r=En(),i={instance:null,invert:!1},{min:o,max:a}=lG({settings:e,defaultSettings:cG}),{values:s}=lG({settings:e.ticks,defaultSettings:uG});function l(e){return"number"!=typeof e||Number.isNaN(e)?NaN:r(e)}return l.invert=function(e){return r.invert(e)},l.clamp=function(e=!0){return r.clamp(e),l},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.copy=function(){const i=fG(e,t,n);return i.domain(l.domain()),i.range(l.range()),i.clamp(r.clamp()),i},l.norm=function(e){return dG(i,l),i.instance(e)},l.normInvert=function(e){return dG(i,l),i.instance.invert(e)},l.data=()=>t,l.ticks=({formatter:e}={})=>(s||r.nice().ticks(5)).map(t=>{const n=l(t);return{position:n,start:n,end:n,value:t,label:e?e(t):t}}),l.domain=e=>void 0!==e?(r.domain(e),l):r.domain(),l.range=e=>void 0!==e?(r.range(e),l):r.range(),l.domain([o||1,a]),l.range(e.invert?[1,0]:[0,1]),i.invert=e.invert,r.base(10),l}function hG(){const e=rW();return e.use(YY),e.use(function(e){if("function"!=typeof e.interaction)return t=>{t.interaction("hammer",zq(e))};e.interaction("hammer",zq(Hammer))}(Pq)),e.renderer("react-qcm",Iq),e.component("axis-overlay",Yb.picassoComponents.axisOverlay),e.component("axis-title",Eq),e.component("brush-highlighter",oG),e.component("disclaimer",Nq),e.component("ghost-point",aG),e.component("label-space",ix),e.component("out-of-bounds-marker",lx),e.component("point-label",Bs),e.component("reference-line-labels",ba),e.component("scroll-hint",Fi),e.component("scrollbar",km),e.component("time-axis",Yb.picassoComponents.timeAxis),e.scale("logarithmic",fG),e.scale("time",Yb.picassoScales.time),e.symbol("line-point",sG),e}var pG,mG;var gG=function(){if(mG)return pG;mG=1;var e={};function t(){t.init.call(this)}return e.isObject=function(e){return"object"==typeof e&&null!==e},e.isNumber=function(e){return"number"==typeof e},e.isUndefined=function(e){return void 0===e},e.isFunction=function(e){return"function"==typeof e},pG=t,t.EventEmitter=t,t.prototype._events=void 0,t.prototype._maxListeners=void 0,t.defaultMaxListeners=10,t.init=function(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0},t.prototype.setMaxListeners=function(t){if(!e.isNumber(t)||t<0||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},t.prototype.emit=function(t){var n,r,i,o,a,s;if(this._events||(this._events={}),"error"===t&&!this._events.error)throw(n=arguments[1])instanceof Error?n:Error('Uncaught, unspecified "error" event.');if(r=this._events[t],e.isUndefined(r))return!1;if(e.isFunction(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:for(i=arguments.length,o=new Array(i-1),a=1;a<i;a++)o[a-1]=arguments[a];r.apply(this,o)}else if(e.isObject(r)){for(i=arguments.length,o=new Array(i-1),a=1;a<i;a++)o[a-1]=arguments[a];for(i=(s=r.slice()).length,a=0;a<i;a++)s[a].apply(this,o)}return!0},t.prototype.addListener=function(n,r){var i;if(!e.isFunction(r))throw TypeError("listener must be a function");(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",n,e.isFunction(r.listener)?r.listener:r),this._events[n]?e.isObject(this._events[n])?this._events[n].push(r):this._events[n]=[this._events[n],r]:this._events[n]=r,e.isObject(this._events[n])&&!this._events[n].warned)&&((i=e.isUndefined(this._maxListeners)?t.defaultMaxListeners:this._maxListeners)&&i>0&&this._events[n].length>i&&(this._events[n].warned=!0,e.isFunction(console.error)&&console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[n].length),e.isFunction(console.trace)&&console.trace()));return this},t.prototype.on=t.prototype.addListener,t.prototype.once=function(t,n){if(!e.isFunction(n))throw TypeError("listener must be a function");var r=!1;function i(){this.removeListener(t,i),r||(r=!0,n.apply(this,arguments))}return i.listener=n,this.on(t,i),this},t.prototype.removeListener=function(t,n){var r,i,o,a;if(!e.isFunction(n))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(o=(r=this._events[t]).length,i=-1,r===n||e.isFunction(r.listener)&&r.listener===n)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,n);else if(e.isObject(r)){for(a=o;a-- >0;)if(r[a]===n||r[a].listener&&r[a].listener===n){i=a;break}if(i<0)return this;1===r.length?(r.length=0,delete this._events[t]):r.splice(i,1),this._events.removeListener&&this.emit("removeListener",t,n)}return this},t.prototype.removeAllListeners=function(t){var n,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(n in this._events)"removeListener"!==n&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[t],e.isFunction(r))this.removeListener(t,r);else if(Array.isArray(r))for(;r.length;)this.removeListener(t,r[r.length-1]);return delete this._events[t],this},t.prototype.listeners=function(t){return this._events&&this._events[t]?e.isFunction(this._events[t])?[this._events[t]]:this._events[t].slice():[]},t.listenerCount=function(t,n){return t._events&&t._events[n]?e.isFunction(t._events[n])?1:t._events[n].length:0},pG}(),yG=o(gG);var vG={shapes:[{type:"path",attrs:{d:"M15.9488039,5.20769129 C16.0487326,6.70662306 15.3492311,8.30548361 14.050157,9.30477145 C12.651154,10.5039169 10.8524359,10.8037032 8.85386017,10.4039881 L7.3549284,10.0042729 L5.75606786,9.70448659 C5.75606786,9.90434416 5.65613907,10.0042729 5.4562815,10.2041305 C5.05656637,10.6038456 4.55692244,10.8037032 4.05727852,10.8037032 C3.75749217,10.8037032 3.45770582,10.7037744 3.15791946,10.6038456 C3.05799068,10.903632 3.15791946,11.2034184 3.45770582,11.7030623 C5.05656637,14.0014243 3.85742095,15.9000712 3.75749217,16 L2.2585604,15.3004985 C2.2585604,15.2005697 2.95806189,14.0014243 1.95877405,12.6024213 C1.6589877,12.0028486 1.15934378,11.0035608 1.55905891,10.0042729 C1.6589877,9.80441537 1.75891648,9.6045578 1.95877405,9.40470024 C1.6589877,8.90505631 1.55905891,8.30548361 1.85884527,7.7059109 C1.55905891,7.40612455 1.25927256,7.1063382 1.15934378,6.70662306 C0.859557424,5.90719279 0.959486209,4.5081898 1.6589877,3.30904439 C1.95877405,2.6095429 2.55834676,2.0099702 3.15791946,1.51032628 C3.95734974,0.91075357 4.95663758,0.610967217 6.15578299,0.311180864 C9.05371774,-0.388320626 11.9516525,0.111323295 13.9502282,1.61025506 C15.1493736,2.50961412 15.8488751,3.80868831 15.9488039,5.20769129 Z M13.0508691,8.10562604 C13.8502994,7.40612455 14.3499433,6.40683671 14.3499433,5.30762008 C14.2500145,4.20840345 13.550513,3.40897318 12.9509403,2.90932926 C12.1515101,2.40968533 11.252151,2.0099702 10.1529344,1.81011263 C8.95378895,1.61025506 7.75464354,1.71018384 6.45556935,1.91004141 C4.75678001,2.30975655 3.65756338,3.00925804 3.05799068,4.10847467 C2.55834676,5.00783373 2.65827554,5.90719279 2.75820433,6.20697914 C2.75820433,6.30690792 2.85813311,6.40683671 3.05799068,6.40683671 C3.15791946,6.40683671 3.25784825,6.40683671 3.35777703,6.40683671 C3.45770582,6.40683671 3.45770582,6.40683671 3.45770582,6.40683671 L3.5576346,6.40683671 L3.65756338,6.40683671 C4.65685123,6.40683671 5.4562815,6.90648063 5.85599664,7.80583969 L5.85599664,8.00569726 C6.35564056,8.10562604 7.05514205,8.30548361 7.75464354,8.50534118 L9.25357531,8.90505631 C10.0530056,9.0049851 10.7525071,9.0049851 11.4520086,8.80512753 C12.0515813,8.70519875 12.5512252,8.40541239 13.0508691,8.10562604 Z"}}]};function bG(t){const n=e.useConstraints(),r=function(){const t=e.useLayout(),n=e.useTranslator(),[r,i]=e.useState(!1),[o,a]=e.useState(!1),s=e=>{a("boolean"==typeof e?e:!o)},[l]=e.useState({});return l.enabled=()=>r,l.active=()=>o,l.action=s,l.update=e=>{i(!e.select&&!e.active)},e.useAction(()=>{const e=!!t.qSelectionInfo?.qInSelections,i=!!t.qHyperCube?.qDimensionInfo?.[0]?.qIsOneAndOnlyOne;return{key:"lasso",label:n.get(o?"Tooltip.ToggleOffLassoSelection":"Tooltip.ToggleOnLassoSelection"),icon:vG,hidden:!r||!e||i,action:s,active:o}},[o,r,t,n.language()]),l}(),[i]=e.useState(()=>function({lasso:e,progressiveRendering:t}){const n={interact:{isEnabled:!0,enabled(){return this.isEnabled},update(e){this.isEnabled=!e.active}},lasso:e,scroll:{isEnabled:!0,enabled(){return this.isEnabled},update(e){this.isEnabled=!e.active}},select:{isEnabled:!0,enabled(){return this.isEnabled&&!t.getInProgressive()},update(e){this.isEnabled=!e.select&&!e.active}},tooltip:{isEnabled:!0,enabled(){return this.isEnabled},update(e){this.isEnabled=!e.passive}},update(e){Object.keys(n).forEach(t=>{n[t].update&&n[t].update(e)})},destroy(){n.select.removeAllListeners()}};return Object.keys(yG.prototype).forEach(e=>{n.select[e]=yG.prototype[e]}),yG.init(n.select),n}({lasso:r,progressiveRendering:t}));return e.useEffect(()=>{i.update(n)},[n]),i}function xG({env:t}){const n=function(){const t={timer:Date.now(),mainTimer:null,pointTimer:null,lineTimer:null,reducedLineTimer:null,renderPromise:null,getInProgressive:()=>t.progressive,setInProgressive:e=>{t.progressive=e}},[n]=e.useState(()=>t);return n}(),r=bG(n),i=e.useDeviceType(),o=e.useElement(),a=e.useOptions(),s=e.useSelections(),[l,c]=e.useState();return e.useEffect(()=>{const{flags:e={isEnabled:()=>!1},isUnsupportedFeature:l=()=>!1,hostConfig:u}=t,d=hG()({renderer:{prio:[a.renderer||"canvas"]}});o.style.overflow="hidden";const f=d.chart({element:o,data:[],settings:{}});return c({actions:r,chart:f,deviceType:i,flags:e,isUnsupportedFeature:l,picasso:d,progressiveRendering:n,selections:s,viewCache:ku(),viewState:Eu({scrollOffset:void 0,viewRange:[0,1]}),hostConfig:u}),function(){r.destroy(),f.destroy()}},[]),l}const SG="REJECTED",MG=()=>{},wG=2,kG=20,EG=200,CG=10;var NG={contains:function(e,t){if(!e)return!1;const{qArea:n}=e;return!!n&&(n.qLeft<=t.qLeft&&n.qLeft+n.qWidth>=t.qLeft+t.qWidth&&n.qTop<=t.qTop&&n.qTop+n.qHeight>=t.qTop+t.qHeight)},patcher:function({layoutService:e}){const t=t=>{t.qArea.qHeight=t.qMatrix.length,t.qArea.qWidth=e.meta.size.x};return t.should=e=>0===e.qArea.qHeight&&0===e.qArea.qWidth&&!!e.qMatrix.length,t},slicer:function(e,t){const n=Math.max(0,t.qHeight)-Math.abs(Math.min(0,t.qTop-e.qArea.qTop)),r=Math.max(0,t.qWidth)-Math.abs(Math.min(0,t.qLeft-e.qArea.qLeft)),i=Math.max(t.qTop,e.qArea.qTop),o=Math.max(t.qLeft,e.qArea.qLeft),a=Math.max(0,i-e.qArea.qTop),s=Math.min(i+n-e.qArea.qTop,e.qArea.qHeight),l=Math.max(0,o-e.qArea.qLeft),c=Math.min(o+r-e.qArea.qLeft,e.qArea.qWidth),u={qArea:{qHeight:s-a,qWidth:c-l,qTop:i,qLeft:o},qMatrix:[]};for(let t=a;t<s;t++)u.qMatrix.push(e.qMatrix[t].slice(l,c));return u},cacheWarden:function({bounds:e={width:0,height:0}}){return{release(t,n){const r=n.qTop-CG<=t.qTop,i=n.qLeft+n.qWidth+CG>=t.qLeft+t.qWidth,o=n.qTop+n.qHeight+CG>=t.qTop+t.qHeight,a=n.qLeft-CG<=t.qLeft;return r&&t.qTop>0||i&&t.qLeft+t.qWidth<e.width||o&&t.qTop+t.qHeight<e.height||a&&t.qLeft>0}}},request:function({definitionPath:e}){return t=>({method:"getHyperCubeData",args:[e,[t]]})}};var TG={contains:function(e,t){if(!e)return!1;const{qArea:n}=e;return!!n&&(n.qTop<=t.qTop&&n.qTop+n.qHeight>=t.qTop+t.qHeight)},patcher:function({layoutService:e}){const t=t=>{t.qArea.qHeight=t.qData[0].qSubNodes.length,t.qArea.qWidth=e.meta.size.x};return t.should=e=>0===e.qArea.qHeight&&0===e.qArea.qWidth&&!!e.qData.length,t},slicer:function(e,t){const n=Math.max(0,t.qHeight)-Math.abs(Math.min(0,t.qTop-e.qArea.qTop)),r=Math.max(t.qTop,e.qArea.qTop),i=Math.max(t.qLeft,e.qArea.qLeft),o=Math.max(0,r-e.qArea.qTop),a=Math.min(r+n-e.qArea.qTop,e.qArea.qHeight),s=e.qData[0].qUp+e.qArea.qHeight+e.qData[0].qDown-r-(a-o),l={qArea:{qHeight:a-o,qWidth:e.qArea.qWidth,qTop:r,qLeft:i},qData:[{...e.qData[0],qUp:r,qDown:s,qSubNodes:[]}]};for(let t=o;t<a;t++)l.qData[0].qSubNodes.push(e.qData[0].qSubNodes[t]);return l},cacheWarden:function({bounds:e={height:0}}){return{release(t,n){const r=n.qTop-CG<=t.qTop,i=n.qTop+n.qHeight+CG>=t.qTop+t.qHeight;return r&&t.qTop>0||i&&t.qTop+t.qHeight<e.height}}},request:function({definitionPath:e}){return t=>({method:"getHyperCubeStackData",args:[e,[t]]})}};var DG={contains:function(){return!1},patcher:function(){const e=e=>e;return e.should=()=>!1,e},slicer:function(e){return e},cacheWarden:function(){return{release:()=>!0}},request:function({definitionPath:e}){return t=>({method:"getHyperCubeTreeData",args:[e,[t]]})}};const qG="pages";const OG="discretePan";function IG({chart:e,actions:t,componentKey:n,dockService:r,rtl:i,scroller:o}){return{type:"Pan",key:"discrete:pan",options:{event:OG,pointers:1,threshold:10,enable(r,i){return this.started===OG||!i||!(!t.scroll.enabled()||!o.enabled())&&e.componentsFromPoint({x:i.center.x,y:i.center.y}).some(e=>e.key===n)}},events:{[`${OG}start`](e){e.preventDefault(),this.started=OG;const t="horizontal"===r.meta.major.orientation?e.deltaX:e.deltaY;this.previousTotalDelta=t<0?-10:10},[`${OG}move`](e){e.preventDefault();const t="horizontal"===r.meta.major.orientation,n=t?e.deltaX:e.deltaY,a=t&&i?-1:1,s=(n-this.previousTotalDelta)*a;this.previousTotalDelta=n,o.scroll(s)},[`${OG}end`](e){e.preventDefault(),this.started=!1},[`${OG}cancel`](e){e.preventDefault(),this.started=!1}}}}function AG({chart:e,componentKey:t,actions:n,scroller:r}){return function(i){if(!n.scroll.enabled()||!r.enabled())return;const[o]=e.componentsFromPoint({x:i.clientX,y:i.clientY}).filter(e=>e.key===t);if(!o)return;i.preventDefault();const a=Math.abs(i.deltaY)>Math.abs(i.deltaX)?i.deltaY:i.deltaX,s=100*Math.sign(-a);r.scroll(s)}}function _G({layoutService:e}){const t=function({layoutService:e}){const t=Math.floor(1e4/(e.meta.dimensionCount+e.meta.measureCount));return function({width:e,height:n}){const r=Math.min(t,Math.max(EG,n));return{width:e,height:Math.max(kG,Math.min(n*wG,r))}}}({layoutService:e}),n={width:e.meta.size.x,height:e.meta.size.y};return function(e){const{width:r,height:i}=t({width:e.qWidth,height:e.qHeight}),o=i?Math.ceil((i-e.qHeight)/2):0,a=r?Math.ceil((r-e.qWidth)/2):0;return{qHeight:i?Math.min(i,n.height):e.qHeight,qWidth:r?Math.min(r,n.width):e.qWidth,qTop:i?Math.max(0,Math.min(e.qTop-o,n.height-i)):e.qTop,qLeft:r?Math.max(0,Math.min(e.qLeft-a,n.width-r)):e.qLeft}}}function LG(e){let t,n;const r=i=>{t=i;const{method:o,args:a}=t.request;e[o](...a).then(e=>{if(t.canceled||n)return t.reject(SG),t=null,void(n&&(r(n),n=null));t.resolve(e[0]),t=null})},i=e=>new Promise((i,o)=>{const a={request:e,resolve:i,reject:o,canceled:!1,cancel:()=>{a.canceled=!0}};t?(e=>{n&&n.reject(SG),n=e})(a):r(a)});return i.isProcessing=()=>!!t,i.hasQueued=()=>!!n,i.cancel=()=>{i.isProcessing()&&t.cancel(),i.hasQueued()&&(n.reject(SG),n=null)},i}const PG={command:{update:()=>{}}};function RG({dataStore:e,composition:t,enigmaModel:n,layoutService:r,trendLineModel:i=PG,definitionPath:o,processDataPage:a}){const{slicer:s,cacheWarden:l,request:c}=t,u=function({dataStore:e,slice:t,warden:n,expand:r,request:i,process:o,connectionless:a,processDataPage:s}){return(l,{onProcessing:c}={})=>{if(e.contains(l)){const r=e.getCurrent();if(a)return Promise.resolve(t(r,l));const i=n.release(r.qArea,l),s=o.isProcessing();if(!i&&s&&o.cancel(),!i||s)return Promise.resolve(t(r,l))}if(a)return Promise.resolve(e.getCurrent());o.isProcessing()&&c&&c();const u=r(l);return o(i(u)).then(n=>(s(n),e.add(n),t(n,l)))}}({dataStore:e,slice:s,warden:l({bounds:{width:r.meta.size.x,height:r.meta.size.y}}),expand:_G({layoutService:r}),request:c({definitionPath:o}),process:LG(n),connectionless:r.meta.isSnapshot,processDataPage:a}),d=Nu((e,{onProcessing:t,onData:n})=>{u(e,{onProcessing:t}).then(e=>n(e)).catch(e=>{if(e!==SG)throw e})},50);return function(e,{onProcessing:t=MG,onDataPage:n=MG}={}){d(e,{onProcessing:t,onData:e=>{r.setDataPages(e?[e]:[]),i.command.update(),n(e)}})}}var FG={inTotal:function({layoutService:e}){return e.meta.size.x},area:function({layoutService:e}){return{qTop:0,qHeight:1,qLeft:0,qWidth:e.meta.size.x}},scaleRange:function({layoutService:e,offsets:t,items:n,viewSize:r}){const{pixel:i}=t,o=e.getDataPages()[0],a=i/r;return[a,n.inView>=n.inTotal?a+1:a+o.qArea.qWidth/n.inView]}};var zG={inTotal:function({layoutService:e,getReducedCube:t}){if(e.meta.isSnapshot&&!e.getLayoutValue("reducedHyperCube")){const n=t();if(n){const[t]=Su({qHyperCube:n},e.refs.dataPages);if(t)return t.qArea.qHeight}const[r]=e.getDataPages();if(r)return r.qArea.qHeight}return e.meta.size.y},area:function({layoutService:e,itemOffset:t,inView:n,areaBuffer:r}){const i=void 0===r?4:r,o=Math.max(0,Math.floor(t)-i/2);return{qTop:o,qHeight:Math.min(e.meta.size.y-o,Math.max(0,Math.ceil(n+i))),qLeft:0,qWidth:e.meta.size.x}},scaleRange:function({layoutService:e,offsets:t,items:n,viewSize:r}){const{pixel:i}=t,o=e.getDataPages()[0],a=r/n.inView,s=(i+o.qArea.qTop*a)/r;return[s,n.inView>=n.inTotal?s+1:s+o.qArea.qHeight/n.inView]}};function jG(e){const{groupSize:t,measureCount:n}=e.meta;return t??n}function $G(e,t){const n=[];for(let r=0;r<e.length;r++){const i=t(e[r]);-1===n.indexOf(i)&&n.push(i)}return n.length}function VG(e){return $G(e.qMatrix,e=>e[0].qElemNumber)-1}var UG={inTotal:function({layoutService:e}){const t=jG(e);return e.meta.size.y*t*(1+1/t)-1},area:function({layoutService:e,itemOffset:t,inView:n,areaBuffer:r}){const i=jG(e),o=void 0===r?i:r,a=t/(i+1),s=Math.max(0,Math.floor((t-a-o/2)/i));return{qTop:s,qHeight:Math.min(e.meta.size.y-s,Math.max(0,Math.ceil((n+o)/i+1))),qLeft:0,qWidth:e.meta.size.x}},scaleRange:function({layoutService:e,offsets:t,items:n,viewSize:r}){const i=jG(e),o=e.getDataPages()[0],a=r/n.inView,{pixel:s}=t,l=VG(o),c=o.qArea.qHeight*i+l,u=(s+(o.qArea.qTop*i+o.qArea.qTop)*a)/r;return[u,n.inView>=n.inTotal?u+1:u+c/n.inView]}};const HG=(e,t)=>t/(e.meta.size.y/e.meta.size.dimensions[0]+1);function BG(e){return{itemOffset(t,n){if(0!==t.qArea.qTop)return HG(e,n);const r=((e,t)=>{const n={successful:!0,count:0};let r=Math.abs(Math.floor(t));const i=[];for(let t=0;t<=r;t++){if(!e[t])return n.successful=!1,n;const o=e[t][0].qElemNumber;-1===i.indexOf(o)&&(i.push(o),r--)}return n.count=i.length-1,n})(t.qMatrix,n);return r.successful?r.count:HG(e,n)},area(t,n,r){if(0!==t.qArea.qTop)return HG(e,n);return $G(t.qMatrix.slice(0,r.qTop+1),e=>e[0].qElemNumber)-1}}}var WG={inTotal:function({layoutService:e}){return e.meta.size.y+e.meta.size.dimensions[0]-1},area:function({getDataPages:e,layoutService:t,itemOffset:n,inView:r}){const i=BG(t).itemOffset(e(),n),o=Math.max(0,Math.floor(n-i));return{qTop:o,qHeight:Math.min(t.meta.size.y-o,Math.max(0,Math.ceil(r+1))),qLeft:0,qWidth:t.meta.size.x}},scaleRange:function({getDataPages:e,layoutService:t,offsets:n,items:r,viewSize:i,upperBound:o}){const a=t.getDataPages()[0],s=i/r.inView,{item:l,pixel:c}=n,u=BG(t).area(e(),l,a.qArea),d=VG(a),f=a.qArea.qHeight+d,h=c===o?(r.inView-f)*s/i:(c+(a.qArea.qTop+u)*s)/i;return[h,r.inView>=r.inTotal?h+1:h+f/r.inView]}};function YG({chart:e,rect:t,dockService:n,itemWidths:r,axisKey:i,renderer:o,isGrouped:a,dimensionAxis:s,inTotal:l,isMajorLabelless:c,maxDataRows:u}){const{DEFAULT:d,SQUEEZE:f,LABELLESS:h}=r[n.meta.chart.mode],p="horizontal"===n.meta.major.orientation,{axisDisplayMode:m="auto",maxVisibleItems:g=10,label:y}=s,v=p?t.width:t.height,b=v/l>=f;switch(m){case"max":return Math.min(l,u);case"custom":return Math.min(g,u);default:return c?v/h:b?function({chart:e,isHorizontal:t,axisKey:n,renderer:r={},isGrouped:i,itemSize:o,label:a}){if(i||"auto"!==a&&"tilted"!==a)return!1;const s=e.component(n),{measureText:l}=r;if(!s||!l)return!0;const{fontFamily:c,fontSize:u,tiltAngle:d}=s.settings.settings.labels,{height:f}=l({fontFamily:c,fontSize:u,text:"M"});if(!t)return f>o;const h=(90-d)*(Math.PI/180);return f>Math.cos(h)*o}({chart:e,isHorizontal:p,axisKey:i,renderer:o,isGrouped:a,itemSize:f,label:y})?v/d:l:v/d}}function GG({chart:e,getRect:t,getDataPages:n,layoutService:r,dockService:i,getItemWidths:o,axisKey:a,renderer:s,areaBuffer:l,rtl:c,getReducedCube:u}){const{inTotal:d,area:f,scaleRange:h}=function({layoutService:e}){const{isDimensionless:t,isGrouped:n,isGroupedByMeasure:r}=e.meta;return t?FG:n?r?UG:WG:zG}({layoutService:r}),p=()=>"horizontal"===i.meta.major.orientation?t().width:t().height,m=e=>e?p()/e:0,g=(e,t)=>-(e-t)*m(t);return{getItems(){const n=r.getLayoutValue("dimensionAxis"),l=d({layoutService:r,getReducedCube:u});return{inTotal:l,inView:YG({chart:e,rect:t(),dockService:i,itemWidths:o(),axisKey:a,renderer:s,isGrouped:r.meta.isGrouped,dimensionAxis:n,inTotal:l,isMajorLabelless:"none"===n.show||"title"===n.show,maxDataRows:Math.floor(1e4/(r.meta.dimensionCount+r.meta.measureCount))})}},getItemSize({items:e}){const{inView:t}=e;return m(t)},getOffsets({pixelOffset:e,items:t}){const{inTotal:n,inView:r}=t,i=Math.min(0,Math.max(e,g(n,r))),o=r?Math.abs(r*i/p()):0;return{start:{pixel:i,item:o},end:{item:Math.min(o+(r||0),n)}}},getUpperBound({items:e}){const{inTotal:t,inView:n}=e;return g(t,n)},getViewRange({pixelOffset:e,items:t}){const{inTotal:n,inView:r}=t;return function({viewSize:e,inTotal:t,inView:n,pixelOffset:r}){const i=e/n*t,o=Math.abs(r)/i;return[o,Math.min(1,o+e/i)]}({viewSize:p(),inTotal:n,inView:r,pixelOffset:e})},getArea:({itemOffset:e,items:t})=>f({getDataPages:n,layoutService:r,itemOffset:e,inView:t.inView,areaBuffer:l}),getScaleRange({offsets:e,items:t}){const o=h({getDataPages:n,layoutService:r,offsets:e,items:t,viewSize:p(),upperBound:g(t.inTotal,t.inView)});return"horizontal"===i.meta.major.orientation&&c?function(e){return[1-e[1],1-e[0]]}(o):o},validate:{offset({pixelOffset:e,items:t}){const{inTotal:n,inView:r}=t;return e<=0&&e>=g(n,r)}},convert:{itemToPixelOffset({itemOffset:e,items:t}){const{inView:n}=t,r=e*m(n);return Number.isFinite(r)?-r:0},relativeToPixelOffset({relativeOffset:e,items:t}){const{inTotal:n,inView:r}=t;return-e*(m(r)*n)}}}}function KG({chart:e,componentKey:t,state:n,dataStore:r,pageData:i,layoutService:o,dockService:a,itemWidths:s,getRect:l,axisKey:c,renderer:u,areaBuffer:d,viewState:f,rtl:h,getReducedCube:p}){n.set("rect",{width:0,height:0}),n.set("itemWidths",{}),n.set("itemSize",0),n.set("items",{}),n.set("offsets",{}),n.set("finished",0),n.set("scaleRange",[0,1]);const m=GG({chart:e,getRect:()=>n.get("rect"),getDataPages:r.getCurrent,layoutService:o,dockService:a,getItemWidths:()=>n.get("itemWidths"),axisKey:c,renderer:u,areaBuffer:d,rtl:h,getReducedCube:p}),g=()=>{const e=m.getItems();return n.set("items",e),e},y=({pixelOffset:e,items:t})=>{const r=m.getOffsets({pixelOffset:e,items:t});return n.set("offsets",r),r},v=e=>{const t=Date.now(),r=g(),a=y({pixelOffset:e,items:r}),s=m.getArea({itemOffset:a.start.item,items:r});if((e=>{const[{qArea:t}]=o.getDataPages();return!!t&&Object.keys(e).every(n=>e[n]===t[n])})(s))return void((m.validate.offset({pixelOffset:e,items:r})||f.get("scrollOffset").start!==a.start.item)&&(n.set("finished",t),n.set("scaleRange",m.getScaleRange({offsets:a.start,items:r})),f.preventSet("viewRange",m.getViewRange({pixelOffset:a.start.pixel,items:r})),f.set("scrollOffset",{start:a.start.item,end:a.end.item})));f.preventSet("viewRange",m.getViewRange({pixelOffset:a.start.pixel,items:r}));const l=()=>{n.get("finished")>t||(n.set("finished",t),n.set("scaleRange",m.getScaleRange({offsets:a.start,items:r})),f.set("scrollOffset",{start:a.start.item,end:a.end.item}))};i(s,{onProcessing:l,onDataPage:l})};return{enabled(){const{inTotal:e,inView:t}=n.get("items");return e>t},itemSize:()=>n.get("itemSize"),scaleRange:()=>n.get("scaleRange"),initialize(){const r=e.component(t);if(!r)return Promise.resolve();n.set("rect","function"==typeof l?l():r.rect),n.set("itemWidths","function"==typeof s?s():s);const a=g();n.set("itemSize",m.getItemSize({items:a}));const c=(({items:e})=>{const t=o.getLayoutValue("scrollStartPos"),n=f.get("scrollOffset");if(void 0===n)return 1===t?m.getUpperBound({items:e}):0;if("number"==typeof n)return m.convert.itemToPixelOffset({itemOffset:n,items:e});const{start:r,end:i}=n,a=1===t&&i?i-e.inView:r;return m.convert.itemToPixelOffset({itemOffset:a,items:e})})({items:a}),u=y({pixelOffset:c,items:a});f.preventSet("viewRange",m.getViewRange({pixelOffset:u.start.pixel,items:a}));const d=m.getArea({itemOffset:u.start.item,items:a});return new Promise(e=>{i(d,{onDataPage:()=>{n.set("scaleRange",m.getScaleRange({offsets:u.start,items:a})),f.preventSet("scrollOffset",{start:u.start.item,end:u.end.item}),e()}})})},scroll(e){const t=n.get("offsets").start.pixel+e;v(t)},scrollToRelative(e){const t=n.get("items"),r=m.convert.relativeToPixelOffset({relativeOffset:e,items:t});v(r)}}}function XG({chart:e,actions:t,componentKey:n,enigmaModel:r,layoutService:i,dockService:o,trendLineModel:a,itemWidths:s,viewState:l,rtl:c,options:{definitionPath:u="/qHyperCubeDef",getRect:d,axisKey:f,renderer:h,areaBuffer:p,processDataPage:m=()=>{},getReducedCube:g=()=>{}}={}}){const y=ku(),v=function({qMode:e}){switch(e){case"K":return TG;case"T":return DG;default:return NG}}({qMode:i.getHyperCubeValue("qMode")}),b=function({state:e,contains:t}){return e.set(qG,[]),{add:t=>{const n=e.get(qG);n.length=0,n.push(t)},getCurrent:()=>e.get(qG)[0],getAll:()=>e.get(qG),contains:n=>t(e.get(qG)[0],n)}}({state:y,contains:v.contains});!function({layoutService:e,dataStore:t,composition:n}){const r=e.getDataPages()[0];if(!r)return;const i=n.patcher({layoutService:e});i.should(r)&&i(r),t.add(r)}({layoutService:i,dataStore:b,composition:v});const x=function({buffer:e}){return void 0===e?void 0:2*Math.round(e/2)}({buffer:p}),S=RG({dataStore:b,composition:v,enigmaModel:r,layoutService:i,trendLineModel:a,definitionPath:u,processDataPage:m}),M=KG({chart:e,componentKey:n,state:y,dataStore:b,pageData:S,layoutService:i,dockService:o,itemWidths:s,getRect:d,axisKey:f,renderer:h,areaBuffer:x,viewState:l,rtl:c,getReducedCube:g}),w=function({layoutService:e,dataStore:t}){return function(n){const r=Su(n,`${e.refs.dataPages}`);r.length=0,r.push(t.getCurrent())}}({layoutService:i,dataStore:b}),k=function({chart:e,actions:t,componentKey:n,dockService:r,rtl:i,scroller:o}){return{gestures:[IG({chart:e,actions:t,componentKey:n,dockService:r,rtl:i,scroller:o})],native:{type:"native",events:{wheel:AG({chart:e,actions:t,componentKey:n,scroller:o})}}}}({chart:e,actions:t,componentKey:n,dockService:o,rtl:c,scroller:M});return{interactions:k,query:{getCanScroll:()=>M.enabled(),getItemSize:()=>M.itemSize(),getScaleRange:()=>M.scaleRange(),getCurrentDataPage:()=>b.getCurrent()},command:{initialize:()=>M.initialize(),scrollTo:e=>M.scrollToRelative(e),setSnapshotData:e=>w(e)}}}const JG=e=>{const{measureCount:t}=e.meta,n=e.getDataPages(),{qMatrix:r}=n?.[0]||{};return(r?.length||0)*t};function ZG({picasso:e,chart:t,localeInfo:n,continuousModel:r,layoutService:i,reducedModel:o,legendModel:a,fieldModel:s,trendLineModel:l,colorService:c,largeDataService:u,progressiveRendering:d,options:f,viewCache:h}){const{POINT:p,LINE:m,BRUSH_HIGHLIGHTER:g,REDUCED_LINE:y}=Gb.COMPONENT,{exclude:v,resetProgressive:b,shouldUseProgressive:x,renderProgressive:S,setReducedCube:M}=u,w={isUpdateDataless:!1,isUsingLegendCube:!1,isUsingLabelSpace:!1,isSizeChanging:!1,isPartialUpdating:!1},{isContinuous:k,isStacked:E}=i.meta,{virtuals:C}=s,N=[],T={main:N,reduced:N,legend:N,dataset:e.data("q")({key:Gb.DATA.MAIN,data:i.getHyperCube(),config:{localeInfo:n,virtualFields:C}})};return{query:{getDataset:()=>T.dataset,getIsUpdateDataless:()=>w.isUpdateDataless,getIsUsingLegendCube:()=>w.isUsingLegendCube,getIsUsingLabelSpace:()=>w.isUsingLabelSpace,animationsEnabled:()=>{const e=t.component(Gb.COMPONENT.OUT_OF_MIN_BOUNDS),n=e&&e.show();return!(!0!==f.chartAnimations||JG(i)>oy.LARGE_NUM_POINTS_ANIMATIONS||w.isSizeChanging||w.isPartialUpdating||h.get("hasHiddenMinOobs")&&n||Ih.propertiesHaveChanged({viewCache:h,layout:i.getLayout()}))}},command:{initialize:()=>{w.isUsingLegendCube=!(k||!E&&!o.query.getIsReduced()||!a.query.getHasCube())},update:()=>(b(),t.layoutComponents(),x()?new Promise(e=>{S(e)}):(t.update(),d.setInProgressive(!1),Promise.resolve())),updateDataless:({settings:e})=>{b(),v.duringMainProgressive=e.components.map(e=>e.key).filter(e=>e!==p&&e!==m),v.duringReducedLineProgressive=e.components.map(e=>e.key).filter(e=>e!==y),v.forClearProgressive=e.components.map(e=>e.key).filter(e=>e!==p&&e!==m&&e!==y),v.postUpdate=e.components.map(e=>e.key).filter(e=>e!==g),v.all=e.components.map(e=>e.key),w.isUpdateDataless=!0;const s=x();T.main=i.getDataPages(),i.setDataPages([]);const u=k?r.getInitialCube():o.query.getCube();M(u);const d=i.getHyperCube()===u;d||(T.reduced=u.qDataPages,u.qDataPages=N),w.isUsingLegendCube&&(T.legend=a.query.getDataPages(),a.command.setDataPages([]));const f=[{type:"q",key:Gb.DATA.MAIN,data:i.getHyperCube(),config:{localeInfo:n,virtualFields:C}},{type:"q",key:Gb.DATA.REDUCED,data:u,config:{localeInfo:n,virtualFields:C}},...c.getMain().getData()];w.isUsingLegendCube&&f.push({type:"q",key:Gb.DATA.LEGEND,data:a.query.getCube(),config:{localeInfo:n,virtualFields:C}}),l.query.hasTrendLines()&&f.push({key:"trend",data:l.query.getData()}),s?t.update({data:f,settings:e}):t.layoutComponents({data:f,settings:e}),i.setDataPages(T.main),T.main=N,d||(u.qDataPages=T.reduced,T.reduced=N),w.isUsingLegendCube&&(a.command.setDataPages(T.legend),T.legend=N),w.isUpdateDataless=!1},updatePartial:()=>(b(!0),x()?new Promise(e=>{S(e,!0)}):(w.isPartialUpdating=!0,t.update({partialData:!0,excludeFromUpdate:v.partialUpdate}),w.isPartialUpdating=!1,d.setInProgressive(!1),Promise.resolve())),setUseLabelSpace:e=>{w.isUsingLabelSpace=e},setState:(e,t)=>{w[e]=t}}}}const QG=e=>e.baseColor||e.coloring&&e.coloring.baseColor;function eK({layout:e}){if(e.qHyperCube.qDimensionInfo.length>1)return{mode:"byDimension",useDimColVal:!0,useBaseColors:"dimension",byDimDef:{activeDimensionIndex:1}};if(e.qHyperCube.qMeasureInfo.length>1)return{mode:"primary",useBaseColors:"measure",paletteColor:null};const t=e.qHyperCube.qDimensionInfo.some(QG),n=e.qHyperCube.qMeasureInfo.some(QG);return{mode:"primary",useBaseColors:t?"dimension":n?"measure":"off",paletteColor:null}}function tK({layoutService:e}){const{isStacked:t,isConnect:n}=e.meta,r=()=>t&&n;return{shouldProcess:()=>r(),shouldProcessInitialPage:()=>r(),getFilteredDataPage:({dataPage:e})=>e,processDataPage:({dataPage:e})=>function({dataPage:e}){const{qMatrix:t}=e,n=t.reduce((e,t,n)=>{for(let r=1;r<t.length;r++)0===n&&(e[r]=[]),e[r].push(t[r]);return e},{}),r=e=>"NaN"===e.qNum;Object.keys(n).forEach(e=>{const t=n[e],i=[{startValue:NaN,endValue:NaN,nodes:[]}];for(let e=0;e<t.length;e++){const n=t[e],o=0===e,a=i[i.length-1];if(r(n)){if(!o&&(!a.nodes.length||Number.isNaN(a.startValue))){const n=t[e-1];a.startValue=n.qIsNull?NaN:n.qNum}i[i.length-1].nodes.push(n)}else a.nodes.length&&(a.endValue=r(n)?NaN:n.qNum,i.push({startValue:NaN,endValue:NaN,nodes:[]}))}i.forEach(e=>{if(!Number.isNaN(e.startValue)&&!Number.isNaN(e.endValue)){const t=(e.endValue-e.startValue)/(e.nodes.length+1);for(let n=0;n<e.nodes.length;n++){const r=e.startValue+t*(n+1),i=e.nodes[n];i.interpolated=!0,i.qText=`${r}`,i.qNum=r,delete i.qIsNull}}})})}({dataPage:e})}}function nK(e){return{id:e,parents:[],children:[],parentsDict:{},childrenDict:{}}}function rK(e,t){e.forEach(e=>e.rank=t)}function iK(e){const t=[],n={};return e.forEach(e=>{e.children.forEach(e=>{n[e.id]||(t.push(e),n[e.id]=!0)})}),t}function oK(e){const t=function(e){const t={},n=[];function r(e,r){t[e]||(t[e]=nK(e),n.push(t[e])),void 0!==r&&(t[r]||(t[r]=nK(r),n.push(t[r])),t[e].childrenDict[t[r].id]||(t[e].children.push(t[r]),t[e].childrenDict[t[r].id]=!0),t[r].parentsDict[t[e].id]||(t[r].parents.push(t[e]),t[r].parentsDict[t[e].id]=!0))}return e.forEach(e=>{for(let t=0;t<e.length-1;t++)r(e[t],e[t+1]);r(e[e.length-1])}),n}(e);let n=function(e){return e.filter(e=>0===e.parents.length)}(t),r=0;for(;n.length;)rK(n,r),r++,n=iK(n);const i=function(e){const t=[];return e.forEach(e=>{const{rank:n}=e;void 0===t[n]&&(t[n]=[]),t[n].push(e.id)}),t}(t),o=[];return i.forEach(e=>{o.push(...e)}),o}function aK({dataPage:e}){const{qSubNodes:t}=e.qData[0],n={};for(let e=0;e<t.length;e++){const r=t[e].qSubNodes;for(let e=0;e<r.length;e++){const t=r[e].qElemNo;n[t]||(n[t]={id:t,text:r[e].qText},r[e].qAttrDims&&(n[t].qAttrDims=r[e].qAttrDims))}}const r=t.map(e=>e.qSubNodes.map(e=>e.qElemNo));return oK(r).map(e=>n[e])}function sK({qElemNo:e,qText:t,qAttrDims:n,referenceNode:r}){const[i]=r.qSubNodes,o={qElemNo:e,qText:t,qRow:r.qRow,qType:"N",qValue:"NaN",qUp:0,qDown:0,qMaxPos:"NaN",qMinNeg:0,qSubNodes:[{qElemNo:0,qText:"-",qRow:i.qRow,qType:"U",qValue:"NaN",qUp:0,qDown:0,qMaxPos:0,qMinNeg:0,qSubNodes:[]}]};return n&&(o.qAttrDims=n),i.qAttrExps&&(o.qSubNodes[0].qAttrExps={qValues:[{qNum:"NaN"}]}),o}function lK({layoutService:e}){const{isZero:t,isStacked:n,isConnect:r}=e.meta,i=()=>t||n&&r,o=({dataPage:e})=>{e?.qData?.length&&(t?function({dataPage:e}){if(!e?.qData?.length&&!e?.qMatrix?.length)return;const t=aK({dataPage:e});e.qData[0].qSubNodes.forEach(e=>{if(e.qSubNodes.length===t.length)return;const n=e.qSubNodes[0];for(let r=0;r<t.length;r++)e.qSubNodes[r]&&e.qSubNodes[r].qElemNo===t[r].id||e.qSubNodes.splice(r,0,sK({qElemNo:t[r].id,qText:t[r].text,qAttrDims:t[r].qAttrDims,referenceNode:n}))})}({dataPage:e}):n&&r&&function({dataPage:e}){const t=aK({dataPage:e}),n=t.map(()=>[{startValue:NaN,endValue:NaN,nodes:[]}]),{qSubNodes:r}=e.qData[0],i=e=>"NaN"===e.qValue;r.forEach((e,o)=>{for(let a=0;a<t.length;a++){const{qSubNodes:s}=e;if(!s[a]||s[a].qElemNo!==t[a].id){const e=s[0],n=sK({qElemNo:t[a].id,qText:t[a].text,qAttrDims:t[a].qAttrDims,referenceNode:e});s.splice(a,0,n)}const l=s[a],c=n[a][n[a].length-1],u=0===o;if(i(l.qSubNodes[0])){if(!u&&(!c.nodes.length||Number.isNaN(c.startValue))){const e=r[o-1].qSubNodes[a];c.startValue=i(e.qSubNodes[0])?NaN:e.qSubNodes[0].qValue}c.nodes.push(l)}else c.nodes.length&&(c.endValue=i(l.qSubNodes[0])?NaN:l.qSubNodes[0].qValue,n[a].push({startValue:NaN,endValue:NaN,nodes:[]}))}}),n.forEach(e=>{e.forEach(e=>{if(!Number.isNaN(e.startValue)&&!Number.isNaN(e.endValue)){const t=(e.endValue-e.startValue)/(e.nodes.length+1);for(let n=0;n<e.nodes.length;n++){const r=e.startValue+t*(n+1),i=e.nodes[n];i[r<0?"qMinNeg":"qMaxPos"]=r;const o=i.qSubNodes[0];o.qType="V",o.qText=`${r}`,o.qValue=r,o.interpolated=!0}}})})}({dataPage:e}))};return{shouldProcess:()=>i(),shouldProcessInitialPage:()=>i(),getFilteredDataPage:({dataPage:e})=>e,processDataPage:({dataPage:e})=>o({dataPage:e})}}function cK({layoutService:e}){return(e.meta.isOneDimensional?tK:lK)({layoutService:e})}function uK({layoutService:e}){const{isStacked:t,isConnect:n}=e.meta;return{shouldProcess:()=>t&&n,shouldProcessInitialPage:()=>!1,getFilteredDataPage:({dataPage:e})=>e,processDataPage:({dataPage:e})=>function({dataPage:e}){const{qMatrix:t}=e,n=t.reduce((e,t,n)=>{for(let r=1;r<t.length;r++)0===n&&(e[r]=[]),e[r].push({node:t[r],num:t[0].qNum});return e},{}),r=e=>"NaN"===e.qNum;Object.keys(n).forEach(e=>{const t=n[e],i=[{startValue:NaN,startNum:NaN,endValue:NaN,endNum:NaN,nodes:[]}];for(let e=0;e<t.length;e++){const{node:n}=t[e],o=0===e,a=i[i.length-1];if(r(n)){if(!o&&(!a.nodes.length||Number.isNaN(a.startValue))){const n=t[e-1].node;a.startValue=r(n)?NaN:n.qNum,a.startNum=r(n)?NaN:t[e-1].num}i[i.length-1].nodes.push(t[e])}else a.nodes.length&&(a.endValue=r(n)?NaN:n.qNum,a.endNum=r(n)?NaN:t[e].num,i.push({startValue:NaN,startNum:NaN,endValue:NaN,endNum:NaN,nodes:[]}))}i.forEach(e=>{if(!Number.isNaN(e.startValue)&&!Number.isNaN(e.endValue)){const t=e.endValue-e.startValue,n=e.endNum-e.startNum;for(let r=0;r<e.nodes.length;r++){const i=(e.nodes[r].num-e.startNum)/n*t+e.startValue,{node:o}=e.nodes[r];o.qText=`${i}`,o.qNum=i,o.interpolated=!0}}})})}({dataPage:e})}}function dK({dataPage:e,layoutService:t}){const{dimensions:n}=t?.meta?.size||{};if(2===n?.length&&e.qMatrix.length>=n[0]*n[1])return;const{qMatrix:r}=e,i={rows:[],headers:[],dictionary:{}},o={headers:[],dictionary:{}};r.forEach(e=>{const t=e[0].qElemNumber,n=e[1].qElemNumber;void 0===i.dictionary[t]&&(i.rows.push([]),i.headers.push(e[0]),i.dictionary[t]={index:i.headers.length-1,hasAttrExps:!1});const r=i.rows[i.dictionary[t].index];void 0===o.dictionary[n]&&(o.headers.push(e[1]),o.dictionary[n]=o.headers.length-1),r[o.dictionary[n]]=e,i.dictionary[t].hasAttrExps=i.dictionary[t].hasAttrExps||!!e[2].qAttrExps});const a=i.headers.length,s=o.headers.length;if(r.length>=a*s)return;o.sortedHeaders=[...o.headers],o.sortedHeaders.sort((e,t)=>e.qElemNumber-t.qElemNumber);let l=0;for(let e=0;e<a;e++){const t=i.headers[e],n=i.rows[e],a=t.qElemNumber,{hasAttrExps:c}=i.dictionary[a];for(let e=0;e<s;e++){const i=o.sortedHeaders[e],a=i.qElemNumber,s=n[o.dictionary[a]];if(s)r[l++]=s;else{const e={qText:"-",qNum:"NaN",injected:!0};c&&(e.qAttrExps={qValues:[{qNum:"NaN"}]}),r[l++]=[{...t},{...i},e]}}}}function fK({layoutService:e}){const{isGap:t,isZero:n,isStacked:r,isConnect:i}=e.meta,o=({dataPage:o})=>{t||n?dK({dataPage:o,layoutService:e}):r&&i&&function({dataPage:e,layoutService:t}){dK({dataPage:e,layoutService:t});const{qMatrix:n}=e,r=n.reduce((e,t)=>(e[t[1].qElemNumber]||(e[t[1].qElemNumber]=[]),e[t[1].qElemNumber].push(t),e),{}),i=e=>"NaN"===e[2].qNum;Object.keys(r).forEach(e=>{const t=r[e],n=[{startValue:NaN,startNum:NaN,endValue:NaN,endNum:NaN,nodes:[]}];for(let e=0;e<t.length;e++){const r=t[e],o=0===e,a=n[n.length-1];if(i(r)){if(!o&&(!a.nodes.length||Number.isNaN(a.startValue))){const n=t[e-1];a.startValue=i(n)?NaN:n[2].qNum,a.startNum=i(n)?NaN:n[0].qNum}n[n.length-1].nodes.push(t[e])}else a.nodes.length&&(a.endValue=i(r)?NaN:r[2].qNum,a.endNum=i(r)?NaN:r[0].qNum,n.push({startValue:NaN,startNum:NaN,endValue:NaN,endNum:NaN,nodes:[]}))}n.forEach(e=>{if(!Number.isNaN(e.startValue)&&!Number.isNaN(e.endValue)){const t=e.endValue-e.startValue,n=e.endNum-e.startNum;for(let r=0;r<e.nodes.length;r++){const i=(e.nodes[r][0].qNum-e.startNum)/n*t+e.startValue,o=e.nodes[r];o[2].qText=`${i}`,o[2].qNum=i,o[2].interpolated=!0}}})})}({dataPage:o,layoutService:e})};return{shouldProcess:()=>t||n||r&&i,shouldProcessInitialPage:()=>!1,getFilteredDataPage:({dataPage:e})=>function({dataPage:e}){return{...e,qMatrix:e?.qMatrix?.filter(e=>!e[2]?.injected)||[]}}({dataPage:e}),processDataPage:({dataPage:e})=>o({dataPage:e})}}function hK({layoutService:e}){return(e.meta.isOneDimensional?uK:fK)({layoutService:e})}function pK({layoutService:e}){const t=function({layoutService:e}){return(e.meta.isDiscrete?cK:hK)({layoutService:e})}({layoutService:e}),n={shouldProcess:t.shouldProcess()};if(t.shouldProcessInitialPage()){const n=e.getDataPages();t.processDataPage({dataPage:n&&n.length?n[0]:[]})}return{query:{getShouldProcess:()=>n.shouldProcess,getFilteredDataPage:({dataPage:e})=>t.getFilteredDataPage({dataPage:e})},command:{processDataPage:({dataPage:e})=>{n.shouldProcess&&t.processDataPage({dataPage:e})}}}}function mK({layoutService:e,extremumModel:t,largeDataService:n}){return function(e){var t,n=e.layout,r=e.config,i=void 0===r?{}:r,o={disclaimer:void 0,isSuppressing:!1,showDisclaimer:null!==(t=i.args)&&void 0!==t&&t.layoutService?i.args.layoutService.getLayoutValue("showDisclaimer"):null==n?void 0:n.showDisclaimer};return{initialize:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).args;o.disclaimer=function(e){var t=e.args,n=e.disclaimers,r=[];return Object.keys(n).forEach(function(e){var i=cu[e],o=n[e];o&&(o.condition||(null==i?void 0:i.condition)||uu)(t)&&r.push({key:(null==i?void 0:i.translationKey)||(null==i?void 0:i.key)||e,alignment:o.alignment||(null==i?void 0:i.alignment)||lu})}),r.find(function(e){return e.alignment===su})||r[0]}({args:Fa(Fa({layout:n},i.args),e),disclaimers:i.disclaimers||{}}),o.isSuppressing=!(!o.disclaimer||o.disclaimer.alignment!==su)},getDisclaimer:function(){return o.isSuppressing?o.disclaimer:!1===o.showDisclaimer?void 0:o.disclaimer},getHasSuppressingDisclaimer:function(){return o.isSuppressing}}}({config:{args:{layoutService:e},disclaimers:{NoDataExist:!0,LimitedData:{condition:()=>{const{isTwoDimensional:t,isContinuous:r,size:i}=e.meta;if(!t)return!1;if(r)return i.y>(n?.meta?.maxNumPoints||oy.DEFAULT_NUM_POINTS);if(!e.meta.mode.K)return!1;const[o]=e.getDataPages(),[a]=o.qData;return!!a&&a.qSubNodes.some(e=>e.qDown>0)}},OnlyNanDataMeasure:!0,OnlyNanDataDimensionContinuous:!0,DataRangeIncludingZero:{condition:()=>{const n=e.getLayoutValue("measureAxis.logarithmic",!1),r=t.query.getExtrema();return n&&r.meta.includesZero}}}}})}const gK=e=>"number"==typeof e&&!Number.isNaN(e),yK=["forecast","forecast_lower","forecast_upper"];function vK({layoutService:e}){return function(){let t=e.getHyperCubeValue("qMeasureInfo");return t=function(e){return e.concat(...e.map(e=>e.qAttrExprInfo?.filter(e=>-1!==yK.indexOf(e.id))??[]))}(t),{min:Math.min(...t.filter(e=>gK(e.qMin)).map(e=>e.qMin)),max:Math.max(...t.filter(e=>gK(e.qMax)).map(e=>e.qMax))}}}const{isNumber:bK}=to;function xK({layoutService:e}){const{isStacked:t,isOneDimensional:n}=e.meta;return t?n?function({dataPage:e,count:t}){const{qMatrix:n}=e,r={min:NaN,max:NaN};return n.forEach(e=>{let n=0,i=0;e.slice(-t).forEach(e=>{"NaN"!==e.qNum&&(e.qNum>=0?i+=e.qNum:n+=e.qNum)}),r.min=Number.isNaN(r.min)?n:Math.min(n,r.min),r.max=Number.isNaN(r.max)?i:Math.max(i,r.max)}),r}:function({dataPage:e,count:t}){const n={min:NaN,max:NaN};if(e.qData){const{qData:t}=e;return n.min=Math.min(...t[0].qSubNodes.filter(e=>bK(e.qMinNeg)).map(e=>e.qMinNeg)),n.max=Math.max(...t[0].qSubNodes.filter(e=>bK(e.qMaxPos)).map(e=>e.qMaxPos)),n}const{qMatrix:r}=e,i={};return r.forEach(e=>{const n=e[0].qElemNumber;i[n]||(i[n]={key:n,min:0,max:0}),e.slice(t).forEach(e=>{"NaN"!==e.qNum&&(e.qNum>=0?i[n].max+=e.qNum:i[n].min+=e.qNum)})}),Object.keys(i).forEach(e=>{n.min=Number.isNaN(n.min)?i[e].min:Math.min(i[e].min,n.min),n.max=Number.isNaN(n.max)?i[e].max:Math.max(i[e].max,n.max)}),n}:vK({layoutService:e})}function SK(e){const t=[];return e.forEach((e,n)=>{const r=e.qAttrExprInfo.findIndex(e=>"forecast"===e.id),i=e.qAttrExprInfo.findIndex(e=>"forecast_lower"===e.id),o=e.qAttrExprInfo.findIndex(e=>"forecast_upper"===e.id);if(-1===r)return;const a={measureIndex:n,field:`qMeasureInfo/${n}/qAttrExprInfo/${r}`};-1!==i&&-1!==o&&(a.lower=`qMeasureInfo/${n}/qAttrExprInfo/${i}`,a.upper=`qMeasureInfo/${n}/qAttrExprInfo/${o}`),t.push(a)}),t}const MK=e=>({layout:t,meta:n})=>{const r=p.canBeContinuous(t),{hasMultipleDimensions:i,hasMultipleMeasures:o,dimensionCount:a}=n,s=!e("continuousData")&&S.continuous({layout:t,auto:()=>p.isTime(!0,t)}),l=!(!t.lineType||"area"!==t.lineType),c=l&&t.stackedArea&&(i||o),u=t.nullMode||"gap";return{canBeContinuous:r,isDiscrete:!s,isArea:l,isStacked:c,isContinuous:s,isTime:p.isTime(s,t),isSnapshot:S.snapshot(t),isOneDimensional:1===a,isTwoDimensional:2===a,isGap:"gap"===u,isConnect:"connect"===u,isZero:"zero"===u}};function wK({layoutService:e}){const{dimensionCount:t,measureCount:n,isStacked:r}=e.meta,i=2===t&&r?1:0;return{qTop:0,qLeft:i,qWidth:t+n+i,qHeight:Math.min(2e3,1e4/(n+1))}}function kK({enigmaModel:e,layoutService:t}){return function(){return function(e,t,n){return e.getHyperCubeReducedData(n.path,[n.rect],n.zoomLevel,n.filter).catch(w).then(e=>{const n=t.getHyperCubeValue("qMode"),r=t.getHyperCubeValue("qDimensionInfo"),i="K"===n&&r.length>1&&e[0]?.qIsReduced,o=e.slice(),a=t.getHyperCubeValue("qMeasureInfo"),s=i?[]:t.getHyperCubeValue("qColumnOrder");return{reducedCube:{qDataPages:o,qDimensionInfo:r.slice(),qEffectiveInterColumnSortOrder:[1,0],qMeasureInfo:i?[a[0],a[0]]:a.slice(),qStackedDataPages:[],qMode:"S",qHasOtherValues:t.getHyperCubeValue("qHasOtherValues"),qSize:t.getHyperCubeValue("qSize"),qColumnOrder:s}}})}(e,t,{path:"/qHyperCubeDef",rect:wK({layoutService:t}),zoomLevel:-1,filter:"D1"})}}function EK({enigmaModel:e,layoutService:t}){const{isSnapshot:n,isContinuous:r}=t.meta;return n?function({layoutService:e}){return function(){return Promise.resolve({reducedCube:e.getLayoutValue("reducedHyperCube")||l(!0,{},e.getHyperCube())})}}({layoutService:t}):r?function({layoutService:e}){return function(){const t=e.getHyperCube();return Promise.resolve({reducedCube:{...t,qDataPages:[...t.qDataPages]}})}}({layoutService:t}):kK({enigmaModel:e,layoutService:t})}function CK({setSelectionInfo:e,event:t,components:n,clear:r}){const i=n?.length?n.map(e=>e.key).filter(Boolean):[];e({event:t,components:i,minorRange:"minorRange"===t,legendRange:"legendRange"===t,legendTap:"tap"===t&&i[0]===Gb.COMPONENT.LEGEND_CATEGORICAL}),r()}function NK({chart:e,actions:t,selections:n}){const r=e.scale(Gb.SCALE.MAIN.MAJOR),i=jf({chart:e,actions:t,selections:n,config:{allowSimultaneous:!0,brushRanges:!0,majorScale:r,selectionActions:{reset(){e.brushSelectionIncludeMax=void 0,t.lasso.active()&&t.lasso.action(!1)},clear:({clearMinor:t,clearDiscrete:n,clearLegend:r})=>{!function({clearMinor:e,clearDiscrete:t,clearLegend:n,chart:r}){e(),t({brushName:!1}),n(),r.brush("lazySelection").clear()}({clearMinor:t,clearDiscrete:n,clearLegend:r,chart:e})}},selectionEvents:{start:CK},custom:{getShouldIncludeMax:({datum:t})=>e.brushSelectionIncludeMax&&t===r.max(),getIsOuterDimensionLocked:()=>i.getIsDimensionLocked(0),getIsInnerDimensionLocked:()=>i.getIsDimensionLocked(1)}}}),o=e.brush("lazySelection"),a={activate:()=>{},deactivated:()=>o.end(),cleared:()=>o.clear(),canceled:()=>o.end()};var s,l;return s=n,l=a,Object.keys(l).forEach(e=>{s?.on(e,l[e])}),i.destroyLazySelection=()=>{((e,t)=>{Object.keys(t).forEach(n=>{e?.removeListener(n,t[n])})})(n,a)},i}var TK,DK,qK,OK,IK,AK,_K,LK,PK,RK,FK,zK,jK,$K,VK,UK,HK,BK,WK,YK,GK,KK,XK,JK,ZK,QK,eX,tX,nX,rX,iX,oX,aX,sX,lX,cX,uX,dX,fX,hX,pX,mX,gX,yX,vX,bX,xX,SX,MX,wX,kX,EX,CX,NX,TX,DX,qX,OX,IX,AX,_X,LX,PX,RX,FX,zX,jX,$X,VX,UX,HX,BX,WX,YX,GX,KX,XX,JX,ZX,QX,eJ,tJ,nJ,rJ,iJ,oJ,aJ,sJ,lJ,cJ,uJ,dJ={exports:{}};function fJ(){if(DK)return TK;DK=1;const e=Number.MAX_SAFE_INTEGER||9007199254740991;return TK={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:e,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}}function hJ(){if(OK)return qK;OK=1;const e="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};return qK=e}function pJ(){return IK||(IK=1,function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=fJ(),o=hJ(),a=(t=e.exports={}).re=[],s=t.safeRe=[],l=t.src=[],c=t.safeSrc=[],u=t.t={};let d=0;const f="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",i],[f,r]],p=(e,t,n)=>{const r=(e=>{for(const[t,n]of h)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e})(t),i=d++;o(e,i,t),u[e]=i,l[i]=t,c[i]=r,a[i]=new RegExp(t,n?"g":void 0),s[i]=new RegExp(r,n?"g":void 0)};p("NUMERICIDENTIFIER","0|[1-9]\\d*"),p("NUMERICIDENTIFIERLOOSE","\\d+"),p("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),p("MAINVERSION",`(${l[u.NUMERICIDENTIFIER]})\\.(${l[u.NUMERICIDENTIFIER]})\\.(${l[u.NUMERICIDENTIFIER]})`),p("MAINVERSIONLOOSE",`(${l[u.NUMERICIDENTIFIERLOOSE]})\\.(${l[u.NUMERICIDENTIFIERLOOSE]})\\.(${l[u.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASEIDENTIFIER",`(?:${l[u.NONNUMERICIDENTIFIER]}|${l[u.NUMERICIDENTIFIER]})`),p("PRERELEASEIDENTIFIERLOOSE",`(?:${l[u.NONNUMERICIDENTIFIER]}|${l[u.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASE",`(?:-(${l[u.PRERELEASEIDENTIFIER]}(?:\\.${l[u.PRERELEASEIDENTIFIER]})*))`),p("PRERELEASELOOSE",`(?:-?(${l[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[u.PRERELEASEIDENTIFIERLOOSE]})*))`),p("BUILDIDENTIFIER",`${f}+`),p("BUILD",`(?:\\+(${l[u.BUILDIDENTIFIER]}(?:\\.${l[u.BUILDIDENTIFIER]})*))`),p("FULLPLAIN",`v?${l[u.MAINVERSION]}${l[u.PRERELEASE]}?${l[u.BUILD]}?`),p("FULL",`^${l[u.FULLPLAIN]}$`),p("LOOSEPLAIN",`[v=\\s]*${l[u.MAINVERSIONLOOSE]}${l[u.PRERELEASELOOSE]}?${l[u.BUILD]}?`),p("LOOSE",`^${l[u.LOOSEPLAIN]}$`),p("GTLT","((?:<|>)?=?)"),p("XRANGEIDENTIFIERLOOSE",`${l[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),p("XRANGEIDENTIFIER",`${l[u.NUMERICIDENTIFIER]}|x|X|\\*`),p("XRANGEPLAIN",`[v=\\s]*(${l[u.XRANGEIDENTIFIER]})(?:\\.(${l[u.XRANGEIDENTIFIER]})(?:\\.(${l[u.XRANGEIDENTIFIER]})(?:${l[u.PRERELEASE]})?${l[u.BUILD]}?)?)?`),p("XRANGEPLAINLOOSE",`[v=\\s]*(${l[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[u.XRANGEIDENTIFIERLOOSE]})(?:${l[u.PRERELEASELOOSE]})?${l[u.BUILD]}?)?)?`),p("XRANGE",`^${l[u.GTLT]}\\s*${l[u.XRANGEPLAIN]}$`),p("XRANGELOOSE",`^${l[u.GTLT]}\\s*${l[u.XRANGEPLAINLOOSE]}$`),p("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),p("COERCE",`${l[u.COERCEPLAIN]}(?:$|[^\\d])`),p("COERCEFULL",l[u.COERCEPLAIN]+`(?:${l[u.PRERELEASE]})?`+`(?:${l[u.BUILD]})?(?:$|[^\\d])`),p("COERCERTL",l[u.COERCE],!0),p("COERCERTLFULL",l[u.COERCEFULL],!0),p("LONETILDE","(?:~>?)"),p("TILDETRIM",`(\\s*)${l[u.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",p("TILDE",`^${l[u.LONETILDE]}${l[u.XRANGEPLAIN]}$`),p("TILDELOOSE",`^${l[u.LONETILDE]}${l[u.XRANGEPLAINLOOSE]}$`),p("LONECARET","(?:\\^)"),p("CARETTRIM",`(\\s*)${l[u.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",p("CARET",`^${l[u.LONECARET]}${l[u.XRANGEPLAIN]}$`),p("CARETLOOSE",`^${l[u.LONECARET]}${l[u.XRANGEPLAINLOOSE]}$`),p("COMPARATORLOOSE",`^${l[u.GTLT]}\\s*(${l[u.LOOSEPLAIN]})$|^$`),p("COMPARATOR",`^${l[u.GTLT]}\\s*(${l[u.FULLPLAIN]})$|^$`),p("COMPARATORTRIM",`(\\s*)${l[u.GTLT]}\\s*(${l[u.LOOSEPLAIN]}|${l[u.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",p("HYPHENRANGE",`^\\s*(${l[u.XRANGEPLAIN]})\\s+-\\s+(${l[u.XRANGEPLAIN]})\\s*$`),p("HYPHENRANGELOOSE",`^\\s*(${l[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[u.XRANGEPLAINLOOSE]})\\s*$`),p("STAR","(<|>)?=?\\s*\\*"),p("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),p("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(dJ,dJ.exports)),dJ.exports}function mJ(){if(_K)return AK;_K=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return AK=n=>n?"object"!=typeof n?e:n:t}function gJ(){if(PK)return LK;PK=1;const e=/^[0-9]+$/,t=(t,n)=>{if("number"==typeof t&&"number"==typeof n)return t===n?0:t<n?-1:1;const r=e.test(t),i=e.test(n);return r&&i&&(t=+t,n=+n),t===n?0:r&&!i?-1:i&&!r?1:t<n?-1:1};return LK={compareIdentifiers:t,rcompareIdentifiers:(e,n)=>t(n,e)},LK}function yJ(){if(FK)return RK;FK=1;const e=hJ(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:n}=fJ(),{safeRe:r,t:i}=pJ(),o=mJ(),{compareIdentifiers:a}=gJ();class s{constructor(a,l){if(l=o(l),a instanceof s){if(a.loose===!!l.loose&&a.includePrerelease===!!l.includePrerelease)return a;a=a.version}else if("string"!=typeof a)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof a}".`);if(a.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",a,l),this.options=l,this.loose=!!l.loose,this.includePrerelease=!!l.includePrerelease;const c=a.trim().match(l.loose?r[i.LOOSE]:r[i.FULL]);if(!c)throw new TypeError(`Invalid Version: ${a}`);if(this.raw=a,this.major=+c[1],this.minor=+c[2],this.patch=+c[3],this.major>n||this.major<0)throw new TypeError("Invalid major version");if(this.minor>n||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>n||this.patch<0)throw new TypeError("Invalid patch version");c[4]?this.prerelease=c[4].split(".").map(e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<n)return t}return e}):this.prerelease=[],this.build=c[5]?c[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(e("SemVer.compare",this.version,this.options,t),!(t instanceof s)){if("string"==typeof t&&t===this.version)return 0;t=new s(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(e){return e instanceof s||(e=new s(e,this.options)),this.major<e.major?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:this.patch>e.patch?1:0}comparePre(t){if(t instanceof s||(t=new s(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let n=0;do{const r=this.prerelease[n],i=t.prerelease[n];if(e("prerelease compare",n,r,i),void 0===r&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===r)return-1;if(r!==i)return a(r,i)}while(++n)}compareBuild(t){t instanceof s||(t=new s(t,this.options));let n=0;do{const r=this.build[n],i=t.build[n];if(e("build compare",n,r,i),void 0===r&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===r)return-1;if(r!==i)return a(r,i)}while(++n)}inc(e,t,n){if(e.startsWith("pre")){if(!t&&!1===n)throw new Error("invalid increment argument: identifier is empty");if(t){const e=`-${t}`.match(this.options.loose?r[i.PRERELEASELOOSE]:r[i.PRERELEASE]);if(!e||e[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,n),this.inc("pre",t,n);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,n),this.inc("pre",t,n);break;case"release":if(0===this.prerelease.length)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(n)?1:0;if(0===this.prerelease.length)this.prerelease=[e];else{let r=this.prerelease.length;for(;--r>=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);if(-1===r){if(t===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let r=[t,e];if(!1===n&&(r=[t]),((e,t)=>{const n=t.split(".");if(n.length>e.length)return!1;for(let t=0;t<n.length;t++)if(0!==a(e[t],n[t]))return!1;return!0})(this.prerelease,t)){const e=this.prerelease[t.split(".").length];isNaN(e)&&(this.prerelease=r)}else this.prerelease=r}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return RK=s}function vJ(){if(jK)return zK;jK=1;const e=yJ();return zK=(t,n,r=!1)=>{if(t instanceof e)return t;try{return new e(t,n)}catch(e){if(!r)return null;throw e}},zK}function bJ(){if(iX)return rX;iX=1;const e=yJ();return rX=(t,n,r)=>new e(t,r).compare(new e(n,r)),rX}function xJ(){if(uX)return cX;uX=1;const e=yJ();return cX=(t,n,r)=>{const i=new e(t,r),o=new e(n,r);return i.compare(o)||i.compareBuild(o)},cX}function SJ(){if(gX)return mX;gX=1;const e=bJ();return mX=(t,n,r)=>e(t,n,r)>0,mX}function MJ(){if(vX)return yX;vX=1;const e=bJ();return yX=(t,n,r)=>e(t,n,r)<0,yX}function wJ(){if(xX)return bX;xX=1;const e=bJ();return bX=(t,n,r)=>0===e(t,n,r),bX}function kJ(){if(MX)return SX;MX=1;const e=bJ();return SX=(t,n,r)=>0!==e(t,n,r),SX}function EJ(){if(kX)return wX;kX=1;const e=bJ();return wX=(t,n,r)=>e(t,n,r)>=0,wX}function CJ(){if(CX)return EX;CX=1;const e=bJ();return EX=(t,n,r)=>e(t,n,r)<=0,EX}function NJ(){if(TX)return NX;TX=1;const e=wJ(),t=kJ(),n=SJ(),r=EJ(),i=MJ(),o=CJ();return NX=(a,s,l,c)=>{switch(s){case"===":return"object"==typeof a&&(a=a.version),"object"==typeof l&&(l=l.version),a===l;case"!==":return"object"==typeof a&&(a=a.version),"object"==typeof l&&(l=l.version),a!==l;case"":case"=":case"==":return e(a,l,c);case"!=":return t(a,l,c);case">":return n(a,l,c);case">=":return r(a,l,c);case"<":return i(a,l,c);case"<=":return o(a,l,c);default:throw new TypeError(`Invalid operator: ${s}`)}},NX}function TJ(){if(PX)return LX;PX=1;const e=/\s+/g;class t{constructor(n,r){if(r=i(r),n instanceof t)return n.loose===!!r.loose&&n.includePrerelease===!!r.includePrerelease?n:new t(n.raw,r);if(n instanceof o)return this.raw=n.value,this.set=[[n]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=n.trim().replace(e," "),this.set=this.raw.split("||").map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter(e=>!y(e[0])),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&v(e[0])){this.set=[e];break}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");const t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=" "),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){e=e.replace(g,"");const t=((this.options.includePrerelease&&p)|(this.options.loose&&m))+":"+e,n=r.get(t);if(n)return n;const i=this.options.loose,s=i?l[u.HYPHENRANGELOOSE]:l[u.HYPHENRANGE];e=e.replace(s,q(this.options.includePrerelease)),a("hyphen replace",e),e=e.replace(l[u.COMPARATORTRIM],d),a("comparator trim",e),e=e.replace(l[u.TILDETRIM],f),a("tilde trim",e),e=e.replace(l[u.CARETTRIM],h),a("caret trim",e);let c=e.split(" ").map(e=>x(e,this.options)).join(" ").split(/\s+/).map(e=>D(e,this.options));i&&(c=c.filter(e=>(a("loose invalid filter",e,this.options),!!e.match(l[u.COMPARATORLOOSE])))),a("range list",c);const v=new Map,b=c.map(e=>new o(e,this.options));for(const e of b){if(y(e))return[e];v.set(e.value,e)}v.size>1&&v.has("")&&v.delete("");const S=[...v.values()];return r.set(t,S),S}intersects(e,n){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(t=>b(t,n)&&e.set.some(e=>b(e,n)&&t.every(t=>e.every(e=>t.intersects(e,n)))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new s(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(O(this.set[t],e,this.options))return!0;return!1}}LX=t;const n=(_X||(_X=1,AX=class{constructor(){this.max=1e3,this.map=new Map}get(e){const t=this.map.get(e);return void 0===t?void 0:(this.map.delete(e),this.map.set(e,t),t)}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&void 0!==t){if(this.map.size>=this.max){const e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}),AX),r=new n,i=mJ(),o=DJ(),a=hJ(),s=yJ(),{safeRe:l,src:c,t:u,comparatorTrimReplace:d,tildeTrimReplace:f,caretTrimReplace:h}=pJ(),{FLAG_INCLUDE_PRERELEASE:p,FLAG_LOOSE:m}=fJ(),g=new RegExp(c[u.BUILD],"g"),y=e=>"<0.0.0-0"===e.value,v=e=>""===e.value,b=(e,t)=>{let n=!0;const r=e.slice();let i=r.pop();for(;n&&r.length;)n=r.every(e=>i.intersects(e,t)),i=r.pop();return n},x=(e,t)=>(e=e.replace(l[u.BUILD],""),a("comp",e,t),e=k(e,t),a("caret",e),e=M(e,t),a("tildes",e),e=C(e,t),a("xrange",e),e=T(e,t),a("stars",e),e),S=e=>!e||"x"===e.toLowerCase()||"*"===e,M=(e,t)=>e.trim().split(/\s+/).map(e=>w(e,t)).join(" "),w=(e,t)=>{const n=t.loose?l[u.TILDELOOSE]:l[u.TILDE];return e.replace(n,(t,n,r,i,o)=>{let s;return a("tilde",e,t,n,r,i,o),S(n)?s="":S(r)?s=`>=${n}.0.0 <${+n+1}.0.0-0`:S(i)?s=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:o?(a("replaceTilde pr",o),s=`>=${n}.${r}.${i}-${o} <${n}.${+r+1}.0-0`):s=`>=${n}.${r}.${i} <${n}.${+r+1}.0-0`,a("tilde return",s),s})},k=(e,t)=>e.trim().split(/\s+/).map(e=>E(e,t)).join(" "),E=(e,t)=>{a("caret",e,t);const n=t.loose?l[u.CARETLOOSE]:l[u.CARET],r=t.includePrerelease?"-0":"";return e.replace(n,(t,n,i,o,s)=>{let l;return a("caret",e,t,n,i,o,s),S(n)?l="":S(i)?l=`>=${n}.0.0${r} <${+n+1}.0.0-0`:S(o)?l="0"===n?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:s?(a("replaceCaret pr",s),l="0"===n?"0"===i?`>=${n}.${i}.${o}-${s} <${n}.${i}.${+o+1}-0`:`>=${n}.${i}.${o}-${s} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${o}-${s} <${+n+1}.0.0-0`):(a("no pr"),l="0"===n?"0"===i?`>=${n}.${i}.${o} <${n}.${i}.${+o+1}-0`:`>=${n}.${i}.${o} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${o} <${+n+1}.0.0-0`),a("caret return",l),l})},C=(e,t)=>(a("replaceXRanges",e,t),e.split(/\s+/).map(e=>N(e,t)).join(" ")),N=(e,t)=>{e=e.trim();const n=t.loose?l[u.XRANGELOOSE]:l[u.XRANGE];return e.replace(n,(n,r,i,o,s,l)=>{if(a("xRange",e,n,r,i,o,s,l),((e,t,n)=>S(e)&&!S(t)||S(t)&&n&&!S(n))(i,o,s))return e;const c=S(i),u=c||S(o),d=u||S(s),f=d;return"="===r&&f&&(r=""),l=t.includePrerelease?"-0":"",c?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&f?(u&&(o=0),s=0,">"===r?(r=">=",u?(i=+i+1,o=0,s=0):(o=+o+1,s=0)):"<="===r&&(r="<",u?i=+i+1:o=+o+1),"<"===r&&(l="-0"),n=`${r+i}.${o}.${s}${l}`):u?n=`>=${i}.0.0${l} <${+i+1}.0.0-0`:d&&(n=`>=${i}.${o}.0${l} <${i}.${+o+1}.0-0`),a("xRange return",n),n})},T=(e,t)=>(a("replaceStars",e,t),e.trim().replace(l[u.STAR],"")),D=(e,t)=>(a("replaceGTE0",e,t),e.trim().replace(l[t.includePrerelease?u.GTE0PRE:u.GTE0],"")),q=e=>(t,n,r,i,o,a,s,l,c,u,d,f)=>`${n=S(r)?"":S(i)?`>=${r}.0.0${e?"-0":""}`:S(o)?`>=${r}.${i}.0${e?"-0":""}`:a?`>=${n}`:`>=${n}${e?"-0":""}`} ${l=S(c)?"":S(u)?`<${+c+1}.0.0-0`:S(d)?`<${c}.${+u+1}.0-0`:f?`<=${c}.${u}.${d}-${f}`:e?`<${c}.${u}.${+d+1}-0`:`<=${l}`}`.trim(),O=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(a(e[n].semver),e[n].semver!==o.ANY&&e[n].semver.prerelease.length>0){const r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0};return LX}function DJ(){if(FX)return RX;FX=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(r,i){if(i=n(i),r instanceof t){if(r.loose===!!i.loose)return r;r=r.value}r=r.trim().split(/\s+/).join(" "),a("comparator",r,i),this.options=i,this.loose=!!i.loose,this.parse(r),this.semver===e?this.value="":this.value=this.operator+this.semver.version,a("comp",this)}parse(t){const n=this.options.loose?r[i.COMPARATORLOOSE]:r[i.COMPARATOR],o=t.match(n);if(!o)throw new TypeError(`Invalid comparator: ${t}`);this.operator=void 0!==o[1]?o[1]:"","="===this.operator&&(this.operator=""),o[2]?this.semver=new s(o[2],this.options.loose):this.semver=e}toString(){return this.value}test(t){if(a("Comparator.test",t,this.options.loose),this.semver===e||t===e)return!0;if("string"==typeof t)try{t=new s(t,this.options)}catch(e){return!1}return o(t,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new l(e.value,r).test(this.value):""===e.operator?""===e.value||new l(this.value,r).test(e.semver):(!(r=n(r)).includePrerelease||"<0.0.0-0"!==this.value&&"<0.0.0-0"!==e.value)&&(!(!r.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))&&(!(!this.operator.startsWith(">")||!e.operator.startsWith(">"))||(!(!this.operator.startsWith("<")||!e.operator.startsWith("<"))||(!(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))||(!!(o(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))||!!(o(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))))))}}RX=t;const n=mJ(),{safeRe:r,t:i}=pJ(),o=NJ(),a=hJ(),s=yJ(),l=TJ();return RX}function qJ(){if(jX)return zX;jX=1;const e=TJ();return zX=(t,n,r)=>{try{n=new e(n,r)}catch(e){return!1}return n.test(t)},zX}function OJ(){if(XX)return KX;XX=1;const e=TJ();return KX=(t,n)=>{try{return new e(t,n).range||"*"}catch(e){return null}},KX}function IJ(){if(ZX)return JX;ZX=1;const e=yJ(),t=DJ(),{ANY:n}=t,r=TJ(),i=qJ(),o=SJ(),a=MJ(),s=CJ(),l=EJ();return JX=(c,u,d,f)=>{let h,p,m,g,y;switch(c=new e(c,f),u=new r(u,f),d){case">":h=o,p=s,m=a,g=">",y=">=";break;case"<":h=a,p=l,m=o,g="<",y="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(i(c,u,f))return!1;for(let e=0;e<u.set.length;++e){const r=u.set[e];let i=null,o=null;if(r.forEach(e=>{e.semver===n&&(e=new t(">=0.0.0")),i=i||e,o=o||e,h(e.semver,i.semver,f)?i=e:m(e.semver,o.semver,f)&&(o=e)}),i.operator===g||i.operator===y)return!1;if((!o.operator||o.operator===g)&&p(c,o.semver))return!1;if(o.operator===y&&m(c,o.semver))return!1}return!0},JX}var AJ=function(){if(uJ)return cJ;uJ=1;const e=pJ(),t=fJ(),n=yJ(),r=gJ(),i=vJ(),o=function(){if(VK)return $K;VK=1;const e=vJ();return $K=(t,n)=>{const r=e(t,n);return r?r.version:null},$K}(),a=function(){if(HK)return UK;HK=1;const e=vJ();return UK=(t,n)=>{const r=e(t.trim().replace(/^[=v]+/,""),n);return r?r.version:null},UK}(),s=function(){if(WK)return BK;WK=1;const e=yJ();return BK=(t,n,r,i,o)=>{"string"==typeof r&&(o=i,i=r,r=void 0);try{return new e(t instanceof e?t.version:t,r).inc(n,i,o).version}catch(e){return null}},BK}(),l=function(){if(GK)return YK;GK=1;const e=vJ();return YK=(t,n)=>{const r=e(t,null,!0),i=e(n,null,!0),o=r.compare(i);if(0===o)return null;const a=o>0,s=a?r:i,l=a?i:r,c=!!s.prerelease.length;if(l.prerelease.length&&!c){if(!l.patch&&!l.minor)return"major";if(0===l.compareMain(s))return l.minor&&!l.patch?"minor":"patch"}const u=c?"pre":"";return r.major!==i.major?u+"major":r.minor!==i.minor?u+"minor":r.patch!==i.patch?u+"patch":"prerelease"},YK}(),c=function(){if(XK)return KK;XK=1;const e=yJ();return KK=(t,n)=>new e(t,n).major,KK}(),u=function(){if(ZK)return JK;ZK=1;const e=yJ();return JK=(t,n)=>new e(t,n).minor,JK}(),d=function(){if(eX)return QK;eX=1;const e=yJ();return QK=(t,n)=>new e(t,n).patch,QK}(),f=function(){if(nX)return tX;nX=1;const e=vJ();return tX=(t,n)=>{const r=e(t,n);return r&&r.prerelease.length?r.prerelease:null}}(),h=bJ(),p=function(){if(aX)return oX;aX=1;const e=bJ();return oX=(t,n,r)=>e(n,t,r),oX}(),m=function(){if(lX)return sX;lX=1;const e=bJ();return sX=(t,n)=>e(t,n,!0),sX}(),g=xJ(),y=function(){if(fX)return dX;fX=1;const e=xJ();return dX=(t,n)=>t.sort((t,r)=>e(t,r,n)),dX}(),v=function(){if(pX)return hX;pX=1;const e=xJ();return hX=(t,n)=>t.sort((t,r)=>e(r,t,n)),hX}(),b=SJ(),x=MJ(),S=wJ(),M=kJ(),w=EJ(),k=CJ(),E=NJ(),C=function(){if(qX)return DX;qX=1;const e=yJ(),t=vJ(),{safeRe:n,t:r}=pJ();return DX=(i,o)=>{if(i instanceof e)return i;if("number"==typeof i&&(i=String(i)),"string"!=typeof i)return null;let a=null;if((o=o||{}).rtl){const e=o.includePrerelease?n[r.COERCERTLFULL]:n[r.COERCERTL];let t;for(;(t=e.exec(i))&&(!a||a.index+a[0].length!==i.length);)a&&t.index+t[0].length===a.index+a[0].length||(a=t),e.lastIndex=t.index+t[1].length+t[2].length;e.lastIndex=-1}else a=i.match(o.includePrerelease?n[r.COERCEFULL]:n[r.COERCE]);if(null===a)return null;const s=a[2],l=a[3]||"0",c=a[4]||"0",u=o.includePrerelease&&a[5]?`-${a[5]}`:"",d=o.includePrerelease&&a[6]?`+${a[6]}`:"";return t(`${s}.${l}.${c}${u}${d}`,o)},DX}(),N=function(){if(IX)return OX;IX=1;const e=vJ(),t=fJ(),n=yJ(),r=(t,r)=>{const i=t instanceof n?t.version:t;return e(i,r)},i=(e,t)=>{if(o(t))return e.version;switch(e.prerelease=[],t){case"major":e.minor=0,e.patch=0;break;case"minor":e.patch=0}return e.format()},o=e=>e.startsWith("pre");return OX=(e,n,o)=>{if(!t.RELEASE_TYPES.includes(n))return null;const a=r(e,o);return a&&i(a,n)}}(),T=DJ(),D=TJ(),q=qJ(),O=function(){if(VX)return $X;VX=1;const e=TJ();return $X=(t,n)=>new e(t,n).set.map(e=>e.map(e=>e.value).join(" ").trim().split(" ")),$X}(),I=function(){if(HX)return UX;HX=1;const e=yJ(),t=TJ();return UX=(n,r,i)=>{let o=null,a=null,s=null;try{s=new t(r,i)}catch(e){return null}return n.forEach(t=>{s.test(t)&&(o&&-1!==a.compare(t)||(o=t,a=new e(o,i)))}),o},UX}(),A=function(){if(WX)return BX;WX=1;const e=yJ(),t=TJ();return BX=(n,r,i)=>{let o=null,a=null,s=null;try{s=new t(r,i)}catch(e){return null}return n.forEach(t=>{s.test(t)&&(o&&1!==a.compare(t)||(o=t,a=new e(o,i)))}),o},BX}(),_=function(){if(GX)return YX;GX=1;const e=yJ(),t=TJ(),n=SJ();return YX=(r,i)=>{r=new t(r,i);let o=new e("0.0.0");if(r.test(o))return o;if(o=new e("0.0.0-0"),r.test(o))return o;o=null;for(let t=0;t<r.set.length;++t){const i=r.set[t];let a=null;i.forEach(t=>{const r=new e(t.semver.version);switch(t.operator){case">":0===r.prerelease.length?r.patch++:r.prerelease.push(0),r.raw=r.format();case"":case">=":a&&!n(r,a)||(a=r);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${t.operator}`)}}),!a||o&&!n(o,a)||(o=a)}return o&&r.test(o)?o:null},YX}(),L=OJ(),P=IJ(),R=function(){if(eJ)return QX;eJ=1;const e=IJ();return QX=(t,n,r)=>e(t,n,">",r),QX}(),F=function(){if(nJ)return tJ;nJ=1;const e=IJ();return tJ=(t,n,r)=>e(t,n,"<",r),tJ}(),z=function(){if(iJ)return rJ;iJ=1;const e=TJ();return rJ=(t,n,r)=>(t=new e(t,r),n=new e(n,r),t.intersects(n,r))}(),j=function(){if(aJ)return oJ;aJ=1;const e=qJ(),t=bJ();return oJ=(n,r,i)=>{const o=[];let a=null,s=null;const l=n.sort((e,n)=>t(e,n,i));for(const t of l)e(t,r,i)?(s=t,a||(a=t)):(s&&o.push([a,s]),s=null,a=null);a&&o.push([a,null]);const c=[];for(const[e,t]of o)e===t?c.push(e):t||e!==l[0]?t?e===l[0]?c.push(`<=${t}`):c.push(`${e} - ${t}`):c.push(`>=${e}`):c.push("*");const u=c.join(" || "),d="string"==typeof r.raw?r.raw:String(r);return u.length<d.length?u:r},oJ}(),$=function(){if(lJ)return sJ;lJ=1;const e=TJ(),t=DJ(),{ANY:n}=t,r=qJ(),i=bJ(),o=[new t(">=0.0.0-0")],a=[new t(">=0.0.0")],s=(e,t,s)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===n){if(1===t.length&&t[0].semver===n)return!0;e=s.includePrerelease?o:a}if(1===t.length&&t[0].semver===n){if(s.includePrerelease)return!0;t=a}const u=new Set;let d,f,h,p,m,g,y;for(const t of e)">"===t.operator||">="===t.operator?d=l(d,t,s):"<"===t.operator||"<="===t.operator?f=c(f,t,s):u.add(t.semver);if(u.size>1)return null;if(d&&f){if(h=i(d.semver,f.semver,s),h>0)return null;if(0===h&&(">="!==d.operator||"<="!==f.operator))return null}for(const e of u){if(d&&!r(e,String(d),s))return null;if(f&&!r(e,String(f),s))return null;for(const n of t)if(!r(e,String(n),s))return!1;return!0}let v=!(!f||s.includePrerelease||!f.semver.prerelease.length)&&f.semver,b=!(!d||s.includePrerelease||!d.semver.prerelease.length)&&d.semver;v&&1===v.prerelease.length&&"<"===f.operator&&0===v.prerelease[0]&&(v=!1);for(const e of t){if(y=y||">"===e.operator||">="===e.operator,g=g||"<"===e.operator||"<="===e.operator,d)if(b&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===b.major&&e.semver.minor===b.minor&&e.semver.patch===b.patch&&(b=!1),">"===e.operator||">="===e.operator){if(p=l(d,e,s),p===e&&p!==d)return!1}else if(">="===d.operator&&!e.test(d.semver))return!1;if(f)if(v&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===v.major&&e.semver.minor===v.minor&&e.semver.patch===v.patch&&(v=!1),"<"===e.operator||"<="===e.operator){if(m=c(f,e,s),m===e&&m!==f)return!1}else if("<="===f.operator&&!e.test(f.semver))return!1;if(!e.operator&&(f||d)&&0!==h)return!1}return!(d&&g&&!f&&0!==h||f&&y&&!d&&0!==h||b||v)},l=(e,t,n)=>{if(!e)return t;const r=i(e.semver,t.semver,n);return r>0?e:r<0||">"===t.operator&&">="===e.operator?t:e},c=(e,t,n)=>{if(!e)return t;const r=i(e.semver,t.semver,n);return r<0?e:r>0||"<"===t.operator&&"<="===e.operator?t:e};return sJ=(t,n,r={})=>{if(t===n)return!0;t=new e(t,r),n=new e(n,r);let i=!1;e:for(const e of t.set){for(const t of n.set){const n=s(e,t,r);if(i=i||null!==n,n)continue e}if(i)return!1}return!0},sJ}();return cJ={parse:i,valid:o,clean:a,inc:s,diff:l,major:c,minor:u,patch:d,prerelease:f,compare:h,rcompare:p,compareLoose:m,compareBuild:g,sort:y,rsort:v,gt:b,lt:x,eq:S,neq:M,gte:w,lte:k,cmp:E,coerce:C,truncate:N,Comparator:T,Range:D,satisfies:q,toComparators:O,maxSatisfying:I,minSatisfying:A,minVersion:_,validRange:L,outside:P,gtr:R,ltr:F,intersects:z,simplifyRange:j,subset:$,SemVer:n,re:e.re,src:e.src,tokens:e.t,SEMVER_SPEC_VERSION:t.SEMVER_SPEC_VERSION,RELEASE_TYPES:t.RELEASE_TYPES,compareIdentifiers:r.compareIdentifiers,rcompareIdentifiers:r.rcompareIdentifiers}}(),_J=o(AJ),LJ={LINE:{CURVE:{LINEAR:"linear",MONOTONE:"monotone"},WIDTH:{FULL:{DEFAULT:2},LESS:{DEFAULT:1},DEFAULT:3},TYPE:{SOLID:void 0,DASHED:"5, 5"}},POINT:{SIZE:{DEFAULT:6,ACTIVE:4,NEW_DEFAULT:8}}};function PJ({layoutService:e,dockService:t,themeService:n,colorService:r,flags:i}){const{LINE:o,POINT:a}=LJ,s=n.getStyles(),l=(e=>!!e&&_J.gt(_J.coerce(e),_J.coerce("2.0.8")))(e.getLayoutValue("version"))&&i.isEnabled("TLV_1804_DEFAULT_CHART_SETTINGS"),c=function({layoutService:e}){const{isOneDimensional:t}=e.meta,{style:n}=e.getLayoutValue("components",[]).filter(e=>"line"===e.key)[0]||{};return({property:r,defaultValue:i,index:o})=>{const a=n&&Object.hasOwnProperty.call(n,r)?n[r]:i;if(void 0===o)return a;const{style:s}=e.getHyperCubeValue((e=>`qMeasureInfo.${e}.styling`)(t?o:0),[]).filter(e=>"line"===e.key||e.cId)[0]||{};return s&&Object.hasOwnProperty.call(s,r)?s[r]:a}}({layoutService:e}),u=t=>i.isEnabled("CLIENT_IM_3050")?e.getLayoutValue("components",[]).find(e=>e.key===t):void 0,d=(e,t)=>{const n=r.getMain().getPaletteColor;if(e?.color&&n){const r=n(e);return"none"===r&&e.index>0?e?.color??t:r??t}return t},f={line:{getCurve:()=>(e,t)=>c({property:"lineCurve",defaultValue:l?o.CURVE.MONOTONE:o.CURVE.LINEAR,index:t}),getStrokeWidth:()=>(e,n)=>c({property:"lineThickness",defaultValue:l?o.WIDTH.DEFAULT:"FULL"===t.meta.chart.mode?o.WIDTH.FULL.DEFAULT:o.WIDTH.LESS.DEFAULT,index:n}),getStrokeDasharray:()=>(e,t)=>{const n=c({property:"lineType",defaultValue:o.TYPE.SOLID,index:t});return n&&o.TYPE[n.toUpperCase()]}},forecast:{getCurve:()=>t=>{const n=t.datum.line.value;return e.getLayoutValue(`qHyperCube.qMeasureInfo.${n}.forecast.lineCurve`,f.line.getCurve()(t,n))},getStrokeWidth:()=>t=>{const n=t.datum.line.value;return e.getLayoutValue(`qHyperCube.qMeasureInfo.${n}.forecast.lineThickness`,f.line.getStrokeWidth()(t,n))},getStrokeDasharray:()=>t=>{const n=t.datum.line.value,r=e.getLayoutValue(`qHyperCube.qMeasureInfo.${n}.forecast.lineType`);return r?o.TYPE[r.toUpperCase()]:f.line.getStrokeDasharray()(t,n)}},point:{getSize:e=>c({property:"dataPointSize",defaultValue:l?a.SIZE.NEW_DEFAULT:a.SIZE.DEFAULT,index:e})},axis:{title:{getStyle:()=>{const e=u("axis")?.axis?.title;return{fontFamily:e?.fontFamily??s.axis.title.fontFamily,fontSize:e?.fontSize??s.axis.title.fontSize,color:d(e?.color,s.axis.title.color)}}},label:{getStyle:()=>{const e=u("axis")?.axis?.label?.name;return{fill:d(e?.color,s.axis.label.name.color),fontSize:e?.fontSize??s.axis.label.name.fontSize,fontFamily:e?.fontFamily??s.axis.label.name.fontFamily}}}},label:{getStyle:()=>{const e=u("label")?.label?.value;return{fill:d(e?.color,s.label.value.color),fontFamily:e?.fontFamily??s.label.value.fontFamily,fontSize:e?.fontSize??s.label.value.fontSize}}},legend:{title:{getStyle:()=>{const e=u("legend")?.legend?.title;return{fontFamily:e?.fontFamily??s.legend.title.fontFamily,fontSize:e?.fontSize??s.legend.title.fontSize,color:d(e?.color,s.legend.title.color)}}},label:{getStyle:()=>{const e=u("legend")?.legend?.label;return{fontFamily:e?.fontFamily??s.legend.label.fontFamily,fontSize:e?.fontSize??s.legend.label.fontSize,color:d(e?.color,s.legend.label.color)}}}}};return{query:f}}function RJ({extrema:e,ticks:t}){const n=e.meta.hasExplicit?2:3;return t.filter(t=>(t=>!e.meta.hasExplicitMin||t>=e.explicit.min)(t)&&(t=>!e.meta.hasExplicitMax||t<=e.explicit.max)(t)).length>=n}function FJ({min:e,max:t,count:n,threshold:r,disable:i}){const o=function(e,t,n){const r=gn().domain([e,t]);return r.nice(n),r}(e,t,n),a={start:!0,stop:!0};if(!a.start||!a.stop){const[e,t]=o.domain(),r=o.ticks(n),i=r.length>=4?r[1]-r[0]:.1*e,s=r.length>=4?r[r.length-1]-r[r.length-2]:.1*t;o.domain([a.start?e:e-i,a.stop?t:t+s]),o.nice(n)}return o}const zJ=50,jJ=100,$J=200,VJ=125;function UJ({layoutService:e,size:t}){const n=(e=>{switch(e){case.5:return zJ;case 1:return jJ;case 2:return $J;default:return e*VJ}})(e.getLayoutValue("measureAxis.spacing",1));return Math.max(1,Math.round(t/n))}function HJ({chart:e,layoutService:t,dockService:n,measureText:r,size:i,min:o,max:a}){const s=UJ({layoutService:t,size:i}),l=FJ({min:o,max:a,count:s,threshold:.05,disable:!0}),c=l.domain(),u={roundedMin:c[0],roundedMax:c[1],ticks:l.ticks(s)},d="horizontal"===n.meta.major.orientation?"height":"width",f=e=>r(e)[d],h=e.formatter(Gb.FORMATTER.MINOR),p=()=>{const e=u.ticks.map(h),t=e.some((t,n)=>e.indexOf(t)!==n);return!t&&(e=>{const t=i/u.ticks.length;return Math.max(...e.map(f))<=t})(e)};for(let e=s-1;e>0&&!p();e--)l.domain([o,a]),l.nice(e),[u.roundedMin,u.roundedMax]=l.domain(),u.ticks=l.ticks(e);return u}function BJ({tick:e,index:t,ticks:n}){return 0===t||t===n.length-1||0===e}function WJ({index:e,ticks:t}){return 0===e||e===t.length-1||e===Math.floor((t.length-1)/2)}function YJ(e,t){const n=Math.floor(Math.log10(e)),r=10**n,i=t(r);let o=n;for(;t(r+10**(o+1))===i;)++o;if(o===n)for(;t(r+10**o)!==i;)--o;return 10**(o+1)}function GJ(e,t){let[n,r]=e.domain();n=function(e,t){if(0===e)return 0;const n=YJ(Math.abs(e),t);return Math.floor(e/n)*n}(n,t),r=function(e,t){if(0===e)return 0;const n=YJ(Math.abs(e),t);return Math.ceil(e/n)*n}(r,t),e.domain([n,r])}function KJ({chart:e,extrema:t,min:n,max:r}){const i={roundedMin:0,roundedMax:0,ticks:[]},o=FJ({min:n,max:r,count:10,threshold:.15,disable:!0}),a=e.formatter(Gb.FORMATTER.MINOR);GJ(o,a),[i.roundedMin,i.roundedMax]=o.domain();const s=o.ticks(10),l=function({ticks:e}){const t=Math.round(.3*e.length),n=t,r=e.length-t;return e.slice(n,r).some(e=>0===e)}({ticks:s}),c=l?BJ:WJ;i.ticks=s.filter((e,t,n)=>c({tick:e,index:t,ticks:n}));i.ticks.length%2==0&&!l&&!t.meta.hasExplicit&&s.length>1&&(i.ticks=[s[0],(s[0]+s[s.length-1])/2,s[s.length-1]]);const u=i.ticks.map(a),d=u.some((e,t)=>u.indexOf(e)!==t);return d&&(i.ticks=[i.ticks[0],i.ticks[i.ticks.length-1]]),i}function XJ({ticks:e,extrema:t}){let n=[...e];return t.meta.hasExplicit&&e.length?(t.meta.hasExplicitMin&&!e.some(e=>e===t.explicit.min)&&(n.unshift(t.explicit.min),n=n.filter(e=>e>=t.explicit.min)),t.meta.hasExplicitMax&&!e.some(e=>e===t.explicit.max)&&(n.push(t.explicit.max),n=n.filter(e=>e<=t.explicit.max)),n):n}function JJ({chart:e,layoutService:t,dockService:n,extrema:r,measureText:i,size:o,min:a,max:s}){const{ticks:l,roundedMin:c,roundedMax:u}=function({chart:e,layoutService:t,dockService:n,extrema:r,measureText:i,size:o,min:a,max:s}){if("SPARK"===n.meta.chart.mode)return function({min:e,max:t}){return{roundedMin:e,roundedMax:t,ticks:[]}}({min:a,max:s});const l=HJ({chart:e,layoutService:t,dockService:n,measureText:i,size:o,min:a,max:s});return RJ({extrema:r,ticks:l.ticks})?l:KJ({chart:e,extrema:r,min:a,max:s})}({chart:e,layoutService:t,dockService:n,extrema:r,measureText:i,size:o,min:a,max:s}),d=function({ticks:e,count:t}){const n=[];for(let r=0;r<e.length-1;r++){const i=e[r],o=(e[r+1]-i)/(t+1);for(let e=1;e<=t;e++)n.push(i+o*e)}return n}({ticks:l,count:1}),f=[...XJ({ticks:l,extrema:r}).map(e=>({value:e,isMinor:!1})),...d.map(e=>({value:e,isMinor:!0}))].sort((e,t)=>e.value-t.value);return{min:c,max:u,values:f}}function ZJ({chart:e,layoutService:t,dockService:n,measureText:r,extrema:i,size:o}){const{min:a,max:s}=function({extrema:e}){const{min:t,max:n}=e;return t!==n?{min:t,max:n}:0===t||1===t?{min:t-1,max:n+1}:{min:t-.2*t*Math.sign(t),max:n+.2*n*Math.sign(n)}}({extrema:i});return JJ({chart:e,layoutService:t,dockService:n,extrema:i,measureText:r,size:o,min:a,max:s})}function QJ({chart:e,layoutService:t,dockService:n,measureText:r,extrema:i,size:o,fontHeight:a}){const{min:s,max:l}=i,c=e.formatter("minor"),u="vertical"===n.meta.minor.orientation?4*a:Math.max(96,function({min:e,max:t,measureText:n,formatter:r}){return r?Math.max(...[e,t,(t-e)/2].map(e=>n(r(e)).width)):0}({min:s,max:l,measureText:r,formatter:c})),d=t.getLayoutValue("measureAxis.spacing",1);return Math.max(2,Math.floor(o/(u*d))+1)}function eZ({chart:e,layoutService:t,dockService:n,measureText:r,extrema:i,size:o}){const a=r("M").height,s=QJ({chart:e,layoutService:t,dockService:n,measureText:r,extrema:i,size:o,fontHeight:a}),{min:l,max:c}=function({layoutService:e,extrema:t}){const{isArea:n}=e.meta,{min:r,max:i}=t.implicit,o={min:r,max:i};return n?(r>=1?o.min=1:r>0&&(o.min=10**Math.floor(Math.log(r)/Math.log(10))),i<=-1?o.max=-1:i<0&&(o.max=-(10**Math.floor(Math.log(Math.abs(i))/Math.log(10)))),o):o}({layoutService:t,extrema:i});return Ro.calculateTicks({size:o,dataMin:l,dataMax:c,explicitMin:i.explicit.min,explicitMax:i.explicit.max,minTickSpacingInPixel:o/(s-1),fontHeight:a})}function tZ({chart:e,layoutService:t,chartModel:n,extremumModel:r,dockService:i,themeService:o}){const a=t.getLayoutValue("measureAxis.logarithmic",!1),{measureText:s}=rW.renderer("svg")();return()=>{const l=o.getStyles(),c=function({chart:e,chartModel:t,dockService:n}){const r=t.query.getIsUpdateDataless()?n.meta.chart.size:e.component(Gb.COMPONENT.LINE).rect;return"horizontal"===n.meta.major.orientation?r.height:r.width}({chart:e,chartModel:n,dockService:i}),u=r.query.getExtrema(),d=(a&&!u.meta.includesZero?eZ:ZJ)({chart:e,layoutService:t,dockService:i,measureText:e=>s({text:e,fontFamily:l.axis.label.name.fontFamily,fontSize:l.axis.label.name.fontSize}),extrema:u,size:c});return d}}function nZ({chart:e,layoutService:t,node:n,formatter:r}){const{isTwoDimensional:i}=t.meta,{key:o,data:a}=n;if(i)return`${a.label}, ${a.major.label}`;const s="U"===t.getHyperCubeValue("qDimensionInfo.0",{}).qNumFormat?.qType;if(o!==Gb.COMPONENT.FORECAST_POINT||!s)return n.data.label;const{scale:l}=e,c=r({data:{fields:["qDimensionInfo/0"]}}),u=l(Gb.SCALE.MAIN.MAJOR),d=u?.formatter?u.formatter():c,f=l(Gb.SCALE.MAIN.MAJOR_INNER),h=f?.formatter?f.formatter():c,{value:p}=a.major,m=d(p),g=h(p);return m===g?m:`${m} ${g}`}function rZ({chart:e,actions:t,translator:n,rtl:r,viewState:i,layoutService:o,fieldModel:a,colorService:s,themeService:l,trendLineModel:c,tickModel:u,custom:d}){const{isTwoDimensional:f,isStacked:h}=o.meta,{fontFamily:p}=l.getStyles(),m=function({tickModel:e}){const{POINT:t,OUT_OF_MIN_BOUNDS:n,OUT_OF_MAX_BOUNDS:r,MAJOR_AXIS:i}=Gb.COMPONENT;return[({chart:o,hovered:a,meta:s})=>{const[l]=a,{triggerer:c}=s;if(c===t)return!1;if(c===n||c===r)return{key:l.key,bounds:l.bounds};if(c===i){const i=o.findShapes("path").find(e=>e.key===r&&e.data.major.value===l.data.value);if(i)return{key:i.key,bounds:i.bounds};const a=o.findShapes("path").find(e=>e.key===n&&e.data.major.value===l.data.value);if(a){const n=e.query.getMin(),r=e.query.getMax(),i=o.findShapes("circle").find(e=>e.key===t&&e.data.major.value===l.data.value&&e.data.end.value>=n&&e.data.end.value<=r);if(!i)return{key:a.key,bounds:a.bounds}}}return!1},"collectible"]}({tickModel:u}),g=Kg({majorInnerScale:Gb.SCALE.MAIN.MAJOR_INNER,tooltip:Gb.COMPONENT.TREND_LINES_TOOLTIP,tooltipOverlay:Gb.COMPONENT.TREND_LINES_TOOLTIP_OVERLAY},{chart:e,viewState:i,trendLineModel:c,layoutService:o,rtl:r});return Dh({chart:e,translator:n,config:{rtl:r,enable:()=>t.tooltip.enabled(),getColorSettings:()=>s.getMain().getSettings(),style:{fontFamily:p},main:{key:Gb.COMPONENT.POINT_TOOLTIP,suppress:({event:e})=>g(e),getGroupByValue:({data:e})=>f?e.line.value:e.major.value,collectibles:[{key:Gb.COMPONENT.POINT,type:"point",major:({data:e})=>e.major.value},{key:Gb.COMPONENT.FORECAST_POINT,type:"point",major:({data:e})=>e.major.value}],triggers:[{keys:[Gb.COMPONENT.POINT,Gb.COMPONENT.FORECAST_POINT],distance:3,collect:{from:"radius",distance:3,filter:({data:e,attrs:t})=>(!e.null||e.null&&!e.null.value)&&(!e.interpolated||e.interpolated&&!e.interpolated.value)&&.01!==t?.opacity},placement:m},{keys:[Gb.COMPONENT.MAJOR_AXIS],collect:{from:"dimension",by:({data:e})=>e.value},placement:m},{keys:[Gb.COMPONENT.OUT_OF_MIN_BOUNDS,Gb.COMPONENT.OUT_OF_MAX_BOUNDS,Gb.COMPONENT.FORECAST_OUT_OF_MIN_BOUNDS,Gb.COMPONENT.FORECAST_OUT_OF_MAX_BOUNDS],collect:{from:"dimension",by:({data:e})=>e.major.value},placement:m}],placements:{collectible:({collected:e})=>{const[t]=e.sort((e,t)=>t.data.end.value-e.data.end.value);return t.bounds}},layout:{grouping:f,single:()=>!(!d.isEnabled()||!d.hasImages())||d.chart.isEnabled()},section:({h:t,nodes:r,dataset:i,formatter:s,create:l})=>{const[c]=r,{title:u,description:p,measures:m}=d.isEnabled()?d.getAttributes({dataset:i,nodes:[c]}):{},g=[];u&&g.push(l.text({value:u,style:{bold:!0}})),p&&g.push(l.text({value:p}));const y=d.hideBasic();y&&!m.length&&(u||p)||g.push(l.text({value:nZ({chart:e,layoutService:o,node:c,formatter:s}),style:{bold:!0}})),y||(g.push(l.color({nodes:r,property:Gb.SCALE.MAIN.COLOR})),g.push(...r.map(e=>{const{data:t}=e,{end:r,line:o,point:s}=t,c=h?t.source.key:r.source.key,u=f?0:o.value,d=i(c).field(h?a.main.minors[u]:r.source.field);return l.measure({label:"forecast"===d.raw().id?n.get("Forecast"):d.title(),value:h?s.label:r.label})}))),m&&g.push(...m.map(e=>l.measure({label:e.label,value:e.value,survive:{color:!0,duplicate:!0}}))),d.chart.isEnabled()&&(d.chart.hasLimitation()?(d.chart.destroy(),g.push(l.raw({value:d.chart.createLimitationRow()}))):g.push(l.raw({value:d.chart.createContainer({h:t})})));const{customTooltipImages:v}=c.data;return d.isEnabled()&&v&&g.push(...v.map(e=>l.raw({value:d.createImageRow({value:e,h:t})}))),g},events:{tooltip:{beforeShow:({collectNodes:e})=>d.isEnabled()&&d.hasImages()?d.addImages({nodes:e()}):Promise.resolve(),afterShow:({expando:e,nodes:t})=>{d.chart.isEnabled()&&!d.chart.hasLimitation()&&d.chart.show({nodes:t,properties:e.get("properties")})}},interaction:{mouseleave:()=>{d.chart.isEnabled()&&d.chart.hasAlternateState()&&d.chart.hide()}}}},legend:{keys:{tooltip:Gb.COMPONENT.LEGEND_TOOLTIP,component:Gb.COMPONENT.LEGEND_CATEGORICAL}}}})}const{DEFAULT_NUM_POINTS:iZ,DEFAULT_NUM_LINES:oZ,LARGE_NUM_POINTS:aZ}=oy,sZ=({layoutService:e,maxNumPoints:t,maxNumLines:n})=>(t>iZ||n>oZ)&&JG(e)>aZ,lZ=e=>{const t=e.points.map(e=>e[2].qNum).sort((e,t)=>t-e);e.median=Math.abs(t[Math.floor(t.length/2)])},cZ=({layoutService:e,numLines:t})=>{const{CHUNK_SIZE:n}=oy,{isOneDimensional:r}=e.meta;if(!t)return 0;if(r)return 1;const i=JG(e)/t;return Math.max(1,Math.min(t,Math.ceil(n/i)))},uZ=(e,t,n,r,i)=>{if(n.linesDict={},n.lines=[],n.chunks=[],n.matrix=[],!t.length)return;const{qMatrix:o}=t[0],{linesDict:a,lines:s}=n;o.forEach(e=>{const t=e[1].qElemNumber;void 0===a[t]?(a[t]={points:[e]},s.push(a[t])):a[t].points.push(e)}),i||(s.forEach(lZ),s.sort((e,t)=>t.median-e.median));const l=s.length;if(r){const e=s[0].points.length;for(let t=0;t<e;t++)for(let e=0;e<l;e++)n.matrix.push(s[e].points[t])}else{const t=cZ({layoutService:e,numLines:l}),r=Math.ceil(l/t);for(let e=0;e<r;e++)n.chunks[e]=[];s.forEach((e,r)=>{const i=Math.floor(r/t);n.chunks[i].push(...e.points)})}},dZ=({chart:e,layoutService:t,progressiveRendering:n,meta:r,render:i,nodes:o,timerId:a,progressiveId:s,shouldUseProgressive:l})=>{const c=e=>{null!==n[e]&&(cancelAnimationFrame(n[e]),n[e]=null)};if(c("mainTimer"),c(a),!l()||!o.length)return void i(o);const u=cZ({layoutService:t,numLines:o.length}),d=Math.ceil(o.length/u);if(d<=1)return void i(o);let f=0;const h=()=>{n[a]=requestAnimationFrame(()=>{if(!e?.update)return c(a),void(r[s]=!1);const t=f*u,l=Math.min(o.length,(f+1)*u);r[s]={start:t,end:l,isFirst:0===f,isLast:f===d-1},i(o.slice(t,l)),f++,f<d?h():(r[s]=!1,n[a]=null)})};h()},{CHUNK_SIZE:fZ}=oy,hZ=({progressiveRendering:e,isPartialUpdate:t,meta:n})=>{null!==e.mainTimer&&(cancelAnimationFrame(e.mainTimer),e.mainTimer=null,e.renderPromise?.resolve(),e.renderPromise=null),null!==e.pointTimer&&(cancelAnimationFrame(e.pointTimer),e.pointTimer=null),null!==e.lineTimer&&(cancelAnimationFrame(e.lineTimer),e.lineTimer=null),t||null!==e.reducedLineTimer&&(cancelAnimationFrame(e.reducedLineTimer),e.reducedLineTimer=null),e.setInProgressive(!1),n.pointProgressive=!1,n.lineProgressive=!1,n.reducedLineProgressive=!1,n.highlighterProgressive=!1},{CHUNK_SIZE:pZ}=oy,mZ=e=>{const t=e.length;return Math.max(3,Math.ceil(pZ/t))},{DEFAULT_NUM_POINTS:gZ,MAX_NUM_POINTS:yZ,LARGE_NUM_POINTS:vZ,DEFAULT_NUM_LINES:bZ,MAX_NUM_LINES:xZ}=oy;function SZ({chart:e,layoutService:t,progressiveRendering:n,options:r}){const{POINT:i,LINE:o,BRUSH_HIGHLIGHTER:a,REDUCED_LINE:s}=Gb.COMPONENT,l={partialUpdate:[Gb.COMPONENT.MINOR_AXIS,Gb.COMPONENT.GRID_LINE,Gb.COMPONENT.ZERO_LINE,Gb.COMPONENT.MAJOR_AXIS_TITLE,Gb.COMPONENT.MINOR_AXIS_TITLE,Gb.COMPONENT.MEASURE_REF_LINE_LABEL,Gb.COMPONENT.LEGEND_CATEGORICAL,s],duringMainProgressive:[],duringReducedLineProgressive:[],forClearProgressive:[],postUpdate:[],all:[]},{dimensionCount:c,measureCount:u,isOneDimensional:d,isContinuous:f,size:h,isStacked:p,isConnect:m}=t.meta,g=t.getLayout(),y=!0,v=void 0===g.maxNumPoints||g.maxNumPoints<gZ?gZ:Math.min(yZ,Math.ceil(g.maxNumPoints)),b=Math.min(vZ,v),x=Su(g.qHyperCube,"qSize.qcy"),S=1===c?x*u:x,M=(()=>{const e=void 0===g.maxNumLines||g.maxNumLines<=0?bZ:Math.min(xZ,Math.ceil(g.maxNumLines));return 1===c?Math.min(e,u):2===c?Math.min(e,h.dimensions[1]+1):void 0})(),w=f&&S>b&&v>b&&(v>gZ&&M>=bZ||v>=gZ&&M>bZ),k={mainPages:[],reducedCube:void 0,reducedPages:[]},E={isMaxNumPointsEnabled:y,isLargeNumPoints:w,maxNumPoints:v,maxNumLines:M,pointProgressive:!1,lineProgressive:!1,reducedLineProgressive:!1,highlighterProgressive:!1,hasInjectedData:!m||p},C={linesDict:{},lines:[],chunks:[],matrix:[]},N={linesDict:{},lines:[],chunks:[],matrix:[]};function T(){k.mainPages=t.getDataPages(),t.setDataPages([])}function D(){t.setDataPages(k.mainPages),k.mainPages=[]}function q(){k.reducedCube&&(k.reducedPages=k.reducedCube.qDataPages||[],k.reducedCube.qDataPages=[])}function O(){k.reducedCube&&(k.reducedCube.qDataPages=k.reducedPages,k.reducedPages=[])}const I=()=>(({layoutService:e,isMaxNumPointsEnabled:t,maxNumPoints:n,maxNumLines:r,options:i})=>{const{isContinuous:o}=e.meta;return o&&!1!==i.progressiveRendering&&sZ({layoutService:e,maxNumPoints:n,maxNumLines:r})})({layoutService:t,isMaxNumPointsEnabled:y,maxNumPoints:v,maxNumLines:M,options:r}),A=t=>{const n=t?[...l.partialUpdate,i,o,a]:[s,i,o,a];e.update({partialData:!0,excludeFromUpdate:n})},_=t=>{requestAnimationFrame(()=>{null===n.reducedLineTimer&&null===n.mainTimer&&(e.update({partialData:!0,excludeFromUpdate:l.postUpdate}),n.setInProgressive(!1),t())})},L=e=>{requestAnimationFrame(()=>{E.pointProgressive=!1,E.lineProgressive=!1,n.mainTimer=null,_(e)})},P=e=>{requestAnimationFrame(()=>{E.reducedLineProgressive=!1,n.reducedLineTimer=null,_(e)})},R=(r,i)=>{n.setInProgressive(!0);const o=t.getDataPages();if(!o.length)return void i(r);const a=o[0].qMatrix.length,s=u;let c=0;const d=()=>{n.mainTimer=requestAnimationFrame(()=>{if(!e?.update)return void hZ({progressiveRendering:n,meta:E});const t=Math.max(0,c*a),o=Math.min(a*u,(c+1)*a);E.pointProgressive={start:t,end:o,isFirst:0===c,isLast:c===s-1},E.lineProgressive={...E.pointProgressive},e.update({partialData:!0,excludeFromUpdate:l.duringMainProgressive}),c++,c<s?d():i(r)})};d()},F=(t,r)=>{if(A(r),n.renderPromise={resolve:t},r)R(t,L);else{const{reducedCube:r}=k,i=r.qDataPages;R(t,L),i.length&&l.all.includes(s)&&((t,r)=>{n.setInProgressive(!0);const{reducedCube:i}=k,o=i.qDataPages;if(!o.length)return void r(t);const a=o[0].qMatrix.length,s=u;let c=0;const d=()=>{n.reducedLineTimer=requestAnimationFrame(()=>{const n=Math.max(0,c*a),i=Math.min(a*u,(c+1)*a);E.reducedLineProgressive={start:n,end:i,isFirst:0===c,isLast:c===s-1},e.update({partialData:!0,excludeFromUpdate:l.duringReducedLineProgressive}),c++,c<s?d():r(t)})};d()})(t,P)}},z=(r,i)=>{n.setInProgressive(!0);const o=t.getDataPages();o.length?(uZ(t,o,C,p,!0),p?((r,i)=>{const o=t.getDataPages()[0].qMatrix.length,{lines:a,matrix:s}=C,c=a.length,u=a[0].points.length,d=mZ(a),f=Math.ceil(u/d);let h=0;const p=()=>{n.mainTimer=requestAnimationFrame(()=>{if(!e?.update)return void hZ({progressiveRendering:n,meta:E});T();const a=h*c*d,u=Math.min(o,(h+1)*c*d),m=Math.max(a-c,0),g=u;E.pointProgressive={start:m,end:g,isFirst:0===h,isLast:g===o},E.lineProgressive={...E.pointProgressive};const y=[{...k.mainPages[0],qMatrix:s.slice(a,u)}];t.setDataPages(y),e.update({partialData:!0,excludeFromUpdate:l.duringMainProgressive}),D(),h++,h<f?p():i(r)})};p()})(r,i):((r,i)=>{const o=t.getDataPages()[0].qMatrix.length,{chunks:a}=C,s=a.length;let c=0,u=0;const d=()=>{n.mainTimer=requestAnimationFrame(()=>{if(!e?.update)return void hZ({progressiveRendering:n,meta:E});T();const f=Math.min(o,u+a[c].length);E.pointProgressive={start:u,end:f,isFirst:0===c,isLast:c===s-1},E.lineProgressive={...E.pointProgressive},u=f;const h=[{...k.mainPages[0],qMatrix:a[c]}];t.setDataPages(h),e.update({partialData:!0,excludeFromUpdate:l.duringMainProgressive}),D(),c++,c<s?d():i(r)})};d()})(r,i)):i(r)},j=(r,i)=>{n.setInProgressive(!0);const{reducedCube:o}=k,a=o.qDataPages;a.length?(uZ(t,a,N,p),p?((t,r)=>{const{reducedCube:i}=k,o=i.qDataPages[0].qMatrix.length,{lines:a,matrix:s}=C,c=a.length,u=a[0].points.length,d=mZ(a),f=Math.ceil(u/d);let h=0;const p=()=>{n.reducedLineTimer=requestAnimationFrame(()=>{if(!e?.update)return void hZ({progressiveRendering:n,meta:E});q();const a=h*c*d,u=Math.min(o,(h+1)*c*d),m=Math.max(a-c,0),g=u;E.reducedLineProgressive={start:m,end:g,isFirst:0===h,isLast:g===o};const y=[{...k.reducedPages[0],qMatrix:s.slice(a,u)}];i.qDataPages=y,e.update({partialData:!0,excludeFromUpdate:l.duringReducedLineProgressive}),O(),h++,h<f?p():r(t)})};p()})(r,i):((t,r)=>{const{reducedCube:i}=k,o=i.qDataPages[0].qMatrix.length,{chunks:a}=N,s=a.length;let c=0,u=0;const d=()=>{n.reducedLineTimer=requestAnimationFrame(()=>{if(!e?.update)return void hZ({progressiveRendering:n,meta:E});q();const f=Math.min(o,u+a[c].length);E.reducedLineProgressive={start:u,end:f,isFirst:0===c,isLast:c===s-1},u=f;const h=[{...k.reducedPages[0],qMatrix:a[c]}];i.qDataPages=h,e.update({partialData:!0,excludeFromUpdate:l.duringReducedLineProgressive}),O(),c++,c<s?d():r(t)})};d()})(r,i)):i(r)};return{meta:E,exclude:l,getSelectionContext:()=>w?"lazySelection":"selection",shouldUseProgressive:I,isLargeNumVisiblePoints:()=>sZ({layoutService:t,maxNumPoints:v,maxNumLines:M}),resetProgressive:e=>hZ({progressiveRendering:n,isPartialUpdate:e,meta:E}),renderProgressive:(e,t)=>{d?F(e,t):((e,t)=>{if(A(t),n.renderPromise={resolve:e},t)z(e,L);else{const{reducedCube:t}=k,n=t.qDataPages;z(e,L),n.length&&l.all.includes(s)&&j(e,P)}})(e,t)},brushPoints:({render:t,nodes:r})=>(({chart:e,shouldUseProgressive:t,progressiveRendering:n,meta:r,render:i,nodes:o})=>{const a=e=>{null!==n[e]&&(cancelAnimationFrame(n[e]),n[e]=null)};if(a("mainTimer"),a("pointTimer"),!t())return void i(o);const s=Math.ceil(o.length/fZ);if(s<=1)return void i(o);let l=0;const c=()=>{n.pointTimer=requestAnimationFrame(()=>{if(!e?.update)return a("pointTimer"),void(r.pointProgressive=!1);const t=l*fZ,u=Math.min(o.length,(l+1)*fZ);r.pointProgressive={start:t,end:u,isFirst:0===l,isLast:l===s-1},i(o.slice(t,u)),l++,l<s?c():(r.pointProgressive=!1,n.pointTimer=null)})};c()})({chart:e,shouldUseProgressive:I,progressiveRendering:n,meta:E,render:t,nodes:r}),dimLines:({render:r,nodes:i})=>dZ({chart:e,layoutService:t,progressiveRendering:n,meta:E,render:r,nodes:i,timerId:"lineTimer",progressiveId:"lineProgressive",shouldUseProgressive:I}),highlightLines:({render:r,nodes:i})=>dZ({chart:e,layoutService:t,progressiveRendering:n,meta:E,render:r,nodes:i,timerId:"highlighterTimer",progressiveId:"highlighterProgressive",shouldUseProgressive:I}),setReducedCube:e=>{k.reducedCube=e},clear:()=>{null===n.mainTimer&&null===n.pointTimer&&null===n.lineTimer&&null===n.reducedLineTimer||(hZ({progressiveRendering:n,meta:E}),T(),q(),e.update({partialData:!0,excludeFromUpdate:l.forClearProgressive}),D(),O())}}}function MZ({layout:e,options:t={}}){return!(!e?.snapshotData||t.freeResize)&&{width:e.snapshotData.content.size.w,height:e.snapshotData.content.size.h}}function wZ(e){return{layout:e.getLayout(),keys:{SCALE:{MAIN:{MINOR:Gb.SCALE.MAIN.MINOR,MAJOR:Gb.SCALE.MAIN.MAJOR}},COMPONENT:{LINE:Gb.COMPONENT.LINE,MAJOR_AXIS:Gb.COMPONENT.MAJOR_AXIS,MAJOR_AXIS_TIME_INNER:Gb.COMPONENT.MAJOR_AXIS_TIME_INNER,MAJOR_AXIS_TITLE:Gb.COMPONENT.MAJOR_AXIS_TITLE,MINOR_AXIS:Gb.COMPONENT.MINOR_AXIS,MINOR_AXIS_TITLE:Gb.COMPONENT.MINOR_AXIS_TITLE},COLLECTION:{MAIN:Gb.COLLECTION.MAIN}}}}var kZ={SPARK:{DEFAULT:7,SQUEEZE:7,LABELLESS:7},XSMALL:{DEFAULT:28,SQUEEZE:24,LABELLESS:20},SMALL:{DEFAULT:28,SQUEEZE:24,LABELLESS:20},MEDIUM:{DEFAULT:28,SQUEEZE:24,LABELLESS:20},FULL:{DEFAULT:28,SQUEEZE:24,LABELLESS:20}};function EZ({core:t}){const n=e.useApp(),r=e.useAppLayout(),i=e.useEmbed(),o=e.useModel(),a=e.useOptions(),s=e.usePlugins(),l=e.useSelections(),c=e.useStaleLayout(),u=e.useTheme(),d=e.useTranslator(),[f,h]=e.useState(),[p,m]=e.useState();return e.useEffect(()=>{if(!t)return()=>{};const{actions:e,chart:n}=t,r=NK({actions:e,chart:n,selections:l});return h(r),function(){r.destroy(),r.destroyLazySelection()}},[t]),e.useEffect(()=>{if(!f)return;const{qLocaleInfo:e}=r,l="rtl"===a.direction,{actions:h,chart:p,flags:g,isUnsupportedFeature:y,picasso:v,viewCache:b,viewState:x,progressiveRendering:S}=t,M=Iu({source:c,metaAdditionsFn:MK(y),experimental:{filter:!0}});f.setFilteredFields(M.meta.filteredFields),f.setLayout(M.getLayout());const w=function(e){var t=e.theme,n=e.config,r=void 0===n?{}:n,i=r.id,o=r.resolve,a=void 0===o?[]:o,s=r.transform,l=void 0===s?[]:s,c=r.extend,u=void 0===c?[]:c,d={theme:t,matrix:Yf(a),styles:void 0};return d.styles=Xf({theme:t,id:i,transform:l,extend:u,matrix:d.matrix}),{getStyles:function(){return d.styles},getTheme:function(){return d.theme},setTheme:function(e){d.theme=e,d.styles=Xf({theme:e,id:i,transform:l,extend:u,matrix:d.matrix})}}}({theme:u,config:{id:"lineChart",resolve:[["object","plugins.label","fontFamily",'"Source Sans Pro", "Arial", "sans-serif"'],["object","plugins.label","fontSize","12px"]]}}),k=xu({chart:p,layoutService:M,config:{logicalSize:MZ({layout:M.getLayout(),options:a}),rtl:l},typeConfig:{type:"major-minor",fallback:"horizontal",invert:!1}}),E=function(e){var t,n=e.app,r=e.translator,i={initialized:!1,dimensions:[],measures:[]};return{initialize:(t=La(ja().m(function e(t){var o,a,s,l,c,u,d;return ja().w(function(e){for(;;)switch(e.n){case 0:if(o=t.properties,!i.initialized){e.n=1;break}return e.a(2);case 1:return s=[xl(a={app:n,translator:r,properties:o}),wl(a)],e.n=2,Promise.all(s);case 2:l=e.v,c=Va(l,2),u=c[0],d=c[1],i.dimensions=u,i.measures=d,i.initialized=!0;case 3:return e.a(2)}},e)})),function(e){return t.apply(this,arguments)}),getAlternatives:function(){return{dimensions:Ua(i.dimensions),measures:Ua(i.measures)}}}}({app:n,translator:d}),C=SZ({chart:p,layoutService:M,progressiveRendering:S,options:a}),N=pK({layoutService:M}),T=function({layoutService:e}){const t={layoutService:void 0},{isDiscrete:n,hasMultipleDimensions:r}=e.meta,i=e.getLayoutValue("color",{}),o=i.auto?r:"byDimension"===i.mode&&i.byDimDef&&i.byDimDef.activeDimensionIndex>-1;return n&&o&&(t.layoutService=Iu({source:e.getLayout()})),{query:{getHasCube:()=>!!t.layoutService,getCube:()=>t.layoutService?t.layoutService.getHyperCube():void 0,getDataPages:()=>t.layoutService?t.layoutService.getDataPages():void 0},command:{setDataPages:e=>{t.layoutService&&t.layoutService.setDataPages(e)}}}}({layoutService:M}),D=function({layoutService:e}){const{isOneDimensional:t,isContinuous:n}=e.meta,r="qDimensionInfo/0",i=`${r}:numeric`,o="qDimensionInfo/"+(t?0:1),a=e.getHyperCubeValue("qMeasureInfo"),s=a.map((e,t)=>`qMeasureInfo/${t}`),l=n?[{key:i,from:r,override:{value:e=>e.qNum}}]:void 0;return{main:{outer:r,inner:o,outerNumeric:i,minors:s},reduced:{outer:r,inner:o,minors:t?s:["qMeasureInfo/0","qMeasureInfo/1"]},forecast:SK(a),virtuals:l}}({layoutService:M}),q=function({enigmaModel:e,layoutService:t,dataProcessorModel:n}){const r={cube:void 0,on:!1},i=EK({enigmaModel:e,layoutService:t}),o=function({layoutService:e}){const{isSnapshot:t,isTwoDimensional:n,isStacked:r}=e.meta,i=e=>{e.qDimensionInfo.unshift({key:"dummy-patch-dimension"})};return i.should=e=>!!(t&&n&&r&&1===e.qDimensionInfo.length),i}({layoutService:t});return{query:{getCube:()=>r.cube,getIsReduced:()=>r.on},command:{initialize:()=>i().then(e=>{const{reducedCube:i}=e;o.should(i)&&o(i),r.cube=i,r.on=!!(r.cube&&r.cube.qDataPages[0]&&r.cube.qDataPages[0].qIsReduced),t.meta.isDiscrete&&t.meta.isOneDimensional&&r.cube.qDataPages[0]&&n.command.processDataPage({dataPage:r.cube.qDataPages[0]})}),setSnapshotData:e=>{e.reducedHyperCube=r.cube}}}}({enigmaModel:o,layoutService:M,dataProcessorModel:N}),O=M.meta.isContinuous?Yb.model({model:o,viewState:x,viewCache:b,layoutService:M,largeDataService:C,dataProcessorModel:N}):void 0;O&&O.update(M.getLayout());const I=function({app:e,model:t,translator:n,picasso:r,localeInfo:i,theme:o,continuousModel:a,layoutService:s,reducedModel:l,legendModel:c}){const{isContinuous:u,isStacked:d}=s.meta,f={main:void 0,reduced:void 0};return{isInitialized:()=>!(!f.main||!f.main.isInitialized()),initialize:()=>{const h=l.query.getIsReduced(),p=u||d||h,m=!u&&c.query.getHasCube(),g=m?c.query.getCube():s.getHyperCube(),y=m?Gb.DATA.LEGEND:void 0;f.main=au({app:e,model:t,translator:n,picasso:r,layoutService:s,config:{localeInfo:i,auto:eK,key:Gb.SCALE.MAIN.COLOR},createConfig:()=>({hc:p?g:l.query.getCube(),source:p?y:Gb.DATA.REDUCED,theme:o})});const v=[f.main.initialize()];if(u){const l=a.getInitialLayout();f.reduced=au({app:e,model:t,translator:n,picasso:r,layoutService:s,config:{localeInfo:i,auto:eK,key:Gb.SCALE.REDUCED.COLOR},createConfig:({getUseBaseColors:e})=>({layout:l,hc:a.getInitialCube(),colorProps:{...l.color,useBaseColors:e(l)},source:Gb.DATA.REDUCED,theme:o})}),v.push(f.reduced.initialize())}return Promise.all(v)},getMain:()=>f.main,getReduced:()=>f.reduced}}({app:n,model:o,translator:d,picasso:v,localeInfo:e,theme:u,layoutService:M,reducedModel:q,legendModel:T,continuousModel:O}),A=jg({layoutService:M,viewState:x,colorModel:{settings:()=>I.getMain().getSettings(),resolveUIColor:e=>I.getMain().getPaletteColor(e)},chart:p,env:{translator:d},keys:{colorScale:Gb.SCALE.MAIN.COLOR},isEnabled:()=>M.meta.dimensionCount<2});A.command.update();const _=function({layoutService:e,reducedModel:t,continuousModel:n,trendLineModel:r}){const i={min:NaN,max:NaN,implicit:{min:NaN,max:NaN},explicit:{min:NaN,max:NaN},meta:{hasExplicit:!1,hasExplicitMin:!1,hasExplicitMax:!1,includesZero:!1}},{isArea:o}=e.meta,a=e.getLayoutValue("measureAxis.logarithmic",!1),s=xK({layoutService:e});return{query:{getExtrema:()=>i},command:{initialize:()=>{const{min:l,max:c}=function({layoutService:e}){const t={min:NaN,max:NaN},{getLayoutValue:n}=e;if(n("measureAxis.autoMinMax",!1))return t;const r=n("measureAxis.minMax");return"min"!==r&&"minMax"!==r||(t.min=+n("measureAxis.min")),"max"!==r&&"minMax"!==r||(t.max=+n("measureAxis.max")),t}({layoutService:e});return i.explicit.min=l,i.explicit.max=c,i.meta.hasExplicitMin=!Number.isNaN(l),i.meta.hasExplicitMax=!Number.isNaN(c),i.meta.hasExplicit=i.meta.hasExplicitMin||i.meta.hasExplicitMax,async function({layoutService:e,reducedModel:t,continuousModel:n}){const{isDiscrete:r,isStacked:i,measureCount:o,dimensionCount:a,hasMultipleDimensions:s}=e.meta;if(r){const e=t.query.getCube();return e.qDataPages.length?{dataPage:e.qDataPages[0],count:o}:{dataPage:e.qStackedDataPages[0]}}const[l]=await n.fetchMinMaxData();return{dataPage:l,count:i&&s?a:o}}({layoutService:e,reducedModel:t,continuousModel:n}).then(({dataPage:e,count:t})=>{const{min:n,max:l}=s({dataPage:e,count:t});let c=Number((Number.isFinite(n)?n:0).toFixed(13)),u=Number((Number.isFinite(l)?l:0).toFixed(13));if(r.query.hasTrendLines()){const{min:e,max:t}=r.query.getMinMax();c=Number.isFinite(e)?Math.min(c,e):c,u=Number.isFinite(t)?Math.max(u,t):u}i.implicit.min=o&&!a?Math.min(0,c):c,i.implicit.max=o&&!a?Math.max(0,u):u,i.min=Number.isNaN(i.explicit.min)?i.implicit.min:i.explicit.min,i.max=Number.isNaN(i.explicit.max)?i.implicit.max:i.explicit.max,i.meta.hasExplicitMin&&!i.meta.hasExplicitMax&&(i.max=Math.max(i.min,i.max)),i.meta.hasExplicitMax&&!i.meta.hasExplicitMin&&(i.min=Math.min(i.min,i.max)),i.meta.includesZero=!!((0-i.min)*(0-i.max)<=0)})}}}}({layoutService:M,reducedModel:q,continuousModel:O,trendLineModel:A}),L=mK({layoutService:M,extremumModel:_,largeDataService:C}),P=ZG({picasso:v,chart:p,localeInfo:e,continuousModel:O,layoutService:M,reducedModel:q,legendModel:T,fieldModel:D,trendLineModel:A,colorService:I,largeDataService:C,progressiveRendering:S,options:a,viewCache:b}),R=PJ({layoutService:M,dockService:k,themeService:w,colorService:I,flags:g}),F=function({chart:e,layoutService:t,chartModel:n,extremumModel:r,dockService:i,themeService:o}){const a={locked:!1,resolved:void 0},{getExtrema:s}=r.query,l=tZ({chart:e,layoutService:t,chartModel:n,extremumModel:r,dockService:i,themeService:o}),c=()=>(a.locked&&a.resolved||(a.resolved=l()),a.resolved);return{query:{getValues:()=>c().values,getMin:()=>s().meta.hasExplicitMin?s().explicit.min:c().min,getMax:()=>s().meta.hasExplicitMax?s().explicit.max:c().max},command:{lock:()=>{a.locked=!0},unlock:()=>{a.locked=!1}}}}({chart:p,layoutService:M,chartModel:P,extremumModel:_,dockService:k,themeService:w}),z=zy({app:n,chart:p,embed:i,flags:g,layout:M.getLayout(),localeInfo:e,model:o,options:{direction:a.direction},picasso:v,translator:d}),j=rZ({actions:h,chart:p,colorService:I,custom:z,fieldModel:D,layoutService:M,rtl:l,themeService:w,tickModel:F,translator:d,trendLineModel:A,viewState:x}),$=M.meta.isDiscrete?XG({chart:p,actions:h,componentKey:Gb.COMPONENT.LINE,enigmaModel:o,layoutService:M,dockService:k,trendLineModel:A,itemWidths:kZ,viewState:x,rtl:l,options:{axisKey:Gb.COMPONENT.MAJOR_AXIS,renderer:v.renderer("svg")(),areaBuffer:M.meta.isTwoDimensional||N.query.getShouldProcess()?40:12,processDataPage:e=>N.command.processDataPage({dataPage:e}),getReducedCube:()=>q.query.getCube()}}):void 0,V=zh({layoutService:M,discreteModel:$}),U=function(e){var t=e.picassoInstance,n=e.plugins,r=e.pluginArgs,i=void 0===r?{}:r,o={initialized:!1,definitions:[]};return{initialize:function(){return La(ja().m(function e(){var r,a,s,l;return ja().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=La(ja().m(function e(n){var r;return ja().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(Fa({},i));case 2:if("object"===Ha(r=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,r);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(Fa({},i))})),e.n=2,Promise.all([a,s]);case 2:l=e.v,o.initialized=!0,(r=o.definitions).push.apply(r,Ua(l[1]));case 3:return e.a(2)}},e)}))()},extendComponents:function(e){return o.initialized?(o.definitions.filter(Boolean).forEach(function(t){var n=Va(e.filter(function(e){return e.key&&e.key===t.key}),1)[0];if(n){var r=Cl(!0,{},n.brush);Cl(!0,n,t),t.brush&&(n.brush=function(e,t){return"object"===Ha(e)&&Object.keys(e).length?(Array.isArray(t.consume)&&(e.consume=Au({originalArray:e.consume,newArray:t.consume,matchKey:"context"})),Array.isArray(t.trigger)&&(e.trigger=Au({originalArray:e.trigger,newArray:t.trigger,matchKey:"on"})),e):t}(r,t.brush))}else e.push(t)}),e):e}}}({picassoInstance:v,plugins:s||[],pluginArgs:wZ(M)});m({alternativeService:E,chartModel:P,colorService:I,continuousModel:O,customTooltipService:z,dataProcessorModel:N,disclaimerService:L,discreteModel:$,dockService:k,extremumModel:_,fieldModel:D,layoutService:M,legendModel:T,pluginService:U,reducedModel:q,refLineModel:V,selectionService:f,styleModel:R,themeService:w,tickModel:F,tooltipService:j,trendLineModel:A,largeDataService:C})},[c,a.direction,f,u.name(),d.language()]),p}function CZ({dataset:e,minor:t}){const n=e.field(t);if(!y.shouldUseFormat(n.raw()))return function(e){return e.qText};const r=n.formatter();return function(e){const{qNum:t,qValue:n,interpolated:i}=e;return void 0===t||"NaN"===t||i?void 0===n||"NaN"===n||i?"-":r(n):r(t)}}function NZ({colorService:e,index:t}){const n={},r=e.getMain().getDatumProps(t);Object.keys(r).forEach(e=>{void 0!==r[e]&&(n[e]=r[e])});const i=r[Gb.SCALE.MAIN.COLOR];return i&&i.field&&(n.colorTooltip={field:i.field,value:e=>void 0!==e.qNum&&"NaN"!==e.qNum?e.qNum:e.qText||"-"}),n}function TZ({layoutService:e,chartModel:t,fieldModel:n,extremumModel:r,tickModel:i,colorService:o}){const{isContinuous:a,isStacked:s,isZero:l}=e.meta,{minors:c,outer:u,outerNumeric:d}=n.main,f=e.getLayoutValue("separateStacking",!0),h=r.query.getExtrema(),p=e.getLayoutValue("measureAxis.logarithmic",!1)&&!h.meta.includesZero,m={key:Gb.COLLECTION.MAIN,data:{extract:c.map((n,r)=>({field:u,props:{major:{field:a?d:u},end:{field:n,label:CZ({dataset:t.query.getDataset(),minor:n})},selectionDimension:{field:u},line:r,...NZ({colorService:o,index:r}),customTooltipAttrExps:Ly.getNode(e.getLayout(),e.meta),null:{field:n,value:e=>"NaN"===e.qNum},interpolated:{field:n,value:e=>!!e.interpolated},fromDynamicScript:{field:u,value:e=>e.qInExtRow},id:{value:e=>`r${e.qRow}e${e.qElemNumber}m${r}`}}})),filter:e=>!e.fromDynamicScript.value}};if(l){const e=()=>h.min<0?i.query.getMax():i.query.getMin(),t=p?t=>"NaN"!==t.qNum?t.qNum:e():e=>"NaN"!==e.qNum?e.qNum:0;c.forEach((e,n)=>{const{end:r}=m.data.extract[n].props;r.value=t})}return s&&(m.data.stack={stackKey:e=>e.major.value,value:e=>e.end.value,offset:f?"diverging":"none"},c.forEach((e,t)=>{const{props:n}=m.data.extract[t];n.point={field:n.end.field,label:n.end.label},n.end.value&&(n.point.value=n.end.value)})),m}function DZ({layoutService:e,chartModel:t,fieldModel:n,extremumModel:r,tickModel:i,colorService:o}){const{isContinuous:a,isStacked:s,isZero:l}=e.meta,c=e.getLayoutValue("separateStacking",!0),u=a?"qNum":"qValue",d=r.query.getExtrema(),f=e.getLayoutValue("measureAxis.logarithmic",!1)&&!d.meta.includesZero,{outer:h,outerNumeric:p,inner:m,minors:g}=n.main,[y]=g,v={key:Gb.COLLECTION.MAIN,data:{extract:{field:m,props:{major:{field:a?p:h},end:{field:y,label:CZ({dataset:t.query.getDataset(),minor:y}),reduceLabel:"first"},selectionDimension:{field:m},selectionOuterDimension:{field:h},line:{field:m},customTooltipAttrExps:Ly.getNode(e.getLayout(),e.meta),null:{field:y,value:e=>"NaN"===e[u],reduce:"first"},interpolated:{field:y,value:e=>!!e.interpolated,reduce:"first"},...NZ({colorService:o})}}}};if(l){const e=()=>d.min<0?i.query.getMax():i.query.getMin();v.data.extract.props.end.value=f?t=>"NaN"!==t[u]?t[u]:e():e=>"NaN"!==e[u]?e[u]:0}if(s){v.data.stack={stackKey:e=>e.major.value,value:e=>e.end.value,offset:c?"diverging":"none"};const{props:e}=v.data.extract;e.point={field:e.end.field,label:e.end.label,reduceLabel:e.end.reduceLabel},e.end.value&&(e.point.value=e.end.value)}return v}function qZ({layoutService:e,reducedModel:t,fieldModel:n,extremumModel:r,tickModel:i,colorService:o}){const{isStacked:a,isZero:s}=e.meta,{minors:l,outer:c}=n.reduced,u=t.query.getIsReduced(),d=e.getLayoutValue("separateStacking",!0),f=r.query.getExtrema(),h=e.getLayoutValue("measureAxis.logarithmic",!1)&&!f.meta.includesZero,p={key:Gb.COLLECTION.REDUCED,data:{extract:l.map((e,t)=>{const n=u?{}:o.getMain().getDatumProps(t);return{source:Gb.DATA.REDUCED,field:c,props:{major:{field:c},end:{field:e},line:t,...n}}})}};if(s){const e=()=>f.min<0?i.query.getMax():i.query.getMin(),t=h?t=>"NaN"!==t.qNum?t.qNum:e():e=>"NaN"!==e.qNum?e.qNum:0;l.forEach((e,n)=>{const{end:r}=p.data.extract[n].props;r.value=t})}return a&&(p.data.stack={stackKey:e=>e.major.value,value:e=>e.end.value,offset:d?"diverging":"none"},l.forEach((e,t)=>{const{props:n}=p.data.extract[t];n.point={field:n.end.field}})),p}function OZ({layoutService:e,fieldModel:t}){if(!e.meta.isStacked)return!1;const n=e.getLayoutValue("separateStacking",!0),{inner:r,minors:i}=t.reduced;return{key:Gb.COLLECTION.REDUCED,data:{extract:i.map(e=>({source:Gb.DATA.REDUCED,field:r,props:{major:{field:r},end:{field:e},point:{field:e}}})),stack:{stackKey:e=>e.major.value,value:e=>e.end.value,offset:n?"diverging":"none"}}}}function IZ({colorService:e,main:t}){const n=l(!0,{},t);return n.key=Gb.COLLECTION.REDUCED,n.data.extract.forEach((t,n)=>{t.source=Gb.DATA.REDUCED,Object.assign(t.props,e.getReduced().getDatumProps(n))}),n}function AZ({main:e}){const t=l(!0,{},e);return t.key=Gb.COLLECTION.REDUCED,t.data.extract.source=Gb.DATA.REDUCED,t}function _Z({layoutService:e,reducedModel:t,fieldModel:n,extremumModel:r,tickModel:i,colorService:o,main:a}){if(!Yp({layoutService:e}).miniChart)return!1;const{isDiscrete:s}=e.meta;return s?function({layoutService:e,reducedModel:t,fieldModel:n,extremumModel:r,tickModel:i,colorService:o}){return(e.meta.isOneDimensional?qZ:OZ)({layoutService:e,reducedModel:t,fieldModel:n,extremumModel:r,tickModel:i,colorService:o})}({layoutService:e,reducedModel:t,fieldModel:n,extremumModel:r,tickModel:i,colorService:o}):function({layoutService:e,colorService:t,main:n}){return(e.meta.isOneDimensional?IZ:AZ)({colorService:t,main:n})}({layoutService:e,colorService:o,main:a})}function LZ({dataset:e,minor:t}){const n=e.field(t).formatter();return function(e){const{qNum:t,qValue:r,interpolated:i}=e;return void 0===t||"NaN"===t||i?void 0===r||"NaN"===r||i?"-":n(r):n(t)}}function PZ({chartModel:e,layoutService:t,fieldModel:n,colorService:r}){const{isContinuous:i}=t.meta;if(!i||0===n.forecast.length)return[];const o=[],a=function({chartModel:e,fieldModel:t,colorService:n}){const{outer:r,outerNumeric:i}=t.main,o=t.forecast,a={key:Gb.COLLECTION.FORECAST,data:{extract:o.map(({measureIndex:t,field:o,lower:a,upper:s})=>({field:r,props:{major:{field:i},end:{field:o,label:LZ({dataset:e.query.getDataset(),minor:`qMeasureInfo/${t}`})},lower:{field:a},upper:{field:s},line:t,...NZ({colorService:n,index:t}),null:{field:o,value:e=>"NaN"===e.qNum},interpolated:{field:o,value:e=>!!e.interpolated},fromDynamicScript:{field:r,value:e=>e.qInExtRow},id:{value:e=>`r${e.qRow}e${e.qElemNumber}m${t}`}}}))}};return a}({chartModel:e,fieldModel:n,colorService:r});if(o.push(a),Yp({layoutService:t}).miniChart){const e=l(!0,{},a);e.key=Gb.COLLECTION.REDUCED_FORECAST,e.data.extract.forEach(e=>{e.source=Gb.DATA.REDUCED}),o.push(e)}return o}function RZ({layoutService:e,reducedModel:t,fieldModel:n,chartModel:r,extremumModel:i,tickModel:o,colorService:a,resources:s}){const l=function({layoutService:e,chartModel:t,fieldModel:n,extremumModel:r,tickModel:i,colorService:o,resources:a}){return(e.meta.isOneDimensional?TZ:DZ)({layoutService:e,chartModel:t,fieldModel:n,extremumModel:r,tickModel:i,colorService:o})}({layoutService:e,fieldModel:n,chartModel:r,extremumModel:i,tickModel:o,colorService:a,resources:s});return[l,_Z({layoutService:e,reducedModel:t,fieldModel:n,extremumModel:i,tickModel:o,colorService:a,main:l}),...PZ({chartModel:r,layoutService:e,fieldModel:n,colorService:a})].filter(Boolean)}var FZ={AXIS:{MAJOR:{horizontal:{width:"XSMALL",height:"SMALL"},vertical:{width:"SMALL",height:"XSMALL"}},MINOR:"XSMALL"},AXIS_TITLE:{MAJOR:{horizontal:{width:"XSMALL",height:"MEDIUM"},vertical:{width:"MEDIUM",height:"XSMALL"}},MINOR:"SMALL"},GRID_LINE:"XSMALL",VALUE_LABEL:"XSMALL",LABEL_SPACE:"XSMALL",OUT_OF_BOUNDS_MARKER:"XSMALL",REDUCED_LINE:"XSMALL",REFERENCE_LINE:"SPARK"};function zZ({layoutService:e,dockService:t,themeService:n,chartModel:r,styleModel:i}){const o=e.getLayoutValue("measureAxis"),a=i.query.axis.label.getStyle();if(!o)return!1;const{show:s}=o;if("none"===s)return!1;const l=n.getStyles();return{type:"axis",key:Gb.COMPONENT.MINOR_AXIS,renderer:jh(),scale:Gb.SCALE.MAIN.MINOR,layout:{dock:t.meta.minor.dock,minimumLayoutMode:FZ.AXIS.MINOR},settings:{labels:{show:"title"!==s,fontSize:a.fontSize,fontFamily:a.fontFamily,fill:a.fill},line:{stroke:l.axis.line.major.color},ticks:{stroke:l.axis.line.major.color},minorTicks:{stroke:l.axis.line.minor.color}},animations:{enabled:r.query.animationsEnabled,trackBy:Ih.axes.trackBy({isMeasure:!0}),compensateForLayoutChanges:Ih.axes.compensateForLayoutChanges({isMeasure:!0,dock:t.meta.minor.dock})}}}function jZ({context:e,layoutService:t,dockService:n,themeService:r,chartModel:i,styleModel:o}){const{show:a,label:s}=t.getLayoutValue("dimensionAxis"),{auto:l,spacing:c}=t.getLayoutValue("gridLine",{}),{orientation:u}=n.meta.major,d="horizontal"===u,f=r.getStyles(),h=o.query.axis.label.getStyle(),p=function({layoutService:e}){const t=e.getHyperCubeValue("qDimensionInfo.0.qApprMaxGlyphCount"),[n]=e.getDataPages(),r=e.meta.mode.K,i=r?n.qData[0].qSubNodes:n.qMatrix,o=r?void 0:0;return N.getAdjustedMaxGlyphCount(t,i,o,"qText")}({layoutService:t}),m=d?s:"auto";return{type:"axis",key:Gb.COMPONENT.MAJOR_AXIS,renderer:jh(),scale:Gb.SCALE.MAIN.MAJOR,layout:{dock:n.meta.major.dock,minimumLayoutMode:FZ.AXIS.MAJOR[u]},settings:{labels:{show:"title"!==a,mode:m,tiltAngle:e.rtl?-40:40,maxEdgeBleed:50,maxLengthPx:"horizontal"===m?void 0:n.meta.minor.size/4,maxGlyphCount:p,tiltThreshold:p>3&&p<13?1:void 0,fontSize:h.fontSize,fontFamily:h.fontFamily,fill:h.fill},line:{show:!l&&0===c,stroke:f.axis.line.major.color},paddingEnd:4},brush:{consume:[{context:"selection",data:["selectionDimension","selectionInnerDimension"],style:{inactive:{opacity:.5}}}]},animations:{enabled:i.query.animationsEnabled,trackBy:Ih.axes.trackBy({isMajor:!0}),compensateForLayoutChanges:Ih.axes.compensateForLayoutChanges({isHorizontal:d})}}}function $Z({layoutService:e,dockService:t,themeService:n,chartModel:r,styleModel:i}){const{show:o}=e.getLayoutValue("dimensionAxis"),{auto:a,spacing:s}=e.getLayoutValue("gridLine",{}),{orientation:l}=t.meta.major,c=n.getStyles(),u=i.query.axis.label.getStyle();return{type:"axis",key:Gb.COMPONENT.MAJOR_AXIS_CONTINUOUS,renderer:jh(),scale:Gb.SCALE.MAIN.MAJOR,layout:{dock:t.meta.major.dock,minimumLayoutMode:FZ.AXIS.MAJOR[l]},settings:{labels:{show:"title"!==o,align:0,offset:4,fontSize:u.fontSize,fontFamily:u.fontFamily,fill:u.fill},line:{show:!a&&0===s},ticks:{show:!0,stroke:c.axis.line.major.color},minorTicks:{show:!1}},animations:{enabled:r.query.animationsEnabled,trackBy:Ih.axes.trackBy({isContinuous:!0}),compensateForLayoutChanges:Ih.axes.compensateForLayoutChanges({isContinuous:!0})}}}function VZ({context:e,layoutService:t,dockService:n,themeService:r,chartModel:i,styleModel:o}){const a=t.getLayoutValue("dimensionAxis");if(!a||"none"===a.show)return[];const{isDiscrete:s,isTime:c}=t.meta;return s?[jZ({context:e,layoutService:t,dockService:n,themeService:r,chartModel:i,styleModel:o})]:c?function({context:e,dockService:t,themeService:n,layoutService:r,chartModel:i,styleModel:o}){const{rtl:a}=e,{auto:s,spacing:c}=r.getLayoutValue("gridLine",{}),{orientation:u}=t.meta.major,d="bottom"===t.meta.major.dock?0:1,f=n.getStyles(),h=o.query.axis.label.getStyle(),p=a?1:0,m={type:"time-axis",renderer:"svg",layout:{dock:t.meta.major.dock,minimumLayoutMode:FZ.AXIS.MAJOR[u]},preferredSize:()=>({size:2*parseFloat(h.fontSize),edgeBleed:{left:1,right:1}}),settings:{anchor:a?"end":"start",label:{align:d,justify:p},guideLine:{major:{justify:p},minor:{align:d}}},style:{label:h,majorGuideLine:{stroke:f.axis.line.major.color},minorGuideLine:{stroke:f.axis.line.minor.color}},animations:{enabled:i.query.animationsEnabled,trackBy:Ih.axes.trackBy({isTime:!0}),compensateForLayoutChanges:Ih.axes.compensateForLayoutChanges({isTime:!0})}};return[l(!0,{},m,{key:Gb.COMPONENT.MAJOR_AXIS_TIME_INNER,scale:Gb.SCALE.MAIN.MAJOR_INNER,settings:{guideLine:{minor:{show:!0}},line:{show:!s&&0===c}},style:{line:{stroke:f.axis.line.major.color},majorGuideLine:{stroke:f.axis.line.minor.color},minorGuideLine:{stroke:f.axis.line.major.color}}}),l(!0,{},m,{key:Gb.COMPONENT.MAJOR_AXIS_TIME_OUTER,scale:Gb.SCALE.MAIN.MAJOR,settings:{guideLine:{minor:{show:!1}},line:{show:!1}}})]}({context:e,layoutService:t,dockService:n,themeService:r,chartModel:i,styleModel:o}):[$Z({layoutService:t,dockService:n,themeService:r,chartModel:i,styleModel:o})]}function UZ({layoutService:e,dockService:t}){const{isContinuous:n,isTime:r}=e.meta,i=e.getLayoutValue("dimensionAxis");if(!i||"none"===i.show||"title"===i.show)return[!1];if(!n)return[!1];const o=FZ.AXIS.MAJOR[t.meta.major.orientation];return r?[{type:"axis-overlay",key:Gb.COMPONENT.MAJOR_AXIS_OVERLAY_TIME_INNER,scale:Gb.SCALE.MAIN.MAJOR_INNER,layout:{dock:`@${Gb.COMPONENT.MAJOR_AXIS_TIME_INNER}`,minimumLayoutMode:o}},{type:"axis-overlay",key:Gb.COMPONENT.MAJOR_AXIS_OVERLAY_TIME_OUTER,scale:Gb.SCALE.MAIN.MAJOR,layout:{dock:`@${Gb.COMPONENT.MAJOR_AXIS_TIME_OUTER}`,minimumLayoutMode:o}}]:[{type:"axis-overlay",key:Gb.COMPONENT.MAJOR_AXIS_OVERLAY_CONTINUOUS,scale:Gb.SCALE.MAIN.MAJOR,layout:{dock:`@${Gb.COMPONENT.MAJOR_AXIS_CONTINUOUS}`,minimumLayoutMode:o}}]}function HZ({actions:e,alternativeService:t,app:n,dockService:r,layoutService:i,model:o,rtl:a,selections:s,styleModel:l,translator:c,viewCache:u}){const d=i.getLayoutValue("measureAxis");if(!d)return!1;const{show:f}=d;if("all"!==f&&"title"!==f)return!1;const h=t.getAlternatives(),p=l.query.axis.title.getStyle(),m={type:"axis-title",key:Gb.COMPONENT.MINOR_AXIS_TITLE,renderer:"react-qcm",layout:{dock:r.meta.minor.dock,minimumLayoutMode:FZ.AXIS_TITLE.MINOR},data:{infos:i.getHyperCubeValue("qMeasureInfo"),alternatives:h.measures,filtered:i.meta.filteredFields.measures},resources:{app:n,cache:u,model:o,selections:s,translator:c},callbacks:{onChange:()=>{}},settings:{isDisabled:()=>!e.interact.enabled(),isRTL:a,isSnapshot:i.meta.isSnapshot,noModelDependencies:!0,skipAttributeExpressions:!1,type:"measure"},style:{title:{color:p.color,fontFamily:p.fontFamily,fontSize:p.fontSize}}};return i.meta.isOneDimensional&&(m.callbacks.onChange=({newProperties:e,model:t})=>{Xm({enabledForecast:!0,properties:e,layout:t.layout})}),m}function BZ({actions:e,alternativeService:t,app:n,dockService:r,layoutService:i,model:o,rtl:a,selections:s,styleModel:l,translator:c,viewCache:u}){const d=i.getLayoutValue("dimensionAxis");if(!d)return!1;const{show:f}=d;if("all"!==f&&"title"!==f)return!1;const h=t.getAlternatives(),{orientation:p}=r.meta.major,m=l.query.axis.title.getStyle(),g={type:"axis-title",key:Gb.COMPONENT.MAJOR_AXIS_TITLE,renderer:"react-qcm",layout:{dock:r.meta.major.dock,minimumLayoutMode:FZ.AXIS_TITLE.MAJOR[p]},data:{infos:i.getHyperCubeValue("qDimensionInfo"),alternatives:h.dimensions,filtered:i.meta.filteredFields.dimensions},resources:{app:n,cache:u,model:o,selections:s,translator:c},callbacks:{onChange:()=>{}},settings:{isDisabled:()=>!e.interact.enabled(),isRTL:a,isSnapshot:i.meta.isSnapshot,noModelDependencies:!0,skipAttributeExpressions:!1,type:"dimension"},style:{title:{color:m.color,fontFamily:m.fontFamily,fontSize:m.fontSize}}};return i.meta.isOneDimensional&&(g.callbacks.onChange=({newProperties:e,model:t})=>{Xm({enabledForecast:!0,properties:e,layout:t.layout})}),g}function WZ({actions:e,alternativeService:t,context:n,dockService:r,layoutService:i,resources:o,selections:a,styleModel:s,viewCache:l}){const c={actions:e,alternativeService:t,app:o.app,dockService:r,layoutService:i,model:o.model,rtl:n.rtl,selections:a,styleModel:s,translator:o.translator,viewCache:l};return[HZ(c),BZ(c)]}function YZ({context:e,selectionService:t,layoutService:n,dockService:r,colorService:i,largeDataService:o}){const{rtl:a}=e,{isContinuous:s,isOneDimensional:l,hasMultipleMeasures:c,isStacked:u}=n.meta,d=n.getLayoutValue("color",{});return{type:"brush-highlighter",key:"brush-highlighter",data:{collection:Gb.COLLECTION.MAIN},settings:{highlightArea:()=>!(n.meta.isStacked&&o.shouldUseProgressive()),getSelectionInfo:()=>t.getSelectionInfo()||{},getSelectionContext:o.getSelectionContext,getProgressiveRender:()=>o.highlightLines,selectionValues:{"qHyperCube/qDimensionInfo/0":s?e=>l?e.value:e.selectionOuterDimension.value:e=>e.major.value,"qHyperCube/qDimensionInfo/0:numeric":e=>e.major.value,"qHyperCube/qDimensionInfo/1":l?e=>e.major.value:e=>e.line.value,"qHyperCube/qMeasureInfo/0":e=>e.end.value,"qHyperCube/qDimensionInfo/0/qAttrExprInfo/0":e=>e.end.value},colorSettings:i.getMain().getSettings(),colorByData:!d.auto&&"byMeasure"===d.mode&&d.byMeasureDef&&void 0!==d.byMeasureDef.activeMeasureIndex,isColorCode:!d.auto&&"byExpression"===d.mode&&d.expressionIsColor,hasMultipleMeasures:c,isStacked:u,orientation:r.meta.major.orientation,rtl:a},rendererSettings:{progressive:o.meta.isMaxNumPointsEnabled?()=>o.meta.highlighterProgressive:void 0}}}function GZ({dockService:e}){return{type:"ghost-point",key:Gb.COMPONENT.GHOST_POINT,data:{collection:Gb.COLLECTION.MAIN},layout:{dock:`@${Gb.COMPONENT.POINT}`},settings:{orientation:e.meta.major.orientation}}}function KZ({layoutService:e,themeService:t,chartModel:n}){const{isContinuous:r,isTime:i}=e.meta,o=e.getLayoutValue("dimensionAxis.gridLine");if(!r||!1===o)return[!1];const a=t.getStyles(),s={type:"grid-line",layout:{minimumLayoutMode:FZ.GRID_LINE},ticks:{stroke:a.grid.line.major.color},minorTicks:{show:!1,stroke:a.grid.line.minor.color},animations:{enabled:n.query.animationsEnabled,trackBy:Ih.lines.trackBy,compensateForLayoutChanges:Ih.lines.compensateForLayoutChanges}};return i?[l(!0,{},s,{key:"time-inner-grid",x:{scale:Gb.SCALE.MAIN.MAJOR_INNER},ticks:{stroke:a.grid.line.minor.color}}),l(!0,{},s,{key:"time-outer-grid",x:{scale:Gb.SCALE.MAIN.MAJOR}})]:[l(!0,{},s,{key:"continuous-grid",x:{scale:Gb.SCALE.MAIN.MAJOR},minorTicks:{show:!0}})]}const XZ=0,JZ=1,ZZ=3;function QZ({layoutService:e,extremumModel:t,dockService:n,tickModel:r,themeService:i,gridLine:o,chartModel:a}){const s=t.query.getExtrema();if(!o||e.getLayoutValue("measureAxis.logarithmic",!1)&&!s.meta.includesZero)return!1;const l=i.getStyles();return{key:Gb.COMPONENT.ZERO_LINE,type:"ref-line",layout:{minimumLayoutMode:FZ.GRID_LINE},show:()=>r.query.getMin()<=0&&r.query.getMax()>=0,scale:Gb.SCALE.MAIN.MINOR,lines:{["horizontal"===n.meta.minor.orientation?"x":"y"]:[{value:0,scale:Gb.SCALE.MAIN.MINOR,line:{stroke:l.grid.line.highContrast.color}}]},animations:{enabled:a.query.animationsEnabled,trackBy:Ih.lines.trackBy,compensateForLayoutChanges:Ih.lines.compensateForLayoutChanges}}}function eQ({layoutService:e,extremumModel:t,dockService:n,tickModel:r,themeService:i,chartModel:o}){const a=function({layoutService:e,dockService:t,themeService:n,chartModel:r}){const{auto:i,spacing:o}=e.getLayoutValue("gridLine",{});if(!i&&o===XZ)return!1;const a=n.getStyles();return{key:Gb.COMPONENT.GRID_LINE,type:"grid-line",layout:{minimumLayoutMode:FZ.GRID_LINE},preferredSize:()=>({size:0,edgeBleed:{left:1,right:1,top:1,bottom:1}}),ticks:{show:!(!i&&o===JZ)||((e,t)=>t%2==0),stroke:a.grid.line.major.color},minorTicks:{show:!i&&o===ZZ,stroke:a.grid.line.minor.color},["horizontal"===t.meta.major.orientation?"y":"x"]:Gb.SCALE.MAIN.MINOR,animations:{enabled:r.query.animationsEnabled,trackBy:Ih.lines.trackBy,compensateForLayoutChanges:Ih.lines.compensateForLayoutChanges}}}({layoutService:e,dockService:n,themeService:i,chartModel:o});return[a,QZ({layoutService:e,extremumModel:t,dockService:n,tickModel:r,themeService:i,gridLine:a,chartModel:o}),...KZ({layoutService:e,themeService:i,chartModel:o})]}function tQ({chart:e,layoutService:t,extremumModel:n,dockService:r,chartModel:i}){const o=t.getLayoutValue("dataPoint",{});if(!o.show||!1===o.showLabels||"none"===o.showLabels)return!1;const{rtl:a}=r.config,s="horizontal"===r.meta.major.orientation,{show:l}=t.getLayoutValue("dimensionAxis",{});if("none"!==l){const{dock:e}=r.meta.major;if(s&&"top"===e)return!1;if(!s&&e===(a?"left":"right"))return!1}const c=a?"left":"right",u=s?21:42;return{type:"label-space",key:Gb.COMPONENT.LABEL_SPACE,layout:{minimumLayoutMode:FZ.LABEL_SPACE,dock:s?"top":c},settings:{size:u},preferredSize(){const t=e.component(Gb.COMPONENT.LINE);if(!t?.rect)return 0;const r=(s?17:34)/t.rect[s?"height":"width"],o=n.query.getExtrema(),l=e.scale(Gb.SCALE.MAIN.MINOR)(o.implicit.max),c=(s||a?l:1-l)<r;return i.command.setUseLabelSpace(c),c?u:0}}}function nQ(){const e={medians:{}},t=t=>{const{id:n}=t;return void 0===e.medians[n]&&(e.medians[n]=(e=>{const t=e.map(e=>e.end.value).sort((e,t)=>t-e);return Math.abs(t[Math.floor(t.length/2)])})(t.data)),e.medians[n]};return(e,n)=>t(n)-t(e)}function rQ({property:e,isHorizontal:t,isColor:n,fallback:r,rtl:i,isContinuous:o,isReduced:a,colorService:s}){return function(l){const{datum:c,resources:{scale:u}}=l;if(s){const e=c.points.every(e=>(e?.color?.value||void 0)===(c.points[0]?.color?.value||void 0));if(e)return s.getMain().getColor()(l)}const d=u(a?Gb.SCALE.REDUCED.MAJOR:Gb.SCALE.MAIN.MAJOR),f=u(o&&a?Gb.SCALE.REDUCED.COLOR:Gb.SCALE.MAIN.COLOR),h=t&&i?[...c.points].reverse():c.points,p=h.reduce((t,n,r)=>{const i="NaN"===n[e].value||Number.isNaN(n[e].value),o=h[r+1],a=o&&"NaN"!==o[e].value&&!Number.isNaN(o[e].value);return i?t.length&&a&&t.push(n):t.push(n),t},[]),m=p.map(e=>d(e.major.value)),g=Math.min(...m),y=Math.max(...m)-g,v=0===y?1:y,b=m.map((e,t)=>0===t?0:t===m.length-1?1:(e-g)/v),x=[];for(let t=0;t<p.length;t++){const i=p[t],o=i.color&&i.color.value,a=n?o||r:f(o)||r,s=0===t,l=t===p.length-1,c=b[t];if("NaN"===i[e].value||Number.isNaN(i[e].value))x[t-1].virtual||x.push({virtual:!0});else{const n=p[t-1];n&&"NaN"!==n[e].value&&!Number.isNaN(n[e].value)?x.push({color:a,offset:s?0:Math.max(0,parseFloat((c-(c-b[t-1])/2).toFixed(5)))}):x.push({color:a,offset:c});const r=p[t+1];r&&"NaN"!==r[e].value&&!Number.isNaN(r[e].value)?x.push({color:a,offset:l?1:Math.max(0,parseFloat((c+(b[t+1]-c)/2).toFixed(5)))}):x.push({color:a,offset:c})}}const S=x.reduce((e,t,n)=>{if(t.virtual){const t=x[n-1],r=x[n+1],i=t.offset+(r.offset-t.offset)/2;e.push({color:t.color,offset:i},{color:r.color,offset:i})}else e.push(t);return e},[]);return{type:"gradient",x1:0,x2:t?1:0,y1:0,y2:t?0:1,stops:S}}}function iQ({isHorizontal:e,isArea:t,isContinuous:n,isReduced:r,rtl:i}){return function(o){const{datum:{points:a},resources:{scale:s}}=o,l=s(n&&r?Gb.SCALE.REDUCED.COLOR:Gb.SCALE.MAIN.COLOR),c=a.map(e=>e.end.value).filter(e=>"NaN"!==e&&!Number.isNaN(e)),u=Math.min(...c),d=Math.max(...c),f=t?Math.min(0,u):u,h=t?Math.max(0,d):d,p=h-f,m=0===p?1:p,g=l.domain().map(e=>({color:l(Math.min(h,Math.max(f,e))),offset:Math.min(1,Math.max(0,(e-f)/m))}));return{type:"gradient",x1:!e&&i?1:0,x2:e||i?0:1,y1:e?1:0,y2:0,stops:g}}}function oQ({isHorizontal:e,isArea:t,isContinuous:n,isReduced:r,fallback:i,rtl:o}){return function(a){const{datum:{points:s},resources:{scale:l}}=a,c=l(n&&r?Gb.SCALE.REDUCED.COLOR:Gb.SCALE.MAIN.COLOR),u=s.map(e=>e.end.value).filter(e=>"NaN"!==e&&!Number.isNaN(e)),d=Math.min(...u),f=Math.max(...u),h=t?Math.min(0,d):d,p=(t?Math.max(0,f):f)-h,m=0===p?1:p,g=c.domain(),y=[];for(let e=0;e<g.length-1;e++){const t=g[e],n=c(t)||i;y.push({color:n,offset:Math.min(1,Math.max(0,(t-h)/m))});const r=g[e+1];y.push({color:n,offset:Math.min(1,Math.max(0,(r-h)/m))})}return{type:"gradient",x1:!e&&o?1:0,x2:e||o?0:1,y1:e?1:0,y2:0,stops:y}}}function aQ({context:e,layoutService:t,dockService:n,colorService:r,isArea:i,isReduced:o}){const{rtl:a}=e,{isTwoDimensional:s,hasMultipleMeasures:l,isContinuous:c,isStacked:u}=t.meta,d=u&&t.getLayoutValue("separateStacking",!0)?"point":"end",{mode:f,type:h,nil:p}=r.getMain().getSettings(),m="horizontal"===n.meta.major.orientation;if(!f||"constant"===h)return r.getMain().getColor();const g=t.getLayoutValue("color",{}),y=!g.auto&&"byExpression"===g.mode,v=!!g.colorExpression;if(y&&!v)return p;if(s&&!y)return rQ({property:d,isHorizontal:m,isColor:!1,fallback:p,rtl:a,isContinuous:c,isReduced:o,colorService:r});const b=!g.auto&&"byMeasure"===g.mode&&g.byMeasureDef&&void 0!==g.byMeasureDef.activeMeasureIndex;if(l||!b)return rQ({property:d,isHorizontal:m,isColor:y&&g.expressionIsColor,fallback:p,rtl:a,isContinuous:c,isReduced:o});return("continuous"===h?iQ:oQ)({isHorizontal:m,isArea:i,isContinuous:c,isReduced:o,fallback:p,rtl:a})}const sQ=e=>void 0===e.strokeLinejoin;function lQ({context:e,layoutService:t,extremumModel:n,dockService:r,styleModel:i,tickModel:o,colorService:a,largeDataService:s,chartModel:l}){const{isStacked:c,isArea:u,isConnect:d}=t.meta,f=t.getLayoutValue("measureAxis.logarithmic",!1),h=t.getLayoutValue("separateStacking",!0),p=nQ(),{fieldType:m}=a.getMain().getSettings(),g={key:Gb.COMPONENT.LINE,type:"line",data:{collection:Gb.COLLECTION.MAIN},settings:{coordinates:{minor:{scale:Gb.SCALE.MAIN.MINOR,fn:e=>{if(c&&h){const t=e.datum.point.value<0?e.datum.start.value:e.datum.end.value;return e.scale(t)}return e.scale(e.datum.end.value)}},major:{scale:Gb.SCALE.MAIN.MAJOR,ref:"major"},layerId:{ref:"line"}},orientation:r.meta.major.orientation,layers:{sort:p,curve:i.query.line.getCurve(),line:{stroke:aQ({context:e,layoutService:t,dockService:r,colorService:a}),strokeWidth:i.query.line.getStrokeWidth(),strokeDasharray:i.query.line.getStrokeDasharray(),strokeLinejoin:"round",showMinor0:!1}},connect:d},brush:{consume:[{context:s.getSelectionContext(),data:["selectionDimension"],filter:e=>!sQ(e),style:{active:{opacity:.5},inactive:{opacity:.5}}}],customRender:s.meta.isMaxNumPointsEnabled?({render:e,nodes:t})=>{s.dimLines({render:e,nodes:t})}:void 0},rendererSettings:{progressive:s.meta.isMaxNumPointsEnabled?()=>s.meta.lineProgressive:void 0},animations:{enabled:l.query.animationsEnabled,trackBy:Ih.lines.trackBy,compensateForLayoutChanges:Ih.lines.compensateForLayoutChanges,isMainComponent:{filterFn:e=>e.commonPoints.length>0}}};return(f||c)&&(g.settings.coordinates.minor0={scale:Gb.SCALE.MAIN.MINOR,fn:e=>{if(c){if(h){const t=e.datum.point.value<0?e.datum.end.value:e.datum.start.value;return e.scale(t)}return e.scale(e.datum.start.value)}const t=n.query.getExtrema().meta.includesZero?0:o.query.getMin();return e.scale(t)}}),u&&(g.settings.layers.area={fill:aQ({context:e,layoutService:t,dockService:r,colorService:a,isArea:!0}),opacity:"measure"===m||"expression"===m?.6:.3},g.brush.consume.push({context:"selection",data:["selectionDimension"],filter:e=>sQ(e),style:{active:{opacity:.15},inactive:{opacity:.15}}})),g}function cQ({context:e,layoutService:t,extremumModel:n,dockService:r,themeService:i,tickModel:o,chartModel:a}){const{isZero:s,isStacked:l}=t.meta,c=n.query.getExtrema();if(!c.meta.hasExplicitMin&&!s)return!1;const u=t.getLayoutValue("separateStacking",!0),d=Number(c.implicit.min.toFixed(13)),{rtl:f}=e,{dock:h,orientation:p}=r.meta.major,m=i.getStyles(),g=t.getLayoutValue("measureAxis.logarithmic",!1)&&!c.meta.includesZero;return{type:"out-of-bounds-marker",key:Gb.COMPONENT.OUT_OF_MIN_BOUNDS,layout:{dock:h,minimumLayoutMode:FZ.OUT_OF_BOUNDS_MARKER},data:{collection:Gb.COLLECTION.MAIN},settings:{type:"min",extremum:()=>o.query.getMin(),separateStacking:l&&u,orientation:p,rtl:f,major:{scale:Gb.SCALE.MAIN.MAJOR}},show:()=>{const e=o.query.getMin();return!(d>=e&&!s)&&!(s&&(g||e<=0)&&d>=e)},style:{fill:m.outOfRange.color},animations:{enabled:a.query.animationsEnabled,compensateForLayoutChanges:Ih.lineOobs.compensateForLayoutChanges}}}function uQ({context:e,layoutService:t,extremumModel:n,dockService:r,themeService:i,tickModel:o,chartModel:a}){const{isZero:s,isStacked:l}=t.meta,c=n.query.getExtrema();if(!c.meta.hasExplicitMax&&!s)return!1;const u=t.getLayoutValue("separateStacking",!0),d=Number(c.implicit.max.toFixed(13)),{rtl:f}=e,{opposite:h,orientation:p}=r.meta.major,m=i.getStyles(),g=t.getLayoutValue("measureAxis.logarithmic",!1)&&!c.meta.includesZero;return{type:"out-of-bounds-marker",key:Gb.COMPONENT.OUT_OF_MAX_BOUNDS,layout:{dock:h,minimumLayoutMode:FZ.OUT_OF_BOUNDS_MARKER},data:{collection:Gb.COLLECTION.MAIN},settings:{type:"max",extremum:()=>o.query.getMax(),separateStacking:l&&u,orientation:p,rtl:f,major:{scale:Gb.SCALE.MAIN.MAJOR}},show:()=>{const e=o.query.getMax();return!(d<=e&&!s)&&!(s&&(g||e>=0)&&d<=e)},style:{fill:m.outOfRange.color},animations:{enabled:a.query.animationsEnabled,compensateForLayoutChanges:Ih.lineOobs.compensateForLayoutChanges}}}function dQ({context:e,layoutService:t,extremumModel:n,dockService:r,themeService:i,tickModel:o,chartModel:a}){return[cQ({context:e,layoutService:t,extremumModel:n,dockService:r,themeService:i,tickModel:o,chartModel:a}),uQ({context:e,layoutService:t,extremumModel:n,dockService:r,themeService:i,tickModel:o,chartModel:a})]}function fQ({chart:e,context:t,layoutService:n,dockService:r,themeService:i,refLineModel:o,colorService:a,chartModel:s}){const{rtl:l,theme:c,localeInfo:u}=t,d=i.getStyles(),{animationsEnabled:f}=s.query;return[Rh({refLineModel:o,layoutService:n,colorModel:{resolveUIColor:a.getMain().getPaletteColor},dockService:r,animationsEnabled:f,chart:e,scale:Gb.SCALE.MAIN.MINOR,axis:"horizontal"===r.meta.major.orientation?"y":"x",key:Gb.COMPONENT.MEASURE_REF_LINE,minimumLayoutMode:FZ.REFERENCE_LINE}),Rh({isDimension:!0,refLineModel:o,layoutService:n,colorModel:{resolveUIColor:a.getMain().getPaletteColor},dockService:r,animationsEnabled:f,chart:e,scale:Gb.SCALE.MAIN.MAJOR,axis:"horizontal"===r.meta.major.orientation?"x":"y",rtl:l,key:Gb.COMPONENT.DIMENSION_REF_LINE,mainComponentKey:Gb.COMPONENT.LINE,minimumLayoutMode:FZ.REFERENCE_LINE}),...Fh({refLineModel:o,layoutService:n,colorModel:{resolveUIColor:a.getMain().getPaletteColor},animationsEnabled:f,dock:r.meta.minor.opposite,scale:Gb.SCALE.MAIN.MINOR,style:d,formatter:Gb.FORMATTER.MINOR,theme:c,localeInfo:u,rtl:l,key:Gb.COMPONENT.MEASURE_REF_LINE_LABEL}),...Fh({isDimension:!0,refLineModel:o,layoutService:n,colorModel:{resolveUIColor:a.getMain().getPaletteColor},animationsEnabled:f,dock:r.meta.major.opposite,scale:Gb.SCALE.MAIN.MAJOR,style:d,theme:c,localeInfo:u,rtl:l,key:Gb.COMPONENT.DIMENSION_REF_LINE_LABEL})]}function hQ({layoutService:e}){const{isConnect:t}=e.meta,n=function({layoutService:e}){const{isDiscrete:t}=e.meta;return({item:e})=>{if(e.dummy)return t;const{value:n}=e.end;return"NaN"===n||Number.isNaN(n)}}({layoutService:e}),r=t?(e,t)=>0!==e&&t.slice(0,e).reverse().some(e=>!n({item:e})):(e,t)=>0!==e&&!n({item:t[e-1]}),i=t?(e,t)=>e!==t.length-1&&t.slice(e+1,t.length).some(e=>!n({item:e})):(e,t)=>e!==t.length-1&&!n({item:t[e+1]});return({index:e,items:t})=>({before:r(e,t),after:i(e,t)})}function pQ({layoutService:e}){const t={key:void 0,map:void 0},n=hQ({layoutService:e});return({item:r,items:i})=>{t.key!==i&&(t.key=i,t.map=function({layoutService:e,items:t}){const{isOneDimensional:n}=e.meta,r=t.reduce((e,t)=>{const{value:n}=t.line;return e[n]||(e[n]={items:[],keys:[]}),e[n].items.push(t),e[n].keys.push(`${t.major.value}-${t.line.value}`),e},{});if(n||1===Object.keys(r).length)return r;const i=t.map(e=>e.major.value),o=i.filter((e,t)=>i.indexOf(e)===t),a=Object.keys(r),s={};return o.forEach(e=>{a.forEach(t=>{s[t]||(s[t]={items:[],keys:[]});const n=r[t].items.filter(t=>t.major.value===e)[0];s[t].items.push(n||{dummy:!0}),s[t].keys.push(n?`${n.major.value}-${n.line.value}`:"dummy")})}),s}({layoutService:e,items:i}));const{value:o}=r.line,a=t.map[o],s=`${r.major.value}-${r.line.value}`,l=a.keys.indexOf(s),{before:c,after:u}=n({index:l,items:a.items});return!c&&!u}}const mQ=3,gQ=20;function yQ({selectionService:e,layoutService:t,dockService:n,styleModel:r,tickModel:i,colorService:o,largeDataService:a,chartModel:s}){const{isContinuous:l,isStacked:c}=t.meta,u=t.getLayoutValue("separateStacking",!0),d=t.getLayoutValue("dataPoint.show",!1),f=o.getMain().getColor(),h="horizontal"===n.meta.major.orientation,p="SPARK"===n.meta.chart.mode,m=LJ.POINT.SIZE.DEFAULT/2,g=pQ({layoutService:t});return{key:Gb.COMPONENT.POINT,type:"point",data:{collection:Gb.COLLECTION.MAIN},preferredSize:()=>({edgeBleed:{top:h?m:0,right:l?m:0,left:l?m:0}}),settings:{[h?"y":"x"]:{scale:Gb.SCALE.MAIN.MINOR,fn:e=>{if(c&&u){const t=e.datum.point.value<0?e.datum.start.value:e.datum.end.value;return e.scale(t)}return e.scale(e.datum.end.value)}},[h?"x":"y"]:{scale:Gb.SCALE.MAIN.MAJOR,ref:"major"},sizeLimits:{minPx:mQ,maxPx:gQ},size:e=>{const{value:t}=e.datum.line;return`${r.query.point.getSize(t)}px`},fill:f,opacity:e=>{if(l){const t=e.resources.scale(Gb.SCALE.MAIN.MAJOR)(e.datum.major.value);if(t<0||t>1)return.01}const t=i.query.getMin(),n=i.query.getMax(),{datum:r}=e,{value:o}=c&&u&&r.point&&r.point.value<0?r.start:r.end;return r.null.value||r.interpolated.value?0:o<t||o>n?.01:p?g({item:r,items:e.data.items})?1.01:0:d?1:g({item:r,items:e.data.items})?1.01:0}},brush:{consume:[{context:a.getSelectionContext(),data:["selectionDimension","selectionOuterDimension","end",Gb.SCALE.MAIN.COLOR,"major"],filter:e=>!e.data.null.value&&!e.data.interpolated.value,style:{active:{r:e=>e.r+LJ.POINT.SIZE.ACTIVE/2,opacity:t=>{if(1.01===t.opacity)return 1;if(.01===t.opacity)return 0;if(!l||d)return 1;const{event:n,components:r}=e.getSelectionInfo();if("continuousRange"===n)return 0;if("tap"!==n)return 1;const i=[Gb.COMPONENT.MAJOR_AXIS_OVERLAY_CONTINUOUS,Gb.COMPONENT.MAJOR_AXIS_OVERLAY_TIME_INNER,Gb.COMPONENT.MAJOR_AXIS_OVERLAY_TIME_OUTER].some(e=>r.indexOf(e)>=0);return i?0:1},strokeWidth:1.5,stroke:"#FFFFFF"},inactive:{opacity:e=>1===e.opacity||1.01===e.opacity?.5:0}}}],customRender:a.meta.isMaxNumPointsEnabled?({render:e,nodes:t})=>{a.brushPoints({render:e,nodes:t})}:void 0},rendererSettings:{progressive:a.meta.isMaxNumPointsEnabled?()=>a.meta.pointProgressive:void 0},animations:{enabled:s.query.animationsEnabled,trackBy:Ih.nonUpdatingNode.trackBy,compensateForLayoutChanges:Ih.points.compensateForLayoutChanges}}}function vQ({layoutService:e,dockService:t,chartModel:n,largeDataService:r,styleModel:i,viewCache:o}){const a=e.getLayoutValue("dataPoint");if(!a)return!1;if(!a.show)return!1;if(!1===a.showLabels||"none"===a.showLabels)return!1;const{rtl:s}=t.config,{orientation:l}=t.meta.major,{isDiscrete:c,isStacked:u,isOneDimensional:d}=e.meta,f=u?e=>e.point.label:e=>e.end.label,h=d?e=>e.value:e=>e.major.value,p=i.query.label.getStyle();return{type:"point-label",key:Gb.COMPONENT.POINT_LABEL,renderer:jh(),layout:{minimumLayoutMode:FZ.VALUE_LABEL},settings:{orientation:l,rtl:s,label:f,pointValue:e=>e.end.value,majorValue:h,lineId:e=>e.data.line.value,configs:[{key:Gb.COMPONENT.POINT,labels:!0,lines:!0},{key:Gb.COMPONENT.FORECAST_POINT,labels:!1,lines:!0}],all:"all"===a.showLabels,enabled:()=>!r?.isLargeNumVisiblePoints(),insideStrategy:c?"edge":"center",labelSpace:{use:()=>n.query.getIsUsingLabelSpace(),size:"horizontal"===l?21:42},cache:o},style:{fontFamily:p.fontFamily,fontSize:p.fontSize,fill:p.fill},animations:{enabled:n.query.animationsEnabled,trackBy:Ih.nonUpdatingNode.trackBy,compensateForLayoutChanges:Ih.labels.compensateForLayoutChanges}}}function bQ({layoutService:e}){return!(!e.meta.isContinuous||!Yp({layoutService:e}).miniChart)&&{type:"range",key:"range-brush-highlighter",layout:{dock:"@scrollbar"},settings:{scale:Gb.SCALE.REDUCED.MAJOR,brush:"selection",fill:"#6CB33F",opacity:.2}}}function xQ({context:e,discreteModel:t,continuousModel:n,layoutService:r,extremumModel:i,dockService:o,styleModel:a,tickModel:s,colorService:l,largeDataService:c,chartModel:u}){if(!Yp({layoutService:r}).miniChart)return!1;const{isDiscrete:d,isTwoDimensional:f,isStacked:h,isSnapshot:p,isArea:m,isConnect:g}=r.meta;if(d&&f&&!h)return!1;if(p&&h&&!r.getLayoutValue("reducedHyperCube"))return!1;const y=d?()=>t.query.getCanScroll():()=>n.getDimensionCardinality()>1,v=r.getLayoutValue("measureAxis.logarithmic",!1),b=r.getLayoutValue("separateStacking",!0),{fieldType:x}=l.getMain().getSettings(),{orientation:S}=o.meta.major,M=a.query.line.getStrokeDasharray(),w={key:Gb.COMPONENT.REDUCED_LINE,type:"line",data:{collection:Gb.COLLECTION.REDUCED},layout:{dock:"@scrollbar",minimumLayoutMode:FZ.REDUCED_LINE},show:y,settings:{coordinates:{minor:{scale:Gb.SCALE.REDUCED.MINOR,fn:e=>{if(h&&b){const t=e.datum.point.value<0?e.datum.start.value:e.datum.end.value;return e.scale(t)}return e.scale(e.datum.end.value)}},major:{scale:Gb.SCALE.REDUCED.MAJOR,ref:"major"},layerId:{ref:"line"}},orientation:S,layers:{curve:a.query.line.getCurve(),line:{stroke:aQ({context:e,layoutService:r,dockService:o,colorService:l,isReduced:!0}),strokeWidth:1,strokeDasharray:(...e)=>void 0===M(...e)?void 0:"1, 1",strokeLinejoin:"round",showMinor0:!1}},connect:!f&&g},rendererSettings:{progressive:c.meta.isMaxNumPointsEnabled?()=>c.meta.reducedLineProgressive:void 0},animations:{enabled:u.query.animationsEnabled,trackBy:Ih.lines.trackBy,compensateForLayoutChanges:Ih.lines.compensateForLayoutChanges}};return(v||h)&&(w.settings.coordinates.minor0={scale:Gb.SCALE.REDUCED.MINOR,fn:e=>{if(h){if(b){const t=e.datum.point.value<0?e.datum.end.value:e.datum.start.value;return e.scale(t)}return e.scale(e.datum.start.value)}const t=i.query.getExtrema().meta.includesZero?0:s.query.getMin();return e.scale(t)}}),m&&(w.settings.layers.area={fill:aQ({context:e,layoutService:r,dockService:o,colorService:l,isArea:!0,isReduced:!0}),opacity:"measure"===x||"expression"===x?.6:.3}),w}function SQ({context:e,viewState:t,viewCache:n,discreteModel:r,continuousModel:i,layoutService:o,dockService:a,themeService:s}){const{deviceType:l,rtl:c}=e,{isDiscrete:u,isTwoDimensional:d,isStacked:f,isSnapshot:h}=o.meta;return!(h&&f&&!o.getLayoutValue("reducedHyperCube"))&&function({layoutService:e,dockService:t,discrete:n,continuousDataModel:r,viewState:i,viewCache:o,themeService:a,rtl:s,scrollbarOverride:l,visualizeCache:c=!1,deviceType:u}){const d=Yp({layoutService:e,override:l});if(d.none)return!1;const{orientation:f}=t.meta.major,h={key:"scrollbar",type:"scrollbar",layout:{dock:"horizontal"===f?t.meta.minor.start:t.meta.minor.end,minimumLayoutMode:"XSMALL"},show:()=>e.meta.isContinuous?r.getDimensionCardinality()>1:n.query.getCanScroll(),settings:{orientation:f,rtl:s,isContinuous:e.meta.isContinuous,range:()=>Bp({layoutService:e,viewState:i,viewCache:o})}};d.bar&&(h.settings.style="slim",h.settings.size={area:"touch"===u?{max:16,min:16}:{max:8,min:8}},e.meta.isContinuous||(h.settings.size.thumb={min:4}));const p=a.getStyles();return p.color&&(h.style={standard:{thumb:{"border-color":p.color,opacity:.4},before:{background:p.color,opacity:.1},after:{background:p.color,opacity:.1}}}),e.meta.isDiscrete&&c&&(h.settings.injections=()=>[Hp({layoutService:e,discrete:n})]),h}({viewState:t,viewCache:n,discrete:r,continuousDataModel:i,layoutService:o,dockService:a,themeService:s,deviceType:l,rtl:c,scrollbarOverride:{predicate:({scrollbar:e})=>u&&d&&!f&&e.miniChart,value:Up.OPTIONS.BAR.value}})}function MQ({layoutService:e,colorService:t,fn:n}){return r=>{const{datum:i}=r,o=i.line.value,a=e.getHyperCubeValue(`qMeasureInfo.${o}.forecast`);if(a?.paletteColor?.color&&"none"!==a.paletteColor.color){const e=t.getMain().getPaletteColor;return e?e(a.paletteColor)??a.paletteColor.color:a.paletteColor.color}return n(r)}}function wQ({layoutService:e,colorService:t}){const n=t.getMain().getColor();return MQ({layoutService:e,colorService:t,fn:n})}function kQ({colorService:e}){const{mode:t,nil:n}=e.getMain().getSettings();return function(e){return"constant"===e||"measure"===e||"dimension"===e}(t)?e.getMain().getColor():()=>n}function EQ({layoutService:e,colorService:t}){return MQ({layoutService:e,colorService:t,fn:kQ({colorService:t})})}function CQ({context:e,discreteModel:t,continuousModel:n,colorService:r,dockService:i,extremumModel:o,layoutService:a,styleModel:s,tickModel:l,chartModel:c},{isReduced:u}){const{isConnect:d,isDiscrete:f}=a.meta,h=a.getLayoutValue("measureAxis.logarithmic",!1),p=f?()=>t.query.getCanScroll():()=>n.getDimensionCardinality()>1;let m,g;u?m={dock:"@scrollbar",minimumLayoutMode:FZ.REDUCED_LINE}:g={consume:[{context:"selection",data:["selectionDimension"],filter:e=>!(e=>void 0===e.strokeLinejoin)(e),style:{active:{opacity:.5},inactive:{opacity:.5}}}]};const y={key:u?Gb.COMPONENT.FORECAST_REDUCED_LINE:Gb.COMPONENT.FORECAST_LINE,type:"line",layout:m,data:{collection:u?Gb.COLLECTION.REDUCED_FORECAST:Gb.COLLECTION.FORECAST},show:p,settings:{coordinates:{minor:{scale:u?Gb.SCALE.REDUCED.MINOR:Gb.SCALE.MAIN.MINOR,ref:"end"},major:{scale:u?Gb.SCALE.REDUCED.MAJOR:Gb.SCALE.MAIN.MAJOR,ref:"major"},layerId:{ref:"line"}},orientation:i.meta.major.orientation,layers:{curve:s.query.forecast.getCurve(),line:{stroke:EQ({layoutService:a,colorService:r}),strokeWidth:u?1:s.query.forecast.getStrokeWidth(),strokeDasharray:s.query.forecast.getStrokeDasharray(),strokeLinejoin:"round",showMinor0:!1}},connect:d},brush:g,animations:{enabled:c.query.animationsEnabled,trackBy:Ih.nonUpdatingNode.trackBy,compensateForLayoutChanges:Ih.lines.compensateForLayoutChanges}};return h&&(y.settings.coordinates.minor0={scale:Gb.SCALE.MAIN.MINOR,fn:e=>{const t=o.query.getExtrema().meta.includesZero?0:l.query.getMin();return e.scale(t)}}),y}const NQ=e=>void 0===e.strokeLinejoin;function TQ({colorService:e,dockService:t,layoutService:n,styleModel:r,chartModel:i},{isReduced:o}){const{isConnect:a}=n.meta,{fieldType:s}=e.getMain().getSettings(),l=n.getLayoutValue("measureAxis.logarithmic",!1);let c,u;o?c={dock:"@scrollbar",minimumLayoutMode:FZ.REDUCED_LINE}:u={consume:[{context:"selection",data:["selectionDimension"],filter:e=>!NQ(e),style:{active:{opacity:.5},inactive:{opacity:.5}}},{context:"selection",data:["selectionDimension"],filter:e=>NQ(e),style:{active:{opacity:.15},inactive:{opacity:.15}}}]};const d={key:o?Gb.COMPONENT.FORECAST_REDUCED_CONFIDENCE:Gb.COMPONENT.FORECAST_CONFIDENCE,type:"line",layout:c,brush:u,data:{collection:o?Gb.COLLECTION.REDUCED_FORECAST:Gb.COLLECTION.FORECAST},settings:{coordinates:{minor0:{scale:o?Gb.SCALE.REDUCED.MINOR:Gb.SCALE.MAIN.MINOR,ref:"lower"},minor:{scale:o?Gb.SCALE.REDUCED.MINOR:Gb.SCALE.MAIN.MINOR,ref:"upper"},major:{scale:o?Gb.SCALE.REDUCED.MAJOR:Gb.SCALE.MAIN.MAJOR,ref:"major"},layerId:{ref:"line"}},orientation:t.meta.major.orientation,layers:{curve:r.query.forecast.getCurve(),area:{show:e=>{const t=e.datum.line.value,r=n.getLayoutValue(`qHyperCube.qMeasureInfo.${t}.forecast`);return ug(r)},fill:function({layoutService:e,colorService:t}){const n=kQ({colorService:t});return r=>{const{datum:i}=r,o=i.line.value,a=e.getHyperCubeValue(`qMeasureInfo.${o}.forecast`),s=a?.confidenceColor||a?.paletteColor;if(s?.color&&"none"!==s.color){const e=t.getMain().getPaletteColor;return e?e(s)??s.color:s.color}return n(r)}}({layoutService:n,colorService:e}),opacity:function({layoutService:e,fieldType:t}){return n=>{const{datum:r}=n,i=r.line.value,o=e.getHyperCubeValue(`qMeasureInfo.${i}.forecast`);return o?.confidenceColor?o?.confidenceColor.alpha??1:"measure"===t||"expression"===t?.6:.3}}({layoutService:n,fieldType:s})},line:{show:!1}},connect:a},animations:{enabled:i.query.animationsEnabled,trackBy:Ih.nonUpdatingNode.trackBy,compensateForLayoutChanges:Ih.lines.compensateForLayoutChanges}};return l&&(d.settings.coordinates.minor0.fn=e=>{let t=e.scale(e.datum.lower.value);return Number.isNaN(t)&&!Number.isNaN(+e.datum.lower.value)&&(Number.isNaN(e.scale(e.datum.upper.value))||(t=function(e){const t=e.range();return t[0]+100*(t[0]-t[1])}(e.scale))),t},d.settings.coordinates.minor.fn=e=>{let t=e.scale(e.datum.upper.value);return Number.isNaN(t)&&!Number.isNaN(+e.datum.upper.value)&&(Number.isNaN(e.scale(e.datum.lower.value))||(t=function(e){const t=e.range();return t[1]+100*(t[1]-t[0])}(e.scale))),t}),d}const DQ=3,qQ=20,OQ=e=>e.fromDynamicScript.value;function IQ({colorService:e,dockService:t,layoutService:n,styleModel:r,tickModel:i,chartModel:o}){const a=n.getLayoutValue("dataPoint.show",!1),s="horizontal"===t.meta.major.orientation,l="SPARK"===t.meta.chart.mode;return{key:Gb.COMPONENT.FORECAST_POINT,type:"point",data:{filter:OQ,collection:Gb.COLLECTION.FORECAST},preferredSize:()=>({edgeBleed:{top:s?LJ.POINT.SIZE.DEFAULT/2:0}}),settings:{[s?"y":"x"]:{scale:Gb.SCALE.MAIN.MINOR,ref:"end"},[s?"x":"y"]:{scale:Gb.SCALE.MAIN.MAJOR,ref:"major"},sizeLimits:{minPx:DQ,maxPx:qQ},size:e=>{const{value:t}=e.datum.line;return`${r.query.point.getSize(t)}px`},fill:wQ({layoutService:n,colorService:e}),opacity:e=>{const t=i.query.getMin(),n=i.query.getMax(),{datum:r}=e,{value:o}=r.end;return r.null.value||r.interpolated.value||o<t||o>n||l?0:a?1:0}},brush:{consume:[{context:"selection",data:[],style:{inactive:{opacity:e=>1===e.opacity?.5:0}}}]},animations:{enabled:o.query.animationsEnabled,trackBy:Ih.nonUpdatingNode.trackBy,compensateForLayoutChanges:Ih.points.compensateForLayoutChanges}}}function AQ(e){const t=vQ(e);return t&&(t.key=Gb.COMPONENT.FORECAST_POINT_LABEL,t.settings.configs=[{key:Gb.COMPONENT.FORECAST_POINT,labels:!0,lines:!0},{key:Gb.COMPONENT.POINT,labels:!1,lines:!0}]),t}function _Q(e){const t=dQ(e),n=t.find(e=>e.key===Gb.COMPONENT.OUT_OF_MIN_BOUNDS);n&&(n.key=Gb.COMPONENT.FORECAST_OUT_OF_MIN_BOUNDS,n.data.collection=Gb.COLLECTION.FORECAST,n.layout.dock=`@${Gb.COMPONENT.OUT_OF_MIN_BOUNDS}`);const r=t.find(e=>e.key===Gb.COMPONENT.OUT_OF_MAX_BOUNDS);return r&&(r.key=Gb.COMPONENT.FORECAST_OUT_OF_MAX_BOUNDS,r.data.collection=Gb.COLLECTION.FORECAST,r.layout.dock=`@${Gb.COMPONENT.OUT_OF_MAX_BOUNDS}`),[n||!1,r||!1]}function LQ(e){const{fieldModel:t}=e;if(!t.forecast.length)return[];const n=[CQ(e,{isReduced:!1}),IQ(e),TQ(e,{isReduced:!1}),AQ(e),..._Q(e)];return function({layoutService:e}){if(!Yp({layoutService:e}).miniChart)return!1;const{isDiscrete:t,isTwoDimensional:n,isStacked:r,isSnapshot:i}=e.meta;return!(t&&n&&!r||i&&r&&!e.getLayoutValue("reducedHyperCube"))}(e)&&(n.push(CQ(e,{isReduced:!0})),n.push(TQ(e,{isReduced:!0}))),n}function PQ({chart:e,chartModel:t,discreteModel:n,colorService:r,themeService:i,layoutService:o,dockService:a,context:s,resources:l,viewCache:c,queryParams:u,hostConfig:d}){const f=[],h=o.getLayoutValue("plugins");if(!Array.isArray(h)||0===h.length)return f;const p=h.filter(e=>"image"===e.type);!function(e){e.forEach(e=>{e&&!e.cId&&(e.cId=y.generateId)})}(h);const m=[{key:Gb.COMPONENT.POINT,lines:!0,labels:!1,labelKeys:[Gb.COMPONENT.POINT_LABEL]},{key:Gb.COMPONENT.FORECAST_POINT,lines:!0,labels:!1,labelKeys:[Gb.COMPONENT.FORECAST_POINT_LABEL]}];p.forEach((c,h)=>{const p=`image-${h}`;f.push($p({app:l.app,chart:e,chartModel:t,discreteModel:n,colorService:r,themeService:i,layoutService:o,dockService:a,flags:l.flags,rtl:s.rtl,majorScale:Gb.SCALE.MAIN.MAJOR,minorScale:Gb.SCALE.MAIN.MINOR,mainComponentKey:Gb.COMPONENT.LINE,key:p,image:c,queryParams:u,hostConfig:d}))});const g=function(e){const t=[];return e.forEach(e=>{e?.type!==t[t.length-1]?.[0]?.type||"point"!==e?.type&&("line"!==e?.type||e?.showPoints||t[t.length-1]?.[0]?.showPoints)?t.push([e]):t[t.length-1].push(e)}),t}(h);return g.forEach((l,c)=>{const u=`points-addon-${c}`,d=`lines-addon-${c}`;switch(l[0]?.type){case"point":f.push(Bh({chart:e,chartModel:t,discreteModel:n,colorService:r,themeService:i,layoutService:o,dockService:a,rtl:s.rtl,majorScale:Gb.SCALE.MAIN.MAJOR,minorScale:Gb.SCALE.MAIN.MINOR,mainComponentKey:Gb.COMPONENT.LINE,data:l,key:u})),m.push({key:u,lines:!1,labels:!0,fixed:!0,duplicates:!0});break;case"line":f.push(function({chart:e,chartModel:t,discreteModel:n,colorService:r,layoutService:i,dockService:o,rtl:a,majorScale:s,minorScale:l,mainComponentKey:c,data:u,key:d,scales:f={}}){if(!Array.isArray(u)||0===u.length)return!1;const h={resolveUIColor:r.getMain().getPaletteColor},p="horizontal"===o.meta.major.orientation,m=!(!p||!a),{canBeContinuous:g,isContinuous:y}=i.meta,v=i.getLayout(),b=Zo.getDimensionValuesInfo({layout:v,canBeContinuous:g,discreteModel:n,layoutService:i}),x=[];u.forEach((e,t)=>{const n=(e?.points??[]).map((n,r)=>({...n,lineId:t,style:0===r?e.style:void 0}));x.push(...n)});const S={},M=[];u.forEach(e=>M.push(...(e?.points??[]).map(e=>e.dimensionValue))),M.forEach(e=>{b[e]&&(S[e]?(S[e].innerValues=b[e].innerValues,S[e].minOrder=Math.min(S[e].minOrder,b[e].minOrder),S[e].maxOrder=Math.max(S[e].maxOrder,b[e].maxOrder),S[e].isMinOrderOk=S[e].isMinOrderOk||b[e].isMinOrderOk,S[e].isMaxOrderOk=S[e].isMaxOrderOk||b[e].isMaxOrderOk):S[e]={id:b[e].id,dataNode:b[e].dataNode,qText:b[e].qText,innerValues:b[e].innerValues,minOrder:b[e].minOrder,maxOrder:b[e].maxOrder,isMinOrderOk:b[e].isMinOrderOk,isMaxOrderOk:b[e].isMaxOrderOk},S[e].numInnerValues=(S[e].maxOrder||0)-(S[e].minOrder||0)+1)});const w=x[0];x.forEach(t=>{const n=Uh({point:t,dimensionValueInfo:S,layoutService:i}),r=t?.scale,o=w?.scale,a=i?.meta?.isButterfly,s=i?.meta?.isStacked,l=S[t.dimensionValue]?.dataNode;let c=n;const u=o&&r&&o!==r,d=a&&1===t.measureIndex,h=s&&Array.isArray(l);if(u)c=function(e,t,n){const r=t.min(),i=t.max(),o=n.min(),a=n.max();return i===r?o:o+(e-r)/(i-r)*(a-o)}(n,f[r]||e.scale(r),f[o]||e.scale(o));else if(d)c=-n;else if(h&&void 0!==t.measureIndex&&Array.isArray(l)){const e=l.slice(0,t.measureIndex+2),n=l[t.measureIndex+1]?.qNum;if("number"==typeof n&&0!==n){const t=Math.sign(n);c=e.reduce((e,n)=>{const r=n.qNum;return"number"==typeof r&&Math.sign(r)===t?e+r:e},0)}}t.validMeasureValue=c});const k={scale:s,fn:({datum:t})=>{const n=e.scale(s),r=t.value.dimensionValue;return y?n("string"==typeof r?""===r?void 0:+r:r):void 0!==S[r]?Zo.getScaledPosition({scale:n,value:S[r].id,valueInfo:S[r],size:e.component(c)?.rect[p?"width":"height"],align:"center",invert:m,layoutService:i,isContinuous:y}):void 0}},E={scale:l,fn:({datum:e,scale:t})=>t(e.value.validMeasureValue)};return{key:d,type:"line",data:x,settings:{connect:!0,coordinates:{major:p?k:E,minor:p?E:k,layerId:({datum:e})=>e.value.lineId},layers:{curve:({datum:e})=>e.value.style?.lineCurve??"monotone",line:{strokeWidth:({datum:e})=>e.value.style?.lineThickness??3,stroke:({datum:e})=>Vh({colorModel:h,color:e.value.style?.lineColor?.color?e.value.style?.lineColor:{index:-1,color:"#000"}}),strokeDasharray:({datum:e})=>e.value.style?.lineType}}},animations:{enabled:t.query.animationsEnabled,trackBy:Ih.nonUpdatingNode.trackBy,compensateForLayoutChanges:Ih.lines.compensateForLayoutChanges}}}({chart:e,chartModel:t,discreteModel:n,colorService:r,layoutService:o,dockService:a,rtl:s.rtl,majorScale:Gb.SCALE.MAIN.MAJOR,minorScale:Gb.SCALE.MAIN.MINOR,mainComponentKey:Gb.COMPONENT.LINE,data:l,key:d})),l.forEach((l,c)=>{if(l?.showPoints&&l?.points){const u=`points-${c}-for-${d}`;f.push(Bh({chart:e,chartModel:t,discreteModel:n,colorService:r,themeService:i,layoutService:o,dockService:a,rtl:s.rtl,majorScale:Gb.SCALE.MAIN.MAJOR,minorScale:Gb.SCALE.MAIN.MINOR,mainComponentKey:Gb.COMPONENT.LINE,data:l.points,key:u})),m.push({key:u,lines:!0,labels:!0,duplicates:!0})}else l?.points&&m.push({key:d,lines:!0,labels:!1,duplicates:!0,points:l.points})})}}),f.push(function({layoutService:e,dockService:t,chartModel:n,themeService:r,configs:i,cache:o}){const a=e.getLayoutValue("plugins"),{rtl:s}=t.config,{orientation:l}=t.meta.major,{isOneDimensional:c,isStacked:u}=e.meta,d=r.getStyles();return{type:"point-label",key:"plugins-point-labels",renderer:jh(),settings:{all:!0,cache:o,configs:i,label:e=>e.value?.label?.value?e.value?.label?.value:u?e.point?.label:e.end?.label,lineId:({data:e})=>{for(let t=0;t<a.length;t++){const n=a[t];switch(n.type){case"point":if(n.cId===e.value?.cId)return n.cId;break;case"line":if(n.points.some(t=>t.cId===e.value?.cId))return n.cId}}return e.value?.cId||e.line?.value},majorValue:e=>e.value?.dimensionValue?e.value.dimensionValue:c?e.value:e.major?.value,orientation:l,pointValue:e=>e.value?.validMeasureValue,rtl:s},style:d.plugins.label,animations:{enabled:n.query.animationsEnabled,trackBy:Ih.nonUpdatingNode.trackBy,compensateForLayoutChanges:Ih.labels.compensateForLayoutChanges}}}({layoutService:o,dockService:a,chartModel:t,themeService:i,configs:m,cache:c})),f}function RQ({alternativeService:e,actions:t,chart:n,chartModel:r,colorService:i,context:o,continuousModel:a,disclaimerService:s,discreteModel:l,dockService:c,extremumModel:u,fieldModel:d,hostConfig:f,layoutService:h,legend:p,refLineModel:m,resources:g,selectables:y,selectionService:v,styleModel:b,themeService:x,tickModel:S,tooltipService:M,trendLineModel:w,viewCache:k,viewState:E,largeDataService:C,selections:N,queryParams:T}){const D=function({context:e,resources:t,disclaimerService:n,themeService:r}){const i=n.getDisclaimer();if(!i)return!1;const{rtl:o}=e,{translator:a}=t,{fontFamily:s}=r.getStyles();return{key:"disclaimer",type:"disclaimer",renderer:"react-qcm",layout:{dock:i.alignment},settings:{isRTL:o,label:a.get(`Object.Disclaimer.${i.key}`)},style:{fontFamily:s}}}({context:o,resources:g,disclaimerService:s,themeService:x});if(s.getHasSuppressingDisclaimer())return[D];const q=function({context:e,layoutService:t,dockService:n,themeService:r,chartModel:i,styleModel:o}){return{majors:[...VZ({context:e,layoutService:t,dockService:n,themeService:r,chartModel:i,styleModel:o})],minor:zZ({layoutService:t,dockService:n,themeService:r,chartModel:i,styleModel:o})}}({context:o,layoutService:h,dockService:c,themeService:x,styleModel:b,chartModel:r}),O=[...eQ({layoutService:h,extremumModel:u,dockService:c,themeService:x,tickModel:S,chartModel:r}),...dQ({context:o,layoutService:h,extremumModel:u,dockService:c,themeService:x,tickModel:S,chartModel:r}),...LQ({discreteModel:l,continuousModel:a,context:o,fieldModel:d,chartModel:r,layoutService:h,extremumModel:u,dockService:c,styleModel:b,tickModel:S,colorService:i,themeService:x}),lQ({context:o,layoutService:h,extremumModel:u,dockService:c,styleModel:b,tickModel:S,colorService:i,largeDataService:C,chartModel:r}),YZ({context:o,selectionService:v,layoutService:h,dockService:c,colorService:i,largeDataService:C}),tQ({chart:n,layoutService:h,extremumModel:u,dockService:c,chartModel:r}),q.minor,yQ({selectionService:v,layoutService:h,dockService:c,styleModel:b,tickModel:S,colorService:i,largeDataService:C,chartModel:r}),...q.majors,...fQ({context:o,refLineModel:m,layoutService:h,dockService:c,themeService:x,colorService:i,chart:n,chartModel:r}),GZ({dockService:c}),...UZ({layoutService:h,dockService:c}),...WZ({actions:t,alternativeService:e,context:o,dockService:c,layoutService:h,resources:g,selections:N,styleModel:b,viewCache:k}),zi({viewState:E,viewCache:k,layoutService:h,dockService:c,rtl:o.rtl}),bQ({layoutService:h}),vQ({layoutService:h,dockService:c,chartModel:r,largeDataService:C,styleModel:b,viewCache:k}),xQ({context:o,discreteModel:l,continuousModel:a,layoutService:h,extremumModel:u,dockService:c,styleModel:b,tickModel:S,colorService:i,largeDataService:C,chartModel:r}),SQ({context:o,viewState:E,viewCache:k,discreteModel:l,continuousModel:a,layoutService:h,dockService:c,themeService:x}),...M.getComponents(),...Ug({majorScale:Gb.SCALE.MAIN.MAJOR,minorScale:Gb.SCALE.MAIN.MINOR,tooltipOverlay:Gb.COMPONENT.TREND_LINES_TOOLTIP_OVERLAY},{layoutService:h,trendLineModel:w,dockService:c,animationsEnabled:r.query.animationsEnabled}),Yg({tooltip:Gb.COMPONENT.TREND_LINES_TOOLTIP,formatter:Gb.FORMATTER.MINOR},{trendLineModel:w,translator:g.translator},o),...PQ({chart:n,chartModel:r,discreteModel:l,colorService:i,themeService:x,layoutService:h,dockService:c,context:o,resources:g,viewCache:k,queryParams:T,hostConfig:f}),D,...p.components,...y.components].filter(Boolean);return function(e){if(e&&0!==e.length)for(let t=0;t<e.length;t++)e[t].layout=e[t].layout||{},e[t].layout.displayOrder=t}(O),O}function FQ({scales:e,fieldModel:t}){const n={[Gb.FORMATTER.MINOR]:{data:{fields:t.main.minors}}},r=e[Gb.SCALE.MAIN.COLOR],i=r&&r.data&&r.data.field;return i&&(n[Gb.FORMATTER.COLOR]={data:{field:i}}),n}const zQ="continuousPan";const jQ="continuousPinchZoom";function $Q({chart:e,actions:t,viewState:n,viewCache:r,layoutService:i,rtl:o}){const{isContinuous:a}=i.meta,s=a?Yb.event.onZoom({chart:e,viewState:n,viewCache:r},{rtl:o,threshold:50,targetKey:Gb.COMPONENT.LINE}):void 0;return{type:"native",events:{wheel(n){const r={x:n.clientX,y:n.clientY},i=e.componentsFromPoint(r);if(a&&t.scroll.enabled()){const[e]=i.filter(e=>e.key===Gb.COMPONENT.LINE);e&&(s(r,Math.sign(-n.deltaY)),n.preventDefault())}if(t.interact.enabled()){const[e]=i.filter(e=>e.key===Gb.COMPONENT.LEGEND_CATEGORICAL);if(e){const t=Math.abs(n.deltaX>Math.abs(n.deltaY))?n.deltaX:n.deltaY;e.emit(t>=0?"next":"prev"),n.preventDefault()}}}}}}function VQ({actions:e,chart:t,discreteModel:n,dockService:r,gestures:i=[],layoutService:o,resources:a,rtl:s,tooltipService:l,trendLineModel:c,viewCache:u,viewState:d}){const{isDiscrete:f,isContinuous:h}=o.meta,p=l.getInteractions(),m=function({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l}){return{gestures:[...rm({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l})],native:im({componentKey:e,chart:t,actions:n,layoutService:o})}}({componentKey:"scrollbar",chart:t,actions:e,viewState:d,viewCache:u,discrete:n,layoutService:o,dockService:r,rtl:s}),g={type:"hammer",enable:!0,gestures:[...[...i].sort((e,t)=>(t.prio||0)-(e.prio||0)),...m.gestures,...p.gestures]},y=[$Q({chart:t,viewState:d,viewCache:u,actions:e,layoutService:o,rtl:s}),m.native,p.native];return f&&(g.gestures.push(...n.interactions.gestures),y.push(n.interactions.native)),h&&g.gestures.push(function({chart:e,actions:t,viewState:n,viewCache:r}){return{type:"Pan",key:"continuous:pan",options:{event:zQ,pointers:1,threshold:10,enable(n,r){return this.started===zQ||!r||!!t.scroll.enabled()&&e.componentsFromPoint({x:r.center.x,y:r.center.y}).some(e=>e.key===Gb.COMPONENT.LINE)}},events:{[`${zQ}start`](t){t.preventDefault(),this.started=zQ;const{min:r,max:i}=n.get("zoom");this[zQ]={min:r,max:i,size:e.component(Gb.COMPONENT.LINE).rect.computedInner.width,span:i-r}},[`${zQ}move`](e){e.preventDefault();const{span:t,min:i,max:o,size:a}=this[zQ],s=-e.deltaX/a;n.set("zoom",{min:Math.min(i+s*t,r.get("continuousMax")-t),max:Math.max(o+s*t,r.get("continuousMin")+t)})},[`${zQ}end`](e){e.preventDefault(),this.started=!1},[`${zQ}cancel`](e){e.preventDefault(),this.started=!1}}}}({chart:t,actions:e,viewState:d,viewCache:u}),function({chart:e,actions:t,viewState:n,viewCache:r,rtl:i}){const o={last:0},a=Yb.event.onZoom({viewCache:r,viewState:n,chart:e},{threshold:100,rtl:i,targetKey:Gb.COMPONENT.LINE});return{type:"Pinch",key:"continuous:pinch-zoom",options:{event:jQ,pointers:2,threshold:0,enable:(n,r)=>!r||!!t.scroll.enabled()&&e.componentsFromPoint({x:r.center.x,y:r.center.y}).some(e=>e.key===Gb.COMPONENT.LINE)},events:{[`${jQ}start`](e){o.last=e.scale,e.preventDefault()},[`${jQ}move`](e){const t=e.scale-o.last;Math.abs(t)>.01&&a(e.center,t>0?1:-1),o.last=e.scale,e.preventDefault()}}}}({chart:t,actions:e,viewState:d,viewCache:u,rtl:s})),[g,...y]}function UQ({context:e,fieldModel:t,dockService:n,tickModel:r}){const{rtl:i}=e,{minors:o}=t.main,{orientation:a}=n.meta.major;return{type:"logarithmic",data:{source:"qHyperCube",fields:o},invert:"horizontal"===a||i,ticks:{values:r.query.getValues},min:r.query.getMin,max:r.query.getMax}}function HQ({context:e,fieldModel:t,dockService:n,tickModel:r}){const{rtl:i}=e,{minors:o}=t.main,{orientation:a}=n.meta.major;return{data:{source:"qHyperCube",fields:o},invert:"horizontal"===a||i,ticks:{values:r.query.getValues},minorTicks:{count:1},min:r.query.getMin,max:r.query.getMax}}function BQ({context:e,layoutService:t,fieldModel:n,extremumModel:r,dockService:i,tickModel:o}){const a=t.getLayoutValue("measureAxis.logarithmic",!1),s=r.query.getExtrema();return(a&&!s.meta.includesZero?UQ:HQ)({context:e,fieldModel:n,dockService:i,tickModel:o})}function WQ({viewState:e,viewCache:t,layoutService:n}){return t.set("qTimeAxisCache",[]),{get:(e,n=0)=>{const r=t.get("qTimeAxisCache");return r[n]&&r[n][0]===e?r[n][1]:void 0},set:(e,n,r=0)=>{t.get("qTimeAxisCache")[r]=[e,n]},key:({distance:r})=>{const{min:i,max:o}=e.get("zoom"),a=(o-i)/(t.get("continuousMax")-t.get("continuousMin")),s=n.getHyperCubeValue("qAxisData.qAxis",[]).map(e=>e.qName);return[r,Number.parseFloat(a).toFixed(12),...s].toString()}}}function YQ({context:e,picasso:t,viewState:n,viewCache:r,discreteModel:i,layoutService:o,fieldModel:a,dockService:s,themeService:c}){const{isDiscrete:u,isTime:d}=o.meta;return u?function({context:e,discreteModel:t,fieldModel:n,dockService:r}){const{rtl:i}=e,{outer:o,inner:a}=n.main,{orientation:s}=r.meta.major;return{[Gb.SCALE.MAIN.MAJOR]:{data:{extract:{field:o,props:{selectionDimension:{field:o},selectionInnerDimension:{field:a}}}},invert:"horizontal"===s&&i,range:t.query.getScaleRange}}}({context:e,discreteModel:i,fieldModel:a,dockService:s}):d?function({context:e,picasso:t,viewState:n,viewCache:r,layoutService:i,fieldModel:o,themeService:a}){const{localeInfo:s,rtl:c}=e,{measureText:u}=t.renderer("svg")(),{outerNumeric:d}=o.main,f=a.getStyles(),h={type:"time",data:{field:d},qAxis:()=>i.getHyperCubeValue("qAxisData.qAxis",[]),field:d,min:()=>n.get("zoom").min,max:()=>n.get("zoom").max,invert:!!c,formatter:{fn:t.formatter("q-time"),localeInfo:s,qNumFormat:i.getHyperCubeValue("qDimensionInfo.0",{}).qNumFormat,measureText:e=>u({text:e,fontFamily:f.axis.label.name.fontFamily,fontSize:f.axis.label.name.fontSize})},ticks:{generator:{type:"d3",initialMin:n.get("zoom").min},anchor:"start",clamp:!0},cache:WQ({viewState:n,viewCache:r,layoutService:i})};return{[Gb.SCALE.MAIN.MAJOR]:l(!0,{},h,{ticks:{level:"outer"}}),[Gb.SCALE.MAIN.MAJOR_INNER]:l(!0,{},h,{ticks:{level:"inner"}})}}({context:e,picasso:t,viewState:n,viewCache:r,layoutService:o,fieldModel:a,themeService:c}):function({context:e,viewState:t,fieldModel:n,dockService:r}){const{rtl:i}=e,{orientation:o}=r.meta.major;return{[Gb.SCALE.MAIN.MAJOR]:{type:"linear",invert:"horizontal"===o&&i,data:{extract:{field:n.main.outerNumeric}},ticks:{forceBounds:!0,count:t.get("zoom").min===t.get("zoom").max?1:void 0},minorTicks:{count:1},min:()=>t.get("zoom").min,max:()=>t.get("zoom").max}}}({context:e,viewState:n,fieldModel:a,dockService:s})}function GQ({viewCache:e,layoutService:t,fieldModel:n,major:r}){return t.meta.isDiscrete?function({layoutService:e,fieldModel:t,major:n}){const{isTwoDimensional:r,isStacked:i}=e.meta,{outer:o,inner:a}=t.reduced,{invert:s}=n;return{data:{extract:{source:Gb.DATA.REDUCED,field:r&&i?a:o}},invert:s}}({layoutService:t,fieldModel:n,major:r}):function({viewCache:e,major:t}){return l(!0,{},t,{min:()=>e.get("continuousMin"),max:()=>e.get("continuousMax")})}({viewCache:e,major:r})}function KQ({viewCache:e,layoutService:t,fieldModel:n,minor:r,major:i}){return{[Gb.SCALE.REDUCED.MINOR]:{...r,data:void 0},[Gb.SCALE.REDUCED.MAJOR]:GQ({viewCache:e,layoutService:t,fieldModel:n,major:i})}}function XQ({context:e,layoutService:t,colorService:n,legend:r}){const i=[n.getMain().getScales()];t.meta.isContinuous&&i.push(n.getReduced().getScales());const o=Object.assign({},...i),a=o[`${Gb.SCALE.MAIN.COLOR}Range`],[s]=r.components,l=s&&s.layout.dock;return a&&("right"===l||"left"===l||e.rtl)&&(a.invert=!0),o}function JQ({context:e,picasso:t,viewState:n,viewCache:r,discreteModel:i,layoutService:o,fieldModel:a,extremumModel:s,dockService:l,themeService:c,tickModel:u,colorService:d,legend:f}){const h=function({context:e,picasso:t,viewState:n,viewCache:r,discreteModel:i,layoutService:o,fieldModel:a,extremumModel:s,dockService:l,themeService:c,tickModel:u}){return{[Gb.SCALE.MAIN.MINOR]:BQ({context:e,layoutService:o,fieldModel:a,extremumModel:s,dockService:l,tickModel:u}),...YQ({context:e,picasso:t,viewState:n,viewCache:r,discreteModel:i,layoutService:o,fieldModel:a,dockService:l,themeService:c})}}({context:e,picasso:t,viewState:n,viewCache:r,discreteModel:i,layoutService:o,fieldModel:a,extremumModel:s,dockService:l,themeService:c,tickModel:u});return{...h,...KQ({viewCache:r,layoutService:o,fieldModel:a,minor:h[Gb.SCALE.MAIN.MINOR],major:h[Gb.SCALE.MAIN.MAJOR]}),...XQ({context:e,layoutService:o,colorService:d,legend:f})}}const ZQ="lasso",QQ=({key:e,componentTargetKey:t,requireFailure:n,recognizeWith:r},i)=>({key:`event:${e}`,type:"Pan",requireFailure:n,recognizeWith:r,options:{event:ZQ,enable(e,n){if(this.started===ZQ||!n)return!0;if(!i.actions.select.enabled()||!i.actions.lasso.enabled()||!i.actions.lasso.active())return!1;return this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).filter(e=>e.key===t).length>0}},events:{lassostart(t){t.preventDefault(),this.started!==ZQ&&(i.actions.select.emit("start",ZQ),this.chart.component(e).emit("lassoStart",t),this.started=ZQ)},lassomove(t){t.preventDefault(),this.chart.component(e).emit("lassoMove",t),"function"==typeof i.updateOnMove&&i.updateOnMove(this.chart)},lassoend(t){t.preventDefault(),this.started=!1,this.chart.component(e).emit("lassoEnd",t),i.actions.select.emit("end",ZQ),"function"==typeof i.updateOnEnd&&i.updateOnEnd()}}});const e0=({targets:e,requireFailure:t,recognizeWith:n,components:r,eventName:i="tap"},o)=>{let a;const s=o.customTooltipModel?o.customTooltipModel.utils:void 0,l=s?o.debouncer(s.displayTooltip,s.DEBOUNCE_THRESHOLD):void 0;return{key:"event:tap",type:"Tap",requireFailure:t,recognizeWith:n,options:{event:i,interval:10,pointers:1,enable(t,n){return!n||!(!o.actions.select.enabled()&&!o.actions.tooltip.enabled())&&(a=this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).filter(t=>-1!==e.indexOf(t.key)),a.length>0)}},events:{[i](t){t.preventDefault();const n=function(e,t){const n=t.element.getBoundingClientRect();let r,i;return e.center?(({x:r}=e.center),({y:i}=e.center)):(r=e.clientX,i=e.clientY),{x:r-n.left,y:i-n.top}}(t,this.chart),c=o.hitRadius?o.hitRadius(a):0,u=c>0?{cx:n.x,cy:n.y,r:c}:n,d=o.shapesAt?o.shapesAt(u):this.chart.shapesAt(u,{components:e.map(e=>({key:e,propagation:"stop"})),propagation:"stop"}),f=this.chart.component("tooltip"),h="mouse"!==t.pointerType&&f&&f.show;if(!o.isLocked(a)&&!o.tooltipOnly&&o.actions.select.enabled()){const e=this.chart.componentsFromPoint({x:t.center.x,y:t.center.y}),n=e.some(e=>"legend-cat"===e.type);if(!d.length&&n||(this.chart.brushSelectionIncludeMax=!1,o.actions.select.brushSelectionIncludeMax=!1,o.actions.select.emit("start",i,e)),d.length&&r){this.chart.brushSelectionIncludeMax=!1,o.actions.select.brushSelectionIncludeMax=!1;const e="function"==typeof r?r(t,d):r;this.chart.brushFromShapes(d,{components:e}),o.actions.select.emit("end",i),(({largeDataService:e,chart:t})=>{(e?.meta||{}).isLargeNumPoints&&t.brush("lazySelection")._state(t.brush("selection")._state())})({largeDataService:o.largeDataService,chart:this.chart})}}if(f&&o.actions.tooltip.enabled())if(d.length){const{customTooltipModel:e}=o;if(e?.useCustomTooltip&&s.checkIfPromisesExist({customTooltipModel:e})){const n=s.getNodes(t,this.chart);l(t,f,{nodes:n,opts:o,customTooltipModel:e})}else f.emit("show",t,{nodes:d})}else h&&f.emit("hide")}}}};const t0=({key:e,requireFailure:t,recognizeWith:n,eventName:r="tap"},i)=>({prio:1,key:`event:${e}-tap`,type:"Tap",requireFailure:t,recognizeWith:n,options:{event:`${r}-${e}-tap`,interval:10,pointers:1,enable:(t,n)=>!!n&&(!!i.actions.select.enabled()&&(!(!n.target||"INPUT"!==n.target.nodeName)||!(!n.target||!n.target.hasAttribute("data-other-value"))&&(n.target.getAttribute("data-key")||"").split("-bubble")[0]===e))},events:{[`${r}-${e}-tap`](t){(t.target.getAttribute("data-key")||"").split("-bubble")[0]&&(t.preventDefault(),this.chart.component(e).emit("bubbleStart",t))}}});const n0=({eventName:e,key:t,fillTargets:n=[],requireFailure:r,recognizeWith:i},o,a)=>({key:`event:${t}`,type:"Pan",requireFailure:r,recognizeWith:i,options:{event:e,enable(r,i){if(this.started===e||!i)return!0;if(!o.actions.select.enabled())return!1;const a=this.chart.componentsFromPoint({x:i.center.x,y:i.center.y}).filter(e=>-1!==n.indexOf(e.key)),s=0===a.length&&function(e,t){const{target:n}=e.srcEvent;return!(!n||0!==(n.getAttribute("data-key")||"").indexOf(`${t}-`))}(i,t);return s?(this.started=e,!0):a.length>0}},events:{[`${e}start`](n){void 0===this.chart.brushSelectionIncludeMax&&(this.chart.brushSelectionIncludeMax=!0,o.actions.select.brushSelectionIncludeMax=!0),n.preventDefault(),o.actions.select.emit("start",e),this.chart.component(t).emit(`${a}Start`,n),this.started=e},[`${e}move`](e){e.preventDefault(),this.chart.component(t).emit(`${a}Move`,e),"function"==typeof o.updateOnMove&&o.updateOnMove(this.chart)},[`${e}end`](n){void 0===this.chart.brushSelectionIncludeMax&&(this.chart.brushSelectionIncludeMax=!0,o.actions.select.brushSelectionIncludeMax=!0),n.preventDefault(),this.chart.component(t).emit(`${a}End`,n),o.actions.select.emit("end",e),this.started=!1,"function"==typeof o.updateOnEnd&&o.updateOnEnd()}}});function r0(e,t){const n=function(e){const{key:t,targets:n,fillTargets:r,targetSelector:i,targetFillSelector:o,dock:a,scale:s,bubblesPlacement:l="inside",observeBrush:c=!1,multiple:u=!1,toLabel:d,onEdited:f}=e;return{key:t,type:"brush-range",layout:{dock:n.map(e=>`@${e}`).join(",")},on:f?{bubbleEnd(){f()}}:{},settings:{brush:c?{context:"selection",observe:!0}:"selection",scale:s,multiple:u,direction:"left"===a||"right"===a?"vertical":"horizontal",bubbles:{align:"left"===a||"top"===a?"end":"start",placement:l,label:d},target:{components:r,selector:i,fillSelector:o,fill:"rgba(82,204,82,0.2)"}}}}(e),r=n0(e,t,"range");return{interactions:[e.onEdited?t0(e,t):null,r].filter(Boolean),components:[n]}}const i0=({largeDataService:e,chart:t})=>{(e?.meta||{}).isLargeNumPoints&&t.brush("lazySelection")._state(t.brush("selection")._state())},o0=({largeDataService:e,chart:t})=>{(e?.meta||{}).isLargeNumPoints&&!e.isLargeNumVisiblePoints()&&t.brush("lazySelection")._state(t.brush("selection")._state())};function a0({chart:e,actions:t,selectionService:n,layoutService:r,colorService:i,largeDataService:o,resources:a}){const{isTwoDimensional:s}=r.meta,l=n.getIsSingleSelect(),c=[Gb.COMPONENT.MAJOR_AXIS,Gb.COMPONENT.POINT,Gb.COMPONENT.MAJOR_AXIS_OVERLAY_CONTINUOUS,Gb.COMPONENT.MAJOR_AXIS_OVERLAY_TIME_INNER,Gb.COMPONENT.MAJOR_AXIS_OVERLAY_TIME_OUTER,Gb.COMPONENT.LEGEND_CATEGORICAL,Gb.COMPONENT.FORECAST_POINT],{flags:u}=a,d=(t,r)=>{const[i]=r,{key:o}=i,a={key:o,action:t.srcEvent.ctrlKey||l?"set":"toggle",contexts:["selection"]};if(o===Gb.COMPONENT.LEGEND_CATEGORICAL)return[{key:o,action:t.srcEvent.ctrlKey?"set":"toggle",contexts:["selection"]}];const c=o===Gb.COMPONENT.POINT;if(c&&(i.data.null.value||i.data.interpolated.value||.01===i.attrs?.opacity))return!1;const u=n.custom.getIsInnerDimensionLocked();if(-1!==[Gb.COMPONENT.MAJOR_AXIS_OVERLAY_CONTINUOUS,Gb.COMPONENT.MAJOR_AXIS_OVERLAY_TIME_INNER,Gb.COMPONENT.MAJOR_AXIS_OVERLAY_TIME_OUTER].indexOf(o)||(a.data=[o===Gb.COMPONENT.POINT&&u?"selectionOuterDimension":"selectionDimension"]),!s||!c)return[a];const{items:d}=e.component(o).data,{value:f}=d[0].line,h=d.every(e=>e.line.value===f);return h&&(a.data=["selectionOuterDimension"]),[a]},f=function({chart:e,selectionService:t,layoutService:n,colorService:r}){const{isOneDimensional:i}=n.meta;return n=>{const{key:o}=n[0],a=t.custom.getIsOuterDimensionLocked();if(o===Gb.COMPONENT.LEGEND_CATEGORICAL)return r.getMain().isSelectionLocked({isMeasureSelectionLocked:a});if(i)return a;const s=t.custom.getIsInnerDimensionLocked();if(a&&s)return!0;if(a){if(o===Gb.COMPONENT.MAJOR_AXIS)return!0;if(o===Gb.COMPONENT.POINT){const{items:t}=e.component(Gb.COMPONENT.LINE).data,{value:n}=t[0].line;return t.every(e=>e.line.value===n)}}return!1}}({chart:e,selectionService:n,layoutService:r,colorService:i}),h=e=>e.some(e=>e.key===Gb.COMPONENT.POINT)?3:0;return u.isEnabled("VIZ_398_CHART_INTERACTION_REFACTOR")?function(e){var t=function(){var e,t,n,r,i,o,a,s,l,c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{actions:null!==(e=c.actions)&&void 0!==e?e:tl.ACTIONS,components:null!==(t=c.components)&&void 0!==t?t:tl.COMPONENTS,events:{onSelectStart:null!==(n=null===(r=c.events)||void 0===r?void 0:r.onSelectStart)&&void 0!==n?n:tl.EVENTS,onSelectEnd:null!==(i=null===(o=c.events)||void 0===o?void 0:o.onSelectEnd)&&void 0!==i?i:tl.EVENTS},hitRadius:null!==(a=c.hitRadius)&&void 0!==a?a:tl.HIT_RADIUS,isLocked:null!==(s=c.isLocked)&&void 0!==s?s:tl.IS_LOCKED,shapesAt:c.shapesAt,targets:null!==(l=c.targets)&&void 0!==l?l:tl.TARGETS}}(e);return{interactions:[rl(t)],components:[]}}({actions:t,components:d,events:{onSelectEnd:()=>{i0({chart:e,largeDataService:o})}},hitRadius:h,isLocked:f,targets:c}):function(e,t){if(!e.targets)throw new Error("Missing 'targets' property");return{interactions:[e0(e,t)],components:[]}}({targets:c,components:d},{debouncer:Cu,flags:u,actions:t,isLocked:f,hitRadius:h,shapesAt:t=>{const n=e.shapesAt(t,{components:c.map(e=>({key:e}))}).filter(e=>!(e.data.null&&e.data.null.value&&e.data.interpolated&&e.data.interpolated.value));return n.length?[n[0]]:[]},largeDataService:o})}function s0({actions:e,selectionService:t,layoutService:n,dockService:r,resources:i}){const{isDiscrete:o,isTwoDimensional:a}=n.meta;if(!o||t.custom.getIsOuterDimensionLocked())return!1;const s=[{key:Gb.COMPONENT.GHOST_POINT,contexts:["selection"],action:"set",data:[a?"selectionOuterDimension":"selectionDimension"]}],{flags:l}=i;return l.isEnabled("VIZ_398_CHART_INTERACTION_REFACTOR")?function(e){var t=function(){var e,t,n,r,i,o,a,s,l,c,u,d,f,h,p=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{actions:null!==(e=p.actions)&&void 0!==e?e:Ws.ACTIONS,componentKey:null!==(t=p.componentKey)&&void 0!==t?t:Ws.COMPONENT_KEY,components:null!==(n=p.components)&&void 0!==n?n:Ws.COMPONENTS,dock:null!==(r=p.dock)&&void 0!==r?r:Ws.DOCK,enable:null!==(i=p.enable)&&void 0!==i?i:Ws.ENABLE,eventKey:null!==(o=p.eventKey)&&void 0!==o?o:Ws.EVENT_KEY,events:{onRangeStart:null!==(a=null===(s=p.events)||void 0===s?void 0:s.onRangeStart)&&void 0!==a?a:Ws.EVENTS,onRangeMove:null!==(l=null===(c=p.events)||void 0===c?void 0:c.onRangeMove)&&void 0!==l?l:Ws.EVENTS,onRangeEnd:null!==(u=null===(d=p.events)||void 0===d?void 0:d.onRangeEnd)&&void 0!==u?u:Ws.EVENTS},fillTargets:null!==(f=p.fillTargets)&&void 0!==f?f:Ws.FILL_TARGETS,targets:null!==(h=p.targets)&&void 0!==h?h:Ws.TARGETS}}(e),n=function(e){return Gs({config:e,type:"area"})}(t),r=function(e){var t=e.componentKey,n=e.components,r=e.dock,i=e.fillTargets;return{key:t,type:"brush-area-dir",layout:{dock:e.targets.map(function(e){return"@".concat(e)}).join(",")},settings:{multiple:!0,brush:{components:n},direction:"left"===r||"right"===r?"vertical":"horizontal",bubbles:{align:"left"===r||"top"===r?"end":"start",placement:"inside"},target:{components:i,fill:"rgba(82,204,82,0.2)"}}}}(t);return{interactions:[n],components:[r]}}({actions:e,componentKey:"discrete-range-brush",components:s,dock:r.meta.major.dock,eventKey:"discreteRange",fillTargets:[Gb.COMPONENT.MAJOR_AXIS],targets:[Gb.COMPONENT.MAJOR_AXIS,Gb.COMPONENT.POINT]}):function(e,t){const n=function(e){const{key:t,targets:n,components:r,fillTargets:i,dock:o}=e;return{key:t,type:"brush-area-dir",layout:{dock:n.map(e=>`@${e}`).join(",")},settings:{multiple:!0,brush:{components:r},direction:"left"===o||"right"===o?"vertical":"horizontal",bubbles:{align:"left"===o||"top"===o?"end":"start",placement:"inside"},target:{components:i,fill:"rgba(82,204,82,0.2)"}}}}(e);return{interactions:[n0(e,t,"area")],components:[n]}}({eventName:"discreteRange",key:"discrete-range-brush",components:s,targets:[Gb.COMPONENT.MAJOR_AXIS,Gb.COMPONENT.POINT],fillTargets:[Gb.COMPONENT.MAJOR_AXIS],dock:r.meta.major.dock},{actions:e})}const l0={components:[],interactions:[]};function c0({chart:e,actions:t,selectionService:n,layoutService:r,largeDataService:i,dockService:o,scales:a,legend:s,isUnsupportedFeature:l,resources:c}){const u=function({actions:e,selectionService:t,layoutService:n,dockService:r,isUnsupportedFeature:i,resources:o}){const{isOneDimensional:a,isStacked:s}=n.meta;if(!a||s||t.custom.getIsOuterDimensionLocked()||i?.("rangeSelections"))return!1;const{flags:l}=o;return l.isEnabled("VIZ_398_CHART_INTERACTION_REFACTOR")?Zs({actions:e,componentKey:"minor-range-brush",dock:r.meta.minor.dock,eventKey:"minorRange",fillTargets:[Gb.COMPONENT.MINOR_AXIS],onEdited:()=>{e.select.emit("end","minorRange")},scale:Gb.SCALE.MAIN.MINOR,targets:[Gb.COMPONENT.MINOR_AXIS,Gb.COMPONENT.POINT]}):r0({eventName:"minorRange",key:"minor-range-brush",targets:[Gb.COMPONENT.MINOR_AXIS,Gb.COMPONENT.POINT],fillTargets:[Gb.COMPONENT.MINOR_AXIS],dock:r.meta.minor.dock,scale:Gb.SCALE.MAIN.MINOR,onEdited(){e.select.emit("end","minorRange")}},{actions:e})}({actions:t,selectionService:n,layoutService:r,dockService:o,isUnsupportedFeature:l,resources:c})||l0,d=s0({actions:t,selectionService:n,layoutService:r,dockService:o,resources:c})||l0,f=function({chart:e,actions:t,selectionService:n,layoutService:r,largeDataService:i,dockService:o,resources:a}){const{isContinuous:s,isTime:l,isTwoDimensional:c}=r.meta;if(!s||c&&n.custom.getIsOuterDimensionLocked())return!1;const{flags:u}=a,d=({datum:e,data:t,scale:r})=>{const i=l?r.formatter():r.data().fields[0].formatter(),o=n.custom.getShouldIncludeMax({datum:e});return`${e!==Math.max(...t)||o?"":"<"}${i(e)}`};return u.isEnabled("VIZ_398_CHART_INTERACTION_REFACTOR")?Zs({actions:t,componentKey:Gb.RANGE.CONTINUOUS,dock:o.meta.major.dock,eventKey:"continuousRange",events:{onRangeMove:()=>{o0({chart:e,largeDataService:i})},onRangeEnd:()=>{i0({chart:e,largeDataService:i})}},fillTargets:l?[Gb.COMPONENT.MAJOR_AXIS_TIME_INNER,Gb.COMPONENT.MAJOR_AXIS_TIME_OUTER]:[Gb.COMPONENT.MAJOR_AXIS_CONTINUOUS],multiple:!0,observeBrush:!0,scale:l?Gb.SCALE.MAIN.MAJOR_INNER:Gb.SCALE.MAIN.MAJOR,targets:l?[Gb.COMPONENT.MAJOR_AXIS_TIME_INNER,Gb.COMPONENT.MAJOR_AXIS_TIME_OUTER,Gb.COMPONENT.POINT]:[Gb.COMPONENT.MAJOR_AXIS_CONTINUOUS,Gb.COMPONENT.POINT],toLabel:d}):r0({eventName:"continuousRange",key:Gb.RANGE.CONTINUOUS,targets:l?[Gb.COMPONENT.MAJOR_AXIS_TIME_INNER,Gb.COMPONENT.MAJOR_AXIS_TIME_OUTER,Gb.COMPONENT.POINT]:[Gb.COMPONENT.MAJOR_AXIS_CONTINUOUS,Gb.COMPONENT.POINT],fillTargets:l?[Gb.COMPONENT.MAJOR_AXIS_TIME_INNER,Gb.COMPONENT.MAJOR_AXIS_TIME_OUTER]:[Gb.COMPONENT.MAJOR_AXIS_CONTINUOUS],dock:o.meta.major.dock,scale:l?Gb.SCALE.MAIN.MAJOR_INNER:Gb.SCALE.MAIN.MAJOR,observeBrush:!0,multiple:!0,toLabel:d},{actions:t,updateOnMove:()=>{o0({largeDataService:i,chart:e})},updateOnEnd:()=>{i0({largeDataService:i,chart:e})}})}({chart:e,actions:t,selectionService:n,layoutService:r,largeDataService:i,dockService:o,resources:c})||l0,h=function({actions:e,selectionService:t,layoutService:n,scales:r,legend:i,resources:o}){const[a]=i.components;if(!a)return!1;const{isTwoDimensional:s}=n.meta,{type:l,key:c}=a,{colorRange:u}=r;if(s||t.custom.getIsOuterDimensionLocked()||"legend-seq"!==l||!u||u.min>=u.max)return!1;const{flags:d}=o;return d.isEnabled("VIZ_398_CHART_INTERACTION_REFACTOR")?Zs({actions:e,bubblesPlacement:"outside",componentKey:"legend-range-brush",dock:a.layout.dock,eventKey:"legendRange",fillTargets:[c],onEdited:()=>{e.select.emit("end","legendRange")},scale:"colorRange",targetFillSelector:'[id="legend-seq-ticks"]',targets:[c],targetSelector:'[id="legend-seq-target"]'}):r0({eventName:"legendRange",key:"legend-range-brush",targets:[c],fillTargets:[c],targetSelector:'[id="legend-seq-target"]',targetFillSelector:'[id="legend-seq-ticks"]',dock:a.layout.dock,scale:"colorRange",bubblesPlacement:"outside",onEdited:()=>{e.select.emit("end","legendRange")}},{actions:e})}({actions:t,selectionService:n,layoutService:r,scales:a,legend:s,resources:c})||l0;return{components:[...u.components,...d.components,...f.components,...h.components],interactions:[...u.interactions,...d.interactions,...f.interactions,...h.interactions]}}const u0={components:[],interactions:[]};function d0({actions:e,selectionService:t,layoutService:n,largeDataService:r,chart:i,resources:o}){const{isOneDimensional:a}=n.meta,s=t.custom.getIsOuterDimensionLocked(),{flags:l}=o;if(a&&s)return u0;const c=t.custom.getIsInnerDimensionLocked();if(!a&&s&&c)return u0;const u=!a&&function({layoutService:e}){const{isDiscrete:t}=e.meta,[n]=e.getDataPages();return!!n&&(t?n.qData&&n.qData.length&&n.qData[0].qSubNodes.every(e=>1===e.qSubNodes.length):n.qMatrix&&n.qMatrix.every(e=>e[1].qElemNumber===n.qMatrix[0][1].qElemNumber))}({layoutService:n});if(u&&s)return u0;const d={key:Gb.COMPONENT.POINT,action:"add",contexts:["selection"]};return d.data=a?["selectionDimension"]:[c||u?"selectionOuterDimension":"selectionDimension"],l.isEnabled("VIZ_398_CHART_INTERACTION_REFACTOR")?function(e){var t=function(){var e,t,n,r,i,o,a,s,l,c,u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{actions:null!==(e=u.actions)&&void 0!==e?e:Qs.ACTIONS,componentKey:null!==(t=u.componentKey)&&void 0!==t?t:Qs.COMPONENT_KEY,components:null!==(n=u.components)&&void 0!==n?n:Qs.COMPONENTS,events:{onLassoStart:null!==(r=null===(i=u.events)||void 0===i?void 0:i.onLassoStart)&&void 0!==r?r:Qs.EVENTS,onLassoMove:null!==(o=null===(a=u.events)||void 0===a?void 0:a.onLassoMove)&&void 0!==o?o:Qs.EVENTS,onLassoEnd:null!==(s=null===(l=u.events)||void 0===l?void 0:l.onLassoEnd)&&void 0!==s?s:Qs.EVENTS},targetKeys:null!==(c=u.targetKeys)&&void 0!==c?c:Qs.TARGET_KEYS}}(e),n=function(e){var t=e.actions,n=e.componentKey,r=e.events,i=e.targetKeys;return{key:"event:lasso",type:"Pan",requireFailure:void 0,recognizeWith:void 0,options:{event:el,enable:function(e,n){return this.started===el||!n||!!(t.select.enabled()&&t.lasso.enabled()&&t.lasso.active())&&this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some(function(e){return-1!==i.indexOf(e.key)})}},events:Pa(Pa(Pa({},"".concat(el,"start"),function(e){e.preventDefault(),this.started!==el&&(t.select.emit("start",el),this.chart.component(n).emit("lassoStart",e),this.started=el,r.onLassoStart({chart:this.chart}))}),"".concat(el,"move"),function(e){e.preventDefault(),this.chart.component(n).emit("lassoMove",e),r.onLassoMove({chart:this.chart})}),"".concat(el,"end"),function(e){e.preventDefault(),this.started=!1,this.chart.component(n).emit("lassoEnd",e),t.select.emit("end",el),r.onLassoEnd({chart:this.chart})})}}(t),r=function(e){return{key:"lasso",type:"brush-lasso",layout:{displayOrder:99},settings:{brush:{components:e.components},lasso:{fill:"rgba(0, 0, 0, 0)",stroke:"black",strokeWidth:2,opacity:.7,strokeDasharray:[]},snapIndicator:{threshold:75,strokeDasharray:"5, 5",stroke:"black",strokeWidth:2,opacity:.7},startPoint:{r:10,stroke:"rgba(77, 192, 78, 1)",strokeWidth:0,opacity:1}}}}(t);return{interactions:[n],components:[r]}}({actions:e,componentKey:"lasso",components:[d],events:{onLassoMove:()=>{o0({largeDataService:r,chart:i})},onLassoEnd:()=>{i0({largeDataService:r,chart:i})}},targetKeys:[Gb.COMPONENT.POINT]}):function(e,t){if(!e.componentTargetKey)throw new Error("Missing 'componentTargetKey' property");const n={key:"lasso",...e},r=(({key:e,components:t})=>({key:e,type:"brush-lasso",layout:{displayOrder:99},settings:{brush:{components:t},lasso:{fill:"rgba(0, 0, 0, 0)",stroke:"black",strokeWidth:2,opacity:.7,strokeDasharray:[]},snapIndicator:{threshold:75,strokeDasharray:"5, 5",stroke:"black",strokeWidth:2,opacity:.7},startPoint:{r:10,stroke:"rgba(77, 192, 78, 1)",strokeWidth:0,opacity:1}}}))(n);return{interactions:[QQ(n,t)],components:[r]}}({key:"lasso",componentTargetKey:Gb.COMPONENT.POINT,components:[d]},{actions:e,updateOnMove:()=>{o0({largeDataService:r,chart:i})},updateOnEnd:()=>{i0({largeDataService:r,chart:i})}})}function f0({app:e,core:t,localeInfo:n,logicalSize:r,model:i,properties:o,services:a,theme:s,translator:l,queryParams:c}){const{actions:u,chart:f,deviceType:h,flags:p,isUnsupportedFeature:m,picasso:g,selections:y,viewCache:v,viewState:b}=t,{alternativeService:x,chartModel:S,colorService:M,continuousModel:w,disclaimerService:k,discreteModel:E,dockService:C,extremumModel:N,fieldModel:T,layoutService:D,pluginService:q,reducedModel:O,refLineModel:I,selectionService:A,styleModel:_,themeService:L,tickModel:P,tooltipService:R,trendLineModel:F,largeDataService:z}=a,{rtl:j}=C.config,$={deviceType:h,localeInfo:n,logicalSize:r,rtl:j,theme:s},V={app:e,flags:p,model:i,translator:l},U=function({context:e,chart:t,actions:n,viewState:r,layoutService:i,colorService:o,styleModel:a}){const s=i.getLayoutValue("dataPoint.show",!1),l={eventName:"legend-c",key:Gb.COMPONENT.LEGEND,viewState:r,chart:t,styleReference:"object.lineChart",styleOverrides:{title:a.query.legend.title.getStyle(),label:a.query.legend.label.getStyle()},rtl:e.rtl};if("categorical"===o.getMain().getSettings().type){const e=!!o.getMain().getScales()[Gb.SCALE.MAIN.LEGEND_COLOR];l.settings={item:{shape:{stroke:{scale:e?Gb.SCALE.MAIN.LEGEND_COLOR:Gb.SCALE.MAIN.COLOR}}}},l.style={item:{shape:{type:s?"line-point":"line",size:12,strokeWidth:2}}}}const c=o.getMain().getLegend(l,{actions:n,navigationDisabled:!n.interact.enabled()});return{components:[...c.components],gestures:[...c.interactions]}}({actions:u,chart:f,colorService:M,context:$,layoutService:D,viewState:b,styleModel:_}),H=JQ({colorService:M,context:$,discreteModel:E,dockService:C,extremumModel:N,fieldModel:T,layoutService:D,legend:U,picasso:g,themeService:L,tickModel:P,viewCache:v,viewState:b}),B=function({chart:e,actions:t,selectionService:n,layoutService:r,chartModel:i,dockService:o,colorService:a,largeDataService:s,scales:l,legend:c,resources:u,isUnsupportedFeature:d}){const f=a0({chart:e,actions:t,selectionService:n,layoutService:r,colorService:a,largeDataService:s,resources:u});if(n.getIsSingleSelect())return{components:[...f.components],gestures:[...f.interactions]};const h=d0({actions:t,selectionService:n,layoutService:r,largeDataService:s,chart:e,resources:u}),p=c0({chart:e,actions:t,selectionService:n,layoutService:r,largeDataService:s,dockService:o,scales:l,legend:c,isUnsupportedFeature:d,resources:u});return{components:[...f.components,...p.components,...h.components],gestures:[...f.interactions,...p.interactions,...h.interactions]}}({actions:u,chart:f,chartModel:S,colorService:M,dockService:C,isUnsupportedFeature:m,layoutService:D,legend:U,resources:V,scales:H,selectionService:A,largeDataService:z}),W=RQ({alternativeService:x,actions:u,chart:f,chartModel:S,colorService:M,context:$,continuousModel:w,disclaimerService:k,discreteModel:E,dockService:C,extremumModel:N,fieldModel:T,layoutService:D,legend:U,refLineModel:I,resources:V,selectables:B,selectionService:A,styleModel:_,themeService:L,tickModel:P,tooltipService:R,trendLineModel:F,viewCache:v,viewState:b,largeDataService:z,selections:y,queryParams:c,hostConfig:t.hostConfig});return{collections:RZ({chartModel:S,colorService:M,extremumModel:N,fieldModel:T,layoutService:D,reducedModel:O,resources:V,tickModel:P}),scales:H,components:q.extendComponents(W),interactions:VQ({actions:u,chart:f,discreteModel:E,dockService:C,gestures:[...U.gestures,...B.gestures],layoutService:D,resources:V,rtl:j,tooltipService:R,trendLineModel:F,viewCache:v,viewState:b}),palettes:M.getMain().getPalettes(),formatters:FQ({fieldModel:T,scales:H}),strategy:(D.getLayout(),Y={logicalSize:$.logicalSize,minCenterRatio:0},{layoutModes:d.getLayoutModes(),center:void 0!==Y.minCenterRatio?{minWidthRatio:Y.minCenterRatio,minHeightRatio:Y.minCenterRatio}:void 0,logicalSize:Y.logicalSize?{align:.5,preserveAspectRatio:!0,...Y.logicalSize}:void 0})};var Y}function h0({core:t,services:n,bootstrapped:r}){const i=e.useApp(),o=e.useAppLayout(),a=e.useModel(),s=e.useOptions(),l=e.useRect(),c=e.useTheme(),u=function({value:t,wait:n=100}){const r=e.useState({}),[i,o]=e.useState(t);return e.useEffect(()=>{if(Date.now()>=r.lastExecuted+n)return r.lastExecuted=Date.now(),o(t),()=>{};const e=setTimeout(()=>{r.lastExecuted=Date.now(),o(t)},n);return()=>clearTimeout(e)},[t]),i}({value:l}),d=e.useTranslator(),f=async()=>{const{chartModel:e,colorService:l,discreteModel:u,layoutService:f,tickModel:h}=n,{isDiscrete:p}=f.meta,{viewCache:m}=t,{queryParams:g}=r;if(!l.isInitialized())return;const y=f0({app:i,core:t,localeInfo:o.qLocaleInfo,logicalSize:MZ({layout:f.getLayout(),options:s}),model:a,properties:r.properties,services:n,theme:c,translator:d,queryParams:g});e.command.updateDataless({settings:y}),await Promise.all(p?[u.command.initialize()]:[]),await e.command.update(),Ih.cacheProperties({viewCache:m,layout:f.getLayout()}),m.set("hasHiddenMinOobs",y.components.filter(e=>e.key===Gb.COMPONENT.OUT_OF_MIN_BOUNDS&&!e.show()).length>0),h.command.lock()},[,h]=e.usePromise(async()=>{r&&await f()},[r]);if(h)throw h;const[,p]=e.usePromise(async()=>{if(!r)return;const{dockService:e,tickModel:t,chartModel:i}=n;e.update({width:u.width,height:u.height}),i.command.setState("isSizeChanging",!0),t.command.unlock(),await f()},[u]);if(p)throw p}window.__qlikMainPrivateResolvers||(window.__qlikMainPrivateResolvers={}),window.__qlikMainPrivateResolvers.mainUrlPromise||(window.__qlikMainPrivateResolvers.mainUrlPromise=new Promise(e=>{window.__qlikMainPrivateResolvers&&(window.__qlikMainPrivateResolvers.resolveMainJsUrl=t=>{e(t)})})),window.__qlikMainPrivateResolvers.mainJsUrlAndHostConfigPromise||(window.__qlikMainPrivateResolvers.mainJsUrlAndHostConfigPromise=new Promise(e=>{window.__qlikMainPrivateResolvers&&(window.__qlikMainPrivateResolvers.resolveMainJsUrlAndHostConfig=t=>{e(t)})})),window.__qlikMainPrivateResolvers.qlikMainPromise||(window.__qlikMainPrivateResolvers.qlikMainPromise=(async()=>{if(window.QlikMain)return window.QlikMain;if(!window.__qlikMainPrivateResolvers?.mainJsUrlAndHostConfigPromise||!window.__qlikMainPrivateResolvers.mainUrlPromise)throw new Error("No main url promise found, report this issue");const e=setTimeout(()=>{console.warn("Waiting for a host parameter pointing to a Qlik runtime system")},5e3),{url:t,hostConfig:n}=await Promise.race([window.__qlikMainPrivateResolvers.mainJsUrlAndHostConfigPromise,window.__qlikMainPrivateResolvers.mainUrlPromise.then(e=>({url:e,hostConfig:window.__qlikMainPrivateResolvers?.forwardCompatibleHostConfig}))]);clearTimeout(e);const r=await async function(e,t){if("windowscookie"===t?.authType){if(t.getAccessToken){const n=await async function(e){if("function"==typeof e)return e();if("string"==typeof e){const t=function(e){return globalThis[e]}(e);if("function"!=typeof t)throw new Error(`getAccessToken function "${e}" not found on globalThis. Please make sure it is defined.`);return t()}}(t.getAccessToken);return n&&await fetch(e,{method:"GET",mode:"cors",credentials:"include",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n}`},cache:"no-cache"}),!0}if(t.loginUri&&!(await fetch(e,{method:"GET",mode:"cors",credentials:"include",redirect:"manual"}).catch(()=>({ok:!1}))).ok)return window.location.replace(t.loginUri),new Promise(()=>{})}return!1}(t,n);return new Promise(e=>{if(window.QlikMain)e(window.QlikMain);else{const n=window.document.createElement("script");t&&(n.src=t),r&&(n.crossOrigin="use-credentials"),n.addEventListener("error",()=>{console.error(`Qlik runtime system not found: ${t}`)}),n.addEventListener("load",()=>{window.QlikMain&&e(window.QlikMain)}),window.document.head.appendChild(n)}})})());var p0=Object.freeze({__proto__:null,importRuntimeModule:async function(e,t){return t?.runtimeModuleMocks?.[e]?t.runtimeModuleMocks?.[e]:(function(e){if(!window.__qlikMainPrivateResolvers)throw new Error("No main url resolver found");const t=function(e){if(!window.__qlikMainPrivateResolvers)throw new Error("No main url resolver found");let t,n=e?.embedRuntimeUrl||e?.url||e?.host;if(n||"noauth"!==e?.authType||(n="https://cdn.qlikcloud.com/qmfe"),n){for(t=n.toLowerCase().startsWith("https://")||n.toLowerCase().startsWith("http://")?n:`https://${n}`;t.endsWith("/");)t=t.slice(0,-1);return`${t}/qlik-embed/main.js`}}(e);t&&window.__qlikMainPrivateResolvers.resolveMainJsUrlAndHostConfig&&window.__qlikMainPrivateResolvers.resolveMainJsUrlAndHostConfig({url:t,hostConfig:e}),t&&window.__qlikMainPrivateResolvers.resolveMainJsUrl&&(window.__qlikMainPrivateResolvers.forwardCompatibleHostConfig=e,window.__qlikMainPrivateResolvers.resolveMainJsUrl(t))}(t),async function(e){if(!window.__qlikMainPrivateResolvers?.qlikMainPromise)throw new Error("No main url resolver found");return(await window.__qlikMainPrivateResolvers.qlikMainPromise).import(e)}(e))}});const m0=["authType","autoRedirect","authRedirectUserConfirmation","embedRuntimeUrl","host","onAuthFailed"],g0=["apikey","oauth2","cookie","windowscookie","reference","anonymous","pfx"],y0={};const v0=async({hostConfig:e,noCache:t}={})=>{const n=`${D2(e)}/resources/autogenerated/product-info.json`;try{if(!(n in y0)){const e={};globalThis.QlikMain?.resourceNeedsCredentials(n)&&(e.credentials="include"),y0[n]=fetch(n,e).then(async e=>e.ok?{data:await e.json(),status:e.status}:{data:void 0,status:e.status})}const e=await y0[n];return(e.status>=400||!e.data)&&delete y0[n],e}catch{return delete y0[n],{data:void 0,status:500}}finally{t&&delete y0[n]}},b0=e=>{const t=e.externalUrls;if(!t)return;const n=e.composition?.productName??"Qlik",r=e.composition?.releaseLabel||"-",i="-"===r?n:`${n} (${r})`;return{productId:e.composition?.senseId??"qlik",productLabel:i,version:e.composition?.version,urls:{personalHelpBaseUrl:t.personalHelpBaseUrl,personalUpgradeBase:t.personalUpgradeBase,personalUpgradeUrl:t.personalUpgradeUrl,serverHelpBaseUrl:t.serverHelpBaseUrl,qlikWebPageUrl:t.qlikWebPageUrl}}},x0=e=>({isCloud:!1,isQCS:!1,isQCG:!1,isCloudConsole:!1,isWindows:!1,isQSE:!1,isQSD:!1,isUnknown:!1,...e});function S0(e,t){const n=new Uint8Array(t);globalThis.crypto.getRandomValues(n);let r="";for(let i=0;i<t;i++)r+=e[n[i]%e.length];return r}function M0(e){return S0("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-",e)}const w0={},k0=new Map;function E0(e){const t=Zb(e)||{};return t.host&&(t.host=D2(t)),Kb()&&D2(t)===window.location.origin&&delete t.host,t.authType&&g0.includes(t.authType)&&delete t.authType,t}function C0(e,t){if("function"!=typeof t)return t}function N0(e){const t=Jb(E0(H2(e)));return JSON.stringify(t,C0)}const T0=new Map;function D0(e,t){const n=t?.reference||null;if(n&&!T0.has(n))throw new g2(`Host config with reference "${n}" is not registered. Please register it before using it.`);T0.has(e)&&console.warn(`registerHostConfig: Host config with name "${e}" is already registered. Overwriting.`),T0.set(e,t)}function q0(e){return T0.get(e)}function O0(){return q0("default")||{}}const I0=new Map;function A0(e){const t=N0(e);let n=I0.get(t);return n||(n={redirectRequestedListeners:new Set,redirectStartedListeners:new Set},I0.set(t,n)),n}function _0(e){const t=A0(e),n=t.redirectRequestedListeners.size>0||e.authRedirectUserConfirmation;return e.autoRedirect||!n?Promise.resolve():"function"==typeof e.authRedirectUserConfirmation?e.authRedirectUserConfirmation().catch(()=>{}):new Promise(e=>{const n=()=>{for(const e of t.redirectStartedListeners)try{e()}catch(e){console.warn(e)}e()};for(const e of t.redirectRequestedListeners)try{e({proceed:n})}catch(e){console.warn(e)}})}const L0="qlik-qmfe-api";function P0(e){let t=e.clientId+(e.scope?`_${e.scope}`:"_user_default");return e.subject&&(t+=`_${e.subject}`),e.userId&&(t+=`_${e.userId}`),t}function R0(e){return`${e.accessCode}_${e.clientId}`}const F0={};function z0(e,t,n){localStorage.setItem(`${L0}-${e}-${t}`,n)}function j0(e,t,n){sessionStorage.setItem(`${L0}-${e}-${t}`,n)}function $0(e,t,n,r){return e.store(`${L0}-${t}-${n}`,r)}function V0(e,t){return localStorage.getItem(`qlik-qmfe-api-${e}-${t}`)||void 0}function U0(e,t){return sessionStorage.getItem(`qlik-qmfe-api-${e}-${t}`)||void 0}function H0(e,t,n){return e.get(`${L0}-${t}-${n}`)}function B0(e,t){t.forEach(t=>localStorage.removeItem(`${L0}-${e}-${t}`))}function W0(e,t){t.forEach(t=>sessionStorage.removeItem(`${L0}-${e}-${t}`))}function Y0(e,t){const n=`${L0}-${e}-${t}`,r=sessionStorage.getItem(n)||void 0;return sessionStorage.removeItem(n),r}function G0(e){return"object"==typeof e&&null!==e&&"function"==typeof e.store&&"function"==typeof e.get&&"function"==typeof e.delete}async function K0(e,t){if(!e.clientId)throw new g2('A host config with authType set to "oauth2" has to also provide a clientId');return X0(P0(e),t,e.noCache,e.accessTokenStorage)}async function X0(e,t,n,r){return n?t():(F0[e]=F0[e]||(async()=>{let n=await async function(e,t){let n,r;if("local"===t?(n=V0(e,"access-token"),r=V0(e,"refresh-token")):"session"===t?(n=U0(e,"access-token"),r=U0(e,"refresh-token")):G0(t)&&(n=await H0(t,e,"access-token"),r=await H0(t,e,"refresh-token")),n)return{accessToken:n,refreshToken:r}}(e,r);return n||(n=await t(),"local"===r&&n?(n.accessToken&&z0(e,"access-token",n.accessToken),n.refreshToken&&z0(e,"refresh-token",n.refreshToken)):"session"===r&&n?(n.accessToken&&j0(e,"access-token",n.accessToken),n.refreshToken&&j0(e,"refresh-token",n.refreshToken)):G0(r)&&n&&(n.accessToken&&await $0(r,e,"access-token",n.accessToken),n.refreshToken&&await $0(r,e,"refresh-token",n.refreshToken)),n)})(),F0[e])}function J0(e){const t=P0(e);delete F0[t],Kb()&&(B0(t,["access-token","refresh-token"]),W0(t,["access-token","refresh-token"])),G0(e.accessTokenStorage)&&function(e,t,n){Promise.all(n.map(n=>e.delete(`${L0}-${t}-${n}`)))}(e.accessTokenStorage,t,["access-token","refresh-token"])}function Z0(e){if("string"==typeof e){const t=globalThis[e];if(!t)throw new Error(`No such function: ${e}`);return t}return e}function Q0(e){return globalThis[e]}function e1(e){if(e.errors)throw new x2(e.errors)}function t1(e){const t=Object.keys(e);return t.sort(),t.map(t=>`${t}=${e[t]}`).join("&")}async function n1(e){const t=(new TextEncoder).encode(e),n=await globalThis.crypto.subtle.digest("SHA-256",t);return function(e){let t;if(Kb()){const n=String.fromCharCode.apply(null,e);t=btoa(n)}else{if(!Xb())throw new Error("Environment not supported for oauth2 authentication");t=Buffer.from(e).toString("base64")}return t}(Array.from(new Uint8Array(n))).replaceAll(/\+/g,"-").replaceAll(/\//g,"_").replace(/=+$/,"")}async function r1(e){const t=e.clientId||"",n=D2(e),r=M0(128),i=M0(43),o=await n1(r),a=e.redirectUri||globalThis.location.href,s=P0(e);J0(e),j0(s,"state",i),j0(s,"verifier",r),j0(s,"href",globalThis.location.href),j0("","client-in-progress",s);const l=`${n}/oauth/authorize?${t1({response_type:"code",client_id:t,redirect_uri:a,scope:e.scope||"user_default",state:i,code_challenge:o,code_challenge_method:"S256"})}`;globalThis.location.replace(l)}async function i1(e,t,n,r){try{const i=await(await fetch(`${D2(e)}/oauth/token`,{method:"POST",credentials:"include",mode:"cors",headers:{"content-type":"application/json"},redirect:"follow",body:JSON.stringify({grant_type:"authorization_code",scope:e.scope||"user_default",...t?{code:t}:{},redirect_uri:r||globalThis.location.href,...n?{code_verifier:n}:{},client_id:e.clientId})})).json();return e1(i),{accessToken:i.access_token,refreshToken:i.refresh_token,errors:i.errors}}catch(e){return console.error(e),new Promise(()=>{})}}function o1(e,t,n,r,i){const o={client_id:e,client_secret:t,scope:n};return r?{...o,grant_type:"urn:qlik:oauth:user-impersonation",user_lookup:{field:"subject",value:r}}:i?{...o,grant_type:"urn:qlik:oauth:user-impersonation",user_lookup:{field:"userId",value:i}}:{...o,grant_type:"client_credentials"}}async function a1(e){const{clientId:t,clientSecret:n,performInteractiveLogin:r}=e;if(!t||!n&&!r)throw new g2('A host config with authType set to "oauth2" has to provide a clientId and a clientSecret or a performInteractiveLogin function');return await K0(e,async()=>{if(e.performInteractiveLogin)return s1(e);if(!e.clientId||!e.clientSecret)throw new g2('A host config with authType set to "oauth2" has to provide a clientId and a clientSecret');return async function(e,t,n,r="user_default",i,o){const a=await(await fetch(`${e}/oauth/token`,{method:"POST",mode:"cors",headers:{"content-type":"application/json"},body:JSON.stringify(o1(t,n,r,i,o))})).json();return{accessToken:a.access_token,refreshToken:a.refresh_token,errors:a.errors}}(D2(e),e.clientId,e.clientSecret,e.scope,e.subject,e.userId)})}async function s1(e){if(!e.performInteractiveLogin)return d1("No performInteractiveLogin function in hostConfig");let t;try{const n=M0(128),r=M0(43),{code:i,state:o}=function(e){if("string"==typeof e){let t;try{t=new URL(e)}catch{t=new URL(e,"http://localhost")}const n=new URLSearchParams(t.search);return{code:n.get("code")||"",state:n.get("state")||""}}return e}(await Z0(e.performInteractiveLogin)({getLoginUrl:async({redirectUri:i})=>(t=i,async function(e,t,n,r){const i=e.clientId||"",o=D2(e),a=await n1(r);return`${o}/oauth/authorize?${t1({response_type:"code",client_id:i,redirect_uri:t,scope:e.scope||"user_default",state:n,code_challenge:a,code_challenge_method:"S256"})}`}(e,i,r,n))}));return t?r!==o?d1("State returned by custom interactive login function does not match original"):i?await i1(e,i,n,t):d1("No code found in response from custom interactive login function"):d1("No redirect uri provided")}catch(e){return{accessToken:void 0,refreshToken:void 0,errors:[{code:"",status:401,title:"Could not perform custom interactive login",detail:String(e)}]}}}!function(e,t){const n=globalThis.location?.hostname?.toLowerCase(),r="localhost"===n,i=n?.endsWith(".qlik-stage.com");(r||i)&&globalThis.QlikMain&&(void 0===globalThis.QlikMain.INTERNAL__DO_NOT_USE.qix&&(globalThis.QlikMain.INTERNAL__DO_NOT_USE.qix={}),globalThis.QlikMain.INTERNAL__DO_NOT_USE.qix[e]=t)}("clearAllAccessTokens",()=>{console.log("Clearing tokens",F0),Object.keys(F0).forEach(e=>{console.log("Clearing access tokens for",e),B0(e,["access-token","refresh-token"]),W0(e,["access-token","refresh-token"])}),function(){for(const e in F0)delete F0[e]}()});let l1=Promise.resolve("");async function c1(e){if(Xb()){const t=await a1(e);return t?(e1(t),t.accessToken||""):""}return Kb()&&(l1=l1.then(async()=>{const t=await async function(e){const{clientId:t}=e;if(!t)throw new g2('A host config with authType set to "oauth2" has to also provide a clientId');const n=await K0(e,async()=>{if(e.getAccessToken)try{return{accessToken:"string"==typeof e.getAccessToken?await Q0(e.getAccessToken)():await e.getAccessToken(),refreshToken:void 0,errors:void 0}}catch{return d1("Could not fetch access token using custom function")}if(e.performInteractiveLogin)return s1(e);const t=P0(e),n=Y0(t,"code"),r=Y0(t,"verifier");if(n&&r){const t=await i1(e,n,r,e.redirectUri);if(t)return t}});return n||(e.performInteractiveLogin||(await _0(e),r1(e)),new Promise(()=>{}))}(e);return t?(e1(t),t.accessToken||""):""})),l1}async function u1(e){const t=await async function(e){return F0[P0(e)]}(e);if(J0(e),t&&t.refreshToken&&e.clientSecret){const n=await K0(e,async()=>{if(!t||!t.refreshToken||!e.clientSecret)throw new Error("Trying to refresh tokens without refreshToken or clientSecret");return async function(e,t,n){const r=await(await fetch(`${e}/oauth/token`,{method:"POST",mode:"cors",headers:{"content-type":"application/json"},body:JSON.stringify({grant_type:"refresh_token",refresh_token:t,client_secret:n})})).json();return{accessToken:r.access_token,refreshToken:r.refresh_token,errors:r.errors}}(D2(e),t.refreshToken,e.clientSecret)});n&&e1(n)}}function d1(e){return{accessToken:void 0,refreshToken:void 0,errors:[{code:"",status:401,title:e,detail:""}]}}async function f1(e,t,n){const r=await fetch(`${D2(e)}/oauth/token`,{method:"POST",credentials:"include",mode:"cors",headers:{"content-type":"application/json"},redirect:"follow",body:JSON.stringify({subject_token:t,subject_token_type:"urn:ietf:params:oauth:token-type:access_token",grant_type:"urn:ietf:params:oauth:grant-type:token-exchange",purpose:n,redirect_uri:globalThis.location?.href,client_id:e.clientId})});if(200!==r.status)throw await async function(e){const t=await e.text();try{return new x2(JSON.parse(t).errors)}catch{return new x2([{code:"unknown",status:e.status,detail:t,title:"Unknown authentication error"}])}}(r);return(await r.json()).access_token}async function h1(e,t){try{return await t()}catch(n){const{retry:r}=await g1({hostConfig:e});if(r)return t();throw n}}function p1(){const e=Math.floor(Date.now()/1e3).toString(16);return`${e}${t=40-e.length,S0("0123456789abcdef",t)}`;var t}async function m1(e){const{accessCode:t,clientId:n}=e;if(!t||!n)throw new g2('A host config with authType set to "anonymous" has to provide both an accessCode and clientId');const r=await async function(e,t){if(!e.accessCode)throw new g2('A host config with authType set to "anonymous" has to also provide an accessCode');return X0(R0(e),t,!1,void 0)}(e,async()=>async function(e,t,n,r){const i=await(await fetch(`${e}/oauth/token/anonymous-embed`,{method:"POST",mode:"cors",headers:{"content-type":"application/json"},body:JSON.stringify({eac:t,client_id:n,grant_type:"urn:qlik:oauth:anonymous-embed",tracking_code:r})})).json();return{accessToken:i.access_token,refreshToken:i.refresh_token,errors:i.errors}}(D2(e),t,n,await async function(e){let t;if(Kb()){const n=R0(e);t=V0(n,"tracking-code"),t||(t=p1()),z0(n,"tracking-code",t)}else t=p1();return t}(e)));if(!r)return"";if(r.errors)throw new x2(r.errors);return r.accessToken?r.accessToken:""}async function g1({hostConfig:e}){return function(e){const t=R0(e);delete F0[t],Kb()&&(B0(t,["access-token","refresh-token"]),W0(t,["access-token","refresh-token"]))}(e),{preventDefault:!1,retry:!0}}var y1={requiredProps:["clientId","accessCode"],optionalProps:[],getRestCallAuthParams:async function({hostConfig:e}){return{headers:{Authorization:`Bearer ${await m1(e)}`},queryParams:{},credentials:"omit"}},getWebSocketAuthParams:async function({hostConfig:e}){return Xb()?{headers:{Authorization:`Bearer ${await m1(e)}`}}:{queryParams:{accessToken:await h1(e,async()=>f1(e,await m1(e),"websocket"))}}},getWebResourceAuthParams:async function({hostConfig:e}){return{queryParams:{accessToken:await h1(e,async()=>f1(e,await m1(e),"websocket"))}}},handleAuthenticationError:g1};var v1={requiredProps:["apiKey"],optionalProps:[],getRestCallAuthParams:function({hostConfig:e}){return Promise.resolve({headers:{Authorization:`Bearer ${e?.apiKey}`},queryParams:{},credentials:"omit"})},getWebSocketAuthParams:async function({hostConfig:e}){if(Kb())throw new Error("Not supported in browser environment");return Promise.resolve({headers:{Authorization:`Bearer ${e?.apiKey}`}})},handleAuthenticationError:function(){return Promise.resolve({})}},b1=class extends Error{status;headers;data;constructor(e,t,n,r){super(e),this.status=t,this.headers=n,this.data=r,this.stack=w1(this.stack)}},x1=class extends Error{contentType;data;constructor(e,t,n){super(e),this.contentType=t,this.data=n,this.stack=w1(this.stack)}};const S1=/^.+\/qmfe-api(?:\.js)?:(\d+)(?::\d+)?$/gim,M1=e=>{const t=e.match(S1);return Boolean(t&&t.length>0)};function w1(e){if(!e)return e;const t=[],n=e.split("\n");n.reverse();for(const e of n){if(M1(e))break;t.unshift(e)}return t.join("\n")}function k1(e){return e?Object.entries(e).map(e=>{const[,t]=e;if(void 0!==t)return e.map(e=>encodeURIComponent(decodeURIComponent(e))).join("=")}).filter(Boolean).join("&"):""}const E1={};globalThis.__API_CACHE__DO_NOT_USE_OR_YOU_WILL_BE_FIRED=E1,globalThis.QlikMain?.INTERNAL__DO_NOT_USE&&(globalThis.QlikMain.INTERNAL__DO_NOT_USE.apiCache=E1);function C1(e,t,n){if(e?.noCache)return!1;if(!t||void 0===t.value)return!1;if(e?.useCacheIfAfter)return e.useCacheIfAfter.getTime()<=t.lastPulled;const r=Date.now()-t.lastPulled;return"number"==typeof e?.maxCacheAge?r<=e?.maxCacheAge:r<n}function N1({url:e,query:t,headers:n,serializedHostConfig:r}){let i=e;if(t&&Object.keys(t).length>0){const n=k1(t);i=e.includes("?")?i.concat(`&${n}`):i.concat(`?${n}`)}return n&&Object.keys(n).length>0&&(i=i.concat(`+headers=${JSON.stringify(n)}`)),r&&"{}"!==r&&(i=i.concat(`+host-config=${r}`)),i}function T1(e){const t=[];return E1[e]&&t.push(E1[e]),E1[".global"]&&t.push(E1[".global"]),t}function D1(e,t){const n=q1(t);for(const t in e){const r=q1(t);(n.startsWith(r)||r.startsWith(n))&&delete e[t]}}function q1(e){const t=e.indexOf("?");if(t>=0)return e.substring(0,t);const n=e.indexOf("+headers=");if(n>=0)return e.substring(0,n);const r=e.indexOf("+host-config=");return r>=0?e.substring(0,r):e}function O1(e){return null==e||e&&(e instanceof Blob||e instanceof Object&&"[object Blob]"===e.toString())||e&&e instanceof ReadableStream||"string"==typeof e?e:JSON.parse(JSON.stringify(e))}function I1(e){return e.then(e=>{const t={data:O1(e.data),headers:e.headers,status:e.status};return e.next&&(t.next=e.next),e.prev&&(t.prev=e.prev),t})}function A1(e,t){return"get"!==e&&"GET"!==e&&(!t.endsWith("/api/v1/licenses/allotments")||"post"!==e&&"POST"!==e)}function _1(e){return e instanceof Error?e.cause?e.message?`${e.message} - ${_1(e.cause)}`:_1(e.cause):e.message:String(e)}async function L1(e,t,n,r,i,o,a,s){const{body:l,contentTypeHeader:c,requestOptions:u}=function(e,t){if(!e)return{body:null,contentTypeHeader:{},requestOptions:{}};const n={},r={};let i;switch(t){case"":case"application/json":n["Content-Type"]="application/json",i=JSON.stringify(e);break;case"multipart/form-data":i=function(e){const t="multipart/form-data";if("object"!=typeof e)throw new x1(`Cannot encode ${typeof e} as ${t}, body should be an object.`,t,e);if(Array.isArray(e))throw new x1(`Cannot encode ${typeof e} as ${t}, body should be an object.`,t,e);if(e instanceof FormData)return e;const n=new FormData;return Object.entries(e).forEach(r=>{const[i,o]=r;switch(typeof o){case"boolean":case"number":case"string":n.set(i,`${o}`);break;case"object":if(o instanceof Blob)n.set(i,o);else if(o instanceof Uint8Array){const e=new Blob([o],{type:"application/octet-stream"});n.set(i,e)}else{const e=JSON.stringify(o),t=new Blob([e],{type:"application/json"});n.set(i,t,"")}break;default:throw new x1(`Cannot encode multipart-field "${i}" with value of type ${typeof o}, values must be objects, strings, numbers or boolean.`,t,e)}}),n}(e);break;case"application/octet-stream":n["Content-Type"]=t,r.duplex="half",i=e;break;case"text/plain":if("string"!=typeof e)throw new x1(`Cannot send ${typeof e} as ${t}, body should be a string.`,t,e);n["Content-Type"]=t,i=e;break;default:throw new x1(`Unsupported content-type "${t}", supported are: application/json, multipart/form-data, application/octet-stream and text/plain`,t,e)}return{body:i,contentTypeHeader:n,requestOptions:r}}(n,r??""),d={...c,...o,...i?.headers,...j1()};!d["User-Agent"]&&s&&(d["User-Agent"]=s);const f={method:e,credentials:a,mode:"cors",headers:d,redirect:await T2(i?.hostConfig)?"manual":"follow",keepalive:i?.keepalive,progress:i?.progress,body:l,...u};let h,p;if(i?.signal)f.signal=i.signal;else if(i?.timeoutMs&&i.timeoutMs>0){const e=new AbortController;h=setTimeout(()=>{e.abort()},i.timeoutMs),f.signal=e.signal}return p=i?.progress?await async function(e,{method:t,headers:n,credentials:r,keepalive:i,body:o,signal:a,progress:s}){const l=new XMLHttpRequest;let c,u;const d=new Promise((e,t)=>{c=e,u=t});if(l.open(t||"GET",e),"object"!=typeof n)throw Error("malformed headers",n);for(const[e,t]of Object.entries(n))l.setRequestHeader(e,t);i&&l.setRequestHeader("Connection","keep-alive"),a&&a.addEventListener("abort",()=>{l.abort(),u()}),l.withCredentials="include"===r,s?.onUpload&&(l.upload.onprogress=e=>{const{loaded:t,total:n,lengthComputable:r}=e;s.onUpload?.({loaded:t,total:r?n:void 0})}),s?.onDownload&&(l.onprogress=e=>{const{loaded:t,total:n,lengthComputable:r}=e;s.onDownload?.({loaded:t,total:r?n:void 0})}),l.onloadend=()=>{const{status:e}=l,t={};for(const e of l.getAllResponseHeaders().split("\r\n")){const[n,r]=e.split(":",2);n&&r&&(t[n]=r)}l.response?c(new Response(l.response,{status:e,headers:t})):c(new Response(void 0,{status:e,headers:t}))};try{const e=o;l.send(e)}catch(e){return Promise.reject(new b1(_1(e),0,new Headers,{}))}return d}(t,f):await async function(e,t){try{return await fetch(e,t)}catch(e){return Promise.reject(new b1(_1(e),0,new Headers,{}))}}(t,f),h&&clearTimeout(h),await async function(e,t){let n;const r=e.headers.get("content-type")?.split(";")[0],i=e.headers.get("content-disposition")?.split(";");if(i&&"attachment"===i[0]){let t="";for(let e=1;e<i.length;e++){const n=i[e].trim();if(0===n.indexOf("filename")){const e=n.indexOf('"'),r=n.lastIndexOf('"');t=n.slice(e+1,r)}}n=$1(await e.blob(),t)}else switch(r){case"image/png":case"image/jpeg":case"image/x-icon":case"application/offset+octet-stream":case"application/octet-stream":case"application/zip":case"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":case"application/pdf":n=$1(await e.blob());break;case"text/event-stream":n=e.body;break;default:{let r;try{r=await e.text()}catch(n){throw new b1(`request to '${t}' failed while reading response body: ${n instanceof Error?n.message:String(n)}`,e.status,e.headers,void 0)}try{n=JSON.parse(r)}catch{n=r}break}}const{status:o,statusText:a,headers:s}=e,l=`request to '${t}' failed with status ${o} ${a}.`;if(o>=300)throw new b1(l,o,s,n);if(0===o)throw new b1(l,302,s,n);return{status:o,headers:s,data:n}}(p,t)}async function P1({method:e,pathTemplate:t,pathVariables:n,query:r,options:i}){const o=D2(i?.hostConfig),{headers:a,queryParams:s,credentials:l}=await _2({hostConfig:i?.hostConfig,method:e}),c=o+function(e,t){let n=e;return t&&Object.keys(t).forEach(e=>{n=n.replace(`{${e}}`,t[e])}),n}(t,n),u=function(e,t){return""!==t?`${e}?${t}`:e}(c,k1({...r,...s})),d=z2(i?.hostConfig);return{completeUrl:u,authHeaders:a,credentials:l,cacheKey:N1({url:c,query:r,headers:i?.headers,serializedHostConfig:d})}}function R1(e,t){return F1(e,t,async()=>{const{authHeaders:n,credentials:r}=await P1(t);return F1(e,{...t,authHeaders:n,credentials:r,options:{...t.options,noCache:!0}},void 0)})}function F1(e,t,n){const{method:r,completeUrl:i,body:o,options:a,authHeaders:s,credentials:l,cacheKey:c,contentType:u,userAgent:d}=t,f={method:r,completeUrl:i,cacheKey:c,options:a},h=function(e,t){if(t?.options?.noCache)return;const{method:n,completeUrl:r,cacheKey:i}=t,o=T1(e);if(A1(n,r))return;let a;for(const e of o)if(i in e){if(a=e[i],a&&void 0!==a.value&&C1(t?.options,a,6e5))break;a=void 0}if(!a)return;return a.lastHit=new Date,a.hitCount+=1,a.accessedPaths.add(globalThis.location?globalThis.location.pathname:"node"),I1(a.value)}(e,f);if(h)return h;const p=L1(r,i,o,u,a,s,l,d),m=async function(e,t,n,r){try{return await n}catch(n){const i=n,o=i.data;if(401===i.status||403===i.status&&"CSRF-TOKEN-2"===o?.code||function(e,t){const n=new URL(e,"http://dummy"),r=n.pathname.endsWith("/qps/csrftoken")&&n.searchParams.has("xrfkey");return 301===t||302===t||r&&403===t}(t,i.status)&&await T2(e)){if(globalThis.loggingOut)return z1();const{retry:t,preventDefault:n}=await A2({hostConfig:e,status:i.status,headers:i.headers,errorBody:o,canRetry:!!r});if(t&&r)return r();if(n)return z1()}throw n}}(a?.hostConfig,i,p,n);return function(e,t,n){E1[e]||(E1[e]={});const{cacheKey:r}=t;if(A1(t.method,t.completeUrl))return n.then(t=>{const n=T1(e);for(const e of n)D1(e,r);return t});const i=E1[e],o=n.catch(e=>(delete i[r],Promise.reject(e)));return i[r]={lastPulled:Date.now(),value:o,lastHit:null,hitCount:0,accessedPaths:new Set},I1(o)}(e,f,function(e,{method:t,body:n,options:r,authHeaders:i,credentials:o,value:a}){return a.then(a=>{const s=a.data;if(!s)return a;const l=z2(r?.hostConfig),c=s.links?.prev?.href,u=s.links?.next?.href;return c&&(a.prev=a=>R1(e,{method:t,completeUrl:c,body:n,options:a||r,authHeaders:i,credentials:o,cacheKey:N1({url:c,headers:r?.headers,serializedHostConfig:l})})),u&&(a.next=a=>R1(e,{method:t,completeUrl:u,body:n,options:a||r,authHeaders:i,credentials:o,cacheKey:N1({url:u,headers:r?.headers,serializedHostConfig:l})})),a})}(e,{...t,value:m}))}function z1(){return new Promise(()=>{})}function j1(){if(!Kb())return{};const e=localStorage.getItem("qmfe-api-service-overrides-header");return e?{"X-Qlik-Overrides":e}:{}}function $1(e,t){const n=e;return n.download=t?n=>V1(e,n??t):t=>V1(e,t),n}async function V1(e,t){if(Kb()){const n=document.createElement("a"),r=window.URL.createObjectURL(e);n.href=r,n.download=t,n.click(),window.URL.revokeObjectURL(r)}else{const{writeFileSync:n}=await Promise.resolve().then(function(){return Z2}),r=await e.arrayBuffer();n(t,new Uint8Array(r))}}const U1="qmfe-api/latest";async function H1(e,t,n){return(K2.getInterceptors()||[]).reduce((e,t)=>n=>t(n,e),t=>async function(e,t){if("mock-backend-rest-recorder"===t.options?.hostConfig?.authType)return Promise.resolve(t.options?.hostConfig.recordInvokeFetch(t));if("mock-backend"===t.options?.hostConfig?.authType)return Promise.resolve(t.options?.hostConfig.mockInvokeFetch(t));if(function(e){const t=H2(e);if(N2(t)){if(0===Object.keys(t).length)throw new g2("a host config must be provided when making a cross domain request");if(!t.host)throw new g2("A 'host' property must be set in host config when making a cross domain request")}}(t.options?.hostConfig),"noauth"===t.options?.hostConfig?.authType)return console.info("API call blocked: noauth auth module is configured, no API calls should be made"),{status:204,headers:new Headers,data:null};let n;n=t?.userAgent?t.userAgent:Kb()?`${window.navigator.userAgent} ${U1}`:U1;const{completeUrl:r,authHeaders:i,credentials:o,cacheKey:a}=await P1(t);return R1(e,{...t,method:t.method.toUpperCase(),completeUrl:r,authHeaders:i,credentials:o,cacheKey:a,userAgent:n})}(e,t))(t)}function B1(e){!function(e){E1[e]={}}(e)}async function W1(e,t){const n=D2(e);let r;r=await T2(e)?"/qps/csrftoken":"/api/v1/csrf-token";const i=async()=>{try{const n=(await H1("csrf-token",{method:"get",pathTemplate:r,options:{hostConfig:e,maxCacheAge:5e3,noCache:t}})).headers.get("qlik-csrf-token");return n||""}catch(e){if(404===e.status)return"";throw e}};return t?(Y1[n]=i(),Y1[n]):(Y1[n]=Y1[n]||i(),Y1[n])}const Y1={};function G1(e){return!1===e.crossSiteCookies?"same-origin":N2(e)?"include":"same-origin"}async function K1(e){if("function"==typeof e)return e();if("string"==typeof e){const t=function(e){return globalThis[e]}(e);if("function"!=typeof t)throw new Error(`getAccessToken function "${e}" not found on globalThis. Please make sure it is defined.`);return t()}}var X1={requiredProps:[],optionalProps:["webIntegrationId","crossSiteCookies","anonymousMode"],getRestCallAuthParams:async function({hostConfig:e,method:t}){const n={};var r;return"get"!==(r=t)&&"GET"!==r&&(n["qlik-csrf-token"]=await W1(e)),e.webIntegrationId&&(n["qlik-web-integration-id"]=e.webIntegrationId),{headers:n,queryParams:{},credentials:G1(e)}},getWebSocketAuthParams:async function({hostConfig:e}){if(Xb()){const t={};return t["qlik-csrf-token"]=await W1(e),e.webIntegrationId&&(t["qlik-web-integration-id"]=e.webIntegrationId),{headers:t}}const t={"qlik-csrf-token":await W1(e,!0)};return e.webIntegrationId&&(t["qlik-web-integration-id"]=e.webIntegrationId),{queryParams:t}},handleAuthenticationError:async function({hostConfig:e,status:t}){if(function(e){const t=D2(e);delete Y1[t],B1("csrf-token")}(e),403===t)return{preventDefault:!1,retry:!0};const n=e.webIntegrationId?`qlik-web-integration-id=${e?.webIntegrationId}&`:"",r=D2(e);return await _0(e),globalThis.location.replace(`${r}/login?${n}returnto=${encodeURIComponent(globalThis.location.href)}`),{preventDefault:!0}}};var J1={requiredProps:[],optionalProps:[],getRestCallAuthParams:function(e){return Promise.resolve({headers:{},queryParams:{},credentials:"same-origin"})},getWebSocketAuthParams:function(e){return Promise.resolve({queryParams:{}})},handleAuthenticationError:function(e){return Promise.resolve({})}};var Z1={requiredProps:[],optionalProps:[],getRestCallAuthParams:function(){return Promise.resolve({headers:{},queryParams:{},credentials:"same-origin"})},getWebSocketAuthParams:function(){return Promise.resolve({queryParams:{}})},handleAuthenticationError:function(){return Promise.resolve({})}};async function Q1(e,t){try{return await t()}catch(n){const{retry:r}=await e2({hostConfig:e});if(r)return t();throw n}}async function e2({hostConfig:e}){return e.getAccessToken?(J0(e),{preventDefault:!1,retry:!0}):e.performInteractiveLogin?(J0(e),{retry:!0}):Kb()?(await _0(e),r1(e),{preventDefault:!0}):(await u1(e),{preventDefault:!1,retry:!0})}Kb()&&function(){const e=new URLSearchParams(globalThis.location.search),t=e.get("code")||void 0,n=e.get("state")||void 0;if(e.get("error")){const t=document.createElement("pre");t.innerText=`<code>${JSON.stringify({error:e.get("error"),error_code:e.get("error_code"),error_description:e.get("error_description"),error_detail:e.get("error_detail"),error_uri:e.get("error_uri")})}</code>`,document.body.prepend(t)}const r=Y0("","client-in-progress");if(r&&t&&n){const e=Y0(r,"state"),i=Y0(r,"href");e&&e===n&&i&&(j0(r,"code",t),i!==globalThis.location.href&&globalThis.location.replace(i))}}();var t2={requiredProps:["clientId"],optionalProps:["clientSecret","redirectUri","accessTokenStorage","scope","subject","userId","noCache","getAccessToken","performInteractiveLogin"],getRestCallAuthParams:async function({hostConfig:e}){return{headers:{Authorization:`Bearer ${await c1(e)}`},queryParams:{},credentials:"omit"}},getWebSocketAuthParams:async function({hostConfig:e}){return Xb()?{headers:{Authorization:`Bearer ${await c1(e)}`}}:{queryParams:{accessToken:await Q1(e,async()=>f1(e,await c1(e),"websocket"))}}},getWebResourceAuthParams:async function({hostConfig:e}){return{queryParams:{accessToken:await Q1(e,async()=>f1(e,await c1(e),"webresource"))}}},handleAuthenticationError:e2};var n2={requiredProps:["reference"],optionalProps:[],getRestCallAuthParams:function(){throw new Error("getRestCallAuthParams should never be called for reference auth module")},getWebSocketAuthParams:function(){throw new Error("getWebSocketAuthParams should never be called for reference auth module")},handleAuthenticationError:function(){throw new Error("handleAuthenticationError should never be called for reference auth module")}};const r2={};function i2(e){const t=D2(e);return r2[t]=r2[t]||function(){let e="";for(let t=0;t<16;t+=1){const t=Math.floor(62*Math.random());e+=t<10?t:t>9&&t<36?String.fromCharCode(t+55):String.fromCharCode(t+61)}return e}(),r2[t]}var o2={requiredProps:[],optionalProps:["loginUri","crossSiteCookies","getAccessToken"],getRestCallAuthParams:async function({hostConfig:e}){return{headers:{"X-Qlik-XrfKey":i2(e)},queryParams:{xrfkey:i2(e)},credentials:G1(e)}},getWebSocketAuthParams:async function({hostConfig:e}){return{queryParams:{xrfkey:i2(e),"qlik-csrf-token":await W1(e,!0)}}},handleAuthenticationError:async function({hostConfig:e}){if(e.loginUri)return await _0(e),globalThis.location.replace(e.loginUri.replace("{location}",encodeURIComponent(globalThis.location.href))),{preventDefault:!0};if(e.getAccessToken){const t=await K1(e.getAccessToken);if(t)return await fetch(`${D2(e)}/qlik-embed/main.js`,{method:"GET",mode:"cors",credentials:"include",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},cache:"no-cache"}),{retry:!0}}return{}}};const a2=new Map;async function s2(e){let t=function(e){const t=z2(e);return a2.get(t)}(e);if(!t){const n=await K1(e.getAccessToken);if(!n)throw new Error("Failed to acquire access token");t=(await fetch(`${D2(e)}/qlik-embed/main.js`,{method:"GET",mode:"cors",credentials:"include",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n}`}})).headers.get("Set-Cookie")||void 0,t&&function(e,t){const n=z2(e);a2.set(n,t)}(e,t)}if(!t)throw new Error("Failed to exchange access token for cookie");return t}var l2={requiredProps:[],optionalProps:["loginUri","crossSiteCookies","getAccessToken"],validateHostConfig:e=>{if("function"==typeof e.getAccessToken)return!0;if("string"==typeof e.getAccessToken){if(!globalThis[e.getAccessToken])throw new g2('The "getAccessToken" function name provided does not exist on globalThis.');return!0}throw new g2('The "getAccessToken" property must be a function or the name of a globally defined function.')},getRestCallAuthParams:async function({hostConfig:e}){return{queryParams:{xrfkey:i2(e)},headers:{Cookie:await s2(e),"X-Qlik-XrfKey":i2(e)},credentials:G1(e)}},getWebSocketAuthParams:async function({hostConfig:e}){return{queryParams:{"qlik-csrf-token":await W1(e,!0)},headers:{Cookie:await s2(e)}}},handleAuthenticationError:async function({hostConfig:e}){return function(e){const t=z2(e);a2.delete(t)}(e),{retry:!0}}};var c2={requiredProps:["pfx"],optionalProps:["passphrase","userHeader"],getRestCallAuthParams:function({hostConfig:e}){return Promise.resolve({headers:{},queryParams:{},credentials:"omit",pfxOptions:{pfx:e?.pfx,passphrase:e?.passphrase}})},getWebSocketAuthParams:async function({hostConfig:e}){if(Kb())throw new Error("Not supported in browser environment");const t=e?.userHeader||"UserDirectory=INTERNAL; UserId=sa_engine";return Promise.resolve({headers:{"X-Qlik-User":t},pfxOptions:{pfx:e?.pfx,passphrase:e?.passphrase||""}})},handleAuthenticationError:function(){return Promise.resolve({})}};const u2={};let d2=Promise.resolve(),f2=!1;function h2(e,t){u2[e.toLowerCase()]=t}async function p2(e){const t=H2(e),n=await m2(t);d2&&await d2;let r=function(e){return u2[e.toLowerCase()]}(n);if(r||(d2=(async()=>{r=await async function(e){const t=globalThis[e];if(t){let n;if(n="function"==typeof t?await t():t,n&&n.getRestCallAuthParams&&n.getWebSocketAuthParams&&n.handleAuthenticationError)return n;throw console.error("Not a valid auth module",n),new v2(e)}return Promise.resolve(void 0)}(n),r&&h2(n,r)})(),await d2),!r)throw new v2(n);return r.validateHostConfig?r.validateHostConfig({authType:n,...t}):function(e,{requiredProps:t,optionalProps:n}){const r=[];for(const n of t)e[n]||r.push(n);if(r.length>0)throw new g2(`missing required properties in host config; '${r.join("', '")}'`);const i=[...m0,...t,...n],o=[];Object.keys(e).forEach(e=>{i.includes(e)||o.push(e)}),o.length>0&&console.warn(`WARNING: unknown properties in host config; '${o.join("', '")}'`)}({authType:n,...t},{requiredProps:r.requiredProps||[],optionalProps:r.optionalProps||[]}),r}async function m2(e){return e.authType?e.authType:e.apiKey?"apikey":e.accessCode?"anonymous":e.clientId?"oauth2":e.webIntegrationId?"cookie":e.reference?"reference":e.pfx?"pfx":await T2(e)?"windowscookie":"cookie"}f2||(h2("apikey",v1),h2("cookie",X1),h2("none",Z1),h2("noauth",J1),h2("oauth2",t2),h2("anonymous",y1),h2("pfx",c2),Kb()?h2("windowscookie",o2):h2("windowscookie",l2),h2("reference",n2),f2=!0);var g2=class extends Error{constructor(e){super(`Invalid host config: ${e}`),this.name="InvalidHostConfigError"}},y2=class extends Error{constructor(...e){const t=e.map((e,t)=>0===t?`"${e}"`:`or "${e}"`).join(" ");super(`HostConfig is not properly configured. authType is expected to be ${t}`),this.name="UnexpectedAuthTypeError"}},v2=class extends Error{constructor(e){super(`Not a valid auth type: ${e}, valid auth types are; '${Object.keys(u2).filter(e=>"qmfeembedframerauthmodule"!==e.toLowerCase()).join("', '")}'`),this.name="InvalidAuthTypeError"}};function b2({title:e,detail:t,code:n,status:r}){return t?`${e} - ${t} (Status: ${r}, Code: ${n})`:`${e} (Status: ${r}, Code: ${n})`}var x2=class extends Error{errors;constructor(e){if("object"!=typeof e)return void super("Unknown error");const t=Array.isArray(e)?e:[e];super(t.map(b2).join(", ")),this.errors=t}};const S2=new Map;let M2,w2="";function k2(e){const t=N0(e);let n=S2.get(t);return n||(n={listeners:new Set},S2.set(t,n)),n}function E2(e,t){if(e===M2&&t.message===w2)return;M2=e,w2=t.message;let n=!1;const r=k2(e);for(const e of r.listeners)try{n=!0,e(t)}catch(e){console.warn("Error in auth error listener",e)}if(e.onAuthFailed)try{n=!0,e.onAuthFailed(t)}catch(e){console.warn("Error in onAuthFailed callback",e)}n||console.error(t.message)}function C2(e){return m2(e)}function N2(e){if(!globalThis.location?.origin)return!0;const t=H2(e);if(0===Object.keys(t).length)return!1;try{return new URL(D2(t)).origin!==globalThis.location.origin}catch{}return!1}async function T2(e){const t=H2(e);return"boolean"==typeof t.forceIsWindows?t.forceIsWindows:!(t.host?.endsWith(".qlik-stage.com")||t.host?.endsWith(".qlikcloud.com")||t.host?.endsWith(".qlikcloudgov.com"))&&("cookie"!==t.authType&&("windowscookie"===t.authType||(await(async(e={})=>{const t=H2(e.hostConfig);if("mock-backend-rest-recorder"===t.authType)return t.recordGetPlatform();if("mock-backend"===t?.authType)return t.mockGetPlatform();if("noauth"===t?.authType)return x0({isUnknown:!0});let n=Kb()?window.QlikMain?.PRODUCT_INFO:void 0;if(!n){const{data:t,status:r}=await v0(e);if(n=t,404===r)return x0({isUnknown:!0});if(!n||r<=399&&r>=300)return x0({isQSE:!0,isWindows:!0})}const r=(n.composition?.deploymentType||"").toLowerCase();return"qliksenseserver"===r?x0({isQSE:!0,isWindows:!0,meta:b0(n)}):"qliksensedesktop"===r?x0({isQSD:!0,isWindows:!0,meta:b0(n)}):"qliksensemobile"===r?x0({isQSE:!0,isWindows:!0,meta:b0(n)}):"cloud-console"===r?x0({isCloud:!0,isCloudConsole:!0,meta:b0(n)}):"fedramp"===n.composition?.provider?x0({isCloud:!0,isQCG:!0,meta:b0(n)}):x0({isCloud:!0,isQCS:!0,meta:b0(n)})})({hostConfig:e})).isWindows))}function D2(e){const t=H2(e)?.host?.trim();let n;for(n=t?t.toLowerCase().startsWith("https://")||t.toLowerCase().startsWith("http://")?t:`https://${t}`:"";"/"===n[n.length-1];)n=n.substring(0,n.length-1);return n}function q2(e){const t=H2(e)?.host;let n;for(n=t?t.toLowerCase().startsWith("https://")||t.toLowerCase().startsWith("http://")?t:`https://${t}`:globalThis.location.origin;"/"===n[n.length-1];)n=n.substring(0,n.length-1);return n.replace(V2,"ws")}async function O2(e){const t=H2(e.hostConfig);try{return await(await p2(t)).getWebSocketAuthParams({...e,hostConfig:t})}catch(e){throw E2(t,U2(e)),e}}async function I2(e){const t=H2(e.hostConfig);try{return await((await p2(t)).getWebResourceAuthParams?.({...e,hostConfig:t}))||{queryParams:{}}}catch(e){throw E2(t,U2(e)),e}}async function A2(e){const t=H2(e.hostConfig),n=await(await p2(t)).handleAuthenticationError({...e,hostConfig:t}),r=e.canRetry&&n.retry,i=n.preventDefault;if(!r&&!i){const{status:n,errorBody:r}=e;E2(t,function({errorBody:e,status:t}){const n=e;return"object"==typeof n?.errors?{message:new x2(n?.errors).message}:{message:`HTTP ${t}`}}({status:n,errorBody:r}))}return n}async function _2(e){const t=H2(e.hostConfig);try{return await(await p2(t)).getRestCallAuthParams({...e,hostConfig:t})}catch(e){throw E2(t,U2(e)),e}}function L2(e,t){h2(e,t)}function P2(e){!function(e){D0("default",e||{})}(e)}function R2(e,t){D0(e,t)}function F2(e){!function(e){T0.has(e)?T0.delete(e):console.warn(`unregisterHostConfig: Host config with name "${e}" not found.`)}(e)}function z2(e){return N0(e)}function j2(e){return function(e){const t=e||w0,n=N0(t);let r=k0.get(n);return r||(r=E0(H2(t)),k0.set(n,r)),r}(e)}globalThis.loggingOut=!1;const $2=()=>{globalThis.loggingOut=!0,globalThis.location.href="/logout"},V2=/^http/;function U2(e){return{message:e.message||"Unknown error"}}function H2(e){if(e?.reference){const t=q0(e.reference);if(!t)throw new g2(`Host config with name "${e.reference}" not found.`);return t}return e&&Object.keys(e).length>0?e:O0()}function B2(){return O0()}function W2(e,t){return function(e,t){const n=k2(e);return n.listeners.add(t),()=>{n.listeners.delete(t)}}(e,t)}function Y2(e,t){return function(e,t){const n=A0(e);return n.redirectRequestedListeners.add(t),()=>{n.redirectRequestedListeners.delete(t)}}(e,t)}function G2(e,t){return function(e,t){const n=A0(e);return n.redirectStartedListeners.add(t),()=>{n.redirectStartedListeners.delete(t)}}(e,t)}let K2;K2=function(){const e=[...K2?.getInterceptors()||[]];return{addInterceptor:t=>(e.push(t),t),removeInterceptor:t=>{const n=e.indexOf(t);let r;return-1!==n&&(r=e.splice(n,1)[0]),r||null},getInterceptors:()=>e}}();const X2={determineAuthType:C2,getDefaultHostConfig:B2,getRestCallAuthParams:_2,getWebResourceAuthParams:I2,getWebSocketAuthParams:O2,handleAuthenticationError:A2,isHostCrossOrigin:N2,isWindows:T2,logout:$2,registerAuthModule:L2,registerHostConfig:R2,serializeHostConfig:z2,setDefaultHostConfig:P2,toValidLocationUrl:D2,toValidWebsocketLocationUrl:q2,unregisterHostConfig:F2,normalizeHostConfig:j2,onFatalAuthError:W2,onPageRedirectRequested:Y2,onPageRedirectStarted:G2};var J2=Object.freeze({__proto__:null,AuthorizationError:x2,InvalidAuthTypeError:v2,InvalidHostConfigError:g2,UnexpectedAuthTypeError:y2,default:X2,determineAuthType:C2,getAccessToken:async function(e){const t=(await _2({method:"GET",...e})).headers?.Authorization;if(0===t.indexOf("Bearer "))return t.substring(7);throw new Error("Unknown format of authorization header returned by remote auth module")},getDefaultHostConfig:B2,getRestCallAuthParams:_2,getWebResourceAuthParams:I2,getWebSocketAuthParams:O2,handleAuthenticationError:A2,isHostCrossOrigin:N2,isWindows:T2,logout:$2,normalizeHostConfig:j2,onFatalAuthError:W2,onPageRedirectRequested:Y2,onPageRedirectStarted:G2,registerAuthModule:L2,registerHostConfig:R2,serializeHostConfig:z2,setDefaultHostConfig:P2,toValidLocationUrl:D2,toValidWebsocketLocationUrl:q2,unregisterHostConfig:F2}),Z2=Object.freeze({__proto__:null});return function(e){return function(e){if(e&&e.get&&e.add){const t="Object.Disclaimer.LimitedData";if(e.get(t)!==t)return;Object.keys(i).forEach(t=>{e.add(i[t])})}}(e.translator),{ext:Zy(e),qae:Qy(e),component(){const t=xG({env:e}),n=EZ({core:t});h0({core:t,services:n,bootstrapped:rx({core:t,services:n})})}}}});
