@nebula.js/sn-pie-chart 2.9.0 → 2.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api-specifications/properties.json +1 -1
- package/core/esm/index.js +2 -2
- package/core/package.json +2 -2
- package/dist/sn-pie-chart.js +10 -10
- package/dist/sn-pie-chart.systemjs.js +2 -2
- package/package.json +11 -11
- package/sn-pie-chart-ext/dist/sn-pie-chart.js +10 -10
- package/sn-pie-chart-ext/sn-pie-chart.qext +1 -1
package/core/esm/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @nebula.js/sn-pie-chart v2.
|
|
2
|
+
* @nebula.js/sn-pie-chart v2.11.0
|
|
3
3
|
* Copyright (c) 2026 QlikTech International AB
|
|
4
4
|
* Released under the MIT license.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import e from"hammerjs";import t from"picasso.js";import n from"picasso-plugin-q";import r from"picasso-plugin-hammer";import i,{useState as o,useEffect as a,useRef as s}from"react";import{styled as l,Button as c,ListItemButton as u,ListItemIcon as p,Divider as d,createTheme as f,SvgIcon as m,ThemeProvider as h,Popover as y,List as g,ListItemText as v}from"@mui/material";import b from"react-dom";import{useOptions as x,useElement as q,useSelections as D,useState as S,useLayout as C,useTranslator as w,useAction as E,useEffect as I,useModel as A,useApp as M,useStaleLayout as L,usePlugins as k,useConstraints as T,useTheme as N,useAppLayout as O,useEmbed as P,usePromise as F,useRect as R,onTakeSnapshot as j,useImperativeHandle as H}from"@nebula.js/stardust";var z={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 V(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var _,$,B={exports:{}},U={},W=($||($=1,B.exports=function(){if(_)return U;_=1;var e=i,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function s(e,n,i){var s,l={},c=null,u=null;for(s in void 0!==i&&(c=""+i),void 0!==n.key&&(c=""+n.key),void 0!==n.ref&&(u=n.ref),n)r.call(n,s)&&!a.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:o.current}}return U.Fragment=n,U.jsx=s,U.jsxs=s,U}()),B.exports),K=({className:e,title:t,path:n,fillRule:r})=>W.jsxs(m,{className:e,viewBox:"0 0 16 16",fontSize:"small",role:"img",style:{height:12,width:12},children:[W.jsx("path",{d:n}),t?W.jsx("title",{children:t}):void 0,r?W.jsx("use",{fillRule:r}):void 0]}),Y={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)"}}}};const G={L:new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),R:new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞יִײַ-ﬨשׁ-ﭏ]"),AL:new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]")},J=e=>G.L.test(e),Z=e=>G.R.test(e)||G.AL.test(e);function X(e){const t=e?e.length:0;let n;for(let r=0;r<t;r++){if(n=e[r],J(n))return"ltr";if(Z(n))return"rtl"}return"ltr"}const Q=l(c,{shouldForwardProp:e=>"direction"!==e&&"padding"!==e&&"styling"!==e})(({direction:e,padding:t,styling:n})=>{const{fontSize:r,fontFamily:i,color:o}=n;return{fontWeight:"normal",lineHeight:"normal",fontSize:`${r} !important`,fontFamily:`${i} !important`,color:`${o} !important`,height:"100%",minWidth:"0px",maxWidth:"640px",padding:t,"&:disabled":{color:o,opacity:1},"& .MuiButton-startIcon":{margin:"ltr"===e?"0 2px":void 0},"& .MuiButton-endIcon":{margin:"rtl"===e?"0 2px":void 0}}}),ee=l(({className:e})=>W.jsx(K,{className:e,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"}))(()=>({color:Y.STYLE.ICONS.COLOR.SECONDARY,marginTop:"1px"})),te=l(({className:e})=>W.jsx(K,{className:e,path:"m8 9 4.5-4.5L14 6l-4.5 4.5L8 12 2 6l1.5-1.5L8 9Z"}))(()=>({color:Y.STYLE.ICONS.COLOR.SECONDARY,marginTop:"1px","&.disabled":{color:Y.STYLE.ICONS.COLOR.DISABLED,opacity:.6}}));var ne=({isOpen:e,onClick:t,popoverId:n,source:r})=>{const{styling:i}=r,{text:o}=r.info,{direction:l}=r.layout,{allowed:c,hasAlternatives:u,hasCyclic:p,hasMultiple:d,index:f,isCyclic:m,isLocked:h}=r.meta,{translator:y}=r.resources,{focus:g}=r.services,{isDisabled:v}=r.settings,{inSelections:b}=r.state,x=!(!c.change||!u),q=!(!c.reload||!m),D=(x||q)&&!b&&!v(),S={pointerEvents:D?"auto":"none"},C=function({allowed:e,canChange:t,canReload:n,direction:r,hasCyclic:i,hasMultiple:o,isLocked:a}){const s={top:"8px",right:"6px",bottom:"8px",left:"6px"};if(!o)return`${s.top} ${s.right} ${s.bottom} ${s.left}`;const l=i&&e.reload;return"ltr"===r&&(a?s.left="0px":n||!t&&l?s.left="4px":t||(s.left="2px"),t||n||(s.right="0px")),"rtl"===r&&(a?s.right="0px":n||!t&&l?s.right="4px":t||(s.right="2px"),t||n||(s.left="0px")),`${s.top} ${s.right} ${s.bottom} ${s.left}`}({allowed:c,canChange:x,canReload:q,direction:l,hasCyclic:p,hasMultiple:d,isLocked:h}),w={["rtl"===l?"endIcon":"startIcon"]:h&&W.jsx(ee,{height:12}),["rtl"===l?"startIcon":"endIcon"]:(x||q)&&W.jsx(te,{className:b||v()?"disabled":""})},E=s(),I=s();a(()=>{e||g.shouldFor(f)&&(E.current.focus(),I.current.focusVisible())});const A=X(o),M=`Accessibility.${D?"Alternative":"Normal"}.Instructions`;return W.jsx(Q,{action:I,"aria-describedby":n,"aria-label":y.get(M),color:"inherit",direction:l,disabled:!D||v()||b,onClick:e=>{D&&t(e)},padding:C,ref:E,style:S,styling:i.title,title:o,...w,children:W.jsx("span",{dir:A,style:Y.STYLE.ELLIPSIS,children:o})})},re=({className:e,title:t})=>W.jsx(K,{className:e,title:t,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"});const ie=l(c,{shouldForwardProp:e=>"direction"!==e&&"isFirst"!==e&&"isLast"!==e&&"styling"!==e})(({direction:e,isFirst:t,isLast:n,styling:r})=>{const{color:i}=r;return{fontWeight:"normal",lineHeight:"normal",color:i,height:"24px",width:"24px",padding:0,marginLeft:"ltr"!==e||t?void 0:"4px",marginRight:"rtl"!==e||n?void 0:"4px","&:disabled":{color:i,opacity:1}}}),oe=l(re,{shouldForwardProp:e=>"direction"!==e&&"isFirst"!==e&&"isLast"!==e})(({direction:e,isFirst:t,isLast:n})=>({color:Y.STYLE.ICONS.COLOR.PRIMARY,marginTop:"1px",marginLeft:"ltr"!==e||t?void 0:"4px",marginRight:"rtl"!==e||n?void 0:"4px"})),ae=l(({className:e,title:t})=>W.jsx(K,{className:e,title:t,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"}),{})(()=>({color:Y.STYLE.ICONS.COLOR.SECONDARY,"&.disabled":{color:Y.STYLE.ICONS.COLOR.DISABLED}}));var se=({source:e})=>{if(!e.meta.isCyclic)return null;const[t,n]=o(!1),{styling:r}=e,{stepCycle:i}=e.action,{position:s,tooltip:l}=e.info,{direction:c}=e.layout,{allowed:u,isFirst:p,isLast:d}=e.meta,{isDisabled:f}=e.settings,{inSelections:m}=e.state;return a(()=>{t&&n(!1)},[s]),u.reload?W.jsx(ie,{direction:c,disabled:t||m||f(),isFirst:p,isLast:d,onClick:()=>(n(!0),void i()),styling:r.title,title:l,variant:"outlined",children:W.jsx(ae,{className:t||m||f()?"disabled":""})}):W.jsx(oe,{direction:c,isFirst:p,isLast:d,style:{flexShrink:0},title:l})},le=({className:e,title:t})=>W.jsx(K,{className:e,title:t,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"});const ce=l(c,{shouldForwardProp:e=>"styling"!==e})(({styling:e})=>{const{fontSize:t,fontFamily:n,color:r}=e;return{fontWeight:"normal",lineHeight:"normal",fontSize:`${t} !important`,fontFamily:`${n} !important`,color:`${r} !important`,padding:"0px 5px",height:"100%",minWidth:"45px","&:disabled":{color:r}}}),ue={color:Y.STYLE.ICONS.COLOR.SECONDARY,marginTop:"1px","&.disabled":{color:Y.STYLE.ICONS.COLOR.DISABLED}},pe=l(({className:e})=>W.jsx(K,{className:e,path:"M8.5 8 4 3.5 5.5 2l6 6-6 6L4 12.5 8.5 8z"}))(()=>ue),de=l(({className:e})=>W.jsx(K,{className:e,path:"m7 8 4.5 4.5L10 14 4 8l6-6 1.5 1.5z"}))(()=>ue),fe=l(le,{shouldForwardProp:e=>"direction"!==e&&"isFirst"!==e&&"isLast"!==e})(({direction:e,isFirst:t,isLast:n})=>({color:Y.STYLE.ICONS.COLOR.PRIMARY,marginTop:"1px",marginLeft:"ltr"!==e||t?void 0:"4px",marginRight:"rtl"!==e||n?void 0:"4px"}));var me=({source:e})=>{if(!e.meta.isDrillDown)return null;const{styling:t}=e,{drillUp:n}=e.action,{breadcrumbs:r,tooltip:i}=e.info,{direction:o}=e.layout,{isFirst:a,isLast:s}=e.meta,{isDisabled:l}=e.settings,{inSelections:c}=e.state,u=l()||c?"disabled":null,p={["rtl"===o?"startIcon":"endIcon"]:"rtl"===o?W.jsx(de,{className:u}):W.jsx(pe,{className:u})},d=r.map((e,i)=>{const o=X(e);return W.jsx(ce,{disabled:l()||c,onClick:()=>(e=>{n({steps:r.length-e})})(i),styling:t.title,title:e,...p,children:W.jsx("span",{dir:o,style:Y.STYLE.ELLIPSIS,children:e})},`breadcrumb-${e}`)});return W.jsxs(W.Fragment,{children:["rtl"===o?d.reverse():void 0,W.jsx(fe,{direction:o,isFirst:a,isLast:s,style:{flexShrink:0},title:i}),"rtl"===o?void 0:d]})};const he=l(u,{shouldForwardProp:e=>"nested"!==e&&"rtl"!==e})(({nested:e,rtl:t})=>({padding:`4px ${e&&t?"32px":"16px"} 4px ${e&&!t?"32px":"16px"}`,"&:focus":{...Y.STYLE.FOCUS}})),ye=l(p)(()=>({marginRight:0,justifyContent:"center"})),ge=l(({className:e})=>W.jsx(K,{className:e,path:"m6 10 7-7 2 2-7 7-2 2-5-5 2-2 3 3Z"}))(()=>({color:Y.STYLE.ICONS.COLOR.SECONDARY})),ve=l(re)(()=>({color:Y.STYLE.ICONS.COLOR.SECONDARY})),be=l(le)(()=>({color:Y.STYLE.ICONS.COLOR.SECONDARY,fontWeight:600})),xe=({meta:e,selected:t})=>t?W.jsx(ge,{height:12}):e?.isCyclic?W.jsx(ve,{height:12}):e?.isDrillDown?W.jsx(be,{height:12}):void 0;var qe=({id:e,meta:t,nested:n,onClick:r,selected:o,source:a,text:s})=>{const{styling:l}=a,{isRTL:c}=a.settings,u={fontWeight:!t||t.isNormal?"normal":600,lineHeight:"normal",fontSize:l.popover.fontSize,fontFamily:l.popover.fontFamily,color:l.popover.color,textAlign:c?"end":"start",...Y.STYLE.ELLIPSIS},p=X(s),d=W.jsx(ye,{sx:c?{paddingRight:"12px"}:{paddingLeft:"12px"},children:xe({meta:t,selected:o})});return W.jsx(i.Fragment,{children:W.jsxs(he,{autoFocus:o,nested:n,onClick:e=>r?.(e),rtl:c,title:s,children:[c&&d,W.jsx(v,{dir:p,primaryTypographyProps:{style:u},children:s}),!c&&d]})},e)};const De=l(d)(()=>({marginTop:"-1px"}));var Se,Ce,we,Ee,Ie=({anchor:e,id:t,onClose:n,open:r,source:o})=>{const{changeTo:a,drillUp:l,setActiveField:c}=o.action,{breadcrumbs:u,group:p,id:d,text:f}=o.info,{alternatives:m}=o.data,{index:h,isCyclic:v,isDrillDown:b}=o.meta,{translator:x}=o.resources,{focus:q}=o.services,D={isChanging:!1},S=s(),C=()=>{const e=document.activeElement;S?.current?.contains(e)&&e.blur(),n()},w=v||b,E=W.jsx(qe,{id:d,meta:o.meta,onClick:C,selected:!w,source:o,text:w?p.name:f},d),I=w&&p.items.map(e=>W.jsx(qe,{id:e.id,nested:!0,onClick:t=>((e,t)=>{D.isChanging||(D.isChanging=!0,"keydown"!==e.type&&"keyup"!==e.type||q.queueFor(h),v&&c({fieldIndex:t.index}),b&&l({steps:u.length-t.index}))})(t,e),selected:e.current,source:o,text:e.text})),A=m.map((e,t)=>W.jsxs(i.Fragment,{children:[W.jsx(qe,{id:e.id,meta:e.meta,onClick:t=>{return n=t,r=e.id,void(D.isChanging||(D.isChanging=!0,"keydown"!==n.type&&"keyup"!==n.type||q.queueFor(h),a({id:r})));var n,r},source:o,text:e.text},e.id),t<m.length-1&&W.jsx(De,{},`divider-${e.id}`)]},e.id));return W.jsx(y,{anchorEl:e,anchorOrigin:{vertical:"top",horizontal:"center"},disableRestoreFocus:!0,id:t,onClose:C,open:r,ref:S,slotProps:{paper:{style:{minWidth:"250px",maxWidth:"640px",maxHeight:"300px"}}},transformOrigin:{vertical:"bottom",horizontal:"center"},children:W.jsxs(g,{"aria-label":x.get("Accessibility.Popover.Instructions"),dense:!0,children:[E,I,W.jsx(De,{},`divider-${d}`),A]})})},Ae=({source:e})=>{const[t,n]=o(null),r={id:t?"alternatives-popover":void 0,isOpen:Boolean(t)},{direction:i}=e.layout,{index:s}=e.meta,{focus:l}=e.services,c=()=>{n(null)};a(()=>{r.isOpen&&c()},[e.info.key]);const u=W.jsx(se,{source:e}),p=W.jsx(me,{source:e});return W.jsxs(W.Fragment,{children:["rtl"===i?void 0:p,"rtl"===i?void 0:u,W.jsx(ne,{onClick:e=>{const{currentTarget:t}=e;t.classList.contains("qcm-focus-visible")&&l.queueFor(s),n(t)},isOpen:r.isOpen,popoverId:r.id,source:e}),W.jsx(Ie,{anchor:t,id:r.id,onClose:c,open:r.isOpen,source:e}),"rtl"===i?p:void 0,"rtl"===i?u:void 0]})},Me=function(){if(Ce)return Se;Ce=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 Se=function e(){var t,n,r,l,c,u,p=arguments[0],d=1,f=arguments.length,m=!1;for("boolean"==typeof p&&(m=p,p=arguments[1]||{},d=2),(null==p||"object"!=typeof p&&"function"!=typeof p)&&(p={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=s(p,n),p!==(l=s(t,n))&&(m&&l&&(o(l)||(c=i(l)))?(c?(c=!1,u=r&&i(r)?r:[]):u=r&&o(r)?r:{},a(p,{name:n,newValue:e(m,u,l)})):void 0!==l&&a(p,{name:n,newValue:l}));return p},Se}(),Le=V(Me),ke={},Te=V((we||(we=1,Ee=ke,(()=>{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,p=arguments[0],d=1,f=arguments.length,m=!1;for("boolean"==typeof p&&(m=p,p=arguments[1]||{},d=2),(null==p||"object"!=typeof p&&"function"!=typeof p)&&(p={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=l(p,n),p!==(i=l(t,n))&&(m&&i&&(a(i)||(c=o(i)))?(c?(c=!1,u=r&&o(r)?r:[]):u=r&&a(r)?r:{},s(p,{name:n,newValue:e(m,u,i)})):void 0!==i&&s(p,{name:n,newValue:i}));return p}}},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:()=>Me});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 p(e){return c+e+u}function d(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 f(e){return!(!e.fullAccumulation&&!e.fullRange)}function m(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 y(){return"[$(=Replace(GetObjectField(".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,"),']',']]'))]")}function g(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 q(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(d(r[0],i),y(0));return"".concat(a,"({1<").concat(c,">}").concat(l,")")}if(r&&2===r.length){var u=d(r[0],i),p=d(r[1],i),f=y(0),m=y(1),h=x(u,f),g=x(p,m);return"".concat(a,"({1<").concat(h,",").concat(g,">}").concat(l,")")}return"".concat(a,"({1}").concat(l,")")}function D(e){return"".concat(e,"(")}function S(e){var t=e.properties,n=e.layout;return s(t,"qHyperCubeDef.qDimensions",s(n,"qHyperCube.qDimensionInfo",[])).length}const C={isFullRange:f,getNumDimensions:S,getExpressionWithExcludedComp:function(e){var t=e.expression,n=e.modifier,r=e.dimensions,i=e.dimensionAndFieldList,o=e.treatMissingAsNull,a=p(h(t));if(!n.showExcludedValues)return a;var s=q({modifier:n,dimensions:r,dimensionAndFieldList:i}),l=o?"":", 0";if(r&&1===r.length){var c=y(0);return"If(Count(".concat(c,") > 0, ").concat(a," + ").concat(s).concat(l,")")}if(r&&2===r.length){var u=y(0),d=y(1);return"If(Count(".concat(u,") * Count(").concat(d,") > 0, ").concat(a," + ").concat(s).concat(l,")")}return a},getRowNoComp:m,getNumStepComp:function(e,t){if(!f(e)){var n=e.steps;return"number"!=typeof n||Number.isNaN(n)?6:n}return m(e,t)},getAboveCompPrefix:g,getAboveCompSuffix:v,getAboveComp:function(e,t,n,r){return g(e,t)+n+v(r)},getFunctionPrefix:D,getFunctionSuffix:function(){return")"},getRangeComp:function(e,t){return D(e)+t+")"},getAggrComp:function(e,t,n){return"Aggr(".concat(e,", ").concat(t,", ").concat(n,")")},getExcludedComp:q,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===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=y(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(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:d,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:p,canExtract:function(e){var t=e.indexOf(c),n=e.indexOf(u);return t>-1&&n>-1&&t<n},getDimDefWithWrapper:y,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 w(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 E(e){return E="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},E(e)}var I=o().bind(null,!0),A={},M=Array.isArray;function L(e){return null!=e&&!Array.isArray(e)&&"object"===E(e)}function k(e){return void 0===e}function T(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function N(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]=k(e[n||t])?o:e[t],e=e[n||t]}}),e}function O(e,t){var n=!0;if(L(e)&&L(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach(function(r){O(e[r],t[r])||(n=!1)}),n);if(M(e)&&M(t)){if(e.length!==t.length)return!1;for(var r=0,i=e.length;r<i;r+=1)if(!O(e[r],t[r]))return!1;return!0}return e===t}A.generate=function(e,t,n){n=n||"";var r=[];return Object.keys(t).forEach(function(i){var o=function(e){return e?I({},{val:e}).val:e}(t[i]),a=e[i],s="".concat(n,"/").concat(i);O(o,a)||T(t,i)||(k(a)?r.push({op:"add",path:s,value:o}):L(o)&&L(a)?r=r.concat(A.generate(a,o,s)):M(o)&&M(a)?r=r.concat(function(e,t,n){var r=[],i=e.slice(),o=-1;function a(e,t,n){if(e[n]&&k(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(O(t,i))return r;if(!k(t[0])&&k(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(A.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){k(t[i])&&!T(e,i)&&r.push({op:"remove",path:"".concat(n,"/").concat(i)})}),r},A.apply=function(e,t){t.forEach(function(t){var n,r,i=N(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(M(i))"-"===o&&(o=i.length),i.splice(+o,"add"===t.op?0:1,t.value);else if(M(a)&&M(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={}.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(L(a)&&L(t.value))n=a,Object.keys(n).forEach(function(e){Object.getOwnPropertyDescriptor(n,e).configurable&&!T(n,e)&&delete n[e]}),I(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=N(e,t.from);M(i)?i.splice(+o,0,u.splice(+s,1)[0]):(i[o]=u[s],delete u[s])}else"remove"===t.op&&(M(i)?i.splice(+o,1):delete i[o])})},A.clone=function(e){return I({},e)},A.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},A.updateObject=function(e,t){Object.keys(e).length?A.apply(e,A.generate(e,t)):I(e,t)};const P=A;var F="accumulation";function R(e,t){var n=s(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===F)return n[r]}function j(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===F)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var H={type:"accumulation",disabled:!1,accumulationDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullAccumulation:!1,steps:6,outputExpression:""};const z={translationKey:"properties.modifier.accumulation",needDimension:C.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return C.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=C.getNumDimensions({properties:r,layout:i}));var c=s(r,"qHyperCubeDef.qDimensions",[]),u=C.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),p=C.getNumStepComp(n,l),d=C.getAboveComp(n,l,u,p),f=C.getRangeComp("RangeSum",d);if(C.needDimension({modifier:n,properties:r,layout:i})){var m=C.getDimComp(c,1),h=C.getDimComp(c,0),y=C.getAggrComp(f,m,h);f=n.showExcludedValues?C.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:a,valueComp:y}):y}return f},extractInputExpression:C.extractInputExpression,initModifier:function(e){C.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.accumulation.disclaimer",show:function(e,t){return!C.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(j(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(j(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(j(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(j(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(j(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return C.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(F))return!1;var o=R(t,e);return o&&!o.disabled}}}};var V="movingAverage";function _(e,t){var n=s(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===V)return n[r]}function $(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===V)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var B={type:"movingAverage",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullRange:!1,steps:6,outputExpression:"",nullSuppression:!1};const U={translationKey:"properties.modifier.movingAverage",needDimension:C.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return C.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=C.getNumDimensions({properties:i,layout:o}));var u=s(i,"qHyperCubeDef.qDimensions",[]),p=r.showExcludedValues&&r.nullSuppression,d=C.getExpressionWithExcludedComp({expression:n,modifier:r,dimensions:u,dimensionAndFieldList:l,treatMissingAsNull:p}),f=C.getNumStepComp(r,c),m=C.getAboveComp(r,c,d,f);if(r.nullSuppression)t=C.getRangeComp("RangeAvg",m);else{var h=C.getRangeComp("RangeSum",m),y=function(e,t){var n=C.getRowNoComp(e,t);if(!C.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(h," / ").concat(y)}var g=t;if(C.needDimension({modifier:r,properties:i,layout:o})){var v=C.getDimComp(u,1),b=C.getDimComp(u,0),x=C.getAggrComp(g,v,b);g=r.showExcludedValues?C.getExcludedComp({modifier:r,dimensions:u,dimensionAndFieldList:l,funcComp:"Only",valueComp:x}):x}return g},extractInputExpression:C.extractInputExpression,initModifier:function(e){C.initModifier(e,B)},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!C.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat($(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($(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($(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($(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($(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0},nullSuppression:{refFn:function(t){return"".concat($(t,e),".nullSuppression")},type:"boolean",translation:t.showNull||"properties.dimensions.showNull",schemaIgnore:!0,defaultValue:!1,inverted:!0}},show:function(e,t){return C.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(V))return!1;var o=_(t,e);return o&&!o.disabled}}}};var W="timeSeriesDecomposition";function K(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 Y(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 G={type:"timeSeriesDecomposition",disabled:!1,decomposition:"",steps:2,outputExpression:""};const J={translationKey:"properties.modifier.timeSeriesDecomposition",needDimension:C.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return C.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties;return n?C.generateTSDExpression(n,t,r):t},extractInputExpression:C.extractInputExpression,initModifier:function(e,t){C.initModifier(e,G),""===e.decomposition&&t&&(e.decomposition=C.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!C.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:l.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=K(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=K(t,e);return n&&!n.fullRange}}},show:function(e,t){return C.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=K(t,e);return o&&!o.disabled}}}};var Z="difference";function X(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===Z)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:C.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return C.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:C.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=C.getNumDimensions({properties:r,layout:i}));var c=s(r,"qHyperCubeDef.qDimensions",[]),u=C.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),p=C.getAboveComp(n,l,u),d="".concat(u," - ").concat(p);if(C.needDimension({modifier:n,properties:r,layout:i})){var f=C.getDimComp(c,1),m=C.getDimComp(c,0),h=C.getAggrComp(d,f,m);d=n.showExcludedValues?C.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:a,funcComp:"Only",valueComp:h}):h}return d},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!C.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(X(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(X(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(X(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return C.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(Z))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===Z)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(C.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(C.getDimDefWithWrapper(n),">"):""}const ue={translationKey:"properties.modifier.normalization",needDimension:function(){return!0},isApplicable:function(e){var t=e.properties,n=e.layout;return C.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:C.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=C.getNumDimensions({properties:r,layout:i}));var c=s(r,"qHyperCubeDef.qDimensions",[]),u=C.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),p=n.selectionScope,d=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,p=le(i,o),d=ce(i,o,a),f=function(e){for(var t=[],n=0;n<e;n++)t[n]=C.getDimDefWithWrapper(n);return t.join(", ")}(o);return s?"(If(".concat(e," < 0, null(), ").concat(e,"))/ Sum(").concat(u," ").concat(p).concat(d," Aggr(").concat(u," RangeMax( 0, ").concat(e,"), ").concat(f,"))"):"".concat(e,"/ Sum(").concat(u," ").concat(p).concat(d," Aggr(").concat(u," ").concat(e,", ").concat(f,"))")}(u,p,n.field,n.value,d,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!C.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 C.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 pe="library id deleted",de="qDef.qDef",fe="qDef.base.qDef",me="qLibraryId",he="qDef.base.qLibraryId",ye="qDef.qLabel",ge="qDef.qLabelExpression",ve="qDef.base.qLabel",be="qDef.base.qLabelExpression",xe="qDef.qAggrFunc",qe="qDef.base.qAggrFunc",De="qDef.base";const Se={getExpression:function(e){var t=s(e,fe);return void 0!==t?t:s(e,de)},getExpressionRef:function(e){return void 0!==s(e,fe)?fe:de},getLibraryIdRef:function(e){return s(e,he)?he:me},getLibraryId:function(e){return s(e,he)||s(e,me)},getLabelRef:function(e){return s(e,De)?ve:ye},getLabelExpressionRef:function(e){return s(e,De)?be:ge}};var Ce={initBase:function(e,t){(t||Ce.isValid(e))&&(a(e,fe,s(e,de)),a(e,he,s(e,me)),a(e,ve,s(e,ye)),a(e,be,s(e,ge)))},restoreBase:function(e){Ce.isValid(e)&&(a(e,de,s(e,fe)),a(e,me,s(e,he)),a(e,ye,s(e,ve)),a(e,ge,s(e,be)),s(e,xe)&&s(e,qe)&&a(e,xe,s(e,qe)),delete e.qDef.base)},isValid:function(e){var t=s(e,fe),n=s(e,he);return void 0!==t||void 0!==n}};const we=Ce;function Ie(e){return Ie="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},Ie(e)}var Ae={accumulation:z,movingAverage:U,difference:ee,normalization:ue,timeSeriesDecomposition:J};const Me={modifiers:Ae,apply:ke,applyModifiers:Te,cleanUpMeasure:Ne,destroy:function(e){e&&Le[e.id]&&Le[e.id].masterItemSubscriber&&(Le[e.id].masterItemSubscriber&&Le[e.id].masterItemSubscriber.unsubscribe(),delete Le[e.id])},hasActiveModifiers:Oe,getActiveModifier:Pe,initBase:we.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some(function(e){return Ae[e]})},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some(function(e){return Ae[e]&&Ae[e].isApplicable({properties:n,layout:r})})},measureBase:Se,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);Ue({modifiers:t,properties:n,layout:r})&&(i=!0,o=o||Je({modifiers:t,properties:n,layout:r}))}),i&&!o},ifEnableTotalsFunction:Fe};var Le={};function ke(){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;Le[t.id]=Le[t.id]||{isFirstTime:!0};var c=Le[t.id].isFirstTime;if(Le[t.id].isFirstTime=!1,n&&"object"===Ie(n))return Te({model:t,properties:n});var u=t?t.layout:void 0,p=s(u,"qSelectionInfo.qInSelections");if(i||p)return Promise.resolve(l);var d=s(u,"qHyperCube.qMeasureInfo"),f=Le[t.id].lastReloadTime;if(Le[t.id].lastReloadTime=s(t,"app.layout.qLastReloadTime"),Oe({measures:d,layout:u})){var m=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 Be({measure:e,properties:n,layout:r})})}({measures:t,layout:n})}({measures:d,layout:u,model:t,lastReloadTime:f});return m||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 Ue({modifiers:je(t),layout:n})?!t.base:!!t.base}({measure:e,layout:n})}))}({measures:d,layout:u,masterItem:a,isFirstTime:c})?t.getEffectiveProperties().then(function(e){var n=o()(!0,{},e);ze(n);var r=Ze(n);return We({model:t}).then(function(i){return Ke({libraryIds:r,model:t}).then(function(r){return m&&function(e){var t=e.properties;Re(t).forEach(function(e){return function(e){var t=e.measure;if(Be({measure:t,properties:e.properties})){var n=0,r=t.qDef.modifiers;Array.isArray(r)&&r.forEach(function(e){if("object"===Ie(e)&&!e.disabled){if(n++,"object"!==Ie(Ae[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=Ae[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==r&&_e(t)&&C.simplifyExpression(t.qDef.base.qDef)!==C.simplifyExpression(r)&&(t.qDef.base.qDef=r)}})}}({measure:e,properties:t})})}({properties:n}),Te({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"===Ie(e.base)})}(d)?t.getEffectiveProperties().then(function(e){return function(e){var t=e.model,n=e.properties,r=Ze(n);return Xe({model:t,libraryIds:r}).then(function(){var e=o()(!0,{},n);return Re(n).forEach(function(e){return Ne(e)}),Ge({oldProperties:e,newProperties:n,model:t})})}({model:t,properties:e})}):Promise.resolve(l)}function Te(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,p=e.dimensionAndFieldList;void 0===n&&(n=l?o()(!0,{},r):r),ze(r);var d=Ze(r);return Xe({model:t,libraryIds:d,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=Re(n)),!t.length)return Promise.resolve();if(!i&&!Oe({measures:t,properties:n}))return t.forEach(function(e){return Ne(e)}),Promise.resolve();var l=i?void 0:Ze(n);return We({model:r,dimensionAndFieldList:a}).then(function(e){return Ke({libraryIds:l,model:r,libraryItemsProps:i}).then(function(r){t.forEach(function(t){var i=t.qDef.modifiers;r&&Ue({modifiers:i,properties:n})?(function(e){var t=e.measure,n=e.properties,r=e.libraryItemsProps,i=e.dimensionAndFieldList,a=0;we.isValid(t)||we.initBase(t,!0);var l=t.qDef,c=l.modifiers,u=l.base;Array.isArray(c)&&c.forEach(function(e){if("object"===Ie(e)&&!e.disabled){if(a++,"object"!==Ie(Ae[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)");Ae[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:Ae[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 Ae[n.type].updateModifier&&Ae[n.type].updateModifier(n,r.qHyperCubeDef);var a=Se.getExpression(t),s=""===a?a:Ae[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||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")}(t)}})}({measure:t,properties:n,libraryItemsProps:r,dimensionAndFieldList:e}),Ve(t)):Ne(t)})})})}({measures:i,properties:r,model:t,libraryItemsProps:u,dimensionAndFieldList:p}).then(function(){return l?Ge({oldProperties:n,newProperties:r,model:t}):Promise.resolve(!1)})}).catch(function(){return Promise.resolve(!1)})}function Ne(e){!function(e){var t=je(e);return Array.isArray(t)&&t.some(function(e){return"object"===Ie(e)&&!e.disabled&&!Ae[e.type]})}(e)?we.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,Ve(e)}function Oe(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some(function(e){return Ue({modifiers:je(e),properties:n,layout:r})})}function Pe(e){var t=je(e);if(Array.isArray(t))for(var n=0;n<t.length;n++){var r=t[n];if(Ae[r.type]&&!r.disabled)return r}}function Fe(e){var t=Pe(e);return!t||Ae[t.type].enableTotalsFunction(e)}function Re(e){return s(e,"qHyperCubeDef.qMeasures",[]).concat(s(e,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",[]))}function je(e){return e.modifiers||e.qDef&&e.qDef.modifiers}function He(e){return s(e,"outputExpression.qValueExpression.qExpr")||s(e,"outputExpression")}function ze(e){Re(e).forEach(function(e){return function(e){var t=Pe(e);t&&(void 0!==t.outputExpression&&He(t)!==e.qDef.qDef?delete e.qDef.base:!we.isValid(e)&&t.base&&(e.qDef.base=o()(!0,{},t.base)))}(e)})}function Ve(e){var t=je(e);Array.isArray(t)&&t.forEach(function(t){"object"===Ie(t)&&(t.disabled||!Ae[t.type]&&He(t)!==e.qDef.qDef)&&(t.disabled=!0,delete t.base)})}function _e(e){return e.base||e.qDef&&e.qDef.base}function $e(e){var t=_e(e);return e.qLibraryId||t&&t.qLibraryId}function Be(e){var t=e.measure,n=e.properties,r=e.layout;return!$e(t)&&Ue({modifiers:je(t),properties:n,layout:r})}function Ue(e){var t=e.modifiers,n=e.properties,r=e.layout,i={};return Array.isArray(t)&&t.some(function(e){return!("object"!==Ie(e)||e.disabled||!Ae[e.type])&&(void 0===i[e.type]&&(i[e.type]=Ae[e.type].isApplicable({properties:n,layout:r})),i[e.type])})}function We(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}).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=P.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 Je(e){var t=e.modifiers,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some(function(e){return"object"===Ie(e)&&!e.disabled&&Ae[e.type]&&Ae[e.type].needDimension({modifier:e,properties:n,layout:r})})}function Ze(e){var t=Re(e),n=[],r=[],i=!1;return t.forEach(function(t){var r=je(t);if(Ue({modifiers:r,properties:e})){var o=$e(t);o&&n.push(o),i=i||Je({modifiers:r,properties:e})}}),s(e,"qHyperCubeDef.qDimensions",[]).forEach(function(e){var t=e.qLibraryId;t&&r.push(t)}),{measureLibraryIds:n,dimensionLibraryIds:r}}function Xe(e){var t=e.model,n=e.libraryIds,r=e.masterItem;return!r&&r!==pe&&n&&(n.measureLibraryIds.length||n.dimensionLibraryIds.length)?(Le[t.id].masterItemSubscriber=Le[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 p=function(e,t){return e.once("closed",t),function(){return e.removeListener("closed",t)}};function d(e,i){return t.app[i](e).then(function(t){r[e]={listener:t.layoutSubscribe(c),unbindCloseListnener:p(t,function(){return e=t.id,n(pe),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(d(e,"getMeasure"))}),Object.keys(o).forEach(function(e){o[e]&&!r[e]&&s.push(d(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 ke({model:t,masterItem:e}).then(function(){return t.app.clearUndoBuffer()})}}),Le[t.id].masterItemSubscriber.subscribe(n)):Promise.resolve()}for(var Qe in Ee.default=r.default,r)-1===["default"].indexOf(Qe)&&(Ee[Qe]=r[Qe]);Object.defineProperty(Ee,"__esModule",{value:!0})})()),ke));function Ne(e){return Array.isArray(e)}function Oe(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}function Pe(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function Fe(e){return void 0===e}function Re(e,t){if(Oe(e)&&Oe(t)){if(Object.keys(e).length!==Object.keys(t).length)return!1;const n=Object.keys(e);for(let r=0,i=n.length;r<i;r+=1)if(!Re(e[n[r]],t[n[r]]))return!1;return!0}if(Ne(e)&&Ne(t)){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n<r;n+=1)if(!Re(e[n],t[n]))return!1;return!0}return e===t}function je({oldData:e={},newData:t={},basePath:n=""}){const r=[];return Object.keys(t).forEach(i=>{const o=function(e){return e?Le(!0,{},{value:e}).value:e}(t[i]),a=e[i],s=`${n}/${i}`;Re(o,a)||Pe(t,i)||(Fe(a)?r.push({op:"add",path:s,value:o}):Oe(o)&&Oe(a)?r.push(...je({oldData:a,newData:o,basePath:s})):Ne(o)&&Ne(a)?r.push(...(({oldArray:e,newArray:t,basePath:n})=>{const r=[];return Re(t,e.slice())||(!Fe(t[0])&&Fe(t[0].qInfo)||0===t.length)&&r.push({op:"replace",path:n,value:t}),r})({oldArray:a,newArray:o,basePath:s})):r.push({op:"replace",path:s,value:o}))}),Object.keys(e).forEach(i=>{Fe(t[i])&&!Pe(e,i)&&r.push({op:"remove",path:`${n}/${i}`})}),r}async function He({from:e,to:t,model:n,container:r,filtered:i,noModelDependencies:o,skipAttributeExpressions:a,onChange:s}){if(!n)return;const l=await n.getEffectiveProperties(),c=l.qHyperCubeDef[r].findIndex(t=>t.qDef.cId===e),u=l.qHyperCubeDef.qLayoutExclude.qHyperCubeDef[r].findIndex(e=>e.qDef.cId===t),p=Le(!0,{},l),d=p.qHyperCubeDef[r][c],f=p.qHyperCubeDef.qLayoutExclude.qHyperCubeDef[r][u];f.qAttributeDimensions=d.qAttributeDimensions,d.qAttributeDimensions=[],a||(f.qAttributeExpressions=d.qAttributeExpressions,d.qAttributeExpressions=[]),p.qHyperCubeDef[r][c]=f,p.qHyperCubeDef.qLayoutExclude.qHyperCubeDef[r][u]=d,s({fromItem:d,toItem:f,oldProperties:l,newProperties:p,model:n}),await function({model:e,properties:t,noModelDependencies:n}){return n?Te.apply({model:e,properties:t}):e.modifiers?e.modifiers.apply({model:e,properties:t}):Promise.resolve()}({model:n,properties:p,noModelDependencies:o}),o?function({properties:e,container:t,filtered:n}){const{color:r}=e;if(!r)return;const{auto:i,mode:o}=r;if(i)return;const a=n.map(n=>e.qHyperCubeDef[t][n]?.qDef.cId).filter(e=>void 0!==e),s=e.qHyperCubeDef[t].filter(e=>!a.includes(e.qDef.cId));if("byDimension"===o&&"qDimensions"===t){const{byDimDef:e}=r;if(!e)return;const t=void 0===e.activeDimensionIndex?-1:e.activeDimensionIndex;if(t<0)return;const n=s[t];if(!n)return;if(n.qLibraryId)r.byDimDef={type:"libraryItem",key:n.qLibraryId,label:n.qLibraryId,activeDimensionIndex:t};else{const{qDef:e}=n,i=e.qLabelExpression||e.qFieldLabels&&e.qFieldLabels[0]||e.qFieldDefs[0],o=(l=n.qDef.qFieldDefs[0]).split(" ").length>1&&"="!==l[0]&&"["!==l[0]?`[${l}]`:l;r.byDimDef={type:"expression",key:o,label:i||o,activeDimensionIndex:t}}}var l;if("byMeasure"===o&&"qMeasures"===t){const{byMeasureDef:e}=r;if(!e)return;const t=void 0===e.activeMeasureIndex?-1:e.activeMeasureIndex;if(t<0)return;const n=s[t];if(!n)return;const i=Te.measureBase.getLibraryId(n);if(i){r.byMeasureDef={type:"libraryItem",key:i,label:i,activeMeasureIndex:t};const e=Te.hasActiveModifiers({measures:[n]})?n.qDef.qDef:void 0;e&&(r.byMeasureDef.expression=e)}else{const{qDef:e}=n;r.byMeasureDef={type:"expression",key:e.qDef,label:e.qLabelExpression||e.qLabel||e.qDef,activeMeasureIndex:t}}}}({properties:p,container:r,filtered:i}):n.colorSupport&&n.colorSupport.colorByUpdater(p,"qHyperCubeDef."),function({model:e,oldProperties:t,newProperties:n}){const r=je({oldData:t,newData:n});e?.applyPatches&&r?.length&&e.applyPatches(r.map(e=>({qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path})),!0)}({model:n,oldProperties:l,newProperties:p})}function ze({callbacks:e,data:t,resources:n,settings:r}){const{onChange:i}=e,{infos:o,filtered:a}=t,{app:s,model:l,translator:c}=n,{noModelDependencies:u,skipAttributeExpressions:p}=r;return o.map((e,t)=>{const{cId:n,qGrouping:r,qGroupFallbackTitles:o,qGroupPos:d,qFallbackTitle:f,qLocked:m,title:h}=e,y="C"===r,g="H"===r,v="N"===r,b="number"==typeof e.explicitColumn?e.explicitColumn:t,x=(t,n)=>{y&&s&&s.getDimension&&s.getDimension(e.qLibraryId).then(e=>{e?.[t](n)}).catch(()=>{})};return{meta:{isCyclic:y,isDrillDown:g,isLocked:!!m,isNormal:v},info:{id:n,key:`${n}-${d}`,text:v?f:o[d],position:d,breadcrumbs:o.slice(0,e.qGroupPos),group:{name:h,items:o.slice(0,g?e.qGroupPos+1:o.length).map((e,t)=>({id:`${n}-item-${t}`,text:e,current:d===t,index:t}))},tooltip:v?void 0:c.get(y?"Tooltip.dimensions.cyclic":"Tooltip.dimensions.drilldown")},action:{changeTo:({id:e})=>He({from:n,to:e,container:"qDimensions",model:l,filtered:a,noModelDependencies:u,skipAttributeExpressions:p,onChange:i}),drillUp:({steps:e})=>{g&&l&&l?.drillUp("/qHyperCubeDef",b,e)},stepCycle:()=>x("stepCycle",1),setActiveField:({fieldIndex:e})=>x("setActiveField",e)}}})}function Ve({callbacks:e,data:t,resources:n,settings:r}){const{onChange:i}=e,{infos:o,filtered:a}=t,{model:s}=n,{noModelDependencies:l,skipAttributeExpressions:c}=r;return o.map(e=>{const{cId:t,qFallbackTitle:n}=e;return{meta:{isNormal:!0},info:{id:t,key:t,text:n},action:{changeTo:({id:e})=>He({from:t,to:e,container:"qMeasures",model:s,filtered:a,noModelDependencies:l,skipAttributeExpressions:c,onChange:i})}}})}function _e({callbacks:e,data:t,dock:n,key:r,rect:o,resources:a,settings:s,state:l,styling:c}){const u=function({dock:e,rect:t}){const n={pointerEvents:"auto",display:"flex",justifyContent:"center",alignItems:"center",height:"100%"};return"left"!==e&&"right"!==e||(n.width=`${t.height}px`,n.height=`${t.width}px`,n.transformOrigin="top left"),"left"===e&&(n.transform=`rotate(-90deg) translate(-${t.height}px, 0)`),"right"===e&&(n.transform=`rotate(90deg) translate(0, -${t.width}px)`),n}({dock:n,rect:o}),p=function({callbacks:e,data:t,dock:n,key:r,resources:i,settings:o,state:a,styling:s}){const{alternatives:l,infos:c}=t,{app:u,cache:p,model:d}=i,{isRTL:f,isSnapshot:m,noModelDependencies:h,type:y}=o,g=function({dock:e,isRTL:t}){return"top"!==e&&"bottom"!==e||!t?"ltr":"rtl"}({dock:n,isRTL:f}),v=function({cache:e,key:t}){const n="axis-title-auto-focus_"+t;return{queueFor:t=>e?.set?.(n,{focus:!0,index:t}),shouldFor:t=>{const r=e?.get?.(n),i=!(!r?.focus||r?.index!==t);return i&&e?.set?.(n,{focus:!1}),i}}}({cache:p,key:r}),b=("dimension"===y?ze:Ve)({callbacks:e,data:t,resources:i,settings:o});"rtl"===g&&b.reverse();const x={allowed:{change:h?!m:!(!d?.modifiers||!d?.colorSupport||m),reload:!!u&&!m},hasAlternatives:!!l.length,hasCyclic:b.some(e=>e.meta.isCyclic),hasMultiple:c.length>1};return b.map((e,n)=>({data:t,layout:{direction:g},resources:{translator:i.translator},services:{focus:v},settings:o,state:a,styling:s,...e,meta:{...x,...e.meta,index:n,isFirst:0===n,isLast:n===b.length-1}}))}({callbacks:e,data:t,dock:n,key:r,resources:a,settings:s,state:l,styling:c});return W.jsx("div",{style:u,children:p.map(e=>W.jsxs(i.Fragment,{children:[W.jsx(Ae,{source:e}),!e.meta.isLast&&W.jsx("span",{dir:e.layout.direction,style:{...c.title,lineHeight:"normal"},children:", "})]},e.info.id))})}const $e='"Source Sans Pro", "Arial", "sans-serif"',Be="12px",Ue=e=>{const{rect:t,state:n}=e,{callbacks:r,data:i,key:o,layout:a,resources:s,settings:l,style:c}=e.settings;return _e({callbacks:r,data:i,dock:a.dock,key:o,rect:t,resources:s,settings:l,state:n,styling:c})};var We,Ke={renderer:"react",require:["renderer"],disableTriggers:!0,key:"axis-title",defaultSettings:{callbacks:{onChange:()=>{}},data:{alternatives:[],infos:[],filtered:[]},resources:{app:void 0,cache:void 0,model:void 0,selections:void 0,translator:void 0},settings:{isDisabled:()=>!1,isRTL:!1,isSnapshot:!1,noModelDependencies:!1,skipAttributeExpressions:!1,type:"dimension"},style:{title:{color:"#333",fontFamily:$e,fontSize:Be},popover:{color:"#595959CC",fontFamily:$e,fontSize:Be}}},preferredSize(){const{data:e,settings:t,style:n}=this.settings,{alternatives:r}=e,{type:i}=t,{fontSize:o,fontFamily:a}=n.title,s=r.length||"measure"!==i?28:20,l=this.registries.renderer("svg")(),{height:c}=l.measureText({text:"M",fontSize:o,fontFamily:a});return Math.max(s,c)},created(){this.state={inSelections:!1},this.listeners={onSelectionsActivated:()=>{this.state.inSelections=!0,this.renderer.render(Ue(this))},onSelectionsDeactivated:()=>{this.state.inSelections=!1}}},beforeMount(){const{selections:e}=this.settings.resources;e&&(e.addListener("activated",this.listeners.onSelectionsActivated),e.addListener("deactivated",this.listeners.onSelectionsDeactivated),e.addListener("canceled",this.listeners.onSelectionsDeactivated))},render(){return Ue(this)},beforeUnmount(){const{selections:e}=this.settings.resources;e&&(e.removeListener("activated",this.listeners.onSelectionsActivated),e.removeListener("deactivated",this.listeners.onSelectionsDeactivated),e.removeListener("canceled",this.listeners.onSelectionsDeactivated))}},Ye=({dock:e,settings:t})=>{const{label:n}=t,r="center"===e,i=r?{}:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"};return W.jsx("span",{style:i,title:n,children:r?n:`* ${n}`})},Ge={renderer:"react",disableTriggers:!0,key:"disclaimer",defaultSettings:{settings:{isRTL:!1,label:void 0},style:{fontFamily:'"Source Sans Pro", "Arial", "sans-serif"'}},preferredSize:()=>22,render(){const{rect:e}=this,{layout:t,settings:n,style:r}=this.settings;return function({dock:e,rect:t,settings:n,styling:r}){const{isRTL:i}=n,o=function({dock:e,isRTL:t}){return"top"!==e&&"bottom"!==e||!t?"ltr":"rtl"}({dock:e,isRTL:i}),a=function({dock:e,rect:t,styling:n}){const r={pointerEvents:"auto",display:"flex",justifyContent:"center",alignItems:"center",color:"#404040",fontStyle:"italic",fontSize:"13px",fontFamily:n.fontFamily};return"left"===e&&(r.width=`${t.height}px`,r.transform=`rotate(-90deg) translate(-${t.height}px, 0)`,r.transformOrigin="top left"),"right"===e&&(r.width=`${t.height}px`,r.transform=`rotate(90deg) translate(0, -${t.width}px)`,r.transformOrigin="top left"),"center"===e&&(r.width=`${t.width}px`,r.height=`${t.height}px`,r.color="#404040",r.fontStyle="normal",r.fontSize="1.2em",r.textAlign="center"),"bottom"!==e&&"top"!==e||(r.justifyContent="flex-start",r.alignItems="flex-start"),r}({dock:e,rect:t,styling:r});return W.jsx("div",{dir:o,style:a,children:W.jsx(Ye,{dock:e,settings:n})})}({dock:t.dock,rect:e,settings:n,styling:r})}},Je={},Ze=function(){if(We)return Je;We=1;var e=b;return Je.createRoot=e.createRoot,Je.hydrateRoot=e.hydrateRoot,Je}();const Xe=f({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 #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 Qe(e){const t={x:0,y:0,width:0,height:0,scaleRatio:{x:1,y:1},margin:{left:0,top:0}},{x:n,y:r,width:i,height:o,scaleRatio:a,margin:s}=e||{};return t.x=Number.isNaN(n)||void 0===n?t.x:n,t.y=Number.isNaN(r)||void 0===r?t.y:r,t.width=Number.isNaN(i)||void 0===i?t.width:i,t.height=Number.isNaN(o)||void 0===o?t.height:o,void 0!==a&&(t.scaleRatio.x=Number.isNaN(a.x)?t.scaleRatio.x:a.x,t.scaleRatio.y=Number.isNaN(a.y)?t.scaleRatio.y:a.y),void 0!==s&&(t.margin.left=Number.isNaN(s.left)?0:s.left,t.margin.top=Number.isNaN(s.top)?0:s.top),t}function et(){const e={rendererBox:Qe(),container:void 0,root:void 0},t=()=>{e.root?.unmount(),e.container?.parentElement?.removeChild(e.container),e.container=void 0};return{size:t=>(t&&(e.rendererBox=Qe(t)),e.rendererBox),element:()=>e.container,appendTo:t=>(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=Ze.createRoot(e.container)),t.appendChild(e.container),e.container),setKey:t=>{e.container&&e.container.setAttribute("data-key",t)},render(t){if(!e.container)return!1;const n=e.rendererBox,r=n.scaleRatio.x,o=n.scaleRatio.y;return e.container.style.left=`${Math.round(n.margin.left+n.x*r)}px`,e.container.style.top=`${Math.round(n.margin.top+n.y*o)}px`,e.container.style.width=`${Math.round(n.width)}px`,e.container.style.height=`${Math.round(n.height)}px`,e.container.style.transform=`scale(${r}, ${o})`,e.container.style.transformOrigin="top left",e.root.render(function({nodes:e}){return W.jsx(i.StrictMode,{children:W.jsx(h,{theme:Xe,children:e})})}({nodes:t})),!0},findShapes:()=>[],itemsAt:()=>[],clear(){t()},destroy(){t()}}}function tt(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function nt(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function rt(){}var it=.7,ot=1/it,at="\\s*([+-]?\\d+)\\s*",st="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",lt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ct=/^#([0-9a-f]{3,8})$/,ut=new RegExp(`^rgb\\(${at},${at},${at}\\)$`),pt=new RegExp(`^rgb\\(${lt},${lt},${lt}\\)$`),dt=new RegExp(`^rgba\\(${at},${at},${at},${st}\\)$`),ft=new RegExp(`^rgba\\(${lt},${lt},${lt},${st}\\)$`),mt=new RegExp(`^hsl\\(${st},${lt},${lt}\\)$`),ht=new RegExp(`^hsla\\(${st},${lt},${lt},${st}\\)$`),yt={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 gt(){return this.rgb().formatHex()}function vt(){return this.rgb().formatRgb()}function bt(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=ct.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?xt(t):3===n?new St(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?qt(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?qt(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=ut.exec(e))?new St(t[1],t[2],t[3],1):(t=pt.exec(e))?new St(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=dt.exec(e))?qt(t[1],t[2],t[3],t[4]):(t=ft.exec(e))?qt(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=mt.exec(e))?Mt(t[1],t[2]/100,t[3]/100,1):(t=ht.exec(e))?Mt(t[1],t[2]/100,t[3]/100,t[4]):yt.hasOwnProperty(e)?xt(yt[e]):"transparent"===e?new St(NaN,NaN,NaN,0):null}function xt(e){return new St(e>>16&255,e>>8&255,255&e,1)}function qt(e,t,n,r){return r<=0&&(e=t=n=NaN),new St(e,t,n,r)}function Dt(e){return e instanceof rt||(e=bt(e)),e?new St((e=e.rgb()).r,e.g,e.b,e.opacity):new St}function St(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function Ct(){return`#${At(this.r)}${At(this.g)}${At(this.b)}`}function wt(){const e=Et(this.opacity);return`${1===e?"rgb(":"rgba("}${It(this.r)}, ${It(this.g)}, ${It(this.b)}${1===e?")":`, ${e})`}`}function Et(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function It(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function At(e){return((e=It(e))<16?"0":"")+e.toString(16)}function Mt(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new kt(e,t,n,r)}function Lt(e){if(e instanceof kt)return new kt(e.h,e.s,e.l,e.opacity);if(e instanceof rt||(e=bt(e)),!e)return new kt;if(e instanceof kt)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 kt(a,s,l,e.opacity)}function kt(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function Tt(e){return(e=(e||0)%360)<0?e+360:e}function Nt(e){return Math.max(0,Math.min(1,e||0))}function Ot(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}tt(rt,bt,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:gt,formatHex:gt,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Lt(this).formatHsl()},formatRgb:vt,toString:vt}),tt(St,function(e,t,n,r){return 1===arguments.length?Dt(e):new St(e,t,n,null==r?1:r)},nt(rt,{brighter(e){return e=null==e?ot:Math.pow(ot,e),new St(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?it:Math.pow(it,e),new St(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new St(It(this.r),It(this.g),It(this.b),Et(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:Ct,formatHex:Ct,formatHex8:function(){return`#${At(this.r)}${At(this.g)}${At(this.b)}${At(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:wt,toString:wt})),tt(kt,function(e,t,n,r){return 1===arguments.length?Lt(e):new kt(e,t,n,null==r?1:r)},nt(rt,{brighter(e){return e=null==e?ot:Math.pow(ot,e),new kt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?it:Math.pow(it,e),new kt(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 St(Ot(e>=240?e-240:e+120,i,r),Ot(e,i,r),Ot(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new kt(Tt(this.h),Nt(this.s),Nt(this.l),Et(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=Et(this.opacity);return`${1===e?"hsl(":"hsla("}${Tt(this.h)}, ${100*Nt(this.s)}%, ${100*Nt(this.l)}%${1===e?")":`, ${e})`}`}}));const Pt=Math.PI/180,Ft=180/Math.PI,Rt=.96422,jt=.82521,Ht=4/29,zt=6/29,Vt=3*zt*zt,_t=zt*zt*zt;function $t(e){if(e instanceof Bt)return new Bt(e.l,e.a,e.b,e.opacity);if(e instanceof Jt)return Zt(e);e instanceof St||(e=Dt(e));var t,n,r=Yt(e.r),i=Yt(e.g),o=Yt(e.b),a=Ut((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=a:(t=Ut((.4360747*r+.3850649*i+.1430804*o)/Rt),n=Ut((.0139322*r+.0971045*i+.7141733*o)/jt)),new Bt(116*a-16,500*(t-a),200*(a-n),e.opacity)}function Bt(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function Ut(e){return e>_t?Math.pow(e,1/3):e/Vt+Ht}function Wt(e){return e>zt?e*e*e:Vt*(e-Ht)}function Kt(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Yt(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Gt(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof Jt)return new Jt(e.h,e.c,e.l,e.opacity);if(e instanceof Bt||(e=$t(e)),0===e.a&&0===e.b)return new Jt(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Ft;return new Jt(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new Jt(e,t,n,null==r?1:r)}function Jt(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function Zt(e){if(isNaN(e.h))return new Bt(e.l,0,0,e.opacity);var t=e.h*Pt;return new Bt(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}function Xt(e){return Gt(e).l<70}function Qt(e,t){const n=Gt(e).l/100,r=Gt(t).l/100;return n>r?(n+.05)/(r+.05):(r+.05)/(n+.05)}function en(e,t){return{x:t.x+e.r*Math.sin(e.a),y:t.y-e.r*Math.cos(e.a)}}tt(Bt,function(e,t,n,r){return 1===arguments.length?$t(e):new Bt(e,t,n,null==r?1:r)},nt(rt,{brighter(e){return new Bt(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new Bt(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 St(Kt(3.1338561*(t=Rt*Wt(t))-1.6168667*(e=1*Wt(e))-.4906146*(n=jt*Wt(n))),Kt(-.9787684*t+1.9161415*e+.033454*n),Kt(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),tt(Jt,Gt,nt(rt,{brighter(e){return new Jt(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new Jt(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return Zt(this).rgb()}}));var tn={require:["chart","settings"],defaultSettings:{settings:{},style:{}},render(){return function({chart:e,settings:t}){const n=e.component(t.component);if(!n)return[];const r=e.findShapes(t.selector).filter(e=>e.key===t.component);if(r.length<2)return[];if(n.settings.settings.slice.cornerRadius>0||n.settings.settings.slice.strokeWidth>0)return[];const i=[];let o=r[r.length-1];for(let e=0;e<r.length;e+=1){const t=r[e],n=o.attrs.fill,a=t.attrs.fill;if(Qt(a,n)<=1.2){const{start:e,offset:n}=t.desc.slice;let{innerRadius:r,outerRadius:s}=t.desc.slice;if(r=Math.max(r,o.desc.slice.innerRadius),s=Math.min(s,o.desc.slice.outerRadius),s>r){const t=en({r:s,a:e},n),o=en({r:r,a:e},n);i.push({type:"line",x1:t.x,y1:t.y,x2:o.x,y2:o.y,strokeWidth:1,opacity:.4,stroke:Xt(a)?"#ccc":"#333"})}}o=t}return i}({chart:this.chart,rect:this.rect,style:this.style,settings:this.settings.settings})}};function nn(e,t){return{x:t.x+e.r*Math.sin(e.a),y:t.y-e.r*Math.cos(e.a)}}function rn(e,t=!0){let n="";for(let t=0;t<e.length;t++){const r=e[t];n+=0===t?`M${r.x} ${r.y}`:`L${r.x} ${r.y}`,n+=" "}return t&&(n+="Z"),n}function on(e){const{size:t,angle:n}=e,r={x:e.x,y:e.y},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}];return s=s.map(e=>function(e,t,n={x:0,y:0}){const r=Math.cos(t),i=Math.sin(t),o=(s=n,{x:(a=e).x-s.x,y:a.y-s.y});var a,s;return function(e,t){return{x:e.x+t.x,y:e.y+t.y}}({x:r*o.x-i*o.y,y:i*o.x+r*o.y},n)}(e,n,r)),{type:"path",fill:e.fill,d:rn(s)}}var an={require:["chart"],defaultSettings:{settings:{},style:{}},render(){return function({chart:e,settings:t}){if(!e.component(t.component))return[];const n=e.findShapes(t.selector).filter(e=>e.key===t.component);if(n.length<2)return[];const r=[];for(let e=0;e<n.length;e+=1){const i=n[e];if(i.data.radius.value<0){const{start:e,end:n,offset:o}=i.desc.slice,a=(e+n)/2,s=nn({r:t.offset,a:a},o),l=on({size:t.size,fill:t.fill,angle:a+Math.PI,...s});l.data={...i.data,_share:i.desc.share,_fillColor:i.attrs.fill},r.push(l)}}return r}({chart:this.chart,rect:this.rect,style:this.style,settings:this.settings.settings})}};const sn="object",ln=["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"];const cn=e=>({value:e,label:e.charAt(0).toUpperCase()+e.slice(1),groupHeader:!1,disabled:!1,styles:{fontFamily:e}});function un({theme:e,translator:t,id:n,path:r}){const i=()=>e.getStyle(n,r,"fontFamily");return{getDefaultValue:()=>i(),getOptions:()=>function({theme:e,translator:t,defaultValue:n}){const r=[],i=e.getStyle("","","fontFamilies");return Array.isArray(i)&&i.length?r.push(...new Set([n,...i.map(e=>e.split(",").map(e=>e.trim()).map(e=>e.replace(/\s+/g," ").trim()).filter(Boolean).join(", "))])):r.push(n),[{value:"ThemeHeader",label:t.get("properties.themeFonts"),metaText:t.get("properties.theme"),groupHeader:!0},...r.map(e=>cn(e)),{value:"DefaultHeader",label:t.get("properties.allFonts"),metaText:t.get("properties.default"),groupHeader:!0},...ln.map(e=>cn(e))]}({theme:e,translator:t,defaultValue:i()})}}var pn=["10px","11px","12px","13px","14px","15px","16px","17px","18px","19px","20px","21px","22px","23px","24px"];const dn=e=>({value:e,label:e,groupHeader:!1,disabled:!1});function fn({theme:e,translator:t,id:n,path:r}){const i=()=>e.getStyle(n,r,"fontSize");return{getDefaultValue:()=>i(),getOptions:()=>function({theme:e,translator:t,defaultValue:n}){const r=[],i=e.getStyle("","","fontSizes");return Array.isArray(i)&&i.length?r.push(...new Set([n,...i])):r.push(n),[{value:"ThemeHeader",label:t.get("properties.themeFontSizes"),metaText:t.get("properties.theme"),groupHeader:!0},...r.map(e=>dn(e)),{value:"DefaultHeader",label:t.get("properties.allFontSizes"),metaText:t.get("properties.default"),groupHeader:!0},...pn.map(e=>dn(e))]}({theme:e,translator:t,defaultValue:i()})}}function mn({theme:e,translator:t,id:n,path:r}){return{fontFamily:un({theme:e,translator:t,id:n,path:r}),fontSize:fn({theme:e,translator:t,id:n,path:r})}}const hn=["__proto__","constructor"],yn=e=>{if(hn.some(t=>e.includes(t)))throw new Error("font-resolver: Forbidden property.")};async function gn({app:e,items:t}){if(!e.evaluateEx)return t;const n=(await Promise.all(t.filter(e=>!!e.qCalcCondition?.qCond?.qv).map(t=>{const{qv:n}=t.qCalcCondition.qCond;return e.evaluateEx(n).then(e=>0===e.qNumber?t.qDef.cId:void 0).catch(()=>t.qDef.cId)}))).filter(Boolean);return t.filter(e=>!n.includes(e.qDef.cId))}async function vn({app:e,translator:t,properties:n}){const{qDimensions:r=[]}=n?.qHyperCubeDef?.qLayoutExclude?.qHyperCubeDef||{};if(!r.length)return Promise.resolve([]);const i=await gn({app:e,items:r});return Promise.all(i.map(n=>function({app:e,translator:t,dimension:n}){const r={id:n.qDef.cId,text:t.get("Object.ErrorMessage.MissingDimension"),meta:{}},{qLibraryId:i}=n;if(i)return e.getDimension?e.getDimension(i).then(e=>e.getLayout()).catch(()=>{}).then(e=>{if(!e)return r;const{qGrouping:t,qLabelExpression:i}=e.qDim,o="C"===t,a="H"===t,s="N"===t;return{id:n.qDef.cId,text:i&&s?i:e.qDim.title,meta:{isCyclic:o,isDrillDown:a,isNormal:s}}}):r;const{cId:o,qLabelExpression:a,qFieldLabels:s,qFieldDefs:l}=n.qDef,c={isCyclic:!1,isDrillDown:!1,isNormal:!0};return a?e.evaluate?e.evaluate(a).then(e=>({id:o,text:e,meta:c})):r:{id:o,text:s[0]||l[0],meta:c}}({app:e,translator:t,dimension:n})))}async function bn({app:e,translator:t,properties:n}){const{qMeasures:r=[]}=n?.qHyperCubeDef?.qLayoutExclude?.qHyperCubeDef||{};if(!r.length)return Promise.resolve([]);const i=await gn({app:e,items:r});return Promise.all(i.map(n=>function({app:e,translator:t,measure:n}){const r={id:n.qDef.cId,text:t.get("Object.ErrorMessage.MissingMeasure")},{qLibraryId:i}=n;if(i)return e.getMeasure?e.getMeasure(i).then(e=>e.getLayout()).catch(()=>{}).then(e=>{if(!e)return r;const{qLabelExpression:t}=e.qMeasure;return{id:n.qDef.cId,text:t||e.qMeasure.qLabel||e.qMeasure.qDef}}):r;const{cId:o,qLabelExpression:a,qLabel:s,qDef:l}=n.qDef;return a?e.evaluate?e.evaluate(a).then(e=>({id:o,text:e})):r:{id:o,text:s||l}}({app:e,translator:t,measure:n})))}var xn,qn,Dn=function(){if(qn)return xn;qn=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 xn=function e(){var t,n,r,l,c,u,p=arguments[0],d=1,f=arguments.length,m=!1;for("boolean"==typeof p&&(m=p,p=arguments[1]||{},d=2),(null==p||"object"!=typeof p&&"function"!=typeof p)&&(p={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=s(p,n),p!==(l=s(t,n))&&(m&&l&&(o(l)||(c=i(l)))?(c?(c=!1,u=r&&i(r)?r:[]):u=r&&o(r)?r:{},a(p,{name:n,newValue:e(m,u,l)})):void 0!==l&&a(p,{name:n,newValue:l}));return p},xn}(),Sn=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}(Dn);function Cn(e,t){return{range:({resources:e,data:n})=>{const r=e.theme.palette("categorical",0===t?n.items.length:t);return n.items.map(e=>r[e.value%r.length])},valueAccessor:e.value}}function wn(e,t){return{range:({resources:e,data:n})=>{const r=e.theme.palette("categorical",0===t?n.items.length:t);return n.items.map(e=>r[e.row.value%r.length])},valueAccessor:e.value}}function En(e,t,n,r,{byRow:i,byElemNo:o}){var a;if(r&&(t.input.persistent||e.hc.qDimensionInfo.length>1||void 0===n.activeDimensionIndex&&e.hc.qSize.qcy>(a=e.hc,(a.qDataPages[0]||a.qStackedDataPages[0])?.qArea.qHeight||0)))return o(r,r.raw().qCardinal);if(r){const e=t.pic.extract({field:r.key(),trackBy:r.value}).length;return i(r,e)}return{}}function In(e,t){const{hc:{qDimensionInfo:n}}=e;let r=t.input.byDimDef||{activeDimensionIndex:n.length-1};if(r.activeDimensionIndex>=0){const e=n[r.activeDimensionIndex];r=e.coloring&&e.coloring.colorMapRef?{type:"libraryItem",key:e.coloring.colorMapRef,activeDimensionIndex:r.activeDimensionIndex}:{activeDimensionIndex:r.activeDimensionIndex}}return r}function An(e,t){let n;return t.activeDimensionIndex>=0?n=e.pic.fields().filter(e=>"dimension"===e.type())[t.activeDimensionIndex]:"libraryItem"===t.type?(n=t.key?e.pic.field(e=>e.raw().colorMapRef===t.key):void 0,!1===n&&(n=e.pic.field(e=>"colorByAlternative"===e.raw().id))):"expression"===t.type&&(n=e.pic.field(e=>"colorByAlternative"===e.raw().id)),n}function Mn(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Ln(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function kn(){}var Tn=.7,Nn=1/Tn,On="\\s*([+-]?\\d+)\\s*",Pn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Fn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Rn=/^#([0-9a-f]{3,8})$/,jn=new RegExp(`^rgb\\(${On},${On},${On}\\)$`),Hn=new RegExp(`^rgb\\(${Fn},${Fn},${Fn}\\)$`),zn=new RegExp(`^rgba\\(${On},${On},${On},${Pn}\\)$`),Vn=new RegExp(`^rgba\\(${Fn},${Fn},${Fn},${Pn}\\)$`),_n=new RegExp(`^hsl\\(${Pn},${Fn},${Fn}\\)$`),$n=new RegExp(`^hsla\\(${Pn},${Fn},${Fn},${Pn}\\)$`),Bn={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 Un(){return this.rgb().formatHex()}function Wn(){return this.rgb().formatRgb()}function Kn(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Rn.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?Yn(t):3===n?new Xn(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Gn(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Gn(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=jn.exec(e))?new Xn(t[1],t[2],t[3],1):(t=Hn.exec(e))?new Xn(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=zn.exec(e))?Gn(t[1],t[2],t[3],t[4]):(t=Vn.exec(e))?Gn(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=_n.exec(e))?ir(t[1],t[2]/100,t[3]/100,1):(t=$n.exec(e))?ir(t[1],t[2]/100,t[3]/100,t[4]):Bn.hasOwnProperty(e)?Yn(Bn[e]):"transparent"===e?new Xn(NaN,NaN,NaN,0):null}function Yn(e){return new Xn(e>>16&255,e>>8&255,255&e,1)}function Gn(e,t,n,r){return r<=0&&(e=t=n=NaN),new Xn(e,t,n,r)}function Jn(e){return e instanceof kn||(e=Kn(e)),e?new Xn((e=e.rgb()).r,e.g,e.b,e.opacity):new Xn}function Zn(e,t,n,r){return 1===arguments.length?Jn(e):new Xn(e,t,n,null==r?1:r)}function Xn(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function Qn(){return`#${rr(this.r)}${rr(this.g)}${rr(this.b)}`}function er(){const e=tr(this.opacity);return`${1===e?"rgb(":"rgba("}${nr(this.r)}, ${nr(this.g)}, ${nr(this.b)}${1===e?")":`, ${e})`}`}function tr(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function nr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function rr(e){return((e=nr(e))<16?"0":"")+e.toString(16)}function ir(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ar(e,t,n,r)}function or(e){if(e instanceof ar)return new ar(e.h,e.s,e.l,e.opacity);if(e instanceof kn||(e=Kn(e)),!e)return new ar;if(e instanceof ar)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 ar(a,s,l,e.opacity)}function ar(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function sr(e){return(e=(e||0)%360)<0?e+360:e}function lr(e){return Math.max(0,Math.min(1,e||0))}function cr(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}Mn(kn,Kn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Un,formatHex:Un,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return or(this).formatHsl()},formatRgb:Wn,toString:Wn}),Mn(Xn,Zn,Ln(kn,{brighter(e){return e=null==e?Nn:Math.pow(Nn,e),new Xn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?Tn:Math.pow(Tn,e),new Xn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Xn(nr(this.r),nr(this.g),nr(this.b),tr(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:Qn,formatHex:Qn,formatHex8:function(){return`#${rr(this.r)}${rr(this.g)}${rr(this.b)}${rr(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:er,toString:er})),Mn(ar,function(e,t,n,r){return 1===arguments.length?or(e):new ar(e,t,n,null==r?1:r)},Ln(kn,{brighter(e){return e=null==e?Nn:Math.pow(Nn,e),new ar(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?Tn:Math.pow(Tn,e),new ar(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 Xn(cr(e>=240?e-240:e+120,i,r),cr(e,i,r),cr(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new ar(sr(this.h),lr(this.s),lr(this.l),tr(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=tr(this.opacity);return`${1===e?"hsl(":"hsla("}${sr(this.h)}, ${100*lr(this.s)}%, ${100*lr(this.l)}%${1===e?")":`, ${e})`}`}}));const ur=Math.PI/180,pr=180/Math.PI,dr=.96422,fr=.82521,mr=4/29,hr=6/29,yr=3*hr*hr,gr=hr*hr*hr;function vr(e){if(e instanceof br)return new br(e.l,e.a,e.b,e.opacity);if(e instanceof Cr)return wr(e);e instanceof Xn||(e=Jn(e));var t,n,r=Sr(e.r),i=Sr(e.g),o=Sr(e.b),a=xr((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=a:(t=xr((.4360747*r+.3850649*i+.1430804*o)/dr),n=xr((.0139322*r+.0971045*i+.7141733*o)/fr)),new br(116*a-16,500*(t-a),200*(a-n),e.opacity)}function br(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function xr(e){return e>gr?Math.pow(e,1/3):e/yr+mr}function qr(e){return e>hr?e*e*e:yr*(e-mr)}function Dr(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Sr(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Cr(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function wr(e){if(isNaN(e.h))return new br(e.l,0,0,e.opacity);var t=e.h*ur;return new br(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}Mn(br,function(e,t,n,r){return 1===arguments.length?vr(e):new br(e,t,n,null==r?1:r)},Ln(kn,{brighter(e){return new br(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new br(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 Xn(Dr(3.1338561*(t=dr*qr(t))-1.6168667*(e=1*qr(e))-.4906146*(n=fr*qr(n))),Dr(-.9787684*t+1.9161415*e+.033454*n),Dr(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),Mn(Cr,function(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof Cr)return new Cr(e.h,e.c,e.l,e.opacity);if(e instanceof br||(e=vr(e)),0===e.a&&0===e.b)return new Cr(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*pr;return new Cr(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new Cr(e,t,n,null==r?1:r)},Ln(kn,{brighter(e){return new Cr(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new Cr(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return wr(this).rgb()}}));var Er=e=>()=>e;function Ir(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):Er(isNaN(e)?t:e)}var Ar=function e(t){var n=function(e){return 1===(e=+e)?Ir: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):Er(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=Zn(e)).r,(t=Zn(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=Ir(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);const Mr=/^class(-pyramid)?/,Lr=(e,t,n,r)=>{let i=void 0!==n.min?n.min:r.min(),o=void 0!==n.max?n.max:r.max();const a=i,s=o,{limits:l}=t,c={},u="percent"===t.limitType?l.map(e=>i+(o-i)*e):l,p=t.colors.map(t=>e.resolveUIColor(t));if(i=Math.min(i,...u),o=Math.max(o,...u),c.min=i,c.max=o,t.breakTypes&&-1===t.breakTypes.indexOf(!0))c.type="categorical",Object.assign(c,(({min:e,max:t,limits:n,range:r})=>{const i=[],o=[];if(n.length)if(n[n.length-1]<e)o.push(e,t),i.push(r[r.length-1],r[r.length-1],r[r.length-1]);else if(n[0]>t)o.push(e,t),i.push(r[0],r[0],r[0]);else{if(n[0]>e)o.push(e),i.push(r[0]);else{o.push(e);for(let t=0;t<n.length;t++)if(e<n[t]){i.push(r[t]);break}}for(let a=0;a<n.length;a++)e<n[a]&&n[a]<t&&(o.push(n[a]),i.push(r[a]));if(n[n.length-1]<t)o.push(t),i.push(r[n.length]),i.push(r[n.length]);else{o.push(t);for(let e=0;e<n.length;e++)if(n[e]>t){i.push(r[e]),i.push(r[e]);break}}}else i.push(r[0]);return{min:e,max:t,range:i,domain:o}})({min:"percent"===t.limitType?i:a,max:"percent"===t.limitType?o:s,range:p,limits:"percent"===t.limitType?u:l}));else if(t.breakTypes){const e=t.breakTypes;c.type="continuous",c.domain=[i],c.range=[p[0]];for(let t=0;t<u.length;t+=1)if(e[t]){const n=p[t],r=p[t+1],i=Ar(n,r)(.5);c.range.push(i),c.domain.push(u[t]),t<u.length-1&&e[t+1]&&(c.range.push(p[t+1]),c.domain.push((u[t]+u[t+1])/2))}else c.range.push(p[t]),c.range.push(p[t+1]),c.domain.push(u[t]),c.domain.push(u[t]+Math.min(1e-6,(o-i)/1e6));c.range.push(p[p.length-1]),c.domain.push(o)}else c.domain=u,c.range=p;return c};function kr(e,t,n,r,i){let o=0;const a=[];let s,l,c;const u=(e-t)/(r+1);if(0===u)return 1;for(s=0;s<n.length;s+=1)l=.99*(n[s]-t),c=n[s]>e?Math.floor(e/u):n[s]<t?0:Math.floor(l/u),Number.isNaN(c)||(a[c]?a[c]+=1:a[c]=1);for(s=0;s<a.length;s+=1)a[s]&&(o+=1);return o<=r||o>=i?Math.max(o,r):kr(e,t,n,r+1,i)}const Tr=(e,{theme:t,hc:n},r,{f:i})=>{const o={mode:"field",fieldType:"measure",field:i?i.key():void 0,reverse:r.input.reverseScheme||!1,type:"continuous",range:({resources:e})=>e.theme.palette("quant")};let a=[],s=!0;if(i){if(Number.isNaN(+i.min())||Number.isNaN(+i.max()))return{invalid:!0};s=!("S"===(l=r.pic.raw()).qMode&&(l.qDataPages[0]&&l.qSize.qcy>l.qDataPages[0].qArea.qHeight||!l.qDataPages.length&&l.qSize.qcy>0)||"K"===l.qMode&&l.qStackedDataPages[0]&&l.qSize.qcy>l.qStackedDataPages[0].qArea.qHeight||"T"===l.qMode&&l.qSize.qcy>l.qTreeDataPages[0].qGroupSize),s&&(a=r.pic.extract({field:0,props:{num:{field:i.key()},exclude:{fields:n.qDimensionInfo.map((e,t)=>({field:`qDimensionInfo/${t}`})),value:e=>Math.min(...e)<0}}}).filter(e=>e.value>=0&&!e.exclude.value).map(e=>e.num.value).filter(e=>"number"==typeof e))}var l;if(!1===r.input.autoMinMax){if(o.min=r.input.measureMin,o.max=r.input.measureMax,o.max<o.min)return{invalid:!0}}else if(i&&!s)o.min=i.min(),o.max=i.max();else if(i){if(!a.length)return{invalid:!0};o.min=Math.min(...a),o.max=Math.max(...a)}let c;if(r.input.measureScheme&&(o.palettes={quant:r.input.measureScheme}),t){const e=t.getDataColorScales().filter(e=>e.key===r.input.measureScheme)[0];o.type=e&&Mr.test(e.type)?"categorical":"continuous","categorical"===o.type&&(c=e.colors.some(e=>Array.isArray(e))?Math.max(...e.colors.map(e=>e?e.length:0)):e.colors.length)}if("categorical"===o.type){const e=s?kr(o.max,o.min,a,1,c):c,t=(o.max-o.min)/e,n=[];for(let r=0;r<e+1;r+=1)n.push(o.min+t*r);o.domain=n,o.range=({resources:t})=>{const n=t.theme.palette("quant",e),r=Math.max(1,Math.floor(n.length/e)),i=[];for(let t=0;t<e;t+=1)i.push(n[t*r]);return[i[0],...i,i[i.length-1]]}}return o};function Nr(e,t){let n;return t.activeMeasureIndex>=0?n=e.pic.fields().filter(e=>"measure"===e.type())[t.activeMeasureIndex]:"libraryItem"===t.type?n=e.pic.field(e=>e.raw().colorMapRef===t.key&&void 0!==t.key):"expression"===t.type&&(n=e.pic.field(e=>"colorByAlternative"===e.raw().id)),n||(n=e.pic.field(e=>void 0!==e.raw().matchMeasure),n&&(n=e.pic.fields().filter(e=>"measure"===e.type())[n.raw().matchMeasure])),n}function Or(e){e.measureOverrides.every(e=>!e)&&(e.measureOverrides=null)}function Pr(e,t){const n=t?.domain||[],r=t?.range||[],i=[];for(let t=0;t<e.length;++t){const o=e[t];if("constant"===o?.mode){const i=n.indexOf(t);-1===i?(n.push(t),r.push(o.primary)):r[i]=o.primary,e[t]=null}else if(o){i.push(t);const e=n.indexOf(t);-1!==e&&(n.splice(e,1),r.splice(e,1))}}return{domain:n,range:r,exclude:i}}function Fr(e,t,n,r){const i=function(e,t,n,r){if(t.input&&!t.input.auto){if("byMeasure"===t.input.mode)return function(e,{theme:t,hc:n},r,{getCField:i=Nr}={}){const o=r.input.byMeasureDef||{activeMeasureIndex:0},a=i(r,o),s=Tr(0,{theme:t,hc:n},r,{f:a});if(s.invalid)return s;"expression"===o.type&&(o.activeMeasureIndex<0||void 0===o.activeMeasureIndex)&&(s.label=o.label,a&&"color.altLabel"===a.raw().labelExpRef&&(s.label=r.input.altLabel)),!s.label&&a&&(s.label=a.title());let l=o.activeMeasureIndex>=0?a:null;if(!l&&a&&void 0!==a.raw().matchMeasure&&a.raw().matchMeasure>-1&&(l=r.pic.fields().filter(e=>"measure"===e.type())[a.raw().matchMeasure]),r.input.useMeasureGradient&&"libraryItem"===o.type)if(l){const t=l.raw().coloring;t&&t.gradient&&Sn(s,Lr(e,t.gradient,s,l))}else s.auxiliary=o;return s}(e,n,t);if("byDimension"===t.input.mode)return function(e,t,n,{getCDef:r=In,getCByField:i=An,getPersistence:o=En}={}){const a=r(t,n),s=i(n,a),l=s?s.raw():{},c=n&&n.pic?n.pic.raw():{};if(l.qError||l.qSize&&0===l.qSize.qcy&&!c.qHasOtherValues)return{invalid:!0};const u={mode:"field",fieldType:"dimension",type:"categorical",field:s?s.key():void 0,isFieldLocked:l.qLocked};return("expression"===a.type||a.activeDimensionIndex<0)&&(u.label=a.label,"color.altLabel"===l.labelExpRef&&(u.label=n.input.altLabel)),!u.label&&s&&(u.label=s.title()),n.input.dimensionScheme&&(u.palettes={categorical:n.input.dimensionScheme}),n.input.useDimColVal&&"libraryItem"===a.type&&(u.auxiliary=a),Sn(u,o(t,n,a,s,{byRow:wn,byElemNo:Cn})),u}(0,n,t);if("byExpression"===t.input.mode)return function(e,{hc:t,theme:n,translator:r},i,o){const a=i.pic.field(e=>"colorByExpression"===e.raw().id);if(!a||!a.raw().qFallbackTitle&&!i.input.colorExpression||!(Number.isFinite(a.raw().qMin)&&Number.isFinite(a.raw().qMax)||i.input.expressionIsColor))return{mode:"constant",type:"constant",primary:o.nil};if(i.input.expressionIsColor)return{mode:"field",fieldType:"expression",field:a?a.key():void 0,type:"color"};const s=Tr(0,{hc:t,theme:n},i,{f:a});return s.invalid||(s.label=i.input.expressionLabel||r.get("Object.ChartTooltip.ColorExpression")),s}(0,n,t,r);if("byMultiple"===t.input.mode||"primary"===t.input.mode)return function(e,{hc:t,theme:n,translator:r},i,o){let a=i.input.useBaseColors;if(("byMultiple"===i.input.mode||"primary"===i.input.mode&&"measure"===i.input.useBaseColors)&&t.qMeasureInfo.length>1&&(a="measure"),"measure"===a){const a=[],s=[];"measure"===i.input.useBaseColors&&t.qMeasureInfo.forEach((t,n)=>{if(t.baseColor||t.coloring&&t.coloring.baseColor){a.push(n);const r=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===r?s.push(o.primary):s.push(r)}});let l=i.input.dimensionScheme?{categorical:i.input.dimensionScheme}:void 0;const c=n?n.getDataColorPalettes()[0]:void 0;return"measure"===i.input.useBaseColors&&c&&(l={categorical:c.key}),{mode:"measure",type:"categorical",palettes:l,label:r?r.get("Common.Measures"):void 0,explicit:a.length?{domain:a,range:s}:void 0}}if("dimension"===a){const n=[],r=[];return t.qDimensionInfo.forEach((t,i)=>{if(t.baseColor||t.coloring&&t.coloring.baseColor){n.push(i);const a=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===a?r.push(o.primary):r.push(a)}}),{mode:"dimension",type:"categorical",field:n.length?n[0]:void 0,explicit:n.length?{domain:n,range:r}:void 0}}let s=o.primary;if(void 0!==i.input.paletteColor)i.input.paletteColor&&(s=e.resolveUIColor(i.input.paletteColor));else{const{singleColor:e}=i.input;"number"!=typeof e||Number.isNaN(e)||(s=["#b0afae","#7b7a78","#545352","#4477aa","#7db8da","#b6d7ea","#46c646","#f93f17","#ffcf02","#276e27","#ffffff","#000000"][e])}return{mode:"constant",type:"constant",primary:s}}(e,n,t,r)}return{}}(e,t,n,r);return t.input?.measureOverrides?(i.measureOverrides=t.input.measureOverrides.map((n,i)=>function({cm:e,defaults:t,index:n,input:r,pic:i}){if(!r||!r.on)return null;const o=r.mode??"primary";return"primary"===o?function(e,t,n){let{primary:r}=n;return void 0!==t.paletteColor&&t.paletteColor&&(r=e.resolveUIColor(t.paletteColor)),{...n,mode:"constant",type:"constant",primary:r}}(e,r,t):"byExpression"===o?function(e,t,n){const r=`qMeasureInfo/${e}/`,i=t.field(e=>e.id().startsWith(r)&&"colorByMeasureExpression"===e.raw().id);return i?{...n,mode:"field",fieldType:"expression",field:i?i.key():void 0,type:"color"}:{...n,mode:"constant",type:"constant",primary:n.nil}}(n,i,t):null}({cm:e,input:n,defaults:r,index:i,pic:t.pic})),function(e,{translator:t}){if(Or(e),1===e.measureOverrides?.length)return e.measureOverrides[0];if("measure"===e.mode&&e.measureOverrides&&(e.explicit=Pr(e.measureOverrides,e.explicit),Or(e)),e.measureOverrides?.every(e=>"constant"===e?.mode)){const n={mode:"measure",type:"categorical",label:t?.get("Common.Measures")};return n.explicit=Pr(e.measureOverrides),n}return e.measureOverrides?.every(e=>e)?{invalid:!0,measureOverrides:e.measureOverrides}:e}(i,n)):i}const Rr=(e,t)=>{const n=e.fieldType,r={};if(t)if("measure"===n){const e=t.coloring;e&&(r.measureGradient=e.gradient)}else if("dimension"===n){const e=t[0],n=t[1];e&&(r.legendDataPage=e),n&&(r.dimValsData=n.colorMap)}return r},jr=e=>{throw e.isHandled=!0,e};function Hr({auto:e,resources:t}={}){const n=function(e){const t={hc:null,colorProps:null,layout:null,theme:null,...e};let n={};const r={auto:()=>({mode:"primary"}),getDimensionColorMap:()=>Promise.reject(),getMeasure:()=>Promise.reject(),getAttributeDimension:()=>Promise.reject()},i={auto:e=>e?(r.auto=e,i):r.auto,getDimensionColorMap:e=>e?(r.getDimensionColorMap=e,i):r.getDimensionColorMap,getAttributeDimension:e=>e?(r.getAttributeDimension=e,i):r.getAttributeDimension,getMeasure:e=>e?(r.getMeasure=e,i):r.getMeasure,set(e){if(!e.colorProps)throw new Error('Missing "colorProps"');if(Sn(t,e),n={pic:t.picasso.data("q")({data:t.hc,config:{localeInfo:t.localeInfo}}),input:t.colorProps},n.input.auto){const i=r.auto(e.layout);n.input=Sn(!0,{},n.input,i,{auto:!1});const o=t.theme?t.theme.getDataColorPalettes():[];o[0]&&(n.input.dimensionScheme=o[0].key);let a=0;n.input.byDimDef&&+n.input.byDimDef.activeDimensionIndex>=0&&(a=+n.input.byDimDef.activeDimensionIndex),t.hc&&t.hc.qDimensionInfo[a]&&t.hc.qDimensionInfo[a].coloring&&t.hc.qDimensionInfo[a].coloring.colorMapRef&&n.input.byDimDef&&(n.input.byDimDef.type="libraryItem",n.input.byDimDef.key=t.hc.qDimensionInfo[a].coloring.colorMapRef)}n.input.measureOverrides?.every(e=>!e||!e.on)&&(n.input=Sn(!1,{},n.input,{measureOverrides:null}))},palettes(){if(!n.palettes){const{theme:e}=t,r=[];(e&&e.getDataColorPickerPalettes()||[]).forEach(e=>{r.push({key:"ui",colors:e.colors})}),n.palettes=r}return n.palettes},getAuxiliaryData(e,n="/qHyperCubeDef"){if(!e.auxiliary&&!/qAttrDimInfo/.test(e.field))return Promise.resolve();const{key:i}=e.auxiliary||{};if("measure"===e.fieldType)return r.getMeasure(i,t).catch(()=>{});if("dimension"===e.fieldType){const o=`${n}/${e.field}`.replace("qDimensionInfo","qDimensions").replace("qAttrDimInfo","qAttributeDimensions");return Promise.all([/qAttrDimInfo/.test(e.field)?r.getAttributeDimension(o,t).catch(()=>{}):Promise.resolve(),i?r.getDimensionColorMap(i,t).catch(()=>{}):Promise.resolve()])}return Promise.resolve()},getAuxiliarySettings(e,r){return e.auxiliary||/qAttrDimInfo/.test(e.field)?(this.palettes(),this.getAuxiliaryData(e,r).then(r=>{if(!r)return{};if("measure"===e.fieldType){if(r.coloring&&r.coloring.gradient){const t=n.pic.field(e.field);return Lr(this,r.coloring.gradient,e,t)}return{}}if("dimension"===e.fieldType){const i={nil:e.nil,others:e.others},o=r[0],a=r[1]?r[1].colorMap:null;if(o){const r=t.picasso.data("q")({data:{qDimensionInfo:[n.pic.field(e.field).raw(),n.pic.field(e.field).raw()],qMeasureInfo:[],qDataPages:o,qInterColumnSortOrder:[0,1],qMode:"S"}});i.legendDataset=r}return a?((e,t,n,{external:r,field:i})=>{const o={...e};Sn(o,Cn(i,i.raw().qCardinal));const a=r.theme?r.theme.getDataColorPalettes()[0]:null;return t.nul&&(o.nil=n.resolveUIColor(t.nul)),t.oth&&(o.others=n.resolveUIColor(t.oth)),t.usePal?(o.palettes={categorical:t.pal},a&&!t.pal&&(o.palettes.categorical=a.key,Sn(o,Cn(i)))):!1===t.autoFill&&t.single?o.range=[n.resolveUIColor(t.single)]:t.autoFill&&(a&&(o.palettes={categorical:a.key}),Sn(o,Cn(i))),t.colors&&t.colors.length&&(o.explicit=((e,t,n)=>{const r={};for(let t=0;t<e.length;t+=1)r[e[t].value]=e[t].baseColor;let i=[];return{domain({data:e}){const o=[];i=[];for(let n=0;n<e.items.length;n++){const a=e.items[n],s=(a.text||a).label;r[s]&&-1===o.indexOf(a.value)&&(o.push(a.value),i.push(t.resolveUIColor(r[s])))}return o.push(-3,-2),i.push(n.others),i.push(n.nil),o},range:()=>i}})(t.colors,n,o)),o})(i,a,this,{external:t,field:n.pic.field(e.field)}):i}return{}})):Promise.resolve()},resolveUIColor(e){if(e.index<0||void 0===e.index)return e.color;if(void 0===n.uiPalette&&(n.uiPalette=this.palettes().filter(e=>"ui"===e.key)[0]||!1),!n.uiPalette)return e.color;const 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(){if(this.palettes(),!n.settings){let e={primary:"steelblue",others:"#aaa",nil:"#ddd"};const{theme:r}=t;r&&(e={...e,...r.getDataColorSpecials()}),n.settings=Sn(e,Fr(this,n,t,e))}return n.settings}};return i}(t).auto(e||(()=>({mode:"byDimension",persistent:!1,useDimColVal:!0,byDimDef:{activeDimensionIndex:0,type:"expression",label:""}}))).getDimensionColorMap((e,{layout:t,app:n})=>((e,{layout:t,app:n})=>t&&t.snapshotData?t.snapshotData.content&&t.snapshotData.content.chartData&&t.snapshotData.content.chartData.dimValsData?Promise.resolve({colorMap:t.snapshotData.content.chartData.dimValsData}):Promise.reject():n&&n.getObject?n.getObject(`ColorMapModel_${e}`).then(e=>e.getLayout()):Promise.reject())(e,{layout:t,app:n})).getMeasure((e,{layout:t,app:n})=>((e,{layout:t,app:n})=>t&&t.snapshotData?t.snapshotData.content&&t.snapshotData.content.chartData&&t.snapshotData.content.chartData.measureGradient?Promise.resolve({coloring:{gradient:t.snapshotData.content.chartData.measureGradient}}):Promise.reject():n&&n.getMeasure?n.getMeasure(e).then(e=>e.getMeasure()):Promise.reject())(e,{layout:t,app:n})).getAttributeDimension((e,{layout:t,model:n,app:r})=>((e,{layout:t,model:n,app:r})=>{if(t&&t.snapshotData)return t.snapshotData.content&&t.snapshotData.content.chartData&&t.snapshotData.content.chartData.legendDataPage?Promise.resolve(t.snapshotData.content.chartData.legendDataPage):Promise.reject();if(n&&n.session&&r){const t=[{qHeight:100,qLeft:0,qTop:0,qWidth:2}];return n.getHyperCubeData(e,t).catch(jr)}return Promise.reject()})(e,{layout:t,model:n,app:r}));return n.getSnapshotData=Rr,n}function zr(e){return t=>"object"==typeof t.datum[e]?t.datum[e].value:void 0}function Vr(e){return"object"==typeof e.datum.isNull?e.datum.isNull.value:-2===e.datum.value}function _r(e){return-3===e.datum.value}const $r={COLOR:void 0,FONT_SIZE:"16px",FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"},Br={COLOR:void 0,FONT_SIZE:void 0,FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"},Ur="legend.title",Wr="legend.label";function Kr({theme:e,key:t,styleOverrides:n}){const r={title:{color:$r.COLOR,fontSize:$r.FONT_SIZE,fontFamily:$r.FONT_FAMILY},label:{color:Br.COLOR,fontSize:Br.FONT_SIZE,fontFamily:Br.FONT_FAMILY}};if(!e&&!n)return r;const{title:i,label:o}=n||{},a=(({theme:e,key:t})=>(n,r,i,o)=>void 0!==n?n:e?e.getStyle(t,r,i):o)({theme:e,key:t});return r.title.color=a(i?.color,Ur,"color",$r.COLOR),r.title.fontSize=a(i?.fontSize,Ur,"fontSize",$r.FONT_SIZE),r.title.fontFamily=a(i?.fontFamily,Ur,"fontFamily",$r.FONT_FAMILY),r.label.color=a(o?.color,Wr,"color",Br.COLOR),r.label.fontSize=a(o?.fontSize,Wr,"fontSize",Br.FONT_SIZE),r.label.fontFamily=a(o?.fontFamily,Wr,"fontFamily",Br.FONT_FAMILY),r}const Yr=(e,t,n)=>{const r=e&&e.dock||void 0;if("auto"!==r)return r||"right";if(t){const e=t.element.getBoundingClientRect();if(e.height>e.width)return"bottom"}return n?"left":"right"},Gr=(e,t,n)=>!(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 Jr(e,t){const{styleReference:n,styleOverrides:r,chart:i,rtl:o}=e,{legendProps:a,coloring:s,theme:l,hc:c}=t,u=Kr({theme:l,key:n,styleOverrides:r});return{layout:{minimumLayoutMode:"MEDIUM",dock:Yr(a,i,o)},show:"function"==typeof a.show?()=>Gr(a,c,s):Gr(a,c,s),renderer:"svg",mounted(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}}}}const Zr=({eventName:e,key:t,requireFailure:n,recognizeWith:r}={},{actions:i}={})=>({key:`event:pan-${t}`,type:"Pan",requireFailure:n,recognizeWith:r,options:{event:e,pointers:1,threshold:10,enable(n,r){return this.started===e||!r||!(i?.interact?.enabled&&!i.interact.enabled())&&this.chart.componentsFromPoint({x:r.center.x,y:r.center.y}).some(e=>e.key===`${t}-cat`)}},events:{[`${e}start`](n){n.preventDefault(),this.started!==e&&(this.started=e,this.chart.component(`${t}-cat`).emit("panstart",n))},[`${e}move`](e){e.preventDefault(),this.chart.component(`${t}-cat`).emit("panmove",e)},[`${e}end`](e){e.preventDefault(),this.chart.component(`${t}-cat`).emit("panend",e),this.started=!1}}}),Xr=({key:e,requireFailure:t,recognizeWith:n},{actions:r}={})=>({key:`event:tap-${e}`,type:"Tap",requireFailure:t,recognizeWith:n,options:{event:"legendtap",interval:10,pointers:1,enable(t,n){if(!n)return!0;if(r?.interact?.enabled&&!r.interact.enabled())return!1;if(!this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some(t=>t.key===`${e}-cat`))return!1;const{target:i}=n.srcEvent;return!!(i&&i.hasAttribute("data-action")&&i.hasAttribute("data-component-key"))||!(!i||!i.childNodes[0]||"BUTTON"!==i.childNodes[0].nodeName)}},events:{legendtap(e){e.preventDefault();const{target:t}=e.srcEvent;t&&t.hasAttribute("data-action")&&t.hasAttribute("data-component-key")&&this.chart.component(t.getAttribute("data-component-key")).emit(t.getAttribute("data-action"))}}});function Qr(e){const t=Hr({resources:e});let n={},r={};const i=e=>(r.settings||(e||console.warn("settings() called before auxiliarySettings()"),r.settings=t.settings()),r.settings),o={config(i){if(n={...i},r={},!n.key)throw new Error("Missing key");t.set({...e,...n})},auto:e=>e?(t.auto(e),o):t.auto(),getAuxiliarySettings:e=>r.auxiliarySettings?Promise.resolve(r.auxiliarySettings):t.getAuxiliarySettings(i(!0),e).then(e=>(r.auxiliarySettings=e||{},r.settings={...r.settings,...r.auxiliarySettings},r.scales=void 0,r.color=void 0,r.auxiliarySettings)),getAuxiliaryData:()=>t.getAuxiliaryData(i()),getSnapshotData(e){const n=i();return t.getAuxiliaryData(n,e).then(e=>t.getSnapshotData(n,e))},resolveUIColor:e=>t.resolveUIColor(e),settings(){const 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(e){const t=i(),n=t.measureOverrides?.[e];return n||this.settings()},isSelectionLocked:({isMeasureSelectionLocked:e})=>function(e,{isMeasureSelectionLocked:t}){return"field"!==e.mode||("dimension"===e.fieldType?e.isFieldLocked:"measure"!==e.fieldType||t)}(i(),{isMeasureSelectionLocked:e}),palettes:()=>function({colorProps:e,coloring:t,theme:n}={}){const r=[];if(t&&t.palettes&&n){const i=t.palettes.categorical||e.dimensionScheme,o=n.getDataColorPalettes().filter(e=>e.key===i)[0]||n.getDataColorPalettes()[0];i&&o&&r.push({key:"categorical",colors:o.colors});const a=t.palettes.metric||e.measureScheme,s=n.getDataColorScales().filter(e=>e.key===a)[0]||n.getDataColorScales()[0];if(s){let e=s.colors[0]?s.colors:[[],...s.colors.slice(1)];e=Array.isArray(e[0])?e.map(e=>e.slice().reverse()):e.slice().reverse(),r.push({key:"quant",colors:e})}}return r}({coloring:i(),colorProps:n.colorProps,theme:n.theme}),scales:()=>(r.scales=r.scales||function({hc:e,coloring:t,rtl:n,key:r,source:i,picasso:o}={}){const a={},s=r;if(t){const r={override:!0,domain:t.explicit&&"function"==typeof t.explicit.domain?t.explicit.domain:[...(t.explicit||{}).domain||[],-3,-2],range:t.explicit&&"function"==typeof t.explicit.range?t.explicit.range:[...(t.explicit||{}).range||[],t.others,t.nil]};if("field"===t.mode){if("dimension"===t.fieldType){const{data:n}=function({hc:e,source:t,coloring:n}){const r={data:{extract:[{source:"dummy",field:0,filter:()=>(r.expando=e.qDataPages[0]?e.qDataPages[0].qArea.qTop:0,!1)},{source:t,field:n.field,trackBy:n.valueAccessor,reduce:"first",props:{row:{reduce:()=>r.expando++},text:{value:e=>e.qText,reduce:"first"}}}]},expando:0};return r}({hc:e,source:i,coloring:t});let l;if(t.legendDataset){let n=0;const r={};o.data("q")({data:e}).extract({field:t.field,trackBy:t.valueAccessor,reduce:e=>{const t=e[0];return r[t]=n++,e[0]}}),l={source:"attrDim",extract:{field:"qDimensionInfo/0",filter:e=>e.qElemNumber>=0,props:{row:{value:e=>r[e.qElemNumber]}}}}}const c={data:n,range:t.range,domain:t.domain,explicit:r,type:"categorical-color",label:e=>e.datum.text&&e.datum.text.value?e.datum.text.value:e.datum.label};a[s]=c,l&&(a[`${s}Legend`]={...c,data:l}),e&&e.qHasOtherValues&&l&&((l||c.data).amend=[{label:e.qDimensionInfo[0].othersLabel,source:{key:"qHyperCube",field:"qDimensionInfo/0"},row:{value:-3},value:-3}])}else if("measure"===t.fieldType){const e={data:{field:t.field},min:t.min,max:t.max};a[s]=Sn({},e,{type:"categorical"===t.type?"threshold-color":"sequential-color",range:t.range,domain:t.domain,invert:t.reverse}),"sequential-color"===a[s].type&&(a[`${s}Range`]=Sn({},e,{invert:!!n}))}else if("color"!==t.type)throw new Error("UNUSED FIELD")}else if("dimension"===t.mode){const t={data:e.qDimensionInfo.map((e,t)=>t),label:t=>e.qDimensionInfo[t.datum.value].qFallbackTitle,explicit:r,type:"categorical-color"};a[s]=t}else if("measure"===t.mode){const n={data:e.qMeasureInfo.map((e,t)=>t).filter(e=>!t.explicit?.exclude?.includes(e)),label:t=>e.qMeasureInfo[t.datum.value].qFallbackTitle,explicit:r,type:"categorical-color"};a[s]=n}}return a}({hc:n.hc,coloring:i(),key:n.key,source:n.source,picasso:e.picasso}),r.scales),color(){return r.color=r.color||function({coloring:e,scales:t,key:n}){const r=zr(n),i=zr(`${n}IsAnOther`),o=({fieldType:e,invalid:n,mode:o,nil:a,others:s,primary:l,type:c},u)=>n?e=>_r(e)||i(e)?s:a:t[u]?t=>_r(t)?s:Vr(t)||-2===r(t)&&"dimension"===e||"NaN"===r(t)?a:i(t)?s:t.resources.scale(u)(r(t))||s:"constant"===o?e=>_r(e)||i(e)?s:Vr(e)?a:l:"color"===c?e=>_r(e)||i(e)?s:Vr(e)?a:r(e)||s:null,a=o(e,n);if(e.measureOverrides){const t=zr(`${n}MeasureIdx`),r=e.measureOverrides.map(e=>e&&o(e));return e=>{const n=t(e);return r[n]?r[n](e):a(e)}}return a}({coloring:i(),scales:this.scales(),key:n.key}),r.color},datumProps(e){return function({hc:e,coloring:t,scales:n,key:r,addMeasureIx:i},o=0){let a,s;const l=r,{nil:c}=t;"field"===t.mode&&t.field?a=t.field:n[r]&&"field"===t.mode&&(a=n[r].data.field||t.field),a?(s={field:a,reduce:"first"},"color"===t.type&&(s.value=e=>{return"NaN"!==e.qNum?`rgba(${[(16711680&(t=e.qNum))>>16,(65280&t)>>8,255&t,((4278190080&t)>>>24)/255].join(",")})`:e.qText&&Kn(e.qText)?e.qText:c;var t})):"dimension"===t.mode?s=void 0!==t.field?t.field:e.qDimensionInfo.length-1:"measure"===t.mode&&(s=o);const u={[l]:s};return e.qDimensionInfo.length>1&&(u[`${l}IsAnOther`]={fields:e.qDimensionInfo.map((e,t)=>({field:`qDimensionInfo/${t}`})),value:e=>-1!==e.indexOf(-3)}),i&&(u[`${l}MeasureIdx`]=o),u}({coloring:this.settingsForMeasure(e),scales:this.scales(),key:n.key,hc:n.hc,addMeasureIx:i().measureOverrides},e)},data(){const 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({eventName:e,key:t,viewState:r,chart:o,rtl:a,styleReference:s="object.legend",styleOverrides:l,settings:c={},style:u={}}={},p={}){return function(e,t,n){const r=[],i=[],o=function(e,t,n){return"categorical"===t.coloring.type?function(e,t,n){const r=Jr(e,t);if(!r.show)return!1;const{key:i,styleReference:o,styleOverrides:a,viewState:s,rtl:l,settings:c,style:u}=e,{scaleKey:p,theme:d,scales:f}=t,m=Kr({theme:d,key:o,styleOverrides:a}),{dock:h}=r.layout,y="left"===h||"right"===h?{maxLines:2,wordBreak:"break-word"}:{},g={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"};let v;"dimension"===t.coloring.fieldType&&(v=e=>e.datum.value>=0||-3===e.datum.value);const b=`${p}Legend`;return Sn(!0,r,{type:"legend-cat",key:`${i}-cat`,scale:b in f?b:p,settings:{layout:{scrollOffset:()=>s?s.get("legendScrollOffset"):void 0,size:-1!==["top","bottom"].indexOf(r.layout.dock)?2:1,direction:l?"rtl":"ltr",horizontal:20},item:{show:v,label:{fill:m.label.color,fontSize:m.label.fontSize,fontFamily:m.label.fontFamily,...y}},navigation:{disabled:n,button:{content:(e,{direction:t})=>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:g[t]})])])}}},brush:{consume:[{context:"selection",data:["",i],style:{inactive:{opacity:.3}}}]}},{settings:c,style:u})}(e,t,n):"continuous"===t.coloring.type&&function(e,t){const{key:n,styleReference:r,styleOverrides:i,rtl:o,settings:a,style:s}=e,{scaleKey:l,theme:c}=t,u=`${l}Range`,p=Jr(e,t);if(!p.show)return!1;const d=Kr({theme:c,key:r,styleOverrides:i}),{dock:f}=p.layout,m="right"===f||"left"===f,h=t.scales?.[u];return m&&h&&(h.invert=!0),Sn(!0,p,{type:"legend-seq",key:`${n}-seq`,settings:{fill:l,major:u,length:1,tick:{fill:d.label.color,fontSize:d.label.fontSize,fontFamily:d.label.fontFamily},title:{anchor:!o||"top"!==p.layout.dock&&"bottom"!==p.layout.dock?void 0:"right",padding:parseFloat(p.settings.title.fontSize)||16}}},{settings:a,style:s})}(e,t)}(e,t,n&&n.navigationDisabled);return r.push(o),o&&"legend-cat"===o.type&&(i.push(Xr(e,n)),i.push(Zr(e,n))),{interactions:i,components:r}}({eventName:e,key:t,rtl:a,viewState:r,chart:o,styleReference:s,styleOverrides:l,settings:c,style:u},{legendProps:n.legendProps,scaleKey:n.key,coloring:i(),theme:n.theme,hc:n.hc,scales:this.scales()},p)}};return o}const ei=e=>e.baseColor||e.coloring&&e.coloring.baseColor;function ti(e){const{qDimensionInfo:t,qMeasureInfo:n}=e.qHyperCube,r=t.some(ei),i=n.some(ei),o=e.color.useBaseColors;return"measure"===o&&!i||"dimension"===o&&!r?"off":o}const ni=e=>e.baseColor||e.coloring&&e.coloring.baseColor;function ri(e){const t=e.qHyperCube.qDimensionInfo.some(ni),n=e.qHyperCube.qMeasureInfo.some(ni);return{mode:"primary",useBaseColors:(t?"dimension":void 0)??(n?"measure":void 0)??"off",paletteColor:null}}const ii=()=>{};var oi="center",ai="bottom",si=[{key:"NoDataExist",alignment:oi,condition:({layoutService:e})=>{if(!e)return!1;const{x:t,y:n}=e.meta.size;return t*n===0}},{key:"OnlyNanDataMeasure",translationKey:"OnlyNanData",alignment:oi,condition:({layoutService:e})=>!!e&&e.getHyperCubeValue("qMeasureInfo").every(e=>"NaN"===e.qMin&&"NaN"===e.qMax)},{key:"OnlyNanDataDimensionContinuous",translationKey:"OnlyNanData",alignment:oi,condition:({layoutService:e})=>{if(!e)return!1;const{isContinuous:t}=e.meta;if(!t)return!1;const n=e.getHyperCubeValue("qDimensionInfo.0");return n&&(n.qMax<n.qMin||"NaN"===n.qMax)}},{key:"OnlyNegativeOrZeroValues",alignment:oi},{key:"DataRangeIncludingZero",alignment:ai},{key:"LimitedData",alignment:ai},{key:"NegativeOrZeroValues",alignment:ai}].reduce((e,t)=>(e[t.key]=t,e),{});const li=()=>!1;function ci(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}const ui=["__proto__","constructor"];function pi(e,t,n){if(void 0===e||void 0===t)return;const r=t.split("."),i=r[r.length-1];if(ui.some(e=>r.includes(e)))return;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]}function di(){let e={};return{get:t=>e[t],set:(t,n)=>(e[t]=n,n),has:t=>t in e,remove(t){delete e[t]},empty(){e={}}}}function fi(e,t=50){let n;return function(...r){clearTimeout(n),n=setTimeout(()=>e.apply(this,r),t)}}function mi({originalArray:e,newArray:t,matchKey:n}){return Array.isArray(e)&&e.length?(t.forEach(t=>{let r=-1;e.some((e,i)=>(e[n]&&e[n]===t[n]&&(r=i),r)),r>-1?e[r]=t:e.push(t)}),e):t}function hi(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 yi(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 gi(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 vi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gi(Object(n),!0).forEach(function(t){yi(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gi(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var bi=Object.prototype.hasOwnProperty,xi=Object.prototype.toString,qi=Object.defineProperty,Di=Object.getOwnPropertyDescriptor,Si=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===xi.call(e)},Ci=function(e){if(!e||"[object Object]"!==xi.call(e))return!1;var t,n=bi.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&bi.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||bi.call(e,t)},wi=function(e,t){qi&&"__proto__"===t.name?qi(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},Ei=function(e,t){if("__proto__"===t){if(!bi.call(e,t))return;if(Di)return Di(e,t).value}return e[t]},Ii=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=Ei(s,n),s!==(i=Ei(t,n))&&(u&&i&&(Ci(i)||(o=Si(i)))?(o?(o=!1,a=r&&Si(r)?r:[]):a=r&&Ci(r)?r:{},wi(s,{name:n,newValue:e(u,a,i)})):void 0!==i&&wi(s,{name:n,newValue:i}));return s};function Ai(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 Mi(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 Li(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,p=e.columnOrder,d=r;if(i.field&&i.field!==n){const e=Ai(i.field,o,{cache:t},p);if(-1===e)return;d=Ii({qRow:a},e(s))}c[u]=Mi(i,d,{key:l})}function ki(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,p=c.main,d=Object.keys(u),f=!!i[e].trackBy,m=typeof i[e].trackBy,h={},y=[],g=[];for(let t=0;t<a.qDataPages.length;t++){const o=Ai(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=Ii({qRow:v},o(a.qDataPages[t].qMatrix[c])),x=Mi(p,b,{key:s});if(!p.filter||p.filter(b)){for(let e=0;e<d.length;e++){const r=u[d[e]];let i=r.fields||[r];r.fields&&(x[d[e]]=[]);for(let o=0;o<i.length;o++)Li({cache:n,f:l,mainCell:b,p:i[o],prop:d[e],page:a.qDataPages[t],rowIdx:v,row:a.qDataPages[t].qMatrix[c],sourceKey:s,target:r.fields?x[d[e]]:x,targetProp:r.fields?o:d[e],columnOrder:a.qColumnOrder});if(r.fields){const t=x[d[e]].map(e=>e.value),n=x[d[e]].map(e=>e.label);x[d[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[d[e]].value)}}}f&&r.track({cfg:i[e],itemData:b,obj:x,target:y,tracker:h,trackType:m}),g.push(x)}}}const v=f?r.collect(y,{main:p,propsArr:d,props:u}):g;o=[...o,...v]}return o}function Ti(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 Ni(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=Pi)):void 0===t&&(t=Oi);for(var n,r,i,o,a,s=new ji(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 ji(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(Ri)}function Oi(e){return e.children}function Pi(e){return Array.isArray(e)?e[1]:null}function Fi(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function Ri(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function ji(e){this.data=e,this.depth=this.height=0,this.parent=null}function Hi(e){return null==e?null:function(e){if("function"!=typeof e)throw new Error;return e}(e)}ji.prototype=Ni.prototype={constructor:ji,count:function(){return this.eachAfter(Ti)},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 Ni(this).eachBefore(Fi)},[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 zi={depth:-1},Vi={},_i={};function $i(e){return e.id}function Bi(e){return e.parentId}function Ui(e){let t=e.length;if(t<2)return"";for(;--t>1&&!Wi(e,t););return e.slice(0,t)}function Wi(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(!(1&n))return!0}return!1}function Ki(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=Ki(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]=Ki(r,i[e]);return t}n[e]in i&&(i=i[n[e]])}return i}function Yi(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,...Yi(e[i].children,t-1,n)]);return r}function Gi(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=>Yi(e.children,r-1,n)}return!1}const Ji=/^qDimensionInfo(?:\/(\d+))?/,Zi=/^\/?qMeasureInfo\/(\d+)/,Xi=/\/qAttrExprInfo\/(\d+)/,Qi=/\/qAttrDimInfo\/(\d+)/;function eo(e){return(e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map((e,t)=>t)).filter(t=>t<e.qDimensionInfo.length)}function to(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,p=r;const d=n.qEffectiveInterColumnSortOrder,f=eo(n);return Ji.test(p)&&(i=!0,o=+Ji.exec(p)[1],p=r.replace(Ji,"")),Zi.test(p)&&("K"===n.qMode?c=+Zi.exec(p)[1]:d&&-1!==d.indexOf(-1)?(c=+Zi.exec(p)[1],u=0):u=+Zi.exec(p)[1],p=p.replace(Zi,"")),p&&(Qi.exec(p)?s=+Qi.exec(p)[1]:Xi.exec(p)&&(a=+Xi.exec(p)[1])),l=i?"S"===n.qMode?f[o]:d?d.indexOf(o):o:d&&-1!==d.indexOf(-1)?d.indexOf(-1):n.qDimensionInfo.length-("K"===n.qMode?0:1),{fieldDepth:l+1,pseudoMeasureIndex:c,measureIdx:u,attrDimIdx:s,attrIdx:a}}function no(e,t){let n,r,i=Gi(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 ro(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 io(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 p=l[n];let d,f,m,h,y,g;if("primitive"===p.type?(m=p.value,g=String(p.value)):("function"==typeof p.value&&(d=e=>p.value(e,r)),"function"==typeof p.label&&(f=e=>p.label(e,r)),p.accessor?(h=p.accessor(r),Array.isArray(h)?(y=h.map(p.valueAccessor),p.attrAccessor&&(y=y.map(p.attrAccessor)),d&&(m=y.map(d),d=null),f&&(g=y.map(f),f=null),m=p.reduce?p.reduce(m):m,g=p.reduceLabel?p.reduceLabel(g,m):String(m)):(m=p.attrAccessor?p.attrAccessor(p.valueAccessor(h)):p.valueAccessor(h),g=m)):(m=i,g=i)),s.fields){const e=d?d(m):m;c.push(e),u.push(f&&null!=g?f(g):null!=g?g:String(e))}else{const n=d?d(m):m;o[t[e]]={value:n,label:f?f(g):null!=g?g:String(n)},p.field&&(o[t[e]].source={field:p.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 oo=(e,t,n)=>{const r="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",i="K"===e.qMode?"qSubNodes":"qNodes",o=Ki(r,e);return o&&o[0]?(t.tree=Ni(o[0],n.children||(e=>e[i])),t.tree):null},ao=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=no(i,to(t.field,{cube:r}));t.accessor=e.nodeFn,t.valueAccessor=e.valueFn,t.attrAccessor=e.attrFn}}}};function so(){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]=vi({__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=$i,n=Bi;function r(r){var i,o,a,s,l,c,u,p,d=Array.from(r),f=t,m=n,h=new Map;if(null!=e){const t=d.map((t,n)=>function(e){let t=(e=`${e}`).length;return Wi(e,t-1)&&!Wi(e,t-2)&&(e=e.slice(0,-1)),"/"===e[0]?e:`/${e}`}(e(t,n,r))),n=t.map(Ui),i=new Set(t).add("");for(const e of n)i.has(e)||(i.add(e),t.push(e),n.push(Ui(e)),d.push(_i));f=(e,n)=>t[n],m=(e,t)=>n[t]}for(a=0,i=d.length;a<i;++a)o=d[a],c=d[a]=new ji(o),null!=(u=f(o,a,r))&&(u+="")&&(p=c.id=u,h.set(p,h.has(p)?Vi:c)),null!=(u=m(o,a,r))&&(u+="")&&(c.parent=u);for(a=0;a<i;++a)if(u=(c=d[a]).parent){if(!(l=h.get(u)))throw new Error("missing: "+u);if(l===Vi)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===_i&&1===s.children.length;)s=s.children[0],--i;for(let e=d.length-1;e>=0&&(c=d[e]).data===_i;--e)c.data=null}if(s.parent=zi,s.eachBefore(function(e){e.depth=e.parent.depth+1,--i}).eachBefore(Ri),s.parent=null,i>0)throw new Error("cycle");return s}return r.id=function(e){return arguments.length?(t=Hi(e),r):t},r.parentId=function(e){return arguments.length?(n=Hi(e),r):n},r.path=function(t){return arguments.length?(e=Hi(t),r):e},r}().id(e=>e.__id).parentId(e=>e.__parent)(l)}(t):oo(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=eo(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(vi(vi({},e),{},{field:a?a.key():void 0}),t),c=s.props,u=s.main,p=Object.keys(c);l[o]={propsArr:p,props:c,main:u};const d=a?to(a,{cube:i}):{fieldDepth:0};ao({propsArr:p,props:c,cube:i,cache:n,itemDepthObject:d,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=ro(r,a,{key:o});io({propsArr:t,props:n,item:i,itemData:a,ret:s,sourceKey:o}),u[e].data=s}return a}function lo(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(!oo(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),p=u.props,d=u.main,f=Object.keys(p),m=to(c,{cube:s}),h=no({fieldDepth:0},m),y=h.nodeFn,g=h.attrFn,v=h.valueFn;ao({propsArr:f,props:p,cube:s,cache:n,itemDepthObject:m,f:c});const b=!!i[a].trackBy,x=typeof i[a].trackBy,q={},D=[],S=y(n.tree),C=[];for(let e=0;e<S.length;e++){const t=S[e],n=g?g(v(t)):v(t);if(d.filter&&!d.filter(n))continue;const o=ro(d,n,{key:l});io({propsArr:f,props:p,item:t,itemData:n,ret:o,sourceKey:l}),b&&r.track({cfg:i[a],itemData:n,obj:o,target:D,tracker:q,trackType:x}),C.push(o)}const w=b?r.collect(D,{main:d,propsArr:f,props:p}):C;o=[...o,...w]}return o}var co,uo,po=(co=function(e){
|
|
8
8
|
/*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
|
|
9
|
-
e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,c,u,p,d=e.length,f=e.search(/[0-9\-\+#]/),m=f>0?e.substring(0,f):"",h=e.split("").reverse().join(""),y=h.search(/[0-9\-\+#]/),g=d-y,v=e.substring(g,g+1),b=g+("."===v||","===v?1:0),x=y>0?e.substring(b,d):"";if(n=(t="-"===(e=e.substring(f,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(h="",g=(p=t[0]).length%l,d=p.length,b=0;b<d;b++)h+=p.charAt(b),!((b-g+1)%l)&&b<d-l&&(h+=o);t[0]=h}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),m+(n?"-":"")+r+x}},co(uo={exports:{}}),uo.exports);function fo(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const mo={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"},ho=/%\)?$/,yo=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,go=/^\(oct\)/i,vo=/^\(dec\)/i,bo=/^\(hex\)/i,xo=/^\(bin\)/i,qo=/^\(rom\)/i,Do=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,So=/#|0/g;function Co(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 wo(e,t,n){const r=fo(e);return n?r:new RegExp(r||"",t)}function Eo(e,t,n,r){let i,o,a,s,l,c,u,p,d,f=e.pattern;var m,h;r&&(e.abbreviate=!0),m=t,(h=n)&&(h=fo(h)),m&&(m=fo(m)),d=new RegExp("(?:[#0]+".concat(m,")?[#0]+(?:").concat(h,"[#0]+)?")),a=f.match(d),a=a?a[0]:"",s=a?f.substr(0,f.indexOf(a)):f,l=a?f.substring(f.indexOf(a)+a.length):"",a||(a=f?"#":"##########"),t&&t===n&&(i=a.split(n),o=i.pop(),a=i.join("")+n+o,t=""),c=t,t=/,/.test(n)?"¤":",",c&&(a=a.replace(wo(c,"g"),t)),u=n,n=".",u&&(a=a.replace(wo(u,"g"),n)),p=a.match(/#/g),p=p?p.length:0;const y=f.split(u);let g;y[1]&&(g=y[1].match(So)),e.prefix=s||"",e.postfix=l||"",e.pattern=f,e.maxPrecision=g?g.length:2,e.percentage=ho.test(f),e.numericPattern=a||"",e.numericRegex=new RegExp("".concat(wo(t,null,!0),"|").concat(wo(n,null,!0)),"g"),e.groupTemp=c,e.decTemp=u,e.t=t,e.d=n,e.temp=p}class Io{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 mo;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 Io(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],Do.test(e[0])&&(r.positive.isFunctional=!0),e[1]?Do.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?Do.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1;const i="U"===this.type;r.positive.isFunctional||Eo(r.positive,t,n,i),r.negative&&!r.negative.isFunctional&&Eo(r.negative,t,n,i),r.zero&&!r.zero.isFunctional&&Eo(r.zero,t,n,i)}formatValue(e){let t,n,r,i,o,a,s,l,c,u=this._prepared,p="",d="",f=e;if(isNaN(e))return"".concat(f);if(e=+e,!1===u.pattern)return e.toString();if(0===e&&u.zero)return u=u.zero,u.pattern;if(e<0&&u.negative?(u=u.negative,e=-e):u=u.positive,o=u.d,a=u.t,u.isFunctional)e=function(e,t,n){let r;return yo.test(t)?e=Co(e,Number(/\d{2}/.exec(t)[0]),t,n):go.test(t)?e=Co(e,8,t,n):vo.test(t)?e=Co(e,10,t,n):bo.test(t)?e=Co(e,16,t,n):xo.test(t)?e=Co(e,2,t,n):qo.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&&(p=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=po(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)/,""),d=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(r)/Math.log(10)))),s=0;s<t;s++)l+="#";e=po(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+d+p+u.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function Ao(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),p=Object.create(null),d=0,f=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)=>(d>=r&&(delete u[p[f]],delete p[f],d--,f++),u[e]=t,p[d]=e,d++,t),l.get=e=>u[e],l.has=e=>e in u,l.clear=()=>{u=Object.create(null),p=Object.create(null),d=0,f=0},l.size=()=>d,l}function Mo(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 Io(...t)}(i,e,t,n,r),a=Ao(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 Lo="D",ko="T",To="TS",No=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Oo=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Po=["January","February","March","April","May","June","July","August","September","October","November","December"],Fo=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ro(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function jo(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}class Ho{constructor(e,t,n){const r=e||{};r.qCalendarStrings||(r.qCalendarStrings={qLongDayNames:No,qDayNames:Oo,qLongMonthNames:Po,qMonthNames:Fo}),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={[ko]:r.qTimeFmt||"hh:mm:ss",[Lo]:r.qDateFmt||"YYYY-MM-DD",[To]:r.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]),this.pattern=t}clone(){const e=new Ho(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*jo(t),r=60*jo(n),i=60*jo(r),o=1e3*jo(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:Ro("".concat(a.year).slice(-2),2),YYY:Ro("".concat(a.year).slice(-3),3),def:e=>Ro("".concat(a.year),e.length)},"M+":{M:a.month+1,MM:Ro("".concat(a.month+1),2),MMM:o.locale_months_abbr[a.month],def:o.locale_months[a.month]},"W+|w+":{W:a.day,WW:Ro("".concat(a.day),2),WWW:o.locale_days_abbr[a.day],def:o.locale_days[a.day]},"D+|d+":{D:a.date,def:e=>Ro("".concat(a.date),e.length)},"h+|H+":{h:a.h,def:e=>Ro("".concat(a.h),e.length)},"m+":{m:a.m,def:e=>Ro("".concat(a.m),e.length)},"s+|S+":{s:a.s,def:e=>Ro("".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 zo(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Ho(...t)}function Vo(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=zo(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),r=Ao(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=zo(i,e,t),r=Ao(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 _o(){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),p="dimension"===l?"first":"avg",d=function(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return Vo(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"),Mo(n,r,i,o,t)}(n,o),f={id:()=>r,key:()=>i,raw:()=>n,title:()=>n.qFallbackTitle||n.label,type:()=>l,origin:()=>c,items:()=>(e||(e=a(f)),e),min:()=>n.qMin,max:()=>n.qMax,value:u,label:e=>(null==e?void 0:e.qText)||"",reduce:p,reduceLabel:"dimension"===l?"first":(e,t)=>d(t),formatter:()=>d,tags:()=>n.qTags};return f}function $o(e,t,n,r,i){return(t[e]||[]).map((t,o)=>{const a="".concat(r?"".concat(r,"/"):"").concat(e,"/").concat(o),s={instance:_o(Ii({id:"".concat(n?"".concat(n,"/"):"").concat(a),key:a,meta:t},i))};return s.attrDims=$o("qAttrDimInfo",t,n,a,Ii({},i,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),s.attrExps=$o("qAttrExprInfo",t,n,a,Ii({},i,{value:e=>null==e?void 0:e.qNum,type:"measure"})),s.measures=$o("qMeasureInfo",t,n,a,Ii({},i,{value:e=>null==e?void 0:e.qValue,type:"measure"})),s})}function Bo(){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=Bo.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=lo,l.hierarchy=so,l.pages="K"===a.qMode?a.qStackedDataPages:a.qTreeDataPages):"S"===a.qMode?(l.extractor=ki,l.pages=a.qDataPages,l.hierarchy=so):l.extractor=()=>[],l.fieldExtractor=e=>l.extractor({field:e},c,o,s);const u="S"===a.qMode?e=>e.qElemNumber:void 0,p="S"===a.qMode?e=>e.qNum:void 0;o.wrappedFields.push(...$o("qDimensionInfo",a,t,"",Ii({},l,{value:u,type:"dimension"}))),o.wrappedFields.push(...$o("qMeasureInfo",a,t,"",Ii({},l,{value:p,type:"measure"}))),o.fields=o.wrappedFields.map(e=>e.instance);const d=e=>{e.forEach(e=>{o.allFields.push(e.instance),d(e.measures),d(e.attrDims),d(e.attrExps)})};return d(o.wrappedFields),(i.virtualFields||[]).forEach(e=>{const n=c.field(e.from),r=_o(vi({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 Uo=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],Wo=/\/qDimensionInfo(?:\/(\d+))?/,Ko=/\/qMeasureInfo\/(\d+)/,Yo=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,Go=/\/qAttrExprInfo\/(\d+)/,Jo=/\/?qHyperCube/,Zo=/\/?qTreeData/,Xo=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),Qo=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function ea(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;Jo.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),a=Xo):Zo.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),a=Qo);let s=!0;if(Wo.test(e)&&(r=+Wo.exec(e)[1]),Ko.test(e)&&(i=+Ko.exec(e)[1]),Yo.test(e)){i=-1,r=0;const e=+Yo.exec(n)[2];isNaN(e)||(r=e,n=n.replace(/\/\d+$/,"")),s=!1}if(Go.test(e)){const e=i;if(t){i=0;const a=Ki(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+=+Go.exec(n)[1]}else r>-1?(r=-1,i=+Go.exec(n)[1]):i+=+Go.exec(n)[1]+1}return Uo.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 hi(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)?hi(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 ta(e){Bo.util=e.data("matrix").util,e.data("q",Bo),e.formatter("q-number",Mo),e.formatter("q-time",Vo)}function na({layout:e,path:t}){const n=ci(e||{},t.split("/").join("."));if(!n)return!1;const{qIsOneAndOnlyOne:r=!1}=n;return r}function ra({brush:e,colorField:t,legendAlias:n,useLegendCube:r=!1}){!t||/qAttrDimInfo/.test(t)?(e.removeKeyAlias("attrDim/qDimensionInfo/0"),n&&e.removeKeyAlias(n),e.addKeyAlias("attrDim/qDimensionInfo/0",`qHyperCube/${t}`)):r&&e.addKeyAlias(n,`qHyperCube/${t}`)}ta.qBrushHelper=ea,ta.selections=ea;const ia="Shift";const oa=(e,t)=>t[e]?oa(e+1,t):e,aa=(e,t)=>{const n=t.reduce((e,t)=>(e[t]=!0,e),{});return e.reduce((e,t,r)=>{const i=oa(r,n);return n[i]=!0,e[r]=i,e},{})};function sa({layout:e,filtered:t={}}={}){const{qDimensionInfo:n=[],qMeasureInfo:r=[]}=e?.qHyperCube||{};return{dimensions:aa(n,t.dimensions||[]),measures:aa(r,t.measures||[])}}function la({selection:e,fieldMap:t}){const{method:n,params:r}=e;if("selectHyperCubeValues"===n){const e=t.dimensions[r[1]];void 0!==e&&(r[1]=e)}return"selectHyperCubeContinuousRange"===n&&r[1].forEach(e=>{const n=t.dimensions[e.qDimIx];void 0!==n&&(e.qDimIx=n)}),e}const ca=[];let ua=0;const pa=e=>{const t=ca.filter(e=>e.selections?.isActive());t.length&&("Enter"===e.key?t.forEach(e=>e.selections.confirm()):"Escape"!==e.key&&"Esc"!==e.key||t.forEach(e=>e.selections.cancel()))};function da({selections:e,brush:t,majorScale:n,actions:r,selectionsFn:i}={},{path:o="/qHyperCubeDef"}={}){if(!e)return{layout:()=>{},filteredFields:()=>{},allowSimultaneous:()=>{},release:()=>{}};const a=++ua;let s=null,l={dimensions:[],measures:[]},c=[],u={};e.on=e.on.bind(e),e.isActive=e.isActive.bind(e),e.addListener=e.addListener.bind(e),e.removeListener=e.removeListener.bind(e);const{rangeInterceptor:p,interceptor:d}=function({brush:e,getConfig:t}){return{interceptor:n=>{const r=e.brushes(),{allowSimultaneous:i,layout:o={}}=t();r.forEach(t=>{("range"===t.type||n[0]?.key&&n[0]?.key!==t.id&&0!==i.indexOf(n[0]?.key))&&e.clear([])});const a=n.filter(e=>-2!==e.value);if(a.length>1){const e=function({layout:e={},values:t=[]}){if(!t?.length)return[];const n=Array.from(new Set(t.map(e=>e.key))),r=[];return n.forEach(n=>{const i=na({layout:e,path:n}),o=t.filter(e=>e.key===n),a=i?[o.pop()]:o;r.push(...a)}),r.filter(Boolean)}({layout:o,values:a});return e}return a},rangeInterceptor:n=>{const r=e.brushes(),{allowSimultaneous:i}=t();return r.filter(e=>"value"===e.type).length?(e.clear([]),n):(r.forEach(t=>{const r=t.id===n[0].key||i.includes(t.id)&&i.includes(n[0].key);"range"!==t.type||r||e.clear([])}),n)}}}({brush:t,getConfig:()=>({layout:s,allowSimultaneous:c})});t.intercept("set-ranges",p),t.intercept("toggle-ranges",p),t.intercept("toggle-values",d),t.intercept("set-values",d),t.intercept("add-values",d),t.on("start",()=>e.begin(o));const f={activate:()=>{},deactivated:()=>t.end(),cleared:()=>t.clear(),canceled:()=>t.end()};var m,h;m=e,h=f,Object.keys(h).forEach(e=>{m.on(e,h[e])});const y=n?.max?.();return r?.select?(r.select.on("start",(...e)=>{t.start(),"function"==typeof r.select.getBrushOptions&&(u=r.select.getBrushOptions(...e))}),r.select.on("end",()=>{const n=i(t,u,s),o=sa({layout:s,filtered:l});n.forEach(t=>{const n=la({selection:t,fieldMap:o});!function(e,t,n){if(!t||void 0===n||"selectHyperCubeContinuousRange"!==e.method)return;const{params:r}=e;if(!r||!r[1]||!r[1][0])return;const{qDimIx:i,qRange:o}=r[1][0];"undefined"!==i&&o&&!1===o.qMaxInclEq&&o.qMax>=n&&(o.qMaxInclEq=!0)}(n,r.select.brushSelectionIncludeMax,y),e.select(n)})})):t.on("update",()=>{const n=i(t,u,s),r=sa({layout:s,filtered:l});n.forEach(t=>{e.select(la({selection:t,fieldMap:r}))})}),0===ca.length&&document.addEventListener("keyup",pa),ca.push({key:a,selections:e}),{layout:e=>{s=e},filteredFields:e=>{l=e},allowSimultaneous:e=>{c=e},release:()=>{s=null;const t=ca.indexOf(ca.filter(e=>e.key===a)[0]);-1!==t&&ca.splice(t,1),ca.length||document.removeEventListener("keyup",pa),((e,t)=>{Object.keys(t).forEach(n=>{e.removeListener(n,t[n])})})(e,f)}}}function fa({chart:e,document:t,selectionInfo:n,eventName:r,componentName:i,brushName:o="selection",emit:a="rangeClear"}){const s=n.event===r,l=t.querySelector(`[data-key='${i}-edge-0']`);if(s||!l)return!1;const c=e.component(i);return!!c&&(c.emit(a),"string"==typeof o&&e.brush(o).clear(),c)}const ma=({chart:e,document:t,selections:n,selectionInfo:r,...i})=>{i.clearDiscrete(),i.clearContinuous(),i.clearMinor(),i.clearRange(),i.clearTap(),i.clearLegend()};function ha({lasso:e}){e?.active?.()&&e?.action(!1)}function ya({chart:e,selectionInfo:t,selectionActions:n,actions:r={},selections:i,selectionEvents:o}){if(!1===n||!1===o)return()=>{};const{reset:a=ha,clear:s}=n,l=!1!==s&&function({clear:e=ma,selections:t,selectionInfo:n,chart:r}){return({cleared:i}={})=>{const o={selections:t,selectionInfo:n,chart:r,document:document,cleared:i};return e({clearDiscrete:(e={})=>function({selectionInfo:e,chart:t,document:n,eventName:r="discreteRange",componentName:i="discrete-range-brush",cleared:o=!1,brushName:a}){return fa({selectionInfo:e,chart:t,document:n,eventName:o?void 0:r,componentName:i,emit:"areaClear",brushName:a})}({...o,...e}),clearContinuous:(e={})=>function({selectionInfo:e,chart:t,document:n,eventName:r="continuousRange",componentName:i="continuous-range-brush",cleared:o=!1,brushName:a}){return fa({selectionInfo:e,chart:t,document:n,eventName:o?void 0:r,componentName:i,brushName:a})}({...o,...e}),clearMinor:(e={})=>function({selectionInfo:e,chart:t,document:n,componentName:r="minor-range-brush",eventName:i="minorRange",cleared:o=!1,brushName:a=!1}){const s=fa({selectionInfo:e,chart:t,document:n,eventName:o?void 0:i,componentName:r,brushName:a});if(!s)return;const{scale:l,brush:c}=s.settings.settings,u=t.scale(l).data().fields.map(e=>e.id()),p=t.brush(c),d=p.brushes().filter(e=>"range"===e.type&&u.some(t=>t===e.id));p&&d.length&&d.forEach(e=>{p.removeRanges(e.brush.ranges().map(t=>({key:e.id,range:t})))})}({...o,...e}),clearRange:(e={})=>function({selectionInfo:e,chart:t,document:n,selections:r,eventName:i="xAxis",cleared:o=!1}){fa({selectionInfo:e,chart:t,document:n,eventName:o?void 0:i,componentName:`${i}-range-brush`,emit:"areaClear",brushName:!1})&&r.clear()}({...o,...e}),clearTap:(e={})=>function({chart:e,selectionInfo:t,selections:n,events:r=["tap"],brushNames:i=[]}){if(!t||!r.includes(t.event))return;const{currentComponent:o,previousComponent:a}=t;a!==o&&(n.clear(),i.forEach(t=>e.brush(t).end()))}({...o,...e}),clearLegend:(e={})=>function({selectionInfo:e,chart:t,document:n,selections:r,eventName:i="legendRange",componentName:o="legend-range-brush",cleared:a=!1,brushName:s=!1}){fa({selectionInfo:e,chart:t,document:n,eventName:a?void 0:i,componentName:o,brushName:s})&&r.clear()}({...o,...e}),...o})}}({clear:s,selections:i,selectionInfo:t,chart:e}),c=function({chart:e,actions:t,reset:n,clear:r}){let i=!1;const o={deactivated(e){const{lasso:r=!1}=t||{};n({e:e,lasso:r})},canceled(i){const{lasso:o=!1}=t||{};n({e:i,lasso:o}),r({e:i,chart:e,document:document})},cleared(t){i||(i=!0,r({e:t,chart:e,document:document,cleared:!0}),i=!1)}};return!1===n&&delete o.deactivated,!1===r&&delete o.cleared,!1===n&&!1===r&&delete o.canceled,o}({chart:e,clear:l,reset:a,actions:r}),u={};Object.entries(c).forEach(([e,t])=>{u[e]=((e,t)=>t?n=>t({event:n,defaultFunc:e}):e)(t,o[e])});const p=function({selectionEvents:e,selections:t,selectionInfo:n,clear:r,chart:i,document:o}){const{start:a}=e,s={selections:t,selectionInfo:n,chart:i,document:o},l=e=>Object.assign(n,e||{}),c=({event:e,components:t})=>()=>(({selectionInfo:e={},setSelectionInfo:t,clear:n,event:r,components:i=[]})=>{t({...e,event:r,components:i.map(e=>e.key).filter(Boolean)}),n()})({event:e,components:t,clear:r,selectionInfo:n,setSelectionInfo:l});return"function"==typeof a?(e,t=[])=>{a({defaultFunc:c({event:e,components:t}),setSelectionInfo:l,clear:r,...s,event:e,components:t})}:(e,t=[])=>{c({event:e,components:t})()}}({selectionEvents:o,selections:i,selectionInfo:t,clear:l,chart:e,document:document});return r?.select?.on("start",p),Object.entries(u).forEach(([e,t])=>{i?.on(e,t)}),function(){r?.select?.removeListener("start",p),Object.entries(u).forEach(([e,t])=>{i?.removeListener(e,t)})}}const ga=[{key:"qHyperCube/qDimensionInfo/0:numeric",includeMax:!1}];function va({chart:e,actions:t,selections:n,picassoQ:r,config:i}){const{allowSimultaneous:o=!1,majorScale:a,selectionActions:{clear:s,reset:l}={},selectionEvents:c={deactivated:void 0,canceled:void 0,cleared:void 0,start:void 0},brushEvents:u={},brushName:p="selection",brushMaxListeners:d=20,brushRanges:f=!1,interceptors:m={},selectionsFn:h=r.selections}=i,y=e.brush(p);if("number"==typeof d&&y.setMaxListeners(d),f){const e=!0===f?ga:f;y.configure({ranges:e})}const g={canSelect:!0,getIsSelectionLocked:!1,isInnerDimensionLocked:!1,lockedDimensions:[],singleSelectIndex:0,selectionInfo:{colorField:void 0,components:[],event:void 0,currentComponent:void 0,previousComponent:void 0}},v=da({brush:y,majorScale:a,actions:t,selections:n,selectionsFn:h});!function({brush:e,interceptors:t={}}){Object.entries(t).forEach(([t,n])=>{(Array.isArray(n)?n:[n]).forEach(n=>{e.intercept(t,n)})})}({brush:y,interceptors:m});const b=function({chart:e,selectionActions:t,brush:n,actions:r,selectionInfo:i,selections:o,selectionEvents:a,brushEvents:s}){const l=function({brush:e,chart:t,selectionInfo:n,brushEvents:r={}}){const i=Object.entries(r).map(([r,i])=>{const o=()=>i({chart:t,selectionInfo:n});return e.on(r,o),[r,o]});return function(){i.forEach(([t,n])=>{e.removeListener(t,n)})}}({brush:n,chart:e,selectionInfo:i,brushEvents:s}),c=ya({chart:e,selectionInfo:i,selectionActions:t,actions:r,selections:o,selectionEvents:a}),u=function({actions:e}){if(!e?.lasso)return()=>{};let t=!1;const n=n=>{t||n.key!==ia||(e.lasso.action(!0),t=!0)},r=n=>{n.key===ia&&(e.lasso.action(!1),t=!1)};return document.addEventListener("keydown",n),document.addEventListener("keyup",r),function(){document.removeEventListener("keydown",n),document.removeEventListener("keyup",r)}}({actions:r});return function(){l(),c(),u()}}({chart:e,brush:y,actions:t,selections:n,selectionInfo:g.selectionInfo,selectionActions:{clear:s,reset:l},selectionEvents:c,brushEvents:u});if(o){const e=!0===o?[...Array(15)].map((e,t)=>`qHyperCube/qMeasureInfo/${t}`):o;v.allowSimultaneous(e)}return{unbindEvents:b,state:g,picassoSelections:v,brush:y}}function ba({chart:e,selections:t,actions:n=!1,config:r={}}){const{unbindEvents:i,state:o,picassoSelections:a,brush:s}=va({chart:e,actions:n,selections:t,picassoQ:ta,config:r}),{custom:l={},legendAlias:c,setBrushAliases:u=ra}=r;return{getIsDimensionLocked:(e=0)=>o.lockedDimensions[e],getIsSelectionLocked:(e=[])=>t?.isLocked?.()??function(e=[]){return!!e?.length&&e.filter(e=>"object"==typeof e.data&&Array.isArray(e.data.fields)).every(e=>e.data.fields.every(e=>{const t=e.raw();return!(!t.qLocked&&t.qCardinal)}))}(e),getIsSingleSelect:(e=o.singleSelectIndex)=>o.singleSelectDimensions[e],getCanSelect:()=>o.canSelect,getSelectionsObject:()=>t,getSelectionInfo:()=>o.selectionInfo,setLayout:e=>{const n=function({selections:e,picassoSelections:t,layout:n}){const r={lockedDimensions:[],singleSelectDimensions:[]};e?.isModal?.()&&e.confirm(),t.layout(n);const{qDimensionInfo:i=[]}=n?.qHyperCube??{};return r.lockedDimensions=i.map(e=>!!e.qLocked),r.singleSelectDimensions=i.map((e,t)=>na({layout:n,path:`qHyperCube/qDimensionInfo/${t}`})),r.singleSelectIndex=function(e){const{qDimensionInfo:t=[]}=e?.qHyperCube||{},n=t.map((e,t)=>!(e.qLocked||e.qCardinalities?.qHypercubeCardinal<=1)&&t).filter(e=>"number"==typeof e);return n[0]??Math.max(t.length-1,0)}(n),r.canSelect=0===i.length||i.some(e=>!e.qLocked),r.dimensionLocked=!!i[0]?.qLocked,r}({selections:t,picassoSelections:a,layout:e});Object.assign(o,n)},setFilteredFields:e=>{a.filteredFields(e)},setBrushAliases:({colorField:e,useLegendCube:t=!1,...n})=>{const r={useLegendCube:t,colorField:e,brush:s,legendAlias:c,...n};u({...r,defaultFunc:()=>ra(r)})},destroy:()=>{i(),a.release()},custom:{...l}}}const xa="'Source Sans Pro', 'Arial', 'sans-serif'",qa="#333333",Da="#595959",Sa="#737373",Ca="#cccccc",wa="#e6e6e6";function Ea(e){const t={};return[...e,["","","color"],["object","","fontFamily"],["object","axis.label.name","color",Da],["object","axis.label.name","fontFamily",xa],["object","axis.label.name","fontSize","12px"],["object","axis.line.major","color",Ca],["object","axis.line.minor","color",wa],["object","axis.title","color"],["object","axis.title","fontFamily",xa],["object","axis.title","fontSize","13px"],["object","grid.line.highContrast","color",wa],["object","grid.line.major","color",Ca],["object","grid.line.minor","color",wa],["object","label.value","color",Da],["object","label.value","fontFamily",xa],["object","label.value","fontSize","12px"],[!1,"label.value","darkColor",Da],[!1,"label.value","lightColor",wa],["object","outOfRange","color","#999"],["object","legend.title","color",qa],["object","legend.title","fontFamily",xa],["object","legend.title","fontSize","15px"],["object","legend.label","color",Da],["object","legend.label","fontFamily",xa],["object","legend.label","fontSize","13px"],["object","referenceLine.label.name","color",qa],["object","referenceLine.label.name","fontFamily",xa],["object","referenceLine.label.name","fontSize","12px"],["object","referenceLine.outOfBounds","color",wa],["object","referenceLine.outOfBounds","fontFamily",xa],["object","referenceLine.outOfBounds","fontSize","12px"],["object","referenceLine.outOfBounds","backgroundColor",Sa,e=>"transparent"===e?Sa:e]].reduce((e,n)=>{const r=`${n[0]}-${n[1]}-${n[2]}}`;return t[r]||(t[r]=!0,e.push(n)),e},[]).sort((e,t)=>(e[0].split?e[0].split(".").length:0)-(t[0].split?t[0].split(".").length:0))}const Ia="object",Aa=e=>e;function Ma({theme:e,id:t,transform:n,extend:r,matrix:i}){const o={},a=n.reduce((e,t)=>{const[n,r]=t;return e[n]=r,e},{});return i.forEach(n=>{const[r,i,s,l,c=e=>e]=n,u=function({theme:e,base:t,path:n,attribute:r,defaultValue:i}){if(!e||!1===t)return i;const o=e.getStyle(t,n,r);return void 0===o?i:o}({theme:e,base:r===Ia&&t?`${Ia}.${t}`:r,path:i,attribute:s,defaultValue:l}),p=(a[`${i}.${s}`]||Aa)(c(u));pi(o,[i,s].filter(Boolean).join("."),p)}),r.forEach(e=>{const[t,n]=e;pi(o,t,n)}),o}const La={NOOP:()=>{},FALSE:()=>!1,ARRAY:()=>[],OBJECT:()=>({})},ka="chart-modules-tooltip",Ta=`#${ka}`;function Na(){if(!document.querySelector(Ta)){const e=document.createElement("div");e.id=ka,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 Oa({key:e,rtl:t,duration:n}){return{show:!0,key:e,type:"tooltip",layout:{displayOrder:3},beforeMount(){Na()},beforeUpdate(){Na()},destroyed(){!function(){const e=document.querySelector(Ta);e?.parentElement&&e.childElementCount<1&&e.parentElement.removeChild(e)}()},settings:{appendTo:()=>document.querySelector(Ta),direction:t?"rtl":"ltr",duration:n},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 Pa="position",Fa={bar:"rect",diamond:"path",point:"circle",square:"rect",triangle:"path","n-polygon":"path",slice:"path"};const Ra=({data:e})=>e.value,ja=({data:e})=>e?.major?.value;function Ha({chart:e,expando:t,nodes:n,collectConfig:r,collectibles:i,meta:o}){const{from:a}=r,s={chart:e,expando:t,nodes:n,collectConfig:r,collectibles:i,meta:o};switch("function"==typeof a?"custom":a){case"single":return function({nodes:e}){const[t]=e;if("container"===t.type&&t.children[0]){const[e]=t.children;return e.key=t.key,[e]}return[t]}(s);case"position":return function({chart:e,collectibles:t,meta:n}){return e.shapesAt(n.position.absolute,{components:t.map(e=>({key:e.key}))})}(s);case"dimension":return function({chart:e,nodes:t,collectConfig:n,collectibles:r,meta:i}){const[o]=t,{filter:a,after:s}=n,l="function"==typeof a?a:()=>!0,c="function"==typeof s?s:()=>{},u=r.reduce((t,r)=>{const a=Fa[r.type]||r.type;return t.push(...e.findShapes(a).filter(e=>e.key===r.key&&e.data&&function({collectConfig:e,meta:t,collectible:n,nodes:r}){const{by:i=Ra}=e,{major:o=ja}=n,a=i({data:r.triggerer.data}),s=o({data:r.candidate.data,meta:t}),l=Array.isArray(a),c=Array.isArray(s);return l&&c?a.length===s.length&&a.every((e,t)=>e===s[t]):!l&&!c&&a===s}({collectConfig:n,meta:i,collectible:r,nodes:{triggerer:o,candidate:e}}))),t},[]).filter(l);return c({collected:u,triggerer:o}),u}(s);case"radius":return function({chart:e,nodes:t,collectConfig:n,collectibles:r,meta:i}){const[o]=t,{localBounds:a}=o,{distance:s,filter:l}=n,c="function"==typeof l?l:()=>!0,u=r.map(e=>e.key);return e.shapesAt({cx:i.position.absolute.x,cy:i.position.absolute.y,r:s||Math.max(a.width,a.height)},{components:u.map(e=>({key:e}))}).filter(c)}(s);case"custom":return function({chart:e,expando:t,nodes:n,collectConfig:r,meta:i}){return r.from({chart:e,expando:t,nodes:n,meta:i})}(s);default:return[]}}const{MAX_VALUE:za}=Number;function Va({nodes:e}){const{xMin:t,xMax:n,yMin:r,yMax:i}=e.filter(e=>e.bounds.height+e.bounds.width!==0).reduce((e,t)=>{const{bounds:n}=t;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:za,xMax:-za,yMin:za,yMax:-za});return{x:t,y:r,width:n-t,height:i-r}}function _a({chart:e,config:t,expando:n,internal:r,nodes:i}){if(!i.length)return[];const[o]=i,{key:a}=o,s=t.main.collectibles.filter(e=>!e.if||e.if());if(!s.length)return[];const{triggers:l}=t.main,{collect:c,placement:u}=l.find(e=>-1!==e.keys.indexOf(a))||{};if(!c||!c.from||!u)return[];const p={triggerer:a,position:r.get(Pa)},d=(Ha({chart:e,expando:n,nodes:i,collectConfig:c,collectibles:s,meta:p})||[]).map(e=>e.children.length?e.children[0]:e);return d.length?function({chart:e,config:t,expando:n,placementConfig:r,hovered:i,collected:o,meta:a}){const{bounds:s,key:l}=function({chart:e,config:t,expando:n,placementConfig:r,hovered:i,collected:o,meta:a}){const[s]=i,l=Array.isArray(r)?r:[r],c={bounds:s.bounds,key:s.key},u=Va({nodes:o});for(let r=0;r<l.length;r++){const s=l[r];if("function"==typeof s){const t=s({chart:e,expando:n,hovered:i,collected:[...o],meta:a,collectedBounds:u,combineBounds:Va});if(t)return t}if("trigger"===s)return c;if("collectible"===s){const{collectible:e}=t.main.placements;return{bounds:"function"==typeof e?e({collected:[...o]}):u,key:o[0].key}}}return c}({chart:e,config:t,expando:n,placementConfig:r,hovered:i,collected:o,meta:a}),[{desc:c}]=o;return[{bounds:s,nodes:o,data:o.map(e=>e.data),key:l,meta:a,desc:c}]}({chart:e,config:t,expando:n,placementConfig:u,hovered:i,collected:d,meta:p}):[]}const $a=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),Ba=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞יִײַ-ﬨשׁ-ﭏ]"),Ua=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]"),Wa=e=>$a.test(e),Ka=e=>Ba.test(e)||Ua.test(e);function Ya(e){const t=e?e.length:0;for(let n=0;n<t;n++){const t=e[n];if(Wa(t))return"ltr";if(Ka(t))return"rtl"}return"ltr"}function Ga({config:e,h:t,context:n}){const r={section:({content:e})=>function({content:e}){return{type:"section",content:e}}({content:e}),text:({value:t,style:n,survive:r,visibility:i})=>function({config:e,value:t,style:{bold:n=!1,italic:r=!1}={},survive:i,visibility:o}){const{rtl:a}=e;return{type:"text",content:[{content:t,style:{"font-weight":n?"bold":"normal","font-style":r?"italic":"normal","text-align":a?"right":"left",direction:Ya(t),"white-space":"pre-wrap"},colspan:2}],survive:{visibility:!1,...i},visibility:{count:!0,force:!1,...o}}}({config:e,value:t,style:n,survive:r,visibility:i}),measure:({label:n,value:r,color:i,style:o,survive:a,visibility:s})=>function({config:e,h:t,label:n,value:r,color:i,style:o,survive:a,visibility:s}){const{rtl:l}=e,c=t("div",{style:{display:"inline-block",width:10,height:10,"background-color":i,margin:"0 8px"}});return{type:"measure",label:n,value:r,content:[{content:l?[":",n]:[n,":"],style:{"text-align":l?"right":"left","font-weight":o?.label?.bold?"bold":"normal","font-style":o?.label?.italic?"italic":"normal",direction:Ya(n)}},{content:i?l?[r,c]:[c,r]:r,style:{"text-align":l?"left":"right","vertical-align":"middle","font-weight":o?.value?.bold?"bold":"normal","font-style":o?.value?.italic?"italic":"normal",direction:Ya(r)}}],survive:{color:!1,duplicate:!1,visibility:!1,...a},visibility:{count:!0,force:!1,...s}}}({config:e,h:t,label:n,value:r,color:i,style:o,survive:a,visibility:s}),divider:({visibility:e}={})=>function({visibility:e}){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:{count:!1,force:!1,...e}}}({visibility:e}),row:({content:e,style:t,colspan:n,survive:r,visibility:i})=>function({content:e,style:t,colspan:n,survive:r,visibility:i}){return{type:"row",content:[{content:e,style:t,colspan:n}],survive:{visibility:!1,...r},visibility:{count:!0,...i}}}({content:e,style:t,colspan:n,survive:r,visibility:i}),raw:({value:e,survive:t,visibility:n})=>function({value:e,survive:t,visibility:n}){return{type:"raw",content:e,survive:{visibility:!1,...t},visibility:{count:!0,...n}}}({value:e,survive:t,visibility:n}),color:({nodes:r,property:i,filter:o=!0,visibility:a,fillColor:s})=>function({config:e,h:t,context:n,nodes:r,property:i,filter:o,visibility:a,fillColor:s}){const{rtl:l}=e,c={type:"color",label:void 0,value:void 0,content:[],filter:o,survive:{visibility:!1},visibility:{count:!0,...a}},u=e.getColorSettings();if("color"===u.type||!u.fieldType)return c;const[p]=r;if(c.value=function({config:e,context:t,property:n,node:r}){const i=r.data[n];if(!i)return;if(-3===r.data.value)return r.data.label;const o=t.resources.dataset(i.source.key).field(i.source.field).formatter(),{value:a,label:s}=i,l=e.getColorSettings();if(o&&"measure"===l.fieldType)return Number.isNaN(+a)?"-":o(i.value);const c=s||a;return void 0===c||Number.isNaN(c)||"NaN"===c?"-":c}({config:e,context:n,property:i,node:p}),void 0===c.value)return c;c.label=function({config:e,context:t,property:n,node:r}){const i=e.getColorSettings();if(i.label)return i.label;const o=r.data[n];if(!o||"color"===i.type)return;const{dataset:a}=t.resources,{key:s,field:l}=o.source;return a(s).field(l).title()}({config:e,context:n,property:i,node:p});const d=s??function({node:e}){const{attrs:t}=e;return t?.fill||"#ddd"}({node:p}),f=t("div",{style:{display:"inline-block",width:10,height:10,"background-color":d,margin:"0 8px"}});return c.content.push({content:l?[":",c.label]:[c.label,":"],style:{"text-align":l?"right":"left",direction:Ya(c.label)}},{content:l?[c.value,f]:[f,c.value],style:{"text-align":l?"left":"right","vertical-align":"middle",direction:Ya(c.value)}}),c}({config:e,h:t,context:n,nodes:r,property:i,filter:o,visibility:a,fillColor:s})};return r}function Ja({chart:e,translator:t,config:n,expando:r,h:i,data:o,style:a}){const[s]=o,{nodes:l}=s.node,c=function({config:e,nodes:t}){const n=t.reduce((t,n)=>{const r=e.main.getGroupByValue({data:n.data});return t[r]||(t[r]={sorting:Object.keys(t).length,items:[]}),t[r].items.push(n),t},{});return Object.keys(n).map(e=>n[e]).sort((e,t)=>e.sorting-t.sorting).map(e=>e.items)}({config:n,nodes:l}),u=function({chart:e,config:t,expando:n,h:r,context:i,groups:o}){const{meta:a}=i.node,{dataset:s,formatter:l}=i.resources,c=Ga({config:t,h:r,context:i}),u=function({dataset:e}){return{dataset:{title:(t,n)=>e(t).field(n).title()}}}({dataset:s}),p=o.map(e=>{const i=c.section({content:[...(t.main.section({expando:n,h:r,nodes:e,dataset:s,formatter:l,meta:a,create:c,util:u})||[]).filter(e=>e.content?.length)].filter(Boolean)});return i.content=function({config:e,content:t}){const n=t.find(e=>"color"===e.type&&e.filter),r=n?t.filter(e=>"measure"!==e.type||e.survive.color||e.label!==n.label||e.value!==n.value):t;return e.main.showDuplicateMeasures?r:r.reduce((e,t)=>{const{type:n,survive:r}=t;if("measure"!==n||r.duplicate)return e.filtered.push(t),e;const i=`${t.label}-${t.value}`;return e.memory[i]||(e.memory[i]=!0,e.filtered.push(t)),e},{memory:{},filtered:[]}).filtered}({config:t,content:i.content}),i});return t.main.sections({chart:e,expando:n,h:r,nodes:i.node.nodes,dataset:s,formatter:l,meta:a,create:c,util:u,sections:p}),p.filter(Boolean)}({chart:e,config:n,expando:r,h:i,context:s,groups:c}),p=function({translator:e,config:t,context:n,templates:r}){const{rows:i,grouping:o,single:a}=t.main.layout,s=function({limit:e,grouping:t,single:n}){const r={count:0,overflow:0,index:{started:void 0,group:void 0},single:{found:!1,index:0}};return{process:({survive:i,visibility:o,index:a})=>{if(o.force)return!0;if(r.single.found||(r.single.found=!0,r.single.index=a),n&&a!==r.single.index)return t?(r.index.started!==a&&r.index.group!==a&&(r.overflow++,r.index.group=a),!1):(r.overflow++,!1);if(r.count>=e&&!i?.visibility){if(!t)return r.overflow++,!1;if(r.index.started!==a)return r.index.group!==a&&(r.overflow++,r.index.group=a),!1}return o.count&&r.count++,t&&(r.index.started=a),!0},overflow:()=>r.overflow}}({limit:i,grouping:o,single:"function"==typeof a?a({meta:n.node.meta,sections:r}):a}),l=r.reduce((e,t,n)=>{const{type:i,content:o=[]}=t;"section"===i&&o.forEach(t=>{s.process({survive:t.survive,visibility:t.visibility,index:n})&&e.push(t.content)});const a=n===r.length-1;return"divider"!==i||a||s.process({survive:t.survive,visibility:t.visibility,index:n})&&e.push(t.content),e},[]).filter(e=>e.length),c=s.overflow();return c&&l.push(function({translator:e,config:t,count:n}){const r=e?e.get("Object.ChartTooltip.NMore",n):`+${n} more`,i=Ya(r);return[{content:r,style:{"font-weight":"bold","text-align":t.rtl?"right":"left",direction:i},colspan:2}]}({translator:e,config:t,count:c})),l}({translator:t,config:n,context:s,templates:u});return p.length?function({h:e,style:t,rows:n}){return n.map(n=>e("tr",{},n.map(n=>{const r={style:{...t.cell||{},...n.style||{}},class:n.class};return n.colspan&&(r.colspan=n.colspan),e("td",r,n.content)})))}({h:i,style:a,rows:p}):function({h:e}){return e("tr",{},e("td",{style:{fontStyle:"italic",opacity:.75}},"Empty"))}({h:i})}const Za="collected";function Xa({chart:e,translator:t,config:n,expando:r,internal:i}){const{key:o}=n.main;if(!o)return!1;const a=di(),s=Oa({key:n.main.key,rtl:n.rtl,duration:n.duration}),{afterShow:l,afterHide:c}=n.main.events.tooltip,u=()=>{const e=a.get(Za);return{expando:r,nodes:e.nodes,meta:e.meta}};return Sn(!0,s,{settings:{filter:t=>_a({chart:e,config:n,expando:r,internal:i,nodes:t}),extract:e=>(a.set(Za,e.node),e),content:({h:i,data:o,style:a})=>Ja({chart:e,translator:t,config:n,expando:r,h:i,data:o,style:a}),placement:({nodes:e})=>n.main.placement({meta:e[0].meta}),afterShow:()=>l(u()),afterHide:()=>c(u())},style:{arrow:{color:n.style.background},content:n.style}})}function Qa({config:e}){const{keys:t}=e.legend;if(!t.tooltip||!t.component)return!1;const{type:n}=e.getColorSettings();if("categorical"!==n)return!1;const r=Oa({key:t.tooltip,rtl:e.rtl,duration:e.duration});return Sn(!0,r,{settings:{filter:e=>e.filter(e=>e.data&&e.key===t.component),extract:e=>e,content:({h:e,data:t,style:n})=>[e("tr",{},[e("td",{style:{...n.cell||{},"font-weight":"bold","text-align":"left"},colspan:2},t[0].node.data.label)])],placement:"pointer"},style:{arrow:{color:e.style.background},content:e.style}})}function es({config:e}){const t=e.main.triggers.reduce((e,t)=>(t.keys.forEach(n=>{const 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({components:e}){return e.filter(e=>t.key[e.key]).reduce((e,n)=>{e.any=!0,e.components.push(n.key);const 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:{}})}}const ts=()=>!0;function ns({config:e}){const t=e.main.triggers.reduce((e,t)=>{const{filter:n}=t;return t.keys.forEach(t=>{e[t]="function"==typeof n?n:ts}),e},{});return e=>{const n=t[e.key];return!n||n(e)}}function rs({chart:e,event:t,component:n}){const r={absolute:{x:0,y:0},relative:{x:0,y:0}},{left:i,top:o}=e.element.getBoundingClientRect();r.absolute.x=(void 0===t.clientX?Math.floor(t.srcEvent.clientX):t.clientX)-i,r.absolute.y=(void 0===t.clientY?Math.floor(t.srcEvent.clientY):t.clientY)-o;const a=e.component(n);if(a){const{computedInner:e}=a.rect;r.relative.x=r.absolute.x-e.x,r.relative.y=r.absolute.y-e.y}return r}function is({chart:e,filter:t,hits:n,position:r}){const i=[];if(n.position.length&&i.push(...e.shapesAt(r.absolute,{components:n.position.map(e=>({key:e}))}).filter(t)),!i.length&&n.distances.length){const o=[];n.distances.forEach(i=>{o.push(...e.shapesAt({cx:r.absolute.x,cy:r.absolute.y,r:i},{components:n.distanceKeys[i].map(e=>({key:e}))}).filter(t))}),o.length&&i.push(function({nodes:e,origin:t}){const n=e.find(e=>"path"===e.type);if(n)return n;const r=e=>{const n=Math.abs(t.x-(e.localBounds.x+e.localBounds.width/2)),r=Math.abs(t.y-(e.localBounds.y+e.localBounds.height/2));return Math.sqrt(n*n+r*r)};return e.slice(1).reduce((e,t)=>{const n=r(t);return n<e.distance&&(e.distance=n,e.node=t),e},{node:e[0],distance:r(e[0])}).node}({nodes:o,origin:r.relative}))}return i}const os="tooltipTap";function as({chart:e,config:t,expando:n,internal:r,facade:i}){const{tap:o}=t.delay,a=es({config:t}),s=ns({config:t}),l=t.main.triggers.reduce((e,t)=>(e.push(...t.keys),e),[]);return{key:`event:${os}`,type:"Tap",options:{event:os,enable:(n,r)=>!r||!!t.enable({event:r})&&e.componentsFromPoint({x:r.center.x,y:r.center.y}).filter(e=>-1!==l.indexOf(e.key)).length>0},recognizeWith:"tap",events:{[os](l){if(l.preventDefault(),"mouse"===l.pointerType||t.main.suppress({event:l}))return;const c=e.component(t.main.key);if(!c||!c.show)return;const u=e.componentsFromPoint({x:l.center.x,y:l.center.y}),p=a({components:u});if(!p.any)return void c.emit("hide");const[d]=p.components,f=rs({chart:e,event:l,component:d});r.set(Pa,f);const m=is({chart:e,filter:s,hits:p,position:f});if(!m.length)return void c.emit("hide");const{key:h}=m[0];t.main.events.tooltip.beforeShow({expando:n,event:l,collectNodes:()=>i.collectNodes({nodes:m}),meta:{triggerer:h,position:f}}).then(()=>{c.emit("show",l,{nodes:m,delay:o})}).catch(()=>{})}}}}function ss({chart:e,config:t,expando:n,internal:r,facade:i}){const o=es({config:t}),a=ns({config:t}),s=function({config:e,expando:t,internal:n,facade:r}){const{beforeShow:i}=e.main.events.tooltip,{hover:o}=e.delay,a={ongoing:{},latest:void 0};return function({event:e,tooltip:s,nodes:l}){const c=function({nodes:e}){return JSON.stringify(e.map(e=>({key:e.key,bounds:e.bounds,value:e.data?.value})))}({nodes:l});if(!a.ongoing[c]){a.ongoing[c]=!0,a.latest=c;const{key:u}=l[0];i({expando:t,event:e,collectNodes:()=>r.collectNodes({nodes:l}),meta:{triggerer:u,position:n.get(Pa)}}).then(()=>{c===a.latest&&s.emit("show",e,{nodes:l,delay:o})}).catch(()=>{s.emit("show")}).finally(()=>{delete a.ongoing[c],c===a.latest&&(a.latest=void 0)})}}}({config:t,expando:n,internal:r,facade:i}),l=[t.main.key,t.legend.keys.tooltip].filter(Boolean),c=()=>{l.forEach(t=>{const n=e.component(t);n?.show&&n.emit("hide")})};return{type:"native",events:{mousemove(n){if(!t.enable({event:n})||t.main.suppress({event:n}))return;const i=e.componentsFromPoint({x:n.clientX,y:n.clientY}),l=e.component(t.main.key);if(l&&l.show){const t=o({components:i});if(t.any){const[i]=t.components,o=rs({chart:e,event:n,component:i});r.set(Pa,o);const c=is({chart:e,filter:a,hits:t,position:o});if(!c.length)return void l.emit("hide");s({event:n,tooltip:l,nodes:c})}else l.emit("hide")}const{legend:c}=t;if(c.keys.tooltip&&c.keys.component){const t=e.component(c.keys.tooltip);t&&t.show&&(i.some(e=>e.key===c.keys.component)?t.emit("show",n):t.emit("hide"))}},mouseup(e){2===e.button&&c()},mouseleave(){t.main.events.interaction.mouseleave({expando:n}),c()},wheel(){c()}}}}function ls({chart:e,translator:t,config:n}){const r=function({config:e={}}){return Sn(!0,{},{rtl:!1,enable:La.FALSE,getColorSettings:La.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:La.FALSE,getGroupByValue:La.NOOP,collectibles:[],triggers:[],placement:()=>({type:"bounds"}),placements:{collectible:"combine"},showDuplicateMeasures:!1,layout:{rows:7,grouping:!1,single:!1},section:La.ARRAY,sections:La.NOOP,events:{tooltip:{beforeShow:()=>Promise.resolve(),afterShow:La.NOOP,afterHide:La.NOOP},interaction:{mouseleave:La.NOOP}}},legend:{keys:{tooltip:void 0,component:void 0}}},e)}({config:n}),i=di(),o=di(),a={components:void 0,interactions:void 0};return{getComponents:()=>(a.components||(a.components=function({chart:e,translator:t,config:n,expando:r,internal:i}){return[Xa({chart:e,translator:t,config:n,expando:r,internal:i}),Qa({config:n})].filter(Boolean)}({chart:e,translator:t,config:r,expando:i,internal:o})),a.components),getInteractions:()=>(a.interactions||(a.interactions=function({chart:e,config:t,expando:n,internal:r}){const i=function({chart:e,config:t,expando:n,internal:r}){return{collectNodes:({nodes:i})=>{const[{nodes:o}={nodes:[]}]=_a({chart:e,config:t,expando:n,internal:r,nodes:i});return o}}}({chart:e,config:t,expando:n,internal:r});return{gestures:[as({chart:e,config:t,expando:n,internal:r,facade:i})],native:ss({chart:e,config:t,expando:n,internal:r,facade:i})}}({chart:e,config:r,expando:i,internal:o})),a.interactions),expando:i}}function cs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var us,ps;var ds=function(){if(ps)return us;ps=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},us=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},us}(),fs=cs(ds);function ms(){const e={};var t;return t=e,Object.keys(fs.prototype).forEach(e=>{t[e]=fs.prototype[e]}),fs.init(t),e.lasso={active:()=>!1},e.select={on:e.on,removeListener:e.removeListener},e}var hs,ys;var gs=function(){if(ys)return hs;ys=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 hs=function e(){var t,n,r,l,c,u,p=arguments[0],d=1,f=arguments.length,m=!1;for("boolean"==typeof p&&(m=p,p=arguments[1]||{},d=2),(null==p||"object"!=typeof p&&"function"!=typeof p)&&(p={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=s(p,n),p!==(l=s(t,n))&&(m&&l&&(o(l)||(c=i(l)))?(c?(c=!1,u=r&&i(r)?r:[]):u=r&&o(r)?r:{},a(p,{name:n,newValue:e(m,u,l)})):void 0!==l&&a(p,{name:n,newValue:l}));return p},hs}(),vs=cs(gs);const bs=[["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}]],xs={};bs.forEach(([e,{width:t,height:n}])=>{xs[e]={width:t,height:n}});const qs={getLayoutModes:()=>xs,getLayoutMode(e,t){let n;for(n=0;n<bs.length;++n)if(e>=bs[n][1].width&&t>=bs[n][1].height)return bs[n][0];return"SPARK"}};function Ds(e,t){return{layoutModes:qs.getLayoutModes(),center:void 0!==t.minCenterRatio?{minWidthRatio:t.minCenterRatio,minHeightRatio:t.minCenterRatio}:void 0,logicalSize:t.logicalSize?{align:.5,preserveAspectRatio:!0,...t.logicalSize}:void 0}}const Ss=/^[A-Z][A-z0-9_]*$/i,Cs={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,"")}},ws={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||Ss.test(e)?e:`[${e.replace(/\]/g,"]]")}]`,t},deleteUndefinedProperties:e=>{Object.keys(e).forEach(t=>{void 0===e[t]&&delete e[t]})},generateId:()=>Cs.id(),shouldUseFormat:e=>!e.isCustomFormatted&&(e.qIsAutoFormat||"U"===e.qNumFormat.qType)};function Es(e,t){const n=e.component(t);return n&&n._DO_NOT_USE_getInfo&&n._DO_NOT_USE_getInfo().offset}const Is=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),As=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞יִײַ-ﬨשׁ-ﭏ]"),Ms=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]"),Ls={lrm:String.fromCharCode(8206),rlm:String.fromCharCode(8207),isLtrChar:e=>Is.test(e),isRtlChar:e=>As.test(e)||Ms.test(e),detectTextDirection(e){const t=e?e.length:0;let n,r;for(n=0;n<t;n++){if(r=e[n],Ls.isLtrChar(r))return"ltr";if(Ls.isRtlChar(r))return"rtl"}return"ltr"}},ks={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?ks.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=Ls.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=Ls.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:Ls.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=Ls.detectTextDirection(t.color.label),i=n?[":",t.color.label]:[t.color.label,":"],o=Ls.detectTextDirection(t.color.value);return[{content:i,style:{"text-align":n?"right":"left",direction:r}},{content:n?[t.color.value,ks.getColorSymbol(e,t)]:[ks.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=Ls.detectTextDirection(e.label),a=r?[":",e.label]:[e.label,":"],s=Ls.detectTextDirection(e.value);let l;return l=i?r?[e.value,ks.getColorSymbol(t,n)]:[ks.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 Ts(e){const t=parseInt(e,10);if(!isNaN(t))return t}const Ns=e=>t=>e.getContrastingColorTo(t.node.attrs.fill);function Os(e,t){const n=e.styleService.label.value.getStyle();return{padding:10,placements:e.simplifiedPlacements.map(n=>function(e,t,n){const r=n.themeService.getStyles(),i=n.styleService.label.value.getStyle(),o=i.fill===r.label.value.color;return{position:e.position,justify:e.justify,fill:o&&!e.onBackground?Ns(t):i.fill,overflow:e.overflow,padding:e.padding}}(n,t,e)),fontSize:Ts(n.fontSize),fontFamily:n.fontFamily,label:e.label}}function Ps(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}var Fs,Rs;1===(Fs=Ps).length&&(Rs=Fs,Fs=function(e,t){return Ps(Rs(e),t)});var js="$";function Hs(){}function zs(e,t){var n=new Hs;if(e instanceof Hs)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 Vs(){}Hs.prototype=zs.prototype={constructor:Hs,has:function(e){return js+e in this},get:function(e){return this[js+e]},set:function(e,t){return this[js+e]=t,this},remove:function(e){var t=js+e;return t in this&&delete this[t]},clear:function(){for(var e in this)e[0]===js&&delete this[e]},keys:function(){var e=[];for(var t in this)t[0]===js&&e.push(t.slice(1));return e},values:function(){var e=[];for(var t in this)t[0]===js&&e.push(this[t]);return e},entries:function(){var e=[];for(var t in this)t[0]===js&&e.push({key:t.slice(1),value:this[t]});return e},size:function(){var e=0;for(var t in this)t[0]===js&&++e;return e},empty:function(){for(var e in this)if(e[0]===js)return!1;return!0},each:function(e){for(var t in this)t[0]===js&&e(this[t],t.slice(1),this)}};var _s=zs.prototype;Vs.prototype={constructor:Vs,has:_s.has,add:function(e){return this[js+(e+="")]=e,this},remove:_s.remove,clear:_s.clear,values:_s.keys,size:_s.size,empty:_s.empty,each:_s.each},vs.bind(null,!0);const $s=[[2,4,6],[2,4],[3]],Bs=[,[,,[[1,2]],[[1,2,3],[1,3]],[[1,2,4],[1,4]],[[1,2,4],[1,5]],[[1,2,4,6],[2,4,6],[1,3,6],[1,6]],[[1,2,4,6],[2,4,6],[1,3,6],[1,7]],[[1,2,4,8],[2,4,8],[1,8]],[[1,2,4,8],[2,4,8],[1,3,9],[1,9]],[[1,2,4,6,10],[1,2,4,10],[1,3,10],[3,10],[1,10]]],[,,,[[2,3]],[[2,3,4],[2,4]],[[2,3,4],[2,4],[2,5]],[[2,4,6],[2,6]],[[2,4,6],[2,6],[2,7]],[[2,4,8],[2,8]],[[2,4,8],[2,8],[2,9]],[[2,4,6,10],[2,4,10],[5,10],[3,10]]],[,,,,[[3,4]],[[3,4,5],[3,5]],[[3,4,5,6],[3,6]],[[3,4,5,6],[3,5,7],[3,7]],[[3,4,5,6,8],[3,5,7],[4,8],[3,8]],[[3,4,5,6,8],[3,4,6,9],[3,4,6,8],[3,6,9],[4,8],[3,9]],[[4,6,10],[5,10],[3,10]]],[,,,,,[[4,5]],[[4,5,6],[4,6]],[[4,5,6,7],[4,5,6],[4,6]],[[4,5,6,7,8],[4,5,6,7],[4,6,8],[4,8]],[[4,5,6,7,8],[4,6,9],[4,6,8],[4,8]],[[4,6,10],[5,7,9],[5,10],[4,10]]],[,,,,,,[[5,6]],[[5,6,7],[5,7]],[[5,6,7,8],[5,6,7],[6,8]],[[5,6,7,8,9],[5,6,7,8],[5,7,9],[5,9]],[[6,8,10],[5,10]]],[,,,,,,,[[6,7]],[[6,7,8],[6,8]],[[6,7,8,9],[6,7,8],[6,9]],[[6,7,8,9,10],[6,8,10],[6,10]]],[,,,,,,,,[[7,8]],[[7,8,9],[7,9]],[[7,8,9,10],[8,10],[7,10],[7,9]]],[,,,,,,,,,[[8,9]],[[8,9,10],[8,10]]],[,,,,,,,,,,[[9,10]]]];function Us(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 Ws(e,t,n){let r;const i=e?e.length:0;for(r=0;r<i;r++)Us(e[r],t,n)}!function(){let e,t;for(Ws($s,1,10),e=0;e<Bs.length;e++)if(Bs[e])for(t=0;t<Bs[e].length;t++)Array.isArray(Bs[e][t])&&Ws(Bs[e][t])}();var Ks={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 Ys(e){const{qHyperCube:t,...n}=e,{qAxisData:r,qDataPages:i,qStackedDataPages:o,qTreeDataPages:a,...s}=t,l=vs(!0,{},{...n,qHyperCube:{...s}}),{dataRelatedPropertiesPaths:c}=Ks;function u(e,t){const n=t.indexOf("[]");if(-1===n)return void(void 0!==ci(e,t)&&pi(e,t,void 0));const r=t.substring(0,n),i=t.substring(n+2),o=i.startsWith(".")?i.substring(1):i;ci(e,r,[]).forEach(e=>{o&&u(e,o)})}return c.forEach(e=>{u(l,e)}),l}var Gs={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,p=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+p)})}}},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=Ys(t);e.set("dataIndependentProperties",JSON.stringify(n))},propertiesHaveChanged:function({viewCache:e,layout:t}){const n=Ys(t);return e.get("dataIndependentProperties")!==JSON.stringify(n)},nonUpdatingNode:{trackBy:function(){return Math.random()}}};function Js(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?void 0:"svg"}var Zs=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}},Xs=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 Zs.newInstanceIfNeeded(e,this._value);const n=this.getNextNode(e.charAt(t));if(!n)return Zs.newInstanceIfNeeded(e,t,this._value);const r=n.getLongestMatch(e,t+1);return r||Zs.newInstanceIfNeeded(e,t,this._value)}},Qs=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 Xs);const n=this.root.put(e,0,t);return n||(e.length>this.maxKeyLen&&(this.maxKeyLen=e.length),this.size++,null)}};(()=>{const e=[],t=[],n=new Qs;let r,i,o;for(r in e["""]="34",e["&"]="38",e["<"]="60",e[">"]="62",e[" "]="160",e["¡"]="161",e["¢"]="162",e["£"]="163",e["¤"]="164",e["¥"]="165",e["¦"]="166",e["§"]="167",e["¨"]="168",e["©"]="169",e["ª"]="170",e["«"]="171",e["¬"]="172",e["­"]="173",e["®"]="174",e["¯"]="175",e["°"]="176",e["±"]="177",e["²"]="178",e["³"]="179",e["´"]="180",e["µ"]="181",e["¶"]="182",e["·"]="183",e["¸"]="184",e["¹"]="185",e["º"]="186",e["»"]="187",e["¼"]="188",e["½"]="189",e["¾"]="190",e["¿"]="191",e["À"]="192",e["Á"]="193",e["Â"]="194",e["Ã"]="195",e["Ä"]="196",e["Å"]="197",e["Æ"]="198",e["Ç"]="199",e["È"]="200",e["É"]="201",e["Ê"]="202",e["Ë"]="203",e["Ì"]="204",e["Í"]="205",e["Î"]="206",e["Ï"]="207",e["Ð"]="208",e["Ñ"]="209",e["Ò"]="210",e["Ó"]="211",e["Ô"]="212",e["Õ"]="213",e["Ö"]="214",e["×"]="215",e["Ø"]="216",e["Ù"]="217",e["Ú"]="218",e["Û"]="219",e["Ü"]="220",e["Ý"]="221",e["Þ"]="222",e["ß"]="223",e["à"]="224",e["á"]="225",e["â"]="226",e["ã"]="227",e["ä"]="228",e["å"]="229",e["æ"]="230",e["ç"]="231",e["è"]="232",e["é"]="233",e["ê"]="234",e["ë"]="235",e["ì"]="236",e["í"]="237",e["î"]="238",e["ï"]="239",e["ð"]="240",e["ñ"]="241",e["ò"]="242",e["ó"]="243",e["ô"]="244",e["õ"]="245",e["ö"]="246",e["÷"]="247",e["ø"]="248",e["ù"]="249",e["ú"]="250",e["û"]="251",e["ü"]="252",e["ý"]="253",e["þ"]="254",e["ÿ"]="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["¬in"]="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)))})(),"undefined"!=typeof document&&document.createElement("div");for(let e=0;e<255;e++)e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||e.toString(16);const el={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 tl(e){const t=e.split("/");return"qmem:"===t[0]&&""===t[1]}const nl={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 rl(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 nl.getImageSize(r,t);return{src:r,size:t,height:o,width:a,imageError:s}}async function il(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 p=r.data?.customTooltipAttrExps?.value||[];let d;if(-1!==u&&p[u]&&(d=p[u]),"media"===c&&s.ref?.qStaticContentUrl?.qUrl)return rl(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&&tl(a))try{const t=`data:image/png;base64, ${await e.getImage(a)}`,{height:n,width:i,imageError:s}=await nl.getImageSize(t,r);o={src:t,size:r,height:n,width:i,imageError:s}}catch{}else{const{height:e,width:t,imageError:n}=await nl.getImageSize(a,r);o={src:a,size:r,height:e,width:t,imageError:n}}return o}(i,o,s,l,d);if(o.isEnabled("IMAGE_BUNDLE_LOAD")&&"field"===c&&d&&d.label){return async function(e,t,n,r){let i;const o=r.label,a=`qmem://${t.qFallbackTitle}/${o}`;if(tl(a))try{const t=await e.getImage(a);if(t){const e=`data:image/png;base64, ${t}`,{height:r,width:o,imageError:a}=await nl.getImageSize(e,n);i={src:e,size:n,height:r,width:o,imageError:a}}}catch{}return i}(i,n[u],l,d)}return[]}const ol={async addImagesToTheNodes({customTooltipModel:e,nodes:t,attrExps:n,opts:r}){const i=t,o=[];for(let t=0;t<i.length;t++)o.push(il(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}},al={async handlePromises({customTooltipModel:e,nodes:t,attrExps:n,opts:r}){let i=t;return i=await ol.addImagesToTheNodes({customTooltipModel:e,nodes:t,attrExps:n,opts:r}),i},checkIfPromisesExist:({customTooltipModel:e})=>ol.checkIfPromisesExist({customTooltipModel:e})};const sl=(e,t)=>{const n=e?.qHyperCubeDef?.qDimensions,r=e?.qHyperCubeDef?.qMeasures,i=e?.qHyperCubeDef?.qInterColumnSortOrder,o=t;return{qInfo:{qType:el.CHART.CHART_PARENT_TYPE,qId:el.CHART.CHART_OBJECT_ID},qHyperCubeDef:{qDimensions:n,qMeasures:r,qInterColumnSortOrder:i,qInitialDataFetch:[{qWidth:0,qHeight:0}]},qStateName:o}},ll=e=>{const t=e.tooltip?.chart?.object?.refId;return{qInfo:{qType:el.CHART.CHART_CHILD_TYPE},qExtendsId:t}};const cl={createContainer:({ctx:e,layout:t})=>{if(!(t.qHyperCube?.qDimensionInfo?.length<=0))return function(e,t){const n=t.tooltip?.chart?.style?.size??"medium",r=el.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:el.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 cl.hide({app:e,customTooltipModel:i});try{await async function({app:e,properties:t,customTooltipModel:n}){const r=n,i=el.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=el.CHART.STATE,o=sl(t,i),a=await e.createSessionObject(o),s=ll(t);if(a.id!==el.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(el.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 cl.hide({app:e,customTooltipModel:i})}}},hide:async({app:e,customTooltipModel:t})=>{const n=t;n?.embed&&(cl.destroyVisualization({customTooltipModel:t}),await e.destroySessionObject(el.CHART.CHART_OBJECT_ID),n.miniChartToken.sessionObj=void 0,await async function({app:e,customTooltipModel:t}){const n=t,r=el.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 ul(e){const t=e.qHyperCubeDef?e.qHyperCubeDef.qDimensions:e.qHyperCube.qDimensionInfo;if(t&&t.length>0)return t}function pl(){const{EXPRESSION:e,TITLE:t,DESCRIPTION:n,IMAGES:r}=el.CUSTOM,i={};return i[e]=!0,i[t]=!0,i[n]=!0,i[r]=!0,i}function dl(e){const t=pl();return e.filter(e=>t[e.id])}const fl={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}=fl.getAttrExprData(a);o.length||n.length?al.handlePromises({customTooltipModel:i,nodes:fl.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&&cl.hide({app:r.app,customTooltipModel:i}),t.emit("hide")},checkIfPromisesExist:({customTooltipModel:e})=>al.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?.[el.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[el.CUSTOM.QUARANTINE]=[],e.forEach(e=>{r.quarantine[el.CUSTOM.QUARANTINE].push(e)}),n.qLayoutExclude=r}(dl(t.qAttributeExpressions||[]),e)}},unquarantineCustomTooltipAttrs(e){const t=e,n=e.qLayoutExclude?.quarantine?.[el.CUSTOM.QUARANTINE];n&&delete t.qLayoutExclude.quarantine[el.CUSTOM.QUARANTINE]},setAttrsFromQuarantine(e,t){const n=ul(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===dl(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=ul(e)||[];[...i,t].forEach(e=>{const t=dl(e.qAttributeExpressions||[]);t.length>0&&(r=t)});const o=pl(),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:Ls.detectTextDirection(e)},colspan:2},{}],getImageRow(e,t){const n=Ls.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 ml(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 el.CUSTOM.EXPRESSION:n="NaN"===t.qNum||e.isCustomFormatted?void 0===t.qText?"NaN":t.qText:t.qNum;break;case el.CUSTOM.TITLE:case el.CUSTOM.DESCRIPTION:case el.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 hl={getNode(e,{dimensionCount:t}){if(!t||t<1)return;const n=t-1,r="qDimensionInfo";return{field:`${r}/${n}`,value:t=>ml(t,e,r,n)}}};const yl={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={[el.CUSTOM.TITLE]:!0,[el.CUSTOM.DESCRIPTION]:!0},{attrExps:o,fieldPath:a}=fl.getAttrExprData(e);return 0===t.length||0===o.length||""===a||o.forEach((e,o)=>{const s=t[o];if(e.id===el.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===el.CUSTOM.TITLE&&{title:t},value:t,id:e.id})}}),r}(n,i.map(t=>ks.getMeasure(e,t)),e,r)}};function gl({nodes:e,layout:t,dataset:n}){const r=function(e,t,n){const r=[];return e.forEach(e=>{r.push(yl.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:[]})}function vl(e){const t=el.CUSTOM.EXPRESSION,{qNumFormat:n,qLabel:r,qLabelExpression:i,cId:o}=e.qDef;return e.qLibraryId?{qLibraryId:e.qLibraryId,id:t,qNumFormat:n,qLabel:r,qLabelExpression:i,cId:o}:{qExpression:e.qDef.qDef,id:t,qNumFormat:n,qLabel:r,qLabelExpression:i,cId:o}}function bl(e){const t=e.qHyperCubeDef?.qDimensions;return t[t.length-1].qAttributeExpressions||[]}var xl={attrExpr:{migrateProperties(e){const t=vs(!0,{},e),n=t.tooltip?.data?.qHyperCubeDef?.qMeasures||[];let r=bl(t);return r=function(e,t){return t.concat(e.map(e=>vl(e)))}(n,r),function(e,t){const n=t.qHyperCubeDef?.qDimensions;n[n.length-1].qAttributeExpressions=e}(r,t),delete t.tooltip?.data,t},getPatches(e){const t=e.tooltip?.data?.qHyperCubeDef?.qMeasures||[],n=e.qHyperCubeDef?.qDimensions.length-1,r=function(e,t,n){let r=e.length;const i=[];return t.forEach(e=>{const t=vl(e),o=JSON.stringify(t);i.push({qPath:`/qHyperCubeDef/qDimensions/${n}/qAttributeExpressions/${r}`,qOp:"add",qValue:o}),r++}),i.push({qPath:"/tooltip/data",qOp:"remove"}),i}(bl(e),t,n);return r},checkForBackwardCompatibility:(e,t)=>(e.qMeasureInfo||[]).length>0&&t.length>0,updateProperties(e,t){return new Promise(n=>{const r=t.qHyperCube?.qDimensionInfo||[],i=t.tooltip?.data?.qHyperCube||{},o=t.qMeta?.privileges?.includes("update");e&&e.getEffectiveProperties&&this.checkForBackwardCompatibility(i,r)&&e.getEffectiveProperties().then(t=>{if(o){const r=this.migrateProperties(t);e.setProperties(r).then(()=>{e.app.clearUndoBuffer(),n(!0)})}else{const r=this.getPatches(t);e.applyPatches(r,!0).then(()=>{e.app.clearUndoBuffer(),n(!0)})}}),n(!1)})}}};const{CUSTOM:ql}=el;function Dl({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},p=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:fl,miniChartToken:{},embed:s}}({layout:t,app:n,model:r,picasso:i,chart:o,translator:a,localeInfo:s,embed:l}),d="rtl"===c.direction,f=()=>{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:()=>f(),hideBasic:()=>f()&&ci(t,"tooltip.hideBasic",!1),getAttributes:({dataset:e,nodes:n})=>{const r=gl({dataset:e,nodes:n,layout:t});return{title:r.customTooltipInfoAttrExpsArr.find(e=>e.id===ql.TITLE)?.title,description:r.customTooltipInfoAttrExpsArr.find(e=>e.id===ql.DESCRIPTION)?.value,measures:r.customTooltipAttrExpsArr}},hasImages:()=>fl.checkIfPromisesExist({customTooltipModel:p}),createImageRow:({value:e,h:t})=>fl.getImageRow(e,{h:t,rtl:d}),addImages:({nodes:r})=>{const i=fl.getDataNodes(o,r),{attrExps:a}=fl.getAttrExprData(t);return al.handlePromises({customTooltipModel:p,nodes:i,attrExps:a,opts:{flags:e,app:n}})},chart:{isEnabled:()=>!!(f()&&t.tooltip?.chart?.object?.refId&&l&&"function"==typeof r?.getEffectiveProperties),hasLimitation:()=>!!n?.isInModalSelection?.(),createContainer:({h:e})=>cl.createContainer({layout:t,ctx:{h:e,rtl:d}}),createLimitationRow:()=>fl.getFooterRow(a.get("properties.tooltip.notselectedmessage"),d),show:({nodes:e,properties:t})=>cl.show({app:n,properties:t,selectedNodes:e,customTooltipModel:p,rtl:d}),hasAlternateState:()=>!!p.miniChartToken?.alternateState,hide:()=>cl.hide({app:n,customTooltipModel:p}),destroy:()=>cl.destroyVisualization({customTooltipModel:p})}}}function Sl(e){return{layout:e,keys:{SCALE:{FILL:"fill"},COMPONENT:{DIMENSION_TITLE:"dimension-title",SLICES:"slices",PIE_LABELS:"pie-labels"}}}}function Cl({layout:e}){const t=({ds:e,encodings:t})=>{const n={field:"qDimensionInfo/0",props:{num:{field:t.slice.arc}}};return t.slice.outerRadius&&(n.props.radius={field:t.slice.outerRadius}),e.extract(n)},n=({rows:e,encodings:t})=>t.slice.outerRadius?e.filter(e=>"NaN"!==e.num.value&&"NaN"!==e.radius.value):e.filter(e=>"NaN"!==e.num.value),r=({rows:t,encodings:n})=>n.slice.outerRadius&&!e.donut.showAsDonut?t.filter(e=>e.num.value>0&&e.radius.value>0):t.filter(e=>e.num.value>0);return function({layout:e,config:t={}}){const n={disclaimer:void 0,isSuppressing:!1,showDisclaimer:t.args?.layoutService?t.args.layoutService.getLayoutValue("showDisclaimer"):e?.showDisclaimer};return{initialize:({args:r}={})=>{n.disclaimer=function({args:e,disclaimers:t}){const n=[];return Object.keys(t).forEach(r=>{const i=si[r],o=t[r];o&&(o.condition||i?.condition||li)(e)&&n.push({key:i?.translationKey||i?.key||r,alignment:o.alignment||i?.alignment||ai})}),n.find(e=>e.alignment===oi)||n[0]}({args:{layout:e,...t.args,...r},disclaimers:t.disclaimers||{}}),n.isSuppressing=!(!n.disclaimer||n.disclaimer.alignment!==oi)},getDisclaimer:()=>n.isSuppressing?n.disclaimer:!1===n.showDisclaimer?void 0:n.disclaimer,getHasSuppressingDisclaimer:()=>n.isSuppressing}}({layout:e,config:{args:{},disclaimers:{NoDataExist:{condition:({ds:e,encodings:n})=>0===t({ds:e,encodings:n}).length},LimitedData:{condition:()=>{const t=ws.getValue(e,"qHyperCube.qSize.qcy");return ws.getValue(e,"qHyperCube.qDataPages.0.qArea.qHeight")<t}},OnlyNanData:{condition:({ds:e,encodings:r})=>{const i=t({ds:e,encodings:r});return 0===n({rows:i,encodings:r}).length}},OnlyNegativeOrZeroValues:{condition:({ds:e,encodings:i})=>{const o=t({ds:e,encodings:i}),a=n({rows:o,encodings:i});return 0===r({rows:a,encodings:i}).length}},NegativeOrZeroValues:{condition:({ds:e,encodings:i})=>{const o=t({ds:e,encodings:i}),a=n({rows:o,encodings:i}),s=a,l=r({rows:a,encodings:i});return s.length!==l.length}}}}})}function wl({flags:e,picasso:t,instance:n}){const r=A(),i=M(),o=w(),a=q(),[s,l]=S(),c=L(),u=k(),p=T(),d=x(),f=N(),{qLocaleInfo:m}=O(),h=P();return I(()=>{if(!n)return;a.style.overflow="hidden";const s=function({app:e,translator:t}){const n={initialized:!1,dimensions:[],measures:[]};return{initialize:async({properties:r})=>{if(n.initialized)return;const i={app:e,translator:t,properties:r},o=[vn(i),bn(i)],a=await Promise.all(o),[s,l]=a;n.dimensions=s,n.measures=l,n.initialized=!0},getAlternatives:()=>({dimensions:[...n.dimensions],measures:[...n.measures]})}}({app:i,translator:o}),y=function({picasso:e,model:t,app:n,translator:r,layoutService:i,createConfig:o=ii,config:a={},custom:s={}}){const{localeInfo:l,key:c,theme:u,auto:p,definitionPath:d}=a,f=i?.getLayout?.(),m={theme:u,key:c,localeInfo:l,layout:f,hc:i?.getHyperCube?.(),legendProps:i?.getLayoutValue?.("legend"),colorProps:{...i?.getLayoutValue?.("color"),useBaseColors:f?ti(f):void 0}},h=Qr({picasso:e,model:t,app:n,translator:r,auto:p});!1!==p&&h.auto(e=>p?p({layout:e,defaultAuto:ri}):ri(e));let y=!1;const g={getColor:()=>h.color(),getPaletteColor:({index:e,color:t})=>h.resolveUIColor({index:e,color:t}),getData:()=>h.data(),getDatumProps:e=>h.datumProps(e),getSnapshotData:()=>h.getSnapshotData(d),getSettingsForMeasure:e=>h.settingsForMeasure(e),getSettings:()=>h.settings(),getLegend:(e,t)=>h.legend(e,t),getScales:()=>h.scales(),getPalettes:()=>h.palettes(),isSelectionLocked:({isMeasureSelectionLocked:e})=>h.isSelectionLocked({isMeasureSelectionLocked:e}),isInitialized:()=>y,custom:{...s},initialize:({createConfig:e=o}={})=>{const t=e({getUseBaseColors:ti}),n=function(e,t={}){return{...e,...t,colorProps:{...e.colorProps,...t.colorProps||{}}}}(m,t);return h.config(n),h.getAuxiliarySettings(d).then(()=>{y=!0})}};return g}({picasso:n.picasso,model:r,app:i,translator:o,config:{auto:!1,key:"fill"}}),g=function({picassoInstance:e,plugins:t,pluginArgs:n={}}){const r={initialized:!1,definitions:[]};return{async initialize(){if(r.initialized)return;const i=Promise.all(t.filter(e=>"custom-component"===e.info.type).map(async t=>{if(!t.info.componentName)throw new Error("plugin-service: Custom component is missing componentName");const r=await t.fn({...n});if("object"!=typeof r)throw new Error("plugin-service: Custom component needs to be an object");e.component(t.info.componentName,r)})),o=Promise.all(t.filter(e=>"component-definition"===e.info.type).map(e=>e.fn({...n}))),a=await Promise.all([i,o]);r.initialized=!0,r.definitions.push(...a[1])},extendComponents:e=>r.initialized?(r.definitions.filter(Boolean).forEach(t=>{const[n]=e.filter(e=>e.key&&e.key===t.key);if(n){const e=Sn(!0,{},n.brush);Sn(!0,n,t),t.brush&&(n.brush=function(e,t){return"object"==typeof e&&Object.keys(e).length?(Array.isArray(t.consume)&&(e.consume=mi({originalArray:e.consume,newArray:t.consume,matchKey:"context"})),Array.isArray(t.trigger)&&(e.trigger=mi({originalArray:e.trigger,newArray:t.trigger,matchKey:"on"})),e):t}(e,t.brush))}else e.push(t)}),e):e}}({picassoInstance:n.picasso,plugins:u,pluginArgs:Sl(c)}),v=Dl({flags:e,layout:c,app:i,model:r,picasso:t,chart:n.chart,translator:o,localeInfo:m,embed:h,options:d}),b=function({theme:e,config:t={}}){const{id:n,resolve:r=[],transform:i=[],extend:o=[]}=t,a={theme:e,matrix:Ea(r),styles:void 0};return a.styles=Ma({theme:e,id:n,transform:i,extend:o,matrix:a.matrix}),{getStyles:()=>a.styles,getTheme:()=>a.theme,setTheme:e=>{a.theme=e,a.styles=Ma({theme:e,id:n,transform:i,extend:o,matrix:a.matrix})}}}({theme:f,config:{id:"pieChart",resolve:[["object","label.name","color","#595959"],["object","label.name","fontFamily"],["object","label.name","fontSize","12px"]]}}),x=function({chart:e,translator:t,layout:n,constraints:r,options:i,themeService:o,colorService:a,custom:s}){const l=n.qHyperCube.qMeasureInfo.length>1,c="rtl"===i.direction,{fontFamily:u}=o.getStyles();return ls({chart:e,translator:t,config:{rtl:c,enable:()=>!r.passive,getColorSettings:()=>a.getSettings(),style:{fontFamily:u},main:{key:"tooltip",getGroupByValue:({data:e})=>e.value,collectibles:[{key:"slices",type:"slice",major:({data:e})=>e.value}],triggers:[{keys:["slices"],collect:{from:"single"},placement:"collectible"},{keys:["pie-labels","negative-indicators"],collect:{from:"dimension",by:({data:e})=>e.value},placement:"trigger"}],placement:({meta:e})=>({type:"slices"===e.triggerer?"slice":"bounds"}),section:({h:e,nodes:n,dataset:r,formatter:i,create:o,util:a})=>{const[c]=n,{title:u,description:p,measures:d}=s.isEnabled()?s.getAttributes({dataset:r,nodes:n}):{},f=[];u&&f.push(o.text({value:u,style:{bold:!0}})),p&&f.push(o.text({value:p}));const m=s.hideBasic();if(m&&!d.length&&(u||p)||f.push(o.text({value:c.data.label,style:{bold:!0}})),!m){f.push(o.color({nodes:n,property:"fill"}));const{num:e}=c.data;if(f.push(o.measure({label:a.dataset.title(e.source.key,e.source.field),value:e.label})),l){const{radius:e}=c.data;f.push(o.measure({label:a.dataset.title(e.source.key,e.source.field),value:e.label}))}f.push(o.measure({label:t?t.get("properties.dataPoints.labelmode.share"):"Share",value:i("share")(c.desc.share)}))}d&&f.push(...d.map(e=>o.measure({label:e.label,value:e.value,survive:{color:!0,duplicate:!0}}))),s.chart.isEnabled()&&(s.chart.hasLimitation()?(s.chart.destroy(),f.push(o.raw({value:s.chart.createLimitationRow()}))):f.push(o.raw({value:s.chart.createContainer({h:e})})));const{customTooltipImages:h}=c.data;return s.isEnabled()&&h&&f.push(...h.map(t=>o.raw({value:s.createImageRow({value:t,h:e})}))),f},layout:{grouping:!0},events:{tooltip:{beforeShow:({collectNodes:e})=>s.isEnabled()&&s.hasImages()?s.addImages({nodes:e()}):Promise.resolve(),afterShow:({expando:e,nodes:t})=>{s.chart.isEnabled()&&!s.chart.hasLimitation()&&s.chart.show({nodes:t,properties:e.get("properties")})}},interaction:{mouseleave:()=>{s.chart.isEnabled()&&s.chart.hasAlternateState()&&s.chart.hide()}}}},legend:{keys:{tooltip:"legend-color-cat",component:"legend-cat"}}}})}({chart:n.chart,translator:o,layout:c,constraints:p,options:d,themeService:b,colorService:y,custom:v}),q=function({layout:e,themeService:t,colorService:n,flags:r}){const i=t.getStyles(),o=t=>r.isEnabled("CLIENT_IM_3050")?e.components?.find(e=>e.key===t):void 0,a=(e,t)=>{const r=n.getPaletteColor;if(e?.color&&r){const n=r(e);return"none"===n&&e.index>0?e?.color??t:n??t}return t};return{axis:{title:{getStyle:()=>{const e=o("axis")?.axis?.title;return{fontFamily:e?.fontFamily??i.axis.title.fontFamily,fontSize:e?.fontSize??i.axis.title.fontSize,color:a(e?.color,i.axis.title.color)}}}},label:{name:{getStyle:()=>{const e=o("label")?.label?.name;return{fill:a(e?.color,i.label.name.color),fontSize:e?.fontSize??i.label.name.fontSize,fontFamily:e?.fontFamily??i.label.name.fontFamily}}},value:{getStyle:()=>{const e=o("label")?.label?.value;return{fill:a(e?.color,i.label.value.color),fontSize:e?.fontSize??i.label.value.fontSize,fontFamily:e?.fontFamily??i.label.value.fontFamily}}}},legend:{title:{getStyle:()=>{const e=o("legend")?.legend?.title;return{fontFamily:e?.fontFamily??i.legend.title.fontFamily,fontSize:e?.fontSize??i.legend.title.fontSize,color:a(e?.color,i.legend.title.color)}}},label:{getStyle:()=>{const e=o("legend")?.legend?.label;return{fontFamily:e?.fontFamily??i.legend.label.fontFamily,fontSize:e?.fontSize??i.legend.label.fontSize,color:a(e?.color,i.legend.label.color)}}}}}}({layout:c,themeService:b,colorService:y,flags:e}),D=Cl({layout:c});l({alternativeService:s,colorService:y,disclaimerService:D,pluginService:g,themeService:b,tooltipService:x,styleService:q})},[r,i,n,c,o.language(),p,d.direction,f.name()]),s}const El=e=>"[object Object]"===Object.prototype.toString.call(e),Il=e=>Array.isArray(e);function Al(e,t){if(e===t)return!0;if(Il(e)){if(!Il(t))return!1;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Al(e[n],t[n]))return!1;return!0}if(El(e)){if(!El(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(!Al(e[n[r]],t[n[r]]))return!1}return!0}return e===t}function Ml({enable:e=!0}={}){const t=A(),n=()=>Date.now().toString()+Math.random(),[r,i]=S(n()),o={properties:void 0};return I(()=>{if(!t||!t.getEffectiveProperties||!e)return()=>{};const r=()=>{t.getEffectiveProperties().then(e=>{const t=vs(!0,{},e);if(!o.properties)return void(o.properties=t);const r=function(e,t){const n={properties:!1,exclude:!1};if(e===t)return n;const r=vs(!0,{},e),i=vs(!0,{},t);return n.exclude=!Al(r.qHyperCubeDef?.qLayoutExclude,i.qHyperCubeDef?.qLayoutExclude),delete r.qHyperCubeDef?.qLayoutExclude,delete i.qHyperCubeDef?.qLayoutExclude,n.properties=!Al(r,i),n}(o.properties,t);o.properties=t,r.exclude&&!r.properties&&i(n())})};return t.on("changed",r),r(),()=>{t.removeListener("changed",r)}},[e]),r}function Ll({scaleKey:e,legend:t,onEdited:n}){const{layout:r}=t,{dock:i}=r||{};return{type:"brush-range",key:"legendRangeBrush",layout:{dock:"@legend-seq"},on:n?{bubbleEnd(){n()}}:{},settings:{brush:"selection",scale:`${e}Range`,direction:"left"===i||"right"===i?"vertical":"horizontal",bubbles:{align:"left"===i||"top"===i?"end":"start",placement:"outside"},target:{selector:'[id="legend-seq-target"]',fillSelector:'[id="legend-seq-ticks"]',fill:"rgba(82,204,82,0.2)"}}}}const kl=.8,Tl=.55,Nl={CORNER_RADIUS:0,INNER_RADIUS:Tl,STROKE:{COLOR:"#FFFFFF",WIDTH:{NONE:0,SMALL:2,MEDIUM:4,LARGE:6}}},Ol=({layout:e},t,n)=>t.encodings.slice.outerRadius?{scale:"radius",fn:t=>{let r=kl,i=0;const o=n?.style?.innerRadius??Tl;e.donut.showAsDonut&&(r=kl-o,i=o);return t.scale(Math.max(0,t.datum.radius.value))*r+i}}:kl,Pl=({layout:e},t,n)=>{if(!e.donut.showAsDonut)return 0;const r=n?.style?.innerRadius??Tl;return t.encodings.slice.outerRadius?{scale:"radius",fn:e=>{const t=kl-r,n=r;return e.scale(Math.min(0,e.datum.radius.value))*t+n}}:r},Fl=({layout:e},t)=>{const n=t.colorService.getDatumProps(),r=n[Object.keys(n)[0]],i=r&&r.field?r.field:void 0,o="qDimensionInfo/0"===i,a=i?t.ds.field(i).raw():null,s=a&&(a.label||a.title||a.qFallbackTitle)||"",l=t.encodings.slice.outerRadius,{formatter:c}=t.chart,u=ws.getValue(e,"qHyperCube.qDimensionInfo",[]).length;function p(e,n){const r=t.ds.field(e).raw();return{field:e,label:!r.isCustomFormatted&&(r.qIsAutoFormat||"U"===r.qNumFormat.qType)?e=>c(n)(e.qNum):e=>e.qText}}const d=(e.components||[]).filter(e=>"slices"===e.key)[0];return{type:"pie",key:"slices",data:{extract:{field:"qDimensionInfo/0",props:{...n,num:p(t.encodings.slice.arc,"arc"),fillTooltip:i?{field:i,label:s,value:e=>o?e.qText||"-":void 0!==e.qNum&&"NaN"!==e.qNum?e.qText?e.qText:e.qNum:e.qText||"-"}:void 0,customTooltipAttrExps:0!==u?hl.getNode(e,{dimensionCount:u}):void 0,radius:l?p(l,"outerRadius"):void 0}}},brush:{consume:[{context:"selection",data:["","fill"],style:{inactive:{opacity:.3},active:{stroke:"rgba(52, 52, 52, 0.7)",strokeWidth:2}}},{context:"highlight",data:[""],style:{inactive:{fill:"#BFDAD9"},active:{fill:"#68B2AF"}}}]},settings:{startAngle:()=>t.viewState.get("rotation"),endAngle:()=>t.viewState.get("rotation")+2*Math.PI,slice:{arc:{ref:"num"},innerRadius:Pl({layout:e},t,d),fill:t.colorService.getColor(),strokeWidth:d?.style?.strokeWidth?Nl.STROKE.WIDTH[d.style.strokeWidth.toUpperCase()]:Nl.STROKE.WIDTH.NONE,stroke:d?.style?.strokeColor?.color??Nl.STROKE.COLOR,outerRadius:Ol({layout:e},t,d),cornerRadius:d?.style?.cornerRadius??0}},animations:{enabled:t.animations.enabled,isMainComponent:!0}}};function Rl({layout:e},t){const n=(e.components||[]).filter(e=>"slices"===e.key)[0],r=n?.style?.innerRadius??Tl,i=t.encodings.slice.outerRadius,o=t.themeService.getStyles();return!(!e.donut.showAsDonut||!i)&&{type:"pie",key:"zeroLine",data:{items:[1]},settings:{slice:{arc:1,fill:"transparent",innerRadius:0,strokeWidth:1,stroke:o.label.name.color,outerRadius:{scale:"radius",fn:e=>{const t=kl-r,n=r;return e.scale(0)*t+n}}}},animations:{enabled:t.animations.enabled}}}function jl(e){return{type:"pie-dividers",key:"pie-dividers",layout:{displayOrder:2},settings:{component:"slices",selector:"path"},brush:{consume:[{context:"selection",style:{inactive:{opacity:.2}}}]},animations:{enabled:e.animations.enabled,trackBy:()=>Math.random()}}}function Hl({layout:e},t){if(e.donut.showAsDonut||!t.encodings.slice.outerRadius)return!1;return{type:"negative-indicators",key:"negative-indicators",layout:{displayOrder:2},settings:{component:"slices",selector:"path",offset:5,size:4,fill:t.themeService.getStyles().label.name.color},brush:{consume:[{context:"selection",style:{inactive:{opacity:.2}}}]},animations:{enabled:t.animations.enabled}}}function zl(e){const t=e.node.desc&&e.node.desc.share;return t?e.formatter("share")(t):""}function Vl(e){return e.node.data.num.label}function _l(e){return e.node.data.radius.label}function $l(e,t,n){if(e.dataPoint.auto)return n?Vl:zl;if("share"===e.dataPoint.labelMode)return zl;if("value"===e.dataPoint.labelMode){return t.encodings.slice.outerRadius&&"radius"===e.dataPoint.labelValueMode?_l:Vl}return null}function Bl({data:e}){return e?e.label:""}function Ul(e){const t=parseInt(e,10);if(!isNaN(t))return t}function Wl(e){const t=((e&&e.components?e.components:void 0)||[]).filter(e=>"slices"===e.key)[0];return(t?.style?.innerRadius??Tl)>.3}function Kl({node:e,data:t}){return vs({_share:e.desc.share,_fillColor:e.attrs.fill},t)}function Yl(e,t,n){const r=t.styleService.label.name.getStyle(),i=[{padding:10,direction:t.encodings.slice.outerRadius?"rotate":"horizontal",placements:[{position:"outside",padding:t.encodings.slice.outerRadius?4:2,fill:r.fill}],fontSize:Ul(r.fontSize),fontFamily:r.fontFamily,label:Bl,linkData:({node:e,data:t})=>vs({_share:e.desc.share,_fillColor:e.attrs.fill,_showTooltip:!0},t)}];if($l(e,t,!1)){const r=function(e,t,n){return{label:$l(e,t,!1),simplifiedPlacements:[{position:e.donut.showAsDonut&&Wl(e)?"inside":"into",onBackground:e.donut.showAsDonut&&Wl(e),padding:4}],theme:n.theme,themeId:"object.pieChart"}}(e,t,n),o=Os(vs(t,r),n.theme);o.linkData=Kl,i.push(o)}return{key:"pie-labels",type:"labels",renderer:Js(),layout:{displayOrder:2,minimumLayoutMode:"XSMALL"},settings:{sources:[{component:"slices",selector:"path",strategy:{type:"slice",settings:{labels:i}}}]},brush:{consume:[{context:"selection",data:["","fill"],style:{inactive:{opacity:.3}}}]},animations:{enabled:t.animations.enabled,trackBy:()=>Math.random()}}}function Gl({layout:e,context:t},n){return!1!==e.dataPoint.show&&(1===n.dataRowCount?function(e,t,n){const r=$l(e,t,!0),i=(o=n.theme,e=>o.getContrastingColorTo(e.node.attrs.fill));var o;const a=t.themeService.getStyles(),s=t.styleService.label.name.getStyle(),l=t.styleService.label.value.getStyle(),c=s.fill===a.label.name.color,u=l.fill===a.label.value.color;return{key:"pie-labels",type:"labels",renderer:Js(),layout:{displayOrder:2,minimumLayoutMode:"XSMALL"},settings:{sources:[{component:"slices",selector:"path",strategy:{type:"rows",settings:{align:.5,justify:.5,padding:10,labels:[{fontSize:Ul(s.fontSize),fontFamily:s.fontFamily,fill:c&&!e.donut.showAsDonut?i:s.fill,label:Bl,linkData:({data:e})=>e},{fontSize:Ul(l.fontSize),fontFamily:l.fontFamily,fill:u&&!e.donut.showAsDonut?i:l.fill,label:r,linkData:({data:e})=>e}]}}}]},animations:{enabled:t.animations.enabled,trackBy:()=>Math.random()}}}(e,n,t):Yl(e,n,t))}const Jl=(e,{requireFailure:t,recognizeWith:n}={})=>({type:"Pan",requireFailure:t,recognizeWith:n,options:{event:"legendRange",enable(t,n){if(this.started||!n)return!0;if(e.constraints.select||e.constraints.active)return!1;const r=(this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some(e=>"legend-seq"===e.type)||function(e){const{target:t}=e.srcEvent;return!(!t||!(t.hasAttribute("data-other-value")&&t.hasAttribute("data-idx")||"INPUT"===t.nodeName))}(n))&&!e.isLocked([this.chart.component("slices")]);return r||this.chart.component("legendRangeBrush").emit("rangeClear"),r}},events:{legendRangestart(t){t.preventDefault(),e.interactions.emit("selections-start"),this.chart.component("legendRangeBrush").emit("rangeStart",t),this.started=!0},legendRangemove(e){e.preventDefault(),this.chart.component("legendRangeBrush").emit("rangeMove",e)},legendRangeend(t){t.preventDefault(),this.chart.component("legendRangeBrush").emit("rangeEnd",t),e.onSelect(),this.started=!1}}});function Zl(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}}function Xl(e,t){const n=t.component("slices");if(!n)return!1;const{x:r,y:i}=Zl(e,t),o=n.rect.x+n.rect.margin.left+n.rect.width/2,a=n.rect.y+n.rect.margin.top+n.rect.height/2,s=Math.min(n.rect.width,n.rect.height)/2*kl;return(o-r)**2+(a-i)**2<=s**2}const Ql=(e,t,{requireFailure:n,recognizeWith:r}={})=>({type:"Tap",requireFailure:n,recognizeWith:r,options:{event:"tap",interval:10,pointers:1,enable(t,n){return!n||!e.constraints.select&&!e.constraints.active&&(this.components=this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).filter(e=>"slices"===e.key||"legend-cat"===e.key||"pie-labels"===e.key),this.components.length)}},events:{tap(n){n.preventDefault();const{target:r}=n.srcEvent;if(r&&("INPUT"===r.nodeName||r.hasAttribute("data-other-value")))return void this.chart.component("legendRangeBrush").emit("bubbleStart",n);if(r&&r.hasAttribute("data-action")&&r.hasAttribute("data-component-key"))return void this.chart.component(r.getAttribute("data-component-key")).emit(r.getAttribute("data-action"));if(r&&r.children&&r.children[0]&&"legend-cat"===r.children[0].getAttribute("data-component-key"))return;if(e.isLocked(this.components))return;e.interactions.emit("selections-start");let i=Zl(n,this.chart);this.components.some(e=>"legend-cat"===e.key)&&(i={cx:i.x,cy:i.y,r:5});const o=this.chart.shapesAt(i,{components:[{key:"slices",propagation:"stop"},{key:"legend-cat",propagation:"stop"},{key:"pie-labels",propagation:"stop"}],propagation:"stop"});o.length&&(this.chart.brushFromShapes(o,{components:[{key:o[0].key,action:n.srcEvent.ctrlKey||t?"set":"toggle",contexts:["selection"]}]}),e.onSelect())}}}),ec=(e,{requireFailure:t,recognizeWith:n}={})=>({type:"Pan",requireFailure:t,recognizeWith:n,options:{event:"lasso",enable(t,n){if(this.isStarted||!n)return!0;if(e.constraints.active||e.constraints.select||!e.interactions.lasso.active())return!1;const r=this.chart.componentsFromPoint({x:n.center.x,y:n.center.y});return!e.isLocked(r)&&r.some(e=>"slices"===e.key)}},events:{lassostart(t){t.preventDefault(),e.constraints.select||e.constraints.active||this.isStarted||(e.interactions.emit("selections-start"),this.chart.component("lasso").emit("lassoStart",t),this.isStarted=!0)},lassomove(e){e.preventDefault(),this.chart.component("lasso").emit("lassoMove",e)},lassoend(t){t.preventDefault(),this.isStarted=!1,this.chart.component("lasso").emit("lassoEnd",t),e.onSelect()}}}),tc=(e,{requireFailure:t,recognizeWith:n}={})=>({type:"Tap",requireFailure:t,recognizeWith:n,options:{event:"areatap",pointers:2,enable(t,n){if(this.started||!n)return!0;if(e.constraints.active||e.constraints.select)return!1;const r=this.chart.componentsFromPoint({x:n.center.x,y:n.center.y});return r.some(e=>"slices"===e.key)&&!e.isLocked(r)}},events:{areatap(t){const n=this.chart.component("area");n&&!this.started&&(e.interactions.emit("selections-start"),n.emit("areaStart",t.pointers[0]),n.emit("areaMove",t.pointers[1]),this.started=!0,setTimeout(()=>{n.emit("areaEnd"),e.onSelect(),this.started=!1},100)),t.preventDefault()}}});function nc(e){return{type:"native",key:"theusual",events:{wheel(t){let n=!1;if(!e.constraints.active&&Xl(t,this.chart)){const r=Math.sign(-t.deltaY);e.viewState.set("rotation",r*(Math.PI/12)),n=!0}else if(!e.constraints.select&&!e.constraints.active){const e=this.chart.componentsFromPoint(t).filter(e=>"legend-cat"===e.key)[0];e&&(n=!0,function(e,t){const n=(Math.abs(e.deltaX)>Math.abs(e.deltaY)?e.deltaX:e.deltaY)>=0?"next":"prev";t.emit(n)}(t,e))}n&&t.preventDefault()}}}}const rc=(e,{requireFailure:t,recognizeWith:n}={})=>({type:"Pan",requireFailure:t,recognizeWith:n,options:{event:"rotate",pointers:1,threshold:10,enable(t,n){return!(!this.started&&n)||!e.constraints.active&&!e.interactions.lasso.active()&&Xl(n,this.chart)}},events:{rotatestart(e){e.preventDefault();const t=this.chart.component("slices").rect,n=this.chart.element.getBoundingClientRect();this.pieCenter={x:n.left+t.x+t.width/2,y:n.top+t.y+t.height/2},this.prevAngle=Math.atan2(e.center.y-this.pieCenter.y,e.center.x-this.pieCenter.x),this.started=!0},rotatemove(t){t.preventDefault();const n=Math.atan2(t.center.y-this.pieCenter.y,t.center.x-this.pieCenter.x);e.viewState.set("rotation",n-this.prevAngle),this.prevAngle=n},rotateend(e){e.preventDefault(),this.started=!1},rotatecancel(e){e.preventDefault(),this.started=!1}}}),ic=(e,{requireFailure:t,recognizeWith:n}={})=>({type:"Pan",requireFailure:t,recognizeWith:n,options:{event:"legendPan",pointers:1,threshold:10,enable(t,n){return!(!this.isStarted&&n)||!e.constraints.active&&this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some(e=>"legend-cat"===e.type)}},events:{legendPanstart(e){if(e.preventDefault(),!this.isStarted){this.components=this.chart.componentsFromPoint({x:e.center.x,y:e.center.y}),this.components.forEach(t=>{t.emit("panstart",e)}),this.isStarted=!0;const t=this.chart.component("tooltip");t&&t.show&&t.emit("hide")}},legendPanmove(e){this.components.forEach(t=>{t.emit("panmove",e)}),e.preventDefault()},legendPanend(e){e.preventDefault(),this.components.forEach(t=>{t.emit("panend",e)}),this.isStarted=!1}}}),oc=(e,t,n)=>({key:"hammered",type:"hammer",enable:!0,gestures:t?[rc(e,{}),Ql(e,t,{}),...n]:[Jl(e,{}),tc(e,{}),rc(e,{}),ec(e,{}),ic(e,{}),Ql(e,t,{}),...n]});function ac(e,t,n){const r=e.getIsSingleSelect(0),{constraints:i}=n;if(i.active&&i.passive)return[];const o=t.tooltipService.getInteractions();return[oc(t,r,o.gestures),nc(t),o.native]}function sc({settings:e},t){const n={share:{type:"d3-number",format:".1%"},arc:{data:{field:t.encodings.slice.arc}},fill:e.scales.fill&&e.scales.fill.data&&e.scales.fill.data.field?{data:{field:e.scales.fill.data.field}}:{}};return t.encodings.slice.outerRadius&&(n.outerRadius={data:{field:t.encodings.slice.outerRadius}}),n}function lc({layout:e},t,n){if(!e.dimensionTitle)return!1;const r=t.alternativeService.getAlternatives(),i=t.styleService.axis.title.getStyle();return{key:"dimension-title",type:"axis-title",renderer:"react-qcm",layout:{dock:"top",minimumLayoutMode:"SMALL"},data:{infos:e.qHyperCube.qDimensionInfo,alternatives:r.dimensions},resources:{app:t.app,cache:t.viewCache,model:t.model,selections:t.selections,translator:t.translator},callbacks:{onChange:()=>{}},settings:{isDisabled:()=>n.constraints.active,isRTL:n.rtl,isSnapshot:!!e.snapshotData,noModelDependencies:!0,skipAttributeExpressions:!1,type:"dimension"},style:{title:{color:i.color,fontFamily:i.fontFamily,fontSize:i.fontSize}}}}function cc({layout:e,context:t,selectionService:n},r={}){const i=function({layout:e}={},t={}){const n={};return vs(n,t.colorService.getScales()),t.encodings.slice.outerRadius&&vs(n,function({layout:e},t){const n={radius:{type:"linear",include:[0],data:{extract:{field:t.encodings.slice.outerRadius}}}};return e.donut.showAsDonut||(n.radius.min=0),n}({layout:e},t)),n}({layout:e},r),o={scales:i};let a=[];const s=function(e,t){const n=e.disclaimerService.getDisclaimer();if(!n)return!1;const{rtl:r}=t,{translator:i}=e,{fontFamily:o}=e.themeService.getStyles();return{key:"disclaimer",type:"disclaimer",renderer:"react-qcm",layout:{dock:n.alignment},settings:{isRTL:r,label:i.get(`Object.Disclaimer.${n.key}`)},style:{fontFamily:o}}}(r,t);if(r.disclaimerService.getHasSuppressingDisclaimer())return{components:[s]};const l=t.constraints.select||t.constraints.active,c=r.colorService.getLegend({eventName:"legend",key:"legend",viewState:r.viewState,chart:r.chart,styleReference:"object.pieChart",styleOverrides:{title:r.styleService.legend.title.getStyle(),label:r.styleService.legend.label.getStyle()},rtl:t.rtl},{navigationDisabled:l});return i.fillRange&&c.components[0]&&("right"===c.components[0].layout.dock||"left"===c.components[0].layout.dock||t.rtl)&&(i.fillRange.invert=!0),a=[Fl({layout:e},r),Rl({layout:e},r),jl(r),Hl({layout:e},r),lc({layout:e},r,t),...c.components,Ll({scaleKey:"fill",legend:c.components[0]||{},onEdited:r.onSelect}),{key:"lasso",type:"brush-lasso",layout:{displayOrder:99},settings:{brush:{components:[{key:"slices",contexts:["selection"]}]},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}}},{key:"area",type:"brush-area",settings:{brush:{components:[{key:"slices",contexts:["selection"],action:"add"}]}},style:{area:{fill:"transparent",strokeWidth:2,stroke:"black",strokeDasharray:"5 5",opacity:.7}}},Gl({layout:{components:e.components,dataPoint:vs({},e.dataPoint,{show:!(e.effectPath&&e.snapshotData&&!1===e.dataPoint.show)}),donut:e.donut},context:t},r),...r.tooltipService.getComponents(),s],a=a.filter(e=>!1!==e),{interactions:ac(n,r,t),scales:i,components:r.pluginService.extendComponents(a),palettes:r.colorService.getPalettes(),formatters:sc({settings:o},r),strategy:Ds(0,r)}}function uc({instance:e,services:t,picasso:r,env:i}){const{flags:o}=i,a=x(),s=A(),l=M(),c=w(),u=N(),p=L(),d=D(),f=T(),{qLocaleInfo:m}=O();i.localeInfo=m;const h=Ml({enable:p&&!p.snapshotData}),[y]=F(()=>{if(!t)return Promise.resolve();xl.attrExpr.updateProperties(s,p);const e=({getUseBaseColors:e})=>({theme:u,legendProps:p.legend,layout:p,localeInfo:m,hc:p.qHyperCube,colorProps:{...p.color,useBaseColors:e(p)}});return Promise.resolve(s&&!p.snapshotData?s.getEffectiveProperties():{}).then(async n=>Promise.all([t.colorService.initialize({createConfig:e}),Promise.resolve(n),t.pluginService.initialize(),t.alternativeService.initialize({properties:n})]))},[t,h]);I(()=>{e?.selectionService&&e.selectionService.setLayout(p)},[p]),I(()=>{if(!e||!y)return;const{chart:i,viewState:h,interactions:g,viewCache:v}=e,{alternativeService:b,colorService:x,disclaimerService:q,pluginService:D,themeService:S,tooltipService:C,styleService:w}=t,E=a.viewState||{};p.snapshotData||(h.preventSet("legendScrollOffset",E.legendScrollOffset||0),h.preventSet("rotation",E.rotation||0)),function(e,t){e&&e.snapshotData&&e.snapshotData.content&&e.snapshotData.content.chartData&&(t.preventSet("legendScrollOffset",e.snapshotData.content.chartData.legendScrollOffset||0),t.preventSet("rotation",e.snapshotData.content.chartData.rotation||0))}(p,h),C.expando.set("properties",y[1]);const I=r.data("q")({key:"qHyperCube",data:p.qHyperCube,config:{localeInfo:m}}),A=[{type:"q",key:"qHyperCube",data:p.qHyperCube,config:{localeInfo:m}},...x.getData()],M={slice:{arc:"qMeasureInfo/0"}};p.qHyperCube.qMeasureInfo.length>1&&(M.slice.outerRadius="qMeasureInfo/1"),q.initialize({args:{ds:I,encodings:M}});const L=function(e,t){if(t.slice.outerRadius)return e.extract({field:"qDimensionInfo/0",props:{num:{field:t.slice.arc},radius:{field:t.slice.outerRadius}}}).filter(e=>e.num.value>0&&"NaN"!==e.radius.value).length;return e.extract({field:"qDimensionInfo/0",props:{num:{field:t.slice.arc}}}).filter(e=>e.num.value>0).length}(r.data("q")({data:p.qHyperCube,config:{localeInfo:m}}),M),k=d?()=>{const e=i.brush("selection");n.selections(e,{},p).forEach(e=>{d.select(e)})}:()=>{},T=p.snapshotData&&!a.freeResize?{width:(p.snapshotData.content.size||p.snapshotData.object.size).w,height:(p.snapshotData.content.size||p.snapshotData.object.size).h}:void 0,N=t=>e.selectionService.getIsSelectionLocked(t),O=()=>cc({layout:p,context:{rtl:"rtl"===a.direction,theme:u,constraints:f},selectionService:e.selectionService},{picasso:r,ds:I,model:s,app:l,chart:i,onSelect:k,isLocked:N,interactions:g,constraints:f,translator:c,viewState:h,dataRowCount:L,encodings:M,alternativeService:b,colorService:x,disclaimerService:q,pluginService:D,themeService:S,styleService:w,tooltipService:C,debouncer:fi,properties:y[1],selections:d,logicalSize:T,flags:o,viewCache:v,animations:{enabled:()=>function({viewState:e,options:t,viewCache:n,layout:r,chart:i}){return!1!==t.chartAnimations&&n.get("chartWidth")===i.element.clientWidth&&n.get("chartHeight")===i.element.clientHeight&&n.get("hasZeroLine")===!!i.component("zeroLine")&&0===e.get("rotation")&&!Gs.propertiesHaveChanged({viewCache:n,layout:r})}({viewState:h,options:a,layout:p,viewCache:v,chart:i})}});e.generateSettings=O;const P=O();i.update({data:A,settings:P}),v.set("chartWidth",i.element.clientWidth),v.set("chartHeight",i.element.clientHeight),v.set("hasZeroLine",P.components.filter(e=>"zeroLine"===e.key).length>0),Gs.cacheProperties({viewCache:v,layout:p}),a.effect&&p.effectProperties?a.effect.update(p,i,{encodings:M}):p.effectPath||i.brush("highlight").end()},[e,y,a.direction,a.effectProperties,f,u.name(),c.language()])}function pc({instance:e,services:t}){const n=q(),r=L();j(i=>{if(!(r.snapshotData&&r.snapshotData.content&&r.snapshotData.content.chartData)&&(function(e,t){const n=t.getBoundingClientRect();e.snapshotData=e.snapshotData||{},e.snapshotData.content=e.snapshotData.content||{},e.snapshotData.content.size=e.snapshotData.content.size||{w:n.width,h:n.height}}(i,n),e&&t))return function({layout:e,chart:t,viewState:n,colorService:r}){return e.snapshotData.content=e.snapshotData.content||{},e.snapshotData.content.chartData={legendScrollOffset:Es(t,"legend-cat"),rotation:n.get("rotation")},r.getSnapshotData().then(t=>{e.snapshotData.content.chartData={...e.snapshotData.content.chartData,...t}}).catch(()=>{})}({layout:i,chart:e.chart,colorService:t.colorService,viewState:e.viewState})}),H(()=>({getViewState:()=>({rotation:e.viewState.get("rotation"),legendScrollOffset:Es(e.chart,"legend-cat")})}),[e])}var dc,fc={exports:{}};var mc=(dc||(dc=1,self,fc.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,p=arguments[0],d=1,f=arguments.length,m=!1;for("boolean"==typeof p&&(m=p,p=arguments[1]||{},d=2),(null==p||"object"!=typeof p&&"function"!=typeof p)&&(p={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=l(p,n),p!==(i=l(t,n))&&(m&&i&&(a(i)||(c=o(i)))?(c?(c=!1,u=r&&o(r)?r:[]):u=r&&a(r)?r:{},s(p,{name:n,newValue:e(m,u,i)})):void 0!==i&&s(p,{name:n,newValue:i}));return p}},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,p=arguments[0],d=1,f=arguments.length,m=!1;for("boolean"==typeof p&&(m=p,p=arguments[1]||{},d=2),(null==p||"object"!=typeof p&&"function"!=typeof p)&&(p={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=l(p,n),p!==(i=l(t,n))&&(m&&i&&(a(i)||(c=o(i)))?(c?(c=!1,u=r&&o(r)?r:[]):u=r&&a(r)?r:{},s(p,{name:n,newValue:e(m,u,i)})):void 0!==i&&s(p,{name:n,newValue:i}));return p}}},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:()=>ke});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 p(e){return!(!e.fullAccumulation&&!e.fullRange)}function d(e,t){var n=e.crossAllDimensions;return 2===t&&n?"RowNo(Total)":"RowNo()"}function f(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 m(){return"[$(=Replace(GetObjectField(".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,"),']',']]'))]")}function h(e,t){var n=e.crossAllDimensions;return 2===t&&n?"Above(Total ":"Above("}function y(e){return void 0===e?")":", 0, ".concat(e,")")}function g(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(g("MinString(".concat(t,")")),")' and Only({1}").concat(t,")<='$(=").concat(g("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),m(0));return"".concat(a,"({1<").concat(c,">}").concat(l,")")}if(r&&2===r.length){var p=u(r[0],i),d=u(r[1],i),f=m(0),h=m(1),y=v(p,f),g=v(d,h);return"".concat(a,"({1<").concat(y,",").concat(g,">}").concat(l,")")}return"".concat(a,"({1}").concat(l,")")}function x(e){return"".concat(e,"(")}function q(e){var t=e.properties,n=e.layout;return o(t,"qHyperCubeDef.qDimensions",o(n,"qHyperCube.qDimensionInfo",[])).length}const D={isFullRange:p,getNumDimensions:q,getExpressionWithExcludedComp:function(e){var t=e.expression,n=e.modifier,r=e.dimensions,i=e.dimensionAndFieldList,o=e.treatMissingAsNull,a=c(f(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=m(0);return"If(Count(".concat(u,") > 0, ").concat(a," + ").concat(s).concat(l,")")}if(r&&2===r.length){var p=m(0),d=m(1);return"If(Count(".concat(p,") * Count(").concat(d,") > 0, ").concat(a," + ").concat(s).concat(l,")")}return a},getRowNoComp:d,getNumStepComp:function(e,t){if(!p(e)){var n=e.steps;return"number"!=typeof n||Number.isNaN(n)?6:n}return d(e,t)},getAboveCompPrefix:h,getAboveCompSuffix:y,getAboveComp:function(e,t,n,r){return h(e,t)+n+y(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===q({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=m(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:f,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=q({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:m,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 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 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 w=t().bind(null,!0),E={},I=Array.isArray;function A(e){return null!=e&&!Array.isArray(e)&&"object"===C(e)}function M(e){return void 0===e}function L(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function k(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]=M(e[n||t])?o:e[t],e=e[n||t]}}),e}function T(e,t){var n=!0;if(A(e)&&A(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach(function(r){T(e[r],t[r])||(n=!1)}),n);if(I(e)&&I(t)){if(e.length!==t.length)return!1;for(var r=0,i=e.length;r<i;r+=1)if(!T(e[r],t[r]))return!1;return!0}return e===t}E.generate=function(e,t,n){n=n||"";var r=[];return Object.keys(t).forEach(function(i){var o=function(e){return e?w({},{val:e}).val:e}(t[i]),a=e[i],s="".concat(n,"/").concat(i);T(o,a)||L(t,i)||(M(a)?r.push({op:"add",path:s,value:o}):A(o)&&A(a)?r=r.concat(E.generate(a,o,s)):I(o)&&I(a)?r=r.concat(function(e,t,n){var r=[],i=e.slice(),o=-1;function a(e,t,n){if(e[n]&&M(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(t,i))return r;if(!M(t[0])&&M(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(E.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){M(t[i])&&!L(e,i)&&r.push({op:"remove",path:"".concat(n,"/").concat(i)})}),r},E.apply=function(e,t){t.forEach(function(t){var n,r,i=k(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(I(i))"-"===o&&(o=i.length),i.splice(+o,"add"===t.op?0:1,t.value);else if(I(a)&&I(t.value)){var l,c=t.value.slice();a.length=0,(l=a).push.apply(l,function(e){if(Array.isArray(e))return S(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 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}}(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(A(a)&&A(t.value))n=a,Object.keys(n).forEach(function(e){Object.getOwnPropertyDescriptor(n,e).configurable&&!L(n,e)&&delete n[e]}),w(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=k(e,t.from);I(i)?i.splice(+o,0,u.splice(+s,1)[0]):(i[o]=u[s],delete u[s])}else"remove"===t.op&&(I(i)?i.splice(+o,1):delete i[o])})},E.clone=function(e){return w({},e)},E.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},E.updateObject=function(e,t){Object.keys(e).length?E.apply(e,E.generate(e,t)):w(e,t)};const N=E,O=function(e,n,r){if(!e)return Promise.resolve();var i=N.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 P="accumulation";function F(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===P)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===P)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var j={type:"accumulation",disabled:!1,accumulationDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullAccumulation:!1,steps:6,outputExpression:""};const H={translationKey:"properties.modifier.accumulation",needDimension:D.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return D.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=D.getNumDimensions({properties:r,layout:i}));var c=o(r,"qHyperCubeDef.qDimensions",[]),u=D.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:s}),p=D.getNumStepComp(n,l),d=D.getAboveComp(n,l,u,p),f=D.getRangeComp("RangeSum",d);if(D.needDimension({modifier:n,properties:r,layout:i})){var m=D.getDimComp(c,1),h=D.getDimComp(c,0),y=D.getAggrComp(f,m,h);f=n.showExcludedValues?D.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:s,valueComp:y}):y}return f},extractInputExpression:D.extractInputExpression,initModifier:function(e){D.initModifier(e,j)},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!D.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=F(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=F(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 D.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=F(t,e);return o&&!o.disabled}};return n}};var z="movingAverage";function V(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===z)return n[r]}function _(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===z)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var $={type:"movingAverage",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullRange:!1,steps:6,outputExpression:"",nullSuppression:!1};const B={translationKey:"properties.modifier.movingAverage",needDimension:D.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return D.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=D.getNumDimensions({properties:i,layout:a}));var u=o(i,"qHyperCubeDef.qDimensions",[]),p=r.showExcludedValues&&r.nullSuppression,d=D.getExpressionWithExcludedComp({expression:n,modifier:r,dimensions:u,dimensionAndFieldList:l,treatMissingAsNull:p}),f=D.getNumStepComp(r,c),m=D.getAboveComp(r,c,d,f);if(r.nullSuppression)t=D.getRangeComp("RangeAvg",m);else{var h=D.getRangeComp("RangeSum",m),y=function(e,t){var n=D.getRowNoComp(e,t);if(!D.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(h," / ").concat(y)}var g=t;if(D.needDimension({modifier:r,properties:i,layout:a})){var v=D.getDimComp(u,1),b=D.getDimComp(u,0),x=D.getAggrComp(g,v,b);g=r.showExcludedValues?D.getExcludedComp({modifier:r,dimensions:u,dimensionAndFieldList:l,funcComp:"Only",valueComp:x}):x}return g},extractInputExpression:D.extractInputExpression,initModifier:function(e){D.initModifier(e,$)},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!D.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(_(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(_(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(_(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(_(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(_(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0},nullSuppression:{refFn:function(t){return"".concat(_(t,e),".nullSuppression")},type:"boolean",translation:t.showNull||"properties.dimensions.showNull",schemaIgnore:!0,defaultValue:!1,inverted:!0}},show:function(e,t){return D.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(z))return!1;var o=V(t,e);return o&&!o.disabled}};return n}};var U="timeSeriesDecomposition";function W(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===U)return n[r]}function K(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===U)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var Y={type:"timeSeriesDecomposition",disabled:!1,decomposition:"",steps:2,outputExpression:""};const G={translationKey:"properties.modifier.timeSeriesDecomposition",needDimension:D.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return D.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties;return n?D.generateTSDExpression(n,t,r):t},extractInputExpression:D.extractInputExpression,initModifier:function(e,t){D.initModifier(e,Y),""===e.decomposition&&t&&(e.decomposition=D.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!D.isApplicable({properties:t.properties})}},settings:{type:"items",items:{decomposition:{refFn:function(t){return"".concat(K(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(K(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 D.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(U))return!1;var o=W(t,e);return o&&!o.disabled}};return n}};var J="difference";function Z(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 X(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 Q={type:"difference",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,outputExpression:""};const ee={translationKey:"properties.modifier.difference",needDimension:D.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return D.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:D.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=D.getNumDimensions({properties:r,layout:i}));var c=o(r,"qHyperCubeDef.qDimensions",[]),u=D.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:s}),p=D.getAboveComp(n,l,u),d="".concat(u," - ").concat(p);if(D.needDimension({modifier:n,properties:r,layout:i})){var f=D.getDimComp(c,1),m=D.getDimComp(c,0),h=D.getAggrComp(d,f,m);d=n.showExcludedValues?D.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:s,funcComp:"Only",valueComp:h}):h}return d},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!D.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(X(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(X(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(X(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return D.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=Z(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(D.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(D.getDimDefWithWrapper(n),">"):""}const ue={translationKey:"properties.modifier.normalization",needDimension:function(){return!0},isApplicable:function(e){var t=e.properties,n=e.layout;return D.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:D.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=D.getNumDimensions({properties:r,layout:i}));var c=o(r,"qHyperCubeDef.qDimensions",[]),u=D.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:s}),p=n.selectionScope,d=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),p=ce(i,o,a),d=function(e){for(var t=[],n=0;n<e;n++)t[n]=D.getDimDefWithWrapper(n);return t.join(", ")}(o);return"".concat(e,"/ Sum(").concat(c," ").concat(u).concat(p," Aggr(").concat(c," ").concat(e,", ").concat(d,"))")}(u,p,n.field,n.value,d,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!D.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 D.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 pe="qDef.base",de="qDef.qDef",fe="qDef.base.qDef",me="qLibraryId",he="qDef.base.qLibraryId";const ye={getExpression:function(e){var t=o(e,fe);return void 0!==t?t:o(e,de)},getExpressionRef:function(e){return void 0!==o(e,fe)?fe:de},getLibraryIdRef:function(e){return o(e,he)?he:me},getLibraryId:function(e){return o(e,he)||o(e,me)},getLabelRef:function(e){return o(e,pe)?"qDef.base.qLabel":"qDef.qLabel"},getLabelExpressionRef:function(e){return o(e,pe)?"qDef.base.qLabelExpression":"qDef.qLabelExpression"}};var ge="qDef.qDef",ve="qDef.base.qDef",be="qLibraryId",xe="qDef.base.qLibraryId",qe="qDef.qLabel",De="qDef.qLabelExpression",Se="qDef.base.qLabel",Ce="qDef.base.qLabelExpression",we="qDef.qAggrFunc",Ee="qDef.base.qAggrFunc",Ie={initBase:function(e,t){(t||Ie.isValid(e))&&(n(e,ve,o(e,ge)),n(e,xe,o(e,be)),n(e,Se,o(e,qe)),n(e,Ce,o(e,De)))},restoreBase:function(e){Ie.isValid(e)&&(n(e,ge,o(e,ve)),n(e,be,o(e,xe)),n(e,qe,o(e,Se)),n(e,De,o(e,Ce)),o(e,we)&&o(e,Ee)&&n(e,we,o(e,Ee)),delete e.qDef.base)},isValid:function(e){var t=o(e,ve),n=o(e,xe);return void 0!==t||void 0!==n}};const Ae=Ie;function Me(e){return Me="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},Me(e)}var Le={accumulation:H,movingAverage:B,difference:ee,normalization:ue,timeSeriesDecomposition:G};const ke={modifiers:Le,apply:Ne,applyModifiers:Oe,cleanUpMeasure:Pe,destroy:function(e){e&&Te[e.id]&&Te[e.id].masterItemSubscriber&&(Te[e.id].masterItemSubscriber&&Te[e.id].masterItemSubscriber.unsubscribe(),delete Te[e.id])},hasActiveModifiers:Fe,getActiveModifier:Re,initBase:Ae.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some(function(e){return Le[e]})},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some(function(e){return Le[e]&&Le[e].isApplicable({properties:n,layout:r})})},measureBase:ye,limitedSorting:function(e){var t=e.measures,n=e.properties,r=e.layout,i=!1,o=!1;return t.forEach(function(e){var t=ze(e);Ke({modifiers:t,properties:n,layout:r})&&(i=!0,o=o||Xe({modifiers:t,properties:n,layout:r}))}),i&&!o},ifEnableTotalsFunction:je};var Te={};function Ne(){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;Te[n.id]=Te[n.id]||{isFirstTime:!0};var c=Te[n.id].isFirstTime;if(Te[n.id].isFirstTime=!1,r&&"object"===Me(r))return Oe({model:n,properties:r});var u=n?n.layout:void 0,p=o(u,"qSelectionInfo.qInSelections");if(a||p)return Promise.resolve(l);var d=o(u,"qHyperCube.qMeasureInfo"),f=Te[n.id].lastReloadTime;if(Te[n.id].lastReloadTime=o(n,"app.layout.qLastReloadTime"),Fe({measures:d,layout:u})){var m=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:d,layout:u,model:n,lastReloadTime:f});return m||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 Ke({modifiers:ze(t),layout:n})?!t.base:!!t.base}({measure:e,layout:n})}))}({measures:d,layout:u,masterItem:s,isFirstTime:c})?n.getEffectiveProperties().then(function(e){var r=t()(!0,{},e);_e(r);var i=Qe(r);return Ye({model:n}).then(function(t){return Ge({libraryIds:i,model:n}).then(function(i){return m&&function(e){var t=e.properties;He(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"===Me(e)&&!e.disabled){if(n++,"object"!==Me(Le[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=Le[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==r&&Be(t)&&D.simplifyExpression(t.qDef.base.qDef)!==D.simplifyExpression(r)&&(t.qDef.base.qDef=r)}})}}({measure:e,properties:t})})}({properties:r}),Oe({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"===Me(e.base)})}(d)?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 He(r).forEach(function(e){return Pe(e)}),Ze({oldProperties:e,newProperties:r,model:n})})}({model:n,properties:e})}):Promise.resolve(l)}function Oe(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,p=e.dimensionAndFieldList;void 0===r&&(r=l?t()(!0,{},i):i),_e(i);var d=Qe(i);return et({model:n,libraryIds:d,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=He(r)),!n.length)return Promise.resolve();if(!Fe({measures:n,properties:r}))return n.forEach(function(e){return Pe(e)}),Promise.resolve();var l=a?void 0:Qe(r);return Ye({model:i,dimensionAndFieldList:s}).then(function(e){return Ge({libraryIds:l,model:i,libraryItemsProps:a}).then(function(i){n.forEach(function(n){Ke({modifiers:n.qDef.modifiers,properties:r})?(function(e){var n=e.measure,r=e.properties,i=e.libraryItemsProps,a=e.dimensionAndFieldList,s=0;Ae.isValid(n)||Ae.initBase(n,!0);var l=n.qDef,c=l.modifiers,u=l.base;Array.isArray(c)&&c.forEach(function(e){if("object"===Me(e)&&!e.disabled){if(s++,"object"!==Me(Le[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)");Le[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:Le[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 Le[r.type].updateModifier&&Le[r.type].updateModifier(r,i.qHyperCubeDef);var a=ye.getExpression(n),s=""===a?a:Le[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||je(e)?"None"!==t?delete e.qDef.base.qAggrFunc:"None"===t&&je(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}),$e(n)):Pe(n)})})})}({measures:a,properties:i,model:n,libraryItemsProps:u,dimensionAndFieldList:p}).then(function(){return l?Ze({oldProperties:r,newProperties:i,model:n}):Promise.resolve(!1)})})}function Pe(e){!function(e){var t=ze(e);return Array.isArray(t)&&t.some(function(e){return"object"===Me(e)&&!e.disabled&&!Le[e.type]})}(e)?Ae.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,$e(e)}function Fe(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some(function(e){return Ke({modifiers:ze(e),properties:n,layout:r})})}function Re(e){var t=ze(e);if(Array.isArray(t))for(var n=0;n<t.length;n++){var r=t[n];if(Le[r.type]&&!r.disabled)return r}}function je(e){var t=Re(e);return!t||Le[t.type].enableTotalsFunction(e)}function He(e){return o(e,"qHyperCubeDef.qMeasures",[]).concat(o(e,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",[]))}function ze(e){return e.modifiers||e.qDef&&e.qDef.modifiers}function Ve(e){return o(e,"outputExpression.qValueExpression.qExpr")||o(e,"outputExpression")}function _e(e){He(e).forEach(function(e){return function(e){var n=Re(e);n&&(void 0!==n.outputExpression&&Ve(n)!==e.qDef.qDef?delete e.qDef.base:!Ae.isValid(e)&&n.base&&(e.qDef.base=t()(!0,{},n.base)))}(e)})}function $e(e){var t=ze(e);Array.isArray(t)&&t.forEach(function(t){"object"===Me(t)&&(t.disabled||!Le[t.type]&&Ve(t)!==e.qDef.qDef)&&(t.disabled=!0,delete t.base)})}function Be(e){return e.base||e.qDef&&e.qDef.base}function Ue(e){var t=Be(e);return e.qLibraryId||t&&t.qLibraryId}function We(e){var t=e.measure,n=e.properties,r=e.layout;return!Ue(t)&&Ke({modifiers:ze(t),properties:n,layout:r})}function Ke(e){var t=e.modifiers,n=e.properties,r=e.layout,i={};return Array.isArray(t)&&t.some(function(e){return!("object"!==Me(e)||e.disabled||!Le[e.type])&&(void 0===i[e.type]&&(i[e.type]=Le[e.type].isApplicable({properties:n,layout:r})),i[e.type])})}function Ye(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 Ge(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 Je(e,t){if(""!==t||-1===["qFmt","qDec","qThou"].indexOf(e))return t}function Ze(e){var t=e.oldProperties,n=e.newProperties,r=e.model,i=JSON.stringify(o(t,"qHyperCubeDef.qMeasures"),Je)!==JSON.stringify(o(n,"qHyperCubeDef.qMeasures"),Je)||JSON.stringify(o(t,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Je)!==JSON.stringify(o(n,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Je);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):O(t,n,r)}({model:r,oldProperties:t,newProperties:n}).then(function(){return i}):Promise.resolve(i)}function Xe(e){var t=e.modifiers,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some(function(e){return"object"===Me(e)&&!e.disabled&&Le[e.type]&&Le[e.type].needDimension({modifier:e,properties:n,layout:r})})}function Qe(e){var t=He(e),n=[],r=[],i=!1;return t.forEach(function(t){var r=ze(t);if(Ke({modifiers:r,properties:e})){var o=Ue(t);o&&n.push(o),i=i||Xe({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)?(Te[t.id].masterItemSubscriber=Te[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 Ne({model:t,masterItem:e}).then(function(){return t.app.clearUndoBuffer()})}}),Te[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:()=>_e});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 p={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 d=n(8),f=n.n(d);const m=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))},h=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))},y=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&&p.isOrderedSubset(i,r.interColumnSortOrder)&&(r.interColumnSortOrder=i.concat())},g=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){f().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 q=n(909),D=n.n(q);function S(e,t){var n=D()(!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 C(e,t){return D()(!0,{},t,e)}function w(e,t,n){return"function"==typeof e?e(t):Number.isNaN(+e)?n:e}var E=Math.pow(2,53)-1;function I(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 A(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 M=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},L=function(e,t,n){t.hasOwnProperty(e)&&(n[e]=t[e])},k=function(e,t,n,r){t.hasOwnProperty(e)?n[e]=t[e]:n[e]=r},T=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}}},N=function(){return{qDef:{autoSort:!0,cId:"",numFormatFromTemplate:!0},qLibraryId:"",qTrendLines:[]}},O=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=S(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=S(s.excludedDimensions[t],a);o.qDimensions.length<i?o.qDimensions.push(c):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(c)}},P=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=C(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=C(s.excludedMeasures[t],a);o.qMeasures.length<i?o.qMeasures.push(c):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(c)}},F=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=w(a.max,i.dimensions.length,E),l=w(a.min,i.dimensions.length,0);return{maxDimensions:w(o.max,s,E),minDimensions:w(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?(p.indexAdded(n.qInterColumnSortOrder,o),++o):(--o,p.indexRemoved(n.qInterColumnSortOrder,o))},j=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=D()(!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=D()(!0,{},n,i)).components&&(i.components=[]),i},H=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},z=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=[]))},V=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 I(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 I(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)?I(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)})}},_=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 A(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 A(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)?A(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)})}},$=function(e){var t=e.measures,n=e.modifierTypes;t&&n&&f().isSupportedModifiers(n)&&t.forEach(function(e){e.store&&e.store.modifiers&&(e.qDef.modifiers=e.store.modifiers),delete e.store})};function B(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 U={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=[]),m({exportFormat:i,qHyperCubeDef:l}),h({exportFormat:i,qHyperCubeDef:l}),y({exportFormat:i,qHyperCubeDef:l}),delete l.qLayoutExclude,g({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,p=e.supportedFilters,d=void 0===p||p,f=e.isHCModifierSupported,m=void 0===f||f,h={qChildren:[]},y=j({exportFormat:t,initialProperties:r,hypercubePath:c}),g=o.getValue(r,c||"").qHyperCubeDef,v=o.getValue(y,c||"").qHyperCubeDef,b=F({exportFormat:t,dataDefinition:a}),x=b.maxDimensions,q=b.minDimensions,D=b.maxMeasures,S=b.minMeasures,C=l.defaultDimension,w=void 0===C?T():C,E=l.defaultMeasure,I=void 0===E?N():E;v.qDimensions.length=0,v.qMeasures.length=0,H({exportFormat:t,maxDimensions:x,minDimensions:q,maxMeasures:D,minMeasures:S})&&z({exportFormat:t,maxDimensions:x,minDimensions:q,maxMeasures:D,minMeasures:S,newHyperCubeDef:v}),O({exportFormat:t,maxDimensions:x,minDimensions:q,newHyperCubeDef:v,defaultDimension:w}),P({exportFormat:t,maxMeasures:D,minMeasures:S,newHyperCubeDef:v,defaultMeasure:I}),V({newProperties:y,dataDefinition:a,hypercubePath:c}),_({newProperties:y,dataDefinition:a,hypercubePath:c}),R({exportFormat:t,newHyperCubeDef:v}),L("qMaxStackedCells",g,v),L("qNoOfLeftDims",g,v),k("qInitialDataFetch",g,v,[{qTop:0,qLeft:0,qWidth:0,qHeight:0}]),k("qMode",g,v,"S"),k("qReductionMode",g,v,"N"),k("qSortbyYValue",g,v),k("qIndentMode",g,v),k("qShowTotalsAbove",g,v),M(y,t,r),h.qProperty=y;var A=o.getValue(u||{},"support.modifiers");return $({measures:v.qMeasures,modifierTypes:A}),d&&B(h.qProperty,"storedFilters"),"S"===v.qMode&&m&&B(h.qProperty,"dynamicScript"),h}};var W={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};function K(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 Y(e,t){return e.length!==t}const G={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(K(a,t,r,i),Y(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"}},J={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}},Z={colorModeOptions:{primary:function(){return!0},dimension:function(e){return J.getNumDimensions(e)>0&&J.getNumMeasures(e)<=1},multiColor:function(e){return J.getNumMeasures(e)>1},measure:function(e){return J.getNumDimensions(e)>0},expression:function(e){return J.getNumMeasures(e)>=1}}},X={colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return J.getNumMeasures(e)>=1}}};var Q={scatterplot:X,"sn-scatter-plot":X,piechart:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return J.getNumMeasures(e)>=1}}},linechart:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return J.getNumDimensions(e)>1},multiColor:function(e){return J.getNumMeasures(e)>1},measure:function(e){return J.getNumDimensions(e)<=1},expression:function(e){return J.getNumMeasures(e)>=1}}},map:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return J.getNumDimensions(e)>=1},multiColor:function(e){return J.getNumMeasures(e)>1},measure:function(e){return J.getNumDimensions(e)>=1},expression:function(e){return J.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 J.getNumDimensions(e)>=1}}}};function ee(e,t,n){if(Array.isArray(e[t])){var r=p.findIndexByPropertyValue(e[t],"id",n);r>=0&&e[t].splice(r,1)}else e[t]=[]}function te(e,t){var n=G.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"),d=o.getValue(t,"color.formatting.isCustomFormatted");if(c){var f=G.create(G.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:f,label:s,item:c,isDimension:n,qNumFormat:u,isCustomFormatted:d});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=p.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:f,measures:a,item:c,isDimension:n,qNumFormat:u,isCustomFormatted:d})}n?(f.qSortBy={qSortByAscii:1},l.qAttributeDimensions.push(f)):l.qAttributeExpressions.push(f)}}}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:f().measureBase.getLibraryId(e)}(n,t),i?(s.type="measure",s.name=i,s.id=i,o=function(e,t){return f().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=J.getItemLabel(t);switch(ne(e,s||""),i){case"field":a="byDimension",o.byDimDef={label:t.label||J.wrapFieldName(t.name),key:J.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=G.IDMAP.COLOR_BY_ALTERNATIVE,a=p.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]||Z).colorModeOptions||Z.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))},pe=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=G.IDMAP.COLOR_BY_ALTERNATIVE,s=p.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)},de=function(e){e.forEach(function(e){e.qOtherTotalSpec&&"qTotalMode"in e.qOtherTotalSpec&&delete e.qOtherTotalSpec.qTotalMode})},fe=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},me=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)},he=function(e){o.setValue(e,"color.mode","primary"),o.setValue(e,"color.auto",!0)},ye=function(e){var t=o.getValue(e,"qHyperCubeDef.qDimensions",[]),n=o.getValue(e,"color.persistent",!1);return t.length>1&&!n},ge={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=U.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),o=i.data[0],a=o.dimensions.concat(o.excludedDimensions),s=o.measures.concat(o.excludedMeasures),l=G.IDMAP,c=l.COLOR_BY_ALTERNATIVE,u=l.COLOR_BY_EXPRESSION;return G.moveByIdFromGroup(a,[],"qAttributeDimensions",c),G.moveByIdFromGroup(a,[],"qAttributeExpressions",c),G.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=U.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:a,extension:s,supportedFilters:l,isHCModifierSupported:c}),p=u.qProperty,d=o.getValue(p,"visualization"),f=o.getValue(p,"qHyperCubeDef.qDimensions",[]),m=o.getValue(p,"color.mode",""),h=o.getValue(p,"color.auto",""),y=ce(p,d),g=ue({canColorBy:y,autoColor:h,colorMode:m,dimensions:f});return y[m]?fe({shouldUpdateColorBy:g,properties:p})&&me(p):he(p),g&&pe(p,"qHyperCubeDef."),ye(p)&&le(p,"color.persistent",!0),de(f),u}};var ve=["bar","marker","line"];const be=function(e){var t=e.initialProperties,n=e.properties;t.measureAxis&&void 0===t.measureAxis.autoMinMax?B(n,"unsupportedAutoMinMax")||D()(n.measureAxis,t.measureAxis):B(n,"supportedAutoMinMax")||D()(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]&&D()(s,n.properties.measureAxes[t[0].axis])):D()(s,n.properties.measureAxes[0])}},qe=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}}},De={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=e.supportedAutoMinMax,o=void 0===i||i,a=ge.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=ge.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:o,extension:s,supportedFilters:l,isHCModifierSupported:c}),p=u.qProperty;return be({initialProperties:n,properties:p}),xe({exportFormat:t,initialProperties:n,properties:p,measureType:a}),qe(p.qHyperCubeDef),p.qHyperCubeDef.qColumnOrder=[],p.qHyperCubeDef.columnOrder=[],u}};function Se(e,t,n){return"qLayoutExclude.quarantine.".concat(e,".").concat(t,".").concat(n)}function Ce(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=Se(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 we(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=Se(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 Ee="qHyperCubeDef.qMeasures",Ie="conditionalColoring",Ae="measures",Me="qDef.conditionalColoring";const Le={quarantine:function(e){Ce({properties:e,arrayPath:Ee,quarantineName:Ie,arrayName:Ae,itemPath:Me})},unquarantine:function(e){we({properties:e,arrayPath:Ee,itemPath:Me,arrayName:Ae,quarantineName:Ie})}};var ke="qHyperCubeDef.qMeasures",Te="measures",Ne="qHyperCubeDef.qDimensions",Oe="dimensions",Pe="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",Fe="alternativeMeasures",Re="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",je="alternativeDimensions",He="qCalcCondition",ze="conditionalShowHide";const Ve={quarantine:function(e){Ce({properties:e,arrayPath:ke,quarantineName:ze,arrayName:Te,itemPath:He}),Ce({properties:e,arrayPath:Ne,quarantineName:ze,arrayName:Oe,itemPath:He})},unquarantine:function(e){we({properties:e,arrayPath:ke,quarantineName:ze,arrayName:Te,itemPath:He}),we({properties:e,arrayPath:Ne,quarantineName:ze,arrayName:Oe,itemPath:He})},quarantineAlternative:function(e){Ce({properties:e,arrayPath:Pe,quarantineName:ze,arrayName:Fe,itemPath:He}),Ce({properties:e,arrayPath:Re,quarantineName:ze,arrayName:je,itemPath:He})},unquarantineAlternative:function(e){we({properties:e,arrayPath:Pe,quarantineName:ze,arrayName:Fe,itemPath:He}),we({properties:e,arrayPath:Re,quarantineName:ze,arrayName:je,itemPath:He})}},_e={hypercube:U,colorChart:ge,axisChart:De,quarantineProperty:x,unquarantineProperty:B,quarantineArrayProp:Ce,unquarantineArrayProp:we,conditionalColoring:Le,conditionalShow:Ve}})(),r.default})()),fc.exports),hc=cs(mc);const yc={setValue(e,t,n){if(!t)return;const r=t.split(".");let i=e;const o=r[r.length-1];let a;for(a=0;a<r.length-1;++a)null==i[r[a]]&&(i[r[a]]=Number.isNaN(+r[a+1])?{}:[]),i=i[r[a]];void 0!==n?i[o]=n:delete i[o]},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(null==o[r[i]])return n;o=o[r[i]]}return o}},gc={getDimensions:e=>yc.getValue(e,"qHyperCubeDef.qDimensions",[]),getNumDimensions:e=>yc.getValue(e,"qHyperCubeDef.qDimensions.length",0),getMeasures:e=>yc.getValue(e,"qHyperCubeDef.qMeasures",[]),getNumMeasures:e=>yc.getValue(e,"qHyperCubeDef.qMeasures.length",0),getDimensionLayouts(e,t){const n=yc.getValue(e,t?`${t}.qHyperCube`:"qHyperCube",null);return n?n.qDimensionInfo:[]},getDimensionLayout(e,t,n){return this.getDimensionLayouts(t,n).filter(t=>e===t.cId)[0]},getMeasureLayouts(e,t){const n=yc.getValue(e,t?`${t}.qHyperCube`:"qHyperCube",null);return n?n.qMeasureInfo:[]},getMeasureLayout(e,t,n){return this.getMeasureLayouts(t,n).filter(t=>e===t.cId)[0]}};const vc={colorModeOptions:{primary:()=>!0,dimension:()=>!0,multiColor:()=>!1,measure:()=>!0,expression:e=>gc.getNumMeasures(e)>=1},showLegend:e=>{const t=yc.getValue(e,"color.auto"),n=yc.getValue(e,"color.expressionIsColor"),r=yc.getValue(e,"color.mode");return!(!t&&"primary"===r||!t&&"byExpression"===r&&(n||void 0===n))},persistentColorsShow:e=>!yc.getValue(e,"color.auto")&&"byDimension"===yc.getValue(e,"color.mode"),useDimValColShow:e=>(void 0===yc.getValue(e,"color.useDimColVal")&&yc.setValue(e,"color.useDimColVal",!1),!yc.getValue(e,"color.auto")&&"byDimension"===yc.getValue(e,"color.mode")&&"libraryItem"===yc.getValue(e,"color.byDimDef.type"))},bc=function(e){const{colorModeOptions:t,persistentColorsShow:n,useDimValColShow:r,showLegend:i}=vc;this.color={colorMode:{options(n){const r=[];return"explore"===e&&r.push({value:"auto",translation:"Common.Auto"}),r.push({value:"primary",translation:"properties.colorMode.primary"}),r.push({value:"byDimension",translation:"properties.colorMode.byDimension"}),r.push({value:"byMeasure",translation:"properties.colorMode.byMeasure"}),t.expression(n)&&"explore"!==e&&r.push({value:"byExpression",translation:"properties.colorMode.byExpression"}),r}},persistentColors:{show:e=>r(e)?n(e)&&!yc.getValue(e,"color.useDimColVal"):n(e)},useDimColVal:{show:r}},this.legend={show:i,showTitle:{show(e){const t=yc.getValue(e,"color.auto");return yc.getValue(e,"legend.show")&&i(e)&&(t||!function(e){return"byExpression"===yc.getValue(e,"color.mode")&&!0===yc.getValue(e,"color.expressionIsColor")}(e))}},dock:{show:e=>yc.getValue(e,"legend.show")&&i(e)}}};function xc(e){return new bc(e)}const qc={classification:{section:"styling",tags:["simple"],exclusive:!0},component:"items",show:!0,chartType:"piechart",translation:"LayerStyleEditor.component.styling",chartTitle:"Object.PieChart",subtitle:"LayerStyleEditor.component.styling",useGeneral:!0,items:{strokeSection:{translation:"properties.Outline",component:"items",items:{strokeItem:{component:"items",ref:"components",key:"slices",items:{strokeWrapper:{component:"inline-wrapper",items:{strokeWidth:{translation:"LayerStyleEditor.style.strokeWidth",ref:"style.strokeWidth",width:9,show:!0,component:"dropdown",type:"string",options:[{value:"none",translation:"Common.None"},{value:"small",translation:"Common.Small"},{value:"medium",translation:"Common.Medium"},{value:"large",translation:"Common.Large"}],defaultValue:"none",schemaIgnore:!0},strokeColor:{ref:"style.strokeColor",defaultValue:{color:"#FFFFFF"},schemaIgnore:!0,width:3,component:"color-picker"}}}}}}},cornerRadius:{component:"items",translation:"LayerStyleEditor.style.cornerRadius",items:{cornerRadiusItem:{component:"items",ref:"components",key:"slices",items:{cornerRadiusSlider:{ref:"style.cornerRadius",translation:"LayerStyleEditor.style.cornerRadius",component:"slider",min:0,max:40,step:.05,width:12,defaultValue:0,schemaIgnore:!0}}}}},innerRadius:{translation:"LayerStyleEditor.style.innerRadius",component:"items",show:e=>e.donut.showAsDonut,items:{innerRadiusItem:{component:"items",ref:"components",key:"slices",items:{innerRadiusSlider:{ref:"style.innerRadius",translation:"LayerStyleEditor.style.innerRadius",component:"slider",min:.05,max:.75,step:.01,width:12,defaultValue:.55,schemaIgnore:!0}}}}}}},Dc=(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.pieChart",e,"color")})}}}}},Sc=(e,t,n,r)=>{const i=function({theme:e,translator:t,config:n={}}){const{id:r,paths:i}=function({config:e={}}){const{id:t,paths:n}=e;return{id:void 0===t?sn:`${sn}.${t}`,paths:Array.isArray(n)?n:[]}}({config:n}),o={};i.forEach(n=>{const i=n.split(".");yn(i);let a=o;for(let o=0;o<i.length;o++){const s=i[o];o===i.length-1?a[s]=mn({theme:e,translator:t,id:r,path:n}):void 0===a[s]&&(a[s]={}),a=a[s]}});const a=e=>{const t=e.split(".");yn(t);let n=o;for(let r=0;r<t.length;r++){const i=t[r];if(void 0===n[i])throw new Error(`font-resolver: Path '${e}' could not be resolved.`);n=n[i]}return n};return o.getDefaultValue=e=>a(e).getDefaultValue(),o.getOptions=e=>a(e).getOptions(),o}({theme:r,translator:n,config:{id:"pieChart",paths:["axis.title","label.name","label.value","legend.title","legend.label"]}});return{component:"styling-panel",chartTitle:"Object.PieChart",translation:"LayerStyleEditor.component.styling",subtitle:"LayerStyleEditor.component.styling",useGeneral:!0,useBackground:e,items:{strokeSection:{translation:"properties.Outline",component:"panel-section",items:{strokeItem:{component:"items",ref:"components",key:"slices",items:{strokeWrapper:{component:"inline-wrapper",items:{strokeWidth:{ref:"style.strokeWidth",width:9,show:!0,component:"dropdown",type:"string",options:[{value:"none",translation:"Common.None"},{value:"small",translation:"Common.Small"},{value:"medium",translation:"Common.Medium"},{value:"large",translation:"Common.Large"}],defaultValue:"none",schemaIgnore:!0},strokeColor:{ref:"style.strokeColor",defaultValue:{color:"#FFFFFF"},schemaIgnore:!0,width:3,component:"color-picker"}}}}}}},cornerRadius:{translation:"LayerStyleEditor.style.cornerRadius",component:"panel-section",items:{cornerRadiusItem:{component:"items",ref:"components",key:"slices",items:{cornerRadiusSlider:{ref:"style.cornerRadius",component:"slider",min:0,max:40,step:.05,width:12,defaultValue:0,schemaIgnore:!0}}}}},innerRadius:{translation:"LayerStyleEditor.style.innerRadius",component:"panel-section",show:e=>e.donut.showAsDonut,items:{innerRadiusItem:{component:"items",ref:"components",key:"slices",items:{innerRadiusSlider:{ref:"style.innerRadius",component:"slider",min:.05,max:.75,step:.01,width:12,defaultValue:.55,schemaIgnore:!0}}}}},axisTitleSection:t?.isEnabled("CLIENT_IM_3050")?{translation:"properties.dataPoints.dimensionlabels",component:"panel-section",items:{axisTitleItems:{component:"items",ref:"components",key:"axis",items:Dc("axis.title",i,r)}}}:void 0,labelNameSection:t?.isEnabled("CLIENT_IM_3050")?{translation:"properties.dataPoints.dimensionValueLabel",component:"panel-section",items:{labelItems:{component:"items",ref:"components",key:"label",items:Dc("label.name",i,r)}}}:void 0,labelValueSection:t?.isEnabled("CLIENT_IM_3050")?{translation:"properties.value.label",component:"panel-section",items:{labelItems:{component:"items",ref:"components",key:"label",items:Dc("label.value",i,r)}}}:void 0,legendTitleSection:t?.isEnabled("CLIENT_IM_3051")?{translation:"properties.legend.title",component:"panel-section",items:{labelItems:{component:"items",ref:"components",key:"legend",items:Dc("legend.title",i,r)}}}:void 0,legendLabelSection:t?.isEnabled("CLIENT_IM_3051")?{translation:"properties.legend.label",component:"panel-section",items:{labelItems:{component:"items",ref:"components",key:"legend",items:Dc("legend.label",i,r)}}}:void 0}}},Cc=xc("hard");const wc=e=>{e.color?.auto||(pi(e,"color.mode","byDimension"),pi(e,"color.byDimDef.activeDimensionIndex",0),pi(e,"color.persistent",!1))},Ec=e=>{const t=[{value:"primary",translation:"properties.colorMode.primary"},{value:"byDimension",translation:"properties.colorMode.byDimension"}];switch(e.color?.mode){case"byMultiple":t.push({value:"byMultiple",translation:"properties.colorMode.multicolored"});break;case"byMeasure":t.push({value:"byMeasure",translation:"properties.colorMode.byMeasure"});break;case"byExpression":t.push({value:"byExpression",translation:"properties.colorMode.byExpression"})}return t},Ic=e=>{const{flags:t,translator:n}=e||{},r=e?.sense?.theme,i=t?.isEnabled("SENSECLIENT_IM_2429_PIECHART_BG"),o=t?.isEnabled("TLV_1804_DEFAULT_CHART_SETTINGS"),a={items:{simpleItems:{items:{autoColor:{label:e=>e.color?.auto?n.get("Simple.Color.Auto",n.get("properties.colorMode.byDimension")):n.get("Common.Custom"),change:wc},colorMode:{options:Ec}}}}},s={items:{labels:{items:{header:{show:e=>e.qHyperCubeDef.qDimensions.length&&e.qHyperCubeDef.qMeasures.length},pointLabels:{component:"checkbox",ref:"dataPoint.auto",type:"boolean",defaultValue:!0,translation:"Simple.Label.Value",show:e=>e.qHyperCubeDef.qDimensions.length&&e.qHyperCubeDef.qMeasures.length,change(e){e.dataPoint.auto||pi(e,"dataPoint.labelMode","none")}},dimensionTitle:{component:"checkbox",ref:"dimensionTitle",type:"string",translation:"Simple.Label.Dimension.Hide",defaultValue:"all",show:e=>e.qHyperCubeDef.qDimensions.length&&e.qHyperCubeDef.qMeasures.length,convertFunctions:{get:(e,t,n,r)=>!r.dimensionTitle,set(e,t,n,r,i){i.dimensionTitle=!e}}}}}}},l={uses:"settings",items:{simpleStyling:qc,simpleLabels:s,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:Sc(i,t,n,r),showAsDonut:{ref:"donut.showAsDonut",type:"boolean",component:"item-selection-list",defaultValue:!1,horizontal:!0,items:[{icon:"pie_chart_pie",component:"icon-item",labelPlacement:"bottom",translation:"properties.pie",value:!1},{icon:"pie_chart_donut",component:"icon-item",labelPlacement:"bottom",translation:"properties.donut",value:!0}]},labels:{type:"items",snapshot:{tid:"property-labels"},items:{dimensionTitle:{ref:"dimensionTitle",type:"boolean",component:"switch",translation:"properties.dataPoints.dimensionlabels",defaultValue:!o,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}]},valuesAuto:{ref:"dataPoint.auto",type:"boolean",translation:"properties.dataPoints.labelmode",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},labelMode:{ref:"dataPoint.labelMode",type:"string",component:"dropdown",options:[{value:"none",translation:"Common.None"},{value:"share",translation:"properties.dataPoints.labelmode.share"},{value:"value",translation:"properties.dataPoints.labelmode.value"}],defaultValue:"share",show:e=>!e.dataPoint.auto},labelValueMode:{ref:"dataPoint.labelValueMode",type:"string",component:"dropdown",translation:"properties.dataPoints.labelvaluemode",options:[{value:"arc",translation:"Visualizations.Descriptions.Angle"},{value:"radius",translation:"Visualizations.Descriptions.Radius"}],defaultValue:"arc",show:e=>!e.dataPoint.auto&&function(e){return e.qHyperCubeDef&&e.qHyperCubeDef.qMeasures.length>1||e.qHyperCube&&e.qHyperCube.qMeasureInfo.length>1}(e)&&"value"===e.dataPoint.labelMode}}}}},colorsAndLegend:{uses:"colorsAndLegend",items:{colors:{items:{colorMode:{options:Cc.color.colorMode.options},persistentColors:{show:Cc.color.persistentColors.show}}},simpleColors:a,legend:{show:Cc.legend.show,items:{show:{defaultValue:!1,snapshot:{tid:"property-legend"}},showTitle:{show:Cc.legend.showTitle.show},dock:{show:Cc.legend.dock.show}}}}},tooltip:{uses:"tooltip"}}};return l},Ac={uses:"data",items:{dimensions:{uses:"dimensions"},measures:{uses:"measures",items:{numberFormatting:{items:{percentOfPieMessage:{component:"text",translation:"properties.numberFormatting.pieMessage",show:(e,t,{properties:n}={})=>n&&(n.dataPoint.auto||"share"!==n.dataPoint.labelMode)}}}}}}},Mc={uses:"sorting",items:{interColumnSorting:{reset:e=>{const{qDimensions:t,qMeasures:n,qInterColumnSortOrder:r}=e.qHyperCubeDef;if(1===t.length&&n.length>=1){const t=r.length,n=[...Array(t).keys()];[n[0],n[1]]=[n[1],n[0]],e.qHyperCubeDef.qInterColumnSortOrder=n}}}}},Lc={type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{suppressZero:null,calcCond:{uses:"calcCond"}}}}};function kc(e){return{type:"items",component:"accordion",items:{data:Ac,sorting:Mc,addons:Lc,settings:Ic(e)}}}const Tc=xc("explore"),Nc=kc();var Oc={type:"items",component:"accordion",items:{data:{uses:"data"},sort:{uses:"sort"},presentation:{uses:"presentation",items:{showAsDonut:Nc.items.settings.items.presentation.items.showAsDonut,labelMode:{type:"items",items:{labelMode:{type:"string",component:"radio-list",translation:"properties.dataPoints.labelmode",diffs:["dataPoint.auto:false","dataPoint.labelMode"],options:Nc.items.settings.items.presentation.items.labels.items.labelMode.options,setPropertyValue(e,t){e.dataPoint.auto=!1,e.dataPoint.labelMode=t},getValue:e=>e.dataPoint.auto?"":e.dataPoint.labelMode}}}}},color:{uses:"color",items:{mode:{options:Tc.color.colorMode.options},dimension:{items:{persistentColors:{show:e=>!(e.color&&"byDimension"===e.color.mode&&e.color.useDimColVal&&Tc.color.useDimColVal.show(e))}}}}}}};const Pc="slices";function Fc(e,t){const n=e&&e.desc&&void 0!==e.desc.share?e.desc.share:void 0;return t("share")(n)}function Rc(e){return e.data.num.label}function jc(e){return e.data.radius.label}function Hc(e,t,n,r){return function(e,t){if(e.dataPoint.auto)return 1===e.qHyperCube.qSize.qcy?Rc:Fc;if("share"===e.dataPoint.labelMode)return Fc;if("value"===e.dataPoint.labelMode)return t.encodings.slice.outerRadius&&"radius"===e.dataPoint.labelValueMode?jc:Rc;return Rc}(n,r)(e,t)}function zc(e){let t;return t=e.data.label?function(e,t){let n=e;return n.length>t&&(n=`${n.substr(0,t-3)}...`),n}(e.data.label,20):"",t}class Vc{constructor({element:e,properties:t,effectHelper:n,Flag:r}){this.element=e,this.Flag=r,n.initFade(this.element);const i=e.find(".effectLayer");i.length>0&&i.remove(),e.append('<div class="effectLayer"></div>'),this.effectLayer=e.find(".effectLayer"),this._effectProperties=t,this.selectedIndex=t.selectedIndex,this.hasPropertiesPanel=!1,this.effectApplied=!0,n.fadeIn(this.element)}updateOrigSettings(e){return{dataPoint:e.dataPoint,legend:e.legend,dimensionTitle:e.dimensionTitle}}updateFlags(e,t){const n=this.chart.getAffectedShapes("highlight"),r=this.effectLayer[0].getBoundingClientRect(),i=n.map(n=>{const{start:i,end:o,outerRadius:a,offset:s}=n.desc.slice,{scaleRatio:l}=this.chart.component(n.key).rect,c=n.element.getBoundingClientRect(),u=(i+o)/2,p=c.left-r.left+l.x*(s.x+a*Math.sin(u)),d=c.top-r.top+l.y*(s.y-a*Math.cos(u)),f=Math.cos(u)>0?"top":"bottom",m=Math.sin(u)>0?"right":"left";return{title:zc(n),label:Hc(n,this.chart.formatter,e,t),orientation:`${f}${m}`,position:{x:p,y:d}}});this.Flag.show(this.effectLayer,i)}init(e,t,n,r){return t.getProperties().then(e=>{if(!e.originalModelSettings){const t=vs(!0,{},e);e.originalModelSettings=this.updateOrigSettings(t)}e.effectProperties=r,e.effectPath=n,e.dataPoint.show=!1,e.legend.show=!1,e.dimensionTitle=!1,t.setProperties(e)})}remove(e,t,n){return e.options=vs(e.options,{effect:null}),n?t.getProperties().then(e=>vs(e,{effectPath:null,effectProperties:null,dataPoint:vs(!0,{},e.originalModelSettings.dataPoint),legend:vs(!0,{},e.originalModelSettings.legend),dimensionTitle:e.originalModelSettings.dimensionTitle})):Promise.resolve()}}class _c extends Vc{init(e,t,n,r){return e.options=vs(!0,e.options,{effect:this}),t.layout.effectProperties&&t.layout.effectPath===n&&t.layout.effectProperties.max===r.max?Promise.resolve():super.init(e,t,n,r)}update(e,t,n){this.chart=t,this.updateHighlight(e),this.updateFlags(e,n)}updateHighlight(e){const t=this.chart.component(Pc).data.items,n=e.effectProperties.min,r=e.effectProperties.max,i=[];let o=[1/0,-1],a=[-1/0,-1];t.forEach((e,t)=>{const i=e.num.value;n&&i<o[0]&&(o=[i,t]),r&&i>a[0]&&(a=[i,t])}),-1!==o[1]&&i.push(t[o[1]].value),-1!==a[1]&&i.push(t[a[1]].value),i.length&&this.chart.brush("highlight").setValues(i.map(e=>({key:"qHyperCube/qDimensionInfo/0",value:e})))}}class $c extends Vc{constructor(e){super(e),this.hasPropertiesPanel=!0,this.propsTemplate=e.highlightValuePropsTemplate,this.effectHelper=e.effectHelper}onClick(e){if(!this.chart)return;const t=this.chart.shapesAt(function(e,t){const n=t.element.getBoundingClientRect();return{x:e.clientX-n.left,y:e.clientY-n.top}}(e,this.chart),{propagation:"stop"});if(1!==t.length)return;const n=t[0],r=this.chart.component(Pc).data.items.map(e=>e.value).indexOf(n.data.value);-1!==r&&(this.selectedIndex=r,this.effectHelper.updateSelectedPointIndex(this))}update(e,t,n){this.chart=t,this.updateHighlight(e),this.updateDataPoints(e,n),this.updateFlags(e,n)}updateHighlight(e){const t=this.chart.component(Pc).data.items[e.effectProperties.selectedIndex];this.chart.brush("highlight").setValues([{key:"qHyperCube/qDimensionInfo/0",value:t.value}])}updateDataPoints(e,t){this.dataPoints=this.chart.findShapes("path").filter(e=>e.key===Pc).map((n,r)=>{const i=Hc(n,this.chart.formatter,e,t);return{text:`${zc(n)} (${i})`,value:r}})}init(e,t,n,r){return e.options=vs(!0,e.options,{effect:this}),t.layout.effectProperties&&t.layout.effectPath===n&&t.layout.effectProperties.selectedIndex===r.selectedIndex?Promise.resolve():super.init(e,t,n,r)}}const Bc="/effects/highlight-value",Uc="/effects/maxmin";var Wc={isCompatible:({effectPath:e})=>e===Uc||e===Bc,create:e=>e.effectPath===Uc?new _c(e):e.effectPath===Bc?new $c(e):null};function Kc(e){const t={},{components:n,tooltip:r}=e,i=n?n.filter(e=>"slices"===e.key)[0]:void 0;if(i&&i.style&&Object.keys(i.style).forEach(e=>{t[`chart_style_${e}`]=i.style[e]}),r){t.chart_tooltip_custom=!r.auto;const e=r.chart?.object?.refId;!r.auto&&e&&(t.chart_tooltip_custom_mini_chart=e)}return t}function Yc(e){if(!e.qHyperCubeDef)return;const t=e.qHyperCubeDef.qDimensions,n=e.qHyperCubeDef.qMeasures;1===t.length&&1===n.length&&(n[0].qSortBy.qSortByNumeric=-1,e.qHyperCubeDef.qInterColumnSortOrder.splice(0,e.qHyperCubeDef.qInterColumnSortOrder.length,1,0))}function Gc(e){e.qOtherTotalSpec.qOtherMode="OTHER_COUNTED",e.qOtherTotalSpec.qOtherCounted={qv:"10"}}function Jc({translator:e}){return{dimensions:{min:1,max:1,description:()=>e.get("Visualizations.Descriptions.Slice"),add(e,t){Gc(e),Yc(t),fl.addCallbackCustomTooltip(t)},move(e,t){Gc(e),Yc(t),fl.moveCallbackCustomTooltip(t,e)},remove(e,t){fl.removeCallbackCustomTooltip(t,e)},replace(e,t,n,r){Gc(e),Yc(r),fl.replaceCallbackCustomTooltip(r,t)}},measures:{min:1,max:2,description:(t,n)=>e.get(0===n?"Visualizations.Descriptions.Angle":"Visualizations.Descriptions.Radius"),add(e,t){Yc(t)},remove(e,t){!function(e){if(!e.qHyperCubeDef)return;const t=e.qHyperCubeDef.qMeasures,{mode:n}=e.color;"byExpression"===n&&0===t.length&&(e.color.mode="primary")}(t)}}}}const Zc=e=>e.qMax<=0,Xc=e=>!(!(e&&e.qHyperCube.qSize.qcy>0)||e.qHyperCube.qMeasureInfo.every(Zc));function Qc(e){const t={definition:kc(e),softDefinition:Oc,support:{snapshot:Xc,export:Xc,exportData:!0,sharing:Xc,viewData:!0,effects:!0},effects:Wc,extendMetrics:Kc,importProperties:(t,n,r,i)=>{const o={layout:{templateId:n.templateId}};r.mapProperties(o);const a={defaultDimension:r.getDefaultDimensionProperties(),defaultMeasure:r.getDefaultMeasureProperties()},s=hc.colorChart.importProperties({exportFormat:t,initialProperties:n,dataDefinition:Jc(e),defaultPropertyValues:a,hypercubePath:i});return s.qProperty.dataPoint&&!1===s.qProperty.dataPoint.show&&delete s.qProperty.dataPoint.show,s},exportProperties:(t,n,r,i)=>{const o=function(e){return(t,n,r,i)=>{const{translator:o,localeInfo:a}=e||{},s=hc.colorChart.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r});if(r){const e=ws.getValue(s,"properties.qHyperCubeDef.qMeasures");if(!e||0===e.length)return s;const t=e[0],n=o?.get("properties.dataPoints.labelmode.share")||"Share",r=i||a,l=r?.qDecimalSep||".",c={qDef:{qDef:"=If(Column(1) >= 0, Column(1))",qLabel:n,qNumFormat:{qType:"F",qnDec:2,qUseThou:0,qFmt:`0${l}0%`,qDec:l,qThou:r?.qThousandSep||","},qAggrFunc:"Sum",qRelative:!0,qExpressions:[],qLabelExpression:"",cId:ws.generateId()},qLibraryId:"",qAttributeExpressions:[],qAttributeDimensions:[]},u=vs(!0,{},t,c);e.push(u);const p=ws.getValue(s,"data.0.measures",[]);if(p?.length>0){const e=p[0],t=vs(!0,{},e,c);p.push(t)}}return s}}(e);return o(t,n,r,i)}};return t}function eu(e){return{version:"2.9.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:[{key:"slices",style:{strokeWidth:"none",strokeColor:{index:-1,color:Nl.STROKE.COLOR},cornerRadius:Nl.CORNER_RADIUS,innerRadius:Nl.INNER_RADIUS}}],dataPoint:{auto:!0,labelMode:"share",labelValueMode:"arc"},dimensionTitle:!e.flags.isEnabled("TLV_1804_DEFAULT_CHART_SETTINGS"),donut:{showAsDonut:!1},footnote:"",legend:{dock:"auto",show:!e.flags.isEnabled("TLV_1804_DEFAULT_CHART_SETTINGS"),showTitle:!0},qHyperCubeDef:{qDimensions:[],qMeasures:[],qInitialDataFetch:[{qWidth:10,qHeight:500}],qSuppressMissing:!0,qSuppressZero:!1,qMode:"S"},showDetails:!0,showDisclaimer:!0,showTitles:!0,subtitle:"",title:"",tooltip:{auto:!0,hideBasic:!1,data:{qHyperCubeDef:void 0},chart:void 0,imageComponents:void 0}}}function tu(e){return{properties:{...eu(e)},data:{targets:[Jc(e)]},importProperties:({exportFormat:t,initialProperties:n,hypercubePath:r})=>{const i=hc.colorChart.importProperties({exportFormat:t,initialProperties:n,dataDefinition:Jc(e),hypercubePath:r});return i.qProperty.dataPoint&&!1===i.qProperty.dataPoint.show&&delete i.qProperty.dataPoint.show,i},exportProperties:({propertyTree:e,hypercubePath:t,viewDataMode:n})=>hc.colorChart.exportProperties({propertyTree:e,hypercubePath:t,viewDataMode:n})}}const nu=i=>{const{flags:o}=i;!function(e){if(e&&e.get&&e.add){const t="Object.Disclaimer.LimitedData";if(e.get(t)!==t)return;Object.keys(z).forEach(t=>{e.add(z[t])})}}(i.translator);const a=function(){const i=t();return i.use(n),i.use(r(e)),i.renderer("react-qcm",et),i.component("axis-title",Ke),i.component("disclaimer",Ge),i.component("pie-dividers",tn),i.component("negative-indicators",an),i}();return{qae:tu(i),ext:Qc(i),component(){const e=function({picasso:e}){const t=x(),n=q(),r=D(),[i,o]=S(),a=ms(),s=C(),l=w(),c=!!s.qSelectionInfo?.qInSelections,[u,p]=S(!1);return a.lasso=function({layout:e,isInSelections:t,isLassoActionActive:n,setIsLassoActionActive:r,translator:i}){return{active:n,label:i.get(n?"Tooltip.ToggleOffLassoSelection":"Tooltip.ToggleOnLassoSelection"),hidden:!t||!!e.qHyperCube?.qDimensionInfo?.[0]?.qIsOneAndOnlyOne,action(e){r("boolean"==typeof e?e:!n)},icon:{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"}}]}}}({layout:s,isInSelections:c,isLassoActionActive:u,setIsLassoActionActive:p,translator:l}),E(()=>(i&&(i.interactions.lasso.active=()=>u),{...a.lasso}),[i,u,c,l.language()]),I(()=>{n.style.overflow="hidden";const i=e({renderer:{prio:[t.renderer||"canvas"]}}),l=i.chart({element:n,data:[],settings:{}}),c=ba({chart:l,actions:a,selections:r,config:{selectionActions:!1}});c.setLayout(s),c.setBrushAliases({colorField:"qDimensionInfo/0/qAttrDimInfo/0"});const u=function(){const e={...{legendScrollOffset:0,rotation:0}},t={},n={};let r=!1;const i={get:t=>e[t],set:(i,o)=>{const a=e[i];!r&&t[i]?e[i]=t[i](o,a):e[i]=o,!r&&n[i]&&n[i](e[i],a)},preventSet:(e,t)=>{r=!0,i.set(e,t),r=!1},intercept:(e,n)=>{t[e]=n},onChanged:(e,t)=>{n[e]=t}};return i}();u.intercept("rotation",e=>(u.get("rotation")+e)%(2*Math.PI)),u.onChanged("rotation",()=>{l.update({partialData:!0})});const p=di();return a.on("selections-start",()=>{l.brush("selection").start()}),o({picasso:i,chart:l,selectionService:c,viewState:u,viewCache:p,interactions:a}),()=>{c.destroy(),l.destroy(),a.removeAllListeners(),delete a.select,u.intercept("rotation",void 0),u.onChanged("rotation",void 0)}},[]),i}({picasso:a}),t=wl({flags:o,picasso:a,instance:e});uc({instance:e,services:t,picasso:a,env:i}),function({instance:e}){const t=L(),n=x(),r=R();I(()=>{if(!e||!e.generateSettings)return;const{viewCache:r,chart:i,generateSettings:o}=e;i.update({settings:o()}),r.set("chartWidth",i.element.clientWidth),r.set("chartHeight",i.element.clientHeight),n.effect&&n.effect.update(t,i)},[r.width,r.height])}({instance:e}),pc({instance:e,services:t})}}};export{nu as default};
|
|
9
|
+
e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,c,u,p,d=e.length,f=e.search(/[0-9\-\+#]/),m=f>0?e.substring(0,f):"",h=e.split("").reverse().join(""),y=h.search(/[0-9\-\+#]/),g=d-y,v=e.substring(g,g+1),b=g+("."===v||","===v?1:0),x=y>0?e.substring(b,d):"";if(n=(t="-"===(e=e.substring(f,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(h="",g=(p=t[0]).length%l,d=p.length,b=0;b<d;b++)h+=p.charAt(b),!((b-g+1)%l)&&b<d-l&&(h+=o);t[0]=h}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),m+(n?"-":"")+r+x}},co(uo={exports:{}}),uo.exports);function fo(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const mo={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"},ho=/%\)?$/,yo=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,go=/^\(oct\)/i,vo=/^\(dec\)/i,bo=/^\(hex\)/i,xo=/^\(bin\)/i,qo=/^\(rom\)/i,Do=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,So=/#|0/g;function Co(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 wo(e,t,n){const r=fo(e);return n?r:new RegExp(r||"",t)}function Eo(e,t,n,r){let i,o,a,s,l,c,u,p,d,f=e.pattern;var m,h;r&&(e.abbreviate=!0),m=t,(h=n)&&(h=fo(h)),m&&(m=fo(m)),d=new RegExp("(?:[#0]+".concat(m,")?[#0]+(?:").concat(h,"[#0]+)?")),a=f.match(d),a=a?a[0]:"",s=a?f.substr(0,f.indexOf(a)):f,l=a?f.substring(f.indexOf(a)+a.length):"",a||(a=f?"#":"##########"),t&&t===n&&(i=a.split(n),o=i.pop(),a=i.join("")+n+o,t=""),c=t,t=/,/.test(n)?"¤":",",c&&(a=a.replace(wo(c,"g"),t)),u=n,n=".",u&&(a=a.replace(wo(u,"g"),n)),p=a.match(/#/g),p=p?p.length:0;const y=f.split(u);let g;y[1]&&(g=y[1].match(So)),e.prefix=s||"",e.postfix=l||"",e.pattern=f,e.maxPrecision=g?g.length:2,e.percentage=ho.test(f),e.numericPattern=a||"",e.numericRegex=new RegExp("".concat(wo(t,null,!0),"|").concat(wo(n,null,!0)),"g"),e.groupTemp=c,e.decTemp=u,e.t=t,e.d=n,e.temp=p}class Io{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 mo;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 Io(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],Do.test(e[0])&&(r.positive.isFunctional=!0),e[1]?Do.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?Do.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1;const i="U"===this.type;r.positive.isFunctional||Eo(r.positive,t,n,i),r.negative&&!r.negative.isFunctional&&Eo(r.negative,t,n,i),r.zero&&!r.zero.isFunctional&&Eo(r.zero,t,n,i)}formatValue(e){let t,n,r,i,o,a,s,l,c,u=this._prepared,p="",d="",f=e;if(isNaN(e))return"".concat(f);if(e=+e,!1===u.pattern)return e.toString();if(0===e&&u.zero)return u=u.zero,u.pattern;if(e<0&&u.negative?(u=u.negative,e=-e):u=u.positive,o=u.d,a=u.t,u.isFunctional)e=function(e,t,n){let r;return yo.test(t)?e=Co(e,Number(/\d{2}/.exec(t)[0]),t,n):go.test(t)?e=Co(e,8,t,n):vo.test(t)?e=Co(e,10,t,n):bo.test(t)?e=Co(e,16,t,n):xo.test(t)?e=Co(e,2,t,n):qo.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&&(p=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=po(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)/,""),d=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(r)/Math.log(10)))),s=0;s<t;s++)l+="#";e=po(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+d+p+u.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function Ao(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),p=Object.create(null),d=0,f=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)=>(d>=r&&(delete u[p[f]],delete p[f],d--,f++),u[e]=t,p[d]=e,d++,t),l.get=e=>u[e],l.has=e=>e in u,l.clear=()=>{u=Object.create(null),p=Object.create(null),d=0,f=0},l.size=()=>d,l}function Mo(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 Io(...t)}(i,e,t,n,r),a=Ao(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 Lo="D",ko="T",To="TS",No=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Oo=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Po=["January","February","March","April","May","June","July","August","September","October","November","December"],Fo=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ro(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function jo(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}class Ho{constructor(e,t,n){const r=e||{};r.qCalendarStrings||(r.qCalendarStrings={qLongDayNames:No,qDayNames:Oo,qLongMonthNames:Po,qMonthNames:Fo}),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={[ko]:r.qTimeFmt||"hh:mm:ss",[Lo]:r.qDateFmt||"YYYY-MM-DD",[To]:r.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]),this.pattern=t}clone(){const e=new Ho(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*jo(t),r=60*jo(n),i=60*jo(r),o=1e3*jo(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:Ro("".concat(a.year).slice(-2),2),YYY:Ro("".concat(a.year).slice(-3),3),def:e=>Ro("".concat(a.year),e.length)},"M+":{M:a.month+1,MM:Ro("".concat(a.month+1),2),MMM:o.locale_months_abbr[a.month],def:o.locale_months[a.month]},"W+|w+":{W:a.day,WW:Ro("".concat(a.day),2),WWW:o.locale_days_abbr[a.day],def:o.locale_days[a.day]},"D+|d+":{D:a.date,def:e=>Ro("".concat(a.date),e.length)},"h+|H+":{h:a.h,def:e=>Ro("".concat(a.h),e.length)},"m+":{m:a.m,def:e=>Ro("".concat(a.m),e.length)},"s+|S+":{s:a.s,def:e=>Ro("".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 zo(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Ho(...t)}function Vo(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=zo(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),r=Ao(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=zo(i,e,t),r=Ao(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 _o(){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),p="dimension"===l?"first":"avg",d=function(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return Vo(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"),Mo(n,r,i,o,t)}(n,o),f={id:()=>r,key:()=>i,raw:()=>n,title:()=>n.qFallbackTitle||n.label,type:()=>l,origin:()=>c,items:()=>(e||(e=a(f)),e),min:()=>n.qMin,max:()=>n.qMax,value:u,label:e=>(null==e?void 0:e.qText)||"",reduce:p,reduceLabel:"dimension"===l?"first":(e,t)=>d(t),formatter:()=>d,tags:()=>n.qTags};return f}function $o(e,t,n,r,i){return(t[e]||[]).map((t,o)=>{const a="".concat(r?"".concat(r,"/"):"").concat(e,"/").concat(o),s={instance:_o(Ii({id:"".concat(n?"".concat(n,"/"):"").concat(a),key:a,meta:t},i))};return s.attrDims=$o("qAttrDimInfo",t,n,a,Ii({},i,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),s.attrExps=$o("qAttrExprInfo",t,n,a,Ii({},i,{value:e=>null==e?void 0:e.qNum,type:"measure"})),s.measures=$o("qMeasureInfo",t,n,a,Ii({},i,{value:e=>null==e?void 0:e.qValue,type:"measure"})),s})}function Bo(){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=Bo.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=lo,l.hierarchy=so,l.pages="K"===a.qMode?a.qStackedDataPages:a.qTreeDataPages):"S"===a.qMode?(l.extractor=ki,l.pages=a.qDataPages,l.hierarchy=so):l.extractor=()=>[],l.fieldExtractor=e=>l.extractor({field:e},c,o,s);const u="S"===a.qMode?e=>e.qElemNumber:void 0,p="S"===a.qMode?e=>e.qNum:void 0;o.wrappedFields.push(...$o("qDimensionInfo",a,t,"",Ii({},l,{value:u,type:"dimension"}))),o.wrappedFields.push(...$o("qMeasureInfo",a,t,"",Ii({},l,{value:p,type:"measure"}))),o.fields=o.wrappedFields.map(e=>e.instance);const d=e=>{e.forEach(e=>{o.allFields.push(e.instance),d(e.measures),d(e.attrDims),d(e.attrExps)})};return d(o.wrappedFields),(i.virtualFields||[]).forEach(e=>{const n=c.field(e.from),r=_o(vi({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 Uo=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],Wo=/\/qDimensionInfo(?:\/(\d+))?/,Ko=/\/qMeasureInfo\/(\d+)/,Yo=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,Go=/\/qAttrExprInfo\/(\d+)/,Jo=/\/?qHyperCube/,Zo=/\/?qTreeData/,Xo=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),Qo=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function ea(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;Jo.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),a=Xo):Zo.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),a=Qo);let s=!0;if(Wo.test(e)&&(r=+Wo.exec(e)[1]),Ko.test(e)&&(i=+Ko.exec(e)[1]),Yo.test(e)){i=-1,r=0;const e=+Yo.exec(n)[2];isNaN(e)||(r=e,n=n.replace(/\/\d+$/,"")),s=!1}if(Go.test(e)){const e=i;if(t){i=0;const a=Ki(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+=+Go.exec(n)[1]}else r>-1?(r=-1,i=+Go.exec(n)[1]):i+=+Go.exec(n)[1]+1}return Uo.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 hi(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)?hi(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 ta(e){Bo.util=e.data("matrix").util,e.data("q",Bo),e.formatter("q-number",Mo),e.formatter("q-time",Vo)}function na({layout:e,path:t}){const n=ci(e||{},t.split("/").join("."));if(!n)return!1;const{qIsOneAndOnlyOne:r=!1}=n;return r}function ra({brush:e,colorField:t,legendAlias:n,useLegendCube:r=!1}){!t||/qAttrDimInfo/.test(t)?(e.removeKeyAlias("attrDim/qDimensionInfo/0"),n&&e.removeKeyAlias(n),e.addKeyAlias("attrDim/qDimensionInfo/0",`qHyperCube/${t}`)):r&&e.addKeyAlias(n,`qHyperCube/${t}`)}ta.qBrushHelper=ea,ta.selections=ea;const ia="Shift";const oa=(e,t)=>t[e]?oa(e+1,t):e,aa=(e,t)=>{const n=t.reduce((e,t)=>(e[t]=!0,e),{});return e.reduce((e,t,r)=>{const i=oa(r,n);return n[i]=!0,e[r]=i,e},{})};function sa({layout:e,filtered:t={}}={}){const{qDimensionInfo:n=[],qMeasureInfo:r=[]}=e?.qHyperCube||{};return{dimensions:aa(n,t.dimensions||[]),measures:aa(r,t.measures||[])}}function la({selection:e,fieldMap:t}){const{method:n,params:r}=e;if("selectHyperCubeValues"===n){const e=t.dimensions[r[1]];void 0!==e&&(r[1]=e)}return"selectHyperCubeContinuousRange"===n&&r[1].forEach(e=>{const n=t.dimensions[e.qDimIx];void 0!==n&&(e.qDimIx=n)}),e}const ca=[];let ua=0;const pa=e=>{const t=ca.filter(e=>e.selections?.isActive());t.length&&("Enter"===e.key?t.forEach(e=>e.selections.confirm()):"Escape"!==e.key&&"Esc"!==e.key||t.forEach(e=>e.selections.cancel()))};function da({selections:e,brush:t,majorScale:n,actions:r,selectionsFn:i}={},{path:o="/qHyperCubeDef"}={}){if(!e)return{layout:()=>{},filteredFields:()=>{},allowSimultaneous:()=>{},release:()=>{}};const a=++ua;let s=null,l={dimensions:[],measures:[]},c=[],u={};e.on=e.on.bind(e),e.isActive=e.isActive.bind(e),e.addListener=e.addListener.bind(e),e.removeListener=e.removeListener.bind(e);const{rangeInterceptor:p,interceptor:d}=function({brush:e,getConfig:t}){return{interceptor:n=>{const r=e.brushes(),{allowSimultaneous:i,layout:o={}}=t();r.forEach(t=>{("range"===t.type||n[0]?.key&&n[0]?.key!==t.id&&0!==i.indexOf(n[0]?.key))&&e.clear([])});const a=n.filter(e=>-2!==e.value);if(a.length>1){const e=function({layout:e={},values:t=[]}){if(!t?.length)return[];const n=Array.from(new Set(t.map(e=>e.key))),r=[];return n.forEach(n=>{const i=na({layout:e,path:n}),o=t.filter(e=>e.key===n),a=i?[o.pop()]:o;r.push(...a)}),r.filter(Boolean)}({layout:o,values:a});return e}return a},rangeInterceptor:n=>{const r=e.brushes(),{allowSimultaneous:i}=t();return r.filter(e=>"value"===e.type).length?(e.clear([]),n):(r.forEach(t=>{const r=t.id===n[0].key||i.includes(t.id)&&i.includes(n[0].key);"range"!==t.type||r||e.clear([])}),n)}}}({brush:t,getConfig:()=>({layout:s,allowSimultaneous:c})});t.intercept("set-ranges",p),t.intercept("toggle-ranges",p),t.intercept("toggle-values",d),t.intercept("set-values",d),t.intercept("add-values",d),t.on("start",()=>e.begin(o));const f={activate:()=>{},deactivated:()=>t.end(),cleared:()=>t.clear(),canceled:()=>t.end()};var m,h;m=e,h=f,Object.keys(h).forEach(e=>{m.on(e,h[e])});const y=n?.max?.();return r?.select?(r.select.on("start",(...e)=>{t.start(),"function"==typeof r.select.getBrushOptions&&(u=r.select.getBrushOptions(...e))}),r.select.on("end",()=>{const n=i(t,u,s),o=sa({layout:s,filtered:l});n.forEach(t=>{const n=la({selection:t,fieldMap:o});!function(e,t,n){if(!t||void 0===n||"selectHyperCubeContinuousRange"!==e.method)return;const{params:r}=e;if(!r||!r[1]||!r[1][0])return;const{qDimIx:i,qRange:o}=r[1][0];"undefined"!==i&&o&&!1===o.qMaxInclEq&&o.qMax>=n&&(o.qMaxInclEq=!0)}(n,r.select.brushSelectionIncludeMax,y),e.select(n)})})):t.on("update",()=>{const n=i(t,u,s),r=sa({layout:s,filtered:l});n.forEach(t=>{e.select(la({selection:t,fieldMap:r}))})}),0===ca.length&&document.addEventListener("keyup",pa),ca.push({key:a,selections:e}),{layout:e=>{s=e},filteredFields:e=>{l=e},allowSimultaneous:e=>{c=e},release:()=>{s=null;const t=ca.indexOf(ca.filter(e=>e.key===a)[0]);-1!==t&&ca.splice(t,1),ca.length||document.removeEventListener("keyup",pa),((e,t)=>{Object.keys(t).forEach(n=>{e.removeListener(n,t[n])})})(e,f)}}}function fa({chart:e,document:t,selectionInfo:n,eventName:r,componentName:i,brushName:o="selection",emit:a="rangeClear"}){const s=n.event===r,l=t.querySelector(`[data-key='${i}-edge-0']`);if(s||!l)return!1;const c=e.component(i);return!!c&&(c.emit(a),"string"==typeof o&&e.brush(o).clear(),c)}const ma=({chart:e,document:t,selections:n,selectionInfo:r,...i})=>{i.clearDiscrete(),i.clearContinuous(),i.clearMinor(),i.clearRange(),i.clearTap(),i.clearLegend()};function ha({lasso:e}){e?.active?.()&&e?.action(!1)}function ya({chart:e,selectionInfo:t,selectionActions:n,actions:r={},selections:i,selectionEvents:o}){if(!1===n||!1===o)return()=>{};const{reset:a=ha,clear:s}=n,l=!1!==s&&function({clear:e=ma,selections:t,selectionInfo:n,chart:r}){return({cleared:i}={})=>{const o={selections:t,selectionInfo:n,chart:r,document:document,cleared:i};return e({clearDiscrete:(e={})=>function({selectionInfo:e,chart:t,document:n,eventName:r="discreteRange",componentName:i="discrete-range-brush",cleared:o=!1,brushName:a}){return fa({selectionInfo:e,chart:t,document:n,eventName:o?void 0:r,componentName:i,emit:"areaClear",brushName:a})}({...o,...e}),clearContinuous:(e={})=>function({selectionInfo:e,chart:t,document:n,eventName:r="continuousRange",componentName:i="continuous-range-brush",cleared:o=!1,brushName:a}){return fa({selectionInfo:e,chart:t,document:n,eventName:o?void 0:r,componentName:i,brushName:a})}({...o,...e}),clearMinor:(e={})=>function({selectionInfo:e,chart:t,document:n,componentName:r="minor-range-brush",eventName:i="minorRange",cleared:o=!1,brushName:a=!1}){const s=fa({selectionInfo:e,chart:t,document:n,eventName:o?void 0:i,componentName:r,brushName:a});if(!s)return;const{scale:l,brush:c}=s.settings.settings,u=t.scale(l).data().fields.map(e=>e.id()),p=t.brush(c),d=p.brushes().filter(e=>"range"===e.type&&u.some(t=>t===e.id));p&&d.length&&d.forEach(e=>{p.removeRanges(e.brush.ranges().map(t=>({key:e.id,range:t})))})}({...o,...e}),clearRange:(e={})=>function({selectionInfo:e,chart:t,document:n,selections:r,eventName:i="xAxis",cleared:o=!1}){fa({selectionInfo:e,chart:t,document:n,eventName:o?void 0:i,componentName:`${i}-range-brush`,emit:"areaClear",brushName:!1})&&r.clear()}({...o,...e}),clearTap:(e={})=>function({chart:e,selectionInfo:t,selections:n,events:r=["tap"],brushNames:i=[]}){if(!t||!r.includes(t.event))return;const{currentComponent:o,previousComponent:a}=t;a!==o&&(n.clear(),i.forEach(t=>e.brush(t).end()))}({...o,...e}),clearLegend:(e={})=>function({selectionInfo:e,chart:t,document:n,selections:r,eventName:i="legendRange",componentName:o="legend-range-brush",cleared:a=!1,brushName:s=!1}){fa({selectionInfo:e,chart:t,document:n,eventName:a?void 0:i,componentName:o,brushName:s})&&r.clear()}({...o,...e}),...o})}}({clear:s,selections:i,selectionInfo:t,chart:e}),c=function({chart:e,actions:t,reset:n,clear:r}){let i=!1;const o={deactivated(e){const{lasso:r=!1}=t||{};n({e:e,lasso:r})},canceled(i){const{lasso:o=!1}=t||{};n({e:i,lasso:o}),r({e:i,chart:e,document:document})},cleared(t){i||(i=!0,r({e:t,chart:e,document:document,cleared:!0}),i=!1)}};return!1===n&&delete o.deactivated,!1===r&&delete o.cleared,!1===n&&!1===r&&delete o.canceled,o}({chart:e,clear:l,reset:a,actions:r}),u={};Object.entries(c).forEach(([e,t])=>{u[e]=((e,t)=>t?n=>t({event:n,defaultFunc:e}):e)(t,o[e])});const p=function({selectionEvents:e,selections:t,selectionInfo:n,clear:r,chart:i,document:o}){const{start:a}=e,s={selections:t,selectionInfo:n,chart:i,document:o},l=e=>Object.assign(n,e||{}),c=({event:e,components:t})=>()=>(({selectionInfo:e={},setSelectionInfo:t,clear:n,event:r,components:i=[]})=>{t({...e,event:r,components:i.map(e=>e.key).filter(Boolean)}),n()})({event:e,components:t,clear:r,selectionInfo:n,setSelectionInfo:l});return"function"==typeof a?(e,t=[])=>{a({defaultFunc:c({event:e,components:t}),setSelectionInfo:l,clear:r,...s,event:e,components:t})}:(e,t=[])=>{c({event:e,components:t})()}}({selectionEvents:o,selections:i,selectionInfo:t,clear:l,chart:e,document:document});return r?.select?.on("start",p),Object.entries(u).forEach(([e,t])=>{i?.on(e,t)}),function(){r?.select?.removeListener("start",p),Object.entries(u).forEach(([e,t])=>{i?.removeListener(e,t)})}}const ga=[{key:"qHyperCube/qDimensionInfo/0:numeric",includeMax:!1}];function va({chart:e,actions:t,selections:n,picassoQ:r,config:i}){const{allowSimultaneous:o=!1,majorScale:a,selectionActions:{clear:s,reset:l}={},selectionEvents:c={deactivated:void 0,canceled:void 0,cleared:void 0,start:void 0},brushEvents:u={},brushName:p="selection",brushMaxListeners:d=20,brushRanges:f=!1,interceptors:m={},selectionsFn:h=r.selections}=i,y=e.brush(p);if("number"==typeof d&&y.setMaxListeners(d),f){const e=!0===f?ga:f;y.configure({ranges:e})}const g={canSelect:!0,getIsSelectionLocked:!1,isInnerDimensionLocked:!1,lockedDimensions:[],singleSelectIndex:0,selectionInfo:{colorField:void 0,components:[],event:void 0,currentComponent:void 0,previousComponent:void 0}},v=da({brush:y,majorScale:a,actions:t,selections:n,selectionsFn:h});!function({brush:e,interceptors:t={}}){Object.entries(t).forEach(([t,n])=>{(Array.isArray(n)?n:[n]).forEach(n=>{e.intercept(t,n)})})}({brush:y,interceptors:m});const b=function({chart:e,selectionActions:t,brush:n,actions:r,selectionInfo:i,selections:o,selectionEvents:a,brushEvents:s}){const l=function({brush:e,chart:t,selectionInfo:n,brushEvents:r={}}){const i=Object.entries(r).map(([r,i])=>{const o=()=>i({chart:t,selectionInfo:n});return e.on(r,o),[r,o]});return function(){i.forEach(([t,n])=>{e.removeListener(t,n)})}}({brush:n,chart:e,selectionInfo:i,brushEvents:s}),c=ya({chart:e,selectionInfo:i,selectionActions:t,actions:r,selections:o,selectionEvents:a}),u=function({actions:e}){if(!e?.lasso)return()=>{};let t=!1;const n=n=>{t||n.key!==ia||(e.lasso.action(!0),t=!0)},r=n=>{n.key===ia&&(e.lasso.action(!1),t=!1)};return document.addEventListener("keydown",n),document.addEventListener("keyup",r),function(){document.removeEventListener("keydown",n),document.removeEventListener("keyup",r)}}({actions:r});return function(){l(),c(),u()}}({chart:e,brush:y,actions:t,selections:n,selectionInfo:g.selectionInfo,selectionActions:{clear:s,reset:l},selectionEvents:c,brushEvents:u});if(o){const e=!0===o?[...Array(15)].map((e,t)=>`qHyperCube/qMeasureInfo/${t}`):o;v.allowSimultaneous(e)}return{unbindEvents:b,state:g,picassoSelections:v,brush:y}}function ba({chart:e,selections:t,actions:n=!1,config:r={}}){const{unbindEvents:i,state:o,picassoSelections:a,brush:s}=va({chart:e,actions:n,selections:t,picassoQ:ta,config:r}),{custom:l={},legendAlias:c,setBrushAliases:u=ra}=r;return{getIsDimensionLocked:(e=0)=>o.lockedDimensions[e],getIsSelectionLocked:(e=[])=>t?.isLocked?.()??function(e=[]){return!!e?.length&&e.filter(e=>"object"==typeof e.data&&Array.isArray(e.data.fields)).every(e=>e.data.fields.every(e=>{const t=e.raw();return!(!t.qLocked&&t.qCardinal)}))}(e),getIsSingleSelect:(e=o.singleSelectIndex)=>o.singleSelectDimensions[e],getCanSelect:()=>o.canSelect,getSelectionsObject:()=>t,getSelectionInfo:()=>o.selectionInfo,setLayout:e=>{const n=function({selections:e,picassoSelections:t,layout:n}){const r={lockedDimensions:[],singleSelectDimensions:[]};e?.isModal?.()&&e.confirm(),t.layout(n);const{qDimensionInfo:i=[]}=n?.qHyperCube??{};return r.lockedDimensions=i.map(e=>!!e.qLocked),r.singleSelectDimensions=i.map((e,t)=>na({layout:n,path:`qHyperCube/qDimensionInfo/${t}`})),r.singleSelectIndex=function(e){const{qDimensionInfo:t=[]}=e?.qHyperCube||{},n=t.map((e,t)=>!(e.qLocked||e.qCardinalities?.qHypercubeCardinal<=1)&&t).filter(e=>"number"==typeof e);return n[0]??Math.max(t.length-1,0)}(n),r.canSelect=0===i.length||i.some(e=>!e.qLocked),r.dimensionLocked=!!i[0]?.qLocked,r}({selections:t,picassoSelections:a,layout:e});Object.assign(o,n)},setFilteredFields:e=>{a.filteredFields(e)},setBrushAliases:({colorField:e,useLegendCube:t=!1,...n})=>{const r={useLegendCube:t,colorField:e,brush:s,legendAlias:c,...n};u({...r,defaultFunc:()=>ra(r)})},destroy:()=>{i(),a.release()},custom:{...l}}}const xa="'Source Sans Pro', 'Arial', 'sans-serif'",qa="#333333",Da="#595959",Sa="#737373",Ca="#cccccc",wa="#e6e6e6";function Ea(e){const t={};return[...e,["","","color"],["object","","fontFamily"],["object","axis.label.name","color",Da],["object","axis.label.name","fontFamily",xa],["object","axis.label.name","fontSize","12px"],["object","axis.line.major","color",Ca],["object","axis.line.minor","color",wa],["object","axis.title","color"],["object","axis.title","fontFamily",xa],["object","axis.title","fontSize","13px"],["object","grid.line.highContrast","color",wa],["object","grid.line.major","color",Ca],["object","grid.line.minor","color",wa],["object","label.value","color",Da],["object","label.value","fontFamily",xa],["object","label.value","fontSize","12px"],[!1,"label.value","darkColor",Da],[!1,"label.value","lightColor",wa],["object","outOfRange","color","#999"],["object","legend.title","color",qa],["object","legend.title","fontFamily",xa],["object","legend.title","fontSize","15px"],["object","legend.label","color",Da],["object","legend.label","fontFamily",xa],["object","legend.label","fontSize","13px"],["object","referenceLine.label.name","color",qa],["object","referenceLine.label.name","fontFamily",xa],["object","referenceLine.label.name","fontSize","12px"],["object","referenceLine.outOfBounds","color",wa],["object","referenceLine.outOfBounds","fontFamily",xa],["object","referenceLine.outOfBounds","fontSize","12px"],["object","referenceLine.outOfBounds","backgroundColor",Sa,e=>"transparent"===e?Sa:e]].reduce((e,n)=>{const r=`${n[0]}-${n[1]}-${n[2]}}`;return t[r]||(t[r]=!0,e.push(n)),e},[]).sort((e,t)=>(e[0].split?e[0].split(".").length:0)-(t[0].split?t[0].split(".").length:0))}const Ia="object",Aa=e=>e;function Ma({theme:e,id:t,transform:n,extend:r,matrix:i}){const o={},a=n.reduce((e,t)=>{const[n,r]=t;return e[n]=r,e},{});return i.forEach(n=>{const[r,i,s,l,c=e=>e]=n,u=function({theme:e,base:t,path:n,attribute:r,defaultValue:i}){if(!e||!1===t)return i;const o=e.getStyle(t,n,r);return void 0===o?i:o}({theme:e,base:r===Ia&&t?`${Ia}.${t}`:r,path:i,attribute:s,defaultValue:l}),p=(a[`${i}.${s}`]||Aa)(c(u));pi(o,[i,s].filter(Boolean).join("."),p)}),r.forEach(e=>{const[t,n]=e;pi(o,t,n)}),o}const La={NOOP:()=>{},FALSE:()=>!1,ARRAY:()=>[],OBJECT:()=>({})},ka="chart-modules-tooltip",Ta=`#${ka}`;function Na(){if(!document.querySelector(Ta)){const e=document.createElement("div");e.id=ka,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 Oa({key:e,rtl:t,duration:n}){return{show:!0,key:e,type:"tooltip",layout:{displayOrder:3},beforeMount(){Na()},beforeUpdate(){Na()},destroyed(){!function(){const e=document.querySelector(Ta);e?.parentElement&&e.childElementCount<1&&e.parentElement.removeChild(e)}()},settings:{appendTo:()=>document.querySelector(Ta),direction:t?"rtl":"ltr",duration:n},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 Pa="position",Fa={bar:"rect",diamond:"path",point:"circle",square:"rect",triangle:"path","n-polygon":"path",slice:"path"};const Ra=({data:e})=>e.value,ja=({data:e})=>e?.major?.value;function Ha({chart:e,expando:t,nodes:n,collectConfig:r,collectibles:i,meta:o}){const{from:a}=r,s={chart:e,expando:t,nodes:n,collectConfig:r,collectibles:i,meta:o};switch("function"==typeof a?"custom":a){case"single":return function({nodes:e}){const[t]=e;if("container"===t.type&&t.children[0]){const[e]=t.children;return e.key=t.key,[e]}return[t]}(s);case"position":return function({chart:e,collectibles:t,meta:n}){return e.shapesAt(n.position.absolute,{components:t.map(e=>({key:e.key}))})}(s);case"dimension":return function({chart:e,nodes:t,collectConfig:n,collectibles:r,meta:i}){const[o]=t,{filter:a,after:s}=n,l="function"==typeof a?a:()=>!0,c="function"==typeof s?s:()=>{},u=r.reduce((t,r)=>{const a=Fa[r.type]||r.type;return t.push(...e.findShapes(a).filter(e=>e.key===r.key&&e.data&&function({collectConfig:e,meta:t,collectible:n,nodes:r}){const{by:i=Ra}=e,{major:o=ja}=n,a=i({data:r.triggerer.data}),s=o({data:r.candidate.data,meta:t}),l=Array.isArray(a),c=Array.isArray(s);return l&&c?a.length===s.length&&a.every((e,t)=>e===s[t]):!l&&!c&&a===s}({collectConfig:n,meta:i,collectible:r,nodes:{triggerer:o,candidate:e}}))),t},[]).filter(l);return c({collected:u,triggerer:o}),u}(s);case"radius":return function({chart:e,nodes:t,collectConfig:n,collectibles:r,meta:i}){const[o]=t,{localBounds:a}=o,{distance:s,filter:l}=n,c="function"==typeof l?l:()=>!0,u=r.map(e=>e.key);return e.shapesAt({cx:i.position.absolute.x,cy:i.position.absolute.y,r:s||Math.max(a.width,a.height)},{components:u.map(e=>({key:e}))}).filter(c)}(s);case"custom":return function({chart:e,expando:t,nodes:n,collectConfig:r,meta:i}){return r.from({chart:e,expando:t,nodes:n,meta:i})}(s);default:return[]}}const{MAX_VALUE:za}=Number;function Va({nodes:e}){const{xMin:t,xMax:n,yMin:r,yMax:i}=e.filter(e=>e.bounds.height+e.bounds.width!==0).reduce((e,t)=>{const{bounds:n}=t;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:za,xMax:-za,yMin:za,yMax:-za});return{x:t,y:r,width:n-t,height:i-r}}function _a({chart:e,config:t,expando:n,internal:r,nodes:i}){if(!i.length)return[];const[o]=i,{key:a}=o,s=t.main.collectibles.filter(e=>!e.if||e.if());if(!s.length)return[];const{triggers:l}=t.main,{collect:c,placement:u}=l.find(e=>-1!==e.keys.indexOf(a))||{};if(!c||!c.from||!u)return[];const p={triggerer:a,position:r.get(Pa)},d=(Ha({chart:e,expando:n,nodes:i,collectConfig:c,collectibles:s,meta:p})||[]).map(e=>e.children.length?e.children[0]:e);return d.length?function({chart:e,config:t,expando:n,placementConfig:r,hovered:i,collected:o,meta:a}){const{bounds:s,key:l}=function({chart:e,config:t,expando:n,placementConfig:r,hovered:i,collected:o,meta:a}){const[s]=i,l=Array.isArray(r)?r:[r],c={bounds:s.bounds,key:s.key},u=Va({nodes:o});for(let r=0;r<l.length;r++){const s=l[r];if("function"==typeof s){const t=s({chart:e,expando:n,hovered:i,collected:[...o],meta:a,collectedBounds:u,combineBounds:Va});if(t)return t}if("trigger"===s)return c;if("collectible"===s){const{collectible:e}=t.main.placements;return{bounds:"function"==typeof e?e({collected:[...o]}):u,key:o[0].key}}}return c}({chart:e,config:t,expando:n,placementConfig:r,hovered:i,collected:o,meta:a}),[{desc:c}]=o;return[{bounds:s,nodes:o,data:o.map(e=>e.data),key:l,meta:a,desc:c}]}({chart:e,config:t,expando:n,placementConfig:u,hovered:i,collected:d,meta:p}):[]}const $a=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),Ba=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞יִײַ-ﬨשׁ-ﭏ]"),Ua=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]"),Wa=e=>$a.test(e),Ka=e=>Ba.test(e)||Ua.test(e);function Ya(e){const t=e?e.length:0;for(let n=0;n<t;n++){const t=e[n];if(Wa(t))return"ltr";if(Ka(t))return"rtl"}return"ltr"}function Ga({config:e,h:t,context:n}){const r={section:({content:e})=>function({content:e}){return{type:"section",content:e}}({content:e}),text:({value:t,style:n,survive:r,visibility:i})=>function({config:e,value:t,style:{bold:n=!1,italic:r=!1}={},survive:i,visibility:o}){const{rtl:a}=e;return{type:"text",content:[{content:t,style:{"font-weight":n?"bold":"normal","font-style":r?"italic":"normal","text-align":a?"right":"left",direction:Ya(t),"white-space":"pre-wrap"},colspan:2}],survive:{visibility:!1,...i},visibility:{count:!0,force:!1,...o}}}({config:e,value:t,style:n,survive:r,visibility:i}),measure:({label:n,value:r,color:i,style:o,survive:a,visibility:s})=>function({config:e,h:t,label:n,value:r,color:i,style:o,survive:a,visibility:s}){const{rtl:l}=e,c=t("div",{style:{display:"inline-block",width:10,height:10,"background-color":i,margin:"0 8px"}});return{type:"measure",label:n,value:r,content:[{content:l?[":",n]:[n,":"],style:{"text-align":l?"right":"left","font-weight":o?.label?.bold?"bold":"normal","font-style":o?.label?.italic?"italic":"normal",direction:Ya(n)}},{content:i?l?[r,c]:[c,r]:r,style:{"text-align":l?"left":"right","vertical-align":"middle","font-weight":o?.value?.bold?"bold":"normal","font-style":o?.value?.italic?"italic":"normal",direction:Ya(r)}}],survive:{color:!1,duplicate:!1,visibility:!1,...a},visibility:{count:!0,force:!1,...s}}}({config:e,h:t,label:n,value:r,color:i,style:o,survive:a,visibility:s}),divider:({visibility:e}={})=>function({visibility:e}){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:{count:!1,force:!1,...e}}}({visibility:e}),row:({content:e,style:t,colspan:n,survive:r,visibility:i})=>function({content:e,style:t,colspan:n,survive:r,visibility:i}){return{type:"row",content:[{content:e,style:t,colspan:n}],survive:{visibility:!1,...r},visibility:{count:!0,...i}}}({content:e,style:t,colspan:n,survive:r,visibility:i}),raw:({value:e,survive:t,visibility:n})=>function({value:e,survive:t,visibility:n}){return{type:"raw",content:e,survive:{visibility:!1,...t},visibility:{count:!0,...n}}}({value:e,survive:t,visibility:n}),color:({nodes:r,property:i,filter:o=!0,visibility:a,fillColor:s})=>function({config:e,h:t,context:n,nodes:r,property:i,filter:o,visibility:a,fillColor:s}){const{rtl:l}=e,c={type:"color",label:void 0,value:void 0,content:[],filter:o,survive:{visibility:!1},visibility:{count:!0,...a}},u=e.getColorSettings();if("color"===u.type||!u.fieldType)return c;const[p]=r;if(c.value=function({config:e,context:t,property:n,node:r}){const i=r.data[n];if(!i)return;if(-3===r.data.value)return r.data.label;const o=t.resources.dataset(i.source.key).field(i.source.field).formatter(),{value:a,label:s}=i,l=e.getColorSettings();if(o&&"measure"===l.fieldType)return Number.isNaN(+a)?"-":o(i.value);const c=s||a;return void 0===c||Number.isNaN(c)||"NaN"===c?"-":c}({config:e,context:n,property:i,node:p}),void 0===c.value)return c;c.label=function({config:e,context:t,property:n,node:r}){const i=e.getColorSettings();if(i.label)return i.label;const o=r.data[n];if(!o||"color"===i.type)return;const{dataset:a}=t.resources,{key:s,field:l}=o.source;return a(s).field(l).title()}({config:e,context:n,property:i,node:p});const d=s??function({node:e}){const{attrs:t}=e;return t?.fill||"#ddd"}({node:p}),f=t("div",{style:{display:"inline-block",width:10,height:10,"background-color":d,margin:"0 8px"}});return c.content.push({content:l?[":",c.label]:[c.label,":"],style:{"text-align":l?"right":"left",direction:Ya(c.label)}},{content:l?[c.value,f]:[f,c.value],style:{"text-align":l?"left":"right","vertical-align":"middle",direction:Ya(c.value)}}),c}({config:e,h:t,context:n,nodes:r,property:i,filter:o,visibility:a,fillColor:s})};return r}function Ja({chart:e,translator:t,config:n,expando:r,h:i,data:o,style:a}){const[s]=o,{nodes:l}=s.node,c=function({config:e,nodes:t}){const n=t.reduce((t,n)=>{const r=e.main.getGroupByValue({data:n.data});return t[r]||(t[r]={sorting:Object.keys(t).length,items:[]}),t[r].items.push(n),t},{});return Object.keys(n).map(e=>n[e]).sort((e,t)=>e.sorting-t.sorting).map(e=>e.items)}({config:n,nodes:l}),u=function({chart:e,config:t,expando:n,h:r,context:i,groups:o}){const{meta:a}=i.node,{dataset:s,formatter:l}=i.resources,c=Ga({config:t,h:r,context:i}),u=function({dataset:e}){return{dataset:{title:(t,n)=>e(t).field(n).title()}}}({dataset:s}),p=o.map(e=>{const i=c.section({content:[...(t.main.section({expando:n,h:r,nodes:e,dataset:s,formatter:l,meta:a,create:c,util:u})||[]).filter(e=>e.content?.length)].filter(Boolean)});return i.content=function({config:e,content:t}){const n=t.find(e=>"color"===e.type&&e.filter),r=n?t.filter(e=>"measure"!==e.type||e.survive.color||e.label!==n.label||e.value!==n.value):t;return e.main.showDuplicateMeasures?r:r.reduce((e,t)=>{const{type:n,survive:r}=t;if("measure"!==n||r.duplicate)return e.filtered.push(t),e;const i=`${t.label}-${t.value}`;return e.memory[i]||(e.memory[i]=!0,e.filtered.push(t)),e},{memory:{},filtered:[]}).filtered}({config:t,content:i.content}),i});return t.main.sections({chart:e,expando:n,h:r,nodes:i.node.nodes,dataset:s,formatter:l,meta:a,create:c,util:u,sections:p}),p.filter(Boolean)}({chart:e,config:n,expando:r,h:i,context:s,groups:c}),p=function({translator:e,config:t,context:n,templates:r}){const{rows:i,grouping:o,single:a}=t.main.layout,s=function({limit:e,grouping:t,single:n}){const r={count:0,overflow:0,index:{started:void 0,group:void 0},single:{found:!1,index:0}};return{process:({survive:i,visibility:o,index:a})=>{if(o.force)return!0;if(r.single.found||(r.single.found=!0,r.single.index=a),n&&a!==r.single.index)return t?(r.index.started!==a&&r.index.group!==a&&(r.overflow++,r.index.group=a),!1):(r.overflow++,!1);if(r.count>=e&&!i?.visibility){if(!t)return r.overflow++,!1;if(r.index.started!==a)return r.index.group!==a&&(r.overflow++,r.index.group=a),!1}return o.count&&r.count++,t&&(r.index.started=a),!0},overflow:()=>r.overflow}}({limit:i,grouping:o,single:"function"==typeof a?a({meta:n.node.meta,sections:r}):a}),l=r.reduce((e,t,n)=>{const{type:i,content:o=[]}=t;"section"===i&&o.forEach(t=>{s.process({survive:t.survive,visibility:t.visibility,index:n})&&e.push(t.content)});const a=n===r.length-1;return"divider"!==i||a||s.process({survive:t.survive,visibility:t.visibility,index:n})&&e.push(t.content),e},[]).filter(e=>e.length),c=s.overflow();return c&&l.push(function({translator:e,config:t,count:n}){const r=e?e.get("Object.ChartTooltip.NMore",n):`+${n} more`,i=Ya(r);return[{content:r,style:{"font-weight":"bold","text-align":t.rtl?"right":"left",direction:i},colspan:2}]}({translator:e,config:t,count:c})),l}({translator:t,config:n,context:s,templates:u});return p.length?function({h:e,style:t,rows:n}){return n.map(n=>e("tr",{},n.map(n=>{const r={style:{...t.cell||{},...n.style||{}},class:n.class};return n.colspan&&(r.colspan=n.colspan),e("td",r,n.content)})))}({h:i,style:a,rows:p}):function({h:e}){return e("tr",{},e("td",{style:{fontStyle:"italic",opacity:.75}},"Empty"))}({h:i})}const Za="collected";function Xa({chart:e,translator:t,config:n,expando:r,internal:i}){const{key:o}=n.main;if(!o)return!1;const a=di(),s=Oa({key:n.main.key,rtl:n.rtl,duration:n.duration}),{afterShow:l,afterHide:c}=n.main.events.tooltip,u=()=>{const e=a.get(Za);return{expando:r,nodes:e.nodes,meta:e.meta}};return Sn(!0,s,{settings:{filter:t=>_a({chart:e,config:n,expando:r,internal:i,nodes:t}),extract:e=>(a.set(Za,e.node),e),content:({h:i,data:o,style:a})=>Ja({chart:e,translator:t,config:n,expando:r,h:i,data:o,style:a}),placement:({nodes:e})=>n.main.placement({meta:e[0].meta}),afterShow:()=>l(u()),afterHide:()=>c(u())},style:{arrow:{color:n.style.background},content:n.style}})}function Qa({config:e}){const{keys:t}=e.legend;if(!t.tooltip||!t.component)return!1;const{type:n}=e.getColorSettings();if("categorical"!==n)return!1;const r=Oa({key:t.tooltip,rtl:e.rtl,duration:e.duration});return Sn(!0,r,{settings:{filter:e=>e.filter(e=>e.data&&e.key===t.component),extract:e=>e,content:({h:e,data:t,style:n})=>[e("tr",{},[e("td",{style:{...n.cell||{},"font-weight":"bold","text-align":"left"},colspan:2},t[0].node.data.label)])],placement:"pointer"},style:{arrow:{color:e.style.background},content:e.style}})}function es({config:e}){const t=e.main.triggers.reduce((e,t)=>(t.keys.forEach(n=>{const 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({components:e}){return e.filter(e=>t.key[e.key]).reduce((e,n)=>{e.any=!0,e.components.push(n.key);const 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:{}})}}const ts=()=>!0;function ns({config:e}){const t=e.main.triggers.reduce((e,t)=>{const{filter:n}=t;return t.keys.forEach(t=>{e[t]="function"==typeof n?n:ts}),e},{});return e=>{const n=t[e.key];return!n||n(e)}}function rs({chart:e,event:t,component:n}){const r={absolute:{x:0,y:0},relative:{x:0,y:0}},{left:i,top:o}=e.element.getBoundingClientRect();r.absolute.x=(void 0===t.clientX?Math.floor(t.srcEvent.clientX):t.clientX)-i,r.absolute.y=(void 0===t.clientY?Math.floor(t.srcEvent.clientY):t.clientY)-o;const a=e.component(n);if(a){const{computedInner:e}=a.rect;r.relative.x=r.absolute.x-e.x,r.relative.y=r.absolute.y-e.y}return r}function is({chart:e,filter:t,hits:n,position:r}){const i=[];if(n.position.length&&i.push(...e.shapesAt(r.absolute,{components:n.position.map(e=>({key:e}))}).filter(t)),!i.length&&n.distances.length){const o=[];n.distances.forEach(i=>{o.push(...e.shapesAt({cx:r.absolute.x,cy:r.absolute.y,r:i},{components:n.distanceKeys[i].map(e=>({key:e}))}).filter(t))}),o.length&&i.push(function({nodes:e,origin:t}){const n=e.find(e=>"path"===e.type);if(n)return n;const r=e=>{const n=Math.abs(t.x-(e.localBounds.x+e.localBounds.width/2)),r=Math.abs(t.y-(e.localBounds.y+e.localBounds.height/2));return Math.sqrt(n*n+r*r)};return e.slice(1).reduce((e,t)=>{const n=r(t);return n<e.distance&&(e.distance=n,e.node=t),e},{node:e[0],distance:r(e[0])}).node}({nodes:o,origin:r.relative}))}return i}const os="tooltipTap";function as({chart:e,config:t,expando:n,internal:r,facade:i}){const{tap:o}=t.delay,a=es({config:t}),s=ns({config:t}),l=t.main.triggers.reduce((e,t)=>(e.push(...t.keys),e),[]);return{key:`event:${os}`,type:"Tap",options:{event:os,enable:(n,r)=>!r||!!t.enable({event:r})&&e.componentsFromPoint({x:r.center.x,y:r.center.y}).filter(e=>-1!==l.indexOf(e.key)).length>0},recognizeWith:"tap",events:{[os](l){if(l.preventDefault(),"mouse"===l.pointerType||t.main.suppress({event:l}))return;const c=e.component(t.main.key);if(!c||!c.show)return;const u=e.componentsFromPoint({x:l.center.x,y:l.center.y}),p=a({components:u});if(!p.any)return void c.emit("hide");const[d]=p.components,f=rs({chart:e,event:l,component:d});r.set(Pa,f);const m=is({chart:e,filter:s,hits:p,position:f});if(!m.length)return void c.emit("hide");const{key:h}=m[0];t.main.events.tooltip.beforeShow({expando:n,event:l,collectNodes:()=>i.collectNodes({nodes:m}),meta:{triggerer:h,position:f}}).then(()=>{c.emit("show",l,{nodes:m,delay:o})}).catch(()=>{})}}}}function ss({chart:e,config:t,expando:n,internal:r,facade:i}){const o=es({config:t}),a=ns({config:t}),s=function({config:e,expando:t,internal:n,facade:r}){const{beforeShow:i}=e.main.events.tooltip,{hover:o}=e.delay,a={ongoing:{},latest:void 0};return function({event:e,tooltip:s,nodes:l}){const c=function({nodes:e}){return JSON.stringify(e.map(e=>({key:e.key,bounds:e.bounds,value:e.data?.value})))}({nodes:l});if(!a.ongoing[c]){a.ongoing[c]=!0,a.latest=c;const{key:u}=l[0];i({expando:t,event:e,collectNodes:()=>r.collectNodes({nodes:l}),meta:{triggerer:u,position:n.get(Pa)}}).then(()=>{c===a.latest&&s.emit("show",e,{nodes:l,delay:o})}).catch(()=>{s.emit("show")}).finally(()=>{delete a.ongoing[c],c===a.latest&&(a.latest=void 0)})}}}({config:t,expando:n,internal:r,facade:i}),l=[t.main.key,t.legend.keys.tooltip].filter(Boolean),c=()=>{l.forEach(t=>{const n=e.component(t);n?.show&&n.emit("hide")})};return{type:"native",events:{mousemove(n){if(!t.enable({event:n})||t.main.suppress({event:n}))return;const i=e.componentsFromPoint({x:n.clientX,y:n.clientY}),l=e.component(t.main.key);if(l&&l.show){const t=o({components:i});if(t.any){const[i]=t.components,o=rs({chart:e,event:n,component:i});r.set(Pa,o);const c=is({chart:e,filter:a,hits:t,position:o});if(!c.length)return void l.emit("hide");s({event:n,tooltip:l,nodes:c})}else l.emit("hide")}const{legend:c}=t;if(c.keys.tooltip&&c.keys.component){const t=e.component(c.keys.tooltip);t&&t.show&&(i.some(e=>e.key===c.keys.component)?t.emit("show",n):t.emit("hide"))}},mouseup(e){2===e.button&&c()},mouseleave(){t.main.events.interaction.mouseleave({expando:n}),c()},wheel(){c()}}}}function ls({chart:e,translator:t,config:n}){const r=function({config:e={}}){return Sn(!0,{},{rtl:!1,enable:La.FALSE,getColorSettings:La.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:La.FALSE,getGroupByValue:La.NOOP,collectibles:[],triggers:[],placement:()=>({type:"bounds"}),placements:{collectible:"combine"},showDuplicateMeasures:!1,layout:{rows:7,grouping:!1,single:!1},section:La.ARRAY,sections:La.NOOP,events:{tooltip:{beforeShow:()=>Promise.resolve(),afterShow:La.NOOP,afterHide:La.NOOP},interaction:{mouseleave:La.NOOP}}},legend:{keys:{tooltip:void 0,component:void 0}}},e)}({config:n}),i=di(),o=di(),a={components:void 0,interactions:void 0};return{getComponents:()=>(a.components||(a.components=function({chart:e,translator:t,config:n,expando:r,internal:i}){return[Xa({chart:e,translator:t,config:n,expando:r,internal:i}),Qa({config:n})].filter(Boolean)}({chart:e,translator:t,config:r,expando:i,internal:o})),a.components),getInteractions:()=>(a.interactions||(a.interactions=function({chart:e,config:t,expando:n,internal:r}){const i=function({chart:e,config:t,expando:n,internal:r}){return{collectNodes:({nodes:i})=>{const[{nodes:o}={nodes:[]}]=_a({chart:e,config:t,expando:n,internal:r,nodes:i});return o}}}({chart:e,config:t,expando:n,internal:r});return{gestures:[as({chart:e,config:t,expando:n,internal:r,facade:i})],native:ss({chart:e,config:t,expando:n,internal:r,facade:i})}}({chart:e,config:r,expando:i,internal:o})),a.interactions),expando:i}}function cs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var us,ps;var ds=function(){if(ps)return us;ps=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},us=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},us}(),fs=cs(ds);function ms(){const e={};var t;return t=e,Object.keys(fs.prototype).forEach(e=>{t[e]=fs.prototype[e]}),fs.init(t),e.lasso={active:()=>!1},e.select={on:e.on,removeListener:e.removeListener},e}var hs,ys;var gs=function(){if(ys)return hs;ys=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 hs=function e(){var t,n,r,l,c,u,p=arguments[0],d=1,f=arguments.length,m=!1;for("boolean"==typeof p&&(m=p,p=arguments[1]||{},d=2),(null==p||"object"!=typeof p&&"function"!=typeof p)&&(p={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=s(p,n),p!==(l=s(t,n))&&(m&&l&&(o(l)||(c=i(l)))?(c?(c=!1,u=r&&i(r)?r:[]):u=r&&o(r)?r:{},a(p,{name:n,newValue:e(m,u,l)})):void 0!==l&&a(p,{name:n,newValue:l}));return p},hs}(),vs=cs(gs);const bs=[["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}]],xs={};bs.forEach(([e,{width:t,height:n}])=>{xs[e]={width:t,height:n}});const qs={getLayoutModes:()=>xs,getLayoutMode(e,t){let n;for(n=0;n<bs.length;++n)if(e>=bs[n][1].width&&t>=bs[n][1].height)return bs[n][0];return"SPARK"}};function Ds(e,t){return{layoutModes:qs.getLayoutModes(),center:void 0!==t.minCenterRatio?{minWidthRatio:t.minCenterRatio,minHeightRatio:t.minCenterRatio}:void 0,logicalSize:t.logicalSize?{align:.5,preserveAspectRatio:!0,...t.logicalSize}:void 0}}const Ss=/^[A-Z][A-z0-9_]*$/i,Cs={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,"")}},ws={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||Ss.test(e)?e:`[${e.replace(/\]/g,"]]")}]`,t},deleteUndefinedProperties:e=>{Object.keys(e).forEach(t=>{void 0===e[t]&&delete e[t]})},generateId:()=>Cs.id(),shouldUseFormat:e=>!e.isCustomFormatted&&(e.qIsAutoFormat||"U"===e.qNumFormat.qType)};function Es(e,t){const n=e.component(t);return n&&n._DO_NOT_USE_getInfo&&n._DO_NOT_USE_getInfo().offset}const Is=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),As=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞יִײַ-ﬨשׁ-ﭏ]"),Ms=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]"),Ls={lrm:String.fromCharCode(8206),rlm:String.fromCharCode(8207),isLtrChar:e=>Is.test(e),isRtlChar:e=>As.test(e)||Ms.test(e),detectTextDirection(e){const t=e?e.length:0;let n,r;for(n=0;n<t;n++){if(r=e[n],Ls.isLtrChar(r))return"ltr";if(Ls.isRtlChar(r))return"rtl"}return"ltr"}},ks={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?ks.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=Ls.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=Ls.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:Ls.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=Ls.detectTextDirection(t.color.label),i=n?[":",t.color.label]:[t.color.label,":"],o=Ls.detectTextDirection(t.color.value);return[{content:i,style:{"text-align":n?"right":"left",direction:r}},{content:n?[t.color.value,ks.getColorSymbol(e,t)]:[ks.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=Ls.detectTextDirection(e.label),a=r?[":",e.label]:[e.label,":"],s=Ls.detectTextDirection(e.value);let l;return l=i?r?[e.value,ks.getColorSymbol(t,n)]:[ks.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 Ts(e){const t=parseInt(e,10);if(!isNaN(t))return t}const Ns=e=>t=>e.getContrastingColorTo(t.node.attrs.fill);function Os(e,t){const n=e.styleService.label.value.getStyle();return{padding:10,placements:e.simplifiedPlacements.map(n=>function(e,t,n){const r=n.themeService.getStyles(),i=n.styleService.label.value.getStyle(),o=i.fill===r.label.value.color;return{position:e.position,justify:e.justify,fill:o&&!e.onBackground?Ns(t):i.fill,overflow:e.overflow,padding:e.padding}}(n,t,e)),fontSize:Ts(n.fontSize),fontFamily:n.fontFamily,label:e.label}}function Ps(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}var Fs,Rs;1===(Fs=Ps).length&&(Rs=Fs,Fs=function(e,t){return Ps(Rs(e),t)});var js="$";function Hs(){}function zs(e,t){var n=new Hs;if(e instanceof Hs)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 Vs(){}Hs.prototype=zs.prototype={constructor:Hs,has:function(e){return js+e in this},get:function(e){return this[js+e]},set:function(e,t){return this[js+e]=t,this},remove:function(e){var t=js+e;return t in this&&delete this[t]},clear:function(){for(var e in this)e[0]===js&&delete this[e]},keys:function(){var e=[];for(var t in this)t[0]===js&&e.push(t.slice(1));return e},values:function(){var e=[];for(var t in this)t[0]===js&&e.push(this[t]);return e},entries:function(){var e=[];for(var t in this)t[0]===js&&e.push({key:t.slice(1),value:this[t]});return e},size:function(){var e=0;for(var t in this)t[0]===js&&++e;return e},empty:function(){for(var e in this)if(e[0]===js)return!1;return!0},each:function(e){for(var t in this)t[0]===js&&e(this[t],t.slice(1),this)}};var _s=zs.prototype;Vs.prototype={constructor:Vs,has:_s.has,add:function(e){return this[js+(e+="")]=e,this},remove:_s.remove,clear:_s.clear,values:_s.keys,size:_s.size,empty:_s.empty,each:_s.each},vs.bind(null,!0);const $s=[[2,4,6],[2,4],[3]],Bs=[,[,,[[1,2]],[[1,2,3],[1,3]],[[1,2,4],[1,4]],[[1,2,4],[1,5]],[[1,2,4,6],[2,4,6],[1,3,6],[1,6]],[[1,2,4,6],[2,4,6],[1,3,6],[1,7]],[[1,2,4,8],[2,4,8],[1,8]],[[1,2,4,8],[2,4,8],[1,3,9],[1,9]],[[1,2,4,6,10],[1,2,4,10],[1,3,10],[3,10],[1,10]]],[,,,[[2,3]],[[2,3,4],[2,4]],[[2,3,4],[2,4],[2,5]],[[2,4,6],[2,6]],[[2,4,6],[2,6],[2,7]],[[2,4,8],[2,8]],[[2,4,8],[2,8],[2,9]],[[2,4,6,10],[2,4,10],[5,10],[3,10]]],[,,,,[[3,4]],[[3,4,5],[3,5]],[[3,4,5,6],[3,6]],[[3,4,5,6],[3,5,7],[3,7]],[[3,4,5,6,8],[3,5,7],[4,8],[3,8]],[[3,4,5,6,8],[3,4,6,9],[3,4,6,8],[3,6,9],[4,8],[3,9]],[[4,6,10],[5,10],[3,10]]],[,,,,,[[4,5]],[[4,5,6],[4,6]],[[4,5,6,7],[4,5,6],[4,6]],[[4,5,6,7,8],[4,5,6,7],[4,6,8],[4,8]],[[4,5,6,7,8],[4,6,9],[4,6,8],[4,8]],[[4,6,10],[5,7,9],[5,10],[4,10]]],[,,,,,,[[5,6]],[[5,6,7],[5,7]],[[5,6,7,8],[5,6,7],[6,8]],[[5,6,7,8,9],[5,6,7,8],[5,7,9],[5,9]],[[6,8,10],[5,10]]],[,,,,,,,[[6,7]],[[6,7,8],[6,8]],[[6,7,8,9],[6,7,8],[6,9]],[[6,7,8,9,10],[6,8,10],[6,10]]],[,,,,,,,,[[7,8]],[[7,8,9],[7,9]],[[7,8,9,10],[8,10],[7,10],[7,9]]],[,,,,,,,,,[[8,9]],[[8,9,10],[8,10]]],[,,,,,,,,,,[[9,10]]]];function Us(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 Ws(e,t,n){let r;const i=e?e.length:0;for(r=0;r<i;r++)Us(e[r],t,n)}!function(){let e,t;for(Ws($s,1,10),e=0;e<Bs.length;e++)if(Bs[e])for(t=0;t<Bs[e].length;t++)Array.isArray(Bs[e][t])&&Ws(Bs[e][t])}();var Ks={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 Ys(e){const{qHyperCube:t,...n}=e,{qAxisData:r,qDataPages:i,qStackedDataPages:o,qTreeDataPages:a,...s}=t,l=vs(!0,{},{...n,qHyperCube:{...s}}),{dataRelatedPropertiesPaths:c}=Ks;function u(e,t){const n=t.indexOf("[]");if(-1===n)return void(void 0!==ci(e,t)&&pi(e,t,void 0));const r=t.substring(0,n),i=t.substring(n+2),o=i.startsWith(".")?i.substring(1):i;ci(e,r,[]).forEach(e=>{o&&u(e,o)})}return c.forEach(e=>{u(l,e)}),l}var Gs={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,p=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+p)})}}},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=Ys(t);e.set("dataIndependentProperties",JSON.stringify(n))},propertiesHaveChanged:function({viewCache:e,layout:t}){const n=Ys(t);return e.get("dataIndependentProperties")!==JSON.stringify(n)},nonUpdatingNode:{trackBy:function(){return Math.random()}}};function Js(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?void 0:"svg"}var Zs=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}},Xs=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 Zs.newInstanceIfNeeded(e,this._value);const n=this.getNextNode(e.charAt(t));if(!n)return Zs.newInstanceIfNeeded(e,t,this._value);const r=n.getLongestMatch(e,t+1);return r||Zs.newInstanceIfNeeded(e,t,this._value)}},Qs=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 Xs);const n=this.root.put(e,0,t);return n||(e.length>this.maxKeyLen&&(this.maxKeyLen=e.length),this.size++,null)}};(()=>{const e=[],t=[],n=new Qs;let r,i,o;for(r in e["""]="34",e["&"]="38",e["<"]="60",e[">"]="62",e[" "]="160",e["¡"]="161",e["¢"]="162",e["£"]="163",e["¤"]="164",e["¥"]="165",e["¦"]="166",e["§"]="167",e["¨"]="168",e["©"]="169",e["ª"]="170",e["«"]="171",e["¬"]="172",e["­"]="173",e["®"]="174",e["¯"]="175",e["°"]="176",e["±"]="177",e["²"]="178",e["³"]="179",e["´"]="180",e["µ"]="181",e["¶"]="182",e["·"]="183",e["¸"]="184",e["¹"]="185",e["º"]="186",e["»"]="187",e["¼"]="188",e["½"]="189",e["¾"]="190",e["¿"]="191",e["À"]="192",e["Á"]="193",e["Â"]="194",e["Ã"]="195",e["Ä"]="196",e["Å"]="197",e["Æ"]="198",e["Ç"]="199",e["È"]="200",e["É"]="201",e["Ê"]="202",e["Ë"]="203",e["Ì"]="204",e["Í"]="205",e["Î"]="206",e["Ï"]="207",e["Ð"]="208",e["Ñ"]="209",e["Ò"]="210",e["Ó"]="211",e["Ô"]="212",e["Õ"]="213",e["Ö"]="214",e["×"]="215",e["Ø"]="216",e["Ù"]="217",e["Ú"]="218",e["Û"]="219",e["Ü"]="220",e["Ý"]="221",e["Þ"]="222",e["ß"]="223",e["à"]="224",e["á"]="225",e["â"]="226",e["ã"]="227",e["ä"]="228",e["å"]="229",e["æ"]="230",e["ç"]="231",e["è"]="232",e["é"]="233",e["ê"]="234",e["ë"]="235",e["ì"]="236",e["í"]="237",e["î"]="238",e["ï"]="239",e["ð"]="240",e["ñ"]="241",e["ò"]="242",e["ó"]="243",e["ô"]="244",e["õ"]="245",e["ö"]="246",e["÷"]="247",e["ø"]="248",e["ù"]="249",e["ú"]="250",e["û"]="251",e["ü"]="252",e["ý"]="253",e["þ"]="254",e["ÿ"]="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["¬in"]="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)))})(),"undefined"!=typeof document&&document.createElement("div");for(let e=0;e<255;e++)e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||e.toString(16);const el={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 tl(e){const t=e.split("/");return"qmem:"===t[0]&&""===t[1]}const nl={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 rl(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 nl.getImageSize(r,t);return{src:r,size:t,height:o,width:a,imageError:s}}async function il(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 p=r.data?.customTooltipAttrExps?.value||[];let d;if(-1!==u&&p[u]&&(d=p[u]),"media"===c&&s.ref?.qStaticContentUrl?.qUrl)return rl(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&&tl(a))try{const t=`data:image/png;base64, ${await e.getImage(a)}`,{height:n,width:i,imageError:s}=await nl.getImageSize(t,r);o={src:t,size:r,height:n,width:i,imageError:s}}catch{}else{const{height:e,width:t,imageError:n}=await nl.getImageSize(a,r);o={src:a,size:r,height:e,width:t,imageError:n}}return o}(i,o,s,l,d);if(o.isEnabled("IMAGE_BUNDLE_LOAD")&&"field"===c&&d&&d.label){return async function(e,t,n,r){let i;const o=r.label,a=`qmem://${t.qFallbackTitle}/${o}`;if(tl(a))try{const t=await e.getImage(a);if(t){const e=`data:image/png;base64, ${t}`,{height:r,width:o,imageError:a}=await nl.getImageSize(e,n);i={src:e,size:n,height:r,width:o,imageError:a}}}catch{}return i}(i,n[u],l,d)}return[]}const ol={async addImagesToTheNodes({customTooltipModel:e,nodes:t,attrExps:n,opts:r}){const i=t,o=[];for(let t=0;t<i.length;t++)o.push(il(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}},al={async handlePromises({customTooltipModel:e,nodes:t,attrExps:n,opts:r}){let i=t;return i=await ol.addImagesToTheNodes({customTooltipModel:e,nodes:t,attrExps:n,opts:r}),i},checkIfPromisesExist:({customTooltipModel:e})=>ol.checkIfPromisesExist({customTooltipModel:e})};const sl=(e,t)=>{const n=e?.qHyperCubeDef?.qDimensions,r=e?.qHyperCubeDef?.qMeasures,i=e?.qHyperCubeDef?.qInterColumnSortOrder,o=t;return{qInfo:{qType:el.CHART.CHART_PARENT_TYPE,qId:el.CHART.CHART_OBJECT_ID},qHyperCubeDef:{qDimensions:n,qMeasures:r,qInterColumnSortOrder:i,qInitialDataFetch:[{qWidth:0,qHeight:0}]},qStateName:o}},ll=e=>{const t=e.tooltip?.chart?.object?.refId;return{qInfo:{qType:el.CHART.CHART_CHILD_TYPE},qExtendsId:t}};const cl={createContainer:({ctx:e,layout:t})=>{if(!(t.qHyperCube?.qDimensionInfo?.length<=0))return function(e,t){const n=t.tooltip?.chart?.style?.size??"medium",r=el.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:el.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 cl.hide({app:e,customTooltipModel:i});try{await async function({app:e,properties:t,customTooltipModel:n}){const r=n,i=el.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=el.CHART.STATE,o=sl(t,i),a=await e.createSessionObject(o),s=ll(t);if(a.id!==el.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(el.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 cl.hide({app:e,customTooltipModel:i})}}},hide:async({app:e,customTooltipModel:t})=>{const n=t;n?.embed&&(cl.destroyVisualization({customTooltipModel:t}),await e.destroySessionObject(el.CHART.CHART_OBJECT_ID),n.miniChartToken.sessionObj=void 0,await async function({app:e,customTooltipModel:t}){const n=t,r=el.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 ul(e){const t=e.qHyperCubeDef?e.qHyperCubeDef.qDimensions:e.qHyperCube.qDimensionInfo;if(t&&t.length>0)return t}function pl(){const{EXPRESSION:e,TITLE:t,DESCRIPTION:n,IMAGES:r}=el.CUSTOM,i={};return i[e]=!0,i[t]=!0,i[n]=!0,i[r]=!0,i}function dl(e){const t=pl();return e.filter(e=>t[e.id])}const fl={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}=fl.getAttrExprData(a);o.length||n.length?al.handlePromises({customTooltipModel:i,nodes:fl.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&&cl.hide({app:r.app,customTooltipModel:i}),t.emit("hide")},checkIfPromisesExist:({customTooltipModel:e})=>al.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?.[el.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[el.CUSTOM.QUARANTINE]=[],e.forEach(e=>{r.quarantine[el.CUSTOM.QUARANTINE].push(e)}),n.qLayoutExclude=r}(dl(t.qAttributeExpressions||[]),e)}},unquarantineCustomTooltipAttrs(e){const t=e,n=e.qLayoutExclude?.quarantine?.[el.CUSTOM.QUARANTINE];n&&delete t.qLayoutExclude.quarantine[el.CUSTOM.QUARANTINE]},setAttrsFromQuarantine(e,t){const n=ul(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===dl(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=ul(e)||[];[...i,t].forEach(e=>{const t=dl(e.qAttributeExpressions||[]);t.length>0&&(r=t)});const o=pl(),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:Ls.detectTextDirection(e)},colspan:2},{}],getImageRow(e,t){const n=Ls.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 ml(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 el.CUSTOM.EXPRESSION:n="NaN"===t.qNum||e.isCustomFormatted?void 0===t.qText?"NaN":t.qText:t.qNum;break;case el.CUSTOM.TITLE:case el.CUSTOM.DESCRIPTION:case el.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 hl={getNode(e,{dimensionCount:t}){if(!t||t<1)return;const n=t-1,r="qDimensionInfo";return{field:`${r}/${n}`,value:t=>ml(t,e,r,n)}}};const yl={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={[el.CUSTOM.TITLE]:!0,[el.CUSTOM.DESCRIPTION]:!0},{attrExps:o,fieldPath:a}=fl.getAttrExprData(e);return 0===t.length||0===o.length||""===a||o.forEach((e,o)=>{const s=t[o];if(e.id===el.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===el.CUSTOM.TITLE&&{title:t},value:t,id:e.id})}}),r}(n,i.map(t=>ks.getMeasure(e,t)),e,r)}};function gl({nodes:e,layout:t,dataset:n}){const r=function(e,t,n){const r=[];return e.forEach(e=>{r.push(yl.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:[]})}function vl(e){const t=el.CUSTOM.EXPRESSION,{qNumFormat:n,qLabel:r,qLabelExpression:i,cId:o}=e.qDef;return e.qLibraryId?{qLibraryId:e.qLibraryId,id:t,qNumFormat:n,qLabel:r,qLabelExpression:i,cId:o}:{qExpression:e.qDef.qDef,id:t,qNumFormat:n,qLabel:r,qLabelExpression:i,cId:o}}function bl(e){const t=e.qHyperCubeDef?.qDimensions;return t[t.length-1].qAttributeExpressions||[]}var xl={attrExpr:{migrateProperties(e){const t=vs(!0,{},e),n=t.tooltip?.data?.qHyperCubeDef?.qMeasures||[];let r=bl(t);return r=function(e,t){return t.concat(e.map(e=>vl(e)))}(n,r),function(e,t){const n=t.qHyperCubeDef?.qDimensions;n[n.length-1].qAttributeExpressions=e}(r,t),delete t.tooltip?.data,t},getPatches(e){const t=e.tooltip?.data?.qHyperCubeDef?.qMeasures||[],n=e.qHyperCubeDef?.qDimensions.length-1,r=function(e,t,n){let r=e.length;const i=[];return t.forEach(e=>{const t=vl(e),o=JSON.stringify(t);i.push({qPath:`/qHyperCubeDef/qDimensions/${n}/qAttributeExpressions/${r}`,qOp:"add",qValue:o}),r++}),i.push({qPath:"/tooltip/data",qOp:"remove"}),i}(bl(e),t,n);return r},checkForBackwardCompatibility:(e,t)=>(e.qMeasureInfo||[]).length>0&&t.length>0,updateProperties(e,t){return new Promise(n=>{const r=t.qHyperCube?.qDimensionInfo||[],i=t.tooltip?.data?.qHyperCube||{},o=t.qMeta?.privileges?.includes("update");e&&e.getEffectiveProperties&&this.checkForBackwardCompatibility(i,r)&&e.getEffectiveProperties().then(t=>{if(o){const r=this.migrateProperties(t);e.setProperties(r).then(()=>{e.app.clearUndoBuffer(),n(!0)})}else{const r=this.getPatches(t);e.applyPatches(r,!0).then(()=>{e.app.clearUndoBuffer(),n(!0)})}}),n(!1)})}}};const{CUSTOM:ql}=el;function Dl({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},p=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:fl,miniChartToken:{},embed:s}}({layout:t,app:n,model:r,picasso:i,chart:o,translator:a,localeInfo:s,embed:l}),d="rtl"===c.direction,f=()=>{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:()=>f(),hideBasic:()=>f()&&ci(t,"tooltip.hideBasic",!1),getAttributes:({dataset:e,nodes:n})=>{const r=gl({dataset:e,nodes:n,layout:t});return{title:r.customTooltipInfoAttrExpsArr.find(e=>e.id===ql.TITLE)?.title,description:r.customTooltipInfoAttrExpsArr.find(e=>e.id===ql.DESCRIPTION)?.value,measures:r.customTooltipAttrExpsArr}},hasImages:()=>fl.checkIfPromisesExist({customTooltipModel:p}),createImageRow:({value:e,h:t})=>fl.getImageRow(e,{h:t,rtl:d}),addImages:({nodes:r})=>{const i=fl.getDataNodes(o,r),{attrExps:a}=fl.getAttrExprData(t);return al.handlePromises({customTooltipModel:p,nodes:i,attrExps:a,opts:{flags:e,app:n}})},chart:{isEnabled:()=>!!(f()&&t.tooltip?.chart?.object?.refId&&l&&"function"==typeof r?.getEffectiveProperties),hasLimitation:()=>!!n?.isInModalSelection?.(),createContainer:({h:e})=>cl.createContainer({layout:t,ctx:{h:e,rtl:d}}),createLimitationRow:()=>fl.getFooterRow(a.get("properties.tooltip.notselectedmessage"),d),show:({nodes:e,properties:t})=>cl.show({app:n,properties:t,selectedNodes:e,customTooltipModel:p,rtl:d}),hasAlternateState:()=>!!p.miniChartToken?.alternateState,hide:()=>cl.hide({app:n,customTooltipModel:p}),destroy:()=>cl.destroyVisualization({customTooltipModel:p})}}}function Sl(e){return{layout:e,keys:{SCALE:{FILL:"fill"},COMPONENT:{DIMENSION_TITLE:"dimension-title",SLICES:"slices",PIE_LABELS:"pie-labels"}}}}function Cl({layout:e}){const t=({ds:e,encodings:t})=>{const n={field:"qDimensionInfo/0",props:{num:{field:t.slice.arc}}};return t.slice.outerRadius&&(n.props.radius={field:t.slice.outerRadius}),e.extract(n)},n=({rows:e,encodings:t})=>t.slice.outerRadius?e.filter(e=>"NaN"!==e.num.value&&"NaN"!==e.radius.value):e.filter(e=>"NaN"!==e.num.value),r=({rows:t,encodings:n})=>n.slice.outerRadius&&!e.donut.showAsDonut?t.filter(e=>e.num.value>0&&e.radius.value>0):t.filter(e=>e.num.value>0);return function({layout:e,config:t={}}){const n={disclaimer:void 0,isSuppressing:!1,showDisclaimer:t.args?.layoutService?t.args.layoutService.getLayoutValue("showDisclaimer"):e?.showDisclaimer};return{initialize:({args:r}={})=>{n.disclaimer=function({args:e,disclaimers:t}){const n=[];return Object.keys(t).forEach(r=>{const i=si[r],o=t[r];o&&(o.condition||i?.condition||li)(e)&&n.push({key:i?.translationKey||i?.key||r,alignment:o.alignment||i?.alignment||ai})}),n.find(e=>e.alignment===oi)||n[0]}({args:{layout:e,...t.args,...r},disclaimers:t.disclaimers||{}}),n.isSuppressing=!(!n.disclaimer||n.disclaimer.alignment!==oi)},getDisclaimer:()=>n.isSuppressing?n.disclaimer:!1===n.showDisclaimer?void 0:n.disclaimer,getHasSuppressingDisclaimer:()=>n.isSuppressing}}({layout:e,config:{args:{},disclaimers:{NoDataExist:{condition:({ds:e,encodings:n})=>0===t({ds:e,encodings:n}).length},LimitedData:{condition:()=>{const t=ws.getValue(e,"qHyperCube.qSize.qcy");return ws.getValue(e,"qHyperCube.qDataPages.0.qArea.qHeight")<t}},OnlyNanData:{condition:({ds:e,encodings:r})=>{const i=t({ds:e,encodings:r});return 0===n({rows:i,encodings:r}).length}},OnlyNegativeOrZeroValues:{condition:({ds:e,encodings:i})=>{const o=t({ds:e,encodings:i}),a=n({rows:o,encodings:i});return 0===r({rows:a,encodings:i}).length}},NegativeOrZeroValues:{condition:({ds:e,encodings:i})=>{const o=t({ds:e,encodings:i}),a=n({rows:o,encodings:i}),s=a,l=r({rows:a,encodings:i});return s.length!==l.length}}}}})}function wl({flags:e,picasso:t,instance:n}){const r=A(),i=M(),o=w(),a=q(),[s,l]=S(),c=L(),u=k(),p=T(),d=x(),f=N(),{qLocaleInfo:m}=O(),h=P();return I(()=>{if(!n)return;a.style.overflow="hidden";const s=function({app:e,translator:t}){const n={initialized:!1,dimensions:[],measures:[]};return{initialize:async({properties:r})=>{if(n.initialized)return;const i={app:e,translator:t,properties:r},o=[vn(i),bn(i)],a=await Promise.all(o),[s,l]=a;n.dimensions=s,n.measures=l,n.initialized=!0},getAlternatives:()=>({dimensions:[...n.dimensions],measures:[...n.measures]})}}({app:i,translator:o}),y=function({picasso:e,model:t,app:n,translator:r,layoutService:i,createConfig:o=ii,config:a={},custom:s={}}){const{localeInfo:l,key:c,theme:u,auto:p,definitionPath:d}=a,f=i?.getLayout?.(),m={theme:u,key:c,localeInfo:l,layout:f,hc:i?.getHyperCube?.(),legendProps:i?.getLayoutValue?.("legend"),colorProps:{...i?.getLayoutValue?.("color"),useBaseColors:f?ti(f):void 0}},h=Qr({picasso:e,model:t,app:n,translator:r,auto:p});!1!==p&&h.auto(e=>p?p({layout:e,defaultAuto:ri}):ri(e));let y=!1;const g={getColor:()=>h.color(),getPaletteColor:({index:e,color:t})=>h.resolveUIColor({index:e,color:t}),getData:()=>h.data(),getDatumProps:e=>h.datumProps(e),getSnapshotData:()=>h.getSnapshotData(d),getSettingsForMeasure:e=>h.settingsForMeasure(e),getSettings:()=>h.settings(),getLegend:(e,t)=>h.legend(e,t),getScales:()=>h.scales(),getPalettes:()=>h.palettes(),isSelectionLocked:({isMeasureSelectionLocked:e})=>h.isSelectionLocked({isMeasureSelectionLocked:e}),isInitialized:()=>y,custom:{...s},initialize:({createConfig:e=o}={})=>{const t=e({getUseBaseColors:ti}),n=function(e,t={}){return{...e,...t,colorProps:{...e.colorProps,...t.colorProps||{}}}}(m,t);return h.config(n),h.getAuxiliarySettings(d).then(()=>{y=!0})}};return g}({picasso:n.picasso,model:r,app:i,translator:o,config:{auto:!1,key:"fill"}}),g=function({picassoInstance:e,plugins:t,pluginArgs:n={}}){const r={initialized:!1,definitions:[]};return{async initialize(){if(r.initialized)return;const i=Promise.all(t.filter(e=>"custom-component"===e.info.type).map(async t=>{if(!t.info.componentName)throw new Error("plugin-service: Custom component is missing componentName");const r=await t.fn({...n});if("object"!=typeof r)throw new Error("plugin-service: Custom component needs to be an object");e.component(t.info.componentName,r)})),o=Promise.all(t.filter(e=>"component-definition"===e.info.type).map(e=>e.fn({...n}))),a=await Promise.all([i,o]);r.initialized=!0,r.definitions.push(...a[1])},extendComponents:e=>r.initialized?(r.definitions.filter(Boolean).forEach(t=>{const[n]=e.filter(e=>e.key&&e.key===t.key);if(n){const e=Sn(!0,{},n.brush);Sn(!0,n,t),t.brush&&(n.brush=function(e,t){return"object"==typeof e&&Object.keys(e).length?(Array.isArray(t.consume)&&(e.consume=mi({originalArray:e.consume,newArray:t.consume,matchKey:"context"})),Array.isArray(t.trigger)&&(e.trigger=mi({originalArray:e.trigger,newArray:t.trigger,matchKey:"on"})),e):t}(e,t.brush))}else e.push(t)}),e):e}}({picassoInstance:n.picasso,plugins:u,pluginArgs:Sl(c)}),v=Dl({flags:e,layout:c,app:i,model:r,picasso:t,chart:n.chart,translator:o,localeInfo:m,embed:h,options:d}),b=function({theme:e,config:t={}}){const{id:n,resolve:r=[],transform:i=[],extend:o=[]}=t,a={theme:e,matrix:Ea(r),styles:void 0};return a.styles=Ma({theme:e,id:n,transform:i,extend:o,matrix:a.matrix}),{getStyles:()=>a.styles,getTheme:()=>a.theme,setTheme:e=>{a.theme=e,a.styles=Ma({theme:e,id:n,transform:i,extend:o,matrix:a.matrix})}}}({theme:f,config:{id:"pieChart",resolve:[["object","label.name","color","#595959"],["object","label.name","fontFamily"],["object","label.name","fontSize","12px"]]}}),x=function({chart:e,translator:t,layout:n,constraints:r,options:i,themeService:o,colorService:a,custom:s}){const l=n.qHyperCube.qMeasureInfo.length>1,c="rtl"===i.direction,{fontFamily:u}=o.getStyles();return ls({chart:e,translator:t,config:{rtl:c,enable:()=>!r.passive,getColorSettings:()=>a.getSettings(),style:{fontFamily:u},main:{key:"tooltip",getGroupByValue:({data:e})=>e.value,collectibles:[{key:"slices",type:"slice",major:({data:e})=>e.value}],triggers:[{keys:["slices"],collect:{from:"single"},placement:"collectible"},{keys:["pie-labels","negative-indicators"],collect:{from:"dimension",by:({data:e})=>e.value},placement:"trigger"}],placement:({meta:e})=>({type:"slices"===e.triggerer?"slice":"bounds"}),section:({h:e,nodes:n,dataset:r,formatter:i,create:o,util:a})=>{const[c]=n,{title:u,description:p,measures:d}=s.isEnabled()?s.getAttributes({dataset:r,nodes:n}):{},f=[];u&&f.push(o.text({value:u,style:{bold:!0}})),p&&f.push(o.text({value:p}));const m=s.hideBasic();if(m&&!d.length&&(u||p)||f.push(o.text({value:c.data.label,style:{bold:!0}})),!m){f.push(o.color({nodes:n,property:"fill"}));const{num:e}=c.data;if(f.push(o.measure({label:a.dataset.title(e.source.key,e.source.field),value:e.label})),l){const{radius:e}=c.data;f.push(o.measure({label:a.dataset.title(e.source.key,e.source.field),value:e.label}))}f.push(o.measure({label:t?t.get("properties.dataPoints.labelmode.share"):"Share",value:i("share")(c.desc.share)}))}d&&f.push(...d.map(e=>o.measure({label:e.label,value:e.value,survive:{color:!0,duplicate:!0}}))),s.chart.isEnabled()&&(s.chart.hasLimitation()?(s.chart.destroy(),f.push(o.raw({value:s.chart.createLimitationRow()}))):f.push(o.raw({value:s.chart.createContainer({h:e})})));const{customTooltipImages:h}=c.data;return s.isEnabled()&&h&&f.push(...h.map(t=>o.raw({value:s.createImageRow({value:t,h:e})}))),f},layout:{grouping:!0},events:{tooltip:{beforeShow:({collectNodes:e})=>s.isEnabled()&&s.hasImages()?s.addImages({nodes:e()}):Promise.resolve(),afterShow:({expando:e,nodes:t})=>{s.chart.isEnabled()&&!s.chart.hasLimitation()&&s.chart.show({nodes:t,properties:e.get("properties")})}},interaction:{mouseleave:()=>{s.chart.isEnabled()&&s.chart.hasAlternateState()&&s.chart.hide()}}}},legend:{keys:{tooltip:"legend-color-cat",component:"legend-cat"}}}})}({chart:n.chart,translator:o,layout:c,constraints:p,options:d,themeService:b,colorService:y,custom:v}),q=function({layout:e,themeService:t,colorService:n,flags:r}){const i=t.getStyles(),o=t=>r.isEnabled("CLIENT_IM_3050")?e.components?.find(e=>e.key===t):void 0,a=(e,t)=>{const r=n.getPaletteColor;if(e?.color&&r){const n=r(e);return"none"===n&&e.index>0?e?.color??t:n??t}return t};return{axis:{title:{getStyle:()=>{const e=o("axis")?.axis?.title;return{fontFamily:e?.fontFamily??i.axis.title.fontFamily,fontSize:e?.fontSize??i.axis.title.fontSize,color:a(e?.color,i.axis.title.color)}}}},label:{name:{getStyle:()=>{const e=o("label")?.label?.name;return{fill:a(e?.color,i.label.name.color),fontSize:e?.fontSize??i.label.name.fontSize,fontFamily:e?.fontFamily??i.label.name.fontFamily}}},value:{getStyle:()=>{const e=o("label")?.label?.value;return{fill:a(e?.color,i.label.value.color),fontSize:e?.fontSize??i.label.value.fontSize,fontFamily:e?.fontFamily??i.label.value.fontFamily}}}},legend:{title:{getStyle:()=>{const e=o("legend")?.legend?.title;return{fontFamily:e?.fontFamily??i.legend.title.fontFamily,fontSize:e?.fontSize??i.legend.title.fontSize,color:a(e?.color,i.legend.title.color)}}},label:{getStyle:()=>{const e=o("legend")?.legend?.label;return{fontFamily:e?.fontFamily??i.legend.label.fontFamily,fontSize:e?.fontSize??i.legend.label.fontSize,color:a(e?.color,i.legend.label.color)}}}}}}({layout:c,themeService:b,colorService:y,flags:e}),D=Cl({layout:c});l({alternativeService:s,colorService:y,disclaimerService:D,pluginService:g,themeService:b,tooltipService:x,styleService:q})},[r,i,n,c,o.language(),p,d.direction,f.name()]),s}const El=e=>"[object Object]"===Object.prototype.toString.call(e),Il=e=>Array.isArray(e);function Al(e,t){if(e===t)return!0;if(Il(e)){if(!Il(t))return!1;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Al(e[n],t[n]))return!1;return!0}if(El(e)){if(!El(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(!Al(e[n[r]],t[n[r]]))return!1}return!0}return e===t}function Ml({enable:e=!0}={}){const t=A(),n=()=>Date.now().toString()+Math.random(),[r,i]=S(n()),o={properties:void 0};return I(()=>{if(!t||!t.getEffectiveProperties||!e)return()=>{};const r=()=>{t.getEffectiveProperties().then(e=>{const t=vs(!0,{},e);if(!o.properties)return void(o.properties=t);const r=function(e,t){const n={properties:!1,exclude:!1};if(e===t)return n;const r=vs(!0,{},e),i=vs(!0,{},t);return n.exclude=!Al(r.qHyperCubeDef?.qLayoutExclude,i.qHyperCubeDef?.qLayoutExclude),delete r.qHyperCubeDef?.qLayoutExclude,delete i.qHyperCubeDef?.qLayoutExclude,n.properties=!Al(r,i),n}(o.properties,t);o.properties=t,r.exclude&&!r.properties&&i(n())})};return t.on("changed",r),r(),()=>{t.removeListener("changed",r)}},[e]),r}function Ll({scaleKey:e,legend:t,onEdited:n}){const{layout:r}=t,{dock:i}=r||{};return{type:"brush-range",key:"legendRangeBrush",layout:{dock:"@legend-seq"},on:n?{bubbleEnd(){n()}}:{},settings:{brush:"selection",scale:`${e}Range`,direction:"left"===i||"right"===i?"vertical":"horizontal",bubbles:{align:"left"===i||"top"===i?"end":"start",placement:"outside"},target:{selector:'[id="legend-seq-target"]',fillSelector:'[id="legend-seq-ticks"]',fill:"rgba(82,204,82,0.2)"}}}}const kl=.8,Tl=.55,Nl={CORNER_RADIUS:0,INNER_RADIUS:Tl,STROKE:{COLOR:"#FFFFFF",WIDTH:{NONE:0,SMALL:2,MEDIUM:4,LARGE:6}}},Ol=({layout:e},t,n)=>t.encodings.slice.outerRadius?{scale:"radius",fn:t=>{let r=kl,i=0;const o=n?.style?.innerRadius??Tl;e.donut.showAsDonut&&(r=kl-o,i=o);return t.scale(Math.max(0,t.datum.radius.value))*r+i}}:kl,Pl=({layout:e},t,n)=>{if(!e.donut.showAsDonut)return 0;const r=n?.style?.innerRadius??Tl;return t.encodings.slice.outerRadius?{scale:"radius",fn:e=>{const t=kl-r,n=r;return e.scale(Math.min(0,e.datum.radius.value))*t+n}}:r},Fl=({layout:e},t)=>{const n=t.colorService.getDatumProps(),r=n[Object.keys(n)[0]],i=r&&r.field?r.field:void 0,o="qDimensionInfo/0"===i,a=i?t.ds.field(i).raw():null,s=a&&(a.label||a.title||a.qFallbackTitle)||"",l=t.encodings.slice.outerRadius,{formatter:c}=t.chart,u=ws.getValue(e,"qHyperCube.qDimensionInfo",[]).length;function p(e,n){const r=t.ds.field(e).raw();return{field:e,label:!r.isCustomFormatted&&(r.qIsAutoFormat||"U"===r.qNumFormat.qType)?e=>c(n)(e.qNum):e=>e.qText}}const d=(e.components||[]).filter(e=>"slices"===e.key)[0];return{type:"pie",key:"slices",data:{extract:{field:"qDimensionInfo/0",props:{...n,num:p(t.encodings.slice.arc,"arc"),fillTooltip:i?{field:i,label:s,value:e=>o?e.qText||"-":void 0!==e.qNum&&"NaN"!==e.qNum?e.qText?e.qText:e.qNum:e.qText||"-"}:void 0,customTooltipAttrExps:0!==u?hl.getNode(e,{dimensionCount:u}):void 0,radius:l?p(l,"outerRadius"):void 0}}},brush:{consume:[{context:"selection",data:["","fill"],style:{inactive:{opacity:.3},active:{stroke:"rgba(52, 52, 52, 0.7)",strokeWidth:2}}},{context:"highlight",data:[""],style:{inactive:{fill:"#BFDAD9"},active:{fill:"#68B2AF"}}}]},settings:{startAngle:()=>t.viewState.get("rotation"),endAngle:()=>t.viewState.get("rotation")+2*Math.PI,slice:{arc:{ref:"num"},innerRadius:Pl({layout:e},t,d),fill:t.colorService.getColor(),strokeWidth:d?.style?.strokeWidth?Nl.STROKE.WIDTH[d.style.strokeWidth.toUpperCase()]:Nl.STROKE.WIDTH.NONE,stroke:d?.style?.strokeColor?.color??Nl.STROKE.COLOR,outerRadius:Ol({layout:e},t,d),cornerRadius:d?.style?.cornerRadius??0}},animations:{enabled:t.animations.enabled,isMainComponent:!0}}};function Rl({layout:e},t){const n=(e.components||[]).filter(e=>"slices"===e.key)[0],r=n?.style?.innerRadius??Tl,i=t.encodings.slice.outerRadius,o=t.themeService.getStyles();return!(!e.donut.showAsDonut||!i)&&{type:"pie",key:"zeroLine",data:{items:[1]},settings:{slice:{arc:1,fill:"transparent",innerRadius:0,strokeWidth:1,stroke:o.label.name.color,outerRadius:{scale:"radius",fn:e=>{const t=kl-r,n=r;return e.scale(0)*t+n}}}},animations:{enabled:t.animations.enabled}}}function jl(e){return{type:"pie-dividers",key:"pie-dividers",layout:{displayOrder:2},settings:{component:"slices",selector:"path"},brush:{consume:[{context:"selection",style:{inactive:{opacity:.2}}}]},animations:{enabled:e.animations.enabled,trackBy:()=>Math.random()}}}function Hl({layout:e},t){if(e.donut.showAsDonut||!t.encodings.slice.outerRadius)return!1;return{type:"negative-indicators",key:"negative-indicators",layout:{displayOrder:2},settings:{component:"slices",selector:"path",offset:5,size:4,fill:t.themeService.getStyles().label.name.color},brush:{consume:[{context:"selection",style:{inactive:{opacity:.2}}}]},animations:{enabled:t.animations.enabled}}}function zl(e){const t=e.node.desc&&e.node.desc.share;return t?e.formatter("share")(t):""}function Vl(e){return e.node.data.num.label}function _l(e){return e.node.data.radius.label}function $l(e,t,n){if(e.dataPoint.auto)return n?Vl:zl;if("share"===e.dataPoint.labelMode)return zl;if("value"===e.dataPoint.labelMode){return t.encodings.slice.outerRadius&&"radius"===e.dataPoint.labelValueMode?_l:Vl}return null}function Bl({data:e}){return e?e.label:""}function Ul(e){const t=parseInt(e,10);if(!isNaN(t))return t}function Wl(e){const t=((e&&e.components?e.components:void 0)||[]).filter(e=>"slices"===e.key)[0];return(t?.style?.innerRadius??Tl)>.3}function Kl({node:e,data:t}){return vs({_share:e.desc.share,_fillColor:e.attrs.fill},t)}function Yl(e,t,n){const r=t.styleService.label.name.getStyle(),i=[{padding:10,direction:t.encodings.slice.outerRadius?"rotate":"horizontal",placements:[{position:"outside",padding:t.encodings.slice.outerRadius?4:2,fill:r.fill}],fontSize:Ul(r.fontSize),fontFamily:r.fontFamily,label:Bl,linkData:({node:e,data:t})=>vs({_share:e.desc.share,_fillColor:e.attrs.fill,_showTooltip:!0},t)}];if($l(e,t,!1)){const r=function(e,t,n){return{label:$l(e,t,!1),simplifiedPlacements:[{position:e.donut.showAsDonut&&Wl(e)?"inside":"into",onBackground:e.donut.showAsDonut&&Wl(e),padding:4}],theme:n.theme,themeId:"object.pieChart"}}(e,t,n),o=Os(vs(t,r),n.theme);o.linkData=Kl,i.push(o)}return{key:"pie-labels",type:"labels",renderer:Js(),layout:{displayOrder:2,minimumLayoutMode:"XSMALL"},settings:{sources:[{component:"slices",selector:"path",strategy:{type:"slice",settings:{labels:i}}}]},brush:{consume:[{context:"selection",data:["","fill"],style:{inactive:{opacity:.3}}}]},animations:{enabled:t.animations.enabled,trackBy:()=>Math.random()}}}function Gl({layout:e,context:t},n){return!1!==e.dataPoint.show&&(1===n.dataRowCount?function(e,t,n){const r=$l(e,t,!0),i=(o=n.theme,e=>o.getContrastingColorTo(e.node.attrs.fill));var o;const a=t.themeService.getStyles(),s=t.styleService.label.name.getStyle(),l=t.styleService.label.value.getStyle(),c=s.fill===a.label.name.color,u=l.fill===a.label.value.color;return{key:"pie-labels",type:"labels",renderer:Js(),layout:{displayOrder:2,minimumLayoutMode:"XSMALL"},settings:{sources:[{component:"slices",selector:"path",strategy:{type:"rows",settings:{align:.5,justify:.5,padding:10,labels:[{fontSize:Ul(s.fontSize),fontFamily:s.fontFamily,fill:c&&!e.donut.showAsDonut?i:s.fill,label:Bl,linkData:({data:e})=>e},{fontSize:Ul(l.fontSize),fontFamily:l.fontFamily,fill:u&&!e.donut.showAsDonut?i:l.fill,label:r,linkData:({data:e})=>e}]}}}]},animations:{enabled:t.animations.enabled,trackBy:()=>Math.random()}}}(e,n,t):Yl(e,n,t))}const Jl=(e,{requireFailure:t,recognizeWith:n}={})=>({type:"Pan",requireFailure:t,recognizeWith:n,options:{event:"legendRange",enable(t,n){if(this.started||!n)return!0;if(e.constraints.select||e.constraints.active)return!1;const r=(this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some(e=>"legend-seq"===e.type)||function(e){const{target:t}=e.srcEvent;return!(!t||!(t.hasAttribute("data-other-value")&&t.hasAttribute("data-idx")||"INPUT"===t.nodeName))}(n))&&!e.isLocked([this.chart.component("slices")]);return r||this.chart.component("legendRangeBrush").emit("rangeClear"),r}},events:{legendRangestart(t){t.preventDefault(),e.interactions.emit("selections-start"),this.chart.component("legendRangeBrush").emit("rangeStart",t),this.started=!0},legendRangemove(e){e.preventDefault(),this.chart.component("legendRangeBrush").emit("rangeMove",e)},legendRangeend(t){t.preventDefault(),this.chart.component("legendRangeBrush").emit("rangeEnd",t),e.onSelect(),this.started=!1}}});function Zl(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}}function Xl(e,t){const n=t.component("slices");if(!n)return!1;const{x:r,y:i}=Zl(e,t),o=n.rect.x+n.rect.margin.left+n.rect.width/2,a=n.rect.y+n.rect.margin.top+n.rect.height/2,s=Math.min(n.rect.width,n.rect.height)/2*kl;return(o-r)**2+(a-i)**2<=s**2}const Ql=(e,t,{requireFailure:n,recognizeWith:r}={})=>({type:"Tap",requireFailure:n,recognizeWith:r,options:{event:"tap",interval:10,pointers:1,enable(t,n){return!n||!e.constraints.select&&!e.constraints.active&&(this.components=this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).filter(e=>"slices"===e.key||"legend-cat"===e.key||"pie-labels"===e.key),this.components.length)}},events:{tap(n){n.preventDefault();const{target:r}=n.srcEvent;if(r&&("INPUT"===r.nodeName||r.hasAttribute("data-other-value")))return void this.chart.component("legendRangeBrush").emit("bubbleStart",n);if(r&&r.hasAttribute("data-action")&&r.hasAttribute("data-component-key"))return void this.chart.component(r.getAttribute("data-component-key")).emit(r.getAttribute("data-action"));if(r&&r.children&&r.children[0]&&"legend-cat"===r.children[0].getAttribute("data-component-key"))return;if(e.isLocked(this.components))return;e.interactions.emit("selections-start");let i=Zl(n,this.chart);this.components.some(e=>"legend-cat"===e.key)&&(i={cx:i.x,cy:i.y,r:5});const o=this.chart.shapesAt(i,{components:[{key:"slices",propagation:"stop"},{key:"legend-cat",propagation:"stop"},{key:"pie-labels",propagation:"stop"}],propagation:"stop"});o.length&&(this.chart.brushFromShapes(o,{components:[{key:o[0].key,action:n.srcEvent.ctrlKey||t?"set":"toggle",contexts:["selection"]}]}),e.onSelect())}}}),ec=(e,{requireFailure:t,recognizeWith:n}={})=>({type:"Pan",requireFailure:t,recognizeWith:n,options:{event:"lasso",enable(t,n){if(this.isStarted||!n)return!0;if(e.constraints.active||e.constraints.select||!e.interactions.lasso.active())return!1;const r=this.chart.componentsFromPoint({x:n.center.x,y:n.center.y});return!e.isLocked(r)&&r.some(e=>"slices"===e.key)}},events:{lassostart(t){t.preventDefault(),e.constraints.select||e.constraints.active||this.isStarted||(e.interactions.emit("selections-start"),this.chart.component("lasso").emit("lassoStart",t),this.isStarted=!0)},lassomove(e){e.preventDefault(),this.chart.component("lasso").emit("lassoMove",e)},lassoend(t){t.preventDefault(),this.isStarted=!1,this.chart.component("lasso").emit("lassoEnd",t),e.onSelect()}}}),tc=(e,{requireFailure:t,recognizeWith:n}={})=>({type:"Tap",requireFailure:t,recognizeWith:n,options:{event:"areatap",pointers:2,enable(t,n){if(this.started||!n)return!0;if(e.constraints.active||e.constraints.select)return!1;const r=this.chart.componentsFromPoint({x:n.center.x,y:n.center.y});return r.some(e=>"slices"===e.key)&&!e.isLocked(r)}},events:{areatap(t){const n=this.chart.component("area");n&&!this.started&&(e.interactions.emit("selections-start"),n.emit("areaStart",t.pointers[0]),n.emit("areaMove",t.pointers[1]),this.started=!0,setTimeout(()=>{n.emit("areaEnd"),e.onSelect(),this.started=!1},100)),t.preventDefault()}}});function nc(e){return{type:"native",key:"theusual",events:{wheel(t){let n=!1;if(!e.constraints.active&&Xl(t,this.chart)){const r=Math.sign(-t.deltaY);e.viewState.set("rotation",r*(Math.PI/12)),n=!0}else if(!e.constraints.select&&!e.constraints.active){const e=this.chart.componentsFromPoint(t).filter(e=>"legend-cat"===e.key)[0];e&&(n=!0,function(e,t){const n=(Math.abs(e.deltaX)>Math.abs(e.deltaY)?e.deltaX:e.deltaY)>=0?"next":"prev";t.emit(n)}(t,e))}n&&t.preventDefault()}}}}const rc=(e,{requireFailure:t,recognizeWith:n}={})=>({type:"Pan",requireFailure:t,recognizeWith:n,options:{event:"rotate",pointers:1,threshold:10,enable(t,n){return!(!this.started&&n)||!e.constraints.active&&!e.interactions.lasso.active()&&Xl(n,this.chart)}},events:{rotatestart(e){e.preventDefault();const t=this.chart.component("slices").rect,n=this.chart.element.getBoundingClientRect();this.pieCenter={x:n.left+t.x+t.width/2,y:n.top+t.y+t.height/2},this.prevAngle=Math.atan2(e.center.y-this.pieCenter.y,e.center.x-this.pieCenter.x),this.started=!0},rotatemove(t){t.preventDefault();const n=Math.atan2(t.center.y-this.pieCenter.y,t.center.x-this.pieCenter.x);e.viewState.set("rotation",n-this.prevAngle),this.prevAngle=n},rotateend(e){e.preventDefault(),this.started=!1},rotatecancel(e){e.preventDefault(),this.started=!1}}}),ic=(e,{requireFailure:t,recognizeWith:n}={})=>({type:"Pan",requireFailure:t,recognizeWith:n,options:{event:"legendPan",pointers:1,threshold:10,enable(t,n){return!(!this.isStarted&&n)||!e.constraints.active&&this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some(e=>"legend-cat"===e.type)}},events:{legendPanstart(e){if(e.preventDefault(),!this.isStarted){this.components=this.chart.componentsFromPoint({x:e.center.x,y:e.center.y}),this.components.forEach(t=>{t.emit("panstart",e)}),this.isStarted=!0;const t=this.chart.component("tooltip");t&&t.show&&t.emit("hide")}},legendPanmove(e){this.components.forEach(t=>{t.emit("panmove",e)}),e.preventDefault()},legendPanend(e){e.preventDefault(),this.components.forEach(t=>{t.emit("panend",e)}),this.isStarted=!1}}}),oc=(e,t,n)=>({key:"hammered",type:"hammer",enable:!0,gestures:t?[rc(e,{}),Ql(e,t,{}),...n]:[Jl(e,{}),tc(e,{}),rc(e,{}),ec(e,{}),ic(e,{}),Ql(e,t,{}),...n]});function ac(e,t,n){const r=e.getIsSingleSelect(0),{constraints:i}=n;if(i.active&&i.passive)return[];const o=t.tooltipService.getInteractions();return[oc(t,r,o.gestures),nc(t),o.native]}function sc({settings:e},t){const n={share:{type:"d3-number",format:".1%"},arc:{data:{field:t.encodings.slice.arc}},fill:e.scales.fill&&e.scales.fill.data&&e.scales.fill.data.field?{data:{field:e.scales.fill.data.field}}:{}};return t.encodings.slice.outerRadius&&(n.outerRadius={data:{field:t.encodings.slice.outerRadius}}),n}function lc({layout:e},t,n){if(!e.dimensionTitle)return!1;const r=t.alternativeService.getAlternatives(),i=t.styleService.axis.title.getStyle();return{key:"dimension-title",type:"axis-title",renderer:"react-qcm",layout:{dock:"top",minimumLayoutMode:"SMALL"},data:{infos:e.qHyperCube.qDimensionInfo,alternatives:r.dimensions},resources:{app:t.app,cache:t.viewCache,model:t.model,selections:t.selections,translator:t.translator},callbacks:{onChange:()=>{}},settings:{isDisabled:()=>n.constraints.active,isRTL:n.rtl,isSnapshot:!!e.snapshotData,noModelDependencies:!0,skipAttributeExpressions:!1,type:"dimension"},style:{title:{color:i.color,fontFamily:i.fontFamily,fontSize:i.fontSize}}}}function cc({layout:e,context:t,selectionService:n},r={}){const i=function({layout:e}={},t={}){const n={};return vs(n,t.colorService.getScales()),t.encodings.slice.outerRadius&&vs(n,function({layout:e},t){const n={radius:{type:"linear",include:[0],data:{extract:{field:t.encodings.slice.outerRadius}}}};return e.donut.showAsDonut||(n.radius.min=0),n}({layout:e},t)),n}({layout:e},r),o={scales:i};let a=[];const s=function(e,t){const n=e.disclaimerService.getDisclaimer();if(!n)return!1;const{rtl:r}=t,{translator:i}=e,{fontFamily:o}=e.themeService.getStyles();return{key:"disclaimer",type:"disclaimer",renderer:"react-qcm",layout:{dock:n.alignment},settings:{isRTL:r,label:i.get(`Object.Disclaimer.${n.key}`)},style:{fontFamily:o}}}(r,t);if(r.disclaimerService.getHasSuppressingDisclaimer())return{components:[s]};const l=t.constraints.select||t.constraints.active,c=r.colorService.getLegend({eventName:"legend",key:"legend",viewState:r.viewState,chart:r.chart,styleReference:"object.pieChart",styleOverrides:{title:r.styleService.legend.title.getStyle(),label:r.styleService.legend.label.getStyle()},rtl:t.rtl},{navigationDisabled:l});return i.fillRange&&c.components[0]&&("right"===c.components[0].layout.dock||"left"===c.components[0].layout.dock||t.rtl)&&(i.fillRange.invert=!0),a=[Fl({layout:e},r),Rl({layout:e},r),jl(r),Hl({layout:e},r),lc({layout:e},r,t),...c.components,Ll({scaleKey:"fill",legend:c.components[0]||{},onEdited:r.onSelect}),{key:"lasso",type:"brush-lasso",layout:{displayOrder:99},settings:{brush:{components:[{key:"slices",contexts:["selection"]}]},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}}},{key:"area",type:"brush-area",settings:{brush:{components:[{key:"slices",contexts:["selection"],action:"add"}]}},style:{area:{fill:"transparent",strokeWidth:2,stroke:"black",strokeDasharray:"5 5",opacity:.7}}},Gl({layout:{components:e.components,dataPoint:vs({},e.dataPoint,{show:!(e.effectPath&&e.snapshotData&&!1===e.dataPoint.show)}),donut:e.donut},context:t},r),...r.tooltipService.getComponents(),s],a=a.filter(e=>!1!==e),{interactions:ac(n,r,t),scales:i,components:r.pluginService.extendComponents(a),palettes:r.colorService.getPalettes(),formatters:sc({settings:o},r),strategy:Ds(0,r)}}function uc({instance:e,services:t,picasso:r,env:i}){const{flags:o}=i,a=x(),s=A(),l=M(),c=w(),u=N(),p=L(),d=D(),f=T(),{qLocaleInfo:m}=O();i.localeInfo=m;const h=Ml({enable:p&&!p.snapshotData}),[y]=F(()=>{if(!t)return Promise.resolve();xl.attrExpr.updateProperties(s,p);const e=({getUseBaseColors:e})=>({theme:u,legendProps:p.legend,layout:p,localeInfo:m,hc:p.qHyperCube,colorProps:{...p.color,useBaseColors:e(p)}});return Promise.resolve(s&&!p.snapshotData?s.getEffectiveProperties():{}).then(async n=>Promise.all([t.colorService.initialize({createConfig:e}),Promise.resolve(n),t.pluginService.initialize(),t.alternativeService.initialize({properties:n})]))},[t,h]);I(()=>{e?.selectionService&&e.selectionService.setLayout(p)},[p]),I(()=>{if(!e||!y)return;const{chart:i,viewState:h,interactions:g,viewCache:v}=e,{alternativeService:b,colorService:x,disclaimerService:q,pluginService:D,themeService:S,tooltipService:C,styleService:w}=t,E=a.viewState||{};p.snapshotData||(h.preventSet("legendScrollOffset",E.legendScrollOffset||0),h.preventSet("rotation",E.rotation||0)),function(e,t){e&&e.snapshotData&&e.snapshotData.content&&e.snapshotData.content.chartData&&(t.preventSet("legendScrollOffset",e.snapshotData.content.chartData.legendScrollOffset||0),t.preventSet("rotation",e.snapshotData.content.chartData.rotation||0))}(p,h),C.expando.set("properties",y[1]);const I=r.data("q")({key:"qHyperCube",data:p.qHyperCube,config:{localeInfo:m}}),A=[{type:"q",key:"qHyperCube",data:p.qHyperCube,config:{localeInfo:m}},...x.getData()],M={slice:{arc:"qMeasureInfo/0"}};p.qHyperCube.qMeasureInfo.length>1&&(M.slice.outerRadius="qMeasureInfo/1"),q.initialize({args:{ds:I,encodings:M}});const L=function(e,t){if(t.slice.outerRadius)return e.extract({field:"qDimensionInfo/0",props:{num:{field:t.slice.arc},radius:{field:t.slice.outerRadius}}}).filter(e=>e.num.value>0&&"NaN"!==e.radius.value).length;return e.extract({field:"qDimensionInfo/0",props:{num:{field:t.slice.arc}}}).filter(e=>e.num.value>0).length}(r.data("q")({data:p.qHyperCube,config:{localeInfo:m}}),M),k=d?()=>{const e=i.brush("selection");n.selections(e,{},p).forEach(e=>{d.select(e)})}:()=>{},T=p.snapshotData&&!a.freeResize?{width:(p.snapshotData.content.size||p.snapshotData.object.size).w,height:(p.snapshotData.content.size||p.snapshotData.object.size).h}:void 0,N=t=>e.selectionService.getIsSelectionLocked(t),O=()=>cc({layout:p,context:{rtl:"rtl"===a.direction,theme:u,constraints:f},selectionService:e.selectionService},{picasso:r,ds:I,model:s,app:l,chart:i,onSelect:k,isLocked:N,interactions:g,constraints:f,translator:c,viewState:h,dataRowCount:L,encodings:M,alternativeService:b,colorService:x,disclaimerService:q,pluginService:D,themeService:S,styleService:w,tooltipService:C,debouncer:fi,properties:y[1],selections:d,logicalSize:T,flags:o,viewCache:v,animations:{enabled:()=>function({viewState:e,options:t,viewCache:n,layout:r,chart:i}){return!1!==t.chartAnimations&&n.get("chartWidth")===i.element.clientWidth&&n.get("chartHeight")===i.element.clientHeight&&n.get("hasZeroLine")===!!i.component("zeroLine")&&0===e.get("rotation")&&!Gs.propertiesHaveChanged({viewCache:n,layout:r})}({viewState:h,options:a,layout:p,viewCache:v,chart:i})}});e.generateSettings=O;const P=O();i.update({data:A,settings:P}),v.set("chartWidth",i.element.clientWidth),v.set("chartHeight",i.element.clientHeight),v.set("hasZeroLine",P.components.filter(e=>"zeroLine"===e.key).length>0),Gs.cacheProperties({viewCache:v,layout:p}),a.effect&&p.effectProperties?a.effect.update(p,i,{encodings:M}):p.effectPath||i.brush("highlight").end()},[e,y,a.direction,a.effectProperties,f,u.name(),c.language()])}function pc({instance:e,services:t}){const n=q(),r=L();j(i=>{if(!(r.snapshotData&&r.snapshotData.content&&r.snapshotData.content.chartData)&&(function(e,t){const n=t.getBoundingClientRect();e.snapshotData=e.snapshotData||{},e.snapshotData.content=e.snapshotData.content||{},e.snapshotData.content.size=e.snapshotData.content.size||{w:n.width,h:n.height}}(i,n),e&&t))return function({layout:e,chart:t,viewState:n,colorService:r}){return e.snapshotData.content=e.snapshotData.content||{},e.snapshotData.content.chartData={legendScrollOffset:Es(t,"legend-cat"),rotation:n.get("rotation")},r.getSnapshotData().then(t=>{e.snapshotData.content.chartData={...e.snapshotData.content.chartData,...t}}).catch(()=>{})}({layout:i,chart:e.chart,colorService:t.colorService,viewState:e.viewState})}),H(()=>({getViewState:()=>({rotation:e.viewState.get("rotation"),legendScrollOffset:Es(e.chart,"legend-cat")})}),[e])}var dc,fc={exports:{}};var mc=(dc||(dc=1,self,fc.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,p=arguments[0],d=1,f=arguments.length,m=!1;for("boolean"==typeof p&&(m=p,p=arguments[1]||{},d=2),(null==p||"object"!=typeof p&&"function"!=typeof p)&&(p={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=l(p,n),p!==(i=l(t,n))&&(m&&i&&(a(i)||(c=o(i)))?(c?(c=!1,u=r&&o(r)?r:[]):u=r&&a(r)?r:{},s(p,{name:n,newValue:e(m,u,i)})):void 0!==i&&s(p,{name:n,newValue:i}));return p}},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,p=arguments[0],d=1,f=arguments.length,m=!1;for("boolean"==typeof p&&(m=p,p=arguments[1]||{},d=2),(null==p||"object"!=typeof p&&"function"!=typeof p)&&(p={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=l(p,n),p!==(i=l(t,n))&&(m&&i&&(a(i)||(c=o(i)))?(c?(c=!1,u=r&&o(r)?r:[]):u=r&&a(r)?r:{},s(p,{name:n,newValue:e(m,u,i)})):void 0!==i&&s(p,{name:n,newValue:i}));return p}}},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:()=>ke});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 p(e){return!(!e.fullAccumulation&&!e.fullRange)}function d(e,t){var n=e.crossAllDimensions;return 2===t&&n?"RowNo(Total)":"RowNo()"}function f(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 m(){return"[$(=Replace(GetObjectField(".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,"),']',']]'))]")}function h(e,t){var n=e.crossAllDimensions;return 2===t&&n?"Above(Total ":"Above("}function y(e){return void 0===e?")":", 0, ".concat(e,")")}function g(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(g("MinString(".concat(t,")")),")' and Only({1}").concat(t,")<='$(=").concat(g("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),m(0));return"".concat(a,"({1<").concat(c,">}").concat(l,")")}if(r&&2===r.length){var p=u(r[0],i),d=u(r[1],i),f=m(0),h=m(1),y=v(p,f),g=v(d,h);return"".concat(a,"({1<").concat(y,",").concat(g,">}").concat(l,")")}return"".concat(a,"({1}").concat(l,")")}function x(e){return"".concat(e,"(")}function q(e){var t=e.properties,n=e.layout;return o(t,"qHyperCubeDef.qDimensions",o(n,"qHyperCube.qDimensionInfo",[])).length}const D={isFullRange:p,getNumDimensions:q,getExpressionWithExcludedComp:function(e){var t=e.expression,n=e.modifier,r=e.dimensions,i=e.dimensionAndFieldList,o=e.treatMissingAsNull,a=c(f(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=m(0);return"If(Count(".concat(u,") > 0, ").concat(a," + ").concat(s).concat(l,")")}if(r&&2===r.length){var p=m(0),d=m(1);return"If(Count(".concat(p,") * Count(").concat(d,") > 0, ").concat(a," + ").concat(s).concat(l,")")}return a},getRowNoComp:d,getNumStepComp:function(e,t){if(!p(e)){var n=e.steps;return"number"!=typeof n||Number.isNaN(n)?6:n}return d(e,t)},getAboveCompPrefix:h,getAboveCompSuffix:y,getAboveComp:function(e,t,n,r){return h(e,t)+n+y(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===q({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=m(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:f,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=q({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:m,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 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 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 w=t().bind(null,!0),E={},I=Array.isArray;function A(e){return null!=e&&!Array.isArray(e)&&"object"===C(e)}function M(e){return void 0===e}function L(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function k(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]=M(e[n||t])?o:e[t],e=e[n||t]}}),e}function T(e,t){var n=!0;if(A(e)&&A(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach(function(r){T(e[r],t[r])||(n=!1)}),n);if(I(e)&&I(t)){if(e.length!==t.length)return!1;for(var r=0,i=e.length;r<i;r+=1)if(!T(e[r],t[r]))return!1;return!0}return e===t}E.generate=function(e,t,n){n=n||"";var r=[];return Object.keys(t).forEach(function(i){var o=function(e){return e?w({},{val:e}).val:e}(t[i]),a=e[i],s="".concat(n,"/").concat(i);T(o,a)||L(t,i)||(M(a)?r.push({op:"add",path:s,value:o}):A(o)&&A(a)?r=r.concat(E.generate(a,o,s)):I(o)&&I(a)?r=r.concat(function(e,t,n){var r=[],i=e.slice(),o=-1;function a(e,t,n){if(e[n]&&M(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(t,i))return r;if(!M(t[0])&&M(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(E.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){M(t[i])&&!L(e,i)&&r.push({op:"remove",path:"".concat(n,"/").concat(i)})}),r},E.apply=function(e,t){t.forEach(function(t){var n,r,i=k(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(I(i))"-"===o&&(o=i.length),i.splice(+o,"add"===t.op?0:1,t.value);else if(I(a)&&I(t.value)){var l,c=t.value.slice();a.length=0,(l=a).push.apply(l,function(e){if(Array.isArray(e))return S(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 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}}(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(A(a)&&A(t.value))n=a,Object.keys(n).forEach(function(e){Object.getOwnPropertyDescriptor(n,e).configurable&&!L(n,e)&&delete n[e]}),w(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=k(e,t.from);I(i)?i.splice(+o,0,u.splice(+s,1)[0]):(i[o]=u[s],delete u[s])}else"remove"===t.op&&(I(i)?i.splice(+o,1):delete i[o])})},E.clone=function(e){return w({},e)},E.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},E.updateObject=function(e,t){Object.keys(e).length?E.apply(e,E.generate(e,t)):w(e,t)};const N=E,O=function(e,n,r){if(!e)return Promise.resolve();var i=N.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 P="accumulation";function F(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===P)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===P)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var j={type:"accumulation",disabled:!1,accumulationDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullAccumulation:!1,steps:6,outputExpression:""};const H={translationKey:"properties.modifier.accumulation",needDimension:D.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return D.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=D.getNumDimensions({properties:r,layout:i}));var c=o(r,"qHyperCubeDef.qDimensions",[]),u=D.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:s}),p=D.getNumStepComp(n,l),d=D.getAboveComp(n,l,u,p),f=D.getRangeComp("RangeSum",d);if(D.needDimension({modifier:n,properties:r,layout:i})){var m=D.getDimComp(c,1),h=D.getDimComp(c,0),y=D.getAggrComp(f,m,h);f=n.showExcludedValues?D.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:s,valueComp:y}):y}return f},extractInputExpression:D.extractInputExpression,initModifier:function(e){D.initModifier(e,j)},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!D.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=F(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=F(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 D.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=F(t,e);return o&&!o.disabled}};return n}};var z="movingAverage";function V(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===z)return n[r]}function _(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===z)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var $={type:"movingAverage",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullRange:!1,steps:6,outputExpression:"",nullSuppression:!1};const B={translationKey:"properties.modifier.movingAverage",needDimension:D.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return D.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=D.getNumDimensions({properties:i,layout:a}));var u=o(i,"qHyperCubeDef.qDimensions",[]),p=r.showExcludedValues&&r.nullSuppression,d=D.getExpressionWithExcludedComp({expression:n,modifier:r,dimensions:u,dimensionAndFieldList:l,treatMissingAsNull:p}),f=D.getNumStepComp(r,c),m=D.getAboveComp(r,c,d,f);if(r.nullSuppression)t=D.getRangeComp("RangeAvg",m);else{var h=D.getRangeComp("RangeSum",m),y=function(e,t){var n=D.getRowNoComp(e,t);if(!D.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(h," / ").concat(y)}var g=t;if(D.needDimension({modifier:r,properties:i,layout:a})){var v=D.getDimComp(u,1),b=D.getDimComp(u,0),x=D.getAggrComp(g,v,b);g=r.showExcludedValues?D.getExcludedComp({modifier:r,dimensions:u,dimensionAndFieldList:l,funcComp:"Only",valueComp:x}):x}return g},extractInputExpression:D.extractInputExpression,initModifier:function(e){D.initModifier(e,$)},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!D.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(_(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(_(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(_(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(_(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(_(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0},nullSuppression:{refFn:function(t){return"".concat(_(t,e),".nullSuppression")},type:"boolean",translation:t.showNull||"properties.dimensions.showNull",schemaIgnore:!0,defaultValue:!1,inverted:!0}},show:function(e,t){return D.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(z))return!1;var o=V(t,e);return o&&!o.disabled}};return n}};var U="timeSeriesDecomposition";function W(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===U)return n[r]}function K(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===U)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var Y={type:"timeSeriesDecomposition",disabled:!1,decomposition:"",steps:2,outputExpression:""};const G={translationKey:"properties.modifier.timeSeriesDecomposition",needDimension:D.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return D.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties;return n?D.generateTSDExpression(n,t,r):t},extractInputExpression:D.extractInputExpression,initModifier:function(e,t){D.initModifier(e,Y),""===e.decomposition&&t&&(e.decomposition=D.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!D.isApplicable({properties:t.properties})}},settings:{type:"items",items:{decomposition:{refFn:function(t){return"".concat(K(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(K(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 D.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(U))return!1;var o=W(t,e);return o&&!o.disabled}};return n}};var J="difference";function Z(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 X(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 Q={type:"difference",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,outputExpression:""};const ee={translationKey:"properties.modifier.difference",needDimension:D.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return D.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:D.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=D.getNumDimensions({properties:r,layout:i}));var c=o(r,"qHyperCubeDef.qDimensions",[]),u=D.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:s}),p=D.getAboveComp(n,l,u),d="".concat(u," - ").concat(p);if(D.needDimension({modifier:n,properties:r,layout:i})){var f=D.getDimComp(c,1),m=D.getDimComp(c,0),h=D.getAggrComp(d,f,m);d=n.showExcludedValues?D.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:s,funcComp:"Only",valueComp:h}):h}return d},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!D.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(X(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(X(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(X(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return D.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=Z(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(D.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(D.getDimDefWithWrapper(n),">"):""}const ue={translationKey:"properties.modifier.normalization",needDimension:function(){return!0},isApplicable:function(e){var t=e.properties,n=e.layout;return D.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:D.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=D.getNumDimensions({properties:r,layout:i}));var c=o(r,"qHyperCubeDef.qDimensions",[]),u=D.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:s}),p=n.selectionScope,d=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),p=ce(i,o,a),d=function(e){for(var t=[],n=0;n<e;n++)t[n]=D.getDimDefWithWrapper(n);return t.join(", ")}(o);return"".concat(e,"/ Sum(").concat(c," ").concat(u).concat(p," Aggr(").concat(c," ").concat(e,", ").concat(d,"))")}(u,p,n.field,n.value,d,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!D.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 D.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 pe="qDef.base",de="qDef.qDef",fe="qDef.base.qDef",me="qLibraryId",he="qDef.base.qLibraryId";const ye={getExpression:function(e){var t=o(e,fe);return void 0!==t?t:o(e,de)},getExpressionRef:function(e){return void 0!==o(e,fe)?fe:de},getLibraryIdRef:function(e){return o(e,he)?he:me},getLibraryId:function(e){return o(e,he)||o(e,me)},getLabelRef:function(e){return o(e,pe)?"qDef.base.qLabel":"qDef.qLabel"},getLabelExpressionRef:function(e){return o(e,pe)?"qDef.base.qLabelExpression":"qDef.qLabelExpression"}};var ge="qDef.qDef",ve="qDef.base.qDef",be="qLibraryId",xe="qDef.base.qLibraryId",qe="qDef.qLabel",De="qDef.qLabelExpression",Se="qDef.base.qLabel",Ce="qDef.base.qLabelExpression",we="qDef.qAggrFunc",Ee="qDef.base.qAggrFunc",Ie={initBase:function(e,t){(t||Ie.isValid(e))&&(n(e,ve,o(e,ge)),n(e,xe,o(e,be)),n(e,Se,o(e,qe)),n(e,Ce,o(e,De)))},restoreBase:function(e){Ie.isValid(e)&&(n(e,ge,o(e,ve)),n(e,be,o(e,xe)),n(e,qe,o(e,Se)),n(e,De,o(e,Ce)),o(e,we)&&o(e,Ee)&&n(e,we,o(e,Ee)),delete e.qDef.base)},isValid:function(e){var t=o(e,ve),n=o(e,xe);return void 0!==t||void 0!==n}};const Ae=Ie;function Me(e){return Me="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},Me(e)}var Le={accumulation:H,movingAverage:B,difference:ee,normalization:ue,timeSeriesDecomposition:G};const ke={modifiers:Le,apply:Ne,applyModifiers:Oe,cleanUpMeasure:Pe,destroy:function(e){e&&Te[e.id]&&Te[e.id].masterItemSubscriber&&(Te[e.id].masterItemSubscriber&&Te[e.id].masterItemSubscriber.unsubscribe(),delete Te[e.id])},hasActiveModifiers:Fe,getActiveModifier:Re,initBase:Ae.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some(function(e){return Le[e]})},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some(function(e){return Le[e]&&Le[e].isApplicable({properties:n,layout:r})})},measureBase:ye,limitedSorting:function(e){var t=e.measures,n=e.properties,r=e.layout,i=!1,o=!1;return t.forEach(function(e){var t=ze(e);Ke({modifiers:t,properties:n,layout:r})&&(i=!0,o=o||Xe({modifiers:t,properties:n,layout:r}))}),i&&!o},ifEnableTotalsFunction:je};var Te={};function Ne(){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;Te[n.id]=Te[n.id]||{isFirstTime:!0};var c=Te[n.id].isFirstTime;if(Te[n.id].isFirstTime=!1,r&&"object"===Me(r))return Oe({model:n,properties:r});var u=n?n.layout:void 0,p=o(u,"qSelectionInfo.qInSelections");if(a||p)return Promise.resolve(l);var d=o(u,"qHyperCube.qMeasureInfo"),f=Te[n.id].lastReloadTime;if(Te[n.id].lastReloadTime=o(n,"app.layout.qLastReloadTime"),Fe({measures:d,layout:u})){var m=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:d,layout:u,model:n,lastReloadTime:f});return m||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 Ke({modifiers:ze(t),layout:n})?!t.base:!!t.base}({measure:e,layout:n})}))}({measures:d,layout:u,masterItem:s,isFirstTime:c})?n.getEffectiveProperties().then(function(e){var r=t()(!0,{},e);_e(r);var i=Qe(r);return Ye({model:n}).then(function(t){return Ge({libraryIds:i,model:n}).then(function(i){return m&&function(e){var t=e.properties;He(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"===Me(e)&&!e.disabled){if(n++,"object"!==Me(Le[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=Le[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==r&&Be(t)&&D.simplifyExpression(t.qDef.base.qDef)!==D.simplifyExpression(r)&&(t.qDef.base.qDef=r)}})}}({measure:e,properties:t})})}({properties:r}),Oe({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"===Me(e.base)})}(d)?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 He(r).forEach(function(e){return Pe(e)}),Ze({oldProperties:e,newProperties:r,model:n})})}({model:n,properties:e})}):Promise.resolve(l)}function Oe(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,p=e.dimensionAndFieldList;void 0===r&&(r=l?t()(!0,{},i):i),_e(i);var d=Qe(i);return et({model:n,libraryIds:d,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=He(r)),!n.length)return Promise.resolve();if(!Fe({measures:n,properties:r}))return n.forEach(function(e){return Pe(e)}),Promise.resolve();var l=a?void 0:Qe(r);return Ye({model:i,dimensionAndFieldList:s}).then(function(e){return Ge({libraryIds:l,model:i,libraryItemsProps:a}).then(function(i){n.forEach(function(n){Ke({modifiers:n.qDef.modifiers,properties:r})?(function(e){var n=e.measure,r=e.properties,i=e.libraryItemsProps,a=e.dimensionAndFieldList,s=0;Ae.isValid(n)||Ae.initBase(n,!0);var l=n.qDef,c=l.modifiers,u=l.base;Array.isArray(c)&&c.forEach(function(e){if("object"===Me(e)&&!e.disabled){if(s++,"object"!==Me(Le[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)");Le[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:Le[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 Le[r.type].updateModifier&&Le[r.type].updateModifier(r,i.qHyperCubeDef);var a=ye.getExpression(n),s=""===a?a:Le[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||je(e)?"None"!==t?delete e.qDef.base.qAggrFunc:"None"===t&&je(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}),$e(n)):Pe(n)})})})}({measures:a,properties:i,model:n,libraryItemsProps:u,dimensionAndFieldList:p}).then(function(){return l?Ze({oldProperties:r,newProperties:i,model:n}):Promise.resolve(!1)})})}function Pe(e){!function(e){var t=ze(e);return Array.isArray(t)&&t.some(function(e){return"object"===Me(e)&&!e.disabled&&!Le[e.type]})}(e)?Ae.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,$e(e)}function Fe(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some(function(e){return Ke({modifiers:ze(e),properties:n,layout:r})})}function Re(e){var t=ze(e);if(Array.isArray(t))for(var n=0;n<t.length;n++){var r=t[n];if(Le[r.type]&&!r.disabled)return r}}function je(e){var t=Re(e);return!t||Le[t.type].enableTotalsFunction(e)}function He(e){return o(e,"qHyperCubeDef.qMeasures",[]).concat(o(e,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",[]))}function ze(e){return e.modifiers||e.qDef&&e.qDef.modifiers}function Ve(e){return o(e,"outputExpression.qValueExpression.qExpr")||o(e,"outputExpression")}function _e(e){He(e).forEach(function(e){return function(e){var n=Re(e);n&&(void 0!==n.outputExpression&&Ve(n)!==e.qDef.qDef?delete e.qDef.base:!Ae.isValid(e)&&n.base&&(e.qDef.base=t()(!0,{},n.base)))}(e)})}function $e(e){var t=ze(e);Array.isArray(t)&&t.forEach(function(t){"object"===Me(t)&&(t.disabled||!Le[t.type]&&Ve(t)!==e.qDef.qDef)&&(t.disabled=!0,delete t.base)})}function Be(e){return e.base||e.qDef&&e.qDef.base}function Ue(e){var t=Be(e);return e.qLibraryId||t&&t.qLibraryId}function We(e){var t=e.measure,n=e.properties,r=e.layout;return!Ue(t)&&Ke({modifiers:ze(t),properties:n,layout:r})}function Ke(e){var t=e.modifiers,n=e.properties,r=e.layout,i={};return Array.isArray(t)&&t.some(function(e){return!("object"!==Me(e)||e.disabled||!Le[e.type])&&(void 0===i[e.type]&&(i[e.type]=Le[e.type].isApplicable({properties:n,layout:r})),i[e.type])})}function Ye(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 Ge(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 Je(e,t){if(""!==t||-1===["qFmt","qDec","qThou"].indexOf(e))return t}function Ze(e){var t=e.oldProperties,n=e.newProperties,r=e.model,i=JSON.stringify(o(t,"qHyperCubeDef.qMeasures"),Je)!==JSON.stringify(o(n,"qHyperCubeDef.qMeasures"),Je)||JSON.stringify(o(t,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Je)!==JSON.stringify(o(n,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Je);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):O(t,n,r)}({model:r,oldProperties:t,newProperties:n}).then(function(){return i}):Promise.resolve(i)}function Xe(e){var t=e.modifiers,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some(function(e){return"object"===Me(e)&&!e.disabled&&Le[e.type]&&Le[e.type].needDimension({modifier:e,properties:n,layout:r})})}function Qe(e){var t=He(e),n=[],r=[],i=!1;return t.forEach(function(t){var r=ze(t);if(Ke({modifiers:r,properties:e})){var o=Ue(t);o&&n.push(o),i=i||Xe({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)?(Te[t.id].masterItemSubscriber=Te[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 Ne({model:t,masterItem:e}).then(function(){return t.app.clearUndoBuffer()})}}),Te[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:()=>_e});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 p={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 d=n(8),f=n.n(d);const m=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))},h=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))},y=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&&p.isOrderedSubset(i,r.interColumnSortOrder)&&(r.interColumnSortOrder=i.concat())},g=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){f().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 q=n(909),D=n.n(q);function S(e,t){var n=D()(!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 C(e,t){return D()(!0,{},t,e)}function w(e,t,n){return"function"==typeof e?e(t):Number.isNaN(+e)?n:e}var E=Math.pow(2,53)-1;function I(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 A(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 M=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},L=function(e,t,n){t.hasOwnProperty(e)&&(n[e]=t[e])},k=function(e,t,n,r){t.hasOwnProperty(e)?n[e]=t[e]:n[e]=r},T=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}}},N=function(){return{qDef:{autoSort:!0,cId:"",numFormatFromTemplate:!0},qLibraryId:"",qTrendLines:[]}},O=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=S(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=S(s.excludedDimensions[t],a);o.qDimensions.length<i?o.qDimensions.push(c):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(c)}},P=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=C(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=C(s.excludedMeasures[t],a);o.qMeasures.length<i?o.qMeasures.push(c):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(c)}},F=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=w(a.max,i.dimensions.length,E),l=w(a.min,i.dimensions.length,0);return{maxDimensions:w(o.max,s,E),minDimensions:w(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?(p.indexAdded(n.qInterColumnSortOrder,o),++o):(--o,p.indexRemoved(n.qInterColumnSortOrder,o))},j=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=D()(!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=D()(!0,{},n,i)).components&&(i.components=[]),i},H=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},z=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=[]))},V=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 I(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 I(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)?I(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)})}},_=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 A(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 A(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)?A(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)})}},$=function(e){var t=e.measures,n=e.modifierTypes;t&&n&&f().isSupportedModifiers(n)&&t.forEach(function(e){e.store&&e.store.modifiers&&(e.qDef.modifiers=e.store.modifiers),delete e.store})};function B(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 U={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=[]),m({exportFormat:i,qHyperCubeDef:l}),h({exportFormat:i,qHyperCubeDef:l}),y({exportFormat:i,qHyperCubeDef:l}),delete l.qLayoutExclude,g({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,p=e.supportedFilters,d=void 0===p||p,f=e.isHCModifierSupported,m=void 0===f||f,h={qChildren:[]},y=j({exportFormat:t,initialProperties:r,hypercubePath:c}),g=o.getValue(r,c||"").qHyperCubeDef,v=o.getValue(y,c||"").qHyperCubeDef,b=F({exportFormat:t,dataDefinition:a}),x=b.maxDimensions,q=b.minDimensions,D=b.maxMeasures,S=b.minMeasures,C=l.defaultDimension,w=void 0===C?T():C,E=l.defaultMeasure,I=void 0===E?N():E;v.qDimensions.length=0,v.qMeasures.length=0,H({exportFormat:t,maxDimensions:x,minDimensions:q,maxMeasures:D,minMeasures:S})&&z({exportFormat:t,maxDimensions:x,minDimensions:q,maxMeasures:D,minMeasures:S,newHyperCubeDef:v}),O({exportFormat:t,maxDimensions:x,minDimensions:q,newHyperCubeDef:v,defaultDimension:w}),P({exportFormat:t,maxMeasures:D,minMeasures:S,newHyperCubeDef:v,defaultMeasure:I}),V({newProperties:y,dataDefinition:a,hypercubePath:c}),_({newProperties:y,dataDefinition:a,hypercubePath:c}),R({exportFormat:t,newHyperCubeDef:v}),L("qMaxStackedCells",g,v),L("qNoOfLeftDims",g,v),k("qInitialDataFetch",g,v,[{qTop:0,qLeft:0,qWidth:0,qHeight:0}]),k("qMode",g,v,"S"),k("qReductionMode",g,v,"N"),k("qSortbyYValue",g,v),k("qIndentMode",g,v),k("qShowTotalsAbove",g,v),M(y,t,r),h.qProperty=y;var A=o.getValue(u||{},"support.modifiers");return $({measures:v.qMeasures,modifierTypes:A}),d&&B(h.qProperty,"storedFilters"),"S"===v.qMode&&m&&B(h.qProperty,"dynamicScript"),h}};var W={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};function K(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 Y(e,t){return e.length!==t}const G={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(K(a,t,r,i),Y(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"}},J={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}},Z={colorModeOptions:{primary:function(){return!0},dimension:function(e){return J.getNumDimensions(e)>0&&J.getNumMeasures(e)<=1},multiColor:function(e){return J.getNumMeasures(e)>1},measure:function(e){return J.getNumDimensions(e)>0},expression:function(e){return J.getNumMeasures(e)>=1}}},X={colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return J.getNumMeasures(e)>=1}}};var Q={scatterplot:X,"sn-scatter-plot":X,piechart:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return J.getNumMeasures(e)>=1}}},linechart:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return J.getNumDimensions(e)>1},multiColor:function(e){return J.getNumMeasures(e)>1},measure:function(e){return J.getNumDimensions(e)<=1},expression:function(e){return J.getNumMeasures(e)>=1}}},map:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return J.getNumDimensions(e)>=1},multiColor:function(e){return J.getNumMeasures(e)>1},measure:function(e){return J.getNumDimensions(e)>=1},expression:function(e){return J.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 J.getNumDimensions(e)>=1}}}};function ee(e,t,n){if(Array.isArray(e[t])){var r=p.findIndexByPropertyValue(e[t],"id",n);r>=0&&e[t].splice(r,1)}else e[t]=[]}function te(e,t){var n=G.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"),d=o.getValue(t,"color.formatting.isCustomFormatted");if(c){var f=G.create(G.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:f,label:s,item:c,isDimension:n,qNumFormat:u,isCustomFormatted:d});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=p.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:f,measures:a,item:c,isDimension:n,qNumFormat:u,isCustomFormatted:d})}n?(f.qSortBy={qSortByAscii:1},l.qAttributeDimensions.push(f)):l.qAttributeExpressions.push(f)}}}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:f().measureBase.getLibraryId(e)}(n,t),i?(s.type="measure",s.name=i,s.id=i,o=function(e,t){return f().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=J.getItemLabel(t);switch(ne(e,s||""),i){case"field":a="byDimension",o.byDimDef={label:t.label||J.wrapFieldName(t.name),key:J.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=G.IDMAP.COLOR_BY_ALTERNATIVE,a=p.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]||Z).colorModeOptions||Z.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))},pe=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=G.IDMAP.COLOR_BY_ALTERNATIVE,s=p.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)},de=function(e){e.forEach(function(e){e.qOtherTotalSpec&&"qTotalMode"in e.qOtherTotalSpec&&delete e.qOtherTotalSpec.qTotalMode})},fe=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},me=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)},he=function(e){o.setValue(e,"color.mode","primary"),o.setValue(e,"color.auto",!0)},ye=function(e){var t=o.getValue(e,"qHyperCubeDef.qDimensions",[]),n=o.getValue(e,"color.persistent",!1);return t.length>1&&!n},ge={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=U.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),o=i.data[0],a=o.dimensions.concat(o.excludedDimensions),s=o.measures.concat(o.excludedMeasures),l=G.IDMAP,c=l.COLOR_BY_ALTERNATIVE,u=l.COLOR_BY_EXPRESSION;return G.moveByIdFromGroup(a,[],"qAttributeDimensions",c),G.moveByIdFromGroup(a,[],"qAttributeExpressions",c),G.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=U.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:a,extension:s,supportedFilters:l,isHCModifierSupported:c}),p=u.qProperty,d=o.getValue(p,"visualization"),f=o.getValue(p,"qHyperCubeDef.qDimensions",[]),m=o.getValue(p,"color.mode",""),h=o.getValue(p,"color.auto",""),y=ce(p,d),g=ue({canColorBy:y,autoColor:h,colorMode:m,dimensions:f});return y[m]?fe({shouldUpdateColorBy:g,properties:p})&&me(p):he(p),g&&pe(p,"qHyperCubeDef."),ye(p)&&le(p,"color.persistent",!0),de(f),u}};var ve=["bar","marker","line"];const be=function(e){var t=e.initialProperties,n=e.properties;t.measureAxis&&void 0===t.measureAxis.autoMinMax?B(n,"unsupportedAutoMinMax")||D()(n.measureAxis,t.measureAxis):B(n,"supportedAutoMinMax")||D()(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]&&D()(s,n.properties.measureAxes[t[0].axis])):D()(s,n.properties.measureAxes[0])}},qe=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}}},De={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=e.supportedAutoMinMax,o=void 0===i||i,a=ge.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=ge.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:o,extension:s,supportedFilters:l,isHCModifierSupported:c}),p=u.qProperty;return be({initialProperties:n,properties:p}),xe({exportFormat:t,initialProperties:n,properties:p,measureType:a}),qe(p.qHyperCubeDef),p.qHyperCubeDef.qColumnOrder=[],p.qHyperCubeDef.columnOrder=[],u}};function Se(e,t,n){return"qLayoutExclude.quarantine.".concat(e,".").concat(t,".").concat(n)}function Ce(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=Se(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 we(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=Se(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 Ee="qHyperCubeDef.qMeasures",Ie="conditionalColoring",Ae="measures",Me="qDef.conditionalColoring";const Le={quarantine:function(e){Ce({properties:e,arrayPath:Ee,quarantineName:Ie,arrayName:Ae,itemPath:Me})},unquarantine:function(e){we({properties:e,arrayPath:Ee,itemPath:Me,arrayName:Ae,quarantineName:Ie})}};var ke="qHyperCubeDef.qMeasures",Te="measures",Ne="qHyperCubeDef.qDimensions",Oe="dimensions",Pe="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",Fe="alternativeMeasures",Re="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",je="alternativeDimensions",He="qCalcCondition",ze="conditionalShowHide";const Ve={quarantine:function(e){Ce({properties:e,arrayPath:ke,quarantineName:ze,arrayName:Te,itemPath:He}),Ce({properties:e,arrayPath:Ne,quarantineName:ze,arrayName:Oe,itemPath:He})},unquarantine:function(e){we({properties:e,arrayPath:ke,quarantineName:ze,arrayName:Te,itemPath:He}),we({properties:e,arrayPath:Ne,quarantineName:ze,arrayName:Oe,itemPath:He})},quarantineAlternative:function(e){Ce({properties:e,arrayPath:Pe,quarantineName:ze,arrayName:Fe,itemPath:He}),Ce({properties:e,arrayPath:Re,quarantineName:ze,arrayName:je,itemPath:He})},unquarantineAlternative:function(e){we({properties:e,arrayPath:Pe,quarantineName:ze,arrayName:Fe,itemPath:He}),we({properties:e,arrayPath:Re,quarantineName:ze,arrayName:je,itemPath:He})}},_e={hypercube:U,colorChart:ge,axisChart:De,quarantineProperty:x,unquarantineProperty:B,quarantineArrayProp:Ce,unquarantineArrayProp:we,conditionalColoring:Le,conditionalShow:Ve}})(),r.default})()),fc.exports),hc=cs(mc);const yc={setValue(e,t,n){if(!t)return;const r=t.split(".");let i=e;const o=r[r.length-1];let a;for(a=0;a<r.length-1;++a)null==i[r[a]]&&(i[r[a]]=Number.isNaN(+r[a+1])?{}:[]),i=i[r[a]];void 0!==n?i[o]=n:delete i[o]},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(null==o[r[i]])return n;o=o[r[i]]}return o}},gc={getDimensions:e=>yc.getValue(e,"qHyperCubeDef.qDimensions",[]),getNumDimensions:e=>yc.getValue(e,"qHyperCubeDef.qDimensions.length",0),getMeasures:e=>yc.getValue(e,"qHyperCubeDef.qMeasures",[]),getNumMeasures:e=>yc.getValue(e,"qHyperCubeDef.qMeasures.length",0),getDimensionLayouts(e,t){const n=yc.getValue(e,t?`${t}.qHyperCube`:"qHyperCube",null);return n?n.qDimensionInfo:[]},getDimensionLayout(e,t,n){return this.getDimensionLayouts(t,n).filter(t=>e===t.cId)[0]},getMeasureLayouts(e,t){const n=yc.getValue(e,t?`${t}.qHyperCube`:"qHyperCube",null);return n?n.qMeasureInfo:[]},getMeasureLayout(e,t,n){return this.getMeasureLayouts(t,n).filter(t=>e===t.cId)[0]}};const vc={colorModeOptions:{primary:()=>!0,dimension:()=>!0,multiColor:()=>!1,measure:()=>!0,expression:e=>gc.getNumMeasures(e)>=1},showLegend:e=>{const t=yc.getValue(e,"color.auto"),n=yc.getValue(e,"color.expressionIsColor"),r=yc.getValue(e,"color.mode");return!(!t&&"primary"===r||!t&&"byExpression"===r&&(n||void 0===n))},persistentColorsShow:e=>!yc.getValue(e,"color.auto")&&"byDimension"===yc.getValue(e,"color.mode"),useDimValColShow:e=>(void 0===yc.getValue(e,"color.useDimColVal")&&yc.setValue(e,"color.useDimColVal",!1),!yc.getValue(e,"color.auto")&&"byDimension"===yc.getValue(e,"color.mode")&&"libraryItem"===yc.getValue(e,"color.byDimDef.type"))},bc=function(e){const{colorModeOptions:t,persistentColorsShow:n,useDimValColShow:r,showLegend:i}=vc;this.color={colorMode:{options(n){const r=[];return"explore"===e&&r.push({value:"auto",translation:"Common.Auto"}),r.push({value:"primary",translation:"properties.colorMode.primary"}),r.push({value:"byDimension",translation:"properties.colorMode.byDimension"}),r.push({value:"byMeasure",translation:"properties.colorMode.byMeasure"}),t.expression(n)&&"explore"!==e&&r.push({value:"byExpression",translation:"properties.colorMode.byExpression"}),r}},persistentColors:{show:e=>r(e)?n(e)&&!yc.getValue(e,"color.useDimColVal"):n(e)},useDimColVal:{show:r}},this.legend={show:i,showTitle:{show(e){const t=yc.getValue(e,"color.auto");return yc.getValue(e,"legend.show")&&i(e)&&(t||!function(e){return"byExpression"===yc.getValue(e,"color.mode")&&!0===yc.getValue(e,"color.expressionIsColor")}(e))}},dock:{show:e=>yc.getValue(e,"legend.show")&&i(e)}}};function xc(e){return new bc(e)}const qc={classification:{section:"styling",tags:["simple"],exclusive:!0},component:"items",show:!0,chartType:"piechart",translation:"LayerStyleEditor.component.styling",chartTitle:"Object.PieChart",subtitle:"LayerStyleEditor.component.styling",useGeneral:!0,items:{strokeSection:{translation:"properties.Outline",component:"items",items:{strokeItem:{component:"items",ref:"components",key:"slices",items:{strokeWrapper:{component:"inline-wrapper",items:{strokeWidth:{translation:"LayerStyleEditor.style.strokeWidth",ref:"style.strokeWidth",width:9,show:!0,component:"dropdown",type:"string",options:[{value:"none",translation:"Common.None"},{value:"small",translation:"Common.Small"},{value:"medium",translation:"Common.Medium"},{value:"large",translation:"Common.Large"}],defaultValue:"none",schemaIgnore:!0},strokeColor:{ref:"style.strokeColor",defaultValue:{color:"#FFFFFF"},schemaIgnore:!0,width:3,component:"color-picker"}}}}}}},cornerRadius:{component:"items",translation:"LayerStyleEditor.style.cornerRadius",items:{cornerRadiusItem:{component:"items",ref:"components",key:"slices",items:{cornerRadiusSlider:{ref:"style.cornerRadius",translation:"LayerStyleEditor.style.cornerRadius",component:"slider",min:0,max:40,step:.05,width:12,defaultValue:0,schemaIgnore:!0}}}}},innerRadius:{translation:"LayerStyleEditor.style.innerRadius",component:"items",show:e=>e.donut.showAsDonut,items:{innerRadiusItem:{component:"items",ref:"components",key:"slices",items:{innerRadiusSlider:{ref:"style.innerRadius",translation:"LayerStyleEditor.style.innerRadius",component:"slider",min:.05,max:.75,step:.01,width:12,defaultValue:.55,schemaIgnore:!0}}}}}}},Dc=(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.pieChart",e,"color")})}}}}},Sc=(e,t,n,r)=>{const i=function({theme:e,translator:t,config:n={}}){const{id:r,paths:i}=function({config:e={}}){const{id:t,paths:n}=e;return{id:void 0===t?sn:`${sn}.${t}`,paths:Array.isArray(n)?n:[]}}({config:n}),o={};i.forEach(n=>{const i=n.split(".");yn(i);let a=o;for(let o=0;o<i.length;o++){const s=i[o];o===i.length-1?a[s]=mn({theme:e,translator:t,id:r,path:n}):void 0===a[s]&&(a[s]={}),a=a[s]}});const a=e=>{const t=e.split(".");yn(t);let n=o;for(let r=0;r<t.length;r++){const i=t[r];if(void 0===n[i])throw new Error(`font-resolver: Path '${e}' could not be resolved.`);n=n[i]}return n};return o.getDefaultValue=e=>a(e).getDefaultValue(),o.getOptions=e=>a(e).getOptions(),o}({theme:r,translator:n,config:{id:"pieChart",paths:["axis.title","label.name","label.value","legend.title","legend.label"]}});return{component:"styling-panel",chartTitle:"Object.PieChart",translation:"LayerStyleEditor.component.styling",subtitle:"LayerStyleEditor.component.styling",useGeneral:!0,useBackground:e,items:{strokeSection:{translation:"properties.Outline",component:"panel-section",items:{strokeItem:{component:"items",ref:"components",key:"slices",items:{strokeWrapper:{component:"inline-wrapper",items:{strokeWidth:{ref:"style.strokeWidth",width:9,show:!0,component:"dropdown",type:"string",options:[{value:"none",translation:"Common.None"},{value:"small",translation:"Common.Small"},{value:"medium",translation:"Common.Medium"},{value:"large",translation:"Common.Large"}],defaultValue:"none",schemaIgnore:!0},strokeColor:{ref:"style.strokeColor",defaultValue:{color:"#FFFFFF"},schemaIgnore:!0,width:3,component:"color-picker"}}}}}}},cornerRadius:{translation:"LayerStyleEditor.style.cornerRadius",component:"panel-section",items:{cornerRadiusItem:{component:"items",ref:"components",key:"slices",items:{cornerRadiusSlider:{ref:"style.cornerRadius",component:"slider",min:0,max:40,step:.05,width:12,defaultValue:0,schemaIgnore:!0}}}}},innerRadius:{translation:"LayerStyleEditor.style.innerRadius",component:"panel-section",show:e=>e.donut.showAsDonut,items:{innerRadiusItem:{component:"items",ref:"components",key:"slices",items:{innerRadiusSlider:{ref:"style.innerRadius",component:"slider",min:.05,max:.75,step:.01,width:12,defaultValue:.55,schemaIgnore:!0}}}}},axisTitleSection:t?.isEnabled("CLIENT_IM_3050")?{translation:"properties.dataPoints.dimensionlabels",component:"panel-section",items:{axisTitleItems:{component:"items",ref:"components",key:"axis",items:Dc("axis.title",i,r)}}}:void 0,labelNameSection:t?.isEnabled("CLIENT_IM_3050")?{translation:"properties.dataPoints.dimensionValueLabel",component:"panel-section",items:{labelItems:{component:"items",ref:"components",key:"label",items:Dc("label.name",i,r)}}}:void 0,labelValueSection:t?.isEnabled("CLIENT_IM_3050")?{translation:"properties.value.label",component:"panel-section",items:{labelItems:{component:"items",ref:"components",key:"label",items:Dc("label.value",i,r)}}}:void 0,legendTitleSection:t?.isEnabled("CLIENT_IM_3051")?{translation:"properties.legend.title",component:"panel-section",items:{labelItems:{component:"items",ref:"components",key:"legend",items:Dc("legend.title",i,r)}}}:void 0,legendLabelSection:t?.isEnabled("CLIENT_IM_3051")?{translation:"properties.legend.label",component:"panel-section",items:{labelItems:{component:"items",ref:"components",key:"legend",items:Dc("legend.label",i,r)}}}:void 0}}},Cc=xc("hard");const wc=e=>{e.color?.auto||(pi(e,"color.mode","byDimension"),pi(e,"color.byDimDef.activeDimensionIndex",0),pi(e,"color.persistent",!1))},Ec=e=>{const t=[{value:"primary",translation:"properties.colorMode.primary"},{value:"byDimension",translation:"properties.colorMode.byDimension"}];switch(e.color?.mode){case"byMultiple":t.push({value:"byMultiple",translation:"properties.colorMode.multicolored"});break;case"byMeasure":t.push({value:"byMeasure",translation:"properties.colorMode.byMeasure"});break;case"byExpression":t.push({value:"byExpression",translation:"properties.colorMode.byExpression"})}return t},Ic=e=>{const{flags:t,translator:n}=e||{},r=e?.sense?.theme,i=t?.isEnabled("SENSECLIENT_IM_2429_PIECHART_BG"),o=t?.isEnabled("TLV_1804_DEFAULT_CHART_SETTINGS"),a={items:{simpleItems:{items:{autoColor:{label:e=>e.color?.auto?n.get("Simple.Color.Auto",n.get("properties.colorMode.byDimension")):n.get("Common.Custom"),change:wc},colorMode:{options:Ec}}}}},s={items:{labels:{items:{header:{show:e=>e.qHyperCubeDef.qDimensions.length&&e.qHyperCubeDef.qMeasures.length},pointLabels:{component:"checkbox",ref:"dataPoint.auto",type:"boolean",defaultValue:!0,translation:"Simple.Label.Value",show:e=>e.qHyperCubeDef.qDimensions.length&&e.qHyperCubeDef.qMeasures.length,change(e){e.dataPoint.auto||pi(e,"dataPoint.labelMode","none")}},dimensionTitle:{component:"checkbox",ref:"dimensionTitle",type:"string",translation:"Simple.Label.Dimension.Hide",defaultValue:"all",show:e=>e.qHyperCubeDef.qDimensions.length&&e.qHyperCubeDef.qMeasures.length,convertFunctions:{get:(e,t,n,r)=>!r.dimensionTitle,set(e,t,n,r,i){i.dimensionTitle=!e}}}}}}},l={uses:"settings",items:{simpleStyling:qc,simpleLabels:s,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:Sc(i,t,n,r),showAsDonut:{ref:"donut.showAsDonut",type:"boolean",component:"item-selection-list",defaultValue:!1,horizontal:!0,items:[{icon:"pie_chart_pie",component:"icon-item",labelPlacement:"bottom",translation:"properties.pie",value:!1},{icon:"pie_chart_donut",component:"icon-item",labelPlacement:"bottom",translation:"properties.donut",value:!0}]},labels:{type:"items",snapshot:{tid:"property-labels"},items:{dimensionTitle:{ref:"dimensionTitle",type:"boolean",component:"switch",translation:"properties.dataPoints.dimensionlabels",defaultValue:!o,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}]},valuesAuto:{ref:"dataPoint.auto",type:"boolean",translation:"properties.dataPoints.labelmode",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},labelMode:{ref:"dataPoint.labelMode",type:"string",component:"dropdown",options:[{value:"none",translation:"Common.None"},{value:"share",translation:"properties.dataPoints.labelmode.share"},{value:"value",translation:"properties.dataPoints.labelmode.value"}],defaultValue:"share",show:e=>!e.dataPoint.auto},labelValueMode:{ref:"dataPoint.labelValueMode",type:"string",component:"dropdown",translation:"properties.dataPoints.labelvaluemode",options:[{value:"arc",translation:"Visualizations.Descriptions.Angle"},{value:"radius",translation:"Visualizations.Descriptions.Radius"}],defaultValue:"arc",show:e=>!e.dataPoint.auto&&function(e){return e.qHyperCubeDef&&e.qHyperCubeDef.qMeasures.length>1||e.qHyperCube&&e.qHyperCube.qMeasureInfo.length>1}(e)&&"value"===e.dataPoint.labelMode}}}}},colorsAndLegend:{uses:"colorsAndLegend",items:{colors:{items:{colorMode:{options:Cc.color.colorMode.options},persistentColors:{show:Cc.color.persistentColors.show}}},simpleColors:a,legend:{show:Cc.legend.show,items:{show:{defaultValue:!1,snapshot:{tid:"property-legend"}},showTitle:{show:Cc.legend.showTitle.show},dock:{show:Cc.legend.dock.show}}}}},tooltip:{uses:"tooltip"}}};return l},Ac={uses:"data",items:{dimensions:{uses:"dimensions"},measures:{uses:"measures",items:{numberFormatting:{items:{percentOfPieMessage:{component:"text",translation:"properties.numberFormatting.pieMessage",show:(e,t,{properties:n}={})=>n&&(n.dataPoint.auto||"share"!==n.dataPoint.labelMode)}}}}}}},Mc={uses:"sorting",items:{interColumnSorting:{reset:e=>{const{qDimensions:t,qMeasures:n,qInterColumnSortOrder:r}=e.qHyperCubeDef;if(1===t.length&&n.length>=1){const t=r.length,n=[...Array(t).keys()];[n[0],n[1]]=[n[1],n[0]],e.qHyperCubeDef.qInterColumnSortOrder=n}}}}},Lc={type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{suppressZero:null,calcCond:{uses:"calcCond"}}}}};function kc(e){return{type:"items",component:"accordion",items:{data:Ac,sorting:Mc,addons:Lc,settings:Ic(e)}}}const Tc=xc("explore"),Nc=kc();var Oc={type:"items",component:"accordion",items:{data:{uses:"data"},sort:{uses:"sort"},presentation:{uses:"presentation",items:{showAsDonut:Nc.items.settings.items.presentation.items.showAsDonut,labelMode:{type:"items",items:{labelMode:{type:"string",component:"radio-list",translation:"properties.dataPoints.labelmode",diffs:["dataPoint.auto:false","dataPoint.labelMode"],options:Nc.items.settings.items.presentation.items.labels.items.labelMode.options,setPropertyValue(e,t){e.dataPoint.auto=!1,e.dataPoint.labelMode=t},getValue:e=>e.dataPoint.auto?"":e.dataPoint.labelMode}}}}},color:{uses:"color",items:{mode:{options:Tc.color.colorMode.options},dimension:{items:{persistentColors:{show:e=>!(e.color&&"byDimension"===e.color.mode&&e.color.useDimColVal&&Tc.color.useDimColVal.show(e))}}}}}}};const Pc="slices";function Fc(e,t){const n=e&&e.desc&&void 0!==e.desc.share?e.desc.share:void 0;return t("share")(n)}function Rc(e){return e.data.num.label}function jc(e){return e.data.radius.label}function Hc(e,t,n,r){return function(e,t){if(e.dataPoint.auto)return 1===e.qHyperCube.qSize.qcy?Rc:Fc;if("share"===e.dataPoint.labelMode)return Fc;if("value"===e.dataPoint.labelMode)return t.encodings.slice.outerRadius&&"radius"===e.dataPoint.labelValueMode?jc:Rc;return Rc}(n,r)(e,t)}function zc(e){let t;return t=e.data.label?function(e,t){let n=e;return n.length>t&&(n=`${n.substr(0,t-3)}...`),n}(e.data.label,20):"",t}class Vc{constructor({element:e,properties:t,effectHelper:n,Flag:r}){this.element=e,this.Flag=r,n.initFade(this.element);const i=e.find(".effectLayer");i.length>0&&i.remove(),e.append('<div class="effectLayer"></div>'),this.effectLayer=e.find(".effectLayer"),this._effectProperties=t,this.selectedIndex=t.selectedIndex,this.hasPropertiesPanel=!1,this.effectApplied=!0,n.fadeIn(this.element)}updateOrigSettings(e){return{dataPoint:e.dataPoint,legend:e.legend,dimensionTitle:e.dimensionTitle}}updateFlags(e,t){const n=this.chart.getAffectedShapes("highlight"),r=this.effectLayer[0].getBoundingClientRect(),i=n.map(n=>{const{start:i,end:o,outerRadius:a,offset:s}=n.desc.slice,{scaleRatio:l}=this.chart.component(n.key).rect,c=n.element.getBoundingClientRect(),u=(i+o)/2,p=c.left-r.left+l.x*(s.x+a*Math.sin(u)),d=c.top-r.top+l.y*(s.y-a*Math.cos(u)),f=Math.cos(u)>0?"top":"bottom",m=Math.sin(u)>0?"right":"left";return{title:zc(n),label:Hc(n,this.chart.formatter,e,t),orientation:`${f}${m}`,position:{x:p,y:d}}});this.Flag.show(this.effectLayer,i)}init(e,t,n,r){return t.getProperties().then(e=>{if(!e.originalModelSettings){const t=vs(!0,{},e);e.originalModelSettings=this.updateOrigSettings(t)}e.effectProperties=r,e.effectPath=n,e.dataPoint.show=!1,e.legend.show=!1,e.dimensionTitle=!1,t.setProperties(e)})}remove(e,t,n){return e.options=vs(e.options,{effect:null}),n?t.getProperties().then(e=>vs(e,{effectPath:null,effectProperties:null,dataPoint:vs(!0,{},e.originalModelSettings.dataPoint),legend:vs(!0,{},e.originalModelSettings.legend),dimensionTitle:e.originalModelSettings.dimensionTitle})):Promise.resolve()}}class _c extends Vc{init(e,t,n,r){return e.options=vs(!0,e.options,{effect:this}),t.layout.effectProperties&&t.layout.effectPath===n&&t.layout.effectProperties.max===r.max?Promise.resolve():super.init(e,t,n,r)}update(e,t,n){this.chart=t,this.updateHighlight(e),this.updateFlags(e,n)}updateHighlight(e){const t=this.chart.component(Pc).data.items,n=e.effectProperties.min,r=e.effectProperties.max,i=[];let o=[1/0,-1],a=[-1/0,-1];t.forEach((e,t)=>{const i=e.num.value;n&&i<o[0]&&(o=[i,t]),r&&i>a[0]&&(a=[i,t])}),-1!==o[1]&&i.push(t[o[1]].value),-1!==a[1]&&i.push(t[a[1]].value),i.length&&this.chart.brush("highlight").setValues(i.map(e=>({key:"qHyperCube/qDimensionInfo/0",value:e})))}}class $c extends Vc{constructor(e){super(e),this.hasPropertiesPanel=!0,this.propsTemplate=e.highlightValuePropsTemplate,this.effectHelper=e.effectHelper}onClick(e){if(!this.chart)return;const t=this.chart.shapesAt(function(e,t){const n=t.element.getBoundingClientRect();return{x:e.clientX-n.left,y:e.clientY-n.top}}(e,this.chart),{propagation:"stop"});if(1!==t.length)return;const n=t[0],r=this.chart.component(Pc).data.items.map(e=>e.value).indexOf(n.data.value);-1!==r&&(this.selectedIndex=r,this.effectHelper.updateSelectedPointIndex(this))}update(e,t,n){this.chart=t,this.updateHighlight(e),this.updateDataPoints(e,n),this.updateFlags(e,n)}updateHighlight(e){const t=this.chart.component(Pc).data.items[e.effectProperties.selectedIndex];this.chart.brush("highlight").setValues([{key:"qHyperCube/qDimensionInfo/0",value:t.value}])}updateDataPoints(e,t){this.dataPoints=this.chart.findShapes("path").filter(e=>e.key===Pc).map((n,r)=>{const i=Hc(n,this.chart.formatter,e,t);return{text:`${zc(n)} (${i})`,value:r}})}init(e,t,n,r){return e.options=vs(!0,e.options,{effect:this}),t.layout.effectProperties&&t.layout.effectPath===n&&t.layout.effectProperties.selectedIndex===r.selectedIndex?Promise.resolve():super.init(e,t,n,r)}}const Bc="/effects/highlight-value",Uc="/effects/maxmin";var Wc={isCompatible:({effectPath:e})=>e===Uc||e===Bc,create:e=>e.effectPath===Uc?new _c(e):e.effectPath===Bc?new $c(e):null};function Kc(e){const t={},{components:n,tooltip:r}=e,i=n?n.filter(e=>"slices"===e.key)[0]:void 0;if(i&&i.style&&Object.keys(i.style).forEach(e=>{t[`chart_style_${e}`]=i.style[e]}),r){t.chart_tooltip_custom=!r.auto;const e=r.chart?.object?.refId;!r.auto&&e&&(t.chart_tooltip_custom_mini_chart=e)}return t}function Yc(e){if(!e.qHyperCubeDef)return;const t=e.qHyperCubeDef.qDimensions,n=e.qHyperCubeDef.qMeasures;1===t.length&&1===n.length&&(n[0].qSortBy.qSortByNumeric=-1,e.qHyperCubeDef.qInterColumnSortOrder.splice(0,e.qHyperCubeDef.qInterColumnSortOrder.length,1,0))}function Gc(e){e.qOtherTotalSpec.qOtherMode="OTHER_COUNTED",e.qOtherTotalSpec.qOtherCounted={qv:"10"}}function Jc({translator:e}){return{dimensions:{min:1,max:1,description:()=>e.get("Visualizations.Descriptions.Slice"),add(e,t){Gc(e),Yc(t),fl.addCallbackCustomTooltip(t)},move(e,t){Gc(e),Yc(t),fl.moveCallbackCustomTooltip(t,e)},remove(e,t){fl.removeCallbackCustomTooltip(t,e)},replace(e,t,n,r){Gc(e),Yc(r),fl.replaceCallbackCustomTooltip(r,t)}},measures:{min:1,max:2,description:(t,n)=>e.get(0===n?"Visualizations.Descriptions.Angle":"Visualizations.Descriptions.Radius"),add(e,t){Yc(t)},remove(e,t){!function(e){if(!e.qHyperCubeDef)return;const t=e.qHyperCubeDef.qMeasures,{mode:n}=e.color;"byExpression"===n&&0===t.length&&(e.color.mode="primary")}(t)}}}}const Zc=e=>e.qMax<=0,Xc=e=>!(!(e&&e.qHyperCube.qSize.qcy>0)||e.qHyperCube.qMeasureInfo.every(Zc));function Qc(e){const t={definition:kc(e),softDefinition:Oc,support:{snapshot:Xc,export:Xc,exportData:!0,sharing:Xc,viewData:!0,effects:!0},effects:Wc,extendMetrics:Kc,importProperties:(t,n,r,i)=>{const o={layout:{templateId:n.templateId}};r.mapProperties(o);const a={defaultDimension:r.getDefaultDimensionProperties(),defaultMeasure:r.getDefaultMeasureProperties()},s=hc.colorChart.importProperties({exportFormat:t,initialProperties:n,dataDefinition:Jc(e),defaultPropertyValues:a,hypercubePath:i});return s.qProperty.dataPoint&&!1===s.qProperty.dataPoint.show&&delete s.qProperty.dataPoint.show,s},exportProperties:(t,n,r,i)=>{const o=function(e){return(t,n,r,i)=>{const{translator:o,localeInfo:a}=e||{},s=hc.colorChart.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r});if(r){const e=ws.getValue(s,"properties.qHyperCubeDef.qMeasures");if(!e||0===e.length)return s;const t=e[0],n=o?.get("properties.dataPoints.labelmode.share")||"Share",r=i||a,l=r?.qDecimalSep||".",c={qDef:{qDef:"=If(Column(1) >= 0, Column(1))",qLabel:n,qNumFormat:{qType:"F",qnDec:2,qUseThou:0,qFmt:`0${l}0%`,qDec:l,qThou:r?.qThousandSep||","},qAggrFunc:"Sum",qRelative:!0,qExpressions:[],qLabelExpression:"",cId:ws.generateId()},qLibraryId:"",qAttributeExpressions:[],qAttributeDimensions:[]},u=vs(!0,{},t,c);e.push(u);const p=ws.getValue(s,"data.0.measures",[]);if(p?.length>0){const e=p[0],t=vs(!0,{},e,c);p.push(t)}}return s}}(e);return o(t,n,r,i)}};return t}function eu(e){return{version:"2.11.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:[{key:"slices",style:{strokeWidth:"none",strokeColor:{index:-1,color:Nl.STROKE.COLOR},cornerRadius:Nl.CORNER_RADIUS,innerRadius:Nl.INNER_RADIUS}}],dataPoint:{auto:!0,labelMode:"share",labelValueMode:"arc"},dimensionTitle:!e.flags.isEnabled("TLV_1804_DEFAULT_CHART_SETTINGS"),donut:{showAsDonut:!1},footnote:"",legend:{dock:"auto",show:!e.flags.isEnabled("TLV_1804_DEFAULT_CHART_SETTINGS"),showTitle:!0},qHyperCubeDef:{qDimensions:[],qMeasures:[],qInitialDataFetch:[{qWidth:10,qHeight:500}],qSuppressMissing:!0,qSuppressZero:!1,qMode:"S"},showDetails:!0,showDisclaimer:!0,showTitles:!0,subtitle:"",title:"",tooltip:{auto:!0,hideBasic:!1,data:{qHyperCubeDef:void 0},chart:void 0,imageComponents:void 0}}}function tu(e){return{properties:{...eu(e)},data:{targets:[Jc(e)]},importProperties:({exportFormat:t,initialProperties:n,hypercubePath:r})=>{const i=hc.colorChart.importProperties({exportFormat:t,initialProperties:n,dataDefinition:Jc(e),hypercubePath:r});return i.qProperty.dataPoint&&!1===i.qProperty.dataPoint.show&&delete i.qProperty.dataPoint.show,i},exportProperties:({propertyTree:e,hypercubePath:t,viewDataMode:n})=>hc.colorChart.exportProperties({propertyTree:e,hypercubePath:t,viewDataMode:n})}}const nu=i=>{const{flags:o}=i;!function(e){if(e&&e.get&&e.add){const t="Object.Disclaimer.LimitedData";if(e.get(t)!==t)return;Object.keys(z).forEach(t=>{e.add(z[t])})}}(i.translator);const a=function(){const i=t();return i.use(n),i.use(r(e)),i.renderer("react-qcm",et),i.component("axis-title",Ke),i.component("disclaimer",Ge),i.component("pie-dividers",tn),i.component("negative-indicators",an),i}();return{qae:tu(i),ext:Qc(i),component(){const e=function({picasso:e}){const t=x(),n=q(),r=D(),[i,o]=S(),a=ms(),s=C(),l=w(),c=!!s.qSelectionInfo?.qInSelections,[u,p]=S(!1);return a.lasso=function({layout:e,isInSelections:t,isLassoActionActive:n,setIsLassoActionActive:r,translator:i}){return{active:n,label:i.get(n?"Tooltip.ToggleOffLassoSelection":"Tooltip.ToggleOnLassoSelection"),hidden:!t||!!e.qHyperCube?.qDimensionInfo?.[0]?.qIsOneAndOnlyOne,action(e){r("boolean"==typeof e?e:!n)},icon:{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"}}]}}}({layout:s,isInSelections:c,isLassoActionActive:u,setIsLassoActionActive:p,translator:l}),E(()=>(i&&(i.interactions.lasso.active=()=>u),{...a.lasso}),[i,u,c,l.language()]),I(()=>{n.style.overflow="hidden";const i=e({renderer:{prio:[t.renderer||"canvas"]}}),l=i.chart({element:n,data:[],settings:{}}),c=ba({chart:l,actions:a,selections:r,config:{selectionActions:!1}});c.setLayout(s),c.setBrushAliases({colorField:"qDimensionInfo/0/qAttrDimInfo/0"});const u=function(){const e={...{legendScrollOffset:0,rotation:0}},t={},n={};let r=!1;const i={get:t=>e[t],set:(i,o)=>{const a=e[i];!r&&t[i]?e[i]=t[i](o,a):e[i]=o,!r&&n[i]&&n[i](e[i],a)},preventSet:(e,t)=>{r=!0,i.set(e,t),r=!1},intercept:(e,n)=>{t[e]=n},onChanged:(e,t)=>{n[e]=t}};return i}();u.intercept("rotation",e=>(u.get("rotation")+e)%(2*Math.PI)),u.onChanged("rotation",()=>{l.update({partialData:!0})});const p=di();return a.on("selections-start",()=>{l.brush("selection").start()}),o({picasso:i,chart:l,selectionService:c,viewState:u,viewCache:p,interactions:a}),()=>{c.destroy(),l.destroy(),a.removeAllListeners(),delete a.select,u.intercept("rotation",void 0),u.onChanged("rotation",void 0)}},[]),i}({picasso:a}),t=wl({flags:o,picasso:a,instance:e});uc({instance:e,services:t,picasso:a,env:i}),function({instance:e}){const t=L(),n=x(),r=R();I(()=>{if(!e||!e.generateSettings)return;const{viewCache:r,chart:i,generateSettings:o}=e;i.update({settings:o()}),r.set("chartWidth",i.element.clientWidth),r.set("chartHeight",i.element.clientHeight),n.effect&&n.effect.update(t,i)},[r.width,r.height])}({instance:e}),pc({instance:e,services:t})}}};export{nu as default};
|