@bino-bi/bn-template-engine 1.0.0-next.46 → 1.0.0-next.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (163) hide show
  1. package/dist/bn-template-engine/bn-template-engine.esm.js +1 -1
  2. package/dist/bn-template-engine/index.esm.js +1 -1
  3. package/dist/bn-template-engine/{p-BnzIfgCq.js → p-3ktFZb1x.js} +1 -1
  4. package/dist/bn-template-engine/p-444a231f.entry.js +1 -0
  5. package/dist/bn-template-engine/{p-21930d0a.entry.js → p-6ab684a9.entry.js} +1 -1
  6. package/dist/bn-template-engine/{p-B0MEAsAS.js → p-7pLJBHT2.js} +1 -1
  7. package/dist/bn-template-engine/{p-46c46067.entry.js → p-9a24e486.entry.js} +1 -1
  8. package/dist/bn-template-engine/p-BL07yV8P.js +1 -0
  9. package/dist/bn-template-engine/p-DXtYQE4s.js +1 -0
  10. package/dist/bn-template-engine/p-DY5fMUX8.js +1 -0
  11. package/dist/bn-template-engine/{p-BA-fydUt.js → p-Dvlw60RF.js} +1 -1
  12. package/dist/bn-template-engine/p-GstO_GU5.js +2 -0
  13. package/dist/bn-template-engine/p-a6017fce.entry.js +1 -0
  14. package/dist/bn-template-engine/{p-16623e0f.entry.js → p-b3f5eba0.entry.js} +1 -1
  15. package/dist/bn-template-engine/p-ddc1b2a9.entry.js +1 -0
  16. package/dist/bn-template-engine/p-hV2evPFR.js +1 -0
  17. package/dist/cjs/bn-annotation-layer_30.cjs.entry.js +54 -36
  18. package/dist/cjs/bn-grid.cjs.entry.js +6 -6
  19. package/dist/cjs/bn-image.cjs.entry.js +3 -3
  20. package/dist/cjs/bn-internationalization.cjs.entry.js +3 -3
  21. package/dist/cjs/bn-ruleset.cjs.entry.js +3 -3
  22. package/dist/cjs/bn-template-engine.cjs.js +2 -2
  23. package/dist/cjs/bn-text.cjs.entry.js +4 -4
  24. package/dist/cjs/index-CM6022qm.js +66 -0
  25. package/dist/cjs/{index-DGis1BzT.js → index-DwBbheYB.js} +2 -1
  26. package/dist/cjs/index.cjs.js +6 -14
  27. package/dist/cjs/loader.cjs.js +2 -2
  28. package/dist/cjs/{localFrame-C27GGom1.js → localFrame-C4RBw_zT.js} +1 -1
  29. package/dist/cjs/types-BngAWYMW.js +17 -0
  30. package/dist/cjs/{withBodyObserver-B78wzw3f.js → withBodyObserver-CIGVLQEB.js} +2 -2
  31. package/dist/cjs/{withHasError-0hW3-4mr.js → withHasError-CZFrIJw0.js} +1 -1
  32. package/dist/cjs/{withStyled-D0hrcfE_.js → withStyled-DHKHBdRb.js} +17 -6
  33. package/dist/cjs/{withTranslation-B4WipL_5.js → withTranslation-CLwC9a8V.js} +3 -3
  34. package/dist/collection/components/bn-chart-time/utils/TimeChart.js +3 -2
  35. package/dist/collection/components/bn-chart-time/utils/elements/AreaFill.js +1 -9
  36. package/dist/collection/components/bn-chart-time/utils/elements/LineSeries.js +1 -6
  37. package/dist/collection/components/bn-context/bn-context.js +86 -1
  38. package/dist/collection/index.js +1 -0
  39. package/dist/collection/utils/notation.js +56 -0
  40. package/dist/collection/utils/withComponentStyle.js +14 -4
  41. package/dist/components/bn-annotation-layer.js +1 -1
  42. package/dist/components/bn-annotation-list.js +1 -1
  43. package/dist/components/bn-asset.js +1 -1
  44. package/dist/components/bn-body.js +1 -1
  45. package/dist/components/bn-card.js +1 -1
  46. package/dist/components/bn-chart-bubble-renderer.js +1 -1
  47. package/dist/components/bn-chart-bubble.js +1 -1
  48. package/dist/components/bn-chart-bullet-renderer.js +1 -1
  49. package/dist/components/bn-chart-bullet.js +1 -1
  50. package/dist/components/bn-chart-scatter-renderer.js +1 -1
  51. package/dist/components/bn-chart-scatter.js +1 -1
  52. package/dist/components/bn-chart-structure-renderer.js +1 -1
  53. package/dist/components/bn-chart-structure.js +1 -1
  54. package/dist/components/bn-chart-time-renderer.js +1 -1
  55. package/dist/components/bn-chart-time.js +1 -1
  56. package/dist/components/bn-component-style.js +1 -1
  57. package/dist/components/bn-context.js +1 -1
  58. package/dist/components/bn-dataset.js +1 -1
  59. package/dist/components/bn-datasource.js +1 -1
  60. package/dist/components/bn-footer.js +1 -1
  61. package/dist/components/bn-grid.js +1 -1
  62. package/dist/components/bn-image.js +1 -1
  63. package/dist/components/bn-internationalization.js +1 -1
  64. package/dist/components/bn-layout-card.js +1 -1
  65. package/dist/components/bn-layout-page.js +1 -1
  66. package/dist/components/bn-message.js +1 -1
  67. package/dist/components/bn-page.js +1 -1
  68. package/dist/components/bn-ruleset.js +1 -1
  69. package/dist/components/bn-scaling-group.js +1 -1
  70. package/dist/components/bn-table-renderer.js +1 -1
  71. package/dist/components/bn-table.js +1 -1
  72. package/dist/components/bn-text.js +1 -1
  73. package/dist/components/bn-title-renderer.js +1 -1
  74. package/dist/components/bn-title.js +1 -1
  75. package/dist/components/bn-tree.js +1 -1
  76. package/dist/components/index.js +1 -1
  77. package/dist/components/{p-CgJB5mCu.js → p-2t-lysdb.js} +1 -1
  78. package/dist/components/{p-DkCeSWKR.js → p-4xaxuPVU.js} +1 -1
  79. package/dist/components/{p-Cxx0YNnl.js → p-6242qMx1.js} +1 -1
  80. package/dist/components/p-6gET6YXc.js +1 -0
  81. package/dist/components/p-BFWvVe7v.js +1 -0
  82. package/dist/components/{p-BuWNCnvR.js → p-BFoRIqDi.js} +1 -1
  83. package/dist/components/p-BP2sJ8k9.js +1 -0
  84. package/dist/components/{p-BoBamuPt.js → p-BgdoWKFY.js} +1 -1
  85. package/dist/components/{p-BzjGUtYh.js → p-BjgkgCAQ.js} +1 -1
  86. package/dist/components/p-BnmylmXF.js +2 -0
  87. package/dist/components/p-Bp5Xj4-s.js +1 -0
  88. package/dist/components/{p-Dq9dG0Kr.js → p-BrQCbmG0.js} +1 -1
  89. package/dist/components/{p-NBaq67dL.js → p-C-3TOa6K.js} +1 -1
  90. package/dist/components/{p-CFVoK5Rb.js → p-C8rpOS5t.js} +1 -1
  91. package/dist/components/{p-DQFahsnV.js → p-CG-iY7pQ.js} +1 -1
  92. package/dist/components/{p-EQNS13GN.js → p-CLjuZoiT.js} +1 -1
  93. package/dist/components/p-CUoPUIej.js +1 -0
  94. package/dist/components/p-CZzlLTQc.js +1 -0
  95. package/dist/components/{p-D_Sbhd0L.js → p-CmvpJzLd.js} +1 -1
  96. package/dist/components/{p-Be0Q3bvf.js → p-CrZ_O3DT.js} +1 -1
  97. package/dist/components/{p-eWxolPDU.js → p-CytMTBFu.js} +1 -1
  98. package/dist/components/{p-4vVbchX2.js → p-D32TsLzd.js} +1 -1
  99. package/dist/components/p-D3hr9wra.js +1 -0
  100. package/dist/components/{p-BXg3v5AO.js → p-DDo-fu3v.js} +1 -1
  101. package/dist/components/{p-B5tixDPM.js → p-DFybNETX.js} +1 -1
  102. package/dist/components/{p-DROj8gke.js → p-DJSj3oQq.js} +1 -1
  103. package/dist/components/p-DMAaBt7n.js +1 -0
  104. package/dist/components/{p-DbWh9W5D.js → p-DRU71K0s.js} +1 -1
  105. package/dist/components/p-DRmphEA0.js +1 -0
  106. package/dist/components/{p-9mUU4itF.js → p-DUZCLRVu.js} +1 -1
  107. package/dist/components/p-DY5fMUX8.js +1 -0
  108. package/dist/components/p-D_K7tYhY.js +1 -0
  109. package/dist/components/{p-BrJZUp-K.js → p-DdvG1D18.js} +1 -1
  110. package/dist/components/{p-D9F5IBFT.js → p-Do4GqlMV.js} +1 -1
  111. package/dist/components/p-Dw3rv_Y9.js +1 -0
  112. package/dist/components/{p-BXXjh6We.js → p-Dyzb4ika.js} +1 -1
  113. package/dist/components/p-JG4Sx1lE.js +1 -0
  114. package/dist/components/p-TNX3alPU.js +1 -0
  115. package/dist/components/{p-BKTBdrEA.js → p-Uc0zvXcQ.js} +1 -1
  116. package/dist/components/p-VtNvNyZK.js +1 -0
  117. package/dist/components/{p-G56USTsQ.js → p-Zuxd3z0q.js} +1 -1
  118. package/dist/components/{p-DoOSXntC.js → p-dO0utE8m.js} +1 -1
  119. package/dist/components/{p-16rjcQ0t.js → p-j42D1yrQ.js} +1 -1
  120. package/dist/components/{p-B5GRtTLX.js → p-ja0FCkHB.js} +1 -1
  121. package/dist/esm/bn-annotation-layer_30.entry.js +43 -25
  122. package/dist/esm/bn-grid.entry.js +5 -5
  123. package/dist/esm/bn-image.entry.js +3 -3
  124. package/dist/esm/bn-internationalization.entry.js +3 -3
  125. package/dist/esm/bn-ruleset.entry.js +3 -3
  126. package/dist/esm/bn-template-engine.js +3 -3
  127. package/dist/esm/bn-text.entry.js +4 -4
  128. package/dist/esm/index-DZHir0Ol.js +60 -0
  129. package/dist/esm/{index-CCZcKl0Q.js → index-GstO_GU5.js} +2 -2
  130. package/dist/esm/index.js +2 -15
  131. package/dist/esm/loader.js +3 -3
  132. package/dist/esm/{localFrame-CEZ7-hBs.js → localFrame-WNu1bAPm.js} +1 -1
  133. package/dist/esm/types-DY5fMUX8.js +15 -0
  134. package/dist/esm/{withBodyObserver-D9yIMxdr.js → withBodyObserver-wJgSN1Pj.js} +2 -2
  135. package/dist/esm/{withHasError-UGtkLrYT.js → withHasError-BDWEBrrb.js} +1 -1
  136. package/dist/esm/{withStyled-BlMqEIfr.js → withStyled-CTZFjg4L.js} +17 -7
  137. package/dist/esm/{withTranslation-Bc3bjHTb.js → withTranslation-BESW5BNq.js} +3 -3
  138. package/dist/types/components/bn-context/bn-context.d.ts +25 -0
  139. package/dist/types/components.d.ts +26 -0
  140. package/dist/types/index.d.ts +2 -0
  141. package/dist/types/utils/notation.d.ts +78 -0
  142. package/dist/types/utils/withComponentStyle.d.ts +6 -0
  143. package/package.json +1 -1
  144. package/dist/bn-template-engine/p-17970e07.entry.js +0 -1
  145. package/dist/bn-template-engine/p-9caa7f46.entry.js +0 -1
  146. package/dist/bn-template-engine/p-BEGt_7Hr.js +0 -1
  147. package/dist/bn-template-engine/p-BRO1oW7m.js +0 -1
  148. package/dist/bn-template-engine/p-CCZcKl0Q.js +0 -2
  149. package/dist/bn-template-engine/p-b0d528f2.entry.js +0 -1
  150. package/dist/components/p-9X5fVJqR.js +0 -1
  151. package/dist/components/p-BKA15uoz.js +0 -1
  152. package/dist/components/p-BKLq0Pbv.js +0 -1
  153. package/dist/components/p-BPGLOHUe.js +0 -1
  154. package/dist/components/p-Bd8cQiLx.js +0 -1
  155. package/dist/components/p-Bj3RWsEx.js +0 -1
  156. package/dist/components/p-D6YGOYV1.js +0 -2
  157. package/dist/components/p-Do4oPrkE.js +0 -1
  158. package/dist/components/p-Dxj_pf8s.js +0 -1
  159. package/dist/components/p-DzYhS_9s.js +0 -1
  160. package/dist/components/p-OgFFKehL.js +0 -1
  161. package/dist/components/p-kvYRImZT.js +0 -1
  162. package/dist/components/p-rEdNIgD8.js +0 -1
  163. package/dist/components/p-uCpFBDF5.js +0 -1
