@quillsql/react 2.12.53 → 2.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/dist/cjs/ChartBuilder.d.ts.map +1 -1
  2. package/dist/cjs/ChartBuilder.js +4 -4
  3. package/dist/cjs/ChartEditor.d.ts.map +1 -1
  4. package/dist/cjs/ChartEditor.js +10 -10
  5. package/dist/cjs/Context.d.ts +13 -1
  6. package/dist/cjs/Context.d.ts.map +1 -1
  7. package/dist/cjs/Context.js +114 -17
  8. package/dist/cjs/Dashboard.d.ts.map +1 -1
  9. package/dist/cjs/Dashboard.js +107 -313
  10. package/dist/cjs/DateRangePicker/QuillDateRangePicker.d.ts.map +1 -1
  11. package/dist/cjs/DateRangePicker/QuillDateRangePicker.js +14 -6
  12. package/dist/cjs/ReportBuilder.d.ts.map +1 -1
  13. package/dist/cjs/ReportBuilder.js +13 -7
  14. package/dist/cjs/SQLEditor.d.ts.map +1 -1
  15. package/dist/cjs/SQLEditor.js +6 -5
  16. package/dist/cjs/components/Dashboard/DashboardFilter.d.ts +2 -1
  17. package/dist/cjs/components/Dashboard/DashboardFilter.d.ts.map +1 -1
  18. package/dist/cjs/components/Dashboard/DashboardFilter.js +7 -7
  19. package/dist/cjs/components/Dashboard/DataLoader.d.ts.map +1 -1
  20. package/dist/cjs/components/Dashboard/DataLoader.js +36 -3
  21. package/dist/cjs/components/QuillMultiSelect.js +1 -1
  22. package/dist/cjs/components/QuillMultiSelectWithCombo.js +1 -1
  23. package/dist/cjs/components/QuillSelect.d.ts +1 -1
  24. package/dist/cjs/components/QuillSelect.d.ts.map +1 -1
  25. package/dist/cjs/components/QuillSelect.js +3 -3
  26. package/dist/cjs/components/QuillSelectWithCombo.d.ts +1 -1
  27. package/dist/cjs/components/QuillSelectWithCombo.d.ts.map +1 -1
  28. package/dist/cjs/components/QuillSelectWithCombo.js +3 -3
  29. package/dist/cjs/components/QuillTable.d.ts.map +1 -1
  30. package/dist/cjs/components/QuillTable.js +10 -3
  31. package/dist/cjs/components/UiComponents.d.ts +1 -0
  32. package/dist/cjs/components/UiComponents.d.ts.map +1 -1
  33. package/dist/cjs/hooks/useDashboard.d.ts +4 -1
  34. package/dist/cjs/hooks/useDashboard.d.ts.map +1 -1
  35. package/dist/cjs/hooks/useDashboard.js +122 -53
  36. package/dist/cjs/hooks/useExport.d.ts.map +1 -1
  37. package/dist/cjs/hooks/useExport.js +8 -2
  38. package/dist/cjs/hooks/useQuill.d.ts.map +1 -1
  39. package/dist/cjs/hooks/useQuill.js +11 -13
  40. package/dist/cjs/models/Client.d.ts +6 -0
  41. package/dist/cjs/models/Client.d.ts.map +1 -1
  42. package/dist/cjs/models/Filter.d.ts +4 -3
  43. package/dist/cjs/models/Filter.d.ts.map +1 -1
  44. package/dist/cjs/models/Filter.js +38 -1
  45. package/dist/cjs/utils/paginationProcessing.js +1 -1
  46. package/dist/cjs/utils/report.js +2 -2
  47. package/dist/cjs/utils/tableProcessing.d.ts +2 -2
  48. package/dist/cjs/utils/tableProcessing.d.ts.map +1 -1
  49. package/dist/esm/ChartBuilder.d.ts.map +1 -1
  50. package/dist/esm/ChartBuilder.js +4 -4
  51. package/dist/esm/ChartEditor.d.ts.map +1 -1
  52. package/dist/esm/ChartEditor.js +10 -10
  53. package/dist/esm/Context.d.ts +13 -1
  54. package/dist/esm/Context.d.ts.map +1 -1
  55. package/dist/esm/Context.js +114 -17
  56. package/dist/esm/Dashboard.d.ts.map +1 -1
  57. package/dist/esm/Dashboard.js +107 -313
  58. package/dist/esm/DateRangePicker/QuillDateRangePicker.d.ts.map +1 -1
  59. package/dist/esm/DateRangePicker/QuillDateRangePicker.js +15 -7
  60. package/dist/esm/ReportBuilder.d.ts.map +1 -1
  61. package/dist/esm/ReportBuilder.js +14 -8
  62. package/dist/esm/SQLEditor.d.ts.map +1 -1
  63. package/dist/esm/SQLEditor.js +6 -5
  64. package/dist/esm/components/Dashboard/DashboardFilter.d.ts +2 -1
  65. package/dist/esm/components/Dashboard/DashboardFilter.d.ts.map +1 -1
  66. package/dist/esm/components/Dashboard/DashboardFilter.js +7 -7
  67. package/dist/esm/components/Dashboard/DataLoader.d.ts.map +1 -1
  68. package/dist/esm/components/Dashboard/DataLoader.js +37 -4
  69. package/dist/esm/components/QuillMultiSelect.js +1 -1
  70. package/dist/esm/components/QuillMultiSelectWithCombo.js +1 -1
  71. package/dist/esm/components/QuillSelect.d.ts +1 -1
  72. package/dist/esm/components/QuillSelect.d.ts.map +1 -1
  73. package/dist/esm/components/QuillSelect.js +3 -3
  74. package/dist/esm/components/QuillSelectWithCombo.d.ts +1 -1
  75. package/dist/esm/components/QuillSelectWithCombo.d.ts.map +1 -1
  76. package/dist/esm/components/QuillSelectWithCombo.js +3 -3
  77. package/dist/esm/components/QuillTable.d.ts.map +1 -1
  78. package/dist/esm/components/QuillTable.js +10 -3
  79. package/dist/esm/components/UiComponents.d.ts +1 -0
  80. package/dist/esm/components/UiComponents.d.ts.map +1 -1
  81. package/dist/esm/hooks/useDashboard.d.ts +4 -1
  82. package/dist/esm/hooks/useDashboard.d.ts.map +1 -1
  83. package/dist/esm/hooks/useDashboard.js +121 -55
  84. package/dist/esm/hooks/useExport.d.ts.map +1 -1
  85. package/dist/esm/hooks/useExport.js +9 -3
  86. package/dist/esm/hooks/useQuill.d.ts.map +1 -1
  87. package/dist/esm/hooks/useQuill.js +12 -14
  88. package/dist/esm/models/Client.d.ts +6 -0
  89. package/dist/esm/models/Client.d.ts.map +1 -1
  90. package/dist/esm/models/Filter.d.ts +4 -3
  91. package/dist/esm/models/Filter.d.ts.map +1 -1
  92. package/dist/esm/models/Filter.js +36 -0
  93. package/dist/esm/utils/paginationProcessing.js +1 -1
  94. package/dist/esm/utils/report.js +2 -2
  95. package/dist/esm/utils/tableProcessing.d.ts +2 -2
  96. package/dist/esm/utils/tableProcessing.d.ts.map +1 -1
  97. package/package.json +1 -1
