@bino-bi/bn-template-engine 1.0.0-alpha.11 → 1.0.0-alpha.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/dist/bn-template-engine/bn-template-engine.esm.js +1 -1
  2. package/dist/bn-template-engine/p-3c827826.entry.js +1 -0
  3. package/dist/bn-template-engine/p-46699464.entry.js +1 -0
  4. package/dist/bn-template-engine/{p-e783733e.entry.js → p-52097456.entry.js} +1 -1
  5. package/dist/bn-template-engine/p-637e3b8f.entry.js +1 -0
  6. package/dist/bn-template-engine/{p-c2cbb8ea.entry.js → p-67eae33e.entry.js} +1 -1
  7. package/dist/bn-template-engine/{p-fdb3e99a.entry.js → p-82023539.entry.js} +1 -1
  8. package/dist/bn-template-engine/p-BVFHvEXF.js +1 -0
  9. package/dist/bn-template-engine/p-BjBz5cSL.js +1 -0
  10. package/dist/bn-template-engine/p-CQnZV3JG.js +1 -0
  11. package/dist/bn-template-engine/p-DHheVOfP.js +1 -0
  12. package/dist/bn-template-engine/{p-e94b4e31.entry.js → p-ab3ea8cf.entry.js} +1 -1
  13. package/dist/cjs/bn-asset_21.cjs.entry.js +576 -730
  14. package/dist/cjs/bn-grid.cjs.entry.js +2 -2
  15. package/dist/cjs/bn-image.cjs.entry.js +2 -2
  16. package/dist/cjs/bn-internationalization.cjs.entry.js +2 -2
  17. package/dist/cjs/bn-template-engine.cjs.js +1 -1
  18. package/dist/cjs/bn-text.cjs.entry.js +3 -3
  19. package/dist/cjs/bn-tree.cjs.entry.js +2 -2
  20. package/dist/cjs/context-protocol-Op7uUwN3.js +9214 -0
  21. package/dist/cjs/editor-companion.cjs.entry.js +13 -6
  22. package/dist/cjs/loader.cjs.js +1 -1
  23. package/dist/cjs/{scaling-eyzCrFB8.js → scaling-57N4Cxb_.js} +44 -40
  24. package/dist/cjs/{withBodyObserver-D7BKWN2N.js → withBodyObserver-BKUE_ypL.js} +12 -7
  25. package/dist/cjs/withStyled-C2kmGAK3.js +1405 -0
  26. package/dist/collection/components/bn-chart-structure/bn-chart-structure.js +11 -6
  27. package/dist/collection/components/bn-chart-structure/ibcs-chart-structure.js +50 -22
  28. package/dist/collection/components/bn-chart-structure/utils/StructureChart.js +51 -48
  29. package/dist/collection/components/bn-chart-structure/utils/model/StructureChartComponentConfig.js +5 -4
  30. package/dist/collection/components/bn-chart-time/bn-chart-time.js +11 -6
  31. package/dist/collection/components/bn-chart-time/ibcs-chart-time.js +47 -22
  32. package/dist/collection/components/bn-chart-time/utils/TimeChart.js +76 -60
  33. package/dist/collection/components/bn-chart-time/utils/model/TimeChartComponentConfig.js +5 -4
  34. package/dist/collection/components/bn-chart-time/utils/model/TimeChartDataRow.js +2 -0
  35. package/dist/collection/components/bn-dataset/bn-dataset.js +214 -23
  36. package/dist/collection/components/bn-datasource/bn-datasource.js +27 -9
  37. package/dist/collection/components/bn-table/bn-table.js +13 -5
  38. package/dist/collection/components/bn-table/ibcs-table.js +52 -25
  39. package/dist/collection/components/bn-table/utils/Table.js +27 -21
  40. package/dist/collection/components/bn-table/utils/factories/tableDataSetFactory.js +2 -2
  41. package/dist/collection/components/bn-table/utils/helper/DataQuery.js +52 -43
  42. package/dist/collection/components/bn-table/utils/helper/QueryGroup.js +4 -9
  43. package/dist/collection/components/bn-table/utils/model/TableComponentConfig.js +5 -4
  44. package/dist/collection/components/editor-companion/editor-companion.js +12 -5
  45. package/dist/collection/context/scopedDb.js +113 -0
  46. package/dist/collection/stores/createScopedStores.js +3 -4
  47. package/dist/collection/utils/dataAnalyzer.js +14 -8
  48. package/dist/collection/utils/withBodyObserver.js +12 -7
  49. package/dist/collection/utils/withDataset.js +43 -39
  50. package/dist/collection/utils/withDatasource.js +28 -18
  51. package/dist/components/DataFormatDigits.js +1 -1
  52. package/dist/components/DateStringFactory.js +1 -1
  53. package/dist/components/Order.js +1 -1
  54. package/dist/components/SVGVariancesStyleGroup.js +1 -1
  55. package/dist/components/bn-chart-structure.js +1 -1
  56. package/dist/components/bn-chart-time.js +1 -1
  57. package/dist/components/bn-dataset.js +1 -1
  58. package/dist/components/bn-datasource.js +1 -1
  59. package/dist/components/bn-table.js +1 -1
  60. package/dist/components/bn-title2.js +1 -1
  61. package/dist/components/context-protocol.js +1 -1
  62. package/dist/components/editor-companion.js +1 -1
  63. package/dist/components/ibcs-chart-structure2.js +1 -1
  64. package/dist/components/ibcs-chart-time2.js +1 -1
  65. package/dist/components/ibcs-table2.js +1 -1
  66. package/dist/components/ibcs-title2.js +1 -1
  67. package/dist/components/ibcsRuleSet.js +1 -1
  68. package/dist/components/luxon.js +1 -0
  69. package/dist/components/scaling.js +1 -1
  70. package/dist/components/withBodyObserver.js +1 -1
  71. package/dist/esm/bn-asset_21.entry.js +571 -725
  72. package/dist/esm/bn-grid.entry.js +2 -2
  73. package/dist/esm/bn-image.entry.js +2 -2
  74. package/dist/esm/bn-internationalization.entry.js +2 -2
  75. package/dist/esm/bn-template-engine.js +1 -1
  76. package/dist/esm/bn-text.entry.js +3 -3
  77. package/dist/esm/bn-tree.entry.js +2 -2
  78. package/dist/esm/context-protocol-BDhzNbeD.js +9204 -0
  79. package/dist/esm/editor-companion.entry.js +13 -6
  80. package/dist/esm/loader.js +1 -1
  81. package/dist/esm/{scaling-BzbiBnuN.js → scaling-La1Ow72h.js} +44 -40
  82. package/dist/esm/{withBodyObserver-AFk2wwHT.js → withBodyObserver-IokS6fHD.js} +12 -7
  83. package/dist/esm/withStyled-Bl9cSoRW.js +1372 -0
  84. package/dist/types/components/bn-chart-structure/bn-chart-structure.d.ts +4 -2
  85. package/dist/types/components/bn-chart-structure/ibcs-chart-structure.d.ts +7 -3
  86. package/dist/types/components/bn-chart-structure/utils/StructureChart.d.ts +11 -12
  87. package/dist/types/components/bn-chart-structure/utils/model/StructureChartComponentConfig.d.ts +5 -3
  88. package/dist/types/components/bn-chart-time/bn-chart-time.d.ts +4 -2
  89. package/dist/types/components/bn-chart-time/ibcs-chart-time.d.ts +7 -3
  90. package/dist/types/components/bn-chart-time/utils/TimeChart.d.ts +11 -12
  91. package/dist/types/components/bn-chart-time/utils/model/TimeChartComponentConfig.d.ts +5 -3
  92. package/dist/types/components/bn-dataset/bn-dataset.d.ts +39 -5
  93. package/dist/types/components/bn-datasource/bn-datasource.d.ts +5 -0
  94. package/dist/types/components/bn-table/bn-table.d.ts +4 -2
  95. package/dist/types/components/bn-table/ibcs-table.d.ts +11 -3
  96. package/dist/types/components/bn-table/utils/Table.d.ts +8 -6
  97. package/dist/types/components/bn-table/utils/factories/tableDataSetFactory.d.ts +2 -2
  98. package/dist/types/components/bn-table/utils/helper/DataQuery.d.ts +7 -3
  99. package/dist/types/components/bn-table/utils/helper/QueryGroup.d.ts +4 -5
  100. package/dist/types/components/bn-table/utils/model/TableComponentConfig.d.ts +5 -3
  101. package/dist/types/components/editor-companion/editor-companion.d.ts +2 -0
  102. package/dist/types/components.d.ts +105 -46
  103. package/dist/types/context/context-protocol.d.ts +4 -3
  104. package/dist/types/context/scopedDb.d.ts +37 -0
  105. package/dist/types/stores/createScopedStores.d.ts +1 -2
  106. package/dist/types/utils/DateStringFactory.d.ts +1 -1
  107. package/dist/types/utils/dataAnalyzer.d.ts +2 -1
  108. package/dist/types/utils/withDataset.d.ts +6 -2
  109. package/dist/types/utils/withDatasource.d.ts +3 -3
  110. package/package.json +2 -1
  111. package/dist/bn-template-engine/p-095f74d7.entry.js +0 -1
  112. package/dist/bn-template-engine/p-14318b0d.entry.js +0 -1
  113. package/dist/bn-template-engine/p-2133e02b.entry.js +0 -1
  114. package/dist/bn-template-engine/p-7HSTE79g.js +0 -1
  115. package/dist/bn-template-engine/p-Bi2wx-el.js +0 -1
  116. package/dist/bn-template-engine/p-CWiZks2h.js +0 -1
  117. package/dist/bn-template-engine/p-DSXNgKLa.js +0 -1
  118. package/dist/cjs/context-protocol-B_jipZpJ.js +0 -665
  119. package/dist/cjs/withStyled-V7xz_x1c.js +0 -9535
  120. package/dist/collection/stores/datasets.js +0 -14
  121. package/dist/collection/stores/datasources.js +0 -14
  122. package/dist/components/_commonjsHelpers.js +0 -1
  123. package/dist/components/alasql.min.js +0 -1
  124. package/dist/esm/context-protocol-D-o_UZ33.js +0 -658
  125. package/dist/esm/withStyled-5RqF8WBL.js +0 -9501
  126. package/dist/types/stores/datasets.d.ts +0 -14
  127. package/dist/types/stores/datasources.d.ts +0 -14
