"use strict";
var c = Object.defineProperty;
var p = Object.getOwnPropertyDescriptor;
var k = Object.getOwnPropertyNames;
var l = Object.prototype.hasOwnProperty;
var s = (n, t) => c(n, "name", { value: t, configurable: !0 });
var A = (n, t) => {
  for (var i in t)
    c(n, i, { get: t[i], enumerable: !0 });
}, b = (n, t, i, o) => {
  if (t && typeof t == "object" || typeof t == "function")
    for (let e of k(t))
      !l.call(n, e) && e !== i && c(n, e, { get: () => t[e], enumerable: !(o = p(t, e)) || o.enumerable });
  return n;
};
var d = (n) => b(c({}, "__esModule", { value: !0 }), n);

// src/test/preview.ts
var E = {};
A(E, {
  default: () => g,
  traverseArgs: () => f
});
module.exports = d(E);
var m = require("storybook/internal/instrumenter"), a = require("storybook/preview-api"), r = require("storybook/test");
var u = /* @__PURE__ */ s(({ parameters: n }) => {
  n?.test?.mockReset === !0 ? (0, r.resetAllMocks)() : n?.test?.clearMocks === !0 ? (0, r.clearAllMocks)() : n?.test?.restoreMocks !== !1 &&
  (0, r.restoreAllMocks)();
}, "resetAllMocksLoader"), f = /* @__PURE__ */ s((n, t = 0, i) => {
  if (t > 5 || n == null)
    return n;
  if ((0, r.isMockFunction)(n))
    return i && n.mockName(i), n;
  if (typeof n == "function" && "isAction" in n && n.isAction && !("implicit" in n && n.implicit)) {
    let o = (0, r.fn)(n);
    return i && o.mockName(i), o;
  }
  if (Array.isArray(n))
    return t++, n.map((o) => f(o, t));
  if (typeof n == "object" && n.constructor === Object) {
    t++;
    for (let [o, e] of Object.entries(n))
      Object.getOwnPropertyDescriptor(n, o)?.writable && (n[o] = f(e, t, o));
    return n;
  }
  return n;
}, "traverseArgs"), w = /* @__PURE__ */ s(({ initialArgs: n }) => {
  f(n);
}, "nameSpiesAndWrapActionsInSpies"), M = /* @__PURE__ */ s(async (n) => {
  globalThis.HTMLElement && n.canvasElement instanceof globalThis.HTMLElement && (n.canvas = (0, r.within)(n.canvasElement)), globalThis.window?.
  navigator?.clipboard && (n.userEvent = (0, m.instrument)(
    { userEvent: r.uninstrumentedUserEvent.setup() },
    { intercept: !0 }
  ).userEvent);
}, "enhanceContext"), g = /* @__PURE__ */ s(() => (0, a.definePreview)({
  loaders: [u, w, M]
}), "default");
