Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-reactive-hooks

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-reactive-hooks - npm Package Compare versions

Comparing version 0.1.3 to 0.1.4

204

index.js
import De, { useRef as D, useState as fr, useCallback as V, createContext as lr, useContext as vr } from "react";
import { produce as dr } from "immer";
import je from "lodash.clonedeep";
var ae = {}, pr = {
get exports() {
return ae;
},
set exports(d) {
ae = d;
}
}, U = {};
var ae = { exports: {} }, U = {};
/**

@@ -22,7 +15,7 @@ * @license React

var ke;
function gr() {
function pr() {
if (ke)
return U;
ke = 1;
var d = De, h = Symbol.for("react.element"), g = Symbol.for("react.fragment"), p = Object.prototype.hasOwnProperty, m = d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, E = { key: !0, ref: !0, __self: !0, __source: !0 };
var b = De, g = Symbol.for("react.element"), p = Symbol.for("react.fragment"), d = Object.prototype.hasOwnProperty, m = b.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, E = { key: !0, ref: !0, __self: !0, __source: !0 };
function P(w, l, y) {

@@ -32,9 +25,9 @@ var C, O = {}, j = null, a = null;

for (C in l)
p.call(l, C) && !E.hasOwnProperty(C) && (O[C] = l[C]);
d.call(l, C) && !E.hasOwnProperty(C) && (O[C] = l[C]);
if (w && w.defaultProps)
for (C in l = w.defaultProps, l)
O[C] === void 0 && (O[C] = l[C]);
return { $$typeof: h, type: w, key: j, ref: a, props: O, _owner: m.current };
return { $$typeof: g, type: w, key: j, ref: a, props: O, _owner: m.current };
}
return U.Fragment = g, U.jsx = P, U.jsxs = P, U;
return U.Fragment = p, U.jsx = P, U.jsxs = P, U;
}

@@ -52,6 +45,6 @@ var L = {};

var Ae;
function hr() {
function gr() {
return Ae || (Ae = 1, process.env.NODE_ENV !== "production" && function() {
var d = De, h = Symbol.for("react.element"), g = Symbol.for("react.portal"), p = Symbol.for("react.fragment"), m = Symbol.for("react.strict_mode"), E = Symbol.for("react.profiler"), P = Symbol.for("react.provider"), w = Symbol.for("react.context"), l = Symbol.for("react.forward_ref"), y = Symbol.for("react.suspense"), C = Symbol.for("react.suspense_list"), O = Symbol.for("react.memo"), j = Symbol.for("react.lazy"), a = Symbol.for("react.offscreen"), i = Symbol.iterator, T = "@@iterator";
function _(e) {
var b = De, g = Symbol.for("react.element"), p = Symbol.for("react.portal"), d = Symbol.for("react.fragment"), m = Symbol.for("react.strict_mode"), E = Symbol.for("react.profiler"), P = Symbol.for("react.provider"), w = Symbol.for("react.context"), l = Symbol.for("react.forward_ref"), y = Symbol.for("react.suspense"), C = Symbol.for("react.suspense_list"), O = Symbol.for("react.memo"), j = Symbol.for("react.lazy"), a = Symbol.for("react.offscreen"), i = Symbol.iterator, T = "@@iterator";
function h(e) {
if (e === null || typeof e != "object")

@@ -62,3 +55,3 @@ return null;

}
var s = d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
var s = b.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
function f(e) {

@@ -84,3 +77,3 @@ {

function $e(e) {
return !!(typeof e == "string" || typeof e == "function" || e === p || e === E || We || e === m || e === y || e === C || Ie || e === a || G || K || Fe || typeof e == "object" && e !== null && (e.$$typeof === j || e.$$typeof === O || e.$$typeof === P || e.$$typeof === w || e.$$typeof === l || // This needs to include all possible module reference object
return !!(typeof e == "string" || typeof e == "function" || e === d || e === E || We || e === m || e === y || e === C || Ie || e === a || G || K || Fe || typeof e == "object" && e !== null && (e.$$typeof === j || e.$$typeof === O || e.$$typeof === P || e.$$typeof === w || e.$$typeof === l || // This needs to include all possible module reference object
// types supported by any Flight configuration anywhere since

@@ -109,5 +102,5 @@ // we don't know which Flight build this will end up being used

switch (e) {
case d:
return "Fragment";
case p:
return "Fragment";
case g:
return "Portal";

@@ -278,14 +271,14 @@ case E:

`), S = n.stack.split(`
`), b = o.length - 1, R = S.length - 1; b >= 1 && R >= 0 && o[b] !== S[R]; )
`), _ = o.length - 1, R = S.length - 1; _ >= 1 && R >= 0 && o[_] !== S[R]; )
R--;
for (; b >= 1 && R >= 0; b--, R--)
if (o[b] !== S[R]) {
if (b !== 1 || R !== 1)
for (; _ >= 1 && R >= 0; _--, R--)
if (o[_] !== S[R]) {
if (_ !== 1 || R !== 1)
do
if (b--, R--, R < 0 || o[b] !== S[R]) {
if (_--, R--, R < 0 || o[_] !== S[R]) {
var x = `
` + o[b].replace(" at new ", " at ");
` + o[_].replace(" at new ", " at ");
return e.displayName && x.includes("<anonymous>") && (x = x.replace("<anonymous>", e.displayName)), typeof e == "function" && M.set(e, x), x;
}
while (b >= 1 && R >= 0);
while (_ >= 1 && R >= 0);
break;

@@ -356,4 +349,4 @@ }

o = e[u](r, u, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
} catch (b) {
o = b;
} catch (_) {
o = _;
}

@@ -442,3 +435,3 @@ o && !(o instanceof Error) && (z(c), 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).", n || "React class", t, u, typeof o), z(null)), o instanceof Error && !(o.message in _e) && (_e[o.message] = !0, z(c), f("Failed %s type: %s", t, o.message), z(null));

// This tag allows us to uniquely identify this as a React Element
$$typeof: h,
$$typeof: g,
// Built-in properties that belong on the element

@@ -476,5 +469,5 @@ type: e,

if (e && e.defaultProps) {
var b = e.defaultProps;
for (v in b)
u[v] === void 0 && (u[v] = b[v]);
var _ = e.defaultProps;
for (v in _)
u[v] === void 0 && (u[v] = _[v]);
}

@@ -499,3 +492,3 @@ if (o || S) {

function ne(e) {
return typeof e == "object" && e !== null && e.$$typeof === h;
return typeof e == "object" && e !== null && e.$$typeof === g;
}

@@ -563,3 +556,3 @@ function Ce() {

else if (e) {
var c = _(e);
var c = h(e);
if (typeof c == "function" && c !== e.entries)

@@ -616,4 +609,4 @@ for (var v = c.call(e), u; !(u = v.next()).done; )

S ? o += S : o += Ce();
var b;
e === null ? b = "null" : Q(e) ? b = "array" : e !== void 0 && e.$$typeof === h ? (b = "<" + (k(e.type) || "Unknown") + " />", o = " Did you accidentally export a JSX literal instead of a component?") : b = typeof e, f("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", b, o);
var _;
e === null ? _ = "null" : Q(e) ? _ = "array" : e !== void 0 && e.$$typeof === g ? (_ = "<" + (k(e.type) || "Unknown") + " />", o = " Did you accidentally export a JSX literal instead of a component?") : _ = typeof e, f("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", _, o);
}

@@ -636,3 +629,3 @@ var R = rr(e, r, t, c, v);

}
return e === p ? or(R) : ar(R), R;
return e === d ? or(R) : ar(R), R;
}

@@ -647,20 +640,19 @@ }

var sr = ir, cr = ur;
L.Fragment = p, L.jsx = sr, L.jsxs = cr;
L.Fragment = d, L.jsx = sr, L.jsxs = cr;
}()), L;
}
(function(d) {
process.env.NODE_ENV === "production" ? d.exports = gr() : d.exports = hr();
})(pr);
const _r = ae.jsx, br = (d, h) => dr(d, (g) => {
for (const [p, m] of h) {
let E = g;
const P = p.length;
for (const w of p.slice(0, P - 1))
process.env.NODE_ENV === "production" ? ae.exports = pr() : ae.exports = gr();
var hr = ae.exports;
const _r = (b, g) => dr(b, (p) => {
for (const [d, m] of g) {
let E = p;
const P = d.length;
for (const w of d.slice(0, P - 1))
E = E[w];
E[p[P - 1]] = m;
E[d[P - 1]] = m;
}
}), oe = (d, h = {}) => {
const g = D(
typeof d == "function" ? d() : d
), p = D(/* @__PURE__ */ new Map()), m = D(
}), oe = (b, g = {}) => {
const p = D(
typeof b == "function" ? b() : b
), d = D(/* @__PURE__ */ new Map()), m = D(
/* @__PURE__ */ new Map()

@@ -670,7 +662,7 @@ ), E = D(!1), [P, w] = fr(!1), l = V((a) => {

for (const [i, T] of m.current)
if (i.length === a.length && i.every((_, s) => _ === a[s]))
if (i.length === a.length && i.every((h, s) => h === a[s]))
return T;
return;
}
return p.current.get(a.join("."));
return d.current.get(a.join("."));
}, []), y = V(

@@ -680,3 +672,3 @@ (a, i) => {

for (const T of m.current.keys())
if (!(T.length < a.length) && T.every((_, s) => _ === a[s])) {
if (!(T.length < a.length) && T.every((h, s) => h === a[s])) {
m.current.set(T, i);

@@ -688,3 +680,3 @@ return;

}
p.current.set(a.join("."), i), w(!P);
d.current.set(a.join("."), i), w(!P);
},

@@ -696,8 +688,8 @@ [P]

m.current.clear();
for (const [_, s] of p.current)
a.push([_.split("."), s]);
p.current.clear();
const i = br(g.current, a);
E.current = !1, (T = h.onStateChange) == null || T.call(h, g.current, i), g.current = i;
}, [h.onStateChange]), O = V(
for (const [h, s] of d.current)
a.push([h.split("."), s]);
d.current.clear();
const i = _r(p.current, a);
E.current = !1, (T = g.onStateChange) == null || T.call(g, p.current, i), p.current = i;
}, [g.onStateChange]), O = V(
(a, i = []) => new Proxy(

@@ -708,8 +700,8 @@ // If the object is frozen, it can't be proxied,

{
get(T, _) {
const s = l([...i, _]) ?? T[_];
return Array.isArray(s) ? j(s, [...i, _]) : typeof s == "object" && s !== null ? O(s, [...i, _]) : s;
get(T, h) {
const s = l([...i, h]) ?? T[h];
return Array.isArray(s) ? j(s, [...i, h]) : typeof s == "object" && s !== null ? O(s, [...i, h]) : s;
},
set(T, _, s) {
return y([...i, _], s), !0;
set(T, h, s) {
return y([...i, h], s), !0;
}

@@ -725,10 +717,10 @@ }

{
get(T, _) {
const s = l([...i, _]) ?? T[_];
get(T, h) {
const s = l([...i, h]) ?? T[h];
if (Array.isArray(s))
return j(s, [...i, _]);
return j(s, [...i, h]);
if (typeof s == "object" && s !== null)
return O(s, [...i, _]);
return O(s, [...i, h]);
if (typeof s == "function")
switch (_) {
switch (h) {
case "push":

@@ -760,4 +752,4 @@ return (...f) => (y(i, [...a, ...f]), a.length + f.length);

},
set(T, _, s) {
return y([...i, _], s), !0;
set(T, h, s) {
return y([...i, h], s), !0;
}

@@ -768,19 +760,19 @@ }

);
return E.current && C(), O(g.current);
}, yr = (d) => ({
__Context: lr(d),
__initialState: d
}), Tr = ({
children: d,
store: h
return E.current && C(), O(p.current);
}, Er = (b) => ({
__Context: lr(b),
__initialState: b
}), yr = ({
children: b,
store: g
}) => {
const g = oe(h.__initialState);
return /* @__PURE__ */ _r(h.__Context.Provider, { value: g, children: d });
}, Cr = (d) => vr(d.__Context), Sr = (d) => {
const h = D([]), g = D([]), p = D(!1), m = D(!1), E = oe(
{ value: d },
const p = oe(g.__initialState);
return /* @__PURE__ */ hr.jsx(g.__Context.Provider, { value: p, children: b });
}, Tr = (b) => vr(b.__Context), Cr = (b) => {
const g = D([]), p = D([]), d = D(!1), m = D(!1), E = oe(
{ value: b },
{
onStateChange: (l) => {
if (p.current) {
p.current = !1;
if (d.current) {
d.current = !1;
return;

@@ -792,33 +784,33 @@ }

}
h.current.push(l.value), g.current = [];
g.current.push(l.value), p.current = [];
}
}
), P = () => {
if (h.current.length === 0)
if (g.current.length === 0)
return;
p.current = !0;
const l = h.current.pop();
l && (g.current.push(je(E.value)), E.value = l);
d.current = !0;
const l = g.current.pop();
l && (p.current.push(je(E.value)), E.value = l);
}, w = () => {
if (g.current.length === 0)
if (p.current.length === 0)
return;
m.current = !0;
const l = g.current.pop();
l && (h.current.push(je(E.value)), E.value = l);
const l = p.current.pop();
l && (g.current.push(je(E.value)), E.value = l);
};
return { state: E.value, undo: P, redo: w };
}, Pr = (d) => {
const h = oe({ value: d });
return new Proxy(h, {
get: (g, p) => p === "value" ? g.value : g.value[p],
set: (g, p, m) => (p === "value" ? g.value = m : g.value[p] = m, !0)
}, Sr = (b) => {
const g = oe({ value: b });
return new Proxy(g, {
get: (p, d) => d === "value" ? p.value : p.value[d],
set: (p, d, m) => (d === "value" ? p.value = m : p.value[d] = m, !0)
});
};
export {
Tr as ReactiveProvider,
yr as createReactiveStore,
yr as ReactiveProvider,
Er as createReactiveStore,
oe as useReactive,
Cr as useReactiveStore,
Sr as useReactiveUndo,
Pr as useReactiveValue
Tr as useReactiveStore,
Cr as useReactiveUndo,
Sr as useReactiveValue
};

@@ -1,2 +0,2 @@

(function(O,g){typeof exports=="object"&&typeof module<"u"?g(exports,require("react"),require("immer"),require("lodash.clonedeep")):typeof define=="function"&&define.amd?define(["exports","react","immer","lodash.clonedeep"],g):(O=typeof globalThis<"u"?globalThis:O||self,g(O["react-reactive-hooks"]={},O.require$$0,O.immer,O.cloneDeep))})(this,function(O,g,De,ue){"use strict";var H={},Fe={get exports(){return H},set exports(d){H=d}},Y={};/**
(function(O,h){typeof exports=="object"&&typeof module<"u"?h(exports,require("react"),require("immer"),require("lodash.clonedeep")):typeof define=="function"&&define.amd?define(["exports","react","immer","lodash.clonedeep"],h):(O=typeof globalThis<"u"?globalThis:O||self,h(O["react-reactive-hooks"]={},O.require$$0,O.immer,O.cloneDeep))})(this,function(O,h,De,ue){"use strict";var H={exports:{}},Y={};/**
* @license React

@@ -9,3 +9,3 @@ * react-jsx-runtime.production.min.js

* LICENSE file in the root directory of this source tree.
*/var ie;function Ie(){if(ie)return Y;ie=1;var d=g,R=Symbol.for("react.element"),h=Symbol.for("react.fragment"),p=Object.prototype.hasOwnProperty,m=d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,y={key:!0,ref:!0,__self:!0,__source:!0};function w(j,l,C){var T,x={},A=null,a=null;C!==void 0&&(A=""+C),l.key!==void 0&&(A=""+l.key),l.ref!==void 0&&(a=l.ref);for(T in l)p.call(l,T)&&!y.hasOwnProperty(T)&&(x[T]=l[T]);if(j&&j.defaultProps)for(T in l=j.defaultProps,l)x[T]===void 0&&(x[T]=l[T]);return{$$typeof:R,type:j,key:A,ref:a,props:x,_owner:m.current}}return Y.Fragment=h,Y.jsx=w,Y.jsxs=w,Y}var U={};/**
*/var ie;function Fe(){if(ie)return Y;ie=1;var _=h,g=Symbol.for("react.element"),p=Symbol.for("react.fragment"),d=Object.prototype.hasOwnProperty,m=_.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,y={key:!0,ref:!0,__self:!0,__source:!0};function w(j,l,C){var T,x={},A=null,a=null;C!==void 0&&(A=""+C),l.key!==void 0&&(A=""+l.key),l.ref!==void 0&&(a=l.ref);for(T in l)d.call(l,T)&&!y.hasOwnProperty(T)&&(x[T]=l[T]);if(j&&j.defaultProps)for(T in l=j.defaultProps,l)x[T]===void 0&&(x[T]=l[T]);return{$$typeof:g,type:j,key:A,ref:a,props:x,_owner:m.current}}return Y.Fragment=p,Y.jsx=w,Y.jsxs=w,Y}var U={};/**
* @license React

@@ -18,12 +18,12 @@ * react-jsx-runtime.development.js

* LICENSE file in the root directory of this source tree.
*/var se;function We(){return se||(se=1,process.env.NODE_ENV!=="production"&&function(){var d=g,R=Symbol.for("react.element"),h=Symbol.for("react.portal"),p=Symbol.for("react.fragment"),m=Symbol.for("react.strict_mode"),y=Symbol.for("react.profiler"),w=Symbol.for("react.provider"),j=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),x=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),a=Symbol.for("react.offscreen"),i=Symbol.iterator,S="@@iterator";function b(e){if(e===null||typeof e!="object")return null;var r=i&&e[i]||e[S];return typeof r=="function"?r:null}var s=d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function f(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];X("error",e,t)}}function X(e,r,t){{var n=s.ReactDebugCurrentFrame,c=n.getStackAddendum();c!==""&&(r+="%s",t=t.concat([c]));var v=t.map(function(u){return String(u)});v.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,v)}}var Z=!1,Q=!1,ze=!1,Je=!1,Ge=!1,ce;ce=Symbol.for("react.module.reference");function Ke(e){return!!(typeof e=="string"||typeof e=="function"||e===p||e===y||Ge||e===m||e===C||e===T||Je||e===a||Z||Q||ze||typeof e=="object"&&e!==null&&(e.$$typeof===A||e.$$typeof===x||e.$$typeof===w||e.$$typeof===j||e.$$typeof===l||e.$$typeof===ce||e.getModuleId!==void 0))}function He(e,r,t){var n=e.displayName;if(n)return n;var c=r.displayName||r.name||"";return c!==""?t+"("+c+")":t}function fe(e){return e.displayName||"Context"}function D(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 p:return"Fragment";case h:return"Portal";case y:return"Profiler";case m:return"StrictMode";case C:return"Suspense";case T:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case j:var r=e;return fe(r)+".Consumer";case w:var t=e;return fe(t._context)+".Provider";case l:return He(e,e.render,"ForwardRef");case x:var n=e.displayName||null;return n!==null?n:D(e.type)||"Memo";case A:{var c=e,v=c._payload,u=c._init;try{return D(u(v))}catch{return null}}}return null}var I=Object.assign,L=0,le,ve,de,pe,he,ge,Re;function be(){}be.__reactDisabledLog=!0;function Xe(){{if(L===0){le=console.log,ve=console.info,de=console.warn,pe=console.error,he=console.group,ge=console.groupCollapsed,Re=console.groupEnd;var e={configurable:!0,enumerable:!0,value:be,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}L++}}function Ze(){{if(L--,L===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:I({},e,{value:le}),info:I({},e,{value:ve}),warn:I({},e,{value:de}),error:I({},e,{value:pe}),group:I({},e,{value:he}),groupCollapsed:I({},e,{value:ge}),groupEnd:I({},e,{value:Re})})}L<0&&f("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var q=s.ReactCurrentDispatcher,$;function B(e,r,t){{if($===void 0)try{throw Error()}catch(c){var n=c.stack.trim().match(/\n( *(at )?)/);$=n&&n[1]||""}return`
`+$+e}}var ee=!1,z;{var Qe=typeof WeakMap=="function"?WeakMap:Map;z=new Qe}function _e(e,r){if(!e||ee)return"";{var t=z.get(e);if(t!==void 0)return t}var n;ee=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var v;v=q.current,q.current=null,Xe();try{if(r){var u=function(){throw Error()};if(Object.defineProperty(u.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(u,[])}catch(F){n=F}Reflect.construct(e,[],u)}else{try{u.call()}catch(F){n=F}e.call(u.prototype)}}else{try{throw Error()}catch(F){n=F}e()}}catch(F){if(F&&n&&typeof F.stack=="string"){for(var o=F.stack.split(`
*/var se;function Ie(){return se||(se=1,process.env.NODE_ENV!=="production"&&function(){var _=h,g=Symbol.for("react.element"),p=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),m=Symbol.for("react.strict_mode"),y=Symbol.for("react.profiler"),w=Symbol.for("react.provider"),j=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),x=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),a=Symbol.for("react.offscreen"),i=Symbol.iterator,S="@@iterator";function R(e){if(e===null||typeof e!="object")return null;var r=i&&e[i]||e[S];return typeof r=="function"?r:null}var s=_.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function f(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];X("error",e,t)}}function X(e,r,t){{var n=s.ReactDebugCurrentFrame,c=n.getStackAddendum();c!==""&&(r+="%s",t=t.concat([c]));var v=t.map(function(u){return String(u)});v.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,v)}}var Z=!1,Q=!1,Be=!1,ze=!1,Je=!1,ce;ce=Symbol.for("react.module.reference");function Ge(e){return!!(typeof e=="string"||typeof e=="function"||e===d||e===y||Je||e===m||e===C||e===T||ze||e===a||Z||Q||Be||typeof e=="object"&&e!==null&&(e.$$typeof===A||e.$$typeof===x||e.$$typeof===w||e.$$typeof===j||e.$$typeof===l||e.$$typeof===ce||e.getModuleId!==void 0))}function Ke(e,r,t){var n=e.displayName;if(n)return n;var c=r.displayName||r.name||"";return c!==""?t+"("+c+")":t}function fe(e){return e.displayName||"Context"}function D(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 p:return"Portal";case y:return"Profiler";case m:return"StrictMode";case C:return"Suspense";case T:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case j:var r=e;return fe(r)+".Consumer";case w:var t=e;return fe(t._context)+".Provider";case l:return Ke(e,e.render,"ForwardRef");case x:var n=e.displayName||null;return n!==null?n:D(e.type)||"Memo";case A:{var c=e,v=c._payload,u=c._init;try{return D(u(v))}catch{return null}}}return null}var I=Object.assign,L=0,le,ve,de,pe,he,ge,Re;function be(){}be.__reactDisabledLog=!0;function He(){{if(L===0){le=console.log,ve=console.info,de=console.warn,pe=console.error,he=console.group,ge=console.groupCollapsed,Re=console.groupEnd;var e={configurable:!0,enumerable:!0,value:be,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}L++}}function Xe(){{if(L--,L===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:I({},e,{value:le}),info:I({},e,{value:ve}),warn:I({},e,{value:de}),error:I({},e,{value:pe}),group:I({},e,{value:he}),groupCollapsed:I({},e,{value:ge}),groupEnd:I({},e,{value:Re})})}L<0&&f("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var q=s.ReactCurrentDispatcher,$;function B(e,r,t){{if($===void 0)try{throw Error()}catch(c){var n=c.stack.trim().match(/\n( *(at )?)/);$=n&&n[1]||""}return`
`+$+e}}var ee=!1,z;{var Ze=typeof WeakMap=="function"?WeakMap:Map;z=new Ze}function _e(e,r){if(!e||ee)return"";{var t=z.get(e);if(t!==void 0)return t}var n;ee=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var v;v=q.current,q.current=null,He();try{if(r){var u=function(){throw Error()};if(Object.defineProperty(u.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(u,[])}catch(F){n=F}Reflect.construct(e,[],u)}else{try{u.call()}catch(F){n=F}e.call(u.prototype)}}else{try{throw Error()}catch(F){n=F}e()}}catch(F){if(F&&n&&typeof F.stack=="string"){for(var o=F.stack.split(`
`),P=n.stack.split(`
`),_=o.length-1,E=P.length-1;_>=1&&E>=0&&o[_]!==P[E];)E--;for(;_>=1&&E>=0;_--,E--)if(o[_]!==P[E]){if(_!==1||E!==1)do if(_--,E--,E<0||o[_]!==P[E]){var k=`
`+o[_].replace(" at new "," at ");return e.displayName&&k.includes("<anonymous>")&&(k=k.replace("<anonymous>",e.displayName)),typeof e=="function"&&z.set(e,k),k}while(_>=1&&E>=0);break}}}finally{ee=!1,q.current=v,Ze(),Error.prepareStackTrace=c}var V=e?e.displayName||e.name:"",Ae=V?B(V):"";return typeof e=="function"&&z.set(e,Ae),Ae}function qe(e,r,t){return _e(e,!1)}function $e(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function J(e,r,t){if(e==null)return"";if(typeof e=="function")return _e(e,$e(e));if(typeof e=="string")return B(e);switch(e){case C:return B("Suspense");case T:return B("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case l:return qe(e.render);case x:return J(e.type,r,t);case A:{var n=e,c=n._payload,v=n._init;try{return J(v(c),r,t)}catch{}}}return""}var G=Object.prototype.hasOwnProperty,me={},Ee=s.ReactDebugCurrentFrame;function K(e){if(e){var r=e._owner,t=J(e.type,e._source,r?r.type:null);Ee.setExtraStackFrame(t)}else Ee.setExtraStackFrame(null)}function er(e,r,t,n,c){{var v=Function.call.bind(G);for(var u in e)if(v(e,u)){var o=void 0;try{if(typeof e[u]!="function"){var P=Error((n||"React class")+": "+t+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw P.name="Invariant Violation",P}o=e[u](r,u,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(_){o=_}o&&!(o instanceof Error)&&(K(c),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).",n||"React class",t,u,typeof o),K(null)),o instanceof Error&&!(o.message in me)&&(me[o.message]=!0,K(c),f("Failed %s type: %s",t,o.message),K(null))}}}var rr=Array.isArray;function re(e){return rr(e)}function tr(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function nr(e){try{return ye(e),!1}catch{return!0}}function ye(e){return""+e}function Ce(e){if(nr(e))return f("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",tr(e)),ye(e)}var M=s.ReactCurrentOwner,ar={key:!0,ref:!0,__self:!0,__source:!0},Se,Te,te;te={};function or(e){if(G.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function ur(e){if(G.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function ir(e,r){if(typeof e.ref=="string"&&M.current&&r&&M.current.stateNode!==r){var t=D(M.current.type);te[t]||(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',D(M.current.type),e.ref),te[t]=!0)}}function sr(e,r){{var t=function(){Se||(Se=!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))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function cr(e,r){{var t=function(){Te||(Te=!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))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var fr=function(e,r,t,n,c,v,u){var o={$$typeof:R,type:e,key:r,ref:t,props:u,_owner:v};return o._store={},Object.defineProperty(o._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(o,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(o,"_source",{configurable:!1,enumerable:!1,writable:!1,value:c}),Object.freeze&&(Object.freeze(o.props),Object.freeze(o)),o};function lr(e,r,t,n,c){{var v,u={},o=null,P=null;t!==void 0&&(Ce(t),o=""+t),ur(r)&&(Ce(r.key),o=""+r.key),or(r)&&(P=r.ref,ir(r,c));for(v in r)G.call(r,v)&&!ar.hasOwnProperty(v)&&(u[v]=r[v]);if(e&&e.defaultProps){var _=e.defaultProps;for(v in _)u[v]===void 0&&(u[v]=_[v])}if(o||P){var E=typeof e=="function"?e.displayName||e.name||"Unknown":e;o&&sr(u,E),P&&cr(u,E)}return fr(e,o,P,c,n,M.current,u)}}var ne=s.ReactCurrentOwner,Pe=s.ReactDebugCurrentFrame;function W(e){if(e){var r=e._owner,t=J(e.type,e._source,r?r.type:null);Pe.setExtraStackFrame(t)}else Pe.setExtraStackFrame(null)}var ae;ae=!1;function oe(e){return typeof e=="object"&&e!==null&&e.$$typeof===R}function Oe(){{if(ne.current){var e=D(ne.current.type);if(e)return`
`),b=o.length-1,E=P.length-1;b>=1&&E>=0&&o[b]!==P[E];)E--;for(;b>=1&&E>=0;b--,E--)if(o[b]!==P[E]){if(b!==1||E!==1)do if(b--,E--,E<0||o[b]!==P[E]){var k=`
`+o[b].replace(" at new "," at ");return e.displayName&&k.includes("<anonymous>")&&(k=k.replace("<anonymous>",e.displayName)),typeof e=="function"&&z.set(e,k),k}while(b>=1&&E>=0);break}}}finally{ee=!1,q.current=v,Xe(),Error.prepareStackTrace=c}var V=e?e.displayName||e.name:"",Ae=V?B(V):"";return typeof e=="function"&&z.set(e,Ae),Ae}function Qe(e,r,t){return _e(e,!1)}function qe(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function J(e,r,t){if(e==null)return"";if(typeof e=="function")return _e(e,qe(e));if(typeof e=="string")return B(e);switch(e){case C:return B("Suspense");case T:return B("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case l:return Qe(e.render);case x:return J(e.type,r,t);case A:{var n=e,c=n._payload,v=n._init;try{return J(v(c),r,t)}catch{}}}return""}var G=Object.prototype.hasOwnProperty,me={},Ee=s.ReactDebugCurrentFrame;function K(e){if(e){var r=e._owner,t=J(e.type,e._source,r?r.type:null);Ee.setExtraStackFrame(t)}else Ee.setExtraStackFrame(null)}function $e(e,r,t,n,c){{var v=Function.call.bind(G);for(var u in e)if(v(e,u)){var o=void 0;try{if(typeof e[u]!="function"){var P=Error((n||"React class")+": "+t+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw P.name="Invariant Violation",P}o=e[u](r,u,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(b){o=b}o&&!(o instanceof Error)&&(K(c),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).",n||"React class",t,u,typeof o),K(null)),o instanceof Error&&!(o.message in me)&&(me[o.message]=!0,K(c),f("Failed %s type: %s",t,o.message),K(null))}}}var er=Array.isArray;function re(e){return er(e)}function rr(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function tr(e){try{return ye(e),!1}catch{return!0}}function ye(e){return""+e}function Ce(e){if(tr(e))return f("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",rr(e)),ye(e)}var M=s.ReactCurrentOwner,nr={key:!0,ref:!0,__self:!0,__source:!0},Se,Te,te;te={};function ar(e){if(G.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function or(e){if(G.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function ur(e,r){if(typeof e.ref=="string"&&M.current&&r&&M.current.stateNode!==r){var t=D(M.current.type);te[t]||(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',D(M.current.type),e.ref),te[t]=!0)}}function ir(e,r){{var t=function(){Se||(Se=!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))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function sr(e,r){{var t=function(){Te||(Te=!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))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var cr=function(e,r,t,n,c,v,u){var o={$$typeof:g,type:e,key:r,ref:t,props:u,_owner:v};return o._store={},Object.defineProperty(o._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(o,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(o,"_source",{configurable:!1,enumerable:!1,writable:!1,value:c}),Object.freeze&&(Object.freeze(o.props),Object.freeze(o)),o};function fr(e,r,t,n,c){{var v,u={},o=null,P=null;t!==void 0&&(Ce(t),o=""+t),or(r)&&(Ce(r.key),o=""+r.key),ar(r)&&(P=r.ref,ur(r,c));for(v in r)G.call(r,v)&&!nr.hasOwnProperty(v)&&(u[v]=r[v]);if(e&&e.defaultProps){var b=e.defaultProps;for(v in b)u[v]===void 0&&(u[v]=b[v])}if(o||P){var E=typeof e=="function"?e.displayName||e.name||"Unknown":e;o&&ir(u,E),P&&sr(u,E)}return cr(e,o,P,c,n,M.current,u)}}var ne=s.ReactCurrentOwner,Pe=s.ReactDebugCurrentFrame;function W(e){if(e){var r=e._owner,t=J(e.type,e._source,r?r.type:null);Pe.setExtraStackFrame(t)}else Pe.setExtraStackFrame(null)}var ae;ae=!1;function oe(e){return typeof e=="object"&&e!==null&&e.$$typeof===g}function Oe(){{if(ne.current){var e=D(ne.current.type);if(e)return`
Check the render method of \``+e+"`."}return""}}function vr(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),t=e.lineNumber;return`
Check the render method of \``+e+"`."}return""}}function lr(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),t=e.lineNumber;return`
Check your code at `+r+":"+t+"."}return""}}var we={};function dr(e){{var r=Oe();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
Check your code at `+r+":"+t+"."}return""}}var we={};function vr(e){{var r=Oe();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
Check the top-level render call using <`+t+">.")}return r}}function je(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=dr(r);if(we[t])return;we[t]=!0;var n="";e&&e._owner&&e._owner!==ne.current&&(n=" It was passed a child from "+D(e._owner.type)+"."),W(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.',t,n),W(null)}}function xe(e,r){{if(typeof e!="object")return;if(re(e))for(var t=0;t<e.length;t++){var n=e[t];oe(n)&&je(n,r)}else if(oe(e))e._store&&(e._store.validated=!0);else if(e){var c=b(e);if(typeof c=="function"&&c!==e.entries)for(var v=c.call(e),u;!(u=v.next()).done;)oe(u.value)&&je(u.value,r)}}}function pr(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===l||r.$$typeof===x))t=r.propTypes;else return;if(t){var n=D(r);er(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!ae){ae=!0;var c=D(r);f("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",c||"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 hr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){W(e),f("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),W(null);break}}e.ref!==null&&(W(e),f("Invalid attribute `ref` supplied to `React.Fragment`."),W(null))}}function ke(e,r,t,n,c,v){{var u=Ke(e);if(!u){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 P=vr(c);P?o+=P:o+=Oe();var _;e===null?_="null":re(e)?_="array":e!==void 0&&e.$$typeof===R?(_="<"+(D(e.type)||"Unknown")+" />",o=" Did you accidentally export a JSX literal instead of a component?"):_=typeof e,f("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",_,o)}var E=lr(e,r,t,c,v);if(E==null)return E;if(u){var k=r.children;if(k!==void 0)if(n)if(re(k)){for(var V=0;V<k.length;V++)xe(k[V],e);Object.freeze&&Object.freeze(k)}else f("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else xe(k,e)}return e===p?hr(E):pr(E),E}}function gr(e,r,t){return ke(e,r,t,!0)}function Rr(e,r,t){return ke(e,r,t,!1)}var br=Rr,_r=gr;U.Fragment=p,U.jsx=br,U.jsxs=_r}()),U}(function(d){process.env.NODE_ENV==="production"?d.exports=Ie():d.exports=We()})(Fe);const Ve=H.jsx,Ye=(d,R)=>De.produce(d,h=>{for(const[p,m]of R){let y=h;const w=p.length;for(const j of p.slice(0,w-1))y=y[j];y[p[w-1]]=m}}),N=(d,R={})=>{const h=g.useRef(typeof d=="function"?d():d),p=g.useRef(new Map),m=g.useRef(new Map),y=g.useRef(!1),[w,j]=g.useState(!1),l=g.useCallback(a=>{if(a.some(i=>typeof i=="symbol")){for(const[i,S]of m.current)if(i.length===a.length&&i.every((b,s)=>b===a[s]))return S;return}return p.current.get(a.join("."))},[]),C=g.useCallback((a,i)=>{if(y.current=!0,a.some(S=>typeof S=="symbol")){for(const S of m.current.keys())if(!(S.length<a.length)&&S.every((b,s)=>b===a[s])){m.current.set(S,i);return}m.current.set(a,i);return}p.current.set(a.join("."),i),j(!w)},[w]),T=g.useCallback(()=>{var S;const a=[...m.current.entries()];m.current.clear();for(const[b,s]of p.current)a.push([b.split("."),s]);p.current.clear();const i=Ye(h.current,a);y.current=!1,(S=R.onStateChange)==null||S.call(R,h.current,i),h.current=i},[R.onStateChange]),x=g.useCallback((a,i=[])=>new Proxy(Object.isFrozen(a)?{...a}:a,{get(S,b){const s=l([...i,b])??S[b];return Array.isArray(s)?A(s,[...i,b]):typeof s=="object"&&s!==null?x(s,[...i,b]):s},set(S,b,s){return C([...i,b],s),!0}}),[l,C]),A=g.useCallback((a,i=[])=>new Proxy(Object.isFrozen(a)?[...a]:a,{get(S,b){const s=l([...i,b])??S[b];if(Array.isArray(s))return A(s,[...i,b]);if(typeof s=="object"&&s!==null)return x(s,[...i,b]);if(typeof s=="function")switch(b){case"push":return(...f)=>(C(i,[...a,...f]),a.length+f.length);case"pop":return()=>{const f=a.pop();return C(i,a),f};case"shift":return()=>{const f=a.shift();return C(i,a),f};case"unshift":return(...f)=>(C(i,[...f,...a]),f.length+a.length);case"splice":return(f,X,...Z)=>{const Q=a.splice(f,X,...Z);return C(i,a),Q};case"sort":return f=>(a.sort(f),C(i,a),a);case"reverse":return()=>(a.reverse(),C(i,a),a)}return s},set(S,b,s){return C([...i,b],s),!0}}),[l,C]);return y.current&&T(),x(h.current)},Ue=d=>({__Context:g.createContext(d),__initialState:d}),Le=({children:d,store:R})=>{const h=N(R.__initialState);return Ve(R.__Context.Provider,{value:h,children:d})},Me=d=>g.useContext(d.__Context),Ne=d=>{const R=g.useRef([]),h=g.useRef([]),p=g.useRef(!1),m=g.useRef(!1),y=N({value:d},{onStateChange:l=>{if(p.current){p.current=!1;return}if(m.current){m.current=!1;return}R.current.push(l.value),h.current=[]}}),w=()=>{if(R.current.length===0)return;p.current=!0;const l=R.current.pop();l&&(h.current.push(ue(y.value)),y.value=l)},j=()=>{if(h.current.length===0)return;m.current=!0;const l=h.current.pop();l&&(R.current.push(ue(y.value)),y.value=l)};return{state:y.value,undo:w,redo:j}},Be=d=>{const R=N({value:d});return new Proxy(R,{get:(h,p)=>p==="value"?h.value:h.value[p],set:(h,p,m)=>(p==="value"?h.value=m:h.value[p]=m,!0)})};O.ReactiveProvider=Le,O.createReactiveStore=Ue,O.useReactive=N,O.useReactiveStore=Me,O.useReactiveUndo=Ne,O.useReactiveValue=Be,Object.defineProperty(O,Symbol.toStringTag,{value:"Module"})});
Check the top-level render call using <`+t+">.")}return r}}function je(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=vr(r);if(we[t])return;we[t]=!0;var n="";e&&e._owner&&e._owner!==ne.current&&(n=" It was passed a child from "+D(e._owner.type)+"."),W(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.',t,n),W(null)}}function xe(e,r){{if(typeof e!="object")return;if(re(e))for(var t=0;t<e.length;t++){var n=e[t];oe(n)&&je(n,r)}else if(oe(e))e._store&&(e._store.validated=!0);else if(e){var c=R(e);if(typeof c=="function"&&c!==e.entries)for(var v=c.call(e),u;!(u=v.next()).done;)oe(u.value)&&je(u.value,r)}}}function dr(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===l||r.$$typeof===x))t=r.propTypes;else return;if(t){var n=D(r);$e(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!ae){ae=!0;var c=D(r);f("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",c||"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 pr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){W(e),f("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),W(null);break}}e.ref!==null&&(W(e),f("Invalid attribute `ref` supplied to `React.Fragment`."),W(null))}}function ke(e,r,t,n,c,v){{var u=Ge(e);if(!u){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 P=lr(c);P?o+=P:o+=Oe();var b;e===null?b="null":re(e)?b="array":e!==void 0&&e.$$typeof===g?(b="<"+(D(e.type)||"Unknown")+" />",o=" Did you accidentally export a JSX literal instead of a component?"):b=typeof e,f("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",b,o)}var E=fr(e,r,t,c,v);if(E==null)return E;if(u){var k=r.children;if(k!==void 0)if(n)if(re(k)){for(var V=0;V<k.length;V++)xe(k[V],e);Object.freeze&&Object.freeze(k)}else f("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else xe(k,e)}return e===d?pr(E):dr(E),E}}function hr(e,r,t){return ke(e,r,t,!0)}function gr(e,r,t){return ke(e,r,t,!1)}var Rr=gr,br=hr;U.Fragment=d,U.jsx=Rr,U.jsxs=br}()),U}process.env.NODE_ENV==="production"?H.exports=Fe():H.exports=Ie();var We=H.exports;const Ve=(_,g)=>De.produce(_,p=>{for(const[d,m]of g){let y=p;const w=d.length;for(const j of d.slice(0,w-1))y=y[j];y[d[w-1]]=m}}),N=(_,g={})=>{const p=h.useRef(typeof _=="function"?_():_),d=h.useRef(new Map),m=h.useRef(new Map),y=h.useRef(!1),[w,j]=h.useState(!1),l=h.useCallback(a=>{if(a.some(i=>typeof i=="symbol")){for(const[i,S]of m.current)if(i.length===a.length&&i.every((R,s)=>R===a[s]))return S;return}return d.current.get(a.join("."))},[]),C=h.useCallback((a,i)=>{if(y.current=!0,a.some(S=>typeof S=="symbol")){for(const S of m.current.keys())if(!(S.length<a.length)&&S.every((R,s)=>R===a[s])){m.current.set(S,i);return}m.current.set(a,i);return}d.current.set(a.join("."),i),j(!w)},[w]),T=h.useCallback(()=>{var S;const a=[...m.current.entries()];m.current.clear();for(const[R,s]of d.current)a.push([R.split("."),s]);d.current.clear();const i=Ve(p.current,a);y.current=!1,(S=g.onStateChange)==null||S.call(g,p.current,i),p.current=i},[g.onStateChange]),x=h.useCallback((a,i=[])=>new Proxy(Object.isFrozen(a)?{...a}:a,{get(S,R){const s=l([...i,R])??S[R];return Array.isArray(s)?A(s,[...i,R]):typeof s=="object"&&s!==null?x(s,[...i,R]):s},set(S,R,s){return C([...i,R],s),!0}}),[l,C]),A=h.useCallback((a,i=[])=>new Proxy(Object.isFrozen(a)?[...a]:a,{get(S,R){const s=l([...i,R])??S[R];if(Array.isArray(s))return A(s,[...i,R]);if(typeof s=="object"&&s!==null)return x(s,[...i,R]);if(typeof s=="function")switch(R){case"push":return(...f)=>(C(i,[...a,...f]),a.length+f.length);case"pop":return()=>{const f=a.pop();return C(i,a),f};case"shift":return()=>{const f=a.shift();return C(i,a),f};case"unshift":return(...f)=>(C(i,[...f,...a]),f.length+a.length);case"splice":return(f,X,...Z)=>{const Q=a.splice(f,X,...Z);return C(i,a),Q};case"sort":return f=>(a.sort(f),C(i,a),a);case"reverse":return()=>(a.reverse(),C(i,a),a)}return s},set(S,R,s){return C([...i,R],s),!0}}),[l,C]);return y.current&&T(),x(p.current)},Ye=_=>({__Context:h.createContext(_),__initialState:_}),Ue=({children:_,store:g})=>{const p=N(g.__initialState);return We.jsx(g.__Context.Provider,{value:p,children:_})},Le=_=>h.useContext(_.__Context),Me=_=>{const g=h.useRef([]),p=h.useRef([]),d=h.useRef(!1),m=h.useRef(!1),y=N({value:_},{onStateChange:l=>{if(d.current){d.current=!1;return}if(m.current){m.current=!1;return}g.current.push(l.value),p.current=[]}}),w=()=>{if(g.current.length===0)return;d.current=!0;const l=g.current.pop();l&&(p.current.push(ue(y.value)),y.value=l)},j=()=>{if(p.current.length===0)return;m.current=!0;const l=p.current.pop();l&&(g.current.push(ue(y.value)),y.value=l)};return{state:y.value,undo:w,redo:j}},Ne=_=>{const g=N({value:_});return new Proxy(g,{get:(p,d)=>d==="value"?p.value:p.value[d],set:(p,d,m)=>(d==="value"?p.value=m:p.value[d]=m,!0)})};O.ReactiveProvider=Ue,O.createReactiveStore=Ye,O.useReactive=N,O.useReactiveStore=Le,O.useReactiveUndo=Me,O.useReactiveValue=Ne,Object.defineProperty(O,Symbol.toStringTag,{value:"Module"})});
{
"name": "react-reactive-hooks",
"version": "0.1.3",
"version": "0.1.4",
"description": "A set of React hooks for reactive programming",

@@ -39,14 +39,16 @@ "keywords": [

},
"dependencies": {},
"dependencies": {
"immer": ">=8.0.0",
"lodash.clonedeep": "^4.5.0"
},
"devDependencies": {
"@trivago/prettier-plugin-sort-imports": "^4.1.1",
"@types/lodash.clonedeep": "^4.5.7",
"@types/node": "^18.15.11",
"@types/react": "^18.0.33",
"@types/react-dom": "^18.0.11",
"@typescript-eslint/eslint-plugin": "^5.57.1",
"@typescript-eslint/parser": "^5.57.1",
"@vitejs/plugin-react": "^3.1.0",
"@types/node": "^18.16.3",
"@types/react": "^18.2.2",
"@typescript-eslint/eslint-plugin": "^5.59.2",
"@typescript-eslint/parser": "^5.59.2",
"@vitejs/plugin-react": "^4.0.0",
"cpy-cli": "^4.2.0",
"eslint": "^8.37.0",
"eslint": "^8.39.0",
"eslint-config-prettier": "^8.8.0",

@@ -57,28 +59,15 @@ "eslint-plugin-prettier": "^4.2.1",

"eslint-plugin-sort-destructure-keys": "^1.5.0",
"immer": "^9.0.21",
"lodash.clonedeep": "^4.5.0",
"prettier": "^2.8.7",
"prettier": "^2.8.8",
"prettier-plugin-packagejson": "^2.4.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"rimraf": "^4.4.1",
"typescript": "^5.0.3",
"vite": "^4.2.1",
"vite-plugin-dts": "^2.2.0",
"rimraf": "^5.0.0",
"typescript": "^5.0.4",
"vite": "^4.3.4",
"vite-plugin-dts": "^2.3.0",
"vite-plugin-linter": "^2.0.2",
"vite-tsconfig-paths": "^4.0.8"
"vite-tsconfig-paths": "^4.2.0"
},
"peerDependencies": {
"immer": ">=8.0.0",
"lodash.clonedeep": "^4.5.0",
"react": ">=16.8.0"
},
"peerDependenciesMeta": {
"immer": {
"optional": true
},
"lodash.clonedeep": {
"optional": true
}
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc