"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var render_with_router_redux_exports = {};
__export(render_with_router_redux_exports, {
  renderWithRouterRedux: () => renderWithRouterRedux
});
module.exports = __toCommonJS(render_with_router_redux_exports);
var import_jsx_runtime = require("react/jsx-runtime");
var import_react = require("@testing-library/react");
var import_react_redux = require("react-redux");
var import_history = require("history");
var import_store = require("../../data/store.js");
var import_history2 = require("../history.js");
var import_app_router = require("../../view/app-router.js");
const renderWithRouterRedux = (ui, {
  route = "/",
  history = (0, import_history.createMemoryHistory)({ initialEntries: [route] }),
  initialState,
  store = (0, import_store.createAppStore)(initialState, import_history2.browserHistory)
} = {}) => ({
  ...(0, import_react.render)(
    /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_redux.Provider, { store, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_app_router.AppRouter, { history, children: ui }) })
  ),
  // adding `store` to the returned utilities to allow us
  // to reference it in our tests (just try to avoid using
  // this to test implementation details).
  store
});