@@ -55,7 +55,6 @@ const TemplateMetricComponent_1 = __importDefault(require("./components/Dashboar
55
55
  const TemplateTableComponent_1 = __importDefault(require("./components/Dashboard/TemplateTableComponent"));
56
56
  const DashboardTemplate_1 = __importDefault(require("./components/Dashboard/DashboardTemplate"));
57
57
  const Filter_2 = require("./models/Filter");
58
- const fast_deep_equal_1 = __importDefault(require("fast-deep-equal"));
59
58
  const defaultChartContainerStyles = {
60
59
  display: 'flex',
61
60
  width: '100%',
@@ -71,6 +70,15 @@ const charts = (sections, section, sortByOrdering) => sections[section]
71
70
  const tables = (sections, section, sortByOrdering) => sections[section]
72
71
  .filter(({ chartType }) => chartType === 'table')
73
72
  .sort(sortByOrdering);
73
+ const sortByOrdering = (a, b) => {
74
+ if (a.order === undefined && b.order === undefined)
75
+ return 0;
76
+ if (a.order === undefined)
77
+ return 1;
78
+ if (b.order === undefined)
79
+ return -1;
80
+ return a.order - b.order;
81
+ };
74
82
  /**
75
83
  * ### Quill Dashboard
76
84
  *
@@ -103,13 +111,11 @@ const tables = (sections, section, sortByOrdering) => sections[section]
103
111
  * @see https://docs.quillsql.com/components/dashboard
104
112
  */
105
113
  function Dashboard({ name, hidden = false, SelectComponent = QuillSelectWithCombo_1.QuillSelectComponentWithCombo, MultiSelectComponent = QuillMultiSelectWithCombo_1.QuillMultiSelectComponentWithCombo, ModalComponent = UiComponents_1.QuillModalComponent, ButtonComponent = UiComponents_1.MemoizedButton, SecondaryButtonComponent = UiComponents_1.MemoizedSecondaryButton, FilterTagComponent = ui_1.QuillFilterPopover, PopoverComponent = UiComponents_1.MemoizedPopover, TextInputComponent = UiComponents_1.QuillTextInput, EmptyDashboardComponent = UiComponents_1.QuillEmptyDashboardComponent, DateRangePickerComponent = QuillDateRangePicker_1.QuillDateRangePicker, MetricComponent = MetricComponent_1.default, ChartComponent = ChartComponent_1.default, TableComponent = TableComponent_1.default, TemplateMetricComponent = TemplateMetricComponent_1.default, TemplateChartComponent = TemplateChartComponent_1.default, TemplateTableComponent = TemplateTableComponent_1.default, DashboardSectionComponent = DashboardSection_1.default, DashboardSectionContainerComponent = DashboardSectionContainer_1.default, FilterContainerComponent = UiComponents_1.QuillFilterContainerComponent, DashboardLoadingComponent = UiComponents_1.QuillLoadingDashboardComponent, ErrorComponent = ChartError_1.QuillChartErrorWithAction, onClickReport, hoverActions, onChangeLoading, hideFilters, hideXAxis = false, hideYAxis = false, hideCartesianGrid = false, comparisonLineStyle = 'solid', containerStyle, className, chartContainerStyle = defaultChartContainerStyles, filters, onClickChartElement, dateBucket, additionalProcessing, hideAdminErrors = true, templateDashboardName, }) {
106
- const { isLoading, data, isDashboardFiltersLoading, dashboardFilters: populatedDashboardFilters, reload, } = (0, useDashboard_1.useDashboard)(name);
107
- const [presetFilters, setPresetFilters] = (0, react_1.useState)(null);
114
+ const { isLoading, data, isDashboardFilterLoading, dashboardFilters: populatedDashboardFilters, reload, } = (0, useDashboard_1.useDashboard)(name);
108
115
  const [client, isClientLoading] = (0, react_1.useContext)(Context_1.ClientContext);
109
116
  const [theme] = (0, react_1.useContext)(Context_1.ThemeContext);
110
117
  const [initialLoad, setInitialLoad] = (0, react_1.useState)(true);
111
- const [appliedFilters, setAppliedFilters] = (0, react_1.useState)(null);
112
- const { dashboardFilters, dashboardFiltersDispatch } = (0, react_1.useContext)(Context_1.DashboardFiltersContext);
118
+ const { dispatch: dashboardFiltersDispatch } = (0, react_1.useContext)(Context_1.DashboardFiltersContext);
113
119
  const [schemaData] = (0, react_1.useContext)(Context_1.SchemaDataContext);
114
120
  const [filterSchemaIsLoaded, setFilterSchemaIsLoaded] = (0, react_1.useState)(false);
115
121
  const [filterSchema, setFilterSchema] = (0, react_1.useState)({ columns: [] }); // Schema to be passed into FilterModal
@@ -119,20 +125,37 @@ function Dashboard({ name, hidden = false, SelectComponent = QuillSelectWithComb
119
125
  const [addFilterPopoverIsOpen, setAddFilterPopoverIsOpen] = (0, react_1.useState)(false);
120
126
  const [filterListIsOpen, setFilterListIsOpen] = (0, react_1.useState)(false);
121
127
  const [filterListAddFilterPopoverIsOpen, setFilterListAddFilterPopoverIsOpen,] = (0, react_1.useState)(false);
122
- const [uniqueCounter, setUniqueCounter] = (0, react_1.useState)(0);
123
- const userFilters = (0, react_1.useMemo)(() => {
124
- return (appliedFilters
125
- ?.map((filter, index) => {
126
- return { filter, index };
127
- })
128
- .filter((filter) => filter.filter.isUserFilter) ?? []);
129
- }, [appliedFilters]);
130
- const adminFilters = (0, react_1.useMemo)(() => {
131
- return appliedFilters?.filter((filter) => !filter.isUserFilter) ?? [];
132
- }, [appliedFilters]);
128
+ const presetOptions = (0, react_1.useMemo)(() => {
129
+ return populatedDashboardFilters?.[0]?.filterType === 'date_range'
130
+ ? populatedDashboardFilters[0].presetRanges?.map((elem) => {
131
+ if (!elem.isStatic) {
132
+ return {
133
+ label: elem.label,
134
+ value: elem.value,
135
+ startDate: dateRangePickerUtils_1.PRIMARY_RANGE[elem.value].start,
136
+ endDate: dateRangePickerUtils_1.PRIMARY_RANGE[elem.value].end,
137
+ };
138
+ }
139
+ return {
140
+ label: elem.label,
141
+ value: elem.value,
142
+ startDate: new Date(elem.startDate),
143
+ endDate: new Date(elem.endDate),
144
+ };
145
+ }) ?? dateRangePickerUtils_1.defaultOptionsV2
146
+ : dateRangePickerUtils_1.defaultOptionsV2;
147
+ }, [populatedDashboardFilters]);
148
+ const [userFilters, setUserFilters] = (0, react_1.useState)({});
149
+ // A filter value can either be a string, an array of strings for a multiselect, or a date range (that could have a comparison range)
150
+ const [filterValues, setFilterValues] = (0, react_1.useState)({});
133
151
  (0, react_1.useEffect)(() => {
152
+ setFilterValues({});
134
153
  reload(name, true);
135
- }, [name, client?.organizationId]);
154
+ }, [client?.organizationId]);
155
+ (0, react_1.useEffect)(() => {
156
+ setFilterValues({});
157
+ reload(name, false);
158
+ }, [name]);
136
159
  const customOperatorOptions = {
137
160
  [Filter_1.FieldTypes.Number]: [
138
161
  Filter_1.NumberOperator.EqualTo,
@@ -165,23 +188,6 @@ function Dashboard({ name, hidden = false, SelectComponent = QuillSelectWithComb
165
188
  return;
166
189
  onDashboardDataChange(data, schemaData.schema);
167
190
  }, [data, filters, schemaData.schema]);
168
- (0, react_1.useEffect)(() => {
169
- if (isDashboardFiltersLoading)
170
- return;
171
- if (populatedDashboardFilters) {
172
- const newApplied = appliedFilters?.map((filter) => {
173
- if ((filter.options && filter.options.length) ||
174
- filter.isUserFilter) {
175
- return filter;
176
- }
177
- const equivalent = populatedDashboardFilters.find((populatedFilter) => populatedFilter._id === filter._id);
178
- return { ...filter, options: equivalent?.options ?? filter.options };
179
- }) ?? populatedDashboardFilters;
180
- if (!(0, fast_deep_equal_1.default)(appliedFilters, newApplied)) {
181
- setAppliedFilters(newApplied);
182
- }
183
- }
184
- }, [isDashboardFiltersLoading, populatedDashboardFilters]);
185
191
  // Go through all columns in the referenced tables and get the unique values to use in fieldValuesMap
186
192
  (0, react_1.useEffect)(() => {
187
193
  const fetchData = async () => {
@@ -202,7 +208,9 @@ function Dashboard({ name, hidden = false, SelectComponent = QuillSelectWithComb
202
208
  setFieldValuesMap(newFieldValues);
203
209
  setFieldValuesIsLoaded(true);
204
210
  };
205
- fetchData();
211
+ if (data?.customFiltersEnabled) {
212
+ fetchData();
213
+ }
206
214
  }, [referencedTables]);
207
215
  // Get the relevant information from the dashboard and schema to pass to FilterModal
208
216
  const updateFilterSchema = (sections, schema) => {
@@ -253,107 +261,6 @@ function Dashboard({ name, hidden = false, SelectComponent = QuillSelectWithComb
253
261
  const onDashboardDataChange = (resp, schema) => {
254
262
  // setDashboardSections(resp.sections ?? {});
255
263
  updateFilterSchema(resp.sections, schema);
256
- const filterArray = [];
257
- if (resp.dateFilter && Object.keys(resp.dateFilter).length) {
258
- let presetsOptions = dateRangePickerUtils_1.defaultOptionsV2;
259
- if (resp.dateFilter.presetRanges) {
260
- presetsOptions = resp.dateFilter.presetRanges.map((elem) => {
261
- if (!elem.isStatic) {
262
- return {
263
- label: elem.label,
264
- value: elem.value,
265
- startDate: dateRangePickerUtils_1.PRIMARY_RANGE[elem.value].start,
266
- endDate: dateRangePickerUtils_1.PRIMARY_RANGE[elem.value].end,
267
- };
268
- }
269
- return {
270
- label: elem.label,
271
- value: elem.value,
272
- startDate: new Date(elem.startDate),
273
- endDate: new Date(elem.endDate),
274
- };
275
- });
276
- }
277
- setPresetFilters(presetsOptions);
278
- // Attempt to find a date filter in the current applied filters
279
- const currentDateFilter = appliedFilters?.find((filter) => filter.filterType === 'date_range');
280
- const key = currentDateFilter?.preset?.value ||
281
- resp.dateFilter?.primaryRange?.value ||
282
- 'LAST_6_MONTHS';
283
- const primaryPreset = presetsOptions.find((option) => {
284
- return option.value === key;
285
- });
286
- const filter = {
287
- startDate: primaryPreset.startDate,
288
- endDate: primaryPreset.endDate,
289
- filterType: 'date_range',
290
- options: presetsOptions.map((elem) => {
291
- return {
292
- label: elem.label,
293
- value: elem.value,
294
- };
295
- }),
296
- field: 'date_range',
297
- label: resp.dateFilter.label,
298
- preset: {
299
- label: primaryPreset.label,
300
- value: primaryPreset.value,
301
- },
302
- dashboardName: name,
303
- };
304
- if (resp.dateFilter.comparison) {
305
- filter.comparison = true;
306
- const compKey = resp.dateFilter.defaultComparisonRange ?? 'PREV_PERIOD';
307
- const range = { start: filter.startDate, end: filter.endDate };
308
- filter.comparisonRange = {
309
- startDate: dateRangePickerUtils_1.COMPARISON_RANGE[compKey](range)?.start,
310
- endDate: dateRangePickerUtils_1.COMPARISON_RANGE[compKey](range)?.end,
311
- value: compKey,
312
- };
313
- }
314
- else {
315
- filter.comparison = false;
316
- }
317
- filterArray.push(filter);
318
- }
319
- // Add string filters to filterArray
320
- if (resp.filters && resp.filters.length) {
321
- Object.values(resp.filters)
322
- .filter((filter) => filter.filterType !== 'date_range')
323
- .forEach((filter) => {
324
- let processedFilter = processFilter(filter);
325
- if (populatedDashboardFilters) {
326
- const equivalent = populatedDashboardFilters.find((populatedFilter) => populatedFilter._id === filter._id);
327
- processedFilter = {
328
- ...processedFilter,
329
- options: equivalent?.options ?? filter.options,
330
- };
331
- }
332
- filterArray.push(processedFilter);
333
- });
334
- }
335
- // Add custom filter to filterArray
336
- if (filters) {
337
- filters.forEach((filter) => {
338
- filterArray.push({
339
- ...filter,
340
- dashboardName: name,
341
- isUserFilter: true,
342
- });
343
- });
344
- }
345
- // remove all that are already present in dashboardSpecificFilters
346
- const dashboardSpecificFilters = dashboardFilters.filter((f) => f.dashboardName === name);
347
- if (!(0, fast_deep_equal_1.default)(dashboardSpecificFilters, filterArray)) {
348
- dashboardFiltersDispatch({
349
- type: 'CLEAR_AND_ADD_DASHBOARD_FILTERS',
350
- data: filterArray,
351
- dashboardName: name,
352
- });
353
- }
354
- if (!(0, fast_deep_equal_1.default)(appliedFilters, filterArray)) {
355
- setAppliedFilters(filterArray);
356
- }
357
264
  setInitialLoad(false);
358
265
  };
359
266
  const handleOnClickDashboardItem = (elem) => {
@@ -361,174 +268,87 @@ function Dashboard({ name, hidden = false, SelectComponent = QuillSelectWithComb
361
268
  onClickReport({ ...elem, _id: elem.id });
362
269
  }
363
270
  };
364
- function removeQuotes(str) {
365
- if (str.startsWith('"') && str.endsWith('"')) {
366
- return str.slice(1, -1);
367
- }
368
- else {
369
- return str;
370
- }
371
- }
372
- const processFilter = (filter, value = null) => {
373
- //for dateObjects only, since values are arrays for dateObjects
374
- const { ...filterWithoutSelectedValue } = filter; // _ is a throwaway variable
375
- let selectedValue;
376
- let selectedElem;
377
- if (filter.filterType === 'string') {
378
- if (filter.options) {
379
- selectedElem = filter.options.find((elem) => elem[removeQuotes(filter.field)] === value);
380
- }
381
- if (selectedElem) {
382
- selectedValue = selectedElem[removeQuotes(filter.field)];
383
- }
384
- return {
385
- ...filterWithoutSelectedValue,
386
- ...(selectedValue ? { selectedValue } : {}),
387
- dashboardName: name,
388
- };
389
- }
390
- if (filter.filterType === 'date' || filter.filterType === 'date_range') {
391
- return {
392
- startDate: value ? value[0] : filter.startDate,
393
- endDate: value ? value[1] : filter.endDate,
394
- filterType: 'date_range',
395
- label: 'Date',
396
- field: 'date_range',
397
- options: filter.options,
398
- dashboardName: name,
399
- };
400
- }
401
- };
402
271
  const updateFilter = (filter, value = null, comparison = null) => {
403
- if (!appliedFilters) {
272
+ if (!populatedDashboardFilters)
404
273
  return;
405
- }
406
- //for dateObjects only, since values are arrays for dateObjects
407
- const { ...filterWithoutSelectedValue } = filter; // _ is a throwaway variable
274
+ let filterValue = {};
408
275
  if (filter.filterType === 'string') {
409
- let selectedValue = {};
410
276
  if (filter.stringFilterType === 'multiselect') {
411
277
  if ((value?.length ?? 0) === 0) {
412
- selectedValue = { values: [] };
278
+ filterValue = { values: undefined, operator: undefined };
413
279
  }
414
280
  else {
415
- selectedValue = { values: value, operator: 'IN' };
281
+ filterValue = { values: value, operator: 'IN' };
416
282
  }
417
283
  }
418
284
  else {
419
- selectedValue = { selectedValue: value };
285
+ filterValue = { selectedValue: value };
420
286
  }
421
- const newFilter = {
422
- ...filterWithoutSelectedValue,
423
- ...selectedValue,
424
- dashboardName: name,
425
- stringFilterType: filter.stringFilterType,
426
- table: filter.table,
427
- labelField: filter.labelField,
428
- label: filter.label,
429
- field: filter.field,
430
- filterType: Filter_2.DashboardFilterType.String,
431
- };
432
- dashboardFiltersDispatch({
433
- type: 'UPDATE_DASHBOARD_FILTER',
434
- id: filter.field,
435
- data: newFilter,
436
- });
437
- const index = appliedFilters.findIndex((filter) => filter.field === newFilter.field &&
438
- filter.dashboardName === newFilter.dashboardName);
439
- if (index !== -1) {
440
- setAppliedFilters([
441
- ...appliedFilters.slice(0, index),
442
- newFilter,
443
- ...appliedFilters.slice(index + 1),
444
- ]);
445
- }
446
- return;
287
+ setFilterValues((filterValues) => ({
288
+ ...filterValues,
289
+ [filter.label]: filterValue,
290
+ }));
447
291
  }
448
- if (filter.filterType === Filter_2.DashboardFilterType.Date) {
292
+ else if (filter.filterType === Filter_2.DashboardFilterType.Date) {
449
293
  if (comparison ||
450
- (filter.comparison && filter.comparisonRange.value !== 'NO_COMPARISON')) {
294
+ (filter.comparison &&
295
+ (filter.comparisonRange?.value ?? 'NO_COMPARISON') !==
296
+ 'NO_COMPARISON')) {
451
297
  let preset = '';
452
298
  if (comparison) {
453
- preset = filter.preset.label;
299
+ preset = filter.preset.value;
454
300
  }
455
- const key = comparison?.value || filter.comparisonRange.value;
301
+ const key = comparison?.value ||
302
+ (filter.comparisonRange?.value ?? 'NO_COMPARISON');
456
303
  let primaryRange = {
457
304
  start: value ? value.startDate : filter.startDate,
458
305
  end: value ? value.endDate : filter.endDate,
459
306
  };
460
307
  if (value && value.preset) {
461
308
  preset = value.preset;
462
- primaryRange = (0, dateRangePickerUtils_1.getRangeFromPresetOptions)(value.preset, presetFilters);
309
+ primaryRange = (0, dateRangePickerUtils_1.getRangeFromPresetOptions)(value.preset, presetOptions);
463
310
  }
464
- const newFilter = {
311
+ filterValue = {
465
312
  startDate: primaryRange.start,
466
313
  endDate: primaryRange.end,
467
- filterType: Filter_2.DashboardFilterType.Date,
468
- label: filter.label,
469
- field: 'date_range',
470
- preset: { label: preset, value: preset },
471
- options: filter.options,
472
- comparison: true,
314
+ preset: {
315
+ label: presetOptions.find((o) => o.value === preset)?.label ?? preset,
316
+ value: preset,
317
+ },
473
318
  comparisonRange: {
474
319
  startDate: dateRangePickerUtils_1.COMPARISON_RANGE[key](primaryRange)?.start,
475
320
  endDate: dateRangePickerUtils_1.COMPARISON_RANGE[key](primaryRange)?.end,
476
321
  value: key,
477
322
  },
478
- defaultComparisonRange: filter.defaultComparisonRange,
479
- primaryRange: filter.primaryRange,
480
- dashboardName: name,
481
323
  };
482
- dashboardFiltersDispatch({
483
- type: 'UPDATE_DASHBOARD_FILTER',
484
- id: 'date_range',
485
- data: newFilter,
486
- });
487
- const index = appliedFilters.findIndex((filter) => filter.field === newFilter.field &&
488
- filter.dashboardName === newFilter.dashboardName);
489
- if (index !== -1) {
490
- setAppliedFilters([
491
- ...appliedFilters.slice(0, index),
492
- newFilter,
493
- ...appliedFilters.slice(index + 1),
494
- ]);
495
- }
324
+ setFilterValues((filterValues) => ({
325
+ ...filterValues,
326
+ [filter.label]: filterValue,
327
+ }));
496
328
  }
497
329
  else {
498
330
  const primaryRange = value && value.preset
499
- ? (0, dateRangePickerUtils_1.getRangeFromPresetOptions)(value.preset, presetFilters)
331
+ ? (0, dateRangePickerUtils_1.getRangeFromPresetOptions)(value.preset, presetOptions)
500
332
  : {
501
333
  start: value?.startDate || filter.startDate,
502
334
  end: value?.endDate || filter.endDate,
503
335
  };
504
336
  const preset = value?.preset ? value.preset : '';
505
- const newFilter = {
506
- ...filter,
507
- preset: { label: preset, value: preset },
337
+ filterValue = {
508
338
  startDate: primaryRange.start,
509
339
  endDate: primaryRange.end,
510
- filterType: Filter_2.DashboardFilterType.Date,
511
- field: 'date_range',
512
- options: filter.options,
513
- label: filter.label,
514
- dashboardName: name,
340
+ preset: { label: preset, value: preset },
515
341
  };
516
- dashboardFiltersDispatch({
517
- type: 'UPDATE_DASHBOARD_FILTER',
518
- id: 'date_range',
519
- data: newFilter,
520
- });
521
- const index = appliedFilters.findIndex((filter) => filter.field === newFilter.field &&
522
- filter.dashboardName === newFilter.dashboardName);
523
- if (index !== -1) {
524
- setAppliedFilters([
525
- ...appliedFilters.slice(0, index),
526
- newFilter,
527
- ...appliedFilters.slice(index + 1),
528
- ]);
529
- }
342
+ setFilterValues((filterValues) => ({
343
+ ...filterValues,
344
+ [filter.label]: filterValue,
345
+ }));
530
346
  }
531
347
  }
348
+ reload(name, false, undefined, {
349
+ filters: populatedDashboardFilters.map((f) => filter.label === f.label ? { ...f, ...filterValue } : f),
350
+ editedFilterLabel: filter.label,
351
+ });
532
352
  };
533
353
  // generate the correct filter structure
534
354
  const getUserFilter = (filter, id, existingFilter) => {
@@ -553,34 +373,20 @@ function Dashboard({ name, hidden = false, SelectComponent = QuillSelectWithComb
553
373
  return userFilter;
554
374
  };
555
375
  // new update filter function for user added filters
556
- const updateUserFilter = (filter, id) => {
557
- if (!appliedFilters) {
558
- return;
559
- }
560
- const newFilter = getUserFilter(filter, id);
561
- dashboardFiltersDispatch({
562
- type: 'ADD_DASHBOARD_FILTER',
563
- data: newFilter,
564
- });
565
- setAppliedFilters([...appliedFilters, newFilter]);
376
+ const updateUserFilter = (filter) => {
377
+ setUserFilters((userFilters) => ({
378
+ ...userFilters,
379
+ [filter.field]: filter,
380
+ }));
566
381
  };
567
382
  (0, react_1.useEffect)(() => {
568
383
  if (onChangeLoading) {
569
384
  onChangeLoading(isLoading || initialLoad);
570
385
  }
571
386
  }, [isLoading, initialLoad, onChangeLoading]);
572
- const sortByOrdering = (a, b) => {
573
- if (a.order === undefined && b.order === undefined)
574
- return 0;
575
- if (a.order === undefined)
576
- return 1;
577
- if (b.order === undefined)
578
- return -1;
579
- return a.order - b.order;
580
- };
581
387
  if (!isLoading &&
582
388
  (Object.keys(data?.sections ?? {}).length === 0 ||
583
- data?.sections?.['']?.length === 0)) {
389
+ Object.values(data?.sections ?? {})[0]?.length === 0)) {
584
390
  return (0, jsx_runtime_1.jsx)(EmptyDashboardComponent, {});
585
391
  }
586
392
  if (hidden || isLoading || isClientLoading || !data?.sections) {
@@ -594,7 +400,13 @@ function Dashboard({ name, hidden = false, SelectComponent = QuillSelectWithComb
594
400
  data &&
595
401
  data.customFiltersEnabled &&
596
402
  filterSchema &&
597
- filterSchema.columns.length === 0 && ((0, jsx_runtime_1.jsx)("div", { style: { marginBottom: 10 }, children: (0, jsx_runtime_1.jsx)(UiComponents_1.QuillErrorMessageComponent, { errorMessage: "Warning: No custom filter options because there are no common views among the charts in the dashboard" }) })), (0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', flexDirection: 'row', alignItems: 'center' }, children: [!hideFilters && ((0, jsx_runtime_1.jsxs)(FilterContainerComponent, { children: [adminFilters.map((filter, index) => ((0, jsx_runtime_1.jsx)(DashboardFilter_1.DashboardFilter, { filter: filter, onChangeFilter: updateFilter, theme: theme, SelectComponent: SelectComponent, MultiSelectComponent: MultiSelectComponent, DateRangePickerComponent: DateRangePickerComponent, isLoading: isDashboardFiltersLoading }, filter._id ?? index))), (0, jsx_runtime_1.jsxs)("div", { style: {
403
+ filterSchema.columns.length === 0 && ((0, jsx_runtime_1.jsx)("div", { style: { marginBottom: 10 }, children: (0, jsx_runtime_1.jsx)(UiComponents_1.QuillErrorMessageComponent, { errorMessage: "Warning: No custom filter options because there are no common views among the charts in the dashboard" }) })), (0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', flexDirection: 'row', alignItems: 'center' }, children: [!hideFilters && ((0, jsx_runtime_1.jsxs)(FilterContainerComponent, { children: [(populatedDashboardFilters ?? []).map((filter) => ((0, jsx_runtime_1.jsx)(DashboardFilter_1.DashboardFilter, { filter: {
404
+ ...filter,
405
+ ...(filter.filterType === 'date_range' && {
406
+ options: presetOptions,
407
+ }),
408
+ ...filterValues[filter.label],
409
+ }, onChangeFilter: updateFilter, theme: theme, SelectComponent: SelectComponent, MultiSelectComponent: MultiSelectComponent, DateRangePickerComponent: DateRangePickerComponent, isLoading: isDashboardFilterLoading(filter.label) }, filter.label + name))), (0, jsx_runtime_1.jsxs)("div", { style: {
598
410
  display: 'flex',
599
411
  flexDirection: 'column',
600
412
  }, children: [data && data.customFiltersEnabled && ((0, jsx_runtime_1.jsx)(SecondaryButtonComponent, { onClick: () => {
@@ -604,14 +416,12 @@ function Dashboard({ name, hidden = false, SelectComponent = QuillSelectWithComb
604
416
  }
605
417
  }, label: `Add Filter` })), (0, jsx_runtime_1.jsx)(PopoverComponent, { isOpen: addFilterPopoverIsOpen, setIsOpen: setAddFilterPopoverIsOpen, popoverTitle: "Add Filter", popoverChildren: (0, jsx_runtime_1.jsx)(FilterModal_1.default, { schema: filterSchema, fieldValuesMap: fieldValuesMap, onSubmitFilter: (filter) => {
606
418
  setAddFilterPopoverIsOpen(false);
607
- if (appliedFilters) {
608
- updateUserFilter(filter, appliedFilters.length);
609
- }
610
- }, onDeleteFilter: () => { }, ButtonComponent: ButtonComponent, SelectComponent: SelectComponent, MultiSelectComponent: MultiSelectComponent, TextInputComponent: TextInputComponent }), containerStyle: { position: 'relative', top: 10 } })] }), userFilters.length > 0 && ((0, jsx_runtime_1.jsx)(ModalComponent, { triggerLabel: `Filters${userFilters.length > 0 ? ` (${userFilters.length})` : ''}`, isOpen: filterListIsOpen, setIsOpen: setFilterListIsOpen, title: "Filters", children: (0, jsx_runtime_1.jsxs)("div", { style: {
419
+ updateUserFilter(filter);
420
+ }, onDeleteFilter: () => { }, ButtonComponent: ButtonComponent, SelectComponent: SelectComponent, MultiSelectComponent: MultiSelectComponent, TextInputComponent: TextInputComponent }), containerStyle: { position: 'relative', top: 10 } })] }), Object.values(userFilters).length > 0 && ((0, jsx_runtime_1.jsx)(ModalComponent, { triggerLabel: `Filters${Object.values(userFilters).length > 0 ? ` (${Object.values(userFilters).length})` : ''}`, isOpen: filterListIsOpen, setIsOpen: setFilterListIsOpen, title: "Filters", children: (0, jsx_runtime_1.jsxs)("div", { style: {
611
421
  display: 'flex',
612
422
  flexDirection: 'column',
613
423
  alignItems: 'start',
614
- }, children: [userFilters.map(({ filter, index }) => ((0, jsx_runtime_1.jsx)(ui_1.FilterPopoverWrapper, { schema: filterSchema, filter: {
424
+ }, children: [Object.values(userFilters).map((filter, index) => ((0, jsx_runtime_1.jsx)(ui_1.FilterPopoverWrapper, { schema: filterSchema, filter: {
615
425
  filterType: filter.filterType,
616
426
  fieldType: filter.fieldType,
617
427
  field: filter.field,
@@ -619,31 +429,17 @@ function Dashboard({ name, hidden = false, SelectComponent = QuillSelectWithComb
619
429
  value: filter.value,
620
430
  }, filterLabel: filter ? (0, filterProcessing_1.filterSentence)(filter) : '', index: index, fieldValuesMap: fieldValuesMap, customOperatorOptions: customOperatorOptions, FilterTagComponent: FilterTagComponent, FilterModal: FilterModal_1.default, ButtonComponent: ButtonComponent, SecondaryButtonComponent: SecondaryButtonComponent, SelectComponent: SelectComponent, TextInputComponent: TextInputComponent, MultiSelectComponent: MultiSelectComponent, handleFilterSave: (newFilter) => {
621
431
  const updatedFilter = getUserFilter(newFilter, filter._id, filter);
622
- if (!appliedFilters) {
623
- return;
624
- }
625
432
  dashboardFiltersDispatch({
626
433
  type: 'UPDATE_DASHBOARD_FILTER',
627
434
  id: updatedFilter._id,
628
435
  data: updateFilter,
629
436
  });
630
- setAppliedFilters([
631
- ...appliedFilters.slice(0, index),
632
- updatedFilter,
633
- ...appliedFilters.slice(index + 1),
634
- ]);
635
437
  }, handleFilterDelete: () => {
636
- if (!appliedFilters) {
637
- return;
638
- }
639
- dashboardFiltersDispatch({
640
- type: 'DELETE_DASHBOARD_FILTER',
641
- id: appliedFilters[index]._id,
438
+ setUserFilters((userFilters) => {
439
+ const updatedFilters = { ...userFilters };
440
+ delete updatedFilters[filter.field];
441
+ return updatedFilters;
642
442
  });
643
- setAppliedFilters([
644
- ...appliedFilters.slice(0, index),
645
- ...appliedFilters.slice(index + 1),
646
- ]);
647
443
  }, containerStyle: { width: 300, marginBottom: 10 } }, `userFilter_${index}_${filter ? (0, filterProcessing_1.filterSentence)(filter) : ''}`))), (0, jsx_runtime_1.jsxs)("div", { style: {
648
444
  display: 'flex',
649
445
  flexDirection: 'column',
@@ -654,10 +450,8 @@ function Dashboard({ name, hidden = false, SelectComponent = QuillSelectWithComb
654
450
  }, label: `Add Filter` }), (0, jsx_runtime_1.jsx)(PopoverComponent, { isOpen: filterListAddFilterPopoverIsOpen, setIsOpen: setFilterListAddFilterPopoverIsOpen, popoverTitle: "Add Filter", popoverChildren: (0, jsx_runtime_1.jsx)(FilterModal_1.default, { schema: filterSchema, fieldValuesMap: fieldValuesMap, onSubmitFilter: (filter) => {
655
451
  setFilterListAddFilterPopoverIsOpen(false);
656
452
  setFilterListIsOpen(false);
657
- const id = uniqueCounter;
658
- setUniqueCounter(uniqueCounter + 1);
659
- updateUserFilter(filter, id);
660
- }, onDeleteFilter: () => { }, ButtonComponent: ButtonComponent, SelectComponent: SelectComponent, MultiSelectComponent: MultiSelectComponent, TextInputComponent: TextInputComponent }), containerStyle: { position: 'relative', top: 10 } })] })] }) }))] })), templateDashboardName && ((0, jsx_runtime_1.jsx)(DashboardTemplate_1.default, { name: templateDashboardName, originDashboard: name, client: client, appliedFilters: appliedFilters, ModalComponent: ModalComponent, TemplateChartComponent: TemplateChartComponent, TemplateMetricComponent: TemplateMetricComponent, TemplateTableComponent: TemplateTableComponent, ButtonComponent: SecondaryButtonComponent }))] }), Object.keys(data.sections)
453
+ updateUserFilter(filter);
454
+ }, onDeleteFilter: () => { }, ButtonComponent: ButtonComponent, SelectComponent: SelectComponent, MultiSelectComponent: MultiSelectComponent, TextInputComponent: TextInputComponent }), containerStyle: { position: 'relative', top: 10 } })] })] }) }))] })), templateDashboardName && ((0, jsx_runtime_1.jsx)(DashboardTemplate_1.default, { name: templateDashboardName, originDashboard: name, client: client, appliedFilters: populatedDashboardFilters, ModalComponent: ModalComponent, TemplateChartComponent: TemplateChartComponent, TemplateMetricComponent: TemplateMetricComponent, TemplateTableComponent: TemplateTableComponent, ButtonComponent: SecondaryButtonComponent }))] }), Object.keys(data.sections)
661
455
  .sort(function (a, b) {
662
456
  return a.length - b.length;
663
457
  })
