@webx-ui/module-auth 0.5.3 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,36 +1,43 @@
1
- import { inject as pe, defineComponent as R, computed as B, ref as b, useTemplateRef as oe, onBeforeUnmount as Fe, resolveComponent as F, openBlock as k, createBlock as S, withCtx as l, createVNode as o, withModifiers as te, createCommentVNode as P, createElementVNode as O, createTextVNode as L, toDisplayString as C, watch as J, unref as e, isRef as fe, createElementBlock as K, resolveDynamicComponent as Be, createSlots as ne, Fragment as le, renderList as he, h as be } from "vue";
2
- import { useTranslate as I, HttpError as Te, useAdmin as q, useI18n as ye } from "@webx-ui/module-admin";
3
- import { useModal as we, WxDialog as ge, WxFormItem as D, WxInput as ee, WxSelect as H, WxSpace as E, WxCheckbox as de, WxText as Y, WxButton as j, toast as G, WxTable as Me, WxActions as ce, WxAction as me, WxBadge as ae, WxAvatar as Pe, createModal as _e, WxCard as Ne, confirm as Oe } from "@webx-ui/core";
4
- const xe = /* @__PURE__ */ Symbol("webx-auth");
5
- function ke() {
6
- const a = pe(xe, null);
1
+ import { inject as te, defineComponent as R, computed as P, ref as g, useTemplateRef as oe, onBeforeUnmount as ze, resolveComponent as B, openBlock as L, createBlock as S, withCtx as l, createVNode as t, withModifiers as Be, createCommentVNode as T, createElementVNode as N, createTextVNode as F, toDisplayString as $, watch as Z, unref as e, isRef as se, createElementBlock as O, resolveDynamicComponent as ge, createSlots as ne, Fragment as le, renderList as _e, h as xe, normalizeClass as Te } from "vue";
2
+ import { useTranslate as I, HttpError as Me, useAdmin as q, useI18n as ke, useErrorText as re, WxDate as Ne, WxRowMenu as he, WxListScreen as Ee } from "@webx-ui/module-admin";
3
+ import { useModal as ie, WxDialog as ue, WxFormItem as M, WxInput as E, WxSelect as X, WxSpace as Y, WxCheckbox as be, WxText as de, WxButton as D, toast as j, WxTable as Oe, WxBadge as ae, WxAvatar as De, createModal as ce, confirm as Re } from "@webx-ui/core";
4
+ const Ve = /* @__PURE__ */ Symbol("webx-auth");
5
+ function me() {
6
+ const a = te(Ve, null);
7
7
  if (a === null)
8
8
  throw new Error("useAuth() was called outside a panel that installed the auth plugin.");
9
9
  return a;
10
10
  }
11
- function Ee(a) {
11
+ function Ie(a) {
12
12
  const i = `${a.apiPath}/auth`;
13
13
  return {
14
14
  async me() {
15
15
  try {
16
16
  return (await a.http.get(`${i}/me`)).data;
17
17
  } catch (s) {
18
- if (Ie(s))
18
+ if (Ye(s))
19
19
  return null;
20
20
  throw s;
21
21
  }
22
22
  },
23
23
  async login(s) {
24
- const n = await a.http.post(`${i}/login`, {
24
+ const o = await a.http.post(`${i}/login`, {
25
25
  email: s.email,
26
26
  password: s.password,
27
27
  remember: s.remember ?? !1
28
28
  });
29
- return a.setUser(n.data), await a.reload(), n.data;
29
+ return a.setUser(o.data), await a.reload(), o.data;
30
30
  },
31
31
  async setLocale(s) {
32
- const n = await a.http.put(`${i}/locale`, { locale: s });
33
- a.setUser(n.data), await a.setLocale(s);
32
+ const o = await a.http.put(`${i}/locale`, { locale: s });
33
+ a.setUser(o.data), await a.setLocale(s);
34
+ },
35
+ async updateProfile(s) {
36
+ const o = await a.http.put(
37
+ `${i}/me`,
38
+ s
39
+ );
40
+ return a.setUser(o.data), o.data;
34
41
  },
35
42
  async logout() {
36
43
  try {
@@ -41,14 +48,14 @@ function Ee(a) {
41
48
  }
42
49
  };
43
50
  }
44
- const Ve = /* @__PURE__ */ Symbol("webx-auth-avatar");
45
- function Re(a, i, s = null) {
46
- a.provide(xe, i), a.provide(Ve, s);
51
+ const Ae = /* @__PURE__ */ Symbol("webx-auth-avatar"), Le = /* @__PURE__ */ Symbol("webx-auth-avatar-field");
52
+ function Ke(a, i, s = null, o = null) {
53
+ a.provide(Ve, i), a.provide(Ae, s), a.provide(Le, o);
47
54
  }
48
- function Ie(a) {
55
+ function Ye(a) {
49
56
  return typeof a == "object" && a !== null && "status" in a && a.status === 401;
50
57
  }
51
- const De = ["title", "aria-label", "aria-pressed"], Ke = /* @__PURE__ */ R({
58
+ const je = ["title", "aria-label", "aria-pressed"], qe = /* @__PURE__ */ R({
52
59
  __name: "LoginCard",
53
60
  props: {
54
61
  emailLabel: { default: void 0 },
@@ -64,170 +71,170 @@ const De = ["title", "aria-label", "aria-pressed"], Ke = /* @__PURE__ */ R({
64
71
  },
65
72
  emits: ["success"],
66
73
  setup(a, { expose: i, emit: s }) {
67
- const n = a, r = s, y = ke(), v = I("webx-auth"), u = B(() => ({
68
- email: n.emailLabel ?? v("card.email"),
69
- password: n.passwordLabel ?? v("card.password"),
70
- remember: n.rememberLabel ?? v("card.remember"),
71
- submit: n.submitLabel ?? v("card.submit"),
72
- capsLock: n.capsLockWarning ?? v("card.caps-lock"),
73
- reveal: n.revealLabel ?? v("card.reveal"),
74
- hide: n.hideLabel ?? v("card.hide")
75
- })), m = b(""), V = b(""), _ = b(!1), d = b(!1), t = b(!1), $ = b(!1), A = b(""), U = b({}), W = b(0), T = oe("emailField");
76
- let z = null;
77
- Fe(x);
78
- const c = B(() => W.value > 0), p = B(
79
- () => n.throttleMessage === void 0 ? v("card.throttled", { seconds: W.value }) : n.throttleMessage.replace(":seconds", String(W.value))
74
+ const o = a, u = s, k = me(), m = I("webx-auth"), n = P(() => ({
75
+ email: o.emailLabel ?? m("card.email"),
76
+ password: o.passwordLabel ?? m("card.password"),
77
+ remember: o.rememberLabel ?? m("card.remember"),
78
+ submit: o.submitLabel ?? m("card.submit"),
79
+ capsLock: o.capsLockWarning ?? m("card.caps-lock"),
80
+ reveal: o.revealLabel ?? m("card.reveal"),
81
+ hide: o.hideLabel ?? m("card.hide")
82
+ })), p = g(""), C = g(""), V = g(!1), d = g(!1), w = g(!1), r = g(!1), b = g(""), _ = g({}), f = g(0), U = oe("emailField");
83
+ let W = null;
84
+ ze(H);
85
+ const z = P(() => f.value > 0), h = P(
86
+ () => o.throttleMessage === void 0 ? m("card.throttled", { seconds: f.value }) : o.throttleMessage.replace(":seconds", String(f.value))
80
87
  );
81
- async function h() {
82
- if (!(d.value || c.value)) {
83
- d.value = !0, A.value = "", U.value = {};
88
+ async function c() {
89
+ if (!(d.value || z.value)) {
90
+ d.value = !0, b.value = "", _.value = {};
84
91
  try {
85
- await y.login({
86
- email: m.value,
87
- password: V.value,
88
- remember: _.value
89
- }), V.value = "", r("success");
90
- } catch (g) {
91
- X(g);
92
+ await k.login({
93
+ email: p.value,
94
+ password: C.value,
95
+ remember: V.value
96
+ }), C.value = "", u("success");
97
+ } catch (y) {
98
+ x(y);
92
99
  } finally {
93
100
  d.value = !1;
94
101
  }
95
102
  }
96
103
  }
97
- function X(g) {
98
- if (!(g instanceof Te)) {
99
- A.value = g instanceof Error ? g.message : String(g);
104
+ function x(y) {
105
+ if (!(y instanceof Me)) {
106
+ b.value = y instanceof Error ? y.message : String(y);
100
107
  return;
101
108
  }
102
- if (g.isValidation) {
103
- U.value = g.errors;
109
+ if (y.isValidation) {
110
+ _.value = y.errors;
104
111
  return;
105
112
  }
106
- if (g.isThrottled) {
107
- w(g.retryAfter ?? 60);
113
+ if (y.isThrottled) {
114
+ Q(y.retryAfter ?? 60);
108
115
  return;
109
116
  }
110
- A.value = g.message;
117
+ b.value = y.message;
111
118
  }
112
- function w(g) {
113
- x(), W.value = g, z = setInterval(() => {
114
- W.value -= 1, W.value <= 0 && x();
119
+ function Q(y) {
120
+ H(), f.value = y, W = setInterval(() => {
121
+ f.value -= 1, f.value <= 0 && H();
115
122
  }, 1e3);
116
123
  }
117
- function x() {
118
- z !== null && (clearInterval(z), z = null), W.value = 0;
124
+ function H() {
125
+ W !== null && (clearInterval(W), W = null), f.value = 0;
119
126
  }
120
- function f(g) {
121
- $.value = g.getModifierState("CapsLock");
127
+ function A(y) {
128
+ r.value = y.getModifierState("CapsLock");
122
129
  }
123
- return i({ focus: () => T.value?.focus() }), (g, M) => {
124
- const ie = F("wx-alert"), Z = F("wx-icon"), re = F("wx-input"), ue = F("wx-form-item"), Se = F("wx-checkbox"), Ue = F("wx-button"), We = F("wx-form"), ze = F("wx-card");
125
- return k(), S(ze, {
130
+ return i({ focus: () => U.value?.focus() }), (y, v) => {
131
+ const G = B("wx-alert"), ee = B("wx-icon"), fe = B("wx-input"), we = B("wx-form-item"), Fe = B("wx-checkbox"), Se = B("wx-button"), We = B("wx-form"), Pe = B("wx-card");
132
+ return L(), S(Pe, {
126
133
  class: "wx-login",
127
134
  padding: 24
128
135
  }, {
129
136
  default: l(() => [
130
- o(We, {
131
- errors: U.value,
137
+ t(We, {
138
+ errors: _.value,
132
139
  disabled: d.value,
133
140
  gap: "md",
134
- onSubmit: te(h, ["prevent"])
141
+ onSubmit: Be(c, ["prevent"])
135
142
  }, {
136
143
  default: l(() => [
137
- A.value !== "" ? (k(), S(ie, {
144
+ b.value !== "" ? (L(), S(G, {
138
145
  key: 0,
139
146
  type: "danger",
140
147
  variant: "soft",
141
148
  live: "",
142
- description: A.value,
149
+ description: b.value,
143
150
  class: "wx-login__message"
144
- }, null, 8, ["description"])) : c.value ? (k(), S(ie, {
151
+ }, null, 8, ["description"])) : z.value ? (L(), S(G, {
145
152
  key: 1,
146
153
  type: "warning",
147
154
  variant: "soft",
148
155
  live: "",
149
- description: p.value,
156
+ description: h.value,
150
157
  class: "wx-login__message"
151
- }, null, 8, ["description"])) : P("", !0),
152
- o(ue, { name: "email" }, {
158
+ }, null, 8, ["description"])) : T("", !0),
159
+ t(we, { name: "email" }, {
153
160
  default: l(() => [
154
- o(re, {
161
+ t(fe, {
155
162
  ref_key: "emailField",
156
- ref: T,
157
- modelValue: m.value,
158
- "onUpdate:modelValue": M[0] || (M[0] = (N) => m.value = N),
163
+ ref: U,
164
+ modelValue: p.value,
165
+ "onUpdate:modelValue": v[0] || (v[0] = (K) => p.value = K),
159
166
  type: "email",
160
- placeholder: u.value.email,
161
- "aria-label": u.value.email,
167
+ placeholder: n.value.email,
168
+ "aria-label": n.value.email,
162
169
  autocomplete: "username",
163
170
  autofocus: a.autofocus,
164
171
  inputmode: "email",
165
172
  size: "lg"
166
173
  }, {
167
174
  prefix: l(() => [
168
- o(Z, { name: "mail" })
175
+ t(ee, { name: "mail" })
169
176
  ]),
170
177
  _: 1
171
178
  }, 8, ["modelValue", "placeholder", "aria-label", "autofocus"])
172
179
  ]),
173
180
  _: 1
174
181
  }),
175
- o(ue, {
182
+ t(we, {
176
183
  name: "password",
177
- help: $.value ? u.value.capsLock : void 0
184
+ help: r.value ? n.value.capsLock : void 0
178
185
  }, {
179
186
  default: l(() => [
180
- o(re, {
181
- modelValue: V.value,
182
- "onUpdate:modelValue": M[2] || (M[2] = (N) => V.value = N),
183
- type: t.value ? "text" : "password",
184
- placeholder: u.value.password,
185
- "aria-label": u.value.password,
187
+ t(fe, {
188
+ modelValue: C.value,
189
+ "onUpdate:modelValue": v[2] || (v[2] = (K) => C.value = K),
190
+ type: w.value ? "text" : "password",
191
+ placeholder: n.value.password,
192
+ "aria-label": n.value.password,
186
193
  autocomplete: "current-password",
187
194
  size: "lg",
188
- onKeydown: f,
189
- onKeyup: f
195
+ onKeydown: A,
196
+ onKeyup: A
190
197
  }, {
191
198
  prefix: l(() => [
192
- o(Z, { name: "lock" })
199
+ t(ee, { name: "lock" })
193
200
  ]),
194
201
  suffix: l(() => [
195
- O("button", {
202
+ N("button", {
196
203
  type: "button",
197
204
  class: "wx-login__reveal",
198
- title: t.value ? u.value.hide : u.value.reveal,
199
- "aria-label": t.value ? u.value.hide : u.value.reveal,
200
- "aria-pressed": t.value,
205
+ title: w.value ? n.value.hide : n.value.reveal,
206
+ "aria-label": w.value ? n.value.hide : n.value.reveal,
207
+ "aria-pressed": w.value,
201
208
  tabindex: "-1",
202
- onClick: M[1] || (M[1] = (N) => t.value = !t.value)
209
+ onClick: v[1] || (v[1] = (K) => w.value = !w.value)
203
210
  }, [
204
- o(Z, {
205
- name: t.value ? "eye-off" : "eye"
211
+ t(ee, {
212
+ name: w.value ? "eye-off" : "eye"
206
213
  }, null, 8, ["name"])
207
- ], 8, De)
214
+ ], 8, je)
208
215
  ]),
209
216
  _: 1
210
217
  }, 8, ["modelValue", "type", "placeholder", "aria-label"])
211
218
  ]),
212
219
  _: 1
213
220
  }, 8, ["help"]),
214
- a.remember ? (k(), S(Se, {
221
+ a.remember ? (L(), S(Fe, {
215
222
  key: 2,
216
- modelValue: _.value,
217
- "onUpdate:modelValue": M[3] || (M[3] = (N) => _.value = N),
218
- label: u.value.remember,
223
+ modelValue: V.value,
224
+ "onUpdate:modelValue": v[3] || (v[3] = (K) => V.value = K),
225
+ label: n.value.remember,
219
226
  class: "wx-login__remember"
220
- }, null, 8, ["modelValue", "label"])) : P("", !0),
221
- o(Ue, {
227
+ }, null, 8, ["modelValue", "label"])) : T("", !0),
228
+ t(Se, {
222
229
  type: "primary",
223
230
  "native-type": "submit",
224
231
  size: "lg",
225
232
  block: "",
226
233
  loading: d.value,
227
- disabled: c.value
234
+ disabled: z.value
228
235
  }, {
229
236
  default: l(() => [
230
- L(C(u.value.submit), 1)
237
+ F($(n.value.submit), 1)
231
238
  ]),
232
239
  _: 1
233
240
  }, 8, ["loading", "disabled"])
@@ -239,12 +246,12 @@ const De = ["title", "aria-label", "aria-pressed"], Ke = /* @__PURE__ */ R({
239
246
  });
240
247
  };
241
248
  }
242
- }), Ae = (a, i) => {
249
+ }), ve = (a, i) => {
243
250
  const s = a.__vccOpts || a;
244
- for (const [n, r] of i)
245
- s[n] = r;
251
+ for (const [o, u] of i)
252
+ s[o] = u;
246
253
  return s;
247
- }, je = /* @__PURE__ */ Ae(Ke, [["__scopeId", "data-v-3c206e31"]]), Ce = {
254
+ }, He = /* @__PURE__ */ ve(qe, [["__scopeId", "data-v-3c206e31"]]), $e = {
248
255
  card: {
249
256
  email: "Email",
250
257
  password: "Password",
@@ -278,7 +285,6 @@ const De = ["title", "aria-label", "aria-pressed"], Ke = /* @__PURE__ */ R({
278
285
  locale: "Panel language",
279
286
  "locale-auto": "Follow the browser",
280
287
  "last-login": "Last signed in",
281
- never: "Never",
282
288
  save: "Save",
283
289
  cancel: "Cancel",
284
290
  delete: "Delete",
@@ -303,52 +309,67 @@ const De = ["title", "aria-label", "aria-pressed"], Ke = /* @__PURE__ */ R({
303
309
  "not-yourself": "You cannot do that to your own account.",
304
310
  "last-super": "There has to be one super administrator left."
305
311
  },
312
+ // Somebody editing themselves, which is a shorter list than an administrator editing them.
313
+ profile: {
314
+ title: "Your profile",
315
+ menu: "Edit your profile",
316
+ name: "Name",
317
+ avatar: "Photo",
318
+ password: "New password",
319
+ "password-hint": "At least 12 characters. Leave blank to keep the current one.",
320
+ "current-password": "Current password",
321
+ "current-password-hint": "Asked for before the password is changed.",
322
+ "wrong-password": "That is not the current password.",
323
+ saved: "Your profile is saved.",
324
+ save: "Save",
325
+ cancel: "Cancel"
326
+ },
306
327
  menu: {
307
328
  "sign-out": "Sign out",
308
329
  language: "Interface language"
309
330
  }
310
331
  };
311
- function se(a) {
312
- const i = `${a.apiPath}/auth`, s = (n) => n.data;
332
+ function pe(a) {
333
+ const i = `${a.apiPath}/auth`, s = (o) => o.data;
313
334
  return {
314
- list: (n = {}) => a.http.get(`${i}/admins`, {
335
+ list: (o = {}) => a.http.get(`${i}/admins`, {
315
336
  query: {
316
- q: n.q || void 0,
317
- role: n.role ?? void 0,
318
- active: n.active ?? void 0,
319
- sort: n.sort,
320
- page: n.page,
321
- per_page: n.per_page
337
+ q: o.q || void 0,
338
+ role: o.role ?? void 0,
339
+ active: o.active ?? void 0,
340
+ sort: o.sort,
341
+ page: o.page,
342
+ per_page: o.per_page
322
343
  }
323
- }).then((r) => ({ ...r.meta, data: r.data })),
324
- get: (n) => a.http.get(`${i}/admins/${n}`).then(s),
325
- create: (n) => a.http.post(`${i}/admins`, n).then(s),
326
- update: (n, r) => a.http.patch(`${i}/admins/${n}`, r).then(s),
327
- remove: (n) => a.http.delete(`${i}/admins/${n}`),
344
+ }).then((u) => ({ ...u.meta, data: u.data })),
345
+ get: (o) => a.http.get(`${i}/admins/${o}`).then(s),
346
+ create: (o) => a.http.post(`${i}/admins`, o).then(s),
347
+ update: (o, u) => a.http.patch(`${i}/admins/${o}`, u).then(s),
348
+ remove: (o) => a.http.delete(`${i}/admins/${o}`),
328
349
  roles: () => a.http.get(`${i}/roles`).then(s)
329
350
  };
330
351
  }
331
- const ve = /* @__PURE__ */ new WeakSet();
332
- function Q() {
352
+ const ye = /* @__PURE__ */ new WeakSet();
353
+ function J() {
333
354
  try {
334
355
  const { i18n: a } = q();
335
- ve.has(a) || (a.defaults("webx-auth", Ce), ve.add(a));
356
+ ye.has(a) || (a.defaults("webx-auth", $e), ye.add(a));
336
357
  } catch {
337
358
  }
338
359
  }
339
- const qe = { class: "wx-admin-form" }, He = { class: "wx-admin-form__grid" }, Ye = {
360
+ const Ge = { class: "wx-admin-form" }, Je = { class: "wx-admin-form__grid" }, Qe = {
340
361
  key: 0,
341
362
  class: "wx-admin-form__aside"
342
- }, Ge = { class: "wx-admin-form__fields" }, Je = /* @__PURE__ */ R({
363
+ }, Xe = { class: "wx-admin-form__fields" }, Ze = /* @__PURE__ */ R({
343
364
  __name: "AdminDialog",
344
365
  props: {
345
366
  admin: { default: null },
346
367
  avatarField: { default: void 0 }
347
368
  },
348
369
  setup(a) {
349
- const i = a, { resolve: s, dismiss: n, open: r } = we(), y = q(), v = se(y), u = ye();
350
- Q();
351
- const m = I("webx-auth"), V = b([]), _ = b(!1), d = b({}), t = b({
370
+ const i = a, { resolve: s, dismiss: o, open: u } = ie(), k = q(), m = pe(k), n = ke();
371
+ J();
372
+ const p = I("webx-auth"), C = re(), V = g([]), d = g(!1), w = g({}), r = g({
352
373
  name: "",
353
374
  email: "",
354
375
  password: "",
@@ -357,81 +378,81 @@ const qe = { class: "wx-admin-form" }, He = { class: "wx-admin-form__grid" }, Ye
357
378
  is_super: !1,
358
379
  locale: null,
359
380
  roles: []
360
- }), $ = B({
361
- get: () => t.value.avatar ? { path: t.value.avatar } : null,
362
- set: (c) => {
363
- t.value.avatar = c?.path ?? null;
381
+ }), b = P({
382
+ get: () => r.value.avatar ? { path: r.value.avatar } : null,
383
+ set: (h) => {
384
+ r.value.avatar = h?.path ?? null;
364
385
  }
365
- }), A = B(() => i.admin !== null), U = B(() => V.value.map((c) => ({ value: c.id, label: c.name }))), W = B(() => [
366
- { value: "auto", label: m("admins.locale-auto") },
367
- ...u.state.panelLocales.map((c) => ({ value: c.code, label: c.nativeName }))
386
+ }), _ = P(() => i.admin !== null), f = P(() => V.value.map((h) => ({ value: h.id, label: h.name }))), U = P(() => [
387
+ { value: "auto", label: p("admins.locale-auto") },
388
+ ...n.state.panelLocales.map((h) => ({ value: h.code, label: h.nativeName }))
368
389
  ]);
369
- v.roles().then((c) => V.value = c), J(
390
+ m.roles().then((h) => V.value = h), Z(
370
391
  () => i.admin,
371
- (c) => {
372
- t.value = {
373
- name: c?.name ?? "",
374
- email: c?.email ?? "",
392
+ (h) => {
393
+ r.value = {
394
+ name: h?.name ?? "",
395
+ email: h?.email ?? "",
375
396
  password: "",
376
- avatar: c?.avatar ?? null,
377
- is_active: c?.is_active ?? !0,
378
- is_super: c?.is_super ?? !1,
379
- locale: c?.locale ?? "auto",
380
- roles: c?.roles.map((p) => p.id) ?? []
381
- }, d.value = {};
397
+ avatar: h?.avatar ?? null,
398
+ is_active: h?.is_active ?? !0,
399
+ is_super: h?.is_super ?? !1,
400
+ locale: h?.locale ?? "auto",
401
+ roles: h?.roles.map((c) => c.id) ?? []
402
+ }, w.value = {};
382
403
  },
383
404
  { immediate: !0 }
384
405
  );
385
- function T(c) {
386
- return d.value[c]?.[0];
406
+ function W(h) {
407
+ return w.value[h]?.[0];
387
408
  }
388
409
  async function z() {
389
- _.value = !0, d.value = {};
390
- const c = {
391
- name: t.value.name,
392
- email: t.value.email,
393
- avatar: t.value.avatar,
394
- is_active: t.value.is_active,
395
- is_super: t.value.is_super,
396
- locale: t.value.locale === "auto" ? null : t.value.locale,
397
- roles: t.value.roles ?? []
410
+ d.value = !0, w.value = {};
411
+ const h = {
412
+ name: r.value.name,
413
+ email: r.value.email,
414
+ avatar: r.value.avatar,
415
+ is_active: r.value.is_active,
416
+ is_super: r.value.is_super,
417
+ locale: r.value.locale === "auto" ? null : r.value.locale,
418
+ roles: r.value.roles ?? []
398
419
  };
399
- t.value.password && (c.password = t.value.password);
420
+ r.value.password && (h.password = r.value.password);
400
421
  try {
401
- const p = i.admin ? await v.update(i.admin.id, c) : await v.create(c);
402
- G.success(m(A.value ? "admins.updated" : "admins.created")), s(p);
403
- } catch (p) {
404
- const h = p.body;
405
- h?.errors ? d.value = h.errors : h?.message && G.danger(h.message);
422
+ const c = i.admin ? await m.update(i.admin.id, h) : await m.create(h);
423
+ j.success(p(_.value ? "admins.updated" : "admins.created")), s(c);
424
+ } catch (c) {
425
+ const x = c.body;
426
+ x?.errors ? w.value = x.errors : j.danger(C(c));
406
427
  } finally {
407
- _.value = !1;
428
+ d.value = !1;
408
429
  }
409
430
  }
410
- return (c, p) => (k(), S(e(ge), {
411
- open: e(r),
412
- "onUpdate:open": p[9] || (p[9] = (h) => fe(r) ? r.value = h : null),
413
- title: A.value ? e(m)("admins.edit-short") : e(m)("admins.new-short"),
431
+ return (h, c) => (L(), S(e(ue), {
432
+ open: e(u),
433
+ "onUpdate:open": c[9] || (c[9] = (x) => se(u) ? u.value = x : null),
434
+ title: _.value ? e(p)("admins.edit-short") : e(p)("admins.new-short"),
414
435
  width: 720
415
436
  }, {
416
437
  footer: l(() => [
417
- o(e(E), { size: "sm" }, {
438
+ t(e(Y), { size: "sm" }, {
418
439
  default: l(() => [
419
- o(e(j), {
440
+ t(e(D), {
420
441
  variant: "outline",
421
- onClick: p[8] || (p[8] = (h) => e(n)())
442
+ onClick: c[8] || (c[8] = (x) => e(o)())
422
443
  }, {
423
444
  default: l(() => [
424
- L(C(e(m)("admins.cancel")), 1)
445
+ F($(e(p)("admins.cancel")), 1)
425
446
  ]),
426
447
  _: 1
427
448
  }),
428
- o(e(j), {
449
+ t(e(D), {
429
450
  type: "primary",
430
- loading: _.value,
451
+ loading: d.value,
431
452
  onClick: z
432
453
  }, {
433
454
  default: l(() => [
434
- L(C(e(m)("admins.save")), 1)
455
+ F($(e(p)("admins.save")), 1)
435
456
  ]),
436
457
  _: 1
437
458
  }, 8, ["loading"])
@@ -440,39 +461,39 @@ const qe = { class: "wx-admin-form" }, He = { class: "wx-admin-form__grid" }, Ye
440
461
  })
441
462
  ]),
442
463
  default: l(() => [
443
- O("div", qe, [
444
- O("div", He, [
445
- a.avatarField ? (k(), K("div", Ye, [
446
- (k(), S(Be(a.avatarField), {
447
- modelValue: $.value,
448
- "onUpdate:modelValue": p[0] || (p[0] = (h) => $.value = h),
449
- label: e(m)("admins.avatar"),
464
+ N("div", Ge, [
465
+ N("div", Je, [
466
+ a.avatarField ? (L(), O("div", Qe, [
467
+ (L(), S(ge(a.avatarField), {
468
+ modelValue: b.value,
469
+ "onUpdate:modelValue": c[0] || (c[0] = (x) => b.value = x),
470
+ label: e(p)("admins.avatar"),
450
471
  aspect: "1/1",
451
472
  captions: !1
452
473
  }, null, 8, ["modelValue", "label"]))
453
- ])) : P("", !0),
454
- O("div", Ge, [
455
- o(e(D), {
456
- label: e(m)("admins.name"),
457
- error: T("name")
474
+ ])) : T("", !0),
475
+ N("div", Xe, [
476
+ t(e(M), {
477
+ label: e(p)("admins.name"),
478
+ error: W("name")
458
479
  }, {
459
480
  default: l(() => [
460
- o(e(ee), {
461
- modelValue: t.value.name,
462
- "onUpdate:modelValue": p[1] || (p[1] = (h) => t.value.name = h),
481
+ t(e(E), {
482
+ modelValue: r.value.name,
483
+ "onUpdate:modelValue": c[1] || (c[1] = (x) => r.value.name = x),
463
484
  name: "name"
464
485
  }, null, 8, ["modelValue"])
465
486
  ]),
466
487
  _: 1
467
488
  }, 8, ["label", "error"]),
468
- o(e(D), {
469
- label: e(m)("admins.email"),
470
- error: T("email")
489
+ t(e(M), {
490
+ label: e(p)("admins.email"),
491
+ error: W("email")
471
492
  }, {
472
493
  default: l(() => [
473
- o(e(ee), {
474
- modelValue: t.value.email,
475
- "onUpdate:modelValue": p[2] || (p[2] = (h) => t.value.email = h),
494
+ t(e(E), {
495
+ modelValue: r.value.email,
496
+ "onUpdate:modelValue": c[2] || (c[2] = (x) => r.value.email = x),
476
497
  type: "email",
477
498
  name: "email",
478
499
  autocomplete: "off"
@@ -480,15 +501,15 @@ const qe = { class: "wx-admin-form" }, He = { class: "wx-admin-form__grid" }, Ye
480
501
  ]),
481
502
  _: 1
482
503
  }, 8, ["label", "error"]),
483
- o(e(D), {
484
- label: e(m)("admins.password"),
485
- error: T("password"),
486
- help: A.value ? e(m)("admins.password-keep") : e(m)("admins.password-hint")
504
+ t(e(M), {
505
+ label: e(p)("admins.password"),
506
+ error: W("password"),
507
+ help: _.value ? e(p)("admins.password-keep") : e(p)("admins.password-hint")
487
508
  }, {
488
509
  default: l(() => [
489
- o(e(ee), {
490
- modelValue: t.value.password,
491
- "onUpdate:modelValue": p[3] || (p[3] = (h) => t.value.password = h),
510
+ t(e(E), {
511
+ modelValue: r.value.password,
512
+ "onUpdate:modelValue": c[3] || (c[3] = (x) => r.value.password = x),
492
513
  type: "password",
493
514
  name: "password",
494
515
  autocomplete: "new-password"
@@ -496,53 +517,53 @@ const qe = { class: "wx-admin-form" }, He = { class: "wx-admin-form__grid" }, Ye
496
517
  ]),
497
518
  _: 1
498
519
  }, 8, ["label", "error", "help"]),
499
- o(e(D), {
500
- label: e(m)("admins.roles"),
501
- error: T("roles")
520
+ t(e(M), {
521
+ label: e(p)("admins.roles"),
522
+ error: W("roles")
502
523
  }, {
503
524
  default: l(() => [
504
- o(e(H), {
505
- modelValue: t.value.roles,
506
- "onUpdate:modelValue": p[4] || (p[4] = (h) => t.value.roles = h),
507
- options: U.value,
525
+ t(e(X), {
526
+ modelValue: r.value.roles,
527
+ "onUpdate:modelValue": c[4] || (c[4] = (x) => r.value.roles = x),
528
+ options: f.value,
508
529
  multiple: ""
509
530
  }, null, 8, ["modelValue", "options"])
510
531
  ]),
511
532
  _: 1
512
533
  }, 8, ["label", "error"]),
513
- o(e(D), {
514
- label: e(m)("admins.locale")
534
+ t(e(M), {
535
+ label: e(p)("admins.locale")
515
536
  }, {
516
537
  default: l(() => [
517
- o(e(H), {
518
- modelValue: t.value.locale,
519
- "onUpdate:modelValue": p[5] || (p[5] = (h) => t.value.locale = h),
520
- options: W.value
538
+ t(e(X), {
539
+ modelValue: r.value.locale,
540
+ "onUpdate:modelValue": c[5] || (c[5] = (x) => r.value.locale = x),
541
+ options: U.value
521
542
  }, null, 8, ["modelValue", "options"])
522
543
  ]),
523
544
  _: 1
524
545
  }, 8, ["label"]),
525
- o(e(E), { size: "md" }, {
546
+ t(e(Y), { size: "md" }, {
526
547
  default: l(() => [
527
- o(e(de), {
528
- modelValue: t.value.is_active,
529
- "onUpdate:modelValue": p[6] || (p[6] = (h) => t.value.is_active = h),
530
- label: e(m)("admins.active")
548
+ t(e(be), {
549
+ modelValue: r.value.is_active,
550
+ "onUpdate:modelValue": c[6] || (c[6] = (x) => r.value.is_active = x),
551
+ label: e(p)("admins.active")
531
552
  }, null, 8, ["modelValue", "label"]),
532
- o(e(de), {
533
- modelValue: t.value.is_super,
534
- "onUpdate:modelValue": p[7] || (p[7] = (h) => t.value.is_super = h),
535
- label: e(m)("admins.super")
553
+ t(e(be), {
554
+ modelValue: r.value.is_super,
555
+ "onUpdate:modelValue": c[7] || (c[7] = (x) => r.value.is_super = x),
556
+ label: e(p)("admins.super")
536
557
  }, null, 8, ["modelValue", "label"])
537
558
  ]),
538
559
  _: 1
539
560
  }),
540
- o(e(Y), {
561
+ t(e(de), {
541
562
  size: "sm",
542
563
  tone: "muted"
543
564
  }, {
544
565
  default: l(() => [
545
- L(C(e(m)("admins.super-hint")), 1)
566
+ F($(e(p)("admins.super-hint")), 1)
546
567
  ]),
547
568
  _: 1
548
569
  })
@@ -553,7 +574,7 @@ const qe = { class: "wx-admin-form" }, He = { class: "wx-admin-form__grid" }, Ye
553
574
  _: 1
554
575
  }, 8, ["open", "title"]));
555
576
  }
556
- }), Qe = { class: "wx-admin-list" }, Le = /* @__PURE__ */ R({
577
+ }), ea = { class: "wx-admin-list" }, Ce = /* @__PURE__ */ R({
557
578
  __name: "AdminList",
558
579
  props: {
559
580
  picking: { type: Boolean, default: !1 },
@@ -564,25 +585,25 @@ const qe = { class: "wx-admin-form" }, He = { class: "wx-admin-form__grid" }, Ye
564
585
  },
565
586
  emits: ["open", "chosen", "selection", "remove"],
566
587
  setup(a, { expose: i, emit: s }) {
567
- const n = a, r = s, y = q(), v = se(y);
568
- Q();
569
- const u = I("webx-auth"), m = b(null), V = b([]), _ = b(!1), d = b("all"), t = b("any"), $ = b([]), A = b({});
570
- let U = { page: 1, perPage: 20, sort: null, search: "" };
571
- const W = B(() => [
572
- { value: "all", label: u("admins.all-roles") },
573
- ...V.value.map((w) => ({ value: w.slug, label: w.name }))
574
- ]), T = B(() => [
575
- { value: "any", label: u("admins.any-state") },
576
- { value: "yes", label: u("admins.only-active") },
577
- { value: "no", label: u("admins.only-inactive") }
578
- ]), z = B(() => [
579
- { key: "name", label: u("admins.name"), sortable: !0 },
580
- { key: "email", label: u("admins.email"), sortable: !0, hideBelow: 560 },
581
- { key: "roles", label: u("admins.roles"), hideBelow: 760 },
582
- { key: "is_active", label: u("admins.active"), align: "center", hideBelow: 660 },
588
+ const o = a, u = s, k = q(), m = pe(k);
589
+ J();
590
+ const n = I("webx-auth"), p = g(null), C = g([]), V = g(!1), d = g("all"), w = g("any"), r = g([]), b = g({});
591
+ let _ = { page: 1, perPage: 20, sort: null, search: "" };
592
+ const f = P(() => [
593
+ { value: "all", label: n("admins.all-roles") },
594
+ ...C.value.map((A) => ({ value: A.slug, label: A.name }))
595
+ ]), U = P(() => [
596
+ { value: "any", label: n("admins.any-state") },
597
+ { value: "yes", label: n("admins.only-active") },
598
+ { value: "no", label: n("admins.only-inactive") }
599
+ ]), W = P(() => [
600
+ { key: "name", label: n("admins.name"), sortable: !0 },
601
+ { key: "email", label: n("admins.email"), sortable: !0, hideBelow: 560 },
602
+ { key: "roles", label: n("admins.roles"), hideBelow: 760 },
603
+ { key: "is_active", label: n("admins.active"), align: "center", hideBelow: 660 },
583
604
  {
584
605
  key: "last_login_at",
585
- label: u("admins.last-login"),
606
+ label: n("admins.last-login"),
586
607
  sortable: !0,
587
608
  hideBelow: 900,
588
609
  // The first thing to go when a row becomes a card: it is a date somebody scans down a
@@ -594,188 +615,176 @@ const qe = { class: "wx-admin-form" }, He = { class: "wx-admin-form__grid" }, Ye
594
615
  label: "",
595
616
  width: 56,
596
617
  align: "right",
597
- hidden: !n.removable,
618
+ hidden: !o.removable,
598
619
  // A card puts them along its top instead, through the `card-actions` slot.
599
620
  hideOnCards: !0
600
621
  }
601
622
  ]);
602
- v.roles().then((w) => V.value = w), J([d, t], () => c(U));
603
- async function c(w) {
604
- U = w, _.value = !0;
623
+ m.roles().then((A) => C.value = A), Z([d, w], () => z(_));
624
+ async function z(A) {
625
+ _ = A, V.value = !0;
605
626
  try {
606
- m.value = await v.list({
607
- q: w.search,
627
+ p.value = await m.list({
628
+ q: A.search,
608
629
  role: d.value === "all" ? null : d.value,
609
- active: t.value === "any" ? null : t.value,
610
- sort: w.sort ? `${w.sort.order === "desc" ? "-" : ""}${w.sort.key}` : "name",
611
- page: w.page,
612
- per_page: w.perPage
613
- }), p();
630
+ active: w.value === "any" ? null : w.value,
631
+ sort: A.sort ? `${A.sort.order === "desc" ? "-" : ""}${A.sort.key}` : "name",
632
+ page: A.page,
633
+ per_page: A.perPage
634
+ }), h();
614
635
  } finally {
615
- _.value = !1;
636
+ V.value = !1;
616
637
  }
617
638
  }
618
- async function p() {
619
- const w = n.resolveAvatar;
620
- if (w)
621
- for (const x of m.value?.data ?? []) {
622
- if (!x.avatar || A.value[x.avatar]) continue;
623
- const f = await w(x.avatar);
624
- f && (A.value = { ...A.value, [x.avatar]: f });
639
+ async function h() {
640
+ const A = o.resolveAvatar;
641
+ if (A)
642
+ for (const y of p.value?.data ?? []) {
643
+ if (!y.avatar || b.value[y.avatar]) continue;
644
+ const v = await A(y.avatar);
645
+ v && (b.value = { ...b.value, [y.avatar]: v });
646
+ }
647
+ }
648
+ function c(A) {
649
+ return [
650
+ {
651
+ key: "delete",
652
+ icon: "trash",
653
+ label: n("admins.delete"),
654
+ danger: !0,
655
+ run: () => u("remove", A)
625
656
  }
657
+ ];
626
658
  }
627
- function h(w) {
628
- if (!n.picking) {
629
- r("open", w);
659
+ function x(A) {
660
+ if (o.picking) {
661
+ u("chosen", [A]);
630
662
  return;
631
663
  }
632
- n.multiple || r("chosen", [w]);
664
+ u("open", A);
633
665
  }
634
- function X(w, x) {
635
- $.value = x, r("selection", x);
666
+ const Q = P(() => !(o.picking && o.multiple));
667
+ function H(A, y) {
668
+ r.value = y, u("selection", y);
636
669
  }
637
- return i({ reload: () => c(U), chosen: () => $.value }), (w, x) => (k(), K("div", Qe, [
638
- o(e(Me), {
639
- data: m.value,
640
- columns: z.value,
670
+ return i({ reload: () => z(_), chosen: () => r.value }), (A, y) => (L(), O("div", ea, [
671
+ t(e(Oe), {
672
+ data: p.value,
673
+ columns: W.value,
641
674
  "row-key": "id",
642
675
  searchable: "",
643
- hover: "",
676
+ clickable: Q.value,
677
+ hover: Q.value,
644
678
  flush: "",
645
- loading: _.value,
646
- "search-placeholder": e(u)("admins.search"),
647
- "empty-text": e(u)("admins.empty"),
679
+ loading: V.value,
680
+ "search-placeholder": e(n)("admins.search"),
681
+ "empty-text": e(n)("admins.empty"),
648
682
  selectable: a.picking && a.multiple,
649
- onStateChange: c,
650
- onRowClick: h,
651
- onSelectionChange: X
683
+ onRowClick: x,
684
+ onStateChange: z,
685
+ onSelectionChange: H
652
686
  }, ne({
653
- "cell-name": l(({ row: f }) => [
654
- o(e(E), {
687
+ "cell-name": l(({ row: v }) => [
688
+ t(e(Y), {
655
689
  size: "sm",
656
690
  align: "center"
657
691
  }, {
658
692
  default: l(() => [
659
- o(e(Pe), {
660
- name: f.name,
661
- src: f.avatar ? A.value[f.avatar] : void 0,
693
+ t(e(De), {
694
+ name: v.name,
695
+ src: v.avatar ? b.value[v.avatar] : void 0,
662
696
  size: "sm"
663
697
  }, null, 8, ["name", "src"]),
664
- O("span", null, C(f.name), 1),
665
- f.is_super ? (k(), S(e(ae), {
698
+ N("span", null, $(v.name), 1),
699
+ v.is_super ? (L(), S(e(ae), {
666
700
  key: 0,
667
701
  type: "warning"
668
702
  }, {
669
703
  default: l(() => [
670
- L(C(e(u)("admins.super")), 1)
704
+ F($(e(n)("admins.super")), 1)
671
705
  ]),
672
706
  _: 1
673
- })) : P("", !0)
707
+ })) : T("", !0)
674
708
  ]),
675
709
  _: 2
676
710
  }, 1024)
677
711
  ]),
678
- "cell-roles": l(({ row: f }) => [
679
- f.roles.length > 0 ? (k(), S(e(E), {
712
+ "cell-roles": l(({ row: v }) => [
713
+ v.roles.length > 0 ? (L(), S(e(Y), {
680
714
  key: 0,
681
715
  size: "xs",
682
716
  wrap: ""
683
717
  }, {
684
718
  default: l(() => [
685
- (k(!0), K(le, null, he(f.roles, (g) => (k(), S(e(ae), {
686
- key: g.id
719
+ (L(!0), O(le, null, _e(v.roles, (G) => (L(), S(e(ae), {
720
+ key: G.id
687
721
  }, {
688
722
  default: l(() => [
689
- L(C(g.name), 1)
723
+ F($(G.name), 1)
690
724
  ]),
691
725
  _: 2
692
726
  }, 1024))), 128))
693
727
  ]),
694
728
  _: 2
695
- }, 1024)) : (k(), S(e(Y), {
729
+ }, 1024)) : (L(), S(e(de), {
696
730
  key: 1,
697
731
  size: "sm",
698
732
  tone: "muted"
699
733
  }, {
700
734
  default: l(() => [
701
- L(C(e(u)("admins.no-roles")), 1)
735
+ F($(e(n)("admins.no-roles")), 1)
702
736
  ]),
703
737
  _: 1
704
738
  }))
705
739
  ]),
706
- "cell-is_active": l(({ row: f }) => [
707
- o(e(ae), {
708
- type: f.is_active ? "success" : "default",
740
+ "cell-is_active": l(({ row: v }) => [
741
+ t(e(ae), {
742
+ type: v.is_active ? "success" : "default",
709
743
  dot: ""
710
744
  }, {
711
745
  default: l(() => [
712
- L(C(f.is_active ? e(u)("admins.active") : e(u)("admins.only-inactive")), 1)
746
+ F($(v.is_active ? e(n)("admins.active") : e(n)("admins.only-inactive")), 1)
713
747
  ]),
714
748
  _: 2
715
749
  }, 1032, ["type"])
716
750
  ]),
717
- "card-actions": l(({ row: f }) => [
718
- a.removable ? (k(), S(e(ce), {
751
+ "card-actions": l(({ row: v }) => [
752
+ a.removable ? (L(), S(e(he), {
719
753
  key: 0,
720
- size: "sm",
721
- onClick: x[2] || (x[2] = te(() => {
722
- }, ["stop"]))
723
- }, {
724
- default: l(() => [
725
- o(e(me), {
726
- type: "remove",
727
- title: e(u)("admins.delete"),
728
- onClick: (g) => r("remove", f)
729
- }, null, 8, ["title", "onClick"])
730
- ]),
731
- _: 2
732
- }, 1024)) : P("", !0)
754
+ actions: c(v),
755
+ label: v.name
756
+ }, null, 8, ["actions", "label"])) : T("", !0)
733
757
  ]),
734
- "cell-actions": l(({ row: f }) => [
735
- o(e(ce), {
736
- size: "sm",
737
- onClick: x[3] || (x[3] = te(() => {
738
- }, ["stop"]))
739
- }, {
740
- default: l(() => [
741
- o(e(me), {
742
- type: "remove",
743
- title: e(u)("admins.delete"),
744
- onClick: (g) => r("remove", f)
745
- }, null, 8, ["title", "onClick"])
746
- ]),
747
- _: 2
748
- }, 1024)
758
+ "cell-actions": l(({ row: v }) => [
759
+ t(e(he), {
760
+ actions: c(v),
761
+ label: v.name
762
+ }, null, 8, ["actions", "label"])
749
763
  ]),
750
- "cell-last_login_at": l(({ row: f }) => [
751
- o(e(Y), {
752
- size: "sm",
753
- tone: f.last_login_at ? "default" : "muted"
754
- }, {
755
- default: l(() => [
756
- L(C(f.last_login_at ? new Date(f.last_login_at).toLocaleString() : e(u)("admins.never")), 1)
757
- ]),
758
- _: 2
759
- }, 1032, ["tone"])
764
+ "cell-last_login_at": l(({ row: v }) => [
765
+ t(e(Ne), {
766
+ value: v.last_login_at,
767
+ tone: v.last_login_at ? "default" : "muted"
768
+ }, null, 8, ["value", "tone"])
760
769
  ]),
761
770
  _: 2
762
771
  }, [
763
772
  a.filters ? {
764
773
  name: "actions",
765
774
  fn: l(() => [
766
- o(e(E), { size: "sm" }, {
775
+ t(e(Y), { size: "sm" }, {
767
776
  default: l(() => [
768
- o(e(H), {
777
+ t(e(X), {
769
778
  modelValue: d.value,
770
- "onUpdate:modelValue": x[0] || (x[0] = (f) => d.value = f),
771
- options: W.value,
779
+ "onUpdate:modelValue": y[0] || (y[0] = (v) => d.value = v),
780
+ options: f.value,
772
781
  size: "sm",
773
782
  style: { width: "180px" }
774
783
  }, null, 8, ["modelValue", "options"]),
775
- o(e(H), {
776
- modelValue: t.value,
777
- "onUpdate:modelValue": x[1] || (x[1] = (f) => t.value = f),
778
- options: T.value,
784
+ t(e(X), {
785
+ modelValue: w.value,
786
+ "onUpdate:modelValue": y[1] || (y[1] = (v) => w.value = v),
787
+ options: U.value,
779
788
  size: "sm",
780
789
  style: { width: "180px" }
781
790
  }, null, 8, ["modelValue", "options"])
@@ -785,73 +794,71 @@ const qe = { class: "wx-admin-form" }, He = { class: "wx-admin-form__grid" }, Ye
785
794
  ]),
786
795
  key: "0"
787
796
  } : void 0
788
- ]), 1032, ["data", "columns", "loading", "search-placeholder", "empty-text", "selectable"])
797
+ ]), 1032, ["data", "columns", "clickable", "hover", "loading", "search-placeholder", "empty-text", "selectable"])
789
798
  ]));
790
799
  }
791
- }), Xe = /* @__PURE__ */ R({
800
+ }), aa = /* @__PURE__ */ R({
792
801
  __name: "AdminsPage",
793
802
  props: {
794
803
  avatarField: { default: void 0 },
795
804
  resolveAvatar: { type: Function, default: void 0 }
796
805
  },
797
806
  setup(a) {
798
- const i = a, s = q(), n = se(s);
799
- Q();
800
- const r = I("webx-auth"), y = oe("list"), v = b(null), u = _e(Je), m = s.can("admins.manage");
801
- async function V(d) {
802
- v.value = d, await u({ admin: d, avatarField: i.avatarField }) && y.value?.reload();
807
+ const i = a, s = q(), o = pe(s);
808
+ J();
809
+ const u = I("webx-auth"), k = re(), m = oe("list"), n = g(null), p = ce(Ze), C = s.can("admins.manage"), V = P(
810
+ () => s.state.manifest?.modules.find((r) => r.id === "admins")?.title ?? u("admins.title")
811
+ );
812
+ async function d(r) {
813
+ n.value = r, await p({ admin: r, avatarField: i.avatarField }) && m.value?.reload();
803
814
  }
804
- async function _(d) {
805
- if (await Oe({
806
- title: r("admins.delete-title", { name: d.name }),
807
- message: r("admins.delete-text"),
808
- confirmText: r("admins.delete"),
809
- cancelText: r("admins.cancel"),
815
+ async function w(r) {
816
+ if (await Re({
817
+ title: u("admins.delete-title", { name: r.name }),
818
+ message: u("admins.delete-text"),
819
+ confirmText: u("admins.delete"),
820
+ cancelText: u("admins.cancel"),
810
821
  tone: "danger"
811
822
  }))
812
823
  try {
813
- await n.remove(d.id), G.success(r("admins.deleted")), y.value?.reload();
814
- } catch ($) {
815
- const A = $.body;
816
- G.danger(A?.message ?? r("errors.forbidden"));
824
+ await o.remove(r.id), j.success(u("admins.deleted")), m.value?.reload();
825
+ } catch (_) {
826
+ j.danger(k(_));
817
827
  }
818
828
  }
819
- return (d, t) => (k(), S(e(Ne), null, ne({
820
- header: l(() => [
821
- L(C(e(r)("admins.title")), 1)
822
- ]),
829
+ return (r, b) => (L(), S(e(Ee), { title: V.value }, ne({
823
830
  default: l(() => [
824
- o(Le, {
831
+ t(Ce, {
825
832
  ref_key: "list",
826
- ref: y,
827
- removable: e(m),
833
+ ref: m,
834
+ removable: e(C),
828
835
  "resolve-avatar": i.resolveAvatar,
829
- onOpen: V,
830
- onRemove: _
836
+ onOpen: d,
837
+ onRemove: w
831
838
  }, null, 8, ["removable", "resolve-avatar"])
832
839
  ]),
833
840
  _: 2
834
841
  }, [
835
- e(m) ? {
836
- name: "extra",
842
+ e(C) ? {
843
+ name: "actions",
837
844
  fn: l(() => [
838
- o(e(j), {
845
+ t(e(D), {
839
846
  type: "primary",
840
847
  icon: "add",
841
- onClick: t[0] || (t[0] = ($) => V(null))
848
+ onClick: b[0] || (b[0] = (_) => d(null))
842
849
  }, {
843
850
  default: l(() => [
844
- L(C(e(r)("admins.new-short")), 1)
851
+ F($(e(u)("admins.new-short")), 1)
845
852
  ]),
846
853
  _: 1
847
854
  })
848
855
  ]),
849
856
  key: "0"
850
857
  } : void 0
851
- ]), 1024));
858
+ ]), 1032, ["title"]));
852
859
  }
853
860
  });
854
- function na(a = {}) {
861
+ function fa(a = {}) {
855
862
  const i = a.path ?? "/admins";
856
863
  return {
857
864
  id: "admins",
@@ -861,7 +868,7 @@ function na(a = {}) {
861
868
  path: i,
862
869
  name: "webx.admins",
863
870
  component: {
864
- render: () => be(Xe, {
871
+ render: () => xe(aa, {
865
872
  avatarField: a.avatarField,
866
873
  resolveAvatar: a.resolveAvatar
867
874
  })
@@ -870,7 +877,7 @@ function na(a = {}) {
870
877
  ]
871
878
  };
872
879
  }
873
- const Ze = /* @__PURE__ */ R({
880
+ const ta = /* @__PURE__ */ R({
874
881
  __name: "AdminPicker",
875
882
  props: {
876
883
  multiple: { type: Boolean, default: !1 },
@@ -878,30 +885,30 @@ const Ze = /* @__PURE__ */ R({
878
885
  resolveAvatar: { type: Function, default: void 0 }
879
886
  },
880
887
  setup(a) {
881
- const i = a, { open: s, resolve: n, dismiss: r } = we();
882
- Q();
883
- const y = I("webx-auth"), v = oe("list"), u = b(0);
884
- function m(_) {
885
- n(_);
888
+ const i = a, { open: s, resolve: o, dismiss: u } = ie();
889
+ J();
890
+ const k = I("webx-auth"), m = oe("list"), n = g(0);
891
+ function p(V) {
892
+ o(V);
886
893
  }
887
- function V(_) {
888
- u.value = _.length;
894
+ function C(V) {
895
+ n.value = V.length;
889
896
  }
890
- return (_, d) => (k(), S(e(ge), {
897
+ return (V, d) => (L(), S(e(ue), {
891
898
  open: e(s),
892
- "onUpdate:open": d[2] || (d[2] = (t) => fe(s) ? s.value = t : null),
893
- title: a.title ?? e(y)(a.multiple ? "admins.select-many" : "admins.select-one"),
899
+ "onUpdate:open": d[2] || (d[2] = (w) => se(s) ? s.value = w : null),
900
+ title: a.title ?? e(k)(a.multiple ? "admins.select-many" : "admins.select-one"),
894
901
  width: 880
895
902
  }, ne({
896
903
  default: l(() => [
897
- o(Le, {
904
+ t(Ce, {
898
905
  ref_key: "list",
899
- ref: v,
906
+ ref: m,
900
907
  picking: "",
901
908
  multiple: a.multiple,
902
909
  "resolve-avatar": i.resolveAvatar,
903
- onChosen: m,
904
- onSelection: V
910
+ onChosen: p,
911
+ onSelection: C
905
912
  }, null, 8, ["multiple", "resolve-avatar"])
906
913
  ]),
907
914
  _: 2
@@ -909,36 +916,36 @@ const Ze = /* @__PURE__ */ R({
909
916
  a.multiple ? {
910
917
  name: "footer",
911
918
  fn: l(() => [
912
- o(e(E), {
919
+ t(e(Y), {
913
920
  size: "sm",
914
921
  align: "center"
915
922
  }, {
916
923
  default: l(() => [
917
- o(e(Y), {
924
+ t(e(de), {
918
925
  size: "sm",
919
926
  tone: "muted"
920
927
  }, {
921
928
  default: l(() => [
922
- L(C(e(y)("admins.chosen", { count: u.value })), 1)
929
+ F($(e(k)("admins.chosen", { count: n.value })), 1)
923
930
  ]),
924
931
  _: 1
925
932
  }),
926
- o(e(j), {
933
+ t(e(D), {
927
934
  variant: "outline",
928
- onClick: d[0] || (d[0] = (t) => e(r)())
935
+ onClick: d[0] || (d[0] = (w) => e(u)())
929
936
  }, {
930
937
  default: l(() => [
931
- L(C(e(y)("admins.cancel")), 1)
938
+ F($(e(k)("admins.cancel")), 1)
932
939
  ]),
933
940
  _: 1
934
941
  }),
935
- o(e(j), {
942
+ t(e(D), {
936
943
  type: "primary",
937
- disabled: u.value === 0,
938
- onClick: d[1] || (d[1] = (t) => e(n)(v.value?.chosen() ?? []))
944
+ disabled: n.value === 0,
945
+ onClick: d[1] || (d[1] = (w) => e(o)(m.value?.chosen() ?? []))
939
946
  }, {
940
947
  default: l(() => [
941
- L(C(e(y)("admins.save")), 1)
948
+ F($(e(k)("admins.save")), 1)
942
949
  ]),
943
950
  _: 1
944
951
  }, 8, ["disabled"])
@@ -950,131 +957,294 @@ const Ze = /* @__PURE__ */ R({
950
957
  } : void 0
951
958
  ]), 1032, ["open", "title"]));
952
959
  }
953
- }), $e = _e(Ze);
954
- async function sa(a = {}) {
955
- return (await $e({ ...a, multiple: !1 }))?.[0];
960
+ }), Ue = ce(ta);
961
+ async function wa(a = {}) {
962
+ return (await Ue({ ...a, multiple: !1 }))?.[0];
956
963
  }
957
- function ia(a = {}) {
958
- return $e({ ...a, multiple: !0 });
964
+ function ha(a = {}) {
965
+ return Ue({ ...a, multiple: !0 });
959
966
  }
960
- const ea = ["title"], aa = /* @__PURE__ */ R({
967
+ const la = { class: "wx-profile-host" }, oa = { class: "wx-profile" }, sa = {
968
+ key: 0,
969
+ class: "wx-profile__aside"
970
+ }, na = { class: "wx-profile__fields" }, ra = /* @__PURE__ */ R({
971
+ __name: "ProfileDialog",
972
+ props: {
973
+ avatarField: { default: void 0 }
974
+ },
975
+ setup(a) {
976
+ const i = a, { resolve: s, dismiss: o, open: u } = ie(), k = q(), m = me();
977
+ J();
978
+ const n = I("webx-auth"), p = re(), C = g(!1), V = g({}), d = g({
979
+ name: k.state.user?.name ?? "",
980
+ avatar: k.state.user?.avatar ?? null,
981
+ password: "",
982
+ current_password: ""
983
+ }), w = g(d.value.avatar ? { path: d.value.avatar } : null);
984
+ function r(_) {
985
+ return V.value[_]?.[0];
986
+ }
987
+ async function b() {
988
+ C.value = !0, V.value = {};
989
+ try {
990
+ await m.updateProfile({
991
+ name: d.value.name,
992
+ avatar: w.value?.path ?? null,
993
+ // Blank is left out entirely rather than sent as an empty string: the server reads a
994
+ // filled password as "change it", and an empty one would be a change to nothing.
995
+ ...d.value.password ? { password: d.value.password, current_password: d.value.current_password } : {}
996
+ }), j.success(n("profile.saved")), s(!0);
997
+ } catch (_) {
998
+ const f = _.body;
999
+ f?.errors ? V.value = f.errors : j.danger(p(_));
1000
+ } finally {
1001
+ C.value = !1;
1002
+ }
1003
+ }
1004
+ return (_, f) => (L(), S(e(ue), {
1005
+ open: e(u),
1006
+ "onUpdate:open": f[5] || (f[5] = (U) => se(u) ? u.value = U : null),
1007
+ title: e(n)("profile.title"),
1008
+ width: 560
1009
+ }, {
1010
+ footer: l(() => [
1011
+ t(e(D), {
1012
+ onClick: f[4] || (f[4] = (U) => e(o)())
1013
+ }, {
1014
+ default: l(() => [
1015
+ F($(e(n)("profile.cancel")), 1)
1016
+ ]),
1017
+ _: 1
1018
+ }),
1019
+ t(e(D), {
1020
+ type: "primary",
1021
+ loading: C.value,
1022
+ onClick: b
1023
+ }, {
1024
+ default: l(() => [
1025
+ F($(e(n)("profile.save")), 1)
1026
+ ]),
1027
+ _: 1
1028
+ }, 8, ["loading"])
1029
+ ]),
1030
+ default: l(() => [
1031
+ N("div", la, [
1032
+ N("div", oa, [
1033
+ i.avatarField ? (L(), O("div", sa, [
1034
+ (L(), S(ge(i.avatarField), {
1035
+ modelValue: w.value,
1036
+ "onUpdate:modelValue": f[0] || (f[0] = (U) => w.value = U),
1037
+ label: e(n)("profile.avatar"),
1038
+ aspect: "1/1",
1039
+ captions: !1
1040
+ }, null, 8, ["modelValue", "label"]))
1041
+ ])) : T("", !0),
1042
+ N("div", na, [
1043
+ t(e(M), {
1044
+ label: e(n)("profile.name"),
1045
+ error: r("name")
1046
+ }, {
1047
+ default: l(() => [
1048
+ t(e(E), {
1049
+ modelValue: d.value.name,
1050
+ "onUpdate:modelValue": f[1] || (f[1] = (U) => d.value.name = U),
1051
+ name: "name"
1052
+ }, null, 8, ["modelValue"])
1053
+ ]),
1054
+ _: 1
1055
+ }, 8, ["label", "error"]),
1056
+ t(e(M), {
1057
+ label: e(n)("admins.email")
1058
+ }, {
1059
+ default: l(() => [
1060
+ t(e(E), {
1061
+ "model-value": e(k).state.user?.email ?? "",
1062
+ readonly: ""
1063
+ }, null, 8, ["model-value"])
1064
+ ]),
1065
+ _: 1
1066
+ }, 8, ["label"]),
1067
+ t(e(M), {
1068
+ label: e(n)("profile.password"),
1069
+ help: e(n)("profile.password-hint"),
1070
+ error: r("password")
1071
+ }, {
1072
+ default: l(() => [
1073
+ t(e(E), {
1074
+ modelValue: d.value.password,
1075
+ "onUpdate:modelValue": f[2] || (f[2] = (U) => d.value.password = U),
1076
+ type: "password",
1077
+ autocomplete: "new-password"
1078
+ }, null, 8, ["modelValue"])
1079
+ ]),
1080
+ _: 1
1081
+ }, 8, ["label", "help", "error"]),
1082
+ d.value.password ? (L(), S(e(M), {
1083
+ key: 0,
1084
+ label: e(n)("profile.current-password"),
1085
+ help: e(n)("profile.current-password-hint"),
1086
+ error: r("current_password")
1087
+ }, {
1088
+ default: l(() => [
1089
+ t(e(E), {
1090
+ modelValue: d.value.current_password,
1091
+ "onUpdate:modelValue": f[3] || (f[3] = (U) => d.value.current_password = U),
1092
+ type: "password",
1093
+ autocomplete: "current-password"
1094
+ }, null, 8, ["modelValue"])
1095
+ ]),
1096
+ _: 1
1097
+ }, 8, ["label", "help", "error"])) : T("", !0)
1098
+ ])
1099
+ ])
1100
+ ])
1101
+ ]),
1102
+ _: 1
1103
+ }, 8, ["open", "title"]));
1104
+ }
1105
+ }), ia = /* @__PURE__ */ ve(ra, [["__scopeId", "data-v-9583a67a"]]), ua = ["title"], da = {
1106
+ key: 0,
1107
+ class: "wx-user-menu__name"
1108
+ }, ca = /* @__PURE__ */ R({
961
1109
  __name: "UserMenu",
962
1110
  props: {
963
1111
  signOutLabel: { default: void 0 },
964
- resolveAvatar: { type: Function, default: void 0 }
1112
+ resolveAvatar: { type: Function, default: void 0 },
1113
+ avatarField: { default: void 0 },
1114
+ expanded: { type: Boolean, default: !1 }
965
1115
  },
966
1116
  setup(a) {
967
- const i = a, s = q(), n = ke(), r = ye(), y = I("webx-auth"), v = B(() => s.state.user), u = B(
968
- () => r.state.panelLocales.length > 1 ? r.state.panelLocales : []
969
- ), m = pe(Ve, null), V = b(void 0);
970
- J(
971
- () => typeof v.value?.avatar == "string" ? v.value.avatar : null,
972
- async (d) => {
973
- const t = i.resolveAvatar ?? m;
974
- if (d === null || d === "" || t === null) {
1117
+ const i = a, s = q(), o = me(), u = ke(), k = I("webx-auth"), m = P(() => s.state.user), n = P(
1118
+ () => u.state.panelLocales.length > 1 ? u.state.panelLocales : []
1119
+ ), p = te(Ae, null), C = te(Le, null), V = g(void 0);
1120
+ Z(
1121
+ () => typeof m.value?.avatar == "string" ? m.value.avatar : null,
1122
+ async (b) => {
1123
+ const _ = i.resolveAvatar ?? p;
1124
+ if (b === null || b === "" || _ === null) {
975
1125
  V.value = void 0;
976
1126
  return;
977
1127
  }
978
- const $ = await t(d);
979
- v.value?.avatar === d && (V.value = $ ?? void 0);
1128
+ const f = await _(b);
1129
+ m.value?.avatar === b && (V.value = f ?? void 0);
980
1130
  },
981
1131
  { immediate: !0 }
982
1132
  );
983
- async function _(d) {
984
- d !== r.state.locale && await n.setLocale(d);
1133
+ const d = ce(ia);
1134
+ function w() {
1135
+ setTimeout(
1136
+ () => {
1137
+ d({ avatarField: i.avatarField ?? C ?? void 0 });
1138
+ },
1139
+ 0
1140
+ );
985
1141
  }
986
- return (d, t) => {
987
- const $ = F("wx-avatar"), A = F("wx-text"), U = F("wx-dropdown-item"), W = F("wx-divider"), T = F("wx-dropdown");
988
- return v.value !== null ? (k(), S(T, { key: 0 }, {
1142
+ async function r(b) {
1143
+ b !== u.state.locale && await o.setLocale(b);
1144
+ }
1145
+ return (b, _) => {
1146
+ const f = B("wx-avatar"), U = B("wx-text"), W = B("wx-dropdown-item"), z = B("wx-divider"), h = B("wx-dropdown");
1147
+ return m.value !== null ? (L(), S(h, { key: 0 }, {
989
1148
  trigger: l(() => [
990
- O("button", {
1149
+ N("button", {
991
1150
  type: "button",
992
- class: "wx-user-menu__trigger",
993
- title: v.value.name
1151
+ class: Te(["wx-user-menu__trigger", { "wx-user-menu__trigger--named": a.expanded }]),
1152
+ title: m.value.name
994
1153
  }, [
995
- o($, {
996
- name: v.value.name,
1154
+ t(f, {
1155
+ name: m.value.name,
997
1156
  src: V.value,
998
1157
  size: "lg"
999
- }, null, 8, ["name", "src"])
1000
- ], 8, ea)
1158
+ }, null, 8, ["name", "src"]),
1159
+ a.expanded ? (L(), O("span", da, $(m.value.name), 1)) : T("", !0)
1160
+ ], 10, ua)
1001
1161
  ]),
1002
1162
  default: l(() => [
1003
- o(U, { disabled: "" }, {
1163
+ t(W, { disabled: "" }, {
1004
1164
  default: l(() => [
1005
- o(A, { size: "sm" }, {
1165
+ t(U, { size: "sm" }, {
1006
1166
  default: l(() => [
1007
- L(C(v.value.email), 1)
1167
+ F($(m.value.email), 1)
1008
1168
  ]),
1009
1169
  _: 1
1010
1170
  })
1011
1171
  ]),
1012
1172
  _: 1
1013
1173
  }),
1014
- u.value.length > 0 ? (k(), K(le, { key: 0 }, [
1015
- o(W, { spacing: "sm" }),
1016
- o(U, { disabled: "" }, {
1174
+ t(z, { spacing: "sm" }),
1175
+ t(W, {
1176
+ icon: "user",
1177
+ onClick: w
1178
+ }, {
1179
+ default: l(() => [
1180
+ F($(e(k)("profile.menu")), 1)
1181
+ ]),
1182
+ _: 1
1183
+ }),
1184
+ n.value.length > 0 ? (L(), O(le, { key: 0 }, [
1185
+ t(z, { spacing: "sm" }),
1186
+ t(W, { disabled: "" }, {
1017
1187
  default: l(() => [
1018
- o(A, {
1188
+ t(U, {
1019
1189
  size: "sm",
1020
1190
  tone: "muted"
1021
1191
  }, {
1022
1192
  default: l(() => [
1023
- L(C(e(y)("menu.language")), 1)
1193
+ F($(e(k)("menu.language")), 1)
1024
1194
  ]),
1025
1195
  _: 1
1026
1196
  })
1027
1197
  ]),
1028
1198
  _: 1
1029
1199
  }),
1030
- (k(!0), K(le, null, he(u.value, (z) => (k(), S(U, {
1031
- key: z.code,
1032
- icon: z.code === e(r).state.locale ? "check" : void 0,
1033
- onClick: (c) => _(z.code)
1200
+ (L(!0), O(le, null, _e(n.value, (c) => (L(), S(W, {
1201
+ key: c.code,
1202
+ icon: c.code === e(u).state.locale ? "check" : void 0,
1203
+ onClick: (x) => r(c.code)
1034
1204
  }, {
1035
1205
  default: l(() => [
1036
- L(C(z.nativeName), 1)
1206
+ F($(c.nativeName), 1)
1037
1207
  ]),
1038
1208
  _: 2
1039
1209
  }, 1032, ["icon", "onClick"]))), 128)),
1040
- o(W, { spacing: "sm" })
1041
- ], 64)) : P("", !0),
1042
- o(U, {
1210
+ t(z, { spacing: "sm" })
1211
+ ], 64)) : T("", !0),
1212
+ t(W, {
1043
1213
  icon: "logout",
1044
- onClick: t[0] || (t[0] = (z) => e(n).logout())
1214
+ onClick: _[0] || (_[0] = (c) => e(o).logout())
1045
1215
  }, {
1046
1216
  default: l(() => [
1047
- L(C(a.signOutLabel ?? e(y)("menu.sign-out")), 1)
1217
+ F($(a.signOutLabel ?? e(k)("menu.sign-out")), 1)
1048
1218
  ]),
1049
1219
  _: 1
1050
1220
  })
1051
1221
  ]),
1052
1222
  _: 1
1053
- })) : P("", !0);
1223
+ })) : T("", !0);
1054
1224
  };
1055
1225
  }
1056
- }), ra = /* @__PURE__ */ Ae(aa, [["__scopeId", "data-v-d9c92170"]]);
1057
- function ua(a = {}) {
1226
+ }), ba = /* @__PURE__ */ ve(ca, [["__scopeId", "data-v-d51d13e4"]]);
1227
+ function ya(a = {}) {
1058
1228
  const i = a.path ?? "/login";
1059
1229
  return {
1060
1230
  install(s) {
1061
- const n = Ee(s.context);
1062
- s.i18n.defaults("webx-auth", Ce), Re(s.app, n, a.resolveAvatar ?? null), s.context.useSessionLoader(() => n.me()), s.router.addRoute({
1231
+ const o = Ie(s.context);
1232
+ s.i18n.defaults("webx-auth", $e), Ke(s.app, o, a.resolveAvatar ?? null, a.avatarField ?? null), s.context.useSessionLoader(() => o.me()), s.router.addRoute({
1063
1233
  path: i,
1064
1234
  name: "webx.login",
1065
1235
  meta: { public: !0 },
1066
- component: { render: () => be(je, { ...a.card }) }
1067
- }), s.router.beforeEach((r) => r.meta.public === !0 || s.context.state.status !== "unauthenticated" ? !0 : { path: i, query: r.fullPath === "/" ? {} : { next: r.fullPath } }), J(
1236
+ component: { render: () => xe(He, { ...a.card }) }
1237
+ }), s.router.beforeEach((u) => u.meta.public === !0 || s.context.state.status !== "unauthenticated" ? !0 : { path: i, query: u.fullPath === "/" ? {} : { next: u.fullPath } }), Z(
1068
1238
  () => s.context.state.status,
1069
- (r) => {
1070
- const y = s.router.currentRoute.value;
1071
- if (r === "unauthenticated" && y.path !== i) {
1072
- s.router.replace({ path: i, query: { next: y.fullPath } });
1239
+ (u) => {
1240
+ const k = s.router.currentRoute.value;
1241
+ if (u === "unauthenticated" && k.path !== i) {
1242
+ s.router.replace({ path: i, query: { next: k.fullPath } });
1073
1243
  return;
1074
1244
  }
1075
- if (r === "ready" && y.path === i) {
1076
- const v = y.query.next;
1077
- s.router.replace(typeof v == "string" ? v : "/");
1245
+ if (u === "ready" && k.path === i) {
1246
+ const m = k.query.next;
1247
+ s.router.replace(typeof m == "string" ? m : "/");
1078
1248
  }
1079
1249
  }
1080
1250
  );
@@ -1082,20 +1252,22 @@ function ua(a = {}) {
1082
1252
  };
1083
1253
  }
1084
1254
  export {
1085
- Le as WxAdminList,
1086
- Xe as WxAdminsPage,
1087
- je as WxLoginCard,
1088
- ra as WxUserMenu,
1089
- na as admins,
1090
- ua as auth,
1091
- xe as authKey,
1092
- Ce as authMessages,
1093
- Ve as avatarResolverKey,
1094
- se as createAdminsApi,
1095
- Ee as createAuthSession,
1096
- Re as provideAuth,
1097
- sa as selectAdmin,
1098
- ia as selectAdmins,
1099
- ke as useAuth
1255
+ Ce as WxAdminList,
1256
+ aa as WxAdminsPage,
1257
+ He as WxLoginCard,
1258
+ ia as WxProfileDialog,
1259
+ ba as WxUserMenu,
1260
+ fa as admins,
1261
+ ya as auth,
1262
+ Ve as authKey,
1263
+ $e as authMessages,
1264
+ Le as avatarFieldKey,
1265
+ Ae as avatarResolverKey,
1266
+ pe as createAdminsApi,
1267
+ Ie as createAuthSession,
1268
+ Ke as provideAuth,
1269
+ wa as selectAdmin,
1270
+ ha as selectAdmins,
1271
+ me as useAuth
1100
1272
  };
1101
1273
  //# sourceMappingURL=index.js.map