Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@flexbase/store-react

Package Overview
Dependencies
Maintainers
4
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@flexbase/store-react - npm Package Compare versions

Comparing version
1.0.0
to
1.0.1
+8
core/use.store.d.ts
import { Setter, Store } from '@flexbase/store';
/**
* A hook that attaches a store to a react state
* Internally it uses `useState` and `useEffect` to create a subscription between the store and react state
* @param store The store to use
* @returns A value and function to update it
*/
export declare const useStore: <T>(store: Store<T>) => [T | undefined, Setter<T>];
import { Setter, Store } from '@flexbase/store';
/**
* A hook that attaches a store to a react state
* Internally it uses `useState` and `useLayoutEffect` to create a subscription between the store and react state
* @param store The store to use
* @returns A value and function to update it
*/
export declare const useStoreLayout: <T>(store: Store<T>) => [T | undefined, Setter<T>];
export { useStore } from './core/use.store';
export { useStoreLayout } from './core/use.store.layout';
import { StorageManager as Or } from "@flexbase/store";
var ne = {}, Dt = {
get exports() {
return ne;
},
set exports(h) {
ne = h;
}
}, p = {};
/**
* @license React
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var Sr;
function Ft() {
if (Sr)
return p;
Sr = 1;
var h = Symbol.for("react.element"), s = Symbol.for("react.portal"), z = Symbol.for("react.fragment"), I = Symbol.for("react.strict_mode"), V = Symbol.for("react.profiler"), D = Symbol.for("react.provider"), F = Symbol.for("react.context"), L = Symbol.for("react.forward_ref"), ae = Symbol.for("react.suspense"), Q = Symbol.for("react.memo"), B = Symbol.for("react.lazy"), H = Symbol.iterator;
function oe(t) {
return t === null || typeof t != "object" ? null : (t = H && t[H] || t["@@iterator"], typeof t == "function" ? t : null);
}
var x = { isMounted: function() {
return !1;
}, enqueueForceUpdate: function() {
}, enqueueReplaceState: function() {
}, enqueueSetState: function() {
} }, q = Object.assign, de = {};
function M(t, u, d) {
this.props = t, this.context = u, this.refs = de, this.updater = d || x;
}
M.prototype.isReactComponent = {}, M.prototype.setState = function(t, u) {
if (typeof t != "object" && typeof t != "function" && t != null)
throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");
this.updater.enqueueSetState(this, t, u, "setState");
}, M.prototype.forceUpdate = function(t) {
this.updater.enqueueForceUpdate(this, t, "forceUpdate");
};
function pe() {
}
pe.prototype = M.prototype;
function J(t, u, d) {
this.props = t, this.context = u, this.refs = de, this.updater = d || x;
}
var X = J.prototype = new pe();
X.constructor = J, q(X, M.prototype), X.isPureReactComponent = !0;
var N = Array.isArray, k = Object.prototype.hasOwnProperty, j = { current: null }, U = { key: !0, ref: !0, __self: !0, __source: !0 };
function K(t, u, d) {
var m, v = {}, _ = null, w = null;
if (u != null)
for (m in u.ref !== void 0 && (w = u.ref), u.key !== void 0 && (_ = "" + u.key), u)
k.call(u, m) && !U.hasOwnProperty(m) && (v[m] = u[m]);
var b = arguments.length - 2;
if (b === 1)
v.children = d;
else if (1 < b) {
for (var E = Array(b), P = 0; P < b; P++)
E[P] = arguments[P + 2];
v.children = E;
}
if (t && t.defaultProps)
for (m in b = t.defaultProps, b)
v[m] === void 0 && (v[m] = b[m]);
return { $$typeof: h, type: t, key: _, ref: w, props: v, _owner: j.current };
}
function ve(t, u) {
return { $$typeof: h, type: t.type, key: u, ref: t.ref, props: t.props, _owner: t._owner };
}
function ue(t) {
return typeof t == "object" && t !== null && t.$$typeof === h;
}
function Te(t) {
var u = { "=": "=0", ":": "=2" };
return "$" + t.replace(/[=:]/g, function(d) {
return u[d];
});
}
var ye = /\/+/g;
function ie(t, u) {
return typeof t == "object" && t !== null && t.key != null ? Te("" + t.key) : u.toString(36);
}
function Z(t, u, d, m, v) {
var _ = typeof t;
(_ === "undefined" || _ === "boolean") && (t = null);
var w = !1;
if (t === null)
w = !0;
else
switch (_) {
case "string":
case "number":
w = !0;
break;
case "object":
switch (t.$$typeof) {
case h:
case s:
w = !0;
}
}
if (w)
return w = t, v = v(w), t = m === "" ? "." + ie(w, 0) : m, N(v) ? (d = "", t != null && (d = t.replace(ye, "$&/") + "/"), Z(v, u, d, "", function(P) {
return P;
})) : v != null && (ue(v) && (v = ve(v, d + (!v.key || w && w.key === v.key ? "" : ("" + v.key).replace(ye, "$&/") + "/") + t)), u.push(v)), 1;
if (w = 0, m = m === "" ? "." : m + ":", N(t))
for (var b = 0; b < t.length; b++) {
_ = t[b];
var E = m + ie(_, b);
w += Z(_, u, d, E, v);
}
else if (E = oe(t), typeof E == "function")
for (t = E.call(t), b = 0; !(_ = t.next()).done; )
_ = _.value, E = m + ie(_, b++), w += Z(_, u, d, E, v);
else if (_ === "object")
throw u = String(t), Error("Objects are not valid as a React child (found: " + (u === "[object Object]" ? "object with keys {" + Object.keys(t).join(", ") + "}" : u) + "). If you meant to render a collection of children, use an array instead.");
return w;
}
function $(t, u, d) {
if (t == null)
return t;
var m = [], v = 0;
return Z(t, m, "", "", function(_) {
return u.call(d, _, v++);
}), m;
}
function W(t) {
if (t._status === -1) {
var u = t._result;
u = u(), u.then(function(d) {
(t._status === 0 || t._status === -1) && (t._status = 1, t._result = d);
}, function(d) {
(t._status === 0 || t._status === -1) && (t._status = 2, t._result = d);
}), t._status === -1 && (t._status = 0, t._result = u);
}
if (t._status === 1)
return t._result.default;
throw t._result;
}
var f = { current: null }, G = { transition: null }, he = { ReactCurrentDispatcher: f, ReactCurrentBatchConfig: G, ReactCurrentOwner: j };
return p.Children = { map: $, forEach: function(t, u, d) {
$(t, function() {
u.apply(this, arguments);
}, d);
}, count: function(t) {
var u = 0;
return $(t, function() {
u++;
}), u;
}, toArray: function(t) {
return $(t, function(u) {
return u;
}) || [];
}, only: function(t) {
if (!ue(t))
throw Error("React.Children.only expected to receive a single React element child.");
return t;
} }, p.Component = M, p.Fragment = z, p.Profiler = V, p.PureComponent = J, p.StrictMode = I, p.Suspense = ae, p.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = he, p.cloneElement = function(t, u, d) {
if (t == null)
throw Error("React.cloneElement(...): The argument must be a React element, but you passed " + t + ".");
var m = q({}, t.props), v = t.key, _ = t.ref, w = t._owner;
if (u != null) {
if (u.ref !== void 0 && (_ = u.ref, w = j.current), u.key !== void 0 && (v = "" + u.key), t.type && t.type.defaultProps)
var b = t.type.defaultProps;
for (E in u)
k.call(u, E) && !U.hasOwnProperty(E) && (m[E] = u[E] === void 0 && b !== void 0 ? b[E] : u[E]);
}
var E = arguments.length - 2;
if (E === 1)
m.children = d;
else if (1 < E) {
b = Array(E);
for (var P = 0; P < E; P++)
b[P] = arguments[P + 2];
m.children = b;
}
return { $$typeof: h, type: t.type, key: v, ref: _, props: m, _owner: w };
}, p.createContext = function(t) {
return t = { $$typeof: F, _currentValue: t, _currentValue2: t, _threadCount: 0, Provider: null, Consumer: null, _defaultValue: null, _globalName: null }, t.Provider = { $$typeof: D, _context: t }, t.Consumer = t;
}, p.createElement = K, p.createFactory = function(t) {
var u = K.bind(null, t);
return u.type = t, u;
}, p.createRef = function() {
return { current: null };
}, p.forwardRef = function(t) {
return { $$typeof: L, render: t };
}, p.isValidElement = ue, p.lazy = function(t) {
return { $$typeof: B, _payload: { _status: -1, _result: t }, _init: W };
}, p.memo = function(t, u) {
return { $$typeof: Q, type: t, compare: u === void 0 ? null : u };
}, p.startTransition = function(t) {
var u = G.transition;
G.transition = {};
try {
t();
} finally {
G.transition = u;
}
}, p.unstable_act = function() {
throw Error("act(...) is not supported in production builds of React.");
}, p.useCallback = function(t, u) {
return f.current.useCallback(t, u);
}, p.useContext = function(t) {
return f.current.useContext(t);
}, p.useDebugValue = function() {
}, p.useDeferredValue = function(t) {
return f.current.useDeferredValue(t);
}, p.useEffect = function(t, u) {
return f.current.useEffect(t, u);
}, p.useId = function() {
return f.current.useId();
}, p.useImperativeHandle = function(t, u, d) {
return f.current.useImperativeHandle(t, u, d);
}, p.useInsertionEffect = function(t, u) {
return f.current.useInsertionEffect(t, u);
}, p.useLayoutEffect = function(t, u) {
return f.current.useLayoutEffect(t, u);
}, p.useMemo = function(t, u) {
return f.current.useMemo(t, u);
}, p.useReducer = function(t, u, d) {
return f.current.useReducer(t, u, d);
}, p.useRef = function(t) {
return f.current.useRef(t);
}, p.useState = function(t) {
return f.current.useState(t);
}, p.useSyncExternalStore = function(t, u, d) {
return f.current.useSyncExternalStore(t, u, d);
}, p.useTransition = function() {
return f.current.useTransition();
}, p.version = "18.2.0", p;
}
var le = {}, Lt = {
get exports() {
return le;
},
set exports(h) {
le = h;
}
};
/**
* @license React
* react.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var wr;
function xt() {
return wr || (wr = 1, function(h, s) {
process.env.NODE_ENV !== "production" && function() {
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
var z = "18.2.0", I = Symbol.for("react.element"), V = Symbol.for("react.portal"), D = Symbol.for("react.fragment"), F = Symbol.for("react.strict_mode"), L = Symbol.for("react.profiler"), ae = Symbol.for("react.provider"), Q = Symbol.for("react.context"), B = Symbol.for("react.forward_ref"), H = Symbol.for("react.suspense"), oe = Symbol.for("react.suspense_list"), x = Symbol.for("react.memo"), q = Symbol.for("react.lazy"), de = Symbol.for("react.offscreen"), M = Symbol.iterator, pe = "@@iterator";
function J(e) {
if (e === null || typeof e != "object")
return null;
var r = M && e[M] || e[pe];
return typeof r == "function" ? r : null;
}
var X = {
/**
* @internal
* @type {ReactComponent}
*/
current: null
}, N = {
transition: null
}, k = {
current: null,
// Used to reproduce behavior of `batchedUpdates` in legacy mode.
isBatchingLegacy: !1,
didScheduleLegacyUpdate: !1
}, j = {
/**
* @internal
* @type {ReactComponent}
*/
current: null
}, U = {}, K = null;
function ve(e) {
K = e;
}
U.setExtraStackFrame = function(e) {
K = e;
}, U.getCurrentStack = null, U.getStackAddendum = function() {
var e = "";
K && (e += K);
var r = U.getCurrentStack;
return r && (e += r() || ""), e;
};
var ue = !1, Te = !1, ye = !1, ie = !1, Z = !1, $ = {
ReactCurrentDispatcher: X,
ReactCurrentBatchConfig: N,
ReactCurrentOwner: j
};
$.ReactDebugCurrentFrame = U, $.ReactCurrentActQueue = k;
function W(e) {
{
for (var r = arguments.length, n = new Array(r > 1 ? r - 1 : 0), a = 1; a < r; a++)
n[a - 1] = arguments[a];
G("warn", e, n);
}
}
function f(e) {
{
for (var r = arguments.length, n = new Array(r > 1 ? r - 1 : 0), a = 1; a < r; a++)
n[a - 1] = arguments[a];
G("error", e, n);
}
}
function G(e, r, n) {
{
var a = $.ReactDebugCurrentFrame, o = a.getStackAddendum();
o !== "" && (r += "%s", n = n.concat([o]));
var c = n.map(function(i) {
return String(i);
});
c.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, c);
}
}
var he = {};
function t(e, r) {
{
var n = e.constructor, a = n && (n.displayName || n.name) || "ReactClass", o = a + "." + r;
if (he[o])
return;
f("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.", r, a), he[o] = !0;
}
}
var u = {
/**
* Checks whether or not this composite component is mounted.
* @param {ReactClass} publicInstance The instance we want to test.
* @return {boolean} True if mounted, false otherwise.
* @protected
* @final
*/
isMounted: function(e) {
return !1;
},
/**
* Forces an update. This should only be invoked when it is known with
* certainty that we are **not** in a DOM transaction.
*
* You may want to call this when you know that some deeper aspect of the
* component's state has changed but `setState` was not called.
*
* This will not invoke `shouldComponentUpdate`, but it will invoke
* `componentWillUpdate` and `componentDidUpdate`.
*
* @param {ReactClass} publicInstance The instance that should rerender.
* @param {?function} callback Called after component is updated.
* @param {?string} callerName name of the calling function in the public API.
* @internal
*/
enqueueForceUpdate: function(e, r, n) {
t(e, "forceUpdate");
},
/**
* Replaces all of the state. Always use this or `setState` to mutate state.
* You should treat `this.state` as immutable.
*
* There is no guarantee that `this.state` will be immediately updated, so
* accessing `this.state` after calling this method may return the old value.
*
* @param {ReactClass} publicInstance The instance that should rerender.
* @param {object} completeState Next state.
* @param {?function} callback Called after component is updated.
* @param {?string} callerName name of the calling function in the public API.
* @internal
*/
enqueueReplaceState: function(e, r, n, a) {
t(e, "replaceState");
},
/**
* Sets a subset of the state. This only exists because _pendingState is
* internal. This provides a merging strategy that is not available to deep
* properties which is confusing. TODO: Expose pendingState or don't use it
* during the merge.
*
* @param {ReactClass} publicInstance The instance that should rerender.
* @param {object} partialState Next partial state to be merged with state.
* @param {?function} callback Called after component is updated.
* @param {?string} Name of the calling function in the public API.
* @internal
*/
enqueueSetState: function(e, r, n, a) {
t(e, "setState");
}
}, d = Object.assign, m = {};
Object.freeze(m);
function v(e, r, n) {
this.props = e, this.context = r, this.refs = m, this.updater = n || u;
}
v.prototype.isReactComponent = {}, v.prototype.setState = function(e, r) {
if (typeof e != "object" && typeof e != "function" && e != null)
throw new Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");
this.updater.enqueueSetState(this, e, r, "setState");
}, v.prototype.forceUpdate = function(e) {
this.updater.enqueueForceUpdate(this, e, "forceUpdate");
};
{
var _ = {
isMounted: ["isMounted", "Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],
replaceState: ["replaceState", "Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]
}, w = function(e, r) {
Object.defineProperty(v.prototype, e, {
get: function() {
W("%s(...) is deprecated in plain JavaScript React classes. %s", r[0], r[1]);
}
});
};
for (var b in _)
_.hasOwnProperty(b) && w(b, _[b]);
}
function E() {
}
E.prototype = v.prototype;
function P(e, r, n) {
this.props = e, this.context = r, this.refs = m, this.updater = n || u;
}
var Pe = P.prototype = new E();
Pe.constructor = P, d(Pe, v.prototype), Pe.isPureReactComponent = !0;
function kr() {
var e = {
current: null
};
return Object.seal(e), e;
}
var Tr = Array.isArray;
function me(e) {
return Tr(e);
}
function Pr(e) {
{
var r = typeof Symbol == "function" && Symbol.toStringTag, n = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
return n;
}
}
function Ar(e) {
try {
return We(e), !1;
} catch {
return !0;
}
}
function We(e) {
return "" + e;
}
function ge(e) {
if (Ar(e))
return f("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Pr(e)), We(e);
}
function jr(e, r, n) {
var a = e.displayName;
if (a)
return a;
var o = r.displayName || r.name || "";
return o !== "" ? n + "(" + o + ")" : n;
}
function Ye(e) {
return e.displayName || "Context";
}
function Y(e) {
if (e == null)
return null;
if (typeof e.tag == "number" && f("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
return e.displayName || e.name || null;
if (typeof e == "string")
return e;
switch (e) {
case D:
return "Fragment";
case V:
return "Portal";
case L:
return "Profiler";
case F:
return "StrictMode";
case H:
return "Suspense";
case oe:
return "SuspenseList";
}
if (typeof e == "object")
switch (e.$$typeof) {
case Q:
var r = e;
return Ye(r) + ".Consumer";
case ae:
var n = e;
return Ye(n._context) + ".Provider";
case B:
return jr(e, e.render, "ForwardRef");
case x:
var a = e.displayName || null;
return a !== null ? a : Y(e.type) || "Memo";
case q: {
var o = e, c = o._payload, i = o._init;
try {
return Y(i(c));
} catch {
return null;
}
}
}
return null;
}
var se = Object.prototype.hasOwnProperty, ze = {
key: !0,
ref: !0,
__self: !0,
__source: !0
}, Be, He, Ae;
Ae = {};
function qe(e) {
if (se.call(e, "ref")) {
var r = Object.getOwnPropertyDescriptor(e, "ref").get;
if (r && r.isReactWarning)
return !1;
}
return e.ref !== void 0;
}
function Ke(e) {
if (se.call(e, "key")) {
var r = Object.getOwnPropertyDescriptor(e, "key").get;
if (r && r.isReactWarning)
return !1;
}
return e.key !== void 0;
}
function $r(e, r) {
var n = function() {
Be || (Be = !0, f("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
};
n.isReactWarning = !0, Object.defineProperty(e, "key", {
get: n,
configurable: !0
});
}
function Ir(e, r) {
var n = function() {
He || (He = !0, f("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
};
n.isReactWarning = !0, Object.defineProperty(e, "ref", {
get: n,
configurable: !0
});
}
function Dr(e) {
if (typeof e.ref == "string" && j.current && e.__self && j.current.stateNode !== e.__self) {
var r = Y(j.current.type);
Ae[r] || (f('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', r, e.ref), Ae[r] = !0);
}
}
var je = function(e, r, n, a, o, c, i) {
var l = {
// This tag allows us to uniquely identify this as a React Element
$$typeof: I,
// Built-in properties that belong on the element
type: e,
key: r,
ref: n,
props: i,
// Record the component responsible for creating this element.
_owner: c
};
return l._store = {}, Object.defineProperty(l._store, "validated", {
configurable: !1,
enumerable: !1,
writable: !0,
value: !1
}), Object.defineProperty(l, "_self", {
configurable: !1,
enumerable: !1,
writable: !1,
value: a
}), Object.defineProperty(l, "_source", {
configurable: !1,
enumerable: !1,
writable: !1,
value: o
}), Object.freeze && (Object.freeze(l.props), Object.freeze(l)), l;
};
function Fr(e, r, n) {
var a, o = {}, c = null, i = null, l = null, y = null;
if (r != null) {
qe(r) && (i = r.ref, Dr(r)), Ke(r) && (ge(r.key), c = "" + r.key), l = r.__self === void 0 ? null : r.__self, y = r.__source === void 0 ? null : r.__source;
for (a in r)
se.call(r, a) && !ze.hasOwnProperty(a) && (o[a] = r[a]);
}
var g = arguments.length - 2;
if (g === 1)
o.children = n;
else if (g > 1) {
for (var R = Array(g), C = 0; C < g; C++)
R[C] = arguments[C + 2];
Object.freeze && Object.freeze(R), o.children = R;
}
if (e && e.defaultProps) {
var S = e.defaultProps;
for (a in S)
o[a] === void 0 && (o[a] = S[a]);
}
if (c || i) {
var O = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
c && $r(o, O), i && Ir(o, O);
}
return je(e, c, i, l, y, j.current, o);
}
function Lr(e, r) {
var n = je(e.type, r, e.ref, e._self, e._source, e._owner, e.props);
return n;
}
function xr(e, r, n) {
if (e == null)
throw new Error("React.cloneElement(...): The argument must be a React element, but you passed " + e + ".");
var a, o = d({}, e.props), c = e.key, i = e.ref, l = e._self, y = e._source, g = e._owner;
if (r != null) {
qe(r) && (i = r.ref, g = j.current), Ke(r) && (ge(r.key), c = "" + r.key);
var R;
e.type && e.type.defaultProps && (R = e.type.defaultProps);
for (a in r)
se.call(r, a) && !ze.hasOwnProperty(a) && (r[a] === void 0 && R !== void 0 ? o[a] = R[a] : o[a] = r[a]);
}
var C = arguments.length - 2;
if (C === 1)
o.children = n;
else if (C > 1) {
for (var S = Array(C), O = 0; O < C; O++)
S[O] = arguments[O + 2];
o.children = S;
}
return je(e.type, c, i, l, y, g, o);
}
function ee(e) {
return typeof e == "object" && e !== null && e.$$typeof === I;
}
var Ge = ".", Mr = ":";
function Nr(e) {
var r = /[=:]/g, n = {
"=": "=0",
":": "=2"
}, a = e.replace(r, function(o) {
return n[o];
});
return "$" + a;
}
var Qe = !1, Vr = /\/+/g;
function Je(e) {
return e.replace(Vr, "$&/");
}
function $e(e, r) {
return typeof e == "object" && e !== null && e.key != null ? (ge(e.key), Nr("" + e.key)) : r.toString(36);
}
function _e(e, r, n, a, o) {
var c = typeof e;
(c === "undefined" || c === "boolean") && (e = null);
var i = !1;
if (e === null)
i = !0;
else
switch (c) {
case "string":
case "number":
i = !0;
break;
case "object":
switch (e.$$typeof) {
case I:
case V:
i = !0;
}
}
if (i) {
var l = e, y = o(l), g = a === "" ? Ge + $e(l, 0) : a;
if (me(y)) {
var R = "";
g != null && (R = Je(g) + "/"), _e(y, r, R, "", function(It) {
return It;
});
} else
y != null && (ee(y) && (y.key && (!l || l.key !== y.key) && ge(y.key), y = Lr(
y,
// Keep both the (mapped) and old keys if they differ, just as
// traverseAllChildren used to do for objects as children
n + // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key
(y.key && (!l || l.key !== y.key) ? (
// $FlowFixMe Flow incorrectly thinks existing element's key can be a number
// eslint-disable-next-line react-internal/safe-string-coercion
Je("" + y.key) + "/"
) : "") + g
)), r.push(y));
return 1;
}
var C, S, O = 0, T = a === "" ? Ge : a + Mr;
if (me(e))
for (var ke = 0; ke < e.length; ke++)
C = e[ke], S = T + $e(C, ke), O += _e(C, r, n, S, o);
else {
var Ue = J(e);
if (typeof Ue == "function") {
var Er = e;
Ue === Er.entries && (Qe || W("Using Maps as children is not supported. Use an array of keyed ReactElements instead."), Qe = !0);
for (var jt = Ue.call(Er), Rr, $t = 0; !(Rr = jt.next()).done; )
C = Rr.value, S = T + $e(C, $t++), O += _e(C, r, n, S, o);
} else if (c === "object") {
var Cr = String(e);
throw new Error("Objects are not valid as a React child (found: " + (Cr === "[object Object]" ? "object with keys {" + Object.keys(e).join(", ") + "}" : Cr) + "). If you meant to render a collection of children, use an array instead.");
}
}
return O;
}
function be(e, r, n) {
if (e == null)
return e;
var a = [], o = 0;
return _e(e, a, "", "", function(c) {
return r.call(n, c, o++);
}), a;
}
function Ur(e) {
var r = 0;
return be(e, function() {
r++;
}), r;
}
function Wr(e, r, n) {
be(e, function() {
r.apply(this, arguments);
}, n);
}
function Yr(e) {
return be(e, function(r) {
return r;
}) || [];
}
function zr(e) {
if (!ee(e))
throw new Error("React.Children.only expected to receive a single React element child.");
return e;
}
function Br(e) {
var r = {
$$typeof: Q,
// As a workaround to support multiple concurrent renderers, we categorize
// some renderers as primary and others as secondary. We only expect
// there to be two concurrent renderers at most: React Native (primary) and
// Fabric (secondary); React DOM (primary) and React ART (secondary).
// Secondary renderers store their context values on separate fields.
_currentValue: e,
_currentValue2: e,
// Used to track how many concurrent renderers this context currently
// supports within in a single renderer. Such as parallel server rendering.
_threadCount: 0,
// These are circular
Provider: null,
Consumer: null,
// Add these to use same hidden class in VM as ServerContext
_defaultValue: null,
_globalName: null
};
r.Provider = {
$$typeof: ae,
_context: r
};
var n = !1, a = !1, o = !1;
{
var c = {
$$typeof: Q,
_context: r
};
Object.defineProperties(c, {
Provider: {
get: function() {
return a || (a = !0, f("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?")), r.Provider;
},
set: function(i) {
r.Provider = i;
}
},
_currentValue: {
get: function() {
return r._currentValue;
},
set: function(i) {
r._currentValue = i;
}
},
_currentValue2: {
get: function() {
return r._currentValue2;
},
set: function(i) {
r._currentValue2 = i;
}
},
_threadCount: {
get: function() {
return r._threadCount;
},
set: function(i) {
r._threadCount = i;
}
},
Consumer: {
get: function() {
return n || (n = !0, f("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?")), r.Consumer;
}
},
displayName: {
get: function() {
return r.displayName;
},
set: function(i) {
o || (W("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.", i), o = !0);
}
}
}), r.Consumer = c;
}
return r._currentRenderer = null, r._currentRenderer2 = null, r;
}
var ce = -1, Ie = 0, Xe = 1, Hr = 2;
function qr(e) {
if (e._status === ce) {
var r = e._result, n = r();
if (n.then(function(c) {
if (e._status === Ie || e._status === ce) {
var i = e;
i._status = Xe, i._result = c;
}
}, function(c) {
if (e._status === Ie || e._status === ce) {
var i = e;
i._status = Hr, i._result = c;
}
}), e._status === ce) {
var a = e;
a._status = Ie, a._result = n;
}
}
if (e._status === Xe) {
var o = e._result;
return o === void 0 && f(`lazy: Expected the result of a dynamic import() call. Instead received: %s
Your code should look like:
const MyComponent = lazy(() => import('./MyComponent'))
Did you accidentally put curly braces around the import?`, o), "default" in o || f(`lazy: Expected the result of a dynamic import() call. Instead received: %s
Your code should look like:
const MyComponent = lazy(() => import('./MyComponent'))`, o), o.default;
} else
throw e._result;
}
function Kr(e) {
var r = {
// We use these fields to store the result.
_status: ce,
_result: e
}, n = {
$$typeof: q,
_payload: r,
_init: qr
};
{
var a, o;
Object.defineProperties(n, {
defaultProps: {
configurable: !0,
get: function() {
return a;
},
set: function(c) {
f("React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."), a = c, Object.defineProperty(n, "defaultProps", {
enumerable: !0
});
}
},
propTypes: {
configurable: !0,
get: function() {
return o;
},
set: function(c) {
f("React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."), o = c, Object.defineProperty(n, "propTypes", {
enumerable: !0
});
}
}
});
}
return n;
}
function Gr(e) {
e != null && e.$$typeof === x ? f("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...)).") : typeof e != "function" ? f("forwardRef requires a render function but was given %s.", e === null ? "null" : typeof e) : e.length !== 0 && e.length !== 2 && f("forwardRef render functions accept exactly two parameters: props and ref. %s", e.length === 1 ? "Did you forget to use the ref parameter?" : "Any additional parameter will be undefined."), e != null && (e.defaultProps != null || e.propTypes != null) && f("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?");
var r = {
$$typeof: B,
render: e
};
{
var n;
Object.defineProperty(r, "displayName", {
enumerable: !1,
configurable: !0,
get: function() {
return n;
},
set: function(a) {
n = a, !e.name && !e.displayName && (e.displayName = a);
}
});
}
return r;
}
var Ze;
Ze = Symbol.for("react.module.reference");
function er(e) {
return !!(typeof e == "string" || typeof e == "function" || e === D || e === L || Z || e === F || e === H || e === oe || ie || e === de || ue || Te || ye || typeof e == "object" && e !== null && (e.$$typeof === q || e.$$typeof === x || e.$$typeof === ae || e.$$typeof === Q || e.$$typeof === B || // This needs to include all possible module reference object
// types supported by any Flight configuration anywhere since
// we don't know which Flight build this will end up being used
// with.
e.$$typeof === Ze || e.getModuleId !== void 0));
}
function Qr(e, r) {
er(e) || f("memo: The first argument must be a component. Instead received: %s", e === null ? "null" : typeof e);
var n = {
$$typeof: x,
type: e,
compare: r === void 0 ? null : r
};
{
var a;
Object.defineProperty(n, "displayName", {
enumerable: !1,
configurable: !0,
get: function() {
return a;
},
set: function(o) {
a = o, !e.name && !e.displayName && (e.displayName = o);
}
});
}
return n;
}
function A() {
var e = X.current;
return e === null && f(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.`), e;
}
function Jr(e) {
var r = A();
if (e._context !== void 0) {
var n = e._context;
n.Consumer === e ? f("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?") : n.Provider === e && f("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?");
}
return r.useContext(e);
}
function Xr(e) {
var r = A();
return r.useState(e);
}
function Zr(e, r, n) {
var a = A();
return a.useReducer(e, r, n);
}
function et(e) {
var r = A();
return r.useRef(e);
}
function rt(e, r) {
var n = A();
return n.useEffect(e, r);
}
function tt(e, r) {
var n = A();
return n.useInsertionEffect(e, r);
}
function nt(e, r) {
var n = A();
return n.useLayoutEffect(e, r);
}
function at(e, r) {
var n = A();
return n.useCallback(e, r);
}
function ot(e, r) {
var n = A();
return n.useMemo(e, r);
}
function ut(e, r, n) {
var a = A();
return a.useImperativeHandle(e, r, n);
}
function it(e, r) {
{
var n = A();
return n.useDebugValue(e, r);
}
}
function st() {
var e = A();
return e.useTransition();
}
function ct(e) {
var r = A();
return r.useDeferredValue(e);
}
function ft() {
var e = A();
return e.useId();
}
function lt(e, r, n) {
var a = A();
return a.useSyncExternalStore(e, r, n);
}
var fe = 0, rr, tr, nr, ar, or, ur, ir;
function sr() {
}
sr.__reactDisabledLog = !0;
function dt() {
{
if (fe === 0) {
rr = console.log, tr = console.info, nr = console.warn, ar = console.error, or = console.group, ur = console.groupCollapsed, ir = console.groupEnd;
var e = {
configurable: !0,
enumerable: !0,
value: sr,
writable: !0
};
Object.defineProperties(console, {
info: e,
log: e,
warn: e,
error: e,
group: e,
groupCollapsed: e,
groupEnd: e
});
}
fe++;
}
}
function pt() {
{
if (fe--, fe === 0) {
var e = {
configurable: !0,
enumerable: !0,
writable: !0
};
Object.defineProperties(console, {
log: d({}, e, {
value: rr
}),
info: d({}, e, {
value: tr
}),
warn: d({}, e, {
value: nr
}),
error: d({}, e, {
value: ar
}),
group: d({}, e, {
value: or
}),
groupCollapsed: d({}, e, {
value: ur
}),
groupEnd: d({}, e, {
value: ir
})
});
}
fe < 0 && f("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
}
}
var De = $.ReactCurrentDispatcher, Fe;
function Ee(e, r, n) {
{
if (Fe === void 0)
try {
throw Error();
} catch (o) {
var a = o.stack.trim().match(/\n( *(at )?)/);
Fe = a && a[1] || "";
}
return `
` + Fe + e;
}
}
var Le = !1, Re;
{
var vt = typeof WeakMap == "function" ? WeakMap : Map;
Re = new vt();
}
function cr(e, r) {
if (!e || Le)
return "";
{
var n = Re.get(e);
if (n !== void 0)
return n;
}
var a;
Le = !0;
var o = Error.prepareStackTrace;
Error.prepareStackTrace = void 0;
var c;
c = De.current, De.current = null, dt();
try {
if (r) {
var i = function() {
throw Error();
};
if (Object.defineProperty(i.prototype, "props", {
set: function() {
throw Error();
}
}), typeof Reflect == "object" && Reflect.construct) {
try {
Reflect.construct(i, []);
} catch (T) {
a = T;
}
Reflect.construct(e, [], i);
} else {
try {
i.call();
} catch (T) {
a = T;
}
e.call(i.prototype);
}
} else {
try {
throw Error();
} catch (T) {
a = T;
}
e();
}
} catch (T) {
if (T && a && typeof T.stack == "string") {
for (var l = T.stack.split(`
`), y = a.stack.split(`
`), g = l.length - 1, R = y.length - 1; g >= 1 && R >= 0 && l[g] !== y[R]; )
R--;
for (; g >= 1 && R >= 0; g--, R--)
if (l[g] !== y[R]) {
if (g !== 1 || R !== 1)
do
if (g--, R--, R < 0 || l[g] !== y[R]) {
var C = `
` + l[g].replace(" at new ", " at ");
return e.displayName && C.includes("<anonymous>") && (C = C.replace("<anonymous>", e.displayName)), typeof e == "function" && Re.set(e, C), C;
}
while (g >= 1 && R >= 0);
break;
}
}
} finally {
Le = !1, De.current = c, pt(), Error.prepareStackTrace = o;
}
var S = e ? e.displayName || e.name : "", O = S ? Ee(S) : "";
return typeof e == "function" && Re.set(e, O), O;
}
function yt(e, r, n) {
return cr(e, !1);
}
function ht(e) {
var r = e.prototype;
return !!(r && r.isReactComponent);
}
function Ce(e, r, n) {
if (e == null)
return "";
if (typeof e == "function")
return cr(e, ht(e));
if (typeof e == "string")
return Ee(e);
switch (e) {
case H:
return Ee("Suspense");
case oe:
return Ee("SuspenseList");
}
if (typeof e == "object")
switch (e.$$typeof) {
case B:
return yt(e.render);
case x:
return Ce(e.type, r, n);
case q: {
var a = e, o = a._payload, c = a._init;
try {
return Ce(c(o), r, n);
} catch {
}
}
}
return "";
}
var fr = {}, lr = $.ReactDebugCurrentFrame;
function Se(e) {
if (e) {
var r = e._owner, n = Ce(e.type, e._source, r ? r.type : null);
lr.setExtraStackFrame(n);
} else
lr.setExtraStackFrame(null);
}
function mt(e, r, n, a, o) {
{
var c = Function.call.bind(se);
for (var i in e)
if (c(e, i)) {
var l = void 0;
try {
if (typeof e[i] != "function") {
var y = Error((a || "React class") + ": " + n + " type `" + i + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[i] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
throw y.name = "Invariant Violation", y;
}
l = e[i](r, i, a, n, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
} catch (g) {
l = g;
}
l && !(l instanceof Error) && (Se(o), f("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", a || "React class", n, i, typeof l), Se(null)), l instanceof Error && !(l.message in fr) && (fr[l.message] = !0, Se(o), f("Failed %s type: %s", n, l.message), Se(null));
}
}
}
function re(e) {
if (e) {
var r = e._owner, n = Ce(e.type, e._source, r ? r.type : null);
ve(n);
} else
ve(null);
}
var xe;
xe = !1;
function dr() {
if (j.current) {
var e = Y(j.current.type);
if (e)
return `
Check the render method of \`` + e + "`.";
}
return "";
}
function gt(e) {
if (e !== void 0) {
var r = e.fileName.replace(/^.*[\\\/]/, ""), n = e.lineNumber;
return `
Check your code at ` + r + ":" + n + ".";
}
return "";
}
function _t(e) {
return e != null ? gt(e.__source) : "";
}
var pr = {};
function bt(e) {
var r = dr();
if (!r) {
var n = typeof e == "string" ? e : e.displayName || e.name;
n && (r = `
Check the top-level render call using <` + n + ">.");
}
return r;
}
function vr(e, r) {
if (!(!e._store || e._store.validated || e.key != null)) {
e._store.validated = !0;
var n = bt(r);
if (!pr[n]) {
pr[n] = !0;
var a = "";
e && e._owner && e._owner !== j.current && (a = " It was passed a child from " + Y(e._owner.type) + "."), re(e), f('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', n, a), re(null);
}
}
}
function yr(e, r) {
if (typeof e == "object") {
if (me(e))
for (var n = 0; n < e.length; n++) {
var a = e[n];
ee(a) && vr(a, r);
}
else if (ee(e))
e._store && (e._store.validated = !0);
else if (e) {
var o = J(e);
if (typeof o == "function" && o !== e.entries)
for (var c = o.call(e), i; !(i = c.next()).done; )
ee(i.value) && vr(i.value, r);
}
}
}
function hr(e) {
{
var r = e.type;
if (r == null || typeof r == "string")
return;
var n;
if (typeof r == "function")
n = r.propTypes;
else if (typeof r == "object" && (r.$$typeof === B || // Note: Memo only checks outer props here.
// Inner props are checked in the reconciler.
r.$$typeof === x))
n = r.propTypes;
else
return;
if (n) {
var a = Y(r);
mt(n, e.props, "prop", a, e);
} else if (r.PropTypes !== void 0 && !xe) {
xe = !0;
var o = Y(r);
f("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", o || "Unknown");
}
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && f("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
}
}
function Et(e) {
{
for (var r = Object.keys(e.props), n = 0; n < r.length; n++) {
var a = r[n];
if (a !== "children" && a !== "key") {
re(e), f("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", a), re(null);
break;
}
}
e.ref !== null && (re(e), f("Invalid attribute `ref` supplied to `React.Fragment`."), re(null));
}
}
function mr(e, r, n) {
var a = er(e);
if (!a) {
var o = "";
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (o += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
var c = _t(r);
c ? o += c : o += dr();
var i;
e === null ? i = "null" : me(e) ? i = "array" : e !== void 0 && e.$$typeof === I ? (i = "<" + (Y(e.type) || "Unknown") + " />", o = " Did you accidentally export a JSX literal instead of a component?") : i = typeof e, f("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", i, o);
}
var l = Fr.apply(this, arguments);
if (l == null)
return l;
if (a)
for (var y = 2; y < arguments.length; y++)
yr(arguments[y], e);
return e === D ? Et(l) : hr(l), l;
}
var gr = !1;
function Rt(e) {
var r = mr.bind(null, e);
return r.type = e, gr || (gr = !0, W("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.")), Object.defineProperty(r, "type", {
enumerable: !1,
get: function() {
return W("Factory.type is deprecated. Access the class directly before passing it to createFactory."), Object.defineProperty(this, "type", {
value: e
}), e;
}
}), r;
}
function Ct(e, r, n) {
for (var a = xr.apply(this, arguments), o = 2; o < arguments.length; o++)
yr(arguments[o], a.type);
return hr(a), a;
}
function St(e, r) {
var n = N.transition;
N.transition = {};
var a = N.transition;
N.transition._updatedFibers = /* @__PURE__ */ new Set();
try {
e();
} finally {
if (N.transition = n, n === null && a._updatedFibers) {
var o = a._updatedFibers.size;
o > 10 && W("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."), a._updatedFibers.clear();
}
}
}
var _r = !1, we = null;
function wt(e) {
if (we === null)
try {
var r = ("require" + Math.random()).slice(0, 7), n = h && h[r];
we = n.call(h, "timers").setImmediate;
} catch {
we = function(o) {
_r === !1 && (_r = !0, typeof MessageChannel > "u" && f("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));
var c = new MessageChannel();
c.port1.onmessage = o, c.port2.postMessage(void 0);
};
}
return we(e);
}
var te = 0, br = !1;
function Ot(e) {
{
var r = te;
te++, k.current === null && (k.current = []);
var n = k.isBatchingLegacy, a;
try {
if (k.isBatchingLegacy = !0, a = e(), !n && k.didScheduleLegacyUpdate) {
var o = k.current;
o !== null && (k.didScheduleLegacyUpdate = !1, Ve(o));
}
} catch (S) {
throw Oe(r), S;
} finally {
k.isBatchingLegacy = n;
}
if (a !== null && typeof a == "object" && typeof a.then == "function") {
var c = a, i = !1, l = {
then: function(S, O) {
i = !0, c.then(function(T) {
Oe(r), te === 0 ? Me(T, S, O) : S(T);
}, function(T) {
Oe(r), O(T);
});
}
};
return !br && typeof Promise < "u" && Promise.resolve().then(function() {
}).then(function() {
i || (br = !0, f("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"));
}), l;
} else {
var y = a;
if (Oe(r), te === 0) {
var g = k.current;
g !== null && (Ve(g), k.current = null);
var R = {
then: function(S, O) {
k.current === null ? (k.current = [], Me(y, S, O)) : S(y);
}
};
return R;
} else {
var C = {
then: function(S, O) {
S(y);
}
};
return C;
}
}
}
}
function Oe(e) {
e !== te - 1 && f("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "), te = e;
}
function Me(e, r, n) {
{
var a = k.current;
if (a !== null)
try {
Ve(a), wt(function() {
a.length === 0 ? (k.current = null, r(e)) : Me(e, r, n);
});
} catch (o) {
n(o);
}
else
r(e);
}
}
var Ne = !1;
function Ve(e) {
if (!Ne) {
Ne = !0;
var r = 0;
try {
for (; r < e.length; r++) {
var n = e[r];
do
n = n(!0);
while (n !== null);
}
e.length = 0;
} catch (a) {
throw e = e.slice(r + 1), a;
} finally {
Ne = !1;
}
}
}
var kt = mr, Tt = Ct, Pt = Rt, At = {
map: be,
forEach: Wr,
count: Ur,
toArray: Yr,
only: zr
};
s.Children = At, s.Component = v, s.Fragment = D, s.Profiler = L, s.PureComponent = P, s.StrictMode = F, s.Suspense = H, s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = $, s.cloneElement = Tt, s.createContext = Br, s.createElement = kt, s.createFactory = Pt, s.createRef = kr, s.forwardRef = Gr, s.isValidElement = ee, s.lazy = Kr, s.memo = Qr, s.startTransition = St, s.unstable_act = Ot, s.useCallback = at, s.useContext = Jr, s.useDebugValue = it, s.useDeferredValue = ct, s.useEffect = rt, s.useId = ft, s.useImperativeHandle = ut, s.useInsertionEffect = tt, s.useLayoutEffect = nt, s.useMemo = ot, s.useReducer = Zr, s.useRef = et, s.useState = Xr, s.useSyncExternalStore = lt, s.useTransition = st, s.version = z, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
}();
}(Lt, le)), le;
}
(function(h) {
process.env.NODE_ENV === "production" ? h.exports = Ft() : h.exports = xt();
})(Dt);
const Nt = (h) => {
const s = Or.lookupManager(h);
if (s === void 0)
throw Error(`Unable to find storage manager for ${h.key.toString()}`);
const z = s.getValue(h), [I, V] = ne.useState(z), D = s.getSetter(h);
return ne.useEffect(() => {
const F = s.subscribe(h, (L) => (V(L.value), Promise.resolve()));
return () => F.unsubscribe();
}, [s, h]), [I, D];
}, Vt = (h) => {
const s = Or.lookupManager(h);
if (s === void 0)
throw Error(`Unable to find storage manager for ${h.key.toString()}`);
const z = s.getValue(h), [I, V] = ne.useState(z), D = s.getSetter(h);
return ne.useLayoutEffect(() => {
const F = s.subscribe(h, (L) => (V(L.value), Promise.resolve()));
return () => F.unsubscribe();
}, [s, h]), [I, D];
};
export {
Nt as useStore,
Vt as useStoreLayout
};
(function(V,J){typeof exports=="object"&&typeof module<"u"?J(exports,require("@flexbase/store")):typeof define=="function"&&define.amd?define(["exports","@flexbase/store"],J):(V=typeof globalThis<"u"?globalThis:V||self,J(V["@flexbase/store-react"]={},V.store))})(this,function(V,J){"use strict";var X={},kr={get exports(){return X},set exports(h){X=h}},p={};/**
* @license React
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var ze;function Pr(){if(ze)return p;ze=1;var h=Symbol.for("react.element"),s=Symbol.for("react.portal"),B=Symbol.for("react.fragment"),D=Symbol.for("react.strict_mode"),U=Symbol.for("react.profiler"),$=Symbol.for("react.provider"),F=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),ie=Symbol.for("react.suspense"),Z=Symbol.for("react.memo"),q=Symbol.for("react.lazy"),H=Symbol.iterator;function se(t){return t===null||typeof t!="object"?null:(t=H&&t[H]||t["@@iterator"],typeof t=="function"?t:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},K=Object.assign,ve={};function M(t,u,d){this.props=t,this.context=u,this.refs=ve,this.updater=d||x}M.prototype.isReactComponent={},M.prototype.setState=function(t,u){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,u,"setState")},M.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function ye(){}ye.prototype=M.prototype;function ee(t,u,d){this.props=t,this.context=u,this.refs=ve,this.updater=d||x}var re=ee.prototype=new ye;re.constructor=ee,K(re,M.prototype),re.isPureReactComponent=!0;var N=Array.isArray,T=Object.prototype.hasOwnProperty,A={current:null},W={key:!0,ref:!0,__self:!0,__source:!0};function G(t,u,d){var m,v={},_=null,w=null;if(u!=null)for(m in u.ref!==void 0&&(w=u.ref),u.key!==void 0&&(_=""+u.key),u)T.call(u,m)&&!W.hasOwnProperty(m)&&(v[m]=u[m]);var b=arguments.length-2;if(b===1)v.children=d;else if(1<b){for(var E=Array(b),P=0;P<b;P++)E[P]=arguments[P+2];v.children=E}if(t&&t.defaultProps)for(m in b=t.defaultProps,b)v[m]===void 0&&(v[m]=b[m]);return{$$typeof:h,type:t,key:_,ref:w,props:v,_owner:A.current}}function he(t,u){return{$$typeof:h,type:t.type,key:u,ref:t.ref,props:t.props,_owner:t._owner}}function ce(t){return typeof t=="object"&&t!==null&&t.$$typeof===h}function je(t){var u={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(d){return u[d]})}var me=/\/+/g;function fe(t,u){return typeof t=="object"&&t!==null&&t.key!=null?je(""+t.key):u.toString(36)}function te(t,u,d,m,v){var _=typeof t;(_==="undefined"||_==="boolean")&&(t=null);var w=!1;if(t===null)w=!0;else switch(_){case"string":case"number":w=!0;break;case"object":switch(t.$$typeof){case h:case s:w=!0}}if(w)return w=t,v=v(w),t=m===""?"."+fe(w,0):m,N(v)?(d="",t!=null&&(d=t.replace(me,"$&/")+"/"),te(v,u,d,"",function(P){return P})):v!=null&&(ce(v)&&(v=he(v,d+(!v.key||w&&w.key===v.key?"":(""+v.key).replace(me,"$&/")+"/")+t)),u.push(v)),1;if(w=0,m=m===""?".":m+":",N(t))for(var b=0;b<t.length;b++){_=t[b];var E=m+fe(_,b);w+=te(_,u,d,E,v)}else if(E=se(t),typeof E=="function")for(t=E.call(t),b=0;!(_=t.next()).done;)_=_.value,E=m+fe(_,b++),w+=te(_,u,d,E,v);else if(_==="object")throw u=String(t),Error("Objects are not valid as a React child (found: "+(u==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":u)+"). If you meant to render a collection of children, use an array instead.");return w}function I(t,u,d){if(t==null)return t;var m=[],v=0;return te(t,m,"","",function(_){return u.call(d,_,v++)}),m}function Y(t){if(t._status===-1){var u=t._result;u=u(),u.then(function(d){(t._status===0||t._status===-1)&&(t._status=1,t._result=d)},function(d){(t._status===0||t._status===-1)&&(t._status=2,t._result=d)}),t._status===-1&&(t._status=0,t._result=u)}if(t._status===1)return t._result.default;throw t._result}var f={current:null},Q={transition:null},ge={ReactCurrentDispatcher:f,ReactCurrentBatchConfig:Q,ReactCurrentOwner:A};return p.Children={map:I,forEach:function(t,u,d){I(t,function(){u.apply(this,arguments)},d)},count:function(t){var u=0;return I(t,function(){u++}),u},toArray:function(t){return I(t,function(u){return u})||[]},only:function(t){if(!ce(t))throw Error("React.Children.only expected to receive a single React element child.");return t}},p.Component=M,p.Fragment=B,p.Profiler=U,p.PureComponent=ee,p.StrictMode=D,p.Suspense=ie,p.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ge,p.cloneElement=function(t,u,d){if(t==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var m=K({},t.props),v=t.key,_=t.ref,w=t._owner;if(u!=null){if(u.ref!==void 0&&(_=u.ref,w=A.current),u.key!==void 0&&(v=""+u.key),t.type&&t.type.defaultProps)var b=t.type.defaultProps;for(E in u)T.call(u,E)&&!W.hasOwnProperty(E)&&(m[E]=u[E]===void 0&&b!==void 0?b[E]:u[E])}var E=arguments.length-2;if(E===1)m.children=d;else if(1<E){b=Array(E);for(var P=0;P<E;P++)b[P]=arguments[P+2];m.children=b}return{$$typeof:h,type:t.type,key:v,ref:_,props:m,_owner:w}},p.createContext=function(t){return t={$$typeof:F,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:$,_context:t},t.Consumer=t},p.createElement=G,p.createFactory=function(t){var u=G.bind(null,t);return u.type=t,u},p.createRef=function(){return{current:null}},p.forwardRef=function(t){return{$$typeof:L,render:t}},p.isValidElement=ce,p.lazy=function(t){return{$$typeof:q,_payload:{_status:-1,_result:t},_init:Y}},p.memo=function(t,u){return{$$typeof:Z,type:t,compare:u===void 0?null:u}},p.startTransition=function(t){var u=Q.transition;Q.transition={};try{t()}finally{Q.transition=u}},p.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},p.useCallback=function(t,u){return f.current.useCallback(t,u)},p.useContext=function(t){return f.current.useContext(t)},p.useDebugValue=function(){},p.useDeferredValue=function(t){return f.current.useDeferredValue(t)},p.useEffect=function(t,u){return f.current.useEffect(t,u)},p.useId=function(){return f.current.useId()},p.useImperativeHandle=function(t,u,d){return f.current.useImperativeHandle(t,u,d)},p.useInsertionEffect=function(t,u){return f.current.useInsertionEffect(t,u)},p.useLayoutEffect=function(t,u){return f.current.useLayoutEffect(t,u)},p.useMemo=function(t,u){return f.current.useMemo(t,u)},p.useReducer=function(t,u,d){return f.current.useReducer(t,u,d)},p.useRef=function(t){return f.current.useRef(t)},p.useState=function(t){return f.current.useState(t)},p.useSyncExternalStore=function(t,u,d){return f.current.useSyncExternalStore(t,u,d)},p.useTransition=function(){return f.current.useTransition()},p.version="18.2.0",p}var ue={},jr={get exports(){return ue},set exports(h){ue=h}};/**
* @license React
* react.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Be;function Ar(){return Be||(Be=1,function(h,s){process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var B="18.2.0",D=Symbol.for("react.element"),U=Symbol.for("react.portal"),$=Symbol.for("react.fragment"),F=Symbol.for("react.strict_mode"),L=Symbol.for("react.profiler"),ie=Symbol.for("react.provider"),Z=Symbol.for("react.context"),q=Symbol.for("react.forward_ref"),H=Symbol.for("react.suspense"),se=Symbol.for("react.suspense_list"),x=Symbol.for("react.memo"),K=Symbol.for("react.lazy"),ve=Symbol.for("react.offscreen"),M=Symbol.iterator,ye="@@iterator";function ee(e){if(e===null||typeof e!="object")return null;var r=M&&e[M]||e[ye];return typeof r=="function"?r:null}var re={current:null},N={transition:null},T={current:null,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1},A={current:null},W={},G=null;function he(e){G=e}W.setExtraStackFrame=function(e){G=e},W.getCurrentStack=null,W.getStackAddendum=function(){var e="";G&&(e+=G);var r=W.getCurrentStack;return r&&(e+=r()||""),e};var ce=!1,je=!1,me=!1,fe=!1,te=!1,I={ReactCurrentDispatcher:re,ReactCurrentBatchConfig:N,ReactCurrentOwner:A};I.ReactDebugCurrentFrame=W,I.ReactCurrentActQueue=T;function Y(e){{for(var r=arguments.length,n=new Array(r>1?r-1:0),a=1;a<r;a++)n[a-1]=arguments[a];Q("warn",e,n)}}function f(e){{for(var r=arguments.length,n=new Array(r>1?r-1:0),a=1;a<r;a++)n[a-1]=arguments[a];Q("error",e,n)}}function Q(e,r,n){{var a=I.ReactDebugCurrentFrame,o=a.getStackAddendum();o!==""&&(r+="%s",n=n.concat([o]));var c=n.map(function(i){return String(i)});c.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,c)}}var ge={};function t(e,r){{var n=e.constructor,a=n&&(n.displayName||n.name)||"ReactClass",o=a+"."+r;if(ge[o])return;f("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",r,a),ge[o]=!0}}var u={isMounted:function(e){return!1},enqueueForceUpdate:function(e,r,n){t(e,"forceUpdate")},enqueueReplaceState:function(e,r,n,a){t(e,"replaceState")},enqueueSetState:function(e,r,n,a){t(e,"setState")}},d=Object.assign,m={};Object.freeze(m);function v(e,r,n){this.props=e,this.context=r,this.refs=m,this.updater=n||u}v.prototype.isReactComponent={},v.prototype.setState=function(e,r){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw new Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,r,"setState")},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};{var _={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]},w=function(e,r){Object.defineProperty(v.prototype,e,{get:function(){Y("%s(...) is deprecated in plain JavaScript React classes. %s",r[0],r[1])}})};for(var b in _)_.hasOwnProperty(b)&&w(b,_[b])}function E(){}E.prototype=v.prototype;function P(e,r,n){this.props=e,this.context=r,this.refs=m,this.updater=n||u}var Ae=P.prototype=new E;Ae.constructor=P,d(Ae,v.prototype),Ae.isPureReactComponent=!0;function $r(){var e={current:null};return Object.seal(e),e}var Fr=Array.isArray;function _e(e){return Fr(e)}function Lr(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,n=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return n}}function xr(e){try{return qe(e),!1}catch{return!0}}function qe(e){return""+e}function be(e){if(xr(e))return f("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Lr(e)),qe(e)}function Mr(e,r,n){var a=e.displayName;if(a)return a;var o=r.displayName||r.name||"";return o!==""?n+"("+o+")":n}function He(e){return e.displayName||"Context"}function z(e){if(e==null)return null;if(typeof e.tag=="number"&&f("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case $:return"Fragment";case U:return"Portal";case L:return"Profiler";case F:return"StrictMode";case H:return"Suspense";case se:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Z:var r=e;return He(r)+".Consumer";case ie:var n=e;return He(n._context)+".Provider";case q:return Mr(e,e.render,"ForwardRef");case x:var a=e.displayName||null;return a!==null?a:z(e.type)||"Memo";case K:{var o=e,c=o._payload,i=o._init;try{return z(i(c))}catch{return null}}}return null}var le=Object.prototype.hasOwnProperty,Ke={key:!0,ref:!0,__self:!0,__source:!0},Ge,Qe,Ie;Ie={};function Je(e){if(le.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function Xe(e){if(le.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function Nr(e,r){var n=function(){Ge||(Ge=!0,f("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}function Vr(e,r){var n=function(){Qe||(Qe=!0,f("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};n.isReactWarning=!0,Object.defineProperty(e,"ref",{get:n,configurable:!0})}function Ur(e){if(typeof e.ref=="string"&&A.current&&e.__self&&A.current.stateNode!==e.__self){var r=z(A.current.type);Ie[r]||(f('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',r,e.ref),Ie[r]=!0)}}var De=function(e,r,n,a,o,c,i){var l={$$typeof:D,type:e,key:r,ref:n,props:i,_owner:c};return l._store={},Object.defineProperty(l._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(l,"_self",{configurable:!1,enumerable:!1,writable:!1,value:a}),Object.defineProperty(l,"_source",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.freeze&&(Object.freeze(l.props),Object.freeze(l)),l};function Wr(e,r,n){var a,o={},c=null,i=null,l=null,y=null;if(r!=null){Je(r)&&(i=r.ref,Ur(r)),Xe(r)&&(be(r.key),c=""+r.key),l=r.__self===void 0?null:r.__self,y=r.__source===void 0?null:r.__source;for(a in r)le.call(r,a)&&!Ke.hasOwnProperty(a)&&(o[a]=r[a])}var g=arguments.length-2;if(g===1)o.children=n;else if(g>1){for(var R=Array(g),S=0;S<g;S++)R[S]=arguments[S+2];Object.freeze&&Object.freeze(R),o.children=R}if(e&&e.defaultProps){var C=e.defaultProps;for(a in C)o[a]===void 0&&(o[a]=C[a])}if(c||i){var O=typeof e=="function"?e.displayName||e.name||"Unknown":e;c&&Nr(o,O),i&&Vr(o,O)}return De(e,c,i,l,y,A.current,o)}function Yr(e,r){var n=De(e.type,r,e.ref,e._self,e._source,e._owner,e.props);return n}function zr(e,r,n){if(e==null)throw new Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var a,o=d({},e.props),c=e.key,i=e.ref,l=e._self,y=e._source,g=e._owner;if(r!=null){Je(r)&&(i=r.ref,g=A.current),Xe(r)&&(be(r.key),c=""+r.key);var R;e.type&&e.type.defaultProps&&(R=e.type.defaultProps);for(a in r)le.call(r,a)&&!Ke.hasOwnProperty(a)&&(r[a]===void 0&&R!==void 0?o[a]=R[a]:o[a]=r[a])}var S=arguments.length-2;if(S===1)o.children=n;else if(S>1){for(var C=Array(S),O=0;O<S;O++)C[O]=arguments[O+2];o.children=C}return De(e.type,c,i,l,y,g,o)}function ne(e){return typeof e=="object"&&e!==null&&e.$$typeof===D}var Ze=".",Br=":";function qr(e){var r=/[=:]/g,n={"=":"=0",":":"=2"},a=e.replace(r,function(o){return n[o]});return"$"+a}var er=!1,Hr=/\/+/g;function rr(e){return e.replace(Hr,"$&/")}function $e(e,r){return typeof e=="object"&&e!==null&&e.key!=null?(be(e.key),qr(""+e.key)):r.toString(36)}function Ee(e,r,n,a,o){var c=typeof e;(c==="undefined"||c==="boolean")&&(e=null);var i=!1;if(e===null)i=!0;else switch(c){case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case D:case U:i=!0}}if(i){var l=e,y=o(l),g=a===""?Ze+$e(l,0):a;if(_e(y)){var R="";g!=null&&(R=rr(g)+"/"),Ee(y,r,R,"",function(Vt){return Vt})}else y!=null&&(ne(y)&&(y.key&&(!l||l.key!==y.key)&&be(y.key),y=Yr(y,n+(y.key&&(!l||l.key!==y.key)?rr(""+y.key)+"/":"")+g)),r.push(y));return 1}var S,C,O=0,k=a===""?Ze:a+Br;if(_e(e))for(var Pe=0;Pe<e.length;Pe++)S=e[Pe],C=k+$e(S,Pe),O+=Ee(S,r,n,C,o);else{var Ye=ee(e);if(typeof Ye=="function"){var wr=e;Ye===wr.entries&&(er||Y("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),er=!0);for(var Mt=Ye.call(wr),Or,Nt=0;!(Or=Mt.next()).done;)S=Or.value,C=k+$e(S,Nt++),O+=Ee(S,r,n,C,o)}else if(c==="object"){var Tr=String(e);throw new Error("Objects are not valid as a React child (found: "+(Tr==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":Tr)+"). If you meant to render a collection of children, use an array instead.")}}return O}function Re(e,r,n){if(e==null)return e;var a=[],o=0;return Ee(e,a,"","",function(c){return r.call(n,c,o++)}),a}function Kr(e){var r=0;return Re(e,function(){r++}),r}function Gr(e,r,n){Re(e,function(){r.apply(this,arguments)},n)}function Qr(e){return Re(e,function(r){return r})||[]}function Jr(e){if(!ne(e))throw new Error("React.Children.only expected to receive a single React element child.");return e}function Xr(e){var r={$$typeof:Z,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null};r.Provider={$$typeof:ie,_context:r};var n=!1,a=!1,o=!1;{var c={$$typeof:Z,_context:r};Object.defineProperties(c,{Provider:{get:function(){return a||(a=!0,f("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?")),r.Provider},set:function(i){r.Provider=i}},_currentValue:{get:function(){return r._currentValue},set:function(i){r._currentValue=i}},_currentValue2:{get:function(){return r._currentValue2},set:function(i){r._currentValue2=i}},_threadCount:{get:function(){return r._threadCount},set:function(i){r._threadCount=i}},Consumer:{get:function(){return n||(n=!0,f("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?")),r.Consumer}},displayName:{get:function(){return r.displayName},set:function(i){o||(Y("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.",i),o=!0)}}}),r.Consumer=c}return r._currentRenderer=null,r._currentRenderer2=null,r}var de=-1,Fe=0,tr=1,Zr=2;function et(e){if(e._status===de){var r=e._result,n=r();if(n.then(function(c){if(e._status===Fe||e._status===de){var i=e;i._status=tr,i._result=c}},function(c){if(e._status===Fe||e._status===de){var i=e;i._status=Zr,i._result=c}}),e._status===de){var a=e;a._status=Fe,a._result=n}}if(e._status===tr){var o=e._result;return o===void 0&&f(`lazy: Expected the result of a dynamic import() call. Instead received: %s
Your code should look like:
const MyComponent = lazy(() => import('./MyComponent'))
Did you accidentally put curly braces around the import?`,o),"default"in o||f(`lazy: Expected the result of a dynamic import() call. Instead received: %s
Your code should look like:
const MyComponent = lazy(() => import('./MyComponent'))`,o),o.default}else throw e._result}function rt(e){var r={_status:de,_result:e},n={$$typeof:K,_payload:r,_init:et};{var a,o;Object.defineProperties(n,{defaultProps:{configurable:!0,get:function(){return a},set:function(c){f("React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),a=c,Object.defineProperty(n,"defaultProps",{enumerable:!0})}},propTypes:{configurable:!0,get:function(){return o},set:function(c){f("React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),o=c,Object.defineProperty(n,"propTypes",{enumerable:!0})}}})}return n}function tt(e){e!=null&&e.$$typeof===x?f("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):typeof e!="function"?f("forwardRef requires a render function but was given %s.",e===null?"null":typeof e):e.length!==0&&e.length!==2&&f("forwardRef render functions accept exactly two parameters: props and ref. %s",e.length===1?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),e!=null&&(e.defaultProps!=null||e.propTypes!=null)&&f("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?");var r={$$typeof:q,render:e};{var n;Object.defineProperty(r,"displayName",{enumerable:!1,configurable:!0,get:function(){return n},set:function(a){n=a,!e.name&&!e.displayName&&(e.displayName=a)}})}return r}var nr;nr=Symbol.for("react.module.reference");function ar(e){return!!(typeof e=="string"||typeof e=="function"||e===$||e===L||te||e===F||e===H||e===se||fe||e===ve||ce||je||me||typeof e=="object"&&e!==null&&(e.$$typeof===K||e.$$typeof===x||e.$$typeof===ie||e.$$typeof===Z||e.$$typeof===q||e.$$typeof===nr||e.getModuleId!==void 0))}function nt(e,r){ar(e)||f("memo: The first argument must be a component. Instead received: %s",e===null?"null":typeof e);var n={$$typeof:x,type:e,compare:r===void 0?null:r};{var a;Object.defineProperty(n,"displayName",{enumerable:!1,configurable:!0,get:function(){return a},set:function(o){a=o,!e.name&&!e.displayName&&(e.displayName=o)}})}return n}function j(){var e=re.current;return e===null&&f(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.`),e}function at(e){var r=j();if(e._context!==void 0){var n=e._context;n.Consumer===e?f("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?"):n.Provider===e&&f("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")}return r.useContext(e)}function ot(e){var r=j();return r.useState(e)}function ut(e,r,n){var a=j();return a.useReducer(e,r,n)}function it(e){var r=j();return r.useRef(e)}function st(e,r){var n=j();return n.useEffect(e,r)}function ct(e,r){var n=j();return n.useInsertionEffect(e,r)}function ft(e,r){var n=j();return n.useLayoutEffect(e,r)}function lt(e,r){var n=j();return n.useCallback(e,r)}function dt(e,r){var n=j();return n.useMemo(e,r)}function pt(e,r,n){var a=j();return a.useImperativeHandle(e,r,n)}function vt(e,r){{var n=j();return n.useDebugValue(e,r)}}function yt(){var e=j();return e.useTransition()}function ht(e){var r=j();return r.useDeferredValue(e)}function mt(){var e=j();return e.useId()}function gt(e,r,n){var a=j();return a.useSyncExternalStore(e,r,n)}var pe=0,or,ur,ir,sr,cr,fr,lr;function dr(){}dr.__reactDisabledLog=!0;function _t(){{if(pe===0){or=console.log,ur=console.info,ir=console.warn,sr=console.error,cr=console.group,fr=console.groupCollapsed,lr=console.groupEnd;var e={configurable:!0,enumerable:!0,value:dr,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}pe++}}function bt(){{if(pe--,pe===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:d({},e,{value:or}),info:d({},e,{value:ur}),warn:d({},e,{value:ir}),error:d({},e,{value:sr}),group:d({},e,{value:cr}),groupCollapsed:d({},e,{value:fr}),groupEnd:d({},e,{value:lr})})}pe<0&&f("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Le=I.ReactCurrentDispatcher,xe;function Se(e,r,n){{if(xe===void 0)try{throw Error()}catch(o){var a=o.stack.trim().match(/\n( *(at )?)/);xe=a&&a[1]||""}return`
`+xe+e}}var Me=!1,Ce;{var Et=typeof WeakMap=="function"?WeakMap:Map;Ce=new Et}function pr(e,r){if(!e||Me)return"";{var n=Ce.get(e);if(n!==void 0)return n}var a;Me=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var c;c=Le.current,Le.current=null,_t();try{if(r){var i=function(){throw Error()};if(Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(k){a=k}Reflect.construct(e,[],i)}else{try{i.call()}catch(k){a=k}e.call(i.prototype)}}else{try{throw Error()}catch(k){a=k}e()}}catch(k){if(k&&a&&typeof k.stack=="string"){for(var l=k.stack.split(`
`),y=a.stack.split(`
`),g=l.length-1,R=y.length-1;g>=1&&R>=0&&l[g]!==y[R];)R--;for(;g>=1&&R>=0;g--,R--)if(l[g]!==y[R]){if(g!==1||R!==1)do if(g--,R--,R<0||l[g]!==y[R]){var S=`
`+l[g].replace(" at new "," at ");return e.displayName&&S.includes("<anonymous>")&&(S=S.replace("<anonymous>",e.displayName)),typeof e=="function"&&Ce.set(e,S),S}while(g>=1&&R>=0);break}}}finally{Me=!1,Le.current=c,bt(),Error.prepareStackTrace=o}var C=e?e.displayName||e.name:"",O=C?Se(C):"";return typeof e=="function"&&Ce.set(e,O),O}function Rt(e,r,n){return pr(e,!1)}function St(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function we(e,r,n){if(e==null)return"";if(typeof e=="function")return pr(e,St(e));if(typeof e=="string")return Se(e);switch(e){case H:return Se("Suspense");case se:return Se("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case q:return Rt(e.render);case x:return we(e.type,r,n);case K:{var a=e,o=a._payload,c=a._init;try{return we(c(o),r,n)}catch{}}}return""}var vr={},yr=I.ReactDebugCurrentFrame;function Oe(e){if(e){var r=e._owner,n=we(e.type,e._source,r?r.type:null);yr.setExtraStackFrame(n)}else yr.setExtraStackFrame(null)}function Ct(e,r,n,a,o){{var c=Function.call.bind(le);for(var i in e)if(c(e,i)){var l=void 0;try{if(typeof e[i]!="function"){var y=Error((a||"React class")+": "+n+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw y.name="Invariant Violation",y}l=e[i](r,i,a,n,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(g){l=g}l&&!(l instanceof Error)&&(Oe(o),f("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",a||"React class",n,i,typeof l),Oe(null)),l instanceof Error&&!(l.message in vr)&&(vr[l.message]=!0,Oe(o),f("Failed %s type: %s",n,l.message),Oe(null))}}}function ae(e){if(e){var r=e._owner,n=we(e.type,e._source,r?r.type:null);he(n)}else he(null)}var Ne;Ne=!1;function hr(){if(A.current){var e=z(A.current.type);if(e)return`
Check the render method of \``+e+"`."}return""}function wt(e){if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),n=e.lineNumber;return`
Check your code at `+r+":"+n+"."}return""}function Ot(e){return e!=null?wt(e.__source):""}var mr={};function Tt(e){var r=hr();if(!r){var n=typeof e=="string"?e:e.displayName||e.name;n&&(r=`
Check the top-level render call using <`+n+">.")}return r}function gr(e,r){if(!(!e._store||e._store.validated||e.key!=null)){e._store.validated=!0;var n=Tt(r);if(!mr[n]){mr[n]=!0;var a="";e&&e._owner&&e._owner!==A.current&&(a=" It was passed a child from "+z(e._owner.type)+"."),ae(e),f('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',n,a),ae(null)}}}function _r(e,r){if(typeof e=="object"){if(_e(e))for(var n=0;n<e.length;n++){var a=e[n];ne(a)&&gr(a,r)}else if(ne(e))e._store&&(e._store.validated=!0);else if(e){var o=ee(e);if(typeof o=="function"&&o!==e.entries)for(var c=o.call(e),i;!(i=c.next()).done;)ne(i.value)&&gr(i.value,r)}}}function br(e){{var r=e.type;if(r==null||typeof r=="string")return;var n;if(typeof r=="function")n=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===q||r.$$typeof===x))n=r.propTypes;else return;if(n){var a=z(r);Ct(n,e.props,"prop",a,e)}else if(r.PropTypes!==void 0&&!Ne){Ne=!0;var o=z(r);f("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",o||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&f("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function kt(e){{for(var r=Object.keys(e.props),n=0;n<r.length;n++){var a=r[n];if(a!=="children"&&a!=="key"){ae(e),f("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",a),ae(null);break}}e.ref!==null&&(ae(e),f("Invalid attribute `ref` supplied to `React.Fragment`."),ae(null))}}function Er(e,r,n){var a=ar(e);if(!a){var o="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(o+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var c=Ot(r);c?o+=c:o+=hr();var i;e===null?i="null":_e(e)?i="array":e!==void 0&&e.$$typeof===D?(i="<"+(z(e.type)||"Unknown")+" />",o=" Did you accidentally export a JSX literal instead of a component?"):i=typeof e,f("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",i,o)}var l=Wr.apply(this,arguments);if(l==null)return l;if(a)for(var y=2;y<arguments.length;y++)_r(arguments[y],e);return e===$?kt(l):br(l),l}var Rr=!1;function Pt(e){var r=Er.bind(null,e);return r.type=e,Rr||(Rr=!0,Y("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.")),Object.defineProperty(r,"type",{enumerable:!1,get:function(){return Y("Factory.type is deprecated. Access the class directly before passing it to createFactory."),Object.defineProperty(this,"type",{value:e}),e}}),r}function jt(e,r,n){for(var a=zr.apply(this,arguments),o=2;o<arguments.length;o++)_r(arguments[o],a.type);return br(a),a}function At(e,r){var n=N.transition;N.transition={};var a=N.transition;N.transition._updatedFibers=new Set;try{e()}finally{if(N.transition=n,n===null&&a._updatedFibers){var o=a._updatedFibers.size;o>10&&Y("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."),a._updatedFibers.clear()}}}var Sr=!1,Te=null;function It(e){if(Te===null)try{var r=("require"+Math.random()).slice(0,7),n=h&&h[r];Te=n.call(h,"timers").setImmediate}catch{Te=function(o){Sr===!1&&(Sr=!0,typeof MessageChannel>"u"&&f("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var c=new MessageChannel;c.port1.onmessage=o,c.port2.postMessage(void 0)}}return Te(e)}var oe=0,Cr=!1;function Dt(e){{var r=oe;oe++,T.current===null&&(T.current=[]);var n=T.isBatchingLegacy,a;try{if(T.isBatchingLegacy=!0,a=e(),!n&&T.didScheduleLegacyUpdate){var o=T.current;o!==null&&(T.didScheduleLegacyUpdate=!1,We(o))}}catch(C){throw ke(r),C}finally{T.isBatchingLegacy=n}if(a!==null&&typeof a=="object"&&typeof a.then=="function"){var c=a,i=!1,l={then:function(C,O){i=!0,c.then(function(k){ke(r),oe===0?Ve(k,C,O):C(k)},function(k){ke(r),O(k)})}};return!Cr&&typeof Promise<"u"&&Promise.resolve().then(function(){}).then(function(){i||(Cr=!0,f("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))}),l}else{var y=a;if(ke(r),oe===0){var g=T.current;g!==null&&(We(g),T.current=null);var R={then:function(C,O){T.current===null?(T.current=[],Ve(y,C,O)):C(y)}};return R}else{var S={then:function(C,O){C(y)}};return S}}}}function ke(e){e!==oe-1&&f("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),oe=e}function Ve(e,r,n){{var a=T.current;if(a!==null)try{We(a),It(function(){a.length===0?(T.current=null,r(e)):Ve(e,r,n)})}catch(o){n(o)}else r(e)}}var Ue=!1;function We(e){if(!Ue){Ue=!0;var r=0;try{for(;r<e.length;r++){var n=e[r];do n=n(!0);while(n!==null)}e.length=0}catch(a){throw e=e.slice(r+1),a}finally{Ue=!1}}}var $t=Er,Ft=jt,Lt=Pt,xt={map:Re,forEach:Gr,count:Kr,toArray:Qr,only:Jr};s.Children=xt,s.Component=v,s.Fragment=$,s.Profiler=L,s.PureComponent=P,s.StrictMode=F,s.Suspense=H,s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=I,s.cloneElement=Ft,s.createContext=Xr,s.createElement=$t,s.createFactory=Lt,s.createRef=$r,s.forwardRef=tt,s.isValidElement=ne,s.lazy=rt,s.memo=nt,s.startTransition=At,s.unstable_act=Dt,s.useCallback=lt,s.useContext=at,s.useDebugValue=vt,s.useDeferredValue=ht,s.useEffect=st,s.useId=mt,s.useImperativeHandle=pt,s.useInsertionEffect=ct,s.useLayoutEffect=ft,s.useMemo=dt,s.useReducer=ut,s.useRef=it,s.useState=ot,s.useSyncExternalStore=gt,s.useTransition=yt,s.version=B,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()}(jr,ue)),ue}(function(h){process.env.NODE_ENV==="production"?h.exports=Pr():h.exports=Ar()})(kr);const Ir=h=>{const s=J.StorageManager.lookupManager(h);if(s===void 0)throw Error(`Unable to find storage manager for ${h.key.toString()}`);const B=s.getValue(h),[D,U]=X.useState(B),$=s.getSetter(h);return X.useEffect(()=>{const F=s.subscribe(h,L=>(U(L.value),Promise.resolve()));return()=>F.unsubscribe()},[s,h]),[D,$]},Dr=h=>{const s=J.StorageManager.lookupManager(h);if(s===void 0)throw Error(`Unable to find storage manager for ${h.key.toString()}`);const B=s.getValue(h),[D,U]=X.useState(B),$=s.getSetter(h);return X.useLayoutEffect(()=>{const F=s.subscribe(h,L=>(U(L.value),Promise.resolve()));return()=>F.unsubscribe()},[s,h]),[D,$]};V.useStore=Ir,V.useStoreLayout=Dr,Object.defineProperty(V,Symbol.toStringTag,{value:"Module"})});
+7
-7
{
"name": "@flexbase/store-react",
"version": "1.0.0",
"version": "1.0.1",
"description": "React extensions for @flexbase/store",
"main": "dist/index.js",
"module": "dist/index.es.js",
"types": "dist/index.d.ts",
"main": "./index.cjs",
"module": "./index.js",
"exports": { ".": { "import": "./index.js", "require": "./index.cjs" } },
"homepage": "https://github.com/flexbase-eng/store-react#readme",

@@ -21,7 +21,7 @@ "repository": {

"dependencies": {
"@flexbase/observable-subject": "^1.1.0",
"@flexbase/store": "^1.2.0"
"@flexbase/observable-subject": "^1.4.3",
"@flexbase/store": "^1.2.2"
},
"type": "module",
"keywords": ["flexbase"]
"keywords": ["flexbase", "state management", "flux", "react"]
}

@@ -7,7 +7,7 @@ # store-react

`npm install @flexbase/observable-subject`
`npm install @flexbase/store-react`
or
`yarn add @flexbase/observable-subject`
`yarn add @flexbase/store-react`

@@ -14,0 +14,0 @@ ## Usage

import { Setter, Store } from '@flexbase/store';
/**
* A hook that attaches a store to a react state
* Internally it uses `useState` and `useEffect` to create a subscription between the store and react state
* @param store The store to use
* @returns A value and function to update it
*/
export declare const useStore: <T>(store: Store<T>) => [T | undefined, Setter<T>];
import { Setter, Store } from '@flexbase/store';
/**
* A hook that attaches a store to a react state
* Internally it uses `useState` and `useLayoutEffect` to create a subscription between the store and react state
* @param store The store to use
* @returns A value and function to update it
*/
export declare const useStoreLayout: <T>(store: Store<T>) => [T | undefined, Setter<T>];
export { useStore } from './core/useStore';
export { useStoreLayout } from './core/useStoreLayout';
import { StorageManager } from '@flexbase/store';
import { useState, useEffect, useLayoutEffect } from 'react';
/**
* A hook that attaches a store to a react state
* Internally it uses `useState` and `useEffect` to create a subscription between the store and react state
* @param store The store to use
* @returns A value and function to update it
*/
const useStore = (store) => {
const mgr = StorageManager.lookupManager(store);
if (mgr === undefined) {
throw Error(`Unable to find storage manager for ${store.key.toString()}`);
}
const value = mgr.getValue(store);
const [reactState, setReactState] = useState(value);
const setter = mgr.getSetter(store);
useEffect(() => {
const subscription = mgr.subscribe(store, context => {
setReactState(context.value);
return Promise.resolve();
});
return () => subscription.unsubscribe();
}, [mgr, store]);
return [reactState, setter];
};
/**
* A hook that attaches a store to a react state
* Internally it uses `useState` and `useLayoutEffect` to create a subscription between the store and react state
* @param store The store to use
* @returns A value and function to update it
*/
const useStoreLayout = (store) => {
const mgr = StorageManager.lookupManager(store);
if (mgr === undefined) {
throw Error(`Unable to find storage manager for ${store.key.toString()}`);
}
const value = mgr.getValue(store);
const [reactState, setReactState] = useState(value);
const setter = mgr.getSetter(store);
useLayoutEffect(() => {
const subscription = mgr.subscribe(store, context => {
setReactState(context.value);
return Promise.resolve();
});
return () => subscription.unsubscribe();
}, [mgr, store]);
return [reactState, setter];
};
export { useStore, useStoreLayout };
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var store = require('@flexbase/store');
var react = require('react');
/**
* A hook that attaches a store to a react state
* Internally it uses `useState` and `useEffect` to create a subscription between the store and react state
* @param store The store to use
* @returns A value and function to update it
*/
const useStore = (store$1) => {
const mgr = store.StorageManager.lookupManager(store$1);
if (mgr === undefined) {
throw Error(`Unable to find storage manager for ${store$1.key.toString()}`);
}
const value = mgr.getValue(store$1);
const [reactState, setReactState] = react.useState(value);
const setter = mgr.getSetter(store$1);
react.useEffect(() => {
const subscription = mgr.subscribe(store$1, context => {
setReactState(context.value);
return Promise.resolve();
});
return () => subscription.unsubscribe();
}, [mgr, store$1]);
return [reactState, setter];
};
/**
* A hook that attaches a store to a react state
* Internally it uses `useState` and `useLayoutEffect` to create a subscription between the store and react state
* @param store The store to use
* @returns A value and function to update it
*/
const useStoreLayout = (store$1) => {
const mgr = store.StorageManager.lookupManager(store$1);
if (mgr === undefined) {
throw Error(`Unable to find storage manager for ${store$1.key.toString()}`);
}
const value = mgr.getValue(store$1);
const [reactState, setReactState] = react.useState(value);
const setter = mgr.getSetter(store$1);
react.useLayoutEffect(() => {
const subscription = mgr.subscribe(store$1, context => {
setReactState(context.value);
return Promise.resolve();
});
return () => subscription.unsubscribe();
}, [mgr, store$1]);
return [reactState, setter];
};
exports.useStore = useStore;
exports.useStoreLayout = useStoreLayout;