@@ -671,13 +465,13 @@ function Dashboard({ name, hidden = false, SelectComponent = QuillSelectWithComb
671
465
  textAlign: 'left',
672
466
  marginTop: 12,
673
467
  }, children: section })] })), metrics(data.sections, section, sortByOrdering).length > 0 && ((0, jsx_runtime_1.jsx)(DashboardSectionComponent, { section: "metrics", children: metrics(data.sections, section, sortByOrdering).map((item, index) => {
674
- return ((0, jsx_runtime_1.jsx)(DataLoader_1.default, { item: item, filters: appliedFilters, children: ({ isLoading, error, data, }) => ((0, jsx_runtime_1.jsx)(MetricComponent, { error: error, isLoading: isLoading, report: data, onClick: !isLoading && onClickReport
468
+ return ((0, jsx_runtime_1.jsx)(DataLoader_1.default, { item: item, filters: populatedDashboardFilters, children: ({ isLoading, error, data, }) => ((0, jsx_runtime_1.jsx)(MetricComponent, { error: error, isLoading: isLoading, report: data, onClick: !isLoading && onClickReport
675
469
  ? () => handleOnClickDashboardItem({
676
470
  ...item,
677
471
  ...data,
678
472
  })
679
- : () => { }, hoverActions: hoverActions }, item.name + '' + index)) }, `${item._id}${index}`));
680
- }) })), charts(data.sections, section, sortByOrdering).length > 0 && ((0, jsx_runtime_1.jsx)(DashboardSectionComponent, { section: "charts", children: charts(data.sections, section, sortByOrdering).map((item, index) => ((0, jsx_runtime_1.jsx)(DataLoader_1.ChartDataLoader, { item: item, dateBucket: dateBucket, additionalProcessing: additionalProcessing, filters: appliedFilters, children: ({ isLoading, data, error, dateBucket, }) => ((0, jsx_runtime_1.jsx)(ChartComponent, { report: data, error: error, onClick: () => {
473
+ : () => { }, hoverActions: hoverActions }, item.name + '' + index)) }, `metric${index}`));
474
+ }) })), charts(data.sections, section, sortByOrdering).length > 0 && ((0, jsx_runtime_1.jsx)(DashboardSectionComponent, { section: "charts", children: charts(data.sections, section, sortByOrdering).map((item, index) => ((0, jsx_runtime_1.jsx)(DataLoader_1.ChartDataLoader, { item: item, dateBucket: dateBucket, additionalProcessing: additionalProcessing, filters: populatedDashboardFilters, children: ({ isLoading, data, error, dateBucket, }) => ((0, jsx_runtime_1.jsx)(ChartComponent, { report: data, error: error, onClick: () => {
681
475
  if (!isLoading && onClickReport) {
682
476
  handleOnClickDashboardItem({
683
477
  ...item,
@@ -689,7 +483,7 @@ function Dashboard({ name, hidden = false, SelectComponent = QuillSelectWithComb
689
483
  height: 300,
690
484
  } })) : ((0, jsx_runtime_1.jsx)(Chart_1.ChartDisplay, { reportId: data.id, config: data, loading: isLoading, containerStyle: chartContainerStyle, colors: theme.chartColors?.length
691
485
  ? theme.chartColors
692
- : undefined, scrollable: false, hideXAxis: hideXAxis, hideYAxis: hideYAxis, hideCartesianGrid: hideCartesianGrid, comparisonLineStyle: comparisonLineStyle, onClickChartElement: onClickChartElement })) }, item.name + '' + index)) }, `${item._id}${index}`))) })), tables(data.sections, section, sortByOrdering).length > 0 && ((0, jsx_runtime_1.jsx)(DashboardSectionComponent, { section: "tables", children: tables(data.sections, section, sortByOrdering).map((item, index) => ((0, jsx_runtime_1.jsx)(DataLoader_1.default, { item: item, filters: appliedFilters, children: ({ isLoading, error, onPageChange, onSortChange, data, rowCount, rowCountIsLoading, }) => ((0, jsx_runtime_1.jsx)(TableComponent, { report: data, isLoading: isLoading, error: error, onClick: !isLoading && onClickReport
486
+ : undefined, scrollable: false, hideXAxis: hideXAxis, hideYAxis: hideYAxis, hideCartesianGrid: hideCartesianGrid, comparisonLineStyle: comparisonLineStyle, onClickChartElement: onClickChartElement })) }, item.name + '' + index)) }, `chart${index}`))) })), tables(data.sections, section, sortByOrdering).length > 0 && ((0, jsx_runtime_1.jsx)(DashboardSectionComponent, { section: "tables", children: tables(data.sections, section, sortByOrdering).map((item, index) => ((0, jsx_runtime_1.jsx)(DataLoader_1.default, { item: item, filters: populatedDashboardFilters, children: ({ isLoading, error, onPageChange, onSortChange, data, rowCount, rowCountIsLoading, }) => ((0, jsx_runtime_1.jsx)(TableComponent, { report: data, isLoading: isLoading, error: error, onClick: !isLoading && onClickReport
693
487
  ? () => handleOnClickDashboardItem({
694
488
  ...item,
695
489
  ...data,
@@ -697,7 +491,7 @@ function Dashboard({ name, hidden = false, SelectComponent = QuillSelectWithComb
697
491
  : undefined, hoverActions: hoverActions, rowCount: rowCount ??
698
492
  data?.rowCount ??
699
493
  data?.rows?.length ??
700
- 0, rowCountIsLoading: rowCountIsLoading, onPageChange: (page) => onPageChange(page), onSortChange: (sort) => onSortChange(sort) })) }, `${item._id}${index}`))) }))] }, section + '' + sectionIndex));
494
+ 0, rowCountIsLoading: rowCountIsLoading, onPageChange: (page) => onPageChange(page), onSortChange: (sort) => onSortChange(sort) })) }, `${name}${index}`))) }))] }, section + '' + sectionIndex));
701
495
  })] }));
