@bino-bi/bn-template-engine 1.0.0-next.28 → 1.0.0-next.30

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 (449) hide show
  1. package/dist/bn-template-engine/bn-template-engine.esm.js +1 -1
  2. package/dist/bn-template-engine/p-132ad556.entry.js +1 -0
  3. package/dist/bn-template-engine/p-17d71782.entry.js +1 -0
  4. package/dist/bn-template-engine/p-40ba7f43.entry.js +1 -0
  5. package/dist/bn-template-engine/p-467871f3.entry.js +1 -0
  6. package/dist/bn-template-engine/p-64803a42.entry.js +1 -0
  7. package/dist/bn-template-engine/p-B8AjeKja.js +1 -0
  8. package/dist/bn-template-engine/p-CCZcKl0Q.js +2 -0
  9. package/dist/bn-template-engine/p-CrT83eO4.js +1 -0
  10. package/dist/bn-template-engine/p-D_DzKxRV.js +1 -0
  11. package/dist/bn-template-engine/p-Z2rUaSh_.js +1 -0
  12. package/dist/bn-template-engine/p-c41c0a1b.entry.js +1 -0
  13. package/dist/bn-template-engine/p-yc69rwuH.js +1 -0
  14. package/dist/cjs/{bn-asset_28.cjs.entry.js → bn-annotation-layer_30.cjs.entry.js} +27566 -26774
  15. package/dist/cjs/bn-grid.cjs.entry.js +11 -63
  16. package/dist/cjs/bn-image.cjs.entry.js +5 -6
  17. package/dist/cjs/bn-internationalization.cjs.entry.js +11 -7
  18. package/dist/cjs/bn-ruleset.cjs.entry.js +7 -8
  19. package/dist/cjs/bn-template-engine.cjs.js +2 -2
  20. package/dist/cjs/bn-text.cjs.entry.js +18 -18
  21. package/dist/cjs/{diagnostics-Cq-qDtXq.js → diagnostics-C4Ggts3w.js} +50 -2
  22. package/dist/cjs/{index-C1Z9vO7z.js → index-DGis1BzT.js} +0 -1
  23. package/dist/cjs/loader.cjs.js +2 -2
  24. package/dist/cjs/{withBodyObserver-CaPUjuC5.js → withBodyObserver-BK4idxqG.js} +2 -2
  25. package/dist/cjs/{context-protocol-C0rKepqu.js → withHasError-CqvcS23z.js} +462 -14
  26. package/dist/cjs/{withStyled-vSfogp9J.js → withStyled-70D4Isgt.js} +22 -35
  27. package/dist/cjs/{sanitizeHtml-Yx1xn6i_.js → withTranslation-C6Pye2CM.js} +148 -129
  28. package/dist/collection/collection-manifest.json +11 -11
  29. package/dist/collection/components/bn-annotation-layer/bn-annotation-layer.css +24 -0
  30. package/dist/collection/components/bn-annotation-layer/bn-annotation-layer.js +430 -0
  31. package/dist/collection/components/bn-annotation-layer/utils/marks.js +161 -0
  32. package/dist/collection/components/bn-annotation-layer/utils/matchPoint.js +25 -0
  33. package/dist/collection/components/bn-annotation-list/bn-annotation-list.css +46 -0
  34. package/dist/collection/components/bn-annotation-list/bn-annotation-list.js +112 -0
  35. package/dist/collection/components/bn-asset/bn-asset.js +1 -1
  36. package/dist/collection/components/bn-body/bn-body.js +24 -1
  37. package/dist/collection/components/bn-card/bn-card.js +24 -1
  38. package/dist/collection/components/bn-chart-bubble/{ibcs-chart-bubble.js → bn-chart-bubble-renderer/bn-chart-bubble-renderer.js} +153 -59
  39. package/dist/collection/components/bn-chart-bubble/bn-chart-bubble.js +70 -13
  40. package/dist/collection/components/bn-chart-bubble/utils/BubbleChart.js +29 -21
  41. package/dist/collection/components/bn-chart-bullet/{ibcs-chart-bullet.js → bn-chart-bullet-renderer/bn-chart-bullet-renderer.js} +127 -53
  42. package/dist/collection/components/bn-chart-bullet/bn-chart-bullet.js +83 -20
  43. package/dist/collection/components/bn-chart-bullet/utils/BulletChart.js +26 -17
  44. package/dist/collection/components/bn-chart-bullet/utils/model/BulletChartStyle.js +4 -4
  45. package/dist/collection/components/bn-chart-scatter/{ibcs-chart-scatter.js → bn-chart-scatter-renderer/bn-chart-scatter-renderer.js} +132 -53
  46. package/dist/collection/components/bn-chart-scatter/bn-chart-scatter.js +69 -12
  47. package/dist/collection/components/bn-chart-scatter/utils/ScatterChart.js +26 -14
  48. package/dist/collection/components/bn-chart-structure/{ibcs-chart-structure.js → bn-chart-structure-renderer/bn-chart-structure-renderer.js} +159 -66
  49. package/dist/collection/components/bn-chart-structure/bn-chart-structure.js +115 -95
  50. package/dist/collection/components/bn-chart-structure/utils/StructureChart.js +44 -15
  51. package/dist/collection/components/bn-chart-structure/utils/elements/Axis.js +1 -1
  52. package/dist/collection/components/bn-chart-structure/utils/elements/Bar.js +6 -2
  53. package/dist/collection/components/bn-chart-structure/utils/elements/Label.js +11 -0
  54. package/dist/collection/components/bn-chart-structure/utils/elements/Marker.js +5 -1
  55. package/dist/collection/components/bn-chart-structure/utils/elements/Needle.js +4 -1
  56. package/dist/collection/components/bn-chart-structure/utils/elements/StackedBar.js +6 -2
  57. package/dist/collection/components/bn-chart-time/{ibcs-chart-time.js → bn-chart-time-renderer/bn-chart-time-renderer.js} +188 -150
  58. package/dist/collection/components/bn-chart-time/bn-chart-time.js +140 -405
  59. package/dist/collection/components/bn-chart-time/utils/TimeChart.js +55 -15
  60. package/dist/collection/components/bn-chart-time/utils/elements/Column.js +5 -1
  61. package/dist/collection/components/bn-chart-time/utils/elements/Label.js +14 -0
  62. package/dist/collection/components/bn-chart-time/utils/elements/LineSeries.js +18 -12
  63. package/dist/collection/components/bn-chart-time/utils/elements/Marker.js +5 -1
  64. package/dist/collection/components/bn-chart-time/utils/elements/Needle.js +4 -1
  65. package/dist/collection/components/bn-chart-time/utils/elements/StackedColumn.js +6 -2
  66. package/dist/collection/components/bn-chart-time/utils/factories/ScenarioFactory.js +2 -2
  67. package/dist/collection/components/bn-chart-time/utils/model/TimeChartComponentConfig.js +2 -18
  68. package/dist/collection/components/bn-component-style/bn-component-style.js +3 -3
  69. package/dist/collection/components/bn-context/bn-context.js +24 -5
  70. package/dist/collection/components/bn-dataset/bn-dataset.js +8 -8
  71. package/dist/collection/components/bn-datasource/bn-datasource.js +8 -8
  72. package/dist/collection/components/bn-footer/bn-footer.css +1 -15
  73. package/dist/collection/components/bn-footer/bn-footer.js +17 -34
  74. package/dist/collection/components/bn-grid/bn-grid.js +38 -71
  75. package/dist/collection/components/bn-image/bn-image.js +21 -2
  76. package/dist/collection/components/bn-internationalization/bn-internationalization.js +7 -1
  77. package/dist/collection/components/bn-layout-card/bn-layout-card.js +3 -32
  78. package/dist/collection/components/bn-layout-page/bn-layout-page.js +3 -32
  79. package/dist/collection/components/bn-message/bn-message.js +20 -2
  80. package/dist/collection/components/bn-page/bn-page.js +22 -3
  81. package/dist/collection/components/bn-ruleset/bn-ruleset.js +3 -3
  82. package/dist/collection/components/bn-scaling-group/bn-scaling-group.js +9 -9
  83. package/dist/collection/components/bn-table/{ibcs-table.js → bn-table-renderer/bn-table-renderer.js} +230 -83
  84. package/dist/collection/components/bn-table/bn-table.js +134 -157
  85. package/dist/collection/components/bn-table/utils/Table.js +3 -3
  86. package/dist/collection/components/bn-table/utils/elements/TableRow.js +1 -1
  87. package/dist/collection/components/bn-table/utils/factories/tableDataSetFactory.js +38 -4
  88. package/dist/collection/components/bn-table/utils/helper/DataQuery.js +3 -1
  89. package/dist/collection/components/bn-table/utils/helper/barColumnGeometry.js +2 -2
  90. package/dist/collection/components/bn-text/bn-text.js +66 -8
  91. package/dist/collection/components/bn-title/{ibcs-title/ibcs-title.js → bn-title-renderer/bn-title-renderer.js} +59 -83
  92. package/dist/collection/components/bn-title/{ibcs-title → bn-title-renderer}/utils/Title.js +2 -2
  93. package/dist/collection/components/bn-title/{ibcs-title → bn-title-renderer}/utils/factories/TitleDataSetFactory.js +1 -1
  94. package/dist/collection/components/bn-title/bn-title.js +58 -14
  95. package/dist/collection/components/bn-tree/bn-tree.js +30 -28
  96. package/dist/collection/index.js +0 -1
  97. package/dist/collection/schemas.js +1 -0
  98. package/dist/collection/stores/componentStyles.js +10 -6
  99. package/dist/collection/stores/createScopedStores.js +3 -1
  100. package/dist/collection/stores/internationalization.js +10 -6
  101. package/dist/collection/utils/annotations.js +66 -0
  102. package/dist/collection/utils/autoFit.js +2 -2
  103. package/dist/collection/utils/emptyState.js +1 -1
  104. package/dist/collection/utils/ibcsRuleSet.js +42 -0
  105. package/dist/collection/utils/layoutState/dataPoint.js +59 -0
  106. package/dist/collection/utils/layoutState/geometry.js +46 -0
  107. package/dist/collection/utils/layoutState/index.js +1 -0
  108. package/dist/collection/utils/layoutState/svgChartElements.js +113 -11
  109. package/dist/collection/utils/layoutTemplate.js +0 -2
  110. package/dist/collection/utils/scaling.js +9 -0
  111. package/dist/collection/utils/validate.js +0 -7
  112. package/dist/collection/utils/withComponentStyle.js +14 -18
  113. package/dist/collection/utils/withDataset.js +22 -11
  114. package/dist/collection/utils/withHasError.js +17 -2
  115. package/dist/collection/utils/withRuleSet.js +7 -7
  116. package/dist/collection/utils/withTranslation.js +14 -14
  117. package/dist/collection/utils/xy/XYFrame.js +13 -3
  118. package/dist/collection/utils/xy/model/ScaleFactorsXYChart.js +8 -9
  119. package/dist/collection/utils/xy/pointKey.js +10 -0
  120. package/dist/components/{ibcs-chart-bullet.d.ts → bn-annotation-layer.d.ts} +4 -4
  121. package/dist/components/bn-annotation-layer.js +1 -0
  122. package/dist/components/{ibcs-chart-scatter.d.ts → bn-annotation-list.d.ts} +4 -4
  123. package/dist/components/bn-annotation-list.js +1 -0
  124. package/dist/components/bn-asset.js +1 -1
  125. package/dist/components/bn-body.js +1 -1
  126. package/dist/components/bn-card.js +1 -1
  127. package/dist/components/bn-chart-bubble-renderer.d.ts +11 -0
  128. package/dist/components/bn-chart-bubble-renderer.js +1 -0
  129. package/dist/components/bn-chart-bubble.js +1 -1
  130. package/dist/components/bn-chart-bullet-renderer.d.ts +11 -0
  131. package/dist/components/bn-chart-bullet-renderer.js +1 -0
  132. package/dist/components/bn-chart-bullet.js +1 -1
  133. package/dist/components/bn-chart-scatter-renderer.d.ts +11 -0
  134. package/dist/components/bn-chart-scatter-renderer.js +1 -0
  135. package/dist/components/bn-chart-scatter.js +1 -1
  136. package/dist/components/bn-chart-structure-renderer.d.ts +11 -0
  137. package/dist/components/bn-chart-structure-renderer.js +1 -0
  138. package/dist/components/bn-chart-structure.js +1 -1
  139. package/dist/components/{bn-template.d.ts → bn-chart-time-renderer.d.ts} +4 -4
  140. package/dist/components/bn-chart-time-renderer.js +1 -0
  141. package/dist/components/bn-chart-time.js +1 -1
  142. package/dist/components/bn-component-style.js +1 -1
  143. package/dist/components/bn-context.js +1 -1
  144. package/dist/components/bn-dataset.js +1 -1
  145. package/dist/components/bn-datasource.js +1 -1
  146. package/dist/components/bn-footer.js +1 -1
  147. package/dist/components/bn-grid.js +1 -1
  148. package/dist/components/bn-image.js +1 -1
  149. package/dist/components/bn-internationalization.js +1 -1
  150. package/dist/components/bn-layout-card.js +1 -1
  151. package/dist/components/bn-layout-page.js +1 -1
  152. package/dist/components/bn-message.js +1 -1
  153. package/dist/components/bn-page.js +1 -1
  154. package/dist/components/bn-ruleset.js +1 -1
  155. package/dist/components/bn-scaling-group.js +1 -1
  156. package/dist/components/{ibcs-chart-bubble.d.ts → bn-table-renderer.d.ts} +4 -4
  157. package/dist/components/bn-table-renderer.js +1 -0
  158. package/dist/components/bn-table.js +1 -1
  159. package/dist/components/bn-text.js +1 -1
  160. package/dist/components/{editor-companion.d.ts → bn-title-renderer.d.ts} +4 -4
  161. package/dist/components/bn-title-renderer.js +1 -0
  162. package/dist/components/bn-title.js +1 -1
  163. package/dist/components/bn-tree.js +1 -1
  164. package/dist/components/index.js +1 -1
  165. package/dist/components/p-B1nL0yOa.js +1 -0
  166. package/dist/components/p-B7uwck1J.js +1 -0
  167. package/dist/components/p-BDS_jiow.js +1 -0
  168. package/dist/components/p-BIIDTtcR.js +1 -0
  169. package/dist/components/p-BQMKgvEC.js +1 -0
  170. package/dist/components/p-BSV_vyqs.js +1 -0
  171. package/dist/components/p-BVKLCz2k.js +1 -0
  172. package/dist/components/p-BWBHlztH.js +1 -0
  173. package/dist/components/p-BXrPfAvP.js +1 -0
  174. package/dist/components/p-Ba9PUiBp.js +1 -0
  175. package/dist/components/p-BpCL2bfw.js +1 -0
  176. package/dist/components/p-BpsXOtoW.js +1 -0
  177. package/dist/components/p-Bs-YxJEt.js +1 -0
  178. package/dist/components/p-CGI6XIaK.js +1 -0
  179. package/dist/components/p-CMM8vtHW.js +1 -0
  180. package/dist/components/p-COqIkH1M.js +1 -0
  181. package/dist/components/p-CYwd_ZNM.js +1 -0
  182. package/dist/components/p-CkW23yp2.js +1 -0
  183. package/dist/components/p-CtBM3KFY.js +1 -0
  184. package/dist/{bn-template-engine/p-DFmSrSnf.js → components/p-CurWSJkH.js} +1 -1
  185. package/dist/components/p-CxPSvrcF.js +1 -0
  186. package/dist/components/p-D2Epww9R.js +1 -0
  187. package/dist/components/p-D5-dYgK_.js +1 -0
  188. package/dist/components/p-D6YGOYV1.js +2 -0
  189. package/dist/components/p-DEHnizot.js +1 -0
  190. package/dist/components/p-DIyUaSBg.js +1 -0
  191. package/dist/components/p-DPLcGhVt.js +1 -0
  192. package/dist/components/p-DUHp_9X-.js +1 -0
  193. package/dist/components/p-DYG9FH_u.js +1 -0
  194. package/dist/components/p-DdGnuNtc.js +1 -0
  195. package/dist/components/p-Dlb4ncGF.js +1 -0
  196. package/dist/components/p-Dm55bMs2.js +1 -0
  197. package/dist/components/p-Dq1AzGKX.js +1 -0
  198. package/dist/components/p-Dq4KMCDU.js +1 -0
  199. package/dist/components/p-DsOaqeTN.js +1 -0
  200. package/dist/components/p-Ds_BSK8v.js +1 -0
  201. package/dist/components/p-LZ9lAY8T.js +1 -0
  202. package/dist/components/p-U3zkcEJZ.js +1 -0
  203. package/dist/components/p-WzaayhTX.js +1 -0
  204. package/dist/components/p-X9hpquOX.js +1 -0
  205. package/dist/components/p-Xb6Ilq8u.js +1 -0
  206. package/dist/components/p-ey23VlID.js +1 -0
  207. package/dist/components/p-jbp6YiHf.js +1 -0
  208. package/dist/components/p-oJjMz8JF.js +1 -0
  209. package/dist/components/p-xhiPDAZa.js +1 -0
  210. package/dist/components/p-xpguaboj.js +1 -0
  211. package/dist/esm/{bn-asset_28.entry.js → bn-annotation-layer_30.entry.js} +24689 -23899
  212. package/dist/esm/bn-grid.entry.js +11 -63
  213. package/dist/esm/bn-image.entry.js +4 -5
  214. package/dist/esm/bn-internationalization.entry.js +9 -5
  215. package/dist/esm/bn-ruleset.entry.js +6 -7
  216. package/dist/esm/bn-template-engine.js +3 -3
  217. package/dist/esm/bn-text.entry.js +12 -12
  218. package/dist/esm/{diagnostics-vw6TKMiT.js → diagnostics-Cyqy1zDT.js} +48 -2
  219. package/dist/esm/{index-C5UYpZUU.js → index-CCZcKl0Q.js} +1 -1
  220. package/dist/esm/loader.js +3 -3
  221. package/dist/esm/{withBodyObserver-DD_-r04o.js → withBodyObserver-JcRB9OPQ.js} +2 -2
  222. package/dist/esm/{context-protocol-CdTp19uA.js → withHasError-l3cMN-oP.js} +458 -14
  223. package/dist/esm/{withStyled-BDEyKd_H.js → withStyled-DGOiR00Q.js} +17 -29
  224. package/dist/esm/{sanitizeHtml-C5bFtARM.js → withTranslation-BpO8BC5B.js} +144 -126
  225. package/dist/schemas/axis.schema.json +52 -0
  226. package/dist/schemas/i18n.schema.json +31 -0
  227. package/dist/schemas/partof.schema.json +33 -0
  228. package/dist/schemas/ruleset.schema.json +59 -0
  229. package/dist/schemas/stack.schema.json +51 -0
  230. package/dist/schemas/theme.schema.json +604 -0
  231. package/dist/schemas/thereof.schema.json +34 -0
  232. package/dist/types/components/bn-annotation-layer/bn-annotation-layer.d.ts +81 -0
  233. package/dist/types/components/bn-annotation-layer/utils/marks.d.ts +69 -0
  234. package/dist/types/components/bn-annotation-layer/utils/matchPoint.d.ts +17 -0
  235. package/dist/types/components/bn-annotation-list/bn-annotation-list.d.ts +35 -0
  236. package/dist/types/components/bn-body/bn-body.d.ts +5 -0
  237. package/dist/types/components/bn-card/bn-card.d.ts +5 -0
  238. package/dist/types/components/bn-chart-bubble/bn-chart-bubble-renderer/bn-chart-bubble-renderer.d.ts +97 -0
  239. package/dist/types/components/bn-chart-bubble/bn-chart-bubble.d.ts +20 -2
  240. package/dist/types/components/bn-chart-bullet/bn-chart-bullet-renderer/bn-chart-bullet-renderer.d.ts +81 -0
  241. package/dist/types/components/bn-chart-bullet/bn-chart-bullet.d.ts +21 -3
  242. package/dist/types/components/bn-chart-bullet/utils/BulletChart.d.ts +2 -0
  243. package/dist/types/components/bn-chart-bullet/utils/model/BulletChartStyle.d.ts +2 -2
  244. package/dist/types/components/bn-chart-scatter/bn-chart-scatter-renderer/bn-chart-scatter-renderer.d.ts +85 -0
  245. package/dist/types/components/bn-chart-scatter/bn-chart-scatter.d.ts +20 -2
  246. package/dist/types/components/bn-chart-structure/{ibcs-chart-structure.d.ts → bn-chart-structure-renderer/bn-chart-structure-renderer.d.ts} +43 -13
  247. package/dist/types/components/bn-chart-structure/bn-chart-structure.d.ts +29 -17
  248. package/dist/types/components/bn-chart-structure/utils/StructureChart.d.ts +7 -0
  249. package/dist/types/components/bn-chart-structure/utils/elements/Label.d.ts +5 -0
  250. package/dist/types/components/bn-chart-structure/utils/elements/Marker.d.ts +1 -0
  251. package/dist/types/components/bn-chart-structure/utils/elements/StackedBar.d.ts +2 -1
  252. package/dist/types/components/bn-chart-structure/utils/model/DataPoint.d.ts +3 -0
  253. package/dist/types/components/bn-chart-time/{ibcs-chart-time.d.ts → bn-chart-time-renderer/bn-chart-time-renderer.d.ts} +50 -17
  254. package/dist/types/components/bn-chart-time/bn-chart-time.d.ts +36 -66
  255. package/dist/types/components/bn-chart-time/utils/TimeChart.d.ts +7 -0
  256. package/dist/types/components/bn-chart-time/utils/elements/Label.d.ts +5 -0
  257. package/dist/types/components/bn-chart-time/utils/elements/LineSeries.d.ts +5 -1
  258. package/dist/types/components/bn-chart-time/utils/elements/Marker.d.ts +1 -0
  259. package/dist/types/components/bn-chart-time/utils/elements/StackedColumn.d.ts +2 -1
  260. package/dist/types/components/bn-chart-time/utils/factories/ScenarioFactory.d.ts +1 -1
  261. package/dist/types/components/bn-chart-time/utils/model/DataPoint.d.ts +3 -0
  262. package/dist/types/components/bn-chart-time/utils/model/TimeChartComponentConfig.d.ts +2 -8
  263. package/dist/types/components/bn-context/bn-context.d.ts +7 -1
  264. package/dist/types/components/bn-dataset/bn-dataset.d.ts +2 -2
  265. package/dist/types/components/bn-datasource/bn-datasource.d.ts +2 -2
  266. package/dist/types/components/bn-footer/bn-footer.d.ts +5 -7
  267. package/dist/types/components/bn-grid/bn-grid.d.ts +8 -6
  268. package/dist/types/components/bn-image/bn-image.d.ts +4 -0
  269. package/dist/types/components/bn-layout-card/bn-layout-card.d.ts +0 -1
  270. package/dist/types/components/bn-layout-page/bn-layout-page.d.ts +0 -1
  271. package/dist/types/components/bn-message/bn-message.d.ts +5 -0
  272. package/dist/types/components/bn-page/bn-page.d.ts +5 -0
  273. package/dist/types/components/bn-table/{ibcs-table.d.ts → bn-table-renderer/bn-table-renderer.d.ts} +49 -12
  274. package/dist/types/components/bn-table/bn-table.d.ts +48 -49
  275. package/dist/types/components/bn-table/utils/elements/Cell.d.ts +2 -0
  276. package/dist/types/components/bn-table/utils/elements/CellBarChart.d.ts +2 -1
  277. package/dist/types/components/bn-table/utils/elements/TableRow.d.ts +3 -0
  278. package/dist/types/components/bn-table/utils/factories/tableDataSetFactory.d.ts +9 -2
  279. package/dist/types/components/bn-text/bn-text.d.ts +19 -1
  280. package/dist/types/components/bn-title/{ibcs-title/ibcs-title.d.ts → bn-title-renderer/bn-title-renderer.d.ts} +15 -4
  281. package/dist/types/components/bn-title/bn-title.d.ts +15 -3
  282. package/dist/types/components/bn-tree/bn-tree.d.ts +6 -2
  283. package/dist/types/components.d.ts +2070 -2406
  284. package/dist/types/context/context-protocol.d.ts +2 -0
  285. package/dist/types/context/scopedDb.d.ts +9 -12
  286. package/dist/types/index.d.ts +0 -1
  287. package/dist/types/schemas.d.ts +50 -0
  288. package/dist/types/stores/componentStyles.d.ts +8 -0
  289. package/dist/types/stores/createScopedStores.d.ts +1 -0
  290. package/dist/types/stores/internationalization.d.ts +3 -2
  291. package/dist/types/stores/ruleSets.d.ts +15 -3
  292. package/dist/types/utils/annotations.d.ts +45 -0
  293. package/dist/types/utils/autoFit.d.ts +2 -2
  294. package/dist/types/utils/emptyState.d.ts +1 -1
  295. package/dist/types/utils/ibcsRuleSet.d.ts +16 -0
  296. package/dist/types/utils/layoutState/dataPoint.d.ts +13 -0
  297. package/dist/types/utils/layoutState/geometry.d.ts +12 -0
  298. package/dist/types/utils/layoutState/index.d.ts +1 -0
  299. package/dist/types/utils/layoutState/svgChartElements.d.ts +9 -6
  300. package/dist/types/utils/layoutState/types.d.ts +29 -0
  301. package/dist/types/utils/model/ChartStyles.d.ts +2 -1
  302. package/dist/types/utils/scaling.d.ts +2 -0
  303. package/dist/types/utils/validate.d.ts +0 -1
  304. package/dist/types/utils/withComponentStyle.d.ts +4 -4
  305. package/dist/types/utils/withDataset.d.ts +3 -3
  306. package/dist/types/utils/withHasError.d.ts +22 -1
  307. package/dist/types/utils/withRuleSet.d.ts +3 -2
  308. package/dist/types/utils/withTranslation.d.ts +1 -2
  309. package/dist/types/utils/xy/model/ScaleFactorsXYChart.d.ts +6 -7
  310. package/dist/types/utils/xy/pointKey.d.ts +9 -0
  311. package/package.json +24 -8
  312. package/readme.md +14 -8
  313. package/dist/bn-template-engine/assets/bar.png +0 -0
  314. package/dist/bn-template-engine/assets/matrix.png +0 -0
  315. package/dist/bn-template-engine/p-5075771a.entry.js +0 -1
  316. package/dist/bn-template-engine/p-5d516435.entry.js +0 -1
  317. package/dist/bn-template-engine/p-5e90e728.entry.js +0 -1
  318. package/dist/bn-template-engine/p-9ef7e132.entry.js +0 -1
  319. package/dist/bn-template-engine/p-9f7a1980.entry.js +0 -1
  320. package/dist/bn-template-engine/p-BeXgxHkW.js +0 -1
  321. package/dist/bn-template-engine/p-C5UYpZUU.js +0 -2
  322. package/dist/bn-template-engine/p-CH0bpt_k.js +0 -1
  323. package/dist/bn-template-engine/p-DI3efDSV.js +0 -1
  324. package/dist/bn-template-engine/p-DXLTTILG.js +0 -1
  325. package/dist/bn-template-engine/p-DtP4jqG5.js +0 -1
  326. package/dist/bn-template-engine/p-a8281b71.entry.js +0 -1
  327. package/dist/bn-template-engine/p-b31277e7.entry.js +0 -1
  328. package/dist/bn-template-engine/p-b396ac84.entry.js +0 -1
  329. package/dist/cjs/bn-template.cjs.entry.js +0 -18
  330. package/dist/cjs/editor-companion.cjs.entry.js +0 -56
  331. package/dist/cjs/withHasError-qGW_yqIv.js +0 -426
  332. package/dist/collection/components/bn-footer/assets/bar.png +0 -0
  333. package/dist/collection/components/bn-footer/assets/matrix.png +0 -0
  334. package/dist/collection/components/bn-message/assets/bar.png +0 -0
  335. package/dist/collection/components/bn-message/assets/matrix.png +0 -0
  336. package/dist/collection/components/bn-template/bn-template.js +0 -38
  337. package/dist/collection/components/editor-companion/editor-companion.css +0 -3
  338. package/dist/collection/components/editor-companion/editor-companion.js +0 -137
  339. package/dist/collection/utils/templateId.js +0 -12
  340. package/dist/collection/utils/testing/fakeGroup.js +0 -21
  341. package/dist/collection/utils/testing/hostFont.js +0 -20
  342. package/dist/collection/utils/testing/mutationObserver.js +0 -44
  343. package/dist/collection/utils/testing/structureChart.js +0 -26
  344. package/dist/collection/utils/testing/timeChart.js +0 -28
  345. package/dist/components/AxisConfig.js +0 -1
  346. package/dist/components/CompareUtil.js +0 -1
  347. package/dist/components/DataFormatDigits.js +0 -1
  348. package/dist/components/DateStringFactory.js +0 -1
  349. package/dist/components/LabelCollisionManager.js +0 -1
  350. package/dist/components/Order.js +0 -1
  351. package/dist/components/SVGStyle.js +0 -1
  352. package/dist/components/SVGVariancesStyleGroup.js +0 -1
  353. package/dist/components/StringAdapter.js +0 -1
  354. package/dist/components/VarianceMeasure.js +0 -1
  355. package/dist/components/XYChartDataRow.js +0 -1
  356. package/dist/components/bn-body2.js +0 -1
  357. package/dist/components/bn-card2.js +0 -1
  358. package/dist/components/bn-footer2.js +0 -1
  359. package/dist/components/bn-message2.js +0 -1
  360. package/dist/components/bn-page2.js +0 -1
  361. package/dist/components/bn-template.js +0 -1
  362. package/dist/components/bn-title2.js +0 -1
  363. package/dist/components/checkXYOverflow.js +0 -1
  364. package/dist/components/contentDecoder.js +0 -1
  365. package/dist/components/context-protocol.js +0 -1
  366. package/dist/components/editor-companion.js +0 -1
  367. package/dist/components/formatter.js +0 -1
  368. package/dist/components/geometry.js +0 -1
  369. package/dist/components/ibcs-chart-bubble.js +0 -1
  370. package/dist/components/ibcs-chart-bubble2.js +0 -1
  371. package/dist/components/ibcs-chart-bullet.js +0 -1
  372. package/dist/components/ibcs-chart-bullet2.js +0 -1
  373. package/dist/components/ibcs-chart-scatter.js +0 -1
  374. package/dist/components/ibcs-chart-scatter2.js +0 -1
  375. package/dist/components/ibcs-chart-structure.d.ts +0 -11
  376. package/dist/components/ibcs-chart-structure.js +0 -1
  377. package/dist/components/ibcs-chart-structure2.js +0 -1
  378. package/dist/components/ibcs-chart-time.d.ts +0 -11
  379. package/dist/components/ibcs-chart-time.js +0 -1
  380. package/dist/components/ibcs-chart-time2.js +0 -1
  381. package/dist/components/ibcs-table.d.ts +0 -11
  382. package/dist/components/ibcs-table.js +0 -1
  383. package/dist/components/ibcs-table2.js +0 -1
  384. package/dist/components/ibcs-title.d.ts +0 -11
  385. package/dist/components/ibcs-title.js +0 -1
  386. package/dist/components/ibcs-title2.js +0 -1
  387. package/dist/components/layoutTemplate.js +0 -1
  388. package/dist/components/luxon.js +0 -1
  389. package/dist/components/scaling.js +0 -1
  390. package/dist/components/svg.esm.js +0 -1
  391. package/dist/components/svgChartElements.js +0 -1
  392. package/dist/components/types.js +0 -1
  393. package/dist/components/validate.js +0 -1
  394. package/dist/components/withBodyObserver.js +0 -1
  395. package/dist/components/withComponentStatus.js +0 -1
  396. package/dist/components/withComponentStyle.js +0 -1
  397. package/dist/components/withDataset.js +0 -1
  398. package/dist/components/withHasError.js +0 -1
  399. package/dist/components/withRuleSet.js +0 -1
  400. package/dist/components/withScalingGroup.js +0 -1
  401. package/dist/components/withStyled.js +0 -1
  402. package/dist/components/withTranslation.js +0 -1
  403. package/dist/esm/bn-template.entry.js +0 -16
  404. package/dist/esm/editor-companion.entry.js +0 -54
  405. package/dist/esm/withHasError-73WV2SP5.js +0 -422
  406. package/dist/types/components/bn-chart-bubble/ibcs-chart-bubble.d.ts +0 -59
  407. package/dist/types/components/bn-chart-bullet/ibcs-chart-bullet.d.ts +0 -53
  408. package/dist/types/components/bn-chart-scatter/ibcs-chart-scatter.d.ts +0 -54
  409. package/dist/types/components/bn-template/bn-template.d.ts +0 -10
  410. package/dist/types/components/editor-companion/editor-companion.d.ts +0 -20
  411. package/dist/types/utils/templateId.d.ts +0 -9
  412. package/dist/types/utils/testing/fakeGroup.d.ts +0 -8
  413. package/dist/types/utils/testing/hostFont.d.ts +0 -16
  414. package/dist/types/utils/testing/mutationObserver.d.ts +0 -5
  415. package/dist/types/utils/testing/structureChart.d.ts +0 -5
  416. package/dist/types/utils/testing/timeChart.d.ts +0 -5
  417. /package/dist/collection/components/bn-chart-bubble/{ibcs-chart-bubble.css → bn-chart-bubble-renderer/bn-chart-bubble-renderer.css} +0 -0
  418. /package/dist/collection/components/bn-chart-bullet/{ibcs-chart-bullet.css → bn-chart-bullet-renderer/bn-chart-bullet-renderer.css} +0 -0
  419. /package/dist/collection/components/bn-chart-scatter/{ibcs-chart-scatter.css → bn-chart-scatter-renderer/bn-chart-scatter-renderer.css} +0 -0
  420. /package/dist/collection/components/bn-chart-time/{ibcs-chart-time.css → bn-chart-time-renderer/bn-chart-time-renderer.css} +0 -0
  421. /package/dist/collection/components/bn-table/{ibcs-table.css → bn-table-renderer/bn-table-renderer.css} +0 -0
  422. /package/dist/collection/components/bn-title/{ibcs-title/ibcs-title.css → bn-title-renderer/bn-title-renderer.css} +0 -0
  423. /package/dist/collection/components/bn-title/{ibcs-title → bn-title-renderer}/utils/factories/index.js +0 -0
  424. /package/dist/collection/components/bn-title/{ibcs-title → bn-title-renderer}/utils/model/MeasureEntriy.js +0 -0
  425. /package/dist/collection/components/bn-title/{ibcs-title → bn-title-renderer}/utils/model/TimePeriod.js +0 -0
  426. /package/dist/collection/components/bn-title/{ibcs-title → bn-title-renderer}/utils/model/TitleConfig.js +0 -0
  427. /package/dist/collection/components/bn-title/{ibcs-title → bn-title-renderer}/utils/model/index.js +0 -0
  428. /package/dist/components/{stackColors.js → p-4q8nRcWC.js} +0 -0
  429. /package/dist/components/{merge.js → p-B2NXsfMz.js} +0 -0
  430. /package/dist/components/{layoutObserver.js → p-B6kka9sT.js} +0 -0
  431. /package/dist/components/{NumericScale.js → p-BJmwHV0a.js} +0 -0
  432. /package/dist/components/{stackLayout.js → p-BTnRaHPb.js} +0 -0
  433. /package/dist/components/{emotion-hash.esm.js → p-BYBpC0EO.js} +0 -0
  434. /package/dist/components/{diagnostics.js → p-CckAR27O.js} +0 -0
  435. /package/dist/components/{SiPrefix.js → p-CeE4_3wQ.js} +0 -0
  436. /package/dist/components/{queryError.js → p-ClruFZD_.js} +0 -0
  437. /package/dist/components/{sanitizeHtml.js → p-CyUmrWfW.js} +0 -0
  438. /package/dist/components/{TableAttribute.js → p-DCPLGEs_.js} +0 -0
  439. /package/dist/components/{parentDimensions.js → p-DD1zlev_.js} +0 -0
  440. /package/dist/components/{pageFormats.js → p-DM7fwmH4.js} +0 -0
  441. /package/dist/components/{emptyState.js → p-DakXa7Dp.js} +0 -0
  442. /package/dist/components/{relativeVariance.js → p-fCjsrD7I.js} +0 -0
  443. /package/dist/types/components/bn-title/{ibcs-title → bn-title-renderer}/utils/Title.d.ts +0 -0
  444. /package/dist/types/components/bn-title/{ibcs-title → bn-title-renderer}/utils/factories/TitleDataSetFactory.d.ts +0 -0
  445. /package/dist/types/components/bn-title/{ibcs-title → bn-title-renderer}/utils/factories/index.d.ts +0 -0
  446. /package/dist/types/components/bn-title/{ibcs-title → bn-title-renderer}/utils/model/MeasureEntriy.d.ts +0 -0
  447. /package/dist/types/components/bn-title/{ibcs-title → bn-title-renderer}/utils/model/TimePeriod.d.ts +0 -0
  448. /package/dist/types/components/bn-title/{ibcs-title → bn-title-renderer}/utils/model/TitleConfig.d.ts +0 -0
  449. /package/dist/types/components/bn-title/{ibcs-title → bn-title-renderer}/utils/model/index.d.ts +0 -0
