canvas-light-react 1.0.0 → 1.0.1
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/dist/CanvasLight.d.ts +6 -0
- package/dist/canvas-light-react.mjs +3099 -194
- package/dist/canvas-light-react.umd.js +31 -2
- package/dist/components/Canvas.d.ts +10 -0
- package/dist/components/Toolbar.d.ts +8 -0
- package/dist/index.d.ts +3 -0
- package/dist/js/canvas-light-react.mjs +3220 -0
- package/dist/js/canvas-light-react.umd.js +35 -0
- package/dist/store/CanvasStore.d.ts +5 -0
- package/dist/store/ToolStore.d.ts +5 -0
- package/dist/tools/Brush.d.ts +10 -0
- package/package.json +3 -3
|
@@ -0,0 +1,3220 @@
|
|
|
1
|
+
import gr, { useRef as mr, useEffect as Or } from "react";
|
|
2
|
+
var He = { exports: {} }, Ce = {};
|
|
3
|
+
var tn;
|
|
4
|
+
function yr() {
|
|
5
|
+
if (tn) return Ce;
|
|
6
|
+
tn = 1;
|
|
7
|
+
var e = /* @__PURE__ */ Symbol.for("react.transitional.element"), t = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
8
|
+
function r(n, i, o) {
|
|
9
|
+
var s = null;
|
|
10
|
+
if (o !== void 0 && (s = "" + o), i.key !== void 0 && (s = "" + i.key), "key" in i) {
|
|
11
|
+
o = {};
|
|
12
|
+
for (var a in i)
|
|
13
|
+
a !== "key" && (o[a] = i[a]);
|
|
14
|
+
} else o = i;
|
|
15
|
+
return i = o.ref, {
|
|
16
|
+
$$typeof: e,
|
|
17
|
+
type: n,
|
|
18
|
+
key: s,
|
|
19
|
+
ref: i !== void 0 ? i : null,
|
|
20
|
+
props: o
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
return Ce.Fragment = t, Ce.jsx = r, Ce.jsxs = r, Ce;
|
|
24
|
+
}
|
|
25
|
+
var Me = {};
|
|
26
|
+
var nn;
|
|
27
|
+
function Er() {
|
|
28
|
+
return nn || (nn = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
29
|
+
function e(c) {
|
|
30
|
+
if (c == null) return null;
|
|
31
|
+
if (typeof c == "function")
|
|
32
|
+
return c.$$typeof === hr ? null : c.displayName || c.name || null;
|
|
33
|
+
if (typeof c == "string") return c;
|
|
34
|
+
switch (c) {
|
|
35
|
+
case j:
|
|
36
|
+
return "Fragment";
|
|
37
|
+
case Re:
|
|
38
|
+
return "Profiler";
|
|
39
|
+
case ye:
|
|
40
|
+
return "StrictMode";
|
|
41
|
+
case ee:
|
|
42
|
+
return "Suspense";
|
|
43
|
+
case Ye:
|
|
44
|
+
return "SuspenseList";
|
|
45
|
+
case vr:
|
|
46
|
+
return "Activity";
|
|
47
|
+
}
|
|
48
|
+
if (typeof c == "object")
|
|
49
|
+
switch (typeof c.tag == "number" && console.error(
|
|
50
|
+
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
51
|
+
), c.$$typeof) {
|
|
52
|
+
case k:
|
|
53
|
+
return "Portal";
|
|
54
|
+
case D:
|
|
55
|
+
return c.displayName || "Context";
|
|
56
|
+
case le:
|
|
57
|
+
return (c._context.displayName || "Context") + ".Consumer";
|
|
58
|
+
case H:
|
|
59
|
+
var h = c.render;
|
|
60
|
+
return c = c.displayName, c || (c = h.displayName || h.name || "", c = c !== "" ? "ForwardRef(" + c + ")" : "ForwardRef"), c;
|
|
61
|
+
case _r:
|
|
62
|
+
return h = c.displayName || null, h !== null ? h : e(c.type) || "Memo";
|
|
63
|
+
case gt:
|
|
64
|
+
h = c._payload, c = c._init;
|
|
65
|
+
try {
|
|
66
|
+
return e(c(h));
|
|
67
|
+
} catch {
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
function t(c) {
|
|
73
|
+
return "" + c;
|
|
74
|
+
}
|
|
75
|
+
function r(c) {
|
|
76
|
+
try {
|
|
77
|
+
t(c);
|
|
78
|
+
var h = !1;
|
|
79
|
+
} catch {
|
|
80
|
+
h = !0;
|
|
81
|
+
}
|
|
82
|
+
if (h) {
|
|
83
|
+
h = console;
|
|
84
|
+
var O = h.error, E = typeof Symbol == "function" && Symbol.toStringTag && c[Symbol.toStringTag] || c.constructor.name || "Object";
|
|
85
|
+
return O.call(
|
|
86
|
+
h,
|
|
87
|
+
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
88
|
+
E
|
|
89
|
+
), t(c);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
function n(c) {
|
|
93
|
+
if (c === j) return "<>";
|
|
94
|
+
if (typeof c == "object" && c !== null && c.$$typeof === gt)
|
|
95
|
+
return "<...>";
|
|
96
|
+
try {
|
|
97
|
+
var h = e(c);
|
|
98
|
+
return h ? "<" + h + ">" : "<...>";
|
|
99
|
+
} catch {
|
|
100
|
+
return "<...>";
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
function i() {
|
|
104
|
+
var c = mt.A;
|
|
105
|
+
return c === null ? null : c.getOwner();
|
|
106
|
+
}
|
|
107
|
+
function o() {
|
|
108
|
+
return Error("react-stack-top-frame");
|
|
109
|
+
}
|
|
110
|
+
function s(c) {
|
|
111
|
+
if (Ht.call(c, "key")) {
|
|
112
|
+
var h = Object.getOwnPropertyDescriptor(c, "key").get;
|
|
113
|
+
if (h && h.isReactWarning) return !1;
|
|
114
|
+
}
|
|
115
|
+
return c.key !== void 0;
|
|
116
|
+
}
|
|
117
|
+
function a(c, h) {
|
|
118
|
+
function O() {
|
|
119
|
+
Xt || (Xt = !0, console.error(
|
|
120
|
+
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
121
|
+
h
|
|
122
|
+
));
|
|
123
|
+
}
|
|
124
|
+
O.isReactWarning = !0, Object.defineProperty(c, "key", {
|
|
125
|
+
get: O,
|
|
126
|
+
configurable: !0
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
function u() {
|
|
130
|
+
var c = e(this.type);
|
|
131
|
+
return Jt[c] || (Jt[c] = !0, console.error(
|
|
132
|
+
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
133
|
+
)), c = this.props.ref, c !== void 0 ? c : null;
|
|
134
|
+
}
|
|
135
|
+
function f(c, h, O, E, We, yt) {
|
|
136
|
+
var N = O.ref;
|
|
137
|
+
return c = {
|
|
138
|
+
$$typeof: V,
|
|
139
|
+
type: c,
|
|
140
|
+
key: h,
|
|
141
|
+
props: O,
|
|
142
|
+
_owner: E
|
|
143
|
+
}, (N !== void 0 ? N : null) !== null ? Object.defineProperty(c, "ref", {
|
|
144
|
+
enumerable: !1,
|
|
145
|
+
get: u
|
|
146
|
+
}) : Object.defineProperty(c, "ref", { enumerable: !1, value: null }), c._store = {}, Object.defineProperty(c._store, "validated", {
|
|
147
|
+
configurable: !1,
|
|
148
|
+
enumerable: !1,
|
|
149
|
+
writable: !0,
|
|
150
|
+
value: 0
|
|
151
|
+
}), Object.defineProperty(c, "_debugInfo", {
|
|
152
|
+
configurable: !1,
|
|
153
|
+
enumerable: !1,
|
|
154
|
+
writable: !0,
|
|
155
|
+
value: null
|
|
156
|
+
}), Object.defineProperty(c, "_debugStack", {
|
|
157
|
+
configurable: !1,
|
|
158
|
+
enumerable: !1,
|
|
159
|
+
writable: !0,
|
|
160
|
+
value: We
|
|
161
|
+
}), Object.defineProperty(c, "_debugTask", {
|
|
162
|
+
configurable: !1,
|
|
163
|
+
enumerable: !1,
|
|
164
|
+
writable: !0,
|
|
165
|
+
value: yt
|
|
166
|
+
}), Object.freeze && (Object.freeze(c.props), Object.freeze(c)), c;
|
|
167
|
+
}
|
|
168
|
+
function d(c, h, O, E, We, yt) {
|
|
169
|
+
var N = h.children;
|
|
170
|
+
if (N !== void 0)
|
|
171
|
+
if (E)
|
|
172
|
+
if (pr(N)) {
|
|
173
|
+
for (E = 0; E < N.length; E++)
|
|
174
|
+
p(N[E]);
|
|
175
|
+
Object.freeze && Object.freeze(N);
|
|
176
|
+
} else
|
|
177
|
+
console.error(
|
|
178
|
+
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
179
|
+
);
|
|
180
|
+
else p(N);
|
|
181
|
+
if (Ht.call(h, "key")) {
|
|
182
|
+
N = e(c);
|
|
183
|
+
var Ee = Object.keys(h).filter(function(br) {
|
|
184
|
+
return br !== "key";
|
|
185
|
+
});
|
|
186
|
+
E = 0 < Ee.length ? "{key: someKey, " + Ee.join(": ..., ") + ": ...}" : "{key: someKey}", en[N + E] || (Ee = 0 < Ee.length ? "{" + Ee.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
187
|
+
`A props object containing a "key" prop is being spread into JSX:
|
|
188
|
+
let props = %s;
|
|
189
|
+
<%s {...props} />
|
|
190
|
+
React keys must be passed directly to JSX without using spread:
|
|
191
|
+
let props = %s;
|
|
192
|
+
<%s key={someKey} {...props} />`,
|
|
193
|
+
E,
|
|
194
|
+
N,
|
|
195
|
+
Ee,
|
|
196
|
+
N
|
|
197
|
+
), en[N + E] = !0);
|
|
198
|
+
}
|
|
199
|
+
if (N = null, O !== void 0 && (r(O), N = "" + O), s(h) && (r(h.key), N = "" + h.key), "key" in h) {
|
|
200
|
+
O = {};
|
|
201
|
+
for (var Et in h)
|
|
202
|
+
Et !== "key" && (O[Et] = h[Et]);
|
|
203
|
+
} else O = h;
|
|
204
|
+
return N && a(
|
|
205
|
+
O,
|
|
206
|
+
typeof c == "function" ? c.displayName || c.name || "Unknown" : c
|
|
207
|
+
), f(
|
|
208
|
+
c,
|
|
209
|
+
N,
|
|
210
|
+
O,
|
|
211
|
+
i(),
|
|
212
|
+
We,
|
|
213
|
+
yt
|
|
214
|
+
);
|
|
215
|
+
}
|
|
216
|
+
function p(c) {
|
|
217
|
+
g(c) ? c._store && (c._store.validated = 1) : typeof c == "object" && c !== null && c.$$typeof === gt && (c._payload.status === "fulfilled" ? g(c._payload.value) && c._payload.value._store && (c._payload.value._store.validated = 1) : c._store && (c._store.validated = 1));
|
|
218
|
+
}
|
|
219
|
+
function g(c) {
|
|
220
|
+
return typeof c == "object" && c !== null && c.$$typeof === V;
|
|
221
|
+
}
|
|
222
|
+
var y = gr, V = /* @__PURE__ */ Symbol.for("react.transitional.element"), k = /* @__PURE__ */ Symbol.for("react.portal"), j = /* @__PURE__ */ Symbol.for("react.fragment"), ye = /* @__PURE__ */ Symbol.for("react.strict_mode"), Re = /* @__PURE__ */ Symbol.for("react.profiler"), le = /* @__PURE__ */ Symbol.for("react.consumer"), D = /* @__PURE__ */ Symbol.for("react.context"), H = /* @__PURE__ */ Symbol.for("react.forward_ref"), ee = /* @__PURE__ */ Symbol.for("react.suspense"), Ye = /* @__PURE__ */ Symbol.for("react.suspense_list"), _r = /* @__PURE__ */ Symbol.for("react.memo"), gt = /* @__PURE__ */ Symbol.for("react.lazy"), vr = /* @__PURE__ */ Symbol.for("react.activity"), hr = /* @__PURE__ */ Symbol.for("react.client.reference"), mt = y.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, Ht = Object.prototype.hasOwnProperty, pr = Array.isArray, Ot = console.createTask ? console.createTask : function() {
|
|
223
|
+
return null;
|
|
224
|
+
};
|
|
225
|
+
y = {
|
|
226
|
+
react_stack_bottom_frame: function(c) {
|
|
227
|
+
return c();
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
var Xt, Jt = {}, Zt = y.react_stack_bottom_frame.bind(
|
|
231
|
+
y,
|
|
232
|
+
o
|
|
233
|
+
)(), Qt = Ot(n(o)), en = {};
|
|
234
|
+
Me.Fragment = j, Me.jsx = function(c, h, O) {
|
|
235
|
+
var E = 1e4 > mt.recentlyCreatedOwnerStacks++;
|
|
236
|
+
return d(
|
|
237
|
+
c,
|
|
238
|
+
h,
|
|
239
|
+
O,
|
|
240
|
+
!1,
|
|
241
|
+
E ? Error("react-stack-top-frame") : Zt,
|
|
242
|
+
E ? Ot(n(c)) : Qt
|
|
243
|
+
);
|
|
244
|
+
}, Me.jsxs = function(c, h, O) {
|
|
245
|
+
var E = 1e4 > mt.recentlyCreatedOwnerStacks++;
|
|
246
|
+
return d(
|
|
247
|
+
c,
|
|
248
|
+
h,
|
|
249
|
+
O,
|
|
250
|
+
!0,
|
|
251
|
+
E ? Error("react-stack-top-frame") : Zt,
|
|
252
|
+
E ? Ot(n(c)) : Qt
|
|
253
|
+
);
|
|
254
|
+
};
|
|
255
|
+
})()), Me;
|
|
256
|
+
}
|
|
257
|
+
var rn;
|
|
258
|
+
function Nr() {
|
|
259
|
+
return rn || (rn = 1, process.env.NODE_ENV === "production" ? He.exports = yr() : He.exports = Er()), He.exports;
|
|
260
|
+
}
|
|
261
|
+
var we = Nr(), Ar = {
|
|
262
|
+
0: "Invalid value for configuration 'enforceActions', expected 'never', 'always' or 'observed'",
|
|
263
|
+
1: function(t, r) {
|
|
264
|
+
return "Cannot apply '" + t + "' to '" + r.toString() + "': Field not found.";
|
|
265
|
+
},
|
|
266
|
+
/*
|
|
267
|
+
2(prop) {
|
|
268
|
+
return `invalid decorator for '${prop.toString()}'`
|
|
269
|
+
},
|
|
270
|
+
3(prop) {
|
|
271
|
+
return `Cannot decorate '${prop.toString()}': action can only be used on properties with a function value.`
|
|
272
|
+
},
|
|
273
|
+
4(prop) {
|
|
274
|
+
return `Cannot decorate '${prop.toString()}': computed can only be used on getter properties.`
|
|
275
|
+
},
|
|
276
|
+
*/
|
|
277
|
+
5: "'keys()' can only be used on observable objects, arrays, sets and maps",
|
|
278
|
+
6: "'values()' can only be used on observable objects, arrays, sets and maps",
|
|
279
|
+
7: "'entries()' can only be used on observable objects, arrays and maps",
|
|
280
|
+
8: "'set()' can only be used on observable objects, arrays and maps",
|
|
281
|
+
9: "'remove()' can only be used on observable objects, arrays and maps",
|
|
282
|
+
10: "'has()' can only be used on observable objects, arrays and maps",
|
|
283
|
+
11: "'get()' can only be used on observable objects, arrays and maps",
|
|
284
|
+
12: "Invalid annotation",
|
|
285
|
+
13: "Dynamic observable objects cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)",
|
|
286
|
+
14: "Intercept handlers should return nothing or a change object",
|
|
287
|
+
15: "Observable arrays cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)",
|
|
288
|
+
16: "Modification exception: the internal structure of an observable array was changed.",
|
|
289
|
+
17: function(t, r) {
|
|
290
|
+
return "[mobx.array] Index out of bounds, " + t + " is larger than " + r;
|
|
291
|
+
},
|
|
292
|
+
18: "mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js",
|
|
293
|
+
19: function(t) {
|
|
294
|
+
return "Cannot initialize from classes that inherit from Map: " + t.constructor.name;
|
|
295
|
+
},
|
|
296
|
+
20: function(t) {
|
|
297
|
+
return "Cannot initialize map from " + t;
|
|
298
|
+
},
|
|
299
|
+
21: function(t) {
|
|
300
|
+
return "Cannot convert to map from '" + t + "'";
|
|
301
|
+
},
|
|
302
|
+
22: "mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js",
|
|
303
|
+
23: "It is not possible to get index atoms from arrays",
|
|
304
|
+
24: function(t) {
|
|
305
|
+
return "Cannot obtain administration from " + t;
|
|
306
|
+
},
|
|
307
|
+
25: function(t, r) {
|
|
308
|
+
return "the entry '" + t + "' does not exist in the observable map '" + r + "'";
|
|
309
|
+
},
|
|
310
|
+
26: "please specify a property",
|
|
311
|
+
27: function(t, r) {
|
|
312
|
+
return "no observable property '" + t.toString() + "' found on the observable object '" + r + "'";
|
|
313
|
+
},
|
|
314
|
+
28: function(t) {
|
|
315
|
+
return "Cannot obtain atom from " + t;
|
|
316
|
+
},
|
|
317
|
+
29: "Expecting some object",
|
|
318
|
+
30: "invalid action stack. did you forget to finish an action?",
|
|
319
|
+
31: "missing option for computed: get",
|
|
320
|
+
32: function(t, r) {
|
|
321
|
+
return "Cycle detected in computation " + t + ": " + r;
|
|
322
|
+
},
|
|
323
|
+
33: function(t) {
|
|
324
|
+
return "The setter of computed value '" + t + "' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?";
|
|
325
|
+
},
|
|
326
|
+
34: function(t) {
|
|
327
|
+
return "[ComputedValue '" + t + "'] It is not possible to assign a new value to a computed value.";
|
|
328
|
+
},
|
|
329
|
+
35: "There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`",
|
|
330
|
+
36: "isolateGlobalState should be called before MobX is running any reactions",
|
|
331
|
+
37: function(t) {
|
|
332
|
+
return "[mobx] `observableArray." + t + "()` mutates the array in-place, which is not allowed inside a derivation. Use `array.slice()." + t + "()` instead";
|
|
333
|
+
},
|
|
334
|
+
38: "'ownKeys()' can only be used on observable objects",
|
|
335
|
+
39: "'defineProperty()' can only be used on observable objects"
|
|
336
|
+
}, Sr = process.env.NODE_ENV !== "production" ? Ar : {};
|
|
337
|
+
function _(e) {
|
|
338
|
+
for (var t = arguments.length, r = new Array(t > 1 ? t - 1 : 0), n = 1; n < t; n++)
|
|
339
|
+
r[n - 1] = arguments[n];
|
|
340
|
+
if (process.env.NODE_ENV !== "production") {
|
|
341
|
+
var i = typeof e == "string" ? e : Sr[e];
|
|
342
|
+
throw typeof i == "function" && (i = i.apply(null, r)), new Error("[MobX] " + i);
|
|
343
|
+
}
|
|
344
|
+
throw new Error(typeof e == "number" ? "[MobX] minified error nr: " + e + (r.length ? " " + r.map(String).join(",") : "") + ". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts" : "[MobX] " + e);
|
|
345
|
+
}
|
|
346
|
+
var wr = {};
|
|
347
|
+
function Bt() {
|
|
348
|
+
return typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : wr;
|
|
349
|
+
}
|
|
350
|
+
var En = Object.assign, Qe = Object.getOwnPropertyDescriptor, Z = Object.defineProperty, ct = Object.prototype, et = [];
|
|
351
|
+
Object.freeze(et);
|
|
352
|
+
var Nn = {};
|
|
353
|
+
Object.freeze(Nn);
|
|
354
|
+
var Dr = typeof Proxy < "u", jr = /* @__PURE__ */ Object.toString();
|
|
355
|
+
function An() {
|
|
356
|
+
Dr || _(process.env.NODE_ENV !== "production" ? "`Proxy` objects are not available in the current environment. Please configure MobX to enable a fallback implementation.`" : "Proxy not available");
|
|
357
|
+
}
|
|
358
|
+
function ke(e) {
|
|
359
|
+
process.env.NODE_ENV !== "production" && l.verifyProxies && _("MobX is currently configured to be able to run in ES5 mode, but in ES5 MobX won't be able to " + e);
|
|
360
|
+
}
|
|
361
|
+
function Y() {
|
|
362
|
+
return ++l.mobxGuid;
|
|
363
|
+
}
|
|
364
|
+
function Ut(e) {
|
|
365
|
+
var t = !1;
|
|
366
|
+
return function() {
|
|
367
|
+
if (!t)
|
|
368
|
+
return t = !0, e.apply(this, arguments);
|
|
369
|
+
};
|
|
370
|
+
}
|
|
371
|
+
var Ne = function() {
|
|
372
|
+
};
|
|
373
|
+
function A(e) {
|
|
374
|
+
return typeof e == "function";
|
|
375
|
+
}
|
|
376
|
+
function _e(e) {
|
|
377
|
+
var t = typeof e;
|
|
378
|
+
switch (t) {
|
|
379
|
+
case "string":
|
|
380
|
+
case "symbol":
|
|
381
|
+
case "number":
|
|
382
|
+
return !0;
|
|
383
|
+
}
|
|
384
|
+
return !1;
|
|
385
|
+
}
|
|
386
|
+
function lt(e) {
|
|
387
|
+
return e !== null && typeof e == "object";
|
|
388
|
+
}
|
|
389
|
+
function P(e) {
|
|
390
|
+
if (!lt(e))
|
|
391
|
+
return !1;
|
|
392
|
+
var t = Object.getPrototypeOf(e);
|
|
393
|
+
if (t == null)
|
|
394
|
+
return !0;
|
|
395
|
+
var r = Object.hasOwnProperty.call(t, "constructor") && t.constructor;
|
|
396
|
+
return typeof r == "function" && r.toString() === jr;
|
|
397
|
+
}
|
|
398
|
+
function Sn(e) {
|
|
399
|
+
var t = e?.constructor;
|
|
400
|
+
return t ? t.name === "GeneratorFunction" || t.displayName === "GeneratorFunction" : !1;
|
|
401
|
+
}
|
|
402
|
+
function ft(e, t, r) {
|
|
403
|
+
Z(e, t, {
|
|
404
|
+
enumerable: !1,
|
|
405
|
+
writable: !0,
|
|
406
|
+
configurable: !0,
|
|
407
|
+
value: r
|
|
408
|
+
});
|
|
409
|
+
}
|
|
410
|
+
function wn(e, t, r) {
|
|
411
|
+
Z(e, t, {
|
|
412
|
+
enumerable: !1,
|
|
413
|
+
writable: !1,
|
|
414
|
+
configurable: !0,
|
|
415
|
+
value: r
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
function ge(e, t) {
|
|
419
|
+
var r = "isMobX" + e;
|
|
420
|
+
return t.prototype[r] = !0, function(n) {
|
|
421
|
+
return lt(n) && n[r] === !0;
|
|
422
|
+
};
|
|
423
|
+
}
|
|
424
|
+
function Ve(e) {
|
|
425
|
+
return e != null && Object.prototype.toString.call(e) === "[object Map]";
|
|
426
|
+
}
|
|
427
|
+
function Vr(e) {
|
|
428
|
+
var t = Object.getPrototypeOf(e), r = Object.getPrototypeOf(t), n = Object.getPrototypeOf(r);
|
|
429
|
+
return n === null;
|
|
430
|
+
}
|
|
431
|
+
function te(e) {
|
|
432
|
+
return e != null && Object.prototype.toString.call(e) === "[object Set]";
|
|
433
|
+
}
|
|
434
|
+
var Dn = typeof Object.getOwnPropertySymbols < "u";
|
|
435
|
+
function Tr(e) {
|
|
436
|
+
var t = Object.keys(e);
|
|
437
|
+
if (!Dn)
|
|
438
|
+
return t;
|
|
439
|
+
var r = Object.getOwnPropertySymbols(e);
|
|
440
|
+
return r.length ? [].concat(t, r.filter(function(n) {
|
|
441
|
+
return ct.propertyIsEnumerable.call(e, n);
|
|
442
|
+
})) : t;
|
|
443
|
+
}
|
|
444
|
+
var Be = typeof Reflect < "u" && Reflect.ownKeys ? Reflect.ownKeys : Dn ? function(e) {
|
|
445
|
+
return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e));
|
|
446
|
+
} : (
|
|
447
|
+
/* istanbul ignore next */
|
|
448
|
+
Object.getOwnPropertyNames
|
|
449
|
+
);
|
|
450
|
+
function jt(e) {
|
|
451
|
+
return typeof e == "string" ? e : typeof e == "symbol" ? e.toString() : new String(e).toString();
|
|
452
|
+
}
|
|
453
|
+
function jn(e) {
|
|
454
|
+
return e === null ? null : typeof e == "object" ? "" + e : e;
|
|
455
|
+
}
|
|
456
|
+
function G(e, t) {
|
|
457
|
+
return ct.hasOwnProperty.call(e, t);
|
|
458
|
+
}
|
|
459
|
+
var xr = Object.getOwnPropertyDescriptors || function(t) {
|
|
460
|
+
var r = {};
|
|
461
|
+
return Be(t).forEach(function(n) {
|
|
462
|
+
r[n] = Qe(t, n);
|
|
463
|
+
}), r;
|
|
464
|
+
};
|
|
465
|
+
function T(e, t) {
|
|
466
|
+
return !!(e & t);
|
|
467
|
+
}
|
|
468
|
+
function x(e, t, r) {
|
|
469
|
+
return r ? e |= t : e &= ~t, e;
|
|
470
|
+
}
|
|
471
|
+
function on(e, t) {
|
|
472
|
+
(t == null || t > e.length) && (t = e.length);
|
|
473
|
+
for (var r = 0, n = Array(t); r < t; r++) n[r] = e[r];
|
|
474
|
+
return n;
|
|
475
|
+
}
|
|
476
|
+
function Pr(e, t) {
|
|
477
|
+
for (var r = 0; r < t.length; r++) {
|
|
478
|
+
var n = t[r];
|
|
479
|
+
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, Cr(n.key), n);
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
function Te(e, t, r) {
|
|
483
|
+
return t && Pr(e.prototype, t), Object.defineProperty(e, "prototype", {
|
|
484
|
+
writable: !1
|
|
485
|
+
}), e;
|
|
486
|
+
}
|
|
487
|
+
function Ae(e, t) {
|
|
488
|
+
var r = typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
|
|
489
|
+
if (r) return (r = r.call(e)).next.bind(r);
|
|
490
|
+
if (Array.isArray(e) || (r = Mr(e)) || t) {
|
|
491
|
+
r && (e = r);
|
|
492
|
+
var n = 0;
|
|
493
|
+
return function() {
|
|
494
|
+
return n >= e.length ? {
|
|
495
|
+
done: !0
|
|
496
|
+
} : {
|
|
497
|
+
done: !1,
|
|
498
|
+
value: e[n++]
|
|
499
|
+
};
|
|
500
|
+
};
|
|
501
|
+
}
|
|
502
|
+
throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
503
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
504
|
+
}
|
|
505
|
+
function se() {
|
|
506
|
+
return se = Object.assign ? Object.assign.bind() : function(e) {
|
|
507
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
508
|
+
var r = arguments[t];
|
|
509
|
+
for (var n in r) ({}).hasOwnProperty.call(r, n) && (e[n] = r[n]);
|
|
510
|
+
}
|
|
511
|
+
return e;
|
|
512
|
+
}, se.apply(null, arguments);
|
|
513
|
+
}
|
|
514
|
+
function Vn(e, t) {
|
|
515
|
+
e.prototype = Object.create(t.prototype), e.prototype.constructor = e, Vt(e, t);
|
|
516
|
+
}
|
|
517
|
+
function Vt(e, t) {
|
|
518
|
+
return Vt = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(r, n) {
|
|
519
|
+
return r.__proto__ = n, r;
|
|
520
|
+
}, Vt(e, t);
|
|
521
|
+
}
|
|
522
|
+
function Rr(e, t) {
|
|
523
|
+
if (typeof e != "object" || !e) return e;
|
|
524
|
+
var r = e[Symbol.toPrimitive];
|
|
525
|
+
if (r !== void 0) {
|
|
526
|
+
var n = r.call(e, t);
|
|
527
|
+
if (typeof n != "object") return n;
|
|
528
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
529
|
+
}
|
|
530
|
+
return String(e);
|
|
531
|
+
}
|
|
532
|
+
function Cr(e) {
|
|
533
|
+
var t = Rr(e, "string");
|
|
534
|
+
return typeof t == "symbol" ? t : t + "";
|
|
535
|
+
}
|
|
536
|
+
function Mr(e, t) {
|
|
537
|
+
if (e) {
|
|
538
|
+
if (typeof e == "string") return on(e, t);
|
|
539
|
+
var r = {}.toString.call(e).slice(8, -1);
|
|
540
|
+
return r === "Object" && e.constructor && (r = e.constructor.name), r === "Map" || r === "Set" ? Array.from(e) : r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? on(e, t) : void 0;
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
var ne = /* @__PURE__ */ Symbol("mobx-stored-annotations");
|
|
544
|
+
function Q(e) {
|
|
545
|
+
function t(r, n) {
|
|
546
|
+
if (Ke(n))
|
|
547
|
+
return e.decorate_20223_(r, n);
|
|
548
|
+
Fe(r, n, e);
|
|
549
|
+
}
|
|
550
|
+
return Object.assign(t, e);
|
|
551
|
+
}
|
|
552
|
+
function Fe(e, t, r) {
|
|
553
|
+
if (G(e, ne) || ft(e, ne, se({}, e[ne])), process.env.NODE_ENV !== "production" && nt(r) && !G(e[ne], t)) {
|
|
554
|
+
var n = e.constructor.name + ".prototype." + t.toString();
|
|
555
|
+
_("'" + n + "' is decorated with 'override', but no such decorated member was found on prototype.");
|
|
556
|
+
}
|
|
557
|
+
kr(e, r, t), nt(r) || (e[ne][t] = r);
|
|
558
|
+
}
|
|
559
|
+
function kr(e, t, r) {
|
|
560
|
+
if (process.env.NODE_ENV !== "production" && !nt(t) && G(e[ne], r)) {
|
|
561
|
+
var n = e.constructor.name + ".prototype." + r.toString(), i = e[ne][r].annotationType_, o = t.annotationType_;
|
|
562
|
+
_("Cannot apply '@" + o + "' to '" + n + "':" + (`
|
|
563
|
+
The field is already decorated with '@` + i + "'.") + `
|
|
564
|
+
Re-decorating fields is not allowed.
|
|
565
|
+
Use '@override' decorator for methods overridden by subclass.`);
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
function Ke(e) {
|
|
569
|
+
return typeof e == "object" && typeof e.kind == "string";
|
|
570
|
+
}
|
|
571
|
+
function dt(e, t) {
|
|
572
|
+
process.env.NODE_ENV !== "production" && !t.includes(e.kind) && _("The decorator applied to '" + String(e.name) + "' cannot be used on a " + e.kind + " element");
|
|
573
|
+
}
|
|
574
|
+
var v = /* @__PURE__ */ Symbol("mobx administration"), ue = /* @__PURE__ */ (function() {
|
|
575
|
+
function e(r) {
|
|
576
|
+
r === void 0 && (r = process.env.NODE_ENV !== "production" ? "Atom@" + Y() : "Atom"), this.name_ = void 0, this.flags_ = 0, this.observers_ = /* @__PURE__ */ new Set(), this.lastAccessedBy_ = 0, this.lowestObserverState_ = b.NOT_TRACKING_, this.onBOL = void 0, this.onBUOL = void 0, this.name_ = r;
|
|
577
|
+
}
|
|
578
|
+
var t = e.prototype;
|
|
579
|
+
return t.onBO = function() {
|
|
580
|
+
this.onBOL && this.onBOL.forEach(function(n) {
|
|
581
|
+
return n();
|
|
582
|
+
});
|
|
583
|
+
}, t.onBUO = function() {
|
|
584
|
+
this.onBUOL && this.onBUOL.forEach(function(n) {
|
|
585
|
+
return n();
|
|
586
|
+
});
|
|
587
|
+
}, t.reportObserved = function() {
|
|
588
|
+
return Gn(this);
|
|
589
|
+
}, t.reportChanged = function() {
|
|
590
|
+
U(), qn(this), I();
|
|
591
|
+
}, t.toString = function() {
|
|
592
|
+
return this.name_;
|
|
593
|
+
}, Te(e, [{
|
|
594
|
+
key: "isBeingObserved",
|
|
595
|
+
get: function() {
|
|
596
|
+
return T(this.flags_, e.isBeingObservedMask_);
|
|
597
|
+
},
|
|
598
|
+
set: function(n) {
|
|
599
|
+
this.flags_ = x(this.flags_, e.isBeingObservedMask_, n);
|
|
600
|
+
}
|
|
601
|
+
}, {
|
|
602
|
+
key: "isPendingUnobservation",
|
|
603
|
+
get: function() {
|
|
604
|
+
return T(this.flags_, e.isPendingUnobservationMask_);
|
|
605
|
+
},
|
|
606
|
+
set: function(n) {
|
|
607
|
+
this.flags_ = x(this.flags_, e.isPendingUnobservationMask_, n);
|
|
608
|
+
}
|
|
609
|
+
}, {
|
|
610
|
+
key: "diffValue",
|
|
611
|
+
get: function() {
|
|
612
|
+
return T(this.flags_, e.diffValueMask_) ? 1 : 0;
|
|
613
|
+
},
|
|
614
|
+
set: function(n) {
|
|
615
|
+
this.flags_ = x(this.flags_, e.diffValueMask_, n === 1);
|
|
616
|
+
}
|
|
617
|
+
}]);
|
|
618
|
+
})();
|
|
619
|
+
ue.isBeingObservedMask_ = 1;
|
|
620
|
+
ue.isPendingUnobservationMask_ = 2;
|
|
621
|
+
ue.diffValueMask_ = 4;
|
|
622
|
+
var It = /* @__PURE__ */ ge("Atom", ue);
|
|
623
|
+
function Tn(e, t, r) {
|
|
624
|
+
t === void 0 && (t = Ne), r === void 0 && (r = Ne);
|
|
625
|
+
var n = new ue(e);
|
|
626
|
+
return t !== Ne && Yi(n, t), r !== Ne && Jn(n, r), n;
|
|
627
|
+
}
|
|
628
|
+
function Lr(e, t) {
|
|
629
|
+
return lr(e, t);
|
|
630
|
+
}
|
|
631
|
+
function Br(e, t) {
|
|
632
|
+
return Object.is ? Object.is(e, t) : e === t ? e !== 0 || 1 / e === 1 / t : e !== e && t !== t;
|
|
633
|
+
}
|
|
634
|
+
var tt = {
|
|
635
|
+
structural: Lr,
|
|
636
|
+
default: Br
|
|
637
|
+
};
|
|
638
|
+
function ve(e, t, r) {
|
|
639
|
+
return $e(e) ? e : Array.isArray(e) ? S.array(e, {
|
|
640
|
+
name: r
|
|
641
|
+
}) : P(e) ? S.object(e, void 0, {
|
|
642
|
+
name: r
|
|
643
|
+
}) : Ve(e) ? S.map(e, {
|
|
644
|
+
name: r
|
|
645
|
+
}) : te(e) ? S.set(e, {
|
|
646
|
+
name: r
|
|
647
|
+
}) : typeof e == "function" && !be(e) && !Ie(e) ? Sn(e) ? De(e) : Ue(r, e) : e;
|
|
648
|
+
}
|
|
649
|
+
function Ur(e, t, r) {
|
|
650
|
+
if (e == null || Pe(e) || bt(e) || ce(e) || X(e))
|
|
651
|
+
return e;
|
|
652
|
+
if (Array.isArray(e))
|
|
653
|
+
return S.array(e, {
|
|
654
|
+
name: r,
|
|
655
|
+
deep: !1
|
|
656
|
+
});
|
|
657
|
+
if (P(e))
|
|
658
|
+
return S.object(e, void 0, {
|
|
659
|
+
name: r,
|
|
660
|
+
deep: !1
|
|
661
|
+
});
|
|
662
|
+
if (Ve(e))
|
|
663
|
+
return S.map(e, {
|
|
664
|
+
name: r,
|
|
665
|
+
deep: !1
|
|
666
|
+
});
|
|
667
|
+
if (te(e))
|
|
668
|
+
return S.set(e, {
|
|
669
|
+
name: r,
|
|
670
|
+
deep: !1
|
|
671
|
+
});
|
|
672
|
+
process.env.NODE_ENV !== "production" && _("The shallow modifier / decorator can only used in combination with arrays, objects, maps and sets");
|
|
673
|
+
}
|
|
674
|
+
function _t(e) {
|
|
675
|
+
return e;
|
|
676
|
+
}
|
|
677
|
+
function Ir(e, t) {
|
|
678
|
+
return process.env.NODE_ENV !== "production" && $e(e) && _("observable.struct should not be used with observable values"), lr(e, t) ? t : e;
|
|
679
|
+
}
|
|
680
|
+
var $r = "override";
|
|
681
|
+
function nt(e) {
|
|
682
|
+
return e.annotationType_ === $r;
|
|
683
|
+
}
|
|
684
|
+
function Ge(e, t) {
|
|
685
|
+
return {
|
|
686
|
+
annotationType_: e,
|
|
687
|
+
options_: t,
|
|
688
|
+
make_: Fr,
|
|
689
|
+
extend_: Kr,
|
|
690
|
+
decorate_20223_: Gr
|
|
691
|
+
};
|
|
692
|
+
}
|
|
693
|
+
function Fr(e, t, r, n) {
|
|
694
|
+
var i;
|
|
695
|
+
if ((i = this.options_) != null && i.bound)
|
|
696
|
+
return this.extend_(e, t, r, !1) === null ? 0 : 1;
|
|
697
|
+
if (n === e.target_)
|
|
698
|
+
return this.extend_(e, t, r, !1) === null ? 0 : 2;
|
|
699
|
+
if (be(r.value))
|
|
700
|
+
return 1;
|
|
701
|
+
var o = xn(e, this, t, r, !1);
|
|
702
|
+
return Z(n, t, o), 2;
|
|
703
|
+
}
|
|
704
|
+
function Kr(e, t, r, n) {
|
|
705
|
+
var i = xn(e, this, t, r);
|
|
706
|
+
return e.defineProperty_(t, i, n);
|
|
707
|
+
}
|
|
708
|
+
function Gr(e, t) {
|
|
709
|
+
process.env.NODE_ENV !== "production" && dt(t, ["method", "field"]);
|
|
710
|
+
var r = t.kind, n = t.name, i = t.addInitializer, o = this, s = function(f) {
|
|
711
|
+
var d, p, g, y;
|
|
712
|
+
return he((d = (p = o.options_) == null ? void 0 : p.name) != null ? d : n.toString(), f, (g = (y = o.options_) == null ? void 0 : y.autoAction) != null ? g : !1);
|
|
713
|
+
};
|
|
714
|
+
if (r == "field")
|
|
715
|
+
return function(u) {
|
|
716
|
+
var f, d = u;
|
|
717
|
+
return be(d) || (d = s(d)), (f = o.options_) != null && f.bound && (d = d.bind(this), d.isMobxAction = !0), d;
|
|
718
|
+
};
|
|
719
|
+
if (r == "method") {
|
|
720
|
+
var a;
|
|
721
|
+
return be(e) || (e = s(e)), (a = this.options_) != null && a.bound && i(function() {
|
|
722
|
+
var u = this, f = u[n].bind(u);
|
|
723
|
+
f.isMobxAction = !0, u[n] = f;
|
|
724
|
+
}), e;
|
|
725
|
+
}
|
|
726
|
+
_("Cannot apply '" + o.annotationType_ + "' to '" + String(n) + "' (kind: " + r + "):" + (`
|
|
727
|
+
'` + o.annotationType_ + "' can only be used on properties with a function value."));
|
|
728
|
+
}
|
|
729
|
+
function qr(e, t, r, n) {
|
|
730
|
+
var i = t.annotationType_, o = n.value;
|
|
731
|
+
process.env.NODE_ENV !== "production" && !A(o) && _("Cannot apply '" + i + "' to '" + e.name_ + "." + r.toString() + "':" + (`
|
|
732
|
+
'` + i + "' can only be used on properties with a function value."));
|
|
733
|
+
}
|
|
734
|
+
function xn(e, t, r, n, i) {
|
|
735
|
+
var o, s, a, u, f, d, p;
|
|
736
|
+
i === void 0 && (i = l.safeDescriptors), qr(e, t, r, n);
|
|
737
|
+
var g = n.value;
|
|
738
|
+
if ((o = t.options_) != null && o.bound) {
|
|
739
|
+
var y;
|
|
740
|
+
g = g.bind((y = e.proxy_) != null ? y : e.target_);
|
|
741
|
+
}
|
|
742
|
+
return {
|
|
743
|
+
value: he(
|
|
744
|
+
(s = (a = t.options_) == null ? void 0 : a.name) != null ? s : r.toString(),
|
|
745
|
+
g,
|
|
746
|
+
(u = (f = t.options_) == null ? void 0 : f.autoAction) != null ? u : !1,
|
|
747
|
+
// https://github.com/mobxjs/mobx/discussions/3140
|
|
748
|
+
(d = t.options_) != null && d.bound ? (p = e.proxy_) != null ? p : e.target_ : void 0
|
|
749
|
+
),
|
|
750
|
+
// Non-configurable for classes
|
|
751
|
+
// prevents accidental field redefinition in subclass
|
|
752
|
+
configurable: i ? e.isPlainObject_ : !0,
|
|
753
|
+
// https://github.com/mobxjs/mobx/pull/2641#issuecomment-737292058
|
|
754
|
+
enumerable: !1,
|
|
755
|
+
// Non-obsevable, therefore non-writable
|
|
756
|
+
// Also prevents rewriting in subclass constructor
|
|
757
|
+
writable: !i
|
|
758
|
+
};
|
|
759
|
+
}
|
|
760
|
+
function Pn(e, t) {
|
|
761
|
+
return {
|
|
762
|
+
annotationType_: e,
|
|
763
|
+
options_: t,
|
|
764
|
+
make_: zr,
|
|
765
|
+
extend_: Yr,
|
|
766
|
+
decorate_20223_: Wr
|
|
767
|
+
};
|
|
768
|
+
}
|
|
769
|
+
function zr(e, t, r, n) {
|
|
770
|
+
var i;
|
|
771
|
+
if (n === e.target_)
|
|
772
|
+
return this.extend_(e, t, r, !1) === null ? 0 : 2;
|
|
773
|
+
if ((i = this.options_) != null && i.bound && (!G(e.target_, t) || !Ie(e.target_[t])) && this.extend_(e, t, r, !1) === null)
|
|
774
|
+
return 0;
|
|
775
|
+
if (Ie(r.value))
|
|
776
|
+
return 1;
|
|
777
|
+
var o = Rn(e, this, t, r, !1, !1);
|
|
778
|
+
return Z(n, t, o), 2;
|
|
779
|
+
}
|
|
780
|
+
function Yr(e, t, r, n) {
|
|
781
|
+
var i, o = Rn(e, this, t, r, (i = this.options_) == null ? void 0 : i.bound);
|
|
782
|
+
return e.defineProperty_(t, o, n);
|
|
783
|
+
}
|
|
784
|
+
function Wr(e, t) {
|
|
785
|
+
var r;
|
|
786
|
+
process.env.NODE_ENV !== "production" && dt(t, ["method"]);
|
|
787
|
+
var n = t.name, i = t.addInitializer;
|
|
788
|
+
return Ie(e) || (e = De(e)), (r = this.options_) != null && r.bound && i(function() {
|
|
789
|
+
var o = this, s = o[n].bind(o);
|
|
790
|
+
s.isMobXFlow = !0, o[n] = s;
|
|
791
|
+
}), e;
|
|
792
|
+
}
|
|
793
|
+
function Hr(e, t, r, n) {
|
|
794
|
+
var i = t.annotationType_, o = n.value;
|
|
795
|
+
process.env.NODE_ENV !== "production" && !A(o) && _("Cannot apply '" + i + "' to '" + e.name_ + "." + r.toString() + "':" + (`
|
|
796
|
+
'` + i + "' can only be used on properties with a generator function value."));
|
|
797
|
+
}
|
|
798
|
+
function Rn(e, t, r, n, i, o) {
|
|
799
|
+
o === void 0 && (o = l.safeDescriptors), Hr(e, t, r, n);
|
|
800
|
+
var s = n.value;
|
|
801
|
+
if (Ie(s) || (s = De(s)), i) {
|
|
802
|
+
var a;
|
|
803
|
+
s = s.bind((a = e.proxy_) != null ? a : e.target_), s.isMobXFlow = !0;
|
|
804
|
+
}
|
|
805
|
+
return {
|
|
806
|
+
value: s,
|
|
807
|
+
// Non-configurable for classes
|
|
808
|
+
// prevents accidental field redefinition in subclass
|
|
809
|
+
configurable: o ? e.isPlainObject_ : !0,
|
|
810
|
+
// https://github.com/mobxjs/mobx/pull/2641#issuecomment-737292058
|
|
811
|
+
enumerable: !1,
|
|
812
|
+
// Non-obsevable, therefore non-writable
|
|
813
|
+
// Also prevents rewriting in subclass constructor
|
|
814
|
+
writable: !o
|
|
815
|
+
};
|
|
816
|
+
}
|
|
817
|
+
function $t(e, t) {
|
|
818
|
+
return {
|
|
819
|
+
annotationType_: e,
|
|
820
|
+
options_: t,
|
|
821
|
+
make_: Xr,
|
|
822
|
+
extend_: Jr,
|
|
823
|
+
decorate_20223_: Zr
|
|
824
|
+
};
|
|
825
|
+
}
|
|
826
|
+
function Xr(e, t, r) {
|
|
827
|
+
return this.extend_(e, t, r, !1) === null ? 0 : 1;
|
|
828
|
+
}
|
|
829
|
+
function Jr(e, t, r, n) {
|
|
830
|
+
return Qr(e, this, t, r), e.defineComputedProperty_(t, se({}, this.options_, {
|
|
831
|
+
get: r.get,
|
|
832
|
+
set: r.set
|
|
833
|
+
}), n);
|
|
834
|
+
}
|
|
835
|
+
function Zr(e, t) {
|
|
836
|
+
process.env.NODE_ENV !== "production" && dt(t, ["getter"]);
|
|
837
|
+
var r = this, n = t.name, i = t.addInitializer;
|
|
838
|
+
return i(function() {
|
|
839
|
+
var o = xe(this)[v], s = se({}, r.options_, {
|
|
840
|
+
get: e,
|
|
841
|
+
context: this
|
|
842
|
+
});
|
|
843
|
+
s.name || (s.name = process.env.NODE_ENV !== "production" ? o.name_ + "." + n.toString() : "ObservableObject." + n.toString()), o.values_.set(n, new F(s));
|
|
844
|
+
}), function() {
|
|
845
|
+
return this[v].getObservablePropValue_(n);
|
|
846
|
+
};
|
|
847
|
+
}
|
|
848
|
+
function Qr(e, t, r, n) {
|
|
849
|
+
var i = t.annotationType_, o = n.get;
|
|
850
|
+
process.env.NODE_ENV !== "production" && !o && _("Cannot apply '" + i + "' to '" + e.name_ + "." + r.toString() + "':" + (`
|
|
851
|
+
'` + i + "' can only be used on getter(+setter) properties."));
|
|
852
|
+
}
|
|
853
|
+
function vt(e, t) {
|
|
854
|
+
return {
|
|
855
|
+
annotationType_: e,
|
|
856
|
+
options_: t,
|
|
857
|
+
make_: ei,
|
|
858
|
+
extend_: ti,
|
|
859
|
+
decorate_20223_: ni
|
|
860
|
+
};
|
|
861
|
+
}
|
|
862
|
+
function ei(e, t, r) {
|
|
863
|
+
return this.extend_(e, t, r, !1) === null ? 0 : 1;
|
|
864
|
+
}
|
|
865
|
+
function ti(e, t, r, n) {
|
|
866
|
+
var i, o;
|
|
867
|
+
return ri(e, this, t, r), e.defineObservableProperty_(t, r.value, (i = (o = this.options_) == null ? void 0 : o.enhancer) != null ? i : ve, n);
|
|
868
|
+
}
|
|
869
|
+
function ni(e, t) {
|
|
870
|
+
if (process.env.NODE_ENV !== "production") {
|
|
871
|
+
if (t.kind === "field")
|
|
872
|
+
throw _("Please use `@observable accessor " + String(t.name) + "` instead of `@observable " + String(t.name) + "`");
|
|
873
|
+
dt(t, ["accessor"]);
|
|
874
|
+
}
|
|
875
|
+
var r = this, n = t.kind, i = t.name, o = /* @__PURE__ */ new WeakSet();
|
|
876
|
+
function s(a, u) {
|
|
877
|
+
var f, d, p = xe(a)[v], g = new de(u, (f = (d = r.options_) == null ? void 0 : d.enhancer) != null ? f : ve, process.env.NODE_ENV !== "production" ? p.name_ + "." + i.toString() : "ObservableObject." + i.toString(), !1);
|
|
878
|
+
p.values_.set(i, g), o.add(a);
|
|
879
|
+
}
|
|
880
|
+
if (n == "accessor")
|
|
881
|
+
return {
|
|
882
|
+
get: function() {
|
|
883
|
+
return o.has(this) || s(this, e.get.call(this)), this[v].getObservablePropValue_(i);
|
|
884
|
+
},
|
|
885
|
+
set: function(u) {
|
|
886
|
+
return o.has(this) || s(this, u), this[v].setObservablePropValue_(i, u);
|
|
887
|
+
},
|
|
888
|
+
init: function(u) {
|
|
889
|
+
return o.has(this) || s(this, u), u;
|
|
890
|
+
}
|
|
891
|
+
};
|
|
892
|
+
}
|
|
893
|
+
function ri(e, t, r, n) {
|
|
894
|
+
var i = t.annotationType_;
|
|
895
|
+
process.env.NODE_ENV !== "production" && !("value" in n) && _("Cannot apply '" + i + "' to '" + e.name_ + "." + r.toString() + "':" + (`
|
|
896
|
+
'` + i + "' cannot be used on getter/setter properties"));
|
|
897
|
+
}
|
|
898
|
+
var ii = "true", oi = /* @__PURE__ */ Cn();
|
|
899
|
+
function Cn(e) {
|
|
900
|
+
return {
|
|
901
|
+
annotationType_: ii,
|
|
902
|
+
options_: e,
|
|
903
|
+
make_: si,
|
|
904
|
+
extend_: ai,
|
|
905
|
+
decorate_20223_: ui
|
|
906
|
+
};
|
|
907
|
+
}
|
|
908
|
+
function si(e, t, r, n) {
|
|
909
|
+
var i, o;
|
|
910
|
+
if (r.get)
|
|
911
|
+
return ht.make_(e, t, r, n);
|
|
912
|
+
if (r.set) {
|
|
913
|
+
var s = be(r.set) ? r.set : he(t.toString(), r.set);
|
|
914
|
+
return n === e.target_ ? e.defineProperty_(t, {
|
|
915
|
+
configurable: l.safeDescriptors ? e.isPlainObject_ : !0,
|
|
916
|
+
set: s
|
|
917
|
+
}) === null ? 0 : 2 : (Z(n, t, {
|
|
918
|
+
configurable: !0,
|
|
919
|
+
set: s
|
|
920
|
+
}), 2);
|
|
921
|
+
}
|
|
922
|
+
if (n !== e.target_ && typeof r.value == "function") {
|
|
923
|
+
var a;
|
|
924
|
+
if (Sn(r.value)) {
|
|
925
|
+
var u, f = (u = this.options_) != null && u.autoBind ? De.bound : De;
|
|
926
|
+
return f.make_(e, t, r, n);
|
|
927
|
+
}
|
|
928
|
+
var d = (a = this.options_) != null && a.autoBind ? Ue.bound : Ue;
|
|
929
|
+
return d.make_(e, t, r, n);
|
|
930
|
+
}
|
|
931
|
+
var p = ((i = this.options_) == null ? void 0 : i.deep) === !1 ? S.ref : S;
|
|
932
|
+
if (typeof r.value == "function" && (o = this.options_) != null && o.autoBind) {
|
|
933
|
+
var g;
|
|
934
|
+
r.value = r.value.bind((g = e.proxy_) != null ? g : e.target_);
|
|
935
|
+
}
|
|
936
|
+
return p.make_(e, t, r, n);
|
|
937
|
+
}
|
|
938
|
+
function ai(e, t, r, n) {
|
|
939
|
+
var i, o;
|
|
940
|
+
if (r.get)
|
|
941
|
+
return ht.extend_(e, t, r, n);
|
|
942
|
+
if (r.set)
|
|
943
|
+
return e.defineProperty_(t, {
|
|
944
|
+
configurable: l.safeDescriptors ? e.isPlainObject_ : !0,
|
|
945
|
+
set: he(t.toString(), r.set)
|
|
946
|
+
}, n);
|
|
947
|
+
if (typeof r.value == "function" && (i = this.options_) != null && i.autoBind) {
|
|
948
|
+
var s;
|
|
949
|
+
r.value = r.value.bind((s = e.proxy_) != null ? s : e.target_);
|
|
950
|
+
}
|
|
951
|
+
var a = ((o = this.options_) == null ? void 0 : o.deep) === !1 ? S.ref : S;
|
|
952
|
+
return a.extend_(e, t, r, n);
|
|
953
|
+
}
|
|
954
|
+
function ui(e, t) {
|
|
955
|
+
_("'" + this.annotationType_ + "' cannot be used as a decorator");
|
|
956
|
+
}
|
|
957
|
+
var ci = "observable", li = "observable.ref", fi = "observable.shallow", di = "observable.struct", Mn = {
|
|
958
|
+
deep: !0,
|
|
959
|
+
name: void 0,
|
|
960
|
+
defaultDecorator: void 0,
|
|
961
|
+
proxy: !0
|
|
962
|
+
};
|
|
963
|
+
Object.freeze(Mn);
|
|
964
|
+
function Xe(e) {
|
|
965
|
+
return e || Mn;
|
|
966
|
+
}
|
|
967
|
+
var Tt = /* @__PURE__ */ vt(ci), _i = /* @__PURE__ */ vt(li, {
|
|
968
|
+
enhancer: _t
|
|
969
|
+
}), vi = /* @__PURE__ */ vt(fi, {
|
|
970
|
+
enhancer: Ur
|
|
971
|
+
}), hi = /* @__PURE__ */ vt(di, {
|
|
972
|
+
enhancer: Ir
|
|
973
|
+
}), kn = /* @__PURE__ */ Q(Tt);
|
|
974
|
+
function Je(e) {
|
|
975
|
+
return e.deep === !0 ? ve : e.deep === !1 ? _t : bi(e.defaultDecorator);
|
|
976
|
+
}
|
|
977
|
+
function pi(e) {
|
|
978
|
+
var t;
|
|
979
|
+
return e ? (t = e.defaultDecorator) != null ? t : Cn(e) : void 0;
|
|
980
|
+
}
|
|
981
|
+
function bi(e) {
|
|
982
|
+
var t, r;
|
|
983
|
+
return e && (t = (r = e.options_) == null ? void 0 : r.enhancer) != null ? t : ve;
|
|
984
|
+
}
|
|
985
|
+
function Ln(e, t, r) {
|
|
986
|
+
if (Ke(t))
|
|
987
|
+
return Tt.decorate_20223_(e, t);
|
|
988
|
+
if (_e(t)) {
|
|
989
|
+
Fe(e, t, Tt);
|
|
990
|
+
return;
|
|
991
|
+
}
|
|
992
|
+
return $e(e) ? e : P(e) ? S.object(e, t, r) : Array.isArray(e) ? S.array(e, t) : Ve(e) ? S.map(e, t) : te(e) ? S.set(e, t) : typeof e == "object" && e !== null ? e : S.box(e, t);
|
|
993
|
+
}
|
|
994
|
+
En(Ln, kn);
|
|
995
|
+
var gi = {
|
|
996
|
+
box: function(t, r) {
|
|
997
|
+
var n = Xe(r);
|
|
998
|
+
return new de(t, Je(n), n.name, !0, n.equals);
|
|
999
|
+
},
|
|
1000
|
+
array: function(t, r) {
|
|
1001
|
+
var n = Xe(r);
|
|
1002
|
+
return (l.useProxies === !1 || n.proxy === !1 ? po : oo)(t, Je(n), n.name);
|
|
1003
|
+
},
|
|
1004
|
+
map: function(t, r) {
|
|
1005
|
+
var n = Xe(r);
|
|
1006
|
+
return new ir(t, Je(n), n.name);
|
|
1007
|
+
},
|
|
1008
|
+
set: function(t, r) {
|
|
1009
|
+
var n = Xe(r);
|
|
1010
|
+
return new or(t, Je(n), n.name);
|
|
1011
|
+
},
|
|
1012
|
+
object: function(t, r, n) {
|
|
1013
|
+
return Oe(function() {
|
|
1014
|
+
return Qn(l.useProxies === !1 || n?.proxy === !1 ? xe({}, n) : no({}, n), t, r);
|
|
1015
|
+
});
|
|
1016
|
+
},
|
|
1017
|
+
ref: /* @__PURE__ */ Q(_i),
|
|
1018
|
+
shallow: /* @__PURE__ */ Q(vi),
|
|
1019
|
+
deep: kn,
|
|
1020
|
+
struct: /* @__PURE__ */ Q(hi)
|
|
1021
|
+
}, S = /* @__PURE__ */ En(Ln, gi), Bn = "computed", mi = "computed.struct", xt = /* @__PURE__ */ $t(Bn), Oi = /* @__PURE__ */ $t(mi, {
|
|
1022
|
+
equals: tt.structural
|
|
1023
|
+
}), ht = function(t, r) {
|
|
1024
|
+
if (Ke(r))
|
|
1025
|
+
return xt.decorate_20223_(t, r);
|
|
1026
|
+
if (_e(r))
|
|
1027
|
+
return Fe(t, r, xt);
|
|
1028
|
+
if (P(t))
|
|
1029
|
+
return Q($t(Bn, t));
|
|
1030
|
+
process.env.NODE_ENV !== "production" && (A(t) || _("First argument to `computed` should be an expression."), A(r) && _("A setter as second argument is no longer supported, use `{ set: fn }` option instead"));
|
|
1031
|
+
var n = P(r) ? r : {};
|
|
1032
|
+
return n.get = t, n.name || (n.name = t.name || ""), new F(n);
|
|
1033
|
+
};
|
|
1034
|
+
Object.assign(ht, xt);
|
|
1035
|
+
ht.struct = /* @__PURE__ */ Q(Oi);
|
|
1036
|
+
var sn, an, rt = 0, yi = 1, Ei = (sn = (an = /* @__PURE__ */ Qe(function() {
|
|
1037
|
+
}, "name")) == null ? void 0 : an.configurable) != null ? sn : !1, un = {
|
|
1038
|
+
value: "action",
|
|
1039
|
+
configurable: !0,
|
|
1040
|
+
writable: !1,
|
|
1041
|
+
enumerable: !1
|
|
1042
|
+
};
|
|
1043
|
+
function he(e, t, r, n) {
|
|
1044
|
+
r === void 0 && (r = !1), process.env.NODE_ENV !== "production" && (A(t) || _("`action` can only be invoked on functions"), (typeof e != "string" || !e) && _("actions should have valid names, got: '" + e + "'"));
|
|
1045
|
+
function i() {
|
|
1046
|
+
return Ni(e, r, t, n || this, arguments);
|
|
1047
|
+
}
|
|
1048
|
+
return i.isMobxAction = !0, i.toString = function() {
|
|
1049
|
+
return t.toString();
|
|
1050
|
+
}, Ei && (un.value = e, Z(i, "name", un)), i;
|
|
1051
|
+
}
|
|
1052
|
+
function Ni(e, t, r, n, i) {
|
|
1053
|
+
var o = Ai(e, t, n, i);
|
|
1054
|
+
try {
|
|
1055
|
+
return r.apply(n, i);
|
|
1056
|
+
} catch (s) {
|
|
1057
|
+
throw o.error_ = s, s;
|
|
1058
|
+
} finally {
|
|
1059
|
+
Si(o);
|
|
1060
|
+
}
|
|
1061
|
+
}
|
|
1062
|
+
function Ai(e, t, r, n) {
|
|
1063
|
+
var i = process.env.NODE_ENV !== "production" && w() && !!e, o = 0;
|
|
1064
|
+
if (process.env.NODE_ENV !== "production" && i) {
|
|
1065
|
+
o = Date.now();
|
|
1066
|
+
var s = n ? Array.from(n) : et;
|
|
1067
|
+
R({
|
|
1068
|
+
type: qt,
|
|
1069
|
+
name: e,
|
|
1070
|
+
object: r,
|
|
1071
|
+
arguments: s
|
|
1072
|
+
});
|
|
1073
|
+
}
|
|
1074
|
+
var a = l.trackingDerivation, u = !t || !a;
|
|
1075
|
+
U();
|
|
1076
|
+
var f = l.allowStateChanges;
|
|
1077
|
+
u && (me(), f = Ft(!0));
|
|
1078
|
+
var d = Gt(!0), p = {
|
|
1079
|
+
runAsAction_: u,
|
|
1080
|
+
prevDerivation_: a,
|
|
1081
|
+
prevAllowStateChanges_: f,
|
|
1082
|
+
prevAllowStateReads_: d,
|
|
1083
|
+
notifySpy_: i,
|
|
1084
|
+
startTime_: o,
|
|
1085
|
+
actionId_: yi++,
|
|
1086
|
+
parentActionId_: rt
|
|
1087
|
+
};
|
|
1088
|
+
return rt = p.actionId_, p;
|
|
1089
|
+
}
|
|
1090
|
+
function Si(e) {
|
|
1091
|
+
rt !== e.actionId_ && _(30), rt = e.parentActionId_, e.error_ !== void 0 && (l.suppressReactionErrors = !0), Kt(e.prevAllowStateChanges_), Le(e.prevAllowStateReads_), I(), e.runAsAction_ && ie(e.prevDerivation_), process.env.NODE_ENV !== "production" && e.notifySpy_ && C({
|
|
1092
|
+
time: Date.now() - e.startTime_
|
|
1093
|
+
}), l.suppressReactionErrors = !1;
|
|
1094
|
+
}
|
|
1095
|
+
function Ft(e) {
|
|
1096
|
+
var t = l.allowStateChanges;
|
|
1097
|
+
return l.allowStateChanges = e, t;
|
|
1098
|
+
}
|
|
1099
|
+
function Kt(e) {
|
|
1100
|
+
l.allowStateChanges = e;
|
|
1101
|
+
}
|
|
1102
|
+
var wi = "create", de = /* @__PURE__ */ (function(e) {
|
|
1103
|
+
function t(n, i, o, s, a) {
|
|
1104
|
+
var u;
|
|
1105
|
+
if (o === void 0 && (o = process.env.NODE_ENV !== "production" ? "ObservableValue@" + Y() : "ObservableValue"), s === void 0 && (s = !0), a === void 0 && (a = tt.default), u = e.call(this, o) || this, u.enhancer = void 0, u.name_ = void 0, u.equals = void 0, u.hasUnreportedChange_ = !1, u.interceptors_ = void 0, u.changeListeners_ = void 0, u.value_ = void 0, u.dehancer = void 0, u.enhancer = i, u.name_ = o, u.equals = a, u.value_ = i(n, void 0, o), process.env.NODE_ENV !== "production" && s && w()) {
|
|
1106
|
+
var f;
|
|
1107
|
+
pe({
|
|
1108
|
+
type: wi,
|
|
1109
|
+
object: u,
|
|
1110
|
+
observableKind: "value",
|
|
1111
|
+
debugObjectName: u.name_,
|
|
1112
|
+
newValue: "" + ((f = u.value_) == null ? void 0 : f.toString())
|
|
1113
|
+
});
|
|
1114
|
+
}
|
|
1115
|
+
return u;
|
|
1116
|
+
}
|
|
1117
|
+
Vn(t, e);
|
|
1118
|
+
var r = t.prototype;
|
|
1119
|
+
return r.dehanceValue = function(i) {
|
|
1120
|
+
return this.dehancer !== void 0 ? this.dehancer(i) : i;
|
|
1121
|
+
}, r.set = function(i) {
|
|
1122
|
+
var o = this.value_;
|
|
1123
|
+
if (i = this.prepareNewValue_(i), i !== l.UNCHANGED) {
|
|
1124
|
+
var s = w();
|
|
1125
|
+
process.env.NODE_ENV !== "production" && s && R({
|
|
1126
|
+
type: K,
|
|
1127
|
+
object: this,
|
|
1128
|
+
observableKind: "value",
|
|
1129
|
+
debugObjectName: this.name_,
|
|
1130
|
+
newValue: i,
|
|
1131
|
+
oldValue: o
|
|
1132
|
+
}), this.setNewValue_(i), process.env.NODE_ENV !== "production" && s && C();
|
|
1133
|
+
}
|
|
1134
|
+
}, r.prepareNewValue_ = function(i) {
|
|
1135
|
+
if (J(this), L(this)) {
|
|
1136
|
+
var o = B(this, {
|
|
1137
|
+
object: this,
|
|
1138
|
+
type: K,
|
|
1139
|
+
newValue: i
|
|
1140
|
+
});
|
|
1141
|
+
if (!o)
|
|
1142
|
+
return l.UNCHANGED;
|
|
1143
|
+
i = o.newValue;
|
|
1144
|
+
}
|
|
1145
|
+
return i = this.enhancer(i, this.value_, this.name_), this.equals(this.value_, i) ? l.UNCHANGED : i;
|
|
1146
|
+
}, r.setNewValue_ = function(i) {
|
|
1147
|
+
var o = this.value_;
|
|
1148
|
+
this.value_ = i, this.reportChanged(), q(this) && z(this, {
|
|
1149
|
+
type: K,
|
|
1150
|
+
object: this,
|
|
1151
|
+
newValue: i,
|
|
1152
|
+
oldValue: o
|
|
1153
|
+
});
|
|
1154
|
+
}, r.get = function() {
|
|
1155
|
+
return this.reportObserved(), this.dehanceValue(this.value_);
|
|
1156
|
+
}, r.intercept_ = function(i) {
|
|
1157
|
+
return qe(this, i);
|
|
1158
|
+
}, r.observe_ = function(i, o) {
|
|
1159
|
+
return o && i({
|
|
1160
|
+
observableKind: "value",
|
|
1161
|
+
debugObjectName: this.name_,
|
|
1162
|
+
object: this,
|
|
1163
|
+
type: K,
|
|
1164
|
+
newValue: this.value_,
|
|
1165
|
+
oldValue: void 0
|
|
1166
|
+
}), ze(this, i);
|
|
1167
|
+
}, r.raw = function() {
|
|
1168
|
+
return this.value_;
|
|
1169
|
+
}, r.toJSON = function() {
|
|
1170
|
+
return this.get();
|
|
1171
|
+
}, r.toString = function() {
|
|
1172
|
+
return this.name_ + "[" + this.value_ + "]";
|
|
1173
|
+
}, r.valueOf = function() {
|
|
1174
|
+
return jn(this.get());
|
|
1175
|
+
}, r[Symbol.toPrimitive] = function() {
|
|
1176
|
+
return this.valueOf();
|
|
1177
|
+
}, t;
|
|
1178
|
+
})(ue), F = /* @__PURE__ */ (function() {
|
|
1179
|
+
function e(r) {
|
|
1180
|
+
this.dependenciesState_ = b.NOT_TRACKING_, this.observing_ = [], this.newObserving_ = null, this.observers_ = /* @__PURE__ */ new Set(), this.runId_ = 0, this.lastAccessedBy_ = 0, this.lowestObserverState_ = b.UP_TO_DATE_, this.unboundDepsCount_ = 0, this.value_ = new it(null), this.name_ = void 0, this.triggeredBy_ = void 0, this.flags_ = 0, this.derivation = void 0, this.setter_ = void 0, this.isTracing_ = $.NONE, this.scope_ = void 0, this.equals_ = void 0, this.requiresReaction_ = void 0, this.keepAlive_ = void 0, this.onBOL = void 0, this.onBUOL = void 0, r.get || _(31), this.derivation = r.get, this.name_ = r.name || (process.env.NODE_ENV !== "production" ? "ComputedValue@" + Y() : "ComputedValue"), r.set && (this.setter_ = he(process.env.NODE_ENV !== "production" ? this.name_ + "-setter" : "ComputedValue-setter", r.set)), this.equals_ = r.equals || (r.compareStructural || r.struct ? tt.structural : tt.default), this.scope_ = r.context, this.requiresReaction_ = r.requiresReaction, this.keepAlive_ = !!r.keepAlive;
|
|
1181
|
+
}
|
|
1182
|
+
var t = e.prototype;
|
|
1183
|
+
return t.onBecomeStale_ = function() {
|
|
1184
|
+
Pi(this);
|
|
1185
|
+
}, t.onBO = function() {
|
|
1186
|
+
this.onBOL && this.onBOL.forEach(function(n) {
|
|
1187
|
+
return n();
|
|
1188
|
+
});
|
|
1189
|
+
}, t.onBUO = function() {
|
|
1190
|
+
this.onBUOL && this.onBUOL.forEach(function(n) {
|
|
1191
|
+
return n();
|
|
1192
|
+
});
|
|
1193
|
+
}, t.get = function() {
|
|
1194
|
+
if (this.isComputing && _(32, this.name_, this.derivation), l.inBatch === 0 && // !globalState.trackingDerivatpion &&
|
|
1195
|
+
this.observers_.size === 0 && !this.keepAlive_)
|
|
1196
|
+
Pt(this) && (this.warnAboutUntrackedRead_(), U(), this.value_ = this.computeValue_(!1), I());
|
|
1197
|
+
else if (Gn(this), Pt(this)) {
|
|
1198
|
+
var n = l.trackingContext;
|
|
1199
|
+
this.keepAlive_ && !n && (l.trackingContext = this), this.trackAndCompute() && xi(this), l.trackingContext = n;
|
|
1200
|
+
}
|
|
1201
|
+
var i = this.value_;
|
|
1202
|
+
if (Ze(i))
|
|
1203
|
+
throw i.cause;
|
|
1204
|
+
return i;
|
|
1205
|
+
}, t.set = function(n) {
|
|
1206
|
+
if (this.setter_) {
|
|
1207
|
+
this.isRunningSetter && _(33, this.name_), this.isRunningSetter = !0;
|
|
1208
|
+
try {
|
|
1209
|
+
this.setter_.call(this.scope_, n);
|
|
1210
|
+
} finally {
|
|
1211
|
+
this.isRunningSetter = !1;
|
|
1212
|
+
}
|
|
1213
|
+
} else
|
|
1214
|
+
_(34, this.name_);
|
|
1215
|
+
}, t.trackAndCompute = function() {
|
|
1216
|
+
var n = this.value_, i = (
|
|
1217
|
+
/* see #1208 */
|
|
1218
|
+
this.dependenciesState_ === b.NOT_TRACKING_
|
|
1219
|
+
), o = this.computeValue_(!0), s = i || Ze(n) || Ze(o) || !this.equals_(n, o);
|
|
1220
|
+
return s && (this.value_ = o, process.env.NODE_ENV !== "production" && w() && pe({
|
|
1221
|
+
observableKind: "computed",
|
|
1222
|
+
debugObjectName: this.name_,
|
|
1223
|
+
object: this.scope_,
|
|
1224
|
+
type: "update",
|
|
1225
|
+
oldValue: n,
|
|
1226
|
+
newValue: o
|
|
1227
|
+
})), s;
|
|
1228
|
+
}, t.computeValue_ = function(n) {
|
|
1229
|
+
this.isComputing = !0;
|
|
1230
|
+
var i = Ft(!1), o;
|
|
1231
|
+
if (n)
|
|
1232
|
+
o = Un(this, this.derivation, this.scope_);
|
|
1233
|
+
else if (l.disableErrorBoundaries === !0)
|
|
1234
|
+
o = this.derivation.call(this.scope_);
|
|
1235
|
+
else
|
|
1236
|
+
try {
|
|
1237
|
+
o = this.derivation.call(this.scope_);
|
|
1238
|
+
} catch (s) {
|
|
1239
|
+
o = new it(s);
|
|
1240
|
+
}
|
|
1241
|
+
return Kt(i), this.isComputing = !1, o;
|
|
1242
|
+
}, t.suspend_ = function() {
|
|
1243
|
+
this.keepAlive_ || (Rt(this), this.value_ = void 0, process.env.NODE_ENV !== "production" && this.isTracing_ !== $.NONE && console.log("[mobx.trace] Computed value '" + this.name_ + "' was suspended and it will recompute on the next access."));
|
|
1244
|
+
}, t.observe_ = function(n, i) {
|
|
1245
|
+
var o = this, s = !0, a = void 0;
|
|
1246
|
+
return Fi(function() {
|
|
1247
|
+
var u = o.get();
|
|
1248
|
+
if (!s || i) {
|
|
1249
|
+
var f = me();
|
|
1250
|
+
n({
|
|
1251
|
+
observableKind: "computed",
|
|
1252
|
+
debugObjectName: o.name_,
|
|
1253
|
+
type: K,
|
|
1254
|
+
object: o,
|
|
1255
|
+
newValue: u,
|
|
1256
|
+
oldValue: a
|
|
1257
|
+
}), ie(f);
|
|
1258
|
+
}
|
|
1259
|
+
s = !1, a = u;
|
|
1260
|
+
});
|
|
1261
|
+
}, t.warnAboutUntrackedRead_ = function() {
|
|
1262
|
+
process.env.NODE_ENV !== "production" && (this.isTracing_ !== $.NONE && console.log("[mobx.trace] Computed value '" + this.name_ + "' is being read outside a reactive context. Doing a full recompute."), (typeof this.requiresReaction_ == "boolean" ? this.requiresReaction_ : l.computedRequiresReaction) && console.warn("[mobx] Computed value '" + this.name_ + "' is being read outside a reactive context. Doing a full recompute."));
|
|
1263
|
+
}, t.toString = function() {
|
|
1264
|
+
return this.name_ + "[" + this.derivation.toString() + "]";
|
|
1265
|
+
}, t.valueOf = function() {
|
|
1266
|
+
return jn(this.get());
|
|
1267
|
+
}, t[Symbol.toPrimitive] = function() {
|
|
1268
|
+
return this.valueOf();
|
|
1269
|
+
}, Te(e, [{
|
|
1270
|
+
key: "isComputing",
|
|
1271
|
+
get: function() {
|
|
1272
|
+
return T(this.flags_, e.isComputingMask_);
|
|
1273
|
+
},
|
|
1274
|
+
set: function(n) {
|
|
1275
|
+
this.flags_ = x(this.flags_, e.isComputingMask_, n);
|
|
1276
|
+
}
|
|
1277
|
+
}, {
|
|
1278
|
+
key: "isRunningSetter",
|
|
1279
|
+
get: function() {
|
|
1280
|
+
return T(this.flags_, e.isRunningSetterMask_);
|
|
1281
|
+
},
|
|
1282
|
+
set: function(n) {
|
|
1283
|
+
this.flags_ = x(this.flags_, e.isRunningSetterMask_, n);
|
|
1284
|
+
}
|
|
1285
|
+
}, {
|
|
1286
|
+
key: "isBeingObserved",
|
|
1287
|
+
get: function() {
|
|
1288
|
+
return T(this.flags_, e.isBeingObservedMask_);
|
|
1289
|
+
},
|
|
1290
|
+
set: function(n) {
|
|
1291
|
+
this.flags_ = x(this.flags_, e.isBeingObservedMask_, n);
|
|
1292
|
+
}
|
|
1293
|
+
}, {
|
|
1294
|
+
key: "isPendingUnobservation",
|
|
1295
|
+
get: function() {
|
|
1296
|
+
return T(this.flags_, e.isPendingUnobservationMask_);
|
|
1297
|
+
},
|
|
1298
|
+
set: function(n) {
|
|
1299
|
+
this.flags_ = x(this.flags_, e.isPendingUnobservationMask_, n);
|
|
1300
|
+
}
|
|
1301
|
+
}, {
|
|
1302
|
+
key: "diffValue",
|
|
1303
|
+
get: function() {
|
|
1304
|
+
return T(this.flags_, e.diffValueMask_) ? 1 : 0;
|
|
1305
|
+
},
|
|
1306
|
+
set: function(n) {
|
|
1307
|
+
this.flags_ = x(this.flags_, e.diffValueMask_, n === 1);
|
|
1308
|
+
}
|
|
1309
|
+
}]);
|
|
1310
|
+
})();
|
|
1311
|
+
F.isComputingMask_ = 1;
|
|
1312
|
+
F.isRunningSetterMask_ = 2;
|
|
1313
|
+
F.isBeingObservedMask_ = 4;
|
|
1314
|
+
F.isPendingUnobservationMask_ = 8;
|
|
1315
|
+
F.diffValueMask_ = 16;
|
|
1316
|
+
var pt = /* @__PURE__ */ ge("ComputedValue", F), b;
|
|
1317
|
+
(function(e) {
|
|
1318
|
+
e[e.NOT_TRACKING_ = -1] = "NOT_TRACKING_", e[e.UP_TO_DATE_ = 0] = "UP_TO_DATE_", e[e.POSSIBLY_STALE_ = 1] = "POSSIBLY_STALE_", e[e.STALE_ = 2] = "STALE_";
|
|
1319
|
+
})(b || (b = {}));
|
|
1320
|
+
var $;
|
|
1321
|
+
(function(e) {
|
|
1322
|
+
e[e.NONE = 0] = "NONE", e[e.LOG = 1] = "LOG", e[e.BREAK = 2] = "BREAK";
|
|
1323
|
+
})($ || ($ = {}));
|
|
1324
|
+
var it = function(t) {
|
|
1325
|
+
this.cause = void 0, this.cause = t;
|
|
1326
|
+
};
|
|
1327
|
+
function Ze(e) {
|
|
1328
|
+
return e instanceof it;
|
|
1329
|
+
}
|
|
1330
|
+
function Pt(e) {
|
|
1331
|
+
switch (e.dependenciesState_) {
|
|
1332
|
+
case b.UP_TO_DATE_:
|
|
1333
|
+
return !1;
|
|
1334
|
+
case b.NOT_TRACKING_:
|
|
1335
|
+
case b.STALE_:
|
|
1336
|
+
return !0;
|
|
1337
|
+
case b.POSSIBLY_STALE_: {
|
|
1338
|
+
for (var t = Gt(!0), r = me(), n = e.observing_, i = n.length, o = 0; o < i; o++) {
|
|
1339
|
+
var s = n[o];
|
|
1340
|
+
if (pt(s)) {
|
|
1341
|
+
if (l.disableErrorBoundaries)
|
|
1342
|
+
s.get();
|
|
1343
|
+
else
|
|
1344
|
+
try {
|
|
1345
|
+
s.get();
|
|
1346
|
+
} catch {
|
|
1347
|
+
return ie(r), Le(t), !0;
|
|
1348
|
+
}
|
|
1349
|
+
if (e.dependenciesState_ === b.STALE_)
|
|
1350
|
+
return ie(r), Le(t), !0;
|
|
1351
|
+
}
|
|
1352
|
+
}
|
|
1353
|
+
return $n(e), ie(r), Le(t), !1;
|
|
1354
|
+
}
|
|
1355
|
+
}
|
|
1356
|
+
}
|
|
1357
|
+
function J(e) {
|
|
1358
|
+
if (process.env.NODE_ENV !== "production") {
|
|
1359
|
+
var t = e.observers_.size > 0;
|
|
1360
|
+
!l.allowStateChanges && (t || l.enforceActions === "always") && console.warn("[MobX] " + (l.enforceActions ? "Since strict-mode is enabled, changing (observed) observable values without using an action is not allowed. Tried to modify: " : "Side effects like changing state are not allowed at this point. Are you trying to modify state from, for example, a computed value or the render function of a React component? You can wrap side effects in 'runInAction' (or decorate functions with 'action') if needed. Tried to modify: ") + e.name_);
|
|
1361
|
+
}
|
|
1362
|
+
}
|
|
1363
|
+
function Di(e) {
|
|
1364
|
+
process.env.NODE_ENV !== "production" && !l.allowStateReads && l.observableRequiresReaction && console.warn("[mobx] Observable '" + e.name_ + "' being read outside a reactive context.");
|
|
1365
|
+
}
|
|
1366
|
+
function Un(e, t, r) {
|
|
1367
|
+
var n = Gt(!0);
|
|
1368
|
+
$n(e), e.newObserving_ = new Array(
|
|
1369
|
+
// Reserve constant space for initial dependencies, dynamic space otherwise.
|
|
1370
|
+
// See https://github.com/mobxjs/mobx/pull/3833
|
|
1371
|
+
e.runId_ === 0 ? 100 : e.observing_.length
|
|
1372
|
+
), e.unboundDepsCount_ = 0, e.runId_ = ++l.runId;
|
|
1373
|
+
var i = l.trackingDerivation;
|
|
1374
|
+
l.trackingDerivation = e, l.inBatch++;
|
|
1375
|
+
var o;
|
|
1376
|
+
if (l.disableErrorBoundaries === !0)
|
|
1377
|
+
o = t.call(r);
|
|
1378
|
+
else
|
|
1379
|
+
try {
|
|
1380
|
+
o = t.call(r);
|
|
1381
|
+
} catch (s) {
|
|
1382
|
+
o = new it(s);
|
|
1383
|
+
}
|
|
1384
|
+
return l.inBatch--, l.trackingDerivation = i, Vi(e), ji(e), Le(n), o;
|
|
1385
|
+
}
|
|
1386
|
+
function ji(e) {
|
|
1387
|
+
process.env.NODE_ENV !== "production" && e.observing_.length === 0 && (typeof e.requiresObservable_ == "boolean" ? e.requiresObservable_ : l.reactionRequiresObservable) && console.warn("[mobx] Derivation '" + e.name_ + "' is created/updated without reading any observable value.");
|
|
1388
|
+
}
|
|
1389
|
+
function Vi(e) {
|
|
1390
|
+
for (var t = e.observing_, r = e.observing_ = e.newObserving_, n = b.UP_TO_DATE_, i = 0, o = e.unboundDepsCount_, s = 0; s < o; s++) {
|
|
1391
|
+
var a = r[s];
|
|
1392
|
+
a.diffValue === 0 && (a.diffValue = 1, i !== s && (r[i] = a), i++), a.dependenciesState_ > n && (n = a.dependenciesState_);
|
|
1393
|
+
}
|
|
1394
|
+
for (r.length = i, e.newObserving_ = null, o = t.length; o--; ) {
|
|
1395
|
+
var u = t[o];
|
|
1396
|
+
u.diffValue === 0 && Fn(u, e), u.diffValue = 0;
|
|
1397
|
+
}
|
|
1398
|
+
for (; i--; ) {
|
|
1399
|
+
var f = r[i];
|
|
1400
|
+
f.diffValue === 1 && (f.diffValue = 0, Ti(f, e));
|
|
1401
|
+
}
|
|
1402
|
+
n !== b.UP_TO_DATE_ && (e.dependenciesState_ = n, e.onBecomeStale_());
|
|
1403
|
+
}
|
|
1404
|
+
function Rt(e) {
|
|
1405
|
+
var t = e.observing_;
|
|
1406
|
+
e.observing_ = [];
|
|
1407
|
+
for (var r = t.length; r--; )
|
|
1408
|
+
Fn(t[r], e);
|
|
1409
|
+
e.dependenciesState_ = b.NOT_TRACKING_;
|
|
1410
|
+
}
|
|
1411
|
+
function In(e) {
|
|
1412
|
+
var t = me();
|
|
1413
|
+
try {
|
|
1414
|
+
return e();
|
|
1415
|
+
} finally {
|
|
1416
|
+
ie(t);
|
|
1417
|
+
}
|
|
1418
|
+
}
|
|
1419
|
+
function me() {
|
|
1420
|
+
var e = l.trackingDerivation;
|
|
1421
|
+
return l.trackingDerivation = null, e;
|
|
1422
|
+
}
|
|
1423
|
+
function ie(e) {
|
|
1424
|
+
l.trackingDerivation = e;
|
|
1425
|
+
}
|
|
1426
|
+
function Gt(e) {
|
|
1427
|
+
var t = l.allowStateReads;
|
|
1428
|
+
return l.allowStateReads = e, t;
|
|
1429
|
+
}
|
|
1430
|
+
function Le(e) {
|
|
1431
|
+
l.allowStateReads = e;
|
|
1432
|
+
}
|
|
1433
|
+
function $n(e) {
|
|
1434
|
+
if (e.dependenciesState_ !== b.UP_TO_DATE_) {
|
|
1435
|
+
e.dependenciesState_ = b.UP_TO_DATE_;
|
|
1436
|
+
for (var t = e.observing_, r = t.length; r--; )
|
|
1437
|
+
t[r].lowestObserverState_ = b.UP_TO_DATE_;
|
|
1438
|
+
}
|
|
1439
|
+
}
|
|
1440
|
+
var Nt = function() {
|
|
1441
|
+
this.version = 6, 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.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.useProxies = !0, this.verifyProxies = !1, this.safeDescriptors = !0;
|
|
1442
|
+
}, At = !0, l = /* @__PURE__ */ (function() {
|
|
1443
|
+
var e = /* @__PURE__ */ Bt();
|
|
1444
|
+
return e.__mobxInstanceCount > 0 && !e.__mobxGlobals && (At = !1), e.__mobxGlobals && e.__mobxGlobals.version !== new Nt().version && (At = !1), At ? e.__mobxGlobals ? (e.__mobxInstanceCount += 1, e.__mobxGlobals.UNCHANGED || (e.__mobxGlobals.UNCHANGED = {}), e.__mobxGlobals) : (e.__mobxInstanceCount = 1, e.__mobxGlobals = /* @__PURE__ */ new Nt()) : (setTimeout(function() {
|
|
1445
|
+
_(35);
|
|
1446
|
+
}, 1), new Nt());
|
|
1447
|
+
})();
|
|
1448
|
+
function Ti(e, t) {
|
|
1449
|
+
e.observers_.add(t), e.lowestObserverState_ > t.dependenciesState_ && (e.lowestObserverState_ = t.dependenciesState_);
|
|
1450
|
+
}
|
|
1451
|
+
function Fn(e, t) {
|
|
1452
|
+
e.observers_.delete(t), e.observers_.size === 0 && Kn(e);
|
|
1453
|
+
}
|
|
1454
|
+
function Kn(e) {
|
|
1455
|
+
e.isPendingUnobservation === !1 && (e.isPendingUnobservation = !0, l.pendingUnobservations.push(e));
|
|
1456
|
+
}
|
|
1457
|
+
function U() {
|
|
1458
|
+
l.inBatch++;
|
|
1459
|
+
}
|
|
1460
|
+
function I() {
|
|
1461
|
+
if (--l.inBatch === 0) {
|
|
1462
|
+
Wn();
|
|
1463
|
+
for (var e = l.pendingUnobservations, t = 0; t < e.length; t++) {
|
|
1464
|
+
var r = e[t];
|
|
1465
|
+
r.isPendingUnobservation = !1, r.observers_.size === 0 && (r.isBeingObserved && (r.isBeingObserved = !1, r.onBUO()), r instanceof F && r.suspend_());
|
|
1466
|
+
}
|
|
1467
|
+
l.pendingUnobservations = [];
|
|
1468
|
+
}
|
|
1469
|
+
}
|
|
1470
|
+
function Gn(e) {
|
|
1471
|
+
Di(e);
|
|
1472
|
+
var t = l.trackingDerivation;
|
|
1473
|
+
return t !== null ? (t.runId_ !== e.lastAccessedBy_ && (e.lastAccessedBy_ = t.runId_, t.newObserving_[t.unboundDepsCount_++] = e, !e.isBeingObserved && l.trackingContext && (e.isBeingObserved = !0, e.onBO())), e.isBeingObserved) : (e.observers_.size === 0 && l.inBatch > 0 && Kn(e), !1);
|
|
1474
|
+
}
|
|
1475
|
+
function qn(e) {
|
|
1476
|
+
e.lowestObserverState_ !== b.STALE_ && (e.lowestObserverState_ = b.STALE_, e.observers_.forEach(function(t) {
|
|
1477
|
+
t.dependenciesState_ === b.UP_TO_DATE_ && (process.env.NODE_ENV !== "production" && t.isTracing_ !== $.NONE && zn(t, e), t.onBecomeStale_()), t.dependenciesState_ = b.STALE_;
|
|
1478
|
+
}));
|
|
1479
|
+
}
|
|
1480
|
+
function xi(e) {
|
|
1481
|
+
e.lowestObserverState_ !== b.STALE_ && (e.lowestObserverState_ = b.STALE_, e.observers_.forEach(function(t) {
|
|
1482
|
+
t.dependenciesState_ === b.POSSIBLY_STALE_ ? (t.dependenciesState_ = b.STALE_, process.env.NODE_ENV !== "production" && t.isTracing_ !== $.NONE && zn(t, e)) : t.dependenciesState_ === b.UP_TO_DATE_ && (e.lowestObserverState_ = b.UP_TO_DATE_);
|
|
1483
|
+
}));
|
|
1484
|
+
}
|
|
1485
|
+
function Pi(e) {
|
|
1486
|
+
e.lowestObserverState_ === b.UP_TO_DATE_ && (e.lowestObserverState_ = b.POSSIBLY_STALE_, e.observers_.forEach(function(t) {
|
|
1487
|
+
t.dependenciesState_ === b.UP_TO_DATE_ && (t.dependenciesState_ = b.POSSIBLY_STALE_, t.onBecomeStale_());
|
|
1488
|
+
}));
|
|
1489
|
+
}
|
|
1490
|
+
function zn(e, t) {
|
|
1491
|
+
if (console.log("[mobx.trace] '" + e.name_ + "' is invalidated due to a change in: '" + t.name_ + "'"), e.isTracing_ === $.BREAK) {
|
|
1492
|
+
var r = [];
|
|
1493
|
+
Yn(Wi(e), r, 1), new Function(`debugger;
|
|
1494
|
+
/*
|
|
1495
|
+
Tracing '` + e.name_ + `'
|
|
1496
|
+
|
|
1497
|
+
You are entering this break point because derivation '` + e.name_ + "' is being traced and '" + t.name_ + `' is now forcing it to update.
|
|
1498
|
+
Just follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update
|
|
1499
|
+
The stackframe you are looking for is at least ~6-8 stack-frames up.
|
|
1500
|
+
|
|
1501
|
+
` + (e instanceof F ? e.derivation.toString().replace(/[*]\//g, "/") : "") + `
|
|
1502
|
+
|
|
1503
|
+
The dependencies for this derivation are:
|
|
1504
|
+
|
|
1505
|
+
` + r.join(`
|
|
1506
|
+
`) + `
|
|
1507
|
+
*/
|
|
1508
|
+
`)();
|
|
1509
|
+
}
|
|
1510
|
+
}
|
|
1511
|
+
function Yn(e, t, r) {
|
|
1512
|
+
if (t.length >= 1e3) {
|
|
1513
|
+
t.push("(and many more)");
|
|
1514
|
+
return;
|
|
1515
|
+
}
|
|
1516
|
+
t.push("" + " ".repeat(r - 1) + e.name), e.dependencies && e.dependencies.forEach(function(n) {
|
|
1517
|
+
return Yn(n, t, r + 1);
|
|
1518
|
+
});
|
|
1519
|
+
}
|
|
1520
|
+
var ae = /* @__PURE__ */ (function() {
|
|
1521
|
+
function e(r, n, i, o) {
|
|
1522
|
+
r === void 0 && (r = process.env.NODE_ENV !== "production" ? "Reaction@" + Y() : "Reaction"), this.name_ = void 0, this.onInvalidate_ = void 0, this.errorHandler_ = void 0, this.requiresObservable_ = void 0, this.observing_ = [], this.newObserving_ = [], this.dependenciesState_ = b.NOT_TRACKING_, this.runId_ = 0, this.unboundDepsCount_ = 0, this.flags_ = 0, this.isTracing_ = $.NONE, this.name_ = r, this.onInvalidate_ = n, this.errorHandler_ = i, this.requiresObservable_ = o;
|
|
1523
|
+
}
|
|
1524
|
+
var t = e.prototype;
|
|
1525
|
+
return t.onBecomeStale_ = function() {
|
|
1526
|
+
this.schedule_();
|
|
1527
|
+
}, t.schedule_ = function() {
|
|
1528
|
+
this.isScheduled || (this.isScheduled = !0, l.pendingReactions.push(this), Wn());
|
|
1529
|
+
}, t.runReaction_ = function() {
|
|
1530
|
+
if (!this.isDisposed) {
|
|
1531
|
+
U(), this.isScheduled = !1;
|
|
1532
|
+
var n = l.trackingContext;
|
|
1533
|
+
if (l.trackingContext = this, Pt(this)) {
|
|
1534
|
+
this.isTrackPending = !0;
|
|
1535
|
+
try {
|
|
1536
|
+
this.onInvalidate_(), process.env.NODE_ENV !== "production" && this.isTrackPending && w() && pe({
|
|
1537
|
+
name: this.name_,
|
|
1538
|
+
type: "scheduled-reaction"
|
|
1539
|
+
});
|
|
1540
|
+
} catch (i) {
|
|
1541
|
+
this.reportExceptionInDerivation_(i);
|
|
1542
|
+
}
|
|
1543
|
+
}
|
|
1544
|
+
l.trackingContext = n, I();
|
|
1545
|
+
}
|
|
1546
|
+
}, t.track = function(n) {
|
|
1547
|
+
if (!this.isDisposed) {
|
|
1548
|
+
U();
|
|
1549
|
+
var i = w(), o;
|
|
1550
|
+
process.env.NODE_ENV !== "production" && i && (o = Date.now(), R({
|
|
1551
|
+
name: this.name_,
|
|
1552
|
+
type: "reaction"
|
|
1553
|
+
})), this.isRunning = !0;
|
|
1554
|
+
var s = l.trackingContext;
|
|
1555
|
+
l.trackingContext = this;
|
|
1556
|
+
var a = Un(this, n, void 0);
|
|
1557
|
+
l.trackingContext = s, this.isRunning = !1, this.isTrackPending = !1, this.isDisposed && Rt(this), Ze(a) && this.reportExceptionInDerivation_(a.cause), process.env.NODE_ENV !== "production" && i && C({
|
|
1558
|
+
time: Date.now() - o
|
|
1559
|
+
}), I();
|
|
1560
|
+
}
|
|
1561
|
+
}, t.reportExceptionInDerivation_ = function(n) {
|
|
1562
|
+
var i = this;
|
|
1563
|
+
if (this.errorHandler_) {
|
|
1564
|
+
this.errorHandler_(n, this);
|
|
1565
|
+
return;
|
|
1566
|
+
}
|
|
1567
|
+
if (l.disableErrorBoundaries)
|
|
1568
|
+
throw n;
|
|
1569
|
+
var o = process.env.NODE_ENV !== "production" ? "[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '" + this + "'" : "[mobx] uncaught error in '" + this + "'";
|
|
1570
|
+
l.suppressReactionErrors ? process.env.NODE_ENV !== "production" && console.warn("[mobx] (error in reaction '" + this.name_ + "' suppressed, fix error of causing action below)") : console.error(o, n), process.env.NODE_ENV !== "production" && w() && pe({
|
|
1571
|
+
type: "error",
|
|
1572
|
+
name: this.name_,
|
|
1573
|
+
message: o,
|
|
1574
|
+
error: "" + n
|
|
1575
|
+
}), l.globalReactionErrorHandlers.forEach(function(s) {
|
|
1576
|
+
return s(n, i);
|
|
1577
|
+
});
|
|
1578
|
+
}, t.dispose = function() {
|
|
1579
|
+
this.isDisposed || (this.isDisposed = !0, this.isRunning || (U(), Rt(this), I()));
|
|
1580
|
+
}, t.getDisposer_ = function(n) {
|
|
1581
|
+
var i = this, o = function s() {
|
|
1582
|
+
i.dispose(), n == null || n.removeEventListener == null || n.removeEventListener("abort", s);
|
|
1583
|
+
};
|
|
1584
|
+
return n == null || n.addEventListener == null || n.addEventListener("abort", o), o[v] = this, "dispose" in Symbol && typeof Symbol.dispose == "symbol" && (o[Symbol.dispose] = o), o;
|
|
1585
|
+
}, t.toString = function() {
|
|
1586
|
+
return "Reaction[" + this.name_ + "]";
|
|
1587
|
+
}, t.trace = function(n) {
|
|
1588
|
+
n === void 0 && (n = !1), Qi(this, n);
|
|
1589
|
+
}, Te(e, [{
|
|
1590
|
+
key: "isDisposed",
|
|
1591
|
+
get: function() {
|
|
1592
|
+
return T(this.flags_, e.isDisposedMask_);
|
|
1593
|
+
},
|
|
1594
|
+
set: function(n) {
|
|
1595
|
+
this.flags_ = x(this.flags_, e.isDisposedMask_, n);
|
|
1596
|
+
}
|
|
1597
|
+
}, {
|
|
1598
|
+
key: "isScheduled",
|
|
1599
|
+
get: function() {
|
|
1600
|
+
return T(this.flags_, e.isScheduledMask_);
|
|
1601
|
+
},
|
|
1602
|
+
set: function(n) {
|
|
1603
|
+
this.flags_ = x(this.flags_, e.isScheduledMask_, n);
|
|
1604
|
+
}
|
|
1605
|
+
}, {
|
|
1606
|
+
key: "isTrackPending",
|
|
1607
|
+
get: function() {
|
|
1608
|
+
return T(this.flags_, e.isTrackPendingMask_);
|
|
1609
|
+
},
|
|
1610
|
+
set: function(n) {
|
|
1611
|
+
this.flags_ = x(this.flags_, e.isTrackPendingMask_, n);
|
|
1612
|
+
}
|
|
1613
|
+
}, {
|
|
1614
|
+
key: "isRunning",
|
|
1615
|
+
get: function() {
|
|
1616
|
+
return T(this.flags_, e.isRunningMask_);
|
|
1617
|
+
},
|
|
1618
|
+
set: function(n) {
|
|
1619
|
+
this.flags_ = x(this.flags_, e.isRunningMask_, n);
|
|
1620
|
+
}
|
|
1621
|
+
}, {
|
|
1622
|
+
key: "diffValue",
|
|
1623
|
+
get: function() {
|
|
1624
|
+
return T(this.flags_, e.diffValueMask_) ? 1 : 0;
|
|
1625
|
+
},
|
|
1626
|
+
set: function(n) {
|
|
1627
|
+
this.flags_ = x(this.flags_, e.diffValueMask_, n === 1);
|
|
1628
|
+
}
|
|
1629
|
+
}]);
|
|
1630
|
+
})();
|
|
1631
|
+
ae.isDisposedMask_ = 1;
|
|
1632
|
+
ae.isScheduledMask_ = 2;
|
|
1633
|
+
ae.isTrackPendingMask_ = 4;
|
|
1634
|
+
ae.isRunningMask_ = 8;
|
|
1635
|
+
ae.diffValueMask_ = 16;
|
|
1636
|
+
var cn = 100, Ri = function(t) {
|
|
1637
|
+
return t();
|
|
1638
|
+
};
|
|
1639
|
+
function Wn() {
|
|
1640
|
+
l.inBatch > 0 || l.isRunningReactions || Ri(Ci);
|
|
1641
|
+
}
|
|
1642
|
+
function Ci() {
|
|
1643
|
+
l.isRunningReactions = !0;
|
|
1644
|
+
for (var e = l.pendingReactions, t = 0; e.length > 0; ) {
|
|
1645
|
+
++t === cn && (console.error(process.env.NODE_ENV !== "production" ? "Reaction doesn't converge to a stable state after " + cn + " iterations." + (" Probably there is a cycle in the reactive function: " + e[0]) : "[mobx] cycle in reaction: " + e[0]), e.splice(0));
|
|
1646
|
+
for (var r = e.splice(0), n = 0, i = r.length; n < i; n++)
|
|
1647
|
+
r[n].runReaction_();
|
|
1648
|
+
}
|
|
1649
|
+
l.isRunningReactions = !1;
|
|
1650
|
+
}
|
|
1651
|
+
var ot = /* @__PURE__ */ ge("Reaction", ae);
|
|
1652
|
+
function w() {
|
|
1653
|
+
return process.env.NODE_ENV !== "production" && !!l.spyListeners.length;
|
|
1654
|
+
}
|
|
1655
|
+
function pe(e) {
|
|
1656
|
+
if (process.env.NODE_ENV !== "production" && l.spyListeners.length)
|
|
1657
|
+
for (var t = l.spyListeners, r = 0, n = t.length; r < n; r++)
|
|
1658
|
+
t[r](e);
|
|
1659
|
+
}
|
|
1660
|
+
function R(e) {
|
|
1661
|
+
if (process.env.NODE_ENV !== "production") {
|
|
1662
|
+
var t = se({}, e, {
|
|
1663
|
+
spyReportStart: !0
|
|
1664
|
+
});
|
|
1665
|
+
pe(t);
|
|
1666
|
+
}
|
|
1667
|
+
}
|
|
1668
|
+
var Mi = {
|
|
1669
|
+
type: "report-end",
|
|
1670
|
+
spyReportEnd: !0
|
|
1671
|
+
};
|
|
1672
|
+
function C(e) {
|
|
1673
|
+
process.env.NODE_ENV !== "production" && pe(e ? se({}, e, {
|
|
1674
|
+
type: "report-end",
|
|
1675
|
+
spyReportEnd: !0
|
|
1676
|
+
}) : Mi);
|
|
1677
|
+
}
|
|
1678
|
+
function ki(e) {
|
|
1679
|
+
return process.env.NODE_ENV === "production" ? (console.warn("[mobx.spy] Is a no-op in production builds"), function() {
|
|
1680
|
+
}) : (l.spyListeners.push(e), Ut(function() {
|
|
1681
|
+
l.spyListeners = l.spyListeners.filter(function(t) {
|
|
1682
|
+
return t !== e;
|
|
1683
|
+
});
|
|
1684
|
+
}));
|
|
1685
|
+
}
|
|
1686
|
+
var qt = "action", Li = "action.bound", Hn = "autoAction", Bi = "autoAction.bound", Ui = "<unnamed action>", Ct = /* @__PURE__ */ Ge(qt), Ii = /* @__PURE__ */ Ge(Li, {
|
|
1687
|
+
bound: !0
|
|
1688
|
+
}), Mt = /* @__PURE__ */ Ge(Hn, {
|
|
1689
|
+
autoAction: !0
|
|
1690
|
+
}), $i = /* @__PURE__ */ Ge(Bi, {
|
|
1691
|
+
autoAction: !0,
|
|
1692
|
+
bound: !0
|
|
1693
|
+
});
|
|
1694
|
+
function Xn(e) {
|
|
1695
|
+
var t = function(n, i) {
|
|
1696
|
+
if (A(n))
|
|
1697
|
+
return he(n.name || Ui, n, e);
|
|
1698
|
+
if (A(i))
|
|
1699
|
+
return he(n, i, e);
|
|
1700
|
+
if (Ke(i))
|
|
1701
|
+
return (e ? Mt : Ct).decorate_20223_(n, i);
|
|
1702
|
+
if (_e(i))
|
|
1703
|
+
return Fe(n, i, e ? Mt : Ct);
|
|
1704
|
+
if (_e(n))
|
|
1705
|
+
return Q(Ge(e ? Hn : qt, {
|
|
1706
|
+
name: n,
|
|
1707
|
+
autoAction: e
|
|
1708
|
+
}));
|
|
1709
|
+
process.env.NODE_ENV !== "production" && _("Invalid arguments for `action`");
|
|
1710
|
+
};
|
|
1711
|
+
return t;
|
|
1712
|
+
}
|
|
1713
|
+
var Se = /* @__PURE__ */ Xn(!1);
|
|
1714
|
+
Object.assign(Se, Ct);
|
|
1715
|
+
var Ue = /* @__PURE__ */ Xn(!0);
|
|
1716
|
+
Object.assign(Ue, Mt);
|
|
1717
|
+
Se.bound = /* @__PURE__ */ Q(Ii);
|
|
1718
|
+
Ue.bound = /* @__PURE__ */ Q($i);
|
|
1719
|
+
function be(e) {
|
|
1720
|
+
return A(e) && e.isMobxAction === !0;
|
|
1721
|
+
}
|
|
1722
|
+
function Fi(e, t) {
|
|
1723
|
+
var r, n, i, o;
|
|
1724
|
+
t === void 0 && (t = Nn), process.env.NODE_ENV !== "production" && (A(e) || _("Autorun expects a function as first argument"), be(e) && _("Autorun does not accept actions since actions are untrackable"));
|
|
1725
|
+
var s = (r = (n = t) == null ? void 0 : n.name) != null ? r : process.env.NODE_ENV !== "production" ? e.name || "Autorun@" + Y() : "Autorun", a = !t.scheduler && !t.delay, u;
|
|
1726
|
+
if (a)
|
|
1727
|
+
u = new ae(s, function() {
|
|
1728
|
+
this.track(p);
|
|
1729
|
+
}, t.onError, t.requiresObservable);
|
|
1730
|
+
else {
|
|
1731
|
+
var f = Gi(t), d = !1;
|
|
1732
|
+
u = new ae(s, function() {
|
|
1733
|
+
d || (d = !0, f(function() {
|
|
1734
|
+
d = !1, u.isDisposed || u.track(p);
|
|
1735
|
+
}));
|
|
1736
|
+
}, t.onError, t.requiresObservable);
|
|
1737
|
+
}
|
|
1738
|
+
function p() {
|
|
1739
|
+
e(u);
|
|
1740
|
+
}
|
|
1741
|
+
return (i = t) != null && (i = i.signal) != null && i.aborted || u.schedule_(), u.getDisposer_((o = t) == null ? void 0 : o.signal);
|
|
1742
|
+
}
|
|
1743
|
+
var Ki = function(t) {
|
|
1744
|
+
return t();
|
|
1745
|
+
};
|
|
1746
|
+
function Gi(e) {
|
|
1747
|
+
return e.scheduler ? e.scheduler : e.delay ? function(t) {
|
|
1748
|
+
return setTimeout(t, e.delay);
|
|
1749
|
+
} : Ki;
|
|
1750
|
+
}
|
|
1751
|
+
var qi = "onBO", zi = "onBUO";
|
|
1752
|
+
function Yi(e, t, r) {
|
|
1753
|
+
return Zn(qi, e, t, r);
|
|
1754
|
+
}
|
|
1755
|
+
function Jn(e, t, r) {
|
|
1756
|
+
return Zn(zi, e, t, r);
|
|
1757
|
+
}
|
|
1758
|
+
function Zn(e, t, r, n) {
|
|
1759
|
+
var i = je(t), o = A(n) ? n : r, s = e + "L";
|
|
1760
|
+
return i[s] ? i[s].add(o) : i[s] = /* @__PURE__ */ new Set([o]), function() {
|
|
1761
|
+
var a = i[s];
|
|
1762
|
+
a && (a.delete(o), a.size === 0 && delete i[s]);
|
|
1763
|
+
};
|
|
1764
|
+
}
|
|
1765
|
+
function Qn(e, t, r, n) {
|
|
1766
|
+
process.env.NODE_ENV !== "production" && (arguments.length > 4 && _("'extendObservable' expected 2-4 arguments"), typeof e != "object" && _("'extendObservable' expects an object as first argument"), ce(e) && _("'extendObservable' should not be used on maps, use map.merge instead"), P(t) || _("'extendObservable' only accepts plain objects as second argument"), ($e(t) || $e(r)) && _("Extending an object with another observable (object) is not supported"));
|
|
1767
|
+
var i = xr(t);
|
|
1768
|
+
return Oe(function() {
|
|
1769
|
+
var o = xe(e, n)[v];
|
|
1770
|
+
Be(i).forEach(function(s) {
|
|
1771
|
+
o.extend_(
|
|
1772
|
+
s,
|
|
1773
|
+
i[s],
|
|
1774
|
+
// must pass "undefined" for { key: undefined }
|
|
1775
|
+
r && s in r ? r[s] : !0
|
|
1776
|
+
);
|
|
1777
|
+
});
|
|
1778
|
+
}), e;
|
|
1779
|
+
}
|
|
1780
|
+
function Wi(e, t) {
|
|
1781
|
+
return er(je(e, t));
|
|
1782
|
+
}
|
|
1783
|
+
function er(e) {
|
|
1784
|
+
var t = {
|
|
1785
|
+
name: e.name_
|
|
1786
|
+
};
|
|
1787
|
+
return e.observing_ && e.observing_.length > 0 && (t.dependencies = Hi(e.observing_).map(er)), t;
|
|
1788
|
+
}
|
|
1789
|
+
function Hi(e) {
|
|
1790
|
+
return Array.from(new Set(e));
|
|
1791
|
+
}
|
|
1792
|
+
var Xi = 0;
|
|
1793
|
+
function tr() {
|
|
1794
|
+
this.message = "FLOW_CANCELLED";
|
|
1795
|
+
}
|
|
1796
|
+
tr.prototype = /* @__PURE__ */ Object.create(Error.prototype);
|
|
1797
|
+
var St = /* @__PURE__ */ Pn("flow"), Ji = /* @__PURE__ */ Pn("flow.bound", {
|
|
1798
|
+
bound: !0
|
|
1799
|
+
}), De = /* @__PURE__ */ Object.assign(function(t, r) {
|
|
1800
|
+
if (Ke(r))
|
|
1801
|
+
return St.decorate_20223_(t, r);
|
|
1802
|
+
if (_e(r))
|
|
1803
|
+
return Fe(t, r, St);
|
|
1804
|
+
process.env.NODE_ENV !== "production" && arguments.length !== 1 && _("Flow expects single argument with generator function");
|
|
1805
|
+
var n = t, i = n.name || "<unnamed flow>", o = function() {
|
|
1806
|
+
var a = this, u = arguments, f = ++Xi, d = Se(i + " - runid: " + f + " - init", n).apply(a, u), p, g = void 0, y = new Promise(function(V, k) {
|
|
1807
|
+
var j = 0;
|
|
1808
|
+
p = k;
|
|
1809
|
+
function ye(D) {
|
|
1810
|
+
g = void 0;
|
|
1811
|
+
var H;
|
|
1812
|
+
try {
|
|
1813
|
+
H = Se(i + " - runid: " + f + " - yield " + j++, d.next).call(d, D);
|
|
1814
|
+
} catch (ee) {
|
|
1815
|
+
return k(ee);
|
|
1816
|
+
}
|
|
1817
|
+
le(H);
|
|
1818
|
+
}
|
|
1819
|
+
function Re(D) {
|
|
1820
|
+
g = void 0;
|
|
1821
|
+
var H;
|
|
1822
|
+
try {
|
|
1823
|
+
H = Se(i + " - runid: " + f + " - yield " + j++, d.throw).call(d, D);
|
|
1824
|
+
} catch (ee) {
|
|
1825
|
+
return k(ee);
|
|
1826
|
+
}
|
|
1827
|
+
le(H);
|
|
1828
|
+
}
|
|
1829
|
+
function le(D) {
|
|
1830
|
+
if (A(D?.then)) {
|
|
1831
|
+
D.then(le, k);
|
|
1832
|
+
return;
|
|
1833
|
+
}
|
|
1834
|
+
return D.done ? V(D.value) : (g = Promise.resolve(D.value), g.then(ye, Re));
|
|
1835
|
+
}
|
|
1836
|
+
ye(void 0);
|
|
1837
|
+
});
|
|
1838
|
+
return y.cancel = Se(i + " - runid: " + f + " - cancel", function() {
|
|
1839
|
+
try {
|
|
1840
|
+
g && ln(g);
|
|
1841
|
+
var V = d.return(void 0), k = Promise.resolve(V.value);
|
|
1842
|
+
k.then(Ne, Ne), ln(k), p(new tr());
|
|
1843
|
+
} catch (j) {
|
|
1844
|
+
p(j);
|
|
1845
|
+
}
|
|
1846
|
+
}), y;
|
|
1847
|
+
};
|
|
1848
|
+
return o.isMobXFlow = !0, o;
|
|
1849
|
+
}, St);
|
|
1850
|
+
De.bound = /* @__PURE__ */ Q(Ji);
|
|
1851
|
+
function ln(e) {
|
|
1852
|
+
A(e.cancel) && e.cancel();
|
|
1853
|
+
}
|
|
1854
|
+
function Ie(e) {
|
|
1855
|
+
return e?.isMobXFlow === !0;
|
|
1856
|
+
}
|
|
1857
|
+
function Zi(e, t) {
|
|
1858
|
+
return e ? Pe(e) || !!e[v] || It(e) || ot(e) || pt(e) : !1;
|
|
1859
|
+
}
|
|
1860
|
+
function $e(e) {
|
|
1861
|
+
return process.env.NODE_ENV !== "production" && arguments.length !== 1 && _("isObservable expects only 1 argument. Use isObservableProp to inspect the observability of a property"), Zi(e);
|
|
1862
|
+
}
|
|
1863
|
+
function Qi() {
|
|
1864
|
+
if (process.env.NODE_ENV !== "production") {
|
|
1865
|
+
for (var e = !1, t = arguments.length, r = new Array(t), n = 0; n < t; n++)
|
|
1866
|
+
r[n] = arguments[n];
|
|
1867
|
+
typeof r[r.length - 1] == "boolean" && (e = r.pop());
|
|
1868
|
+
var i = eo(r);
|
|
1869
|
+
if (!i)
|
|
1870
|
+
return _("'trace(break?)' can only be used inside a tracked computed value or a Reaction. Consider passing in the computed value or reaction explicitly");
|
|
1871
|
+
i.isTracing_ === $.NONE && console.log("[mobx.trace] '" + i.name_ + "' tracing enabled"), i.isTracing_ = e ? $.BREAK : $.LOG;
|
|
1872
|
+
}
|
|
1873
|
+
}
|
|
1874
|
+
function eo(e) {
|
|
1875
|
+
switch (e.length) {
|
|
1876
|
+
case 0:
|
|
1877
|
+
return l.trackingDerivation;
|
|
1878
|
+
case 1:
|
|
1879
|
+
return je(e[0]);
|
|
1880
|
+
case 2:
|
|
1881
|
+
return je(e[0], e[1]);
|
|
1882
|
+
}
|
|
1883
|
+
}
|
|
1884
|
+
function re(e, t) {
|
|
1885
|
+
t === void 0 && (t = void 0), U();
|
|
1886
|
+
try {
|
|
1887
|
+
return e.apply(t);
|
|
1888
|
+
} finally {
|
|
1889
|
+
I();
|
|
1890
|
+
}
|
|
1891
|
+
}
|
|
1892
|
+
function fe(e) {
|
|
1893
|
+
return e[v];
|
|
1894
|
+
}
|
|
1895
|
+
var to = {
|
|
1896
|
+
has: function(t, r) {
|
|
1897
|
+
return process.env.NODE_ENV !== "production" && l.trackingDerivation && ke("detect new properties using the 'in' operator. Use 'has' from 'mobx' instead."), fe(t).has_(r);
|
|
1898
|
+
},
|
|
1899
|
+
get: function(t, r) {
|
|
1900
|
+
return fe(t).get_(r);
|
|
1901
|
+
},
|
|
1902
|
+
set: function(t, r, n) {
|
|
1903
|
+
var i;
|
|
1904
|
+
return _e(r) ? (process.env.NODE_ENV !== "production" && !fe(t).values_.has(r) && ke("add a new observable property through direct assignment. Use 'set' from 'mobx' instead."), (i = fe(t).set_(r, n, !0)) != null ? i : !0) : !1;
|
|
1905
|
+
},
|
|
1906
|
+
deleteProperty: function(t, r) {
|
|
1907
|
+
var n;
|
|
1908
|
+
return process.env.NODE_ENV !== "production" && ke("delete properties from an observable object. Use 'remove' from 'mobx' instead."), _e(r) ? (n = fe(t).delete_(r, !0)) != null ? n : !0 : !1;
|
|
1909
|
+
},
|
|
1910
|
+
defineProperty: function(t, r, n) {
|
|
1911
|
+
var i;
|
|
1912
|
+
return process.env.NODE_ENV !== "production" && ke("define property on an observable object. Use 'defineProperty' from 'mobx' instead."), (i = fe(t).defineProperty_(r, n)) != null ? i : !0;
|
|
1913
|
+
},
|
|
1914
|
+
ownKeys: function(t) {
|
|
1915
|
+
return process.env.NODE_ENV !== "production" && l.trackingDerivation && ke("iterate keys to detect added / removed properties. Use 'keys' from 'mobx' instead."), fe(t).ownKeys_();
|
|
1916
|
+
},
|
|
1917
|
+
preventExtensions: function(t) {
|
|
1918
|
+
_(13);
|
|
1919
|
+
}
|
|
1920
|
+
};
|
|
1921
|
+
function no(e, t) {
|
|
1922
|
+
var r, n;
|
|
1923
|
+
return An(), e = xe(e, t), (n = (r = e[v]).proxy_) != null ? n : r.proxy_ = new Proxy(e, to);
|
|
1924
|
+
}
|
|
1925
|
+
function L(e) {
|
|
1926
|
+
return e.interceptors_ !== void 0 && e.interceptors_.length > 0;
|
|
1927
|
+
}
|
|
1928
|
+
function qe(e, t) {
|
|
1929
|
+
var r = e.interceptors_ || (e.interceptors_ = []);
|
|
1930
|
+
return r.push(t), Ut(function() {
|
|
1931
|
+
var n = r.indexOf(t);
|
|
1932
|
+
n !== -1 && r.splice(n, 1);
|
|
1933
|
+
});
|
|
1934
|
+
}
|
|
1935
|
+
function B(e, t) {
|
|
1936
|
+
var r = me();
|
|
1937
|
+
try {
|
|
1938
|
+
for (var n = [].concat(e.interceptors_ || []), i = 0, o = n.length; i < o && (t = n[i](t), t && !t.type && _(14), !!t); i++)
|
|
1939
|
+
;
|
|
1940
|
+
return t;
|
|
1941
|
+
} finally {
|
|
1942
|
+
ie(r);
|
|
1943
|
+
}
|
|
1944
|
+
}
|
|
1945
|
+
function q(e) {
|
|
1946
|
+
return e.changeListeners_ !== void 0 && e.changeListeners_.length > 0;
|
|
1947
|
+
}
|
|
1948
|
+
function ze(e, t) {
|
|
1949
|
+
var r = e.changeListeners_ || (e.changeListeners_ = []);
|
|
1950
|
+
return r.push(t), Ut(function() {
|
|
1951
|
+
var n = r.indexOf(t);
|
|
1952
|
+
n !== -1 && r.splice(n, 1);
|
|
1953
|
+
});
|
|
1954
|
+
}
|
|
1955
|
+
function z(e, t) {
|
|
1956
|
+
var r = me(), n = e.changeListeners_;
|
|
1957
|
+
if (n) {
|
|
1958
|
+
n = n.slice();
|
|
1959
|
+
for (var i = 0, o = n.length; i < o; i++)
|
|
1960
|
+
n[i](t);
|
|
1961
|
+
ie(r);
|
|
1962
|
+
}
|
|
1963
|
+
}
|
|
1964
|
+
var wt = /* @__PURE__ */ Symbol("mobx-keys");
|
|
1965
|
+
function nr(e, t, r) {
|
|
1966
|
+
return process.env.NODE_ENV !== "production" && (!P(e) && !P(Object.getPrototypeOf(e)) && _("'makeAutoObservable' can only be used for classes that don't have a superclass"), Pe(e) && _("makeAutoObservable can only be used on objects not already made observable")), P(e) ? Qn(e, e, t, r) : (Oe(function() {
|
|
1967
|
+
var n = xe(e, r)[v];
|
|
1968
|
+
if (!e[wt]) {
|
|
1969
|
+
var i = Object.getPrototypeOf(e), o = new Set([].concat(Be(e), Be(i)));
|
|
1970
|
+
o.delete("constructor"), o.delete(v), ft(i, wt, o);
|
|
1971
|
+
}
|
|
1972
|
+
e[wt].forEach(function(s) {
|
|
1973
|
+
return n.make_(
|
|
1974
|
+
s,
|
|
1975
|
+
// must pass "undefined" for { key: undefined }
|
|
1976
|
+
t && s in t ? t[s] : !0
|
|
1977
|
+
);
|
|
1978
|
+
});
|
|
1979
|
+
}), e);
|
|
1980
|
+
}
|
|
1981
|
+
var fn = "splice", K = "update", ro = 1e4, io = {
|
|
1982
|
+
get: function(t, r) {
|
|
1983
|
+
var n = t[v];
|
|
1984
|
+
return r === v ? n : r === "length" ? n.getArrayLength_() : typeof r == "string" && !isNaN(r) ? n.get_(parseInt(r)) : G(st, r) ? st[r] : t[r];
|
|
1985
|
+
},
|
|
1986
|
+
set: function(t, r, n) {
|
|
1987
|
+
var i = t[v];
|
|
1988
|
+
return r === "length" && i.setArrayLength_(n), typeof r == "symbol" || isNaN(r) ? t[r] = n : i.set_(parseInt(r), n), !0;
|
|
1989
|
+
},
|
|
1990
|
+
preventExtensions: function() {
|
|
1991
|
+
_(15);
|
|
1992
|
+
}
|
|
1993
|
+
}, zt = /* @__PURE__ */ (function() {
|
|
1994
|
+
function e(r, n, i, o) {
|
|
1995
|
+
r === void 0 && (r = process.env.NODE_ENV !== "production" ? "ObservableArray@" + Y() : "ObservableArray"), this.owned_ = void 0, this.legacyMode_ = void 0, this.atom_ = void 0, this.values_ = [], this.interceptors_ = void 0, this.changeListeners_ = void 0, this.enhancer_ = void 0, this.dehancer = void 0, this.proxy_ = void 0, this.lastKnownLength_ = 0, this.owned_ = i, this.legacyMode_ = o, this.atom_ = new ue(r), this.enhancer_ = function(s, a) {
|
|
1996
|
+
return n(s, a, process.env.NODE_ENV !== "production" ? r + "[..]" : "ObservableArray[..]");
|
|
1997
|
+
};
|
|
1998
|
+
}
|
|
1999
|
+
var t = e.prototype;
|
|
2000
|
+
return t.dehanceValue_ = function(n) {
|
|
2001
|
+
return this.dehancer !== void 0 ? this.dehancer(n) : n;
|
|
2002
|
+
}, t.dehanceValues_ = function(n) {
|
|
2003
|
+
return this.dehancer !== void 0 && n.length > 0 ? n.map(this.dehancer) : n;
|
|
2004
|
+
}, t.intercept_ = function(n) {
|
|
2005
|
+
return qe(this, n);
|
|
2006
|
+
}, t.observe_ = function(n, i) {
|
|
2007
|
+
return i === void 0 && (i = !1), i && n({
|
|
2008
|
+
observableKind: "array",
|
|
2009
|
+
object: this.proxy_,
|
|
2010
|
+
debugObjectName: this.atom_.name_,
|
|
2011
|
+
type: "splice",
|
|
2012
|
+
index: 0,
|
|
2013
|
+
added: this.values_.slice(),
|
|
2014
|
+
addedCount: this.values_.length,
|
|
2015
|
+
removed: [],
|
|
2016
|
+
removedCount: 0
|
|
2017
|
+
}), ze(this, n);
|
|
2018
|
+
}, t.getArrayLength_ = function() {
|
|
2019
|
+
return this.atom_.reportObserved(), this.values_.length;
|
|
2020
|
+
}, t.setArrayLength_ = function(n) {
|
|
2021
|
+
(typeof n != "number" || isNaN(n) || n < 0) && _("Out of range: " + n);
|
|
2022
|
+
var i = this.values_.length;
|
|
2023
|
+
if (n !== i)
|
|
2024
|
+
if (n > i) {
|
|
2025
|
+
for (var o = new Array(n - i), s = 0; s < n - i; s++)
|
|
2026
|
+
o[s] = void 0;
|
|
2027
|
+
this.spliceWithArray_(i, 0, o);
|
|
2028
|
+
} else
|
|
2029
|
+
this.spliceWithArray_(n, i - n);
|
|
2030
|
+
}, t.updateArrayLength_ = function(n, i) {
|
|
2031
|
+
n !== this.lastKnownLength_ && _(16), this.lastKnownLength_ += i, this.legacyMode_ && i > 0 && ur(n + i + 1);
|
|
2032
|
+
}, t.spliceWithArray_ = function(n, i, o) {
|
|
2033
|
+
var s = this;
|
|
2034
|
+
J(this.atom_);
|
|
2035
|
+
var a = this.values_.length;
|
|
2036
|
+
if (n === void 0 ? n = 0 : n > a ? n = a : n < 0 && (n = Math.max(0, a + n)), arguments.length === 1 ? i = a - n : i == null ? i = 0 : i = Math.max(0, Math.min(i, a - n)), o === void 0 && (o = et), L(this)) {
|
|
2037
|
+
var u = B(this, {
|
|
2038
|
+
object: this.proxy_,
|
|
2039
|
+
type: fn,
|
|
2040
|
+
index: n,
|
|
2041
|
+
removedCount: i,
|
|
2042
|
+
added: o
|
|
2043
|
+
});
|
|
2044
|
+
if (!u)
|
|
2045
|
+
return et;
|
|
2046
|
+
i = u.removedCount, o = u.added;
|
|
2047
|
+
}
|
|
2048
|
+
if (o = o.length === 0 ? o : o.map(function(p) {
|
|
2049
|
+
return s.enhancer_(p, void 0);
|
|
2050
|
+
}), this.legacyMode_ || process.env.NODE_ENV !== "production") {
|
|
2051
|
+
var f = o.length - i;
|
|
2052
|
+
this.updateArrayLength_(a, f);
|
|
2053
|
+
}
|
|
2054
|
+
var d = this.spliceItemsIntoValues_(n, i, o);
|
|
2055
|
+
return (i !== 0 || o.length !== 0) && this.notifyArraySplice_(n, o, d), this.dehanceValues_(d);
|
|
2056
|
+
}, t.spliceItemsIntoValues_ = function(n, i, o) {
|
|
2057
|
+
if (o.length < ro) {
|
|
2058
|
+
var s;
|
|
2059
|
+
return (s = this.values_).splice.apply(s, [n, i].concat(o));
|
|
2060
|
+
} else {
|
|
2061
|
+
var a = this.values_.slice(n, n + i), u = this.values_.slice(n + i);
|
|
2062
|
+
this.values_.length += o.length - i;
|
|
2063
|
+
for (var f = 0; f < o.length; f++)
|
|
2064
|
+
this.values_[n + f] = o[f];
|
|
2065
|
+
for (var d = 0; d < u.length; d++)
|
|
2066
|
+
this.values_[n + o.length + d] = u[d];
|
|
2067
|
+
return a;
|
|
2068
|
+
}
|
|
2069
|
+
}, t.notifyArrayChildUpdate_ = function(n, i, o) {
|
|
2070
|
+
var s = !this.owned_ && w(), a = q(this), u = a || s ? {
|
|
2071
|
+
observableKind: "array",
|
|
2072
|
+
object: this.proxy_,
|
|
2073
|
+
type: K,
|
|
2074
|
+
debugObjectName: this.atom_.name_,
|
|
2075
|
+
index: n,
|
|
2076
|
+
newValue: i,
|
|
2077
|
+
oldValue: o
|
|
2078
|
+
} : null;
|
|
2079
|
+
process.env.NODE_ENV !== "production" && s && R(u), this.atom_.reportChanged(), a && z(this, u), process.env.NODE_ENV !== "production" && s && C();
|
|
2080
|
+
}, t.notifyArraySplice_ = function(n, i, o) {
|
|
2081
|
+
var s = !this.owned_ && w(), a = q(this), u = a || s ? {
|
|
2082
|
+
observableKind: "array",
|
|
2083
|
+
object: this.proxy_,
|
|
2084
|
+
debugObjectName: this.atom_.name_,
|
|
2085
|
+
type: fn,
|
|
2086
|
+
index: n,
|
|
2087
|
+
removed: o,
|
|
2088
|
+
added: i,
|
|
2089
|
+
removedCount: o.length,
|
|
2090
|
+
addedCount: i.length
|
|
2091
|
+
} : null;
|
|
2092
|
+
process.env.NODE_ENV !== "production" && s && R(u), this.atom_.reportChanged(), a && z(this, u), process.env.NODE_ENV !== "production" && s && C();
|
|
2093
|
+
}, t.get_ = function(n) {
|
|
2094
|
+
if (this.legacyMode_ && n >= this.values_.length) {
|
|
2095
|
+
console.warn(process.env.NODE_ENV !== "production" ? "[mobx.array] Attempt to read an array index (" + n + ") that is out of bounds (" + this.values_.length + "). Please check length first. Out of bound indices will not be tracked by MobX" : "[mobx] Out of bounds read: " + n);
|
|
2096
|
+
return;
|
|
2097
|
+
}
|
|
2098
|
+
return this.atom_.reportObserved(), this.dehanceValue_(this.values_[n]);
|
|
2099
|
+
}, t.set_ = function(n, i) {
|
|
2100
|
+
var o = this.values_;
|
|
2101
|
+
if (this.legacyMode_ && n > o.length && _(17, n, o.length), n < o.length) {
|
|
2102
|
+
J(this.atom_);
|
|
2103
|
+
var s = o[n];
|
|
2104
|
+
if (L(this)) {
|
|
2105
|
+
var a = B(this, {
|
|
2106
|
+
type: K,
|
|
2107
|
+
object: this.proxy_,
|
|
2108
|
+
// since "this" is the real array we need to pass its proxy
|
|
2109
|
+
index: n,
|
|
2110
|
+
newValue: i
|
|
2111
|
+
});
|
|
2112
|
+
if (!a)
|
|
2113
|
+
return;
|
|
2114
|
+
i = a.newValue;
|
|
2115
|
+
}
|
|
2116
|
+
i = this.enhancer_(i, s);
|
|
2117
|
+
var u = i !== s;
|
|
2118
|
+
u && (o[n] = i, this.notifyArrayChildUpdate_(n, i, s));
|
|
2119
|
+
} else {
|
|
2120
|
+
for (var f = new Array(n + 1 - o.length), d = 0; d < f.length - 1; d++)
|
|
2121
|
+
f[d] = void 0;
|
|
2122
|
+
f[f.length - 1] = i, this.spliceWithArray_(o.length, 0, f);
|
|
2123
|
+
}
|
|
2124
|
+
}, e;
|
|
2125
|
+
})();
|
|
2126
|
+
function oo(e, t, r, n) {
|
|
2127
|
+
return r === void 0 && (r = process.env.NODE_ENV !== "production" ? "ObservableArray@" + Y() : "ObservableArray"), n === void 0 && (n = !1), An(), Oe(function() {
|
|
2128
|
+
var i = new zt(r, t, n, !1);
|
|
2129
|
+
wn(i.values_, v, i);
|
|
2130
|
+
var o = new Proxy(i.values_, io);
|
|
2131
|
+
return i.proxy_ = o, e && e.length && i.spliceWithArray_(0, 0, e), o;
|
|
2132
|
+
});
|
|
2133
|
+
}
|
|
2134
|
+
var st = {
|
|
2135
|
+
clear: function() {
|
|
2136
|
+
return this.splice(0);
|
|
2137
|
+
},
|
|
2138
|
+
replace: function(t) {
|
|
2139
|
+
var r = this[v];
|
|
2140
|
+
return r.spliceWithArray_(0, r.values_.length, t);
|
|
2141
|
+
},
|
|
2142
|
+
// Used by JSON.stringify
|
|
2143
|
+
toJSON: function() {
|
|
2144
|
+
return this.slice();
|
|
2145
|
+
},
|
|
2146
|
+
/*
|
|
2147
|
+
* functions that do alter the internal structure of the array, (based on lib.es6.d.ts)
|
|
2148
|
+
* since these functions alter the inner structure of the array, the have side effects.
|
|
2149
|
+
* Because the have side effects, they should not be used in computed function,
|
|
2150
|
+
* and for that reason the do not call dependencyState.notifyObserved
|
|
2151
|
+
*/
|
|
2152
|
+
splice: function(t, r) {
|
|
2153
|
+
for (var n = arguments.length, i = new Array(n > 2 ? n - 2 : 0), o = 2; o < n; o++)
|
|
2154
|
+
i[o - 2] = arguments[o];
|
|
2155
|
+
var s = this[v];
|
|
2156
|
+
switch (arguments.length) {
|
|
2157
|
+
case 0:
|
|
2158
|
+
return [];
|
|
2159
|
+
case 1:
|
|
2160
|
+
return s.spliceWithArray_(t);
|
|
2161
|
+
case 2:
|
|
2162
|
+
return s.spliceWithArray_(t, r);
|
|
2163
|
+
}
|
|
2164
|
+
return s.spliceWithArray_(t, r, i);
|
|
2165
|
+
},
|
|
2166
|
+
spliceWithArray: function(t, r, n) {
|
|
2167
|
+
return this[v].spliceWithArray_(t, r, n);
|
|
2168
|
+
},
|
|
2169
|
+
push: function() {
|
|
2170
|
+
for (var t = this[v], r = arguments.length, n = new Array(r), i = 0; i < r; i++)
|
|
2171
|
+
n[i] = arguments[i];
|
|
2172
|
+
return t.spliceWithArray_(t.values_.length, 0, n), t.values_.length;
|
|
2173
|
+
},
|
|
2174
|
+
pop: function() {
|
|
2175
|
+
return this.splice(Math.max(this[v].values_.length - 1, 0), 1)[0];
|
|
2176
|
+
},
|
|
2177
|
+
shift: function() {
|
|
2178
|
+
return this.splice(0, 1)[0];
|
|
2179
|
+
},
|
|
2180
|
+
unshift: function() {
|
|
2181
|
+
for (var t = this[v], r = arguments.length, n = new Array(r), i = 0; i < r; i++)
|
|
2182
|
+
n[i] = arguments[i];
|
|
2183
|
+
return t.spliceWithArray_(0, 0, n), t.values_.length;
|
|
2184
|
+
},
|
|
2185
|
+
reverse: function() {
|
|
2186
|
+
return l.trackingDerivation && _(37, "reverse"), this.replace(this.slice().reverse()), this;
|
|
2187
|
+
},
|
|
2188
|
+
sort: function() {
|
|
2189
|
+
l.trackingDerivation && _(37, "sort");
|
|
2190
|
+
var t = this.slice();
|
|
2191
|
+
return t.sort.apply(t, arguments), this.replace(t), this;
|
|
2192
|
+
},
|
|
2193
|
+
remove: function(t) {
|
|
2194
|
+
var r = this[v], n = r.dehanceValues_(r.values_).indexOf(t);
|
|
2195
|
+
return n > -1 ? (this.splice(n, 1), !0) : !1;
|
|
2196
|
+
}
|
|
2197
|
+
};
|
|
2198
|
+
m("at", M);
|
|
2199
|
+
m("concat", M);
|
|
2200
|
+
m("flat", M);
|
|
2201
|
+
m("includes", M);
|
|
2202
|
+
m("indexOf", M);
|
|
2203
|
+
m("join", M);
|
|
2204
|
+
m("lastIndexOf", M);
|
|
2205
|
+
m("slice", M);
|
|
2206
|
+
m("toString", M);
|
|
2207
|
+
m("toLocaleString", M);
|
|
2208
|
+
m("toSorted", M);
|
|
2209
|
+
m("toSpliced", M);
|
|
2210
|
+
m("with", M);
|
|
2211
|
+
m("every", W);
|
|
2212
|
+
m("filter", W);
|
|
2213
|
+
m("find", W);
|
|
2214
|
+
m("findIndex", W);
|
|
2215
|
+
m("findLast", W);
|
|
2216
|
+
m("findLastIndex", W);
|
|
2217
|
+
m("flatMap", W);
|
|
2218
|
+
m("forEach", W);
|
|
2219
|
+
m("map", W);
|
|
2220
|
+
m("some", W);
|
|
2221
|
+
m("toReversed", W);
|
|
2222
|
+
m("reduce", rr);
|
|
2223
|
+
m("reduceRight", rr);
|
|
2224
|
+
function m(e, t) {
|
|
2225
|
+
typeof Array.prototype[e] == "function" && (st[e] = t(e));
|
|
2226
|
+
}
|
|
2227
|
+
function M(e) {
|
|
2228
|
+
return function() {
|
|
2229
|
+
var t = this[v];
|
|
2230
|
+
t.atom_.reportObserved();
|
|
2231
|
+
var r = t.dehanceValues_(t.values_);
|
|
2232
|
+
return r[e].apply(r, arguments);
|
|
2233
|
+
};
|
|
2234
|
+
}
|
|
2235
|
+
function W(e) {
|
|
2236
|
+
return function(t, r) {
|
|
2237
|
+
var n = this, i = this[v];
|
|
2238
|
+
i.atom_.reportObserved();
|
|
2239
|
+
var o = i.dehanceValues_(i.values_);
|
|
2240
|
+
return o[e](function(s, a) {
|
|
2241
|
+
return t.call(r, s, a, n);
|
|
2242
|
+
});
|
|
2243
|
+
};
|
|
2244
|
+
}
|
|
2245
|
+
function rr(e) {
|
|
2246
|
+
return function() {
|
|
2247
|
+
var t = this, r = this[v];
|
|
2248
|
+
r.atom_.reportObserved();
|
|
2249
|
+
var n = r.dehanceValues_(r.values_), i = arguments[0];
|
|
2250
|
+
return arguments[0] = function(o, s, a) {
|
|
2251
|
+
return i(o, s, a, t);
|
|
2252
|
+
}, n[e].apply(n, arguments);
|
|
2253
|
+
};
|
|
2254
|
+
}
|
|
2255
|
+
var so = /* @__PURE__ */ ge("ObservableArrayAdministration", zt);
|
|
2256
|
+
function bt(e) {
|
|
2257
|
+
return lt(e) && so(e[v]);
|
|
2258
|
+
}
|
|
2259
|
+
var ao = {}, oe = "add", at = "delete", ir = /* @__PURE__ */ (function() {
|
|
2260
|
+
function e(r, n, i) {
|
|
2261
|
+
var o = this;
|
|
2262
|
+
n === void 0 && (n = ve), i === void 0 && (i = process.env.NODE_ENV !== "production" ? "ObservableMap@" + Y() : "ObservableMap"), this.enhancer_ = void 0, this.name_ = void 0, this[v] = ao, this.data_ = void 0, this.hasMap_ = void 0, this.keysAtom_ = void 0, this.interceptors_ = void 0, this.changeListeners_ = void 0, this.dehancer = void 0, this.enhancer_ = n, this.name_ = i, A(Map) || _(18), Oe(function() {
|
|
2263
|
+
o.keysAtom_ = Tn(process.env.NODE_ENV !== "production" ? o.name_ + ".keys()" : "ObservableMap.keys()"), o.data_ = /* @__PURE__ */ new Map(), o.hasMap_ = /* @__PURE__ */ new Map(), r && o.merge(r);
|
|
2264
|
+
});
|
|
2265
|
+
}
|
|
2266
|
+
var t = e.prototype;
|
|
2267
|
+
return t.has_ = function(n) {
|
|
2268
|
+
return this.data_.has(n);
|
|
2269
|
+
}, t.has = function(n) {
|
|
2270
|
+
var i = this;
|
|
2271
|
+
if (!l.trackingDerivation)
|
|
2272
|
+
return this.has_(n);
|
|
2273
|
+
var o = this.hasMap_.get(n);
|
|
2274
|
+
if (!o) {
|
|
2275
|
+
var s = o = new de(this.has_(n), _t, process.env.NODE_ENV !== "production" ? this.name_ + "." + jt(n) + "?" : "ObservableMap.key?", !1);
|
|
2276
|
+
this.hasMap_.set(n, s), Jn(s, function() {
|
|
2277
|
+
return i.hasMap_.delete(n);
|
|
2278
|
+
});
|
|
2279
|
+
}
|
|
2280
|
+
return o.get();
|
|
2281
|
+
}, t.set = function(n, i) {
|
|
2282
|
+
var o = this.has_(n);
|
|
2283
|
+
if (L(this)) {
|
|
2284
|
+
var s = B(this, {
|
|
2285
|
+
type: o ? K : oe,
|
|
2286
|
+
object: this,
|
|
2287
|
+
newValue: i,
|
|
2288
|
+
name: n
|
|
2289
|
+
});
|
|
2290
|
+
if (!s)
|
|
2291
|
+
return this;
|
|
2292
|
+
i = s.newValue;
|
|
2293
|
+
}
|
|
2294
|
+
return o ? this.updateValue_(n, i) : this.addValue_(n, i), this;
|
|
2295
|
+
}, t.delete = function(n) {
|
|
2296
|
+
var i = this;
|
|
2297
|
+
if (J(this.keysAtom_), L(this)) {
|
|
2298
|
+
var o = B(this, {
|
|
2299
|
+
type: at,
|
|
2300
|
+
object: this,
|
|
2301
|
+
name: n
|
|
2302
|
+
});
|
|
2303
|
+
if (!o)
|
|
2304
|
+
return !1;
|
|
2305
|
+
}
|
|
2306
|
+
if (this.has_(n)) {
|
|
2307
|
+
var s = w(), a = q(this), u = a || s ? {
|
|
2308
|
+
observableKind: "map",
|
|
2309
|
+
debugObjectName: this.name_,
|
|
2310
|
+
type: at,
|
|
2311
|
+
object: this,
|
|
2312
|
+
oldValue: this.data_.get(n).value_,
|
|
2313
|
+
name: n
|
|
2314
|
+
} : null;
|
|
2315
|
+
return process.env.NODE_ENV !== "production" && s && R(u), re(function() {
|
|
2316
|
+
var f;
|
|
2317
|
+
i.keysAtom_.reportChanged(), (f = i.hasMap_.get(n)) == null || f.setNewValue_(!1);
|
|
2318
|
+
var d = i.data_.get(n);
|
|
2319
|
+
d.setNewValue_(void 0), i.data_.delete(n);
|
|
2320
|
+
}), a && z(this, u), process.env.NODE_ENV !== "production" && s && C(), !0;
|
|
2321
|
+
}
|
|
2322
|
+
return !1;
|
|
2323
|
+
}, t.updateValue_ = function(n, i) {
|
|
2324
|
+
var o = this.data_.get(n);
|
|
2325
|
+
if (i = o.prepareNewValue_(i), i !== l.UNCHANGED) {
|
|
2326
|
+
var s = w(), a = q(this), u = a || s ? {
|
|
2327
|
+
observableKind: "map",
|
|
2328
|
+
debugObjectName: this.name_,
|
|
2329
|
+
type: K,
|
|
2330
|
+
object: this,
|
|
2331
|
+
oldValue: o.value_,
|
|
2332
|
+
name: n,
|
|
2333
|
+
newValue: i
|
|
2334
|
+
} : null;
|
|
2335
|
+
process.env.NODE_ENV !== "production" && s && R(u), o.setNewValue_(i), a && z(this, u), process.env.NODE_ENV !== "production" && s && C();
|
|
2336
|
+
}
|
|
2337
|
+
}, t.addValue_ = function(n, i) {
|
|
2338
|
+
var o = this;
|
|
2339
|
+
J(this.keysAtom_), re(function() {
|
|
2340
|
+
var f, d = new de(i, o.enhancer_, process.env.NODE_ENV !== "production" ? o.name_ + "." + jt(n) : "ObservableMap.key", !1);
|
|
2341
|
+
o.data_.set(n, d), i = d.value_, (f = o.hasMap_.get(n)) == null || f.setNewValue_(!0), o.keysAtom_.reportChanged();
|
|
2342
|
+
});
|
|
2343
|
+
var s = w(), a = q(this), u = a || s ? {
|
|
2344
|
+
observableKind: "map",
|
|
2345
|
+
debugObjectName: this.name_,
|
|
2346
|
+
type: oe,
|
|
2347
|
+
object: this,
|
|
2348
|
+
name: n,
|
|
2349
|
+
newValue: i
|
|
2350
|
+
} : null;
|
|
2351
|
+
process.env.NODE_ENV !== "production" && s && R(u), a && z(this, u), process.env.NODE_ENV !== "production" && s && C();
|
|
2352
|
+
}, t.get = function(n) {
|
|
2353
|
+
return this.has(n) ? this.dehanceValue_(this.data_.get(n).get()) : this.dehanceValue_(void 0);
|
|
2354
|
+
}, t.dehanceValue_ = function(n) {
|
|
2355
|
+
return this.dehancer !== void 0 ? this.dehancer(n) : n;
|
|
2356
|
+
}, t.keys = function() {
|
|
2357
|
+
return this.keysAtom_.reportObserved(), this.data_.keys();
|
|
2358
|
+
}, t.values = function() {
|
|
2359
|
+
var n = this, i = this.keys();
|
|
2360
|
+
return dn({
|
|
2361
|
+
next: function() {
|
|
2362
|
+
var s = i.next(), a = s.done, u = s.value;
|
|
2363
|
+
return {
|
|
2364
|
+
done: a,
|
|
2365
|
+
value: a ? void 0 : n.get(u)
|
|
2366
|
+
};
|
|
2367
|
+
}
|
|
2368
|
+
});
|
|
2369
|
+
}, t.entries = function() {
|
|
2370
|
+
var n = this, i = this.keys();
|
|
2371
|
+
return dn({
|
|
2372
|
+
next: function() {
|
|
2373
|
+
var s = i.next(), a = s.done, u = s.value;
|
|
2374
|
+
return {
|
|
2375
|
+
done: a,
|
|
2376
|
+
value: a ? void 0 : [u, n.get(u)]
|
|
2377
|
+
};
|
|
2378
|
+
}
|
|
2379
|
+
});
|
|
2380
|
+
}, t[Symbol.iterator] = function() {
|
|
2381
|
+
return this.entries();
|
|
2382
|
+
}, t.forEach = function(n, i) {
|
|
2383
|
+
for (var o = Ae(this), s; !(s = o()).done; ) {
|
|
2384
|
+
var a = s.value, u = a[0], f = a[1];
|
|
2385
|
+
n.call(i, f, u, this);
|
|
2386
|
+
}
|
|
2387
|
+
}, t.merge = function(n) {
|
|
2388
|
+
var i = this;
|
|
2389
|
+
return ce(n) && (n = new Map(n)), re(function() {
|
|
2390
|
+
P(n) ? Tr(n).forEach(function(o) {
|
|
2391
|
+
return i.set(o, n[o]);
|
|
2392
|
+
}) : Array.isArray(n) ? n.forEach(function(o) {
|
|
2393
|
+
var s = o[0], a = o[1];
|
|
2394
|
+
return i.set(s, a);
|
|
2395
|
+
}) : Ve(n) ? (Vr(n) || _(19, n), n.forEach(function(o, s) {
|
|
2396
|
+
return i.set(s, o);
|
|
2397
|
+
})) : n != null && _(20, n);
|
|
2398
|
+
}), this;
|
|
2399
|
+
}, t.clear = function() {
|
|
2400
|
+
var n = this;
|
|
2401
|
+
re(function() {
|
|
2402
|
+
In(function() {
|
|
2403
|
+
for (var i = Ae(n.keys()), o; !(o = i()).done; ) {
|
|
2404
|
+
var s = o.value;
|
|
2405
|
+
n.delete(s);
|
|
2406
|
+
}
|
|
2407
|
+
});
|
|
2408
|
+
});
|
|
2409
|
+
}, t.replace = function(n) {
|
|
2410
|
+
var i = this;
|
|
2411
|
+
return re(function() {
|
|
2412
|
+
for (var o = uo(n), s = /* @__PURE__ */ new Map(), a = !1, u = Ae(i.data_.keys()), f; !(f = u()).done; ) {
|
|
2413
|
+
var d = f.value;
|
|
2414
|
+
if (!o.has(d)) {
|
|
2415
|
+
var p = i.delete(d);
|
|
2416
|
+
if (p)
|
|
2417
|
+
a = !0;
|
|
2418
|
+
else {
|
|
2419
|
+
var g = i.data_.get(d);
|
|
2420
|
+
s.set(d, g);
|
|
2421
|
+
}
|
|
2422
|
+
}
|
|
2423
|
+
}
|
|
2424
|
+
for (var y = Ae(o.entries()), V; !(V = y()).done; ) {
|
|
2425
|
+
var k = V.value, j = k[0], ye = k[1], Re = i.data_.has(j);
|
|
2426
|
+
if (i.set(j, ye), i.data_.has(j)) {
|
|
2427
|
+
var le = i.data_.get(j);
|
|
2428
|
+
s.set(j, le), Re || (a = !0);
|
|
2429
|
+
}
|
|
2430
|
+
}
|
|
2431
|
+
if (!a)
|
|
2432
|
+
if (i.data_.size !== s.size)
|
|
2433
|
+
i.keysAtom_.reportChanged();
|
|
2434
|
+
else
|
|
2435
|
+
for (var D = i.data_.keys(), H = s.keys(), ee = D.next(), Ye = H.next(); !ee.done; ) {
|
|
2436
|
+
if (ee.value !== Ye.value) {
|
|
2437
|
+
i.keysAtom_.reportChanged();
|
|
2438
|
+
break;
|
|
2439
|
+
}
|
|
2440
|
+
ee = D.next(), Ye = H.next();
|
|
2441
|
+
}
|
|
2442
|
+
i.data_ = s;
|
|
2443
|
+
}), this;
|
|
2444
|
+
}, t.toString = function() {
|
|
2445
|
+
return "[object ObservableMap]";
|
|
2446
|
+
}, t.toJSON = function() {
|
|
2447
|
+
return Array.from(this);
|
|
2448
|
+
}, t.observe_ = function(n, i) {
|
|
2449
|
+
return process.env.NODE_ENV !== "production" && i === !0 && _("`observe` doesn't support fireImmediately=true in combination with maps."), ze(this, n);
|
|
2450
|
+
}, t.intercept_ = function(n) {
|
|
2451
|
+
return qe(this, n);
|
|
2452
|
+
}, Te(e, [{
|
|
2453
|
+
key: "size",
|
|
2454
|
+
get: function() {
|
|
2455
|
+
return this.keysAtom_.reportObserved(), this.data_.size;
|
|
2456
|
+
}
|
|
2457
|
+
}, {
|
|
2458
|
+
key: Symbol.toStringTag,
|
|
2459
|
+
get: function() {
|
|
2460
|
+
return "Map";
|
|
2461
|
+
}
|
|
2462
|
+
}]);
|
|
2463
|
+
})(), ce = /* @__PURE__ */ ge("ObservableMap", ir);
|
|
2464
|
+
function dn(e) {
|
|
2465
|
+
return e[Symbol.toStringTag] = "MapIterator", Wt(e);
|
|
2466
|
+
}
|
|
2467
|
+
function uo(e) {
|
|
2468
|
+
if (Ve(e) || ce(e))
|
|
2469
|
+
return e;
|
|
2470
|
+
if (Array.isArray(e))
|
|
2471
|
+
return new Map(e);
|
|
2472
|
+
if (P(e)) {
|
|
2473
|
+
var t = /* @__PURE__ */ new Map();
|
|
2474
|
+
for (var r in e)
|
|
2475
|
+
t.set(r, e[r]);
|
|
2476
|
+
return t;
|
|
2477
|
+
} else
|
|
2478
|
+
return _(21, e);
|
|
2479
|
+
}
|
|
2480
|
+
var co = {}, or = /* @__PURE__ */ (function() {
|
|
2481
|
+
function e(r, n, i) {
|
|
2482
|
+
var o = this;
|
|
2483
|
+
n === void 0 && (n = ve), i === void 0 && (i = process.env.NODE_ENV !== "production" ? "ObservableSet@" + Y() : "ObservableSet"), this.name_ = void 0, this[v] = co, this.data_ = /* @__PURE__ */ new Set(), this.atom_ = void 0, this.changeListeners_ = void 0, this.interceptors_ = void 0, this.dehancer = void 0, this.enhancer_ = void 0, this.name_ = i, A(Set) || _(22), this.enhancer_ = function(s, a) {
|
|
2484
|
+
return n(s, a, i);
|
|
2485
|
+
}, Oe(function() {
|
|
2486
|
+
o.atom_ = Tn(o.name_), r && o.replace(r);
|
|
2487
|
+
});
|
|
2488
|
+
}
|
|
2489
|
+
var t = e.prototype;
|
|
2490
|
+
return t.dehanceValue_ = function(n) {
|
|
2491
|
+
return this.dehancer !== void 0 ? this.dehancer(n) : n;
|
|
2492
|
+
}, t.clear = function() {
|
|
2493
|
+
var n = this;
|
|
2494
|
+
re(function() {
|
|
2495
|
+
In(function() {
|
|
2496
|
+
for (var i = Ae(n.data_.values()), o; !(o = i()).done; ) {
|
|
2497
|
+
var s = o.value;
|
|
2498
|
+
n.delete(s);
|
|
2499
|
+
}
|
|
2500
|
+
});
|
|
2501
|
+
});
|
|
2502
|
+
}, t.forEach = function(n, i) {
|
|
2503
|
+
for (var o = Ae(this), s; !(s = o()).done; ) {
|
|
2504
|
+
var a = s.value;
|
|
2505
|
+
n.call(i, a, a, this);
|
|
2506
|
+
}
|
|
2507
|
+
}, t.add = function(n) {
|
|
2508
|
+
var i = this;
|
|
2509
|
+
if (J(this.atom_), L(this)) {
|
|
2510
|
+
var o = B(this, {
|
|
2511
|
+
type: oe,
|
|
2512
|
+
object: this,
|
|
2513
|
+
newValue: n
|
|
2514
|
+
});
|
|
2515
|
+
if (!o)
|
|
2516
|
+
return this;
|
|
2517
|
+
n = o.newValue;
|
|
2518
|
+
}
|
|
2519
|
+
if (!this.has(n)) {
|
|
2520
|
+
re(function() {
|
|
2521
|
+
i.data_.add(i.enhancer_(n, void 0)), i.atom_.reportChanged();
|
|
2522
|
+
});
|
|
2523
|
+
var s = process.env.NODE_ENV !== "production" && w(), a = q(this), u = a || s ? {
|
|
2524
|
+
observableKind: "set",
|
|
2525
|
+
debugObjectName: this.name_,
|
|
2526
|
+
type: oe,
|
|
2527
|
+
object: this,
|
|
2528
|
+
newValue: n
|
|
2529
|
+
} : null;
|
|
2530
|
+
s && process.env.NODE_ENV !== "production" && R(u), a && z(this, u), s && process.env.NODE_ENV !== "production" && C();
|
|
2531
|
+
}
|
|
2532
|
+
return this;
|
|
2533
|
+
}, t.delete = function(n) {
|
|
2534
|
+
var i = this;
|
|
2535
|
+
if (L(this)) {
|
|
2536
|
+
var o = B(this, {
|
|
2537
|
+
type: at,
|
|
2538
|
+
object: this,
|
|
2539
|
+
oldValue: n
|
|
2540
|
+
});
|
|
2541
|
+
if (!o)
|
|
2542
|
+
return !1;
|
|
2543
|
+
}
|
|
2544
|
+
if (this.has(n)) {
|
|
2545
|
+
var s = process.env.NODE_ENV !== "production" && w(), a = q(this), u = a || s ? {
|
|
2546
|
+
observableKind: "set",
|
|
2547
|
+
debugObjectName: this.name_,
|
|
2548
|
+
type: at,
|
|
2549
|
+
object: this,
|
|
2550
|
+
oldValue: n
|
|
2551
|
+
} : null;
|
|
2552
|
+
return s && process.env.NODE_ENV !== "production" && R(u), re(function() {
|
|
2553
|
+
i.atom_.reportChanged(), i.data_.delete(n);
|
|
2554
|
+
}), a && z(this, u), s && process.env.NODE_ENV !== "production" && C(), !0;
|
|
2555
|
+
}
|
|
2556
|
+
return !1;
|
|
2557
|
+
}, t.has = function(n) {
|
|
2558
|
+
return this.atom_.reportObserved(), this.data_.has(this.dehanceValue_(n));
|
|
2559
|
+
}, t.entries = function() {
|
|
2560
|
+
var n = this.values();
|
|
2561
|
+
return _n({
|
|
2562
|
+
next: function() {
|
|
2563
|
+
var o = n.next(), s = o.value, a = o.done;
|
|
2564
|
+
return a ? {
|
|
2565
|
+
value: void 0,
|
|
2566
|
+
done: a
|
|
2567
|
+
} : {
|
|
2568
|
+
value: [s, s],
|
|
2569
|
+
done: a
|
|
2570
|
+
};
|
|
2571
|
+
}
|
|
2572
|
+
});
|
|
2573
|
+
}, t.keys = function() {
|
|
2574
|
+
return this.values();
|
|
2575
|
+
}, t.values = function() {
|
|
2576
|
+
this.atom_.reportObserved();
|
|
2577
|
+
var n = this, i = this.data_.values();
|
|
2578
|
+
return _n({
|
|
2579
|
+
next: function() {
|
|
2580
|
+
var s = i.next(), a = s.value, u = s.done;
|
|
2581
|
+
return u ? {
|
|
2582
|
+
value: void 0,
|
|
2583
|
+
done: u
|
|
2584
|
+
} : {
|
|
2585
|
+
value: n.dehanceValue_(a),
|
|
2586
|
+
done: u
|
|
2587
|
+
};
|
|
2588
|
+
}
|
|
2589
|
+
});
|
|
2590
|
+
}, t.intersection = function(n) {
|
|
2591
|
+
if (te(n) && !X(n))
|
|
2592
|
+
return n.intersection(this);
|
|
2593
|
+
var i = new Set(this);
|
|
2594
|
+
return i.intersection(n);
|
|
2595
|
+
}, t.union = function(n) {
|
|
2596
|
+
if (te(n) && !X(n))
|
|
2597
|
+
return n.union(this);
|
|
2598
|
+
var i = new Set(this);
|
|
2599
|
+
return i.union(n);
|
|
2600
|
+
}, t.difference = function(n) {
|
|
2601
|
+
return new Set(this).difference(n);
|
|
2602
|
+
}, t.symmetricDifference = function(n) {
|
|
2603
|
+
if (te(n) && !X(n))
|
|
2604
|
+
return n.symmetricDifference(this);
|
|
2605
|
+
var i = new Set(this);
|
|
2606
|
+
return i.symmetricDifference(n);
|
|
2607
|
+
}, t.isSubsetOf = function(n) {
|
|
2608
|
+
return new Set(this).isSubsetOf(n);
|
|
2609
|
+
}, t.isSupersetOf = function(n) {
|
|
2610
|
+
return new Set(this).isSupersetOf(n);
|
|
2611
|
+
}, t.isDisjointFrom = function(n) {
|
|
2612
|
+
if (te(n) && !X(n))
|
|
2613
|
+
return n.isDisjointFrom(this);
|
|
2614
|
+
var i = new Set(this);
|
|
2615
|
+
return i.isDisjointFrom(n);
|
|
2616
|
+
}, t.replace = function(n) {
|
|
2617
|
+
var i = this;
|
|
2618
|
+
return X(n) && (n = new Set(n)), re(function() {
|
|
2619
|
+
Array.isArray(n) ? (i.clear(), n.forEach(function(o) {
|
|
2620
|
+
return i.add(o);
|
|
2621
|
+
})) : te(n) ? (i.clear(), n.forEach(function(o) {
|
|
2622
|
+
return i.add(o);
|
|
2623
|
+
})) : n != null && _("Cannot initialize set from " + n);
|
|
2624
|
+
}), this;
|
|
2625
|
+
}, t.observe_ = function(n, i) {
|
|
2626
|
+
return process.env.NODE_ENV !== "production" && i === !0 && _("`observe` doesn't support fireImmediately=true in combination with sets."), ze(this, n);
|
|
2627
|
+
}, t.intercept_ = function(n) {
|
|
2628
|
+
return qe(this, n);
|
|
2629
|
+
}, t.toJSON = function() {
|
|
2630
|
+
return Array.from(this);
|
|
2631
|
+
}, t.toString = function() {
|
|
2632
|
+
return "[object ObservableSet]";
|
|
2633
|
+
}, t[Symbol.iterator] = function() {
|
|
2634
|
+
return this.values();
|
|
2635
|
+
}, Te(e, [{
|
|
2636
|
+
key: "size",
|
|
2637
|
+
get: function() {
|
|
2638
|
+
return this.atom_.reportObserved(), this.data_.size;
|
|
2639
|
+
}
|
|
2640
|
+
}, {
|
|
2641
|
+
key: Symbol.toStringTag,
|
|
2642
|
+
get: function() {
|
|
2643
|
+
return "Set";
|
|
2644
|
+
}
|
|
2645
|
+
}]);
|
|
2646
|
+
})(), X = /* @__PURE__ */ ge("ObservableSet", or);
|
|
2647
|
+
function _n(e) {
|
|
2648
|
+
return e[Symbol.toStringTag] = "SetIterator", Wt(e);
|
|
2649
|
+
}
|
|
2650
|
+
var vn = /* @__PURE__ */ Object.create(null), hn = "remove", kt = /* @__PURE__ */ (function() {
|
|
2651
|
+
function e(r, n, i, o) {
|
|
2652
|
+
n === void 0 && (n = /* @__PURE__ */ new Map()), o === void 0 && (o = oi), this.target_ = void 0, this.values_ = void 0, this.name_ = void 0, this.defaultAnnotation_ = void 0, this.keysAtom_ = void 0, this.changeListeners_ = void 0, this.interceptors_ = void 0, this.proxy_ = void 0, this.isPlainObject_ = void 0, this.appliedAnnotations_ = void 0, this.pendingKeys_ = void 0, this.target_ = r, this.values_ = n, this.name_ = i, this.defaultAnnotation_ = o, this.keysAtom_ = new ue(process.env.NODE_ENV !== "production" ? this.name_ + ".keys" : "ObservableObject.keys"), this.isPlainObject_ = P(this.target_), process.env.NODE_ENV !== "production" && !fr(this.defaultAnnotation_) && _("defaultAnnotation must be valid annotation"), process.env.NODE_ENV !== "production" && (this.appliedAnnotations_ = {});
|
|
2653
|
+
}
|
|
2654
|
+
var t = e.prototype;
|
|
2655
|
+
return t.getObservablePropValue_ = function(n) {
|
|
2656
|
+
return this.values_.get(n).get();
|
|
2657
|
+
}, t.setObservablePropValue_ = function(n, i) {
|
|
2658
|
+
var o = this.values_.get(n);
|
|
2659
|
+
if (o instanceof F)
|
|
2660
|
+
return o.set(i), !0;
|
|
2661
|
+
if (L(this)) {
|
|
2662
|
+
var s = B(this, {
|
|
2663
|
+
type: K,
|
|
2664
|
+
object: this.proxy_ || this.target_,
|
|
2665
|
+
name: n,
|
|
2666
|
+
newValue: i
|
|
2667
|
+
});
|
|
2668
|
+
if (!s)
|
|
2669
|
+
return null;
|
|
2670
|
+
i = s.newValue;
|
|
2671
|
+
}
|
|
2672
|
+
if (i = o.prepareNewValue_(i), i !== l.UNCHANGED) {
|
|
2673
|
+
var a = q(this), u = process.env.NODE_ENV !== "production" && w(), f = a || u ? {
|
|
2674
|
+
type: K,
|
|
2675
|
+
observableKind: "object",
|
|
2676
|
+
debugObjectName: this.name_,
|
|
2677
|
+
object: this.proxy_ || this.target_,
|
|
2678
|
+
oldValue: o.value_,
|
|
2679
|
+
name: n,
|
|
2680
|
+
newValue: i
|
|
2681
|
+
} : null;
|
|
2682
|
+
process.env.NODE_ENV !== "production" && u && R(f), o.setNewValue_(i), a && z(this, f), process.env.NODE_ENV !== "production" && u && C();
|
|
2683
|
+
}
|
|
2684
|
+
return !0;
|
|
2685
|
+
}, t.get_ = function(n) {
|
|
2686
|
+
return l.trackingDerivation && !G(this.target_, n) && this.has_(n), this.target_[n];
|
|
2687
|
+
}, t.set_ = function(n, i, o) {
|
|
2688
|
+
return o === void 0 && (o = !1), G(this.target_, n) ? this.values_.has(n) ? this.setObservablePropValue_(n, i) : o ? Reflect.set(this.target_, n, i) : (this.target_[n] = i, !0) : this.extend_(n, {
|
|
2689
|
+
value: i,
|
|
2690
|
+
enumerable: !0,
|
|
2691
|
+
writable: !0,
|
|
2692
|
+
configurable: !0
|
|
2693
|
+
}, this.defaultAnnotation_, o);
|
|
2694
|
+
}, t.has_ = function(n) {
|
|
2695
|
+
if (!l.trackingDerivation)
|
|
2696
|
+
return n in this.target_;
|
|
2697
|
+
this.pendingKeys_ || (this.pendingKeys_ = /* @__PURE__ */ new Map());
|
|
2698
|
+
var i = this.pendingKeys_.get(n);
|
|
2699
|
+
return i || (i = new de(n in this.target_, _t, process.env.NODE_ENV !== "production" ? this.name_ + "." + jt(n) + "?" : "ObservableObject.key?", !1), this.pendingKeys_.set(n, i)), i.get();
|
|
2700
|
+
}, t.make_ = function(n, i) {
|
|
2701
|
+
if (i === !0 && (i = this.defaultAnnotation_), i !== !1) {
|
|
2702
|
+
if (gn(this, i, n), !(n in this.target_)) {
|
|
2703
|
+
var o;
|
|
2704
|
+
if ((o = this.target_[ne]) != null && o[n])
|
|
2705
|
+
return;
|
|
2706
|
+
_(1, i.annotationType_, this.name_ + "." + n.toString());
|
|
2707
|
+
}
|
|
2708
|
+
for (var s = this.target_; s && s !== ct; ) {
|
|
2709
|
+
var a = Qe(s, n);
|
|
2710
|
+
if (a) {
|
|
2711
|
+
var u = i.make_(this, n, a, s);
|
|
2712
|
+
if (u === 0)
|
|
2713
|
+
return;
|
|
2714
|
+
if (u === 1)
|
|
2715
|
+
break;
|
|
2716
|
+
}
|
|
2717
|
+
s = Object.getPrototypeOf(s);
|
|
2718
|
+
}
|
|
2719
|
+
bn(this, i, n);
|
|
2720
|
+
}
|
|
2721
|
+
}, t.extend_ = function(n, i, o, s) {
|
|
2722
|
+
if (s === void 0 && (s = !1), o === !0 && (o = this.defaultAnnotation_), o === !1)
|
|
2723
|
+
return this.defineProperty_(n, i, s);
|
|
2724
|
+
gn(this, o, n);
|
|
2725
|
+
var a = o.extend_(this, n, i, s);
|
|
2726
|
+
return a && bn(this, o, n), a;
|
|
2727
|
+
}, t.defineProperty_ = function(n, i, o) {
|
|
2728
|
+
o === void 0 && (o = !1), J(this.keysAtom_);
|
|
2729
|
+
try {
|
|
2730
|
+
U();
|
|
2731
|
+
var s = this.delete_(n);
|
|
2732
|
+
if (!s)
|
|
2733
|
+
return s;
|
|
2734
|
+
if (L(this)) {
|
|
2735
|
+
var a = B(this, {
|
|
2736
|
+
object: this.proxy_ || this.target_,
|
|
2737
|
+
name: n,
|
|
2738
|
+
type: oe,
|
|
2739
|
+
newValue: i.value
|
|
2740
|
+
});
|
|
2741
|
+
if (!a)
|
|
2742
|
+
return null;
|
|
2743
|
+
var u = a.newValue;
|
|
2744
|
+
i.value !== u && (i = se({}, i, {
|
|
2745
|
+
value: u
|
|
2746
|
+
}));
|
|
2747
|
+
}
|
|
2748
|
+
if (o) {
|
|
2749
|
+
if (!Reflect.defineProperty(this.target_, n, i))
|
|
2750
|
+
return !1;
|
|
2751
|
+
} else
|
|
2752
|
+
Z(this.target_, n, i);
|
|
2753
|
+
this.notifyPropertyAddition_(n, i.value);
|
|
2754
|
+
} finally {
|
|
2755
|
+
I();
|
|
2756
|
+
}
|
|
2757
|
+
return !0;
|
|
2758
|
+
}, t.defineObservableProperty_ = function(n, i, o, s) {
|
|
2759
|
+
s === void 0 && (s = !1), J(this.keysAtom_);
|
|
2760
|
+
try {
|
|
2761
|
+
U();
|
|
2762
|
+
var a = this.delete_(n);
|
|
2763
|
+
if (!a)
|
|
2764
|
+
return a;
|
|
2765
|
+
if (L(this)) {
|
|
2766
|
+
var u = B(this, {
|
|
2767
|
+
object: this.proxy_ || this.target_,
|
|
2768
|
+
name: n,
|
|
2769
|
+
type: oe,
|
|
2770
|
+
newValue: i
|
|
2771
|
+
});
|
|
2772
|
+
if (!u)
|
|
2773
|
+
return null;
|
|
2774
|
+
i = u.newValue;
|
|
2775
|
+
}
|
|
2776
|
+
var f = pn(n), d = {
|
|
2777
|
+
configurable: l.safeDescriptors ? this.isPlainObject_ : !0,
|
|
2778
|
+
enumerable: !0,
|
|
2779
|
+
get: f.get,
|
|
2780
|
+
set: f.set
|
|
2781
|
+
};
|
|
2782
|
+
if (s) {
|
|
2783
|
+
if (!Reflect.defineProperty(this.target_, n, d))
|
|
2784
|
+
return !1;
|
|
2785
|
+
} else
|
|
2786
|
+
Z(this.target_, n, d);
|
|
2787
|
+
var p = new de(i, o, process.env.NODE_ENV !== "production" ? this.name_ + "." + n.toString() : "ObservableObject.key", !1);
|
|
2788
|
+
this.values_.set(n, p), this.notifyPropertyAddition_(n, p.value_);
|
|
2789
|
+
} finally {
|
|
2790
|
+
I();
|
|
2791
|
+
}
|
|
2792
|
+
return !0;
|
|
2793
|
+
}, t.defineComputedProperty_ = function(n, i, o) {
|
|
2794
|
+
o === void 0 && (o = !1), J(this.keysAtom_);
|
|
2795
|
+
try {
|
|
2796
|
+
U();
|
|
2797
|
+
var s = this.delete_(n);
|
|
2798
|
+
if (!s)
|
|
2799
|
+
return s;
|
|
2800
|
+
if (L(this)) {
|
|
2801
|
+
var a = B(this, {
|
|
2802
|
+
object: this.proxy_ || this.target_,
|
|
2803
|
+
name: n,
|
|
2804
|
+
type: oe,
|
|
2805
|
+
newValue: void 0
|
|
2806
|
+
});
|
|
2807
|
+
if (!a)
|
|
2808
|
+
return null;
|
|
2809
|
+
}
|
|
2810
|
+
i.name || (i.name = process.env.NODE_ENV !== "production" ? this.name_ + "." + n.toString() : "ObservableObject.key"), i.context = this.proxy_ || this.target_;
|
|
2811
|
+
var u = pn(n), f = {
|
|
2812
|
+
configurable: l.safeDescriptors ? this.isPlainObject_ : !0,
|
|
2813
|
+
enumerable: !1,
|
|
2814
|
+
get: u.get,
|
|
2815
|
+
set: u.set
|
|
2816
|
+
};
|
|
2817
|
+
if (o) {
|
|
2818
|
+
if (!Reflect.defineProperty(this.target_, n, f))
|
|
2819
|
+
return !1;
|
|
2820
|
+
} else
|
|
2821
|
+
Z(this.target_, n, f);
|
|
2822
|
+
this.values_.set(n, new F(i)), this.notifyPropertyAddition_(n, void 0);
|
|
2823
|
+
} finally {
|
|
2824
|
+
I();
|
|
2825
|
+
}
|
|
2826
|
+
return !0;
|
|
2827
|
+
}, t.delete_ = function(n, i) {
|
|
2828
|
+
if (i === void 0 && (i = !1), J(this.keysAtom_), !G(this.target_, n))
|
|
2829
|
+
return !0;
|
|
2830
|
+
if (L(this)) {
|
|
2831
|
+
var o = B(this, {
|
|
2832
|
+
object: this.proxy_ || this.target_,
|
|
2833
|
+
name: n,
|
|
2834
|
+
type: hn
|
|
2835
|
+
});
|
|
2836
|
+
if (!o)
|
|
2837
|
+
return null;
|
|
2838
|
+
}
|
|
2839
|
+
try {
|
|
2840
|
+
var s;
|
|
2841
|
+
U();
|
|
2842
|
+
var a = q(this), u = process.env.NODE_ENV !== "production" && w(), f = this.values_.get(n), d = void 0;
|
|
2843
|
+
if (!f && (a || u)) {
|
|
2844
|
+
var p;
|
|
2845
|
+
d = (p = Qe(this.target_, n)) == null ? void 0 : p.value;
|
|
2846
|
+
}
|
|
2847
|
+
if (i) {
|
|
2848
|
+
if (!Reflect.deleteProperty(this.target_, n))
|
|
2849
|
+
return !1;
|
|
2850
|
+
} else
|
|
2851
|
+
delete this.target_[n];
|
|
2852
|
+
if (process.env.NODE_ENV !== "production" && delete this.appliedAnnotations_[n], f && (this.values_.delete(n), f instanceof de && (d = f.value_), qn(f)), this.keysAtom_.reportChanged(), (s = this.pendingKeys_) == null || (s = s.get(n)) == null || s.set(n in this.target_), a || u) {
|
|
2853
|
+
var g = {
|
|
2854
|
+
type: hn,
|
|
2855
|
+
observableKind: "object",
|
|
2856
|
+
object: this.proxy_ || this.target_,
|
|
2857
|
+
debugObjectName: this.name_,
|
|
2858
|
+
oldValue: d,
|
|
2859
|
+
name: n
|
|
2860
|
+
};
|
|
2861
|
+
process.env.NODE_ENV !== "production" && u && R(g), a && z(this, g), process.env.NODE_ENV !== "production" && u && C();
|
|
2862
|
+
}
|
|
2863
|
+
} finally {
|
|
2864
|
+
I();
|
|
2865
|
+
}
|
|
2866
|
+
return !0;
|
|
2867
|
+
}, t.observe_ = function(n, i) {
|
|
2868
|
+
return process.env.NODE_ENV !== "production" && i === !0 && _("`observe` doesn't support the fire immediately property for observable objects."), ze(this, n);
|
|
2869
|
+
}, t.intercept_ = function(n) {
|
|
2870
|
+
return qe(this, n);
|
|
2871
|
+
}, t.notifyPropertyAddition_ = function(n, i) {
|
|
2872
|
+
var o, s = q(this), a = process.env.NODE_ENV !== "production" && w();
|
|
2873
|
+
if (s || a) {
|
|
2874
|
+
var u = s || a ? {
|
|
2875
|
+
type: oe,
|
|
2876
|
+
observableKind: "object",
|
|
2877
|
+
debugObjectName: this.name_,
|
|
2878
|
+
object: this.proxy_ || this.target_,
|
|
2879
|
+
name: n,
|
|
2880
|
+
newValue: i
|
|
2881
|
+
} : null;
|
|
2882
|
+
process.env.NODE_ENV !== "production" && a && R(u), s && z(this, u), process.env.NODE_ENV !== "production" && a && C();
|
|
2883
|
+
}
|
|
2884
|
+
(o = this.pendingKeys_) == null || (o = o.get(n)) == null || o.set(!0), this.keysAtom_.reportChanged();
|
|
2885
|
+
}, t.ownKeys_ = function() {
|
|
2886
|
+
return this.keysAtom_.reportObserved(), Be(this.target_);
|
|
2887
|
+
}, t.keys_ = function() {
|
|
2888
|
+
return this.keysAtom_.reportObserved(), Object.keys(this.target_);
|
|
2889
|
+
}, e;
|
|
2890
|
+
})();
|
|
2891
|
+
function xe(e, t) {
|
|
2892
|
+
var r;
|
|
2893
|
+
if (process.env.NODE_ENV !== "production" && t && Pe(e) && _("Options can't be provided for already observable objects."), G(e, v))
|
|
2894
|
+
return process.env.NODE_ENV !== "production" && !(cr(e) instanceof kt) && _("Cannot convert '" + ut(e) + `' into observable object:
|
|
2895
|
+
The target is already observable of different type.
|
|
2896
|
+
Extending builtins is not supported.`), e;
|
|
2897
|
+
process.env.NODE_ENV !== "production" && !Object.isExtensible(e) && _("Cannot make the designated object observable; it is not extensible");
|
|
2898
|
+
var n = (r = t?.name) != null ? r : process.env.NODE_ENV !== "production" ? (P(e) ? "ObservableObject" : e.constructor.name) + "@" + Y() : "ObservableObject", i = new kt(e, /* @__PURE__ */ new Map(), String(n), pi(t));
|
|
2899
|
+
return ft(e, v, i), e;
|
|
2900
|
+
}
|
|
2901
|
+
var lo = /* @__PURE__ */ ge("ObservableObjectAdministration", kt);
|
|
2902
|
+
function pn(e) {
|
|
2903
|
+
return vn[e] || (vn[e] = {
|
|
2904
|
+
get: function() {
|
|
2905
|
+
return this[v].getObservablePropValue_(e);
|
|
2906
|
+
},
|
|
2907
|
+
set: function(r) {
|
|
2908
|
+
return this[v].setObservablePropValue_(e, r);
|
|
2909
|
+
}
|
|
2910
|
+
});
|
|
2911
|
+
}
|
|
2912
|
+
function Pe(e) {
|
|
2913
|
+
return lt(e) ? lo(e[v]) : !1;
|
|
2914
|
+
}
|
|
2915
|
+
function bn(e, t, r) {
|
|
2916
|
+
var n;
|
|
2917
|
+
process.env.NODE_ENV !== "production" && (e.appliedAnnotations_[r] = t), (n = e.target_[ne]) == null || delete n[r];
|
|
2918
|
+
}
|
|
2919
|
+
function gn(e, t, r) {
|
|
2920
|
+
if (process.env.NODE_ENV !== "production" && !fr(t) && _("Cannot annotate '" + e.name_ + "." + r.toString() + "': Invalid annotation."), process.env.NODE_ENV !== "production" && !nt(t) && G(e.appliedAnnotations_, r)) {
|
|
2921
|
+
var n = e.name_ + "." + r.toString(), i = e.appliedAnnotations_[r].annotationType_, o = t.annotationType_;
|
|
2922
|
+
_("Cannot apply '" + o + "' to '" + n + "':" + (`
|
|
2923
|
+
The field is already annotated with '` + i + "'.") + `
|
|
2924
|
+
Re-annotating fields is not allowed.
|
|
2925
|
+
Use 'override' annotation for methods overridden by subclass.`);
|
|
2926
|
+
}
|
|
2927
|
+
}
|
|
2928
|
+
var fo = /* @__PURE__ */ ar(0), _o = /* @__PURE__ */ (function() {
|
|
2929
|
+
var e = !1, t = {};
|
|
2930
|
+
return Object.defineProperty(t, "0", {
|
|
2931
|
+
set: function() {
|
|
2932
|
+
e = !0;
|
|
2933
|
+
}
|
|
2934
|
+
}), Object.create(t)[0] = 1, e === !1;
|
|
2935
|
+
})(), Dt = 0, sr = function() {
|
|
2936
|
+
};
|
|
2937
|
+
function vo(e, t) {
|
|
2938
|
+
Object.setPrototypeOf ? Object.setPrototypeOf(e.prototype, t) : e.prototype.__proto__ !== void 0 ? e.prototype.__proto__ = t : e.prototype = t;
|
|
2939
|
+
}
|
|
2940
|
+
vo(sr, Array.prototype);
|
|
2941
|
+
var Yt = /* @__PURE__ */ (function(e) {
|
|
2942
|
+
function t(n, i, o, s) {
|
|
2943
|
+
var a;
|
|
2944
|
+
return o === void 0 && (o = process.env.NODE_ENV !== "production" ? "ObservableArray@" + Y() : "ObservableArray"), s === void 0 && (s = !1), a = e.call(this) || this, Oe(function() {
|
|
2945
|
+
var u = new zt(o, i, s, !0);
|
|
2946
|
+
u.proxy_ = a, wn(a, v, u), n && n.length && a.spliceWithArray(0, 0, n), _o && Object.defineProperty(a, "0", fo);
|
|
2947
|
+
}), a;
|
|
2948
|
+
}
|
|
2949
|
+
Vn(t, e);
|
|
2950
|
+
var r = t.prototype;
|
|
2951
|
+
return r.concat = function() {
|
|
2952
|
+
this[v].atom_.reportObserved();
|
|
2953
|
+
for (var i = arguments.length, o = new Array(i), s = 0; s < i; s++)
|
|
2954
|
+
o[s] = arguments[s];
|
|
2955
|
+
return Array.prototype.concat.apply(
|
|
2956
|
+
this.slice(),
|
|
2957
|
+
//@ts-ignore
|
|
2958
|
+
o.map(function(a) {
|
|
2959
|
+
return bt(a) ? a.slice() : a;
|
|
2960
|
+
})
|
|
2961
|
+
);
|
|
2962
|
+
}, r[Symbol.iterator] = function() {
|
|
2963
|
+
var n = this, i = 0;
|
|
2964
|
+
return Wt({
|
|
2965
|
+
next: function() {
|
|
2966
|
+
return i < n.length ? {
|
|
2967
|
+
value: n[i++],
|
|
2968
|
+
done: !1
|
|
2969
|
+
} : {
|
|
2970
|
+
done: !0,
|
|
2971
|
+
value: void 0
|
|
2972
|
+
};
|
|
2973
|
+
}
|
|
2974
|
+
});
|
|
2975
|
+
}, Te(t, [{
|
|
2976
|
+
key: "length",
|
|
2977
|
+
get: function() {
|
|
2978
|
+
return this[v].getArrayLength_();
|
|
2979
|
+
},
|
|
2980
|
+
set: function(i) {
|
|
2981
|
+
this[v].setArrayLength_(i);
|
|
2982
|
+
}
|
|
2983
|
+
}, {
|
|
2984
|
+
key: Symbol.toStringTag,
|
|
2985
|
+
get: function() {
|
|
2986
|
+
return "Array";
|
|
2987
|
+
}
|
|
2988
|
+
}]);
|
|
2989
|
+
})(sr);
|
|
2990
|
+
Object.entries(st).forEach(function(e) {
|
|
2991
|
+
var t = e[0], r = e[1];
|
|
2992
|
+
t !== "concat" && ft(Yt.prototype, t, r);
|
|
2993
|
+
});
|
|
2994
|
+
function ar(e) {
|
|
2995
|
+
return {
|
|
2996
|
+
enumerable: !1,
|
|
2997
|
+
configurable: !0,
|
|
2998
|
+
get: function() {
|
|
2999
|
+
return this[v].get_(e);
|
|
3000
|
+
},
|
|
3001
|
+
set: function(r) {
|
|
3002
|
+
this[v].set_(e, r);
|
|
3003
|
+
}
|
|
3004
|
+
};
|
|
3005
|
+
}
|
|
3006
|
+
function ho(e) {
|
|
3007
|
+
Z(Yt.prototype, "" + e, ar(e));
|
|
3008
|
+
}
|
|
3009
|
+
function ur(e) {
|
|
3010
|
+
if (e > Dt) {
|
|
3011
|
+
for (var t = Dt; t < e + 100; t++)
|
|
3012
|
+
ho(t);
|
|
3013
|
+
Dt = e;
|
|
3014
|
+
}
|
|
3015
|
+
}
|
|
3016
|
+
ur(1e3);
|
|
3017
|
+
function po(e, t, r) {
|
|
3018
|
+
return new Yt(e, t, r);
|
|
3019
|
+
}
|
|
3020
|
+
function je(e, t) {
|
|
3021
|
+
if (typeof e == "object" && e !== null) {
|
|
3022
|
+
if (bt(e))
|
|
3023
|
+
return t !== void 0 && _(23), e[v].atom_;
|
|
3024
|
+
if (X(e))
|
|
3025
|
+
return e.atom_;
|
|
3026
|
+
if (ce(e)) {
|
|
3027
|
+
if (t === void 0)
|
|
3028
|
+
return e.keysAtom_;
|
|
3029
|
+
var r = e.data_.get(t) || e.hasMap_.get(t);
|
|
3030
|
+
return r || _(25, t, ut(e)), r;
|
|
3031
|
+
}
|
|
3032
|
+
if (Pe(e)) {
|
|
3033
|
+
if (!t)
|
|
3034
|
+
return _(26);
|
|
3035
|
+
var n = e[v].values_.get(t);
|
|
3036
|
+
return n || _(27, t, ut(e)), n;
|
|
3037
|
+
}
|
|
3038
|
+
if (It(e) || pt(e) || ot(e))
|
|
3039
|
+
return e;
|
|
3040
|
+
} else if (A(e) && ot(e[v]))
|
|
3041
|
+
return e[v];
|
|
3042
|
+
_(28);
|
|
3043
|
+
}
|
|
3044
|
+
function cr(e, t) {
|
|
3045
|
+
if (e || _(29), It(e) || pt(e) || ot(e) || ce(e) || X(e))
|
|
3046
|
+
return e;
|
|
3047
|
+
if (e[v])
|
|
3048
|
+
return e[v];
|
|
3049
|
+
_(24, e);
|
|
3050
|
+
}
|
|
3051
|
+
function ut(e, t) {
|
|
3052
|
+
var r;
|
|
3053
|
+
if (t !== void 0)
|
|
3054
|
+
r = je(e, t);
|
|
3055
|
+
else {
|
|
3056
|
+
if (be(e))
|
|
3057
|
+
return e.name;
|
|
3058
|
+
Pe(e) || ce(e) || X(e) ? r = cr(e) : r = je(e);
|
|
3059
|
+
}
|
|
3060
|
+
return r.name_;
|
|
3061
|
+
}
|
|
3062
|
+
function Oe(e) {
|
|
3063
|
+
var t = me(), r = Ft(!0);
|
|
3064
|
+
U();
|
|
3065
|
+
try {
|
|
3066
|
+
return e();
|
|
3067
|
+
} finally {
|
|
3068
|
+
I(), Kt(r), ie(t);
|
|
3069
|
+
}
|
|
3070
|
+
}
|
|
3071
|
+
var mn = ct.toString;
|
|
3072
|
+
function lr(e, t, r) {
|
|
3073
|
+
return r === void 0 && (r = -1), Lt(e, t, r);
|
|
3074
|
+
}
|
|
3075
|
+
function Lt(e, t, r, n, i) {
|
|
3076
|
+
if (e === t)
|
|
3077
|
+
return e !== 0 || 1 / e === 1 / t;
|
|
3078
|
+
if (e == null || t == null)
|
|
3079
|
+
return !1;
|
|
3080
|
+
if (e !== e)
|
|
3081
|
+
return t !== t;
|
|
3082
|
+
var o = typeof e;
|
|
3083
|
+
if (o !== "function" && o !== "object" && typeof t != "object")
|
|
3084
|
+
return !1;
|
|
3085
|
+
var s = mn.call(e);
|
|
3086
|
+
if (s !== mn.call(t))
|
|
3087
|
+
return !1;
|
|
3088
|
+
switch (s) {
|
|
3089
|
+
// Strings, numbers, regular expressions, dates, and booleans are compared by value.
|
|
3090
|
+
case "[object RegExp]":
|
|
3091
|
+
// RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')
|
|
3092
|
+
case "[object String]":
|
|
3093
|
+
return "" + e == "" + t;
|
|
3094
|
+
case "[object Number]":
|
|
3095
|
+
return +e != +e ? +t != +t : +e == 0 ? 1 / +e === 1 / t : +e == +t;
|
|
3096
|
+
case "[object Date]":
|
|
3097
|
+
case "[object Boolean]":
|
|
3098
|
+
return +e == +t;
|
|
3099
|
+
case "[object Symbol]":
|
|
3100
|
+
return typeof Symbol < "u" && Symbol.valueOf.call(e) === Symbol.valueOf.call(t);
|
|
3101
|
+
case "[object Map]":
|
|
3102
|
+
case "[object Set]":
|
|
3103
|
+
r >= 0 && r++;
|
|
3104
|
+
break;
|
|
3105
|
+
}
|
|
3106
|
+
e = On(e), t = On(t);
|
|
3107
|
+
var a = s === "[object Array]";
|
|
3108
|
+
if (!a) {
|
|
3109
|
+
if (typeof e != "object" || typeof t != "object")
|
|
3110
|
+
return !1;
|
|
3111
|
+
var u = e.constructor, f = t.constructor;
|
|
3112
|
+
if (u !== f && !(A(u) && u instanceof u && A(f) && f instanceof f) && "constructor" in e && "constructor" in t)
|
|
3113
|
+
return !1;
|
|
3114
|
+
}
|
|
3115
|
+
if (r === 0)
|
|
3116
|
+
return !1;
|
|
3117
|
+
r < 0 && (r = -1), n = n || [], i = i || [];
|
|
3118
|
+
for (var d = n.length; d--; )
|
|
3119
|
+
if (n[d] === e)
|
|
3120
|
+
return i[d] === t;
|
|
3121
|
+
if (n.push(e), i.push(t), a) {
|
|
3122
|
+
if (d = e.length, d !== t.length)
|
|
3123
|
+
return !1;
|
|
3124
|
+
for (; d--; )
|
|
3125
|
+
if (!Lt(e[d], t[d], r - 1, n, i))
|
|
3126
|
+
return !1;
|
|
3127
|
+
} else {
|
|
3128
|
+
var p = Object.keys(e), g = p.length;
|
|
3129
|
+
if (Object.keys(t).length !== g)
|
|
3130
|
+
return !1;
|
|
3131
|
+
for (var y = 0; y < g; y++) {
|
|
3132
|
+
var V = p[y];
|
|
3133
|
+
if (!(G(t, V) && Lt(e[V], t[V], r - 1, n, i)))
|
|
3134
|
+
return !1;
|
|
3135
|
+
}
|
|
3136
|
+
}
|
|
3137
|
+
return n.pop(), i.pop(), !0;
|
|
3138
|
+
}
|
|
3139
|
+
function On(e) {
|
|
3140
|
+
return bt(e) ? e.slice() : Ve(e) || ce(e) || te(e) || X(e) ? Array.from(e.entries()) : e;
|
|
3141
|
+
}
|
|
3142
|
+
var yn, bo = ((yn = Bt().Iterator) == null ? void 0 : yn.prototype) || {};
|
|
3143
|
+
function Wt(e) {
|
|
3144
|
+
return e[Symbol.iterator] = go, Object.assign(Object.create(bo), e);
|
|
3145
|
+
}
|
|
3146
|
+
function go() {
|
|
3147
|
+
return this;
|
|
3148
|
+
}
|
|
3149
|
+
function fr(e) {
|
|
3150
|
+
return (
|
|
3151
|
+
// Can be function
|
|
3152
|
+
e instanceof Object && typeof e.annotationType_ == "string" && A(e.make_) && A(e.extend_)
|
|
3153
|
+
);
|
|
3154
|
+
}
|
|
3155
|
+
["Symbol", "Map", "Set"].forEach(function(e) {
|
|
3156
|
+
var t = Bt();
|
|
3157
|
+
typeof t[e] > "u" && _("MobX requires global '" + e + "' to be available or polyfilled");
|
|
3158
|
+
});
|
|
3159
|
+
typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__ == "object" && __MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({
|
|
3160
|
+
spy: ki,
|
|
3161
|
+
extras: {
|
|
3162
|
+
getDebugName: ut
|
|
3163
|
+
},
|
|
3164
|
+
$mobx: v
|
|
3165
|
+
});
|
|
3166
|
+
class mo {
|
|
3167
|
+
canvas = null;
|
|
3168
|
+
constructor() {
|
|
3169
|
+
nr(this);
|
|
3170
|
+
}
|
|
3171
|
+
setCanvas(t) {
|
|
3172
|
+
this.canvas = t;
|
|
3173
|
+
}
|
|
3174
|
+
}
|
|
3175
|
+
class Oo {
|
|
3176
|
+
tool = null;
|
|
3177
|
+
constructor() {
|
|
3178
|
+
nr(this);
|
|
3179
|
+
}
|
|
3180
|
+
setTool(t) {
|
|
3181
|
+
this.tool = t;
|
|
3182
|
+
}
|
|
3183
|
+
}
|
|
3184
|
+
class dr {
|
|
3185
|
+
canvas;
|
|
3186
|
+
ctx;
|
|
3187
|
+
drawing = !1;
|
|
3188
|
+
constructor(t) {
|
|
3189
|
+
this.canvas = t, this.ctx = t.getContext("2d"), this.ctx.strokeStyle = "black", this.ctx.lineWidth = 2, this.mouseDownHandler = this.mouseDownHandler.bind(this), this.mouseMoveHandler = this.mouseMoveHandler.bind(this), this.mouseUpHandler = this.mouseUpHandler.bind(this), this.init();
|
|
3190
|
+
}
|
|
3191
|
+
init() {
|
|
3192
|
+
this.canvas.addEventListener("mousedown", this.mouseDownHandler), this.canvas.addEventListener("mousemove", this.mouseMoveHandler), this.canvas.addEventListener("mouseup", this.mouseUpHandler);
|
|
3193
|
+
}
|
|
3194
|
+
mouseDownHandler(t) {
|
|
3195
|
+
this.drawing = !0, this.ctx.beginPath(), this.ctx.moveTo(t.offsetX, t.offsetY);
|
|
3196
|
+
}
|
|
3197
|
+
mouseMoveHandler(t) {
|
|
3198
|
+
this.drawing && (this.ctx.lineTo(t.offsetX, t.offsetY), this.ctx.stroke());
|
|
3199
|
+
}
|
|
3200
|
+
mouseUpHandler() {
|
|
3201
|
+
this.drawing = !1;
|
|
3202
|
+
}
|
|
3203
|
+
}
|
|
3204
|
+
const yo = ({ canvasStore: e, toolStore: t, width: r = 800, height: n = 600 }) => {
|
|
3205
|
+
const i = mr(null);
|
|
3206
|
+
return Or(() => {
|
|
3207
|
+
i.current && (e.setCanvas(i.current), t.setTool(new dr(i.current)));
|
|
3208
|
+
}, [i.current]), /* @__PURE__ */ we.jsx("canvas", { ref: i, width: r, height: n, style: { border: "1px solid #000" } });
|
|
3209
|
+
}, Eo = ({ canvasStore: e, toolStore: t }) => /* @__PURE__ */ we.jsx("div", { style: { marginBottom: 10 }, children: /* @__PURE__ */ we.jsx("button", { onClick: () => e.canvas && t.setTool(new dr(e.canvas)), children: "Кисть" }) }), Ao = ({ width: e = 800, height: t = 600 }) => {
|
|
3210
|
+
const r = new mo(), n = new Oo();
|
|
3211
|
+
return /* @__PURE__ */ we.jsxs("div", { children: [
|
|
3212
|
+
/* @__PURE__ */ we.jsx(Eo, { canvasStore: r, toolStore: n }),
|
|
3213
|
+
/* @__PURE__ */ we.jsx(yo, { canvasStore: r, toolStore: n, width: e, height: t })
|
|
3214
|
+
] });
|
|
3215
|
+
};
|
|
3216
|
+
export {
|
|
3217
|
+
Ao as CanvasLight,
|
|
3218
|
+
mo as CanvasStore,
|
|
3219
|
+
Oo as ToolStore
|
|
3220
|
+
};
|