@sisense/sdk-ui 2.21.0 → 2.23.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.
Files changed (234) hide show
  1. package/dist/ai.cjs +58 -58
  2. package/dist/ai.js +861 -844
  3. package/dist/analytics-composer/node.cjs +1 -1
  4. package/dist/analytics-composer/node.js +2240 -1230
  5. package/dist/analytics-composer.cjs +47 -47
  6. package/dist/analytics-composer.js +135 -131
  7. package/dist/dimensions-2t18RSZC.cjs +1 -0
  8. package/dist/dimensions-C0BmtTH2.js +204 -0
  9. package/dist/execute-query-CHYTupEo.js +5866 -0
  10. package/dist/execute-query-DmAyVFF5.cjs +1 -0
  11. package/dist/{index-Ck90GjPy.js → index-DCAC0mJe.js} +33 -2
  12. package/dist/{index-0brX9D6q.cjs → index-Dx6wvLd3.cjs} +1 -1
  13. package/dist/index.cjs +423 -410
  14. package/dist/index.js +24905 -23677
  15. package/dist/index.umd.js +728 -675
  16. package/dist/packages/sdk-ui/src/domains/dashboarding/components/editable-layout/const.d.ts +1 -0
  17. package/dist/packages/sdk-ui/src/domains/dashboarding/components/editable-layout/smart-pointer-sensor.d.ts +17 -0
  18. package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/get-dashboard-model.d.ts +2 -1
  19. package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/index.d.ts +1 -1
  20. package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/translate-dashboard-utils.d.ts +8 -1
  21. package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/types.d.ts +9 -2
  22. package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/use-dashboard-model/dashboard-model-reducer/index.d.ts +4 -0
  23. package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/use-dashboard-model/dashboard-model-reducer/persist-dashboard-model-middleware.d.ts +13 -0
  24. package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/use-dashboard-model/{use-dashboard-model-reducer.d.ts → dashboard-model-reducer/types.d.ts} +43 -38
  25. package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/use-dashboard-model/dashboard-model-reducer/use-dashboard-model-reducer.d.ts +9 -0
  26. package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/use-dashboard-model/dashboard-model-reducer/utils.d.ts +29 -0
  27. package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/use-dashboard-model/use-dashboard-persistence.d.ts +6 -5
  28. package/dist/packages/sdk-ui/src/domains/dashboarding/hooks/duplicate-widget/duplicate-widget-utils.d.ts +34 -0
  29. package/dist/packages/sdk-ui/src/domains/dashboarding/hooks/duplicate-widget/index.d.ts +2 -0
  30. package/dist/packages/sdk-ui/src/domains/dashboarding/hooks/duplicate-widget/use-duplicate-widget-menu-item.d.ts +57 -0
  31. package/dist/packages/sdk-ui/src/domains/dashboarding/hooks/jtd/jtd-types.d.ts +1 -1
  32. package/dist/packages/sdk-ui/src/domains/dashboarding/hooks/rename-widget/use-widget-renaming.d.ts +34 -0
  33. package/dist/packages/sdk-ui/src/domains/dashboarding/types.d.ts +65 -2
  34. package/dist/packages/sdk-ui/src/domains/dashboarding/use-composed-dashboard.d.ts +15 -3
  35. package/dist/packages/sdk-ui/src/domains/dashboarding/use-dashboard-theme.d.ts +1 -1
  36. package/dist/packages/sdk-ui/src/domains/data-browser/add-filter-popover/add-filter-data-browser.d.ts +2 -1
  37. package/dist/packages/sdk-ui/src/domains/data-browser/data-schema-browser/data-schema-browser.d.ts +2 -1
  38. package/dist/packages/sdk-ui/src/domains/data-browser/dimensions-browser/types.d.ts +9 -1
  39. package/dist/packages/sdk-ui/src/domains/filters/components/cascading-filter-tile/cascading-filter-tile.d.ts +7 -0
  40. package/dist/packages/sdk-ui/src/domains/filters/components/cascading-filter-tile/cascading-level-filter.d.ts +4 -1
  41. package/dist/packages/sdk-ui/src/domains/filters/components/cascading-filter-tile/use-cascadding-filter-tile-menu-items/use-cascadding-filter-tile-lock-menu-item.d.ts +13 -0
  42. package/dist/packages/sdk-ui/src/domains/filters/components/cascading-filter-tile/use-cascadding-filter-tile-menu-items/use-cascadding-filter-tile-menu-items.d.ts +14 -0
  43. package/dist/packages/sdk-ui/src/domains/filters/components/criteria-filter-tile/criteria-filter-tile.d.ts +7 -0
  44. package/dist/packages/sdk-ui/src/domains/filters/components/custom-filter-tile.d.ts +7 -0
  45. package/dist/packages/sdk-ui/src/domains/filters/components/date-filter/date-range-filter-tile/date-range-filter-tile.d.ts +7 -0
  46. package/dist/packages/sdk-ui/src/domains/filters/components/date-filter/relative-date-filter-tile/relative-date-filter-tile.d.ts +7 -0
  47. package/dist/packages/sdk-ui/src/domains/filters/components/{filter-tile.d.ts → filter-tile/filter-tile.d.ts} +7 -0
  48. package/dist/packages/sdk-ui/src/domains/filters/components/filter-tile/index.d.ts +1 -0
  49. package/dist/packages/sdk-ui/src/domains/filters/components/filter-tile/types.d.ts +36 -0
  50. package/dist/packages/sdk-ui/src/domains/filters/components/filter-tile-container.d.ts +6 -0
  51. package/dist/packages/sdk-ui/src/domains/filters/components/filters-panel/types.d.ts +13 -0
  52. package/dist/packages/sdk-ui/src/domains/filters/components/index.d.ts +1 -1
  53. package/dist/packages/sdk-ui/src/domains/filters/components/member-filter-tile/member-filter-tile.d.ts +7 -0
  54. package/dist/packages/sdk-ui/src/domains/filters/components/unsupported-filter-tile.d.ts +10 -1
  55. package/dist/packages/sdk-ui/src/domains/filters/shared/clone-filter-and-toggle-locked.d.ts +7 -0
  56. package/dist/packages/sdk-ui/src/domains/filters/shared/filter-tile-menu-button.d.ts +10 -0
  57. package/dist/packages/sdk-ui/src/domains/filters/shared/use-filter-tile-menu-items/use-filter-tile-lock-menu-item.d.ts +15 -0
  58. package/dist/packages/sdk-ui/src/domains/filters/shared/use-filter-tile-menu-items/use-filter-tile-menu-items.d.ts +14 -0
  59. package/dist/packages/sdk-ui/src/domains/formulas/fetch-formula.d.ts +1 -1
  60. package/dist/packages/sdk-ui/src/domains/formulas/index.d.ts +0 -1
  61. package/dist/packages/sdk-ui/src/domains/formulas/use-get-shared-formula.d.ts +20 -7
  62. package/dist/packages/sdk-ui/src/domains/query-execution/core/execute-query.d.ts +1 -1
  63. package/dist/packages/sdk-ui/src/domains/query-execution/hooks/use-execute-query-by-widget-id/use-execute-query-by-widget-id.d.ts +1 -1
  64. package/dist/packages/sdk-ui/src/domains/query-execution/hooks/use-query-cache/use-query-cache.d.ts +2 -1
  65. package/dist/packages/sdk-ui/src/domains/visualizations/components/boxplot-chart/boxplot-utils.d.ts +1 -1
  66. package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/helpers/get-load-data-function.d.ts +1 -1
  67. package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/helpers/data-loading.d.ts +1 -1
  68. package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/types.d.ts +1 -1
  69. package/dist/packages/sdk-ui/src/domains/widgets/change-events.d.ts +73 -0
  70. package/dist/packages/sdk-ui/src/domains/widgets/components/chart-widget/types.d.ts +12 -2
  71. package/dist/packages/sdk-ui/src/domains/widgets/components/pivot-table-widget/types.d.ts +12 -2
  72. package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/translate-dashboard-filters.d.ts +3 -1
  73. package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/translate-widget-data-options.d.ts +1 -1
  74. package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/translate-widget-style-options/index.d.ts +1 -0
  75. package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/translate-widget-style-options/to-widget-dto-style.d.ts +63 -0
  76. package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/types.d.ts +1 -1
  77. package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/utils.d.ts +3 -2
  78. package/dist/packages/sdk-ui/src/domains/widgets/event-to-delta.d.ts +17 -0
  79. package/dist/packages/sdk-ui/src/domains/widgets/helpers/header-menu-utils.d.ts +14 -4
  80. package/dist/packages/sdk-ui/src/domains/widgets/helpers/index.d.ts +2 -1
  81. package/dist/packages/sdk-ui/src/domains/widgets/hooks/use-title-renaming.d.ts +27 -0
  82. package/dist/packages/sdk-ui/src/domains/widgets/hooks/use-widget-header-management.d.ts +28 -0
  83. package/dist/packages/sdk-ui/src/domains/widgets/shared/widget-container/widget-container.d.ts +3 -1
  84. package/dist/packages/sdk-ui/src/domains/widgets/shared/widget-header/types.d.ts +32 -17
  85. package/dist/packages/sdk-ui/src/domains/widgets/shared/widget-header/widget-header.d.ts +3 -1
  86. package/dist/packages/sdk-ui/src/domains/widgets/shared/widget-header/widget-menu-button.d.ts +1 -1
  87. package/dist/packages/sdk-ui/src/infra/api/rest-api.d.ts +4 -0
  88. package/dist/packages/sdk-ui/src/infra/api/types/dashboard-dto.d.ts +3 -2
  89. package/dist/packages/sdk-ui/src/infra/app/client-application.d.ts +6 -215
  90. package/dist/packages/sdk-ui/src/infra/app/helpers.d.ts +16 -0
  91. package/dist/packages/sdk-ui/src/infra/app/settings/settings.d.ts +3 -0
  92. package/dist/packages/sdk-ui/src/infra/app/settings/types/deployment-props.d.ts +4 -1
  93. package/dist/packages/sdk-ui/src/infra/app/settings/types/features.d.ts +19 -1
  94. package/dist/packages/sdk-ui/src/infra/app/types.d.ts +236 -0
  95. package/dist/packages/sdk-ui/src/infra/contexts/plugin-provider/index.d.ts +5 -0
  96. package/dist/packages/sdk-ui/src/infra/contexts/plugin-provider/plugin-context.d.ts +15 -0
  97. package/dist/packages/sdk-ui/src/infra/contexts/plugin-provider/plugin-provider.d.ts +21 -0
  98. package/dist/packages/sdk-ui/src/infra/contexts/plugin-provider/types.d.ts +50 -0
  99. package/dist/packages/sdk-ui/src/infra/contexts/plugin-provider/validate-plugins.d.ts +9 -0
  100. package/dist/packages/sdk-ui/src/infra/contexts/sisense-context/sisense-context.d.ts +1 -1
  101. package/dist/packages/sdk-ui/src/infra/contexts/theme-provider/theme-context.d.ts +2 -1
  102. package/dist/packages/sdk-ui/src/infra/decorators/component-decorators/with-tracking/with-tracking.d.ts +1 -1
  103. package/dist/packages/sdk-ui/src/infra/decorators/hook-decorators/with-tracking.d.ts +1 -1
  104. package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/de-de.d.ts +31 -0
  105. package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/en-us.d.ts +31 -0
  106. package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/es-ar.d.ts +31 -0
  107. package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/es-es.d.ts +31 -0
  108. package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/fr-fr.d.ts +31 -0
  109. package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/it-it.d.ts +31 -0
  110. package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/ja-jp.d.ts +31 -0
  111. package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/ko-kr.d.ts +31 -0
  112. package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/nl-nl.d.ts +31 -0
  113. package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/pt-br.d.ts +31 -0
  114. package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/ru-ru.d.ts +31 -0
  115. package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/tr-tr.d.ts +31 -0
  116. package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/zh-cn.d.ts +31 -0
  117. package/dist/packages/sdk-ui/src/infra/translation/resources/en.d.ts +31 -0
  118. package/dist/packages/sdk-ui/src/infra/translation/resources/index.d.ts +62 -0
  119. package/dist/packages/sdk-ui/src/modules/ai/api/chat-rest-api.d.ts +2 -1
  120. package/dist/packages/sdk-ui/src/modules/ai/api/narration-endpoints.d.ts +2 -1
  121. package/dist/packages/sdk-ui/src/modules/ai/get-nlg-insights-from-widget.d.ts +1 -0
  122. package/dist/packages/sdk-ui/src/modules/ai/use-get-nlq-result.d.ts +1 -0
  123. package/dist/packages/sdk-ui/src/modules/ai/use-get-query-recommendations.d.ts +1 -0
  124. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/chart/helpers/axis-type-detection.d.ts +17 -0
  125. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/chart/helpers/chart-type-schemas.d.ts +37 -0
  126. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/chart/helpers/index.d.ts +9 -0
  127. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/chart/helpers/translate-data-options.d.ts +9 -0
  128. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/chart/helpers/validate-chart-json.d.ts +19 -0
  129. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/chart/translate-chart-from-json.d.ts +42 -0
  130. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/chart/translate-chart-to-json.d.ts +41 -0
  131. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/constructs/dimensions/translate-dimensions-from-json.d.ts +11 -0
  132. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/constructs/dimensions/translate-dimensions-to-json.d.ts +22 -0
  133. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/{translate-filters-from-json.d.ts → constructs/filters/translate-filters-from-json.d.ts} +2 -2
  134. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/{translate-filters-to-json.d.ts → constructs/filters/translate-filters-to-json.d.ts} +1 -1
  135. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/{translate-measures-from-json.d.ts → constructs/measures/translate-measures-from-json.d.ts} +4 -4
  136. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/constructs/measures/translate-measures-to-json.d.ts +22 -0
  137. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/index.d.ts +8 -3
  138. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/pivot-table/helpers/index.d.ts +7 -0
  139. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/pivot-table/helpers/translate-data-options.d.ts +14 -0
  140. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/pivot-table/helpers/validate-pivot-table-json.d.ts +19 -0
  141. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/pivot-table/translate-pivot-table-from-json.d.ts +12 -0
  142. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/pivot-table/translate-pivot-table-to-json.d.ts +12 -0
  143. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/query/constants.d.ts +8 -0
  144. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/{translate-query-from-json.d.ts → query/translate-query-from-json.d.ts} +3 -3
  145. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/{translate-query-to-jaql.d.ts → query/translate-query-to-jaql.d.ts} +1 -1
  146. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/{translate-query-to-json.d.ts → query/translate-query-to-json.d.ts} +2 -2
  147. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/shared/data-options/adapters.d.ts +19 -0
  148. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/shared/data-options/index.d.ts +9 -0
  149. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/shared/data-options/translate-axis-from-json.d.ts +24 -0
  150. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/shared/data-options/translate-axis-to-json.d.ts +18 -0
  151. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/{process-function → shared/expression}/custom-formula/process-custom-formula.d.ts +1 -1
  152. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/{process-function → shared/expression}/custom-formula/validate-custom-formula.d.ts +13 -0
  153. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/{process-function → shared/expression}/execute-function.d.ts +1 -1
  154. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/{process-function → shared/expression}/factory-function-processors.d.ts +1 -1
  155. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/{process-function → shared/expression}/factory-function-schemas.d.ts +1 -1
  156. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/{process-function → shared/expression}/filter-processors.d.ts +1 -1
  157. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/shared/expression/formula-function-schemas.d.ts +25 -0
  158. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/{process-function → shared/expression}/process-arg.d.ts +1 -1
  159. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/{process-function → shared/expression}/process-node.d.ts +1 -1
  160. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/shared/utils/attribute-helpers.d.ts +50 -0
  161. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/shared/utils/fuzzy-match.d.ts +16 -0
  162. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/{parse-compose-code.d.ts → shared/utils/parse-compose-code.d.ts} +1 -1
  163. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/shared/utils/schema-index.d.ts +49 -0
  164. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/shared/utils/translation-helpers.d.ts +31 -0
  165. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/types.d.ts +115 -4
  166. package/dist/packages/sdk-ui/src/modules/analytics-composer/types.d.ts +6 -6
  167. package/dist/packages/sdk-ui/src/props.d.ts +14 -21
  168. package/dist/packages/sdk-ui/src/public-api/alpha.d.ts +1 -1
  169. package/dist/packages/sdk-ui/src/public-api/beta.d.ts +1 -1
  170. package/dist/packages/sdk-ui/src/public-api/internal.d.ts +9 -6
  171. package/dist/packages/sdk-ui/src/public-api/public.d.ts +2 -2
  172. package/dist/packages/sdk-ui/src/public-api/sisense-internal.d.ts +18 -5
  173. package/dist/packages/sdk-ui/src/shared/components/alert/alert.d.ts +91 -0
  174. package/dist/packages/sdk-ui/src/shared/components/alert/index.d.ts +2 -0
  175. package/dist/packages/sdk-ui/src/shared/components/grouped-items-browser/types.d.ts +7 -1
  176. package/dist/packages/sdk-ui/src/shared/components/inline-text-editor/inline-text-editor.d.ts +26 -0
  177. package/dist/packages/sdk-ui/src/shared/components/inline-text-editor/use-blur-on-pointer-down-outside.d.ts +11 -0
  178. package/dist/packages/sdk-ui/src/shared/components/loading-indicator.d.ts +2 -1
  179. package/dist/packages/sdk-ui/src/shared/components/menu/menu-button.d.ts +2 -1
  180. package/dist/packages/sdk-ui/src/shared/components/quota-notification/quota-notification.d.ts +32 -0
  181. package/dist/packages/sdk-ui/src/shared/hooks/use-app-settings.d.ts +12 -0
  182. package/dist/packages/sdk-ui/src/shared/hooks/use-quota-notification.d.ts +54 -0
  183. package/dist/packages/sdk-ui/src/shared/hooks/use-quota-warning-dismissed.d.ts +8 -0
  184. package/dist/packages/sdk-ui/src/shared/hooks/use-should-load.d.ts +1 -1
  185. package/dist/packages/sdk-ui/src/shared/hooks/use-with-change-detection.d.ts +5 -5
  186. package/dist/packages/sdk-ui/src/shared/icons/warning-icon.d.ts +6 -0
  187. package/dist/packages/sdk-ui/src/shared/icons/x-circle-icon.d.ts +6 -0
  188. package/dist/packages/sdk-ui/src/shared/types/menu-item.d.ts +17 -0
  189. package/dist/packages/sdk-ui/src/types.d.ts +3 -3
  190. package/dist/{use-common-filters-DBqRT0et.js → quota-notification-CVl0isIV.js} +18254 -16897
  191. package/dist/quota-notification-RAaHp-eO.cjs +713 -0
  192. package/dist/translations/de-de.cjs +1 -1
  193. package/dist/translations/de-de.js +34 -3
  194. package/dist/translations/en-us.cjs +1 -1
  195. package/dist/translations/en-us.js +1 -1
  196. package/dist/translations/es-ar.cjs +1 -1
  197. package/dist/translations/es-ar.js +34 -3
  198. package/dist/translations/es-es.cjs +1 -1
  199. package/dist/translations/es-es.js +34 -3
  200. package/dist/translations/fr-fr.cjs +1 -1
  201. package/dist/translations/fr-fr.js +34 -3
  202. package/dist/translations/it-it.cjs +1 -1
  203. package/dist/translations/it-it.js +34 -3
  204. package/dist/translations/ja-jp.cjs +1 -1
  205. package/dist/translations/ja-jp.js +34 -3
  206. package/dist/translations/ko-kr.cjs +1 -1
  207. package/dist/translations/ko-kr.js +34 -3
  208. package/dist/translations/nl-nl.cjs +1 -1
  209. package/dist/translations/nl-nl.js +34 -3
  210. package/dist/translations/pt-br.cjs +1 -1
  211. package/dist/translations/pt-br.js +34 -3
  212. package/dist/translations/ru-ru.cjs +1 -1
  213. package/dist/translations/ru-ru.js +34 -3
  214. package/dist/translations/tr-tr.cjs +1 -1
  215. package/dist/translations/tr-tr.js +34 -3
  216. package/dist/translations/zh-cn.cjs +1 -1
  217. package/dist/translations/zh-cn.js +34 -3
  218. package/dist/{types-Ockb-LJ0.js → types-B96nVbgX.js} +1 -1
  219. package/dist/{types-Ch9J6ycn.cjs → types-DZ4vWh8j.cjs} +1 -1
  220. package/dist/{utils-DH69_bUK.cjs → utils-CgV-jWWQ.cjs} +44 -44
  221. package/dist/{utils-BXDqo_yg.js → utils-ChqSLRbz.js} +2073 -2081
  222. package/dist/{widget-composer-DgCWcMJ1.cjs → widget-composer-Blul90Zb.cjs} +3 -3
  223. package/dist/{widget-composer-DfVCQL2G.js → widget-composer-Cf_CN3Ux.js} +8 -8
  224. package/package.json +12 -9
  225. package/dist/dimensions-DVGn8ORR.cjs +0 -1
  226. package/dist/dimensions-DuUqQgpi.js +0 -202
  227. package/dist/execute-query-B21bnb05.js +0 -5802
  228. package/dist/execute-query-BIkhszY1.cjs +0 -1
  229. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/common.d.ts +0 -84
  230. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/translate-dimensions-from-json.d.ts +0 -12
  231. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/translate-dimensions-to-json.d.ts +0 -13
  232. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/translate-measures-to-json.d.ts +0 -13
  233. package/dist/use-common-filters-CXJN3RSs.cjs +0 -672
  234. /package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/use-dashboard-model/{use-dasboard-model-utils.d.ts → use-dashboard-model-utils.d.ts} +0 -0