@@ -0,0 +1 @@
1
+ import{h as t,p as e,H as o,a as i,t as n}from"./p-D6YGOYV1.js";import{m as s,a as r,b as a}from"./p-B1nL0yOa.js";import{p as l,n as h,r as c,d as u}from"./p-COqIkH1M.js";import{F as d,Q as f,V as p,s as $,I as m,a as v}from"./p-xpguaboj.js";import{S as g,I as b,D as w,C as R,d as S,M as y}from"./p-BQMKgvEC.js";import{N as E,r as O}from"./p-fCjsrD7I.js";import{D as M,w as U}from"./p-DEHnizot.js";import{D as G,b as T}from"./p-xhiPDAZa.js";import{F as N}from"./p-DCPLGEs_.js";import{d as _,g as C}from"./p-BVKLCz2k.js";import{D as L,a as x,b as k}from"./p-Dlb4ncGF.js";import{A as P}from"./p-CMM8vtHW.js";import{S as A}from"./p-oJjMz8JF.js";import{c as D}from"./p-CxPSvrcF.js";import{S as W}from"./p-CeE4_3wQ.js";import{w as B}from"./p-jbp6YiHf.js";var F,Y,H,j,I;!function(t){t[t.ALL=-1]="ALL"}(F||(F={})),function(t){t[t.UP_TO_DATE=0]="UP_TO_DATE",t[t.DIRTY=1]="DIRTY"}(Y||(Y={})),function(t){t.LIST="list",t.SUM="sum",t.SUMNOTOTAL="sumnototal",t.OPT="opt",t.OPTNOTOTAL="optnototal"}(H||(H={})),function(t){t.ASC="asc",t.DESC="desc"}(j||(j={})),function(t){t.HEADER="HEADER",t.GROUPHEAD="GROUPHEAD",t.SEPERATORLINE="SEPERATORLINE",t.SUM="SUM",t.GROUPSUM="GROUP_SUM",t.DRILLELEMENT="DRILLELEMENT",t.STANDARD="STANDARD",t.PARTELEMENT="PARTELEMENT",t.ENTRY="ENTRY"}(I||(I={}));const z="none",V="setname";function Q(t){return t===V?"COALESCE([setname],[setName])":`normalizeDate([date], '${t}')`}function X(t){if(null==t)return"";if("string"==typeof t)return t.trim();const e=q(t);return e?e.toISO():String(t)}function q(t){if(null!=t){if("string"==typeof t){const e=M.fromISO(t,{zone:"utc"});return e.isValid?e:void 0}if("number"==typeof t){const e=M.fromMillis(t,{zone:"utc"});return e.isValid?e:void 0}if("boolean"==typeof t.isValid)return t.isValid?t:void 0}}const K=/[\s\u200e\u200f\u061c]*[%\u066a][\s\u200e\u200f\u061c]*/;class Z{constructor(t,e,o,i,n,s,r,a,l){this.prefixStyle="prefix",this.isBarChart=!1,this.key=t,this.index=e,this.value=o,this.prefix=s||"",this.cssStyle=i||"",this.prefixStyle=r||"prefix",this.type=n,this.mark=void 0,this.colSpan=a||1,this.measureScale=l||1}getAsHeaderList(){if(null==this.value)return[""];const t=[];for(const e of this.value.toString().split("<br/>"))t.push(e);return t}draw(t,e){let o=this.value;if("undefined"===o||void 0===o||null==o)return"";if(Number.isNaN(Number(o)))return o;if(""===this.type||void 0===this.type||null==this.type)return o;let i=t.percent,n=t.percent;return"percentpoint"===this.type?d.number(Number(o),"percent",i,n,1,e).replace(K,""):("decimal"===this.type&&(o=+o/this.measureScale,i=t.decimal,n=t.decimal),d.number(Number(o),this.type,i,n,1,e))}drawPrefix(){return null==this.prefix?"":this.prefix}}class J{constructor(t,e,o){this.index=t,this.groupindex=e,this.type=o,this.cssStyle=this.initCssStyle(),this.elements=[]}initCssStyle(){switch(this.type){case I.HEADER:return"groupheader";case I.SEPERATORLINE:return"";case I.DRILLELEMENT:return"ofit";case I.PARTELEMENT:return"partof";case I.STANDARD:return"";case I.SUM:return"sum";default:return""}}getCells(){return this.elements}createElement(t,e,o,i,n,s,r,a,l,h=!1,c,u=1,d){let f=s;"category"===e&&null!=a&&(f=`category-${a.toString()}`),this.type===I.HEADER?f="headerlabel":this.type===I.SEPERATORLINE&&(f=null!=s?s:e),this.type===I.PARTELEMENT&&("percent"===i&&(t="-"),"category"!==e&&"operation"!==e&&(i="percent",f="")),("-"===t||t===E&&"percent"===i)&&(f="");let p="prefix-first";r&&(p="prefix-second"),o&&(f=`${f} ${o}`);const $=new Z(e,this.elements.length,t,f,i,n,p,u,l);$.isBarChart=h,$.columnStats=c,$.waterfall=d,this.elements.push($)}}const tt=.85;function et(t,e){return Math.max(0,(t-.5)*e)}function ot(t,e){return Math.max(1,(t?1:0)+(e?1:0))}function it(t,e,o,i){const n=et(t,e),s=ot(o,i),r=Math.min(2.85*e,n/(2*s)),a=(n-r*s)/s,l=Math.min(.3*e,.2*a),h=.15*a;return{totalWidth:n,labelAreaWidth:r,maxBarWidth:a,axisX:o?r+a:0,breakGap:l,overdriveZoneWidth:h,cutWidth:Math.max(0,a-l-h),labelGap:.3*e}}function nt(t,e,o,i){const n=et(t,e),s=ot(o,i),r=Math.min(3.375*e,n/2),a=n-r,l=a/s,h=Math.min(.375*e,.2*l);return{totalWidth:n,labelAreaWidth:r,maxPinLength:Math.max(0,l-h),pinPadding:h,axisX:o?l:0,labelX:a+.3*e}}const st={positive:{stroke:"#008f96",fill:"#008f96",fillpattern:"solid"},negative:{stroke:"#ff0000",fill:"#ff0000",fillpattern:"solid"},neutral:{stroke:"#808080",fill:"#808080",fillpattern:"outlined"},scenarios:{ac:{stroke:"#404040",fill:"#404040",fillpattern:"solid"},pp:{stroke:"#A6A6A6",fill:"#A6A6A6",fillpattern:"solid"},fc:{stroke:"#404040",fill:"#ffffff",fillpattern:"hatched"},pl:{stroke:"#404040",fill:"#ffffff",fillpattern:"outlined"}},fontColor:"#000000",fontSize:11.333305,emPx:13.3333,fontFamily:"'Noto Sans', sans-serif",unitScaling:.01,percentageScaling:.5,scaleFactor:1},rt="#666666";function at(t,e){return`pattern-${t}-${e.replace("#","")}`}const lt=({styles:e})=>{const o=e.scaleFactor,i=6*o,n=[{id:at("pos",e.positive.stroke),stroke:e.positive.stroke,fill:e.positive.fill},{id:at("neg",e.negative.stroke),stroke:e.negative.stroke,fill:e.negative.fill},{id:at("neu",e.neutral.stroke),stroke:e.neutral.stroke,fill:e.neutral.fill},...["ac","pp","fc","pl"].map((t=>({id:at(t,e.scenarios[t].stroke),stroke:e.scenarios[t].stroke,fill:e.scenarios[t].fill})))];return t("defs",null,n.map((e=>t("pattern",{id:e.id,patternUnits:"userSpaceOnUse",width:i,height:i},t("rect",{width:i,height:i,fill:"#ffffff"}),t("line",{x1:"0",y1:i,x2:i,y2:"0",stroke:e.stroke,"stroke-width":1.5*o})))))};function ht(t,e,o=1,i,n=0){const s=t>=0?"+":"";if(e){const e=e=>s+d.number(t,"percent",e,e,1,i);let o=Math.min(20,Math.max(0,Math.trunc(n)||0));for(;o>0&&e(o).length>7;)o--;return e(o)}const r=t/o,a=Math.abs(r);let l=1,h="";return a>=9995e5?(l=1e9,h="B"):a>=999500?(l=1e6,h="M"):a>=999.5&&(l=1e3,h="K"),s+d.number(r/l,"decimal",a>=10*l?0:1,0,1,i)+h}function ct(t){const e=t.slice(0,2).toLowerCase();return["ac","pp","fc","pl"].includes(e)}function ut(t){const e=t.slice(0,2).toLowerCase();return"pp"===e?"pp":"fc"===e?"fc":"pl"===e?"pl":"ac"}function dt(t,e,o,i){return ct(t)?function(t,e){const o=ut(t);return e.scenarios[o]}(t,i):function(t,e,o){const i=t>=0;return e?i?o.positive:o.negative:i?o.negative:o.positive}(e,o,i)}function ft(t,e){const o=t.fillpattern;return"hatched"===o?`url(#${at(e,t.stroke)})`:"outlined"===o?"transparent":t.fill}function pt(t){return"outlined"===t.fillpattern?{stroke:t.stroke,strokeWidth:1.5}:{stroke:"none",strokeWidth:0}}const $t=e=>{const{value:o,scenario:i,columnStats:n,height:s,isPositiveGood:r,formattedValue:a,measureScale:l,locale:h,columnWidthEm:c=10,styles:u=st}=e,d=u.scaleFactor,f=u.fontSize,p=n.min<0,$=n.max>0,{totalWidth:m,axisX:v,breakGap:g,overdriveZoneWidth:b,cutWidth:w,labelGap:R}=it(c,u.emPx,p,$),S=Math.abs(o)*u.unitScaling*f,y=S-w>1e-6,E=Math.max(0,n.absMax*u.unitScaling*f-w),O=Math.max(0,S-w),M=E>0?O/E*b:0,U=2*d,G=s-2*U,T=U,N=o>=0,_=dt(i,o,r,u),C=ft(_,ct(i)?ut(i):r?N?"pos":"neg":N?"neg":"pos"),{stroke:L,strokeWidth:x}=pt(_),k=a||ht(o,!1,l,h),P=y?w:S,A=y?w+g+M:S,D=N?v+A+R:v-A-R,W=N?"start":"end";return t("svg",{width:m,height:s,class:"cell-bar-chart absolute-variance",style:{overflow:"visible"}},t(lt,{styles:u}),t("line",{x1:v,y1:0,x2:v,y2:s,stroke:rt,"stroke-width":1*d}),P>0&&t("rect",{x:N?v:v-P,y:T,width:P,height:G,fill:C,stroke:L,"stroke-width":x*d}),y&&M>0&&t("rect",{x:N?v+w+g:v-w-g-M,y:T,width:M,height:G,fill:C,stroke:L,"stroke-width":x*d}),y&&function(e,o,i,n,s){const r=e+o/2,a=.35*o,l=n/3,h=.3*o;let c=`M ${r-a} ${i}`;for(let t=0;t<3;t++)c+=` L ${r-a-h} ${i+l*(t+.5)} L ${r-a} ${i+l*(t+1)}`;let u=`M ${r+a} ${i}`;for(let t=0;t<3;t++)u+=` L ${r+a+h} ${i+l*(t+.5)} L ${r+a} ${i+l*(t+1)}`;return[t("rect",{x:e,y:i-1,width:o,height:n+2,fill:"#ffffff"}),t("path",{d:c,fill:"none",stroke:"#000000","stroke-width":1*s}),t("path",{d:u,fill:"none",stroke:"#000000","stroke-width":1*s})]}(N?v+w:v-w-g,g,T,G,d),t("text",{x:D,y:s/2,dy:"0.35em","text-anchor":W,fill:u.fontColor,"font-size":f,"font-family":u.fontFamily},k))},mt=e=>{const{value:o,scenario:i,columnStats:n,height:s,isPositiveGood:r,formattedValue:a,measureScale:l,locale:h,percentDigits:c,columnWidthEm:u=10,styles:d=st}=e,f=d.scaleFactor,p=d.fontSize,$=n.min<0,m=n.max>0,{totalWidth:v,maxPinLength:g,axisX:b,labelX:w}=nt(u,d.emPx,$,m),R=s/2,S=100*Math.abs(o)*d.percentageScaling*p,y=S>g,E=Math.min(S,g),O=o>=0,M=O?b+E:b-E,U=dt(i,o,r,d),G=3*f,T=a||ht(o,!0,l,h,c);return t("svg",{width:v,height:s,class:"cell-bar-chart relative-variance",style:{overflow:"visible"}},t("line",{x1:b,y1:0,x2:b,y2:s,stroke:rt,"stroke-width":1*f}),!y&&t("circle",{cx:M,cy:R,r:G,fill:d.fontColor}),t("line",{x1:b,y1:R,x2:M,y2:R,stroke:U.fill,"stroke-width":2*f}),y&&O&&t("polygon",{points:`${b+g},${R} ${b+g-6*f},${R-3*f} ${b+g-6*f},${R+3*f}`,fill:U.fill}),y&&!O&&t("polygon",{points:`${b-g},${R} ${b-g+6*f},${R-3*f} ${b-g+6*f},${R+3*f}`,fill:U.fill}),t("text",{x:w,y:s/2,dy:"0.35em","text-anchor":"start",fill:d.fontColor,"font-size":p,"font-style":"italic","font-family":d.fontFamily},T))},vt=e=>{const{value:o,columnStats:i,isRelative:n,styles:s=st}=e;return null==o||isNaN(o)||!i||0===i.absMax?t("span",{class:"bar-chart-empty",style:{color:s.fontColor,fontStyle:"italic"}},"-"):t(n?mt:$t,Object.assign({},e))},gt=e=>{const{value:o,scenario:i,height:n,measureScale:s,locale:r,columnWidthEm:a=10,styles:l=st,waterfall:h}=e,c=l.scaleFactor,u=l.fontSize,d=h.max-h.min;if(null==o||isNaN(o)||d<=0)return t("span",{class:"bar-chart-empty",style:{color:l.fontColor,fontStyle:"italic"}},"-");const{totalWidth:f,labelAreaWidth:p,barAreaWidth:$,labelGap:m}=function(t,e){const o=et(t,e),i=Math.min(2.85*e,o/4);return{totalWidth:o,labelAreaWidth:i,barAreaWidth:o-2*i,labelGap:.3*e}}(a,l.emPx),v=$/d,g=t=>p+(t-h.min)*v,b=2*c,w=n-2*b,R=b,S=g(0),y=g(h.start),E=g(h.end),O=Math.min(y,E),M=Math.abs(E-y),U=dt(i,o,!1,l),G=ft(U,ut(i)),{stroke:T,strokeWidth:N}=pt(U),_=ht(o,"partof"===h.kind,s,r).replace(/^\+/,""),C=E<y,L=C?O-m:O+M+m,x=C?"end":"start";return t("svg",{width:f,height:n,class:"cell-bar-chart waterfall-bar",style:{overflow:"visible"}},t(lt,{styles:l}),t("line",{x1:S,y1:0,x2:S,y2:n,stroke:rt,"stroke-width":1*c}),void 0!==h.parentStart&&void 0!==h.parentEnd&&t("line",{x1:g(h.parentStart),y1:0,x2:g(h.parentStart),y2:n,stroke:rt,"stroke-width":1*c,"stroke-dasharray":`${2*c},${2*c}`}),void 0!==h.parentStart&&void 0!==h.parentEnd&&t("line",{x1:g(h.parentEnd),y1:0,x2:g(h.parentEnd),y2:n,stroke:rt,"stroke-width":1*c,"stroke-dasharray":`${2*c},${2*c}`}),M>0&&t("rect",{x:O,y:R,width:M,height:w,fill:G,stroke:T,"stroke-width":N*c}),t("text",{x:L,y:n/2,dy:"0.35em","text-anchor":x,fill:l.fontColor,"font-size":u,"font-family":l.fontFamily},_))},bt=`IFNULL(${f.ROWGROUP}, '')`;class wt{constructor(t){this.groups=[f.CATEGORY,f.CATEGORYINDEX],H.OPT!==t.type&&H.OPTNOTOTAL!==t.type||this.groups.unshift(f.OPERATION),t.grouped&&(this.groups.push(f.ROWGROUP),this.groups.push(f.ROWGROUPINDEX))}toString(){return this.groups.map((t=>t===f.ROWGROUP?bt:t)).toString()}select(){return this.groups.map((t=>t===f.ROWGROUP?`${bt} as ${t}`:t)).toString()}noCategory(){return this.groups.filter((t=>t!==f.CATEGORY))}toArray(){return this.groups}}class Rt{constructor(t,e){this.hasPartOf=!1,this.params=[],this.hasBlankRowGroup=!1,this.config=t,this.i18n=e}execute(t,e){var o;this.db=t,this.fromExpr=e;for(const t of[...this.config.scenarios,...this.config.categoryThereOf.keys()])if(!N.test(t))throw new Error(`invalid identifier "${t}"`);const i=[],n=[],s=[],r=this.config.scenarios.map((t=>this.translateScenarioSQL(t,!1,this.config.type))).toString(),a=this.config.scenarios.map((t=>this.translateScenarioSQL(t,!0,this.config.type))).toString(),l=this.getRelativeScenarios(),h=this.config.attributes.map((t=>this.translateAttributeSQL(t))).toString(),c=new wt(this.config);let u=["",""];this.config.sortOrder.hierarchy.length>0&&(u=this.createOrderString(this.config.sortOrder)),this.hasPartOf=this.checkConfigForPartOf();const{hierarchy:d,direction:p}=this.config.sortOrder,$=d.filter((t=>t===f.ROWGROUP||t===f.ROWGROUPINDEX||t.toUpperCase()in g)),m=$.filter((t=>t.toUpperCase()in g)).map((t=>`, SUM(${t} * transformOperator(operation)) as ${t}`)).join(""),v=$.length>0?$.map((t=>`${t} ${p}`)).toString():`${f.ROWGROUPINDEX} asc`,b=t.exec(`SELECT COUNT(DISTINCT ${f.CATEGORY}) as ${f.TOTALROWCOUNT} ${this.config.grouped?`, ${bt} as ${f.ROWGROUP}, FIRST(${f.ROWGROUPINDEX}) as ${f.ROWGROUPINDEX}${m}`:""}\n FROM ${e} ${this.config.grouped?`GROUP BY ${bt} ORDER BY ${v}`:""}`);return 0===b.length||1===b.length&&0===(null!==(o=b[0][f.TOTALROWCOUNT])&&void 0!==o?o:0)&&!this.config.grouped?[]:(this.hasBlankRowGroup=this.config.grouped&&b.some((t=>""===t.rowGroup)),b.forEach((t=>{const e=this.config.grouped?""===t.rowGroup?`WHERE (${f.ROWGROUP} IS NULL OR ${f.ROWGROUP} = '')`:`WHERE ${f.ROWGROUP} = ${this.bind(t.rowGroup)}`:"";let o="";this.config.limit&&(o=`LIMIT ${this.config.limit}`),this.createGroupHeaderRow(t,i),this.createDataRow(i,t,c,r,h,e,u,o),this.createRestRow(t,i,c,r,e,u),this.createGroupSumRow(i,n,t,a,e,u)})),this.createTotalSumRow(i,n,a),i.forEach((t=>s.push(this.exec(t)))),this.detectNaNCells(this.config.scenarios,s),this.createThereOfDrillRows(r,h,u,s),this.createPartOfDrillRows(r,u,n,s),this.createIntervalColumns(s),this.createThereOfDrillColumns(this.config.categoryThereOf,s),this.calculateColumnGroupRest(s,this.config.categoryThereOf),this.calculateRelativeVariances(s,l),s)}detectNaNCells(t,e){e.forEach((e=>{e.map((e=>(t.forEach((t=>{const o=new p(t);!0===o.isValid?0!==e[o.base+"_cnt"]&&0!==e[o.delta+"_cnt"]||(e[t]=Number.NaN):0===e[t+"_cnt"]&&(e[t]=Number.NaN)})),e)))}))}createPartOfDrillRows(t,e,o,i){if(null==this.config.partOf||0===this.config.partOf.length||this.config.type===H.LIST)return;const n=this.createPartOfQuery(t,e);let s=[];const r=this.db,a=this.params;n.forEach((t=>{s.push(...this.exec(t))}));const l=this.exctractScenarioNames(t),h=[];o.forEach((function(t){h.push(...r.exec(t,a))}));const c=new Map;h.forEach((t=>c.set(t[f.ROWGROUP],t))),s=this.reduceResDrillByCategoryGroups(s,l),s.forEach((function(t){l.forEach((e=>{try{t[e]=t[e]/c.get(t[f.ROWGROUP])[e]}catch(o){console.error("DataQuery: partOf drill row calculation failed",e,o),t[e]=Number.NaN}}))})),this.injectDrillRowsToResultRows(s,i)}createRestRow(t,e,o,i,n,s){var r;if(t.totalRowCnt-this.config.limit>0&&0!==this.config.limit){const a=this.exctractScenarioNames(i).map((t=>`SUM(${t}) as ${t}`)).join(", ");e.push(`SELECT ${f.ROWNR}, 1 as ${f.ROWGROUPINDEX} , 'ENTRY' as ${f.TYPE}, 'NO_GROUP' as ${f.ROWGROUP}, ${this.bind(String(null!==(r=t.rowGroup)&&void 0!==r?r:""))} as restRowGroup, 'REST' as ${f.CATEGORY} ${a.length>0?", "+a:""} FROM (SELECT ROWNUM() AS ${f.ROWNR}, ${e.length} as ${f.ROWGROUPINDEX} , 'ENTRY' as ${f.TYPE}, ${this.bind(String(t.rowGroup||"NO_GROUP"))} as ${f.ROWGROUP}, ${o.select()} ${i.length>0?",".concat(i):""} FROM ${this.fromExpr} ${n} GROUP BY ${o} ORDER BY ${s[0]}) t WHERE t.rowNr > ${this.config.limit}`)}}createDataRow(t,e,o,i,n,s,r,a){t.push(`SELECT ROWNUM() AS ${f.ROWNR},\n ${t.length} as ${f.ROWGROUPINDEX},\n 'ENTRY' as ${f.TYPE},\n ${this.bind(String(e.rowGroup||"NO_GROUP"))} as ${f.ROWGROUP},\n '${f.CATEGORYINDEX}',\n ${o.select()} ${i.length>0?",".concat(i):""} ${n.length>0?",".concat(n):""}\n FROM ${this.fromExpr} ${s}\n GROUP BY ${o}\n ORDER BY ${r[0]} ${a}`)}createGroupHeaderRow(t,e){if(!0===this.config.grouped){const o=this.bind(String(t.rowGroup)),i=""===t.rowGroup?this.bind("-"):o;e.push(`SELECT ROWNUM() AS ${f.ROWNR},\n ${e.length} as ${f.ROWGROUPINDEX},\n 'GROUPHEAD' as ${f.TYPE},\n ${o} as ${f.ROWGROUP} ${this.config.showGroupTitle?`,${i} as ${f.CATEGORY}`:""}\n FROM ${this.fromExpr}\n GROUP BY '1'`)}}createGroupSumRow(t,e,o,i,n,s){if(!0===this.config.grouped&&(H.SUM===this.config.type||H.SUMNOTOTAL===this.config.type||H.OPT===this.config.type||H.OPTNOTOTAL===this.config.type)){const r=this.bind(String(o.rowGroup));t.push(`SELECT ${t.length} as ${f.ROWGROUPINDEX},\n '=' as ${f.OPERATION},\n ${r} as ${f.ROWGROUP},\n ROWNUM() AS ${f.ROWNR},\n 'GROUP_SUM' as ${f.TYPE} ${i.length>0?",".concat(i):""}\n FROM ${this.fromExpr} ${n}\n ORDER BY ${s[0]} `),e.push(`SELECT ${t.length} as ${f.ROWGROUPINDEX},\n '=' as ${f.OPERATION},\n ${r} as ${f.ROWGROUP},\n ROWNUM() AS ${f.ROWNR},\n 'GROUP_SUM' as ${f.TYPE} ${i.length>0?",".concat(i):""}\n FROM ${this.fromExpr} ${n}\n ORDER BY ${s[0]} `)}}createTotalSumRow(t,e,o){var i;if(H.SUM===this.config.type||H.OPT===this.config.type){const e=(null===(i=this.config.title)||void 0===i?void 0:i.trim())||"SUM_TOTAL",n=this.hasPartOf&&!1===this.config.grouped&&"SUM_TOTAL"!==e?`${this.i18n.get("SUM_TOTAL")||"SUM_TOTAL"} ${e}`:e;t.push(`SELECT ${t.length} as ${f.ROWGROUPINDEX},\n ${this.bind(n)} as ${f.ROWGROUP},\n '=' as ${f.OPERATION},\n 'SUM' as ${f.TYPE} ${o.length>0?",".concat(o):""}\n FROM ${this.fromExpr} `)}e.push(`SELECT ${t.length} as ${f.ROWGROUPINDEX},\n 'SUM_TOTAL' as ${f.ROWGROUP},\n '=' as ${f.OPERATION},\n 'SUM' as ${f.TYPE} ${o.length>0?",".concat(o):""}\n FROM ${this.fromExpr} `)}reduceResDrillByCategoryGroups(t,e){const o=new Map;return t.forEach((function(t){const i=t.rowNr+t.rowGroup+t.type+t.category;if(o.has(i)){const n=o.get(i);e.forEach((e=>{try{n[e]+=t[e]}catch(t){console.error("DataQuery: drill row aggregation failed",e,t)}}))}else o.set(i,t)})),[...o.values()]}injectDrillRowsToResultRows(t,e){const o=new Map;if(!0===this.config.grouped)t.forEach((function(t){e.forEach((function(e){const i=e.findIndex((e=>e.category===t.category&&e.rowGroup===t.rowGroup));if(i>=0){if(o.has(`${t.category}_${t.rowGroup}`)){const e=o.get(`${t.category}_${t.rowGroup}`)||0;o.set(`${t.category}_${t.rowGroup}`,e+1)}else o.set(`${t.category}_${t.rowGroup}`,1);t[f.ROWNR]=o.get(`${t.category}_${t.rowGroup}`),e.splice(i+t[f.ROWNR],0,t)}}))}));else{const i=this.findDuplicateSubCategories(t);t.forEach((function(t){e.forEach((function(e){const n=e.findIndex((e=>null!=e.category&&e.category===t.category));if(n>=0){if(o.has(`${t.category}`)){const e=o.get(`${t.category}`)||0;o.set(`${t.category}`,e+1)}else o.set(`${t.category}`,1);null!=t.rowGroup&&""!==t.rowGroup&&i.includes(`${t.category}##${t.subCategory}`)&&(t.rawSubCategory=t.subCategory,t.subCategory=`${t.subCategory} (${t.rowGroup})`),e.splice(n+t[f.ROWNR],0,t)}}))}))}}createThereOfDrillRows(t,e,o,i){if(void 0===this.config.thereOf||0===this.config.thereOf.length)return;const n=[],s=[];this.config.thereOf.forEach((i=>{let s=!0,r="1 <> 1 OR ( ";null!=i.category&&0!==i.category.length&&i.category.trim()&&(r+=` ${f.CATEGORY} = ${this.bind(i.category)}`,s=!1),null!=i.rowGroup&&0!==i.rowGroup.length&&i.rowGroup.trim()&&(r+=` ${s?"":"AND"} ${f.ROWGROUP} = ${this.bind(i.rowGroup)}`,s=!1),null!=i.subCategory&&0!==i.subCategory.length&&i.subCategory.trim()&&(r+=` ${s?"":"AND"} ${f.SUBCATEGORY} = ${this.bind(i.subCategory)}`),r+=")",n.push(`SELECT ROWNUM() AS ${f.ROWNR},\n null as operation,\n 'DRILLELEMENT' as ${f.TYPE},\n ${f.CATEGORY},\n ${f.SUBCATEGORY},\n ${this.drillRowGroup} as ${f.ROWGROUP},\n ${t} ${e.length>0?",".concat(e):""}\n FROM ${this.fromExpr}\n WHERE ${r}\n GROUP BY ${this.drillRowGroup}, ${f.CATEGORY}, ${f.SUBCATEGORY}\n ORDER BY ${o[1]}`)})),n.forEach((t=>{s.push(...this.exec(t))})),this.injectDrillRowsToResultRows(s,i)}calculateRelativeVariances(t,e){t.forEach((t=>{t.forEach((t=>{"GROUPHEAD"!==t[f.TYPE]&&e.forEach(((e,o)=>{var i;t[o]=null!==(i=O(t[o],t[e]))&&void 0!==i?i:E}))}))}))}calculateColumnGroupRest(t,e){if(null==e||0===e.size)return;const o=new Map,i=new Map;e.forEach(((t,e)=>{const n=t,s=[];for(const t of n)s.push(`${e}##${t.name}`);o.set(e,s),i.set(`${e}##REST`,!1)})),t.forEach((t=>{t.forEach((t=>{"GROUPHEAD"!==t[f.TYPE]&&o.forEach(((e,o)=>{let n=0;e.forEach((e=>{void 0!==t[e]&&(n+=t[e])})),t[`${o}##REST`]=t[o]-n,0!==t[`${o}##REST`]&&i.set(`${o}##REST`,!0)}))}))}));const n=Array.from(i.entries()).filter((([t,e])=>!e)).map((([t])=>t));t.forEach((t=>{t.forEach((t=>{for(const e of n)delete t[e]}))}))}createIntervalColumns(t){var e,o,i,n,s;if(this.config.interval===z||this.config.categoryThereOf.size>0||0===this.config.scenarios.length)return;const r="##",a=`(SELECT *, ${Q(this.config.interval)} as __interval FROM ${this.fromExpr}) as p`,l=this.config.scenarios.map((t=>this.translateScenarioSQL(t,!1,this.config.type))).toString(),h=this.config.scenarios.map((t=>this.translateScenarioSQL(t,!0,this.config.type))).toString(),c=[...new Set(this.exctractScenarioNames(l))],u=this.getRelativeScenarios(),d=new wt(this.config),$=H.OPT===this.config.type||H.OPTNOTOTAL===this.config.type,m=this.config.grouped&&(H.SUM===this.config.type||H.SUMNOTOTAL===this.config.type||H.OPT===this.config.type||H.OPTNOTOTAL===this.config.type),v=this.checkConfigForPartOf()&&this.config.type!==H.LIST,g=t=>this.exec(t),b=t=>(this.config.scenarios.forEach((e=>{const o=new p(e);!0===o.isValid?0!==t[o.base+"_cnt"]&&0!==t[o.delta+"_cnt"]||(t[e]=Number.NaN):0===t[e+"_cnt"]&&(t[e]=Number.NaN)})),u.forEach(((e,o)=>{var i;t[o]=null!==(i=O(t[o],t[e]))&&void 0!==i?i:E})),t),w=(t,e,o)=>{for(const i of this.config.scenarios)t[i+r+o]=e[i]},R=g(`SELECT ${d.select()}, __interval ${l.length>0?",".concat(l):""}\n FROM ${a}\n GROUP BY ${d}, __interval`);if(this.config.limit>0)for(let i=0;i<t.length;i++){const n=t[i].find((t=>"ENTRY"===t.type&&"REST"===t.category));if(!n)continue;let s;for(let e=i-1;e>=0&&!s;e--){const o=t[e].filter((t=>"ENTRY"===t.type&&"REST"!==t.category));o.length>0&&(s=o)}if(!s)continue;const r=new Set(s.map((t=>t.category))),a=s[0].rowGroup,l=new Map;for(const t of R){if(this.config.grouped&&t.rowGroup!==a)continue;if(r.has(t.category))continue;const i=X(t.__interval);let n=l.get(i);n||(n={},l.set(i,n));for(const i of c)n[i]=(null!==(e=n[i])&&void 0!==e?e:0)+(null!==(o=t[i])&&void 0!==o?o:0)}l.forEach(((t,e)=>{w(n,b(t),e)}))}for(const e of R){const o=X(e.__interval);b(e);for(const i of t)for(const t of i)"ENTRY"===t.type&&"REST"!==t.category&&t.category===e.category&&(this.config.grouped&&t.rowGroup!==e.rowGroup||$&&t.operation!==e.operation||w(t,e,o))}const S=m||v&&this.config.grouped?g(`SELECT ${bt} as ${f.ROWGROUP}, __interval ${h.length>0?",".concat(h):""}\n FROM ${a}\n GROUP BY ${bt}, __interval`):[],y=new Map;if(S.forEach((t=>y.set(`${t.rowGroup}${r}${X(t.__interval)}`,t))),m)for(const e of S){const o=X(e.__interval),i=b(Object.assign({},e));for(const n of t)for(const t of n)"GROUP_SUM"===t.type&&t.rowGroup===e.rowGroup&&w(t,i,o)}const M=H.SUM===this.config.type||H.OPT===this.config.type,U=M||v&&!this.config.grouped?g(`SELECT __interval ${h.length>0?",".concat(h):""}\n FROM ${a}\n GROUP BY __interval`):[],G=new Map;if(U.forEach((t=>G.set(X(t.__interval),t))),M)for(const e of U){const o=X(e.__interval),i=b(Object.assign({},e));for(const e of t)for(const t of e)"SUM"===t.type&&w(t,i,o)}if(null!=this.config.thereOf&&this.config.thereOf.length>0){const e=[];this.config.thereOf.forEach((t=>{e.push(...g(`SELECT ${this.drillRowGroup} as ${f.ROWGROUP}, ${f.CATEGORY}, ${f.SUBCATEGORY}, __interval ${l.length>0?",".concat(l):""}\n FROM ${a}\n WHERE ${this.createThereOfWhereClause(t)}\n GROUP BY ${this.drillRowGroup}, ${f.CATEGORY}, ${f.SUBCATEGORY}, __interval`))}));for(const o of e){const e=X(o.__interval);b(o);for(const i of t)for(const t of i)"DRILLELEMENT"===t.type&&t.category===o.category&&t.rowGroup===o.rowGroup&&(t.subCategory!==o.subCategory&&t.subCategory!==`${o.subCategory} (${o.rowGroup})`||w(t,o,e))}}if(v){let e="1 <> 1 ";null===(i=this.config.partOf)||void 0===i||i.forEach((t=>{e+=`OR (${f.CATEGORY} = ${this.bind(t.category)}`,null!=t.rowGroup&&0!==t.rowGroup.length&&t.rowGroup.trim()&&(e+=`and ${f.ROWGROUP} = ${this.bind(t.rowGroup)}`),e+=")"}));const o=g(`SELECT ${f.CATEGORY}, ${this.config.grouped?`${f.ROWGROUP}`:`'SUM_TOTAL' as ${f.ROWGROUP}`}, __interval ${l.length>0?",".concat(l):""}\n FROM ${a}\n WHERE ${e}\n GROUP BY ${f.ROWGROUP}, ${f.CATEGORY}, __interval`),h=new Map;for(const t of o){const e=`${t.rowGroup}${r}${t.category}${r}${X(t.__interval)}`,o=h.get(e);if(o)for(const e of c)o[e]=(null!==(n=o[e])&&void 0!==n?n:0)+(null!==(s=t[e])&&void 0!==s?s:0);else h.set(e,t)}h.forEach((e=>{const o=X(e.__interval),i=this.config.grouped?y.get(`${e.rowGroup}${r}${o}`):G.get(o);for(const t of c)e[t]=e[t]/(i?i[t]:Number.NaN);b(e);for(const i of t)for(const t of i)"PARTELEMENT"===t.type&&t.category===e.category&&t.rowGroup===e.rowGroup&&w(t,e,o)}))}}createThereOfWhereClause(t){let e=!0,o="1 <> 1 OR ( ";return null!=t.category&&0!==t.category.length&&t.category.trim()&&(o+=` ${f.CATEGORY} = ${this.bind(t.category)}`,e=!1),null!=t.rowGroup&&0!==t.rowGroup.length&&t.rowGroup.trim()&&(o+=` ${e?"":"AND"} ${f.ROWGROUP} = ${this.bind(t.rowGroup)}`,e=!1),null!=t.subCategory&&0!==t.subCategory.length&&t.subCategory.trim()&&(o+=` ${e?"":"AND"} ${f.SUBCATEGORY} = ${this.bind(t.subCategory)}`),o+")"}getRelativeScenarios(){const t=new Map;return this.config.scenarios.forEach((e=>{const o=this.createRelativeScenario(e);null!=o&&t.set(o.key,o.value)})),t}translateScenarioSQL(t,e,o){const i=new p(t);return H.OPT===o||H.OPTNOTOTAL===o?i.isValid?"dr"===i.type?`SUM(${i.base} - ${i.delta}) as ${t}, SUM(${i.delta}) as dr_${i.delta}`:`SUM(${i.base} - ${i.delta}) as ${t}`:e?`SUM(${t} * transformOperator(operation)) as ${t}, COUNT(ISNULL(${t})) as ${t}_cnt`:`SUM(${t}) as ${t}, COUNT(ISNULL(${t})) as ${t}_cnt`:i.isValid?"dr"===i.type?`SUM((${i.base} * transformOperator(operation)) - (${i.delta} * transformOperator(operation))) as ${t}, SUM(${i.delta} * transformOperator(operation)) as dr_${i.delta}`:`SUM((${i.base} * transformOperator(operation))- (${i.delta} * transformOperator(operation))) as ${t}`:`SUM(${t} * transformOperator(operation)) as ${t}, COUNT(ISNULL(${t})) as ${t}_cnt`}translateAttributeSQL(t){const e=`[${t.arg}]`,o=/^(ac|pp|fc|pl)[1-4]$/.test(t.arg)&&this.config.type!==H.OPT&&this.config.type!==H.OPTNOTOTAL;switch(t.fn){case"set":return`SETAGG(${e}) as ${t.alias}`;case"first":return`FIRST(${e}) as ${t.alias}`;case"last":return`LAST(${e}) as ${t.alias}`;case"min":return`MIN(${e}) as ${t.alias}`;case"max":return`MAX(${e}) as ${t.alias}`;case"avg":return o?`AVG(${e} * transformOperator(operation)) as ${t.alias}`:`AVG(${e}) as ${t.alias}`;case"sum":return o?`SUM(${e} * transformOperator(operation)) as ${t.alias}`:`SUM(${e}) as ${t.alias}`;case"lit":{const e=t.arg;return`${this.bind(""===e||Number.isNaN(Number(e))?e:Number(e))} as ${t.alias}`}}}get drillRowGroup(){return this.config.grouped?bt:f.ROWGROUP}exec(t){const e=this.db.exec(t,this.params);return this.config.grouped&&e.forEach((t=>t.rowGroup=null==t.rowGroup?"":String(t.rowGroup))),e}bind(t){return`$${this.params.push(t)-1} `}createOrderString(t){const e=j.ASC===t.direction?j.DESC:j.ASC;return[t.hierarchy.map((e=>`${e} ${t.direction}`)).toString(),t.hierarchy.map((t=>`${t} ${e}`)).toString()]}createRelativeScenario(t){const e=new p(t);return e.isValid&&"dr"===e.type?{key:`${t}`,value:`dr_${e.delta}`}:null}exctractScenarioNames(t){const e=[];return t.split(",").forEach((t=>t.length>=2?e.push(t.split("as")[1].trim()):null)),e}findDuplicateSubCategories(t){const e=t.map((t=>({count:1,subCategory:`${t.category}##${t.subCategory}`}))).reduce(((t,e)=>(t[e.subCategory]=(t[e.subCategory]||0)+e.count,t)),{});return Object.keys(e).filter((t=>e[t]>1))}createPartOfQuery(t,e){var o;const i=[];let n="1 <> 1 ",s=` ${this.drillRowGroup} as ${f.ROWGROUP}`,r="ROWNUM()";return null===(o=this.config.partOf)||void 0===o||o.forEach((t=>{n+=`OR (${f.CATEGORY} = ${this.bind(t.category)}`,null!=t.rowGroup&&0!==t.rowGroup.length&&t.rowGroup.trim()&&(n+=`and ${f.ROWGROUP} = ${this.bind(t.rowGroup)}`),!1===this.config.grouped&&(s=` 'SUM_TOTAL' as ${f.ROWGROUP} `,r="1"),n+=")"})),i.push(`SELECT ${r} AS ${f.ROWNR},\n 'PARTELEMENT' as ${f.TYPE},\n ${f.CATEGORY},\n ${s},\n ${t}\n FROM ${this.fromExpr}\n WHERE ${n}\n GROUP BY ${this.drillRowGroup}, ${f.CATEGORY}, ${f.TYPE}\n ORDER BY ${e[1]}`),i}checkConfigForPartOf(){return null!=this.config.partOf&&0!==this.config.partOf.length}createThereOfDrillColumns(t,e){if(null==t||0===t.size)return;const o=[],i=[],n=this.fromExpr;t.forEach(((t,e)=>{let i="1 <> 1 ";t.forEach((t=>{i+=` or columnGroup = ${this.bind(String(t.name))} `})),o.push(`SELECT 'ENTRY' as rowlevel,\n 'COLUMNGROUP' as columnlevel,\n rowGroup,\n category,\n columnGroup,\n '${e}' as scenario,\n sum(${e} * transformOperator(operation)) as val\n FROM ${n}\n WHERE ${i}\n GROUP BY rowlevel, rowGroup, category, columnGroup, scenario`),o.push(`SELECT 'ENTRY' as rowlevel,\n 'SUBGROUP' as columnlevel,\n rowGroup,\n category,\n columnGroup,\n columnSubGroup,\n '${e}' as scenario,\n sum(${e} * transformOperator(operation)) as val\n FROM ${n}\n WHERE ${i}\n GROUP BY rowlevel, rowGroup, category, columnGroup, columnSubGroup, scenario`),o.push(`SELECT 'DRILLELEMENT' as rowlevel,\n 'COLUMNGROUP' as columnlevel,\n rowGroup,\n category,\n subCategory,\n columnGroup,\n '${e}' as scenario,\n sum(${e} * transformOperator(operation)) as val\n FROM ${n}\n WHERE ${i}\n GROUP BY rowlevel, rowGroup, category, subCategory, columnGroup, scenario`),o.push(`SELECT 'DRILLELEMENT' as rowlevel,\n 'SUBGROUP' as columnlevel,\n rowGroup,\n category,\n subCategory,\n columnGroup,\n columnSubGroup,\n '${e}' as scenario,\n sum(${e} * transformOperator(operation)) as val\n FROM ${n}\n WHERE ${i}\n GROUP BY rowlevel, rowGroup, category, subCategory, columnGroup, columnSubGroup, scenario`),o.push(`SELECT 'GROUP_SUM' as rowlevel,\n 'COLUMNGROUP' as columnlevel,\n rowGroup,\n columnGroup,\n '${e}' as scenario,\n sum(${e} * transformOperator(operation)) as val\n FROM ${n}\n WHERE ${i}\n GROUP BY rowlevel, rowGroup, columnGroup, scenario`),o.push(`SELECT 'GROUP_SUM' as rowlevel,\n 'SUBGROUP' as columnlevel,\n rowGroup,\n columnGroup,\n columnSubGroup,\n '${e}' as scenario,\n sum(${e} * transformOperator(operation)) as val\n FROM ${n}\n WHERE ${i}\n GROUP BY rowlevel, rowGroup, columnGroup, columnSubGroup, scenario`),o.push(`SELECT 'SUM' as rowlevel,\n 'COLUMNGROUP' as columnlevel,\n columnGroup,\n '${e}' as scenario,\n sum(${e} * transformOperator(operation)) as val\n FROM ${n}\n WHERE ${i}\n GROUP BY rowlevel, columnGroup, scenario`),o.push(`SELECT 'SUM' as rowlevel,\n 'SUBGROUP' as columnlevel,\n columnGroup,\n columnSubGroup,\n '${e}' as scenario,\n sum(${e} * transformOperator(operation)) as val\n FROM ${n}\n WHERE ${i}\n GROUP BY rowlevel, columnGroup, columnSubGroup, scenario`)}));for(const t of o)i.push(...this.db.exec(t,this.params));this.injectDrillColumnsToResultRows(i,e)}injectDrillColumnsToResultRows(t,e){const o="##";for(const i of t)for(const t of e)for(const e of t)if(e.type===i.rowlevel)if("ENTRY"===i.rowlevel)"COLUMNGROUP"===i.columnlevel&&e.category===i.category?e[i.scenario+o+i.columnGroup]=i.val:"SUBGROUP"===i.columnlevel&&e.category===i.category&&(e[i.scenario+o+i.columnGroup+o+i.columnSubGroup]=i.val);else if("DRILLELEMENT"===i.rowlevel){if(!this.config.grouped&&e.rowGroup!==i.rowGroup)continue;"COLUMNGROUP"===i.columnlevel&&e.category===i.category&&e.subCategory===i.subCategory?e[i.scenario+o+i.columnGroup]=i.val:"SUBGROUP"===i.columnlevel&&e.category===i.category&&e.subCategory===i.subCategory?e[i.scenario+o+i.columnGroup+o+i.columnSubGroup]=i.val:"COLUMNGROUP"===i.columnlevel&&e.category===i.category&&e.subCategory===`${i.subCategory} (${i.rowGroup})`?e[i.scenario+o+i.columnGroup]=i.val:"SUBGROUP"===i.columnlevel&&e.category===i.category&&e.subCategory===`${i.subCategory} (${i.rowGroup})`&&(e[i.scenario+o+i.columnGroup+o+i.columnSubGroup]=i.val)}else("SUM"===i.rowlevel||"GROUP_SUM"===i.rowlevel)&&("COLUMNGROUP"===i.columnlevel&&e.category===i.category&&e.subCategory===i.subCategory&&(e[i.scenario+o+i.columnGroup]=i.val),"SUBGROUP"===i.columnlevel&&e.category===i.category&&e.subCategory===i.subCategory&&(e[i.scenario+o+i.columnGroup+o+i.columnSubGroup]=i.val))}}class St{constructor(){this.geometry=new Map}set(t,e,o){let i=this.geometry.get(t);i||(i=new Map,this.geometry.set(t,i)),i.set(e,o)}get(t,e){var o;return null===(o=this.geometry.get(t))||void 0===o?void 0:o.get(e)}}function yt(t,e,o){const i=t[e];if(null==i)return null;const n=Number(i);return isNaN(n)?null:o!==H.OPT&&o!==H.OPTNOTOTAL||t[f.TYPE]!==I.ENTRY||"-"!==t[f.OPERATION]?n:-n}class Et{constructor(t){this.ruleSet=t,this.normalizedHeader=[],this.attributesByAlias=new Map,this.hasBlankRowGroup=!1,this.dateBuckets=!1}underlineClass(t){return this.ruleSet&&/^(ac|pp|fc|pl)[1-4]$/.test(t)?$(this.ruleSet.getScenarioColorIndex(t))+t.slice(2):null}getNormalizedHeader(){return this.normalizedHeader}createHeader(t,e,o,i,n,s,r=[]){const a=[];this.attributesByAlias=new Map(r.map((t=>[t.alias,t]))),this.normalizedHeader=this.normalizeHeader(t,e,r);const l=this.normalizedHeader.some((t=>void 0!==t.bucket));l&&a.push(this.createIntervalBandRow());const h=new J(l?1:0,0,I.HEADER),c=new J(l?2:1,0,I.SEPERATORLINE);for(const t of this.normalizedHeader){const e=this.attributesByAlias.get(t.name);h.createElement(e?o.get(e.label)||e.label:d.translateScenarioLabel(t.name,o),t.type,this.createColumnType(t),null,this.setHeaderPrefix(t,o,i,n,s),null,null,null,null),c.createElement(null,t.type,this.createColumnType(t),null,null,this.underlineClass(t.type),null,null,null)}return a.push(h),a.push(c),a}createIntervalBandRow(){const t=new J(0,0,I.HEADER);let e=0;for(;e<this.normalizedHeader.length;){const o=this.normalizedHeader[e];if(void 0===o.bucket){t.createElement(null,o.type,"filler",null,null,null,null,null,null),e+=1;continue}let i=1;for(;e+i<this.normalizedHeader.length&&this.normalizedHeader[e+i].bucket===o.bucket;)i+=1;t.createElement(o.bucketLabel,o.type,"intervalGroup",null,null,null,null,null,null,!1,void 0,i),e+=i}return t}setHeaderPrefix(t,e,o,i,n){let s="";return"category"===t.name&&n&&(0===o.prefix.length&&0===i.length||(s=d.translateScenarioLabel("in",e)+" "+o.prefix+i)),t.order&&(s+=d.translateScenarioLabel("ORDER_"+t.order,e)),s}normalizeHeader(t,e,o){let i=[{name:f.CATEGORY,group:f.CATEGORY,type:f.CATEGORY,order:void 0}];H.OPT!==t&&H.OPTNOTOTAL!==t||(i=[{name:f.OPERATION,group:f.OPERATION,type:f.OPERATION,order:void 0},{name:f.CATEGORY,group:f.CATEGORY,type:f.CATEGORY,order:void 0}]);const n=o.map((t=>({name:t.alias,group:t.alias,type:t.alias,order:void 0})));return[...i,...n,...e]}createBodyRows(t,e,o,i){var n;const s=[];let r=-1;const a=new Rt(t,e);var l;this.dateBuckets=(l=t.interval)!==z&&l!==V;const h=a.execute(o,i);this.hasBlankRowGroup=a.hasBlankRowGroup;const c=this.calculateColumnStatistics(h,t.barColumns,t.interval!==z),u=(null!==(n=t.barColumns)&&void 0!==n?n:[]).filter((t=>t.toUpperCase().trim()in g)),d=u.length>0&&t.interval===z&&0===t.categoryThereOf.size&&function(t){for(const e of t)for(const t of e){const e=t[f.TYPE];if(e===I.SUM||e===I.GROUPSUM||e===I.DRILLELEMENT||e===I.PARTELEMENT)return!0}return!1}(h)?function(t,e,o){const i=new St;for(const n of e){let e,s=0,r=0;const a=[],l=(t,e)=>{a.push(e),i.set(t,n,e)};for(const i of t)for(const t of i){const i=t[f.TYPE];if(i===I.GROUPHEAD){e=void 0;continue}const a=yt(t,n,o);if(i===I.ENTRY){if(null===a){e=void 0;continue}l(t,{start:s,end:s+a,min:0,max:0,kind:"cascade"}),e={start:s,end:s+a},r=e.start,s+=a}else if(i===I.SUM||i===I.GROUPSUM){if(null===a){e=void 0;continue}l(t,{start:0,end:a,min:0,max:0,kind:"anchor"}),e={start:0,end:a},r=0,s=a}else if(i===I.DRILLELEMENT){if(null===a||void 0===e)continue;const o=r+(Math.sign(e.end-e.start)||1)*Math.abs(a);l(t,{start:r,end:o,min:0,max:0,kind:"thereof",parentStart:e.start,parentEnd:e.end}),r=o}else if(i===I.PARTELEMENT){if(null===a||void 0===e)continue;const o=r+a*(e.end-e.start);l(t,{start:r,end:o,min:0,max:0,kind:"partof",parentStart:e.start,parentEnd:e.end}),r=o}}let h=0,c=0;for(const t of a)h=Math.min(h,t.start,t.end),c=Math.max(c,t.start,t.end);for(const t of a)t.min=h,t.max=c}return i}(h,u,t.type):void 0;for(const o of h)r+=1,s.push(...this.createRow(t.i18n,e,t.scenariosUnitType,o,r,-1,t.categoryWidth,t.measureScale,t.barColumns,c,d));return s}calculateColumnStatistics(t,e,o=!1){const i=new Map;if(!e||0===e.length)return i;const n=new Map;for(const t of e)i.set(t,{min:1/0,max:-1/0,absMax:0,median:0}),n.set(t,[]);for(const s of t)for(const t of s){const s=t[f.TYPE];if(s!==I.SUM&&s!==I.GROUPSUM)for(const s of e){const e=o?this.extractIntervalColumnValues(t,s):[this.extractColumnValue(t,s)];for(const t of e)if(null!==t&&!isNaN(t)){const e=i.get(s);e.min=Math.min(e.min,t),e.max=Math.max(e.max,t),n.get(s).push(Math.abs(t))}}}for(const[t,e]of i){e.min!==1/0&&e.max!==-1/0||(e.min=0,e.max=0),e.absMax=Math.max(Math.abs(e.min),Math.abs(e.max));const o=n.get(t);if(o.length>0){o.sort(((t,e)=>t-e));const t=Math.floor(o.length/2);e.median=o.length%2==0?(o[t-1]+o[t])/2:o[t]}i.set(t,e)}return i}extractIntervalColumnValues(t,e){const o=e+"##",i=[];for(const e of Object.keys(t))if(e.startsWith(o)){const o=Number(t[e]);i.push(isNaN(o)?null:o)}return i}extractColumnValue(t,e){if(void 0!==t[e]){const o=Number(t[e]);return isNaN(o)?null:o}for(const o of Object.keys(t))if(o===e||o.endsWith("##"+e)||o===e+"##"+e){const e=Number(t[o]);if(!isNaN(e))return e}return null}createRow(t,e,o,i,n,s,r,a,h,c,u){var d;const p=[];for(const $ of i){const m=$[f.ROWGROUP],v=""===m?"-":m,g=$[f.SUBCATEGORY],b=$[f.TYPE],w=$[f.ROWNR]>=2,R=this.createDetailRow(b,s+=1,n,i.length);R.key=this.rowKey($);for(const i of this.normalizedHeader){const n=this.getRawDataRowElement($,i),s=null!==(d=null==h?void 0:h.includes(i.type))&&void 0!==d&&d,f=s?null==c?void 0:c.get(i.type):void 0,p=s&&void 0===i.bucket&&i.name===i.group&&i.name===i.type?null==u?void 0:u.get($,i.type):void 0;R.createElement(this.translateSumCellLabel(t,e,n,v,g,b,i.type),i.type,this.createColumnType(i),this.setCellType(i.type,o),this.translateCellPrefix(e,b,i.type),this.translateScenarioCSS(i.type,n),w,r,null==a?void 0:a.value,s,f,1,p),this.dateBuckets&&void 0!==i.bucket&&(R.elements[R.elements.length-1].date=l(i.bucket))}p.push(R)}return p}rowKey(t){var e;const o=null!=t.restRowGroup?t.restRowGroup:"NO_GROUP"===t.rowGroup?void 0:t.rowGroup;switch(t.type){case I.ENTRY:return{rowGroup:o,category:t.category,subCategory:t.subCategory};case I.DRILLELEMENT:return{rowGroup:o,category:t.category,subCategory:null!==(e=t.rawSubCategory)&&void 0!==e?e:t.subCategory};case I.GROUPSUM:return{rowGroup:o,row:"subtotal"};case I.SUM:return{row:"total"};default:return}}getRawDataRowElement(t,e){return void 0!==e.bucket?t[e.type+"##"+e.bucket]:e.name===e.group&&e.name===e.type?t[e.name]:e.name===e.group&&e.name!==e.type?t[e.type+"##"+e.name]:t[e.type+"##"+e.group+"##"+e.name]}createDetailRow(t,e,o,i){switch(t){case I.GROUPHEAD:return new J(e,o,I.HEADER);case I.SUM:case I.GROUPSUM:return new J(i+2,o,I.SUM);case I.DRILLELEMENT:return new J(i+2,o,I.DRILLELEMENT);case I.PARTELEMENT:return new J(i+2,o,I.PARTELEMENT);default:return new J(e,o,I.STANDARD)}}translateSumCellLabel(t,e,o,i,n,s,r){return this.attributesByAlias.has(r)||!1===Number.isNaN(Number(o))||this.isOperationColumn(r)?o:this.isGroupHeadCategory(s,r)?t===b.ALL?`${e.get(o)||o}`:o:this.isEntryCategory(s,r)?t===b.ALL||"REST"===o?`${e.get(o)||o}`:o:this.isDrillElementCategory(s,r)?t===b.ALL?`${e.get(n)||n}`:`${n}`:this.isPartElementCategory(s,r)?t===b.ALL||"SUM_TOTAL"===i?`${e.get(i)||i}`:`${i}`:this.isSumElementCategory(s,r)?t===b.ALL||"SUM_TOTAL"===i?`${e.get(i)||i}`:i:"GROUPHEAD"===s&&null==o||o===E?o:Number.isNaN(Number(o))?"-":Number(o)}isOperationColumn(t){return"operation"===t}translateScenarioCSS(t,e){if(this.attributesByAlias.has(t))return"attribute";const o=new p(t);let i="pos";return e<0&&(i="neg"),o.isValid?i+"_"+o.direction+("dr"===o.type?" relative_variance":""):t}setCellType(t,e){if("category"===t)return"";const o=this.attributesByAlias.get(t);if(o)return o.isNumeric?"decimal":"";let i;const n=new p(t);return e===w.PERCENT?(i="percent",n.isValid&&"d"===n.type&&(i="percentpoint")):(i="decimal",n.isValid&&"dr"===n.type&&(i="percent")),i}isDrillElementCategory(t,e){return"DRILLELEMENT"===t&&"category"===e}isPartElementCategory(t,e){return"PARTELEMENT"===t&&"category"===e}isSumElementCategory(t,e){return("GROUP_SUM"===t||"SUM"===t)&&"category"===e}isEntryCategory(t,e){return"ENTRY"===t&&"category"===e}isGroupHeadCategory(t,e){return"GROUPHEAD"===t&&"category"===e}translateCellPrefix(t,e,o){return this.isOperationColumn(o)||this.isGroupHeadCategory(e,o)||this.isEntryCategory(e,o)?null:this.isDrillElementCategory(e,o)?`${t.get("thereof")} `:this.isPartElementCategory(e,o)?`${t.get("part_of")} `:null}createColumnType(t){return t.name===t.group&&t.name===t.type?"base":t.name===t.group?"columnGroup":"columnSubGroup"}}class Ot{constructor(t,e,o,i){this.fromExpr="",this.rowCount=0,this.headerRows=[],this.bodyRows=[],this.intervalBuckets=[],this.ruleSet=t||new m,this.db=e,this.dataSetFactory=new Et(this.ruleSet),this.config=this.initConfig(i),this.i18n=this.initI18n(new Map),this.setSource(o,i.filter)}setI18n(t){this.i18n=this.initI18n(t)}initI18n(t){const e=new Map([["",""],["SEPARATOR_WS",", "],["in","in"],["ORDER_asc","↑"],["ORDER_desc","↓"],["ac1","AC"],["pp1","PY"],["fc1","FC"],["pl1","PL"],["ac2","AC2"],["pp2","PY2"],["fc2","FC2"],["pl2","PL2"],["ac3","AC3"],["pp3","PY3"],["fc3","FC3"],["pl3","PL3"],["ac4","AC4"],["pp4","PY4"],["fc4","FC4"],["pl4","PL4"],["category"," "],["operation"," "],["thereof","davon"],["part_of","in % von"],["ibcssymbol_delta_ac","Δ{%}"],["ibcssymbol_delta_generic","Δ({%})"],["ibcssymbol_delta_ac_relative","Δ{%}%"],["ibcssymbol_delta_generic_relative","Δ({%})%"],["SUM_TOTAL","❖"]]);return this.state=Y.DIRTY,new Map([...e,...t||new Map])}initConfig(t){this.state=Y.DIRTY;const e=t,o=this;return t.scenarios.sort(((t,e)=>o.ruleSet.getScenarioSorIndex(t)-o.ruleSet.getScenarioSorIndex(e))),e}setConfig(t){this.config=this.initConfig(t)}setSource(t,e){var o,i;if(this.state=Y.DIRTY,this.fromExpr=_(this.db,t,e),!this.fromExpr)return void(this.rowCount=0);const n=this.db.exec(`SELECT COUNT(*) AS cnt FROM ${this.fromExpr}`);this.rowCount=null!==(i=null===(o=n[0])||void 0===o?void 0:o.cnt)&&void 0!==i?i:0}update(){this.prepareIntervalBuckets();const t=this.normalizeScenarios(this.config.scenarios,this.config.categoryThereOf,this.config.sortOrder,this.intervalBuckets);this.headerRows=this.dataSetFactory.createHeader(this.config.type,t,this.i18n,this.config.measureScale,this.config.measureUnit,this.config.showMeasureScale,this.config.attributes),this.bodyRows=0!==this.rowCount&&this.fromExpr?this.dataSetFactory.createBodyRows(this.config,this.i18n,this.db,this.fromExpr):[],this.state=Y.UP_TO_DATE}getHeader(){return this.state===Y.DIRTY&&this.update(),this.headerRows}getBody(){return this.state===Y.DIRTY&&this.update(),this.bodyRows}getColumns(){return this.state===Y.DIRTY&&this.update(),this.dataSetFactory.getNormalizedHeader()}prepareIntervalBuckets(){this.intervalBuckets=[],this.config.interval===z||!this.fromExpr||this.config.categoryThereOf.size>0?this.config.interval=z:(this.config.interval=function(t,e,o){var i;if(o!==G.AUTO)return o;const n=t.exec(`SELECT [date] as d FROM ${e}`);let s,r;for(const t of n){const e=null===(i=q(t.d))||void 0===i?void 0:i.toMillis();void 0!==e&&(s=void 0===s?e:Math.min(s,e),r=void 0===r?e:Math.max(r,e))}return void 0===s||void 0===r?G.DAY:(new T).calculateDistanceType(M.fromMillis(s),M.fromMillis(r))}(this.db,this.fromExpr,this.config.interval),this.intervalBuckets=function(t,e,o,i){const n=t.exec(`SELECT ${Q(o)} as __interval FROM ${e}`);if(o===V){const t=new Set,e=[];for(const o of n){const i=X(o.__interval);t.has(i)||(t.add(i),e.push({key:i,label:0===i.length?"-":i}))}return e}const s=new Set,r=[];for(const t of n){const e=q(t.__interval);if(!e)continue;const o=e.toISO();s.has(o)||(s.add(o),r.push(e))}r.sort(((t,e)=>t.toMillis()-e.toMillis()));const a=new T;return a.setLocale(i),r.map((t=>({key:t.toISO(),label:a.getDateString(t,o)})))}(this.db,this.fromExpr,this.config.interval,this.config.locale),0===this.intervalBuckets.length&&(this.config.interval=z))}normalizeScenarios(t,e,o,i=[]){var n,s;const r=[];if(i.length>0){for(const e of i)for(const i of t)r.push({name:i,group:i,type:i,order:(null===(n=null==o?void 0:o.hierarchy)||void 0===n?void 0:n.at(0))===i?o.direction:void 0,bucket:e.key,bucketLabel:e.label});return r}for(const i of t){if(null==e?void 0:e.has(i)){const t=e.get(i);for(const e of t){r.push({name:e.name,group:e.name,type:i,order:void 0});for(const t of e.subGroups)r.push({name:t,group:e.name,type:i,order:void 0})}r.push({name:"REST",group:"REST",type:i,order:void 0})}let t;(null===(s=null==o?void 0:o.hierarchy)||void 0===s?void 0:s.at(0))===i&&(t=o.direction),r.push({name:i,group:i,type:i,order:t})}return r}hasNoData(){return 0===this.rowCount}hasBlankRowGroup(){return this.dataSetFactory.hasBlankRowGroup}}class Mt{constructor(){this.title="",this.scenarios=[],this.scenariosUnitType=w.DECIMAL,this.grouped=!1,this.showGroupTitle=!0,this.thereOf=[],this.categoryThereOf=new Map,this.partOf=[],this.attributes=[],this.sortOrder=new D(new A).default(),this.type=H.LIST,this.limit=0,this.i18n=b.ALL,this.categoryWidth=S.W25,this.measureScale=new W,this.measureUnit="",this.measureType=y.VOLUME,this.showMeasureScale=!0,this.filter="",this.barColumns=[],this.interval="none",this.locale="de"}}class Ut{constructor(t,e,o,i,n,s){this.tableDrillGroupAdapter=t,this.stringAdapter=e,this.orderAdapter=o,this.db=i,this.fromExpr=n,this.onQueryError=s}adapt(t){const e=new Mt;return R.isString(t.title)&&(e.title=t.title),R.isArray(t.scenarios)&&(e.scenarios=P.adaptArray(t.scenarios,this.stringAdapter)),R.isExisting(t.scenariosUnitType)&&(e.scenariosUnitType=t.scenariosUnitType),R.isBoolean(t.grouped)&&(e.grouped=t.grouped),R.isBoolean(t.showGroupTitle)&&(e.showGroupTitle=t.showGroupTitle),R.isBoolean(t.showMeasureScale)&&(e.showMeasureScale=t.showMeasureScale),R.isArray(t.thereOf)&&(e.thereOf=P.adaptArray(t.thereOf,this.tableDrillGroupAdapter)),R.isExisting(t.categoryThereOf)&&(e.categoryThereOf=t.categoryThereOf),R.isArray(t.partOf)&&(e.partOf=P.adaptArray(t.partOf,this.tableDrillGroupAdapter)),R.isArray(t.attributes)&&(e.attributes=t.attributes),R.isExisting(t.order)&&(e.sortOrder=this.orderAdapter.adapt(t.order)),R.isExisting(t.type)&&(e.type=t.type),R.isNumber(t.limit)&&(e.limit=t.limit),R.isExisting(t.i18n)&&(e.i18n=t.i18n),R.isExisting(t.categoryWidth)&&(e.categoryWidth=t.categoryWidth),R.isExisting(t.measureScale)&&(e.measureScale=L.calculateMeasureScale(this.db,this.fromExpr,e.scenarios,t.measureScale,this.onQueryError)),R.isExisting(t.measureType)&&(e.measureType=t.measureType),R.isString(t.measureUnit)&&(e.measureUnit=t.measureUnit),R.isString(t.filter)&&(e.filter=t.filter.trim()),R.isArray(t.barColumns)&&(e.barColumns=t.barColumns),R.isString(t.interval)&&(e.interval=t.interval),R.isString(t.locale)&&(e.locale=t.locale),e}default(){return new Mt}}class Gt{constructor(){this.rowGroup="",this.category="",this.subCategory="",this.partOf=""}}class Tt{constructor(){}adapt(t){const e=new Gt;return R.isString(t.rowGroup)&&(e.rowGroup=t.rowGroup),R.isString(t.category)&&(e.category=t.category),R.isString(t.subCategory)&&(e.subCategory=t.subCategory),R.isString(t.partOf)&&(e.partOf=t.partOf),e}default(){return new Gt}}const Nt=e(class extends o{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.tableName="",this.dataVersion=0,this.sumTitle="SUM_TOTAL",this.scenarios=[],this.scenariosDataFormat=w.DECIMAL,this.grouped=!1,this.limit=0,this.showGroupTitle=!0,this.thereof=[],this.partof=[],this.order={hierarchy:[],direction:j.ASC},this.categorythereof=new Map,this.attributeColumns=[],this.type=H.LIST,this.categoryWidth=S.INF,this.dataFormatDigits={percent:2,decimal:1},this.i18n=new Map,this.i18nMode=b.ALL,this.measureScale="_",this.measureUnit="",this.showMeasureScale=!0,this.measureType=y.VOLUME,this.filter="",this.barColumns=[],this.interval="none",this.barColumnMaxWidth=30,this.unitScaling=.01,this.percentageScaling=.5,this.scaleFactor=1,this.componentDataFormatDigits=new x,U(this),this.componentStyle=B(this)}async getLayoutDetail(t,e){var o,i,n;const l={regions:[],metadata:{},diagnostics:[]},h=null===(o=this.element.shadowRoot)||void 0===o?void 0:o.querySelector("table");if(l.metadata.hasNoData=null===(n=null===(i=this.table)||void 0===i?void 0:i.hasNoData())||void 0===n||n,!this.table||!h)return l;const u=h.querySelector("thead"),d=h.querySelector("tbody");u&&l.regions.push({id:"header",rect:s(u,t)}),d&&l.regions.push({id:"body",rect:s(d,t)});const f=this.table.getHeader(),p=this.table.getBody(),$=this.table.getColumns();if(l.metadata.headerRowCount=f.length,l.metadata.rowCount=p.length,l.metadata.columnCount=$.length,l.metadata.cellCount=p.reduce(((t,e)=>t+e.getCells().length),0),"full"!==e)return l;const m=[],v=[],g=(e,o,i)=>{const n=i?Array.from(i.children).filter((t=>"tr"===t.localName)):[];o.forEach(((o,i)=>{const h=n[i];if(!h)return;m.push({section:e,index:i,type:o.type,rect:s(h,t),point:c(h)});const u=o.getCells(),d=Array.from(h.children);u.length===d.length?u.forEach(((o,n)=>{var l,h;const u=d[n],f={kind:"header"===e?"headerCell":"cell",row:i,column:o.index,key:o.key||void 0,colSpan:o.colSpan,value:null!==(l=o.value)&&void 0!==l?l:void 0,text:(null===(h=u.textContent)||void 0===h?void 0:h.trim())||void 0,type:o.type||void 0,rect:s(u,t),point:c(u)};f.point&&(f.content=r(u,t),f.contentSign=a(u)||void 0);const p=u.querySelector("svg.cell-bar-chart");p&&(f.bar={variant:p.classList.contains("waterfall-bar")?"waterfall":p.classList.contains("relative-variance")?"relative":"absolute",rect:s(p,t)}),v.push(f)})):l.diagnostics.push({id:`WARN_layout_cell_pairing_${e}_${i}`,type:"warning",message:`layout-state: model/DOM cell count mismatch in ${e} row ${i} (${u.length} vs ${d.length}); cell details skipped for this row.`})}))};return g("header",f,u),g("body",p,d),l.elements=v,l.table={rows:m,columns:$.map(((t,e)=>({index:e,key:t.name,group:t.group,type:t.type,bucket:t.bucket})))},l}render(){var e;return t(i,{class:{"no-data":!0===(null===(e=this.table)||void 0===e?void 0:e.hasNoData())}},(()=>{var e,o,i,n;if(void 0===this.table)return;if(this.table.hasNoData()){const o=null!==(e=this.i18n.get("no-data"))&&void 0!==e?e:"No Data";return t("div",{class:"empty-state"},o)}const s=null===(n=null===(i=null===(o=this.stores)||void 0===o?void 0:o.context)||void 0===i?void 0:i.state)||void 0===n?void 0:n.locale;return t("table",null,t("thead",null,this.table.getHeader().map((e=>t("tr",{class:e.cssStyle},e.getCells().map((e=>t("th",{colSpan:e.colSpan,class:e.cssStyle},e.getAsHeaderList().map(((o,i,n)=>t("span",null,i===n.length-1?t("span",{class:" "===o?"table-footer":""},o,e.drawPrefix()," "):t("span",null,o,e.drawPrefix(),t("br",null)))))))))))),t("tbody",null,this.table.getBody().map((e=>t("tr",Object.assign({class:e.cssStyle},u(e.key,"element")),null==e?void 0:e.getCells().map((o=>t("td",Object.assign({colSpan:o.colSpan,class:o.type?`${o.cssStyle} ${o.type}`:o.cssStyle},e.key&&null!=o.value&&""!==o.value&&"-"!==o.value?u(Object.assign(Object.assign({},e.key),{date:o.date,scenario:o.key}),"element"):{}),null!=o.prefix?t("span",{class:o.cssStyle+" "+o.prefixStyle},o.drawPrefix()):"",o.isBarChart&&o.columnStats&&o.value!==E&&(void 0!==o.waterfall||e.type!==I.SUM)?void 0!==o.waterfall?t(gt,{value:o.value,scenario:o.key,columnStats:o.columnStats,height:18*this.scaleFactor,isRelative:!1,isPositiveGood:o.key.endsWith("_pos"),measureScale:o.measureScale,locale:s,columnWidthEm:this.barColumnMaxWidth,styles:this.barChartStyles,waterfall:o.waterfall}):t(vt,{value:o.value,scenario:o.key,columnStats:o.columnStats,height:18*this.scaleFactor,isRelative:o.key.startsWith("dr"),isPositiveGood:o.key.endsWith("_pos"),measureScale:"percentpoint"===o.type?.01:o.measureScale,locale:s,percentDigits:this.componentDataFormatDigits.percent,columnWidthEm:this.barColumnMaxWidth,styles:this.barChartStyles}):o.draw(this.componentDataFormatDigits,s)))))))))})())}componentWillRender(){var t,e,o,i,n;this.stores||(this.stores=C(this.element));const s=this.stores.db.db;this.componentDataFormatDigits=(new k).adapt(this.dataFormatDigits);try{const e=this.prepareConfig(s);this.table=new Ot(new m(this.ruleSetConfig),s,this.tableName,e),this.table.setI18n(this.i18n),this.table.hasNoData()||this.table.getBody(),null===(t=this.errors)||void 0===t||t.remove("ERR_sql")}catch(t){console.error("bn-table-renderer: query failed",t),this.table=void 0,null===(e=this.errors)||void 0===e||e.addOrReplace({id:"ERR_sql",type:"error",message:`Query failed: ${t instanceof Error?t.message:t}`})}(null===(o=this.table)||void 0===o?void 0:o.hasBlankRowGroup())?null===(i=this.errors)||void 0===i||i.addOrReplace({id:"WARN_blankRowGroup",type:"warning",message:"grouped: rows with blank rowGroup found, they are grouped under '-'."}):null===(n=this.errors)||void 0===n||n.remove("WARN_blankRowGroup"),this.barChartStyles=this.prepareBarChartStyles()}prepareConfig(t){var e,o,i;const n=_(t,this.tableName,this.filter);return new Ut(new Tt,new A,new D(new A),t,n,(t=>{throw t})).adapt({title:this.sumTitle,scenarios:this.scenarios,scenariosUnitType:this.scenariosDataFormat,grouped:this.grouped,showGroupTitle:this.showGroupTitle,thereOf:this.thereof,partOf:this.partof,categoryThereOf:this.categorythereof,attributes:this.attributeColumns,order:this.order,type:this.type,limit:this.limit,i18n:this.i18nMode,categoryWidth:this.categoryWidth,measureScale:this.measureScale,measureUnit:this.measureUnit,measureType:this.measureType,showMeasureScale:this.showMeasureScale,filter:this.filter,barColumns:this.barColumns,interval:this.interval,locale:(null===(i=null===(o=null===(e=this.stores)||void 0===e?void 0:e.context)||void 0===o?void 0:o.state)||void 0===i?void 0:i.locale)||"de"})}prepareBarChartStyles(){var t;const e=!(this.unitScaling>0),o=!(this.percentageScaling>0),i=e?this.autoUnitScaling():this.unitScaling,n=o?this.autoPercentageScaling():this.percentageScaling;return(e||o)&&(null===(t=this.reportAutoScaling)||void 0===t||t.call(this,{unit:e?i:void 0,percentage:o?n:void 0})),this.componentStyle((t=>{var e,o,s,r,a,l,c,u,d,f,p,$,g,b,w,R,S,y,E,O,M,U,G,T,N,_,C;const L=null===(e=t["bn-chart-time"])||void 0===e?void 0:e.varianceStyles,x=null===(o=t["bn-chart-time"])||void 0===o?void 0:o.barStyles;return{positive:{stroke:(null===(s=null==L?void 0:L.pos)||void 0===s?void 0:s.stroke)||"#008f96",fill:(null===(r=null==L?void 0:L.pos)||void 0===r?void 0:r.fill)||"#008f96",fillpattern:h(null===(a=null==L?void 0:L.pos)||void 0===a?void 0:a.fillpattern)||"solid"},negative:{stroke:(null===(l=null==L?void 0:L.neg)||void 0===l?void 0:l.stroke)||"#ff0000",fill:(null===(c=null==L?void 0:L.neg)||void 0===c?void 0:c.fill)||"#ff0000",fillpattern:h(null===(u=null==L?void 0:L.neg)||void 0===u?void 0:u.fillpattern)||"solid"},neutral:{stroke:(null===(d=null==L?void 0:L.neu)||void 0===d?void 0:d.stroke)||"#808080",fill:(null===(f=null==L?void 0:L.neu)||void 0===f?void 0:f.fill)||"#808080",fillpattern:h(null===(p=null==L?void 0:L.neu)||void 0===p?void 0:p.fillpattern)||"outlined"},scenarios:v({ac:{stroke:(null===($=null==x?void 0:x.ac)||void 0===$?void 0:$.stroke)||"#404040",fill:(null===(g=null==x?void 0:x.ac)||void 0===g?void 0:g.fill)||"#404040",fillpattern:h(null===(b=null==x?void 0:x.ac)||void 0===b?void 0:b.fillpattern)||"solid"},pp:{stroke:(null===(w=null==x?void 0:x.pp)||void 0===w?void 0:w.stroke)||"#A6A6A6",fill:(null===(R=null==x?void 0:x.pp)||void 0===R?void 0:R.fill)||"#A6A6A6",fillpattern:h(null===(S=null==x?void 0:x.pp)||void 0===S?void 0:S.fillpattern)||"solid"},fc:{stroke:(null===(y=null==x?void 0:x.fc)||void 0===y?void 0:y.stroke)||"#404040",fill:(null===(E=null==x?void 0:x.fc)||void 0===E?void 0:E.fill)||"#ffffff",fillpattern:h(null===(O=null==x?void 0:x.fc)||void 0===O?void 0:O.fillpattern)||"hatched"},pl:{stroke:(null===(M=null==x?void 0:x.pl)||void 0===M?void 0:M.stroke)||"#404040",fill:(null===(U=null==x?void 0:x.pl)||void 0===U?void 0:U.fill)||"#ffffff",fillpattern:h(null===(G=null==x?void 0:x.pl)||void 0===G?void 0:G.fillpattern)||"outlined"}},new m(this.ruleSetConfig)),fontColor:(null===(T=t.global)||void 0===T?void 0:T.fontColor)||"#000000",fontSize:((null===(N=t.global)||void 0===N?void 0:N.fontSizePx)||13.3333)*tt*this.scaleFactor,emPx:((null===(_=t.global)||void 0===_?void 0:_.fontSizePx)||13.3333)*this.scaleFactor,fontFamily:(null===(C=t.global)||void 0===C?void 0:C.fontFamily)||"'Noto Sans', sans-serif",unitScaling:i,percentageScaling:n,scaleFactor:this.scaleFactor}}))}emPx(){return this.componentStyle((t=>{var e;return(null===(e=t.global)||void 0===e?void 0:e.fontSizePx)||13.3333}))*this.scaleFactor}autoUnitScaling(){const t=this.emPx(),e=t*tt,{absMax:o,hasNeg:i,hasPos:n}=this.getAbsBarColumnStats();if(o<=0||e<=0)return.01;const{maxBarWidth:s,cutWidth:r}=it(this.barColumnMaxWidth,t,i,n);return Math.min(.8*s,r)/(o*e)}autoPercentageScaling(){const t=this.emPx(),e=t*tt,{absMax:o,hasNeg:i,hasPos:n}=this.getRelativeBarColumnStats();if(o<=0||e<=0)return.5;const{maxPinLength:s}=nt(this.barColumnMaxWidth,t,i,n);return.8*s/(o*e)}getAbsBarColumnStats(){return this.collectBarColumnStats((t=>!t.key.startsWith("dr")&&!t.waterfall),1)}getRelativeBarColumnStats(){return this.collectBarColumnStats((t=>t.key.startsWith("dr")),100)}collectBarColumnStats(t,e){const o={absMax:0,hasNeg:!1,hasPos:!1};if(!this.table)return o;for(const i of this.table.getBody())if(i.type!==I.SUM)for(const n of i.getCells())n.isBarChart&&n.columnStats&&t(n)&&(o.absMax=Math.max(o.absMax,n.columnStats.absMax*e),o.hasNeg=o.hasNeg||n.columnStats.min<0,o.hasPos=o.hasPos||n.columnStats.max>0);return o}get element(){return this}static get style(){return':host(.no-data){display:block;box-sizing:border-box;width:100%;height:100%}:host(.no-data)>div{float:none;width:100%;height:100%}:host(.no-data) .no-data~.no-data{display:none}.empty-state{box-sizing:border-box;display:flex;align-items:center;justify-content:center;float:none;width:100%;height:100%;min-height:3em;margin:0;padding:0.5em;overflow:hidden;border:0.1em dashed #ddd;color:#808080;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);font-style:normal;text-align:center}:host{position:relative;display:inline-block}table{background-color:var(--bn-font-background, white);font-size:var(--bn-font-size, 1em);color:var(--bn-font-color, black);font-family:var(--bn-font-family, "Noto Sans", "Helvetica Neue", Helvetica, sans-serif);border-spacing:0.3em 0}thead{border-style:none}tr:first-child td{border-top:none;padding-top:0.5em}td.ac1,td.ac2,td.ac3,td.ac4,td.pp1,td.pp2,td.pp3,td.pp4,td.pl1,td.pl2,td.pl3,td.pl4,td.fc1,td.fc2,td.fc3,td.fc4,td.share,td.variance,td.pos_pos,td.pos_neg,td.neg_pos,td.neg_neg,td.pos_neutral,td.neg_neutral{text-align:right}.category-w100{min-width:100em;max-width:100em}.category-w50{min-width:50em;max-width:50em}.category-w25{min-width:25em;max-width:25em}.category-w20{min-width:20em;max-width:20em}.category-w15{min-width:15em;max-width:15em}.category-w10{min-width:10em;max-width:10em}.category-w5{min-width:5em;max-width:5em}.prefix-second{color:transparent;font-style:normal}.prefix-first{font-style:normal}th{border-bottom:0.1em solid black;text-align:right;font-weight:normal;vertical-align:text-top}td.columnGroup,th.columnGroup{font-size:0.6em}td.columnSubGroup,th.columnSubGroup{font-size:0.6em;border-spacing:0em 0;font-style:italic}td.base,th.base{font-style:normal}th.ofit,td.ofit,tr.ofit,th.partof,td.partof,tr.partof{font-size:0.6em;font-style:italic}td.ofit,td.partof{font-size:0.6em;font-style:italic}th.ofit td,tr.ofit td,th.partof td,tr.partof td{border-top:0em solid black;padding-left:1em}th.ofit share,th.partof share,tr.share td{border-top:0em solid black}th.share,tr.share,td.share{font-size:0.6em;font-style:italic}th.filler{border-bottom:0em solid black;text-align:right}td.filler{border-top:0em none !important;border-bottom:0em none;text-align:right}th.group{text-align:center;border-spacing:1em 0}th.headerlabel{border-bottom:0em none black;padding-bottom:0em}th.intervalGroup{border-bottom:0.1em solid black;text-align:center;font-weight:bold}td.variance:after{content:"%"}td.relative_variance{font-style:italic}td.percent{font-style:italic;text-align:right}td.decimal,td.percentpoint{text-align:right}td.pos_pos{color:#008f96}td.neg_pos{color:#ff0000}td.pos_neg{color:#ff0000}td.neg_neg{color:#008f96}td.pos_pos:before{content:"+"}td.pos_neg:before{content:"+"}td.pos_neu:before{content:"+"}th.ac1,th.ac2,th.ac3,th.ac4{padding-top:0em;border-bottom:0.3em solid black}th.pp1,th.pp2,th.pp3,th.pp4{padding-top:0em;border-bottom:0.3em solid grey}th.pl1,th.pl2,th.pl3,th.pl4{padding-top:0em;border-bottom:0.3em double black}th.fc1,th.fc2,th.fc3,th.fc4{border-bottom:0.3em solid;border-image:repeating-linear-gradient(-45deg, white, white, black, white, white 0.3em) 2}td.colsum{font-weight:bold}th.colsum{padding-top:0em;font-weight:bold}tr.sum td{border-top:0.1em solid black;font-weight:bold;padding-bottom:0.5em}tr.groupheader td{border-top:0em dotted #ddd;padding-top:0.5em;font-weight:bold;font-style:italic}tr.begingroup td{border-top:0em dotted #ddd;padding-top:0.5em}th.begin-group{padding-left:0.75em}th.end-group{padding-left:0.75em}td{box-sizing:border-box;-webkit-box-sizing:border-box;border-top:0.1em dashed #ddd;padding-left:0.5em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.table-footer{font-size:0.6em}.cell-bar-chart{display:inline-block;vertical-align:middle}.bar-chart-empty{color:#999}td:has(.cell-bar-chart){padding:0 0.25em;vertical-align:middle}td:has(.cell-bar-chart).pos_pos:before,td:has(.cell-bar-chart).pos_neg:before,td:has(.cell-bar-chart).pos_neu:before{content:none}td:has(.cell-bar-chart).variance:after{content:none}'}},[1,"bn-table-renderer",{tableName:[1,"table-name"],dataVersion:[2,"data-version"],selectedStyle:[513,"selected-style"],sumTitle:[1,"sum-title"],scenarios:[16],scenariosDataFormat:[1,"scenarios-data-format"],grouped:[4],limit:[2],showGroupTitle:[4,"show-group-title"],thereof:[16],partof:[16],order:[16],categorythereof:[16],attributeColumns:[16],type:[1],categoryWidth:[1,"category-width"],dataFormatDigits:[16],ruleSetConfig:[16],i18n:[1040],i18nMode:[1,"i18n-mode"],measureScale:[1,"measure-scale"],measureUnit:[1,"measure-unit"],showMeasureScale:[4,"show-measure-scale"],measureType:[1,"measure-type"],filter:[1],barColumns:[16],interval:[1],barColumnMaxWidth:[2,"bar-column-max-width"],unitScaling:[2,"unit-scaling"],percentageScaling:[2,"percentage-scaling"],reportAutoScaling:[16],errors:[16],scaleFactor:[2,"scale-factor"],getLayoutDetail:[64]}]);function _t(){"undefined"!=typeof customElements&&["bn-table-renderer"].forEach((t=>{"bn-table-renderer"===t&&(customElements.get(n(t))||customElements.define(n(t),Nt))}))}export{Nt as B,z as I,H as T,V as a,_t as d}
@@ -0,0 +1 @@
1
+ import{g as o,f as t}from"./p-D6YGOYV1.js";import{g as s,c as n}from"./p-BVKLCz2k.js";import{r as f}from"./p-DEHnizot.js";const c=c=>{let p,i;const r=()=>{"function"==typeof c.validateUnitScaling&&c.validateUnitScaling(c.unitScaling),"function"==typeof c.validatePercentageScaling&&c.validatePercentageScaling(c.percentageScaling),"function"==typeof c.validateSizeScaling&&c.validateSizeScaling()},e=c.connectedCallback;c.connectedCallback=()=>{const n=o(c);i=s(n),(()=>{const o=i.scalingGroups.state;for(const t of Object.keys(o))void 0!==o[t]?c.pixelPerUnitGroupMap.set(t,o[t]):c.pixelPerUnitGroupMap.delete(t)})(),r(),p=i.scalingGroups.on("set",((s,n)=>{void 0!==n?c.pixelPerUnitGroupMap.set(s,n):c.pixelPerUnitGroupMap.delete(s),r(),t(o(c))})),f(e,c)};const a=c.disconnectedCallback;c.disconnectedCallback=()=>{f(p),n(o(c)),f(a,c)}};export{c as w}
@@ -0,0 +1 @@
1
+ import{r as n}from"./p-COqIkH1M.js";import{r as i,a as t}from"./p-CckAR27O.js";import{m as e}from"./p-B1nL0yOa.js";import{LAYOUT_STATE_VERSION as o}from"./index.js";const r=/^Scenario([1-4])$/,l=/^stacked_(?:col|bar)_(\d+)_seg_\d+$/,d='g[id^="stacked_col_"], g[id^="stacked_bar_"]';function a(n,i){var t;let e=n.parentElement;for(;e&&e!==i;){const n=r.exec(null!==(t=e.id)&&void 0!==t?t:"");if(n)return`scenario${n[1]}`;e=e.parentElement}}function s(n){if(""===n)return;const i=Number(n.split("_")[0]);return Number.isFinite(i)?i:void 0}function c(n){const i=n.getAttribute("data-bn-index");return null===i?void 0:Number(i)}function u(n,i){var t;return(null!==(t=n.getAttribute("class"))&&void 0!==t?t:"").split(/\s+/).includes(i)}function v(i,t,o,r,v){var f,g;const m={regions:[],barCount:0},b=[];return Array.from(null!==(g=null===(f=i.shadowRoot)||void 0===f?void 0:f.querySelectorAll(t))&&void 0!==g?g:[]).forEach(((i,t)=>{var f,g,x,p;const k=null!==(f=o[t])&&void 0!==f?f:`segment${t}`,_=null===(g=i.shadowRoot)||void 0===g?void 0:g.querySelector("svg#drawCanvas");if(_&&(m.regions.push({id:`canvas:${k}`,rect:e(_,r)}),0===t&&(m.barCount=function(n){const i=n.querySelector('g[id="Scenario1"]');if(i)return Array.from(i.children).filter((n=>{var i;return/^\d+$/.test(null!==(i=n.id)&&void 0!==i?i:"")})).length;const t=new Set;return n.querySelectorAll(d).forEach((n=>{const i=l.exec(n.id);i&&n.querySelector("rect")&&t.add(i[1])})),t.size}(_)),"full"===v&&b.push(...function(i,t,o){const r=[],v=new Set;return i.querySelectorAll('g[id$="_RECT"]').forEach(((l,d)=>{var c;v.add(l);const u={kind:"bar",id:l.id,segment:t,scenario:a(l,i),index:null!==(c=s(l.id))&&void 0!==c?c:d,rect:e(l,o),point:n(l)};r.push(u)})),i.querySelectorAll(d).forEach((i=>{var d,a,s;const c=l.exec(i.id);if(!c||!i.querySelector("rect"))return;v.add(i);const u=n(i),f={kind:"bar",id:i.id,segment:t,scenario:`stack:${null!==(s=null!==(a=null!==(d=null==u?void 0:u.scenario)&&void 0!==d?d:null==u?void 0:u.subCategory)&&void 0!==a?a:null==u?void 0:u.category)&&void 0!==s?s:""}`,index:Number(c[1]),rect:e(i,o),point:u};r.push(f)})),["DATA","SCENARIO"].forEach((l=>{i.querySelectorAll(`g[id$="_${l}_Label"]`).forEach(((i,d)=>{var a,c,f;if(u(i,"hide"))return;const g=null!==(c=null===(a=i.textContent)||void 0===a?void 0:a.trim())&&void 0!==c?c:"";if(!g)return;v.add(i);const m={kind:"label",id:i.id,role:"DATA"===l?"data":"scenario",text:g,segment:t,index:null!==(f=s(i.id))&&void 0!==f?f:d,rect:e(i,o),point:n(i)};r.push(m)}))})),i.querySelectorAll("[data-bn-part]").forEach(((l,d)=>{var a,u,f;if(v.has(l))return;const g=n(l),m=null!==(a=c(l))&&void 0!==a?a:function(n,i){var t;for(let e=n;e&&e!==i;e=e.parentElement){const n=s(null!==(t=e.id)&&void 0!==t?t:"");if(void 0!==n)return n}}(l,i);if("element"===g.part){const n={kind:"point",series:g.scenario,index:null!=m?m:d,rect:e(l,o),point:g};return void r.push(n)}const b={kind:"label",id:l.id||void 0,role:"data",text:null!==(f=null===(u=l.textContent)||void 0===u?void 0:u.trim())&&void 0!==f?f:"",segment:t,index:m,rect:e(l,o),point:g};r.push(b)})),i.querySelectorAll('g[id="axis"] line').forEach((n=>{var i;const l=(null!==(i=n.getAttribute("class"))&&void 0!==i?i:"").split(/\s+/).find((n=>n.startsWith("axis-"))),d=e(n,o),a={kind:"axis",style:null==l?void 0:l.slice(5),orientation:d.context.width>=d.context.height?"horizontal":"vertical",segment:t,rect:d};r.push(a)})),i.querySelectorAll('g[id="AxisAndDateLables"] text, g[id="AxisAndDateLabelsLine"] text').forEach((n=>{var l,d;if(u(n,"hide")||function(n,i){var t;let e=n.parentElement;for(;e&&e!==i;){if((null!==(t=e.id)&&void 0!==t?t:"").endsWith("_Label"))return!0;e=e.parentElement}return!1}(n,i))return;const a=null!==(d=null===(l=n.textContent)||void 0===l?void 0:l.trim())&&void 0!==d?d:"";if(!a)return;const s={kind:"label",role:u(n,"categories")?"title":"category",text:a,segment:t,rect:e(n,o)};r.push(s)})),r}(_,k,r))),"full"===v){const n=null===(x=i.shadowRoot)||void 0===x?void 0:x.querySelector(".footer"),t=null===(p=null==n?void 0:n.textContent)||void 0===p?void 0:p.trim();t&&b.push({kind:"label",role:"footer",text:t,segment:k,rect:e(n,r)})}})),"full"===v&&(m.elements=b),m}function f(r,l,d,a,s,u){var v,f,g,m;const b={version:o,tag:r.localName,id:t(r),slot:null!==(v=r.getAttribute("slot"))&&void 0!==v?v:void 0,rect:e(r,s),em:a,regions:[],metadata:{title:d},diagnostics:i(r)},x=null===(m=null===(g=null===(f=r.shadowRoot)||void 0===f?void 0:f.querySelector(l))||void 0===g?void 0:g.shadowRoot)||void 0===m?void 0:m.querySelector("svg#drawCanvas");return x&&(b.regions.push({id:"canvas",rect:e(x,s)}),b.metadata.pointCount=x.querySelectorAll("circle, ellipse").length,"full"===u&&(b.elements=function(i,t){const o=[];return i.querySelectorAll("circle, ellipse").forEach(((i,r)=>{const l={kind:"point",index:r,rect:e(i,t),point:n(i)};o.push(l)})),i.querySelectorAll('rect[data-bn-part="element"]').forEach(((i,r)=>{var l;const d=n(i),a={kind:"bar",segment:"base",scenario:null==d?void 0:d.scenario,index:null!==(l=c(i))&&void 0!==l?l:r,rect:e(i,t),point:d};o.push(a)})),i.querySelectorAll("text").forEach((i=>{var r,l;const d=null!==(l=null===(r=i.textContent)||void 0===r?void 0:r.trim())&&void 0!==l?l:"";if(!d)return;const a={kind:"label",role:"data",text:d,rect:e(i,t),point:n(i)};o.push(a)})),o}(x,s))),b}export{v as a,f as c}
@@ -0,0 +1 @@
1
+ import{D as t}from"./p-DEHnizot.js";var n,a,s,o,e,r,c,i;!function(t){t.ALL="all",t.META="meta"}(n||(n={})),function(t){t.CURRENCY="currency",t.VOLUME="volume"}(a||(a={})),function(t){t.AC1="ac1",t.AC2="ac2",t.AC3="ac3",t.AC4="ac4",t.PP1="pp1",t.PP2="pp2",t.PP3="pp3",t.PP4="pp4",t.FC1="fc1",t.FC2="fc2",t.FC3="fc3",t.FC4="fc4",t.PL1="pl1",t.PL2="pl2",t.PL3="pl3",t.PL4="pl4"}(s||(s={})),function(t){t.POS="pos",t.NEG="neg",t.NEU="neu"}(o||(o={})),function(t){t.DECIMAL="decimal",t.PERCENT="percent"}(e||(e={})),function(t){t.LIST="list",t.SUM="sum",t.SUMNOTOTAL="sumnototal",t.OPT="opt",t.OPTNOTOTAL="optnototal"}(r||(r={})),function(t){t.INF="inf",t.W100="w100",t.W50="w50",t.W25="w25",t.W20="w20",t.W15="w15",t.W10="w10",t.W5="w5"}(c||(c={})),function(t){t.W5="w5",t.W10="w10",t.W15="w15",t.W20="w20",t.W25="w25",t.W30="w30",t.W40="w40",t.W60="w60",t.W80="w80",t.W100="w100"}(i||(i={}));const u={[i.W5]:5,[i.W10]:10,[i.W15]:15,[i.W20]:20,[i.W25]:25,[i.W30]:30,[i.W40]:40,[i.W60]:60,[i.W80]:80,[i.W100]:100};var f,l,p,w,m,b;!function(t){t.ROWGROUP="rowGroup",t.ROWGROUPINDEX="rowGroupIndex",t.CATEGORY="category",t.CATEGORYINDEX="categoryIndex",t.SUBCATEGORY="subCategory",t.SUBCATEGORYINDEX="subCategoryIndex"}(f||(f={})),function(t){t.SMART="smart",t.LONG="long",t.SHORT="short"}(l||(l={})),function(t){t.COLUMN="column",t.LINE="line",t.WATERFALL="waterfall"}(p||(p={})),function(t){t.BAR="bar",t.LINE="line",t.AUTO="auto"}(w||(w={})),function(t){t.SCENARIOS="scenarios",t.DIMENSIONS="dimensions"}(m||(m={})),function(t){t.ABSOLUTE="absolute",t.RELATIVE="relative",t.ABSOLUTE_RELATIVE="absolute-relative"}(b||(b={}));const y=100;var g;!function(t){t.ASC="asc",t.DESC="desc",t.DATASET="dataset"}(g||(g={}));class d{static isExisting(t){return null!=t}static isString(t){return"string"==typeof t}static isNumber(t){return"number"==typeof t&&!Number.isNaN(t)}static isBoolean(t){return"boolean"==typeof t}static isArray(t){return Array.isArray(t)}static isObject(t){return"object"==typeof t&&null!==t}static isOperator(t){return"+"===t||"-"===t}static isDate(n){return n instanceof t&&n.isValid}}export{f as A,u as B,d as C,e as D,n as I,a as M,y as R,s as S,i as T,o as a,l as b,r as c,c as d,m as e,g as f,b as g,w as h}
@@ -0,0 +1 @@
1
+ import{p as e,H as t,h as o,a as s,t as n}from"./p-D6YGOYV1.js";import{w as i}from"./p-DEHnizot.js";import{w as r}from"./p-jbp6YiHf.js";import{w as a}from"./p-CGI6XIaK.js";const d=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.pageNumber=null,this.displayPageNumber=!0,i(this),this.errors=a(this),this.componentStyle=r(this)}getFontStyles(){return this.componentStyle((e=>{var t,o,s,n;return{"--bn-font-family":(null===(t=e.global)||void 0===t?void 0:t.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":`${(null===(o=e.global)||void 0===o?void 0:o.fontSizePx)||13.3333}px`,"--bn-font-color":(null===(s=e.global)||void 0===s?void 0:s.fontColor)||"#000000","--bn-font-background":(null===(n=e.global)||void 0===n?void 0:n.fontBackgroundColor)||"#ffffff"}}))}render(){return o(s,{key:"af4dda021b22094c4c55e25eb34da67dc1a8e41d",id:this.displayPageNumber||this.text?"container-page-footer":"container",style:this.getFontStyles()},o("div",{key:"f059b4ca265505730e9e384704d3b74579e3af9f",id:"footer-text"},null!=this.text?o("span",{class:"note"},this.text):""),o("div",{key:"0c00b17953457763640c4ebad3e0eb99ea742bfd",id:"page-number"},this.displayPageNumber?o("span",{class:"page"},this.pageNumber):""))}get element(){return this}static get style(){return':host{padding:0.2em 0.5em;display:flex;flex-direction:row;justify-content:space-between;gap:1em;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000)}:host(#container-page-footer){box-sizing:border-box;-webkit-box-sizing:border-box;border-top:0.1em solid #ddd}div#footer-text{font-size:0.6em;display:inline}div#page-number{font-size:0.6em;display:inline}'}},[1,"bn-footer",{selectedStyle:[513,"selected-style"],pageNumber:[1025,"page-number"],text:[1025],displayPageNumber:[4,"display-page-number"]}]);function f(){"undefined"!=typeof customElements&&["bn-footer"].forEach((e=>{"bn-footer"===e&&(customElements.get(n(e))||customElements.define(n(e),d))}))}export{d as F,f as d}