"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function M(i){return i.length}function b(i,f){const n=f||{},d=(n.align||[]).concat(),y=n.stringLength||M,u=[],p=[],w=[],a=[];let g=0,s=-1;for(;++s<i.length;){const r=[],c=[];let t=-1;for(i[s].length>g&&(g=i[s].length);++t<i[s].length;){const l=C(i[s][t]);if(n.alignDelimiters!==!1){const o=y(l);c[t]=o,(a[t]===void 0||o>a[t])&&(a[t]=o)}r.push(l)}p[s]=r,w[s]=c}let e=-1;if(typeof d=="object"&&"length"in d)for(;++e<g;)u[e]=j(d[e]);else{const r=j(d);for(;++e<g;)u[e]=r}e=-1;const z=[],D=[];for(;++e<g;){const r=u[e];let c="",t="";r===99?(c=":",t=":"):r===108?c=":":r===114&&(t=":");let l=n.alignDelimiters===!1?1:Math.max(1,a[e]-c.length-t.length);const o=c+"-".repeat(l)+t;n.alignDelimiters!==!1&&(l=c.length+l+t.length,l>a[e]&&(a[e]=l),D[e]=l),z[e]=o}p.splice(1,0,z),w.splice(1,0,D),s=-1;const x=[];for(;++s<p.length;){const r=p[s],c=w[s];e=-1;const t=[];for(;++e<g;){const l=r[e]||"";let o="",m="";if(n.alignDelimiters!==!1){const h=a[e]-(c[e]||0),S=u[e];S===114?o=" ".repeat(h):S===99?h%2?(o=" ".repeat(h/2+.5),m=" ".repeat(h/2-.5)):(o=" ".repeat(h/2),m=o):m=" ".repeat(h)}n.delimiterStart!==!1&&!e&&t.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&l==="")&&(n.delimiterStart!==!1||e)&&t.push(" "),n.alignDelimiters!==!1&&t.push(o),t.push(l),n.alignDelimiters!==!1&&t.push(m),n.padding!==!1&&t.push(" "),(n.delimiterEnd!==!1||e!==g-1)&&t.push("|")}x.push(n.delimiterEnd===!1?t.join("").replace(/ +$/,""):t.join(""))}return x.join(`
`)}function C(i){return i==null?"":String(i)}function j(i){const f=typeof i=="string"?i.codePointAt(0):0;return f===67||f===99?99:f===76||f===108?108:f===82||f===114?114:0}exports.markdownTable=b;
//# sourceMappingURL=index.cjs.js.map
