@yakocloud/state-vocab 2.3.3 → 2.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/state-vocab.cjs.js +4 -4
- package/dist/state-vocab.es.js +176 -179
- package/package.json +1 -1
package/dist/state-vocab.cjs.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
-
`),
|
|
3
|
-
`),...
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("react"),te=Symbol("state-def"),C=Symbol("state-path"),L=Symbol("state-ssr");function fe(t,a,r){if(!a)return t;const s=a.split(".");let n=t;for(const c of s)if(n!==null&&typeof n=="object"&&c in n)n=n[c];else return r;return n===void 0?r:n}function de(t,a,r){const s=a.replace(/\[(\d+)\]/g,".$1").split(".");let n=t;for(let c=0;c<s.length-1;c++){const d=s[c],b=s[c+1];(n[d]===void 0||n[d]===null)&&(n[d]=/^\d+$/.test(b)?[]:{}),n=n[d]}return n[s[s.length-1]]=r,t}function me(t,a=0){let r;return function(...s){r!==void 0&&clearTimeout(r),r=setTimeout(()=>{r=void 0,t.apply(this,s)},a)}}function be(t,a,r=[]){return p.useMemo(()=>me(t,a),r)}function ve(t){const a=JSON.stringify(t,null,2).split(`
|
|
2
|
+
`),r=[],s=[];for(const n of a){const c=n.match(/^(\s*)"([^"]+)"(\s*:\s*)(.+)$/);if(c){const[,d,b,v,u]=c;r.push(`${d}%c"${b}"%c${v}%c${u}`),s.push("color: #9cdcfe; font-weight: bold","color: #cccccc","color: #ce9178")}else r.push(`%c${n}`),s.push("color: #cccccc")}console.log(r.join(`
|
|
3
|
+
`),...s,t)}var V={exports:{}},x={};var B;function Ee(){if(B)return x;B=1;var t=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function r(s,n,c){var d=null;if(c!==void 0&&(d=""+c),n.key!==void 0&&(d=""+n.key),"key"in n){c={};for(var b in n)b!=="key"&&(c[b]=n[b])}else c=n;return n=c.ref,{$$typeof:t,type:s,key:d,ref:n!==void 0?n:null,props:c}}return x.Fragment=a,x.jsx=r,x.jsxs=r,x}var O={};var H;function Se(){return H||(H=1,process.env.NODE_ENV!=="production"&&(function(){function t(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ue?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case h:return"Fragment";case m:return"Profiler";case k:return"StrictMode";case oe:return"Suspense";case ae:return"SuspenseList";case ce:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case g:return"Portal";case $:return e.displayName||"Context";case T:return(e._context.displayName||"Context")+".Consumer";case w:var o=e.render;return e=e.displayName,e||(e=o.displayName||o.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case se:return o=e.displayName||null,o!==null?o:t(e.type)||"Memo";case I:o=e._payload,e=e._init;try{return t(e(o))}catch{}}return null}function a(e){return""+e}function r(e){try{a(e);var o=!1}catch{o=!0}if(o){o=console;var l=o.error,i=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return l.call(o,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",i),a(e)}}function s(e){if(e===h)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===I)return"<...>";try{var o=t(e);return o?"<"+o+">":"<...>"}catch{return"<...>"}}function n(){var e=M.A;return e===null?null:e.getOwner()}function c(){return Error("react-stack-top-frame")}function d(e){if(W.call(e,"key")){var o=Object.getOwnPropertyDescriptor(e,"key").get;if(o&&o.isReactWarning)return!1}return e.key!==void 0}function b(e,o){function l(){J||(J=!0,console.error("%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://react.dev/link/special-props)",o))}l.isReactWarning=!0,Object.defineProperty(e,"key",{get:l,configurable:!0})}function v(){var e=t(this.type);return U[e]||(U[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function u(e,o,l,i,j,D){var f=l.ref;return e={$$typeof:_,type:e,key:o,props:l,_owner:i},(f!==void 0?f:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:v}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:j}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:D}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function y(e,o,l,i,j,D){var f=o.children;if(f!==void 0)if(i)if(le(f)){for(i=0;i<f.length;i++)E(f[i]);Object.freeze&&Object.freeze(f)}else console.error("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 E(f);if(W.call(o,"key")){f=t(e);var P=Object.keys(o).filter(function(ie){return ie!=="key"});i=0<P.length?"{key: someKey, "+P.join(": ..., ")+": ...}":"{key: someKey}",X[f+i]||(P=0<P.length?"{"+P.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
4
4
|
let props = %s;
|
|
5
5
|
<%s {...props} />
|
|
6
6
|
React keys must be passed directly to JSX without using spread:
|
|
7
7
|
let props = %s;
|
|
8
|
-
<%s key={someKey} {...props} />`,f,
|
|
8
|
+
<%s key={someKey} {...props} />`,i,f,P,f),X[f+i]=!0)}if(f=null,l!==void 0&&(r(l),f=""+l),d(o)&&(r(o.key),f=""+o.key),"key"in o){l={};for(var F in o)F!=="key"&&(l[F]=o[F])}else l=o;return f&&b(l,typeof e=="function"?e.displayName||e.name||"Unknown":e),u(e,f,l,n(),j,D)}function E(e){R(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===I&&(e._payload.status==="fulfilled"?R(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function R(e){return typeof e=="object"&&e!==null&&e.$$typeof===_}var S=p,_=Symbol.for("react.transitional.element"),g=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),m=Symbol.for("react.profiler"),T=Symbol.for("react.consumer"),$=Symbol.for("react.context"),w=Symbol.for("react.forward_ref"),oe=Symbol.for("react.suspense"),ae=Symbol.for("react.suspense_list"),se=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),ce=Symbol.for("react.activity"),ue=Symbol.for("react.client.reference"),M=S.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W=Object.prototype.hasOwnProperty,le=Array.isArray,Y=console.createTask?console.createTask:function(){return null};S={react_stack_bottom_frame:function(e){return e()}};var J,U={},q=S.react_stack_bottom_frame.bind(S,c)(),G=Y(s(c)),X={};O.Fragment=h,O.jsx=function(e,o,l){var i=1e4>M.recentlyCreatedOwnerStacks++;return y(e,o,l,!1,i?Error("react-stack-top-frame"):q,i?Y(s(e)):G)},O.jsxs=function(e,o,l){var i=1e4>M.recentlyCreatedOwnerStacks++;return y(e,o,l,!0,i?Error("react-stack-top-frame"):q,i?Y(s(e)):G)}})()),O}var Z;function _e(){return Z||(Z=1,process.env.NODE_ENV==="production"?V.exports=Ee():V.exports=Se()),V.exports}var pe=_e();const re=p.createContext({stateVocab:{},setStateVocab:()=>{}});function ge(){return p.useContext(re)}const Re=t=>{const{children:a,verbose:r}=t,[s,n]=p.useState({});return r&&ve(s),pe.jsx(re.Provider,{value:{stateVocab:s,setStateVocab:n},children:a})},A=(t,a)=>r=>{const s={...r};return de(s,t,a),s},Q=t=>{const{serialized:a,deserialize:r}=t;return a===null?null:r(a)},ye=t=>typeof t=="function",Te=t=>typeof t=="function",z=t=>typeof t<"u",N=t=>Te(t)?t():t,he=typeof window>"u";function ke(t={}){return{[te]:!0,[L]:!1,[C]:"",useState(a){const r=he?void 0:N(t.storage),s=t.serialize??JSON.stringify,n=t.deserialize??JSON.parse,c=t.defaultValue,d=t.bidirectional;a??={};const b=be(a.onSet??(()=>{}),a.delayedSet,[]),v=ge(),u=this[C],y=this[L],[E,R]=p.useState(!y);p.useEffect(()=>R(!0),[]);const S=p.useMemo(()=>{if(!E||!r)return;const m=r.getItem(u);return Q({deserialize:n,serialized:m})},[E]),_=p.useMemo(()=>fe(v.stateVocab,u,S??N(a.defaultValue)??c),[v.stateVocab,S]);p.useEffect(()=>{console.log("!!! value",_),z(_)&&(console.log("!!! statePath",u),console.log("!!! embed(statePath, value)",A(u,_)),v.setStateVocab(A(u,_)),console.log("!!! storage",r),console.log("!!! storedValue",S),console.log("!!! typeof storedValue",typeof S),r&&S===null&&(console.log("!!! serialize(value)",s(_)),r.setItem(u,s(_))))},[]),p.useEffect(()=>{if(!a.bidirectional&&!d)return;const m=T=>{if(T.key!==u)return;const $=T.newValue,w=Q({serialized:$,deserialize:n})??N(a.defaultValue)??c;z(w)&&(v.setStateVocab(A(u,w)),b(w,g.current),g.current=w)};return window.addEventListener("storage",m),()=>window.removeEventListener("storage",m)},[a.bidirectional,d]);const g=p.useRef(_);return[_,m=>{const T=ye(m)?m(g.current):m;v.setStateVocab(A(u,T)),b(T,g.current),r&&r.setItem(u,s(T)),g.current=T},()=>{const m=N(a.defaultValue)??c;if(!z(m)){r?.removeItem(u);return}v.setStateVocab(A(u,m)),b(m,g.current),g.current=m,r&&r.setItem(u,s(m))}]},toString(){return this[C]}}}const K=new WeakMap,ee=new WeakMap;function ne(t,a){a??={};const{path:r="",ssr:s}=a;let n=K.get(t);n||(n=new Map,K.set(t,n));const c=n.get(r);if(c)return c;const d=new Proxy(t,{get(b,v){const u=b[v],y=r?`${r}.${String(v)}`:String(v);if(u&&typeof u=="object"&&te in u){const E=u;let R=ee.get(E);R||(R=new Map,ee.set(E,R));const S=R.get(y);if(S)return S;const _=Reflect.ownKeys(E).filter(k=>typeof E[k]=="function"),g=Object.fromEntries(_.map(k=>[k,(...m)=>E[k].call({...E,[C]:y,[L]:s},...m)])),h={...E,...g};return R.set(y,h),h}return u&&typeof u=="object"?ne(u,{path:y,ssr:s}):u}});return n.set(r,d),d}function we(t,a){return ne(t,a)}exports.StorageProvider=Re;exports.defineState=ke;exports.setupStorage=we;
|
package/dist/state-vocab.es.js
CHANGED
|
@@ -1,85 +1,85 @@
|
|
|
1
1
|
import me, { useMemo as L, createContext as be, useState as re, useContext as ve, useEffect as M, useRef as Ee } from "react";
|
|
2
2
|
const ne = Symbol("state-def"), N = Symbol("state-path"), W = Symbol("state-ssr");
|
|
3
|
-
function _e(t, a,
|
|
3
|
+
function _e(t, a, r) {
|
|
4
4
|
if (!a)
|
|
5
5
|
return t;
|
|
6
|
-
const
|
|
7
|
-
let
|
|
8
|
-
for (const c of
|
|
9
|
-
if (
|
|
10
|
-
|
|
6
|
+
const s = a.split(".");
|
|
7
|
+
let n = t;
|
|
8
|
+
for (const c of s)
|
|
9
|
+
if (n !== null && typeof n == "object" && c in n)
|
|
10
|
+
n = n[c];
|
|
11
11
|
else
|
|
12
|
-
return
|
|
13
|
-
return
|
|
12
|
+
return r;
|
|
13
|
+
return n === void 0 ? r : n;
|
|
14
14
|
}
|
|
15
|
-
function pe(t, a,
|
|
16
|
-
const
|
|
17
|
-
let
|
|
18
|
-
for (let c = 0; c <
|
|
19
|
-
const
|
|
20
|
-
(
|
|
15
|
+
function pe(t, a, r) {
|
|
16
|
+
const s = a.replace(/\[(\d+)\]/g, ".$1").split(".");
|
|
17
|
+
let n = t;
|
|
18
|
+
for (let c = 0; c < s.length - 1; c++) {
|
|
19
|
+
const d = s[c], b = s[c + 1];
|
|
20
|
+
(n[d] === void 0 || n[d] === null) && (n[d] = /^\d+$/.test(b) ? [] : {}), n = n[d];
|
|
21
21
|
}
|
|
22
|
-
return
|
|
22
|
+
return n[s[s.length - 1]] = r, t;
|
|
23
23
|
}
|
|
24
24
|
function Se(t, a = 0) {
|
|
25
|
-
let
|
|
26
|
-
return function(...
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
let r;
|
|
26
|
+
return function(...s) {
|
|
27
|
+
r !== void 0 && clearTimeout(r), r = setTimeout(() => {
|
|
28
|
+
r = void 0, t.apply(this, s);
|
|
29
29
|
}, a);
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
-
function Re(t, a,
|
|
32
|
+
function Re(t, a, r = []) {
|
|
33
33
|
return L(
|
|
34
34
|
() => Se(t, a),
|
|
35
35
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
36
|
-
|
|
36
|
+
r
|
|
37
37
|
);
|
|
38
38
|
}
|
|
39
39
|
function Te(t) {
|
|
40
40
|
const a = JSON.stringify(t, null, 2).split(`
|
|
41
|
-
`),
|
|
42
|
-
for (const
|
|
43
|
-
const c =
|
|
41
|
+
`), r = [], s = [];
|
|
42
|
+
for (const n of a) {
|
|
43
|
+
const c = n.match(/^(\s*)"([^"]+)"(\s*:\s*)(.+)$/);
|
|
44
44
|
if (c) {
|
|
45
|
-
const [,
|
|
46
|
-
|
|
45
|
+
const [, d, b, v, l] = c;
|
|
46
|
+
r.push(`${d}%c"${b}"%c${v}%c${l}`), s.push(
|
|
47
47
|
"color: #9cdcfe; font-weight: bold",
|
|
48
48
|
"color: #cccccc",
|
|
49
49
|
"color: #ce9178"
|
|
50
50
|
);
|
|
51
51
|
} else
|
|
52
|
-
|
|
52
|
+
r.push(`%c${n}`), s.push("color: #cccccc");
|
|
53
53
|
}
|
|
54
|
-
console.log(
|
|
55
|
-
`), ...
|
|
54
|
+
console.log(r.join(`
|
|
55
|
+
`), ...s, t);
|
|
56
56
|
}
|
|
57
57
|
var j = { exports: {} }, P = {};
|
|
58
58
|
var H;
|
|
59
|
-
function
|
|
59
|
+
function ge() {
|
|
60
60
|
if (H) return P;
|
|
61
61
|
H = 1;
|
|
62
62
|
var t = Symbol.for("react.transitional.element"), a = Symbol.for("react.fragment");
|
|
63
|
-
function s
|
|
64
|
-
var
|
|
65
|
-
if (c !== void 0 && (
|
|
63
|
+
function r(s, n, c) {
|
|
64
|
+
var d = null;
|
|
65
|
+
if (c !== void 0 && (d = "" + c), n.key !== void 0 && (d = "" + n.key), "key" in n) {
|
|
66
66
|
c = {};
|
|
67
|
-
for (var b in
|
|
68
|
-
b !== "key" && (c[b] =
|
|
69
|
-
} else c =
|
|
70
|
-
return
|
|
67
|
+
for (var b in n)
|
|
68
|
+
b !== "key" && (c[b] = n[b]);
|
|
69
|
+
} else c = n;
|
|
70
|
+
return n = c.ref, {
|
|
71
71
|
$$typeof: t,
|
|
72
|
-
type:
|
|
73
|
-
key:
|
|
74
|
-
ref:
|
|
72
|
+
type: s,
|
|
73
|
+
key: d,
|
|
74
|
+
ref: n !== void 0 ? n : null,
|
|
75
75
|
props: c
|
|
76
76
|
};
|
|
77
77
|
}
|
|
78
|
-
return P.Fragment = a, P.jsx =
|
|
78
|
+
return P.Fragment = a, P.jsx = r, P.jsxs = r, P;
|
|
79
79
|
}
|
|
80
80
|
var x = {};
|
|
81
81
|
var Z;
|
|
82
|
-
function
|
|
82
|
+
function ye() {
|
|
83
83
|
return Z || (Z = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
84
84
|
function t(e) {
|
|
85
85
|
if (e == null) return null;
|
|
@@ -87,33 +87,33 @@ function he() {
|
|
|
87
87
|
return e.$$typeof === ie ? null : e.displayName || e.name || null;
|
|
88
88
|
if (typeof e == "string") return e;
|
|
89
89
|
switch (e) {
|
|
90
|
-
case
|
|
90
|
+
case y:
|
|
91
91
|
return "Fragment";
|
|
92
92
|
case m:
|
|
93
93
|
return "Profiler";
|
|
94
|
-
case
|
|
94
|
+
case h:
|
|
95
95
|
return "StrictMode";
|
|
96
96
|
case se:
|
|
97
97
|
return "Suspense";
|
|
98
98
|
case ce:
|
|
99
99
|
return "SuspenseList";
|
|
100
|
-
case
|
|
100
|
+
case ue:
|
|
101
101
|
return "Activity";
|
|
102
102
|
}
|
|
103
103
|
if (typeof e == "object")
|
|
104
104
|
switch (typeof e.tag == "number" && console.error(
|
|
105
105
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
106
106
|
), e.$$typeof) {
|
|
107
|
-
case
|
|
107
|
+
case S:
|
|
108
108
|
return "Portal";
|
|
109
109
|
case C:
|
|
110
110
|
return e.displayName || "Context";
|
|
111
|
-
case
|
|
111
|
+
case g:
|
|
112
112
|
return (e._context.displayName || "Context") + ".Consumer";
|
|
113
113
|
case k:
|
|
114
114
|
var o = e.render;
|
|
115
115
|
return e = e.displayName, e || (e = o.displayName || o.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
116
|
-
case
|
|
116
|
+
case le:
|
|
117
117
|
return o = e.displayName || null, o !== null ? o : t(e.type) || "Memo";
|
|
118
118
|
case $:
|
|
119
119
|
o = e._payload, e = e._init;
|
|
@@ -127,7 +127,7 @@ function he() {
|
|
|
127
127
|
function a(e) {
|
|
128
128
|
return "" + e;
|
|
129
129
|
}
|
|
130
|
-
function
|
|
130
|
+
function r(e) {
|
|
131
131
|
try {
|
|
132
132
|
a(e);
|
|
133
133
|
var o = !1;
|
|
@@ -136,16 +136,16 @@ function he() {
|
|
|
136
136
|
}
|
|
137
137
|
if (o) {
|
|
138
138
|
o = console;
|
|
139
|
-
var
|
|
140
|
-
return
|
|
139
|
+
var u = o.error, i = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
140
|
+
return u.call(
|
|
141
141
|
o,
|
|
142
142
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
143
|
-
|
|
143
|
+
i
|
|
144
144
|
), a(e);
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
|
-
function
|
|
148
|
-
if (e ===
|
|
147
|
+
function s(e) {
|
|
148
|
+
if (e === y) return "<>";
|
|
149
149
|
if (typeof e == "object" && e !== null && e.$$typeof === $)
|
|
150
150
|
return "<...>";
|
|
151
151
|
try {
|
|
@@ -155,14 +155,14 @@ function he() {
|
|
|
155
155
|
return "<...>";
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
|
-
function
|
|
158
|
+
function n() {
|
|
159
159
|
var e = I.A;
|
|
160
160
|
return e === null ? null : e.getOwner();
|
|
161
161
|
}
|
|
162
162
|
function c() {
|
|
163
163
|
return Error("react-stack-top-frame");
|
|
164
164
|
}
|
|
165
|
-
function
|
|
165
|
+
function d(e) {
|
|
166
166
|
if (J.call(e, "key")) {
|
|
167
167
|
var o = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
168
168
|
if (o && o.isReactWarning) return !1;
|
|
@@ -170,14 +170,14 @@ function he() {
|
|
|
170
170
|
return e.key !== void 0;
|
|
171
171
|
}
|
|
172
172
|
function b(e, o) {
|
|
173
|
-
function
|
|
173
|
+
function u() {
|
|
174
174
|
U || (U = !0, console.error(
|
|
175
175
|
"%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://react.dev/link/special-props)",
|
|
176
176
|
o
|
|
177
177
|
));
|
|
178
178
|
}
|
|
179
|
-
|
|
180
|
-
get:
|
|
179
|
+
u.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
180
|
+
get: u,
|
|
181
181
|
configurable: !0
|
|
182
182
|
});
|
|
183
183
|
}
|
|
@@ -187,15 +187,15 @@ function he() {
|
|
|
187
187
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
188
188
|
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
189
189
|
}
|
|
190
|
-
function
|
|
191
|
-
var
|
|
190
|
+
function l(e, o, u, i, O, D) {
|
|
191
|
+
var f = u.ref;
|
|
192
192
|
return e = {
|
|
193
|
-
$$typeof:
|
|
193
|
+
$$typeof: p,
|
|
194
194
|
type: e,
|
|
195
195
|
key: o,
|
|
196
|
-
props:
|
|
197
|
-
_owner:
|
|
198
|
-
}, (
|
|
196
|
+
props: u,
|
|
197
|
+
_owner: i
|
|
198
|
+
}, (f !== void 0 ? f : null) !== null ? Object.defineProperty(e, "ref", {
|
|
199
199
|
enumerable: !1,
|
|
200
200
|
get: v
|
|
201
201
|
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
@@ -220,100 +220,100 @@ function he() {
|
|
|
220
220
|
value: D
|
|
221
221
|
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
222
222
|
}
|
|
223
|
-
function T(e, o,
|
|
224
|
-
var
|
|
225
|
-
if (
|
|
226
|
-
if (
|
|
227
|
-
if (fe(
|
|
228
|
-
for (
|
|
229
|
-
E(
|
|
230
|
-
Object.freeze && Object.freeze(
|
|
223
|
+
function T(e, o, u, i, O, D) {
|
|
224
|
+
var f = o.children;
|
|
225
|
+
if (f !== void 0)
|
|
226
|
+
if (i)
|
|
227
|
+
if (fe(f)) {
|
|
228
|
+
for (i = 0; i < f.length; i++)
|
|
229
|
+
E(f[i]);
|
|
230
|
+
Object.freeze && Object.freeze(f);
|
|
231
231
|
} else
|
|
232
232
|
console.error(
|
|
233
233
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
234
234
|
);
|
|
235
|
-
else E(
|
|
235
|
+
else E(f);
|
|
236
236
|
if (J.call(o, "key")) {
|
|
237
|
-
|
|
237
|
+
f = t(e);
|
|
238
238
|
var w = Object.keys(o).filter(function(de) {
|
|
239
239
|
return de !== "key";
|
|
240
240
|
});
|
|
241
|
-
|
|
241
|
+
i = 0 < w.length ? "{key: someKey, " + w.join(": ..., ") + ": ...}" : "{key: someKey}", B[f + i] || (w = 0 < w.length ? "{" + w.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
242
242
|
`A props object containing a "key" prop is being spread into JSX:
|
|
243
243
|
let props = %s;
|
|
244
244
|
<%s {...props} />
|
|
245
245
|
React keys must be passed directly to JSX without using spread:
|
|
246
246
|
let props = %s;
|
|
247
247
|
<%s key={someKey} {...props} />`,
|
|
248
|
+
i,
|
|
248
249
|
f,
|
|
249
|
-
d,
|
|
250
250
|
w,
|
|
251
|
-
|
|
252
|
-
), B[
|
|
251
|
+
f
|
|
252
|
+
), B[f + i] = !0);
|
|
253
253
|
}
|
|
254
|
-
if (
|
|
255
|
-
|
|
254
|
+
if (f = null, u !== void 0 && (r(u), f = "" + u), d(o) && (r(o.key), f = "" + o.key), "key" in o) {
|
|
255
|
+
u = {};
|
|
256
256
|
for (var F in o)
|
|
257
|
-
F !== "key" && (
|
|
258
|
-
} else
|
|
259
|
-
return
|
|
260
|
-
|
|
257
|
+
F !== "key" && (u[F] = o[F]);
|
|
258
|
+
} else u = o;
|
|
259
|
+
return f && b(
|
|
260
|
+
u,
|
|
261
261
|
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
262
|
-
),
|
|
262
|
+
), l(
|
|
263
263
|
e,
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
264
|
+
f,
|
|
265
|
+
u,
|
|
266
|
+
n(),
|
|
267
267
|
O,
|
|
268
268
|
D
|
|
269
269
|
);
|
|
270
270
|
}
|
|
271
271
|
function E(e) {
|
|
272
|
-
|
|
272
|
+
R(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === $ && (e._payload.status === "fulfilled" ? R(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
|
|
273
273
|
}
|
|
274
|
-
function
|
|
275
|
-
return typeof e == "object" && e !== null && e.$$typeof ===
|
|
274
|
+
function R(e) {
|
|
275
|
+
return typeof e == "object" && e !== null && e.$$typeof === p;
|
|
276
276
|
}
|
|
277
|
-
var
|
|
277
|
+
var _ = me, p = Symbol.for("react.transitional.element"), S = Symbol.for("react.portal"), y = Symbol.for("react.fragment"), h = Symbol.for("react.strict_mode"), m = Symbol.for("react.profiler"), g = Symbol.for("react.consumer"), C = Symbol.for("react.context"), k = Symbol.for("react.forward_ref"), se = Symbol.for("react.suspense"), ce = Symbol.for("react.suspense_list"), le = Symbol.for("react.memo"), $ = Symbol.for("react.lazy"), ue = Symbol.for("react.activity"), ie = Symbol.for("react.client.reference"), I = _.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, J = Object.prototype.hasOwnProperty, fe = Array.isArray, Y = console.createTask ? console.createTask : function() {
|
|
278
278
|
return null;
|
|
279
279
|
};
|
|
280
|
-
|
|
280
|
+
_ = {
|
|
281
281
|
react_stack_bottom_frame: function(e) {
|
|
282
282
|
return e();
|
|
283
283
|
}
|
|
284
284
|
};
|
|
285
|
-
var U, q = {}, G =
|
|
286
|
-
|
|
285
|
+
var U, q = {}, G = _.react_stack_bottom_frame.bind(
|
|
286
|
+
_,
|
|
287
287
|
c
|
|
288
|
-
)(), X = Y(
|
|
289
|
-
x.Fragment =
|
|
290
|
-
var
|
|
288
|
+
)(), X = Y(s(c)), B = {};
|
|
289
|
+
x.Fragment = y, x.jsx = function(e, o, u) {
|
|
290
|
+
var i = 1e4 > I.recentlyCreatedOwnerStacks++;
|
|
291
291
|
return T(
|
|
292
292
|
e,
|
|
293
293
|
o,
|
|
294
|
-
|
|
294
|
+
u,
|
|
295
295
|
!1,
|
|
296
|
-
|
|
297
|
-
|
|
296
|
+
i ? Error("react-stack-top-frame") : G,
|
|
297
|
+
i ? Y(s(e)) : X
|
|
298
298
|
);
|
|
299
|
-
}, x.jsxs = function(e, o,
|
|
300
|
-
var
|
|
299
|
+
}, x.jsxs = function(e, o, u) {
|
|
300
|
+
var i = 1e4 > I.recentlyCreatedOwnerStacks++;
|
|
301
301
|
return T(
|
|
302
302
|
e,
|
|
303
303
|
o,
|
|
304
|
-
|
|
304
|
+
u,
|
|
305
305
|
!0,
|
|
306
|
-
|
|
307
|
-
|
|
306
|
+
i ? Error("react-stack-top-frame") : G,
|
|
307
|
+
i ? Y(s(e)) : X
|
|
308
308
|
);
|
|
309
309
|
};
|
|
310
310
|
})()), x;
|
|
311
311
|
}
|
|
312
312
|
var Q;
|
|
313
|
-
function
|
|
314
|
-
return Q || (Q = 1, process.env.NODE_ENV === "production" ? j.exports =
|
|
313
|
+
function he() {
|
|
314
|
+
return Q || (Q = 1, process.env.NODE_ENV === "production" ? j.exports = ge() : j.exports = ye()), j.exports;
|
|
315
315
|
}
|
|
316
|
-
var ke =
|
|
316
|
+
var ke = he();
|
|
317
317
|
const oe = be({
|
|
318
318
|
stateVocab: {},
|
|
319
319
|
setStateVocab: () => {
|
|
@@ -323,17 +323,16 @@ function we() {
|
|
|
323
323
|
return ve(oe);
|
|
324
324
|
}
|
|
325
325
|
const je = (t) => {
|
|
326
|
-
const { children: a, verbose:
|
|
327
|
-
return
|
|
328
|
-
},
|
|
329
|
-
const
|
|
330
|
-
return pe(
|
|
326
|
+
const { children: a, verbose: r } = t, [s, n] = re({});
|
|
327
|
+
return r && Te(s), /* @__PURE__ */ ke.jsx(oe.Provider, { value: { stateVocab: s, setStateVocab: n }, children: a });
|
|
328
|
+
}, A = (t, a) => (r) => {
|
|
329
|
+
const s = { ...r };
|
|
330
|
+
return pe(s, t, a), s;
|
|
331
331
|
}, K = (t) => {
|
|
332
|
-
const { serialized: a, deserialize:
|
|
333
|
-
return a === null ? null :
|
|
334
|
-
}, Pe = (t) => typeof t == "function", xe = (t) => typeof t == "function", z = (t) => typeof t < "u",
|
|
332
|
+
const { serialized: a, deserialize: r } = t;
|
|
333
|
+
return a === null ? null : r(a);
|
|
334
|
+
}, Pe = (t) => typeof t == "function", xe = (t) => typeof t == "function", z = (t) => typeof t < "u", V = (t) => xe(t) ? t() : t, Ae = typeof window > "u";
|
|
335
335
|
function Ve(t = {}) {
|
|
336
|
-
const a = Ae ? void 0 : A(t.storage), s = t.bidirectional;
|
|
337
336
|
return {
|
|
338
337
|
[ne]: !0,
|
|
339
338
|
// marks this object as a leaf in the router tree
|
|
@@ -341,74 +340,72 @@ function Ve(t = {}) {
|
|
|
341
340
|
// placeholder; injected at runtime by injectPaths()
|
|
342
341
|
[N]: "",
|
|
343
342
|
// placeholder; injected at runtime by injectPaths()
|
|
344
|
-
useState(
|
|
345
|
-
const r = t.serialize ?? JSON.stringify,
|
|
346
|
-
|
|
343
|
+
useState(a) {
|
|
344
|
+
const r = Ae ? void 0 : V(t.storage), s = t.serialize ?? JSON.stringify, n = t.deserialize ?? JSON.parse, c = t.defaultValue, d = t.bidirectional;
|
|
345
|
+
a ??= {};
|
|
347
346
|
const b = Re(
|
|
348
|
-
|
|
347
|
+
a.onSet ?? (() => {
|
|
349
348
|
}),
|
|
350
|
-
|
|
349
|
+
a.delayedSet,
|
|
351
350
|
[]
|
|
352
|
-
), v = we(),
|
|
353
|
-
M(() =>
|
|
354
|
-
const
|
|
351
|
+
), v = we(), l = this[N], T = this[W], [E, R] = re(!T);
|
|
352
|
+
M(() => R(!0), []);
|
|
353
|
+
const _ = L(
|
|
355
354
|
() => {
|
|
356
|
-
if (!E || !
|
|
355
|
+
if (!E || !r)
|
|
357
356
|
return;
|
|
358
|
-
const m =
|
|
359
|
-
return K({ deserialize:
|
|
357
|
+
const m = r.getItem(l);
|
|
358
|
+
return K({ deserialize: n, serialized: m });
|
|
360
359
|
},
|
|
361
360
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
362
361
|
[E]
|
|
363
|
-
),
|
|
362
|
+
), p = L(
|
|
364
363
|
() => _e(
|
|
365
364
|
v.stateVocab,
|
|
366
|
-
|
|
365
|
+
l,
|
|
367
366
|
// 3rd argument in order to avoid waiting for useEffect execution
|
|
368
|
-
|
|
367
|
+
_ ?? V(a.defaultValue) ?? c
|
|
369
368
|
),
|
|
370
369
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
371
370
|
[
|
|
372
371
|
v.stateVocab,
|
|
373
|
-
|
|
374
|
-
u
|
|
372
|
+
_
|
|
375
373
|
]
|
|
376
374
|
);
|
|
377
375
|
M(
|
|
378
376
|
() => {
|
|
379
|
-
z(
|
|
377
|
+
console.log("!!! value", p), z(p) && (console.log("!!! statePath", l), console.log("!!! embed(statePath, value)", A(l, p)), v.setStateVocab(A(l, p)), console.log("!!! storage", r), console.log("!!! storedValue", _), console.log("!!! typeof storedValue", typeof _), r && _ === null && (console.log("!!! serialize(value)", s(p)), r.setItem(l, s(p))));
|
|
380
378
|
},
|
|
381
379
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
382
|
-
[
|
|
380
|
+
[]
|
|
383
381
|
), M(() => {
|
|
384
|
-
if (!
|
|
382
|
+
if (!a.bidirectional && !d)
|
|
385
383
|
return;
|
|
386
|
-
const m = (
|
|
387
|
-
if (
|
|
384
|
+
const m = (g) => {
|
|
385
|
+
if (g.key !== l)
|
|
388
386
|
return;
|
|
389
|
-
const C =
|
|
390
|
-
z(k) && (v.setStateVocab(
|
|
387
|
+
const C = g.newValue, k = K({ serialized: C, deserialize: n }) ?? V(a.defaultValue) ?? c;
|
|
388
|
+
z(k) && (v.setStateVocab(A(l, k)), b(k, S.current), S.current = k);
|
|
391
389
|
};
|
|
392
390
|
return window.addEventListener("storage", m), () => window.removeEventListener("storage", m);
|
|
393
391
|
}, [
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
s
|
|
392
|
+
a.bidirectional,
|
|
393
|
+
d
|
|
397
394
|
]);
|
|
398
|
-
const
|
|
395
|
+
const S = Ee(p);
|
|
399
396
|
return [
|
|
400
|
-
|
|
397
|
+
p,
|
|
401
398
|
(m) => {
|
|
402
|
-
const
|
|
403
|
-
v.setStateVocab(
|
|
399
|
+
const g = Pe(m) ? m(S.current) : m;
|
|
400
|
+
v.setStateVocab(A(l, g)), b(g, S.current), r && r.setItem(l, s(g)), S.current = g;
|
|
404
401
|
},
|
|
405
402
|
() => {
|
|
406
|
-
const m =
|
|
403
|
+
const m = V(a.defaultValue) ?? c;
|
|
407
404
|
if (!z(m)) {
|
|
408
|
-
|
|
405
|
+
r?.removeItem(l);
|
|
409
406
|
return;
|
|
410
407
|
}
|
|
411
|
-
v.setStateVocab(
|
|
408
|
+
v.setStateVocab(A(l, m)), b(m, S.current), S.current = m, r && r.setItem(l, s(m));
|
|
412
409
|
}
|
|
413
410
|
];
|
|
414
411
|
},
|
|
@@ -422,48 +419,48 @@ const ee = /* @__PURE__ */ new WeakMap(), te = /* @__PURE__ */ new WeakMap();
|
|
|
422
419
|
function ae(t, a) {
|
|
423
420
|
a ??= {};
|
|
424
421
|
const {
|
|
425
|
-
path:
|
|
426
|
-
ssr:
|
|
422
|
+
path: r = "",
|
|
423
|
+
ssr: s
|
|
427
424
|
} = a;
|
|
428
|
-
let
|
|
429
|
-
|
|
430
|
-
const c =
|
|
425
|
+
let n = ee.get(t);
|
|
426
|
+
n || (n = /* @__PURE__ */ new Map(), ee.set(t, n));
|
|
427
|
+
const c = n.get(r);
|
|
431
428
|
if (c)
|
|
432
429
|
return c;
|
|
433
|
-
const
|
|
430
|
+
const d = new Proxy(t, {
|
|
434
431
|
get(b, v) {
|
|
435
|
-
const
|
|
436
|
-
if (
|
|
437
|
-
const E =
|
|
438
|
-
let
|
|
439
|
-
|
|
440
|
-
const
|
|
441
|
-
if (
|
|
442
|
-
return
|
|
443
|
-
const
|
|
444
|
-
(
|
|
445
|
-
),
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
(...m) => E[
|
|
432
|
+
const l = b[v], T = r ? `${r}.${String(v)}` : String(v);
|
|
433
|
+
if (l && typeof l == "object" && ne in l) {
|
|
434
|
+
const E = l;
|
|
435
|
+
let R = te.get(E);
|
|
436
|
+
R || (R = /* @__PURE__ */ new Map(), te.set(E, R));
|
|
437
|
+
const _ = R.get(T);
|
|
438
|
+
if (_)
|
|
439
|
+
return _;
|
|
440
|
+
const p = Reflect.ownKeys(E).filter(
|
|
441
|
+
(h) => typeof E[h] == "function"
|
|
442
|
+
), S = Object.fromEntries(
|
|
443
|
+
p.map((h) => [
|
|
444
|
+
h,
|
|
445
|
+
(...m) => E[h].call(
|
|
449
446
|
{
|
|
450
447
|
...E,
|
|
451
448
|
[N]: T,
|
|
452
|
-
[W]:
|
|
449
|
+
[W]: s
|
|
453
450
|
},
|
|
454
451
|
...m
|
|
455
452
|
)
|
|
456
453
|
])
|
|
457
|
-
),
|
|
458
|
-
return
|
|
454
|
+
), y = { ...E, ...S };
|
|
455
|
+
return R.set(T, y), y;
|
|
459
456
|
}
|
|
460
|
-
return
|
|
457
|
+
return l && typeof l == "object" ? ae(l, {
|
|
461
458
|
path: T,
|
|
462
|
-
ssr:
|
|
463
|
-
}) :
|
|
459
|
+
ssr: s
|
|
460
|
+
}) : l;
|
|
464
461
|
}
|
|
465
462
|
});
|
|
466
|
-
return
|
|
463
|
+
return n.set(r, d), d;
|
|
467
464
|
}
|
|
468
465
|
function Ne(t, a) {
|
|
469
466
|
return ae(t, a);
|