import {
  Plugable,
  init_plugin
} from "./chunk-BPDGLDKM.mjs";
import {
  init_utils,
  mergeDeep
} from "./chunk-PXXNUAGA.mjs";
import {
  __esm
} from "./chunk-2CV3WTQN.mjs";

// src/proxy.ts
import debug from "debug";
var log, ProxyDefaultConfig, Proxy;
var init_proxy = __esm({
  "src/proxy.ts"() {
    init_plugin();
    init_utils();
    log = debug("@tomrpc/core/fn");
    ProxyDefaultConfig = {
      proxy: {
        inject: "before",
        //init | load | before | after
        before: []
      }
    };
    Proxy = class extends Plugable {
      constructor(cfg) {
        super(mergeDeep(ProxyDefaultConfig, cfg));
      }
      proxy() {
        return async (ctx, next) => {
          log("proxy default");
          await next();
          log("proxy default end");
        };
      }
    };
  }
});

export {
  Proxy,
  init_proxy
};
