@bino-bi/bn-template-engine 1.0.0-next.21 → 1.0.0-next.23

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 (164) hide show
  1. package/dist/bn-template-engine/bn-template-engine.esm.js +1 -1
  2. package/dist/bn-template-engine/{p-28d5c266.entry.js → p-0a49cf00.entry.js} +1 -1
  3. package/dist/bn-template-engine/{p-b9e94127.entry.js → p-22b8d044.entry.js} +1 -1
  4. package/dist/bn-template-engine/{p-6c7f0076.entry.js → p-251bb53d.entry.js} +1 -1
  5. package/dist/bn-template-engine/p-2aed639e.entry.js +1 -0
  6. package/dist/bn-template-engine/{p-7e9dbc93.entry.js → p-4616b879.entry.js} +1 -1
  7. package/dist/bn-template-engine/{p-99477a27.entry.js → p-629edcca.entry.js} +1 -1
  8. package/dist/bn-template-engine/p-686d8e44.entry.js +1 -0
  9. package/dist/bn-template-engine/{p-a4ea9a79.entry.js → p-68aa61cc.entry.js} +1 -1
  10. package/dist/bn-template-engine/{p-DwYUTvvI.js → p-B5x8M8OC.js} +1 -1
  11. package/dist/bn-template-engine/{p-fFtEvsY-.js → p-BGrnfif3.js} +1 -1
  12. package/dist/bn-template-engine/{p-6lOdN-fB.js → p-BVfLus3u.js} +1 -1
  13. package/dist/bn-template-engine/{p-CJThzFZm.js → p-BcZ5GQZ8.js} +1 -1
  14. package/dist/bn-template-engine/{p-CYE0I1Mx.js → p-Bca5V28_.js} +1 -1
  15. package/dist/bn-template-engine/p-C5UYpZUU.js +2 -0
  16. package/dist/bn-template-engine/{p-BgIpdpfH.js → p-C7T4DAAW.js} +1 -1
  17. package/dist/bn-template-engine/p-CDo04UEU.js +1 -0
  18. package/dist/bn-template-engine/p-CTrNbSXN.js +1 -0
  19. package/dist/bn-template-engine/{p-C5uvAEKI.js → p-CbciPY-M.js} +1 -1
  20. package/dist/bn-template-engine/{p-BpWWgN6k.js → p-CuR4S456.js} +1 -1
  21. package/dist/bn-template-engine/p-DWtTjg0f.js +1 -0
  22. package/dist/bn-template-engine/{p-eEfqksk-.js → p-DdqXNsKP.js} +1 -1
  23. package/dist/bn-template-engine/{p-B4JfKvVT.js → p-DtLI_CzV.js} +1 -1
  24. package/dist/bn-template-engine/p-UtNHLX1j.js +1 -0
  25. package/dist/bn-template-engine/{p-ba912130.entry.js → p-aecb5de3.entry.js} +1 -1
  26. package/dist/bn-template-engine/{p-687032d5.entry.js → p-ba43d46e.entry.js} +1 -1
  27. package/dist/bn-template-engine/{p-6077155f.entry.js → p-c476e7bb.entry.js} +1 -1
  28. package/dist/bn-template-engine/{p-2d3ea756.entry.js → p-d7c670ec.entry.js} +1 -1
  29. package/dist/bn-template-engine/{p-a1380d7c.entry.js → p-e4a584a8.entry.js} +1 -1
  30. package/dist/bn-template-engine/{p-de29986f.entry.js → p-f12fb09b.entry.js} +1 -1
  31. package/dist/bn-template-engine/p-f9a721bb.entry.js +1 -0
  32. package/dist/cjs/{AxisConfig-D7CAyPLO.js → AxisConfig-DmP4U3JM.js} +1 -1
  33. package/dist/cjs/{LabelCollisionManager-DkdQ9Xdg.js → LabelCollisionManager-Cet3WPm0.js} +2 -2
  34. package/dist/cjs/{Order-IPfAP0q8.js → Order-DlKLywO_.js} +1 -1
  35. package/dist/cjs/{SVGStyle-BD8jApd4.js → SVGStyle-D78RaNnj.js} +2 -2
  36. package/dist/cjs/{SVGVariancesStyleGroup-BaWzR951.js → SVGVariancesStyleGroup-XvNAnYYA.js} +1 -1
  37. package/dist/cjs/{VarianceMeasure-BBWTgv2e.js → VarianceMeasure-BfZLlICl.js} +4 -4
  38. package/dist/cjs/{XYChartDataRow-BoR0CTfl.js → XYChartDataRow-B0NNOqxB.js} +4 -4
  39. package/dist/cjs/bn-asset_21.cjs.entry.js +1052 -314
  40. package/dist/cjs/bn-chart-bubble.cjs.entry.js +25 -15
  41. package/dist/cjs/bn-chart-bullet.cjs.entry.js +9 -9
  42. package/dist/cjs/bn-chart-scatter.cjs.entry.js +9 -9
  43. package/dist/cjs/bn-grid.cjs.entry.js +6 -6
  44. package/dist/cjs/bn-image.cjs.entry.js +6 -6
  45. package/dist/cjs/bn-internationalization.cjs.entry.js +4 -4
  46. package/dist/cjs/bn-ruleset.cjs.entry.js +4 -4
  47. package/dist/cjs/bn-template-engine.cjs.js +3 -3
  48. package/dist/cjs/bn-template.cjs.entry.js +2 -2
  49. package/dist/cjs/bn-text.cjs.entry.js +7 -7
  50. package/dist/cjs/bn-tree.cjs.entry.js +6 -6
  51. package/dist/cjs/{context-protocol-BBhT9B52.js → context-protocol-DeLmu5s2.js} +1 -1
  52. package/dist/cjs/editor-companion.cjs.entry.js +2 -2
  53. package/dist/cjs/ibcs-chart-bubble.cjs.entry.js +6 -6
  54. package/dist/cjs/ibcs-chart-bullet.cjs.entry.js +6 -6
  55. package/dist/cjs/ibcs-chart-scatter.cjs.entry.js +6 -6
  56. package/dist/cjs/{index-CDKG4xmO.js → index-C1Z9vO7z.js} +61 -19
  57. package/dist/cjs/{layoutObserver-DUYYkDMQ.js → layoutObserver-CrzQQGpv.js} +5 -5
  58. package/dist/cjs/loader.cjs.js +2 -2
  59. package/dist/cjs/{scaling-BIJQ2NV1.js → scaling-JAU6IJnR.js} +85 -3
  60. package/dist/cjs/{withBodyObserver-BKUE_ypL.js → withBodyObserver-DJO98AJ-.js} +2 -2
  61. package/dist/cjs/{withHasError-Cl2gTQzA.js → withHasError-BdDmiOXM.js} +1 -1
  62. package/dist/cjs/{withScalingGroup-D5clRvRe.js → withScalingGroup-Bu5gatHT.js} +3 -3
  63. package/dist/cjs/{withStyled-Cm9dWQhu.js → withStyled-50UepUwV.js} +8 -8
  64. package/dist/collection/collection-manifest.json +1 -1
  65. package/dist/collection/components/bn-chart-bubble/bn-chart-bubble.js +15 -5
  66. package/dist/collection/components/bn-chart-structure/bn-chart-structure.css +6 -0
  67. package/dist/collection/components/bn-chart-structure/bn-chart-structure.js +149 -57
  68. package/dist/collection/components/bn-chart-structure/ibcs-chart-structure.js +135 -28
  69. package/dist/collection/components/bn-chart-structure/utils/StructureChart.js +30 -19
  70. package/dist/collection/components/bn-chart-time/bn-chart-time.js +186 -49
  71. package/dist/collection/components/bn-chart-time/ibcs-chart-time.css +9 -3
  72. package/dist/collection/components/bn-chart-time/ibcs-chart-time.js +141 -22
  73. package/dist/collection/components/bn-chart-time/utils/TimeChart.js +36 -0
  74. package/dist/collection/components/bn-scaling-group/bn-scaling-group.js +76 -19
  75. package/dist/collection/components/bn-table/bn-table.js +121 -49
  76. package/dist/collection/components/bn-table/ibcs-table.js +83 -42
  77. package/dist/collection/components/bn-table/utils/elements/CellBarChart.js +20 -34
  78. package/dist/collection/components/bn-table/utils/elements/WaterfallBar.js +4 -5
  79. package/dist/collection/components/bn-table/utils/helper/barColumnGeometry.js +89 -0
  80. package/dist/collection/utils/autoFit.js +63 -0
  81. package/dist/collection/utils/constants.js +3 -3
  82. package/dist/collection/utils/dataAnalyzer.js +17 -8
  83. package/dist/collection/utils/scaling.js +79 -0
  84. package/dist/collection/utils/validate.js +3 -3
  85. package/dist/components/DataFormatDigits.js +1 -1
  86. package/dist/components/autoFit.js +1 -0
  87. package/dist/components/bn-chart-bubble.js +1 -1
  88. package/dist/components/bn-chart-bullet.js +1 -1
  89. package/dist/components/bn-chart-scatter.js +1 -1
  90. package/dist/components/bn-chart-structure.js +1 -1
  91. package/dist/components/bn-chart-time.js +1 -1
  92. package/dist/components/bn-grid.js +1 -1
  93. package/dist/components/bn-scaling-group.js +1 -1
  94. package/dist/components/bn-table.js +1 -1
  95. package/dist/components/bn-text.js +1 -1
  96. package/dist/components/bn-tree.js +1 -1
  97. package/dist/components/ibcs-chart-structure2.js +1 -1
  98. package/dist/components/ibcs-chart-time2.js +1 -1
  99. package/dist/components/ibcs-table2.js +1 -1
  100. package/dist/components/scaling.js +1 -0
  101. package/dist/components/validate.js +1 -1
  102. package/dist/components/withDataset.js +1 -1
  103. package/dist/components/withStyled.js +1 -1
  104. package/dist/esm/{AxisConfig-ByIP5J-9.js → AxisConfig-Cjy_RANi.js} +1 -1
  105. package/dist/esm/{LabelCollisionManager-DaNiDiM9.js → LabelCollisionManager-B_NUM9yq.js} +2 -2
  106. package/dist/esm/{Order-BQeJE_yi.js → Order-B-aF6Rwn.js} +1 -1
  107. package/dist/esm/{SVGStyle-BwBlY3Km.js → SVGStyle-8FfAtUF-.js} +2 -2
  108. package/dist/esm/{SVGVariancesStyleGroup-BpGW4CvN.js → SVGVariancesStyleGroup-DD4mIOjT.js} +1 -1
  109. package/dist/esm/{VarianceMeasure-CE3N8Bea.js → VarianceMeasure-DLOuIIJ7.js} +4 -4
  110. package/dist/esm/{XYChartDataRow-DeMI1JKU.js → XYChartDataRow-CKfILBFG.js} +4 -4
  111. package/dist/esm/bn-asset_21.entry.js +1052 -314
  112. package/dist/esm/bn-chart-bubble.entry.js +25 -15
  113. package/dist/esm/bn-chart-bullet.entry.js +9 -9
  114. package/dist/esm/bn-chart-scatter.entry.js +9 -9
  115. package/dist/esm/bn-grid.entry.js +6 -6
  116. package/dist/esm/bn-image.entry.js +6 -6
  117. package/dist/esm/bn-internationalization.entry.js +4 -4
  118. package/dist/esm/bn-ruleset.entry.js +4 -4
  119. package/dist/esm/bn-template-engine.js +4 -4
  120. package/dist/esm/bn-template.entry.js +2 -2
  121. package/dist/esm/bn-text.entry.js +7 -7
  122. package/dist/esm/bn-tree.entry.js +6 -6
  123. package/dist/esm/{context-protocol-d8MHrEo8.js → context-protocol-BoEL0caI.js} +1 -1
  124. package/dist/esm/editor-companion.entry.js +2 -2
  125. package/dist/esm/ibcs-chart-bubble.entry.js +6 -6
  126. package/dist/esm/ibcs-chart-bullet.entry.js +6 -6
  127. package/dist/esm/ibcs-chart-scatter.entry.js +6 -6
  128. package/dist/esm/{index-B_d-jp99.js → index-C5UYpZUU.js} +61 -19
  129. package/dist/esm/{layoutObserver-BJBEyhNf.js → layoutObserver-cgIXg2sg.js} +5 -5
  130. package/dist/esm/loader.js +3 -3
  131. package/dist/esm/{scaling-BGnpSN1j.js → scaling-CxyNpMQM.js} +83 -4
  132. package/dist/esm/{withBodyObserver-IokS6fHD.js → withBodyObserver-Cb9ZC5_J.js} +2 -2
  133. package/dist/esm/{withHasError-DW_vMDUp.js → withHasError-Bh1Viz52.js} +1 -1
  134. package/dist/esm/{withScalingGroup-CC3UcvC5.js → withScalingGroup-Yv9nGGe1.js} +3 -3
  135. package/dist/esm/{withStyled-2l5Tx3cf.js → withStyled-By9Jd-Oy.js} +8 -8
  136. package/dist/types/components/bn-chart-bubble/bn-chart-bubble.d.ts +5 -2
  137. package/dist/types/components/bn-chart-structure/bn-chart-structure.d.ts +47 -19
  138. package/dist/types/components/bn-chart-structure/ibcs-chart-structure.d.ts +17 -3
  139. package/dist/types/components/bn-chart-structure/utils/StructureChart.d.ts +11 -3
  140. package/dist/types/components/bn-chart-time/bn-chart-time.d.ts +52 -18
  141. package/dist/types/components/bn-chart-time/ibcs-chart-time.d.ts +18 -3
  142. package/dist/types/components/bn-chart-time/utils/TimeChart.d.ts +12 -0
  143. package/dist/types/components/bn-scaling-group/bn-scaling-group.d.ts +28 -8
  144. package/dist/types/components/bn-table/bn-table.d.ts +45 -19
  145. package/dist/types/components/bn-table/ibcs-table.d.ts +23 -6
  146. package/dist/types/components/bn-table/utils/elements/CellBarChart.d.ts +9 -1
  147. package/dist/types/components/bn-table/utils/helper/barColumnGeometry.d.ts +51 -0
  148. package/dist/types/components.d.ts +91 -55
  149. package/dist/types/stencil-public-runtime.d.ts +1 -0
  150. package/dist/types/utils/autoFit.d.ts +79 -0
  151. package/dist/types/utils/constants.d.ts +3 -3
  152. package/dist/types/utils/dataAnalyzer.d.ts +5 -1
  153. package/dist/types/utils/scaling.d.ts +63 -0
  154. package/dist/types/utils/validate.d.ts +2 -2
  155. package/package.json +1 -1
  156. package/readme.md +2 -0
  157. package/dist/bn-template-engine/p-2fba7c99.entry.js +0 -1
  158. package/dist/bn-template-engine/p-A8xyE4b1.js +0 -1
  159. package/dist/bn-template-engine/p-B_d-jp99.js +0 -2
  160. package/dist/bn-template-engine/p-BjBz5cSL.js +0 -1
  161. package/dist/bn-template-engine/p-C8Q0lsaU.js +0 -1
  162. package/dist/bn-template-engine/p-C9i1Xsib.js +0 -1
  163. package/dist/bn-template-engine/p-a8291de2.entry.js +0 -1
  164. package/dist/bn-template-engine/p-b5274369.entry.js +0 -1
