import{__exports as o}from"../../../../_virtual/validateSpanningCellConfig.mjs";import{__require as n}from"./utils.mjs";var e;function r(){if(e)return o;e=1,Object.defineProperty(o,"__esModule",{value:!0}),o.validateSpanningCellConfig=void 0;const r=n(),i=(o,n,e)=>o<=e&&e<=n;return o.validateSpanningCellConfig=(o,n)=>{const[e,t]=[o.length,o[0].length];n.forEach((o,n)=>{const{colSpan:e,rowSpan:r}=o;if(void 0===e&&void 0===r)throw new Error(`Expect at least colSpan or rowSpan is provided in config.spanningCells[${n}]`);if(void 0!==e&&e<1)throw new Error(`Expect colSpan is not equal zero, instead got: ${e} in config.spanningCells[${n}]`);if(void 0!==r&&r<1)throw new Error(`Expect rowSpan is not equal zero, instead got: ${r} in config.spanningCells[${n}]`)});const a=n.map(r.calculateRangeCoordinate);a.forEach(({topLeft:o,bottomRight:n},r)=>{if(!(i(0,t-1,o.col)&&i(0,e-1,o.row)&&i(0,t-1,n.col)&&i(0,e-1,n.row)))throw new Error(`Some cells in config.spanningCells[${r}] are out of the table`)});const l=Array.from({length:e},()=>Array.from({length:t}));a.forEach(({topLeft:o,bottomRight:n},e)=>{(0,r.sequence)(o.row,n.row).forEach(i=>{(0,r.sequence)(o.col,n.col).forEach(o=>{if(void 0!==l[i][o])throw new Error(`Spanning cells in config.spanningCells[${l[i][o]}] and config.spanningCells[${e}] are overlap each other`);l[i][o]=e})})})},o}export{r as __require};