@open-kingdom/shared-feature-notifications 0.0.2-0

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/index.js ADDED
@@ -0,0 +1,1619 @@
1
+ import { jsx as E, jsxs as he } from "react/jsx-runtime";
2
+ import * as D from "react";
3
+ import Te, { useState as re, useEffect as ne } from "react";
4
+ var $ = { exports: {} }, Q = {};
5
+ var ye;
6
+ function Xe() {
7
+ if (ye) return Q;
8
+ ye = 1;
9
+ var e = Te;
10
+ function t(a, u) {
11
+ return a === u && (a !== 0 || 1 / a === 1 / u) || a !== a && u !== u;
12
+ }
13
+ var r = typeof Object.is == "function" ? Object.is : t, n = e.useSyncExternalStore, o = e.useRef, i = e.useEffect, c = e.useMemo, s = e.useDebugValue;
14
+ return Q.useSyncExternalStoreWithSelector = function(a, u, l, p, h) {
15
+ var d = o(null);
16
+ if (d.current === null) {
17
+ var _ = { hasValue: !1, value: null };
18
+ d.current = _;
19
+ } else _ = d.current;
20
+ d = c(
21
+ function() {
22
+ function O(m) {
23
+ if (!C) {
24
+ if (C = !0, f = m, m = p(m), h !== void 0 && _.hasValue) {
25
+ var v = _.value;
26
+ if (h(v, m))
27
+ return y = v;
28
+ }
29
+ return y = m;
30
+ }
31
+ if (v = y, r(f, m)) return v;
32
+ var w = p(m);
33
+ return h !== void 0 && h(v, w) ? (f = m, v) : (f = m, y = w);
34
+ }
35
+ var C = !1, f, y, b = l === void 0 ? null : l;
36
+ return [
37
+ function() {
38
+ return O(u());
39
+ },
40
+ b === null ? void 0 : function() {
41
+ return O(b());
42
+ }
43
+ ];
44
+ },
45
+ [u, l, p, h]
46
+ );
47
+ var g = n(a, d[0], d[1]);
48
+ return i(
49
+ function() {
50
+ _.hasValue = !0, _.value = g;
51
+ },
52
+ [g]
53
+ ), s(g), g;
54
+ }, Q;
55
+ }
56
+ var Z = {};
57
+ var me;
58
+ function qe() {
59
+ return me || (me = 1, process.env.NODE_ENV !== "production" && function() {
60
+ function e(a, u) {
61
+ return a === u && (a !== 0 || 1 / a === 1 / u) || a !== a && u !== u;
62
+ }
63
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
64
+ var t = Te, r = typeof Object.is == "function" ? Object.is : e, n = t.useSyncExternalStore, o = t.useRef, i = t.useEffect, c = t.useMemo, s = t.useDebugValue;
65
+ Z.useSyncExternalStoreWithSelector = function(a, u, l, p, h) {
66
+ var d = o(null);
67
+ if (d.current === null) {
68
+ var _ = { hasValue: !1, value: null };
69
+ d.current = _;
70
+ } else _ = d.current;
71
+ d = c(
72
+ function() {
73
+ function O(m) {
74
+ if (!C) {
75
+ if (C = !0, f = m, m = p(m), h !== void 0 && _.hasValue) {
76
+ var v = _.value;
77
+ if (h(v, m))
78
+ return y = v;
79
+ }
80
+ return y = m;
81
+ }
82
+ if (v = y, r(f, m))
83
+ return v;
84
+ var w = p(m);
85
+ return h !== void 0 && h(v, w) ? (f = m, v) : (f = m, y = w);
86
+ }
87
+ var C = !1, f, y, b = l === void 0 ? null : l;
88
+ return [
89
+ function() {
90
+ return O(u());
91
+ },
92
+ b === null ? void 0 : function() {
93
+ return O(b());
94
+ }
95
+ ];
96
+ },
97
+ [u, l, p, h]
98
+ );
99
+ var g = n(a, d[0], d[1]);
100
+ return i(
101
+ function() {
102
+ _.hasValue = !0, _.value = g;
103
+ },
104
+ [g]
105
+ ), s(g), g;
106
+ }, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
107
+ }()), Z;
108
+ }
109
+ var _e;
110
+ function Je() {
111
+ return _e || (_e = 1, process.env.NODE_ENV === "production" ? $.exports = Xe() : $.exports = qe()), $.exports;
112
+ }
113
+ var Qe = Je(), Ze = /* @__PURE__ */ Symbol.for("react-redux-context"), et = typeof globalThis < "u" ? globalThis : (
114
+ /* fall back to a per-module scope (pre-8.1 behaviour) if `globalThis` is not available */
115
+ {}
116
+ );
117
+ function tt() {
118
+ if (!D.createContext) return {};
119
+ const e = et[Ze] ??= /* @__PURE__ */ new Map();
120
+ let t = e.get(D.createContext);
121
+ return t || (t = D.createContext(
122
+ null
123
+ ), process.env.NODE_ENV !== "production" && (t.displayName = "ReactRedux"), e.set(D.createContext, t)), t;
124
+ }
125
+ var R = /* @__PURE__ */ tt();
126
+ function de(e = R) {
127
+ return function() {
128
+ const r = D.useContext(e);
129
+ if (process.env.NODE_ENV !== "production" && !r)
130
+ throw new Error(
131
+ "could not find react-redux context value; please ensure the component is wrapped in a <Provider>"
132
+ );
133
+ return r;
134
+ };
135
+ }
136
+ var Ve = /* @__PURE__ */ de();
137
+ function ze(e = R) {
138
+ const t = e === R ? Ve : (
139
+ // @ts-ignore
140
+ de(e)
141
+ ), r = () => {
142
+ const { store: n } = t();
143
+ return n;
144
+ };
145
+ return Object.assign(r, {
146
+ withTypes: () => r
147
+ }), r;
148
+ }
149
+ var rt = /* @__PURE__ */ ze();
150
+ function nt(e = R) {
151
+ const t = e === R ? rt : ze(e), r = () => t().dispatch;
152
+ return Object.assign(r, {
153
+ withTypes: () => r
154
+ }), r;
155
+ }
156
+ var ot = /* @__PURE__ */ nt(), it = (e, t) => e === t;
157
+ function st(e = R) {
158
+ const t = e === R ? Ve : de(e), r = (n, o = {}) => {
159
+ const { equalityFn: i = it } = typeof o == "function" ? { equalityFn: o } : o;
160
+ if (process.env.NODE_ENV !== "production") {
161
+ if (!n)
162
+ throw new Error("You must pass a selector to useSelector");
163
+ if (typeof n != "function")
164
+ throw new Error("You must pass a function as a selector to useSelector");
165
+ if (typeof i != "function")
166
+ throw new Error(
167
+ "You must pass a function as an equality function to useSelector"
168
+ );
169
+ }
170
+ const c = t(), { store: s, subscription: a, getServerState: u } = c, l = D.useRef(!0), p = D.useCallback(
171
+ {
172
+ [n.name](d) {
173
+ const _ = n(d);
174
+ if (process.env.NODE_ENV !== "production") {
175
+ const { devModeChecks: g = {} } = typeof o == "function" ? {} : o, { identityFunctionCheck: O, stabilityCheck: C } = c, {
176
+ identityFunctionCheck: f,
177
+ stabilityCheck: y
178
+ } = {
179
+ stabilityCheck: C,
180
+ identityFunctionCheck: O,
181
+ ...g
182
+ };
183
+ if (y === "always" || y === "once" && l.current) {
184
+ const b = n(d);
185
+ if (!i(_, b)) {
186
+ let m;
187
+ try {
188
+ throw new Error();
189
+ } catch (v) {
190
+ ({ stack: m } = v);
191
+ }
192
+ console.warn(
193
+ "Selector " + (n.name || "unknown") + ` returned a different result when called with the same parameters. This can lead to unnecessary rerenders.
194
+ Selectors that return a new reference (such as an object or an array) should be memoized: https://redux.js.org/usage/deriving-data-selectors#optimizing-selectors-with-memoization`,
195
+ {
196
+ state: d,
197
+ selected: _,
198
+ selected2: b,
199
+ stack: m
200
+ }
201
+ );
202
+ }
203
+ }
204
+ if ((f === "always" || f === "once" && l.current) && _ === d) {
205
+ let b;
206
+ try {
207
+ throw new Error();
208
+ } catch (m) {
209
+ ({ stack: b } = m);
210
+ }
211
+ console.warn(
212
+ "Selector " + (n.name || "unknown") + ` returned the root state when called. This can lead to unnecessary rerenders.
213
+ Selectors that return the entire state are almost certainly a mistake, as they will cause a rerender whenever *anything* in state changes.`,
214
+ { stack: b }
215
+ );
216
+ }
217
+ l.current && (l.current = !1);
218
+ }
219
+ return _;
220
+ }
221
+ }[n.name],
222
+ [n]
223
+ ), h = Qe.useSyncExternalStoreWithSelector(
224
+ a.addNestedSub,
225
+ s.getState,
226
+ u || s.getState,
227
+ p,
228
+ i
229
+ );
230
+ return D.useDebugValue(h), h;
231
+ };
232
+ return Object.assign(r, {
233
+ withTypes: () => r
234
+ }), r;
235
+ }
236
+ var be = /* @__PURE__ */ st();
237
+ function ct(e) {
238
+ if (typeof e != "object" || e === null)
239
+ return !1;
240
+ let t = e;
241
+ for (; Object.getPrototypeOf(t) !== null; )
242
+ t = Object.getPrototypeOf(t);
243
+ return Object.getPrototypeOf(e) === t || Object.getPrototypeOf(e) === null;
244
+ }
245
+ function at(e) {
246
+ return ct(e) && "type" in e && typeof e.type == "string";
247
+ }
248
+ var Me = Symbol.for("immer-nothing"), ve = Symbol.for("immer-draftable"), x = Symbol.for("immer-state"), ut = process.env.NODE_ENV !== "production" ? [
249
+ // All error codes, starting by 0:
250
+ function(e) {
251
+ return `The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`;
252
+ },
253
+ function(e) {
254
+ 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 '${e}'`;
255
+ },
256
+ "This object has been frozen and should not be mutated",
257
+ function(e) {
258
+ return "Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? " + e;
259
+ },
260
+ "An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.",
261
+ "Immer forbids circular references",
262
+ "The first or second argument to `produce` must be a function",
263
+ "The third argument to `produce` must be a function or undefined",
264
+ "First argument to `createDraft` must be a plain object, an array, or an immerable object",
265
+ "First argument to `finishDraft` must be a draft returned by `createDraft`",
266
+ function(e) {
267
+ return `'current' expects a draft, got: ${e}`;
268
+ },
269
+ "Object.defineProperty() cannot be used on an Immer draft",
270
+ "Object.setPrototypeOf() cannot be used on an Immer draft",
271
+ "Immer only supports deleting array indices",
272
+ "Immer only supports setting array indices and the 'length' property",
273
+ function(e) {
274
+ return `'original' expects a draft, got: ${e}`;
275
+ }
276
+ // Note: if more errors are added, the errorOffset in Patches.ts should be increased
277
+ // See Patches.ts for additional errors
278
+ ] : [];
279
+ function S(e, ...t) {
280
+ if (process.env.NODE_ENV !== "production") {
281
+ const r = ut[e], n = typeof r == "function" ? r.apply(null, t) : r;
282
+ throw new Error(`[Immer] ${n}`);
283
+ }
284
+ throw new Error(
285
+ `[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`
286
+ );
287
+ }
288
+ var P = Object.getPrototypeOf;
289
+ function T(e) {
290
+ return !!e && !!e[x];
291
+ }
292
+ function k(e) {
293
+ return e ? Pe(e) || Array.isArray(e) || !!e[ve] || !!e.constructor?.[ve] || L(e) || X(e) : !1;
294
+ }
295
+ var lt = Object.prototype.constructor.toString(), ge = /* @__PURE__ */ new WeakMap();
296
+ function Pe(e) {
297
+ if (!e || typeof e != "object")
298
+ return !1;
299
+ const t = Object.getPrototypeOf(e);
300
+ if (t === null || t === Object.prototype)
301
+ return !0;
302
+ const r = Object.hasOwnProperty.call(t, "constructor") && t.constructor;
303
+ if (r === Object)
304
+ return !0;
305
+ if (typeof r != "function")
306
+ return !1;
307
+ let n = ge.get(r);
308
+ return n === void 0 && (n = Function.toString.call(r), ge.set(r, n)), n === lt;
309
+ }
310
+ function K(e, t, r = !0) {
311
+ Y(e) === 0 ? (r ? Reflect.ownKeys(e) : Object.keys(e)).forEach((n) => {
312
+ t(n, e[n], e);
313
+ }) : e.forEach((n, o) => t(o, n, e));
314
+ }
315
+ function Y(e) {
316
+ const t = e[x];
317
+ return t ? t.type_ : Array.isArray(e) ? 1 : L(e) ? 2 : X(e) ? 3 : 0;
318
+ }
319
+ function oe(e, t) {
320
+ return Y(e) === 2 ? e.has(t) : Object.prototype.hasOwnProperty.call(e, t);
321
+ }
322
+ function Ae(e, t, r) {
323
+ const n = Y(e);
324
+ n === 2 ? e.set(t, r) : n === 3 ? e.add(r) : e[t] = r;
325
+ }
326
+ function dt(e, t) {
327
+ return e === t ? e !== 0 || 1 / e === 1 / t : e !== e && t !== t;
328
+ }
329
+ function L(e) {
330
+ return e instanceof Map;
331
+ }
332
+ function X(e) {
333
+ return e instanceof Set;
334
+ }
335
+ function j(e) {
336
+ return e.copy_ || e.base_;
337
+ }
338
+ function ie(e, t) {
339
+ if (L(e))
340
+ return new Map(e);
341
+ if (X(e))
342
+ return new Set(e);
343
+ if (Array.isArray(e))
344
+ return Array.prototype.slice.call(e);
345
+ const r = Pe(e);
346
+ if (t === !0 || t === "class_only" && !r) {
347
+ const n = Object.getOwnPropertyDescriptors(e);
348
+ delete n[x];
349
+ let o = Reflect.ownKeys(n);
350
+ for (let i = 0; i < o.length; i++) {
351
+ const c = o[i], s = n[c];
352
+ s.writable === !1 && (s.writable = !0, s.configurable = !0), (s.get || s.set) && (n[c] = {
353
+ configurable: !0,
354
+ writable: !0,
355
+ // could live with !!desc.set as well here...
356
+ enumerable: s.enumerable,
357
+ value: e[c]
358
+ });
359
+ }
360
+ return Object.create(P(e), n);
361
+ } else {
362
+ const n = P(e);
363
+ if (n !== null && r)
364
+ return { ...e };
365
+ const o = Object.create(n);
366
+ return Object.assign(o, e);
367
+ }
368
+ }
369
+ function fe(e, t = !1) {
370
+ return q(e) || T(e) || !k(e) || (Y(e) > 1 && Object.defineProperties(e, {
371
+ set: F,
372
+ add: F,
373
+ clear: F,
374
+ delete: F
375
+ }), Object.freeze(e), t && Object.values(e).forEach((r) => fe(r, !0))), e;
376
+ }
377
+ function ft() {
378
+ S(2);
379
+ }
380
+ var F = {
381
+ value: ft
382
+ };
383
+ function q(e) {
384
+ return e === null || typeof e != "object" ? !0 : Object.isFrozen(e);
385
+ }
386
+ var pt = {};
387
+ function V(e) {
388
+ const t = pt[e];
389
+ return t || S(0, e), t;
390
+ }
391
+ var A;
392
+ function Ie() {
393
+ return A;
394
+ }
395
+ function ht(e, t) {
396
+ return {
397
+ drafts_: [],
398
+ parent_: e,
399
+ immer_: t,
400
+ // Whenever the modified draft contains a draft from another scope, we
401
+ // need to prevent auto-freezing so the unowned draft can be finalized.
402
+ canAutoFreeze_: !0,
403
+ unfinalizedDrafts_: 0
404
+ };
405
+ }
406
+ function we(e, t) {
407
+ t && (V("Patches"), e.patches_ = [], e.inversePatches_ = [], e.patchListener_ = t);
408
+ }
409
+ function se(e) {
410
+ ce(e), e.drafts_.forEach(yt), e.drafts_ = null;
411
+ }
412
+ function ce(e) {
413
+ e === A && (A = e.parent_);
414
+ }
415
+ function Ee(e) {
416
+ return A = ht(A, e);
417
+ }
418
+ function yt(e) {
419
+ const t = e[x];
420
+ t.type_ === 0 || t.type_ === 1 ? t.revoke_() : t.revoked_ = !0;
421
+ }
422
+ function Ne(e, t) {
423
+ t.unfinalizedDrafts_ = t.drafts_.length;
424
+ const r = t.drafts_[0];
425
+ return e !== void 0 && e !== r ? (r[x].modified_ && (se(t), S(4)), k(e) && (e = H(t, e), t.parent_ || G(t, e)), t.patches_ && V("Patches").generateReplacementPatches_(
426
+ r[x].base_,
427
+ e,
428
+ t.patches_,
429
+ t.inversePatches_
430
+ )) : e = H(t, r, []), se(t), t.patches_ && t.patchListener_(t.patches_, t.inversePatches_), e !== Me ? e : void 0;
431
+ }
432
+ function H(e, t, r) {
433
+ if (q(t))
434
+ return t;
435
+ const n = e.immer_.shouldUseStrictIteration(), o = t[x];
436
+ if (!o)
437
+ return K(
438
+ t,
439
+ (i, c) => Se(e, o, t, i, c, r),
440
+ n
441
+ ), t;
442
+ if (o.scope_ !== e)
443
+ return t;
444
+ if (!o.modified_)
445
+ return G(e, o.base_, !0), o.base_;
446
+ if (!o.finalized_) {
447
+ o.finalized_ = !0, o.scope_.unfinalizedDrafts_--;
448
+ const i = o.copy_;
449
+ let c = i, s = !1;
450
+ o.type_ === 3 && (c = new Set(i), i.clear(), s = !0), K(
451
+ c,
452
+ (a, u) => Se(
453
+ e,
454
+ o,
455
+ i,
456
+ a,
457
+ u,
458
+ r,
459
+ s
460
+ ),
461
+ n
462
+ ), G(e, i, !1), r && e.patches_ && V("Patches").generatePatches_(
463
+ o,
464
+ r,
465
+ e.patches_,
466
+ e.inversePatches_
467
+ );
468
+ }
469
+ return o.copy_;
470
+ }
471
+ function Se(e, t, r, n, o, i, c) {
472
+ if (o == null || typeof o != "object" && !c)
473
+ return;
474
+ const s = q(o);
475
+ if (!(s && !c)) {
476
+ if (process.env.NODE_ENV !== "production" && o === r && S(5), T(o)) {
477
+ const a = i && t && t.type_ !== 3 && // Set objects are atomic since they have no keys.
478
+ !oe(t.assigned_, n) ? i.concat(n) : void 0, u = H(e, o, a);
479
+ if (Ae(r, n, u), T(u))
480
+ e.canAutoFreeze_ = !1;
481
+ else
482
+ return;
483
+ } else c && r.add(o);
484
+ if (k(o) && !s) {
485
+ if (!e.immer_.autoFreeze_ && e.unfinalizedDrafts_ < 1 || t && t.base_ && t.base_[n] === o && s)
486
+ return;
487
+ H(e, o), (!t || !t.scope_.parent_) && typeof n != "symbol" && (L(r) ? r.has(n) : Object.prototype.propertyIsEnumerable.call(r, n)) && G(e, o);
488
+ }
489
+ }
490
+ }
491
+ function G(e, t, r = !1) {
492
+ !e.parent_ && e.immer_.autoFreeze_ && e.canAutoFreeze_ && fe(t, r);
493
+ }
494
+ function mt(e, t) {
495
+ const r = Array.isArray(e), n = {
496
+ type_: r ? 1 : 0,
497
+ // Track which produce call this is associated with.
498
+ scope_: t ? t.scope_ : Ie(),
499
+ // True for both shallow and deep changes.
500
+ modified_: !1,
501
+ // Used during finalization.
502
+ finalized_: !1,
503
+ // Track which properties have been assigned (true) or deleted (false).
504
+ assigned_: {},
505
+ // The parent draft state.
506
+ parent_: t,
507
+ // The base state.
508
+ base_: e,
509
+ // The base proxy.
510
+ draft_: null,
511
+ // set below
512
+ // The base copy with any updated values.
513
+ copy_: null,
514
+ // Called by the `produce` function.
515
+ revoke_: null,
516
+ isManual_: !1
517
+ };
518
+ let o = n, i = pe;
519
+ r && (o = [n], i = I);
520
+ const { revoke: c, proxy: s } = Proxy.revocable(o, i);
521
+ return n.draft_ = s, n.revoke_ = c, s;
522
+ }
523
+ var pe = {
524
+ get(e, t) {
525
+ if (t === x)
526
+ return e;
527
+ const r = j(e);
528
+ if (!oe(r, t))
529
+ return _t(e, r, t);
530
+ const n = r[t];
531
+ return e.finalized_ || !k(n) ? n : n === ee(e.base_, t) ? (te(e), e.copy_[t] = ue(n, e)) : n;
532
+ },
533
+ has(e, t) {
534
+ return t in j(e);
535
+ },
536
+ ownKeys(e) {
537
+ return Reflect.ownKeys(j(e));
538
+ },
539
+ set(e, t, r) {
540
+ const n = Le(j(e), t);
541
+ if (n?.set)
542
+ return n.set.call(e.draft_, r), !0;
543
+ if (!e.modified_) {
544
+ const o = ee(j(e), t), i = o?.[x];
545
+ if (i && i.base_ === r)
546
+ return e.copy_[t] = r, e.assigned_[t] = !1, !0;
547
+ if (dt(r, o) && (r !== void 0 || oe(e.base_, t)))
548
+ return !0;
549
+ te(e), ae(e);
550
+ }
551
+ return e.copy_[t] === r && // special case: handle new props with value 'undefined'
552
+ (r !== void 0 || t in e.copy_) || // special case: NaN
553
+ Number.isNaN(r) && Number.isNaN(e.copy_[t]) || (e.copy_[t] = r, e.assigned_[t] = !0), !0;
554
+ },
555
+ deleteProperty(e, t) {
556
+ return ee(e.base_, t) !== void 0 || t in e.base_ ? (e.assigned_[t] = !1, te(e), ae(e)) : delete e.assigned_[t], e.copy_ && delete e.copy_[t], !0;
557
+ },
558
+ // Note: We never coerce `desc.value` into an Immer draft, because we can't make
559
+ // the same guarantee in ES5 mode.
560
+ getOwnPropertyDescriptor(e, t) {
561
+ const r = j(e), n = Reflect.getOwnPropertyDescriptor(r, t);
562
+ return n && {
563
+ writable: !0,
564
+ configurable: e.type_ !== 1 || t !== "length",
565
+ enumerable: n.enumerable,
566
+ value: r[t]
567
+ };
568
+ },
569
+ defineProperty() {
570
+ S(11);
571
+ },
572
+ getPrototypeOf(e) {
573
+ return P(e.base_);
574
+ },
575
+ setPrototypeOf() {
576
+ S(12);
577
+ }
578
+ }, I = {};
579
+ K(pe, (e, t) => {
580
+ I[e] = function() {
581
+ return arguments[0] = arguments[0][0], t.apply(this, arguments);
582
+ };
583
+ });
584
+ I.deleteProperty = function(e, t) {
585
+ return process.env.NODE_ENV !== "production" && isNaN(parseInt(t)) && S(13), I.set.call(this, e, t, void 0);
586
+ };
587
+ I.set = function(e, t, r) {
588
+ return process.env.NODE_ENV !== "production" && t !== "length" && isNaN(parseInt(t)) && S(14), pe.set.call(this, e[0], t, r, e[0]);
589
+ };
590
+ function ee(e, t) {
591
+ const r = e[x];
592
+ return (r ? j(r) : e)[t];
593
+ }
594
+ function _t(e, t, r) {
595
+ const n = Le(t, r);
596
+ return n ? "value" in n ? n.value : (
597
+ // This is a very special case, if the prop is a getter defined by the
598
+ // prototype, we should invoke it with the draft as context!
599
+ n.get?.call(e.draft_)
600
+ ) : void 0;
601
+ }
602
+ function Le(e, t) {
603
+ if (!(t in e))
604
+ return;
605
+ let r = P(e);
606
+ for (; r; ) {
607
+ const n = Object.getOwnPropertyDescriptor(r, t);
608
+ if (n)
609
+ return n;
610
+ r = P(r);
611
+ }
612
+ }
613
+ function ae(e) {
614
+ e.modified_ || (e.modified_ = !0, e.parent_ && ae(e.parent_));
615
+ }
616
+ function te(e) {
617
+ e.copy_ || (e.copy_ = ie(
618
+ e.base_,
619
+ e.scope_.immer_.useStrictShallowCopy_
620
+ ));
621
+ }
622
+ var bt = class {
623
+ constructor(e) {
624
+ this.autoFreeze_ = !0, this.useStrictShallowCopy_ = !1, this.useStrictIteration_ = !0, this.produce = (t, r, n) => {
625
+ if (typeof t == "function" && typeof r != "function") {
626
+ const i = r;
627
+ r = t;
628
+ const c = this;
629
+ return function(s = i, ...a) {
630
+ return c.produce(s, (u) => r.call(this, u, ...a));
631
+ };
632
+ }
633
+ typeof r != "function" && S(6), n !== void 0 && typeof n != "function" && S(7);
634
+ let o;
635
+ if (k(t)) {
636
+ const i = Ee(this), c = ue(t, void 0);
637
+ let s = !0;
638
+ try {
639
+ o = r(c), s = !1;
640
+ } finally {
641
+ s ? se(i) : ce(i);
642
+ }
643
+ return we(i, n), Ne(o, i);
644
+ } else if (!t || typeof t != "object") {
645
+ if (o = r(t), o === void 0 && (o = t), o === Me && (o = void 0), this.autoFreeze_ && fe(o, !0), n) {
646
+ const i = [], c = [];
647
+ V("Patches").generateReplacementPatches_(t, o, i, c), n(i, c);
648
+ }
649
+ return o;
650
+ } else
651
+ S(1, t);
652
+ }, this.produceWithPatches = (t, r) => {
653
+ if (typeof t == "function")
654
+ return (i, ...c) => this.produceWithPatches(i, (s) => t(s, ...c));
655
+ let n, o;
656
+ return [this.produce(t, r, (i, c) => {
657
+ n = i, o = c;
658
+ }), n, o];
659
+ }, typeof e?.autoFreeze == "boolean" && this.setAutoFreeze(e.autoFreeze), typeof e?.useStrictShallowCopy == "boolean" && this.setUseStrictShallowCopy(e.useStrictShallowCopy), typeof e?.useStrictIteration == "boolean" && this.setUseStrictIteration(e.useStrictIteration);
660
+ }
661
+ createDraft(e) {
662
+ k(e) || S(8), T(e) && (e = vt(e));
663
+ const t = Ee(this), r = ue(e, void 0);
664
+ return r[x].isManual_ = !0, ce(t), r;
665
+ }
666
+ finishDraft(e, t) {
667
+ const r = e && e[x];
668
+ (!r || !r.isManual_) && S(9);
669
+ const { scope_: n } = r;
670
+ return we(n, t), Ne(void 0, n);
671
+ }
672
+ /**
673
+ * Pass true to automatically freeze all copies created by Immer.
674
+ *
675
+ * By default, auto-freezing is enabled.
676
+ */
677
+ setAutoFreeze(e) {
678
+ this.autoFreeze_ = e;
679
+ }
680
+ /**
681
+ * Pass true to enable strict shallow copy.
682
+ *
683
+ * By default, immer does not copy the object descriptors such as getter, setter and non-enumrable properties.
684
+ */
685
+ setUseStrictShallowCopy(e) {
686
+ this.useStrictShallowCopy_ = e;
687
+ }
688
+ /**
689
+ * Pass false to use faster iteration that skips non-enumerable properties
690
+ * but still handles symbols for compatibility.
691
+ *
692
+ * By default, strict iteration is enabled (includes all own properties).
693
+ */
694
+ setUseStrictIteration(e) {
695
+ this.useStrictIteration_ = e;
696
+ }
697
+ shouldUseStrictIteration() {
698
+ return this.useStrictIteration_;
699
+ }
700
+ applyPatches(e, t) {
701
+ let r;
702
+ for (r = t.length - 1; r >= 0; r--) {
703
+ const o = t[r];
704
+ if (o.path.length === 0 && o.op === "replace") {
705
+ e = o.value;
706
+ break;
707
+ }
708
+ }
709
+ r > -1 && (t = t.slice(r + 1));
710
+ const n = V("Patches").applyPatches_;
711
+ return T(e) ? n(e, t) : this.produce(
712
+ e,
713
+ (o) => n(o, t)
714
+ );
715
+ }
716
+ };
717
+ function ue(e, t) {
718
+ const r = L(e) ? V("MapSet").proxyMap_(e, t) : X(e) ? V("MapSet").proxySet_(e, t) : mt(e, t);
719
+ return (t ? t.scope_ : Ie()).drafts_.push(r), r;
720
+ }
721
+ function vt(e) {
722
+ return T(e) || S(10, e), $e(e);
723
+ }
724
+ function $e(e) {
725
+ if (!k(e) || q(e))
726
+ return e;
727
+ const t = e[x];
728
+ let r, n = !0;
729
+ if (t) {
730
+ if (!t.modified_)
731
+ return t.base_;
732
+ t.finalized_ = !0, r = ie(e, t.scope_.immer_.useStrictShallowCopy_), n = t.scope_.immer_.shouldUseStrictIteration();
733
+ } else
734
+ r = ie(e, !0);
735
+ return K(
736
+ r,
737
+ (o, i) => {
738
+ Ae(r, o, $e(i));
739
+ },
740
+ n
741
+ ), t && (t.finalized_ = !1), r;
742
+ }
743
+ var le = new bt(), Fe = le.produce, gt = /* @__PURE__ */ le.setUseStrictIteration.bind(
744
+ le
745
+ ), wt = (e, t, r) => {
746
+ if (t.length === 1 && t[0] === r) {
747
+ let n = !1;
748
+ try {
749
+ const o = {};
750
+ e(o) === o && (n = !0);
751
+ } catch {
752
+ }
753
+ if (n) {
754
+ let o;
755
+ try {
756
+ throw new Error();
757
+ } catch (i) {
758
+ ({ stack: o } = i);
759
+ }
760
+ console.warn(
761
+ `The result function returned its own inputs without modification. e.g
762
+ \`createSelector([state => state.todos], todos => todos)\`
763
+ This could lead to inefficient memoization and unnecessary re-renders.
764
+ Ensure transformation logic is in the result function, and extraction logic is in the input selectors.`,
765
+ { stack: o }
766
+ );
767
+ }
768
+ }
769
+ }, Et = (e, t, r) => {
770
+ const { memoize: n, memoizeOptions: o } = t, { inputSelectorResults: i, inputSelectorResultsCopy: c } = e, s = n(() => ({}), ...o);
771
+ if (s.apply(null, i) !== s.apply(null, c)) {
772
+ let a;
773
+ try {
774
+ throw new Error();
775
+ } catch (u) {
776
+ ({ stack: a } = u);
777
+ }
778
+ console.warn(
779
+ `An input selector returned a different result when passed same arguments.
780
+ This means your output selector will likely run more frequently than intended.
781
+ Avoid returning a new reference inside your input selector, e.g.
782
+ \`createSelector([state => state.todos.map(todo => todo.id)], todoIds => todoIds.length)\``,
783
+ {
784
+ arguments: r,
785
+ firstInputs: i,
786
+ secondInputs: c,
787
+ stack: a
788
+ }
789
+ );
790
+ }
791
+ }, Nt = {
792
+ inputStabilityCheck: "once",
793
+ identityFunctionCheck: "once"
794
+ };
795
+ function St(e, t = `expected a function, instead received ${typeof e}`) {
796
+ if (typeof e != "function")
797
+ throw new TypeError(t);
798
+ }
799
+ function Ot(e, t = `expected an object, instead received ${typeof e}`) {
800
+ if (typeof e != "object")
801
+ throw new TypeError(t);
802
+ }
803
+ function xt(e, t = "expected all items to be functions, instead received the following types: ") {
804
+ if (!e.every((r) => typeof r == "function")) {
805
+ const r = e.map(
806
+ (n) => typeof n == "function" ? `function ${n.name || "unnamed"}()` : typeof n
807
+ ).join(", ");
808
+ throw new TypeError(`${t}[${r}]`);
809
+ }
810
+ }
811
+ var Oe = (e) => Array.isArray(e) ? e : [e];
812
+ function Ct(e) {
813
+ const t = Array.isArray(e[0]) ? e[0] : e;
814
+ return xt(
815
+ t,
816
+ "createSelector expects all input-selectors to be functions, but received the following types: "
817
+ ), t;
818
+ }
819
+ function xe(e, t) {
820
+ const r = [], { length: n } = e;
821
+ for (let o = 0; o < n; o++)
822
+ r.push(e[o].apply(null, t));
823
+ return r;
824
+ }
825
+ var kt = (e, t) => {
826
+ const { identityFunctionCheck: r, inputStabilityCheck: n } = {
827
+ ...Nt,
828
+ ...t
829
+ };
830
+ return {
831
+ identityFunctionCheck: {
832
+ shouldRun: r === "always" || r === "once" && e,
833
+ run: wt
834
+ },
835
+ inputStabilityCheck: {
836
+ shouldRun: n === "always" || n === "once" && e,
837
+ run: Et
838
+ }
839
+ };
840
+ }, Dt = class {
841
+ constructor(e) {
842
+ this.value = e;
843
+ }
844
+ deref() {
845
+ return this.value;
846
+ }
847
+ }, jt = typeof WeakRef < "u" ? WeakRef : Dt, Rt = 0, Ce = 1;
848
+ function W() {
849
+ return {
850
+ s: Rt,
851
+ v: void 0,
852
+ o: null,
853
+ p: null
854
+ };
855
+ }
856
+ function We(e, t = {}) {
857
+ let r = W();
858
+ const { resultEqualityCheck: n } = t;
859
+ let o, i = 0;
860
+ function c() {
861
+ let s = r;
862
+ const { length: a } = arguments;
863
+ for (let p = 0, h = a; p < h; p++) {
864
+ const d = arguments[p];
865
+ if (typeof d == "function" || typeof d == "object" && d !== null) {
866
+ let _ = s.o;
867
+ _ === null && (s.o = _ = /* @__PURE__ */ new WeakMap());
868
+ const g = _.get(d);
869
+ g === void 0 ? (s = W(), _.set(d, s)) : s = g;
870
+ } else {
871
+ let _ = s.p;
872
+ _ === null && (s.p = _ = /* @__PURE__ */ new Map());
873
+ const g = _.get(d);
874
+ g === void 0 ? (s = W(), _.set(d, s)) : s = g;
875
+ }
876
+ }
877
+ const u = s;
878
+ let l;
879
+ if (s.s === Ce)
880
+ l = s.v;
881
+ else if (l = e.apply(null, arguments), i++, n) {
882
+ const p = o?.deref?.() ?? o;
883
+ p != null && n(p, l) && (l = p, i !== 0 && i--), o = typeof l == "object" && l !== null || typeof l == "function" ? new jt(l) : l;
884
+ }
885
+ return u.s = Ce, u.v = l, l;
886
+ }
887
+ return c.clearCache = () => {
888
+ r = W(), c.resetResultsCount();
889
+ }, c.resultsCount = () => i, c.resetResultsCount = () => {
890
+ i = 0;
891
+ }, c;
892
+ }
893
+ function Tt(e, ...t) {
894
+ const r = typeof e == "function" ? {
895
+ memoize: e,
896
+ memoizeOptions: t
897
+ } : e, n = (...o) => {
898
+ let i = 0, c = 0, s, a = {}, u = o.pop();
899
+ typeof u == "object" && (a = u, u = o.pop()), St(
900
+ u,
901
+ `createSelector expects an output function after the inputs, but received: [${typeof u}]`
902
+ );
903
+ const l = {
904
+ ...r,
905
+ ...a
906
+ }, {
907
+ memoize: p,
908
+ memoizeOptions: h = [],
909
+ argsMemoize: d = We,
910
+ argsMemoizeOptions: _ = [],
911
+ devModeChecks: g = {}
912
+ } = l, O = Oe(h), C = Oe(_), f = Ct(o), y = p(function() {
913
+ return i++, u.apply(
914
+ null,
915
+ arguments
916
+ );
917
+ }, ...O);
918
+ let b = !0;
919
+ const m = d(function() {
920
+ c++;
921
+ const v = xe(
922
+ f,
923
+ arguments
924
+ );
925
+ if (s = y.apply(null, v), process.env.NODE_ENV !== "production") {
926
+ const { identityFunctionCheck: w, inputStabilityCheck: M } = kt(b, g);
927
+ if (w.shouldRun && w.run(
928
+ u,
929
+ v,
930
+ s
931
+ ), M.shouldRun) {
932
+ const J = xe(
933
+ f,
934
+ arguments
935
+ );
936
+ M.run(
937
+ { inputSelectorResults: v, inputSelectorResultsCopy: J },
938
+ { memoize: p, memoizeOptions: O },
939
+ arguments
940
+ );
941
+ }
942
+ b && (b = !1);
943
+ }
944
+ return s;
945
+ }, ...C);
946
+ return Object.assign(m, {
947
+ resultFunc: u,
948
+ memoizedResultFunc: y,
949
+ dependencies: f,
950
+ dependencyRecomputations: () => c,
951
+ resetDependencyRecomputations: () => {
952
+ c = 0;
953
+ },
954
+ lastResult: () => s,
955
+ recomputations: () => i,
956
+ resetRecomputations: () => {
957
+ i = 0;
958
+ },
959
+ memoize: p,
960
+ argsMemoize: d
961
+ });
962
+ };
963
+ return Object.assign(n, {
964
+ withTypes: () => n
965
+ }), n;
966
+ }
967
+ var z = /* @__PURE__ */ Tt(We), Vt = Object.assign(
968
+ (e, t = z) => {
969
+ Ot(
970
+ e,
971
+ `createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`
972
+ );
973
+ const r = Object.keys(e), n = r.map(
974
+ (o) => e[o]
975
+ );
976
+ return t(
977
+ n,
978
+ (...o) => o.reduce((i, c, s) => (i[r[s]] = c, i), {})
979
+ );
980
+ },
981
+ { withTypes: () => Vt }
982
+ );
983
+ function ke(e, t) {
984
+ function r(...n) {
985
+ if (t) {
986
+ let o = t(...n);
987
+ if (!o)
988
+ throw new Error(process.env.NODE_ENV === "production" ? N(0) : "prepareAction did not return an object");
989
+ return {
990
+ type: e,
991
+ payload: o.payload,
992
+ ..."meta" in o && {
993
+ meta: o.meta
994
+ },
995
+ ..."error" in o && {
996
+ error: o.error
997
+ }
998
+ };
999
+ }
1000
+ return {
1001
+ type: e,
1002
+ payload: n[0]
1003
+ };
1004
+ }
1005
+ return r.toString = () => `${e}`, r.type = e, r.match = (n) => at(n) && n.type === e, r;
1006
+ }
1007
+ function De(e) {
1008
+ return k(e) ? Fe(e, () => {
1009
+ }) : e;
1010
+ }
1011
+ function B(e, t, r) {
1012
+ return e.has(t) ? e.get(t) : e.set(t, r(t)).get(t);
1013
+ }
1014
+ function Be(e) {
1015
+ const t = {}, r = [];
1016
+ let n;
1017
+ const o = {
1018
+ addCase(i, c) {
1019
+ if (process.env.NODE_ENV !== "production") {
1020
+ if (r.length > 0)
1021
+ throw new Error(process.env.NODE_ENV === "production" ? N(26) : "`builder.addCase` should only be called before calling `builder.addMatcher`");
1022
+ if (n)
1023
+ throw new Error(process.env.NODE_ENV === "production" ? N(27) : "`builder.addCase` should only be called before calling `builder.addDefaultCase`");
1024
+ }
1025
+ const s = typeof i == "string" ? i : i.type;
1026
+ if (!s)
1027
+ throw new Error(process.env.NODE_ENV === "production" ? N(28) : "`builder.addCase` cannot be called with an empty action type");
1028
+ if (s in t)
1029
+ throw new Error(process.env.NODE_ENV === "production" ? N(29) : `\`builder.addCase\` cannot be called with two reducers for the same action type '${s}'`);
1030
+ return t[s] = c, o;
1031
+ },
1032
+ addAsyncThunk(i, c) {
1033
+ if (process.env.NODE_ENV !== "production" && n)
1034
+ throw new Error(process.env.NODE_ENV === "production" ? N(43) : "`builder.addAsyncThunk` should only be called before calling `builder.addDefaultCase`");
1035
+ return c.pending && (t[i.pending.type] = c.pending), c.rejected && (t[i.rejected.type] = c.rejected), c.fulfilled && (t[i.fulfilled.type] = c.fulfilled), c.settled && r.push({
1036
+ matcher: i.settled,
1037
+ reducer: c.settled
1038
+ }), o;
1039
+ },
1040
+ addMatcher(i, c) {
1041
+ if (process.env.NODE_ENV !== "production" && n)
1042
+ throw new Error(process.env.NODE_ENV === "production" ? N(30) : "`builder.addMatcher` should only be called before calling `builder.addDefaultCase`");
1043
+ return r.push({
1044
+ matcher: i,
1045
+ reducer: c
1046
+ }), o;
1047
+ },
1048
+ addDefaultCase(i) {
1049
+ if (process.env.NODE_ENV !== "production" && n)
1050
+ throw new Error(process.env.NODE_ENV === "production" ? N(31) : "`builder.addDefaultCase` can only be called once");
1051
+ return n = i, o;
1052
+ }
1053
+ };
1054
+ return e(o), [t, r, n];
1055
+ }
1056
+ gt(!1);
1057
+ function zt(e) {
1058
+ return typeof e == "function";
1059
+ }
1060
+ function Mt(e, t) {
1061
+ if (process.env.NODE_ENV !== "production" && typeof t == "object")
1062
+ throw new Error(process.env.NODE_ENV === "production" ? N(8) : "The object notation for `createReducer` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createReducer");
1063
+ let [r, n, o] = Be(t), i;
1064
+ if (zt(e))
1065
+ i = () => De(e());
1066
+ else {
1067
+ const s = De(e);
1068
+ i = () => s;
1069
+ }
1070
+ function c(s = i(), a) {
1071
+ let u = [r[a.type], ...n.filter(({
1072
+ matcher: l
1073
+ }) => l(a)).map(({
1074
+ reducer: l
1075
+ }) => l)];
1076
+ return u.filter((l) => !!l).length === 0 && (u = [o]), u.reduce((l, p) => {
1077
+ if (p)
1078
+ if (T(l)) {
1079
+ const h = p(l, a);
1080
+ return h === void 0 ? l : h;
1081
+ } else {
1082
+ if (k(l))
1083
+ return Fe(l, (h) => p(h, a));
1084
+ {
1085
+ const h = p(l, a);
1086
+ if (h === void 0) {
1087
+ if (l === null)
1088
+ return l;
1089
+ throw Error("A case reducer on a non-draftable value must not return undefined");
1090
+ }
1091
+ return h;
1092
+ }
1093
+ }
1094
+ return l;
1095
+ }, s);
1096
+ }
1097
+ return c.getInitialState = i, c;
1098
+ }
1099
+ var Pt = /* @__PURE__ */ Symbol.for("rtk-slice-createasyncthunk");
1100
+ function At(e, t) {
1101
+ return `${e}/${t}`;
1102
+ }
1103
+ function It({
1104
+ creators: e
1105
+ } = {}) {
1106
+ const t = e?.asyncThunk?.[Pt];
1107
+ return function(r) {
1108
+ const {
1109
+ name: n,
1110
+ reducerPath: o = n
1111
+ } = r;
1112
+ if (!n)
1113
+ throw new Error(process.env.NODE_ENV === "production" ? N(11) : "`name` is a required option for createSlice");
1114
+ typeof process < "u" && process.env.NODE_ENV === "development" && r.initialState === void 0 && console.error("You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`");
1115
+ const i = (typeof r.reducers == "function" ? r.reducers(Ft()) : r.reducers) || {}, c = Object.keys(i), s = {
1116
+ sliceCaseReducersByName: {},
1117
+ sliceCaseReducersByType: {},
1118
+ actionCreators: {},
1119
+ sliceMatchers: []
1120
+ }, a = {
1121
+ addCase(f, y) {
1122
+ const b = typeof f == "string" ? f : f.type;
1123
+ if (!b)
1124
+ throw new Error(process.env.NODE_ENV === "production" ? N(12) : "`context.addCase` cannot be called with an empty action type");
1125
+ if (b in s.sliceCaseReducersByType)
1126
+ throw new Error(process.env.NODE_ENV === "production" ? N(13) : "`context.addCase` cannot be called with two reducers for the same action type: " + b);
1127
+ return s.sliceCaseReducersByType[b] = y, a;
1128
+ },
1129
+ addMatcher(f, y) {
1130
+ return s.sliceMatchers.push({
1131
+ matcher: f,
1132
+ reducer: y
1133
+ }), a;
1134
+ },
1135
+ exposeAction(f, y) {
1136
+ return s.actionCreators[f] = y, a;
1137
+ },
1138
+ exposeCaseReducer(f, y) {
1139
+ return s.sliceCaseReducersByName[f] = y, a;
1140
+ }
1141
+ };
1142
+ c.forEach((f) => {
1143
+ const y = i[f], b = {
1144
+ reducerName: f,
1145
+ type: At(n, f),
1146
+ createNotation: typeof r.reducers == "function"
1147
+ };
1148
+ Bt(y) ? Kt(b, y, a, t) : Wt(b, y, a);
1149
+ });
1150
+ function u() {
1151
+ if (process.env.NODE_ENV !== "production" && typeof r.extraReducers == "object")
1152
+ throw new Error(process.env.NODE_ENV === "production" ? N(14) : "The object notation for `createSlice.extraReducers` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createSlice");
1153
+ const [f = {}, y = [], b = void 0] = typeof r.extraReducers == "function" ? Be(r.extraReducers) : [r.extraReducers], m = {
1154
+ ...f,
1155
+ ...s.sliceCaseReducersByType
1156
+ };
1157
+ return Mt(r.initialState, (v) => {
1158
+ for (let w in m)
1159
+ v.addCase(w, m[w]);
1160
+ for (let w of s.sliceMatchers)
1161
+ v.addMatcher(w.matcher, w.reducer);
1162
+ for (let w of y)
1163
+ v.addMatcher(w.matcher, w.reducer);
1164
+ b && v.addDefaultCase(b);
1165
+ });
1166
+ }
1167
+ const l = (f) => f, p = /* @__PURE__ */ new Map(), h = /* @__PURE__ */ new WeakMap();
1168
+ let d;
1169
+ function _(f, y) {
1170
+ return d || (d = u()), d(f, y);
1171
+ }
1172
+ function g() {
1173
+ return d || (d = u()), d.getInitialState();
1174
+ }
1175
+ function O(f, y = !1) {
1176
+ function b(v) {
1177
+ let w = v[f];
1178
+ if (typeof w > "u") {
1179
+ if (y)
1180
+ w = B(h, b, g);
1181
+ else if (process.env.NODE_ENV !== "production")
1182
+ throw new Error(process.env.NODE_ENV === "production" ? N(15) : "selectSlice returned undefined for an uninjected slice reducer");
1183
+ }
1184
+ return w;
1185
+ }
1186
+ function m(v = l) {
1187
+ const w = B(p, y, () => /* @__PURE__ */ new WeakMap());
1188
+ return B(w, v, () => {
1189
+ const M = {};
1190
+ for (const [J, Ye] of Object.entries(r.selectors ?? {}))
1191
+ M[J] = Lt(Ye, v, () => B(h, v, g), y);
1192
+ return M;
1193
+ });
1194
+ }
1195
+ return {
1196
+ reducerPath: f,
1197
+ getSelectors: m,
1198
+ get selectors() {
1199
+ return m(b);
1200
+ },
1201
+ selectSlice: b
1202
+ };
1203
+ }
1204
+ const C = {
1205
+ name: n,
1206
+ reducer: _,
1207
+ actions: s.actionCreators,
1208
+ caseReducers: s.sliceCaseReducersByName,
1209
+ getInitialState: g,
1210
+ ...O(o),
1211
+ injectInto(f, {
1212
+ reducerPath: y,
1213
+ ...b
1214
+ } = {}) {
1215
+ const m = y ?? o;
1216
+ return f.inject({
1217
+ reducerPath: m,
1218
+ reducer: _
1219
+ }, b), {
1220
+ ...C,
1221
+ ...O(m, !0)
1222
+ };
1223
+ }
1224
+ };
1225
+ return C;
1226
+ };
1227
+ }
1228
+ function Lt(e, t, r, n) {
1229
+ function o(i, ...c) {
1230
+ let s = t(i);
1231
+ if (typeof s > "u") {
1232
+ if (n)
1233
+ s = r();
1234
+ else if (process.env.NODE_ENV !== "production")
1235
+ throw new Error(process.env.NODE_ENV === "production" ? N(16) : "selectState returned undefined for an uninjected slice reducer");
1236
+ }
1237
+ return e(s, ...c);
1238
+ }
1239
+ return o.unwrapped = e, o;
1240
+ }
1241
+ var $t = /* @__PURE__ */ It();
1242
+ function Ft() {
1243
+ function e(t, r) {
1244
+ return {
1245
+ _reducerDefinitionType: "asyncThunk",
1246
+ payloadCreator: t,
1247
+ ...r
1248
+ };
1249
+ }
1250
+ return e.withTypes = () => e, {
1251
+ reducer(t) {
1252
+ return Object.assign({
1253
+ // hack so the wrapping function has the same name as the original
1254
+ // we need to create a wrapper so the `reducerDefinitionType` is not assigned to the original
1255
+ [t.name](...r) {
1256
+ return t(...r);
1257
+ }
1258
+ }[t.name], {
1259
+ _reducerDefinitionType: "reducer"
1260
+ /* reducer */
1261
+ });
1262
+ },
1263
+ preparedReducer(t, r) {
1264
+ return {
1265
+ _reducerDefinitionType: "reducerWithPrepare",
1266
+ prepare: t,
1267
+ reducer: r
1268
+ };
1269
+ },
1270
+ asyncThunk: e
1271
+ };
1272
+ }
1273
+ function Wt({
1274
+ type: e,
1275
+ reducerName: t,
1276
+ createNotation: r
1277
+ }, n, o) {
1278
+ let i, c;
1279
+ if ("reducer" in n) {
1280
+ if (r && !Ut(n))
1281
+ throw new Error(process.env.NODE_ENV === "production" ? N(17) : "Please use the `create.preparedReducer` notation for prepared action creators with the `create` notation.");
1282
+ i = n.reducer, c = n.prepare;
1283
+ } else
1284
+ i = n;
1285
+ o.addCase(e, i).exposeCaseReducer(t, i).exposeAction(t, c ? ke(e, c) : ke(e));
1286
+ }
1287
+ function Bt(e) {
1288
+ return e._reducerDefinitionType === "asyncThunk";
1289
+ }
1290
+ function Ut(e) {
1291
+ return e._reducerDefinitionType === "reducerWithPrepare";
1292
+ }
1293
+ function Kt({
1294
+ type: e,
1295
+ reducerName: t
1296
+ }, r, n, o) {
1297
+ if (!o)
1298
+ throw new Error(process.env.NODE_ENV === "production" ? N(18) : "Cannot use `create.asyncThunk` in the built-in `createSlice`. Use `buildCreateSlice({ creators: { asyncThunk: asyncThunkCreator } })` to create a customised version of `createSlice`.");
1299
+ const {
1300
+ payloadCreator: i,
1301
+ fulfilled: c,
1302
+ pending: s,
1303
+ rejected: a,
1304
+ settled: u,
1305
+ options: l
1306
+ } = r, p = o(e, i, l);
1307
+ n.exposeAction(t, p), c && n.addCase(p.fulfilled, c), s && n.addCase(p.pending, s), a && n.addCase(p.rejected, a), u && n.addMatcher(p.settled, u), n.exposeCaseReducer(t, {
1308
+ fulfilled: c || U,
1309
+ pending: s || U,
1310
+ rejected: a || U,
1311
+ settled: u || U
1312
+ });
1313
+ }
1314
+ function U() {
1315
+ }
1316
+ function N(e) {
1317
+ return `Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `;
1318
+ }
1319
+ const Ht = {
1320
+ maxNotifications: 5,
1321
+ autoDismiss: !0,
1322
+ dismissTimeout: 5e3
1323
+ }, Gt = {
1324
+ notifications: [],
1325
+ config: Ht
1326
+ }, Yt = (e, t) => {
1327
+ const r = {
1328
+ ...t.payload,
1329
+ id: Date.now().toString(),
1330
+ timestamp: Date.now(),
1331
+ dismissed: !1
1332
+ };
1333
+ e.notifications.unshift(r), e.config.maxNotifications && e.notifications.length > e.config.maxNotifications && (e.notifications = e.notifications.slice(
1334
+ 0,
1335
+ e.config.maxNotifications
1336
+ ));
1337
+ }, Xt = (e, t) => {
1338
+ const r = e.notifications.find((n) => n.id === t.payload);
1339
+ r && (r.dismissed = !0);
1340
+ }, qt = (e, t) => {
1341
+ e.notifications = e.notifications.filter(
1342
+ (r) => r.id !== t.payload
1343
+ );
1344
+ }, Jt = (e) => {
1345
+ e.notifications = [];
1346
+ }, Qt = (e, t) => {
1347
+ e.config = { ...e.config, ...t.payload };
1348
+ }, Ue = $t({
1349
+ name: "notifications",
1350
+ initialState: Gt,
1351
+ reducers: {
1352
+ addNotification: Yt,
1353
+ dismissNotification: Xt,
1354
+ removeNotification: qt,
1355
+ clearNotifications: Jt,
1356
+ updateConfig: Qt
1357
+ }
1358
+ }), {
1359
+ addNotification: ir,
1360
+ dismissNotification: je,
1361
+ removeNotification: Re,
1362
+ clearNotifications: sr,
1363
+ updateConfig: cr
1364
+ } = Ue.actions;
1365
+ Ue.reducer;
1366
+ const Zt = "notifications", Ke = (e) => e[Zt], He = z(
1367
+ [Ke],
1368
+ (e) => e.notifications
1369
+ ), Ge = z(
1370
+ [He],
1371
+ (e) => e.filter((t) => !t.dismissed)
1372
+ );
1373
+ z(
1374
+ [He],
1375
+ (e) => e.length
1376
+ );
1377
+ z(
1378
+ [Ge],
1379
+ (e) => e.length
1380
+ );
1381
+ const er = z(
1382
+ [Ke],
1383
+ (e) => e.config
1384
+ );
1385
+ function tr({
1386
+ notification: e,
1387
+ onDismissed: t,
1388
+ onRemoved: r
1389
+ }) {
1390
+ const [n, o] = re(!1), [i, c] = re(!1);
1391
+ ne(() => {
1392
+ const h = setTimeout(() => o(!0), 10);
1393
+ return () => clearTimeout(h);
1394
+ }, []);
1395
+ const s = () => {
1396
+ c(!0), t(e.id), setTimeout(() => {
1397
+ r(e.id);
1398
+ }, 300);
1399
+ }, a = (h) => {
1400
+ const d = "p-4 rounded-lg border shadow-lg transition-all duration-300 ease-in-out transform";
1401
+ switch (h) {
1402
+ case "success":
1403
+ return `${d} bg-success-50 dark:bg-success-900/20 border-success-200 dark:border-success-700`;
1404
+ case "warning":
1405
+ return `${d} bg-warning-50 dark:bg-warning-900/20 border-warning-200 dark:border-warning-700`;
1406
+ case "error":
1407
+ return `${d} bg-error-50 dark:bg-error-900/20 border-error-200 dark:border-error-700`;
1408
+ default:
1409
+ return d;
1410
+ }
1411
+ }, u = (h) => {
1412
+ switch (h) {
1413
+ case "success":
1414
+ return "text-success-800 dark:text-success-200";
1415
+ case "warning":
1416
+ return "text-warning-800 dark:text-warning-200";
1417
+ case "error":
1418
+ return "text-error-800 dark:text-error-200";
1419
+ default:
1420
+ return "";
1421
+ }
1422
+ }, l = (h) => {
1423
+ switch (h) {
1424
+ case "success":
1425
+ return "text-success-600 dark:text-success-400";
1426
+ case "warning":
1427
+ return "text-warning-600 dark:text-warning-400";
1428
+ case "error":
1429
+ return "text-error-600 dark:text-error-400";
1430
+ default:
1431
+ return "";
1432
+ }
1433
+ }, p = (h) => {
1434
+ switch (h) {
1435
+ case "success":
1436
+ return /* @__PURE__ */ E(
1437
+ "svg",
1438
+ {
1439
+ className: "w-5 h-5 text-success-600 dark:text-success-400",
1440
+ fill: "none",
1441
+ stroke: "currentColor",
1442
+ viewBox: "0 0 24 24",
1443
+ children: /* @__PURE__ */ E(
1444
+ "path",
1445
+ {
1446
+ strokeLinecap: "round",
1447
+ strokeLinejoin: "round",
1448
+ strokeWidth: 2,
1449
+ d: "M5 13l4 4L19 7"
1450
+ }
1451
+ )
1452
+ }
1453
+ );
1454
+ case "warning":
1455
+ return /* @__PURE__ */ E(
1456
+ "svg",
1457
+ {
1458
+ className: "w-5 h-5 text-warning-600 dark:text-warning-400",
1459
+ fill: "none",
1460
+ stroke: "currentColor",
1461
+ viewBox: "0 0 24 24",
1462
+ children: /* @__PURE__ */ E(
1463
+ "path",
1464
+ {
1465
+ strokeLinecap: "round",
1466
+ strokeLinejoin: "round",
1467
+ strokeWidth: 2,
1468
+ d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z"
1469
+ }
1470
+ )
1471
+ }
1472
+ );
1473
+ case "error":
1474
+ return /* @__PURE__ */ E(
1475
+ "svg",
1476
+ {
1477
+ className: "w-5 h-5 text-error-600 dark:text-error-400",
1478
+ fill: "none",
1479
+ stroke: "currentColor",
1480
+ viewBox: "0 0 24 24",
1481
+ children: /* @__PURE__ */ E(
1482
+ "path",
1483
+ {
1484
+ strokeLinecap: "round",
1485
+ strokeLinejoin: "round",
1486
+ strokeWidth: 2,
1487
+ d: "M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
1488
+ }
1489
+ )
1490
+ }
1491
+ );
1492
+ default:
1493
+ return null;
1494
+ }
1495
+ };
1496
+ return /* @__PURE__ */ E(
1497
+ "div",
1498
+ {
1499
+ className: `
1500
+ ${a(e.type)}
1501
+ ${n ? "translate-x-0 opacity-100" : "translate-x-full opacity-0"}
1502
+ ${i ? "translate-x-full opacity-0" : ""}
1503
+ min-w-[320px] max-w-[480px] w-full
1504
+ `,
1505
+ role: "alert",
1506
+ "aria-live": "assertive",
1507
+ children: /* @__PURE__ */ he("div", { className: "flex items-start gap-3", children: [
1508
+ /* @__PURE__ */ E("div", { className: "flex-shrink-0 mt-0.5", children: p(e.type) }),
1509
+ /* @__PURE__ */ he("div", { className: "flex-1 min-w-0", children: [
1510
+ /* @__PURE__ */ E(
1511
+ "h4",
1512
+ {
1513
+ className: `text-sm font-semibold ${u(
1514
+ e.type
1515
+ )}`,
1516
+ children: e.type.charAt(0).toUpperCase() + e.type.slice(1)
1517
+ }
1518
+ ),
1519
+ /* @__PURE__ */ E(
1520
+ "p",
1521
+ {
1522
+ "data-testid": "notification",
1523
+ className: `text-sm mt-1 ${l(
1524
+ e.type
1525
+ )}`,
1526
+ children: e.message
1527
+ }
1528
+ )
1529
+ ] }),
1530
+ /* @__PURE__ */ E(
1531
+ "button",
1532
+ {
1533
+ "data-testid": "dismiss-button",
1534
+ onClick: s,
1535
+ className: "flex-shrink-0 p-1 text-neutral-400 hover:text-neutral-600 dark:hover:text-neutral-300 transition-colors",
1536
+ "aria-label": "Dismiss notification",
1537
+ children: /* @__PURE__ */ E(
1538
+ "svg",
1539
+ {
1540
+ className: "w-4 h-4",
1541
+ fill: "none",
1542
+ stroke: "currentColor",
1543
+ viewBox: "0 0 24 24",
1544
+ children: /* @__PURE__ */ E(
1545
+ "path",
1546
+ {
1547
+ strokeLinecap: "round",
1548
+ strokeLinejoin: "round",
1549
+ strokeWidth: 2,
1550
+ d: "M6 18L18 6M6 6l12 12"
1551
+ }
1552
+ )
1553
+ }
1554
+ )
1555
+ }
1556
+ )
1557
+ ] })
1558
+ }
1559
+ );
1560
+ }
1561
+ function rr() {
1562
+ const e = be(Ge), t = be(er), r = ot(), [n, o] = re(
1563
+ []
1564
+ );
1565
+ ne(() => {
1566
+ if (!t.autoDismiss || !t.dismissTimeout) return;
1567
+ const a = [];
1568
+ return e.forEach((u) => {
1569
+ const l = setTimeout(() => {
1570
+ r(je(u.id)), setTimeout(() => {
1571
+ r(Re(u.id));
1572
+ }, 300);
1573
+ }, t.dismissTimeout);
1574
+ a.push(l);
1575
+ }), () => {
1576
+ a.forEach(clearTimeout);
1577
+ };
1578
+ }, [e, t.autoDismiss, t.dismissTimeout, r]), ne(() => {
1579
+ const a = e.map((u) => u.id);
1580
+ o((u) => {
1581
+ const l = [...u];
1582
+ return a.forEach((p) => {
1583
+ l.includes(p) || l.push(p);
1584
+ }), l;
1585
+ });
1586
+ }, [e]);
1587
+ const i = (a) => {
1588
+ r(je(a));
1589
+ }, c = (a) => {
1590
+ r(Re(a)), o(
1591
+ (u) => u.filter((l) => l !== a)
1592
+ );
1593
+ }, s = e.filter(
1594
+ (a) => n.includes(a.id)
1595
+ );
1596
+ return s.length === 0 ? null : /* @__PURE__ */ E(
1597
+ "div",
1598
+ {
1599
+ className: "fixed bottom-4 right-4 z-50 flex flex-col gap-3 pointer-events-none",
1600
+ "aria-live": "polite",
1601
+ "aria-label": "Notifications",
1602
+ children: s.map((a) => /* @__PURE__ */ E("div", { className: "pointer-events-auto", children: /* @__PURE__ */ E(
1603
+ tr,
1604
+ {
1605
+ notification: a,
1606
+ onDismissed: i,
1607
+ onRemoved: c
1608
+ }
1609
+ ) }, a.id))
1610
+ }
1611
+ );
1612
+ }
1613
+ function ar() {
1614
+ return /* @__PURE__ */ E(rr, {});
1615
+ }
1616
+ export {
1617
+ rr as NotificationToastContainer,
1618
+ ar as SharedFeatureNotifications
1619
+ };