702
496
  }
703
497
  exports.default = Dashboard;
@@ -1 +1 @@
1
- {"version":3,"file":"QuillDateRangePicker.d.ts","sourceRoot":"","sources":["../../../src/DateRangePicker/QuillDateRangePicker.tsx"],"names":[],"mappings":"AAAA,OAAc,EACZ,WAAW,EAKZ,MAAM,OAAO,CAAC;AAmBf,MAAM,WAAW,6BAA6B;IAC5C,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE;QAAE,SAAS,EAAE,IAAI,CAAC;QAAC,OAAO,EAAE,IAAI,CAAA;KAAE,CAAC;IAC9C,aAAa,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAClD,iBAAiB,EAAE,CAAC,EAClB,SAAS,EACT,OAAO,GACR,EAAE;QACD,SAAS,EAAE,IAAI,CAAC;QAChB,OAAO,EAAE,IAAI,CAAC;KACf,KAAK,IAAI,CAAC;IACX,cAAc,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IAChE,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,MAAM,SAAS,GAAG;IACtB,SAAS,EAAE,IAAI,CAAC;IAChB,OAAO,EAAE,IAAI,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,SAAS,EACT,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,MAAM,EACN,KAAK,EACL,WAAW,EACX,UAAU,GACX,EAAE,6BAA6B,2CAgI/B"}
1
+ {"version":3,"file":"QuillDateRangePicker.d.ts","sourceRoot":"","sources":["../../../src/DateRangePicker/QuillDateRangePicker.tsx"],"names":[],"mappings":"AAAA,OAAc,EACZ,WAAW,EAKZ,MAAM,OAAO,CAAC;AAmBf,MAAM,WAAW,6BAA6B;IAC5C,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE;QAAE,SAAS,EAAE,IAAI,CAAC;QAAC,OAAO,EAAE,IAAI,CAAA;KAAE,CAAC;IAC9C,aAAa,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAClD,iBAAiB,EAAE,CAAC,EAClB,SAAS,EACT,OAAO,GACR,EAAE;QACD,SAAS,EAAE,IAAI,CAAC;QAChB,OAAO,EAAE,IAAI,CAAC;KACf,KAAK,IAAI,CAAC;IACX,cAAc,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IAChE,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,MAAM,SAAS,GAAG;IACtB,SAAS,EAAE,IAAI,CAAC;IAChB,OAAO,EAAE,IAAI,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,SAAS,EACT,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,MAAM,EACN,KAAK,EACL,WAAW,EACX,UAAU,GACX,EAAE,6BAA6B,2CA2I/B"}