@bino-bi/bn-template-engine 1.0.0-alpha.3 → 1.0.0-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bn-template-engine/bn-template-engine.esm.js +1 -1
- package/dist/bn-template-engine/p-1265d8d3.entry.js +1 -0
- package/dist/bn-template-engine/p-15516dac.entry.js +1 -0
- package/dist/bn-template-engine/p-1c716641.entry.js +1 -0
- package/dist/bn-template-engine/p-27cc8dc0.entry.js +1 -0
- package/dist/bn-template-engine/p-3b4c7425.entry.js +1 -0
- package/dist/bn-template-engine/p-4426d484.entry.js +1 -0
- package/dist/bn-template-engine/p-51f8dc9e.entry.js +1 -0
- package/dist/bn-template-engine/p-53d4e690.entry.js +1 -0
- package/dist/bn-template-engine/p-5KQYRQLK.js +1 -0
- package/dist/bn-template-engine/p-7337e03d.entry.js +1 -0
- package/dist/bn-template-engine/{p-0f1504f3.entry.js → p-75e97c87.entry.js} +1 -1
- package/dist/bn-template-engine/p-7a560278.entry.js +1 -0
- package/dist/bn-template-engine/p-BYBpC0EO.js +1 -0
- package/dist/bn-template-engine/p-BfXY5dsy.js +1 -0
- package/dist/bn-template-engine/p-BgnHJQ9Q.js +1 -0
- package/dist/bn-template-engine/{p-B4ySv9KQ.js → p-Bhd_WSML.js} +1 -1
- package/dist/bn-template-engine/p-Bka-Z6jo.js +1 -0
- package/dist/bn-template-engine/p-Bnhh02CF.js +1 -0
- package/dist/bn-template-engine/p-C7dQL8CS.js +1 -0
- package/dist/bn-template-engine/p-CL1RYuNU.js +1 -0
- package/dist/bn-template-engine/p-CYwd_ZNM.js +1 -0
- package/dist/bn-template-engine/p-ChlK-T9I.js +1 -0
- package/dist/bn-template-engine/p-DHezf8pZ.js +1 -0
- package/dist/bn-template-engine/{p-DVMu6dEy.js → p-DlppAFq9.js} +1 -1
- package/dist/bn-template-engine/p-DvDDgmcV.js +1 -0
- package/dist/bn-template-engine/p-DvvwfRQG.js +1 -0
- package/dist/bn-template-engine/{p-DG-1MR_T.js → p-P7pGJBgc.js} +1 -1
- package/dist/bn-template-engine/p-abc0067c.entry.js +1 -0
- package/dist/bn-template-engine/p-b34eaf86.entry.js +1 -0
- package/dist/bn-template-engine/p-bdb8b44c.entry.js +1 -0
- package/dist/bn-template-engine/p-c44fcb8e.entry.js +1 -0
- package/dist/bn-template-engine/p-c7e1a49b.entry.js +1 -0
- package/dist/bn-template-engine/p-d9003041.entry.js +1 -0
- package/dist/bn-template-engine/p-daa7ffa3.entry.js +1 -0
- package/dist/bn-template-engine/p-e084f50a.entry.js +1 -0
- package/dist/bn-template-engine/p-eaba6658.entry.js +1 -0
- package/dist/bn-template-engine/{p-C0yAPzJz.js → p-u8igQLRZ.js} +1 -1
- package/dist/cjs/{DataFormatDigits-DAmZzqbD.js → DataFormatDigits-DKcOeLNK.js} +1 -1
- package/dist/cjs/{DateStringFactory-CcluhpGI.js → DateStringFactory-CSKvbS8K.js} +1 -1
- package/dist/cjs/{Order-BKoDS21t.js → Order-iG11HI4R.js} +8 -5
- package/dist/cjs/{SVGVariancesStyleGroup-DYYAU-81.js → SVGVariancesStyleGroup-K-Tw6lOD.js} +1 -14
- package/dist/cjs/bn-asset.cjs.entry.js +5 -4
- package/dist/cjs/bn-body_4.cjs.entry.js +15 -13
- package/dist/cjs/bn-card.cjs.entry.js +5 -4
- package/dist/cjs/{ibcs-chart-structure.cjs.entry.js → bn-chart-structure_5.cjs.entry.js} +1074 -30
- package/dist/cjs/bn-chart-time.cjs.entry.js +38 -12
- package/dist/cjs/bn-component-style.cjs.entry.js +5 -4
- package/dist/cjs/bn-dataset.cjs.entry.js +38 -9
- package/dist/cjs/bn-grid.cjs.entry.js +9 -7
- package/dist/cjs/bn-image.cjs.entry.js +9 -7
- package/dist/cjs/bn-internationalization.cjs.entry.js +5 -4
- package/dist/cjs/bn-layout-card.cjs.entry.js +3 -2
- package/dist/cjs/bn-layout-page.cjs.entry.js +2 -1
- package/dist/cjs/bn-message.cjs.entry.js +5 -4
- package/dist/cjs/bn-table.cjs.entry.js +981 -0
- package/dist/cjs/bn-template-engine.cjs.js +1 -1
- package/dist/cjs/bn-template.cjs.entry.js +3 -2
- package/dist/cjs/bn-text.cjs.entry.js +11 -9
- package/dist/cjs/bn-tree.cjs.entry.js +9 -7
- package/dist/cjs/contentDecoder-JxOldq1e.js +419 -0
- package/dist/cjs/{context-protocol-CRPmux5D.js → context-protocol-DRQWrwsA.js} +2 -0
- package/dist/cjs/editor-companion.cjs.entry.js +1 -1
- package/dist/cjs/emotion-hash.esm-nbbEQ0Dn.js +57 -0
- package/dist/cjs/ibcs-chart-time.cjs.entry.js +22 -18
- package/dist/cjs/{bn-context_5.cjs.entry.js → ibcs-table.cjs.entry.js} +122 -1293
- package/dist/cjs/{StringAdapter-Bneo8T4k.js → ibcsRuleSet-DgUoXOfd.js} +10 -10
- package/dist/cjs/index-Dm85hG6t.js +65 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{scaling-D8sIIKft.js → scaling-9Tz595RQ.js} +7 -7
- package/dist/cjs/{withHasError-B8gHkfV2.js → utils-CwHIVbbL.js} +1 -69
- package/dist/cjs/{withBodyObserver-C6gLgq_e.js → withBodyObserver-CKpSD8UT.js} +3 -3
- package/dist/cjs/{withComponentStatus-_x4LQZ0N.js → withComponentStatus-Bw70BhO0.js} +5 -5
- package/dist/cjs/{withComponentStyle-DMtic_9Y.js → withComponentStyle-aIbTCtfj.js} +5 -5
- package/dist/cjs/withHasError-D7ue5vAv.js +72 -0
- package/dist/cjs/{withStyled-CW30Bh6c.js → withStyled-CS1Yp4sv.js} +8 -61
- package/dist/cjs/{withTranslation-CWPAIRjh.js → withTranslation-rwgyITqe.js} +5 -5
- package/dist/collection/components/bn-chart-structure/bn-chart-structure.js +226 -99
- package/dist/collection/components/bn-chart-structure/ibcs-chart-structure.js +13 -3
- package/dist/collection/components/bn-chart-structure/utils/StructureChart.js +94 -11
- package/dist/collection/components/bn-chart-structure/utils/elements/Label.js +11 -0
- package/dist/collection/components/bn-chart-structure/utils/elements/StackedBar.js +8 -6
- package/dist/collection/components/bn-chart-structure/utils/model/styles/StructureChartStyle.js +4 -0
- package/dist/collection/components/bn-chart-time/bn-chart-time.js +28 -4
- package/dist/collection/components/bn-chart-time/utils/TimeChart.js +3 -3
- package/dist/collection/components/bn-chart-time/utils/elements/StackedColumn.js +3 -4
- package/dist/collection/components/bn-chart-time/utils/model/styles/TimeChartStyle.js +4 -0
- package/dist/collection/components/bn-dataset/bn-dataset.js +49 -2
- package/dist/collection/components/bn-datasource/bn-datasource.js +46 -3
- package/dist/collection/components/bn-table/bn-table.js +20 -21
- package/dist/collection/components/bn-table/ibcs-table.js +2 -2
- package/dist/collection/components/bn-table/utils/elements/CellBarChart.js +58 -41
- package/dist/collection/stores/componentStyles.js +2 -0
- package/dist/collection/utils/constants.js +8 -5
- package/dist/collection/utils/contentDecoder.js +28 -0
- package/dist/collection/utils/stackColors.js +2 -2
- package/dist/collection/utils/validate.js +1 -1
- package/dist/components/DataFormatDigits.js +1 -1
- package/dist/components/Order.js +1 -1
- package/dist/components/SVGVariancesStyleGroup.js +1 -1
- package/dist/components/bn-chart-structure.js +1 -1
- package/dist/components/bn-chart-time.js +1 -1
- package/dist/components/bn-dataset.js +1 -1
- package/dist/components/bn-datasource.js +1 -1
- package/dist/components/bn-table.js +1 -1
- package/dist/components/contentDecoder.js +1 -0
- package/dist/components/context-protocol.js +1 -1
- package/dist/components/emotion-hash.esm.js +1 -0
- package/dist/components/ibcs-chart-structure2.js +1 -1
- package/dist/components/ibcs-chart-time2.js +1 -1
- package/dist/components/ibcs-table2.js +1 -1
- package/dist/components/ibcs-title2.js +1 -1
- package/dist/components/ibcsRuleSet.js +1 -1
- package/dist/components/validate.js +1 -1
- package/dist/components/withStyled.js +1 -1
- package/dist/esm/{DataFormatDigits--qIbKvXa.js → DataFormatDigits-oSZ1hBKE.js} +1 -1
- package/dist/esm/{DateStringFactory-XWdUjsn8.js → DateStringFactory-CSGz6TDk.js} +1 -1
- package/dist/esm/{Order-sqjrku2z.js → Order-Bnhh02CF.js} +9 -6
- package/dist/esm/{SVGVariancesStyleGroup-ibg3sLjM.js → SVGVariancesStyleGroup-CqTjrZYg.js} +2 -13
- package/dist/esm/bn-asset.entry.js +5 -4
- package/dist/esm/bn-body_4.entry.js +11 -9
- package/dist/esm/bn-card.entry.js +5 -4
- package/dist/esm/{ibcs-chart-structure.entry.js → bn-chart-structure_5.entry.js} +1064 -24
- package/dist/esm/bn-chart-time.entry.js +38 -12
- package/dist/esm/bn-component-style.entry.js +5 -4
- package/dist/esm/bn-dataset.entry.js +35 -6
- package/dist/esm/bn-grid.entry.js +9 -7
- package/dist/esm/bn-image.entry.js +9 -7
- package/dist/esm/bn-internationalization.entry.js +5 -4
- package/dist/esm/bn-layout-card.entry.js +3 -2
- package/dist/esm/bn-layout-page.entry.js +2 -1
- package/dist/esm/bn-message.entry.js +5 -4
- package/dist/esm/bn-table.entry.js +979 -0
- package/dist/esm/bn-template-engine.js +1 -1
- package/dist/esm/bn-template.entry.js +3 -2
- package/dist/esm/bn-text.entry.js +11 -9
- package/dist/esm/bn-tree.entry.js +9 -7
- package/dist/esm/contentDecoder-oMmxz6nJ.js +416 -0
- package/dist/esm/{context-protocol-Bz5klD-F.js → context-protocol-BHnQsVsr.js} +2 -0
- package/dist/esm/editor-companion.entry.js +1 -1
- package/dist/esm/emotion-hash.esm-BYBpC0EO.js +55 -0
- package/dist/esm/ibcs-chart-time.entry.js +15 -11
- package/dist/esm/{bn-context_5.entry.js → ibcs-table.entry.js} +69 -1236
- package/dist/esm/{StringAdapter-BCLJpQQ8.js → ibcsRuleSet-K4ytuA1f.js} +10 -10
- package/dist/esm/index-DHezf8pZ.js +65 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{scaling-C6K8FYSF.js → scaling-Cehc74IE.js} +2 -2
- package/dist/esm/{withHasError-B3QX2emi.js → utils-DvvwfRQG.js} +1 -69
- package/dist/esm/{withBodyObserver-DczL5ia8.js → withBodyObserver-FQ8NwCIz.js} +1 -1
- package/dist/esm/{withComponentStatus-DodoSXe-.js → withComponentStatus-DWjDYtZ7.js} +1 -1
- package/dist/esm/{withComponentStyle-BerJY64r.js → withComponentStyle-9uP_hcDq.js} +2 -2
- package/dist/esm/withHasError-FyY5mQ_3.js +70 -0
- package/dist/esm/{withStyled-D1fAWJ3g.js → withStyled--qQWquTH.js} +6 -59
- package/dist/esm/{withTranslation-mimbJdER.js → withTranslation-BqD0Kp7b.js} +2 -2
- package/dist/types/components/bn-chart-structure/bn-chart-structure.d.ts +155 -109
- package/dist/types/components/bn-chart-structure/utils/StructureChart.d.ts +7 -0
- package/dist/types/components/bn-chart-structure/utils/elements/Label.d.ts +2 -0
- package/dist/types/components/bn-chart-structure/utils/model/styles/StructureChartStyle.d.ts +1 -0
- package/dist/types/components/bn-chart-time/utils/model/styles/TimeChartStyle.d.ts +1 -0
- package/dist/types/components/bn-dataset/bn-dataset.d.ts +6 -0
- package/dist/types/components/bn-datasource/bn-datasource.d.ts +8 -0
- package/dist/types/components/bn-table/bn-table.d.ts +10 -8
- package/dist/types/components/bn-table/utils/elements/CellBarChart.d.ts +0 -2
- package/dist/types/components.d.ts +102 -38
- package/dist/types/stores/componentStyles.d.ts +2 -0
- package/dist/types/utils/constants.d.ts +8 -5
- package/dist/types/utils/contentDecoder.d.ts +12 -0
- package/package.json +2 -1
- package/dist/bn-template-engine/p-05a82a77.entry.js +0 -1
- package/dist/bn-template-engine/p-1970906d.entry.js +0 -1
- package/dist/bn-template-engine/p-1dbd339c.entry.js +0 -1
- package/dist/bn-template-engine/p-2e68cf09.entry.js +0 -1
- package/dist/bn-template-engine/p-31cc6a2d.entry.js +0 -1
- package/dist/bn-template-engine/p-37881d05.entry.js +0 -1
- package/dist/bn-template-engine/p-3b894997.entry.js +0 -1
- package/dist/bn-template-engine/p-50e49732.entry.js +0 -1
- package/dist/bn-template-engine/p-6c7c0455.entry.js +0 -1
- package/dist/bn-template-engine/p-6da93eae.entry.js +0 -1
- package/dist/bn-template-engine/p-701e1578.entry.js +0 -1
- package/dist/bn-template-engine/p-8tsCnxIz.js +0 -1
- package/dist/bn-template-engine/p-997b2fe4.entry.js +0 -1
- package/dist/bn-template-engine/p-BL8gyUwE.js +0 -1
- package/dist/bn-template-engine/p-BSfqOkN_.js +0 -1
- package/dist/bn-template-engine/p-CRLgp9-v.js +0 -1
- package/dist/bn-template-engine/p-CYjZRKdI.js +0 -1
- package/dist/bn-template-engine/p-DRikHQE-.js +0 -1
- package/dist/bn-template-engine/p-DtdQCMzj.js +0 -1
- package/dist/bn-template-engine/p-a90f1cbe.entry.js +0 -1
- package/dist/bn-template-engine/p-b7bec050.entry.js +0 -1
- package/dist/bn-template-engine/p-d7f0cbaf.entry.js +0 -1
- package/dist/bn-template-engine/p-dfb61aa5.entry.js +0 -1
- package/dist/bn-template-engine/p-ece17f84.entry.js +0 -1
- package/dist/bn-template-engine/p-f27995c9.entry.js +0 -1
- package/dist/bn-template-engine/p-fd427179.entry.js +0 -1
- package/dist/bn-template-engine/p-sqjrku2z.js +0 -1
- package/dist/bn-template-engine/p-tzFCK9qn.js +0 -1
- package/dist/cjs/bn-chart-structure.cjs.entry.js +0 -700
- package/dist/esm/bn-chart-structure.entry.js +0 -698
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{S as e}from"./p-JNHhIe7t.js";const t=(()=>{let e;return(...t)=>{e&&clearTimeout(e),e=setTimeout((()=>{e=0,(e=>{for(let t of e.keys()){const o=e.get(t).filter((e=>{const t=e.deref();return t&&(!("isConnected"in(o=t))||o.isConnected);var o}));e.set(t,o)}})(...t)}),2e3)}})(),o=e.forceUpdate,n=e.getRenderingRef,i=(e,t)=>{const o=e.indexOf(t);o>=0&&(e[o]=e[e.length-1],e.length--)},r=(e,r)=>{const a=((e,t=(e,t)=>e!==t)=>{const o=()=>{return("function"==typeof(t=e)?t():t)??{};var t},n=o();let r=new Map(Object.entries(n));const a="undefined"!=typeof Proxy,s=a?null:{},l={dispose:[],get:[],set:[],reset:[]},f=new Map,c=()=>{r=new Map(Object.entries(o())),a||_(),l.reset.forEach((e=>e()))},d=e=>(l.get.forEach((t=>t(e))),r.get(e)),p=(e,o)=>{const n=r.get(e);t(o,n,e)&&(r.set(e,o),a||u(e),l.set.forEach((t=>t(e,o,n))))},b=a?new Proxy(n,{get:(e,t)=>d(t),ownKeys:()=>Array.from(r.keys()),getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0}),has:(e,t)=>r.has(t),set:(e,t,o)=>(p(t,o),!0)}):(_(),s),h=(e,t)=>(l[e].push(t),()=>{i(l[e],t)});function u(e){!a&&s&&(Object.prototype.hasOwnProperty.call(s,e)||Object.defineProperty(s,e,{configurable:!0,enumerable:!0,get:()=>d(e),set(t){p(e,t)}}))}function _(){if(a||!s)return;const e=new Set(r.keys());for(const t of Object.keys(s))e.has(t)||delete s[t];for(const t of e)u(t)}return{state:b,get:d,set:p,on:h,onChange:(e,t)=>{const n=(o,n)=>{o===e&&t(n)},i=()=>{const n=o();t(n[e])},r=h("set",n),a=h("reset",i);return f.set(t,{setHandler:n,resetHandler:i,propName:e}),()=>{r(),a(),f.delete(t)}},use:(...e)=>{const t=e.reduce(((e,t)=>(t.set&&e.push(h("set",t.set)),t.get&&e.push(h("get",t.get)),t.reset&&e.push(h("reset",t.reset)),t.dispose&&e.push(h("dispose",t.dispose)),e)),[]);return()=>t.forEach((e=>e()))},dispose:()=>{l.dispose.forEach((e=>e())),c()},reset:c,forceUpdate:e=>{const t=r.get(e);l.set.forEach((o=>o(e,t,t)))},removeListener:(e,t)=>{const o=f.get(t);o&&o.propName===e&&(i(l.set,o.setHandler),i(l.reset,o.resetHandler),f.delete(t))}}})(e,r);return a.use((()=>{if("function"!=typeof n||"function"!=typeof o)return{};const e=o,i=n,r=new Map;return{dispose:()=>r.clear(),get:e=>{const t=i();t&&((e,t,o)=>{let n=e.get(t);n||(n=[],e.set(t,n)),n.some((e=>e.deref()===o))||n.push(new WeakRef(o))})(r,e,t)},set:o=>{const n=r.get(o);if(n){const t=n.filter((t=>{const o=t.deref();return!!o&&e(o)}));r.set(o,t)}t(r)},reset:()=>{r.forEach((t=>{t.forEach((t=>{const o=t.deref();o&&e(o)}))})),t(r)}}})()),a},a={global:{fontFamily:"'Noto Sans', sans-serif",fontSizePx:13.3333,fontColor:"#000000",fontBackgroundColor:"#ffffff"},"bn-text":{},"bn-chart-time":{scaleFactors:{scenarioOffset:.3,scenarioLabelToColumn:.3,labelToColumn:.3,labelToAxis:.3,needleWidth:.3,needleHeadWidth:.6,columnWidth:2,varianceAxisLineWidth:.3,axisLineWidth:.1,auxiliaryLineWidth:.1,scenarioLineWidth:.2,markerWidth:.7,markerOffset:0,categoryWidth:3,axisTickLength:.3},axisStyles:{ac:{stroke:"#121212",fill:"#121212",width:.1},fc:{stroke:"#121212",fill:"#ffffff",width:.1,dasharray:"10 5 5 5"},pp:{stroke:"#606060",fill:"#606060",width:.1},pl:{stroke:"#121212",fill:"#ffffff",width:.1}},barStyles:{ac:{stroke:"#404040",fill:"#404040",width:.1},fc:{stroke:"#404040",fill:"#ffffff",width:.5,fillpattern:"fc"},pp:{stroke:"#A6A6A6",fill:"#A6A6A6",width:.1},pl:{stroke:"#404040",fill:"#ffffff",width:.1}},varianceStyles:{pos:{stroke:"#008f96",fill:"#008f96",width:.1},neg:{stroke:"#ff0000",fill:"#ff0000",width:.1},neu:{stroke:"#808080",fill:"#808080",width:.1}},padding:{top:10,left:10,right:10,bottom:10}},"bn-chart-structure":{scaleFactors:{scenarioOffset:.3,scenarioLabelToBar:.1,labelToBar:.3,labelToAxis:.3,needleWidth:.3,needleHeadWidth:.6,barWidth:1.2,varianceAxisLineWidth:.3,axisLineWidth:.1,auxiliaryLineWidth:.1,scenarioLineWidth:.2,markerWidth:.7,markerOffset:0,categoryWidth:1.9,axisTickLength:.3},axisStyles:{ac:{stroke:"#121212",fill:"#121212",width:.1},fc:{stroke:"#121212",fill:"#ffffff",width:.1,dasharray:"10 5 5 5"},pp:{stroke:"#606060",fill:"#606060",width:.1},pl:{stroke:"#121212",fill:"#ffffff",width:.1}},barStyles:{ac:{stroke:"#404040",fill:"#404040",width:.1},fc:{stroke:"#404040",fill:"#ffffff",width:.5,fillpattern:"fc"},pp:{stroke:"#A6A6A6",fill:"#A6A6A6",width:.1},pl:{stroke:"#404040",fill:"#ffffff",width:.1}},varianceStyles:{pos:{stroke:"#008f96",fill:"#008f96",width:.1},neg:{stroke:"#ff0000",fill:"#ff0000",width:.1},neu:{stroke:"#808080",fill:"#808080",width:.1}},padding:{top:10,left:10,right:10,bottom:10}},"bn-tree":{edgeColor:"#404040",edgeWidth:1,operatorCircleRadius:10,operatorFontSizeScale:.9,operatorColor:"#404040"},"bn-grid":{headerBackground:"transparent",borderColor:"#A6A6A6",borderWidth:1,cellPadding:4}};function s(e,t,o=null){o=o||{},t=t?t+".":"";for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&("object"==typeof e[n]&&null!==e[n]?s(e[n],t+n,o):o[t+n]=e[n]);return o}const l=["ORDER_asc","ORDER_desc","ac1","pp1","fc1","pl1","ac2","pp2","fc2","pl2","ac3","pp3","fc3","pl3","ac4","pp4","fc4","pl4","ibcssymbol_delta_ac","ibcssymbol_delta_generic","ibcssymbol_delta_ac_relative","ibcssymbol_delta_generic_relative"],f=s({global:{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",ORDER_asc:"↑",ORDER_desc:"↓",ibcssymbol_delta_ac:"Δ{%}",ibcssymbol_delta_generic:"Δ({%})",ibcssymbol_delta_ac_relative:"Δ{%}%",ibcssymbol_delta_generic_relative:"Δ({%})%"},"bn-title":{SEPERATOR_WS:", ",CONNECTOR_WS:" und ",in:"in"},"bn-chart":{},"bn-table":{in:"in",category:" ",operation:" ",there_of:"davon",part_of:"in % von",SUM_TOTAL:"❖",REST:"REST"}}),c=s({global:{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",ORDER_asc:"↑",ORDER_desc:"↓",ibcssymbol_delta_ac:"Δ{%}",ibcssymbol_delta_generic:"Δ({%})",ibcssymbol_delta_ac_relative:"Δ{%}%",ibcssymbol_delta_generic_relative:"Δ({%})%"},"bn-title":{SEPERATOR_WS:", ",CONNECTOR_WS:" and ",in:"in"},"bn-chart":{},"bn-table":{category:" ",operation:" ",there_of:"there of",part_of:"in % of",SUM_TOTAL:"❖",REST:"REST"}}),d=Object.keys(f||{}),p={_system:{de:f,en:c}},b=new WeakMap;function h(e){let t=b.get(e);return t||(t={datasources:r({}),datasets:r({}),datasetsMeta:r({}),componentStyles:r({_system:a}),internationalization:r(Object.assign({},p)),assets:r({}),context:r({locale:"en"})},b.set(e,t)),t}const u=new WeakMap;function _(e){const t=u.get(e);if(t)return t;const o=function(e){var t;let o=e.parentNode;for(;o;){if(o instanceof HTMLElement&&"bn-context"===(null===(t=o.nodeName)||void 0===t?void 0:t.toLowerCase()))return o;if(o.parentNode)o=o.parentNode;else{if(!(o instanceof ShadowRoot))break;o=o.host}}}(e);if(!o)throw new Error(`[bn] <${e.localName}> must be inside a <bn-context>. No ancestor <bn-context> found.`);const n=h(o);return u.set(e,n),n}function y(e){u.delete(e)}export{d as B,l as a,h as b,y as c,s as f,_ as g}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{f as t,g as n,T as r,h as s,i as e,a,O as o,M as i,j as u,A as c,c as l}from"./p-sqjrku2z.js";import{D as f,a as m}from"./p-B4ySv9KQ.js";import{f as d,g as N}from"./p-JNHhIe7t.js";import{r as p}from"./p-tzFCK9qn.js";function v(t){return null==t||""===t||"null"===t}function b(n){return v(n)||"auto"===n.trim().toLowerCase()?[]:h((null==n?void 0:n.split(",").filter((n=>!(n.toUpperCase().trim()in t)))).toString())}function h(r){return v(r)?[]:r.replace(";",",").split(",").filter((r=>{var s,e,a;const o=r.split("_"),i=null===(s=o[0])||void 0===s?void 0:s.replace(/^dr|^d/,"").toUpperCase().trim(),u=null===(e=o[1])||void 0===e?void 0:e.toUpperCase().trim(),c=null===(a=o[2])||void 0===a?void 0:a.toUpperCase().trim();return 3!==o.length||!(i in t)||!(u in t)||!(c in n)}))}function y(t){return v(t)||"auto"===t.trim().toLowerCase()?[]:h(t.split(",").filter((t=>!(t.toUpperCase()in a))).toString())}function g(t){return!v(t)&&Number.isInteger(Number(t))}function S(t){return!v(t)&&!Number.isNaN(Number(t))}function O(t){return!v(t)&&(null==t?void 0:t.toUpperCase())in o}function J(t){return"auto"===(null==t?void 0:t.toLowerCase())||(null==t?void 0:t.toUpperCase())in c}function w(t){if(v(t))return[];try{const n=JSON.parse(t);if(n instanceof Array)return n.filter((t=>!(t.hasOwnProperty("name")&&t.hasOwnProperty("unit"))))}catch(t){console.error("validateMeasureList: failed to parse JSON",t)}return["Invalid JSON structure"]}function j(t){const n=Date.parse(t);return Number.isInteger(n)}function k(t){return(null==t?void 0:t.toUpperCase())in m}function A(t){return(null==t?void 0:t.toUpperCase())in f}function $(t){return(null==t?void 0:t.toUpperCase())in l}function T(t){return!v(t)&&(null==t?void 0:t.toUpperCase())in s}function z(t){return!v(t)&&["true","false",!0,!1].some((n=>n===t))}function M(t){return!v(t)&&(null==t?void 0:t.toUpperCase())in e}function E(t){if(v(t))return[];try{const n=JSON.parse(t);if(n instanceof Array)return n.filter((t=>!(t.hasOwnProperty("rowGroup")&&t.hasOwnProperty("category")&&t.hasOwnProperty("subCategory"))))}catch(t){console.error("validateThereOfJsonStr: failed to parse JSON",t)}return["Invalid JSON structure"]}function G(t){if(v(t))return[];try{const n=JSON.parse(t);if(n instanceof Array)return n.filter((t=>!(t.hasOwnProperty("rowGroup")&&t.hasOwnProperty("category"))))}catch(t){console.error("validatePartOfJsonStr: failed to parse JSON",t)}return["Invalid JSON structure"]}function I(t){return(null==t?void 0:t.trim().toUpperCase())in i}function q(t){return["_","k","M","G","T","P","E","Z","Y","m","μ","n","p","P","f","a","z","y"].includes(null==t?void 0:t.trim())||["GREATEST","LEAST"].includes(null==t?void 0:t.trim().toUpperCase())}function x(t){return(null==t?void 0:t.toUpperCase().trim())in u}function C(t){return(null==t?void 0:t.toUpperCase().trim())in r}function L(t){if(v(t))return[];try{return JSON.parse(t).filter((t=>!(t.hasOwnProperty("scenario")&&t.hasOwnProperty("name")&&t.hasOwnProperty("subGroups"))))}catch(t){console.error("validateColumnThereOfJsonStr: failed to parse JSON",t)}return["Invalid JSON structure"]}function P(t){if(v(t))return[];try{const n=JSON.parse(t);if("object"!=typeof n||null===n||Array.isArray(n))return["stack: must be a JSON object"];const r=[];if(n.hasOwnProperty("by")){const t=["scenario","category","subcategory","rowgroup"];t.includes(n.by)||r.push(`stack: 'by' must be one of: ${t.join(", ")}`)}else r.push("stack: 'by' is required");if(n.hasOwnProperty("mode")){const t=["absolute","relative","absolute-relative"];t.includes(n.mode)||r.push(`stack: 'mode' must be one of: ${t.join(", ")}`)}if(n.hasOwnProperty("order")){const t=["asc","desc","dataset"];t.includes(n.order)||r.push(`stack: 'order' must be one of: ${t.join(", ")}`)}return r}catch(t){return["stack: invalid JSON"]}}class _{constructor(){this.cache=new Map,this.tag=_.makeStyleTag()}static makeStyleTag(){const t=document.createElement("style");return t.type="text/css",t.setAttribute("data-bn-computed-style",""),t.append(document.createTextNode("")),(document.head||document.querySelector("head")).append(t),t}apply(t){t.forEach((t=>this.cache.set(t.className,t.style))),this.tag.innerHTML=Array.from(this.cache.values()).map((t=>t)).join("\n")}}const D=new _,F=t=>S(t)?`${t}px`:t,K={width:{className:"w",cssName:"width",attrName:"width",transform:F},height:{className:"h",cssName:"height",attrName:"height",transform:F},position:{className:"pst",cssName:"position",attrName:"position"},top:{className:"top",cssName:"top",attrName:"top",transform:F},right:{className:"rgt",cssName:"right",attrName:"right",transform:F},bottom:{className:"btm",cssName:"bottom",attrName:"bottom",transform:F},left:{className:"lft",cssName:"left",attrName:"left",transform:F},"font-size":{className:"fts",cssName:"font-size",attrName:"font-size",transform:F},"grid-column":{className:"gdc",cssName:"grid-column",attrName:"grid-column"},"grid-row":{className:"gdr",cssName:"grid-row",attrName:"grid-row"}},B=Object.keys(K);function H(t,n){const r=function(t,n){const r=function(t){for(var n,r=0,s=0,e=t.length;e>=4;++s,e-=4)n=1540483477*(65535&(n=255&t.charCodeAt(s)|(255&t.charCodeAt(++s))<<8|(255&t.charCodeAt(++s))<<16|(255&t.charCodeAt(++s))<<24))+(59797*(n>>>16)<<16),r=1540483477*(65535&(n^=n>>>24))+(59797*(n>>>16)<<16)^1540483477*(65535&r)+(59797*(r>>>16)<<16);switch(e){case 3:r^=(255&t.charCodeAt(s+2))<<16;case 2:r^=(255&t.charCodeAt(s+1))<<8;case 1:r=1540483477*(65535&(r^=255&t.charCodeAt(s)))+(59797*(r>>>16)<<16)}return(((r=1540483477*(65535&(r^=r>>>13))+(59797*(r>>>16)<<16))^r>>>15)>>>0).toString(36)}(n);return`bn-c-${t.className}_${r}`}(t,n),s=function(t,n,r){return`.${n} {${t.cssName}: ${r};}`}(t,r,n);return{className:r,style:s}}const Q=t=>{const n=new Map;return B.forEach((r=>{const s=t.getAttribute(r);s&&(["top","left","right","bottom"].includes(r)&&n.set("position",H(K.position,"absolute")),n.set(r,H(K[r],(K[r].transform||function(t){return t})(s))))})),n},R=new MutationObserver((t=>{for(const n of t){const t=n.target,r=Q(t);D.apply(r);const s=Array.from(r.values()).map((t=>t.className));t.className=t.className.split(" ").filter((t=>!t.startsWith("bn-c-"))).concat(...s).join(" "),d(t)}})),Y=t=>{const n=t.connectedCallback,r=t.disconnectedCallback;t.connectedCallback=()=>{const r=N(t);if(!r)throw new Error("Can't find element field in component undefined");(t=>{const n=Q(t);D.apply(n);const r=Array.from(n.values()).map((t=>t.className));t.className=t.className.split(" ").filter((t=>!t.startsWith("bn-c-"))).concat(...r).join(" "),R.observe(t,{attributes:!0,attributeFilter:B,childList:!1,subtree:!1})})(r),p(n,t)},t.disconnectedCallback=()=>{p(r,t)}};export{h as a,J as b,y as c,O as d,g as e,z as f,q as g,P as h,S as i,v as j,A as k,$ as l,w as m,j as n,k as o,C as p,T as q,M as r,E as s,G as t,I as u,b as v,Y as w,x,L as y}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as i,h as t,H as e,g as s}from"./p-JNHhIe7t.js";import{v as a,a as n,i as r,b as o,c as l,d as h,e as d,f as c,g as p,h as u,w as v,j as g}from"./p-DtdQCMzj.js";import{w as m,g as f,p as y}from"./p-DVMu6dEy.js";import{w as b}from"./p-CYjZRKdI.js";import{w as S}from"./p-CRLgp9-v.js";import{a as w}from"./p-DRikHQE-.js";import{w as O}from"./p-BSfqOkN_.js";import{w as k}from"./p-tzFCK9qn.js";import{A as R,O as x,a as _,S as T,b as A}from"./p-sqjrku2z.js";import"./p-B4ySv9KQ.js";const E=class{validateScenario(i){const t=a(i),e="ERR_scenarios";t.length>0?this.errors.addOrReplace({id:e,type:"warning",message:"scenarios: invalid value(s) '"+JSON.stringify(t)+"' are not supported."}):this.errors.remove(e)}validateVariances(i){const t="ERR_variances",e=n(i);e.length>0?this.errors.addOrReplace({id:t,type:"warning",message:"variances: invalid value(s) '"+JSON.stringify(e)+"' are not supported."}):this.errors.remove(t)}validateUnitScaling(i){const t="ERR_unitScaling";r(i)||this.pixelPerUnitGroupMap.has(i)?this.errors.remove(t):this.errors.addOrReplace({id:t,type:"warning",message:"unitScaling: invalid value(s) '"+i+"' are not supported."})}validatePercentageScaling(i){const t="ERR_percentageScaling";r(i)||this.pixelPerUnitGroupMap.has(i)?this.errors.remove(t):this.errors.addOrReplace({id:t,type:"warning",message:"percentageScaling: invalid value(s) '"+i+"' are not supported."})}validateLevel(i){const t="ERR_level";o(i)?this.errors.remove(t):this.errors.addOrReplace({id:t,type:"warning",message:"level: invalid value(s) '"+i+"' are not supported."})}validateOrderList(i){const t=l(i),e="ERR_order";t.length>0?this.errors.addOrReplace({id:e,type:"warning",message:"order: invalid value(s) '"+JSON.stringify(t)+"' are not supported."}):this.errors.remove(e)}validateOrderDirection(i){const t="ERR_orderDirection";h(i)?this.errors.remove(t):this.errors.addOrReplace({id:t,type:"warning",message:"orderDirection: invalid value '"+(null==i?void 0:i.toString())+"' is not supported."})}validateLimit(i){const t="ERR_limit";d(i)?this.errors.remove(t):this.errors.addOrReplace({id:t,type:"warning",message:"limit: invalid value '"+(null==i?void 0:i.toString())+"' is not supported."})}validateShowCategories(i){const t="ERR_showCategories";c(i)?this.errors.remove(t):this.errors.addOrReplace({id:t,type:"warning",message:"showCategories: invalid value(s) '"+(null==i?void 0:i.toString())+"' are not supported."})}validateMeasureScale(i){const t="ERR_measureScale";p(i)?this.errors.remove(t):this.errors.addOrReplace({id:t,type:"warning",message:"measureScale: invalid value '"+(null==i?void 0:i.toString())+"' is not supported."})}validateShowMeasureScale(i){const t="ERR_grouped";c(i)?this.errors.remove(t):this.errors.addOrReplace({id:t,type:"warning",message:"showMeasureScale: invalid value(s) '"+(null==i?void 0:i.toString())+"' are not supported."})}validateStack(i){const t="ERR_stack",e=u(i);e.length>0?this.errors.addOrReplace({id:t,type:"warning",message:e.join("; ")}):this.errors.remove(t)}validateScaling(i){if(null==i||""===i||"none"===i||"auto"===i)return void this.errors.remove("ERR_scale");const t=Number(i);isNaN(t)||t<=0?this.errors.addOrReplace({id:"ERR_scale",type:"warning",message:`Invalid scale value: "${i}". Use "none", "auto", or a positive number.`}):this.errors.remove("ERR_scale")}constructor(t){i(this,t),this.data=[],this.datasetMeta=null,this.appliedScaleFactor=1,this.chartTitle="",this.filter="",this.limit=0,this.showCategories="true",this.measureScale="greatest",this.showMeasureScale="false",this.measureUnit="",this.stack="",this.scenariosArray=[""],this.pixelPerUnitGroupMap=new Map,this._autoScaleGuard=!1,v(this),b(this),m(this,((i,t)=>{this.data=t||[]}),((i,t)=>{this.datasetMeta=t})),this.chartTemplate=this.chartTemplate.bind(this),this.errors=k(this),this.componentStyle=O(this),this.t=S(this).t}componentWillLoad(){this.validateScenario(this.scenarios),this.validateVariances(this.variances),this.validateUnitScaling(this.unitScaling),this.validateLevel(this.level),this.validateOrderDirection(this.orderDirection),this.validateOrderList(this.order),this.validateShowCategories(this.showCategories),this.validateMeasureScale(this.measureScale),this.validateShowMeasureScale(this.showMeasureScale),this.validateStack(this.stack),this.validateScaling(this.scale)}componentDidRender(){var i,t;const{mode:e}=y(this.scale);if("auto"!==e&&"empty"!==e){this._autoScaleGuard=!1;const i=f(this.element),t="WARN_overflow";return void(i.width>0&&this.element.scrollWidth>i.width+1?this.errors.addOrReplace({id:t,type:"warning",message:"Chart exceeds available space and will be cut off. Check unit-scaling value."}):this.errors.remove(t))}if(this._autoScaleGuard)return void(this._autoScaleGuard=!1);const s=this.element,{height:a}=f(s);if(a<=0)return;const n=this.componentStyle((i=>{var t;return(null===(t=i.global)||void 0===t?void 0:t.fontSizePx)||13.3333}));s.style.setProperty("--bn-font-size",`${n}px`);const r=null===(i=s.shadowRoot)||void 0===i?void 0:i.querySelector(".container"),o=null!==(t=null==r?void 0:r.scrollHeight)&&void 0!==t?t:s.scrollHeight;if(o<=a+1)return this.errors.remove("AUTO_scale"),void(1!==this.appliedScaleFactor&&(this._autoScaleGuard=!0,this.appliedScaleFactor=1));const l=(a-1)/o;s.style.setProperty("--bn-font-size",n*l+"px"),"empty"===e?this.errors.addOrReplace({id:"AUTO_scale",type:"warning",message:`Auto-scaled chart by factor ${l.toFixed(3)}`}):this.errors.remove("AUTO_scale"),Math.abs(l-this.appliedScaleFactor)>.001&&(this._autoScaleGuard=!0,this.appliedScaleFactor=l)}prepareDimension(){const i=f(this.element);return this.canvasWidthSegmented=i.width/this.scenariosArray.length,{width:this.canvasWidthSegmented,height:i.height}}prepareScenarios(){var i,t,e,s;const a="auto"===(null===(i=this.scenarios)||void 0===i?void 0:i.trim().toLowerCase());return g(this.scenarios)||a?(null===(e=null===(t=this.datasetMeta)||void 0===t?void 0:t.availableScenarios)||void 0===e?void 0:e.length)>0?(a?this.errors.remove("AUTO_scenarios"):this.errors.addOrReplace({id:"AUTO_scenarios",type:"warning",message:`scenarios: not set, auto-detected: ${this.datasetMeta.availableScenarios.join(",")}`}),this.datasetMeta.availableScenarios):[]:(this.errors.remove("AUTO_scenarios"),null===(s=this.scenarios)||void 0===s?void 0:s.split(",").map((i=>i.trim())))}prepareVariances(){var i;return g(this.variances)?[]:null===(i=this.variances)||void 0===i?void 0:i.split(",").map((i=>i.trim()))}prepareHideCategories(i){return i>=1||"true"!==this.showCategories}prepareI18n(){const i=w,t=new Map([].map((i=>[i,this.t(".".concat(i))]))),e=new Map(i.map((i=>[i,this.t("global.".concat(i))])));return new Map([...e.entries(),...t.entries()])}preparePixelPerUnit(){var i;if(this.pixelPerUnitGroupMap.has(this.unitScaling))return this.errors.remove("AUTO_unitScaling"),this.pixelPerUnitGroupMap.get(this.unitScaling);if("auto"===(null===(i=this.unitScaling)||void 0===i?void 0:i.toString().trim().toLowerCase()))return this.errors.remove("AUTO_unitScaling"),0;const t=Number(this.unitScaling);return!isNaN(t)&&t>0?(this.errors.remove("AUTO_unitScaling"),t):(this.errors.addOrReplace({id:"AUTO_unitScaling",type:"warning",message:"unit-scaling: not set, auto-calculated to fit available space."}),0)}preparePixelPerPercentage(){return this.pixelPerUnitGroupMap.has(this.percentageScaling)?this.pixelPerUnitGroupMap.get(this.percentageScaling):100*Number(this.percentageScaling)}prepareLevel(){var i,t,e;const s="auto"===(null===(i=this.level)||void 0===i?void 0:i.trim().toLowerCase());return g(this.level)||s?(null===(t=this.datasetMeta)||void 0===t?void 0:t.suggestedLevel)?(s?this.errors.remove("AUTO_level"):this.errors.addOrReplace({id:"AUTO_level",type:"warning",message:`level: not set, auto-detected: ${this.datasetMeta.suggestedLevel}`}),R[this.datasetMeta.suggestedLevel.toUpperCase()]):void 0:(this.errors.remove("AUTO_level"),R[null===(e=this.level)||void 0===e?void 0:e.toUpperCase()])}prepareOrder(){var i,t,e;const s="auto"===(null===(i=this.order)||void 0===i?void 0:i.trim().toLowerCase());let a;return g(this.order)||s?(null===(t=this.datasetMeta)||void 0===t?void 0:t.suggestedOrder)?(s?this.errors.remove("AUTO_order"):this.errors.addOrReplace({id:"AUTO_order",type:"warning",message:`order: not set, auto-detected: ${this.datasetMeta.suggestedOrder}`}),a=this.datasetMeta.suggestedOrder):a=this.order:(this.errors.remove("AUTO_order"),a=this.order),{hierarchy:null==a?void 0:a.split(",").map((i=>_[null==i?void 0:i.toUpperCase()])),direction:x[null===(e=this.orderDirection)||void 0===e?void 0:e.toUpperCase()]}}prepareStyle(){const i=this.getEffectiveScaleFactor();return this.componentStyle((t=>{const e=t.global.fontSizePx*i;return{scaleFactors:{scenarioOffset:t["bn-chart-structure"].scaleFactors.scenarioOffset,scenarioLabelToBar:t["bn-chart-structure"].scaleFactors.scenarioLabelToBar,labelToBar:t["bn-chart-structure"].scaleFactors.labelToBar,labelToAxis:t["bn-chart-structure"].scaleFactors.labelToAxis,needleWidth:t["bn-chart-structure"].scaleFactors.needleWidth,needleHeadWidth:t["bn-chart-structure"].scaleFactors.needleHeadWidth,barWidth:t["bn-chart-structure"].scaleFactors.barWidth,varianceAxisLineWidth:t["bn-chart-structure"].scaleFactors.varianceAxisLineWidth,axisLineWidth:t["bn-chart-structure"].scaleFactors.axisLineWidth,auxiliaryLineWidth:t["bn-chart-structure"].scaleFactors.auxiliaryLineWidth,scenarioLineWidth:t["bn-chart-structure"].scaleFactors.scenarioLineWidth,markerWidth:t["bn-chart-structure"].scaleFactors.markerWidth,markerOffset:t["bn-chart-structure"].scaleFactors.markerOffset,categoryWidth:t["bn-chart-structure"].scaleFactors.categoryWidth,axisTickLength:t["bn-chart-structure"].scaleFactors.axisTickLength},fontStyles:{font:`${e}px ${t.global.fontFamily}`,size:e,color:t.global.fontColor,background:t.global.fontBackgroundColor,leading:1.8},axisStyles:t["bn-chart-structure"].axisStyles,barStyles:t["bn-chart-structure"].barStyles,varianceStyles:t["bn-chart-structure"].varianceStyles,padding:t["bn-chart-structure"].padding,pattern:null}}))}prepareChartTitle(i){return i>=1?"":this.chartTitle}prepareStackConfig(){if(g(this.stack))return null;try{const i=JSON.parse(this.stack);return{by:i.by,mode:i.mode||A.ABSOLUTE,order:i.order||T.DATASET}}catch(i){return null}}prepareFilter(){return 0===this.filter.length?"":this.filter}prepareLimit(){return Math.floor(Number(this.limit)||0)}getDataStructure(){return{IStructureChartDataRow:{operation:{type:"string",isOptional:!1,description:""},rowGroup:{type:"string",isOptional:!1,description:""},rowGroupIndex:{type:"number",isOptional:!1,description:""},category:{type:"string",isOptional:!1,description:""},categoryIndex:{type:"number",isOptional:!1,description:""},subCategory:{type:"string",isOptional:!1,description:""},subCategoryIndex:{type:"number",isOptional:!1,description:""},columnGroup:{type:"string",isOptional:!1,description:""},columnGroupIndex:{type:"number",isOptional:!1,description:""},columnSubGroup:{type:"string",isOptional:!1,description:""},columnSubGroupIndex:{type:"number",isOptional:!1,description:""},ac1:{type:"number",isOptional:!1,description:""},ac2:{type:"number",isOptional:!1,description:""},ac3:{type:"number",isOptional:!1,description:""},ac4:{type:"number",isOptional:!1,description:""},pp1:{type:"number",isOptional:!1,description:""},pp2:{type:"number",isOptional:!1,description:""},pp3:{type:"number",isOptional:!1,description:""},pp4:{type:"number",isOptional:!1,description:""},fc1:{type:"number",isOptional:!1,description:""},fc2:{type:"number",isOptional:!1,description:""},fc3:{type:"number",isOptional:!1,description:""},fc4:{type:"number",isOptional:!1,description:""},pl1:{type:"number",isOptional:!1,description:""},pl2:{type:"number",isOptional:!1,description:""},pl3:{type:"number",isOptional:!1,description:""},pl4:{type:"number",isOptional:!1,description:""}}}}prepareMeasureScale(){return g(this.measureScale)?"GREATEST":["_","k","M","G","T","P","E","Z","Y","m","μ","n","p","P","f","a","z","y"].includes(this.measureScale.trim())||"LEAST"===this.measureScale.trim().toUpperCase()?this.measureScale.trim():"GREATEST"}prepareShowMeasureScale(i){return 0===i&&"true"===this.showMeasureScale}prepareMeasureUnit(){return""===this.measureUnit||null==this.measureUnit?"":this.measureUnit}chartTemplate(i,e){const s=this.getEffectiveScaleFactor(),a=this.preparePixelPerUnit(),n=this.preparePixelPerPercentage();return t("ibcs-chart-structure",{data:this.data,chartTitle:this.prepareChartTitle(e),scenarios:this.prepareScenarios(),variances:[i],hideCategories:this.prepareHideCategories(e),pixelPerUnit:a>0?a*s:0,pixelPerPercentage:n>0?n*s:0,limit:this.prepareLimit(),styles:this.prepareStyle(),i18n:this.prepareI18n(),order:this.prepareOrder(),level:this.prepareLevel(),filter:this.prepareFilter(),"measure-scale":this.prepareMeasureScale(),"measure-unit":this.prepareMeasureUnit(),showMeasureScale:this.prepareShowMeasureScale(e),stackConfig:this.prepareStackConfig(),parentDimensions:this.prepareDimension()})}getEffectiveScaleFactor(){const{mode:i,factor:t}=y(this.scale);return"factor"===i?t:"auto"===i||"empty"===i?this.appliedScaleFactor:1}getFontStyles(){const i=this.getEffectiveScaleFactor();return this.componentStyle((t=>{var e,s,a,n;const r=(null===(e=t.global)||void 0===e?void 0:e.fontSizePx)||13.3333;return{"--bn-font-family":(null===(s=t.global)||void 0===s?void 0:s.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":r*i+"px","--bn-font-color":(null===(a=t.global)||void 0===a?void 0:a.fontColor)||"#000000","--bn-font-background":(null===(n=t.global)||void 0===n?void 0:n.fontBackgroundColor)||"#ffffff"}}))}render(){let i=[""];const s=this.prepareVariances();s.length>0&&(i=[...i,...s]);const a=this.getFontStyles();return t(e,{key:"c8ad939fbe92ab4a01af1e5ce17e097dbb5eab56",style:a},t("div",{key:"d786c49dd808c2dd9093ede7100e16ac52f50689",class:"container"},i.map(this.chartTemplate)))}get element(){return s(this)}static get watchers(){return{scenarios:[{validateScenario:0}],variances:[{validateVariances:0}],unitScaling:[{validateUnitScaling:0}],percentageScaling:[{validatePercentageScaling:0}],level:[{validateLevel:0}],order:[{validateOrderList:0}],orderDirection:[{validateOrderDirection:0}],limit:[{validateLimit:0}],showCategories:[{validateShowCategories:0}],measureScale:[{validateMeasureScale:0}],showMeasureScale:[{validateShowMeasureScale:0}],stack:[{validateStack:0}],scale:[{validateScaling:0}]}}};E.style=':host{display:inline-block;position:relative;overflow:hidden}.container{display:flex;flex-direction:row}.background-image{display:flex;flex-wrap:wrap;justify-content:flex-end}.categories{text-align:right;font-size:var(--bn-font-size, 1em);font-family:var(--bn-font-family, "Noto Sans", "Helvetica Neue", Helvetica, sans-serif);color:var(--bn-font-color, black)}.label-bg{fill:var(--bn-font-background, white);opacity:0.7}.label-text{text-align:right;font-size:var(--bn-font-size, 1em);font-family:var(--bn-font-family, "Noto Sans", "Helvetica Neue", Helvetica, sans-serif);color:var(--bn-font-color, black)}.axis-title{text-align:center;font-family:var(--bn-font-family, "Noto Sans", "Helvetica Neue", Helvetica, sans-serif);color:var(--bn-font-color, black)}.axis-ac{stroke:black;stroke-width:0.1em}.axis-pp{stroke:grey;stroke-width:0.1em}.axis-fc{stroke:black;stroke-dasharray:2;stroke-width:0.1em}.axis-pl{stroke:white;stroke-width:0.1em;outline-offset:0em;outline:0.1em solid black}canvas{image-rendering:-moz-crisp-edges;image-rendering:-webkit-crisp-edges;image-rendering:pixelated;image-rendering:crisp-edges}.measure{font-weight:bold}span{display:inline-block}.hidePatternContainer{height:0;width:0}div{float:left}.warning{font-size:0.8em;font-style:italic}.footer{margin:0.2em;font-size:0.6em}.footer-hide{margin:0.2em;font-size:0.6em;opacity:0}';export{E as bn_chart_structure}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g as t,r as s,h as a,H as e}from"./p-JNHhIe7t.js";import{g as o,c as n}from"./p-DRikHQE-.js";import{r,w as i}from"./p-tzFCK9qn.js";import{w as c}from"./p-DG-1MR_T.js";import{a as u}from"./p-BYmPQYxx.js";import{w as l}from"./p-CYjZRKdI.js";import"./p-BFTU3MAI.js";const p=["ac1","ac2","ac3","ac4","pp1","pp2","pp3","pp4","fc1","fc2","fc3","fc4","pl1","pl2","pl3","pl4"],h=["rowGroup","category","subCategory","columnGroup","columnSubGroup"];function f(t){return"number"==typeof t&&!isNaN(t)&&isFinite(t)}function m(t){const s=Array.from(t);return{distinctValues:s,count:s.length,hasData:s.length>0}}const d=class{constructor(a){s(this,a),this.datasources="",this.static=!1,l(this),this.errors=i(this),this.database=new u.Database,((s,a)=>{let e,i,c=[];const u=new MutationObserver((e=>{e.forEach((e=>{"datasources"===e.attributeName&&(c=(t(s).getAttribute("datasources")||"").split(","),c.forEach((t=>{a(t,i.datasources.get(t))})))}))})),l=s.connectedCallback;s.connectedCallback=()=>{const n=t(s);i=o(n),c=(n.getAttribute("datasources")||"").split(","),c.forEach((t=>{a(t,i.datasources.get(t))})),u.observe(n,{attributes:!0,attributeFilter:["datasources"]}),e=i.datasources.on("set",((t,s)=>{c.includes(t)&&a(t,s)})),r(l,s)};const p=s.disconnectedCallback;s.disconnectedCallback=()=>{u.disconnect(),r(e),n(t(s)),r(p,s)}})(this,((t,s)=>{this.database.tables[t]={data:s},this.executeQuery()})),c(this,(t=>{this.query=t,this.executeQuery()}))}executeQuery(){if(this.stores||(this.stores=o(this.element)),this.query&&this.name){let t;if(this.static)try{t=JSON.parse(this.query)}catch(s){console.error("Failed to parse static dataset",s),t=[]}else t=this.database.exec(this.query);this.latestResult!==t&&(this.latestResult=t,this.stores.datasets.set(this.name,t),this.stores.datasetsMeta.set(this.name,function(t){const s={};for(const t of h)s[t]=new Set;const a={};for(const t of p)a[t]={hasData:!1,min:null,max:null};const e=new Set;let o=null,n=null;const r=Array.isArray(t)?t:[];for(let t=0;t<r.length;t++){const i=r[t];if(null==i)continue;for(const t of h){const a=i[t];null!=a&&""!==a&&s[t].add(String(a))}for(const t of p){const s=i[t];if(f(s)){const e=a[t];e.hasData=!0,(null===e.min||s<e.min)&&(e.min=s),(null===e.max||s>e.max)&&(e.max=s)}}const c=i.date;if(null!=c&&""!==c){const t=String(c);e.add(t),(null===o||t<o)&&(o=t),(null===n||t>n)&&(n=t)}}const i=p.map((t=>({key:t,hasData:a[t].hasData,min:a[t].min,max:a[t].max}))),c=i.filter((t=>t.hasData)).map((t=>t.key)),u=m(s.rowGroup),l=m(s.category),d=m(s.subCategory),g=m(s.columnGroup),y=m(s.columnSubGroup),b={min:o,max:n,hasData:e.size>0,distinctCount:e.size};let w="category";return d.hasData?w="subCategory":l.hasData?w="category":u.hasData&&(w="rowGroup"),{rowCount:r.length,scenarios:i,availableScenarios:c,rowGroup:u,category:l,subCategory:d,columnGroup:g,columnSubGroup:y,dateRange:b,suggestedLevel:w,suggestedOrder:w,suggestedDateInterval:b.hasData?"auto":null,calculatedAt:Date.now()}}(t)))}}nameUpdated(){this.executeQuery()}render(){return a(e,{key:"0aecc50d8aa488f49d6630fec9f0755d306f213e"})}get element(){return t(this)}static get watchers(){return{name:[{nameUpdated:0}]}}};d.style="bn-dataset{display:none}";export{d as bn_dataset}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,h as e,H as r,g as s}from"./p-JNHhIe7t.js";import{f as i,w as o}from"./p-DtdQCMzj.js";import{w as n}from"./p-CYjZRKdI.js";import{w as a}from"./p-BSfqOkN_.js";import{w as d}from"./p-tzFCK9qn.js";import"./p-sqjrku2z.js";import"./p-B4ySv9KQ.js";import"./p-DRikHQE-.js";function l(t){if(!t||""===t.trim()||"[]"===t)return[];try{const e=JSON.parse(t);return Array.isArray(e)?e.map(((t,e)=>{var r,s,i;return"string"==typeof t?{label:t,id:String(e)}:"object"==typeof t&&null!==t?{label:null!==(s=null!==(r=t.label)&&void 0!==r?r:t.name)&&void 0!==s?s:String(e),id:null!==(i=t.id)&&void 0!==i?i:String(e)}:{label:String(t),id:String(e)}})):[]}catch(t){return console.error("parseHeaders: failed to parse JSON",t),[]}}function h(t){if(!t||""===t.trim()||"[]"===t)return[];try{const e=JSON.parse(t);if(!Array.isArray(e))return["Headers must be an array"];const r=[],s=new Set;return e.forEach(((t,e)=>{"object"==typeof t&&null!==t&&void 0!==t.id&&("string"!=typeof t.id?r.push(`Header[${e}]: 'id' must be a string`):s.has(t.id)?r.push(`Header[${e}]: duplicate id '${t.id}'`):s.add(t.id),void 0!==t.label&&"string"!=typeof t.label&&r.push(`Header[${e}]: 'label' must be a string`))})),r}catch(t){return console.error("validateHeadersJson: failed to parse JSON",t),["Invalid JSON structure"]}}const u=class{validateRowHeaders(t){const e="ERR_rowHeaders",r=h(t);r.length>0?this.errors.addOrReplace({id:e,type:"error",message:`row-headers: ${r.join("; ")}`}):this.errors.remove(e),this.updateGridConfig()}validateColumnHeaders(t){const e="ERR_columnHeaders",r=h(t);r.length>0?this.errors.addOrReplace({id:e,type:"error",message:`column-headers: ${r.join("; ")}`}):this.errors.remove(e),this.updateGridConfig()}validateShowRowHeaders(t){const e="ERR_showRowHeaders";i(t)?this.errors.remove(e):this.errors.addOrReplace({id:e,type:"warning",message:`show-row-headers: invalid value '${t}', must be 'true' or 'false'`})}validateShowColumnHeaders(t){const e="ERR_showColumnHeaders";i(t)?this.errors.remove(e):this.errors.addOrReplace({id:e,type:"warning",message:`show-column-headers: invalid value '${t}', must be 'true' or 'false'`})}validateShowBorders(t){const e="ERR_showBorders";i(t)?this.errors.remove(e):this.errors.addOrReplace({id:e,type:"warning",message:`show-borders: invalid value '${t}', must be 'true' or 'false'`})}constructor(e){t(this,e),this.gridConfig={rows:[],columns:[]},this.chartTitle="",this.rowHeaders="[]",this.columnHeaders="[]",this.showRowHeaders="true",this.showColumnHeaders="true",this.showBorders="true",this.rowHeaderWidth="auto",this.cellGap="0px",o(this),n(this),this.errors=d(this),this.componentStyle=a(this)}getGridStyle(){return this.componentStyle((t=>t["bn-grid"]))}componentWillLoad(){this.validateRowHeaders(this.rowHeaders),this.validateColumnHeaders(this.columnHeaders),this.validateShowRowHeaders(this.showRowHeaders),this.validateShowColumnHeaders(this.showColumnHeaders),this.validateShowBorders(this.showBorders)}updateGridConfig(){var t;this.gridConfig=(t=this.columnHeaders,{rows:l(this.rowHeaders),columns:l(t)})}shouldShowRowHeaders(){return"true"===this.showRowHeaders&&this.gridConfig.rows.length>0}shouldShowColumnHeaders(){return"true"===this.showColumnHeaders&&this.gridConfig.columns.length>0}shouldShowBorders(){return"true"===this.showBorders}getGridTemplateColumns(){const t=[];this.shouldShowRowHeaders()&&t.push(this.rowHeaderWidth);const e=this.gridConfig.columns.length||1;for(let r=0;r<e;r++)t.push("auto");return t.join(" ")}getGridTemplateRows(){const t=[];this.chartTitle&&t.push("auto"),this.shouldShowColumnHeaders()&&t.push("auto");const e=this.gridConfig.rows.length||1;for(let r=0;r<e;r++)t.push("auto");return t.join(" ")}renderTitle(){if(!this.chartTitle)return null;const t=(this.shouldShowRowHeaders()?1:0)+this.gridConfig.columns.length;return e("div",{class:"grid-title",style:{"grid-column":`1 / span ${t}`,"grid-row":"1"}},this.chartTitle)}renderColumnHeaders(){if(!this.shouldShowColumnHeaders())return null;const t=this.getGridStyle(),r=this.shouldShowBorders()?`${t.borderWidth}px solid ${t.borderColor}`:"none",s=this.shouldShowRowHeaders()?2:1,i=this.chartTitle?2:1;return this.gridConfig.columns.map(((o,n)=>{const a=n>0;return e("div",{key:`col-header-${o.id}`,class:"grid-header grid-header-col",style:{"grid-column":String(s+n),"grid-row":String(i),"border-left":a?r:"none",padding:`${t.cellPadding}px`,"padding-left":a?`${t.cellPadding+4}px`:`${t.cellPadding}px`}},o.label)}))}renderDataCells(){const t=this.getGridStyle(),r=this.shouldShowBorders()?`${t.borderWidth}px solid ${t.borderColor}`:"none",s=this.shouldShowRowHeaders()?2:1,i=(this.chartTitle?1:0)+(this.shouldShowColumnHeaders()?1:0)+1,o=[];return this.gridConfig.rows.length>0&&this.gridConfig.columns.length>0&&this.gridConfig.rows.forEach(((n,a)=>{if(this.shouldShowRowHeaders()){const s=a>0;o.push(e("div",{key:`row-header-${n.id}`,class:"grid-header grid-header-row",style:{"grid-column":"1","grid-row":String(i+a),"border-top":s?r:"none",padding:`${t.cellPadding}px`,"padding-top":s?`${t.cellPadding+4}px`:`${t.cellPadding}px`}},n.label))}this.gridConfig.columns.forEach(((d,l)=>{const h=function(t,e){return`${t.id}-${e.id}`}(n,d),u=l>0,c=a>0;o.push(e("div",{key:`cell-${h}`,class:"grid-cell",style:{"grid-column":String(s+l),"grid-row":String(i+a),"border-left":u?r:"none","border-top":c?r:"none","padding-left":u?`${t.cellPadding+4}px`:"0","padding-top":c?`${t.cellPadding+4}px`:"0"}},e("slot",{name:h})))}))})),o}getFontStyles(){return this.componentStyle((t=>{var e,r,s,i;return{"--bn-font-family":(null===(e=t.global)||void 0===e?void 0:e.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":`${(null===(r=t.global)||void 0===r?void 0:r.fontSizePx)||13.3333}px`,"--bn-font-color":(null===(s=t.global)||void 0===s?void 0:s.fontColor)||"#000000","--bn-font-background":(null===(i=t.global)||void 0===i?void 0:i.fontBackgroundColor)||"#ffffff"}}))}render(){const t={display:"inline-grid","grid-template-columns":this.getGridTemplateColumns(),"grid-template-rows":this.getGridTemplateRows(),gap:this.cellGap};return e(r,{key:"e84402bafd778e7069cd17bd86687a6648dbafe0",style:this.getFontStyles()},e("div",{key:"91941a42bc41fbbaf53c66551035bf97765a9f88",class:"grid-container",style:t},this.renderTitle(),this.renderColumnHeaders(),this.renderDataCells()),e("slot",{key:"349958090f4bf35b9ec768c8994bdf5a96636a36"}))}get element(){return s(this)}static get watchers(){return{rowHeaders:[{validateRowHeaders:0}],columnHeaders:[{validateColumnHeaders:0}],showRowHeaders:[{validateShowRowHeaders:0}],showColumnHeaders:[{validateShowColumnHeaders:0}],showBorders:[{validateShowBorders:0}]}}};u.style=':host{display:inline-block;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000)}.grid-container{display:inline-grid;box-sizing:border-box}.grid-title{font-weight:normal;padding-bottom:8px}.grid-header{display:flex;align-items:flex-end;box-sizing:border-box}.grid-header-row{justify-content:flex-end;padding-right:8px}.grid-header-col{white-space:nowrap;justify-content:flex-start}.grid-cell{position:relative;box-sizing:border-box}';export{u as bn_grid}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,h as i,H as s,g as h}from"./p-JNHhIe7t.js";import{S as e,g as n,a as r,b as o,c as a,I as l,F as c,d as u,e as d,f,P as p}from"./p-C0yAPzJz.js";import{d as v,e as g,k as w,A as b,b as P,l as m,a as S,O as y}from"./p-sqjrku2z.js";import{D as L,S as x,b as M}from"./p-BL8gyUwE.js";import{F as k,C as T,V as C}from"./p-1jFf17Vj.js";import{a as A}from"./p-BYmPQYxx.js";import{S as $,I as _}from"./p-8tsCnxIz.js";import"./p-BFTU3MAI.js";class O{constructor(t,i,s,h,e,n,r,o){this.categoryPosition={x:0,y:0},this.spacings={scenarioOffset:0,markerOffset:0,scenarioLabelToBar:0,labelToBar:0,labelToAxis:0,needleWidth:0,needleHeadWidth:0,barWidth:0,varianceAxisLineWidth:0,axisLineWidth:0,auxiliaryLineWidth:0,scenarioLineWidth:0,markerWidth:0,categoryWidth:0,axisTickLength:0},this.categoriesBoxOffset={width:0,height:0},this.padding=t,this.scaleFactors=i,this.fontSize=s,this.axisPosition={x:0,y:0},this.numberOfColumns=h,this.leftSideLengthSync=e,this.topSideLabelHeight=n>0?this.fontSize:0,this.leftSideLabelLength=this.calculateSideLabelLength(n,r,o),this.calculateSpacings(),this.calculateCategoryPosition(),this.calculateAxisPosition()}getBarPositionX(){return this.axisPosition.x}getBarCenterPositionY(t){return this.categoryPosition.y+this.spacings.scenarioOffset+t*this.spacings.categoryWidth}getBarPositionY(t,i){return i?this.getBarCenterPositionY(t):this.getBarCenterPositionY(t)-this.spacings.scenarioOffset}getCategoryPositionX(t){let i=this.spacings.labelToAxis;return t&&(i=-this.spacings.labelToAxis),this.getAxisPositionX()+i}getAxisTitlePositionX(){return this.axisPosition.x}getAxisTitlePositionY(){return this.axisPosition.y-this.spacings.labelToAxis}getNeedleWidth(){return this.spacings.needleWidth}getAxisPositionX(){return this.leftSideLabelLength+this.padding.left+this.spacings.labelToAxis}getAxisPositionY(){return this.padding.top+this.getAxisTitleOffset()}loadCategoriesBox(t){this.categoriesBoxOffset=t,this.calculateAxisPosition()}addOffsetByNegativeDataPoints(t,i,s,h){null!=t&&null!=t.value&&t.value<0&&(s&&t.isClipped()?this.axisPosition.x+=Math.abs(t.getClippedValue()*t.pixelPerUnit):this.axisPosition.x+=Math.abs(t.value*t.pixelPerUnit),this.axisPosition.x+=i,this.axisPosition.x+=this.spacings.labelToBar),this.axisPosition.x<h/2&&(this.axisPosition.x=h/2+this.spacings.labelToBar)}getLabelPositionX(t){let i=this.spacings.labelToBar;return t<0&&(i*=-1),this.axisPosition.x+t+i}getLabelPositionY(t){return this.axisPosition.y+t+this.spacings.labelToBar}getCategoryToAxisSpaceing(){return this.spacings.labelToAxis}getCategoryToTopSpaceing(){return this.spacings.scenarioOffset}getCategoryToBottomSpaceing(){return this.spacings.scenarioOffset}getAxisEndPositionY(){return this.getAxisPositionY()+(this.numberOfColumns+.5)*this.spacings.categoryWidth}getScenarioLabelPositionOffsetY(t){return t?.5*this.getBarWidth()+this.spacings.scenarioLabelToBar:-(.5*this.getBarWidth()+this.spacings.scenarioLabelToBar)}getBarWidth(){return this.spacings.barWidth}getMarkerPositionY(t,i){return i?this.getBarCenterPositionY(t)-this.spacings.markerOffset-.5*this.getBarWidth():this.getBarCenterPositionY(t)+this.spacings.markerOffset+.5*this.getBarWidth()}getMarkerPositionX(){return this.getBarPositionX()}getMarkerScenarioLabelPositionOffsetY(t){return t?-(.5*this.spacings.markerWidth+this.spacings.scenarioLabelToBar):this.spacings.scenarioLabelToBar+.5*this.spacings.markerWidth}getAxisEndPositionX(){return this.getAxisPositionX()}calculateSpacings(){this.spacings={scenarioOffset:this.fontSize*this.scaleFactors.scenarioOffset,markerOffset:this.fontSize*this.scaleFactors.markerOffset,scenarioLabelToBar:this.fontSize*this.scaleFactors.scenarioLabelToBar,labelToBar:this.fontSize*this.scaleFactors.labelToBar,labelToAxis:this.fontSize*this.scaleFactors.labelToAxis,needleWidth:this.fontSize*this.scaleFactors.needleWidth,needleHeadWidth:this.fontSize*this.scaleFactors.needleHeadWidth,barWidth:this.fontSize*this.scaleFactors.barWidth,varianceAxisLineWidth:this.fontSize*this.scaleFactors.varianceAxisLineWidth,axisLineWidth:this.fontSize*this.scaleFactors.axisLineWidth,auxiliaryLineWidth:this.fontSize*this.scaleFactors.auxiliaryLineWidth,scenarioLineWidth:this.fontSize*this.scaleFactors.scenarioLineWidth,markerWidth:this.fontSize*this.scaleFactors.markerWidth,categoryWidth:this.fontSize*this.scaleFactors.categoryWidth,axisTickLength:this.fontSize*this.scaleFactors.axisTickLength}}calculateCategoryPosition(){this.categoryPosition={x:this.padding.left,y:this.getAxisPositionY()+.5*this.spacings.categoryWidth}}calculateAxisPosition(){this.axisPosition={x:this.getAxisPositionX(),y:this.getAxisPositionY()}}recalculatePositions(){this.calculateCategoryPosition(),this.calculateAxisPosition()}getAxisTitleOffset(){return this.topSideLabelHeight}calculateSideLabelLength(t,i,s){if(this.leftSideLengthSync)return this.leftSideLengthSync;const h=t/2;let e=i;return h>e&&(e=h),s>e&&(e=s),e}}class E{constructor(t){this.top=t.top,this.bottom=t.bottom,this.left=t.left,this.right=t.right}addBoxTopLeft(t){return this.top+=t.height|this.top,this.left+=t.width|this.top,this}}class R{constructor(t){const i=1*t,s=.7*t;this.bgOffset=(i-s)/2,this.markerUp={top:s/2+",0",left:"0,"+s,right:s+","+s},this.markerUpBackground={top:i/2+",0",left:"0,"+i,right:i+","+i},this.markerDown={bottom:s/2+","+s,left:"0,0",right:s+",0"},this.markerDownBackground={bottom:i/2+","+i,left:"0,0",right:i+",0"}}upMarkerPatternStrings(){return{background:this.markerUpBackground.left+" "+this.markerUpBackground.right+" "+this.markerUpBackground.top+" "+this.markerUpBackground.left,foreground:this.markerUp.left+" "+this.markerUp.right+" "+this.markerUp.top+" "+this.markerUp.left,bgOffset:this.bgOffset}}downMarkerPatternStrings(){return{background:this.markerDownBackground.left+" "+this.markerDownBackground.right+" "+this.markerDownBackground.bottom+" "+this.markerDownBackground.left,foreground:this.markerDown.left+" "+this.markerDown.right+" "+this.markerDown.bottom+" "+this.markerDown.left,bgOffset:this.bgOffset}}createPatternMapForStructureBar(){const t=new Map;return t.set("marker-up",this.upMarkerPatternStrings()),t.set("marker-down",this.downMarkerPatternStrings()),t}}class W{constructor(t){this.container=new e,this.pattern=this.createFCPattern(this.container.group(),t),this.styles=t;let i=10;null!=t&&null!=t.fontStyles&&t.fontStyles.size&&(i=t.fontStyles.size),this.bgOffset=(1*i-.7*i)/2}createFCPattern(t,i){const s=i;return t.pattern(10,10,(function(t){t.rect(10,10).fill(s.barStyles.fc.fill),t.line(0,5,5,0).stroke({width:s.barStyles.fc.width,color:s.barStyles.fc.stroke,linecap:"square"}),t.line(5,10,10,5).stroke({width:s.barStyles.fc.width,color:s.barStyles.fc.stroke,linecap:"square"})})).id("pattern-structure-fc")}getFCPolygonPattern(){return{background:"",foreground:"",bgOffset:0,pattern:this.pattern}}toString(){return this.container.svg()}}var D,B,N,X,Y;!function(t){t[t.UP_TO_DATE=0]="UP_TO_DATE",t[t.DIRTY=1]="DIRTY"}(D||(D={})),function(t){t.RELATIVE="dr",t.ABSOLUTE="d",t.NONE=""}(B||(B={}));class V{constructor(t,i){this.data=t,this.scenarios=i,this.variances=[],this.title="",this.hideCategories=!1,this.pixelPerUnit=10,this.pixelPerPercentage=50,this.limit=0,this.sortOrder=new w(new $).default(),this.level=b.CATEGORY,this.filter="",this.measureScale=new x,this.measureUnit="",this.showMeasureScale=!0,this.dataFormatDigits={decimal:1,percent:2},this.stackConfig=null}}class F{constructor(t,i,s,h,e){this.dataRowAdapter=t,this.orderAdapter=i,this.stringAdapter=s,this.dataFormatDigitsAdapter=h,this.dataSet=e}adapt(t){const i=v.adaptArray(t.data,this.dataRowAdapter),s=v.adaptArray(t.scenarios,this.stringAdapter),h=new V(i,s);return g.isArray(t.variances)&&(h.variances=v.adaptArray(t.variances,this.stringAdapter)),g.isString(t.title)&&(h.title=t.title),g.isBoolean(t.hideCategories)&&(h.hideCategories=t.hideCategories),g.isNumber(t.pixelPerUnit)&&(h.pixelPerUnit=t.pixelPerUnit),g.isNumber(t.pixelPerPercentage)&&(h.pixelPerPercentage=t.pixelPerPercentage),g.isNumber(t.limit)&&(h.limit=t.limit),g.isExisting(t.sortOrder)&&(h.sortOrder=this.orderAdapter.adapt(t.sortOrder)),g.isExisting(t.level)&&(h.level=t.level),g.isString(t.filter)&&(h.filter=t.filter.trim()),g.isExisting(t.measureScale)&&(h.measureScale=L.calculateMeasureScale(this.dataSet,h.scenarios,t.measureScale)),g.isString(t.measureUnit)&&(h.measureUnit=t.measureUnit),g.isBoolean(t.showMeasureScale)&&(h.showMeasureScale=t.showMeasureScale),g.isExisting(t.dataFormatDigits)&&(h.dataFormatDigits=this.dataFormatDigitsAdapter.adapt(t.dataFormatDigits)),g.isExisting(t.stackConfig)&&(h.stackConfig=t.stackConfig),h}default(){return new V([],[])}}class H{constructor(t,i,s,h){this.value=t,this.scenario=i,this.pixelPerUnit=s||1,this.variance="neg"===h||h===N.NEG?N.NEG:"pos"===h||h===N.POS?N.POS:N.NEU}isEmpty(){return null==this.value||null==this.scenario}getScaledUnit(){return null==this.value?0:this.value*this.pixelPerUnit}getScaledPercentUnit(){return null==this.value?0:Math.abs(this.value)>1.45?this.value>=0?1.45*this.pixelPerUnit:-1.45*this.pixelPerUnit:this.value*this.pixelPerUnit}getVarianceStyle(){return null==this.value||this.value>=0?this.variance:N.NEU===this.variance?N.NEU:N.POS===this.variance?N.NEG:N.POS}isClipped(){return null!=this.value&&Math.abs(this.value)>1.45}getClippedValue(){return 145}getScenario(){var t;return null===(t=this.scenario)||void 0===t?void 0:t.slice(0,2)}}class G{constructor(){this.operation="+"}addRowGroup(t,i){this.rowGroup=t,this.rowGroupIndex=i}addCategory(t,i){this.category=t,this.categoryIndex=i}addSubCategory(t,i){this.subCategory=t,this.subCategoryIndex=i}addColumnGroup(t,i){this.columnGroup=t,this.columnGroupIndex=i}addSubColumnGroup(t,i){this.columnSubGroup=t,this.columnSubGroupIndex=i}}class z{constructor(){}adapt(t){const i=new G;return g.isOperator(t.operation)&&(i.operation=t.operation),g.isNumber(t.rowGroupIndex)&&g.isString(t.rowGroup)&&i.addRowGroup(t.rowGroup,t.rowGroupIndex),g.isNumber(t.categoryIndex)&&g.isString(t.category)&&i.addCategory(t.category,t.categoryIndex),g.isNumber(t.subCategoryIndex)&&g.isString(t.subCategory)&&i.addSubCategory(t.subCategory,t.subCategoryIndex),g.isNumber(t.columnGroupIndex)&&g.isString(t.columnGroup)&&i.addColumnGroup(t.columnGroup,t.columnGroupIndex),g.isNumber(t.columnSubGroupIndex)&&g.isString(t.columnSubGroup)&&i.addSubColumnGroup(t.columnSubGroup,t.columnSubGroupIndex),this.setActualValues(t,i),this.setPlanValues(t,i),this.setPreviousPeriodValues(t,i),this.setForecastValues(t,i),i}default(){return new G}setActualValues(t,i){g.isNumber(t.ac1)&&(i.ac1=t.ac1),g.isNumber(t.ac2)&&(i.ac2=t.ac2),g.isNumber(t.ac3)&&(i.ac3=t.ac3),g.isNumber(t.ac4)&&(i.ac4=t.ac4)}setPlanValues(t,i){g.isNumber(t.pl1)&&(i.pl1=t.pl1),g.isNumber(t.pl2)&&(i.pl2=t.pl2),g.isNumber(t.pl3)&&(i.pl3=t.pl3),g.isNumber(t.pl4)&&(i.pl4=t.pl4)}setPreviousPeriodValues(t,i){g.isNumber(t.pp1)&&(i.pp1=t.pp1),g.isNumber(t.pp2)&&(i.pp2=t.pp2),g.isNumber(t.pp3)&&(i.pp3=t.pp3),g.isNumber(t.pp4)&&(i.pp4=t.pp4)}setForecastValues(t,i){g.isNumber(t.fc1)&&(i.fc1=t.fc1),g.isNumber(t.fc2)&&(i.fc2=t.fc2),g.isNumber(t.fc3)&&(i.fc3=t.fc3),g.isNumber(t.fc4)&&(i.fc4=t.fc4)}}class U{constructor(t,i,s,h,e,n){this.scaleFactors=t,this.fontStyles=i,this.axisStyles=s,this.barStyles=h,this.varianceStyles=e,this.padding=n,this.pattern=new Map}}class I{constructor(t,i,s,h,e){this.scaleFactorsStructureChartAdapter=t,this.fontStyleAdapter=i,this.svgStyleGroupAdapter=s,this.svgVariancesStyleGroupAdapter=h,this.paddingadapter=e}adapt(t){const i=new U(this.scaleFactorsStructureChartAdapter.default(),this.fontStyleAdapter.default(),this.svgStyleGroupAdapter.default(),this.svgStyleGroupAdapter.default(),this.svgVariancesStyleGroupAdapter.default(),this.paddingadapter.default());return g.isExisting(t)&&(g.isExisting(t.scaleFactors)&&(i.scaleFactors=this.scaleFactorsStructureChartAdapter.adapt(t.scaleFactors)),g.isExisting(t.fontStyles)&&(i.fontStyles=this.fontStyleAdapter.adapt(t.fontStyles)),g.isExisting(t.axisStyles)&&(i.axisStyles=this.svgStyleGroupAdapter.adapt(t.axisStyles)),g.isExisting(t.barStyles)&&(i.barStyles=this.svgStyleGroupAdapter.adapt(t.barStyles)),g.isExisting(t.varianceStyles)&&(i.varianceStyles=this.svgVariancesStyleGroupAdapter.adapt(t.varianceStyles)),g.isExisting(t.padding)&&(i.padding=this.paddingadapter.adapt(t.padding)),i.pattern=new R(i.fontStyles.size).createPatternMapForStructureBar()),i}default(){return new U(this.scaleFactorsStructureChartAdapter.default(),this.fontStyleAdapter.default(),this.svgStyleGroupAdapter.default(),this.svgStyleGroupAdapter.default(),this.svgVariancesStyleGroupAdapter.default(),this.paddingadapter.default())}}class j{constructor(){this.scenarioOffset=.3,this.scenarioLabelToBar=.1,this.labelToBar=.3,this.labelToAxis=.3,this.needleWidth=.3,this.needleHeadWidth=.6,this.barWidth=1.2,this.varianceAxisLineWidth=.3,this.axisLineWidth=.1,this.auxiliaryLineWidth=.1,this.scenarioLineWidth=.2,this.markerWidth=.7,this.markerOffset=0,this.categoryWidth=1.9,this.axisTickLength=.3}}class K{adapt(t){const i=new j;return g.isNumber(t.scenarioOffset)&&(i.scenarioOffset=t.scenarioOffset),g.isNumber(t.scenarioLabelToBar)&&(i.scenarioLabelToBar=t.scenarioLabelToBar),g.isNumber(t.labelToBar)&&(i.labelToBar=t.labelToBar),g.isNumber(t.labelToAxis)&&(i.labelToAxis=t.labelToAxis),g.isNumber(t.needleWidth)&&(i.needleWidth=t.needleWidth),g.isNumber(t.needleHeadWidth)&&(i.needleHeadWidth=t.needleHeadWidth),g.isNumber(t.barWidth)&&(i.barWidth=t.barWidth),g.isNumber(t.varianceAxisLineWidth)&&(i.varianceAxisLineWidth=t.varianceAxisLineWidth),g.isNumber(t.axisLineWidth)&&(i.axisLineWidth=t.axisLineWidth),g.isNumber(t.auxiliaryLineWidth)&&(i.auxiliaryLineWidth=t.auxiliaryLineWidth),g.isNumber(t.scenarioLineWidth)&&(i.scenarioLineWidth=t.scenarioLineWidth),g.isNumber(t.markerWidth)&&(i.markerWidth=t.markerWidth),g.isNumber(t.markerOffset)&&(i.markerOffset=t.markerOffset),g.isNumber(t.categoryWidth)&&(i.categoryWidth=t.categoryWidth),g.isNumber(t.axisTickLength)&&(i.axisTickLength=t.axisTickLength),i}default(){return new j}}!function(t){t.AC1="ac1",t.PP1="pp1",t.FC1="fc1",t.PL1="pl1",t.AC2="ac2",t.PP2="pp2",t.FC2="fc2",t.PL2="pl2",t.AC3="ac3",t.PP3="pp3",t.FC3="fc3",t.PL3="pl3",t.AC4="ac4",t.PP4="pp4",t.FC4="fc4",t.PL4="pl4",t.POS="pos",t.NEG="neg",t.NEU="neu"}(N||(N={})),function(t){t.LIST="LIST",t.SUM="SUM",t.OPT="OPT"}(X||(X={})),function(t){t[t.Left=0]="Left",t[t.Center=1]="Center",t[t.Right=2]="Right",t[t.Top=3]="Top",t[t.Bottom=4]="Bottom"}(Y||(Y={}));class q{constructor(t,i,s,h,e,n,r,o){this.group=null,this.segmentFillColor=null,this.ID_SCENARIOLABEL="Label",this.CSS_CATEGORIES="categories",this.x=i,this.y=s,this.value=e,null!=t&&(this.group=t.group().id(this.createElementID(t.toString(),h))),this.styles=n,this.isVarianceLabel=!1,this.isRelativeLabel=!1,this.verticalHookLocation=r||Y.Top,this.horizontalHookLocation=o||Y.Left}setToVarianceLabel(){return this.isVarianceLabel=!0,this}setToRelativeVarianceLabel(){return this.isVarianceLabel=!0,this.isRelativeLabel=!0,this}setSegmentFill(t){return this.segmentFillColor=t,this}updateGroup(t){return this.group=t,this}createElementID(t,i){return t+"_"+i+"_"+this.ID_SCENARIOLABEL}draw(t={percent:2,decimal:1},i=new x){if(this.isEmpty())return this;const s=this.group;let h;const e=this.styles.fontStyles.background||"#ffffff";let r="",o="start";if(!1===Number.isNaN(Number(this.value))){let s=t.percent,e=t.percent,n=1,a="percent";!1===this.isRelativeLabel&&(s=t.decimal,e=t.decimal,n=i.value,a="decimal"),h=k.number(Number(this.value),a,s,e,n),Number(this.value)<0&&(o="end"),this.isVarianceLabel&&Number(this.value)>=0&&(r="+")}else h=""+this.value,o="start";const a=s.text(r+h);a.move(this.x,this.y);const l=a.bbox().w,c=a.bbox().h;return this.horizontalHookLocation===Y.Right?(o="end",a.move(a.x()-a.length(),a.y())):this.horizontalHookLocation===Y.Center&&(o="middle",a.move(a.x()-a.length()/2,a.y())),this.verticalHookLocation===Y.Center?a.move(a.x(),a.y()-c/2):this.verticalHookLocation===Y.Bottom&&a.move(a.x(),a.y()-c),a.font({anchor:o}),null!=this.segmentFillColor?a.fill(n(this.segmentFillColor)):null==s||s.rect(l,.9*c).stroke(e).fill(e).opacity(.7).move(a.x(),a.y()+.1*c).insertBefore(a),this}isEmpty(){return null==this.value||""===this.value}setPos(t,i){return this.x=t,this.y=i,this}}class Z{constructor(t,i,s,h){this.height=0,this.ID_AXIS="axis",this.ID_AXIS_TITLE="axis-title",this.CSS_AXIS_TITLE="categories",this.scenarioType=t.scenarioType,this.labelText=t.labelText||null,this.position=i,this.style=h,this.label=new q(s,this.position.getAxisTitlePositionX(),this.position.getAxisTitlePositionY(),this.ID_AXIS_TITLE,this.labelText,this.style,Y.Bottom,Y.Center),this.svgGroup=s.group().id(this.ID_AXIS)}draw(){return this.labelText&&this.label.draw(),this.svgGroup.line(this.position.getAxisPositionX(),this.position.getAxisPositionY(),this.position.getAxisEndPositionX(),this.position.getAxisEndPositionY()).addClass(this.ID_AXIS+"-"+this.convertScenarioType()),this.height=this.svgGroup.height(),this}convertScenarioType(){return void 0===this.scenarioType||null==this.scenarioType?"default":`${this.scenarioType}`.slice(0,2)}}class J{constructor(t,i,s,h,e,n,r,o=null){if(this.ID_DATA_PREFIX="DATA",this.ID_SCENARIO_PREFIX="SCENARIO",this.ID_RECT="RECT",this.FALLBACK_COLOUR="#000000",this.label=null,this.scenarioLabel=null,this.barGroup=null,this.isVarianceBar=!1,this.overflowConfig=null,this.isOverflowing=!1,this.overdriveWidth=0,this.dimensions={barLength:0,xPos:0,yPos:0,labelXPos:0,scenarioLabelXPos:0,scenarioLabelYPos:0,clipped:!1},this.hasData=!1,this.dataPoint=s,this.index=h,this.isPrimaryBar=e,this.position=t,this.barStyles=i.barStyles,this.overflowConfig=o,this.scenarioGroup=n,this.styles=i,null!=n&&(this.barGroup=n.group().id(n.toString()+"_"+this.ID_RECT)),!0!==(null==s?void 0:s.isEmpty())&&null!=s.value){this.hasData=!0;let i=Y.Left;s.value<0&&(i=Y.Right),this.dimensions=this.createDimensions(t,s,h,e),this.label=new q(this.scenarioGroup,this.dimensions.labelXPos,this.dimensions.yPos,this.ID_DATA_PREFIX,s.value,this.styles,Y.Center,i),this.scenarioLabel=this.getScenarioLabel(r)}}setAsVariance(){var t;return this.isVarianceBar=!0,null===(t=this.label)||void 0===t||t.setToVarianceLabel(),this}isRelativeVariance(){var t;return this.isVarianceBar=!0,null===(t=this.label)||void 0===t||t.setToRelativeVarianceLabel(),this}updateLabelGroup(t){var i;return this.isEmpty()||null==t||null===(i=this.label)||void 0===i||i.updateGroup(t),this}draw(t={percent:2,decimal:1},i=new x){if(this.isEmpty()||null==this.dataPoint.getScenario())return this;let s=this.barStyles.getSVGStyle(this.dataPoint.getScenario());this.isVarianceBar&&(s=this.styles.varianceStyles.getSVGStyle(this.dataPoint.getVarianceStyle()));const h=this.convertToSVGStyle(s,"stroke");let e=this.convertToSVGStyle(s,"fill");const n=this.barStyles.getSVGStyle(this.dataPoint.getScenario()).fillpattern;if(null!=n){const t=this.styles.pattern.get(n);null!=t&&(e=t.pattern)}null!=this.barGroup&&(this.isOverflowing&&this.overflowConfig?this.drawOverdriveBar(e,h):this.barGroup.rect(this.dimensions.barLength,this.position.getBarWidth()).fill(e).stroke(h).cy(this.dimensions.yPos).x(this.dimensions.xPos)),this.drawBarDataLabel(t,i),this.drawScenarioLabel()}drawOverdriveBar(t,i){if(!this.barGroup||!this.overflowConfig)return;const s=this.position.getBarPositionX(),h=this.position.getBarWidth(),e=this.dimensions.barLength,{breakGap:n}=this.overflowConfig;this.dataPoint.getScaledUnit()<0?(this.barGroup.rect(e,h).fill(t).stroke(i).x(s-e).cy(this.dimensions.yPos),this.barGroup.rect(this.overdriveWidth,h).fill(t).stroke(i).x(s-e-n-this.overdriveWidth).cy(this.dimensions.yPos),this.drawBreakIndicator(s-e-n,n)):(this.barGroup.rect(e,h).fill(t).stroke(i).x(s).cy(this.dimensions.yPos),this.barGroup.rect(this.overdriveWidth,h).fill(t).stroke(i).x(s+e+n).cy(this.dimensions.yPos),this.drawBreakIndicator(s+e,n))}drawBreakIndicator(t,i){if(!this.barGroup)return;const s=this.position.getBarWidth(),h=this.dimensions.yPos-s/2,e=t+i/2,n=.35*i,r=s/3;let o=`M ${e-n} ${h}`;for(let t=0;t<3;t++)o+=` L ${e-n-.3*i} ${h+r*(t+.5)} L ${e-n} ${h+r*(t+1)}`;let a=`M ${e+n} ${h}`;for(let t=0;t<3;t++)a+=` L ${e+n+.3*i} ${h+r*(t+.5)} L ${e+n} ${h+r*(t+1)}`;this.barGroup.rect(i,s+2).fill("#ffffff").stroke("none").x(t).cy(this.dimensions.yPos),this.barGroup.path(o).fill("none").stroke({color:"#000000",width:1}),this.barGroup.path(a).fill("none").stroke({color:"#000000",width:1})}createDimensions(t,i,s,h){const e=i.getScaledUnit(),n=Math.abs(e);if(this.overflowConfig&&n>0){const r="ac"===i.getScenario()?this.overflowConfig.cutWidth:this.overflowConfig.cutWidth-this.overflowConfig.scenarioCutOffset;if(n>r){this.isOverflowing=!0;const{breakGap:i,overdriveZoneWidth:o,maxOverflow:a}=this.overflowConfig;this.overdriveWidth=a>0?(n-r)/a*o:0;const l=r+i+this.overdriveWidth;return e<0?{clipped:!1,barLength:r,xPos:t.getBarPositionX()-r,yPos:t.getBarPositionY(s,h),labelXPos:t.getLabelPositionX(-l),scenarioLabelXPos:t.getBarPositionX()-.5*r,scenarioLabelYPos:t.getBarPositionY(s,h)+t.getScenarioLabelPositionOffsetY(h)}:{clipped:!1,barLength:r,xPos:t.getBarPositionX(),yPos:t.getBarPositionY(s,h),labelXPos:t.getLabelPositionX(l),scenarioLabelXPos:t.getBarPositionX()+.5*r,scenarioLabelYPos:t.getBarPositionY(s,h)+t.getScenarioLabelPositionOffsetY(h)}}}return e<0?{clipped:!1,barLength:n,xPos:t.getBarPositionX()+e,yPos:t.getBarPositionY(s,h),labelXPos:this.position.getLabelPositionX(e),scenarioLabelXPos:this.position.getBarPositionX()-.5*n,scenarioLabelYPos:this.position.getBarPositionY(s,h)+this.position.getScenarioLabelPositionOffsetY(h)}:{clipped:!1,barLength:e,xPos:t.getBarPositionX(),yPos:t.getBarPositionY(s,h),labelXPos:this.position.getLabelPositionX(e),scenarioLabelXPos:this.position.getBarPositionX()+.5*n,scenarioLabelYPos:this.position.getBarPositionY(s,h)+this.position.getScenarioLabelPositionOffsetY(h)}}convertToSVGStyle(t,i){return null==t&&(t=[]),t.color=t[i]||this.FALLBACK_COLOUR,Object.assign({},t)}drawScenarioLabel(){null==this.scenarioLabel||this.scenarioLabel.isEmpty()||this.isVarianceBar||this.scenarioLabel.setPos(this.dimensions.scenarioLabelXPos,this.dimensions.scenarioLabelYPos).draw()}drawBarDataLabel(t,i=new x){var s;this.isPrimaryBar&&(null===(s=this.label)||void 0===s||s.draw(t,i))}isEmpty(){return!1===this.hasData||Number.isNaN(this.dataPoint.value)}getScenarioLabel(t){return new q(this.scenarioGroup,-1,-1,this.ID_SCENARIO_PREFIX,t,this.styles,this.isPrimaryBar?Y.Top:Y.Bottom,Y.Center)}}class Q{constructor(t,i,s,h,e,n,r,o,a){this.ID_DATA_PREFIX="DATA",this.ID_SCENARIO_PREFIX="SCENARIO",this.FALLBACK_COLOUR="#000000",this.scenarioLabel=null,this._defaultMarkerPattern=null,this.dimensions={barLength:0,xPos:0,yPos:0,labelXPos:0,scenarioLabelXPos:0,scenarioLabelYPos:0,clipped:!1},this.hasData=!1,this.position=t,this.markerGroup=i||null,this.markerPattern=s||this._defaultMarkerPattern,this.styles=e,this.barStyles=e?e.barStyles:null,this.scenario=h,!0!==(null==n?void 0:n.isEmpty())&&(this.hasData=!0,this.dimensions=this.createMarkerDimensions(n,r,a),this.scenarioLabel=this.getScenarioLabel(o,e,a))}createMarkerDimensions(t,i,s){return t.getScaledUnit()<0?{clipped:!1,labelXPos:0,barLength:Math.abs(t.getScaledUnit()),xPos:this.position.getMarkerPositionX()-Math.abs(t.getScaledUnit()),yPos:this.position.getMarkerPositionY(i,s),scenarioLabelXPos:this.position.getMarkerPositionX()-Math.abs(t.getScaledUnit()),scenarioLabelYPos:this.position.getMarkerPositionY(i,s)+this.position.getMarkerScenarioLabelPositionOffsetY(s)}:{clipped:!1,labelXPos:0,barLength:t.getScaledUnit(),xPos:this.position.getMarkerPositionX()+t.getScaledUnit(),yPos:this.position.getMarkerPositionY(i,s),scenarioLabelXPos:this.position.getMarkerPositionX()+t.getScaledUnit(),scenarioLabelYPos:this.position.getMarkerPositionY(i,s)+this.position.getMarkerScenarioLabelPositionOffsetY(s)}}getScenarioLabel(t,i,s){return null==this.markerGroup?null:new q(this.markerGroup,-1,-1,this.ID_DATA_PREFIX,t,i,s?Y.Bottom:Y.Top,Y.Center)}convertToSVGStyle(t,i){return null==t&&(t=[]),t.color=t[i]||this.FALLBACK_COLOUR,Object.assign({},t)}draw(){if(this.isEmpty())return this;const t=this.convertToSVGStyle(this.barStyles[this.getScenario()],"stroke");let i=this.convertToSVGStyle(this.barStyles[this.getScenario()],"fill");const s=this.barStyles[this.getScenario()];if(null!=s&&s.fillpattern){const t=this.styles.pattern.get(s.fillpattern);null!=t&&(i=t.pattern)}return this.markerGroup.polygon(this.markerPattern.background).fill("#ffffff").cy(this.dimensions.yPos).cx(this.dimensions.xPos),this.markerGroup.polygon(this.markerPattern.foreground).fill(i).stroke(t).cy(this.dimensions.yPos).cx(this.dimensions.xPos),null==this.scenarioLabel||this.scenarioLabel.isEmpty()||this.scenarioLabel.setPos(this.dimensions.scenarioLabelXPos,this.dimensions.scenarioLabelYPos).draw(),this}isEmpty(){return!1===this.hasData}getScenario(){var t;return null===(t=this.scenario)||void 0===t?void 0:t.slice(0,2)}}class tt{constructor(t,i,s,h,e){if(this.ID_DATA_PREFIX="DATA",this.ID_SCENARIO_PREFIX="SCENARIO",this.ID_RECT="RECT",this.FALLBACK_COLOUR="#000000",this.label=null,this.dimensions={barLength:0,xPos:0,yPos:0,labelXPos:0,scenarioLabelXPos:0,scenarioLabelYPos:0,clipped:!1},this.hasData=!1,this.dataPoint=s,this.index=h,this.position=t,this.barStyles=i.barStyles,this.scenarioGroup=e,this.styles=i,this.barGroup=e.group().id(e.toString()+"_"+this.ID_RECT),!0!==(null==s?void 0:s.isEmpty())&&null!=s.value){this.hasData=!0,this.dimensions=this.createDimensions(t,s,h);let i=Y.Left;s.value<0&&(i=Y.Right),this.label=new q(this.scenarioGroup,this.dimensions.labelXPos,this.dimensions.yPos,this.ID_DATA_PREFIX,s.value,this.styles,Y.Center,i),this.label.setToRelativeVarianceLabel()}}updateLabelGroup(t){var i;return this.isEmpty()||null==t||null===(i=this.label)||void 0===i||i.updateGroup(t),this}draw(){var t;if(this.isEmpty())return this;if(null==this.dimensions)return this;const i=this.styles.varianceStyles.getSVGStyle(this.dataPoint.getVarianceStyle()),s=i.stroke;let h=i.fill;const e=this.barStyles[this.dataPoint.getScenario()];if(null!=e&&e.fillpattern){const t=this.styles.pattern.get(e.fillpattern);null!=t&&null!=t.pattern&&(h=t.pattern)}this.drawNeedleHead(h,s),this.barGroup.rect(this.dimensions.barLength,this.position.getNeedleWidth()).fill(h).stroke(s).cy(this.dimensions.yPos).x(this.dimensions.xPos),null===(t=this.label)||void 0===t||t.draw()}createDimensions(t,i,s){return i.getScaledPercentUnit()<0?{barLength:Math.abs(i.getScaledPercentUnit()),xPos:t.getBarPositionX()+i.getScaledPercentUnit(),yPos:t.getBarCenterPositionY(s),labelXPos:this.position.getLabelPositionX(i.getScaledPercentUnit()-this.position.getNeedleWidth()),clipped:i.isClipped(),scenarioLabelXPos:0,scenarioLabelYPos:0}:{barLength:i.getScaledPercentUnit(),xPos:t.getBarPositionX(),yPos:t.getBarCenterPositionY(s),labelXPos:this.position.getLabelPositionX(i.getScaledPercentUnit()+this.position.getNeedleWidth()),clipped:i.isClipped(),scenarioLabelXPos:0,scenarioLabelYPos:0}}drawNeedleHead(t,i){if(null===this.dimensions)return;const s=this.styles.varianceStyles.needleHeadColour,h=this.styles.varianceStyles.needleHeadColour;if(this.dimensions.clipped){let s="13,0 4,-5 4,5 13,0 8,0 0,-5 0,5 8,0";null!=this.dataPoint.value&&this.dataPoint.value<0&&(s="0,0 9,-5 9,5 0,0 5,0 13,-5 13,5 5,0"),this.barGroup.polygon(s).fill(t).cx(this.getHeadXPosition()).cy(this.dimensions.yPos).fill(t).stroke(i)}else this.barGroup.rect(2*this.position.getNeedleWidth(),2*this.position.getNeedleWidth()).cx(this.getHeadXPosition()).cy(this.dimensions.yPos).fill(s).stroke(h)}isEmpty(){return!1===this.hasData||Number.isNaN(this.dataPoint.value)}getHeadXPosition(){let t=this.dimensions.xPos;return null!=this.dataPoint.value&&this.dataPoint.value>0&&(t+=this.dimensions.barLength),t}}class it{constructor(t,i,s,h,e,n,r,o,a,l,c){this.hasData=!1,this.position=t,this.styles=i,this.dataPoint=s,this.index=h,this.baselineValue=e,this.segmentIndex=r,this.stackMode=o,this.totalValue=a,this.group=c,this.barGroup=c.group().id(`stacked_bar_${h}_seg_${r}`),!0!==(null==s?void 0:s.isEmpty())&&null!=s.value&&(this.hasData=!0)}draw(t={percent:2,decimal:1},i=new x){if(!this.hasData||null==this.dataPoint.value)return;const s=this.dataPoint.value,h=this.dataPoint.pixelPerUnit,e=this.position.getBarPositionX(),n=this.position.getBarWidth();let a,l;if(this.stackMode===P.RELATIVE){const t=h;a=(0!==this.totalValue?Math.abs(s)/Math.abs(this.totalValue):0)*t,l=e+this.baselineValue/Math.abs(this.totalValue)*t}else a=Math.abs(s*h),l=e+this.baselineValue*h;const c=this.position.getBarPositionY(this.index,!0),u=r(this.segmentIndex),d={color:u},f={color:o(this.segmentIndex),width:.5};if(this.barGroup.rect(Math.max(a,.5),n).fill(d).stroke(f).cy(c).x(l),a>=30){const h=l+a/2;if(this.stackMode===P.RELATIVE||this.stackMode===P.ABSOLUTE_RELATIVE){const i=(0!==this.totalValue?s/this.totalValue*100:0).toFixed(t.percent)+"%";new q(this.group,h,c,"STACK_SEG",i,this.styles,Y.Center,Y.Center).setSegmentFill(u).draw()}else new q(this.group,h,c,"STACK_SEG",s,this.styles,Y.Center,Y.Center).setSegmentFill(u).draw(t,i)}}drawTotalLabel(t={percent:2,decimal:1},i=new x){if(this.stackMode===P.RELATIVE)return;const s=this.position.getBarPositionX()+this.totalValue*this.dataPoint.pixelPerUnit+this.position.spacings.labelToBar,h=this.position.getBarPositionY(this.index,!0);new q(this.group,s,h,"STACK_TOTAL",this.totalValue,this.styles,Y.Center,Y.Left).draw(t,i)}}class st{constructor(t,i,s,h,e){this.overflowConfig=null,this.i18n=e;const n=i.group().id("Scenario1"),r=i.group().id("Scenario2").insertBefore(n);this.svgGroups={parent:i,scenario1:n,scenario2:r,scenario3:i.group().id("Scenario3"),scenario4:i.group().id("Scenario4"),scenario1Label:i.group().id("label")},this.styles=s,this.position=t,this.elementCnt=h}setOverflowConfig(t){this.overflowConfig=t}isLastDataPoint(t){return this.elementCnt-1===t}isFirsttDataPoint(t){return 0===t}createPrimaryBar(t,i){var s,h,e,n;const r=null===(h=null===(s=this.svgGroups)||void 0===s?void 0:s.scenario1)||void 0===h?void 0:h.group().id(""+i),o=null===(n=null===(e=this.svgGroups)||void 0===e?void 0:e.scenario1Label)||void 0===n?void 0:n.group().id(""+i);let a=null;return this.isLastDataPoint(i)&&(a=`${this.i18n.get(t.scenario)||t.scenario}`),new J(this.position,this.styles,t,i,!0,r,a,this.overflowConfig).updateLabelGroup(o)}createVarianceBar(t,i){var s,h,e,n;const r=null===(h=null===(s=this.svgGroups)||void 0===s?void 0:s.scenario1)||void 0===h?void 0:h.group().id(""+i),o=null===(n=null===(e=this.svgGroups)||void 0===e?void 0:e.scenario1Label)||void 0===n?void 0:n.group().id(""+i);let a=null;return this.isLastDataPoint(i)&&(a=`${this.i18n.get(t.scenario)||t.scenario}`),new J(this.position,this.styles,t,i,!0,r,a,this.overflowConfig).updateLabelGroup(o).setAsVariance()}createRelativeVarianceBar(t,i){var s,h,e,n;const r=null===(h=null===(s=this.svgGroups)||void 0===s?void 0:s.scenario1)||void 0===h?void 0:h.group().id(""+i),o=null===(n=null===(e=this.svgGroups)||void 0===e?void 0:e.scenario1Label)||void 0===n?void 0:n.group().id(""+i);return new tt(this.position,this.styles,t,i,r).updateLabelGroup(o)}createSecondaryBar(t,i){var s,h;const e=null===(h=null===(s=this.svgGroups)||void 0===s?void 0:s.scenario2)||void 0===h?void 0:h.group().id(""+i);let n=null;return this.isFirsttDataPoint(i)&&(n=`${this.i18n.get(t.scenario)||t.scenario}`),new J(this.position,this.styles,t,i,!1,e,n,this.overflowConfig)}createPrimaryMarker(t,i){var s,h;const e=null===(h=null===(s=this.svgGroups)||void 0===s?void 0:s.scenario3)||void 0===h?void 0:h.group().id(""+i),n=this.styles.pattern.get("marker-down")||{foreground:"0,0 1,0 1,1 0,1",background:"0,0 1,0 1,1 0,1",bgOffset:0};let r=null;return this.isFirstDataPoint(i)&&(r=`${this.i18n.get(t.scenario)||t.scenario}`),new Q(this.position,e,n,t.scenario,this.styles,t,i,r,!0)}createSecondaryMarker(t,i){var s,h;const e=null===(h=null===(s=this.svgGroups)||void 0===s?void 0:s.scenario4)||void 0===h?void 0:h.group().id(""+i),n=this.styles.pattern.get("marker-up")||{foreground:"0,0 1,0 1,1 0,1",background:"0,0 1,0 1,1 0,1",bgOffset:0};let r=null;return this.isLastDataPoint(i)&&(r=`${this.i18n.get(t.scenario)||t.scenario}`),new Q(this.position,e,n,t.scenario,this.styles,t,i,r,!1)}isFirstDataPoint(t){return 0===t}}class ht{constructor(t,i,s){this.dataModel=[],this.variancesDataModel=[],this.title="",this.smallestDataPointValue=new H(0,N.AC1,1,N.NEU),this.highestDataPointValue=new H(0,N.AC1,1,N.NEU),this.smallestVarianceDataPointValue=new H(0,N.AC1,1,N.NEU),this.highestVarianceDataPointValue=new H(0,N.AC1,1,N.NEU),this.pixelPerUnit=1,this.pixelPerPercentage=1,this.hideCategories=!1,this.axisScenario=N.AC1,this.CSS_CATEGORIES="categories",this.preparedDataSet=[],this.state=D.DIRTY,this.titleLength=0,this.leftSideOffsetForHorizontalSync=0,this.limit=0,this.measureScale=new x,this.measureUnit="",this.dataFormatDigits={percent:2,decimal:1},this.stackConfig=null,this.overflowConfig=null,this.initSQLFunctions(),this.ruleSet=t||new _,this.i18n=this.createI18n(new Map),this.styles=s,this.setConfig(i),this.position=this.createElementPosition()}updatePosition(){this.position=this.createElementPosition()}createElementPosition(){this.titleLength=this.calculateTitleLength(0);let t=this.calculateLeftSideWidth(this.getVarianceType());const i=this.calculateCategoryWidth();return this.titleLength>t&&(t=this.titleLength),new O(new E(this.styles.padding),this.styles.scaleFactors,this.styles.fontStyles.size,this.dataModel.length,this.leftSideOffsetForHorizontalSync,this.titleLength,t,i)}initSQLFunctions(){A.fn.transformOperator=function(t){return"-"===t?-1:1}}setStyles(t){this.styles=t}setConfig(t){var i;this.state=D.DIRTY,this.sortScenariosbyVisualisationRules(t),this.hideCategories=t.hideCategories||!1,this.limit=t.limit,this.pixelPerUnit=t.pixelPerUnit||1,this.pixelPerPercentage=t.pixelPerPercentage||100,this.setData([...t.data],t.filter),this.dataModel=this.populateModel(t.scenarios,t.level,t.sortOrder),t.stackConfig&&t.stackConfig.by!==m.SCENARIO&&this.populateDimensionStackSegments(t.scenarios,t.stackConfig,t.level),this.variancesDataModel=this.populateVarianceModel(t.variances,this.dataModel),this.title=t.title||k.translateScenarioLabel(null===(i=null==t?void 0:t.variances)||void 0===i?void 0:i.toString(),this.i18n),this.smallestDataPointValue=this.findSmallestDataPointValue(this.dataModel),this.smallestVarianceDataPointValue=this.findSmallestDataPointValue(this.variancesDataModel),this.highestDataPointValue=this.findHighestDataPointValue(this.dataModel),this.highestVarianceDataPointValue=this.findHighestDataPointValue(this.variancesDataModel),this.axisScenario=this.setAxisScenario(t.variances),this.measureScale=t.measureScale,this.measureUnit=t.measureUnit,this.dataFormatDigits=t.dataFormatDigits,this.stackConfig=t.stackConfig,this.updatePosition()}sortScenariosbyVisualisationRules(t){const i=this;t.scenarios.sort(((t,s)=>i.ruleSet.getScenarioSorIndex(t)-i.ruleSet.getScenarioSorIndex(s))).reverse()}setI18n(t){this.i18n=this.createI18n(t)}createI18n(t){this.state=D.DIRTY;const i=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"],["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 new Map([...i,...t])}setData(t,i){if(null!=t)if(this.state=D.DIRTY,this.preparedDataSet.length=0,null!=i&&i.length>0)try{this.preparedDataSet=A(`SELECT * FROM ? WHERE ${i}`,[t])}catch(s){console.error("StructureChart: filter query failed, using unfiltered data",i,s),this.preparedDataSet=t}else this.preparedDataSet=t}getAllocatedCanvasWidth(){const t=this.position.getAxisPositionX(),i=this.calculateRightSideWidth(this.getVarianceType());let s=t+i+ +this.styles.padding.left+this.styles.padding.right;return i<this.titleLength/2&&(s+=this.titleLength/2),t<this.titleLength/2&&(s+=this.titleLength/2),s}getAllocatedCanvasHeight(){return(this.dataModel.length+1)*this.position.spacings.categoryWidth+this.styles.padding.top+this.styles.padding.bottom}patternToString(){return"<svg></svg>"}toString(){const t=new e;return this.draw(t),t.id("drawCanvas"),t.width(this.getAllocatedCanvasWidth()),t.height(this.getAllocatedCanvasHeight()),t.svg()}draw(t){this.cleanSVGforRedraw(t),this.state===D.DIRTY&&(this.state=D.UP_TO_DATE),this.variancesDataModel&&this.variancesDataModel.length>0?(this.drawVarianceScenario(this.variancesDataModel,t),this.drawAxisAndLabels(this.variancesDataModel,t)):null!=this.stackConfig?(this.drawStackedScenarios(this.dataModel,t),this.drawStackedHeaders(this.dataModel,t),this.drawAxisAndLabels(this.dataModel,t)):(this.drawScenarios(this.dataModel,t),this.drawAxisAndLabels(this.dataModel,t))}setPattern(t,i){this.styles.pattern.set(t,i)}calculateTitleLength(t){const i=T(this.title.length>7?this.title:"_______",{font:this.styles.fontStyles.font,fontSize:this.styles.fontStyles.size+"px"}).width;return i<t?t:i/2}getFooter(){return 1===this.measureScale.value&&""===this.measureUnit?" ":k.translateScenarioLabel("in",this.i18n)+" "+this.measureScale.prefix+this.measureUnit}setAxisScenario(t){let i=N.AC1;if(null!=t&&t.length>0){const s=new C(t.toString());s.isValid&&(i=s.delta)}return null===i&&(i=N.AC1),i}populateModel(t,i,s){var h;if(0===(null===(h=this.preparedDataSet)||void 0===h?void 0:h.length))return[];const e=[],n=this.createOrderStr(i,s),r=this.createSelectString(i,s),o=this.createGroupByStr(i,s),a=A(`SELECT ${r} ${t.length>0?","+t.map((t=>`SUM(${t} * transformOperator(operation)) as ${t}, COUNT(ISNULL(${t})) as ${t}_cnt`)).join(","):""} \n FROM ?\n GROUP BY ${o}\n ORDER BY ${n}`,[this.preparedDataSet]);return this.detectNaNCells(t,a),this.createDataRows(a,e,t),this.crateRESTRow(a,t,e),e}detectNaNCells(t,i){i.forEach((i=>(t.forEach((t=>{const s=new C(t);!0===s.isValid?0!==i[s.base+"_cnt"]&&0!==i[s.delta+"_cnt"]||(i[t]=Number.NaN):0===i[t+"_cnt"]&&(i[t]=Number.NaN)})),i)))}crateRESTRow(t,i,s){if(0===this.limit||this.limit>t.length)return;const h=[],e=t.slice(this.limit,t.length);this.createDataRows(e,h,i);const n=h.reduce((function(t,s){return{id:t.id,category:t.category,type:t.type,scenario1:new H(t.scenario1.value+s.scenario1.value,i[0],t.scenario1.pixelPerUnit,N.NEU),scenario2:new H(t.scenario2.value+s.scenario2.value,i[1],t.scenario2.pixelPerUnit,N.NEU),scenario3:new H(t.scenario3.value+s.scenario3.value,i[2],t.scenario3.pixelPerUnit,N.NEU),scenario4:new H(t.scenario4.value+s.scenario4.value,i[3],t.scenario4.pixelPerUnit,N.NEU)}}),{id:9999,category:"REST",type:B.NONE,scenario1:new H(0,i[0],this.pixelPerUnit,N.NEU),scenario2:new H(0,i[1],this.pixelPerUnit,N.NEU),scenario3:new H(0,i[2],this.pixelPerUnit,N.NEU),scenario4:new H(0,i[3],this.pixelPerUnit,N.NEU)});s.push(n)}createDataRows(t,i,s){let h=t;this.limit>0&&(h=t.slice(0,this.limit)),h.forEach(((t,h)=>{i.push({id:h,category:t.category,type:B.NONE,scenario1:new H(t[s[0]],s[0],this.pixelPerUnit,N.NEU),scenario2:new H(t[s[1]],s[1],this.pixelPerUnit,N.NEU),scenario3:new H(t[s[2]],s[2],this.pixelPerUnit,N.NEU),scenario4:new H(t[s[3]],s[3],this.pixelPerUnit,N.NEU)})}))}createOrderStr(t,i){let s=`${t.toLowerCase()}`;return i.hierarchy.length>=1&&(s=`${i.hierarchy.toString()} ${null==i?void 0:i.direction}`),s}createSelectString(t,i){return t===b.CATEGORY&&i.hierarchy.includes(S.CATEGORYINDEX)?`${S.CATEGORYINDEX}, ${b.CATEGORY} as category`:t===b.ROWGROUP&&i.hierarchy.includes(S.ROWGROUPINDEX)?`${S.ROWGROUPINDEX}, ${b.ROWGROUP} as category`:t===b.SUBCATEGORY&&i.hierarchy.includes(S.SUBCATEGORYINDEX)?`${S.SUBCATEGORYINDEX}, ${b.SUBCATEGORY} as category`:`${t.toString()} as category`}createGroupByStr(t,i){return t===b.CATEGORY&&i.hierarchy.includes(S.CATEGORYINDEX)?`${S.CATEGORYINDEX}, ${b.CATEGORY}`:t===b.ROWGROUP&&i.hierarchy.includes(S.ROWGROUPINDEX)?`${S.ROWGROUPINDEX}, ${b.ROWGROUP}`:t===b.SUBCATEGORY&&i.hierarchy.includes(S.SUBCATEGORYINDEX)?`${S.SUBCATEGORYINDEX}, ${b.SUBCATEGORY}`:`${t.toString()}`}calculateCategoryWidth(){if(this.hideCategories)return 5;let t=0;for(const i of this.dataModel){const s=T(i.category,{font:this.styles.fontStyles.font,fontSize:this.styles.fontStyles.size+"px"});s.width>t&&(t=s.width)}return 1.1125*t}findSmallestDataPointValue(t){let i=new H(0,"default",this.pixelPerUnit,null);for(const s of t)for(const t of[s.scenario1,s.scenario2,s.scenario3,s.scenario4])null!=t&&null!=i.value&&t.value<i.value&&(i=t);return i}findHighestDataPointValue(t){let i=new H(0,"default",this.pixelPerUnit,null);for(const s of t)for(const t of[s.scenario1,s.scenario2,s.scenario3,s.scenario4])null!=t&&null!=i.value&&t.value>i.value&&(i=t);return i}populateVarianceModel(t,i){const s=[];if(0===t.length)return s;let h=null;null!=i&&i.length>0&&(h=i[0]);for(const e in t){const n=new C(t[e]);if(n.isValid){const t=this.mapScenarios(n,h),e=n.direction;let r=this.pixelPerUnit;"dr"===n.type&&(r=this.pixelPerPercentage);for(const h in i)s.push({id:Number(h),category:i[h].category,type:"dr"===n.type?B.RELATIVE:B.ABSOLUTE,scenario1:new H(this.calculateVariance(n,i[h],t),n.base,r,e),scenario2:new H(null,null,null,null),scenario3:new H(null,null,null,null),scenario4:new H(null,null,null,null)})}}return s}calculateVariance(t,i,s){const h=s.get(t.base),e=s.get(t.delta);return null==h||null==e?null:t.type===B.RELATIVE?(i[h].value-i[e].value)/i[e].value:i[h].value-i[e].value}mapScenarios(t,i){const s=new Map;return null==i||["scenario1","scenario2","scenario3","scenario4"].forEach((h=>{i[h].scenario===t.delta?s.set(t.delta,h):i[h].scenario===t.base&&s.set(t.base,h)})),s}calculateTextBoxWidth(t){return T(k.number(t,"decimal",1,0),{font:this.styles.fontStyles.font,fontSize:this.styles.fontStyles.size+"px"}).width}calculatePercentageTextBoxWidth(t){let i=0;return t>=0&&(i+=T("+",{font:this.styles.fontStyles.font,fontSize:this.styles.fontStyles.size+"px"}).width),i+=T(" %",{font:this.styles.fontStyles.font,fontSize:this.styles.fontStyles.size+"px"}).width,T(k.number(t,"decimal",1,1),{font:this.styles.fontStyles.font,fontSize:this.styles.fontStyles.size+"px"}).width+i+i}cleanSVGforRedraw(t){t.clear()}drawAxisAndLabels(t,i){const s=i.group().id("AxisAndDateLables");let h=!1;this.hideCategories||t.forEach(((t,i)=>{t.type===B.RELATIVE&&(h=!0);let e=Y.Right,n=!0;t.scenario1.value<0&&(e=Y.Left,n=!1),new q(s,this.position.getCategoryPositionX(n),this.position.getBarCenterPositionY(i),"",t.category,this.styles,Y.Center,e).draw()})),new Z({scenarioType:this.axisScenario,labelText:this.title,isRelative:h},this.position,s,this.styles).draw()}drawScenarios(t,i){const s=i.group().id("Scenarios"),h=new st(this.position,s,this.styles,t.length,this.i18n);h.setOverflowConfig(this.overflowConfig),t.forEach(((t,i)=>{h.createPrimaryBar(t.scenario1,i).draw(this.dataFormatDigits,this.measureScale),h.createSecondaryBar(t.scenario2,i).draw(),h.createPrimaryMarker(t.scenario3,i).draw(),h.createSecondaryMarker(t.scenario4,i).draw()}))}drawVarianceScenario(t,i){const s=i.group().id("Scenarios"),h=new st(this.position,s,this.styles,t.length,this.i18n);return h.setOverflowConfig(this.overflowConfig),t.forEach(((t,i)=>{t.type===B.RELATIVE?h.createRelativeVarianceBar(t.scenario1,i).draw():h.createVarianceBar(t.scenario1,i).draw(this.dataFormatDigits,this.measureScale)})),s}drawStackedScenarios(t,i){if(!this.stackConfig)return;const s=i.group().id("StackedScenarios"),h=this.stackConfig.by===m.SCENARIO;t.forEach(((t,i)=>{const e=["scenario1","scenario2","scenario3","scenario4"],n=[];if(h)for(const i of e){const s=t[i];s&&!s.isEmpty()&&null!=s.value&&n.push({value:s.value,scenario:s.scenario,dataPoint:s})}else{const i=t.scenario1;i&&!i.isEmpty()&&null!=i.value&&n.push({value:i.value,scenario:i.scenario,dataPoint:i})}if(0!==n.length)if((h?new Set(n.map((t=>a(t.scenario)))):new Set).size>1){const t=new Map;for(const i of n){const s=a(i.scenario);t.has(s)||t.set(s,[]),t.get(s).push(i)}const h=[];for(const i of l)t.has(i)&&(h.push({prefix:i,segments:t.get(i)}),t.delete(i));for(const[i,s]of t)h.push({prefix:i,segments:s});h.forEach(((t,e)=>{const n=t.segments.reduce(((t,i)=>t+Math.abs(i.value)),0),r=h.length-1-e;let o=0,a=null;t.segments.forEach((t=>{const h=new it(this.position,this.styles,t.dataPoint,i,o,t.scenario,r,this.stackConfig.mode,n,!0,s);h.draw(this.dataFormatDigits,this.measureScale),o+=Math.abs(t.value),a=h})),a&&a.drawTotalLabel(this.dataFormatDigits,this.measureScale)}))}else{let e=n;!h&&t.stackSegments&&t.stackSegments.length>0&&(e=t.stackSegments.map((t=>({value:t.value,scenario:t.label,dataPoint:t.dataPoint})))),"asc"===this.stackConfig.order?e.sort(((t,i)=>t.value-i.value)):"desc"===this.stackConfig.order&&e.sort(((t,i)=>i.value-t.value));const r=e.reduce(((t,i)=>t+Math.abs(i.value)),0);let o=0,a=null;e.forEach(((t,e)=>{const n=new it(this.position,this.styles,t.dataPoint,i,o,t.scenario,e,this.stackConfig.mode,r,h,s);n.draw(this.dataFormatDigits,this.measureScale),o+=Math.abs(t.value),a=n})),a&&a.drawTotalLabel(this.dataFormatDigits,this.measureScale)}}))}drawStackedHeaders(t,i){if(!this.stackConfig||0===t.length)return;const s=this.stackConfig.by===m.SCENARIO,h=i.group().id("StackedHeaders"),e=t[0];if(!s){const t=e.stackSegments;if(!t||0===t.length)return;const i=[...t];"asc"===this.stackConfig.order?i.sort(((t,i)=>t.value-i.value)):"desc"===this.stackConfig.order&&i.sort(((t,i)=>i.value-t.value));const s=i.reduce(((t,i)=>t+Math.abs(i.value)),0),n=this.position.getBarPositionX(),r=this.position.getAxisTitlePositionY();let o=0;return void i.forEach((t=>{const i=t.dataPoint.pixelPerUnit;let e;e=this.stackConfig.mode===P.RELATIVE?(0!==s?Math.abs(t.value)/s:0)*i:Math.abs(t.value*i);const a=n+o+e/2,l=this.i18n.get(t.label)||t.label;new q(h,a,r,"STACK_HEADER",l,this.styles,Y.Bottom,Y.Center).draw(),o+=e}))}const n=["scenario1","scenario2","scenario3","scenario4"],r=[];for(const t of n){const i=e[t];i&&!i.isEmpty()&&null!=i.value&&r.push({value:i.value,scenario:i.scenario,dataPoint:i})}if(0===r.length)return;const o=new Set(r.map((t=>a(t.scenario)))),c=this.position.getBarPositionX(),u=this.position.getAxisTitlePositionY();if(o.size>1){const t=new Map;for(const i of r){const s=a(i.scenario);t.has(s)||t.set(s,[]),t.get(s).push(i)}const i=[];for(const s of l)t.has(s)&&(i.push({prefix:s,segments:t.get(s)}),t.delete(s));for(const[s,h]of t)i.push({prefix:s,segments:h});i.forEach((t=>{const i=t.segments.reduce(((t,i)=>t+Math.abs(i.value)),0),s=t.segments[0].dataPoint.pixelPerUnit,e=c+(this.stackConfig.mode===P.RELATIVE?s:i*s)/2,n=this.i18n.get(t.prefix+"1")||t.prefix.toUpperCase();new q(h,e,u,"STACK_HEADER",n,this.styles,Y.Bottom,Y.Center).draw()}))}else{"asc"===this.stackConfig.order?r.sort(((t,i)=>t.value-i.value)):"desc"===this.stackConfig.order&&r.sort(((t,i)=>i.value-t.value));const t=r.reduce(((t,i)=>t+Math.abs(i.value)),0);let i=0;r.forEach((s=>{const e=s.dataPoint.pixelPerUnit;let n;n=this.stackConfig.mode===P.RELATIVE?(0!==t?Math.abs(s.value)/t:0)*e:Math.abs(s.value*e);const r=c+i+n/2,o=this.i18n.get(s.scenario)||s.scenario;new q(h,r,u,"STACK_HEADER",o,this.styles,Y.Bottom,Y.Center).draw(),i+=n}))}}getVarianceType(){return this.variancesDataModel.length>0?this.variancesDataModel[0].type:B.NONE}calculateLeftSideWidth(t){var i,s,h;let e=0;const n=this.styles.fontStyles.size*this.styles.scaleFactors.labelToBar;if(B.NONE===t&&null!=(null===(i=this.smallestDataPointValue)||void 0===i?void 0:i.value)&&this.smallestDataPointValue.value<0){const t=this.calculateTextBoxWidth(this.smallestDataPointValue.value);e=Math.abs(this.smallestDataPointValue.getScaledUnit())+n+t}else if(B.RELATIVE===t&&null!=(null===(s=this.smallestVarianceDataPointValue)||void 0===s?void 0:s.value)&&this.smallestVarianceDataPointValue.value<0){const t=this.calculatePercentageTextBoxWidth(this.smallestVarianceDataPointValue.value);e=Math.abs(this.smallestVarianceDataPointValue.getScaledPercentUnit())+n+t}else if(B.ABSOLUTE===t&&null!=(null===(h=this.smallestVarianceDataPointValue)||void 0===h?void 0:h.value)&&this.smallestVarianceDataPointValue.value<0){const t=this.calculateTextBoxWidth(this.smallestVarianceDataPointValue.value);e=Math.abs(this.smallestVarianceDataPointValue.getScaledUnit())+n+t}return e<=this.titleLength?this.titleLength:e}calculateRightSideWidth(t){var i,s,h;let e=0;const n=this.styles.fontStyles.size*this.styles.scaleFactors.labelToBar;if(B.NONE===t&&null!=(null===(i=this.highestDataPointValue)||void 0===i?void 0:i.value)&&this.highestDataPointValue.value>=0){const t=this.calculateTextBoxWidth(this.highestDataPointValue.value);e=Math.abs(this.highestDataPointValue.getScaledUnit())+n+t}else if(B.RELATIVE===t&&null!=(null===(s=this.highestVarianceDataPointValue)||void 0===s?void 0:s.value)&&this.highestVarianceDataPointValue.value>=0){const t=this.calculatePercentageTextBoxWidth(this.highestVarianceDataPointValue.value);e=Math.abs(this.highestVarianceDataPointValue.getScaledPercentUnit())+n+t}else if(B.ABSOLUTE===t&&null!=(null===(h=this.highestVarianceDataPointValue)||void 0===h?void 0:h.value)&&this.highestVarianceDataPointValue.value>=0){const t=this.calculateTextBoxWidth(this.highestVarianceDataPointValue.value);e=Math.abs(this.highestVarianceDataPointValue.getScaledUnit())+n+t}return e<=this.titleLength?this.titleLength:e}populateDimensionStackSegments(t,i,s){var h;if(0===(null===(h=this.preparedDataSet)||void 0===h?void 0:h.length)||0===t.length)return;const e={[m.CATEGORY]:"category",[m.SUBCATEGORY]:"subCategory",[m.ROWGROUP]:"rowGroup"}[i.by];if(!e)return;const n=s.toString(),r=t[0],o=A(`SELECT [${n}] as displayGroup, [${e}] as stackLabel, SUM([${r}] * transformOperator(operation)) as stackValue FROM ? GROUP BY [${n}], [${e}]`,[this.preparedDataSet]),a=new Map;for(const t of o){const i=t.displayGroup;a.has(i)||a.set(i,[]),null!=t.stackValue&&null!=t.stackLabel&&a.get(i).push({label:t.stackLabel,value:t.stackValue})}for(const t of this.dataModel){const i=a.get(t.category);t.stackSegments=i&&i.length>0?i.map((t=>({label:t.label,value:t.value,dataPoint:new H(t.value,r,this.pixelPerUnit,N.NEU)}))):[]}}hasNoData(){return 0===this.dataModel.length}setAvailableWidth(t){if(this.pixelPerUnit<=0||t<=0)this.overflowConfig=null;else if(null==this.stackConfig){if(this.overflowConfig=this.calculateOverflowConfig(t),this.overflowConfig){const{cutWidth:t,overdriveZoneWidth:i,breakGap:s}=this.overflowConfig,h=t+i+s;this.variancesDataModel&&this.variancesDataModel.length>0?(this.highestVarianceDataPointValue.getScaledUnit()>t&&(this.highestVarianceDataPointValue=new H(h,this.highestVarianceDataPointValue.scenario,1,this.highestVarianceDataPointValue.variance)),null!=this.smallestVarianceDataPointValue.value&&Math.abs(this.smallestVarianceDataPointValue.getScaledUnit())>t&&(this.smallestVarianceDataPointValue=new H(-h,this.smallestVarianceDataPointValue.scenario,1,this.smallestVarianceDataPointValue.variance))):(this.highestDataPointValue.getScaledUnit()>t&&(this.highestDataPointValue=new H(h,this.highestDataPointValue.scenario,1,this.highestDataPointValue.variance)),null!=this.smallestDataPointValue.value&&Math.abs(this.smallestDataPointValue.getScaledUnit())>t&&(this.smallestDataPointValue=new H(-h,this.smallestDataPointValue.scenario,1,this.smallestDataPointValue.variance))),this.updatePosition()}}else this.overflowConfig=null}calculateOverflowConfig(t){const i=this.variancesDataModel&&this.variancesDataModel.length>0;if(this.getVarianceType()===B.RELATIVE)return null;const s=i?this.highestVarianceDataPointValue:this.highestDataPointValue,h=i?this.smallestVarianceDataPointValue:this.smallestDataPointValue,e=s.getScaledUnit(),n=null!=h.value?Math.abs(h.getScaledUnit()):0,r=Math.max(e,n);if(r<=0)return null;const o=this.styles.fontStyles.size,a=o*this.styles.scaleFactors.labelToBar,l=1.5*o,c=.3*o,u=.8*o,d=t-this.position.getAxisPositionX()-this.styles.padding.left-this.styles.padding.right-a-this.calculateTextBoxWidth(s.value||0)-l-c;if(d<=u)return null;const f=d-u;return r<=f?null:{cutWidth:d,overdriveZoneWidth:l,breakGap:c,maxOverflow:r-f,scenarioCutOffset:u}}}const et=class{constructor(i){t(this,i),this.data=[],this.chartTitle="",this.scenarios=[],this.variances=[],this.hideCategories=!1,this.pixelPerUnit=10,this.pixelPerPercentage=50,this.limit=0,this.i18n=new Map,this.order={hierarchy:[],direction:y.ASC},this.level=b.CATEGORY,this.filter="",this.measureScale="_",this.measureUnit="",this.showMeasureScale=!0,this.dataFormatDigits={percent:2,decimal:1},this.stackConfig=null,this.parentDimensions={width:0,height:0}}render(){var t,h,e;if(void 0===this.chart)return i(s,null);if(this.chart.hasNoData()){const t=this.i18n.get("NO_DATA")||"==No Data==";return i(s,null,i("p",{class:"warning"},t))}return i(s,null,i("div",{innerHTML:null===(t=this.pattern)||void 0===t?void 0:t.toString(),class:"hidePatternContainer"}),i("div",{class:this.showMeasureScale?"footer":"footer-hide"},null===(h=this.chart)||void 0===h?void 0:h.getFooter()),i("div",{innerHTML:null===(e=this.chart)||void 0===e?void 0:e.toString()}))}async componentWillLoad(){var t;const i=this.prepareConfig(),s=this.prepareStyle();this.chart=new ht(new _,i,s),this.chart.setI18n(this.i18n),this.autoFitScaling(i,s),this.chart.setAvailableWidth((null===(t=this.parentDimensions)||void 0===t?void 0:t.width)||0),this.pattern=new W(this.chart.styles),this.chart.setPattern("fc",this.pattern.getFCPolygonPattern())}async componentWillUpdate(){var t;if(null==this.chart)return;const i=this.prepareConfig(),s=this.prepareStyle();this.chart.setI18n(this.i18n),this.chart.setStyles(s),this.chart.setConfig(i),this.autoFitScaling(i,s),this.chart.setAvailableWidth((null===(t=this.parentDimensions)||void 0===t?void 0:t.width)||0),this.pattern=new W(this.chart.styles),this.chart.setPattern("fc",this.pattern.getFCPolygonPattern())}autoFitScaling(t,i){var s;if(t.pixelPerUnit>0)return;const h=null===(s=this.parentDimensions)||void 0===s?void 0:s.width;if(!h||h<=0)return t.pixelPerUnit=1,this.chart=new ht(new _,t,i),void this.chart.setI18n(this.i18n);t.pixelPerUnit=1,this.chart=new ht(new _,t,i),this.chart.setI18n(this.i18n),this.chart.toString();const e=this.chart.getAllocatedCanvasWidth();e<=0||(t.pixelPerUnit=.9*h/e,this.chart=new ht(new _,t,i),this.chart.setI18n(this.i18n))}async componentWillRender(){}componentDidLoad(){}componentDidUpdate(){}prepareConfig(){return new F(new z,new w(new $),new $,new M,this.data).adapt({data:this.data,scenarios:this.scenarios,variances:this.variances,title:this.chartTitle,hideCategories:this.hideCategories,pixelPerUnit:this.pixelPerUnit,pixelPerPercentage:this.pixelPerPercentage,level:this.level,limit:this.limit,sortOrder:this.order,filter:this.filter,measureScale:this.measureScale,measureUnit:this.measureUnit,showMeasureScale:this.showMeasureScale,dataFormatDigits:this.dataFormatDigits,stackConfig:this.stackConfig})}prepareStyle(){return new I(new K,new c,new u(new d),new f(new d),new p).adapt(this.styles)}get element(){return h(this)}};et.style=':host{display:inline-block;position:relative;overflow:hidden}.container{display:flex;flex-direction:row}.background-image{display:flex;flex-wrap:wrap;justify-content:flex-end}.categories{text-align:right;font-size:var(--bn-font-size, 1em);font-family:var(--bn-font-family, "Noto Sans", "Helvetica Neue", Helvetica, sans-serif);color:var(--bn-font-color, black)}.label-bg{fill:var(--bn-font-background, white);opacity:0.7}.label-text{text-align:right;font-size:var(--bn-font-size, 1em);font-family:var(--bn-font-family, "Noto Sans", "Helvetica Neue", Helvetica, sans-serif);color:var(--bn-font-color, black)}.axis-title{text-align:center;font-family:var(--bn-font-family, "Noto Sans", "Helvetica Neue", Helvetica, sans-serif);color:var(--bn-font-color, black)}.axis-ac{stroke:black;stroke-width:0.1em}.axis-pp{stroke:grey;stroke-width:0.1em}.axis-fc{stroke:black;stroke-dasharray:2;stroke-width:0.1em}.axis-pl{stroke:white;stroke-width:0.1em;outline-offset:0em;outline:0.1em solid black}canvas{image-rendering:-moz-crisp-edges;image-rendering:-webkit-crisp-edges;image-rendering:pixelated;image-rendering:crisp-edges}.measure{font-weight:bold}span{display:inline-block}.hidePatternContainer{height:0;width:0}div{float:left}.warning{font-size:0.8em;font-style:italic}.footer{margin:0.2em;font-size:0.6em}.footer-hide{margin:0.2em;font-size:0.6em;opacity:0}';export{et as ibcs_chart_structure}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,h as s,H as i,g as o}from"./p-JNHhIe7t.js";import{w as r}from"./p-DtdQCMzj.js";import{w as n}from"./p-CYjZRKdI.js";import{w as e}from"./p-BSfqOkN_.js";import{g as a}from"./p-DRikHQE-.js";import{w as f}from"./p-tzFCK9qn.js";import"./p-sqjrku2z.js";import"./p-B4ySv9KQ.js";const l=class{constructor(s){t(this,s),r(this),n(this),this.errors=f(this),this.componentStyle=e(this)}connectedCallback(){this.stores=a(this.element)}getFontStyles(){return this.componentStyle((t=>{var s,i,o,r;return{"--bn-font-family":(null===(s=t.global)||void 0===s?void 0:s.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":`${(null===(i=t.global)||void 0===i?void 0:i.fontSizePx)||13.3333}px`,"--bn-font-color":(null===(o=t.global)||void 0===o?void 0:o.fontColor)||"#000000","--bn-font-background":(null===(r=t.global)||void 0===r?void 0:r.fontBackgroundColor)||"#ffffff"}}))}prepareAssetUrl(t){if(null==t||""===t)return"";const s=this.stores.assets.state;return t.startsWith("asset:")?s[t.substring(6)]:s[t]||t}render(){return s(i,{key:"656f301d5fb1a7650f4c7d0cbb3fe1ef15b8ae92",style:this.getFontStyles()},null!=this.source&&""!==this.source?s("img",{src:this.prepareAssetUrl(this.source)}):"")}get element(){return o(this)}};l.style=":host{display:inline-block;position:relative;overflow:hidden}img{max-width:100%;height:auto}";export{l as bn_image}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,h as e,H as s,g as r}from"./p-JNHhIe7t.js";import{w as o}from"./p-CYjZRKdI.js";import{w as a}from"./p-tzFCK9qn.js";const b=class{constructor(e){t(this,e),o(this),this.errors=a(this)}render(){return e(s,{key:"ef4bc925d3e711445f9533e0b1e59a8942700283"},e("slot",{key:"c338dd99289b256bab83240cf923b23fd62b4ef1"}))}get element(){return r(this)}};export{b as bn_template}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,h as s,H as i,g as e,d as n}from"./p-JNHhIe7t.js";import{w as a}from"./p-CYjZRKdI.js";import{w as r}from"./p-BSfqOkN_.js";import{w as o}from"./p-tzFCK9qn.js";import{w as d,v as l,a as h,c,d as u,m as p,n as f,j as v,k as b,o as m}from"./p-DtdQCMzj.js";import{I as g,O as y,D as w,e as R,d as _,k as S}from"./p-sqjrku2z.js";import{w as k}from"./p-CRLgp9-v.js";import{a as E}from"./p-DRikHQE-.js";import{a as x,D,b as O}from"./p-B4ySv9KQ.js";import{F as z}from"./p-1jFf17Vj.js";import{I as C,S as j}from"./p-8tsCnxIz.js";import"./p-BFTU3MAI.js";const M=class{constructor(s){t(this,s),a(this),this.errors=o(this),this.componentStyle=r(this)}getFontStyles(){return this.componentStyle((t=>{var s,i,e,n;return{"--bn-font-family":(null===(s=t.global)||void 0===s?void 0:s.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":`${(null===(i=t.global)||void 0===i?void 0:i.fontSizePx)||13.3333}px`,"--bn-font-color":(null===(e=t.global)||void 0===e?void 0:e.fontColor)||"#000000","--bn-font-background":(null===(n=t.global)||void 0===n?void 0:n.fontBackgroundColor)||"#ffffff"}}))}render(){return s(i,{key:"f43978af1c6658c6fa165093c3ada6b5f3b5986d",style:this.getFontStyles()},s("slot",{key:"b9c97432089676fc373b1d5ee59573ef5681a5c5"}))}get element(){return e(this)}};M.style=':host{flex:1;position:relative;overflow:hidden;display:block;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000)}';const F=class{constructor(s){t(this,s),this.pageNumber=null,this.displayPageNumber=!0,a(this),this.errors=o(this),this.componentStyle=r(this)}getFontStyles(){return this.componentStyle((t=>{var s,i,e,n;return{"--bn-font-family":(null===(s=t.global)||void 0===s?void 0:s.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":`${(null===(i=t.global)||void 0===i?void 0:i.fontSizePx)||13.3333}px`,"--bn-font-color":(null===(e=t.global)||void 0===e?void 0:e.fontColor)||"#000000","--bn-font-background":(null===(n=t.global)||void 0===n?void 0:n.fontBackgroundColor)||"#ffffff"}}))}isValidHttpUrl(t){let s;try{s=new URL(t)}catch(t){return!1}return"http:"===s.protocol||"https:"===s.protocol}prepareAssetUrl(t){return this.isValidHttpUrl(t)?t:`./assets/${t}.png`}render(){return s(i,{key:"c445ca8c8abde56b46564932a6fcd079aa1e640d",id:this.displayPageNumber||this.text||this.code?"container-page-footer":"container",style:this.getFontStyles()},s("div",{key:"2e5829597d228c78acbbbf130bfc440092456cb4",id:"footer-text"},null!=this.text?s("span",{class:"note"},this.text):""),s("div",{key:"a2c98bf85fc41fa0aebc35fded0528cd8ba4948f",id:"code"},null!=this.code?s("img",{class:"image",src:n(`${this.prepareAssetUrl(this.code)}`)}):""),s("div",{key:"e879c6ed16996d8b505d64426e2253f3057863f5",id:"page-number"},this.displayPageNumber?s("span",{class:"page"},this.pageNumber):""))}static get assetsDirs(){return["assets"]}get element(){return e(this)}};F.style=':host{padding:0.2em 0.5em;display:flex;flex-direction:row;justify-content:space-between;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000)}:host(#container-page-footer){box-sizing:border-box;-webkit-box-sizing:border-box;border-top:0.1em solid #ddd}div#footer-text{font-size:0.6em;display:inline}div#code{flex:1;display:inline;text-align:right;padding-right:1em}div#page-number{font-size:0.6em;display:inline}.image{z-index:2;background-color:transparent;border:transparent;height:1.2em;width:auto}';const N=class{constructor(s){t(this,s),this.businessUnit="",this.order="category",this.orderDirection="asc",this.dateFormat="none",this.dateLink="none",d(this),a(this),this.t=k(this).t,this.errors=o(this),this.componentStyle=r(this)}validateScenario(t){const s="ERR_scenarios",i=l(t);i.length>0?this.errors.addOrReplace({id:s,type:"warning",message:"scenarios: invalid value(s) '"+(null==i?void 0:i.toString())+"' are not supported."}):this.errors.remove(s)}validateVariances(t){const s="ERR_variances",i=h(t);i.length>0?this.errors.addOrReplace({id:s,type:"warning",message:"variances: invalid value(s) '"+(null==i?void 0:i.toString())+"' are not supported."}):this.errors.remove(s)}validateOrder(t){const s=c(t),i="ERR_order";s.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"order: invalid value(s) '"+(null==s?void 0:s.toString())+"' are not supported."}):this.errors.remove(i)}validateOrderDirection(t){const s="ERR_orderDirection";u(t)?this.errors.remove(s):this.errors.addOrReplace({id:s,type:"warning",message:"orderDirection: invalid value '"+(null==t?void 0:t.toString())+"' is not supported."})}validateMeasures(t){const s="ERR_measures",i=p(t);i.length>0?this.errors.addOrReplace({id:s,type:"warning",message:"measures: invalid value(s) '"+(null==i?void 0:i.toString())+'\' are not supported. Valid format example: [{"name": "Bruttoumsatz", "unit": "mEUR"}]'}):this.errors.remove(s)}validateDateStart(t){const s="ERR_dateStart";f(t)||v(t)?this.errors.remove(s):this.errors.addOrReplace({id:s,type:"warning",message:"dateStart: invalid value '"+(null==t?void 0:t.toString())+"' is not supported."})}validateDateEnd(t){const s="ERR_dateEnd";f(t)||v(t)?this.errors.remove(s):this.errors.addOrReplace({id:s,type:"warning",message:"dateStart: invalid value '"+(null==t?void 0:t.toString())+"' is not supported."})}validateDateFormat(t){const s="ERR_dateFormat";b(t)||v(t)?this.errors.remove(s):this.errors.addOrReplace({id:s,type:"warning",message:"dateFormat: invalid value '"+(null==t?void 0:t.toString())+"' is not supported."})}validateDateLink(t){const s="ERR_dateLink";m(t)||v(t)?this.errors.remove(s):this.errors.addOrReplace({id:s,type:"warning",message:"dateLink: invalid value '"+(null==t?void 0:t.toString())+"' is not supported."})}componentWillLoad(){this.validateScenario(this.scenarios),this.validateVariances(this.variances),this.validateMeasures(this.measures),this.validateDateStart(this.dateStart),this.validateDateEnd(this.dateEnd),this.validateDateFormat(this.dateFormat),this.validateDateLink(this.dateLink),this.validateOrderDirection(this.orderDirection),this.validateOrder(this.order)}prepareI18n(){const t=E,s=new Map(["SEPERATOR_WS","in","CONNECTOR_WS"].map((t=>[t,this.t(".".concat(t))]))),i=new Map(t.map((t=>[t,this.t("global.".concat(t))])));return new Map([...i.entries(),...s.entries()])}prepareI18nMode(){return g.META}prepareTitleOrder(){var t;return v(this.order)||v(this.orderDirection)?null:{hierarchy:this.order.split(",").map((t=>t.trim())),direction:y[null===(t=this.orderDirection)||void 0===t?void 0:t.toUpperCase()]}}prepareTitleTimePeriod(){var t,s;return v(this.dateStart)&&v(this.dateEnd)||v(this.dateLink)?null:{start:w.fromISO(this.dateStart),end:w.fromISO(this.dateEnd),format:D[null===(t=this.dateFormat)||void 0===t?void 0:t.toUpperCase()],link:x[null===(s=this.dateLink)||void 0===s?void 0:s.toUpperCase()]}}prepareMeasures(){return v(this.measures)?[]:JSON.parse(this.measures)}prepareScenarios(){var t,s,i,e;if(v(this.scenarios)&&v(this.variances))return[];let n=[];return(null===(t=this.scenarios)||void 0===t?void 0:t.trim().length)>0&&(n=n.concat(null===(s=this.scenarios)||void 0===s?void 0:s.split(","))),(null===(i=this.variances)||void 0===i?void 0:i.trim().length)>0&&(n=n.concat(null===(e=this.variances)||void 0===e?void 0:e.split(","))),n.map((t=>t.trim()))}prepareBusinessUnit(){return v(this.businessUnit)||"null"===this.businessUnit?null:this.businessUnit}getFontStyles(){return this.componentStyle((t=>{var s,i,e,n;return{"--bn-font-family":(null===(s=t.global)||void 0===s?void 0:s.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":`${(null===(i=t.global)||void 0===i?void 0:i.fontSizePx)||13.3333}px`,"--bn-font-color":(null===(e=t.global)||void 0===e?void 0:e.fontColor)||"#000000","--bn-font-background":(null===(n=t.global)||void 0===n?void 0:n.fontBackgroundColor)||"#ffffff"}}))}render(){const t=this.getFontStyles();return s(i,{key:"029abd8096c5274f94123da2dc1c1e88e76be922",style:t},s("ibcs-title",{key:"c8b128a6ea36d44d8a0730898b35fa3f944e23ae",businessUnit:this.prepareBusinessUnit(),scenarios:this.prepareScenarios(),measures:this.prepareMeasures(),timeperiod:this.prepareTitleTimePeriod(),order:this.prepareTitleOrder(),i18n:this.prepareI18n(),"i18n-mode":this.prepareI18nMode()}))}get element(){return e(this)}static get watchers(){return{scenarios:[{validateScenario:0}],variances:[{validateVariances:0}],order:[{validateOrder:0}],orderDirection:[{validateOrderDirection:0}],measures:[{validateMeasures:0}],dateStart:[{validateDateStart:0}],dateEnd:[{validateDateEnd:0}],dateFormat:[{validateDateFormat:0}],dateLink:[{validateDateLink:0}]}}};N.style=':host{padding:0.5em;margin-bottom:0.5em;box-sizing:border-box;-webkit-box-sizing:border-box;width:100%;display:block;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000)}';class T{constructor(){}createMeasures(t,s,i){if(this.allMeasuresUseSameUnit(t)){const e=t.length;let n="",a="";for(let r=0;r<e;r++){let o="";r>0&&(o=s.get("SEPERATOR_WS")),e>1&&r===e-1&&(o=s.get("CONNECTOR_WS")),i===g.ALL?(n=(s.get(n)||n)+o+(s.get(t[r].name)||t[r].name),a=s.get(t[r].unit)||t[r].unit):(n=n+o+t[r].name,a=t[r].unit)}return[{name:n,unit:a}]}return t}createDimension(t,s,i,e,n){let a="";return void 0!==s&&(a=(new O).getDateLinkString(s.start,s.end,s.link,s.format,n)),a+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(" ",z.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 L{constructor(){this.businessunit="",this.measures=[],this.scenarios=[],this.i18nMode=g.ALL,this.intervalSpanLimit=32}}class P{constructor(t,s,i,e){this.measureEntryAdapter=t,this.timePeriodAdapter=s,this.orderAdapter=i,this.stringAdapter=e}adapt(t){const s=new L;return R.isString(t.businessunit)&&(s.businessunit=t.businessunit),R.isArray(t.measures)&&(s.measures=_.adaptArray(t.measures,this.measureEntryAdapter)),R.isArray(t.scenarios)&&(s.scenarios=_.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 L}}var U;!function(t){t[t.UP_TO_DATE=0]="UP_TO_DATE",t[t.DIRTY=1]="DIRTY"}(U||(U={}));class A{constructor(t){this.i18n=new Map,this.unit="",this.measures=[],this.dimension="",this.config=new L,this.state=U.DIRTY,this.ruleSet=t||new C,this.dataSetFactory=new T,this.state=U.DIRTY,this.setI18n(new Map)}setI18n(t){this.state=U.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 U.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=U.UP_TO_DATE),this}setConfig(t){this.config=this.initConfig(t)}initConfig(t){this.state=U.DIRTY;const s=t,i=this;return t.scenarios.sort(((t,s)=>i.ruleSet.getScenarioSorIndex(t)-i.ruleSet.getScenarioSorIndex(s))),s}}class W{constructor(t="",s=""){this.name=t,this.unit=s}}class I{construnctor(){}adapt(t){const s=new W;return R.isString(t.name)&&(s.name=t.name),R.isString(t.unit)&&(s.unit=t.unit),s}default(){return new W("","")}}class B{constructor(t=w.now(),s=w.now(),i=D.AUTO,e=x.AUTO){this.start=t,this.end=s,this.format=i,this.link=e}}class Y{construnctor(){}adapt(t){const s=new B;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 B}}const V=class{constructor(s){t(this,s),this.businessUnit="",this.scenarios=[],this.measures=[],this.intervalSpanLimit=28,this.order={hierarchy:[],direction:y.ASC},this.i18n=new Map,this.i18nMode=g.ALL,this.title=new A(new C)}async setBusinessUnit(t){this.businessUnit=t}async setProps(t){Object.keys(t).forEach((s=>{this[s]=t[s]}))}render(){return s("div",{key:"08439c867ae47a9ee17ef8280801896a823c8826"},s("div",{key:"bb5b7325de2ae2f2e0bdba8d7f7f36511835efa9"},this.title.unit),s("div",{key:"3edb730c95280ca0c47db70e32dd8e471747d989"},this.title.measures.map(((t,i)=>s("span",null,this.isFirstElement(i)?this.title.i18n.get("SEPERATOR_WS"):"",s("span",{class:"measure"},t.name)," ",t.unit?this.title.i18n.get("in"):""," ",t.unit)))),s("div",{key:"3bae51f2fddef6b2195d1c24915512b6255c9a75"},this.title.dimension))}componentWillLoad(){const t=this.prepareConfig();this.title=new A(new C),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 P(new I,new Y,new S(new j),new j).adapt({businessunit:this.businessUnit,measures:this.measures,scenarios:this.scenarios,timeperiod:this.timeperiod,intervalSpanLimit:this.intervalSpanLimit,i18nMode:this.i18nMode,order:this.order})}};V.style=':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)}';export{M as bn_body,F as bn_footer,N as bn_title,V as ibcs_title}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var t,e,n,r,s,i,u,a;!function(t){t.ALL="all",t.META="meta"}(t||(t={})),function(t){t.CURRENCY="currency",t.VOLUME="volume"}(e||(e={})),function(t){t.AC1="ac1",t.AC2="ac2",t.AC3="ac3",t.AC4="ac4",t.PP1="pp1",t.PP2="pp2",t.PP3="pp3",t.PP4="pp4",t.FC1="fc1",t.FC2="fc2",t.FC3="fc3",t.FC4="fc4",t.PL1="pl1",t.PL2="pl2",t.PL3="pl3",t.PL4="pl4"}(n||(n={})),function(t){t.POS="pos",t.NEG="neg",t.NEU="neu"}(r||(r={})),function(t){t.DECIMAL="decimal",t.PERCENT="percent"}(s||(s={})),function(t){t.LIST="list",t.SUM="sum",t.SUMNOTOTAL="sumnototal",t.OPT="opt",t.OPTNOTOTAL="optnototal"}(i||(i={})),function(t){t.INF="inf",t.W100="w100",t.W50="w50",t.W25="w25",t.W20="w20",t.W15="w15",t.W10="w10",t.W5="w5"}(u||(u={})),function(t){t.W5="w5",t.W10="w10",t.W15="w15",t.W20="w20",t.W25="w25",t.W30="w30",t.W40="w40",t.W60="w60",t.W80="w80",t.W100="w100"}(a||(a={}));const o={[a.W5]:5,[a.W10]:10,[a.W15]:15,[a.W20]:20,[a.W25]:25,[a.W30]:30,[a.W40]:40,[a.W60]:60,[a.W80]:80,[a.W100]:100};var c,l,h,d,m,f,y;!function(t){t.ROWGROUP="rowGroup",t.ROWGROUPINDEX="rowGroupIndex",t.CATEGORY="category",t.CATEGORYINDEX="categoryIndex",t.SUBCATEGORY="subCategory",t.SUBCATEGORYINDEX="subCategoryIndex"}(c||(c={})),function(t){t.SMART="smart",t.LONG="long",t.SHORT="short"}(l||(l={})),function(t){t.COLUMN="column",t.LINE="line",t.WATERFALL="waterfall"}(h||(h={})),function(t){t.BAR="bar",t.LINE="line",t.AUTO="auto"}(d||(d={})),function(t){t.SCENARIO="scenario",t.CATEGORY="category",t.SUBCATEGORY="subcategory",t.ROWGROUP="rowgroup"}(m||(m={})),function(t){t.ABSOLUTE="absolute",t.RELATIVE="relative",t.ABSOLUTE_RELATIVE="absolute-relative"}(f||(f={})),function(t){t.ASC="asc",t.DESC="desc",t.DATASET="dataset"}(y||(y={}));class g extends Error{}class w extends g{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class p extends g{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class M extends g{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class S extends g{}class k extends g{constructor(t){super(`Invalid unit ${t}`)}}class b extends g{}class N extends g{constructor(){super("Zone is an abstract class")}}const T="numeric",v="short",E="long",O={year:T,month:T,day:T},D={year:T,month:v,day:T},I={year:T,month:v,day:T,weekday:v},$={year:T,month:E,day:T},x={year:T,month:E,day:T,weekday:E},F={hour:T,minute:T},Z={hour:T,minute:T,second:T},L={hour:T,minute:T,second:T,timeZoneName:v},W={hour:T,minute:T,second:T,timeZoneName:E},C={hour:T,minute:T,hourCycle:"h23"},A={hour:T,minute:T,second:T,hourCycle:"h23"},_={hour:T,minute:T,second:T,hourCycle:"h23",timeZoneName:v},j={hour:T,minute:T,second:T,hourCycle:"h23",timeZoneName:E},q={year:T,month:T,day:T,hour:T,minute:T},H={year:T,month:T,day:T,hour:T,minute:T,second:T},z={year:T,month:v,day:T,hour:T,minute:T},R={year:T,month:v,day:T,hour:T,minute:T,second:T},U={year:T,month:v,day:T,weekday:v,hour:T,minute:T},J={year:T,month:E,day:T,hour:T,minute:T,timeZoneName:v},G={year:T,month:E,day:T,hour:T,minute:T,second:T,timeZoneName:v},P={year:T,month:E,day:T,weekday:E,hour:T,minute:T,timeZoneName:E},Y={year:T,month:E,day:T,weekday:E,hour:T,minute:T,second:T,timeZoneName:E};class V{get type(){throw new N}get name(){throw new N}get ianaName(){return this.name}get isUniversal(){throw new N}offsetName(t,e){throw new N}formatOffset(t,e){throw new N}offset(t){throw new N}equals(t){throw new N}get isValid(){throw new N}}let B=null;class Q extends V{static get instance(){return null===B&&(B=new Q),B}get type(){return"system"}get name(){return(new Intl.DateTimeFormat).resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:e,locale:n}){return we(t,e,n)}formatOffset(t,e){return ke(this.offset(t),e)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return"system"===t.type}get isValid(){return!0}}const K=new Map,X={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6},tt=new Map;class et extends V{static create(t){let e=tt.get(t);return void 0===e&&tt.set(t,e=new et(t)),e}static resetCache(){tt.clear(),K.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=et.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:e,locale:n}){return we(t,e,n,this.name)}formatOffset(t,e){return ke(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=K.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"}),K.set(t,e)),e}(this.name);let[r,s,i,u,a,o,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=X[e];"era"===e?r[i]=s:Bt(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,a,o,c,l]=r;return[u,s,i,a,o,c,l]}(n,e);"BC"===u&&(r=1-Math.abs(r));let l=+e;const h=l%1e3;return l-=h>=0?h:1e3+h,(me({year:r,month:s,day:i,hour:24===a?0:a,minute:o,second:c,millisecond:0})-l)/6e4}equals(t){return"iana"===t.type&&t.name===this.name}get isValid(){return this.valid}}let nt={};const rt=new Map;function st(t,e={}){const n=JSON.stringify([t,e]);let r=rt.get(n);return void 0===r&&(r=new Intl.DateTimeFormat(t,e),rt.set(n,r)),r}const it=new Map,ut=new Map;let at=null;const ot=new Map;function ct(t){let e=ot.get(t);return void 0===e&&(e=new Intl.DateTimeFormat(t).resolvedOptions(),ot.set(t,e)),e}const lt=new Map;function ht(t,e,n,r){const s=t.listingMode();return"error"===s?null:"en"===s?n(e):r(e)}class dt{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=it.get(n);return void 0===r&&(r=new Intl.NumberFormat(t,e),it.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 ie(this.floor?Math.floor(t):ce(t,3),this.padTo)}}class mt{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&&et.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=st(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 ft{constructor(t,e,n){this.opts={style:"long",...n},!e&&Xt()&&(this.rtf=function(t,e={}){const{base:n,...r}=e,s=JSON.stringify([t,r]);let i=ut.get(s);return void 0===i&&(i=new Intl.RelativeTimeFormat(t,e),ut.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,a=Math.abs(e),o=1===a,c=s[t],l=r?o?c[1]:c[2]||c[1]:o?s[t][0]:t;return u?`${a} ${l} ago`:`in ${a} ${l}`}(e,t,this.opts.numeric,"long"!==this.opts.style)}formatToParts(t,e){return this.rtf?this.rtf.formatToParts(t,e):[]}}const yt={firstDay:1,minimalDays:4,weekend:[6,7]};class gt{static fromOpts(t){return gt.create(t.locale,t.numberingSystem,t.outputCalendar,t.weekSettings,t.defaultToEN)}static create(t,e,n,r,s=!1){const i=t||Lt.defaultLocale,u=i||(s?"en-US":at||(at=(new Intl.DateTimeFormat).resolvedOptions().locale,at)),a=e||Lt.defaultNumberingSystem,o=n||Lt.defaultOutputCalendar,c=re(r)||Lt.defaultWeekSettings;return new gt(u,a,o,c,i)}static resetCache(){at=null,rt.clear(),it.clear(),ut.clear(),ot.clear(),lt.clear()}static fromObject({locale:t,numberingSystem:e,outputCalendar:n,weekSettings:r}={}){return gt.create(t,e,n,r)}constructor(t,e,n,r,s){const[i,u,a]=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=st(t).resolvedOptions(),r=t}catch(s){const i=t.substring(0,n);e=st(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||a||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"===ct(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?gt.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,re(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 ht(this,t,Ee,(()=>{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=Ir.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 ht(this,t,$e,(()=>{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=Ir.utc(2016,11,13+n);e.push(t(r))}return e}((t=>this.extract(t,n,"weekday")))),this.weekdaysCache[r][t]}))}meridiems(){return ht(this,void 0,(()=>xe),(()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[Ir.utc(2016,11,13,9),Ir.utc(2016,11,13,19)].map((e=>this.extract(e,t,"dayperiod")))}return this.meridiemCache}))}eras(t){return ht(this,t,We,(()=>{const e={era:t};return this.eraCache[t]||(this.eraCache[t]=[Ir.utc(-40,1,1),Ir.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 dt(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,e={}){return new mt(t,this.intl,e)}relFormatter(t={}){return new ft(this.intl,this.isEnglish(),t)}listFormatter(t={}){return function(t,e={}){const n=JSON.stringify([t,e]);let r=nt[n];return r||(r=new Intl.ListFormat(t,e),nt[n]=r),r}(this.intl,t)}isEnglish(){return"en"===this.locale||"en-us"===this.locale.toLowerCase()||ct(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:te()?function(t){let e=lt.get(t);if(!e){const n=new Intl.Locale(t);e="getWeekInfo"in n?n.getWeekInfo():n.weekInfo,"minimalDays"in e||(e={...yt,...e}),lt.set(t,e)}return e}(this.locale):yt}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 wt=null;class pt extends V{static get utcInstance(){return null===wt&&(wt=new pt(0)),wt}static instance(t){return 0===t?pt.utcInstance:new pt(t)}static parseSpecifier(t){if(t){const e=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(e)return new pt(pe(e[1],e[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return 0===this.fixed?"UTC":`UTC${ke(this.fixed,"narrow")}`}get ianaName(){return 0===this.fixed?"Etc/UTC":`Etc/GMT${ke(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,e){return ke(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 Mt extends V{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 St(t,e){if(Bt(t)||null===t)return e;if(t instanceof V)return t;if("string"==typeof t){const n=t.toLowerCase();return"default"===n?e:"local"===n||"system"===n?Q.instance:"utc"===n||"gmt"===n?pt.utcInstance:pt.parseSpecifier(n)||et.create(t)}return Qt(t)?pt.instance(t):"object"==typeof t&&"offset"in t&&"function"==typeof t.offset?t:new Mt(t)}const kt={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},bt={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]},Nt=kt.hanidec.replace(/[\[|\]]/g,"").split(""),Tt=new Map;function vt({numberingSystem:t},e=""){const n=t||"latn";let r=Tt.get(n);void 0===r&&(r=new Map,Tt.set(n,r));let s=r.get(e);return void 0===s&&(s=new RegExp(`${kt[n]}${e}`),r.set(e,s)),s}let Et,Ot=()=>Date.now(),Dt="system",It=null,$t=null,xt=null,Ft=60,Zt=null;class Lt{static get now(){return Ot}static set now(t){Ot=t}static set defaultZone(t){Dt=t}static get defaultZone(){return St(Dt,Q.instance)}static get defaultLocale(){return It}static set defaultLocale(t){It=t}static get defaultNumberingSystem(){return $t}static set defaultNumberingSystem(t){$t=t}static get defaultOutputCalendar(){return xt}static set defaultOutputCalendar(t){xt=t}static get defaultWeekSettings(){return Zt}static set defaultWeekSettings(t){Zt=re(t)}static get twoDigitCutoffYear(){return Ft}static set twoDigitCutoffYear(t){Ft=t%100}static get throwOnInvalid(){return Et}static set throwOnInvalid(t){Et=t}static resetCaches(){gt.resetCache(),et.resetCache(),Ir.resetCache(),Tt.clear()}}class Wt{constructor(t,e){this.reason=t,this.explanation=e}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const Ct=[0,31,59,90,120,151,181,212,243,273,304,334],At=[0,31,60,91,121,152,182,213,244,274,305,335];function _t(t,e){return new Wt("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${t}, which is invalid`)}function jt(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 qt(t,e,n){return n+(le(t)?At:Ct)[e-1]}function Ht(t,e){const n=le(t)?At:Ct,r=n.findIndex((t=>t<e));return{month:r+1,day:e-n[r]}}function zt(t,e){return(t-e+7)%7+1}function Rt(t,e=4,n=1){const{year:r,month:s,day:i}=t,u=qt(r,s,i),a=zt(jt(r,s,i),n);let o,c=Math.floor((u-a+14-e)/7);return c<1?(o=r-1,c=ye(o,e,n)):c>ye(r,e,n)?(o=r+1,c=1):o=r,{weekYear:o,weekNumber:c,weekday:a,...be(t)}}function Ut(t,e=4,n=1){const{weekYear:r,weekNumber:s,weekday:i}=t,u=zt(jt(r,1,e),n),a=he(r);let o,c=7*s+i-u-7+e;c<1?(o=r-1,c+=he(o)):c>a?(o=r+1,c-=he(r)):o=r;const{month:l,day:h}=Ht(o,c);return{year:o,month:l,day:h,...be(t)}}function Jt(t){const{year:e,month:n,day:r}=t;return{year:e,ordinal:qt(e,n,r),...be(t)}}function Gt(t){const{year:e,ordinal:n}=t,{month:r,day:s}=Ht(e,n);return{year:e,month:r,day:s,...be(t)}}function Pt(t,e){if(!Bt(t.localWeekday)||!Bt(t.localWeekNumber)||!Bt(t.localWeekYear)){if(!Bt(t.weekday)||!Bt(t.weekNumber)||!Bt(t.weekYear))throw new S("Cannot mix locale-based week fields with ISO-based week fields");return Bt(t.localWeekday)||(t.weekday=t.localWeekday),Bt(t.localWeekNumber)||(t.weekNumber=t.localWeekNumber),Bt(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 Yt(t){const e=Kt(t.year),n=se(t.month,1,12),r=se(t.day,1,de(t.year,t.month));return e?n?!r&&_t("day",t.day):_t("month",t.month):_t("year",t.year)}function Vt(t){const{hour:e,minute:n,second:r,millisecond:s}=t,i=se(e,0,23)||24===e&&0===n&&0===r&&0===s,u=se(n,0,59),a=se(r,0,59),o=se(s,0,999);return i?u?a?!o&&_t("millisecond",s):_t("second",r):_t("minute",n):_t("hour",e)}function Bt(t){return void 0===t}function Qt(t){return"number"==typeof t}function Kt(t){return"number"==typeof t&&t%1==0}function Xt(){try{return"undefined"!=typeof Intl&&!!Intl.RelativeTimeFormat}catch(t){return!1}}function te(){try{return"undefined"!=typeof Intl&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch(t){return!1}}function ee(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 ne(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function re(t){if(null==t)return null;if("object"!=typeof t)throw new b("Week settings must be an object");if(!se(t.firstDay,1,7)||!se(t.minimalDays,1,7)||!Array.isArray(t.weekend)||t.weekend.some((t=>!se(t,1,7))))throw new b("Invalid week settings");return{firstDay:t.firstDay,minimalDays:t.minimalDays,weekend:Array.from(t.weekend)}}function se(t,e,n){return Kt(t)&&t>=e&&t<=n}function ie(t,e=2){let n;return n=t<0?"-"+(""+-t).padStart(e,"0"):(""+t).padStart(e,"0"),n}function ue(t){return Bt(t)||null===t||""===t?void 0:parseInt(t,10)}function ae(t){return Bt(t)||null===t||""===t?void 0:parseFloat(t)}function oe(t){if(!Bt(t)&&null!==t&&""!==t){const e=1e3*parseFloat("0."+t);return Math.floor(e)}}function ce(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 le(t){return t%4==0&&(t%100!=0||t%400==0)}function he(t){return le(t)?366:365}function de(t,e){const n=(r=e-1)-12*Math.floor(r/12)+1;var r;return 2===n?le(t+(e-n)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function me(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 fe(t,e,n){return-zt(jt(t,1,e),n)+e-1}function ye(t,e=4,n=1){const r=fe(t,e,n),s=fe(t+1,e,n);return(he(t)-r+s)/7}function ge(t){return t>99?t:t>Lt.twoDigitCutoffYear?1900+t:2e3+t}function we(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},a=new Intl.DateTimeFormat(n,u).formatToParts(s).find((t=>"timezonename"===t.type.toLowerCase()));return a?a.value:null}function pe(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 Me(t){const e=Number(t);if("boolean"==typeof t||""===t||!Number.isFinite(e))throw new b(`Invalid unit value ${t}`);return e}function Se(t,e){const n={};for(const r in t)if(ne(t,r)){const s=t[r];if(null==s)continue;n[e(r)]=Me(s)}return n}function ke(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}${ie(n,2)}:${ie(r,2)}`;case"narrow":return`${s}${n}${r>0?`:${r}`:""}`;case"techie":return`${s}${ie(n,2)}${ie(r,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function be(t){return function(t){return["hour","minute","second","millisecond"].reduce(((e,n)=>(e[n]=t[n],e)),{})}(t)}const Ne=["January","February","March","April","May","June","July","August","September","October","November","December"],Te=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],ve=["J","F","M","A","M","J","J","A","S","O","N","D"];function Ee(t){switch(t){case"narrow":return[...ve];case"short":return[...Te];case"long":return[...Ne];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 Oe=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],De=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Ie=["M","T","W","T","F","S","S"];function $e(t){switch(t){case"narrow":return[...Ie];case"short":return[...De];case"long":return[...Oe];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const xe=["AM","PM"],Fe=["Before Christ","Anno Domini"],Ze=["BC","AD"],Le=["B","A"];function We(t){switch(t){case"narrow":return[...Le];case"short":return[...Ze];case"long":return[...Fe];default:return null}}function Ce(t,e){let n="";for(const r of t)n+=r.literal?r.val:e(r.val);return n}const Ae={D:O,DD:D,DDD:$,DDDD:x,t:F,tt:Z,ttt:L,tttt:W,T:C,TT:A,TTT:_,TTTT:j,f:q,ff:z,fff:J,ffff:P,F:H,FF:R,FFF:G,FFFF:Y};class _e{static create(t,e={}){return new _e(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 Ae[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 ie(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 Ee(e)[t.month-1]}(t,e):s(r?{month:e}:{month:e,day:"numeric"},"month"),a=(e,r)=>n?function(t,e){return $e(e)[t.weekday-1]}(t,e):s(r?{weekday:e}:{weekday:e,month:"long",day:"numeric"},"weekday"),o=e=>{const n=_e.macroTokenToFormatOpts(e);return n?this.formatWithSystemDefault(t,n):e},c=e=>n?function(t,e){return We(e)[t.year<0?0:1]}(t,e):s({era:e},"era");return Ce(_e.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 xe[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 a("short",!0);case"cccc":return a("long",!0);case"ccccc":return a("narrow",!0);case"EEE":return a("short",!1);case"EEEE":return a("long",!1);case"EEEEE":return a("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 o(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=_e.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 Ce(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 je=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function qe(...t){const e=t.reduce(((t,e)=>t+e.source),"");return RegExp(`^${e}$`)}function He(...t){return e=>t.reduce((([t,n,r],s)=>{const[i,u,a]=s(e,r);return[{...t,...i},u||n,a]}),[{},null,1]).slice(0,2)}function ze(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 Re(...t){return(e,n)=>{const r={};let s;for(s=0;s<t.length;s++)r[t[s]]=ue(e[n+s]);return[r,null,n+s]}}const Ue=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,Je=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Ge=RegExp(`${Je.source}(?:${Ue.source}?(?:\\[(${je.source})\\])?)?`),Pe=RegExp(`(?:[Tt]${Ge.source})?`),Ye=Re("weekYear","weekNumber","weekDay"),Ve=Re("year","ordinal"),Be=RegExp(`${Je.source} ?(?:${Ue.source}|(${je.source}))?`),Qe=RegExp(`(?: ${Be.source})?`);function Ke(t,e,n){const r=t[e];return Bt(r)?n:ue(r)}function Xe(t,e){return[{hours:Ke(t,e,0),minutes:Ke(t,e+1,0),seconds:Ke(t,e+2,0),milliseconds:oe(t[e+3])},null,e+4]}function tn(t,e){const n=!t[e]&&!t[e+1],r=pe(t[e+1],t[e+2]);return[{},n?null:pt.instance(r),e+3]}function en(t,e){return[{},t[e]?et.create(t[e]):null,e+1]}const nn=RegExp(`^T?${Je.source}$`),rn=/^-?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 sn(t){const[e,n,r,s,i,u,a,o,c]=t,l="-"===e[0],h=o&&"-"===o[0],d=(t,e=!1)=>void 0!==t&&(e||t&&l)?-t:t;return[{years:d(ae(n)),months:d(ae(r)),weeks:d(ae(s)),days:d(ae(i)),hours:d(ae(u)),minutes:d(ae(a)),seconds:d(ae(o),"-0"===o),milliseconds:d(oe(c),h)}]}const un={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function an(t,e,n,r,s,i,u){const a={year:2===e.length?ge(ue(e)):ue(e),month:Te.indexOf(n)+1,day:ue(r),hour:ue(s),minute:ue(i)};return u&&(a.second=ue(u)),t&&(a.weekday=t.length>3?Oe.indexOf(t)+1:De.indexOf(t)+1),a}const on=/^(?:(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 cn(t){const[,e,n,r,s,i,u,a,o,c,l,h]=t,d=an(e,s,r,n,i,u,a);let m;return m=o?un[o]:c?0:pe(l,h),[d,new pt(m)]}const ln=/^(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$/,hn=/^(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$/,dn=/^(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 mn(t){const[,e,n,r,s,i,u,a]=t;return[an(e,s,r,n,i,u,a),pt.utcInstance]}function fn(t){const[,e,n,r,s,i,u,a]=t;return[an(e,a,n,r,s,i,u),pt.utcInstance]}const yn=qe(/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Pe),gn=qe(/(\d{4})-?W(\d\d)(?:-?(\d))?/,Pe),wn=qe(/(\d{4})-?(\d{3})/,Pe),pn=qe(Ge),Mn=He((function(t,e){return[{year:Ke(t,e),month:Ke(t,e+1,1),day:Ke(t,e+2,1)},null,e+3]}),Xe,tn,en),Sn=He(Ye,Xe,tn,en),kn=He(Ve,Xe,tn,en),bn=He(Xe,tn,en),Nn=He(Xe),Tn=qe(/(\d{4})-(\d\d)-(\d\d)/,Qe),vn=qe(Be),En=He(Xe,tn,en),On="Invalid Duration",Dn={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}},In={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},...Dn},$n={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},...Dn},xn=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Fn=xn.slice(0).reverse();function Zn(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 An(r)}function Ln(t,e){let n=e.milliseconds??0;for(const r of Fn.slice(1))e[r]&&(n+=e[r]*t[r].milliseconds);return n}function Wn(t,e){const n=Ln(t,e)<0?-1:1;xn.reduceRight(((r,s)=>{if(Bt(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),xn.reduce(((n,r)=>{if(Bt(e[r]))return n;if(n){const s=e[n]%1;e[n]-=s,e[r]+=s*t[n][r]}return r}),null)}function Cn(t){const e={};for(const[n,r]of Object.entries(t))0!==r&&(e[n]=r);return e}class An{constructor(t){const e="longterm"===t.conversionAccuracy||!1;let n=e?$n:In;t.matrix&&(n=t.matrix),this.values=t.values,this.loc=t.loc||gt.create(),this.conversionAccuracy=e?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=n,this.isLuxonDuration=!0}static fromMillis(t,e){return An.fromObject({milliseconds:t},e)}static fromObject(t,e={}){if(null==t||"object"!=typeof t)throw new b("Duration.fromObject: argument expected to be an object, got "+(null===t?"null":typeof t));return new An({values:Se(t,An.normalizeUnit),loc:gt.fromObject(e),conversionAccuracy:e.conversionAccuracy,matrix:e.matrix})}static fromDurationLike(t){if(Qt(t))return An.fromMillis(t);if(An.isDuration(t))return t;if("object"==typeof t)return An.fromObject(t);throw new b(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,e){const[n]=function(t){return ze(t,[rn,sn])}(t);return n?An.fromObject(n,e):An.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,e){const[n]=function(t){return ze(t,[nn,Nn])}(t);return n?An.fromObject(n,e):An.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,e=null){if(!t)throw new b("need to specify a reason the Duration is invalid");const n=t instanceof Wt?t:new Wt(t,e);if(Lt.throwOnInvalid)throw new M(n);return new An({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 k(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?_e.create(this.loc,n).formatDurationFromString(this,t):On}toHuman(t={}){if(!this.isValid)return On;const e=!1!==t.showZeros,n=xn.map((n=>{const r=this.values[n];return Bt(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+=ce(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},Ir.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?Ln(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;const e=An.fromDurationLike(t),n={};for(const t of xn)(ne(e.values,t)||ne(this.values,t))&&(n[t]=e.get(t)+this.get(t));return Zn(this,{values:n},!0)}minus(t){if(!this.isValid)return this;const e=An.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]=Me(t(this.values[n],n));return Zn(this,{values:e},!0)}get(t){return this[An.normalizeUnit(t)]}set(t){return this.isValid?Zn(this,{values:{...this.values,...Se(t,An.normalizeUnit)}}):this}reconfigure({locale:t,numberingSystem:e,conversionAccuracy:n,matrix:r}={}){return Zn(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 Wn(this.matrix,t),Zn(this,{values:t},!0)}rescale(){return this.isValid?Zn(this,{values:Cn(this.normalize().shiftToAll().toObject())},!0):this}shiftTo(...t){if(!this.isValid)return this;if(0===t.length)return this;t=t.map((t=>An.normalizeUnit(t)));const e={},n={},r=this.toObject();let s;for(const i of xn)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;Qt(r[i])&&(t+=r[i]);const u=Math.trunc(t);e[i]=u,n[i]=(1e3*t-1e3*u)/1e3}else Qt(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 Wn(this.matrix,e),Zn(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 Zn(this,{values:t},!0)}removeZeros(){return this.isValid?Zn(this,{values:Cn(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 xn)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 _n="Invalid Interval";class jn{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 b("need to specify a reason the Interval is invalid");const n=t instanceof Wt?t:new Wt(t,e);if(Lt.throwOnInvalid)throw new p(n);return new jn({invalid:n})}static fromDateTimes(t,e){const n=$r(t),r=$r(e),s=function(t,e){return t&&t.isValid?e&&e.isValid?e<t?jn.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:jn.invalid("missing or invalid end"):jn.invalid("missing or invalid start")}(n,r);return null==s?new jn({start:n,end:r}):s}static after(t,e){const n=An.fromDurationLike(e),r=$r(t);return jn.fromDateTimes(r,r.plus(n))}static before(t,e){const n=An.fromDurationLike(e),r=$r(t);return jn.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=Ir.fromISO(n,e),s=t.isValid}catch(r){s=!1}try{i=Ir.fromISO(r,e),u=i.isValid}catch(r){u=!1}if(s&&u)return jn.fromDateTimes(t,i);if(s){const n=An.fromISO(r,e);if(n.isValid)return jn.after(t,n)}else if(u){const t=An.fromISO(n,e);if(t.isValid)return jn.before(i,t)}}return jn.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?jn.fromDateTimes(t||this.s,e||this.e):this}splitAt(...t){if(!this.isValid)return[];const e=t.map($r).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(jn.fromDateTimes(r,i)),r=i,s+=1}return n}splitBy(t){const e=An.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(jn.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:jn.fromDateTimes(e,n)}union(t){return this.isValid?jn.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(jn.fromDateTimes(e,t.time)),e=null);return jn.merge(r)}difference(...t){return jn.xor([this].concat(t)).map((t=>this.intersection(t))).filter((t=>t&&!t.isEmpty()))}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:_n}[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=O,e={}){return this.isValid?_e.create(this.s.loc.clone(e),t).formatInterval(this):_n}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:_n}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:_n}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:_n}toFormat(t,{separator:e=" – "}={}){return this.isValid?`${this.s.toFormat(t)}${e}${this.e.toFormat(t)}`:_n}toDuration(t,e){return this.isValid?this.e.diff(this.s,t,e):An.invalid(this.invalidReason)}mapEndpoints(t){return jn.fromDateTimes(t(this.s),t(this.e))}}class qn{static hasDST(t=Lt.defaultZone){const e=Ir.now().setZone(t).set({month:12});return!t.isUniversal&&e.offset!==e.set({month:6}).offset}static isValidIANAZone(t){return et.isValidZone(t)}static normalizeZone(t){return St(t,Lt.defaultZone)}static getStartOfWeek({locale:t=null,locObj:e=null}={}){return(e||gt.create(t)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:t=null,locObj:e=null}={}){return(e||gt.create(t)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:t=null,locObj:e=null}={}){return(e||gt.create(t)).getWeekendDays().slice()}static months(t="long",{locale:e=null,numberingSystem:n=null,locObj:r=null,outputCalendar:s="gregory"}={}){return(r||gt.create(e,n,s)).months(t)}static monthsFormat(t="long",{locale:e=null,numberingSystem:n=null,locObj:r=null,outputCalendar:s="gregory"}={}){return(r||gt.create(e,n,s)).months(t,!0)}static weekdays(t="long",{locale:e=null,numberingSystem:n=null,locObj:r=null}={}){return(r||gt.create(e,n,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:e=null,numberingSystem:n=null,locObj:r=null}={}){return(r||gt.create(e,n,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return gt.create(t).meridiems()}static eras(t="short",{locale:e=null}={}){return gt.create(e,null,"gregory").eras(t)}static features(){return{relative:Xt(),localeWeek:te()}}}function Hn(t,e){const n=t=>t.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=n(e)-n(t);return Math.floor(An.fromMillis(r).as("days"))}function zn(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(kt.hanidec))e+=Nt.indexOf(t[n]);else for(const t in bt){const[n,s]=bt[t];r>=n&&r<=s&&(e+=r-n)}}return parseInt(e,10)}return e}(t))}}const Rn=`[ ${String.fromCharCode(160)}]`,Un=new RegExp(Rn,"g");function Jn(t){return t.replace(/\./g,"\\.?").replace(Un,Rn)}function Gn(t){return t.replace(/\./g,"").replace(Un," ").toLowerCase()}function Pn(t,e){return null===t?null:{regex:RegExp(t.map(Jn).join("|")),deser:([n])=>t.findIndex((t=>Gn(n)===Gn(t)))+e}}function Yn(t,e){return{regex:t,deser:([,t,e])=>pe(t,e),groups:e}}function Vn(t){return{regex:t,deser:([t])=>t}}const Bn={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 Qn=null;function Kn(t,e){return Array.prototype.concat(...t.map((t=>function(t,e){if(t.literal)return t;const n=er(_e.macroTokenToFormatOpts(t.val),e);return null==n||n.includes(void 0)?t:n}(t,e))))}class Xn{constructor(t,e){if(this.locale=t,this.format=e,this.tokens=Kn(_e.parseFormat(e),t),this.units=this.tokens.map((e=>function(t,e){const n=vt(e),r=vt(e,"{2}"),s=vt(e,"{3}"),i=vt(e,"{4}"),u=vt(e,"{6}"),a=vt(e,"{1,2}"),o=vt(e,"{1,3}"),c=vt(e,"{1,6}"),l=vt(e,"{1,9}"),h=vt(e,"{2,4}"),d=vt(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 Pn(e.eras("short"),0);case"GG":return Pn(e.eras("long"),0);case"y":return zn(c);case"yy":case"kk":return zn(h,ge);case"yyyy":case"kkkk":return zn(i);case"yyyyy":return zn(d);case"yyyyyy":return zn(u);case"M":case"L":case"d":case"H":case"h":case"m":case"q":case"s":case"W":return zn(a);case"MM":case"LL":case"dd":case"HH":case"hh":case"mm":case"qq":case"ss":case"WW":return zn(r);case"MMM":return Pn(e.months("short",!0),1);case"MMMM":return Pn(e.months("long",!0),1);case"LLL":return Pn(e.months("short",!1),1);case"LLLL":return Pn(e.months("long",!1),1);case"o":case"S":return zn(o);case"ooo":case"SSS":return zn(s);case"u":return Vn(l);case"uu":return Vn(a);case"uuu":case"E":case"c":return zn(n);case"a":return Pn(e.meridiems(),0);case"EEE":return Pn(e.weekdays("short",!1),1);case"EEEE":return Pn(e.weekdays("long",!1),1);case"ccc":return Pn(e.weekdays("short",!0),1);case"cccc":return Pn(e.weekdays("long",!0),1);case"Z":case"ZZ":return Yn(new RegExp(`([+-]${a.source})(?::(${r.source}))?`),2);case"ZZZ":return Yn(new RegExp(`([+-]${a.source})(${r.source})?`),2);case"z":return Vn(/[a-z_+-/]{1,256}?/i);case" ":return Vn(/[^\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(ne(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 Bt(t.z)||(n=et.create(t.z)),Bt(t.Z)||(n||(n=new pt(t.Z)),e=t.Z),Bt(t.q)||(t.M=3*(t.q-1)+1),Bt(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),Bt(t.u)||(t.S=oe(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(ne(n,"a")&&ne(n,"H"))throw new S("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 tr(t,e,n){return new Xn(t,n).explainFromTokens(e)}function er(t,e){if(!t)return null;const n=_e.create(e,t).dtFormatter((Qn||(Qn=Ir.fromMillis(1555555555555)),Qn)),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=Bn[i];if("object"==typeof u&&(u=u[e[r]]),u)return{literal:!1,val:u}}(e,t,s)))}const nr="Invalid DateTime",rr=864e13;function sr(t){return new Wt("unsupported zone",`the zone "${t.name}" is not supported`)}function ir(t){return null===t.weekData&&(t.weekData=Rt(t.c)),t.weekData}function ur(t){return null===t.localWeekData&&(t.localWeekData=Rt(t.c,t.loc.getMinDaysInFirstWeek(),t.loc.getStartOfWeek())),t.localWeekData}function ar(t,e){const n={ts:t.ts,zone:t.zone,c:t.c,o:t.o,loc:t.loc,invalid:t.invalid};return new Ir({...n,...e,old:n})}function or(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 cr(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 lr(t,e,n){return or(me(t),e,n)}function hr(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,de(r,s))+Math.trunc(e.days)+7*Math.trunc(e.weeks)},u=An.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"),a=me(i);let[o,c]=or(a,n,t.zone);return 0!==u&&(o+=u,c=t.zone.offset(o)),{ts:o,o:c}}function dr(t,e,n,r,s,i){const{setZone:u,zone:a}=n;if(t&&0!==Object.keys(t).length||e){const r=e||a,s=Ir.fromObject(t,{...n,zone:r,specificOffset:i});return u?s:s.setZone(a)}return Ir.invalid(new Wt("unparsable",`the input "${s}" can't be parsed as ${r}`))}function mr(t,e,n=!0){return t.isValid?_e.create(gt.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(t,e):null}function fr(t,e,n){const r=t.c.year>9999||t.c.year<0;let s="";if(r&&t.c.year>=0&&(s+="+"),s+=ie(t.c.year,r?6:4),"year"===n)return s;if(e){if(s+="-",s+=ie(t.c.month),"month"===n)return s;s+="-"}else if(s+=ie(t.c.month),"month"===n)return s;return s+=ie(t.c.day),s}function yr(t,e,n,r,s,i,u){let a=!n||0!==t.c.millisecond||0!==t.c.second,o="";switch(u){case"day":case"month":case"year":break;default:if(o+=ie(t.c.hour),"hour"===u)break;if(e){if(o+=":",o+=ie(t.c.minute),"minute"===u)break;a&&(o+=":",o+=ie(t.c.second))}else{if(o+=ie(t.c.minute),"minute"===u)break;a&&(o+=ie(t.c.second))}if("second"===u)break;!a||r&&0===t.c.millisecond||(o+=".",o+=ie(t.c.millisecond,3))}return s&&(t.isOffsetFixed&&0===t.offset&&!i?o+="Z":t.o<0?(o+="-",o+=ie(Math.trunc(-t.o/60)),o+=":",o+=ie(Math.trunc(-t.o%60))):(o+="+",o+=ie(Math.trunc(t.o/60)),o+=":",o+=ie(Math.trunc(t.o%60)))),i&&(o+="["+t.zone.ianaName+"]"),o}const gr={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},wr={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},pr={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Mr=["year","month","day","hour","minute","second","millisecond"],Sr=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],kr=["year","ordinal","hour","minute","second","millisecond"];function br(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 k(t);return e}function Nr(t){switch(t.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return br(t)}}function Tr(t,e){const n=St(e.zone,Lt.defaultZone);if(!n.isValid)return Ir.invalid(sr(n));const r=gt.fromObject(e);let s,i;if(Bt(t.year))s=Lt.now();else{for(const e of Mr)Bt(t[e])&&(t[e]=gr[e]);const e=Yt(t)||Vt(t);if(e)return Ir.invalid(e);const r=function(t){if(void 0===Or&&(Or=Lt.now()),"iana"!==t.type)return t.offset(Or);const e=t.name;let n=Dr.get(e);return void 0===n&&(n=t.offset(Or),Dr.set(e,n)),n}(n);[s,i]=lr(t,r,n)}return new Ir({ts:s,zone:n,loc:r,o:i})}function vr(t,e,n){const r=!!Bt(n.round)||n.round,s=Bt(n.rounding)?"trunc":n.rounding,i=(t,i)=>(t=ce(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 Er(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 Or;const Dr=new Map;class Ir{constructor(t){const e=t.zone||Lt.defaultZone;let n=t.invalid||(Number.isNaN(t.ts)?new Wt("invalid input"):null)||(e.isValid?null:sr(e));this.ts=Bt(t.ts)?Lt.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=Qt(t.o)&&!t.old?t.o:e.offset(this.ts);r=cr(this.ts,i),n=Number.isNaN(r.year)?new Wt("invalid input"):null,r=n?null:r,s=n?null:i}this._zone=e,this.loc=t.loc||gt.create(),this.invalid=n,this.weekData=null,this.localWeekData=null,this.c=r,this.o=s,this.isLuxonDateTime=!0}static now(){return new Ir({})}static local(){const[t,e]=Er(arguments),[n,r,s,i,u,a,o]=e;return Tr({year:n,month:r,day:s,hour:i,minute:u,second:a,millisecond:o},t)}static utc(){const[t,e]=Er(arguments),[n,r,s,i,u,a,o]=e;return t.zone=pt.utcInstance,Tr({year:n,month:r,day:s,hour:i,minute:u,second:a,millisecond:o},t)}static fromJSDate(t,e={}){const n="[object Date]"===Object.prototype.toString.call(t)?t.valueOf():NaN;if(Number.isNaN(n))return Ir.invalid("invalid input");const r=St(e.zone,Lt.defaultZone);return r.isValid?new Ir({ts:n,zone:r,loc:gt.fromObject(e)}):Ir.invalid(sr(r))}static fromMillis(t,e={}){if(Qt(t))return t<-rr||t>rr?Ir.invalid("Timestamp out of range"):new Ir({ts:t,zone:St(e.zone,Lt.defaultZone),loc:gt.fromObject(e)});throw new b(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,e={}){if(Qt(t))return new Ir({ts:1e3*t,zone:St(e.zone,Lt.defaultZone),loc:gt.fromObject(e)});throw new b("fromSeconds requires a numerical input")}static fromObject(t,e={}){t=t||{};const n=St(e.zone,Lt.defaultZone);if(!n.isValid)return Ir.invalid(sr(n));const r=gt.fromObject(e),s=Se(t,Nr),{minDaysInFirstWeek:i,startOfWeek:u}=Pt(s,r),a=Lt.now(),o=Bt(e.specificOffset)?n.offset(a):e.specificOffset,c=!Bt(s.ordinal),l=!Bt(s.year),h=!Bt(s.month)||!Bt(s.day),d=l||h,m=s.weekYear||s.weekNumber;if((d||c)&&m)throw new S("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(h&&c)throw new S("Can't mix ordinal dates with month/day");const f=m||s.weekday&&!d;let y,g,w=cr(a,o);f?(y=Sr,g=wr,w=Rt(w,i,u)):c?(y=kr,g=pr,w=Jt(w)):(y=Mr,g=gr);let p=!1;for(const t of y)Bt(s[t])?s[t]=p?g[t]:w[t]:p=!0;const M=f?function(t,e=4,n=1){const r=Kt(t.weekYear),s=se(t.weekNumber,1,ye(t.weekYear,e,n)),i=se(t.weekday,1,7);return r?s?!i&&_t("weekday",t.weekday):_t("week",t.weekNumber):_t("weekYear",t.weekYear)}(s,i,u):c?function(t){const e=Kt(t.year),n=se(t.ordinal,1,he(t.year));return e?!n&&_t("ordinal",t.ordinal):_t("year",t.year)}(s):Yt(s),k=M||Vt(s);if(k)return Ir.invalid(k);const b=f?Ut(s,i,u):c?Gt(s):s,[N,T]=lr(b,o,n),v=new Ir({ts:N,zone:n,o:T,loc:r});return s.weekday&&d&&t.weekday!==v.weekday?Ir.invalid("mismatched weekday",`you can't specify both a weekday of ${s.weekday} and a date of ${v.toISO()}`):v.isValid?v:Ir.invalid(v.invalid)}static fromISO(t,e={}){const[n,r]=function(t){return ze(t,[yn,Mn],[gn,Sn],[wn,kn],[pn,bn])}(t);return dr(n,r,e,"ISO 8601",t)}static fromRFC2822(t,e={}){const[n,r]=function(t){return ze(function(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}(t),[on,cn])}(t);return dr(n,r,e,"RFC 2822",t)}static fromHTTP(t,e={}){const[n,r]=function(t){return ze(t,[ln,mn],[hn,mn],[dn,fn])}(t);return dr(n,r,e,"HTTP",e)}static fromFormat(t,e,n={}){if(Bt(t)||Bt(e))throw new b("fromFormat requires an input string and a format");const{locale:r=null,numberingSystem:s=null}=n,i=gt.fromOpts({locale:r,numberingSystem:s,defaultToEN:!0}),[u,a,o,c]=function(t,e,n){const{result:r,zone:s,specificOffset:i,invalidReason:u}=tr(t,e,n);return[r,s,i,u]}(i,t,e);return c?Ir.invalid(c):dr(u,a,n,`format ${e}`,t,o)}static fromString(t,e,n={}){return Ir.fromFormat(t,e,n)}static fromSQL(t,e={}){const[n,r]=function(t){return ze(t,[Tn,Mn],[vn,En])}(t);return dr(n,r,e,"SQL",t)}static invalid(t,e=null){if(!t)throw new b("need to specify a reason the DateTime is invalid");const n=t instanceof Wt?t:new Wt(t,e);if(Lt.throwOnInvalid)throw new w(n);return new Ir({invalid:n})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t,e={}){const n=er(t,gt.fromObject(e));return n?n.map((t=>t?t.val:null)).join(""):null}static expandFormat(t,e={}){return Kn(_e.parseFormat(t),gt.fromObject(e)).map((t=>t.val)).join("")}static resetCache(){Or=void 0,Dr.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?ir(this).weekYear:NaN}get weekNumber(){return this.isValid?ir(this).weekNumber:NaN}get weekday(){return this.isValid?ir(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?ur(this).weekday:NaN}get localWeekNumber(){return this.isValid?ur(this).weekNumber:NaN}get localWeekYear(){return this.isValid?ur(this).weekYear:NaN}get ordinal(){return this.isValid?Jt(this.c).ordinal:NaN}get monthShort(){return this.isValid?qn.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?qn.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?qn.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?qn.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=me(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 a=n-i*e,o=n-u*e,c=cr(a,i),l=cr(o,u);return c.hour===l.hour&&c.minute===l.minute&&c.second===l.second&&c.millisecond===l.millisecond?[ar(this,{ts:a}),ar(this,{ts:o})]:[this]}get isInLeapYear(){return le(this.year)}get daysInMonth(){return de(this.year,this.month)}get daysInYear(){return this.isValid?he(this.year):NaN}get weeksInWeekYear(){return this.isValid?ye(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?ye(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(t={}){const{locale:e,numberingSystem:n,calendar:r}=_e.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:e,numberingSystem:n,outputCalendar:r}}toUTC(t=0,e={}){return this.setZone(pt.instance(t),e)}toLocal(){return this.setZone(Lt.defaultZone)}setZone(t,{keepLocalTime:e=!1,keepCalendarTime:n=!1}={}){if((t=St(t,Lt.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]=lr(n,e,t)}return ar(this,{ts:r,zone:t})}return Ir.invalid(sr(t))}reconfigure({locale:t,numberingSystem:e,outputCalendar:n}={}){return ar(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=Se(t,Nr),{minDaysInFirstWeek:n,startOfWeek:r}=Pt(e,this.loc),s=!Bt(e.weekYear)||!Bt(e.weekNumber)||!Bt(e.weekday),i=!Bt(e.ordinal),u=!Bt(e.year),a=!Bt(e.month)||!Bt(e.day);if((u||a||i)&&(e.weekYear||e.weekNumber))throw new S("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(a&&i)throw new S("Can't mix ordinal dates with month/day");let o;s?o=Ut({...Rt(this.c,n,r),...e},n,r):Bt(e.ordinal)?(o={...this.toObject(),...e},Bt(e.day)&&(o.day=Math.min(de(o.year,o.month),o.day))):o=Gt({...Jt(this.c),...e});const[c,l]=lr(o,this.o,this.zone);return ar(this,{ts:c,o:l})}plus(t){return this.isValid?ar(this,hr(this,An.fromDurationLike(t))):this}minus(t){return this.isValid?ar(this,hr(this,An.fromDurationLike(t).negate())):this}startOf(t,{useLocaleWeeks:e=!1}={}){if(!this.isValid)return this;const n={},r=An.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?_e.create(this.loc.redefaultToEN(e)).formatDateTimeFromString(this,t):nr}toLocaleString(t=O,e={}){return this.isValid?_e.create(this.loc.clone(e),t).formatDateTime(this):nr}toLocaleParts(t={}){return this.isValid?_e.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 a=fr(this,u,i=br(i));return Mr.indexOf(i)>=3&&(a+="T"),a+=yr(this,u,e,n,r,s,i),a}toISODate({format:t="extended",precision:e="day"}={}){return this.isValid?fr(this,"extended"===t,br(e)):null}toISOWeekDate(){return mr(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=br(u),(r&&Mr.indexOf(u)>=3?"T":"")+yr(this,"extended"===i,e,t,n,s,u)):null}toRFC2822(){return mr(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return mr(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?fr(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")),mr(this,r,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():nr}[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 An.invalid("created by diffing an invalid DateTime");const r={locale:this.locale,numberingSystem:this.numberingSystem,...n},s=(a=e,Array.isArray(a)?a:[a]).map(An.normalizeUnit),i=t.valueOf()>this.valueOf(),u=function(t,e,n,r){let[s,i,u,a]=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=Hn(t,e);return(n-n%7)/7}],["days",Hn]],s={},i=t;let u,a;for(const[o,c]of r)n.indexOf(o)>=0&&(u=o,s[o]=c(t,e),a=i.plus(s),a>e?(s[o]--,(t=i.plus(s))>e&&(a=t,s[o]--,t=i.plus(s))):t=a);return[t,s,a,u]}(t,e,n);const o=e-s,c=n.filter((t=>["hours","minutes","seconds","milliseconds"].indexOf(t)>=0));0===c.length&&(u<e&&(u=s.plus({[a]:1})),u!==s&&(i[a]=(i[a]||0)+o/(u-s)));const l=An.fromObject(i,r);return c.length>0?An.fromMillis(o,r).shiftTo(...c).plus(l):l}(i?this:t,i?t:this,s,r);var a;return i?u.negate():u}diffNow(t="milliseconds",e={}){return this.diff(Ir.now(),t,e)}until(t){return this.isValid?jn.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||Ir.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),vr(e,this.plus(n),{...t,numeric:"always",units:r,unit:s})}toRelativeCalendar(t={}){return this.isValid?vr(t.base||Ir.fromObject({},{zone:this.zone}),this,{...t,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...t){if(!t.every(Ir.isDateTime))throw new b("min requires all arguments be DateTimes");return ee(t,(t=>t.valueOf()),Math.min)}static max(...t){if(!t.every(Ir.isDateTime))throw new b("max requires all arguments be DateTimes");return ee(t,(t=>t.valueOf()),Math.max)}static fromFormatExplain(t,e,n={}){const{locale:r=null,numberingSystem:s=null}=n;return tr(gt.fromOpts({locale:r,numberingSystem:s,defaultToEN:!0}),t,e)}static fromStringExplain(t,e,n={}){return Ir.fromFormatExplain(t,e,n)}static buildFormatParser(t,e={}){const{locale:n=null,numberingSystem:r=null}=e,s=gt.fromOpts({locale:n,numberingSystem:r,defaultToEN:!0});return new Xn(s,t)}static fromFormatParser(t,e,n={}){if(Bt(t)||Bt(e))throw new b("fromFormatParser requires an input string and a format parser");const{locale:r=null,numberingSystem:s=null}=n,i=gt.fromOpts({locale:r,numberingSystem:s,defaultToEN:!0});if(!i.equals(e.locale))throw new b(`fromFormatParser called with a locale of ${i}, but the format parser was created for ${e.locale}`);const{result:u,zone:a,specificOffset:o,invalidReason:c}=e.explainFromTokens(t);return c?Ir.invalid(c):dr(u,a,n,`format ${e.format}`,t,o)}static get DATE_SHORT(){return O}static get DATE_MED(){return D}static get DATE_MED_WITH_WEEKDAY(){return I}static get DATE_FULL(){return $}static get DATE_HUGE(){return x}static get TIME_SIMPLE(){return F}static get TIME_WITH_SECONDS(){return Z}static get TIME_WITH_SHORT_OFFSET(){return L}static get TIME_WITH_LONG_OFFSET(){return W}static get TIME_24_SIMPLE(){return C}static get TIME_24_WITH_SECONDS(){return A}static get TIME_24_WITH_SHORT_OFFSET(){return _}static get TIME_24_WITH_LONG_OFFSET(){return j}static get DATETIME_SHORT(){return q}static get DATETIME_SHORT_WITH_SECONDS(){return H}static get DATETIME_MED(){return z}static get DATETIME_MED_WITH_SECONDS(){return R}static get DATETIME_MED_WITH_WEEKDAY(){return U}static get DATETIME_FULL(){return J}static get DATETIME_FULL_WITH_SECONDS(){return G}static get DATETIME_HUGE(){return P}static get DATETIME_HUGE_WITH_SECONDS(){return Y}}function $r(t){if(Ir.isDateTime(t))return t;if(t&&t.valueOf&&Qt(t.valueOf()))return Ir.fromJSDate(t);if(t&&"object"==typeof t)return Ir.fromObject(t);throw new b(`Unknown datetime argument: ${t}, of type ${typeof t}`)}class xr{static isExisting(t){return null!=t}static isString(t){return"string"==typeof t}static isNumber(t){return"number"==typeof t&&!Number.isNaN(t)}static isBoolean(t){return"boolean"==typeof t}static isArray(t){return Array.isArray(t)}static isObject(t){return"object"==typeof t&&null!==t}static isOperator(t){return"+"===t||"-"===t}static isDate(t){return t instanceof Ir&&t.isValid}}class Fr{static adaptDefaultString(t){return xr.isString(t)?t.trim():""}static adaptArray(t,e){const n=[];return xr.isArray(t)&&t.forEach((t=>{n.push(e.adapt(t))})),n}}var Zr,Lr;!function(t){t.ASC="asc",t.DESC="desc"}(Zr||(Zr={})),function(t){t.ROWGROUP="rowGroup",t.ROWGROUPINDEX="rowGroupIndex",t.CATEGORY="category",t.CATEGORYINDEX="categoryIndex",t.SUBCATEGORY="subCategory",t.SUBCATEGORYINDEX="subCategoryIndex",t.AC1="ac1",t.AC2="ac2",t.AC3="ac3",t.AC4="ac4",t.PP1="pp1",t.PP2="pp2",t.PP3="pp3",t.PP4="pp4",t.FC1="fc1",t.FC2="fc2",t.FC3="fc3",t.FC4="fc4",t.PL1="pl1",t.PL2="pl2",t.PL3="pl3",t.PL4="pl4"}(Lr||(Lr={}));class Wr{constructor(t=["category"],e=Zr.ASC){this.hierarchy=t,this.direction=e}}class Cr{constructor(t){this.stringAdapter=t}adapt(t){var e;const n=Fr.adaptArray(t.hierarchy,this.stringAdapter),r=Zr[null===(e=t.direction)||void 0===e?void 0:e.toUpperCase()]||Zr.ASC;return new Wr(n.map((t=>Lr[t.toUpperCase()]||Lr.CATEGORY)),r)}default(){return new Wr(["category"],Zr.ASC)}}export{c as A,o as B,d as C,Ir as D,t as I,e as M,Zr as O,y as S,a as T,Lr as a,f as b,l as c,Fr as d,xr as e,n as f,r as g,s as h,i,u as j,Cr as k,m as l}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g as e}from"./p-JNHhIe7t.js";const r=(e,r)=>{"function"==typeof e&&(r?e.bind(r)():e())};function t(){let e=(new Date).getTime(),r=performance&&performance.now&&1e3*performance.now()||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(t=>{let x=16*Math.random();return e>0?(x=(e+x)%16|0,e=Math.floor(e/16)):(x=(r+x)%16|0,r=Math.floor(r/16)),("x"===t?x:7&x|8).toString(16)}))}let x=(e=21)=>{let r="",t=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)r+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&t[e]];return r};const n=r=>{const{set:t,modify:n}=(()=>{let t=[];const x=()=>t,n=x=>{const n=t;t=x,n!==x&&(t=>{const x=e(r);0===t.length?x.removeAttribute("has-error"):x.setAttribute("has-error",JSON.stringify(t))})(t)};return{get:x,set:n,setAndGet:e=>{n(e)},getAndSet:e=>{const r=x();return n(e),r},modify:e=>{n(e(x()))}}})();return{clear:()=>{t([])},replace:e=>{t(e.map((e=>(e.id||(e.id=x()),e))))},add:e=>(e.id||(e.id=x()),n((r=>[...r,e])),e.id),addOrReplace:e=>{if(void 0===e.id)throw"missing";return n((r=>[...r.filter((r=>r.id!==e.id)),e])),e.id},remove:e=>{n((r=>r.filter((r=>r.id!==e))))}}};export{t as g,r,n as w}
|