"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const index = require("./src-selection-index.cjs");
const matcher = require("./src-matcher.cjs");
function selection_filter(match) {
  if (typeof match !== "function") match = matcher.default(match);
  for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {
    for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) {
      if ((node = group[i]) && match.call(node, node.__data__, i, group)) {
        subgroup.push(node);
      }
    }
  }
  return new index.Selection(subgroups, this._parents);
}
exports.default = selection_filter;
//# sourceMappingURL=src-selection-filter.cjs.map
