function i(e) {
  return `Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `;
}
var S = typeof Symbol == "function" && Symbol.observable || "@@observable", _ = S, O = () => Math.random().toString(36).substring(7).split("").join("."), k = {
  INIT: `@@redux/INIT${/* @__PURE__ */ O()}`,
  REPLACE: `@@redux/REPLACE${/* @__PURE__ */ O()}`,
  PROBE_UNKNOWN_ACTION: () => `@@redux/PROBE_UNKNOWN_ACTION${O()}`
}, b = k;
function v(e) {
  if (typeof e != "object" || e === null)
    return !1;
  let t = e;
  for (; Object.getPrototypeOf(t) !== null; )
    t = Object.getPrototypeOf(t);
  return Object.getPrototypeOf(e) === t || Object.getPrototypeOf(e) === null;
}
function $(e) {
  if (e === void 0)
    return "undefined";
  if (e === null)
    return "null";
  const t = typeof e;
  switch (t) {
    case "boolean":
    case "string":
    case "number":
    case "symbol":
    case "function":
      return t;
  }
  if (Array.isArray(e))
    return "array";
  if (V(e))
    return "date";
  if (T(e))
    return "error";
  const r = j(e);
  switch (r) {
    case "Symbol":
    case "Promise":
    case "WeakMap":
    case "WeakSet":
    case "Map":
    case "Set":
      return r;
  }
  return Object.prototype.toString.call(e).slice(8, -1).toLowerCase().replace(/\s/g, "");
}
function j(e) {
  return typeof e.constructor == "function" ? e.constructor.name : null;
}
function T(e) {
  return e instanceof Error || typeof e.message == "string" && e.constructor && typeof e.constructor.stackTraceLimit == "number";
}
function V(e) {
  return e instanceof Date ? !0 : typeof e.toDateString == "function" && typeof e.getDate == "function" && typeof e.setDate == "function";
}
function y(e) {
  let t = typeof e;
  return process.env.NODE_ENV !== "production" && (t = $(e)), t;
}
function A(e, t, r) {
  if (typeof e != "function")
    throw new Error(process.env.NODE_ENV === "production" ? i(2) : `Expected the root reducer to be a function. Instead, received: '${y(e)}'`);
  if (typeof t == "function" && typeof r == "function" || typeof r == "function" && typeof arguments[3] == "function")
    throw new Error(process.env.NODE_ENV === "production" ? i(0) : "It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");
  if (typeof t == "function" && typeof r > "u" && (r = t, t = void 0), typeof r < "u") {
    if (typeof r != "function")
      throw new Error(process.env.NODE_ENV === "production" ? i(1) : `Expected the enhancer to be a function. Instead, received: '${y(r)}'`);
    return r(A)(e, t);
  }
  let a = e, d = t, u = /* @__PURE__ */ new Map(), o = u, s = 0, c = !1;
  function f() {
    o === u && (o = /* @__PURE__ */ new Map(), u.forEach((n, p) => {
      o.set(p, n);
    }));
  }
  function w() {
    if (c)
      throw new Error(process.env.NODE_ENV === "production" ? i(3) : "You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");
    return d;
  }
  function l(n) {
    if (typeof n != "function")
      throw new Error(process.env.NODE_ENV === "production" ? i(4) : `Expected the listener to be a function. Instead, received: '${y(n)}'`);
    if (c)
      throw new Error(process.env.NODE_ENV === "production" ? i(5) : "You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");
    let p = !0;
    f();
    const E = s++;
    return o.set(E, n), function() {
      if (p) {
        if (c)
          throw new Error(process.env.NODE_ENV === "production" ? i(6) : "You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");
        p = !1, f(), o.delete(E), u = null;
      }
    };
  }
  function h(n) {
    if (!v(n))
      throw new Error(process.env.NODE_ENV === "production" ? i(7) : `Actions must be plain objects. Instead, the actual type was: '${y(n)}'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.`);
    if (typeof n.type > "u")
      throw new Error(process.env.NODE_ENV === "production" ? i(8) : 'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');
    if (typeof n.type != "string")
      throw new Error(process.env.NODE_ENV === "production" ? i(17) : `Action "type" property must be a string. Instead, the actual type was: '${y(n.type)}'. Value was: '${n.type}' (stringified)`);
    if (c)
      throw new Error(process.env.NODE_ENV === "production" ? i(9) : "Reducers may not dispatch actions.");
    try {
      c = !0, d = a(d, n);
    } finally {
      c = !1;
    }
    return (u = o).forEach((E) => {
      E();
    }), n;
  }
  function N(n) {
    if (typeof n != "function")
      throw new Error(process.env.NODE_ENV === "production" ? i(10) : `Expected the nextReducer to be a function. Instead, received: '${y(n)}`);
    a = n, h({
      type: b.REPLACE
    });
  }
  function g() {
    const n = l;
    return {
      /**
       * The minimal observable subscription method.
       * @param observer Any object that can be used as an observer.
       * The observer object should have a `next` method.
       * @returns An object with an `unsubscribe` method that can
       * be used to unsubscribe the observable from the store, and prevent further
       * emission of values from the observable.
       */
      subscribe(p) {
        if (typeof p != "object" || p === null)
          throw new Error(process.env.NODE_ENV === "production" ? i(11) : `Expected the observer to be an object. Instead, received: '${y(p)}'`);
        function E() {
          const x = p;
          x.next && x.next(w());
        }
        return E(), {
          unsubscribe: n(E)
        };
      },
      [_]() {
        return this;
      }
    };
  }
  return h({
    type: b.INIT
  }), {
    dispatch: h,
    subscribe: l,
    getState: w,
    replaceReducer: N,
    [_]: g
  };
}
function I(e) {
  typeof console < "u" && typeof console.error == "function" && console.error(e);
  try {
    throw new Error(e);
  } catch {
  }
}
function P(e, t, r, a) {
  const d = Object.keys(t), u = r && r.type === b.INIT ? "preloadedState argument passed to createStore" : "previous state received by the reducer";
  if (d.length === 0)
    return "Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";
  if (!v(e))
    return `The ${u} has unexpected type of "${y(e)}". Expected argument to be an object with the following keys: "${d.join('", "')}"`;
  const o = Object.keys(e).filter((s) => !t.hasOwnProperty(s) && !a[s]);
  if (o.forEach((s) => {
    a[s] = !0;
  }), !(r && r.type === b.REPLACE) && o.length > 0)
    return `Unexpected ${o.length > 1 ? "keys" : "key"} "${o.join('", "')}" found in ${u}. Expected to find one of the known reducer keys instead: "${d.join('", "')}". Unexpected keys will be ignored.`;
}
function R(e) {
  Object.keys(e).forEach((t) => {
    const r = e[t];
    if (typeof r(void 0, {
      type: b.INIT
    }) > "u")
      throw new Error(process.env.NODE_ENV === "production" ? i(12) : `The slice reducer for key "${t}" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);
    if (typeof r(void 0, {
      type: b.PROBE_UNKNOWN_ACTION()
    }) > "u")
      throw new Error(process.env.NODE_ENV === "production" ? i(13) : `The slice reducer for key "${t}" returned undefined when probed with a random type. Don't try to handle '${b.INIT}' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.`);
  });
}
function C(e) {
  const t = Object.keys(e), r = {};
  for (let o = 0; o < t.length; o++) {
    const s = t[o];
    process.env.NODE_ENV !== "production" && typeof e[s] > "u" && I(`No reducer provided for key "${s}"`), typeof e[s] == "function" && (r[s] = e[s]);
  }
  const a = Object.keys(r);
  let d;
  process.env.NODE_ENV !== "production" && (d = {});
  let u;
  try {
    R(r);
  } catch (o) {
    u = o;
  }
  return function(s = {}, c) {
    if (u)
      throw u;
    if (process.env.NODE_ENV !== "production") {
      const l = P(s, r, c, d);
      l && I(l);
    }
    let f = !1;
    const w = {};
    for (let l = 0; l < a.length; l++) {
      const h = a[l], N = r[h], g = s[h], m = N(g, c);
      if (typeof m > "u") {
        const n = c && c.type;
        throw new Error(process.env.NODE_ENV === "production" ? i(14) : `When called with an action of type ${n ? `"${String(n)}"` : "(unknown type)"}, the slice reducer for key "${h}" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.`);
      }
      w[h] = m, f = f || m !== g;
    }
    return f = f || a.length !== Object.keys(s).length, f ? w : s;
  };
}
function M(...e) {
  return e.length === 0 ? (t) => t : e.length === 1 ? e[0] : e.reduce((t, r) => (...a) => t(r(...a)));
}
function K(...e) {
  return (t) => (r, a) => {
    const d = t(r, a);
    let u = () => {
      throw new Error(process.env.NODE_ENV === "production" ? i(15) : "Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.");
    };
    const o = {
      getState: d.getState,
      dispatch: (c, ...f) => u(c, ...f)
    }, s = e.map((c) => c(o));
    return u = M(...s)(d.dispatch), {
      ...d,
      dispatch: u
    };
  };
}
function L(e) {
  return v(e) && "type" in e && typeof e.type == "string";
}
export {
  b as __DO_NOT_USE__ActionTypes,
  K as applyMiddleware,
  C as combineReducers,
  M as compose,
  A as createStore,
  L as isAction,
  v as isPlainObject
};
//# sourceMappingURL=redux.js.map
