import { __exports as o$1 } from "../../../_virtual/collection.mjs";
function o(t, n, d, f) {
  var s = d.inverse;
  return Object.defineProperty(t, "remove", {
    value: function(e) {
      var r = this.indexOf(e);
      return r !== -1 && (this.splice(r, 1), n.unset(e, s, f)), e;
    }
  }), Object.defineProperty(t, "contains", {
    value: function(e) {
      return this.indexOf(e) !== -1;
    }
  }), Object.defineProperty(t, "add", {
    value: function(e, r) {
      var i = this.indexOf(e);
      if (typeof r > "u") {
        if (i !== -1)
          return;
        r = this.length;
      }
      i !== -1 && this.splice(i, 1), this.splice(r, 0, e), i === -1 && n.set(e, s, f);
    }
  }), Object.defineProperty(t, "__refs_collection", {
    value: true
  }), t;
}
function c(t) {
  return t.__refs_collection === true;
}
o$1.extend = o;
o$1.isExtended = c;
export {
  o$1 as default
};