@@ -0,0 +1 @@
1
+ import{g as o,f as t}from"./p-C5UYpZUU.js";import{g as s,c as f}from"./p-C7T4DAAW.js";import{r as n}from"./p-DtLI_CzV.js";const c=c=>{let p,r;const i=()=>{"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 f=o(c);r=s(f),(()=>{const o=r.scalingGroups.state;for(const t of Object.keys(o))void 0!==o[t]?c.pixelPerUnitGroupMap.set(t,o[t]):c.pixelPerUnitGroupMap.delete(t)})(),i(),p=r.scalingGroups.on("set",((s,f)=>{void 0!==f?c.pixelPerUnitGroupMap.set(s,f):c.pixelPerUnitGroupMap.delete(s),i(),t(o(c))})),n(e,c)};const a=c.disconnectedCallback;c.disconnectedCallback=()=>{n(p),f(o(c)),n(a,c)}};export{c as w}
@@ -0,0 +1 @@
1
+ import{g as t}from"./p-C5UYpZUU.js";import{r}from"./p-DtLI_CzV.js";const o=(o,s)=>{let a;const e=new MutationObserver((()=>{var t;a&&s(null!==(t=a.textContent)&&void 0!==t?t:"")})),i=o.connectedCallback;o.connectedCallback=()=>{var n;a=t(o),e.observe(a,{childList:!0,subtree:!0,characterData:!0}),s(null!==(n=a.textContent)&&void 0!==n?n:""),r(i,o)};const n=o.disconnectedCallback;o.disconnectedCallback=()=>{e.disconnect(),r(n,o)}};export{o as w}
@@ -1 +1 @@
1
- import{C as a}from"./p-eEfqksk-.js";class t{static adaptDefaultString(t){return a.isString(t)?t.trim():""}static adaptArray(t,r){const c=[];return a.isArray(t)&&t.forEach((a=>{c.push(r.adapt(a))})),c}}var r,c;!function(a){a.ASC="asc",a.DESC="desc"}(r||(r={})),function(a){a.ROWGROUP="rowGroup",a.ROWGROUPINDEX="rowGroupIndex",a.CATEGORY="category",a.CATEGORYINDEX="categoryIndex",a.SUBCATEGORY="subCategory",a.SUBCATEGORYINDEX="subCategoryIndex",a.AC1="ac1",a.AC2="ac2",a.AC3="ac3",a.AC4="ac4",a.PP1="pp1",a.PP2="pp2",a.PP3="pp3",a.PP4="pp4",a.FC1="fc1",a.FC2="fc2",a.FC3="fc3",a.FC4="fc4",a.PL1="pl1",a.PL2="pl2",a.PL3="pl3",a.PL4="pl4"}(c||(c={}));class s{constructor(a=["category"],t=r.ASC){this.hierarchy=a,this.direction=t}}class o{constructor(a){this.stringAdapter=a}adapt(a){var o;const e=t.adaptArray(a.hierarchy,this.stringAdapter),p=r[null===(o=a.direction)||void 0===o?void 0:o.toUpperCase()]||r.ASC;return new s(e.map((a=>c[a.toUpperCase()]||c.CATEGORY)),p)}default(){return new s(["category"],r.ASC)}}export{t as A,r as O,s as a,c as b,o as c}
1
+ import{C as a}from"./p-DdqXNsKP.js";class t{static adaptDefaultString(t){return a.isString(t)?t.trim():""}static adaptArray(t,r){const c=[];return a.isArray(t)&&t.forEach((a=>{c.push(r.adapt(a))})),c}}var r,c;!function(a){a.ASC="asc",a.DESC="desc"}(r||(r={})),function(a){a.ROWGROUP="rowGroup",a.ROWGROUPINDEX="rowGroupIndex",a.CATEGORY="category",a.CATEGORYINDEX="categoryIndex",a.SUBCATEGORY="subCategory",a.SUBCATEGORYINDEX="subCategoryIndex",a.AC1="ac1",a.AC2="ac2",a.AC3="ac3",a.AC4="ac4",a.PP1="pp1",a.PP2="pp2",a.PP3="pp3",a.PP4="pp4",a.FC1="fc1",a.FC2="fc2",a.FC3="fc3",a.FC4="fc4",a.PL1="pl1",a.PL2="pl2",a.PL3="pl3",a.PL4="pl4"}(c||(c={}));class s{constructor(a=["category"],t=r.ASC){this.hierarchy=a,this.direction=t}}class o{constructor(a){this.stringAdapter=a}adapt(a){var o;const p=t.adaptArray(a.hierarchy,this.stringAdapter),e=r[null===(o=a.direction)||void 0===o?void 0:o.toUpperCase()]||r.ASC;return new s(p.map((a=>c[a.toUpperCase()]||c.CATEGORY)),e)}default(){return new s(["category"],r.ASC)}}export{t as A,r as O,s as a,c as b,o as c}
@@ -1 +1 @@
1
- import{g as t,f as e}from"./p-B_d-jp99.js";import{g as s,c as r,D as n}from"./p-BgIpdpfH.js";import{r as a}from"./p-B4JfKvVT.js";import{m as i,S as o,b as u,A as c,c as l,T as h,D as d,d as m,M as f,e as y,r as b}from"./p-eEfqksk-.js";import{b as N,O as g}from"./p-C5uvAEKI.js";const p=n=>{let o,u,c,l;const h=()=>{const t=u.componentStyles.state;l=i([t._system||{},t._default||{},t[c]||{}],{arrayMergeType:"overwrite"})},d=new MutationObserver((s=>{s.forEach((s=>{"selected-style"===s.attributeName&&(c=t(n).getAttribute("selected-style"),h(),e(n))}))})),m=n.connectedCallback;n.connectedCallback=()=>{const r=t(n);u=s(r),l=u.componentStyles.state._system,d.observe(r,{attributes:!0,attributeFilter:["selected-style"]}),c=t(n).getAttribute("selected-style"),h(),o=u.componentStyles.on("set",(s=>{s===c&&(c=t(n).getAttribute("selected-style"),h(),e(t(n)))})),a(m,n)};const f=n.disconnectedCallback;return n.disconnectedCallback=()=>{d.disconnect(),a(o),r(t(n)),a(f,n)},t=>t(l)},v=/^\s*(set|first|last|min|max|avg|sum|lit)\(\s*(.*?)\s*\)\s*$/,S=/^[A-Za-z_][A-Za-z0-9_]*$/,k=["min","max","avg","sum"];class D{constructor(t,e,s,r){this.label=t,this.alias=e,this.fn=s,this.arg=r}get isNumeric(){return k.includes(this.fn)}}function w(t){if("string"!=typeof t)return!1;const e=v.exec(t);if(!e)return!1;const[,s,r]=e;return"lit"===s?r.length>0:S.test(r)}function T(t,e,s){if(!w(s))return null;const[,r,n]=v.exec(s);return new D(t,e,r,n)}var O,A;!function(t){t.YEAR="year",t.QUARTER="quarter",t.MONTH="month",t.WEEK="week",t.DAY="day",t.HOUR="hour",t.MINUTE="minute",t.SECOND="second",t.MILLISECOND="millisecond",t.NONE="fallback",t.AUTO="auto"}(O||(O={})),function(t){t.AVG="avg",t.INTERVAL="interval",t.START="start",t.END="end",t.YTD="ytd",t.YTG="ytg",t.CUM="cum",t.MAT="mat",t.NONE="none",t.AUTO="auto"}(A||(A={}));class M{constructor(){this._dateFormat={year:"yyyy",quarter:"q'Q' yyyy",month:"LLL yyyy",week:"'KW'WW yyyy",day:"dd.MM.yyyy",hour:"TT",minute:"TT",second:"TT",millisecond:"TT:SSS",fallback:"dd.MM.yyyy"},this._dateFormatShort={year:"yy",quarter:"q'Q'",month:"LLL",week:"'KW'WW",day:"dd",hour:"hh'h'",minute:"mm'm'",second:"ss's'",millisecond:"SSS'ms'",fallback:"dd.MM.yyyy"},this._dateLinkFormat={avg:"Ø[LINK]",interval:"[DATE]..[DATE2]",start:".[DATE]",end:"[DATE].",ytd:"_[DATE]",ytg:"[DATE]_",cum:"[DATE]_[DATE2]",mat:"~[DATE]",none:"[DATE]"},this.locale="de",this.dateFormatPinned=!1,this.dateFormatShortPinned=!1,this.dateFormat=this._dateFormat,this.dateLinkFormat=this._dateLinkFormat,this.dateFormatShort=this._dateFormatShort}setDateLinkFormat(t){this.dateLinkFormat=t}setDateFormat(t){this.dateFormat=t,this.dateFormatPinned=!0}setDateFormatShort(t){this.dateFormatShort=t,this.dateFormatShortPinned=!0}setLocale(t){this.locale=t,this.dateFormatPinned||(this.dateFormat=Object.assign(Object.assign({},this._dateFormat),M.LOCALE_DATE_FORMAT[t]||{})),this.dateFormatShortPinned||(this.dateFormatShort=Object.assign(Object.assign({},this._dateFormatShort),M.LOCALE_DATE_FORMAT_SHORT[t]||{}))}getDateString(t,e){return t.setLocale(this.locale).toFormat(this.dateFormat[e]||this.dateFormat.fallback)}getSmartDateString(t,e){switch(e){case O.DAY:return this.getFormatedDayDate(t);case O.MONTH:return this.getFormatedMonthDate(t);case O.QUARTER:return this.getFormatedQuarterDate(t);case O.WEEK:return this.getFormatedWeekDate(t);case O.HOUR:return this.getFormatedHourDate(t);case O.MINUTE:return this.getFormatedMinuteDate(t);case O.SECOND:return this.getFormatedSecondDate(t);case O.MILLISECOND:return this.getFormatedMilliSecondDate(t);default:return this.getDateString(t,e)}}calculateDistanceType(t,e,s=32){if(null==e)return O.DAY;const r="number"==typeof t?n.fromMillis(t):t,a="number"==typeof e?n.fromMillis(e):e;return 0===a.diff(r).as("milliseconds")?O.DAY:a.diff(r).as("milliseconds")<s?O.MILLISECOND:a.diff(r).as("seconds")<s?O.SECOND:a.diff(r).as("minutes")<s?O.MINUTE:a.diff(r).as("hours")<s?O.HOUR:a.diff(r).as("days")<s?O.DAY:a.diff(r).as("weeks")<s?O.WEEK:a.diff(r).as("months")<s?O.MONTH:a.diff(r).as("quarters")<s?O.QUARTER:O.YEAR}datesBetween(t,e,s,r){const n=this.convertDateDistanceToMomentunitOfTime(s),a=t.startOf(n),i=e.endOf(n);let o=i.diff(a).as(n);const u=[];o>=r&&(o=r);let c=a;do{u.push(c),c=c.plus(this.createDiratonLike(n,1))}while(c<=i&&u.length<o);return u}getDateLinkString(t,e,s,r,a){if(null==t&&null==e)return"";if(null==t&&s!==A.END&&s!==A.YTD)return"";if(null==e&&(A.INTERVAL===s||A.CUM===s||A.END===s||A.YTD===s))return"";const i=t||n.now(),o=e;r===O.AUTO&&(r=this.calculateDistanceType(i,o,a));let u=this.getDateString(i,r),c="",l=A.NONE;return null!=o&&(c=this.getDateString(o,r),l=A.INTERVAL,u===c&&s===A.INTERVAL&&(s=A.NONE),u===c&&s===A.AVG&&(l=A.NONE),A.END!==s&&A.YTD!==s||(u=c),(s===A.INTERVAL||s===A.CUM||A.AVG)&&(r===O.QUARTER?i.quarter===o.quarter&&i.year===o.year?c=c.replace(" "+o.year,""):i.year===o.year&&(u=u.replace(" "+i.year,"")):r===O.MONTH?i.month===o.month&&i.year===o.year?c=c.replace(" "+o.year,""):i.year===o.year&&(u=u.replace(" "+i.year,"")):r===O.WEEK&&(i.weekNumber===o.weekNumber&&i.year===o.year?c=c.replace(" "+o.year,""):i.year===o.year&&(u=u.replace(" "+i.year,""))))),this.dateLinkFormat[s].replace("[LINK]",this.dateLinkFormat[l]).replace("[DATE]",u).replace("[DATE2]",c)}getShortDateString(t,e){return t.setLocale(this.locale).toFormat(this.dateFormatShort[e]||this.dateFormatShort.fallback)}getFormatedDayDate(t){let e=this.dateFormatShort.day;return this.isFirstInMonth(t)&&(e+=" "+this.dateFormatShort.month),this.isJanuary(t)&&(e+=" "+this.dateFormatShort.year),t.setLocale(this.locale).toFormat(e)}getFormatedMonthDate(t){let e=this.dateFormatShort.month;return this.isJanuary(t)&&(e+=" "+this.dateFormatShort.year),t.setLocale(this.locale).toFormat(e)}getFormatedQuarterDate(t){let e=this.dateFormatShort.quarter;return this.isFirstQuarter(t)&&(e+=" "+this.dateFormatShort.year),t.setLocale(this.locale).toFormat(e)}getFormatedWeekDate(t){let e=this.dateFormatShort.week;return this.isFirstWeek(t)&&(e+=" "+this.dateFormatShort.year),t.setLocale(this.locale).toFormat(e)}getFormatedHourDate(t){let e=this.dateFormatShort.hour;return this.isFirstHour(t)&&(e+=" "+this.dateFormatShort.day),t.setLocale(this.locale).toFormat(e)}getFormatedMinuteDate(t){let e=this.dateFormatShort.minute;return this.isFirstMinute(t)&&(e=this.dateFormatShort.hour+":"+e),t.setLocale(this.locale).toFormat(e)}getFormatedSecondDate(t){let e=this.dateFormatShort.second;return this.isFirstSecond(t)&&(e=this.dateFormatShort.minute+":"+e),t.setLocale(this.locale).toFormat(e)}getFormatedMilliSecondDate(t){let e=this.dateFormatShort.millisecond;return this.isFirstMilliSecond(t)&&(e=this.dateFormatShort.second+":"+e),t.setLocale(this.locale).toFormat(e)}isFirstInMonth(t){return 1===t.day}isJanuary(t){return 1===t.month}isFirstQuarter(t){return 1===t.quarter}isFirstWeek(t){return 1===t.weekNumber}isFirstHour(t){return 0===t.hour}isFirstMinute(t){return 0===t.minute}isFirstSecond(t){return 0===t.second}isFirstMilliSecond(t){return 0===t.millisecond}convertDateDistanceToMomentunitOfTime(t){let e;switch(t){case O.YEAR:e="year";break;case O.MONTH:e="month";break;case O.QUARTER:e="quarter";break;case O.WEEK:e="week";break;case O.DAY:e="day";break;case O.HOUR:e="hour";break;case O.MINUTE:e="minute";break;case O.SECOND:e="second";break;case O.MILLISECOND:e="millisecond";break;default:e="day"}return e}createDiratonLike(t,e){switch(t){case"year":return{years:e};case"month":return{months:e};case"quarter":return{quarters:e};case"week":return{weeks:e};case"day":default:return{days:e};case"hour":return{hours:e};case"minute":return{minutes:e};case"second":return{seconds:e};case"millisecond":return{milliseconds:e}}}}function J(t){return null==t||""===t||"null"===t}function F(t){return J(t)||"auto"===t.trim().toLowerCase()?[]:E((null==t?void 0:t.split(",").filter((t=>!(t.toUpperCase().trim()in o)))).toString())}function E(t){return J(t)?[]:t.replace(";",",").split(",").filter((t=>{var e,s,r;const n=t.split("_"),a=null===(e=n[0])||void 0===e?void 0:e.replace(/^dr|^d/,"").toUpperCase().trim(),i=null===(s=n[1])||void 0===s?void 0:s.toUpperCase().trim(),c=null===(r=n[2])||void 0===r?void 0:r.toUpperCase().trim();return 3!==n.length||!(a in o)||!(i in o)||!(c in u)}))}function j(t){return J(t)?[]:E(t.split(",").filter((t=>!(t.toUpperCase().trim()in o))).toString())}function L(t){return J(t)||"auto"===t.trim().toLowerCase()?[]:E(t.split(",").filter((t=>!(t.toUpperCase()in N))).toString())}function W(t){return!J(t)&&Number.isInteger(Number(t))}function $(t){return!J(t)&&!Number.isNaN(Number(t))}function q(t){return!J(t)&&(null==t?void 0:t.toUpperCase())in g}function I(t){return"auto"===(null==t?void 0:t.toLowerCase())||(null==t?void 0:t.toUpperCase())in c}function _(t){if(J(t))return[];try{const e=JSON.parse(t);if(e instanceof Array)return e.filter((t=>!(t.hasOwnProperty("name")&&t.hasOwnProperty("unit"))))}catch(t){console.error("validateMeasureList: failed to parse JSON",t)}return["Invalid JSON structure"]}function z(t){const e=Date.parse(t);return Number.isInteger(e)}function x(t){return(null==t?void 0:t.toUpperCase())in A}function G(t){return(null==t?void 0:t.toUpperCase())in O}function K(t){return(null==t?void 0:t.toUpperCase())in l}function B(t){return!J(t)&&(null==t?void 0:t.toUpperCase())in d}function C(t){return!J(t)&&["true","false",!0,!1].some((e=>e===t))}function H(t){return!J(t)&&(null==t?void 0:t.toUpperCase())in m}function Q(t){if(J(t))return[];try{const e=JSON.parse(t);if(e instanceof Array)return e.filter((t=>!(t.hasOwnProperty("rowGroup")&&t.hasOwnProperty("category")&&t.hasOwnProperty("subCategory"))))}catch(t){console.error("validateThereOfJsonStr: failed to parse JSON",t)}return["Invalid JSON structure"]}function P(t){if(J(t))return[];try{const e=JSON.parse(t);if(null!==e&&"object"==typeof e&&!(e instanceof Array))return Object.entries(e).filter((([,t])=>"string"!=typeof t||!w(t))).map((([t,e])=>`${t}: ${e}`))}catch(t){console.error("validateAttributesJsonStr: failed to parse JSON",t)}return["Invalid JSON structure"]}function Z(t){if(J(t))return[];try{const e=JSON.parse(t);if(e instanceof Array)return e.filter((t=>!(t.hasOwnProperty("rowGroup")&&t.hasOwnProperty("category"))))}catch(t){console.error("validatePartOfJsonStr: failed to parse JSON",t)}return["Invalid JSON structure"]}function R(t){return(null==t?void 0:t.trim().toUpperCase())in f}function V(t){return["_","k","M","G","T","P","E","Z","Y","m","μ","n","p","P","f","a","z","y"].includes(null==t?void 0:t.trim())||["GREATEST","LEAST"].includes(null==t?void 0:t.trim().toUpperCase())}function Y(t){return(null==t?void 0:t.toUpperCase().trim())in y}function U(t){return(null==t?void 0:t.toUpperCase().trim())in h}function X(t){if(J(t))return[];try{return JSON.parse(t).filter((t=>!(t.hasOwnProperty("scenario")&&t.hasOwnProperty("name")&&t.hasOwnProperty("subGroups"))))}catch(t){console.error("validateColumnThereOfJsonStr: failed to parse JSON",t)}return["Invalid JSON structure"]}function tt(t){if(J(t))return[];try{const e=JSON.parse(t);if("object"!=typeof e||null===e||Array.isArray(e))return["stack: must be a JSON object"];const s=[];if(e.hasOwnProperty("by")){const t=["scenarios","dimensions"];t.includes(e.by)||s.push(`stack: 'by' must be one of: ${t.join(", ")}`)}else s.push("stack: 'by' is required");if(e.hasOwnProperty("mode")){const t=["absolute","relative","absolute-relative"];t.includes(e.mode)||s.push(`stack: 'mode' must be one of: ${t.join(", ")}`)}if(e.hasOwnProperty("order")){const t=["asc","desc","dataset"];t.includes(e.order)||s.push(`stack: 'order' must be one of: ${t.join(", ")}`)}return s}catch(t){return["stack: invalid JSON"]}}function et(t){return!J(t)&&null!==b(t)}M.LOCALE_DATE_FORMAT={en:{week:"'W'WW yyyy",day:"MM/dd/yyyy",fallback:"MM/dd/yyyy"}},M.LOCALE_DATE_FORMAT_SHORT={en:{week:"'W'WW",fallback:"MM/dd/yyyy"}};class st{constructor(){this.cache=new Map,this.tag=st.makeStyleTag()}static makeStyleTag(){const t=document.createElement("style");return t.type="text/css",t.setAttribute("data-bn-computed-style",""),t.append(document.createTextNode("")),(document.head||document.querySelector("head")).append(t),t}apply(t){t.forEach((t=>this.cache.set(t.className,t.style))),this.tag.innerHTML=Array.from(this.cache.values()).map((t=>t)).join("\n")}}const rt=new st;function nt(t){for(var e,s=0,r=0,n=t.length;n>=4;++r,n-=4)e=1540483477*(65535&(e=255&t.charCodeAt(r)|(255&t.charCodeAt(++r))<<8|(255&t.charCodeAt(++r))<<16|(255&t.charCodeAt(++r))<<24))+(59797*(e>>>16)<<16),s=1540483477*(65535&(e^=e>>>24))+(59797*(e>>>16)<<16)^1540483477*(65535&s)+(59797*(s>>>16)<<16);switch(n){case 3:s^=(255&t.charCodeAt(r+2))<<16;case 2:s^=(255&t.charCodeAt(r+1))<<8;case 1:s=1540483477*(65535&(s^=255&t.charCodeAt(r)))+(59797*(s>>>16)<<16)}return(((s=1540483477*(65535&(s^=s>>>13))+(59797*(s>>>16)<<16))^s>>>15)>>>0).toString(36)}const at=t=>$(t)?`${t}px`:t,it={width:{className:"w",cssName:"width",attrName:"width",transform:at},height:{className:"h",cssName:"height",attrName:"height",transform:at},position:{className:"pst",cssName:"position",attrName:"position"},top:{className:"top",cssName:"top",attrName:"top",transform:at},right:{className:"rgt",cssName:"right",attrName:"right",transform:at},bottom:{className:"btm",cssName:"bottom",attrName:"bottom",transform:at},left:{className:"lft",cssName:"left",attrName:"left",transform:at},"font-size":{className:"fts",cssName:"font-size",attrName:"font-size",transform:at},"grid-column":{className:"gdc",cssName:"grid-column",attrName:"grid-column"},"grid-row":{className:"gdr",cssName:"grid-row",attrName:"grid-row"}},ot=Object.keys(it);function ut(t,e){const s=function(t,e){const s=nt(e);return`bn-c-${t.className}_${s}`}(t,e),r=function(t,e,s){return`.${e} {${t.cssName}: ${s};}`}(t,s,e);return{className:s,style:r}}const ct=t=>{const e=new Map;return ot.forEach((s=>{const r=t.getAttribute(s);r&&(["top","left","right","bottom"].includes(s)&&e.set("position",ut(it.position,"absolute")),e.set(s,ut(it[s],(it[s].transform||function(t){return t})(r))))})),e},lt=new MutationObserver((t=>{for(const s of t){const t=s.target,r=ct(t);rt.apply(r);const n=Array.from(r.values()).map((t=>t.className));t.className=t.className.split(" ").filter((t=>!t.startsWith("bn-c-"))).concat(...n).join(" "),e(t)}})),ht=e=>{const s=e.connectedCallback,r=e.disconnectedCallback;e.connectedCallback=()=>{const r=t(e);if(!r)throw new Error("Can't find element field in component undefined");(t=>{const e=ct(t);rt.apply(e);const s=Array.from(e.values()).map((t=>t.className));t.className=t.className.split(" ").filter((t=>!t.startsWith("bn-c-"))).concat(...s).join(" "),lt.observe(t,{attributes:!0,attributeFilter:ot,childList:!1,subtree:!1})})(r),a(s,e)},e.disconnectedCallback=()=>{a(r,e)}};export{X as A,P as B,T as C,O as D,_ as E,z as F,x as G,A as H,W as a,p as b,et as c,q as d,C as e,$ as f,F as g,E as h,J as i,I as j,V as k,tt as l,G as m,K as n,nt as o,M as p,j as q,U as r,B as s,H as t,Q as u,L as v,ht as w,Z as x,R as y,Y as z}
1
+ import{g as t,f as e}from"./p-C5UYpZUU.js";import{g as s,c as r,D as n}from"./p-C7T4DAAW.js";import{r as a}from"./p-DtLI_CzV.js";import{m as i,S as o,b as u,A as c,c as l,T as h,D as d,d as m,M as f,e as y,r as b}from"./p-DdqXNsKP.js";import{b as N,O as g}from"./p-CbciPY-M.js";const p=n=>{let o,u,c,l;const h=()=>{const t=u.componentStyles.state;l=i([t._system||{},t._default||{},t[c]||{}],{arrayMergeType:"overwrite"})},d=new MutationObserver((s=>{s.forEach((s=>{"selected-style"===s.attributeName&&(c=t(n).getAttribute("selected-style"),h(),e(n))}))})),m=n.connectedCallback;n.connectedCallback=()=>{const r=t(n);u=s(r),l=u.componentStyles.state._system,d.observe(r,{attributes:!0,attributeFilter:["selected-style"]}),c=t(n).getAttribute("selected-style"),h(),o=u.componentStyles.on("set",(s=>{s===c&&(c=t(n).getAttribute("selected-style"),h(),e(t(n)))})),a(m,n)};const f=n.disconnectedCallback;return n.disconnectedCallback=()=>{d.disconnect(),a(o),r(t(n)),a(f,n)},t=>t(l)},v=/^\s*(set|first|last|min|max|avg|sum|lit)\(\s*(.*?)\s*\)\s*$/,S=/^[A-Za-z_][A-Za-z0-9_]*$/,D=["min","max","avg","sum"];class k{constructor(t,e,s,r){this.label=t,this.alias=e,this.fn=s,this.arg=r}get isNumeric(){return D.includes(this.fn)}}function w(t){if("string"!=typeof t)return!1;const e=v.exec(t);if(!e)return!1;const[,s,r]=e;return"lit"===s?r.length>0:S.test(r)}function T(t,e,s){if(!w(s))return null;const[,r,n]=v.exec(s);return new k(t,e,r,n)}var O,A;!function(t){t.YEAR="year",t.QUARTER="quarter",t.MONTH="month",t.WEEK="week",t.DAY="day",t.HOUR="hour",t.MINUTE="minute",t.SECOND="second",t.MILLISECOND="millisecond",t.NONE="fallback",t.AUTO="auto"}(O||(O={})),function(t){t.AVG="avg",t.INTERVAL="interval",t.START="start",t.END="end",t.YTD="ytd",t.YTG="ytg",t.CUM="cum",t.MAT="mat",t.NONE="none",t.AUTO="auto"}(A||(A={}));class M{constructor(){this._dateFormat={year:"yyyy",quarter:"q'Q' yyyy",month:"LLL yyyy",week:"'KW'WW yyyy",day:"dd.MM.yyyy",hour:"TT",minute:"TT",second:"TT",millisecond:"TT:SSS",fallback:"dd.MM.yyyy"},this._dateFormatShort={year:"yy",quarter:"q'Q'",month:"LLL",week:"'KW'WW",day:"dd",hour:"hh'h'",minute:"mm'm'",second:"ss's'",millisecond:"SSS'ms'",fallback:"dd.MM.yyyy"},this._dateLinkFormat={avg:"Ø[LINK]",interval:"[DATE]..[DATE2]",start:".[DATE]",end:"[DATE].",ytd:"_[DATE]",ytg:"[DATE]_",cum:"[DATE]_[DATE2]",mat:"~[DATE]",none:"[DATE]"},this.locale="de",this.dateFormatPinned=!1,this.dateFormatShortPinned=!1,this.dateFormat=this._dateFormat,this.dateLinkFormat=this._dateLinkFormat,this.dateFormatShort=this._dateFormatShort}setDateLinkFormat(t){this.dateLinkFormat=t}setDateFormat(t){this.dateFormat=t,this.dateFormatPinned=!0}setDateFormatShort(t){this.dateFormatShort=t,this.dateFormatShortPinned=!0}setLocale(t){this.locale=t,this.dateFormatPinned||(this.dateFormat=Object.assign(Object.assign({},this._dateFormat),M.LOCALE_DATE_FORMAT[t]||{})),this.dateFormatShortPinned||(this.dateFormatShort=Object.assign(Object.assign({},this._dateFormatShort),M.LOCALE_DATE_FORMAT_SHORT[t]||{}))}getDateString(t,e){return t.setLocale(this.locale).toFormat(this.dateFormat[e]||this.dateFormat.fallback)}getSmartDateString(t,e){switch(e){case O.DAY:return this.getFormatedDayDate(t);case O.MONTH:return this.getFormatedMonthDate(t);case O.QUARTER:return this.getFormatedQuarterDate(t);case O.WEEK:return this.getFormatedWeekDate(t);case O.HOUR:return this.getFormatedHourDate(t);case O.MINUTE:return this.getFormatedMinuteDate(t);case O.SECOND:return this.getFormatedSecondDate(t);case O.MILLISECOND:return this.getFormatedMilliSecondDate(t);default:return this.getDateString(t,e)}}calculateDistanceType(t,e,s=32){if(null==e)return O.DAY;const r="number"==typeof t?n.fromMillis(t):t,a="number"==typeof e?n.fromMillis(e):e;return 0===a.diff(r).as("milliseconds")?O.DAY:a.diff(r).as("milliseconds")<s?O.MILLISECOND:a.diff(r).as("seconds")<s?O.SECOND:a.diff(r).as("minutes")<s?O.MINUTE:a.diff(r).as("hours")<s?O.HOUR:a.diff(r).as("days")<s?O.DAY:a.diff(r).as("weeks")<s?O.WEEK:a.diff(r).as("months")<s?O.MONTH:a.diff(r).as("quarters")<s?O.QUARTER:O.YEAR}datesBetween(t,e,s,r){const n=this.convertDateDistanceToMomentunitOfTime(s),a=t.startOf(n),i=e.endOf(n);let o=i.diff(a).as(n);const u=[];o>=r&&(o=r);let c=a;do{u.push(c),c=c.plus(this.createDiratonLike(n,1))}while(c<=i&&u.length<o);return u}getDateLinkString(t,e,s,r,a){if(null==t&&null==e)return"";if(null==t&&s!==A.END&&s!==A.YTD)return"";if(null==e&&(A.INTERVAL===s||A.CUM===s||A.END===s||A.YTD===s))return"";const i=t||n.now(),o=e;r===O.AUTO&&(r=this.calculateDistanceType(i,o,a));let u=this.getDateString(i,r),c="",l=A.NONE;return null!=o&&(c=this.getDateString(o,r),l=A.INTERVAL,u===c&&s===A.INTERVAL&&(s=A.NONE),u===c&&s===A.AVG&&(l=A.NONE),A.END!==s&&A.YTD!==s||(u=c),(s===A.INTERVAL||s===A.CUM||A.AVG)&&(r===O.QUARTER?i.quarter===o.quarter&&i.year===o.year?c=c.replace(" "+o.year,""):i.year===o.year&&(u=u.replace(" "+i.year,"")):r===O.MONTH?i.month===o.month&&i.year===o.year?c=c.replace(" "+o.year,""):i.year===o.year&&(u=u.replace(" "+i.year,"")):r===O.WEEK&&(i.weekNumber===o.weekNumber&&i.year===o.year?c=c.replace(" "+o.year,""):i.year===o.year&&(u=u.replace(" "+i.year,""))))),this.dateLinkFormat[s].replace("[LINK]",this.dateLinkFormat[l]).replace("[DATE]",u).replace("[DATE2]",c)}getShortDateString(t,e){return t.setLocale(this.locale).toFormat(this.dateFormatShort[e]||this.dateFormatShort.fallback)}getFormatedDayDate(t){let e=this.dateFormatShort.day;return this.isFirstInMonth(t)&&(e+=" "+this.dateFormatShort.month),this.isJanuary(t)&&(e+=" "+this.dateFormatShort.year),t.setLocale(this.locale).toFormat(e)}getFormatedMonthDate(t){let e=this.dateFormatShort.month;return this.isJanuary(t)&&(e+=" "+this.dateFormatShort.year),t.setLocale(this.locale).toFormat(e)}getFormatedQuarterDate(t){let e=this.dateFormatShort.quarter;return this.isFirstQuarter(t)&&(e+=" "+this.dateFormatShort.year),t.setLocale(this.locale).toFormat(e)}getFormatedWeekDate(t){let e=this.dateFormatShort.week;return this.isFirstWeek(t)&&(e+=" "+this.dateFormatShort.year),t.setLocale(this.locale).toFormat(e)}getFormatedHourDate(t){let e=this.dateFormatShort.hour;return this.isFirstHour(t)&&(e+=" "+this.dateFormatShort.day),t.setLocale(this.locale).toFormat(e)}getFormatedMinuteDate(t){let e=this.dateFormatShort.minute;return this.isFirstMinute(t)&&(e=this.dateFormatShort.hour+":"+e),t.setLocale(this.locale).toFormat(e)}getFormatedSecondDate(t){let e=this.dateFormatShort.second;return this.isFirstSecond(t)&&(e=this.dateFormatShort.minute+":"+e),t.setLocale(this.locale).toFormat(e)}getFormatedMilliSecondDate(t){let e=this.dateFormatShort.millisecond;return this.isFirstMilliSecond(t)&&(e=this.dateFormatShort.second+":"+e),t.setLocale(this.locale).toFormat(e)}isFirstInMonth(t){return 1===t.day}isJanuary(t){return 1===t.month}isFirstQuarter(t){return 1===t.quarter}isFirstWeek(t){return 1===t.weekNumber}isFirstHour(t){return 0===t.hour}isFirstMinute(t){return 0===t.minute}isFirstSecond(t){return 0===t.second}isFirstMilliSecond(t){return 0===t.millisecond}convertDateDistanceToMomentunitOfTime(t){let e;switch(t){case O.YEAR:e="year";break;case O.MONTH:e="month";break;case O.QUARTER:e="quarter";break;case O.WEEK:e="week";break;case O.DAY:e="day";break;case O.HOUR:e="hour";break;case O.MINUTE:e="minute";break;case O.SECOND:e="second";break;case O.MILLISECOND:e="millisecond";break;default:e="day"}return e}createDiratonLike(t,e){switch(t){case"year":return{years:e};case"month":return{months:e};case"quarter":return{quarters:e};case"week":return{weeks:e};case"day":default:return{days:e};case"hour":return{hours:e};case"minute":return{minutes:e};case"second":return{seconds:e};case"millisecond":return{milliseconds:e}}}}function J(t){return null==t||""===t||"null"===t}function F(t){return J(t)||"auto"===t.trim().toLowerCase()?[]:E((null==t?void 0:t.split(",").filter((t=>!(t.toUpperCase().trim()in o)))).toString())}function E(t){return J(t)?[]:t.replace(";",",").split(",").filter((t=>{var e,s,r;const n=t.split("_"),a=null===(e=n[0])||void 0===e?void 0:e.replace(/^dr|^d/,"").toUpperCase().trim(),i=null===(s=n[1])||void 0===s?void 0:s.toUpperCase().trim(),c=null===(r=n[2])||void 0===r?void 0:r.toUpperCase().trim();return 3!==n.length||!(a in o)||!(i in o)||!(c in u)}))}function L(t){return J(t)?[]:E(t.split(",").filter((t=>!(t.toUpperCase().trim()in o))).toString())}function j(t){return J(t)||"auto"===t.trim().toLowerCase()?[]:E(t.split(",").filter((t=>!(t.toUpperCase()in N))).toString())}function W(t){return!J(t)&&Number.isInteger(Number(t))}function $(t){return!J(t)&&!Number.isNaN(Number(t))}function q(t){return!J(t)&&(null==t?void 0:t.toUpperCase())in g}function I(t){return"auto"===(null==t?void 0:t.toLowerCase())||(null==t?void 0:t.toUpperCase())in c}function _(t){if(J(t))return[];try{const e=JSON.parse(t);if(e instanceof Array)return e.filter((t=>!(t.hasOwnProperty("name")&&t.hasOwnProperty("unit"))))}catch(t){console.error("validateMeasureList: failed to parse JSON",t)}return["Invalid JSON structure"]}function z(t){const e=Date.parse(t);return Number.isInteger(e)}function C(t){return(null==t?void 0:t.toUpperCase())in A}function x(t){return(null==t?void 0:t.toUpperCase())in O}function G(t){return(null==t?void 0:t.toUpperCase())in l}function K(t){return!J(t)&&(null==t?void 0:t.toUpperCase())in d}function P(t){return!J(t)&&["true","false",!0,!1].some((e=>e===t))}function Q(t){return!J(t)&&(null==t?void 0:t.toUpperCase())in m}function Z(t){if(J(t))return[];try{const e=JSON.parse(t);if(e instanceof Array)return e.filter((t=>!(t.hasOwnProperty("rowGroup")&&t.hasOwnProperty("category")&&t.hasOwnProperty("subCategory"))))}catch(t){console.error("validateThereOfJsonStr: failed to parse JSON",t)}return["Invalid JSON structure"]}function H(t){if(J(t))return[];try{const e=JSON.parse(t);if(null!==e&&"object"==typeof e&&!(e instanceof Array))return Object.entries(e).filter((([,t])=>"string"!=typeof t||!w(t))).map((([t,e])=>`${t}: ${e}`))}catch(t){console.error("validateAttributesJsonStr: failed to parse JSON",t)}return["Invalid JSON structure"]}function U(t){if(J(t))return[];try{const e=JSON.parse(t);if(e instanceof Array)return e.filter((t=>!(t.hasOwnProperty("rowGroup")&&t.hasOwnProperty("category"))))}catch(t){console.error("validatePartOfJsonStr: failed to parse JSON",t)}return["Invalid JSON structure"]}function Y(t){return(null==t?void 0:t.trim().toUpperCase())in f}function B(t){return["_","k","M","G","T","P","E","Z","Y","m","my","μ","n","p","f","a","z","y"].includes(null==t?void 0:t.trim())||["GREATEST","LEAST"].includes(null==t?void 0:t.trim().toUpperCase())}function R(t){return(null==t?void 0:t.toUpperCase().trim())in y}function V(t){return(null==t?void 0:t.toUpperCase().trim())in h}function X(t){if(J(t))return[];try{return JSON.parse(t).filter((t=>!(t.hasOwnProperty("scenario")&&t.hasOwnProperty("name")&&t.hasOwnProperty("subGroups"))))}catch(t){console.error("validateColumnThereOfJsonStr: failed to parse JSON",t)}return["Invalid JSON structure"]}function tt(t){if(J(t))return[];try{const e=JSON.parse(t);if("object"!=typeof e||null===e||Array.isArray(e))return["stack: must be a JSON object"];const s=[];if(e.hasOwnProperty("by")){const t=["scenarios","dimensions"];t.includes(e.by)||s.push(`stack: 'by' must be one of: ${t.join(", ")}`)}else s.push("stack: 'by' is required");if(e.hasOwnProperty("mode")){const t=["absolute","relative","absolute-relative"];t.includes(e.mode)||s.push(`stack: 'mode' must be one of: ${t.join(", ")}`)}if(e.hasOwnProperty("order")){const t=["asc","desc","dataset"];t.includes(e.order)||s.push(`stack: 'order' must be one of: ${t.join(", ")}`)}return s}catch(t){return["stack: invalid JSON"]}}function et(t){return!J(t)&&null!==b(t)}M.LOCALE_DATE_FORMAT={en:{week:"'W'WW yyyy",day:"MM/dd/yyyy",fallback:"MM/dd/yyyy"}},M.LOCALE_DATE_FORMAT_SHORT={en:{week:"'W'WW",fallback:"MM/dd/yyyy"}};class st{constructor(){this.cache=new Map,this.tag=st.makeStyleTag()}static makeStyleTag(){const t=document.createElement("style");return t.type="text/css",t.setAttribute("data-bn-computed-style",""),t.append(document.createTextNode("")),(document.head||document.querySelector("head")).append(t),t}apply(t){t.forEach((t=>this.cache.set(t.className,t.style))),this.tag.innerHTML=Array.from(this.cache.values()).map((t=>t)).join("\n")}}const rt=new st;function nt(t){for(var e,s=0,r=0,n=t.length;n>=4;++r,n-=4)e=1540483477*(65535&(e=255&t.charCodeAt(r)|(255&t.charCodeAt(++r))<<8|(255&t.charCodeAt(++r))<<16|(255&t.charCodeAt(++r))<<24))+(59797*(e>>>16)<<16),s=1540483477*(65535&(e^=e>>>24))+(59797*(e>>>16)<<16)^1540483477*(65535&s)+(59797*(s>>>16)<<16);switch(n){case 3:s^=(255&t.charCodeAt(r+2))<<16;case 2:s^=(255&t.charCodeAt(r+1))<<8;case 1:s=1540483477*(65535&(s^=255&t.charCodeAt(r)))+(59797*(s>>>16)<<16)}return(((s=1540483477*(65535&(s^=s>>>13))+(59797*(s>>>16)<<16))^s>>>15)>>>0).toString(36)}const at=t=>$(t)?`${t}px`:t,it={width:{className:"w",cssName:"width",attrName:"width",transform:at},height:{className:"h",cssName:"height",attrName:"height",transform:at},position:{className:"pst",cssName:"position",attrName:"position"},top:{className:"top",cssName:"top",attrName:"top",transform:at},right:{className:"rgt",cssName:"right",attrName:"right",transform:at},bottom:{className:"btm",cssName:"bottom",attrName:"bottom",transform:at},left:{className:"lft",cssName:"left",attrName:"left",transform:at},"font-size":{className:"fts",cssName:"font-size",attrName:"font-size",transform:at},"grid-column":{className:"gdc",cssName:"grid-column",attrName:"grid-column"},"grid-row":{className:"gdr",cssName:"grid-row",attrName:"grid-row"}},ot=Object.keys(it);function ut(t,e){const s=function(t,e){const s=nt(e);return`bn-c-${t.className}_${s}`}(t,e),r=function(t,e,s){return`.${e} {${t.cssName}: ${s};}`}(t,s,e);return{className:s,style:r}}const ct=t=>{const e=new Map;return ot.forEach((s=>{const r=t.getAttribute(s);r&&(["top","left","right","bottom"].includes(s)&&e.set("position",ut(it.position,"absolute")),e.set(s,ut(it[s],(it[s].transform||function(t){return t})(r))))})),e},lt=new MutationObserver((t=>{for(const s of t){const t=s.target,r=ct(t);rt.apply(r);const n=Array.from(r.values()).map((t=>t.className));t.className=t.className.split(" ").filter((t=>!t.startsWith("bn-c-"))).concat(...n).join(" "),e(t)}})),ht=e=>{const s=e.connectedCallback,r=e.disconnectedCallback;e.connectedCallback=()=>{const r=t(e);if(!r)throw new Error("Can't find element field in component undefined");(t=>{const e=ct(t);rt.apply(e);const s=Array.from(e.values()).map((t=>t.className));t.className=t.className.split(" ").filter((t=>!t.startsWith("bn-c-"))).concat(...s).join(" "),lt.observe(t,{attributes:!0,attributeFilter:ot,childList:!1,subtree:!1})})(r),a(s,e)},e.disconnectedCallback=()=>{a(r,e)}};export{X as A,H as B,T as C,O as D,_ as E,z as F,C as G,A as H,W as a,p as b,et as c,q as d,P as e,$ as f,F as g,E as h,J as i,I as j,B as k,tt as l,x as m,G as n,nt as o,M as p,L as q,V as r,K as s,Q as t,Z as u,j as v,ht as w,U as x,Y as y,R as z}
@@ -0,0 +1 @@
1
+ import{f as t,g as e}from"./p-C5UYpZUU.js";import{g as s,c as r}from"./p-C7T4DAAW.js";import{r as n}from"./p-DtLI_CzV.js";import{i as o,f as l}from"./p-UtNHLX1j.js";import{m as u}from"./p-DdqXNsKP.js";const i=i=>{let a,c,f,m,p=null;const v=()=>{const t=c.ruleSets.state;m=u([t._system||{},t._default||{},t[f]||{}])},d=()=>{const s=e(i),r=s.getAttribute("ruleset");if(p&&(p.disconnect(),p=null),r&&o(r)){const e=l(s,r);f=null==e?void 0:e.getAttribute("ruleset"),e&&(p=new MutationObserver((()=>{f=e.getAttribute("ruleset"),v(),t(i)})),p.observe(e,{attributes:!0,attributeFilter:["ruleset"]}))}else f=r},b=new MutationObserver((e=>{e.forEach((e=>{"ruleset"===e.attributeName&&(d(),v(),t(i))}))})),j=i.connectedCallback;i.connectedCallback=()=>{const r=e(i);c=s(r),m=c.ruleSets.state._system,b.observe(r,{attributes:!0,attributeFilter:["ruleset"]}),d(),v(),a=c.ruleSets.on("set",(s=>{s!==f&&"_default"!==s||(d(),v(),t(e(i)))})),n(j,i)};const w=i.disconnectedCallback;return i.disconnectedCallback=()=>{b.disconnect(),p&&(p.disconnect(),p=null),n(a),r(e(i)),n(w,i)},()=>m};function a(t,e,s=80){let r=null,n=!1,o=-1,l=-1;const u=function(t){var e;const s=t.parentElement;return(null===(e=null==s?void 0:s.assignedSlot)||void 0===e?void 0:e.parentElement)?s.assignedSlot.parentElement:s}(t);if(!u)return{disconnect(){}};const i=new ResizeObserver((t=>{var i;if(n)return;let a,c;const f=t[0];if(null===(i=null==f?void 0:f.contentBoxSize)||void 0===i?void 0:i.length){const t=f.contentBoxSize[0];a=t.inlineSize,c=t.blockSize}else a=u.clientWidth,c=u.clientHeight;Math.abs(a-o)<=2&&Math.abs(c-l)<=2||(o=a,l=c,null!=r&&clearTimeout(r),r=setTimeout((()=>{n||e()}),s))}));return i.observe(u),{disconnect(){n=!0,null!=r&&clearTimeout(r),i.disconnect()}}}export{a as o,i as w}
@@ -1 +1 @@
1
- import{D as t}from"./p-BgIpdpfH.js";const n=t=>{if("object"==typeof t&&null!==t){if("function"==typeof Object.getPrototypeOf){const n=Object.getPrototypeOf(t);return n===Object.prototype||null===n}return"[object Object]"===Object.prototype.toString.call(t)}return!1},r=(t,n)=>n,e=(t,n)=>[...new Set([...t,...n])],a=(t,s)=>{const c=(t=>{return{arrayMergeType:"combine",arrayMerge:(n=t?t.arrayMergeType:"combine","overwrite"===n?r:e),...t};var n})(s);return t.reduce(((t,r)=>(Object.keys(r).forEach((e=>{Array.isArray(t[e])&&Array.isArray(r[e])?c&&c.arrayMerge&&(t[e]=c.arrayMerge(t[e],r[e])):t[e]=n(t[e])&&n(r[e])?a([t[e],r[e]],c):r[e]})),t)),{})};var s,c,o,u,i,l,f,p;!function(t){t.ALL="all",t.META="meta"}(s||(s={})),function(t){t.CURRENCY="currency",t.VOLUME="volume"}(c||(c={})),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"}(o||(o={})),function(t){t.POS="pos",t.NEG="neg",t.NEU="neu"}(u||(u={})),function(t){t.DECIMAL="decimal",t.PERCENT="percent"}(i||(i={})),function(t){t.LIST="list",t.SUM="sum",t.SUMNOTOTAL="sumnototal",t.OPT="opt",t.OPTNOTOTAL="optnototal"}(l||(l={})),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"}(f||(f={})),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"}(p||(p={}));const b={[p.W5]:5,[p.W10]:10,[p.W15]:15,[p.W20]:20,[p.W25]:25,[p.W30]:30,[p.W40]:40,[p.W60]:60,[p.W80]:80,[p.W100]:100};var w,m,y,d,g,j;!function(t){t.ROWGROUP="rowGroup",t.ROWGROUPINDEX="rowGroupIndex",t.CATEGORY="category",t.CATEGORYINDEX="categoryIndex",t.SUBCATEGORY="subCategory",t.SUBCATEGORYINDEX="subCategoryIndex"}(w||(w={})),function(t){t.SMART="smart",t.LONG="long",t.SHORT="short"}(m||(m={})),function(t){t.COLUMN="column",t.LINE="line",t.WATERFALL="waterfall"}(y||(y={})),function(t){t.BAR="bar",t.LINE="line",t.AUTO="auto"}(d||(d={})),function(t){t.SCENARIOS="scenarios",t.DIMENSIONS="dimensions"}(g||(g={})),function(t){t.ABSOLUTE="absolute",t.RELATIVE="relative",t.ABSOLUTE_RELATIVE="absolute-relative"}(j||(j={}));const v=100;var O;!function(t){t.ASC="asc",t.DESC="desc",t.DATASET="dataset"}(O||(O={}));class h{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}}const x=/^(dr|d)((?:ac|pp|fc|pl)[1-4])_((?:ac|pp|fc|pl)[1-4])(?:_(pos|neg|neu))?$/;class A{constructor(t,n,r){this.type=t,this.base=n,this.delta=r}static parse(t){const n=x.exec(t);return null===n?null:new A(n[1],n[2],n[3])}compute(t,n){return null==t||null==n?null:"dr"===this.type?0===n?null:(t-n)/n:t-n}}function I(t){const n=t.trim();if(Object.values(o).includes(n))return{kind:"scenario",slot:n};const r=A.parse(n);return null!==r?{kind:"variance",measure:r}:null}function B(t){return t.replace(/\d+$/,"")}function C(t){return t.replace(/^[a-z]+/,"")}export{w as A,b as B,h as C,i as D,s as I,c as M,v as R,o as S,p as T,C as a,u as b,m as c,l as d,f as e,g as f,O as g,j as h,d as i,a as m,I as r,B as s}
1
+ import{D as t}from"./p-C7T4DAAW.js";const n=t=>{if("object"==typeof t&&null!==t){if("function"==typeof Object.getPrototypeOf){const n=Object.getPrototypeOf(t);return n===Object.prototype||null===n}return"[object Object]"===Object.prototype.toString.call(t)}return!1},r=(t,n)=>n,e=(t,n)=>[...new Set([...t,...n])],a=(t,s)=>{const c=(t=>{return{arrayMergeType:"combine",arrayMerge:(n=t?t.arrayMergeType:"combine","overwrite"===n?r:e),...t};var n})(s);return t.reduce(((t,r)=>(Object.keys(r).forEach((e=>{Array.isArray(t[e])&&Array.isArray(r[e])?c&&c.arrayMerge&&(t[e]=c.arrayMerge(t[e],r[e])):t[e]=n(t[e])&&n(r[e])?a([t[e],r[e]],c):r[e]})),t)),{})};var s,c,o,u,i,l,f,p;!function(t){t.ALL="all",t.META="meta"}(s||(s={})),function(t){t.CURRENCY="currency",t.VOLUME="volume"}(c||(c={})),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"}(o||(o={})),function(t){t.POS="pos",t.NEG="neg",t.NEU="neu"}(u||(u={})),function(t){t.DECIMAL="decimal",t.PERCENT="percent"}(i||(i={})),function(t){t.LIST="list",t.SUM="sum",t.SUMNOTOTAL="sumnototal",t.OPT="opt",t.OPTNOTOTAL="optnototal"}(l||(l={})),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"}(f||(f={})),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"}(p||(p={}));const b={[p.W5]:5,[p.W10]:10,[p.W15]:15,[p.W20]:20,[p.W25]:25,[p.W30]:30,[p.W40]:40,[p.W60]:60,[p.W80]:80,[p.W100]:100};var w,m,y,d,g,j;!function(t){t.ROWGROUP="rowGroup",t.ROWGROUPINDEX="rowGroupIndex",t.CATEGORY="category",t.CATEGORYINDEX="categoryIndex",t.SUBCATEGORY="subCategory",t.SUBCATEGORYINDEX="subCategoryIndex"}(w||(w={})),function(t){t.SMART="smart",t.LONG="long",t.SHORT="short"}(m||(m={})),function(t){t.COLUMN="column",t.LINE="line",t.WATERFALL="waterfall"}(y||(y={})),function(t){t.BAR="bar",t.LINE="line",t.AUTO="auto"}(d||(d={})),function(t){t.SCENARIOS="scenarios",t.DIMENSIONS="dimensions"}(g||(g={})),function(t){t.ABSOLUTE="absolute",t.RELATIVE="relative",t.ABSOLUTE_RELATIVE="absolute-relative"}(j||(j={}));const v=100;var O;!function(t){t.ASC="asc",t.DESC="desc",t.DATASET="dataset"}(O||(O={}));class A{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}}const h=/^(dr|d)((?:ac|pp|fc|pl)[1-4])_((?:ac|pp|fc|pl)[1-4])(?:_(pos|neg|neu))?$/;class x{constructor(t,n,r){this.type=t,this.base=n,this.delta=r}static parse(t){const n=h.exec(t);return null===n?null:new x(n[1],n[2],n[3])}compute(t,n){return null==t||null==n?null:"dr"===this.type?0===n?null:(t-n)/n:t-n}}function C(t){const n=t.trim();if(Object.values(o).includes(n))return{kind:"scenario",slot:n};const r=x.parse(n);return null!==r?{kind:"variance",measure:r}:null}function D(t){return t.replace(/\d+$/,"")}function I(t){return t.replace(/^[a-z]+/,"")}export{w as A,b as B,A as C,i as D,s as I,c as M,v as R,o as S,p as T,I as a,u as b,m as c,l as d,f as e,g as f,O as g,j as h,d as i,a as m,C as r,D as s}
@@ -1 +1 @@
1
- import{g as e}from"./p-B_d-jp99.js";const t=(e,t)=>{"function"==typeof e&&(t?e.bind(t)():e())};var r,n;!function(e){e[e.RUNNING=0]="RUNNING",e[e.SUCCESSFUL=1]="SUCCESSFUL",e[e.ERROR=2]="ERROR"}(r||(r={})),function(e){let t;const n=new Map,o={running:0,successful:0,error:0},s=e=>{switch(e){case r.RUNNING:return"running";case r.SUCCESSFUL:return"successful";default:return"error"}};e.updateStatus=(r,c)=>{t&&clearTimeout(t);const x=n.get(r);void 0!==x&&o[s(x)]--,o[s(c)]++,n.set(r,c),t=setTimeout((()=>{window.componentRegisterIsRenderedResult=e.componentRegisterIsRendered(),console.log("componentRegisterIsRendered:",window.componentRegisterIsRenderedResult)}),500)},e.componentRegisterIsRendered=()=>0===o.running,e.componentRegisterStatus=()=>Object.assign({},o)}(n||(n={}));const o=e=>{const o=function(){let e=(new Date).getTime(),t=performance&&performance.now&&1e3*performance.now()||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(r=>{let n=16*Math.random();return e>0?(n=(e+n)%16|0,e=Math.floor(e/16)):(n=(t+n)%16|0,t=Math.floor(t/16)),("x"===r?n:7&n|8).toString(16)}))}(),s=e.connectedCallback;e.connectedCallback=()=>{n.updateStatus(o,r.RUNNING),t(s,e)};const c=e.componentWillRender;e.componentWillRender=()=>{n.updateStatus(o,r.RUNNING),t(c,e)};const x=e.componentDidRender;e.componentDidRender=()=>{n.updateStatus(o,r.SUCCESSFUL),t(x,e)}};let s=(e=21)=>{let t="",r=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&r[e]];return t};const c=t=>{const{set:r,modify:n}=(()=>{let r=[];const n=()=>r,o=n=>{const o=r;r=n,o!==n&&(r=>{const n=e(t);0===r.length?n.removeAttribute("has-error"):n.setAttribute("has-error",JSON.stringify(r))})(r)};return{get:n,set:o,setAndGet:e=>{o(e)},getAndSet:e=>{const t=n();return o(e),t},modify:e=>{o(e(n()))}}})();return{clear:()=>{r([])},replace:e=>{r(e.map((e=>(e.id||(e.id=s()),e))))},add:e=>(e.id||(e.id=s()),n((t=>[...t,e])),e.id),addOrReplace:e=>{if(void 0===e.id)throw"missing";return n((t=>[...t.filter((t=>t.id!==e.id)),e])),e.id},remove:e=>{n((t=>t.filter((t=>t.id!==e))))}}};export{c as a,t as r,o as w}
1
+ import{g as e}from"./p-C5UYpZUU.js";const t=(e,t)=>{"function"==typeof e&&(t?e.bind(t)():e())};var r,n;!function(e){e[e.RUNNING=0]="RUNNING",e[e.SUCCESSFUL=1]="SUCCESSFUL",e[e.ERROR=2]="ERROR"}(r||(r={})),function(e){let t;const n=new Map,o={running:0,successful:0,error:0},s=e=>{switch(e){case r.RUNNING:return"running";case r.SUCCESSFUL:return"successful";default:return"error"}};e.updateStatus=(r,c)=>{t&&clearTimeout(t);const x=n.get(r);void 0!==x&&o[s(x)]--,o[s(c)]++,n.set(r,c),t=setTimeout((()=>{window.componentRegisterIsRenderedResult=e.componentRegisterIsRendered(),console.log("componentRegisterIsRendered:",window.componentRegisterIsRenderedResult)}),500)},e.componentRegisterIsRendered=()=>0===o.running,e.componentRegisterStatus=()=>Object.assign({},o)}(n||(n={}));const o=e=>{const o=function(){let e=(new Date).getTime(),t=performance&&performance.now&&1e3*performance.now()||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(r=>{let n=16*Math.random();return e>0?(n=(e+n)%16|0,e=Math.floor(e/16)):(n=(t+n)%16|0,t=Math.floor(t/16)),("x"===r?n:7&n|8).toString(16)}))}(),s=e.connectedCallback;e.connectedCallback=()=>{n.updateStatus(o,r.RUNNING),t(s,e)};const c=e.componentWillRender;e.componentWillRender=()=>{n.updateStatus(o,r.RUNNING),t(c,e)};const x=e.componentDidRender;e.componentDidRender=()=>{n.updateStatus(o,r.SUCCESSFUL),t(x,e)}};let s=(e=21)=>{let t="",r=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&r[e]];return t};const c=t=>{const{set:r,modify:n}=(()=>{let r=[];const n=()=>r,o=n=>{const o=r;r=n,o!==n&&(r=>{const n=e(t);0===r.length?n.removeAttribute("has-error"):n.setAttribute("has-error",JSON.stringify(r))})(r)};return{get:n,set:o,setAndGet:e=>{o(e)},getAndSet:e=>{const t=n();return o(e),t},modify:e=>{o(e(n()))}}})();return{clear:()=>{r([])},replace:e=>{r(e.map((e=>(e.id||(e.id=s()),e))))},add:e=>(e.id||(e.id=s()),n((t=>[...t,e])),e.id),addOrReplace:e=>{if(void 0===e.id)throw"missing";return n((t=>[...t.filter((t=>t.id!==e.id)),e])),e.id},remove:e=>{n((t=>t.filter((t=>t.id!==e))))}}};export{c as a,t as r,o as w}
@@ -0,0 +1 @@
1
+ import{g as t,c as n}from"./p-C7T4DAAW.js";import{r as e}from"./p-DtLI_CzV.js";import{g as o,f as r}from"./p-C5UYpZUU.js";const i=(t,n)=>{const e=[],o=[];for(const r of n)(t(r)?e:o).push(r);return[e,o]},a="WARN_use_dataset",s=(t,n)=>{const e=t.errors;if(e)if(n.length>0){const t=n.map((t=>t.substring(1))).join(", ");e.addOrReplace({id:a,type:"warning",message:`Using datasource(s) "${t}" directly. Prefer using a dataset (bn-dataset) for query support and metadata.`})}else e.remove(a)},u=(r,a,u)=>{let l,c,f=[],d=[],p=[];const v=(t,n)=>{const e=n?t.substring(1):t;let o;try{o=c.db.db.exec(`SELECT * FROM \`${e}\``)}catch(t){o=[]}a(t,o)},m=()=>{f.forEach((t=>t())),f=[],d.forEach((t=>{t&&(f.push(c.db.subscribe(t,(()=>v(t,!1)))),v(t,!1),(t=>{if(u){const n=c.datasetsMeta.get(t);n&&u(t,n)}})(t))})),p.forEach((t=>{t&&(f.push(c.db.subscribe(t.substring(1),(()=>v(t,!0)))),v(t,!0))}))},b=new MutationObserver((t=>{t.forEach((t=>{"datasets"===t.attributeName&&([p,d]=i((t=>t.startsWith("$")),o(r).getAttribute("datasets").split(",")),s(r,p),m())}))})),h=r.connectedCallback;r.connectedCallback=()=>{const n=o(r);c=t(n),[p,d]=i((t=>t.startsWith("$")),(n.getAttribute("datasets")||"").split(",")),s(r,p),m(),b.observe(n,{attributes:!0,attributeFilter:["datasets"]}),u&&(l=c.datasetsMeta.on("set",((t,n)=>{d.includes(t)&&u(t,n)}))),e(h,r)};const g=r.disconnectedCallback;return r.disconnectedCallback=()=>{b.disconnect(),f.forEach((t=>t())),f=[],e(l),n(o(r)),e(g,r)},t=>{d=t,m()}},l="inherited-page",c="bn-layout-page";function f(t){return"inherited-closest"===t||t===l}function d(t,n){let e=t.parentNode;for(;e;){if(e instanceof HTMLElement){const t=e.nodeName.toLowerCase();if(n===l){if(t===c)return e}else if("bn-layout-card"===t||t===c)return e}if(e.parentNode)e=e.parentNode;else{if(!(e instanceof ShadowRoot))break;e=e.host}}}const p=(t,n)=>{const i=new Map;let a,s=null;const u=t.connectedCallback;t.connectedCallback=()=>{(()=>{const e=o(t);i.clear();const u=[];for(const o of n){const n=t[o.propName];if("string"!=typeof n||!f(n))continue;if(a||(a=d(e,n)),!a)continue;const r=a.getAttribute(o.ancestorAttr);null!=r&&i.set(o.propName,r),u.push(o.ancestorAttr)}a&&u.length>0&&(s=new MutationObserver((()=>{for(const e of n){if(!f(t[e.propName]))continue;const n=a.getAttribute(e.ancestorAttr);null!=n?i.set(e.propName,n):i.delete(e.propName)}r(t)})),s.observe(a,{attributes:!0,attributeFilter:u}))})(),e(u,t)};const l=t.disconnectedCallback;return t.disconnectedCallback=()=>{s&&(s.disconnect(),s=null),a=void 0,i.clear(),e(l,t)},(t,n)=>{if(f(n))return i.get(t)}},v=i=>{let a,s,u,l=null;const c=()=>{var t;const n=o(i);if(l&&(l.disconnect(),l=null),s=null!==(t=n.getAttribute("i18n-namespace"))&&void 0!==t?t:n.getAttribute("namespace"),null!=s)return;const e=function(t){let n=t.parentNode;for(;n;){if(n instanceof HTMLElement&&n.hasAttribute("i18n-namespace"))return n;if(n.parentNode)n=n.parentNode;else{if(!(n instanceof ShadowRoot))break;n=n.host}}}(n);e&&(s=e.getAttribute("i18n-namespace"),l=new MutationObserver((()=>{c(),r(i)})),l.observe(e,{attributes:!0,attributeFilter:["i18n-namespace"]}))},f=new MutationObserver((t=>{t.forEach((t=>{"i18n-namespace"!==t.attributeName&&"namespace"!==t.attributeName||(c(),r(i))}))})),d=i.connectedCallback;i.connectedCallback=()=>{const n=o(i);u=t(n),f.observe(n,{attributes:!0,attributeFilter:["i18n-namespace","namespace"]}),c(),a=u.internationalization.on("set",(t=>{t!==s&&"_system"!==t||r(i)})),e(d,i)};const p=i.disconnectedCallback;return i.disconnectedCallback=()=>{f.disconnect(),l&&(l.disconnect(),l=null),e(a),n(o(i)),e(p,i)},{t:(t,n)=>{var e,r,a,l,c;t.startsWith(".")&&(t=o(i).localName+t);const f=u.internationalization.state,d=u.context.state.locale,p=null!==(a=null===(r=null===(e=f[s])||void 0===e?void 0:e[d])||void 0===r?void 0:r[t])&&void 0!==a?a:null===(c=null===(l=f._system)||void 0===l?void 0:l[d])||void 0===c?void 0:c[t];return null==p?t:p.replace(/{{([\s\S]+?)}}/g,((t,e)=>{var o;return null!==(o=null==n?void 0:n[e.trim()])&&void 0!==o?o:""}))}}};function m(t,n=!1){const e=b(t);if(!e)return n&&console.log("[parentDims] no layout parent found for",t.tagName),{width:0,height:0};const o=getComputedStyle(e),r=e.clientWidth-parseFloat(o.paddingLeft)-parseFloat(o.paddingRight),i=function(t,n=!1){let e=b(t),o=0,r=null,i=1;for(;e;){if(e.hasAttribute("data-bn-fit-content")){n&&console.log(`[height:${o}]`,e.tagName,"fit-content region → discarding inner candidate"),r=null;const t=parseInt(e.getAttribute("data-bn-fit-content"),10);!isNaN(t)&&t>1&&(i*=t),e=h(e),o++;continue}const t=getComputedStyle(e),a=t.overflowY;if(n&&console.log(`[height:${o}]`,e.tagName,e.className||"(no class)",`overflow=${a} clientH=${e.clientHeight} h=${t.height}`),null===r)if("hidden"===a||"scroll"===a||"auto"===a)r=e.clientHeight-parseFloat(t.paddingTop)-parseFloat(t.paddingBottom),n&&console.log(`[height] candidate at depth ${o}: ${Math.round(r)}px`);else if("none"!==t.maxHeight){const n=parseFloat(t.maxHeight);!isNaN(n)&&n>0&&(r=Math.min(n,e.clientHeight-parseFloat(t.paddingTop)-parseFloat(t.paddingBottom)))}e=h(e),o++}return null!==r?r/i:(n&&console.log("[height] NO constrained ancestor → viewport fallback"),"undefined"!=typeof window?window.innerHeight/i:0)}(t,n);return n&&console.log("[parentDims]",t.tagName,"→ layoutParent:",e.tagName,e.className||"(no class)",`clientW=${e.clientWidth} → w=${Math.round(r)}, h=${Math.round(i)}`,"overflow:",o.overflow),{width:Math.max(0,r),height:Math.max(0,i)}}function b(t){var n;const e=t.parentElement;return(null===(n=null==e?void 0:e.assignedSlot)||void 0===n?void 0:n.parentElement)?e.assignedSlot.parentElement:e}function h(t){var n;if(null===(n=t.assignedSlot)||void 0===n?void 0:n.parentElement)return t.assignedSlot.parentElement;if(t.parentElement)return t.parentElement;const e=t.getRootNode();return e instanceof ShadowRoot?e.host:null}function g(t){if(null==t||""===t)return{mode:"empty"};if("none"===t)return{mode:"none"};if("auto"===t)return{mode:"auto"};const n=Number(t);return!isNaN(n)&&n>0?{mode:"factor",factor:n}:{mode:"empty"}}const w={k:1e3,K:1e3,M:1e6,G:1e9,T:1e12},y=/^(\d+(?:\.\d+)?|\.\d+)\s*([kKMGT])?$/;function M(t){var n;if("number"==typeof t)return Number.isFinite(t)&&t>0?{kind:"number",value:t}:{kind:"invalid",raw:String(t)};const e=null!==(n=null==t?void 0:t.toString().trim())&&void 0!==n?n:"";if("auto"===e.toLowerCase())return{kind:"auto"};const o=y.exec(e);if(o){const t=Number(o[1])*(o[2]?w[o[2]]:1);if(Number.isFinite(t)&&t>0)return{kind:"number",value:t}}return{kind:"invalid",raw:e}}function $(t,n){const e=M(t);if("auto"===e.kind)return{kind:"auto"};if("string"==typeof t){const e=t.trim();if(n.has(e))return{kind:"value",value:n.get(e)}}return"number"===e.kind?{kind:"value",value:e.value}:{kind:"invalid",raw:e.raw}}const k=[[1e12,"T"],[1e9,"G"],[1e6,"M"],[1e3,"k"]];function N(t){if(!Number.isFinite(t)||t<=0)return String(t);const n=t=>String(Number(t.toPrecision(3)));for(const[e,o]of k)if(t>=e)return`${n(t/e)}${o}`;return n(t)}export{v as a,N as b,p as c,M as d,d as f,m as g,f as i,g as p,$ as r,u as w}
@@ -1 +1 @@
1
- import{r as t,h as e,H as s,g as r}from"./p-B_d-jp99.js";import{e as i,w as o,b as n}from"./p-BpWWgN6k.js";import{w as d,a}from"./p-B4JfKvVT.js";import"./p-BgIpdpfH.js";import"./p-eEfqksk-.js";import"./p-C5uvAEKI.js";function l(t){if(!t||""===t.trim()||"[]"===t)return[];try{const e=JSON.parse(t);return Array.isArray(e)?e.map(((t,e)=>{var s,r,i;return"string"==typeof t?{label:t,id:String(e)}:"object"==typeof t&&null!==t?{label:null!==(r=null!==(s=t.label)&&void 0!==s?s:t.name)&&void 0!==r?r:String(e),id:null!==(i=t.id)&&void 0!==i?i:String(e)}:{label:String(t),id:String(e)}})):[]}catch(t){return console.error("parseHeaders: failed to parse JSON",t),[]}}function h(t){if(!t||""===t.trim()||"[]"===t)return[];try{const e=JSON.parse(t);if(!Array.isArray(e))return["Headers must be an array"];const s=[],r=new Set;return e.forEach(((t,e)=>{"object"==typeof t&&null!==t&&void 0!==t.id&&("string"!=typeof t.id?s.push(`Header[${e}]: 'id' must be a string`):r.has(t.id)?s.push(`Header[${e}]: duplicate id '${t.id}'`):r.add(t.id),void 0!==t.label&&"string"!=typeof t.label&&s.push(`Header[${e}]: 'label' must be a string`))})),s}catch(t){return console.error("validateHeadersJson: failed to parse JSON",t),["Invalid JSON structure"]}}const u=class{validateRowHeaders(t){const e="ERR_rowHeaders",s=h(t);s.length>0?this.errors.addOrReplace({id:e,type:"error",message:`row-headers: ${s.join("; ")}`}):this.errors.remove(e),this.updateGridConfig()}validateColumnHeaders(t){const e="ERR_columnHeaders",s=h(t);s.length>0?this.errors.addOrReplace({id:e,type:"error",message:`column-headers: ${s.join("; ")}`}):this.errors.remove(e),this.updateGridConfig()}validateShowRowHeaders(t){const e="ERR_showRowHeaders";i(t)?this.errors.remove(e):this.errors.addOrReplace({id:e,type:"warning",message:`show-row-headers: invalid value '${t}', must be 'true' or 'false'`})}validateShowColumnHeaders(t){const e="ERR_showColumnHeaders";i(t)?this.errors.remove(e):this.errors.addOrReplace({id:e,type:"warning",message:`show-column-headers: invalid value '${t}', must be 'true' or 'false'`})}validateShowBorders(t){const e="ERR_showBorders";i(t)?this.errors.remove(e):this.errors.addOrReplace({id:e,type:"warning",message:`show-borders: invalid value '${t}', must be 'true' or 'false'`})}constructor(e){t(this,e),this.gridConfig={rows:[],columns:[]},this.chartTitle="",this.rowHeaders="[]",this.columnHeaders="[]",this.showRowHeaders="true",this.showColumnHeaders="true",this.showBorders="true",this.rowHeaderWidth="auto",this.cellGap="0px",o(this),d(this),this.errors=a(this),this.componentStyle=n(this)}getGridStyle(){return this.componentStyle((t=>t["bn-grid"]))}componentWillLoad(){this.validateRowHeaders(this.rowHeaders),this.validateColumnHeaders(this.columnHeaders),this.validateShowRowHeaders(this.showRowHeaders),this.validateShowColumnHeaders(this.showColumnHeaders),this.validateShowBorders(this.showBorders)}updateGridConfig(){var t;this.gridConfig=(t=this.columnHeaders,{rows:l(this.rowHeaders),columns:l(t)})}shouldShowRowHeaders(){return"true"===this.showRowHeaders&&this.gridConfig.rows.length>0}shouldShowColumnHeaders(){return"true"===this.showColumnHeaders&&this.gridConfig.columns.length>0}shouldShowBorders(){return"true"===this.showBorders}getGridTemplateColumns(){const t=[];this.shouldShowRowHeaders()&&t.push(this.rowHeaderWidth);const e=this.gridConfig.columns.length||1;for(let s=0;s<e;s++)t.push("auto");return t.join(" ")}getGridTemplateRows(){const t=[];this.chartTitle&&t.push("auto"),this.shouldShowColumnHeaders()&&t.push("auto");const e=this.gridConfig.rows.length||1;for(let s=0;s<e;s++)t.push("auto");return t.join(" ")}renderTitle(){if(!this.chartTitle)return null;const t=(this.shouldShowRowHeaders()?1:0)+this.gridConfig.columns.length;return e("div",{class:"grid-title",style:{"grid-column":`1 / span ${t}`,"grid-row":"1"}},this.chartTitle)}renderColumnHeaders(){if(!this.shouldShowColumnHeaders())return null;const t=this.getGridStyle(),s=this.shouldShowBorders()?`${t.borderWidth}px solid ${t.borderColor}`:"none",r=this.shouldShowRowHeaders()?2:1,i=this.chartTitle?2:1;return this.gridConfig.columns.map(((o,n)=>{const d=n>0;return e("div",{key:`col-header-${o.id}`,class:"grid-header grid-header-col",style:{"grid-column":String(r+n),"grid-row":String(i),"border-left":d?s:"none",padding:`${t.cellPadding}px`,"padding-left":d?`${t.cellPadding+4}px`:`${t.cellPadding}px`}},o.label)}))}renderDataCells(){const t=this.getGridStyle(),s=this.shouldShowBorders()?`${t.borderWidth}px solid ${t.borderColor}`:"none",r=this.shouldShowRowHeaders()?2:1,i=(this.chartTitle?1:0)+(this.shouldShowColumnHeaders()?1:0)+1,o=[];return this.gridConfig.rows.length>0&&this.gridConfig.columns.length>0&&this.gridConfig.rows.forEach(((n,d)=>{if(this.shouldShowRowHeaders()){const r=d>0;o.push(e("div",{key:`row-header-${n.id}`,class:"grid-header grid-header-row",style:{"grid-column":"1","grid-row":String(i+d),"border-top":r?s:"none",padding:`${t.cellPadding}px`,"padding-top":r?`${t.cellPadding+4}px`:`${t.cellPadding}px`}},n.label))}this.gridConfig.columns.forEach(((a,l)=>{const h=function(t,e){return`${t.id}-${e.id}`}(n,a),u=l>0,c=d>0;o.push(e("div",{key:`cell-${h}`,class:"grid-cell",style:{"grid-column":String(r+l),"grid-row":String(i+d),"border-left":u?s:"none","border-top":c?s:"none","padding-left":u?`${t.cellPadding+4}px`:"0","padding-top":c?`${t.cellPadding+4}px`:"0"}},e("slot",{name:h})))}))})),o}getFontStyles(){return this.componentStyle((t=>{var e,s,r,i;return{"--bn-font-family":(null===(e=t.global)||void 0===e?void 0:e.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":`${(null===(s=t.global)||void 0===s?void 0:s.fontSizePx)||13.3333}px`,"--bn-font-color":(null===(r=t.global)||void 0===r?void 0:r.fontColor)||"#000000","--bn-font-background":(null===(i=t.global)||void 0===i?void 0:i.fontBackgroundColor)||"#ffffff"}}))}render(){const t={display:"inline-grid","grid-template-columns":this.getGridTemplateColumns(),"grid-template-rows":this.getGridTemplateRows(),gap:this.cellGap};return e(s,{key:"9522911b83a725994d62b657469bfcdbcae4a795",style:this.getFontStyles()},e("div",{key:"c3d4fe8e552c31b0e10ca930a784867e1f711d01",class:"grid-container",style:t},this.renderTitle(),this.renderColumnHeaders(),this.renderDataCells()),e("slot",{key:"9772d659471df1d3588a1372fedd09d6b3bb459d"}))}get element(){return r(this)}static get watchers(){return{rowHeaders:[{validateRowHeaders:0}],columnHeaders:[{validateColumnHeaders:0}],showRowHeaders:[{validateShowRowHeaders:0}],showColumnHeaders:[{validateShowColumnHeaders:0}],showBorders:[{validateShowBorders:0}]}}};u.style=':host{display:inline-block;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000)}.grid-container{display:inline-grid;box-sizing:border-box}.grid-title{font-weight:normal;padding-bottom:8px}.grid-header{display:flex;align-items:flex-end;box-sizing:border-box}.grid-header-row{justify-content:flex-end;padding-right:8px}.grid-header-col{white-space:nowrap;justify-content:flex-start}.grid-cell{position:relative;box-sizing:border-box}';export{u as bn_grid}
1
+ import{r as t,h as e,H as s,g as r}from"./p-C5UYpZUU.js";import{e as i,w as o,b as n}from"./p-CuR4S456.js";import{w as d,a}from"./p-DtLI_CzV.js";import"./p-C7T4DAAW.js";import"./p-DdqXNsKP.js";import"./p-CbciPY-M.js";function l(t){if(!t||""===t.trim()||"[]"===t)return[];try{const e=JSON.parse(t);return Array.isArray(e)?e.map(((t,e)=>{var s,r,i;return"string"==typeof t?{label:t,id:String(e)}:"object"==typeof t&&null!==t?{label:null!==(r=null!==(s=t.label)&&void 0!==s?s:t.name)&&void 0!==r?r:String(e),id:null!==(i=t.id)&&void 0!==i?i:String(e)}:{label:String(t),id:String(e)}})):[]}catch(t){return console.error("parseHeaders: failed to parse JSON",t),[]}}function h(t){if(!t||""===t.trim()||"[]"===t)return[];try{const e=JSON.parse(t);if(!Array.isArray(e))return["Headers must be an array"];const s=[],r=new Set;return e.forEach(((t,e)=>{"object"==typeof t&&null!==t&&void 0!==t.id&&("string"!=typeof t.id?s.push(`Header[${e}]: 'id' must be a string`):r.has(t.id)?s.push(`Header[${e}]: duplicate id '${t.id}'`):r.add(t.id),void 0!==t.label&&"string"!=typeof t.label&&s.push(`Header[${e}]: 'label' must be a string`))})),s}catch(t){return console.error("validateHeadersJson: failed to parse JSON",t),["Invalid JSON structure"]}}const u=class{validateRowHeaders(t){const e="ERR_rowHeaders",s=h(t);s.length>0?this.errors.addOrReplace({id:e,type:"error",message:`row-headers: ${s.join("; ")}`}):this.errors.remove(e),this.updateGridConfig()}validateColumnHeaders(t){const e="ERR_columnHeaders",s=h(t);s.length>0?this.errors.addOrReplace({id:e,type:"error",message:`column-headers: ${s.join("; ")}`}):this.errors.remove(e),this.updateGridConfig()}validateShowRowHeaders(t){const e="ERR_showRowHeaders";i(t)?this.errors.remove(e):this.errors.addOrReplace({id:e,type:"warning",message:`show-row-headers: invalid value '${t}', must be 'true' or 'false'`})}validateShowColumnHeaders(t){const e="ERR_showColumnHeaders";i(t)?this.errors.remove(e):this.errors.addOrReplace({id:e,type:"warning",message:`show-column-headers: invalid value '${t}', must be 'true' or 'false'`})}validateShowBorders(t){const e="ERR_showBorders";i(t)?this.errors.remove(e):this.errors.addOrReplace({id:e,type:"warning",message:`show-borders: invalid value '${t}', must be 'true' or 'false'`})}constructor(e){t(this,e),this.gridConfig={rows:[],columns:[]},this.chartTitle="",this.rowHeaders="[]",this.columnHeaders="[]",this.showRowHeaders="true",this.showColumnHeaders="true",this.showBorders="true",this.rowHeaderWidth="auto",this.cellGap="0px",o(this),d(this),this.errors=a(this),this.componentStyle=n(this)}getGridStyle(){return this.componentStyle((t=>t["bn-grid"]))}componentWillLoad(){this.validateRowHeaders(this.rowHeaders),this.validateColumnHeaders(this.columnHeaders),this.validateShowRowHeaders(this.showRowHeaders),this.validateShowColumnHeaders(this.showColumnHeaders),this.validateShowBorders(this.showBorders)}updateGridConfig(){var t;this.gridConfig=(t=this.columnHeaders,{rows:l(this.rowHeaders),columns:l(t)})}shouldShowRowHeaders(){return"true"===this.showRowHeaders&&this.gridConfig.rows.length>0}shouldShowColumnHeaders(){return"true"===this.showColumnHeaders&&this.gridConfig.columns.length>0}shouldShowBorders(){return"true"===this.showBorders}getGridTemplateColumns(){const t=[];this.shouldShowRowHeaders()&&t.push(this.rowHeaderWidth);const e=this.gridConfig.columns.length||1;for(let s=0;s<e;s++)t.push("auto");return t.join(" ")}getGridTemplateRows(){const t=[];this.chartTitle&&t.push("auto"),this.shouldShowColumnHeaders()&&t.push("auto");const e=this.gridConfig.rows.length||1;for(let s=0;s<e;s++)t.push("auto");return t.join(" ")}renderTitle(){if(!this.chartTitle)return null;const t=(this.shouldShowRowHeaders()?1:0)+this.gridConfig.columns.length;return e("div",{class:"grid-title",style:{"grid-column":`1 / span ${t}`,"grid-row":"1"}},this.chartTitle)}renderColumnHeaders(){if(!this.shouldShowColumnHeaders())return null;const t=this.getGridStyle(),s=this.shouldShowBorders()?`${t.borderWidth}px solid ${t.borderColor}`:"none",r=this.shouldShowRowHeaders()?2:1,i=this.chartTitle?2:1;return this.gridConfig.columns.map(((o,n)=>{const d=n>0;return e("div",{key:`col-header-${o.id}`,class:"grid-header grid-header-col",style:{"grid-column":String(r+n),"grid-row":String(i),"border-left":d?s:"none",padding:`${t.cellPadding}px`,"padding-left":d?`${t.cellPadding+4}px`:`${t.cellPadding}px`}},o.label)}))}renderDataCells(){const t=this.getGridStyle(),s=this.shouldShowBorders()?`${t.borderWidth}px solid ${t.borderColor}`:"none",r=this.shouldShowRowHeaders()?2:1,i=(this.chartTitle?1:0)+(this.shouldShowColumnHeaders()?1:0)+1,o=[];return this.gridConfig.rows.length>0&&this.gridConfig.columns.length>0&&this.gridConfig.rows.forEach(((n,d)=>{if(this.shouldShowRowHeaders()){const r=d>0;o.push(e("div",{key:`row-header-${n.id}`,class:"grid-header grid-header-row",style:{"grid-column":"1","grid-row":String(i+d),"border-top":r?s:"none",padding:`${t.cellPadding}px`,"padding-top":r?`${t.cellPadding+4}px`:`${t.cellPadding}px`}},n.label))}this.gridConfig.columns.forEach(((a,l)=>{const h=function(t,e){return`${t.id}-${e.id}`}(n,a),u=l>0,c=d>0;o.push(e("div",{key:`cell-${h}`,class:"grid-cell",style:{"grid-column":String(r+l),"grid-row":String(i+d),"border-left":u?s:"none","border-top":c?s:"none","padding-left":u?`${t.cellPadding+4}px`:"0","padding-top":c?`${t.cellPadding+4}px`:"0"}},e("slot",{name:h})))}))})),o}getFontStyles(){return this.componentStyle((t=>{var e,s,r,i;return{"--bn-font-family":(null===(e=t.global)||void 0===e?void 0:e.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":`${(null===(s=t.global)||void 0===s?void 0:s.fontSizePx)||13.3333}px`,"--bn-font-color":(null===(r=t.global)||void 0===r?void 0:r.fontColor)||"#000000","--bn-font-background":(null===(i=t.global)||void 0===i?void 0:i.fontBackgroundColor)||"#ffffff"}}))}render(){const t={display:"inline-grid","grid-template-columns":this.getGridTemplateColumns(),"grid-template-rows":this.getGridTemplateRows(),gap:this.cellGap};return e(s,{key:"9522911b83a725994d62b657469bfcdbcae4a795",style:this.getFontStyles()},e("div",{key:"c3d4fe8e552c31b0e10ca930a784867e1f711d01",class:"grid-container",style:t},this.renderTitle(),this.renderColumnHeaders(),this.renderDataCells()),e("slot",{key:"9772d659471df1d3588a1372fedd09d6b3bb459d"}))}get element(){return r(this)}static get watchers(){return{rowHeaders:[{validateRowHeaders:0}],columnHeaders:[{validateColumnHeaders:0}],showRowHeaders:[{validateShowRowHeaders:0}],showColumnHeaders:[{validateShowColumnHeaders:0}],showBorders:[{validateShowBorders:0}]}}};u.style=':host{display:inline-block;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000)}.grid-container{display:inline-grid;box-sizing:border-box}.grid-title{font-weight:normal;padding-bottom:8px}.grid-header{display:flex;align-items:flex-end;box-sizing:border-box}.grid-header-row{justify-content:flex-end;padding-right:8px}.grid-header-col{white-space:nowrap;justify-content:flex-start}.grid-cell{position:relative;box-sizing:border-box}';export{u as bn_grid}
@@ -1 +1 @@
1
- import{r as t,h as s,H as i,g as a}from"./p-B_d-jp99.js";import{w as e}from"./p-BjBz5cSL.js";import{g as r,f as n}from"./p-BgIpdpfH.js";import{w as o,a as h}from"./p-B4JfKvVT.js";const c=class{constructor(s){t(this,s),this.namespace="_system",o(this),this.errors=h(this),e(this,(t=>{this.stores||(this.stores=r(this.element));try{const s=n(JSON.parse(t)),i=this.namespace||"_system",a=Object.assign({},this.stores.internationalization.get(i));a[this.code]=Object.assign(Object.assign({},a[this.code]),s),this.stores.internationalization.set(i,a)}catch(t){console.error(t)}}))}render(){return s(i,{key:"1b5e46fd06494aada4db697402746be6bcf950db"})}get element(){return a(this)}};c.style="bn-internationalization{display:none}";export{c as bn_internationalization}
1
+ import{r as t,h as s,H as i,g as a}from"./p-C5UYpZUU.js";import{w as r}from"./p-CTrNbSXN.js";import{g as e,f as n}from"./p-C7T4DAAW.js";import{w as o,a as h}from"./p-DtLI_CzV.js";const c=class{constructor(s){t(this,s),this.namespace="_system",o(this),this.errors=h(this),r(this,(t=>{this.stores||(this.stores=e(this.element));try{const s=n(JSON.parse(t)),i=this.namespace||"_system",a=Object.assign({},this.stores.internationalization.get(i));a[this.code]=Object.assign(Object.assign({},a[this.code]),s),this.stores.internationalization.set(i,a)}catch(t){console.error(t)}}))}render(){return s(i,{key:"1b5e46fd06494aada4db697402746be6bcf950db"})}get element(){return a(this)}};c.style="bn-internationalization{display:none}";export{c as bn_internationalization}
@@ -1 +1 @@
1
- import{r as t,d as i,f as e,h as s,H as r,g as a}from"./p-B_d-jp99.js";import{a as n}from"./p-BgIpdpfH.js";import{C as l,r as o,A as u}from"./p-eEfqksk-.js";import{w as h,o as d}from"./p-A8xyE4b1.js";import{O as c,a as p,b as v}from"./p-C5uvAEKI.js";import{w as g,a as m,g as f,p as b}from"./p-C9i1Xsib.js";import{v as _,i as y,d as w,a as O,w as R,b as A}from"./p-BpWWgN6k.js";import{w as E,a as $}from"./p-B4JfKvVT.js";import{p as j}from"./p-6lOdN-fB.js";const T=["measure","label","unit"];function N(t){const i=[],e=W(t,"measure",i);if(void 0===e||""===e.trim())return i.push("measure"),{config:null,unknownKeys:U(t,T),invalidFields:i};const s={measure:e.trim()};return s.label=W(t,"label",i),s.unit=W(t,"unit",i),{config:s,unknownKeys:U(t,T),invalidFields:i}}const S=["show","decimals"];function k(t,i){const e=[],s={show:i.show,decimals:i.decimals};return l.isExisting(t.show)&&("auto"===t.show||"none"===t.show?s.show=t.show:e.push("show")),l.isExisting(t.decimals)&&(l.isNumber(t.decimals)&&t.decimals>=0&&t.decimals<=4?s.decimals=Math.floor(t.decimals):e.push("decimals")),{config:s,unknownKeys:U(t,S),invalidFields:e}}function x(t){var i;const e=null!==(i=null==t?void 0:t.trim())&&void 0!==i?i:"";if(""===e||"null"===e)return{ranges:[],parseError:!1,issues:[]};let s;try{s=JSON.parse(e)}catch(t){return{ranges:[],parseError:!0,issues:[]}}if(!Array.isArray(s)||0===s.length)return{ranges:[],parseError:!0,issues:[]};if(!s.every((t=>l.isNumber(t)&&isFinite(t)&&t>0)))return{ranges:[],parseError:!0,issues:[]};const r=[];let a=s;const n=[...a].sort(((t,i)=>t-i));return n.some(((t,i)=>t!==a[i]))&&r.push("not ascending, sorted"),a=n,a.length>2&&(r.push(`${a.length} entries, first 2 kept`),a=a.slice(0,2)),{ranges:a,parseError:!1,issues:r}}function U(t,i){return Object.keys(t).filter((t=>!i.includes(t)))}function W(t,i,e){if(l.isExisting(t[i]))return l.isString(t[i])?t[i]:void e.push(i)}const L=["pl1","pp1","fc1"],z=class{validateActual(t){this.validateMeasureSpec("actual",t)}validateTarget(t){this.validateMeasureSpec("target",t)}validateRanges(t){const i="ERR_bullet_json_ranges",e="WARN_bullet_ranges",s=x(t);if(s.parseError)return this.setBlockingError(i,this.t(".bullet-prop-json",{prop:"ranges"})),void this.errors.remove(e);this.setBlockingError(i,null),s.issues.length>0?this.errors.addOrReplace({id:e,type:"warning",message:this.t(".bullet-ranges-invalid",{detail:s.issues.join("; ")})}):this.errors.remove(e)}validateNormalize(t){this.validateEnum("normalize","ERR_normalize",t,["target","none"],"target")}validateVariances(t){this.validateEnum("variances","ERR_variances",t,["auto","none"],"auto")}validateLevel(t){this.validateEnum("level","ERR_level",t,["auto","rowgroup","category","subcategory"],"auto")}validateOrder(t){const i="ERR_order",e=_(t).filter((t=>""!==t));0===e.length?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:`order: invalid value(s) '${e.join(", ")}'; using the dataset order.`})}validateOrderDirection(t){const i="ERR_orderDirection";y(t)||w(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:`order-direction: invalid value '${t}' — expected asc/desc; using asc.`})}validateLimit(t){const i="ERR_limit";O(t)&&Number(t)>=0?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:`limit: invalid value '${t}' — expected a non-negative integer; using 0.`})}validateLabels(t){const i="ERR_bullet_json_labels",e="WARN_bullet_fields_labels",{data:s,parseError:r}=j(t,null);if(r)return this.setBlockingError(i,this.t(".bullet-prop-json",{prop:"labels"})),void this.errors.remove(e);this.setBlockingError(i,null),null!==s?this.reportSpecIssues(e,"labels",k(s,this.labelDefaults())):this.errors.remove(e)}validateScale(t){const i="ERR_scale";if(y(t))return void this.errors.remove(i);const{mode:e,factor:s}=b(t);"factor"===e&&(void 0===s||s<=0)?this.errors.addOrReplace({id:i,type:"warning",message:`scale: invalid value '${t}' — expected none/auto or a positive number.`}):this.errors.remove(i)}constructor(i){t(this,i),this.datasetName="",this.dataVersion=0,this.datasetMeta=null,this.appliedScaleFactor=1,this.layoutObserver=null,this.activeErrors=new Set,this.chartTitle="",this.filter="",this.actual="",this.target="",this.ranges="",this.normalize="target",this.variances="auto",this.level="auto",this.order="",this.orderDirection="",this.limit=0,this.labels="",this._autoScaleGuard=!1,this._lastScaledParentHeight=0,this.translateForInner=(t,i)=>this.t(t,i),R(this),E(this),g(this,(t=>{this.datasetName=(null==t?void 0:t.startsWith("$"))?t.substring(1):t||"",this.dataVersion=this.dataVersion+1}),((t,i)=>{this.datasetMeta=i})),this.errors=$(this),this.componentStyle=A(this),this.ruleSetConfig=h(this),this.t=m(this).t}componentWillLoad(){this.validateActual(this.actual),this.validateTarget(this.target),this.validateRanges(this.ranges),this.validateNormalize(this.normalize),this.validateVariances(this.variances),this.validateLevel(this.level),this.validateOrder(this.order),this.validateOrderDirection(this.orderDirection),this.validateLimit(this.limit),this.validateLabels(this.labels),this.validateScale(this.scale)}componentDidRender(){const{mode:t}=b(this.scale);if("auto"!==t&&"empty"!==t)return void(this._autoScaleGuard=!1);if(this._autoScaleGuard)return void(this._autoScaleGuard=!1);const e=this.element,{height:s}=f(e);if(s<=0)return;this._lastScaledParentHeight=s;const r=this.componentStyle((t=>{var i;return(null===(i=t.global)||void 0===i?void 0:i.fontSizePx)||13.3333})),a=e.scrollHeight,n=this.appliedScaleFactor;if(a<=s+1)return void this.errors.remove("AUTO_scale");const l=Math.max(.3,n*(s-1)/a);Math.abs(l-n)<.01||(e.style.setProperty("--bn-font-size",r*l+"px"),"empty"===t?this.errors.addOrReplace({id:"AUTO_scale",type:"warning",message:`Auto-scaled chart by factor ${l.toFixed(3)}`}):this.errors.remove("AUTO_scale"),this._autoScaleGuard=!0,i((()=>{this.appliedScaleFactor=l})))}componentDidLoad(){this.layoutObserver=d(this.element,(()=>{if(this._autoScaleGuard)return;const{height:t}=f(this.element);t>0&&Math.abs(t-this._lastScaledParentHeight)>2&&(this._lastScaledParentHeight=t,e(this))})),requestAnimationFrame((()=>{requestAnimationFrame((()=>{if(this._autoScaleGuard)return;const{height:t}=f(this.element);this._lastScaledParentHeight=t,e(this)}))}))}disconnectedCallback(){var t;null===(t=this.layoutObserver)||void 0===t||t.disconnect(),this.layoutObserver=null}labelDefaults(){return{show:"auto",decimals:1}}setBlockingError(t,i){null===i?(this.errors.remove(t),this.activeErrors.delete(t)):(this.errors.addOrReplace({id:t,type:"error",message:i}),this.activeErrors.add(t))}hasBlockingErrors(){return this.activeErrors.size>0}validateMeasureSpec(t,i){var e;const s=`ERR_bullet_json_${t}`,r=`ERR_bullet_measure_${t}`,a=`WARN_bullet_fields_${t}`,{data:n,parseError:l}=j(i,"measure");if(l)return this.setBlockingError(s,this.t(".bullet-prop-json",{prop:t})),this.setBlockingError(r,null),void this.errors.remove(a);if(this.setBlockingError(s,null),null===n)return this.setBlockingError(r,null),void this.errors.remove(a);const u=(null!==(e=n.measure)&&void 0!==e?e:"").trim(),h=o(u);"auto"===u.toLowerCase()||null!==h&&"scenario"===h.kind?this.setBlockingError(r,null):this.setBlockingError(r,this.t(".bullet-measure-invalid",{prop:t,measure:u})),this.reportSpecIssues(a,t,N(n))}validateEnum(t,i,e,s,r){y(e)||s.includes(e.trim().toLowerCase())?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:`${t}: invalid value '${e}' — expected ${s.join("/")}; using '${r}'.`})}reportSpecIssues(t,i,e){const s=[];null!==e&&e.invalidFields.length>0&&s.push(`invalid: ${e.invalidFields.join(", ")}`),null!==e&&e.unknownKeys.length>0&&s.push(`unknown: ${e.unknownKeys.join(", ")}`),s.length>0?this.errors.addOrReplace({id:t,type:"warning",message:`${i}: ignored sub-fields (${s.join("; ")}).`}):this.errors.remove(t)}prepareActual(){var t,i,e,s,r;const{data:a,parseError:n}=j(this.actual,"measure");if(n)return null;const l=null!==a?N(a).config:null;if(null===l||"auto"===l.measure.toLowerCase()){const r=null!==l,a=null!==(i=null===(t=this.datasetMeta)||void 0===t?void 0:t.availableScenarios)&&void 0!==i?i:[],n=null!==(s=a.includes("ac1")?"ac1":null!==(e=a.find((t=>t.startsWith("ac"))))&&void 0!==e?e:a[0])&&void 0!==s?s:"ac1";return r||null===this.datasetMeta?this.errors.remove("AUTO_actual"):this.errors.addOrReplace({id:"AUTO_actual",type:"warning",message:`actual: not set, auto-detected: ${n}`}),null===l?{measure:n}:Object.assign(Object.assign({},l),{measure:n})}return this.errors.remove("AUTO_actual"),"scenario"===(null===(r=o(l.measure))||void 0===r?void 0:r.kind)?l:null}prepareTarget(){var t,i,e;const{data:s,parseError:r}=j(this.target,"measure");if(r)return null;const a=null!==s?N(s).config:null;if(null===a||"auto"===a.measure.toLowerCase()){const e=null!==a,s=null!==(i=null===(t=this.datasetMeta)||void 0===t?void 0:t.availableScenarios)&&void 0!==i?i:[],r=L.find((t=>s.includes(t)));return void 0===r?(this.errors.remove("AUTO_target"),null!==this.datasetMeta?this.errors.addOrReplace({id:"WARN_bullet_target_unavailable",type:"warning",message:this.t(".bullet-target-none")}):this.errors.remove("WARN_bullet_target_unavailable"),null):(this.errors.remove("WARN_bullet_target_unavailable"),e||null===this.datasetMeta?this.errors.remove("AUTO_target"):this.errors.addOrReplace({id:"AUTO_target",type:"warning",message:`target: not set, auto-detected: ${r}`}),null===a?{measure:r}:Object.assign(Object.assign({},a),{measure:r}))}return this.errors.remove("AUTO_target"),this.errors.remove("WARN_bullet_target_unavailable"),"scenario"===(null===(e=o(a.measure))||void 0===e?void 0:e.kind)?a:null}prepareNormalize(){var t;return"none"===(null===(t=this.normalize)||void 0===t?void 0:t.trim().toLowerCase())?"none":"target"}prepareShowVariances(){var t;return"none"!==(null===(t=this.variances)||void 0===t?void 0:t.trim().toLowerCase())}prepareLevel(){var t,i;const e=null===(t=this.level)||void 0===t?void 0:t.trim().toLowerCase();if("rowgroup"===e)return u.ROWGROUP;if("category"===e)return u.CATEGORY;if("subcategory"===e)return u.SUBCATEGORY;const s=null===(i=this.datasetMeta)||void 0===i?void 0:i.suggestedLevel;if(void 0!==s&&""!==s){const t=u[s.toUpperCase()];if(void 0!==t)return t}return u.CATEGORY}prepareOrder(){var t,i,e,s;const r="auto"===(null===(t=this.order)||void 0===t?void 0:t.trim().toLowerCase());let a;y(this.order)||r?(null===(i=this.datasetMeta)||void 0===i?void 0:i.suggestedOrder)?(r?this.errors.remove("AUTO_order"):this.errors.addOrReplace({id:"AUTO_order",type:"warning",message:`order: not set, auto-detected: ${this.datasetMeta.suggestedOrder}`}),a=this.datasetMeta.suggestedOrder):(this.errors.remove("AUTO_order"),a=""):(this.errors.remove("AUTO_order"),a=this.order);const n=null!==(s=c[null===(e=this.orderDirection)||void 0===e?void 0:e.toUpperCase()])&&void 0!==s?s:c.ASC;if(y(a))return new p([v.CATEGORYINDEX],n);const l=a.split(",").map((t=>v[t.trim().toUpperCase()])).filter((t=>void 0!==t));return new p(l.length>0?l:[v.CATEGORYINDEX],n)}prepareLabels(){const t=this.labelDefaults(),{data:i,parseError:e}=j(this.labels,null);return e||null===i?{show:t.show,decimals:t.decimals}:k(i,t).config}prepareLimit(){const t=Math.floor(Number(this.limit)||0);return t>0?t:0}i18nLocalKeys(){return["no-data","target","axis.in"]}prepareI18n(){const t=new Map(this.i18nLocalKeys().map((t=>[t,this.t(".".concat(t))]))),i=new Map(n.map((t=>[t,this.t("global.".concat(t))])));return new Map([...i.entries(),...t.entries()])}prepareStyle(){const t=this.getEffectiveScaleFactor();return this.componentStyle((i=>{const e=i.global.fontSizePx*t;return{scaleFactors:i["bn-chart-bullet"].scaleFactors,fontStyles:{font:`${e}px ${i.global.fontFamily}`,size:e,color:i.global.fontColor,background:i.global.fontBackgroundColor,leading:1.8},axisStyles:i["bn-chart-bullet"].axisStyles,barStyles:i["bn-chart-bullet"].barStyles,varianceStyles:i["bn-chart-bullet"].varianceStyles,rangeColors:i["bn-chart-bullet"].rangeColors,padding:i["bn-chart-bullet"].padding}}))}getEffectiveScaleFactor(){const{mode:t,factor:i}=b(this.scale);return"factor"===t?i:"auto"===t||"empty"===t?this.appliedScaleFactor:1}getFontStyles(){const t=this.getEffectiveScaleFactor();return this.componentStyle((i=>{var e,s,r,a;const n=(null===(e=i.global)||void 0===e?void 0:e.fontSizePx)||13.3333;return{"--bn-font-family":(null===(s=i.global)||void 0===s?void 0:s.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":n*t+"px","--bn-font-color":(null===(r=i.global)||void 0===r?void 0:r.fontColor)||"#000000","--bn-font-background":(null===(a=i.global)||void 0===a?void 0:a.fontBackgroundColor)||"#ffffff"}}))}getDataStructure(){const t={};for(const i of["ac","pp","fc","pl"])for(const e of[1,2,3,4])t[`${i}${e}`]={type:"number",isOptional:!0,description:""};const i={actual:this.prepareActual(),target:this.prepareTarget()};for(const[e,s]of Object.entries(i))null!==s&&void 0!==t[s.measure]&&(t[s.measure].description=`${e}: ${void 0!==s.label?s.label:s.measure}`);return{IBulletChartDataRow:Object.assign({operation:{type:"string",isOptional:!1,description:""},rowGroup:{type:"string",isOptional:!0,description:""},rowGroupIndex:{type:"number",isOptional:!0,description:""},category:{type:"string",isOptional:!1,description:""},categoryIndex:{type:"number",isOptional:!1,description:""},subCategory:{type:"string",isOptional:!0,description:""},subCategoryIndex:{type:"number",isOptional:!0,description:""}},t)}}chartTemplate(){const t=this.prepareActual(),i=this.prepareTarget(),e=x(this.ranges).ranges,r=this.prepareNormalize();return this.setBlockingError("ERR_bullet_measure_same",null!==t&&null!==i&&t.measure===i.measure?this.t(".bullet-measure-same",{measure:t.measure}):null),e.length>0&&"target"===r?this.errors.addOrReplace({id:"WARN_bullet_ranges_ignored",type:"warning",message:this.t(".bullet-ranges-ignored")}):this.errors.remove("WARN_bullet_ranges_ignored"),this.hasBlockingErrors()||null===t?null:s("ibcs-chart-bullet",{tableName:this.datasetName,dataVersion:this.dataVersion,chartTitle:this.chartTitle,actual:t,target:i,ranges:e,normalize:r,showVariances:this.prepareShowVariances(),level:this.prepareLevel(),order:this.prepareOrder(),limit:this.prepareLimit(),labels:this.prepareLabels(),filter:this.filter,styles:this.prepareStyle(),i18n:this.prepareI18n(),containerWidth:f(this.element).width,ruleSetConfig:this.ruleSetConfig(),errors:this.errors,translate:this.translateForInner})}render(){return s(r,{key:"9fd8c656471de9582652769edf49b80756575830",style:this.getFontStyles()},s("div",{key:"a6fe8d33dde8912a77a86244db092bb364c1aeaa",class:"container"},this.chartTemplate()))}get element(){return a(this)}static get watchers(){return{actual:[{validateActual:0}],target:[{validateTarget:0}],ranges:[{validateRanges:0}],normalize:[{validateNormalize:0}],variances:[{validateVariances:0}],level:[{validateLevel:0}],order:[{validateOrder:0}],orderDirection:[{validateOrderDirection:0}],limit:[{validateLimit:0}],labels:[{validateLabels:0}],scale:[{validateScale:0}]}}};z.style=":host{display:inline-block;position:relative;overflow:hidden}.container{display:flex;flex-direction:column}";export{z as bn_chart_bullet}
1
+ import{r as t,d as i,f as e,h as s,H as r,g as a}from"./p-C5UYpZUU.js";import{a as n}from"./p-C7T4DAAW.js";import{C as l,r as o,A as u}from"./p-DdqXNsKP.js";import{w as h,o as d}from"./p-DWtTjg0f.js";import{O as c,a as p,b as v}from"./p-CbciPY-M.js";import{w as g,a as m,g as f,p as b}from"./p-UtNHLX1j.js";import{v as _,i as y,d as w,a as R,w as O,b as A}from"./p-CuR4S456.js";import{w as $,a as E}from"./p-DtLI_CzV.js";import{p as j}from"./p-BVfLus3u.js";const T=["measure","label","unit"];function N(t){const i=[],e=k(t,"measure",i);if(void 0===e||""===e.trim())return i.push("measure"),{config:null,unknownKeys:L(t,T),invalidFields:i};const s={measure:e.trim()};return s.label=k(t,"label",i),s.unit=k(t,"unit",i),{config:s,unknownKeys:L(t,T),invalidFields:i}}const S=["show","decimals"];function U(t,i){const e=[],s={show:i.show,decimals:i.decimals};return l.isExisting(t.show)&&("auto"===t.show||"none"===t.show?s.show=t.show:e.push("show")),l.isExisting(t.decimals)&&(l.isNumber(t.decimals)&&t.decimals>=0&&t.decimals<=4?s.decimals=Math.floor(t.decimals):e.push("decimals")),{config:s,unknownKeys:L(t,S),invalidFields:e}}function x(t){var i;const e=null!==(i=null==t?void 0:t.trim())&&void 0!==i?i:"";if(""===e||"null"===e)return{ranges:[],parseError:!1,issues:[]};let s;try{s=JSON.parse(e)}catch(t){return{ranges:[],parseError:!0,issues:[]}}if(!Array.isArray(s)||0===s.length)return{ranges:[],parseError:!0,issues:[]};if(!s.every((t=>l.isNumber(t)&&isFinite(t)&&t>0)))return{ranges:[],parseError:!0,issues:[]};const r=[];let a=s;const n=[...a].sort(((t,i)=>t-i));return n.some(((t,i)=>t!==a[i]))&&r.push("not ascending, sorted"),a=n,a.length>2&&(r.push(`${a.length} entries, first 2 kept`),a=a.slice(0,2)),{ranges:a,parseError:!1,issues:r}}function L(t,i){return Object.keys(t).filter((t=>!i.includes(t)))}function k(t,i,e){if(l.isExisting(t[i]))return l.isString(t[i])?t[i]:void e.push(i)}const D=["pl1","pp1","fc1"],W=class{validateActual(t){this.validateMeasureSpec("actual",t)}validateTarget(t){this.validateMeasureSpec("target",t)}validateRanges(t){const i="ERR_bullet_json_ranges",e="WARN_bullet_ranges",s=x(t);if(s.parseError)return this.setBlockingError(i,this.t(".bullet-prop-json",{prop:"ranges"})),void this.errors.remove(e);this.setBlockingError(i,null),s.issues.length>0?this.errors.addOrReplace({id:e,type:"warning",message:this.t(".bullet-ranges-invalid",{detail:s.issues.join("; ")})}):this.errors.remove(e)}validateNormalize(t){this.validateEnum("normalize","ERR_normalize",t,["target","none"],"target")}validateVariances(t){this.validateEnum("variances","ERR_variances",t,["auto","none"],"auto")}validateLevel(t){this.validateEnum("level","ERR_level",t,["auto","rowgroup","category","subcategory"],"auto")}validateOrder(t){const i="ERR_order",e=_(t).filter((t=>""!==t));0===e.length?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:`order: invalid value(s) '${e.join(", ")}'; using the dataset order.`})}validateOrderDirection(t){const i="ERR_orderDirection";y(t)||w(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:`order-direction: invalid value '${t}' — expected asc/desc; using asc.`})}validateLimit(t){const i="ERR_limit";R(t)&&Number(t)>=0?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:`limit: invalid value '${t}' — expected a non-negative integer; using 0.`})}validateLabels(t){const i="ERR_bullet_json_labels",e="WARN_bullet_fields_labels",{data:s,parseError:r}=j(t,null);if(r)return this.setBlockingError(i,this.t(".bullet-prop-json",{prop:"labels"})),void this.errors.remove(e);this.setBlockingError(i,null),null!==s?this.reportSpecIssues(e,"labels",U(s,this.labelDefaults())):this.errors.remove(e)}validateScale(t){const i="ERR_scale";if(y(t))return void this.errors.remove(i);const{mode:e,factor:s}=b(t);"factor"===e&&(void 0===s||s<=0)?this.errors.addOrReplace({id:i,type:"warning",message:`scale: invalid value '${t}' — expected none/auto or a positive number.`}):this.errors.remove(i)}constructor(i){t(this,i),this.datasetName="",this.dataVersion=0,this.datasetMeta=null,this.appliedScaleFactor=1,this.layoutObserver=null,this.activeErrors=new Set,this.chartTitle="",this.filter="",this.actual="",this.target="",this.ranges="",this.normalize="target",this.variances="auto",this.level="auto",this.order="",this.orderDirection="",this.limit=0,this.labels="",this._autoScaleGuard=!1,this._lastScaledParentHeight=0,this.translateForInner=(t,i)=>this.t(t,i),O(this),$(this),g(this,(t=>{this.datasetName=(null==t?void 0:t.startsWith("$"))?t.substring(1):t||"",this.dataVersion=this.dataVersion+1}),((t,i)=>{this.datasetMeta=i})),this.errors=E(this),this.componentStyle=A(this),this.ruleSetConfig=h(this),this.t=m(this).t}componentWillLoad(){this.validateActual(this.actual),this.validateTarget(this.target),this.validateRanges(this.ranges),this.validateNormalize(this.normalize),this.validateVariances(this.variances),this.validateLevel(this.level),this.validateOrder(this.order),this.validateOrderDirection(this.orderDirection),this.validateLimit(this.limit),this.validateLabels(this.labels),this.validateScale(this.scale)}componentDidRender(){const{mode:t}=b(this.scale);if("auto"!==t&&"empty"!==t)return void(this._autoScaleGuard=!1);if(this._autoScaleGuard)return void(this._autoScaleGuard=!1);const e=this.element,{height:s}=f(e);if(s<=0)return;this._lastScaledParentHeight=s;const r=this.componentStyle((t=>{var i;return(null===(i=t.global)||void 0===i?void 0:i.fontSizePx)||13.3333})),a=e.scrollHeight,n=this.appliedScaleFactor;if(a<=s+1)return void this.errors.remove("AUTO_scale");const l=Math.max(.3,n*(s-1)/a);Math.abs(l-n)<.01||(e.style.setProperty("--bn-font-size",r*l+"px"),"empty"===t?this.errors.addOrReplace({id:"AUTO_scale",type:"warning",message:`Auto-scaled chart by factor ${l.toFixed(3)}`}):this.errors.remove("AUTO_scale"),this._autoScaleGuard=!0,i((()=>{this.appliedScaleFactor=l})))}componentDidLoad(){this.layoutObserver=d(this.element,(()=>{if(this._autoScaleGuard)return;const{height:t}=f(this.element);t>0&&Math.abs(t-this._lastScaledParentHeight)>2&&(this._lastScaledParentHeight=t,e(this))})),requestAnimationFrame((()=>{requestAnimationFrame((()=>{if(this._autoScaleGuard)return;const{height:t}=f(this.element);this._lastScaledParentHeight=t,e(this)}))}))}disconnectedCallback(){var t;null===(t=this.layoutObserver)||void 0===t||t.disconnect(),this.layoutObserver=null}labelDefaults(){return{show:"auto",decimals:1}}setBlockingError(t,i){null===i?(this.errors.remove(t),this.activeErrors.delete(t)):(this.errors.addOrReplace({id:t,type:"error",message:i}),this.activeErrors.add(t))}hasBlockingErrors(){return this.activeErrors.size>0}validateMeasureSpec(t,i){var e;const s=`ERR_bullet_json_${t}`,r=`ERR_bullet_measure_${t}`,a=`WARN_bullet_fields_${t}`,{data:n,parseError:l}=j(i,"measure");if(l)return this.setBlockingError(s,this.t(".bullet-prop-json",{prop:t})),this.setBlockingError(r,null),void this.errors.remove(a);if(this.setBlockingError(s,null),null===n)return this.setBlockingError(r,null),void this.errors.remove(a);const u=(null!==(e=n.measure)&&void 0!==e?e:"").trim(),h=o(u);"auto"===u.toLowerCase()||null!==h&&"scenario"===h.kind?this.setBlockingError(r,null):this.setBlockingError(r,this.t(".bullet-measure-invalid",{prop:t,measure:u})),this.reportSpecIssues(a,t,N(n))}validateEnum(t,i,e,s,r){y(e)||s.includes(e.trim().toLowerCase())?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:`${t}: invalid value '${e}' — expected ${s.join("/")}; using '${r}'.`})}reportSpecIssues(t,i,e){const s=[];null!==e&&e.invalidFields.length>0&&s.push(`invalid: ${e.invalidFields.join(", ")}`),null!==e&&e.unknownKeys.length>0&&s.push(`unknown: ${e.unknownKeys.join(", ")}`),s.length>0?this.errors.addOrReplace({id:t,type:"warning",message:`${i}: ignored sub-fields (${s.join("; ")}).`}):this.errors.remove(t)}prepareActual(){var t,i,e,s,r;const{data:a,parseError:n}=j(this.actual,"measure");if(n)return null;const l=null!==a?N(a).config:null;if(null===l||"auto"===l.measure.toLowerCase()){const r=null!==l,a=null!==(i=null===(t=this.datasetMeta)||void 0===t?void 0:t.availableScenarios)&&void 0!==i?i:[],n=null!==(s=a.includes("ac1")?"ac1":null!==(e=a.find((t=>t.startsWith("ac"))))&&void 0!==e?e:a[0])&&void 0!==s?s:"ac1";return r||null===this.datasetMeta?this.errors.remove("AUTO_actual"):this.errors.addOrReplace({id:"AUTO_actual",type:"warning",message:`actual: not set, auto-detected: ${n}`}),null===l?{measure:n}:Object.assign(Object.assign({},l),{measure:n})}return this.errors.remove("AUTO_actual"),"scenario"===(null===(r=o(l.measure))||void 0===r?void 0:r.kind)?l:null}prepareTarget(){var t,i,e;const{data:s,parseError:r}=j(this.target,"measure");if(r)return null;const a=null!==s?N(s).config:null;if(null===a||"auto"===a.measure.toLowerCase()){const e=null!==a,s=null!==(i=null===(t=this.datasetMeta)||void 0===t?void 0:t.availableScenarios)&&void 0!==i?i:[],r=D.find((t=>s.includes(t)));return void 0===r?(this.errors.remove("AUTO_target"),null!==this.datasetMeta?this.errors.addOrReplace({id:"WARN_bullet_target_unavailable",type:"warning",message:this.t(".bullet-target-none")}):this.errors.remove("WARN_bullet_target_unavailable"),null):(this.errors.remove("WARN_bullet_target_unavailable"),e||null===this.datasetMeta?this.errors.remove("AUTO_target"):this.errors.addOrReplace({id:"AUTO_target",type:"warning",message:`target: not set, auto-detected: ${r}`}),null===a?{measure:r}:Object.assign(Object.assign({},a),{measure:r}))}return this.errors.remove("AUTO_target"),this.errors.remove("WARN_bullet_target_unavailable"),"scenario"===(null===(e=o(a.measure))||void 0===e?void 0:e.kind)?a:null}prepareNormalize(){var t;return"none"===(null===(t=this.normalize)||void 0===t?void 0:t.trim().toLowerCase())?"none":"target"}prepareShowVariances(){var t;return"none"!==(null===(t=this.variances)||void 0===t?void 0:t.trim().toLowerCase())}prepareLevel(){var t,i;const e=null===(t=this.level)||void 0===t?void 0:t.trim().toLowerCase();if("rowgroup"===e)return u.ROWGROUP;if("category"===e)return u.CATEGORY;if("subcategory"===e)return u.SUBCATEGORY;const s=null===(i=this.datasetMeta)||void 0===i?void 0:i.suggestedLevel;if(void 0!==s&&""!==s){const t=u[s.toUpperCase()];if(void 0!==t)return t}return u.CATEGORY}prepareOrder(){var t,i,e,s;const r="auto"===(null===(t=this.order)||void 0===t?void 0:t.trim().toLowerCase());let a;y(this.order)||r?(null===(i=this.datasetMeta)||void 0===i?void 0:i.suggestedOrder)?(r?this.errors.remove("AUTO_order"):this.errors.addOrReplace({id:"AUTO_order",type:"warning",message:`order: not set, auto-detected: ${this.datasetMeta.suggestedOrder}`}),a=this.datasetMeta.suggestedOrder):(this.errors.remove("AUTO_order"),a=""):(this.errors.remove("AUTO_order"),a=this.order);const n=null!==(s=c[null===(e=this.orderDirection)||void 0===e?void 0:e.toUpperCase()])&&void 0!==s?s:c.ASC;if(y(a))return new p([v.CATEGORYINDEX],n);const l=a.split(",").map((t=>v[t.trim().toUpperCase()])).filter((t=>void 0!==t));return new p(l.length>0?l:[v.CATEGORYINDEX],n)}prepareLabels(){const t=this.labelDefaults(),{data:i,parseError:e}=j(this.labels,null);return e||null===i?{show:t.show,decimals:t.decimals}:U(i,t).config}prepareLimit(){const t=Math.floor(Number(this.limit)||0);return t>0?t:0}i18nLocalKeys(){return["no-data","target","axis.in"]}prepareI18n(){const t=new Map(this.i18nLocalKeys().map((t=>[t,this.t(".".concat(t))]))),i=new Map(n.map((t=>[t,this.t("global.".concat(t))])));return new Map([...i.entries(),...t.entries()])}prepareStyle(){const t=this.getEffectiveScaleFactor();return this.componentStyle((i=>{const e=i.global.fontSizePx*t;return{scaleFactors:i["bn-chart-bullet"].scaleFactors,fontStyles:{font:`${e}px ${i.global.fontFamily}`,size:e,color:i.global.fontColor,background:i.global.fontBackgroundColor,leading:1.8},axisStyles:i["bn-chart-bullet"].axisStyles,barStyles:i["bn-chart-bullet"].barStyles,varianceStyles:i["bn-chart-bullet"].varianceStyles,rangeColors:i["bn-chart-bullet"].rangeColors,padding:i["bn-chart-bullet"].padding}}))}getEffectiveScaleFactor(){const{mode:t,factor:i}=b(this.scale);return"factor"===t?i:"auto"===t||"empty"===t?this.appliedScaleFactor:1}getFontStyles(){const t=this.getEffectiveScaleFactor();return this.componentStyle((i=>{var e,s,r,a;const n=(null===(e=i.global)||void 0===e?void 0:e.fontSizePx)||13.3333;return{"--bn-font-family":(null===(s=i.global)||void 0===s?void 0:s.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":n*t+"px","--bn-font-color":(null===(r=i.global)||void 0===r?void 0:r.fontColor)||"#000000","--bn-font-background":(null===(a=i.global)||void 0===a?void 0:a.fontBackgroundColor)||"#ffffff"}}))}getDataStructure(){const t={};for(const i of["ac","pp","fc","pl"])for(const e of[1,2,3,4])t[`${i}${e}`]={type:"number",isOptional:!0,description:""};const i={actual:this.prepareActual(),target:this.prepareTarget()};for(const[e,s]of Object.entries(i))null!==s&&void 0!==t[s.measure]&&(t[s.measure].description=`${e}: ${void 0!==s.label?s.label:s.measure}`);return{IBulletChartDataRow:Object.assign({operation:{type:"string",isOptional:!1,description:""},rowGroup:{type:"string",isOptional:!0,description:""},rowGroupIndex:{type:"number",isOptional:!0,description:""},category:{type:"string",isOptional:!1,description:""},categoryIndex:{type:"number",isOptional:!1,description:""},subCategory:{type:"string",isOptional:!0,description:""},subCategoryIndex:{type:"number",isOptional:!0,description:""}},t)}}chartTemplate(){const t=this.prepareActual(),i=this.prepareTarget(),e=x(this.ranges).ranges,r=this.prepareNormalize();return this.setBlockingError("ERR_bullet_measure_same",null!==t&&null!==i&&t.measure===i.measure?this.t(".bullet-measure-same",{measure:t.measure}):null),e.length>0&&"target"===r?this.errors.addOrReplace({id:"WARN_bullet_ranges_ignored",type:"warning",message:this.t(".bullet-ranges-ignored")}):this.errors.remove("WARN_bullet_ranges_ignored"),this.hasBlockingErrors()||null===t?null:s("ibcs-chart-bullet",{tableName:this.datasetName,dataVersion:this.dataVersion,chartTitle:this.chartTitle,actual:t,target:i,ranges:e,normalize:r,showVariances:this.prepareShowVariances(),level:this.prepareLevel(),order:this.prepareOrder(),limit:this.prepareLimit(),labels:this.prepareLabels(),filter:this.filter,styles:this.prepareStyle(),i18n:this.prepareI18n(),containerWidth:f(this.element).width,ruleSetConfig:this.ruleSetConfig(),errors:this.errors,translate:this.translateForInner})}render(){return s(r,{key:"9fd8c656471de9582652769edf49b80756575830",style:this.getFontStyles()},s("div",{key:"a6fe8d33dde8912a77a86244db092bb364c1aeaa",class:"container"},this.chartTemplate()))}get element(){return a(this)}static get watchers(){return{actual:[{validateActual:0}],target:[{validateTarget:0}],ranges:[{validateRanges:0}],normalize:[{validateNormalize:0}],variances:[{validateVariances:0}],level:[{validateLevel:0}],order:[{validateOrder:0}],orderDirection:[{validateOrderDirection:0}],limit:[{validateLimit:0}],labels:[{validateLabels:0}],scale:[{validateScale:0}]}}};W.style=":host{display:inline-block;position:relative;overflow:hidden}.container{display:flex;flex-direction:column}";export{W as bn_chart_bullet}
@@ -1 +1 @@
1
- import{r as t,h as i,H as s,g as h}from"./p-B_d-jp99.js";import{g as n,b as e}from"./p-BgIpdpfH.js";import{A as r,s as o,C as a}from"./p-eEfqksk-.js";import{C as l,F as u,S as c,I as d,a as p,b as v,c as f,P as g}from"./p-DwYUTvvI.js";import{S as m}from"./p-fFtEvsY-.js";import{b as w}from"./p-C5uvAEKI.js";import{N as b}from"./p-DsTzlzxQ.js";class ${constructor(t,i,s,h,n,e){this.ruleSet=t,this.config=h,this.styles=n,this.availableWidth=e,this.rows=[],this.warnings=[],this.i18nMap=new Map,this.populateModel(i,s),this.normalized="target"===this.config.normalize&&this.rows.some((t=>null!==t.fraction)),null!==this.config.target&&this.rows.length>0&&!this.rows.some((t=>null!==t.target))&&this.warnings.push({code:"bullet-target-none",data:{}})}populateModel(t,i){var s,h,n;if(""===i)return;const e=this.config.level,r=this.config.order,o=this.config.actual.measure,a=null!==(h=null===(s=this.config.target)||void 0===s?void 0:s.measure)&&void 0!==h?h:null,l=[o,...null!==a?[a]:[]].map((t=>`SUM(${t}) as ${t}, COUNT(ISNULL(${t})) as ${t}_cnt`)).join(", ");let u;try{u=t.exec(`SELECT ${this.createSelectString(e,r)}, ${l},\n MIN(transformOperator(operation)) as opMin, MAX(transformOperator(operation)) as opMax\n FROM ${i}\n GROUP BY ${this.createGroupByStr(e,r)}\n ORDER BY ${this.createOrderStr(e,r)}`)}catch(t){return void console.error("BulletChart: populateModel query failed",t)}let c=null!=u?u:[];this.config.limit>0&&(c=c.slice(0,this.config.limit));let d=0,p=0,v=0;for(const t of c){const i=this.readValue(t,o),s=null!==a?this.readValue(t,a):null,h="number"==typeof t.opMin?t.opMin:1,e="number"==typeof t.opMax?t.opMax:1;let r=-1===h&&-1===e?"-":"+";h!==e&&(r="+",d++);let l=null;"target"===this.config.normalize&&(null===s?null!==a&&p++:s<=0?v++:null!==i&&(i<0?v++:l=i/s)),this.rows.push({category:String(null!==(n=t.category)&&void 0!==n?n:""),actual:i,target:s,operation:r,sentiment:this.sentiment(i,s,r),fraction:l})}d>0&&this.warnings.push({code:"bullet-mixed-operation",data:{count:String(d)}}),p>0&&this.warnings.push({code:"bullet-target-missing",data:{count:String(p)}}),v>0&&this.warnings.push({code:"bullet-target-invalid",data:{count:String(v)}})}readValue(t,i){if(0===t[`${i}_cnt`])return null;const s=t[i];return"number"==typeof s&&isFinite(s)?s:null}sentiment(t,i,s){return null===t||null===i||t===i?"neu":t>i!=("-"===s)?"pos":"neg"}createSelectString(t,i){return t===r.CATEGORY&&i.hierarchy.includes(w.CATEGORYINDEX)?`${w.CATEGORYINDEX}, ${r.CATEGORY} as category`:t===r.ROWGROUP&&i.hierarchy.includes(w.ROWGROUPINDEX)?`${w.ROWGROUPINDEX}, ${r.ROWGROUP} as category`:t===r.SUBCATEGORY&&i.hierarchy.includes(w.SUBCATEGORYINDEX)?`${w.SUBCATEGORYINDEX}, ${r.SUBCATEGORY} as category`:`${t.toString()} as category`}createGroupByStr(t,i){return t===r.CATEGORY&&i.hierarchy.includes(w.CATEGORYINDEX)?`${w.CATEGORYINDEX}, ${r.CATEGORY}`:t===r.ROWGROUP&&i.hierarchy.includes(w.ROWGROUPINDEX)?`${w.ROWGROUPINDEX}, ${r.ROWGROUP}`:t===r.SUBCATEGORY&&i.hierarchy.includes(w.SUBCATEGORYINDEX)?`${w.SUBCATEGORYINDEX}, ${r.SUBCATEGORY}`:`${t.toString()}`}createOrderStr(t,i){let s=`${t.toLowerCase()}`;return i.hierarchy.length>=1&&(s=`${i.hierarchy.toString()} ${null==i?void 0:i.direction}`),s}get em(){return this.styles.fontStyles.size}fontFamily(){return this.styles.fontStyles.font.replace(/^[\d.]+px\s*/,"")}textWidth(t,i=!1){const s=l(t,{font:this.styles.fontStyles.font,fontSize:this.styles.fontStyles.size+"px",fontWeight:i?"bold":"normal"}).width;return Number.isFinite(s)&&s>0?s:.6*t.length*this.em}drawText(t,i,s,h,n={}){var e,r,o;t.text(i).font({size:null!==(e=n.size)&&void 0!==e?e:this.styles.fontStyles.size,weight:n.bold?"bold":"normal",anchor:null!==(r=n.anchor)&&void 0!==r?r:"start"}).fill(null!==(o=n.color)&&void 0!==o?o:this.styles.fontStyles.color).attr({x:s,y:h,"font-family":this.fontFamily()})}setI18n(t){this.i18nMap=t}hasNoData(){return 0===this.rows.length}getWarnings(){return this.warnings}getAllocatedCanvasWidth(){return this.availableWidth}getAllocatedCanvasHeight(){return this.styles.padding.top+this.titleHeight()+this.headerHeight()+this.rows.length*this.rowBlockHeight()+this.styles.padding.bottom}titleHeight(){return""!==this.config.chartTitle?1.6*this.em:0}headerHeight(){return this.rows.length>0?1.2*this.em:0}rowBlockHeight(){const t=this.em,i=this.styles.scaleFactors.rowHeight*t;return this.normalized?i:i+this.styles.scaleFactors.tickStripHeight*t}valueLabel(t){return null===t||"none"===this.config.labels.show?"":u.number(t,"decimal",this.config.labels.decimals,0)}targetFamily(){var t,i,s;const h=null!==(i=null===(t=this.config.target)||void 0===t?void 0:t.measure)&&void 0!==i?i:"pl1";return null!==(s={10:"ac",20:"pp",30:"fc",50:"pl"}[this.ruleSet.getScenarioColorIndex(h)])&&void 0!==s?s:o(h)}actualLabel(){var t;return null!==(t=this.config.actual.label)&&void 0!==t?t:u.translateScenarioLabel(this.config.actual.measure,this.i18nMap)}targetLabel(){return null===this.config.target?"":void 0!==this.config.target.label?this.config.target.label:this.normalized?this.i18nMap.get("target")||"Target":u.translateScenarioLabel(this.config.target.measure,this.i18nMap)}toString(){const t=new c;return this.draw(t),t.id("drawCanvas"),t.width(this.getAllocatedCanvasWidth()),t.height(this.getAllocatedCanvasHeight()),t.attr("overflow","visible"),t.svg()}draw(t){var i,s;const h=this.em,n=this.styles.scaleFactors,e=this.styles.padding,r=t.group();if(""!==this.config.chartTitle&&this.drawText(r,this.config.chartTitle,e.left,e.top+h,{bold:!0}),0===this.rows.length)return void t.group().addClass("annotations");const o=n.rowHeight*h,a=this.rowBlockHeight(),l=e.top+this.titleHeight()+this.headerHeight(),u=l+(this.rows.length-1)*a+o,c=Math.max(...this.rows.map((t=>this.textWidth(t.category,!0))),h),d=this.rows.map((t=>this.valueLabel(t.actual))),p="none"===this.config.labels.show?0:Math.max(...d.map((t=>this.textWidth(t))),0),v=e.left+c+n.labelToAxis*h,f=Math.max(10,this.availableWidth-v-e.right-p-(p>0?n.labelToBar*h:0)),g=null!==(i=this.config.actual.unit)&&void 0!==i?i:null===(s=this.config.target)||void 0===s?void 0:s.unit,m=this.i18nMap.get("axis.in")||"in",w=l-.35*h;void 0!==g&&""!==g&&this.drawText(r,`${m} ${g}`,e.left,w,{}),this.drawText(r,this.actualLabel(),v+.2*h,w,{}),this.normalized?this.drawNormalized(r,v,f,l,u,o,a,d):this.drawClassic(r,v,f,l,o,a,d),this.rows.forEach(((t,i)=>{this.drawText(r,t.category,v-n.labelToAxis*h,l+i*a+o/2+.35*h,{anchor:"end",bold:!0})})),r.line(v,l-.2*h,v,u+.2*h).stroke({color:this.styles.axisStyles.ac.stroke,width:n.axisLineWidth}),t.group().addClass("annotations")}drawNormalized(t,i,s,h,n,e,r,o){const a=this.em,l=this.styles.scaleFactors,u=1.05*Math.max(1,...this.rows.map((t=>{var i;return null!==(i=t.fraction)&&void 0!==i?i:0}))),c=t=>i+t/u*s,d=c(1),p=this.styles.barStyles.getSVGStyle(this.targetFamily()),v=t.line(d,h-.3*a,d,n+.3*a).stroke({color:p.stroke,width:l.targetLineWidth});void 0!==p.dasharray&&v.attr("stroke-dasharray",p.dasharray),this.drawText(t,this.targetLabel(),d,h-.35*a,{anchor:"middle",bold:!0}),this.rows.forEach(((s,n)=>{const u=h+n*r+e/2;if(null===s.fraction)return void this.drawValueText(t,o[n],i+l.labelToBar*a,u);const p=l.barHeight*a,v=c(s.fraction);if(t.rect(Math.max(0,v-i),p).move(i,u-p/2).fill(this.styles.barStyles.ac.fill).stroke({color:this.styles.barStyles.ac.stroke,width:this.styles.barStyles.ac.width}),this.config.showVariances&&"neu"!==s.sentiment){const i=l.varianceHeight*a,h=this.styles.varianceStyles.getSVGStyle(s.sentiment);t.rect(Math.abs(v-d),i).move(Math.min(v,d),u-i/2).fill(h.fill).stroke({color:h.stroke,width:h.width})}this.drawValueText(t,o[n],Math.max(v,d)+l.labelToBar*a,u)}))}drawClassic(t,i,s,h,n,e,r){const o=this.em,a=this.styles.scaleFactors,l=a.barHeight*o,c=this.config.ranges.length>0;this.rows.forEach(((d,p)=>{var v,f;const g=h+p*e,m=g+n/2,w=c&&null!==d.target?this.config.ranges.map((t=>t*d.target)):[],$=Math.max(null!==(v=d.actual)&&void 0!==v?v:0,null!==(f=d.target)&&void 0!==f?f:0,...w);if($<=0)return void this.drawValueText(t,r[p],i+a.labelToBar*o,m);const M=b.niceStep($,4),y=Math.ceil($/M-1e-9*M)*M,S=new b(0,y,i,i+s);let x=i;w.forEach(((i,s)=>{const h=.8*n;t.rect(Math.max(0,S.scale(i)-x),h).move(x,m-h/2).fill(this.styles.rangeColors[Math.min(s,this.styles.rangeColors.length-1)]).stroke("none"),x=S.scale(i)}));let N=i;if(null!==d.actual&&d.actual>0){const s=S.scale(d.actual);t.rect(s-i,l).move(i,m-l/2).fill(this.styles.barStyles.ac.fill).stroke({color:this.styles.barStyles.ac.stroke,width:this.styles.barStyles.ac.width}),N=s}if(null!==d.target&&d.target>0){const i=S.scale(d.target),s=a.targetTickHeight*o,n=this.styles.barStyles.getSVGStyle(this.targetFamily()),e=t.line(i,m-s/2,i,m+s/2).stroke({color:n.stroke,width:a.targetLineWidth});void 0!==n.dasharray&&e.attr("stroke-dasharray",n.dasharray),0===p&&this.drawText(t,this.targetLabel(),i,h-.35*o,{anchor:"middle"}),N=Math.max(N,i)}N=Math.max(N,x),this.drawValueText(t,r[p],N+a.labelToBar*o,m);const C=S.ticks(4),D=b.tickDecimals(C),E=g+n;for(const i of C){const s=S.scale(i);t.line(s,E,s,E+a.axisTickLength*o).stroke({color:this.styles.axisStyles.ac.stroke,width:a.axisLineWidth}),this.drawText(t,u.number(i,"decimal",D,D),s,E+a.tickStripHeight*o-.2*o,{anchor:"middle"})}}))}drawValueText(t,i,s,h){""!==i&&this.drawText(t,i,s,h+.35*this.em,{})}}class M{constructor(){this.rowHeight=1.9,this.barHeight=.66,this.varianceHeight=.4,this.targetTickHeight=1.1,this.targetLineWidth=2,this.axisLineWidth=1,this.labelToBar=.3,this.labelToAxis=.3,this.axisTickLength=.35,this.tickStripHeight=1.2}}class y{adapt(t){const i=new M;return a.isNumber(t.rowHeight)&&(i.rowHeight=t.rowHeight),a.isNumber(t.barHeight)&&(i.barHeight=t.barHeight),a.isNumber(t.varianceHeight)&&(i.varianceHeight=t.varianceHeight),a.isNumber(t.targetTickHeight)&&(i.targetTickHeight=t.targetTickHeight),a.isNumber(t.targetLineWidth)&&(i.targetLineWidth=t.targetLineWidth),a.isNumber(t.axisLineWidth)&&(i.axisLineWidth=t.axisLineWidth),a.isNumber(t.labelToBar)&&(i.labelToBar=t.labelToBar),a.isNumber(t.labelToAxis)&&(i.labelToAxis=t.labelToAxis),a.isNumber(t.axisTickLength)&&(i.axisTickLength=t.axisTickLength),a.isNumber(t.tickStripHeight)&&(i.tickStripHeight=t.tickStripHeight),i}default(){return new M}}class S{constructor(t,i,s,h,n,e){this.scaleFactors=t,this.fontStyles=i,this.axisStyles=s,this.barStyles=h,this.varianceStyles=n,this.padding=e,this.rangeColors=["#D9D9D9","#EFEFEF"]}}class x{constructor(t,i,s,h,n){this.scaleFactorsBulletChartAdapter=t,this.fontStyleAdapter=i,this.svgStyleGroupAdapter=s,this.svgVariancesStyleGroupAdapter=h,this.paddingAdapter=n}adapt(t){const i=this.default();return a.isExisting(t)&&(a.isExisting(t.scaleFactors)&&(i.scaleFactors=this.scaleFactorsBulletChartAdapter.adapt(t.scaleFactors)),a.isExisting(t.fontStyles)&&(i.fontStyles=this.fontStyleAdapter.adapt(t.fontStyles)),a.isExisting(t.axisStyles)&&(i.axisStyles=this.svgStyleGroupAdapter.adapt(t.axisStyles)),a.isExisting(t.barStyles)&&(i.barStyles=this.svgStyleGroupAdapter.adapt(t.barStyles)),a.isExisting(t.varianceStyles)&&(i.varianceStyles=this.svgVariancesStyleGroupAdapter.adapt(t.varianceStyles)),a.isExisting(t.padding)&&(i.padding=this.paddingAdapter.adapt(t.padding)),Array.isArray(t.rangeColors)&&t.rangeColors.length>0&&(i.rangeColors=t.rangeColors)),i}default(){return new S(this.scaleFactorsBulletChartAdapter.default(),this.fontStyleAdapter.default(),this.svgStyleGroupAdapter.default(),this.svgStyleGroupAdapter.default(),this.svgVariancesStyleGroupAdapter.default(),this.paddingAdapter.default())}}const N=["bullet-target-missing","bullet-target-invalid","bullet-mixed-operation","bullet-target-none"],C=class{constructor(i){t(this,i),this.tableName="",this.dataVersion=0,this.chartTitle="",this.target=null,this.ranges=[],this.normalize="target",this.showVariances=!0,this.level=r.CATEGORY,this.limit=0,this.filter="",this.i18n=new Map,this.containerWidth=0,this.svgMarkup=""}getDb(){return this.stores||(this.stores=n(this.element)),this.stores.db.db}componentWillLoad(){this.rebuild()}componentWillUpdate(){this.rebuild()}rebuild(){const t=this.prepareStyle(),i=this.tableName?e(this.tableName,this.filter):"";this.chart=new $(new d(this.ruleSetConfig),this.getDb(),i,{chartTitle:this.chartTitle,actual:this.actual,target:this.target,ranges:this.ranges,normalize:this.normalize,showVariances:this.showVariances,level:this.level,order:this.order,limit:this.limit,labels:this.labels},t,this.containerWidth||0),this.chart.setI18n(this.i18n),this.svgMarkup=this.chart.hasNoData()?"":this.chart.toString(),this.syncWarnings(this.chart.getWarnings())}syncWarnings(t){if(void 0===this.errors)return;const i=new Map(t.map((t=>[t.code,t.data])));for(const t of N){const s=`WARN_${t}`;if(i.has(t)){const h=void 0!==this.translate?this.translate(`.${t}`,i.get(t)):t;this.errors.addOrReplace({id:s,type:"warning",message:h})}else this.errors.remove(s)}}prepareStyle(){return new x(new y,new p,new v(new f),new m(new f),new g).adapt(this.styles)}render(){if(void 0===this.chart)return i(s,null);if(this.chart.hasNoData()){const t=this.i18n.get("no-data")||"==No Data==";return i(s,null,i("p",{class:"warning"},t))}return i(s,null,i("div",{innerHTML:this.svgMarkup}))}get element(){return h(this)}};C.style=':host{position:relative;display:inline-block}.warning{font-family:var(--bn-font-family, "Noto Sans", "Helvetica Neue", Helvetica, sans-serif);color:var(--bn-font-color, black)}';export{C as ibcs_chart_bullet}
1
+ import{r as t,h as i,H as s,g as h}from"./p-C5UYpZUU.js";import{g as n,b as r}from"./p-C7T4DAAW.js";import{A as e,s as o,C as a}from"./p-DdqXNsKP.js";import{C as l,F as u,S as c,I as d,a as p,b as v,c as f,P as g}from"./p-B5x8M8OC.js";import{S as m}from"./p-BGrnfif3.js";import{b as w}from"./p-CbciPY-M.js";import{N as b}from"./p-DsTzlzxQ.js";class ${constructor(t,i,s,h,n,r){this.ruleSet=t,this.config=h,this.styles=n,this.availableWidth=r,this.rows=[],this.warnings=[],this.i18nMap=new Map,this.populateModel(i,s),this.normalized="target"===this.config.normalize&&this.rows.some((t=>null!==t.fraction)),null!==this.config.target&&this.rows.length>0&&!this.rows.some((t=>null!==t.target))&&this.warnings.push({code:"bullet-target-none",data:{}})}populateModel(t,i){var s,h,n;if(""===i)return;const r=this.config.level,e=this.config.order,o=this.config.actual.measure,a=null!==(h=null===(s=this.config.target)||void 0===s?void 0:s.measure)&&void 0!==h?h:null,l=[o,...null!==a?[a]:[]].map((t=>`SUM(${t}) as ${t}, COUNT(ISNULL(${t})) as ${t}_cnt`)).join(", ");let u;try{u=t.exec(`SELECT ${this.createSelectString(r,e)}, ${l},\n MIN(transformOperator(operation)) as opMin, MAX(transformOperator(operation)) as opMax\n FROM ${i}\n GROUP BY ${this.createGroupByStr(r,e)}\n ORDER BY ${this.createOrderStr(r,e)}`)}catch(t){return void console.error("BulletChart: populateModel query failed",t)}let c=null!=u?u:[];this.config.limit>0&&(c=c.slice(0,this.config.limit));let d=0,p=0,v=0;for(const t of c){const i=this.readValue(t,o),s=null!==a?this.readValue(t,a):null,h="number"==typeof t.opMin?t.opMin:1,r="number"==typeof t.opMax?t.opMax:1;let e=-1===h&&-1===r?"-":"+";h!==r&&(e="+",d++);let l=null;"target"===this.config.normalize&&(null===s?null!==a&&p++:s<=0?v++:null!==i&&(i<0?v++:l=i/s)),this.rows.push({category:String(null!==(n=t.category)&&void 0!==n?n:""),actual:i,target:s,operation:e,sentiment:this.sentiment(i,s,e),fraction:l})}d>0&&this.warnings.push({code:"bullet-mixed-operation",data:{count:String(d)}}),p>0&&this.warnings.push({code:"bullet-target-missing",data:{count:String(p)}}),v>0&&this.warnings.push({code:"bullet-target-invalid",data:{count:String(v)}})}readValue(t,i){if(0===t[`${i}_cnt`])return null;const s=t[i];return"number"==typeof s&&isFinite(s)?s:null}sentiment(t,i,s){return null===t||null===i||t===i?"neu":t>i!=("-"===s)?"pos":"neg"}createSelectString(t,i){return t===e.CATEGORY&&i.hierarchy.includes(w.CATEGORYINDEX)?`${w.CATEGORYINDEX}, ${e.CATEGORY} as category`:t===e.ROWGROUP&&i.hierarchy.includes(w.ROWGROUPINDEX)?`${w.ROWGROUPINDEX}, ${e.ROWGROUP} as category`:t===e.SUBCATEGORY&&i.hierarchy.includes(w.SUBCATEGORYINDEX)?`${w.SUBCATEGORYINDEX}, ${e.SUBCATEGORY} as category`:`${t.toString()} as category`}createGroupByStr(t,i){return t===e.CATEGORY&&i.hierarchy.includes(w.CATEGORYINDEX)?`${w.CATEGORYINDEX}, ${e.CATEGORY}`:t===e.ROWGROUP&&i.hierarchy.includes(w.ROWGROUPINDEX)?`${w.ROWGROUPINDEX}, ${e.ROWGROUP}`:t===e.SUBCATEGORY&&i.hierarchy.includes(w.SUBCATEGORYINDEX)?`${w.SUBCATEGORYINDEX}, ${e.SUBCATEGORY}`:`${t.toString()}`}createOrderStr(t,i){let s=`${t.toLowerCase()}`;return i.hierarchy.length>=1&&(s=`${i.hierarchy.toString()} ${null==i?void 0:i.direction}`),s}get em(){return this.styles.fontStyles.size}fontFamily(){return this.styles.fontStyles.font.replace(/^[\d.]+px\s*/,"")}textWidth(t,i=!1){const s=l(t,{font:this.styles.fontStyles.font,fontSize:this.styles.fontStyles.size+"px",fontWeight:i?"bold":"normal"}).width;return Number.isFinite(s)&&s>0?s:.6*t.length*this.em}drawText(t,i,s,h,n={}){var r,e,o;t.text(i).font({size:null!==(r=n.size)&&void 0!==r?r:this.styles.fontStyles.size,weight:n.bold?"bold":"normal",anchor:null!==(e=n.anchor)&&void 0!==e?e:"start"}).fill(null!==(o=n.color)&&void 0!==o?o:this.styles.fontStyles.color).attr({x:s,y:h,"font-family":this.fontFamily()})}setI18n(t){this.i18nMap=t}hasNoData(){return 0===this.rows.length}getWarnings(){return this.warnings}getAllocatedCanvasWidth(){return this.availableWidth}getAllocatedCanvasHeight(){return this.styles.padding.top+this.titleHeight()+this.headerHeight()+this.rows.length*this.rowBlockHeight()+this.styles.padding.bottom}titleHeight(){return""!==this.config.chartTitle?1.6*this.em:0}headerHeight(){return this.rows.length>0?1.2*this.em:0}rowBlockHeight(){const t=this.em,i=this.styles.scaleFactors.rowHeight*t;return this.normalized?i:i+this.styles.scaleFactors.tickStripHeight*t}valueLabel(t){return null===t||"none"===this.config.labels.show?"":u.number(t,"decimal",this.config.labels.decimals,0)}targetFamily(){var t,i,s;const h=null!==(i=null===(t=this.config.target)||void 0===t?void 0:t.measure)&&void 0!==i?i:"pl1";return null!==(s={10:"ac",20:"pp",30:"fc",50:"pl"}[this.ruleSet.getScenarioColorIndex(h)])&&void 0!==s?s:o(h)}actualLabel(){var t;return null!==(t=this.config.actual.label)&&void 0!==t?t:u.translateScenarioLabel(this.config.actual.measure,this.i18nMap)}targetLabel(){return null===this.config.target?"":void 0!==this.config.target.label?this.config.target.label:this.normalized?this.i18nMap.get("target")||"Target":u.translateScenarioLabel(this.config.target.measure,this.i18nMap)}toString(){const t=new c;return this.draw(t),t.id("drawCanvas"),t.width(this.getAllocatedCanvasWidth()),t.height(this.getAllocatedCanvasHeight()),t.attr("overflow","visible"),t.svg()}draw(t){var i,s;const h=this.em,n=this.styles.scaleFactors,r=this.styles.padding,e=t.group();if(""!==this.config.chartTitle&&this.drawText(e,this.config.chartTitle,r.left,r.top+h,{bold:!0}),0===this.rows.length)return void t.group().addClass("annotations");const o=n.rowHeight*h,a=this.rowBlockHeight(),l=r.top+this.titleHeight()+this.headerHeight(),u=l+(this.rows.length-1)*a+o,c=Math.max(...this.rows.map((t=>this.textWidth(t.category,!0))),h),d=this.rows.map((t=>this.valueLabel(t.actual))),p="none"===this.config.labels.show?0:Math.max(...d.map((t=>this.textWidth(t))),0),v=r.left+c+n.labelToAxis*h,f=Math.max(10,this.availableWidth-v-r.right-p-(p>0?n.labelToBar*h:0)),g=null!==(i=this.config.actual.unit)&&void 0!==i?i:null===(s=this.config.target)||void 0===s?void 0:s.unit,m=this.i18nMap.get("axis.in")||"in",w=l-.35*h;void 0!==g&&""!==g&&this.drawText(e,`${m} ${g}`,r.left,w,{}),this.drawText(e,this.actualLabel(),v+.2*h,w,{}),this.normalized?this.drawNormalized(e,v,f,l,u,o,a,d):this.drawClassic(e,v,f,l,o,a,d),this.rows.forEach(((t,i)=>{this.drawText(e,t.category,v-n.labelToAxis*h,l+i*a+o/2+.35*h,{anchor:"end",bold:!0})})),e.line(v,l-.2*h,v,u+.2*h).stroke({color:this.styles.axisStyles.ac.stroke,width:n.axisLineWidth}),t.group().addClass("annotations")}drawNormalized(t,i,s,h,n,r,e,o){const a=this.em,l=this.styles.scaleFactors,u=1.05*Math.max(1,...this.rows.map((t=>{var i;return null!==(i=t.fraction)&&void 0!==i?i:0}))),c=t=>i+t/u*s,d=c(1),p=this.styles.barStyles.getSVGStyle(this.targetFamily()),v=t.line(d,h-.3*a,d,n+.3*a).stroke({color:p.stroke,width:l.targetLineWidth});void 0!==p.dasharray&&v.attr("stroke-dasharray",p.dasharray),this.drawText(t,this.targetLabel(),d,h-.35*a,{anchor:"middle",bold:!0}),this.rows.forEach(((s,n)=>{const u=h+n*e+r/2;if(null===s.fraction)return void this.drawValueText(t,o[n],i+l.labelToBar*a,u);const p=l.barHeight*a,v=c(s.fraction);if(t.rect(Math.max(0,v-i),p).move(i,u-p/2).fill(this.styles.barStyles.ac.fill).stroke({color:this.styles.barStyles.ac.stroke,width:this.styles.barStyles.ac.width}),this.config.showVariances&&"neu"!==s.sentiment){const i=l.varianceHeight*a,h=this.styles.varianceStyles.getSVGStyle(s.sentiment);t.rect(Math.abs(v-d),i).move(Math.min(v,d),u-i/2).fill(h.fill).stroke({color:h.stroke,width:h.width})}this.drawValueText(t,o[n],Math.max(v,d)+l.labelToBar*a,u)}))}drawClassic(t,i,s,h,n,r,e){const o=this.em,a=this.styles.scaleFactors,l=a.barHeight*o,c=this.config.ranges.length>0;this.rows.forEach(((d,p)=>{var v,f;const g=h+p*r,m=g+n/2,w=c&&null!==d.target?this.config.ranges.map((t=>t*d.target)):[],$=Math.max(null!==(v=d.actual)&&void 0!==v?v:0,null!==(f=d.target)&&void 0!==f?f:0,...w);if($<=0)return void this.drawValueText(t,e[p],i+a.labelToBar*o,m);const M=b.niceStep($,4),y=Math.ceil($/M-1e-9*M)*M,S=new b(0,y,i,i+s);let x=i;w.forEach(((i,s)=>{const h=.8*n;t.rect(Math.max(0,S.scale(i)-x),h).move(x,m-h/2).fill(this.styles.rangeColors[Math.min(s,this.styles.rangeColors.length-1)]).stroke("none"),x=S.scale(i)}));let C=i;if(null!==d.actual&&d.actual>0){const s=S.scale(d.actual);t.rect(s-i,l).move(i,m-l/2).fill(this.styles.barStyles.ac.fill).stroke({color:this.styles.barStyles.ac.stroke,width:this.styles.barStyles.ac.width}),C=s}if(null!==d.target&&d.target>0){const i=S.scale(d.target),s=a.targetTickHeight*o,n=this.styles.barStyles.getSVGStyle(this.targetFamily()),r=t.line(i,m-s/2,i,m+s/2).stroke({color:n.stroke,width:a.targetLineWidth});void 0!==n.dasharray&&r.attr("stroke-dasharray",n.dasharray),0===p&&this.drawText(t,this.targetLabel(),i,h-.35*o,{anchor:"middle"}),C=Math.max(C,i)}C=Math.max(C,x),this.drawValueText(t,e[p],C+a.labelToBar*o,m);const N=S.ticks(4),D=b.tickDecimals(N),T=g+n;for(const i of N){const s=S.scale(i);t.line(s,T,s,T+a.axisTickLength*o).stroke({color:this.styles.axisStyles.ac.stroke,width:a.axisLineWidth}),this.drawText(t,u.number(i,"decimal",D,D),s,T+a.tickStripHeight*o-.2*o,{anchor:"middle"})}}))}drawValueText(t,i,s,h){""!==i&&this.drawText(t,i,s,h+.35*this.em,{})}}class M{constructor(){this.rowHeight=1.9,this.barHeight=.66,this.varianceHeight=.4,this.targetTickHeight=1.1,this.targetLineWidth=2,this.axisLineWidth=1,this.labelToBar=.3,this.labelToAxis=.3,this.axisTickLength=.35,this.tickStripHeight=1.2}}class y{adapt(t){const i=new M;return a.isNumber(t.rowHeight)&&(i.rowHeight=t.rowHeight),a.isNumber(t.barHeight)&&(i.barHeight=t.barHeight),a.isNumber(t.varianceHeight)&&(i.varianceHeight=t.varianceHeight),a.isNumber(t.targetTickHeight)&&(i.targetTickHeight=t.targetTickHeight),a.isNumber(t.targetLineWidth)&&(i.targetLineWidth=t.targetLineWidth),a.isNumber(t.axisLineWidth)&&(i.axisLineWidth=t.axisLineWidth),a.isNumber(t.labelToBar)&&(i.labelToBar=t.labelToBar),a.isNumber(t.labelToAxis)&&(i.labelToAxis=t.labelToAxis),a.isNumber(t.axisTickLength)&&(i.axisTickLength=t.axisTickLength),a.isNumber(t.tickStripHeight)&&(i.tickStripHeight=t.tickStripHeight),i}default(){return new M}}class S{constructor(t,i,s,h,n,r){this.scaleFactors=t,this.fontStyles=i,this.axisStyles=s,this.barStyles=h,this.varianceStyles=n,this.padding=r,this.rangeColors=["#D9D9D9","#EFEFEF"]}}class x{constructor(t,i,s,h,n){this.scaleFactorsBulletChartAdapter=t,this.fontStyleAdapter=i,this.svgStyleGroupAdapter=s,this.svgVariancesStyleGroupAdapter=h,this.paddingAdapter=n}adapt(t){const i=this.default();return a.isExisting(t)&&(a.isExisting(t.scaleFactors)&&(i.scaleFactors=this.scaleFactorsBulletChartAdapter.adapt(t.scaleFactors)),a.isExisting(t.fontStyles)&&(i.fontStyles=this.fontStyleAdapter.adapt(t.fontStyles)),a.isExisting(t.axisStyles)&&(i.axisStyles=this.svgStyleGroupAdapter.adapt(t.axisStyles)),a.isExisting(t.barStyles)&&(i.barStyles=this.svgStyleGroupAdapter.adapt(t.barStyles)),a.isExisting(t.varianceStyles)&&(i.varianceStyles=this.svgVariancesStyleGroupAdapter.adapt(t.varianceStyles)),a.isExisting(t.padding)&&(i.padding=this.paddingAdapter.adapt(t.padding)),Array.isArray(t.rangeColors)&&t.rangeColors.length>0&&(i.rangeColors=t.rangeColors)),i}default(){return new S(this.scaleFactorsBulletChartAdapter.default(),this.fontStyleAdapter.default(),this.svgStyleGroupAdapter.default(),this.svgStyleGroupAdapter.default(),this.svgVariancesStyleGroupAdapter.default(),this.paddingAdapter.default())}}const C=["bullet-target-missing","bullet-target-invalid","bullet-mixed-operation","bullet-target-none"],N=class{constructor(i){t(this,i),this.tableName="",this.dataVersion=0,this.chartTitle="",this.target=null,this.ranges=[],this.normalize="target",this.showVariances=!0,this.level=e.CATEGORY,this.limit=0,this.filter="",this.i18n=new Map,this.containerWidth=0,this.svgMarkup=""}getDb(){return this.stores||(this.stores=n(this.element)),this.stores.db.db}componentWillLoad(){this.rebuild()}componentWillUpdate(){this.rebuild()}rebuild(){const t=this.prepareStyle(),i=this.tableName?r(this.tableName,this.filter):"";this.chart=new $(new d(this.ruleSetConfig),this.getDb(),i,{chartTitle:this.chartTitle,actual:this.actual,target:this.target,ranges:this.ranges,normalize:this.normalize,showVariances:this.showVariances,level:this.level,order:this.order,limit:this.limit,labels:this.labels},t,this.containerWidth||0),this.chart.setI18n(this.i18n),this.svgMarkup=this.chart.hasNoData()?"":this.chart.toString(),this.syncWarnings(this.chart.getWarnings())}syncWarnings(t){if(void 0===this.errors)return;const i=new Map(t.map((t=>[t.code,t.data])));for(const t of C){const s=`WARN_${t}`;if(i.has(t)){const h=void 0!==this.translate?this.translate(`.${t}`,i.get(t)):t;this.errors.addOrReplace({id:s,type:"warning",message:h})}else this.errors.remove(s)}}prepareStyle(){return new x(new y,new p,new v(new f),new m(new f),new g).adapt(this.styles)}render(){if(void 0===this.chart)return i(s,null);if(this.chart.hasNoData()){const t=this.i18n.get("no-data")||"==No Data==";return i(s,null,i("p",{class:"warning"},t))}return i(s,null,i("div",{innerHTML:this.svgMarkup}))}get element(){return h(this)}};N.style=':host{position:relative;display:inline-block}.warning{font-family:var(--bn-font-family, "Noto Sans", "Helvetica Neue", Helvetica, sans-serif);color:var(--bn-font-color, black)}';export{N as ibcs_chart_bullet}
@@ -1 +1 @@
1
- import{r as t,h as i,H as o,g as e}from"./p-B_d-jp99.js";import{a as n,w as s,g as a,p as l}from"./p-C9i1Xsib.js";import{w as r,a as d}from"./p-B4JfKvVT.js";import{w as f,b as v}from"./p-BpWWgN6k.js";import{s as c}from"./p-BA48JiHe.js";import"./p-BgIpdpfH.js";import"./p-eEfqksk-.js";import"./p-C5uvAEKI.js";const h=/\b(__proto__|globalThis)\b|\.constructor\b/,u=class{constructor(i){t(this,i),this.data={},f(this),r(this),this.errors=d(this),this.t=n(this).t,s(this,((t,i)=>{this.data=Object.assign(Object.assign({},this.data),{[t]:i})})),this.componentStyle=v(this)}validateValue(t){"string"!=typeof t||""===t?this.errors.addOrReplace({id:"no_value",type:"warning",message:"Empty value"}):this.errors.remove("no_value")}validateScaling(t){if(null==t||""===t||"none"===t||"auto"===t)return void this.errors.remove("ERR_scale");const i=Number(t);isNaN(i)||i<=0?this.errors.addOrReplace({id:"ERR_scale",type:"warning",message:`Invalid scale value: "${t}". Use "none", "auto", or a positive number.`}):this.errors.remove("ERR_scale")}componentWillLoad(){this.validateValue(this.value),this.validateScaling(this.scale)}evalTemplate(t){if(!t)return"";if(h.test(t))return this.errors.addOrReplace({id:"ERR_value_eval",type:"error",message:"Template contains forbidden pattern"}),"";try{const i=new Proxy({data:this.data,t:this.t},{has:()=>!0,get:(t,i)=>i===Symbol.unscopables?void 0:t[i],set:()=>!0}),o=new Function("sandbox","with(sandbox){try{return`"+t+'`}catch(e){return""}}').call(i,i);return this.errors.remove("ERR_value_eval"),null!=o?String(o):""}catch(t){return this.errors.addOrReplace({id:"ERR_value_eval",type:"error",message:`Template evaluation failed: ${t instanceof Error?t.message:String(t)}`}),""}}prepareStyle(){return this.componentStyle((t=>{var i,o,e,n,s,a,l,r,d,f,v,c,h,u,p,b,m,g,y,w,_,$;return{fontStyles:{font:`${null!==(n=null!==(o=null===(i=t["bn-text"])||void 0===i?void 0:i.fontSizePx)&&void 0!==o?o:null===(e=t.global)||void 0===e?void 0:e.fontSizePx)&&void 0!==n?n:13.3333}px ${null!==(r=null!==(a=null===(s=t["bn-text"])||void 0===s?void 0:s.fontFamily)&&void 0!==a?a:null===(l=t.global)||void 0===l?void 0:l.fontFamily)&&void 0!==r?r:"'Noto Sans', sans-serif"}`,size:null!==(c=null!==(f=null===(d=t["bn-text"])||void 0===d?void 0:d.fontSizePx)&&void 0!==f?f:null===(v=t.global)||void 0===v?void 0:v.fontSizePx)&&void 0!==c?c:13.3333,color:null!==(b=null!==(u=null===(h=t["bn-text"])||void 0===h?void 0:h.fontColor)&&void 0!==u?u:null===(p=t.global)||void 0===p?void 0:p.fontColor)&&void 0!==b?b:"#000000",background:null!==(w=null!==(g=null===(m=t["bn-text"])||void 0===m?void 0:m.fontBackgroundColor)&&void 0!==g?g:null===(y=t.global)||void 0===y?void 0:y.fontBackgroundColor)&&void 0!==w?w:"#ffffff",leading:null!==($=null===(_=t["bn-text"])||void 0===_?void 0:_.leading)&&void 0!==$?$:1.8}}}))}applyScaling(t){const i=this.element,{mode:o,factor:e}=l(this.scale),{width:n,height:s}=a(i),r=i.scrollHeight>i.clientHeight+1?i.clientHeight:s,d=n,f=d>0&&i.scrollWidth>d+1,v=r>0&&i.scrollHeight>r+1,c=f||v;if(d<=0&&r<=0)return;if("none"===o){if(c){const t=[];f&&t.push(`w:${i.scrollWidth}>${Math.round(d)}`),v&&t.push(`h:${i.scrollHeight}>${Math.round(r)}`),this.errors.addOrReplace({id:"WARN_overflow",type:"warning",message:`Content overflows container (${t.join(", ")})`})}else this.errors.remove("WARN_overflow");return}if("factor"===o){if(c){const t=[];f&&t.push(`w:${i.scrollWidth}>${Math.round(d)}`),v&&t.push(`h:${i.scrollHeight}>${Math.round(r)}`),this.errors.addOrReplace({id:"WARN_overflow",type:"warning",message:`Content overflows with factor ${e} (${t.join(", ")})`})}else this.errors.remove("WARN_overflow");return}i.style.setProperty("--bn-font-size",`${t}px`);const h=i.scrollWidth,u=i.scrollHeight,p=i.clientHeight,b=u>p+1?p:s,m=d<=0||h<=d+1,g=b<=0||u<=b+1;if(m&&g)return void this.errors.remove("AUTO_scale");const y=Math.min(1,!m&&d>0?d/h:1,!g&&b>0?b/u:1);i.style.setProperty("--bn-font-size",t*y+"px"),"empty"===o?this.errors.addOrReplace({id:"AUTO_scale",type:"warning",message:`Auto-scaled font by factor ${y.toFixed(3)}`}):this.errors.remove("AUTO_scale")}componentDidRender(){this.container.innerHTML=c(this.evalTemplate(this.value)),this.applyScaling(this.prepareStyle().fontStyles.size)}render(){const{fontStyles:t}=this.prepareStyle(),{mode:e,factor:n}=l(this.scale),s="factor"===e?t.size*n+"px":`${t.size}px`,a={"--bn-font-family":t.font.substring(t.font.indexOf("px ")+3),"--bn-font-size":s,"--bn-font-color":t.color,"--bn-font-background":t.background};return i(o,{key:"b5516777bb29ddddf3fb43ff518fdc383c86a812",style:a},i("div",{key:"dc325b0679f0a151ac60d32cae70f2a2f14ae205"},i("span",{key:"fcdc9c6cb9224428e7b47df3ac10336bcdffb260",class:"container",ref:t=>{this.container=t}})))}get element(){return e(this)}static get watchers(){return{value:[{validateValue:0}],scale:[{validateScaling:0}]}}};u.style=':host{padding:0.5em;display:inline-block;position:relative;overflow:hidden;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000);background-color:var(--bn-font-background, white)}span.container p{margin:0}';export{u as bn_text}
1
+ import{r as t,h as i,H as o,g as e}from"./p-C5UYpZUU.js";import{a as n,w as s,g as a,p as l}from"./p-UtNHLX1j.js";import{w as r,a as d}from"./p-DtLI_CzV.js";import{w as c,b as f}from"./p-CuR4S456.js";import{s as v}from"./p-BA48JiHe.js";import"./p-C7T4DAAW.js";import"./p-DdqXNsKP.js";import"./p-CbciPY-M.js";const h=/\b(__proto__|globalThis)\b|\.constructor\b/,u=class{constructor(i){t(this,i),this.data={},c(this),r(this),this.errors=d(this),this.t=n(this).t,s(this,((t,i)=>{this.data=Object.assign(Object.assign({},this.data),{[t]:i})})),this.componentStyle=f(this)}validateValue(t){"string"!=typeof t||""===t?this.errors.addOrReplace({id:"no_value",type:"warning",message:"Empty value"}):this.errors.remove("no_value")}validateScaling(t){if(null==t||""===t||"none"===t||"auto"===t)return void this.errors.remove("ERR_scale");const i=Number(t);isNaN(i)||i<=0?this.errors.addOrReplace({id:"ERR_scale",type:"warning",message:`Invalid scale value: "${t}". Use "none", "auto", or a positive number.`}):this.errors.remove("ERR_scale")}componentWillLoad(){this.validateValue(this.value),this.validateScaling(this.scale)}evalTemplate(t){if(!t)return"";if(h.test(t))return this.errors.addOrReplace({id:"ERR_value_eval",type:"error",message:"Template contains forbidden pattern"}),"";try{const i=new Proxy({data:this.data,t:this.t},{has:()=>!0,get:(t,i)=>i===Symbol.unscopables?void 0:t[i],set:()=>!0}),o=new Function("sandbox","with(sandbox){try{return`"+t+'`}catch(e){return""}}').call(i,i);return this.errors.remove("ERR_value_eval"),null!=o?String(o):""}catch(t){return this.errors.addOrReplace({id:"ERR_value_eval",type:"error",message:`Template evaluation failed: ${t instanceof Error?t.message:String(t)}`}),""}}prepareStyle(){return this.componentStyle((t=>{var i,o,e,n,s,a,l,r,d,c,f,v,h,u,p,b,m,g,y,w,_,R;return{fontStyles:{font:`${null!==(n=null!==(o=null===(i=t["bn-text"])||void 0===i?void 0:i.fontSizePx)&&void 0!==o?o:null===(e=t.global)||void 0===e?void 0:e.fontSizePx)&&void 0!==n?n:13.3333}px ${null!==(r=null!==(a=null===(s=t["bn-text"])||void 0===s?void 0:s.fontFamily)&&void 0!==a?a:null===(l=t.global)||void 0===l?void 0:l.fontFamily)&&void 0!==r?r:"'Noto Sans', sans-serif"}`,size:null!==(v=null!==(c=null===(d=t["bn-text"])||void 0===d?void 0:d.fontSizePx)&&void 0!==c?c:null===(f=t.global)||void 0===f?void 0:f.fontSizePx)&&void 0!==v?v:13.3333,color:null!==(b=null!==(u=null===(h=t["bn-text"])||void 0===h?void 0:h.fontColor)&&void 0!==u?u:null===(p=t.global)||void 0===p?void 0:p.fontColor)&&void 0!==b?b:"#000000",background:null!==(w=null!==(g=null===(m=t["bn-text"])||void 0===m?void 0:m.fontBackgroundColor)&&void 0!==g?g:null===(y=t.global)||void 0===y?void 0:y.fontBackgroundColor)&&void 0!==w?w:"#ffffff",leading:null!==(R=null===(_=t["bn-text"])||void 0===_?void 0:_.leading)&&void 0!==R?R:1.8}}}))}applyScaling(t){const i=this.element,{mode:o,factor:e}=l(this.scale),{width:n,height:s}=a(i),r=i.scrollHeight>i.clientHeight+1?i.clientHeight:s,d=n,c=d>0&&i.scrollWidth>d+1,f=r>0&&i.scrollHeight>r+1,v=c||f;if(d<=0&&r<=0)return;if("none"===o){if(v){const t=[];c&&t.push(`w:${i.scrollWidth}>${Math.round(d)}`),f&&t.push(`h:${i.scrollHeight}>${Math.round(r)}`),this.errors.addOrReplace({id:"WARN_overflow",type:"warning",message:`Content overflows container (${t.join(", ")})`})}else this.errors.remove("WARN_overflow");return}if("factor"===o){if(v){const t=[];c&&t.push(`w:${i.scrollWidth}>${Math.round(d)}`),f&&t.push(`h:${i.scrollHeight}>${Math.round(r)}`),this.errors.addOrReplace({id:"WARN_overflow",type:"warning",message:`Content overflows with factor ${e} (${t.join(", ")})`})}else this.errors.remove("WARN_overflow");return}i.style.setProperty("--bn-font-size",`${t}px`);const h=i.scrollWidth,u=i.scrollHeight,p=i.clientHeight,b=u>p+1?p:s,m=d<=0||h<=d+1,g=b<=0||u<=b+1;if(m&&g)return void this.errors.remove("AUTO_scale");const y=Math.min(1,!m&&d>0?d/h:1,!g&&b>0?b/u:1);i.style.setProperty("--bn-font-size",t*y+"px"),"empty"===o?this.errors.addOrReplace({id:"AUTO_scale",type:"warning",message:`Auto-scaled font by factor ${y.toFixed(3)}`}):this.errors.remove("AUTO_scale")}componentDidRender(){this.container.innerHTML=v(this.evalTemplate(this.value)),this.applyScaling(this.prepareStyle().fontStyles.size)}render(){const{fontStyles:t}=this.prepareStyle(),{mode:e,factor:n}=l(this.scale),s="factor"===e?t.size*n+"px":`${t.size}px`,a={"--bn-font-family":t.font.substring(t.font.indexOf("px ")+3),"--bn-font-size":s,"--bn-font-color":t.color,"--bn-font-background":t.background};return i(o,{key:"b5516777bb29ddddf3fb43ff518fdc383c86a812",style:a},i("div",{key:"dc325b0679f0a151ac60d32cae70f2a2f14ae205"},i("span",{key:"fcdc9c6cb9224428e7b47df3ac10336bcdffb260",class:"container",ref:t=>{this.container=t}})))}get element(){return e(this)}static get watchers(){return{value:[{validateValue:0}],scale:[{validateScaling:0}]}}};u.style=':host{padding:0.5em;display:inline-block;position:relative;overflow:hidden;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000);background-color:var(--bn-font-background, white)}span.container p{margin:0}';export{u as bn_text}
@@ -1 +1 @@
1
- import{r as s,h as t,H as e,g as r}from"./p-B_d-jp99.js";import{w as a}from"./p-BjBz5cSL.js";import{g as i}from"./p-BgIpdpfH.js";import{w as o,a as h}from"./p-B4JfKvVT.js";const p=class{constructor(t){s(this,t),this.name="_default",o(this),this.errors=h(this),a(this,(s=>{this.stores||(this.stores=i(this.element));try{const t=JSON.parse(s);this.stores.ruleSets.set(this.name,t),this.errors.remove("JSON_PARSE")}catch(s){this.errors.addOrReplace({id:"JSON_PARSE",type:"error",message:`bn-ruleset: Failed to parse JSON body — ${s.message}`}),console.error(s)}}))}render(){return t(e,{key:"9fa99c590cee15a870554baa592395a50ee0d311"})}get element(){return r(this)}};p.style="bn-ruleset{display:none}";export{p as bn_ruleset}
1
+ import{r as s,h as t,H as e,g as r}from"./p-C5UYpZUU.js";import{w as a}from"./p-CTrNbSXN.js";import{g as i}from"./p-C7T4DAAW.js";import{w as o,a as h}from"./p-DtLI_CzV.js";const n=class{constructor(t){s(this,t),this.name="_default",o(this),this.errors=h(this),a(this,(s=>{this.stores||(this.stores=i(this.element));try{const t=JSON.parse(s);this.stores.ruleSets.set(this.name,t),this.errors.remove("JSON_PARSE")}catch(s){this.errors.addOrReplace({id:"JSON_PARSE",type:"error",message:`bn-ruleset: Failed to parse JSON body — ${s.message}`}),console.error(s)}}))}render(){return t(e,{key:"9fa99c590cee15a870554baa592395a50ee0d311"})}get element(){return r(this)}};n.style="bn-ruleset{display:none}";export{n as bn_ruleset}
@@ -0,0 +1 @@
1
+ import{r as t,h as i,H as s,g as h}from"./p-C5UYpZUU.js";import{r as e,m as n,s as o,g as l,b as r}from"./p-C7T4DAAW.js";import{C as a,S as c,F as d,I as u,a as v,b as m,c as b,P as f}from"./p-B5x8M8OC.js";import{X as w,r as p,a as g,b as x,P as y,F as M,c as $,S}from"./p-Bca5V28_.js";import{g as L}from"./p-BcZ5GQZ8.js";import{N as k}from"./p-DsTzlzxQ.js";import{r as z}from"./p-DdqXNsKP.js";class C{constructor(t,i,s,h,e){this.mode=t,this.vMax=i,this.rMaxPx=s,this.rMinPx=h,this.areaPerUnitPx2=e}static local(t,i,s){return new C("local",t,i,s,0)}static grouped(t){return new C("grouped",0,0,0,t)}radius(t){return"grouped"===this.mode?t<=0?0:Math.sqrt(this.areaPerUnitPx2*t/Math.PI):this.vMax<=0||t<=0?this.rMinPx:Math.max(this.rMinPx,this.rMaxPx*Math.sqrt(t/this.vMax))}}class N{constructor(t,i,s,h,e,n){var o,l,r,a;this.ruleSet=t,this.config=h,this.styles=e,this.availableWidth=n,this.warnings=[],this.canvasHeight=0,this.i18nMap=new Map,this.hatchPatterns=new Set,this.scaleOverflowCount=0,this.svgRoot=null;const c=new w,d=""!==s?i.exec(`SELECT * FROM ${s}`):[],u=(null!=d?d:[]).map((t=>c.adapt(t)));this.data=p(u,{pointLevel:h.pointLevel,seriesLevel:h.seriesLevel,facetLevel:null!==h.facet?"rowgroup"===h.facet.level?"rowGroup":"category":null,measures:{x:null!==(o=z(h.x.measure))&&void 0!==o?o:{kind:"scenario",slot:"ac1"},y:null!==(l=z(h.y.measure))&&void 0!==l?l:{kind:"scenario",slot:"ac2"},size:null!==(r=z(h.size.measure))&&void 0!==r?r:{kind:"scenario",slot:"ac3"},share:null!==h.share&&null!==(a=z(h.share.measure))&&void 0!==a?a:void 0},compareFamily:h.compareFamily,domains:{x:{min:h.x.min,max:h.x.max},y:{min:h.y.min,max:h.y.max}},limit:h.limit,limitBy:"size"}),this.warnings.push(...this.data.warnings)}get em(){return this.styles.fontStyles.size}fontFamily(){return this.styles.fontStyles.font.replace(/^[\d.]+px\s*/,"")}textWidth(t,i=!1){const s=a(t,{font:this.styles.fontStyles.font,fontSize:this.styles.fontStyles.size+"px",fontWeight:i?"bold":"normal"}).width;return Number.isFinite(s)&&s>0?s:.6*t.length*this.em}drawText(t,i,s,h,e={}){var n,o;t.text(i).font({size:this.styles.fontStyles.size,weight:e.bold?"bold":"normal",anchor:null!==(n=e.anchor)&&void 0!==n?n:"start"}).fill(null!==(o=e.color)&&void 0!==o?o:this.styles.fontStyles.color).attr({x:s,y:h,"font-family":this.fontFamily()})}hasNoData(){return 0===this.data.totalPoints}getWarnings(){return this.warnings}getAllocatedCanvasWidth(){return this.availableWidth}getAllocatedCanvasHeight(){return this.canvasHeight}setI18n(t){this.i18nMap=t}addWarningOnce(t,i){this.warnings.some((i=>i.code===t))||this.warnings.push({code:t,data:i})}primaryColorIndex(){const t=z(this.config.size.measure);return null===t||"variance"===t.kind?10:this.ruleSet.getScenarioColorIndex(t.slot)}compareColorIndex(){return this.ruleSet.getScenarioColorIndex(`${this.config.compareFamily}1`)}seriesHue(t){const{color:i,overflowed:s}=e(t,this.styles.seriesColors);return s&&this.addWarningOnce("xy-series-overflow",{}),i}familyDisplayName(t){return this.ruleSet.getScenario(`${t}1`).group}legendModel(){var t,i;const s=[],h=null!==(i=null!==(t=this.config.size.label)&&void 0!==t?t:this.i18nMap.get("legend.size"))&&void 0!==i?i:"";""!==h&&(s.push(h),void 0!==this.config.size.unit&&""!==this.config.size.unit&&s.push(`${this.i18nMap.get("axis.in")||"in"} ${this.config.size.unit}`));const e=this.seriesHue(0),o=[];if(null!==this.config.compareFamily){const t=z(this.config.size.measure),i=null!==t&&"scenario"===t.kind?t.slot.replace(/\d+$/,""):"ac";o.push({label:this.familyDisplayName(this.config.compareFamily),treatment:n(this.compareColorIndex(),e,"bubble")}),o.push({label:this.familyDisplayName(i),treatment:n(this.primaryColorIndex(),e,"bubble")})}const l=this.data.series.map((t=>{var i;return{label:""===t.key?null!==(i=this.ruleSet.getScenario("").name)&&void 0!==i?i:"Series":t.key,treatment:n(this.primaryColorIndex(),this.seriesHue(t.index),"bubble")}}));return{sizeCaption:s,title:this.i18nMap.get("legend.title")||null,compareEntries:o,entries:l}}toString(){const t=new c;return this.draw(t),t.id("drawCanvas"),t.width(this.getAllocatedCanvasWidth()),t.height(this.getAllocatedCanvasHeight()),t.attr("overflow","visible"),t.svg()}axisTitle(t,i){var s;const h=null!==(s=t.label)&&void 0!==s?s:"";return""===h?"":void 0===t.unit||""===t.unit?h:`${h} ${i} ${t.unit}`}draw(t){var i,s,h,e,n,o,l,r,a,c,d;this.warnings=this.data.warnings.slice(),this.hatchPatterns.clear(),this.scaleOverflowCount=0,this.svgRoot=t;const u=this.em,v=this.styles.padding,m=this.i18nMap.get("axis.in")||"in",b=t.group(),f=new g(this.styles),w=this.legendModel(),p=this.config.legend.show&&(w.entries.length>0||w.sizeCaption.length>0),x=p?f.measure(w,this.config.legend.position):{width:0,height:0},y="right"===this.config.legend.position&&p?x.width+u:0,$=""!==this.config.chartTitle?1.6*u:0,S=this.axisTitle(this.config.y,m),L=this.axisTitle(this.config.x,m),z=""!==S?1.4*u:.4*u,N=1.4*u+(""!==L?1.3*u:0);let T,W=3*u,D={x:0,y:0,width:0,height:0},A=[];const P=Math.max(1,this.data.facets.length),j=null===(i=this.config.facet)||void 0===i?void 0:i.columns,F=k.domain(null!==(h=null===(s=this.data.extents)||void 0===s?void 0:s.xMin)&&void 0!==h?h:0,null!==(n=null===(e=this.data.extents)||void 0===e?void 0:e.xMax)&&void 0!==n?n:1,{min:this.config.x.min,max:this.config.x.max}),H=k.domain(null!==(l=null===(o=this.data.extents)||void 0===o?void 0:o.yMin)&&void 0!==l?l:0,null!==(a=null===(r=this.data.extents)||void 0===r?void 0:r.yMax)&&void 0!==a?a:1,{min:this.config.y.min,max:this.config.y.max});for(let t=0;t<2;t++){const t=Math.max(10,this.availableWidth-v.left-v.right-W-y);D={x:v.left+W,y:v.top+$+z,width:t,height:t/this.config.aspect},T=new M(P,j,D,this.styles.scaleFactors.panelGap*u);const i=T.panelRect(0).height,s=Math.max(4,Math.min(8,Math.round(i/(4*u)))),h=new k(H[0],H[1],i,0);A=h.ticks(s);const e=k.tickDecimals(A);W=Math.max(...A.map((t=>this.textWidth(this.formatTick(t,e)))),u)+this.styles.scaleFactors.axisTickLength*u+.4*u}this.canvasHeight=D.y+D.height+N+("bottom"===this.config.legend.position&&p?x.height+u:0)+v.bottom,""!==this.config.chartTitle&&this.drawText(b,this.config.chartTitle,v.left,v.top+u,{bold:!0}),""!==S&&this.drawAxisTitleText(b,this.config.y,m,v.left,D.y-.6*u,"start");const B=this.buildPanels(T,F,H),I=B[0].xScale.ticks(Math.max(3,Math.min(8,Math.round(B[0].rect.width/(7*u))))),U=k.tickDecimals(I),E=k.tickDecimals(A),X=this.config.sizeAreaPerUnit>0?C.grouped(this.config.sizeAreaPerUnit):C.local(null!==(d=null===(c=this.data.extents)||void 0===c?void 0:c.sizeMax)&&void 0!==d?d:0,this.styles.scaleFactors.bubbleMaxRadius*u,this.styles.scaleFactors.bubbleMinRadius*u);0===this.data.facets.length?this.drawPanel(b,B[0],{key:"",points:[]},X,I,A,U,E,!0,!0):this.data.facets.forEach(((t,i)=>{this.drawPanel(b,B[i],t,X,I,A,U,E,T.isOuterLeft(i),T.isOuterBottom(i),this.data.facets.length>1?t.key:"")})),""!==L&&this.drawAxisTitleText(b,this.config.x,m,D.x+D.width,D.y+D.height+2.6*u,"end"),p&&("right"===this.config.legend.position?f.draw(b,w,D.x+D.width+u,D.y,"right"):f.draw(b,w,D.x,D.y+D.height+N,"bottom")),this.scaleOverflowCount>0&&this.addWarningOnce("bubble-scale-overflow",{count:String(this.scaleOverflowCount)}),t.group().addClass("annotations")}drawAxisTitleText(t,i,s,h,e,n){var o;const l=null!==(o=i.label)&&void 0!==o?o:"",r=void 0!==i.unit&&""!==i.unit?`${s} ${i.unit}`:"",a=.3*this.em;"start"===n?(this.drawText(t,l,h,e,{bold:!0}),""!==r&&this.drawText(t,r,h+this.textWidth(l,!0)+a,e,{})):""!==r?(this.drawText(t,r,h,e,{anchor:"end"}),this.drawText(t,l,h-this.textWidth(r)-a,e,{anchor:"end",bold:!0})):this.drawText(t,l,h,e,{anchor:"end",bold:!0})}buildPanels(t,i,s){const h=[];for(let e=0;e<t.count;e++){const n=t.panelRect(e),o=new k(i[0],i[1],n.x,n.x+n.width),l=new k(s[0],s[1],n.y+n.height,n.y);h.push({rect:n,xScale:o,yScale:l,frame:new x(o,l,n,this.styles)})}return h}treatmentFill(t,i,s){return!0!==t.hatch?t.fill:(this.ensureHatchPattern(i,s),`url(#xy-fc-${i})`)}ensureHatchPattern(t,i){this.hatchPatterns.has(t)||null===this.svgRoot||(this.hatchPatterns.add(t),this.svgRoot.defs().pattern(10,10,(t=>{t.rect(10,10).fill("#ffffff"),t.line(0,10,10,0).stroke({color:i,width:2}),t.line(-2.5,2.5,2.5,-2.5).stroke({color:i,width:2}),t.line(7.5,12.5,12.5,7.5).stroke({color:i,width:2})})).id(`xy-fc-${t}`))}drawPanel(t,i,s,h,e,l,r,a,c,d,u=""){var v,m,b,f;const w=t.group(),p=this.em;i.frame.drawBands(w,this.config.x.highlight,this.config.y.highlight),i.frame.drawGrid(w,l,void 0===this.config.x.refLine&&void 0===this.config.y.refLine&&i.rect.width>30*p?e:void 0),i.frame.drawRefLines(w,this.config.x.refLine,this.config.y.refLine),i.frame.drawFrame(w);const g=w.group().id("compare"),x=w.group().id("primary"),M=new y(i.rect,this.styles.scaleFactors.labelToMark*p),$=[...s.points].sort(((t,i)=>{var s,h;return(null!==(s=i.size)&&void 0!==s?s:0)-(null!==(h=t.size)&&void 0!==h?h:0)})),S=[];for(const t of $){const s=null!==(m=null===(v=this.data.series.find((i=>i.key===t.seriesKey)))||void 0===v?void 0:v.index)&&void 0!==m?m:0,e=this.seriesHue(s),l=n(this.primaryColorIndex(),e,"bubble"),r=i.xScale.scale(t.x),a=i.yScale.scale(t.y),c=h.radius(null!==(b=t.size)&&void 0!==b?b:0);if(this.config.sizeAreaPerUnit>0&&this.bubbleExceedsPanel(i.rect,r,a,c)&&this.scaleOverflowCount++,null!=t.compare){const o=n(this.compareColorIndex(),e,"bubble"),l=i.xScale.scale(t.compare.x),r=i.yScale.scale(t.compare.y),a=h.radius(null!==(f=t.compare.size)&&void 0!==f?f:0);this.drawBubble(g,l,r,a,o,s,e),M.registerMark(l,r,a),this.config.labels.values&&void 0!==t.compare.size&&a>=1.2*p&&this.drawValueLabel(g,l,r,a,t.compare.size,o.fill)}this.drawBubble(x,r,a,c,l,s,e),M.registerMark(r,a,c),void 0!==t.share&&c>0&&this.drawShareSlice(x,r,a,c,t.share,o(e)),this.config.labels.values&&void 0!==t.size&&this.drawValueLabel(x,r,a,c,t.size,!0===l.hatch?"#ffffff":l.fill),S.push({point:t,cx:r,cy:a,r:c,seriesIndex:s,hue:e,treatment:l})}this.drawNameLabels(w,M,S),i.frame.drawTickLabels(w,{ticksX:e,ticksY:l,xDecimals:r,yDecimals:a,showXLabels:d,showYLabels:c}),""!==u&&i.frame.drawPanelTitle(w,u)}bubbleExceedsPanel(t,i,s,h){return i-h<t.x||i+h>t.x+t.width||s-h<t.y||s+h>t.y+t.height}drawBubble(t,i,s,h,e,n,o){h<=0||t.circle(2*h).center(i,s).fill(this.treatmentFill(e,n,o)).stroke({color:e.stroke,width:e.strokeWidth})}drawShareSlice(t,i,s,h,e,n){if(e<=0)return;if(e>=1)return void t.circle(2*h).center(i,s).fill(n);const o=2*e*Math.PI,l=i+h*Math.sin(o),r=s-h*Math.cos(o),a=o>Math.PI?1:0;t.path(`M ${i} ${s} L ${i} ${s-h} A ${h} ${h} 0 ${a} 1 ${l} ${r} Z`).fill(n).stroke("none")}drawValueLabel(t,i,s,h,e,n){const o=d.number(e,"decimal",1,1);this.textWidth(o)+.4*this.em>2*h||this.drawText(t,o,i,s+.35*this.em,{anchor:"middle",color:L(n.startsWith("#")?n:"#ffffff")})}drawNameLabels(t,i,s){const h=[...s].sort(((t,i)=>{var s,h;return(null!==(s=i.point.size)&&void 0!==s?s:0)-(null!==(h=t.point.size)&&void 0!==h?h:0)})),{selected:e,unknownNames:n}=i.selectCandidates(h,this.config.labels.points,this.config.labels.max,(t=>t.point.name));n.length>0&&this.addWarningOnce("xy-label-unknown",{names:n.join(", ")});const o=e.map((t=>({name:t.point.name,cx:t.cx,cy:t.cy,r:t.r,width:this.textWidth(t.point.name),height:1.1*this.em})));for(const s of i.place(o))this.drawText(t,s.candidate.name,s.x,s.y+.9*s.candidate.height,{})}formatTick(t,i){return d.number(t,"decimal",i,i)}}const T=["xy-duplicate-point","xy-point-clipped","xy-variance-nodata","xy-label-unknown","xy-series-overflow","xy-point-budget","bubble-size-negative","bubble-share-range","bubble-scale-overflow"],W=class{constructor(i){t(this,i),this.tableName="",this.dataVersion=0,this.chartTitle="",this.share=null,this.compareFamily=null,this.facet=null,this.pointLevel="category",this.seriesLevel=null,this.aspect=16/9,this.limit=0,this.filter="",this.sizeAreaPerUnit=0,this.i18n=new Map,this.containerWidth=0,this.svgMarkup=""}getDb(){return this.stores||(this.stores=l(this.element)),this.stores.db.db}componentWillLoad(){this.rebuild()}componentWillUpdate(){this.rebuild()}rebuild(){const t=this.prepareStyle(),i=this.tableName?r(this.tableName,this.filter):"";this.chart=new N(new u(this.ruleSetConfig),this.getDb(),i,{chartTitle:this.chartTitle,x:this.x,y:this.y,size:this.size,share:this.share,compareFamily:this.compareFamily,labels:this.labels,legend:this.legend,facet:this.facet,pointLevel:this.pointLevel,seriesLevel:this.seriesLevel,aspect:this.aspect,limit:this.limit,sizeAreaPerUnit:this.sizeAreaPerUnit},t,this.containerWidth||0),this.chart.setI18n(this.i18n),this.svgMarkup=this.chart.hasNoData()?"":this.chart.toString(),this.syncWarnings(this.chart.getWarnings())}syncWarnings(t){if(void 0===this.errors)return;const i=new Map(t.map((t=>[t.code,t.data])));for(const t of T){const s=`WARN_${t}`;if(i.has(t)){const h=void 0!==this.translate?this.translate(`.${t}`,i.get(t)):t;this.errors.addOrReplace({id:s,type:"warning",message:h})}else this.errors.remove(s)}}prepareStyle(){return new $(new S,new v,new m(new b),new f).adapt(this.styles)}render(){if(void 0===this.chart)return i(s,null);if(this.chart.hasNoData()){const t=this.i18n.get("no-data")||"==No Data==";return i(s,null,i("p",{class:"warning"},t))}return i(s,null,i("div",{innerHTML:this.svgMarkup}))}get element(){return h(this)}};W.style=':host{position:relative;display:inline-block}.warning{font-family:var(--bn-font-family, "Noto Sans", "Helvetica Neue", Helvetica, sans-serif);color:var(--bn-font-color, black)}';export{W as ibcs_chart_bubble}
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var VarianceMeasure = require('./VarianceMeasure-BBWTgv2e.js');
3
+ var VarianceMeasure = require('./VarianceMeasure-BfZLlICl.js');
4
4
 
5
5
  /**
6
6
  * Parses a raw object-prop attribute value. A blank value yields `data: null`
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var SVGStyle = require('./SVGStyle-BD8jApd4.js');
4
- require('./VarianceMeasure-BBWTgv2e.js');
3
+ var SVGStyle = require('./SVGStyle-D78RaNnj.js');
4
+ require('./VarianceMeasure-BfZLlICl.js');
5
5
 
6
6
  /** SI metric prefix for number scaling (e.g. prefix="M", value=1000000 divides displayed values by one million). */
7
7
  class SiPrefix {
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var VarianceMeasure = require('./VarianceMeasure-BBWTgv2e.js');
3
+ var VarianceMeasure = require('./VarianceMeasure-BfZLlICl.js');
4
4
 
5
5
  /** Shared utilities for the adapter layer, used by all component config adapters. */
6
6
  class AdapterUtils {
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var contextProtocol = require('./context-protocol-BBhT9B52.js');
4
- var VarianceMeasure = require('./VarianceMeasure-BBWTgv2e.js');
3
+ var contextProtocol = require('./context-protocol-DeLmu5s2.js');
4
+ var VarianceMeasure = require('./VarianceMeasure-BfZLlICl.js');
5
5
 
6
6
  /**
7
7
  * Parses an IBCS variance column name into its constituent parts.
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var VarianceMeasure = require('./VarianceMeasure-BBWTgv2e.js');
3
+ var VarianceMeasure = require('./VarianceMeasure-BfZLlICl.js');
4
4
 
5
5
  class SVGVariancesStyleGroup {
6
6
  constructor(pos, neg, neu) {
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var contextProtocol = require('./context-protocol-BBhT9B52.js');
3
+ var contextProtocol = require('./context-protocol-DeLmu5s2.js');
4
4
 
5
5
  const isObject = (obj) => {
6
6
  if (typeof obj === 'object' && obj !== null) {
@@ -125,7 +125,7 @@ exports.TableType = void 0;
125
125
  TableType["OPT"] = "opt";
126
126
  TableType["OPTNOTOTAL"] = "optnototal";
127
127
  })(exports.TableType || (exports.TableType = {}));
128
- /** Width of the category label column as a percentage of the table width. INF = auto/infinite. */
128
+ /** Width of the category label column, in em of the table font. INF = auto/infinite. */
129
129
  exports.TableCategoryWidth = void 0;
130
130
  (function (TableCategoryWidth) {
131
131
  TableCategoryWidth["INF"] = "inf";
@@ -137,7 +137,7 @@ exports.TableCategoryWidth = void 0;
137
137
  TableCategoryWidth["W10"] = "w10";
138
138
  TableCategoryWidth["W5"] = "w5";
139
139
  })(exports.TableCategoryWidth || (exports.TableCategoryWidth = {}));
140
- /** Width preset for inline bar/pin chart columns. Value = max bar width in em. */
140
+ /** Width preset for inline bar/pin chart columns. Value = total column width in em. */
141
141
  exports.TableBarColumnWidth = void 0;
142
142
  (function (TableBarColumnWidth) {
143
143
  TableBarColumnWidth["W5"] = "w5";
@@ -151,7 +151,7 @@ exports.TableBarColumnWidth = void 0;
151
151
  TableBarColumnWidth["W80"] = "w80";
152
152
  TableBarColumnWidth["W100"] = "w100";
153
153
  })(exports.TableBarColumnWidth || (exports.TableBarColumnWidth = {}));
154
- /** Maps TableBarColumnWidth presets to max bar width in em. */
154
+ /** Maps TableBarColumnWidth presets to total bar column width in em. */
155
155
  const BAR_COLUMN_WIDTH_EM = {
156
156
  [exports.TableBarColumnWidth.W5]: 5,
157
157
  [exports.TableBarColumnWidth.W10]: 10,
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- var VarianceMeasure = require('./VarianceMeasure-BBWTgv2e.js');
4
- var contextProtocol = require('./context-protocol-BBhT9B52.js');
5
- var LabelCollisionManager = require('./LabelCollisionManager-DkdQ9Xdg.js');
6
- var SVGStyle = require('./SVGStyle-BD8jApd4.js');
3
+ var VarianceMeasure = require('./VarianceMeasure-BfZLlICl.js');
4
+ var contextProtocol = require('./context-protocol-DeLmu5s2.js');
5
+ var LabelCollisionManager = require('./LabelCollisionManager-Cet3WPm0.js');
6
+ var SVGStyle = require('./SVGStyle-D78RaNnj.js');
7
7
 
8
8
  /**
9
9
  * Aggregates all style configuration for an XY chart (scatter/bubble):