react-toolkits 0.4.4 → 0.5.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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # react-toolkits
2
2
 
3
+ ## 0.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - dc3a327: build: replace tsup with vite
8
+
9
+ ## 0.4.5
10
+
11
+ ### Patch Changes
12
+
13
+ - 9e342fd: feat: override default styles
14
+
3
15
  ## 0.4.4
4
16
 
5
17
  ### Patch Changes
package/README.md CHANGED
@@ -20,7 +20,7 @@ const root = createRoot(container)
20
20
  const items: NavMenuItem[] = []
21
21
 
22
22
  root.render(
23
- <ReactToolkitsProvider title="React Web" menuItems={items}>
23
+ <ContextProvider title="React Web" menuItems={items}>
24
24
  <RouterProvider
25
25
  router={router}
26
26
  fallbackElement={
@@ -35,7 +35,7 @@ root.render(
35
35
  />
36
36
  }
37
37
  />
38
- </ReactToolkitsProvider>,
38
+ </ContextProvider>,
39
39
  )
40
40
 
41
41
  ```
@@ -0,0 +1,459 @@
1
+ var K = Symbol.for("immer-nothing"), j = Symbol.for("immer-draftable"), u = Symbol.for("immer-state"), Q = process.env.NODE_ENV !== "production" ? [
2
+ // All error codes, starting by 0:
3
+ function(e) {
4
+ return `The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`;
5
+ },
6
+ function(e) {
7
+ 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}'`;
8
+ },
9
+ "This object has been frozen and should not be mutated",
10
+ function(e) {
11
+ return "Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? " + e;
12
+ },
13
+ "An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.",
14
+ "Immer forbids circular references",
15
+ "The first or second argument to `produce` must be a function",
16
+ "The third argument to `produce` must be a function or undefined",
17
+ "First argument to `createDraft` must be a plain object, an array, or an immerable object",
18
+ "First argument to `finishDraft` must be a draft returned by `createDraft`",
19
+ function(e) {
20
+ return `'current' expects a draft, got: ${e}`;
21
+ },
22
+ "Object.defineProperty() cannot be used on an Immer draft",
23
+ "Object.setPrototypeOf() cannot be used on an Immer draft",
24
+ "Immer only supports deleting array indices",
25
+ "Immer only supports setting array indices and the 'length' property",
26
+ function(e) {
27
+ return `'original' expects a draft, got: ${e}`;
28
+ }
29
+ // Note: if more errors are added, the errorOffset in Patches.ts should be increased
30
+ // See Patches.ts for additional errors
31
+ ] : [];
32
+ function s(e, ...t) {
33
+ if (process.env.NODE_ENV !== "production") {
34
+ const r = Q[e], n = typeof r == "function" ? r.apply(null, t) : r;
35
+ throw new Error(`[Immer] ${n}`);
36
+ }
37
+ throw new Error(
38
+ `[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`
39
+ );
40
+ }
41
+ var p = Object.getPrototypeOf;
42
+ function h(e) {
43
+ return !!e && !!e[u];
44
+ }
45
+ function _(e) {
46
+ var t;
47
+ return e ? U(e) || Array.isArray(e) || !!e[j] || !!((t = e.constructor) != null && t[j]) || O(e) || D(e) : !1;
48
+ }
49
+ var Y = Object.prototype.constructor.toString();
50
+ function U(e) {
51
+ if (!e || typeof e != "object")
52
+ return !1;
53
+ const t = p(e);
54
+ if (t === null)
55
+ return !0;
56
+ const r = Object.hasOwnProperty.call(t, "constructor") && t.constructor;
57
+ return r === Object ? !0 : typeof r == "function" && Function.toString.call(r) === Y;
58
+ }
59
+ function m(e, t) {
60
+ z(e) === 0 ? Object.entries(e).forEach(([r, n]) => {
61
+ t(r, n, e);
62
+ }) : e.forEach((r, n) => t(n, r, e));
63
+ }
64
+ function z(e) {
65
+ const t = e[u];
66
+ return t ? t.type_ : Array.isArray(e) ? 1 : O(e) ? 2 : D(e) ? 3 : 0;
67
+ }
68
+ function N(e, t) {
69
+ return z(e) === 2 ? e.has(t) : Object.prototype.hasOwnProperty.call(e, t);
70
+ }
71
+ function B(e, t, r) {
72
+ const n = z(e);
73
+ n === 2 ? e.set(t, r) : n === 3 ? e.add(r) : e[t] = r;
74
+ }
75
+ function Z(e, t) {
76
+ return e === t ? e !== 0 || 1 / e === 1 / t : e !== e && t !== t;
77
+ }
78
+ function O(e) {
79
+ return e instanceof Map;
80
+ }
81
+ function D(e) {
82
+ return e instanceof Set;
83
+ }
84
+ function d(e) {
85
+ return e.copy_ || e.base_;
86
+ }
87
+ function v(e, t) {
88
+ if (O(e))
89
+ return new Map(e);
90
+ if (D(e))
91
+ return new Set(e);
92
+ if (Array.isArray(e))
93
+ return Array.prototype.slice.call(e);
94
+ if (!t && U(e))
95
+ return p(e) ? { ...e } : Object.assign(/* @__PURE__ */ Object.create(null), e);
96
+ const r = Object.getOwnPropertyDescriptors(e);
97
+ delete r[u];
98
+ let n = Reflect.ownKeys(r);
99
+ for (let i = 0; i < n.length; i++) {
100
+ const o = n[i], c = r[o];
101
+ c.writable === !1 && (c.writable = !0, c.configurable = !0), (c.get || c.set) && (r[o] = {
102
+ configurable: !0,
103
+ writable: !0,
104
+ // could live with !!desc.set as well here...
105
+ enumerable: c.enumerable,
106
+ value: e[o]
107
+ });
108
+ }
109
+ return Object.create(p(e), r);
110
+ }
111
+ function T(e, t = !1) {
112
+ return S(e) || h(e) || !_(e) || (z(e) > 1 && (e.set = e.add = e.clear = e.delete = L), Object.freeze(e), t && m(e, (r, n) => T(n, !0))), e;
113
+ }
114
+ function L() {
115
+ s(2);
116
+ }
117
+ function S(e) {
118
+ return Object.isFrozen(e);
119
+ }
120
+ var V = {};
121
+ function y(e) {
122
+ const t = V[e];
123
+ return t || s(0, e), t;
124
+ }
125
+ var P;
126
+ function G() {
127
+ return P;
128
+ }
129
+ function ee(e, t) {
130
+ return {
131
+ drafts_: [],
132
+ parent_: e,
133
+ immer_: t,
134
+ // Whenever the modified draft contains a draft from another scope, we
135
+ // need to prevent auto-freezing so the unowned draft can be finalized.
136
+ canAutoFreeze_: !0,
137
+ unfinalizedDrafts_: 0
138
+ };
139
+ }
140
+ function R(e, t) {
141
+ t && (y("Patches"), e.patches_ = [], e.inversePatches_ = [], e.patchListener_ = t);
142
+ }
143
+ function E(e) {
144
+ C(e), e.drafts_.forEach(te), e.drafts_ = null;
145
+ }
146
+ function C(e) {
147
+ e === P && (P = e.parent_);
148
+ }
149
+ function x(e) {
150
+ return P = ee(P, e);
151
+ }
152
+ function te(e) {
153
+ const t = e[u];
154
+ t.type_ === 0 || t.type_ === 1 ? t.revoke_() : t.revoked_ = !0;
155
+ }
156
+ function $(e, t) {
157
+ t.unfinalizedDrafts_ = t.drafts_.length;
158
+ const r = t.drafts_[0];
159
+ return e !== void 0 && e !== r ? (r[u].modified_ && (E(t), s(4)), _(e) && (e = g(t, e), t.parent_ || w(t, e)), t.patches_ && y("Patches").generateReplacementPatches_(
160
+ r[u].base_,
161
+ e,
162
+ t.patches_,
163
+ t.inversePatches_
164
+ )) : e = g(t, r, []), E(t), t.patches_ && t.patchListener_(t.patches_, t.inversePatches_), e !== K ? e : void 0;
165
+ }
166
+ function g(e, t, r) {
167
+ if (S(t))
168
+ return t;
169
+ const n = t[u];
170
+ if (!n)
171
+ return m(
172
+ t,
173
+ (i, o) => W(e, n, t, i, o, r)
174
+ ), t;
175
+ if (n.scope_ !== e)
176
+ return t;
177
+ if (!n.modified_)
178
+ return w(e, n.base_, !0), n.base_;
179
+ if (!n.finalized_) {
180
+ n.finalized_ = !0, n.scope_.unfinalizedDrafts_--;
181
+ const i = n.copy_;
182
+ let o = i, c = !1;
183
+ n.type_ === 3 && (o = new Set(i), i.clear(), c = !0), m(
184
+ o,
185
+ (f, l) => W(e, n, i, f, l, r, c)
186
+ ), w(e, i, !1), r && e.patches_ && y("Patches").generatePatches_(
187
+ n,
188
+ r,
189
+ e.patches_,
190
+ e.inversePatches_
191
+ );
192
+ }
193
+ return n.copy_;
194
+ }
195
+ function W(e, t, r, n, i, o, c) {
196
+ if (process.env.NODE_ENV !== "production" && i === r && s(5), h(i)) {
197
+ const f = o && t && t.type_ !== 3 && // Set objects are atomic since they have no keys.
198
+ !N(t.assigned_, n) ? o.concat(n) : void 0, l = g(e, i, f);
199
+ if (B(r, n, l), h(l))
200
+ e.canAutoFreeze_ = !1;
201
+ else
202
+ return;
203
+ } else
204
+ c && r.add(i);
205
+ if (_(i) && !S(i)) {
206
+ if (!e.immer_.autoFreeze_ && e.unfinalizedDrafts_ < 1)
207
+ return;
208
+ g(e, i), (!t || !t.scope_.parent_) && w(e, i);
209
+ }
210
+ }
211
+ function w(e, t, r = !1) {
212
+ !e.parent_ && e.immer_.autoFreeze_ && e.canAutoFreeze_ && T(t, r);
213
+ }
214
+ function re(e, t) {
215
+ const r = Array.isArray(e), n = {
216
+ type_: r ? 1 : 0,
217
+ // Track which produce call this is associated with.
218
+ scope_: t ? t.scope_ : G(),
219
+ // True for both shallow and deep changes.
220
+ modified_: !1,
221
+ // Used during finalization.
222
+ finalized_: !1,
223
+ // Track which properties have been assigned (true) or deleted (false).
224
+ assigned_: {},
225
+ // The parent draft state.
226
+ parent_: t,
227
+ // The base state.
228
+ base_: e,
229
+ // The base proxy.
230
+ draft_: null,
231
+ // set below
232
+ // The base copy with any updated values.
233
+ copy_: null,
234
+ // Called by the `produce` function.
235
+ revoke_: null,
236
+ isManual_: !1
237
+ };
238
+ let i = n, o = M;
239
+ r && (i = [n], o = b);
240
+ const { revoke: c, proxy: f } = Proxy.revocable(i, o);
241
+ return n.draft_ = f, n.revoke_ = c, f;
242
+ }
243
+ var M = {
244
+ get(e, t) {
245
+ if (t === u)
246
+ return e;
247
+ const r = d(e);
248
+ if (!N(r, t))
249
+ return ne(e, r, t);
250
+ const n = r[t];
251
+ return e.finalized_ || !_(n) ? n : n === F(e.base_, t) ? (A(e), e.copy_[t] = I(n, e)) : n;
252
+ },
253
+ has(e, t) {
254
+ return t in d(e);
255
+ },
256
+ ownKeys(e) {
257
+ return Reflect.ownKeys(d(e));
258
+ },
259
+ set(e, t, r) {
260
+ const n = H(d(e), t);
261
+ if (n != null && n.set)
262
+ return n.set.call(e.draft_, r), !0;
263
+ if (!e.modified_) {
264
+ const i = F(d(e), t), o = i == null ? void 0 : i[u];
265
+ if (o && o.base_ === r)
266
+ return e.copy_[t] = r, e.assigned_[t] = !1, !0;
267
+ if (Z(r, i) && (r !== void 0 || N(e.base_, t)))
268
+ return !0;
269
+ A(e), k(e);
270
+ }
271
+ return e.copy_[t] === r && // special case: handle new props with value 'undefined'
272
+ (r !== void 0 || t in e.copy_) || // special case: NaN
273
+ Number.isNaN(r) && Number.isNaN(e.copy_[t]) || (e.copy_[t] = r, e.assigned_[t] = !0), !0;
274
+ },
275
+ deleteProperty(e, t) {
276
+ return F(e.base_, t) !== void 0 || t in e.base_ ? (e.assigned_[t] = !1, A(e), k(e)) : delete e.assigned_[t], e.copy_ && delete e.copy_[t], !0;
277
+ },
278
+ // Note: We never coerce `desc.value` into an Immer draft, because we can't make
279
+ // the same guarantee in ES5 mode.
280
+ getOwnPropertyDescriptor(e, t) {
281
+ const r = d(e), n = Reflect.getOwnPropertyDescriptor(r, t);
282
+ return n && {
283
+ writable: !0,
284
+ configurable: e.type_ !== 1 || t !== "length",
285
+ enumerable: n.enumerable,
286
+ value: r[t]
287
+ };
288
+ },
289
+ defineProperty() {
290
+ s(11);
291
+ },
292
+ getPrototypeOf(e) {
293
+ return p(e.base_);
294
+ },
295
+ setPrototypeOf() {
296
+ s(12);
297
+ }
298
+ }, b = {};
299
+ m(M, (e, t) => {
300
+ b[e] = function() {
301
+ return arguments[0] = arguments[0][0], t.apply(this, arguments);
302
+ };
303
+ });
304
+ b.deleteProperty = function(e, t) {
305
+ return process.env.NODE_ENV !== "production" && isNaN(parseInt(t)) && s(13), b.set.call(this, e, t, void 0);
306
+ };
307
+ b.set = function(e, t, r) {
308
+ return process.env.NODE_ENV !== "production" && t !== "length" && isNaN(parseInt(t)) && s(14), M.set.call(this, e[0], t, r, e[0]);
309
+ };
310
+ function F(e, t) {
311
+ const r = e[u];
312
+ return (r ? d(r) : e)[t];
313
+ }
314
+ function ne(e, t, r) {
315
+ var i;
316
+ const n = H(t, r);
317
+ return n ? "value" in n ? n.value : (
318
+ // This is a very special case, if the prop is a getter defined by the
319
+ // prototype, we should invoke it with the draft as context!
320
+ (i = n.get) == null ? void 0 : i.call(e.draft_)
321
+ ) : void 0;
322
+ }
323
+ function H(e, t) {
324
+ if (!(t in e))
325
+ return;
326
+ let r = p(e);
327
+ for (; r; ) {
328
+ const n = Object.getOwnPropertyDescriptor(r, t);
329
+ if (n)
330
+ return n;
331
+ r = p(r);
332
+ }
333
+ }
334
+ function k(e) {
335
+ e.modified_ || (e.modified_ = !0, e.parent_ && k(e.parent_));
336
+ }
337
+ function A(e) {
338
+ e.copy_ || (e.copy_ = v(
339
+ e.base_,
340
+ e.scope_.immer_.useStrictShallowCopy_
341
+ ));
342
+ }
343
+ var ie = class {
344
+ constructor(e) {
345
+ this.autoFreeze_ = !0, this.useStrictShallowCopy_ = !1, this.produce = (t, r, n) => {
346
+ if (typeof t == "function" && typeof r != "function") {
347
+ const o = r;
348
+ r = t;
349
+ const c = this;
350
+ return function(l = o, ...q) {
351
+ return c.produce(l, (J) => r.call(this, J, ...q));
352
+ };
353
+ }
354
+ typeof r != "function" && s(6), n !== void 0 && typeof n != "function" && s(7);
355
+ let i;
356
+ if (_(t)) {
357
+ const o = x(this), c = I(t, void 0);
358
+ let f = !0;
359
+ try {
360
+ i = r(c), f = !1;
361
+ } finally {
362
+ f ? E(o) : C(o);
363
+ }
364
+ return R(o, n), $(i, o);
365
+ } else if (!t || typeof t != "object") {
366
+ if (i = r(t), i === void 0 && (i = t), i === K && (i = void 0), this.autoFreeze_ && T(i, !0), n) {
367
+ const o = [], c = [];
368
+ y("Patches").generateReplacementPatches_(t, i, o, c), n(o, c);
369
+ }
370
+ return i;
371
+ } else
372
+ s(1, t);
373
+ }, this.produceWithPatches = (t, r) => {
374
+ if (typeof t == "function")
375
+ return (c, ...f) => this.produceWithPatches(c, (l) => t(l, ...f));
376
+ let n, i;
377
+ return [this.produce(t, r, (c, f) => {
378
+ n = c, i = f;
379
+ }), n, i];
380
+ }, typeof (e == null ? void 0 : e.autoFreeze) == "boolean" && this.setAutoFreeze(e.autoFreeze), typeof (e == null ? void 0 : e.useStrictShallowCopy) == "boolean" && this.setUseStrictShallowCopy(e.useStrictShallowCopy);
381
+ }
382
+ createDraft(e) {
383
+ _(e) || s(8), h(e) && (e = oe(e));
384
+ const t = x(this), r = I(e, void 0);
385
+ return r[u].isManual_ = !0, C(t), r;
386
+ }
387
+ finishDraft(e, t) {
388
+ const r = e && e[u];
389
+ (!r || !r.isManual_) && s(9);
390
+ const { scope_: n } = r;
391
+ return R(n, t), $(void 0, n);
392
+ }
393
+ /**
394
+ * Pass true to automatically freeze all copies created by Immer.
395
+ *
396
+ * By default, auto-freezing is enabled.
397
+ */
398
+ setAutoFreeze(e) {
399
+ this.autoFreeze_ = e;
400
+ }
401
+ /**
402
+ * Pass true to enable strict shallow copy.
403
+ *
404
+ * By default, immer does not copy the object descriptors such as getter, setter and non-enumrable properties.
405
+ */
406
+ setUseStrictShallowCopy(e) {
407
+ this.useStrictShallowCopy_ = e;
408
+ }
409
+ applyPatches(e, t) {
410
+ let r;
411
+ for (r = t.length - 1; r >= 0; r--) {
412
+ const i = t[r];
413
+ if (i.path.length === 0 && i.op === "replace") {
414
+ e = i.value;
415
+ break;
416
+ }
417
+ }
418
+ r > -1 && (t = t.slice(r + 1));
419
+ const n = y("Patches").applyPatches_;
420
+ return h(e) ? n(e, t) : this.produce(
421
+ e,
422
+ (i) => n(i, t)
423
+ );
424
+ }
425
+ };
426
+ function I(e, t) {
427
+ const r = O(e) ? y("MapSet").proxyMap_(e, t) : D(e) ? y("MapSet").proxySet_(e, t) : re(e, t);
428
+ return (t ? t.scope_ : G()).drafts_.push(r), r;
429
+ }
430
+ function oe(e) {
431
+ return h(e) || s(10, e), X(e);
432
+ }
433
+ function X(e) {
434
+ if (!_(e) || S(e))
435
+ return e;
436
+ const t = e[u];
437
+ let r;
438
+ if (t) {
439
+ if (!t.modified_)
440
+ return t.base_;
441
+ t.finalized_ = !0, r = v(e, t.scope_.immer_.useStrictShallowCopy_);
442
+ } else
443
+ r = v(e, !0);
444
+ return m(r, (n, i) => {
445
+ B(r, n, X(i));
446
+ }), t && (t.finalized_ = !1), r;
447
+ }
448
+ var a = new ie(), ce = a.produce;
449
+ a.produceWithPatches.bind(
450
+ a
451
+ );
452
+ a.setAutoFreeze.bind(a);
453
+ a.setUseStrictShallowCopy.bind(a);
454
+ a.applyPatches.bind(a);
455
+ a.createDraft.bind(a);
456
+ a.finishDraft.bind(a);
457
+ export {
458
+ ce as p
459
+ };
@@ -0,0 +1,212 @@
1
+ import { I as O, w as W, i as h, k as x, s as z, m as N, l as V, U as y, n as U, b as G, r as n, e as K } from "./index-gdaNSPz6.chunk.js";
2
+ import L, { useRef as o, useCallback as w, useState as $ } from "react";
3
+ const P = O ? (e) => {
4
+ e();
5
+ } : L.startTransition, j = (e) => {
6
+ const [, t] = $({}), r = o(!1), i = o(e), d = o({
7
+ data: !1,
8
+ error: !1,
9
+ isValidating: !1
10
+ }), m = w((l) => {
11
+ let a = !1;
12
+ const g = i.current;
13
+ for (const p in l) {
14
+ const s = p;
15
+ g[s] !== l[s] && (g[s] = l[s], d.current[s] && (a = !0));
16
+ }
17
+ a && !r.current && t({});
18
+ }, []);
19
+ return U(() => (r.current = !1, () => {
20
+ r.current = !0;
21
+ })), [
22
+ i,
23
+ d.current,
24
+ m
25
+ ];
26
+ }, q = () => (e, t, r = {}) => {
27
+ const { mutate: i } = x(), d = o(e), m = o(t), l = o(r), a = o(0), [g, p, s] = j({
28
+ data: y,
29
+ error: y,
30
+ isMutating: !1
31
+ }), R = g.current, v = w(
32
+ async (D, T) => {
33
+ const [b, I] = z(d.current);
34
+ if (!m.current)
35
+ throw new Error("Can’t trigger the mutation: missing fetcher.");
36
+ if (!b)
37
+ throw new Error("Can’t trigger the mutation: missing key.");
38
+ const c = N(N({
39
+ populateCache: !1,
40
+ throwOnError: !0
41
+ }, l.current), T), S = V();
42
+ a.current = S, s({
43
+ isMutating: !0
44
+ });
45
+ try {
46
+ const u = await i(
47
+ b,
48
+ m.current(I, {
49
+ arg: D
50
+ }),
51
+ // We must throw the error here so we can catch and update the states.
52
+ N(c, {
53
+ throwOnError: !0
54
+ })
55
+ );
56
+ if (a.current <= S) {
57
+ var M, C;
58
+ P(() => s({
59
+ data: u,
60
+ isMutating: !1,
61
+ error: void 0
62
+ })), (M = (C = c).onSuccess) == null || M.call(C, u, b, c);
63
+ }
64
+ return u;
65
+ } catch (u) {
66
+ if (a.current <= S) {
67
+ var E, A;
68
+ if (P(() => s({
69
+ error: u,
70
+ isMutating: !1
71
+ })), (E = (A = c).onError) == null || E.call(A, u, b, c), c.throwOnError)
72
+ throw u;
73
+ }
74
+ }
75
+ },
76
+ // eslint-disable-next-line react-hooks/exhaustive-deps
77
+ []
78
+ ), k = w(() => {
79
+ a.current = V(), s({
80
+ data: y,
81
+ error: y,
82
+ isMutating: !1
83
+ });
84
+ }, []);
85
+ return U(() => {
86
+ d.current = e, m.current = t, l.current = r;
87
+ }), {
88
+ trigger: v,
89
+ reset: k,
90
+ get data() {
91
+ return p.data = !0, R.data;
92
+ },
93
+ get error() {
94
+ return p.error = !0, R.error;
95
+ },
96
+ get isMutating() {
97
+ return p.isMutating = !0, R.isMutating;
98
+ }
99
+ };
100
+ }, f = W(h, q);
101
+ function B() {
102
+ return h(
103
+ "/api/usystem/user/allPermssions",
104
+ (e) => n(e, { isGlobalNS: !0 }).then((t) => t.data)
105
+ );
106
+ }
107
+ function H() {
108
+ return h(
109
+ "/api/usystem/user/allPermissionsV2",
110
+ (e) => n(e, { isGlobalNS: !0 }).then((t) => t.data)
111
+ );
112
+ }
113
+ function J() {
114
+ const { accessible: e } = K("200005", { isGlobalNS: !0 });
115
+ return h(
116
+ e ? "/api/usystem/role/all" : null,
117
+ (t) => n(t, { isGlobalNS: !0 }).then((r) => r.data)
118
+ );
119
+ }
120
+ function Q(e) {
121
+ const { usePermissionApiV2: t } = G();
122
+ return h(
123
+ `/api/usystem/role/${t ? "infoV2" : "info"}?name=${e}`,
124
+ (r) => n(r, { isGlobalNS: !0 }).then((i) => i.data)
125
+ );
126
+ }
127
+ function X() {
128
+ const { usePermissionApiV2: e } = G();
129
+ return f(
130
+ e ? "/api/usystem/role/createV2" : "/api/usystem/role/create",
131
+ (t, {
132
+ arg: r
133
+ }) => n(t, {
134
+ method: "post",
135
+ body: r,
136
+ isGlobalNS: !0
137
+ })
138
+ );
139
+ }
140
+ function Z() {
141
+ const { usePermissionApiV2: e } = G();
142
+ return f(
143
+ e ? "/api/usystem/role/updateV2" : "/api/usystem/role/update",
144
+ (t, {
145
+ arg: r
146
+ }) => n(t, {
147
+ method: "post",
148
+ body: r,
149
+ isGlobalNS: !0
150
+ })
151
+ );
152
+ }
153
+ function _() {
154
+ return f(
155
+ "/api/usystem/role/delete",
156
+ (e, {
157
+ arg: t
158
+ }) => n(e, {
159
+ method: "post",
160
+ body: t,
161
+ isGlobalNS: !0
162
+ })
163
+ );
164
+ }
165
+ function ee() {
166
+ return f(
167
+ "/api/usystem/user/create",
168
+ (e, {
169
+ arg: t
170
+ }) => n(e, {
171
+ method: "post",
172
+ body: t,
173
+ isGlobalNS: !0
174
+ })
175
+ );
176
+ }
177
+ function te() {
178
+ return f(
179
+ "/api/usystem/user/update",
180
+ (e, {
181
+ arg: t
182
+ }) => n(e, {
183
+ method: "post",
184
+ body: t,
185
+ isGlobalNS: !0
186
+ })
187
+ );
188
+ }
189
+ function re() {
190
+ return f(
191
+ "/api/usystem/user/delete",
192
+ (e, {
193
+ arg: t
194
+ }) => n(e, {
195
+ method: "post",
196
+ body: t,
197
+ isGlobalNS: !0
198
+ })
199
+ );
200
+ }
201
+ export {
202
+ _ as a,
203
+ X as b,
204
+ Z as c,
205
+ B as d,
206
+ H as e,
207
+ re as f,
208
+ ee as g,
209
+ J as h,
210
+ te as i,
211
+ Q as u
212
+ };