@yusr_systems/core 2.2.1 → 2.2.3
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/yusr-core.js +83 -815
- package/package.json +33 -29
package/dist/yusr-core.js
CHANGED
|
@@ -1,782 +1,50 @@
|
|
|
1
|
-
import e from "
|
|
1
|
+
import { createSlice as e } from "@reduxjs/toolkit";
|
|
2
|
+
import t from "react";
|
|
2
3
|
import "react-dom";
|
|
3
4
|
//#region src/auth/authConstants.ts
|
|
4
|
-
var
|
|
5
|
+
var n = class {
|
|
5
6
|
static LoggedInUserStorageItemName = "LoggedInUser";
|
|
6
7
|
static AuthCheckStorageItemName = "IsLoggedIn";
|
|
7
8
|
static SettingStorageItemName = "Setting";
|
|
8
9
|
static UnauthorizedEventName = "ApiUnauthorized";
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
var n = () => Math.random().toString(36).substring(7).split("").join(".");
|
|
12
|
-
`${/* @__PURE__ */ n()}`, `${/* @__PURE__ */ n()}`;
|
|
13
|
-
function r(e) {
|
|
14
|
-
if (typeof e != "object" || !e) return !1;
|
|
15
|
-
let t = e;
|
|
16
|
-
for (; Object.getPrototypeOf(t) !== null;) t = Object.getPrototypeOf(t);
|
|
17
|
-
return Object.getPrototypeOf(e) === t || Object.getPrototypeOf(e) === null;
|
|
18
|
-
}
|
|
19
|
-
function i(e) {
|
|
20
|
-
return r(e) && "type" in e && typeof e.type == "string";
|
|
21
|
-
}
|
|
22
|
-
//#endregion
|
|
23
|
-
//#region ../../node_modules/immer/dist/immer.mjs
|
|
24
|
-
var a = Symbol.for("immer-nothing"), o = Symbol.for("immer-draftable"), s = Symbol.for("immer-state"), c = process.env.NODE_ENV === "production" ? [] : [
|
|
25
|
-
function(e) {
|
|
26
|
-
return `The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`;
|
|
27
|
-
},
|
|
28
|
-
function(e) {
|
|
29
|
-
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}'`;
|
|
30
|
-
},
|
|
31
|
-
"This object has been frozen and should not be mutated",
|
|
32
|
-
function(e) {
|
|
33
|
-
return "Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? " + e;
|
|
34
|
-
},
|
|
35
|
-
"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.",
|
|
36
|
-
"Immer forbids circular references",
|
|
37
|
-
"The first or second argument to `produce` must be a function",
|
|
38
|
-
"The third argument to `produce` must be a function or undefined",
|
|
39
|
-
"First argument to `createDraft` must be a plain object, an array, or an immerable object",
|
|
40
|
-
"First argument to `finishDraft` must be a draft returned by `createDraft`",
|
|
41
|
-
function(e) {
|
|
42
|
-
return `'current' expects a draft, got: ${e}`;
|
|
43
|
-
},
|
|
44
|
-
"Object.defineProperty() cannot be used on an Immer draft",
|
|
45
|
-
"Object.setPrototypeOf() cannot be used on an Immer draft",
|
|
46
|
-
"Immer only supports deleting array indices",
|
|
47
|
-
"Immer only supports setting array indices and the 'length' property",
|
|
48
|
-
function(e) {
|
|
49
|
-
return `'original' expects a draft, got: ${e}`;
|
|
50
|
-
}
|
|
51
|
-
];
|
|
52
|
-
function l(e, ...t) {
|
|
53
|
-
if (process.env.NODE_ENV !== "production") {
|
|
54
|
-
let n = c[e], r = D(n) ? n.apply(null, t) : n;
|
|
55
|
-
throw Error(`[Immer] ${r}`);
|
|
56
|
-
}
|
|
57
|
-
throw Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`);
|
|
58
|
-
}
|
|
59
|
-
var u = Object, d = u.getPrototypeOf, f = "constructor", p = "prototype", m = "configurable", h = "enumerable", g = "writable", _ = "value", v = (e) => !!e && !!e[s];
|
|
60
|
-
function y(e) {
|
|
61
|
-
return e ? ne(e) || w(e) || !!e[o] || !!e[f]?.[o] || T(e) || E(e) : !1;
|
|
62
|
-
}
|
|
63
|
-
var ee = u[p][f].toString(), te = /* @__PURE__ */ new WeakMap();
|
|
64
|
-
function ne(e) {
|
|
65
|
-
if (!e || !ae(e)) return !1;
|
|
66
|
-
let t = d(e);
|
|
67
|
-
if (t === null || t === u[p]) return !0;
|
|
68
|
-
let n = u.hasOwnProperty.call(t, f) && t[f];
|
|
69
|
-
if (n === Object) return !0;
|
|
70
|
-
if (!D(n)) return !1;
|
|
71
|
-
let r = te.get(n);
|
|
72
|
-
return r === void 0 && (r = Function.toString.call(n), te.set(n, r)), r === ee;
|
|
73
|
-
}
|
|
74
|
-
function b(e, t, n = !0) {
|
|
75
|
-
x(e) === 0 ? (n ? Reflect.ownKeys(e) : u.keys(e)).forEach((n) => {
|
|
76
|
-
t(n, e[n], e);
|
|
77
|
-
}) : e.forEach((n, r) => t(r, n, e));
|
|
78
|
-
}
|
|
79
|
-
function x(e) {
|
|
80
|
-
let t = e[s];
|
|
81
|
-
return t ? t.type_ : w(e) ? 1 : T(e) ? 2 : E(e) ? 3 : 0;
|
|
82
|
-
}
|
|
83
|
-
var re = (e, t, n = x(e)) => n === 2 ? e.has(t) : u[p].hasOwnProperty.call(e, t), S = (e, t, n = x(e)) => n === 2 ? e.get(t) : e[t], C = (e, t, n, r = x(e)) => {
|
|
84
|
-
r === 2 ? e.set(t, n) : r === 3 ? e.add(n) : e[t] = n;
|
|
85
|
-
};
|
|
86
|
-
function ie(e, t) {
|
|
87
|
-
return e === t ? e !== 0 || 1 / e == 1 / t : e !== e && t !== t;
|
|
88
|
-
}
|
|
89
|
-
var w = Array.isArray, T = (e) => e instanceof Map, E = (e) => e instanceof Set, ae = (e) => typeof e == "object", D = (e) => typeof e == "function", O = (e) => typeof e == "boolean";
|
|
90
|
-
function oe(e) {
|
|
91
|
-
let t = +e;
|
|
92
|
-
return Number.isInteger(t) && String(t) === e;
|
|
93
|
-
}
|
|
94
|
-
var k = (e) => e.copy_ || e.base_, se = (e) => e.modified_ ? e.copy_ : e.base_;
|
|
95
|
-
function A(e, t) {
|
|
96
|
-
if (T(e)) return new Map(e);
|
|
97
|
-
if (E(e)) return new Set(e);
|
|
98
|
-
if (w(e)) return Array[p].slice.call(e);
|
|
99
|
-
let n = ne(e);
|
|
100
|
-
if (t === !0 || t === "class_only" && !n) {
|
|
101
|
-
let t = u.getOwnPropertyDescriptors(e);
|
|
102
|
-
delete t[s];
|
|
103
|
-
let n = Reflect.ownKeys(t);
|
|
104
|
-
for (let r = 0; r < n.length; r++) {
|
|
105
|
-
let i = n[r], a = t[i];
|
|
106
|
-
a[g] === !1 && (a[g] = !0, a[m] = !0), (a.get || a.set) && (t[i] = {
|
|
107
|
-
[m]: !0,
|
|
108
|
-
[g]: !0,
|
|
109
|
-
[h]: a[h],
|
|
110
|
-
[_]: e[i]
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
return u.create(d(e), t);
|
|
114
|
-
} else {
|
|
115
|
-
let t = d(e);
|
|
116
|
-
if (t !== null && n) return { ...e };
|
|
117
|
-
let r = u.create(t);
|
|
118
|
-
return u.assign(r, e);
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
function j(e, t = !1) {
|
|
122
|
-
return N(e) || v(e) || !y(e) ? e : (x(e) > 1 && u.defineProperties(e, {
|
|
123
|
-
set: M,
|
|
124
|
-
add: M,
|
|
125
|
-
clear: M,
|
|
126
|
-
delete: M
|
|
127
|
-
}), u.freeze(e), t && b(e, (e, t) => {
|
|
128
|
-
j(t, !0);
|
|
129
|
-
}, !1), e);
|
|
130
|
-
}
|
|
131
|
-
function ce() {
|
|
132
|
-
l(2);
|
|
133
|
-
}
|
|
134
|
-
var M = { [_]: ce };
|
|
135
|
-
function N(e) {
|
|
136
|
-
return e === null || !ae(e) ? !0 : u.isFrozen(e);
|
|
137
|
-
}
|
|
138
|
-
var P = "MapSet", F = "Patches", le = "ArrayMethods", ue = {};
|
|
139
|
-
function I(e) {
|
|
140
|
-
let t = ue[e];
|
|
141
|
-
return t || l(0, e), t;
|
|
142
|
-
}
|
|
143
|
-
var de = (e) => !!ue[e], L, fe = () => L, pe = (e, t) => ({
|
|
144
|
-
drafts_: [],
|
|
145
|
-
parent_: e,
|
|
146
|
-
immer_: t,
|
|
147
|
-
canAutoFreeze_: !0,
|
|
148
|
-
unfinalizedDrafts_: 0,
|
|
149
|
-
handledSet_: /* @__PURE__ */ new Set(),
|
|
150
|
-
processedForPatches_: /* @__PURE__ */ new Set(),
|
|
151
|
-
mapSetPlugin_: de(P) ? I(P) : void 0,
|
|
152
|
-
arrayMethodsPlugin_: de(le) ? I(le) : void 0
|
|
153
|
-
});
|
|
154
|
-
function me(e, t) {
|
|
155
|
-
t && (e.patchPlugin_ = I(F), e.patches_ = [], e.inversePatches_ = [], e.patchListener_ = t);
|
|
156
|
-
}
|
|
157
|
-
function he(e) {
|
|
158
|
-
ge(e), e.drafts_.forEach(ve), e.drafts_ = null;
|
|
159
|
-
}
|
|
160
|
-
function ge(e) {
|
|
161
|
-
e === L && (L = e.parent_);
|
|
162
|
-
}
|
|
163
|
-
var _e = (e) => L = pe(L, e);
|
|
164
|
-
function ve(e) {
|
|
165
|
-
let t = e[s];
|
|
166
|
-
t.type_ === 0 || t.type_ === 1 ? t.revoke_() : t.revoked_ = !0;
|
|
167
|
-
}
|
|
168
|
-
function ye(e, t) {
|
|
169
|
-
t.unfinalizedDrafts_ = t.drafts_.length;
|
|
170
|
-
let n = t.drafts_[0];
|
|
171
|
-
if (e !== void 0 && e !== n) {
|
|
172
|
-
n[s].modified_ && (he(t), l(4)), y(e) && (e = be(t, e));
|
|
173
|
-
let { patchPlugin_: r } = t;
|
|
174
|
-
r && r.generateReplacementPatches_(n[s].base_, e, t);
|
|
175
|
-
} else e = be(t, n);
|
|
176
|
-
return xe(t, e, !0), he(t), t.patches_ && t.patchListener_(t.patches_, t.inversePatches_), e === a ? void 0 : e;
|
|
177
|
-
}
|
|
178
|
-
function be(e, t) {
|
|
179
|
-
if (N(t)) return t;
|
|
180
|
-
let n = t[s];
|
|
181
|
-
if (!n) return z(t, e.handledSet_, e);
|
|
182
|
-
if (!R(n, e)) return t;
|
|
183
|
-
if (!n.modified_) return n.base_;
|
|
184
|
-
if (!n.finalized_) {
|
|
185
|
-
let { callbacks_: t } = n;
|
|
186
|
-
if (t) for (; t.length > 0;) t.pop()(e);
|
|
187
|
-
Ee(n, e);
|
|
188
|
-
}
|
|
189
|
-
return n.copy_;
|
|
190
|
-
}
|
|
191
|
-
function xe(e, t, n = !1) {
|
|
192
|
-
!e.parent_ && e.immer_.autoFreeze_ && e.canAutoFreeze_ && j(t, n);
|
|
193
|
-
}
|
|
194
|
-
function Se(e) {
|
|
195
|
-
e.finalized_ = !0, e.scope_.unfinalizedDrafts_--;
|
|
196
|
-
}
|
|
197
|
-
var R = (e, t) => e.scope_ === t, Ce = [];
|
|
198
|
-
function we(e, t, n, r) {
|
|
199
|
-
let i = k(e), a = e.type_;
|
|
200
|
-
if (r !== void 0 && S(i, r, a) === t) {
|
|
201
|
-
C(i, r, n, a);
|
|
202
|
-
return;
|
|
203
|
-
}
|
|
204
|
-
if (!e.draftLocations_) {
|
|
205
|
-
let t = e.draftLocations_ = /* @__PURE__ */ new Map();
|
|
206
|
-
b(i, (e, n) => {
|
|
207
|
-
if (v(n)) {
|
|
208
|
-
let r = t.get(n) || [];
|
|
209
|
-
r.push(e), t.set(n, r);
|
|
210
|
-
}
|
|
211
|
-
});
|
|
212
|
-
}
|
|
213
|
-
let o = e.draftLocations_.get(t) ?? Ce;
|
|
214
|
-
for (let e of o) C(i, e, n, a);
|
|
215
|
-
}
|
|
216
|
-
function Te(e, t, n) {
|
|
217
|
-
e.callbacks_.push(function(r) {
|
|
218
|
-
let i = t;
|
|
219
|
-
if (!i || !R(i, r)) return;
|
|
220
|
-
r.mapSetPlugin_?.fixSetContents(i);
|
|
221
|
-
let a = se(i);
|
|
222
|
-
we(e, i.draft_ ?? i, a, n), Ee(i, r);
|
|
223
|
-
});
|
|
224
|
-
}
|
|
225
|
-
function Ee(e, t) {
|
|
226
|
-
if (e.modified_ && !e.finalized_ && (e.type_ === 3 || e.type_ === 1 && e.allIndicesReassigned_ || (e.assigned_?.size ?? 0) > 0)) {
|
|
227
|
-
let { patchPlugin_: n } = t;
|
|
228
|
-
if (n) {
|
|
229
|
-
let r = n.getPath(e);
|
|
230
|
-
r && n.generatePatches_(e, r, t);
|
|
231
|
-
}
|
|
232
|
-
Se(e);
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
function De(e, t, n) {
|
|
236
|
-
let { scope_: r } = e;
|
|
237
|
-
if (v(n)) {
|
|
238
|
-
let i = n[s];
|
|
239
|
-
R(i, r) && i.callbacks_.push(function() {
|
|
240
|
-
U(e), we(e, n, se(i), t);
|
|
241
|
-
});
|
|
242
|
-
} else y(n) && e.callbacks_.push(function() {
|
|
243
|
-
let i = k(e);
|
|
244
|
-
e.type_ === 3 ? i.has(n) && z(n, r.handledSet_, r) : S(i, t, e.type_) === n && r.drafts_.length > 1 && (e.assigned_.get(t) ?? !1) === !0 && e.copy_ && z(S(e.copy_, t, e.type_), r.handledSet_, r);
|
|
245
|
-
});
|
|
246
|
-
}
|
|
247
|
-
function z(e, t, n) {
|
|
248
|
-
return !n.immer_.autoFreeze_ && n.unfinalizedDrafts_ < 1 || v(e) || t.has(e) || !y(e) || N(e) ? e : (t.add(e), b(e, (r, i) => {
|
|
249
|
-
if (v(i)) {
|
|
250
|
-
let t = i[s];
|
|
251
|
-
R(t, n) && (C(e, r, se(t), e.type_), Se(t));
|
|
252
|
-
} else y(i) && z(i, t, n);
|
|
253
|
-
}), e);
|
|
254
|
-
}
|
|
255
|
-
function Oe(e, t) {
|
|
256
|
-
let n = w(e), r = {
|
|
257
|
-
type_: n ? 1 : 0,
|
|
258
|
-
scope_: t ? t.scope_ : fe(),
|
|
259
|
-
modified_: !1,
|
|
260
|
-
finalized_: !1,
|
|
261
|
-
assigned_: void 0,
|
|
262
|
-
parent_: t,
|
|
263
|
-
base_: e,
|
|
264
|
-
draft_: null,
|
|
265
|
-
copy_: null,
|
|
266
|
-
revoke_: null,
|
|
267
|
-
isManual_: !1,
|
|
268
|
-
callbacks_: void 0
|
|
269
|
-
}, i = r, a = B;
|
|
270
|
-
n && (i = [r], a = V);
|
|
271
|
-
let { revoke: o, proxy: s } = Proxy.revocable(i, a);
|
|
272
|
-
return r.draft_ = s, r.revoke_ = o, [s, r];
|
|
273
|
-
}
|
|
274
|
-
var B = {
|
|
275
|
-
get(e, t) {
|
|
276
|
-
if (t === s) return e;
|
|
277
|
-
let n = e.scope_.arrayMethodsPlugin_, r = e.type_ === 1 && typeof t == "string";
|
|
278
|
-
if (r && n?.isArrayOperationMethod(t)) return n.createMethodInterceptor(e, t);
|
|
279
|
-
let i = k(e);
|
|
280
|
-
if (!re(i, t, e.type_)) return ke(e, i, t);
|
|
281
|
-
let a = i[t];
|
|
282
|
-
if (e.finalized_ || !y(a) || r && e.operationMethod && n?.isMutatingArrayMethod(e.operationMethod) && oe(t)) return a;
|
|
283
|
-
if (a === H(e.base_, t)) {
|
|
284
|
-
U(e);
|
|
285
|
-
let n = e.type_ === 1 ? +t : t, r = W(e.scope_, a, e, n);
|
|
286
|
-
return e.copy_[n] = r;
|
|
287
|
-
}
|
|
288
|
-
return a;
|
|
289
|
-
},
|
|
290
|
-
has(e, t) {
|
|
291
|
-
return t in k(e);
|
|
292
|
-
},
|
|
293
|
-
ownKeys(e) {
|
|
294
|
-
return Reflect.ownKeys(k(e));
|
|
295
|
-
},
|
|
296
|
-
set(e, t, n) {
|
|
297
|
-
let r = Ae(k(e), t);
|
|
298
|
-
if (r?.set) return r.set.call(e.draft_, n), !0;
|
|
299
|
-
if (!e.modified_) {
|
|
300
|
-
let r = H(k(e), t), i = r?.[s];
|
|
301
|
-
if (i && i.base_ === n) return e.copy_[t] = n, e.assigned_.set(t, !1), !0;
|
|
302
|
-
if (ie(n, r) && (n !== void 0 || re(e.base_, t, e.type_))) return !0;
|
|
303
|
-
U(e), je(e);
|
|
304
|
-
}
|
|
305
|
-
return e.copy_[t] === n && (n !== void 0 || t in e.copy_) || Number.isNaN(n) && Number.isNaN(e.copy_[t]) ? !0 : (e.copy_[t] = n, e.assigned_.set(t, !0), De(e, t, n), !0);
|
|
306
|
-
},
|
|
307
|
-
deleteProperty(e, t) {
|
|
308
|
-
return U(e), H(e.base_, t) !== void 0 || t in e.base_ ? (e.assigned_.set(t, !1), je(e)) : e.assigned_.delete(t), e.copy_ && delete e.copy_[t], !0;
|
|
309
|
-
},
|
|
310
|
-
getOwnPropertyDescriptor(e, t) {
|
|
311
|
-
let n = k(e), r = Reflect.getOwnPropertyDescriptor(n, t);
|
|
312
|
-
return r && {
|
|
313
|
-
[g]: !0,
|
|
314
|
-
[m]: e.type_ !== 1 || t !== "length",
|
|
315
|
-
[h]: r[h],
|
|
316
|
-
[_]: n[t]
|
|
317
|
-
};
|
|
318
|
-
},
|
|
319
|
-
defineProperty() {
|
|
320
|
-
l(11);
|
|
321
|
-
},
|
|
322
|
-
getPrototypeOf(e) {
|
|
323
|
-
return d(e.base_);
|
|
324
|
-
},
|
|
325
|
-
setPrototypeOf() {
|
|
326
|
-
l(12);
|
|
327
|
-
}
|
|
328
|
-
}, V = {};
|
|
329
|
-
for (let e in B) {
|
|
330
|
-
let t = B[e];
|
|
331
|
-
V[e] = function() {
|
|
332
|
-
let e = arguments;
|
|
333
|
-
return e[0] = e[0][0], t.apply(this, e);
|
|
334
|
-
};
|
|
335
|
-
}
|
|
336
|
-
V.deleteProperty = function(e, t) {
|
|
337
|
-
return process.env.NODE_ENV !== "production" && isNaN(parseInt(t)) && l(13), V.set.call(this, e, t, void 0);
|
|
338
|
-
}, V.set = function(e, t, n) {
|
|
339
|
-
return process.env.NODE_ENV !== "production" && t !== "length" && isNaN(parseInt(t)) && l(14), B.set.call(this, e[0], t, n, e[0]);
|
|
340
|
-
};
|
|
341
|
-
function H(e, t) {
|
|
342
|
-
let n = e[s];
|
|
343
|
-
return (n ? k(n) : e)[t];
|
|
344
|
-
}
|
|
345
|
-
function ke(e, t, n) {
|
|
346
|
-
let r = Ae(t, n);
|
|
347
|
-
return r ? _ in r ? r[_] : r.get?.call(e.draft_) : void 0;
|
|
348
|
-
}
|
|
349
|
-
function Ae(e, t) {
|
|
350
|
-
if (!(t in e)) return;
|
|
351
|
-
let n = d(e);
|
|
352
|
-
for (; n;) {
|
|
353
|
-
let e = Object.getOwnPropertyDescriptor(n, t);
|
|
354
|
-
if (e) return e;
|
|
355
|
-
n = d(n);
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
function je(e) {
|
|
359
|
-
e.modified_ || (e.modified_ = !0, e.parent_ && je(e.parent_));
|
|
360
|
-
}
|
|
361
|
-
function U(e) {
|
|
362
|
-
e.copy_ ||= (e.assigned_ = /* @__PURE__ */ new Map(), A(e.base_, e.scope_.immer_.useStrictShallowCopy_));
|
|
363
|
-
}
|
|
364
|
-
var Me = class {
|
|
365
|
-
constructor(e) {
|
|
366
|
-
this.autoFreeze_ = !0, this.useStrictShallowCopy_ = !1, this.useStrictIteration_ = !1, this.produce = (e, t, n) => {
|
|
367
|
-
if (D(e) && !D(t)) {
|
|
368
|
-
let n = t;
|
|
369
|
-
t = e;
|
|
370
|
-
let r = this;
|
|
371
|
-
return function(e = n, ...i) {
|
|
372
|
-
return r.produce(e, (e) => t.call(this, e, ...i));
|
|
373
|
-
};
|
|
374
|
-
}
|
|
375
|
-
D(t) || l(6), n !== void 0 && !D(n) && l(7);
|
|
376
|
-
let r;
|
|
377
|
-
if (y(e)) {
|
|
378
|
-
let i = _e(this), a = W(i, e, void 0), o = !0;
|
|
379
|
-
try {
|
|
380
|
-
r = t(a), o = !1;
|
|
381
|
-
} finally {
|
|
382
|
-
o ? he(i) : ge(i);
|
|
383
|
-
}
|
|
384
|
-
return me(i, n), ye(r, i);
|
|
385
|
-
} else if (!e || !ae(e)) {
|
|
386
|
-
if (r = t(e), r === void 0 && (r = e), r === a && (r = void 0), this.autoFreeze_ && j(r, !0), n) {
|
|
387
|
-
let t = [], i = [];
|
|
388
|
-
I(F).generateReplacementPatches_(e, r, {
|
|
389
|
-
patches_: t,
|
|
390
|
-
inversePatches_: i
|
|
391
|
-
}), n(t, i);
|
|
392
|
-
}
|
|
393
|
-
return r;
|
|
394
|
-
} else l(1, e);
|
|
395
|
-
}, this.produceWithPatches = (e, t) => {
|
|
396
|
-
if (D(e)) return (t, ...n) => this.produceWithPatches(t, (t) => e(t, ...n));
|
|
397
|
-
let n, r;
|
|
398
|
-
return [
|
|
399
|
-
this.produce(e, t, (e, t) => {
|
|
400
|
-
n = e, r = t;
|
|
401
|
-
}),
|
|
402
|
-
n,
|
|
403
|
-
r
|
|
404
|
-
];
|
|
405
|
-
}, O(e?.autoFreeze) && this.setAutoFreeze(e.autoFreeze), O(e?.useStrictShallowCopy) && this.setUseStrictShallowCopy(e.useStrictShallowCopy), O(e?.useStrictIteration) && this.setUseStrictIteration(e.useStrictIteration);
|
|
406
|
-
}
|
|
407
|
-
createDraft(e) {
|
|
408
|
-
y(e) || l(8), v(e) && (e = Ne(e));
|
|
409
|
-
let t = _e(this), n = W(t, e, void 0);
|
|
410
|
-
return n[s].isManual_ = !0, ge(t), n;
|
|
411
|
-
}
|
|
412
|
-
finishDraft(e, t) {
|
|
413
|
-
let n = e && e[s];
|
|
414
|
-
(!n || !n.isManual_) && l(9);
|
|
415
|
-
let { scope_: r } = n;
|
|
416
|
-
return me(r, t), ye(void 0, r);
|
|
417
|
-
}
|
|
418
|
-
setAutoFreeze(e) {
|
|
419
|
-
this.autoFreeze_ = e;
|
|
420
|
-
}
|
|
421
|
-
setUseStrictShallowCopy(e) {
|
|
422
|
-
this.useStrictShallowCopy_ = e;
|
|
423
|
-
}
|
|
424
|
-
setUseStrictIteration(e) {
|
|
425
|
-
this.useStrictIteration_ = e;
|
|
426
|
-
}
|
|
427
|
-
shouldUseStrictIteration() {
|
|
428
|
-
return this.useStrictIteration_;
|
|
429
|
-
}
|
|
430
|
-
applyPatches(e, t) {
|
|
431
|
-
let n;
|
|
432
|
-
for (n = t.length - 1; n >= 0; n--) {
|
|
433
|
-
let r = t[n];
|
|
434
|
-
if (r.path.length === 0 && r.op === "replace") {
|
|
435
|
-
e = r.value;
|
|
436
|
-
break;
|
|
437
|
-
}
|
|
438
|
-
}
|
|
439
|
-
n > -1 && (t = t.slice(n + 1));
|
|
440
|
-
let r = I(F).applyPatches_;
|
|
441
|
-
return v(e) ? r(e, t) : this.produce(e, (e) => r(e, t));
|
|
442
|
-
}
|
|
443
|
-
};
|
|
444
|
-
function W(e, t, n, r) {
|
|
445
|
-
let [i, a] = T(t) ? I(P).proxyMap_(t, n) : E(t) ? I(P).proxySet_(t, n) : Oe(t, n);
|
|
446
|
-
return (n?.scope_ ?? fe()).drafts_.push(i), a.callbacks_ = n?.callbacks_ ?? [], a.key_ = r, n && r !== void 0 ? Te(n, a, r) : a.callbacks_.push(function(e) {
|
|
447
|
-
e.mapSetPlugin_?.fixSetContents(a);
|
|
448
|
-
let { patchPlugin_: t } = e;
|
|
449
|
-
a.modified_ && t && t.generatePatches_(a, [], e);
|
|
450
|
-
}), i;
|
|
451
|
-
}
|
|
452
|
-
function Ne(e) {
|
|
453
|
-
return v(e) || l(10, e), Pe(e);
|
|
454
|
-
}
|
|
455
|
-
function Pe(e) {
|
|
456
|
-
if (!y(e) || N(e)) return e;
|
|
457
|
-
let t = e[s], n, r = !0;
|
|
458
|
-
if (t) {
|
|
459
|
-
if (!t.modified_) return t.base_;
|
|
460
|
-
t.finalized_ = !0, n = A(e, t.scope_.immer_.useStrictShallowCopy_), r = t.scope_.immer_.shouldUseStrictIteration();
|
|
461
|
-
} else n = A(e, !0);
|
|
462
|
-
return b(n, (e, t) => {
|
|
463
|
-
C(n, e, Pe(t));
|
|
464
|
-
}, r), t && (t.finalized_ = !1), n;
|
|
465
|
-
}
|
|
466
|
-
var Fe = new Me().produce;
|
|
467
|
-
typeof window < "u" && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__, typeof window < "u" && window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__;
|
|
468
|
-
function G(e, t) {
|
|
469
|
-
function n(...n) {
|
|
470
|
-
if (t) {
|
|
471
|
-
let r = t(...n);
|
|
472
|
-
if (!r) throw Error(process.env.NODE_ENV === "production" ? J(0) : "prepareAction did not return an object");
|
|
473
|
-
return {
|
|
474
|
-
type: e,
|
|
475
|
-
payload: r.payload,
|
|
476
|
-
..."meta" in r && { meta: r.meta },
|
|
477
|
-
..."error" in r && { error: r.error }
|
|
478
|
-
};
|
|
479
|
-
}
|
|
480
|
-
return {
|
|
481
|
-
type: e,
|
|
482
|
-
payload: n[0]
|
|
483
|
-
};
|
|
484
|
-
}
|
|
485
|
-
return n.toString = () => `${e}`, n.type = e, n.match = (t) => i(t) && t.type === e, n;
|
|
486
|
-
}
|
|
487
|
-
Array, Symbol.species;
|
|
488
|
-
function Ie(e) {
|
|
489
|
-
return y(e) ? Fe(e, () => {}) : e;
|
|
490
|
-
}
|
|
491
|
-
function K(e, t, n) {
|
|
492
|
-
return e.has(t) ? e.get(t) : e.set(t, n(t)).get(t);
|
|
493
|
-
}
|
|
494
|
-
function Le(e) {
|
|
495
|
-
let t = {}, n = [], r, i = {
|
|
496
|
-
addCase(e, a) {
|
|
497
|
-
if (process.env.NODE_ENV !== "production") {
|
|
498
|
-
if (n.length > 0) throw Error(process.env.NODE_ENV === "production" ? J(26) : "`builder.addCase` should only be called before calling `builder.addMatcher`");
|
|
499
|
-
if (r) throw Error(process.env.NODE_ENV === "production" ? J(27) : "`builder.addCase` should only be called before calling `builder.addDefaultCase`");
|
|
500
|
-
}
|
|
501
|
-
let o = typeof e == "string" ? e : e.type;
|
|
502
|
-
if (!o) throw Error(process.env.NODE_ENV === "production" ? J(28) : "`builder.addCase` cannot be called with an empty action type");
|
|
503
|
-
if (o in t) throw Error(process.env.NODE_ENV === "production" ? J(29) : `\`builder.addCase\` cannot be called with two reducers for the same action type '${o}'`);
|
|
504
|
-
return t[o] = a, i;
|
|
505
|
-
},
|
|
506
|
-
addAsyncThunk(e, a) {
|
|
507
|
-
if (process.env.NODE_ENV !== "production" && r) throw Error(process.env.NODE_ENV === "production" ? J(43) : "`builder.addAsyncThunk` should only be called before calling `builder.addDefaultCase`");
|
|
508
|
-
return a.pending && (t[e.pending.type] = a.pending), a.rejected && (t[e.rejected.type] = a.rejected), a.fulfilled && (t[e.fulfilled.type] = a.fulfilled), a.settled && n.push({
|
|
509
|
-
matcher: e.settled,
|
|
510
|
-
reducer: a.settled
|
|
511
|
-
}), i;
|
|
512
|
-
},
|
|
513
|
-
addMatcher(e, t) {
|
|
514
|
-
if (process.env.NODE_ENV !== "production" && r) throw Error(process.env.NODE_ENV === "production" ? J(30) : "`builder.addMatcher` should only be called before calling `builder.addDefaultCase`");
|
|
515
|
-
return n.push({
|
|
516
|
-
matcher: e,
|
|
517
|
-
reducer: t
|
|
518
|
-
}), i;
|
|
519
|
-
},
|
|
520
|
-
addDefaultCase(e) {
|
|
521
|
-
if (process.env.NODE_ENV !== "production" && r) throw Error(process.env.NODE_ENV === "production" ? J(31) : "`builder.addDefaultCase` can only be called once");
|
|
522
|
-
return r = e, i;
|
|
523
|
-
}
|
|
524
|
-
};
|
|
525
|
-
return e(i), [
|
|
526
|
-
t,
|
|
527
|
-
n,
|
|
528
|
-
r
|
|
529
|
-
];
|
|
530
|
-
}
|
|
531
|
-
function Re(e) {
|
|
532
|
-
return typeof e == "function";
|
|
533
|
-
}
|
|
534
|
-
function ze(e, t) {
|
|
535
|
-
if (process.env.NODE_ENV !== "production" && typeof t == "object") throw Error(process.env.NODE_ENV === "production" ? J(8) : "The object notation for `createReducer` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createReducer");
|
|
536
|
-
let [n, r, i] = Le(t), a;
|
|
537
|
-
if (Re(e)) a = () => Ie(e());
|
|
538
|
-
else {
|
|
539
|
-
let t = Ie(e);
|
|
540
|
-
a = () => t;
|
|
541
|
-
}
|
|
542
|
-
function o(e = a(), t) {
|
|
543
|
-
let o = [n[t.type], ...r.filter(({ matcher: e }) => e(t)).map(({ reducer: e }) => e)];
|
|
544
|
-
return o.filter((e) => !!e).length === 0 && (o = [i]), o.reduce((e, n) => {
|
|
545
|
-
if (n) if (v(e)) {
|
|
546
|
-
let r = n(e, t);
|
|
547
|
-
return r === void 0 ? e : r;
|
|
548
|
-
} else if (y(e)) return Fe(e, (e) => n(e, t));
|
|
549
|
-
else {
|
|
550
|
-
let r = n(e, t);
|
|
551
|
-
if (r === void 0) {
|
|
552
|
-
if (e === null) return e;
|
|
553
|
-
throw Error("A case reducer on a non-draftable value must not return undefined");
|
|
554
|
-
}
|
|
555
|
-
return r;
|
|
556
|
-
}
|
|
557
|
-
return e;
|
|
558
|
-
}, e);
|
|
559
|
-
}
|
|
560
|
-
return o.getInitialState = a, o;
|
|
561
|
-
}
|
|
562
|
-
var Be = /* @__PURE__ */ Symbol.for("rtk-slice-createasyncthunk");
|
|
563
|
-
function Ve(e, t) {
|
|
564
|
-
return `${e}/${t}`;
|
|
565
|
-
}
|
|
566
|
-
function He({ creators: e } = {}) {
|
|
567
|
-
let t = e?.asyncThunk?.[Be];
|
|
568
|
-
return function(e) {
|
|
569
|
-
let { name: n, reducerPath: r = n } = e;
|
|
570
|
-
if (!n) throw Error(process.env.NODE_ENV === "production" ? J(11) : "`name` is a required option for createSlice");
|
|
571
|
-
typeof process < "u" && process.env.NODE_ENV === "development" && e.initialState === void 0 && console.error("You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`");
|
|
572
|
-
let i = (typeof e.reducers == "function" ? e.reducers(Ge()) : e.reducers) || {}, a = Object.keys(i), o = {
|
|
573
|
-
sliceCaseReducersByName: {},
|
|
574
|
-
sliceCaseReducersByType: {},
|
|
575
|
-
actionCreators: {},
|
|
576
|
-
sliceMatchers: []
|
|
577
|
-
}, s = {
|
|
578
|
-
addCase(e, t) {
|
|
579
|
-
let n = typeof e == "string" ? e : e.type;
|
|
580
|
-
if (!n) throw Error(process.env.NODE_ENV === "production" ? J(12) : "`context.addCase` cannot be called with an empty action type");
|
|
581
|
-
if (n in o.sliceCaseReducersByType) throw Error(process.env.NODE_ENV === "production" ? J(13) : "`context.addCase` cannot be called with two reducers for the same action type: " + n);
|
|
582
|
-
return o.sliceCaseReducersByType[n] = t, s;
|
|
583
|
-
},
|
|
584
|
-
addMatcher(e, t) {
|
|
585
|
-
return o.sliceMatchers.push({
|
|
586
|
-
matcher: e,
|
|
587
|
-
reducer: t
|
|
588
|
-
}), s;
|
|
589
|
-
},
|
|
590
|
-
exposeAction(e, t) {
|
|
591
|
-
return o.actionCreators[e] = t, s;
|
|
592
|
-
},
|
|
593
|
-
exposeCaseReducer(e, t) {
|
|
594
|
-
return o.sliceCaseReducersByName[e] = t, s;
|
|
595
|
-
}
|
|
596
|
-
};
|
|
597
|
-
a.forEach((r) => {
|
|
598
|
-
let a = i[r], o = {
|
|
599
|
-
reducerName: r,
|
|
600
|
-
type: Ve(n, r),
|
|
601
|
-
createNotation: typeof e.reducers == "function"
|
|
602
|
-
};
|
|
603
|
-
qe(a) ? Ye(o, a, s, t) : Ke(o, a, s);
|
|
604
|
-
});
|
|
605
|
-
function c() {
|
|
606
|
-
if (process.env.NODE_ENV !== "production" && typeof e.extraReducers == "object") throw Error(process.env.NODE_ENV === "production" ? J(14) : "The object notation for `createSlice.extraReducers` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createSlice");
|
|
607
|
-
let [t = {}, n = [], r = void 0] = typeof e.extraReducers == "function" ? Le(e.extraReducers) : [e.extraReducers], i = {
|
|
608
|
-
...t,
|
|
609
|
-
...o.sliceCaseReducersByType
|
|
610
|
-
};
|
|
611
|
-
return ze(e.initialState, (e) => {
|
|
612
|
-
for (let t in i) e.addCase(t, i[t]);
|
|
613
|
-
for (let t of o.sliceMatchers) e.addMatcher(t.matcher, t.reducer);
|
|
614
|
-
for (let t of n) e.addMatcher(t.matcher, t.reducer);
|
|
615
|
-
r && e.addDefaultCase(r);
|
|
616
|
-
});
|
|
617
|
-
}
|
|
618
|
-
let l = (e) => e, u = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new WeakMap(), f;
|
|
619
|
-
function p(e, t) {
|
|
620
|
-
return f ||= c(), f(e, t);
|
|
621
|
-
}
|
|
622
|
-
function m() {
|
|
623
|
-
return f ||= c(), f.getInitialState();
|
|
624
|
-
}
|
|
625
|
-
function h(t, n = !1) {
|
|
626
|
-
function r(e) {
|
|
627
|
-
let i = e[t];
|
|
628
|
-
if (i === void 0) {
|
|
629
|
-
if (n) i = K(d, r, m);
|
|
630
|
-
else if (process.env.NODE_ENV !== "production") throw Error(process.env.NODE_ENV === "production" ? J(15) : "selectSlice returned undefined for an uninjected slice reducer");
|
|
631
|
-
}
|
|
632
|
-
return i;
|
|
633
|
-
}
|
|
634
|
-
function i(t = l) {
|
|
635
|
-
return K(K(u, n, () => /* @__PURE__ */ new WeakMap()), t, () => {
|
|
636
|
-
let r = {};
|
|
637
|
-
for (let [i, a] of Object.entries(e.selectors ?? {})) r[i] = Ue(a, t, () => K(d, t, m), n);
|
|
638
|
-
return r;
|
|
639
|
-
});
|
|
640
|
-
}
|
|
641
|
-
return {
|
|
642
|
-
reducerPath: t,
|
|
643
|
-
getSelectors: i,
|
|
644
|
-
get selectors() {
|
|
645
|
-
return i(r);
|
|
646
|
-
},
|
|
647
|
-
selectSlice: r
|
|
648
|
-
};
|
|
649
|
-
}
|
|
650
|
-
let g = {
|
|
651
|
-
name: n,
|
|
652
|
-
reducer: p,
|
|
653
|
-
actions: o.actionCreators,
|
|
654
|
-
caseReducers: o.sliceCaseReducersByName,
|
|
655
|
-
getInitialState: m,
|
|
656
|
-
...h(r),
|
|
657
|
-
injectInto(e, { reducerPath: t, ...n } = {}) {
|
|
658
|
-
let i = t ?? r;
|
|
659
|
-
return e.inject({
|
|
660
|
-
reducerPath: i,
|
|
661
|
-
reducer: p
|
|
662
|
-
}, n), {
|
|
663
|
-
...g,
|
|
664
|
-
...h(i, !0)
|
|
665
|
-
};
|
|
666
|
-
}
|
|
667
|
-
};
|
|
668
|
-
return g;
|
|
669
|
-
};
|
|
670
|
-
}
|
|
671
|
-
function Ue(e, t, n, r) {
|
|
672
|
-
function i(i, ...a) {
|
|
673
|
-
let o = t(i);
|
|
674
|
-
if (o === void 0) {
|
|
675
|
-
if (r) o = n();
|
|
676
|
-
else if (process.env.NODE_ENV !== "production") throw Error(process.env.NODE_ENV === "production" ? J(16) : "selectState returned undefined for an uninjected slice reducer");
|
|
677
|
-
}
|
|
678
|
-
return e(o, ...a);
|
|
679
|
-
}
|
|
680
|
-
return i.unwrapped = e, i;
|
|
681
|
-
}
|
|
682
|
-
var We = /* @__PURE__ */ He();
|
|
683
|
-
function Ge() {
|
|
684
|
-
function e(e, t) {
|
|
685
|
-
return {
|
|
686
|
-
_reducerDefinitionType: "asyncThunk",
|
|
687
|
-
payloadCreator: e,
|
|
688
|
-
...t
|
|
689
|
-
};
|
|
690
|
-
}
|
|
691
|
-
return e.withTypes = () => e, {
|
|
692
|
-
reducer(e) {
|
|
693
|
-
return Object.assign({ [e.name](...t) {
|
|
694
|
-
return e(...t);
|
|
695
|
-
} }[e.name], { _reducerDefinitionType: "reducer" });
|
|
696
|
-
},
|
|
697
|
-
preparedReducer(e, t) {
|
|
698
|
-
return {
|
|
699
|
-
_reducerDefinitionType: "reducerWithPrepare",
|
|
700
|
-
prepare: e,
|
|
701
|
-
reducer: t
|
|
702
|
-
};
|
|
703
|
-
},
|
|
704
|
-
asyncThunk: e
|
|
705
|
-
};
|
|
706
|
-
}
|
|
707
|
-
function Ke({ type: e, reducerName: t, createNotation: n }, r, i) {
|
|
708
|
-
let a, o;
|
|
709
|
-
if ("reducer" in r) {
|
|
710
|
-
if (n && !Je(r)) throw Error(process.env.NODE_ENV === "production" ? J(17) : "Please use the `create.preparedReducer` notation for prepared action creators with the `create` notation.");
|
|
711
|
-
a = r.reducer, o = r.prepare;
|
|
712
|
-
} else a = r;
|
|
713
|
-
i.addCase(e, a).exposeCaseReducer(t, a).exposeAction(t, o ? G(e, o) : G(e));
|
|
714
|
-
}
|
|
715
|
-
function qe(e) {
|
|
716
|
-
return e._reducerDefinitionType === "asyncThunk";
|
|
717
|
-
}
|
|
718
|
-
function Je(e) {
|
|
719
|
-
return e._reducerDefinitionType === "reducerWithPrepare";
|
|
720
|
-
}
|
|
721
|
-
function Ye({ type: e, reducerName: t }, n, r, i) {
|
|
722
|
-
if (!i) throw Error(process.env.NODE_ENV === "production" ? J(18) : "Cannot use `create.asyncThunk` in the built-in `createSlice`. Use `buildCreateSlice({ creators: { asyncThunk: asyncThunkCreator } })` to create a customised version of `createSlice`.");
|
|
723
|
-
let { payloadCreator: a, fulfilled: o, pending: s, rejected: c, settled: l, options: u } = n, d = i(e, a, u);
|
|
724
|
-
r.exposeAction(t, d), o && r.addCase(d.fulfilled, o), s && r.addCase(d.pending, s), c && r.addCase(d.rejected, c), l && r.addMatcher(d.settled, l), r.exposeCaseReducer(t, {
|
|
725
|
-
fulfilled: o || q,
|
|
726
|
-
pending: s || q,
|
|
727
|
-
rejected: c || q,
|
|
728
|
-
settled: l || q
|
|
729
|
-
});
|
|
730
|
-
}
|
|
731
|
-
function q() {}
|
|
732
|
-
var Xe = "listener", Ze = "completed", Qe = "cancelled";
|
|
733
|
-
`${Qe}`, `${Ze}`, `${Xe}${Qe}`, `${Xe}${Ze}`;
|
|
734
|
-
var { assign: $e } = Object, et = "listenerMiddleware", tt = /* @__PURE__ */ $e(/* @__PURE__ */ G(`${et}/add`), { withTypes: () => tt });
|
|
735
|
-
`${et}`;
|
|
736
|
-
var nt = /* @__PURE__ */ $e(/* @__PURE__ */ G(`${et}/remove`), { withTypes: () => nt });
|
|
737
|
-
function J(e) {
|
|
738
|
-
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. `;
|
|
739
|
-
}
|
|
740
|
-
//#endregion
|
|
741
|
-
//#region src/auth/authSlice.ts
|
|
742
|
-
var rt = () => {
|
|
743
|
-
let e = localStorage.getItem(t.AuthCheckStorageItemName) === "true", n = localStorage.getItem(t.LoggedInUserStorageItemName), r = localStorage.getItem(t.SettingStorageItemName);
|
|
10
|
+
}, r = () => {
|
|
11
|
+
let e = localStorage.getItem(n.AuthCheckStorageItemName) === "true", t = localStorage.getItem(n.LoggedInUserStorageItemName), r = localStorage.getItem(n.SettingStorageItemName);
|
|
744
12
|
return {
|
|
745
13
|
isAuthenticated: e,
|
|
746
|
-
loggedInUser:
|
|
14
|
+
loggedInUser: t ? JSON.parse(t) : void 0,
|
|
747
15
|
setting: r ? JSON.parse(r) : void 0
|
|
748
16
|
};
|
|
749
|
-
},
|
|
17
|
+
}, i = () => e({
|
|
750
18
|
name: "auth",
|
|
751
|
-
initialState:
|
|
19
|
+
initialState: r(),
|
|
752
20
|
reducers: {
|
|
753
|
-
login: (e,
|
|
754
|
-
e.isAuthenticated = !0, localStorage.setItem(
|
|
21
|
+
login: (e, t) => {
|
|
22
|
+
e.isAuthenticated = !0, localStorage.setItem(n.AuthCheckStorageItemName, "true"), t.payload && (e.loggedInUser = t.payload.user, localStorage.setItem(n.LoggedInUserStorageItemName, JSON.stringify(t.payload.user)), e.setting = t.payload.setting, localStorage.setItem(n.SettingStorageItemName, JSON.stringify(t.payload.setting)));
|
|
755
23
|
},
|
|
756
24
|
logout: (e) => {
|
|
757
|
-
e.isAuthenticated = !1, e.loggedInUser = void 0, e.setting = void 0, localStorage.removeItem(
|
|
25
|
+
e.isAuthenticated = !1, e.loggedInUser = void 0, e.setting = void 0, localStorage.removeItem(n.AuthCheckStorageItemName), localStorage.removeItem(n.LoggedInUserStorageItemName), localStorage.removeItem(n.SettingStorageItemName);
|
|
758
26
|
},
|
|
759
|
-
updateLoggedInUser: (e,
|
|
27
|
+
updateLoggedInUser: (e, t) => {
|
|
760
28
|
e.loggedInUser = {
|
|
761
29
|
...e.loggedInUser,
|
|
762
|
-
...
|
|
763
|
-
}, localStorage.setItem(
|
|
30
|
+
...t.payload
|
|
31
|
+
}, localStorage.setItem(n.LoggedInUserStorageItemName, JSON.stringify(e.loggedInUser));
|
|
764
32
|
},
|
|
765
|
-
updateSetting: (e,
|
|
33
|
+
updateSetting: (e, t) => {
|
|
766
34
|
e.setting = {
|
|
767
35
|
...e.setting,
|
|
768
|
-
...
|
|
769
|
-
}, localStorage.setItem(
|
|
36
|
+
...t.payload
|
|
37
|
+
}, localStorage.setItem(n.SettingStorageItemName, JSON.stringify(e.setting));
|
|
770
38
|
},
|
|
771
39
|
syncFromStorage: (e) => {
|
|
772
|
-
e.isAuthenticated = localStorage.getItem(
|
|
773
|
-
let
|
|
774
|
-
e.loggedInUser =
|
|
775
|
-
let r = localStorage.getItem(
|
|
40
|
+
e.isAuthenticated = localStorage.getItem(n.AuthCheckStorageItemName) === "true";
|
|
41
|
+
let t = localStorage.getItem(n.LoggedInUserStorageItemName);
|
|
42
|
+
e.loggedInUser = t ? JSON.parse(t) : void 0;
|
|
43
|
+
let r = localStorage.getItem(n.SettingStorageItemName);
|
|
776
44
|
e.setting = r ? JSON.parse(r) : void 0;
|
|
777
45
|
}
|
|
778
46
|
}
|
|
779
|
-
}),
|
|
47
|
+
}), a = class e {
|
|
780
48
|
static Format(e, t) {
|
|
781
49
|
return `${e}:${t}`;
|
|
782
50
|
}
|
|
@@ -797,32 +65,32 @@ var rt = () => {
|
|
|
797
65
|
let [t] = e[0].split(":");
|
|
798
66
|
return `/${t.toLowerCase()}`;
|
|
799
67
|
}
|
|
800
|
-
},
|
|
68
|
+
}, o = class {
|
|
801
69
|
id;
|
|
802
|
-
},
|
|
70
|
+
}, s = class extends o {
|
|
803
71
|
name;
|
|
804
72
|
countryId;
|
|
805
73
|
country;
|
|
806
74
|
constructor(e) {
|
|
807
75
|
super(), Object.assign(this, e);
|
|
808
76
|
}
|
|
809
|
-
},
|
|
77
|
+
}, c = class {
|
|
810
78
|
static columnsNames = [{
|
|
811
79
|
label: "اسم المدينة",
|
|
812
80
|
value: "Name"
|
|
813
81
|
}];
|
|
814
|
-
},
|
|
82
|
+
}, l = class extends o {
|
|
815
83
|
name;
|
|
816
84
|
code;
|
|
817
85
|
constructor(e) {
|
|
818
86
|
super(), Object.assign(this, e);
|
|
819
87
|
}
|
|
820
|
-
},
|
|
88
|
+
}, u = class {
|
|
821
89
|
static columnsNames = [{
|
|
822
90
|
label: "اسم الدولة",
|
|
823
91
|
value: "Name"
|
|
824
92
|
}];
|
|
825
|
-
},
|
|
93
|
+
}, d = class extends o {
|
|
826
94
|
name;
|
|
827
95
|
code;
|
|
828
96
|
isFeminine;
|
|
@@ -833,33 +101,33 @@ var rt = () => {
|
|
|
833
101
|
constructor(e) {
|
|
834
102
|
super(), Object.assign(this, e);
|
|
835
103
|
}
|
|
836
|
-
},
|
|
104
|
+
}, f = class {
|
|
837
105
|
value;
|
|
838
106
|
columnName;
|
|
839
107
|
constructor(e) {
|
|
840
108
|
Object.assign(this, e);
|
|
841
109
|
}
|
|
842
|
-
},
|
|
110
|
+
}, p = class {
|
|
843
111
|
companyEmail;
|
|
844
112
|
username;
|
|
845
113
|
password;
|
|
846
114
|
constructor(e) {
|
|
847
115
|
Object.assign(this, e);
|
|
848
116
|
}
|
|
849
|
-
},
|
|
117
|
+
}, m = class {
|
|
850
118
|
url = null;
|
|
851
119
|
base64File = null;
|
|
852
120
|
extension = null;
|
|
853
121
|
contentType = null;
|
|
854
|
-
status =
|
|
122
|
+
status = h.Unchanged;
|
|
855
123
|
constructor(e) {
|
|
856
124
|
Object.assign(this, e);
|
|
857
125
|
}
|
|
858
|
-
},
|
|
126
|
+
}, h = {
|
|
859
127
|
Unchanged: 0,
|
|
860
128
|
New: 1,
|
|
861
129
|
Delete: 2
|
|
862
|
-
},
|
|
130
|
+
}, g = class {
|
|
863
131
|
static _baseUrl = "";
|
|
864
132
|
static get baseUrl() {
|
|
865
133
|
return this._baseUrl || console.warn("YusrCore: baseUrl has not been initialized. Defaults to empty string."), this._baseUrl;
|
|
@@ -870,13 +138,13 @@ var rt = () => {
|
|
|
870
138
|
};
|
|
871
139
|
//#endregion
|
|
872
140
|
//#region ../../node_modules/sonner/dist/index.mjs
|
|
873
|
-
function
|
|
141
|
+
function _(e) {
|
|
874
142
|
if (!e || typeof document > "u") return;
|
|
875
143
|
let t = document.head || document.getElementsByTagName("head")[0], n = document.createElement("style");
|
|
876
144
|
n.type = "text/css", t.appendChild(n), n.styleSheet ? n.styleSheet.cssText = e : n.appendChild(document.createTextNode(e));
|
|
877
145
|
}
|
|
878
146
|
Array(12).fill(0);
|
|
879
|
-
var
|
|
147
|
+
var v = 1, y = new class {
|
|
880
148
|
constructor() {
|
|
881
149
|
this.subscribe = (e) => (this.subscribers.push(e), () => {
|
|
882
150
|
let t = this.subscribers.indexOf(e);
|
|
@@ -886,7 +154,7 @@ var gt = 1, Z = new class {
|
|
|
886
154
|
}, this.addToast = (e) => {
|
|
887
155
|
this.publish(e), this.toasts = [...this.toasts, e];
|
|
888
156
|
}, this.create = (e) => {
|
|
889
|
-
let { message: t, ...n } = e, r = typeof e?.id == "number" || e.id?.length > 0 ? e.id :
|
|
157
|
+
let { message: t, ...n } = e, r = typeof e?.id == "number" || e.id?.length > 0 ? e.id : v++, i = this.toasts.find((e) => e.id === r), a = e.dismissible === void 0 ? !0 : e.dismissible;
|
|
890
158
|
return this.dismissedToasts.has(r) && this.dismissedToasts.delete(r), i ? this.toasts = this.toasts.map((n) => n.id === r ? (this.publish({
|
|
891
159
|
...n,
|
|
892
160
|
...e,
|
|
@@ -935,34 +203,34 @@ var gt = 1, Z = new class {
|
|
|
935
203
|
...t,
|
|
936
204
|
type: "loading",
|
|
937
205
|
message: e
|
|
938
|
-
}), this.promise = (
|
|
206
|
+
}), this.promise = (e, n) => {
|
|
939
207
|
if (!n) return;
|
|
940
208
|
let r;
|
|
941
209
|
n.loading !== void 0 && (r = this.create({
|
|
942
210
|
...n,
|
|
943
|
-
promise:
|
|
211
|
+
promise: e,
|
|
944
212
|
type: "loading",
|
|
945
213
|
message: n.loading,
|
|
946
214
|
description: typeof n.description == "function" ? void 0 : n.description
|
|
947
215
|
}));
|
|
948
|
-
let i = Promise.resolve(
|
|
949
|
-
if (o = ["resolve",
|
|
216
|
+
let i = Promise.resolve(e instanceof Function ? e() : e), a = r !== void 0, o, s = i.then(async (e) => {
|
|
217
|
+
if (o = ["resolve", e], t.isValidElement(e)) a = !1, this.create({
|
|
950
218
|
id: r,
|
|
951
219
|
type: "default",
|
|
952
|
-
message:
|
|
220
|
+
message: e
|
|
953
221
|
});
|
|
954
|
-
else if (
|
|
222
|
+
else if (x(e) && !e.ok) {
|
|
955
223
|
a = !1;
|
|
956
|
-
let i = typeof n.error == "function" ? await n.error(`HTTP error! status: ${
|
|
224
|
+
let i = typeof n.error == "function" ? await n.error(`HTTP error! status: ${e.status}`) : n.error, o = typeof n.description == "function" ? await n.description(`HTTP error! status: ${e.status}`) : n.description, s = typeof i == "object" && !t.isValidElement(i) ? i : { message: i };
|
|
957
225
|
this.create({
|
|
958
226
|
id: r,
|
|
959
227
|
type: "error",
|
|
960
228
|
description: o,
|
|
961
229
|
...s
|
|
962
230
|
});
|
|
963
|
-
} else if (
|
|
231
|
+
} else if (e instanceof Error) {
|
|
964
232
|
a = !1;
|
|
965
|
-
let i = typeof n.error == "function" ? await n.error(
|
|
233
|
+
let i = typeof n.error == "function" ? await n.error(e) : n.error, o = typeof n.description == "function" ? await n.description(e) : n.description, s = typeof i == "object" && !t.isValidElement(i) ? i : { message: i };
|
|
966
234
|
this.create({
|
|
967
235
|
id: r,
|
|
968
236
|
type: "error",
|
|
@@ -971,7 +239,7 @@ var gt = 1, Z = new class {
|
|
|
971
239
|
});
|
|
972
240
|
} else if (n.success !== void 0) {
|
|
973
241
|
a = !1;
|
|
974
|
-
let i = typeof n.success == "function" ? await n.success(
|
|
242
|
+
let i = typeof n.success == "function" ? await n.success(e) : n.success, o = typeof n.description == "function" ? await n.description(e) : n.description, s = typeof i == "object" && !t.isValidElement(i) ? i : { message: i };
|
|
975
243
|
this.create({
|
|
976
244
|
id: r,
|
|
977
245
|
type: "success",
|
|
@@ -979,10 +247,10 @@ var gt = 1, Z = new class {
|
|
|
979
247
|
...s
|
|
980
248
|
});
|
|
981
249
|
}
|
|
982
|
-
}).catch(async (
|
|
983
|
-
if (o = ["reject",
|
|
250
|
+
}).catch(async (e) => {
|
|
251
|
+
if (o = ["reject", e], n.error !== void 0) {
|
|
984
252
|
a = !1;
|
|
985
|
-
let i = typeof n.error == "function" ? await n.error(
|
|
253
|
+
let i = typeof n.error == "function" ? await n.error(e) : n.error, o = typeof n.description == "function" ? await n.description(e) : n.description, s = typeof i == "object" && !t.isValidElement(i) ? i : { message: i };
|
|
986
254
|
this.create({
|
|
987
255
|
id: r,
|
|
988
256
|
type: "error",
|
|
@@ -995,7 +263,7 @@ var gt = 1, Z = new class {
|
|
|
995
263
|
}), c = () => new Promise((e, t) => s.then(() => o[0] === "reject" ? t(o[1]) : e(o[1])).catch(t));
|
|
996
264
|
return typeof r != "string" && typeof r != "number" ? { unwrap: c } : Object.assign(r, { unwrap: c });
|
|
997
265
|
}, this.custom = (e, t) => {
|
|
998
|
-
let n = t?.id ||
|
|
266
|
+
let n = t?.id || v++;
|
|
999
267
|
return this.create({
|
|
1000
268
|
jsx: e(n),
|
|
1001
269
|
id: n,
|
|
@@ -1003,31 +271,31 @@ var gt = 1, Z = new class {
|
|
|
1003
271
|
}), n;
|
|
1004
272
|
}, this.getActiveToasts = () => this.toasts.filter((e) => !this.dismissedToasts.has(e.id)), this.subscribers = [], this.toasts = [], this.dismissedToasts = /* @__PURE__ */ new Set();
|
|
1005
273
|
}
|
|
1006
|
-
}(),
|
|
1007
|
-
let n = t?.id ||
|
|
1008
|
-
return
|
|
274
|
+
}(), b = (e, t) => {
|
|
275
|
+
let n = t?.id || v++;
|
|
276
|
+
return y.addToast({
|
|
1009
277
|
title: e,
|
|
1010
278
|
...t,
|
|
1011
279
|
id: n
|
|
1012
280
|
}), n;
|
|
1013
|
-
},
|
|
1014
|
-
success:
|
|
1015
|
-
info:
|
|
1016
|
-
warning:
|
|
1017
|
-
error:
|
|
1018
|
-
custom:
|
|
1019
|
-
message:
|
|
1020
|
-
promise:
|
|
1021
|
-
dismiss:
|
|
1022
|
-
loading:
|
|
281
|
+
}, x = (e) => e && typeof e == "object" && "ok" in e && typeof e.ok == "boolean" && "status" in e && typeof e.status == "number", S = Object.assign(b, {
|
|
282
|
+
success: y.success,
|
|
283
|
+
info: y.info,
|
|
284
|
+
warning: y.warning,
|
|
285
|
+
error: y.error,
|
|
286
|
+
custom: y.custom,
|
|
287
|
+
message: y.message,
|
|
288
|
+
promise: y.promise,
|
|
289
|
+
dismiss: y.dismiss,
|
|
290
|
+
loading: y.loading
|
|
1023
291
|
}, {
|
|
1024
|
-
getHistory: () =>
|
|
1025
|
-
getToasts: () =>
|
|
292
|
+
getHistory: () => y.toasts,
|
|
293
|
+
getToasts: () => y.getActiveToasts()
|
|
1026
294
|
});
|
|
1027
|
-
ht("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");
|
|
295
|
+
_("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");
|
|
1028
296
|
//#endregion
|
|
1029
297
|
//#region src/networking/services/yusrApiHelper.ts
|
|
1030
|
-
var
|
|
298
|
+
var C = class e {
|
|
1031
299
|
static async Get(t, n) {
|
|
1032
300
|
let r = await fetch(t, {
|
|
1033
301
|
method: "GET",
|
|
@@ -1083,19 +351,19 @@ var $ = class e {
|
|
|
1083
351
|
});
|
|
1084
352
|
if (!a.ok) {
|
|
1085
353
|
let e = await a.json();
|
|
1086
|
-
|
|
354
|
+
S.error(e.title || "حدث خطأ أثناء تحميل التقرير", { description: e.detail || "يرجى المحاولة مرة أخرى لاحقاً" });
|
|
1087
355
|
return;
|
|
1088
356
|
}
|
|
1089
357
|
return await a.blob();
|
|
1090
358
|
}
|
|
1091
|
-
static async handleResponse(e,
|
|
1092
|
-
if (e.status === 401) return window.dispatchEvent(new Event(
|
|
359
|
+
static async handleResponse(e, t) {
|
|
360
|
+
if (e.status === 401) return window.dispatchEvent(new Event(n.UnauthorizedEventName)), S.error("انتهت صلاحية الدخول", { description: "سجل الدخول مجددًا." }), {
|
|
1093
361
|
data: void 0,
|
|
1094
362
|
status: 401,
|
|
1095
363
|
errorTitle: "Unauthorized",
|
|
1096
364
|
errorDetails: "Session expired"
|
|
1097
365
|
};
|
|
1098
|
-
if (e.status === 404) return
|
|
366
|
+
if (e.status === 404) return S.error("لم يتم العثور على طلبك"), {
|
|
1099
367
|
data: void 0,
|
|
1100
368
|
status: 404,
|
|
1101
369
|
errorTitle: "Not Found",
|
|
@@ -1103,7 +371,7 @@ var $ = class e {
|
|
|
1103
371
|
};
|
|
1104
372
|
if (!e.ok) {
|
|
1105
373
|
let t = await e.json();
|
|
1106
|
-
return
|
|
374
|
+
return S.error(t.title || "An error occurred", { description: t.detail }), {
|
|
1107
375
|
data: void 0,
|
|
1108
376
|
status: e.status,
|
|
1109
377
|
errorTitle: t.title,
|
|
@@ -1111,31 +379,31 @@ var $ = class e {
|
|
|
1111
379
|
};
|
|
1112
380
|
}
|
|
1113
381
|
let r = await e.json();
|
|
1114
|
-
return
|
|
382
|
+
return t && S.success(t), {
|
|
1115
383
|
data: r,
|
|
1116
384
|
status: e.status,
|
|
1117
385
|
errorTitle: "",
|
|
1118
386
|
errorDetails: ""
|
|
1119
387
|
};
|
|
1120
388
|
}
|
|
1121
|
-
},
|
|
389
|
+
}, w = class {
|
|
1122
390
|
async Filter(e, t, n) {
|
|
1123
|
-
return await
|
|
391
|
+
return await C.Post(`${g.baseUrl}/${this.routeName}/Filter?pageNumber=${e}&rowsPerPage=${t}`, n);
|
|
1124
392
|
}
|
|
1125
|
-
},
|
|
393
|
+
}, T = class extends w {
|
|
1126
394
|
async Get(e) {
|
|
1127
|
-
return await
|
|
395
|
+
return await C.Get(`${g.baseUrl}/${this.routeName}/${e}`);
|
|
1128
396
|
}
|
|
1129
397
|
async Add(e) {
|
|
1130
|
-
return await
|
|
398
|
+
return await C.Post(`${g.baseUrl}/${this.routeName}/Add`, e, void 0, "تم حفظ البيانات بنجاح");
|
|
1131
399
|
}
|
|
1132
400
|
async Update(e) {
|
|
1133
|
-
return await
|
|
401
|
+
return await C.Put(`${g.baseUrl}/${this.routeName}/Update`, e, void 0, "تم تحديث المعلومات بنجاح");
|
|
1134
402
|
}
|
|
1135
403
|
async Delete(e) {
|
|
1136
|
-
return await
|
|
404
|
+
return await C.Delete(`${g.baseUrl}/${this.routeName}/${e}`, void 0, "تمت إزالة السجل بنجاح");
|
|
1137
405
|
}
|
|
1138
|
-
},
|
|
406
|
+
}, E = class {
|
|
1139
407
|
static required(e = "هذا الحقل مطلوب") {
|
|
1140
408
|
return (t) => t == null || t === "" || typeof t == "string" && t.trim() === "" ? e : null;
|
|
1141
409
|
}
|
|
@@ -1153,4 +421,4 @@ var $ = class e {
|
|
|
1153
421
|
}
|
|
1154
422
|
};
|
|
1155
423
|
//#endregion
|
|
1156
|
-
export {
|
|
424
|
+
export { g as ApiConstants, n as AuthConstants, T as BaseApiService, o as BaseEntity, w as BaseFilterableApiService, s as City, c as CityFilterColumns, l as Country, u as CountryFilterColumns, d as Currency, f as FilterCondition, p as LoginRequest, m as StorageFile, h as StorageFileStatus, a as SystemPermissions, E as Validators, C as YusrApiHelper, i as createAuthSlice };
|
package/package.json
CHANGED
|
@@ -1,29 +1,33 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@yusr_systems/core",
|
|
3
|
-
"version": "2.2.
|
|
4
|
-
"
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"main": "./dist/yusr-core.js",
|
|
11
|
-
"module": "./dist/yusr-core.js",
|
|
12
|
-
"types": "./dist/index.d.ts",
|
|
13
|
-
"exports": {
|
|
14
|
-
".": {
|
|
15
|
-
"types": "./dist/index.d.ts",
|
|
16
|
-
"import": "./dist/yusr-core.js"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@yusr_systems/core",
|
|
3
|
+
"version": "2.2.3",
|
|
4
|
+
"private": false,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"publishConfig": {
|
|
7
|
+
"access": "public",
|
|
8
|
+
"registry": "https://registry.npmjs.org/"
|
|
9
|
+
},
|
|
10
|
+
"main": "./dist/yusr-core.js",
|
|
11
|
+
"module": "./dist/yusr-core.js",
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"import": "./dist/yusr-core.js",
|
|
17
|
+
"default": "./dist/yusr-core.js"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"dist"
|
|
22
|
+
],
|
|
23
|
+
"scripts": {
|
|
24
|
+
"dev": "vite",
|
|
25
|
+
"build": "tsc --noEmit && vite build",
|
|
26
|
+
"preview": "vite preview"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"typescript": "~5.9.3",
|
|
30
|
+
"vite": "^8.0.0",
|
|
31
|
+
"vite-plugin-dts": "^4.0.0"
|
|
32
|
+
}
|
|
33
|
+
}
|