var E = Object.defineProperty;
var r = (l, t) => E(l, "name", { value: t, configurable: !0 });

// src/storybook-error.ts
var n = class n extends Error {
  /**
   * Data associated with the error. Used to provide additional information in the error message or to be passed to telemetry.
   */
  data = {};
  /**
   * Specifies the documentation for the error.
   * - If `true`, links to a documentation page on the Storybook website (make sure it exists before enabling).
   * - If a string, uses the provided URL for documentation (external or FAQ links).
   * - If `false` (default), no documentation link is added.
   */
  documentation = !1;
  /**
   * Flag used to easily determine if the error originates from Storybook.
   */
  fromStorybook = !0;
  get fullErrorCode() {
    let t = String(this.code).padStart(4, "0");
    return `SB_${this.category}_${t}`;
  }
  /**
   * Overrides the default `Error.name` property in the format: SB_<CATEGORY>_<CODE>.
   */
  get name() {
    let t = this.constructor.name;
    return `${this.fullErrorCode} (${t})`;
  }
  /**
   * Generates the error message along with additional documentation link (if applicable).
   */
  get message() {
    let t;
    return this.documentation === !0 ? t = `https://storybook.js.org/error/${this.fullErrorCode}` : typeof this.documentation == "string" ? t =
    this.documentation : Array.isArray(this.documentation) && (t = `
${this.documentation.map((s) => `	- ${s}`).join(`
`)}`), `${this.template()}${t != null ? `

More info: ${t}
` : ""}`;
  }
};
r(n, "StorybookError");
var o = n;

// src/manager-errors.ts
var d = /* @__PURE__ */ ((e) => (e.MANAGER_UNCAUGHT = "MANAGER_UNCAUGHT", e.MANAGER_UI = "MANAGER_UI", e.MANAGER_API = "MANAGER_API", e.MANAGER_CLIENT_LOGGER =
"MANAGER_CLIENT-LOGGER", e.MANAGER_CHANNELS = "MANAGER_CHANNELS", e.MANAGER_CORE_EVENTS = "MANAGER_CORE-EVENTS", e.MANAGER_ROUTER = "MANAGER\
_ROUTER", e.MANAGER_THEMING = "MANAGER_THEMING", e))(d || {}), A = class A extends o {
  category = "MANAGER_UI";
  code = 1;
  template() {
    return "The Provider passed into Storybook's UI is not extended from the base Provider. Please check your Provider implementation.";
  }
};
r(A, "ProviderDoesNotExtendBaseProviderError");
var i = A, a = class a extends o {
  constructor(s) {
    super(s.error.message);
    this.data = s;
    this.stack = s.error.stack;
  }
  category = "MANAGER_UNCAUGHT";
  code = 1;
  template() {
    return this.message;
  }
};
r(a, "UncaughtManagerError");
var c = a;
export {
  d as Category,
  i as ProviderDoesNotExtendBaseProviderError,
  c as UncaughtManagerError
};
