@yakocloud/state-vocab 3.1.1 → 3.1.2

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