@bino-bi/bn-template-engine 1.0.0-next.45 → 1.0.0-next.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bn-template-engine/bn-template-engine.esm.js +1 -1
- package/dist/bn-template-engine/{p-8b28c9bd.entry.js → p-16623e0f.entry.js} +1 -1
- package/dist/bn-template-engine/p-17970e07.entry.js +1 -0
- package/dist/bn-template-engine/{p-48871742.entry.js → p-21930d0a.entry.js} +1 -1
- package/dist/bn-template-engine/{p-5a64f90f.entry.js → p-46c46067.entry.js} +1 -1
- package/dist/bn-template-engine/p-9caa7f46.entry.js +1 -0
- package/dist/bn-template-engine/p-B0MEAsAS.js +1 -0
- package/dist/bn-template-engine/{p-qpZjVnX5.js → p-BA-fydUt.js} +1 -1
- package/dist/bn-template-engine/p-BEGt_7Hr.js +1 -0
- package/dist/bn-template-engine/p-BRO1oW7m.js +1 -0
- package/dist/bn-template-engine/{p-DVE0-sOv.js → p-BnzIfgCq.js} +1 -1
- package/dist/bn-template-engine/{p-b0dfc113.entry.js → p-b0d528f2.entry.js} +1 -1
- package/dist/cjs/bn-annotation-layer_30.cjs.entry.js +608 -83
- package/dist/cjs/bn-grid.cjs.entry.js +161 -34
- package/dist/cjs/bn-image.cjs.entry.js +2 -2
- package/dist/cjs/bn-internationalization.cjs.entry.js +2 -2
- package/dist/cjs/bn-ruleset.cjs.entry.js +2 -2
- package/dist/cjs/bn-template-engine.cjs.js +1 -1
- package/dist/cjs/bn-text.cjs.entry.js +3 -3
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{localFrame-U3Qs0psw.js → localFrame-C27GGom1.js} +1 -1
- package/dist/cjs/{withBodyObserver-S-FGHpAX.js → withBodyObserver-B78wzw3f.js} +1 -1
- package/dist/cjs/{withHasError-BkBrsCpI.js → withHasError-0hW3-4mr.js} +11 -5
- package/dist/cjs/{withStyled-BZb6snOx.js → withStyled-D0hrcfE_.js} +25 -1
- package/dist/cjs/{withTranslation-1qTs5Fi7.js → withTranslation-B4WipL_5.js} +2 -2
- package/dist/collection/components/bn-annotation-layer/bn-annotation-layer.js +33 -2
- package/dist/collection/components/bn-chart-structure/bn-chart-structure.js +112 -16
- package/dist/collection/components/bn-chart-structure/utils/StructureChart.js +1 -1
- package/dist/collection/components/bn-chart-structure/utils/elements/Needle.js +3 -3
- package/dist/collection/components/bn-chart-time/bn-chart-time-renderer/bn-chart-time-renderer.js +113 -3
- package/dist/collection/components/bn-chart-time/bn-chart-time.js +261 -22
- package/dist/collection/components/bn-chart-time/utils/TimeChart.js +221 -12
- package/dist/collection/components/bn-chart-time/utils/elements/Axis.js +9 -1
- package/dist/collection/components/bn-chart-time/utils/elements/Column.js +10 -4
- package/dist/collection/components/bn-chart-time/utils/elements/Needle.js +9 -3
- package/dist/collection/components/bn-chart-time/utils/factories/ScenarioFactory.js +2 -2
- package/dist/collection/components/bn-chart-time/utils/model/DataPoint.js +9 -6
- package/dist/collection/components/bn-chart-time/utils/model/TimeChartComponentConfig.js +15 -0
- package/dist/collection/components/bn-grid/bn-grid.js +118 -24
- package/dist/collection/components/bn-grid/utils/cellLayout.js +55 -9
- package/dist/collection/components/bn-layout-card/bn-layout-card.js +4 -2
- package/dist/collection/components/bn-layout-page/bn-layout-page.js +23 -1
- package/dist/collection/components/bn-title/bn-title-renderer/bn-title-renderer.css +10 -0
- package/dist/collection/components/bn-title/bn-title-renderer/bn-title-renderer.js +23 -1
- package/dist/collection/components/bn-title/bn-title.js +40 -2
- package/dist/collection/stores/componentStyles.js +9 -3
- package/dist/collection/stores/internationalization.js +2 -2
- package/dist/collection/utils/DateStringFactory.js +19 -0
- package/dist/collection/utils/model/DataFormatDigits.js +4 -2
- package/dist/collection/utils/model/VarianceScenario.js +13 -0
- package/dist/collection/utils/validate.js +4 -0
- package/dist/components/bn-annotation-layer.js +1 -1
- package/dist/components/bn-annotation-list.js +1 -1
- package/dist/components/bn-asset.js +1 -1
- package/dist/components/bn-body.js +1 -1
- package/dist/components/bn-card.js +1 -1
- package/dist/components/bn-chart-bubble-renderer.js +1 -1
- package/dist/components/bn-chart-bubble.js +1 -1
- package/dist/components/bn-chart-bullet-renderer.js +1 -1
- package/dist/components/bn-chart-bullet.js +1 -1
- package/dist/components/bn-chart-scatter-renderer.js +1 -1
- package/dist/components/bn-chart-scatter.js +1 -1
- package/dist/components/bn-chart-structure-renderer.js +1 -1
- package/dist/components/bn-chart-structure.js +1 -1
- package/dist/components/bn-chart-time-renderer.js +1 -1
- package/dist/components/bn-chart-time.js +1 -1
- package/dist/components/bn-component-style.js +1 -1
- package/dist/components/bn-context.js +1 -1
- package/dist/components/bn-dataset.js +1 -1
- package/dist/components/bn-datasource.js +1 -1
- package/dist/components/bn-footer.js +1 -1
- package/dist/components/bn-grid.js +1 -1
- package/dist/components/bn-image.js +1 -1
- package/dist/components/bn-internationalization.js +1 -1
- package/dist/components/bn-layout-card.js +1 -1
- package/dist/components/bn-layout-page.js +1 -1
- package/dist/components/bn-message.js +1 -1
- package/dist/components/bn-page.js +1 -1
- package/dist/components/bn-ruleset.js +1 -1
- package/dist/components/bn-scaling-group.js +1 -1
- package/dist/components/bn-table-renderer.js +1 -1
- package/dist/components/bn-table.js +1 -1
- package/dist/components/bn-text.js +1 -1
- package/dist/components/bn-title-renderer.js +1 -1
- package/dist/components/bn-title.js +1 -1
- package/dist/components/bn-tree.js +1 -1
- package/dist/components/p-9X5fVJqR.js +1 -0
- package/dist/components/p-B5GRtTLX.js +1 -0
- package/dist/components/{p-DJUffGeB.js → p-BKA15uoz.js} +1 -1
- package/dist/components/p-BKLq0Pbv.js +1 -0
- package/dist/components/p-BKTBdrEA.js +1 -0
- package/dist/components/p-Bd8cQiLx.js +1 -0
- package/dist/components/{p-CvEdUq8i.js → p-Be0Q3bvf.js} +1 -1
- package/dist/components/{p-xIWChKGS.js → p-Bj3RWsEx.js} +1 -1
- package/dist/components/{p-B4L069XF.js → p-BoBamuPt.js} +1 -1
- package/dist/components/{p-DaOm9YwQ.js → p-BrJZUp-K.js} +1 -1
- package/dist/components/{p-CyfGkLMh.js → p-BuWNCnvR.js} +1 -1
- package/dist/components/{p-M2k_I8lv.js → p-CFVoK5Rb.js} +1 -1
- package/dist/components/{p-fKJx8WtW.js → p-CgJB5mCu.js} +1 -1
- package/dist/components/p-Cxx0YNnl.js +1 -0
- package/dist/components/p-D9F5IBFT.js +1 -0
- package/dist/components/{p-BfUdaxZ9.js → p-DQFahsnV.js} +1 -1
- package/dist/components/p-DROj8gke.js +1 -0
- package/dist/components/p-D_Sbhd0L.js +1 -0
- package/dist/components/{p-Cel0a6ma.js → p-DbWh9W5D.js} +1 -1
- package/dist/components/{p-2eicD9rF.js → p-DkCeSWKR.js} +1 -1
- package/dist/components/{p-7ieJFBUk.js → p-DoOSXntC.js} +1 -1
- package/dist/components/p-Dxj_pf8s.js +1 -0
- package/dist/components/{p-DQl2K2Xl.js → p-DzYhS_9s.js} +1 -1
- package/dist/components/{p-B2bvM2Ig.js → p-EQNS13GN.js} +1 -1
- package/dist/components/{p-Y9bth2Y_.js → p-G56USTsQ.js} +1 -1
- package/dist/components/p-OgFFKehL.js +1 -0
- package/dist/components/{p-C2ycO60j.js → p-kvYRImZT.js} +1 -1
- package/dist/components/{p-Chuj-LpI.js → p-rEdNIgD8.js} +1 -1
- package/dist/components/{p-DwuXVo2h.js → p-uCpFBDF5.js} +1 -1
- package/dist/esm/bn-annotation-layer_30.entry.js +608 -83
- package/dist/esm/bn-grid.entry.js +161 -34
- package/dist/esm/bn-image.entry.js +2 -2
- package/dist/esm/bn-internationalization.entry.js +2 -2
- package/dist/esm/bn-ruleset.entry.js +2 -2
- package/dist/esm/bn-template-engine.js +1 -1
- package/dist/esm/bn-text.entry.js +3 -3
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{localFrame-BNWPPaQa.js → localFrame-CEZ7-hBs.js} +1 -1
- package/dist/esm/{withBodyObserver-AHQAUV85.js → withBodyObserver-D9yIMxdr.js} +1 -1
- package/dist/esm/{withHasError-B6Lvj9Cq.js → withHasError-UGtkLrYT.js} +11 -5
- package/dist/esm/{withStyled-CzzXg64f.js → withStyled-BlMqEIfr.js} +25 -2
- package/dist/esm/{withTranslation-C1gL7wSU.js → withTranslation-Bc3bjHTb.js} +2 -2
- package/dist/schemas/theme.schema.json +18 -0
- package/dist/types/components/bn-annotation-layer/bn-annotation-layer.d.ts +11 -0
- package/dist/types/components/bn-chart-structure/bn-chart-structure.d.ts +16 -0
- package/dist/types/components/bn-chart-structure/utils/elements/Needle.d.ts +2 -1
- package/dist/types/components/bn-chart-time/bn-chart-time-renderer/bn-chart-time-renderer.d.ts +8 -0
- package/dist/types/components/bn-chart-time/bn-chart-time.d.ts +46 -1
- package/dist/types/components/bn-chart-time/utils/TimeChart.d.ts +37 -0
- package/dist/types/components/bn-chart-time/utils/elements/Axis.d.ts +2 -0
- package/dist/types/components/bn-chart-time/utils/elements/Needle.d.ts +2 -1
- package/dist/types/components/bn-chart-time/utils/factories/ScenarioFactory.d.ts +1 -1
- package/dist/types/components/bn-chart-time/utils/model/DataPoint.d.ts +6 -1
- package/dist/types/components/bn-chart-time/utils/model/TimeChartComponentConfig.d.ts +6 -0
- package/dist/types/components/bn-grid/bn-grid.d.ts +23 -0
- package/dist/types/components/bn-grid/utils/cellLayout.d.ts +39 -3
- package/dist/types/components/bn-layout-card/bn-layout-card.d.ts +3 -1
- package/dist/types/components/bn-layout-page/bn-layout-page.d.ts +9 -0
- package/dist/types/components/bn-title/bn-title-renderer/bn-title-renderer.d.ts +2 -0
- package/dist/types/components/bn-title/bn-title.d.ts +10 -0
- package/dist/types/components.d.ts +173 -6
- package/dist/types/stores/componentStyles.d.ts +8 -0
- package/dist/types/utils/DateStringFactory.d.ts +4 -0
- package/dist/types/utils/layoutState/types.d.ts +3 -0
- package/dist/types/utils/model/VarianceScenario.d.ts +2 -0
- package/dist/types/utils/validate.d.ts +2 -0
- package/package.json +1 -1
- package/dist/bn-template-engine/p-1b002bd5.entry.js +0 -1
- package/dist/bn-template-engine/p-750b2c82.entry.js +0 -1
- package/dist/bn-template-engine/p-D0tNATZq.js +0 -1
- package/dist/bn-template-engine/p-DF9sfwBN.js +0 -1
- package/dist/bn-template-engine/p-EcC0qLtU.js +0 -1
- package/dist/components/p-1B_s8oPY.js +0 -1
- package/dist/components/p-AwH1w8Mu.js +0 -1
- package/dist/components/p-BiSytXUy.js +0 -1
- package/dist/components/p-C3gYq-HU.js +0 -1
- package/dist/components/p-CEf5X8MZ.js +0 -1
- package/dist/components/p-CniN8ALm.js +0 -1
- package/dist/components/p-D40Am1Ap.js +0 -1
- package/dist/components/p-DDvWTgk1.js +0 -1
- package/dist/components/p-DjPWZfry.js +0 -1
- package/dist/components/p-DnDL1pPc.js +0 -1
- package/dist/components/p-sLbQ7yZ1.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as t,H as i,h as s,a as h,t as e}from"./p-D6YGOYV1.js";import{S as n,F as r,a as o,P as l}from"./p-eWxolPDU.js";import{C as a,g as c,b as u,h as d,e as f,R as p}from"./p-B5tixDPM.js";import{C as v,a as w,F as m,I as b,b as g,V as y,s as S}from"./p-D_Sbhd0L.js";import{a as P,H as L,b as k,L as x,S as C}from"./p-Be0Q3bvf.js";import{S as M}from"./p-CeE4_3wQ.js";import{d as O,p as A,S as T}from"./p-BzjGUtYh.js";import{N as $,r as D}from"./p-fCjsrD7I.js";import{D as N,w as _}from"./p-Dq9dG0Kr.js";import{d as E,g as Y}from"./p-Cxx0YNnl.js";import{e as j,r as R}from"./p-ClruFZD_.js";import{D as F,b as V}from"./p-B5GRtTLX.js";import{a as H,I as B}from"./p-4q8nRcWC.js";import{s as G,c as W,a as X,b as z,l as I,d as U,M as q}from"./p-BTnRaHPb.js";import{D as K,b as Q}from"./p-DoOSXntC.js";import{A as Z}from"./p-BXg3v5AO.js";import{S as J}from"./p-BPGLOHUe.js";import{S as tt}from"./p-NBaq67dL.js";class it{constructor(){this.scenarioOffset=.3,this.scenarioLabelToColumn=.3,this.labelToColumn=.3,this.labelToAxis=.3,this.needleWidth=.3,this.needleHeadWidth=.6,this.columnWidth=2,this.varianceAxisLineWidth=.3,this.axisLineWidth=.1,this.auxiliaryLineWidth=.1,this.scenarioLineWidth=.2,this.markerWidth=.7,this.markerOffset=0,this.categoryWidth=3,this.axisTickLength=.3}}class st{adapt(t){const i=new it;return a.isNumber(t.scenarioOffset)&&(i.scenarioOffset=t.scenarioOffset),a.isNumber(t.scenarioLabelToColumn)&&(i.scenarioLabelToColumn=t.scenarioLabelToColumn),a.isNumber(t.labelToColumn)&&(i.labelToColumn=t.labelToColumn),a.isNumber(t.labelToAxis)&&(i.labelToAxis=t.labelToAxis),a.isNumber(t.needleWidth)&&(i.needleWidth=t.needleWidth),a.isNumber(t.needleHeadWidth)&&(i.needleHeadWidth=t.needleHeadWidth),a.isNumber(t.columnWidth)&&(i.columnWidth=t.columnWidth),a.isNumber(t.varianceAxisLineWidth)&&(i.varianceAxisLineWidth=t.varianceAxisLineWidth),a.isNumber(t.axisLineWidth)&&(i.axisLineWidth=t.axisLineWidth),a.isNumber(t.auxiliaryLineWidth)&&(i.auxiliaryLineWidth=t.auxiliaryLineWidth),a.isNumber(t.scenarioLineWidth)&&(i.scenarioLineWidth=t.scenarioLineWidth),a.isNumber(t.markerWidth)&&(i.markerWidth=t.markerWidth),a.isNumber(t.markerOffset)&&(i.markerOffset=t.markerOffset),a.isNumber(t.categoryWidth)&&(i.categoryWidth=t.categoryWidth),a.isNumber(t.axisTickLength)&&(i.axisTickLength=t.axisTickLength),i}default(){return new it}}class ht{constructor(t,i,s,h,e,n,r){this.categoryPosition={x:0,y:0},this.spacings=new it,this.categoriesBoxOffset={width:0,height:0},this.padding=t,this.scaleFactors=i,this.fontStlye=s,this.dataLabelHeight=this.caluculateDataLabelHeight(),this.axisPosition={x:0,y:0},this.columnValue={min:h,max:e},this.numberOfColumns=n,this.leftSideLabelLength=r,this.calculateSpacings(),this.calculateCategoryPosition(),this.calculateAxisPosition()}caluculateDataLabelHeight(){return 1.1*v("123456789",{font:this.fontStlye.font,fontSize:this.fontStlye.size+"px"}).height}getColumnCenterPositionX(t){return this.categoryPosition.y+this.spacings.scenarioOffset+t*this.spacings.categoryWidth+this.leftSideLabelLength+.5*this.spacings.columnWidth}getAxisPositionY(t){let i=this.columnValue.max.getScaledUnit();return t&&(i=this.columnValue.max.getScaledPercentUnit()+this.getNeedleWidth()),i+this.dataLabelHeight+this.spacings.labelToAxis+this.padding.top}getAxisPositionX(){return this.padding.left+this.leftSideLabelLength}getColumnPositionX(t,i){return i?this.getColumnCenterPositionX(t):this.getColumnCenterPositionX(t)-this.spacings.scenarioOffset}getColumnPositionY(){return this.columnValue.max.getScaledUnit()+this.dataLabelHeight+this.spacings.labelToColumn+this.padding.top}getNeedlePositionY(){return this.columnValue.max.getScaledPercentUnit()+this.dataLabelHeight+this.spacings.labelToColumn+this.getNeedleWidth()+this.padding.top}getMarkerPositionX(t,i){return i?this.getColumnCenterPositionX(t)-this.spacings.markerOffset-.5*this.getColumnWidth():this.getColumnCenterPositionX(t)+this.spacings.markerOffset+.5*this.getColumnWidth()}getMarkerPositionY(){return this.getColumnPositionY()}getAxisTitlePositionX(t){const i=t.width();return this.axisPosition.x-i}getAxisTitlePositionY(t,i){let s=this.columnValue.max.getScaledUnit();return i&&(s=this.columnValue.max.getScaledPercentUnit()),t?s+this.dataLabelHeight+this.spacings.labelToAxis:s}getColumnDataLabelPositionY(t){const i=this.spacings.labelToColumn;return t<0?this.getColumnPositionY()+Math.abs(t)+i:this.getColumnPositionY()-t-i}getNeedleDataLabelPositionY(t){const i=this.spacings.labelToColumn;return t<0?this.getNeedlePositionY()+Math.abs(t)+i+2*this.getNeedleWidth():this.getNeedlePositionY()-t-i-2*this.getNeedleWidth()}getAxisEndPositionX(){return this.getAxisPositionX()+(this.numberOfColumns+.5)*this.spacings.categoryWidth}getColumnWidth(){return this.spacings.columnWidth}getNeedleWidth(){return this.spacings.needleWidth}getNeedleHeadWidth(){return this.spacings.needleHeadWidth}getScenarioLabelPositionOffsetX(t){return t?.5*this.getColumnWidth()+this.spacings.scenarioLabelToColumn:-(.5*this.getColumnWidth()+this.spacings.scenarioLabelToColumn)}calculateSpacings(){this.spacings={scenarioOffset:this.fontStlye.size*this.scaleFactors.scenarioOffset,scenarioLabelToColumn:this.fontStlye.size*this.scaleFactors.scenarioLabelToColumn,markerOffset:this.fontStlye.size*this.scaleFactors.markerOffset,labelToColumn:this.fontStlye.size*this.scaleFactors.labelToColumn,labelToAxis:this.fontStlye.size*this.scaleFactors.labelToAxis,needleWidth:this.fontStlye.size*this.scaleFactors.needleWidth,needleHeadWidth:this.fontStlye.size*this.scaleFactors.needleHeadWidth,columnWidth:this.fontStlye.size*this.scaleFactors.columnWidth,varianceAxisLineWidth:this.fontStlye.size*this.scaleFactors.varianceAxisLineWidth,axisLineWidth:this.fontStlye.size*this.scaleFactors.axisLineWidth,auxiliaryLineWidth:this.fontStlye.size*this.scaleFactors.auxiliaryLineWidth,scenarioLineWidth:this.fontStlye.size*this.scaleFactors.scenarioLineWidth,markerWidth:this.fontStlye.size*this.scaleFactors.markerWidth,categoryWidth:this.fontStlye.size*this.scaleFactors.categoryWidth,axisTickLength:this.fontStlye.size*this.scaleFactors.axisTickLength}}calculateCategoryPosition(){this.categoryPosition={x:this.padding.left+.5*this.spacings.columnWidth,y:this.padding.top}}calculateAxisPosition(){this.axisPosition={x:this.getAxisPositionX(),y:this.getAxisPositionY(!1)}}getMarkerScenarioLabelPositionOffsetX(t){return t?this.spacings.labelToColumn-this.fontStlye.size:this.spacings.labelToColumn+.5*this.spacings.markerWidth}}class et{constructor(t){this.top=t.top,this.bottom=t.bottom,this.left=t.left,this.right=t.right}addBoxTopLeft(t){return this.top+=t.height|this.top,this.left+=t.width|this.top,this}}class nt{constructor(t){const i=1*t,s=.7*t;this.bgOffset=(i-s)/2,this.markerUp={top:s/2+",0",left:"0,"+s,right:s+","+s},this.markerUpBackground={top:i/2+",0",left:"0,"+i,right:i+","+i},this.markerDown={bottom:s/2+","+s,left:"0,0",right:s+",0"},this.markerDownBackground={bottom:i/2+","+i,left:"0,0",right:i+",0"},this.markerRight={bottom:"0,"+s,top:"0,0",right:s+","+s/2},this.markerRightBackground={bottom:"0,"+i,top:"0,0",right:i+","+i/2},this.markerLeft={bottom:s+","+s,top:s+",0",left:"0,"+s/2},this.markerLeftBackground={bottom:i+","+i,top:i+",0",Left:"0,"+i/2}}upMarkerPatternStrings(){return{background:this.markerUpBackground.left+" "+this.markerUpBackground.right+" "+this.markerUpBackground.top+" "+this.markerUpBackground.left,foreground:this.markerUp.left+" "+this.markerUp.right+" "+this.markerUp.top+" "+this.markerUp.left,bgOffset:this.bgOffset}}downMarkerPatternStrings(){return{background:this.markerDownBackground.left+" "+this.markerDownBackground.right+" "+this.markerDownBackground.bottom+" "+this.markerDownBackground.left,foreground:this.markerDown.left+" "+this.markerDown.right+" "+this.markerDown.bottom+" "+this.markerDown.left,bgOffset:this.bgOffset}}rightMarkerPatternStrings(){return{background:this.markerRightBackground.top+" "+this.markerRightBackground.right+" "+this.markerRightBackground.bottom+" "+this.markerRightBackground.top,foreground:this.markerRight.top+" "+this.markerRight.right+" "+this.markerRight.bottom+" "+this.markerRight.top,bgOffset:this.bgOffset}}leftMarkerPatternStrings(){return{background:this.markerLeftBackground.top+" "+this.markerLeftBackground.Left+" "+this.markerLeftBackground.bottom+" "+this.markerLeftBackground.top,foreground:this.markerLeft.top+" "+this.markerLeft.left+" "+this.markerLeft.bottom+" "+this.markerLeft.top,bgOffset:this.bgOffset}}createPatternMapForStructureBar(){const t=new Map;return t.set("marker-up",this.upMarkerPatternStrings()),t.set("marker-down",this.downMarkerPatternStrings()),t.set("marker-right",this.rightMarkerPatternStrings()),t.set("marker-left",this.leftMarkerPatternStrings()),t}}class rt{constructor(t){this.container=new n,this.pattern=this.createFCPattern(this.container.group(),t),this.styles=t;let i=10;null!=t&&null!=t.fontStyles&&t.fontStyles.size&&(i=t.fontStyles.size),this.bgOffset=(1*i-.7*i)/2}createFCPattern(t,i){const s=i;return t.pattern(10,10,(function(t){t.rect(10,10).fill(s.barStyles.fc.fill),t.line(0,5,5,0).stroke({width:s.barStyles.fc.width,color:s.barStyles.fc.stroke,linecap:"square"}),t.line(5,10,10,5).stroke({width:s.barStyles.fc.width,color:s.barStyles.fc.stroke,linecap:"square"})})).id("pattern-time-fc")}getFCPolygonPattern(){return{background:"",foreground:"",bgOffset:0,pattern:this.pattern}}toString(){return this.container.svg()}}class ot{constructor(t,i,s,h){this.percentClamp=ot.PERCENT_CLAMP,this.value=t,this.scenario=i,this.pixelPerUnit=s||1;const e="string"==typeof h?w(h,null,!0):h;this.variance="neg"===e||e===dt.NEG?dt.NEG:"pos"===e||e===dt.POS?dt.POS:dt.NEU}isEmpty(){return void 0===this.value||null==this.scenario}getScaledUnit(){return null==this.value?0:this.value*this.pixelPerUnit}getScaledPercentUnit(){return null==this.value?0:this.value>this.percentClamp?this.percentClamp*this.pixelPerUnit:this.value<-this.percentClamp?-this.percentClamp*this.pixelPerUnit:this.value*this.pixelPerUnit}getVarianceStyle(){return null==this.value||this.value>=0?this.variance:dt.NEU===this.variance?dt.NEU:dt.POS===this.variance?dt.NEG:dt.POS}isClipped(){return null!=this.value&&Math.abs(this.value)>this.percentClamp}getClippedValue(){return 145}getScenario(){var t;return null===(t=this.scenario)||void 0===t?void 0:t.slice(0,2)}}ot.PERCENT_CLAMP=1.45;class lt{constructor(){this.operation="+"}addRowGroup(t,i){this.rowGroup=t,this.rowGroupIndex=i}addCategory(t,i){this.category=t,this.categoryIndex=i}addSubCategory(t,i){this.subCategory=t,this.subCategoryIndex=i}addColumnGroup(t,i){this.columnGroup=t,this.columnGroupIndex=i}addSubColumnGroup(t,i){this.columnSubGroup=t,this.columnSubGroupIndex=i}}class at{constructor(){}adapt(t){const i=new lt;return a.isString(t.date)&&(i.date=this.parseDateString(t.date)),a.isOperator(t.operation)&&(i.operation=t.operation),a.isNumber(t.rowGroupIndex)&&a.isString(t.rowGroup)&&i.addRowGroup(t.rowGroup,t.rowGroupIndex),a.isNumber(t.categoryIndex)&&a.isString(t.category)&&i.addCategory(t.category,t.categoryIndex),a.isNumber(t.subCategoryIndex)&&a.isString(t.subCategory)&&i.addSubCategory(t.subCategory,t.subCategoryIndex),a.isNumber(t.columnGroupIndex)&&a.isString(t.columnGroup)&&i.addColumnGroup(t.columnGroup,t.columnGroupIndex),a.isNumber(t.columnSubGroupIndex)&&a.isString(t.columnSubGroup)&&i.addSubColumnGroup(t.columnSubGroup,t.columnSubGroupIndex),this.setActualValues(t,i),this.setPlanValues(t,i),this.setPreviousPeriodValues(t,i),this.setForecastValues(t,i),i}parseDateString(t){if("string"!=typeof t)return;const i=N.fromISO(t,{zone:"utc"});if(i.isValid)return i;console.warn(`TimeChartDataRow: invalid date value '${t}' - skipping row`)}default(){return new lt}setActualValues(t,i){a.isNumber(t.ac1)&&(i.ac1=t.ac1),a.isNumber(t.ac2)&&(i.ac2=t.ac2),a.isNumber(t.ac3)&&(i.ac3=t.ac3),a.isNumber(t.ac4)&&(i.ac4=t.ac4)}setPlanValues(t,i){a.isNumber(t.pl1)&&(i.pl1=t.pl1),a.isNumber(t.pl2)&&(i.pl2=t.pl2),a.isNumber(t.pl3)&&(i.pl3=t.pl3),a.isNumber(t.pl4)&&(i.pl4=t.pl4)}setPreviousPeriodValues(t,i){a.isNumber(t.pp1)&&(i.pp1=t.pp1),a.isNumber(t.pp2)&&(i.pp2=t.pp2),a.isNumber(t.pp3)&&(i.pp3=t.pp3),a.isNumber(t.pp4)&&(i.pp4=t.pp4)}setForecastValues(t,i){a.isNumber(t.fc1)&&(i.fc1=t.fc1),a.isNumber(t.fc2)&&(i.fc2=t.fc2),a.isNumber(t.fc3)&&(i.fc3=t.fc3),a.isNumber(t.fc4)&&(i.fc4=t.fc4)}}class ct{constructor(t,i,s,h,e,n){this.scaleFactors=t,this.fontStyles=i,this.axisStyles=s,this.barStyles=h,this.varianceStyles=e,this.padding=n,this.pattern=new Map,this.stackColors=["#000000","#c0c0c0","#808080"],this.locale="de"}}class ut{constructor(t,i,s,h,e){this.scaleFactorsStructureChartAdapter=t,this.fontStyleAdapter=i,this.svgStyleGroupAdapter=s,this.svgVariancesStyleGroupAdapter=h,this.paddingadapter=e}adapt(t){const i=new ct(this.scaleFactorsStructureChartAdapter.default(),this.fontStyleAdapter.default(),this.svgStyleGroupAdapter.default(),this.svgStyleGroupAdapter.default(),this.svgVariancesStyleGroupAdapter.default(),this.paddingadapter.default());return a.isExisting(t)&&(a.isExisting(t.scaleFactors)&&(i.scaleFactors=this.scaleFactorsStructureChartAdapter.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.stackColors)&&t.stackColors.length>0&&(i.stackColors=t.stackColors),i.pattern=new nt(i.fontStyles.size).createPatternMapForStructureBar()),i}default(){return new ct(this.scaleFactorsStructureChartAdapter.default(),this.fontStyleAdapter.default(),this.svgStyleGroupAdapter.default(),this.svgStyleGroupAdapter.default(),this.svgVariancesStyleGroupAdapter.default(),this.paddingadapter.default())}}var dt,ft;!function(t){t.AC1="ac1",t.PP1="pp1",t.FC1="fc1",t.PL1="pl1",t.AC2="ac2",t.PP2="pp2",t.FC2="fc2",t.PL2="pl2",t.AC3="ac3",t.PP3="pp3",t.FC3="fc3",t.PL3="pl3",t.AC4="ac4",t.PP4="pp4",t.FC4="fc4",t.PL4="pl4",t.POS="pos",t.NEG="neg",t.NEU="neu"}(dt||(dt={})),function(t){t.LIST="LIST",t.SUM="SUM",t.OPT="OPT"}(ft||(ft={}));class pt{constructor(t,i,s){this.ID_AXIS="axis",this.CSS_AXIS_TITLE="categories",this.scenarioType=t.scenarioType,this.labelText=t.labelText||null,this.isRelative=t.isRelative||!1,this.titlePosition=t.titlePosition||"left",this.position=i,this.svgGroup=s.group().id(this.ID_AXIS)}drawAxisTitle(t,i){null==i&&(i=""),"right"!==this.titlePosition?t.text(i).addClass(this.CSS_AXIS_TITLE).attr("text-anchor","middle").move(this.position.getAxisTitlePositionX(t),this.position.getAxisTitlePositionY(!0,this.isRelative)):t.text(i).addClass(this.CSS_AXIS_TITLE).move(this.position.getAxisEndPositionX()+this.position.spacings.labelToColumn,this.position.getAxisTitlePositionY(!0,this.isRelative))}draw(){return this.labelText&&"none"!==this.titlePosition&&this.drawAxisTitle(this.svgGroup,this.labelText),this.svgGroup.line(this.position.getAxisPositionX(),this.position.getAxisPositionY(this.isRelative),this.position.getAxisEndPositionX(),this.position.getAxisPositionY(this.isRelative)).addClass(this.ID_AXIS+"-"+this.convertScenarioType()),this}convertScenarioType(){return void 0===this.scenarioType||null==this.scenarioType?"default":`${this.scenarioType}`.slice(0,2)}}class vt{constructor(t,i,s,h,e,n,r,o=null){this.ID_DATA_PREFIX="DATA",this.ID_SCENARIO_PREFIX="SCENARIO",this.ID_RECT="RECT",this.FALLBACK_COLOUR="#000000",this.label=null,this.scenarioLabel=null,this.isVarianceColumn=!1,this.overflowConfig=null,this.isOverflowing=!1,this.overdriveHeight=0,this.dimensions={columnLength:0,xPos:0,yPos:0,labelYPos:0,scenarioLabelXPos:0,scenarioLabelYPos:0,clipped:!1},this.hasData=!1,this.dataPoint=s,this.index=h,this.isPrimaryColumn=e,this.position=t,this.columnBarStyles=i.barStyles,this.overflowConfig=o,this.scenarioGroup=n,this.styles=i,this.columnGroup=n.group().id(n.toString()+"_"+this.ID_RECT),!0!==(null==s?void 0:s.isEmpty())&&(this.hasData=!0,this.dimensions=this.createDimensions(s,h,e),this.label=this.getDataLabel(s),this.scenarioLabel=this.getScenarioLabel(r))}setAsVariance(){var t;return this.isVarianceColumn=!0,null===(t=this.label)||void 0===t||t.setToVarianceLabel(),this}updateLabelGroup(t){var i;return this.isEmpty()||null===(i=this.label)||void 0===i||i.updateGroup(t),this}draw(t={percent:2,decimal:1},i=new M){var s,h,e;if(this.isEmpty())return this;const n=this.getScenarioStyle();let r=this.convertToSVGStyle(n,"stroke"),o=this.getFillStyle(n);if(this.isVarianceColumn&&"pl"===this.dataPoint.notation){const t=Number(null===(h=null===(s=this.columnBarStyles)||void 0===s?void 0:s.pl)||void 0===h?void 0:h.width);r={color:(null==n?void 0:n.fill)||this.FALLBACK_COLOUR,width:t>0?t:1},o=this.styles.fontStyles.background||"#ffffff"}this.scenarioGroup.attr(O(this.dataPoint.key)),null===(e=this.columnGroup)||void 0===e||e.attr(O(this.dataPoint.key,"element")),null!=this.columnGroup&&(this.isOverflowing&&this.overflowConfig?this.drawOverdriveBar(o,r):this.columnGroup.rect(this.position.getColumnWidth(),this.dimensions.columnLength).fill(o).stroke(r).y(this.dimensions.yPos).cx(this.dimensions.xPos)),this.drawColumnDataLabel(t,i),this.drawScenarioLabel()}drawOverdriveBar(t,i){if(!this.columnGroup||!this.overflowConfig)return;const s=this.position.getColumnPositionY(),h=this.position.getColumnWidth(),e=this.dimensions.columnLength,{breakGap:n}=this.overflowConfig,r=s-e;this.columnGroup.rect(h,e).fill(t).stroke(i).y(r).cx(this.dimensions.xPos);const o=r-n-this.overdriveHeight;this.columnGroup.rect(h,this.overdriveHeight).fill(t).stroke(i).y(o).cx(this.dimensions.xPos),this.drawBreakIndicator(r,n)}drawBreakIndicator(t,i){if(!this.columnGroup)return;const s=this.position.getColumnWidth(),h=this.dimensions.xPos-s/2,e=t-i/2,n=.35*i,r=s/3;let o=`M ${h} ${e-n}`;for(let t=0;t<3;t++)o+=` L ${h+r*(t+.5)} ${e-n-.3*i} L ${h+r*(t+1)} ${e-n}`;let l=`M ${h} ${e+n}`;for(let t=0;t<3;t++)l+=` L ${h+r*(t+.5)} ${e+n+.3*i} L ${h+r*(t+1)} ${e+n}`;this.columnGroup.rect(s+2,i).fill("#ffffff").stroke("none").y(t-i).cx(this.dimensions.xPos),this.columnGroup.path(o).fill("none").stroke({color:"#000000",width:1}),this.columnGroup.path(l).fill("none").stroke({color:"#000000",width:1})}createDimensions(t,i,s){const h=t.getScaledUnit();if(this.overflowConfig&&h>0){const e="ac"===t.getScenario()?this.overflowConfig.cutHeight:this.overflowConfig.cutHeight-this.overflowConfig.scenarioCutOffset;if(h>e){this.isOverflowing=!0;const{breakGap:t,overdriveZoneHeight:n,maxOverflow:r}=this.overflowConfig;this.overdriveHeight=r>0?(h-e)/r*n:0;const o=e+t+this.overdriveHeight,l=this.position.getColumnPositionY();return{clipped:!1,columnLength:e,xPos:this.position.getColumnPositionX(i,s),yPos:l-e,labelYPos:l-o-this.position.spacings.labelToColumn,scenarioLabelXPos:this.position.getColumnPositionX(i,s)+this.position.getScenarioLabelPositionOffsetX(s),scenarioLabelYPos:l-.5*e}}}return h<0?{clipped:!1,columnLength:Math.abs(h),xPos:this.position.getColumnPositionX(i,s),yPos:this.position.getColumnPositionY(),labelYPos:this.position.getColumnDataLabelPositionY(h),scenarioLabelXPos:this.position.getColumnPositionX(i,s)+this.position.getScenarioLabelPositionOffsetX(s),scenarioLabelYPos:this.position.getColumnPositionY()+.5*Math.abs(h)}:{clipped:!1,columnLength:h,xPos:this.position.getColumnPositionX(i,s),yPos:this.position.getColumnPositionY()-h,labelYPos:this.position.getColumnDataLabelPositionY(h),scenarioLabelXPos:this.position.getColumnPositionX(i,s)+this.position.getScenarioLabelPositionOffsetX(s),scenarioLabelYPos:this.position.getColumnPositionY()-.5*Math.abs(h)}}getDataLabel(t){let i=L.Bottom;null!=t.value&&t.value<0&&(i=L.Top);const s=this.isOverflowing?this.dimensions.labelYPos:this.position.getColumnDataLabelPositionY(this.dataPoint.getScaledUnit());return new P(this.scenarioGroup,this.position.getColumnCenterPositionX(this.index),s,this.ID_DATA_PREFIX,t.value,this.styles,i,L.Center).setPoint(t.key)}getScenarioLabel(t){return new P(this.scenarioGroup,-1,-1,this.ID_SCENARIO_PREFIX,t,this.styles,L.Center,this.isPrimaryColumn?L.Left:L.Right)}convertToSVGStyle(t,i){return null==t&&(t=[]),t.color=t[i]||this.FALLBACK_COLOUR,Object.assign({},t)}drawScenarioLabel(){null==this.scenarioLabel||this.scenarioLabel.isEmpty()||this.isVarianceColumn||this.scenarioLabel.setPos(this.dimensions.scenarioLabelXPos,this.dimensions.scenarioLabelYPos).draw(!0)}drawColumnDataLabel(t,i=new M){var s;null===(s=this.label)||void 0===s||s.draw(this.isPrimaryColumn,t,i)}getFillStyle(t){var i,s,h,e;const n=this.columnBarStyles[this.dataPoint.getScenario()];return(null==n?void 0:n.fillpattern)&&(null===(i=this.styles.pattern.get(n.fillpattern))||void 0===i?void 0:i.pattern)?null===(e=null===(h=null===(s=this.styles)||void 0===s?void 0:s.pattern)||void 0===h?void 0:h.get(n.fillpattern))||void 0===e?void 0:e.pattern:this.convertToSVGStyle(t,"fill")}getScenarioStyle(){var t;return this.isVarianceColumn?null===(t=this.styles)||void 0===t?void 0:t.varianceStyles.getSVGStyle(this.dataPoint.getVarianceStyle()):this.columnBarStyles[this.dataPoint.getScenario()]}isEmpty(){return!1===this.hasData||Number.isNaN(this.dataPoint.value)}}class wt{constructor(t,i,s,h,e,n,r,o,l){this.ID_DATA_PREFIX="DATA",this.ID_SCENARIO_PREFIX="SCENARIO",this.FALLBACK_COLOUR="#000000",this.scenarioLabel=null,this._defaultMarkerPattern=null,this.dimensions={columnLength:0,xPos:0,yPos:0,labelYPos:0,scenarioLabelXPos:0,scenarioLabelYPos:0,clipped:!1},this.hasData=!1,this.position=t,this.markerGroup=i||null,this.markerPattern=s||this._defaultMarkerPattern,this.styles=e,this.barStyles=e?e.barStyles:null,this.scenario=h,!0!==(null==n?void 0:n.isEmpty())&&(this.hasData=!0,this.pointKey=n.key,this.dimensions=this.createMarkerDimensions(n,r,l),this.scenarioLabel=this.getScenarioLabel(o,e,l))}draw(){if(this.isEmpty())return this;const t=this.convertToSVGStyle(this.barStyles[this.getScenario()],"stroke");let i=this.convertToSVGStyle(this.barStyles[this.getScenario()],"fill");const s=this.barStyles[this.getScenario()];if(null!=s&&s.fillpattern){const t=this.styles.pattern.get(s.fillpattern);null!=t&&(i=t.pattern)}return this.markerGroup.attr(O(this.pointKey)),this.markerGroup.polygon(this.markerPattern.background).fill("#ffffff").cy(this.dimensions.yPos-this.dimensions.columnLength).cx(this.dimensions.xPos),this.markerGroup.polygon(this.markerPattern.foreground).fill(i).stroke(t).cy(this.dimensions.yPos-this.dimensions.columnLength).cx(this.dimensions.xPos).attr(O(this.pointKey,"element")),null==this.scenarioLabel||this.scenarioLabel.isEmpty()||this.scenarioLabel.setPos(this.dimensions.scenarioLabelXPos,this.dimensions.scenarioLabelYPos).draw(),this}createMarkerDimensions(t,i,s){return t.getScaledUnit()<0?{clipped:!1,labelYPos:0,columnLength:t.getScaledUnit(),xPos:this.position.getMarkerPositionX(i,s),yPos:this.position.getMarkerPositionY(),scenarioLabelXPos:this.position.getMarkerPositionX(i,s)+this.position.getMarkerScenarioLabelPositionOffsetX(s),scenarioLabelYPos:this.position.getMarkerPositionY()+Math.abs(t.getScaledUnit())}:{clipped:!1,labelYPos:0,columnLength:t.getScaledUnit(),xPos:this.position.getMarkerPositionX(i,s),yPos:this.position.getMarkerPositionY(),scenarioLabelXPos:this.position.getMarkerPositionX(i,s)+this.position.getMarkerScenarioLabelPositionOffsetX(s),scenarioLabelYPos:this.position.getMarkerPositionY()-Math.abs(t.getScaledUnit())}}getScenarioLabel(t,i,s){return null==this.markerGroup?null:new P(this.markerGroup,-1,-1,this.ID_DATA_PREFIX,t,i,L.Center,s?L.Right:L.Left)}convertToSVGStyle(t,i){return null==t&&(t=[]),t.color=t[i]||this.FALLBACK_COLOUR,Object.assign({},t)}isEmpty(){return!1===this.hasData}getScenario(){var t;return null===(t=this.scenario)||void 0===t?void 0:t.slice(0,2)}}class mt{constructor(t,i,s,h,e){this.ID_DATA_PREFIX="DATA",this.ID_SCENARIO_PREFIX="SCENARIO",this.ID_RECT="RECT",this.FALLBACK_COLOUR="#000000",this.dataLabel=null,this.dimensions={columnLength:0,xPos:0,yPos:0,labelYPos:0,scenarioLabelXPos:0,scenarioLabelYPos:0,clipped:!1},this.hasData=!1,this.dataPoint=s,this.index=h,this.position=t,this.barStyles=i.barStyles,this.scenarioGroup=e,this.styles=i,this.barGroup=e.group().id(e.toString()+"_"+this.ID_RECT);const n=void 0===(null==s?void 0:s.value)&&null!=(null==s?void 0:s.scenario);(!0!==(null==s?void 0:s.isEmpty())||n)&&(this.hasData=!0,this.dimensions=this.createDimensions(t,s,h),this.dataLabel=new P(this.scenarioGroup,this.position.getColumnCenterPositionX(this.index),this.position.getNeedleDataLabelPositionY(this.dataPoint.getScaledPercentUnit()),this.ID_DATA_PREFIX,n?$:s.value,this.styles,L.Center,L.Center),this.dataLabel.setToRelativeVarianceLabel().setPoint(s.key))}updateLabelGroup(t){var i;return this.isEmpty()||null===(i=this.dataLabel)||void 0===i||i.updateGroup(t),this}draw(t={percent:2,decimal:1}){var i,s,h;if(void 0===(null===(i=this.dataPoint)||void 0===i?void 0:i.value))return null===(s=this.dataLabel)||void 0===s||s.draw(!0,t),this;if(this.isEmpty())return this;this.scenarioGroup.attr(O(this.dataPoint.key)),this.barGroup.attr(O(this.dataPoint.key,"element"));const e=this.styles.varianceStyles[this.dataPoint.getVarianceStyle()],n=this.convertToSVGStyle(e,"stroke");let r=this.convertToSVGStyle(e,"fill");const o=this.convertToSVGStyle(this.styles.varianceStyles.ac,"stroke"),l=this.convertToSVGStyle(this.styles.varianceStyles.ac,"fill"),a=this.barStyles[this.dataPoint.getScenario()];if(null!=a&&a.fillpattern){const t=this.styles.pattern.get(a.fillpattern);null!=t&&(r=t.pattern)}"pl"===this.dataPoint.notation&&(n.color=(null==e?void 0:e.fill)||n.color,n.width=Math.max(1,Number(n.width)||0),r=this.styles.fontStyles.background||"#ffffff"),this.dimensions.clipped?this.createClippedNeedleHead(r,n):this.createNeedleHead(o,l),this.barGroup.rect(this.position.getNeedleWidth(),this.dimensions.columnLength).cx(this.dimensions.xPos).y(this.dimensions.yPos).fill(r).stroke(n),null===(h=this.dataLabel)||void 0===h||h.draw(!0,t)}createDimensions(t,i,s){return i.getScaledPercentUnit()<0?{labelYPos:0,scenarioLabelXPos:0,scenarioLabelYPos:0,columnLength:Math.abs(i.getScaledPercentUnit()),xPos:t.getColumnCenterPositionX(s),yPos:t.getNeedlePositionY(),clipped:i.isClipped()}:{columnLength:i.getScaledPercentUnit(),xPos:t.getColumnCenterPositionX(s),yPos:t.getNeedlePositionY()-i.getScaledPercentUnit(),labelYPos:0,scenarioLabelXPos:0,scenarioLabelYPos:0,clipped:i.isClipped()}}convertToSVGStyle(t,i){return null==t&&(t=[]),t.color=t[i]||this.FALLBACK_COLOUR,Object.assign({},t)}createClippedNeedleHead(t,i){const s=this.barGroup.polygon("0,0 5,9 -5,9 0,0 0,5 5,13 -5,13 0,5").fill(t).cx(this.dimensions.xPos).cy(this.getHeadYPosition()).fill(t).stroke(i);null!=this.dataPoint.value&&this.dataPoint.value<0&&s.flip("y")}createNeedleHead(t,i){this.barGroup.rect(2*this.position.getNeedleWidth(),this.position.getNeedleHeadWidth()).cx(this.dimensions.xPos).cy(this.getHeadYPosition()).fill(t).stroke(i)}isEmpty(){return!1===this.hasData||Number.isNaN(this.dataPoint.value)}getHeadYPosition(){let t=this.dimensions.yPos;return null!=this.dataPoint.value&&this.dataPoint.value<0&&(t+=this.dimensions.columnLength),t}}const bt={ac:{markerFill:"#000000",markerStroke:"#000000",lineColor:"#000000"},pp:{markerFill:"#999999",markerStroke:"#999999",lineColor:"#999999"},fc:{markerFill:"#ffffff",markerStroke:"#000000",lineColor:"#000000",lineDashArray:"4,4"},pl:{markerFill:"#ffffff",markerStroke:"#000000",lineColor:"#000000"}};class gt{constructor(t,i,s,h,e,n,r,o,l=null,a){this.lineSlot=a,this.MARKER_SIZE=8,this.LINE_WIDTH=2,this.ID_LINE_PREFIX="LINE",this.ID_MARKER_PREFIX="MARKER",this.ID_LABEL_PREFIX="LABEL",this.ESTIMATED_LABEL_WIDTH=56,this.ESTIMATED_LABEL_HEIGHT=24,this.position=t,this.styles=i,this.dataPoints=s,this.scenarioGroup=h,this.labelGroup=e,this.scenarioName=n,this.scenarioLabel=r,this.collisionManager=l}draw(t={percent:2,decimal:1},i=new M){return this.drawGeometry(),this.drawLabels(t,i),this}drawGeometry(){if(0===this.dataPoints.length)return this;const t=this.getLineStyle();return this.drawLines(t),this.drawMarkers(t),this}drawLabels(t={percent:2,decimal:1},i=new M){return 0===this.dataPoints.length||(this.drawScenarioLabel(),this.drawValueLabels(t,i)),this}getLineStyle(){var t,i,s;const h=null!==(t=this.lineSlot)&&void 0!==t?t:(null===(s=null===(i=this.scenarioName)||void 0===i?void 0:i.slice(0,2))||void 0===s?void 0:s.toLowerCase())||"ac";return bt[h]||bt.ac}getScenarioVariant(){var t;const i=parseInt((null===(t=this.scenarioName)||void 0===t?void 0:t.slice(-1))||"1",10);return isNaN(i)?1:Math.min(Math.max(i,1),4)}drawSquareMarker(t,i,s,h){const e=this.MARKER_SIZE/2;return t.rect(this.MARKER_SIZE,this.MARKER_SIZE).fill(h.markerFill).stroke({color:h.markerStroke,width:1}).move(i-e,s-e)}drawCircleMarker(t,i,s,h){return t.circle(this.MARKER_SIZE).fill(h.markerFill).stroke({color:h.markerStroke,width:1}).center(i,s)}drawTriangleMarker(t,i,s,h){const e=this.MARKER_SIZE/2;return t.polygon(`${i},${s-e} ${i-e},${s+e} ${i+e},${s+e}`).fill(h.markerFill).stroke({color:h.markerStroke,width:1})}drawDiamondMarker(t,i,s,h){const e=this.MARKER_SIZE/2;return t.polygon(`${i},${s-e} ${i+e},${s} ${i},${s+e} ${i-e},${s}`).fill(h.markerFill).stroke({color:h.markerStroke,width:1})}drawLines(t){const i=this.scenarioGroup.group().id(this.ID_LINE_PREFIX);for(let s=1;s<this.dataPoints.length;s++){const h=this.dataPoints[s-1],e=this.dataPoints[s];if(h.dataPoint.isEmpty()||e.dataPoint.isEmpty())continue;const n=this.position.getColumnCenterPositionX(h.index),r=this.position.getColumnPositionY()-h.dataPoint.getScaledUnit(),o=this.position.getColumnCenterPositionX(e.index),l=this.position.getColumnPositionY()-e.dataPoint.getScaledUnit(),a=i.line([[n,r],[o,l]]).stroke({color:t.lineColor,width:this.LINE_WIDTH,linecap:"round"}).fill("none");t.lineDashArray&&a.attr("stroke-dasharray",t.lineDashArray)}}drawMarkers(t){const i=this.scenarioGroup.group().id(this.ID_MARKER_PREFIX),s=this.getScenarioVariant();for(const h of this.dataPoints){if(h.dataPoint.isEmpty())continue;const e=this.position.getColumnCenterPositionX(h.index),n=this.position.getColumnPositionY()-h.dataPoint.getScaledUnit();let r;switch(s){case 2:r=this.drawCircleMarker(i,e,n,t);break;case 3:r=this.drawTriangleMarker(i,e,n,t);break;case 4:r=this.drawDiamondMarker(i,e,n,t);break;default:r=this.drawSquareMarker(i,e,n,t)}r.attr(O(h.dataPoint.key,"element")).attr("data-bn-index",String(h.index))}}getLabelPositionPriority(t){const i=this.dataPoints[t];let s=null;for(let i=t+1;i<this.dataPoints.length;i++)if(!this.dataPoints[i].dataPoint.isEmpty()){s=this.dataPoints[i];break}let h=null;for(let i=t-1;i>=0;i--)if(!this.dataPoints[i].dataPoint.isEmpty()){h=this.dataPoints[i];break}const e=i.dataPoint.getScaledUnit();return h&&s&&h.dataPoint.getScaledUnit()>e&&s.dataPoint.getScaledUnit()>e?[k.Below,k.Left,k.Right,k.Above]:[k.Above,k.Left,k.Right,k.Below]}getScenarioType(){var t,i;return(null===(i=null===(t=this.scenarioName)||void 0===t?void 0:t.slice(0,2))||void 0===i?void 0:i.toLowerCase())||"ac"}drawValueLabels(t,i){const s=this.getScenarioType();for(let h=0;h<this.dataPoints.length;h++){const e=this.dataPoints[h];if(e.dataPoint.isEmpty()||null===e.dataPoint.value)continue;const n=this.position.getColumnCenterPositionX(e.index),r=this.position.getColumnPositionY()-e.dataPoint.getScaledUnit();let o=n,l=r-this.MARKER_SIZE/2-2,a=L.Bottom,c=L.Center;if(this.collisionManager){const t=this.getLabelPositionPriority(h),i=this.collisionManager.getOptimalPlacement(n,r,this.ESTIMATED_LABEL_WIDTH,this.ESTIMATED_LABEL_HEIGHT,e.index,this.MARKER_SIZE,s,t);if(null===i)continue;o=i.labelX,l=i.labelY,a=i.verticalHook,c=i.horizontalHook;const u=Object.assign(Object.assign({},i.bounds),{scenarioType:s});this.collisionManager.register(u)}new P(this.labelGroup,o,l,this.ID_LABEL_PREFIX,e.dataPoint.value,this.styles,a,c).setPoint(e.dataPoint.key).draw(!0,t,i)}}drawScenarioLabel(){if(!this.scenarioLabel)return;let t=null;for(let i=this.dataPoints.length-1;i>=0;i--)if(!this.dataPoints[i].dataPoint.isEmpty()){t=this.dataPoints[i];break}if(!t)return;const i=this.position.getColumnCenterPositionX(t.index)+this.MARKER_SIZE+4,s=this.position.getColumnPositionY()-t.dataPoint.getScaledUnit(),h=this.getScenarioType();if(this.collisionManager){if(this.collisionManager.shouldHideScenarioLabel(i,s,h))return;this.collisionManager.registerScenarioLabel(i,s,h)}new P(this.labelGroup,i,s,"SCENARIO_LABEL",this.scenarioLabel,this.styles,L.Center,L.Left).forceStringTypeDraw()}}class yt{constructor(t,i,s,h,e,n,r,o,l,a,c){this.hasData=!1,this.position=t,this.styles=i,this.dataPoint=s,this.index=h,this.segment=e,this.segmentIndex=r,this.stackMode=o,this.stack=l,this.group=c,this.columnGroup=c.group().id(`stacked_col_${h}_seg_${r}`),!0!==(null==s?void 0:s.isEmpty())&&null!=s.value&&(this.hasData=!0)}draw(t={percent:2,decimal:1},i=new M){if(!this.hasData||!Number.isFinite(this.dataPoint.value))return;const s=this.dataPoint.value,h=this.dataPoint.pixelPerUnit,e=this.position.getColumnPositionY(),n=Math.abs(this.segment.end-this.segment.start)*h,r=e-Math.max(this.segment.start,this.segment.end)*h,o=this.position.getColumnCenterPositionX(this.index),l=this.position.getColumnWidth(),a=this.styles.stackColors,u=a[this.segmentIndex%a.length],d={color:u},f={color:u,width:.5};if(this.columnGroup.attr(O(this.dataPoint.key,"element")),this.columnGroup.rect(l,Math.max(n,.5)).fill(d).stroke(f).y(r).cx(o),n>=18){const h=r+n/2;if(this.stackMode===c.RELATIVE||this.stackMode===c.ABSOLUTE_RELATIVE){const i=m.number(this.segment.share,"percent",t.percent,t.percent,1,this.styles.locale);new P(this.group,o,h,"STACK_SEG",i,this.styles,L.Center,L.Center).setSegmentFill(u).setPoint(this.dataPoint.key).forceStringTypeDraw()}else new P(this.group,o,h,"STACK_SEG",s,this.styles,L.Center,L.Center).setSegmentFill(u).setPoint(this.dataPoint.key).draw(!0,t,i)}}drawTotalLabel(t={percent:2,decimal:1},i=new M,s){if(this.stackMode===c.RELATIVE)return;const h=this.stack.total<0,e=h?0-this.stack.negative:this.stack.positive,n=this.position.getColumnCenterPositionX(this.index),r=this.position.getColumnDataLabelPositionY(e*this.dataPoint.pixelPerUnit);new P(this.group,n,r,"STACK_TOTAL",this.stack.total,this.styles,h?L.Top:L.Bottom,L.Center).setPoint(s,"total").draw(!0,t,i)}}const St={ac:{fill:"#000000",opacity:.3,lineColor:"#000000"},pp:{fill:"#999999",opacity:.3,lineColor:"#999999"},fc:{fill:"#000000",opacity:.2,lineColor:"#000000",dashArray:"4,4"},pl:{fill:"#000000",opacity:.1,lineColor:"#000000"}},Pt=[{fill:"#000000",opacity:.3},{fill:"#555555",opacity:.25},{fill:"#999999",opacity:.2},{fill:"#bbbbbb",opacity:.15},{fill:"#dddddd",opacity:.1}];class Lt{constructor(t,i,s,h,e,n){this.group=t.group().id(`area_fill_${e}`),this.upperPoints=i,this.lowerPoints=s,this.scenarioType=h,this.segmentIndex=e,this.isScenarioStack=n}draw(){if(this.upperPoints.length<2||this.lowerPoints.length<2)return;let t,i,s=`M ${this.upperPoints[0].x},${this.upperPoints[0].y}`;for(let t=1;t<this.upperPoints.length;t++)s+=` L ${this.upperPoints[t].x},${this.upperPoints[t].y}`;for(let t=this.lowerPoints.length-1;t>=0;t--)s+=` L ${this.lowerPoints[t].x},${this.lowerPoints[t].y}`;if(s+=" Z",this.isScenarioStack&&this.scenarioType){const s=this.scenarioType.slice(0,2).toLowerCase(),h=St[s]||St.ac;t=h.fill,i=h.opacity}else{const s=Math.min(this.segmentIndex,Pt.length-1);t=Pt[s].fill,i=Pt[s].opacity}this.group.path(s).fill(t).opacity(i).stroke("none")}drawBoundaryLine(){if(this.upperPoints.length<2)return;let t,i="#000000";if(this.isScenarioStack&&this.scenarioType){const s=this.scenarioType.slice(0,2).toLowerCase(),h=St[s]||St.ac;i=h.lineColor,t=h.dashArray}const s=this.group.polyline(this.upperPoints.map((t=>[t.x,t.y]))).fill("none").stroke({color:i,width:1.5});t&&s.attr("stroke-dasharray",t)}}class kt{constructor(t,i,s,h,e,n,r,o){this.ID_DATA_PREFIX="DATA",this.ID_SCENARIO_PREFIX="SCENARIO",this.ID_RECT="RECT",this.FALLBACK_COLOUR="#000000",this.label=null,this.scenarioLabel=null,this.isVarianceLine=!1,this.dimensions={columnLength:0,xPos:0,yPos:0,labelYPos:0,scenarioLabelXPos:0,scenarioLabelYPos:0,clipped:!1},this.previousDimensions={columnLength:0,xPos:0,yPos:0,labelYPos:0,scenarioLabelXPos:0,scenarioLabelYPos:0,clipped:!1},this.hasData=!1,this.dataPoint=s,this.index=e,this.isPrimaryLine=n,this.position=t,this.LineBarStyles=i.barStyles,this.scenarioGroup=r,this.styles=i,this.LineGroup=r.group().id(r.toString()+"_"+this.ID_RECT),!0!==(null==s?void 0:s.isEmpty())&&(this.hasData=!0,this.dimensions=this.createDimensions(s,e,n),this.label=this.getDataLabel(s),this.scenarioLabel=this.getScenarioLabel(o)),this.previousDimensions=this.createDimensions(h,e-1,n)}setAsVariance(){var t;return this.isVarianceLine=!0,null===(t=this.label)||void 0===t||t.setToVarianceLabel(),this}updateLabelGroup(t){var i;return this.isEmpty()||null===(i=this.label)||void 0===i||i.updateGroup(t),this}draw(t={percent:2,decimal:1},i=new M){if(this.isEmpty())return this;const s=this.getScenarioStyle(),h=this.getFillStyle(s);null!=this.LineGroup&&this.LineGroup.line([[this.previousDimensions.xPos,this.previousDimensions.yPos],[this.dimensions.xPos,this.dimensions.yPos]]).fill(h).stroke({color:"#f06",width:3,linecap:"round"}),this.drawLineDataLabel(t,i),this.drawScenarioLabel()}createDimensions(t,i,s){return{clipped:!1,columnLength:t.getScaledUnit(),xPos:this.position.getColumnPositionX(i,s),yPos:this.position.getColumnPositionY()-t.getScaledUnit(),labelYPos:this.position.getColumnDataLabelPositionY(t.getScaledUnit()),scenarioLabelXPos:this.position.getColumnPositionX(i,s)+this.position.getScenarioLabelPositionOffsetX(s),scenarioLabelYPos:this.position.getColumnPositionY()-t.getScaledUnit()}}getDataLabel(t){let i=L.Bottom;return null!=t.value&&t.value<0&&(i=L.Top),new P(this.scenarioGroup,this.position.getColumnCenterPositionX(this.index),this.position.getColumnDataLabelPositionY(this.dataPoint.getScaledUnit()),this.ID_DATA_PREFIX,t.value,this.styles,i,L.Center)}getScenarioLabel(t){return new P(this.scenarioGroup,0,0,this.ID_SCENARIO_PREFIX,t,this.styles,L.Bottom,L.Left)}convertToSVGStyle(t,i){return null==t&&(t=[]),t.color=t[i]||this.FALLBACK_COLOUR,Object.assign({},t)}drawScenarioLabel(){null==this.scenarioLabel||this.scenarioLabel.isEmpty()||this.isVarianceLine||this.scenarioLabel.setPos(this.dimensions.scenarioLabelXPos,this.dimensions.scenarioLabelYPos).draw(!0)}drawLineDataLabel(t,i=new M){var s;null===(s=this.label)||void 0===s||s.draw(this.isPrimaryLine,t,i)}getFillStyle(t){var i,s,h,e;const n=this.LineBarStyles[this.dataPoint.getScenario()];return(null==n?void 0:n.fillpattern)&&(null===(i=this.styles.pattern.get(n.fillpattern))||void 0===i?void 0:i.pattern)?null===(e=null===(h=null===(s=this.styles)||void 0===s?void 0:s.pattern)||void 0===h?void 0:h.get(n.fillpattern))||void 0===e?void 0:e.pattern:this.convertToSVGStyle(t,"fill")}getScenarioStyle(){var t;return this.isVarianceLine?null===(t=this.styles)||void 0===t?void 0:t.varianceStyles.getSVGStyle(this.dataPoint.getVarianceStyle()):this.LineBarStyles[this.dataPoint.getScenario()]}isEmpty(){return!1===this.hasData||Number.isNaN(this.dataPoint.value)}}class xt{constructor(t,i,s,h,e){this.pixelPerUnit=1,this.collisionManager=null,this.overflowConfig=null,this.i18n=e;const n=i.group().id("Scenario1"),r=i.group().id("Scenario2").insertBefore(n);this.svgGroups={parent:i,scenario1:n,scenario2:r,scenario3:i.group().id("Scenario3"),scenario4:i.group().id("Scenario4"),scenario1Label:i.group().id("label")},this.styles=s,this.position=t,this.elementCnt=h}setOverflowConfig(t){this.overflowConfig=t}createLine(t,i,s,h){const e=this.svgGroups.scenario1.group().id(""+h),n=this.svgGroups.scenario1Label.group().id(""+h);let r=null;return this.isLastDataPoint(h-1)&&(r=t),new kt(this.position,this.styles,i,s,h,!1,e,r).updateLabelGroup(n)}createPrimaryBar(t,i,s=!0){const h=this.svgGroups.scenario1.group().id(""+i),e=this.svgGroups.scenario1Label.group().id(""+i);let n=null;return s&&this.isLastDataPoint(i)&&(n=`${this.i18n.get(t.scenario)||t.scenario}`),new vt(this.position,this.styles,t,i,!0,h,n,this.overflowConfig).updateLabelGroup(e)}createVarianceBar(t,i){const s=this.svgGroups.scenario1.group().id(""+i),h=this.svgGroups.scenario1Label.group().id(""+i);let e=null;return this.isLastDataPoint(i)&&(e=`${this.i18n.get(t.scenario)||t.scenario}`),new vt(this.position,this.styles,t,i,!0,s,e,this.overflowConfig).updateLabelGroup(h).setAsVariance()}createRelativeVarianceBar(t,i){const s=this.svgGroups.scenario1.group().id(""+i),h=this.svgGroups.scenario1Label.group().id(""+i);return new mt(this.position,this.styles,t,i,s).updateLabelGroup(h)}createSecondaryBar(t,i){const s=this.svgGroups.scenario2.group().id(""+i);let h=null;return this.isFirstDataPoint(i)&&(h=`${this.i18n.get(t.scenario)||t.scenario}`),new vt(this.position,this.styles,t,i,!1,s,h,this.overflowConfig)}createPrimaryMarker(t,i){const s=this.svgGroups.scenario3.group().id(""+i),h=this.styles.pattern.get("marker-right")||{foreground:"#000000",background:"#ffffff",bgOffset:0};let e=null;return this.isFirstDataPoint(i)&&(e=`${this.i18n.get(t.scenario)||t.scenario}`),new wt(this.position,s,h,t.scenario,this.styles,t,i,e,!0)}createSecondaryMarker(t,i){const s=this.svgGroups.scenario4.group().id(""+i),h=this.styles.pattern.get("marker-left")||{foreground:"#000000",background:"#ffffff",bgOffset:0};let e=null;return this.isLastDataPoint(i)&&(e=`${this.i18n.get(t.scenario)||t.scenario}`),new wt(this.position,s,h,t.scenario,this.styles,t,i,e,!1)}isLastDataPoint(t){return this.elementCnt-1===t}isFirstDataPoint(t){return 0===t}setCollisionManager(t){this.collisionManager=t}moveLabelsToFront(){this.svgGroups.scenario1Label.front()}createLineSeries(t,i,s){const h=this.svgGroups.parent.group().id("LineSeries_"+i),e=this.svgGroups.scenario1Label.group().id("LineSeries_Label_"+i),n=`${this.i18n.get(i)||i}`;return new gt(this.position,this.styles,t,h,e,i,n,this.i18n,this.collisionManager,s)}}const Ct="bn-measurement-host";function Mt(t,i){const s=function(){if("undefined"==typeof document||!document.body)return null;let t=document.getElementById(Ct);return t||(t=document.createElement("div"),t.id=Ct,t.style.cssText="opacity:0;position:absolute;left:-100%;top:-100%;overflow:hidden",t.setAttribute("aria-hidden","true"),document.body.appendChild(t)),t}();if(s){s.appendChild(t.node);try{i()}finally{t.node.parentNode===s&&s.removeChild(t.node)}}else i()}var Ot,At;!function(t){t[t.UP_TO_DATE=0]="UP_TO_DATE",t[t.DIRTY=1]="DIRTY"}(Ot||(Ot={})),function(t){t.RELATIVE="dr",t.ABSOLUTE="d",t.NONE=""}(At||(At={}));class Tt{constructor(t,i,s,h,e,n=0){this.CSS_CATEGORIES="categories",this.dataModel=[],this.variancesDataModel=[],this.title="",this.configTitle="",this.configVariances=[],this.smallestDataPointValue=new ot(0,dt.AC1,1,dt.NEU),this.highestDataPointValue=new ot(0,dt.AC1,1,dt.NEU),this.smallestVarianceDataPointValue=new ot(0,dt.AC1,1,dt.NEU),this.highestVarianceDataPointValue=new ot(0,dt.AC1,1,dt.NEU),this.pixelPerUnit=1,this.pixelPerPercentage=1,this.hideAxisLabels=!1,this.axisScenario=dt.AC1,this.fromExpr="",this.rowCount=0,this.axisCategoryArea={width:0,height:0},this.scenariosArea={width:0,height:0},this.state=Ot.DIRTY,this.i18n=new Map,this.leftSideOffsetForHorizontalSync=-1,this.dateInterval=F.DAY,this.locale="de",this.axisLabelsMode=u.SMART,this.intervalSpanLimit=32,this.measureScale=new M,this.measureUnit="",this.dataFormatDigits={percent:2,decimal:1},this.showOverlayMedian=!1,this.showOverlayAvg=!1,this.chartMode=d.BAR,this.maxBars=28,this.stackConfig=null,this.scenarioPropOrder=[],this.lineFullWidth=!0,this.availableWidth=0,this.overflowConfig=null,this.lastScenarios=[],this.axisLabelsStep=1,this.scenarioSwitch=!1,this.axisTitlePosition="left",this.varianceOverlaps=0,this.db=i,this.tableName=s,this.ruleSet=t||new b,this.i18n=this.createI18n(new Map),this.styles=e,this.availableWidth=n,this.setConfig(h),this.position=this.createElementPosition(this.lastScenarios)}updatePosition(t){this.position=this.createElementPosition(t)}setStyles(t){this.styles=t}setRuleSet(t){this.ruleSet=t||new b}setAvailableWidth(t){this.availableWidth=t}setAvailableHeight(t){this.pixelPerUnit<=0||t<=0?this.overflowConfig=null:null==this.stackConfig&&this.determineEffectiveChartMode()===d.BAR?(this.overflowConfig=this.calculateOverflowConfig(t),this.overflowConfig&&this.updatePosition(this.lastScenarios)):this.overflowConfig=null}calculateOverflowConfig(t){const i=(this.isVarianceChart()?this.highestVarianceDataPointValue:this.highestDataPointValue).getScaledUnit();if(i<=0)return null;const s=this.styles.fontStyles.size,h=1.5*s,e=.3*s,n=t-(this.position.dataLabelHeight+this.position.spacings.labelToColumn+this.position.padding.top+this.position.padding.bottom+this.position.spacings.labelToAxis+s+this.switchNamesHeight())-h-e,r=.8*s;if(n<=r)return null;const o=n-r;return i<=o?null:{cutHeight:n,overdriveZoneHeight:h,breakGap:e,maxOverflow:i-o,scenarioCutOffset:r}}setConfig(t){var i,s,h,e;this.state=Ot.DIRTY,this.locale=t.locale,this.scenarioPropOrder=[...t.scenarios];const n=this.sortScenariosbyVisualisationRules(t.scenarios);if(this.setSource(t.filter),this.hideAxisLabels=t.hideAxisLabels||!1,this.pixelPerUnit=t.pixelPerUnit,this.pixelPerPercentage=t.pixelPerPercentage,this.axisLabelsMode=t.axisLabelsMode,this.intervalSpanLimit=t.intervalSpanLimit,this.axisLabelsStep=null!==(i=t.axisLabelsStep)&&void 0!==i?i:1,this.scenarioSwitch=null!==(s=t.scenarioSwitch)&&void 0!==s&&s,this.axisTitlePosition=null!==(h=t.axisTitlePosition)&&void 0!==h?h:"left",this.dateInterval=this.findDateInterval(t.dateInterval),this.dataModel=this.populateModel(n,this.dateInterval),this.variancesDataModel=this.populateVarianceModel(t.variances,this.dataModel),this.configTitle=t.title,this.configVariances=null!==(e=null==t?void 0:t.variances)&&void 0!==e?e:[],this.updateTitle(),this.smallestDataPointValue=this.findSmallestDataPointValue(this.dataModel),this.smallestVarianceDataPointValue=this.findSmallestDataPointValue(this.variancesDataModel),this.highestDataPointValue=this.findHighestDataPointValue(this.dataModel),this.highestVarianceDataPointValue=this.findHighestDataPointValue(this.variancesDataModel),this.axisScenario=this.setAxisScenario(t.variances),this.leftSideOffsetForHorizontalSync=t.leftSideOffsetForHorizontalSync,this.measureScale=t.measureScale,this.measureUnit=t.measureUnit,this.dataFormatDigits=t.dataFormatDigits,this.showOverlayMedian=t.showOverlayMedian,this.showOverlayAvg=t.showOverlayAvg,this.chartMode=t.chartMode,this.maxBars=t.maxBars,this.stackConfig=t.stackConfig,this.lineFullWidth=t.lineFullWidth,this.lastScenarios=n,null!=this.stackConfig){const t=[];for(const i of this.dataModel)t.push(...this.stackGroups(i).map((t=>t.layout)));const i=G(t),{scenario:s,variance:h}=this.highestDataPointValue;this.highestDataPointValue=new ot(i.positive,s,this.pixelPerUnit,h),this.smallestDataPointValue=new ot(0-i.negative,s,this.pixelPerUnit,h)}this.updatePosition(n)}getFooter(){return 1===this.measureScale.value&&""===this.measureUnit?" ":m.translateScenarioLabel("in",this.i18n)+" "+this.measureScale.prefix+this.measureUnit}sortScenariosbyVisualisationRules(t){const i=this;return[...t].sort(((t,s)=>i.ruleSet.getScenarioSorIndex(t)-i.ruleSet.getScenarioSorIndex(s))).reverse()}setI18n(t){this.i18n=this.createI18n(t),this.updateTitle()}updateTitle(){var t,i;const s=this.scenarioSwitch?null===(t=this.configVariances)||void 0===t?void 0:t[0]:null===(i=this.configVariances)||void 0===i?void 0:i.toString();this.title=this.configTitle||m.translateScenarioLabel(s,this.i18n)}setSource(t){var i,s;if(this.state=Ot.DIRTY,this.queryError=void 0,this.fromExpr=E(this.db,this.tableName,t),this.fromExpr)try{const t=this.db.exec(`SELECT COUNT(*) AS cnt FROM ${this.fromExpr}`);this.rowCount=null!==(s=null===(i=t[0])||void 0===i?void 0:i.cnt)&&void 0!==s?s:0}catch(t){this.rowCount=0,this.failQuery(t)}else this.rowCount=0}getQueryError(){return this.queryError}failQuery(t){var i;null!==(i=this.queryError)&&void 0!==i||(this.queryError=j(t))}getAllocatedCanvasWidth(){const t=this.position.getAxisEndPositionX(),i=3*this.styles.fontStyles.size,s=Math.max(this.axisCategoryArea.width,this.scenariosArea.width),h=s>0?s+this.position.leftSideLabelLength:0;let e=0;if("right"===this.axisTitlePosition&&this.title){const i=v(this.title,{font:this.styles.fontStyles.font,fontSize:this.styles.fontStyles.size+"px"}).width;e=t+this.position.spacings.labelToColumn+i+this.styles.padding.right}return Math.max(t+i,h,e)}getAllocatedCanvasHeight(){if(null==this.smallestVarianceDataPointValue.value||null==this.highestVarianceDataPointValue.value||null==this.smallestDataPointValue.value||null==this.highestDataPointValue.value)return 0;const t=this.isVarianceChart()&&this.variancesDataModel.some((t=>t.type===At.RELATIVE)),i=this.position.getAxisPositionY(t),s=this.position.spacings.labelToAxis+this.position.dataLabelHeight+this.styles.padding.bottom;let h;if(this.isOnSameAxisSide())h=i+s;else{const t=this.isVarianceChart()?this.smallestVarianceDataPointValue:this.smallestDataPointValue;h=i+Math.abs(t.getScaledUnit())+this.position.spacings.labelToColumn+this.position.dataLabelHeight+s}const e=this.isOnSameAxisSide();return Math.max(h,e?this.axisCategoryArea.height+this.scenariosArea.height:this.scenariosArea.height)+this.switchNamesHeight()}switchNamesHeight(){return!this.hideAxisLabels&&this.switchRuns().length>1?this.position.dataLabelHeight:0}static hasValue(t){return null!=t&&!t.isEmpty()&&null!=t.value&&!Number.isNaN(t.value)}followerSlots(){return this.scenarioSwitch&&null==this.stackConfig&&this.determineEffectiveChartMode()===d.BAR?["scenario2","scenario3","scenario4"].filter((t=>{let i=0;for(const s of this.dataModel)if(Tt.hasValue(s[t])){if(Tt.hasValue(s.scenario1))return!1;i++}return i>0})):[]}visibleSlot(t,i){var s;return Tt.hasValue(t.scenario1)?"scenario1":null!==(s=i.find((i=>Tt.hasValue(t[i]))))&&void 0!==s?s:null}switchRuns(){const t=this.followerSlots();if(0===t.length)return[];const i=[];return this.dataModel.forEach(((s,h)=>{const e=this.visibleSlot(s,t),n=e?s[e].scenario:null,r=i[i.length-1];null!=n&&(null==r?void 0:r.scenario)!==n?i.push({scenario:n,from:h,to:h}):r&&(r.to=h)})),i}getVarianceOverlaps(){return this.varianceOverlaps}fitRelativeVariances(t){const i=this.variancesDataModel.filter((t=>t.type===At.RELATIVE)).map((t=>t.scenario1));if(0===i.length||!i.some((t=>t.isClipped())))return;const s=t=>{i.forEach((i=>i.percentClamp=t)),this.updatePosition(this.lastScenarios)};s(Number.POSITIVE_INFINITY),this.layout(),t>0&&this.getAllocatedCanvasHeight()<=t||s(ot.PERCENT_CLAMP)}getUnitBarExtent(){var t,i;const s=this.isVarianceChart()&&this.variancesDataModel.some((t=>t.type===At.RELATIVE)),h=this.isVarianceChart(),e=h?this.highestVarianceDataPointValue:this.highestDataPointValue,n=h?this.smallestVarianceDataPointValue:this.smallestDataPointValue;return W({relativeVariance:s,maxPositive:null!==(t=null==e?void 0:e.value)&&void 0!==t?t:0,minNegative:this.isOnSameAxisSide()?0:null!==(i=null==n?void 0:n.value)&&void 0!==i?i:0})}getPercentBarExtent(){var t,i,s,h;const e=this.isVarianceChart()&&this.variancesDataModel.some((t=>t.type===At.RELATIVE));return X({relativeVariance:e,maxPositive:null!==(i=null===(t=this.highestVarianceDataPointValue)||void 0===t?void 0:t.value)&&void 0!==i?i:0,minNegative:this.isOnSameAxisSide()?0:null!==(h=null===(s=this.smallestVarianceDataPointValue)||void 0===s?void 0:s.value)&&void 0!==h?h:0})}layout(){const t=new n;Mt(t,(()=>this.draw(t)))}toString(){const t=new n;return Mt(t,(()=>this.draw(t))),t.id("drawCanvas"),t.width(this.getAllocatedCanvasWidth()),t.height(this.getAllocatedCanvasHeight()),t.attr("overflow","visible"),t.svg()}applyFontToContainer(t){t.attr({"font-size":this.styles.fontStyles.size,"font-family":this.styles.fontStyles.family})}draw(t){this.cleanSVGforRedraw(t),this.applyFontToContainer(t),this.state===Ot.DIRTY&&(this.state=Ot.UP_TO_DATE),this.isVarianceChart()?(this.drawVarianceScenario(this.variancesDataModel,t),this.drawAxisAndLabels(this.variancesDataModel,t)):null!=this.stackConfig?this.determineEffectiveChartMode()===d.LINE?(this.drawStackedAreaScenarios(this.dataModel,t),this.drawAxisAndLabelsForLineChart(this.dataModel,t)):(this.drawStackedScenarios(this.dataModel,t),this.drawStackedHeaders(this.dataModel,t),this.drawAxisAndLabels(this.dataModel,t)):this.determineEffectiveChartMode()===d.LINE?(this.drawLineScenarios(this.dataModel,t),this.drawAxisAndLabelsForLineChart(this.dataModel,t)):(this.drawScenarios(this.dataModel,t),this.drawOverlayLayer(this.dataModel,t),this.drawAxisAndLabels(this.dataModel,t))}determineEffectiveChartMode(){return this.chartMode===d.LINE||this.chartMode===d.AUTO&&this.dataModel.length>this.maxBars?d.LINE:d.BAR}setPattern(t,i){this.styles.pattern.set(t,i)}hasNoData(){return 0===this.dataModel.length}isOnSameAxisSide(){return null!=this.smallestVarianceDataPointValue.value&&null!=this.highestVarianceDataPointValue.value&&null!=this.smallestDataPointValue.value&&null!=this.highestDataPointValue.value&&(this.isVarianceChart()?Math.sign(this.smallestVarianceDataPointValue.value)===Math.sign(this.highestVarianceDataPointValue.value)||0===this.smallestDataPointValue.value&&1===Math.sign(this.highestDataPointValue.value):Math.sign(this.smallestDataPointValue.value)===Math.sign(this.highestDataPointValue.value)||0===this.smallestDataPointValue.value&&1===Math.sign(this.highestDataPointValue.value))}createI18n(t){this.state=Ot.DIRTY;const i=new Map([["SEPARATOR_WS",", "],["in","in"],["ORDER_asc","↑"],["ORDER_desc","↓"],["ac1","AC"],["pp1","PY"],["fc1","FC"],["pl1","PL"],["ac2","AC2"],["pp2","PY2"],["fc2","FC2"],["pl2","PL2"],["ac3","AC3"],["pp3","PY3"],["fc3","FC3"],["pl3","PL3"],["ac4","AC4"],["pp4","PY4"],["fc4","FC4"],["pl4","PL4"],["category"," "],["operation"," "],["thereof","davon"],["part_of","in % von"],["ibcssymbol_delta_ac","Δ{%}"],["ibcssymbol_delta_generic","Δ({%})"],["ibcssymbol_delta_ac_relative","Δ{%}%"],["ibcssymbol_delta_generic_relative","Δ({%})%"],["SUM_TOTAL","❖"]]);return new Map([...i,...t])}createElementPosition(t){let i;const s=v(t.filter(((t,i)=>1===i||2===i)).map((t=>m.translateScenarioLabel(t,this.i18n))).reduce(((t,i)=>t.length<i.length?i:t),""),{font:this.styles.fontStyles.font,fontSize:this.styles.fontStyles.size+"px"}).width,h=this.calculateTitleLength(this.leftSideOffsetForHorizontalSync);let e,n;if(i=s>h?s:h,null!=this.position&&(i+=this.position.spacings.labelToColumn),this.leftSideOffsetForHorizontalSync>-1&&(i=this.leftSideOffsetForHorizontalSync),this.isVarianceChart()?(e=this.smallestVarianceDataPointValue,n=this.highestVarianceDataPointValue):(e=this.smallestDataPointValue,n=this.highestDataPointValue),this.overflowConfig){const{cutHeight:t,overdriveZoneHeight:i,breakGap:s}=this.overflowConfig;n=new ot(t+i+s,n.scenario,1,n.variance)}let r=this.styles.scaleFactors;const o=this.determineEffectiveChartMode();if(this.lineFullWidth&&this.availableWidth>0&&this.dataModel.length>0&&!this.isVarianceChart()&&o===d.LINE){const t=this.styles.fontStyles.size,s=this.styles.padding,h=this.styles.scaleFactors,e=this.availableWidth-(s.left+s.right+t*h.scenarioOffset+i+t*h.columnWidth);if(e>0){const i=Math.max(e/this.dataModel.length/t,1.2*h.columnWidth),s=new it;Object.assign(s,h),s.categoryWidth=i,r=s}}return new ht(new et(this.styles.padding),r,this.styles.fontStyles,e,n,this.dataModel.length,i)}calculateTitleLength(t){let i="_______";i.length<this.title.length&&(i=this.title);const s=v(i,{font:this.styles.fontStyles.font,fontSize:this.styles.fontStyles.size+"px"}).width;return s<t?t:s}scenarioStyles(){const t=g(this.styles.barStyles,this.ruleSet);return t===this.styles.barStyles?this.styles:Object.assign(Object.create(Object.getPrototypeOf(this.styles)),this.styles,{barStyles:t})}setAxisScenario(t){let i=dt.AC1;if(null!=t&&t.length>0){const s=new y(t.toString());s.isValid&&(i=S(this.ruleSet.getScenarioColorIndex(s.delta))+s.delta.slice(2))}return null===i&&(i=dt.AC1),i}populateModel(t,i){if(0===this.rowCount||!this.fromExpr)return[];let s=this.queryDataSet(i,"","");return this.detectNaNCells(t,s),s=this.leftOuterJoinDates(s,i),this.createDataRows(s,t)}detectNaNCells(t,i){i.forEach((i=>(t.forEach((t=>{const s=new y(t);!0===s.isValid?0!==i[s.base+"_cnt"]&&0!==i[s.delta+"_cnt"]||(i[t]=Number.NaN):0===i[t+"_cnt"]&&(i[t]=Number.NaN)})),i)))}findDateInterval(t){if(t!==F.AUTO)return t;const i=this.queryDates();if(0===i.length)return F.DAY;let s=i[0],h=i[0];for(const t of i)t<s&&(s=t),t>h&&(h=t);return(new V).calculateDistanceType(s,h,this.intervalSpanLimit)}queryDates(){if(0===this.rowCount)return[];let t;try{t=this.db.exec(`SELECT DISTINCT [date] FROM ${this.fromExpr}`)}catch(t){return this.failQuery(t),[]}return t.map((t=>Tt.coerceDateTime(t.date))).filter((t=>null!=t))}static coerceDateTime(t){if(null!=t){if("string"==typeof t){const i=N.fromISO(t,{zone:"utc"});return i.isValid?i:void 0}if("number"==typeof t){const i=N.fromMillis(t,{zone:"utc"});return i.isValid?i:void 0}return"boolean"==typeof t.isValid?t:void 0}}queryDataSet(t,i,s){const h=["ac1","ac2","ac3","ac4","pp1","pp2","pp3","pp4","fc1","fc2","fc3","fc4","pl1","pl2","pl3","pl4"],e=`normalizeDate([date], '${t}' , '${this.locale}') as calcdate`;let n;try{n=this.db.exec(`SELECT p.calcdate ${i},\n ${h.map((t=>`SUM(${t} * transformOperator(operation)) as ${t}, COUNT(ISNULL(${t})) as ${t}_cnt`)).join(",")}\n\n FROM (SELECT ${e} ${i},\n ac1,\n ac2,\n ac3,\n ac4,\n pp1,\n pp2,\n pp3,\n pp4,\n fc1,\n fc2,\n fc3,\n fc4,\n pl1,\n pl2,\n pl3,\n pl4\n FROM ${this.fromExpr}) as p\n GROUP BY calcdate ${s}\n ORDER BY calcdate asc`)}catch(t){return this.failQuery(t),[]}return n}createDataRows(t,i){var s;const h=[];t.forEach(((t,s)=>{h.push({id:s,category:t.category,type:At.NONE,date:t.calcdate,scenario1:new ot(t[i[0]],i[0],this.pixelPerUnit,dt.NEU),scenario2:new ot(t[i[1]],i[1],this.pixelPerUnit,dt.NEU),scenario3:new ot(t[i[2]],i[2],this.pixelPerUnit,dt.NEU),scenario4:new ot(t[i[3]],i[3],this.pixelPerUnit,dt.NEU)})}));for(const t of h)for(const i of[t.scenario1,t.scenario2,t.scenario3,t.scenario4])null==i.value||Number.isNaN(i.value)||(i.key={date:Tt.pointDate(t.date),scenario:null!==(s=i.scenario)&&void 0!==s?s:void 0});return h}static pointDate(t){var i;return A(null===(i=null==t?void 0:t.toISO)||void 0===i?void 0:i.call(t))}findSmallestDataPointValue(t){const i=this.isVarianceChart()?this.pixelPerPercentage:this.pixelPerUnit;let s=new ot(0,"default",i,dt.NEU);for(const i of t)for(const t of[i.scenario1,i.scenario2,i.scenario3,i.scenario4])t&&null!=t.value&&t.value<Number(s.value)&&(s=t);return s}findHighestDataPointValue(t){const i=this.isVarianceChart()?this.pixelPerPercentage:this.pixelPerUnit;let s=new ot(0,"default",i,dt.NEU);for(const i of t)for(const t of[i.scenario1,i.scenario2,i.scenario3,i.scenario4])null!=t&&t.value>Number(s.value)&&(s=t);return s}populateVarianceModel(t,i){const s=[];if(null==t||0===t.length)return s;let h=null;null!=i&&i.length>0&&(h=i[0]),this.varianceOverlaps=0;const e=t.map((t=>new y(t)));if(this.scenarioSwitch&&e.filter((t=>t.isValid)).length>1)return this.populateSharedVarianceRow(t,e,i,h);for(const e in t){const n=new y(t[e]);if(n.isValid){const r=this.mapScenarios(n,h),o=n.direction,l="dr"===n.type?this.pixelPerPercentage:this.pixelPerUnit;for(const h in i){const a=new ot(this.calculateVariance(n,i[h],r),n.delta,l,o);null===a.value||Number.isNaN(a.value)||(a.key={date:Tt.pointDate(i[h].date),scenario:t[e]}),s.push({id:Number(h),category:i[h].category,type:"dr"===n.type?At.RELATIVE:At.ABSOLUTE,date:i[h].date,scenario1:a,scenario2:new ot(null,null,null,null),scenario3:new ot(null,null,null,null),scenario4:new ot(null,null,null,null)})}}}return s}populateSharedVarianceRow(t,i,s,h){const e=[],n=i.map(((i,s)=>({variance:i,name:t[s]}))).filter((t=>t.variance.isValid)),r="dr"===n[0].variance.type,o=r?this.pixelPerPercentage:this.pixelPerUnit;return s.forEach(((t,i)=>{let s=null,l=0;for(const{variance:i,name:e}of n){const n=this.calculateVariance(i,t,this.mapScenarios(i,h));null===n||Number.isNaN(n)||(l++,null==s&&(s=new ot(n,i.delta,o,i.direction),s.notation=i.base.slice(0,2),s.key={date:Tt.pointDate(t.date),scenario:e}))}l>1&&this.varianceOverlaps++,e.push({id:i,category:t.category,type:r?At.RELATIVE:At.ABSOLUTE,date:t.date,scenario1:null!=s?s:new ot(null,n[0].variance.delta,o,n[0].variance.direction),scenario2:new ot(null,null,null,null),scenario3:new ot(null,null,null,null),scenario4:new ot(null,null,null,null)})})),e}calculateVariance(t,i,s){const h=s.get(t.base),e=s.get(t.delta);return null==h||null==e||null==i[h].value||null==i[e].value?null:t.type===At.RELATIVE?D(i[h].value-i[e].value,i[e].value):i[h].value-i[e].value}mapScenarios(t,i){const s=new Map;return null==i||["scenario1","scenario2","scenario3","scenario4"].forEach((h=>{i[h].scenario===t.delta?s.set(t.delta,h):i[h].scenario===t.base&&s.set(t.base,h)})),s}cleanSVGforRedraw(t){t.clear()}isVarianceChart(){return this.variancesDataModel&&this.variancesDataModel.length>0}createDateFactory(){const t=new V;t.setLocale(this.locale);const i=this.i18n.get("date-format-short-year");return"string"==typeof i&&/y/.test(i)&&!i.includes("date-format")&&t.patchDateFormatShort({year:i}),t}dateLabelPlace(t){let i=t.scenario1.value<0,s=this.position.spacings.labelToAxis;if(null!=this.stackConfig&&!this.isVarianceChart()){const h=this.stackConfig.mode!==c.RELATIVE&&this.determineEffectiveChartMode()!==d.LINE?(this.position.spacings.labelToColumn+this.position.dataLabelHeight)/this.pixelPerUnit:0,e=this.stackGroups(t).filter((t=>t.hasValue)).map((t=>t.layout));let n=z(e,(()=>h));n.flipped&&h>0&&e.some((t=>t.total>=0))&&(n={flipped:!1,clearance:Math.max(...e.map((t=>t.negative+(t.total<0?h:0))))}),i=n.flipped,s+=n.clearance*this.pixelPerUnit}return i?{hookLocation:L.Bottom,offset:-s}:{hookLocation:L.Top,offset:s}}drawAxisAndLabels(t,i){const s=this.createDateFactory(),h=i.group().id("AxisAndDateLables");let e=!1;if(!1===this.hideAxisLabels)t.forEach(((t,i)=>{const{hookLocation:n,offset:r}=this.dateLabelPlace(t);t.type===At.RELATIVE&&(e=!0);const o=this.axisLabelsMode===u.SMART&&s.isSmartBoundary(t.date,this.dateInterval);if(i%this.axisLabelsStep!=0&&!o)return;let l=s.getDateString(t.date,this.dateInterval);this.axisLabelsMode===u.SMART?(l=s.getSmartDateString(t.date,this.dateInterval),0===i&&this.dateInterval!==F.YEAR&&(l=s.getShortDateString(t.date,this.dateInterval))):this.axisLabelsMode===u.SHORT&&(l=s.getShortDateString(t.date,this.dateInterval)),new P(h,this.position.getColumnCenterPositionX(i),this.position.getAxisPositionY(e)+r,"",l,this.styles,n,L.Center).forceStringTypeDraw()}));else{const i=null==t?void 0:t[0];i&&i.type===At.RELATIVE&&(e=!0)}new pt({scenarioType:this.axisScenario,labelText:this.title,isRelative:e,titlePosition:this.axisTitlePosition},this.position,h).draw();const n=h.bbox();this.axisCategoryArea={height:n.height,width:n.width},this.drawScenarioSwitch(i)}drawScenarioSwitch(t){const i=this.switchRuns();if(i.length<2)return;const s=t.group().id("ScenarioSwitch"),h=this.switchNamesHeight(),e=this.getAllocatedCanvasHeight(),n=h>0?e-this.styles.padding.bottom:e,r=Math.max(1,this.position.spacings.auxiliaryLineWidth);i.slice(1).forEach((t=>{const i=(this.position.getColumnCenterPositionX(t.from-1)+this.position.getColumnCenterPositionX(t.from))/2;s.line(i,0,i,n).stroke({color:this.styles.fontStyles.color||"#000000",width:r}).addClass("scenario-switch")})),0!==h&&i.forEach((t=>{const i=(this.position.getColumnCenterPositionX(t.from)+this.position.getColumnCenterPositionX(t.to))/2;new P(s,i,n-h,"SWITCH_"+t.scenario,m.translateScenarioLabel(t.scenario,this.i18n),this.styles,L.Top,L.Center).forceStringTypeDraw()}))}drawScenarios(t,i){const s=i.group().id("Scenarios"),h=new xt(this.position,s,this.scenarioStyles(),t.length,this.i18n);h.setOverflowConfig(this.overflowConfig);let e=!1;const n=this.followerSlots();t.forEach(((t,i)=>{const s=n.length>0?this.visibleSlot(t,n):"scenario1";null!=s&&"scenario1"!==s?(h.createPrimaryBar(t[s],i,!1).draw(this.dataFormatDigits,this.measureScale),e=!0):h.createPrimaryBar(t.scenario1,i).draw(this.dataFormatDigits,this.measureScale),"scenario2"!==s&&h.createSecondaryBar(t.scenario2,i).draw(),"scenario3"!==s&&h.createPrimaryMarker(t.scenario3,i).draw(),"scenario4"!==s&&h.createSecondaryMarker(t.scenario4,i).draw(),!1===t.scenario1.isEmpty()&&(e=!0)}));let r=0;!1===e&&(r=this.isOnSameAxisSide()?this.position.dataLabelHeight:2*this.position.dataLabelHeight);const o=s.bbox();this.scenariosArea={height:o.height+this.styles.padding.top+this.styles.padding.bottom+r,width:o.width+this.position.spacings.columnWidth}}drawLineScenarios(t,i){var s,h;const e=i.group().id("LineScenarios"),n=new x,r=new xt(this.position,e,this.scenarioStyles(),t.length,this.i18n);r.setCollisionManager(n);const o=["ac1","pp1","fc1","pl1"],l=[[],[],[],[]];t.forEach(((t,i)=>{["scenario1","scenario2","scenario3","scenario4"].forEach(((s,h)=>{t[s]&&l[h].push({dataPoint:t[s],index:i})}))}));const a=[];for(let t=0;t<l.length;t++){const i=l[t];if(i.length>0&&i.some((t=>!t.dataPoint.isEmpty()))){const e=(null===(h=null===(s=i[0])||void 0===s?void 0:s.dataPoint)||void 0===h?void 0:h.scenario)||o[t],n=e.slice(0,2).toLowerCase();a.push({points:i,scenarioName:e,scenarioType:n})}}a.sort(((t,i)=>(C[i.scenarioType]||99)-(C[t.scenarioType]||99)));const c=[];for(const t of a){const i=r.createLineSeries(t.points,t.scenarioName,S(this.ruleSet.getScenarioColorIndex(t.scenarioName)));c.push({series:i,scenarioType:t.scenarioType})}for(const t of c)t.series.drawGeometry();r.moveLabelsToFront();const u=[...c].sort(((t,i)=>(C[t.scenarioType]||99)-(C[i.scenarioType]||99)));for(const t of u)t.series.drawLabels(this.dataFormatDigits,this.measureScale);const d=this.position.getColumnPositionY(),f=e.bbox();this.scenariosArea={height:Math.max(f.height+this.styles.padding.top,d)+this.styles.padding.bottom,width:f.width+this.position.spacings.columnWidth}}drawAxisAndLabelsForLineChart(t,i){const s=this.createDateFactory(),h=i.group().id("AxisAndDateLabelsLine"),e=!1,n=t.length-1;!1===this.hideAxisLabels&&t.forEach(((i,r)=>{if(!this.shouldShowLineChartAxisLabel(t,r))return;const{hookLocation:o,offset:l}=this.dateLabelPlace(i);let a;this.lineFullWidth&&this.availableWidth>0?this.axisLabelsMode===u.SMART?(a=s.getSmartDateString(i.date,this.dateInterval),0===r&&this.dateInterval!==F.YEAR&&(a=s.getShortDateString(i.date,this.dateInterval))):a=this.axisLabelsMode===u.SHORT?s.getShortDateString(i.date,this.dateInterval):s.getDateString(i.date,this.dateInterval):a=s.getShortDateString(i.date,this.dateInterval),new P(h,this.position.getColumnCenterPositionX(r),this.position.getAxisPositionY(e)+l,"",a,this.styles,o,L.Center).forceStringTypeDraw(),r>0&&r<n&&this.isYearChange(t,r)&&this.drawYearSeparatorLine(h,r,e)})),new pt({scenarioType:this.axisScenario,labelText:this.title,isRelative:e},this.position,h).draw();const r=h.bbox();this.axisCategoryArea={height:r.height,width:r.width}}shouldShowLineChartAxisLabel(t,i){return!!(this.lineFullWidth&&this.availableWidth>0)||(0===i||i===t.length-1||this.isYearChange(t,i))}isYearChange(t,i){var s,h;if(0===i)return!1;const e=null===(s=t[i])||void 0===s?void 0:s.date,n=null===(h=t[i-1])||void 0===h?void 0:h.date;return!(!e||!n)&&(this.dateInterval===F.WEEK?e.weekYear!==n.weekYear:e.year!==n.year)}drawYearSeparatorLine(t,i,s){const h=this.position.getColumnCenterPositionX(i)-this.position.spacings.columnWidth/2,e=this.position.columnValue.max.getScaledUnit()+this.position.dataLabelHeight,n=this.position.getAxisPositionY(s)-e,r=this.position.getAxisPositionY(s);t.line([[h,n],[h,r]]).stroke({color:"#999999",width:1,dasharray:"4,4"}).attr("stroke-dasharray","4,4")}drawVarianceScenario(t,i){const s=i.group().id("Scenarios"),h=new xt(this.position,s,this.scenarioStyles(),t.length,this.i18n);h.setOverflowConfig(this.overflowConfig),t.forEach(((t,i)=>{t.type===At.RELATIVE?h.createRelativeVarianceBar(t.scenario1,i).draw(this.dataFormatDigits):h.createVarianceBar(t.scenario1,i).draw(this.dataFormatDigits,this.measureScale)}));const e=s.bbox();return this.scenariosArea={height:e.height+this.styles.padding.top+this.styles.padding.bottom,width:e.width+this.position.spacings.columnWidth},s}sortSegmentsByPropOrder(t){if(0===this.scenarioPropOrder.length)return;const i=this.scenarioPropOrder;t.sort(((t,s)=>{const h=i.indexOf(t.scenario),e=i.indexOf(s.scenario);return(-1===h?i.length:h)-(-1===e?i.length:e)}))}stackGroups(t){if(!this.stackConfig)return[];const i=this.stackConfig.by===f.SCENARIOS,s=this.determineEffectiveChartMode()===d.LINE,h=[];for(const e of i||s?["scenario1","scenario2","scenario3","scenario4"]:["scenario1"]){const i=t[e];i&&!i.isEmpty()&&null!=i.value&&h.push({value:i.value,scenario:i.scenario,dataPoint:i})}if(0===h.length)return[];const e=this.stackConfig.mode===c.RELATIVE?p:0,n=(t,i)=>({prefix:t,segments:i,layout:I(i.map((t=>t.value)),e),hasValue:i.some((t=>Number.isFinite(t.value)))});if(i&&this.sortSegmentsByPropOrder(h),s)return[n("",h)];if(i){const t=new Map;for(const i of h){const s=H(i.scenario);t.has(s)||t.set(s,[]),t.get(s).push(i)}if(t.size>1){const i=[];for(const s of B)t.has(s)&&(i.push(n(s,t.get(s))),t.delete(s));for(const[s,h]of t)i.push(n(s,h));return i}}const r=t=>Number.isFinite(t.value)?t.value:0;return"asc"===this.stackConfig.order?h.sort(((t,i)=>r(t)-r(i))):"desc"===this.stackConfig.order&&h.sort(((t,i)=>r(i)-r(t))),[n("",h)]}drawStackedScenarios(t,i){if(!this.stackConfig)return;const s=i.group().id("StackedScenarios"),h=this.stackConfig.by===f.SCENARIOS;t.forEach(((t,i)=>{const e=this.stackGroups(t);e.forEach(((n,r)=>{let o=null;n.segments.forEach(((t,l)=>{const a=new yt(this.position,this.styles,t.dataPoint,i,n.layout.segments[l],t.scenario,e.length>1?e.length-1-r:l,this.stackConfig.mode,n.layout,h,s);a.draw(this.dataFormatDigits,this.measureScale),o=a})),o&&n.hasValue&&o.drawTotalLabel(this.dataFormatDigits,this.measureScale,{date:Tt.pointDate(t.date),scenario:e.length>1?n.prefix:void 0})}))}));const e=s.bbox();this.scenariosArea={height:e.height+this.styles.padding.top+this.styles.padding.bottom,width:e.width+this.position.spacings.columnWidth}}drawStackedHeaders(t,i){if(!this.stackConfig||0===t.length)return;if(this.stackConfig.by!==f.SCENARIOS)return;const s=i.group().id("StackedHeaders"),h=this.stackGroups(t[0]);if(0===h.length)return;const e=this.position.getColumnPositionY(),n=this.position.getColumnCenterPositionX(0)-this.position.getColumnWidth()/2-this.position.spacings.labelToColumn,r=(t,i)=>{new P(s,n,t,"STACK_HEADER",i,this.styles,L.Center,L.Right).forceStringTypeDraw()};if(h.length>1)return void h.forEach(((t,i)=>{const{positive:s,negative:n,total:o}=t.layout;r(e-(i===h.length-1?(s-n)/2:o<0?0-n:s)*t.segments[0].dataPoint.pixelPerUnit,this.i18n.get(t.prefix+"1")||t.prefix.toUpperCase())}));const[o]=h;o.segments.forEach(((t,i)=>{const{start:s,end:h}=o.layout.segments[i];r(e-(s+h)/2*t.dataPoint.pixelPerUnit,this.i18n.get(t.scenario)||t.scenario)}))}drawStackedAreaScenarios(t,i){if(!this.stackConfig)return;const s=i.group().id("StackedAreaScenarios"),h=this.stackConfig.by===f.SCENARIOS,e=this.stackConfig.mode,n=["scenario1","scenario2","scenario3","scenario4"];if(0===(h?n.filter((i=>t.some((t=>t[i]&&!t[i].isEmpty())))).length:1))return;const r=[],o=[];for(const i of n)t.some((t=>t[i]&&!t[i].isEmpty()))&&o.push(i);if(h&&this.scenarioPropOrder.length>0){const i=this.scenarioPropOrder;o.sort(((s,h)=>{var e,n,r,o;const l=i.indexOf(null!==(n=null===(e=t[0][s])||void 0===e?void 0:e.scenario)&&void 0!==n?n:""),a=i.indexOf(null!==(o=null===(r=t[0][h])||void 0===r?void 0:r.scenario)&&void 0!==o?o:"");return(-1===l?i.length:l)-(-1===a?i.length:a)}))}for(const i of o){const s=t[0][i];r.push((null==s?void 0:s.scenario)||"ac1")}const l=(t,i)=>{const s=t[i];return s&&!s.isEmpty()&&Number.isFinite(s.value)?s.value:0},a=o.map((i=>t.reduce(((t,s)=>t+l(s,i)),0)<0?-0:0)),u=e===c.RELATIVE?p:0,d=t.map((t=>I(o.map(((i,s)=>l(t,i)||a[s])),u))),v=this.position.getColumnPositionY(),w=this.pixelPerUnit,m=(t,i)=>d.map(((s,h)=>({x:this.position.getColumnCenterPositionX(h),y:v-s.segments[t][i]*w})));for(let t=0;t<o.length;t++){const i=m(t,"end"),e=m(t,"start"),n=h?S(this.ruleSet.getScenarioColorIndex(r[t])):null,o=new Lt(s,i,e,n,t,h);o.draw(),o.drawBoundaryLine()}const b=s.bbox();this.scenariosArea={height:b.height+this.styles.padding.top+this.styles.padding.bottom,width:b.width+this.position.spacings.columnWidth}}drawOverlayLayer(t,i){if(0===t.length)return;const s=i.group().id("Overlay"),h=new xt(this.position,s,this.scenarioStyles(),t.length,this.i18n);if(!0===this.showOverlayAvg){let i=null;const s=function(t){const i=$t(t),s=i.length>0?i.reduce(((t,i)=>t+i),0)/i.length:NaN,h=Object.assign(Object.assign({},t[0]),{scenario1:new ot(s,t[0].scenario1.scenario,t[0].scenario1.pixelPerUnit,t[0].scenario1.variance)}),e=Object.assign(Object.assign({},t[t.length-1]),{scenario1:new ot(s,t[t.length-1].scenario1.scenario,t[t.length-1].scenario1.pixelPerUnit,t[t.length-1].scenario1.variance)});return[h,...t.map((t=>Object.assign(Object.assign({},t),{scenario1:new ot(s,t.scenario1.scenario,t.scenario1.pixelPerUnit,t.scenario1.variance)}))),e]}(t);s.forEach(((t,s)=>{null!=i&&h.createLine(`Ø ${this.i18n.get(t.scenario1.scenario)||t.scenario1.scenario}`,t.scenario1,i,s-1).draw(this.dataFormatDigits,this.measureScale),i=t.scenario1}))}if(!0===this.showOverlayMedian){let i=null;const s=function(t){const i=$t(t).sort(((t,i)=>t-i)),s=i.length%2==0?(i[i.length/2-1]+i[i.length/2])/2:i[Math.floor(i.length/2)],h=Object.assign(Object.assign({},t[0]),{scenario1:new ot(s,t[0].scenario1.scenario,t[0].scenario1.pixelPerUnit,t[0].scenario1.variance)}),e=Object.assign(Object.assign({},t[t.length-1]),{scenario1:new ot(s,t[t.length-1].scenario1.scenario,t[t.length-1].scenario1.pixelPerUnit,t[t.length-1].scenario1.variance)});return[h,...t.map((t=>Object.assign(Object.assign({},t),{scenario1:new ot(s,t.scenario1.scenario,t.scenario1.pixelPerUnit,t.scenario1.variance)}))),e]}(t);s.forEach(((t,s)=>{null!=i&&h.createLine(`Mdn ${this.i18n.get(t.scenario1.scenario)||t.scenario1.scenario}`,t.scenario1,i,s-1).draw(this.dataFormatDigits,this.measureScale),i=t.scenario1}))}}leftOuterJoinDates(t,i){const s=t.map((t=>t.calcdate)).filter((t=>null!=t&&"boolean"==typeof t.isValid&&t.isValid));if(0===s.length)return t;const h=N.max(...s),e=N.min(...s),n=new V;if(n.countBetween(e,h,i)>1e4)return t;const r=n.datesBetween(e,h,i),o=new Map;return r.forEach(((t,i)=>{o.set(t.toISO(),{id:i,calcdate:t,category:null,ac1:null,ac2:null,ac3:null,ac4:null,pp1:null,pp2:null,pp3:null,pp4:null,fc1:null,fc2:null,fc3:null,fc4:null,pl1:null,pl2:null,pl3:null,pl4:null,isEmpty:!0})})),t.forEach((t=>{const i=t.calcdate.toISO(),s=o.get(i);s&&s.isEmpty&&o.set(i,{id:s.id,calcdate:t.calcdate,category:t.category,ac1:t.ac1,ac2:t.ac2,ac3:t.ac3,ac4:t.ac4,pp1:t.pp1,pp2:t.pp2,pp3:t.pp3,pp4:t.pp4,fc1:t.fc1,fc2:t.fc2,fc3:t.fc3,fc4:t.fc4,pl1:t.pl1,pl2:t.pl2,pl3:t.pl3,pl4:t.pl4,isEmpty:!1})})),Array.from(o.values())}}function $t(t){return t.map((t=>{var i;return null===(i=t.scenario1)||void 0===i?void 0:i.value})).filter((t=>Number.isFinite(t)))}class Dt{constructor(t,i){this.data=t,this.scenarios=i,this.variances=[],this.title="",this.hideAxisLabels=!1,this.pixelPerUnit=10,this.pixelPerPercentage=50,this.leftSideOffsetForHorizontalSync=-1,this.dateInterval=F.AUTO,this.axisLabelsMode=u.SMART,this.intervalSpanLimit=28,this.filter="",this.measureScale=new M,this.measureUnit="",this.showMeasureScale=!0,this.dataFormatDigits={decimal:1,percent:2},this.showOverlayMedian=!0,this.showOverlayAvg=!0,this.chartMode=d.BAR,this.maxBars=28,this.stackConfig=null,this.lineFullWidth=!0,this.axisLabelsStep=1,this.scenarioSwitch=!1,this.axisTitlePosition="left",this.locale="de"}}class Nt{constructor(t,i,s,h,e,n){this.dataRowAdapter=t,this.stringAdapter=i,this.dataFormatDigitsAdapter=s,this.db=h,this.fromExpr=e,this.onQueryError=n}adapt(t){const i=Z.adaptArray(t.data,this.dataRowAdapter),s=Z.adaptArray(t.scenarios,this.stringAdapter),h=new Dt(i,s);return a.isArray(t.variances)&&(h.variances=Z.adaptArray(t.variances,this.stringAdapter)),a.isString(t.title)&&(h.title=t.title),a.isBoolean(t.hideAxisLabels)&&(h.hideAxisLabels=t.hideAxisLabels),a.isNumber(t.pixelPerUnit)&&(h.pixelPerUnit=t.pixelPerUnit),a.isNumber(t.pixelPerPercentage)&&(h.pixelPerPercentage=t.pixelPerPercentage),a.isExisting(t.dateInterval)&&(h.dateInterval=t.dateInterval),a.isExisting(t.axisLabelsMode)&&(h.axisLabelsMode=t.axisLabelsMode),a.isNumber(t.leftSideOffsetForHorizontalSync)&&(h.leftSideOffsetForHorizontalSync=t.leftSideOffsetForHorizontalSync),a.isNumber(t.intervalSpanLimit)&&(h.intervalSpanLimit=t.intervalSpanLimit),a.isString(t.filter)&&(h.filter=t.filter),a.isExisting(t.measureScale)&&(h.measureScale=K.calculateMeasureScale(this.db,this.fromExpr,h.scenarios,t.measureScale,this.onQueryError)),a.isString(t.measureUnit)&&(h.measureUnit=t.measureUnit),a.isBoolean(t.showMeasureScale)&&(h.showMeasureScale=t.showMeasureScale),a.isExisting(t.dataFormatDigits)&&(h.dataFormatDigits=this.dataFormatDigitsAdapter.adapt(t.dataFormatDigits)),a.isBoolean(t.showOverlayAvg)&&(h.showOverlayAvg=t.showOverlayAvg),a.isBoolean(t.showOverlayMedian)&&(h.showOverlayMedian=t.showOverlayMedian),a.isExisting(t.chartMode)&&(h.chartMode=t.chartMode),a.isNumber(t.maxBars)&&(h.maxBars=t.maxBars),a.isExisting(t.stackConfig)&&(h.stackConfig=t.stackConfig),a.isBoolean(t.lineFullWidth)&&(h.lineFullWidth=t.lineFullWidth),a.isNumber(t.axisLabelsStep)&&t.axisLabelsStep>=1&&(h.axisLabelsStep=t.axisLabelsStep),a.isBoolean(t.scenarioSwitch)&&(h.scenarioSwitch=t.scenarioSwitch),a.isString(t.axisTitlePosition)&&(h.axisTitlePosition=t.axisTitlePosition),a.isString(t.locale)&&(h.locale=t.locale),h}default(){return new Dt([],[])}}const _t=t(class extends i{disconnectedCallback(){var t;this.overlapErrId&&(null===(t=this.errors)||void 0===t||t.remove(this.overlapErrId),this.overlapErrId=void 0)}constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.tableName="",this.dataVersion=0,this.scenarios=[],this.variances=[],this.hideAxisLabels=!1,this.pixelPerUnit=2,this.pixelPerPercentage=50,this.leftSideOffsetForHorizontalSync=-1,this.i18n=new Map,this.dateInterval=F.AUTO,this.intervalSpanLimit=28,this.axisLabelsMode=u.SMART,this.filter="",this.measureScale="_",this.measureUnit="",this.showMeasureScale=!0,this.showOverlayMedian=!1,this.showOverlayAvg=!1,this.chartMode=d.BAR,this.maxBars=28,this.stackConfig=null,this.lineFullWidth=!0,this.containerWidth=0,this.dataFormatDigits={percent:2,decimal:1},this.axisLabelsStep=1,this.scenarioSwitch=!1,this.axisTitlePosition="left",this.parentDimensions={width:0,height:0},_(this)}getDb(){return this.stores||(this.stores=Y(this.element)),this.stores.db.db}render(){var t,i,e,n;if(void 0===this.chart||void 0!==this.queryError)return s(h,null);if(this.chart.hasNoData()){const i=null!==(t=this.i18n.get("no-data"))&&void 0!==t?t:"No Data";return s(h,{class:"no-data"},s("div",{class:"empty-state"},i))}return s(h,null,s("div",{innerHTML:null===(i=this.pattern)||void 0===i?void 0:i.toString(),class:"hidePatternContainer",style:{width:"0",height:"0",overflow:"hidden"}}),s("div",{class:this.showMeasureScale?"footer":"footer-hide"},null===(e=this.chart)||void 0===e?void 0:e.getFooter()),s("div",{innerHTML:null===(n=this.chart)||void 0===n?void 0:n.toString()}))}syncQueryError(){var t,i,s,h,e,n,r;this.queryError=null!==(t=this.measureScaleError)&&void 0!==t?t:null===(i=this.chart)||void 0===i?void 0:i.getQueryError(),R(this.errors,this.queryError);const o=`WARN_variances_overlap_${this.variances.join("_")}`,l=null!==(h=null===(s=this.chart)||void 0===s?void 0:s.getVarianceOverlaps())&&void 0!==h?h:0;this.overlapErrId&&this.overlapErrId!==o&&(null===(e=this.errors)||void 0===e||e.remove(this.overlapErrId)),this.overlapErrId=l>0?o:void 0,l>0?null===(n=this.errors)||void 0===n||n.addOrReplace({id:o,type:"warning",message:`scenarioSwitch: the variances ${this.variances.join(", ")} share a row, but ${l} period(s) have more than one value. The first variance wins there.`}):null===(r=this.errors)||void 0===r||r.remove(o)}async componentWillLoad(){var t,i;const s=this.prepareConfig(),h=this.prepareStyle(),e=this.containerWidth||0;this.chart=new Tt(new b(this.ruleSetConfig),this.getDb(),this.tableName,s,h,e),this.chart.setI18n(this.i18n);const n=s.pixelPerUnit<=0,r=s.pixelPerPercentage<=0;this.autoFitScaling(s,h),this.chart.setAvailableHeight(n?0:(null===(t=this.parentDimensions)||void 0===t?void 0:t.height)||0),r||this.chart.fitRelativeVariances((null===(i=this.parentDimensions)||void 0===i?void 0:i.height)||0),this.pattern=new rt(this.chart.styles),this.chart.setPattern("hatched",this.pattern.getFCPolygonPattern()),this.syncQueryError()}async componentWillUpdate(){var t,i;if(null==this.chart)return;const s=this.prepareConfig(),h=this.prepareStyle();this.chart.setI18n(this.i18n),this.chart.setStyles(h),this.chart.setAvailableWidth(this.containerWidth||0),this.chart.setRuleSet(new b(this.ruleSetConfig)),this.chart.setConfig(s);const e=s.pixelPerUnit<=0,n=s.pixelPerPercentage<=0;this.autoFitScaling(s,h),this.chart.setAvailableHeight(e?0:(null===(t=this.parentDimensions)||void 0===t?void 0:t.height)||0),n||this.chart.fitRelativeVariances((null===(i=this.parentDimensions)||void 0===i?void 0:i.height)||0),this.pattern=new rt(this.chart.styles),this.chart.setPattern("hatched",this.pattern.getFCPolygonPattern()),this.syncQueryError()}autoFitScaling(t,i){var s;const h=t.pixelPerUnit<=0,e=t.pixelPerPercentage<=0;if(!h&&!e)return;const n=()=>{var i;null===(i=this.reportAutoScaling)||void 0===i||i.call(this,{unit:h?t.pixelPerUnit:void 0,percentage:e?t.pixelPerPercentage:void 0})},r=null===(s=this.parentDimensions)||void 0===s?void 0:s.height,o=this.containerWidth||0,l=()=>{this.chart=new Tt(new b(this.ruleSetConfig),this.getDb(),this.tableName,t,i,o),this.chart.setI18n(this.i18n)},a=()=>(this.chart.layout(),this.chart.getAllocatedCanvasHeight());if(!r||r<=0)return h&&(t.pixelPerUnit=1),e&&(t.pixelPerPercentage=50),l(),void n();h&&(t.pixelPerUnit=1),e&&(t.pixelPerPercentage=1),l();let c=a();if(c<=0)return void n();const u=Math.max(q,.9*r/c);let d=!1,f=!1,p=null;for(let i=0;i<=3;i++){const i=U({target:r,measured:c,unitExtent:h?this.chart.getUnitBarExtent():0,pctExtent:e?this.chart.getPercentBarExtent():0,currentPpu:t.pixelPerUnit,currentPpp:t.pixelPerPercentage});if(void 0===i.ppu&&void 0===i.ppp)break;if(h&&void 0!==i.ppu&&(t.pixelPerUnit=i.ppu,d=!0),e&&void 0!==i.ppp&&(t.pixelPerPercentage=i.ppp,f=!0),l(),c=a(),c<=r+.5&&(p={ppu:t.pixelPerUnit,ppp:t.pixelPerPercentage},c>=.98*r))break}let v=!1;if(h&&!d&&(t.pixelPerUnit=u,v=!0),e&&!f&&(t.pixelPerPercentage=u,v=!0),c>r+.5){if(p)d&&(t.pixelPerUnit=p.ppu),f&&(t.pixelPerPercentage=p.ppp);else{const i=r/c;h&&(t.pixelPerUnit=Math.max(q,t.pixelPerUnit*i)),e&&(t.pixelPerPercentage=Math.max(q,t.pixelPerPercentage*i))}v=!0}v&&l(),n()}async componentWillRender(){}componentDidLoad(){}componentDidUpdate(){}prepareConfig(){var t,i,s;const h=this.getDb(),e=E(h,this.tableName,this.filter);return this.measureScaleError=void 0,new Nt(new at,new J,new Q,h,e,(t=>{this.measureScaleError=j(t)})).adapt({scenarios:this.scenarios,variances:this.variances,title:this.chartTitle,hideAxisLabels:this.hideAxisLabels,pixelPerUnit:this.pixelPerUnit,pixelPerPercentage:this.pixelPerPercentage,dateInterval:this.dateInterval,axisLabelsMode:this.axisLabelsMode,leftSideOffsetForHorizontalSync:this.leftSideOffsetForHorizontalSync,intervalSpanLimit:this.intervalSpanLimit,filter:this.filter,measureScale:this.measureScale,measureUnit:this.measureUnit,showMeasureScale:this.showMeasureScale,dataFormatDigits:this.dataFormatDigits,showOverlayMedian:this.showOverlayMedian,showOverlayAvg:this.showOverlayAvg,chartMode:this.chartMode,maxBars:this.maxBars,stackConfig:this.stackConfig,lineFullWidth:this.lineFullWidth,axisLabelsStep:this.axisLabelsStep,scenarioSwitch:this.scenarioSwitch,axisTitlePosition:this.axisTitlePosition,locale:(null===(s=null===(i=null===(t=this.stores)||void 0===t?void 0:t.context)||void 0===i?void 0:i.state)||void 0===s?void 0:s.locale)||"de"})}prepareStyle(){var t,i;const s=new ut(new st,new r,new o(new T),new tt(new T),new l).adapt(this.styles);return s.locale=(null===(i=null===(t=Y(this.element).context)||void 0===t?void 0:t.state)||void 0===i?void 0:i.locale)||"de",s}get element(){return this}static get style(){return':host(.no-data){display:block;box-sizing:border-box;width:100%;height:100%}:host(.no-data)>div{float:none;width:100%;height:100%}:host(.no-data) .no-data~.no-data{display:none}.empty-state{box-sizing:border-box;display:flex;align-items:center;justify-content:center;float:none;width:100%;height:100%;min-height:3em;margin:0;padding:0.5em;overflow:hidden;border:0.1em dashed #ddd;color:#808080;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);font-style:normal;text-align:center}:host{position:relative;display:inline-block}.categories{text-align:right;font-size:var(--bn-font-size, 1em);font-family:var(--bn-font-family, "Noto Sans", "Helvetica Neue", Helvetica, sans-serif);color:var(--bn-font-color, black)}.label-bg{fill:var(--bn-font-background, white);opacity:0.7}.label-text{text-align:right;font-size:var(--bn-font-size, 1em);font-family:var(--bn-font-family, "Noto Sans", "Helvetica Neue", Helvetica, sans-serif);color:var(--bn-font-color, black)}.axis-title{text-align:center;font-family:var(--bn-font-family, "Noto Sans", "Helvetica Neue", Helvetica, sans-serif);color:var(--bn-font-color, black)}.axis-default{stroke:black;stroke-width:0.1em}.axis-ac{stroke:black;stroke-width:0.1em}.axis-pp{stroke:grey;stroke-width:0.1em}.axis-fc{stroke:black;stroke-dasharray:2;stroke-width:0.1em}.axis-pl{stroke:white;stroke-width:0.1em;outline-offset:0em;outline:0.1em solid black}canvas{image-rendering:-moz-crisp-edges;image-rendering:-webkit-crisp-edges;image-rendering:pixelated;image-rendering:crisp-edges}.measure{font-weight:bold}span{display:inline-block}.hidePatternContainer{height:0;width:0}.hide{opacity:0}.footer{margin:0.2em;font-size:0.6em}.footer-hide{display:none}svg#drawCanvas{display:block}'}},[1,"bn-chart-time-renderer",{tableName:[1,"table-name"],dataVersion:[2,"data-version"],chartTitle:[1,"chart-title"],scenarios:[16],variances:[16],hideAxisLabels:[4,"hide-axis-labels"],pixelPerUnit:[2,"pixel-per-unit"],pixelPerPercentage:[2,"pixel-per-percentage"],reportAutoScaling:[16],errors:[16],leftSideOffsetForHorizontalSync:[2,"left-side-offset-for-horizontal-sync"],styles:[1040],i18n:[1040],dateInterval:[1,"date-interval"],intervalSpanLimit:[2,"interval-span-limit"],axisLabelsMode:[1,"axis-labels-mode"],filter:[1],measureScale:[1,"measure-scale"],measureUnit:[1,"measure-unit"],showMeasureScale:[4,"show-measure-scale"],showOverlayMedian:[4,"show-overlay-median"],showOverlayAvg:[4,"show-overlay-avg"],chartMode:[1,"chart-mode"],maxBars:[2,"max-bars"],stackConfig:[16],lineFullWidth:[4,"line-full-width"],containerWidth:[2,"container-width"],dataFormatDigits:[16],axisLabelsStep:[2,"axis-labels-step"],scenarioSwitch:[4,"scenario-switch"],axisTitlePosition:[1,"axis-title-position"],parentDimensions:[16],ruleSetConfig:[16]}]);function Et(){"undefined"!=typeof customElements&&["bn-chart-time-renderer"].forEach((t=>{"bn-chart-time-renderer"===t&&(customElements.get(e(t))||customElements.define(e(t),_t))}))}export{_t as B,Et as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as n}from"./p-JofGXz75.js";import{r as i}from"./p-BzjGUtYh.js";import{r as t,a as e}from"./p-CckAR27O.js";import{m as o}from"./p-
|
|
1
|
+
import{r as n}from"./p-JofGXz75.js";import{r as i}from"./p-BzjGUtYh.js";import{r as t,a as e}from"./p-CckAR27O.js";import{m as o}from"./p-BrJZUp-K.js";import{LAYOUT_STATE_VERSION as r}from"./index.js";const l=/^Scenario([1-4])$/,d=/^stacked_(?:col|bar)_(\d+)_seg_\d+$/,a='g[id^="stacked_col_"], g[id^="stacked_bar_"]';function s(n,i){var t;let e=n.parentElement;for(;e&&e!==i;){const n=l.exec(null!==(t=e.id)&&void 0!==t?t:"");if(n)return`scenario${n[1]}`;e=e.parentElement}}function c(n){if(""===n)return;const i=Number(n.split("_")[0]);return Number.isFinite(i)?i:void 0}function u(n){const i=n.getAttribute("data-bn-index");return null===i?void 0:Number(i)}function v(n,i){var t;return(null!==(t=n.getAttribute("class"))&&void 0!==t?t:"").split(/\s+/).includes(i)}function f(t,e,r,l,f){var m,g;const p={regions:[],barCount:0,baseline:{}},b=[];return Array.from(null!==(g=null===(m=t.shadowRoot)||void 0===m?void 0:m.querySelectorAll(e))&&void 0!==g?g:[]).forEach(((e,m)=>{var g,x,k,_;const A=null!==(g=r[m])&&void 0!==g?g:`segment${m}`,$=null===(x=e.shadowRoot)||void 0===x?void 0:x.querySelector("svg#drawCanvas");if($&&(p.regions.push({id:`canvas:${A}`,rect:o($,l)}),0===m&&(p.barCount=function(n){const i=n.querySelector('g[id="Scenario1"]');if(i)return Array.from(i.children).filter((n=>{var i;return/^\d+$/.test(null!==(i=n.id)&&void 0!==i?i:"")})).length;const t=new Set;return n.querySelectorAll(a).forEach((n=>{const i=d.exec(n.id);i&&n.querySelector("rect")&&t.add(i[1])})),t.size}($),p.baseline=n($,t)),"full"===f&&b.push(...function(n,t,e){const r=[],l=new Set;return n.querySelectorAll('g[id$="_RECT"]').forEach(((d,a)=>{var u;l.add(d);const v={kind:"bar",id:d.id,segment:t,scenario:s(d,n),index:null!==(u=c(d.id))&&void 0!==u?u:a,rect:o(d,e),point:i(d)};r.push(v)})),n.querySelectorAll(a).forEach((n=>{var a,s,c;const u=d.exec(n.id);if(!u||!n.querySelector("rect"))return;l.add(n);const v=i(n),f={kind:"bar",id:n.id,segment:t,scenario:`stack:${null!==(c=null!==(s=null!==(a=null==v?void 0:v.scenario)&&void 0!==a?a:null==v?void 0:v.subCategory)&&void 0!==s?s:null==v?void 0:v.category)&&void 0!==c?c:""}`,index:Number(u[1]),rect:o(n,e),point:v};r.push(f)})),["DATA","SCENARIO"].forEach((d=>{n.querySelectorAll(`g[id$="_${d}_Label"]`).forEach(((n,a)=>{var s,u,f;if(v(n,"hide"))return;const m=null!==(u=null===(s=n.textContent)||void 0===s?void 0:s.trim())&&void 0!==u?u:"";if(!m)return;l.add(n);const g={kind:"label",id:n.id,role:"DATA"===d?"data":"scenario",text:m,segment:t,index:null!==(f=c(n.id))&&void 0!==f?f:a,rect:o(n,e),point:i(n)};r.push(g)}))})),n.querySelectorAll("[data-bn-part]").forEach(((d,a)=>{var s,v,f;if(l.has(d))return;const m=i(d),g=null!==(s=u(d))&&void 0!==s?s:function(n,i){var t;for(let e=n;e&&e!==i;e=e.parentElement){const n=c(null!==(t=e.id)&&void 0!==t?t:"");if(void 0!==n)return n}}(d,n);if("element"===m.part){const n={kind:"point",series:m.scenario,index:null!=g?g:a,rect:o(d,e),point:m};return void r.push(n)}const p={kind:"label",id:d.id||void 0,role:"data",text:null!==(f=null===(v=d.textContent)||void 0===v?void 0:v.trim())&&void 0!==f?f:"",segment:t,index:g,rect:o(d,e),point:m};r.push(p)})),n.querySelectorAll('g[id="axis"] line').forEach((n=>{var i;const l=(null!==(i=n.getAttribute("class"))&&void 0!==i?i:"").split(/\s+/).find((n=>n.startsWith("axis-"))),d=o(n,e),a={kind:"axis",style:null==l?void 0:l.slice(5),orientation:d.context.width>=d.context.height?"horizontal":"vertical",segment:t,rect:d};r.push(a)})),n.querySelectorAll('g[id="AxisAndDateLables"] text, g[id="AxisAndDateLabelsLine"] text').forEach((i=>{var l,d;if(v(i,"hide")||function(n,i){var t;let e=n.parentElement;for(;e&&e!==i;){if((null!==(t=e.id)&&void 0!==t?t:"").endsWith("_Label"))return!0;e=e.parentElement}return!1}(i,n))return;const a=null!==(d=null===(l=i.textContent)||void 0===l?void 0:l.trim())&&void 0!==d?d:"";if(!a)return;const s={kind:"label",role:v(i,"categories")?"title":"category",text:a,segment:t,rect:o(i,e)};r.push(s)})),r}($,A,l))),"full"===f){const n=null===(k=e.shadowRoot)||void 0===k?void 0:k.querySelector(".footer"),i=null===(_=null==n?void 0:n.textContent)||void 0===_?void 0:_.trim();i&&b.push({kind:"label",role:"footer",text:i,segment:A,rect:o(n,l)})}})),"full"===f&&(p.elements=b),p}function m(l,d,a,s,c,v){var f,m,g,p;const b={version:r,tag:l.localName,id:e(l),slot:null!==(f=l.getAttribute("slot"))&&void 0!==f?f:void 0,rect:o(l,c),em:s,regions:[],metadata:{title:a},diagnostics:t(l)},x=null===(p=null===(g=null===(m=l.shadowRoot)||void 0===m?void 0:m.querySelector(d))||void 0===g?void 0:g.shadowRoot)||void 0===p?void 0:p.querySelector("svg#drawCanvas");return x&&(b.regions.push({id:"canvas",rect:o(x,c)}),b.metadata.pointCount=x.querySelectorAll("circle, ellipse").length,b.baseline=n(x,l),"full"===v&&(b.elements=function(n,t){const e=[];return n.querySelectorAll("circle, ellipse").forEach(((n,r)=>{const l={kind:"point",index:r,rect:o(n,t),point:i(n)};e.push(l)})),n.querySelectorAll('rect[data-bn-part="element"]').forEach(((n,r)=>{var l;const d=i(n),a={kind:"bar",segment:"base",scenario:null==d?void 0:d.scenario,index:null!==(l=u(n))&&void 0!==l?l:r,rect:o(n,t),point:d};e.push(a)})),n.querySelectorAll("text").forEach((n=>{var r,l;const d=null!==(l=null===(r=n.textContent)||void 0===r?void 0:r.trim())&&void 0!==l?l:"";if(!d)return;const a={kind:"label",role:"data",text:d,rect:o(n,t),point:i(n)};e.push(a)})),e}(x,c))),b}export{f as a,m as c}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as t,H as o,h as s,a as e,t as n}from"./p-D6YGOYV1.js";import{w as i}from"./p-Dq9dG0Kr.js";import{w as r}from"./p-
|
|
1
|
+
import{p as t,H as o,h as s,a as e,t as n}from"./p-D6YGOYV1.js";import{w as i}from"./p-Dq9dG0Kr.js";import{w as r}from"./p-9X5fVJqR.js";import{w as f}from"./p-4vVbchX2.js";const a=t(class extends o{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),i(this),this.errors=f(this),this.componentStyle=r(this)}getFontStyles(){return this.componentStyle((t=>{var o,s,e,n;return{"--bn-font-family":(null===(o=t.global)||void 0===o?void 0:o.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===(e=t.global)||void 0===e?void 0:e.fontColor)||"#000000","--bn-font-background":(null===(n=t.global)||void 0===n?void 0:n.fontBackgroundColor)||"#ffffff"}}))}render(){return s(e,{key:"fb9799f1ea3fadbf10dbc88aa668cad9d3e63853",style:this.getFontStyles()},s("slot",{key:"e08e29cdcac02cdd5caab034b0398b78de8951bf"}))}get element(){return this}static get style(){return':host{flex:1;min-height:0;position:relative;overflow:hidden;display: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)}'}},[257,"bn-body",{selectedStyle:[513,"selected-style"]}]);function l(){"undefined"!=typeof customElements&&["bn-body"].forEach((t=>{"bn-body"===t&&(customElements.get(n(t))||customElements.define(n(t),a))}))}export{a as B,l as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m as t}from"./p-BYBpC0EO.js";import{
|
|
1
|
+
import{m as t}from"./p-BYBpC0EO.js";import{o as s}from"./p-BKLq0Pbv.js";import{f as e,g as o}from"./p-D6YGOYV1.js";import{r as a}from"./p-Dq9dG0Kr.js";class r{constructor(){this.cache=new Map,this.tag=r.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.textContent=Array.from(this.cache.values()).map((t=>t)).join("\n")}}const n=new r,m=t=>s(t)?`${t}px`:t,c={width:{className:"w",cssName:"width",attrName:"width",transform:m},height:{className:"h",cssName:"height",attrName:"height",transform:m},position:{className:"pst",cssName:"position",attrName:"position"},top:{className:"top",cssName:"top",attrName:"top",transform:m},right:{className:"rgt",cssName:"right",attrName:"right",transform:m},bottom:{className:"btm",cssName:"bottom",attrName:"bottom",transform:m},left:{className:"lft",cssName:"left",attrName:"left",transform:m},"font-size":{className:"fts",cssName:"font-size",attrName:"font-size",transform:m},"grid-column":{className:"gdc",cssName:"grid-column",attrName:"grid-column"},"grid-row":{className:"gdr",cssName:"grid-row",attrName:"grid-row"}},i=Object.keys(c);function f(t,s,e){return`.${s} {${t.cssName}: ${e};}`}function N(s,e){const o=document.createElement("div").style;o.setProperty(s.cssName,e);const a=o.getPropertyValue(s.cssName);if(o.cssText=`${s.cssName}:${a};--bn-end:1`,!a||a.includes("<")||"1"!==o.getPropertyValue("--bn-end"))return;const r=function(s,e){const o=t(e);return`bn-c-${s.className}_${o}`}(s,e);return{className:r,style:f(s,r,a)}}const l=t=>{const s=new Map;return i.forEach((e=>{const o=t.getAttribute(e);if(o){["top","left","right","bottom"].includes(e)&&s.set("position",N(c.position,"absolute"));const t=N(c[e],(c[e].transform||function(t){return t})(o));t&&s.set(e,t)}})),s},d=new MutationObserver((t=>{for(const s of t){const t=s.target,o=l(t);n.apply(o);const a=Array.from(o.values()).map((t=>t.className));t.className=t.className.split(" ").filter((t=>!t.startsWith("bn-c-"))).concat(...a).join(" "),e(t)}})),p=t=>{const s=t.connectedCallback,e=t.disconnectedCallback;t.connectedCallback=()=>{const e=o(t);if(!e)throw new Error("Can't find element field in component undefined");(t=>{const s=l(t);n.apply(s);const e=Array.from(s.values()).map((t=>t.className));t.className=t.className.split(" ").filter((t=>!t.startsWith("bn-c-"))).concat(...e).join(" "),d.observe(t,{attributes:!0,attributeFilter:i,childList:!1,subtree:!1})})(e),a(s,t)},t.disconnectedCallback=()=>{a(e,t)}};export{p as w}
|