import { __require as c } from "./document.js";
import { __require as p } from "./lazy-result.js";
import { __require as f } from "./no-work-result.js";
import { __require as h } from "./root.js";
var o, i;
function P() {
  if (i) return o;
  i = 1;
  let n = c(), u = p(), l = f(), a = h();
  class t {
    constructor(s = []) {
      this.version = "8.5.3", this.plugins = this.normalize(s);
    }
    normalize(s) {
      let r = [];
      for (let e of s)
        if (e.postcss === !0 ? e = e() : e.postcss && (e = e.postcss), typeof e == "object" && Array.isArray(e.plugins))
          r = r.concat(e.plugins);
        else if (typeof e == "object" && e.postcssPlugin)
          r.push(e);
        else if (typeof e == "function")
          r.push(e);
        else if (typeof e == "object" && (e.parse || e.stringify)) {
          if (process.env.NODE_ENV !== "production")
            throw new Error(
              "PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation."
            );
        } else
          throw new Error(e + " is not a PostCSS plugin");
      return r;
    }
    process(s, r = {}) {
      return !this.plugins.length && !r.parser && !r.stringifier && !r.syntax ? new l(this, s, r) : new u(this, s, r);
    }
    use(s) {
      return this.plugins = this.plugins.concat(this.normalize([s])), this;
    }
  }
  return o = t, t.default = t, a.registerProcessor(t), n.registerProcessor(t), o;
}
export {
  P as __require
};
//# sourceMappingURL=processor.js.map
