import { addUniqueItem as r, removeItem as e } from "../../utils/array.es.js";
import { compareByDepth as o } from "./compare-by-depth.es.js";
var n = function() {
  function i() {
    this.children = [], this.isDirty = !1;
  }
  return i.prototype.add = function(t) {
    r(this.children, t), this.isDirty = !0;
  }, i.prototype.remove = function(t) {
    e(this.children, t), this.isDirty = !0;
  }, i.prototype.forEach = function(t) {
    this.isDirty && this.children.sort(o), this.isDirty = !1, this.children.forEach(t);
  }, i;
}();
export {
  n as FlatTree
};
//# sourceMappingURL=flat-tree.es.js.map
