@bino-bi/bn-template-engine 1.0.0-next.48 → 1.0.0-next.49
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-b3f5eba0.entry.js → p-2de524d0.entry.js} +1 -1
- package/dist/bn-template-engine/{p-a6017fce.entry.js → p-510d2ee6.entry.js} +1 -1
- package/dist/bn-template-engine/{p-6ab684a9.entry.js → p-8fc90dc8.entry.js} +1 -1
- package/dist/bn-template-engine/p-BFl7OwcC.js +1 -0
- package/dist/bn-template-engine/{p-3ktFZb1x.js → p-Bxa4pX1M.js} +1 -1
- package/dist/bn-template-engine/p-c1d679af.entry.js +1 -0
- package/dist/cjs/bn-annotation-layer_30.cjs.entry.js +628 -108
- package/dist/cjs/bn-grid.cjs.entry.js +1 -1
- package/dist/cjs/bn-image.cjs.entry.js +1 -1
- package/dist/cjs/bn-text.cjs.entry.js +2 -2
- package/dist/cjs/{withStyled-DHKHBdRb.js → withStyled-pkdctrK9.js} +18 -1
- package/dist/cjs/{withTranslation-CLwC9a8V.js → withTranslation-BIzTNYZM.js} +1 -1
- package/dist/collection/components/bn-annotation-layer/bn-annotation-layer.css +19 -0
- package/dist/collection/components/bn-annotation-layer/bn-annotation-layer.js +65 -8
- package/dist/collection/components/bn-annotation-layer/utils/marks.js +85 -5
- package/dist/collection/components/bn-annotation-layer/utils/matchPoint.js +7 -1
- package/dist/collection/components/bn-chart-time/bn-chart-time-renderer/bn-chart-time-renderer.js +20 -6
- package/dist/collection/components/bn-chart-time/bn-chart-time.js +55 -23
- package/dist/collection/components/bn-chart-time/utils/TimeChart.js +329 -53
- package/dist/collection/components/bn-chart-time/utils/elements/Column.js +4 -1
- package/dist/collection/components/bn-chart-time/utils/elements/Label.js +2 -1
- package/dist/collection/components/bn-chart-time/utils/elements/StackedColumn.js +53 -11
- package/dist/collection/utils/annotations.js +1 -1
- package/dist/collection/utils/constants.js +2 -0
- package/dist/collection/utils/layoutState/svgChartElements.js +10 -0
- package/dist/collection/utils/validate.js +16 -1
- package/dist/components/bn-annotation-layer.js +1 -1
- package/dist/components/bn-annotation-list.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-grid.js +1 -1
- package/dist/components/bn-image.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-page.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-CLjuZoiT.js → p-B11cXOLy.js} +1 -1
- package/dist/components/p-BBdzTx8V.js +1 -0
- package/dist/components/{p-B1_wkOLx.js → p-BVNOmHh4.js} +1 -1
- package/dist/components/p-BXP6aagM.js +1 -0
- package/dist/components/{p-CG-iY7pQ.js → p-Blre9f28.js} +1 -1
- package/dist/components/p-CHJ6WE0l.js +1 -0
- package/dist/components/{p-Do4GqlMV.js → p-CHhxQoF9.js} +1 -1
- package/dist/components/{p-C-3TOa6K.js → p-CJ0-xdfZ.js} +1 -1
- package/dist/components/{p-BFoRIqDi.js → p-CO6bgquz.js} +1 -1
- package/dist/components/{p-CytMTBFu.js → p-CSJCkHEL.js} +1 -1
- package/dist/components/p-CVfmhtEW.js +1 -0
- package/dist/components/{p-Zuxd3z0q.js → p-Cc0gaLwp.js} +1 -1
- package/dist/components/p-CuUfiEu0.js +1 -0
- package/dist/components/{p-DUZCLRVu.js → p-D362XOg2.js} +1 -1
- package/dist/components/p-DBj1Yd3M.js +1 -0
- package/dist/components/{p-BjgkgCAQ.js → p-DHX92KDP.js} +1 -1
- package/dist/components/p-DHloMyxV.js +1 -0
- package/dist/components/{p-Uc0zvXcQ.js → p-Dd1QOWDV.js} +1 -1
- package/dist/components/p-DguYWLBj.js +1 -0
- package/dist/components/p-Do-IGHJk.js +1 -0
- package/dist/components/{p-DDo-fu3v.js → p-DsC0ew4j.js} +1 -1
- package/dist/components/p-HVN8BNWN.js +1 -0
- package/dist/components/{p-Dyzb4ika.js → p-YSRTB0jS.js} +1 -1
- package/dist/components/{p-CrZ_O3DT.js → p-k7heRDPP.js} +1 -1
- package/dist/components/{p-dO0utE8m.js → p-keKnrAVS.js} +1 -1
- package/dist/components/p-x0W2_FAX.js +1 -0
- package/dist/components/p-y12CmIFS.js +1 -0
- package/dist/esm/bn-annotation-layer_30.entry.js +628 -108
- package/dist/esm/bn-grid.entry.js +1 -1
- package/dist/esm/bn-image.entry.js +1 -1
- package/dist/esm/bn-text.entry.js +2 -2
- package/dist/esm/{withStyled-CTZFjg4L.js → withStyled-B62R20Zx.js} +18 -1
- package/dist/esm/{withTranslation-BESW5BNq.js → withTranslation-BEseMLQ6.js} +1 -1
- package/dist/types/components/bn-annotation-layer/utils/marks.d.ts +48 -0
- package/dist/types/components/bn-annotation-layer/utils/matchPoint.d.ts +4 -0
- package/dist/types/components/bn-chart-time/bn-chart-time.d.ts +29 -6
- package/dist/types/components/bn-chart-time/utils/TimeChart.d.ts +51 -2
- package/dist/types/components/bn-chart-time/utils/elements/StackedColumn.d.ts +5 -1
- package/dist/types/components/bn-chart-time/utils/model/TimeChartComponentConfig.d.ts +6 -0
- package/dist/types/components.d.ts +6 -6
- package/dist/types/utils/annotations.d.ts +11 -1
- package/dist/types/utils/constants.d.ts +3 -1
- package/dist/types/utils/layoutState/types.d.ts +2 -0
- package/package.json +1 -1
- package/dist/bn-template-engine/p-203e7d6a.entry.js +0 -1
- package/dist/bn-template-engine/p-DXtYQE4s.js +0 -1
- package/dist/components/p-6gET6YXc.js +0 -1
- package/dist/components/p-BFWvVe7v.js +0 -1
- package/dist/components/p-C8rpOS5t.js +0 -1
- package/dist/components/p-CUoPUIej.js +0 -1
- package/dist/components/p-ChpAMqbN.js +0 -1
- package/dist/components/p-D3hr9wra.js +0 -1
- package/dist/components/p-DFybNETX.js +0 -1
- package/dist/components/p-DRmphEA0.js +0 -1
- package/dist/components/p-D_K7tYhY.js +0 -1
- package/dist/components/p-Dw3rv_Y9.js +0 -1
- package/dist/components/p-TNX3alPU.js +0 -1
- package/dist/components/p-j42D1yrQ.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g as t,f as n}from"./p-GstO_GU5.js";import{g as e,r,c as s,D as a}from"./p-7pLJBHT2.js";const i=t=>{if("object"==typeof t&&null!==t){if("function"==typeof Object.getPrototypeOf){const n=Object.getPrototypeOf(t);return n===Object.prototype||null===n}return"[object Object]"===Object.prototype.toString.call(t)}return!1},o=(t,n)=>n,u=(t,n)=>[...new Set([...t,...n])],c=(t,n)=>{const e=(t=>{return{arrayMergeType:"combine",arrayMerge:(n=t?t.arrayMergeType:"combine","overwrite"===n?o:u),...t};var n})(n);return t.reduce(((t,n)=>(Object.keys(n).forEach((r=>{Array.isArray(t[r])&&Array.isArray(n[r])?e&&e.arrayMerge&&(t[r]=e.arrayMerge(t[r],n[r])):t[r]=i(t[r])&&i(n[r])?c([t[r],n[r]],e):n[r]})),t)),{})},l=(t,n)=>c([t._system||{},t._default||{},void 0!==n&&t[n]||{}],{arrayMergeType:"overwrite"}),f=a=>{let i,o,u,c;const f=()=>{c=l(o.componentStyles.state,u)},d=a.connectedCallback;a.connectedCallback=()=>{const s=t(a);o=e(s),c=o.componentStyles.state._system,u=a.selectedStyle,f(),i=o.componentStyles.on("set",(e=>{e!==u&&"_default"!==e||(u=a.selectedStyle,f(),n(t(a)))})),r(d,a)};const h=a.disconnectedCallback;return a.disconnectedCallback=()=>{r(i),s(t(a)),r(h,a)},t=>(void 0!==o&&a.selectedStyle!==u&&(u=a.selectedStyle,f()),t(c))};var d,h,m,y,p,b,v,g;!function(t){t.ALL="all",t.META="meta"}(d||(d={})),function(t){t.CURRENCY="currency",t.VOLUME="volume"}(h||(h={})),function(t){t.AC1="ac1",t.AC2="ac2",t.AC3="ac3",t.AC4="ac4",t.PP1="pp1",t.PP2="pp2",t.PP3="pp3",t.PP4="pp4",t.FC1="fc1",t.FC2="fc2",t.FC3="fc3",t.FC4="fc4",t.PL1="pl1",t.PL2="pl2",t.PL3="pl3",t.PL4="pl4"}(m||(m={})),function(t){t.POS="pos",t.NEG="neg",t.NEU="neu",t.OP="op",t.OPINV="opinv"}(y||(y={})),function(t){t.DECIMAL="decimal",t.PERCENT="percent"}(p||(p={})),function(t){t.LIST="list",t.SUM="sum",t.SUMNOTOTAL="sumnototal",t.OPT="opt",t.OPTNOTOTAL="optnototal"}(b||(b={})),function(t){t.INF="inf",t.W100="w100",t.W50="w50",t.W25="w25",t.W20="w20",t.W15="w15",t.W10="w10",t.W5="w5"}(v||(v={})),function(t){t.W5="w5",t.W10="w10",t.W15="w15",t.W20="w20",t.W25="w25",t.W30="w30",t.W40="w40",t.W60="w60",t.W80="w80",t.W100="w100"}(g||(g={}));const N={[g.W5]:5,[g.W10]:10,[g.W15]:15,[g.W20]:20,[g.W25]:25,[g.W30]:30,[g.W40]:40,[g.W60]:60,[g.W80]:80,[g.W100]:100};var w,k,S,O,D,T;!function(t){t.ROWGROUP="rowGroup",t.ROWGROUPINDEX="rowGroupIndex",t.CATEGORY="category",t.CATEGORYINDEX="categoryIndex",t.SUBCATEGORY="subCategory",t.SUBCATEGORYINDEX="subCategoryIndex"}(w||(w={})),function(t){t.SMART="smart",t.LONG="long",t.SHORT="short"}(k||(k={})),function(t){t.COLUMN="column",t.LINE="line",t.WATERFALL="waterfall"}(S||(S={})),function(t){t.BAR="bar",t.LINE="line",t.AUTO="auto"}(O||(O={})),function(t){t.SCENARIOS="scenarios",t.DIMENSIONS="dimensions"}(D||(D={})),function(t){t.ABSOLUTE="absolute",t.RELATIVE="relative",t.ABSOLUTE_RELATIVE="absolute-relative"}(T||(T={}));const A=100;var M,E,j,J,L,$,F;!function(t){t.ASC="asc",t.DESC="desc",t.DATASET="dataset"}(M||(M={})),function(t){t[t.ALL=-1]="ALL"}(E||(E={})),function(t){t[t.UP_TO_DATE=0]="UP_TO_DATE",t[t.DIRTY=1]="DIRTY"}(j||(j={})),function(t){t.LIST="list",t.SUM="sum",t.SUMNOTOTAL="sumnototal",t.OPT="opt",t.OPTNOTOTAL="optnototal"}(J||(J={})),function(t){t.BELOW="below",t.ABOVE="above"}(L||(L={})),function(t){t.ASC="asc",t.DESC="desc"}($||($={})),function(t){t.HEADER="HEADER",t.GROUPHEAD="GROUPHEAD",t.SEPERATORLINE="SEPERATORLINE",t.SUM="SUM",t.GROUPSUM="GROUP_SUM",t.DRILLELEMENT="DRILLELEMENT",t.STANDARD="STANDARD",t.PARTELEMENT="PARTELEMENT",t.ENTRY="ENTRY"}(F||(F={}));const _=/^\s*(set|first|last|min|max|avg|sum|lit)\(\s*(.*?)\s*\)\s*$/,I=/^[A-Za-z_][A-Za-z0-9_]*$/,W=["min","max","avg","sum"];class x{constructor(t,n,e,r){this.label=t,this.alias=n,this.fn=e,this.arg=r}get isNumeric(){return W.includes(this.fn)}}function G(t){if("string"!=typeof t)return!1;const n=_.exec(t);if(!n)return!1;const[,e,r]=n;return"lit"===e?r.length>0:I.test(r)}function R(t,n,e){if(!G(e))return null;const[,r,s]=_.exec(e);return new x(t,n,r,s)}var q,z,C,P;!function(t){t.YEAR="year",t.QUARTER="quarter",t.MONTH="month",t.WEEK="week",t.DAY="day",t.HOUR="hour",t.MINUTE="minute",t.SECOND="second",t.MILLISECOND="millisecond",t.NONE="fallback",t.AUTO="auto"}(q||(q={})),function(t){t.AVG="avg",t.INTERVAL="interval",t.START="start",t.END="end",t.YTD="ytd",t.YTG="ytg",t.CUM="cum",t.MAT="mat",t.NONE="none",t.AUTO="auto"}(z||(z={}));class U{constructor(){this._dateFormat={year:"yyyy",quarter:"q'Q' yyyy",month:"LLL yyyy",week:"'KW'WW kkkk",day:"dd.MM.yyyy",hour:"TT",minute:"TT",second:"TT",millisecond:"TT:SSS",fallback:"dd.MM.yyyy"},this._dateFormatShort={year:"yy",quarter:"q'Q'",month:"LLL",week:"'KW'WW",day:"dd",hour:"hh'h'",minute:"mm'm'",second:"ss's'",millisecond:"SSS'ms'",fallback:"dd.MM.yyyy"},this._dateLinkFormat={avg:"Ø[LINK]",interval:"[DATE]..[DATE2]",start:".[DATE]",end:"[DATE].",ytd:"_[DATE]",ytg:"[DATE]_",cum:"[DATE]_[DATE2]",mat:"~[DATE]",none:"[DATE]"},this.locale="de",this.dateFormatPinned=!1,this.dateFormatShortPinned=!1,this.dateFormat=this._dateFormat,this.dateLinkFormat=this._dateLinkFormat,this.dateFormatShort=this._dateFormatShort}setDateLinkFormat(t){this.dateLinkFormat=t}setDateFormat(t){this.dateFormat=t,this.dateFormatPinned=!0}setDateFormatShort(t){this.dateFormatShort=t,this.dateFormatShortPinned=!0}patchDateFormatShort(t){this.dateFormatShort=Object.assign(Object.assign({},this.dateFormatShort),t)}setLocale(t){this.locale=t,this.dateFormatPinned||(this.dateFormat=Object.assign(Object.assign({},this._dateFormat),U.LOCALE_DATE_FORMAT[t]||{})),this.dateFormatShortPinned||(this.dateFormatShort=Object.assign(Object.assign({},this._dateFormatShort),U.LOCALE_DATE_FORMAT_SHORT[t]||{}))}getDateString(t,n){return t.setLocale(this.locale).toFormat(this.dateFormat[n]||this.dateFormat.fallback)}getSmartDateString(t,n){switch(n){case q.DAY:return this.getFormatedDayDate(t);case q.MONTH:return this.getFormatedMonthDate(t);case q.QUARTER:return this.getFormatedQuarterDate(t);case q.WEEK:return this.getFormatedWeekDate(t);case q.HOUR:return this.getFormatedHourDate(t);case q.MINUTE:return this.getFormatedMinuteDate(t);case q.SECOND:return this.getFormatedSecondDate(t);case q.MILLISECOND:return this.getFormatedMilliSecondDate(t);default:return this.getDateString(t,n)}}calculateDistanceType(t,n,e=32){if(null==n)return q.DAY;const r="number"==typeof t?a.fromMillis(t):t,s="number"==typeof n?a.fromMillis(n):n;return 0===s.diff(r).as("milliseconds")?q.DAY:s.diff(r).as("milliseconds")<e?q.MILLISECOND:s.diff(r).as("seconds")<e?q.SECOND:s.diff(r).as("minutes")<e?q.MINUTE:s.diff(r).as("hours")<e?q.HOUR:s.diff(r).as("days")<e?q.DAY:s.diff(r).as("weeks")<e?q.WEEK:s.diff(r).as("months")<e?q.MONTH:s.diff(r).as("quarters")<e?q.QUARTER:q.YEAR}datesBetween(t,n,e){const r=this.convertDateDistanceToMomentunitOfTime(e),s=t.startOf(r),a=n.endOf(r),i=[];let o=s;do{i.push(o),o=o.plus(this.createDiratonLike(r,1))}while(o<=a);return i}countBetween(t,n,e){const r=this.convertDateDistanceToMomentunitOfTime(e);return Math.floor(n.startOf(r).diff(t.startOf(r),r).as(r))+1}getDateLinkString(t,n,e,r,s){if(null==t&&null==n)return"";if(null==t&&e!==z.END&&e!==z.YTD)return"";if(null==n&&(z.INTERVAL===e||z.CUM===e||z.END===e||z.YTD===e))return"";const i=t||a.now(),o=n;r===q.AUTO&&(r=this.calculateDistanceType(i,o,s));let u=this.getDateString(i,r),c="",l=z.NONE;return null!=o&&(c=this.getDateString(o,r),l=z.INTERVAL,u===c&&e===z.INTERVAL&&(e=z.NONE),u===c&&e===z.AVG&&(l=z.NONE),z.END!==e&&z.YTD!==e||(u=c),e!==z.INTERVAL&&e!==z.CUM&&e!==z.AVG||(r===q.QUARTER?i.quarter===o.quarter&&i.year===o.year?c=c.replace(" "+o.year,""):i.year===o.year&&(u=u.replace(" "+i.year,"")):r===q.MONTH?i.month===o.month&&i.year===o.year?c=c.replace(" "+o.year,""):i.year===o.year&&(u=u.replace(" "+i.year,"")):r===q.WEEK&&(i.weekNumber===o.weekNumber&&i.weekYear===o.weekYear?c=c.replace(" "+o.weekYear,""):i.weekYear===o.weekYear&&(u=u.replace(" "+i.weekYear,""))))),this.dateLinkFormat[e].replace("[LINK]",this.dateLinkFormat[l]).replace("[DATE]",u).replace("[DATE2]",c)}getShortDateString(t,n){return t.setLocale(this.locale).toFormat(this.dateFormatShort[n]||this.dateFormatShort.fallback)}getFormatedDayDate(t){let n=this.dateFormatShort.day;return this.isFirstInMonth(t)&&(n+=" "+this.dateFormatShort.month),this.isJanuary(t)&&(n+=" "+this.dateFormatShort.year),t.setLocale(this.locale).toFormat(n)}getFormatedMonthDate(t){let n=this.dateFormatShort.month;return this.isJanuary(t)&&(n+=" "+this.dateFormatShort.year),t.setLocale(this.locale).toFormat(n)}getFormatedQuarterDate(t){let n=this.dateFormatShort.quarter;return this.isFirstQuarter(t)&&(n+=" "+this.dateFormatShort.year),t.setLocale(this.locale).toFormat(n)}getFormatedWeekDate(t){let n=this.dateFormatShort.week;return this.isFirstWeek(t)&&(n+=" kk"),t.setLocale(this.locale).toFormat(n)}getFormatedHourDate(t){let n=this.dateFormatShort.hour;return this.isFirstHour(t)&&(n+=" "+this.dateFormatShort.day),t.setLocale(this.locale).toFormat(n)}getFormatedMinuteDate(t){let n=this.dateFormatShort.minute;return this.isFirstMinute(t)&&(n=this.dateFormatShort.hour+":"+n),t.setLocale(this.locale).toFormat(n)}getFormatedSecondDate(t){let n=this.dateFormatShort.second;return this.isFirstSecond(t)&&(n=this.dateFormatShort.minute+":"+n),t.setLocale(this.locale).toFormat(n)}getFormatedMilliSecondDate(t){let n=this.dateFormatShort.millisecond;return this.isFirstMilliSecond(t)&&(n=this.dateFormatShort.second+":"+n),t.setLocale(this.locale).toFormat(n)}isSmartBoundary(t,n){switch(n){case q.DAY:return this.isFirstInMonth(t);case q.WEEK:return this.isFirstWeek(t);case q.MONTH:return this.isJanuary(t);case q.QUARTER:return this.isFirstQuarter(t);default:return!1}}isFirstInMonth(t){return 1===t.day}isJanuary(t){return 1===t.month}isFirstQuarter(t){return 1===t.quarter}isFirstWeek(t){return 1===t.weekNumber}isFirstHour(t){return 0===t.hour}isFirstMinute(t){return 0===t.minute}isFirstSecond(t){return 0===t.second}isFirstMilliSecond(t){return 0===t.millisecond}convertDateDistanceToMomentunitOfTime(t){let n;switch(t){case q.YEAR:n="year";break;case q.MONTH:n="month";break;case q.QUARTER:n="quarter";break;case q.WEEK:n="week";break;case q.DAY:n="day";break;case q.HOUR:n="hour";break;case q.MINUTE:n="minute";break;case q.SECOND:n="second";break;case q.MILLISECOND:n="millisecond";break;default:n="day"}return n}createDiratonLike(t,n){switch(t){case"year":return{years:n};case"month":return{months:n};case"quarter":return{quarters:n};case"week":return{weeks:n};case"day":default:return{days:n};case"hour":return{hours:n};case"minute":return{minutes:n};case"second":return{seconds:n};case"millisecond":return{milliseconds:n}}}}U.LOCALE_DATE_FORMAT={en:{week:"'W'WW kkkk",day:"MM/dd/yyyy",fallback:"MM/dd/yyyy"}},U.LOCALE_DATE_FORMAT_SHORT={en:{week:"'W'WW",fallback:"MM/dd/yyyy"}};class B{static isExisting(t){return null!=t}static isString(t){return"string"==typeof t}static isNumber(t){return"number"==typeof t&&!Number.isNaN(t)}static isBoolean(t){return"boolean"==typeof t}static isArray(t){return Array.isArray(t)}static isObject(t){return"object"==typeof t&&null!==t}static isOperator(t){return"+"===t||"-"===t}static isDate(t){return t instanceof a&&t.isValid}}class H{static adaptDefaultString(t){return B.isString(t)?t.trim():""}static adaptArray(t,n){const e=[];return B.isArray(t)&&t.forEach((t=>{e.push(n.adapt(t))})),e}}!function(t){t.ASC="asc",t.DESC="desc"}(C||(C={})),function(t){t.ROWGROUP="rowGroup",t.ROWGROUPINDEX="rowGroupIndex",t.CATEGORY="category",t.CATEGORYINDEX="categoryIndex",t.SUBCATEGORY="subCategory",t.SUBCATEGORYINDEX="subCategoryIndex",t.AC1="ac1",t.AC2="ac2",t.AC3="ac3",t.AC4="ac4",t.PP1="pp1",t.PP2="pp2",t.PP3="pp3",t.PP4="pp4",t.FC1="fc1",t.FC2="fc2",t.FC3="fc3",t.FC4="fc4",t.PL1="pl1",t.PL2="pl2",t.PL3="pl3",t.PL4="pl4"}(P||(P={}));class K{constructor(t=["category"],n=C.ASC){this.hierarchy=t,this.direction=n}}const Q=[P.ROWGROUP,P.ROWGROUPINDEX,P.CATEGORY,P.CATEGORYINDEX,P.SUBCATEGORY,P.SUBCATEGORYINDEX],Y=/^(?:ac|fc|pp|pl)[1-4]$/,Z=/^(dr|d)((?:ac|fc|pp|pl)[1-4])_((?:ac|fc|pp|pl)[1-4])(?:_(?:pos|neg|neu|opinv|op))?$/;function V(t){if(null==t)return;const n=t.indexOf("@"),e=(n<0?t:t.slice(0,n)).trim().toLowerCase(),r=n<0?void 0:t.slice(n+1).trim();if(""===r)return;const s=P[e.toUpperCase()];if(null!=s&&Q.includes(s))return void 0===r?{kind:"dim",column:s}:void 0;if(Y.test(e))return{kind:"scenario",column:e,bucket:r};const a=Z.exec(e);if(null!=a){const[,t,n,e]=a;return{kind:"variance",column:`${t}${n}_${e}`,type:t,base:n,delta:e,bucket:r}}}function X(t){const n=V(t);if(null!=n)return void 0===n.bucket?n.column:`${n.column}@${n.bucket}`}class tt{constructor(t,n=!1){this.stringAdapter=t,this.allowMeasures=n}adapt(t){var n;const e=H.adaptArray(t.hierarchy,this.stringAdapter),r=C[null===(n=t.direction)||void 0===n?void 0:n.toUpperCase()]||C.ASC;return new K(e.map((t=>(this.allowMeasures?X(t):P[t.toUpperCase()])||P.CATEGORY)),r)}default(){return new K(["category"],C.ASC)}}const nt="n/a";function et(t,n){if(!(Math.abs(n)<=1e-9*Math.abs(t)))return t/Math.abs(n)}const rt=/^(dr|d)((?:ac|pp|fc|pl)[1-4])_((?:ac|pp|fc|pl)[1-4])(?:_(pos|neg|neu|op|opinv))?$/;class st{constructor(t,n,e){this.type=t,this.base=n,this.delta=e}static parse(t){const n=rt.exec(t);return null===n?null:new st(n[1],n[2],n[3])}compute(t,n){var e;return null==t||null==n?null:"dr"===this.type?0===n?null:null!==(e=et(t-n,n))&&void 0!==e?e:null:t-n}}function at(t){const n=t.trim();if(Object.values(m).includes(n))return{kind:"scenario",slot:n};const e=st.parse(n);return null!==e?{kind:"variance",measure:e}:null}function it(t){return t.replace(/\d+$/,"")}function ot(t){return t.replace(/^[a-z]+/,"")}function ut(t){var n;return"dr"===(null===(n=st.parse(t.trim()))||void 0===n?void 0:n.type)}function ct(t){if(!ut(t.measure))return t;const n=t=>void 0===t?void 0:t/100;return Object.assign(Object.assign({},t),{min:n(t.min),max:n(t.max),refLine:n(t.refLine),highlight:t.highlight&&{from:n(t.highlight.from),to:n(t.highlight.to)}})}function lt(t){return null==t||""===t||"null"===t}function ft(t){return"string"==typeof t&&"none"===t.trim().toLowerCase()}function dt(t){return lt(t)||"auto"===t.trim().toLowerCase()?[]:ht((null==t?void 0:t.split(",").filter((t=>!(t.toUpperCase().trim()in m)))).toString())}function ht(t){return lt(t)?[]:t.replace(";",",").split(",").filter((t=>{var n,e,r;const s=t.split("_"),a=null===(n=s[0])||void 0===n?void 0:n.replace(/^dr|^d/,"").toUpperCase().trim(),i=null===(e=s[1])||void 0===e?void 0:e.toUpperCase().trim(),o=null===(r=s[2])||void 0===r?void 0:r.toUpperCase().trim();return 3!==s.length||!(a in m)||!(i in m)||!(o in y)}))}function mt(t){return lt(t)?[]:ht(t.split(",").filter((t=>!(t.toUpperCase().trim()in m))).toString())}function yt(t){return lt(t)||"auto"===t.trim().toLowerCase()?[]:ht(t.split(",").filter((t=>!(t.toUpperCase()in P))).toString())}function pt(t){return lt(t)||"auto"===t.trim().toLowerCase()?[]:t.split(",").filter((t=>void 0===V(t)))}function bt(t){return!lt(t)&&Number.isInteger(Number(t))}function vt(t){return!lt(t)&&!Number.isNaN(Number(t))}function gt(t){return!lt(t)&&(null==t?void 0:t.toUpperCase())in C}function Nt(t){return"auto"===(null==t?void 0:t.toLowerCase())||(null==t?void 0:t.toUpperCase())in w}function wt(t){if(lt(t))return[];try{const n=JSON.parse(t);if(n instanceof Array)return n.filter((t=>!(t.hasOwnProperty("name")&&t.hasOwnProperty("unit"))))}catch(t){console.error("validateMeasureList: failed to parse JSON",t)}return["Invalid JSON structure"]}function kt(t){const n=Date.parse(t);return Number.isInteger(n)}function St(t){return(null==t?void 0:t.toUpperCase())in z}function Ot(t){return(null==t?void 0:t.toUpperCase())in q}function Dt(t){return(null==t?void 0:t.toUpperCase())in k}function Tt(t){return!lt(t)&&(null==t?void 0:t.toUpperCase())in p}function At(t){return!lt(t)&&(null==t?void 0:t.toUpperCase())in b}function Mt(t){return(null==t?void 0:t.toUpperCase())in L}function Et(t){if(lt(t))return[];try{const n=JSON.parse(t);if(n instanceof Array)return n.filter((t=>!(t.hasOwnProperty("rowGroup")&&t.hasOwnProperty("category")&&t.hasOwnProperty("subCategory"))))}catch(t){console.error("validateThereOfJsonStr: failed to parse JSON",t)}return["Invalid JSON structure"]}function jt(t){if(lt(t))return[];try{const n=JSON.parse(t);if(null!==n&&"object"==typeof n&&!(n instanceof Array))return Object.entries(n).filter((([,t])=>"string"!=typeof t||!G(t))).map((([t,n])=>`${t}: ${n}`))}catch(t){console.error("validateAttributesJsonStr: failed to parse JSON",t)}return["Invalid JSON structure"]}function Jt(t){if(lt(t))return[];try{const n=JSON.parse(t);if(n instanceof Array)return n.filter((t=>!(t.hasOwnProperty("rowGroup")&&t.hasOwnProperty("category"))))}catch(t){console.error("validatePartOfJsonStr: failed to parse JSON",t)}return["Invalid JSON structure"]}function Lt(t){return(null==t?void 0:t.trim().toUpperCase())in h}function $t(t){return["_","k","M","G","T","P","E","Z","Y","m","my","μ","n","p","f","a","z","y"].includes(null==t?void 0:t.trim())||["GREATEST","LEAST"].includes(null==t?void 0:t.trim().toUpperCase())}function Ft(t){return(null==t?void 0:t.toUpperCase().trim())in v}function _t(t){return(null==t?void 0:t.toUpperCase().trim())in g}function It(t){if(lt(t))return[];try{return JSON.parse(t).filter((t=>!(t.hasOwnProperty("scenario")&&t.hasOwnProperty("name")&&t.hasOwnProperty("subGroups"))))}catch(t){console.error("validateColumnThereOfJsonStr: failed to parse JSON",t)}return["Invalid JSON structure"]}function Wt(t){if(lt(t))return[];try{const n=JSON.parse(t);if("object"!=typeof n||null===n||Array.isArray(n))return["stack: must be a JSON object"];const e=[];if(n.hasOwnProperty("by")){const t=["scenarios","dimensions"];t.includes(n.by)||e.push(`stack: 'by' must be one of: ${t.join(", ")}`)}else e.push("stack: 'by' is required");if(n.hasOwnProperty("mode")){const t=["absolute","relative","absolute-relative"];t.includes(n.mode)||e.push(`stack: 'mode' must be one of: ${t.join(", ")}`)}if(n.hasOwnProperty("order")){const t=["asc","desc","dataset"];t.includes(n.order)||e.push(`stack: 'order' must be one of: ${t.join(", ")}`)}return e}catch(t){return["stack: invalid JSON"]}}function xt(t){return!lt(t)&&null!==at(t)}class Gt{constructor(){this.cache=new Map,this.tag=Gt.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 Rt=new Gt;function qt(t){for(var n,e=0,r=0,s=t.length;s>=4;++r,s-=4)n=1540483477*(65535&(n=255&t.charCodeAt(r)|(255&t.charCodeAt(++r))<<8|(255&t.charCodeAt(++r))<<16|(255&t.charCodeAt(++r))<<24))+(59797*(n>>>16)<<16),e=1540483477*(65535&(n^=n>>>24))+(59797*(n>>>16)<<16)^1540483477*(65535&e)+(59797*(e>>>16)<<16);switch(s){case 3:e^=(255&t.charCodeAt(r+2))<<16;case 2:e^=(255&t.charCodeAt(r+1))<<8;case 1:e=1540483477*(65535&(e^=255&t.charCodeAt(r)))+(59797*(e>>>16)<<16)}return(((e=1540483477*(65535&(e^=e>>>13))+(59797*(e>>>16)<<16))^e>>>15)>>>0).toString(36)}const zt=t=>vt(t)?`${t}px`:t,Ct={width:{className:"w",cssName:"width",attrName:"width",transform:zt},height:{className:"h",cssName:"height",attrName:"height",transform:zt},position:{className:"pst",cssName:"position",attrName:"position"},top:{className:"top",cssName:"top",attrName:"top",transform:zt},right:{className:"rgt",cssName:"right",attrName:"right",transform:zt},bottom:{className:"btm",cssName:"bottom",attrName:"bottom",transform:zt},left:{className:"lft",cssName:"left",attrName:"left",transform:zt},"font-size":{className:"fts",cssName:"font-size",attrName:"font-size",transform:zt},"grid-column":{className:"gdc",cssName:"grid-column",attrName:"grid-column"},"grid-row":{className:"gdr",cssName:"grid-row",attrName:"grid-row"}},Pt=Object.keys(Ct);function Ut(t,n,e){return`.${n} {${t.cssName}: ${e};}`}function Bt(t,n){const e=document.createElement("div").style;e.setProperty(t.cssName,n);const r=e.getPropertyValue(t.cssName);if(e.cssText=`${t.cssName}:${r};--bn-end:1`,!r||r.includes("<")||"1"!==e.getPropertyValue("--bn-end"))return;const s=function(t,n){const e=qt(n);return`bn-c-${t.className}_${e}`}(t,n);return{className:s,style:Ut(t,s,r)}}const Ht=t=>{const n=new Map;return Pt.forEach((e=>{const r=t.getAttribute(e);if(r){["top","left","right","bottom"].includes(e)&&n.set("position",Bt(Ct.position,"absolute"));const t=Bt(Ct[e],(Ct[e].transform||function(t){return t})(r));t&&n.set(e,t)}})),n},Kt=new MutationObserver((t=>{for(const e of t){const t=e.target,r=Ht(t);Rt.apply(r);const s=Array.from(r.values()).map((t=>t.className));t.className=t.className.split(" ").filter((t=>!t.startsWith("bn-c-"))).concat(...s).join(" "),n(t)}})),Qt=n=>{const e=n.connectedCallback,s=n.disconnectedCallback;n.connectedCallback=()=>{const s=t(n);if(!s)throw new Error("Can't find element field in component undefined");(t=>{const n=Ht(t);Rt.apply(n);const e=Array.from(n.values()).map((t=>t.className));t.className=t.className.split(" ").filter((t=>!t.startsWith("bn-c-"))).concat(...e).join(" "),Kt.observe(t,{attributes:!0,attributeFilter:Pt,childList:!1,subtree:!1})})(s),r(e,n)},n.disconnectedCallback=()=>{r(s,n)}};export{p as $,w as A,vt as B,B as C,Ot as D,Dt as E,q as F,k as G,O as H,U as I,l as J,qt as K,mt as L,_t as M,nt as N,C as O,Tt as P,At as Q,A as R,D as S,Et as T,Mt as U,Jt as V,pt as W,Lt as X,Ft as Y,It as Z,jt as _,f as a,L as a0,J as a1,X as a2,d as a3,v as a4,h as a5,R as a6,N as a7,g as a8,F as a9,I as aa,V as ab,m as ac,$ as ad,j as ae,wt as af,kt as ag,St as ah,z as ai,bt as b,xt as c,ot as d,ct as e,ut as f,gt as g,K as h,lt as i,P as j,ft as k,dt as l,c as m,ht as n,Nt as o,$t as p,Wt as q,at as r,it as s,M as t,T as u,yt as v,Qt as w,H as x,tt as y,et as z}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{A as r}from"./p-DDo-fu3v.js";class a{adapt(a){return r.adaptDefaultString(a)}default(){return""}}export{a as S}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{p as t,H as i,h as s,d as h,t as e}from"./p-BnmylmXF.js";import{S as n,F as r,a as o,P as a}from"./p-CytMTBFu.js";import{C as l,g as c,b as u,h as d,e as f,R as p}from"./p-DFybNETX.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-CmvpJzLd.js";import{a as P,H as L,b as x,L as k,S as M}from"./p-CrZ_O3DT.js";import{S as C}from"./p-CeE4_3wQ.js";import{d as O,p as T,S as A}from"./p-BjgkgCAQ.js";import{N as $,r as N}from"./p-fCjsrD7I.js";import{I as D,S as _,D as E}from"./p-VtNvNyZK.js";import{D as j,w as Y}from"./p-BrQCbmG0.js";import{d as R,g as F}from"./p-6242qMx1.js";import{e as V,r as H}from"./p-ClruFZD_.js";import{D as B,b as W}from"./p-ja0FCkHB.js";import{a as X,I as z}from"./p-4q8nRcWC.js";import{s as I,c as G,a as U,b as q,l as K,d as Z,M as Q}from"./p-BTnRaHPb.js";import{D as J,b as tt}from"./p-dO0utE8m.js";import{A as it}from"./p-DDo-fu3v.js";import{S as st}from"./p-6gET6YXc.js";import{S as ht}from"./p-C-3TOa6K.js";class et{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 nt{adapt(t){const i=new et;return l.isNumber(t.scenarioOffset)&&(i.scenarioOffset=t.scenarioOffset),l.isNumber(t.scenarioLabelToColumn)&&(i.scenarioLabelToColumn=t.scenarioLabelToColumn),l.isNumber(t.labelToColumn)&&(i.labelToColumn=t.labelToColumn),l.isNumber(t.labelToAxis)&&(i.labelToAxis=t.labelToAxis),l.isNumber(t.needleWidth)&&(i.needleWidth=t.needleWidth),l.isNumber(t.needleHeadWidth)&&(i.needleHeadWidth=t.needleHeadWidth),l.isNumber(t.columnWidth)&&(i.columnWidth=t.columnWidth),l.isNumber(t.varianceAxisLineWidth)&&(i.varianceAxisLineWidth=t.varianceAxisLineWidth),l.isNumber(t.axisLineWidth)&&(i.axisLineWidth=t.axisLineWidth),l.isNumber(t.auxiliaryLineWidth)&&(i.auxiliaryLineWidth=t.auxiliaryLineWidth),l.isNumber(t.scenarioLineWidth)&&(i.scenarioLineWidth=t.scenarioLineWidth),l.isNumber(t.markerWidth)&&(i.markerWidth=t.markerWidth),l.isNumber(t.markerOffset)&&(i.markerOffset=t.markerOffset),l.isNumber(t.categoryWidth)&&(i.categoryWidth=t.categoryWidth),l.isNumber(t.axisTickLength)&&(i.axisTickLength=t.axisTickLength),i}default(){return new et}}class rt{constructor(t,i,s,h,e,n,r){this.categoryPosition={x:0,y:0},this.spacings=new et,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 ot{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 at{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 lt{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 ct{constructor(t,i,s,h){this.percentClamp=ct.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===vt.NEG?vt.NEG:"pos"===e||e===vt.POS?vt.POS:vt.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:vt.NEU===this.variance?vt.NEU:vt.POS===this.variance?vt.NEG:vt.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)}}ct.PERCENT_CLAMP=1.45;class ut{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 dt{constructor(){}adapt(t){const i=new ut;return l.isString(t.date)&&(i.date=this.parseDateString(t.date)),l.isOperator(t.operation)&&(i.operation=t.operation),l.isNumber(t.rowGroupIndex)&&l.isString(t.rowGroup)&&i.addRowGroup(t.rowGroup,t.rowGroupIndex),l.isNumber(t.categoryIndex)&&l.isString(t.category)&&i.addCategory(t.category,t.categoryIndex),l.isNumber(t.subCategoryIndex)&&l.isString(t.subCategory)&&i.addSubCategory(t.subCategory,t.subCategoryIndex),l.isNumber(t.columnGroupIndex)&&l.isString(t.columnGroup)&&i.addColumnGroup(t.columnGroup,t.columnGroupIndex),l.isNumber(t.columnSubGroupIndex)&&l.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=j.fromISO(t,{zone:"utc"});if(i.isValid)return i;console.warn(`TimeChartDataRow: invalid date value '${t}' - skipping row`)}default(){return new ut}setActualValues(t,i){l.isNumber(t.ac1)&&(i.ac1=t.ac1),l.isNumber(t.ac2)&&(i.ac2=t.ac2),l.isNumber(t.ac3)&&(i.ac3=t.ac3),l.isNumber(t.ac4)&&(i.ac4=t.ac4)}setPlanValues(t,i){l.isNumber(t.pl1)&&(i.pl1=t.pl1),l.isNumber(t.pl2)&&(i.pl2=t.pl2),l.isNumber(t.pl3)&&(i.pl3=t.pl3),l.isNumber(t.pl4)&&(i.pl4=t.pl4)}setPreviousPeriodValues(t,i){l.isNumber(t.pp1)&&(i.pp1=t.pp1),l.isNumber(t.pp2)&&(i.pp2=t.pp2),l.isNumber(t.pp3)&&(i.pp3=t.pp3),l.isNumber(t.pp4)&&(i.pp4=t.pp4)}setForecastValues(t,i){l.isNumber(t.fc1)&&(i.fc1=t.fc1),l.isNumber(t.fc2)&&(i.fc2=t.fc2),l.isNumber(t.fc3)&&(i.fc3=t.fc3),l.isNumber(t.fc4)&&(i.fc4=t.fc4)}}class ft{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 pt{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 ft(this.scaleFactorsStructureChartAdapter.default(),this.fontStyleAdapter.default(),this.svgStyleGroupAdapter.default(),this.svgStyleGroupAdapter.default(),this.svgVariancesStyleGroupAdapter.default(),this.paddingadapter.default());return l.isExisting(t)&&(l.isExisting(t.scaleFactors)&&(i.scaleFactors=this.scaleFactorsStructureChartAdapter.adapt(t.scaleFactors)),l.isExisting(t.fontStyles)&&(i.fontStyles=this.fontStyleAdapter.adapt(t.fontStyles)),l.isExisting(t.axisStyles)&&(i.axisStyles=this.svgStyleGroupAdapter.adapt(t.axisStyles)),l.isExisting(t.barStyles)&&(i.barStyles=this.svgStyleGroupAdapter.adapt(t.barStyles)),l.isExisting(t.varianceStyles)&&(i.varianceStyles=this.svgVariancesStyleGroupAdapter.adapt(t.varianceStyles)),l.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 at(i.fontStyles.size).createPatternMapForStructureBar()),i}default(){return new ft(this.scaleFactorsStructureChartAdapter.default(),this.fontStyleAdapter.default(),this.svgStyleGroupAdapter.default(),this.svgStyleGroupAdapter.default(),this.svgVariancesStyleGroupAdapter.default(),this.paddingadapter.default())}}var vt,wt;!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"}(vt||(vt={})),function(t){t.LIST="LIST",t.SUM="SUM",t.OPT="OPT"}(wt||(wt={}));class mt{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 bt{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 C){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 a=`M ${h} ${e+n}`;for(let t=0;t<3;t++)a+=` 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(a).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,a=this.position.getColumnPositionY();return{clipped:!1,columnLength:e,xPos:this.position.getColumnPositionX(i,s),yPos:a-e,labelYPos:a-o-this.position.spacings.labelToColumn,scenarioLabelXPos:this.position.getColumnPositionX(i,s)+this.position.getScenarioLabelPositionOffsetX(s),scenarioLabelYPos:a-.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 C){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 gt{constructor(t,i,s,h,e,n,r,o,a){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,a),this.scenarioLabel=this.getScenarioLabel(o,e,a))}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 yt{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"),a=this.convertToSVGStyle(this.styles.varianceStyles.ac,"fill"),l=this.barStyles[this.dataPoint.getScenario()];if(null!=l&&l.fillpattern){const t=this.styles.pattern.get(l.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,a),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}}class St{constructor(t,i,s,h,e,n,r,o,a=null,l){this.lineSlot=l,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=a}draw(t={percent:2,decimal:1},i=new C){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 C){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 D[h]||D.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),a=this.position.getColumnPositionY()-e.dataPoint.getScaledUnit(),l=i.line([[n,r],[o,a]]).stroke({color:t.lineColor,width:this.LINE_WIDTH,linecap:"round"}).fill("none");t.lineDashArray&&l.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?[x.Below,x.Left,x.Right,x.Above]:[x.Above,x.Left,x.Right,x.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,a=r-this.MARKER_SIZE/2-2,l=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,a=i.labelY,l=i.verticalHook,c=i.horizontalHook;const u=Object.assign(Object.assign({},i.bounds),{scenarioType:s});this.collisionManager.register(u)}new P(this.labelGroup,o,a,this.ID_LABEL_PREFIX,e.dataPoint.value,this.styles,l,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 Pt{constructor(t,i,s,h,e,n,r,o,a,l,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=a,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 C){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),a=this.position.getColumnWidth(),l=this.styles.stackColors,u=l[this.segmentIndex%l.length],d={color:u},f={color:u,width:.5};if(this.columnGroup.attr(O(this.dataPoint.key,"element")),this.columnGroup.rect(a,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 C,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 Lt=[{fill:"#000000",opacity:.3},{fill:"#555555",opacity:.25},{fill:"#999999",opacity:.2},{fill:"#bbbbbb",opacity:.15},{fill:"#dddddd",opacity:.1}];class xt{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=_[s]||_.ac;t=h.fill,i=h.opacity}else{const s=Math.min(this.segmentIndex,Lt.length-1);t=Lt[s].fill,i=Lt[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=_[s]||_.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 C){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 C){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 Mt{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 bt(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 bt(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 yt(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 bt(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 gt(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 gt(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 St(this.position,this.styles,t,h,e,i,n,this.i18n,this.collisionManager,s)}}const Ct="bn-measurement-host";function Ot(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 Tt,At;!function(t){t[t.UP_TO_DATE=0]="UP_TO_DATE",t[t.DIRTY=1]="DIRTY"}(Tt||(Tt={})),function(t){t.RELATIVE="dr",t.ABSOLUTE="d",t.NONE=""}(At||(At={}));class $t{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 ct(0,vt.AC1,1,vt.NEU),this.highestDataPointValue=new ct(0,vt.AC1,1,vt.NEU),this.smallestVarianceDataPointValue=new ct(0,vt.AC1,1,vt.NEU),this.highestVarianceDataPointValue=new ct(0,vt.AC1,1,vt.NEU),this.pixelPerUnit=1,this.pixelPerPercentage=1,this.hideAxisLabels=!1,this.axisScenario=vt.AC1,this.fromExpr="",this.rowCount=0,this.axisCategoryArea={width:0,height:0},this.scenariosArea={width:0,height:0},this.state=Tt.DIRTY,this.i18n=new Map,this.leftSideOffsetForHorizontalSync=-1,this.dateInterval=B.DAY,this.locale="de",this.axisLabelsMode=u.SMART,this.intervalSpanLimit=32,this.measureScale=new C,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=Tt.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=I(t),{scenario:s,variance:h}=this.highestDataPointValue;this.highestDataPointValue=new ct(i.positive,s,this.pixelPerUnit,h),this.smallestDataPointValue=new ct(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=Tt.DIRTY,this.queryError=void 0,this.fromExpr=R(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=V(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($t.hasValue(s[t])){if($t.hasValue(s.scenario1))return!1;i++}return i>0})):[]}visibleSlot(t,i){var s;return $t.hasValue(t.scenario1)?"scenario1":null!==(s=i.find((i=>$t.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(ct.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 G({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 U({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;Ot(t,(()=>this.draw(t)))}toString(){const t=new n;return Ot(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===Tt.DIRTY&&(this.state=Tt.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=Tt.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 ct(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 et;Object.assign(s,h),s.categoryWidth=i,r=s}}return new rt(new ot(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=vt.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=vt.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!==B.AUTO)return t;const i=this.queryDates();if(0===i.length)return B.DAY;let s=i[0],h=i[0];for(const t of i)t<s&&(s=t),t>h&&(h=t);return(new W).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=>$t.coerceDateTime(t.date))).filter((t=>null!=t))}static coerceDateTime(t){if(null!=t){if("string"==typeof t){const i=j.fromISO(t,{zone:"utc"});return i.isValid?i:void 0}if("number"==typeof t){const i=j.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 ct(t[i[0]],i[0],this.pixelPerUnit,vt.NEU),scenario2:new ct(t[i[1]],i[1],this.pixelPerUnit,vt.NEU),scenario3:new ct(t[i[2]],i[2],this.pixelPerUnit,vt.NEU),scenario4:new ct(t[i[3]],i[3],this.pixelPerUnit,vt.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:$t.pointDate(t.date),scenario:null!==(s=i.scenario)&&void 0!==s?s:void 0});return h}static pointDate(t){var i;return T(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 ct(0,"default",i,vt.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 ct(0,"default",i,vt.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,a="dr"===n.type?this.pixelPerPercentage:this.pixelPerUnit;for(const h in i){const l=new ct(this.calculateVariance(n,i[h],r),n.delta,a,o);null===l.value||Number.isNaN(l.value)||(l.key={date:$t.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:l,scenario2:new ct(null,null,null,null),scenario3:new ct(null,null,null,null),scenario4:new ct(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,a=0;for(const{variance:i,name:e}of n){const n=this.calculateVariance(i,t,this.mapScenarios(i,h));null===n||Number.isNaN(n)||(a++,null==s&&(s=new ct(n,i.delta,o,i.direction),s.notation=i.base.slice(0,2),s.key={date:$t.pointDate(t.date),scenario:e}))}a>1&&this.varianceOverlaps++,e.push({id:i,category:t.category,type:r?At.RELATIVE:At.ABSOLUTE,date:t.date,scenario1:null!=s?s:new ct(null,n[0].variance.delta,o,n[0].variance.direction),scenario2:new ct(null,null,null,null),scenario3:new ct(null,null,null,null),scenario4:new ct(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?N(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 W;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=q(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 a=s.getDateString(t.date,this.dateInterval);this.axisLabelsMode===u.SMART?(a=s.getSmartDateString(t.date,this.dateInterval),0===i&&this.dateInterval!==B.YEAR&&(a=s.getShortDateString(t.date,this.dateInterval))):this.axisLabelsMode===u.SHORT&&(a=s.getShortDateString(t.date,this.dateInterval)),new P(h,this.position.getColumnCenterPositionX(i),this.position.getAxisPositionY(e)+r,"",a,this.styles,n,L.Center).forceStringTypeDraw()}));else{const i=null==t?void 0:t[0];i&&i.type===At.RELATIVE&&(e=!0)}new mt({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 Mt(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 k,r=new Mt(this.position,e,this.scenarioStyles(),t.length,this.i18n);r.setCollisionManager(n);const o=["ac1","pp1","fc1","pl1"],a=[[],[],[],[]];t.forEach(((t,i)=>{["scenario1","scenario2","scenario3","scenario4"].forEach(((s,h)=>{t[s]&&a[h].push({dataPoint:t[s],index:i})}))}));const l=[];for(let t=0;t<a.length;t++){const i=a[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();l.push({points:i,scenarioName:e,scenarioType:n})}}l.sort(((t,i)=>(M[i.scenarioType]||99)-(M[t.scenarioType]||99)));const c=[];for(const t of l){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)=>(M[t.scenarioType]||99)-(M[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:a}=this.dateLabelPlace(i);let l;this.lineFullWidth&&this.availableWidth>0?this.axisLabelsMode===u.SMART?(l=s.getSmartDateString(i.date,this.dateInterval),0===r&&this.dateInterval!==B.YEAR&&(l=s.getShortDateString(i.date,this.dateInterval))):l=this.axisLabelsMode===u.SHORT?s.getShortDateString(i.date,this.dateInterval):s.getDateString(i.date,this.dateInterval):l=s.getShortDateString(i.date,this.dateInterval),new P(h,this.position.getColumnCenterPositionX(r),this.position.getAxisPositionY(e)+a,"",l,this.styles,o,L.Center).forceStringTypeDraw(),r>0&&r<n&&this.isYearChange(t,r)&&this.drawYearSeparatorLine(h,r,e)})),new mt({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===B.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:E}).attr("stroke-dasharray",E)}drawVarianceScenario(t,i){const s=i.group().id("Scenarios"),h=new Mt(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:K(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=X(i.scenario);t.has(s)||t.set(s,[]),t.get(s).push(i)}if(t.size>1){const i=[];for(const s of z)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,a)=>{const l=new Pt(this.position,this.styles,t.dataPoint,i,n.layout.segments[a],t.scenario,e.length>1?e.length-1-r:a,this.stackConfig.mode,n.layout,h,s);l.draw(this.dataFormatDigits,this.measureScale),o=l})),o&&n.hasValue&&o.drawTotalLabel(this.dataFormatDigits,this.measureScale,{date:$t.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 a=i.indexOf(null!==(n=null===(e=t[0][s])||void 0===e?void 0:e.scenario)&&void 0!==n?n:""),l=i.indexOf(null!==(o=null===(r=t[0][h])||void 0===r?void 0:r.scenario)&&void 0!==o?o:"");return(-1===a?i.length:a)-(-1===l?i.length:l)}))}for(const i of o){const s=t[0][i];r.push((null==s?void 0:s.scenario)||"ac1")}const a=(t,i)=>{const s=t[i];return s&&!s.isEmpty()&&Number.isFinite(s.value)?s.value:0},l=o.map((i=>t.reduce(((t,s)=>t+a(s,i)),0)<0?-0:0)),u=e===c.RELATIVE?p:0,d=t.map((t=>K(o.map(((i,s)=>a(t,i)||l[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 xt(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 Mt(this.position,s,this.scenarioStyles(),t.length,this.i18n);if(!0===this.showOverlayAvg){let i=null;const s=function(t){const i=Nt(t),s=i.length>0?i.reduce(((t,i)=>t+i),0)/i.length:NaN,h=Object.assign(Object.assign({},t[0]),{scenario1:new ct(s,t[0].scenario1.scenario,t[0].scenario1.pixelPerUnit,t[0].scenario1.variance)}),e=Object.assign(Object.assign({},t[t.length-1]),{scenario1:new ct(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 ct(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=Nt(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 ct(s,t[0].scenario1.scenario,t[0].scenario1.pixelPerUnit,t[0].scenario1.variance)}),e=Object.assign(Object.assign({},t[t.length-1]),{scenario1:new ct(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 ct(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=j.max(...s),e=j.min(...s),n=new W;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 Nt(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=B.AUTO,this.axisLabelsMode=u.SMART,this.intervalSpanLimit=28,this.filter="",this.measureScale=new C,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 _t{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=it.adaptArray(t.data,this.dataRowAdapter),s=it.adaptArray(t.scenarios,this.stringAdapter),h=new Dt(i,s);return l.isArray(t.variances)&&(h.variances=it.adaptArray(t.variances,this.stringAdapter)),l.isString(t.title)&&(h.title=t.title),l.isBoolean(t.hideAxisLabels)&&(h.hideAxisLabels=t.hideAxisLabels),l.isNumber(t.pixelPerUnit)&&(h.pixelPerUnit=t.pixelPerUnit),l.isNumber(t.pixelPerPercentage)&&(h.pixelPerPercentage=t.pixelPerPercentage),l.isExisting(t.dateInterval)&&(h.dateInterval=t.dateInterval),l.isExisting(t.axisLabelsMode)&&(h.axisLabelsMode=t.axisLabelsMode),l.isNumber(t.leftSideOffsetForHorizontalSync)&&(h.leftSideOffsetForHorizontalSync=t.leftSideOffsetForHorizontalSync),l.isNumber(t.intervalSpanLimit)&&(h.intervalSpanLimit=t.intervalSpanLimit),l.isString(t.filter)&&(h.filter=t.filter),l.isExisting(t.measureScale)&&(h.measureScale=J.calculateMeasureScale(this.db,this.fromExpr,h.scenarios,t.measureScale,this.onQueryError)),l.isString(t.measureUnit)&&(h.measureUnit=t.measureUnit),l.isBoolean(t.showMeasureScale)&&(h.showMeasureScale=t.showMeasureScale),l.isExisting(t.dataFormatDigits)&&(h.dataFormatDigits=this.dataFormatDigitsAdapter.adapt(t.dataFormatDigits)),l.isBoolean(t.showOverlayAvg)&&(h.showOverlayAvg=t.showOverlayAvg),l.isBoolean(t.showOverlayMedian)&&(h.showOverlayMedian=t.showOverlayMedian),l.isExisting(t.chartMode)&&(h.chartMode=t.chartMode),l.isNumber(t.maxBars)&&(h.maxBars=t.maxBars),l.isExisting(t.stackConfig)&&(h.stackConfig=t.stackConfig),l.isBoolean(t.lineFullWidth)&&(h.lineFullWidth=t.lineFullWidth),l.isNumber(t.axisLabelsStep)&&t.axisLabelsStep>=1&&(h.axisLabelsStep=t.axisLabelsStep),l.isBoolean(t.scenarioSwitch)&&(h.scenarioSwitch=t.scenarioSwitch),l.isString(t.axisTitlePosition)&&(h.axisTitlePosition=t.axisTitlePosition),l.isString(t.locale)&&(h.locale=t.locale),h}default(){return new Dt([],[])}}const Et=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=B.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},Y(this)}getDb(){return this.stores||(this.stores=F(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(),H(this.errors,this.queryError);const o=`WARN_variances_overlap_${this.variances.join("_")}`,a=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=a>0?o:void 0,a>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 ${a} 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 $t(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 lt(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 lt(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,a=()=>{this.chart=new $t(new b(this.ruleSetConfig),this.getDb(),this.tableName,t,i,o),this.chart.setI18n(this.i18n)},l=()=>(this.chart.layout(),this.chart.getAllocatedCanvasHeight());if(!r||r<=0)return h&&(t.pixelPerUnit=1),e&&(t.pixelPerPercentage=50),a(),void n();h&&(t.pixelPerUnit=1),e&&(t.pixelPerPercentage=1),a();let c=l();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=Z({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),a(),c=l(),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&&a(),n()}async componentWillRender(){}componentDidLoad(){}componentDidUpdate(){}prepareConfig(){var t,i,s;const h=this.getDb(),e=R(h,this.tableName,this.filter);return this.measureScaleError=void 0,new _t(new dt,new st,new tt,h,e,(t=>{this.measureScaleError=V(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 pt(new nt,new r,new o(new A),new ht(new A),new a).adapt(this.styles);return s.locale=(null===(i=null===(t=F(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 jt(){"undefined"!=typeof customElements&&["bn-chart-time-renderer"].forEach((t=>{"bn-chart-time-renderer"===t&&(customElements.get(e(t))||customElements.define(e(t),Et))}))}export{Et as B,jt as d}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{S as n}from"./p-6242qMx1.js";const t=/^[a-z][a-z0-9-]*$/i;function o(o,r){var l,a;const e=null!==(l=null==r?void 0:r.color)&&void 0!==l?l:n["bn-annotation"].color,i=null!==(a=null==r?void 0:r.colors)&&void 0!==a?a:{},u=`var(--bn-annotation-color, ${e})`;if(!o||!t.test(o))return u;const c=Object.prototype.hasOwnProperty.call(i,o)?i[o]:void 0;return`var(--bn-annotation-color-${o}, ${null!=c?c:u})`}const r=n=>"string"==typeof n||"number"==typeof n?String(n):void 0;function l(n){var t;return null===(t=e(n))||void 0===t?void 0:t.map((n=>{var t;return Object.assign(Object.assign({},n),{label:r(n.label),color:r(n.color),target:null!==(t=r(n.target))&&void 0!==t?t:"",to:r(n.to)})}))}function a(n){var t;return null===(t=e(n))||void 0===t?void 0:t.map((n=>({label:r(n.label),title:r(n.title),html:r(n.html)})))}function e(n){if(null==n||""===n.trim())return[];try{const t=JSON.parse(n);if(Array.isArray(t)&&t.every((n=>null!==n&&"object"==typeof n)))return t}catch(n){}}const i=new WeakMap;let u=1;function c(n){const t=n.closest("bn-layout-page");if(!t)return"";let o=i.get(t);return o||(o="page-"+u++,i.set(t,o)),o}export{c as a,o as b,l as c,a as p}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g as n,c as o,R as t}from"./p-6242qMx1.js";import{f as e,c as r}from"./p-BnmylmXF.js";import{r as i}from"./p-BrQCbmG0.js";import{i as s}from"./p-Dw3rv_Y9.js";const l="inherited-page",u="bn-layout-page";function a(n){return"inherited-closest"===n||n===l}function c(n,o){const t=[];let e=n.parentNode;for(;e;){const n=e.nodeName.toLowerCase();if(n===u){t.push(e);break}if("bn-layout-card"===n&&o!==l&&t.push(e),e.parentNode)e=e.parentNode;else{if(!(e instanceof ShadowRoot))break;e=e.host}}return t}function d(n,o){var t;const e=n=>{const t=n.getAttribute(o),e=null==t?void 0:t.trim();return s(e)||a(e)?void 0:t};for(const r of n){if((null===(t=r.getAttribute(o))||void 0===t?void 0:t.trim())===l){const o=n.find((n=>n.nodeName.toLowerCase()===u)),t=o&&e(o);if(void 0!==t)return t;continue}const i=e(r);if(void 0!==i)return i}}const v=(n,o,t)=>{const s=new Map,u=new Map;let v=null;const f=()=>{var t;const i=r(n);s.clear(),u.clear(),v&&(v.disconnect(),v=null);const l=new Map;for(const e of o){const o=n[e.propName];if("string"!=typeof o||!a(o))continue;u.set(e.propName,o);const r=c(i,o),v=d(r,e.ancestorAttr);void 0!==v&&s.set(e.propName,v);for(const n of r)l.set(n,[...null!==(t=l.get(n))&&void 0!==t?t:[],e.ancestorAttr])}if(l.size>0){v=new MutationObserver((()=>{f(),e(n)}));for(const[n,o]of l)v.observe(n,{attributes:!0,attributeFilter:o})}},p=n.connectedCallback;n.connectedCallback=()=>{f(),i(p,n)};const m=n.disconnectedCallback;n.disconnectedCallback=()=>{v&&(v.disconnect(),v=null),s.clear(),u.clear(),i(m,n)};const b=n=>{var t;return null===(t=o.find((o=>o.propName===n)))||void 0===t?void 0:t.ancestorAttr.replace(/-(\w)/g,((n,o)=>o.toUpperCase()))};return(n,o,e)=>{const r=`WARN_inherited_${n}`,i=a(o);i&&u.get(n)!==o&&f();const c=i?s.get(n):void 0;return i&&void 0===c?(null==t||t.addOrReplace({id:r,type:"warning",message:`${n}: '${o}' could not be resolved, no surrounding ${o===l?"page":"card or page"} sets ${b(n)}`}),{value:e,inherited:!1,unresolved:!0}):(null==t||t.remove(r),{value:null!=c?c:o,inherited:void 0!==c,unresolved:!1})}},f=s=>{let l,u,a,c,d=null;const v=()=>{const n=r(s);if(d&&(d.disconnect(),d=null),a=s.i18nNamespace,u=a,null!=u)return;const o=function(n){let o=n.parentNode;for(;o;){if(o instanceof HTMLElement&&o.hasAttribute("i18n-namespace"))return o;if(o.parentNode)o=o.parentNode;else{if(!(o instanceof ShadowRoot))break;o=o.host}}}(n);o&&(u=o.getAttribute("i18n-namespace"),d=new MutationObserver((()=>{v(),e(s)})),d.observe(o,{attributes:!0,attributeFilter:["i18n-namespace"]}))},f=s.connectedCallback;s.connectedCallback=()=>{const o=r(s);c=n(o),v(),l=c.internationalization.on("set",(n=>{n!==u&&"_system"!==n||e(s)})),i(f,s)};const p=s.disconnectedCallback;return s.disconnectedCallback=()=>{d&&(d.disconnect(),d=null),i(l),o(r(s)),i(p,s)},{t:(n,o)=>{var e,i,l,d,f;void 0!==c&&s.i18nNamespace!==a&&v(),n.startsWith(".")&&(n=r(s).localName+n),Object.prototype.hasOwnProperty.call(t,n)&&(n=t[n]);const p=c.internationalization.state,m=c.context.state.locale,b=null!==(l=null===(i=null===(e=p[u])||void 0===e?void 0:e[m])||void 0===i?void 0:i[n])&&void 0!==l?l:null===(f=null===(d=p._system)||void 0===d?void 0:d[m])||void 0===f?void 0:f[n];return null==b?n:b.replace(/{{([\s\S]+?)}}/g,((n,t)=>{var e;return null!==(e=null==o?void 0:o[t.trim()])&&void 0!==e?e:""}))}}};export{v as a,c as f,a as i,d as r,f as w}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{p as t,H as e,h as i,d as s,t as a}from"./p-BnmylmXF.js";import{v as r,a as n,b as o,c as d,d as l,e as h,i as v,f as u,g as p}from"./p-Dw3rv_Y9.js";import{w as m,D as c}from"./p-BrQCbmG0.js";import{w as f}from"./p-CUoPUIej.js";import{a as b,g}from"./p-6242qMx1.js";import{w as D}from"./p-D_K7tYhY.js";import{w as y}from"./p-JG4Sx1lE.js";import{r as w}from"./p-CmvpJzLd.js";import{w as S}from"./p-DRmphEA0.js";import{w as k}from"./p-D32TsLzd.js";import{I as j}from"./p-DFybNETX.js";import{a as E}from"./p-j42D1yrQ.js";import{a as N,D as R}from"./p-ja0FCkHB.js";import{d as _}from"./p-B1_wkOLx.js";const F=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.businessUnit="",this.order="category",this.orderDirection="asc",this.dateFormat="none",this.dateLink="none",D(this),m(this),this.t=f(this).t,this.errors=k(this),this.componentStyle=y(this),this.ruleSetConfig=S(this)}validateScenario(t){const e="WARN_scenarios",i=r(t);i.length>0?this.errors.addOrReplace({id:e,type:"warning",message:"scenarios: invalid value(s) '"+(null==i?void 0:i.toString())+"' are not supported."}):this.errors.remove(e)}validateVariances(t){const e="WARN_variances",i=n(t);i.length>0?this.errors.addOrReplace({id:e,type:"warning",message:"variances: invalid value(s) '"+(null==i?void 0:i.toString())+"' are not supported."}):this.errors.remove(e)}validateOrder(t){const e=o(t),i="WARN_order";e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"order: invalid value(s) '"+(null==e?void 0:e.toString())+"' are not supported."}):this.errors.remove(i)}validateOrderDirection(t){const e="WARN_orderDirection";d(t)?this.errors.remove(e):this.errors.addOrReplace({id:e,type:"warning",message:"orderDirection: invalid value '"+(null==t?void 0:t.toString())+"' is not supported."})}validateMeasures(t){const e="WARN_measures",i=l(t);i.length>0?this.errors.addOrReplace({id:e,type:"warning",message:"measures: invalid value(s) '"+(null==i?void 0:i.toString())+'\' are not supported. Valid format example: [{"name": "Bruttoumsatz", "unit": "mEUR"}]'}):this.errors.remove(e)}validateDateStart(t){const e="WARN_dateStart";h(t)||v(t)?this.errors.remove(e):this.errors.addOrReplace({id:e,type:"warning",message:"dateStart: invalid value '"+(null==t?void 0:t.toString())+"' is not supported."})}validateDateEnd(t){const e="WARN_dateEnd";h(t)||v(t)?this.errors.remove(e):this.errors.addOrReplace({id:e,type:"warning",message:"dateStart: invalid value '"+(null==t?void 0:t.toString())+"' is not supported."})}validateDateFormat(t){const e="WARN_dateFormat";u(t)||v(t)?this.errors.remove(e):this.errors.addOrReplace({id:e,type:"warning",message:"dateFormat: invalid value '"+(null==t?void 0:t.toString())+"' is not supported."})}validateDateLink(t){const e="WARN_dateLink";p(t)||v(t)?this.errors.remove(e):this.errors.addOrReplace({id:e,type:"warning",message:"dateLink: invalid value '"+(null==t?void 0:t.toString())+"' is not supported."})}componentWillLoad(){this.validateScenario(this.scenarios),this.validateVariances(this.variances),this.validateMeasures(this.measures),this.validateDateStart(this.dateStart),this.validateDateEnd(this.dateEnd),this.validateDateFormat(this.dateFormat),this.validateDateLink(this.dateLink),this.validateOrderDirection(this.orderDirection),this.validateOrder(this.order)}prepareI18n(){const t=b,e=new Map(["SEPARATOR_WS","in","CONNECTOR_WS"].map((t=>[t,this.t(".".concat(t))]))),i=new Map(t.map((t=>[t,this.t("global.".concat(t))])));return new Map([...i.entries(),...e.entries(),...w(this.ruleSetConfig("user"))])}prepareI18nMode(){return j.META}prepareLocale(){return g(this.element).context.state.locale||"de"}prepareTitleOrder(){var t;return v(this.order)||v(this.orderDirection)?null:{hierarchy:this.order.split(",").map((t=>t.trim())),direction:E[null===(t=this.orderDirection)||void 0===t?void 0:t.toUpperCase()]}}prepareTitleTimePeriod(){var t,e;return v(this.dateStart)&&v(this.dateEnd)||v(this.dateLink)?null:{start:c.fromISO(this.dateStart,{zone:"utc"}),end:c.fromISO(this.dateEnd,{zone:"utc"}),format:R[null===(t=this.dateFormat)||void 0===t?void 0:t.toUpperCase()],link:N[null===(e=this.dateLink)||void 0===e?void 0:e.toUpperCase()]}}prepareMeasures(){if(v(this.measures))return[];try{return JSON.parse(this.measures)}catch(t){return[]}}prepareScenarios(){var t,e,i,s;if(v(this.scenarios)&&v(this.variances))return[];let a=[];return(null===(t=this.scenarios)||void 0===t?void 0:t.trim().length)>0&&(a=a.concat(null===(e=this.scenarios)||void 0===e?void 0:e.split(","))),(null===(i=this.variances)||void 0===i?void 0:i.trim().length)>0&&(a=a.concat(null===(s=this.variances)||void 0===s?void 0:s.split(","))),a.map((t=>t.trim()))}prepareBusinessUnit(){return v(this.businessUnit)||"null"===this.businessUnit?null:this.businessUnit}getFontStyles(){return this.componentStyle((t=>{var e,i,s,a;return{"--bn-font-family":(null===(e=t.global)||void 0===e?void 0:e.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":`${this.titleFontSize>0?this.titleFontSize:(null===(i=t.global)||void 0===i?void 0:i.fontSizePx)||13.3333}px`,"--bn-font-color":(null===(s=t.global)||void 0===s?void 0:s.fontColor)||"#000000","--bn-font-background":(null===(a=t.global)||void 0===a?void 0:a.fontBackgroundColor)||"#ffffff"}}))}render(){const t=this.getFontStyles();return i(s,{key:"999f282ecc2901b62f051e0501da7dd41f44a30a",style:t},i("bn-title-renderer",{key:"2c58cbb472fc807a83503e7789babce4b17b1081",businessUnit:this.prepareBusinessUnit(),scenarios:this.prepareScenarios(),measures:this.prepareMeasures(),timeperiod:this.prepareTitleTimePeriod(),order:this.prepareTitleOrder(),i18n:this.prepareI18n(),"i18n-mode":this.prepareI18nMode(),locale:this.prepareLocale(),ruleSetConfig:this.ruleSetConfig()}))}get element(){return this}static get watchers(){return{scenarios:[{validateScenario:0}],variances:[{validateVariances:0}],order:[{validateOrder:0}],orderDirection:[{validateOrderDirection:0}],measures:[{validateMeasures:0}],dateStart:[{validateDateStart:0}],dateEnd:[{validateDateEnd:0}],dateFormat:[{validateDateFormat:0}],dateLink:[{validateDateLink:0}]}}static get style(){return':host{padding:0.5em;margin-bottom:0.5em;box-sizing:border-box;-webkit-box-sizing:border-box;width:100%;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)}'}},[1,"bn-title",{selectedStyle:[513,"selected-style"],i18nNamespace:[513,"i18n-namespace"],ruleset:[513],titleFontSize:[2,"title-font-size"],businessUnit:[1,"business-unit"],scenarios:[1],variances:[1],order:[1],orderDirection:[1,"order-direction"],measures:[1],dateStart:[1,"date-start"],dateEnd:[1,"date-end"],dateFormat:[1,"date-format"],dateLink:[1,"date-link"]},void 0,{scenarios:[{validateScenario:0}],variances:[{validateVariances:0}],order:[{validateOrder:0}],orderDirection:[{validateOrderDirection:0}],measures:[{validateMeasures:0}],dateStart:[{validateDateStart:0}],dateEnd:[{validateDateEnd:0}],dateFormat:[{validateDateFormat:0}],dateLink:[{validateDateLink:0}]}]);function L(){"undefined"!=typeof customElements&&["bn-title","bn-title-renderer"].forEach((t=>{switch(t){case"bn-title":customElements.get(a(t))||customElements.define(a(t),F);break;case"bn-title-renderer":customElements.get(a(t))||_()}}))}export{F as T,L as d}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{p as t,H as i,h as s,d as n,t as e}from"./p-BnmylmXF.js";import{r as h,m as o,g as r,d as a}from"./p-6242qMx1.js";import{C as l,I as d}from"./p-CmvpJzLd.js";import{w as c}from"./p-BrQCbmG0.js";import{e as u,r as m}from"./p-ClruFZD_.js";import{S as v,F as f,a as p,P as w}from"./p-CytMTBFu.js";import{d as y,S as g}from"./p-BjgkgCAQ.js";import{X as x,r as b,a as M,x as $,f as L,b as j,c as C,P as k,F as S,d as P,S as T}from"./p-CG-iY7pQ.js";import{N as W}from"./p-BJmwHV0a.js";import{a as z,r as D,i as N}from"./p-Dyzb4ika.js";import{s as B}from"./p-Xb6Ilq8u.js";class E{constructor(t,i){this.xScale=t,this.yScale=i}isPositiveDomain(){return this.xScale.domainMin>0&&this.yScale.domainMin>0}static autoK(t){const i=t.filter((t=>t>0)).sort(((t,i)=>t-i));if(0===i.length)return[];const s=t=>i[Math.min(i.length-1,Math.floor(t*i.length))];let n=E.ladderValues(s(.25),s(.75));if(n.length<2&&(n=E.ladderValues(i[0],i[i.length-1])),0===n.length)return[];if(1===n.length)return n;if(n.length<=4)return n;const e=[];for(let t=0;t<4;t++)e.push(n[Math.round(t*(n.length-1)/3)]);return[...new Set(e)]}static ladderValues(t,i){if(t<=0||i<t)return[];const s=[];for(let n=Math.floor(Math.log10(t))-1;n<=Math.ceil(Math.log10(i));n++)for(const e of[1,2,5]){const h=e*Math.pow(10,n);h>=t&&h<=i&&s.push(h)}return s}visibleRange(t){if(!this.isPositiveDomain()||t<=0)return null;const i=Math.max(this.xScale.domainMin,t/this.yScale.domainMax),s=Math.min(this.xScale.domainMax,t/this.yScale.domainMin);return i>=s?null:[i,s]}samples(t){const i=this.visibleRange(t);if(null===i)return null;const[s,n]=i,e=[];for(let i=0;i<64;i++){const h=s*Math.pow(n/s,i/63);e.push({x:this.xScale.scale(h),y:this.yScale.scale(t/h)})}return e}path(t){const i=this.samples(t);return null===i?null:i.map(((t,i)=>`${0===i?"M":"L"} ${t.x} ${t.y}`)).join(" ")}exitPoint(t){const i=this.visibleRange(t);if(null===i)return null;const s=i[1],n=s>=this.xScale.domainMax-1e-9*Math.abs(this.xScale.domainMax);return{x:this.xScale.scale(s),y:this.yScale.scale(t/s),edge:n?"right":"bottom"}}regionPath(t){if(!this.isPositiveDomain()||t<=0)return null;const i=this.xScale.domainMin,s=this.xScale.domainMax,n=this.yScale.domainMin,e=this.yScale.domainMax,h=this.xScale.scale(i),o=this.xScale.scale(s),r=this.yScale.scale(e),a=this.yScale.scale(n);if(t>=s*e)return null;if(t<=i*n)return`M ${h} ${r} L ${o} ${r} L ${o} ${a} L ${h} ${a} Z`;const l=this.samples(t),[d,c]=this.visibleRange(t),u=d>i,m=c>=s-1e-9*Math.abs(s),v=l.map(((t,i)=>`${0===i?"M":"L"} ${t.x} ${t.y}`));return m||v.push(`L ${o} ${a}`),v.push(`L ${o} ${r}`),u||v.push(`L ${h} ${r}`),v.push("Z"),v.join(" ")}}class F{constructor(t,i,s,n,e,h){var o,r;this.ruleSet=t,this.config=n,this.styles=e,this.availableWidth=h,this.warnings=[],this.canvasHeight=0,this.i18nMap=new Map,this.config=Object.assign(Object.assign({},n),{x:z(n.x),y:z(n.y)});const a=new x;let l=[];try{""!==s&&(l=i.exec(`SELECT * FROM ${s}`))}catch(t){this.queryError=u(t)}const d=(null!=l?l:[]).map((t=>a.adapt(t)));this.data=b(d,{pointLevel:n.pointLevel,seriesLevel:n.seriesLevel,facetLevel:null!==n.facet?"rowgroup"===n.facet.level?"rowGroup":"category":null,measures:{x:null!==(o=D(n.x.measure))&&void 0!==o?o:{kind:"scenario",slot:"ac1"},y:null!==(r=D(n.y.measure))&&void 0!==r?r:{kind:"scenario",slot:"ac2"}},domains:{x:{min:this.config.x.min,max:this.config.x.max},y:{min:this.config.y.min,max:this.config.y.max}},limit:n.limit,limitBy:"order"}),this.warnings.push(...this.data.warnings)}get em(){return this.styles.fontStyles.size}get xPercent(){return N(this.config.x.measure)}get yPercent(){return N(this.config.y.measure)}fontFamily(){return this.styles.fontStyles.font.replace(/^[\d.]+px\s*/,"")}textWidth(t,i=!1){const s=l(t,{font:this.styles.fontStyles.font,fontSize:this.styles.fontStyles.size+"px",fontWeight:i?"bold":"normal"}).width;return Number.isFinite(s)&&s>0?s:.6*t.length*this.em}drawText(t,i,s,n,e={}){var h,o,r;return t.text(i).font({size:null!==(h=e.size)&&void 0!==h?h:this.styles.fontStyles.size,weight:e.bold?"bold":"normal",anchor:null!==(o=e.anchor)&&void 0!==o?o:"start"}).fill(null!==(r=e.color)&&void 0!==r?r:this.styles.fontStyles.color).attr({x:s,y:n,"font-family":this.fontFamily()})}hasNoData(){return 0===this.data.totalPoints}getWarnings(){return this.warnings}getQueryError(){return this.queryError}getAllocatedCanvasWidth(){return this.availableWidth}getAllocatedCanvasHeight(){return this.canvasHeight}axisTitle(t,i){var s;const n=null!==(s=t.label)&&void 0!==s?s:"";return""===n?"":void 0===t.unit||""===t.unit?n:`${n} ${i} ${t.unit}`}setI18n(t){this.i18nMap=t}legendModel(){const t=this.data.series.map((t=>{var i;return{label:""===t.key?null!==(i=this.ruleSet.getScenario("").name)&&void 0!==i?i:"Series":t.key,treatment:this.seriesTreatment(t.index)}}));return{sizeCaption:[],title:this.i18nMap.get("legend.title")||null,compareEntries:[],entries:t}}primaryColorIndex(){const t=D(this.config.x.measure);return null===t||"variance"===t.kind?10:this.ruleSet.getScenarioColorIndex(t.slot)}seriesTreatment(t){const{color:i,overflowed:s}=h(t,this.styles.seriesColors);return s&&this.addWarningOnce("xy-series-overflow",{}),o(this.primaryColorIndex(),i,"dot")}addWarningOnce(t,i){this.warnings.some((i=>i.code===t))||this.warnings.push({code:t,data:i})}toString(){const t=new v;return this.draw(t),t.id("drawCanvas"),t.width(this.getAllocatedCanvasWidth()),t.height(this.getAllocatedCanvasHeight()),t.attr("overflow","visible"),t.svg()}draw(t){var i,s,n,e,h,o,r,a,l,d;this.warnings=this.data.warnings.slice();const c=this.em,u=this.styles.padding,m=this.i18nMap.get("axis.in")||"in",v=t.group(),f=new M(this.styles),p=this.legendModel(),w=this.config.legend.show&&p.entries.length>0,y=w?f.measure(p,this.config.legend.position):{width:0,height:0},g=null!==this.config.iso,x=g?Math.max(3*c,...this.isoValueLabels().map((t=>this.textWidth(t)+c)),this.textWidth(null!==(i=this.config.iso.label)&&void 0!==i?i:"",!0)+c,this.textWidth(void 0!==this.config.iso.unit&&""!==this.config.iso.unit?`${m} ${this.config.iso.unit}`:"")+c):0,b="right"===this.config.legend.position?Math.max(w?y.width+c:0,x):x,j=""!==this.config.chartTitle?1.6*c:0,C=this.axisTitle(this.config.y,m),k=this.axisTitle(this.config.x,m),P=""!==C?1.4*c:.4*c,T=1.4*c+(""!==k?1.3*c:0);let z,D=3*c,N={x:0,y:0,width:0,height:0},B=[];const E=Math.max(1,this.data.facets.length),F=null===(s=this.config.facet)||void 0===s?void 0:s.columns,A=W.domain(null!==(e=null===(n=this.data.extents)||void 0===n?void 0:n.xMin)&&void 0!==e?e:0,null!==(o=null===(h=this.data.extents)||void 0===h?void 0:h.xMax)&&void 0!==o?o:1,{min:this.config.x.min,max:this.config.x.max}),I=W.domain(null!==(a=null===(r=this.data.extents)||void 0===r?void 0:r.yMin)&&void 0!==a?a:0,null!==(d=null===(l=this.data.extents)||void 0===l?void 0:l.yMax)&&void 0!==d?d:1,{min:this.config.y.min,max:this.config.y.max});for(let t=0;t<2;t++){const t=Math.max(10,this.availableWidth-u.left-u.right-D-b);N={x:u.left+D,y:u.top+j+P,width:t,height:t/this.config.aspect},z=new S(E,F,N,this.styles.scaleFactors.panelGap*c);const i=z.panelRect(0).height,s=Math.max(4,Math.min(8,Math.round(i/(4*c)))),n=new W(I[0],I[1],i,0);B=n.ticks(s);const e=$(B,this.yPercent);D=Math.max(...B.map((t=>this.textWidth(L(t,e,this.styles.locale,this.yPercent)))),c)+this.styles.scaleFactors.axisTickLength*c+.4*c}this.canvasHeight=N.y+N.height+T+("bottom"===this.config.legend.position&&w?y.height+c:0)+u.bottom,""!==this.config.chartTitle&&this.drawText(v,this.config.chartTitle,u.left,u.top+c,{bold:!0}),""!==C&&this.drawAxisTitleText(v,this.config.y,m,u.left,N.y-.6*c,"start");const V=this.buildPanels(z,A,I),X=V[0].xScale.ticks(Math.max(3,Math.min(8,Math.round(V[0].rect.width/(7*c))))),O=$(X,this.xPercent),Q=$(B,this.yPercent);let G=!1;g&&(A[0]>0&&I[0]>0?G=!0:this.addWarningOnce("xy-iso-domain",{})),0===this.data.facets.length?this.drawPanel(v,V[0],{key:"",points:[]},X,B,O,Q,!0,!0,G):this.data.facets.forEach(((t,i)=>{this.drawPanel(v,V[i],t,X,B,O,Q,z.isOuterLeft(i),z.isOuterBottom(i),G,this.data.facets.length>1?t.key:"")})),""!==k&&this.drawAxisTitleText(v,this.config.x,m,N.x+N.width,N.y+N.height+2.6*c,"end"),w&&("right"===this.config.legend.position?f.draw(v,p,N.x+N.width+c,N.y,"right"):f.draw(v,p,N.x,N.y+N.height+T,"bottom")),t.group().addClass("annotations")}drawAxisTitleText(t,i,s,n,e,h){var o;const r=null!==(o=i.label)&&void 0!==o?o:"",a=void 0!==i.unit&&""!==i.unit?`${s} ${i.unit}`:"",l=.3*this.em;"start"===h?(this.drawText(t,r,n,e,{bold:!0}),""!==a&&this.drawText(t,a,n+this.textWidth(r,!0)+l,e,{})):""!==a?(this.drawText(t,a,n,e,{anchor:"end"}),this.drawText(t,r,n-this.textWidth(a)-l,e,{anchor:"end",bold:!0})):this.drawText(t,r,n,e,{anchor:"end",bold:!0})}buildPanels(t,i,s){const n=[];for(let e=0;e<t.count;e++){const h=t.panelRect(e),o=new W(i[0],i[1],h.x,h.x+h.width),r=new W(s[0],s[1],h.y+h.height,h.y);n.push({rect:h,xScale:o,yScale:r,frame:new j(o,r,h,this.styles)})}return n}drawPanel(t,i,s,n,e,h,o,r,a,l,d=""){var c,u;const m=t.group(),v=this.em;i.frame.drawBands(m,this.config.x.highlight,this.config.y.highlight),i.frame.drawGrid(m,e,void 0===this.config.x.refLine&&void 0===this.config.y.refLine&&i.rect.width>30*v?n:void 0),l&&null!==this.config.iso&&this.drawIso(m,i),i.frame.drawRefLines(m,this.config.x.refLine,this.config.y.refLine),i.frame.drawFrame(m);const f=this.styles.scaleFactors.pointRadius*v,p=new k(i.rect,this.styles.scaleFactors.labelToMark*v),w=[];for(const t of s.points){const n=null!==(u=null===(c=this.data.series.find((i=>i.key===t.seriesKey)))||void 0===c?void 0:c.index)&&void 0!==u?u:0,e=this.seriesTreatment(n),h=i.xScale.scale(t.x),o=i.yScale.scale(t.y);w.push({point:t,cx:h,cy:o,treatment:e});const r=m.circle(2*f).center(h,o).fill(e.fill).stroke({color:e.stroke,width:e.strokeWidth}).attr(y(C(t,s.key,this.config),"element"));void 0!==e.dasharray&&r.attr("stroke-dasharray",e.dasharray),p.registerMark(h,o,f)}this.drawPointLabels(m,p,w,f,s.key),i.frame.drawTickLabels(m,{ticksX:n,ticksY:e,xDecimals:h,yDecimals:o,xPercent:this.xPercent,yPercent:this.yPercent,showXLabels:a,showYLabels:r}),""!==d&&i.frame.drawPanelTitle(m,d)}drawPointLabels(t,i,s,n,e){const h=s.reduce(((t,i)=>t+i.cx),0)/Math.max(1,s.length),o=s.reduce(((t,i)=>t+i.cy),0)/Math.max(1,s.length),r=[...s].sort(((t,i)=>Math.hypot(i.cx-h,i.cy-o)-Math.hypot(t.cx-h,t.cy-o))),{selected:a,unknownNames:l}=i.selectCandidates(r,this.config.labels.points,this.config.labels.max,(t=>t.point.name));l.length>0&&this.addWarningOnce("xy-label-unknown",{names:l.join(", ")});const d=new Map,c=a.map((t=>{const i={name:t.point.name,cx:t.cx,cy:t.cy,r:n,width:this.textWidth(t.point.name),height:1.1*this.em};return d.set(i,t.point),i}));for(const s of i.place(c))this.drawText(t,s.candidate.name,s.x,s.y+.9*s.candidate.height,{}).attr(y(C(d.get(s.candidate),e,this.config),"label"))}drawIso(t,i){const s=this.config.iso,n=new E(i.xScale,i.yScale),e=this.i18nMap.get("axis.in")||"in",h=this.isoValues(),o=this.isoValueLabels();if(void 0!==s.highlight){const i=n.regionPath(s.highlight.from);null!==i&&t.path(i).fill(this.styles.axisStyles.pl.fill).stroke("none")}const r={color:this.styles.axisStyles.fc.stroke,width:B(this.styles.scaleFactors.gridLineWidth,this.em)};let a=null;for(const[i,s]of h.entries()){const e=n.path(s);if(null===e)continue;t.path(e).fill("none").stroke(r);const h=n.exitPoint(s);null!==h&&(this.drawText(t,o[i],h.x+.4*this.em,"right"===h.edge?h.y+.35*this.em:h.y-.5*this.em,{}),(null===a||h.y<a.y)&&(a=h))}if(null!==a&&void 0!==s.label&&""!==s.label){const i=void 0!==s.unit&&""!==s.unit?`${e} ${s.unit}`:"";this.drawText(t,s.label,a.x+.4*this.em,a.y-1.6*this.em,{bold:!0}),""!==i&&this.drawText(t,i,a.x+.4*this.em,a.y-.5*this.em,{})}}isoValues(){const t=this.config.iso;return"auto"!==t.values?t.values:E.autoK(this.data.facets.flatMap((t=>t.points.map((t=>t.x*t.y)))))}isoValueLabels(){const t=this.isoValues(),i=Math.max(0,...t.map((t=>W.stepDecimals(Math.abs(t)))));return t.map((t=>L(t,i,this.styles.locale)))}}const A=["xy-duplicate-point","xy-point-clipped","xy-variance-nodata","xy-iso-domain","xy-label-unknown","xy-series-overflow","xy-point-budget"],I=t(class extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.tableName="",this.dataVersion=0,this.chartTitle="",this.iso=null,this.facet=null,this.pointLevel="category",this.seriesLevel=null,this.aspect=16/9,this.limit=0,this.filter="",this.i18n=new Map,this.containerWidth=0,this.svgMarkup="",c(this)}getDb(){return this.stores||(this.stores=r(this.element)),this.stores.db.db}componentWillLoad(){this.rebuild()}componentWillUpdate(){this.rebuild()}rebuild(){const t=this.prepareStyle(),i=a(this.getDb(),this.tableName,this.filter);this.chart=new F(new d(this.ruleSetConfig),this.getDb(),i,{chartTitle:this.chartTitle,x:this.x,y:this.y,iso:this.iso,labels:this.labels,legend:this.legend,facet:this.facet,pointLevel:this.pointLevel,seriesLevel:this.seriesLevel,aspect:this.aspect,limit:this.limit},t,this.containerWidth||0),this.chart.setI18n(this.i18n),this.svgMarkup=this.chart.hasNoData()?"":this.chart.toString(),this.syncWarnings(this.chart.getWarnings()),m(this.errors,this.chart.getQueryError())}syncWarnings(t){if(void 0===this.errors)return;const i=new Map(t.map((t=>[t.code,t.data])));for(const t of A){const s=`WARN_${t.replace(/-/g,"_")}`;if(i.has(t)){const n=void 0!==this.translator?this.translator(`.${t}`,i.get(t)):t;this.errors.addOrReplace({id:s,type:"warning",message:n})}else this.errors.remove(s)}}prepareStyle(){var t,i;const s=new P(new T,new f,new p(new g),new w).adapt(this.styles);return s.locale=(null===(i=null===(t=r(this.element).context)||void 0===t?void 0:t.state)||void 0===i?void 0:i.locale)||"de",s}render(){var t;if(void 0===this.chart||void 0!==this.chart.getQueryError())return s(n,null);if(this.chart.hasNoData()){const i=null!==(t=this.i18n.get("no-data"))&&void 0!==t?t:"No Data";return s(n,{class:"no-data"},s("div",{class:"empty-state"},i))}return s(n,null,s("div",{innerHTML:this.svgMarkup}))}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}'}},[1,"bn-chart-scatter-renderer",{tableName:[1,"table-name"],dataVersion:[2,"data-version"],chartTitle:[1,"chart-title"],x:[16],y:[16],iso:[16],labels:[16],legend:[16],facet:[16],pointLevel:[1,"point-level"],seriesLevel:[1,"series-level"],aspect:[2],limit:[2],filter:[1],styles:[16],i18n:[16],containerWidth:[2,"container-width"],ruleSetConfig:[16],errors:[16],translator:[16]}]);function V(){"undefined"!=typeof customElements&&["bn-chart-scatter-renderer"].forEach((t=>{"bn-chart-scatter-renderer"===t&&(customElements.get(e(t))||customElements.define(e(t),I))}))}export{I as B,V as d}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{D as t}from"./p-BrQCbmG0.js";var n,a,s,o,e,r,c,i;!function(t){t.ALL="all",t.META="meta"}(n||(n={})),function(t){t.CURRENCY="currency",t.VOLUME="volume"}(a||(a={})),function(t){t.AC1="ac1",t.AC2="ac2",t.AC3="ac3",t.AC4="ac4",t.PP1="pp1",t.PP2="pp2",t.PP3="pp3",t.PP4="pp4",t.FC1="fc1",t.FC2="fc2",t.FC3="fc3",t.FC4="fc4",t.PL1="pl1",t.PL2="pl2",t.PL3="pl3",t.PL4="pl4"}(s||(s={})),function(t){t.POS="pos",t.NEG="neg",t.NEU="neu",t.OP="op",t.OPINV="opinv"}(o||(o={})),function(t){t.DECIMAL="decimal",t.PERCENT="percent"}(e||(e={})),function(t){t.LIST="list",t.SUM="sum",t.SUMNOTOTAL="sumnototal",t.OPT="opt",t.OPTNOTOTAL="optnototal"}(r||(r={})),function(t){t.INF="inf",t.W100="w100",t.W50="w50",t.W25="w25",t.W20="w20",t.W15="w15",t.W10="w10",t.W5="w5"}(c||(c={})),function(t){t.W5="w5",t.W10="w10",t.W15="w15",t.W20="w20",t.W25="w25",t.W30="w30",t.W40="w40",t.W60="w60",t.W80="w80",t.W100="w100"}(i||(i={}));const u={[i.W5]:5,[i.W10]:10,[i.W15]:15,[i.W20]:20,[i.W25]:25,[i.W30]:30,[i.W40]:40,[i.W60]:60,[i.W80]:80,[i.W100]:100};var f,l,p,w,m,b;!function(t){t.ROWGROUP="rowGroup",t.ROWGROUPINDEX="rowGroupIndex",t.CATEGORY="category",t.CATEGORYINDEX="categoryIndex",t.SUBCATEGORY="subCategory",t.SUBCATEGORYINDEX="subCategoryIndex"}(f||(f={})),function(t){t.SMART="smart",t.LONG="long",t.SHORT="short"}(l||(l={})),function(t){t.COLUMN="column",t.LINE="line",t.WATERFALL="waterfall"}(p||(p={})),function(t){t.BAR="bar",t.LINE="line",t.AUTO="auto"}(w||(w={})),function(t){t.SCENARIOS="scenarios",t.DIMENSIONS="dimensions"}(m||(m={})),function(t){t.ABSOLUTE="absolute",t.RELATIVE="relative",t.ABSOLUTE_RELATIVE="absolute-relative"}(b||(b={}));const y=100;var g;!function(t){t.ASC="asc",t.DESC="desc",t.DATASET="dataset"}(g||(g={}));class d{static isExisting(t){return null!=t}static isString(t){return"string"==typeof t}static isNumber(t){return"number"==typeof t&&!Number.isNaN(t)}static isBoolean(t){return"boolean"==typeof t}static isArray(t){return Array.isArray(t)}static isObject(t){return"object"==typeof t&&null!==t}static isOperator(t){return"+"===t||"-"===t}static isDate(n){return n instanceof t&&n.isValid}}export{f as A,u as B,d as C,e as D,n as I,a as M,y as R,s as S,i as T,o as a,l as b,r as c,c as d,m as e,g as f,b as g,w as h}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{f as t,c as s}from"./p-BnmylmXF.js";import{g as r,c as e}from"./p-6242qMx1.js";import{r as o}from"./p-BrQCbmG0.js";import{i as l,f as a,r as u}from"./p-CUoPUIej.js";import{m as n}from"./p-B2NXsfMz.js";const i=i=>{let m,f,p,c,b,j=null;const M=()=>{const t=f.ruleSets.state;b=n([t._default||{},t[p]||{}]),c=n([t._system||{},b])},w=()=>{const r=s(i),e=r.getAttribute("ruleset");if(j&&(j.disconnect(),j=null),e&&l(e)){const s=a(r,e);if(p=u(s,"ruleset"),s.length>0){j=new MutationObserver((()=>{p=u(s,"ruleset"),M(),t(i)}));for(const t of s)j.observe(t,{attributes:!0,attributeFilter:["ruleset"]})}}else p=e},B=new MutationObserver((s=>{s.forEach((s=>{"ruleset"===s.attributeName&&(w(),M(),t(i))}))})),F=i.connectedCallback;i.connectedCallback=()=>{const e=s(i);f=r(e),c=f.ruleSets.state._system,B.observe(e,{attributes:!0,attributeFilter:["ruleset"]}),w(),M(),m=f.ruleSets.on("set",(r=>{r!==p&&"_default"!==r||(w(),M(),t(s(i)))})),o(F,i)};const v=i.disconnectedCallback;return i.disconnectedCallback=()=>{B.disconnect(),j&&(j.disconnect(),j=null),o(m),e(s(i)),o(v,i)},(t="all")=>"user"===t?b:c};export{i as w}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{m as t}from"./p-BYBpC0EO.js";import{o as s}from"./p-Dw3rv_Y9.js";import{f as e,c as o}from"./p-BnmylmXF.js";import{r}from"./p-BrQCbmG0.js";class a{constructor(){this.cache=new Map,this.tag=a.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 a,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 l(s,e){const o=document.createElement("div").style;o.setProperty(s.cssName,e);const r=o.getPropertyValue(s.cssName);if(o.cssText=`${s.cssName}:${r};--bn-end:1`,!r||r.includes("<")||"1"!==o.getPropertyValue("--bn-end"))return;const a=function(s,e){const o=t(e);return`bn-c-${s.className}_${o}`}(s,e);return{className:a,style:f(s,a,r)}}const N=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",l(c.position,"absolute"));const t=l(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=N(t);n.apply(o);const r=Array.from(o.values()).map((t=>t.className));t.className=t.className.split(" ").filter((t=>!t.startsWith("bn-c-"))).concat(...r).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=N(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),r(s,t)},t.disconnectedCallback=()=>{r(e,t)}};export{p as w}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{S as n,a as t,A as r,b as o,T as u,D as e,c as i,M as a,d as s}from"./p-DFybNETX.js";import{T as c,i as l}from"./p-BZXiWkDS.js";import{D as f,a as d}from"./p-ja0FCkHB.js";import{O as v,a as m,p as y}from"./p-j42D1yrQ.js";import{r as p}from"./p-Dyzb4ika.js";function S(n){return null==n||""===n||"null"===n}function b(n){return"string"==typeof n&&"none"===n.trim().toLowerCase()}function N(t){return S(t)||"auto"===t.trim().toLowerCase()?[]:O((null==t?void 0:t.split(",").filter((t=>!(t.toUpperCase().trim()in n)))).toString())}function O(r){return S(r)?[]:r.replace(";",",").split(",").filter((r=>{var o,u,e;const i=r.split("_"),a=null===(o=i[0])||void 0===o?void 0:o.replace(/^dr|^d/,"").toUpperCase().trim(),s=null===(u=i[1])||void 0===u?void 0:u.toUpperCase().trim(),c=null===(e=i[2])||void 0===e?void 0:e.toUpperCase().trim();return 3!==i.length||!(a in n)||!(s in n)||!(c in t)}))}function J(t){return S(t)?[]:O(t.split(",").filter((t=>!(t.toUpperCase().trim()in n))).toString())}function j(n){return S(n)||"auto"===n.trim().toLowerCase()?[]:O(n.split(",").filter((n=>!(n.toUpperCase()in v))).toString())}function k(n){return S(n)||"auto"===n.trim().toLowerCase()?[]:n.split(",").filter((n=>void 0===y(n)))}function A(n){return!S(n)&&Number.isInteger(Number(n))}function h(n){return!S(n)&&!Number.isNaN(Number(n))}function T(n){return!S(n)&&(null==n?void 0:n.toUpperCase())in m}function D(n){return"auto"===(null==n?void 0:n.toLowerCase())||(null==n?void 0:n.toUpperCase())in r}function g(n){if(S(n))return[];try{const t=JSON.parse(n);if(t instanceof Array)return t.filter((n=>!(n.hasOwnProperty("name")&&n.hasOwnProperty("unit"))))}catch(n){console.error("validateMeasureList: failed to parse JSON",n)}return["Invalid JSON structure"]}function E(n){const t=Date.parse(n);return Number.isInteger(t)}function G(n){return(null==n?void 0:n.toUpperCase())in d}function I(n){return(null==n?void 0:n.toUpperCase())in f}function $(n){return(null==n?void 0:n.toUpperCase())in o}function C(n){return!S(n)&&(null==n?void 0:n.toUpperCase())in e}function w(n){return!S(n)&&(null==n?void 0:n.toUpperCase())in i}function z(n){return(null==n?void 0:n.toUpperCase())in c}function B(n){if(S(n))return[];try{const t=JSON.parse(n);if(t instanceof Array)return t.filter((n=>!(n.hasOwnProperty("rowGroup")&&n.hasOwnProperty("category")&&n.hasOwnProperty("subCategory"))))}catch(n){console.error("validateThereOfJsonStr: failed to parse JSON",n)}return["Invalid JSON structure"]}function M(n){if(S(n))return[];try{const t=JSON.parse(n);if(null!==t&&"object"==typeof t&&!(t instanceof Array))return Object.entries(t).filter((([,n])=>"string"!=typeof n||!l(n))).map((([n,t])=>`${n}: ${t}`))}catch(n){console.error("validateAttributesJsonStr: failed to parse JSON",n)}return["Invalid JSON structure"]}function q(n){if(S(n))return[];try{const t=JSON.parse(n);if(t instanceof Array)return t.filter((n=>!(n.hasOwnProperty("rowGroup")&&n.hasOwnProperty("category"))))}catch(n){console.error("validatePartOfJsonStr: failed to parse JSON",n)}return["Invalid JSON structure"]}function x(n){return(null==n?void 0:n.trim().toUpperCase())in a}function F(n){return["_","k","M","G","T","P","E","Z","Y","m","my","μ","n","p","f","a","z","y"].includes(null==n?void 0:n.trim())||["GREATEST","LEAST"].includes(null==n?void 0:n.trim().toUpperCase())}function L(n){return(null==n?void 0:n.toUpperCase().trim())in s}function P(n){return(null==n?void 0:n.toUpperCase().trim())in u}function X(n){if(S(n))return[];try{return JSON.parse(n).filter((n=>!(n.hasOwnProperty("scenario")&&n.hasOwnProperty("name")&&n.hasOwnProperty("subGroups"))))}catch(n){console.error("validateColumnThereOfJsonStr: failed to parse JSON",n)}return["Invalid JSON structure"]}function Z(n){if(S(n))return[];try{const t=JSON.parse(n);if("object"!=typeof t||null===t||Array.isArray(t))return["stack: must be a JSON object"];const r=[];if(t.hasOwnProperty("by")){const n=["scenarios","dimensions"];n.includes(t.by)||r.push(`stack: 'by' must be one of: ${n.join(", ")}`)}else r.push("stack: 'by' is required");if(t.hasOwnProperty("mode")){const n=["absolute","relative","absolute-relative"];n.includes(t.mode)||r.push(`stack: 'mode' must be one of: ${n.join(", ")}`)}if(t.hasOwnProperty("order")){const n=["asc","desc","dataset"];n.includes(t.order)||r.push(`stack: 'order' must be one of: ${n.join(", ")}`)}return r}catch(n){return["stack: invalid JSON"]}}function _(n){return!S(n)&&null!==p(n)}export{L as A,X as B,M as C,O as a,j as b,T as c,g as d,E as e,I as f,G as g,A as h,S as i,_ as j,b as k,D as l,F as m,Z as n,h as o,$ as p,J as q,P as r,C as s,w as t,B as u,N as v,z as w,q as x,k as y,x as z}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as n}from"./p-JofGXz75.js";import{r as i}from"./p-BjgkgCAQ.js";import{r as t,a as o}from"./p-CckAR27O.js";import{m as e}from"./p-DdvG1D18.js";import{L as r}from"./p-DY5fMUX8.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 o=n.parentElement;for(;o&&o!==i;){const n=l.exec(null!==(t=o.id)&&void 0!==t?t:"");if(n)return`scenario${n[1]}`;o=o.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,o,r,l,f){var g,m;const p={regions:[],barCount:0,baseline:{}},b=[];return Array.from(null!==(m=null===(g=t.shadowRoot)||void 0===g?void 0:g.querySelectorAll(o))&&void 0!==m?m:[]).forEach(((o,g)=>{var m,x,k,A;const _=null!==(m=r[g])&&void 0!==m?m:`segment${g}`,$=null===(x=o.shadowRoot)||void 0===x?void 0:x.querySelector("svg#drawCanvas");if($&&(p.regions.push({id:`canvas:${_}`,rect:e($,l)}),0===g&&(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,o){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:e(d,o),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:e(n,o),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 g=null!==(u=null===(s=n.textContent)||void 0===s?void 0:s.trim())&&void 0!==u?u:"";if(!g)return;l.add(n);const m={kind:"label",id:n.id,role:"DATA"===d?"data":"scenario",text:g,segment:t,index:null!==(f=c(n.id))&&void 0!==f?f:a,rect:e(n,o),point:i(n)};r.push(m)}))})),n.querySelectorAll("[data-bn-part]").forEach(((d,a)=>{var s,v,f;if(l.has(d))return;const g=i(d),m=null!==(s=u(d))&&void 0!==s?s:function(n,i){var t;for(let o=n;o&&o!==i;o=o.parentElement){const n=c(null!==(t=o.id)&&void 0!==t?t:"");if(void 0!==n)return n}}(d,n);if("element"===g.part){const n={kind:"point",series:g.scenario,index:null!=m?m:a,rect:e(d,o),point:g};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:m,rect:e(d,o),point:g};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=e(n,o),a={kind:"axis",style:null==l?void 0:l.slice(5),orientation:d.context.width>=d.context.height?"horizontal":"vertical",segment:t,rect:d};r.push(a)})),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 o=n.parentElement;for(;o&&o!==i;){if((null!==(t=o.id)&&void 0!==t?t:"").endsWith("_Label"))return!0;o=o.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:e(i,o)};r.push(s)})),r}($,_,l))),"full"===f){const n=null===(k=o.shadowRoot)||void 0===k?void 0:k.querySelector(".footer"),i=null===(A=null==n?void 0:n.textContent)||void 0===A?void 0:A.trim();i&&b.push({kind:"label",role:"footer",text:i,segment:_,rect:e(n,l)})}})),"full"===f&&(p.elements=b),p}function g(l,d,a,s,c,v){var f,g,m,p;const b={version:r,tag:l.localName,id:o(l),slot:null!==(f=l.getAttribute("slot"))&&void 0!==f?f:void 0,rect:e(l,c),em:s,regions:[],metadata:{title:a},diagnostics:t(l)},x=null===(p=null===(m=null===(g=l.shadowRoot)||void 0===g?void 0:g.querySelector(d))||void 0===m?void 0:m.shadowRoot)||void 0===p?void 0:p.querySelector("svg#drawCanvas");return x&&(b.regions.push({id:"canvas",rect:e(x,c)}),b.metadata.pointCount=x.querySelectorAll("circle, ellipse").length,b.baseline=n(x,l),"full"===v&&(b.elements=function(n,t){const o=[];return n.querySelectorAll("circle, ellipse").forEach(((n,r)=>{const l={kind:"point",index:r,rect:e(n,t),point:i(n)};o.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:e(n,t),point:d};o.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:e(n,t),point:i(n)};o.push(a)})),o}(x,c))),b}export{f as a,g as c}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{A as n}from"./p-DDo-fu3v.js";var c,t;!function(n){n.ASC="asc",n.DESC="desc"}(c||(c={})),function(n){n.ROWGROUP="rowGroup",n.ROWGROUPINDEX="rowGroupIndex",n.CATEGORY="category",n.CATEGORYINDEX="categoryIndex",n.SUBCATEGORY="subCategory",n.SUBCATEGORYINDEX="subCategoryIndex",n.AC1="ac1",n.AC2="ac2",n.AC3="ac3",n.AC4="ac4",n.PP1="pp1",n.PP2="pp2",n.PP3="pp3",n.PP4="pp4",n.FC1="fc1",n.FC2="fc2",n.FC3="fc3",n.FC4="fc4",n.PL1="pl1",n.PL2="pl2",n.PL3="pl3",n.PL4="pl4"}(t||(t={}));class o{constructor(n=["category"],t=c.ASC){this.hierarchy=n,this.direction=t}}const r=[t.ROWGROUP,t.ROWGROUPINDEX,t.CATEGORY,t.CATEGORYINDEX,t.SUBCATEGORY,t.SUBCATEGORYINDEX],a=/^(?:ac|fc|pp|pl)[1-4]$/,s=/^(dr|d)((?:ac|fc|pp|pl)[1-4])_((?:ac|fc|pp|pl)[1-4])(?:_(?:pos|neg|neu|opinv|op))?$/;function p(n){if(null==n)return;const c=n.indexOf("@"),o=(c<0?n:n.slice(0,c)).trim().toLowerCase(),p=c<0?void 0:n.slice(c+1).trim();if(""===p)return;const e=t[o.toUpperCase()];if(null!=e&&r.includes(e))return void 0===p?{kind:"dim",column:e}:void 0;if(a.test(o))return{kind:"scenario",column:o,bucket:p};const u=s.exec(o);if(null!=u){const[,n,c,t]=u;return{kind:"variance",column:`${n}${c}_${t}`,type:n,base:c,delta:t,bucket:p}}}function e(n){const c=p(n);if(null!=c)return void 0===c.bucket?c.column:`${c.column}@${c.bucket}`}class u{constructor(n,c=!1){this.stringAdapter=n,this.allowMeasures=c}adapt(r){var a;const s=n.adaptArray(r.hierarchy,this.stringAdapter),p=c[null===(a=r.direction)||void 0===a?void 0:a.toUpperCase()]||c.ASC;return new o(s.map((n=>(this.allowMeasures?e(n):t[n.toUpperCase()])||t.CATEGORY)),p)}default(){return new o(["category"],c.ASC)}}export{t as O,c as a,o as b,u as c,e as n,p}
|