import { Selection } from "./index.js";
function sort_default(t) {
	t ||= ascending;
	function r(e, n) {
		return e && n ? t(e.__data__, n.__data__) : !e - !n;
	}
	for (var i = this._groups, a = i.length, o = Array(a), s = 0; s < a; ++s) {
		for (var c = i[s], l = c.length, u = o[s] = Array(l), d, f = 0; f < l; ++f) (d = c[f]) && (u[f] = d);
		u.sort(r);
	}
	return new Selection(o, this._parents).order();
}
function ascending(e, t) {
	return e < t ? -1 : e > t ? 1 : e >= t ? 0 : NaN;
}
export { sort_default as default };