@@ -1,186 +1,193 @@
1
- var Xe = Object.defineProperty, ve = Object.defineProperties;
2
- var er = Object.getOwnPropertyDescriptors;
3
- var pe = Object.getOwnPropertySymbols;
4
- var rr = Object.prototype.hasOwnProperty, tr = Object.prototype.propertyIsEnumerable;
5
- var ye = (e, r, t) => r in e ? Xe(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t, p = (e, r) => {
6
- for (var t in r || (r = {}))
7
- rr.call(r, t) && ye(e, t, r[t]);
8
- if (pe)
9
- for (var t of pe(r))
10
- tr.call(r, t) && ye(e, t, r[t]);
1
+ var zt = Object.defineProperty, Pt = Object.defineProperties;
2
+ var Lt = Object.getOwnPropertyDescriptors;
3
+ var ze = Object.getOwnPropertySymbols;
4
+ var _t = Object.prototype.hasOwnProperty, Ut = Object.prototype.propertyIsEnumerable;
5
+ var Pe = (e, t, r) => t in e ? zt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, g = (e, t) => {
6
+ for (var r in t || (t = {}))
7
+ _t.call(t, r) && Pe(e, r, t[r]);
8
+ if (ze)
9
+ for (var r of ze(t))
10
+ Ut.call(t, r) && Pe(e, r, t[r]);
11
11
  return e;
12
- }, b = (e, r) => ve(e, er(r));
13
- import { f as sr, J as nr } from "../types-Ockb-LJ0.js";
14
- import { b as _s, E as Us, a as Ws, i as js, e as Js, d as Gs } from "../types-Ockb-LJ0.js";
15
- import { bW as ir, bA as or, bX as ar, bY as ur, bZ as cr, aw as se, b_ as lr, av as fr, b$ as dr, b8 as mr, ax as pr, c0 as yr, bb as gr, b9 as hr, aL as br, b7 as Fr, ba as wr, d as qr, c as Er, k as Cr, c1 as $r, c2 as Ar, c3 as xr, c4 as Dr, c5 as Mr, c6 as Sr, c7 as Tr, c8 as Nr, c9 as Rr, ca as Or, cb as Ir, au as zr, cc as Pr, cd as Br, S as ne, h as kr, s as ie, b as U, M as O, ce as Ee, bG as Ce, cf as Lr, cg as Vr, ch as _r, ci as Ur, cj as Wr, aH as jr, an as ge, am as Jr, ck as $e, a7 as Gr, cl as Kr, y as Qr, x as Yr } from "../execute-query-B21bnb05.js";
16
- import { i as Hr, b as Zr, D as Xr, d as vr, a as et } from "../dimensions-DuUqQgpi.js";
17
- class rt {
12
+ }, F = (e, t) => Pt(e, Lt(t));
13
+ import { f as jt, J as Vt } from "../types-B96nVbgX.js";
14
+ import { b as ri, E as si, a as ni, i as ii, e as oi, d as ai } from "../types-B96nVbgX.js";
15
+ import { cb as Wt, bK as Kt, cc as Jt, cd as Yt, ce as Gt, aG as be, cf as Qt, aF as Ht, cg as Xt, bi as Zt, aH as er, ch as tr, bl as rr, bj as sr, aV as nr, bh as ir, bk as or, d as ar, c as ur, k as cr, ci as lr, cj as fr, ck as dr, cl as mr, cm as pr, cn as yr, co as gr, cp as hr, cq as br, cr as Fr, cs as wr, aE as qr, ct as Ar, cu as Cr, S as B, t as H, h as Er, b as $, av as _, at as te, cv as xr, cw as $r, cx as Tr, M as L, cy as Dr, cz as Sr, aR as Or, ax as Le, aw as Fe, bQ as re, U as Mr, V as vr, cA as tt, ag as Nr, A as Rr, cB as Ir, y as kr, x as Br } from "../execute-query-CHYTupEo.js";
16
+ import { i as zr, b as Pr, D as Lr, d as _r, a as Ur } from "../dimensions-C0BmtTH2.js";
17
+ function jr(e, t) {
18
+ const r = e.length, s = t.length, n = Array.from({ length: r + 1 }, (i, o) => Array.from({ length: s + 1 }, (a, u) => o === 0 ? u : u === 0 ? o : 0));
19
+ for (let i = 1; i <= r; i++)
20
+ for (let o = 1; o <= s; o++)
21
+ n[i][o] = Math.min(n[i - 1][o] + 1, n[i][o - 1] + 1, n[i - 1][o - 1] + (e[i - 1] === t[o - 1] ? 0 : 1));
22
+ return n[r][s];
23
+ }
24
+ class Vr {
18
25
  constructor() {
19
26
  this.keyToValue = /* @__PURE__ */ new Map(), this.valueToKey = /* @__PURE__ */ new Map();
20
27
  }
21
- set(r, t) {
22
- this.keyToValue.set(r, t), this.valueToKey.set(t, r);
28
+ set(t, r) {
29
+ this.keyToValue.set(t, r), this.valueToKey.set(r, t);
23
30
  }
24
- getByKey(r) {
25
- return this.keyToValue.get(r);
31
+ getByKey(t) {
32
+ return this.keyToValue.get(t);
26
33
  }
27
- getByValue(r) {
28
- return this.valueToKey.get(r);
34
+ getByValue(t) {
35
+ return this.valueToKey.get(t);
29
36
  }
30
37
  clear() {
31
38
  this.keyToValue.clear(), this.valueToKey.clear();
32
39
  }
33
40
  }
34
- class Ae {
35
- constructor(r) {
36
- this.generateIdentifier = r, this.kv = new rt();
41
+ class rt {
42
+ constructor(t) {
43
+ this.generateIdentifier = t, this.kv = new Vr();
37
44
  }
38
- register(r, t) {
39
- this.kv.getByValue(r) || (t || (t = this.generateIdentifier(r)), this.kv.set(t, r));
45
+ register(t, r) {
46
+ this.kv.getByValue(t) || (r || (r = this.generateIdentifier(t)), this.kv.set(r, t));
40
47
  }
41
48
  clear() {
42
49
  this.kv.clear();
43
50
  }
44
- getIdentifier(r) {
45
- return this.kv.getByValue(r);
51
+ getIdentifier(t) {
52
+ return this.kv.getByValue(t);
46
53
  }
47
- getValue(r) {
48
- return this.kv.getByKey(r);
54
+ getValue(t) {
55
+ return this.kv.getByKey(t);
49
56
  }
50
57
  }
51
- class tt extends Ae {
58
+ class Wr extends rt {
52
59
  constructor() {
53
- super((r) => r.name), this.classToAllowedProps = /* @__PURE__ */ new Map();
60
+ super((t) => t.name), this.classToAllowedProps = /* @__PURE__ */ new Map();
54
61
  }
55
- register(r, t) {
56
- typeof t == "object" ? (t.allowProps && this.classToAllowedProps.set(r, t.allowProps), super.register(r, t.identifier)) : super.register(r, t);
62
+ register(t, r) {
63
+ typeof r == "object" ? (r.allowProps && this.classToAllowedProps.set(t, r.allowProps), super.register(t, r.identifier)) : super.register(t, r);
57
64
  }
58
- getAllowedProps(r) {
59
- return this.classToAllowedProps.get(r);
65
+ getAllowedProps(t) {
66
+ return this.classToAllowedProps.get(t);
60
67
  }
61
68
  }
62
- function st(e) {
69
+ function Kr(e) {
63
70
  if ("values" in Object)
64
71
  return Object.values(e);
65
- const r = [];
66
- for (const t in e)
67
- e.hasOwnProperty(t) && r.push(e[t]);
68
- return r;
72
+ const t = [];
73
+ for (const r in e)
74
+ e.hasOwnProperty(r) && t.push(e[r]);
75
+ return t;
69
76
  }
70
- function nt(e, r) {
71
- const t = st(e);
72
- if ("find" in t)
73
- return t.find(r);
74
- const s = t;
77
+ function Jr(e, t) {
78
+ const r = Kr(e);
79
+ if ("find" in r)
80
+ return r.find(t);
81
+ const s = r;
75
82
  for (let n = 0; n < s.length; n++) {
76
- const o = s[n];
77
- if (r(o))
78
- return o;
83
+ const i = s[n];
84
+ if (t(i))
85
+ return i;
79
86
  }
80
87
  }
81
- function I(e, r) {
82
- Object.entries(e).forEach(([t, s]) => r(s, t));
88
+ function U(e, t) {
89
+ Object.entries(e).forEach(([r, s]) => t(s, r));
83
90
  }
84
- function W(e, r) {
85
- return e.indexOf(r) !== -1;
91
+ function Z(e, t) {
92
+ return e.indexOf(t) !== -1;
86
93
  }
87
- function he(e, r) {
88
- for (let t = 0; t < e.length; t++) {
89
- const s = e[t];
90
- if (r(s))
94
+ function _e(e, t) {
95
+ for (let r = 0; r < e.length; r++) {
96
+ const s = e[r];
97
+ if (t(s))
91
98
  return s;
92
99
  }
93
100
  }
94
- class it {
101
+ class Yr {
95
102
  constructor() {
96
103
  this.transfomers = {};
97
104
  }
98
- register(r) {
99
- this.transfomers[r.name] = r;
105
+ register(t) {
106
+ this.transfomers[t.name] = t;
100
107
  }
101
- findApplicable(r) {
102
- return nt(this.transfomers, (t) => t.isApplicable(r));
108
+ findApplicable(t) {
109
+ return Jr(this.transfomers, (r) => r.isApplicable(t));
103
110
  }
104
- findByName(r) {
105
- return this.transfomers[r];
111
+ findByName(t) {
112
+ return this.transfomers[t];
106
113
  }
107
114
  }
108
- const ot = (e) => Object.prototype.toString.call(e).slice(8, -1), xe = (e) => typeof e == "undefined", at = (e) => e === null, B = (e) => typeof e != "object" || e === null || e === Object.prototype ? !1 : Object.getPrototypeOf(e) === null ? !0 : Object.getPrototypeOf(e) === Object.prototype, Z = (e) => B(e) && Object.keys(e).length === 0, D = (e) => Array.isArray(e), ut = (e) => typeof e == "string", ct = (e) => typeof e == "number" && !isNaN(e), lt = (e) => typeof e == "boolean", ft = (e) => e instanceof RegExp, k = (e) => e instanceof Map, L = (e) => e instanceof Set, De = (e) => ot(e) === "Symbol", dt = (e) => e instanceof Date && !isNaN(e.valueOf()), mt = (e) => e instanceof Error, be = (e) => typeof e == "number" && isNaN(e), pt = (e) => lt(e) || at(e) || xe(e) || ct(e) || ut(e) || De(e), yt = (e) => typeof e == "bigint", gt = (e) => e === 1 / 0 || e === -1 / 0, ht = (e) => ArrayBuffer.isView(e) && !(e instanceof DataView), bt = (e) => e instanceof URL, Me = (e) => e.replace(/\./g, "\\."), Q = (e) => e.map(String).map(Me).join("."), P = (e) => {
109
- const r = [];
110
- let t = "";
115
+ const Gr = (e) => Object.prototype.toString.call(e).slice(8, -1), st = (e) => typeof e == "undefined", Qr = (e) => e === null, K = (e) => typeof e != "object" || e === null || e === Object.prototype ? !1 : Object.getPrototypeOf(e) === null ? !0 : Object.getPrototypeOf(e) === Object.prototype, fe = (e) => K(e) && Object.keys(e).length === 0, R = (e) => Array.isArray(e), Hr = (e) => typeof e == "string", Xr = (e) => typeof e == "number" && !isNaN(e), Zr = (e) => typeof e == "boolean", es = (e) => e instanceof RegExp, J = (e) => e instanceof Map, Y = (e) => e instanceof Set, nt = (e) => Gr(e) === "Symbol", ts = (e) => e instanceof Date && !isNaN(e.valueOf()), rs = (e) => e instanceof Error, Ue = (e) => typeof e == "number" && isNaN(e), ss = (e) => Zr(e) || Qr(e) || st(e) || Xr(e) || Hr(e) || nt(e), ns = (e) => typeof e == "bigint", is = (e) => e === 1 / 0 || e === -1 / 0, os = (e) => ArrayBuffer.isView(e) && !(e instanceof DataView), as = (e) => e instanceof URL, it = (e) => e.replace(/\./g, "\\."), ae = (e) => e.map(String).map(it).join("."), W = (e) => {
116
+ const t = [];
117
+ let r = "";
111
118
  for (let n = 0; n < e.length; n++) {
112
- let o = e.charAt(n);
113
- if (o === "\\" && e.charAt(n + 1) === ".") {
114
- t += ".", n++;
119
+ let i = e.charAt(n);
120
+ if (i === "\\" && e.charAt(n + 1) === ".") {
121
+ r += ".", n++;
115
122
  continue;
116
123
  }
117
- if (o === ".") {
118
- r.push(t), t = "";
124
+ if (i === ".") {
125
+ t.push(r), r = "";
119
126
  continue;
120
127
  }
121
- t += o;
128
+ r += i;
122
129
  }
123
- const s = t;
124
- return r.push(s), r;
130
+ const s = r;
131
+ return t.push(s), t;
125
132
  };
126
- function $(e, r, t, s) {
133
+ function v(e, t, r, s) {
127
134
  return {
128
135
  isApplicable: e,
129
- annotation: r,
130
- transform: t,
136
+ annotation: t,
137
+ transform: r,
131
138
  untransform: s
132
139
  };
133
140
  }
134
- const Se = [
135
- $(xe, "undefined", () => null, () => {
141
+ const ot = [
142
+ v(st, "undefined", () => null, () => {
136
143
  }),
137
- $(yt, "bigint", (e) => e.toString(), (e) => typeof BigInt != "undefined" ? BigInt(e) : (console.error("Please add a BigInt polyfill."), e)),
138
- $(dt, "Date", (e) => e.toISOString(), (e) => new Date(e)),
139
- $(mt, "Error", (e, r) => {
140
- const t = {
144
+ v(ns, "bigint", (e) => e.toString(), (e) => typeof BigInt != "undefined" ? BigInt(e) : (console.error("Please add a BigInt polyfill."), e)),
145
+ v(ts, "Date", (e) => e.toISOString(), (e) => new Date(e)),
146
+ v(rs, "Error", (e, t) => {
147
+ const r = {
141
148
  name: e.name,
142
149
  message: e.message
143
150
  };
144
- return r.allowedErrorProps.forEach((s) => {
145
- t[s] = e[s];
146
- }), t;
147
- }, (e, r) => {
148
- const t = new Error(e.message);
149
- return t.name = e.name, t.stack = e.stack, r.allowedErrorProps.forEach((s) => {
150
- t[s] = e[s];
151
- }), t;
151
+ return t.allowedErrorProps.forEach((s) => {
152
+ r[s] = e[s];
153
+ }), r;
154
+ }, (e, t) => {
155
+ const r = new Error(e.message);
156
+ return r.name = e.name, r.stack = e.stack, t.allowedErrorProps.forEach((s) => {
157
+ r[s] = e[s];
158
+ }), r;
152
159
  }),
153
- $(ft, "regexp", (e) => "" + e, (e) => {
154
- const r = e.slice(1, e.lastIndexOf("/")), t = e.slice(e.lastIndexOf("/") + 1);
155
- return new RegExp(r, t);
160
+ v(es, "regexp", (e) => "" + e, (e) => {
161
+ const t = e.slice(1, e.lastIndexOf("/")), r = e.slice(e.lastIndexOf("/") + 1);
162
+ return new RegExp(t, r);
156
163
  }),
157
- $(
158
- L,
164
+ v(
165
+ Y,
159
166
  "set",
160
167
  // (sets only exist in es6+)
161
168
  // eslint-disable-next-line es5/no-es6-methods
162
169
  (e) => [...e.values()],
163
170
  (e) => new Set(e)
164
171
  ),
165
- $(k, "map", (e) => [...e.entries()], (e) => new Map(e)),
166
- $((e) => be(e) || gt(e), "number", (e) => be(e) ? "NaN" : e > 0 ? "Infinity" : "-Infinity", Number),
167
- $((e) => e === 0 && 1 / e === -1 / 0, "number", () => "-0", Number),
168
- $(bt, "URL", (e) => e.toString(), (e) => new URL(e))
172
+ v(J, "map", (e) => [...e.entries()], (e) => new Map(e)),
173
+ v((e) => Ue(e) || is(e), "number", (e) => Ue(e) ? "NaN" : e > 0 ? "Infinity" : "-Infinity", Number),
174
+ v((e) => e === 0 && 1 / e === -1 / 0, "number", () => "-0", Number),
175
+ v(as, "URL", (e) => e.toString(), (e) => new URL(e))
169
176
  ];
170
- function j(e, r, t, s) {
177
+ function se(e, t, r, s) {
171
178
  return {
172
179
  isApplicable: e,
173
- annotation: r,
174
- transform: t,
180
+ annotation: t,
181
+ transform: r,
175
182
  untransform: s
176
183
  };
177
184
  }
178
- const Te = j((e, r) => De(e) ? !!r.symbolRegistry.getIdentifier(e) : !1, (e, r) => ["symbol", r.symbolRegistry.getIdentifier(e)], (e) => e.description, (e, r, t) => {
179
- const s = t.symbolRegistry.getValue(r[1]);
185
+ const at = se((e, t) => nt(e) ? !!t.symbolRegistry.getIdentifier(e) : !1, (e, t) => ["symbol", t.symbolRegistry.getIdentifier(e)], (e) => e.description, (e, t, r) => {
186
+ const s = r.symbolRegistry.getValue(t[1]);
180
187
  if (!s)
181
188
  throw new Error("Trying to deserialize unknown symbol");
182
189
  return s;
183
- }), Ft = [
190
+ }), us = [
184
191
  Int8Array,
185
192
  Uint8Array,
186
193
  Int16Array,
@@ -190,124 +197,124 @@ const Te = j((e, r) => De(e) ? !!r.symbolRegistry.getIdentifier(e) : !1, (e, r)
190
197
  Float32Array,
191
198
  Float64Array,
192
199
  Uint8ClampedArray
193
- ].reduce((e, r) => (e[r.name] = r, e), {}), Ne = j(ht, (e) => ["typed-array", e.constructor.name], (e) => [...e], (e, r) => {
194
- const t = Ft[r[1]];
195
- if (!t)
200
+ ].reduce((e, t) => (e[t.name] = t, e), {}), ut = se(os, (e) => ["typed-array", e.constructor.name], (e) => [...e], (e, t) => {
201
+ const r = us[t[1]];
202
+ if (!r)
196
203
  throw new Error("Trying to deserialize unknown typed array");
197
- return new t(e);
204
+ return new r(e);
198
205
  });
199
- function Re(e, r) {
200
- return e != null && e.constructor ? !!r.classRegistry.getIdentifier(e.constructor) : !1;
206
+ function ct(e, t) {
207
+ return e != null && e.constructor ? !!t.classRegistry.getIdentifier(e.constructor) : !1;
201
208
  }
202
- const Oe = j(Re, (e, r) => ["class", r.classRegistry.getIdentifier(e.constructor)], (e, r) => {
203
- const t = r.classRegistry.getAllowedProps(e.constructor);
204
- if (!t)
205
- return p({}, e);
209
+ const lt = se(ct, (e, t) => ["class", t.classRegistry.getIdentifier(e.constructor)], (e, t) => {
210
+ const r = t.classRegistry.getAllowedProps(e.constructor);
211
+ if (!r)
212
+ return g({}, e);
206
213
  const s = {};
207
- return t.forEach((n) => {
214
+ return r.forEach((n) => {
208
215
  s[n] = e[n];
209
216
  }), s;
210
- }, (e, r, t) => {
211
- const s = t.classRegistry.getValue(r[1]);
217
+ }, (e, t, r) => {
218
+ const s = r.classRegistry.getValue(t[1]);
212
219
  if (!s)
213
- throw new Error(`Trying to deserialize unknown class '${r[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);
220
+ throw new Error(`Trying to deserialize unknown class '${t[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);
214
221
  return Object.assign(Object.create(s.prototype), e);
215
- }), Ie = j((e, r) => !!r.customTransformerRegistry.findApplicable(e), (e, r) => ["custom", r.customTransformerRegistry.findApplicable(e).name], (e, r) => r.customTransformerRegistry.findApplicable(e).serialize(e), (e, r, t) => {
216
- const s = t.customTransformerRegistry.findByName(r[1]);
222
+ }), ft = se((e, t) => !!t.customTransformerRegistry.findApplicable(e), (e, t) => ["custom", t.customTransformerRegistry.findApplicable(e).name], (e, t) => t.customTransformerRegistry.findApplicable(e).serialize(e), (e, t, r) => {
223
+ const s = r.customTransformerRegistry.findByName(t[1]);
217
224
  if (!s)
218
225
  throw new Error("Trying to deserialize unknown custom value");
219
226
  return s.deserialize(e);
220
- }), wt = [Oe, Te, Ie, Ne], Fe = (e, r) => {
221
- const t = he(wt, (n) => n.isApplicable(e, r));
222
- if (t)
227
+ }), cs = [lt, at, ft, ut], je = (e, t) => {
228
+ const r = _e(cs, (n) => n.isApplicable(e, t));
229
+ if (r)
223
230
  return {
224
- value: t.transform(e, r),
225
- type: t.annotation(e, r)
231
+ value: r.transform(e, t),
232
+ type: r.annotation(e, t)
226
233
  };
227
- const s = he(Se, (n) => n.isApplicable(e, r));
234
+ const s = _e(ot, (n) => n.isApplicable(e, t));
228
235
  if (s)
229
236
  return {
230
- value: s.transform(e, r),
237
+ value: s.transform(e, t),
231
238
  type: s.annotation
232
239
  };
233
- }, ze = {};
234
- Se.forEach((e) => {
235
- ze[e.annotation] = e;
240
+ }, dt = {};
241
+ ot.forEach((e) => {
242
+ dt[e.annotation] = e;
236
243
  });
237
- const qt = (e, r, t) => {
238
- if (D(r))
239
- switch (r[0]) {
244
+ const ls = (e, t, r) => {
245
+ if (R(t))
246
+ switch (t[0]) {
240
247
  case "symbol":
241
- return Te.untransform(e, r, t);
248
+ return at.untransform(e, t, r);
242
249
  case "class":
243
- return Oe.untransform(e, r, t);
250
+ return lt.untransform(e, t, r);
244
251
  case "custom":
245
- return Ie.untransform(e, r, t);
252
+ return ft.untransform(e, t, r);
246
253
  case "typed-array":
247
- return Ne.untransform(e, r, t);
254
+ return ut.untransform(e, t, r);
248
255
  default:
249
- throw new Error("Unknown transformation: " + r);
256
+ throw new Error("Unknown transformation: " + t);
250
257
  }
251
258
  else {
252
- const s = ze[r];
259
+ const s = dt[t];
253
260
  if (!s)
254
- throw new Error("Unknown transformation: " + r);
255
- return s.untransform(e, t);
261
+ throw new Error("Unknown transformation: " + t);
262
+ return s.untransform(e, r);
256
263
  }
257
- }, R = (e, r) => {
258
- if (r > e.size)
264
+ }, P = (e, t) => {
265
+ if (t > e.size)
259
266
  throw new Error("index out of bounds");
260
- const t = e.keys();
261
- for (; r > 0; )
262
- t.next(), r--;
263
- return t.next().value;
267
+ const r = e.keys();
268
+ for (; t > 0; )
269
+ r.next(), t--;
270
+ return r.next().value;
264
271
  };
265
- function Pe(e) {
266
- if (W(e, "__proto__"))
272
+ function mt(e) {
273
+ if (Z(e, "__proto__"))
267
274
  throw new Error("__proto__ is not allowed as a property");
268
- if (W(e, "prototype"))
275
+ if (Z(e, "prototype"))
269
276
  throw new Error("prototype is not allowed as a property");
270
- if (W(e, "constructor"))
277
+ if (Z(e, "constructor"))
271
278
  throw new Error("constructor is not allowed as a property");
272
279
  }
273
- const Et = (e, r) => {
274
- Pe(r);
275
- for (let t = 0; t < r.length; t++) {
276
- const s = r[t];
277
- if (L(e))
278
- e = R(e, +s);
279
- else if (k(e)) {
280
- const n = +s, o = +r[++t] == 0 ? "key" : "value", i = R(e, n);
281
- switch (o) {
280
+ const fs = (e, t) => {
281
+ mt(t);
282
+ for (let r = 0; r < t.length; r++) {
283
+ const s = t[r];
284
+ if (Y(e))
285
+ e = P(e, +s);
286
+ else if (J(e)) {
287
+ const n = +s, i = +t[++r] == 0 ? "key" : "value", o = P(e, n);
288
+ switch (i) {
282
289
  case "key":
283
- e = i;
290
+ e = o;
284
291
  break;
285
292
  case "value":
286
- e = e.get(i);
293
+ e = e.get(o);
287
294
  break;
288
295
  }
289
296
  } else
290
297
  e = e[s];
291
298
  }
292
299
  return e;
293
- }, X = (e, r, t) => {
294
- if (Pe(r), r.length === 0)
295
- return t(e);
300
+ }, de = (e, t, r) => {
301
+ if (mt(t), t.length === 0)
302
+ return r(e);
296
303
  let s = e;
297
- for (let o = 0; o < r.length - 1; o++) {
298
- const i = r[o];
299
- if (D(s)) {
300
- const a = +i;
304
+ for (let i = 0; i < t.length - 1; i++) {
305
+ const o = t[i];
306
+ if (R(s)) {
307
+ const a = +o;
301
308
  s = s[a];
302
- } else if (B(s))
303
- s = s[i];
304
- else if (L(s)) {
305
- const a = +i;
306
- s = R(s, a);
307
- } else if (k(s)) {
308
- if (o === r.length - 2)
309
+ } else if (K(s))
310
+ s = s[o];
311
+ else if (Y(s)) {
312
+ const a = +o;
313
+ s = P(s, a);
314
+ } else if (J(s)) {
315
+ if (i === t.length - 2)
309
316
  break;
310
- const u = +i, c = +r[++o] == 0 ? "key" : "value", m = R(s, u);
317
+ const u = +o, c = +t[++i] == 0 ? "key" : "value", m = P(s, u);
311
318
  switch (c) {
312
319
  case "key":
313
320
  s = m;
@@ -318,352 +325,354 @@ const Et = (e, r) => {
318
325
  }
319
326
  }
320
327
  }
321
- const n = r[r.length - 1];
322
- if (D(s) ? s[+n] = t(s[+n]) : B(s) && (s[n] = t(s[n])), L(s)) {
323
- const o = R(s, +n), i = t(o);
324
- o !== i && (s.delete(o), s.add(i));
328
+ const n = t[t.length - 1];
329
+ if (R(s) ? s[+n] = r(s[+n]) : K(s) && (s[n] = r(s[n])), Y(s)) {
330
+ const i = P(s, +n), o = r(i);
331
+ i !== o && (s.delete(i), s.add(o));
325
332
  }
326
- if (k(s)) {
327
- const o = +r[r.length - 2], i = R(s, o);
333
+ if (J(s)) {
334
+ const i = +t[t.length - 2], o = P(s, i);
328
335
  switch (+n == 0 ? "key" : "value") {
329
336
  case "key": {
330
- const u = t(i);
331
- s.set(u, s.get(i)), u !== i && s.delete(i);
337
+ const u = r(o);
338
+ s.set(u, s.get(o)), u !== o && s.delete(o);
332
339
  break;
333
340
  }
334
341
  case "value": {
335
- s.set(i, t(s.get(i)));
342
+ s.set(o, r(s.get(o)));
336
343
  break;
337
344
  }
338
345
  }
339
346
  }
340
347
  return e;
341
348
  };
342
- function v(e, r, t = []) {
349
+ function me(e, t, r = []) {
343
350
  if (!e)
344
351
  return;
345
- if (!D(e)) {
346
- I(e, (o, i) => v(o, r, [...t, ...P(i)]));
352
+ if (!R(e)) {
353
+ U(e, (i, o) => me(i, t, [...r, ...W(o)]));
347
354
  return;
348
355
  }
349
356
  const [s, n] = e;
350
- n && I(n, (o, i) => {
351
- v(o, r, [...t, ...P(i)]);
352
- }), r(s, t);
357
+ n && U(n, (i, o) => {
358
+ me(i, t, [...r, ...W(o)]);
359
+ }), t(s, r);
353
360
  }
354
- function Ct(e, r, t) {
355
- return v(r, (s, n) => {
356
- e = X(e, n, (o) => qt(o, s, t));
361
+ function ds(e, t, r) {
362
+ return me(t, (s, n) => {
363
+ e = de(e, n, (i) => ls(i, s, r));
357
364
  }), e;
358
365
  }
359
- function $t(e, r) {
360
- function t(s, n) {
361
- const o = Et(e, P(n));
362
- s.map(P).forEach((i) => {
363
- e = X(e, i, () => o);
366
+ function ms(e, t) {
367
+ function r(s, n) {
368
+ const i = fs(e, W(n));
369
+ s.map(W).forEach((o) => {
370
+ e = de(e, o, () => i);
364
371
  });
365
372
  }
366
- if (D(r)) {
367
- const [s, n] = r;
368
- s.forEach((o) => {
369
- e = X(e, P(o), () => e);
370
- }), n && I(n, t);
373
+ if (R(t)) {
374
+ const [s, n] = t;
375
+ s.forEach((i) => {
376
+ e = de(e, W(i), () => e);
377
+ }), n && U(n, r);
371
378
  } else
372
- I(r, t);
379
+ U(t, r);
373
380
  return e;
374
381
  }
375
- const At = (e, r) => B(e) || D(e) || k(e) || L(e) || Re(e, r);
376
- function xt(e, r, t) {
377
- const s = t.get(e);
378
- s ? s.push(r) : t.set(e, [r]);
382
+ const ps = (e, t) => K(e) || R(e) || J(e) || Y(e) || ct(e, t);
383
+ function ys(e, t, r) {
384
+ const s = r.get(e);
385
+ s ? s.push(t) : r.set(e, [t]);
379
386
  }
380
- function Dt(e, r) {
381
- const t = {};
387
+ function gs(e, t) {
388
+ const r = {};
382
389
  let s;
383
390
  return e.forEach((n) => {
384
391
  if (n.length <= 1)
385
392
  return;
386
- r || (n = n.map((a) => a.map(String)).sort((a, u) => a.length - u.length));
387
- const [o, ...i] = n;
388
- o.length === 0 ? s = i.map(Q) : t[Q(o)] = i.map(Q);
389
- }), s ? Z(t) ? [s] : [s, t] : Z(t) ? void 0 : t;
390
- }
391
- const Be = (e, r, t, s, n = [], o = [], i = /* @__PURE__ */ new Map()) => {
392
- var g;
393
- const a = pt(e);
393
+ t || (n = n.map((a) => a.map(String)).sort((a, u) => a.length - u.length));
394
+ const [i, ...o] = n;
395
+ i.length === 0 ? s = o.map(ae) : r[ae(i)] = o.map(ae);
396
+ }), s ? fe(r) ? [s] : [s, r] : fe(r) ? void 0 : r;
397
+ }
398
+ const pt = (e, t, r, s, n = [], i = [], o = /* @__PURE__ */ new Map()) => {
399
+ var h;
400
+ const a = ss(e);
394
401
  if (!a) {
395
- xt(e, n, r);
396
- const f = i.get(e);
397
- if (f)
402
+ ys(e, n, t);
403
+ const p = o.get(e);
404
+ if (p)
398
405
  return s ? {
399
406
  transformedValue: null
400
- } : f;
407
+ } : p;
401
408
  }
402
- if (!At(e, t)) {
403
- const f = Fe(e, t), h = f ? {
404
- transformedValue: f.value,
405
- annotations: [f.type]
409
+ if (!ps(e, r)) {
410
+ const p = je(e, r), d = p ? {
411
+ transformedValue: p.value,
412
+ annotations: [p.type]
406
413
  } : {
407
414
  transformedValue: e
408
415
  };
409
- return a || i.set(e, h), h;
416
+ return a || o.set(e, d), d;
410
417
  }
411
- if (W(o, e))
418
+ if (Z(i, e))
412
419
  return {
413
420
  transformedValue: null
414
421
  };
415
- const u = Fe(e, t), c = (g = u == null ? void 0 : u.value) != null ? g : e, m = D(c) ? [] : {}, d = {};
416
- I(c, (f, h) => {
417
- if (h === "__proto__" || h === "constructor" || h === "prototype")
418
- throw new Error(`Detected property ${h}. This is a prototype pollution risk, please remove it from your object.`);
419
- const A = Be(f, r, t, s, [...n, h], [...o, e], i);
420
- m[h] = A.transformedValue, D(A.annotations) ? d[h] = A.annotations : B(A.annotations) && I(A.annotations, (z, N) => {
421
- d[Me(h) + "." + N] = z;
422
+ const u = je(e, r), c = (h = u == null ? void 0 : u.value) != null ? h : e, m = R(c) ? [] : {}, l = {};
423
+ U(c, (p, d) => {
424
+ if (d === "__proto__" || d === "constructor" || d === "prototype")
425
+ throw new Error(`Detected property ${d}. This is a prototype pollution risk, please remove it from your object.`);
426
+ const b = pt(p, t, r, s, [...n, d], [...i, e], o);
427
+ m[d] = b.transformedValue, R(b.annotations) ? l[d] = b.annotations : K(b.annotations) && U(b.annotations, (A, O) => {
428
+ l[it(d) + "." + O] = A;
422
429
  });
423
430
  });
424
- const y = Z(d) ? {
431
+ const f = fe(l) ? {
425
432
  transformedValue: m,
426
433
  annotations: u ? [u.type] : void 0
427
434
  } : {
428
435
  transformedValue: m,
429
- annotations: u ? [u.type, d] : d
436
+ annotations: u ? [u.type, l] : l
430
437
  };
431
- return a || i.set(e, y), y;
438
+ return a || o.set(e, f), f;
432
439
  };
433
- function ke(e) {
440
+ function yt(e) {
434
441
  return Object.prototype.toString.call(e).slice(8, -1);
435
442
  }
436
- function we(e) {
437
- return ke(e) === "Array";
443
+ function Ve(e) {
444
+ return yt(e) === "Array";
438
445
  }
439
- function Mt(e) {
440
- if (ke(e) !== "Object")
446
+ function hs(e) {
447
+ if (yt(e) !== "Object")
441
448
  return !1;
442
- const r = Object.getPrototypeOf(e);
443
- return !!r && r.constructor === Object && r === Object.prototype;
449
+ const t = Object.getPrototypeOf(e);
450
+ return !!t && t.constructor === Object && t === Object.prototype;
444
451
  }
445
- function St(e, r, t, s, n) {
446
- const o = {}.propertyIsEnumerable.call(s, r) ? "enumerable" : "nonenumerable";
447
- o === "enumerable" && (e[r] = t), n && o === "nonenumerable" && Object.defineProperty(e, r, {
448
- value: t,
452
+ function bs(e, t, r, s, n) {
453
+ const i = {}.propertyIsEnumerable.call(s, t) ? "enumerable" : "nonenumerable";
454
+ i === "enumerable" && (e[t] = r), n && i === "nonenumerable" && Object.defineProperty(e, t, {
455
+ value: r,
449
456
  enumerable: !1,
450
457
  writable: !0,
451
458
  configurable: !0
452
459
  });
453
460
  }
454
- function ee(e, r = {}) {
455
- if (we(e))
456
- return e.map((n) => ee(n, r));
457
- if (!Mt(e))
461
+ function pe(e, t = {}) {
462
+ if (Ve(e))
463
+ return e.map((n) => pe(n, t));
464
+ if (!hs(e))
458
465
  return e;
459
- const t = Object.getOwnPropertyNames(e), s = Object.getOwnPropertySymbols(e);
460
- return [...t, ...s].reduce((n, o) => {
461
- if (we(r.props) && !r.props.includes(o))
466
+ const r = Object.getOwnPropertyNames(e), s = Object.getOwnPropertySymbols(e);
467
+ return [...r, ...s].reduce((n, i) => {
468
+ if (Ve(t.props) && !t.props.includes(i))
462
469
  return n;
463
- const i = e[o], a = ee(i, r);
464
- return St(n, o, a, e, r.nonenumerable), n;
470
+ const o = e[i], a = pe(o, t);
471
+ return bs(n, i, a, e, t.nonenumerable), n;
465
472
  }, {});
466
473
  }
467
- class l {
474
+ class y {
468
475
  /**
469
476
  * @param dedupeReferentialEqualities If true, SuperJSON will make sure only one instance of referentially equal objects are serialized and the rest are replaced with `null`.
470
477
  */
471
- constructor({ dedupe: r = !1 } = {}) {
472
- this.classRegistry = new tt(), this.symbolRegistry = new Ae((t) => {
478
+ constructor({ dedupe: t = !1 } = {}) {
479
+ this.classRegistry = new Wr(), this.symbolRegistry = new rt((r) => {
473
480
  var s;
474
- return (s = t.description) != null ? s : "";
475
- }), this.customTransformerRegistry = new it(), this.allowedErrorProps = [], this.dedupe = r;
481
+ return (s = r.description) != null ? s : "";
482
+ }), this.customTransformerRegistry = new Yr(), this.allowedErrorProps = [], this.dedupe = t;
476
483
  }
477
- serialize(r) {
478
- const t = /* @__PURE__ */ new Map(), s = Be(r, t, this, this.dedupe), n = {
484
+ serialize(t) {
485
+ const r = /* @__PURE__ */ new Map(), s = pt(t, r, this, this.dedupe), n = {
479
486
  json: s.transformedValue
480
487
  };
481
- s.annotations && (n.meta = b(p({}, n.meta), {
488
+ s.annotations && (n.meta = F(g({}, n.meta), {
482
489
  values: s.annotations
483
490
  }));
484
- const o = Dt(t, this.dedupe);
485
- return o && (n.meta = b(p({}, n.meta), {
486
- referentialEqualities: o
491
+ const i = gs(r, this.dedupe);
492
+ return i && (n.meta = F(g({}, n.meta), {
493
+ referentialEqualities: i
487
494
  })), n;
488
495
  }
489
- deserialize(r) {
490
- const { json: t, meta: s } = r;
491
- let n = ee(t);
492
- return s != null && s.values && (n = Ct(n, s.values, this)), s != null && s.referentialEqualities && (n = $t(n, s.referentialEqualities)), n;
496
+ deserialize(t) {
497
+ const { json: r, meta: s } = t;
498
+ let n = pe(r);
499
+ return s != null && s.values && (n = ds(n, s.values, this)), s != null && s.referentialEqualities && (n = ms(n, s.referentialEqualities)), n;
493
500
  }
494
- stringify(r) {
495
- return JSON.stringify(this.serialize(r));
501
+ stringify(t) {
502
+ return JSON.stringify(this.serialize(t));
496
503
  }
497
- parse(r) {
498
- return this.deserialize(JSON.parse(r));
504
+ parse(t) {
505
+ return this.deserialize(JSON.parse(t));
499
506
  }
500
- registerClass(r, t) {
501
- this.classRegistry.register(r, t);
507
+ registerClass(t, r) {
508
+ this.classRegistry.register(t, r);
502
509
  }
503
- registerSymbol(r, t) {
504
- this.symbolRegistry.register(r, t);
510
+ registerSymbol(t, r) {
511
+ this.symbolRegistry.register(t, r);
505
512
  }
506
- registerCustom(r, t) {
507
- this.customTransformerRegistry.register(p({
508
- name: t
509
- }, r));
513
+ registerCustom(t, r) {
514
+ this.customTransformerRegistry.register(g({
515
+ name: r
516
+ }, t));
510
517
  }
511
- allowErrorProps(...r) {
512
- this.allowedErrorProps.push(...r);
518
+ allowErrorProps(...t) {
519
+ this.allowedErrorProps.push(...t);
513
520
  }
514
521
  }
515
- l.defaultInstance = new l();
516
- l.serialize = l.defaultInstance.serialize.bind(l.defaultInstance);
517
- l.deserialize = l.defaultInstance.deserialize.bind(l.defaultInstance);
518
- l.stringify = l.defaultInstance.stringify.bind(l.defaultInstance);
519
- l.parse = l.defaultInstance.parse.bind(l.defaultInstance);
520
- l.registerClass = l.defaultInstance.registerClass.bind(l.defaultInstance);
521
- l.registerSymbol = l.defaultInstance.registerSymbol.bind(l.defaultInstance);
522
- l.registerCustom = l.defaultInstance.registerCustom.bind(l.defaultInstance);
523
- l.allowErrorProps = l.defaultInstance.allowErrorProps.bind(l.defaultInstance);
524
- const T = (e) => e === void 0 ? ne.None : e, Tt = (e) => new nr(e.metadataItem, e.type), oe = (e) => new qr(
522
+ y.defaultInstance = new y();
523
+ y.serialize = y.defaultInstance.serialize.bind(y.defaultInstance);
524
+ y.deserialize = y.defaultInstance.deserialize.bind(y.defaultInstance);
525
+ y.stringify = y.defaultInstance.stringify.bind(y.defaultInstance);
526
+ y.parse = y.defaultInstance.parse.bind(y.defaultInstance);
527
+ y.registerClass = y.defaultInstance.registerClass.bind(y.defaultInstance);
528
+ y.registerSymbol = y.defaultInstance.registerSymbol.bind(y.defaultInstance);
529
+ y.registerCustom = y.defaultInstance.registerCustom.bind(y.defaultInstance);
530
+ y.allowErrorProps = y.defaultInstance.allowErrorProps.bind(y.defaultInstance);
531
+ const z = (e) => e === void 0 ? B.None : e, Fs = (e) => new Vt(e.metadataItem, e.type), we = (e) => new ar(
525
532
  e.name,
526
533
  e.expression,
527
534
  e.type,
528
535
  e.description,
529
- T(e.sort),
536
+ z(e.sort),
530
537
  e.dataSource,
531
538
  e.composeCode
532
- ), ae = (e) => new Er(
539
+ ), qe = (e) => new ur(
533
540
  e.name,
534
541
  e.expression,
535
542
  e.granularity,
536
543
  e.format,
537
544
  e.description,
538
- T(e.sort),
545
+ z(e.sort),
539
546
  e.dataSource,
540
547
  e.composeCode
541
- ), q = (e) => {
548
+ ), D = (e) => {
542
549
  switch (e.__serializable) {
543
550
  case "DimensionalAttribute":
544
- return oe(e);
551
+ return we(e);
545
552
  case "DimensionalLevelAttribute":
546
- return ae(e);
553
+ return qe(e);
547
554
  default:
548
555
  return e;
549
556
  }
550
- }, Le = (e) => new Xr(
557
+ }, gt = (e) => new Lr(
551
558
  e.name,
552
559
  e.expression,
553
- e.attributes.map(q),
554
- e.dimensions.map(Nt),
560
+ e.attributes.map(D),
561
+ e.dimensions.map(ws),
555
562
  e.type,
556
563
  e.description,
557
- T(e.sort),
564
+ z(e.sort),
558
565
  e.dataSource,
559
566
  e.composeCode,
560
- e.defaultAttribute ? q(e.defaultAttribute) : void 0
561
- ), Ve = (e) => new vr(
567
+ e.defaultAttribute ? D(e.defaultAttribute) : void 0
568
+ ), ht = (e) => new _r(
562
569
  e.name,
563
570
  e.expression,
564
571
  e.description,
565
- T(e.sort),
572
+ z(e.sort),
566
573
  e.dataSource,
567
- e.composeCode
568
- ), Nt = (e) => {
574
+ e.composeCode,
575
+ e.indexed,
576
+ e.merged
577
+ ), ws = (e) => {
569
578
  switch (e.__serializable) {
570
579
  case "DimensionalDimension":
571
- return Le(e);
580
+ return gt(e);
572
581
  case "DimensionalDateDimension":
573
- return Ve(e);
582
+ return ht(e);
574
583
  default:
575
584
  return e;
576
585
  }
577
- }, ue = (e) => new Cr(
586
+ }, Ae = (e) => new cr(
578
587
  e.name,
579
- q(e.attribute),
588
+ D(e.attribute),
580
589
  e.aggregation,
581
590
  e.format,
582
591
  e.description,
583
- T(e.sort),
592
+ z(e.sort),
584
593
  e.dataSource,
585
594
  e.composeCode
586
- ), ce = (e) => {
587
- const r = Object.fromEntries(
588
- Object.entries(e.context).map(([t, s]) => {
595
+ ), Ce = (e) => {
596
+ const t = Object.fromEntries(
597
+ Object.entries(e.context).map(([r, s]) => {
589
598
  if (s && typeof s == "object" && "__serializable" in s)
590
599
  switch (s.__serializable) {
591
600
  case "DimensionalAttribute":
592
- return [t, oe(s)];
601
+ return [r, we(s)];
593
602
  case "DimensionalLevelAttribute":
594
- return [t, ae(s)];
603
+ return [r, qe(s)];
595
604
  case "DimensionalBaseMeasure":
596
- return [t, ue(s)];
605
+ return [r, Ae(s)];
597
606
  case "DimensionalCalculatedMeasure":
598
- return [t, ce(s)];
607
+ return [r, Ce(s)];
599
608
  default:
600
- return [t, s];
609
+ return [r, s];
601
610
  }
602
- return [t, s];
611
+ return [r, s];
603
612
  })
604
613
  );
605
- return new $r(
614
+ return new lr(
606
615
  e.name,
607
616
  e.expression,
608
- r,
617
+ t,
609
618
  e.format,
610
619
  e.description,
611
- T(e.sort),
620
+ z(e.sort),
612
621
  e.dataSource,
613
622
  e.composeCode
614
623
  );
615
- }, _e = (e) => new Ar(
624
+ }, bt = (e) => new fr(
616
625
  e.name,
617
- q(e.attribute),
626
+ D(e.attribute),
618
627
  e.format,
619
628
  e.description,
620
- T(e.sort),
629
+ z(e.sort),
621
630
  e.dataSource,
622
631
  e.composeCode
623
- ), Y = (e) => {
632
+ ), ue = (e) => {
624
633
  switch (e.__serializable) {
625
634
  case "DimensionalBaseMeasure":
626
- return ue(e);
635
+ return Ae(e);
627
636
  case "DimensionalCalculatedMeasure":
628
- return ce(e);
637
+ return Ce(e);
629
638
  case "DimensionalMeasureTemplate":
630
- return _e(e);
639
+ return bt(e);
631
640
  default:
632
641
  return e;
633
642
  }
634
- }, F = (e) => {
643
+ }, C = (e) => {
635
644
  switch (e.__serializable) {
636
645
  case "MembersFilter":
637
- return new Br(
638
- q(e.attribute),
646
+ return new Cr(
647
+ D(e.attribute),
639
648
  e.members,
640
- e.config.backgroundFilter ? b(p({}, e.config), { backgroundFilter: F(e.config.backgroundFilter) }) : e.config,
649
+ e.config.backgroundFilter ? F(g({}, e.config), { backgroundFilter: C(e.config.backgroundFilter) }) : e.config,
641
650
  e.composeCode
642
651
  );
643
652
  case "LogicalAttributeFilter":
644
- return new Pr(
645
- e.filters.map((t) => F(t)),
653
+ return new Ar(
654
+ e.filters.map((r) => C(r)),
646
655
  e.operator,
647
656
  e.config,
648
657
  e.composeCode
649
658
  );
650
659
  case "CascadingFilter":
651
- return new zr(
652
- e._filters.map((t) => F(t)),
660
+ return new qr(
661
+ e._filters.map((r) => C(r)),
653
662
  e.config,
654
663
  e.composeCode
655
664
  );
656
665
  case "ExcludeFilter":
657
- return new Ir(
658
- F(e.filter),
659
- e.input ? F(e.input) : void 0,
666
+ return new wr(
667
+ C(e.filter),
668
+ e.input ? C(e.input) : void 0,
660
669
  e.config,
661
670
  e.composeCode
662
671
  );
663
672
  case "MeasureFilter":
664
- return new Or(
665
- q(e.attribute),
666
- Y(e.measure),
673
+ return new Fr(
674
+ D(e.attribute),
675
+ ue(e.measure),
667
676
  e.operatorA,
668
677
  e.valueA,
669
678
  e.operatorB,
@@ -672,25 +681,25 @@ const T = (e) => e === void 0 ? ne.None : e, Tt = (e) => new nr(e.metadataItem,
672
681
  e.composeCode
673
682
  );
674
683
  case "RankingFilter":
675
- return new Rr(
676
- q(e.attribute),
677
- Y(e.measure),
684
+ return new br(
685
+ D(e.attribute),
686
+ ue(e.measure),
678
687
  e.operator,
679
688
  e.count,
680
689
  e.config,
681
690
  e.composeCode
682
691
  );
683
692
  case "MeasureRankingFilter":
684
- return new Nr(
685
- Y(e.measure),
693
+ return new hr(
694
+ ue(e.measure),
686
695
  e.operator,
687
696
  e.count,
688
697
  e.config,
689
698
  e.composeCode
690
699
  );
691
700
  case "NumericFilter":
692
- return new Tr(
693
- q(e.attribute),
701
+ return new gr(
702
+ D(e.attribute),
694
703
  e.operatorA,
695
704
  e.valueA,
696
705
  e.operatorB,
@@ -699,26 +708,26 @@ const T = (e) => e === void 0 ? ne.None : e, Tt = (e) => new nr(e.metadataItem,
699
708
  e.composeCode
700
709
  );
701
710
  case "TextFilter":
702
- return new Sr(
703
- q(e.attribute),
711
+ return new yr(
712
+ D(e.attribute),
704
713
  e.operatorA,
705
714
  e.valueA,
706
715
  e.config,
707
716
  e.composeCode
708
717
  );
709
718
  case "DateRangeFilter": {
710
- const { valueA: t, valueB: s } = e;
711
- return new Mr(
712
- q(e.attribute),
713
- t,
719
+ const { valueA: r, valueB: s } = e;
720
+ return new pr(
721
+ D(e.attribute),
722
+ r,
714
723
  s,
715
724
  e.config,
716
725
  e.composeCode
717
726
  );
718
727
  }
719
728
  case "RelativeDateFilter":
720
- return new Dr(
721
- q(e.attribute),
729
+ return new mr(
730
+ D(e.attribute),
722
731
  e.offset,
723
732
  e.count,
724
733
  e.operator,
@@ -727,8 +736,8 @@ const T = (e) => e === void 0 ? ne.None : e, Tt = (e) => new nr(e.metadataItem,
727
736
  e.composeCode
728
737
  );
729
738
  case "CustomFilter":
730
- return new xr(
731
- q(e.attribute),
739
+ return new dr(
740
+ D(e.attribute),
732
741
  e.jaqlExpression,
733
742
  e.config,
734
743
  e.composeCode
@@ -737,433 +746,510 @@ const T = (e) => e === void 0 ? ne.None : e, Tt = (e) => new nr(e.metadataItem,
737
746
  return e;
738
747
  }
739
748
  };
740
- l.registerCustom(
749
+ y.registerCustom(
741
750
  {
742
- isApplicable: sr,
751
+ isApplicable: jt,
743
752
  serialize: (e) => e.serialize(),
744
- deserialize: (e) => Tt(e)
753
+ deserialize: (e) => Fs(e)
745
754
  },
746
755
  "JaqlElement"
747
756
  );
748
- l.registerCustom(
757
+ y.registerCustom(
749
758
  {
750
- isApplicable: ir,
759
+ isApplicable: Wt,
751
760
  serialize: (e) => e.serialize(),
752
- deserialize: (e) => oe(e)
761
+ deserialize: (e) => we(e)
753
762
  },
754
763
  "DimensionalAttribute"
755
764
  );
756
- l.registerCustom(
765
+ y.registerCustom(
757
766
  {
758
- isApplicable: or,
767
+ isApplicable: Kt,
759
768
  serialize: (e) => e.serialize(),
760
- deserialize: (e) => ae(e)
769
+ deserialize: (e) => qe(e)
761
770
  },
762
771
  "DimensionalLevelAttribute"
763
772
  );
764
- l.registerCustom(
773
+ y.registerCustom(
765
774
  {
766
- isApplicable: Hr,
775
+ isApplicable: zr,
767
776
  serialize: (e) => e.serialize(),
768
- deserialize: (e) => Le(e)
777
+ deserialize: (e) => gt(e)
769
778
  },
770
779
  "DimensionalDimension"
771
780
  );
772
- l.registerCustom(
781
+ y.registerCustom(
773
782
  {
774
- isApplicable: Zr,
783
+ isApplicable: Pr,
775
784
  serialize: (e) => e.serialize(),
776
- deserialize: (e) => Ve(e)
785
+ deserialize: (e) => ht(e)
777
786
  },
778
787
  "DimensionalDateDimension"
779
788
  );
780
- l.registerCustom(
789
+ y.registerCustom(
781
790
  {
782
- isApplicable: ar,
791
+ isApplicable: Jt,
783
792
  serialize: (e) => e.serialize(),
784
- deserialize: (e) => ue(e)
793
+ deserialize: (e) => Ae(e)
785
794
  },
786
795
  "DimensionalBaseMeasure"
787
796
  );
788
- l.registerCustom(
797
+ y.registerCustom(
789
798
  {
790
- isApplicable: ur,
799
+ isApplicable: Yt,
791
800
  serialize: (e) => e.serialize(),
792
- deserialize: (e) => ce(e)
801
+ deserialize: (e) => Ce(e)
793
802
  },
794
803
  "DimensionalCalculatedMeasure"
795
804
  );
796
- l.registerCustom(
805
+ y.registerCustom(
797
806
  {
798
- isApplicable: cr,
807
+ isApplicable: Gt,
799
808
  serialize: (e) => e.serialize(),
800
- deserialize: (e) => _e(e)
809
+ deserialize: (e) => bt(e)
801
810
  },
802
811
  "DimensionalMeasureTemplate"
803
812
  );
804
- l.registerCustom(
813
+ y.registerCustom(
805
814
  {
806
- isApplicable: se,
815
+ isApplicable: be,
807
816
  serialize: (e) => e.serialize(),
808
- deserialize: (e) => F(e)
817
+ deserialize: (e) => C(e)
809
818
  },
810
819
  "MembersFilter"
811
820
  );
812
- l.registerCustom(
821
+ y.registerCustom(
813
822
  {
814
- isApplicable: lr,
823
+ isApplicable: Qt,
815
824
  serialize: (e) => e.serialize(),
816
- deserialize: (e) => F(e)
825
+ deserialize: (e) => C(e)
817
826
  },
818
827
  "LogicalAttributeFilter"
819
828
  );
820
- l.registerCustom(
829
+ y.registerCustom(
821
830
  {
822
- isApplicable: fr,
831
+ isApplicable: Ht,
823
832
  serialize: (e) => e.serialize(),
824
- deserialize: (e) => F(e)
833
+ deserialize: (e) => C(e)
825
834
  },
826
835
  "CascadingFilter"
827
836
  );
828
- l.registerCustom(
837
+ y.registerCustom(
829
838
  {
830
- isApplicable: dr,
839
+ isApplicable: Xt,
831
840
  serialize: (e) => e.serialize(),
832
- deserialize: (e) => F(e)
841
+ deserialize: (e) => C(e)
833
842
  },
834
843
  "ExcludeFilter"
835
844
  );
836
- l.registerCustom(
845
+ y.registerCustom(
837
846
  {
838
- isApplicable: mr,
847
+ isApplicable: Zt,
839
848
  serialize: (e) => e.serialize(),
840
- deserialize: (e) => F(e)
849
+ deserialize: (e) => C(e)
841
850
  },
842
851
  "MeasureFilter"
843
852
  );
844
- l.registerCustom(
853
+ y.registerCustom(
845
854
  {
846
- isApplicable: pr,
855
+ isApplicable: er,
847
856
  serialize: (e) => e.serialize(),
848
- deserialize: (e) => F(e)
857
+ deserialize: (e) => C(e)
849
858
  },
850
859
  "RankingFilter"
851
860
  );
852
- l.registerCustom(
861
+ y.registerCustom(
853
862
  {
854
- isApplicable: yr,
863
+ isApplicable: tr,
855
864
  serialize: (e) => e.serialize(),
856
- deserialize: (e) => F(e)
865
+ deserialize: (e) => C(e)
857
866
  },
858
867
  "MeasureRankingFilter"
859
868
  );
860
- l.registerCustom(
869
+ y.registerCustom(
861
870
  {
862
- isApplicable: gr,
871
+ isApplicable: rr,
863
872
  serialize: (e) => e.serialize(),
864
- deserialize: (e) => F(e)
873
+ deserialize: (e) => C(e)
865
874
  },
866
875
  "NumericFilter"
867
876
  );
868
- l.registerCustom(
877
+ y.registerCustom(
869
878
  {
870
- isApplicable: hr,
879
+ isApplicable: sr,
871
880
  serialize: (e) => e.serialize(),
872
- deserialize: (e) => F(e)
881
+ deserialize: (e) => C(e)
873
882
  },
874
883
  "TextFilter"
875
884
  );
876
- l.registerCustom(
885
+ y.registerCustom(
877
886
  {
878
- isApplicable: br,
887
+ isApplicable: nr,
879
888
  serialize: (e) => e.serialize(),
880
- deserialize: (e) => F(e)
889
+ deserialize: (e) => C(e)
881
890
  },
882
891
  "DateRangeFilter"
883
892
  );
884
- l.registerCustom(
893
+ y.registerCustom(
885
894
  {
886
- isApplicable: Fr,
895
+ isApplicable: ir,
887
896
  serialize: (e) => e.serialize(),
888
- deserialize: (e) => F(e)
897
+ deserialize: (e) => C(e)
889
898
  },
890
899
  "RelativeDateFilter"
891
900
  );
892
- l.registerCustom(
901
+ y.registerCustom(
893
902
  {
894
- isApplicable: wr,
903
+ isApplicable: or,
895
904
  serialize: (e) => e.serialize(),
896
- deserialize: (e) => F(e)
905
+ deserialize: (e) => C(e)
897
906
  },
898
907
  "CustomFilter"
899
908
  );
900
- const zs = l, w = "DM.";
909
+ const Kn = y, q = "DM.";
910
+ function T(e) {
911
+ return typeof e == "object" && e !== null;
912
+ }
901
913
  function E(e) {
902
914
  return typeof e == "object" && e !== null && "function" in e && "args" in e;
903
915
  }
904
- function Ue(e) {
916
+ function Ft(e) {
905
917
  return e.every(E);
906
918
  }
907
- function J(e) {
919
+ function ne(e) {
908
920
  return "attribute" in e && "config" in e;
909
921
  }
910
- function _(e) {
922
+ function X(e) {
911
923
  return "left" in e && "right" in e && "operator" in e;
912
924
  }
913
- function le(e) {
914
- return !J(e) && !_(e);
925
+ function Ee(e) {
926
+ return !ne(e) && !X(e);
915
927
  }
916
- function Rt(e) {
917
- return typeof e == "object" && e !== null && "column" in e && typeof e.column == "string" && !("function" in e && "args" in e);
928
+ function qs(e) {
929
+ return T(e) && "column" in e && typeof e.column == "string" && !("function" in e && "args" in e);
918
930
  }
919
- function Ot(e) {
920
- const r = e;
921
- return typeof e != "object" || e === null || r === null || !("column" in r) ? !1 : E(r.column);
922
- }
923
- function It(e) {
924
- const r = [...e].sort((o, i) => i.name.length - o.name.length), t = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
925
- for (const o of e) {
926
- t.set(o.name, o);
927
- const i = [...o.columns].sort((u, c) => c.name.length - u.name.length);
928
- n.set(o.name, i);
931
+ function As(e) {
932
+ return !T(e) || !("column" in e) ? !1 : E(e.column);
933
+ }
934
+ const x = 3;
935
+ function M(e, t, r) {
936
+ if (t.length === 0) return;
937
+ let s = Number.MAX_SAFE_INTEGER, n;
938
+ for (const i of t) {
939
+ const o = r(i), a = jr(e, o);
940
+ a < s && (s = a, n = i);
941
+ }
942
+ return n !== void 0 ? { best: n, distance: s } : void 0;
943
+ }
944
+ function xe(e) {
945
+ const t = [...e].sort((i, o) => o.name.length - i.name.length), r = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
946
+ for (const i of e) {
947
+ r.set(i.name, i);
948
+ const o = [...i.columns].sort((u, c) => c.name.length - u.name.length);
949
+ n.set(i.name, o);
929
950
  const a = /* @__PURE__ */ new Map();
930
- for (const u of o.columns)
951
+ for (const u of i.columns)
931
952
  a.set(u.name, u);
932
- s.set(o.name, a);
953
+ s.set(i.name, a);
933
954
  }
934
955
  return {
935
- sortedTables: r,
956
+ sortedTables: t,
936
957
  tableColumnMap: n,
937
- tableMap: t,
958
+ tableMap: r,
938
959
  columnMap: s
939
960
  };
940
961
  }
941
- function We(e, r) {
942
- if (!e.startsWith(w))
962
+ function $e(e, t) {
963
+ if (!e.startsWith(q))
943
964
  throw new Error(
944
- `Invalid dimensional element name format: "${e}". Expected format: "${w}TableName.ColumnName[.Level]"`
965
+ `Invalid dimensional element name format: '${e}'. Expected format: '${q}TableName.ColumnName[.Level]'`
945
966
  );
946
- const t = e.slice(w.length);
947
- if (!t)
967
+ const r = e.slice(q.length);
968
+ if (!r)
948
969
  throw new Error(
949
- `Invalid dimensional element name format: "${e}". Expected format: "${w}TableName.ColumnName[.Level]"`
970
+ `Invalid dimensional element name format: '${e}'. Expected format: '${q}TableName.ColumnName[.Level]'`
950
971
  );
951
972
  let s, n;
952
- for (const d of r.sortedTables)
953
- if (t.startsWith(d.name + ".")) {
954
- const y = t.slice(d.name.length + 1);
955
- if (!y)
973
+ for (const d of t.sortedTables)
974
+ if (r.startsWith(d.name + ".")) {
975
+ const b = r.slice(d.name.length + 1);
976
+ if (!b)
956
977
  throw new Error(
957
- `Invalid dimensional element name format: "${e}". Expected format: "${w}TableName.ColumnName[.Level]"`
978
+ `Invalid dimensional element name format: '${e}'. Expected format: '${q}TableName.ColumnName[.Level]'`
958
979
  );
959
- s = d, n = y;
980
+ s = d, n = b;
960
981
  break;
961
982
  }
962
983
  if (!s) {
963
- const d = t.indexOf(".");
984
+ const d = r.indexOf(".");
964
985
  if (d === -1)
965
986
  throw new Error(
966
- `Invalid dimensional element name format: "${e}". Expected format: "${w}TableName.ColumnName[.Level]"`
987
+ `Invalid dimensional element name format: '${e}'. Expected format: '${q}TableName.ColumnName[.Level]'`
967
988
  );
968
- const y = t.slice(0, d);
969
- throw new Error(`Table "${y}" not found in the data model`);
970
- }
971
- const o = r.tableColumnMap.get(s.name);
972
- if (!o)
973
- throw new Error(`Table "${s.name}" found but has no columns`);
974
- let i, a;
975
- const u = U.all;
976
- for (const d of o) {
989
+ const b = r.slice(0, d), A = M(b, t.sortedTables, (oe) => oe.name), O = A && A.distance <= x ? ` Did you mean '${A.best.name}'?` : "";
990
+ throw new Error(`Table '${b}' not found in the data model.${O}`);
991
+ }
992
+ const i = t.tableColumnMap.get(s.name);
993
+ if (!i)
994
+ throw new Error(`Table '${s.name}' found but has no columns`);
995
+ let o, a;
996
+ const u = $.all;
997
+ for (const d of i) {
977
998
  if (n === d.name)
978
999
  return { table: s, column: d };
979
1000
  if (!n.startsWith(d.name + "."))
980
1001
  continue;
981
- const y = n.slice(d.name.length + 1);
982
- if (!y)
1002
+ const b = n.slice(d.name.length + 1);
1003
+ if (!b)
983
1004
  continue;
984
- const g = u.includes(y), f = ie(d.dataType);
985
- if (g) {
986
- if (f)
987
- return { table: s, column: d, level: y };
988
- i || (i = d, a = y);
1005
+ const A = u.includes(b), O = H(d.dataType);
1006
+ if (A) {
1007
+ if (O)
1008
+ return { table: s, column: d, level: b };
1009
+ o || (o = d, a = b);
989
1010
  continue;
990
1011
  }
991
- f && !i && (i = d, a = y);
1012
+ O && !o && (o = d, a = b);
992
1013
  }
993
- if (i && a)
994
- throw u.includes(a) ? new Error(
995
- `Invalid date level "${a}" in dimensional element "${e}". Column "${s.name}.${i.name}" is not a datetime column`
996
- ) : new Error(
997
- `Invalid date level "${a}" in dimensional element "${e}". Valid levels are: ${u.join(
1014
+ if (o && a) {
1015
+ if (u.includes(a))
1016
+ throw new Error(
1017
+ `Invalid date level '${a}' in dimensional element '${e}'. Column '${s.name}.${o.name}' is not a datetime column`
1018
+ );
1019
+ const d = M(a, u, (A) => A), b = d && d.distance <= x ? ` Did you mean '${d.best}'?` : "";
1020
+ throw new Error(
1021
+ `Invalid date level '${a}' in dimensional element '${e}'. Valid levels are: ${u.join(
998
1022
  ", "
999
- )}`
1023
+ )}.${b}`
1000
1024
  );
1001
- const c = n.indexOf("."), m = c === -1 ? n : n.slice(0, c);
1002
- throw new Error(`Column "${m}" not found in table "${s.name}"`);
1025
+ }
1026
+ const c = n.indexOf("."), m = c === -1 ? n : n.slice(0, c), l = M(n, i, (d) => d.name), f = l && l.distance <= x && l.best.name !== m, h = f ? ` Did you mean '${l.best.name}'?` : "", p = !f && n.endsWith(".") && (l == null ? void 0 : l.best.name) === m ? ` Use '${m}' without a trailing dot.` : "";
1027
+ throw new Error(
1028
+ `Column '${m}' not found in table '${s.name}'.${h}${p}`
1029
+ );
1003
1030
  }
1004
- function zt(e, r) {
1005
- const { table: t, column: s, level: n } = We(e, r);
1031
+ function Cs(e, t) {
1032
+ const { table: r, column: s, level: n } = $e(e, t);
1006
1033
  if (n) {
1007
- if (!ie(s.dataType))
1034
+ if (!H(s.dataType))
1008
1035
  throw new Error(
1009
- `Invalid date level "${n}" in dimensional element "${e}". Column "${t.name}.${s.name}" is not a datetime column`
1036
+ `Invalid date level '${n}' in dimensional element '${e}'. Column '${r.name}.${s.name}' is not a datetime column`
1010
1037
  );
1011
- const o = U.all;
1012
- if (!o.includes(n))
1038
+ const i = $.all;
1039
+ if (!i.includes(n))
1013
1040
  throw new Error(
1014
- `Invalid date level "${n}" in dimensional element "${e}". Valid levels are: ${o.join(
1041
+ `Invalid date level '${n}' in dimensional element '${e}'. Valid levels are: ${i.join(
1015
1042
  ", "
1016
1043
  )}`
1017
1044
  );
1018
- const i = U.dateOnly;
1019
- if (s.dataType === "date" && !i.includes(n))
1045
+ const o = $.dateOnly;
1046
+ if (s.dataType === "date" && !o.includes(n))
1020
1047
  throw new Error(
1021
- `Invalid level "${n}" in dimensional element "${e}". Column "${t.name}.${s.name}" is only a date column, not a datetime column`
1048
+ `Invalid level '${n}' in dimensional element '${e}'. Column '${r.name}.${s.name}' is only a date column, not a datetime column`
1022
1049
  );
1023
- const a = U.timeOnly;
1050
+ const a = $.timeOnly;
1024
1051
  if (s.dataType === "time" && !a.includes(n))
1025
1052
  throw new Error(
1026
- `Invalid level "${n}" in dimensional element "${e}". Column "${t.name}.${s.name}" is only a time column, not a date column`
1053
+ `Invalid level '${n}' in dimensional element '${e}'. Column '${r.name}.${s.name}' is only a time column, not a date column`
1027
1054
  );
1028
1055
  }
1029
- return { column: s, level: n };
1056
+ return { table: r, column: s, level: n };
1030
1057
  }
1031
- function je(e) {
1032
- return e.type === O.TextAttribute;
1033
- }
1034
- function Je(e) {
1035
- return e.type === O.NumericAttribute;
1036
- }
1037
- function Pt(e) {
1038
- return e.type === O.DateLevel;
1039
- }
1040
- function Bt(e) {
1041
- return je(e) || Je(e);
1042
- }
1043
- function G(e) {
1044
- return e.type === O.TextAttribute ? "text" : e.type === O.NumericAttribute ? "numeric" : e.type === O.DateLevel ? "date/datetime" : "unknown";
1045
- }
1046
- function K(e, r, t) {
1047
- const { column: s, level: n } = zt(e, t);
1048
- return kr({
1049
- expression: s.expression,
1050
- dataType: s.dataType,
1051
- granularity: n,
1058
+ function G(e, t, r, s) {
1059
+ const { table: n, column: i, level: o } = Cs(e, r);
1060
+ let a = o;
1061
+ if (H(i.dataType) && a === void 0 && (s != null && s.inferredDateLevel)) {
1062
+ const u = s.inferredDateLevel, c = $.all;
1063
+ if (!c.includes(u))
1064
+ throw new Error(
1065
+ `Invalid inferred date level '${u}'. Valid levels are: ${c.join(", ")}`
1066
+ );
1067
+ const m = `${e}.${u}`, l = $.dateOnly;
1068
+ if (i.dataType === "date" && !l.includes(u))
1069
+ throw new Error(
1070
+ `Invalid level '${u}' in dimensional element '${m}'. Column '${n.name}.${i.name}' is only a date column, not a datetime column`
1071
+ );
1072
+ const f = $.timeOnly;
1073
+ if (i.dataType === "time" && !f.includes(u))
1074
+ throw new Error(
1075
+ `Invalid level '${u}' in dimensional element '${m}'. Column '${n.name}.${i.name}' is only a time column, not a date column`
1076
+ );
1077
+ a = u;
1078
+ }
1079
+ return Er({
1080
+ expression: i.expression,
1081
+ dataType: i.dataType,
1082
+ granularity: a,
1052
1083
  format: void 0,
1053
1084
  sort: void 0,
1054
- dataSource: r
1085
+ dataSource: t
1055
1086
  });
1056
1087
  }
1057
- function kt(e, r, t) {
1058
- const { column: s, level: n } = We(e, t);
1088
+ function Es(e, t, r) {
1089
+ const { column: s, level: n } = $e(e, r);
1059
1090
  if (n)
1060
1091
  throw new Error(
1061
- `Invalid DateDimension name format: "${e}". Expected format: "${w}TableName.ColumnName"`
1092
+ `Invalid DateDimension name format: '${e}'. Expected format: '${q}TableName.ColumnName'`
1062
1093
  );
1063
- if (!ie(s.dataType))
1094
+ if (!H(s.dataType))
1064
1095
  throw new Error(
1065
- `Invalid DateDimension name "${e}". Column "${s.name}" is not a datetime column (got ${s.dataType}).`
1096
+ `Invalid DateDimension name '${e}'. Column '${s.name}' is not a datetime column (got ${s.dataType}).`
1066
1097
  );
1067
- return et({
1098
+ return Ur({
1068
1099
  name: s.name,
1069
1100
  expression: s.expression,
1070
- dataSource: r
1101
+ dataSource: t
1071
1102
  });
1072
1103
  }
1073
- function x(e, r) {
1074
- const t = e();
1075
- return t.success ? t.data : (r.push(...t.errors), null);
1076
- }
1077
- const Lt = (e, r, t) => {
1078
- if (!r)
1079
- return { attribute: e };
1080
- const s = typeof r == "object" ? r.direction : r;
1081
- return Ee(s) ? { attribute: e.sort(Ce(s)) } : {
1082
- attribute: e,
1083
- error: b(p({}, t), {
1084
- message: `Invalid sort type. Expected "sortAsc", "sortDesc", or "sortNone". Got: "${s}".`
1085
- })
1086
- };
1087
- }, Vt = (e, r, t, s) => {
1088
- const n = K(e.column, r, t);
1089
- return Lt(n, e.sortType, s);
1090
- }, _t = (e, r, t, s) => typeof e == "string" ? { attribute: K(e, r, t) } : Rt(e) ? Vt(e, r, t, s) : {
1091
- error: b(p({}, s), {
1092
- message: 'Invalid dimension item. Expected a string (composeCode) or object with "column" and optional "sortType".'
1104
+ const xs = (e, t) => {
1105
+ if (!e) return;
1106
+ const r = typeof e == "object" ? e.direction : e;
1107
+ if (!te(r))
1108
+ return F(g({}, t), {
1109
+ message: `Invalid sort type. Expected 'sortAsc', 'sortDesc', or 'sortNone'. Got: '${r}'.`
1110
+ });
1111
+ }, $s = (e, t, r, s) => {
1112
+ const n = xs(e.sortType, s);
1113
+ if (n)
1114
+ return {
1115
+ attribute: G(e.column, t, r),
1116
+ style: {},
1117
+ error: n
1118
+ };
1119
+ const i = G(e.column, t, r), o = _(e, "column");
1120
+ return { attribute: i, style: o };
1121
+ }, Ts = (e, t, r, s) => typeof e == "string" ? { attribute: G(e, t, r) } : qs(e) ? $s(e, t, r, s) : {
1122
+ error: F(g({}, s), {
1123
+ message: "Invalid dimension item. Expected a string (composeCode) or object with 'column' and optional 'sortType'."
1093
1124
  })
1094
- }, Ut = (e) => {
1095
- const { data: r } = e, { dataSource: t, schemaIndex: s } = e.context;
1096
- if (!r)
1125
+ }, wt = (e) => {
1126
+ const { data: t } = e, { dataSource: r, schemaIndex: s } = e.context;
1127
+ if (!t)
1097
1128
  return { success: !0, data: [] };
1098
- if (!Array.isArray(r))
1129
+ if (!Array.isArray(t))
1099
1130
  return {
1100
1131
  success: !1,
1101
1132
  errors: [
1102
1133
  {
1103
1134
  category: "dimensions",
1104
1135
  index: -1,
1105
- input: r,
1136
+ input: t,
1106
1137
  message: "Invalid dimensions JSON. Expected an array."
1107
1138
  }
1108
1139
  ]
1109
1140
  };
1110
- const n = [], o = [];
1111
- return r.forEach((i, a) => {
1141
+ const n = [], i = [];
1142
+ return t.forEach((o, a) => {
1112
1143
  const u = {
1113
1144
  category: "dimensions",
1114
1145
  index: a,
1115
- input: i
1146
+ input: o
1116
1147
  };
1117
1148
  try {
1118
- const c = _t(i, t, s, u);
1149
+ const c = Ts(o, r, s, u);
1119
1150
  if (c.error) {
1120
- o.push(c.error);
1151
+ i.push(c.error);
1121
1152
  return;
1122
1153
  }
1123
- c.attribute && n.push(c.attribute);
1154
+ c.attribute && n.push(
1155
+ c.style !== void 0 ? { attribute: c.attribute, style: c.style } : { attribute: c.attribute }
1156
+ );
1124
1157
  } catch (c) {
1125
1158
  const m = c instanceof Error ? c.message : "Unknown error";
1126
- o.push(b(p({}, u), { message: m }));
1159
+ i.push(F(g({}, u), { message: m }));
1127
1160
  }
1128
- }), o.length > 0 ? { success: !1, errors: o } : { success: !0, data: n };
1161
+ }), i.length > 0 ? { success: !1, errors: i } : { success: !0, data: n };
1129
1162
  };
1130
- function fe(e, r) {
1131
- const t = Reflect.get(e, r);
1132
- if (typeof t != "function")
1133
- throw new Error(`Function "${r}" not found or is not a function`);
1134
- return t;
1163
+ function Te(e, t) {
1164
+ const r = Reflect.get(e, t);
1165
+ if (typeof r != "function")
1166
+ throw new Error(`Function '${t}' not found or is not a function`);
1167
+ return r;
1135
1168
  }
1136
- function Wt(e, r) {
1137
- const t = e.replace("measureFactory.", ""), n = fe(Lr, t)(...r);
1138
- if (!le(n))
1139
- throw new Error(`Function "${e}" did not return a valid Measure`);
1169
+ function Ds(e, t) {
1170
+ const r = e.replace("measureFactory.", ""), n = Te(xr, r)(...t);
1171
+ if (!Ee(n))
1172
+ throw new Error(`Function '${e}' did not return a valid Measure`);
1140
1173
  return n;
1141
1174
  }
1142
- function jt(e, r) {
1143
- const t = e.replace("filterFactory.logic.", ""), n = fe(Vr, t)(...r);
1144
- if (!_(n))
1145
- throw new Error(`Function "${e}" did not return a valid FilterRelations`);
1175
+ function Ss(e, t) {
1176
+ const r = e.replace("filterFactory.logic.", ""), n = Te($r, r)(...t);
1177
+ if (!X(n))
1178
+ throw new Error(`Function '${e}' did not return a valid FilterRelations`);
1146
1179
  return n;
1147
1180
  }
1148
- function Jt(e, r) {
1181
+ function Os(e, t) {
1149
1182
  if (e.startsWith("filterFactory.logic."))
1150
- return jt(e, r);
1151
- const t = e.replace("filterFactory.", ""), n = fe(_r, t)(...r);
1152
- if (!J(n) && !_(n))
1153
- throw new Error(`Function "${e}" did not return a valid Filter or FilterRelations`);
1183
+ return Ss(e, t);
1184
+ const r = e.replace("filterFactory.", ""), n = Te(Tr, r)(...t);
1185
+ if (!ne(n) && !X(n))
1186
+ throw new Error(`Function '${e}' did not return a valid Filter or FilterRelations`);
1154
1187
  return n;
1155
1188
  }
1156
- function Gt(e, r) {
1189
+ function Ms(e, t) {
1157
1190
  const s = e.split(".")[0];
1158
1191
  if (s === "measureFactory")
1159
- return Wt(e, r);
1192
+ return Ds(e, t);
1160
1193
  if (s === "filterFactory")
1161
- return Jt(e, r);
1194
+ return Os(e, t);
1162
1195
  throw new Error(
1163
- `Unsupported factory: "${s}". Supported factories: measureFactory, filterFactory`
1196
+ `Unsupported factory: '${s}'. Supported factories: measureFactory, filterFactory`
1164
1197
  );
1165
1198
  }
1166
- const Kt = /\[([a-zA-Z_][a-zA-Z0-9_.-]*)\]/g, Ge = /* @__PURE__ */ new Set([
1199
+ const ye = {
1200
+ SDIFF: {
1201
+ category: "time-diff",
1202
+ argCount: 2,
1203
+ requiredDateLevel: $.Seconds,
1204
+ argType: "datetime"
1205
+ },
1206
+ MNDIFF: {
1207
+ category: "time-diff",
1208
+ argCount: 2,
1209
+ requiredDateLevel: $.Minutes,
1210
+ argType: "datetime"
1211
+ },
1212
+ HDIFF: {
1213
+ category: "time-diff",
1214
+ argCount: 2,
1215
+ requiredDateLevel: $.Hours,
1216
+ argType: "datetime"
1217
+ },
1218
+ DDIFF: {
1219
+ category: "time-diff",
1220
+ argCount: 2,
1221
+ requiredDateLevel: $.Days,
1222
+ argType: "datetime"
1223
+ },
1224
+ MDIFF: {
1225
+ category: "time-diff",
1226
+ argCount: 2,
1227
+ requiredDateLevel: $.Months,
1228
+ argType: "datetime"
1229
+ },
1230
+ QDIFF: {
1231
+ category: "time-diff",
1232
+ argCount: 2,
1233
+ requiredDateLevel: $.Quarters,
1234
+ argType: "datetime"
1235
+ },
1236
+ YDIFF: {
1237
+ category: "time-diff",
1238
+ argCount: 2,
1239
+ requiredDateLevel: $.Years,
1240
+ argType: "datetime"
1241
+ }
1242
+ }, vs = Object.keys(ye).filter(
1243
+ (e) => ye[e].category === "time-diff"
1244
+ );
1245
+ function qt() {
1246
+ return vs;
1247
+ }
1248
+ function At(e) {
1249
+ const t = ye[e.toUpperCase()];
1250
+ return t == null ? void 0 : t.requiredDateLevel;
1251
+ }
1252
+ const Ns = /\[(\w[\w.-]*)\]/g, Ct = /* @__PURE__ */ new Set([
1167
1253
  // Universal – Aggregative (per Sisense doc: (A) only; Statistical CONTRIBUTION, PERCENTILE, etc. are non-aggregative)
1168
1254
  "AVG",
1169
1255
  "COUNT",
@@ -1191,219 +1277,322 @@ const Kt = /\[([a-zA-Z_][a-zA-Z0-9_.-]*)\]/g, Ge = /* @__PURE__ */ new Set([
1191
1277
  "SKEWP",
1192
1278
  "SKEW",
1193
1279
  "SLOPE"
1194
- ]), Qt = new RegExp(
1195
- `\\b(${Array.from(Ge).join("|")})\\s*\\(`,
1280
+ ]), Rs = new RegExp(
1281
+ `\\b(${Array.from(Ct).join("|")})\\s*\\(`,
1196
1282
  "i"
1197
1283
  );
1198
- function Yt(e) {
1199
- return E(e) ? !0 : typeof e == "string" && e.startsWith(w) ? !1 : e && typeof e == "object" && "kind" in e ? e.kind === "measure" : !0;
1284
+ function Et(e) {
1285
+ return E(e) ? !0 : typeof e == "string" && e.startsWith(q) ? !1 : T(e) && "kind" in e ? e.kind === "measure" : !0;
1200
1286
  }
1201
- function Ht(e) {
1202
- const r = /\b(\w+)\s*\(/g, t = /* @__PURE__ */ new Set();
1287
+ function Is(e) {
1288
+ const t = /\b(\w+)\s*\(/g, r = /* @__PURE__ */ new Set();
1203
1289
  let s;
1204
- for (; (s = r.exec(e)) !== null; ) {
1290
+ for (; (s = t.exec(e)) !== null; ) {
1205
1291
  const n = s[1];
1206
- Ge.has(n.toUpperCase()) || t.add(n);
1292
+ Ct.has(n.toUpperCase()) || r.add(n);
1207
1293
  }
1208
- return Array.from(t);
1294
+ return Array.from(r);
1209
1295
  }
1210
- function Zt(e) {
1211
- return e.length === 1 ? `[${e[0]}]` : e.map((r) => `[${r}]`).join(", ");
1296
+ function ks(e) {
1297
+ return e.length === 1 ? `[${e[0]}]` : e.map((t) => `[${t}]`).join(", ");
1212
1298
  }
1213
- function Xt(e) {
1299
+ function Bs(e) {
1214
1300
  return e.length === 0 ? "" : e.length === 1 ? `${e[0]} is not an aggregative function. ` : `${e.join(", ")} are not aggregative functions. `;
1215
1301
  }
1216
- function vt(e, r, t = {}) {
1217
- const {
1218
- warnUnusedContext: s = !0,
1219
- errorOnUnusedContext: n = !0,
1220
- allowEmptyFormula: o = !1,
1221
- errorPrefix: i = "customFormula validation"
1222
- } = t, a = {
1223
- isValid: !0,
1224
- errors: [],
1225
- warnings: [],
1226
- references: [],
1227
- unusedContextKeys: []
1302
+ const j = (e) => e.startsWith("[") ? e : `[${e}]`, xt = (e) => e.startsWith("[") && e.endsWith("]") ? e.slice(1, -1) : e;
1303
+ function $t(e, t) {
1304
+ if (t.length === 0) return [];
1305
+ const r = t.map((n) => n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|"), s = new RegExp(
1306
+ `\\b(${r})\\s*\\(\\s*\\[([^\\]]+)\\]\\s*,\\s*\\[([^\\]]+)\\]\\s*\\)`,
1307
+ "gi"
1308
+ );
1309
+ return [...e.matchAll(s)].map((n) => ({
1310
+ functionName: n[1].toUpperCase(),
1311
+ ref1: n[2].trim(),
1312
+ ref2: n[3].trim()
1313
+ }));
1314
+ }
1315
+ function zs(e, t, r) {
1316
+ var o, a, u;
1317
+ const s = Object.keys(t), n = ((o = r.errorPrefix) != null ? o : "customFormula validation").trim(), i = n === "" ? "" : n.endsWith(" ") ? n : `${n} `;
1318
+ return {
1319
+ formula: e,
1320
+ context: t,
1321
+ contextKeys: s,
1322
+ canonicalContextKeys: new Set(s.map(j)),
1323
+ errorPrefix: i,
1324
+ warnUnusedContext: (a = r.warnUnusedContext) != null ? a : !0,
1325
+ errorOnUnusedContext: (u = r.errorOnUnusedContext) != null ? u : !0,
1326
+ schemaIndex: r.schemaIndex,
1327
+ result: { isValid: !0, errors: [], warnings: [], references: [], unusedContextKeys: [] }
1228
1328
  };
1229
- if (!e || e.trim().length === 0)
1230
- return o || (a.errors.push(`${i}args[1]: Formula cannot be empty`), a.isValid = !1), a;
1231
- const u = /\b\w+\s*\[/gi, c = e.match(u);
1232
- if (c) {
1233
- const g = c[0].replace(/\s*\[.*$/, "");
1234
- a.errors.push(
1235
- `${i}args[1]: Invalid syntax: '${g}' - operator cannot be used before bracket reference without parentheses`
1236
- ), a.isValid = !1;
1237
- }
1238
- a.references = [
1329
+ }
1330
+ function N(e, t) {
1331
+ e.result.errors.push(t), e.result.isValid = !1;
1332
+ }
1333
+ const Ps = /* @__PURE__ */ new Set(["CASE", "WHEN", "THEN", "ELSE", "END", "AND", "OR"]);
1334
+ function Ls(e) {
1335
+ const t = /\b(\w+)\s*\[/gi, r = [...e.formula.matchAll(t)].find(
1336
+ (s) => !Ps.has(s[1].toUpperCase())
1337
+ );
1338
+ r && N(
1339
+ e,
1340
+ `${e.errorPrefix}args[1]: Invalid syntax: '${r[1]}' - operator cannot be used before bracket reference without parentheses`
1341
+ );
1342
+ }
1343
+ function _s(e) {
1344
+ return [
1239
1345
  ...new Set(
1240
- [...e.matchAll(new RegExp(Kt.source, "g"))].map((g) => g[1])
1346
+ [...e.matchAll(new RegExp(Ns.source, "g"))].map((t) => t[1])
1241
1347
  )
1242
1348
  ];
1243
- const m = Object.keys(r);
1244
- if (a.references.length === 0)
1245
- return a.warnings.push(
1246
- `${i}args[1]: No bracket references found in formula - ensure this is intentional`
1247
- ), a;
1248
- if (m.length === 0)
1249
- return a.errors.push(
1250
- `${i}args[2]: Context cannot be empty - custom formulas require context definitions`
1251
- ), a.isValid = !1, a;
1252
- const d = a.references.filter((g) => !m.includes(g));
1253
- if (d.length > 0 && (a.isValid = !1, d.length === 1 ? a.errors.push(
1254
- `${i}args[1]: Reference [${d[0]}] not found in context. Available keys: ${m.join(", ")}`
1255
- ) : a.errors.push(
1256
- `${i}args[1]: References [${d.join(
1257
- "], ["
1258
- )}] not found in context. Available keys: ${m.join(", ")}`
1259
- )), !Qt.test(e)) {
1260
- const g = a.references.filter(
1261
- (f) => f in r && !Yt(r[f])
1349
+ }
1350
+ function Us(e) {
1351
+ const t = e.result.references.filter(
1352
+ (n) => !e.canonicalContextKeys.has(j(n))
1353
+ );
1354
+ if (t.length === 0) return;
1355
+ const r = e.contextKeys.map((n) => `[${xt(n)}]`).join(", "), s = t.length === 1 ? `Reference [${t[0]}]` : `References [${t.join("], [")}]`;
1356
+ N(
1357
+ e,
1358
+ `${e.errorPrefix}args[1]: ${s} not found in context. Available keys: ${r}`
1359
+ );
1360
+ }
1361
+ function js(e) {
1362
+ if (Rs.test(e.formula)) return;
1363
+ const t = e.result.references.filter((r) => {
1364
+ var n;
1365
+ const s = (n = e.context[j(r)]) != null ? n : e.context[r];
1366
+ return s !== void 0 && !Et(s);
1367
+ });
1368
+ t.length !== 0 && N(
1369
+ e,
1370
+ `${e.errorPrefix}args[1]: ${Bs(
1371
+ Is(e.formula)
1372
+ )}Bracket reference(s) ${ks(
1373
+ t
1374
+ )} point to raw attributes and must be wrapped in an aggregative function (e.g. SUM, AVG)`
1375
+ );
1376
+ }
1377
+ function Vs(e) {
1378
+ if (!e.warnUnusedContext && !e.errorOnUnusedContext || e.contextKeys.length === 0) return;
1379
+ const t = new Set(e.result.references.map(j)), r = e.contextKeys.filter((i) => !t.has(j(i)));
1380
+ if (e.result.unusedContextKeys = r, r.length === 0) return;
1381
+ const s = r.map((i) => `[${xt(i)}]`).join(", "), n = `${e.errorPrefix}args[2]: Context keys ${s} are defined but not used in formula`;
1382
+ e.errorOnUnusedContext ? N(e, n) : e.warnUnusedContext && e.result.warnings.push(n);
1383
+ }
1384
+ function We(e, t, r, s) {
1385
+ var o;
1386
+ const n = (o = s.context[j(e)]) != null ? o : s.context[e];
1387
+ if (n === void 0) return;
1388
+ if (!(typeof n == "string" && n.startsWith(q))) {
1389
+ Et(n) && N(
1390
+ s,
1391
+ `${s.errorPrefix}args[1]: ${t.functionName} requires datetime dimension attributes. Reference [${e}] points to a measure; use an attribute (e.g. ${q}Table.Column.Level).`
1262
1392
  );
1263
- g.length > 0 && (a.errors.push(
1264
- `${i}args[1]: ${Xt(
1265
- Ht(e)
1266
- )}Bracket reference(s) ${Zt(
1267
- g
1268
- )} point to raw attributes and must be wrapped in an aggregative function (e.g. SUM, AVG)`
1269
- ), a.isValid = !1);
1270
- }
1271
- if ((s || n) && m.length > 0) {
1272
- const g = m.filter((f) => !a.references.includes(f));
1273
- if (a.unusedContextKeys = g, g.length > 0) {
1274
- const f = `${i}args[2]: Context keys [${g.join(
1275
- ", "
1276
- )}] are defined but not used in formula`;
1277
- n ? (a.errors.push(f), a.isValid = !1) : s && a.warnings.push(f);
1278
- }
1393
+ return;
1279
1394
  }
1280
- return a;
1395
+ if (s.schemaIndex)
1396
+ try {
1397
+ const a = $e(n, s.schemaIndex);
1398
+ H(a.column.dataType) ? r && a.level && a.level !== r && N(
1399
+ s,
1400
+ `${s.errorPrefix}args[1]: ${t.functionName} expects date level '${r}'. Reference [${e}] has level '${a.level}'.`
1401
+ ) : N(
1402
+ s,
1403
+ `${s.errorPrefix}args[1]: ${t.functionName} requires datetime dimensions. Reference [${e}] resolves to non-datetime column '${a.column.name}'.`
1404
+ );
1405
+ } catch (a) {
1406
+ const u = a instanceof Error ? a.message : "Unknown error";
1407
+ N(s, `${s.errorPrefix}args[1]: ${t.functionName} reference [${e}]: ${u}`);
1408
+ }
1281
1409
  }
1282
- function es(e, r, t = {}) {
1283
- const s = vt(e, r, t);
1410
+ function Ws(e) {
1411
+ const t = qt(), r = $t(e.formula, t);
1412
+ for (const s of r) {
1413
+ const n = At(s.functionName);
1414
+ We(s.ref1, s, n, e), We(s.ref2, s, n, e);
1415
+ }
1416
+ }
1417
+ function Ks(e, t, r = {}) {
1418
+ var n;
1419
+ const s = zs(e, t, r);
1420
+ return !e || e.trim().length === 0 ? ((n = r.allowEmptyFormula) != null && n || N(s, `${s.errorPrefix}args[1]: Formula cannot be empty`), s.result) : (Ls(s), s.result.references = _s(e), s.result.references.length === 0 ? (s.result.warnings.push(
1421
+ `${s.errorPrefix}args[1]: No bracket references found in formula - ensure this is intentional`
1422
+ ), s.result) : s.contextKeys.length === 0 ? (N(
1423
+ s,
1424
+ `${s.errorPrefix}args[2]: Context cannot be empty - custom formulas require context definitions`
1425
+ ), s.result) : (Us(s), js(s), Vs(s), Ws(s), s.result));
1426
+ }
1427
+ function Js(e, t, r = {}) {
1428
+ const s = Ks(e, t, r);
1284
1429
  if (!s.isValid)
1285
1430
  throw new Error(s.errors.join("; "));
1286
1431
  s.warnings.length > 0 && console.warn("Formula validation warnings:", s.warnings.join("; "));
1287
1432
  }
1288
- function rs(e, r) {
1433
+ function Ys(e, t) {
1289
1434
  if (e.length < 3 || e.length > 5)
1290
1435
  throw new Error(
1291
- `${r.pathPrefix}Expected 3, 4, or 5 arguments for customFormula (title, formula, context, format?, description?)`
1436
+ `${t.pathPrefix}Expected 3, 4, or 5 arguments for customFormula (title, formula, context, format?, description?)`
1437
+ );
1438
+ const r = e[1];
1439
+ if (typeof r != "string")
1440
+ throw new Error(
1441
+ `${t.pathPrefix}args[1]: Expected formula string, got ${typeof r}`
1292
1442
  );
1293
- const t = e[1], s = e[2];
1294
- es(t, s, {
1295
- errorPrefix: `${r.pathPrefix}`,
1443
+ const s = r, n = e[2];
1444
+ if (!T(n))
1445
+ throw new Error(
1446
+ `${t.pathPrefix}args[2]: Expected context object, got ${n === null ? "null" : typeof n}`
1447
+ );
1448
+ const i = n;
1449
+ Js(s, i, {
1450
+ errorPrefix: `${t.pathPrefix}`,
1296
1451
  errorOnUnusedContext: !0,
1297
1452
  // Strict validation: all context keys must be used
1298
- allowEmptyFormula: !1
1453
+ allowEmptyFormula: !1,
1299
1454
  // Custom formulas must have content
1455
+ schemaIndex: t.schemaIndex
1300
1456
  });
1301
- const n = {};
1302
- for (const [o, i] of Object.entries(s)) {
1303
- const a = `args[2].${o}`;
1304
- if (E(i))
1305
- n[`${o}`] = C({
1306
- data: i,
1457
+ const o = Gs(s), a = {};
1458
+ for (const [u, c] of Object.entries(i)) {
1459
+ const m = `args[2].${u}`;
1460
+ if (E(c))
1461
+ a[`${u}`] = S({
1462
+ data: c,
1307
1463
  context: {
1308
- dataSource: r.dataSource,
1309
- schemaIndex: r.schemaIndex,
1310
- pathPrefix: a
1464
+ dataSource: t.dataSource,
1465
+ schemaIndex: t.schemaIndex,
1466
+ pathPrefix: m
1311
1467
  }
1312
1468
  });
1313
- else if (typeof i == "string" && i.startsWith(w))
1469
+ else if (typeof c == "string" && c.startsWith(q)) {
1470
+ const l = u.startsWith("[") && u.endsWith("]") ? u.slice(1, -1) : u, f = o[l];
1314
1471
  try {
1315
- n[`${o}`] = K(
1316
- i,
1317
- r.dataSource,
1318
- r.schemaIndex
1472
+ a[`${u}`] = G(
1473
+ c,
1474
+ t.dataSource,
1475
+ t.schemaIndex,
1476
+ f !== void 0 ? { inferredDateLevel: f } : void 0
1319
1477
  );
1320
- } catch (u) {
1321
- const c = u instanceof Error ? u.message : "Unknown error";
1322
- throw new Error(`${a}: ${c}`);
1478
+ } catch (h) {
1479
+ const p = h instanceof Error ? h.message : "Unknown error";
1480
+ throw new Error(`${m}: ${p}`);
1323
1481
  }
1324
- else if (i && typeof i == "object" && "kind" in i)
1325
- n[`${o}`] = i;
1482
+ } else if (c && typeof c == "object" && "kind" in c)
1483
+ a[`${u}`] = c;
1326
1484
  else
1327
1485
  throw new Error(
1328
- `${a}: Invalid context value for key '${o}'. Expected a function call or attribute reference (${w}...), but got: ${typeof i}`
1486
+ `${m}: Invalid context value for key '${u}'. Expected a function call or attribute reference (${q}...), but got: ${typeof c}`
1329
1487
  );
1330
1488
  }
1331
- e[2] = n;
1489
+ e[2] = a;
1332
1490
  }
1333
- function de(e, r) {
1334
- const t = e[0];
1335
- if (!t || typeof t != "object" || !("type" in t))
1336
- throw new Error(`${r.pathPrefix}args[0]: Expected attribute as first argument`);
1337
- return t;
1491
+ function Gs(e) {
1492
+ const t = qt(), r = $t(e, t), s = {};
1493
+ for (const n of r) {
1494
+ const i = At(n.functionName);
1495
+ if (i !== void 0)
1496
+ for (const o of [n.ref1, n.ref2]) {
1497
+ const a = s[o];
1498
+ if (a !== void 0 && a !== i)
1499
+ throw new Error(
1500
+ `Reference [${o}] is used in time-diff functions with conflicting date levels ('${a}' and '${i}'). Specify the date level in the context (e.g. DM.Table.Column.${i}).`
1501
+ );
1502
+ s[o] = i;
1503
+ }
1504
+ }
1505
+ return s;
1506
+ }
1507
+ function Tt(e) {
1508
+ return e.type === L.TextAttribute;
1509
+ }
1510
+ function Dt(e) {
1511
+ return e.type === L.NumericAttribute;
1338
1512
  }
1339
- function qe(e, r) {
1340
- const t = de(e, r);
1341
- if (!Bt(t))
1513
+ function Qs(e) {
1514
+ return e.type === L.DateLevel;
1515
+ }
1516
+ function Hs(e) {
1517
+ return Tt(e) || Dt(e);
1518
+ }
1519
+ function ie(e) {
1520
+ return e.type === L.TextAttribute ? "text" : e.type === L.NumericAttribute ? "numeric" : e.type === L.DateLevel ? "date/datetime" : "unknown";
1521
+ }
1522
+ function De(e, t) {
1523
+ const r = e[0];
1524
+ if (!r || typeof r != "object" || !("type" in r))
1525
+ throw new Error(`${t.pathPrefix}args[0]: Expected attribute as first argument`);
1526
+ return r;
1527
+ }
1528
+ function Ke(e, t) {
1529
+ const r = De(e, t);
1530
+ if (!Hs(r))
1342
1531
  throw new Error(
1343
- `${r.pathPrefix}args[0]: Attribute must be string or numeric type, got ${G(
1344
- t
1532
+ `${t.pathPrefix}args[0]: Attribute must be string or numeric type, got ${ie(
1533
+ r
1345
1534
  )} attribute`
1346
1535
  );
1347
1536
  }
1348
- function M(e, r) {
1349
- const t = de(e, r);
1350
- if (!Je(t))
1537
+ function I(e, t) {
1538
+ const r = De(e, t);
1539
+ if (!Dt(r))
1351
1540
  throw new Error(
1352
- `${r.pathPrefix}args[0]: Attribute must be numeric type, got ${G(
1353
- t
1541
+ `${t.pathPrefix}args[0]: Attribute must be numeric type, got ${ie(
1542
+ r
1354
1543
  )} attribute`
1355
1544
  );
1356
1545
  }
1357
- function S(e, r) {
1358
- const t = de(e, r);
1359
- if (!je(t))
1546
+ function k(e, t) {
1547
+ const r = De(e, t);
1548
+ if (!Tt(r))
1360
1549
  throw new Error(
1361
- `${r.pathPrefix}args[0]: Attribute must be string type, got ${G(
1362
- t
1550
+ `${t.pathPrefix}args[0]: Attribute must be string type, got ${ie(
1551
+ r
1363
1552
  )} attribute`
1364
1553
  );
1365
1554
  }
1366
- function ts(e, r) {
1367
- const t = e[0];
1368
- if (!t || typeof t != "object" || !("attribute" in t))
1369
- throw new Error(`${r.pathPrefix}args[0]: Expected filter as first argument`);
1370
- return t;
1555
+ function Xs(e, t) {
1556
+ const r = e[0];
1557
+ if (!r || typeof r != "object" || !("attribute" in r))
1558
+ throw new Error(`${t.pathPrefix}args[0]: Expected filter as first argument`);
1559
+ return r;
1371
1560
  }
1372
- function ss(e, r) {
1373
- const t = ts(e, r);
1374
- if (!se(t))
1561
+ function Zs(e, t) {
1562
+ const r = Xs(e, t);
1563
+ if (!be(r))
1375
1564
  throw new Error(
1376
- `${r.pathPrefix}args[0]: exclude filter only accepts members filter, got ${t.__serializable || "unknown"} filter`
1565
+ `${t.pathPrefix}args[0]: exclude filter only accepts members filter, got ${r.__serializable || "unknown"} filter`
1377
1566
  );
1378
1567
  }
1379
- const ns = {
1380
- "measureFactory.customFormula": rs,
1568
+ const en = {
1569
+ "measureFactory.customFormula": Ys,
1381
1570
  // String | Number filters
1382
- "filterFactory.equals": qe,
1383
- "filterFactory.doesntEqual": qe,
1571
+ "filterFactory.equals": Ke,
1572
+ "filterFactory.doesntEqual": Ke,
1384
1573
  // Numeric filters
1385
- "filterFactory.greaterThan": M,
1386
- "filterFactory.greaterThanOrEqual": M,
1387
- "filterFactory.lessThan": M,
1388
- "filterFactory.lessThanOrEqual": M,
1389
- "filterFactory.between": M,
1390
- "filterFactory.betweenNotEqual": M,
1391
- "filterFactory.numeric": M,
1574
+ "filterFactory.greaterThan": I,
1575
+ "filterFactory.greaterThanOrEqual": I,
1576
+ "filterFactory.lessThan": I,
1577
+ "filterFactory.lessThanOrEqual": I,
1578
+ "filterFactory.between": I,
1579
+ "filterFactory.betweenNotEqual": I,
1580
+ "filterFactory.numeric": I,
1392
1581
  // String filters
1393
- "filterFactory.contains": S,
1394
- "filterFactory.doesntContain": S,
1395
- "filterFactory.startsWith": S,
1396
- "filterFactory.doesntStartWith": S,
1397
- "filterFactory.endsWith": S,
1398
- "filterFactory.doesntEndWith": S,
1399
- "filterFactory.like": S,
1582
+ "filterFactory.contains": k,
1583
+ "filterFactory.doesntContain": k,
1584
+ "filterFactory.startsWith": k,
1585
+ "filterFactory.doesntStartWith": k,
1586
+ "filterFactory.endsWith": k,
1587
+ "filterFactory.doesntEndWith": k,
1588
+ "filterFactory.like": k,
1400
1589
  // Exclude filter
1401
- "filterFactory.exclude": ss
1590
+ "filterFactory.exclude": Zs
1402
1591
  };
1403
- function is(e) {
1404
- return ns[`${e}`];
1592
+ function tn(e) {
1593
+ return en[`${e}`];
1405
1594
  }
1406
- const os = {
1595
+ const St = {
1407
1596
  // ==================== MEASURE FACTORY FUNCTIONS ====================
1408
1597
  // Basic aggregations
1409
1598
  "measureFactory.sum": [
@@ -1930,608 +2119,677 @@ const os = {
1930
2119
  { type: "FilterRelationsNode", required: !0 }
1931
2120
  ]
1932
2121
  };
1933
- function me(e) {
1934
- return os[`${e}`];
2122
+ function Se(e) {
2123
+ return St[`${e}`];
1935
2124
  }
1936
- function as(e) {
1937
- const r = me(e);
1938
- return r ? r.filter((t) => t.required).length : 0;
2125
+ function rn(e) {
2126
+ const t = Se(e);
2127
+ return t ? t.filter((r) => r.required).length : 0;
1939
2128
  }
1940
- function us(e) {
1941
- const r = me(e);
1942
- return r ? r.length : 0;
2129
+ function sn(e) {
2130
+ const t = Se(e);
2131
+ return t ? t.length : 0;
1943
2132
  }
1944
- function cs(e) {
2133
+ function nn(e) {
1945
2134
  if (typeof e != "string" || !/^\d{4}-\d{2}-\d{2}/.test(e))
1946
2135
  return !1;
1947
- const t = Date.parse(e);
1948
- if (isNaN(t) || e.length < 10)
2136
+ const r = Date.parse(e);
2137
+ if (isNaN(r) || e.length < 10)
1949
2138
  return !1;
1950
2139
  const s = new Date(e);
1951
2140
  return !isNaN(s.getTime());
1952
2141
  }
1953
- function H(e, r, t, s) {
1954
- if (e.startsWith(w))
2142
+ function ce(e, t, r, s) {
2143
+ if (e.startsWith(q))
1955
2144
  try {
1956
- return K(e, r, t);
2145
+ return G(e, t, r);
1957
2146
  } catch (n) {
1958
- const o = n instanceof Error ? n.message : "Unknown error";
1959
- throw new Error(`${s}: ${o}`);
2147
+ const i = n instanceof Error ? n.message : "Unknown error";
2148
+ throw new Error(`${s}: ${i}`);
1960
2149
  }
1961
2150
  throw new Error(
1962
- `${s}: Invalid attribute "${e}". Expected format: "${w}TableName.ColumnName[.Level]"`
2151
+ `${s}: Invalid attribute '${e}'. Expected format: '${q}TableName.ColumnName[.Level]'`
1963
2152
  );
1964
2153
  }
1965
- function ls(e, r, t, s) {
1966
- if (e.startsWith(w))
2154
+ function on(e, t, r, s) {
2155
+ if (e.startsWith(q))
1967
2156
  try {
1968
- return kt(e, r, t);
2157
+ return Es(e, t, r);
1969
2158
  } catch (n) {
1970
- const o = n instanceof Error ? n.message : "Unknown error";
1971
- throw new Error(`${s}: ${o}`);
2159
+ const i = n instanceof Error ? n.message : "Unknown error";
2160
+ throw new Error(`${s}: ${i}`);
1972
2161
  }
1973
2162
  throw new Error(
1974
- `${s}: Invalid date dimension string "${e}". Expected format: "${w}TableName.ColumnName"`
2163
+ `${s}: Invalid date dimension string '${e}'. Expected format: '${q}TableName.ColumnName'`
1975
2164
  );
1976
2165
  }
1977
- function fs(e) {
1978
- const r = e.data, { argSchema: t, dataSource: s, schemaIndex: n, pathPrefix: o } = e.context, i = o;
1979
- if (r === void 0) {
1980
- if (t.required)
1981
- throw new Error(`${i}: Required argument is missing (expected ${t.type})`);
2166
+ function an(e) {
2167
+ const t = e.data, { argSchema: r, dataSource: s, schemaIndex: n, pathPrefix: i } = e.context, o = i;
2168
+ if (t === void 0) {
2169
+ if (r.required)
2170
+ throw new Error(`${o}: Required argument is missing (expected ${r.type})`);
1982
2171
  return;
1983
2172
  }
1984
- switch (t.type) {
1985
- case "string":
1986
- if (typeof r != "string")
1987
- throw new Error(`${i}: Expected string, got ${typeof r}`);
1988
- return r;
1989
- case "number":
1990
- if (typeof r != "number")
1991
- throw new Error(`${i}: Expected number, got ${typeof r}`);
1992
- return r;
1993
- case "boolean":
1994
- if (typeof r != "boolean")
1995
- throw new Error(`${i}: Expected boolean, got ${typeof r}`);
1996
- return r;
1997
- case "string[]":
1998
- if (!Array.isArray(r))
1999
- throw new Error(
2000
- `${i}: Expected array of strings, got ${typeof r}. Example: ["value1", "value2"]`
2001
- );
2002
- if (!r.every((a) => typeof a == "string"))
2003
- throw new Error(
2004
- `${i}: Expected array of strings, but contains non-string values`
2005
- );
2006
- return r;
2007
- case "number[]":
2008
- if (!Array.isArray(r))
2009
- throw new Error(
2010
- `${i}: Expected array of numbers, got ${typeof r}. Example: [10, 20]`
2011
- );
2012
- if (!r.every((a) => typeof a == "number"))
2013
- throw new Error(
2014
- `${i}: Expected array of numbers, but contains non-number values`
2015
- );
2016
- return r;
2017
- case "Attribute":
2018
- if (typeof r != "string")
2019
- throw new Error(
2020
- `${i}: Expected attribute string, got ${typeof r}. Example: "DM.Commerce.Revenue"`
2021
- );
2022
- return H(r, s, n, i);
2023
- case "Attribute[]":
2024
- if (!Array.isArray(r))
2025
- throw new Error(
2026
- `${i}: Expected array of attributes, got ${typeof r}. Example: ["DM.Commerce.AgeRange"]`
2027
- );
2028
- return r.map((a, u) => {
2029
- if (typeof a != "string")
2030
- throw new Error(`${i}[${u}]: Expected attribute string, got ${typeof a}`);
2031
- return H(a, s, n, `${i}[${u}]`);
2032
- });
2033
- case "Measure":
2034
- case "BaseMeasure":
2035
- if (!E(r))
2036
- throw new Error(
2037
- `${i}: Expected measure function call, got ${typeof r}. Example: {"function": "measureFactory.sum", "args": ["DM.Commerce.Revenue"]}`
2038
- );
2039
- return C({
2040
- data: r,
2041
- context: { dataSource: s, schemaIndex: n, pathPrefix: i }
2042
- });
2043
- case "Measure[]":
2044
- if (!Array.isArray(r))
2045
- throw new Error(
2046
- `${i}: Expected array of measure function calls, got ${typeof r}`
2047
- );
2048
- return r.map((a, u) => {
2049
- if (!E(a))
2173
+ if (!(t === null && !r.required))
2174
+ switch (r.type) {
2175
+ case "string":
2176
+ if (typeof t != "string")
2177
+ throw new Error(`${o}: Expected string, got ${typeof t}`);
2178
+ return t;
2179
+ case "number":
2180
+ if (typeof t != "number")
2181
+ throw new Error(`${o}: Expected number, got ${typeof t}`);
2182
+ return t;
2183
+ case "boolean":
2184
+ if (typeof t != "boolean")
2185
+ throw new Error(`${o}: Expected boolean, got ${typeof t}`);
2186
+ return t;
2187
+ case "string[]":
2188
+ if (!Array.isArray(t))
2189
+ throw new Error(
2190
+ `${o}: Expected array of strings, got ${typeof t}. Example: ['value1', 'value2']`
2191
+ );
2192
+ if (!t.every((a) => typeof a == "string"))
2193
+ throw new Error(
2194
+ `${o}: Expected array of strings, but contains non-string values`
2195
+ );
2196
+ return t;
2197
+ case "number[]":
2198
+ if (!Array.isArray(t))
2050
2199
  throw new Error(
2051
- `${i}[${u}]: Expected measure function call, got ${typeof a}`
2200
+ `${o}: Expected array of numbers, got ${typeof t}. Example: [10, 20]`
2052
2201
  );
2053
- return C({
2054
- data: a,
2055
- context: { dataSource: s, schemaIndex: n, pathPrefix: `${i}[${u}]` }
2202
+ if (!t.every((a) => typeof a == "number"))
2203
+ throw new Error(
2204
+ `${o}: Expected array of numbers, but contains non-number values`
2205
+ );
2206
+ return t;
2207
+ case "Attribute":
2208
+ if (typeof t != "string")
2209
+ throw new Error(
2210
+ `${o}: Expected attribute string, got ${typeof t}. Example: 'DM.Commerce.Revenue'`
2211
+ );
2212
+ return ce(t, s, n, o);
2213
+ case "Attribute[]":
2214
+ if (!Array.isArray(t))
2215
+ throw new Error(
2216
+ `${o}: Expected array of attributes, got ${typeof t}. Example: ['DM.Commerce.AgeRange']`
2217
+ );
2218
+ return t.map((a, u) => {
2219
+ if (typeof a != "string")
2220
+ throw new Error(`${o}[${u}]: Expected attribute string, got ${typeof a}`);
2221
+ return ce(a, s, n, `${o}[${u}]`);
2056
2222
  });
2057
- });
2058
- case "Filter":
2059
- if (!E(r))
2060
- throw new Error(
2061
- `${i}: Expected filter function call, got ${typeof r}. Example: {"function": "filterFactory.contains", "args": ["DM.Brand.Brand", "Apple"]}`
2062
- );
2063
- return C({
2064
- data: r,
2065
- context: { dataSource: s, schemaIndex: n, pathPrefix: i }
2066
- });
2067
- case "Filter[]":
2068
- if (!Array.isArray(r))
2069
- throw new Error(
2070
- `${i}: Expected array of filter function calls, got ${typeof r}`
2071
- );
2072
- return r.map((a, u) => {
2073
- if (!E(a))
2223
+ case "Measure":
2224
+ case "BaseMeasure":
2225
+ if (!E(t))
2074
2226
  throw new Error(
2075
- `${i}[${u}]: Expected filter function call, got ${typeof a}`
2227
+ `${o}: Expected measure function call, got ${typeof t}. Example: {'function': 'measureFactory.sum', 'args': ['DM.Commerce.Revenue']}`
2076
2228
  );
2077
- return C({
2078
- data: a,
2079
- context: { dataSource: s, schemaIndex: n, pathPrefix: `${i}[${u}]` }
2229
+ return S({
2230
+ data: t,
2231
+ context: { dataSource: s, schemaIndex: n, pathPrefix: o }
2080
2232
  });
2081
- });
2082
- case "FilterRelationsNode":
2083
- if (Array.isArray(r))
2084
- return r.map((a, u) => {
2233
+ case "Measure[]":
2234
+ if (!Array.isArray(t))
2235
+ throw new Error(
2236
+ `${o}: Expected array of measure function calls, got ${typeof t}`
2237
+ );
2238
+ return t.map((a, u) => {
2085
2239
  if (!E(a))
2086
2240
  throw new Error(
2087
- `${i}[${u}]: Expected filter function call, got ${typeof a}`
2241
+ `${o}[${u}]: Expected measure function call, got ${typeof a}`
2088
2242
  );
2089
- return C({
2243
+ return S({
2090
2244
  data: a,
2091
- context: { dataSource: s, schemaIndex: n, pathPrefix: `${i}[${u}]` }
2245
+ context: { dataSource: s, schemaIndex: n, pathPrefix: `${o}[${u}]` }
2092
2246
  });
2093
2247
  });
2094
- if (E(r))
2095
- return C({
2096
- data: r,
2097
- context: { dataSource: s, schemaIndex: n, pathPrefix: i }
2248
+ case "Filter":
2249
+ if (!E(t))
2250
+ throw new Error(
2251
+ `${o}: Expected filter function call, got ${typeof t}. Example: {'function': 'filterFactory.contains', 'args': ['DM.Brand.Brand', 'Apple']}`
2252
+ );
2253
+ return S({
2254
+ data: t,
2255
+ context: { dataSource: s, schemaIndex: n, pathPrefix: o }
2098
2256
  });
2099
- throw new Error(
2100
- `${i}: Expected filter function call or array of filters, got ${typeof r}`
2101
- );
2102
- case "DateDimension":
2103
- if (typeof r != "string")
2257
+ case "Filter[]":
2258
+ if (!Array.isArray(t))
2259
+ throw new Error(
2260
+ `${o}: Expected array of filter function calls, got ${typeof t}`
2261
+ );
2262
+ return t.map((a, u) => {
2263
+ if (!E(a))
2264
+ throw new Error(
2265
+ `${o}[${u}]: Expected filter function call, got ${typeof a}`
2266
+ );
2267
+ return S({
2268
+ data: a,
2269
+ context: { dataSource: s, schemaIndex: n, pathPrefix: `${o}[${u}]` }
2270
+ });
2271
+ });
2272
+ case "FilterRelationsNode":
2273
+ if (Array.isArray(t))
2274
+ return t.map((a, u) => {
2275
+ if (!E(a))
2276
+ throw new Error(
2277
+ `${o}[${u}]: Expected filter function call, got ${typeof a}`
2278
+ );
2279
+ return S({
2280
+ data: a,
2281
+ context: { dataSource: s, schemaIndex: n, pathPrefix: `${o}[${u}]` }
2282
+ });
2283
+ });
2284
+ if (E(t))
2285
+ return S({
2286
+ data: t,
2287
+ context: { dataSource: s, schemaIndex: n, pathPrefix: o }
2288
+ });
2104
2289
  throw new Error(
2105
- `${i}: Expected date dimension string, got ${typeof r}. Example: "DM.Commerce.Date"`
2290
+ `${o}: Expected filter function call or array of filters, got ${typeof t}`
2106
2291
  );
2107
- return ls(r, s, n, i);
2108
- case "LevelAttribute": {
2109
- if (typeof r != "string")
2110
- throw new Error(
2111
- `${i}: Expected date attribute string, got ${typeof r}. Example: "DM.Commerce.Date.Years"`
2292
+ case "DateDimension":
2293
+ if (typeof t != "string")
2294
+ throw new Error(
2295
+ `${o}: Expected date dimension string, got ${typeof t}. Example: 'DM.Commerce.Date'`
2296
+ );
2297
+ return on(t, s, n, o);
2298
+ case "LevelAttribute": {
2299
+ if (typeof t != "string")
2300
+ throw new Error(
2301
+ `${o}: Expected date attribute string, got ${typeof t}. Example: 'DM.Commerce.Date.Years'`
2302
+ );
2303
+ const a = ce(
2304
+ t,
2305
+ s,
2306
+ n,
2307
+ o
2112
2308
  );
2113
- const a = H(
2114
- r,
2115
- s,
2116
- n,
2117
- i
2118
- );
2119
- if (!Pt(a))
2309
+ if (!Qs(a))
2310
+ throw new Error(
2311
+ `${o}: Attribute must be date/datetime type, got ${ie(
2312
+ a
2313
+ )} attribute`
2314
+ );
2315
+ return a;
2316
+ }
2317
+ case "Measure | number":
2318
+ if (typeof t == "number")
2319
+ return t;
2320
+ if (E(t))
2321
+ return S({
2322
+ data: t,
2323
+ context: { dataSource: s, schemaIndex: n, pathPrefix: o }
2324
+ });
2120
2325
  throw new Error(
2121
- `${i}: Attribute must be date/datetime type, got ${G(
2122
- a
2123
- )} attribute`
2326
+ `${o}: Expected measure function call or number, got ${typeof t}`
2124
2327
  );
2125
- return a;
2328
+ case "Date | string":
2329
+ if (typeof t == "string") {
2330
+ if (nn(t))
2331
+ return t;
2332
+ throw new Error(
2333
+ `${o}: Expected valid ISO date string or Date object, got invalid date string '${t}'`
2334
+ );
2335
+ } else {
2336
+ if (t instanceof Date)
2337
+ return t;
2338
+ throw new Error(
2339
+ `${o}: Expected date string or Date object, got ${typeof t}`
2340
+ );
2341
+ }
2342
+ case "string | number":
2343
+ if (typeof t == "string" || typeof t == "number")
2344
+ return t;
2345
+ throw new Error(`${o}: Expected string or number, got ${typeof t}`);
2346
+ case "BaseFilterConfig":
2347
+ case "MembersFilterConfig":
2348
+ case "CustomFormulaContext":
2349
+ case "any":
2350
+ if (t == null && r.required)
2351
+ throw new Error(`${o}: Required argument is null/undefined`);
2352
+ return t;
2353
+ default:
2354
+ return t;
2126
2355
  }
2127
- case "Measure | number":
2128
- if (typeof r == "number")
2129
- return r;
2130
- if (E(r))
2131
- return C({
2132
- data: r,
2133
- context: { dataSource: s, schemaIndex: n, pathPrefix: i }
2134
- });
2135
- throw new Error(
2136
- `${i}: Expected measure function call or number, got ${typeof r}`
2137
- );
2138
- case "Date | string":
2139
- if (typeof r == "string") {
2140
- if (cs(r))
2141
- return r;
2142
- throw new Error(
2143
- `${i}: Expected valid ISO date string or Date object, got invalid date string "${r}"`
2144
- );
2145
- } else {
2146
- if (r instanceof Date)
2147
- return r;
2148
- throw new Error(
2149
- `${i}: Expected date string or Date object, got ${typeof r}`
2150
- );
2151
- }
2152
- case "string | number":
2153
- if (typeof r == "string" || typeof r == "number")
2154
- return r;
2155
- throw new Error(`${i}: Expected string or number, got ${typeof r}`);
2156
- case "BaseFilterConfig":
2157
- case "MembersFilterConfig":
2158
- case "CustomFormulaContext":
2159
- case "any":
2160
- if (r == null && t.required)
2161
- throw new Error(`${i}: Required argument is null/undefined`);
2162
- return r;
2163
- default:
2164
- return r;
2165
- }
2166
2356
  }
2167
- function C(e) {
2168
- const { data: r } = e, { dataSource: t, schemaIndex: s, pathPrefix: n } = e.context, { function: o, args: i } = r, a = n ? `${n}.` : "", u = me(o);
2169
- if (!u)
2170
- throw new Error(`${a}function: Unknown function "${o}"`);
2171
- const c = as(o), m = us(o);
2172
- if (i.length < c)
2357
+ function S(e) {
2358
+ const { data: t } = e, { dataSource: r, schemaIndex: s, pathPrefix: n } = e.context, { function: i, args: o } = t, a = n ? `${n}.` : "", u = Se(i);
2359
+ if (!u) {
2360
+ const p = Object.keys(St), d = M(i, p, (A) => A), b = d && d.distance <= x ? ` Did you mean '${d.best}'?` : "";
2173
2361
  throw new Error(
2174
- `${a}function: Expected at least ${c} arguments, got ${i.length}`
2362
+ `${a}function: Unknown function '${i}'.${b}`
2175
2363
  );
2176
- if (i.length > m)
2364
+ }
2365
+ const c = rn(i), m = sn(i);
2366
+ if (o.length < c)
2177
2367
  throw new Error(
2178
- `${a}function: Expected at most ${m} arguments, got ${i.length}`
2368
+ `${a}function: Expected at least ${c} arguments, got ${o.length}`
2179
2369
  );
2180
- const d = [], y = [];
2181
- for (let f = 0; f < Math.max(i.length, u.length); f++) {
2182
- const h = u[`${f}`], A = i[`${f}`], z = a ? `${a}args[${f}]` : `args[${f}]`;
2183
- if (A === void 0) {
2184
- h != null && h.required && y.push(`${z}: Missing required argument (expected ${h.type})`);
2370
+ if (o.length > m)
2371
+ throw new Error(
2372
+ `${a}function: Expected at most ${m} arguments, got ${o.length}`
2373
+ );
2374
+ const l = [], f = [];
2375
+ for (let p = 0; p < Math.max(o.length, u.length); p++) {
2376
+ const d = u[`${p}`], b = o[`${p}`], A = a ? `${a}args[${p}]` : `args[${p}]`;
2377
+ if (b === void 0) {
2378
+ d != null && d.required && f.push(`${A}: Missing required argument (expected ${d.type})`);
2185
2379
  continue;
2186
2380
  }
2187
- if (!h) {
2188
- y.push(`${z}: Unexpected argument`);
2381
+ if (!d) {
2382
+ f.push(`${A}: Unexpected argument`);
2189
2383
  continue;
2190
2384
  }
2191
2385
  try {
2192
- const N = fs({
2193
- data: A,
2386
+ const O = an({
2387
+ data: b,
2194
2388
  context: {
2195
- dataSource: t,
2389
+ dataSource: r,
2196
2390
  schemaIndex: s,
2197
- pathPrefix: z,
2198
- argSchema: h
2391
+ pathPrefix: A,
2392
+ argSchema: d
2199
2393
  }
2200
2394
  });
2201
- d.push(N);
2202
- } catch (N) {
2203
- const Ze = N instanceof Error ? N.message : "Unknown error";
2204
- y.push(Ze);
2395
+ l.push(O);
2396
+ } catch (O) {
2397
+ const oe = O instanceof Error ? O.message : "Unknown error";
2398
+ f.push(oe);
2205
2399
  }
2206
2400
  }
2207
- if (y.length > 0) {
2208
- const f = y.join("; ");
2209
- throw new Error(f);
2401
+ if (f.length > 0) {
2402
+ const p = f.join("; ");
2403
+ throw new Error(p);
2210
2404
  }
2211
- const g = is(o);
2212
- if (g)
2405
+ const h = tn(i);
2406
+ if (h)
2213
2407
  try {
2214
- g(d, {
2215
- dataSource: t,
2408
+ h(l, {
2409
+ dataSource: r,
2216
2410
  schemaIndex: s,
2217
2411
  pathPrefix: a
2218
2412
  });
2219
- } catch (f) {
2220
- const h = f instanceof Error ? f.message : "Unknown validation error";
2221
- throw new Error(h);
2413
+ } catch (p) {
2414
+ const d = p instanceof Error ? p.message : "Unknown validation error";
2415
+ throw new Error(d);
2222
2416
  }
2223
- return Gt(o, d);
2417
+ return Ms(i, l);
2224
2418
  }
2225
- function Ke(e) {
2226
- const { attribute: r, config: t } = e;
2227
- if (se(e) && Ur(r)) {
2228
- const { granularity: s } = r, n = e.members.map((a) => s === "Years" && !isNaN(Number(a)) ? `${a}-01-01T00:00:00` : a), o = Wr(t), i = Object.keys(o).length === 0 ? void 0 : o;
2229
- return jr(r, n, i);
2419
+ function Ot(e) {
2420
+ const { attribute: t, config: r } = e;
2421
+ if (be(e) && Dr(t)) {
2422
+ const { granularity: s } = t, n = e.members.map((a) => s === "Years" && !isNaN(Number(a)) ? `${a}-01-01T00:00:00` : a), i = Sr(r), o = Object.keys(i).length === 0 ? void 0 : i;
2423
+ return Or(t, n, o);
2230
2424
  }
2231
2425
  return e;
2232
2426
  }
2233
- function ds(e) {
2234
- let r = [];
2235
- for (const t of e)
2236
- _(t) ? r = ge(t, r) : r = ge([Ke(t)], r);
2237
- return r != null ? r : [];
2427
+ function un(e) {
2428
+ let t = [];
2429
+ for (const r of e)
2430
+ X(r) ? t = Le(r, t) : t = Le([Ot(r)], t);
2431
+ return t != null ? t : [];
2238
2432
  }
2239
- const ms = (e) => {
2240
- const { data: r } = e, { dataSource: t, schemaIndex: s } = e.context, n = [], o = [];
2241
- return r.forEach((i, a) => {
2433
+ const cn = (e) => {
2434
+ const { data: t } = e, { dataSource: r, schemaIndex: s } = e.context, n = [], i = [];
2435
+ return t.forEach((o, a) => {
2242
2436
  const u = {
2243
2437
  category: "filters",
2244
2438
  index: a,
2245
- input: i
2439
+ input: o
2246
2440
  };
2247
2441
  try {
2248
- const c = C({
2249
- data: i,
2250
- context: { dataSource: t, schemaIndex: s, pathPrefix: "" }
2442
+ const c = S({
2443
+ data: o,
2444
+ context: { dataSource: r, schemaIndex: s, pathPrefix: "" }
2251
2445
  });
2252
- !_(c) && !J(c) ? o.push(b(p({}, u), { message: "Invalid filter JSON" })) : n.push(c);
2446
+ !X(c) && !ne(c) ? i.push(F(g({}, u), { message: "Invalid filter JSON" })) : n.push(c);
2253
2447
  } catch (c) {
2254
2448
  const m = c instanceof Error ? c.message : "Unknown error";
2255
- o.push(b(p({}, u), { message: m }));
2449
+ i.push(F(g({}, u), { message: m }));
2256
2450
  }
2257
- }), o.length > 0 ? { success: !1, errors: o } : { success: !0, data: ds(n) };
2258
- }, ps = (e) => {
2259
- const { data: r } = e, { dataSource: t, schemaIndex: s } = e.context;
2260
- return r ? Ue(r) ? ms({
2261
- data: r,
2262
- context: { dataSource: t, schemaIndex: s }
2451
+ }), i.length > 0 ? { success: !1, errors: i } : { success: !0, data: un(n) };
2452
+ }, Oe = (e) => {
2453
+ const { data: t } = e, { dataSource: r, schemaIndex: s } = e.context;
2454
+ return t ? Ft(t) ? cn({
2455
+ data: t,
2456
+ context: { dataSource: r, schemaIndex: s }
2263
2457
  }) : {
2264
2458
  success: !1,
2265
2459
  errors: [
2266
2460
  {
2267
2461
  category: "filters",
2268
2462
  index: -1,
2269
- input: r,
2270
- message: 'Invalid filters JSON. Expected an array of function calls with "function" and "args" properties.'
2463
+ input: t,
2464
+ message: "Invalid filters JSON. Expected an array of function calls with 'function' and 'args' properties."
2271
2465
  }
2272
2466
  ]
2273
2467
  } : { success: !0, data: [] };
2274
- }, ys = (e) => {
2275
- const { data: r } = e, { dataSource: t, schemaIndex: s } = e.context, n = [], o = [];
2276
- return r.forEach((i, a) => {
2468
+ }, ln = (e) => {
2469
+ const { data: t } = e, { dataSource: r, schemaIndex: s } = e.context, n = [], i = [];
2470
+ return t.forEach((o, a) => {
2277
2471
  const u = {
2278
2472
  category: "highlights",
2279
2473
  index: a,
2280
- input: i
2474
+ input: o
2281
2475
  };
2282
2476
  try {
2283
- const c = C({
2284
- data: i,
2285
- context: { dataSource: t, schemaIndex: s, pathPrefix: "" }
2477
+ const c = S({
2478
+ data: o,
2479
+ context: { dataSource: r, schemaIndex: s, pathPrefix: "" }
2286
2480
  });
2287
- J(c) ? n.push(Ke(c)) : o.push(b(p({}, u), { message: "Invalid filter JSON" }));
2481
+ ne(c) ? n.push(Ot(c)) : i.push(F(g({}, u), { message: "Invalid filter JSON" }));
2288
2482
  } catch (c) {
2289
2483
  const m = c instanceof Error ? c.message : "Unknown error";
2290
- o.push(b(p({}, u), { message: m }));
2484
+ i.push(F(g({}, u), { message: m }));
2291
2485
  }
2292
- }), o.length > 0 ? { success: !1, errors: o } : { success: !0, data: n };
2293
- }, gs = (e) => {
2294
- const { data: r } = e, { dataSource: t, schemaIndex: s } = e.context;
2295
- return r ? Ue(r) ? ys({
2296
- data: r,
2297
- context: { dataSource: t, schemaIndex: s }
2486
+ }), i.length > 0 ? { success: !1, errors: i } : { success: !0, data: n };
2487
+ }, Me = (e) => {
2488
+ const { data: t } = e, { dataSource: r, schemaIndex: s } = e.context;
2489
+ return t ? Ft(t) ? ln({
2490
+ data: t,
2491
+ context: { dataSource: r, schemaIndex: s }
2298
2492
  }) : {
2299
2493
  success: !1,
2300
2494
  errors: [
2301
2495
  {
2302
2496
  category: "highlights",
2303
2497
  index: -1,
2304
- input: r,
2305
- message: 'Invalid highlights JSON. Expected an array of function calls with "function" and "args" properties.'
2498
+ input: t,
2499
+ message: "Invalid highlights JSON. Expected an array of function calls with 'function' and 'args' properties."
2306
2500
  }
2307
2501
  ]
2308
2502
  } : { success: !0, data: [] };
2309
- }, hs = (e, r, t) => {
2310
- const { dataSource: s, schemaIndex: n } = r;
2503
+ }, fn = (e, t) => {
2504
+ if (e && !te(e))
2505
+ return F(g({}, t), {
2506
+ message: `Invalid sort type. Expected 'sortAsc', 'sortDesc', or 'sortNone'. Got: '${e}'.`
2507
+ });
2508
+ }, dn = (e, t, r) => {
2509
+ const { dataSource: s, schemaIndex: n } = t;
2311
2510
  try {
2312
- const o = C({
2511
+ const i = S({
2313
2512
  data: e,
2314
2513
  context: { dataSource: s, schemaIndex: n, pathPrefix: "" }
2315
2514
  });
2316
- return le(o) ? { success: !0, data: o } : {
2515
+ return Ee(i) ? { success: !0, data: i } : {
2317
2516
  success: !1,
2318
- errors: [b(p({}, t), { message: "Invalid measure JSON" })]
2517
+ errors: [F(g({}, r), { message: "Invalid measure JSON" })]
2319
2518
  };
2320
- } catch (o) {
2321
- const i = o instanceof Error ? o.message : "Unknown error";
2519
+ } catch (i) {
2520
+ const o = i instanceof Error ? i.message : "Unknown error";
2322
2521
  return {
2323
2522
  success: !1,
2324
- errors: [b(p({}, t), { message: i })]
2523
+ errors: [F(g({}, r), { message: o })]
2325
2524
  };
2326
2525
  }
2327
- }, bs = (e, r, t) => r ? Ee(r) ? { measure: e.sort(Ce(r)) } : {
2328
- measure: e,
2329
- error: b(p({}, t), {
2330
- message: `Invalid sort type. Expected "sortAsc", "sortDesc", or "sortNone". Got: "${r}".`
2331
- })
2332
- } : { measure: e }, Fs = (e, r, t, s) => {
2333
- const n = C({
2526
+ }, mn = (e, t, r, s) => {
2527
+ const n = S({
2334
2528
  data: e.column,
2335
- context: { dataSource: r, schemaIndex: t, pathPrefix: "" }
2529
+ context: { dataSource: t, schemaIndex: r, pathPrefix: "" }
2336
2530
  });
2337
- return le(n) ? bs(n, e.sortType, s) : { error: b(p({}, s), { message: "Invalid measure JSON" }) };
2338
- }, ws = (e, r, t, s) => {
2339
- if (Ot(e))
2340
- return Fs(e, r, t, s);
2531
+ if (!Ee(n))
2532
+ return {
2533
+ style: {},
2534
+ error: F(g({}, s), { message: "Invalid measure JSON" })
2535
+ };
2536
+ const i = fn(e.sortType, s);
2537
+ if (i) {
2538
+ const a = _(e, "column");
2539
+ return { measure: n, style: a, error: i };
2540
+ }
2541
+ const o = _(e, "column");
2542
+ return { measure: n, style: o };
2543
+ }, pn = (e, t, r, s) => {
2544
+ if (As(e))
2545
+ return mn(e, t, r, s);
2341
2546
  if (E(e)) {
2342
- const n = hs(
2547
+ const n = dn(
2343
2548
  e,
2344
- { dataSource: r, schemaIndex: t },
2549
+ { dataSource: t, schemaIndex: r },
2345
2550
  s
2346
2551
  );
2347
2552
  return n.success ? { measure: n.data } : { error: n.errors[0] };
2348
2553
  }
2349
2554
  return {
2350
- error: b(p({}, s), {
2351
- message: 'Invalid measure item. Expected a function call (function/args) or object with "column" and optional "sortType".'
2555
+ error: F(g({}, s), {
2556
+ message: "Invalid measure item. Expected a function call (function/args) or object with 'column' and optional 'sortType'."
2352
2557
  })
2353
2558
  };
2354
- }, qs = (e) => {
2355
- const { data: r } = e, { dataSource: t, schemaIndex: s } = e.context;
2356
- if (!r)
2559
+ }, Mt = (e) => {
2560
+ const { data: t } = e, { dataSource: r, schemaIndex: s } = e.context;
2561
+ if (!t)
2357
2562
  return { success: !0, data: [] };
2358
- if (!Array.isArray(r))
2563
+ if (!Array.isArray(t))
2359
2564
  return {
2360
2565
  success: !1,
2361
2566
  errors: [
2362
2567
  {
2363
2568
  category: "measures",
2364
2569
  index: -1,
2365
- input: r,
2570
+ input: t,
2366
2571
  message: "Invalid measures JSON. Expected an array."
2367
2572
  }
2368
2573
  ]
2369
2574
  };
2370
- const n = [], o = [];
2371
- return r.forEach((i, a) => {
2575
+ const n = [], i = [];
2576
+ return t.forEach((o, a) => {
2372
2577
  const u = {
2373
2578
  category: "measures",
2374
2579
  index: a,
2375
- input: i
2580
+ input: o
2376
2581
  };
2377
2582
  try {
2378
- const c = ws(i, t, s, u);
2583
+ const c = pn(o, r, s, u);
2379
2584
  if (c.error) {
2380
- o.push(c.error);
2585
+ i.push(c.error);
2381
2586
  return;
2382
2587
  }
2383
- c.measure && n.push(c.measure);
2588
+ c.measure && n.push(
2589
+ c.style !== void 0 ? { measure: c.measure, style: c.style } : { measure: c.measure }
2590
+ );
2384
2591
  } catch (c) {
2385
2592
  const m = c instanceof Error ? c.message : "Unknown error";
2386
- o.push(b(p({}, u), { message: m }));
2593
+ i.push(F(g({}, u), { message: m }));
2387
2594
  }
2388
- }), o.length > 0 ? { success: !1, errors: o } : { success: !0, data: n };
2389
- }, Ps = (e) => {
2390
- const { data: r } = e, { dataSource: t, tables: s } = e.context, n = It(s), o = [], i = x(
2391
- () => Ut({
2392
- data: r.dimensions || [],
2393
- context: { dataSource: t, schemaIndex: n }
2595
+ }), i.length > 0 ? { success: !1, errors: i } : { success: !0, data: n };
2596
+ };
2597
+ function Q(e) {
2598
+ return typeof e == "string" ? e.replace(/\[\[([^\]]+)\]\]/g, "$1") : Array.isArray(e) ? e.map(Q) : e !== null && typeof e == "object" ? Object.fromEntries(
2599
+ Object.entries(e).map(([t, r]) => [t, Q(r)])
2600
+ ) : e;
2601
+ }
2602
+ function w(e, t, r) {
2603
+ const s = e();
2604
+ if (!s.success) {
2605
+ const n = r ? s.errors.map(r) : s.errors;
2606
+ return t.push(...n), null;
2607
+ }
2608
+ return s.data;
2609
+ }
2610
+ const ve = "$trend", Ne = "$forecast";
2611
+ function yn(e) {
2612
+ return e.map(({ attribute: t, style: r }) => {
2613
+ const s = r == null ? void 0 : r.sortType;
2614
+ if (!s) return t;
2615
+ const n = typeof s == "object" ? s.direction : s;
2616
+ return te(n) ? t.sort(re(n)) : t;
2617
+ });
2618
+ }
2619
+ function gn(e) {
2620
+ var t, r;
2621
+ return (r = (t = e.composeCode) == null ? void 0 : t.includes("measureFactory.trend")) != null ? r : !1;
2622
+ }
2623
+ function hn(e) {
2624
+ var t, r;
2625
+ return (r = (t = e.composeCode) == null ? void 0 : t.includes("measureFactory.forecast")) != null ? r : !1;
2626
+ }
2627
+ function bn(e) {
2628
+ var r, s;
2629
+ const t = [];
2630
+ for (const { measure: n, style: i } of e) {
2631
+ const o = i == null ? void 0 : i.sortType, a = o && te(o) ? n.sort(re(o)) : n;
2632
+ t.push(a), i != null && i.trend && !gn(n) && t.push(
2633
+ Mr(n, `${ve}_${(r = n.name) != null ? r : "Measure"}`, i.trend)
2634
+ ), i != null && i.forecast && !hn(n) && t.push(
2635
+ vr(
2636
+ n,
2637
+ `${Ne}_${(s = n.name) != null ? s : "Measure"}`,
2638
+ i.forecast
2639
+ )
2640
+ );
2641
+ }
2642
+ return t;
2643
+ }
2644
+ const Jn = (e) => {
2645
+ const { data: t } = e, { dataSource: r, tables: s } = e.context, n = xe(s), i = [], o = w(
2646
+ () => wt({
2647
+ data: t.dimensions || [],
2648
+ context: { dataSource: r, schemaIndex: n }
2394
2649
  }),
2395
- o
2396
- ), a = x(
2397
- () => qs({
2398
- data: r.measures || [],
2399
- context: { dataSource: t, schemaIndex: n }
2650
+ i
2651
+ ), a = w(
2652
+ () => Mt({
2653
+ data: t.measures || [],
2654
+ context: { dataSource: r, schemaIndex: n }
2400
2655
  }),
2401
- o
2402
- ), u = x(
2403
- () => ps({
2404
- data: r.filters || [],
2405
- context: { dataSource: t, schemaIndex: n }
2656
+ i
2657
+ ), u = w(
2658
+ () => Oe({
2659
+ data: t.filters || [],
2660
+ context: { dataSource: r, schemaIndex: n }
2406
2661
  }),
2407
- o
2662
+ i
2408
2663
  );
2409
2664
  let c = null;
2410
- return r.highlights && (c = x(
2411
- () => gs({
2412
- data: r.highlights || [],
2413
- context: { dataSource: t, schemaIndex: n }
2665
+ return t.highlights && (c = w(
2666
+ () => Me({
2667
+ data: t.highlights || [],
2668
+ context: { dataSource: r, schemaIndex: n }
2414
2669
  }),
2415
- o
2416
- )), o.length > 0 ? {
2670
+ i
2671
+ )), i.length > 0 ? {
2417
2672
  success: !1,
2418
- errors: o
2673
+ errors: i
2419
2674
  } : {
2420
2675
  success: !0,
2421
- data: p({
2422
- dataSource: Jr(t),
2423
- dimensions: i || [],
2424
- measures: a || [],
2676
+ data: g({
2677
+ dataSource: Fe(r),
2678
+ dimensions: o ? yn(o) : [],
2679
+ measures: a ? bn(a) : [],
2425
2680
  filters: u || []
2426
2681
  }, c && { highlights: c })
2427
2682
  };
2428
2683
  };
2429
- function Es(e) {
2430
- const r = [], t = [];
2684
+ function Je(e) {
2685
+ return typeof e == "object" && e !== null && "column" in e && e.column !== void 0;
2686
+ }
2687
+ function Re(e) {
2688
+ const t = [], r = [];
2431
2689
  return e.forEach((s, n) => {
2432
- const o = () => typeof s.toJSON == "function" ? s.toJSON() : s;
2433
- if (!s.composeCode) {
2434
- t.push({
2690
+ var l, f, h;
2691
+ const i = Je(s) ? s.column : s, o = Je(s) ? s : void 0, a = () => typeof i.toJSON == "function" ? i.toJSON() : i;
2692
+ if (!i.composeCode) {
2693
+ r.push({
2435
2694
  category: "dimensions",
2436
2695
  index: n,
2437
- input: o(),
2438
- message: `Dimension at index ${n} (${s.name || "unnamed"}) is missing composeCode`
2696
+ input: a(),
2697
+ message: `Dimension at index ${n} (${i.name || "unnamed"}) is missing composeCode`
2439
2698
  });
2440
2699
  return;
2441
2700
  }
2442
- if (!s.composeCode.startsWith(w)) {
2443
- t.push({
2701
+ if (!i.composeCode.startsWith(q)) {
2702
+ r.push({
2444
2703
  category: "dimensions",
2445
2704
  index: n,
2446
- input: o(),
2447
- message: `Expected composeCode to start with "${w}" for dimension at index ${n} (${s.name || "unnamed"}). Got: "${s.composeCode}"`
2705
+ input: a(),
2706
+ message: `Expected composeCode to start with '${q}' for dimension at index ${n} (${i.name || "unnamed"}). Got: '${i.composeCode}'`
2448
2707
  });
2449
2708
  return;
2450
2709
  }
2451
- const i = s.getSort();
2452
- if (i !== void 0 && i !== ne.None) {
2453
- const a = {
2454
- column: s.composeCode,
2455
- sortType: $e(i)
2456
- };
2457
- r.push(a);
2710
+ const u = (h = o != null && o.sortType ? re(o.sortType) : void 0) != null ? h : ((l = i.getSort) == null ? void 0 : l.call(i)) !== void 0 && ((f = i.getSort) == null ? void 0 : f.call(i)) !== B.None ? i.getSort() : void 0, c = o ? _(o, "column") : {};
2711
+ if (u !== void 0 && u !== B.None || o && Object.keys(c).length > 0) {
2712
+ const p = g(g({
2713
+ column: i.composeCode
2714
+ }, u !== void 0 && u !== B.None && { sortType: tt(u) }), c);
2715
+ t.push(p);
2458
2716
  } else
2459
- r.push(s.composeCode);
2460
- }), t.length > 0 ? { success: !1, errors: t } : { success: !0, data: r };
2717
+ t.push(i.composeCode);
2718
+ }), r.length > 0 ? { success: !1, errors: r } : { success: !0, data: t };
2461
2719
  }
2462
- function Qe(e, r) {
2463
- const t = [];
2464
- let s = "", n = 0, o = !1, i = null;
2720
+ function vt(e, t) {
2721
+ const r = [];
2722
+ let s = "", n = 0, i = !1, o = null;
2465
2723
  for (let a = 0; a < e.length; a++) {
2466
2724
  const u = e[a], c = e[a + 1];
2467
- if (o) {
2468
- if (u !== i) {
2725
+ if (i) {
2726
+ if (u !== o) {
2469
2727
  s += u;
2470
2728
  continue;
2471
2729
  }
2472
- if (c === i) {
2730
+ if (c === o) {
2473
2731
  s += u + c, a++;
2474
2732
  continue;
2475
2733
  }
2476
- o = !1, i = null, s += u;
2734
+ i = !1, o = null, s += u;
2477
2735
  continue;
2478
2736
  } else {
2479
2737
  if (u === "'" || u === '"') {
2480
- o = !0, i = u, s += u;
2738
+ i = !0, o = u, s += u;
2481
2739
  continue;
2482
2740
  }
2483
- if ("([{".includes(u) && n++, ")]}".includes(u) && n--, u === r && n === 0) {
2484
- t.push(s.trim()), s = "";
2741
+ if ("([{".includes(u) && n++, ")]}".includes(u) && n--, u === t && n === 0) {
2742
+ r.push(s.trim()), s = "";
2485
2743
  continue;
2486
2744
  }
2487
2745
  }
2488
2746
  s += u;
2489
2747
  }
2490
- return s.trim() && t.push(s.trim()), t;
2748
+ return s.trim() && r.push(s.trim()), r;
2491
2749
  }
2492
- function Cs(e, r) {
2493
- let t = 0, s = !1, n = null;
2494
- for (let o = 0; o < e.length; o++) {
2495
- const i = e[o], a = e[o + 1];
2750
+ function Fn(e, t) {
2751
+ let r = 0, s = !1, n = null;
2752
+ for (let i = 0; i < e.length; i++) {
2753
+ const o = e[i], a = e[i + 1];
2496
2754
  if (s) {
2497
- if (i !== n) continue;
2755
+ if (o !== n) continue;
2498
2756
  if (a === n) {
2499
- o++;
2757
+ i++;
2500
2758
  continue;
2501
2759
  }
2502
2760
  s = !1, n = null;
2503
2761
  } else {
2504
- if (i === "'" || i === '"') {
2505
- s = !0, n = i;
2762
+ if (o === "'" || o === '"') {
2763
+ s = !0, n = o;
2506
2764
  continue;
2507
2765
  }
2508
- if ("([{".includes(i) && t++, ")]}".includes(i) && t--, i === r && t === 0) return o;
2766
+ if ("([{".includes(o) && r++, ")]}".includes(o) && r--, o === t && r === 0) return i;
2509
2767
  }
2510
2768
  }
2511
2769
  return -1;
2512
2770
  }
2513
- function $s(e) {
2771
+ function wn(e) {
2514
2772
  return e.startsWith("'") && e.endsWith("'") || e.startsWith('"') && e.endsWith('"') ? e.slice(1, -1) : e;
2515
2773
  }
2516
2774
  function V(e) {
2517
2775
  if (!e || typeof e != "string")
2518
2776
  throw new Error(`Invalid composeCode: expected non-empty string, got ${typeof e}`);
2519
- const r = e.trim();
2520
- if (!r)
2521
- throw new Error("Invalid composeCode: empty string");
2522
- const t = r.match(/^([a-zA-Z_$][a-zA-Z0-9_.$]*)\s*\((.*)\)$/);
2777
+ const t = e.trim();
2523
2778
  if (!t)
2524
- throw new Error(`Invalid composeCode format: expected function call, got "${r}"`);
2525
- const s = t[1], n = t[2], o = Ye(n);
2779
+ throw new Error("Invalid composeCode: empty string");
2780
+ const r = t.match(/^([a-zA-Z_$][a-zA-Z0-9_.$]*)\s*\((.*)\)$/);
2781
+ if (!r)
2782
+ throw new Error(`Invalid composeCode format: expected function call, got '${t}'`);
2783
+ const s = r[1], n = r[2], i = Nt(n);
2526
2784
  return {
2527
2785
  function: s,
2528
- args: o
2786
+ args: i
2529
2787
  };
2530
2788
  }
2531
- function Ye(e) {
2532
- return e.trim() ? Qe(e, ",").map(He) : [];
2789
+ function Nt(e) {
2790
+ return e.trim() ? vt(e, ",").map(Rt) : [];
2533
2791
  }
2534
- function He(e) {
2792
+ function Rt(e) {
2535
2793
  if (!e)
2536
2794
  throw new Error("Cannot parse empty argument value");
2537
2795
  if (e === "null")
@@ -2545,40 +2803,40 @@ function He(e) {
2545
2803
  if (e.match(/^-?\d+(\.\d+)?$/))
2546
2804
  return parseFloat(e);
2547
2805
  if (e.startsWith("'") && e.endsWith("'") || e.startsWith('"') && e.endsWith('"')) {
2548
- const t = e[0];
2549
- return e.slice(1, -1).replace(new RegExp(`${t}${t}`, "g"), t);
2806
+ const r = e[0];
2807
+ return e.slice(1, -1).replace(new RegExp(`${r}${r}`, "g"), r);
2550
2808
  }
2551
2809
  if (e.startsWith("[") && e.endsWith("]")) {
2552
- const t = e.slice(1, -1).trim();
2553
- if (!t)
2810
+ const r = e.slice(1, -1).trim();
2811
+ if (!r)
2554
2812
  return [];
2555
- const s = Ye(t);
2813
+ const s = Nt(r);
2556
2814
  return s.every((n) => typeof n == "string"), s;
2557
2815
  }
2558
2816
  if (e.startsWith("{") && e.endsWith("}")) {
2559
- const t = e.slice(1, -1).trim();
2560
- return t ? xs(t) : {};
2817
+ const r = e.slice(1, -1).trim();
2818
+ return r ? An(r) : {};
2561
2819
  }
2562
2820
  return e.includes("(") && e.includes(")") ? V(e) : (e.startsWith("DM."), e);
2563
2821
  }
2564
- function As(e) {
2565
- const r = Cs(e, ":");
2566
- if (r === -1)
2567
- throw new Error(`Invalid object property: expected "key: value", got "${e}"`);
2568
- const t = $s(e.slice(0, r).trim()), s = He(e.slice(r + 1).trim());
2569
- return [t, s];
2822
+ function qn(e) {
2823
+ const t = Fn(e, ":");
2824
+ if (t === -1)
2825
+ throw new Error(`Invalid object property: expected 'key: value', got '${e}'`);
2826
+ const r = wn(e.slice(0, t).trim()), s = Rt(e.slice(t + 1).trim());
2827
+ return [r, s];
2570
2828
  }
2571
- function xs(e) {
2829
+ function An(e) {
2572
2830
  if (!e.trim()) return {};
2573
- const r = Qe(e, ",").map(As).filter(([, t]) => t !== null);
2574
- return Object.fromEntries(r);
2831
+ const t = vt(e, ",").map(qn).filter(([, r]) => r !== null);
2832
+ return Object.fromEntries(t);
2575
2833
  }
2576
- const re = "Unknown error";
2577
- function Ds(e) {
2834
+ const ge = "Unknown error";
2835
+ function Ie(e) {
2578
2836
  if (!e)
2579
2837
  return { success: !0, data: [] };
2580
- const r = [];
2581
- if (Gr(e)) {
2838
+ const t = [];
2839
+ if (Nr(e)) {
2582
2840
  if (!e.composeCode)
2583
2841
  return {
2584
2842
  success: !1,
@@ -2594,7 +2852,7 @@ function Ds(e) {
2594
2852
  try {
2595
2853
  return { success: !0, data: [V(e.composeCode)] };
2596
2854
  } catch (s) {
2597
- const n = s instanceof Error ? s.message : re;
2855
+ const n = s instanceof Error ? s.message : ge;
2598
2856
  return {
2599
2857
  success: !1,
2600
2858
  errors: [
@@ -2602,162 +2860,914 @@ function Ds(e) {
2602
2860
  category: "filters",
2603
2861
  index: -1,
2604
2862
  input: e,
2605
- message: `Failed to parse composeCode for FilterRelations: ${n}. ComposeCode: "${e.composeCode}"`
2863
+ message: `Failed to parse composeCode for FilterRelations: ${n}. ComposeCode: '${e.composeCode}'`
2606
2864
  }
2607
2865
  ]
2608
2866
  };
2609
2867
  }
2610
2868
  }
2611
- const t = [];
2869
+ const r = [];
2612
2870
  return e.forEach((s, n) => {
2871
+ var i;
2613
2872
  if (!s.composeCode) {
2614
- r.push({
2873
+ t.push({
2615
2874
  category: "filters",
2616
2875
  index: n,
2617
2876
  input: s,
2618
- message: `Filter at index ${n} (${s.name || "unnamed"}) is missing composeCode`
2877
+ message: `Filter at index ${n} (${(i = s.name) != null ? i : "unnamed"}) is missing composeCode`
2619
2878
  });
2620
2879
  return;
2621
2880
  }
2622
2881
  try {
2623
2882
  const o = V(s.composeCode);
2624
- t.push(o);
2883
+ r.push(o);
2625
2884
  } catch (o) {
2626
- const i = o instanceof Error ? o.message : re;
2627
- r.push({
2885
+ const a = o instanceof Error ? o.message : ge;
2886
+ t.push({
2628
2887
  category: "filters",
2629
2888
  index: n,
2630
2889
  input: s,
2631
- message: `Failed to parse composeCode for filter at index ${n}: ${i}. ComposeCode: "${s.composeCode}"`
2890
+ message: `Failed to parse composeCode for filter at index ${n}: ${a}. ComposeCode: '${s.composeCode}'`
2632
2891
  });
2633
2892
  }
2634
- }), r.length > 0 ? { success: !1, errors: r } : { success: !0, data: t };
2893
+ }), t.length > 0 ? { success: !1, errors: t } : { success: !0, data: r };
2635
2894
  }
2636
- function Ms(e) {
2895
+ function ke(e) {
2637
2896
  if (!e)
2638
2897
  return { success: !0, data: [] };
2639
- const r = [], t = [];
2898
+ const t = [], r = [];
2640
2899
  return e.forEach((s, n) => {
2900
+ var i;
2641
2901
  if (!s.composeCode) {
2642
- t.push({
2902
+ r.push({
2643
2903
  category: "highlights",
2644
2904
  index: n,
2645
2905
  input: s,
2646
- message: `Highlight filter at index ${n} (${s.name || "unnamed"}) is missing composeCode`
2906
+ message: `Highlight filter at index ${n} (${(i = s.name) != null ? i : "unnamed"}) is missing composeCode`
2647
2907
  });
2648
2908
  return;
2649
2909
  }
2650
2910
  try {
2651
2911
  const o = V(s.composeCode);
2652
- r.push(o);
2912
+ t.push(o);
2653
2913
  } catch (o) {
2654
- const i = o instanceof Error ? o.message : re;
2655
- t.push({
2914
+ const a = o instanceof Error ? o.message : ge;
2915
+ r.push({
2656
2916
  category: "highlights",
2657
2917
  index: n,
2658
2918
  input: s,
2659
- message: `Failed to parse composeCode for highlight filter at index ${n}: ${i}. ComposeCode: "${s.composeCode}"`
2919
+ message: `Failed to parse composeCode for highlight filter at index ${n}: ${a}. ComposeCode: '${s.composeCode}'`
2660
2920
  });
2661
2921
  }
2662
- }), t.length > 0 ? { success: !1, errors: t } : { success: !0, data: r };
2922
+ }), r.length > 0 ? { success: !1, errors: r } : { success: !0, data: t };
2923
+ }
2924
+ function Ye(e) {
2925
+ return typeof e == "object" && e !== null && "column" in e && e.column !== void 0;
2663
2926
  }
2664
- function Ss(e) {
2665
- const r = [], t = [];
2927
+ function Be(e) {
2928
+ const t = [], r = [];
2666
2929
  return e.forEach((s, n) => {
2667
- const o = () => typeof s.toJSON == "function" ? s.toJSON() : s;
2668
- if (!s.composeCode) {
2669
- t.push({
2930
+ var u, c, m;
2931
+ const i = Ye(s) ? s.column : s, o = Ye(s) ? s : void 0, a = () => typeof i.toJSON == "function" ? i.toJSON() : i;
2932
+ if (!i.composeCode) {
2933
+ r.push({
2670
2934
  category: "measures",
2671
2935
  index: n,
2672
- input: o(),
2673
- message: `Measure at index ${n} (${s.name || "unnamed"}) is missing composeCode`
2936
+ input: a(),
2937
+ message: `Measure at index ${n} (${i.name || "unnamed"}) is missing composeCode`
2674
2938
  });
2675
2939
  return;
2676
2940
  }
2677
2941
  try {
2678
- const i = V(s.composeCode), a = s.getSort();
2679
- if (a !== void 0 && a !== ne.None) {
2680
- const u = {
2681
- column: i,
2682
- sortType: $e(a)
2683
- };
2684
- r.push(u);
2942
+ const l = V(i.composeCode), f = (m = o != null && o.sortType ? re(o.sortType) : void 0) != null ? m : ((u = i.getSort) == null ? void 0 : u.call(i)) !== void 0 && ((c = i.getSort) == null ? void 0 : c.call(i)) !== B.None ? i.getSort() : void 0;
2943
+ if (f !== void 0 && f !== B.None || o && Object.keys(_(o, "column")).length > 0) {
2944
+ const p = o ? _(o, "column") : {}, d = g(g({
2945
+ column: l
2946
+ }, f !== void 0 && f !== B.None && { sortType: tt(f) }), p);
2947
+ t.push(d);
2685
2948
  } else
2686
- r.push(i);
2687
- } catch (i) {
2688
- const a = i instanceof Error ? i.message : "Unknown error";
2689
- t.push({
2949
+ t.push(l);
2950
+ } catch (l) {
2951
+ const f = l instanceof Error ? l.message : "Unknown error";
2952
+ r.push({
2690
2953
  category: "measures",
2691
2954
  index: n,
2692
- input: o(),
2693
- message: `Failed to parse composeCode for measure at index ${n} (${s.name || "unnamed"}): ${a}. ComposeCode: "${s.composeCode}"`
2955
+ input: a(),
2956
+ message: `Failed to parse composeCode for measure at index ${n} (${i.name || "unnamed"}): ${f}. ComposeCode: '${i.composeCode}'`
2694
2957
  });
2695
2958
  }
2696
- }), t.length > 0 ? { success: !1, errors: t } : { success: !0, data: r };
2959
+ }), r.length > 0 ? { success: !1, errors: r } : { success: !0, data: t };
2697
2960
  }
2698
- function te(e) {
2699
- return typeof e == "string" ? e.replace(/\[\[([^\]]+)\]\]/g, "$1") : Array.isArray(e) ? e.map(te) : e !== null && typeof e == "object" ? Object.fromEntries(
2700
- Object.entries(e).map(([r, t]) => [r, te(t)])
2701
- ) : e;
2961
+ function Ge(e) {
2962
+ var t, r, s, n;
2963
+ return ((r = (t = e.composeCode) == null ? void 0 : t.includes("measureFactory.trend")) != null ? r : !1) || ((n = (s = e.name) == null ? void 0 : s.startsWith(ve)) != null ? n : !1);
2702
2964
  }
2703
- function Bs(e) {
2704
- const r = [], t = x(
2705
- () => Es(e.dimensions || []),
2706
- r
2707
- ), s = x(
2708
- () => Ss(e.measures || []),
2709
- r
2710
- ), n = x(
2711
- () => Ds(e.filters),
2712
- r
2965
+ function Qe(e) {
2966
+ var t, r, s, n;
2967
+ return ((r = (t = e.composeCode) == null ? void 0 : t.includes("measureFactory.forecast")) != null ? r : !1) || ((n = (s = e.name) == null ? void 0 : s.startsWith(Ne)) != null ? n : !1);
2968
+ }
2969
+ function He(e) {
2970
+ try {
2971
+ const t = V(e.trim());
2972
+ return t.args[2] != null && typeof t.args[2] == "object" ? t.args[2] : void 0;
2973
+ } catch (t) {
2974
+ return;
2975
+ }
2976
+ }
2977
+ function Cn(e) {
2978
+ var s, n, i;
2979
+ if (!(e != null && e.length)) return [];
2980
+ const t = /* @__PURE__ */ new Set(), r = [];
2981
+ for (let o = 0; o < e.length; o++) {
2982
+ if (t.has(o)) continue;
2983
+ const a = e[o];
2984
+ if (Ge(a) || Qe(a)) {
2985
+ r.push(a);
2986
+ continue;
2987
+ }
2988
+ const u = (s = a.name) != null ? s : "Measure", c = `${ve}_${u}`, m = `${Ne}_${u}`;
2989
+ let l, f, h = o + 1;
2990
+ if (h < e.length && !t.has(h) && Ge(e[h]) && e[h].name === c) {
2991
+ const p = (n = e[h].composeCode) == null ? void 0 : n.trim();
2992
+ p && (l = He(p), t.add(h), h++);
2993
+ }
2994
+ if (h < e.length && !t.has(h) && Qe(e[h]) && e[h].name === m) {
2995
+ const p = (i = e[h].composeCode) == null ? void 0 : i.trim();
2996
+ p && (f = He(p), t.add(h));
2997
+ }
2998
+ l !== void 0 || f !== void 0 ? r.push(g(g({
2999
+ column: a
3000
+ }, l && Object.keys(l).length > 0 && { trend: l }), f && Object.keys(f).length > 0 && { forecast: f })) : r.push(a);
3001
+ }
3002
+ return r;
3003
+ }
3004
+ function Yn(e) {
3005
+ const t = [], r = w(
3006
+ () => Re(e.dimensions || []),
3007
+ t
3008
+ ), s = Cn(e.measures || []), n = w(
3009
+ () => Be(s),
3010
+ t
3011
+ ), i = w(
3012
+ () => Ie(e.filters),
3013
+ t
2713
3014
  );
2714
3015
  let o = null;
2715
- if (e.highlights && e.highlights.length > 0 && (o = x(
2716
- () => Ms(e.highlights),
2717
- r
2718
- )), r.length > 0)
3016
+ if (e.highlights && e.highlights.length > 0 && (o = w(
3017
+ () => ke(e.highlights),
3018
+ t
3019
+ )), t.length > 0)
2719
3020
  return {
2720
3021
  success: !1,
2721
- errors: r
3022
+ errors: t
2722
3023
  };
2723
- const i = p({
2724
- dimensions: t || [],
2725
- measures: s || [],
2726
- filters: n || []
3024
+ const a = g({
3025
+ dimensions: r || [],
3026
+ measures: n || [],
3027
+ filters: i || []
2727
3028
  }, o && { highlights: o });
2728
3029
  return {
2729
3030
  success: !0,
2730
3031
  // Strip [[delimiters]] from all strings to preserve original names with spaces
2731
- data: te(i)
3032
+ data: Q(a)
2732
3033
  };
2733
3034
  }
2734
- function Ts(e) {
2735
- const { filters: r, relations: t } = Yr(
3035
+ const It = new Set(
3036
+ Rr.filter((e) => e !== "image")
3037
+ ), Xe = Object.freeze([...It]), le = /* @__PURE__ */ new Set([
3038
+ "category",
3039
+ "value",
3040
+ "breakBy",
3041
+ "breakByPoint",
3042
+ "x",
3043
+ "y",
3044
+ "breakByColor",
3045
+ "size",
3046
+ "boxType",
3047
+ "outliers",
3048
+ "geo",
3049
+ "colorBy",
3050
+ "details",
3051
+ "color",
3052
+ "date",
3053
+ "columns",
3054
+ "rows",
3055
+ "values",
3056
+ "secondary",
3057
+ "min",
3058
+ "max",
3059
+ "seriesToColorMap"
3060
+ ]), En = {
3061
+ line: {
3062
+ validAxes: /* @__PURE__ */ new Set(["category", "value", "breakBy", "seriesToColorMap"]),
3063
+ requiredAxes: ["category", "value"]
3064
+ },
3065
+ area: {
3066
+ validAxes: /* @__PURE__ */ new Set(["category", "value", "breakBy", "seriesToColorMap"]),
3067
+ requiredAxes: ["category", "value"]
3068
+ },
3069
+ bar: {
3070
+ validAxes: /* @__PURE__ */ new Set(["category", "value", "breakBy", "seriesToColorMap"]),
3071
+ requiredAxes: ["category", "value"]
3072
+ },
3073
+ column: {
3074
+ validAxes: /* @__PURE__ */ new Set(["category", "value", "breakBy", "seriesToColorMap"]),
3075
+ requiredAxes: ["category", "value"]
3076
+ },
3077
+ streamgraph: {
3078
+ validAxes: /* @__PURE__ */ new Set(["category", "value", "breakBy", "seriesToColorMap"]),
3079
+ requiredAxes: ["category", "value"]
3080
+ },
3081
+ polar: {
3082
+ validAxes: /* @__PURE__ */ new Set(["category", "value", "breakBy", "seriesToColorMap"]),
3083
+ requiredAxes: ["category", "value"]
3084
+ },
3085
+ pie: {
3086
+ validAxes: /* @__PURE__ */ new Set(["category", "value", "seriesToColorMap"]),
3087
+ requiredAxes: ["category", "value"]
3088
+ },
3089
+ funnel: {
3090
+ validAxes: /* @__PURE__ */ new Set(["category", "value", "seriesToColorMap"]),
3091
+ requiredAxes: ["category", "value"]
3092
+ },
3093
+ treemap: {
3094
+ validAxes: /* @__PURE__ */ new Set(["category", "value", "seriesToColorMap"]),
3095
+ requiredAxes: ["category", "value"]
3096
+ },
3097
+ sunburst: {
3098
+ validAxes: /* @__PURE__ */ new Set(["category", "value", "seriesToColorMap"]),
3099
+ requiredAxes: ["category", "value"]
3100
+ },
3101
+ scatter: {
3102
+ validAxes: /* @__PURE__ */ new Set(["x", "y", "breakByPoint", "breakByColor", "size", "seriesToColorMap"]),
3103
+ requiredAxes: []
3104
+ },
3105
+ table: {
3106
+ validAxes: /* @__PURE__ */ new Set(["columns"]),
3107
+ requiredAxes: ["columns"]
3108
+ },
3109
+ indicator: {
3110
+ validAxes: /* @__PURE__ */ new Set(["value", "secondary", "min", "max"]),
3111
+ requiredAxes: []
3112
+ },
3113
+ boxplot: {
3114
+ validAxes: /* @__PURE__ */ new Set(["category", "value", "boxType", "outliers"]),
3115
+ requiredAxes: ["value"]
3116
+ },
3117
+ areamap: {
3118
+ validAxes: /* @__PURE__ */ new Set(["geo", "color"]),
3119
+ requiredAxes: ["geo"]
3120
+ },
3121
+ scattermap: {
3122
+ validAxes: /* @__PURE__ */ new Set(["geo", "size", "colorBy", "details"]),
3123
+ requiredAxes: ["geo"]
3124
+ },
3125
+ "calendar-heatmap": {
3126
+ validAxes: /* @__PURE__ */ new Set(["date", "value"]),
3127
+ requiredAxes: ["date", "value"]
3128
+ },
3129
+ arearange: {
3130
+ validAxes: /* @__PURE__ */ new Set(["category", "value", "breakBy", "seriesToColorMap"]),
3131
+ requiredAxes: ["category", "value"]
3132
+ }
3133
+ }, xn = /* @__PURE__ */ new Set([
3134
+ "category",
3135
+ "breakBy",
3136
+ "breakByPoint",
3137
+ "rows",
3138
+ "geo",
3139
+ "details",
3140
+ "date"
3141
+ ]), $n = /* @__PURE__ */ new Set([
3142
+ "value",
3143
+ "size",
3144
+ "colorBy",
3145
+ "boxType",
3146
+ "outliers",
3147
+ "values",
3148
+ "secondary",
3149
+ "min",
3150
+ "max",
3151
+ "color"
3152
+ ]);
3153
+ function Tn(e) {
3154
+ const t = En[e];
3155
+ if (t)
3156
+ return {
3157
+ validAxes: new Set(t.validAxes),
3158
+ requiredAxes: Object.freeze([...t.requiredAxes])
3159
+ };
3160
+ }
3161
+ function kt(e) {
3162
+ return typeof e == "string" && It.has(e);
3163
+ }
3164
+ function Dn(e, t, r) {
3165
+ if (r === "boxplot" && e === "value" || r === "calendar-heatmap" && e === "date" || xn.has(e))
3166
+ return !0;
3167
+ if ($n.has(e))
3168
+ return !1;
3169
+ const s = Array.isArray(t) ? t[0] : t;
3170
+ if (!s)
3171
+ return !0;
3172
+ let n;
3173
+ return T(s) && "column" in s && (n = s.column), !(E(s) || n !== void 0 && E(n));
3174
+ }
3175
+ function Sn(e) {
3176
+ const t = [], r = {
3177
+ chartType: "",
3178
+ dataOptions: {}
3179
+ };
3180
+ if (!T(e))
3181
+ return t.push({
3182
+ category: "chartType",
3183
+ index: -1,
3184
+ input: e,
3185
+ message: "Expected an object"
3186
+ }), { normalized: r, errors: t };
3187
+ const s = e.chartType;
3188
+ if (s === void 0) {
3189
+ const i = Object.keys(e), o = M("chartType", i, (c) => c), a = o && o.distance <= x ? ` Did you mean 'chartType'? (You may have typed '${o.best}')` : "", u = o && o.distance <= x ? { [o.best]: e[o.best] } : e;
3190
+ t.push({
3191
+ category: "chartType",
3192
+ index: -1,
3193
+ input: u,
3194
+ message: `chartType is required.${a}`
3195
+ });
3196
+ } else if (kt(s))
3197
+ r.chartType = s;
3198
+ else {
3199
+ const i = M(String(s), Xe, (u) => u), o = i && i.distance <= x ? ` Did you mean '${i.best}'?` : "", a = Xe.slice(0, 8).join(", ");
3200
+ t.push({
3201
+ category: "chartType",
3202
+ index: -1,
3203
+ input: s,
3204
+ message: `Invalid chartType '${s}'. Valid types: ${a}, ...${o}`
3205
+ });
3206
+ }
3207
+ const n = e.dataOptions;
3208
+ if (n === void 0) {
3209
+ const i = Object.keys(e), o = M("dataOptions", i, (c) => c), a = o && o.distance <= x ? ` Did you mean 'dataOptions'? (You may have typed '${o.best}')` : "", u = o && o.distance <= x ? { [o.best]: e[o.best] } : e;
3210
+ t.push({
3211
+ category: "dataOptions",
3212
+ index: -1,
3213
+ input: u,
3214
+ message: `dataOptions is required.${a}`
3215
+ });
3216
+ } else n !== null && typeof n == "object" && (r.dataOptions = n);
3217
+ return e.styleOptions !== void 0 && (r.styleOptions = e.styleOptions), e.filters !== void 0 && Array.isArray(e.filters) && (r.filters = e.filters), e.highlights !== void 0 && Array.isArray(e.highlights) && (r.highlights = e.highlights), { normalized: r, errors: t };
3218
+ }
3219
+ function On(e) {
3220
+ return e.map(
3221
+ ({ attribute: t, style: r }) => r ? g({ column: t }, r) : t
3222
+ );
3223
+ }
3224
+ function Mn(e) {
3225
+ return e.map(
3226
+ ({ measure: t, style: r }) => r ? g({ column: t }, r) : t
3227
+ );
3228
+ }
3229
+ function Bt(e) {
3230
+ return Array.isArray(e) ? e : [e];
3231
+ }
3232
+ function he(e) {
3233
+ return (t) => F(g({}, t), {
3234
+ category: "dataOptions",
3235
+ index: e
3236
+ });
3237
+ }
3238
+ function ee(e, t, r, s, n) {
3239
+ const i = t ? Bt(
3240
+ t
3241
+ ) : [];
3242
+ if (i.length === 0)
3243
+ return [];
3244
+ if (r === "dimension") {
3245
+ const a = w(
3246
+ () => wt({
3247
+ data: i,
3248
+ context: s
3249
+ }),
3250
+ n,
3251
+ he(e)
3252
+ );
3253
+ return a !== null ? On(a) : null;
3254
+ }
3255
+ const o = w(
3256
+ () => Mt({
3257
+ data: i,
3258
+ context: s
3259
+ }),
3260
+ n,
3261
+ he(e)
3262
+ );
3263
+ return o !== null ? Mn(o) : null;
3264
+ }
3265
+ function Ze(e, t, r) {
3266
+ const s = Array.isArray(t) ? t : t != null ? [t] : [];
3267
+ if (r === "dimension") {
3268
+ const i = Re(
3269
+ s
3270
+ );
3271
+ return i.success ? { success: !0, data: i.data } : {
3272
+ success: !1,
3273
+ errors: i.errors.map((o) => F(g({}, o), {
3274
+ category: "dataOptions",
3275
+ index: e
3276
+ }))
3277
+ };
3278
+ }
3279
+ const n = Be(s);
3280
+ return n.success ? { success: !0, data: n.data } : {
3281
+ success: !1,
3282
+ errors: n.errors.map((i) => F(g({}, i), {
3283
+ category: "dataOptions",
3284
+ index: e
3285
+ }))
3286
+ };
3287
+ }
3288
+ function vn(e, t) {
3289
+ let r;
3290
+ T(e) && "column" in e && (r = e.column);
3291
+ const n = !(E(e) || r !== void 0 && E(r)) ? "dimension" : "measure", i = [], o = ee("columns", [e], n, t, i);
3292
+ return o !== null ? { success: !0, data: o } : { success: !1, errors: i };
3293
+ }
3294
+ function Nn(e, t, r, s) {
3295
+ const n = [];
3296
+ for (const i of e) {
3297
+ const o = w(
3298
+ () => vn(i, t),
3299
+ r,
3300
+ s
3301
+ );
3302
+ o && n.push(...o);
3303
+ }
3304
+ return n;
3305
+ }
3306
+ function Rn(e, t, r) {
3307
+ if (!e || !T(e))
3308
+ return r.push({
3309
+ category: "dataOptions",
3310
+ index: -1,
3311
+ input: e,
3312
+ message: "dataOptions is required"
3313
+ }), null;
3314
+ const s = {}, { chartType: n } = t, i = r.length, o = e, a = Object.keys(e), u = /* @__PURE__ */ new Map();
3315
+ for (const l of a)
3316
+ if (!le.has(l)) {
3317
+ const f = M(l, [...le], (p) => p), h = f && f.distance <= x ? ` Did you mean '${f.best}'?` : "";
3318
+ f && f.distance <= x && u.set(l, f.best), r.push({
3319
+ category: "dataOptions",
3320
+ index: l,
3321
+ input: o[l],
3322
+ message: `Unknown dataOptions key '${l}'.${h}`
3323
+ });
3324
+ }
3325
+ const c = n ? Tn(n) : void 0;
3326
+ if (c) {
3327
+ for (const l of a)
3328
+ if (l !== "seriesToColorMap" && !c.validAxes.has(l) && le.has(l)) {
3329
+ const f = M(l, [...c.validAxes], (d) => d), h = f && f.distance <= x ? ` Did you mean '${f.best}'?` : "", p = [...c.validAxes].join(", ");
3330
+ r.push({
3331
+ category: "dataOptions",
3332
+ index: l,
3333
+ input: o[l],
3334
+ message: `Axis '${l}' is not valid for chart type '${n}'. Valid axes: ${p}.${h}`
3335
+ });
3336
+ }
3337
+ for (const l of c.requiredAxes)
3338
+ [...u.values()].includes(l) || (!(l in o) || o[l] == null) && r.push({
3339
+ category: "dataOptions",
3340
+ index: l,
3341
+ input: null,
3342
+ message: `Chart type '${n}' requires '${c.requiredAxes.join(
3343
+ "' and '"
3344
+ )}'. Missing: ${l}.`
3345
+ });
3346
+ n === "indicator" && (["value", "secondary", "min", "max"].some(
3347
+ (h) => h in o && o[h] != null
3348
+ ) || r.push({
3349
+ category: "dataOptions",
3350
+ index: -1,
3351
+ input: e,
3352
+ message: "Indicator chart requires at least one of: value, secondary, min, max."
3353
+ })), n === "scatter" && ("x" in e && e.x != null || "y" in e && e.y != null || r.push({
3354
+ category: "dataOptions",
3355
+ index: -1,
3356
+ input: e,
3357
+ message: "Scatter chart requires at least one of: x, y."
3358
+ }));
3359
+ }
3360
+ if (r.length > i)
3361
+ return null;
3362
+ const m = Object.entries(e);
3363
+ for (const [l, f] of m) {
3364
+ if (!f) continue;
3365
+ if (l === "seriesToColorMap") {
3366
+ s[l] = f;
3367
+ continue;
3368
+ }
3369
+ if (l === "columns") {
3370
+ s[l] = Nn(
3371
+ Bt(f),
3372
+ t,
3373
+ r,
3374
+ he("columns")
3375
+ );
3376
+ continue;
3377
+ }
3378
+ const h = Dn(l, f, n) ? "dimension" : "measure", p = ee(
3379
+ l,
3380
+ f,
3381
+ h,
3382
+ t,
3383
+ r
3384
+ );
3385
+ if (p !== null) {
3386
+ const d = n === "calendar-heatmap" && l === "value";
3387
+ s[l] = d || !Array.isArray(f) ? p[0] : p;
3388
+ }
3389
+ }
3390
+ return r.length > i ? null : s;
3391
+ }
3392
+ function In(e) {
3393
+ if (typeof e != "string") return "iqr";
3394
+ const t = e.split("/")[1];
3395
+ return t === "iqr" || t === "extremums" || t === "standardDeviation" ? t : "iqr";
3396
+ }
3397
+ const Gn = (e) => {
3398
+ var d;
3399
+ const { data: t, context: r } = e, { dataSource: s, tables: n } = r, { normalized: i, errors: o } = Sn(t);
3400
+ if (o.length > 0)
3401
+ return { success: !1, errors: o };
3402
+ const a = i.chartType, u = xe(n), c = [];
3403
+ let m = Rn(
3404
+ i.dataOptions,
3405
+ { dataSource: s, schemaIndex: u, chartType: a },
3406
+ c
3407
+ );
3408
+ if (a === "boxplot" && m) {
3409
+ const b = In((d = i.styleOptions) == null ? void 0 : d.subtype), A = b === "iqr" || b === "standardDeviation";
3410
+ m = F(g({}, m), { boxType: b, outliersEnabled: A });
3411
+ }
3412
+ let l = null;
3413
+ i.filters && i.filters.length > 0 && (l = w(
3414
+ () => Oe({
3415
+ data: i.filters || [],
3416
+ context: { dataSource: s, schemaIndex: u }
3417
+ }),
3418
+ c
3419
+ ));
3420
+ let f = null;
3421
+ if (i.highlights && i.highlights.length > 0 && (f = w(
3422
+ () => Me({
3423
+ data: i.highlights || [],
3424
+ context: { dataSource: s, schemaIndex: u }
3425
+ }),
3426
+ c
3427
+ )), c.length > 0 || m === null)
3428
+ return {
3429
+ success: !1,
3430
+ errors: c
3431
+ };
3432
+ if (!kt(i.chartType))
3433
+ return {
3434
+ success: !1,
3435
+ errors: [
3436
+ {
3437
+ category: "chartType",
3438
+ index: -1,
3439
+ input: i.chartType,
3440
+ message: "Invalid chartType"
3441
+ }
3442
+ ]
3443
+ };
3444
+ const h = i.chartType;
3445
+ return {
3446
+ success: !0,
3447
+ data: g(g(g({
3448
+ dataSet: Fe(s),
3449
+ chartType: h,
3450
+ dataOptions: m
3451
+ }, i.styleOptions && {
3452
+ // Pass-through NLQ JSON; shape matches ChartStyleOptions.
3453
+ styleOptions: i.styleOptions
3454
+ }), l && { filters: l }), f && { highlights: f })
3455
+ };
3456
+ }, Qn = (e) => {
3457
+ const t = [];
3458
+ if (!e.chartType)
3459
+ return {
3460
+ success: !1,
3461
+ errors: [
3462
+ {
3463
+ category: "dimensions",
3464
+ index: -1,
3465
+ input: e,
3466
+ message: "chartType is required"
3467
+ }
3468
+ ]
3469
+ };
3470
+ if (!e.dataOptions)
3471
+ return {
3472
+ success: !1,
3473
+ errors: [
3474
+ {
3475
+ category: "dimensions",
3476
+ index: -1,
3477
+ input: e,
3478
+ message: "dataOptions is required"
3479
+ }
3480
+ ]
3481
+ };
3482
+ let r = null;
3483
+ const s = kn(e.dataOptions);
3484
+ s.success ? r = s.data : t.push(...s.errors);
3485
+ let n;
3486
+ if (e.filters) {
3487
+ const u = w(
3488
+ () => Ie(e.filters),
3489
+ t
3490
+ );
3491
+ n = u != null ? u : void 0;
3492
+ }
3493
+ let i;
3494
+ if (e.highlights && e.highlights.length > 0) {
3495
+ const u = w(
3496
+ () => ke(e.highlights),
3497
+ t
3498
+ );
3499
+ i = u != null ? u : void 0;
3500
+ }
3501
+ if (t.length > 0 || r === null)
3502
+ return { success: !1, errors: t };
3503
+ const o = g(g(g({
3504
+ chartType: e.chartType,
3505
+ dataOptions: r
3506
+ }, e.styleOptions && {
3507
+ styleOptions: e.styleOptions
3508
+ }), n && n.length > 0 && { filters: n }), i && i.length > 0 && { highlights: i });
3509
+ return {
3510
+ success: !0,
3511
+ data: Q(
3512
+ o
3513
+ )
3514
+ };
3515
+ };
3516
+ function kn(e) {
3517
+ const t = {}, r = [], s = /* @__PURE__ */ new Set(["seriesToColorMap", "boxType", "outliersEnabled", "valueTitle"]);
3518
+ for (const [n, i] of Object.entries(e)) {
3519
+ if (n === "seriesToColorMap" && i) {
3520
+ t[n] = i;
3521
+ continue;
3522
+ }
3523
+ if (s.has(n) || i == null) {
3524
+ i != null && (t[n] = i);
3525
+ continue;
3526
+ }
3527
+ const o = Array.isArray(i) ? i : [i], a = Array.isArray(i), u = [], c = [];
3528
+ for (let m = 0; m < o.length; m++) {
3529
+ const l = o[m], h = Bn(l) ? Re([
3530
+ l
3531
+ ]) : Be([l]);
3532
+ h.success ? u.push(...h.data) : h.errors.forEach((p) => {
3533
+ var d;
3534
+ c.push(F(g({}, p), { index: m, input: (d = p.input) != null ? d : l }));
3535
+ });
3536
+ }
3537
+ if (c.length > 0) {
3538
+ r.push(...c);
3539
+ continue;
3540
+ }
3541
+ t[n] = a ? u : u[0];
3542
+ }
3543
+ return r.length > 0 ? { success: !1, errors: r } : { success: !0, data: t };
3544
+ }
3545
+ function Bn(e) {
3546
+ const t = Array.isArray(e) ? e[0] : e;
3547
+ if (!t || !T(t))
3548
+ return !0;
3549
+ const r = "column" in t && t.column != null && T(t.column) ? t.column : t;
3550
+ if ("composeCode" in r) {
3551
+ const s = r.composeCode;
3552
+ if (typeof s == "string" && s.startsWith("DM."))
3553
+ return !0;
3554
+ if (typeof s == "string" && (s.includes("measureFactory") || s.includes("Formula")))
3555
+ return !1;
3556
+ }
3557
+ if ("type" in r) {
3558
+ const s = r.type;
3559
+ if (s === "basemeasure" || s === "calculatedmeasure")
3560
+ return !1;
3561
+ }
3562
+ return !("aggregation" in r || "attribute" in r && "aggregation" in r);
3563
+ }
3564
+ const et = ["rows", "columns", "values", "grandTotals"];
3565
+ function zn(e) {
3566
+ if (!T(e)) return !1;
3567
+ const t = Object.keys(e);
3568
+ return t.every((r) => r === "rows" || r === "columns") && t.every((r) => typeof e[r] == "boolean");
3569
+ }
3570
+ function Pn(e) {
3571
+ const t = [], r = {
3572
+ dataOptions: {}
3573
+ };
3574
+ if (!T(e))
3575
+ return t.push({
3576
+ category: "dataOptions",
3577
+ index: -1,
3578
+ input: e,
3579
+ message: "Expected an object"
3580
+ }), { normalized: r, errors: t };
3581
+ const s = e.dataOptions;
3582
+ if (s === void 0) {
3583
+ const n = Object.keys(e), i = M("dataOptions", n, (u) => u), o = i && i.distance <= x ? ` Did you mean 'dataOptions'? (You may have typed '${i.best}')` : "", a = i && i.distance <= x ? { [i.best]: e[i.best] } : e;
3584
+ t.push({
3585
+ category: "dataOptions",
3586
+ index: -1,
3587
+ input: a,
3588
+ message: `dataOptions is required.${o}`
3589
+ });
3590
+ } else if (T(s)) {
3591
+ const n = s;
3592
+ r.dataOptions = n;
3593
+ for (const o of Object.keys(n))
3594
+ if (!et.includes(o)) {
3595
+ const a = M(o, [...et], (c) => c), u = a && a.distance <= x ? ` Did you mean '${a.best}'?` : "";
3596
+ t.push({
3597
+ category: "dataOptions",
3598
+ index: o,
3599
+ input: n[o],
3600
+ message: `Unknown dataOptions key '${o}'. Valid keys: rows, columns, values, grandTotals.${u}`
3601
+ });
3602
+ }
3603
+ for (const o of ["rows", "columns", "values"]) {
3604
+ const a = n[o];
3605
+ a != null && !Array.isArray(a) && t.push({
3606
+ category: "dataOptions",
3607
+ index: o,
3608
+ input: a,
3609
+ message: `dataOptions.${o} must be an array`
3610
+ });
3611
+ }
3612
+ const i = n.grandTotals;
3613
+ i != null && !zn(i) && t.push({
3614
+ category: "dataOptions",
3615
+ index: "grandTotals",
3616
+ input: i,
3617
+ message: "grandTotals must be an object with optional rows?: boolean, columns?: boolean"
3618
+ });
3619
+ }
3620
+ return e.styleOptions !== void 0 && (r.styleOptions = e.styleOptions), e.filters !== void 0 && Array.isArray(e.filters) && (r.filters = e.filters), e.highlights !== void 0 && Array.isArray(e.highlights) && (r.highlights = e.highlights), { normalized: r, errors: t };
3621
+ }
3622
+ function Ln(e, t, r) {
3623
+ if (!e || typeof e != "object")
3624
+ return r.push({
3625
+ category: "dataOptions",
3626
+ index: -1,
3627
+ input: e,
3628
+ message: "dataOptions is required"
3629
+ }), null;
3630
+ const s = {}, n = r.length;
3631
+ for (const o of ["rows", "columns"]) {
3632
+ const a = ee(
3633
+ o,
3634
+ e[o],
3635
+ "dimension",
3636
+ t,
3637
+ r
3638
+ );
3639
+ a && (s[o] = a);
3640
+ }
3641
+ const i = ee(
3642
+ "values",
3643
+ e.values,
3644
+ "measure",
3645
+ t,
3646
+ r
3647
+ );
3648
+ return i && (s.values = i), e.grandTotals !== void 0 && (s.grandTotals = e.grandTotals), r.length > n ? null : s;
3649
+ }
3650
+ const Hn = (e) => {
3651
+ const { data: t, context: r } = e, { dataSource: s, tables: n } = r, { normalized: i, errors: o } = Pn(t);
3652
+ if (o.length > 0)
3653
+ return { success: !1, errors: o };
3654
+ const a = xe(n), u = [], c = Ln(
3655
+ i.dataOptions,
3656
+ { dataSource: s, schemaIndex: a },
3657
+ u
3658
+ );
3659
+ let m = null;
3660
+ i.filters && i.filters.length > 0 && (m = w(
3661
+ () => Oe({
3662
+ data: i.filters || [],
3663
+ context: { dataSource: s, schemaIndex: a }
3664
+ }),
3665
+ u
3666
+ ));
3667
+ let l = null;
3668
+ return i.highlights && i.highlights.length > 0 && (l = w(
3669
+ () => Me({
3670
+ data: i.highlights || [],
3671
+ context: { dataSource: s, schemaIndex: a }
3672
+ }),
3673
+ u
3674
+ )), u.length > 0 || c === null ? {
3675
+ success: !1,
3676
+ errors: u
3677
+ } : {
3678
+ success: !0,
3679
+ data: g(g(g({
3680
+ dataSet: Fe(s),
3681
+ dataOptions: c
3682
+ }, i.styleOptions && { styleOptions: i.styleOptions }), m && { filters: m }), l && { highlights: l })
3683
+ };
3684
+ }, Xn = (e) => {
3685
+ const t = [];
3686
+ if (!e.dataOptions)
3687
+ return {
3688
+ success: !1,
3689
+ errors: [
3690
+ {
3691
+ category: "dataOptions",
3692
+ index: -1,
3693
+ input: e,
3694
+ message: "dataOptions is required"
3695
+ }
3696
+ ]
3697
+ };
3698
+ const r = e.dataOptions, s = {};
3699
+ for (const c of ["rows", "columns"]) {
3700
+ const m = r[c];
3701
+ if (m && m.length > 0) {
3702
+ const l = Ze(c, m, "dimension");
3703
+ l.success ? s[c] = l.data : t.push(...l.errors);
3704
+ }
3705
+ }
3706
+ const n = r.values;
3707
+ if (n && n.length > 0) {
3708
+ const c = Ze("values", n, "measure");
3709
+ c.success ? s.values = c.data : t.push(...c.errors);
3710
+ }
3711
+ r.grandTotals !== void 0 && (s.grandTotals = r.grandTotals);
3712
+ let i;
3713
+ if (e.filters) {
3714
+ const c = w(
3715
+ () => Ie(e.filters),
3716
+ t
3717
+ );
3718
+ i = c != null ? c : void 0;
3719
+ }
3720
+ let o;
3721
+ if (e.highlights && e.highlights.length > 0) {
3722
+ const c = w(
3723
+ () => ke(e.highlights),
3724
+ t
3725
+ );
3726
+ o = c != null ? c : void 0;
3727
+ }
3728
+ if (t.length > 0)
3729
+ return { success: !1, errors: t };
3730
+ const a = g(g(g({
3731
+ dataOptions: s
3732
+ }, e.styleOptions && { styleOptions: e.styleOptions }), i && i.length > 0 && { filters: i }), o && o.length > 0 && { highlights: o });
3733
+ return {
3734
+ success: !0,
3735
+ data: Q(
3736
+ a
3737
+ )
3738
+ };
3739
+ };
3740
+ function _n(e) {
3741
+ const { filters: t, relations: r } = Br(
2736
3742
  e.filters || []
2737
3743
  );
2738
3744
  return {
2739
3745
  dataSource: e.dataSource,
2740
3746
  dimensions: e.dimensions,
2741
3747
  measures: e.measures,
2742
- filters: r,
2743
- filterRelations: t,
3748
+ filters: t,
3749
+ filterRelations: r,
2744
3750
  highlights: e.highlights
2745
3751
  // No count/offset/ungroup - these are execution concerns, not translation concerns
2746
3752
  };
2747
3753
  }
2748
- function ks(e, r, t = !1) {
2749
- const s = Ts(e), n = Kr(s, r);
2750
- return Qr(n, t);
3754
+ function Zn(e, t, r = !1) {
3755
+ const s = _n(e), n = Ir(s, t);
3756
+ return kr(n, r);
2751
3757
  }
2752
3758
  export {
2753
- zs as CustomSuperJSON,
2754
- _s as EMPTY_EXPANDED_QUERY_MODEL,
2755
- Us as EMPTY_SIMPLE_QUERY_MODEL,
2756
- Ws as isByIdDashboardCodeParams,
2757
- js as isByIdWidgetCodeParams,
2758
- Js as isClientSideDashboardCodeParams,
2759
- Gs as isClientSideWidgetCodeParams,
2760
- Ps as translateQueryFromJSON,
2761
- Bs as translateQueryToJSON,
2762
- ks as translateQueryToJaql
3759
+ Kn as CustomSuperJSON,
3760
+ ri as EMPTY_EXPANDED_QUERY_MODEL,
3761
+ si as EMPTY_SIMPLE_QUERY_MODEL,
3762
+ ni as isByIdDashboardCodeParams,
3763
+ ii as isByIdWidgetCodeParams,
3764
+ oi as isClientSideDashboardCodeParams,
3765
+ ai as isClientSideWidgetCodeParams,
3766
+ Gn as translateChartFromJSON,
3767
+ Qn as translateChartToJSON,
3768
+ Hn as translatePivotTableFromJSON,
3769
+ Xn as translatePivotTableToJSON,
3770
+ Jn as translateQueryFromJSON,
3771
+ Yn as translateQueryToJSON,
3772
+ Zn as translateQueryToJaql
2763
3773
  };