reactant-module
Version:
A module model for Reactant
2 lines (1 loc) • 23.1 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("mutative"),require("reactant-di"),require("redux")):"function"==typeof define&&define.amd?define(["exports","mutative","reactant-di","redux"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).reactantModule={},e.mutative,e.reactantDi,e.redux)}(this,(function(e,t,r,n){"use strict";var o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},o(e,t)};function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var a=function(){return a=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},a.apply(this,arguments)};function u(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a}function c(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function l(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function s(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function f(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var d,p=Symbol("store"),v=Symbol("loader"),b=Symbol("subscriptions"),h=Symbol("unsubscriptions"),y=Symbol("state"),g=Symbol("defaultState"),m=Symbol("signalMap"),_=Symbol("enablePatches"),S=Symbol("enableAutoComputed"),O=Symbol("enableAutoFreeze"),w=Symbol("strict"),j=Symbol("enableInspector"),R=Symbol("checkAction"),P="REACTANT_ACTION",A=Symbol("container"),C=Symbol("identifier"),E=Symbol("modules"),x=Symbol("name"),M=Symbol("initState"),T=Symbol("dynamicModules"),k=function(){function e(){if("function"!=typeof this.component)throw new Error("'".concat(Object.getPrototypeOf(this).constructor.name,"' ViewModule 'component' property should be defined class 'method'."));this.component=this.component.bind(this)}return e=u([r.injectable(),c("design:paramtypes",[])],e)}(),K=function(){return d};function z(e,t,r,n){Object.defineProperty(e,t,a({configurable:!0,writable:!0,enumerable:!0,value:r},n))}var D=function(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t},H=function(e,t){return"function"==typeof e&&"function"==typeof t||D(e,t)};function N(e,t){if(null===e||null===t||e.length!==t.length)return!1;for(var r=e.length,n=0;n<r;n+=1)if(!D(e[n],t[n]))return!1;return!0}var F=function(e){return"@@reactant/".concat(e,"/").concat(Math.random().toString(36))},I=function(e,t){return e.reduce((function(e,t){return t(e)}),t)},q=function(e,t){try{var r=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;return"function"==typeof r&&e?r(a({serialize:!0,actionSanitizer:function(e){return e._reactant===P?a(a({},e),{type:"@@reactant/".concat(e.type,"/").concat(e.method)}):e}},t)):n.compose}catch(e){return n.compose}},V=n.compose;function Y(e){var t=new Map,r=new Map;return function(){var n;return N(null!==(n=t.get(this))&&void 0!==n?n:[],arguments)||r.set(this,e.apply(this,arguments)),t.set(this,arguments),r.get(this)}}var L,W,B=(void 0===L&&(L=Y),function(e,t){var r=L((function(){return t.apply(this,arguments)}));return function(){return r.apply(this,e.apply(null,[this]))}});var J=0,U=0,X=function(){function e(e){this._version=0,this._value=e}return e.prototype._refresh=function(){return!0},Object.defineProperty(e.prototype,"value",{get:function(){var e=this.addDependency();return void 0!==e&&(e._version=this._version),this._value},set:function(e){if(W instanceof Q)throw new Error("Computed cannot have side-effects");e!==this._value&&(this._value=e,this._version+=1,J+=1)},enumerable:!1,configurable:!0}),e.prototype.addDependency=function(){if(void 0!==W){var e=this._node;return void 0===e||e._target!==W?(e={_version:0,_source:this,_prevSource:W._sources,_nextSource:void 0,_target:W,_prevTarget:void 0,_nextTarget:void 0,_rollbackNode:e},void 0!==W._sources&&(W._sources._nextSource=e),W._sources=e,this._node=e,e):-1===e._version?(e._version=0,void 0!==e._nextSource&&(e._nextSource._prevSource=e._prevSource,void 0!==e._prevSource&&(e._prevSource._nextSource=e._nextSource),e._prevSource=W._sources,e._nextSource=void 0,W._sources._nextSource=e,W._sources=e),e):void 0}},e}(),G=function(e){return new X(e)},Q=function(e){function t(t){var r=e.call(this,void 0)||this;return r._globalVersion=J-1,r._flags=new Set([2]),r._compute=t,r}return i(t,e),t.prototype._refresh=function(){if(this._flags.delete(1),this._flags.has(0))return!1;if(!this._flags.has(2)&&this._flags.has(4))return!0;if(this._flags.delete(2),this._globalVersion===J)return!0;if(this._globalVersion=J,this._flags.add(0),this._version>0&&!this.needsToRecompute())return this._flags.delete(0),!0;var e=W;try{this.prepareSources(),W=this;var t=this._compute();(this._flags.has(3)||this._value!==t||0===this._version)&&(this._value=t,this._flags.delete(3),this._version+=1)}catch(e){this._value=e,this._flags.add(3),this._version+=1}return W=e,this.cleanupSources(),this._flags.delete(0),!0},Object.defineProperty(t.prototype,"value",{get:function(){if(this._flags.has(0))throw new Error("Cycle detected");var e=this.addDependency();if(this._refresh(),void 0!==e&&(e._version=this._version),this._flags.has(3))throw this._value;return this._value},enumerable:!1,configurable:!0}),t.prototype.needsToRecompute=function(){for(var e=this._sources;void 0!==e;e=e._nextSource)if(e._source._version!==e._version||!e._source._refresh()||e._source._version!==e._version)return!0;return!1},t.prototype.prepareSources=function(){for(var e=this._sources;void 0!==e;e=e._nextSource){var t=e._source._node;if(void 0!==t&&(e._rollbackNode=t),e._source._node=e,e._version=-1,void 0===e._nextSource){this._sources=e;break}}},t.prototype.cleanupSources=function(){for(var e,t=this._sources;void 0!==t;){var r=t._prevSource;-1===t._version?(void 0!==r&&(r._nextSource=t._nextSource),void 0!==t._nextSource&&(t._nextSource._prevSource=r)):e=t,t._source._node=t._rollbackNode,void 0!==t._rollbackNode&&(t._rollbackNode=void 0),t=r}this._sources=e},t}(X);var Z=r.getLazyDecorator((function(e,t){try{var r=t[A].getAll(e);return 1===r.length?r[0]:r}catch(e){}return null}));var $=function(){function e(){}return e=u([r.injectable()],e)}(),ee=function(){return{middleware:[],beforeCombineRootReducers:[],afterCombineRootReducers:[],enhancer:[],preloadedStateHandler:[],afterCreateStore:[],provider:[]}},te=function(e,t,r){Object.keys(e).forEach((function(n){var o,i=t[n].filter(Boolean),a=r[n];(o=e[n]).push.apply(o,f(f([],s(i),!1),s(a),!1))}))},re=function(e,t,r){e instanceof $&&"number"==typeof r&&("function"==typeof e.beforeCombineRootReducers&&(t.beforeCombineRootReducers[r]=function(t){return e.beforeCombineRootReducers(t)}),"function"==typeof e.afterCombineRootReducers&&(t.afterCombineRootReducers[r]=function(t){return e.afterCombineRootReducers(t)}),"function"==typeof e.preloadedStateHandler&&(t.preloadedStateHandler[r]=function(t){return e.preloadedStateHandler(t)}),"function"==typeof e.enhancer&&(t.enhancer[r]=e.enhancer.bind(e)),"function"==typeof e.middleware&&(t.middleware[r]=e.middleware.bind(e)),"function"==typeof e.afterCreateStore&&(t.afterCreateStore[r]=e.afterCreateStore.bind(e)),"function"==typeof e.provider&&(t.provider[r]=e.provider.bind(e)))},ne=function(e,t){e instanceof $&&("function"==typeof e.beforeCombineRootReducers&&t.beforeCombineRootReducers.push((function(t){return e.beforeCombineRootReducers(t)})),"function"==typeof e.afterCombineRootReducers&&t.afterCombineRootReducers.push((function(t){return e.afterCombineRootReducers(t)})),"function"==typeof e.preloadedStateHandler&&t.preloadedStateHandler.push((function(t){return e.preloadedStateHandler(t)})),"function"==typeof e.enhancer&&t.enhancer.push(e.enhancer.bind(e)),"function"==typeof e.middleware&&t.middleware.push(e.middleware.bind(e)),"function"==typeof e.afterCreateStore&&t.afterCreateStore.push(e.afterCreateStore.bind(e)),"function"==typeof e.provider&&t.provider.push(e.provider.bind(e)))};var oe=function(e,t,r){var n,o,i,a,u,c,l=(void 0===r?{}:r).immediate;if("function"!=typeof t)throw new Error("The 'listener' should be a function.");if(e[p]){if(l)try{t()}catch(e){console.error(e)}c=null===(i=e[p])||void 0===i?void 0:i.subscribe(t)}else{var s,f=null!==(a=e[b])&&void 0!==a?a:[];f.push((function(){var r;if(l)try{t()}catch(e){console.error(e)}s=null===(r=e[p])||void 0===r?void 0:r.subscribe(t)})),c=function(){return s()},Object.assign(e,((n={})[b]=f,n))}var d=null!==(u=e[h])&&void 0!==u?u:new Set,v=function(){c(),d.delete(v)};return d.add(v),e[h]||Object.assign(e,((o={})[h]=d,o)),v},ie=function(e){var t=e;return{get modules(){return t[E]},get identifier(){return t[C]},get store(){return t[p]},get container(){return t[A]},get state(){return t[y]},get initState(){return t[M]},get enablePatches(){return t[_]},get enableAutoFreeze(){return t[O]},get strict(){return t[w]},get enableInspector(){return t[j]},get checkAction(){return t[R]}}};Object.defineProperty(e,"applyPatches",{enumerable:!0,get:function(){return t.apply}}),Object.defineProperty(e,"current",{enumerable:!0,get:function(){return t.current}}),Object.defineProperty(e,"original",{enumerable:!0,get:function(){return t.original}}),Object.defineProperty(e,"unsafe",{enumerable:!0,get:function(){return t.unsafe}}),Object.defineProperty(e,"METADATA_KEY",{enumerable:!0,get:function(){return r.METADATA_KEY}}),Object.defineProperty(e,"ModuleRef",{enumerable:!0,get:function(){return r.ModuleRef}}),Object.defineProperty(e,"Optional",{enumerable:!0,get:function(){return r.Optional}}),Object.defineProperty(e,"bindModules",{enumerable:!0,get:function(){return r.bindModules}}),Object.defineProperty(e,"createContainer",{enumerable:!0,get:function(){return r.createContainer}}),Object.defineProperty(e,"forwardRef",{enumerable:!0,get:function(){return r.forwardRef}}),Object.defineProperty(e,"getLazyDecorator",{enumerable:!0,get:function(){return r.getLazyDecorator}}),Object.defineProperty(e,"getMetadata",{enumerable:!0,get:function(){return r.getMetadata}}),Object.defineProperty(e,"inject",{enumerable:!0,get:function(){return r.inject}}),Object.defineProperty(e,"multiInject",{enumerable:!0,get:function(){return r.multiInject}}),Object.defineProperty(e,"multiOptional",{enumerable:!0,get:function(){return r.multiOptional}}),Object.defineProperty(e,"optional",{enumerable:!0,get:function(){return r.optional}}),e.PluginModule=$,e.ViewModule=k,e.action=function(e,r,n){var o=n.value;return a(a({},n),{value:function(){for(var n,i=this,u=[],c=0;c<arguments.length;c++)u[c]=arguments[c];var l=ie(this);if(void 0===l.store)throw new Error("'this' in method '".concat(r.toString(),"' of class '").concat(e.constructor.name,"' decorated by '@action' must be bound to the current class instance."));if("function"==typeof l.checkAction)try{l.checkAction({target:this,ref:l,method:r,args:u})}catch(e){console.error(e)}if(void 0===d)try{var f=l.store.getState(),p=void 0,v=void 0,b=void 0;l.enablePatches?(p=(n=s(t.create(f,(function(e){d=e;o.apply(i,u)}),{enablePatches:!0,strict:l.strict,enableAutoFreeze:l.enableAutoFreeze}),3))[0],v=n[1],b=n[2]):p=t.create(f,(function(e){d=e;o.apply(i,u)}),{strict:l.strict,enableAutoFreeze:l.enableAutoFreeze}),d=void 0,l.store.dispatch(a({type:l.identifier,method:r,params:u,state:p,_reactant:P},l.enablePatches?{_patches:v,_inversePatches:b}:{}))}finally{d=void 0}else o.apply(this,u)}})},e.actionIdentifier=P,e.applyMiddleware=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){function r(){var r=t.apply(this,f([],s(arguments),!1))||this;return r.enhancer=n.applyMiddleware.apply(null,e),r}return i(r,t),r}($)},e.areShallowEqualWithArray=N,e.areShallowEqualWithObject=function(e,t){if(H(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(var o=0;o<r.length;o+=1)if(!Object.prototype.hasOwnProperty.call(t,r[o])||!H(e[r[o]],t[r[o]]))return!1;return!0},e.assign=z,e.assignPlugin=re,e.autobind=function(e,t,r){var n=r.value;return{configurable:r.configurable,enumerable:r.enumerable,get:function(){if(this===e)return n;if(e.constructor!==this.constructor&&e.constructor===Object.getPrototypeOf(this).constructor)return n;var r=n.bind(this);return z(this,t,r,{enumerable:!1}),r},set:function(e){z(this,t,e)}}},e.checkActionKey=R,e.compose=V,e.computed=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(1===e.length&&"function"==typeof e[0])return function(t,r,n){var o=e[0],i=B((function(e){var t;return[null===(t=e[p])||void 0===t?void 0:t.getState()]}),(function(){return o(this)})),u=B((function(e){var t=K();return e[S]&&!t&&o(e),i.call(e)}),n.get);return a(a({},n),{get:function(){return u.call(this)}})};var r=e[2],n=new WeakMap;return a(a({},r),{get:function(){if(!this[S])return r.get.call(this);var e=K();if(!this[p])return r.get.call(this);var t,o=n.get(this);if(e)return(null==o?void 0:o.storeState)===this[p].getState()?o.value:r.get.call(this);o||(o={instance:(t=r.get.bind(this),new Q(t))},n.set(this,o));var i=o.instance.value;return o.value=i,o.storeState=this[p].getState(),i}})},e.containerKey=A,e.createSelectorWithArray=B,e.createState=function(e){return e},e.createStore=function(e){var o,i,u,c,d,h,k,z,H,N,V=e.modules,Y=e.container,L=e.ServiceIdentifiers,W=e.loadedModules,B=e.load,J=e.dynamicModules,U=e.pluginHooks,X=e.preloadedState,Q=e.devOptions,Z=void 0===Q?{}:Q,$=e.originalStore,ee=e.beforeReplaceReducer,oe=e.modulesMap,ie=void 0===oe?{}:oe,ae=!1,ue=$,ce={},le=[],se=null!==(d=Z.autoFreeze)&&void 0!==d&&d,fe=null!==(h=Z.autoComputed)&&void 0!==h&&h,de=null!==(k=Z.reduxDevTools)&&void 0!==k&&k,pe=null!==(z=Z.enablePatches)&&void 0!==z&&z,ve=null!==(H=Z.enableInspector)&&void 0!==H&&H,be=null!==(N=Z.strict)&&void 0!==N&&N,he=Z.checkAction,ye={middleware:[],beforeCombineRootReducers:[],afterCombineRootReducers:[],enhancer:[],preloadedStateHandler:[],afterCreateStore:[],provider:[]},ge={middleware:[],beforeCombineRootReducers:[],afterCombineRootReducers:[],enhancer:[],preloadedStateHandler:[],afterCreateStore:[],provider:[]};J.forEach((function(e,t){try{var r=Y.getAll(t);e.value=e.multiple?r:r[0]}catch(e){}}));try{for(var me=l(V),_e=me.next();!_e.done;_e=me.next()){var Se=_e.value,Oe="function"==typeof Se?Se:Se.provide;L.has(Oe)||L.set(Oe,[])}}catch(e){o={error:e}}finally{try{_e&&!_e.done&&(i=me.return)&&i.call(me)}finally{if(o)throw o.error}}var we=r.getMetadata(r.METADATA_KEY.multiple),je=Array.from(L),Re=Array.from(L.keys());je.sort((function(e,t){var n,o,i=s(e,1)[0],a=s(t,1)[0],u=[];try{u=null!==(n=Reflect.getMetadata(r.METADATA_KEY.paramtypes,i))&&void 0!==n?n:[]}catch(e){}var c=[];try{c=null!==(o=Reflect.getMetadata(r.METADATA_KEY.paramtypes,a))&&void 0!==o?o:[]}catch(e){}return u.length-c.length})),L.clear(),je.forEach((function(e){var t=s(e,2),r=t[0],n=t[1];L.set(r,n)}));var Pe=function(e){var r=we.has(e);if(Y.isBound(e)&&(r||!r&&!W.has(e))){var o=Y.getAll(e);W.add(e),o.forEach((function(i,u){var c,l,d,h,k,z,H,N=Re.indexOf(e);-1===N?ne(i,ye):re(i,ge,N);var I=e.name,q="string"==typeof e?e:i[x];if(null!=q||(q=F(null!=I?I:String(e))),"string"!=typeof q)throw new Error("'".concat(I,"' module 'options.name' property in '@injectable(options)' should be defined as a valid 'string'."));if(o.length>1&&(q+=":".concat(u)),ie[q])throw new Error("Unexpected multiple instances, provider: '".concat(null!=I?I:e,"' module '").concat(q,"' property and other module conflicts. Please check the token for dependency injection."));if(Object.assign(ie,((c={})[q]=i,c)),!("object"!=typeof i||null===i||i[E]&&r)){if("[object Object]"===toString.call(i[y])){var V={};if(0===Object.keys(i[y]).length)throw new Error("\n '".concat(I,"' class property 'state' must have at least one state key.\n "));var L=((l={})[m]={enumerable:!1,configurable:!1,writable:!1,value:V},l),W=function(e){var t,r=Object.getOwnPropertyDescriptor(i,e);if(void 0===r)return"continue";Object.assign(i[y],((t={})[e]=r.value,t)),L[e]={enumerable:!0,configurable:!0,get:function(){var t=this[y][e];if(!fe)return t;if(!K()&&V[e]&&!D(V[e].value,t))try{V[e].value=t}catch(r){JSON.stringify(V[e].value)!==JSON.stringify(t)&&console.error("[Reactant] The '".concat(e,"' state value of the module '").concat(I,"' has been changed outside the common reducer, which may cause the state to be out of sync. Please check middleware to update the state value without signal updating."))}return t},set:function(t){this[y][e]=t}}};for(var U in i[y])W(U);var X=se?t.create(a({},i[y]),(function(){}),{enableAutoFreeze:se}):i[y];Object.assign(L,((d={})[M]={enumerable:!1,configurable:!1,writable:!1,value:X},d));var Q=Object.keys(X).reduce((function(e,t){var r,n,o=i[g]&&Object.hasOwnProperty.call(i[g],t)?i[g][t]:X[t];if("function"==typeof o){var a=o,u=a(void 0,{});return Object.assign(e,((r={})[t]=function(e,r){return void 0===e&&(e=u),r._reactant===P&&r.state[q]?r.state[q][t]:a(e,r)},r))}V[t]=G(o);var c=V[t];return Object.assign(e,((n={})[t]=function(e,r){if(void 0===e&&(e=o),r._reactant===P&&r.state[q]){var n=r.state[q][t];return fe&&!D(n,e)&&(c.value=n),n}return e},n))}),{});ae=!0;var Z=n.combineReducers(Q);Object.assign(ce,((h={})[q]=Z,h)),Object.defineProperties(i,L),Object.defineProperties(i,((k={})[y]={enumerable:!1,configurable:!1,get:function(){var e=K();if(e)return e[q];if(!ue)return X;var t=ue.getState()[q];return se&&!Object.isFrozen(t)?Object.freeze(t):t}},k))}Array.isArray(i[b])||Object.assign(i,((z={})[b]=[],z)),le.push(i[b]);try{Object.defineProperties(i,((H={})[E]={enumerable:!1,configurable:!1,writable:!1,value:ie},H[C]={enumerable:!1,configurable:!1,writable:!1,value:q},H[p]={enumerable:!1,configurable:!1,get:function(){return ue}},H[A]={enumerable:!1,configurable:!1,get:function(){return Y}},H[T]={enumerable:!1,configurable:!1,value:J},H[v]={enumerable:!1,configurable:!1,value:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];B.apply(void 0,f([],s(e),!1))}},H[w]={enumerable:!1,configurable:!1,value:be},H[O]={enumerable:!1,configurable:!1,value:se},H[_]={enumerable:!1,configurable:!1,value:pe},H[S]={enumerable:!1,configurable:!1,value:fe},H[j]={enumerable:!1,configurable:!1,value:ve},H[R]={enumerable:!1,configurable:!1,value:he},H))}catch(t){throw console.error("provide: '".concat(e.toString(),"' has unexpected errors.")),t}}}))}};try{for(var Ae=l(L),Ce=Ae.next();!Ce.done;Ce=Ae.next()){Pe(s(Ce.value,1)[0])}}catch(e){u={error:e}}finally{try{Ce&&!Ce.done&&(c=Ae.return)&&c.call(Ae)}finally{if(u)throw u.error}}if(te(U,ge,ye),void 0===ue){var Ee=ae?n.combineReducers(ce=I(U.beforeCombineRootReducers,ce)):function(){return null},xe=q(de,Z.reduxDevToolsOptions);ue=n.createStore(I(U.afterCombineRootReducers,Ee),I(U.preloadedStateHandler,X?Object.entries(X).reduce((function(e,t){var r,n=s(t,2),o=n[0],i=n[1];return ie[o]?Object.assign(e,((r={})[o]=i,r)):e}),{}):X),xe.apply(void 0,f([n.applyMiddleware.apply(void 0,f([],s(U.middleware),!1))],s(U.enhancer),!1))),ae&&Object.assign(ue,{reducers:ce}),I(U.afterCreateStore,ue)}else if(ae){ue.reducers=a(a({},ue.reducers),I(U.beforeCombineRootReducers,ce));Ee=n.combineReducers(ue.reducers);var Me=I(U.afterCombineRootReducers,Ee);"function"==typeof ee&&ee(),ue.replaceReducer(Me)}else"function"==typeof ee&&ee();return I(Array.prototype.concat.apply([],le)),ue},e.defaultMemoize=Y,e.defaultStateKey=g,e.dispatch=function(e,t){var r=e[p];if(!r)throw new Error("Store for '".concat(e.constructor.name,"' service does not exist. Please make sure you have set any Redux state, or it should not be executed synchronously in class constructor."));r.dispatch(t)},e.dynamic=function(e,t){return function(n,o){var i,a,u=null!==(i=null==t?void 0:t.multiple)&&void 0!==i&&i,c=null!==(a=null==t?void 0:t.useToken)&&void 0!==a&&a;return u&&r.multiOptional(e)((function(){})),{configurable:!0,enumerable:!0,get:function(){var t;if(!c)return null===(t=this[E])||void 0===t?void 0:t[e];var r=this[T];if(r.has(e))return r.get(e).value;var n=void 0;try{var o=this[A].getAll(e);n=u?o:o[0]}catch(e){}return r.set(e,{multiple:u,value:n}),n},set:function(e){var t;throw new Error("Cannot assign to read only 'dynamic' injection property '".concat(o.toString(),"' of class '").concat(null!==(t=this[C])&&void 0!==t?t:this.constructor.name,"'"))}}}},e.dynamicModulesKey=T,e.enableAutoComputedKey=S,e.enableAutoFreezeKey=O,e.enableInspectorKey=j,e.enablePatchesKey=_,e.generatePluginHooks=ee,e.getComposeEnhancers=q,e.getRef=ie,e.getStageName=F,e.getStagedState=K,e.identifierKey=C,e.initStateKey=M,e.injectable=function(e){void 0===e&&(e={});var t=r.injectable(e);return function(r){var n=e.name;return"string"==typeof n&&Object.defineProperty(r.prototype,x,{enumerable:!1,configurable:!1,writable:!1,value:n}),t(r)}},e.isEqual=D,e.isEqualExceptFunction=H,e.lazy=Z,e.load=function(e,t){return new Promise((function(r){if(e[v])e[v](t,r);else var n=oe(e,(function(){e[v]&&(n(),e[v](t,r))}))}))},e.loaderKey=v,e.mergePluginHooks=te,e.modulesKey=E,e.nameKey=x,e.perform=I,e.pushPlugin=ne,e.signal=G,e.signalMapKey=m,e.state=function(e,t,r){var n,o,i=e;Object.assign(e,((n={})[y]=a(a({},i[y]),((o={})[t]=void 0,o)),n))},e.stateKey=y,e.storeKey=p,e.strictKey=w,e.subscribe=oe,e.subscriptionsKey=b,e.unsubscriptionsKey=h,e.untracked=function(e){if(U>0)return e();var t=W;W=void 0,U+=1;try{return e()}finally{U-=1,W=t}},e.watch=function(e,t,r,n){var o=void 0===n?{}:n,i=o.multiple,a=void 0!==i&&i,u=o.isEqual,c=void 0===u?D:u;if("function"!=typeof r){var l=Object.getPrototypeOf(e).constructor.name;throw new Error("The 'watcher' should be a function in the class '".concat(l,"'."))}var s=r,f=t();if(a){if(!Array.isArray(f)){l=Object.getPrototypeOf(e).constructor.name;throw new Error("The 'selector' should be a function that returns an array as watching multiple values in the class '".concat(l,"'."))}return oe(e,(function(){for(var e=t(),r=f.length,n=0;n<r;n+=1)if(!c(e[n],f[n])){var o=f;return f=e,void s(e,o)}}))}return oe(e,(function(){var e=t();if(!c(e,f)){var r=f;f=e,s(e,r)}}))}}));