@m4l/layouts 9.1.13 → 9.1.15
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/components/ModuleDetailTabs/useModuleDatailTabs.d.ts +83 -83
- package/hooks/index.d.ts +1 -0
- package/hooks/useDynamicAccordions/useBaseAccordions.js +2 -2
- package/hooks/useDynamicPaperForm/index.d.ts +2 -0
- package/hooks/useDynamicPaperForm/index.js +1 -0
- package/hooks/useDynamicPaperForm/types.d.ts +25 -0
- package/hooks/useDynamicPaperForm/useDynamicPaperForm.d.ts +9 -0
- package/hooks/useDynamicPaperForm/useDynamicPaperForm.js +55 -0
- package/index.js +5 -2
- package/layouts/MasterDetailLayout/MasterDetailLayout.js +15 -18
- package/layouts/MasterDetailLayout/constants.d.ts +2 -0
- package/layouts/MasterDetailLayout/constants.js +6 -0
- package/layouts/MasterDetailLayout/contexts/MasterDetailContext/index.js +14 -5
- package/layouts/MasterDetailLayout/contexts/MasterDetailContext/store.d.ts +16 -0
- package/layouts/MasterDetailLayout/contexts/MasterDetailContext/store.js +50 -0
- package/layouts/MasterDetailLayout/contexts/MasterDetailContext/types.d.ts +28 -0
- package/layouts/MasterDetailLayout/dicctionary.d.ts +6 -2
- package/layouts/MasterDetailLayout/dicctionary.js +8 -3
- package/layouts/MasterDetailLayout/helpers/getTotalModuleActions.d.ts +5 -0
- package/layouts/MasterDetailLayout/helpers/getTotalModuleActions.js +8 -0
- package/layouts/MasterDetailLayout/icons.d.ts +5 -0
- package/layouts/MasterDetailLayout/icons.js +8 -0
- package/layouts/MasterDetailLayout/slots/MasterDetailLayoutEnum.d.ts +3 -0
- package/layouts/MasterDetailLayout/slots/MasterDetailLayoutEnum.js +7 -0
- package/layouts/MasterDetailLayout/slots/MasterDetailLayoutSlot.d.ts +1 -0
- package/layouts/MasterDetailLayout/slots/MasterDetailLayoutSlot.js +11 -0
- package/layouts/MasterDetailLayout/styles.d.ts +2 -1
- package/layouts/MasterDetailLayout/styles.js +37 -5
- package/layouts/MasterDetailLayout/tests/MasterDetailLayout.test.d.ts +1 -0
- package/layouts/MasterDetailLayout/types.d.ts +6 -0
- package/layouts/ModuleLayout/contexts/ModuleContext/store.js +3 -1
- package/package.json +1 -1
- package/storybook/layouts/MasterDetailLayout/MasterDetailLayout.stories.d.ts +6 -0
- package/storybook/layouts/MasterDetailLayout/moks/mokData.d.ts +7 -0
- package/storybook/layouts/MasterDetailLayout/subcomponents/RenderMasterDetailLayout.d.ts +6 -0
- package/test/constants.d.ts +0 -2
- package/test/mocks.d.ts +2 -0
- package/commonjs/index.js +0 -7
- package/layouts/MasterDetailLayout/classes/constants.d.ts +0 -1
- package/layouts/MasterDetailLayout/classes/constants.js +0 -4
- package/layouts/MasterDetailLayout/classes/index.d.ts +0 -9
- package/layouts/MasterDetailLayout/classes/index.js +0 -23
- package/layouts/MasterDetailLayout/classes/types.d.ts +0 -6
- package/not_recognized/index.js +0 -963
package/not_recognized/index.js
DELETED
|
@@ -1,963 +0,0 @@
|
|
|
1
|
-
import require$$0, { useDebugValue } from "react";
|
|
2
|
-
import { g as getDefaultExportFromCjs } from "../commonjs/index.js";
|
|
3
|
-
const createStoreImpl = (createState) => {
|
|
4
|
-
let state;
|
|
5
|
-
const listeners = /* @__PURE__ */ new Set();
|
|
6
|
-
const setState = (partial, replace) => {
|
|
7
|
-
const nextState = typeof partial === "function" ? partial(state) : partial;
|
|
8
|
-
if (!Object.is(nextState, state)) {
|
|
9
|
-
const previousState = state;
|
|
10
|
-
state = (replace != null ? replace : typeof nextState !== "object") ? nextState : Object.assign({}, state, nextState);
|
|
11
|
-
listeners.forEach((listener) => listener(state, previousState));
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
const getState = () => state;
|
|
15
|
-
const subscribe = (listener) => {
|
|
16
|
-
listeners.add(listener);
|
|
17
|
-
return () => listeners.delete(listener);
|
|
18
|
-
};
|
|
19
|
-
const destroy = () => {
|
|
20
|
-
listeners.clear();
|
|
21
|
-
};
|
|
22
|
-
const api = { setState, getState, subscribe, destroy };
|
|
23
|
-
state = createState(setState, getState, api);
|
|
24
|
-
return api;
|
|
25
|
-
};
|
|
26
|
-
const createStore = (createState) => createState ? createStoreImpl(createState) : createStoreImpl;
|
|
27
|
-
var withSelector = { exports: {} };
|
|
28
|
-
var withSelector_production_min = {};
|
|
29
|
-
var shim = { exports: {} };
|
|
30
|
-
var useSyncExternalStoreShim_production_min = {};
|
|
31
|
-
/**
|
|
32
|
-
* @license React
|
|
33
|
-
* use-sync-external-store-shim.production.min.js
|
|
34
|
-
*
|
|
35
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
36
|
-
*
|
|
37
|
-
* This source code is licensed under the MIT license found in the
|
|
38
|
-
* LICENSE file in the root directory of this source tree.
|
|
39
|
-
*/
|
|
40
|
-
var hasRequiredUseSyncExternalStoreShim_production_min;
|
|
41
|
-
function requireUseSyncExternalStoreShim_production_min() {
|
|
42
|
-
if (hasRequiredUseSyncExternalStoreShim_production_min) return useSyncExternalStoreShim_production_min;
|
|
43
|
-
hasRequiredUseSyncExternalStoreShim_production_min = 1;
|
|
44
|
-
var e = require$$0;
|
|
45
|
-
function h2(a2, b2) {
|
|
46
|
-
return a2 === b2 && (0 !== a2 || 1 / a2 === 1 / b2) || a2 !== a2 && b2 !== b2;
|
|
47
|
-
}
|
|
48
|
-
var k2 = "function" === typeof Object.is ? Object.is : h2, l2 = e.useState, m = e.useEffect, n2 = e.useLayoutEffect, p2 = e.useDebugValue;
|
|
49
|
-
function q2(a2, b2) {
|
|
50
|
-
var d2 = b2(), f2 = l2({ inst: { value: d2, getSnapshot: b2 } }), c2 = f2[0].inst, g2 = f2[1];
|
|
51
|
-
n2(function() {
|
|
52
|
-
c2.value = d2;
|
|
53
|
-
c2.getSnapshot = b2;
|
|
54
|
-
r2(c2) && g2({ inst: c2 });
|
|
55
|
-
}, [a2, d2, b2]);
|
|
56
|
-
m(function() {
|
|
57
|
-
r2(c2) && g2({ inst: c2 });
|
|
58
|
-
return a2(function() {
|
|
59
|
-
r2(c2) && g2({ inst: c2 });
|
|
60
|
-
});
|
|
61
|
-
}, [a2]);
|
|
62
|
-
p2(d2);
|
|
63
|
-
return d2;
|
|
64
|
-
}
|
|
65
|
-
function r2(a2) {
|
|
66
|
-
var b2 = a2.getSnapshot;
|
|
67
|
-
a2 = a2.value;
|
|
68
|
-
try {
|
|
69
|
-
var d2 = b2();
|
|
70
|
-
return !k2(a2, d2);
|
|
71
|
-
} catch (f2) {
|
|
72
|
-
return true;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
function t2(a2, b2) {
|
|
76
|
-
return b2();
|
|
77
|
-
}
|
|
78
|
-
var u2 = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? t2 : q2;
|
|
79
|
-
useSyncExternalStoreShim_production_min.useSyncExternalStore = void 0 !== e.useSyncExternalStore ? e.useSyncExternalStore : u2;
|
|
80
|
-
return useSyncExternalStoreShim_production_min;
|
|
81
|
-
}
|
|
82
|
-
var useSyncExternalStoreShim_development = {};
|
|
83
|
-
/**
|
|
84
|
-
* @license React
|
|
85
|
-
* use-sync-external-store-shim.development.js
|
|
86
|
-
*
|
|
87
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
88
|
-
*
|
|
89
|
-
* This source code is licensed under the MIT license found in the
|
|
90
|
-
* LICENSE file in the root directory of this source tree.
|
|
91
|
-
*/
|
|
92
|
-
var hasRequiredUseSyncExternalStoreShim_development;
|
|
93
|
-
function requireUseSyncExternalStoreShim_development() {
|
|
94
|
-
if (hasRequiredUseSyncExternalStoreShim_development) return useSyncExternalStoreShim_development;
|
|
95
|
-
hasRequiredUseSyncExternalStoreShim_development = 1;
|
|
96
|
-
if (process.env.NODE_ENV !== "production") {
|
|
97
|
-
(function() {
|
|
98
|
-
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") {
|
|
99
|
-
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
|
|
100
|
-
}
|
|
101
|
-
var React = require$$0;
|
|
102
|
-
var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
103
|
-
function error(format) {
|
|
104
|
-
{
|
|
105
|
-
{
|
|
106
|
-
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
107
|
-
args[_key2 - 1] = arguments[_key2];
|
|
108
|
-
}
|
|
109
|
-
printWarning("error", format, args);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
function printWarning(level, format, args) {
|
|
114
|
-
{
|
|
115
|
-
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
116
|
-
var stack = ReactDebugCurrentFrame.getStackAddendum();
|
|
117
|
-
if (stack !== "") {
|
|
118
|
-
format += "%s";
|
|
119
|
-
args = args.concat([stack]);
|
|
120
|
-
}
|
|
121
|
-
var argsWithFormat = args.map(function(item) {
|
|
122
|
-
return String(item);
|
|
123
|
-
});
|
|
124
|
-
argsWithFormat.unshift("Warning: " + format);
|
|
125
|
-
Function.prototype.apply.call(console[level], console, argsWithFormat);
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
function is(x2, y2) {
|
|
129
|
-
return x2 === y2 && (x2 !== 0 || 1 / x2 === 1 / y2) || x2 !== x2 && y2 !== y2;
|
|
130
|
-
}
|
|
131
|
-
var objectIs = typeof Object.is === "function" ? Object.is : is;
|
|
132
|
-
var useState = React.useState, useEffect = React.useEffect, useLayoutEffect = React.useLayoutEffect, useDebugValue2 = React.useDebugValue;
|
|
133
|
-
var didWarnOld18Alpha = false;
|
|
134
|
-
var didWarnUncachedGetSnapshot = false;
|
|
135
|
-
function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
|
|
136
|
-
{
|
|
137
|
-
if (!didWarnOld18Alpha) {
|
|
138
|
-
if (React.startTransition !== void 0) {
|
|
139
|
-
didWarnOld18Alpha = true;
|
|
140
|
-
error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release.");
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
var value = getSnapshot();
|
|
145
|
-
{
|
|
146
|
-
if (!didWarnUncachedGetSnapshot) {
|
|
147
|
-
var cachedValue = getSnapshot();
|
|
148
|
-
if (!objectIs(value, cachedValue)) {
|
|
149
|
-
error("The result of getSnapshot should be cached to avoid an infinite loop");
|
|
150
|
-
didWarnUncachedGetSnapshot = true;
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
var _useState = useState({
|
|
155
|
-
inst: {
|
|
156
|
-
value,
|
|
157
|
-
getSnapshot
|
|
158
|
-
}
|
|
159
|
-
}), inst = _useState[0].inst, forceUpdate = _useState[1];
|
|
160
|
-
useLayoutEffect(function() {
|
|
161
|
-
inst.value = value;
|
|
162
|
-
inst.getSnapshot = getSnapshot;
|
|
163
|
-
if (checkIfSnapshotChanged(inst)) {
|
|
164
|
-
forceUpdate({
|
|
165
|
-
inst
|
|
166
|
-
});
|
|
167
|
-
}
|
|
168
|
-
}, [subscribe, value, getSnapshot]);
|
|
169
|
-
useEffect(function() {
|
|
170
|
-
if (checkIfSnapshotChanged(inst)) {
|
|
171
|
-
forceUpdate({
|
|
172
|
-
inst
|
|
173
|
-
});
|
|
174
|
-
}
|
|
175
|
-
var handleStoreChange = function() {
|
|
176
|
-
if (checkIfSnapshotChanged(inst)) {
|
|
177
|
-
forceUpdate({
|
|
178
|
-
inst
|
|
179
|
-
});
|
|
180
|
-
}
|
|
181
|
-
};
|
|
182
|
-
return subscribe(handleStoreChange);
|
|
183
|
-
}, [subscribe]);
|
|
184
|
-
useDebugValue2(value);
|
|
185
|
-
return value;
|
|
186
|
-
}
|
|
187
|
-
function checkIfSnapshotChanged(inst) {
|
|
188
|
-
var latestGetSnapshot = inst.getSnapshot;
|
|
189
|
-
var prevValue = inst.value;
|
|
190
|
-
try {
|
|
191
|
-
var nextValue = latestGetSnapshot();
|
|
192
|
-
return !objectIs(prevValue, nextValue);
|
|
193
|
-
} catch (error2) {
|
|
194
|
-
return true;
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
function useSyncExternalStore$1(subscribe, getSnapshot, getServerSnapshot) {
|
|
198
|
-
return getSnapshot();
|
|
199
|
-
}
|
|
200
|
-
var canUseDOM = !!(typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined");
|
|
201
|
-
var isServerEnvironment = !canUseDOM;
|
|
202
|
-
var shim2 = isServerEnvironment ? useSyncExternalStore$1 : useSyncExternalStore;
|
|
203
|
-
var useSyncExternalStore$2 = React.useSyncExternalStore !== void 0 ? React.useSyncExternalStore : shim2;
|
|
204
|
-
useSyncExternalStoreShim_development.useSyncExternalStore = useSyncExternalStore$2;
|
|
205
|
-
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function") {
|
|
206
|
-
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
|
|
207
|
-
}
|
|
208
|
-
})();
|
|
209
|
-
}
|
|
210
|
-
return useSyncExternalStoreShim_development;
|
|
211
|
-
}
|
|
212
|
-
var hasRequiredShim;
|
|
213
|
-
function requireShim() {
|
|
214
|
-
if (hasRequiredShim) return shim.exports;
|
|
215
|
-
hasRequiredShim = 1;
|
|
216
|
-
if (process.env.NODE_ENV === "production") {
|
|
217
|
-
shim.exports = requireUseSyncExternalStoreShim_production_min();
|
|
218
|
-
} else {
|
|
219
|
-
shim.exports = requireUseSyncExternalStoreShim_development();
|
|
220
|
-
}
|
|
221
|
-
return shim.exports;
|
|
222
|
-
}
|
|
223
|
-
/**
|
|
224
|
-
* @license React
|
|
225
|
-
* use-sync-external-store-shim/with-selector.production.min.js
|
|
226
|
-
*
|
|
227
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
228
|
-
*
|
|
229
|
-
* This source code is licensed under the MIT license found in the
|
|
230
|
-
* LICENSE file in the root directory of this source tree.
|
|
231
|
-
*/
|
|
232
|
-
var hasRequiredWithSelector_production_min;
|
|
233
|
-
function requireWithSelector_production_min() {
|
|
234
|
-
if (hasRequiredWithSelector_production_min) return withSelector_production_min;
|
|
235
|
-
hasRequiredWithSelector_production_min = 1;
|
|
236
|
-
var h2 = require$$0, n2 = requireShim();
|
|
237
|
-
function p2(a2, b2) {
|
|
238
|
-
return a2 === b2 && (0 !== a2 || 1 / a2 === 1 / b2) || a2 !== a2 && b2 !== b2;
|
|
239
|
-
}
|
|
240
|
-
var q2 = "function" === typeof Object.is ? Object.is : p2, r2 = n2.useSyncExternalStore, t2 = h2.useRef, u2 = h2.useEffect, v2 = h2.useMemo, w2 = h2.useDebugValue;
|
|
241
|
-
withSelector_production_min.useSyncExternalStoreWithSelector = function(a2, b2, e, l2, g2) {
|
|
242
|
-
var c2 = t2(null);
|
|
243
|
-
if (null === c2.current) {
|
|
244
|
-
var f2 = { hasValue: false, value: null };
|
|
245
|
-
c2.current = f2;
|
|
246
|
-
} else f2 = c2.current;
|
|
247
|
-
c2 = v2(function() {
|
|
248
|
-
function a3(a4) {
|
|
249
|
-
if (!c3) {
|
|
250
|
-
c3 = true;
|
|
251
|
-
d3 = a4;
|
|
252
|
-
a4 = l2(a4);
|
|
253
|
-
if (void 0 !== g2 && f2.hasValue) {
|
|
254
|
-
var b3 = f2.value;
|
|
255
|
-
if (g2(b3, a4)) return k2 = b3;
|
|
256
|
-
}
|
|
257
|
-
return k2 = a4;
|
|
258
|
-
}
|
|
259
|
-
b3 = k2;
|
|
260
|
-
if (q2(d3, a4)) return b3;
|
|
261
|
-
var e2 = l2(a4);
|
|
262
|
-
if (void 0 !== g2 && g2(b3, e2)) return b3;
|
|
263
|
-
d3 = a4;
|
|
264
|
-
return k2 = e2;
|
|
265
|
-
}
|
|
266
|
-
var c3 = false, d3, k2, m = void 0 === e ? null : e;
|
|
267
|
-
return [function() {
|
|
268
|
-
return a3(b2());
|
|
269
|
-
}, null === m ? void 0 : function() {
|
|
270
|
-
return a3(m());
|
|
271
|
-
}];
|
|
272
|
-
}, [b2, e, l2, g2]);
|
|
273
|
-
var d2 = r2(a2, c2[0], c2[1]);
|
|
274
|
-
u2(function() {
|
|
275
|
-
f2.hasValue = true;
|
|
276
|
-
f2.value = d2;
|
|
277
|
-
}, [d2]);
|
|
278
|
-
w2(d2);
|
|
279
|
-
return d2;
|
|
280
|
-
};
|
|
281
|
-
return withSelector_production_min;
|
|
282
|
-
}
|
|
283
|
-
var withSelector_development = {};
|
|
284
|
-
/**
|
|
285
|
-
* @license React
|
|
286
|
-
* use-sync-external-store-shim/with-selector.development.js
|
|
287
|
-
*
|
|
288
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
289
|
-
*
|
|
290
|
-
* This source code is licensed under the MIT license found in the
|
|
291
|
-
* LICENSE file in the root directory of this source tree.
|
|
292
|
-
*/
|
|
293
|
-
var hasRequiredWithSelector_development;
|
|
294
|
-
function requireWithSelector_development() {
|
|
295
|
-
if (hasRequiredWithSelector_development) return withSelector_development;
|
|
296
|
-
hasRequiredWithSelector_development = 1;
|
|
297
|
-
if (process.env.NODE_ENV !== "production") {
|
|
298
|
-
(function() {
|
|
299
|
-
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") {
|
|
300
|
-
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
|
|
301
|
-
}
|
|
302
|
-
var React = require$$0;
|
|
303
|
-
var shim2 = requireShim();
|
|
304
|
-
function is(x2, y2) {
|
|
305
|
-
return x2 === y2 && (x2 !== 0 || 1 / x2 === 1 / y2) || x2 !== x2 && y2 !== y2;
|
|
306
|
-
}
|
|
307
|
-
var objectIs = typeof Object.is === "function" ? Object.is : is;
|
|
308
|
-
var useSyncExternalStore = shim2.useSyncExternalStore;
|
|
309
|
-
var useRef = React.useRef, useEffect = React.useEffect, useMemo = React.useMemo, useDebugValue2 = React.useDebugValue;
|
|
310
|
-
function useSyncExternalStoreWithSelector2(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) {
|
|
311
|
-
var instRef = useRef(null);
|
|
312
|
-
var inst;
|
|
313
|
-
if (instRef.current === null) {
|
|
314
|
-
inst = {
|
|
315
|
-
hasValue: false,
|
|
316
|
-
value: null
|
|
317
|
-
};
|
|
318
|
-
instRef.current = inst;
|
|
319
|
-
} else {
|
|
320
|
-
inst = instRef.current;
|
|
321
|
-
}
|
|
322
|
-
var _useMemo = useMemo(function() {
|
|
323
|
-
var hasMemo = false;
|
|
324
|
-
var memoizedSnapshot;
|
|
325
|
-
var memoizedSelection;
|
|
326
|
-
var memoizedSelector = function(nextSnapshot) {
|
|
327
|
-
if (!hasMemo) {
|
|
328
|
-
hasMemo = true;
|
|
329
|
-
memoizedSnapshot = nextSnapshot;
|
|
330
|
-
var _nextSelection = selector(nextSnapshot);
|
|
331
|
-
if (isEqual !== void 0) {
|
|
332
|
-
if (inst.hasValue) {
|
|
333
|
-
var currentSelection = inst.value;
|
|
334
|
-
if (isEqual(currentSelection, _nextSelection)) {
|
|
335
|
-
memoizedSelection = currentSelection;
|
|
336
|
-
return currentSelection;
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
memoizedSelection = _nextSelection;
|
|
341
|
-
return _nextSelection;
|
|
342
|
-
}
|
|
343
|
-
var prevSnapshot = memoizedSnapshot;
|
|
344
|
-
var prevSelection = memoizedSelection;
|
|
345
|
-
if (objectIs(prevSnapshot, nextSnapshot)) {
|
|
346
|
-
return prevSelection;
|
|
347
|
-
}
|
|
348
|
-
var nextSelection = selector(nextSnapshot);
|
|
349
|
-
if (isEqual !== void 0 && isEqual(prevSelection, nextSelection)) {
|
|
350
|
-
return prevSelection;
|
|
351
|
-
}
|
|
352
|
-
memoizedSnapshot = nextSnapshot;
|
|
353
|
-
memoizedSelection = nextSelection;
|
|
354
|
-
return nextSelection;
|
|
355
|
-
};
|
|
356
|
-
var maybeGetServerSnapshot = getServerSnapshot === void 0 ? null : getServerSnapshot;
|
|
357
|
-
var getSnapshotWithSelector = function() {
|
|
358
|
-
return memoizedSelector(getSnapshot());
|
|
359
|
-
};
|
|
360
|
-
var getServerSnapshotWithSelector = maybeGetServerSnapshot === null ? void 0 : function() {
|
|
361
|
-
return memoizedSelector(maybeGetServerSnapshot());
|
|
362
|
-
};
|
|
363
|
-
return [getSnapshotWithSelector, getServerSnapshotWithSelector];
|
|
364
|
-
}, [getSnapshot, getServerSnapshot, selector, isEqual]), getSelection = _useMemo[0], getServerSelection = _useMemo[1];
|
|
365
|
-
var value = useSyncExternalStore(subscribe, getSelection, getServerSelection);
|
|
366
|
-
useEffect(function() {
|
|
367
|
-
inst.hasValue = true;
|
|
368
|
-
inst.value = value;
|
|
369
|
-
}, [value]);
|
|
370
|
-
useDebugValue2(value);
|
|
371
|
-
return value;
|
|
372
|
-
}
|
|
373
|
-
withSelector_development.useSyncExternalStoreWithSelector = useSyncExternalStoreWithSelector2;
|
|
374
|
-
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function") {
|
|
375
|
-
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
|
|
376
|
-
}
|
|
377
|
-
})();
|
|
378
|
-
}
|
|
379
|
-
return withSelector_development;
|
|
380
|
-
}
|
|
381
|
-
if (process.env.NODE_ENV === "production") {
|
|
382
|
-
withSelector.exports = requireWithSelector_production_min();
|
|
383
|
-
} else {
|
|
384
|
-
withSelector.exports = requireWithSelector_development();
|
|
385
|
-
}
|
|
386
|
-
var withSelectorExports = withSelector.exports;
|
|
387
|
-
const useSyncExternalStoreExports = /* @__PURE__ */ getDefaultExportFromCjs(withSelectorExports);
|
|
388
|
-
const { useSyncExternalStoreWithSelector } = useSyncExternalStoreExports;
|
|
389
|
-
function useStore(api, selector = api.getState, equalityFn) {
|
|
390
|
-
const slice = useSyncExternalStoreWithSelector(
|
|
391
|
-
api.subscribe,
|
|
392
|
-
api.getState,
|
|
393
|
-
api.getServerState || api.getState,
|
|
394
|
-
selector,
|
|
395
|
-
equalityFn
|
|
396
|
-
);
|
|
397
|
-
useDebugValue(slice);
|
|
398
|
-
return slice;
|
|
399
|
-
}
|
|
400
|
-
const createImpl = (createState) => {
|
|
401
|
-
const api = typeof createState === "function" ? createStore(createState) : createState;
|
|
402
|
-
const useBoundStore = (selector, equalityFn) => useStore(api, selector, equalityFn);
|
|
403
|
-
Object.assign(useBoundStore, api);
|
|
404
|
-
return useBoundStore;
|
|
405
|
-
};
|
|
406
|
-
const create = (createState) => createState ? createImpl(createState) : createImpl;
|
|
407
|
-
const __vite_import_meta_env__ = { "BASE_URL": "/", "DEV": false, "MODE": "production", "PROD": true, "SSR": false, "VITE_DOMAIN_TOKEN": "lab1", "VITE_ENVIRONMENT_ASSETS": "d1", "VITE_HOST_API_LOCAL": "http://localhost:3000/domain", "VITE_HOST_API_REMOTE": "https://lab1.stage.made4labs.com/api/v1/domain", "VITE_HOST_STATIC_ASSETS": "https://s3.amazonaws.com/static.made4labs/environments", "VITE_STORYBOOK_ISOLATION_MODULE_ID": "users_list", "VITE_STORYBOOK_MODULE_ID": "login", "VITE_USER": "carloszapata@gmail.com", "VITE_USER_PWD": "Mayuscula123." };
|
|
408
|
-
const trackedConnections = /* @__PURE__ */ new Map();
|
|
409
|
-
const getTrackedConnectionState = (name) => {
|
|
410
|
-
const api = trackedConnections.get(name);
|
|
411
|
-
if (!api)
|
|
412
|
-
return {};
|
|
413
|
-
return Object.fromEntries(
|
|
414
|
-
Object.entries(api.stores).map(([key, api2]) => [key, api2.getState()])
|
|
415
|
-
);
|
|
416
|
-
};
|
|
417
|
-
const extractConnectionInformation = (store, extensionConnector, options) => {
|
|
418
|
-
if (store === void 0) {
|
|
419
|
-
return {
|
|
420
|
-
type: "untracked",
|
|
421
|
-
connection: extensionConnector.connect(options)
|
|
422
|
-
};
|
|
423
|
-
}
|
|
424
|
-
const existingConnection = trackedConnections.get(options.name);
|
|
425
|
-
if (existingConnection) {
|
|
426
|
-
return { type: "tracked", store, ...existingConnection };
|
|
427
|
-
}
|
|
428
|
-
const newConnection = {
|
|
429
|
-
connection: extensionConnector.connect(options),
|
|
430
|
-
stores: {}
|
|
431
|
-
};
|
|
432
|
-
trackedConnections.set(options.name, newConnection);
|
|
433
|
-
return { type: "tracked", store, ...newConnection };
|
|
434
|
-
};
|
|
435
|
-
const devtoolsImpl = (fn2, devtoolsOptions = {}) => (set, get, api) => {
|
|
436
|
-
const { enabled, anonymousActionType, store, ...options } = devtoolsOptions;
|
|
437
|
-
let extensionConnector;
|
|
438
|
-
try {
|
|
439
|
-
extensionConnector = (enabled != null ? enabled : (__vite_import_meta_env__ && "production") !== "production") && window.__REDUX_DEVTOOLS_EXTENSION__;
|
|
440
|
-
} catch (e) {
|
|
441
|
-
}
|
|
442
|
-
if (!extensionConnector) {
|
|
443
|
-
return fn2(set, get, api);
|
|
444
|
-
}
|
|
445
|
-
const { connection, ...connectionInformation } = extractConnectionInformation(store, extensionConnector, options);
|
|
446
|
-
let isRecording = true;
|
|
447
|
-
api.setState = (state, replace, nameOrAction) => {
|
|
448
|
-
const r2 = set(state, replace);
|
|
449
|
-
if (!isRecording)
|
|
450
|
-
return r2;
|
|
451
|
-
const action = nameOrAction === void 0 ? { type: anonymousActionType || "anonymous" } : typeof nameOrAction === "string" ? { type: nameOrAction } : nameOrAction;
|
|
452
|
-
if (store === void 0) {
|
|
453
|
-
connection == null ? void 0 : connection.send(action, get());
|
|
454
|
-
return r2;
|
|
455
|
-
}
|
|
456
|
-
connection == null ? void 0 : connection.send(
|
|
457
|
-
{
|
|
458
|
-
...action,
|
|
459
|
-
type: `${store}/${action.type}`
|
|
460
|
-
},
|
|
461
|
-
{
|
|
462
|
-
...getTrackedConnectionState(options.name),
|
|
463
|
-
[store]: api.getState()
|
|
464
|
-
}
|
|
465
|
-
);
|
|
466
|
-
return r2;
|
|
467
|
-
};
|
|
468
|
-
const setStateFromDevtools = (...a2) => {
|
|
469
|
-
const originalIsRecording = isRecording;
|
|
470
|
-
isRecording = false;
|
|
471
|
-
set(...a2);
|
|
472
|
-
isRecording = originalIsRecording;
|
|
473
|
-
};
|
|
474
|
-
const initialState = fn2(api.setState, get, api);
|
|
475
|
-
if (connectionInformation.type === "untracked") {
|
|
476
|
-
connection == null ? void 0 : connection.init(initialState);
|
|
477
|
-
} else {
|
|
478
|
-
connectionInformation.stores[connectionInformation.store] = api;
|
|
479
|
-
connection == null ? void 0 : connection.init(
|
|
480
|
-
Object.fromEntries(
|
|
481
|
-
Object.entries(connectionInformation.stores).map(([key, store2]) => [
|
|
482
|
-
key,
|
|
483
|
-
key === connectionInformation.store ? initialState : store2.getState()
|
|
484
|
-
])
|
|
485
|
-
)
|
|
486
|
-
);
|
|
487
|
-
}
|
|
488
|
-
if (api.dispatchFromDevtools && typeof api.dispatch === "function") {
|
|
489
|
-
const originalDispatch = api.dispatch;
|
|
490
|
-
api.dispatch = (...a2) => {
|
|
491
|
-
originalDispatch(...a2);
|
|
492
|
-
};
|
|
493
|
-
}
|
|
494
|
-
connection.subscribe((message) => {
|
|
495
|
-
var _a;
|
|
496
|
-
switch (message.type) {
|
|
497
|
-
case "ACTION":
|
|
498
|
-
if (typeof message.payload !== "string") {
|
|
499
|
-
console.error(
|
|
500
|
-
"[zustand devtools middleware] Unsupported action format"
|
|
501
|
-
);
|
|
502
|
-
return;
|
|
503
|
-
}
|
|
504
|
-
return parseJsonThen(
|
|
505
|
-
message.payload,
|
|
506
|
-
(action) => {
|
|
507
|
-
if (action.type === "__setState") {
|
|
508
|
-
if (store === void 0) {
|
|
509
|
-
setStateFromDevtools(action.state);
|
|
510
|
-
return;
|
|
511
|
-
}
|
|
512
|
-
if (Object.keys(action.state).length !== 1) {
|
|
513
|
-
console.error(
|
|
514
|
-
`
|
|
515
|
-
[zustand devtools middleware] Unsupported __setState action format.
|
|
516
|
-
When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),
|
|
517
|
-
and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } }
|
|
518
|
-
`
|
|
519
|
-
);
|
|
520
|
-
}
|
|
521
|
-
const stateFromDevtools = action.state[store];
|
|
522
|
-
if (stateFromDevtools === void 0 || stateFromDevtools === null) {
|
|
523
|
-
return;
|
|
524
|
-
}
|
|
525
|
-
if (JSON.stringify(api.getState()) !== JSON.stringify(stateFromDevtools)) {
|
|
526
|
-
setStateFromDevtools(stateFromDevtools);
|
|
527
|
-
}
|
|
528
|
-
return;
|
|
529
|
-
}
|
|
530
|
-
if (!api.dispatchFromDevtools)
|
|
531
|
-
return;
|
|
532
|
-
if (typeof api.dispatch !== "function")
|
|
533
|
-
return;
|
|
534
|
-
api.dispatch(action);
|
|
535
|
-
}
|
|
536
|
-
);
|
|
537
|
-
case "DISPATCH":
|
|
538
|
-
switch (message.payload.type) {
|
|
539
|
-
case "RESET":
|
|
540
|
-
setStateFromDevtools(initialState);
|
|
541
|
-
if (store === void 0) {
|
|
542
|
-
return connection == null ? void 0 : connection.init(api.getState());
|
|
543
|
-
}
|
|
544
|
-
return connection == null ? void 0 : connection.init(getTrackedConnectionState(options.name));
|
|
545
|
-
case "COMMIT":
|
|
546
|
-
if (store === void 0) {
|
|
547
|
-
connection == null ? void 0 : connection.init(api.getState());
|
|
548
|
-
return;
|
|
549
|
-
}
|
|
550
|
-
return connection == null ? void 0 : connection.init(getTrackedConnectionState(options.name));
|
|
551
|
-
case "ROLLBACK":
|
|
552
|
-
return parseJsonThen(message.state, (state) => {
|
|
553
|
-
if (store === void 0) {
|
|
554
|
-
setStateFromDevtools(state);
|
|
555
|
-
connection == null ? void 0 : connection.init(api.getState());
|
|
556
|
-
return;
|
|
557
|
-
}
|
|
558
|
-
setStateFromDevtools(state[store]);
|
|
559
|
-
connection == null ? void 0 : connection.init(getTrackedConnectionState(options.name));
|
|
560
|
-
});
|
|
561
|
-
case "JUMP_TO_STATE":
|
|
562
|
-
case "JUMP_TO_ACTION":
|
|
563
|
-
return parseJsonThen(message.state, (state) => {
|
|
564
|
-
if (store === void 0) {
|
|
565
|
-
setStateFromDevtools(state);
|
|
566
|
-
return;
|
|
567
|
-
}
|
|
568
|
-
if (JSON.stringify(api.getState()) !== JSON.stringify(state[store])) {
|
|
569
|
-
setStateFromDevtools(state[store]);
|
|
570
|
-
}
|
|
571
|
-
});
|
|
572
|
-
case "IMPORT_STATE": {
|
|
573
|
-
const { nextLiftedState } = message.payload;
|
|
574
|
-
const lastComputedState = (_a = nextLiftedState.computedStates.slice(-1)[0]) == null ? void 0 : _a.state;
|
|
575
|
-
if (!lastComputedState)
|
|
576
|
-
return;
|
|
577
|
-
if (store === void 0) {
|
|
578
|
-
setStateFromDevtools(lastComputedState);
|
|
579
|
-
} else {
|
|
580
|
-
setStateFromDevtools(lastComputedState[store]);
|
|
581
|
-
}
|
|
582
|
-
connection == null ? void 0 : connection.send(
|
|
583
|
-
null,
|
|
584
|
-
// FIXME no-any
|
|
585
|
-
nextLiftedState
|
|
586
|
-
);
|
|
587
|
-
return;
|
|
588
|
-
}
|
|
589
|
-
case "PAUSE_RECORDING":
|
|
590
|
-
return isRecording = !isRecording;
|
|
591
|
-
}
|
|
592
|
-
return;
|
|
593
|
-
}
|
|
594
|
-
});
|
|
595
|
-
return initialState;
|
|
596
|
-
};
|
|
597
|
-
const devtools = devtoolsImpl;
|
|
598
|
-
const parseJsonThen = (stringified, f2) => {
|
|
599
|
-
let parsed;
|
|
600
|
-
try {
|
|
601
|
-
parsed = JSON.parse(stringified);
|
|
602
|
-
} catch (e) {
|
|
603
|
-
console.error(
|
|
604
|
-
"[zustand devtools middleware] Could not parse the received json",
|
|
605
|
-
e
|
|
606
|
-
);
|
|
607
|
-
}
|
|
608
|
-
if (parsed !== void 0)
|
|
609
|
-
f2(parsed);
|
|
610
|
-
};
|
|
611
|
-
function n(n2) {
|
|
612
|
-
for (var r2 = arguments.length, t2 = Array(r2 > 1 ? r2 - 1 : 0), e = 1; e < r2; e++) t2[e - 1] = arguments[e];
|
|
613
|
-
if ("production" !== process.env.NODE_ENV) {
|
|
614
|
-
var i2 = Y[n2], o2 = i2 ? "function" == typeof i2 ? i2.apply(null, t2) : i2 : "unknown error nr: " + n2;
|
|
615
|
-
throw Error("[Immer] " + o2);
|
|
616
|
-
}
|
|
617
|
-
throw Error("[Immer] minified error nr: " + n2 + (t2.length ? " " + t2.map(function(n3) {
|
|
618
|
-
return "'" + n3 + "'";
|
|
619
|
-
}).join(",") : "") + ". Find the full error at: https://bit.ly/3cXEKWf");
|
|
620
|
-
}
|
|
621
|
-
function r(n2) {
|
|
622
|
-
return !!n2 && !!n2[Q];
|
|
623
|
-
}
|
|
624
|
-
function t(n2) {
|
|
625
|
-
var r2;
|
|
626
|
-
return !!n2 && (function(n3) {
|
|
627
|
-
if (!n3 || "object" != typeof n3) return false;
|
|
628
|
-
var r3 = Object.getPrototypeOf(n3);
|
|
629
|
-
if (null === r3) return true;
|
|
630
|
-
var t2 = Object.hasOwnProperty.call(r3, "constructor") && r3.constructor;
|
|
631
|
-
return t2 === Object || "function" == typeof t2 && Function.toString.call(t2) === Z;
|
|
632
|
-
}(n2) || Array.isArray(n2) || !!n2[L] || !!(null === (r2 = n2.constructor) || void 0 === r2 ? void 0 : r2[L]) || s(n2) || v(n2));
|
|
633
|
-
}
|
|
634
|
-
function i(n2, r2, t2) {
|
|
635
|
-
void 0 === t2 && (t2 = false), 0 === o(n2) ? (t2 ? Object.keys : nn)(n2).forEach(function(e) {
|
|
636
|
-
t2 && "symbol" == typeof e || r2(e, n2[e], n2);
|
|
637
|
-
}) : n2.forEach(function(t3, e) {
|
|
638
|
-
return r2(e, t3, n2);
|
|
639
|
-
});
|
|
640
|
-
}
|
|
641
|
-
function o(n2) {
|
|
642
|
-
var r2 = n2[Q];
|
|
643
|
-
return r2 ? r2.i > 3 ? r2.i - 4 : r2.i : Array.isArray(n2) ? 1 : s(n2) ? 2 : v(n2) ? 3 : 0;
|
|
644
|
-
}
|
|
645
|
-
function u(n2, r2) {
|
|
646
|
-
return 2 === o(n2) ? n2.has(r2) : Object.prototype.hasOwnProperty.call(n2, r2);
|
|
647
|
-
}
|
|
648
|
-
function a(n2, r2) {
|
|
649
|
-
return 2 === o(n2) ? n2.get(r2) : n2[r2];
|
|
650
|
-
}
|
|
651
|
-
function f(n2, r2, t2) {
|
|
652
|
-
var e = o(n2);
|
|
653
|
-
2 === e ? n2.set(r2, t2) : 3 === e ? n2.add(t2) : n2[r2] = t2;
|
|
654
|
-
}
|
|
655
|
-
function c(n2, r2) {
|
|
656
|
-
return n2 === r2 ? 0 !== n2 || 1 / n2 == 1 / r2 : n2 != n2 && r2 != r2;
|
|
657
|
-
}
|
|
658
|
-
function s(n2) {
|
|
659
|
-
return X && n2 instanceof Map;
|
|
660
|
-
}
|
|
661
|
-
function v(n2) {
|
|
662
|
-
return q && n2 instanceof Set;
|
|
663
|
-
}
|
|
664
|
-
function p(n2) {
|
|
665
|
-
return n2.o || n2.t;
|
|
666
|
-
}
|
|
667
|
-
function l(n2) {
|
|
668
|
-
if (Array.isArray(n2)) return Array.prototype.slice.call(n2);
|
|
669
|
-
var r2 = rn(n2);
|
|
670
|
-
delete r2[Q];
|
|
671
|
-
for (var t2 = nn(r2), e = 0; e < t2.length; e++) {
|
|
672
|
-
var i2 = t2[e], o2 = r2[i2];
|
|
673
|
-
false === o2.writable && (o2.writable = true, o2.configurable = true), (o2.get || o2.set) && (r2[i2] = { configurable: true, writable: true, enumerable: o2.enumerable, value: n2[i2] });
|
|
674
|
-
}
|
|
675
|
-
return Object.create(Object.getPrototypeOf(n2), r2);
|
|
676
|
-
}
|
|
677
|
-
function d(n2, e) {
|
|
678
|
-
return void 0 === e && (e = false), y(n2) || r(n2) || !t(n2) || (o(n2) > 1 && (n2.set = n2.add = n2.clear = n2.delete = h), Object.freeze(n2), e && i(n2, function(n3, r2) {
|
|
679
|
-
return d(r2, true);
|
|
680
|
-
}, true)), n2;
|
|
681
|
-
}
|
|
682
|
-
function h() {
|
|
683
|
-
n(2);
|
|
684
|
-
}
|
|
685
|
-
function y(n2) {
|
|
686
|
-
return null == n2 || "object" != typeof n2 || Object.isFrozen(n2);
|
|
687
|
-
}
|
|
688
|
-
function b(r2) {
|
|
689
|
-
var t2 = tn[r2];
|
|
690
|
-
return t2 || n(18, r2), t2;
|
|
691
|
-
}
|
|
692
|
-
function _() {
|
|
693
|
-
return "production" === process.env.NODE_ENV || U || n(0), U;
|
|
694
|
-
}
|
|
695
|
-
function j(n2, r2) {
|
|
696
|
-
r2 && (b("Patches"), n2.u = [], n2.s = [], n2.v = r2);
|
|
697
|
-
}
|
|
698
|
-
function g(n2) {
|
|
699
|
-
O(n2), n2.p.forEach(S), n2.p = null;
|
|
700
|
-
}
|
|
701
|
-
function O(n2) {
|
|
702
|
-
n2 === U && (U = n2.l);
|
|
703
|
-
}
|
|
704
|
-
function w(n2) {
|
|
705
|
-
return U = { p: [], l: U, h: n2, m: true, _: 0 };
|
|
706
|
-
}
|
|
707
|
-
function S(n2) {
|
|
708
|
-
var r2 = n2[Q];
|
|
709
|
-
0 === r2.i || 1 === r2.i ? r2.j() : r2.g = true;
|
|
710
|
-
}
|
|
711
|
-
function P(r2, e) {
|
|
712
|
-
e._ = e.p.length;
|
|
713
|
-
var i2 = e.p[0], o2 = void 0 !== r2 && r2 !== i2;
|
|
714
|
-
return e.h.O || b("ES5").S(e, r2, o2), o2 ? (i2[Q].P && (g(e), n(4)), t(r2) && (r2 = M(e, r2), e.l || x(e, r2)), e.u && b("Patches").M(i2[Q].t, r2, e.u, e.s)) : r2 = M(e, i2, []), g(e), e.u && e.v(e.u, e.s), r2 !== H ? r2 : void 0;
|
|
715
|
-
}
|
|
716
|
-
function M(n2, r2, t2) {
|
|
717
|
-
if (y(r2)) return r2;
|
|
718
|
-
var e = r2[Q];
|
|
719
|
-
if (!e) return i(r2, function(i2, o3) {
|
|
720
|
-
return A(n2, e, r2, i2, o3, t2);
|
|
721
|
-
}, true), r2;
|
|
722
|
-
if (e.A !== n2) return r2;
|
|
723
|
-
if (!e.P) return x(n2, e.t, true), e.t;
|
|
724
|
-
if (!e.I) {
|
|
725
|
-
e.I = true, e.A._--;
|
|
726
|
-
var o2 = 4 === e.i || 5 === e.i ? e.o = l(e.k) : e.o, u2 = o2, a2 = false;
|
|
727
|
-
3 === e.i && (u2 = new Set(o2), o2.clear(), a2 = true), i(u2, function(r3, i2) {
|
|
728
|
-
return A(n2, e, o2, r3, i2, t2, a2);
|
|
729
|
-
}), x(n2, o2, false), t2 && n2.u && b("Patches").N(e, t2, n2.u, n2.s);
|
|
730
|
-
}
|
|
731
|
-
return e.o;
|
|
732
|
-
}
|
|
733
|
-
function A(e, i2, o2, a2, c2, s2, v2) {
|
|
734
|
-
if ("production" !== process.env.NODE_ENV && c2 === o2 && n(5), r(c2)) {
|
|
735
|
-
var p2 = M(e, c2, s2 && i2 && 3 !== i2.i && !u(i2.R, a2) ? s2.concat(a2) : void 0);
|
|
736
|
-
if (f(o2, a2, p2), !r(p2)) return;
|
|
737
|
-
e.m = false;
|
|
738
|
-
} else v2 && o2.add(c2);
|
|
739
|
-
if (t(c2) && !y(c2)) {
|
|
740
|
-
if (!e.h.D && e._ < 1) return;
|
|
741
|
-
M(e, c2), i2 && i2.A.l || x(e, c2);
|
|
742
|
-
}
|
|
743
|
-
}
|
|
744
|
-
function x(n2, r2, t2) {
|
|
745
|
-
void 0 === t2 && (t2 = false), !n2.l && n2.h.D && n2.m && d(r2, t2);
|
|
746
|
-
}
|
|
747
|
-
function z(n2, r2) {
|
|
748
|
-
var t2 = n2[Q];
|
|
749
|
-
return (t2 ? p(t2) : n2)[r2];
|
|
750
|
-
}
|
|
751
|
-
function I(n2, r2) {
|
|
752
|
-
if (r2 in n2) for (var t2 = Object.getPrototypeOf(n2); t2; ) {
|
|
753
|
-
var e = Object.getOwnPropertyDescriptor(t2, r2);
|
|
754
|
-
if (e) return e;
|
|
755
|
-
t2 = Object.getPrototypeOf(t2);
|
|
756
|
-
}
|
|
757
|
-
}
|
|
758
|
-
function k(n2) {
|
|
759
|
-
n2.P || (n2.P = true, n2.l && k(n2.l));
|
|
760
|
-
}
|
|
761
|
-
function E(n2) {
|
|
762
|
-
n2.o || (n2.o = l(n2.t));
|
|
763
|
-
}
|
|
764
|
-
function N(n2, r2, t2) {
|
|
765
|
-
var e = s(r2) ? b("MapSet").F(r2, t2) : v(r2) ? b("MapSet").T(r2, t2) : n2.O ? function(n3, r3) {
|
|
766
|
-
var t3 = Array.isArray(n3), e2 = { i: t3 ? 1 : 0, A: r3 ? r3.A : _(), P: false, I: false, R: {}, l: r3, t: n3, k: null, o: null, j: null, C: false }, i2 = e2, o2 = en;
|
|
767
|
-
t3 && (i2 = [e2], o2 = on);
|
|
768
|
-
var u2 = Proxy.revocable(i2, o2), a2 = u2.revoke, f2 = u2.proxy;
|
|
769
|
-
return e2.k = f2, e2.j = a2, f2;
|
|
770
|
-
}(r2, t2) : b("ES5").J(r2, t2);
|
|
771
|
-
return (t2 ? t2.A : _()).p.push(e), e;
|
|
772
|
-
}
|
|
773
|
-
function R(e) {
|
|
774
|
-
return r(e) || n(22, e), function n2(r2) {
|
|
775
|
-
if (!t(r2)) return r2;
|
|
776
|
-
var e2, u2 = r2[Q], c2 = o(r2);
|
|
777
|
-
if (u2) {
|
|
778
|
-
if (!u2.P && (u2.i < 4 || !b("ES5").K(u2))) return u2.t;
|
|
779
|
-
u2.I = true, e2 = D(r2, c2), u2.I = false;
|
|
780
|
-
} else e2 = D(r2, c2);
|
|
781
|
-
return i(e2, function(r3, t2) {
|
|
782
|
-
u2 && a(u2.t, r3) === t2 || f(e2, r3, n2(t2));
|
|
783
|
-
}), 3 === c2 ? new Set(e2) : e2;
|
|
784
|
-
}(e);
|
|
785
|
-
}
|
|
786
|
-
function D(n2, r2) {
|
|
787
|
-
switch (r2) {
|
|
788
|
-
case 2:
|
|
789
|
-
return new Map(n2);
|
|
790
|
-
case 3:
|
|
791
|
-
return Array.from(n2);
|
|
792
|
-
}
|
|
793
|
-
return l(n2);
|
|
794
|
-
}
|
|
795
|
-
var G, U, W = "undefined" != typeof Symbol && "symbol" == typeof Symbol("x"), X = "undefined" != typeof Map, q = "undefined" != typeof Set, B = "undefined" != typeof Proxy && void 0 !== Proxy.revocable && "undefined" != typeof Reflect, H = W ? Symbol.for("immer-nothing") : ((G = {})["immer-nothing"] = true, G), L = W ? Symbol.for("immer-draftable") : "__$immer_draftable", Q = W ? Symbol.for("immer-state") : "__$immer_state", Y = { 0: "Illegal state", 1: "Immer drafts cannot have computed properties", 2: "This object has been frozen and should not be mutated", 3: function(n2) {
|
|
796
|
-
return "Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? " + n2;
|
|
797
|
-
}, 4: "An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.", 5: "Immer forbids circular references", 6: "The first or second argument to `produce` must be a function", 7: "The third argument to `produce` must be a function or undefined", 8: "First argument to `createDraft` must be a plain object, an array, or an immerable object", 9: "First argument to `finishDraft` must be a draft returned by `createDraft`", 10: "The given draft is already finalized", 11: "Object.defineProperty() cannot be used on an Immer draft", 12: "Object.setPrototypeOf() cannot be used on an Immer draft", 13: "Immer only supports deleting array indices", 14: "Immer only supports setting array indices and the 'length' property", 15: function(n2) {
|
|
798
|
-
return "Cannot apply patch, path doesn't resolve: " + n2;
|
|
799
|
-
}, 16: 'Sets cannot have "replace" patches.', 17: function(n2) {
|
|
800
|
-
return "Unsupported patch operation: " + n2;
|
|
801
|
-
}, 18: function(n2) {
|
|
802
|
-
return "The plugin for '" + n2 + "' has not been loaded into Immer. To enable the plugin, import and call `enable" + n2 + "()` when initializing your application.";
|
|
803
|
-
}, 20: "Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available", 21: function(n2) {
|
|
804
|
-
return "produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '" + n2 + "'";
|
|
805
|
-
}, 22: function(n2) {
|
|
806
|
-
return "'current' expects a draft, got: " + n2;
|
|
807
|
-
}, 23: function(n2) {
|
|
808
|
-
return "'original' expects a draft, got: " + n2;
|
|
809
|
-
}, 24: "Patching reserved attributes like __proto__, prototype and constructor is not allowed" }, Z = "" + Object.prototype.constructor, nn = "undefined" != typeof Reflect && Reflect.ownKeys ? Reflect.ownKeys : void 0 !== Object.getOwnPropertySymbols ? function(n2) {
|
|
810
|
-
return Object.getOwnPropertyNames(n2).concat(Object.getOwnPropertySymbols(n2));
|
|
811
|
-
} : Object.getOwnPropertyNames, rn = Object.getOwnPropertyDescriptors || function(n2) {
|
|
812
|
-
var r2 = {};
|
|
813
|
-
return nn(n2).forEach(function(t2) {
|
|
814
|
-
r2[t2] = Object.getOwnPropertyDescriptor(n2, t2);
|
|
815
|
-
}), r2;
|
|
816
|
-
}, tn = {}, en = { get: function(n2, r2) {
|
|
817
|
-
if (r2 === Q) return n2;
|
|
818
|
-
var e = p(n2);
|
|
819
|
-
if (!u(e, r2)) return function(n3, r3, t2) {
|
|
820
|
-
var e2, i3 = I(r3, t2);
|
|
821
|
-
return i3 ? "value" in i3 ? i3.value : null === (e2 = i3.get) || void 0 === e2 ? void 0 : e2.call(n3.k) : void 0;
|
|
822
|
-
}(n2, e, r2);
|
|
823
|
-
var i2 = e[r2];
|
|
824
|
-
return n2.I || !t(i2) ? i2 : i2 === z(n2.t, r2) ? (E(n2), n2.o[r2] = N(n2.A.h, i2, n2)) : i2;
|
|
825
|
-
}, has: function(n2, r2) {
|
|
826
|
-
return r2 in p(n2);
|
|
827
|
-
}, ownKeys: function(n2) {
|
|
828
|
-
return Reflect.ownKeys(p(n2));
|
|
829
|
-
}, set: function(n2, r2, t2) {
|
|
830
|
-
var e = I(p(n2), r2);
|
|
831
|
-
if (null == e ? void 0 : e.set) return e.set.call(n2.k, t2), true;
|
|
832
|
-
if (!n2.P) {
|
|
833
|
-
var i2 = z(p(n2), r2), o2 = null == i2 ? void 0 : i2[Q];
|
|
834
|
-
if (o2 && o2.t === t2) return n2.o[r2] = t2, n2.R[r2] = false, true;
|
|
835
|
-
if (c(t2, i2) && (void 0 !== t2 || u(n2.t, r2))) return true;
|
|
836
|
-
E(n2), k(n2);
|
|
837
|
-
}
|
|
838
|
-
return n2.o[r2] === t2 && (void 0 !== t2 || r2 in n2.o) || Number.isNaN(t2) && Number.isNaN(n2.o[r2]) || (n2.o[r2] = t2, n2.R[r2] = true), true;
|
|
839
|
-
}, deleteProperty: function(n2, r2) {
|
|
840
|
-
return void 0 !== z(n2.t, r2) || r2 in n2.t ? (n2.R[r2] = false, E(n2), k(n2)) : delete n2.R[r2], n2.o && delete n2.o[r2], true;
|
|
841
|
-
}, getOwnPropertyDescriptor: function(n2, r2) {
|
|
842
|
-
var t2 = p(n2), e = Reflect.getOwnPropertyDescriptor(t2, r2);
|
|
843
|
-
return e ? { writable: true, configurable: 1 !== n2.i || "length" !== r2, enumerable: e.enumerable, value: t2[r2] } : e;
|
|
844
|
-
}, defineProperty: function() {
|
|
845
|
-
n(11);
|
|
846
|
-
}, getPrototypeOf: function(n2) {
|
|
847
|
-
return Object.getPrototypeOf(n2.t);
|
|
848
|
-
}, setPrototypeOf: function() {
|
|
849
|
-
n(12);
|
|
850
|
-
} }, on = {};
|
|
851
|
-
i(en, function(n2, r2) {
|
|
852
|
-
on[n2] = function() {
|
|
853
|
-
return arguments[0] = arguments[0][0], r2.apply(this, arguments);
|
|
854
|
-
};
|
|
855
|
-
}), on.deleteProperty = function(r2, t2) {
|
|
856
|
-
return "production" !== process.env.NODE_ENV && isNaN(parseInt(t2)) && n(13), on.set.call(this, r2, t2, void 0);
|
|
857
|
-
}, on.set = function(r2, t2, e) {
|
|
858
|
-
return "production" !== process.env.NODE_ENV && "length" !== t2 && isNaN(parseInt(t2)) && n(14), en.set.call(this, r2[0], t2, e, r2[0]);
|
|
859
|
-
};
|
|
860
|
-
var un = function() {
|
|
861
|
-
function e(r2) {
|
|
862
|
-
var e2 = this;
|
|
863
|
-
this.O = B, this.D = true, this.produce = function(r3, i3, o2) {
|
|
864
|
-
if ("function" == typeof r3 && "function" != typeof i3) {
|
|
865
|
-
var u2 = i3;
|
|
866
|
-
i3 = r3;
|
|
867
|
-
var a2 = e2;
|
|
868
|
-
return function(n2) {
|
|
869
|
-
var r4 = this;
|
|
870
|
-
void 0 === n2 && (n2 = u2);
|
|
871
|
-
for (var t2 = arguments.length, e3 = Array(t2 > 1 ? t2 - 1 : 0), o3 = 1; o3 < t2; o3++) e3[o3 - 1] = arguments[o3];
|
|
872
|
-
return a2.produce(n2, function(n3) {
|
|
873
|
-
var t3;
|
|
874
|
-
return (t3 = i3).call.apply(t3, [r4, n3].concat(e3));
|
|
875
|
-
});
|
|
876
|
-
};
|
|
877
|
-
}
|
|
878
|
-
var f2;
|
|
879
|
-
if ("function" != typeof i3 && n(6), void 0 !== o2 && "function" != typeof o2 && n(7), t(r3)) {
|
|
880
|
-
var c2 = w(e2), s2 = N(e2, r3, void 0), v2 = true;
|
|
881
|
-
try {
|
|
882
|
-
f2 = i3(s2), v2 = false;
|
|
883
|
-
} finally {
|
|
884
|
-
v2 ? g(c2) : O(c2);
|
|
885
|
-
}
|
|
886
|
-
return "undefined" != typeof Promise && f2 instanceof Promise ? f2.then(function(n2) {
|
|
887
|
-
return j(c2, o2), P(n2, c2);
|
|
888
|
-
}, function(n2) {
|
|
889
|
-
throw g(c2), n2;
|
|
890
|
-
}) : (j(c2, o2), P(f2, c2));
|
|
891
|
-
}
|
|
892
|
-
if (!r3 || "object" != typeof r3) {
|
|
893
|
-
if (void 0 === (f2 = i3(r3)) && (f2 = r3), f2 === H && (f2 = void 0), e2.D && d(f2, true), o2) {
|
|
894
|
-
var p2 = [], l2 = [];
|
|
895
|
-
b("Patches").M(r3, f2, p2, l2), o2(p2, l2);
|
|
896
|
-
}
|
|
897
|
-
return f2;
|
|
898
|
-
}
|
|
899
|
-
n(21, r3);
|
|
900
|
-
}, this.produceWithPatches = function(n2, r3) {
|
|
901
|
-
if ("function" == typeof n2) return function(r4) {
|
|
902
|
-
for (var t3 = arguments.length, i4 = Array(t3 > 1 ? t3 - 1 : 0), o3 = 1; o3 < t3; o3++) i4[o3 - 1] = arguments[o3];
|
|
903
|
-
return e2.produceWithPatches(r4, function(r5) {
|
|
904
|
-
return n2.apply(void 0, [r5].concat(i4));
|
|
905
|
-
});
|
|
906
|
-
};
|
|
907
|
-
var t2, i3, o2 = e2.produce(n2, r3, function(n3, r4) {
|
|
908
|
-
t2 = n3, i3 = r4;
|
|
909
|
-
});
|
|
910
|
-
return "undefined" != typeof Promise && o2 instanceof Promise ? o2.then(function(n3) {
|
|
911
|
-
return [n3, t2, i3];
|
|
912
|
-
}) : [o2, t2, i3];
|
|
913
|
-
}, "boolean" == typeof (null == r2 ? void 0 : r2.useProxies) && this.setUseProxies(r2.useProxies), "boolean" == typeof (null == r2 ? void 0 : r2.autoFreeze) && this.setAutoFreeze(r2.autoFreeze);
|
|
914
|
-
}
|
|
915
|
-
var i2 = e.prototype;
|
|
916
|
-
return i2.createDraft = function(e2) {
|
|
917
|
-
t(e2) || n(8), r(e2) && (e2 = R(e2));
|
|
918
|
-
var i3 = w(this), o2 = N(this, e2, void 0);
|
|
919
|
-
return o2[Q].C = true, O(i3), o2;
|
|
920
|
-
}, i2.finishDraft = function(r2, t2) {
|
|
921
|
-
var e2 = r2 && r2[Q];
|
|
922
|
-
"production" !== process.env.NODE_ENV && (e2 && e2.C || n(9), e2.I && n(10));
|
|
923
|
-
var i3 = e2.A;
|
|
924
|
-
return j(i3, t2), P(void 0, i3);
|
|
925
|
-
}, i2.setAutoFreeze = function(n2) {
|
|
926
|
-
this.D = n2;
|
|
927
|
-
}, i2.setUseProxies = function(r2) {
|
|
928
|
-
r2 && !B && n(20), this.O = r2;
|
|
929
|
-
}, i2.applyPatches = function(n2, t2) {
|
|
930
|
-
var e2;
|
|
931
|
-
for (e2 = t2.length - 1; e2 >= 0; e2--) {
|
|
932
|
-
var i3 = t2[e2];
|
|
933
|
-
if (0 === i3.path.length && "replace" === i3.op) {
|
|
934
|
-
n2 = i3.value;
|
|
935
|
-
break;
|
|
936
|
-
}
|
|
937
|
-
}
|
|
938
|
-
e2 > -1 && (t2 = t2.slice(e2 + 1));
|
|
939
|
-
var o2 = b("Patches").$;
|
|
940
|
-
return r(n2) ? o2(n2, t2) : this.produce(n2, function(n3) {
|
|
941
|
-
return o2(n3, t2);
|
|
942
|
-
});
|
|
943
|
-
}, e;
|
|
944
|
-
}(), an = new un(), fn = an.produce;
|
|
945
|
-
an.produceWithPatches.bind(an);
|
|
946
|
-
an.setAutoFreeze.bind(an);
|
|
947
|
-
an.setUseProxies.bind(an);
|
|
948
|
-
an.applyPatches.bind(an);
|
|
949
|
-
an.createDraft.bind(an);
|
|
950
|
-
an.finishDraft.bind(an);
|
|
951
|
-
const immerImpl = (initializer) => (set, get, store) => {
|
|
952
|
-
store.setState = (updater, replace, ...a2) => {
|
|
953
|
-
const nextState = typeof updater === "function" ? fn(updater) : updater;
|
|
954
|
-
return set(nextState, replace, ...a2);
|
|
955
|
-
};
|
|
956
|
-
return initializer(store.setState, get, store);
|
|
957
|
-
};
|
|
958
|
-
const immer = immerImpl;
|
|
959
|
-
export {
|
|
960
|
-
create as c,
|
|
961
|
-
devtools as d,
|
|
962
|
-
immer as i
|
|
963
|
-
};
|