function Mixins(...constructors) {
  return (derivedCtor) => {
    constructors.forEach((baseCtor) => {
      Object.getOwnPropertyNames(baseCtor.prototype).forEach((name) => {
        Object.defineProperty(
          derivedCtor.prototype,
          name,
          Object.getOwnPropertyDescriptor(baseCtor.prototype, name) || /* @__PURE__ */ Object.create(null)
        );
      });
      Object.getOwnPropertyNames(baseCtor).forEach((name) => {
        if (name !== "prototype" && name !== "name" && name !== "length") {
          Object.defineProperty(
            derivedCtor,
            name,
            Object.getOwnPropertyDescriptor(baseCtor, name) || /* @__PURE__ */ Object.create(null)
          );
        }
      });
    });
  };
}
const SINGLETON_KEY = Symbol("singleton");
function Singleton(type) {
  return new Proxy(type, {
    construct(target, argsList, newTarget) {
      if (target.prototype !== newTarget.prototype) {
        return Reflect.construct(target, argsList, newTarget);
      }
      if (!target[SINGLETON_KEY]) {
        target[SINGLETON_KEY] = Reflect.construct(target, argsList, newTarget);
      }
      return target[SINGLETON_KEY];
    }
  });
}
export {
  Mixins,
  Singleton
};
