const f = {}, a = (n) => {
  let t;
  const s = /* @__PURE__ */ new Set(), c = (e, u) => {
    const o = typeof e == "function" ? e(t) : e;
    if (!Object.is(o, t)) {
      const b = t;
      t = u ?? (typeof o != "object" || o === null) ? o : Object.assign({}, t, o), s.forEach((d) => d(t, b));
    }
  }, i = () => t, r = { setState: c, getState: i, getInitialState: () => l, subscribe: (e) => (s.add(e), () => s.delete(e)), destroy: () => {
    (f ? "production" : void 0) !== "production" && console.warn(
      "[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."
    ), s.clear();
  } }, l = t = n(c, i, r);
  return r;
}, y = (n) => n ? a(n) : a;
export {
  y as createStore
};
//# sourceMappingURL=vanilla.js.map
