react-global-state-hooks 7.0.2 → 7.0.3

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/createContext.js CHANGED
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):"object"==typeof exports?exports["react-global-state-hooks"]=e(require("react")):t["react-global-state-hooks"]=e(t.react)}(this,(t=>{return e={564:(t,e,r)=>{"use strict";var n=Object.create?function(t,e,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);o&&!("get"in o?!e.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]},o=function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),o(r(212),e)},212:function(t,e,r){var n;n=t=>(()=>{var e={774:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,s=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(t){s=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return u}}(t,e)||i(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){if(t){if("string"==typeof t)return a(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(t,e):void 0}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function u(){u=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),u=new C(n||[]);return o(a,"_invoke",{value:j(t,r,u)}),a}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=f;var p={};function v(){}function h(){}function b(){}var y={};l(y,a,(function(){return this}));var g=Object.getPrototypeOf,m=g&&g(g(E([])));m&&m!==e&&r.call(m,a)&&(y=m);var S=b.prototype=v.prototype=Object.create(y);function w(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function i(o,a,u,c){var s=d(t[o],t,a);if("throw"!==s.type){var l=s.arg,f=l.value;return f&&"object"==n(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){i("next",t,u,c)}),(function(t){i("throw",t,u,c)})):e.resolve(f).then((function(t){l.value=t,u(l)}),(function(t){return i("throw",t,u,c)}))}c(s.arg)}var a;o(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){i(t,r,e,n)}))}return a=a?a.then(n,n):n()}})}function j(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=x(a,r);if(u){if(u===p)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=d(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===p)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function x(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),p;var o=d(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,p;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,p):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,p)}function _(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function E(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:M}}function M(){return{value:void 0,done:!0}}return h.prototype=b,o(S,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:h,configurable:!0}),h.displayName=l(b,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,l(t,s,"GeneratorFunction")),t.prototype=Object.create(S),t},t.awrap=function(t){return{__await:t}},w(O.prototype),l(O.prototype,c,(function(){return this})),t.AsyncIterator=O,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new O(f(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},w(S),l(S,s,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=E,C.prototype={constructor:C,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(k),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(u&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,p):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),p},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;k(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:E(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},t}function c(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,s(n.key),n)}}function s(t){var e=function(t,e){if("object"!==n(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,"string");if("object"!==n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===n(e)?e:String(e)}Object.defineProperty(e,"__esModule",{value:!0}),e.GlobalStore=void 0;var l=r(156),f=r(244),d=r(125),p=r(281),v=r(143),h=r(561),b=r(400),y=r(157),g=r(605),m=r(383),S=function(){function t(e){var r=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{metadata:{}};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.actionsConfig=null,this.callbacks=null,this.actions=null,this.subscribers=new Map,this.initialize=function(){return function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))}(r,void 0,void 0,u().mark((function t(){var e,r,n,o,i,a;return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(Object.keys(null!==(e=this.actionsConfig)&&void 0!==e?e:{}).length>0&&(this.actions=this.getStoreActionsMap()),n=this.onInit,o=null!==(r=this.callbacks)&&void 0!==r?r:{},i=o.onInit,n||i){t.next=6;break}return t.abrupt("return");case 6:a=this.getConfigCallbackParam(),null==n||n(a),(0,d.isNil)(i)||null==i||i(a);case 9:case"end":return t.stop()}}),t,this)})))},this.executeSetStateForSubscriber=function(t,e){var n,o,i=t.selector,a=t.callback,u=t.currentState,c=t.config;if(!e.forceUpdate&&(null!==(n=null==c?void 0:c.isEqualRoot)&&void 0!==n?n:function(t,e){return t===e})(e.currentRootState,e.newRootState))return{didUpdate:!1};var s=i?i(e.newRootState):e.newRootState;return!e.forceUpdate&&(null!==(o=null==c?void 0:c.isEqual)&&void 0!==o?o:function(t,e){return t===e})(u,s)?{didUpdate:!1}:(r.partialUpdateSubscription(t.subscriptionId,{currentState:s}),a({state:s},{identifier:e.identifier}),{didUpdate:!0})},this.setState=function(t,e){var n=t.state,o=e.forceUpdate,a=e.identifier,u=r.stateWrapper.state;if(o||u!==n){r.stateWrapper={state:n};var c,s={forceUpdate:o,newRootState:n,currentRootState:u,identifier:a},l=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=i(t))){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,u=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return u=t.done,t},e:function(t){c=!0,a=t},f:function(){try{u||null==r.return||r.return()}finally{if(c)throw a}}}}(r.subscribers.values());try{for(l.s();!(c=l.n()).done;){var f=c.value;r.executeSetStateForSubscriber(f,s)}}catch(t){l.e(t)}finally{l.f()}}},this.setMetadata=function(t){var e=(0,f.isFunction)(t)?t(r.metadata):t;r.metadata=e},this.getMetadata=function(){return r.metadata},this.getState=function(t,e,n){var o;if(!t)return r.stateWrapper.state;var i=(0,f.isFunction)(e),a=i?t:void 0,u=i?e:t,c=null!==(o=i?n:e)&&void 0!==o?o:void 0,s=a?a(r.stateWrapper.state):r.stateWrapper.state;(null==c?void 0:c.skipFirst)||u(s);var l=(0,y.uniqueId)("gs:");return r.setOrUpdateSubscription({subscriptionId:l,selector:a,config:c,currentState:s,callback:function(t){var e=t.state;return u(e)},isSetStateCallback:!1}),function(){r.subscribers.delete(l)}},this.getConfigCallbackParam=function(){var t=r.setMetadata,e=r.getMetadata,n=r.getState,o=r.actions;return{setMetadata:t,getMetadata:e,getState:n,setState:r.setStateWrapper,actions:o}},this.lastSubscriptionId=null,this.setOrUpdateSubscription=function(t){var e=t.subscriptionId;if(!e)return{isNewSubscription:!1};var n=r.subscribers.get(e);return(0,v.isRecord)(n)?(Object.assign(n,t),{isNewSubscription:!1}):(r.executeOnSubscribed(),r.subscribers.set(e,t),r.lastSubscriptionId=e,{isNewSubscription:!0})},this.partialUpdateSubscription=function(t,e){var n=r.subscribers.get(t);(0,v.isRecord)(n)&&Object.assign(n,e)},this.executeOnSubscribed=function(){var t,e=r.onSubscribed,n=null===(t=r.callbacks)||void 0===t?void 0:t.onSubscribed;if(e||n){var o=r.getConfigCallbackParam();null==e||e(o),null==n||n(o)}},this.getHook=function(){var t=function(t){var e,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=(0,m.useConstantValueRef)((function(){return{subscriptionId:null,tempInitialRootState:r.stateWrapper.state}})),u=function(){return t?{state:t(r.stateWrapper.state)}:r.stateWrapper},c=o((0,l.useState)(u),2),s=c[0],f=c[1];(0,l.useEffect)((function(){if(!(0,d.isNil)(a.current)){(0,d.isNil)(a.current.subscriptionId)&&(a.current.subscriptionId=(0,y.uniqueId)("ss:"));var e=a.current.subscriptionId,n={subscriptionId:e,currentState:s.state,selector:t,config:i,callback:f,isSetStateCallback:!0};return r.setOrUpdateSubscription(n).isNewSubscription&&(r.executeSetStateForSubscriber(n,{forceUpdate:!1,newRootState:r.stateWrapper.state,currentRootState:a.current.tempInitialRootState,identifier:"on mount state update"}),a.current.tempInitialRootState=g.uniqueSymbol),function(){r.subscribers.delete(e)}}}),[]);var v=(0,p.isString)(null===(e=a.current)||void 0===e?void 0:e.subscriptionId)?a.current.subscriptionId:"",h=r.subscribers.get(v),b=(null!==(n=null==h?void 0:h.config)&&void 0!==n?n:{dependencies:i.dependencies}).dependencies;return r.partialUpdateSubscription(v,{currentState:s.state,selector:t,config:i,callback:f}),[r.computeSelectedState({selector:t,subscriptionId:v,config:i,currentDependencies:b,computeChildState:u,stateWrapperRef:s}),r.getStateOrchestrator(),r.metadata]};return t.stateControls=r.stateControls,t.createSelectorHook=r.createSelectorHook,t.createObservable=r.createObservable,t},this.computeSelectedState=function(t){var e=t.selector,n=t.subscriptionId,o=t.config,i=t.currentDependencies,a=t.computeChildState,u=t.stateWrapperRef;if(!e||!n)return u.state;var c=o.dependencies;if(i===c)return u.state;if((null==i?void 0:i.length)===(null==c?void 0:c.length)&&(0,h.shallowCompare)(i,c))return u.state;var s=a().state;return r.partialUpdateSubscription(n,{currentState:s}),u.state=s,s},this.createSelectorHook=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.isEqualRoot,a=n.isEqual,u=n.name,c=o(r.stateControls(),3),s=c[0],l=c[1],d=c[2],p=s(),v=(null!=e?e:function(t){return t})(p),h=new t(v,{name:null!=u?u:(0,y.uniqueId)("sh:")}),b=o(h.stateControls(),2),g=b[0],m=b[1];s((function(t){if(!(null!=i?i:Object.is)(p,t)){p=t;var r=e(t);(null!=a?a:Object.is)(v,r)||(v=r,m(r))}}),{skipFirst:!0});var S=h.getHook(),w=function(t,e){return[o((0,f.isFunction)(t)?S(t,e):S(),1)[0],l,d]};return w.stateControls=function(){return[g,l,d]},w.createSelectorHook=r.createSelectorHook.bind(w),w.createObservable=r.createObservable.bind(w),w},this.stateControls=function(){var t=r.getStateOrchestrator(),e=r.getMetadata;return[r.getState,t,e]},this.getStateOrchestrator=function(){return r.actions?r.actions:r.setStateWrapper},this.setStateWrapper=function(t){var e,n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=o.forceUpdate,a=o.identifier,u=r.stateWrapper.state,c=(0,f.isFunction)(t)?t(u):t;if(i||r.stateWrapper.state!==c){var s=r.setMetadata,l=r.getMetadata,d=r.getState,p=r.actions,v={setMetadata:s,getMetadata:l,setState:r.setState,getState:d,actions:p,previousState:u,state:c,identifier:a},h=r.computePreventStateChange,b=null===(e=r.callbacks)||void 0===e?void 0:e.computePreventStateChange;if((h||b)&&((null==h?void 0:h(v))||(null==b?void 0:b(v))))return;r.setState({state:c},{forceUpdate:i,identifier:a});var y=r.onStateChanged,g=null===(n=r.callbacks)||void 0===n?void 0:n.onStateChanged;(y||g)&&(null==y||y(v),null==g||g(v))}},this.getStoreActionsMap=function(){if(!(0,v.isRecord)(r.actionsConfig))return null;var t=r.actionsConfig,e=r.setMetadata,n=r.setStateWrapper,o=r.getState,i=r.getMetadata,a=Object.keys(t).reduce((function(r,u){var c,l,f;return Object.assign(r,(c={},f=function(){for(var r=t[u],c=arguments.length,s=new Array(c),l=0;l<c;l++)s[l]=arguments[l];var f=r.apply(a,s);return"function"!=typeof f&&(0,b.throwWrongKeyOnActionCollectionConfig)(u),f.call(a,{setState:n,getState:o,setMetadata:e,getMetadata:i,actions:a})},(l=s(l=u))in c?Object.defineProperty(c,l,{value:f,enumerable:!0,configurable:!0,writable:!0}):c[l]=f,c)),r}),{});return a};var a=n.metadata,c=n.callbacks,S=n.actions,w=n.name;this.stateWrapper={state:e},this._name=null!=w?w:(0,y.uniqueId)("gs:"),this.metadata=null!=a?a:{},this.callbacks=null!=c?c:null,this.actionsConfig=null!=S?S:null,(null===globalThis||void 0===globalThis?void 0:globalThis.REACT_GLOBAL_STATE_HOOK_DEBUG)&&globalThis.REACT_GLOBAL_STATE_HOOK_DEBUG(this),this.constructor!==t||this.initialize()}var e,r;return e=t,r=[{key:"createObservable",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.isEqualRoot,n=e.isEqual,i=e.name,a=o(this.stateControls(),1)[0],u=[],c=a(),s=(null!=t?t:function(t){return t})(a());a((function(e){if(!(null!=r?r:Object.is)(c,e)){c=e;var o=t(e);(null!=n?n:Object.is)(s,o)||(s=o,u.forEach((function(t){return t()})))}}),{skipFirst:!0});var l=function(t,e,r){var n;if(!t)return s;var o=(0,f.isFunction)(e),i=o?t:void 0,a=o?e:t,c=null!==(n=o?r:e)&&void 0!==n?n:void 0,l=function(){return a(i?i(s):s)};(null==c?void 0:c.skipFirst)||l();var d=function(){l()};return u.push(d),function(){u.splice(u.indexOf(d),1)}};return l._name=null!=i?i:(0,y.uniqueId)("ob:"),l.createObservable=this.createObservable.bind(l),l.stateControls=function(){return[l]},l}}],r&&c(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();e.GlobalStore=S},143:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.isRecord=void 0;var o=r(125);e.isRecord=function(t){return!(0,o.isNil)(t)&&"object"===n(t)}},561:(t,e,r)=>{"use strict";function n(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,s=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(t){s=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return u}}(t,e)||i(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=i(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,u=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return u=t.done,t},e:function(t){c=!0,a=t},f:function(){try{u||null==r.return||r.return()}finally{if(c)throw a}}}}function i(t,e){if(t){if("string"==typeof t)return a(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(t,e):void 0}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function u(t){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.shallowCompare=void 0;var c=r(416),s=r(231),l=r(125),f=r(143);e.shallowCompare=function(t,e){if(t===e)return!0;var r=u(t),i=u(e);if(r!==i)return!1;if((0,l.isNil)(t)||(0,l.isNil)(e)||(0,c.isPrimitive)(t)&&(0,c.isPrimitive)(e)||(0,s.isDate)(t)&&(0,s.isDate)(e)||"function"===r&&"function"===i)return t===e;if(Array.isArray(t)){var a=t,d=e;if(a.length!==d.length)return!1;for(var p=0;p<a.length;p++)if(a[p]!==d[p])return!1}if(t instanceof Map){var v=t,h=e;if(v.size!==h.size)return!1;var b,y=o(v);try{for(y.s();!(b=y.n()).done;){var g=n(b.value,2),m=g[0];if(g[1]!==h.get(m))return!1}}catch(t){y.e(t)}finally{y.f()}}if(t instanceof Set){var S=t,w=e;if(S.size!==w.size)return!1;var O,j=o(S);try{for(j.s();!(O=j.n()).done;){var x=O.value;if(!w.has(x))return!1}}catch(t){j.e(t)}finally{j.f()}}if(!(0,f.isRecord)(t)||!(0,f.isRecord)(e))return t===e;var _=Object.keys(t),k=Object.keys(e);if(_.length!==k.length)return!1;for(var C=0,E=_;C<E.length;C++){var M=E[C];if(t[M]!==e[M])return!1}return!0}},400:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.throwWrongKeyOnActionCollectionConfig=void 0,e.throwWrongKeyOnActionCollectionConfig=function(t){throw new Error("[WRONG CONFIGURATION!]: Every key inside the storeActionsConfig must be a higher order function that returns a function \n[".concat(t,"]: key is not a valid function, try something like this: \n{\n\n ").concat(t,": (param) => ({ setState, getState, setMetadata, getMetadata, actions }) => {\n\n setState((state) => ({ ...state, ...param }))\n\n }\n\n}\n"))}},157:(t,e)=>{"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.uniqueId=void 0,e.uniqueId=(r=0,function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return r===Number.MAX_SAFE_INTEGER&&(r=0),t+Date.now().toString(36)+(r++).toString(36)})},605:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.uniqueSymbol=void 0,e.uniqueSymbol=Symbol("unique")},383:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useConstantValueRef=void 0;var n=r(156),o=r(605);e.useConstantValueRef=function(t){var e=(0,n.useRef)(o.uniqueSymbol);return e.current===o.uniqueSymbol&&(e.current=t()),e}},231:function(t){t.exports=(()=>{"use strict";var t={};return(()=>{var e=t;Object.defineProperty(e,"__esModule",{value:!0}),e.isDate=void 0,e.isDate=function(t){return t instanceof Date}})(),t})()},244:function(t){t.exports=(()=>{"use strict";var t={};return(()=>{var e=t;Object.defineProperty(e,"__esModule",{value:!0}),e.isFunction=void 0,e.isFunction=function(t){return"function"==typeof t||t instanceof Function}})(),t})()},125:function(t){t.exports=(()=>{"use strict";var t={};return(()=>{var e=t;Object.defineProperty(e,"__esModule",{value:!0}),e.isNil=void 0,e.isNil=function(t){return null==t}})(),t})()},416:function(t){t.exports=(()=>{"use strict";var t={112:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isBoolean=void 0,e.isBoolean=function(t){return"boolean"==typeof t}},243:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isNil=void 0,e.isNil=function(t){return null==t}},11:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isNumber=void 0,e.isNumber=function(t){return"number"==typeof t}},671:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isString=void 0,e.isString=function(t){return"string"==typeof t}}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}var n={};return(()=>{var t=n;function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}Object.defineProperty(t,"__esModule",{value:!0}),t.isPrimitive=void 0;var o=r(112),i=r(243),a=r(11),u=r(671);t.isPrimitive=function(t){return(0,i.isNil)(t)||(0,a.isNumber)(t)||(0,o.isBoolean)(t)||(0,u.isString)(t)||"symbol"===e(t)}})(),n})()},281:function(t){t.exports=(()=>{"use strict";var t={};return(()=>{var e=t;Object.defineProperty(e,"__esModule",{value:!0}),e.isString=void 0,e.isString=function(t){return"string"==typeof t}})(),t})()},156:e=>{"use strict";e.exports=t}},r={};function n(t){var o=r[t];if(void 0!==o)return o.exports;var i=r[t]={exports:{}};return e[t].call(i.exports,i,i.exports,n),i.exports}var o={};return(()=>{"use strict";var t=o,e=Object.create?function(t,e,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);o&&!("get"in o?!e.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]},r=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};Object.defineProperty(t,"__esModule",{value:!0}),t.createContext=void 0;var i=function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var o in t)"default"!==o&&Object.prototype.hasOwnProperty.call(t,o)&&e(n,t,o);return r(n,t),n}(n(156)),a=n(774),u=n(244),c=n(125),s=n(157),l=n(605);t.createContext=function(t,e){var r=new Map,n=i.default.createContext(l.uniqueSymbol),o=function(){var t=i.default.useContext(n);if(t===l.uniqueSymbol)throw new Error("context hooks need to be used inside a provider");return t};return o.createSelectorHook=function(t,e){var n=(0,s.uniqueId)("cs:");return function(){var i,a,u=o(),s=(i=u,null!==(a=r.get(i))&&void 0!==a?a:r.set(i,new Map).get(i));s.has(n)||s.set(n,u.createSelectorHook(t,e));var l=s.get(n);if((0,c.isNil)(l))throw new Error("useSelectedHook is nil");return l.apply(void 0,arguments)}},[o,function(o){var c=o.children,s=o.value,l=o.ref,f=(0,i.useMemo)((function(){var r=void 0===s?t():(0,u.isFunction)(s)?s(t()):s,n=new a.GlobalStore(r,e);return{store:n,hook:n.getHook()}}),[]),d=f.store,p=f.hook;return r.has(p)||r.set(p,new Map),(0,i.useEffect)((function(){return function(){var t,e,n,o;r.delete(p),null===(e=null===(t=d.callbacks)||void 0===t?void 0:t.onUnMount)||void 0===e||e.call(t),null===(o=(n=d).__onUnMountContext)||void 0===o||o.call(n,d,p)}}),[]),(0,i.useImperativeHandle)(l,(function(){return l?d.getConfigCallbackParam():{}}),[d,l]),i.default.createElement(n.Provider,{value:p},c)}]}})(),o})(),t.exports=n(r(156))},156:e=>{"use strict";e.exports=t}},r={},function t(n){var o=r[n];if(void 0!==o)return o.exports;var i=r[n]={exports:{}};return e[n].call(i.exports,i,i.exports,t),i.exports}(564);var e,r}));
1
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):"object"==typeof exports?exports["react-global-state-hooks"]=e(require("react")):t["react-global-state-hooks"]=e(t.react)}(this,(t=>{return e={564:(t,e,r)=>{"use strict";var n=Object.create?function(t,e,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);o&&!("get"in o?!e.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]},o=function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),o(r(212),e)},212:function(t,e,r){var n;n=t=>(()=>{var e={774:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,s=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(t){s=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return u}}(t,e)||i(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){if(t){if("string"==typeof t)return a(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(t,e):void 0}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function u(){u=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),u=new C(n||[]);return o(a,"_invoke",{value:j(t,r,u)}),a}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=f;var p={};function v(){}function h(){}function b(){}var y={};l(y,a,(function(){return this}));var g=Object.getPrototypeOf,m=g&&g(g(E([])));m&&m!==e&&r.call(m,a)&&(y=m);var S=b.prototype=v.prototype=Object.create(y);function w(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function i(o,a,u,c){var s=d(t[o],t,a);if("throw"!==s.type){var l=s.arg,f=l.value;return f&&"object"==n(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){i("next",t,u,c)}),(function(t){i("throw",t,u,c)})):e.resolve(f).then((function(t){l.value=t,u(l)}),(function(t){return i("throw",t,u,c)}))}c(s.arg)}var a;o(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){i(t,r,e,n)}))}return a=a?a.then(n,n):n()}})}function j(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=x(a,r);if(u){if(u===p)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=d(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===p)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function x(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),p;var o=d(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,p;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,p):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,p)}function _(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function E(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:M}}function M(){return{value:void 0,done:!0}}return h.prototype=b,o(S,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:h,configurable:!0}),h.displayName=l(b,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,l(t,s,"GeneratorFunction")),t.prototype=Object.create(S),t},t.awrap=function(t){return{__await:t}},w(O.prototype),l(O.prototype,c,(function(){return this})),t.AsyncIterator=O,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new O(f(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},w(S),l(S,s,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=E,C.prototype={constructor:C,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(k),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(u&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,p):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),p},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;k(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:E(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},t}function c(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,s(n.key),n)}}function s(t){var e=function(t,e){if("object"!==n(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,"string");if("object"!==n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===n(e)?e:String(e)}Object.defineProperty(e,"__esModule",{value:!0}),e.GlobalStore=void 0;var l=r(156),f=r(244),d=r(125),p=r(281),v=r(143),h=r(561),b=r(400),y=r(157),g=r(605),m=r(383),S=function(){function t(e){var r=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{metadata:{}};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.actionsConfig=null,this.callbacks=null,this.actions=null,this.subscribers=new Map,this.initialize=function(){return function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))}(r,void 0,void 0,u().mark((function t(){var e,r,n,o,i,a;return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(Object.keys(null!==(e=this.actionsConfig)&&void 0!==e?e:{}).length>0&&(this.actions=this.getStoreActionsMap()),n=this.onInit,o=null!==(r=this.callbacks)&&void 0!==r?r:{},i=o.onInit,n||i){t.next=6;break}return t.abrupt("return");case 6:a=this.getConfigCallbackParam(),null==n||n(a),(0,d.isNil)(i)||null==i||i(a);case 9:case"end":return t.stop()}}),t,this)})))},this.executeSetStateForSubscriber=function(t,e){var n,o,i=t.selector,a=t.callback,u=t.currentState,c=t.config;if(!e.forceUpdate&&(null!==(n=null==c?void 0:c.isEqualRoot)&&void 0!==n?n:function(t,e){return t===e})(e.currentRootState,e.newRootState))return{didUpdate:!1};var s=i?i(e.newRootState):e.newRootState;return!e.forceUpdate&&(null!==(o=null==c?void 0:c.isEqual)&&void 0!==o?o:function(t,e){return t===e})(u,s)?{didUpdate:!1}:(r.partialUpdateSubscription(t.subscriptionId,{currentState:s}),a({state:s},{identifier:e.identifier}),{didUpdate:!0})},this.setState=function(t,e){var n=t.state,o=e.forceUpdate,a=e.identifier,u=r.stateWrapper.state;if(o||u!==n){r.stateWrapper={state:n};var c,s={forceUpdate:o,newRootState:n,currentRootState:u,identifier:a},l=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=i(t))){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,u=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return u=t.done,t},e:function(t){c=!0,a=t},f:function(){try{u||null==r.return||r.return()}finally{if(c)throw a}}}}(r.subscribers.values());try{for(l.s();!(c=l.n()).done;){var f=c.value;r.executeSetStateForSubscriber(f,s)}}catch(t){l.e(t)}finally{l.f()}}},this.setMetadata=function(t){var e=(0,f.isFunction)(t)?t(r.metadata):t;r.metadata=e},this.getMetadata=function(){return r.metadata},this.getState=function(t,e,n){var o;if(!t)return r.stateWrapper.state;var i=(0,f.isFunction)(e),a=i?t:void 0,u=i?e:t,c=null!==(o=i?n:e)&&void 0!==o?o:void 0,s=a?a(r.stateWrapper.state):r.stateWrapper.state;(null==c?void 0:c.skipFirst)||u(s);var l=(0,y.uniqueId)("gs:");return r.setOrUpdateSubscription({subscriptionId:l,selector:a,config:c,currentState:s,callback:function(t){var e=t.state;return u(e)},isSetStateCallback:!1}),function(){r.subscribers.delete(l)}},this.getConfigCallbackParam=function(){var t=r.setMetadata,e=r.getMetadata,n=r.getState,o=r.actions;return{setMetadata:t,getMetadata:e,getState:n,setState:r.setStateWrapper,actions:o}},this.lastSubscriptionId=null,this.setOrUpdateSubscription=function(t){var e=t.subscriptionId;if(!e)return{isNewSubscription:!1};var n=r.subscribers.get(e);return(0,v.isRecord)(n)?(Object.assign(n,t),{isNewSubscription:!1}):(r.executeOnSubscribed(),r.subscribers.set(e,t),r.lastSubscriptionId=e,{isNewSubscription:!0})},this.partialUpdateSubscription=function(t,e){var n=r.subscribers.get(t);(0,v.isRecord)(n)&&Object.assign(n,e)},this.executeOnSubscribed=function(){var t,e=r.onSubscribed,n=null===(t=r.callbacks)||void 0===t?void 0:t.onSubscribed;if(e||n){var o=r.getConfigCallbackParam();null==e||e(o),null==n||n(o)}},this.getHook=function(){var t=function(t){var e,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=(0,m.useConstantValueRef)((function(){return{subscriptionId:null,tempInitialRootState:r.stateWrapper.state}})),u=function(){return t?{state:t(r.stateWrapper.state)}:r.stateWrapper},c=o((0,l.useState)(u),2),s=c[0],f=c[1];(0,l.useEffect)((function(){if(!(0,d.isNil)(a.current)){(0,d.isNil)(a.current.subscriptionId)&&(a.current.subscriptionId=(0,y.uniqueId)("ss:"));var e=a.current.subscriptionId,n={subscriptionId:e,currentState:s.state,selector:t,config:i,callback:f,isSetStateCallback:!0};return r.setOrUpdateSubscription(n).isNewSubscription&&(r.executeSetStateForSubscriber(n,{forceUpdate:!1,newRootState:r.stateWrapper.state,currentRootState:a.current.tempInitialRootState===g.uniqueSymbol?r.stateWrapper.state:a.current.tempInitialRootState,identifier:"on mount state update"}),a.current.tempInitialRootState=g.uniqueSymbol),function(){r.subscribers.delete(e)}}}),[]);var v=(0,p.isString)(null===(e=a.current)||void 0===e?void 0:e.subscriptionId)?a.current.subscriptionId:"",h=r.subscribers.get(v),b=(null!==(n=null==h?void 0:h.config)&&void 0!==n?n:{dependencies:i.dependencies}).dependencies;return r.partialUpdateSubscription(v,{currentState:s.state,selector:t,config:i,callback:f}),[r.computeSelectedState({selector:t,subscriptionId:v,config:i,currentDependencies:b,computeChildState:u,stateWrapperRef:s}),r.getStateOrchestrator(),r.metadata]};return t.stateControls=r.stateControls,t.createSelectorHook=r.createSelectorHook,t.createObservable=r.createObservable,t},this.computeSelectedState=function(t){var e=t.selector,n=t.subscriptionId,o=t.config,i=t.currentDependencies,a=t.computeChildState,u=t.stateWrapperRef;if(!e||!n)return u.state;var c=o.dependencies;if(i===c)return u.state;if((null==i?void 0:i.length)===(null==c?void 0:c.length)&&(0,h.shallowCompare)(i,c))return u.state;var s=a().state;return r.partialUpdateSubscription(n,{currentState:s}),u.state=s,s},this.createSelectorHook=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.isEqualRoot,a=n.isEqual,u=n.name,c=o(r.stateControls(),3),s=c[0],l=c[1],d=c[2],p=s(),v=(null!=e?e:function(t){return t})(p),h=new t(v,{name:null!=u?u:(0,y.uniqueId)("sh:")}),b=o(h.stateControls(),2),g=b[0],m=b[1];s((function(t){if(!(null!=i?i:Object.is)(p,t)){p=t;var r=e(t);(null!=a?a:Object.is)(v,r)||(v=r,m(r))}}),{skipFirst:!0});var S=h.getHook(),w=function(t,e){return[o((0,f.isFunction)(t)?S(t,e):S(),1)[0],l,d]};return w.stateControls=function(){return[g,l,d]},w.createSelectorHook=r.createSelectorHook.bind(w),w.createObservable=r.createObservable.bind(w),w},this.stateControls=function(){var t=r.getStateOrchestrator(),e=r.getMetadata;return[r.getState,t,e]},this.getStateOrchestrator=function(){return r.actions?r.actions:r.setStateWrapper},this.setStateWrapper=function(t){var e,n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=o.forceUpdate,a=o.identifier,u=r.stateWrapper.state,c=(0,f.isFunction)(t)?t(u):t;if(i||r.stateWrapper.state!==c){var s=r.setMetadata,l=r.getMetadata,d=r.getState,p=r.actions,v={setMetadata:s,getMetadata:l,setState:r.setState,getState:d,actions:p,previousState:u,state:c,identifier:a},h=r.computePreventStateChange,b=null===(e=r.callbacks)||void 0===e?void 0:e.computePreventStateChange;if((h||b)&&((null==h?void 0:h(v))||(null==b?void 0:b(v))))return;r.setState({state:c},{forceUpdate:i,identifier:a});var y=r.onStateChanged,g=null===(n=r.callbacks)||void 0===n?void 0:n.onStateChanged;(y||g)&&(null==y||y(v),null==g||g(v))}},this.getStoreActionsMap=function(){if(!(0,v.isRecord)(r.actionsConfig))return null;var t=r.actionsConfig,e=r.setMetadata,n=r.setStateWrapper,o=r.getState,i=r.getMetadata,a=Object.keys(t).reduce((function(r,u){var c,l,f;return Object.assign(r,(c={},f=function(){for(var r=t[u],c=arguments.length,s=new Array(c),l=0;l<c;l++)s[l]=arguments[l];var f=r.apply(a,s);return"function"!=typeof f&&(0,b.throwWrongKeyOnActionCollectionConfig)(u),f.call(a,{setState:n,getState:o,setMetadata:e,getMetadata:i,actions:a})},(l=s(l=u))in c?Object.defineProperty(c,l,{value:f,enumerable:!0,configurable:!0,writable:!0}):c[l]=f,c)),r}),{});return a};var a=n.metadata,c=n.callbacks,S=n.actions,w=n.name;this.stateWrapper={state:e},this._name=null!=w?w:(0,y.uniqueId)("gs:"),this.metadata=null!=a?a:{},this.callbacks=null!=c?c:null,this.actionsConfig=null!=S?S:null,(null===globalThis||void 0===globalThis?void 0:globalThis.REACT_GLOBAL_STATE_HOOK_DEBUG)&&globalThis.REACT_GLOBAL_STATE_HOOK_DEBUG(this),this.constructor!==t||this.initialize()}var e,r;return e=t,r=[{key:"createObservable",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.isEqualRoot,n=e.isEqual,i=e.name,a=o(this.stateControls(),1)[0],u=[],c=a(),s=(null!=t?t:function(t){return t})(a());a((function(e){if(!(null!=r?r:Object.is)(c,e)){c=e;var o=t(e);(null!=n?n:Object.is)(s,o)||(s=o,u.forEach((function(t){return t()})))}}),{skipFirst:!0});var l=function(t,e,r){var n;if(!t)return s;var o=(0,f.isFunction)(e),i=o?t:void 0,a=o?e:t,c=null!==(n=o?r:e)&&void 0!==n?n:void 0,l=function(){return a(i?i(s):s)};(null==c?void 0:c.skipFirst)||l();var d=function(){l()};return u.push(d),function(){u.splice(u.indexOf(d),1)}};return l._name=null!=i?i:(0,y.uniqueId)("ob:"),l.createObservable=this.createObservable.bind(l),l.stateControls=function(){return[l]},l}}],r&&c(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();e.GlobalStore=S},143:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.isRecord=void 0;var o=r(125);e.isRecord=function(t){return!(0,o.isNil)(t)&&"object"===n(t)}},561:(t,e,r)=>{"use strict";function n(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,s=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(t){s=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return u}}(t,e)||i(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=i(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,u=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return u=t.done,t},e:function(t){c=!0,a=t},f:function(){try{u||null==r.return||r.return()}finally{if(c)throw a}}}}function i(t,e){if(t){if("string"==typeof t)return a(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(t,e):void 0}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function u(t){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.shallowCompare=void 0;var c=r(416),s=r(231),l=r(125),f=r(143);e.shallowCompare=function(t,e){if(t===e)return!0;var r=u(t),i=u(e);if(r!==i)return!1;if((0,l.isNil)(t)||(0,l.isNil)(e)||(0,c.isPrimitive)(t)&&(0,c.isPrimitive)(e)||(0,s.isDate)(t)&&(0,s.isDate)(e)||"function"===r&&"function"===i)return t===e;if(Array.isArray(t)){var a=t,d=e;if(a.length!==d.length)return!1;for(var p=0;p<a.length;p++)if(a[p]!==d[p])return!1}if(t instanceof Map){var v=t,h=e;if(v.size!==h.size)return!1;var b,y=o(v);try{for(y.s();!(b=y.n()).done;){var g=n(b.value,2),m=g[0];if(g[1]!==h.get(m))return!1}}catch(t){y.e(t)}finally{y.f()}}if(t instanceof Set){var S=t,w=e;if(S.size!==w.size)return!1;var O,j=o(S);try{for(j.s();!(O=j.n()).done;){var x=O.value;if(!w.has(x))return!1}}catch(t){j.e(t)}finally{j.f()}}if(!(0,f.isRecord)(t)||!(0,f.isRecord)(e))return t===e;var _=Object.keys(t),k=Object.keys(e);if(_.length!==k.length)return!1;for(var C=0,E=_;C<E.length;C++){var M=E[C];if(t[M]!==e[M])return!1}return!0}},400:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.throwWrongKeyOnActionCollectionConfig=void 0,e.throwWrongKeyOnActionCollectionConfig=function(t){throw new Error("[WRONG CONFIGURATION!]: Every key inside the storeActionsConfig must be a higher order function that returns a function \n[".concat(t,"]: key is not a valid function, try something like this: \n{\n\n ").concat(t,": (param) => ({ setState, getState, setMetadata, getMetadata, actions }) => {\n\n setState((state) => ({ ...state, ...param }))\n\n }\n\n}\n"))}},157:(t,e)=>{"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.uniqueId=void 0,e.uniqueId=(r=0,function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return r===Number.MAX_SAFE_INTEGER&&(r=0),t+Date.now().toString(36)+(r++).toString(36)})},605:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.uniqueSymbol=void 0,e.uniqueSymbol=Symbol("unique")},383:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useConstantValueRef=void 0;var n=r(156),o=r(605);e.useConstantValueRef=function(t){var e=(0,n.useRef)(o.uniqueSymbol);return e.current===o.uniqueSymbol&&(e.current=t()),e}},231:function(t){t.exports=(()=>{"use strict";var t={};return(()=>{var e=t;Object.defineProperty(e,"__esModule",{value:!0}),e.isDate=void 0,e.isDate=function(t){return t instanceof Date}})(),t})()},244:function(t){t.exports=(()=>{"use strict";var t={};return(()=>{var e=t;Object.defineProperty(e,"__esModule",{value:!0}),e.isFunction=void 0,e.isFunction=function(t){return"function"==typeof t||t instanceof Function}})(),t})()},125:function(t){t.exports=(()=>{"use strict";var t={};return(()=>{var e=t;Object.defineProperty(e,"__esModule",{value:!0}),e.isNil=void 0,e.isNil=function(t){return null==t}})(),t})()},416:function(t){t.exports=(()=>{"use strict";var t={112:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isBoolean=void 0,e.isBoolean=function(t){return"boolean"==typeof t}},243:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isNil=void 0,e.isNil=function(t){return null==t}},11:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isNumber=void 0,e.isNumber=function(t){return"number"==typeof t}},671:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isString=void 0,e.isString=function(t){return"string"==typeof t}}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}var n={};return(()=>{var t=n;function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}Object.defineProperty(t,"__esModule",{value:!0}),t.isPrimitive=void 0;var o=r(112),i=r(243),a=r(11),u=r(671);t.isPrimitive=function(t){return(0,i.isNil)(t)||(0,a.isNumber)(t)||(0,o.isBoolean)(t)||(0,u.isString)(t)||"symbol"===e(t)}})(),n})()},281:function(t){t.exports=(()=>{"use strict";var t={};return(()=>{var e=t;Object.defineProperty(e,"__esModule",{value:!0}),e.isString=void 0,e.isString=function(t){return"string"==typeof t}})(),t})()},156:e=>{"use strict";e.exports=t}},r={};function n(t){var o=r[t];if(void 0!==o)return o.exports;var i=r[t]={exports:{}};return e[t].call(i.exports,i,i.exports,n),i.exports}var o={};return(()=>{"use strict";var t=o,e=Object.create?function(t,e,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);o&&!("get"in o?!e.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]},r=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};Object.defineProperty(t,"__esModule",{value:!0}),t.createContext=void 0;var i=function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var o in t)"default"!==o&&Object.prototype.hasOwnProperty.call(t,o)&&e(n,t,o);return r(n,t),n}(n(156)),a=n(774),u=n(244),c=n(125),s=n(157),l=n(605);t.createContext=function(t,e){var r=new Map,n=i.default.createContext(l.uniqueSymbol),o=function(){var t=i.default.useContext(n);if(t===l.uniqueSymbol)throw new Error("context hooks need to be used inside a provider");return t};return o.createSelectorHook=function(t,e){var n=(0,s.uniqueId)("cs:");return function(){var i,a,u=o(),s=(i=u,null!==(a=r.get(i))&&void 0!==a?a:r.set(i,new Map).get(i));s.has(n)||s.set(n,u.createSelectorHook(t,e));var l=s.get(n);if((0,c.isNil)(l))throw new Error("useSelectedHook is nil");return l.apply(void 0,arguments)}},[o,function(o){var c=o.children,s=o.value,l=o.ref,f=(0,i.useMemo)((function(){var r=void 0===s?t():(0,u.isFunction)(s)?s(t()):s,n=new a.GlobalStore(r,e);return{store:n,hook:n.getHook()}}),[]),d=f.store,p=f.hook;return r.has(p)||r.set(p,new Map),(0,i.useEffect)((function(){return function(){var t,e,n,o;r.delete(p),null===(e=null===(t=d.callbacks)||void 0===t?void 0:t.onUnMount)||void 0===e||e.call(t),null===(o=(n=d).__onUnMountContext)||void 0===o||o.call(n,d,p)}}),[]),(0,i.useImperativeHandle)(l,(function(){return l?d.getConfigCallbackParam():{}}),[d,l]),i.default.createElement(n.Provider,{value:p},c)}]}})(),o})(),t.exports=n(r(156))},156:e=>{"use strict";e.exports=t}},r={},function t(n){var o=r[n];if(void 0!==o)return o.exports;var i=r[n]={exports:{}};return e[n].call(i.exports,i,i.exports,t),i.exports}(564);var e,r}));
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):"object"==typeof exports?exports["react-global-state-hooks"]=e(require("react")):t["react-global-state-hooks"]=e(t.react)}(this,(t=>(()=>{var e={774:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,i(n.key),n)}}function i(t){var e=function(t,e){if("object"!=n(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,e||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==n(e)?e:String(e)}function a(t,e){return a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},a(t,e)}function u(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=s(t);if(e){var o=s(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return c(this,r)}}function c(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return l(t)}function l(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function s(t){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},s(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.GlobalStore=void 0;var f=r(297),p=r(164),v=r(826),y=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&a(t,e)}(s,t);var e,r,n,i=u(s);function s(t){var e,r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{metadata:{}};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),(e=i.call(this,t,n)).localStorage=null,e.isLocalStorageAvailable=function(t){return Boolean((null==t?void 0:t.key)&&(null===globalThis||void 0===globalThis?void 0:globalThis.localStorage))},e._onInitialize=function(t){var r=t.setState,n=t.getState;if(e.isLocalStorageAvailable(e.localStorage)){var o=(0,p.getLocalStorageItem)(e.localStorage);if(null===o){var i=n();return(0,v.setLocalStorageItem)(i,e.localStorage)}r(o)}},e._onChange=function(t){var r=t.getState;e.isLocalStorageAvailable(e.localStorage)&&(0,v.setLocalStorageItem)(r(),e.localStorage)},e.onInitialize=null,e.onChange=null,e.onInit=function(t){var r;null===(r=e._onInitialize)||void 0===r||r.call(l(e),t)},e.onStateChanged=function(t){var r;null===(r=e._onChange)||void 0===r||r.call(l(e),t)},e.localStorage=null!==(r=n.localStorage)&&void 0!==r?r:null,e.constructor!==s?c(e):(e.initialize(),e)}return e=s,r&&o(e.prototype,r),n&&o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(f.GlobalStoreAbstract);e.GlobalStore=y},196:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createGlobalState=void 0;var n=r(774);e.createGlobalState=function(t,e){return new n.GlobalStore(t,e).getHook()}},164:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getLocalStorageItem=void 0;var n=r(129);e.getLocalStorageItem=function(t){var e=t.key;if(!e)return null;var r="function"==typeof e?e():e,o=localStorage.getItem(r);if(null===o)return null;var i=t.decrypt||t.encrypt?"function"==typeof t.decrypt?t.decrypt(o):atob(o):o;return(0,n.formatFromStore)(i,{jsonParse:!0})}},826:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setLocalStorageItem=void 0;var n=r(75);e.setLocalStorageItem=function(t,e){var r=e.key;if(r){var o="function"==typeof r?r():r,i=(0,n.formatToStore)(t,{stringify:!0,excludeTypes:["function"]}),a=e.encrypt?"function"==typeof e.encrypt?e.encrypt(i):btoa(i):i;localStorage.setItem(o,a)}}},129:function(t){t.exports=(()=>{"use strict";var t={333:(t,e,r)=>{function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}Object.defineProperty(e,"__esModule",{value:!0}),e.clone=void 0;var i=r(646),a=r(346),u=r(473);e.clone=function(t){var r,c=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).shallow;if((0,u.isPrimitive)(t)||(0,i.isDate)(t))return t;if(Array.isArray(t))return c?function(t){if(Array.isArray(t))return o(t)}(r=t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(r)||function(t,e){if(t){if("string"==typeof t)return o(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(t,e):void 0}}(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}():t.map((function(t){return(0,e.clone)(t)}));if(t instanceof Map){var l=Array.from(t.entries());return c?new Map(l):new Map(l.map((function(t){return(0,e.clone)(t)})))}if(t instanceof Set){var s=Array.from(t.values());return c?new Set(s):new Set(s.map((function(t){return(0,e.clone)(t)})))}return t instanceof RegExp?new RegExp(t.toString()):(0,a.isFunction)(t)?c?t:Object.create(t):c?Object.assign({},t):t instanceof Error?new Error(t.message):Object.keys(t).reduce((function(r,o){var i=t[o];return Object.assign(Object.assign({},r),function(t,e,r){return(e=function(t){var e=function(t){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}({},o,(0,e.clone)(i)))}),{})}},944:(t,e,r)=>{function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}Object.defineProperty(e,"__esModule",{value:!0}),e.formatFromStore=void 0;var i=r(333),a=r(346),u=r(473);e.formatFromStore=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=r.jsonParse,l=r.sortKeys;return function(t){var r,i,c;if((0,u.isPrimitive)(t))return t;if("date"===(null==t?void 0:t.$t))return new Date(t.$v);if("map"===(null==t?void 0:t.$t)){var s=(null!==(r=t.$v)&&void 0!==r?r:[]).map((function(t){var r,n,i=(n=2,function(t){if(Array.isArray(t))return t}(r=t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(r,n)||function(t,e){if(t){if("string"==typeof t)return o(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(t,e):void 0}}(r,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),a=i[0],u=i[1];return[a,(0,e.formatFromStore)(u)]}));return new Map(s)}if("set"===(null==t?void 0:t.$t)){var f=null!==(i=t.$v)&&void 0!==i?i:[].map((function(t){return(0,e.formatFromStore)(t)}));return new Set(f)}return"regex"===(null==t?void 0:t.$t)?new RegExp(t.$v):"error"===(null==t?void 0:t.$t)?new Error(t.$v):Array.isArray(t)?t.map((function(t){return(0,e.formatFromStore)(t)})):"function"===(null==t?void 0:t.$t)?Function("(".concat(t.$v,")(...arguments)")):(c=Object.keys(t),l?(0,a.isFunction)(l)?c.sort(l):c.sort((function(t,e){return(null!=t?t:"").localeCompare(e)})):c).reduce((function(r,o){var i,a,u,c=t[o];return Object.assign(Object.assign({},r),(i={},a=o,u=(0,e.formatFromStore)(c),(a=function(t){var e=function(t){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}(a))in i?Object.defineProperty(i,a,{value:u,enumerable:!0,configurable:!0,writable:!0}):i[a]=u,i))}),{})}(c?JSON.parse(t):(0,i.clone)(t))}},112:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isBoolean=void 0,e.isBoolean=function(t){return"boolean"==typeof t}},646:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isDate=void 0,e.isDate=function(t){return t instanceof Date}},346:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isFunction=void 0,e.isFunction=function(t){return"function"==typeof t||t instanceof Function}},243:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isNil=void 0,e.isNil=function(t){return null==t}},11:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isNumber=void 0,e.isNumber=function(t){return"number"==typeof t}},473:(t,e,r)=>{function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.isPrimitive=void 0;var o=r(112),i=r(243),a=r(11),u=r(671);e.isPrimitive=function(t){return(0,i.isNil)(t)||(0,a.isNumber)(t)||(0,o.isBoolean)(t)||(0,u.isString)(t)||"symbol"===n(t)}},671:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isString=void 0,e.isString=function(t){return"string"==typeof t}}},e={};return function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}(944)})()},75:function(t){t.exports=(()=>{"use strict";var t={333:(t,e,r)=>{function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}Object.defineProperty(e,"__esModule",{value:!0}),e.clone=void 0;var i=r(646),a=r(346),u=r(473);e.clone=function(t){var r,c=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).shallow;if((0,u.isPrimitive)(t)||(0,i.isDate)(t))return t;if(Array.isArray(t))return c?function(t){if(Array.isArray(t))return o(t)}(r=t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(r)||function(t,e){if(t){if("string"==typeof t)return o(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(t,e):void 0}}(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}():t.map((function(t){return(0,e.clone)(t)}));if(t instanceof Map){var l=Array.from(t.entries());return c?new Map(l):new Map(l.map((function(t){return(0,e.clone)(t)})))}if(t instanceof Set){var s=Array.from(t.values());return c?new Set(s):new Set(s.map((function(t){return(0,e.clone)(t)})))}return t instanceof RegExp?new RegExp(t.toString()):(0,a.isFunction)(t)?c?t:Object.create(t):c?Object.assign({},t):t instanceof Error?new Error(t.message):Object.keys(t).reduce((function(r,o){var i=t[o];return Object.assign(Object.assign({},r),function(t,e,r){return(e=function(t){var e=function(t){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}({},o,(0,e.clone)(i)))}),{})}},112:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isBoolean=void 0,e.isBoolean=function(t){return"boolean"==typeof t}},646:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isDate=void 0,e.isDate=function(t){return t instanceof Date}},346:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isFunction=void 0,e.isFunction=function(t){return"function"==typeof t||t instanceof Function}},243:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isNil=void 0,e.isNil=function(t){return null==t}},11:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isNumber=void 0,e.isNumber=function(t){return"number"==typeof t}},473:(t,e,r)=>{function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.isPrimitive=void 0;var o=r(112),i=r(243),a=r(11),u=r(671);e.isPrimitive=function(t){return(0,i.isNil)(t)||(0,a.isNumber)(t)||(0,o.isBoolean)(t)||(0,u.isString)(t)||"symbol"===n(t)}},43:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isRegex=void 0,e.isRegex=function(t){return t instanceof RegExp}},671:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isString=void 0,e.isString=function(t){return"string"==typeof t}}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}var n={};return(()=>{var t=n;function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}Object.defineProperty(t,"__esModule",{value:!0}),t.formatToStore=void 0;var o=r(333),i=r(646),a=r(346),u=r(473),c=r(43);t.formatToStore=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{stringify:!1},n=r.stringify,l=r.validator,s=r.excludeTypes,f=r.excludeKeys,p=r.sortKeys,v=new Set(null!=s?s:[]),y=new Set(null!=f?f:[]),d=v.size||y.size,b=null!=l?l:function(t){var r=t.key,n=t.value;if(!d)return!0;var o=y.has(r),i=v.has(e(n));return!o&&!i},m=function(t){if((0,u.isPrimitive)(t))return t;var r;if(Array.isArray(t))return t.map((function(t){return m(t)}));if(t instanceof Map)return{$t:"map",$v:Array.from(t.entries()).map((function(t){return m(t)}))};if(t instanceof Set)return{$t:"set",$v:Array.from(t.values()).map((function(t){return m(t)}))};if((0,i.isDate)(t))return{$t:"date",$v:t.toISOString()};if((0,c.isRegex)(t))return{$t:"regex",$v:t.toString()};if((0,a.isFunction)(t)){var n;try{n={$t:"function",$v:t.toString()}}catch(t){n={$t:"error",$v:"Error: Could not serialize function"}}return n}return t instanceof Error?{$t:"error",$v:t.message}:(r=Object.keys(t),p?(0,a.isFunction)(p)?r.sort(p):r.sort((function(t,e){return(null!=t?t:"").localeCompare(e)})):r).reduce((function(r,n){var o,i,a,u=t[n],c=m(u);return b({obj:t,key:n,value:c})?Object.assign(Object.assign({},r),(o={},i=n,a=m(u),(i=function(t){var r=function(t){if("object"!=e(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=e(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==e(r)?r:r+""}(i))in o?Object.defineProperty(o,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):o[i]=a,o)):r}),{})},h=m((0,o.clone)(t));return n?JSON.stringify(h):h}})(),n})()},297:function(t,e,r){var n;n=t=>(()=>{var e={774:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(t,e)||i(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){if(t){if("string"==typeof t)return a(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(t,e):void 0}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function u(){u=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var i=e&&e.prototype instanceof y?e:y,a=Object.create(i.prototype),u=new E(n||[]);return o(a,"_invoke",{value:j(t,r,u)}),a}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=f;var v={};function y(){}function d(){}function b(){}var m={};s(m,a,(function(){return this}));var h=Object.getPrototypeOf,g=h&&h(h(A([])));g&&g!==e&&r.call(g,a)&&(m=g);var S=b.prototype=y.prototype=Object.create(m);function O(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function i(o,a,u,c){var l=p(t[o],t,a);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==n(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){i("next",t,u,c)}),(function(t){i("throw",t,u,c)})):e.resolve(f).then((function(t){s.value=t,u(s)}),(function(t){return i("throw",t,u,c)}))}c(l.arg)}var a;o(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){i(t,r,e,n)}))}return a=a?a.then(n,n):n()}})}function j(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=_(a,r);if(u){if(u===v)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=p(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function _(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,_(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var o=p(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,v;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,v):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,v)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function A(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:M}}function M(){return{value:void 0,done:!0}}return d.prototype=b,o(S,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:d,configurable:!0}),d.displayName=s(b,l,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,s(t,l,"GeneratorFunction")),t.prototype=Object.create(S),t},t.awrap=function(t){return{__await:t}},O(w.prototype),s(w.prototype,c,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(f(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},O(S),s(S,l,"Generator"),s(S,a,(function(){return this})),s(S,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=A,E.prototype={constructor:E,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(u&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:A(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),v}},t}function c(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,l(n.key),n)}}function l(t){var e=function(t,e){if("object"!==n(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,"string");if("object"!==n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===n(e)?e:String(e)}Object.defineProperty(e,"__esModule",{value:!0}),e.GlobalStore=void 0;var s=r(156),f=r(244),p=r(125),v=r(281),y=r(143),d=r(561),b=r(400),m=r(157),h=r(605),g=r(383),S=function(){function t(e){var r=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{metadata:{}};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.actionsConfig=null,this.callbacks=null,this.actions=null,this.subscribers=new Map,this.initialize=function(){return function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))}(r,void 0,void 0,u().mark((function t(){var e,r,n,o,i,a;return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(Object.keys(null!==(e=this.actionsConfig)&&void 0!==e?e:{}).length>0&&(this.actions=this.getStoreActionsMap()),n=this.onInit,o=null!==(r=this.callbacks)&&void 0!==r?r:{},i=o.onInit,n||i){t.next=6;break}return t.abrupt("return");case 6:a=this.getConfigCallbackParam(),null==n||n(a),(0,p.isNil)(i)||null==i||i(a);case 9:case"end":return t.stop()}}),t,this)})))},this.executeSetStateForSubscriber=function(t,e){var n,o,i=t.selector,a=t.callback,u=t.currentState,c=t.config;if(!e.forceUpdate&&(null!==(n=null==c?void 0:c.isEqualRoot)&&void 0!==n?n:function(t,e){return t===e})(e.currentRootState,e.newRootState))return{didUpdate:!1};var l=i?i(e.newRootState):e.newRootState;return!e.forceUpdate&&(null!==(o=null==c?void 0:c.isEqual)&&void 0!==o?o:function(t,e){return t===e})(u,l)?{didUpdate:!1}:(r.partialUpdateSubscription(t.subscriptionId,{currentState:l}),a({state:l},{identifier:e.identifier}),{didUpdate:!0})},this.setState=function(t,e){var n=t.state,o=e.forceUpdate,a=e.identifier,u=r.stateWrapper.state;if(o||u!==n){r.stateWrapper={state:n};var c,l={forceUpdate:o,newRootState:n,currentRootState:u,identifier:a},s=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=i(t))){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,u=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return u=t.done,t},e:function(t){c=!0,a=t},f:function(){try{u||null==r.return||r.return()}finally{if(c)throw a}}}}(r.subscribers.values());try{for(s.s();!(c=s.n()).done;){var f=c.value;r.executeSetStateForSubscriber(f,l)}}catch(t){s.e(t)}finally{s.f()}}},this.setMetadata=function(t){var e=(0,f.isFunction)(t)?t(r.metadata):t;r.metadata=e},this.getMetadata=function(){return r.metadata},this.getState=function(t,e,n){var o;if(!t)return r.stateWrapper.state;var i=(0,f.isFunction)(e),a=i?t:void 0,u=i?e:t,c=null!==(o=i?n:e)&&void 0!==o?o:void 0,l=a?a(r.stateWrapper.state):r.stateWrapper.state;(null==c?void 0:c.skipFirst)||u(l);var s=(0,m.uniqueId)("gs:");return r.setOrUpdateSubscription({subscriptionId:s,selector:a,config:c,currentState:l,callback:function(t){var e=t.state;return u(e)},isSetStateCallback:!1}),function(){r.subscribers.delete(s)}},this.getConfigCallbackParam=function(){var t=r.setMetadata,e=r.getMetadata,n=r.getState,o=r.actions;return{setMetadata:t,getMetadata:e,getState:n,setState:r.setStateWrapper,actions:o}},this.lastSubscriptionId=null,this.setOrUpdateSubscription=function(t){var e=t.subscriptionId;if(!e)return{isNewSubscription:!1};var n=r.subscribers.get(e);return(0,y.isRecord)(n)?(Object.assign(n,t),{isNewSubscription:!1}):(r.executeOnSubscribed(),r.subscribers.set(e,t),r.lastSubscriptionId=e,{isNewSubscription:!0})},this.partialUpdateSubscription=function(t,e){var n=r.subscribers.get(t);(0,y.isRecord)(n)&&Object.assign(n,e)},this.executeOnSubscribed=function(){var t,e=r.onSubscribed,n=null===(t=r.callbacks)||void 0===t?void 0:t.onSubscribed;if(e||n){var o=r.getConfigCallbackParam();null==e||e(o),null==n||n(o)}},this.getHook=function(){var t=function(t){var e,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=(0,g.useConstantValueRef)((function(){return{subscriptionId:null,tempInitialRootState:r.stateWrapper.state}})),u=function(){return t?{state:t(r.stateWrapper.state)}:r.stateWrapper},c=o((0,s.useState)(u),2),l=c[0],f=c[1];(0,s.useEffect)((function(){if(!(0,p.isNil)(a.current)){(0,p.isNil)(a.current.subscriptionId)&&(a.current.subscriptionId=(0,m.uniqueId)("ss:"));var e=a.current.subscriptionId,n={subscriptionId:e,currentState:l.state,selector:t,config:i,callback:f,isSetStateCallback:!0};return r.setOrUpdateSubscription(n).isNewSubscription&&(r.executeSetStateForSubscriber(n,{forceUpdate:!1,newRootState:r.stateWrapper.state,currentRootState:a.current.tempInitialRootState,identifier:"on mount state update"}),a.current.tempInitialRootState=h.uniqueSymbol),function(){r.subscribers.delete(e)}}}),[]);var y=(0,v.isString)(null===(e=a.current)||void 0===e?void 0:e.subscriptionId)?a.current.subscriptionId:"",d=r.subscribers.get(y),b=(null!==(n=null==d?void 0:d.config)&&void 0!==n?n:{dependencies:i.dependencies}).dependencies;return r.partialUpdateSubscription(y,{currentState:l.state,selector:t,config:i,callback:f}),[r.computeSelectedState({selector:t,subscriptionId:y,config:i,currentDependencies:b,computeChildState:u,stateWrapperRef:l}),r.getStateOrchestrator(),r.metadata]};return t.stateControls=r.stateControls,t.createSelectorHook=r.createSelectorHook,t.createObservable=r.createObservable,t},this.computeSelectedState=function(t){var e=t.selector,n=t.subscriptionId,o=t.config,i=t.currentDependencies,a=t.computeChildState,u=t.stateWrapperRef;if(!e||!n)return u.state;var c=o.dependencies;if(i===c)return u.state;if((null==i?void 0:i.length)===(null==c?void 0:c.length)&&(0,d.shallowCompare)(i,c))return u.state;var l=a().state;return r.partialUpdateSubscription(n,{currentState:l}),u.state=l,l},this.createSelectorHook=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.isEqualRoot,a=n.isEqual,u=n.name,c=o(r.stateControls(),3),l=c[0],s=c[1],p=c[2],v=l(),y=(null!=e?e:function(t){return t})(v),d=new t(y,{name:null!=u?u:(0,m.uniqueId)("sh:")}),b=o(d.stateControls(),2),h=b[0],g=b[1];l((function(t){if(!(null!=i?i:Object.is)(v,t)){v=t;var r=e(t);(null!=a?a:Object.is)(y,r)||(y=r,g(r))}}),{skipFirst:!0});var S=d.getHook(),O=function(t,e){return[o((0,f.isFunction)(t)?S(t,e):S(),1)[0],s,p]};return O.stateControls=function(){return[h,s,p]},O.createSelectorHook=r.createSelectorHook.bind(O),O.createObservable=r.createObservable.bind(O),O},this.stateControls=function(){var t=r.getStateOrchestrator(),e=r.getMetadata;return[r.getState,t,e]},this.getStateOrchestrator=function(){return r.actions?r.actions:r.setStateWrapper},this.setStateWrapper=function(t){var e,n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=o.forceUpdate,a=o.identifier,u=r.stateWrapper.state,c=(0,f.isFunction)(t)?t(u):t;if(i||r.stateWrapper.state!==c){var l=r.setMetadata,s=r.getMetadata,p=r.getState,v=r.actions,y={setMetadata:l,getMetadata:s,setState:r.setState,getState:p,actions:v,previousState:u,state:c,identifier:a},d=r.computePreventStateChange,b=null===(e=r.callbacks)||void 0===e?void 0:e.computePreventStateChange;if((d||b)&&((null==d?void 0:d(y))||(null==b?void 0:b(y))))return;r.setState({state:c},{forceUpdate:i,identifier:a});var m=r.onStateChanged,h=null===(n=r.callbacks)||void 0===n?void 0:n.onStateChanged;(m||h)&&(null==m||m(y),null==h||h(y))}},this.getStoreActionsMap=function(){if(!(0,y.isRecord)(r.actionsConfig))return null;var t=r.actionsConfig,e=r.setMetadata,n=r.setStateWrapper,o=r.getState,i=r.getMetadata,a=Object.keys(t).reduce((function(r,u){var c,s,f;return Object.assign(r,(c={},f=function(){for(var r=t[u],c=arguments.length,l=new Array(c),s=0;s<c;s++)l[s]=arguments[s];var f=r.apply(a,l);return"function"!=typeof f&&(0,b.throwWrongKeyOnActionCollectionConfig)(u),f.call(a,{setState:n,getState:o,setMetadata:e,getMetadata:i,actions:a})},(s=l(s=u))in c?Object.defineProperty(c,s,{value:f,enumerable:!0,configurable:!0,writable:!0}):c[s]=f,c)),r}),{});return a};var a=n.metadata,c=n.callbacks,S=n.actions,O=n.name;this.stateWrapper={state:e},this._name=null!=O?O:(0,m.uniqueId)("gs:"),this.metadata=null!=a?a:{},this.callbacks=null!=c?c:null,this.actionsConfig=null!=S?S:null,(null===globalThis||void 0===globalThis?void 0:globalThis.REACT_GLOBAL_STATE_HOOK_DEBUG)&&globalThis.REACT_GLOBAL_STATE_HOOK_DEBUG(this),this.constructor!==t||this.initialize()}var e,r;return e=t,r=[{key:"createObservable",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.isEqualRoot,n=e.isEqual,i=e.name,a=o(this.stateControls(),1)[0],u=[],c=a(),l=(null!=t?t:function(t){return t})(a());a((function(e){if(!(null!=r?r:Object.is)(c,e)){c=e;var o=t(e);(null!=n?n:Object.is)(l,o)||(l=o,u.forEach((function(t){return t()})))}}),{skipFirst:!0});var s=function(t,e,r){var n;if(!t)return l;var o=(0,f.isFunction)(e),i=o?t:void 0,a=o?e:t,c=null!==(n=o?r:e)&&void 0!==n?n:void 0,s=function(){return a(i?i(l):l)};(null==c?void 0:c.skipFirst)||s();var p=function(){s()};return u.push(p),function(){u.splice(u.indexOf(p),1)}};return s._name=null!=i?i:(0,m.uniqueId)("ob:"),s.createObservable=this.createObservable.bind(s),s.stateControls=function(){return[s]},s}}],r&&c(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();e.GlobalStore=S},143:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.isRecord=void 0;var o=r(125);e.isRecord=function(t){return!(0,o.isNil)(t)&&"object"===n(t)}},561:(t,e,r)=>{"use strict";function n(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(t,e)||i(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=i(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,u=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return u=t.done,t},e:function(t){c=!0,a=t},f:function(){try{u||null==r.return||r.return()}finally{if(c)throw a}}}}function i(t,e){if(t){if("string"==typeof t)return a(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(t,e):void 0}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function u(t){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.shallowCompare=void 0;var c=r(416),l=r(231),s=r(125),f=r(143);e.shallowCompare=function(t,e){if(t===e)return!0;var r=u(t),i=u(e);if(r!==i)return!1;if((0,s.isNil)(t)||(0,s.isNil)(e)||(0,c.isPrimitive)(t)&&(0,c.isPrimitive)(e)||(0,l.isDate)(t)&&(0,l.isDate)(e)||"function"===r&&"function"===i)return t===e;if(Array.isArray(t)){var a=t,p=e;if(a.length!==p.length)return!1;for(var v=0;v<a.length;v++)if(a[v]!==p[v])return!1}if(t instanceof Map){var y=t,d=e;if(y.size!==d.size)return!1;var b,m=o(y);try{for(m.s();!(b=m.n()).done;){var h=n(b.value,2),g=h[0];if(h[1]!==d.get(g))return!1}}catch(t){m.e(t)}finally{m.f()}}if(t instanceof Set){var S=t,O=e;if(S.size!==O.size)return!1;var w,j=o(S);try{for(j.s();!(w=j.n()).done;){var _=w.value;if(!O.has(_))return!1}}catch(t){j.e(t)}finally{j.f()}}if(!(0,f.isRecord)(t)||!(0,f.isRecord)(e))return t===e;var P=Object.keys(t),x=Object.keys(e);if(P.length!==x.length)return!1;for(var E=0,A=P;E<A.length;E++){var M=A[E];if(t[M]!==e[M])return!1}return!0}},400:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.throwWrongKeyOnActionCollectionConfig=void 0,e.throwWrongKeyOnActionCollectionConfig=function(t){throw new Error("[WRONG CONFIGURATION!]: Every key inside the storeActionsConfig must be a higher order function that returns a function \n[".concat(t,"]: key is not a valid function, try something like this: \n{\n\n ").concat(t,": (param) => ({ setState, getState, setMetadata, getMetadata, actions }) => {\n\n setState((state) => ({ ...state, ...param }))\n\n }\n\n}\n"))}},157:(t,e)=>{"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.uniqueId=void 0,e.uniqueId=(r=0,function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return r===Number.MAX_SAFE_INTEGER&&(r=0),t+Date.now().toString(36)+(r++).toString(36)})},605:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.uniqueSymbol=void 0,e.uniqueSymbol=Symbol("unique")},383:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useConstantValueRef=void 0;var n=r(156),o=r(605);e.useConstantValueRef=function(t){var e=(0,n.useRef)(o.uniqueSymbol);return e.current===o.uniqueSymbol&&(e.current=t()),e}},231:function(t){t.exports=(()=>{"use strict";var t={};return(()=>{var e=t;Object.defineProperty(e,"__esModule",{value:!0}),e.isDate=void 0,e.isDate=function(t){return t instanceof Date}})(),t})()},244:function(t){t.exports=(()=>{"use strict";var t={};return(()=>{var e=t;Object.defineProperty(e,"__esModule",{value:!0}),e.isFunction=void 0,e.isFunction=function(t){return"function"==typeof t||t instanceof Function}})(),t})()},125:function(t){t.exports=(()=>{"use strict";var t={};return(()=>{var e=t;Object.defineProperty(e,"__esModule",{value:!0}),e.isNil=void 0,e.isNil=function(t){return null==t}})(),t})()},416:function(t){t.exports=(()=>{"use strict";var t={112:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isBoolean=void 0,e.isBoolean=function(t){return"boolean"==typeof t}},243:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isNil=void 0,e.isNil=function(t){return null==t}},11:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isNumber=void 0,e.isNumber=function(t){return"number"==typeof t}},671:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isString=void 0,e.isString=function(t){return"string"==typeof t}}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}var n={};return(()=>{var t=n;function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}Object.defineProperty(t,"__esModule",{value:!0}),t.isPrimitive=void 0;var o=r(112),i=r(243),a=r(11),u=r(671);t.isPrimitive=function(t){return(0,i.isNil)(t)||(0,a.isNumber)(t)||(0,o.isBoolean)(t)||(0,u.isString)(t)||"symbol"===e(t)}})(),n})()},281:function(t){t.exports=(()=>{"use strict";var t={};return(()=>{var e=t;Object.defineProperty(e,"__esModule",{value:!0}),e.isString=void 0,e.isString=function(t){return"string"==typeof t}})(),t})()},156:e=>{"use strict";e.exports=t}},r={};function n(t){var o=r[t];if(void 0!==o)return o.exports;var i=r[t]={exports:{}};return e[t].call(i.exports,i,i.exports,n),i.exports}var o={};return(()=>{"use strict";var t=o;function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function r(t,e){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},r(t,e)}function i(t){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,o=a(t);if(r){var i=a(this).constructor;n=Reflect.construct(o,arguments,i)}else n=o.apply(this,arguments);return function(t,r){if(r&&("object"===e(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}function a(t){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},a(t)}Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalStoreAbstract=void 0;var u=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&r(t,e)}(o,t);var e,n=i(o);function o(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),(t=n.apply(this,arguments)).onInit=function(e){t.onInitialize(e)},t.onStateChanged=function(e){t.onChange(e)},t}return e=o,Object.defineProperty(e,"prototype",{writable:!1}),e}(n(774).GlobalStore);t.GlobalStoreAbstract=u})(),o})(),t.exports=n(r(156))},156:e=>{"use strict";e.exports=t}},r={};function n(t){var o=r[t];if(void 0!==o)return o.exports;var i=r[t]={exports:{}};return e[t].call(i.exports,i,i.exports,n),i.exports}var o={};return(()=>{"use strict";var t=o,e=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.createCustomGlobalState=void 0;var r=n(196);t.createCustomGlobalState=function(t){var n=t.onInitialize,o=t.onChange;return function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=i.callbacks,u=e(i,["callbacks"]);return(0,r.createGlobalState)(t,Object.assign(Object.assign({},u),{callbacks:Object.assign(Object.assign({},null!=a?a:{}),{onInit:function(t){var e;null==n||n(t,null==u?void 0:u.config),null===(e=null==a?void 0:a.onInit)||void 0===e||e.call(a,t)},onStateChanged:function(t){var e;null==o||o(t,null==u?void 0:u.config),null===(e=null==a?void 0:a.onStateChanged)||void 0===e||e.call(a,t)}})}))}}})(),o})()));
1
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):"object"==typeof exports?exports["react-global-state-hooks"]=e(require("react")):t["react-global-state-hooks"]=e(t.react)}(this,(t=>(()=>{var e={774:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,i(n.key),n)}}function i(t){var e=function(t,e){if("object"!=n(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,e||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==n(e)?e:String(e)}function a(t,e){return a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},a(t,e)}function u(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=s(t);if(e){var o=s(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return c(this,r)}}function c(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return l(t)}function l(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function s(t){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},s(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.GlobalStore=void 0;var f=r(297),p=r(164),v=r(826),y=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&a(t,e)}(s,t);var e,r,n,i=u(s);function s(t){var e,r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{metadata:{}};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),(e=i.call(this,t,n)).localStorage=null,e.isLocalStorageAvailable=function(t){return Boolean((null==t?void 0:t.key)&&(null===globalThis||void 0===globalThis?void 0:globalThis.localStorage))},e._onInitialize=function(t){var r=t.setState,n=t.getState;if(e.isLocalStorageAvailable(e.localStorage)){var o=(0,p.getLocalStorageItem)(e.localStorage);if(null===o){var i=n();return(0,v.setLocalStorageItem)(i,e.localStorage)}r(o)}},e._onChange=function(t){var r=t.getState;e.isLocalStorageAvailable(e.localStorage)&&(0,v.setLocalStorageItem)(r(),e.localStorage)},e.onInitialize=null,e.onChange=null,e.onInit=function(t){var r;null===(r=e._onInitialize)||void 0===r||r.call(l(e),t)},e.onStateChanged=function(t){var r;null===(r=e._onChange)||void 0===r||r.call(l(e),t)},e.localStorage=null!==(r=n.localStorage)&&void 0!==r?r:null,e.constructor!==s?c(e):(e.initialize(),e)}return e=s,r&&o(e.prototype,r),n&&o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(f.GlobalStoreAbstract);e.GlobalStore=y},196:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createGlobalState=void 0;var n=r(774);e.createGlobalState=function(t,e){return new n.GlobalStore(t,e).getHook()}},164:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getLocalStorageItem=void 0;var n=r(129);e.getLocalStorageItem=function(t){var e=t.key;if(!e)return null;var r="function"==typeof e?e():e,o=localStorage.getItem(r);if(null===o)return null;var i=t.decrypt||t.encrypt?"function"==typeof t.decrypt?t.decrypt(o):atob(o):o;return(0,n.formatFromStore)(i,{jsonParse:!0})}},826:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setLocalStorageItem=void 0;var n=r(75);e.setLocalStorageItem=function(t,e){var r=e.key;if(r){var o="function"==typeof r?r():r,i=(0,n.formatToStore)(t,{stringify:!0,excludeTypes:["function"]}),a=e.encrypt?"function"==typeof e.encrypt?e.encrypt(i):btoa(i):i;localStorage.setItem(o,a)}}},129:function(t){t.exports=(()=>{"use strict";var t={333:(t,e,r)=>{function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}Object.defineProperty(e,"__esModule",{value:!0}),e.clone=void 0;var i=r(646),a=r(346),u=r(473);e.clone=function(t){var r,c=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).shallow;if((0,u.isPrimitive)(t)||(0,i.isDate)(t))return t;if(Array.isArray(t))return c?function(t){if(Array.isArray(t))return o(t)}(r=t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(r)||function(t,e){if(t){if("string"==typeof t)return o(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(t,e):void 0}}(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}():t.map((function(t){return(0,e.clone)(t)}));if(t instanceof Map){var l=Array.from(t.entries());return c?new Map(l):new Map(l.map((function(t){return(0,e.clone)(t)})))}if(t instanceof Set){var s=Array.from(t.values());return c?new Set(s):new Set(s.map((function(t){return(0,e.clone)(t)})))}return t instanceof RegExp?new RegExp(t.toString()):(0,a.isFunction)(t)?c?t:Object.create(t):c?Object.assign({},t):t instanceof Error?new Error(t.message):Object.keys(t).reduce((function(r,o){var i=t[o];return Object.assign(Object.assign({},r),function(t,e,r){return(e=function(t){var e=function(t){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}({},o,(0,e.clone)(i)))}),{})}},944:(t,e,r)=>{function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}Object.defineProperty(e,"__esModule",{value:!0}),e.formatFromStore=void 0;var i=r(333),a=r(346),u=r(473);e.formatFromStore=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=r.jsonParse,l=r.sortKeys;return function(t){var r,i,c;if((0,u.isPrimitive)(t))return t;if("date"===(null==t?void 0:t.$t))return new Date(t.$v);if("map"===(null==t?void 0:t.$t)){var s=(null!==(r=t.$v)&&void 0!==r?r:[]).map((function(t){var r,n,i=(n=2,function(t){if(Array.isArray(t))return t}(r=t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(r,n)||function(t,e){if(t){if("string"==typeof t)return o(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(t,e):void 0}}(r,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),a=i[0],u=i[1];return[a,(0,e.formatFromStore)(u)]}));return new Map(s)}if("set"===(null==t?void 0:t.$t)){var f=null!==(i=t.$v)&&void 0!==i?i:[].map((function(t){return(0,e.formatFromStore)(t)}));return new Set(f)}return"regex"===(null==t?void 0:t.$t)?new RegExp(t.$v):"error"===(null==t?void 0:t.$t)?new Error(t.$v):Array.isArray(t)?t.map((function(t){return(0,e.formatFromStore)(t)})):"function"===(null==t?void 0:t.$t)?Function("(".concat(t.$v,")(...arguments)")):(c=Object.keys(t),l?(0,a.isFunction)(l)?c.sort(l):c.sort((function(t,e){return(null!=t?t:"").localeCompare(e)})):c).reduce((function(r,o){var i,a,u,c=t[o];return Object.assign(Object.assign({},r),(i={},a=o,u=(0,e.formatFromStore)(c),(a=function(t){var e=function(t){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}(a))in i?Object.defineProperty(i,a,{value:u,enumerable:!0,configurable:!0,writable:!0}):i[a]=u,i))}),{})}(c?JSON.parse(t):(0,i.clone)(t))}},112:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isBoolean=void 0,e.isBoolean=function(t){return"boolean"==typeof t}},646:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isDate=void 0,e.isDate=function(t){return t instanceof Date}},346:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isFunction=void 0,e.isFunction=function(t){return"function"==typeof t||t instanceof Function}},243:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isNil=void 0,e.isNil=function(t){return null==t}},11:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isNumber=void 0,e.isNumber=function(t){return"number"==typeof t}},473:(t,e,r)=>{function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.isPrimitive=void 0;var o=r(112),i=r(243),a=r(11),u=r(671);e.isPrimitive=function(t){return(0,i.isNil)(t)||(0,a.isNumber)(t)||(0,o.isBoolean)(t)||(0,u.isString)(t)||"symbol"===n(t)}},671:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isString=void 0,e.isString=function(t){return"string"==typeof t}}},e={};return function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}(944)})()},75:function(t){t.exports=(()=>{"use strict";var t={333:(t,e,r)=>{function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}Object.defineProperty(e,"__esModule",{value:!0}),e.clone=void 0;var i=r(646),a=r(346),u=r(473);e.clone=function(t){var r,c=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).shallow;if((0,u.isPrimitive)(t)||(0,i.isDate)(t))return t;if(Array.isArray(t))return c?function(t){if(Array.isArray(t))return o(t)}(r=t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(r)||function(t,e){if(t){if("string"==typeof t)return o(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(t,e):void 0}}(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}():t.map((function(t){return(0,e.clone)(t)}));if(t instanceof Map){var l=Array.from(t.entries());return c?new Map(l):new Map(l.map((function(t){return(0,e.clone)(t)})))}if(t instanceof Set){var s=Array.from(t.values());return c?new Set(s):new Set(s.map((function(t){return(0,e.clone)(t)})))}return t instanceof RegExp?new RegExp(t.toString()):(0,a.isFunction)(t)?c?t:Object.create(t):c?Object.assign({},t):t instanceof Error?new Error(t.message):Object.keys(t).reduce((function(r,o){var i=t[o];return Object.assign(Object.assign({},r),function(t,e,r){return(e=function(t){var e=function(t){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}({},o,(0,e.clone)(i)))}),{})}},112:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isBoolean=void 0,e.isBoolean=function(t){return"boolean"==typeof t}},646:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isDate=void 0,e.isDate=function(t){return t instanceof Date}},346:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isFunction=void 0,e.isFunction=function(t){return"function"==typeof t||t instanceof Function}},243:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isNil=void 0,e.isNil=function(t){return null==t}},11:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isNumber=void 0,e.isNumber=function(t){return"number"==typeof t}},473:(t,e,r)=>{function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.isPrimitive=void 0;var o=r(112),i=r(243),a=r(11),u=r(671);e.isPrimitive=function(t){return(0,i.isNil)(t)||(0,a.isNumber)(t)||(0,o.isBoolean)(t)||(0,u.isString)(t)||"symbol"===n(t)}},43:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isRegex=void 0,e.isRegex=function(t){return t instanceof RegExp}},671:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isString=void 0,e.isString=function(t){return"string"==typeof t}}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}var n={};return(()=>{var t=n;function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}Object.defineProperty(t,"__esModule",{value:!0}),t.formatToStore=void 0;var o=r(333),i=r(646),a=r(346),u=r(473),c=r(43);t.formatToStore=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{stringify:!1},n=r.stringify,l=r.validator,s=r.excludeTypes,f=r.excludeKeys,p=r.sortKeys,v=new Set(null!=s?s:[]),y=new Set(null!=f?f:[]),d=v.size||y.size,b=null!=l?l:function(t){var r=t.key,n=t.value;if(!d)return!0;var o=y.has(r),i=v.has(e(n));return!o&&!i},m=function(t){if((0,u.isPrimitive)(t))return t;var r;if(Array.isArray(t))return t.map((function(t){return m(t)}));if(t instanceof Map)return{$t:"map",$v:Array.from(t.entries()).map((function(t){return m(t)}))};if(t instanceof Set)return{$t:"set",$v:Array.from(t.values()).map((function(t){return m(t)}))};if((0,i.isDate)(t))return{$t:"date",$v:t.toISOString()};if((0,c.isRegex)(t))return{$t:"regex",$v:t.toString()};if((0,a.isFunction)(t)){var n;try{n={$t:"function",$v:t.toString()}}catch(t){n={$t:"error",$v:"Error: Could not serialize function"}}return n}return t instanceof Error?{$t:"error",$v:t.message}:(r=Object.keys(t),p?(0,a.isFunction)(p)?r.sort(p):r.sort((function(t,e){return(null!=t?t:"").localeCompare(e)})):r).reduce((function(r,n){var o,i,a,u=t[n],c=m(u);return b({obj:t,key:n,value:c})?Object.assign(Object.assign({},r),(o={},i=n,a=m(u),(i=function(t){var r=function(t){if("object"!=e(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=e(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==e(r)?r:r+""}(i))in o?Object.defineProperty(o,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):o[i]=a,o)):r}),{})},h=m((0,o.clone)(t));return n?JSON.stringify(h):h}})(),n})()},297:function(t,e,r){var n;n=t=>(()=>{var e={774:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(t,e)||i(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){if(t){if("string"==typeof t)return a(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(t,e):void 0}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function u(){u=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var i=e&&e.prototype instanceof y?e:y,a=Object.create(i.prototype),u=new E(n||[]);return o(a,"_invoke",{value:j(t,r,u)}),a}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=f;var v={};function y(){}function d(){}function b(){}var m={};s(m,a,(function(){return this}));var h=Object.getPrototypeOf,g=h&&h(h(A([])));g&&g!==e&&r.call(g,a)&&(m=g);var S=b.prototype=y.prototype=Object.create(m);function O(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function i(o,a,u,c){var l=p(t[o],t,a);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==n(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){i("next",t,u,c)}),(function(t){i("throw",t,u,c)})):e.resolve(f).then((function(t){s.value=t,u(s)}),(function(t){return i("throw",t,u,c)}))}c(l.arg)}var a;o(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){i(t,r,e,n)}))}return a=a?a.then(n,n):n()}})}function j(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=_(a,r);if(u){if(u===v)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=p(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function _(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,_(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var o=p(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,v;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,v):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,v)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function A(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:M}}function M(){return{value:void 0,done:!0}}return d.prototype=b,o(S,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:d,configurable:!0}),d.displayName=s(b,l,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,s(t,l,"GeneratorFunction")),t.prototype=Object.create(S),t},t.awrap=function(t){return{__await:t}},O(w.prototype),s(w.prototype,c,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(f(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},O(S),s(S,l,"Generator"),s(S,a,(function(){return this})),s(S,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=A,E.prototype={constructor:E,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(u&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:A(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),v}},t}function c(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,l(n.key),n)}}function l(t){var e=function(t,e){if("object"!==n(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,"string");if("object"!==n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===n(e)?e:String(e)}Object.defineProperty(e,"__esModule",{value:!0}),e.GlobalStore=void 0;var s=r(156),f=r(244),p=r(125),v=r(281),y=r(143),d=r(561),b=r(400),m=r(157),h=r(605),g=r(383),S=function(){function t(e){var r=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{metadata:{}};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.actionsConfig=null,this.callbacks=null,this.actions=null,this.subscribers=new Map,this.initialize=function(){return function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))}(r,void 0,void 0,u().mark((function t(){var e,r,n,o,i,a;return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(Object.keys(null!==(e=this.actionsConfig)&&void 0!==e?e:{}).length>0&&(this.actions=this.getStoreActionsMap()),n=this.onInit,o=null!==(r=this.callbacks)&&void 0!==r?r:{},i=o.onInit,n||i){t.next=6;break}return t.abrupt("return");case 6:a=this.getConfigCallbackParam(),null==n||n(a),(0,p.isNil)(i)||null==i||i(a);case 9:case"end":return t.stop()}}),t,this)})))},this.executeSetStateForSubscriber=function(t,e){var n,o,i=t.selector,a=t.callback,u=t.currentState,c=t.config;if(!e.forceUpdate&&(null!==(n=null==c?void 0:c.isEqualRoot)&&void 0!==n?n:function(t,e){return t===e})(e.currentRootState,e.newRootState))return{didUpdate:!1};var l=i?i(e.newRootState):e.newRootState;return!e.forceUpdate&&(null!==(o=null==c?void 0:c.isEqual)&&void 0!==o?o:function(t,e){return t===e})(u,l)?{didUpdate:!1}:(r.partialUpdateSubscription(t.subscriptionId,{currentState:l}),a({state:l},{identifier:e.identifier}),{didUpdate:!0})},this.setState=function(t,e){var n=t.state,o=e.forceUpdate,a=e.identifier,u=r.stateWrapper.state;if(o||u!==n){r.stateWrapper={state:n};var c,l={forceUpdate:o,newRootState:n,currentRootState:u,identifier:a},s=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=i(t))){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,u=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return u=t.done,t},e:function(t){c=!0,a=t},f:function(){try{u||null==r.return||r.return()}finally{if(c)throw a}}}}(r.subscribers.values());try{for(s.s();!(c=s.n()).done;){var f=c.value;r.executeSetStateForSubscriber(f,l)}}catch(t){s.e(t)}finally{s.f()}}},this.setMetadata=function(t){var e=(0,f.isFunction)(t)?t(r.metadata):t;r.metadata=e},this.getMetadata=function(){return r.metadata},this.getState=function(t,e,n){var o;if(!t)return r.stateWrapper.state;var i=(0,f.isFunction)(e),a=i?t:void 0,u=i?e:t,c=null!==(o=i?n:e)&&void 0!==o?o:void 0,l=a?a(r.stateWrapper.state):r.stateWrapper.state;(null==c?void 0:c.skipFirst)||u(l);var s=(0,m.uniqueId)("gs:");return r.setOrUpdateSubscription({subscriptionId:s,selector:a,config:c,currentState:l,callback:function(t){var e=t.state;return u(e)},isSetStateCallback:!1}),function(){r.subscribers.delete(s)}},this.getConfigCallbackParam=function(){var t=r.setMetadata,e=r.getMetadata,n=r.getState,o=r.actions;return{setMetadata:t,getMetadata:e,getState:n,setState:r.setStateWrapper,actions:o}},this.lastSubscriptionId=null,this.setOrUpdateSubscription=function(t){var e=t.subscriptionId;if(!e)return{isNewSubscription:!1};var n=r.subscribers.get(e);return(0,y.isRecord)(n)?(Object.assign(n,t),{isNewSubscription:!1}):(r.executeOnSubscribed(),r.subscribers.set(e,t),r.lastSubscriptionId=e,{isNewSubscription:!0})},this.partialUpdateSubscription=function(t,e){var n=r.subscribers.get(t);(0,y.isRecord)(n)&&Object.assign(n,e)},this.executeOnSubscribed=function(){var t,e=r.onSubscribed,n=null===(t=r.callbacks)||void 0===t?void 0:t.onSubscribed;if(e||n){var o=r.getConfigCallbackParam();null==e||e(o),null==n||n(o)}},this.getHook=function(){var t=function(t){var e,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=(0,g.useConstantValueRef)((function(){return{subscriptionId:null,tempInitialRootState:r.stateWrapper.state}})),u=function(){return t?{state:t(r.stateWrapper.state)}:r.stateWrapper},c=o((0,s.useState)(u),2),l=c[0],f=c[1];(0,s.useEffect)((function(){if(!(0,p.isNil)(a.current)){(0,p.isNil)(a.current.subscriptionId)&&(a.current.subscriptionId=(0,m.uniqueId)("ss:"));var e=a.current.subscriptionId,n={subscriptionId:e,currentState:l.state,selector:t,config:i,callback:f,isSetStateCallback:!0};return r.setOrUpdateSubscription(n).isNewSubscription&&(r.executeSetStateForSubscriber(n,{forceUpdate:!1,newRootState:r.stateWrapper.state,currentRootState:a.current.tempInitialRootState===h.uniqueSymbol?r.stateWrapper.state:a.current.tempInitialRootState,identifier:"on mount state update"}),a.current.tempInitialRootState=h.uniqueSymbol),function(){r.subscribers.delete(e)}}}),[]);var y=(0,v.isString)(null===(e=a.current)||void 0===e?void 0:e.subscriptionId)?a.current.subscriptionId:"",d=r.subscribers.get(y),b=(null!==(n=null==d?void 0:d.config)&&void 0!==n?n:{dependencies:i.dependencies}).dependencies;return r.partialUpdateSubscription(y,{currentState:l.state,selector:t,config:i,callback:f}),[r.computeSelectedState({selector:t,subscriptionId:y,config:i,currentDependencies:b,computeChildState:u,stateWrapperRef:l}),r.getStateOrchestrator(),r.metadata]};return t.stateControls=r.stateControls,t.createSelectorHook=r.createSelectorHook,t.createObservable=r.createObservable,t},this.computeSelectedState=function(t){var e=t.selector,n=t.subscriptionId,o=t.config,i=t.currentDependencies,a=t.computeChildState,u=t.stateWrapperRef;if(!e||!n)return u.state;var c=o.dependencies;if(i===c)return u.state;if((null==i?void 0:i.length)===(null==c?void 0:c.length)&&(0,d.shallowCompare)(i,c))return u.state;var l=a().state;return r.partialUpdateSubscription(n,{currentState:l}),u.state=l,l},this.createSelectorHook=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.isEqualRoot,a=n.isEqual,u=n.name,c=o(r.stateControls(),3),l=c[0],s=c[1],p=c[2],v=l(),y=(null!=e?e:function(t){return t})(v),d=new t(y,{name:null!=u?u:(0,m.uniqueId)("sh:")}),b=o(d.stateControls(),2),h=b[0],g=b[1];l((function(t){if(!(null!=i?i:Object.is)(v,t)){v=t;var r=e(t);(null!=a?a:Object.is)(y,r)||(y=r,g(r))}}),{skipFirst:!0});var S=d.getHook(),O=function(t,e){return[o((0,f.isFunction)(t)?S(t,e):S(),1)[0],s,p]};return O.stateControls=function(){return[h,s,p]},O.createSelectorHook=r.createSelectorHook.bind(O),O.createObservable=r.createObservable.bind(O),O},this.stateControls=function(){var t=r.getStateOrchestrator(),e=r.getMetadata;return[r.getState,t,e]},this.getStateOrchestrator=function(){return r.actions?r.actions:r.setStateWrapper},this.setStateWrapper=function(t){var e,n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=o.forceUpdate,a=o.identifier,u=r.stateWrapper.state,c=(0,f.isFunction)(t)?t(u):t;if(i||r.stateWrapper.state!==c){var l=r.setMetadata,s=r.getMetadata,p=r.getState,v=r.actions,y={setMetadata:l,getMetadata:s,setState:r.setState,getState:p,actions:v,previousState:u,state:c,identifier:a},d=r.computePreventStateChange,b=null===(e=r.callbacks)||void 0===e?void 0:e.computePreventStateChange;if((d||b)&&((null==d?void 0:d(y))||(null==b?void 0:b(y))))return;r.setState({state:c},{forceUpdate:i,identifier:a});var m=r.onStateChanged,h=null===(n=r.callbacks)||void 0===n?void 0:n.onStateChanged;(m||h)&&(null==m||m(y),null==h||h(y))}},this.getStoreActionsMap=function(){if(!(0,y.isRecord)(r.actionsConfig))return null;var t=r.actionsConfig,e=r.setMetadata,n=r.setStateWrapper,o=r.getState,i=r.getMetadata,a=Object.keys(t).reduce((function(r,u){var c,s,f;return Object.assign(r,(c={},f=function(){for(var r=t[u],c=arguments.length,l=new Array(c),s=0;s<c;s++)l[s]=arguments[s];var f=r.apply(a,l);return"function"!=typeof f&&(0,b.throwWrongKeyOnActionCollectionConfig)(u),f.call(a,{setState:n,getState:o,setMetadata:e,getMetadata:i,actions:a})},(s=l(s=u))in c?Object.defineProperty(c,s,{value:f,enumerable:!0,configurable:!0,writable:!0}):c[s]=f,c)),r}),{});return a};var a=n.metadata,c=n.callbacks,S=n.actions,O=n.name;this.stateWrapper={state:e},this._name=null!=O?O:(0,m.uniqueId)("gs:"),this.metadata=null!=a?a:{},this.callbacks=null!=c?c:null,this.actionsConfig=null!=S?S:null,(null===globalThis||void 0===globalThis?void 0:globalThis.REACT_GLOBAL_STATE_HOOK_DEBUG)&&globalThis.REACT_GLOBAL_STATE_HOOK_DEBUG(this),this.constructor!==t||this.initialize()}var e,r;return e=t,r=[{key:"createObservable",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.isEqualRoot,n=e.isEqual,i=e.name,a=o(this.stateControls(),1)[0],u=[],c=a(),l=(null!=t?t:function(t){return t})(a());a((function(e){if(!(null!=r?r:Object.is)(c,e)){c=e;var o=t(e);(null!=n?n:Object.is)(l,o)||(l=o,u.forEach((function(t){return t()})))}}),{skipFirst:!0});var s=function(t,e,r){var n;if(!t)return l;var o=(0,f.isFunction)(e),i=o?t:void 0,a=o?e:t,c=null!==(n=o?r:e)&&void 0!==n?n:void 0,s=function(){return a(i?i(l):l)};(null==c?void 0:c.skipFirst)||s();var p=function(){s()};return u.push(p),function(){u.splice(u.indexOf(p),1)}};return s._name=null!=i?i:(0,m.uniqueId)("ob:"),s.createObservable=this.createObservable.bind(s),s.stateControls=function(){return[s]},s}}],r&&c(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();e.GlobalStore=S},143:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.isRecord=void 0;var o=r(125);e.isRecord=function(t){return!(0,o.isNil)(t)&&"object"===n(t)}},561:(t,e,r)=>{"use strict";function n(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(t,e)||i(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=i(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,u=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return u=t.done,t},e:function(t){c=!0,a=t},f:function(){try{u||null==r.return||r.return()}finally{if(c)throw a}}}}function i(t,e){if(t){if("string"==typeof t)return a(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(t,e):void 0}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function u(t){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.shallowCompare=void 0;var c=r(416),l=r(231),s=r(125),f=r(143);e.shallowCompare=function(t,e){if(t===e)return!0;var r=u(t),i=u(e);if(r!==i)return!1;if((0,s.isNil)(t)||(0,s.isNil)(e)||(0,c.isPrimitive)(t)&&(0,c.isPrimitive)(e)||(0,l.isDate)(t)&&(0,l.isDate)(e)||"function"===r&&"function"===i)return t===e;if(Array.isArray(t)){var a=t,p=e;if(a.length!==p.length)return!1;for(var v=0;v<a.length;v++)if(a[v]!==p[v])return!1}if(t instanceof Map){var y=t,d=e;if(y.size!==d.size)return!1;var b,m=o(y);try{for(m.s();!(b=m.n()).done;){var h=n(b.value,2),g=h[0];if(h[1]!==d.get(g))return!1}}catch(t){m.e(t)}finally{m.f()}}if(t instanceof Set){var S=t,O=e;if(S.size!==O.size)return!1;var w,j=o(S);try{for(j.s();!(w=j.n()).done;){var _=w.value;if(!O.has(_))return!1}}catch(t){j.e(t)}finally{j.f()}}if(!(0,f.isRecord)(t)||!(0,f.isRecord)(e))return t===e;var P=Object.keys(t),x=Object.keys(e);if(P.length!==x.length)return!1;for(var E=0,A=P;E<A.length;E++){var M=A[E];if(t[M]!==e[M])return!1}return!0}},400:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.throwWrongKeyOnActionCollectionConfig=void 0,e.throwWrongKeyOnActionCollectionConfig=function(t){throw new Error("[WRONG CONFIGURATION!]: Every key inside the storeActionsConfig must be a higher order function that returns a function \n[".concat(t,"]: key is not a valid function, try something like this: \n{\n\n ").concat(t,": (param) => ({ setState, getState, setMetadata, getMetadata, actions }) => {\n\n setState((state) => ({ ...state, ...param }))\n\n }\n\n}\n"))}},157:(t,e)=>{"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.uniqueId=void 0,e.uniqueId=(r=0,function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return r===Number.MAX_SAFE_INTEGER&&(r=0),t+Date.now().toString(36)+(r++).toString(36)})},605:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.uniqueSymbol=void 0,e.uniqueSymbol=Symbol("unique")},383:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useConstantValueRef=void 0;var n=r(156),o=r(605);e.useConstantValueRef=function(t){var e=(0,n.useRef)(o.uniqueSymbol);return e.current===o.uniqueSymbol&&(e.current=t()),e}},231:function(t){t.exports=(()=>{"use strict";var t={};return(()=>{var e=t;Object.defineProperty(e,"__esModule",{value:!0}),e.isDate=void 0,e.isDate=function(t){return t instanceof Date}})(),t})()},244:function(t){t.exports=(()=>{"use strict";var t={};return(()=>{var e=t;Object.defineProperty(e,"__esModule",{value:!0}),e.isFunction=void 0,e.isFunction=function(t){return"function"==typeof t||t instanceof Function}})(),t})()},125:function(t){t.exports=(()=>{"use strict";var t={};return(()=>{var e=t;Object.defineProperty(e,"__esModule",{value:!0}),e.isNil=void 0,e.isNil=function(t){return null==t}})(),t})()},416:function(t){t.exports=(()=>{"use strict";var t={112:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isBoolean=void 0,e.isBoolean=function(t){return"boolean"==typeof t}},243:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isNil=void 0,e.isNil=function(t){return null==t}},11:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isNumber=void 0,e.isNumber=function(t){return"number"==typeof t}},671:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isString=void 0,e.isString=function(t){return"string"==typeof t}}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}var n={};return(()=>{var t=n;function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}Object.defineProperty(t,"__esModule",{value:!0}),t.isPrimitive=void 0;var o=r(112),i=r(243),a=r(11),u=r(671);t.isPrimitive=function(t){return(0,i.isNil)(t)||(0,a.isNumber)(t)||(0,o.isBoolean)(t)||(0,u.isString)(t)||"symbol"===e(t)}})(),n})()},281:function(t){t.exports=(()=>{"use strict";var t={};return(()=>{var e=t;Object.defineProperty(e,"__esModule",{value:!0}),e.isString=void 0,e.isString=function(t){return"string"==typeof t}})(),t})()},156:e=>{"use strict";e.exports=t}},r={};function n(t){var o=r[t];if(void 0!==o)return o.exports;var i=r[t]={exports:{}};return e[t].call(i.exports,i,i.exports,n),i.exports}var o={};return(()=>{"use strict";var t=o;function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function r(t,e){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},r(t,e)}function i(t){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,o=a(t);if(r){var i=a(this).constructor;n=Reflect.construct(o,arguments,i)}else n=o.apply(this,arguments);return function(t,r){if(r&&("object"===e(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}function a(t){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},a(t)}Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalStoreAbstract=void 0;var u=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&r(t,e)}(o,t);var e,n=i(o);function o(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),(t=n.apply(this,arguments)).onInit=function(e){t.onInitialize(e)},t.onStateChanged=function(e){t.onChange(e)},t}return e=o,Object.defineProperty(e,"prototype",{writable:!1}),e}(n(774).GlobalStore);t.GlobalStoreAbstract=u})(),o})(),t.exports=n(r(156))},156:e=>{"use strict";e.exports=t}},r={};function n(t){var o=r[t];if(void 0!==o)return o.exports;var i=r[t]={exports:{}};return e[t].call(i.exports,i,i.exports,n),i.exports}var o={};return(()=>{"use strict";var t=o,e=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.createCustomGlobalState=void 0;var r=n(196);t.createCustomGlobalState=function(t){var n=t.onInitialize,o=t.onChange;return function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=i.callbacks,u=e(i,["callbacks"]);return(0,r.createGlobalState)(t,Object.assign(Object.assign({},u),{callbacks:Object.assign(Object.assign({},null!=a?a:{}),{onInit:function(t){var e;null==n||n(t,null==u?void 0:u.config),null===(e=null==a?void 0:a.onInit)||void 0===e||e.call(a,t)},onStateChanged:function(t){var e;null==o||o(t,null==u?void 0:u.config),null===(e=null==a?void 0:a.onStateChanged)||void 0===e||e.call(a,t)}})}))}}})(),o})()));