@@ -1 +1 @@
1
- import{h as t,proxyCustomElement as e,HTMLElement as o,Host as s,transformTag as n}from"@stencil/core/internal/client";import{F as r,Q as i,V as a,I as l,S as c}from"./ibcsRuleSet.js";import{I as h,D as u,j as d,k as f,l as p,e as m,M as $}from"./Order.js";import{a as v}from"./alasql.min.js";import{D as g,S as R,a as w,b}from"./DataFormatDigits.js";import{w as S}from"./withComponentStyle.js";var E,O,y,M,U;!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"}(O||(O={})),function(t){t.LIST="list",t.SUM="sum",t.SUMNOTOTAL="sumnototal",t.OPT="opt",t.OPTNOTOTAL="optnototal"}(y||(y={})),function(t){t.ASC="asc",t.DESC="desc"}(M||(M={})),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"}(U||(U={}));class G{constructor(t,e,o,s,n,r,i,a,l){this.prefixStyle="prefix",this.isBarChart=!1,this.key=t,this.index=e,this.value=o,this.prefix=r||"",this.cssStyle=s||"",this.prefixStyle=i||"prefix",this.type=n,this.mark=void 0,this.colSpan=a||1,this.measureScale=l||1}getAsHeaderList(){if(null==this.value)return[""];const t=[];for(const e of this.value.toString().split("<br/>"))t.push(e);return t}draw(t){let e=this.value;if("undefined"===e||void 0===e||null==e)return"";if(Number.isNaN(Number(e)))return e;if(""===this.type||void 0===this.type||null==this.type)return e;let o=t.percent,s=t.percent;return"decimal"===this.type&&(e=+e/this.measureScale,o=t.decimal,s=t.decimal),r.number(Number(e),this.type,o,s)}drawPrefix(){return null==this.prefix?"":this.prefix}}class T{constructor(t,e,o){this.index=t,this.groupindex=e,this.type=o,this.cssStyle=this.initCssStyle(),this.elements=[]}initCssStyle(){switch(this.type){case U.HEADER:return"groupheader";case U.SEPERATORLINE:return"";case U.DRILLELEMENT:return"ofit";case U.PARTELEMENT:return"partof";case U.STANDARD:return"";case U.SUM:return"sum";default:return""}}getCells(){return this.elements}createElement(t,e,o,s,n,r,i,a,l,c=!1,h){let u=r;"category"===e&&null!=a&&(u=`category-${a.toString()}`),this.type===U.HEADER?u="headerlabel":this.type===U.SEPERATORLINE&&(u=e),this.type===U.PARTELEMENT&&("percent"===s&&(t="-"),"category"!==e&&"operation"!==e&&(s="percent",u="")),"-"===t&&(u="");let d="prefix-first";i&&(d="prefix-second"),o&&(u=`${u} ${o}`);const f=new G(e,this.elements.length,t,u,s,n,d,1,l);f.isBarChart=c,f.columnStats=h,this.elements.push(f)}}const _={positive:{stroke:"#008f96",fill:"#008f96",fillpattern:"solid"},negative:{stroke:"#ff0000",fill:"#ff0000",fillpattern:"solid"},neutral:{stroke:"#808080",fill:"#808080",fillpattern:"outlined"},scenarios:{ac:{stroke:"#404040",fill:"#404040",fillpattern:"solid"},pp:{stroke:"#A6A6A6",fill:"#A6A6A6",fillpattern:"solid"},fc:{stroke:"#404040",fill:"#ffffff",fillpattern:"hatched"},pl:{stroke:"#404040",fill:"#ffffff",fillpattern:"outlined"}},fontColor:"#000000",fontSize:11,fontFamily:"'Noto Sans', sans-serif",unitScaling:.01,percentageScaling:.5,scaleFactor:1},C="#666666";function L(t,e){return`pattern-${t}-${e.replace("#","")}`}const N=({styles:e})=>{const o=e.scaleFactor,s=6*o,n=[{id:L("pos",e.positive.stroke),stroke:e.positive.stroke,fill:e.positive.fill},{id:L("neg",e.negative.stroke),stroke:e.negative.stroke,fill:e.negative.fill},{id:L("neu",e.neutral.stroke),stroke:e.neutral.stroke,fill:e.neutral.fill}];return t("defs",null,n.map((e=>t("pattern",{id:e.id,patternUnits:"userSpaceOnUse",width:s,height:s},t("rect",{width:s,height:s,fill:"#ffffff"}),t("line",{x1:"0",y1:s,x2:s,y2:"0",stroke:e.stroke,"stroke-width":1.5*o})))))};function P(t,e,o=1){let s,n;const r=t>=0?"+":"";if(e)return s=100*t,r+Math.round(s).toString()+"%";{let e;return s=t/o,n=Math.abs(s),e=n>=1e9?(s/1e9).toFixed(n>=1e10?0:1)+"B":n>=1e6?(s/1e6).toFixed(n>=1e7?0:1)+"M":n>=1e3?(s/1e3).toFixed(n>=1e4?0:1)+"K":s.toFixed(n>=10?0:1),e=e.replace(/\.0([KMB]?)$/,"$1"),r+e}}function x(t){const e=t.slice(0,2).toLowerCase();return["ac","pp","fc","pl"].includes(e)}function k(t){const e=t.slice(0,2).toLowerCase();return"pp"===e?"pp":"fc"===e?"fc":"pl"===e?"pl":"ac"}function A(t,e,o,s){return x(t)?function(t,e){const o=k(t);return e.scenarios[o]}(t,s):function(t,e,o){const s=t>=0;return e?s?o.positive:o.negative:s?o.negative:o.positive}(e,o,s)}const D=e=>{const{value:o,scenario:s,columnStats:n,height:r,isPositiveGood:i,formattedValue:a,measureScale:l,maxBarWidth:c=10,styles:h=_}=e,u=h.scaleFactor,d=h.fontSize,f=38*u,p=c*d,m=4*u,$=.15*p,v=p-m-$,g=Math.abs(o)*h.unitScaling*d,R=g>v,w=Math.max(0,n.absMax*h.unitScaling*d-v),b=Math.max(0,g-v),S=w>0?b/w*$:0,E=n.min<0,O=n.max>0,y=E?p:0,M=(E?f:0)+(y+(O?p:0))+(O?f:0),U=2*u,G=r-2*U,T=(E?f:0)+y,D=U,B=o>=0,F=A(s,o,i,h),Y=function(t,e){const o=t.fillpattern;return"hatched"===o?`url(#${L(e,t.stroke)})`:"outlined"===o?"transparent":t.fill}(F,x(s)?k(s):i?B?"pos":"neg":B?"neg":"pos"),{stroke:W,strokeWidth:H}="outlined"===(I=F).fillpattern?{stroke:I.stroke,strokeWidth:1.5}:{stroke:"none",strokeWidth:0};var I;const z=a||P(o,!1,l),j=R?v:g,V=R?v+m+S:g,Q=B?T+V+4*u:T-V-4*u,q=B?"start":"end";return t("svg",{width:M,height:r,class:"cell-bar-chart absolute-variance",style:{overflow:"visible"}},t(N,{styles:h}),t("line",{x1:T,y1:0,x2:T,y2:r,stroke:C,"stroke-width":1*u}),j>0&&t("rect",{x:B?T:T-j,y:D,width:j,height:G,fill:Y,stroke:W,"stroke-width":H*u}),R&&S>0&&t("rect",{x:B?T+v+m:T-v-m-S,y:D,width:S,height:G,fill:Y,stroke:W,"stroke-width":H*u}),R&&function(e,o,s,n,r){const i=e+o/2,a=.35*o,l=n/3,c=.3*o;let h=`M ${i-a} ${s}`;for(let t=0;t<3;t++)h+=` L ${i-a-c} ${s+l*(t+.5)} L ${i-a} ${s+l*(t+1)}`;let u=`M ${i+a} ${s}`;for(let t=0;t<3;t++)u+=` L ${i+a+c} ${s+l*(t+.5)} L ${i+a} ${s+l*(t+1)}`;return[t("rect",{x:e,y:s-1,width:o,height:n+2,fill:"#ffffff"}),t("path",{d:h,fill:"none",stroke:"#000000","stroke-width":1*r}),t("path",{d:u,fill:"none",stroke:"#000000","stroke-width":1*r})]}(B?T+v:T-v-m,m,D,G,u),t("text",{x:Q,y:r/2,dy:"0.35em","text-anchor":q,fill:h.fontColor,"font-size":d,"font-family":h.fontFamily},z))},B=e=>{const{value:o,scenario:s,columnStats:n,height:r,isPositiveGood:i,formattedValue:a,measureScale:l,maxBarWidth:c=10,styles:h=_}=e,u=h.scaleFactor,d=h.fontSize,f=Math.round(.67*c*d),p=5*u,m=n.min<0?f+p:0,$=m+(n.max>0?f+p:0),v=$+45*u,g=m,R=r/2,w=100*Math.abs(o)*h.percentageScaling*d,b=w>f,S=Math.min(w,f),E=o>=0,O=E?g+S:g-S,y=A(s,o,i,h),M=3*u,U=a||P(o,!0,l),G=$+4*u;return t("svg",{width:v,height:r,class:"cell-bar-chart relative-variance",style:{overflow:"visible"}},t("line",{x1:g,y1:0,x2:g,y2:r,stroke:C,"stroke-width":1*u}),!b&&t("circle",{cx:O,cy:R,r:M,fill:h.fontColor}),t("line",{x1:g,y1:R,x2:O,y2:R,stroke:y.fill,"stroke-width":2*u}),b&&E&&t("polygon",{points:`${g+f},${R} ${g+f-6*u},${R-3*u} ${g+f-6*u},${R+3*u}`,fill:y.fill}),b&&!E&&t("polygon",{points:`${g-f},${R} ${g-f+6*u},${R-3*u} ${g-f+6*u},${R+3*u}`,fill:y.fill}),t("text",{x:G,y:r/2,dy:"0.35em","text-anchor":"start",fill:h.fontColor,"font-size":d,"font-style":"italic","font-family":h.fontFamily},U))},F=e=>{const{value:o,columnStats:s,isRelative:n,styles:r=_}=e;return null==o||isNaN(o)||!s||0===s.absMax?t("span",{class:"bar-chart-empty",style:{color:r.fontColor,fontStyle:"italic"}},"-"):t(n?B:D,Object.assign({},e))};class Y{constructor(t){v.fn.transformOperator=function(t){return"-"===t?-1:1},this.groups=[i.CATEGORY,i.CATEGORYINDEX],y.OPT!==t.type&&y.OPTNOTOTAL!==t.type||this.groups.unshift(i.OPERATION),t.grouped&&(this.groups.push(i.ROWGROUP),this.groups.push(i.ROWGROUPINDEX))}toString(){return this.groups.map((t=>`${t}`)).toString()}noCategory(){return this.groups.filter((t=>t!==i.CATEGORY))}toArray(){return this.groups}}class W{constructor(t,e){this.hasPartOf=!1,this.config=t,this.i18n=e}execute(t){if(0===t.length)return[];const e=[],o=[],s=[],n=this.config.scenarios.map((t=>this.translateScenarioSQL(t,!1,this.config.type))).toString(),r=this.config.scenarios.map((t=>this.translateScenarioSQL(t,!0,this.config.type))).toString(),a=this.getRelativeScenarios(),l=new Y(this.config),c=this.config.grouped?[i.ROWGROUP,i.ROWGROUPINDEX]:[];let h=["",""];return this.config.sortOrder.hierarchy.length>0&&(h=this.createOrderString(this.config.sortOrder)),this.hasPartOf=this.checkConfigForPartOf(),v(`SELECT COUNT(DISTINCT ${i.CATEGORY}) as ${i.TOTALROWCOUNT} ${c.length>0?","+c:""}\n FROM ? ${c.length>0?"GROUP BY "+c:""} \n ORDER BY ${h[0]}`,[t]).forEach((t=>{const s=t.rowGroup&&t.rowGroup.length>0?`WHERE ${i.ROWGROUP} = '${t.rowGroup}'`:"";let a="";this.config.limit&&(a=`LIMIT ${this.config.limit}`),this.createGroupHeaderRow(t,e),this.createDataRow(e,t,l,n,s,h,a),this.createRestRow(t,e,l,n,s,h),this.createGroupSumRow(e,o,t,r,h)})),this.createTotalSumRow(e,o,r),e.forEach((e=>{try{s.push(v(e,[t]))}catch(t){console.error("DataQuery: SQL query execution failed",e,t)}})),this.detectNaNCells(this.config.scenarios,s),this.createThereOfDrillRows(n,h,t,s),this.createPartOfDrillRows(n,h,o,t,s),this.createThereOfDrillColumns(this.config.categoryThereOf,t,s),this.calculateColumnGroupRest(s,this.config.categoryThereOf),this.calculateRelativeVariances(s,a),s}detectNaNCells(t,e){e.forEach((e=>{e.map((e=>(t.forEach((t=>{const o=new a(t);!0===o.isValid?0!==e[o.base+"_cnt"]&&0!==e[o.delta+"_cnt"]||(e[t]=Number.NaN):0===e[t+"_cnt"]&&(e[t]=Number.NaN)})),e)))}))}createPartOfDrillRows(t,e,o,s,n){if(null==this.config.partOf||0===this.config.partOf.length||this.config.type===y.LIST||null==s||0===s.length)return;const r=this.createPartOfQuery(t,e);let a=[];r.forEach((function(t){a.push(...v(t,[s]))}));const l=this.exctractScenarioNames(t),c=[];o.forEach((function(t){c.push(...v(t,[s]))}));const h=new Map;c.forEach((t=>h.set(t[i.ROWGROUP],t))),a=this.reduceResDrillByCategoryGroups(a,l),a.forEach((function(t){l.forEach((e=>{try{t[e]=t[e]/h.get(t[i.ROWGROUP])[e]}catch(o){console.error("DataQuery: partOf drill row calculation failed",e,o),t[e]=Number.NaN}}))})),this.injectDrillRowsToResultRows(a,n)}createRestRow(t,e,o,s,n,r){t.totalRowCnt-this.config.limit>0&&0!==this.config.limit&&e.push(`SELECT ${i.ROWNR}, 1 as ${i.ROWGROUPINDEX} , 'ENTRY' as ${i.TYPE}, 'NO_GROUP' as ${i.ROWGROUP}, 'REST' as ${i.CATEGORY} , SUM(ac1) as ac1, SUM(pp1) as pp1, SUM(dpp1_ac1_pos) as dpp1_ac1_pos, SUM(drpp1_ac1_pos) as drpp1_ac1_pos, SUM(dr_pp1) as dr_pp1 FROM (SELECT ROWNUM() AS ${i.ROWNR}, ${e.length} as ${i.ROWGROUPINDEX} , 'ENTRY' as ${i.TYPE}, '${t.rowGroup||"NO_GROUP"}' as ${i.ROWGROUP}, ${o} ${s.length>0?",".concat(s):""} FROM ? ${n} GROUP BY ${o} ORDER BY ${r[0]}) t WHERE t.rowNr > ${this.config.limit}`)}createDataRow(t,e,o,s,n,r,a){t.push(`SELECT ROWNUM() AS ${i.ROWNR},\n ${t.length} as ${i.ROWGROUPINDEX},\n 'ENTRY' as ${i.TYPE},\n '${e.rowGroup||"NO_GROUP"}' as ${i.ROWGROUP},\n '${i.CATEGORYINDEX}',\n ${o} ${s.length>0?",".concat(s):""}\n FROM ? ${n}\n GROUP BY ${o}\n ORDER BY ${r[0]} ${a}`)}createGroupHeaderRow(t,e){!0===this.config.grouped&&e.push(`SELECT ROWNUM() AS ${i.ROWNR},\n ${e.length} as ${i.ROWGROUPINDEX},\n 'GROUPHEAD' as ${i.TYPE},\n '${t.rowGroup}' as ${i.ROWGROUP} ${this.config.showGroupTitle?`,'${t.rowGroup}' as ${i.CATEGORY}`:""}\n FROM ?\n GROUP BY '1'`)}createGroupSumRow(t,e,o,s,n){!0!==this.config.grouped||y.SUM!==this.config.type&&y.SUMNOTOTAL!==this.config.type&&y.OPT!==this.config.type&&y.OPTNOTOTAL!==this.config.type||(t.push(`SELECT ${t.length} as ${i.ROWGROUPINDEX},\n '=' as ${i.OPERATION},\n '${o.rowGroup}' as ${i.ROWGROUP},\n ROWNUM() AS ${i.ROWNR},\n 'GROUP_SUM' as ${i.TYPE} ${s.length>0?",".concat(s):""}\n FROM ?\n WHERE ${i.ROWGROUP} = '${o.rowGroup}'\n ORDER BY ${n[0]} `),e.push(`SELECT ${t.length} as ${i.ROWGROUPINDEX},\n '=' as ${i.OPERATION},\n '${o.rowGroup}' as ${i.ROWGROUP},\n ROWNUM() AS ${i.ROWNR},\n 'GROUP_SUM' as ${i.TYPE} ${s.length>0?",".concat(s):""}\n FROM ?\n WHERE ${i.ROWGROUP} = '${o.rowGroup}'\n ORDER BY ${n[0]} `))}createTotalSumRow(t,e,o){if(y.SUM===this.config.type||y.OPT===this.config.type){const e=`${this.hasPartOf&&!1===this.config.grouped?`${this.i18n.get("SUM_TOTAL")||"SUM_TOTAL"} `:""}${this.config.title}`;t.push(`SELECT ${t.length} as ${i.ROWGROUPINDEX},\n '${e}' as ${i.ROWGROUP},\n '=' as ${i.OPERATION},\n 'SUM' as ${i.TYPE} ${o.length>0?",".concat(o):""}\n FROM ? `)}e.push(`SELECT ${t.length} as ${i.ROWGROUPINDEX},\n 'SUM_TOTAL' as ${i.ROWGROUP},\n '=' as ${i.OPERATION},\n 'SUM' as ${i.TYPE} ${o.length>0?",".concat(o):""}\n FROM ? `)}reduceResDrillByCategoryGroups(t,e){const o=new Map;return t.forEach((function(t){const s=t.rowNr+t.rowGroup+t.type+t.category;if(o.has(s)){const n=o.get(s);e.forEach((e=>{try{n[e]+=t[e]}catch(t){console.error("DataQuery: drill row aggregation failed",e,t)}}))}else o.set(s,t)})),[...o.values()]}injectDrillRowsToResultRows(t,e){const o=new Map;if(!0===this.config.grouped)t.forEach((function(t){e.forEach((function(e){const s=e.findIndex((e=>e.category===t.category&&e.rowGroup===t.rowGroup));if(s>=0){if(o.has(`${t.category}_${t.rowGroup}`)){const e=o.get(`${t.category}_${t.rowGroup}`)||0;o.set(`${t.category}_${t.rowGroup}`,e+1)}else o.set(`${t.category}_${t.rowGroup}`,1);t[i.ROWNR]=o.get(`${t.category}_${t.rowGroup}`),e.splice(s+t[i.ROWNR],0,t)}}))}));else{const s=this.findDuplicateSubCategories(t);t.forEach((function(t){e.forEach((function(e){const n=e.findIndex((e=>null!=e.category&&e.category===t.category));if(n>=0){if(o.has(`${t.category}`)){const e=o.get(`${t.category}`)||0;o.set(`${t.category}`,e+1)}else o.set(`${t.category}`,1);(1===t[i.ROWNR]||s.includes(t.subCategory))&&(t.subCategory=`${t.subCategory} (${t.rowGroup})`),e.splice(n+t[i.ROWNR],0,t)}}))}))}}createThereOfDrillRows(t,e,o,s){if(void 0===this.config.thereOf||0===this.config.thereOf.length)return;const n=[],r=[];this.config.thereOf.forEach((o=>{let s=!0,r="1 <> 1 OR ( ";null!=o.category&&0!==o.category.length&&o.category.trim()&&(r+=` ${i.CATEGORY} = '${o.category}'`,s=!1),null!=o.rowGroup&&0!==o.rowGroup.length&&o.rowGroup.trim()&&(r+=` ${s?"":"AND"} ${i.ROWGROUP} = '${o.rowGroup}'`,s=!1),null!=o.subCategory&&0!==o.subCategory.length&&o.subCategory.trim()&&(r+=` ${s?"":"AND"} ${i.SUBCATEGORY} = '${o.subCategory}'`),r+=")",n.push(`SELECT ROWNUM() AS ${i.ROWNR},\n null as operation,\n 'DRILLELEMENT' as ${i.TYPE},\n ${i.CATEGORY},\n ${i.SUBCATEGORY},\n ${i.ROWGROUP} as ${i.ROWGROUP},\n ${t}\n FROM ?\n WHERE ${r}\n GROUP BY ${i.ROWGROUP}, ${i.CATEGORY}, ${i.SUBCATEGORY}\n ORDER BY ${e[1]}`)})),n.forEach((function(t){r.push(...v(t,[o]))})),this.injectDrillRowsToResultRows(r,s)}calculateRelativeVariances(t,e){t.forEach((t=>{t.forEach((t=>{"GROUPHEAD"!==t[i.TYPE]&&e.forEach(((e,o)=>{t[o]=t[o]/t[e]}))}))}))}calculateColumnGroupRest(t,e){if(null==e||0===e.size)return;const o=new Map,s=new Map;e.forEach(((t,e)=>{const n=t,r=[];for(const t of n)r.push(`${e}##${t.name}`);o.set(e,r),s.set(`${e}##REST`,!1)})),t.forEach((t=>{t.forEach((t=>{"GROUPHEAD"!==t[i.TYPE]&&o.forEach(((e,o)=>{let n=0;e.forEach((e=>{void 0!==t[e]&&(n+=t[e])})),t[`${o}##REST`]=t[o]-n,0!==t[`${o}##REST`]&&s.set(`${o}##REST`,!0)}))}))}));const n=Array.from(s.entries()).filter((([t,e])=>!e)).map((([t])=>t));t.forEach((t=>{t.forEach((t=>{for(const e of n)delete t[e]}))}))}getRelativeScenarios(){const t=new Map;return this.config.scenarios.forEach((e=>{const o=this.createRelativeScenario(e);null!=o&&t.set(o.key,o.value)})),t}translateScenarioSQL(t,e,o){const s=new a(t);return y.OPT===o||y.OPTNOTOTAL===o?s.isValid?"dr"===s.type?`SUM(${s.base} - ${s.delta}) as ${t}, SUM(${s.delta}) as dr_${s.delta}`:`SUM(${s.base} - ${s.delta}) as ${t}`:e?`SUM(${t} * transformOperator(operation)) as ${t}, COUNT(ISNULL(${t})) as ${t}_cnt`:`SUM(${t}) as ${t}, COUNT(ISNULL(${t})) as ${t}_cnt`:s.isValid?"dr"===s.type?`SUM((${s.base} * transformOperator(operation)) - (${s.delta} * transformOperator(operation))) as ${t}, SUM(${s.delta} * transformOperator(operation)) as dr_${s.delta}`:`SUM((${s.base} * transformOperator(operation))- (${s.delta} * transformOperator(operation))) as ${t}`:`SUM(${t} * transformOperator(operation)) as ${t}, COUNT(ISNULL(${t})) as ${t}_cnt`}createOrderString(t){return[`${t.hierarchy.toString()} ${t.direction}`,`${t.hierarchy.toString()} ${M.ASC===t.direction?M.DESC:M.ASC}`]}createRelativeScenario(t){const e=new a(t);return e.isValid&&"dr"===e.type?{key:`${t}`,value:`dr_${e.delta}`}:null}exctractScenarioNames(t){const e=[];return t.split(",").forEach((t=>t.length>=2?e.push(t.split("as")[1].trim()):null)),e}findDuplicateSubCategories(t){const e=t.map((t=>({count:1,subCategory:t.subCategory}))).reduce(((t,e)=>(t[e.subCategory]=(t[e.subCategory]||0)+e.count,t)),{});return Object.keys(e).filter((t=>e[t]>1))}createPartOfQuery(t,e){var o;const s=[];let n="1 <> 1 ",r=` ${i.ROWGROUP}`,a="ROWNUM()";return null===(o=this.config.partOf)||void 0===o||o.forEach((t=>{n+=`OR (${i.CATEGORY} = '${t.category}'`,null!=t.rowGroup&&0!==t.rowGroup.length&&t.rowGroup.trim()&&(n+=`and ${i.ROWGROUP} = '${t.rowGroup}'`),!1===this.config.grouped&&(r=` 'SUM_TOTAL' as ${i.ROWGROUP} `,a="1"),n+=")"})),s.push(`SELECT ${a} AS ${i.ROWNR},\n 'PARTELEMENT' as ${i.TYPE},\n ${i.CATEGORY},\n ${r},\n ${t}\n FROM ?\n WHERE ${n}\n GROUP BY ${i.ROWGROUP}, ${i.CATEGORY}, ${i.TYPE}\n ORDER BY ${e[1]}`),s}checkConfigForPartOf(){return null!=this.config.partOf&&0!==this.config.partOf.length}createThereOfDrillColumns(t,e,o){if(null==t||0===t.size)return;const s=[],n=[];t.forEach(((t,e)=>{let o="1 <> 1 ";t.forEach((t=>{o+=` or columnGroup = '${t.name}' `})),s.push(`SELECT 'ENTRY' as rowlevel,\n 'COLUMNGROUP' as columnlevel,\n rowGroup,\n category,\n columnGroup,\n '${e}' as scenario,\n sum(${e} * transformOperator(operation)) as val\n FROM ?\n WHERE ${o}\n GROUP BY rowlevel, rowGroup, category, columnGroup, scenario`),s.push(`SELECT 'ENTRY' as rowlevel,\n 'SUBGROUP' as columnlevel,\n rowGroup,\n category,\n columnGroup,\n columnSubGroup,\n '${e}' as scenario,\n sum(${e} * transformOperator(operation)) as val\n FROM ?\n WHERE ${o}\n GROUP BY rowlevel, rowGroup, category, columnGroup, columnSubGroup, scenario`),s.push(`SELECT 'DRILLELEMENT' as rowlevel,\n 'COLUMNGROUP' as columnlevel,\n rowGroup,\n category,\n subCategory,\n columnGroup,\n '${e}' as scenario,\n sum(${e} * transformOperator(operation)) as val\n FROM ?\n WHERE ${o}\n GROUP BY rowlevel, rowGroup, category, subCategory, columnGroup, scenario`),s.push(`SELECT 'DRILLELEMENT' as rowlevel,\n 'SUBGROUP' as columnlevel,\n rowGroup,\n category,\n subCategory,\n columnGroup,\n columnSubGroup,\n '${e}' as scenario,\n sum(${e} * transformOperator(operation)) as val\n FROM ?\n WHERE ${o}\n GROUP BY rowlevel, rowGroup, category, subCategory, columnGroup, columnSubGroup, scenario`),s.push(`SELECT 'GROUP_SUM' as rowlevel,\n 'COLUMNGROUP' as columnlevel,\n rowGroup,\n columnGroup,\n '${e}' as scenario,\n sum(${e} * transformOperator(operation)) as val\n FROM ?\n WHERE ${o}\n GROUP BY rowlevel, rowGroup, columnGroup, scenario`),s.push(`SELECT 'GROUP_SUM' as rowlevel,\n 'SUBGROUP' as columnlevel,\n rowGroup,\n columnGroup,\n columnSubGroup,\n '${e}' as scenario,\n sum(${e} * transformOperator(operation)) as val\n FROM ?\n WHERE ${o}\n GROUP BY rowlevel, rowGroup, columnGroup, columnSubGroup, scenario`),s.push(`SELECT 'SUM' as rowlevel,\n 'COLUMNGROUP' as columnlevel,\n columnGroup,\n '${e}' as scenario,\n sum(${e} * transformOperator(operation)) as val\n FROM ?\n WHERE ${o}\n GROUP BY rowlevel, columnGroup, scenario`),s.push(`SELECT 'SUM' as rowlevel,\n 'SUBGROUP' as columnlevel,\n columnGroup,\n columnSubGroup,\n '${e}' as scenario,\n sum(${e} * transformOperator(operation)) as val\n FROM ?\n WHERE ${o}\n GROUP BY rowlevel, columnGroup, columnSubGroup, scenario`)}));for(const t of s)n.push(...v(t,[e]));this.injectDrillColumnsToResultRows(n,o)}injectDrillColumnsToResultRows(t,e){const o="##";for(const s of t)for(const t of e)for(const e of t)e.type===s.rowlevel&&("ENTRY"===s.rowlevel?"COLUMNGROUP"===s.columnlevel&&e.category===s.category?e[s.scenario+o+s.columnGroup]=s.val:"SUBGROUP"===s.columnlevel&&e.category===s.category&&(e[s.scenario+o+s.columnGroup+o+s.columnSubGroup]=s.val):"DRILLELEMENT"===s.rowlevel?"COLUMNGROUP"===s.columnlevel&&e.category===s.category&&e.subCategory===s.subCategory?e[s.scenario+o+s.columnGroup]=s.val:"SUBGROUP"===s.columnlevel&&e.category===s.category&&e.subCategory===s.subCategory?e[s.scenario+o+s.columnGroup+o+s.columnSubGroup]=s.val:"COLUMNGROUP"===s.columnlevel&&e.category===s.category&&e.subCategory===`${s.subCategory} (${s.rowGroup})`?e[s.scenario+o+s.columnGroup]=s.val:"SUBGROUP"===s.columnlevel&&e.category===s.category&&e.subCategory===`${s.subCategory} (${s.rowGroup})`&&(e[s.scenario+o+s.columnGroup+o+s.columnSubGroup]=s.val):("SUM"===s.rowlevel||"GROUP_SUM"===s.rowlevel)&&("COLUMNGROUP"===s.columnlevel&&e.category===s.category&&e.subCategory===s.subCategory&&(e[s.scenario+o+s.columnGroup]=s.val),"SUBGROUP"===s.columnlevel&&e.category===s.category&&e.subCategory===s.subCategory&&(e[s.scenario+o+s.columnGroup+o+s.columnSubGroup]=s.val)))}}class H{constructor(){this.normalizedHeader=[]}createHeader(t,e,o,s,n,i){const a=[];this.normalizedHeader=this.normalizeHeader(t,e);const l=new T(0,0,U.HEADER),c=new T(1,0,U.SEPERATORLINE);for(const t of this.normalizedHeader)l.createElement(r.translateScenarioLabel(t.name,o),t.type,this.createColumnType(t),null,this.setHeaderPrefix(t,o,s,n,i),null,null,null,null),c.createElement(null,t.type,this.createColumnType(t),null,null,null,null,null,null);return a.push(l),a.push(c),a}setHeaderPrefix(t,e,o,s,n){let i="";return"category"===t.name&&n&&(0===o.prefix.length&&0===s.length||(i=r.translateScenarioLabel("in",e)+" "+o.prefix+s)),t.order&&(i+=r.translateScenarioLabel("ORDER_"+t.order,e)),i}normalizeHeader(t,e){let o=[{name:i.CATEGORY,group:i.CATEGORY,type:i.CATEGORY,order:void 0}];return y.OPT!==t&&y.OPTNOTOTAL!==t||(o=[{name:i.OPERATION,group:i.OPERATION,type:i.OPERATION,order:void 0},{name:i.CATEGORY,group:i.CATEGORY,type:i.CATEGORY,order:void 0}]),[...o,...e]}createBodyRows(t,e,o){const s=[];let n=-1;const r=new W(t,e).execute(o),i=this.calculateColumnStatistics(r,t.barColumns);for(const o of r)n+=1,s.push(...this.createRow(t.i18n,e,t.scenariosUnitType,o,n,-1,t.categoryWidth,t.measureScale,t.barColumns,i));return s}calculateColumnStatistics(t,e){const o=new Map;if(!e||0===e.length)return o;const s=new Map;for(const t of e)o.set(t,{min:1/0,max:-1/0,absMax:0,median:0}),s.set(t,[]);for(const n of t)for(const t of n)for(const n of e){const e=this.extractColumnValue(t,n);if(null!==e&&!isNaN(e)){const t=o.get(n);t.min=Math.min(t.min,e),t.max=Math.max(t.max,e),s.get(n).push(Math.abs(e))}}for(const[t,e]of o){e.min!==1/0&&e.max!==-1/0||(e.min=0,e.max=0),e.absMax=Math.max(Math.abs(e.min),Math.abs(e.max));const n=s.get(t);if(n.length>0){n.sort(((t,e)=>t-e));const t=Math.floor(n.length/2);e.median=n.length%2==0?(n[t-1]+n[t])/2:n[t]}o.set(t,e)}return o}extractColumnValue(t,e){if(void 0!==t[e]){const o=Number(t[e]);return isNaN(o)?null:o}for(const o of Object.keys(t))if(o===e||o.endsWith("##"+e)||o===e+"##"+e){const e=Number(t[o]);if(!isNaN(e))return e}return null}createRow(t,e,o,s,n,r,a,l,c,h){var u;const d=[];for(const f of s){const p=f[i.ROWGROUP],m=f[i.SUBCATEGORY],$=f[i.TYPE],v=f[i.ROWNR]>=2,g=this.createDetailRow($,r+=1,n,s.length);for(const s of this.normalizedHeader){const n=this.getRawDataRowElement(f,s),r=null!==(u=null==c?void 0:c.includes(s.type))&&void 0!==u&&u,i=r?null==h?void 0:h.get(s.type):void 0;g.createElement(this.translateSumCellLabel(t,e,n,p,m,$,s.type),s.type,this.createColumnType(s),this.setCellType(s.type,o),this.translateCellPrefix(e,$,s.type),this.translateScenarioCSS(s.type,n),v,a,null==l?void 0:l.value,r,i)}d.push(g)}return d}getRawDataRowElement(t,e){return e.name===e.group&&e.name===e.type?t[e.name]:e.name===e.group&&e.name!==e.type?t[e.type+"##"+e.name]:t[e.type+"##"+e.group+"##"+e.name]}createDetailRow(t,e,o,s){switch(t){case U.GROUPHEAD:return new T(e,o,U.HEADER);case U.SUM:case U.GROUPSUM:return new T(s+2,o,U.SUM);case U.DRILLELEMENT:return new T(s+2,o,U.DRILLELEMENT);case U.PARTELEMENT:return new T(s+2,o,U.PARTELEMENT);default:return new T(e,o,U.STANDARD)}}translateSumCellLabel(t,e,o,s,n,r,i){return!1===Number.isNaN(Number(o))||this.isOperationColumn(i)?o:this.isGroupHeadCategory(r,i)||this.isEntryCategory(r,i)?t===h.ALL?`${e.get(o)||o}`:o:this.isDrillElementCategory(r,i)?t===h.ALL?`${e.get(n)||n}`:`${n}`:this.isPartElementCategory(r,i)?t===h.ALL||"SUM_TOTAL"===s?`${e.get(s)||s}`:`${s}`:this.isSumElementCategory(r,i)?t===h.ALL||"SUM_TOTAL"===s?`${e.get(s)||s}`:s:"GROUPHEAD"===r&&null==o?o:Number.isNaN(Number(o))?"-":Number(o)}isOperationColumn(t){return"operation"===t}translateScenarioCSS(t,e){const o=new a(t);let s="pos";return e<0&&(s="neg"),o.isValid?s+"_"+o.direction+("dr"===o.type?" relative_variance":""):t}setCellType(t,e){if("category"===t)return"";let o;const s=new a(t);return e===u.PERCENT?(o="percent",s.isValid&&"d"===s.type&&(o="decimal")):(o="decimal",s.isValid&&"dr"===s.type&&(o="percent")),o}isDrillElementCategory(t,e){return"DRILLELEMENT"===t&&"category"===e}isPartElementCategory(t,e){return"PARTELEMENT"===t&&"category"===e}isSumElementCategory(t,e){return("GROUP_SUM"===t||"SUM"===t)&&"category"===e}isEntryCategory(t,e){return"ENTRY"===t&&"category"===e}isGroupHeadCategory(t,e){return"GROUPHEAD"===t&&"category"===e}translateCellPrefix(t,e,o){return this.isOperationColumn(o)||this.isGroupHeadCategory(e,o)||this.isEntryCategory(e,o)?null:this.isDrillElementCategory(e,o)?`${t.get("there_of")} `:this.isPartElementCategory(e,o)?`${t.get("part_of")} `:null}createColumnType(t){return t.name===t.group&&t.name===t.type?"base":t.name===t.group?"columnGroup":"columnSubGroup"}}class I{constructor(t,e,o){this.data=[],this.headerRows=[],this.bodyRows=[],this.ruleSet=t||new l,this.dataSetFactory=new H,this.config=this.initConfig(o),this.i18n=this.initI18n(new Map),this.setData(e,o.filter),this.state=O.DIRTY}setI18n(t){this.i18n=this.initI18n(t)}initI18n(t){const e=new Map([["",""],["SEPERATOR_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"],["in","in"],["category"," "],["operation"," "],["there_of","davon"],["part_of","in % von"],["ibcssymbol_delta_ac","Δ{%}"],["ibcssymbol_delta_generic","Δ({%})"],["ibcssymbol_delta_ac_relative","Δ{%}%"],["ibcssymbol_delta_generic_relative","Δ({%})%"],["SUM_TOTAL","❖"]]);return this.state=O.DIRTY,new Map([...e,...t||new Map])}initConfig(t){this.state=O.DIRTY;const e=t,o=this;return t.scenarios.sort(((t,e)=>o.ruleSet.getScenarioSorIndex(t)-o.ruleSet.getScenarioSorIndex(e))),e}setConfig(t){this.config=this.initConfig(t)}setData(t,e){if(null==t)return;if(null!=e&&e.length>0)try{this.data=v(`SELECT * FROM ? WHERE ${e}`,[t])}catch(o){console.error("Table: filter query failed, using unfiltered data",e,o),this.data=t}else this.data=t;const o=this.normalizeScenarios(this.config.scenarios,this.config.categoryThereOf,this.config.sortOrder);this.headerRows=this.dataSetFactory.createHeader(this.config.type,o,this.i18n,this.config.measureScale,this.config.measureUnit,this.config.showMeasureScale),this.bodyRows=this.dataSetFactory.createBodyRows(this.config,this.i18n,this.data),this.state=O.UP_TO_DATE}update(){const t=this.normalizeScenarios(this.config.scenarios,this.config.categoryThereOf,this.config.sortOrder);this.headerRows=this.dataSetFactory.createHeader(this.config.type,t,this.i18n,this.config.measureScale,this.config.measureUnit,this.config.showMeasureScale),this.bodyRows=this.dataSetFactory.createBodyRows(this.config,this.i18n,this.data),this.state=O.UP_TO_DATE}getHeader(){return this.state===O.DIRTY&&this.update(),this.headerRows}getBody(){return this.state===O.DIRTY&&this.update(),this.bodyRows}normalizeScenarios(t,e,o){var s;const n=[];for(const r of t){if(null==e?void 0:e.has(r)){const t=e.get(r);for(const e of t){n.push({name:e.name,group:e.name,type:r,order:void 0});for(const t of e.subGroups)n.push({name:t,group:e.name,type:r,order:void 0})}n.push({name:"REST",group:"REST",type:r,order:void 0})}let t;(null===(s=null==o?void 0:o.hierarchy)||void 0===s?void 0:s.at(0))===r&&(t=o.direction),n.push({name:r,group:r,type:r,order:t})}return n}hasNoData(){return 0===this.data.length}}class z{constructor(){this.title="",this.scenarios=[],this.scenariosUnitType=u.DECIMAL,this.grouped=!1,this.showGroupTitle=!0,this.thereOf=[],this.categoryThereOf=new Map,this.partOf=[],this.sortOrder=new p(new c).default(),this.type=y.LIST,this.limit=0,this.i18n=h.ALL,this.categoryWidth=m.W25,this.measureScale=new R,this.measureUnit="",this.measureType=$.VOLUME,this.showMeasureScale=!0,this.filter="",this.barColumns=[]}}class j{constructor(t,e,o,s){this.tableDrillGroupAdapter=t,this.stringAdapter=e,this.orderAdapter=o,this.dataSet=s}adapt(t){const e=new z;return d.isString(t.title)&&(e.title=t.title),d.isArray(t.scenarios)&&(e.scenarios=f.adaptArray(t.scenarios,this.stringAdapter)),d.isExisting(t.scenariosUnitType)&&(e.scenariosUnitType=t.scenariosUnitType),d.isBoolean(t.grouped)&&(e.grouped=t.grouped),d.isBoolean(t.showGroupTitle)&&(e.showGroupTitle=t.showGroupTitle),d.isBoolean(t.showMeasureScale)&&(e.showMeasureScale=t.showMeasureScale),d.isArray(t.thereOf)&&(e.thereOf=f.adaptArray(t.thereOf,this.tableDrillGroupAdapter)),d.isExisting(t.categoryThereOf)&&(e.categoryThereOf=t.categoryThereOf),d.isArray(t.partOf)&&(e.partOf=f.adaptArray(t.partOf,this.tableDrillGroupAdapter)),d.isExisting(t.order)&&(e.sortOrder=this.orderAdapter.adapt(t.order)),d.isExisting(t.type)&&(e.type=t.type),d.isNumber(t.limit)&&(e.limit=t.limit),d.isExisting(t.i18n)&&(e.i18n=t.i18n),d.isExisting(t.categoryWidth)&&(e.categoryWidth=t.categoryWidth),d.isExisting(t.measureScale)&&(e.measureScale=g.calculateMeasureScale(this.dataSet,e.scenarios,t.measureScale)),d.isExisting(t.measureType)&&(e.measureType=t.measureType),d.isString(t.measureUnit)&&(e.measureUnit=t.measureUnit),d.isString(t.filter)&&(e.filter=t.filter.trim()),d.isArray(t.barColumns)&&(e.barColumns=t.barColumns),e}default(){return new z}}class V{constructor(){this.rowGroup="",this.category="",this.subCategory="",this.partOf=""}}class Q{constructor(){}adapt(t){const e=new V;return d.isString(t.rowGroup)&&(e.rowGroup=t.rowGroup),d.isString(t.category)&&(e.category=t.category),d.isString(t.subCategory)&&(e.subCategory=t.subCategory),d.isString(t.partOf)&&(e.partOf=t.partOf),e}default(){return new V}}class q{constructor(){this.operation="+"}addRowGroup(t,e){this.rowGroup=t,this.rowGroupIndex=e}addCategory(t,e){this.category=t,this.categoryIndex=e}addSubCategory(t,e){this.subCategory=t,this.subCategoryIndex=e}addColumnGroup(t,e){this.columnGroup=t,this.columnGroupIndex=e}addSubColumnGroup(t,e){this.columnSubGroup=t,this.columnSubGroupIndex=e}}class K{constructor(){}adapt(t){const e=new q;return d.isOperator(t.operation)&&(e.operation=t.operation),d.isNumber(t.rowGroupIndex)&&d.isString(t.rowGroup)&&e.addRowGroup(t.rowGroup,t.rowGroupIndex),d.isNumber(t.categoryIndex)&&d.isString(t.category)&&e.addCategory(t.category,t.categoryIndex),d.isNumber(t.subCategoryIndex)&&d.isString(t.subCategory)&&e.addSubCategory(t.subCategory,t.subCategoryIndex),d.isNumber(t.columnGroupIndex)&&d.isString(t.columnGroup)&&e.addColumnGroup(t.columnGroup,t.columnGroupIndex),d.isNumber(t.columnSubGroupIndex)&&d.isString(t.columnSubGroup)&&e.addSubColumnGroup(t.columnSubGroup,t.columnSubGroupIndex),this.setActualValues(t,e),this.setPlanValues(t,e),this.setPreviousPeriodValues(t,e),this.setForecastValues(t,e),e}default(){return new q}setActualValues(t,e){d.isNumber(t.ac1)&&(e.ac1=t.ac1),d.isNumber(t.ac2)&&(e.ac2=t.ac2),d.isNumber(t.ac3)&&(e.ac3=t.ac3),d.isNumber(t.ac4)&&(e.ac4=t.ac4)}setPlanValues(t,e){d.isNumber(t.pp1)&&(e.pp1=t.pp1),d.isNumber(t.pp2)&&(e.pp2=t.pp2),d.isNumber(t.pp3)&&(e.pp3=t.pp3),d.isNumber(t.pp4)&&(e.pp4=t.pp4)}setPreviousPeriodValues(t,e){d.isNumber(t.pl1)&&(e.pl1=t.pl1),d.isNumber(t.pl2)&&(e.pl2=t.pl2),d.isNumber(t.pl3)&&(e.pl3=t.pl3),d.isNumber(t.pl4)&&(e.pl4=t.pl4)}setForecastValues(t,e){d.isNumber(t.fc1)&&(e.fc1=t.fc1),d.isNumber(t.fc2)&&(e.fc2=t.fc2),d.isNumber(t.fc3)&&(e.fc3=t.fc3),d.isNumber(t.fc4)&&(e.fc4=t.fc4)}}const J=e(class extends o{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.data=[],this.tableTitle="SUM_TOTAL",this.scenarios=[],this.scenariosDataFormat=u.DECIMAL,this.grouped=!1,this.limit=0,this.showGroupTitle=!0,this.thereof=[],this.partof=[],this.order={hierarchy:[],direction:M.ASC},this.categorythereof=new Map,this.type=y.LIST,this.categoryWidth=m.INF,this.dataFormatDigits={percent:2,decimal:1},this.i18n=new Map,this.i18nMode=h.ALL,this.measureScale="_",this.measureUnit="",this.showMeasureScale=!0,this.measureType=$.VOLUME,this.filter="",this.barColumns=[],this.barColumnMaxWidth=30,this.unitScaling=.01,this.percentageScaling=.5,this.scaleFactor=1,this.componentDataFormatDigits=new w,this.componentStyle=S(this)}render(){return t(s,null,(()=>{if(void 0!==this.table){if(this.table.hasNoData()){const e=this.i18n.get("NO_DATA")||"==No Data==";return t("p",{class:"warning"},e)}return t("table",null,t("thead",null,this.table.getHeader().map((e=>t("tr",{class:e.cssStyle},e.getCells().map((e=>t("th",{colSpan:e.colSpan,class:e.cssStyle},e.getAsHeaderList().map(((o,s,n)=>t("span",null,s===n.length-1?t("span",{class:" "===o?"table-footer":""},o,e.drawPrefix()," "):t("span",null,o,e.drawPrefix(),t("br",null)))))))))))),t("tbody",null,this.table.getBody().map((e=>t("tr",{class:e.cssStyle},null==e?void 0:e.getCells().map((o=>t("td",{colSpan:o.colSpan,class:o.type?`${o.cssStyle} ${o.type}`:o.cssStyle},null!=o.prefix?t("span",{class:o.cssStyle+" "+o.prefixStyle},o.drawPrefix()):"",o.isBarChart&&o.columnStats&&e.type!==U.SUM?t(F,{value:o.value,scenario:o.key,columnStats:o.columnStats,height:18*this.scaleFactor,isRelative:o.key.startsWith("dr"),isPositiveGood:o.key.endsWith("_pos"),measureScale:o.measureScale,maxBarWidth:this.barColumnMaxWidth,styles:this.barChartStyles}):o.draw(this.componentDataFormatDigits)))))))))}})())}componentWillRender(){const t=this.prepareConfig(),e=this.prepareData();this.componentDataFormatDigits=(new b).adapt(this.dataFormatDigits),this.table=new I(new l,e,t),this.table.setI18n(this.i18n),this.barChartStyles=this.prepareBarChartStyles()}prepareConfig(){return new j(new Q,new c,new p(new c),this.data).adapt({title:this.tableTitle,scenarios:this.scenarios,scenariosUnitType:this.scenariosDataFormat,grouped:this.grouped,showGroupTitle:this.showGroupTitle,thereOf:this.thereof,partOf:this.partof,categoryThereOf:this.categorythereof,order:this.order,type:this.type,limit:this.limit,i18n:this.i18nMode,categoryWidth:this.categoryWidth,measureScale:this.measureScale,measureUnit:this.measureUnit,measureType:this.measureType,showMeasureScale:this.showMeasureScale,filter:this.filter,barColumns:this.barColumns})}prepareData(){return f.adaptArray(this.data,new K)}prepareBarChartStyles(){return this.componentStyle((t=>{var e,o,s,n,r,i,a,l,c,h,u,d,f,p,m,$,v,g,R,w,b,S,E,O,y,M;const U=null===(e=t["bn-chart-time"])||void 0===e?void 0:e.varianceStyles,G=null===(o=t["bn-chart-time"])||void 0===o?void 0:o.barStyles;return{positive:{stroke:(null===(s=null==U?void 0:U.pos)||void 0===s?void 0:s.stroke)||"#008f96",fill:(null===(n=null==U?void 0:U.pos)||void 0===n?void 0:n.fill)||"#008f96",fillpattern:(null===(r=null==U?void 0:U.pos)||void 0===r?void 0:r.fillpattern)||"solid"},negative:{stroke:(null===(i=null==U?void 0:U.neg)||void 0===i?void 0:i.stroke)||"#ff0000",fill:(null===(a=null==U?void 0:U.neg)||void 0===a?void 0:a.fill)||"#ff0000",fillpattern:(null===(l=null==U?void 0:U.neg)||void 0===l?void 0:l.fillpattern)||"solid"},neutral:{stroke:(null===(c=null==U?void 0:U.neu)||void 0===c?void 0:c.stroke)||"#808080",fill:(null===(h=null==U?void 0:U.neu)||void 0===h?void 0:h.fill)||"#808080",fillpattern:(null===(u=null==U?void 0:U.neu)||void 0===u?void 0:u.fillpattern)||"outlined"},scenarios:{ac:{stroke:(null===(d=null==G?void 0:G.ac)||void 0===d?void 0:d.stroke)||"#404040",fill:(null===(f=null==G?void 0:G.ac)||void 0===f?void 0:f.fill)||"#404040",fillpattern:(null===(p=null==G?void 0:G.ac)||void 0===p?void 0:p.fillpattern)||"solid"},pp:{stroke:(null===(m=null==G?void 0:G.pp)||void 0===m?void 0:m.stroke)||"#A6A6A6",fill:(null===($=null==G?void 0:G.pp)||void 0===$?void 0:$.fill)||"#A6A6A6",fillpattern:(null===(v=null==G?void 0:G.pp)||void 0===v?void 0:v.fillpattern)||"solid"},fc:{stroke:(null===(g=null==G?void 0:G.fc)||void 0===g?void 0:g.stroke)||"#404040",fill:(null===(R=null==G?void 0:G.fc)||void 0===R?void 0:R.fill)||"#ffffff",fillpattern:(null===(w=null==G?void 0:G.fc)||void 0===w?void 0:w.fillpattern)||"hatched"},pl:{stroke:(null===(b=null==G?void 0:G.pl)||void 0===b?void 0:b.stroke)||"#404040",fill:(null===(S=null==G?void 0:G.pl)||void 0===S?void 0:S.fill)||"#ffffff",fillpattern:(null===(E=null==G?void 0:G.pl)||void 0===E?void 0:E.fillpattern)||"outlined"}},fontColor:(null===(O=t.global)||void 0===O?void 0:O.fontColor)||"#000000",fontSize:.85*((null===(y=t.global)||void 0===y?void 0:y.fontSizePx)||13.3333)*this.scaleFactor,fontFamily:(null===(M=t.global)||void 0===M?void 0:M.fontFamily)||"'Noto Sans', sans-serif",unitScaling:this.unitScaling>0?this.unitScaling:this.autoUnitScaling(),percentageScaling:this.percentageScaling>0?this.percentageScaling:this.autoPercentageScaling(),scaleFactor:this.scaleFactor}}))}autoUnitScaling(){const t=this.componentStyle((t=>{var e;return.85*((null===(e=t.global)||void 0===e?void 0:e.fontSizePx)||13.3333)*this.scaleFactor})),e=this.barColumnMaxWidth*t*.8,o=this.getMaxAbsValue();return o<=0||t<=0?.01:e/(o*t)}autoPercentageScaling(){const t=this.componentStyle((t=>{var e;return.85*((null===(e=t.global)||void 0===e?void 0:e.fontSizePx)||13.3333)*this.scaleFactor})),e=.8*Math.round(.67*this.barColumnMaxWidth*t),o=this.getMaxRelativeValue();return o<=0||t<=0?.5:e/(o*t)}getMaxAbsValue(){if(!this.table)return 0;let t=0;for(const e of this.table.getBody())if(e.type!==U.SUM)for(const o of e.getCells())o.isBarChart&&o.columnStats&&!o.key.startsWith("dr")&&(t=Math.max(t,o.columnStats.absMax));return t}getMaxRelativeValue(){if(!this.table)return 0;let t=0;for(const e of this.table.getBody())if(e.type!==U.SUM)for(const o of e.getCells())o.isBarChart&&o.columnStats&&o.key.startsWith("dr")&&(t=Math.max(t,100*o.columnStats.absMax));return t}get element(){return this}static get style(){return':host{position:relative;display:inline-block}table{background-color:var(--bn-font-background, white);font-size:var(--bn-font-size, 1em);color:var(--bn-font-color, black);font-family:var(--bn-font-family, "Noto Sans", "Helvetica Neue", Helvetica, sans-serif);border-spacing:0.3em 0}thead{border-style:none}tr:first-child td{border-top:none;padding-top:0.5em}td.ac1,td.ac2,td.ac3,td.ac4,td.pp1,td.pp2,td.pp3,td.pp4,td.pl1,td.pl2,td.pl3,td.pl4,td.fc1,td.fc2,td.fc3,td.fc4,td.share,td.variance,td.pos_pos,td.pos_neg,td.neg_pos,td.neg_neg,td.pos_neutral,td.neg_neutral{text-align:right}.category-w100{min-width:100em;max-width:100em}.category-w50{min-width:50em;max-width:50em}.category-w25{min-width:25em;max-width:25em}.category-w20{min-width:20em;max-width:20em}.category-w15{min-width:15em;max-width:15em}.category-w10{min-width:10em;max-width:10em}.category-w5{min-width:5em;max-width:5em}.prefix-second{color:transparent;font-style:normal}.prefix-first{font-style:normal}th{border-bottom:0.1em solid black;text-align:right;font-weight:normal;vertical-align:text-top}td.columnGroup,th.columnGroup{font-size:0.6em}td.columnSubGroup,th.columnSubGroup{font-size:0.6em;border-spacing:0em 0;font-style:italic}td.base,th.base{font-style:normal}th.ofit,td.ofit,tr.ofit,th.partof,td.partof,tr.partof{font-size:0.6em;font-style:italic}td.ofit,td.partof{font-size:0.6em;font-style:italic}th.ofit td,tr.ofit td,th.partof td,tr.partof td{border-top:0em solid black;padding-left:1em}th.ofit share,th.partof share,tr.share td{border-top:0em solid black}th.share,tr.share,td.share{font-size:0.6em;font-style:italic}th.filler{border-bottom:0em solid black;text-align:right}td.filler{border-top:0em none !important;border-bottom:0em none;text-align:right}th.group{text-align:center;border-spacing:1em 0}th.headerlabel{border-bottom:0em none black;padding-bottom:0em}td.variance:after{content:"%"}td.relative_variance{font-style:italic}td.percent{font-style:italic;text-align:right}td.decimal{text-align:right}td.pos_pos{color:#008f96}td.neg_pos{color:#ff0000}td.pos_neg{color:#ff0000}td.neg_neg{color:#008f96}td.pos_pos:before{content:"+"}td.pos_neg:before{content:"+"}td.pos_neu:before{content:"+"}th.ac1,th.ac2,th.ac3,th.ac4{padding-top:0em;border-bottom:0.3em solid black}th.pp1,th.pp2,th.pp3,th.pp4{padding-top:0em;border-bottom:0.3em solid grey}th.pl1,th.pl2,th.pl3,th.pl4{padding-top:0em;border-bottom:0.3em double black}th.fc1,th.fc2,th.fc3,th.fc4{border-bottom:0.3em solid;border-image:repeating-linear-gradient(-45deg, white, white, black, white, white 0.3em) 2}td.colsum{font-weight:bold}th.colsum{padding-top:0em;font-weight:bold}tr.sum td{border-top:0.1em solid black;font-weight:bold;padding-bottom:0.5em}tr.groupheader td{border-top:0em dotted #ddd;padding-top:0.5em;font-weight:bold;font-style:italic}tr.begingroup td{border-top:0em dotted #ddd;padding-top:0.5em}th.begin-group{padding-left:0.75em}th.end-group{padding-left:0.75em}td{box-sizing:border-box;-webkit-box-sizing:border-box;border-top:0.1em dashed #ddd;padding-left:0.5em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.table-footer{font-size:0.6em}.cell-bar-chart{display:inline-block;vertical-align:middle}.bar-chart-empty{color:#999}td:has(.cell-bar-chart){padding:0 0.25em;vertical-align:middle}td:has(.cell-bar-chart).pos_pos:before,td:has(.cell-bar-chart).pos_neg:before,td:has(.cell-bar-chart).pos_neu:before{content:none}td:has(.cell-bar-chart).variance:after{content:none}'}},[1,"ibcs-table",{data:[16],tableTitle:[1,"table-title"],scenarios:[16],scenariosDataFormat:[1,"scenarios-data-format"],grouped:[4],limit:[2],showGroupTitle:[4,"show-group-title"],thereof:[16],partof:[16],order:[16],categorythereof:[16],type:[1],categoryWidth:[1,"category-width"],dataFormatDigits:[16],i18n:[1040],i18nMode:[1,"i18n-mode"],measureScale:[1,"measure-scale"],measureUnit:[1,"measure-unit"],showMeasureScale:[4,"show-measure-scale"],measureType:[1,"measure-type"],filter:[1],barColumns:[16],barColumnMaxWidth:[2,"bar-column-max-width"],unitScaling:[2,"unit-scaling"],percentageScaling:[2,"percentage-scaling"],scaleFactor:[2,"scale-factor"]}]);function X(){"undefined"!=typeof customElements&&["ibcs-table"].forEach((t=>{"ibcs-table"===t&&(customElements.get(n(t))||customElements.define(n(t),J))}))}export{J as I,y as T,X as d}
1
+ import{h as t,proxyCustomElement as e,HTMLElement as o,Host as s,transformTag as i}from"@stencil/core/internal/client";import{F as n,Q as r,V as a,I as l,S as c}from"./ibcsRuleSet.js";import{I as h,D as u,i as d,j as f,k as p,e as m,M as $}from"./Order.js";import{d as v,g}from"./context-protocol.js";import{D as R,S as w,a as b,b as S}from"./DataFormatDigits.js";import{w as E}from"./withComponentStyle.js";var O,y,M,U,G;!function(t){t[t.ALL=-1]="ALL"}(O||(O={})),function(t){t[t.UP_TO_DATE=0]="UP_TO_DATE",t[t.DIRTY=1]="DIRTY"}(y||(y={})),function(t){t.LIST="list",t.SUM="sum",t.SUMNOTOTAL="sumnototal",t.OPT="opt",t.OPTNOTOTAL="optnototal"}(M||(M={})),function(t){t.ASC="asc",t.DESC="desc"}(U||(U={})),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"}(G||(G={}));class T{constructor(t,e,o,s,i,n,r,a,l){this.prefixStyle="prefix",this.isBarChart=!1,this.key=t,this.index=e,this.value=o,this.prefix=n||"",this.cssStyle=s||"",this.prefixStyle=r||"prefix",this.type=i,this.mark=void 0,this.colSpan=a||1,this.measureScale=l||1}getAsHeaderList(){if(null==this.value)return[""];const t=[];for(const e of this.value.toString().split("<br/>"))t.push(e);return t}draw(t){let e=this.value;if("undefined"===e||void 0===e||null==e)return"";if(Number.isNaN(Number(e)))return e;if(""===this.type||void 0===this.type||null==this.type)return e;let o=t.percent,s=t.percent;return"decimal"===this.type&&(e=+e/this.measureScale,o=t.decimal,s=t.decimal),n.number(Number(e),this.type,o,s)}drawPrefix(){return null==this.prefix?"":this.prefix}}class _{constructor(t,e,o){this.index=t,this.groupindex=e,this.type=o,this.cssStyle=this.initCssStyle(),this.elements=[]}initCssStyle(){switch(this.type){case G.HEADER:return"groupheader";case G.SEPERATORLINE:return"";case G.DRILLELEMENT:return"ofit";case G.PARTELEMENT:return"partof";case G.STANDARD:return"";case G.SUM:return"sum";default:return""}}getCells(){return this.elements}createElement(t,e,o,s,i,n,r,a,l,c=!1,h){let u=n;"category"===e&&null!=a&&(u=`category-${a.toString()}`),this.type===G.HEADER?u="headerlabel":this.type===G.SEPERATORLINE&&(u=e),this.type===G.PARTELEMENT&&("percent"===s&&(t="-"),"category"!==e&&"operation"!==e&&(s="percent",u="")),"-"===t&&(u="");let d="prefix-first";r&&(d="prefix-second"),o&&(u=`${u} ${o}`);const f=new T(e,this.elements.length,t,u,s,i,d,1,l);f.isBarChart=c,f.columnStats=h,this.elements.push(f)}}const C={positive:{stroke:"#008f96",fill:"#008f96",fillpattern:"solid"},negative:{stroke:"#ff0000",fill:"#ff0000",fillpattern:"solid"},neutral:{stroke:"#808080",fill:"#808080",fillpattern:"outlined"},scenarios:{ac:{stroke:"#404040",fill:"#404040",fillpattern:"solid"},pp:{stroke:"#A6A6A6",fill:"#A6A6A6",fillpattern:"solid"},fc:{stroke:"#404040",fill:"#ffffff",fillpattern:"hatched"},pl:{stroke:"#404040",fill:"#ffffff",fillpattern:"outlined"}},fontColor:"#000000",fontSize:11,fontFamily:"'Noto Sans', sans-serif",unitScaling:.01,percentageScaling:.5,scaleFactor:1},N="#666666";function L(t,e){return`pattern-${t}-${e.replace("#","")}`}const P=({styles:e})=>{const o=e.scaleFactor,s=6*o,i=[{id:L("pos",e.positive.stroke),stroke:e.positive.stroke,fill:e.positive.fill},{id:L("neg",e.negative.stroke),stroke:e.negative.stroke,fill:e.negative.fill},{id:L("neu",e.neutral.stroke),stroke:e.neutral.stroke,fill:e.neutral.fill}];return t("defs",null,i.map((e=>t("pattern",{id:e.id,patternUnits:"userSpaceOnUse",width:s,height:s},t("rect",{width:s,height:s,fill:"#ffffff"}),t("line",{x1:"0",y1:s,x2:s,y2:"0",stroke:e.stroke,"stroke-width":1.5*o})))))};function x(t,e,o=1){let s,i;const n=t>=0?"+":"";if(e)return s=100*t,n+Math.round(s).toString()+"%";{let e;return s=t/o,i=Math.abs(s),e=i>=1e9?(s/1e9).toFixed(i>=1e10?0:1)+"B":i>=1e6?(s/1e6).toFixed(i>=1e7?0:1)+"M":i>=1e3?(s/1e3).toFixed(i>=1e4?0:1)+"K":s.toFixed(i>=10?0:1),e=e.replace(/\.0([KMB]?)$/,"$1"),n+e}}function k(t){const e=t.slice(0,2).toLowerCase();return["ac","pp","fc","pl"].includes(e)}function A(t){const e=t.slice(0,2).toLowerCase();return"pp"===e?"pp":"fc"===e?"fc":"pl"===e?"pl":"ac"}function D(t,e,o,s){return k(t)?function(t,e){const o=A(t);return e.scenarios[o]}(t,s):function(t,e,o){const s=t>=0;return e?s?o.positive:o.negative:s?o.negative:o.positive}(e,o,s)}const B=e=>{const{value:o,scenario:s,columnStats:i,height:n,isPositiveGood:r,formattedValue:a,measureScale:l,maxBarWidth:c=10,styles:h=C}=e,u=h.scaleFactor,d=h.fontSize,f=38*u,p=c*d,m=4*u,$=.15*p,v=p-m-$,g=Math.abs(o)*h.unitScaling*d,R=g>v,w=Math.max(0,i.absMax*h.unitScaling*d-v),b=Math.max(0,g-v),S=w>0?b/w*$:0,E=i.min<0,O=i.max>0,y=E?p:0,M=(E?f:0)+(y+(O?p:0))+(O?f:0),U=2*u,G=n-2*U,T=(E?f:0)+y,_=U,B=o>=0,F=D(s,o,r,h),Y=function(t,e){const o=t.fillpattern;return"hatched"===o?`url(#${L(e,t.stroke)})`:"outlined"===o?"transparent":t.fill}(F,k(s)?A(s):r?B?"pos":"neg":B?"neg":"pos"),{stroke:W,strokeWidth:H}="outlined"===(I=F).fillpattern?{stroke:I.stroke,strokeWidth:1.5}:{stroke:"none",strokeWidth:0};var I;const z=a||x(o,!1,l),j=R?v:g,Q=R?v+m+S:g,V=B?T+Q+4*u:T-Q-4*u,q=B?"start":"end";return t("svg",{width:M,height:n,class:"cell-bar-chart absolute-variance",style:{overflow:"visible"}},t(P,{styles:h}),t("line",{x1:T,y1:0,x2:T,y2:n,stroke:N,"stroke-width":1*u}),j>0&&t("rect",{x:B?T:T-j,y:_,width:j,height:G,fill:Y,stroke:W,"stroke-width":H*u}),R&&S>0&&t("rect",{x:B?T+v+m:T-v-m-S,y:_,width:S,height:G,fill:Y,stroke:W,"stroke-width":H*u}),R&&function(e,o,s,i,n){const r=e+o/2,a=.35*o,l=i/3,c=.3*o;let h=`M ${r-a} ${s}`;for(let t=0;t<3;t++)h+=` L ${r-a-c} ${s+l*(t+.5)} L ${r-a} ${s+l*(t+1)}`;let u=`M ${r+a} ${s}`;for(let t=0;t<3;t++)u+=` L ${r+a+c} ${s+l*(t+.5)} L ${r+a} ${s+l*(t+1)}`;return[t("rect",{x:e,y:s-1,width:o,height:i+2,fill:"#ffffff"}),t("path",{d:h,fill:"none",stroke:"#000000","stroke-width":1*n}),t("path",{d:u,fill:"none",stroke:"#000000","stroke-width":1*n})]}(B?T+v:T-v-m,m,_,G,u),t("text",{x:V,y:n/2,dy:"0.35em","text-anchor":q,fill:h.fontColor,"font-size":d,"font-family":h.fontFamily},z))},F=e=>{const{value:o,scenario:s,columnStats:i,height:n,isPositiveGood:r,formattedValue:a,measureScale:l,maxBarWidth:c=10,styles:h=C}=e,u=h.scaleFactor,d=h.fontSize,f=Math.round(.67*c*d),p=5*u,m=i.min<0?f+p:0,$=m+(i.max>0?f+p:0),v=$+45*u,g=m,R=n/2,w=100*Math.abs(o)*h.percentageScaling*d,b=w>f,S=Math.min(w,f),E=o>=0,O=E?g+S:g-S,y=D(s,o,r,h),M=3*u,U=a||x(o,!0,l),G=$+4*u;return t("svg",{width:v,height:n,class:"cell-bar-chart relative-variance",style:{overflow:"visible"}},t("line",{x1:g,y1:0,x2:g,y2:n,stroke:N,"stroke-width":1*u}),!b&&t("circle",{cx:O,cy:R,r:M,fill:h.fontColor}),t("line",{x1:g,y1:R,x2:O,y2:R,stroke:y.fill,"stroke-width":2*u}),b&&E&&t("polygon",{points:`${g+f},${R} ${g+f-6*u},${R-3*u} ${g+f-6*u},${R+3*u}`,fill:y.fill}),b&&!E&&t("polygon",{points:`${g-f},${R} ${g-f+6*u},${R-3*u} ${g-f+6*u},${R+3*u}`,fill:y.fill}),t("text",{x:G,y:n/2,dy:"0.35em","text-anchor":"start",fill:h.fontColor,"font-size":d,"font-style":"italic","font-family":h.fontFamily},U))},Y=e=>{const{value:o,columnStats:s,isRelative:i,styles:n=C}=e;return null==o||isNaN(o)||!s||0===s.absMax?t("span",{class:"bar-chart-empty",style:{color:n.fontColor,fontStyle:"italic"}},"-"):t(i?F:B,Object.assign({},e))};class W{constructor(t){this.groups=[r.CATEGORY,r.CATEGORYINDEX],M.OPT!==t.type&&M.OPTNOTOTAL!==t.type||this.groups.unshift(r.OPERATION),t.grouped&&(this.groups.push(r.ROWGROUP),this.groups.push(r.ROWGROUPINDEX))}toString(){return this.groups.map((t=>`${t}`)).toString()}noCategory(){return this.groups.filter((t=>t!==r.CATEGORY))}toArray(){return this.groups}}class H{constructor(t,e){this.hasPartOf=!1,this.config=t,this.i18n=e}execute(t,e){var o;this.db=t,this.fromExpr=e;const s=[],i=[],n=[],a=this.config.scenarios.map((t=>this.translateScenarioSQL(t,!1,this.config.type))).toString(),l=this.config.scenarios.map((t=>this.translateScenarioSQL(t,!0,this.config.type))).toString(),c=this.getRelativeScenarios(),h=new W(this.config),u=this.config.grouped?[r.ROWGROUP,r.ROWGROUPINDEX]:[];let d,f=["",""];this.config.sortOrder.hierarchy.length>0&&(f=this.createOrderString(this.config.sortOrder)),this.hasPartOf=this.checkConfigForPartOf();try{d=t.exec(`SELECT COUNT(DISTINCT ${r.CATEGORY}) as ${r.TOTALROWCOUNT} ${u.length>0?","+u:""}\n FROM ${e} ${u.length>0?"GROUP BY "+u:""}\n ORDER BY ${f[0]}`)}catch(t){return console.error("DataQuery: meta query failed",t),[]}return 0===d.length||1===d.length&&0===(null!==(o=d[0][r.TOTALROWCOUNT])&&void 0!==o?o:0)&&0===u.length?[]:(d.forEach((t=>{const e=t.rowGroup&&t.rowGroup.length>0?`WHERE ${r.ROWGROUP} = '${t.rowGroup}'`:"";let o="";this.config.limit&&(o=`LIMIT ${this.config.limit}`),this.createGroupHeaderRow(t,s),this.createDataRow(s,t,h,a,e,f,o),this.createRestRow(t,s,h,a,e,f),this.createGroupSumRow(s,i,t,l,f)})),this.createTotalSumRow(s,i,l),s.forEach((e=>{try{n.push(t.exec(e))}catch(t){console.error("DataQuery: SQL query execution failed",e,t)}})),this.detectNaNCells(this.config.scenarios,n),this.createThereOfDrillRows(a,f,n),this.createPartOfDrillRows(a,f,i,n),this.createThereOfDrillColumns(this.config.categoryThereOf,n),this.calculateColumnGroupRest(n,this.config.categoryThereOf),this.calculateRelativeVariances(n,c),n)}detectNaNCells(t,e){e.forEach((e=>{e.map((e=>(t.forEach((t=>{const o=new a(t);!0===o.isValid?0!==e[o.base+"_cnt"]&&0!==e[o.delta+"_cnt"]||(e[t]=Number.NaN):0===e[t+"_cnt"]&&(e[t]=Number.NaN)})),e)))}))}createPartOfDrillRows(t,e,o,s){if(null==this.config.partOf||0===this.config.partOf.length||this.config.type===M.LIST)return;const i=this.createPartOfQuery(t,e);let n=[];const a=this.db;i.forEach((function(t){n.push(...a.exec(t))}));const l=this.exctractScenarioNames(t),c=[];o.forEach((function(t){c.push(...a.exec(t))}));const h=new Map;c.forEach((t=>h.set(t[r.ROWGROUP],t))),n=this.reduceResDrillByCategoryGroups(n,l),n.forEach((function(t){l.forEach((e=>{try{t[e]=t[e]/h.get(t[r.ROWGROUP])[e]}catch(o){console.error("DataQuery: partOf drill row calculation failed",e,o),t[e]=Number.NaN}}))})),this.injectDrillRowsToResultRows(n,s)}createRestRow(t,e,o,s,i,n){t.totalRowCnt-this.config.limit>0&&0!==this.config.limit&&e.push(`SELECT ${r.ROWNR}, 1 as ${r.ROWGROUPINDEX} , 'ENTRY' as ${r.TYPE}, 'NO_GROUP' as ${r.ROWGROUP}, 'REST' as ${r.CATEGORY} , SUM(ac1) as ac1, SUM(pp1) as pp1, SUM(dpp1_ac1_pos) as dpp1_ac1_pos, SUM(drpp1_ac1_pos) as drpp1_ac1_pos, SUM(dr_pp1) as dr_pp1 FROM (SELECT ROWNUM() AS ${r.ROWNR}, ${e.length} as ${r.ROWGROUPINDEX} , 'ENTRY' as ${r.TYPE}, '${t.rowGroup||"NO_GROUP"}' as ${r.ROWGROUP}, ${o} ${s.length>0?",".concat(s):""} FROM ${this.fromExpr} ${i} GROUP BY ${o} ORDER BY ${n[0]}) t WHERE t.rowNr > ${this.config.limit}`)}createDataRow(t,e,o,s,i,n,a){t.push(`SELECT ROWNUM() AS ${r.ROWNR},\n ${t.length} as ${r.ROWGROUPINDEX},\n 'ENTRY' as ${r.TYPE},\n '${e.rowGroup||"NO_GROUP"}' as ${r.ROWGROUP},\n '${r.CATEGORYINDEX}',\n ${o} ${s.length>0?",".concat(s):""}\n FROM ${this.fromExpr} ${i}\n GROUP BY ${o}\n ORDER BY ${n[0]} ${a}`)}createGroupHeaderRow(t,e){!0===this.config.grouped&&e.push(`SELECT ROWNUM() AS ${r.ROWNR},\n ${e.length} as ${r.ROWGROUPINDEX},\n 'GROUPHEAD' as ${r.TYPE},\n '${t.rowGroup}' as ${r.ROWGROUP} ${this.config.showGroupTitle?`,'${t.rowGroup}' as ${r.CATEGORY}`:""}\n FROM ${this.fromExpr}\n GROUP BY '1'`)}createGroupSumRow(t,e,o,s,i){!0!==this.config.grouped||M.SUM!==this.config.type&&M.SUMNOTOTAL!==this.config.type&&M.OPT!==this.config.type&&M.OPTNOTOTAL!==this.config.type||(t.push(`SELECT ${t.length} as ${r.ROWGROUPINDEX},\n '=' as ${r.OPERATION},\n '${o.rowGroup}' as ${r.ROWGROUP},\n ROWNUM() AS ${r.ROWNR},\n 'GROUP_SUM' as ${r.TYPE} ${s.length>0?",".concat(s):""}\n FROM ${this.fromExpr}\n WHERE ${r.ROWGROUP} = '${o.rowGroup}'\n ORDER BY ${i[0]} `),e.push(`SELECT ${t.length} as ${r.ROWGROUPINDEX},\n '=' as ${r.OPERATION},\n '${o.rowGroup}' as ${r.ROWGROUP},\n ROWNUM() AS ${r.ROWNR},\n 'GROUP_SUM' as ${r.TYPE} ${s.length>0?",".concat(s):""}\n FROM ${this.fromExpr}\n WHERE ${r.ROWGROUP} = '${o.rowGroup}'\n ORDER BY ${i[0]} `))}createTotalSumRow(t,e,o){if(M.SUM===this.config.type||M.OPT===this.config.type){const e=`${this.hasPartOf&&!1===this.config.grouped?`${this.i18n.get("SUM_TOTAL")||"SUM_TOTAL"} `:""}${this.config.title}`;t.push(`SELECT ${t.length} as ${r.ROWGROUPINDEX},\n '${e}' as ${r.ROWGROUP},\n '=' as ${r.OPERATION},\n 'SUM' as ${r.TYPE} ${o.length>0?",".concat(o):""}\n FROM ${this.fromExpr} `)}e.push(`SELECT ${t.length} as ${r.ROWGROUPINDEX},\n 'SUM_TOTAL' as ${r.ROWGROUP},\n '=' as ${r.OPERATION},\n 'SUM' as ${r.TYPE} ${o.length>0?",".concat(o):""}\n FROM ${this.fromExpr} `)}reduceResDrillByCategoryGroups(t,e){const o=new Map;return t.forEach((function(t){const s=t.rowNr+t.rowGroup+t.type+t.category;if(o.has(s)){const i=o.get(s);e.forEach((e=>{try{i[e]+=t[e]}catch(t){console.error("DataQuery: drill row aggregation failed",e,t)}}))}else o.set(s,t)})),[...o.values()]}injectDrillRowsToResultRows(t,e){const o=new Map;if(!0===this.config.grouped)t.forEach((function(t){e.forEach((function(e){const s=e.findIndex((e=>e.category===t.category&&e.rowGroup===t.rowGroup));if(s>=0){if(o.has(`${t.category}_${t.rowGroup}`)){const e=o.get(`${t.category}_${t.rowGroup}`)||0;o.set(`${t.category}_${t.rowGroup}`,e+1)}else o.set(`${t.category}_${t.rowGroup}`,1);t[r.ROWNR]=o.get(`${t.category}_${t.rowGroup}`),e.splice(s+t[r.ROWNR],0,t)}}))}));else{const s=this.findDuplicateSubCategories(t);t.forEach((function(t){e.forEach((function(e){const i=e.findIndex((e=>null!=e.category&&e.category===t.category));if(i>=0){if(o.has(`${t.category}`)){const e=o.get(`${t.category}`)||0;o.set(`${t.category}`,e+1)}else o.set(`${t.category}`,1);(1===t[r.ROWNR]||s.includes(t.subCategory))&&(t.subCategory=`${t.subCategory} (${t.rowGroup})`),e.splice(i+t[r.ROWNR],0,t)}}))}))}}createThereOfDrillRows(t,e,o){if(void 0===this.config.thereOf||0===this.config.thereOf.length)return;const s=[],i=[];this.config.thereOf.forEach((o=>{let i=!0,n="1 <> 1 OR ( ";null!=o.category&&0!==o.category.length&&o.category.trim()&&(n+=` ${r.CATEGORY} = '${o.category}'`,i=!1),null!=o.rowGroup&&0!==o.rowGroup.length&&o.rowGroup.trim()&&(n+=` ${i?"":"AND"} ${r.ROWGROUP} = '${o.rowGroup}'`,i=!1),null!=o.subCategory&&0!==o.subCategory.length&&o.subCategory.trim()&&(n+=` ${i?"":"AND"} ${r.SUBCATEGORY} = '${o.subCategory}'`),n+=")",s.push(`SELECT ROWNUM() AS ${r.ROWNR},\n null as operation,\n 'DRILLELEMENT' as ${r.TYPE},\n ${r.CATEGORY},\n ${r.SUBCATEGORY},\n ${r.ROWGROUP} as ${r.ROWGROUP},\n ${t}\n FROM ${this.fromExpr}\n WHERE ${n}\n GROUP BY ${r.ROWGROUP}, ${r.CATEGORY}, ${r.SUBCATEGORY}\n ORDER BY ${e[1]}`)}));const n=this.db;s.forEach((function(t){i.push(...n.exec(t))})),this.injectDrillRowsToResultRows(i,o)}calculateRelativeVariances(t,e){t.forEach((t=>{t.forEach((t=>{"GROUPHEAD"!==t[r.TYPE]&&e.forEach(((e,o)=>{t[o]=t[o]/t[e]}))}))}))}calculateColumnGroupRest(t,e){if(null==e||0===e.size)return;const o=new Map,s=new Map;e.forEach(((t,e)=>{const i=t,n=[];for(const t of i)n.push(`${e}##${t.name}`);o.set(e,n),s.set(`${e}##REST`,!1)})),t.forEach((t=>{t.forEach((t=>{"GROUPHEAD"!==t[r.TYPE]&&o.forEach(((e,o)=>{let i=0;e.forEach((e=>{void 0!==t[e]&&(i+=t[e])})),t[`${o}##REST`]=t[o]-i,0!==t[`${o}##REST`]&&s.set(`${o}##REST`,!0)}))}))}));const i=Array.from(s.entries()).filter((([t,e])=>!e)).map((([t])=>t));t.forEach((t=>{t.forEach((t=>{for(const e of i)delete t[e]}))}))}getRelativeScenarios(){const t=new Map;return this.config.scenarios.forEach((e=>{const o=this.createRelativeScenario(e);null!=o&&t.set(o.key,o.value)})),t}translateScenarioSQL(t,e,o){const s=new a(t);return M.OPT===o||M.OPTNOTOTAL===o?s.isValid?"dr"===s.type?`SUM(${s.base} - ${s.delta}) as ${t}, SUM(${s.delta}) as dr_${s.delta}`:`SUM(${s.base} - ${s.delta}) as ${t}`:e?`SUM(${t} * transformOperator(operation)) as ${t}, COUNT(ISNULL(${t})) as ${t}_cnt`:`SUM(${t}) as ${t}, COUNT(ISNULL(${t})) as ${t}_cnt`:s.isValid?"dr"===s.type?`SUM((${s.base} * transformOperator(operation)) - (${s.delta} * transformOperator(operation))) as ${t}, SUM(${s.delta} * transformOperator(operation)) as dr_${s.delta}`:`SUM((${s.base} * transformOperator(operation))- (${s.delta} * transformOperator(operation))) as ${t}`:`SUM(${t} * transformOperator(operation)) as ${t}, COUNT(ISNULL(${t})) as ${t}_cnt`}createOrderString(t){return[`${t.hierarchy.toString()} ${t.direction}`,`${t.hierarchy.toString()} ${U.ASC===t.direction?U.DESC:U.ASC}`]}createRelativeScenario(t){const e=new a(t);return e.isValid&&"dr"===e.type?{key:`${t}`,value:`dr_${e.delta}`}:null}exctractScenarioNames(t){const e=[];return t.split(",").forEach((t=>t.length>=2?e.push(t.split("as")[1].trim()):null)),e}findDuplicateSubCategories(t){const e=t.map((t=>({count:1,subCategory:t.subCategory}))).reduce(((t,e)=>(t[e.subCategory]=(t[e.subCategory]||0)+e.count,t)),{});return Object.keys(e).filter((t=>e[t]>1))}createPartOfQuery(t,e){var o;const s=[];let i="1 <> 1 ",n=` ${r.ROWGROUP}`,a="ROWNUM()";return null===(o=this.config.partOf)||void 0===o||o.forEach((t=>{i+=`OR (${r.CATEGORY} = '${t.category}'`,null!=t.rowGroup&&0!==t.rowGroup.length&&t.rowGroup.trim()&&(i+=`and ${r.ROWGROUP} = '${t.rowGroup}'`),!1===this.config.grouped&&(n=` 'SUM_TOTAL' as ${r.ROWGROUP} `,a="1"),i+=")"})),s.push(`SELECT ${a} AS ${r.ROWNR},\n 'PARTELEMENT' as ${r.TYPE},\n ${r.CATEGORY},\n ${n},\n ${t}\n FROM ${this.fromExpr}\n WHERE ${i}\n GROUP BY ${r.ROWGROUP}, ${r.CATEGORY}, ${r.TYPE}\n ORDER BY ${e[1]}`),s}checkConfigForPartOf(){return null!=this.config.partOf&&0!==this.config.partOf.length}createThereOfDrillColumns(t,e){if(null==t||0===t.size)return;const o=[],s=[],i=this.fromExpr;t.forEach(((t,e)=>{let s="1 <> 1 ";t.forEach((t=>{s+=` or columnGroup = '${t.name}' `})),o.push(`SELECT 'ENTRY' as rowlevel,\n 'COLUMNGROUP' as columnlevel,\n rowGroup,\n category,\n columnGroup,\n '${e}' as scenario,\n sum(${e} * transformOperator(operation)) as val\n FROM ${i}\n WHERE ${s}\n GROUP BY rowlevel, rowGroup, category, columnGroup, scenario`),o.push(`SELECT 'ENTRY' as rowlevel,\n 'SUBGROUP' as columnlevel,\n rowGroup,\n category,\n columnGroup,\n columnSubGroup,\n '${e}' as scenario,\n sum(${e} * transformOperator(operation)) as val\n FROM ${i}\n WHERE ${s}\n GROUP BY rowlevel, rowGroup, category, columnGroup, columnSubGroup, scenario`),o.push(`SELECT 'DRILLELEMENT' as rowlevel,\n 'COLUMNGROUP' as columnlevel,\n rowGroup,\n category,\n subCategory,\n columnGroup,\n '${e}' as scenario,\n sum(${e} * transformOperator(operation)) as val\n FROM ${i}\n WHERE ${s}\n GROUP BY rowlevel, rowGroup, category, subCategory, columnGroup, scenario`),o.push(`SELECT 'DRILLELEMENT' as rowlevel,\n 'SUBGROUP' as columnlevel,\n rowGroup,\n category,\n subCategory,\n columnGroup,\n columnSubGroup,\n '${e}' as scenario,\n sum(${e} * transformOperator(operation)) as val\n FROM ${i}\n WHERE ${s}\n GROUP BY rowlevel, rowGroup, category, subCategory, columnGroup, columnSubGroup, scenario`),o.push(`SELECT 'GROUP_SUM' as rowlevel,\n 'COLUMNGROUP' as columnlevel,\n rowGroup,\n columnGroup,\n '${e}' as scenario,\n sum(${e} * transformOperator(operation)) as val\n FROM ${i}\n WHERE ${s}\n GROUP BY rowlevel, rowGroup, columnGroup, scenario`),o.push(`SELECT 'GROUP_SUM' as rowlevel,\n 'SUBGROUP' as columnlevel,\n rowGroup,\n columnGroup,\n columnSubGroup,\n '${e}' as scenario,\n sum(${e} * transformOperator(operation)) as val\n FROM ${i}\n WHERE ${s}\n GROUP BY rowlevel, rowGroup, columnGroup, columnSubGroup, scenario`),o.push(`SELECT 'SUM' as rowlevel,\n 'COLUMNGROUP' as columnlevel,\n columnGroup,\n '${e}' as scenario,\n sum(${e} * transformOperator(operation)) as val\n FROM ${i}\n WHERE ${s}\n GROUP BY rowlevel, columnGroup, scenario`),o.push(`SELECT 'SUM' as rowlevel,\n 'SUBGROUP' as columnlevel,\n columnGroup,\n columnSubGroup,\n '${e}' as scenario,\n sum(${e} * transformOperator(operation)) as val\n FROM ${i}\n WHERE ${s}\n GROUP BY rowlevel, columnGroup, columnSubGroup, scenario`)}));for(const t of o)s.push(...this.db.exec(t));this.injectDrillColumnsToResultRows(s,e)}injectDrillColumnsToResultRows(t,e){const o="##";for(const s of t)for(const t of e)for(const e of t)e.type===s.rowlevel&&("ENTRY"===s.rowlevel?"COLUMNGROUP"===s.columnlevel&&e.category===s.category?e[s.scenario+o+s.columnGroup]=s.val:"SUBGROUP"===s.columnlevel&&e.category===s.category&&(e[s.scenario+o+s.columnGroup+o+s.columnSubGroup]=s.val):"DRILLELEMENT"===s.rowlevel?"COLUMNGROUP"===s.columnlevel&&e.category===s.category&&e.subCategory===s.subCategory?e[s.scenario+o+s.columnGroup]=s.val:"SUBGROUP"===s.columnlevel&&e.category===s.category&&e.subCategory===s.subCategory?e[s.scenario+o+s.columnGroup+o+s.columnSubGroup]=s.val:"COLUMNGROUP"===s.columnlevel&&e.category===s.category&&e.subCategory===`${s.subCategory} (${s.rowGroup})`?e[s.scenario+o+s.columnGroup]=s.val:"SUBGROUP"===s.columnlevel&&e.category===s.category&&e.subCategory===`${s.subCategory} (${s.rowGroup})`&&(e[s.scenario+o+s.columnGroup+o+s.columnSubGroup]=s.val):("SUM"===s.rowlevel||"GROUP_SUM"===s.rowlevel)&&("COLUMNGROUP"===s.columnlevel&&e.category===s.category&&e.subCategory===s.subCategory&&(e[s.scenario+o+s.columnGroup]=s.val),"SUBGROUP"===s.columnlevel&&e.category===s.category&&e.subCategory===s.subCategory&&(e[s.scenario+o+s.columnGroup+o+s.columnSubGroup]=s.val)))}}class I{constructor(){this.normalizedHeader=[]}createHeader(t,e,o,s,i,r){const a=[];this.normalizedHeader=this.normalizeHeader(t,e);const l=new _(0,0,G.HEADER),c=new _(1,0,G.SEPERATORLINE);for(const t of this.normalizedHeader)l.createElement(n.translateScenarioLabel(t.name,o),t.type,this.createColumnType(t),null,this.setHeaderPrefix(t,o,s,i,r),null,null,null,null),c.createElement(null,t.type,this.createColumnType(t),null,null,null,null,null,null);return a.push(l),a.push(c),a}setHeaderPrefix(t,e,o,s,i){let r="";return"category"===t.name&&i&&(0===o.prefix.length&&0===s.length||(r=n.translateScenarioLabel("in",e)+" "+o.prefix+s)),t.order&&(r+=n.translateScenarioLabel("ORDER_"+t.order,e)),r}normalizeHeader(t,e){let o=[{name:r.CATEGORY,group:r.CATEGORY,type:r.CATEGORY,order:void 0}];return M.OPT!==t&&M.OPTNOTOTAL!==t||(o=[{name:r.OPERATION,group:r.OPERATION,type:r.OPERATION,order:void 0},{name:r.CATEGORY,group:r.CATEGORY,type:r.CATEGORY,order:void 0}]),[...o,...e]}createBodyRows(t,e,o,s){const i=[];let n=-1;const r=new H(t,e).execute(o,s),a=this.calculateColumnStatistics(r,t.barColumns);for(const o of r)n+=1,i.push(...this.createRow(t.i18n,e,t.scenariosUnitType,o,n,-1,t.categoryWidth,t.measureScale,t.barColumns,a));return i}calculateColumnStatistics(t,e){const o=new Map;if(!e||0===e.length)return o;const s=new Map;for(const t of e)o.set(t,{min:1/0,max:-1/0,absMax:0,median:0}),s.set(t,[]);for(const i of t)for(const t of i)for(const i of e){const e=this.extractColumnValue(t,i);if(null!==e&&!isNaN(e)){const t=o.get(i);t.min=Math.min(t.min,e),t.max=Math.max(t.max,e),s.get(i).push(Math.abs(e))}}for(const[t,e]of o){e.min!==1/0&&e.max!==-1/0||(e.min=0,e.max=0),e.absMax=Math.max(Math.abs(e.min),Math.abs(e.max));const i=s.get(t);if(i.length>0){i.sort(((t,e)=>t-e));const t=Math.floor(i.length/2);e.median=i.length%2==0?(i[t-1]+i[t])/2:i[t]}o.set(t,e)}return o}extractColumnValue(t,e){if(void 0!==t[e]){const o=Number(t[e]);return isNaN(o)?null:o}for(const o of Object.keys(t))if(o===e||o.endsWith("##"+e)||o===e+"##"+e){const e=Number(t[o]);if(!isNaN(e))return e}return null}createRow(t,e,o,s,i,n,a,l,c,h){var u;const d=[];for(const f of s){const p=f[r.ROWGROUP],m=f[r.SUBCATEGORY],$=f[r.TYPE],v=f[r.ROWNR]>=2,g=this.createDetailRow($,n+=1,i,s.length);for(const s of this.normalizedHeader){const i=this.getRawDataRowElement(f,s),n=null!==(u=null==c?void 0:c.includes(s.type))&&void 0!==u&&u,r=n?null==h?void 0:h.get(s.type):void 0;g.createElement(this.translateSumCellLabel(t,e,i,p,m,$,s.type),s.type,this.createColumnType(s),this.setCellType(s.type,o),this.translateCellPrefix(e,$,s.type),this.translateScenarioCSS(s.type,i),v,a,null==l?void 0:l.value,n,r)}d.push(g)}return d}getRawDataRowElement(t,e){return e.name===e.group&&e.name===e.type?t[e.name]:e.name===e.group&&e.name!==e.type?t[e.type+"##"+e.name]:t[e.type+"##"+e.group+"##"+e.name]}createDetailRow(t,e,o,s){switch(t){case G.GROUPHEAD:return new _(e,o,G.HEADER);case G.SUM:case G.GROUPSUM:return new _(s+2,o,G.SUM);case G.DRILLELEMENT:return new _(s+2,o,G.DRILLELEMENT);case G.PARTELEMENT:return new _(s+2,o,G.PARTELEMENT);default:return new _(e,o,G.STANDARD)}}translateSumCellLabel(t,e,o,s,i,n,r){return!1===Number.isNaN(Number(o))||this.isOperationColumn(r)?o:this.isGroupHeadCategory(n,r)||this.isEntryCategory(n,r)?t===h.ALL?`${e.get(o)||o}`:o:this.isDrillElementCategory(n,r)?t===h.ALL?`${e.get(i)||i}`:`${i}`:this.isPartElementCategory(n,r)?t===h.ALL||"SUM_TOTAL"===s?`${e.get(s)||s}`:`${s}`:this.isSumElementCategory(n,r)?t===h.ALL||"SUM_TOTAL"===s?`${e.get(s)||s}`:s:"GROUPHEAD"===n&&null==o?o:Number.isNaN(Number(o))?"-":Number(o)}isOperationColumn(t){return"operation"===t}translateScenarioCSS(t,e){const o=new a(t);let s="pos";return e<0&&(s="neg"),o.isValid?s+"_"+o.direction+("dr"===o.type?" relative_variance":""):t}setCellType(t,e){if("category"===t)return"";let o;const s=new a(t);return e===u.PERCENT?(o="percent",s.isValid&&"d"===s.type&&(o="decimal")):(o="decimal",s.isValid&&"dr"===s.type&&(o="percent")),o}isDrillElementCategory(t,e){return"DRILLELEMENT"===t&&"category"===e}isPartElementCategory(t,e){return"PARTELEMENT"===t&&"category"===e}isSumElementCategory(t,e){return("GROUP_SUM"===t||"SUM"===t)&&"category"===e}isEntryCategory(t,e){return"ENTRY"===t&&"category"===e}isGroupHeadCategory(t,e){return"GROUPHEAD"===t&&"category"===e}translateCellPrefix(t,e,o){return this.isOperationColumn(o)||this.isGroupHeadCategory(e,o)||this.isEntryCategory(e,o)?null:this.isDrillElementCategory(e,o)?`${t.get("there_of")} `:this.isPartElementCategory(e,o)?`${t.get("part_of")} `:null}createColumnType(t){return t.name===t.group&&t.name===t.type?"base":t.name===t.group?"columnGroup":"columnSubGroup"}}class z{constructor(t,e,o,s){this.fromExpr="",this.rowCount=0,this.headerRows=[],this.bodyRows=[],this.ruleSet=t||new l,this.db=e,this.dataSetFactory=new I,this.config=this.initConfig(s),this.i18n=this.initI18n(new Map),this.setSource(o,s.filter),this.state=y.DIRTY}setI18n(t){this.i18n=this.initI18n(t)}initI18n(t){const e=new Map([["",""],["SEPERATOR_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"],["in","in"],["category"," "],["operation"," "],["there_of","davon"],["part_of","in % von"],["ibcssymbol_delta_ac","Δ{%}"],["ibcssymbol_delta_generic","Δ({%})"],["ibcssymbol_delta_ac_relative","Δ{%}%"],["ibcssymbol_delta_generic_relative","Δ({%})%"],["SUM_TOTAL","❖"]]);return this.state=y.DIRTY,new Map([...e,...t||new Map])}initConfig(t){this.state=y.DIRTY;const e=t,o=this;return t.scenarios.sort(((t,e)=>o.ruleSet.getScenarioSorIndex(t)-o.ruleSet.getScenarioSorIndex(e))),e}setConfig(t){this.config=this.initConfig(t)}setSource(t,e){var o,s;if(!t)return this.fromExpr="",void(this.rowCount=0);this.fromExpr=v(t,e);try{const t=this.db.exec(`SELECT COUNT(*) AS cnt FROM ${this.fromExpr}`);this.rowCount=null!==(s=null===(o=t[0])||void 0===o?void 0:o.cnt)&&void 0!==s?s:0}catch(t){this.rowCount=0}const i=this.normalizeScenarios(this.config.scenarios,this.config.categoryThereOf,this.config.sortOrder);this.headerRows=this.dataSetFactory.createHeader(this.config.type,i,this.i18n,this.config.measureScale,this.config.measureUnit,this.config.showMeasureScale),this.bodyRows=0===this.rowCount?[]:this.dataSetFactory.createBodyRows(this.config,this.i18n,this.db,this.fromExpr),this.state=y.UP_TO_DATE}update(){const t=this.normalizeScenarios(this.config.scenarios,this.config.categoryThereOf,this.config.sortOrder);this.headerRows=this.dataSetFactory.createHeader(this.config.type,t,this.i18n,this.config.measureScale,this.config.measureUnit,this.config.showMeasureScale),this.bodyRows=0!==this.rowCount&&this.fromExpr?this.dataSetFactory.createBodyRows(this.config,this.i18n,this.db,this.fromExpr):[],this.state=y.UP_TO_DATE}getHeader(){return this.state===y.DIRTY&&this.update(),this.headerRows}getBody(){return this.state===y.DIRTY&&this.update(),this.bodyRows}normalizeScenarios(t,e,o){var s;const i=[];for(const n of t){if(null==e?void 0:e.has(n)){const t=e.get(n);for(const e of t){i.push({name:e.name,group:e.name,type:n,order:void 0});for(const t of e.subGroups)i.push({name:t,group:e.name,type:n,order:void 0})}i.push({name:"REST",group:"REST",type:n,order:void 0})}let t;(null===(s=null==o?void 0:o.hierarchy)||void 0===s?void 0:s.at(0))===n&&(t=o.direction),i.push({name:n,group:n,type:n,order:t})}return i}hasNoData(){return 0===this.rowCount}}class j{constructor(){this.title="",this.scenarios=[],this.scenariosUnitType=u.DECIMAL,this.grouped=!1,this.showGroupTitle=!0,this.thereOf=[],this.categoryThereOf=new Map,this.partOf=[],this.sortOrder=new p(new c).default(),this.type=M.LIST,this.limit=0,this.i18n=h.ALL,this.categoryWidth=m.W25,this.measureScale=new w,this.measureUnit="",this.measureType=$.VOLUME,this.showMeasureScale=!0,this.filter="",this.barColumns=[]}}class Q{constructor(t,e,o,s,i){this.tableDrillGroupAdapter=t,this.stringAdapter=e,this.orderAdapter=o,this.db=s,this.fromExpr=i}adapt(t){const e=new j;return d.isString(t.title)&&(e.title=t.title),d.isArray(t.scenarios)&&(e.scenarios=f.adaptArray(t.scenarios,this.stringAdapter)),d.isExisting(t.scenariosUnitType)&&(e.scenariosUnitType=t.scenariosUnitType),d.isBoolean(t.grouped)&&(e.grouped=t.grouped),d.isBoolean(t.showGroupTitle)&&(e.showGroupTitle=t.showGroupTitle),d.isBoolean(t.showMeasureScale)&&(e.showMeasureScale=t.showMeasureScale),d.isArray(t.thereOf)&&(e.thereOf=f.adaptArray(t.thereOf,this.tableDrillGroupAdapter)),d.isExisting(t.categoryThereOf)&&(e.categoryThereOf=t.categoryThereOf),d.isArray(t.partOf)&&(e.partOf=f.adaptArray(t.partOf,this.tableDrillGroupAdapter)),d.isExisting(t.order)&&(e.sortOrder=this.orderAdapter.adapt(t.order)),d.isExisting(t.type)&&(e.type=t.type),d.isNumber(t.limit)&&(e.limit=t.limit),d.isExisting(t.i18n)&&(e.i18n=t.i18n),d.isExisting(t.categoryWidth)&&(e.categoryWidth=t.categoryWidth),d.isExisting(t.measureScale)&&(e.measureScale=R.calculateMeasureScale(this.db,this.fromExpr,e.scenarios,t.measureScale)),d.isExisting(t.measureType)&&(e.measureType=t.measureType),d.isString(t.measureUnit)&&(e.measureUnit=t.measureUnit),d.isString(t.filter)&&(e.filter=t.filter.trim()),d.isArray(t.barColumns)&&(e.barColumns=t.barColumns),e}default(){return new j}}class V{constructor(){this.rowGroup="",this.category="",this.subCategory="",this.partOf=""}}class q{constructor(){}adapt(t){const e=new V;return d.isString(t.rowGroup)&&(e.rowGroup=t.rowGroup),d.isString(t.category)&&(e.category=t.category),d.isString(t.subCategory)&&(e.subCategory=t.subCategory),d.isString(t.partOf)&&(e.partOf=t.partOf),e}default(){return new V}}const K=e(class extends o{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.tableName="",this.dataVersion=0,this.tableTitle="SUM_TOTAL",this.scenarios=[],this.scenariosDataFormat=u.DECIMAL,this.grouped=!1,this.limit=0,this.showGroupTitle=!0,this.thereof=[],this.partof=[],this.order={hierarchy:[],direction:U.ASC},this.categorythereof=new Map,this.type=M.LIST,this.categoryWidth=m.INF,this.dataFormatDigits={percent:2,decimal:1},this.i18n=new Map,this.i18nMode=h.ALL,this.measureScale="_",this.measureUnit="",this.showMeasureScale=!0,this.measureType=$.VOLUME,this.filter="",this.barColumns=[],this.barColumnMaxWidth=30,this.unitScaling=.01,this.percentageScaling=.5,this.scaleFactor=1,this.componentDataFormatDigits=new b,this.componentStyle=E(this)}render(){return t(s,null,(()=>{if(void 0!==this.table){if(this.table.hasNoData()){const e=this.i18n.get("NO_DATA")||"==No Data==";return t("p",{class:"warning"},e)}return t("table",null,t("thead",null,this.table.getHeader().map((e=>t("tr",{class:e.cssStyle},e.getCells().map((e=>t("th",{colSpan:e.colSpan,class:e.cssStyle},e.getAsHeaderList().map(((o,s,i)=>t("span",null,s===i.length-1?t("span",{class:" "===o?"table-footer":""},o,e.drawPrefix()," "):t("span",null,o,e.drawPrefix(),t("br",null)))))))))))),t("tbody",null,this.table.getBody().map((e=>t("tr",{class:e.cssStyle},null==e?void 0:e.getCells().map((o=>t("td",{colSpan:o.colSpan,class:o.type?`${o.cssStyle} ${o.type}`:o.cssStyle},null!=o.prefix?t("span",{class:o.cssStyle+" "+o.prefixStyle},o.drawPrefix()):"",o.isBarChart&&o.columnStats&&e.type!==G.SUM?t(Y,{value:o.value,scenario:o.key,columnStats:o.columnStats,height:18*this.scaleFactor,isRelative:o.key.startsWith("dr"),isPositiveGood:o.key.endsWith("_pos"),measureScale:o.measureScale,maxBarWidth:this.barColumnMaxWidth,styles:this.barChartStyles}):o.draw(this.componentDataFormatDigits)))))))))}})())}componentWillRender(){this.stores||(this.stores=g(this.element));const t=this.stores.db.db,e=this.prepareConfig(t);this.componentDataFormatDigits=(new S).adapt(this.dataFormatDigits),this.table=new z(new l,t,this.tableName,e),this.table.setI18n(this.i18n),this.barChartStyles=this.prepareBarChartStyles()}prepareConfig(t){const e=this.tableName?this.filter&&this.filter.length>0?`(SELECT * FROM \`${this.tableName}\` WHERE ${this.filter}) AS __src`:`\`${this.tableName}\``:"";return new Q(new q,new c,new p(new c),t,e).adapt({title:this.tableTitle,scenarios:this.scenarios,scenariosUnitType:this.scenariosDataFormat,grouped:this.grouped,showGroupTitle:this.showGroupTitle,thereOf:this.thereof,partOf:this.partof,categoryThereOf:this.categorythereof,order:this.order,type:this.type,limit:this.limit,i18n:this.i18nMode,categoryWidth:this.categoryWidth,measureScale:this.measureScale,measureUnit:this.measureUnit,measureType:this.measureType,showMeasureScale:this.showMeasureScale,filter:this.filter,barColumns:this.barColumns})}prepareBarChartStyles(){return this.componentStyle((t=>{var e,o,s,i,n,r,a,l,c,h,u,d,f,p,m,$,v,g,R,w,b,S,E,O,y,M;const U=null===(e=t["bn-chart-time"])||void 0===e?void 0:e.varianceStyles,G=null===(o=t["bn-chart-time"])||void 0===o?void 0:o.barStyles;return{positive:{stroke:(null===(s=null==U?void 0:U.pos)||void 0===s?void 0:s.stroke)||"#008f96",fill:(null===(i=null==U?void 0:U.pos)||void 0===i?void 0:i.fill)||"#008f96",fillpattern:(null===(n=null==U?void 0:U.pos)||void 0===n?void 0:n.fillpattern)||"solid"},negative:{stroke:(null===(r=null==U?void 0:U.neg)||void 0===r?void 0:r.stroke)||"#ff0000",fill:(null===(a=null==U?void 0:U.neg)||void 0===a?void 0:a.fill)||"#ff0000",fillpattern:(null===(l=null==U?void 0:U.neg)||void 0===l?void 0:l.fillpattern)||"solid"},neutral:{stroke:(null===(c=null==U?void 0:U.neu)||void 0===c?void 0:c.stroke)||"#808080",fill:(null===(h=null==U?void 0:U.neu)||void 0===h?void 0:h.fill)||"#808080",fillpattern:(null===(u=null==U?void 0:U.neu)||void 0===u?void 0:u.fillpattern)||"outlined"},scenarios:{ac:{stroke:(null===(d=null==G?void 0:G.ac)||void 0===d?void 0:d.stroke)||"#404040",fill:(null===(f=null==G?void 0:G.ac)||void 0===f?void 0:f.fill)||"#404040",fillpattern:(null===(p=null==G?void 0:G.ac)||void 0===p?void 0:p.fillpattern)||"solid"},pp:{stroke:(null===(m=null==G?void 0:G.pp)||void 0===m?void 0:m.stroke)||"#A6A6A6",fill:(null===($=null==G?void 0:G.pp)||void 0===$?void 0:$.fill)||"#A6A6A6",fillpattern:(null===(v=null==G?void 0:G.pp)||void 0===v?void 0:v.fillpattern)||"solid"},fc:{stroke:(null===(g=null==G?void 0:G.fc)||void 0===g?void 0:g.stroke)||"#404040",fill:(null===(R=null==G?void 0:G.fc)||void 0===R?void 0:R.fill)||"#ffffff",fillpattern:(null===(w=null==G?void 0:G.fc)||void 0===w?void 0:w.fillpattern)||"hatched"},pl:{stroke:(null===(b=null==G?void 0:G.pl)||void 0===b?void 0:b.stroke)||"#404040",fill:(null===(S=null==G?void 0:G.pl)||void 0===S?void 0:S.fill)||"#ffffff",fillpattern:(null===(E=null==G?void 0:G.pl)||void 0===E?void 0:E.fillpattern)||"outlined"}},fontColor:(null===(O=t.global)||void 0===O?void 0:O.fontColor)||"#000000",fontSize:.85*((null===(y=t.global)||void 0===y?void 0:y.fontSizePx)||13.3333)*this.scaleFactor,fontFamily:(null===(M=t.global)||void 0===M?void 0:M.fontFamily)||"'Noto Sans', sans-serif",unitScaling:this.unitScaling>0?this.unitScaling:this.autoUnitScaling(),percentageScaling:this.percentageScaling>0?this.percentageScaling:this.autoPercentageScaling(),scaleFactor:this.scaleFactor}}))}autoUnitScaling(){const t=this.componentStyle((t=>{var e;return.85*((null===(e=t.global)||void 0===e?void 0:e.fontSizePx)||13.3333)*this.scaleFactor})),e=this.barColumnMaxWidth*t*.8,o=this.getMaxAbsValue();return o<=0||t<=0?.01:e/(o*t)}autoPercentageScaling(){const t=this.componentStyle((t=>{var e;return.85*((null===(e=t.global)||void 0===e?void 0:e.fontSizePx)||13.3333)*this.scaleFactor})),e=.8*Math.round(.67*this.barColumnMaxWidth*t),o=this.getMaxRelativeValue();return o<=0||t<=0?.5:e/(o*t)}getMaxAbsValue(){if(!this.table)return 0;let t=0;for(const e of this.table.getBody())if(e.type!==G.SUM)for(const o of e.getCells())o.isBarChart&&o.columnStats&&!o.key.startsWith("dr")&&(t=Math.max(t,o.columnStats.absMax));return t}getMaxRelativeValue(){if(!this.table)return 0;let t=0;for(const e of this.table.getBody())if(e.type!==G.SUM)for(const o of e.getCells())o.isBarChart&&o.columnStats&&o.key.startsWith("dr")&&(t=Math.max(t,100*o.columnStats.absMax));return t}get element(){return this}static get style(){return':host{position:relative;display:inline-block}table{background-color:var(--bn-font-background, white);font-size:var(--bn-font-size, 1em);color:var(--bn-font-color, black);font-family:var(--bn-font-family, "Noto Sans", "Helvetica Neue", Helvetica, sans-serif);border-spacing:0.3em 0}thead{border-style:none}tr:first-child td{border-top:none;padding-top:0.5em}td.ac1,td.ac2,td.ac3,td.ac4,td.pp1,td.pp2,td.pp3,td.pp4,td.pl1,td.pl2,td.pl3,td.pl4,td.fc1,td.fc2,td.fc3,td.fc4,td.share,td.variance,td.pos_pos,td.pos_neg,td.neg_pos,td.neg_neg,td.pos_neutral,td.neg_neutral{text-align:right}.category-w100{min-width:100em;max-width:100em}.category-w50{min-width:50em;max-width:50em}.category-w25{min-width:25em;max-width:25em}.category-w20{min-width:20em;max-width:20em}.category-w15{min-width:15em;max-width:15em}.category-w10{min-width:10em;max-width:10em}.category-w5{min-width:5em;max-width:5em}.prefix-second{color:transparent;font-style:normal}.prefix-first{font-style:normal}th{border-bottom:0.1em solid black;text-align:right;font-weight:normal;vertical-align:text-top}td.columnGroup,th.columnGroup{font-size:0.6em}td.columnSubGroup,th.columnSubGroup{font-size:0.6em;border-spacing:0em 0;font-style:italic}td.base,th.base{font-style:normal}th.ofit,td.ofit,tr.ofit,th.partof,td.partof,tr.partof{font-size:0.6em;font-style:italic}td.ofit,td.partof{font-size:0.6em;font-style:italic}th.ofit td,tr.ofit td,th.partof td,tr.partof td{border-top:0em solid black;padding-left:1em}th.ofit share,th.partof share,tr.share td{border-top:0em solid black}th.share,tr.share,td.share{font-size:0.6em;font-style:italic}th.filler{border-bottom:0em solid black;text-align:right}td.filler{border-top:0em none !important;border-bottom:0em none;text-align:right}th.group{text-align:center;border-spacing:1em 0}th.headerlabel{border-bottom:0em none black;padding-bottom:0em}td.variance:after{content:"%"}td.relative_variance{font-style:italic}td.percent{font-style:italic;text-align:right}td.decimal{text-align:right}td.pos_pos{color:#008f96}td.neg_pos{color:#ff0000}td.pos_neg{color:#ff0000}td.neg_neg{color:#008f96}td.pos_pos:before{content:"+"}td.pos_neg:before{content:"+"}td.pos_neu:before{content:"+"}th.ac1,th.ac2,th.ac3,th.ac4{padding-top:0em;border-bottom:0.3em solid black}th.pp1,th.pp2,th.pp3,th.pp4{padding-top:0em;border-bottom:0.3em solid grey}th.pl1,th.pl2,th.pl3,th.pl4{padding-top:0em;border-bottom:0.3em double black}th.fc1,th.fc2,th.fc3,th.fc4{border-bottom:0.3em solid;border-image:repeating-linear-gradient(-45deg, white, white, black, white, white 0.3em) 2}td.colsum{font-weight:bold}th.colsum{padding-top:0em;font-weight:bold}tr.sum td{border-top:0.1em solid black;font-weight:bold;padding-bottom:0.5em}tr.groupheader td{border-top:0em dotted #ddd;padding-top:0.5em;font-weight:bold;font-style:italic}tr.begingroup td{border-top:0em dotted #ddd;padding-top:0.5em}th.begin-group{padding-left:0.75em}th.end-group{padding-left:0.75em}td{box-sizing:border-box;-webkit-box-sizing:border-box;border-top:0.1em dashed #ddd;padding-left:0.5em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.table-footer{font-size:0.6em}.cell-bar-chart{display:inline-block;vertical-align:middle}.bar-chart-empty{color:#999}td:has(.cell-bar-chart){padding:0 0.25em;vertical-align:middle}td:has(.cell-bar-chart).pos_pos:before,td:has(.cell-bar-chart).pos_neg:before,td:has(.cell-bar-chart).pos_neu:before{content:none}td:has(.cell-bar-chart).variance:after{content:none}'}},[1,"ibcs-table",{tableName:[1,"table-name"],dataVersion:[2,"data-version"],tableTitle:[1,"table-title"],scenarios:[16],scenariosDataFormat:[1,"scenarios-data-format"],grouped:[4],limit:[2],showGroupTitle:[4,"show-group-title"],thereof:[16],partof:[16],order:[16],categorythereof:[16],type:[1],categoryWidth:[1,"category-width"],dataFormatDigits:[16],i18n:[1040],i18nMode:[1,"i18n-mode"],measureScale:[1,"measure-scale"],measureUnit:[1,"measure-unit"],showMeasureScale:[4,"show-measure-scale"],measureType:[1,"measure-type"],filter:[1],barColumns:[16],barColumnMaxWidth:[2,"bar-column-max-width"],unitScaling:[2,"unit-scaling"],percentageScaling:[2,"percentage-scaling"],scaleFactor:[2,"scale-factor"]}]);function J(){"undefined"!=typeof customElements&&["ibcs-table"].forEach((t=>{"ibcs-table"===t&&(customElements.get(i(t))||customElements.define(i(t),K))}))}export{K as I,M as T,J as d}
@@ -1 +1 @@
1
- import{proxyCustomElement as t,HTMLElement as s,h as i,transformTag as e}from"@stencil/core/internal/client";import{I as n,j as r,k as a,f as o,b as c,l as h}from"./Order.js";import{b as l,D as u,a as d}from"./DateStringFactory.js";import{F as p,I as f,S as b}from"./ibcsRuleSet.js";class m{constructor(){}createMeasures(t,s,i){if(this.allMeasuresUseSameUnit(t)){const e=t.length;let r="",a="";for(let o=0;o<e;o++){let c="";o>0&&(c=s.get("SEPERATOR_WS")),e>1&&o===e-1&&(c=s.get("CONNECTOR_WS")),i===n.ALL?(r=(s.get(r)||r)+c+(s.get(t[o].name)||t[o].name),a=s.get(t[o].unit)||t[o].unit):(r=r+c+t[o].name,a=t[o].unit)}return[{name:r,unit:a}]}return t}createDimension(t,s,i,e,n){let r="";return void 0!==s&&(r=(new l).getDateLinkString(s.start,s.end,s.link,s.format,n)),r+t.map((t=>{let s="";return null!=i&&null!=i.hierarchy&&i.hierarchy.find((s=>s===t))&&(s=e.get("asc"===i.direction?"ORDER_asc":"ORDER_desc")),"".concat(" ",p.translateScenarioLabel(t,e),s)})).toString()}allMeasuresUseSameUnit(t){const s=new Map;return t.forEach((function(t){s.set(t.unit,!0)})),1===s.size}}class w{constructor(){this.businessunit="",this.measures=[],this.scenarios=[],this.i18nMode=n.ALL,this.intervalSpanLimit=32}}class _{constructor(t,s,i,e){this.measureEntryAdapter=t,this.timePeriodAdapter=s,this.orderAdapter=i,this.stringAdapter=e}adapt(t){const s=new w;return r.isString(t.businessunit)&&(s.businessunit=t.businessunit),r.isArray(t.measures)&&(s.measures=a.adaptArray(t.measures,this.measureEntryAdapter)),r.isArray(t.scenarios)&&(s.scenarios=a.adaptArray(t.scenarios,this.stringAdapter)),r.isExisting(t.timeperiod)&&(s.timeperiod=this.timePeriodAdapter.adapt(t.timeperiod)),r.isNumber(t.intervalSpanLimit)&&(s.intervalSpanLimit=t.intervalSpanLimit),r.isExisting(t.i18nMode)&&(s.i18nMode=t.i18nMode),r.isExisting(t.order)&&(s.order=this.orderAdapter.adapt(t.order)),s}default(){return new w}}var v;!function(t){t[t.UP_TO_DATE=0]="UP_TO_DATE",t[t.DIRTY=1]="DIRTY"}(v||(v={}));class y{constructor(t){this.i18n=new Map,this.unit="",this.measures=[],this.dimension="",this.config=new w,this.state=v.DIRTY,this.ruleSet=t||new f,this.dataSetFactory=new m,this.state=v.DIRTY,this.setI18n(new Map)}setI18n(t){this.state=v.DIRTY;const s=new Map([["SEPERATOR_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"],["pp3","PL3"],["ac4","AC4"],["py4","PY4"],["fc4","FC4"],["pp4","PL4"],["category"," "],["operation"," "],["there_of","davon"],["part_of","in % von"],["ibcssymbol_delta_ac","Δ{%}"],["ibcssymbol_delta_generic","Δ({%})"],["ibcssymbol_delta_ac_relative","Δ{%}%"],["ibcssymbol_delta_generic_relative","Δ({%})%"],["SUM_TOTAL","❖"],["CONNECTOR_WS"," und "]]);this.i18n=new Map([...s,...t||new Map])}update(){return v.DIRTY===this.state&&(this.unit=this.config.businessunit,this.measures=this.dataSetFactory.createMeasures(this.config.measures,this.i18n,this.config.i18nMode),this.dimension=this.dataSetFactory.createDimension(this.config.scenarios,this.config.timeperiod,this.config.order,this.i18n,this.config.intervalSpanLimit),this.state=v.UP_TO_DATE),this}setConfig(t){this.config=this.initConfig(t)}initConfig(t){this.state=v.DIRTY;const s=t,i=this;return t.scenarios.sort(((t,s)=>i.ruleSet.getScenarioSorIndex(t)-i.ruleSet.getScenarioSorIndex(s))),s}}class R{constructor(t="",s=""){this.name=t,this.unit=s}}class E{construnctor(){}adapt(t){const s=new R;return r.isString(t.name)&&(s.name=t.name),r.isString(t.unit)&&(s.unit=t.unit),s}default(){return new R("","")}}class S{constructor(t=o.now(),s=o.now(),i=u.AUTO,e=d.AUTO){this.start=t,this.end=s,this.format=i,this.link=e}}class C{construnctor(){}adapt(t){const s=new S;return r.isDate(t.start)&&(s.start=t.start),r.isDate(t.end)&&(s.end=t.end),r.isExisting(t.format)&&(s.format=t.format),r.isExisting(t.link)&&(s.link=t.link),s}default(){return new S}}const O=t(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.businessUnit="",this.scenarios=[],this.measures=[],this.intervalSpanLimit=28,this.order={hierarchy:[],direction:c.ASC},this.i18n=new Map,this.i18nMode=n.ALL,this.title=new y(new f)}async setBusinessUnit(t){this.businessUnit=t}async setProps(t){Object.keys(t).forEach((s=>{this[s]=t[s]}))}render(){return i("div",{key:"314cf7dad025643a6cdc190312eb100a310f076b"},i("div",{key:"b2e5c89f5d9d08987d09d0ee46e63b5889ede87c"},this.title.unit),i("div",{key:"d9cb4aa0cc02d8b354eb61609d4e22f4641e10a1"},this.title.measures.map(((t,s)=>i("span",null,this.isFirstElement(s)?this.title.i18n.get("SEPERATOR_WS"):"",i("span",{class:"measure"},t.name)," ",t.unit?this.title.i18n.get("in"):""," ",t.unit)))),i("div",{key:"ccbfb094dd5fa097fe339b03958ea3854e87083e"},this.title.dimension))}componentWillLoad(){const t=this.prepareConfig();this.title=new y(new f),this.title.setI18n(this.i18n),this.title.setConfig(t)}componentWillUpdate(){const t=this.prepareConfig();this.title.setI18n(this.i18n),this.title.setConfig(t)}componentWillRender(){this.title.update()}isFirstElement(t){return 0!==t}prepareConfig(){return new _(new E,new C,new h(new b),new b).adapt({businessunit:this.businessUnit,measures:this.measures,scenarios:this.scenarios,timeperiod:this.timeperiod,intervalSpanLimit:this.intervalSpanLimit,i18nMode:this.i18nMode,order:this.order})}static get style(){return':host{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)}.measure{font-weight:bold}div{background-color:var(--bn-font-background, white);color:var(--bn-font-color, black)}'}},[1,"ibcs-title",{businessUnit:[1537,"business-unit"],scenarios:[16],measures:[16],timeperiod:[16],intervalSpanLimit:[2,"interval-span-limit"],order:[16],i18n:[1040],i18nMode:[1,"i18n-mode"],setBusinessUnit:[64],setProps:[64]}]);function P(){"undefined"!=typeof customElements&&["ibcs-title"].forEach((t=>{"ibcs-title"===t&&(customElements.get(e(t))||customElements.define(e(t),O))}))}export{O as I,P as d}
1
+ import{proxyCustomElement as t,HTMLElement as s,h as i,transformTag as e}from"@stencil/core/internal/client";import{I as n,i as r,j as a,b as o,k as c}from"./Order.js";import{b as h,D as l,a as u}from"./DateStringFactory.js";import{F as d,I as p,S as f}from"./ibcsRuleSet.js";import{D as m}from"./luxon.js";class b{constructor(){}createMeasures(t,s,i){if(this.allMeasuresUseSameUnit(t)){const e=t.length;let r="",a="";for(let o=0;o<e;o++){let c="";o>0&&(c=s.get("SEPERATOR_WS")),e>1&&o===e-1&&(c=s.get("CONNECTOR_WS")),i===n.ALL?(r=(s.get(r)||r)+c+(s.get(t[o].name)||t[o].name),a=s.get(t[o].unit)||t[o].unit):(r=r+c+t[o].name,a=t[o].unit)}return[{name:r,unit:a}]}return t}createDimension(t,s,i,e,n){let r="";return void 0!==s&&(r=(new h).getDateLinkString(s.start,s.end,s.link,s.format,n)),r+t.map((t=>{let s="";return null!=i&&null!=i.hierarchy&&i.hierarchy.find((s=>s===t))&&(s=e.get("asc"===i.direction?"ORDER_asc":"ORDER_desc")),"".concat(" ",d.translateScenarioLabel(t,e),s)})).toString()}allMeasuresUseSameUnit(t){const s=new Map;return t.forEach((function(t){s.set(t.unit,!0)})),1===s.size}}class w{constructor(){this.businessunit="",this.measures=[],this.scenarios=[],this.i18nMode=n.ALL,this.intervalSpanLimit=32}}class _{constructor(t,s,i,e){this.measureEntryAdapter=t,this.timePeriodAdapter=s,this.orderAdapter=i,this.stringAdapter=e}adapt(t){const s=new w;return r.isString(t.businessunit)&&(s.businessunit=t.businessunit),r.isArray(t.measures)&&(s.measures=a.adaptArray(t.measures,this.measureEntryAdapter)),r.isArray(t.scenarios)&&(s.scenarios=a.adaptArray(t.scenarios,this.stringAdapter)),r.isExisting(t.timeperiod)&&(s.timeperiod=this.timePeriodAdapter.adapt(t.timeperiod)),r.isNumber(t.intervalSpanLimit)&&(s.intervalSpanLimit=t.intervalSpanLimit),r.isExisting(t.i18nMode)&&(s.i18nMode=t.i18nMode),r.isExisting(t.order)&&(s.order=this.orderAdapter.adapt(t.order)),s}default(){return new w}}var v;!function(t){t[t.UP_TO_DATE=0]="UP_TO_DATE",t[t.DIRTY=1]="DIRTY"}(v||(v={}));class y{constructor(t){this.i18n=new Map,this.unit="",this.measures=[],this.dimension="",this.config=new w,this.state=v.DIRTY,this.ruleSet=t||new p,this.dataSetFactory=new b,this.state=v.DIRTY,this.setI18n(new Map)}setI18n(t){this.state=v.DIRTY;const s=new Map([["SEPERATOR_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"],["pp3","PL3"],["ac4","AC4"],["py4","PY4"],["fc4","FC4"],["pp4","PL4"],["category"," "],["operation"," "],["there_of","davon"],["part_of","in % von"],["ibcssymbol_delta_ac","Δ{%}"],["ibcssymbol_delta_generic","Δ({%})"],["ibcssymbol_delta_ac_relative","Δ{%}%"],["ibcssymbol_delta_generic_relative","Δ({%})%"],["SUM_TOTAL","❖"],["CONNECTOR_WS"," und "]]);this.i18n=new Map([...s,...t||new Map])}update(){return v.DIRTY===this.state&&(this.unit=this.config.businessunit,this.measures=this.dataSetFactory.createMeasures(this.config.measures,this.i18n,this.config.i18nMode),this.dimension=this.dataSetFactory.createDimension(this.config.scenarios,this.config.timeperiod,this.config.order,this.i18n,this.config.intervalSpanLimit),this.state=v.UP_TO_DATE),this}setConfig(t){this.config=this.initConfig(t)}initConfig(t){this.state=v.DIRTY;const s=t,i=this;return t.scenarios.sort(((t,s)=>i.ruleSet.getScenarioSorIndex(t)-i.ruleSet.getScenarioSorIndex(s))),s}}class R{constructor(t="",s=""){this.name=t,this.unit=s}}class E{construnctor(){}adapt(t){const s=new R;return r.isString(t.name)&&(s.name=t.name),r.isString(t.unit)&&(s.unit=t.unit),s}default(){return new R("","")}}class S{constructor(t=m.now(),s=m.now(),i=l.AUTO,e=u.AUTO){this.start=t,this.end=s,this.format=i,this.link=e}}class C{construnctor(){}adapt(t){const s=new S;return r.isDate(t.start)&&(s.start=t.start),r.isDate(t.end)&&(s.end=t.end),r.isExisting(t.format)&&(s.format=t.format),r.isExisting(t.link)&&(s.link=t.link),s}default(){return new S}}const O=t(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.businessUnit="",this.scenarios=[],this.measures=[],this.intervalSpanLimit=28,this.order={hierarchy:[],direction:o.ASC},this.i18n=new Map,this.i18nMode=n.ALL,this.title=new y(new p)}async setBusinessUnit(t){this.businessUnit=t}async setProps(t){Object.keys(t).forEach((s=>{this[s]=t[s]}))}render(){return i("div",{key:"314cf7dad025643a6cdc190312eb100a310f076b"},i("div",{key:"b2e5c89f5d9d08987d09d0ee46e63b5889ede87c"},this.title.unit),i("div",{key:"d9cb4aa0cc02d8b354eb61609d4e22f4641e10a1"},this.title.measures.map(((t,s)=>i("span",null,this.isFirstElement(s)?this.title.i18n.get("SEPERATOR_WS"):"",i("span",{class:"measure"},t.name)," ",t.unit?this.title.i18n.get("in"):""," ",t.unit)))),i("div",{key:"ccbfb094dd5fa097fe339b03958ea3854e87083e"},this.title.dimension))}componentWillLoad(){const t=this.prepareConfig();this.title=new y(new p),this.title.setI18n(this.i18n),this.title.setConfig(t)}componentWillUpdate(){const t=this.prepareConfig();this.title.setI18n(this.i18n),this.title.setConfig(t)}componentWillRender(){this.title.update()}isFirstElement(t){return 0!==t}prepareConfig(){return new _(new E,new C,new c(new f),new f).adapt({businessunit:this.businessUnit,measures:this.measures,scenarios:this.scenarios,timeperiod:this.timeperiod,intervalSpanLimit:this.intervalSpanLimit,i18nMode:this.i18nMode,order:this.order})}static get style(){return':host{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)}.measure{font-weight:bold}div{background-color:var(--bn-font-background, white);color:var(--bn-font-color, black)}'}},[1,"ibcs-title",{businessUnit:[1537,"business-unit"],scenarios:[16],measures:[16],timeperiod:[16],intervalSpanLimit:[2,"interval-span-limit"],order:[16],i18n:[1040],i18nMode:[1,"i18n-mode"],setBusinessUnit:[64],setProps:[64]}]);function P(){"undefined"!=typeof customElements&&["ibcs-title"].forEach((t=>{"ibcs-title"===t&&(customElements.get(e(t))||customElements.define(e(t),O))}))}export{O as I,P as d}
@@ -1 +1 @@
1
- import{k as t}from"./Order.js";import{g as r}from"./_commonjsHelpers.js";class i{adapt(r){return t.adaptDefaultString(r)}default(){return""}}class e{constructor(t){this.type="",this.base="",this.delta="",this.direction="",this.isValid=!1;const r=/(d|dr)(pl\d|ac\d|fc\d|pp\d)_(pl\d|ac\d|fc\d|pp\d)_(pos|neg|neu)/;if(r.test(t)){const i=r.exec(t);null!=i&&(this.type=String(i[1]),this.base=String(i[2]),this.delta=String(i[3]),this.direction=String(i[4]),this.isValid=!0)}}}var s;!function(t){t.OPERATION="operation",t.ROWGROUP="rowGroup",t.ROWGROUPINDEX="rowGroupIndex",t.CURRENTROW="currentRow",t.CATEGORY="category",t.CATEGORYINDEX="categoryIndex",t.SUBCATEGORY="subCategory",t.SUBCATEGORYINDEX="subCategoryIndex",t.COLUMNGROUP="columnGroup",t.COLUMNGROUPINDEX="columnIndex",t.COLUMNSUBGROUP="columnSubGroup",t.COLUMNSUBGROUPINDEX="columnSubGroupIndex",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",t.TOTALROWCOUNT="totalRowCnt",t.ROWNR="rowNr",t.TYPE="type"}(s||(s={}));var n,o={},a=r(function(){if(n)return o;n=1;var t={};return Object.defineProperty(o,"__esModule",{value:!0}),o.default=function(r,i){void 0===i&&(i={});var e=JSON.stringify({text:r,options:i});if(t[e])return t[e];i.font=i.font||"Times",i.fontSize=i.fontSize||"16px",i.fontWeight=i.fontWeight||"normal",i.width=i.width||"auto";var s=function(t,r){var i=document.createElement("div"),e=document.createTextNode(t);return i.appendChild(e),i.style.fontFamily=r.font,i.style.fontSize=r.fontSize,i.style.fontWeight=r.fontWeight,i.style.position="absolute",i.style.visibility="hidden",i.style.left="-999px",i.style.top="-999px",i.style.width=r.width,i.style.height="auto",document.body.appendChild(i),i}(r,i),n={width:s.offsetWidth,height:s.offsetHeight};return function(t){t.parentNode.removeChild(t)}(s),t[e]=n,n},o}());class c{static number(t,r="decimal",i=1,e=0,s=1){return(t/s).toLocaleString("de-DE",{style:r,useGrouping:!0,maximumFractionDigits:i,minimumFractionDigits:e}).replace(/\s+(%)/g,"$1").replace(/\s/g,this.postfixSeperator).replace(/\./g,this.tsdDelimiter)}static translateScenarioLabel(t,r){if(null==t)return"";const i=new e(t);if(!i.isValid)return`${r.get(t)||t}`;let n,o;return s.AC1===i.base?(n=r.get("dr"===i.type?"ibcssymbol_delta_ac_relative":"ibcssymbol_delta_ac"),o=r.get(i.delta)||i.delta):(n=r.get("dr"===i.type?"ibcssymbol_delta_generic_relative":"ibcssymbol_delta_generic"),o=`${r.get(i.base)||i.base} - ${r.get(i.delta)||i.delta}`),void 0===n&&(n="{%}"),`${n.replace("{%}",o)}`}static getMaxWidthOfArrayItems(t,r,i){return a(t.map((t=>c.translateScenarioLabel(t,r))).reduce(((t,r)=>t.length<r.length?r:t),""),{font:i.fontStyles.font,fontSize:i.fontStyles.size+"px"}).width}}c.tsdDelimiter=".",c.postfixSeperator=",";class d{constructor(){this._dateFormat={year:"YYYY",quarter:"Q[Q] YYYY",month:"MMM YYYY",locale:"[KW]WW YYYY",day:"DD.MM.YYYY"},this._dateLinkFormat={avg:"Ø[DATE]",interval:"[DATE]..[DATE]",start:".[DATE]",end:"[DATE].",ytd:"_[DATE]",ytg:"[DATE]_",cum:"[DATE]_[DATE]",mat:"~[DATE]",none:"[DATE]"},this._scenarioMap=new Map,this._fallBackScenario={name:"Series",group:"Series",colorIndex:10,sortIndex:120},this.createScenarioMapEntry("ac","AC",10,400),this.createScenarioMapEntry("fc","FC",30,300),this.createScenarioMapEntry("pl","PL",50,200),this.createScenarioMapEntry("bu","BU",50,200),this.createScenarioMapEntry("pp","PP",20,100),this.createScenarioMapEntry("py","PY",20,100),this.createScenarioMapEntry("dac","dAC",10,1400),this.createScenarioMapEntry("dfc","dFC",30,1300),this.createScenarioMapEntry("dpl","dPL",50,1200),this.createScenarioMapEntry("dbu","dBU",50,1200),this.createScenarioMapEntry("dpp","dPP",20,1100),this.createScenarioMapEntry("dpy","dPY",20,1100),this.createScenarioMapEntry("drac","drAC",10,2400),this.createScenarioMapEntry("drfc","drFC",30,2300),this.createScenarioMapEntry("drpl","drPL",50,2200),this.createScenarioMapEntry("drbu","drBU",50,2200),this.createScenarioMapEntry("drpp","drPP",20,2100),this.createScenarioMapEntry("drpy","drPY",20,2100)}createScenarioMapEntry(t,r,i,e){const s=r,n=i;[1,2,3,4].forEach((i=>{this._scenarioMap.set(t+i,{name:r+i,group:s,colorIndex:n,sortIndex:e+10*i})}))}getScenario(t){return this._scenarioMap.has(t)?this._scenarioMap.get(t):this._fallBackScenario}getScenarioGroup(t){return this._scenarioMap.has(t)?this._scenarioMap.get(t).name:this._fallBackScenario.name}getScenarioColorIndex(t){return this._scenarioMap.has(t)?this._scenarioMap.get(t).colorIndex:this._fallBackScenario.colorIndex}getScenarioSorIndex(t){const r=this.normalizeVarianceScenario(t);return this._scenarioMap.has(r)?this._scenarioMap.get(r).sortIndex:this._fallBackScenario.sortIndex}normalizeVarianceScenario(t){if(null==t)return"";const r=new e(t);return r.isValid?r.type+r.delta:t}}export{a as C,c as F,d as I,s as Q,i as S,e as V}
1
+ import{j as t}from"./Order.js";import{g as r}from"./luxon.js";class i{adapt(r){return t.adaptDefaultString(r)}default(){return""}}class e{constructor(t){this.type="",this.base="",this.delta="",this.direction="",this.isValid=!1;const r=/(d|dr)(pl\d|ac\d|fc\d|pp\d)_(pl\d|ac\d|fc\d|pp\d)_(pos|neg|neu)/;if(r.test(t)){const i=r.exec(t);null!=i&&(this.type=String(i[1]),this.base=String(i[2]),this.delta=String(i[3]),this.direction=String(i[4]),this.isValid=!0)}}}var s;!function(t){t.OPERATION="operation",t.ROWGROUP="rowGroup",t.ROWGROUPINDEX="rowGroupIndex",t.CURRENTROW="currentRow",t.CATEGORY="category",t.CATEGORYINDEX="categoryIndex",t.SUBCATEGORY="subCategory",t.SUBCATEGORYINDEX="subCategoryIndex",t.COLUMNGROUP="columnGroup",t.COLUMNGROUPINDEX="columnIndex",t.COLUMNSUBGROUP="columnSubGroup",t.COLUMNSUBGROUPINDEX="columnSubGroupIndex",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",t.TOTALROWCOUNT="totalRowCnt",t.ROWNR="rowNr",t.TYPE="type"}(s||(s={}));var n,o={},a=r(function(){if(n)return o;n=1;var t={};return Object.defineProperty(o,"__esModule",{value:!0}),o.default=function(r,i){void 0===i&&(i={});var e=JSON.stringify({text:r,options:i});if(t[e])return t[e];i.font=i.font||"Times",i.fontSize=i.fontSize||"16px",i.fontWeight=i.fontWeight||"normal",i.width=i.width||"auto";var s=function(t,r){var i=document.createElement("div"),e=document.createTextNode(t);return i.appendChild(e),i.style.fontFamily=r.font,i.style.fontSize=r.fontSize,i.style.fontWeight=r.fontWeight,i.style.position="absolute",i.style.visibility="hidden",i.style.left="-999px",i.style.top="-999px",i.style.width=r.width,i.style.height="auto",document.body.appendChild(i),i}(r,i),n={width:s.offsetWidth,height:s.offsetHeight};return function(t){t.parentNode.removeChild(t)}(s),t[e]=n,n},o}());class c{static number(t,r="decimal",i=1,e=0,s=1){return(t/s).toLocaleString("de-DE",{style:r,useGrouping:!0,maximumFractionDigits:i,minimumFractionDigits:e}).replace(/\s+(%)/g,"$1").replace(/\s/g,this.postfixSeperator).replace(/\./g,this.tsdDelimiter)}static translateScenarioLabel(t,r){if(null==t)return"";const i=new e(t);if(!i.isValid)return`${r.get(t)||t}`;let n,o;return s.AC1===i.base?(n=r.get("dr"===i.type?"ibcssymbol_delta_ac_relative":"ibcssymbol_delta_ac"),o=r.get(i.delta)||i.delta):(n=r.get("dr"===i.type?"ibcssymbol_delta_generic_relative":"ibcssymbol_delta_generic"),o=`${r.get(i.base)||i.base} - ${r.get(i.delta)||i.delta}`),void 0===n&&(n="{%}"),`${n.replace("{%}",o)}`}static getMaxWidthOfArrayItems(t,r,i){return a(t.map((t=>c.translateScenarioLabel(t,r))).reduce(((t,r)=>t.length<r.length?r:t),""),{font:i.fontStyles.font,fontSize:i.fontStyles.size+"px"}).width}}c.tsdDelimiter=".",c.postfixSeperator=",";class d{constructor(){this._dateFormat={year:"YYYY",quarter:"Q[Q] YYYY",month:"MMM YYYY",locale:"[KW]WW YYYY",day:"DD.MM.YYYY"},this._dateLinkFormat={avg:"Ø[DATE]",interval:"[DATE]..[DATE]",start:".[DATE]",end:"[DATE].",ytd:"_[DATE]",ytg:"[DATE]_",cum:"[DATE]_[DATE]",mat:"~[DATE]",none:"[DATE]"},this._scenarioMap=new Map,this._fallBackScenario={name:"Series",group:"Series",colorIndex:10,sortIndex:120},this.createScenarioMapEntry("ac","AC",10,400),this.createScenarioMapEntry("fc","FC",30,300),this.createScenarioMapEntry("pl","PL",50,200),this.createScenarioMapEntry("bu","BU",50,200),this.createScenarioMapEntry("pp","PP",20,100),this.createScenarioMapEntry("py","PY",20,100),this.createScenarioMapEntry("dac","dAC",10,1400),this.createScenarioMapEntry("dfc","dFC",30,1300),this.createScenarioMapEntry("dpl","dPL",50,1200),this.createScenarioMapEntry("dbu","dBU",50,1200),this.createScenarioMapEntry("dpp","dPP",20,1100),this.createScenarioMapEntry("dpy","dPY",20,1100),this.createScenarioMapEntry("drac","drAC",10,2400),this.createScenarioMapEntry("drfc","drFC",30,2300),this.createScenarioMapEntry("drpl","drPL",50,2200),this.createScenarioMapEntry("drbu","drBU",50,2200),this.createScenarioMapEntry("drpp","drPP",20,2100),this.createScenarioMapEntry("drpy","drPY",20,2100)}createScenarioMapEntry(t,r,i,e){const s=r,n=i;[1,2,3,4].forEach((i=>{this._scenarioMap.set(t+i,{name:r+i,group:s,colorIndex:n,sortIndex:e+10*i})}))}getScenario(t){return this._scenarioMap.has(t)?this._scenarioMap.get(t):this._fallBackScenario}getScenarioGroup(t){return this._scenarioMap.has(t)?this._scenarioMap.get(t).name:this._fallBackScenario.name}getScenarioColorIndex(t){return this._scenarioMap.has(t)?this._scenarioMap.get(t).colorIndex:this._fallBackScenario.colorIndex}getScenarioSorIndex(t){const r=this.normalizeVarianceScenario(t);return this._scenarioMap.has(r)?this._scenarioMap.get(r).sortIndex:this._fallBackScenario.sortIndex}normalizeVarianceScenario(t){if(null==t)return"";const r=new e(t);return r.isValid?r.type+r.delta:t}}export{a as C,c as F,d as I,s as Q,i as S,e as V}
@@ -0,0 +1 @@
1
+ var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function e(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}class n extends Error{}class r extends n{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class s extends n{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class i extends n{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class u extends n{}class o extends n{constructor(t){super(`Invalid unit ${t}`)}}class a extends n{}class c extends n{constructor(){super("Zone is an abstract class")}}const h="numeric",l="short",d="long",m={year:h,month:h,day:h},f={year:h,month:l,day:h},y={year:h,month:l,day:h,weekday:l},g={year:h,month:d,day:h},w={year:h,month:d,day:h,weekday:d},p={hour:h,minute:h},M={hour:h,minute:h,second:h},k={hour:h,minute:h,second:h,timeZoneName:l},S={hour:h,minute:h,second:h,timeZoneName:d},T={hour:h,minute:h,hourCycle:"h23"},N={hour:h,minute:h,second:h,hourCycle:"h23"},b={hour:h,minute:h,second:h,hourCycle:"h23",timeZoneName:l},v={hour:h,minute:h,second:h,hourCycle:"h23",timeZoneName:d},E={year:h,month:h,day:h,hour:h,minute:h},O={year:h,month:h,day:h,hour:h,minute:h,second:h},D={year:h,month:l,day:h,hour:h,minute:h},$={year:h,month:l,day:h,hour:h,minute:h,second:h},I={year:h,month:l,day:h,weekday:l,hour:h,minute:h},x={year:h,month:d,day:h,hour:h,minute:h,timeZoneName:l},F={year:h,month:d,day:h,hour:h,minute:h,second:h,timeZoneName:l},Z={year:h,month:d,day:h,weekday:d,hour:h,minute:h,timeZoneName:d},L={year:h,month:d,day:h,weekday:d,hour:h,minute:h,second:h,timeZoneName:d};class W{get type(){throw new c}get name(){throw new c}get ianaName(){return this.name}get isUniversal(){throw new c}offsetName(t,e){throw new c}formatOffset(t,e){throw new c}offset(t){throw new c}equals(t){throw new c}get isValid(){throw new c}}let A=null;class C extends W{static get instance(){return null===A&&(A=new C),A}get type(){return"system"}get name(){return(new Intl.DateTimeFormat).resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:e,locale:n}){return re(t,e,n)}formatOffset(t,e){return oe(this.offset(t),e)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return"system"===t.type}get isValid(){return!0}}const _=new Map,j={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6},q=new Map;class H extends W{static create(t){let e=q.get(t);return void 0===e&&q.set(t,e=new H(t)),e}static resetCache(){q.clear(),_.clear()}static isValidSpecifier(t){return this.isValidZone(t)}static isValidZone(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch(t){return!1}}constructor(t){super(),this.zoneName=t,this.valid=H.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:e,locale:n}){return re(t,e,n,this.name)}formatOffset(t,e){return oe(this.offset(t),e)}offset(t){if(!this.valid)return NaN;const e=new Date(t);if(isNaN(e))return NaN;const n=function(t){let e=_.get(t);return void 0===e&&(e=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),_.set(t,e)),e}(this.name);let[r,s,i,u,o,a,c]=n.formatToParts?function(t,e){const n=t.formatToParts(e),r=[];for(let t=0;t<n.length;t++){const{type:e,value:s}=n[t],i=j[e];"era"===e?r[i]=s:At(i)||(r[i]=parseInt(s,10))}return r}(n,e):function(t,e){const n=t.format(e).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,s,i,u,o,a,c,h]=r;return[u,s,i,o,a,c,h]}(n,e);"BC"===u&&(r=1-Math.abs(r));let h=+e;const l=h%1e3;return h-=l>=0?l:1e3+l,(Xt({year:r,month:s,day:i,hour:24===o?0:o,minute:a,second:c,millisecond:0})-h)/6e4}equals(t){return"iana"===t.type&&t.name===this.name}get isValid(){return this.valid}}let z={};const R=new Map;function U(t,e={}){const n=JSON.stringify([t,e]);let r=R.get(n);return void 0===r&&(r=new Intl.DateTimeFormat(t,e),R.set(n,r)),r}const J=new Map,G=new Map;let P=null;const Y=new Map;function V(t){let e=Y.get(t);return void 0===e&&(e=new Intl.DateTimeFormat(t).resolvedOptions(),Y.set(t,e)),e}const B=new Map;function Q(t,e,n,r){const s=t.listingMode();return"error"===s?null:"en"===s?n(e):r(e)}class K{constructor(t,e,n){this.padTo=n.padTo||0,this.floor=n.floor||!1;const{padTo:r,floor:s,...i}=n;if(!e||Object.keys(i).length>0){const e={useGrouping:!1,...n};n.padTo>0&&(e.minimumIntegerDigits=n.padTo),this.inf=function(t,e={}){const n=JSON.stringify([t,e]);let r=J.get(n);return void 0===r&&(r=new Intl.NumberFormat(t,e),J.set(n,r)),r}(t,e)}}format(t){if(this.inf){const e=this.floor?Math.floor(t):t;return this.inf.format(e)}return Jt(this.floor?Math.floor(t):Vt(t,3),this.padTo)}}class X{constructor(t,e,n){let r;if(this.opts=n,this.originalZone=void 0,this.opts.timeZone)this.dt=t;else if("fixed"===t.zone.type){const e=t.offset/60*-1,n=e>=0?`Etc/GMT+${e}`:`Etc/GMT${e}`;0!==t.offset&&H.create(n).valid?(r=n,this.dt=t):(r="UTC",this.dt=0===t.offset?t:t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone)}else"system"===t.zone.type?this.dt=t:"iana"===t.zone.type?(this.dt=t,r=t.zone.name):(r="UTC",this.dt=t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone);const s={...this.opts};s.timeZone=s.timeZone||r,this.dtf=U(e,s)}format(){return this.originalZone?this.formatToParts().map((({value:t})=>t)).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const t=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?t.map((t=>{if("timeZoneName"===t.type){const e=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...t,value:e}}return t})):t}resolvedOptions(){return this.dtf.resolvedOptions()}}class tt{constructor(t,e,n){this.opts={style:"long",...n},!e&&jt()&&(this.rtf=function(t,e={}){const{base:n,...r}=e,s=JSON.stringify([t,r]);let i=G.get(s);return void 0===i&&(i=new Intl.RelativeTimeFormat(t,e),G.set(s,i)),i}(t,n))}format(t,e){return this.rtf?this.rtf.format(t,e):function(t,e,n="always",r=!1){const s={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},i=-1===["hours","minutes","seconds"].indexOf(t);if("auto"===n&&i){const n="days"===t;switch(e){case 1:return n?"tomorrow":`next ${s[t][0]}`;case-1:return n?"yesterday":`last ${s[t][0]}`;case 0:return n?"today":`this ${s[t][0]}`}}const u=Object.is(e,-0)||e<0,o=Math.abs(e),a=1===o,c=s[t],h=r?a?c[1]:c[2]||c[1]:a?s[t][0]:t;return u?`${o} ${h} ago`:`in ${o} ${h}`}(e,t,this.opts.numeric,"long"!==this.opts.style)}formatToParts(t,e){return this.rtf?this.rtf.formatToParts(t,e):[]}}const et={firstDay:1,minimalDays:4,weekend:[6,7]};class nt{static fromOpts(t){return nt.create(t.locale,t.numberingSystem,t.outputCalendar,t.weekSettings,t.defaultToEN)}static create(t,e,n,r,s=!1){const i=t||kt.defaultLocale,u=i||(s?"en-US":P||(P=(new Intl.DateTimeFormat).resolvedOptions().locale,P)),o=e||kt.defaultNumberingSystem,a=n||kt.defaultOutputCalendar,c=Rt(r)||kt.defaultWeekSettings;return new nt(u,o,a,c,i)}static resetCache(){P=null,R.clear(),J.clear(),G.clear(),Y.clear(),B.clear()}static fromObject({locale:t,numberingSystem:e,outputCalendar:n,weekSettings:r}={}){return nt.create(t,e,n,r)}constructor(t,e,n,r,s){const[i,u,o]=function(t){const e=t.indexOf("-x-");-1!==e&&(t=t.substring(0,e));const n=t.indexOf("-u-");if(-1===n)return[t];{let e,r;try{e=U(t).resolvedOptions(),r=t}catch(s){const i=t.substring(0,n);e=U(i).resolvedOptions(),r=i}const{numberingSystem:s,calendar:i}=e;return[r,s,i]}}(t);this.locale=i,this.numberingSystem=e||u||null,this.outputCalendar=n||o||null,this.weekSettings=r,this.intl=function(t,e,n){return n||e?(t.includes("-u-")||(t+="-u"),n&&(t+=`-ca-${n}`),e&&(t+=`-nu-${e}`),t):t}(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=s,this.fastNumbersCached=null}get fastNumbers(){var t;return null==this.fastNumbersCached&&(this.fastNumbersCached=(!(t=this).numberingSystem||"latn"===t.numberingSystem)&&("latn"===t.numberingSystem||!t.locale||t.locale.startsWith("en")||"latn"===V(t.locale).numberingSystem)),this.fastNumbersCached}listingMode(){return this.isEnglish()&&!(null!==this.numberingSystem&&"latn"!==this.numberingSystem||null!==this.outputCalendar&&"gregory"!==this.outputCalendar)?"en":"intl"}clone(t){return t&&0!==Object.getOwnPropertyNames(t).length?nt.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,Rt(t.weekSettings)||this.weekSettings,t.defaultToEN||!1):this}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,e=!1){return Q(this,t,de,(()=>{const n="ja"===this.intl||this.intl.startsWith("ja-"),r=(e&=!n)?{month:t,day:"numeric"}:{month:t},s=e?"format":"standalone";return this.monthsCache[s][t]||(this.monthsCache[s][t]=function(t){const e=[];for(let n=1;n<=12;n++){const r=yr.utc(2009,n,1);e.push(t(r))}return e}(n?t=>this.dtFormatter(t,r).format():t=>this.extract(t,r,"month"))),this.monthsCache[s][t]}))}weekdays(t,e=!1){return Q(this,t,ge,(()=>{const n=e?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},r=e?"format":"standalone";return this.weekdaysCache[r][t]||(this.weekdaysCache[r][t]=function(t){const e=[];for(let n=1;n<=7;n++){const r=yr.utc(2016,11,13+n);e.push(t(r))}return e}((t=>this.extract(t,n,"weekday")))),this.weekdaysCache[r][t]}))}meridiems(){return Q(this,void 0,(()=>we),(()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[yr.utc(2016,11,13,9),yr.utc(2016,11,13,19)].map((e=>this.extract(e,t,"dayperiod")))}return this.meridiemCache}))}eras(t){return Q(this,t,Se,(()=>{const e={era:t};return this.eraCache[t]||(this.eraCache[t]=[yr.utc(-40,1,1),yr.utc(2017,1,1)].map((t=>this.extract(t,e,"era")))),this.eraCache[t]}))}extract(t,e,n){const r=this.dtFormatter(t,e).formatToParts().find((t=>t.type.toLowerCase()===n));return r?r.value:null}numberFormatter(t={}){return new K(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,e={}){return new X(t,this.intl,e)}relFormatter(t={}){return new tt(this.intl,this.isEnglish(),t)}listFormatter(t={}){return function(t,e={}){const n=JSON.stringify([t,e]);let r=z[n];return r||(r=new Intl.ListFormat(t,e),z[n]=r),r}(this.intl,t)}isEnglish(){return"en"===this.locale||"en-us"===this.locale.toLowerCase()||V(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:qt()?function(t){let e=B.get(t);if(!e){const n=new Intl.Locale(t);e="getWeekInfo"in n?n.getWeekInfo():n.weekInfo,"minimalDays"in e||(e={...et,...e}),B.set(t,e)}return e}(this.locale):et}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let rt=null;class st extends W{static get utcInstance(){return null===rt&&(rt=new st(0)),rt}static instance(t){return 0===t?st.utcInstance:new st(t)}static parseSpecifier(t){if(t){const e=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(e)return new st(se(e[1],e[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return 0===this.fixed?"UTC":`UTC${oe(this.fixed,"narrow")}`}get ianaName(){return 0===this.fixed?"Etc/UTC":`Etc/GMT${oe(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,e){return oe(this.fixed,e)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return"fixed"===t.type&&t.fixed===this.fixed}get isValid(){return!0}}class it extends W{constructor(t){super(),this.zoneName=t}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function ut(t,e){if(At(t)||null===t)return e;if(t instanceof W)return t;if("string"==typeof t){const n=t.toLowerCase();return"default"===n?e:"local"===n||"system"===n?C.instance:"utc"===n||"gmt"===n?st.utcInstance:st.parseSpecifier(n)||H.create(t)}return Ct(t)?st.instance(t):"object"==typeof t&&"offset"in t&&"function"==typeof t.offset?t:new it(t)}const ot={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},at={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},ct=ot.hanidec.replace(/[\[|\]]/g,"").split(""),ht=new Map;function lt({numberingSystem:t},e=""){const n=t||"latn";let r=ht.get(n);void 0===r&&(r=new Map,ht.set(n,r));let s=r.get(e);return void 0===s&&(s=new RegExp(`${ot[n]}${e}`),r.set(e,s)),s}let dt,mt=()=>Date.now(),ft="system",yt=null,gt=null,wt=null,pt=60,Mt=null;class kt{static get now(){return mt}static set now(t){mt=t}static set defaultZone(t){ft=t}static get defaultZone(){return ut(ft,C.instance)}static get defaultLocale(){return yt}static set defaultLocale(t){yt=t}static get defaultNumberingSystem(){return gt}static set defaultNumberingSystem(t){gt=t}static get defaultOutputCalendar(){return wt}static set defaultOutputCalendar(t){wt=t}static get defaultWeekSettings(){return Mt}static set defaultWeekSettings(t){Mt=Rt(t)}static get twoDigitCutoffYear(){return pt}static set twoDigitCutoffYear(t){pt=t%100}static get throwOnInvalid(){return dt}static set throwOnInvalid(t){dt=t}static resetCaches(){nt.resetCache(),H.resetCache(),yr.resetCache(),ht.clear()}}class St{constructor(t,e){this.reason=t,this.explanation=e}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const Tt=[0,31,59,90,120,151,181,212,243,273,304,334],Nt=[0,31,60,91,121,152,182,213,244,274,305,335];function bt(t,e){return new St("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${t}, which is invalid`)}function vt(t,e,n){const r=new Date(Date.UTC(t,e-1,n));t<100&&t>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);const s=r.getUTCDay();return 0===s?7:s}function Et(t,e,n){return n+(Bt(t)?Nt:Tt)[e-1]}function Ot(t,e){const n=Bt(t)?Nt:Tt,r=n.findIndex((t=>t<e));return{month:r+1,day:e-n[r]}}function Dt(t,e){return(t-e+7)%7+1}function $t(t,e=4,n=1){const{year:r,month:s,day:i}=t,u=Et(r,s,i),o=Dt(vt(r,s,i),n);let a,c=Math.floor((u-o+14-e)/7);return c<1?(a=r-1,c=ee(a,e,n)):c>ee(r,e,n)?(a=r+1,c=1):a=r,{weekYear:a,weekNumber:c,weekday:o,...ae(t)}}function It(t,e=4,n=1){const{weekYear:r,weekNumber:s,weekday:i}=t,u=Dt(vt(r,1,e),n),o=Qt(r);let a,c=7*s+i-u-7+e;c<1?(a=r-1,c+=Qt(a)):c>o?(a=r+1,c-=Qt(r)):a=r;const{month:h,day:l}=Ot(a,c);return{year:a,month:h,day:l,...ae(t)}}function xt(t){const{year:e,month:n,day:r}=t;return{year:e,ordinal:Et(e,n,r),...ae(t)}}function Ft(t){const{year:e,ordinal:n}=t,{month:r,day:s}=Ot(e,n);return{year:e,month:r,day:s,...ae(t)}}function Zt(t,e){if(!At(t.localWeekday)||!At(t.localWeekNumber)||!At(t.localWeekYear)){if(!At(t.weekday)||!At(t.weekNumber)||!At(t.weekYear))throw new u("Cannot mix locale-based week fields with ISO-based week fields");return At(t.localWeekday)||(t.weekday=t.localWeekday),At(t.localWeekNumber)||(t.weekNumber=t.localWeekNumber),At(t.localWeekYear)||(t.weekYear=t.localWeekYear),delete t.localWeekday,delete t.localWeekNumber,delete t.localWeekYear,{minDaysInFirstWeek:e.getMinDaysInFirstWeek(),startOfWeek:e.getStartOfWeek()}}return{minDaysInFirstWeek:4,startOfWeek:1}}function Lt(t){const e=_t(t.year),n=Ut(t.month,1,12),r=Ut(t.day,1,Kt(t.year,t.month));return e?n?!r&&bt("day",t.day):bt("month",t.month):bt("year",t.year)}function Wt(t){const{hour:e,minute:n,second:r,millisecond:s}=t,i=Ut(e,0,23)||24===e&&0===n&&0===r&&0===s,u=Ut(n,0,59),o=Ut(r,0,59),a=Ut(s,0,999);return i?u?o?!a&&bt("millisecond",s):bt("second",r):bt("minute",n):bt("hour",e)}function At(t){return void 0===t}function Ct(t){return"number"==typeof t}function _t(t){return"number"==typeof t&&t%1==0}function jt(){try{return"undefined"!=typeof Intl&&!!Intl.RelativeTimeFormat}catch(t){return!1}}function qt(){try{return"undefined"!=typeof Intl&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch(t){return!1}}function Ht(t,e,n){if(0!==t.length)return t.reduce(((t,r)=>{const s=[e(r),r];return t&&n(t[0],s[0])===t[0]?t:s}),null)[1]}function zt(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Rt(t){if(null==t)return null;if("object"!=typeof t)throw new a("Week settings must be an object");if(!Ut(t.firstDay,1,7)||!Ut(t.minimalDays,1,7)||!Array.isArray(t.weekend)||t.weekend.some((t=>!Ut(t,1,7))))throw new a("Invalid week settings");return{firstDay:t.firstDay,minimalDays:t.minimalDays,weekend:Array.from(t.weekend)}}function Ut(t,e,n){return _t(t)&&t>=e&&t<=n}function Jt(t,e=2){let n;return n=t<0?"-"+(""+-t).padStart(e,"0"):(""+t).padStart(e,"0"),n}function Gt(t){return At(t)||null===t||""===t?void 0:parseInt(t,10)}function Pt(t){return At(t)||null===t||""===t?void 0:parseFloat(t)}function Yt(t){if(!At(t)&&null!==t&&""!==t){const e=1e3*parseFloat("0."+t);return Math.floor(e)}}function Vt(t,e,n="round"){const r=10**e;switch(n){case"expand":return t>0?Math.ceil(t*r)/r:Math.floor(t*r)/r;case"trunc":return Math.trunc(t*r)/r;case"round":return Math.round(t*r)/r;case"floor":return Math.floor(t*r)/r;case"ceil":return Math.ceil(t*r)/r;default:throw new RangeError(`Value rounding ${n} is out of range`)}}function Bt(t){return t%4==0&&(t%100!=0||t%400==0)}function Qt(t){return Bt(t)?366:365}function Kt(t,e){const n=(r=e-1)-12*Math.floor(r/12)+1;var r;return 2===n?Bt(t+(e-n)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function Xt(t){let e=Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,t.second,t.millisecond);return t.year<100&&t.year>=0&&(e=new Date(e),e.setUTCFullYear(t.year,t.month-1,t.day)),+e}function te(t,e,n){return-Dt(vt(t,1,e),n)+e-1}function ee(t,e=4,n=1){const r=te(t,e,n),s=te(t+1,e,n);return(Qt(t)-r+s)/7}function ne(t){return t>99?t:t>kt.twoDigitCutoffYear?1900+t:2e3+t}function re(t,e,n,r=null){const s=new Date(t),i={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(i.timeZone=r);const u={timeZoneName:e,...i},o=new Intl.DateTimeFormat(n,u).formatToParts(s).find((t=>"timezonename"===t.type.toLowerCase()));return o?o.value:null}function se(t,e){let n=parseInt(t,10);Number.isNaN(n)&&(n=0);const r=parseInt(e,10)||0;return 60*n+(n<0||Object.is(n,-0)?-r:r)}function ie(t){const e=Number(t);if("boolean"==typeof t||""===t||!Number.isFinite(e))throw new a(`Invalid unit value ${t}`);return e}function ue(t,e){const n={};for(const r in t)if(zt(t,r)){const s=t[r];if(null==s)continue;n[e(r)]=ie(s)}return n}function oe(t,e){const n=Math.trunc(Math.abs(t/60)),r=Math.trunc(Math.abs(t%60)),s=t>=0?"+":"-";switch(e){case"short":return`${s}${Jt(n,2)}:${Jt(r,2)}`;case"narrow":return`${s}${n}${r>0?`:${r}`:""}`;case"techie":return`${s}${Jt(n,2)}${Jt(r,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function ae(t){return function(t){return["hour","minute","second","millisecond"].reduce(((e,n)=>(e[n]=t[n],e)),{})}(t)}const ce=["January","February","March","April","May","June","July","August","September","October","November","December"],he=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],le=["J","F","M","A","M","J","J","A","S","O","N","D"];function de(t){switch(t){case"narrow":return[...le];case"short":return[...he];case"long":return[...ce];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const me=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],fe=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],ye=["M","T","W","T","F","S","S"];function ge(t){switch(t){case"narrow":return[...ye];case"short":return[...fe];case"long":return[...me];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const we=["AM","PM"],pe=["Before Christ","Anno Domini"],Me=["BC","AD"],ke=["B","A"];function Se(t){switch(t){case"narrow":return[...ke];case"short":return[...Me];case"long":return[...pe];default:return null}}function Te(t,e){let n="";for(const r of t)n+=r.literal?r.val:e(r.val);return n}const Ne={D:m,DD:f,DDD:g,DDDD:w,t:p,tt:M,ttt:k,tttt:S,T,TT:N,TTT:b,TTTT:v,f:E,ff:D,fff:x,ffff:Z,F:O,FF:$,FFF:F,FFFF:L};class be{static create(t,e={}){return new be(t,e)}static parseFormat(t){let e=null,n="",r=!1;const s=[];for(let i=0;i<t.length;i++){const u=t.charAt(i);"'"===u?((n.length>0||r)&&s.push({literal:r||/^\s+$/.test(n),val:""===n?"'":n}),e=null,n="",r=!r):r||u===e?n+=u:(n.length>0&&s.push({literal:/^\s+$/.test(n),val:n}),n=u,e=u)}return n.length>0&&s.push({literal:r||/^\s+$/.test(n),val:n}),s}static macroTokenToFormatOpts(t){return Ne[t]}constructor(t,e){this.opts=e,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,e){return null===this.systemLoc&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(t,{...this.opts,...e}).format()}dtFormatter(t,e={}){return this.loc.dtFormatter(t,{...this.opts,...e})}formatDateTime(t,e){return this.dtFormatter(t,e).format()}formatDateTimeParts(t,e){return this.dtFormatter(t,e).formatToParts()}formatInterval(t,e){return this.dtFormatter(t.start,e).dtf.formatRange(t.start.toJSDate(),t.end.toJSDate())}resolvedOptions(t,e){return this.dtFormatter(t,e).resolvedOptions()}num(t,e=0,n){if(this.opts.forceSimple)return Jt(t,e);const r={...this.opts};return e>0&&(r.padTo=e),n&&(r.signDisplay=n),this.loc.numberFormatter(r).format(t)}formatDateTimeFromString(t,e){const n="en"===this.loc.listingMode(),r=this.loc.outputCalendar&&"gregory"!==this.loc.outputCalendar,s=(e,n)=>this.loc.extract(t,e,n),i=e=>t.isOffsetFixed&&0===t.offset&&e.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,e.format):"",u=(e,r)=>n?function(t,e){return de(e)[t.month-1]}(t,e):s(r?{month:e}:{month:e,day:"numeric"},"month"),o=(e,r)=>n?function(t,e){return ge(e)[t.weekday-1]}(t,e):s(r?{weekday:e}:{weekday:e,month:"long",day:"numeric"},"weekday"),a=e=>{const n=be.macroTokenToFormatOpts(e);return n?this.formatWithSystemDefault(t,n):e},c=e=>n?function(t,e){return Se(e)[t.year<0?0:1]}(t,e):s({era:e},"era");return Te(be.parseFormat(e),(e=>{switch(e){case"S":return this.num(t.millisecond);case"u":case"SSS":return this.num(t.millisecond,3);case"s":return this.num(t.second);case"ss":return this.num(t.second,2);case"uu":return this.num(Math.floor(t.millisecond/10),2);case"uuu":return this.num(Math.floor(t.millisecond/100));case"m":return this.num(t.minute);case"mm":return this.num(t.minute,2);case"h":return this.num(t.hour%12==0?12:t.hour%12);case"hh":return this.num(t.hour%12==0?12:t.hour%12,2);case"H":return this.num(t.hour);case"HH":return this.num(t.hour,2);case"Z":return i({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return i({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return i({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:this.loc.locale});case"z":return t.zoneName;case"a":return n?function(t){return we[t.hour<12?0:1]}(t):s({hour:"numeric",hourCycle:"h12"},"dayperiod");case"d":return r?s({day:"numeric"},"day"):this.num(t.day);case"dd":return r?s({day:"2-digit"},"day"):this.num(t.day,2);case"c":case"E":return this.num(t.weekday);case"ccc":return o("short",!0);case"cccc":return o("long",!0);case"ccccc":return o("narrow",!0);case"EEE":return o("short",!1);case"EEEE":return o("long",!1);case"EEEEE":return o("narrow",!1);case"L":return r?s({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return r?s({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return u("short",!0);case"LLLL":return u("long",!0);case"LLLLL":return u("narrow",!0);case"M":return r?s({month:"numeric"},"month"):this.num(t.month);case"MM":return r?s({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return u("short",!1);case"MMMM":return u("long",!1);case"MMMMM":return u("narrow",!1);case"y":return r?s({year:"numeric"},"year"):this.num(t.year);case"yy":return r?s({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return r?s({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return r?s({year:"numeric"},"year"):this.num(t.year,6);case"G":return c("short");case"GG":return c("long");case"GGGGG":return c("narrow");case"kk":return this.num(t.weekYear.toString().slice(-2),2);case"kkkk":return this.num(t.weekYear,4);case"W":return this.num(t.weekNumber);case"WW":return this.num(t.weekNumber,2);case"n":return this.num(t.localWeekNumber);case"nn":return this.num(t.localWeekNumber,2);case"ii":return this.num(t.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(t.localWeekYear,4);case"o":return this.num(t.ordinal);case"ooo":return this.num(t.ordinal,3);case"q":return this.num(t.quarter);case"qq":return this.num(t.quarter,2);case"X":return this.num(Math.floor(t.ts/1e3));case"x":return this.num(t.ts);default:return a(e)}}))}formatDurationFromString(t,e){const n="negativeLargestOnly"===this.opts.signMode?-1:1,r=t=>{switch(t[0]){case"S":return"milliseconds";case"s":return"seconds";case"m":return"minutes";case"h":return"hours";case"d":return"days";case"w":return"weeks";case"M":return"months";case"y":return"years";default:return null}},s=be.parseFormat(e),i=s.reduce(((t,{literal:e,val:n})=>e?t:t.concat(n)),[]),u=t.shiftTo(...i.map(r).filter((t=>t)));return Te(s,((t,e)=>s=>{const i=r(s);if(i){const r=e.isNegativeDuration&&i!==e.largestUnit?n:1;let u;return u="negativeLargestOnly"===this.opts.signMode&&i!==e.largestUnit?"never":"all"===this.opts.signMode?"always":"auto",this.num(t.get(i)*r,s.length,u)}return s})(u,{isNegativeDuration:u<0,largestUnit:Object.keys(u.values)[0]}))}}const ve=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Ee(...t){const e=t.reduce(((t,e)=>t+e.source),"");return RegExp(`^${e}$`)}function Oe(...t){return e=>t.reduce((([t,n,r],s)=>{const[i,u,o]=s(e,r);return[{...t,...i},u||n,o]}),[{},null,1]).slice(0,2)}function De(t,...e){if(null==t)return[null,null];for(const[n,r]of e){const e=n.exec(t);if(e)return r(e)}return[null,null]}function $e(...t){return(e,n)=>{const r={};let s;for(s=0;s<t.length;s++)r[t[s]]=Gt(e[n+s]);return[r,null,n+s]}}const Ie=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,xe=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Fe=RegExp(`${xe.source}(?:${Ie.source}?(?:\\[(${ve.source})\\])?)?`),Ze=RegExp(`(?:[Tt]${Fe.source})?`),Le=$e("weekYear","weekNumber","weekDay"),We=$e("year","ordinal"),Ae=RegExp(`${xe.source} ?(?:${Ie.source}|(${ve.source}))?`),Ce=RegExp(`(?: ${Ae.source})?`);function _e(t,e,n){const r=t[e];return At(r)?n:Gt(r)}function je(t,e){return[{hours:_e(t,e,0),minutes:_e(t,e+1,0),seconds:_e(t,e+2,0),milliseconds:Yt(t[e+3])},null,e+4]}function qe(t,e){const n=!t[e]&&!t[e+1],r=se(t[e+1],t[e+2]);return[{},n?null:st.instance(r),e+3]}function He(t,e){return[{},t[e]?H.create(t[e]):null,e+1]}const ze=RegExp(`^T?${xe.source}$`),Re=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function Ue(t){const[e,n,r,s,i,u,o,a,c]=t,h="-"===e[0],l=a&&"-"===a[0],d=(t,e=!1)=>void 0!==t&&(e||t&&h)?-t:t;return[{years:d(Pt(n)),months:d(Pt(r)),weeks:d(Pt(s)),days:d(Pt(i)),hours:d(Pt(u)),minutes:d(Pt(o)),seconds:d(Pt(a),"-0"===a),milliseconds:d(Yt(c),l)}]}const Je={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Ge(t,e,n,r,s,i,u){const o={year:2===e.length?ne(Gt(e)):Gt(e),month:he.indexOf(n)+1,day:Gt(r),hour:Gt(s),minute:Gt(i)};return u&&(o.second=Gt(u)),t&&(o.weekday=t.length>3?me.indexOf(t)+1:fe.indexOf(t)+1),o}const Pe=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function Ye(t){const[,e,n,r,s,i,u,o,a,c,h,l]=t,d=Ge(e,s,r,n,i,u,o);let m;return m=a?Je[a]:c?0:se(h,l),[d,new st(m)]}const Ve=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,Be=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,Qe=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Ke(t){const[,e,n,r,s,i,u,o]=t;return[Ge(e,s,r,n,i,u,o),st.utcInstance]}function Xe(t){const[,e,n,r,s,i,u,o]=t;return[Ge(e,o,n,r,s,i,u),st.utcInstance]}const tn=Ee(/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Ze),en=Ee(/(\d{4})-?W(\d\d)(?:-?(\d))?/,Ze),nn=Ee(/(\d{4})-?(\d{3})/,Ze),rn=Ee(Fe),sn=Oe((function(t,e){return[{year:_e(t,e),month:_e(t,e+1,1),day:_e(t,e+2,1)},null,e+3]}),je,qe,He),un=Oe(Le,je,qe,He),on=Oe(We,je,qe,He),an=Oe(je,qe,He),cn=Oe(je),hn=Ee(/(\d{4})-(\d\d)-(\d\d)/,Ce),ln=Ee(Ae),dn=Oe(je,qe,He),mn="Invalid Duration",fn={weeks:{days:7,hours:168,minutes:10080,seconds:604800,milliseconds:6048e5},days:{hours:24,minutes:1440,seconds:86400,milliseconds:864e5},hours:{minutes:60,seconds:3600,milliseconds:36e5},minutes:{seconds:60,milliseconds:6e4},seconds:{milliseconds:1e3}},yn={years:{quarters:4,months:12,weeks:52,days:365,hours:8760,minutes:525600,seconds:31536e3,milliseconds:31536e6},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:131040,seconds:7862400,milliseconds:78624e5},months:{weeks:4,days:30,hours:720,minutes:43200,seconds:2592e3,milliseconds:2592e6},...fn},gn={years:{quarters:4,months:12,weeks:52.1775,days:365.2425,hours:8765.82,minutes:525949.2,seconds:525949.2*60,milliseconds:525949.2*60*1e3},quarters:{months:3,weeks:13.044375,days:91.310625,hours:2191.455,minutes:131487.3,seconds:525949.2*60/4,milliseconds:7889237999.999999},months:{weeks:4.3481250000000005,days:30.436875,hours:730.485,minutes:43829.1,seconds:2629746,milliseconds:2629746e3},...fn},wn=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],pn=wn.slice(0).reverse();function Mn(t,e,n=!1){const r={values:n?e.values:{...t.values,...e.values||{}},loc:t.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||t.conversionAccuracy,matrix:e.matrix||t.matrix};return new Nn(r)}function kn(t,e){let n=e.milliseconds??0;for(const r of pn.slice(1))e[r]&&(n+=e[r]*t[r].milliseconds);return n}function Sn(t,e){const n=kn(t,e)<0?-1:1;wn.reduceRight(((r,s)=>{if(At(e[s]))return r;if(r){const i=t[s][r],u=Math.floor(e[r]*n/i);e[s]+=u*n,e[r]-=u*i*n}return s}),null),wn.reduce(((n,r)=>{if(At(e[r]))return n;if(n){const s=e[n]%1;e[n]-=s,e[r]+=s*t[n][r]}return r}),null)}function Tn(t){const e={};for(const[n,r]of Object.entries(t))0!==r&&(e[n]=r);return e}class Nn{constructor(t){const e="longterm"===t.conversionAccuracy||!1;let n=e?gn:yn;t.matrix&&(n=t.matrix),this.values=t.values,this.loc=t.loc||nt.create(),this.conversionAccuracy=e?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=n,this.isLuxonDuration=!0}static fromMillis(t,e){return Nn.fromObject({milliseconds:t},e)}static fromObject(t,e={}){if(null==t||"object"!=typeof t)throw new a("Duration.fromObject: argument expected to be an object, got "+(null===t?"null":typeof t));return new Nn({values:ue(t,Nn.normalizeUnit),loc:nt.fromObject(e),conversionAccuracy:e.conversionAccuracy,matrix:e.matrix})}static fromDurationLike(t){if(Ct(t))return Nn.fromMillis(t);if(Nn.isDuration(t))return t;if("object"==typeof t)return Nn.fromObject(t);throw new a(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,e){const[n]=function(t){return De(t,[Re,Ue])}(t);return n?Nn.fromObject(n,e):Nn.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,e){const[n]=function(t){return De(t,[ze,cn])}(t);return n?Nn.fromObject(n,e):Nn.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,e=null){if(!t)throw new a("need to specify a reason the Duration is invalid");const n=t instanceof St?t:new St(t,e);if(kt.throwOnInvalid)throw new i(n);return new Nn({invalid:n})}static normalizeUnit(t){const e={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[t?t.toLowerCase():t];if(!e)throw new o(t);return e}static isDuration(t){return t&&t.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(t,e={}){const n={...e,floor:!1!==e.round&&!1!==e.floor};return this.isValid?be.create(this.loc,n).formatDurationFromString(this,t):mn}toHuman(t={}){if(!this.isValid)return mn;const e=!1!==t.showZeros,n=wn.map((n=>{const r=this.values[n];return At(r)||0===r&&!e?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:n.slice(0,-1)}).format(r)})).filter((t=>t));return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(n)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let t="P";return 0!==this.years&&(t+=this.years+"Y"),0===this.months&&0===this.quarters||(t+=this.months+3*this.quarters+"M"),0!==this.weeks&&(t+=this.weeks+"W"),0!==this.days&&(t+=this.days+"D"),0===this.hours&&0===this.minutes&&0===this.seconds&&0===this.milliseconds||(t+="T"),0!==this.hours&&(t+=this.hours+"H"),0!==this.minutes&&(t+=this.minutes+"M"),0===this.seconds&&0===this.milliseconds||(t+=Vt(this.seconds+this.milliseconds/1e3,3)+"S"),"P"===t&&(t+="T0S"),t}toISOTime(t={}){if(!this.isValid)return null;const e=this.toMillis();return e<0||e>=864e5?null:(t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t,includeOffset:!1},yr.fromMillis(e,{zone:"UTC"}).toISOTime(t))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?kn(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;const e=Nn.fromDurationLike(t),n={};for(const t of wn)(zt(e.values,t)||zt(this.values,t))&&(n[t]=e.get(t)+this.get(t));return Mn(this,{values:n},!0)}minus(t){if(!this.isValid)return this;const e=Nn.fromDurationLike(t);return this.plus(e.negate())}mapUnits(t){if(!this.isValid)return this;const e={};for(const n of Object.keys(this.values))e[n]=ie(t(this.values[n],n));return Mn(this,{values:e},!0)}get(t){return this[Nn.normalizeUnit(t)]}set(t){return this.isValid?Mn(this,{values:{...this.values,...ue(t,Nn.normalizeUnit)}}):this}reconfigure({locale:t,numberingSystem:e,conversionAccuracy:n,matrix:r}={}){return Mn(this,{loc:this.loc.clone({locale:t,numberingSystem:e}),matrix:r,conversionAccuracy:n})}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;const t=this.toObject();return Sn(this.matrix,t),Mn(this,{values:t},!0)}rescale(){return this.isValid?Mn(this,{values:Tn(this.normalize().shiftToAll().toObject())},!0):this}shiftTo(...t){if(!this.isValid)return this;if(0===t.length)return this;t=t.map((t=>Nn.normalizeUnit(t)));const e={},n={},r=this.toObject();let s;for(const i of wn)if(t.indexOf(i)>=0){s=i;let t=0;for(const e in n)t+=this.matrix[e][i]*n[e],n[e]=0;Ct(r[i])&&(t+=r[i]);const u=Math.trunc(t);e[i]=u,n[i]=(1e3*t-1e3*u)/1e3}else Ct(r[i])&&(n[i]=r[i]);for(const t in n)0!==n[t]&&(e[s]+=t===s?n[t]:n[t]/this.matrix[s][t]);return Sn(this.matrix,e),Mn(this,{values:e},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const t={};for(const e of Object.keys(this.values))t[e]=0===this.values[e]?0:-this.values[e];return Mn(this,{values:t},!0)}removeZeros(){return this.isValid?Mn(this,{values:Tn(this.values)},!0):this}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(t){if(!this.isValid||!t.isValid)return!1;if(!this.loc.equals(t.loc))return!1;for(const r of wn)if(n=t.values[r],!(void 0===(e=this.values[r])||0===e?void 0===n||0===n:e===n))return!1;var e,n;return!0}}const bn="Invalid Interval";class vn{constructor(t){this.s=t.start,this.e=t.end,this.invalid=t.invalid||null,this.isLuxonInterval=!0}static invalid(t,e=null){if(!t)throw new a("need to specify a reason the Interval is invalid");const n=t instanceof St?t:new St(t,e);if(kt.throwOnInvalid)throw new s(n);return new vn({invalid:n})}static fromDateTimes(t,e){const n=gr(t),r=gr(e),s=function(t,e){return t&&t.isValid?e&&e.isValid?e<t?vn.invalid("end before start",`The end of an interval must be after its start, but you had start=${t.toISO()} and end=${e.toISO()}`):null:vn.invalid("missing or invalid end"):vn.invalid("missing or invalid start")}(n,r);return null==s?new vn({start:n,end:r}):s}static after(t,e){const n=Nn.fromDurationLike(e),r=gr(t);return vn.fromDateTimes(r,r.plus(n))}static before(t,e){const n=Nn.fromDurationLike(e),r=gr(t);return vn.fromDateTimes(r.minus(n),r)}static fromISO(t,e){const[n,r]=(t||"").split("/",2);if(n&&r){let t,s,i,u;try{t=yr.fromISO(n,e),s=t.isValid}catch(r){s=!1}try{i=yr.fromISO(r,e),u=i.isValid}catch(r){u=!1}if(s&&u)return vn.fromDateTimes(t,i);if(s){const n=Nn.fromISO(r,e);if(n.isValid)return vn.after(t,n)}else if(u){const t=Nn.fromISO(n,e);if(t.isValid)return vn.before(i,t)}}return vn.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static isInterval(t){return t&&t.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):null}get isValid(){return null===this.invalidReason}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(t="milliseconds"){return this.isValid?this.toDuration(t).get(t):NaN}count(t="milliseconds",e){if(!this.isValid)return NaN;const n=this.start.startOf(t,e);let r;return r=e?.useLocaleWeeks?this.end.reconfigure({locale:n.locale}):this.end,r=r.startOf(t,e),Math.floor(r.diff(n,t).get(t))+(r.valueOf()!==this.end.valueOf())}hasSame(t){return!!this.isValid&&(this.isEmpty()||this.e.minus(1).hasSame(this.s,t))}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(t){return!!this.isValid&&this.s>t}isBefore(t){return!!this.isValid&&this.e<=t}contains(t){return!!this.isValid&&this.s<=t&&this.e>t}set({start:t,end:e}={}){return this.isValid?vn.fromDateTimes(t||this.s,e||this.e):this}splitAt(...t){if(!this.isValid)return[];const e=t.map(gr).filter((t=>this.contains(t))).sort(((t,e)=>t.toMillis()-e.toMillis())),n=[];let{s:r}=this,s=0;for(;r<this.e;){const t=e[s]||this.e,i=+t>+this.e?this.e:t;n.push(vn.fromDateTimes(r,i)),r=i,s+=1}return n}splitBy(t){const e=Nn.fromDurationLike(t);if(!this.isValid||!e.isValid||0===e.as("milliseconds"))return[];let n,{s:r}=this,s=1;const i=[];for(;r<this.e;){const t=this.start.plus(e.mapUnits((t=>t*s)));n=+t>+this.e?this.e:t,i.push(vn.fromDateTimes(r,n)),r=n,s+=1}return i}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s<t.e}abutsStart(t){return!!this.isValid&&+this.e==+t.s}abutsEnd(t){return!!this.isValid&&+t.e==+this.s}engulfs(t){return!!this.isValid&&this.s<=t.s&&this.e>=t.e}equals(t){return!(!this.isValid||!t.isValid)&&this.s.equals(t.s)&&this.e.equals(t.e)}intersection(t){if(!this.isValid)return this;const e=this.s>t.s?this.s:t.s,n=this.e<t.e?this.e:t.e;return e>=n?null:vn.fromDateTimes(e,n)}union(t){return this.isValid?vn.fromDateTimes(this.s<t.s?this.s:t.s,this.e>t.e?this.e:t.e):this}static merge(t){const[e,n]=t.sort(((t,e)=>t.s-e.s)).reduce((([t,e],n)=>e?e.overlaps(n)||e.abutsStart(n)?[t,e.union(n)]:[t.concat([e]),n]:[t,n]),[[],null]);return n&&e.push(n),e}static xor(t){let e=null,n=0;const r=[],s=t.map((t=>[{time:t.s,type:"s"},{time:t.e,type:"e"}])),i=Array.prototype.concat(...s).sort(((t,e)=>t.time-e.time));for(const t of i)n+="s"===t.type?1:-1,1===n?e=t.time:(e&&+e!=+t.time&&r.push(vn.fromDateTimes(e,t.time)),e=null);return vn.merge(r)}difference(...t){return vn.xor([this].concat(t)).map((t=>this.intersection(t))).filter((t=>t&&!t.isEmpty()))}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:bn}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(t=m,e={}){return this.isValid?be.create(this.s.loc.clone(e),t).formatInterval(this):bn}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:bn}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:bn}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:bn}toFormat(t,{separator:e=" – "}={}){return this.isValid?`${this.s.toFormat(t)}${e}${this.e.toFormat(t)}`:bn}toDuration(t,e){return this.isValid?this.e.diff(this.s,t,e):Nn.invalid(this.invalidReason)}mapEndpoints(t){return vn.fromDateTimes(t(this.s),t(this.e))}}class En{static hasDST(t=kt.defaultZone){const e=yr.now().setZone(t).set({month:12});return!t.isUniversal&&e.offset!==e.set({month:6}).offset}static isValidIANAZone(t){return H.isValidZone(t)}static normalizeZone(t){return ut(t,kt.defaultZone)}static getStartOfWeek({locale:t=null,locObj:e=null}={}){return(e||nt.create(t)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:t=null,locObj:e=null}={}){return(e||nt.create(t)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:t=null,locObj:e=null}={}){return(e||nt.create(t)).getWeekendDays().slice()}static months(t="long",{locale:e=null,numberingSystem:n=null,locObj:r=null,outputCalendar:s="gregory"}={}){return(r||nt.create(e,n,s)).months(t)}static monthsFormat(t="long",{locale:e=null,numberingSystem:n=null,locObj:r=null,outputCalendar:s="gregory"}={}){return(r||nt.create(e,n,s)).months(t,!0)}static weekdays(t="long",{locale:e=null,numberingSystem:n=null,locObj:r=null}={}){return(r||nt.create(e,n,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:e=null,numberingSystem:n=null,locObj:r=null}={}){return(r||nt.create(e,n,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return nt.create(t).meridiems()}static eras(t="short",{locale:e=null}={}){return nt.create(e,null,"gregory").eras(t)}static features(){return{relative:jt(),localeWeek:qt()}}}function On(t,e){const n=t=>t.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=n(e)-n(t);return Math.floor(Nn.fromMillis(r).as("days"))}function Dn(t,e=t=>t){return{regex:t,deser:([t])=>e(function(t){let e=parseInt(t,10);if(isNaN(e)){e="";for(let n=0;n<t.length;n++){const r=t.charCodeAt(n);if(-1!==t[n].search(ot.hanidec))e+=ct.indexOf(t[n]);else for(const t in at){const[n,s]=at[t];r>=n&&r<=s&&(e+=r-n)}}return parseInt(e,10)}return e}(t))}}const $n=`[ ${String.fromCharCode(160)}]`,In=new RegExp($n,"g");function xn(t){return t.replace(/\./g,"\\.?").replace(In,$n)}function Fn(t){return t.replace(/\./g,"").replace(In," ").toLowerCase()}function Zn(t,e){return null===t?null:{regex:RegExp(t.map(xn).join("|")),deser:([n])=>t.findIndex((t=>Fn(n)===Fn(t)))+e}}function Ln(t,e){return{regex:t,deser:([,t,e])=>se(t,e),groups:e}}function Wn(t){return{regex:t,deser:([t])=>t}}const An={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};let Cn=null;function _n(t,e){return Array.prototype.concat(...t.map((t=>function(t,e){if(t.literal)return t;const n=Hn(be.macroTokenToFormatOpts(t.val),e);return null==n||n.includes(void 0)?t:n}(t,e))))}class jn{constructor(t,e){if(this.locale=t,this.format=e,this.tokens=_n(be.parseFormat(e),t),this.units=this.tokens.map((e=>function(t,e){const n=lt(e),r=lt(e,"{2}"),s=lt(e,"{3}"),i=lt(e,"{4}"),u=lt(e,"{6}"),o=lt(e,"{1,2}"),a=lt(e,"{1,3}"),c=lt(e,"{1,6}"),h=lt(e,"{1,9}"),l=lt(e,"{2,4}"),d=lt(e,"{4,6}"),m=t=>{return{regex:RegExp((e=t.val,e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"))),deser:([t])=>t,literal:!0};var e},f=(f=>{if(t.literal)return m(f);switch(f.val){case"G":return Zn(e.eras("short"),0);case"GG":return Zn(e.eras("long"),0);case"y":return Dn(c);case"yy":case"kk":return Dn(l,ne);case"yyyy":case"kkkk":return Dn(i);case"yyyyy":return Dn(d);case"yyyyyy":return Dn(u);case"M":case"L":case"d":case"H":case"h":case"m":case"q":case"s":case"W":return Dn(o);case"MM":case"LL":case"dd":case"HH":case"hh":case"mm":case"qq":case"ss":case"WW":return Dn(r);case"MMM":return Zn(e.months("short",!0),1);case"MMMM":return Zn(e.months("long",!0),1);case"LLL":return Zn(e.months("short",!1),1);case"LLLL":return Zn(e.months("long",!1),1);case"o":case"S":return Dn(a);case"ooo":case"SSS":return Dn(s);case"u":return Wn(h);case"uu":return Wn(o);case"uuu":case"E":case"c":return Dn(n);case"a":return Zn(e.meridiems(),0);case"EEE":return Zn(e.weekdays("short",!1),1);case"EEEE":return Zn(e.weekdays("long",!1),1);case"ccc":return Zn(e.weekdays("short",!0),1);case"cccc":return Zn(e.weekdays("long",!0),1);case"Z":case"ZZ":return Ln(new RegExp(`([+-]${o.source})(?::(${r.source}))?`),2);case"ZZZ":return Ln(new RegExp(`([+-]${o.source})(${r.source})?`),2);case"z":return Wn(/[a-z_+-/]{1,256}?/i);case" ":return Wn(/[^\S\n\r]/);default:return m(f)}})(t)||{invalidReason:"missing Intl.DateTimeFormat.formatToParts support"};return f.token=t,f}(e,t))),this.disqualifyingUnit=this.units.find((t=>t.invalidReason)),!this.disqualifyingUnit){const[t,e]=[`^${(n=this.units).map((t=>t.regex)).reduce(((t,e)=>`${t}(${e.source})`),"")}$`,n];this.regex=RegExp(t,"i"),this.handlers=e}var n}explainFromTokens(t){if(this.isValid){const[e,n]=function(t,e,n){const r=t.match(e);if(r){const t={};let e=1;for(const s in n)if(zt(n,s)){const i=n[s],u=i.groups?i.groups+1:1;!i.literal&&i.token&&(t[i.token.val[0]]=i.deser(r.slice(e,e+u))),e+=u}return[r,t]}return[r,{}]}(t,this.regex,this.handlers),[r,s,i]=n?function(t){let e,n=null;return At(t.z)||(n=H.create(t.z)),At(t.Z)||(n||(n=new st(t.Z)),e=t.Z),At(t.q)||(t.M=3*(t.q-1)+1),At(t.h)||(t.h<12&&1===t.a?t.h+=12:12===t.h&&0===t.a&&(t.h=0)),0===t.G&&t.y&&(t.y=-t.y),At(t.u)||(t.S=Yt(t.u)),[Object.keys(t).reduce(((e,n)=>{const r=(t=>{switch(t){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}})(n);return r&&(e[r]=t[n]),e}),{}),n,e]}(n):[null,null,void 0];if(zt(n,"a")&&zt(n,"H"))throw new u("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:this.tokens,regex:this.regex,rawMatches:e,matches:n,result:r,zone:s,specificOffset:i}}return{input:t,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function qn(t,e,n){return new jn(t,n).explainFromTokens(e)}function Hn(t,e){if(!t)return null;const n=be.create(e,t).dtFormatter((Cn||(Cn=yr.fromMillis(1555555555555)),Cn)),r=n.formatToParts(),s=n.resolvedOptions();return r.map((e=>function(t,e,n){const{type:r,value:s}=t;if("literal"===r){const t=/^\s+$/.test(s);return{literal:!t,val:t?" ":s}}let i=r;"hour"===r&&(i=null!=e.hour12?e.hour12?"hour12":"hour24":null!=e.hourCycle?"h11"===e.hourCycle||"h12"===e.hourCycle?"hour12":"hour24":n.hour12?"hour12":"hour24");let u=An[i];if("object"==typeof u&&(u=u[e[r]]),u)return{literal:!1,val:u}}(e,t,s)))}const zn="Invalid DateTime",Rn=864e13;function Un(t){return new St("unsupported zone",`the zone "${t.name}" is not supported`)}function Jn(t){return null===t.weekData&&(t.weekData=$t(t.c)),t.weekData}function Gn(t){return null===t.localWeekData&&(t.localWeekData=$t(t.c,t.loc.getMinDaysInFirstWeek(),t.loc.getStartOfWeek())),t.localWeekData}function Pn(t,e){const n={ts:t.ts,zone:t.zone,c:t.c,o:t.o,loc:t.loc,invalid:t.invalid};return new yr({...n,...e,old:n})}function Yn(t,e,n){let r=t-60*e*1e3;const s=n.offset(r);if(e===s)return[r,e];r-=60*(s-e)*1e3;const i=n.offset(r);return s===i?[r,s]:[t-60*Math.min(s,i)*1e3,Math.max(s,i)]}function Vn(t,e){const n=new Date(t+=60*e*1e3);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function Bn(t,e,n){return Yn(Xt(t),e,n)}function Qn(t,e){const n=t.o,r=t.c.year+Math.trunc(e.years),s=t.c.month+Math.trunc(e.months)+3*Math.trunc(e.quarters),i={...t.c,year:r,month:s,day:Math.min(t.c.day,Kt(r,s))+Math.trunc(e.days)+7*Math.trunc(e.weeks)},u=Nn.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),o=Xt(i);let[a,c]=Yn(o,n,t.zone);return 0!==u&&(a+=u,c=t.zone.offset(a)),{ts:a,o:c}}function Kn(t,e,n,r,s,i){const{setZone:u,zone:o}=n;if(t&&0!==Object.keys(t).length||e){const r=e||o,s=yr.fromObject(t,{...n,zone:r,specificOffset:i});return u?s:s.setZone(o)}return yr.invalid(new St("unparsable",`the input "${s}" can't be parsed as ${r}`))}function Xn(t,e,n=!0){return t.isValid?be.create(nt.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(t,e):null}function tr(t,e,n){const r=t.c.year>9999||t.c.year<0;let s="";if(r&&t.c.year>=0&&(s+="+"),s+=Jt(t.c.year,r?6:4),"year"===n)return s;if(e){if(s+="-",s+=Jt(t.c.month),"month"===n)return s;s+="-"}else if(s+=Jt(t.c.month),"month"===n)return s;return s+=Jt(t.c.day),s}function er(t,e,n,r,s,i,u){let o=!n||0!==t.c.millisecond||0!==t.c.second,a="";switch(u){case"day":case"month":case"year":break;default:if(a+=Jt(t.c.hour),"hour"===u)break;if(e){if(a+=":",a+=Jt(t.c.minute),"minute"===u)break;o&&(a+=":",a+=Jt(t.c.second))}else{if(a+=Jt(t.c.minute),"minute"===u)break;o&&(a+=Jt(t.c.second))}if("second"===u)break;!o||r&&0===t.c.millisecond||(a+=".",a+=Jt(t.c.millisecond,3))}return s&&(t.isOffsetFixed&&0===t.offset&&!i?a+="Z":t.o<0?(a+="-",a+=Jt(Math.trunc(-t.o/60)),a+=":",a+=Jt(Math.trunc(-t.o%60))):(a+="+",a+=Jt(Math.trunc(t.o/60)),a+=":",a+=Jt(Math.trunc(t.o%60)))),i&&(a+="["+t.zone.ianaName+"]"),a}const nr={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},rr={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},sr={ordinal:1,hour:0,minute:0,second:0,millisecond:0},ir=["year","month","day","hour","minute","second","millisecond"],ur=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],or=["year","ordinal","hour","minute","second","millisecond"];function ar(t){const e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[t.toLowerCase()];if(!e)throw new o(t);return e}function cr(t){switch(t.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return ar(t)}}function hr(t,e){const n=ut(e.zone,kt.defaultZone);if(!n.isValid)return yr.invalid(Un(n));const r=nt.fromObject(e);let s,i;if(At(t.year))s=kt.now();else{for(const e of ir)At(t[e])&&(t[e]=nr[e]);const e=Lt(t)||Wt(t);if(e)return yr.invalid(e);const r=function(t){if(void 0===mr&&(mr=kt.now()),"iana"!==t.type)return t.offset(mr);const e=t.name;let n=fr.get(e);return void 0===n&&(n=t.offset(mr),fr.set(e,n)),n}(n);[s,i]=Bn(t,r,n)}return new yr({ts:s,zone:n,loc:r,o:i})}function lr(t,e,n){const r=!!At(n.round)||n.round,s=At(n.rounding)?"trunc":n.rounding,i=(t,i)=>(t=Vt(t,r||n.calendary?0:2,n.calendary?"round":s),e.loc.clone(n).relFormatter(n).format(t,i)),u=r=>n.calendary?e.hasSame(t,r)?0:e.startOf(r).diff(t.startOf(r),r).get(r):e.diff(t,r).get(r);if(n.unit)return i(u(n.unit),n.unit);for(const t of n.units){const e=u(t);if(Math.abs(e)>=1)return i(e,t)}return i(t>e?-0:0,n.units[n.units.length-1])}function dr(t){let e,n={};return t.length>0&&"object"==typeof t[t.length-1]?(n=t[t.length-1],e=Array.from(t).slice(0,t.length-1)):e=Array.from(t),[n,e]}let mr;const fr=new Map;class yr{constructor(t){const e=t.zone||kt.defaultZone;let n=t.invalid||(Number.isNaN(t.ts)?new St("invalid input"):null)||(e.isValid?null:Un(e));this.ts=At(t.ts)?kt.now():t.ts;let r=null,s=null;if(!n)if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(e))[r,s]=[t.old.c,t.old.o];else{const i=Ct(t.o)&&!t.old?t.o:e.offset(this.ts);r=Vn(this.ts,i),n=Number.isNaN(r.year)?new St("invalid input"):null,r=n?null:r,s=n?null:i}this._zone=e,this.loc=t.loc||nt.create(),this.invalid=n,this.weekData=null,this.localWeekData=null,this.c=r,this.o=s,this.isLuxonDateTime=!0}static now(){return new yr({})}static local(){const[t,e]=dr(arguments),[n,r,s,i,u,o,a]=e;return hr({year:n,month:r,day:s,hour:i,minute:u,second:o,millisecond:a},t)}static utc(){const[t,e]=dr(arguments),[n,r,s,i,u,o,a]=e;return t.zone=st.utcInstance,hr({year:n,month:r,day:s,hour:i,minute:u,second:o,millisecond:a},t)}static fromJSDate(t,e={}){const n="[object Date]"===Object.prototype.toString.call(t)?t.valueOf():NaN;if(Number.isNaN(n))return yr.invalid("invalid input");const r=ut(e.zone,kt.defaultZone);return r.isValid?new yr({ts:n,zone:r,loc:nt.fromObject(e)}):yr.invalid(Un(r))}static fromMillis(t,e={}){if(Ct(t))return t<-Rn||t>Rn?yr.invalid("Timestamp out of range"):new yr({ts:t,zone:ut(e.zone,kt.defaultZone),loc:nt.fromObject(e)});throw new a(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,e={}){if(Ct(t))return new yr({ts:1e3*t,zone:ut(e.zone,kt.defaultZone),loc:nt.fromObject(e)});throw new a("fromSeconds requires a numerical input")}static fromObject(t,e={}){t=t||{};const n=ut(e.zone,kt.defaultZone);if(!n.isValid)return yr.invalid(Un(n));const r=nt.fromObject(e),s=ue(t,cr),{minDaysInFirstWeek:i,startOfWeek:o}=Zt(s,r),a=kt.now(),c=At(e.specificOffset)?n.offset(a):e.specificOffset,h=!At(s.ordinal),l=!At(s.year),d=!At(s.month)||!At(s.day),m=l||d,f=s.weekYear||s.weekNumber;if((m||h)&&f)throw new u("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(d&&h)throw new u("Can't mix ordinal dates with month/day");const y=f||s.weekday&&!m;let g,w,p=Vn(a,c);y?(g=ur,w=rr,p=$t(p,i,o)):h?(g=or,w=sr,p=xt(p)):(g=ir,w=nr);let M=!1;for(const t of g)At(s[t])?s[t]=M?w[t]:p[t]:M=!0;const k=y?function(t,e=4,n=1){const r=_t(t.weekYear),s=Ut(t.weekNumber,1,ee(t.weekYear,e,n)),i=Ut(t.weekday,1,7);return r?s?!i&&bt("weekday",t.weekday):bt("week",t.weekNumber):bt("weekYear",t.weekYear)}(s,i,o):h?function(t){const e=_t(t.year),n=Ut(t.ordinal,1,Qt(t.year));return e?!n&&bt("ordinal",t.ordinal):bt("year",t.year)}(s):Lt(s),S=k||Wt(s);if(S)return yr.invalid(S);const T=y?It(s,i,o):h?Ft(s):s,[N,b]=Bn(T,c,n),v=new yr({ts:N,zone:n,o:b,loc:r});return s.weekday&&m&&t.weekday!==v.weekday?yr.invalid("mismatched weekday",`you can't specify both a weekday of ${s.weekday} and a date of ${v.toISO()}`):v.isValid?v:yr.invalid(v.invalid)}static fromISO(t,e={}){const[n,r]=function(t){return De(t,[tn,sn],[en,un],[nn,on],[rn,an])}(t);return Kn(n,r,e,"ISO 8601",t)}static fromRFC2822(t,e={}){const[n,r]=function(t){return De(function(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}(t),[Pe,Ye])}(t);return Kn(n,r,e,"RFC 2822",t)}static fromHTTP(t,e={}){const[n,r]=function(t){return De(t,[Ve,Ke],[Be,Ke],[Qe,Xe])}(t);return Kn(n,r,e,"HTTP",e)}static fromFormat(t,e,n={}){if(At(t)||At(e))throw new a("fromFormat requires an input string and a format");const{locale:r=null,numberingSystem:s=null}=n,i=nt.fromOpts({locale:r,numberingSystem:s,defaultToEN:!0}),[u,o,c,h]=function(t,e,n){const{result:r,zone:s,specificOffset:i,invalidReason:u}=qn(t,e,n);return[r,s,i,u]}(i,t,e);return h?yr.invalid(h):Kn(u,o,n,`format ${e}`,t,c)}static fromString(t,e,n={}){return yr.fromFormat(t,e,n)}static fromSQL(t,e={}){const[n,r]=function(t){return De(t,[hn,sn],[ln,dn])}(t);return Kn(n,r,e,"SQL",t)}static invalid(t,e=null){if(!t)throw new a("need to specify a reason the DateTime is invalid");const n=t instanceof St?t:new St(t,e);if(kt.throwOnInvalid)throw new r(n);return new yr({invalid:n})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t,e={}){const n=Hn(t,nt.fromObject(e));return n?n.map((t=>t?t.val:null)).join(""):null}static expandFormat(t,e={}){return _n(be.parseFormat(t),nt.fromObject(e)).map((t=>t.val)).join("")}static resetCache(){mr=void 0,fr.clear()}get(t){return this[t]}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?Jn(this).weekYear:NaN}get weekNumber(){return this.isValid?Jn(this).weekNumber:NaN}get weekday(){return this.isValid?Jn(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?Gn(this).weekday:NaN}get localWeekNumber(){return this.isValid?Gn(this).weekNumber:NaN}get localWeekYear(){return this.isValid?Gn(this).weekYear:NaN}get ordinal(){return this.isValid?xt(this.c).ordinal:NaN}get monthShort(){return this.isValid?En.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?En.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?En.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?En.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return!this.isOffsetFixed&&(this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset)}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const t=864e5,e=6e4,n=Xt(this.c),r=this.zone.offset(n-t),s=this.zone.offset(n+t),i=this.zone.offset(n-r*e),u=this.zone.offset(n-s*e);if(i===u)return[this];const o=n-i*e,a=n-u*e,c=Vn(o,i),h=Vn(a,u);return c.hour===h.hour&&c.minute===h.minute&&c.second===h.second&&c.millisecond===h.millisecond?[Pn(this,{ts:o}),Pn(this,{ts:a})]:[this]}get isInLeapYear(){return Bt(this.year)}get daysInMonth(){return Kt(this.year,this.month)}get daysInYear(){return this.isValid?Qt(this.year):NaN}get weeksInWeekYear(){return this.isValid?ee(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?ee(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(t={}){const{locale:e,numberingSystem:n,calendar:r}=be.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:e,numberingSystem:n,outputCalendar:r}}toUTC(t=0,e={}){return this.setZone(st.instance(t),e)}toLocal(){return this.setZone(kt.defaultZone)}setZone(t,{keepLocalTime:e=!1,keepCalendarTime:n=!1}={}){if((t=ut(t,kt.defaultZone)).equals(this.zone))return this;if(t.isValid){let r=this.ts;if(e||n){const e=t.offset(this.ts),n=this.toObject();[r]=Bn(n,e,t)}return Pn(this,{ts:r,zone:t})}return yr.invalid(Un(t))}reconfigure({locale:t,numberingSystem:e,outputCalendar:n}={}){return Pn(this,{loc:this.loc.clone({locale:t,numberingSystem:e,outputCalendar:n})})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;const e=ue(t,cr),{minDaysInFirstWeek:n,startOfWeek:r}=Zt(e,this.loc),s=!At(e.weekYear)||!At(e.weekNumber)||!At(e.weekday),i=!At(e.ordinal),o=!At(e.year),a=!At(e.month)||!At(e.day);if((o||a||i)&&(e.weekYear||e.weekNumber))throw new u("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(a&&i)throw new u("Can't mix ordinal dates with month/day");let c;s?c=It({...$t(this.c,n,r),...e},n,r):At(e.ordinal)?(c={...this.toObject(),...e},At(e.day)&&(c.day=Math.min(Kt(c.year,c.month),c.day))):c=Ft({...xt(this.c),...e});const[h,l]=Bn(c,this.o,this.zone);return Pn(this,{ts:h,o:l})}plus(t){return this.isValid?Pn(this,Qn(this,Nn.fromDurationLike(t))):this}minus(t){return this.isValid?Pn(this,Qn(this,Nn.fromDurationLike(t).negate())):this}startOf(t,{useLocaleWeeks:e=!1}={}){if(!this.isValid)return this;const n={},r=Nn.normalizeUnit(t);switch(r){case"years":n.month=1;case"quarters":case"months":n.day=1;case"weeks":case"days":n.hour=0;case"hours":n.minute=0;case"minutes":n.second=0;case"seconds":n.millisecond=0}if("weeks"===r)if(e){const t=this.loc.getStartOfWeek(),{weekday:e}=this;e<t&&(n.weekNumber=this.weekNumber-1),n.weekday=t}else n.weekday=1;if("quarters"===r){const t=Math.ceil(this.month/3);n.month=3*(t-1)+1}return this.set(n)}endOf(t,e){return this.isValid?this.plus({[t]:1}).startOf(t,e).minus(1):this}toFormat(t,e={}){return this.isValid?be.create(this.loc.redefaultToEN(e)).formatDateTimeFromString(this,t):zn}toLocaleString(t=m,e={}){return this.isValid?be.create(this.loc.clone(e),t).formatDateTime(this):zn}toLocaleParts(t={}){return this.isValid?be.create(this.loc.clone(t),t).formatDateTimeParts(this):[]}toISO({format:t="extended",suppressSeconds:e=!1,suppressMilliseconds:n=!1,includeOffset:r=!0,extendedZone:s=!1,precision:i="milliseconds"}={}){if(!this.isValid)return null;const u="extended"===t;let o=tr(this,u,i=ar(i));return ir.indexOf(i)>=3&&(o+="T"),o+=er(this,u,e,n,r,s,i),o}toISODate({format:t="extended",precision:e="day"}={}){return this.isValid?tr(this,"extended"===t,ar(e)):null}toISOWeekDate(){return Xn(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:t=!1,suppressSeconds:e=!1,includeOffset:n=!0,includePrefix:r=!1,extendedZone:s=!1,format:i="extended",precision:u="milliseconds"}={}){return this.isValid?(u=ar(u),(r&&ir.indexOf(u)>=3?"T":"")+er(this,"extended"===i,e,t,n,s,u)):null}toRFC2822(){return Xn(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Xn(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?tr(this,!0):null}toSQLTime({includeOffset:t=!0,includeZone:e=!1,includeOffsetSpace:n=!0}={}){let r="HH:mm:ss.SSS";return(e||t)&&(n&&(r+=" "),e?r+="z":t&&(r+="ZZ")),Xn(this,r,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():zn}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(t={}){if(!this.isValid)return{};const e={...this.c};return t.includeConfig&&(e.outputCalendar=this.outputCalendar,e.numberingSystem=this.loc.numberingSystem,e.locale=this.loc.locale),e}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(t,e="milliseconds",n={}){if(!this.isValid||!t.isValid)return Nn.invalid("created by diffing an invalid DateTime");const r={locale:this.locale,numberingSystem:this.numberingSystem,...n},s=(o=e,Array.isArray(o)?o:[o]).map(Nn.normalizeUnit),i=t.valueOf()>this.valueOf(),u=function(t,e,n,r){let[s,i,u,o]=function(t,e,n){const r=[["years",(t,e)=>e.year-t.year],["quarters",(t,e)=>e.quarter-t.quarter+4*(e.year-t.year)],["months",(t,e)=>e.month-t.month+12*(e.year-t.year)],["weeks",(t,e)=>{const n=On(t,e);return(n-n%7)/7}],["days",On]],s={},i=t;let u,o;for(const[a,c]of r)n.indexOf(a)>=0&&(u=a,s[a]=c(t,e),o=i.plus(s),o>e?(s[a]--,(t=i.plus(s))>e&&(o=t,s[a]--,t=i.plus(s))):t=o);return[t,s,o,u]}(t,e,n);const a=e-s,c=n.filter((t=>["hours","minutes","seconds","milliseconds"].indexOf(t)>=0));0===c.length&&(u<e&&(u=s.plus({[o]:1})),u!==s&&(i[o]=(i[o]||0)+a/(u-s)));const h=Nn.fromObject(i,r);return c.length>0?Nn.fromMillis(a,r).shiftTo(...c).plus(h):h}(i?this:t,i?t:this,s,r);var o;return i?u.negate():u}diffNow(t="milliseconds",e={}){return this.diff(yr.now(),t,e)}until(t){return this.isValid?vn.fromDateTimes(this,t):this}hasSame(t,e,n){if(!this.isValid)return!1;const r=t.valueOf(),s=this.setZone(t.zone,{keepLocalTime:!0});return s.startOf(e,n)<=r&&r<=s.endOf(e,n)}equals(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)}toRelative(t={}){if(!this.isValid)return null;const e=t.base||yr.fromObject({},{zone:this.zone}),n=t.padding?this<e?-t.padding:t.padding:0;let r=["years","months","days","hours","minutes","seconds"],s=t.unit;return Array.isArray(t.unit)&&(r=t.unit,s=void 0),lr(e,this.plus(n),{...t,numeric:"always",units:r,unit:s})}toRelativeCalendar(t={}){return this.isValid?lr(t.base||yr.fromObject({},{zone:this.zone}),this,{...t,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...t){if(!t.every(yr.isDateTime))throw new a("min requires all arguments be DateTimes");return Ht(t,(t=>t.valueOf()),Math.min)}static max(...t){if(!t.every(yr.isDateTime))throw new a("max requires all arguments be DateTimes");return Ht(t,(t=>t.valueOf()),Math.max)}static fromFormatExplain(t,e,n={}){const{locale:r=null,numberingSystem:s=null}=n;return qn(nt.fromOpts({locale:r,numberingSystem:s,defaultToEN:!0}),t,e)}static fromStringExplain(t,e,n={}){return yr.fromFormatExplain(t,e,n)}static buildFormatParser(t,e={}){const{locale:n=null,numberingSystem:r=null}=e,s=nt.fromOpts({locale:n,numberingSystem:r,defaultToEN:!0});return new jn(s,t)}static fromFormatParser(t,e,n={}){if(At(t)||At(e))throw new a("fromFormatParser requires an input string and a format parser");const{locale:r=null,numberingSystem:s=null}=n,i=nt.fromOpts({locale:r,numberingSystem:s,defaultToEN:!0});if(!i.equals(e.locale))throw new a(`fromFormatParser called with a locale of ${i}, but the format parser was created for ${e.locale}`);const{result:u,zone:o,specificOffset:c,invalidReason:h}=e.explainFromTokens(t);return h?yr.invalid(h):Kn(u,o,n,`format ${e.format}`,t,c)}static get DATE_SHORT(){return m}static get DATE_MED(){return f}static get DATE_MED_WITH_WEEKDAY(){return y}static get DATE_FULL(){return g}static get DATE_HUGE(){return w}static get TIME_SIMPLE(){return p}static get TIME_WITH_SECONDS(){return M}static get TIME_WITH_SHORT_OFFSET(){return k}static get TIME_WITH_LONG_OFFSET(){return S}static get TIME_24_SIMPLE(){return T}static get TIME_24_WITH_SECONDS(){return N}static get TIME_24_WITH_SHORT_OFFSET(){return b}static get TIME_24_WITH_LONG_OFFSET(){return v}static get DATETIME_SHORT(){return E}static get DATETIME_SHORT_WITH_SECONDS(){return O}static get DATETIME_MED(){return D}static get DATETIME_MED_WITH_SECONDS(){return $}static get DATETIME_MED_WITH_WEEKDAY(){return I}static get DATETIME_FULL(){return x}static get DATETIME_FULL_WITH_SECONDS(){return F}static get DATETIME_HUGE(){return Z}static get DATETIME_HUGE_WITH_SECONDS(){return L}}function gr(t){if(yr.isDateTime(t))return t;if(t&&t.valueOf&&Ct(t.valueOf()))return yr.fromJSDate(t);if(t&&"object"==typeof t)return yr.fromObject(t);throw new a(`Unknown datetime argument: ${t}, of type ${typeof t}`)}export{yr as D,t as c,e as g}
@@ -1 +1 @@
1
- import{g as t,c as e}from"./context-protocol.js";import{r as o}from"./utils.js";import{getElement as n}from"@stencil/core/internal/client";const a=(t,e)=>{const o=[],n=[];for(const a of e)(t(a)?o:n).push(a);return[o,n]},r="WARN_use_dataset",s=(t,e)=>{const o=t.errors;if(o)if(e.length>0){const t=e.map((t=>t.substring(1))).join(", ");o.addOrReplace({id:r,type:"warning",message:`Using datasource(s) "${t}" directly. Prefer using a dataset (bn-dataset) for query support and metadata.`})}else o.remove(r)},i=(r,i,c)=>{let l,u,d,f,p=[],h=[];const m=t=>{if(c){const e=f.datasetsMeta.get(t);e&&c(t,e)}},$=new MutationObserver((t=>{t.forEach((t=>{"datasets"===t.attributeName&&([h,p]=a((t=>t.startsWith("$")),n(r).getAttribute("datasets").split(",")),s(r,h),p.forEach((t=>{i(t,f.datasets.get(t)),m(t)})),h.forEach((t=>{i(t,f.datasources.get(t.substring(1)))})))}))})),g=r.connectedCallback;r.connectedCallback=()=>{const e=n(r);f=t(e),[h,p]=a((t=>t.startsWith("$")),(e.getAttribute("datasets")||"").split(",")),s(r,h),p.forEach((t=>{i(t,f.datasets.get(t)),m(t)})),h.forEach((t=>{i(t,f.datasources.get(t.substring(1)))})),$.observe(e,{attributes:!0,attributeFilter:["datasets"]}),l=f.datasets.on("set",((t,e)=>{p.includes(t)&&i(t,e)})),u=f.datasources.on("set",((t,e)=>{h.includes("$"+t)&&i("$"+t,e)})),c&&(d=f.datasetsMeta.on("set",((t,e)=>{p.includes(t)&&c(t,e)}))),o(g,r)};const w=r.disconnectedCallback;return r.disconnectedCallback=()=>{$.disconnect(),o(l),o(u),o(d),e(n(r)),o(w,r)},t=>{p=t,t.forEach((t=>{i(t,f.datasets.get(t)),m(t)}))}};function c(t,e=!1){const o=l(t);if(!o)return e&&console.log("[parentDims] no layout parent found for",t.tagName),{width:0,height:0};const n=getComputedStyle(o),a=o.clientWidth-parseFloat(n.paddingLeft)-parseFloat(n.paddingRight),r=function(t,e=!1){let o=l(t),n=0;for(;o;){const t=getComputedStyle(o),a=t.overflowY;if(e&&console.log(`[height:${n}]`,o.tagName,o.className||"(no class)",`overflow=${a} clientH=${o.clientHeight} h=${t.height}`),"hidden"===a||"scroll"===a||"auto"===a){const a=o.clientHeight-parseFloat(t.paddingTop)-parseFloat(t.paddingBottom);return e&&console.log(`[height] FOUND constrained at depth ${n}: ${Math.round(a)}px`),a}if("none"!==t.maxHeight){const e=parseFloat(t.maxHeight);if(!isNaN(e)&&e>0)return Math.min(e,o.clientHeight-parseFloat(t.paddingTop)-parseFloat(t.paddingBottom))}o=u(o),n++}return e&&console.log("[height] NO constrained ancestor → viewport fallback"),"undefined"!=typeof window?window.innerHeight:0}(t,e);return e&&console.log("[parentDims]",t.tagName,"→ layoutParent:",o.tagName,o.className||"(no class)",`clientW=${o.clientWidth} → w=${Math.round(a)}, h=${Math.round(r)}`,"overflow:",n.overflow),{width:Math.max(0,a),height:Math.max(0,r)}}function l(t){var e;const o=t.parentElement;return(null===(e=null==o?void 0:o.assignedSlot)||void 0===e?void 0:e.parentElement)?o.assignedSlot.parentElement:o}function u(t){var e;return(null===(e=t.assignedSlot)||void 0===e?void 0:e.parentElement)?t.assignedSlot.parentElement:t.parentElement}function d(t){if(null==t||""===t)return{mode:"empty"};if("none"===t)return{mode:"none"};if("auto"===t)return{mode:"auto"};const e=Number(t);return!isNaN(e)&&e>0?{mode:"factor",factor:e}:{mode:"empty"}}export{c as g,d as p,i as w}
1
+ import{g as t,c as e}from"./context-protocol.js";import{r as o}from"./utils.js";import{getElement as n}from"@stencil/core/internal/client";const a=(t,e)=>{const o=[],n=[];for(const a of e)(t(a)?o:n).push(a);return[o,n]},r="WARN_use_dataset",s=(t,e)=>{const o=t.errors;if(o)if(e.length>0){const t=e.map((t=>t.substring(1))).join(", ");o.addOrReplace({id:r,type:"warning",message:`Using datasource(s) "${t}" directly. Prefer using a dataset (bn-dataset) for query support and metadata.`})}else o.remove(r)},i=(r,i,c)=>{let l,u,d=[],f=[],p=[];const h=(t,e)=>{const o=e?t.substring(1):t;let n;try{n=u.db.db.exec(`SELECT * FROM \`${o}\``)}catch(t){n=[]}i(t,n)},m=()=>{d.forEach((t=>t())),d=[],f.forEach((t=>{t&&(d.push(u.db.subscribe(t,(()=>h(t,!1)))),h(t,!1),(t=>{if(c){const e=u.datasetsMeta.get(t);e&&c(t,e)}})(t))})),p.forEach((t=>{t&&(d.push(u.db.subscribe(t.substring(1),(()=>h(t,!0)))),h(t,!0))}))},g=new MutationObserver((t=>{t.forEach((t=>{"datasets"===t.attributeName&&([p,f]=a((t=>t.startsWith("$")),n(r).getAttribute("datasets").split(",")),s(r,p),m())}))})),w=r.connectedCallback;r.connectedCallback=()=>{const e=n(r);u=t(e),[p,f]=a((t=>t.startsWith("$")),(e.getAttribute("datasets")||"").split(",")),s(r,p),m(),g.observe(e,{attributes:!0,attributeFilter:["datasets"]}),c&&(l=u.datasetsMeta.on("set",((t,e)=>{f.includes(t)&&c(t,e)}))),o(w,r)};const $=r.disconnectedCallback;return r.disconnectedCallback=()=>{g.disconnect(),d.forEach((t=>t())),d=[],o(l),e(n(r)),o($,r)},t=>{f=t,m()}};function c(t,e=!1){const o=l(t);if(!o)return e&&console.log("[parentDims] no layout parent found for",t.tagName),{width:0,height:0};const n=getComputedStyle(o),a=o.clientWidth-parseFloat(n.paddingLeft)-parseFloat(n.paddingRight),r=function(t,e=!1){let o=l(t),n=0;for(;o;){const t=getComputedStyle(o),a=t.overflowY;if(e&&console.log(`[height:${n}]`,o.tagName,o.className||"(no class)",`overflow=${a} clientH=${o.clientHeight} h=${t.height}`),"hidden"===a||"scroll"===a||"auto"===a){const a=o.clientHeight-parseFloat(t.paddingTop)-parseFloat(t.paddingBottom);return e&&console.log(`[height] FOUND constrained at depth ${n}: ${Math.round(a)}px`),a}if("none"!==t.maxHeight){const e=parseFloat(t.maxHeight);if(!isNaN(e)&&e>0)return Math.min(e,o.clientHeight-parseFloat(t.paddingTop)-parseFloat(t.paddingBottom))}o=u(o),n++}return e&&console.log("[height] NO constrained ancestor → viewport fallback"),"undefined"!=typeof window?window.innerHeight:0}(t,e);return e&&console.log("[parentDims]",t.tagName,"→ layoutParent:",o.tagName,o.className||"(no class)",`clientW=${o.clientWidth} → w=${Math.round(a)}, h=${Math.round(r)}`,"overflow:",n.overflow),{width:Math.max(0,a),height:Math.max(0,r)}}function l(t){var e;const o=t.parentElement;return(null===(e=null==o?void 0:o.assignedSlot)||void 0===e?void 0:e.parentElement)?o.assignedSlot.parentElement:o}function u(t){var e;return(null===(e=t.assignedSlot)||void 0===e?void 0:e.parentElement)?t.assignedSlot.parentElement:t.parentElement}function d(t){if(null==t||""===t)return{mode:"empty"};if("none"===t)return{mode:"none"};if("auto"===t)return{mode:"auto"};const e=Number(t);return!isNaN(e)&&e>0?{mode:"factor",factor:e}:{mode:"empty"}}export{c as g,d as p,i as w}
@@ -1 +1 @@
1
- import{getElement as t}from"@stencil/core/internal/client";import{r}from"./utils.js";const s=(s,e)=>{const o=new MutationObserver((t=>{t.forEach((t=>{e(t.target.textContent)}))})),c=s.connectedCallback;s.connectedCallback=()=>{const n=t(s);o.observe(n,{childList:!0,subtree:!0,characterData:!0}),e(n.textContent),r(c,s)};const n=s.disconnectedCallback;s.disconnectedCallback=()=>{o.disconnect(),r(n,s)}};export{s as w}
1
+ import{getElement as t}from"@stencil/core/internal/client";import{r}from"./utils.js";const e=(e,o)=>{let i;const n=new MutationObserver((()=>{var t;i&&o(null!==(t=i.textContent)&&void 0!==t?t:"")})),s=e.connectedCallback;e.connectedCallback=()=>{var a;i=t(e),n.observe(i,{childList:!0,subtree:!0,characterData:!0}),o(null!==(a=i.textContent)&&void 0!==a?a:""),r(s,e)};const a=e.disconnectedCallback;e.disconnectedCallback=()=>{n.disconnect(),r(a,e)}};export{e as w}