@cclr/model 1.0.9
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/lib/index.d.ts +3 -0
- package/lib/index.js +2 -0
- package/lib/index.js.LICENSE.txt +1 -0
- package/lib/index.js.map +1 -0
- package/lib/src/compose.d.ts +2 -0
- package/lib/src/global.d.ts +24 -0
- package/lib/src/middleware/index.d.ts +51 -0
- package/lib/src/model.d.ts +14 -0
- package/lib/src/rebuildAction.d.ts +2 -0
- package/lib/src/rebuildAsyncAction.d.ts +2 -0
- package/lib/src/type.d.ts +27 -0
- package/package.json +25 -0
package/lib/index.d.ts
ADDED
package/lib/index.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see index.js.LICENSE.txt */
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Model=t():e.Model=t()}(self,(()=>{return e={40:function(e,t,n){var r,o,i;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,o=[t,n(803),n(762)],void 0===(i="function"==typeof(r=function(e,t,r){"use strict";var o=n(151);Object.defineProperty(e,"__esModule",{value:!0});var i={};e.default=void 0,t=o(t),Object.keys(r).forEach((function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(i,t)||t in e&&e[t]===r[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return r[t]}}))}));var u=t.default;e.default=u})?r.apply(t,o):r)||(e.exports=i)},223:function(e,t){var n,r,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,r=[t],n=function(e){"use strict";function t(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce((function(e,t){return function(){return e(t.apply(void 0,arguments))}}))}Object.defineProperty(e,"__esModule",{value:!0}),e.compose=t},void 0===(o="function"==typeof n?n.apply(t,r):n)||(e.exports=o)},744:function(e,t){var n,r,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,r=[t],void 0===(o="function"==typeof(n=function(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getState=e.getCtx=e.GlobalModal=void 0;var t={__MId:1,State:{},Actions:{},Subscribes:{}};e.GlobalModal=t;var n=function(e){return{state:t.State[e],actions:t.Actions[e],subscribes:t.Subscribes[e]}};e.getCtx=n;var r=function(e){return t.State[e]};e.getState=r})?n.apply(t,r):n)||(e.exports=o)},501:function(e,t,n){var r,o,i;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,o=[t,n(306),n(404),n(744),n(343)],void 0===(i="function"==typeof(r=function(e,t,r,o,i){"use strict";var u=n(151);Object.defineProperty(e,"__esModule",{value:!0}),e.updateState=e.setterFun=e.runAction=e.returnState=e.publish=e.presetMiddleware=e.logger=e.asyncRunAction=e.asyncLogger=void 0,t=u(t),r=u(r);var a=function(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,i){function u(e){try{f(r.next(e))}catch(e){i(e)}}function a(e){try{f(r.throw(e))}catch(e){i(e)}}function f(e){e.done?n(e.value):o(e.value).then(u,a)}f((r=r.apply(e,t||[])).next())}))},f=function(e){return function(t){return function(n){console.log(e.modelName,"- action -start: ",e.action.name);var r=t(n);return console.log(e.modelName,"- action -end: ",e.action.name),r}}};e.logger=f;var c=function(e){return function(t){return function(n){return a(void 0,void 0,void 0,r.default.mark((function o(){var i;return r.default.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return console.log(e.modelName,"- action -start: ",e.action.name),r.next=3,t(n);case 3:return i=r.sent,console.log(e.modelName,"- action -end: ",e.action.name),r.abrupt("return",i);case 6:case"end":return r.stop()}}),o)})))}}};e.asyncLogger=c;var s=function(e){return function(t){return function(n){var r=(0,e.action)(e.payload,{state:e.state,actions:e.actions});return r.then?console.warn("actions, 内不能处理异步函数返回,请使用asyncActions"):e.newState=r,t(n)}}};e.runAction=s;var l=function(e){return function(t){return function(n){return a(void 0,void 0,void 0,r.default.mark((function o(){var i,u,a,f;return r.default.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return i=e.action,u=e.payload,a=e.state,f=e.actions,r.next=3,i(u,{state:a,actions:f});case 3:return e.newState=r.sent,r.abrupt("return",t(n));case 5:case"end":return r.stop()}}),o)})))}}};e.asyncRunAction=l;var p=function(e){return function(n){return function(r){var i=e.newState,u=e.modelName;if("function"==typeof i)e.setterFun=i;else if("object"===(0,t.default)(i)){var a=Object.assign(Object.assign({},o.GlobalModal.State[u]),i||{});e.setterFun=function(e){e[u]=a}}return n(r)}}};e.setterFun=p;var d=function(e){return function(t){return function(n){var r=e.setterFun,u=e.modelName;return r&&(o.GlobalModal.State[u]=(0,i.produce)(o.GlobalModal.State[u],r)),t(n)}}};e.updateState=d;var y=function(e){return function(t){return function(n){return e.subscribes.forEach((function(e){e({})})),t(n)}}};e.publish=y;var v=function(e){return function(t){return function(t){return(0,o.getState)(e.modelName)}}};e.returnState=v;var h=[f,s,p,d,y,v];e.presetMiddleware=h})?r.apply(t,o):r)||(e.exports=i)},803:function(e,t,n){var r,o,i;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,o=[t,n(826),n(554),n(577),n(744),n(360),n(520)],void 0===(i="function"==typeof(r=function(e,t,r,o,i,u,a){"use strict";var f=n(151);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,t=f(t),r=f(r),o=f(o);var c=function(){function e(n){(0,r.default)(this,e),Object.entries(n).forEach((function(e){var n=(0,t.default)(e,2),r=n[0],o=n[1];i.GlobalModal.__MId++,i.GlobalModal.State[r]=o.state,i.GlobalModal.Actions[r]=Object.assign(Object.assign({},(0,a.rebuildAsyncActions)(o.asyncActions,r)),(0,u.rebuildActions)(o.actions,r))}))}return(0,o.default)(e,[{key:"getState",value:function(e){return i.GlobalModal.State[e]}},{key:"getAction",value:function(e){return i.GlobalModal.Actions[e]}},{key:"getModel",value:function(){}},{key:"subscribe",value:function(e,t){i.GlobalModal.Subscribes[e]||(i.GlobalModal.Subscribes[e]=[]),i.GlobalModal.Subscribes[e].push(t)}},{key:"unsubscribe",value:function(e,t){i.GlobalModal.Subscribes[e]||(i.GlobalModal.Subscribes[e]=[]),i.GlobalModal.Subscribes[e]=i.GlobalModal.Subscribes[e].filter((function(e){return e!==t}))}},{key:"applyMiddleware",value:function(){}}]),e}();e.default=c})?r.apply(t,o):r)||(e.exports=i)},360:function(e,t,n){var r,o,i;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,o=[t,n(513),n(826),n(223),n(744),n(501)],void 0===(i="function"==typeof(r=function(e,t,r,o,i,u){"use strict";var a=n(151);Object.defineProperty(e,"__esModule",{value:!0}),e.rebuildActions=e.presetMiddleware=void 0,t=a(t),r=a(r);var f=[u.logger,u.runAction,u.setterFun,u.updateState,u.publish,u.returnState];e.presetMiddleware=f;var c=function(e,t){var n={};return Object.entries(e).forEach((function(e){var o=(0,r.default)(e,2),i=o[0],u=o[1];n[i]=s(u,t)})),n};e.rebuildActions=c;var s=function(e,n){return function(r){var u=(0,i.getCtx)(n),a=u.state,c=u.actions,s=u.subscribes,l={payload:r,state:a,actions:c,action:e,subscribes:s,modelName:n,newState:null,setterFun:void 0},p=f.map((function(e){return e(l)}));return o.compose.apply(void 0,(0,t.default)(p))((function(){return(0,i.getState)(n)}))()}}})?r.apply(t,o):r)||(e.exports=i)},520:function(e,t,n){var r,o,i;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,o=[t,n(513),n(826),n(223),n(744),n(501)],void 0===(i="function"==typeof(r=function(e,t,r,o,i,u){"use strict";var a=n(151);Object.defineProperty(e,"__esModule",{value:!0}),e.rebuildAsyncActions=e.presetMiddleware=void 0,t=a(t),r=a(r);var f=[u.asyncLogger,u.asyncRunAction,u.setterFun,u.updateState,u.publish,u.returnState];e.presetMiddleware=f;var c=function(e,t){var n={};return Object.entries(e).forEach((function(e){var o=(0,r.default)(e,2),i=o[0],u=o[1];n[i]=s(u,t)})),n};e.rebuildAsyncActions=c;var s=function(e,n){return function(r){var u=(0,i.getCtx)(n),a=u.state,c=u.actions,s=u.subscribes,l={payload:r,state:a,actions:c,action:e,subscribes:s,modelName:n,newState:null,setterFun:void 0},p=f.map((function(e){return e(l)}));return o.compose.apply(void 0,(0,t.default)(p))((function(){return(0,i.getState)(n)}))()}}})?r.apply(t,o):r)||(e.exports=i)},762:function(e,t){var n,r,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,r=[t],void 0===(o="function"==typeof(n=function(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0})})?n.apply(t,r):n)||(e.exports=o)},214:function(e,t,n){var r,o,i;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,o=[n(43),n(456),n(553),n(853),n(302),n(554),n(577),n(779),n(826),n(306)],r=function(t,r,o,i,u,a,f,c,s,l){"use strict";var p=n(151);function d(e){var t=y();return function(){var n,r=(0,i.default)(e);if(t){var u=(0,i.default)(this).constructor;n=Reflect.construct(r,arguments,u)}else n=r.apply(this,arguments);return(0,o.default)(this,n)}}function y(){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(e){return!1}}function v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?v(Object(n),!0).forEach((function(t){(0,c.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function b(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=g(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},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 i,u=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return u=e.done,e},e:function(e){a=!0,i=e},f:function(){try{u||null==n.return||n.return()}finally{if(a)throw i}}}}function g(e,t){if(e){if("string"==typeof e)return x(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?x(e,t):void 0}}function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}t=p(t),r=p(r),o=p(o),i=p(i),u=p(u),a=p(a),f=p(f),c=p(c),s=p(s),l=p(l);var m=Object.defineProperty,w=Object.getOwnPropertyDescriptor,_=Object.getOwnPropertyNames,O=Object.prototype.hasOwnProperty,S=function(e,t,n,r){if(t&&"object"==(0,l.default)(t)||"function"==typeof t){var o,i=b(_(t));try{var u=function(){var i=o.value;!O.call(e,i)&&i!==n&&m(e,i,{get:function(){return t[i]},enumerable:!(r=w(t,i))||r.enumerable})};for(i.s();!(o=i.n()).done;)u()}catch(e){i.e(e)}finally{i.f()}}return e},T=function(e){return S(m({},"__esModule",{value:!0}),e)},j={};(function(e,t){for(var n in t)m(e,n,{get:t[n],enumerable:!0})})(j,{Immer:function(){return xe},applyPatches:function(){return ke},castDraft:function(){return Fe},castImmutable:function(){return Ne},createDraft:function(){return Ee},current:function(){return we},enableMapSet:function(){return Se},enablePatches:function(){return Oe},finishDraft:function(){return Le},freeze:function(){return J},immerable:function(){return P},isDraft:function(){return L},isDraftable:function(){return F},nothing:function(){return M},original:function(){return D},produce:function(){return je},produceWithPatches:function(){return Me},setAutoFreeze:function(){return Pe},setUseStrictShallowCopy:function(){return Ae}}),e.exports=T(j);var M=Symbol.for("immer-nothing"),P=Symbol.for("immer-draftable"),A=Symbol.for("immer-state");function k(e){throw new Error("[Immer] minified error nr: ".concat(e,". Full error at: https://bit.ly/3cXEKWf"))}var E=Object.getPrototypeOf;function L(e){return!!e&&!!e[A]}function F(e){var t;return!!e&&(G(e)||Array.isArray(e)||!!e[P]||!(null===(t=e.constructor)||void 0===t||!t[P])||B(e)||K(e))}var N=Object.prototype.constructor.toString();function G(e){if(!e||"object"!=(0,l.default)(e))return!1;var t=E(e);if(null===t)return!0;var n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===N}function D(e){return L(e)||k(15,e),e[A].t}function R(e,t){0===I(e)?Object.entries(e).forEach((function(n){var r=(0,s.default)(n,2),o=r[0],i=r[1];t(o,i,e)})):e.forEach((function(n,r){return t(r,n,e)}))}function I(e){var t=e[A];return t?t.o:Array.isArray(e)?1:B(e)?2:K(e)?3:0}function z(e,t){return 2===I(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function C(e,t){return 2===I(e)?e.get(t):e[t]}function U(e,t,n){var r=I(e);2===r?e.set(t,n):3===r?e.add(n):e[t]=n}function W(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function B(e){return e instanceof Map}function K(e){return e instanceof Set}function Y(e){return e.e||e.t}function $(e,t){if(B(e))return new Map(e);if(K(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&G(e))return E(e)?h({},e):Object.assign(Object.create(null),e);var n=Object.getOwnPropertyDescriptors(e);delete n[A];for(var r=Reflect.ownKeys(n),o=0;o<r.length;o++){var i=r[o],u=n[i];!1===u.writable&&(u.writable=!0,u.configurable=!0),(u.get||u.set)&&(n[i]={configurable:!0,writable:!0,enumerable:u.enumerable,value:e[i]})}return Object.create(E(e),n)}function J(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return q(e)||L(e)||!F(e)||(I(e)>1&&(e.set=e.add=e.clear=e.delete=X),Object.freeze(e),t&&R(e,(function(e,t){return J(t,!0)}),!0)),e}function X(){k(2)}function q(e){return Object.isFrozen(e)}var H,Q={};function V(e){var t=Q[e];return t||k(0,e),t}function Z(e,t){Q[e]||(Q[e]=t)}function ee(){return H}function te(e,t){return{a:[],i:e,p:t,P:!0,d:0}}function ne(e,t){t&&(V("Patches"),e.f=[],e.h=[],e.b=t)}function re(e){oe(e),e.a.forEach(ue),e.a=null}function oe(e){e===H&&(H=e.i)}function ie(e){return H=te(H,e)}function ue(e){var t=e[A];0===t.o||1===t.o?t.x():t.m=!0}function ae(e,t){t.d=t.a.length;var n=t.a[0];return void 0!==e&&e!==n?(n[A].s&&(re(t),k(4)),F(e)&&(e=fe(t,e),t.i||se(t,e)),t.f&&V("Patches").T(n[A].t,e,t.f,t.h)):e=fe(t,n,[]),re(t),t.f&&t.b(t.f,t.h),e!==M?e:void 0}function fe(e,t,n){if(q(t))return t;var r=t[A];if(!r)return R(t,(function(o,i){return ce(e,r,t,o,i,n)}),!0),t;if(r.n!==e)return t;if(!r.s)return se(e,r.t,!0),r.t;if(!r.c){r.c=!0,r.n.d--;var o=r.e,i=o,u=!1;3===r.o&&(i=new Set(o),o.clear(),u=!0),R(i,(function(t,i){return ce(e,r,o,t,i,n,u)})),se(e,o,!1),n&&e.f&&V("Patches").g(r,n,e.f,e.h)}return r.e}function ce(e,t,n,r,o,i,u){if(L(o)){var a=fe(e,o,i&&t&&3!==t.o&&!z(t.r,r)?i.concat(r):void 0);if(U(n,r,a),!L(a))return;e.P=!1}else u&&n.add(o);if(F(o)&&!q(o)){if(!e.p.y&&e.d<1)return;fe(e,o),(!t||!t.n.i)&&se(e,o)}}function se(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];!e.i&&e.p.y&&e.P&&J(t,n)}function le(e,t){var n=Array.isArray(e),r={o:n?1:0,n:t?t.n:ee(),s:!1,c:!1,r:{},i:t,t:e,u:null,e:null,x:null,l:!1},o=r,i=pe;n&&(o=[r],i=de);var u=Proxy.revocable(o,i),a=u.revoke,f=u.proxy;return r.u=f,r.x=a,f}var pe={get:function(e,t){if(t===A)return e;var n=Y(e);if(!z(n,t))return ve(e,n,t);var r=n[t];return e.c||!F(r)?r:r===ye(e.t,t)?(ge(e),e.e[t]=me(r,e)):r},has:function(e,t){return t in Y(e)},ownKeys:function(e){return Reflect.ownKeys(Y(e))},set:function(e,t,n){var r=he(Y(e),t);if(null!=r&&r.set)return r.set.call(e.u,n),!0;if(!e.s){var o=ye(Y(e),t),i=null==o?void 0:o[A];if(i&&i.t===n)return e.e[t]=n,e.r[t]=!1,!0;if(W(n,o)&&(void 0!==n||z(e.t,t)))return!0;ge(e),be(e)}return e.e[t]===n&&(void 0!==n||t in e.e)||Number.isNaN(n)&&Number.isNaN(e.e[t])||(e.e[t]=n,e.r[t]=!0),!0},deleteProperty:function(e,t){return void 0!==ye(e.t,t)||t in e.t?(e.r[t]=!1,ge(e),be(e)):delete e.r[t],e.e&&delete e.e[t],!0},getOwnPropertyDescriptor:function(e,t){var n=Y(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:1!==e.o||"length"!==t,enumerable:r.enumerable,value:n[t]}},defineProperty:function(){k(11)},getPrototypeOf:function(e){return E(e.t)},setPrototypeOf:function(){k(12)}},de={};function ye(e,t){var n=e[A];return(n?Y(n):e)[t]}function ve(e,t,n){var r,o=he(t,n);return o?"value"in o?o.value:null===(r=o.get)||void 0===r?void 0:r.call(e.u):void 0}function he(e,t){if(t in e)for(var n=E(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=E(n)}}function be(e){e.s||(e.s=!0,e.i&&be(e.i))}function ge(e){e.e||(e.e=$(e.t,e.n.p.S))}R(pe,(function(e,t){de[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),de.deleteProperty=function(e,t){return de.set.call(this,e,t,void 0)},de.set=function(e,t,n){return pe.set.call(this,e[0],t,n,e[0])};var xe=function(){function e(t){var n=this;(0,a.default)(this,e),this.y=!0,this.S=!1,this.produce=function(e,t,r){if("function"==typeof e&&"function"!=typeof t){var o=t;t=e;var i=n;return function(){for(var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o,r=arguments.length,u=new Array(r>1?r-1:0),a=1;a<r;a++)u[a-1]=arguments[a];return i.produce(n,(function(n){var r;return(r=t).call.apply(r,[e,n].concat(u))}))}}var u;if("function"!=typeof t&&k(6),void 0!==r&&"function"!=typeof r&&k(7),F(e)){var a=ie(n),f=me(e,void 0),c=!0;try{u=t(f),c=!1}finally{c?re(a):oe(a)}return ne(a,r),ae(u,a)}if(!e||"object"!=(0,l.default)(e)){if(void 0===(u=t(e))&&(u=e),u===M&&(u=void 0),n.y&&J(u,!0),r){var s=[],p=[];V("Patches").T(e,u,s,p),r(s,p)}return u}k(1,e)},this.produceWithPatches=function(e,t){return"function"==typeof e?function(t){for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];return n.produceWithPatches(t,(function(t){return e.apply(void 0,[t].concat(o))}))}:[n.produce(e,t,(function(e,t){r=e,o=t})),r,o];var r,o},"boolean"==typeof(null==t?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),"boolean"==typeof(null==t?void 0:t.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy)}return(0,f.default)(e,[{key:"createDraft",value:function(e){F(e)||k(8),L(e)&&(e=we(e));var t=ie(this),n=me(e,void 0);return n[A].l=!0,oe(t),n}},{key:"finishDraft",value:function(e,t){var n=e&&e[A];(!n||!n.l)&&k(9);var r=n.n;return ne(r,t),ae(void 0,r)}},{key:"setAutoFreeze",value:function(e){this.y=e}},{key:"setUseStrictShallowCopy",value:function(e){this.S=e}},{key:"applyPatches",value:function(e,t){var n;for(n=t.length-1;n>=0;n--){var r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));var o=V("Patches").A;return L(e)?o(e,t):this.produce(e,(function(e){return o(e,t)}))}}]),e}();function me(e,t){var n=B(e)?V("MapSet").I(e,t):K(e)?V("MapSet").D(e,t):le(e,t);return(t?t.n:ee()).a.push(n),n}function we(e){return L(e)||k(10,e),_e(e)}function _e(e){if(!F(e)||q(e))return e;var t,n=e[A];if(n){if(!n.s)return n.t;n.c=!0,t=$(e,n.n.p.S)}else t=$(e,!0);return R(t,(function(e,n){U(t,e,_e(n))})),n&&(n.c=!1),t}function Oe(){var e="replace",t="add",n="remove";function r(e,t,n,r){switch(e.o){case 0:case 2:return i(e,t,n,r);case 1:return o(e,t,n,r);case 3:return u(e,t,n,r)}}function o(r,o,i,u){var a,f,c=r.t,s=r.r,l=r.e;l.length<c.length&&(c=(a=[l,c])[0],l=a[1],i=(f=[u,i])[0],u=f[1]);for(var d=0;d<c.length;d++)if(s[d]&&l[d]!==c[d]){var y=o.concat([d]);i.push({op:e,path:y,value:p(l[d])}),u.push({op:e,path:y,value:p(c[d])})}for(var v=c.length;v<l.length;v++){var h=o.concat([v]);i.push({op:t,path:h,value:p(l[v])})}for(var b=l.length-1;c.length<=b;--b){var g=o.concat([b]);u.push({op:n,path:g})}}function i(r,o,i,u){var a=r.t,f=r.e;R(r.r,(function(r,c){var s=C(a,r),l=C(f,r),d=c?z(a,r)?e:t:n;if(s!==l||d!==e){var y=o.concat(r);i.push(d===n?{op:d,path:y}:{op:d,path:y,value:l}),u.push(d===t?{op:n,path:y}:d===n?{op:t,path:y,value:p(s)}:{op:e,path:y,value:p(s)})}}))}function u(e,r,o,i){var u=e.t,a=e.e,f=0;u.forEach((function(e){if(!a.has(e)){var u=r.concat([f]);o.push({op:n,path:u,value:e}),i.unshift({op:t,path:u,value:e})}f++})),f=0,a.forEach((function(e){if(!u.has(e)){var a=r.concat([f]);o.push({op:t,path:a,value:e}),i.unshift({op:n,path:a,value:e})}f++}))}function a(t,n,r,o){r.push({op:e,path:[],value:n===M?void 0:n}),o.push({op:e,path:[],value:t})}function f(r,o){return o.forEach((function(o){for(var i=o.path,u=o.op,a=r,f=0;f<i.length-1;f++){var s=I(a),p=i[f];"string"!=typeof p&&"number"!=typeof p&&(p=""+p),(0===s||1===s)&&("__proto__"===p||"constructor"===p)&&k(19),"function"==typeof a&&"prototype"===p&&k(19),a=C(a,p),"object"!=(0,l.default)(a)&&k(18,i.join("/"))}var d=I(a),y=c(o.value),v=i[i.length-1];switch(u){case e:switch(d){case 2:return a.set(v,y);case 3:k(16);default:return a[v]=y}case t:switch(d){case 1:return"-"===v?a.push(y):a.splice(v,0,y);case 2:return a.set(v,y);case 3:return a.add(y);default:return a[v]=y}case n:switch(d){case 1:return a.splice(v,1);case 2:return a.delete(v);case 3:return a.delete(o.value);default:return delete a[v]}default:k(17,u)}})),r}function c(e){if(!F(e))return e;if(Array.isArray(e))return e.map(c);if(B(e))return new Map(Array.from(e.entries()).map((function(e){var t=(0,s.default)(e,2);return[t[0],c(t[1])]})));if(K(e))return new Set(Array.from(e).map(c));var t=Object.create(E(e));for(var n in e)t[n]=c(e[n]);return z(e,P)&&(t[P]=e[P]),t}function p(e){return L(e)?c(e):e}Z("Patches",{A:f,g:r,T:a})}function Se(){var e=function(e,n){(0,r.default)(u,e);var i=d(u);function u(e,n){var r;return(0,a.default)(this,u),(r=i.call(this))[A]={o:2,i:n,n:n?n.n:ee(),s:!1,c:!1,e:void 0,r:void 0,t:e,u:(0,t.default)(r),l:!1,m:!1},r}return(0,f.default)(u,[{key:"size",get:function(){return Y(this[A]).size}},{key:"has",value:function(e){return Y(this[A]).has(e)}},{key:"set",value:function(e,t){var n=this[A];return p(n),(!Y(n).has(e)||Y(n).get(e)!==t)&&(o(n),be(n),n.r.set(e,!0),n.e.set(e,t),n.r.set(e,!0)),this}},{key:"delete",value:function(e){if(!this.has(e))return!1;var t=this[A];return p(t),o(t),be(t),t.t.has(e)?t.r.set(e,!1):t.r.delete(e),t.e.delete(e),!0}},{key:"clear",value:function(){var e=this[A];p(e),Y(e).size&&(o(e),be(e),e.r=new Map,R(e.t,(function(t){e.r.set(t,!1)})),e.e.clear())}},{key:"forEach",value:function(e,t){var n=this;Y(this[A]).forEach((function(r,o,i){e.call(t,n.get(o),o,n)}))}},{key:"get",value:function(e){var t=this[A];p(t);var n=Y(t).get(e);if(t.c||!F(n)||n!==t.t.get(e))return n;var r=me(n,t);return o(t),t.e.set(e,r),r}},{key:"keys",value:function(){return Y(this[A]).keys()}},{key:"values",value:function(){var e,t=this,n=this.keys();return e={},(0,c.default)(e,Symbol.iterator,(function(){return t.values()})),(0,c.default)(e,"next",(function(){var e=n.next();return e.done?e:{done:!1,value:t.get(e.value)}})),e}},{key:"entries",value:function(){var e,t=this,n=this.keys();return e={},(0,c.default)(e,Symbol.iterator,(function(){return t.entries()})),(0,c.default)(e,"next",(function(){var e=n.next();if(e.done)return e;var r=t.get(e.value);return{done:!1,value:[e.value,r]}})),e}},{key:n,value:function(){return this.entries()}}]),u}((0,u.default)(Map),Symbol.iterator);function n(t,n){return new e(t,n)}function o(e){e.e||(e.r=new Map,e.e=new Map(e.t))}var i=function(e,n){(0,r.default)(i,e);var o=d(i);function i(e,n){var r;return(0,a.default)(this,i),(r=o.call(this))[A]={o:3,i:n,n:n?n.n:ee(),s:!1,c:!1,e:void 0,t:e,u:(0,t.default)(r),a:new Map,m:!1,l:!1},r}return(0,f.default)(i,[{key:"size",get:function(){return Y(this[A]).size}},{key:"has",value:function(e){var t=this[A];return p(t),t.e?!!(t.e.has(e)||t.a.has(e)&&t.e.has(t.a.get(e))):t.t.has(e)}},{key:"add",value:function(e){var t=this[A];return p(t),this.has(e)||(l(t),be(t),t.e.add(e)),this}},{key:"delete",value:function(e){if(!this.has(e))return!1;var t=this[A];return p(t),l(t),be(t),t.e.delete(e)||!!t.a.has(e)&&t.e.delete(t.a.get(e))}},{key:"clear",value:function(){var e=this[A];p(e),Y(e).size&&(l(e),be(e),e.e.clear())}},{key:"values",value:function(){var e=this[A];return p(e),l(e),e.e.values()}},{key:"entries",value:function(){var e=this[A];return p(e),l(e),e.e.entries()}},{key:"keys",value:function(){return this.values()}},{key:n,value:function(){return this.values()}},{key:"forEach",value:function(e,t){for(var n=this.values(),r=n.next();!r.done;)e.call(t,r.value,r.value,this),r=n.next()}}]),i}((0,u.default)(Set),Symbol.iterator);function s(e,t){return new i(e,t)}function l(e){e.e||(e.e=new Set,e.t.forEach((function(t){if(F(t)){var n=me(t,e);e.a.set(t,n),e.e.add(n)}else e.e.add(t)})))}function p(e){e.m&&k(3,JSON.stringify(Y(e)))}Z("MapSet",{I:n,D:s})}var Te=new xe,je=Te.produce,Me=Te.produceWithPatches.bind(Te),Pe=Te.setAutoFreeze.bind(Te),Ae=Te.setUseStrictShallowCopy.bind(Te),ke=Te.applyPatches.bind(Te),Ee=Te.createDraft.bind(Te),Le=Te.finishDraft.bind(Te);function Fe(e){return e}function Ne(e){return e}},void 0===(i="function"==typeof r?r.apply(t,o):r)||(e.exports=i)},343:function(e,t,n){var r,o,i;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,o=[],void 0===(i="function"==typeof(r=function(){"use strict";e.exports=n(214)})?r.apply(t,o):r)||(e.exports=i)},891:function(e,t){var n,r,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,r=[],void 0===(o="function"==typeof(n=function(){"use strict";function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})?n.apply(t,r):n)||(e.exports=o)},42:function(e,t){var n,r,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,r=[],void 0===(o="function"==typeof(n=function(){"use strict";function t(e){if(Array.isArray(e))return e}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})?n.apply(t,r):n)||(e.exports=o)},883:function(e,t,n){var r,o,i;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,o=[],void 0===(i="function"==typeof(r=function(){"use strict";var t=n(891);function r(e){if(Array.isArray(e))return t(e)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})?r.apply(t,o):r)||(e.exports=i)},43:function(e,t){var n,r,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,r=[],void 0===(o="function"==typeof(n=function(){"use strict";function t(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})?n.apply(t,r):n)||(e.exports=o)},554:function(e,t){var n,r,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,r=[],void 0===(o="function"==typeof(n=function(){"use strict";function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})?n.apply(t,r):n)||(e.exports=o)},363:function(e,t,n){var r,o,i;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,o=[],r=function(){"use strict";var t=n(917),r=n(466);function o(n,i,u){return r()?(e.exports=o=Reflect.construct.bind(),e.exports.__esModule=!0,e.exports.default=e.exports):(e.exports=o=function(e,n,r){var o=[null];o.push.apply(o,n);var i=new(Function.bind.apply(e,o));return r&&t(i,r.prototype),i},e.exports.__esModule=!0,e.exports.default=e.exports),o.apply(null,arguments)}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},void 0===(i="function"==typeof r?r.apply(t,o):r)||(e.exports=i)},577:function(e,t,n){var r,o,i;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,o=[],void 0===(i="function"==typeof(r=function(){"use strict";var t=n(517);function r(e,n){for(var r=0;r<n.length;r++){var o=n[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,t(o.key),o)}}function o(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports})?r.apply(t,o):r)||(e.exports=i)},779:function(e,t,n){var r,o,i;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,o=[],void 0===(i="function"==typeof(r=function(){"use strict";var t=n(517);function r(e,n,r){return(n=t(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})?r.apply(t,o):r)||(e.exports=i)},853:function(e,t){var n,r,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,r=[],void 0===(o="function"==typeof(n=function(){"use strict";function t(n){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})?n.apply(t,r):n)||(e.exports=o)},456:function(e,t,n){var r,o,i;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,o=[],void 0===(i="function"==typeof(r=function(){"use strict";var t=n(917);function r(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),n&&t(e,n)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})?r.apply(t,o):r)||(e.exports=i)},151:function(e,t){var n,r,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,r=[],void 0===(o="function"==typeof(n=function(){"use strict";function t(e){return e&&e.__esModule?e:{default:e}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})?n.apply(t,r):n)||(e.exports=o)},812:function(e,t){var n,r,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,r=[],void 0===(o="function"==typeof(n=function(){"use strict";function t(e){return-1!==Function.toString.call(e).indexOf("[native code]")}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})?n.apply(t,r):n)||(e.exports=o)},466:function(e,t){var n,r,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,r=[],void 0===(o="function"==typeof(n=function(){"use strict";function t(){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(e){return!1}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})?n.apply(t,r):n)||(e.exports=o)},678:function(e,t){var n,r,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,r=[],void 0===(o="function"==typeof(n=function(){"use strict";function t(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})?n.apply(t,r):n)||(e.exports=o)},734:function(e,t){var n,r,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,r=[],void 0===(o="function"==typeof(n=function(){"use strict";function t(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,u,a=[],f=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;f=!1}else for(;!(f=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);f=!0);}catch(e){c=!0,o=e}finally{try{if(!f&&null!=n.return&&(u=n.return(),Object(u)!==u))return}finally{if(c)throw o}}return a}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})?n.apply(t,r):n)||(e.exports=o)},261:function(e,t){var n,r,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,r=[],void 0===(o="function"==typeof(n=function(){"use strict";function t(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})?n.apply(t,r):n)||(e.exports=o)},813:function(e,t){var n,r,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,r=[],void 0===(o="function"==typeof(n=function(){"use strict";function t(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})?n.apply(t,r):n)||(e.exports=o)},553:function(e,t,n){var r,o,i;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,o=[],void 0===(i="function"==typeof(r=function(){"use strict";var t=n(306).default,r=n(43);function o(e,n){if(n&&("object"===t(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return r(e)}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports})?r.apply(t,o):r)||(e.exports=i)},416:function(e,t,n){var r,o,i;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,o=[],r=function(){"use strict";var t=n(306).default;function r(){e.exports=r=function(){return n},e.exports.__esModule=!0,e.exports.default=e.exports;var n={},o=Object.prototype,i=o.hasOwnProperty,u=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},f=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function p(e,t,n,r){var o=t&&t.prototype instanceof v?t:v,i=Object.create(o.prototype),a=new P(r||[]);return u(i,"_invoke",{value:S(e,n,a)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}n.wrap=p;var y={};function v(){}function h(){}function b(){}var g={};l(g,f,(function(){return this}));var x=Object.getPrototypeOf,m=x&&x(x(A([])));m&&m!==o&&i.call(m,f)&&(g=m);var w=b.prototype=v.prototype=Object.create(g);function _(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function O(e,n){function r(o,u,a,f){var c=d(e[o],e,u);if("throw"!==c.type){var s=c.arg,l=s.value;return l&&"object"==t(l)&&i.call(l,"__await")?n.resolve(l.__await).then((function(e){r("next",e,a,f)}),(function(e){r("throw",e,a,f)})):n.resolve(l).then((function(e){s.value=e,a(s)}),(function(e){return r("throw",e,a,f)}))}f(c.arg)}var o;u(this,"_invoke",{value:function(e,t){function i(){return new n((function(n,o){r(e,t,n,o)}))}return o=o?o.then(i,i):i()}})}function S(e,t,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return k()}for(n.method=o,n.arg=i;;){var u=n.delegate;if(u){var a=T(u,n);if(a){if(a===y)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var f=d(e,t,n);if("normal"===f.type){if(r=n.done?"completed":"suspendedYield",f.arg===y)continue;return{value:f.arg,done:n.done}}"throw"===f.type&&(r="completed",n.method="throw",n.arg=f.arg)}}}function T(e,t){var n=t.method,r=e.iterator[n];if(void 0===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,T(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var o=d(r,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,y;var i=o.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,y):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,y)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function M(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function A(e){if(e){var t=e[f];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n<e.length;)if(i.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return r.next=r}}return{next:k}}function k(){return{value:void 0,done:!0}}return h.prototype=b,u(w,"constructor",{value:b,configurable:!0}),u(b,"constructor",{value:h,configurable:!0}),h.displayName=l(b,s,"GeneratorFunction"),n.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===h||"GeneratorFunction"===(t.displayName||t.name))},n.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,s,"GeneratorFunction")),e.prototype=Object.create(w),e},n.awrap=function(e){return{__await:e}},_(O.prototype),l(O.prototype,c,(function(){return this})),n.AsyncIterator=O,n.async=function(e,t,r,o,i){void 0===i&&(i=Promise);var u=new O(p(e,t,r,o),i);return n.isGeneratorFunction(t)?u:u.next().then((function(e){return e.done?e.value:u.next()}))},_(w),l(w,s,"Generator"),l(w,f,(function(){return this})),l(w,"toString",(function(){return"[object Generator]"})),n.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},n.values=A,P.prototype={constructor:P,reset:function(e){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(M),!e)for(var t in this)"t"===t.charAt(0)&&i.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n,r){return u.type="throw",u.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],u=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var a=i.call(o,"catchLoc"),f=i.call(o,"finallyLoc");if(a&&f){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!f)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var u=o?o.completion:{};return u.type=e,u.arg=t,o?(this.method="next",this.next=o.finallyLoc,y):this.complete(u)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),M(n),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;M(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:A(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),y}},n}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports},void 0===(i="function"==typeof r?r.apply(t,o):r)||(e.exports=i)},917:function(e,t){var n,r,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,r=[],void 0===(o="function"==typeof(n=function(){"use strict";function t(n,r){return e.exports=t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n,r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})?n.apply(t,r):n)||(e.exports=o)},826:function(e,t,n){var r,o,i;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,o=[],void 0===(i="function"==typeof(r=function(){"use strict";var t=n(42),r=n(734),o=n(390),i=n(261);function u(e,n){return t(e)||r(e,n)||o(e,n)||i()}e.exports=u,e.exports.__esModule=!0,e.exports.default=e.exports})?r.apply(t,o):r)||(e.exports=i)},513:function(e,t,n){var r,o,i;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,o=[],void 0===(i="function"==typeof(r=function(){"use strict";var t=n(883),r=n(678),o=n(390),i=n(813);function u(e){return t(e)||r(e)||o(e)||i()}e.exports=u,e.exports.__esModule=!0,e.exports.default=e.exports})?r.apply(t,o):r)||(e.exports=i)},837:function(e,t,n){var r,o,i;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,o=[],void 0===(i="function"==typeof(r=function(){"use strict";var t=n(306).default;function r(e,n){if("object"!==t(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,n||"default");if("object"!==t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})?r.apply(t,o):r)||(e.exports=i)},517:function(e,t,n){var r,o,i;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,o=[],void 0===(i="function"==typeof(r=function(){"use strict";var t=n(306).default,r=n(837);function o(e){var n=r(e,"string");return"symbol"===t(n)?n:String(n)}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports})?r.apply(t,o):r)||(e.exports=i)},306:function(e,t){var n,r,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,r=[],void 0===(o="function"==typeof(n=function(){"use strict";function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})?n.apply(t,r):n)||(e.exports=o)},390:function(e,t,n){var r,o,i;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,o=[],void 0===(i="function"==typeof(r=function(){"use strict";var t=n(891);function r(e,n){if(e){if("string"==typeof e)return t(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,n):void 0}}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})?r.apply(t,o):r)||(e.exports=i)},302:function(e,t,n){var r,o,i;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,o=[],r=function(){"use strict";var t=n(853),r=n(917),o=n(812),i=n(363);function u(n){var a="function"==typeof Map?new Map:void 0;return e.exports=u=function(e){if(null===e||!o(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==a){if(a.has(e))return a.get(e);a.set(e,n)}function n(){return i(e,arguments,t(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),r(n,e)},e.exports.__esModule=!0,e.exports.default=e.exports,u(n)}e.exports=u,e.exports.__esModule=!0,e.exports.default=e.exports},void 0===(i="function"==typeof r?r.apply(t,o):r)||(e.exports=i)},404:function(e,t,n){var r,o,i;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,o=[n(306)],void 0===(i="function"==typeof(r=function(t){"use strict";var r=n(151);t=r(t);var o=n(416)();e.exports=o;try{regeneratorRuntime=o}catch(e){"object"===("undefined"==typeof globalThis?"undefined":(0,t.default)(globalThis))?globalThis.regeneratorRuntime=o:Function("r","regeneratorRuntime = r")(o)}})?r.apply(t,o):r)||(e.exports=i)}},t={},function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}(40);var e,t}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","mappings":";CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAe,MAAID,IAEnBD,EAAY,MAAIC,GACjB,CATD,CASGK,MAAM,KACT,iSCTA,iNAA2B,MACZC,EAAAA,QAAK,oLCFb,SAASC,IAAkB,2BAAPC,EAAK,yBAALA,EAAK,gBAC5B,OAAqB,IAAjBA,EAAMC,OACC,SAACC,GAAG,OAAKA,CAAG,EAEF,IAAjBF,EAAMC,OACCD,EAAM,GAEVA,EAAMG,QAAO,SAACC,EAAGC,GACpB,OAAO,kBAAaD,EAAEC,EAAC,wBAAU,CACrC,GACJ,6DAAC,kUCVD,IASMC,EAAc,CAChBC,MAAO,EACPC,MAXU,CAAC,EAYXC,QAXY,CAAC,EAYbC,WAXe,CACnB,GAWE,gBACF,IAAMC,EAAS,SAACC,GACZ,MAAO,CACHC,MAAOP,EAAYE,MAAMI,GACzBE,QAASR,EAAYG,QAAQG,GAC7BG,WAAYT,EAAYI,WAAWE,GAE3C,EAAE,W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CAAC,GAOX,OAHAse,EAAoBF,GAAUrW,KAAK9H,EAAOD,QAASC,EAAQA,EAAOD,QAASme,GAGpEle,EAAOD,OACf,CCnB0Bme,CAAoB,UDF1CD","sources":["webpack://Model/webpack/universalModuleDefinition","webpack://Model/./packages/model/index.ts","webpack://Model/./packages/model/src/compose.ts","webpack://Model/./packages/model/src/global.ts","webpack://Model/./packages/model/src/middleware/index.ts","webpack://Model/./packages/model/src/model.ts","webpack://Model/./packages/model/src/rebuildAction.ts","webpack://Model/./packages/model/src/rebuildAsyncAction.ts","webpack://Model/../../src/immer.ts","webpack://Model/../../src/utils/env.ts","webpack://Model/../../src/utils/errors.ts","webpack://Model/../../src/utils/common.ts","webpack://Model/../../src/utils/plugins.ts","webpack://Model/../../src/core/scope.ts","webpack://Model/../../src/core/finalize.ts","webpack://Model/../../src/core/proxy.ts","webpack://Model/../../src/core/immerClass.ts","webpack://Model/../../src/core/current.ts","webpack://Model/../../src/plugins/patches.ts","webpack://Model/../../src/plugins/mapset.ts","webpack://Model/./packages/model/node_modules/immer/dist/cjs/index.js","webpack://Model/../cclr-magic-cli/node_modules/.pnpm/@babel+runtime@7.20.7/node_modules/@babel/runtime/helpers/arrayLikeToArray.js","webpack://Model/../cclr-magic-cli/node_modules/.pnpm/@babel+runtime@7.20.7/node_modules/@babel/runtime/helpers/arrayWithHoles.js","webpack://Model/../cclr-magic-cli/node_modules/.pnpm/@babel+runtime@7.20.7/node_modules/@babel/runtime/helpers/arrayWithoutHoles.js","webpack://Model/../cclr-magic-cli/node_modules/.pnpm/@babel+runtime@7.20.7/node_modules/@babel/runtime/helpers/assertThisInitialized.js","webpack://Model/../cclr-magic-cli/node_modules/.pnpm/@babel+runtime@7.20.7/node_modules/@babel/runtime/helpers/classCallCheck.js","webpack://Model/../cclr-magic-cli/node_modules/.pnpm/@babel+runtime@7.20.7/node_modules/@babel/runtime/helpers/construct.js","webpack://Model/../cclr-magic-cli/node_modules/.pnpm/@babel+runtime@7.20.7/node_modules/@babel/runtime/helpers/createClass.js","webpack://Model/../cclr-magic-cli/node_modules/.pnpm/@babel+runtime@7.20.7/node_modules/@babel/runtime/helpers/defineProperty.js","webpack://Model/../cclr-magic-cli/node_modules/.pnpm/@babel+runtime@7.20.7/node_modules/@babel/runtime/helpers/getPrototypeOf.js","webpack://Model/../cclr-magic-cli/node_modules/.pnpm/@babel+runtime@7.20.7/node_modules/@babel/runtime/helpers/inherits.js","webpack://Model/../cclr-magic-cli/node_modules/.pnpm/@babel+runtime@7.20.7/node_modules/@babel/runtime/helpers/interopRequireDefault.js","webpack://Model/../cclr-magic-cli/node_modules/.pnpm/@babel+runtime@7.20.7/node_modules/@babel/runtime/helpers/isNativeFunction.js","webpack://Model/../cclr-magic-cli/node_modules/.pnpm/@babel+runtime@7.20.7/node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js","webpack://Model/../cclr-magic-cli/node_modules/.pnpm/@babel+runtime@7.20.7/node_modules/@babel/runtime/helpers/iterableToArray.js","webpack://Model/../cclr-magic-cli/node_modules/.pnpm/@babel+runtime@7.20.7/node_modules/@babel/runtime/helpers/iterableToArrayLimit.js","webpack://Model/../cclr-magic-cli/node_modules/.pnpm/@babel+runtime@7.20.7/node_modules/@babel/runtime/helpers/nonIterableRest.js","webpack://Model/../cclr-magic-cli/node_modules/.pnpm/@babel+runtime@7.20.7/node_modules/@babel/runtime/helpers/nonIterableSpread.js","webpack://Model/../cclr-magic-cli/node_modules/.pnpm/@babel+runtime@7.20.7/node_modules/@babel/runtime/helpers/possibleConstructorReturn.js","webpack://Model/../cclr-magic-cli/node_modules/.pnpm/@babel+runtime@7.20.7/node_modules/@babel/runtime/helpers/regeneratorRuntime.js","webpack://Model/../cclr-magic-cli/node_modules/.pnpm/@babel+runtime@7.20.7/node_modules/@babel/runtime/helpers/setPrototypeOf.js","webpack://Model/../cclr-magic-cli/node_modules/.pnpm/@babel+runtime@7.20.7/node_modules/@babel/runtime/helpers/slicedToArray.js","webpack://Model/../cclr-magic-cli/node_modules/.pnpm/@babel+runtime@7.20.7/node_modules/@babel/runtime/helpers/toConsumableArray.js","webpack://Model/../cclr-magic-cli/node_modules/.pnpm/@babel+runtime@7.20.7/node_modules/@babel/runtime/helpers/toPrimitive.js","webpack://Model/../cclr-magic-cli/node_modules/.pnpm/@babel+runtime@7.20.7/node_modules/@babel/runtime/helpers/toPropertyKey.js","webpack://Model/../cclr-magic-cli/node_modules/.pnpm/@babel+runtime@7.20.7/node_modules/@babel/runtime/helpers/typeof.js","webpack://Model/../cclr-magic-cli/node_modules/.pnpm/@babel+runtime@7.20.7/node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js","webpack://Model/../cclr-magic-cli/node_modules/.pnpm/@babel+runtime@7.20.7/node_modules/@babel/runtime/helpers/wrapNativeSuper.js","webpack://Model/../cclr-magic-cli/node_modules/.pnpm/@babel+runtime@7.20.7/node_modules/@babel/runtime/regenerator/index.js","webpack://Model/webpack/bootstrap","webpack://Model/webpack/startup"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Model\"] = factory();\n\telse\n\t\troot[\"Model\"] = factory();\n})(self, () => {\nreturn ","import Model from \"./src/model\";\nexport * from './src/type';\nexport default Model;\n","export function compose(...funcs) {\n if (funcs.length === 0) {\n return (arg) => arg;\n }\n if (funcs.length === 1) {\n return funcs[0];\n }\n return funcs.reduce((a, b) => {\n return (...args) => a(b(...args));\n });\n}\n","const State = {};\nconst Actions = {};\nconst Subscribes = {\n/*******\n[modelName]: [\n () => { }\n]\n********/\n};\nconst GlobalModal = {\n __MId: 1,\n State,\n Actions,\n Subscribes,\n};\nconst getCtx = (modelName) => {\n return {\n state: GlobalModal.State[modelName],\n actions: GlobalModal.Actions[modelName],\n subscribes: GlobalModal.Subscribes[modelName],\n };\n};\nconst getState = (modelName) => {\n return GlobalModal.State[modelName];\n};\nexport { GlobalModal, getCtx, getState };\n","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { GlobalModal, getState } from \"../global\";\nimport { produce } from \"immer\";\n/**\n * 打印log\n * @param ctx\n * @returns\n */\nconst logger = (ctx) => (next) => (params) => {\n console.log(ctx.modelName, \"- action -start: \", ctx.action.name);\n const r = next(params);\n console.log(ctx.modelName, \"- action -end: \", ctx.action.name);\n return r;\n};\n/**\n * 打印log\n * @param ctx\n * @returns\n */\nconst asyncLogger = (ctx) => (next) => (params) => __awaiter(void 0, void 0, void 0, function* () {\n console.log(ctx.modelName, \"- action -start: \", ctx.action.name);\n const r = yield next(params);\n console.log(ctx.modelName, \"- action -end: \", ctx.action.name);\n return r;\n});\n/**\n * 执行action\n * @param ctx\n * @returns\n */\nconst runAction = (ctx) => (next) => (params) => {\n const { action, payload, state, actions } = ctx;\n const actionRes = action(payload, {\n state,\n actions,\n });\n if (actionRes.then) {\n console.warn(\"actions, 内不能处理异步函数返回,请使用asyncActions\");\n }\n else {\n ctx.newState = actionRes;\n }\n return next(params);\n};\n/**\n * 异步执行action\n * @param ctx\n * @returns\n */\nconst asyncRunAction = (ctx) => (next) => (params) => __awaiter(void 0, void 0, void 0, function* () {\n const { action, payload, state, actions } = ctx;\n ctx.newState = yield action(payload, {\n state,\n actions,\n });\n return next(params);\n});\n/**\n * 更新器\n * @param ctx\n * @returns\n */\nconst setterFun = (ctx) => (next) => (params) => {\n const { newState, modelName } = ctx;\n if (typeof newState === \"function\") {\n ctx.setterFun = newState;\n }\n else if (typeof newState === \"object\") {\n const ModelState = Object.assign(Object.assign({}, GlobalModal.State[modelName]), (newState || {}));\n ctx.setterFun = (state) => {\n state[modelName] = ModelState;\n };\n }\n return next(params);\n};\n/**\n * 更新函数\n * @param ctx\n * @returns\n */\nconst updateState = (ctx) => (next) => (params) => {\n const { setterFun, modelName } = ctx;\n setterFun &&\n (GlobalModal.State[modelName] = produce(GlobalModal.State[modelName], setterFun));\n return next(params);\n};\n/**\n * 发布函数\n * @param ctx\n * @returns\n */\nconst publish = (ctx) => (next) => (params) => {\n const { subscribes } = ctx;\n subscribes.forEach((callback) => {\n callback({});\n });\n return next(params);\n};\n/**\n * action返回\n * @param ctx\n * @returns\n */\nconst returnState = (ctx) => (_next) => (_params) => {\n return getState(ctx.modelName);\n};\nexport const presetMiddleware = [\n logger,\n runAction,\n setterFun,\n updateState,\n publish,\n returnState,\n];\nexport { logger, asyncLogger, runAction, asyncRunAction, setterFun, updateState, publish, returnState, };\n","import { GlobalModal } from \"./global\";\nimport { rebuildActions } from \"./rebuildAction\";\nimport { rebuildAsyncActions } from \"./rebuildAsyncAction\";\nexport default class Model {\n constructor(models) {\n Object.entries(models).forEach(([modelName, model]) => {\n GlobalModal.__MId++;\n GlobalModal.State[modelName] = model.state;\n GlobalModal.Actions[modelName] = Object.assign(Object.assign({}, rebuildAsyncActions(model.asyncActions, modelName)), rebuildActions(model.actions, modelName));\n });\n }\n getState(modelName) {\n return GlobalModal.State[modelName];\n }\n getAction(modelName) {\n return GlobalModal.Actions[modelName];\n }\n getModel() { }\n subscribe(modelName, callback) {\n if (!GlobalModal.Subscribes[modelName]) {\n GlobalModal.Subscribes[modelName] = [];\n }\n GlobalModal.Subscribes[modelName].push(callback);\n }\n unsubscribe(modelName, callback) {\n if (!GlobalModal.Subscribes[modelName]) {\n GlobalModal.Subscribes[modelName] = [];\n }\n GlobalModal.Subscribes[modelName] = GlobalModal.Subscribes[modelName].filter((item) => item !== callback);\n }\n applyMiddleware() { }\n}\n","import { compose } from \"./compose\";\nimport { getCtx, getState } from \"./global\";\nimport { logger, runAction, setterFun, updateState, publish, returnState, } from \"./middleware\";\nexport const presetMiddleware = [\n logger,\n runAction,\n setterFun,\n updateState,\n publish,\n returnState,\n];\nexport const rebuildActions = (actions, modelName) => {\n const updateActions = {};\n Object.entries(actions).forEach(([key, action]) => {\n updateActions[key] = resetAction(action, modelName);\n });\n return updateActions;\n};\nconst resetAction = (action, modelName) => {\n return (payload) => {\n const { state, actions, subscribes } = getCtx(modelName);\n const ctx = {\n payload,\n state,\n actions,\n action,\n subscribes,\n modelName,\n newState: null,\n setterFun: undefined,\n };\n const middlewares = presetMiddleware.map((middleware) => {\n return middleware(ctx);\n });\n const composeFun = compose(...middlewares);\n return composeFun(() => getState(modelName))();\n };\n};\n","import { compose } from \"./compose\";\nimport { getCtx, getState } from \"./global\";\nimport { asyncLogger, asyncRunAction, setterFun, updateState, publish, returnState, } from \"./middleware\";\nexport const presetMiddleware = [\n asyncLogger,\n asyncRunAction,\n setterFun,\n updateState,\n publish,\n returnState,\n];\nexport const rebuildAsyncActions = (actions, modelName) => {\n const updateActions = {};\n Object.entries(actions).forEach(([key, action]) => {\n updateActions[key] = resetAction(action, modelName);\n });\n return updateActions;\n};\nconst resetAction = (action, modelName) => {\n return (payload) => {\n const { state, actions, subscribes } = getCtx(modelName);\n const ctx = {\n payload,\n state,\n actions,\n action,\n subscribes,\n modelName,\n newState: null,\n setterFun: undefined,\n };\n const middlewares = presetMiddleware.map((middleware) => {\n return middleware(ctx);\n });\n const composeFun = compose(...middlewares);\n return composeFun(() => getState(modelName))();\n };\n};\n","import {\n\tIProduce,\n\tIProduceWithPatches,\n\tImmer,\n\tDraft,\n\tImmutable\n} from \"./internal\"\n\nexport {\n\tDraft,\n\tImmutable,\n\tPatch,\n\tPatchListener,\n\toriginal,\n\tcurrent,\n\tisDraft,\n\tisDraftable,\n\tNOTHING as nothing,\n\tDRAFTABLE as immerable,\n\tfreeze,\n\tObjectish\n} from \"./internal\"\n\nconst immer = new Immer()\n\n/**\n * The `produce` function takes a value and a \"recipe function\" (whose\n * return value often depends on the base state). The recipe function is\n * free to mutate its first argument however it wants. All mutations are\n * only ever applied to a __copy__ of the base state.\n *\n * Pass only a function to create a \"curried producer\" which relieves you\n * from passing the recipe function every time.\n *\n * Only plain objects and arrays are made mutable. All other objects are\n * considered uncopyable.\n *\n * Note: This function is __bound__ to its `Immer` instance.\n *\n * @param {any} base - the initial state\n * @param {Function} producer - function that receives a proxy of the base state as first argument and which can be freely modified\n * @param {Function} patchListener - optional function that will be called with all the patches produced here\n * @returns {any} a new state, or the initial state if nothing was modified\n */\nexport const produce: IProduce = immer.produce\n\n/**\n * Like `produce`, but `produceWithPatches` always returns a tuple\n * [nextState, patches, inversePatches] (instead of just the next state)\n */\nexport const produceWithPatches: IProduceWithPatches = immer.produceWithPatches.bind(\n\timmer\n)\n\n/**\n * Pass true to automatically freeze all copies created by Immer.\n *\n * Always freeze by default, even in production mode\n */\nexport const setAutoFreeze = immer.setAutoFreeze.bind(immer)\n\n/**\n * Pass true to enable strict shallow copy.\n *\n * By default, immer does not copy the object descriptors such as getter, setter and non-enumrable properties.\n */\nexport const setUseStrictShallowCopy = immer.setUseStrictShallowCopy.bind(immer)\n\n/**\n * Apply an array of Immer patches to the first argument.\n *\n * This function is a producer, which means copy-on-write is in effect.\n */\nexport const applyPatches = immer.applyPatches.bind(immer)\n\n/**\n * Create an Immer draft from the given base state, which may be a draft itself.\n * The draft can be modified until you finalize it with the `finishDraft` function.\n */\nexport const createDraft = immer.createDraft.bind(immer)\n\n/**\n * Finalize an Immer draft from a `createDraft` call, returning the base state\n * (if no changes were made) or a modified copy. The draft must *not* be\n * mutated afterwards.\n *\n * Pass a function as the 2nd argument to generate Immer patches based on the\n * changes that were made.\n */\nexport const finishDraft = immer.finishDraft.bind(immer)\n\n/**\n * This function is actually a no-op, but can be used to cast an immutable type\n * to an draft type and make TypeScript happy\n *\n * @param value\n */\nexport function castDraft<T>(value: T): Draft<T> {\n\treturn value as any\n}\n\n/**\n * This function is actually a no-op, but can be used to cast a mutable type\n * to an immutable type and make TypeScript happy\n * @param value\n */\nexport function castImmutable<T>(value: T): Immutable<T> {\n\treturn value as any\n}\n\nexport {Immer}\n\nexport {enablePatches} from \"./plugins/patches\"\nexport {enableMapSet} from \"./plugins/mapset\"\n","// Should be no imports here!\n\n/**\n * The sentinel value returned by producers to replace the draft with undefined.\n */\nexport const NOTHING: unique symbol = Symbol.for(\"immer-nothing\")\n\n/**\n * To let Immer treat your class instances as plain immutable objects\n * (albeit with a custom prototype), you must define either an instance property\n * or a static property on each of your custom classes.\n *\n * Otherwise, your class instance will never be drafted, which means it won't be\n * safe to mutate in a produce callback.\n */\nexport const DRAFTABLE: unique symbol = Symbol.for(\"immer-draftable\")\n\nexport const DRAFT_STATE: unique symbol = Symbol.for(\"immer-state\")\n","export const errors =\n\tprocess.env.NODE_ENV !== \"production\"\n\t\t? [\n\t\t\t\t// All error codes, starting by 0:\n\t\t\t\tfunction(plugin: string) {\n\t\t\t\t\treturn `The plugin for '${plugin}' has not been loaded into Immer. To enable the plugin, import and call \\`enable${plugin}()\\` when initializing your application.`\n\t\t\t\t},\n\t\t\t\tfunction(thing: string) {\n\t\t\t\t\treturn `produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${thing}'`\n\t\t\t\t},\n\t\t\t\t\"This object has been frozen and should not be mutated\",\n\t\t\t\tfunction(data: any) {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t\"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? \" +\n\t\t\t\t\t\tdata\n\t\t\t\t\t)\n\t\t\t\t},\n\t\t\t\t\"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.\",\n\t\t\t\t\"Immer forbids circular references\",\n\t\t\t\t\"The first or second argument to `produce` must be a function\",\n\t\t\t\t\"The third argument to `produce` must be a function or undefined\",\n\t\t\t\t\"First argument to `createDraft` must be a plain object, an array, or an immerable object\",\n\t\t\t\t\"First argument to `finishDraft` must be a draft returned by `createDraft`\",\n\t\t\t\tfunction(thing: string) {\n\t\t\t\t\treturn `'current' expects a draft, got: ${thing}`\n\t\t\t\t},\n\t\t\t\t\"Object.defineProperty() cannot be used on an Immer draft\",\n\t\t\t\t\"Object.setPrototypeOf() cannot be used on an Immer draft\",\n\t\t\t\t\"Immer only supports deleting array indices\",\n\t\t\t\t\"Immer only supports setting array indices and the 'length' property\",\n\t\t\t\tfunction(thing: string) {\n\t\t\t\t\treturn `'original' expects a draft, got: ${thing}`\n\t\t\t\t}\n\t\t\t\t// Note: if more errors are added, the errorOffset in Patches.ts should be increased\n\t\t\t\t// See Patches.ts for additional errors\n\t\t ]\n\t\t: []\n\nexport function die(error: number, ...args: any[]): never {\n\tif (process.env.NODE_ENV !== \"production\") {\n\t\tconst e = errors[error]\n\t\tconst msg = typeof e === \"function\" ? e.apply(null, args as any) : e\n\t\tthrow new Error(`[Immer] ${msg}`)\n\t}\n\tthrow new Error(\n\t\t`[Immer] minified error nr: ${error}. Full error at: https://bit.ly/3cXEKWf`\n\t)\n}\n","import {\n\tDRAFT_STATE,\n\tDRAFTABLE,\n\tObjectish,\n\tDrafted,\n\tAnyObject,\n\tAnyMap,\n\tAnySet,\n\tImmerState,\n\tArchType,\n\tdie\n} from \"../internal\"\n\nexport const getPrototypeOf = Object.getPrototypeOf\n\n/** Returns true if the given value is an Immer draft */\n/*#__PURE__*/\nexport function isDraft(value: any): boolean {\n\treturn !!value && !!value[DRAFT_STATE]\n}\n\n/** Returns true if the given value can be drafted by Immer */\n/*#__PURE__*/\nexport function isDraftable(value: any): boolean {\n\tif (!value) return false\n\treturn (\n\t\tisPlainObject(value) ||\n\t\tArray.isArray(value) ||\n\t\t!!value[DRAFTABLE] ||\n\t\t!!value.constructor?.[DRAFTABLE] ||\n\t\tisMap(value) ||\n\t\tisSet(value)\n\t)\n}\n\nconst objectCtorString = Object.prototype.constructor.toString()\n/*#__PURE__*/\nexport function isPlainObject(value: any): boolean {\n\tif (!value || typeof value !== \"object\") return false\n\tconst proto = getPrototypeOf(value)\n\tif (proto === null) {\n\t\treturn true\n\t}\n\tconst Ctor =\n\t\tObject.hasOwnProperty.call(proto, \"constructor\") && proto.constructor\n\n\tif (Ctor === Object) return true\n\n\treturn (\n\t\ttypeof Ctor == \"function\" &&\n\t\tFunction.toString.call(Ctor) === objectCtorString\n\t)\n}\n\n/** Get the underlying object that is represented by the given draft */\n/*#__PURE__*/\nexport function original<T>(value: T): T | undefined\nexport function original(value: Drafted<any>): any {\n\tif (!isDraft(value)) die(15, value)\n\treturn value[DRAFT_STATE].base_\n}\n\nexport function each<T extends Objectish>(\n\tobj: T,\n\titer: (key: string | number, value: any, source: T) => void,\n\tenumerableOnly?: boolean\n): void\nexport function each(obj: any, iter: any) {\n\tif (getArchtype(obj) === ArchType.Object) {\n\t\tObject.entries(obj).forEach(([key, value]) => {\n\t\t\titer(key, value, obj)\n\t\t})\n\t} else {\n\t\tobj.forEach((entry: any, index: any) => iter(index, entry, obj))\n\t}\n}\n\n/*#__PURE__*/\nexport function getArchtype(thing: any): ArchType {\n\tconst state: undefined | ImmerState = thing[DRAFT_STATE]\n\treturn state\n\t\t? state.type_\n\t\t: Array.isArray(thing)\n\t\t? ArchType.Array\n\t\t: isMap(thing)\n\t\t? ArchType.Map\n\t\t: isSet(thing)\n\t\t? ArchType.Set\n\t\t: ArchType.Object\n}\n\n/*#__PURE__*/\nexport function has(thing: any, prop: PropertyKey): boolean {\n\treturn getArchtype(thing) === ArchType.Map\n\t\t? thing.has(prop)\n\t\t: Object.prototype.hasOwnProperty.call(thing, prop)\n}\n\n/*#__PURE__*/\nexport function get(thing: AnyMap | AnyObject, prop: PropertyKey): any {\n\t// @ts-ignore\n\treturn getArchtype(thing) === ArchType.Map ? thing.get(prop) : thing[prop]\n}\n\n/*#__PURE__*/\nexport function set(thing: any, propOrOldValue: PropertyKey, value: any) {\n\tconst t = getArchtype(thing)\n\tif (t === ArchType.Map) thing.set(propOrOldValue, value)\n\telse if (t === ArchType.Set) {\n\t\tthing.add(value)\n\t} else thing[propOrOldValue] = value\n}\n\n/*#__PURE__*/\nexport function is(x: any, y: any): boolean {\n\t// From: https://github.com/facebook/fbjs/blob/c69904a511b900266935168223063dd8772dfc40/packages/fbjs/src/core/shallowEqual.js\n\tif (x === y) {\n\t\treturn x !== 0 || 1 / x === 1 / y\n\t} else {\n\t\treturn x !== x && y !== y\n\t}\n}\n\n/*#__PURE__*/\nexport function isMap(target: any): target is AnyMap {\n\treturn target instanceof Map\n}\n\n/*#__PURE__*/\nexport function isSet(target: any): target is AnySet {\n\treturn target instanceof Set\n}\n/*#__PURE__*/\nexport function latest(state: ImmerState): any {\n\treturn state.copy_ || state.base_\n}\n\n/*#__PURE__*/\nexport function shallowCopy(base: any, strict: boolean) {\n\tif (isMap(base)) {\n\t\treturn new Map(base)\n\t}\n\tif (isSet(base)) {\n\t\treturn new Set(base)\n\t}\n\tif (Array.isArray(base)) return Array.prototype.slice.call(base)\n\n\tif (!strict && isPlainObject(base)) {\n\t\tif (!getPrototypeOf(base)) {\n\t\t\tconst obj = Object.create(null)\n\t\t\treturn Object.assign(obj, base)\n\t\t}\n\t\treturn {...base}\n\t}\n\n\tconst descriptors = Object.getOwnPropertyDescriptors(base)\n\tdelete descriptors[DRAFT_STATE as any]\n\tlet keys = Reflect.ownKeys(descriptors)\n\tfor (let i = 0; i < keys.length; i++) {\n\t\tconst key: any = keys[i]\n\t\tconst desc = descriptors[key]\n\t\tif (desc.writable === false) {\n\t\t\tdesc.writable = true\n\t\t\tdesc.configurable = true\n\t\t}\n\t\t// like object.assign, we will read any _own_, get/set accessors. This helps in dealing\n\t\t// with libraries that trap values, like mobx or vue\n\t\t// unlike object.assign, non-enumerables will be copied as well\n\t\tif (desc.get || desc.set)\n\t\t\tdescriptors[key] = {\n\t\t\t\tconfigurable: true,\n\t\t\t\twritable: true, // could live with !!desc.set as well here...\n\t\t\t\tenumerable: desc.enumerable,\n\t\t\t\tvalue: base[key]\n\t\t\t}\n\t}\n\treturn Object.create(getPrototypeOf(base), descriptors)\n}\n\n/**\n * Freezes draftable objects. Returns the original object.\n * By default freezes shallowly, but if the second argument is `true` it will freeze recursively.\n *\n * @param obj\n * @param deep\n */\nexport function freeze<T>(obj: T, deep?: boolean): T\nexport function freeze<T>(obj: any, deep: boolean = false): T {\n\tif (isFrozen(obj) || isDraft(obj) || !isDraftable(obj)) return obj\n\tif (getArchtype(obj) > 1 /* Map or Set */) {\n\t\tobj.set = obj.add = obj.clear = obj.delete = dontMutateFrozenCollections as any\n\t}\n\tObject.freeze(obj)\n\tif (deep) each(obj, (_key, value) => freeze(value, true), true)\n\treturn obj\n}\n\nfunction dontMutateFrozenCollections() {\n\tdie(2)\n}\n\nexport function isFrozen(obj: any): boolean {\n\treturn Object.isFrozen(obj)\n}\n","import {\n\tImmerState,\n\tPatch,\n\tDrafted,\n\tImmerBaseState,\n\tAnyMap,\n\tAnySet,\n\tArchType,\n\tdie\n} from \"../internal\"\n\n/** Plugin utilities */\nconst plugins: {\n\tPatches?: {\n\t\tgeneratePatches_(\n\t\t\tstate: ImmerState,\n\t\t\tbasePath: PatchPath,\n\t\t\tpatches: Patch[],\n\t\t\tinversePatches: Patch[]\n\t\t): void\n\t\tgenerateReplacementPatches_(\n\t\t\tbase: any,\n\t\t\treplacement: any,\n\t\t\tpatches: Patch[],\n\t\t\tinversePatches: Patch[]\n\t\t): void\n\t\tapplyPatches_<T>(draft: T, patches: Patch[]): T\n\t}\n\tMapSet?: {\n\t\tproxyMap_<T extends AnyMap>(target: T, parent?: ImmerState): T\n\t\tproxySet_<T extends AnySet>(target: T, parent?: ImmerState): T\n\t}\n} = {}\n\ntype Plugins = typeof plugins\n\nexport function getPlugin<K extends keyof Plugins>(\n\tpluginKey: K\n): Exclude<Plugins[K], undefined> {\n\tconst plugin = plugins[pluginKey]\n\tif (!plugin) {\n\t\tdie(0, pluginKey)\n\t}\n\t// @ts-ignore\n\treturn plugin\n}\n\nexport function loadPlugin<K extends keyof Plugins>(\n\tpluginKey: K,\n\timplementation: Plugins[K]\n): void {\n\tif (!plugins[pluginKey]) plugins[pluginKey] = implementation\n}\n/** Map / Set plugin */\n\nexport interface MapState extends ImmerBaseState {\n\ttype_: ArchType.Map\n\tcopy_: AnyMap | undefined\n\tassigned_: Map<any, boolean> | undefined\n\tbase_: AnyMap\n\trevoked_: boolean\n\tdraft_: Drafted<AnyMap, MapState>\n}\n\nexport interface SetState extends ImmerBaseState {\n\ttype_: ArchType.Set\n\tcopy_: AnySet | undefined\n\tbase_: AnySet\n\tdrafts_: Map<any, Drafted> // maps the original value to the draft value in the new set\n\trevoked_: boolean\n\tdraft_: Drafted<AnySet, SetState>\n}\n\n/** Patches plugin */\n\nexport type PatchPath = (string | number)[]\n","import {\n\tPatch,\n\tPatchListener,\n\tDrafted,\n\tImmer,\n\tDRAFT_STATE,\n\tImmerState,\n\tArchType,\n\tgetPlugin\n} from \"../internal\"\n\n/** Each scope represents a `produce` call. */\n\nexport interface ImmerScope {\n\tpatches_?: Patch[]\n\tinversePatches_?: Patch[]\n\tcanAutoFreeze_: boolean\n\tdrafts_: any[]\n\tparent_?: ImmerScope\n\tpatchListener_?: PatchListener\n\timmer_: Immer\n\tunfinalizedDrafts_: number\n}\n\nlet currentScope: ImmerScope | undefined\n\nexport function getCurrentScope() {\n\treturn currentScope!\n}\n\nfunction createScope(\n\tparent_: ImmerScope | undefined,\n\timmer_: Immer\n): ImmerScope {\n\treturn {\n\t\tdrafts_: [],\n\t\tparent_,\n\t\timmer_,\n\t\t// Whenever the modified draft contains a draft from another scope, we\n\t\t// need to prevent auto-freezing so the unowned draft can be finalized.\n\t\tcanAutoFreeze_: true,\n\t\tunfinalizedDrafts_: 0\n\t}\n}\n\nexport function usePatchesInScope(\n\tscope: ImmerScope,\n\tpatchListener?: PatchListener\n) {\n\tif (patchListener) {\n\t\tgetPlugin(\"Patches\") // assert we have the plugin\n\t\tscope.patches_ = []\n\t\tscope.inversePatches_ = []\n\t\tscope.patchListener_ = patchListener\n\t}\n}\n\nexport function revokeScope(scope: ImmerScope) {\n\tleaveScope(scope)\n\tscope.drafts_.forEach(revokeDraft)\n\t// @ts-ignore\n\tscope.drafts_ = null\n}\n\nexport function leaveScope(scope: ImmerScope) {\n\tif (scope === currentScope) {\n\t\tcurrentScope = scope.parent_\n\t}\n}\n\nexport function enterScope(immer: Immer) {\n\treturn (currentScope = createScope(currentScope, immer))\n}\n\nfunction revokeDraft(draft: Drafted) {\n\tconst state: ImmerState = draft[DRAFT_STATE]\n\tif (state.type_ === ArchType.Object || state.type_ === ArchType.Array)\n\t\tstate.revoke_()\n\telse state.revoked_ = true\n}\n","import {\n\tImmerScope,\n\tDRAFT_STATE,\n\tisDraftable,\n\tNOTHING,\n\tPatchPath,\n\teach,\n\thas,\n\tfreeze,\n\tImmerState,\n\tisDraft,\n\tSetState,\n\tset,\n\tArchType,\n\tgetPlugin,\n\tdie,\n\trevokeScope,\n\tisFrozen\n} from \"../internal\"\n\nexport function processResult(result: any, scope: ImmerScope) {\n\tscope.unfinalizedDrafts_ = scope.drafts_.length\n\tconst baseDraft = scope.drafts_![0]\n\tconst isReplaced = result !== undefined && result !== baseDraft\n\tif (isReplaced) {\n\t\tif (baseDraft[DRAFT_STATE].modified_) {\n\t\t\trevokeScope(scope)\n\t\t\tdie(4)\n\t\t}\n\t\tif (isDraftable(result)) {\n\t\t\t// Finalize the result in case it contains (or is) a subset of the draft.\n\t\t\tresult = finalize(scope, result)\n\t\t\tif (!scope.parent_) maybeFreeze(scope, result)\n\t\t}\n\t\tif (scope.patches_) {\n\t\t\tgetPlugin(\"Patches\").generateReplacementPatches_(\n\t\t\t\tbaseDraft[DRAFT_STATE].base_,\n\t\t\t\tresult,\n\t\t\t\tscope.patches_,\n\t\t\t\tscope.inversePatches_!\n\t\t\t)\n\t\t}\n\t} else {\n\t\t// Finalize the base draft.\n\t\tresult = finalize(scope, baseDraft, [])\n\t}\n\trevokeScope(scope)\n\tif (scope.patches_) {\n\t\tscope.patchListener_!(scope.patches_, scope.inversePatches_!)\n\t}\n\treturn result !== NOTHING ? result : undefined\n}\n\nfunction finalize(rootScope: ImmerScope, value: any, path?: PatchPath) {\n\t// Don't recurse in tho recursive data structures\n\tif (isFrozen(value)) return value\n\n\tconst state: ImmerState = value[DRAFT_STATE]\n\t// A plain object, might need freezing, might contain drafts\n\tif (!state) {\n\t\teach(\n\t\t\tvalue,\n\t\t\t(key, childValue) =>\n\t\t\t\tfinalizeProperty(rootScope, state, value, key, childValue, path),\n\t\t\ttrue // See #590, don't recurse into non-enumerable of non drafted objects\n\t\t)\n\t\treturn value\n\t}\n\t// Never finalize drafts owned by another scope.\n\tif (state.scope_ !== rootScope) return value\n\t// Unmodified draft, return the (frozen) original\n\tif (!state.modified_) {\n\t\tmaybeFreeze(rootScope, state.base_, true)\n\t\treturn state.base_\n\t}\n\t// Not finalized yet, let's do that now\n\tif (!state.finalized_) {\n\t\tstate.finalized_ = true\n\t\tstate.scope_.unfinalizedDrafts_--\n\t\tconst result = state.copy_\n\t\t// Finalize all children of the copy\n\t\t// For sets we clone before iterating, otherwise we can get in endless loop due to modifying during iteration, see #628\n\t\t// To preserve insertion order in all cases we then clear the set\n\t\t// And we let finalizeProperty know it needs to re-add non-draft children back to the target\n\t\tlet resultEach = result\n\t\tlet isSet = false\n\t\tif (state.type_ === ArchType.Set) {\n\t\t\tresultEach = new Set(result)\n\t\t\tresult.clear()\n\t\t\tisSet = true\n\t\t}\n\t\teach(resultEach, (key, childValue) =>\n\t\t\tfinalizeProperty(rootScope, state, result, key, childValue, path, isSet)\n\t\t)\n\t\t// everything inside is frozen, we can freeze here\n\t\tmaybeFreeze(rootScope, result, false)\n\t\t// first time finalizing, let's create those patches\n\t\tif (path && rootScope.patches_) {\n\t\t\tgetPlugin(\"Patches\").generatePatches_(\n\t\t\t\tstate,\n\t\t\t\tpath,\n\t\t\t\trootScope.patches_,\n\t\t\t\trootScope.inversePatches_!\n\t\t\t)\n\t\t}\n\t}\n\treturn state.copy_\n}\n\nfunction finalizeProperty(\n\trootScope: ImmerScope,\n\tparentState: undefined | ImmerState,\n\ttargetObject: any,\n\tprop: string | number,\n\tchildValue: any,\n\trootPath?: PatchPath,\n\ttargetIsSet?: boolean\n) {\n\tif (process.env.NODE_ENV !== \"production\" && childValue === targetObject)\n\t\tdie(5)\n\tif (isDraft(childValue)) {\n\t\tconst path =\n\t\t\trootPath &&\n\t\t\tparentState &&\n\t\t\tparentState!.type_ !== ArchType.Set && // Set objects are atomic since they have no keys.\n\t\t\t!has((parentState as Exclude<ImmerState, SetState>).assigned_!, prop) // Skip deep patches for assigned keys.\n\t\t\t\t? rootPath!.concat(prop)\n\t\t\t\t: undefined\n\t\t// Drafts owned by `scope` are finalized here.\n\t\tconst res = finalize(rootScope, childValue, path)\n\t\tset(targetObject, prop, res)\n\t\t// Drafts from another scope must prevented to be frozen\n\t\t// if we got a draft back from finalize, we're in a nested produce and shouldn't freeze\n\t\tif (isDraft(res)) {\n\t\t\trootScope.canAutoFreeze_ = false\n\t\t} else return\n\t} else if (targetIsSet) {\n\t\ttargetObject.add(childValue)\n\t}\n\t// Search new objects for unfinalized drafts. Frozen objects should never contain drafts.\n\tif (isDraftable(childValue) && !isFrozen(childValue)) {\n\t\tif (!rootScope.immer_.autoFreeze_ && rootScope.unfinalizedDrafts_ < 1) {\n\t\t\t// optimization: if an object is not a draft, and we don't have to\n\t\t\t// deepfreeze everything, and we are sure that no drafts are left in the remaining object\n\t\t\t// cause we saw and finalized all drafts already; we can stop visiting the rest of the tree.\n\t\t\t// This benefits especially adding large data tree's without further processing.\n\t\t\t// See add-data.js perf test\n\t\t\treturn\n\t\t}\n\t\tfinalize(rootScope, childValue)\n\t\t// immer deep freezes plain objects, so if there is no parent state, we freeze as well\n\t\tif (!parentState || !parentState.scope_.parent_)\n\t\t\tmaybeFreeze(rootScope, childValue)\n\t}\n}\n\nfunction maybeFreeze(scope: ImmerScope, value: any, deep = false) {\n\t// we never freeze for a non-root scope; as it would prevent pruning for drafts inside wrapping objects\n\tif (!scope.parent_ && scope.immer_.autoFreeze_ && scope.canAutoFreeze_) {\n\t\tfreeze(value, deep)\n\t}\n}\n","import {\n\teach,\n\thas,\n\tis,\n\tisDraftable,\n\tshallowCopy,\n\tlatest,\n\tImmerBaseState,\n\tImmerState,\n\tDrafted,\n\tAnyObject,\n\tAnyArray,\n\tObjectish,\n\tgetCurrentScope,\n\tgetPrototypeOf,\n\tDRAFT_STATE,\n\tdie,\n\tcreateProxy,\n\tArchType,\n\tImmerScope\n} from \"../internal\"\n\ninterface ProxyBaseState extends ImmerBaseState {\n\tassigned_: {\n\t\t[property: string]: boolean\n\t}\n\tparent_?: ImmerState\n\trevoke_(): void\n}\n\nexport interface ProxyObjectState extends ProxyBaseState {\n\ttype_: ArchType.Object\n\tbase_: any\n\tcopy_: any\n\tdraft_: Drafted<AnyObject, ProxyObjectState>\n}\n\nexport interface ProxyArrayState extends ProxyBaseState {\n\ttype_: ArchType.Array\n\tbase_: AnyArray\n\tcopy_: AnyArray | null\n\tdraft_: Drafted<AnyArray, ProxyArrayState>\n}\n\ntype ProxyState = ProxyObjectState | ProxyArrayState\n\n/**\n * Returns a new draft of the `base` object.\n *\n * The second argument is the parent draft-state (used internally).\n */\nexport function createProxyProxy<T extends Objectish>(\n\tbase: T,\n\tparent?: ImmerState\n): Drafted<T, ProxyState> {\n\tconst isArray = Array.isArray(base)\n\tconst state: ProxyState = {\n\t\ttype_: isArray ? ArchType.Array : (ArchType.Object as any),\n\t\t// Track which produce call this is associated with.\n\t\tscope_: parent ? parent.scope_ : getCurrentScope()!,\n\t\t// True for both shallow and deep changes.\n\t\tmodified_: false,\n\t\t// Used during finalization.\n\t\tfinalized_: false,\n\t\t// Track which properties have been assigned (true) or deleted (false).\n\t\tassigned_: {},\n\t\t// The parent draft state.\n\t\tparent_: parent,\n\t\t// The base state.\n\t\tbase_: base,\n\t\t// The base proxy.\n\t\tdraft_: null as any, // set below\n\t\t// The base copy with any updated values.\n\t\tcopy_: null,\n\t\t// Called by the `produce` function.\n\t\trevoke_: null as any,\n\t\tisManual_: false\n\t}\n\n\t// the traps must target something, a bit like the 'real' base.\n\t// but also, we need to be able to determine from the target what the relevant state is\n\t// (to avoid creating traps per instance to capture the state in closure,\n\t// and to avoid creating weird hidden properties as well)\n\t// So the trick is to use 'state' as the actual 'target'! (and make sure we intercept everything)\n\t// Note that in the case of an array, we put the state in an array to have better Reflect defaults ootb\n\tlet target: T = state as any\n\tlet traps: ProxyHandler<object | Array<any>> = objectTraps\n\tif (isArray) {\n\t\ttarget = [state] as any\n\t\ttraps = arrayTraps\n\t}\n\n\tconst {revoke, proxy} = Proxy.revocable(target, traps)\n\tstate.draft_ = proxy as any\n\tstate.revoke_ = revoke\n\treturn proxy as any\n}\n\n/**\n * Object drafts\n */\nexport const objectTraps: ProxyHandler<ProxyState> = {\n\tget(state, prop) {\n\t\tif (prop === DRAFT_STATE) return state\n\n\t\tconst source = latest(state)\n\t\tif (!has(source, prop)) {\n\t\t\t// non-existing or non-own property...\n\t\t\treturn readPropFromProto(state, source, prop)\n\t\t}\n\t\tconst value = source[prop]\n\t\tif (state.finalized_ || !isDraftable(value)) {\n\t\t\treturn value\n\t\t}\n\t\t// Check for existing draft in modified state.\n\t\t// Assigned values are never drafted. This catches any drafts we created, too.\n\t\tif (value === peek(state.base_, prop)) {\n\t\t\tprepareCopy(state)\n\t\t\treturn (state.copy_![prop as any] = createProxy(value, state))\n\t\t}\n\t\treturn value\n\t},\n\thas(state, prop) {\n\t\treturn prop in latest(state)\n\t},\n\townKeys(state) {\n\t\treturn Reflect.ownKeys(latest(state))\n\t},\n\tset(\n\t\tstate: ProxyObjectState,\n\t\tprop: string /* strictly not, but helps TS */,\n\t\tvalue\n\t) {\n\t\tconst desc = getDescriptorFromProto(latest(state), prop)\n\t\tif (desc?.set) {\n\t\t\t// special case: if this write is captured by a setter, we have\n\t\t\t// to trigger it with the correct context\n\t\t\tdesc.set.call(state.draft_, value)\n\t\t\treturn true\n\t\t}\n\t\tif (!state.modified_) {\n\t\t\t// the last check is because we need to be able to distinguish setting a non-existing to undefined (which is a change)\n\t\t\t// from setting an existing property with value undefined to undefined (which is not a change)\n\t\t\tconst current = peek(latest(state), prop)\n\t\t\t// special case, if we assigning the original value to a draft, we can ignore the assignment\n\t\t\tconst currentState: ProxyObjectState = current?.[DRAFT_STATE]\n\t\t\tif (currentState && currentState.base_ === value) {\n\t\t\t\tstate.copy_![prop] = value\n\t\t\t\tstate.assigned_[prop] = false\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tif (is(value, current) && (value !== undefined || has(state.base_, prop)))\n\t\t\t\treturn true\n\t\t\tprepareCopy(state)\n\t\t\tmarkChanged(state)\n\t\t}\n\n\t\tif (\n\t\t\t(state.copy_![prop] === value &&\n\t\t\t\t// special case: handle new props with value 'undefined'\n\t\t\t\t(value !== undefined || prop in state.copy_)) ||\n\t\t\t// special case: NaN\n\t\t\t(Number.isNaN(value) && Number.isNaN(state.copy_![prop]))\n\t\t)\n\t\t\treturn true\n\n\t\t// @ts-ignore\n\t\tstate.copy_![prop] = value\n\t\tstate.assigned_[prop] = true\n\t\treturn true\n\t},\n\tdeleteProperty(state, prop: string) {\n\t\t// The `undefined` check is a fast path for pre-existing keys.\n\t\tif (peek(state.base_, prop) !== undefined || prop in state.base_) {\n\t\t\tstate.assigned_[prop] = false\n\t\t\tprepareCopy(state)\n\t\t\tmarkChanged(state)\n\t\t} else {\n\t\t\t// if an originally not assigned property was deleted\n\t\t\tdelete state.assigned_[prop]\n\t\t}\n\t\tif (state.copy_) {\n\t\t\tdelete state.copy_[prop]\n\t\t}\n\t\treturn true\n\t},\n\t// Note: We never coerce `desc.value` into an Immer draft, because we can't make\n\t// the same guarantee in ES5 mode.\n\tgetOwnPropertyDescriptor(state, prop) {\n\t\tconst owner = latest(state)\n\t\tconst desc = Reflect.getOwnPropertyDescriptor(owner, prop)\n\t\tif (!desc) return desc\n\t\treturn {\n\t\t\twritable: true,\n\t\t\tconfigurable: state.type_ !== ArchType.Array || prop !== \"length\",\n\t\t\tenumerable: desc.enumerable,\n\t\t\tvalue: owner[prop]\n\t\t}\n\t},\n\tdefineProperty() {\n\t\tdie(11)\n\t},\n\tgetPrototypeOf(state) {\n\t\treturn getPrototypeOf(state.base_)\n\t},\n\tsetPrototypeOf() {\n\t\tdie(12)\n\t}\n}\n\n/**\n * Array drafts\n */\n\nconst arrayTraps: ProxyHandler<[ProxyArrayState]> = {}\neach(objectTraps, (key, fn) => {\n\t// @ts-ignore\n\tarrayTraps[key] = function() {\n\t\targuments[0] = arguments[0][0]\n\t\treturn fn.apply(this, arguments)\n\t}\n})\narrayTraps.deleteProperty = function(state, prop) {\n\tif (process.env.NODE_ENV !== \"production\" && isNaN(parseInt(prop as any)))\n\t\tdie(13)\n\t// @ts-ignore\n\treturn arrayTraps.set!.call(this, state, prop, undefined)\n}\narrayTraps.set = function(state, prop, value) {\n\tif (\n\t\tprocess.env.NODE_ENV !== \"production\" &&\n\t\tprop !== \"length\" &&\n\t\tisNaN(parseInt(prop as any))\n\t)\n\t\tdie(14)\n\treturn objectTraps.set!.call(this, state[0], prop, value, state[0])\n}\n\n// Access a property without creating an Immer draft.\nfunction peek(draft: Drafted, prop: PropertyKey) {\n\tconst state = draft[DRAFT_STATE]\n\tconst source = state ? latest(state) : draft\n\treturn source[prop]\n}\n\nfunction readPropFromProto(state: ImmerState, source: any, prop: PropertyKey) {\n\tconst desc = getDescriptorFromProto(source, prop)\n\treturn desc\n\t\t? `value` in desc\n\t\t\t? desc.value\n\t\t\t: // This is a very special case, if the prop is a getter defined by the\n\t\t\t // prototype, we should invoke it with the draft as context!\n\t\t\t desc.get?.call(state.draft_)\n\t\t: undefined\n}\n\nfunction getDescriptorFromProto(\n\tsource: any,\n\tprop: PropertyKey\n): PropertyDescriptor | undefined {\n\t// 'in' checks proto!\n\tif (!(prop in source)) return undefined\n\tlet proto = getPrototypeOf(source)\n\twhile (proto) {\n\t\tconst desc = Object.getOwnPropertyDescriptor(proto, prop)\n\t\tif (desc) return desc\n\t\tproto = getPrototypeOf(proto)\n\t}\n\treturn undefined\n}\n\nexport function markChanged(state: ImmerState) {\n\tif (!state.modified_) {\n\t\tstate.modified_ = true\n\t\tif (state.parent_) {\n\t\t\tmarkChanged(state.parent_)\n\t\t}\n\t}\n}\n\nexport function prepareCopy(state: {\n\tbase_: any\n\tcopy_: any\n\tscope_: ImmerScope\n}) {\n\tif (!state.copy_) {\n\t\tstate.copy_ = shallowCopy(\n\t\t\tstate.base_,\n\t\t\tstate.scope_.immer_.useStrictShallowCopy_\n\t\t)\n\t}\n}\n","import {\n\tIProduceWithPatches,\n\tIProduce,\n\tImmerState,\n\tDrafted,\n\tisDraftable,\n\tprocessResult,\n\tPatch,\n\tObjectish,\n\tDRAFT_STATE,\n\tDraft,\n\tPatchListener,\n\tisDraft,\n\tisMap,\n\tisSet,\n\tcreateProxyProxy,\n\tgetPlugin,\n\tdie,\n\tenterScope,\n\trevokeScope,\n\tleaveScope,\n\tusePatchesInScope,\n\tgetCurrentScope,\n\tNOTHING,\n\tfreeze,\n\tcurrent\n} from \"../internal\"\n\ninterface ProducersFns {\n\tproduce: IProduce\n\tproduceWithPatches: IProduceWithPatches\n}\n\nexport class Immer implements ProducersFns {\n\tautoFreeze_: boolean = true\n\tuseStrictShallowCopy_: boolean = false\n\n\tconstructor(config?: {autoFreeze?: boolean; useStrictShallowCopy?: boolean}) {\n\t\tif (typeof config?.autoFreeze === \"boolean\")\n\t\t\tthis.setAutoFreeze(config!.autoFreeze)\n\t\tif (typeof config?.useStrictShallowCopy === \"boolean\")\n\t\t\tthis.setUseStrictShallowCopy(config!.useStrictShallowCopy)\n\t}\n\n\t/**\n\t * The `produce` function takes a value and a \"recipe function\" (whose\n\t * return value often depends on the base state). The recipe function is\n\t * free to mutate its first argument however it wants. All mutations are\n\t * only ever applied to a __copy__ of the base state.\n\t *\n\t * Pass only a function to create a \"curried producer\" which relieves you\n\t * from passing the recipe function every time.\n\t *\n\t * Only plain objects and arrays are made mutable. All other objects are\n\t * considered uncopyable.\n\t *\n\t * Note: This function is __bound__ to its `Immer` instance.\n\t *\n\t * @param {any} base - the initial state\n\t * @param {Function} recipe - function that receives a proxy of the base state as first argument and which can be freely modified\n\t * @param {Function} patchListener - optional function that will be called with all the patches produced here\n\t * @returns {any} a new state, or the initial state if nothing was modified\n\t */\n\tproduce: IProduce = (base: any, recipe?: any, patchListener?: any) => {\n\t\t// curried invocation\n\t\tif (typeof base === \"function\" && typeof recipe !== \"function\") {\n\t\t\tconst defaultBase = recipe\n\t\t\trecipe = base\n\n\t\t\tconst self = this\n\t\t\treturn function curriedProduce(\n\t\t\t\tthis: any,\n\t\t\t\tbase = defaultBase,\n\t\t\t\t...args: any[]\n\t\t\t) {\n\t\t\t\treturn self.produce(base, (draft: Drafted) => recipe.call(this, draft, ...args)) // prettier-ignore\n\t\t\t}\n\t\t}\n\n\t\tif (typeof recipe !== \"function\") die(6)\n\t\tif (patchListener !== undefined && typeof patchListener !== \"function\")\n\t\t\tdie(7)\n\n\t\tlet result\n\n\t\t// Only plain objects, arrays, and \"immerable classes\" are drafted.\n\t\tif (isDraftable(base)) {\n\t\t\tconst scope = enterScope(this)\n\t\t\tconst proxy = createProxy(base, undefined)\n\t\t\tlet hasError = true\n\t\t\ttry {\n\t\t\t\tresult = recipe(proxy)\n\t\t\t\thasError = false\n\t\t\t} finally {\n\t\t\t\t// finally instead of catch + rethrow better preserves original stack\n\t\t\t\tif (hasError) revokeScope(scope)\n\t\t\t\telse leaveScope(scope)\n\t\t\t}\n\t\t\tusePatchesInScope(scope, patchListener)\n\t\t\treturn processResult(result, scope)\n\t\t} else if (!base || typeof base !== \"object\") {\n\t\t\tresult = recipe(base)\n\t\t\tif (result === undefined) result = base\n\t\t\tif (result === NOTHING) result = undefined\n\t\t\tif (this.autoFreeze_) freeze(result, true)\n\t\t\tif (patchListener) {\n\t\t\t\tconst p: Patch[] = []\n\t\t\t\tconst ip: Patch[] = []\n\t\t\t\tgetPlugin(\"Patches\").generateReplacementPatches_(base, result, p, ip)\n\t\t\t\tpatchListener(p, ip)\n\t\t\t}\n\t\t\treturn result\n\t\t} else die(1, base)\n\t}\n\n\tproduceWithPatches: IProduceWithPatches = (base: any, recipe?: any): any => {\n\t\t// curried invocation\n\t\tif (typeof base === \"function\") {\n\t\t\treturn (state: any, ...args: any[]) =>\n\t\t\t\tthis.produceWithPatches(state, (draft: any) => base(draft, ...args))\n\t\t}\n\n\t\tlet patches: Patch[], inversePatches: Patch[]\n\t\tconst result = this.produce(base, recipe, (p: Patch[], ip: Patch[]) => {\n\t\t\tpatches = p\n\t\t\tinversePatches = ip\n\t\t})\n\t\treturn [result, patches!, inversePatches!]\n\t}\n\n\tcreateDraft<T extends Objectish>(base: T): Draft<T> {\n\t\tif (!isDraftable(base)) die(8)\n\t\tif (isDraft(base)) base = current(base)\n\t\tconst scope = enterScope(this)\n\t\tconst proxy = createProxy(base, undefined)\n\t\tproxy[DRAFT_STATE].isManual_ = true\n\t\tleaveScope(scope)\n\t\treturn proxy as any\n\t}\n\n\tfinishDraft<D extends Draft<any>>(\n\t\tdraft: D,\n\t\tpatchListener?: PatchListener\n\t): D extends Draft<infer T> ? T : never {\n\t\tconst state: ImmerState = draft && (draft as any)[DRAFT_STATE]\n\t\tif (!state || !state.isManual_) die(9)\n\t\tconst {scope_: scope} = state\n\t\tusePatchesInScope(scope, patchListener)\n\t\treturn processResult(undefined, scope)\n\t}\n\n\t/**\n\t * Pass true to automatically freeze all copies created by Immer.\n\t *\n\t * By default, auto-freezing is enabled.\n\t */\n\tsetAutoFreeze(value: boolean) {\n\t\tthis.autoFreeze_ = value\n\t}\n\n\t/**\n\t * Pass true to enable strict shallow copy.\n\t *\n\t * By default, immer does not copy the object descriptors such as getter, setter and non-enumrable properties.\n\t */\n\tsetUseStrictShallowCopy(value: boolean) {\n\t\tthis.useStrictShallowCopy_ = value\n\t}\n\n\tapplyPatches<T extends Objectish>(base: T, patches: Patch[]): T {\n\t\t// If a patch replaces the entire state, take that replacement as base\n\t\t// before applying patches\n\t\tlet i: number\n\t\tfor (i = patches.length - 1; i >= 0; i--) {\n\t\t\tconst patch = patches[i]\n\t\t\tif (patch.path.length === 0 && patch.op === \"replace\") {\n\t\t\t\tbase = patch.value\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\t// If there was a patch that replaced the entire state, start from the\n\t\t// patch after that.\n\t\tif (i > -1) {\n\t\t\tpatches = patches.slice(i + 1)\n\t\t}\n\n\t\tconst applyPatchesImpl = getPlugin(\"Patches\").applyPatches_\n\t\tif (isDraft(base)) {\n\t\t\t// N.B: never hits if some patch a replacement, patches are never drafts\n\t\t\treturn applyPatchesImpl(base, patches)\n\t\t}\n\t\t// Otherwise, produce a copy of the base state.\n\t\treturn this.produce(base, (draft: Drafted) =>\n\t\t\tapplyPatchesImpl(draft, patches)\n\t\t)\n\t}\n}\n\nexport function createProxy<T extends Objectish>(\n\tvalue: T,\n\tparent?: ImmerState\n): Drafted<T, ImmerState> {\n\t// precondition: createProxy should be guarded by isDraftable, so we know we can safely draft\n\tconst draft: Drafted = isMap(value)\n\t\t? getPlugin(\"MapSet\").proxyMap_(value, parent)\n\t\t: isSet(value)\n\t\t? getPlugin(\"MapSet\").proxySet_(value, parent)\n\t\t: createProxyProxy(value, parent)\n\n\tconst scope = parent ? parent.scope_ : getCurrentScope()\n\tscope.drafts_.push(draft)\n\treturn draft\n}\n","import {\n\tdie,\n\tisDraft,\n\tshallowCopy,\n\teach,\n\tDRAFT_STATE,\n\tset,\n\tImmerState,\n\tisDraftable,\n\tisFrozen\n} from \"../internal\"\n\n/** Takes a snapshot of the current state of a draft and finalizes it (but without freezing). This is a great utility to print the current state during debugging (no Proxies in the way). The output of current can also be safely leaked outside the producer. */\nexport function current<T>(value: T): T\nexport function current(value: any): any {\n\tif (!isDraft(value)) die(10, value)\n\treturn currentImpl(value)\n}\n\nfunction currentImpl(value: any): any {\n\tif (!isDraftable(value) || isFrozen(value)) return value\n\tconst state: ImmerState | undefined = value[DRAFT_STATE]\n\tlet copy: any\n\tif (state) {\n\t\tif (!state.modified_) return state.base_\n\t\t// Optimization: avoid generating new drafts during copying\n\t\tstate.finalized_ = true\n\t\tcopy = shallowCopy(value, state.scope_.immer_.useStrictShallowCopy_)\n\t} else {\n\t\tcopy = shallowCopy(value, true)\n\t}\n\t// recurse\n\teach(copy, (key, childValue) => {\n\t\tset(copy, key, currentImpl(childValue))\n\t})\n\tif (state) {\n\t\tstate.finalized_ = false\n\t}\n\treturn copy\n}\n","import {immerable} from \"../immer\"\nimport {\n\tImmerState,\n\tPatch,\n\tSetState,\n\tProxyArrayState,\n\tMapState,\n\tProxyObjectState,\n\tPatchPath,\n\tget,\n\teach,\n\thas,\n\tgetArchtype,\n\tgetPrototypeOf,\n\tisSet,\n\tisMap,\n\tloadPlugin,\n\tArchType,\n\tdie,\n\tisDraft,\n\tisDraftable,\n\tNOTHING,\n\terrors\n} from \"../internal\"\n\nexport function enablePatches() {\n\tconst errorOffset = 16\n\tif (process.env.NODE_ENV !== \"production\") {\n\t\terrors.push(\n\t\t\t'Sets cannot have \"replace\" patches.',\n\t\t\tfunction(op: string) {\n\t\t\t\treturn \"Unsupported patch operation: \" + op\n\t\t\t},\n\t\t\tfunction(path: string) {\n\t\t\t\treturn \"Cannot apply patch, path doesn't resolve: \" + path\n\t\t\t},\n\t\t\t\"Patching reserved attributes like __proto__, prototype and constructor is not allowed\"\n\t\t)\n\t}\n\n\tconst REPLACE = \"replace\"\n\tconst ADD = \"add\"\n\tconst REMOVE = \"remove\"\n\n\tfunction generatePatches_(\n\t\tstate: ImmerState,\n\t\tbasePath: PatchPath,\n\t\tpatches: Patch[],\n\t\tinversePatches: Patch[]\n\t): void {\n\t\tswitch (state.type_) {\n\t\t\tcase ArchType.Object:\n\t\t\tcase ArchType.Map:\n\t\t\t\treturn generatePatchesFromAssigned(\n\t\t\t\t\tstate,\n\t\t\t\t\tbasePath,\n\t\t\t\t\tpatches,\n\t\t\t\t\tinversePatches\n\t\t\t\t)\n\t\t\tcase ArchType.Array:\n\t\t\t\treturn generateArrayPatches(state, basePath, patches, inversePatches)\n\t\t\tcase ArchType.Set:\n\t\t\t\treturn generateSetPatches(\n\t\t\t\t\t(state as any) as SetState,\n\t\t\t\t\tbasePath,\n\t\t\t\t\tpatches,\n\t\t\t\t\tinversePatches\n\t\t\t\t)\n\t\t}\n\t}\n\n\tfunction generateArrayPatches(\n\t\tstate: ProxyArrayState,\n\t\tbasePath: PatchPath,\n\t\tpatches: Patch[],\n\t\tinversePatches: Patch[]\n\t) {\n\t\tlet {base_, assigned_} = state\n\t\tlet copy_ = state.copy_!\n\n\t\t// Reduce complexity by ensuring `base` is never longer.\n\t\tif (copy_.length < base_.length) {\n\t\t\t// @ts-ignore\n\t\t\t;[base_, copy_] = [copy_, base_]\n\t\t\t;[patches, inversePatches] = [inversePatches, patches]\n\t\t}\n\n\t\t// Process replaced indices.\n\t\tfor (let i = 0; i < base_.length; i++) {\n\t\t\tif (assigned_[i] && copy_[i] !== base_[i]) {\n\t\t\t\tconst path = basePath.concat([i])\n\t\t\t\tpatches.push({\n\t\t\t\t\top: REPLACE,\n\t\t\t\t\tpath,\n\t\t\t\t\t// Need to maybe clone it, as it can in fact be the original value\n\t\t\t\t\t// due to the base/copy inversion at the start of this function\n\t\t\t\t\tvalue: clonePatchValueIfNeeded(copy_[i])\n\t\t\t\t})\n\t\t\t\tinversePatches.push({\n\t\t\t\t\top: REPLACE,\n\t\t\t\t\tpath,\n\t\t\t\t\tvalue: clonePatchValueIfNeeded(base_[i])\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\n\t\t// Process added indices.\n\t\tfor (let i = base_.length; i < copy_.length; i++) {\n\t\t\tconst path = basePath.concat([i])\n\t\t\tpatches.push({\n\t\t\t\top: ADD,\n\t\t\t\tpath,\n\t\t\t\t// Need to maybe clone it, as it can in fact be the original value\n\t\t\t\t// due to the base/copy inversion at the start of this function\n\t\t\t\tvalue: clonePatchValueIfNeeded(copy_[i])\n\t\t\t})\n\t\t}\n\t\tfor (let i = copy_.length - 1; base_.length <= i; --i) {\n\t\t\tconst path = basePath.concat([i])\n\t\t\tinversePatches.push({\n\t\t\t\top: REMOVE,\n\t\t\t\tpath\n\t\t\t})\n\t\t}\n\t}\n\n\t// This is used for both Map objects and normal objects.\n\tfunction generatePatchesFromAssigned(\n\t\tstate: MapState | ProxyObjectState,\n\t\tbasePath: PatchPath,\n\t\tpatches: Patch[],\n\t\tinversePatches: Patch[]\n\t) {\n\t\tconst {base_, copy_} = state\n\t\teach(state.assigned_!, (key, assignedValue) => {\n\t\t\tconst origValue = get(base_, key)\n\t\t\tconst value = get(copy_!, key)\n\t\t\tconst op = !assignedValue ? REMOVE : has(base_, key) ? REPLACE : ADD\n\t\t\tif (origValue === value && op === REPLACE) return\n\t\t\tconst path = basePath.concat(key as any)\n\t\t\tpatches.push(op === REMOVE ? {op, path} : {op, path, value})\n\t\t\tinversePatches.push(\n\t\t\t\top === ADD\n\t\t\t\t\t? {op: REMOVE, path}\n\t\t\t\t\t: op === REMOVE\n\t\t\t\t\t? {op: ADD, path, value: clonePatchValueIfNeeded(origValue)}\n\t\t\t\t\t: {op: REPLACE, path, value: clonePatchValueIfNeeded(origValue)}\n\t\t\t)\n\t\t})\n\t}\n\n\tfunction generateSetPatches(\n\t\tstate: SetState,\n\t\tbasePath: PatchPath,\n\t\tpatches: Patch[],\n\t\tinversePatches: Patch[]\n\t) {\n\t\tlet {base_, copy_} = state\n\n\t\tlet i = 0\n\t\tbase_.forEach((value: any) => {\n\t\t\tif (!copy_!.has(value)) {\n\t\t\t\tconst path = basePath.concat([i])\n\t\t\t\tpatches.push({\n\t\t\t\t\top: REMOVE,\n\t\t\t\t\tpath,\n\t\t\t\t\tvalue\n\t\t\t\t})\n\t\t\t\tinversePatches.unshift({\n\t\t\t\t\top: ADD,\n\t\t\t\t\tpath,\n\t\t\t\t\tvalue\n\t\t\t\t})\n\t\t\t}\n\t\t\ti++\n\t\t})\n\t\ti = 0\n\t\tcopy_!.forEach((value: any) => {\n\t\t\tif (!base_.has(value)) {\n\t\t\t\tconst path = basePath.concat([i])\n\t\t\t\tpatches.push({\n\t\t\t\t\top: ADD,\n\t\t\t\t\tpath,\n\t\t\t\t\tvalue\n\t\t\t\t})\n\t\t\t\tinversePatches.unshift({\n\t\t\t\t\top: REMOVE,\n\t\t\t\t\tpath,\n\t\t\t\t\tvalue\n\t\t\t\t})\n\t\t\t}\n\t\t\ti++\n\t\t})\n\t}\n\n\tfunction generateReplacementPatches_(\n\t\tbaseValue: any,\n\t\treplacement: any,\n\t\tpatches: Patch[],\n\t\tinversePatches: Patch[]\n\t): void {\n\t\tpatches.push({\n\t\t\top: REPLACE,\n\t\t\tpath: [],\n\t\t\tvalue: replacement === NOTHING ? undefined : replacement\n\t\t})\n\t\tinversePatches.push({\n\t\t\top: REPLACE,\n\t\t\tpath: [],\n\t\t\tvalue: baseValue\n\t\t})\n\t}\n\n\tfunction applyPatches_<T>(draft: T, patches: Patch[]): T {\n\t\tpatches.forEach(patch => {\n\t\t\tconst {path, op} = patch\n\n\t\t\tlet base: any = draft\n\t\t\tfor (let i = 0; i < path.length - 1; i++) {\n\t\t\t\tconst parentType = getArchtype(base)\n\t\t\t\tlet p = path[i]\n\t\t\t\tif (typeof p !== \"string\" && typeof p !== \"number\") {\n\t\t\t\t\tp = \"\" + p\n\t\t\t\t}\n\n\t\t\t\t// See #738, avoid prototype pollution\n\t\t\t\tif (\n\t\t\t\t\t(parentType === ArchType.Object || parentType === ArchType.Array) &&\n\t\t\t\t\t(p === \"__proto__\" || p === \"constructor\")\n\t\t\t\t)\n\t\t\t\t\tdie(errorOffset + 3)\n\t\t\t\tif (typeof base === \"function\" && p === \"prototype\")\n\t\t\t\t\tdie(errorOffset + 3)\n\t\t\t\tbase = get(base, p)\n\t\t\t\tif (typeof base !== \"object\") die(errorOffset + 2, path.join(\"/\"))\n\t\t\t}\n\n\t\t\tconst type = getArchtype(base)\n\t\t\tconst value = deepClonePatchValue(patch.value) // used to clone patch to ensure original patch is not modified, see #411\n\t\t\tconst key = path[path.length - 1]\n\t\t\tswitch (op) {\n\t\t\t\tcase REPLACE:\n\t\t\t\t\tswitch (type) {\n\t\t\t\t\t\tcase ArchType.Map:\n\t\t\t\t\t\t\treturn base.set(key, value)\n\t\t\t\t\t\t/* istanbul ignore next */\n\t\t\t\t\t\tcase ArchType.Set:\n\t\t\t\t\t\t\tdie(errorOffset)\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t// if value is an object, then it's assigned by reference\n\t\t\t\t\t\t\t// in the following add or remove ops, the value field inside the patch will also be modifyed\n\t\t\t\t\t\t\t// so we use value from the cloned patch\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\treturn (base[key] = value)\n\t\t\t\t\t}\n\t\t\t\tcase ADD:\n\t\t\t\t\tswitch (type) {\n\t\t\t\t\t\tcase ArchType.Array:\n\t\t\t\t\t\t\treturn key === \"-\"\n\t\t\t\t\t\t\t\t? base.push(value)\n\t\t\t\t\t\t\t\t: base.splice(key as any, 0, value)\n\t\t\t\t\t\tcase ArchType.Map:\n\t\t\t\t\t\t\treturn base.set(key, value)\n\t\t\t\t\t\tcase ArchType.Set:\n\t\t\t\t\t\t\treturn base.add(value)\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\treturn (base[key] = value)\n\t\t\t\t\t}\n\t\t\t\tcase REMOVE:\n\t\t\t\t\tswitch (type) {\n\t\t\t\t\t\tcase ArchType.Array:\n\t\t\t\t\t\t\treturn base.splice(key as any, 1)\n\t\t\t\t\t\tcase ArchType.Map:\n\t\t\t\t\t\t\treturn base.delete(key)\n\t\t\t\t\t\tcase ArchType.Set:\n\t\t\t\t\t\t\treturn base.delete(patch.value)\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\treturn delete base[key]\n\t\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\tdie(errorOffset + 1, op)\n\t\t\t}\n\t\t})\n\n\t\treturn draft\n\t}\n\n\t// optimize: this is quite a performance hit, can we detect intelligently when it is needed?\n\t// E.g. auto-draft when new objects from outside are assigned and modified?\n\t// (See failing test when deepClone just returns obj)\n\tfunction deepClonePatchValue<T>(obj: T): T\n\tfunction deepClonePatchValue(obj: any) {\n\t\tif (!isDraftable(obj)) return obj\n\t\tif (Array.isArray(obj)) return obj.map(deepClonePatchValue)\n\t\tif (isMap(obj))\n\t\t\treturn new Map(\n\t\t\t\tArray.from(obj.entries()).map(([k, v]) => [k, deepClonePatchValue(v)])\n\t\t\t)\n\t\tif (isSet(obj)) return new Set(Array.from(obj).map(deepClonePatchValue))\n\t\tconst cloned = Object.create(getPrototypeOf(obj))\n\t\tfor (const key in obj) cloned[key] = deepClonePatchValue(obj[key])\n\t\tif (has(obj, immerable)) cloned[immerable] = obj[immerable]\n\t\treturn cloned\n\t}\n\n\tfunction clonePatchValueIfNeeded<T>(obj: T): T {\n\t\tif (isDraft(obj)) {\n\t\t\treturn deepClonePatchValue(obj)\n\t\t} else return obj\n\t}\n\n\tloadPlugin(\"Patches\", {\n\t\tapplyPatches_,\n\t\tgeneratePatches_,\n\t\tgenerateReplacementPatches_\n\t})\n}\n","// types only!\nimport {\n\tImmerState,\n\tAnyMap,\n\tAnySet,\n\tMapState,\n\tSetState,\n\tDRAFT_STATE,\n\tgetCurrentScope,\n\tlatest,\n\tisDraftable,\n\tcreateProxy,\n\tloadPlugin,\n\tmarkChanged,\n\tdie,\n\tArchType,\n\teach\n} from \"../internal\"\n\nexport function enableMapSet() {\n\tclass DraftMap extends Map {\n\t\t[DRAFT_STATE]: MapState\n\n\t\tconstructor(target: AnyMap, parent?: ImmerState) {\n\t\t\tsuper()\n\t\t\tthis[DRAFT_STATE] = {\n\t\t\t\ttype_: ArchType.Map,\n\t\t\t\tparent_: parent,\n\t\t\t\tscope_: parent ? parent.scope_ : getCurrentScope()!,\n\t\t\t\tmodified_: false,\n\t\t\t\tfinalized_: false,\n\t\t\t\tcopy_: undefined,\n\t\t\t\tassigned_: undefined,\n\t\t\t\tbase_: target,\n\t\t\t\tdraft_: this as any,\n\t\t\t\tisManual_: false,\n\t\t\t\trevoked_: false\n\t\t\t}\n\t\t}\n\n\t\tget size(): number {\n\t\t\treturn latest(this[DRAFT_STATE]).size\n\t\t}\n\n\t\thas(key: any): boolean {\n\t\t\treturn latest(this[DRAFT_STATE]).has(key)\n\t\t}\n\n\t\tset(key: any, value: any) {\n\t\t\tconst state: MapState = this[DRAFT_STATE]\n\t\t\tassertUnrevoked(state)\n\t\t\tif (!latest(state).has(key) || latest(state).get(key) !== value) {\n\t\t\t\tprepareMapCopy(state)\n\t\t\t\tmarkChanged(state)\n\t\t\t\tstate.assigned_!.set(key, true)\n\t\t\t\tstate.copy_!.set(key, value)\n\t\t\t\tstate.assigned_!.set(key, true)\n\t\t\t}\n\t\t\treturn this\n\t\t}\n\n\t\tdelete(key: any): boolean {\n\t\t\tif (!this.has(key)) {\n\t\t\t\treturn false\n\t\t\t}\n\n\t\t\tconst state: MapState = this[DRAFT_STATE]\n\t\t\tassertUnrevoked(state)\n\t\t\tprepareMapCopy(state)\n\t\t\tmarkChanged(state)\n\t\t\tif (state.base_.has(key)) {\n\t\t\t\tstate.assigned_!.set(key, false)\n\t\t\t} else {\n\t\t\t\tstate.assigned_!.delete(key)\n\t\t\t}\n\t\t\tstate.copy_!.delete(key)\n\t\t\treturn true\n\t\t}\n\n\t\tclear() {\n\t\t\tconst state: MapState = this[DRAFT_STATE]\n\t\t\tassertUnrevoked(state)\n\t\t\tif (latest(state).size) {\n\t\t\t\tprepareMapCopy(state)\n\t\t\t\tmarkChanged(state)\n\t\t\t\tstate.assigned_ = new Map()\n\t\t\t\teach(state.base_, key => {\n\t\t\t\t\tstate.assigned_!.set(key, false)\n\t\t\t\t})\n\t\t\t\tstate.copy_!.clear()\n\t\t\t}\n\t\t}\n\n\t\tforEach(cb: (value: any, key: any, self: any) => void, thisArg?: any) {\n\t\t\tconst state: MapState = this[DRAFT_STATE]\n\t\t\tlatest(state).forEach((_value: any, key: any, _map: any) => {\n\t\t\t\tcb.call(thisArg, this.get(key), key, this)\n\t\t\t})\n\t\t}\n\n\t\tget(key: any): any {\n\t\t\tconst state: MapState = this[DRAFT_STATE]\n\t\t\tassertUnrevoked(state)\n\t\t\tconst value = latest(state).get(key)\n\t\t\tif (state.finalized_ || !isDraftable(value)) {\n\t\t\t\treturn value\n\t\t\t}\n\t\t\tif (value !== state.base_.get(key)) {\n\t\t\t\treturn value // either already drafted or reassigned\n\t\t\t}\n\t\t\t// despite what it looks, this creates a draft only once, see above condition\n\t\t\tconst draft = createProxy(value, state)\n\t\t\tprepareMapCopy(state)\n\t\t\tstate.copy_!.set(key, draft)\n\t\t\treturn draft\n\t\t}\n\n\t\tkeys(): IterableIterator<any> {\n\t\t\treturn latest(this[DRAFT_STATE]).keys()\n\t\t}\n\n\t\tvalues(): IterableIterator<any> {\n\t\t\tconst iterator = this.keys()\n\t\t\treturn {\n\t\t\t\t[Symbol.iterator]: () => this.values(),\n\t\t\t\tnext: () => {\n\t\t\t\t\tconst r = iterator.next()\n\t\t\t\t\t/* istanbul ignore next */\n\t\t\t\t\tif (r.done) return r\n\t\t\t\t\tconst value = this.get(r.value)\n\t\t\t\t\treturn {\n\t\t\t\t\t\tdone: false,\n\t\t\t\t\t\tvalue\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} as any\n\t\t}\n\n\t\tentries(): IterableIterator<[any, any]> {\n\t\t\tconst iterator = this.keys()\n\t\t\treturn {\n\t\t\t\t[Symbol.iterator]: () => this.entries(),\n\t\t\t\tnext: () => {\n\t\t\t\t\tconst r = iterator.next()\n\t\t\t\t\t/* istanbul ignore next */\n\t\t\t\t\tif (r.done) return r\n\t\t\t\t\tconst value = this.get(r.value)\n\t\t\t\t\treturn {\n\t\t\t\t\t\tdone: false,\n\t\t\t\t\t\tvalue: [r.value, value]\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} as any\n\t\t}\n\n\t\t[Symbol.iterator]() {\n\t\t\treturn this.entries()\n\t\t}\n\t}\n\n\tfunction proxyMap_<T extends AnyMap>(target: T, parent?: ImmerState): T {\n\t\t// @ts-ignore\n\t\treturn new DraftMap(target, parent)\n\t}\n\n\tfunction prepareMapCopy(state: MapState) {\n\t\tif (!state.copy_) {\n\t\t\tstate.assigned_ = new Map()\n\t\t\tstate.copy_ = new Map(state.base_)\n\t\t}\n\t}\n\n\tclass DraftSet extends Set {\n\t\t[DRAFT_STATE]: SetState\n\t\tconstructor(target: AnySet, parent?: ImmerState) {\n\t\t\tsuper()\n\t\t\tthis[DRAFT_STATE] = {\n\t\t\t\ttype_: ArchType.Set,\n\t\t\t\tparent_: parent,\n\t\t\t\tscope_: parent ? parent.scope_ : getCurrentScope()!,\n\t\t\t\tmodified_: false,\n\t\t\t\tfinalized_: false,\n\t\t\t\tcopy_: undefined,\n\t\t\t\tbase_: target,\n\t\t\t\tdraft_: this,\n\t\t\t\tdrafts_: new Map(),\n\t\t\t\trevoked_: false,\n\t\t\t\tisManual_: false\n\t\t\t}\n\t\t}\n\n\t\tget size(): number {\n\t\t\treturn latest(this[DRAFT_STATE]).size\n\t\t}\n\n\t\thas(value: any): boolean {\n\t\t\tconst state: SetState = this[DRAFT_STATE]\n\t\t\tassertUnrevoked(state)\n\t\t\t// bit of trickery here, to be able to recognize both the value, and the draft of its value\n\t\t\tif (!state.copy_) {\n\t\t\t\treturn state.base_.has(value)\n\t\t\t}\n\t\t\tif (state.copy_.has(value)) return true\n\t\t\tif (state.drafts_.has(value) && state.copy_.has(state.drafts_.get(value)))\n\t\t\t\treturn true\n\t\t\treturn false\n\t\t}\n\n\t\tadd(value: any): any {\n\t\t\tconst state: SetState = this[DRAFT_STATE]\n\t\t\tassertUnrevoked(state)\n\t\t\tif (!this.has(value)) {\n\t\t\t\tprepareSetCopy(state)\n\t\t\t\tmarkChanged(state)\n\t\t\t\tstate.copy_!.add(value)\n\t\t\t}\n\t\t\treturn this\n\t\t}\n\n\t\tdelete(value: any): any {\n\t\t\tif (!this.has(value)) {\n\t\t\t\treturn false\n\t\t\t}\n\n\t\t\tconst state: SetState = this[DRAFT_STATE]\n\t\t\tassertUnrevoked(state)\n\t\t\tprepareSetCopy(state)\n\t\t\tmarkChanged(state)\n\t\t\treturn (\n\t\t\t\tstate.copy_!.delete(value) ||\n\t\t\t\t(state.drafts_.has(value)\n\t\t\t\t\t? state.copy_!.delete(state.drafts_.get(value))\n\t\t\t\t\t: /* istanbul ignore next */ false)\n\t\t\t)\n\t\t}\n\n\t\tclear() {\n\t\t\tconst state: SetState = this[DRAFT_STATE]\n\t\t\tassertUnrevoked(state)\n\t\t\tif (latest(state).size) {\n\t\t\t\tprepareSetCopy(state)\n\t\t\t\tmarkChanged(state)\n\t\t\t\tstate.copy_!.clear()\n\t\t\t}\n\t\t}\n\n\t\tvalues(): IterableIterator<any> {\n\t\t\tconst state: SetState = this[DRAFT_STATE]\n\t\t\tassertUnrevoked(state)\n\t\t\tprepareSetCopy(state)\n\t\t\treturn state.copy_!.values()\n\t\t}\n\n\t\tentries(): IterableIterator<[any, any]> {\n\t\t\tconst state: SetState = this[DRAFT_STATE]\n\t\t\tassertUnrevoked(state)\n\t\t\tprepareSetCopy(state)\n\t\t\treturn state.copy_!.entries()\n\t\t}\n\n\t\tkeys(): IterableIterator<any> {\n\t\t\treturn this.values()\n\t\t}\n\n\t\t[Symbol.iterator]() {\n\t\t\treturn this.values()\n\t\t}\n\n\t\tforEach(cb: any, thisArg?: any) {\n\t\t\tconst iterator = this.values()\n\t\t\tlet result = iterator.next()\n\t\t\twhile (!result.done) {\n\t\t\t\tcb.call(thisArg, result.value, result.value, this)\n\t\t\t\tresult = iterator.next()\n\t\t\t}\n\t\t}\n\t}\n\tfunction proxySet_<T extends AnySet>(target: T, parent?: ImmerState): T {\n\t\t// @ts-ignore\n\t\treturn new DraftSet(target, parent)\n\t}\n\n\tfunction prepareSetCopy(state: SetState) {\n\t\tif (!state.copy_) {\n\t\t\t// create drafts for all entries to preserve insertion order\n\t\t\tstate.copy_ = new Set()\n\t\t\tstate.base_.forEach(value => {\n\t\t\t\tif (isDraftable(value)) {\n\t\t\t\t\tconst draft = createProxy(value, state)\n\t\t\t\t\tstate.drafts_.set(value, draft)\n\t\t\t\t\tstate.copy_!.add(draft)\n\t\t\t\t} else {\n\t\t\t\t\tstate.copy_!.add(value)\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t}\n\n\tfunction assertUnrevoked(state: any /*ES5State | MapState | SetState*/) {\n\t\tif (state.revoked_) die(3, JSON.stringify(latest(state)))\n\t}\n\n\tloadPlugin(\"MapSet\", {proxyMap_, proxySet_})\n}\n","\n'use strict'\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./immer.cjs.production.js')\n} else {\n module.exports = require('./immer.cjs.development.js')\n}","function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n return arr2;\n}\nmodule.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\nmodule.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var arrayLikeToArray = require(\"./arrayLikeToArray.js\");\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return arrayLikeToArray(arr);\n}\nmodule.exports = _arrayWithoutHoles, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n return self;\n}\nmodule.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\nmodule.exports = _classCallCheck, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var setPrototypeOf = require(\"./setPrototypeOf.js\");\nvar isNativeReflectConstruct = require(\"./isNativeReflectConstruct.js\");\nfunction _construct(Parent, args, Class) {\n if (isNativeReflectConstruct()) {\n module.exports = _construct = Reflect.construct.bind(), module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n } else {\n module.exports = _construct = function _construct(Parent, args, Class) {\n var a = [null];\n a.push.apply(a, args);\n var Constructor = Function.bind.apply(Parent, a);\n var instance = new Constructor();\n if (Class) setPrototypeOf(instance, Class.prototype);\n return instance;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n }\n return _construct.apply(null, arguments);\n}\nmodule.exports = _construct, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var toPropertyKey = require(\"./toPropertyKey.js\");\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);\n }\n}\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\nmodule.exports = _createClass, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var toPropertyKey = require(\"./toPropertyKey.js\");\nfunction _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}\nmodule.exports = _defineProperty, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _getPrototypeOf(o) {\n module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n return _getPrototypeOf(o);\n}\nmodule.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var setPrototypeOf = require(\"./setPrototypeOf.js\");\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n Object.defineProperty(subClass, \"prototype\", {\n writable: false\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}\nmodule.exports = _inherits, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n \"default\": obj\n };\n}\nmodule.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _isNativeFunction(fn) {\n return Function.toString.call(fn).indexOf(\"[native code]\") !== -1;\n}\nmodule.exports = _isNativeFunction, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n try {\n Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}\nmodule.exports = _isNativeReflectConstruct, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}\nmodule.exports = _iterableToArray, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _iterableToArrayLimit(arr, i) {\n var _i = null == arr ? null : \"undefined\" != typeof Symbol && arr[Symbol.iterator] || arr[\"@@iterator\"];\n if (null != _i) {\n var _s,\n _e,\n _x,\n _r,\n _arr = [],\n _n = !0,\n _d = !1;\n try {\n if (_x = (_i = _i.call(arr)).next, 0 === i) {\n if (Object(_i) !== _i) return;\n _n = !1;\n } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);\n } catch (err) {\n _d = !0, _e = err;\n } finally {\n try {\n if (!_n && null != _i[\"return\"] && (_r = _i[\"return\"](), Object(_r) !== _r)) return;\n } finally {\n if (_d) throw _e;\n }\n }\n return _arr;\n }\n}\nmodule.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nmodule.exports = _nonIterableRest, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nmodule.exports = _nonIterableSpread, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var _typeof = require(\"./typeof.js\")[\"default\"];\nvar assertThisInitialized = require(\"./assertThisInitialized.js\");\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n } else if (call !== void 0) {\n throw new TypeError(\"Derived constructors may only return object or undefined\");\n }\n return assertThisInitialized(self);\n}\nmodule.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var _typeof = require(\"./typeof.js\")[\"default\"];\nfunction _regeneratorRuntime() {\n \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */\n module.exports = _regeneratorRuntime = function _regeneratorRuntime() {\n return exports;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n var exports = {},\n Op = Object.prototype,\n hasOwn = Op.hasOwnProperty,\n defineProperty = Object.defineProperty || function (obj, key, desc) {\n obj[key] = desc.value;\n },\n $Symbol = \"function\" == typeof Symbol ? Symbol : {},\n iteratorSymbol = $Symbol.iterator || \"@@iterator\",\n asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\",\n toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n function define(obj, key, value) {\n return Object.defineProperty(obj, key, {\n value: value,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }), obj[key];\n }\n try {\n define({}, \"\");\n } catch (err) {\n define = function define(obj, key, value) {\n return obj[key] = value;\n };\n }\n function wrap(innerFn, outerFn, self, tryLocsList) {\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,\n generator = Object.create(protoGenerator.prototype),\n context = new Context(tryLocsList || []);\n return defineProperty(generator, \"_invoke\", {\n value: makeInvokeMethod(innerFn, self, context)\n }), generator;\n }\n function tryCatch(fn, obj, arg) {\n try {\n return {\n type: \"normal\",\n arg: fn.call(obj, arg)\n };\n } catch (err) {\n return {\n type: \"throw\",\n arg: err\n };\n }\n }\n exports.wrap = wrap;\n var ContinueSentinel = {};\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n var IteratorPrototype = {};\n define(IteratorPrototype, iteratorSymbol, function () {\n return this;\n });\n var getProto = Object.getPrototypeOf,\n NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);\n var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n define(prototype, method, function (arg) {\n return this._invoke(method, arg);\n });\n });\n }\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (\"throw\" !== record.type) {\n var result = record.arg,\n value = result.value;\n return value && \"object\" == _typeof(value) && hasOwn.call(value, \"__await\") ? PromiseImpl.resolve(value.__await).then(function (value) {\n invoke(\"next\", value, resolve, reject);\n }, function (err) {\n invoke(\"throw\", err, resolve, reject);\n }) : PromiseImpl.resolve(value).then(function (unwrapped) {\n result.value = unwrapped, resolve(result);\n }, function (error) {\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n reject(record.arg);\n }\n var previousPromise;\n defineProperty(this, \"_invoke\", {\n value: function value(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function (resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();\n }\n });\n }\n function makeInvokeMethod(innerFn, self, context) {\n var state = \"suspendedStart\";\n return function (method, arg) {\n if (\"executing\" === state) throw new Error(\"Generator is already running\");\n if (\"completed\" === state) {\n if (\"throw\" === method) throw arg;\n return doneResult();\n }\n for (context.method = method, context.arg = arg;;) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n if (\"next\" === context.method) context.sent = context._sent = context.arg;else if (\"throw\" === context.method) {\n if (\"suspendedStart\" === state) throw state = \"completed\", context.arg;\n context.dispatchException(context.arg);\n } else \"return\" === context.method && context.abrupt(\"return\", context.arg);\n state = \"executing\";\n var record = tryCatch(innerFn, self, context);\n if (\"normal\" === record.type) {\n if (state = context.done ? \"completed\" : \"suspendedYield\", record.arg === ContinueSentinel) continue;\n return {\n value: record.arg,\n done: context.done\n };\n }\n \"throw\" === record.type && (state = \"completed\", context.method = \"throw\", context.arg = record.arg);\n }\n };\n }\n function maybeInvokeDelegate(delegate, context) {\n var methodName = context.method,\n method = delegate.iterator[methodName];\n if (undefined === method) return context.delegate = null, \"throw\" === methodName && delegate.iterator[\"return\"] && (context.method = \"return\", context.arg = undefined, maybeInvokeDelegate(delegate, context), \"throw\" === context.method) || \"return\" !== methodName && (context.method = \"throw\", context.arg = new TypeError(\"The iterator does not provide a '\" + methodName + \"' method\")), ContinueSentinel;\n var record = tryCatch(method, delegate.iterator, context.arg);\n if (\"throw\" === record.type) return context.method = \"throw\", context.arg = record.arg, context.delegate = null, ContinueSentinel;\n var info = record.arg;\n return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, \"return\" !== context.method && (context.method = \"next\", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = \"throw\", context.arg = new TypeError(\"iterator result is not an object\"), context.delegate = null, ContinueSentinel);\n }\n function pushTryEntry(locs) {\n var entry = {\n tryLoc: locs[0]\n };\n 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);\n }\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\", delete record.arg, entry.completion = record;\n }\n function Context(tryLocsList) {\n this.tryEntries = [{\n tryLoc: \"root\"\n }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);\n }\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) return iteratorMethod.call(iterable);\n if (\"function\" == typeof iterable.next) return iterable;\n if (!isNaN(iterable.length)) {\n var i = -1,\n next = function next() {\n for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;\n return next.value = undefined, next.done = !0, next;\n };\n return next.next = next;\n }\n }\n return {\n next: doneResult\n };\n }\n function doneResult() {\n return {\n value: undefined,\n done: !0\n };\n }\n return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, \"constructor\", {\n value: GeneratorFunctionPrototype,\n configurable: !0\n }), defineProperty(GeneratorFunctionPrototype, \"constructor\", {\n value: GeneratorFunction,\n configurable: !0\n }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, \"GeneratorFunction\"), exports.isGeneratorFunction = function (genFun) {\n var ctor = \"function\" == typeof genFun && genFun.constructor;\n return !!ctor && (ctor === GeneratorFunction || \"GeneratorFunction\" === (ctor.displayName || ctor.name));\n }, exports.mark = function (genFun) {\n return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, \"GeneratorFunction\")), genFun.prototype = Object.create(Gp), genFun;\n }, exports.awrap = function (arg) {\n return {\n __await: arg\n };\n }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n return this;\n }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n void 0 === PromiseImpl && (PromiseImpl = Promise);\n var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);\n return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {\n return result.done ? result.value : iter.next();\n });\n }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, \"Generator\"), define(Gp, iteratorSymbol, function () {\n return this;\n }), define(Gp, \"toString\", function () {\n return \"[object Generator]\";\n }), exports.keys = function (val) {\n var object = Object(val),\n keys = [];\n for (var key in object) keys.push(key);\n return keys.reverse(), function next() {\n for (; keys.length;) {\n var key = keys.pop();\n if (key in object) return next.value = key, next.done = !1, next;\n }\n return next.done = !0, next;\n };\n }, exports.values = values, Context.prototype = {\n constructor: Context,\n reset: function reset(skipTempReset) {\n if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) \"t\" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);\n },\n stop: function stop() {\n this.done = !0;\n var rootRecord = this.tryEntries[0].completion;\n if (\"throw\" === rootRecord.type) throw rootRecord.arg;\n return this.rval;\n },\n dispatchException: function dispatchException(exception) {\n if (this.done) throw exception;\n var context = this;\n function handle(loc, caught) {\n return record.type = \"throw\", record.arg = exception, context.next = loc, caught && (context.method = \"next\", context.arg = undefined), !!caught;\n }\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i],\n record = entry.completion;\n if (\"root\" === entry.tryLoc) return handle(\"end\");\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\"),\n hasFinally = hasOwn.call(entry, \"finallyLoc\");\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);\n if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);\n } else {\n if (!hasFinally) throw new Error(\"try statement without catch or finally\");\n if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);\n }\n }\n }\n },\n abrupt: function abrupt(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev && hasOwn.call(entry, \"finallyLoc\") && this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n finallyEntry && (\"break\" === type || \"continue\" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);\n var record = finallyEntry ? finallyEntry.completion : {};\n return record.type = type, record.arg = arg, finallyEntry ? (this.method = \"next\", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);\n },\n complete: function complete(record, afterLoc) {\n if (\"throw\" === record.type) throw record.arg;\n return \"break\" === record.type || \"continue\" === record.type ? this.next = record.arg : \"return\" === record.type ? (this.rval = this.arg = record.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;\n },\n finish: function finish(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;\n }\n },\n \"catch\": function _catch(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (\"throw\" === record.type) {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n throw new Error(\"illegal catch attempt\");\n },\n delegateYield: function delegateYield(iterable, resultName, nextLoc) {\n return this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n }, \"next\" === this.method && (this.arg = undefined), ContinueSentinel;\n }\n }, exports;\n}\nmodule.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _setPrototypeOf(o, p) {\n module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n return _setPrototypeOf(o, p);\n}\nmodule.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var arrayWithHoles = require(\"./arrayWithHoles.js\");\nvar iterableToArrayLimit = require(\"./iterableToArrayLimit.js\");\nvar unsupportedIterableToArray = require(\"./unsupportedIterableToArray.js\");\nvar nonIterableRest = require(\"./nonIterableRest.js\");\nfunction _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();\n}\nmodule.exports = _slicedToArray, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var arrayWithoutHoles = require(\"./arrayWithoutHoles.js\");\nvar iterableToArray = require(\"./iterableToArray.js\");\nvar unsupportedIterableToArray = require(\"./unsupportedIterableToArray.js\");\nvar nonIterableSpread = require(\"./nonIterableSpread.js\");\nfunction _toConsumableArray(arr) {\n return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();\n}\nmodule.exports = _toConsumableArray, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var _typeof = require(\"./typeof.js\")[\"default\"];\nfunction _toPrimitive(input, hint) {\n if (_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}\nmodule.exports = _toPrimitive, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var _typeof = require(\"./typeof.js\")[\"default\"];\nvar toPrimitive = require(\"./toPrimitive.js\");\nfunction _toPropertyKey(arg) {\n var key = toPrimitive(arg, \"string\");\n return _typeof(key) === \"symbol\" ? key : String(key);\n}\nmodule.exports = _toPropertyKey, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return (module.exports = _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports), _typeof(obj);\n}\nmodule.exports = _typeof, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var arrayLikeToArray = require(\"./arrayLikeToArray.js\");\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}\nmodule.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var getPrototypeOf = require(\"./getPrototypeOf.js\");\nvar setPrototypeOf = require(\"./setPrototypeOf.js\");\nvar isNativeFunction = require(\"./isNativeFunction.js\");\nvar construct = require(\"./construct.js\");\nfunction _wrapNativeSuper(Class) {\n var _cache = typeof Map === \"function\" ? new Map() : undefined;\n module.exports = _wrapNativeSuper = function _wrapNativeSuper(Class) {\n if (Class === null || !isNativeFunction(Class)) return Class;\n if (typeof Class !== \"function\") {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n if (typeof _cache !== \"undefined\") {\n if (_cache.has(Class)) return _cache.get(Class);\n _cache.set(Class, Wrapper);\n }\n function Wrapper() {\n return construct(Class, arguments, getPrototypeOf(this).constructor);\n }\n Wrapper.prototype = Object.create(Class.prototype, {\n constructor: {\n value: Wrapper,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n return setPrototypeOf(Wrapper, Class);\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n return _wrapNativeSuper(Class);\n}\nmodule.exports = _wrapNativeSuper, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","// TODO(Babel 8): Remove this file.\n\nvar runtime = require(\"../helpers/regeneratorRuntime\")();\nmodule.exports = runtime;\n\n// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(40);\n"],"names":["root","factory","exports","module","define","amd","self","Model","compose","funcs","length","arg","reduce","a","b","GlobalModal","__MId","State","Actions","Subscribes","getCtx","modelName","state","actions","subscribes","getState","__awaiter","thisArg","_arguments","P","generator","adopt","value","resolve","Promise","reject","fulfilled","step","next","e","rejected","result","done","then","apply","logger","ctx","params","console","log","action","name","r","asyncLogger","runAction","actionRes","payload","warn","newState","asyncRunAction","setterFun","ModelState","Object","assign","updateState","produce","publish","forEach","callback","returnState","_next","_params","presetMiddleware","models","entries","model","rebuildAsyncActions","asyncActions","rebuildActions","push","filter","item","updateActions","key","resetAction","undefined","middlewares","map","middleware","composeFun","__export","Immer","applyPatches","castDraft","castImmutable","createDraft","current","enableMapSet","enablePatches","finishDraft","freeze","immerable","DRAFTABLE","isDraft","isDraftable","nothing","NOTHING","original","produceWithPatches","setAutoFreeze","setUseStrictShallowCopy","Symbol","DRAFT_STATE","die","error","Error","getPrototypeOf","isPlainObject","Array","isArray","constructor","isMap","isSet","objectCtorString","prototype","toString","proto","Ctor","hasOwnProperty","call","Function","base_","each","obj","iter","getArchtype","entry","index","thing","type_","has","prop","get","set","propOrOldValue","t","add","is","x","y","target","Map","Set","latest","copy_","shallowCopy","base","strict","slice","create","descriptors","getOwnPropertyDescriptors","keys","Reflect","ownKeys","i","desc","writable","configurable","enumerable","deep","isFrozen","clear","dontMutateFrozenCollections","_key","currentScope","plugins","getPlugin","pluginKey","plugin","loadPlugin","implementation","getCurrentScope","createScope","parent_","immer_","drafts_","canAutoFreeze_","unfinalizedDrafts_","usePatchesInScope","scope","patchListener","patches_","inversePatches_","patchListener_","revokeScope","leaveScope","revokeDraft","enterScope","immer","draft","revoke_","revoked_","processResult","baseDraft","modified_","finalize","maybeFreeze","generateReplacementPatches_","rootScope","path","childValue","finalizeProperty","scope_","finalized_","resultEach","generatePatches_","parentState","targetObject","rootPath","targetIsSet","res","assigned_","concat","autoFreeze_","createProxyProxy","parent","draft_","isManual_","traps","objectTraps","arrayTraps","Proxy","revocable","revoke","proxy","source","readPropFromProto","peek","prepareCopy","createProxy","getDescriptorFromProto","currentState","markChanged","Number","isNaN","deleteProperty","getOwnPropertyDescriptor","owner","defineProperty","setPrototypeOf","useStrictShallowCopy_","fn","arguments","this","config","recipe","defaultBase","args","hasError","p","ip","patches","inversePatches","autoFreeze","useStrictShallowCopy","patch","op","applyPatchesImpl","applyPatches_","proxyMap_","proxySet_","currentImpl","copy","REPLACE","ADD","REMOVE","basePath","generatePatchesFromAssigned","generateArrayPatches","generateSetPatches","clonePatchValueIfNeeded","assignedValue","origValue","unshift","baseValue","replacement","parentType","join","type","deepClonePatchValue","splice","from","k","cloned","DraftMap","size","prepareMapCopy","assertUnrevoked","cb","_value","_map","iterator","values","DraftSet","prepareSetCopy","JSON","stringify","bind","_arrayLikeToArray","arr","len","arr2","__esModule","_arrayWithHoles","arrayLikeToArray","require","_arrayWithoutHoles","_assertThisInitialized","ReferenceError","_classCallCheck","instance","Constructor","TypeError","isNativeReflectConstruct","_construct","Parent","Class","construct","toPropertyKey","_defineProperties","props","descriptor","_createClass","protoProps","staticProps","_defineProperty","_getPrototypeOf","o","__proto__","_inherits","subClass","superClass","_interopRequireDefault","_isNativeFunction","indexOf","_isNativeReflectConstruct","sham","Boolean","valueOf","_iterableToArray","_iterableToArrayLimit","_i","_s","_e","_x","_r","_arr","_n","_d","err","_nonIterableRest","_nonIterableSpread","_typeof","assertThisInitialized","_possibleConstructorReturn","_regeneratorRuntime","Op","hasOwn","$Symbol","iteratorSymbol","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","wrap","innerFn","outerFn","tryLocsList","protoGenerator","Generator","context","Context","makeInvokeMethod","tryCatch","ContinueSentinel","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","NativeIteratorPrototype","Gp","defineIteratorMethods","method","_invoke","AsyncIterator","PromiseImpl","invoke","record","__await","unwrapped","previousPromise","callInvokeWithMethodAndArg","doneResult","delegate","delegateResult","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","methodName","info","resultName","nextLoc","pushTryEntry","locs","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","resetTryEntry","completion","reset","iterable","iteratorMethod","displayName","isGeneratorFunction","genFun","ctor","mark","awrap","async","val","object","reverse","pop","skipTempReset","prev","charAt","stop","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","thrown","delegateYield","_setPrototypeOf","arrayWithHoles","iterableToArrayLimit","unsupportedIterableToArray","nonIterableRest","_slicedToArray","arrayWithoutHoles","iterableToArray","nonIterableSpread","_toConsumableArray","_toPrimitive","input","hint","prim","toPrimitive","String","_toPropertyKey","_unsupportedIterableToArray","minLen","n","test","isNativeFunction","_wrapNativeSuper","_cache","Wrapper","runtime","regeneratorRuntime","accidentalStrictMode","globalThis","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__"],"sourceRoot":""}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { IPlainObject, TAction, TAnyFunction } from "./type";
|
|
2
|
+
declare const GlobalModal: {
|
|
3
|
+
__MId: number;
|
|
4
|
+
State: {
|
|
5
|
+
[key: string]: IPlainObject;
|
|
6
|
+
};
|
|
7
|
+
Actions: {
|
|
8
|
+
[key: string]: {
|
|
9
|
+
[key: string]: TAction;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
Subscribes: {
|
|
13
|
+
[key: string]: TAnyFunction[];
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
declare const getCtx: (modelName: string) => {
|
|
17
|
+
state: IPlainObject;
|
|
18
|
+
actions: {
|
|
19
|
+
[key: string]: TAction;
|
|
20
|
+
};
|
|
21
|
+
subscribes: TAnyFunction[];
|
|
22
|
+
};
|
|
23
|
+
declare const getState: (modelName: any) => IPlainObject;
|
|
24
|
+
export { GlobalModal, getCtx, getState };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { IMiddleCtx } from "../type";
|
|
2
|
+
/**
|
|
3
|
+
* 打印log
|
|
4
|
+
* @param ctx
|
|
5
|
+
* @returns
|
|
6
|
+
*/
|
|
7
|
+
declare const logger: (ctx: IMiddleCtx) => (next: any) => (params: any) => any;
|
|
8
|
+
/**
|
|
9
|
+
* 打印log
|
|
10
|
+
* @param ctx
|
|
11
|
+
* @returns
|
|
12
|
+
*/
|
|
13
|
+
declare const asyncLogger: (ctx: IMiddleCtx) => (next: any) => (params: any) => Promise<any>;
|
|
14
|
+
/**
|
|
15
|
+
* 执行action
|
|
16
|
+
* @param ctx
|
|
17
|
+
* @returns
|
|
18
|
+
*/
|
|
19
|
+
declare const runAction: (ctx: IMiddleCtx) => (next: any) => (params: any) => any;
|
|
20
|
+
/**
|
|
21
|
+
* 异步执行action
|
|
22
|
+
* @param ctx
|
|
23
|
+
* @returns
|
|
24
|
+
*/
|
|
25
|
+
declare const asyncRunAction: (ctx: IMiddleCtx) => (next: any) => (params: any) => Promise<any>;
|
|
26
|
+
/**
|
|
27
|
+
* 更新器
|
|
28
|
+
* @param ctx
|
|
29
|
+
* @returns
|
|
30
|
+
*/
|
|
31
|
+
declare const setterFun: (ctx: IMiddleCtx) => (next: any) => (params: any) => any;
|
|
32
|
+
/**
|
|
33
|
+
* 更新函数
|
|
34
|
+
* @param ctx
|
|
35
|
+
* @returns
|
|
36
|
+
*/
|
|
37
|
+
declare const updateState: (ctx: IMiddleCtx) => (next: any) => (params: any) => any;
|
|
38
|
+
/**
|
|
39
|
+
* 发布函数
|
|
40
|
+
* @param ctx
|
|
41
|
+
* @returns
|
|
42
|
+
*/
|
|
43
|
+
declare const publish: (ctx: IMiddleCtx) => (next: any) => (params: any) => any;
|
|
44
|
+
/**
|
|
45
|
+
* action返回
|
|
46
|
+
* @param ctx
|
|
47
|
+
* @returns
|
|
48
|
+
*/
|
|
49
|
+
declare const returnState: (ctx: IMiddleCtx) => (_next: any) => (_params: any) => import("../type").IPlainObject;
|
|
50
|
+
export declare const presetMiddleware: ((ctx: IMiddleCtx) => (next: any) => (params: any) => any)[];
|
|
51
|
+
export { logger, asyncLogger, runAction, asyncRunAction, setterFun, updateState, publish, returnState, };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IModels, TAnyFunction } from "./type";
|
|
2
|
+
export default class Model {
|
|
3
|
+
constructor(models: {
|
|
4
|
+
[key: string]: IModels;
|
|
5
|
+
});
|
|
6
|
+
getState(modelName: string): import("./type").IPlainObject;
|
|
7
|
+
getAction(modelName: string): {
|
|
8
|
+
[key: string]: import("./type").TAction;
|
|
9
|
+
};
|
|
10
|
+
getModel(): void;
|
|
11
|
+
subscribe(modelName: string, callback: TAnyFunction): void;
|
|
12
|
+
unsubscribe(modelName: string, callback: TAnyFunction): void;
|
|
13
|
+
applyMiddleware(): void;
|
|
14
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export type TMiddleware = (ctx: any) => (next: any) => (params: any) => any;
|
|
2
|
+
export interface IPlainObject {
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
}
|
|
5
|
+
export type TAction = (params?: IPlainObject) => IPlainObject;
|
|
6
|
+
export type TAnyFunction = (...params: Array<any>) => unknown;
|
|
7
|
+
export interface IMiddleCtx {
|
|
8
|
+
payload: any;
|
|
9
|
+
state: IPlainObject;
|
|
10
|
+
actions: {
|
|
11
|
+
[key: string]: TAction;
|
|
12
|
+
};
|
|
13
|
+
action: any;
|
|
14
|
+
subscribes: TAnyFunction[];
|
|
15
|
+
modelName: any;
|
|
16
|
+
newState: any;
|
|
17
|
+
setterFun?: (state: any) => void;
|
|
18
|
+
}
|
|
19
|
+
export interface IModels {
|
|
20
|
+
state: IPlainObject;
|
|
21
|
+
actions?: {
|
|
22
|
+
[key: string]: TAction;
|
|
23
|
+
};
|
|
24
|
+
asyncActions?: {
|
|
25
|
+
[key: string]: TAction;
|
|
26
|
+
};
|
|
27
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@cclr/model",
|
|
3
|
+
"version": "1.0.9",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "./lib/index.js",
|
|
6
|
+
"typings": "lib/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"lib/",
|
|
9
|
+
"index.js",
|
|
10
|
+
"README.md",
|
|
11
|
+
"package.json"
|
|
12
|
+
],
|
|
13
|
+
"scripts": {
|
|
14
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
15
|
+
},
|
|
16
|
+
"author": "congcongluren",
|
|
17
|
+
"publishConfig": {
|
|
18
|
+
"access": "public"
|
|
19
|
+
},
|
|
20
|
+
"license": "ISC",
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"immer": "^10.0.2"
|
|
23
|
+
},
|
|
24
|
+
"gitHead": "2263fa58bdd5e63a0d35eeba7d71ced4fa808b47"
|
|
25
|
+
}
|