import{__exports as e}from"../../../../_virtual/alignString.mjs";import{__require as r}from"../../../string-width/index.mjs";import{__require as t}from"./utils.mjs";var n;function i(){if(n)return e;n=1;var i=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.alignString=void 0;const a=i(r()),u=t(),o=(e,r)=>e+" ".repeat(r);return e.alignString=(e,r,t)=>{const n=(0,a.default)(e);if(n===r)return e;if(n>r)throw new Error("Subject parameter value width cannot be greater than the container width.");if(0===n)return" ".repeat(r);const i=r-n;return"left"===t?o(e,i):"right"===t?((e,r)=>" ".repeat(r)+e)(e,i):"justify"===t?((e,r)=>{const t=(0,u.countSpaceSequence)(e);if(0===t)return o(e,r);const n=(0,u.distributeUnevenly)(r,t);if(Math.max(...n)>3)return o(e,r);let i=0;return e.replace(/\s+/g,e=>e+" ".repeat(n[i++]))})(e,i):((e,r)=>" ".repeat(Math.floor(r/2))+e+" ".repeat(Math.ceil(r/2)))(e,i)},e}export{i as __require};