import CJS_COMPAT_NODE_URL_fkaa0x0zihe from 'node:url';
import CJS_COMPAT_NODE_PATH_fkaa0x0zihe from 'node:path';
import CJS_COMPAT_NODE_MODULE_fkaa0x0zihe from "node:module";

var __filename = CJS_COMPAT_NODE_URL_fkaa0x0zihe.fileURLToPath(import.meta.url);
var __dirname = CJS_COMPAT_NODE_PATH_fkaa0x0zihe.dirname(__filename);
var require = CJS_COMPAT_NODE_MODULE_fkaa0x0zihe.createRequire(import.meta.url);

// ------------------------------------------------------------
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
// ------------------------------------------------------------
import {
  rewriteSbMockImportCalls
} from "../../../../_node-chunks/chunk-S3OHEWCH.js";
import "../../../../_node-chunks/chunk-QUBI53SI.js";
import "../../../../_node-chunks/chunk-4ILNNMLG.js";

// src/core-server/presets/webpack/loaders/storybook-mock-transform-loader.ts
import { logger } from "storybook/internal/node-logger";
var storybookMockTransformLoader = function(source, sourceMap, meta) {
  let callback = this.async();
  try {
    let result = rewriteSbMockImportCalls(source);
    callback(null, result.code, result.map || void 0, meta);
  } catch (error) {
    let filePath = this.resourcePath;
    logger.debug(`Could not transform sb.mock(import(...)) calls in ${filePath}: ${error}`), callback(null, source, sourceMap, meta);
  }
}, storybook_mock_transform_loader_default = storybookMockTransformLoader;
export {
  storybook_mock_transform_loader_default as default
};
