mobx
Version:
Simple, scalable state management.
3 lines (2 loc) • 47.8 kB
JavaScript
var t,n;t=this,n=function(t){function n(t,...n){throw new Error(`[MobX] minified error nr: ${t}${n.length?" "+n.map(String).join(","):""}. See mobx.js.org/errors`)}function e(t){let n=!1;return function(){if(!n)return n=!0,t.apply(this,arguments)}}function i(t){return"function"==typeof t}function r(t){switch(typeof t){case"string":case"symbol":case"number":return!0}return!1}function s(t){return null!==t&&"object"==typeof t}function o(t){if(!s(t))return!1;const n=Object.getPrototypeOf(t);if(null==n||n===yn)return!0;const e=d(n,"constructor")&&n.constructor;return"function"==typeof e&&e.toString()===wn}function u(t){const n=null==t?void 0:t.constructor;return!!n&&("GeneratorFunction"===n.name||"GeneratorFunction"===n.displayName)}function c(t,n,e){bn(t,n,{enumerable:!1,writable:!0,configurable:!0,value:e})}function h(t,n){const e="isMobX"+t;return n.prototype[e]=!0,function(t){return s(t)&&!0===t[e]}}function l(t){return null!=t&&"[object Map]"===Object.prototype.toString.call(t)}function a(t){return null!=t&&"[object Set]"===Object.prototype.toString.call(t)}function f(t){return null===t?null:"object"==typeof t?""+t:t}function d(t,n){return yn.hasOwnProperty.call(t,n)}function v(t,n){return!!(t&n)}function b(t,n,e){return e?t|=n:t&=~n,t}function y(t){return t.private?Symbol(String(t.name)):t.name}function p(t,n=gn,e=gn){const i=new Sn(t);return n!==gn&&(i.onBOL=new Set([n])),e!==gn&&(i.onBUOL=new Set([e])),i}function m(t,n){return cn(t,n)}function w(t,n,e){return null===t||"object"!=typeof t&&"function"!=typeof t||Mt(t)?t:Array.isArray(t)?$n.array(t,{name:e}):o(t)?$n.object(t,void 0,{name:e}):l(t)?$n.map(t,{name:e}):a(t)?$n.set(t,{name:e}):"function"!=typeof t||wt(t)||xt(t)?t:u(t)?xe(t):we(e,t)}function g(t){return t}function j(t,n){return{t:t,i:n,o:O,u:_}}function O(t,n,e,i){var r;if(null!=(r=this.i)&&r.bound)return null===this.u(t,n,e,!1)?0:1;if(i===t.h)return null===this.u(t,n,e,!1)?0:2;if(wt(e.value))return 1;const s=A(t,this,n,e,!1);return bn(i,n,s),2}function _(t,n,e,i){const r=A(t,this,n,e);return t.l(n,r,i)}function S(t,e,i){const{kind:r,name:s,addInitializer:o}=i,u=t,c=t=>{var n,e,i,r;return H(null!=(n=null==(e=u.i)?void 0:e.name)?n:s.toString(),t,null!=(i=null==(r=u.i)?void 0:r.autoAction)&&i)};return"field"==r?function(t){var n;let e=t;return wt(e)||(e=c(e)),null!=(n=u.i)&&n.bound&&(e=e.bind(this),e.isMobxAction=!0),e}:"method"==r?(wt(e)||(e=c(e)),null!=(h=u.i)&&h.bound&&o(function(){const t=this,n=t[s].bind(t);n.isMobxAction=!0,t[s]=n}),e):void n(43,u.t,String(s),r);var h}function A(t,n,e,i,r=ue.safeDescriptors){var s,o,u,c,h,l,a;let{value:f}=i;var d;return null!=(s=n.i)&&s.bound&&(f=f.bind(null!=(d=t.v)?d:t.h)),{value:H(null!=(o=null==(u=n.i)?void 0:u.name)?o:e.toString(),f,null!=(c=null==(h=n.i)?void 0:h.autoAction)&&c,null!=(l=n.i)&&l.bound?null!=(a=t.v)?a:t.h:void 0),configurable:!r||t.p,enumerable:!1,writable:!r}}function V(t,n){return{t:t,i:n,o:x,u:N}}function x(t,n,e,i){var r;if(i===t.h)return null===this.u(t,n,e,!1)?0:2;if(null!=(r=this.i)&&r.bound&&(!d(t.h,n)||!xt(t.h[n]))&&null===this.u(t,n,e,!1))return 0;if(xt(e.value))return 1;const s=M(t,0,0,e,!1,!1);return bn(i,n,s),2}function N(t,n,e,i){var r;const s=M(t,0,0,e,null==(r=this.i)?void 0:r.bound);return t.l(n,s,i)}function R(t,n,e){var i;const{name:r,addInitializer:s}=e;return xt(n)||(n=xe(n)),null!=(i=t.i)&&i.bound&&s(function(){const t=this,n=t[r].bind(t);n.isMobXFlow=!0,t[r]=n}),n}function M(t,n,e,i,r,s=ue.safeDescriptors){let{value:o}=i;var u;return xt(o)||(o=xe(o)),r&&(o=o.bind(null!=(u=t.v)?u:t.h),o.isMobXFlow=!0),{value:o,configurable:!s||t.p,enumerable:!1,writable:!s}}function E(t,n){return{t:t,i:n,o:k,u:C}}function k(t,n,e){return null===this.u(t,n,e,!1)?0:1}function C(t,n,e,i){return t.m(n,dn({},this.i,{get:e.get,set:e.set}),i)}function I(t,n,e){function i(t){const i=dn({},r.i,{get:n,context:t});return i.name||(i.name=`ObservableObject.${e.name.toString()}`),new te(i)}const r=t,{addInitializer:s}=e,o=y(e);let u;return s(function(){var t;const n=tn(this)[_n],e=this;var r;n.j.has(o)||null!=(t=n.O)&&t.delete(o)?n.j.set(o,i(e)):(null!=(r=n.O)?r:n.O=new Map).set(o,()=>i(e))}),function(){const t=this[_n],e=t.j.get(o);if(e instanceof te&&e.derivation!==n){var r;let t=null==(r=u)?void 0:r.get(this);var s;return t||(t=i(this),(null!=(s=u)?s:u=new WeakMap).set(this,t)),t.get()}return t._(o)}}function T(t,n){return{t:t,i:n,o:B,u:P}}function B(t,n,e){return null===this.u(t,n,e,!1)?0:1}function P(t,n,e,i){var r,s;return t.S(n,e.value,null!=(r=null==(s=this.i)?void 0:s.A)?r:w,i)}function D(t,n,e){function i(t,n){var i;const s=tn(t)[_n];return(null!=(i=s.V)?i:s.V=new Map).set(o,()=>{var t,i;return new Yn(n,null!=(t=null==(i=r.i)?void 0:i.A)?t:w,`ObservableObject.${e.name.toString()}`,!1)}),s}const r=t,{kind:s}=e;if("accessor"!==s)return;const o=y(e);return{get(){var t;return(null!=(t=this[_n])?t:i(this,n.get.call(this)))._(o)},set(t){var n;return(null!=(n=this[_n])?n:i(this,t)).N(o,t)},init(t){return i(this,t),t}}}function K(t){return{t:Nn,i:t,o:L,u:$}}function L(t,n,e,i){var r,s,o,c;if(e.get)return qn.o(t,n,e,i);if(e.set){const r=wt(e.set)?e.set:H(n.toString(),e.set);return i===t.h?null===t.l(n,{configurable:!ue.safeDescriptors||t.p,set:r})?0:2:(bn(i,n,{configurable:!0,set:r}),2)}if(i!==t.h&&"function"==typeof e.value)return u(e.value)?(null!=(c=this.i)&&c.autoBind?Ne:xe).o(t,n,e,i):(null!=(o=this.i)&&o.autoBind?je:we).o(t,n,e,i);let h=!1===(null==(r=this.i)?void 0:r.deep)?Pn:$n;var l;return"function"==typeof e.value&&null!=(s=this.i)&&s.autoBind&&(e.value=e.value.bind(null!=(l=t.v)?l:t.h)),h.o(t,n,e,i)}function $(t,n,e,i){var r,s,o;return e.get?qn.u(t,n,e,i):e.set?t.l(n,{configurable:!ue.safeDescriptors||t.p,set:H(n.toString(),e.set)},i):("function"==typeof e.value&&null!=(r=this.i)&&r.autoBind&&(e.value=e.value.bind(null!=(o=t.v)?o:t.h)),(!1===(null==(s=this.i)?void 0:s.deep)?Pn:$n).u(t,n,e,i))}function U(t,n){return dn(function(e,i){if(i&&"string"==typeof i.kind)return n(t,e,i)},t)}function W(t){return t||En}function z(t){return U(t,D)}function q(t){return!0===t.deep?w:!1===t.deep?g:(n=t.defaultDecorator)&&null!=(e=null==(i=n.i)?void 0:i.A)?e:w;var n,e,i}function F(t){return U(t,I)}function H(t,n,e=!1,i){function r(){return G(0,e,n,i||this,arguments)}return r.isMobxAction=!0,r.toString=()=>n.toString(),Xn&&(Qn.value=t,bn(r,"name",Qn)),r}function G(t,n,e,i,r){const s=J(0,n);try{return e.apply(i,r)}catch(t){throw s.R=t,t}finally{X(s)}}function J(t,n){const e=ue.trackingDerivation,i=!n||!e;ht();let r=ue.allowStateChanges;i&&it();const s={M:i,k:e,C:r,I:ue.allowStateReads,T:!1,B:0,P:Jn++,D:Gn};return Gn=s.P,s}function X(t){Gn!==t.P&&n(30),Gn=t.D,void 0!==t.R&&(ue.suppressReactionErrors=!0),lt(),t.M&&rt(t.k),ue.suppressReactionErrors=!1}function Q(t,n){const e=function(t){const n=ue.allowStateChanges;return ue.allowStateChanges=t,n}(t);try{return n()}finally{!function(t){ue.allowStateChanges=t}(e)}}function Y(t){return t instanceof ee}function Z(t){switch(t.K){case 0:return!1;case-1:case 2:return!0;case 1:{const n=it(),e=t.L,i=e.length;for(let r=0;r<i;r++){const i=e[r];if(ne(i)){if(ue.disableErrorBoundaries)i.get();else try{i.get()}catch(t){return rt(n),!0}if(2===t.K)return rt(n),!0}}return st(t),rt(n),!1}}}function tt(t,n,e){st(t),t.$=new Array(0===t.U?100:t.L.length),t.W=0,t.U=++ue.runId;const i=ue.trackingDerivation;let r;if(ue.trackingDerivation=t,ue.inBatch++,!0===ue.disableErrorBoundaries)r=n.call(e);else try{r=n.call(e)}catch(t){r=new ee(t)}return ue.inBatch--,ue.trackingDerivation=i,function(t){const n=t.L,e=t.L=t.$;let i=0,r=0,s=t.W;for(let t=0;t<s;t++){const n=e[t];0===n.diffValue&&(n.diffValue=1,r!==t&&(e[r]=n),r++),n.K>i&&(i=n.K)}for(e.length=r,t.$=null,s=n.length;s--;){const e=n[s];0===e.diffValue&&ut(e,t),e.diffValue=0}for(;r--;){const n=e[r];1===n.diffValue&&(n.diffValue=0,ot(n,t))}0!==i&&(t.K=i,t.q())}(t),r}function nt(t){const n=t.L;t.L=[];let e=n.length;for(;e--;)ut(n[e],t);t.K=-1}function et(t){const n=it();try{return t()}finally{rt(n)}}function it(){const t=ue.trackingDerivation;return ue.trackingDerivation=null,t}function rt(t){ue.trackingDerivation=t}function st(t){if(0===t.K)return;t.K=0;const n=t.L;let e=n.length;for(;e--;)n[e].F=0}function ot(t,n){var e;(null!=(e=t.H)?e:t.H=new Set).add(n),t.F>n.K&&(t.F=n.K)}function ut(t,n){const e=t.H;e&&(e.delete(n),0===e.size&&ct(t))}function ct(t){!1===t.isPendingUnobservation&&(t.isPendingUnobservation=!0,ue.pendingUnobservations.push(t))}function ht(){ue.inBatch++}function lt(){0===--ue.inBatch&&(vt(),!ue.isRunningUnobservations&&ue.pendingUnobservations.length>0&&function(){ue.isRunningUnobservations=!0;try{const t=ue.pendingUnobservations;for(let n=0;n<t.length;n++){const e=t[n];e.isPendingUnobservation=!1,e.H&&0!==e.H.size||(e.H=null,e.isBeingObserved&&(e.isBeingObserved=!1,e.onBUO()),e instanceof te&&e.G())}ue.pendingUnobservations=[]}finally{ue.isRunningUnobservations=!1}}())}function at(t){var n;t.isBeingObserved||(t.isBeingObserved=!0,t.onBO(),null==(n=t.L)||n.forEach(at))}function ft(t){const n=ue.trackingDerivation;return null!==n?(n.U!==t.J&&(t.J=n.U,n.$[n.W++]=t,!t.isBeingObserved&&ue.trackingContext&&(t.isBeingObserved=!0,t.onBO())),t.isBeingObserved):((!t.H||0===t.H.size)&&ue.inBatch>0&&ct(t),!1)}function dt(t){var n;2!==t.F&&(t.F=2,null==(n=t.H)||n.forEach(t=>{0===t.K&&t.q(),t.K=2}))}function vt(){ue.inBatch>0||ue.isRunningReactions||le(bt)}function bt(){ue.isRunningReactions=!0;const t=ue.pendingReactions;let n=0;for(;t.length>0;){++n===he&&(console.error(`[mobx] cycle in reaction: ${t[0]}`),t.splice(0));let e=t.splice(0);for(let t=0,n=e.length;t<n;t++)e[t].X()}ue.isRunningReactions=!1}function yt(t){return U(t,S)}function pt(t){return function(n,e){return e&&"string"==typeof e.kind?S(t?ye:ve,n,e):i(n)?H(n.name||"<unnamed action>",n,t):i(e)?H(n,e,t):r(n)?yt(j(t?de:fe,{name:n,autoAction:t})):void 0}}function mt(t){return G(0,!1,t,this,void 0)}function wt(t){return i(t)&&!0===t.isMobxAction}function gt(t,n=mn){function e(){t(o)}var i,r;const s=null!=(i=null==n?void 0:n.name)?i:"Autorun";let o;if(n.scheduler||n.delay){const t=jt(n);let i=!1;o=new ce(s,()=>{i||(i=!0,t(()=>{i=!1,o.isDisposed||o.track(e)}))},n.onError,n.requiresObservable)}else o=new ce(s,function(){this.track(e)},n.onError,n.requiresObservable);return null!=n&&null!=(r=n.signal)&&r.aborted||o.Y(),o.Z(null==n?void 0:n.signal)}function jt(t){return t.scheduler?t.scheduler:t.delay?n=>setTimeout(n,t.delay):Oe}function Ot(t,n,e,r){const s="function"==typeof r?rn(n,e):rn(n),o=i(r)?r:e,u=`${t}L`;return s[u]?s[u].add(o):s[u]=new Set([o]),function(){const t=s[u];t&&(t.delete(o),0===t.size&&delete s[u])}}function _t(t,n,e,i){const r=On(n);return un(()=>{const n=tn(t,i)[_n];jn(r).forEach(t=>{n.u(t,r[t],!e||!d(e,t)||e[t])})}),t}function St(t){const n={name:t.tt};var e;return t.L&&t.L.length>0&&(n.dependencies=(e=t.L,Array.from(new Set(e))).map(St)),n}function At(t){const n={name:t.tt};return function(t){return!!t.H&&t.H.size>0}(t)&&(n.observers=Array.from(function(t){var n;return null!=(n=t.H)?n:new Set}(t),At)),n}function Vt(t){i(t.cancel)&&t.cancel()}function xt(t){return!0===(null==t?void 0:t.isMobXFlow)}function Nt(t,n){var e;if(void 0===n)return ne(t);if(!1===en(t))return!1;const i=t[_n];if(null!=(e=i.O)&&e.has(n))return!0;if(!i.j.has(n))return!1;const r=rn(t,n);return ne(r)}function Rt(t,n){if(!t)return!1;if(void 0!==n){if(en(t)){var e,i;const r=t[_n];return r.j.has(n)||!(null==(e=r.O)||!e.has(n))||!(null==(i=r.V)||!i.has(n))}return!1}return en(t)||!!t[_n]||An(t)||ae(t)||ne(t)}function Mt(t){return Rt(t)}function Et(t){return en(t)?t[_n].nt():$e(t)||ze(t)?Array.from(t.keys()):Qt(t)?t.map((t,n)=>n):void n(5)}function kt(t,e){return en(t)?t[_n].et(e):$e(t)||ze(t)?t.has(e):Qt(t)?e>=0&&e<t.length:void n(10)}function Ct(t){if(en(t))return t[_n].it();n(38)}function It(t,n,e){if(ne(t)){let i,r=!0;return gt(()=>{const s=t.get();if(!r||e){const e=it();n({observableKind:"computed",debugObjectName:t.tt,type:ke,object:t,newValue:s,oldValue:i}),rt(e)}r=!1,i=s})}return e&&n({observableKind:"value",debugObjectName:t.tt,object:t,type:ke,newValue:t.rt,oldValue:void 0}),zt(t,n)}function Tt(t,n,e){return t.set(n,e),e}function Bt(t,n){if(null==t||"object"!=typeof t||t instanceof Date||!Mt(t))return t;if(Zn(t)||ne(t))return Bt(t.get(),n);if(n.has(t))return n.get(t);if(Qt(t)){const e=Tt(n,t,new Array(t.length));return t.forEach((t,i)=>{e[i]=Bt(t,n)}),e}if(ze(t)){const e=Tt(n,t,new Set);return t.forEach(t=>{e.add(Bt(t,n))}),e}if($e(t)){const e=Tt(n,t,new Map);return t.forEach((t,i)=>{e.set(i,Bt(t,n))}),e}{const e=Tt(n,t,{});return Ct(t).forEach(i=>{yn.propertyIsEnumerable.call(t,i)&&(e[i]=Bt(t[i],n))}),function(t,n,e){const i=t[_n];if(void 0===i.V)return;const r=i.h;for(const[s,o]of i.j)d(r,s)||o instanceof te||!(s in r)||(n[s]=Bt(t[s],e));if(i.V)for(const s of i.V.keys())i.j.has(s)||d(r,s)||!(s in r)||(n[s]=Bt(t[s],e))}(t,e,n),e}}function Pt(t,n){ht();try{return t.apply(n)}finally{lt()}}function Dt(t,n,e){let i;if("number"==typeof e.timeout){const t=new Error("WHEN_TIMEOUT");i=setTimeout(()=>{if(!s[_n].isDisposed){if(s(),!e.onError)throw t;e.onError(t)}},e.timeout)}e.name="When";const r=H("When-effect",n);var s=gt(n=>{Q(!1,t)&&(n.dispose(),i&&clearTimeout(i),r())},e);return s}function Kt(t){return t[_n]}function Lt(t){return void 0!==t.st&&t.st.length>0}function $t(t,n){let i=t.st;return i?i.push(n):i=t.st=[n],e(()=>{const t=i.indexOf(n);-1!==t&&i.splice(t,1)})}function Ut(t,e){const i=it();try{const i=[...t.st||[]];for(let t=0,r=i.length;t<r&&((e=i[t](e))&&!e.type&&n(14),e);t++);return e}finally{rt(i)}}function Wt(t){return void 0!==t.ot&&t.ot.length>0}function zt(t,n){let i=t.ot;return i?i.push(n):i=t.ot=[n],e(()=>{const t=i.indexOf(n);-1!==t&&i.splice(t,1)})}function qt(t,n){const e=it();let i=t.ot;if(i){i=i.slice();for(let t=0,e=i.length;t<e;t++)i[t](n);rt(e)}}function Ft(t,e,i){if(!0===i&&(i=t.ut),!1===i)return;e in t.h||n(1,i.t,`${t.tt}.${e.toString()}`);let r=t.h;for(;r&&r!==yn;){const n=vn(r,e);if(n){const s=i.o(t,e,n,r);if(0===s)return;if(1===s)break}r=Object.getPrototypeOf(r)}}function Ht(t,n){"function"==typeof Array.prototype[t]&&(Te[t]=n(t))}function Gt(t){return function(){const n=this[_n];n.ct.reportObserved();const e=n.ht(n.j);return e[t].apply(e,arguments)}}function Jt(t){return function(n,e){const i=this[_n];return i.ct.reportObserved(),i.ht(i.j)[t]((t,i)=>n.call(e,t,i,this))}}function Xt(t){return function(){const n=this[_n];n.ct.reportObserved();const e=n.ht(n.j),i=arguments[0];return arguments[0]=(t,n,e)=>i(t,n,e,this),e[t].apply(e,arguments)}}function Qt(t){return s(t)&&Be(t[_n])}function Yt(t){return t[Symbol.toStringTag]="MapIterator",an(t)}function Zt(t){return t[Symbol.toStringTag]="SetIterator",an(t)}function tn(t,n){var e;if(d(t,_n))return t;const i=null!=(e=null==n?void 0:n.name)?e:"ObservableObject",r=new He(t,new Map,String(i),function(t){var n;return t?null!=(n=t.defaultDecorator)?n:function(t){var n;const e=!1!==t.deep,i=!!t.autoBind,r=(e?0:1)|(i?2:0);return null!=(n=Mn[r])?n:Mn[r]=K({deep:e,autoBind:i})}(t):void 0}(n));return c(t,_n,r),t}function nn(t){return qe[t]||(qe[t]={get(){return this[_n]._(t)},set(n){return this[_n].N(t,n)}})}function en(t){return!!s(t)&&Ge(t[_n])}function rn(t,e){if("object"==typeof t&&null!==t){const i=t[_n];if(Ge(i)){var r,s;if(!e)return n(26);const o=null!=(r=null!=(s=i.j.get(e))?s:i.lt(e))?r:i.ft(e);return o||n(27,e,on(t)),o}if(Be(i))return void 0!==e&&n(23),i.ct;if(ze(t))return t.ct;if($e(t)){if(void 0===e)return t.dt;const i=t.vt.get(e)||t.bt.get(e);return i||n(25,e,on(t)),i}if(en(t))return rn(t,e);if(An(t)||ne(t)||ae(t))return t}else if(i(t)&&ae(t[_n]))return t[_n];n(28)}function sn(t,e){return t||n(29),void 0!==e?sn(rn(t,e)):An(t)||ne(t)||ae(t)||$e(t)||ze(t)?t:t[_n]?t[_n]:void n(24,t)}function on(t,n){let e;if(void 0!==n)e=rn(t,n);else{if(wt(t))return t.name;e=en(t)||$e(t)||ze(t)?sn(t):rn(t)}return e.tt}function un(t){const n=it();ht();try{return t()}finally{lt(),rt(n)}}function cn(t,n,e=-1){return hn(t,n,e)}function hn(t,n,e,r,s){if(t===n)return 0!==t||1/t==1/n;if(null==t||null==n)return!1;if(t!=t)return n!=n;const o=typeof t;if("function"!==o&&"object"!==o&&"object"!=typeof n)return!1;const u=Je.call(t);if(u!==Je.call(n))return!1;switch(u){case"[object RegExp]":case"[object String]":return""+t==""+n;case"[object Number]":return+t!=+t?+n!=+n:0===+t?1/+t==1/n:+t===+n;case"[object Date]":case"[object Boolean]":return+t===+n;case"[object Symbol]":return"undefined"!=typeof Symbol&&Symbol.valueOf.call(t)===Symbol.valueOf.call(n);case"[object Map]":case"[object Set]":e>=0&&e++}t=ln(t),n=ln(n);const c="[object Array]"===u;if(!c){if("object"!=typeof t||"object"!=typeof n)return!1;const e=t.constructor,r=n.constructor;if(e!==r&&!(i(e)&&e instanceof e&&i(r)&&r instanceof r)&&"constructor"in t&&"constructor"in n)return!1}if(0===e)return!1;e<0&&(e=-1),s=s||[];let h=(r=r||[]).length;for(;h--;)if(r[h]===t)return s[h]===n;if(r.push(t),s.push(n),c){if(h=t.length,h!==n.length)return!1;for(;h--;)if(!hn(t[h],n[h],e-1,r,s))return!1}else{const i=Object.keys(t),o=i.length;if(Object.keys(n).length!==o)return!1;for(let u=0;u<o;u++){const o=i[u];if(!d(n,o)||!hn(t[o],n[o],e-1,r,s))return!1}}return r.pop(),s.pop(),!0}function ln(t){return Qt(t)?t.slice():l(t)||$e(t)||a(t)||ze(t)?Array.from(t.entries()):t}function an(t){return t[Symbol.iterator]=fn,dn(Object.create(Qe),t)}function fn(){return this}const dn=Object.assign,vn=Object.getOwnPropertyDescriptor,bn=Object.defineProperty,yn=Object.prototype,pn=[];Object.freeze(pn);const mn={};Object.freeze(mn);const wn=Object.toString(),gn=()=>{},jn=Reflect.ownKeys,On=Object.getOwnPropertyDescriptors,_n=Symbol("mobx administration");class Sn{constructor(t="Atom"){this.tt=void 0,this.yt=0,this.H=null,this.J=0,this.F=-1,this.onBOL=void 0,this.onBUOL=void 0,this.tt=t}get isBeingObserved(){return v(this.yt,1)}set isBeingObserved(t){this.yt=b(this.yt,1,t)}get isPendingUnobservation(){return v(this.yt,2)}set isPendingUnobservation(t){this.yt=b(this.yt,2,t)}get diffValue(){return v(this.yt,4)?1:0}set diffValue(t){this.yt=b(this.yt,4,1===t)}onBO(){this.onBOL&&this.onBOL.forEach(t=>t())}onBUO(){this.onBUOL&&this.onBUOL.forEach(t=>t())}reportObserved(){return ft(this)}reportChanged(){ht(),dt(this),lt()}toString(){return this.tt}}const An=h("Atom",Sn),Vn=Object.is,xn={t:"override",o:function(){return 0},u:function(){n(44,this.t)}},Nn="true",Rn=K(),Mn=[Rn],En={deep:!0,name:void 0,defaultDecorator:void 0};Object.freeze(En);const kn=T("observable"),Cn=T("observableRef",{A:g}),In=T("observableShallow",{A:function(t,n,e){return null==t||en(t)||Qt(t)||$e(t)||ze(t)?t:Array.isArray(t)?$n.array(t,{name:e,deep:!1}):o(t)?$n.object(t,void 0,{name:e,deep:!1}):l(t)?$n.map(t,{name:e,deep:!1}):a(t)?$n.set(t,{name:e,deep:!1}):void 0}}),Tn=T("observableStruct",{A:function(t,n){return cn(t,n)?n:t}}),Bn={box(t,n){const e=W(n);return new Yn(t,q(e),e.name,!0,e.equals)},array(t,n){const e=W(n);return function(t,n,e="ObservableArray",i=!1){return un(()=>{const r=new Ie(e,n,i);bn(r.j,_n,{enumerable:!1,writable:!1,configurable:!0,value:r});const s=new Proxy(r.j,Ce);return r.v=s,t&&t.length&&r.wt(0,0,t),s})}(t,q(e),e.name)},map(t,n){const e=W(n);return new Le(t,q(e),e.name)},set(t,n){const e=W(n);return new We(t,q(e),e.name)},object:(t,n,e)=>un(()=>_t(function(t,n){var e,i;return null!=(i=(e=(t=tn(t,n))[_n]).v)?i:e.v=new Proxy(t,Re)}({},e),t,n))},Pn=z(Cn),Dn=z(In),Kn=z(kn),Ln=z(Tn);var $n=dn(function(t,n,e){return n&&"string"==typeof n.kind?D(kn,t,n):Mt(t)?t:o(t)?$n.object(t,n,e):Array.isArray(t)?$n.array(t,n):l(t)?$n.map(t,n):a(t)?$n.set(t,n):"object"==typeof t&&null!==t?t:$n.box(t,n)},kn,Bn);const Un="computed",Wn=E(Un),zn=F(E("computedStruct",{equals:m})),qn=function(t,n){if(n&&"string"==typeof n.kind)return I(Wn,t,n);if(o(t))return F(E(Un,t));const e=o(n)?n:{};return e.get=t,e.name||(e.name=t.name||""),new te(e)};var Fn,Hn;dn(qn,Wn);let Gn=0,Jn=1;const Xn=null!=(Fn=null==(Hn=vn(()=>{},"name"))?void 0:Hn.configurable)&&Fn,Qn={value:"action",configurable:!0,writable:!1,enumerable:!1};class Yn extends Sn{constructor(t,n,e="ObservableValue",i=!0,r=Vn){super(e),this.A=void 0,this.tt=void 0,this.gt=void 0,this.st=void 0,this.ot=void 0,this.rt=void 0,this.dehancer=void 0,this.A=n,this.tt=e,this.gt=r,this.rt=n(t,void 0,e)}dehanceValue(t){return void 0!==this.dehancer?this.dehancer(t):t}set(t){(t=this.jt(t))!==ue.UNCHANGED&&this.Ot(t)}jt(t){if(Lt(this)){const n=Ut(this,{object:this,type:ke,newValue:t});if(!n)return ue.UNCHANGED;t=n.newValue}return t=this.A(t,this.rt,this.tt),this.gt(this.rt,t)?ue.UNCHANGED:t}Ot(t){const n=this.rt;this.rt=t,this.reportChanged(),Wt(this)&&qt(this,{observableKind:"value",debugObjectName:this.tt,type:ke,object:this,newValue:t,oldValue:n})}get(){return this.reportObserved(),this.dehanceValue(this.rt)}raw(){return this.rt}toJSON(){return this.get()}toString(){return`${this.tt}[${this.rt}]`}valueOf(){return f(this.get())}[Symbol.toPrimitive](){return this.valueOf()}}const Zn=h("ObservableValue",Yn);class te{constructor(t){this.K=-1,this.L=[],this.$=null,this.H=null,this.U=0,this.J=0,this.F=0,this.W=0,this.rt=new ee(null),this.tt=void 0,this.yt=0,this.derivation=void 0,this._t=void 0,this.St=void 0,this.gt=void 0,this.At=void 0,this.Vt=void 0,this.onBOL=void 0,this.onBUOL=void 0,t.get||n(31),this.derivation=t.get,this.tt=t.name||"ComputedValue",t.set&&(this._t=H("ComputedValue-setter",t.set)),this.gt=t.equals||Vn,this.St=t.context,this.At=t.requiresReaction,this.Vt=!!t.keepAlive}q(){!function(t){var n;0===t.F&&(t.F=1,null==(n=t.H)||n.forEach(t=>{0===t.K&&(t.K=1,t.q())}))}(this)}onBO(){this.onBOL&&this.onBOL.forEach(t=>t())}onBUO(){this.onBUOL&&this.onBUOL.forEach(t=>t())}get isComputing(){return v(this.yt,1)}set isComputing(t){this.yt=b(this.yt,1,t)}get isRunningSetter(){return v(this.yt,2)}set isRunningSetter(t){this.yt=b(this.yt,2,t)}get isBeingObserved(){return v(this.yt,4)}set isBeingObserved(t){this.yt=b(this.yt,4,t)}get isPendingUnobservation(){return v(this.yt,8)}set isPendingUnobservation(t){this.yt=b(this.yt,8,t)}get diffValue(){return v(this.yt,16)?1:0}set diffValue(t){this.yt=b(this.yt,16,1===t)}get(){if(this.isComputing&&n(32,this.tt,this.derivation),0!==ue.inBatch||this.H&&0!==this.H.size||this.Vt){const t=this.isBeingObserved;if(ft(this),Z(this)){let t=ue.trackingContext;t||!this.Vt&&!this.isBeingObserved||(ue.trackingContext=this),this.trackAndCompute()&&function(t){var n;2!==t.F&&(t.F=2,null==(n=t.H)||n.forEach(n=>{1===n.K?n.K=2:0===n.K&&(t.F=0)}))}(this),ue.trackingContext=t}else!t&&this.isBeingObserved&&this.L.forEach(at)}else Z(this)&&(this.xt(),ht(),this.rt=this.Nt(!1),lt());const t=this.rt;if(Y(t))throw t.cause;return t}set(t){if(this._t){this.isRunningSetter&&n(33,this.tt),this.isRunningSetter=!0;try{this._t.call(this.St,t)}finally{this.isRunningSetter=!1}}else n(34,this.tt)}trackAndCompute(){const t=this.rt,n=-1===this.K,e=this.Nt(!0),i=n||Y(t)||Y(e)||!this.gt(t,e);return i&&(this.rt=e),i}Nt(t){let n;if(this.isComputing=!0,t)n=tt(this,this.derivation,this.St);else if(!0===ue.disableErrorBoundaries)n=this.derivation.call(this.St);else try{n=this.derivation.call(this.St)}catch(t){n=new ee(t)}return this.isComputing=!1,n}G(){this.Vt||(nt(this),this.rt=void 0)}xt(){}toString(){return`${this.tt}[${this.derivation.toString()}]`}valueOf(){return f(this.get())}[Symbol.toPrimitive](){return this.valueOf()}}const ne=h("ComputedValue",te);class ee{constructor(t){this.cause=void 0,this.cause=t}}const ie=["mobxGuid","spyListeners","enforceActions","computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","allowStateReads","disableErrorBoundaries","runId","UNCHANGED"];class re{constructor(){this.version=7,this.UNCHANGED={},this.trackingDerivation=null,this.trackingContext=null,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.isRunningUnobservations=!1,this.allowStateChanges=!1,this.allowStateReads=!0,this.enforceActions=!0,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1,this.safeDescriptors=!0}}let se=!0,oe=!1,ue=function(){let t=globalThis;return t.__mobxInstanceCount>0&&!t.__mobxGlobals&&(se=!1),t.__mobxGlobals&&7!==t.__mobxGlobals.version&&(se=!1),se?t.__mobxGlobals?(t.__mobxInstanceCount+=1,t.__mobxGlobals.UNCHANGED||(t.__mobxGlobals.UNCHANGED={}),t.__mobxGlobals):(t.__mobxInstanceCount=1,t.__mobxGlobals=new re):(setTimeout(()=>{oe||n(35)},1),new re)}();class ce{constructor(t="Reaction",n,e,i){this.tt=void 0,this.Rt=void 0,this.Mt=void 0,this.Et=void 0,this.L=[],this.$=[],this.K=-1,this.U=0,this.W=0,this.yt=0,this.kt=void 0,this.tt=t,this.Rt=n,this.Mt=e,this.Et=i}get isDisposed(){return v(this.yt,1)}set isDisposed(t){this.yt=b(this.yt,1,t)}get isScheduled(){return v(this.yt,2)}set isScheduled(t){this.yt=b(this.yt,2,t)}get isTrackPending(){return v(this.yt,4)}set isTrackPending(t){this.yt=b(this.yt,4,t)}get isRunning(){return v(this.yt,8)}set isRunning(t){this.yt=b(this.yt,8,t)}get diffValue(){return v(this.yt,16)?1:0}set diffValue(t){this.yt=b(this.yt,16,1===t)}q(){this.Y()}Y(){this.isScheduled||(this.isScheduled=!0,ue.pendingReactions.push(this),vt())}X(){if(!this.isDisposed){ht(),this.isScheduled=!1;const t=ue.trackingContext;if(ue.trackingContext=this,Z(this)){this.isTrackPending=!0;try{this.Rt()}catch(t){this.Ct(t)}}ue.trackingContext=t,lt()}}track(t){if(this.isDisposed)return;ht(),this.isRunning=!0;const n=ue.trackingContext;ue.trackingContext=this;const e=tt(this,t,void 0);ue.trackingContext=n,this.isRunning=!1,this.isTrackPending=!1,this.isDisposed&&nt(this),Y(e)&&this.Ct(e.cause),lt()}Ct(t){if(this.Mt)this.Mt(t,this);else{if(ue.disableErrorBoundaries)throw t;ue.suppressReactionErrors||console.error(`[mobx] uncaught error in '${this}'`,t),ue.globalReactionErrorHandlers.forEach(n=>n(t,this))}}dispose(){var t;this.isDisposed||(this.isDisposed=!0,null==(t=this.kt)||t.call(this),this.isRunning||(ht(),nt(this),lt()))}Z(t){const n=()=>this.dispose();return null!=t&&t.addEventListener&&!this.isDisposed&&(t.addEventListener("abort",n),this.kt=()=>null==t.removeEventListener?void 0:t.removeEventListener("abort",n)),n[_n]=this,"dispose"in Symbol&&"symbol"==typeof Symbol.dispose&&(n[Symbol.dispose]=n),n}toString(){return`Reaction[${this.tt}]`}}const he=100;let le=t=>t();const ae=h("Reaction",ce),fe="action",de="autoAction",ve=j(fe),be=j("actionBound",{bound:!0}),ye=j(de,{autoAction:!0}),pe=j("autoActionBound",{autoAction:!0,bound:!0}),me=pt(!1);dn(me,ve);const we=pt(!0);dn(we,ye);const ge=yt(be),je=yt(pe),Oe=t=>t(),_e="always";class Se extends Error{constructor(){super("FLOW_CANCELLED"),Object.setPrototypeOf(this,new.target.prototype),this.name="FlowCancellationError"}toString(){return`Error: ${this.message}`}}const Ae=V("flow"),Ve=V("flowBound",{bound:!0}),xe=dn(function(t,n){if(n&&"string"==typeof n.kind)return R(Ae,t,n);const e=t,r=e.name||"flow",s=function(){const t=arguments,n=me(r,e).apply(this,t);let s,o;const u=new Promise(function(t,e){function u(t){let i;o=void 0;try{i=me(r,n.next).call(n,t)}catch(t){return e(t)}h(i)}function c(t){let i;o=void 0;try{i=me(r,n.throw).call(n,t)}catch(t){return e(t)}h(i)}function h(n){if(!i(null==n?void 0:n.then))return n.done?t(n.value):(o=Promise.resolve(n.value),o.then(u,c));n.then(h,e)}s=e,u(void 0)});return u.cancel=me(r,function(){try{o&&Vt(o);const t=n.return(void 0),e=Promise.resolve(t.value);e.then(gn,gn),Vt(e),s(new Se)}catch(t){s(t)}}),u};return s.isMobXFlow=!0,s},Ae),Ne=function(t){return U(t,R)}(Ve),Re={has:(t,n)=>Kt(t).et(n),get:(t,n)=>Kt(t).It(n),set(t,n,e){var i;return!!r(n)&&(null==(i=Kt(t).Tt(n,e,!0))||i)},deleteProperty(t,n){var e;return!!r(n)&&(null==(e=Kt(t).Bt(n,!0))||e)},defineProperty(t,n,e){var i;return null==(i=Kt(t).l(n,e))||i},ownKeys:t=>Kt(t).it(),preventExtensions(t){n(13)}},Me=Symbol("mobx-keys"),Ee="splice",ke="update",Ce={get(t,n){const e=t[_n];return n===_n?e:"length"===n?e.Pt():"string"!=typeof n||isNaN(n)?d(Te,n)?Te[n]:t[n]:e.It(parseInt(n))},set(t,n,e){const i=t[_n];return"length"===n?i.Dt(e):"symbol"==typeof n||isNaN(n)?t[n]=e:i.Tt(parseInt(n),e),!0},preventExtensions(){n(15)}};class Ie{constructor(t="ObservableArray",n,e){this.Kt=void 0,this.ct=void 0,this.j=[],this.st=void 0,this.ot=void 0,this.A=void 0,this.dehancer=void 0,this.v=void 0,this.Lt=0,this.Kt=e,this.ct=new Sn(t),this.A=(t,e)=>n(t,e,"ObservableArray[..]")}$t(t){return void 0!==this.dehancer?this.dehancer(t):t}ht(t){return void 0!==this.dehancer&&t.length>0?t.map(this.dehancer):t}Pt(){return this.ct.reportObserved(),this.j.length}Dt(t){(!Number.isInteger(t)||t<0)&&n(40,t);let e=this.j.length;if(t!==e)if(t>e){const n=Array.from({length:t-e});this.wt(e,0,n)}else this.wt(t,e-t)}Ut(t,e){t!==this.Lt&&n(16),this.Lt+=e}wt(t,n,e){const i=this.j.length;if(void 0===t?t=0:t>i?t=i:t<0&&(t=Math.max(0,i+t)),n=1===arguments.length?i-t:null==n?0:Math.max(0,Math.min(n,i-t)),void 0===e&&(e=pn),Lt(this)){const i=Ut(this,{object:this.v,type:Ee,index:t,removedCount:n,added:e});if(!i)return pn;n=i.removedCount,e=i.added}e=0===e.length?e:e.map(t=>this.A(t,void 0));const r=this.Wt(t,n,e);return 0===n&&0===e.length||this.zt(t,e,r),this.ht(r)}Wt(t,n,e){if(e.length<1e4)return this.j.splice(t,n,...e);{const i=this.j.slice(t,t+n);let r=this.j.slice(t+n);this.j.length+=e.length-n;for(let n=0;n<e.length;n++)this.j[t+n]=e[n];for(let n=0;n<r.length;n++)this.j[t+e.length+n]=r[n];return i}}qt(t,n,e){const i=Wt(this),r=i?{observableKind:"array",object:this.v,type:ke,debugObjectName:this.ct.tt,index:t,newValue:n,oldValue:e}:null;this.ct.reportChanged(),i&&qt(this,r)}zt(t,n,e){const i=Wt(this),r=i?{observableKind:"array",object:this.v,debugObjectName:this.ct.tt,type:Ee,index:t,removed:e,added:n,removedCount:e.length,addedCount:n.length}:null;this.ct.reportChanged(),i&&qt(this,r)}It(t){return this.ct.reportObserved(),this.$t(this.j[t])}Tt(t,n){const e=this.j;if(t<e.length){const i=e[t];if(Lt(this)){const e=Ut(this,{type:ke,object:this.v,index:t,newValue:n});if(!e)return;n=e.newValue}(n=this.A(n,i))!==i&&(e[t]=n,this.qt(t,n,i))}else{const i=Array.from({length:t+1-e.length});i[i.length-1]=n,this.wt(e.length,0,i)}}}var Te={clear(){return this.splice(0)},replace(t){const n=this[_n];return n.wt(0,n.j.length,t)},toJSON(){return this.slice()},splice(t,n,...e){const i=this[_n];switch(arguments.length){case 0:return[];case 1:return i.wt(t);case 2:return i.wt(t,n)}return i.wt(t,n,e)},spliceWithArray(t,n,e){return this[_n].wt(t,n,e)},push(...t){const n=this[_n];return n.wt(n.j.length,0,t),n.j.length},pop(){return this.splice(Math.max(this[_n].j.length-1,0),1)[0]},shift(){return this.splice(0,1)[0]},unshift(...t){const n=this[_n];return n.wt(0,0,t),n.j.length},reverse(){return ue.trackingDerivation&&n(37,"reverse"),this.replace(this.slice().reverse()),this},sort(){ue.trackingDerivation&&n(37,"sort");const t=this.slice();return t.sort.apply(t,arguments),this.replace(t),this},remove(t){const n=this[_n],e=n.ht(n.j).indexOf(t);return e>-1&&(this.splice(e,1),!0)}};Ht("at",Gt),Ht("concat",Gt),Ht("flat",Gt),Ht("includes",Gt),Ht("indexOf",Gt),Ht("join",Gt),Ht("lastIndexOf",Gt),Ht("slice",Gt),Ht("toString",Gt),Ht("toLocaleString",Gt),Ht("toSorted",Gt),Ht("toSpliced",Gt),Ht("with",Gt),Ht("every",Jt),Ht("filter",Jt),Ht("find",Jt),Ht("findIndex",Jt),Ht("findLast",Jt),Ht("findLastIndex",Jt),Ht("flatMap",Jt),Ht("forEach",Jt),Ht("map",Jt),Ht("some",Jt),Ht("toReversed",Jt),Ht("reduce",Xt),Ht("reduceRight",Xt);const Be=h("ObservableArrayAdministration",Ie),Pe={},De="add",Ke="delete";class Le{constructor(t,n=w,e="ObservableMap"){this.A=void 0,this.tt=void 0,this[_n]=Pe,this.vt=void 0,this.bt=void 0,this.dt=void 0,this.st=void 0,this.ot=void 0,this.dehancer=void 0,this.A=n,this.tt=e,un(()=>{this.dt=p("ObservableMap.keys()"),this.vt=new Map,this.bt=new Map,t&&this.merge(t)})}et(t){return this.vt.has(t)}has(t){if(!ue.trackingDerivation)return this.et(t);let n=this.bt.get(t);if(!n){const e=n=new Yn(this.et(t),g,"ObservableMap.key?",!1);this.bt.set(t,e),e.onBUOL=new Set([()=>this.bt.delete(t)])}return n.get()}set(t,n){const e=this.et(t);if(Lt(this)){const i=Ut(this,{type:e?ke:De,object:this,newValue:n,name:t});if(!i)return this;n=i.newValue}return e?this.Ft(t,n):this.Ht(t,n),this}delete(t){if(Lt(this)&&!Ut(this,{type:Ke,object:this,name:t}))return!1;if(this.et(t)){const n=!1,e=Wt(this),i=e||n?{observableKind:"map",debugObjectName:this.tt,type:Ke,object:this,oldValue:this.vt.get(t).rt,name:t}:null;return Pt(()=>{var n;this.dt.reportChanged(),null==(n=this.bt.get(t))||n.set(!1),this.vt.get(t).Ot(void 0),this.vt.delete(t)}),e&&qt(this,i),!0}return!1}Ft(t,n){const e=this.vt.get(t);if((n=e.jt(n))!==ue.UNCHANGED){const i=!1,r=Wt(this),s=r||i?{observableKind:"map",debugObjectName:this.tt,type:ke,object:this,oldValue:e.rt,name:t,newValue:n}:null;e.Ot(n),r&&qt(this,s)}}Ht(t,n){Pt(()=>{var e;const i=new Yn(n,this.A,"ObservableMap.key",!1);this.vt.set(t,i),n=i.rt,null==(e=this.bt.get(t))||e.set(!0),this.dt.reportChanged()});const e=Wt(this);e&&qt(this,e?{observableKind:"map",debugObjectName:this.tt,type:De,object:this,name:t,newValue:n}:null)}get(t){return this.has(t)?this.$t(this.vt.get(t).get()):this.$t(void 0)}getOrInsert(t,n){return this.has(t)||this.set(t,n),this.get(t)}getOrInsertComputed(t,n){return this.has(t)||this.set(t,n(t)),this.get(t)}$t(t){return void 0!==this.dehancer?this.dehancer(t):t}keys(){return this.dt.reportObserved(),this.vt.keys()}values(){const t=this,n=this.keys();return Yt({next(){const{done:e,value:i}=n.next();return{done:e,value:e?void 0:t.get(i)}}})}entries(){const t=this,n=this.keys();return Yt({next(){const{done:e,value:i}=n.next();return{done:e,value:e?void 0:[i,t.get(i)]}}})}[Symbol.iterator](){return this.entries()}forEach(t,n){for(const[e,i]of this)t.call(n,i,e,this)}merge(t){return $e(t)&&(t=new Map(t)),Pt(()=>{o(t)?function(t){const n=Object.keys(t),e=Object.getOwnPropertySymbols(t);return e.length?[...n,...e.filter(n=>yn.propertyIsEnumerable.call(t,n))]:n}(t).forEach(n=>this.set(n,t[n])):Array.isArray(t)?t.forEach(([t,n])=>this.set(t,n)):l(t)?(function(t){const n=Object.getPrototypeOf(t),e=Object.getPrototypeOf(n);return null===Object.getPrototypeOf(e)}(t)||n(19,t),t.forEach((t,n)=>this.set(n,t))):null!=t&&n(20,t)}),this}clear(){Pt(()=>{et(()=>{for(const t of this.keys())this.delete(t)})})}replace(t){return Pt(()=>{const e=function(t){if(l(t)||$e(t))return t;if(Array.isArray(t))return new Map(t);if(o(t)){const n=new Map;for(const e in t)n.set(e,t[e]);return n}return n(21,t)}(t),i=new Map;let r=!1;for(const t of this.vt.keys())if(!e.has(t))if(this.delete(t))r=!0;else{const n=this.vt.get(t);i.set(t,n)}for(const[t,n]of e.entries()){const e=this.vt.has(t);if(this.set(t,n),this.vt.has(t)){const n=this.vt.get(t);i.set(t,n),e||(r=!0)}}if(!r)if(this.vt.size!==i.size)this.dt.reportChanged();else{const t=this.vt.keys(),n=i.keys();let e=t.next(),r=n.next();for(;!e.done;){if(e.value!==r.value){this.dt.reportChanged();break}e=t.next(),r=n.next()}}this.vt=i}),this}get size(){return this.dt.reportObserved(),this.vt.size}toString(){return"[object ObservableMap]"}toJSON(){return Array.from(this)}get[Symbol.toStringTag](){return"Map"}}var $e=h("ObservableMap",Le);const Ue={};class We{constructor(t,n=w,e="ObservableSet"){this.tt=void 0,this[_n]=Ue,this.vt=new Set,this.ct=void 0,this.ot=void 0,this.st=void 0,this.dehancer=void 0,this.A=void 0,this.tt=e,this.A=(t,i)=>n(t,i,e),un(()=>{this.ct=p(this.tt),t&&this.replace(t)})}$t(t){return void 0!==this.dehancer?this.dehancer(t):t}clear(){Pt(()=>{et(()=>{for(const t of this.vt.values())this.delete(t)})})}forEach(t,n){for(const e of this)t.call(n,e,e,this)}get size(){return this.ct.reportObserved(),this.vt.size}add(t){if(Lt(this)){const n=Ut(this,{type:De,object:this,newValue:t});if(!n)return this;t=n.newValue}if(!this.et(t)){Pt(()=>{t=this.A(t,void 0),this.vt.add(t),this.ct.reportChanged()});const n=!1,e=Wt(this);e&&qt(this,e||n?{observableKind:"set",debugObjectName:this.tt,type:De,object:this,newValue:t}:null)}return this}delete(t){if(Lt(this)&&!Ut(this,{type:Ke,object:this,oldValue:t}))return!1;if(this.et(t)){const n=!1,e=Wt(this),i=e||n?{observableKind:"set",debugObjectName:this.tt,type:Ke,object:this,oldValue:t}:null;return Pt(()=>{this.ct.reportChanged(),this.vt.delete(t)}),e&&qt(this,i),!0}return!1}et(t){return this.vt.has(this.$t(t))}has(t){return this.ct.reportObserved(),this.et(t)}entries(){const t=this.values();return Zt({next(){const{value:n,done:e}=t.next();return e?{value:void 0,done:e}:{value:[n,n],done:e}}})}keys(){return this.values()}values(){this.ct.reportObserved();const t=this,n=this.vt.values();return Zt({next(){const{value:e,done:i}=n.next();return i?{value:void 0,done:i}:{value:t.$t(e),done:i}}})}intersection(t){return new Set(this).intersection(t)}union(t){return new Set(this).union(t)}difference(t){return new Set(this).difference(t)}symmetricDifference(t){return new Set(this).symmetricDifference(t)}isSubsetOf(t){return new Set(this).isSubsetOf(t)}isSupersetOf(t){return new Set(this).isSupersetOf(t)}isDisjointFrom(t){return new Set(this).isDisjointFrom(t)}replace(t){return ze(t)&&(t=new Set(t)),Array.isArray(t)||a(t)?Pt(()=>{const n=a(t)?t:new Set(t);if(0!==n.size)if(0!==this.vt.size){for(const t of this.vt.values())n.has(this.$t(t))||this.delete(t);n.forEach(t=>this.add(t))}else n.forEach(t=>this.add(t));else this.clear()}):null!=t&&n(41,t),this}toJSON(){return Array.from(this)}toString(){return"[object ObservableSet]"}[Symbol.iterator](){return this.values()}get[Symbol.toStringTag](){return"Set"}}var ze=h("ObservableSet",We);const qe=Object.create(null),Fe="remove";class He{constructor(t,n=new Map,e,i=Rn){this.h=void 0,this.j=void 0,this.tt=void 0,this.ut=void 0,this.dt=void 0,this.ot=void 0,this.st=void 0,this.v=void 0,this.p=void 0,this.Gt=void 0,this.Jt=void 0,this.O=void 0,this.V=void 0,this.h=t,this.j=n,this.tt=e,this.ut=i,this.dt=new Sn("ObservableObject.keys"),this.p=o(this.h)}_(t){var n,e;return(null!=(n=null!=(e=this.j.get(t))?e:this.lt(t))?n:this.ft(t)).get()}lt(t){var n;const e=null==(n=this.O)?void 0:n.get(t);if(!e)return;this.O.delete(t),0===this.O.size&&(this.O=void 0);const i=e();return this.j.set(t,i),i}ft(t){var n;const e=null==(n=this.V)?void 0:n.get(t);if(!e)return;this.V.delete(t),0===this.V.size&&(this.V=null);const i=e();return this.j.set(t,i),i}N(t,n){var e,i;const r=null!=(e=null!=(i=this.j.get(t))?i:this.lt(t))?e:this.ft(t);if(r instanceof te)return r.set(n),!0;if(Lt(this)){const e=Ut(this,{type:ke,object:this.v||this.h,name:t,newValue:n});if(!e)return null;n=e.newValue}if((n=r.jt(n))!==ue.UNCHANGED){const e=Wt(this),i=e?{type:ke,observableKind:"object",debugObjectName:this.tt,object:this.v||this.h,oldValue:r.rt,name:t,newValue:n}:null;r.Ot(n),e&&qt(this,i)}return!0}It(t){return ue.trackingDerivation&&!d(this.h,t)&&this.et(t),this.h[t]}Tt(t,n,e=!1){return d(this.h,t)?this.j.has(t)?this.N(t,n):e?Reflect.set(this.h,t,n):(this.h[t]=n,!0):this.u(t,{value:n,enumerable:!0,writable:!0,configurable:!0},this.ut,e)}et(t){if(!ue.trackingDerivation)return t in this.h;this.Jt||(this.Jt=new Map);let n=this.Jt.get(t);return n||(n=new Yn(t in this.h,g,"ObservableObject.key?",!1),this.Jt.set(t,n),n.onBUOL=new Set([()=>{var n;return null==(n=this.Jt)?void 0:n.delete(t)}])),n.get()}u(t,n,e,i=!1){return!0===e&&(e=this.ut),!1===e?this.l(t,n,i):e.u(this,t,n,i)}l(t,n,e=!1){try{ht();const i=this.Bt(t);if(!i)return i;if(Lt(this)){const e=Ut(this,{object:this.v||this.h,name:t,type:De,newValue:n.value});if(!e)return null;const{newValue:i}=e;n.value!==i&&(n=dn({},n,{value:i}))}if(e){if(!Reflect.defineProperty(this.h,t,n))return!1}else bn(this.h,t,n);this.Xt(t,n.value)}finally{lt()}return!0}S(t,n,e,i=!1){try{ht();const r=this.Bt(t);if(!r)return r;if(Lt(this)){const e=Ut(this,{object:this.v||this.h,name:t,type:De,newValue:n});if(!e)return null;n=e.newValue}const s=nn(t),o={configurable:!ue.safeDescriptors||this.p,enumerable:!0,get:s.get,set:s.set};if(i){if(!Reflect.defineProperty(this.h,t,o))return!1}else bn(this.h,t,o);const u=new Yn(n,e,"ObservableObject.key",!1);this.j.set(t,u),this.Xt(t,u.rt)}finally{lt()}return!0}m(t,n,e=!1){try{ht();const i=this.Bt(t);if(!i)return i;if(Lt(this)&&!Ut(this,{object:this.v||this.h,name:t,type:De,newValue:void 0}))return null;n.name||(n.name="ObservableObject.key"),n.context=this.v||this.h;const r=nn(t),s={configurable:!ue.safeDescriptors||this.p,enumerable:!1,get:r.get,set:r.set};if(e){if(!Reflect.defineProperty(this.h,t,s))return!1}else bn(this.h,t,s);this.j.set(t,new te(n)),this.Xt(t,void 0)}finally{lt()}return!0}Bt(t,n=!1){if(!d(this.h,t))return!0;if(Lt(this)&&!Ut(this,{object:this.v||this.h,name:t,type:Fe}))return null;try{var e;ht();const r=Wt(this),s=!1,o=this.j.get(t);let u;var i;if(o||!r&&!s||(u=null==(i=vn(this.h,t))?void 0:i.value),n){if(!Reflect.deleteProperty(this.h,t))return!1}else delete this.h[t];o&&(this.j.delete(t),o instanceof Yn&&(u=o.rt),dt(o)),this.dt.reportChanged(),null==(e=this.Jt)||null==(e=e.get(t))||e.set(t in this.h),(r||s)&&r&&qt(this,{type:Fe,observableKind:"object",object:this.v||this.h,debugObjectName:this.tt,oldValue:u,name:t})}finally{lt()}return!0}Xt(t,n){var e;const i=Wt(this);i&&i&&qt(this,i?{type:De,observableKind:"object",debugObjectName:this.tt,object:this.v||this.h,name:t,newValue:n}:null),null==(e=this.Jt)||null==(e=e.get(t))||e.set(!0),this.dt.reportChanged()}it(){return this.dt.reportObserved(),jn(this.h)}nt(){return this.dt.reportObserved(),Object.keys(this.h)}}const Ge=h("ObservableObjectAdministration",He),Je=yn.toString;var Xe;const Qe=(null==(Xe=globalThis.Iterator)?void 0:Xe.prototype)||{};t.$mobx=_n,t.FlowCancellationError=Se,t.ObservableMap=Le,t.ObservableSet=We,t.Reaction=ce,t._allowStateChanges=Q,t._allowStateChangesInsideComputed=mt,t._allowStateReadsEnd=function(t){ue.allowStateReads=t},t._allowStateReadsStart=function(t){const n=ue.allowStateReads;return ue.allowStateReads=t,n},t._autoAction=we,t._autoActionBound=je,t._endAction=X,t._getAdministration=sn,t._getGlobalState=function(){return ue},t._interceptReads=function(t,n,e){let i;return $e(t)||Qt(t)||Zn(t)?i=sn(t):en(t)&&(i=sn(t,n)),i.dehancer="function"==typeof n?n:e,()=>{i.dehancer=void 0}},t._isComputingDerivation=function(){return null!==ue.trackingDerivation},t._resetGlobalState=function(){const t=new re;for(let n in t)-1===ie.indexOf(n)&&(ue[n]=t[n]);ue.allowStateChanges=!ue.enforceActions},t._startAction=J,t.action=me,t.actionBound=ge,t.autorun=gt,t.compareDefault=Vn,t.compareIdentity=function(t,n){return t===n},t.compareShallow=function(t,n){return cn(t,n,1)},t.compareStructural=m,t.computed=qn,t.computedStruct=zn,t.configure=function(t){!0===t.isolateGlobalState&&function(){if((ue.pendingReactions.length||ue.inBatch||ue.isRunningReactions)&&n(36),oe=!0,se){let t=globalThis;0===--t.__mobxInstanceCount&&(t.__mobxGlobals=void 0),ue=new re}}();const{enforceActions:e}=t;if(void 0!==e){const t=e===_e?_e:"observed"===e;ue.enforceActions=t,ue.allowStateChanges=!0!==t&&t!==_e}["computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","disableErrorBoundaries","safeDescriptors"].forEach(n=>{n in t&&(ue[n]=!!t[n])}),ue.allowStateReads=!ue.observableRequiresReaction,t.reactionScheduler&&function(t){const n=le;le=e=>t(()=>n(e))}(t.reactionScheduler)},t.createAtom=p,t.defineProperty=function(t,e,i){if(en(t))return t[_n].l(e,i);n(39)},t.entries=function(t){return en(t)?Et(t).map(n=>[n,t[n]]):$e(t)?Et(t).map(n=>[n,t.get(n)]):ze(t)?Array.from(t.entries()):Qt(t)?t.map((t,n)=>[n,t]):void n(7)},t.extendObservable=_t,t.flow=xe,t.flowBound=Ne,t.flowResult=function(t){return t},t.get=function(t,e){if(kt(t,e))return en(t)?t[_n].It(e):$e(t)?t.get(e):Qt(t)?t[e]:void n(11)},t.getAtom=rn,t.getDebugName=on,t.getDependencyTree=function(t,n){return St(rn(t,n))},t.getObserverTree=function(t,n){return At(rn(t,n))},t.has=kt,t.intercept=function(t,n,e){return i(e)?function(t,n,e){return $t(sn(t,n),e)}(t,n,e):function(t,n){return $t(sn(t),n)}(t,n)},t.isAction=wt,t.isBoxedObservable=Zn,t.isComputed=function(t){return Nt(t)},t.isComputedProp=function(t,n){return Nt(t,n)},t.isFlow=xt,t.isFlowCancellationError=function(t){return t instanceof Se},t.isObservable=Mt,t.isObservableArray=Qt,t.isObservableMap=$e,t.isObservableObject=en,t.isObservableProp=function(t,n){return Rt(t,n)},t.isObservableSet=ze,t.keys=Et,t.makeAutoObservable=function(t,n,e){return o(t)?_t(t,t,n,e):(un(()=>{const i=tn(t,e)[_n];if(!t[Me]){const n=Object.getPrototypeOf(t),e=new Set([...jn(t),...jn(n)]);e.delete("constructor"),e.delete(_n),c(n,Me,e)}t[Me].forEach(t=>Ft(i,t,!n||!d(n,t)||n[t]))}),t)},t.makeObservable=function(t,n,e){return un(()=>{const i=tn(t,e)[_n];jn(n).forEach(t=>Ft(i,t,n[t]))}),t},t.observable=$n,t.observableDeep=Kn,t.observableRef=Pn,t.observableShallow=Dn,t.observableStruct=Ln,t.observe=function(t,n,e,r){return i(e)?function(t,n,e,i){return It(sn(t,n),e,i)}(t,n,e,r):function(t,n,e){const i=sn(t);if(Qt(t))e&&n({observableKind:"array",object:i.v,debugObjectName:i.ct.tt,type:"splice",index:0,added:i.j.slice(),addedCount:i.j.length,removed:[],removedCount:0});else if($e(t));else if(ze(t));else if(!en(t))return It(i,n,e);return zt(i,n)}(t,n,e)},t.onBecomeObserved=function(t,n,e){return Ot("onBO",t,n,e)},t.onBecomeUnobserved=function(t,n,e){return Ot("onBUO",t,n,e)},t.onReactionError=function(t){return ue.globalReactionErrorHandlers.push(t),()=>{const n=ue.globalReactionErrorHandlers.indexOf(t);n>=0&&ue.globalReactionErrorHandlers.splice(n,1)}},t.override=xn,t.ownKeys=Ct,t.reaction=function(t,n,e=mn){function i(){if(v=!1,y.isDisposed)return;let n=!1;const i=f;y.track(()=>{const e=Q(!1,()=>t(y));n=d||!b(f,e),f=e}),(d&&e.fireImmediately||!d&&n)&&u(f,i,y),d=!1}var r,s;const o=null!=(r=e.name)?r:"Reaction",u=me(o,e.onError?(c=e.onError,h=n,function(){try{return h.apply(this,arguments)}catch(t){c.call(this,t)}}):n);var c,h;const l=!e.scheduler&&!e.delay,a=jt(e);let f,d=!0,v=!1;const b=e.equals||Vn,y=new ce(o,()=>{d||l?i():v||(v=!0,a(i))},e.onError,e.requiresObservable);return null!=e&&null!=(s=e.signal)&&s.aborted||y.Y(),y.Z(null==e?void 0:e.signal)},t.remove=function(t,e){en(t)?t[_n].Bt(e):$e(t)||ze(t)?t.delete(e):Qt(t)?("number"!=typeof e&&(e=parseInt(e,10)),t.splice(e,1)):n(9)},t.runInAction=mt,t.set=function t(e,i,r){if(2===arguments.length&&!ze(e)){ht();const n=i;try{for(let i in n)t(e,i,n[i])}finally{lt()}return}en(e)?e[_n].Tt(i,r):$e(e)?e.set(i,r):ze(e)?e.add(i):Qt(e)?("number"!=typeof i&&(i=parseInt(i,10)),i<0&&n(42,i),ht(),i>=e.length&&(e.length=i+1),e[i]=r,lt()):n(8)},t.spy=function(){return console.warn("[mobx.spy] Is a no-op in production builds"),function(){}},t.toJS=function(t){return Bt(t,new Map)},t.transaction=Pt,t.untracked=et,t.values=function(t){return en(t)?Et(t).map(n=>t[n]):$e(t)?Et(t).map(n=>t.get(n)):ze(t)?Array.from(t.values()):Qt(t)?t.slice():void n(6)},t.when=function(t,n,e){return 1===arguments.length||n&&"object"==typeof n?function(t,n){var e;if(null!=n&&null!=(e=n.signal)&&e.aborted)return dn(Promise.reject(new Error("WHEN_ABORTED")),{cancel:()=>null});let i,r;const s=new Promise((e,s)=>{var o;let u=Dt(t,e,dn({},n,{onError:s}));i=()=>{u(),s(new Error("WHEN_CANCELLED"))},r=()=>{u(),s(new Error("WHEN_ABORTED"))},null==n||null==(o=n.signal)||null==o.addEventListener||o.addEventListener("abort",r)}).finally(()=>{var t;return null==n||null==(t=n.signal)||null==t.removeEventListener?void 0:t.removeEventListener("abort",r)});return s.cancel=i,s}(t,n):Dt(t,n,e||{})},Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((t="undefined"!=typeof globalThis?globalThis:t||self).mobx={});
//# sourceMappingURL=mobx.umd.production.min.js.map