@@ -1 +1 @@
1
- import{p as t,H as i,h as e,a as o,t as l}from"./p-D6YGOYV1.js";import{LAYOUT_STATE_VERSION as s}from"./index.js";import{o as n,m as r}from"./p-BrJZUp-K.js";import{r as a,a as d}from"./p-CckAR27O.js";import{l as h}from"./p-CMCnX0iM.js";import{w as c}from"./p-Dq9dG0Kr.js";import{w as u}from"./p-uCpFBDF5.js";import{w as v}from"./p-9X5fVJqR.js";import{w as f}from"./p-4vVbchX2.js";function p(t){if(!t||""===t.trim()||"[]"===t)return[];try{const i=JSON.parse(t);return Array.isArray(i)?i.map(((t,i)=>{var e,o,l;return"string"==typeof t?{label:t,id:i+""}:"object"==typeof t&&null!==t?{label:null!==(o=null!==(e=t.label)&&void 0!==e?e:t.name)&&void 0!==o?o:i+"",id:null!==(l=t.id)&&void 0!==l?l:i+""}:{label:t+"",id:i+""}})):[]}catch(t){return console.error("parseHeaders: failed to parse JSON",t),[]}}function g(t,i){return`${t.id}-${i.id}`}function m(t){if(!t||""===t.trim()||"[]"===t)return[];try{const i=JSON.parse(t);if(!Array.isArray(i))return["Headers must be an array"];const e=[],o=new Set;return i.forEach(((t,i)=>{"object"==typeof t&&null!==t&&void 0!==t.id&&("string"!=typeof t.id?e.push(`Header[${i}]: 'id' must be a string`):o.has(t.id)?e.push(`Header[${i}]: duplicate id '${t.id}'`):o.add(t.id),void 0!==t.label&&"string"!=typeof t.label&&e.push(`Header[${i}]: 'label' must be a string`))})),e}catch(t){return console.error("validateHeadersJson: failed to parse JSON",t),["Invalid JSON structure"]}}const b=["auto","equal"],w=["top","center","bottom","baseline"],y=["left","center","right","baseline"],C={top:"flex-start",center:"center",bottom:"flex-end",baseline:"flex-start"},x={left:"stretch",center:"center",right:"flex-end",baseline:"stretch"};function S(t){if(null===t||""===t.trim())return 1;const i=Number(t);return Number.isInteger(i)&&i>=1?i:void 0}function H(t,i,e){var o,l;const s=Array.from({length:t},(()=>Array(i))),n=[],r=[];for(let a=0;a<t;a++)for(let d=0;d<i;d++){const h=s[a][d];if(h){r.push({row:a,column:d,by:h});continue}const c=e(a,d),u=Math.min(null!==(o=null==c?void 0:c.rowSpan)&&void 0!==o?o:1,t-a);let v=1;const f=Math.min(null!==(l=null==c?void 0:c.columnSpan)&&void 0!==l?l:1,i-d);for(;v<f&&!s[a][d+v];)v++;const p={row:a,column:d,rowSpan:u,columnSpan:v};for(let t=a;t<a+u;t++)for(let i=d;i<d+v;i++)s[t][i]=p;n.push(p)}return{cells:n,covered:r}}const R=t=>Math.round(100*t)/100,j=new Set(["bn-asset","bn-component-style","bn-dataset","bn-datasource","bn-internationalization","bn-ruleset","bn-scaling-group"]),A=new Set(["bn-layout-card"]),O={top:"--bn-baseline-offset-top",left:"--bn-baseline-offset-left",right:"--bn-baseline-offset-right"},k=["row-span","column-span","cell-background"],z=t(class extends i{validateRowHeaders(t){const i="ERR_rowHeaders",e=m(t);e.length>0?this.errors.addOrReplace({id:i,type:"error",message:"row-headers: "+e.join("; ")}):this.errors.remove(i),this.updateGridConfig()}validateColumnHeaders(t){const i="ERR_columnHeaders",e=m(t);e.length>0?this.errors.addOrReplace({id:i,type:"error",message:"column-headers: "+e.join("; ")}):this.errors.remove(i),this.updateGridConfig()}validateCellHeight(t){this.resolvedHeight=this.validateChoice("cell-height","ERR_cellHeight",t,b,"auto")}validateCellWidth(t){this.resolvedWidth=this.validateChoice("cell-width","ERR_cellWidth",t,b,"auto")}validateCellVerticalAlign(t){this.resolvedVertical=this.validateChoice("cell-vertical-align","ERR_cellVerticalAlign",t,w,"top"),this.schedule()}validateCellHorizontalAlign(t){this.resolvedHorizontal=this.validateChoice("cell-horizontal-align","ERR_cellHorizontalAlign",t,y,"left"),this.schedule()}validateCellCaptions(t){const i=function(t){if(void 0===t||""===t.trim())return{};let i;try{i=JSON.parse(t)}catch(t){return}if("object"!=typeof i||null===i||Array.isArray(i))return;const e={};for(const[t,o]of Object.entries(i)){if("string"!=typeof o)return;""!==o&&(e[t]=o)}return e}(t);i?this.errors.remove("ERR_cellCaptions"):this.errors.addOrReplace({id:"ERR_cellCaptions",type:"error",message:"cell-captions: not a JSON object from slot name to text."}),this.captions=null!=i?i:{}}constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.gridConfig={rows:[],columns:[]},this.resolvedHeight="auto",this.resolvedWidth="auto",this.resolvedVertical="top",this.resolvedHorizontal="left",this.captions={},this.offsets={},this.cellAttributes={},this.placed=[],this.frames=new Map,this.observed=new WeakSet,this.scheduled=!1,this.run=0,this.adjustments=0,this.chartTitle="",this.rowHeaders="[]",this.columnHeaders="[]",this.showRowHeaders=!0,this.showColumnHeaders=!0,this.showBorders=!0,this.rowHeaderWidth="auto",this.cellGap="0px",this.cellHeight="auto",this.cellWidth="auto",this.cellVerticalAlign="top",this.cellHorizontalAlign="left",this.cellCaptions="",this.schedule=()=>{if(!this.isBaselineMode())return this.run++,Object.keys(this.offsets).length>0&&(this.offsets={}),void this.applyFrameOffsets();this.scheduled||(this.scheduled=!0,this.holdStatus(new Promise((t=>{requestAnimationFrame((()=>{this.scheduled=!1,this.align().catch((t=>console.error("bn-grid: aligning the baselines failed",t))).finally(t)}))}))))},u(this),this.holdStatus=c(this),this.errors=f(this),this.componentStyle=v(this)}connectedCallback(){var t;this.observed=new WeakSet,this.resizeObserver=new ResizeObserver(this.schedule),this.mutationObserver=new MutationObserver((()=>{this.readCellAttributes(),this.checkCoveredSlots(),this.schedule()})),this.mutationObserver.observe(this.element,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["slot",...k]}),null===(t=document.fonts)||void 0===t||t.addEventListener("loadingdone",this.schedule),this.readCellAttributes()}disconnectedCallback(){var t,i,e;null===(t=this.resizeObserver)||void 0===t||t.disconnect(),null===(i=this.mutationObserver)||void 0===i||i.disconnect(),null===(e=document.fonts)||void 0===e||e.removeEventListener("loadingdone",this.schedule),this.run++}componentDidRender(){this.schedule()}validateChoice(t,i,e,o,l){return null==e||""===e?(this.errors.remove(i),l):o.includes(e)?(this.errors.remove(i),e):(this.errors.addOrReplace({id:i,type:"error",message:`${t}: "${e}" is not one of ${o.join(", ")}.`}),l)}readCellAttributes(){const t={},i=[];for(const e of Array.from(this.element.children)){const o=e.getAttribute("slot");if(null===o)continue;const l=t=>{const l=S(e.getAttribute(t));return void 0===l&&i.push(`${t} of slot "${o}"`),null!=l?l:1},s={rowSpan:l("row-span"),columnSpan:l("column-span")},n=e.getAttribute("cell-background");n&&(s.background=n),(s.rowSpan>1||s.columnSpan>1||s.background)&&(t[o]=s)}i.length>0?this.errors.addOrReplace({id:"ERR_cellSpan",type:"error",message:i.join(", ")+": not a whole number from 1."}):this.errors.remove("ERR_cellSpan"),JSON.stringify(t)!==JSON.stringify(this.cellAttributes)&&(this.cellAttributes=t)}placeDataCells(){const{rows:t,columns:i}=this.gridConfig,e=(e,o)=>g(t[e],i[o]),{cells:o}=H(t.length,i.length,((t,i)=>this.cellAttributes[e(t,i)]));this.placed=o.map((t=>Object.assign(Object.assign({},t),{slot:e(t.row,t.column)}))),this.checkCoveredSlots()}checkCoveredSlots(){var t;const{rows:i,columns:e}=null!==(t=this.gridConfig)&&void 0!==t?t:{rows:[],columns:[]},o=(t,o)=>g(i[t],e[o]),{covered:l}=H(i.length,e.length,((t,i)=>this.cellAttributes[o(t,i)])),s=new Set(Array.from(this.element.children).map((t=>t.getAttribute("slot")))),n=l.filter((({row:t,column:i})=>s.has(o(t,i))));if(n.length>0){const t=n.map((({row:t,column:i,by:e})=>`"${o(t,i)}" (covered by "${o(e.row,e.column)}")`));this.errors.addOrReplace({id:"WARN_cellSpan",type:"warning",message:`a span covers the slot ${t.join(", ")}: its content is not shown.`})}else this.errors.remove("WARN_cellSpan")}isBaselineMode(){return"baseline"===this.resolvedVertical||"baseline"===this.resolvedHorizontal}contentIn(t){const i=Array.from(this.element.children).find((i=>i.getAttribute("slot")===t));if(!i)return{};const e=[i,...Array.from(i.querySelectorAll("*"))],o=e.find((t=>t.localName.startsWith("bn-")&&!j.has(t.localName)&&!A.has(t.localName))),l=o?e.find((t=>A.has(t.localName)&&t.contains(o))):void 0;return{visual:o,frame:l}}applyFrameOffsets(){this.frames.forEach(((t,i)=>{const e=this.offsets[i];Object.keys(O).forEach((i=>{const o=null==e?void 0:e[i];o?t.style.setProperty(O[i],o+"px"):t.style.removeProperty(O[i])}))}))}async align(){var t;const i=++this.run;if(!this.element.isConnected||!this.isBaselineMode())return;const e=this.placed,o=e.map((({slot:t})=>this.contentIn(t))),l=o.map((t=>t.visual));if(await Promise.all(l.map((t=>{var i;return null===(i=null==t?void 0:t.componentOnReady)||void 0===i?void 0:i.call(t)}))),i!==this.run)return;l.forEach((t=>t&&this.observe(t)));const s=await Promise.all(l.map((t=>"function"==typeof(null==t?void 0:t.getBaseline)?t.getBaseline().catch((()=>({}))):Promise.resolve({}))));if(i!==this.run)return;const n=h(this.element),r=new Map;null===(t=this.element.shadowRoot)||void 0===t||t.querySelectorAll(".grid-slot").forEach((t=>{var i;r.set(null!==(i=t.getAttribute("data-slot"))&&void 0!==i?i:"",t)})),this.frames=new Map,o.forEach((({frame:t},i)=>t&&this.frames.set(e[i].slot,t)));const a=function(t,i,e){const o={};for(const i of t)o[i.slot]={};const l=(i,e,l,s,n)=>{var r,a;const d=new Map;for(const o of t)(null!==(r=o[e])&&void 0!==r?r:1)>1||d.set(o[i],[...null!==(a=d.get(o[i]))&&void 0!==a?a:[],o]);for(const t of d.values()){const i=t.map((t=>{const i=l(t);return void 0===i?void 0:i-s(t)})),e=i.filter((t=>void 0!==t)),r=e.length>0?Math.max(...e):0,a=i.map((t=>void 0===t?void 0:R(r-t))),d=Math.max(0,...a.filter((t=>void 0!==t)));t.forEach(((t,i)=>n(o[t.slot],a[i],d)))}};return i&&l("row","rowSpan",(t=>t.y),(t=>t.top),((t,i)=>{void 0===i?t.bottom=!0:t.top=i})),e&&l("column","columnSpan",(t=>t.x),(t=>t.left),((t,i,e)=>{void 0!==i&&(t.left=i);const o=R(e-(null!=i?i:0));o>0&&(t.right=o)})),o}(e.map((({slot:t,row:i,column:e,rowSpan:a,columnSpan:d},h)=>{const c=l[h],u=s[h],v=o[h].frame,f=null!=v?v:r.get(t),p=t=>parseFloat((null==f?void 0:f.style.getPropertyValue(t))||"0")||0,g={slot:t,row:i,column:e,rowSpan:a,columnSpan:d,top:p(v?O.top:"padding-top"),left:p(v?O.left:"margin-left")};if(c){const t=n.toLocal(c.getBoundingClientRect());void 0!==u.y&&(g.y=t.y+u.y),void 0!==u.x&&(g.x=t.x+u.x)}return g})),"baseline"===this.resolvedVertical,"baseline"===this.resolvedHorizontal);if(function(t,i){var e,o,l,s,n,r,a,d;const h=new Set([...Object.keys(t),...Object.keys(i)]);for(const c of h){const h=null!==(e=t[c])&&void 0!==e?e:{},u=null!==(o=i[c])&&void 0!==o?o:{};if(!!h.bottom!=!!u.bottom)return!1;if(Math.abs((null!==(l=h.top)&&void 0!==l?l:0)-(null!==(s=u.top)&&void 0!==s?s:0))>=.5)return!1;if(Math.abs((null!==(n=h.left)&&void 0!==n?n:0)-(null!==(r=u.left)&&void 0!==r?r:0))>=.5)return!1;if(Math.abs((null!==(a=h.right)&&void 0!==a?a:0)-(null!==(d=u.right)&&void 0!==d?d:0))>=.5)return!1}return!0}(a,this.offsets))this.adjustments=0;else{if(this.adjustments>=5)return console.warn("bn-grid: the baselines did not settle; the cells keep their last alignment."),void(this.adjustments=0);this.adjustments++,this.offsets=a,this.applyFrameOffsets(),this.schedule()}}observe(t){var i;this.observed.has(t)||(this.observed.add(t),null===(i=this.resizeObserver)||void 0===i||i.observe(t));const e=t=>{var i;t&&(this.observed.has(t)||(this.observed.add(t),null===(i=this.mutationObserver)||void 0===i||i.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["x1","y1","x2","y2","x","y","width","height","transform","style","class"]})),t.querySelectorAll("*").forEach((t=>e(t.shadowRoot))))};e(t.shadowRoot)}async getLayoutState(t){var i,e,o,l;const h=null!==(i=null==t?void 0:t.detail)&&void 0!==i?i:"summary",c=n(this.element),u=this.componentStyle((t=>{var i;return(null===(i=t.global)||void 0===i?void 0:i.fontSizePx)||13.3333})),{rows:v,columns:f}=this.gridConfig,p={version:s,tag:this.element.localName,id:d(this.element),slot:null!==(e=this.element.getAttribute("slot"))&&void 0!==e?e:void 0,rect:r(this.element,c),em:{fontSizePx:u,appliedScaleFactor:1},regions:[],metadata:{title:this.chartTitle||void 0,rowCount:v.length,columnCount:f.length,cellCount:this.placed.length},diagnostics:a(this.element)},g=null===(o=this.element.shadowRoot)||void 0===o?void 0:o.querySelector(".grid-container");if(g&&p.regions.push({id:"grid",rect:r(g,c)}),"full"!==h||!g)return p;const m=[],b=t=>m.push(t),w=g.querySelector(".grid-title");return w&&b({kind:"gridTitle",label:(null===(l=w.textContent)||void 0===l?void 0:l.trim())||void 0,rect:r(w,c)}),g.querySelectorAll(".grid-header-col").forEach(((t,i)=>{var e,o;b({kind:"gridHeader",columnId:null===(e=f[i])||void 0===e?void 0:e.id,label:(null===(o=t.textContent)||void 0===o?void 0:o.trim())||void 0,rect:r(t,c)})})),g.querySelectorAll(".grid-header-row").forEach(((t,i)=>{var e,o;b({kind:"gridHeader",rowId:null===(e=v[i])||void 0===e?void 0:e.id,label:(null===(o=t.textContent)||void 0===o?void 0:o.trim())||void 0,rect:r(t,c)})})),g.querySelectorAll(".grid-cell").forEach(((t,i)=>{var e,o,l,s;const n=this.placed[i];b(Object.assign(Object.assign(Object.assign({kind:"gridCell",rowId:n?null===(e=v[n.row])||void 0===e?void 0:e.id:void 0,columnId:n?null===(o=f[n.column])||void 0===o?void 0:o.id:void 0,slot:null!==(s=null===(l=t.querySelector("slot"))||void 0===l?void 0:l.getAttribute("name"))&&void 0!==s?s:void 0},(null==n?void 0:n.rowSpan)>1?{rowSpan:n.rowSpan}:{}),(null==n?void 0:n.columnSpan)>1?{columnSpan:n.columnSpan}:{}),{rect:r(t,c)}))})),g.querySelectorAll(".grid-caption").forEach((t=>{var i,e,o,l;b({kind:"gridCaption",slot:null!==(o=null===(e=null===(i=t.parentElement)||void 0===i?void 0:i.querySelector("slot"))||void 0===e?void 0:e.getAttribute("name"))&&void 0!==o?o:void 0,label:(null===(l=t.textContent)||void 0===l?void 0:l.trim())||void 0,rect:r(t,c)})})),p.elements=m,p}getGridStyle(){return this.componentStyle((t=>t["bn-grid"]))}componentWillLoad(){this.validateRowHeaders(this.rowHeaders),this.validateColumnHeaders(this.columnHeaders),this.validateCellHeight(this.cellHeight),this.validateCellWidth(this.cellWidth),this.validateCellVerticalAlign(this.cellVerticalAlign),this.validateCellHorizontalAlign(this.cellHorizontalAlign),this.validateCellCaptions(this.cellCaptions),this.readCellAttributes()}componentWillRender(){this.placeDataCells()}updateGridConfig(){this.gridConfig=function(t,i){return{rows:p(t),columns:p(i)}}(this.rowHeaders,this.columnHeaders)}shouldShowRowHeaders(){return this.showRowHeaders&&this.gridConfig.rows.length>0}shouldShowColumnHeaders(){return this.showColumnHeaders&&this.gridConfig.columns.length>0}shouldShowBorders(){return this.showBorders}getGridTemplateColumns(){const t=[];this.shouldShowRowHeaders()&&t.push(this.rowHeaderWidth);const i=this.gridConfig.columns.length||1;for(let e=0;e<i;e++)t.push("equal"===this.resolvedWidth?"minmax(0, 1fr)":"auto");return t.join(" ")}getGridTemplateRows(){const t=[];this.chartTitle&&t.push("auto"),this.shouldShowColumnHeaders()&&t.push("auto");const i=this.gridConfig.rows.length||1;for(let e=0;e<i;e++)t.push("equal"===this.resolvedHeight?"1fr":"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(),i=this.shouldShowBorders()?`${t.borderWidth}px solid ${t.borderColor}`:"none",o=this.shouldShowRowHeaders()?2:1,l=this.chartTitle?2:1;return this.gridConfig.columns.map(((s,n)=>{const r=n>0;return e("div",{key:"col-header-"+s.id,class:"grid-header grid-header-col",style:{"grid-column":o+n+"","grid-row":l+"","border-left":r?i:"none",padding:t.cellPadding+"px","padding-left":r?t.cellPadding+4+"px":t.cellPadding+"px"}},s.label)}))}renderDataCells(){const t=this.getGridStyle(),i=this.shouldShowBorders()?`${t.borderWidth}px solid ${t.borderColor}`:"none",o=this.shouldShowRowHeaders()?2:1,l=(this.chartTitle?1:0)+(this.shouldShowColumnHeaders()?1:0)+1,s=[],n=(t,i)=>i>1?`${t} / span ${i}`:t+"";return this.gridConfig.rows.length>0&&this.gridConfig.columns.length>0&&this.gridConfig.rows.forEach(((r,a)=>{if(this.shouldShowRowHeaders()){const o=a>0;s.push(e("div",{key:"row-header-"+r.id,class:"grid-header grid-header-row",style:{"grid-column":"1","grid-row":l+a+"","border-top":o?i:"none",padding:t.cellPadding+"px","padding-top":o?t.cellPadding+4+"px":t.cellPadding+"px"}},r.label))}this.placed.filter((t=>t.row===a)).forEach((({slot:r,column:d,rowSpan:h,columnSpan:c})=>{var u,v;const f=d>0,p=a>0,g=null!==(v=null===(u=this.cellAttributes[r])||void 0===u?void 0:u.background)&&void 0!==v?v:t.cellBackground&&"transparent"!==t.cellBackground?t.cellBackground:void 0;s.push(e("div",{key:"cell-"+r,class:"grid-cell","data-bn-fit-content":"",style:Object.assign(Object.assign({"grid-column":n(o+d,c),"grid-row":n(l+a,h),"border-left":f?i:"none","border-top":p?i:"none","padding-left":f?t.cellPadding+4+"px":"0","padding-top":p?t.cellPadding+4+"px":"0"},this.cellAlignStyle()),g?{"background-color":g}:{})},this.renderCellContent(r,t)))}))})),s}cellAlignStyle(){return"top"===this.resolvedVertical&&"left"===this.resolvedHorizontal?{}:{display:"flex","flex-direction":"column","justify-content":C[this.resolvedVertical],"align-items":x[this.resolvedHorizontal]}}renderCellContent(t,i){var o;const l=this.captions[t],s=void 0!==l?e("div",{class:"grid-caption",style:{"font-size":i.captionFontSize+"px","font-weight":i.captionFontWeight+"",color:i.captionColor,"margin-bottom":i.captionGap+"px","align-self":"flex-start"}},l):null,n={};"top"===this.resolvedVertical&&"left"===this.resolvedHorizontal||(n["align-self"]="stretch","center"!==this.resolvedHorizontal&&"right"!==this.resolvedHorizontal||(n.display="flex",n["flex-direction"]="column",n["align-items"]=x[this.resolvedHorizontal])),"center"===this.resolvedVertical?(n["margin-top"]="auto",n["margin-bottom"]="auto"):"bottom"===this.resolvedVertical&&(n["margin-top"]="auto");const r=this.frames.has(t)?{bottom:null===(o=this.offsets[t])||void 0===o?void 0:o.bottom}:this.offsets[t];return(null==r?void 0:r.bottom)&&(n["margin-top"]="auto"),(null==r?void 0:r.top)&&(n["padding-top"]=r.top+"px"),(null==r?void 0:r.left)&&(n["margin-left"]=r.left+"px"),(null==r?void 0:r.right)&&(n["margin-right"]=r.right+"px"),[s,e("div",{class:"grid-slot","data-slot":t,style:n},e("slot",{name:t}))]}getFontStyles(){return this.componentStyle((t=>{var i,e,o,l;return{"--bn-font-family":(null===(i=t.global)||void 0===i?void 0:i.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":((null===(e=t.global)||void 0===e?void 0:e.fontSizePx)||13.3333)+"px","--bn-font-color":(null===(o=t.global)||void 0===o?void 0:o.fontColor)||"#000000","--bn-font-background":(null===(l=t.global)||void 0===l?void 0:l.fontBackgroundColor)||"#ffffff"}}))}render(){const t="equal"===this.resolvedWidth,i=Object.assign(Object.assign({display:t?"grid":"inline-grid"},t?{width:"100%"}:{}),{"grid-template-columns":this.getGridTemplateColumns(),"grid-template-rows":this.getGridTemplateRows(),gap:this.cellGap});return e(o,{key:"97d858fb6f5704dfd46638c8e5c6a74927e702e0",style:t?Object.assign(Object.assign({},this.getFontStyles()),{display:"block"}):this.getFontStyles()},e("div",{key:"1e218eac5865574fcb4572d1aaea60f1d87d8948",class:"grid-container",style:i},this.renderTitle(),this.renderColumnHeaders(),this.renderDataCells()),e("slot",{key:"aabefa01213c69c0303f1df06f5575973253677e"}))}get element(){return this}static get watchers(){return{rowHeaders:[{validateRowHeaders:0}],columnHeaders:[{validateColumnHeaders:0}],cellHeight:[{validateCellHeight:0}],cellWidth:[{validateCellWidth:0}],cellVerticalAlign:[{validateCellVerticalAlign:0}],cellHorizontalAlign:[{validateCellHorizontalAlign:0}],cellCaptions:[{validateCellCaptions:0}]}}static get style(){return':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}'}},[257,"bn-grid",{selectedStyle:[513,"selected-style"],chartTitle:[1,"chart-title"],rowHeaders:[1,"row-headers"],columnHeaders:[1,"column-headers"],showRowHeaders:[4,"show-row-headers"],showColumnHeaders:[4,"show-column-headers"],i18nNamespace:[513,"i18n-namespace"],showBorders:[4,"show-borders"],rowHeaderWidth:[1,"row-header-width"],cellGap:[1,"cell-gap"],cellHeight:[1,"cell-height"],cellWidth:[1,"cell-width"],cellVerticalAlign:[1,"cell-vertical-align"],cellHorizontalAlign:[1,"cell-horizontal-align"],cellCaptions:[1,"cell-captions"],gridConfig:[32],resolvedHeight:[32],resolvedWidth:[32],resolvedVertical:[32],resolvedHorizontal:[32],captions:[32],offsets:[32],cellAttributes:[32],getLayoutState:[64]},void 0,{rowHeaders:[{validateRowHeaders:0}],columnHeaders:[{validateColumnHeaders:0}],cellHeight:[{validateCellHeight:0}],cellWidth:[{validateCellWidth:0}],cellVerticalAlign:[{validateCellVerticalAlign:0}],cellHorizontalAlign:[{validateCellHorizontalAlign:0}],cellCaptions:[{validateCellCaptions:0}]}]),$=z,M=function(){"undefined"!=typeof customElements&&["bn-grid"].forEach((t=>{"bn-grid"===t&&(customElements.get(l(t))||customElements.define(l(t),z))}))};export{$ as BnGrid,M as defineCustomElement}
1
+ import{p as t,H as i,h as e,d as o,t as l}from"./p-BnmylmXF.js";import{L as s}from"./p-DY5fMUX8.js";import{o as n,m as r}from"./p-DdvG1D18.js";import{r as a,a as d}from"./p-CckAR27O.js";import{l as h}from"./p-CMCnX0iM.js";import{w as c}from"./p-BrQCbmG0.js";import{w as u}from"./p-D_K7tYhY.js";import{w as v}from"./p-JG4Sx1lE.js";import{w as f}from"./p-D32TsLzd.js";function p(t){if(!t||""===t.trim()||"[]"===t)return[];try{const i=JSON.parse(t);return Array.isArray(i)?i.map(((t,i)=>{var e,o,l;return"string"==typeof t?{label:t,id:i+""}:"object"==typeof t&&null!==t?{label:null!==(o=null!==(e=t.label)&&void 0!==e?e:t.name)&&void 0!==o?o:i+"",id:null!==(l=t.id)&&void 0!==l?l:i+""}:{label:t+"",id:i+""}})):[]}catch(t){return console.error("parseHeaders: failed to parse JSON",t),[]}}function g(t,i){return`${t.id}-${i.id}`}function m(t){if(!t||""===t.trim()||"[]"===t)return[];try{const i=JSON.parse(t);if(!Array.isArray(i))return["Headers must be an array"];const e=[],o=new Set;return i.forEach(((t,i)=>{"object"==typeof t&&null!==t&&void 0!==t.id&&("string"!=typeof t.id?e.push(`Header[${i}]: 'id' must be a string`):o.has(t.id)?e.push(`Header[${i}]: duplicate id '${t.id}'`):o.add(t.id),void 0!==t.label&&"string"!=typeof t.label&&e.push(`Header[${i}]: 'label' must be a string`))})),e}catch(t){return console.error("validateHeadersJson: failed to parse JSON",t),["Invalid JSON structure"]}}const b=["auto","equal"],w=["top","center","bottom","baseline"],y=["left","center","right","baseline"],C={top:"flex-start",center:"center",bottom:"flex-end",baseline:"flex-start"},S={left:"stretch",center:"center",right:"flex-end",baseline:"stretch"};function x(t){if(null===t||""===t.trim())return 1;const i=Number(t);return Number.isInteger(i)&&i>=1?i:void 0}function H(t,i,e){var o,l;const s=Array.from({length:t},(()=>Array(i))),n=[],r=[];for(let a=0;a<t;a++)for(let d=0;d<i;d++){const h=s[a][d];if(h){r.push({row:a,column:d,by:h});continue}const c=e(a,d),u=Math.min(null!==(o=null==c?void 0:c.rowSpan)&&void 0!==o?o:1,t-a);let v=1;const f=Math.min(null!==(l=null==c?void 0:c.columnSpan)&&void 0!==l?l:1,i-d);for(;v<f&&!s[a][d+v];)v++;const p={row:a,column:d,rowSpan:u,columnSpan:v};for(let t=a;t<a+u;t++)for(let i=d;i<d+v;i++)s[t][i]=p;n.push(p)}return{cells:n,covered:r}}const j=t=>Math.round(100*t)/100,R=new Set(["bn-asset","bn-component-style","bn-dataset","bn-datasource","bn-internationalization","bn-ruleset","bn-scaling-group"]),A=new Set(["bn-layout-card"]),O={top:"--bn-baseline-offset-top",left:"--bn-baseline-offset-left",right:"--bn-baseline-offset-right"},k=["row-span","column-span","cell-background"],z=t(class extends i{validateRowHeaders(t){const i="ERR_rowHeaders",e=m(t);e.length>0?this.errors.addOrReplace({id:i,type:"error",message:"row-headers: "+e.join("; ")}):this.errors.remove(i),this.updateGridConfig()}validateColumnHeaders(t){const i="ERR_columnHeaders",e=m(t);e.length>0?this.errors.addOrReplace({id:i,type:"error",message:"column-headers: "+e.join("; ")}):this.errors.remove(i),this.updateGridConfig()}validateCellHeight(t){this.resolvedHeight=this.validateChoice("cell-height","ERR_cellHeight",t,b,"auto")}validateCellWidth(t){this.resolvedWidth=this.validateChoice("cell-width","ERR_cellWidth",t,b,"auto")}validateCellVerticalAlign(t){this.resolvedVertical=this.validateChoice("cell-vertical-align","ERR_cellVerticalAlign",t,w,"top"),this.schedule()}validateCellHorizontalAlign(t){this.resolvedHorizontal=this.validateChoice("cell-horizontal-align","ERR_cellHorizontalAlign",t,y,"left"),this.schedule()}validateCellCaptions(t){const i=function(t){if(void 0===t||""===t.trim())return{};let i;try{i=JSON.parse(t)}catch(t){return}if("object"!=typeof i||null===i||Array.isArray(i))return;const e={};for(const[t,o]of Object.entries(i)){if("string"!=typeof o)return;""!==o&&(e[t]=o)}return e}(t);i?this.errors.remove("ERR_cellCaptions"):this.errors.addOrReplace({id:"ERR_cellCaptions",type:"error",message:"cell-captions: not a JSON object from slot name to text."}),this.captions=null!=i?i:{}}constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.gridConfig={rows:[],columns:[]},this.resolvedHeight="auto",this.resolvedWidth="auto",this.resolvedVertical="top",this.resolvedHorizontal="left",this.captions={},this.offsets={},this.cellAttributes={},this.placed=[],this.frames=new Map,this.observed=new WeakSet,this.scheduled=!1,this.run=0,this.adjustments=0,this.chartTitle="",this.rowHeaders="[]",this.columnHeaders="[]",this.showRowHeaders=!0,this.showColumnHeaders=!0,this.showBorders=!0,this.rowHeaderWidth="auto",this.cellGap="0px",this.cellHeight="auto",this.cellWidth="auto",this.cellVerticalAlign="top",this.cellHorizontalAlign="left",this.cellCaptions="",this.schedule=()=>{if(!this.isBaselineMode())return this.run++,Object.keys(this.offsets).length>0&&(this.offsets={}),void this.applyFrameOffsets();this.scheduled||(this.scheduled=!0,this.holdStatus(new Promise((t=>{requestAnimationFrame((()=>{this.scheduled=!1,this.align().catch((t=>console.error("bn-grid: aligning the baselines failed",t))).finally(t)}))}))))},u(this),this.holdStatus=c(this),this.errors=f(this),this.componentStyle=v(this)}connectedCallback(){var t;this.observed=new WeakSet,this.resizeObserver=new ResizeObserver(this.schedule),this.mutationObserver=new MutationObserver((()=>{this.readCellAttributes(),this.checkCoveredSlots(),this.schedule()})),this.mutationObserver.observe(this.element,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["slot",...k]}),null===(t=document.fonts)||void 0===t||t.addEventListener("loadingdone",this.schedule),this.readCellAttributes()}disconnectedCallback(){var t,i,e;null===(t=this.resizeObserver)||void 0===t||t.disconnect(),null===(i=this.mutationObserver)||void 0===i||i.disconnect(),null===(e=document.fonts)||void 0===e||e.removeEventListener("loadingdone",this.schedule),this.run++}componentDidRender(){this.schedule()}validateChoice(t,i,e,o,l){return null==e||""===e?(this.errors.remove(i),l):o.includes(e)?(this.errors.remove(i),e):(this.errors.addOrReplace({id:i,type:"error",message:`${t}: "${e}" is not one of ${o.join(", ")}.`}),l)}readCellAttributes(){const t={},i=[];for(const e of Array.from(this.element.children)){const o=e.getAttribute("slot");if(null===o)continue;const l=t=>{const l=x(e.getAttribute(t));return void 0===l&&i.push(`${t} of slot "${o}"`),null!=l?l:1},s={rowSpan:l("row-span"),columnSpan:l("column-span")},n=e.getAttribute("cell-background");n&&(s.background=n),(s.rowSpan>1||s.columnSpan>1||s.background)&&(t[o]=s)}i.length>0?this.errors.addOrReplace({id:"ERR_cellSpan",type:"error",message:i.join(", ")+": not a whole number from 1."}):this.errors.remove("ERR_cellSpan"),JSON.stringify(t)!==JSON.stringify(this.cellAttributes)&&(this.cellAttributes=t)}placeDataCells(){const{rows:t,columns:i}=this.gridConfig,e=(e,o)=>g(t[e],i[o]),{cells:o}=H(t.length,i.length,((t,i)=>this.cellAttributes[e(t,i)]));this.placed=o.map((t=>Object.assign(Object.assign({},t),{slot:e(t.row,t.column)}))),this.checkCoveredSlots()}checkCoveredSlots(){var t;const{rows:i,columns:e}=null!==(t=this.gridConfig)&&void 0!==t?t:{rows:[],columns:[]},o=(t,o)=>g(i[t],e[o]),{covered:l}=H(i.length,e.length,((t,i)=>this.cellAttributes[o(t,i)])),s=new Set(Array.from(this.element.children).map((t=>t.getAttribute("slot")))),n=l.filter((({row:t,column:i})=>s.has(o(t,i))));if(n.length>0){const t=n.map((({row:t,column:i,by:e})=>`"${o(t,i)}" (covered by "${o(e.row,e.column)}")`));this.errors.addOrReplace({id:"WARN_cellSpan",type:"warning",message:`a span covers the slot ${t.join(", ")}: its content is not shown.`})}else this.errors.remove("WARN_cellSpan")}isBaselineMode(){return"baseline"===this.resolvedVertical||"baseline"===this.resolvedHorizontal}contentIn(t){const i=Array.from(this.element.children).find((i=>i.getAttribute("slot")===t));if(!i)return{};const e=[i,...Array.from(i.querySelectorAll("*"))],o=e.find((t=>t.localName.startsWith("bn-")&&!R.has(t.localName)&&!A.has(t.localName))),l=o?e.find((t=>A.has(t.localName)&&t.contains(o))):void 0;return{visual:o,frame:l}}applyFrameOffsets(){this.frames.forEach(((t,i)=>{const e=this.offsets[i];Object.keys(O).forEach((i=>{const o=null==e?void 0:e[i];o?t.style.setProperty(O[i],o+"px"):t.style.removeProperty(O[i])}))}))}async align(){var t;const i=++this.run;if(!this.element.isConnected||!this.isBaselineMode())return;const e=this.placed,o=e.map((({slot:t})=>this.contentIn(t))),l=o.map((t=>t.visual));if(await Promise.all(l.map((t=>{var i;return null===(i=null==t?void 0:t.componentOnReady)||void 0===i?void 0:i.call(t)}))),i!==this.run)return;l.forEach((t=>t&&this.observe(t)));const s=await Promise.all(l.map((t=>"function"==typeof(null==t?void 0:t.getBaseline)?t.getBaseline().catch((()=>({}))):Promise.resolve({}))));if(i!==this.run)return;const n=h(this.element),r=new Map;null===(t=this.element.shadowRoot)||void 0===t||t.querySelectorAll(".grid-slot").forEach((t=>{var i;r.set(null!==(i=t.getAttribute("data-slot"))&&void 0!==i?i:"",t)})),this.frames=new Map,o.forEach((({frame:t},i)=>t&&this.frames.set(e[i].slot,t)));const a=function(t,i,e){const o={};for(const i of t)o[i.slot]={};const l=(i,e,l,s,n)=>{var r,a;const d=new Map;for(const o of t)(null!==(r=o[e])&&void 0!==r?r:1)>1||d.set(o[i],[...null!==(a=d.get(o[i]))&&void 0!==a?a:[],o]);for(const t of d.values()){const i=t.map((t=>{const i=l(t);return void 0===i?void 0:i-s(t)})),e=i.filter((t=>void 0!==t)),r=e.length>0?Math.max(...e):0,a=i.map((t=>void 0===t?void 0:j(r-t))),d=Math.max(0,...a.filter((t=>void 0!==t)));t.forEach(((t,i)=>n(o[t.slot],a[i],d)))}};return i&&l("row","rowSpan",(t=>t.y),(t=>t.top),((t,i)=>{void 0===i?t.bottom=!0:t.top=i})),e&&l("column","columnSpan",(t=>t.x),(t=>t.left),((t,i,e)=>{void 0!==i&&(t.left=i);const o=j(e-(null!=i?i:0));o>0&&(t.right=o)})),o}(e.map((({slot:t,row:i,column:e,rowSpan:a,columnSpan:d},h)=>{const c=l[h],u=s[h],v=o[h].frame,f=null!=v?v:r.get(t),p=t=>parseFloat((null==f?void 0:f.style.getPropertyValue(t))||"0")||0,g={slot:t,row:i,column:e,rowSpan:a,columnSpan:d,top:p(v?O.top:"padding-top"),left:p(v?O.left:"margin-left")};if(c){const t=n.toLocal(c.getBoundingClientRect());void 0!==u.y&&(g.y=t.y+u.y),void 0!==u.x&&(g.x=t.x+u.x)}return g})),"baseline"===this.resolvedVertical,"baseline"===this.resolvedHorizontal);if(function(t,i){var e,o,l,s,n,r,a,d;const h=new Set([...Object.keys(t),...Object.keys(i)]);for(const c of h){const h=null!==(e=t[c])&&void 0!==e?e:{},u=null!==(o=i[c])&&void 0!==o?o:{};if(!!h.bottom!=!!u.bottom)return!1;if(Math.abs((null!==(l=h.top)&&void 0!==l?l:0)-(null!==(s=u.top)&&void 0!==s?s:0))>=.5)return!1;if(Math.abs((null!==(n=h.left)&&void 0!==n?n:0)-(null!==(r=u.left)&&void 0!==r?r:0))>=.5)return!1;if(Math.abs((null!==(a=h.right)&&void 0!==a?a:0)-(null!==(d=u.right)&&void 0!==d?d:0))>=.5)return!1}return!0}(a,this.offsets))this.adjustments=0;else{if(this.adjustments>=5)return console.warn("bn-grid: the baselines did not settle; the cells keep their last alignment."),void(this.adjustments=0);this.adjustments++,this.offsets=a,this.applyFrameOffsets(),this.schedule()}}observe(t){var i;this.observed.has(t)||(this.observed.add(t),null===(i=this.resizeObserver)||void 0===i||i.observe(t));const e=t=>{var i;t&&(this.observed.has(t)||(this.observed.add(t),null===(i=this.mutationObserver)||void 0===i||i.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["x1","y1","x2","y2","x","y","width","height","transform","style","class"]})),t.querySelectorAll("*").forEach((t=>e(t.shadowRoot))))};e(t.shadowRoot)}async getLayoutState(t){var i,e,o,l;const h=null!==(i=null==t?void 0:t.detail)&&void 0!==i?i:"summary",c=n(this.element),u=this.componentStyle((t=>{var i;return(null===(i=t.global)||void 0===i?void 0:i.fontSizePx)||13.3333})),{rows:v,columns:f}=this.gridConfig,p={version:s,tag:this.element.localName,id:d(this.element),slot:null!==(e=this.element.getAttribute("slot"))&&void 0!==e?e:void 0,rect:r(this.element,c),em:{fontSizePx:u,appliedScaleFactor:1},regions:[],metadata:{title:this.chartTitle||void 0,rowCount:v.length,columnCount:f.length,cellCount:this.placed.length},diagnostics:a(this.element)},g=null===(o=this.element.shadowRoot)||void 0===o?void 0:o.querySelector(".grid-container");if(g&&p.regions.push({id:"grid",rect:r(g,c)}),"full"!==h||!g)return p;const m=[],b=t=>m.push(t),w=g.querySelector(".grid-title");return w&&b({kind:"gridTitle",label:(null===(l=w.textContent)||void 0===l?void 0:l.trim())||void 0,rect:r(w,c)}),g.querySelectorAll(".grid-header-col").forEach(((t,i)=>{var e,o;b({kind:"gridHeader",columnId:null===(e=f[i])||void 0===e?void 0:e.id,label:(null===(o=t.textContent)||void 0===o?void 0:o.trim())||void 0,rect:r(t,c)})})),g.querySelectorAll(".grid-header-row").forEach(((t,i)=>{var e,o;b({kind:"gridHeader",rowId:null===(e=v[i])||void 0===e?void 0:e.id,label:(null===(o=t.textContent)||void 0===o?void 0:o.trim())||void 0,rect:r(t,c)})})),g.querySelectorAll(".grid-cell").forEach(((t,i)=>{var e,o,l,s;const n=this.placed[i];b(Object.assign(Object.assign(Object.assign({kind:"gridCell",rowId:n?null===(e=v[n.row])||void 0===e?void 0:e.id:void 0,columnId:n?null===(o=f[n.column])||void 0===o?void 0:o.id:void 0,slot:null!==(s=null===(l=t.querySelector("slot"))||void 0===l?void 0:l.getAttribute("name"))&&void 0!==s?s:void 0},(null==n?void 0:n.rowSpan)>1?{rowSpan:n.rowSpan}:{}),(null==n?void 0:n.columnSpan)>1?{columnSpan:n.columnSpan}:{}),{rect:r(t,c)}))})),g.querySelectorAll(".grid-caption").forEach((t=>{var i,e,o,l;b({kind:"gridCaption",slot:null!==(o=null===(e=null===(i=t.parentElement)||void 0===i?void 0:i.querySelector("slot"))||void 0===e?void 0:e.getAttribute("name"))&&void 0!==o?o:void 0,label:(null===(l=t.textContent)||void 0===l?void 0:l.trim())||void 0,rect:r(t,c)})})),p.elements=m,p}getGridStyle(){return this.componentStyle((t=>t["bn-grid"]))}componentWillLoad(){this.validateRowHeaders(this.rowHeaders),this.validateColumnHeaders(this.columnHeaders),this.validateCellHeight(this.cellHeight),this.validateCellWidth(this.cellWidth),this.validateCellVerticalAlign(this.cellVerticalAlign),this.validateCellHorizontalAlign(this.cellHorizontalAlign),this.validateCellCaptions(this.cellCaptions),this.readCellAttributes()}componentWillRender(){this.placeDataCells()}updateGridConfig(){this.gridConfig=function(t,i){return{rows:p(t),columns:p(i)}}(this.rowHeaders,this.columnHeaders)}shouldShowRowHeaders(){return this.showRowHeaders&&this.gridConfig.rows.length>0}shouldShowColumnHeaders(){return this.showColumnHeaders&&this.gridConfig.columns.length>0}shouldShowBorders(){return this.showBorders}getGridTemplateColumns(){const t=[];this.shouldShowRowHeaders()&&t.push(this.rowHeaderWidth);const i=this.gridConfig.columns.length||1;for(let e=0;e<i;e++)t.push("equal"===this.resolvedWidth?"minmax(0, 1fr)":"auto");return t.join(" ")}getGridTemplateRows(){const t=[];this.chartTitle&&t.push("auto"),this.shouldShowColumnHeaders()&&t.push("auto");const i=this.gridConfig.rows.length||1;for(let e=0;e<i;e++)t.push("equal"===this.resolvedHeight?"1fr":"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(),i=this.shouldShowBorders()?`${t.borderWidth}px solid ${t.borderColor}`:"none",o=this.shouldShowRowHeaders()?2:1,l=this.chartTitle?2:1;return this.gridConfig.columns.map(((s,n)=>{const r=n>0;return e("div",{key:"col-header-"+s.id,class:"grid-header grid-header-col",style:{"grid-column":o+n+"","grid-row":l+"","border-left":r?i:"none",padding:t.cellPadding+"px","padding-left":r?t.cellPadding+4+"px":t.cellPadding+"px"}},s.label)}))}renderDataCells(){const t=this.getGridStyle(),i=this.shouldShowBorders()?`${t.borderWidth}px solid ${t.borderColor}`:"none",o=this.shouldShowRowHeaders()?2:1,l=(this.chartTitle?1:0)+(this.shouldShowColumnHeaders()?1:0)+1,s=[],n=(t,i)=>i>1?`${t} / span ${i}`:t+"";return this.gridConfig.rows.length>0&&this.gridConfig.columns.length>0&&this.gridConfig.rows.forEach(((r,a)=>{if(this.shouldShowRowHeaders()){const o=a>0;s.push(e("div",{key:"row-header-"+r.id,class:"grid-header grid-header-row",style:{"grid-column":"1","grid-row":l+a+"","border-top":o?i:"none",padding:t.cellPadding+"px","padding-top":o?t.cellPadding+4+"px":t.cellPadding+"px"}},r.label))}this.placed.filter((t=>t.row===a)).forEach((({slot:r,column:d,rowSpan:h,columnSpan:c})=>{var u,v;const f=d>0,p=a>0,g=null!==(v=null===(u=this.cellAttributes[r])||void 0===u?void 0:u.background)&&void 0!==v?v:t.cellBackground&&"transparent"!==t.cellBackground?t.cellBackground:void 0;s.push(e("div",{key:"cell-"+r,class:"grid-cell","data-bn-fit-content":"",style:Object.assign(Object.assign({"grid-column":n(o+d,c),"grid-row":n(l+a,h),"border-left":f?i:"none","border-top":p?i:"none","padding-left":f?t.cellPadding+4+"px":"0","padding-top":p?t.cellPadding+4+"px":"0"},this.cellAlignStyle()),g?{"background-color":g}:{})},this.renderCellContent(r,t)))}))})),s}cellAlignStyle(){return"top"===this.resolvedVertical&&"left"===this.resolvedHorizontal?{}:{display:"flex","flex-direction":"column","justify-content":C[this.resolvedVertical],"align-items":S[this.resolvedHorizontal]}}renderCellContent(t,i){var o;const l=this.captions[t],s=void 0!==l?e("div",{class:"grid-caption",style:{"font-size":i.captionFontSize+"px","font-weight":i.captionFontWeight+"",color:i.captionColor,"margin-bottom":i.captionGap+"px","align-self":"flex-start"}},l):null,n={};"top"===this.resolvedVertical&&"left"===this.resolvedHorizontal||(n["align-self"]="stretch","center"!==this.resolvedHorizontal&&"right"!==this.resolvedHorizontal||(n.display="flex",n["flex-direction"]="column",n["align-items"]=S[this.resolvedHorizontal])),"center"===this.resolvedVertical?(n["margin-top"]="auto",n["margin-bottom"]="auto"):"bottom"===this.resolvedVertical&&(n["margin-top"]="auto");const r=this.frames.has(t)?{bottom:null===(o=this.offsets[t])||void 0===o?void 0:o.bottom}:this.offsets[t];return(null==r?void 0:r.bottom)&&(n["margin-top"]="auto"),(null==r?void 0:r.top)&&(n["padding-top"]=r.top+"px"),(null==r?void 0:r.left)&&(n["margin-left"]=r.left+"px"),(null==r?void 0:r.right)&&(n["margin-right"]=r.right+"px"),[s,e("div",{class:"grid-slot","data-slot":t,style:n},e("slot",{name:t}))]}getFontStyles(){return this.componentStyle((t=>{var i,e,o,l;return{"--bn-font-family":(null===(i=t.global)||void 0===i?void 0:i.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":((null===(e=t.global)||void 0===e?void 0:e.fontSizePx)||13.3333)+"px","--bn-font-color":(null===(o=t.global)||void 0===o?void 0:o.fontColor)||"#000000","--bn-font-background":(null===(l=t.global)||void 0===l?void 0:l.fontBackgroundColor)||"#ffffff"}}))}render(){const t="equal"===this.resolvedWidth,i=Object.assign(Object.assign({display:t?"grid":"inline-grid"},t?{width:"100%"}:{}),{"grid-template-columns":this.getGridTemplateColumns(),"grid-template-rows":this.getGridTemplateRows(),gap:this.cellGap});return e(o,{key:"97d858fb6f5704dfd46638c8e5c6a74927e702e0",style:t?Object.assign(Object.assign({},this.getFontStyles()),{display:"block"}):this.getFontStyles()},e("div",{key:"1e218eac5865574fcb4572d1aaea60f1d87d8948",class:"grid-container",style:i},this.renderTitle(),this.renderColumnHeaders(),this.renderDataCells()),e("slot",{key:"aabefa01213c69c0303f1df06f5575973253677e"}))}get element(){return this}static get watchers(){return{rowHeaders:[{validateRowHeaders:0}],columnHeaders:[{validateColumnHeaders:0}],cellHeight:[{validateCellHeight:0}],cellWidth:[{validateCellWidth:0}],cellVerticalAlign:[{validateCellVerticalAlign:0}],cellHorizontalAlign:[{validateCellHorizontalAlign:0}],cellCaptions:[{validateCellCaptions:0}]}}static get style(){return':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}'}},[257,"bn-grid",{selectedStyle:[513,"selected-style"],chartTitle:[1,"chart-title"],rowHeaders:[1,"row-headers"],columnHeaders:[1,"column-headers"],showRowHeaders:[4,"show-row-headers"],showColumnHeaders:[4,"show-column-headers"],i18nNamespace:[513,"i18n-namespace"],showBorders:[4,"show-borders"],rowHeaderWidth:[1,"row-header-width"],cellGap:[1,"cell-gap"],cellHeight:[1,"cell-height"],cellWidth:[1,"cell-width"],cellVerticalAlign:[1,"cell-vertical-align"],cellHorizontalAlign:[1,"cell-horizontal-align"],cellCaptions:[1,"cell-captions"],gridConfig:[32],resolvedHeight:[32],resolvedWidth:[32],resolvedVertical:[32],resolvedHorizontal:[32],captions:[32],offsets:[32],cellAttributes:[32],getLayoutState:[64]},void 0,{rowHeaders:[{validateRowHeaders:0}],columnHeaders:[{validateColumnHeaders:0}],cellHeight:[{validateCellHeight:0}],cellWidth:[{validateCellWidth:0}],cellVerticalAlign:[{validateCellVerticalAlign:0}],cellHorizontalAlign:[{validateCellHorizontalAlign:0}],cellCaptions:[{validateCellCaptions:0}]}]),$=z,M=function(){"undefined"!=typeof customElements&&["bn-grid"].forEach((t=>{"bn-grid"===t&&(customElements.get(l(t))||customElements.define(l(t),z))}))};export{$ as BnGrid,M as defineCustomElement}
@@ -1 +1 @@
1
- import{p as t,H as s,h as e,a as i,t as o}from"./p-D6YGOYV1.js";import{w as n}from"./p-uCpFBDF5.js";import{w as r}from"./p-Dq9dG0Kr.js";import{w as l}from"./p-9X5fVJqR.js";import{g as a}from"./p-Cxx0YNnl.js";import{w as c}from"./p-4vVbchX2.js";const m=t(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),n(this),r(this),this.errors=c(this),this.componentStyle=l(this)}connectedCallback(){this.stores=a(this.element)}getFontStyles(){return this.componentStyle((t=>{var s,e,i,o;return{"--bn-font-family":(null===(s=t.global)||void 0===s?void 0:s.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":((null===(e=t.global)||void 0===e?void 0:e.fontSizePx)||13.3333)+"px","--bn-font-color":(null===(i=t.global)||void 0===i?void 0:i.fontColor)||"#000000","--bn-font-background":(null===(o=t.global)||void 0===o?void 0:o.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 e(i,{key:"b303581057c183cc27eb13cfdc389c6b008e9172",style:this.getFontStyles()},null!=this.source&&""!==this.source?e("img",{src:this.prepareAssetUrl(this.source)}):"")}get element(){return this}static get style(){return":host{display:inline-block;position:relative;overflow:hidden}img{max-width:100%;height:auto}"}},[1,"bn-image",{selectedStyle:[513,"selected-style"],source:[1]}]),f=m,h=function(){"undefined"!=typeof customElements&&["bn-image"].forEach((t=>{"bn-image"===t&&(customElements.get(o(t))||customElements.define(o(t),m))}))};export{f as BnImage,h as defineCustomElement}
1
+ import{p as t,H as s,h as e,d as i,t as o}from"./p-BnmylmXF.js";import{w as n}from"./p-D_K7tYhY.js";import{w as r}from"./p-BrQCbmG0.js";import{w as l}from"./p-JG4Sx1lE.js";import{g as m}from"./p-6242qMx1.js";import{w as a}from"./p-D32TsLzd.js";const c=t(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),n(this),r(this),this.errors=a(this),this.componentStyle=l(this)}connectedCallback(){this.stores=m(this.element)}getFontStyles(){return this.componentStyle((t=>{var s,e,i,o;return{"--bn-font-family":(null===(s=t.global)||void 0===s?void 0:s.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":((null===(e=t.global)||void 0===e?void 0:e.fontSizePx)||13.3333)+"px","--bn-font-color":(null===(i=t.global)||void 0===i?void 0:i.fontColor)||"#000000","--bn-font-background":(null===(o=t.global)||void 0===o?void 0:o.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 e(i,{key:"b303581057c183cc27eb13cfdc389c6b008e9172",style:this.getFontStyles()},null!=this.source&&""!==this.source?e("img",{src:this.prepareAssetUrl(this.source)}):"")}get element(){return this}static get style(){return":host{display:inline-block;position:relative;overflow:hidden}img{max-width:100%;height:auto}"}},[1,"bn-image",{selectedStyle:[513,"selected-style"],source:[1]}]),f=c,h=function(){"undefined"!=typeof customElements&&["bn-image"].forEach((t=>{"bn-image"===t&&(customElements.get(o(t))||customElements.define(o(t),c))}))};export{f as BnImage,h as defineCustomElement}
@@ -1 +1 @@
1
- import{p as t,H as s,h as e,a as o,t as i}from"./p-D6YGOYV1.js";import{w as n}from"./p-Do4oPrkE.js";import{g as r,b as a,R as c}from"./p-Cxx0YNnl.js";import{e as m}from"./p-ClruFZD_.js";import{w as h}from"./p-Dq9dG0Kr.js";import{w as b}from"./p-4vVbchX2.js";const p=t(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.namespace="_system",h(this),this.errors=b(this),n(this,(t=>{if(this.stores||(this.stores=r(this.element)),""!==t.trim())try{const s=JSON.parse(t);if(null===s||"object"!=typeof s||Array.isArray(s))throw Error("not a JSON object.");const e=a(s);for(const[t,s]of Object.entries(c))t in e&&!(s in e)&&(e[s]=e[t]);const o=this.namespace||"_system",i=Object.assign({},this.stores.internationalization.get(o));i[this.code]=Object.assign(Object.assign({},i[this.code]),e),this.stores.internationalization.set(o,i),this.errors.remove("ERR_body")}catch(t){this.errors.addOrReplace({id:"ERR_body",type:"error",message:"Body: "+m(t)})}else this.errors.remove("ERR_body")}))}render(){return e(o,{key:"7e7454bf0b02ea746a736daaabb09c9ff52b3775"})}get element(){return this}static get style(){return"bn-internationalization{display:none}"}},[0,"bn-internationalization",{code:[1],namespace:[1]}]),f=p,l=function(){"undefined"!=typeof customElements&&["bn-internationalization"].forEach((t=>{"bn-internationalization"===t&&(customElements.get(i(t))||customElements.define(i(t),p))}))};export{f as BnInternationalization,l as defineCustomElement}
1
+ import{p as t,H as s,h as e,d as i,t as o}from"./p-BnmylmXF.js";import{w as n}from"./p-BP2sJ8k9.js";import{g as r,b as a,R as m}from"./p-6242qMx1.js";import{e as c}from"./p-ClruFZD_.js";import{w as b}from"./p-BrQCbmG0.js";import{w as h}from"./p-D32TsLzd.js";const p=t(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.namespace="_system",b(this),this.errors=h(this),n(this,(t=>{if(this.stores||(this.stores=r(this.element)),""!==t.trim())try{const s=JSON.parse(t);if(null===s||"object"!=typeof s||Array.isArray(s))throw Error("not a JSON object.");const e=a(s);for(const[t,s]of Object.entries(m))t in e&&!(s in e)&&(e[s]=e[t]);const i=this.namespace||"_system",o=Object.assign({},this.stores.internationalization.get(i));o[this.code]=Object.assign(Object.assign({},o[this.code]),e),this.stores.internationalization.set(i,o),this.errors.remove("ERR_body")}catch(t){this.errors.addOrReplace({id:"ERR_body",type:"error",message:"Body: "+c(t)})}else this.errors.remove("ERR_body")}))}render(){return e(i,{key:"7e7454bf0b02ea746a736daaabb09c9ff52b3775"})}get element(){return this}static get style(){return"bn-internationalization{display:none}"}},[0,"bn-internationalization",{code:[1],namespace:[1]}]),f=p,l=function(){"undefined"!=typeof customElements&&["bn-internationalization"].forEach((t=>{"bn-internationalization"===t&&(customElements.get(o(t))||customElements.define(o(t),p))}))};export{f as BnInternationalization,l as defineCustomElement}
@@ -1 +1 @@
1
- import{p as t,H as e,h as s,F as i,t as r}from"./p-D6YGOYV1.js";import{g as a}from"./p-Cxx0YNnl.js";import{w as n}from"./p-Dq9dG0Kr.js";import{w as o}from"./p-9X5fVJqR.js";import{w as l}from"./p-4vVbchX2.js";import{a as d}from"./p-Bj3RWsEx.js";import{t as c,a as m,b as h,c as p,C as f,d as b}from"./p-Dq4KMCDU.js";import{d as u}from"./p-rEdNIgD8.js";import{d as g}from"./p-DkCeSWKR.js";import{d as y}from"./p-CgJB5mCu.js";import{d as x}from"./p-BoBamuPt.js";import{d as v}from"./p-DROj8gke.js";const k=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.titleImage="",this.titleBusinessUnit="",this.titleOrder="category",this.titleOrderDirection="asc",this.titleDateFormat="none",this.titleDateLink="none",this.footerText="",this.cardLayout="full",this.cardCustomTemplate='"a b" "c d"',this.cardGridGap="0",this.cardFitToContent=!1,this.cardShowBorder=!0,n(this),this.errors=l(this),this.componentStyle=o(this),this.resolveInherited=d(this,[{propName:"titleScenarios",ancestorAttr:"title-scenarios"},{propName:"titleVariances",ancestorAttr:"title-variances"},{propName:"titleOrder",ancestorAttr:"title-order"},{propName:"titleOrderDirection",ancestorAttr:"title-order-direction"},{propName:"ruleset",ancestorAttr:"ruleset"}])}connectedCallback(){this.stores=a(this.element)}getCommonStyles(){let t="100%";return!0===this.cardFitToContent&&(t="fit-content"),{display:"grid",height:t,width:"100%",gap:this.cardGridGap+"px"}}getGridTemplateColumns(t){return c(this.getTemplatePattern(t))}getRowCount(t){return m(this.getTemplatePattern(t)).length||1}getGridTemplateRows(t){const e=this.getRowCount(t);return this.cardFitToContent?Array(e).fill("auto").join(" "):Array(e).fill("minmax(0, 1fr)").join(" ")}getLayoutStyle(){return Object.assign(Object.assign({},this.getCommonStyles()),{"grid-template-areas":this.getTemplatePattern(this.cardLayout),"grid-template-columns":this.getGridTemplateColumns(this.cardLayout),"grid-template-rows":this.getGridTemplateRows(this.cardLayout)})}createDivAreaStyles(t){return t.map((t=>({display:"flex",overflow:"hidden","grid-area":t})))}getSlots(t){const e=this.createDivAreaStyles(t);return s(i,null,e.map(((t,e)=>s("div",{style:t},s("slot",{name:"card-slot-"+e})))))}extractSlotNames(t){return h(t)}getTemplatePattern(t){return p(t,this.cardCustomTemplate)}componentWillRender(){const t=this.cardLayout===f?b(this.cardCustomTemplate):void 0;t?this.errors.addOrReplace({id:"WARN_cardCustomTemplate",type:"warning",message:"cardCustomTemplate: "+t}):this.errors.remove("WARN_cardCustomTemplate")}setCardClass(){return!0===this.cardShowBorder?"card_box border":"card_box"}titleProp(t){return this.resolveInherited(t,this[t],"").value}prepareTitleImage(t){if(null==t||""===t)return"";const e=this.stores.assets.state;return t.startsWith("asset:")?e[t.substring(6)]:e[t]||t}render(){var t;const e=this.getLayoutStyle(),i=this.extractSlotNames(e["grid-template-areas"]);return s("bn-card",{key:"3db479047905de01ac517491f2d68a9bd0a3a576",styles:this.styles,"selected-style":this.selectedStyle,class:this.setCardClass()},s("div",{key:"fd9948acd84ce55badf87a7e03d733d1e75a1bea",class:"cardtitle"},s("bn-title",{key:"21200c96fb03d403fa616b093d753ea4b746c6f2","i18n-namespace":null!==(t=this.i18nNamespace)&&void 0!==t?t:this.titleNamespace,ruleset:this.titleProp("ruleset"),"title-font-size":this.componentStyle((t=>{var e;return null===(e=null==t?void 0:t["bn-layout-card"])||void 0===e?void 0:e.titleFontSize})),"business-unit":this.titleBusinessUnit,scenarios:this.titleProp("titleScenarios"),variances:this.titleProp("titleVariances"),order:this.titleProp("titleOrder"),"order-direction":this.titleProp("titleOrderDirection"),measures:this.titleMeasures,"date-start":this.titleDateStart,"date-end":this.titleDateEnd,"date-format":this.titleDateFormat,"date-link":this.titleDateLink}),null!=this.titleImage&&""!==this.titleImage?s("img",{class:"image",src:this.prepareTitleImage(this.titleImage)}):""),s("bn-body",{key:"c5b1957822ff216d33084154afdf6deb3e4426cc"},s("div",{key:"bc17f6f73825894641f775137eaefd5059a25cf6",style:e,"data-bn-fit-content":this.cardFitToContent?this.getRowCount(this.cardLayout)+"":null},this.getSlots(i))),s("bn-footer",{key:"cfbeba76eaf11358e92002d309cafae19d2525e2",text:this.footerText,"page-number":"0","display-page-number":"false"}))}get element(){return this}static get style(){return':host{--bn-baseline-offset-top:0px;--bn-baseline-offset-left:0px;--bn-baseline-offset-right:0px;background:var(--bn-font-background, white);color:var(--bn-font-color, black);font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);display:flex;flex-direction:column;width:100%;height:100%;overflow:hidden}.cardtitle{display:inline-flex}::slotted(*){flex:1 1 auto;min-width:0}.image{margin-right:0.5em;margin-top:0.5em;z-index:2;background-color:transparent;border:transparent;height:4em;width:auto;display:inline}bn-body{box-sizing:border-box;padding:var(--bn-baseline-offset-top) var(--bn-baseline-offset-right) 0 var(--bn-baseline-offset-left)}'}},[257,"bn-layout-card",{styles:[1],selectedStyle:[1,"selected-style"],ruleset:[1],titleImage:[1,"title-image"],titleBusinessUnit:[1,"title-business-unit"],titleScenarios:[1,"title-scenarios"],titleVariances:[1,"title-variances"],titleOrder:[1,"title-order"],titleOrderDirection:[1,"title-order-direction"],titleMeasures:[1,"title-measures"],titleDateStart:[1,"title-date-start"],titleDateEnd:[1,"title-date-end"],titleDateFormat:[1,"title-date-format"],titleDateLink:[1,"title-date-link"],titleNamespace:[1,"title-namespace"],i18nNamespace:[513,"i18n-namespace"],footerText:[1,"footer-text"],cardLayout:[1,"card-layout"],cardCustomTemplate:[1,"card-custom-template"],cardGridGap:[1,"card-grid-gap"],cardFitToContent:[4,"card-fit-to-content"],cardShowBorder:[4,"card-show-border"]}]),w=k,C=function(){"undefined"!=typeof customElements&&["bn-layout-card","bn-body","bn-card","bn-footer","bn-title","bn-title-renderer"].forEach((t=>{switch(t){case"bn-layout-card":customElements.get(r(t))||customElements.define(r(t),k);break;case"bn-body":customElements.get(r(t))||u();break;case"bn-card":customElements.get(r(t))||g();break;case"bn-footer":customElements.get(r(t))||y();break;case"bn-title":customElements.get(r(t))||x();break;case"bn-title-renderer":customElements.get(r(t))||v()}}))};export{w as BnLayoutCard,C as defineCustomElement}
1
+ import{p as t,H as e,h as s,F as i,t as r}from"./p-BnmylmXF.js";import{g as a}from"./p-6242qMx1.js";import{w as n}from"./p-BrQCbmG0.js";import{w as o}from"./p-JG4Sx1lE.js";import{w as l}from"./p-D32TsLzd.js";import{a as d}from"./p-CUoPUIej.js";import{t as c,a as m,b as h,c as p,C as b,d as f}from"./p-Dq4KMCDU.js";import{d as u}from"./p-DMAaBt7n.js";import{d as g}from"./p-4xaxuPVU.js";import{d as y}from"./p-2t-lysdb.js";import{d as x}from"./p-BgdoWKFY.js";import{d as v}from"./p-DJSj3oQq.js";const k=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.titleImage="",this.titleBusinessUnit="",this.titleOrder="category",this.titleOrderDirection="asc",this.titleDateFormat="none",this.titleDateLink="none",this.footerText="",this.cardLayout="full",this.cardCustomTemplate='"a b" "c d"',this.cardGridGap="0",this.cardFitToContent=!1,this.cardShowBorder=!0,n(this),this.errors=l(this),this.componentStyle=o(this),this.resolveInherited=d(this,[{propName:"titleScenarios",ancestorAttr:"title-scenarios"},{propName:"titleVariances",ancestorAttr:"title-variances"},{propName:"titleOrder",ancestorAttr:"title-order"},{propName:"titleOrderDirection",ancestorAttr:"title-order-direction"},{propName:"ruleset",ancestorAttr:"ruleset"}])}connectedCallback(){this.stores=a(this.element)}getCommonStyles(){let t="100%";return!0===this.cardFitToContent&&(t="fit-content"),{display:"grid",height:t,width:"100%",gap:this.cardGridGap+"px"}}getGridTemplateColumns(t){return c(this.getTemplatePattern(t))}getRowCount(t){return m(this.getTemplatePattern(t)).length||1}getGridTemplateRows(t){const e=this.getRowCount(t);return this.cardFitToContent?Array(e).fill("auto").join(" "):Array(e).fill("minmax(0, 1fr)").join(" ")}getLayoutStyle(){return Object.assign(Object.assign({},this.getCommonStyles()),{"grid-template-areas":this.getTemplatePattern(this.cardLayout),"grid-template-columns":this.getGridTemplateColumns(this.cardLayout),"grid-template-rows":this.getGridTemplateRows(this.cardLayout)})}createDivAreaStyles(t){return t.map((t=>({display:"flex",overflow:"hidden","grid-area":t})))}getSlots(t){const e=this.createDivAreaStyles(t);return s(i,null,e.map(((t,e)=>s("div",{style:t},s("slot",{name:"card-slot-"+e})))))}extractSlotNames(t){return h(t)}getTemplatePattern(t){return p(t,this.cardCustomTemplate)}componentWillRender(){const t=this.cardLayout===b?f(this.cardCustomTemplate):void 0;t?this.errors.addOrReplace({id:"WARN_cardCustomTemplate",type:"warning",message:"cardCustomTemplate: "+t}):this.errors.remove("WARN_cardCustomTemplate")}setCardClass(){return!0===this.cardShowBorder?"card_box border":"card_box"}titleProp(t){return this.resolveInherited(t,this[t],"").value}prepareTitleImage(t){if(null==t||""===t)return"";const e=this.stores.assets.state;return t.startsWith("asset:")?e[t.substring(6)]:e[t]||t}render(){var t;const e=this.getLayoutStyle(),i=this.extractSlotNames(e["grid-template-areas"]);return s("bn-card",{key:"3db479047905de01ac517491f2d68a9bd0a3a576",styles:this.styles,"selected-style":this.selectedStyle,class:this.setCardClass()},s("div",{key:"fd9948acd84ce55badf87a7e03d733d1e75a1bea",class:"cardtitle"},s("bn-title",{key:"21200c96fb03d403fa616b093d753ea4b746c6f2","i18n-namespace":null!==(t=this.i18nNamespace)&&void 0!==t?t:this.titleNamespace,ruleset:this.titleProp("ruleset"),"title-font-size":this.componentStyle((t=>{var e;return null===(e=null==t?void 0:t["bn-layout-card"])||void 0===e?void 0:e.titleFontSize})),"business-unit":this.titleBusinessUnit,scenarios:this.titleProp("titleScenarios"),variances:this.titleProp("titleVariances"),order:this.titleProp("titleOrder"),"order-direction":this.titleProp("titleOrderDirection"),measures:this.titleMeasures,"date-start":this.titleDateStart,"date-end":this.titleDateEnd,"date-format":this.titleDateFormat,"date-link":this.titleDateLink}),null!=this.titleImage&&""!==this.titleImage?s("img",{class:"image",src:this.prepareTitleImage(this.titleImage)}):""),s("bn-body",{key:"c5b1957822ff216d33084154afdf6deb3e4426cc"},s("div",{key:"bc17f6f73825894641f775137eaefd5059a25cf6",style:e,"data-bn-fit-content":this.cardFitToContent?this.getRowCount(this.cardLayout)+"":null},this.getSlots(i))),s("bn-footer",{key:"cfbeba76eaf11358e92002d309cafae19d2525e2",text:this.footerText,"page-number":"0","display-page-number":"false"}))}get element(){return this}static get style(){return':host{--bn-baseline-offset-top:0px;--bn-baseline-offset-left:0px;--bn-baseline-offset-right:0px;background:var(--bn-font-background, white);color:var(--bn-font-color, black);font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);display:flex;flex-direction:column;width:100%;height:100%;overflow:hidden}.cardtitle{display:inline-flex}::slotted(*){flex:1 1 auto;min-width:0}.image{margin-right:0.5em;margin-top:0.5em;z-index:2;background-color:transparent;border:transparent;height:4em;width:auto;display:inline}bn-body{box-sizing:border-box;padding:var(--bn-baseline-offset-top) var(--bn-baseline-offset-right) 0 var(--bn-baseline-offset-left)}'}},[257,"bn-layout-card",{styles:[1],selectedStyle:[1,"selected-style"],ruleset:[1],titleImage:[1,"title-image"],titleBusinessUnit:[1,"title-business-unit"],titleScenarios:[1,"title-scenarios"],titleVariances:[1,"title-variances"],titleOrder:[1,"title-order"],titleOrderDirection:[1,"title-order-direction"],titleMeasures:[1,"title-measures"],titleDateStart:[1,"title-date-start"],titleDateEnd:[1,"title-date-end"],titleDateFormat:[1,"title-date-format"],titleDateLink:[1,"title-date-link"],titleNamespace:[1,"title-namespace"],i18nNamespace:[513,"i18n-namespace"],footerText:[1,"footer-text"],cardLayout:[1,"card-layout"],cardCustomTemplate:[1,"card-custom-template"],cardGridGap:[1,"card-grid-gap"],cardFitToContent:[4,"card-fit-to-content"],cardShowBorder:[4,"card-show-border"]}]),w=k,j=function(){"undefined"!=typeof customElements&&["bn-layout-card","bn-body","bn-card","bn-footer","bn-title","bn-title-renderer"].forEach((t=>{switch(t){case"bn-layout-card":customElements.get(r(t))||customElements.define(r(t),k);break;case"bn-body":customElements.get(r(t))||u();break;case"bn-card":customElements.get(r(t))||g();break;case"bn-footer":customElements.get(r(t))||y();break;case"bn-title":customElements.get(r(t))||x();break;case"bn-title-renderer":customElements.get(r(t))||v()}}))};export{w as BnLayoutCard,j as defineCustomElement}
@@ -1 +1 @@
1
- import{p as t,H as e,h as s,F as a,a as i,t as r}from"./p-D6YGOYV1.js";import{s as o}from"./p-DM7fwmH4.js";import{w as n}from"./p-Dq9dG0Kr.js";import{w as l}from"./p-4vVbchX2.js";import{a as m,b as d,c as h,t as c,i as p,C as u,d as b}from"./p-Dq4KMCDU.js";import{d as g}from"./p-rEdNIgD8.js";import{d as f}from"./p-CgJB5mCu.js";import{d as y}from"./p-DbWh9W5D.js";import{d as k}from"./p-G56USTsQ.js";import{d as v}from"./p-BoBamuPt.js";import{d as D}from"./p-DROj8gke.js";const x=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.messageText="",this.messageImage="",this.titleBusinessUnit="",this.titleOrder="category",this.titleOrderDirection="asc",this.titleDateFormat="none",this.titleDateLink="none",this.footerDisplayPageNumber=!0,this.pageLayout="full",this.pageCustomTemplate='"a b" "c d"',this.pageGridGap="0",this.pageFitToContent=!1,n(this),this.errors=l(this)}getCommonStyles(){let t="100%";return!0===this.pageFitToContent&&(t="fit-content"),{display:"grid",height:t,width:"100%",gap:this.pageGridGap+"px"}}getRowCount(t){return m(this.getTemplateAreas(t)).length||1}getGridTemplateRows(t){const e=this.getRowCount(t);return this.pageFitToContent?Array(e).fill("auto").join(" "):Array(e).fill("minmax(0, 1fr)").join(" ")}getLayoutStyle(){return Object.assign(Object.assign({},this.getCommonStyles()),{"grid-template-areas":this.getTemplateAreas(this.pageLayout),"grid-template-columns":this.getGridTemplateColumns(this.pageLayout),"grid-template-rows":this.getGridTemplateRows(this.pageLayout)})}createDivAreaStyles(t){return t.map((t=>({display:"flex",overflow:"hidden","grid-area":t})))}getSlots(t){const e=this.createDivAreaStyles(t);return s(a,null,e.map(((t,e)=>s("div",{style:t},s("slot",{name:"slot-"+e})))))}extractSlotNames(t){return d(t)}getTemplateAreas(t){return h(t,this.pageCustomTemplate)}getGridTemplateColumns(t){return p(t)?c(this.getTemplateAreas(t)):"1fr"}mirror(t,e){null==e?this.element.hasAttribute(t)&&this.element.removeAttribute(t):this.element.getAttribute(t)!==e&&this.element.setAttribute(t,e)}componentWillRender(){this.mirror("page-format",this.pageFormat),this.mirror("page-orientation",this.pageOrientation);const t=this.pageLayout===u?b(this.pageCustomTemplate):void 0;t?this.errors.addOrReplace({id:"WARN_pageCustomTemplate",type:"warning",message:"pageCustomTemplate: "+t}):this.errors.remove("WARN_pageCustomTemplate")}rotation(){var t;const e=null===(t=this.element.closest("bn-context"))||void 0===t?void 0:t.getAttribute("render-orientation"),s=o(this.pageFormat,this.pageOrientation,e);if(s.turned)return{host:{width:s.width,height:s.height},page:{transform:"rotate(-90deg) translate(-100%)",transformOrigin:"top left"}}}render(){var t;const e=this.getLayoutStyle(),a=this.extractSlotNames(e["grid-template-areas"]),r=this.rotation();return s(i,{key:"2ec4b279578c40e0aa56ec89ede269abb4d2951b",style:null==r?void 0:r.host},s("bn-page",{key:"fae96a429fad331f28fdf69e5036e6857db866c6",styles:this.styles,"selected-style":this.selectedStyle,format:this.pageFormat,orientation:this.pageOrientation,style:null==r?void 0:r.page},s("bn-message",{key:"17e10377a10a257417acc50460cc2a66e1010abd",text:this.messageText,image:this.messageImage}),s("bn-title",{key:"3149bfdb60c2782c65a3c956fe15d291b2748327","i18n-namespace":null!==(t=this.i18nNamespace)&&void 0!==t?t:this.titleNamespace,ruleset:this.ruleset,"title-id":this.titleId,"business-unit":this.titleBusinessUnit,scenarios:this.titleScenarios,variances:this.titleVariances,order:this.titleOrder,"order-direction":this.titleOrderDirection,measures:this.titleMeasures,"date-start":this.titleDateStart,"date-end":this.titleDateEnd,"date-format":this.titleDateFormat,"date-link":this.titleDateLink}),s("bn-body",{key:"8ef72077b8656469db320af429a1226453866558"},s("div",{key:"99b22034f2c6edbe7e25e1a3cb6873f2af287178",style:e,"data-bn-fit-content":this.pageFitToContent?this.getRowCount(this.pageLayout)+"":null},this.getSlots(a)),s("slot",{key:"918b8f2c8991d801a0033748f37250500cf2d2e9",name:"annotations"})),s("bn-footer",{key:"a77e27405f7fbc68c90a95c563628ddc2d708e02",text:this.footerText,"page-number":this.pageNumber,"display-page-number":this.footerDisplayPageNumber})))}get element(){return this}static get style(){return':host{background:var(--bn-font-background, white);color:var(--bn-font-color, black);font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);display:block;overflow:hidden}::slotted(*){flex:1 1 auto;min-width:0}'}},[257,"bn-layout-page",{styles:[1],selectedStyle:[1,"selected-style"],ruleset:[1],messageText:[1,"message-text"],messageImage:[1,"message-image"],titleId:[1,"title-id"],titleBusinessUnit:[1,"title-business-unit"],titleScenarios:[1,"title-scenarios"],titleVariances:[1,"title-variances"],titleOrder:[1,"title-order"],titleOrderDirection:[1,"title-order-direction"],titleMeasures:[1,"title-measures"],titleDateStart:[1,"title-date-start"],titleDateEnd:[1,"title-date-end"],titleDateFormat:[1,"title-date-format"],titleDateLink:[1,"title-date-link"],titleNamespace:[1,"title-namespace"],i18nNamespace:[513,"i18n-namespace"],pageFormat:[1,"page-format"],pageOrientation:[1,"page-orientation"],pageNumber:[1,"page-number"],footerText:[1,"footer-text"],footerDisplayPageNumber:[4,"footer-display-page-number"],pageLayout:[1,"page-layout"],pageCustomTemplate:[1,"page-custom-template"],pageGridGap:[1,"page-grid-gap"],pageFitToContent:[4,"page-fit-to-content"]}]),j=x,w=function(){"undefined"!=typeof customElements&&["bn-layout-page","bn-body","bn-footer","bn-message","bn-page","bn-title","bn-title-renderer"].forEach((t=>{switch(t){case"bn-layout-page":customElements.get(r(t))||customElements.define(r(t),x);break;case"bn-body":customElements.get(r(t))||g();break;case"bn-footer":customElements.get(r(t))||f();break;case"bn-message":customElements.get(r(t))||y();break;case"bn-page":customElements.get(r(t))||k();break;case"bn-title":customElements.get(r(t))||v();break;case"bn-title-renderer":customElements.get(r(t))||D()}}))};export{j as BnLayoutPage,w as defineCustomElement}
1
+ import{p as t,H as e,h as s,F as a,d as i,t as r}from"./p-BnmylmXF.js";import{s as o}from"./p-DM7fwmH4.js";import{w as n}from"./p-BrQCbmG0.js";import{w as l}from"./p-D32TsLzd.js";import{a as m,b as d,c as h,t as c,i as p,C as b,d as u}from"./p-Dq4KMCDU.js";import{d as f}from"./p-DMAaBt7n.js";import{d as g}from"./p-2t-lysdb.js";import{d as y}from"./p-DRU71K0s.js";import{d as k}from"./p-Zuxd3z0q.js";import{d as v}from"./p-BgdoWKFY.js";import{d as x}from"./p-DJSj3oQq.js";const j=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.messageText="",this.messageImage="",this.titleBusinessUnit="",this.titleOrder="category",this.titleOrderDirection="asc",this.titleDateFormat="none",this.titleDateLink="none",this.footerDisplayPageNumber=!0,this.pageLayout="full",this.pageCustomTemplate='"a b" "c d"',this.pageGridGap="0",this.pageFitToContent=!1,n(this),this.errors=l(this)}getCommonStyles(){let t="100%";return!0===this.pageFitToContent&&(t="fit-content"),{display:"grid",height:t,width:"100%",gap:this.pageGridGap+"px"}}getRowCount(t){return m(this.getTemplateAreas(t)).length||1}getGridTemplateRows(t){const e=this.getRowCount(t);return this.pageFitToContent?Array(e).fill("auto").join(" "):Array(e).fill("minmax(0, 1fr)").join(" ")}getLayoutStyle(){return Object.assign(Object.assign({},this.getCommonStyles()),{"grid-template-areas":this.getTemplateAreas(this.pageLayout),"grid-template-columns":this.getGridTemplateColumns(this.pageLayout),"grid-template-rows":this.getGridTemplateRows(this.pageLayout)})}createDivAreaStyles(t){return t.map((t=>({display:"flex",overflow:"hidden","grid-area":t})))}getSlots(t){const e=this.createDivAreaStyles(t);return s(a,null,e.map(((t,e)=>s("div",{style:t},s("slot",{name:"slot-"+e})))))}extractSlotNames(t){return d(t)}getTemplateAreas(t){return h(t,this.pageCustomTemplate)}getGridTemplateColumns(t){return p(t)?c(this.getTemplateAreas(t)):"1fr"}mirror(t,e){null==e?this.element.hasAttribute(t)&&this.element.removeAttribute(t):this.element.getAttribute(t)!==e&&this.element.setAttribute(t,e)}componentWillRender(){this.mirror("page-format",this.pageFormat),this.mirror("page-orientation",this.pageOrientation);const t=this.pageLayout===b?u(this.pageCustomTemplate):void 0;t?this.errors.addOrReplace({id:"WARN_pageCustomTemplate",type:"warning",message:"pageCustomTemplate: "+t}):this.errors.remove("WARN_pageCustomTemplate")}rotation(){var t;const e=null===(t=this.element.closest("bn-context"))||void 0===t?void 0:t.getAttribute("render-orientation"),s=o(this.pageFormat,this.pageOrientation,e);if(s.turned)return{host:{width:s.width,height:s.height},page:{transform:"rotate(-90deg) translate(-100%)",transformOrigin:"top left"}}}render(){var t;const e=this.getLayoutStyle(),a=this.extractSlotNames(e["grid-template-areas"]),r=this.rotation();return s(i,{key:"2ec4b279578c40e0aa56ec89ede269abb4d2951b",style:null==r?void 0:r.host},s("bn-page",{key:"fae96a429fad331f28fdf69e5036e6857db866c6",styles:this.styles,"selected-style":this.selectedStyle,format:this.pageFormat,orientation:this.pageOrientation,style:null==r?void 0:r.page},s("bn-message",{key:"17e10377a10a257417acc50460cc2a66e1010abd",text:this.messageText,image:this.messageImage}),s("bn-title",{key:"3149bfdb60c2782c65a3c956fe15d291b2748327","i18n-namespace":null!==(t=this.i18nNamespace)&&void 0!==t?t:this.titleNamespace,ruleset:this.ruleset,"title-id":this.titleId,"business-unit":this.titleBusinessUnit,scenarios:this.titleScenarios,variances:this.titleVariances,order:this.titleOrder,"order-direction":this.titleOrderDirection,measures:this.titleMeasures,"date-start":this.titleDateStart,"date-end":this.titleDateEnd,"date-format":this.titleDateFormat,"date-link":this.titleDateLink}),s("bn-body",{key:"8ef72077b8656469db320af429a1226453866558"},s("div",{key:"99b22034f2c6edbe7e25e1a3cb6873f2af287178",style:e,"data-bn-fit-content":this.pageFitToContent?this.getRowCount(this.pageLayout)+"":null},this.getSlots(a)),s("slot",{key:"918b8f2c8991d801a0033748f37250500cf2d2e9",name:"annotations"})),s("bn-footer",{key:"a77e27405f7fbc68c90a95c563628ddc2d708e02",text:this.footerText,"page-number":this.pageNumber,"display-page-number":this.footerDisplayPageNumber})))}get element(){return this}static get style(){return':host{background:var(--bn-font-background, white);color:var(--bn-font-color, black);font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);display:block;overflow:hidden}::slotted(*){flex:1 1 auto;min-width:0}'}},[257,"bn-layout-page",{styles:[1],selectedStyle:[1,"selected-style"],ruleset:[1],messageText:[1,"message-text"],messageImage:[1,"message-image"],titleId:[1,"title-id"],titleBusinessUnit:[1,"title-business-unit"],titleScenarios:[1,"title-scenarios"],titleVariances:[1,"title-variances"],titleOrder:[1,"title-order"],titleOrderDirection:[1,"title-order-direction"],titleMeasures:[1,"title-measures"],titleDateStart:[1,"title-date-start"],titleDateEnd:[1,"title-date-end"],titleDateFormat:[1,"title-date-format"],titleDateLink:[1,"title-date-link"],titleNamespace:[1,"title-namespace"],i18nNamespace:[513,"i18n-namespace"],pageFormat:[1,"page-format"],pageOrientation:[1,"page-orientation"],pageNumber:[1,"page-number"],footerText:[1,"footer-text"],footerDisplayPageNumber:[4,"footer-display-page-number"],pageLayout:[1,"page-layout"],pageCustomTemplate:[1,"page-custom-template"],pageGridGap:[1,"page-grid-gap"],pageFitToContent:[4,"page-fit-to-content"]}]),w=j,D=function(){"undefined"!=typeof customElements&&["bn-layout-page","bn-body","bn-footer","bn-message","bn-page","bn-title","bn-title-renderer"].forEach((t=>{switch(t){case"bn-layout-page":customElements.get(r(t))||customElements.define(r(t),j);break;case"bn-body":customElements.get(r(t))||f();break;case"bn-footer":customElements.get(r(t))||g();break;case"bn-message":customElements.get(r(t))||y();break;case"bn-page":customElements.get(r(t))||k();break;case"bn-title":customElements.get(r(t))||v();break;case"bn-title-renderer":customElements.get(r(t))||x()}}))};export{w as BnLayoutPage,D as defineCustomElement}
@@ -1 +1 @@
1
- import{F as o,d as s}from"./p-DbWh9W5D.js";const p=o,r=s;export{p as BnMessage,r as defineCustomElement}
1
+ import{F as s,d as o}from"./p-DRU71K0s.js";const p=s,r=o;export{p as BnMessage,r as defineCustomElement}
@@ -1 +1 @@
1
- import{P as s,d as o}from"./p-G56USTsQ.js";const p=s,r=o;export{p as BnPage,r as defineCustomElement}
1
+ import{P as o,d as s}from"./p-Zuxd3z0q.js";const p=o,r=s;export{p as BnPage,r as defineCustomElement}
@@ -1 +1 @@
1
- import{p as t,H as s,h as e,a as r,t as o}from"./p-D6YGOYV1.js";import{w as n}from"./p-Do4oPrkE.js";import{g as i}from"./p-Cxx0YNnl.js";import{w as c}from"./p-Dq9dG0Kr.js";import{w as m}from"./p-4vVbchX2.js";const a=t(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.name="_default",c(this),this.errors=m(this),n(this,(t=>{this.stores||(this.stores=i(this.element));try{const s=JSON.parse(t);this.stores.ruleSets.set(this.name,s),this.errors.remove("ERR_body")}catch(t){this.errors.addOrReplace({id:"ERR_body",type:"error",message:"bn-ruleset: Failed to parse JSON body - "+t.message}),console.error(t)}}))}render(){return e(r,{key:"de03c25692178ed0f97c1e0d914396cba7c53cc3"})}get element(){return this}static get style(){return"bn-ruleset{display:none}"}},[0,"bn-ruleset",{name:[1]}]),p=a,h=function(){"undefined"!=typeof customElements&&["bn-ruleset"].forEach((t=>{"bn-ruleset"===t&&(customElements.get(o(t))||customElements.define(o(t),a))}))};export{p as BnRuleset,h as defineCustomElement}
1
+ import{p as s,H as t,h as e,d as r,t as o}from"./p-BnmylmXF.js";import{w as n}from"./p-BP2sJ8k9.js";import{g as i}from"./p-6242qMx1.js";import{w as m}from"./p-BrQCbmG0.js";import{w as c}from"./p-D32TsLzd.js";const a=s(class extends t{constructor(s){super(),!1!==s&&this.__registerHost(),this.name="_default",m(this),this.errors=c(this),n(this,(s=>{this.stores||(this.stores=i(this.element));try{const t=JSON.parse(s);this.stores.ruleSets.set(this.name,t),this.errors.remove("ERR_body")}catch(s){this.errors.addOrReplace({id:"ERR_body",type:"error",message:"bn-ruleset: Failed to parse JSON body - "+s.message}),console.error(s)}}))}render(){return e(r,{key:"de03c25692178ed0f97c1e0d914396cba7c53cc3"})}get element(){return this}static get style(){return"bn-ruleset{display:none}"}},[0,"bn-ruleset",{name:[1]}]),p=a,d=function(){"undefined"!=typeof customElements&&["bn-ruleset"].forEach((s=>{"bn-ruleset"===s&&(customElements.get(o(s))||customElements.define(o(s),a))}))};export{p as BnRuleset,d as defineCustomElement}
@@ -1 +1 @@
1
- import{p as e,H as i,h as s,a as t,t as n}from"./p-D6YGOYV1.js";import{g as a}from"./p-Cxx0YNnl.js";import{a as r,f as o}from"./p-Xb6Ilq8u.js";import{w as u}from"./p-Dq9dG0Kr.js";import{w as h}from"./p-4vVbchX2.js";const l=e(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),u(this),this.errors=h(this)}connectedCallback(){this.stores=a(this.element),this.pushToStore()}disconnectedCallback(){this.removeEntryIfOurs(this.storedName)}onNameChange(e,i){const s=null==i?void 0:(""+i).trim();s&&s!==(null==e?void 0:(""+e).trim())&&this.removeEntryIfOurs(s),this.pushToStore()}onValueChange(){this.pushToStore()}removeEntryIfOurs(e){e&&this.stores&&(this.storedName===e&&this.stores.scalingGroups.state[e]===this.storedValue&&this.stores.scalingGroups.set(e,void 0),this.storedName===e&&(this.storedName=void 0,this.storedValue=void 0))}pushToStore(){var e;if(!this.stores)return;const i=null===(e=this.name)||void 0===e?void 0:(""+e).trim(),s=r(i);if("auto"===s.kind)return void this.errors.addOrReplace({id:"WARN_reserved_name",type:"warning",message:'bn-scaling-group: name "auto" is reserved and cannot be used.'});if(this.errors.remove("WARN_reserved_name"),!i)return void this.errors.addOrReplace({id:"WARN_empty_name",type:"warning",message:"bn-scaling-group: name is required."});if(this.errors.remove("WARN_empty_name"),"number"===s.kind)return void this.errors.addOrReplace({id:"WARN_numeric_name",type:"warning",message:`bn-scaling-group: name "${i}" is not allowed - it would be ambiguous with a numeric scaling value.`});this.errors.remove("WARN_numeric_name");const t=r(this.value);if("number"!==t.kind)return void this.errors.addOrReplace({id:"WARN_invalid_value",type:"warning",message:`bn-scaling-group: invalid value "${this.value}" - must be a positive number, optionally with k/M/G/T suffix.`});this.errors.remove("WARN_invalid_value");const n=this.stores.scalingGroups.state[i];void 0===n||n===t.value||this.storedName===i&&this.storedValue===n?this.errors.remove("WARN_duplicate_group"):this.errors.addOrReplace({id:"WARN_duplicate_group",type:"warning",message:`bn-scaling-group: "${i}" is already registered with a different value (${o(n)}); overwriting.`}),this.storedName&&this.storedName!==i&&this.removeEntryIfOurs(this.storedName),this.stores.scalingGroups.set(i,t.value),this.storedName=i,this.storedValue=t.value}render(){return s(t,{key:"db1fe7bbe3d3caf76ad32eac64f944eef10b1ccd"})}get element(){return this}static get watchers(){return{name:[{onNameChange:0}],value:[{onValueChange:0}]}}static get style(){return"bn-scaling-group{display:none}"}},[0,"bn-scaling-group",{name:[1],value:[8]},void 0,{name:[{onNameChange:0}],value:[{onValueChange:0}]}]),m=l,d=function(){"undefined"!=typeof customElements&&["bn-scaling-group"].forEach((e=>{"bn-scaling-group"===e&&(customElements.get(n(e))||customElements.define(n(e),l))}))};export{m as BnScalingGroup,d as defineCustomElement}
1
+ import{p as e,H as i,h as s,d as t,t as n}from"./p-BnmylmXF.js";import{g as a}from"./p-6242qMx1.js";import{a as r,f as o}from"./p-Xb6Ilq8u.js";import{w as u}from"./p-BrQCbmG0.js";import{w as h}from"./p-D32TsLzd.js";const l=e(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),u(this),this.errors=h(this)}connectedCallback(){this.stores=a(this.element),this.pushToStore()}disconnectedCallback(){this.removeEntryIfOurs(this.storedName)}onNameChange(e,i){const s=null==i?void 0:(""+i).trim();s&&s!==(null==e?void 0:(""+e).trim())&&this.removeEntryIfOurs(s),this.pushToStore()}onValueChange(){this.pushToStore()}removeEntryIfOurs(e){e&&this.stores&&(this.storedName===e&&this.stores.scalingGroups.state[e]===this.storedValue&&this.stores.scalingGroups.set(e,void 0),this.storedName===e&&(this.storedName=void 0,this.storedValue=void 0))}pushToStore(){var e;if(!this.stores)return;const i=null===(e=this.name)||void 0===e?void 0:(""+e).trim(),s=r(i);if("auto"===s.kind)return void this.errors.addOrReplace({id:"WARN_reserved_name",type:"warning",message:'bn-scaling-group: name "auto" is reserved and cannot be used.'});if(this.errors.remove("WARN_reserved_name"),!i)return void this.errors.addOrReplace({id:"WARN_empty_name",type:"warning",message:"bn-scaling-group: name is required."});if(this.errors.remove("WARN_empty_name"),"number"===s.kind)return void this.errors.addOrReplace({id:"WARN_numeric_name",type:"warning",message:`bn-scaling-group: name "${i}" is not allowed - it would be ambiguous with a numeric scaling value.`});this.errors.remove("WARN_numeric_name");const t=r(this.value);if("number"!==t.kind)return void this.errors.addOrReplace({id:"WARN_invalid_value",type:"warning",message:`bn-scaling-group: invalid value "${this.value}" - must be a positive number, optionally with k/M/G/T suffix.`});this.errors.remove("WARN_invalid_value");const n=this.stores.scalingGroups.state[i];void 0===n||n===t.value||this.storedName===i&&this.storedValue===n?this.errors.remove("WARN_duplicate_group"):this.errors.addOrReplace({id:"WARN_duplicate_group",type:"warning",message:`bn-scaling-group: "${i}" is already registered with a different value (${o(n)}); overwriting.`}),this.storedName&&this.storedName!==i&&this.removeEntryIfOurs(this.storedName),this.stores.scalingGroups.set(i,t.value),this.storedName=i,this.storedValue=t.value}render(){return s(t,{key:"db1fe7bbe3d3caf76ad32eac64f944eef10b1ccd"})}get element(){return this}static get watchers(){return{name:[{onNameChange:0}],value:[{onValueChange:0}]}}static get style(){return"bn-scaling-group{display:none}"}},[0,"bn-scaling-group",{name:[1],value:[8]},void 0,{name:[{onNameChange:0}],value:[{onValueChange:0}]}]),m=l,d=function(){"undefined"!=typeof customElements&&["bn-scaling-group"].forEach((e=>{"bn-scaling-group"===e&&(customElements.get(n(e))||customElements.define(n(e),l))}))};export{m as BnScalingGroup,d as defineCustomElement}
@@ -1 +1 @@
1
- import{B as o,d as s}from"./p-EQNS13GN.js";const p=o,r=s;export{p as BnTableRenderer,r as defineCustomElement}
1
+ import{B as o,d as s}from"./p-CLjuZoiT.js";const p=o,r=s;export{p as BnTableRenderer,r as defineCustomElement}
@@ -1 +1 @@
1
- import{p as t,H as i,w as e,h as a,a as s,t as r,f as n}from"./p-D6YGOYV1.js";import{h as o,a as l}from"./p-Cxx0YNnl.js";import{v as h,a as d,i as p,q as u,r as c,s as v,t as m,h as g,u as f,w as y,x as b,y as S,c as w,z as O,m as A,A as T,B as N,f as D,C as W}from"./p-BKLq0Pbv.js";import{w as _}from"./p-BKA15uoz.js";import{w as C}from"./p-Dq9dG0Kr.js";import{w as P}from"./p-DzYhS_9s.js";import{w as R,a as F,i as x}from"./p-Bj3RWsEx.js";import{w as M}from"./p-uCpFBDF5.js";import{w as j}from"./p-9X5fVJqR.js";import{r as I}from"./p-D_Sbhd0L.js";import{w as U}from"./p-Bd8cQiLx.js";import{w as B,r as k}from"./p-4vVbchX2.js";import{g as G}from"./p-Dsvjkuy3.js";import{f as L,r as E,p as z}from"./p-Xb6Ilq8u.js";import{o as J}from"./p-B6kka9sT.js";import{D as $,I as V,d as X,M as q,B as Y,T as K}from"./p-B5tixDPM.js";import{T as Q,a as Z,p as H}from"./p-BZXiWkDS.js";import{I as tt,a as it,d as et,c as at}from"./p-EQNS13GN.js";import{a as st,n as rt}from"./p-16rjcQ0t.js";import{LAYOUT_STATE_VERSION as nt}from"./index.js";import{o as ot,m as lt}from"./p-BrJZUp-K.js";import{r as ht,a as dt}from"./p-CckAR27O.js";import{b as pt}from"./p-JofGXz75.js";import{s as ut}from"./p-DakXa7Dp.js";const ct=t(class extends i{validateScaling(t){if(null==t||""===t||"none"===t||"auto"===t)return void this.errors.remove("WARN_scale");const i=Number(t);isNaN(i)||i<=0?this.errors.addOrReplace({id:"WARN_scale",type:"warning",message:`Invalid scale value: "${t}". Use "none", "auto", or a positive number.`}):this.errors.remove("WARN_scale")}constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.layoutObserver=null,this._lastScaledParentWidth=0,this.datasetName="",this.dataVersion=0,this.datasetMeta=null,this.appliedScaleFactor=1,this.hasBlankSetnames=!1,this.hasSetnameIndexWithoutSetname=!1,this.sumTitle="",this.filter="",this.measureUnit="",this.barColumnWidth="w10",this.unitScaling="100",this.percentageScaling="2",this.pixelPerUnitGroupMap=new Map,this.dataFormat="decimal",this.grouped=!1,this.showMeasureScale=!1,this.showGroupTitle=!0,this.runningSum=!1,this.varianceWaterfall=!1,this.type="list",this.limit=0,this.thereof="[]",this.thereofPosition="below",this.partof="[]",this.order="category",this.orderDirection="asc",this.measureType="volume",this.measureScale="greatest",this.dataFormatDigitsDecimal=1,this.dataFormatDigitsPercent=2,this.categoryWidth="w15",this.columnthereof=null,this.interval="none",this.categoryIntervalPosition=0,this.tableAttributes="",this._autoScaleGuard=!1,this.autoUnitWarningActive=!1,this.autoPctWarningActive=!1,this.handleAutoScalingReport=t=>{var i,e,a,s;this.lastAutoScalingReport={unit:null!==(i=t.unit)&&void 0!==i?i:null===(e=this.lastAutoScalingReport)||void 0===e?void 0:e.unit,percentage:null!==(a=t.percentage)&&void 0!==a?a:null===(s=this.lastAutoScalingReport)||void 0===s?void 0:s.percentage};const r=(t,i)=>void 0===i||Math.abs(t-i)>.001*Math.abs(t);if(void 0!==t.unit&&t.unit>0&&this.autoUnitWarningActive){const i=1/t.unit;r(i,this.lastReportedUnitsPerEm)&&(this.lastReportedUnitsPerEm=i,this.errors.addOrReplace({id:"AUTO_unitScaling",type:"warning",message:`unit-scaling: invalid value "${this.unitScaling}" - auto-fitted to 1 em ≈ ${L(i)} units.`}))}if(void 0!==t.percentage&&t.percentage>0&&this.autoPctWarningActive){const i=1/t.percentage;r(i,this.lastReportedPpPerEm)&&(this.lastReportedPpPerEm=i,this.errors.addOrReplace({id:"AUTO_percentageScaling",type:"warning",message:`percentage-scaling: invalid value "${this.percentageScaling}" - auto-fitted to 1 em ≈ ${L(i)} percentage points.`}))}},M(this),C(this),this.errors=B(this),P(this),this.componentStyle=j(this),this.ruleSetConfig=U(this),_(this,((t,i)=>{this.datasetName=(null==t?void 0:t.startsWith("$"))?t.substring(1):t||"",this.dataVersion=this.dataVersion+1,this.hasBlankSetnames=Array.isArray(i)&&i.some((t=>{var i;return p(null!==(i=null==t?void 0:t.setname)&&void 0!==i?i:null==t?void 0:t.setName)})),this.hasSetnameIndexWithoutSetname=Array.isArray(i)&&i.some((t=>{var i,e;return void 0!==at(null!==(i=null==t?void 0:t.setnameIndex)&&void 0!==i?i:null==t?void 0:t.setNameIndex)&&p(null!==(e=null==t?void 0:t.setname)&&void 0!==e?e:null==t?void 0:t.setName)}))}),((t,i)=>{this.datasetMeta=i})),this.t=R(this).t,this.resolveInherited=F(this,[{propName:"scenarios",ancestorAttr:"title-scenarios"},{propName:"variances",ancestorAttr:"title-variances"},{propName:"order",ancestorAttr:"title-order"},{propName:"orderDirection",ancestorAttr:"title-order-direction"}],this.errors)}validateFilter(t){const i="ERR_filter";o(t)?this.errors.addOrReplace({id:i,type:"error",message:"filter: double backticks are not allowed."}):this.errors.remove(i)}validateScenario(t){const i="WARN_scenarios";if(x(t))return void this.errors.remove(i);const e=h(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"scenarios: invalid value(s) '"+(null==e?void 0:""+e)+"' are not supported."}):this.errors.remove(i)}validateVariances(t){const i="WARN_variances";if(x(t))return void this.errors.remove(i);const e=d(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"variances: invalid value(s) '"+JSON.stringify(e)+"' are not supported."}):this.errors.remove(i)}validateBarColumns(t){const i="WARN_barColumns";if(p(t))return void this.errors.remove(i);const e=u(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"barColumns: invalid value(s) '"+JSON.stringify(e)+"' are not supported."}):this.errors.remove(i)}validateBarColumnWidth(t){const i="WARN_barColumnWidth";c(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"barColumnWidth: invalid value '"+t+"' is not supported."})}validateUnitScaling(t){const i="WARN_unitScaling";"invalid"===E(t,this.pixelPerUnitGroupMap).kind?this.errors.addOrReplace({id:i,type:"warning",message:"unitScaling: invalid value '"+t+"' is not supported."}):this.errors.remove(i)}validatePercentageScaling(t){const i="WARN_percentageScaling";"invalid"===E(t,this.pixelPerUnitGroupMap).kind?this.errors.addOrReplace({id:i,type:"warning",message:"percentageScaling: invalid value '"+t+"' is not supported."}):this.errors.remove(i)}validateDataFormat(t){const i="WARN_dataFormat";v(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"dataFormat: invalid value(s) '"+(null==t?void 0:""+t)+"' are not supported."})}validateType(t){const i="WARN_type";m(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"type: invalid value(s) '"+(null==t?void 0:""+t)+"' are not supported."})}validateLimit(t){const i="WARN_limit";g(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"order: invalid value '"+(null==t?void 0:""+t)+"' is not supported."})}validateThereOf(t){const i="WARN_thereof",e=f(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"ThereOf: invalid value(s) '"+JSON.stringify(e)+"' are not supported."}):this.errors.remove(i)}validateThereofPosition(t){const i="WARN_thereofPosition";p(t)||y(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"thereofPosition: invalid value '"+t+"' is not supported."})}validatePartOf(t){const i="WARN_partof",e=b(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"partof: invalid value(s) '"+JSON.stringify(e)+"' are not supported."}):this.errors.remove(i)}validateOrderList(t){const i="WARN_order";if(x(t))return void this.errors.remove(i);const e=S(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"order: invalid value(s) '"+JSON.stringify(e)+"' are not supported."}):this.errors.remove(i)}validateOrderDirection(t){const i="WARN_orderDirection";x(t)||w(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"orderDirection: invalid value '"+(null==t?void 0:""+t)+"' is not supported."})}validateMeasureType(t){const i="WARN_measureType";O(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"measureType: invalid value '"+(null==t?void 0:""+t)+"' is not supported."})}validateMeasureScale(t){const i="WARN_measureScale";A(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"measureScale: invalid value '"+(null==t?void 0:""+t)+"' is not supported."})}validateDataFormatDigitsDecimal(t){const i="WARN_dataFormatDigitsDecimal";g(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"dataFormatDigitsDecimal: invalid value(s) '"+t+"' are not supported."})}validateDateFormatDigitsPercent(t){const i="WARN_dataFormatDigitsPercent";g(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"dataFormatDigitsPercent: invalid value(s) '"+t+"' are not supported."})}validateCategoryWidth(t){const i="WARN_categoryWidth";T(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"categoryWidth: invalid value(s) '"+t+"' are not supported."})}validateColumnThereOf(t){const i=N(t),e="WARN_columnthereof";i.length>0?this.errors.addOrReplace({id:e,type:"warning",message:"columnthereof: invalid value(s) '"+JSON.stringify(i)+"' are not supported."}):this.errors.remove(e)}validateInterval(t){const i="WARN_interval",e=null==t?void 0:t.trim().toLowerCase();p(t)||e===tt||e===it||D(e)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"interval: invalid value '"+t+"' is not supported."})}validateCategoryIntervalPosition(t){const i="WARN_categoryIntervalPosition";p(t)||g(t)&&Number(t)>=0?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"categoryIntervalPosition: invalid value '"+t+"' is not supported."})}validateTableAttributes(t){const i="WARN_attributes",e=W(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"attributes: invalid value(s) '"+JSON.stringify(e)+"' are not supported."}):this.errors.remove(i)}componentWillLoad(){this.validateFilter(this.filter),this.validateScenario(this.scenarios),this.validateVariances(this.variances),this.validateDataFormat(this.dataFormat),this.validateType(this.type),this.validateLimit(this.limit),this.validateThereOf(this.thereof),this.validateThereofPosition(this.thereofPosition),this.validatePartOf(this.partof),this.validateOrderDirection(this.orderDirection),this.validateOrderList(this.order),this.validateDataFormatDigitsDecimal(this.dataFormatDigitsDecimal),this.validateDateFormatDigitsPercent(this.dataFormatDigitsPercent),this.validateCategoryWidth(this.categoryWidth),this.validateMeasureType(this.measureType),this.validateMeasureScale(this.measureScale),this.validateColumnThereOf(this.columnthereof),this.validateInterval(this.interval),this.validateCategoryIntervalPosition(this.categoryIntervalPosition),this.validateTableAttributes(this.tableAttributes),this.validateBarColumns(this.barColumns),this.validateBarColumnWidth(this.barColumnWidth),this.validateUnitScaling(this.unitScaling),this.validatePercentageScaling(this.percentageScaling),this.validateScaling(this.scale)}componentDidLoad(){this.layoutObserver=J(this.element,(()=>{if(this._autoScaleGuard)return;const{width:t}=G(this.element);t>0&&Math.abs(t-this._lastScaledParentWidth)>2&&(this._lastScaledParentWidth=t,n(this))}))}disconnectedCallback(){var t;null===(t=this.layoutObserver)||void 0===t||t.disconnect(),this.layoutObserver=null}componentDidRender(){ut(this.element,"bn-table-renderer");const{mode:t}=z(this.scale);if("auto"!==t&&"empty"!==t)return this._autoScaleGuard=!1,void this.checkOverflow();if(this._autoScaleGuard)return this._autoScaleGuard=!1,void this.checkOverflow();const i=this.element,{width:a}=G(i);if(a<=0)return void this.checkOverflow();this._lastScaledParentWidth=a;const s=this.componentStyle((t=>{var i;return(null===(i=t.global)||void 0===i?void 0:i.fontSizePx)||13.3333})),r=i.scrollWidth,n=this.appliedScaleFactor;if(r<=a+1)return this.errors.remove("AUTO_scale"),void this.checkOverflow();const o=Math.max(.3,n*(a-1)/r);Math.abs(o-n)<.001||(i.style.setProperty("--bn-font-size",s*o+"px"),"empty"===t?this.errors.addOrReplace({id:"AUTO_scale",type:"warning",message:"Auto-scaled table by factor "+o.toFixed(3)}):this.errors.remove("AUTO_scale"),this._autoScaleGuard=!0,e((()=>{this.appliedScaleFactor=o}))),this.checkOverflow()}checkOverflow(){const t=G(this.element),i=this.element.scrollWidth,e=this.element.scrollHeight,a=t.width>0&&i>t.width+1,s=t.height>0&&e>t.height+1;if(!a&&!s)return void k(this.errors,null);const{mode:r}=z(this.scale),n="auto"!==r&&"empty"!==r,o=[];a&&o.push(`width (${Math.round(i)}px > ${Math.round(t.width)}px)`),s&&o.push(`height (${Math.round(e)}px > ${Math.round(t.height)}px)`),k(this.errors,`Table exceeds available ${o.join(" and ")}. Give the component more space, reduce rows (e.g. limit), or set a smaller scale.`,n)}prepareDataFormat(){var t;return $[null===(t=this.dataFormat)||void 0===t?void 0:t.toUpperCase()]}prepareGrouped(){return this.grouped}prepareShowGroupTitle(){return this.showGroupTitle}prepareThereofPosition(){var t;return(null===(t=this.thereofPosition)||void 0===t?void 0:t.toLowerCase())===Q.ABOVE?Q.ABOVE:Q.BELOW}prepareTableType(){var t;return Z[null===(t=this.type)||void 0===t?void 0:t.toUpperCase()]}prepareLimit(){return Math.floor(Number(this.limit)||0)}prepareThereOf(){if(null==this.thereof||""===this.thereof.trim())return[];try{return JSON.parse(this.thereof)}catch(t){return[]}}preparePartOf(){if(null==this.partof||""===this.partof.trim())return[];try{return JSON.parse(this.partof)}catch(t){return[]}}prepareOrder(){var t;const i=this.resolveInherited("order",this.order,"category").value,e=this.resolveInherited("orderDirection",this.orderDirection,"asc").value,a="auto"===(null==i?void 0:i.trim().toLowerCase());let s=i;return a&&(null===(t=this.datasetMeta)||void 0===t?void 0:t.suggestedOrder)&&(s=this.datasetMeta.suggestedOrder),{hierarchy:s.split(",").map((t=>rt(t))),direction:st[null==e?void 0:e.toUpperCase()]}}prepareI18nMode(){return V.META}prepareI18n(){const t=l,i=new Map(["in","category","operation","thereof","part_of","SUM_TOTAL","no-data","REST"].map((t=>[t,this.t(".".concat(t))]))),e=new Map(t.map((t=>[t,this.t("global.".concat(t))])));return new Map([...e.entries(),...i.entries(),...I(this.ruleSetConfig("user"))])}prepareDataFormatDigits(){return{percent:this.dataFormatDigitsPercent,decimal:this.dataFormatDigitsDecimal}}prepareScenarios(){var t,i,e,a,s,r,n,o,l,h,d;const u=this.resolveInherited("scenarios",this.scenarios),c=this.resolveInherited("variances",this.variances);if(u.inherited||c.inherited){this.errors.remove("AUTO_scenarios");let a=[];return p(u.value)?u.unresolved&&(a=a.concat(null!==(i=null===(t=this.datasetMeta)||void 0===t?void 0:t.availableScenarios)&&void 0!==i?i:[])):a=a.concat(u.value.split(",")),(null===(e=c.value)||void 0===e?void 0:e.trim().length)>0&&(a=a.concat(c.value.split(","))),a.map((t=>t.trim()))}const v="auto"===(null===(a=u.value)||void 0===a?void 0:a.trim().toLowerCase()),m=v||u.unresolved;if((p(u.value)||v)&&p(c.value))return(null===(r=null===(s=this.datasetMeta)||void 0===s?void 0:s.availableScenarios)||void 0===r?void 0:r.length)>0?(m?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):[];let g=[];return v||p(u.value)?(null===(o=null===(n=this.datasetMeta)||void 0===n?void 0:n.availableScenarios)||void 0===o?void 0:o.length)>0&&(m?this.errors.remove("AUTO_scenarios"):this.errors.addOrReplace({id:"AUTO_scenarios",type:"warning",message:"scenarios: not set, auto-detected: "+this.datasetMeta.availableScenarios.join(",")}),g=g.concat(this.datasetMeta.availableScenarios)):(this.errors.remove("AUTO_scenarios"),g=g.concat(null===(l=u.value)||void 0===l?void 0:l.split(","))),(null===(h=c.value)||void 0===h?void 0:h.trim().length)>0&&(g=g.concat(null===(d=c.value)||void 0===d?void 0:d.split(","))),g.map((t=>t.trim()))}prepareCategoryWidth(){var t;return p(this.categoryWidth)?X.INF:X[null===(t=this.categoryWidth)||void 0===t?void 0:t.toUpperCase()]}prepareMeasureScale(){return p(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"}prepareMeasureType(){var t;return p(this.measureType)?q.VOLUME:q[null===(t=this.measureType)||void 0===t?void 0:t.toUpperCase()]}prepareColumnThereOf(){if(null==this.columnthereof||""===this.columnthereof.trim())return new Map;const t=new Map;try{const i=JSON.parse(this.columnthereof);for(const[e,a]of Object.entries(i))!1===t.has(a.scenario)&&t.set(a.scenario,[]),t.get(a.scenario).push(a)}catch(t){return new Map}return t}prepareInterval(){var t;const i="WARN_intervalConflict",e="WARN_intervalNoDate",a="WARN_intervalSetname",s="WARN_intervalSetnameIndex",r=p(this.interval)?tt:this.interval.trim().toLowerCase();return r!==tt&&r!==it&&!D(r)||r===tt?(this.errors.remove(i),this.errors.remove(e),this.errors.remove(a),this.errors.remove(s),tt):null!=this.columnthereof&&""!==this.columnthereof.trim()?(this.errors.addOrReplace({id:i,type:"warning",message:"interval: cannot be combined with columnthereof, interval is ignored."}),this.errors.remove(e),this.errors.remove(a),this.errors.remove(s),tt):(this.errors.remove(i),r===it?(this.hasBlankSetnames?this.errors.addOrReplace({id:a,type:"warning",message:"interval: rows with blank setname found, they are grouped under '-'."}):this.errors.remove(a),this.hasSetnameIndexWithoutSetname?this.errors.addOrReplace({id:s,type:"warning",message:"interval: rows with setnameIndex but blank setname found, setnameIndex needs setname."}):this.errors.remove(s),this.errors.remove(e),it):(this.errors.remove(a),this.errors.remove(s),this.datasetMeta&&!(null===(t=this.datasetMeta.dateRange)||void 0===t?void 0:t.hasData)?(this.errors.addOrReplace({id:e,type:"warning",message:"interval: dataset has no date values, interval is ignored."}),tt):(this.errors.remove(e),r)))}prepareCategoryIntervalPosition(){const t=Number(this.categoryIntervalPosition);return Number.isInteger(t)&&t>0?t:0}prepareAttributes(){if(null==this.tableAttributes||""===this.tableAttributes.trim())return[];try{const t=JSON.parse(this.tableAttributes);return null===t||"object"!=typeof t||t instanceof Array?[]:Object.entries(t).map((([t,i],e)=>"string"==typeof i?H(t,"attr_"+e,i):null)).filter((t=>null!==t))}catch(t){return[]}}prepareSumTitle(){return""===this.sumTitle||null==this.sumTitle?"SUM_TOTAL":this.sumTitle}prepareShowMeasureScale(){return this.showMeasureScale}prepareMeasureUnit(){return""===this.measureUnit||null==this.measureUnit?"":this.measureUnit}prepareFilter(){return 0===this.filter.length?"":this.filter}prepareBarColumnWidth(){var t;const i=null===(t=this.barColumnWidth)||void 0===t?void 0:t.toUpperCase(),e=K[i];return e?Y[e]:Y[K.W10]}prepareBarColumns(){return p(this.barColumns)?[]:this.barColumns.split(",").map((t=>t.trim()))}prepareUnitScaling(){const t=E(this.unitScaling,this.pixelPerUnitGroupMap);return"value"===t.kind?(this.errors.remove("AUTO_unitScaling"),this.autoUnitWarningActive=!1,this.lastReportedUnitsPerEm=void 0,1/t.value):"auto"===t.kind?(this.errors.remove("AUTO_unitScaling"),this.autoUnitWarningActive=!1,this.lastReportedUnitsPerEm=void 0,0):(this.autoUnitWarningActive=!0,this.errors.addOrReplace({id:"AUTO_unitScaling",type:"warning",message:`unit-scaling: invalid value "${t.raw}" - auto-fitting to the bar column width.`}),0)}preparePercentageScaling(){const t=E(this.percentageScaling,this.pixelPerUnitGroupMap);return"value"===t.kind?(this.errors.remove("AUTO_percentageScaling"),this.autoPctWarningActive=!1,this.lastReportedPpPerEm=void 0,1/t.value):"auto"===t.kind?(this.errors.remove("AUTO_percentageScaling"),this.autoPctWarningActive=!1,this.lastReportedPpPerEm=void 0,0):(this.autoPctWarningActive=!0,this.errors.addOrReplace({id:"AUTO_percentageScaling",type:"warning",message:`percentage-scaling: invalid value "${t.raw}" - auto-fitting to the pin area.`}),0)}getDataStructure(){return{ITableDataRow:{setName:{type:"string",isOptional:!1,description:""},setNameIndex:{type:"number",isOptional:!0,description:""},date:{type:"string",isOptional:!1,description:""},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:""}}}}async getBaseline(){return this.readBaseline()}readBaseline(){var t,i,e;const a=null===(e=null===(i=null===(t=this.element.shadowRoot)||void 0===t?void 0:t.querySelector("bn-table-renderer"))||void 0===i?void 0:i.shadowRoot)||void 0===e?void 0:e.querySelector("table");return pt(a,this.element)}async getLayoutState(t){var i,e,a,s;const r=null!==(i=null==t?void 0:t.detail)&&void 0!==i?i:"summary",n=ot(this.element),o=this.getEffectiveScaleFactor(),l=Number.isFinite(o)&&o>0?o:1,h=this.componentStyle((t=>{var i;return(null===(i=t.global)||void 0===i?void 0:i.fontSizePx)||13.3333}))*l,d={version:nt,tag:this.element.localName,id:dt(this.element),slot:null!==(e=this.element.getAttribute("slot"))&&void 0!==e?e:void 0,rect:lt(this.element,n),em:{fontSizePx:h,appliedScaleFactor:l},regions:[],metadata:{},diagnostics:ht(this.element),scaling:this.resolveScalingInfo(h),baseline:this.readBaseline()},p=null===(a=this.element.shadowRoot)||void 0===a?void 0:a.querySelector("bn-table-renderer");if(p){const t=null!==(s=p.scenarios)&&void 0!==s?s:[];if(d.metadata.scenarios=t.filter((t=>!t.startsWith("d"))),d.metadata.variances=t.filter((t=>t.startsWith("d"))),"function"==typeof p.getLayoutDetail){const t=await p.getLayoutDetail(n,r);d.regions=t.regions,d.metadata=Object.assign(Object.assign({},d.metadata),t.metadata),d.diagnostics=[...d.diagnostics,...t.diagnostics],t.elements&&(d.elements=t.elements),t.table&&(d.table=t.table)}}return d}resolveScalingInfo(t){var i,e;const a={},s=E(this.unitScaling,this.pixelPerUnitGroupMap);if("value"===s.kind)a.unitMode="fixed",a.unitsPerEm=s.value,a.unitPxPerUnit=t/s.value;else{a.unitMode="auto";const e=null===(i=this.lastAutoScalingReport)||void 0===i?void 0:i.unit;void 0!==e&&e>0&&(a.unitsPerEm=1/e,a.unitPxPerUnit=e*t)}const r=E(this.percentageScaling,this.pixelPerUnitGroupMap);if("value"===r.kind)a.percentageMode="fixed",a.percentagePointsPerEm=r.value,a.percentagePxPerPoint=t/r.value;else{a.percentageMode="auto";const i=null===(e=this.lastAutoScalingReport)||void 0===e?void 0:e.percentage;void 0!==i&&i>0&&(a.percentagePointsPerEm=1/i,a.percentagePxPerPoint=i*t)}return a}getEffectiveScaleFactor(){const{mode:t,factor:i}=z(this.scale);return"factor"===t?i:"auto"===t||"empty"===t?this.appliedScaleFactor:1}getFontStyles(){const t=this.getEffectiveScaleFactor();return this.componentStyle((i=>{var e,a,s,r;const n=(null===(e=i.global)||void 0===e?void 0:e.fontSizePx)||13.3333;return{"--bn-font-family":(null===(a=i.global)||void 0===a?void 0:a.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":n*t+"px","--bn-font-color":(null===(s=i.global)||void 0===s?void 0:s.fontColor)||"#000000","--bn-font-background":(null===(r=i.global)||void 0===r?void 0:r.fontBackgroundColor)||"#ffffff"}}))}render(){const t=this.getFontStyles(),i=this.getEffectiveScaleFactor();return a(s,{key:"2af1b7f31952cd0ba32e0a069ce143d3402b4a77",style:t},a("div",{key:"b78ad13abb48a43c1da0aec4727372a482c39701"},a("bn-table-renderer",{key:"ab0132a3b57953379f6d8f5f19a18f95a14cc326",tableName:this.datasetName,dataVersion:this.dataVersion,sumTitle:this.prepareSumTitle(),scenarios:this.prepareScenarios(),scenariosDataFormat:this.prepareDataFormat(),grouped:this.prepareGrouped(),limit:this.prepareLimit(),showGroupTitle:this.prepareShowGroupTitle(),runningSum:this.runningSum,varianceWaterfall:this.varianceWaterfall,thereof:this.prepareThereOf(),thereofPosition:this.prepareThereofPosition(),partof:this.preparePartOf(),order:this.prepareOrder(),categorythereof:this.prepareColumnThereOf(),attributeColumns:this.prepareAttributes(),type:this.prepareTableType(),categoryWidth:this.prepareCategoryWidth(),dataFormatDigits:this.prepareDataFormatDigits(),i18n:this.prepareI18n(),i18nMode:this.prepareI18nMode(),measureScale:this.prepareMeasureScale(),measureType:this.prepareMeasureType(),measureUnit:this.prepareMeasureUnit(),showMeasureScale:this.prepareShowMeasureScale(),filter:this.prepareFilter(),barColumns:this.prepareBarColumns(),interval:this.prepareInterval(),categoryIntervalPosition:this.prepareCategoryIntervalPosition(),barColumnMaxWidth:this.prepareBarColumnWidth(),unitScaling:this.prepareUnitScaling(),percentageScaling:this.preparePercentageScaling(),reportAutoScaling:this.handleAutoScalingReport,errors:this.errors,scaleFactor:i,ruleSetConfig:this.ruleSetConfig(),selectedStyle:this.selectedStyle})))}get element(){return this}static get watchers(){return{scale:[{validateScaling:0}],filter:[{validateFilter:0}],scenarios:[{validateScenario:0}],variances:[{validateVariances:0}],barColumns:[{validateBarColumns:0}],barColumnWidth:[{validateBarColumnWidth:0}],unitScaling:[{validateUnitScaling:0}],percentageScaling:[{validatePercentageScaling:0}],dataFormat:[{validateDataFormat:0}],type:[{validateType:0}],limit:[{validateLimit:0}],thereof:[{validateThereOf:0}],thereofPosition:[{validateThereofPosition:0}],partof:[{validatePartOf:0}],order:[{validateOrderList:0}],orderDirection:[{validateOrderDirection:0}],measureType:[{validateMeasureType:0}],measureScale:[{validateMeasureScale:0}],dataFormatDigitsDecimal:[{validateDataFormatDigitsDecimal:0}],dataFormatDigitsPercent:[{validateDateFormatDigitsPercent:0}],categoryWidth:[{validateCategoryWidth:0}],columnthereof:[{validateColumnThereOf:0}],interval:[{validateInterval:0}],categoryIntervalPosition:[{validateCategoryIntervalPosition:0}],tableAttributes:[{validateTableAttributes:0}]}}static get style(){return':host(.no-data){display:block;box-sizing:border-box;width:100%;height:100%}:host(.no-data)>div{float:none;width:100%;height:100%}:host(.no-data) .no-data~.no-data{display:none}.empty-state{box-sizing:border-box;display:flex;align-items:center;justify-content:center;float:none;width:100%;height:100%;min-height:3em;margin:0;padding:0.5em;overflow:hidden;border:0.1em dashed #ddd;color:#808080;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);font-style:normal;text-align:center}:host{display:inline-block;position:relative;overflow:hidden;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000)}'}},[1,"bn-table",{datasets:[513],i18nNamespace:[513,"i18n-namespace"],scale:[1],ruleset:[513],selectedStyle:[513,"selected-style"],sumTitle:[1,"sum-title"],filter:[1],measureUnit:[1,"measure-unit"],scenarios:[1],variances:[1],barColumns:[1,"bar-columns"],barColumnWidth:[1,"bar-column-width"],unitScaling:[8,"unit-scaling"],percentageScaling:[8,"percentage-scaling"],dataFormat:[1,"data-format"],grouped:[4],showMeasureScale:[4,"show-measure-scale"],showGroupTitle:[4,"show-group-title"],runningSum:[4,"running-sum"],varianceWaterfall:[4,"variance-waterfall"],type:[1],limit:[2],thereof:[1],thereofPosition:[1,"thereof-position"],partof:[1],order:[1],orderDirection:[1,"order-direction"],measureType:[1,"measure-type"],measureScale:[1,"measure-scale"],dataFormatDigitsDecimal:[2,"data-format-digits-decimal"],dataFormatDigitsPercent:[2,"data-format-digits-percent"],categoryWidth:[1,"category-width"],columnthereof:[1],interval:[1],categoryIntervalPosition:[2,"category-interval-position"],tableAttributes:[1,"attributes"],datasetName:[32],dataVersion:[32],datasetMeta:[32],appliedScaleFactor:[32],hasBlankSetnames:[32],hasSetnameIndexWithoutSetname:[32],getBaseline:[64],getLayoutState:[64]},void 0,{scale:[{validateScaling:0}],filter:[{validateFilter:0}],scenarios:[{validateScenario:0}],variances:[{validateVariances:0}],barColumns:[{validateBarColumns:0}],barColumnWidth:[{validateBarColumnWidth:0}],unitScaling:[{validateUnitScaling:0}],percentageScaling:[{validatePercentageScaling:0}],dataFormat:[{validateDataFormat:0}],type:[{validateType:0}],limit:[{validateLimit:0}],thereof:[{validateThereOf:0}],thereofPosition:[{validateThereofPosition:0}],partof:[{validatePartOf:0}],order:[{validateOrderList:0}],orderDirection:[{validateOrderDirection:0}],measureType:[{validateMeasureType:0}],measureScale:[{validateMeasureScale:0}],dataFormatDigitsDecimal:[{validateDataFormatDigitsDecimal:0}],dataFormatDigitsPercent:[{validateDateFormatDigitsPercent:0}],categoryWidth:[{validateCategoryWidth:0}],columnthereof:[{validateColumnThereOf:0}],interval:[{validateInterval:0}],categoryIntervalPosition:[{validateCategoryIntervalPosition:0}],tableAttributes:[{validateTableAttributes:0}]}]),vt=ct,mt=function(){"undefined"!=typeof customElements&&["bn-table","bn-table-renderer"].forEach((t=>{switch(t){case"bn-table":customElements.get(r(t))||customElements.define(r(t),ct);break;case"bn-table-renderer":customElements.get(r(t))||et()}}))};export{vt as BnTable,mt as defineCustomElement}
1
+ import{p as t,H as i,w as e,h as a,d as s,t as r,f as n}from"./p-BnmylmXF.js";import{h as o,a as l}from"./p-6242qMx1.js";import{v as h,a as d,i as p,q as u,r as c,s as v,t as m,h as g,u as f,w as y,x as b,y as S,c as w,z as O,m as T,A,B as D,f as N,C as W}from"./p-Dw3rv_Y9.js";import{w as _}from"./p-CZzlLTQc.js";import{w as C}from"./p-BrQCbmG0.js";import{w as P}from"./p-Bp5Xj4-s.js";import{w as F,a as M,i as R}from"./p-CUoPUIej.js";import{w as j}from"./p-D_K7tYhY.js";import{w as x}from"./p-JG4Sx1lE.js";import{r as I}from"./p-CmvpJzLd.js";import{w as U}from"./p-DRmphEA0.js";import{w as k,r as B}from"./p-D32TsLzd.js";import{g as L}from"./p-Dsvjkuy3.js";import{f as G,r as E,p as z}from"./p-Xb6Ilq8u.js";import{o as J}from"./p-B6kka9sT.js";import{D as $,I as X,d as V,M as Y,B as Z,T as q}from"./p-DFybNETX.js";import{T as Q,a as K,p as H}from"./p-BZXiWkDS.js";import{I as tt,a as it,d as et,c as at}from"./p-CLjuZoiT.js";import{a as st,n as rt}from"./p-j42D1yrQ.js";import{L as nt}from"./p-DY5fMUX8.js";import{o as ot,m as lt}from"./p-DdvG1D18.js";import{r as ht,a as dt}from"./p-CckAR27O.js";import{b as pt}from"./p-JofGXz75.js";import{s as ut}from"./p-DakXa7Dp.js";const ct=t(class extends i{validateScaling(t){if(null==t||""===t||"none"===t||"auto"===t)return void this.errors.remove("WARN_scale");const i=Number(t);isNaN(i)||i<=0?this.errors.addOrReplace({id:"WARN_scale",type:"warning",message:`Invalid scale value: "${t}". Use "none", "auto", or a positive number.`}):this.errors.remove("WARN_scale")}constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.layoutObserver=null,this._lastScaledParentWidth=0,this.datasetName="",this.dataVersion=0,this.datasetMeta=null,this.appliedScaleFactor=1,this.hasBlankSetnames=!1,this.hasSetnameIndexWithoutSetname=!1,this.sumTitle="",this.filter="",this.measureUnit="",this.barColumnWidth="w10",this.unitScaling="100",this.percentageScaling="2",this.pixelPerUnitGroupMap=new Map,this.dataFormat="decimal",this.grouped=!1,this.showMeasureScale=!1,this.showGroupTitle=!0,this.runningSum=!1,this.varianceWaterfall=!1,this.type="list",this.limit=0,this.thereof="[]",this.thereofPosition="below",this.partof="[]",this.order="category",this.orderDirection="asc",this.measureType="volume",this.measureScale="greatest",this.dataFormatDigitsDecimal=1,this.dataFormatDigitsPercent=2,this.categoryWidth="w15",this.columnthereof=null,this.interval="none",this.categoryIntervalPosition=0,this.tableAttributes="",this._autoScaleGuard=!1,this.autoUnitWarningActive=!1,this.autoPctWarningActive=!1,this.handleAutoScalingReport=t=>{var i,e,a,s;this.lastAutoScalingReport={unit:null!==(i=t.unit)&&void 0!==i?i:null===(e=this.lastAutoScalingReport)||void 0===e?void 0:e.unit,percentage:null!==(a=t.percentage)&&void 0!==a?a:null===(s=this.lastAutoScalingReport)||void 0===s?void 0:s.percentage};const r=(t,i)=>void 0===i||Math.abs(t-i)>.001*Math.abs(t);if(void 0!==t.unit&&t.unit>0&&this.autoUnitWarningActive){const i=1/t.unit;r(i,this.lastReportedUnitsPerEm)&&(this.lastReportedUnitsPerEm=i,this.errors.addOrReplace({id:"AUTO_unitScaling",type:"warning",message:`unit-scaling: invalid value "${this.unitScaling}" - auto-fitted to 1 em ≈ ${G(i)} units.`}))}if(void 0!==t.percentage&&t.percentage>0&&this.autoPctWarningActive){const i=1/t.percentage;r(i,this.lastReportedPpPerEm)&&(this.lastReportedPpPerEm=i,this.errors.addOrReplace({id:"AUTO_percentageScaling",type:"warning",message:`percentage-scaling: invalid value "${this.percentageScaling}" - auto-fitted to 1 em ≈ ${G(i)} percentage points.`}))}},j(this),C(this),this.errors=k(this),P(this),this.componentStyle=x(this),this.ruleSetConfig=U(this),_(this,((t,i)=>{this.datasetName=(null==t?void 0:t.startsWith("$"))?t.substring(1):t||"",this.dataVersion=this.dataVersion+1,this.hasBlankSetnames=Array.isArray(i)&&i.some((t=>{var i;return p(null!==(i=null==t?void 0:t.setname)&&void 0!==i?i:null==t?void 0:t.setName)})),this.hasSetnameIndexWithoutSetname=Array.isArray(i)&&i.some((t=>{var i,e;return void 0!==at(null!==(i=null==t?void 0:t.setnameIndex)&&void 0!==i?i:null==t?void 0:t.setNameIndex)&&p(null!==(e=null==t?void 0:t.setname)&&void 0!==e?e:null==t?void 0:t.setName)}))}),((t,i)=>{this.datasetMeta=i})),this.t=F(this).t,this.resolveInherited=M(this,[{propName:"scenarios",ancestorAttr:"title-scenarios"},{propName:"variances",ancestorAttr:"title-variances"},{propName:"order",ancestorAttr:"title-order"},{propName:"orderDirection",ancestorAttr:"title-order-direction"}],this.errors)}validateFilter(t){const i="ERR_filter";o(t)?this.errors.addOrReplace({id:i,type:"error",message:"filter: double backticks are not allowed."}):this.errors.remove(i)}validateScenario(t){const i="WARN_scenarios";if(R(t))return void this.errors.remove(i);const e=h(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"scenarios: invalid value(s) '"+(null==e?void 0:""+e)+"' are not supported."}):this.errors.remove(i)}validateVariances(t){const i="WARN_variances";if(R(t))return void this.errors.remove(i);const e=d(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"variances: invalid value(s) '"+JSON.stringify(e)+"' are not supported."}):this.errors.remove(i)}validateBarColumns(t){const i="WARN_barColumns";if(p(t))return void this.errors.remove(i);const e=u(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"barColumns: invalid value(s) '"+JSON.stringify(e)+"' are not supported."}):this.errors.remove(i)}validateBarColumnWidth(t){const i="WARN_barColumnWidth";c(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"barColumnWidth: invalid value '"+t+"' is not supported."})}validateUnitScaling(t){const i="WARN_unitScaling";"invalid"===E(t,this.pixelPerUnitGroupMap).kind?this.errors.addOrReplace({id:i,type:"warning",message:"unitScaling: invalid value '"+t+"' is not supported."}):this.errors.remove(i)}validatePercentageScaling(t){const i="WARN_percentageScaling";"invalid"===E(t,this.pixelPerUnitGroupMap).kind?this.errors.addOrReplace({id:i,type:"warning",message:"percentageScaling: invalid value '"+t+"' is not supported."}):this.errors.remove(i)}validateDataFormat(t){const i="WARN_dataFormat";v(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"dataFormat: invalid value(s) '"+(null==t?void 0:""+t)+"' are not supported."})}validateType(t){const i="WARN_type";m(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"type: invalid value(s) '"+(null==t?void 0:""+t)+"' are not supported."})}validateLimit(t){const i="WARN_limit";g(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"order: invalid value '"+(null==t?void 0:""+t)+"' is not supported."})}validateThereOf(t){const i="WARN_thereof",e=f(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"ThereOf: invalid value(s) '"+JSON.stringify(e)+"' are not supported."}):this.errors.remove(i)}validateThereofPosition(t){const i="WARN_thereofPosition";p(t)||y(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"thereofPosition: invalid value '"+t+"' is not supported."})}validatePartOf(t){const i="WARN_partof",e=b(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"partof: invalid value(s) '"+JSON.stringify(e)+"' are not supported."}):this.errors.remove(i)}validateOrderList(t){const i="WARN_order";if(R(t))return void this.errors.remove(i);const e=S(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"order: invalid value(s) '"+JSON.stringify(e)+"' are not supported."}):this.errors.remove(i)}validateOrderDirection(t){const i="WARN_orderDirection";R(t)||w(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"orderDirection: invalid value '"+(null==t?void 0:""+t)+"' is not supported."})}validateMeasureType(t){const i="WARN_measureType";O(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"measureType: invalid value '"+(null==t?void 0:""+t)+"' is not supported."})}validateMeasureScale(t){const i="WARN_measureScale";T(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"measureScale: invalid value '"+(null==t?void 0:""+t)+"' is not supported."})}validateDataFormatDigitsDecimal(t){const i="WARN_dataFormatDigitsDecimal";g(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"dataFormatDigitsDecimal: invalid value(s) '"+t+"' are not supported."})}validateDateFormatDigitsPercent(t){const i="WARN_dataFormatDigitsPercent";g(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"dataFormatDigitsPercent: invalid value(s) '"+t+"' are not supported."})}validateCategoryWidth(t){const i="WARN_categoryWidth";A(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"categoryWidth: invalid value(s) '"+t+"' are not supported."})}validateColumnThereOf(t){const i=D(t),e="WARN_columnthereof";i.length>0?this.errors.addOrReplace({id:e,type:"warning",message:"columnthereof: invalid value(s) '"+JSON.stringify(i)+"' are not supported."}):this.errors.remove(e)}validateInterval(t){const i="WARN_interval",e=null==t?void 0:t.trim().toLowerCase();p(t)||e===tt||e===it||N(e)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"interval: invalid value '"+t+"' is not supported."})}validateCategoryIntervalPosition(t){const i="WARN_categoryIntervalPosition";p(t)||g(t)&&Number(t)>=0?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"categoryIntervalPosition: invalid value '"+t+"' is not supported."})}validateTableAttributes(t){const i="WARN_attributes",e=W(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"attributes: invalid value(s) '"+JSON.stringify(e)+"' are not supported."}):this.errors.remove(i)}componentWillLoad(){this.validateFilter(this.filter),this.validateScenario(this.scenarios),this.validateVariances(this.variances),this.validateDataFormat(this.dataFormat),this.validateType(this.type),this.validateLimit(this.limit),this.validateThereOf(this.thereof),this.validateThereofPosition(this.thereofPosition),this.validatePartOf(this.partof),this.validateOrderDirection(this.orderDirection),this.validateOrderList(this.order),this.validateDataFormatDigitsDecimal(this.dataFormatDigitsDecimal),this.validateDateFormatDigitsPercent(this.dataFormatDigitsPercent),this.validateCategoryWidth(this.categoryWidth),this.validateMeasureType(this.measureType),this.validateMeasureScale(this.measureScale),this.validateColumnThereOf(this.columnthereof),this.validateInterval(this.interval),this.validateCategoryIntervalPosition(this.categoryIntervalPosition),this.validateTableAttributes(this.tableAttributes),this.validateBarColumns(this.barColumns),this.validateBarColumnWidth(this.barColumnWidth),this.validateUnitScaling(this.unitScaling),this.validatePercentageScaling(this.percentageScaling),this.validateScaling(this.scale)}componentDidLoad(){this.layoutObserver=J(this.element,(()=>{if(this._autoScaleGuard)return;const{width:t}=L(this.element);t>0&&Math.abs(t-this._lastScaledParentWidth)>2&&(this._lastScaledParentWidth=t,n(this))}))}disconnectedCallback(){var t;null===(t=this.layoutObserver)||void 0===t||t.disconnect(),this.layoutObserver=null}componentDidRender(){ut(this.element,"bn-table-renderer");const{mode:t}=z(this.scale);if("auto"!==t&&"empty"!==t)return this._autoScaleGuard=!1,void this.checkOverflow();if(this._autoScaleGuard)return this._autoScaleGuard=!1,void this.checkOverflow();const i=this.element,{width:a}=L(i);if(a<=0)return void this.checkOverflow();this._lastScaledParentWidth=a;const s=this.componentStyle((t=>{var i;return(null===(i=t.global)||void 0===i?void 0:i.fontSizePx)||13.3333})),r=i.scrollWidth,n=this.appliedScaleFactor;if(r<=a+1)return this.errors.remove("AUTO_scale"),void this.checkOverflow();const o=Math.max(.3,n*(a-1)/r);Math.abs(o-n)<.001||(i.style.setProperty("--bn-font-size",s*o+"px"),"empty"===t?this.errors.addOrReplace({id:"AUTO_scale",type:"warning",message:"Auto-scaled table by factor "+o.toFixed(3)}):this.errors.remove("AUTO_scale"),this._autoScaleGuard=!0,e((()=>{this.appliedScaleFactor=o}))),this.checkOverflow()}checkOverflow(){const t=L(this.element),i=this.element.scrollWidth,e=this.element.scrollHeight,a=t.width>0&&i>t.width+1,s=t.height>0&&e>t.height+1;if(!a&&!s)return void B(this.errors,null);const{mode:r}=z(this.scale),n="auto"!==r&&"empty"!==r,o=[];a&&o.push(`width (${Math.round(i)}px > ${Math.round(t.width)}px)`),s&&o.push(`height (${Math.round(e)}px > ${Math.round(t.height)}px)`),B(this.errors,`Table exceeds available ${o.join(" and ")}. Give the component more space, reduce rows (e.g. limit), or set a smaller scale.`,n)}prepareDataFormat(){var t;return $[null===(t=this.dataFormat)||void 0===t?void 0:t.toUpperCase()]}prepareGrouped(){return this.grouped}prepareShowGroupTitle(){return this.showGroupTitle}prepareThereofPosition(){var t;return(null===(t=this.thereofPosition)||void 0===t?void 0:t.toLowerCase())===Q.ABOVE?Q.ABOVE:Q.BELOW}prepareTableType(){var t;return K[null===(t=this.type)||void 0===t?void 0:t.toUpperCase()]}prepareLimit(){return Math.floor(Number(this.limit)||0)}prepareThereOf(){if(null==this.thereof||""===this.thereof.trim())return[];try{return JSON.parse(this.thereof)}catch(t){return[]}}preparePartOf(){if(null==this.partof||""===this.partof.trim())return[];try{return JSON.parse(this.partof)}catch(t){return[]}}prepareOrder(){var t;const i=this.resolveInherited("order",this.order,"category").value,e=this.resolveInherited("orderDirection",this.orderDirection,"asc").value,a="auto"===(null==i?void 0:i.trim().toLowerCase());let s=i;return a&&(null===(t=this.datasetMeta)||void 0===t?void 0:t.suggestedOrder)&&(s=this.datasetMeta.suggestedOrder),{hierarchy:s.split(",").map((t=>rt(t))),direction:st[null==e?void 0:e.toUpperCase()]}}prepareI18nMode(){return X.META}prepareI18n(){const t=l,i=new Map(["in","category","operation","thereof","part_of","SUM_TOTAL","no-data","REST"].map((t=>[t,this.t(".".concat(t))]))),e=new Map(t.map((t=>[t,this.t("global.".concat(t))])));return new Map([...e.entries(),...i.entries(),...I(this.ruleSetConfig("user"))])}prepareDataFormatDigits(){return{percent:this.dataFormatDigitsPercent,decimal:this.dataFormatDigitsDecimal}}prepareScenarios(){var t,i,e,a,s,r,n,o,l,h,d;const u=this.resolveInherited("scenarios",this.scenarios),c=this.resolveInherited("variances",this.variances);if(u.inherited||c.inherited){this.errors.remove("AUTO_scenarios");let a=[];return p(u.value)?u.unresolved&&(a=a.concat(null!==(i=null===(t=this.datasetMeta)||void 0===t?void 0:t.availableScenarios)&&void 0!==i?i:[])):a=a.concat(u.value.split(",")),(null===(e=c.value)||void 0===e?void 0:e.trim().length)>0&&(a=a.concat(c.value.split(","))),a.map((t=>t.trim()))}const v="auto"===(null===(a=u.value)||void 0===a?void 0:a.trim().toLowerCase()),m=v||u.unresolved;if((p(u.value)||v)&&p(c.value))return(null===(r=null===(s=this.datasetMeta)||void 0===s?void 0:s.availableScenarios)||void 0===r?void 0:r.length)>0?(m?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):[];let g=[];return v||p(u.value)?(null===(o=null===(n=this.datasetMeta)||void 0===n?void 0:n.availableScenarios)||void 0===o?void 0:o.length)>0&&(m?this.errors.remove("AUTO_scenarios"):this.errors.addOrReplace({id:"AUTO_scenarios",type:"warning",message:"scenarios: not set, auto-detected: "+this.datasetMeta.availableScenarios.join(",")}),g=g.concat(this.datasetMeta.availableScenarios)):(this.errors.remove("AUTO_scenarios"),g=g.concat(null===(l=u.value)||void 0===l?void 0:l.split(","))),(null===(h=c.value)||void 0===h?void 0:h.trim().length)>0&&(g=g.concat(null===(d=c.value)||void 0===d?void 0:d.split(","))),g.map((t=>t.trim()))}prepareCategoryWidth(){var t;return p(this.categoryWidth)?V.INF:V[null===(t=this.categoryWidth)||void 0===t?void 0:t.toUpperCase()]}prepareMeasureScale(){return p(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"}prepareMeasureType(){var t;return p(this.measureType)?Y.VOLUME:Y[null===(t=this.measureType)||void 0===t?void 0:t.toUpperCase()]}prepareColumnThereOf(){if(null==this.columnthereof||""===this.columnthereof.trim())return new Map;const t=new Map;try{const i=JSON.parse(this.columnthereof);for(const[e,a]of Object.entries(i))!1===t.has(a.scenario)&&t.set(a.scenario,[]),t.get(a.scenario).push(a)}catch(t){return new Map}return t}prepareInterval(){var t;const i="WARN_intervalConflict",e="WARN_intervalNoDate",a="WARN_intervalSetname",s="WARN_intervalSetnameIndex",r=p(this.interval)?tt:this.interval.trim().toLowerCase();return r!==tt&&r!==it&&!N(r)||r===tt?(this.errors.remove(i),this.errors.remove(e),this.errors.remove(a),this.errors.remove(s),tt):null!=this.columnthereof&&""!==this.columnthereof.trim()?(this.errors.addOrReplace({id:i,type:"warning",message:"interval: cannot be combined with columnthereof, interval is ignored."}),this.errors.remove(e),this.errors.remove(a),this.errors.remove(s),tt):(this.errors.remove(i),r===it?(this.hasBlankSetnames?this.errors.addOrReplace({id:a,type:"warning",message:"interval: rows with blank setname found, they are grouped under '-'."}):this.errors.remove(a),this.hasSetnameIndexWithoutSetname?this.errors.addOrReplace({id:s,type:"warning",message:"interval: rows with setnameIndex but blank setname found, setnameIndex needs setname."}):this.errors.remove(s),this.errors.remove(e),it):(this.errors.remove(a),this.errors.remove(s),this.datasetMeta&&!(null===(t=this.datasetMeta.dateRange)||void 0===t?void 0:t.hasData)?(this.errors.addOrReplace({id:e,type:"warning",message:"interval: dataset has no date values, interval is ignored."}),tt):(this.errors.remove(e),r)))}prepareCategoryIntervalPosition(){const t=Number(this.categoryIntervalPosition);return Number.isInteger(t)&&t>0?t:0}prepareAttributes(){if(null==this.tableAttributes||""===this.tableAttributes.trim())return[];try{const t=JSON.parse(this.tableAttributes);return null===t||"object"!=typeof t||t instanceof Array?[]:Object.entries(t).map((([t,i],e)=>"string"==typeof i?H(t,"attr_"+e,i):null)).filter((t=>null!==t))}catch(t){return[]}}prepareSumTitle(){return""===this.sumTitle||null==this.sumTitle?"SUM_TOTAL":this.sumTitle}prepareShowMeasureScale(){return this.showMeasureScale}prepareMeasureUnit(){return""===this.measureUnit||null==this.measureUnit?"":this.measureUnit}prepareFilter(){return 0===this.filter.length?"":this.filter}prepareBarColumnWidth(){var t;const i=null===(t=this.barColumnWidth)||void 0===t?void 0:t.toUpperCase(),e=q[i];return e?Z[e]:Z[q.W10]}prepareBarColumns(){return p(this.barColumns)?[]:this.barColumns.split(",").map((t=>t.trim()))}prepareUnitScaling(){const t=E(this.unitScaling,this.pixelPerUnitGroupMap);return"value"===t.kind?(this.errors.remove("AUTO_unitScaling"),this.autoUnitWarningActive=!1,this.lastReportedUnitsPerEm=void 0,1/t.value):"auto"===t.kind?(this.errors.remove("AUTO_unitScaling"),this.autoUnitWarningActive=!1,this.lastReportedUnitsPerEm=void 0,0):(this.autoUnitWarningActive=!0,this.errors.addOrReplace({id:"AUTO_unitScaling",type:"warning",message:`unit-scaling: invalid value "${t.raw}" - auto-fitting to the bar column width.`}),0)}preparePercentageScaling(){const t=E(this.percentageScaling,this.pixelPerUnitGroupMap);return"value"===t.kind?(this.errors.remove("AUTO_percentageScaling"),this.autoPctWarningActive=!1,this.lastReportedPpPerEm=void 0,1/t.value):"auto"===t.kind?(this.errors.remove("AUTO_percentageScaling"),this.autoPctWarningActive=!1,this.lastReportedPpPerEm=void 0,0):(this.autoPctWarningActive=!0,this.errors.addOrReplace({id:"AUTO_percentageScaling",type:"warning",message:`percentage-scaling: invalid value "${t.raw}" - auto-fitting to the pin area.`}),0)}getDataStructure(){return{ITableDataRow:{setName:{type:"string",isOptional:!1,description:""},setNameIndex:{type:"number",isOptional:!0,description:""},date:{type:"string",isOptional:!1,description:""},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:""}}}}async getBaseline(){return this.readBaseline()}readBaseline(){var t,i,e;const a=null===(e=null===(i=null===(t=this.element.shadowRoot)||void 0===t?void 0:t.querySelector("bn-table-renderer"))||void 0===i?void 0:i.shadowRoot)||void 0===e?void 0:e.querySelector("table");return pt(a,this.element)}async getLayoutState(t){var i,e,a,s;const r=null!==(i=null==t?void 0:t.detail)&&void 0!==i?i:"summary",n=ot(this.element),o=this.getEffectiveScaleFactor(),l=Number.isFinite(o)&&o>0?o:1,h=this.componentStyle((t=>{var i;return(null===(i=t.global)||void 0===i?void 0:i.fontSizePx)||13.3333}))*l,d={version:nt,tag:this.element.localName,id:dt(this.element),slot:null!==(e=this.element.getAttribute("slot"))&&void 0!==e?e:void 0,rect:lt(this.element,n),em:{fontSizePx:h,appliedScaleFactor:l},regions:[],metadata:{},diagnostics:ht(this.element),scaling:this.resolveScalingInfo(h),baseline:this.readBaseline()},p=null===(a=this.element.shadowRoot)||void 0===a?void 0:a.querySelector("bn-table-renderer");if(p){const t=null!==(s=p.scenarios)&&void 0!==s?s:[];if(d.metadata.scenarios=t.filter((t=>!t.startsWith("d"))),d.metadata.variances=t.filter((t=>t.startsWith("d"))),"function"==typeof p.getLayoutDetail){const t=await p.getLayoutDetail(n,r);d.regions=t.regions,d.metadata=Object.assign(Object.assign({},d.metadata),t.metadata),d.diagnostics=[...d.diagnostics,...t.diagnostics],t.elements&&(d.elements=t.elements),t.table&&(d.table=t.table)}}return d}resolveScalingInfo(t){var i,e;const a={},s=E(this.unitScaling,this.pixelPerUnitGroupMap);if("value"===s.kind)a.unitMode="fixed",a.unitsPerEm=s.value,a.unitPxPerUnit=t/s.value;else{a.unitMode="auto";const e=null===(i=this.lastAutoScalingReport)||void 0===i?void 0:i.unit;void 0!==e&&e>0&&(a.unitsPerEm=1/e,a.unitPxPerUnit=e*t)}const r=E(this.percentageScaling,this.pixelPerUnitGroupMap);if("value"===r.kind)a.percentageMode="fixed",a.percentagePointsPerEm=r.value,a.percentagePxPerPoint=t/r.value;else{a.percentageMode="auto";const i=null===(e=this.lastAutoScalingReport)||void 0===e?void 0:e.percentage;void 0!==i&&i>0&&(a.percentagePointsPerEm=1/i,a.percentagePxPerPoint=i*t)}return a}getEffectiveScaleFactor(){const{mode:t,factor:i}=z(this.scale);return"factor"===t?i:"auto"===t||"empty"===t?this.appliedScaleFactor:1}getFontStyles(){const t=this.getEffectiveScaleFactor();return this.componentStyle((i=>{var e,a,s,r;const n=(null===(e=i.global)||void 0===e?void 0:e.fontSizePx)||13.3333;return{"--bn-font-family":(null===(a=i.global)||void 0===a?void 0:a.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":n*t+"px","--bn-font-color":(null===(s=i.global)||void 0===s?void 0:s.fontColor)||"#000000","--bn-font-background":(null===(r=i.global)||void 0===r?void 0:r.fontBackgroundColor)||"#ffffff"}}))}render(){const t=this.getFontStyles(),i=this.getEffectiveScaleFactor();return a(s,{key:"2af1b7f31952cd0ba32e0a069ce143d3402b4a77",style:t},a("div",{key:"b78ad13abb48a43c1da0aec4727372a482c39701"},a("bn-table-renderer",{key:"ab0132a3b57953379f6d8f5f19a18f95a14cc326",tableName:this.datasetName,dataVersion:this.dataVersion,sumTitle:this.prepareSumTitle(),scenarios:this.prepareScenarios(),scenariosDataFormat:this.prepareDataFormat(),grouped:this.prepareGrouped(),limit:this.prepareLimit(),showGroupTitle:this.prepareShowGroupTitle(),runningSum:this.runningSum,varianceWaterfall:this.varianceWaterfall,thereof:this.prepareThereOf(),thereofPosition:this.prepareThereofPosition(),partof:this.preparePartOf(),order:this.prepareOrder(),categorythereof:this.prepareColumnThereOf(),attributeColumns:this.prepareAttributes(),type:this.prepareTableType(),categoryWidth:this.prepareCategoryWidth(),dataFormatDigits:this.prepareDataFormatDigits(),i18n:this.prepareI18n(),i18nMode:this.prepareI18nMode(),measureScale:this.prepareMeasureScale(),measureType:this.prepareMeasureType(),measureUnit:this.prepareMeasureUnit(),showMeasureScale:this.prepareShowMeasureScale(),filter:this.prepareFilter(),barColumns:this.prepareBarColumns(),interval:this.prepareInterval(),categoryIntervalPosition:this.prepareCategoryIntervalPosition(),barColumnMaxWidth:this.prepareBarColumnWidth(),unitScaling:this.prepareUnitScaling(),percentageScaling:this.preparePercentageScaling(),reportAutoScaling:this.handleAutoScalingReport,errors:this.errors,scaleFactor:i,ruleSetConfig:this.ruleSetConfig(),selectedStyle:this.selectedStyle})))}get element(){return this}static get watchers(){return{scale:[{validateScaling:0}],filter:[{validateFilter:0}],scenarios:[{validateScenario:0}],variances:[{validateVariances:0}],barColumns:[{validateBarColumns:0}],barColumnWidth:[{validateBarColumnWidth:0}],unitScaling:[{validateUnitScaling:0}],percentageScaling:[{validatePercentageScaling:0}],dataFormat:[{validateDataFormat:0}],type:[{validateType:0}],limit:[{validateLimit:0}],thereof:[{validateThereOf:0}],thereofPosition:[{validateThereofPosition:0}],partof:[{validatePartOf:0}],order:[{validateOrderList:0}],orderDirection:[{validateOrderDirection:0}],measureType:[{validateMeasureType:0}],measureScale:[{validateMeasureScale:0}],dataFormatDigitsDecimal:[{validateDataFormatDigitsDecimal:0}],dataFormatDigitsPercent:[{validateDateFormatDigitsPercent:0}],categoryWidth:[{validateCategoryWidth:0}],columnthereof:[{validateColumnThereOf:0}],interval:[{validateInterval:0}],categoryIntervalPosition:[{validateCategoryIntervalPosition:0}],tableAttributes:[{validateTableAttributes:0}]}}static get style(){return':host(.no-data){display:block;box-sizing:border-box;width:100%;height:100%}:host(.no-data)>div{float:none;width:100%;height:100%}:host(.no-data) .no-data~.no-data{display:none}.empty-state{box-sizing:border-box;display:flex;align-items:center;justify-content:center;float:none;width:100%;height:100%;min-height:3em;margin:0;padding:0.5em;overflow:hidden;border:0.1em dashed #ddd;color:#808080;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);font-style:normal;text-align:center}:host{display:inline-block;position:relative;overflow:hidden;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000)}'}},[1,"bn-table",{datasets:[513],i18nNamespace:[513,"i18n-namespace"],scale:[1],ruleset:[513],selectedStyle:[513,"selected-style"],sumTitle:[1,"sum-title"],filter:[1],measureUnit:[1,"measure-unit"],scenarios:[1],variances:[1],barColumns:[1,"bar-columns"],barColumnWidth:[1,"bar-column-width"],unitScaling:[8,"unit-scaling"],percentageScaling:[8,"percentage-scaling"],dataFormat:[1,"data-format"],grouped:[4],showMeasureScale:[4,"show-measure-scale"],showGroupTitle:[4,"show-group-title"],runningSum:[4,"running-sum"],varianceWaterfall:[4,"variance-waterfall"],type:[1],limit:[2],thereof:[1],thereofPosition:[1,"thereof-position"],partof:[1],order:[1],orderDirection:[1,"order-direction"],measureType:[1,"measure-type"],measureScale:[1,"measure-scale"],dataFormatDigitsDecimal:[2,"data-format-digits-decimal"],dataFormatDigitsPercent:[2,"data-format-digits-percent"],categoryWidth:[1,"category-width"],columnthereof:[1],interval:[1],categoryIntervalPosition:[2,"category-interval-position"],tableAttributes:[1,"attributes"],datasetName:[32],dataVersion:[32],datasetMeta:[32],appliedScaleFactor:[32],hasBlankSetnames:[32],hasSetnameIndexWithoutSetname:[32],getBaseline:[64],getLayoutState:[64]},void 0,{scale:[{validateScaling:0}],filter:[{validateFilter:0}],scenarios:[{validateScenario:0}],variances:[{validateVariances:0}],barColumns:[{validateBarColumns:0}],barColumnWidth:[{validateBarColumnWidth:0}],unitScaling:[{validateUnitScaling:0}],percentageScaling:[{validatePercentageScaling:0}],dataFormat:[{validateDataFormat:0}],type:[{validateType:0}],limit:[{validateLimit:0}],thereof:[{validateThereOf:0}],thereofPosition:[{validateThereofPosition:0}],partof:[{validatePartOf:0}],order:[{validateOrderList:0}],orderDirection:[{validateOrderDirection:0}],measureType:[{validateMeasureType:0}],measureScale:[{validateMeasureScale:0}],dataFormatDigitsDecimal:[{validateDataFormatDigitsDecimal:0}],dataFormatDigitsPercent:[{validateDateFormatDigitsPercent:0}],categoryWidth:[{validateCategoryWidth:0}],columnthereof:[{validateColumnThereOf:0}],interval:[{validateInterval:0}],categoryIntervalPosition:[{validateCategoryIntervalPosition:0}],tableAttributes:[{validateTableAttributes:0}]}]),vt=ct,mt=function(){"undefined"!=typeof customElements&&["bn-table","bn-table-renderer"].forEach((t=>{switch(t){case"bn-table":customElements.get(r(t))||customElements.define(r(t),ct);break;case"bn-table-renderer":customElements.get(r(t))||et()}}))};export{vt as BnTable,mt as defineCustomElement}
@@ -1 +1 @@
1
- import{p as t,H as e,f as n,h as o,a as s,t as i}from"./p-D6YGOYV1.js";import{w as l}from"./p-BKA15uoz.js";import{w as a}from"./p-Bj3RWsEx.js";import{w as r}from"./p-Dq9dG0Kr.js";import{w as d}from"./p-uCpFBDF5.js";import{w as u}from"./p-9X5fVJqR.js";import{w as c}from"./p-4vVbchX2.js";import{g as f}from"./p-Dsvjkuy3.js";import{p as v}from"./p-Xb6Ilq8u.js";import{s as h}from"./p-CyUmrWfW.js";const p="[A-Za-z_$\\u00C0-\\uFFFF][\\w$\\u00C0-\\uFFFF]*",m="'[^'\\\\]*'|\"[^\"\\\\]*\"",b=`(?:this\\.)?data(?:\\.(${p})|\\[\\s*(${m})\\s*\\])\\[\\s*(\\d+)\\s*\\]\\.(${p})`,g=RegExp(`\\$\\{\\s*(?:${b}|t\\(\\s*(${m})\\s*(?:,\\s*\\{([^{}]*)\\}\\s*)?\\))\\s*\\}`,"g"),y=RegExp(`\\s*(?:(${p})|(${m}))\\s*:\\s*(?:(${m})|(-?\\d+(?:\\.\\d+)?)|(${b}))\\s*(?:,|$)`,"y"),w=t=>(t+"").replace(/[&<>"'\t\n\f\r ]/g,(t=>`&#${t.charCodeAt(0)};`)),$=(t,e)=>"object"==typeof t&&null!==t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0,N=t=>t.slice(1,-1);const A=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.refit=()=>{n(this)},this.data={},d(this),r(this),this.errors=c(this),this.t=a(this).t,l(this,((t,e)=>{this.data=""===t?{}:Object.assign(Object.assign({},this.data),{[t]:e})})),this.componentStyle=u(this)}connectedCallback(){var t;null===(t=document.fonts)||void 0===t||t.addEventListener("loadingdone",this.refit)}disconnectedCallback(){var t;null===(t=document.fonts)||void 0===t||t.removeEventListener("loadingdone",this.refit)}validateValue(t){"string"!=typeof t||""===t?this.errors.addOrReplace({id:"WARN_value",type:"warning",message:"Empty value"}):this.errors.remove("WARN_value")}validateScaling(t){if(null==t||""===t||"none"===t||"auto"===t)return void this.errors.remove("WARN_scale");const e=Number(t);isNaN(e)||e<=0?this.errors.addOrReplace({id:"WARN_scale",type:"warning",message:`Invalid scale value: "${t}". Use "none", "auto", or a positive number.`}):this.errors.remove("WARN_scale")}componentWillLoad(){this.validateValue(this.value),this.validateScaling(this.scale)}prepareStyle(){return this.componentStyle((t=>{var e,n,o,s,i,l,a,r,d,u,c,f,v,h,p,m,b,g,y,w,$,N;return{fontStyles:{font:`${null!==(s=null!==(n=null===(e=t["bn-text"])||void 0===e?void 0:e.fontSizePx)&&void 0!==n?n:null===(o=t.global)||void 0===o?void 0:o.fontSizePx)&&void 0!==s?s:13.3333}px ${null!==(r=null!==(l=null===(i=t["bn-text"])||void 0===i?void 0:i.fontFamily)&&void 0!==l?l:null===(a=t.global)||void 0===a?void 0:a.fontFamily)&&void 0!==r?r:"'Noto Sans', sans-serif"}`,size:null!==(f=null!==(u=null===(d=t["bn-text"])||void 0===d?void 0:d.fontSizePx)&&void 0!==u?u:null===(c=t.global)||void 0===c?void 0:c.fontSizePx)&&void 0!==f?f:13.3333,color:null!==(m=null!==(h=null===(v=t["bn-text"])||void 0===v?void 0:v.fontColor)&&void 0!==h?h:null===(p=t.global)||void 0===p?void 0:p.fontColor)&&void 0!==m?m:"#000000",background:null!==(w=null!==(g=null===(b=t["bn-text"])||void 0===b?void 0:b.fontBackgroundColor)&&void 0!==g?g:null===(y=t.global)||void 0===y?void 0:y.fontBackgroundColor)&&void 0!==w?w:"#ffffff",leading:null!==(N=null===($=t["bn-text"])||void 0===$?void 0:$.leading)&&void 0!==N?N:1.8}}}))}applyScaling(t){const e=this.element,{mode:n,factor:o}=v(this.scale),{width:s,height:i}=f(e),l=e.scrollHeight>e.clientHeight+1?e.clientHeight:i,a=s,r=a>0&&e.scrollWidth>a+1,d=l>0&&e.scrollHeight>l+1,u=r||d;if(a<=0&&l<=0)return;if("none"===n){if(u){const t=[];r&&t.push(`w:${e.scrollWidth}>${Math.round(a)}`),d&&t.push(`h:${e.scrollHeight}>${Math.round(l)}`),this.errors.addOrReplace({id:"WARN_overflow",type:"warning",message:`Content overflows container (${t.join(", ")})`})}else this.errors.remove("WARN_overflow");return}if("factor"===n){if(u){const t=[];r&&t.push(`w:${e.scrollWidth}>${Math.round(a)}`),d&&t.push(`h:${e.scrollHeight}>${Math.round(l)}`),this.errors.addOrReplace({id:"WARN_overflow",type:"warning",message:`Content overflows with factor ${o} (${t.join(", ")})`})}else this.errors.remove("WARN_overflow");return}e.style.setProperty("--bn-font-size",t+"px");const c=e.scrollWidth,h=e.scrollHeight,p=e.clientHeight,m=h>p+1?p:i,b=a<=0||c<=a+1,g=m<=0||h<=m+1;if(b&&g)return void this.errors.remove("AUTO_scale");const y=Math.min(1,!b&&a>0?a/c:1,!g&&m>0?m/h:1);e.style.setProperty("--bn-font-size",t*y+"px"),"empty"===n?this.errors.addOrReplace({id:"AUTO_scale",type:"warning",message:"Auto-scaled font by factor "+y.toFixed(3)}):this.errors.remove("AUTO_scale")}componentDidRender(){var t;const{html:e,unknown:n}=function(t,e,n){const o=[],s=t=>{o.includes(t)||o.push(t)},i=(t,n,o,i,l)=>{const a=$($($(e,null!=n?n:N(o)),Number(i)+""),l);return void 0===a&&s(t),a};return{html:t.replace(g,((t,e,o,l,a,r,d)=>{const u=t.slice(2,-1).trim();try{if(void 0===r){const t=i(u,e,o,l,a);return null==t?"":w(t)}const s=void 0===d?void 0:(t=>{const e={};for(y.lastIndex=0;""!==t.slice(y.lastIndex).trim();){const n=y.exec(t);if(!n)return null;const[,o,s,l,a,r,d,u,c,f]=n;e[null!=o?o:N(s)]=void 0!==l?N(l):void 0!==a?Number(a):i(r,d,u,c,f)}return e})(d);return null===s?t:w(n(N(r),s))}catch(t){return s(u),""}})),unknown:o}}(null!==(t=this.value)&&void 0!==t?t:"",this.data,this.t);n.length>0?this.errors.addOrReplace({id:"WARN_value_path",type:"warning",message:"Unknown template path: "+n.join(", ")}):this.errors.remove("WARN_value_path"),this.container.innerHTML=h(e),this.applyScaling(this.prepareStyle().fontStyles.size)}render(){const{fontStyles:t}=this.prepareStyle(),{mode:e,factor:n}=v(this.scale),i="factor"===e?t.size*n+"px":t.size+"px",l={"--bn-font-family":t.font.substring(t.font.indexOf("px ")+3),"--bn-font-size":i,"--bn-font-color":t.color,"--bn-font-background":t.background};return o(s,{key:"47eaf1468ffc8b8de7e77f2b0aff4b927f8b0471",style:l},o("div",{key:"1f592c2fd0a4af77047c56ee043f6bdd84dfb2d2"},o("span",{key:"ecad3e6ea36dfa495ef78183fc6c3979eb9d5be2",class:"container",ref:t=>{this.container=t}})))}get element(){return this}static get watchers(){return{value:[{validateValue:0}],scale:[{validateScaling:0}]}}static get style(){return':host{padding:0.5em;display:inline-block;position:relative;overflow:hidden;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000);background-color:var(--bn-font-background, white)}span.container p{margin:0}'}},[1,"bn-text",{datasets:[513],selectedStyle:[513,"selected-style"],i18nNamespace:[513,"i18n-namespace"],value:[1],scale:[1],data:[32]},void 0,{value:[{validateValue:0}],scale:[{validateScaling:0}]}]),_=A,j=function(){"undefined"!=typeof customElements&&["bn-text"].forEach((t=>{"bn-text"===t&&(customElements.get(i(t))||customElements.define(i(t),A))}))};export{_ as BnText,j as defineCustomElement}
1
+ import{p as t,H as e,f as n,h as o,d as s,t as i}from"./p-BnmylmXF.js";import{w as l}from"./p-CZzlLTQc.js";import{w as a}from"./p-CUoPUIej.js";import{w as r}from"./p-BrQCbmG0.js";import{w as d}from"./p-D_K7tYhY.js";import{w as c}from"./p-JG4Sx1lE.js";import{w as u}from"./p-D32TsLzd.js";import{g as f}from"./p-Dsvjkuy3.js";import{p as v}from"./p-Xb6Ilq8u.js";import{s as h}from"./p-CyUmrWfW.js";const p="[A-Za-z_$\\u00C0-\\uFFFF][\\w$\\u00C0-\\uFFFF]*",m="'[^'\\\\]*'|\"[^\"\\\\]*\"",b=`(?:this\\.)?data(?:\\.(${p})|\\[\\s*(${m})\\s*\\])\\[\\s*(\\d+)\\s*\\]\\.(${p})`,g=RegExp(`\\$\\{\\s*(?:${b}|t\\(\\s*(${m})\\s*(?:,\\s*\\{([^{}]*)\\}\\s*)?\\))\\s*\\}`,"g"),y=RegExp(`\\s*(?:(${p})|(${m}))\\s*:\\s*(?:(${m})|(-?\\d+(?:\\.\\d+)?)|(${b}))\\s*(?:,|$)`,"y"),w=t=>(t+"").replace(/[&<>"'\t\n\f\r ]/g,(t=>`&#${t.charCodeAt(0)};`)),$=(t,e)=>"object"==typeof t&&null!==t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0,N=t=>t.slice(1,-1);const _=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.refit=()=>{n(this)},this.data={},d(this),r(this),this.errors=u(this),this.t=a(this).t,l(this,((t,e)=>{this.data=""===t?{}:Object.assign(Object.assign({},this.data),{[t]:e})})),this.componentStyle=c(this)}connectedCallback(){var t;null===(t=document.fonts)||void 0===t||t.addEventListener("loadingdone",this.refit)}disconnectedCallback(){var t;null===(t=document.fonts)||void 0===t||t.removeEventListener("loadingdone",this.refit)}validateValue(t){"string"!=typeof t||""===t?this.errors.addOrReplace({id:"WARN_value",type:"warning",message:"Empty value"}):this.errors.remove("WARN_value")}validateScaling(t){if(null==t||""===t||"none"===t||"auto"===t)return void this.errors.remove("WARN_scale");const e=Number(t);isNaN(e)||e<=0?this.errors.addOrReplace({id:"WARN_scale",type:"warning",message:`Invalid scale value: "${t}". Use "none", "auto", or a positive number.`}):this.errors.remove("WARN_scale")}componentWillLoad(){this.validateValue(this.value),this.validateScaling(this.scale)}prepareStyle(){return this.componentStyle((t=>{var e,n,o,s,i,l,a,r,d,c,u,f,v,h,p,m,b,g,y,w,$,N;return{fontStyles:{font:`${null!==(s=null!==(n=null===(e=t["bn-text"])||void 0===e?void 0:e.fontSizePx)&&void 0!==n?n:null===(o=t.global)||void 0===o?void 0:o.fontSizePx)&&void 0!==s?s:13.3333}px ${null!==(r=null!==(l=null===(i=t["bn-text"])||void 0===i?void 0:i.fontFamily)&&void 0!==l?l:null===(a=t.global)||void 0===a?void 0:a.fontFamily)&&void 0!==r?r:"'Noto Sans', sans-serif"}`,size:null!==(f=null!==(c=null===(d=t["bn-text"])||void 0===d?void 0:d.fontSizePx)&&void 0!==c?c:null===(u=t.global)||void 0===u?void 0:u.fontSizePx)&&void 0!==f?f:13.3333,color:null!==(m=null!==(h=null===(v=t["bn-text"])||void 0===v?void 0:v.fontColor)&&void 0!==h?h:null===(p=t.global)||void 0===p?void 0:p.fontColor)&&void 0!==m?m:"#000000",background:null!==(w=null!==(g=null===(b=t["bn-text"])||void 0===b?void 0:b.fontBackgroundColor)&&void 0!==g?g:null===(y=t.global)||void 0===y?void 0:y.fontBackgroundColor)&&void 0!==w?w:"#ffffff",leading:null!==(N=null===($=t["bn-text"])||void 0===$?void 0:$.leading)&&void 0!==N?N:1.8}}}))}applyScaling(t){const e=this.element,{mode:n,factor:o}=v(this.scale),{width:s,height:i}=f(e),l=e.scrollHeight>e.clientHeight+1?e.clientHeight:i,a=s,r=a>0&&e.scrollWidth>a+1,d=l>0&&e.scrollHeight>l+1,c=r||d;if(a<=0&&l<=0)return;if("none"===n){if(c){const t=[];r&&t.push(`w:${e.scrollWidth}>${Math.round(a)}`),d&&t.push(`h:${e.scrollHeight}>${Math.round(l)}`),this.errors.addOrReplace({id:"WARN_overflow",type:"warning",message:`Content overflows container (${t.join(", ")})`})}else this.errors.remove("WARN_overflow");return}if("factor"===n){if(c){const t=[];r&&t.push(`w:${e.scrollWidth}>${Math.round(a)}`),d&&t.push(`h:${e.scrollHeight}>${Math.round(l)}`),this.errors.addOrReplace({id:"WARN_overflow",type:"warning",message:`Content overflows with factor ${o} (${t.join(", ")})`})}else this.errors.remove("WARN_overflow");return}e.style.setProperty("--bn-font-size",t+"px");const u=e.scrollWidth,h=e.scrollHeight,p=e.clientHeight,m=h>p+1?p:i,b=a<=0||u<=a+1,g=m<=0||h<=m+1;if(b&&g)return void this.errors.remove("AUTO_scale");const y=Math.min(1,!b&&a>0?a/u:1,!g&&m>0?m/h:1);e.style.setProperty("--bn-font-size",t*y+"px"),"empty"===n?this.errors.addOrReplace({id:"AUTO_scale",type:"warning",message:"Auto-scaled font by factor "+y.toFixed(3)}):this.errors.remove("AUTO_scale")}componentDidRender(){var t;const{html:e,unknown:n}=function(t,e,n){const o=[],s=t=>{o.includes(t)||o.push(t)},i=(t,n,o,i,l)=>{const a=$($($(e,null!=n?n:N(o)),Number(i)+""),l);return void 0===a&&s(t),a};return{html:t.replace(g,((t,e,o,l,a,r,d)=>{const c=t.slice(2,-1).trim();try{if(void 0===r){const t=i(c,e,o,l,a);return null==t?"":w(t)}const s=void 0===d?void 0:(t=>{const e={};for(y.lastIndex=0;""!==t.slice(y.lastIndex).trim();){const n=y.exec(t);if(!n)return null;const[,o,s,l,a,r,d,c,u,f]=n;e[null!=o?o:N(s)]=void 0!==l?N(l):void 0!==a?Number(a):i(r,d,c,u,f)}return e})(d);return null===s?t:w(n(N(r),s))}catch(t){return s(c),""}})),unknown:o}}(null!==(t=this.value)&&void 0!==t?t:"",this.data,this.t);n.length>0?this.errors.addOrReplace({id:"WARN_value_path",type:"warning",message:"Unknown template path: "+n.join(", ")}):this.errors.remove("WARN_value_path"),this.container.innerHTML=h(e),this.applyScaling(this.prepareStyle().fontStyles.size)}render(){const{fontStyles:t}=this.prepareStyle(),{mode:e,factor:n}=v(this.scale),i="factor"===e?t.size*n+"px":t.size+"px",l={"--bn-font-family":t.font.substring(t.font.indexOf("px ")+3),"--bn-font-size":i,"--bn-font-color":t.color,"--bn-font-background":t.background};return o(s,{key:"47eaf1468ffc8b8de7e77f2b0aff4b927f8b0471",style:l},o("div",{key:"1f592c2fd0a4af77047c56ee043f6bdd84dfb2d2"},o("span",{key:"ecad3e6ea36dfa495ef78183fc6c3979eb9d5be2",class:"container",ref:t=>{this.container=t}})))}get element(){return this}static get watchers(){return{value:[{validateValue:0}],scale:[{validateScaling:0}]}}static get style(){return':host{padding:0.5em;display:inline-block;position:relative;overflow:hidden;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000);background-color:var(--bn-font-background, white)}span.container p{margin:0}'}},[1,"bn-text",{datasets:[513],selectedStyle:[513,"selected-style"],i18nNamespace:[513,"i18n-namespace"],value:[1],scale:[1],data:[32]},void 0,{value:[{validateValue:0}],scale:[{validateScaling:0}]}]),j=_,A=function(){"undefined"!=typeof customElements&&["bn-text"].forEach((t=>{"bn-text"===t&&(customElements.get(i(t))||customElements.define(i(t),_))}))};export{j as BnText,A as defineCustomElement}
@@ -1 +1 @@
1
- import{B as o,d as s}from"./p-DROj8gke.js";const p=o,r=s;export{p as BnTitleRenderer,r as defineCustomElement}
1
+ import{B as o,d as s}from"./p-DJSj3oQq.js";const p=o,r=s;export{p as BnTitleRenderer,r as defineCustomElement}
@@ -1 +1 @@
1
- import{T as o,d as s}from"./p-BoBamuPt.js";const t=o,a=s;export{t as BnTitle,a as defineCustomElement}
1
+ import{T as o,d as s}from"./p-BgdoWKFY.js";const p=o,r=s;export{p as BnTitle,r as defineCustomElement}