//#region ../../node_modules/d3-format/src/formatSpecifier.js
var e = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;
function t(t) {
	if (!(r = e.exec(t))) throw Error("invalid format: " + t);
	var r;
	return new n({
		fill: r[1],
		align: r[2],
		sign: r[3],
		symbol: r[4],
		zero: r[5],
		width: r[6],
		comma: r[7],
		precision: r[8] && r[8].slice(1),
		trim: r[9],
		type: r[10]
	});
}
t.prototype = n.prototype;
function n(e) {
	this.fill = e.fill === void 0 ? " " : e.fill + "", this.align = e.align === void 0 ? ">" : e.align + "", this.sign = e.sign === void 0 ? "-" : e.sign + "", this.symbol = e.symbol === void 0 ? "" : e.symbol + "", this.zero = !!e.zero, this.width = e.width === void 0 ? void 0 : +e.width, this.comma = !!e.comma, this.precision = e.precision === void 0 ? void 0 : +e.precision, this.trim = !!e.trim, this.type = e.type === void 0 ? "" : e.type + "";
}
n.prototype.toString = function() {
	return this.fill + this.align + this.sign + this.symbol + (this.zero ? "0" : "") + (this.width === void 0 ? "" : Math.max(1, this.width | 0)) + (this.comma ? "," : "") + (this.precision === void 0 ? "" : "." + Math.max(0, this.precision | 0)) + (this.trim ? "~" : "") + this.type;
};
//#endregion
export { n as FormatSpecifier, t as default };
