@wssto2/vue-core 0.4.27 → 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.
Files changed (144) hide show
  1. package/CHANGELOG.md +79 -0
  2. package/dist/{AccessGate.vue_vue_type_script_setup_true_lang-J5HoyGNJ.js → AccessGate.vue_vue_type_script_setup_true_lang-Nw1IsB8N.js} +1 -1
  3. package/dist/{ActionRow.vue_vue_type_script_setup_true_lang-QPvYudWc.js → ActionRow.vue_vue_type_script_setup_true_lang-BCgKzUvG.js} +1 -1
  4. package/dist/{Activity-xtkZq4vG.js → Activity-CoGI2_GL.js} +7 -7
  5. package/dist/{Changes-BPB8h56i.js → Changes-Cwfe6wbX.js} +6 -6
  6. package/dist/{CollectionPage.vue_vue_type_script_setup_true_lang-CVEYkb26.js → CollectionPage.vue_vue_type_script_setup_true_lang-CtvHtFLy.js} +5 -5
  7. package/dist/{DataTable.vue_vue_type_script_setup_true_lang-DcQQ-uQS.js → DataTable.vue_vue_type_script_setup_true_lang-BEvz5zqo.js} +1 -1
  8. package/dist/{DateField.vue_vue_type_script_setup_true_lang-CpuH0WTl.js → DateField.vue_vue_type_script_setup_true_lang-DRuWzSaX.js} +1 -1
  9. package/dist/{DeadLetters-DeYxkTMh.js → DeadLetters-DyA5Dqn0.js} +7 -7
  10. package/dist/{FormErrors.vue_vue_type_script_setup_true_lang-DGOSc-PS.js → FormErrors.vue_vue_type_script_setup_true_lang-D7edzNTL.js} +2 -2
  11. package/dist/{FormGroup.vue_vue_type_script_setup_true_lang-DSwSRsA5.js → FormGroup.vue_vue_type_script_setup_true_lang-BPchlRCl.js} +2 -2
  12. package/dist/{FormView.vue_vue_type_script_setup_true_lang-BUrYkjmF.js → FormView.vue_vue_type_script_setup_true_lang-CPSYV7iQ.js} +2 -2
  13. package/dist/{General-BLbn4BCc.js → General-DTEfxWls.js} +10 -10
  14. package/dist/MenuButton.vue_vue_type_script_setup_true_lang-AGbN9r5q.js +28 -0
  15. package/dist/{NewRolePage-B7DwFWPk.js → NewRolePage-CRZoUajV.js} +3 -3
  16. package/dist/{NumberField.vue_vue_type_script_setup_true_lang-DaE5BLm4.js → NumberField.vue_vue_type_script_setup_true_lang-ButMV_sf.js} +1 -1
  17. package/dist/ProfilePage-DLY81mvN.js +764 -0
  18. package/dist/RoleEditor.vue_vue_type_script_setup_true_lang-gXbxXG2R.js +325 -0
  19. package/dist/RolePage-B9t586Q8.js +314 -0
  20. package/dist/{RolesPage-B5RwSZ89.js → RolesPage-BRdG-OSL.js} +6 -6
  21. package/dist/{SectionNavigator.vue_vue_type_script_setup_true_lang-Dmv6TpCi.js → SectionNavigator.vue_vue_type_script_setup_true_lang-Cy9Oi0ts.js} +1 -1
  22. package/dist/{SegmentedField.vue_vue_type_script_setup_true_lang-Dg-_ZjgR.js → SegmentedField.vue_vue_type_script_setup_true_lang-BwyMvkis.js} +1 -1
  23. package/dist/{SelectField.vue_vue_type_script_setup_true_lang-C3FbRQW7.js → SelectField.vue_vue_type_script_setup_true_lang-BzQC1qDQ.js} +11 -12
  24. package/dist/SessionList.vue_vue_type_script_setup_true_lang-DhoTd5D7.js +133 -0
  25. package/dist/{Sessions-wEdUsK-U.js → Sessions-vGyUOnPG.js} +5 -5
  26. package/dist/SettingsPage-V8WeADZZ.js +632 -0
  27. package/dist/{SignIn-CK9rq8LQ.js → SignIn-C-3i8RG6.js} +7 -7
  28. package/dist/{SignInPage-BORsM1g4.js → SignInPage-D2NA3VKU.js} +4 -4
  29. package/dist/SignIns-eoYPB6kB.js +121 -0
  30. package/dist/{SwitchField.vue_vue_type_script_setup_true_lang-ALvJisiP.js → SwitchField.vue_vue_type_script_setup_true_lang-D_-HACqT.js} +1 -1
  31. package/dist/{TextField.vue_vue_type_script_setup_true_lang-CP2WeU36.js → TextField.vue_vue_type_script_setup_true_lang-DTAQPbW0.js} +2 -2
  32. package/dist/{TextareaField.vue_vue_type_script_setup_true_lang-BJ4__cvJ.js → TextareaField.vue_vue_type_script_setup_true_lang-DsjK2C9T.js} +1 -1
  33. package/dist/{TimeField.vue_vue_type_script_setup_true_lang-DBxKAWRo.js → TimeField.vue_vue_type_script_setup_true_lang-Cz7KhUqt.js} +1 -1
  34. package/dist/Timestamp.vue_vue_type_script_setup_true_lang-CutyQkJb.js +52 -0
  35. package/dist/{UserRecord-C1SzdpKu.js → UserRecord-BaQl2zzQ.js} +13 -13
  36. package/dist/{UsersList-B3hc683r.js → UsersList-BfXWgH5K.js} +9 -9
  37. package/dist/access/RoleCompareDialog.vue.d.ts +1 -1
  38. package/dist/access/RoleEditor.vue.d.ts +2 -0
  39. package/dist/access/constraints.d.ts +28 -0
  40. package/dist/access/context.d.ts +5 -0
  41. package/dist/access/feature.d.ts +17 -0
  42. package/dist/access/index.d.ts +3 -1
  43. package/dist/access/index.js +11 -9
  44. package/dist/access/refusals.d.ts +20 -2
  45. package/dist/app/index.js +6 -6
  46. package/dist/client/index.js +19 -11
  47. package/dist/{client-k9euDWF4.js → client-BHPFfBj3.js} +20 -20
  48. package/dist/collection/index.js +5 -5
  49. package/dist/content/Timestamp.vue.d.ts +3 -2
  50. package/dist/content/index.js +66 -37
  51. package/dist/{contributions-BVBZP5Jb.js → contributions-DVQPcjJz.js} +1 -1
  52. package/dist/{describeError-B-NMa--w.js → describeError-BqGAUZgX.js} +1 -1
  53. package/dist/{error-CD7x0Jrz.js → error-Bb_dr_Ay.js} +2 -2
  54. package/dist/{fieldMessages-6HVzSDqG.js → fieldMessages-DTXpWnBd.js} +7 -7
  55. package/dist/form/index.js +1235 -1412
  56. package/dist/{guards-BJZjc3FZ.js → guards-DRh4zmxO.js} +1 -1
  57. package/dist/{http-BFfkA7gN.js → http-D_pBg22D.js} +1 -1
  58. package/dist/i18n/index.d.ts +2 -2
  59. package/dist/i18n/index.js +30 -30
  60. package/dist/identity/index.d.ts +2 -0
  61. package/dist/identity/index.js +8 -6
  62. package/dist/identity/profile/DetailsFields.vue.d.ts +8 -0
  63. package/dist/identity/profile/{DetailsPanel.vue.d.ts → DetailsGroup.vue.d.ts} +4 -1
  64. package/dist/identity/profile/{EmailPanel.vue.d.ts → EmailGroup.vue.d.ts} +1 -1
  65. package/dist/identity/profile/SignInsGroup.vue.d.ts +2 -0
  66. package/dist/identity/profile/profileSections.d.ts +37 -0
  67. package/dist/identity/shared/SignInList.vue.d.ts +22 -0
  68. package/dist/identity/shared/deviceLabel.d.ts +7 -0
  69. package/dist/identity/useReturnToOwnAccount.d.ts +10 -0
  70. package/dist/identity/users/context.d.ts +3 -0
  71. package/dist/identity/users/feature.d.ts +3 -0
  72. package/dist/index-WkbzC_ee.js +745 -0
  73. package/dist/index-g-qbUeTk.js +630 -0
  74. package/dist/index-kqk7Mclb.js +480 -0
  75. package/dist/index.d.ts +1 -1
  76. package/dist/index.js +1 -1
  77. package/dist/modules/notification/entities.d.ts +19 -0
  78. package/dist/modules/notification/routes.d.ts +25 -1
  79. package/dist/modules/notification/schemas.d.ts +24 -0
  80. package/dist/{navigation-DpcDF0rX.js → navigation-DuQwti76.js} +1 -1
  81. package/dist/{neighbors-RVQ4O3Qv.js → neighbors-IMRQ4rkm.js} +22 -22
  82. package/dist/notifications/context.d.ts +24 -1
  83. package/dist/notifications/feature.d.ts +10 -1
  84. package/dist/notifications/index.d.ts +1 -1
  85. package/dist/notifications/index.js +1 -1
  86. package/dist/notifications/push/DevicesSection.vue.d.ts +12 -0
  87. package/dist/notifications/push/ThisDeviceSection.vue.d.ts +15 -0
  88. package/dist/notifications/push/browser.d.ts +40 -0
  89. package/dist/notifications/push/devices.d.ts +15 -0
  90. package/dist/notifications/push/thisDevice.d.ts +28 -0
  91. package/dist/notifications/settings/ChannelsSection.vue.d.ts +16 -0
  92. package/dist/notifications/settings/{QuietHoursPanel.vue.d.ts → QuietHoursSection.vue.d.ts} +3 -1
  93. package/dist/notifications/settings/SettingsBody.vue.d.ts +17 -0
  94. package/dist/notifications/settings/settings.d.ts +4 -3
  95. package/dist/notifications/settings/state.d.ts +4 -2
  96. package/dist/options-g8RwEhBk.js +366 -0
  97. package/dist/overlay/MenuButton.vue.d.ts +3 -2
  98. package/dist/overlay/index.js +37 -59
  99. package/dist/page/index.js +1 -1
  100. package/dist/phone/index.js +10 -11
  101. package/dist/platform/index.js +3 -3
  102. package/dist/{platform-PZpUkkMS.js → platform-Dl1fbScN.js} +2 -2
  103. package/dist/push-worker/index.d.ts +91 -0
  104. package/dist/push-worker/index.js +54 -0
  105. package/dist/resource/index.js +1 -1
  106. package/dist/{routeResource-DlTsGTg_.js → routeResource-CcYA75T2.js} +2 -2
  107. package/dist/router/index.js +3 -3
  108. package/dist/{rowLayout-Dh749umr.js → rowLayout-BBFyLbOl.js} +1 -1
  109. package/dist/{sections-CeZl-Jxg.js → sections-D5rgQ4YB.js} +1 -1
  110. package/dist/shell/index.js +3 -3
  111. package/dist/signInEvents-DWShrJox.js +30 -0
  112. package/dist/state/index.js +1 -1
  113. package/dist/{status-D9iQJJiz.js → status-C2gHqkj6.js} +2 -2
  114. package/dist/styles.css +1 -1
  115. package/dist/{suggestions-DHJFKB26.js → suggestions-CfFTHi8y.js} +2 -2
  116. package/dist/testing/index.js +1 -1
  117. package/dist/{useCommand-Cj-APj-P.js → useCommand-CtqheKUv.js} +2 -2
  118. package/dist/useGroupSheet-ATvc0IiM.js +278 -0
  119. package/dist/{useLoad-M7V-AVwR.js → useLoad-W4tfxmm5.js} +1 -1
  120. package/dist/{useResourceForm-tGYTfKhH.js → useResourceForm-CJfl8rj_.js} +1 -1
  121. package/package.json +6 -2
  122. package/dist/KeyValue.vue_vue_type_script_setup_true_lang-wcZcvnow.js +0 -35
  123. package/dist/OtpInput.vue_vue_type_script_setup_true_lang-gp4FfWAH.js +0 -95
  124. package/dist/PanelActions.vue_vue_type_script_setup_true_lang-E9VdIGkf.js +0 -46
  125. package/dist/ProfilePage-CQYHj9Ns.js +0 -654
  126. package/dist/RoleEditor.vue_vue_type_script_setup_true_lang-DRHmjA9w.js +0 -300
  127. package/dist/RolePage-ODFu68Ce.js +0 -315
  128. package/dist/SessionList.vue_vue_type_script_setup_true_lang-D5qm77Zo.js +0 -111
  129. package/dist/SettingsPage-BVrMihx0.js +0 -255
  130. package/dist/SignInTable.vue_vue_type_script_setup_true_lang-AakWNvaM.js +0 -79
  131. package/dist/SignIns-C-8kVf7I.js +0 -66
  132. package/dist/Timestamp.vue_vue_type_script_setup_true_lang-DRmzPDOP.js +0 -51
  133. package/dist/control-B4SdblL6.js +0 -350
  134. package/dist/identity/profile/PanelActions.vue.d.ts +0 -17
  135. package/dist/index-C3E6DcO0.js +0 -706
  136. package/dist/index-LP6NNnow.js +0 -459
  137. package/dist/index-qUaGJ9j2.js +0 -504
  138. package/dist/notifications/settings/EmailPanel.vue.d.ts +0 -14
  139. package/dist/options-Ba_0uLWN.js +0 -18
  140. package/dist/route-goWMxDUN.js +0 -13
  141. package/dist/transport-BnP7WC0Y.js +0 -4
  142. /package/dist/identity/{profile/PasswordPanel.vue.d.ts → ReturnMenuItem.vue.d.ts} +0 -0
  143. /package/dist/identity/profile/{SessionsPanel.vue.d.ts → PasswordGroup.vue.d.ts} +0 -0
  144. /package/dist/identity/profile/{SignInsPanel.vue.d.ts → SessionsGroup.vue.d.ts} +0 -0
@@ -1,459 +0,0 @@
1
- import { r as i } from "./route-goWMxDUN.js";
2
- import { d as H, p as Y } from "./feature-DdUAfyi4.js";
3
- import { k as ie } from "./keepAlive-CDvMQlcJ.js";
4
- import { d as z } from "./defineRoutes-BGAdiIrt.js";
5
- import { d as I } from "./context-Ch1r4fdN.js";
6
- import { defineComponent as E, computed as b, watch as $, openBlock as x, createElementBlock as G, ref as D, useTemplateRef as oe, watchEffect as re, onBeforeUnmount as ae, createVNode as _, unref as o, createElementVNode as m, toDisplayString as f, createCommentVNode as F, useId as ce, createBlock as N, Teleport as ue, normalizeClass as j, createTextVNode as O, withCtx as T, mergeProps as le, h as me } from "vue";
7
- import { u as pe } from "./environment-Dva-SG8D.js";
8
- import { u as P } from "./describeError-B-NMa--w.js";
9
- import { t as k } from "./toast-CqSDTWRX.js";
10
- import { u as A, h as q, f as M } from "./platform-PZpUkkMS.js";
11
- import { a as R } from "./error-CD7x0Jrz.js";
12
- import { useI18n as C } from "vue-i18n";
13
- import { useRouter as J, useRoute as de } from "vue-router";
14
- import { _ as Q } from "./Icon.vue_vue_type_script_lang-D7oC-d-S.js";
15
- import { _ as L } from "./Button.vue_vue_type_script_setup_true_lang-CL9Qh5yq.js";
16
- import { u as fe } from "./leaveGuard-Cc8yeLxM.js";
17
- import { _ as he } from "./FormView.vue_vue_type_script_setup_true_lang-BUrYkjmF.js";
18
- import { _ as ye } from "./TextField.vue_vue_type_script_setup_true_lang-CP2WeU36.js";
19
- import { u as ge } from "./mediaQuery-CygcXmFW.js";
20
- import { u as ve } from "./useDialog-CXR3hN0G.js";
21
- import { c as _e } from "./closeOverlays-CjVsIrpL.js";
22
- import { u as be } from "./FormErrors.vue_vue_type_script_setup_true_lang-DGOSc-PS.js";
23
- import { u as we } from "./format-D8X4zsx6.js";
24
- import { _ as xe } from "./AccountMenuItem.vue_vue_type_script_setup_true_lang-CPeNxh5K.js";
25
- import { b as Ee } from "./routeResource-DlTsGTg_.js";
26
- import { _ as Se } from "./AccessGate.vue_vue_type_script_setup_true_lang-J5HoyGNJ.js";
27
- const w = {
28
- login: i("POST", "/v1/auth/login", { public: !0 }),
29
- refresh: i("POST", "/v1/auth/refresh", { public: !0 }),
30
- logout: i("POST", "/v1/auth/logout"),
31
- me: i("GET", "/v1/auth/me"),
32
- changeLocale: i("POST", "/v1/auth/change-locale"),
33
- loginAs: i("POST", "/v1/auth/login-as"),
34
- loginAsReturn: i("POST", "/v1/auth/login-as/return"),
35
- usersList: i("GET", "/v1/iam/users", { permission: "iam.user:view" }),
36
- usersShow: i("GET", "/v1/iam/users/:id", { permission: "iam.user:view" }),
37
- usersCreate: i("POST", "/v1/iam/users", { permission: "iam.user:manage" }),
38
- usersUpdate: i("PUT", "/v1/iam/users/:id", { permission: "iam.user:manage" }),
39
- usersSetPassword: i("PUT", "/v1/iam/users/:id/password", { permission: "iam.user:manage" }),
40
- usersDeactivate: i("POST", "/v1/iam/users/:id/deactivate", { permission: "iam.user:manage" }),
41
- usersActivate: i("POST", "/v1/iam/users/:id/activate", { permission: "iam.user:manage" }),
42
- usersUnlock: i("POST", "/v1/iam/users/:id/unlock", { permission: "iam.user:manage" }),
43
- usersSignins: i("GET", "/v1/iam/users/:id/signins", { permission: "iam.user:view" }),
44
- usersChanges: i("GET", "/v1/iam/users/:id/changes", { permission: "iam.user:view" }),
45
- usersActivity: i("GET", "/v1/iam/users/:id/activity", { permission: "iam.user.activity:view" }),
46
- usersSessions: i("GET", "/v1/iam/users/:id/sessions", { permission: "iam.user:view" }),
47
- usersRevokeSession: i("DELETE", "/v1/iam/users/:id/sessions/:session_id", { permission: "iam.user:manage" }),
48
- usersRevokeSessions: i("DELETE", "/v1/iam/users/:id/sessions", { permission: "iam.user:manage" }),
49
- profileShow: i("GET", "/v1/iam/profile"),
50
- profileUpdate: i("PUT", "/v1/iam/profile"),
51
- profileChangePassword: i("PUT", "/v1/iam/profile/password"),
52
- profileRequestEmail: i("POST", "/v1/iam/profile/email"),
53
- profileResendEmail: i("POST", "/v1/iam/profile/email/resend"),
54
- profileConfirmEmail: i("POST", "/v1/iam/profile/email/confirm"),
55
- profileCancelEmail: i("DELETE", "/v1/iam/profile/email"),
56
- profileSignins: i("GET", "/v1/iam/profile/signins"),
57
- profileSessions: i("GET", "/v1/iam/profile/sessions"),
58
- profileRevokeSession: i("DELETE", "/v1/iam/profile/sessions/:session_id")
59
- }, [Te, X] = I("vue-core.identity"), K = (e) => R(e) && e.kind === "unauthorized";
60
- function ke(e) {
61
- if (!R(e) || e.code !== "identity.signin.locked") return null;
62
- const s = e.params?.locked_until, t = typeof s == "string" ? new Date(s) : null;
63
- return t && !Number.isNaN(t.getTime()) ? t : null;
64
- }
65
- async function Pe({ http: e, session: s }, t) {
66
- await e.request(w.login, t, { handleUnauthorized: !1 }), await V({ session: s });
67
- }
68
- async function V({ session: e }) {
69
- const s = await e.refresh();
70
- if (s.status === "failed") throw s.error;
71
- if (s.status !== "authenticated") throw new Error("The server accepted the request but reports nobody signed in.");
72
- }
73
- async function Ae(e, s) {
74
- await e.http.request(w.loginAs, { user_id: s }), await V(e);
75
- }
76
- async function Ce(e) {
77
- await e.http.request(w.loginAsReturn), await V(e);
78
- }
79
- const Oe = { hidden: "" }, Ie = /* @__PURE__ */ E({
80
- __name: "LocaleSync",
81
- setup(e) {
82
- const { http: s, session: t } = A(), n = pe(), d = P(), g = b(() => {
83
- const r = t.state.value, a = r.status === "authenticated" ? r.user.locale : void 0;
84
- return typeof a == "string" ? a : null;
85
- });
86
- let u = null;
87
- return $(g, async (r) => {
88
- u = r, r !== null && r !== n.locale.value && n.locales.includes(r) && await n.setLocale(r);
89
- }, { immediate: !0 }), $(n.locale, async (r) => {
90
- if (!(t.state.value.status !== "authenticated" || r === u))
91
- try {
92
- await s.request(w.changeLocale, { locale: r }), u = r;
93
- } catch (a) {
94
- K(a) || k.error(d(a));
95
- }
96
- }), (r, a) => (x(), G("span", Oe));
97
- }
98
- }), Re = { class: "min-w-0 flex-1" }, Ke = { class: "hidden md:inline" }, Ue = { class: "md:hidden" }, $e = ["disabled"], qe = /* @__PURE__ */ E({
99
- __name: "ImpersonationBanner",
100
- setup(e) {
101
- const { t: s } = C(), t = A(), n = J(), { home: d } = X(), g = P(), u = b(() => q(t.session.state.value)?.impersonator ?? null), r = b(() => {
102
- const l = q(t.session.state.value)?.user;
103
- return typeof l?.name == "string" ? l.name : typeof l?.login == "string" ? l.login : String(l?.id ?? "");
104
- }), a = D(!1), p = oe("strip");
105
- let c = null;
106
- re(() => {
107
- c?.disconnect(), c = null;
108
- const l = p.value;
109
- if (!l) return void document.documentElement.style.removeProperty("--shell-banner-h");
110
- if (typeof ResizeObserver > "u") return;
111
- const v = () => document.documentElement.style.setProperty("--shell-banner-h", `${l.offsetHeight}px`);
112
- c = new ResizeObserver(v), c.observe(l), v();
113
- }, { flush: "post" }), ae(() => {
114
- c?.disconnect(), document.documentElement.style.removeProperty("--shell-banner-h");
115
- });
116
- async function h() {
117
- a.value = !0;
118
- try {
119
- await Ce(t), await n.push(d);
120
- } catch (l) {
121
- K(l) || k.error(g(l)), t.session.refresh();
122
- } finally {
123
- a.value = !1;
124
- }
125
- }
126
- return (l, v) => u.value ? (x(), G("div", {
127
- key: 0,
128
- ref_key: "strip",
129
- ref: p,
130
- role: "status",
131
- "data-impersonation-banner": "",
132
- class: "sticky top-0 z-40 flex flex-wrap items-center gap-x-3 gap-y-1.5 bg-status-warning-surface px-4 py-2 text-subheadline text-status-warning-content shadow-[inset_0_-1px_0_rgb(154_74_7/0.25)]"
133
- }, [
134
- _(o(Q), {
135
- name: "informationLine",
136
- size: 18,
137
- class: "shrink-0 compact:hidden"
138
- }),
139
- m("span", Re, [
140
- m("span", Ke, f(o(s)("core.identity.impersonation.banner", { name: r.value })), 1),
141
- m("span", Ue, f(o(s)("core.identity.impersonation.banner_short", { name: r.value })), 1)
142
- ]),
143
- m("button", {
144
- type: "button",
145
- disabled: a.value,
146
- class: "hit-target cursor-pointer rounded-control bg-status-warning-solid px-3 py-1 text-footnote font-semibold whitespace-nowrap text-white transition duration-motion-fast hover:brightness-110 disabled:opacity-45",
147
- onClick: h
148
- }, f(o(s)("core.identity.impersonation.return")), 9, $e)
149
- ], 512)) : F("", !0);
150
- }
151
- });
152
- function Le(e = {}) {
153
- const { t: s } = C(), t = A(), n = we(), d = P(), u = be({
154
- defaults: () => ({ login: e.login ?? "", password: "" }),
155
- validator: {
156
- safeParse(a) {
157
- const p = a, c = ["login", "password"].filter((h) => p[h] === "").map((h) => ({ path: [h], message: s("core.identity.signin.required") }));
158
- return c.length === 0 ? { success: !0, data: p } : { success: !1, error: { issues: c } };
159
- }
160
- },
161
- failureMessage(a, p) {
162
- const c = ke(p);
163
- return c ? s("core.errors.identity.signin.locked", { locked_until: n.time(c) }) : R(p) ? d(p) : void 0;
164
- }
165
- }), r = b(() => u.errors.first("password") ?? (u.failure.value?.error ? u.failure.value.message : void 0));
166
- return { form: u, passwordError: r, submit: async () => (await u.submit((a) => Pe(t, a))).status === "saved" };
167
- }
168
- const ze = ["aria-labelledby"], Ge = ["id"], De = { class: "mt-1 text-subheadline text-content-muted" }, Fe = { class: "flex items-center gap-2 rounded-control bg-status-success-surface px-2.5 py-2 text-footnote text-status-success-content" }, Ne = { class: "flex flex-col gap-1.5" }, Ve = { class: "text-footnote text-content-muted" }, Be = {
169
- class: "rounded-control bg-fill px-2.5 py-2 text-body text-content-muted",
170
- "data-expiry-login": ""
171
- }, je = /* @__PURE__ */ E({
172
- __name: "SessionExpiry",
173
- setup(e) {
174
- const { t: s } = C(), { session: t } = A(), n = de(), d = fe(), g = P(), u = ge(), r = ce(), a = b(() => {
175
- const y = t.state.value, S = y.status === "anonymous" && y.reason === "expired" ? y.previous?.user : void 0;
176
- return typeof S?.login == "string" ? S.login : null;
177
- }), p = b(() => a.value !== null && n.meta.public !== !0), c = D(null), h = ve(c, { onEscape: () => {
178
- } }), { isOpen: l } = h, { form: v, passwordError: se, submit: te } = Le({ login: a.value ?? "" });
179
- $(p, (y) => {
180
- y ? (v.hydrate({ login: a.value ?? "", password: "" }), _e(), k.dismiss(), h.present()) : h.dismissWithoutAsking();
181
- }, { immediate: !0, flush: "post" });
182
- async function ne() {
183
- if (!(d.hasUnsavedChanges() && !await d.confirm()))
184
- try {
185
- await t.signOut();
186
- } catch (y) {
187
- K(y) || k.error(g(y));
188
- }
189
- }
190
- return (y, S) => (x(), N(ue, { to: "body" }, [
191
- o(l) ? (x(), G("div", {
192
- key: 0,
193
- class: "relative z-10000",
194
- role: "alertdialog",
195
- "aria-modal": "true",
196
- "aria-labelledby": o(r),
197
- "data-session-expiry": ""
198
- }, [
199
- S[0] || (S[0] = m("div", {
200
- class: "fixed inset-0 bg-scrim",
201
- "aria-hidden": "true"
202
- }, null, -1)),
203
- m("div", {
204
- class: j(["fixed inset-0 flex p-4", o(u) ? "items-end p-0" : "items-center justify-center"])
205
- }, [
206
- m("div", {
207
- ref_key: "panel",
208
- ref: c,
209
- tabindex: "-1",
210
- class: j(["flex w-full flex-col gap-4 bg-surface-overlay p-6 shadow-float outline-none", o(u) ? "rounded-t-2xl pb-[max(2rem,var(--app-safe-bottom))]" : "max-w-sm rounded-menu"])
211
- }, [
212
- m("div", null, [
213
- m("h2", {
214
- id: o(r),
215
- class: "text-headline font-semibold text-content-strong"
216
- }, f(o(s)("core.identity.expired.title")), 9, Ge),
217
- m("p", De, f(o(s)("core.identity.expired.body")), 1)
218
- ]),
219
- m("p", Fe, [
220
- _(o(Q), {
221
- name: "checkboxCircleFill",
222
- size: 16,
223
- class: "shrink-0"
224
- }),
225
- O(" " + f(o(s)("core.identity.expired.kept")), 1)
226
- ]),
227
- _(o(he), { onSubmit: o(te) }, {
228
- default: T(() => [
229
- m("div", Ne, [
230
- m("span", Ve, f(o(s)("core.identity.username")), 1),
231
- m("span", Be, f(a.value), 1)
232
- ]),
233
- _(o(ye), le(o(v).bind("password"), {
234
- label: o(s)("core.identity.signin.password"),
235
- type: "password",
236
- autocomplete: "current-password",
237
- required: "",
238
- error: o(se)
239
- }), null, 16, ["label", "error"]),
240
- _(o(L), {
241
- type: "submit",
242
- prominence: "primary",
243
- class: "w-full",
244
- processing: o(v).submitting.value
245
- }, {
246
- default: T(() => [
247
- O(f(o(s)("core.identity.signin.submit")), 1)
248
- ]),
249
- _: 1
250
- }, 8, ["processing"])
251
- ]),
252
- _: 1
253
- }, 8, ["onSubmit"]),
254
- _(o(L), {
255
- prominence: "plain",
256
- class: "self-center",
257
- onClick: ne
258
- }, {
259
- default: T(() => [
260
- O(f(o(s)("core.identity.expired.sign_out")), 1)
261
- ]),
262
- _: 1
263
- })
264
- ], 2)
265
- ], 2)
266
- ], 8, ze)) : F("", !0)
267
- ]));
268
- }
269
- }), Me = (e) => typeof e == "object" && e !== null && !Array.isArray(e), We = (e) => {
270
- if (!Me(e)) throw new TypeError("expected an object");
271
- if (typeof e.id != "number") throw new TypeError("id: expected a number");
272
- for (const s of ["login", "name", "email", "locale"])
273
- if (typeof e[s] != "string") throw new TypeError(`${s}: expected a string`);
274
- return { id: e.id, login: e.login, name: e.name, email: e.email, locale: e.locale };
275
- }, U = (e) => R(e) && e.kind === "unauthorized", B = (e, s) => e.request(w.refresh, { refresh_token: "" }, { signal: s, handleUnauthorized: !1 });
276
- function He(e, s) {
277
- return {
278
- async load(t) {
279
- try {
280
- const { data: n } = await e.request(w.me, void 0, { signal: t, handleUnauthorized: !1 });
281
- return M(n, s);
282
- } catch (n) {
283
- if (!U(n)) throw n;
284
- }
285
- try {
286
- const { data: n } = await B(e, t);
287
- return M(n, s);
288
- } catch (n) {
289
- if (U(n)) return null;
290
- throw n;
291
- }
292
- },
293
- async signOut() {
294
- try {
295
- await e.request(w.logout, void 0, { handleUnauthorized: !1 });
296
- } catch (t) {
297
- if (!U(t)) throw t;
298
- }
299
- }
300
- };
301
- }
302
- function Cs(e) {
303
- const s = e?.parseUser ?? We;
304
- return {
305
- session: (n) => He(n, s),
306
- async renewSession(n, d) {
307
- try {
308
- return await B(d), (await n.refresh()).status === "authenticated";
309
- } catch {
310
- return !1;
311
- }
312
- }
313
- };
314
- }
315
- const Ye = async (e) => {
316
- await B(e.http);
317
- }, Je = z({
318
- login: { name: "login", path: "/login", component: () => import("./SignInPage-BORsM1g4.js"), meta: { public: !0, titleKey: "core.identity.signin.title" } }
319
- });
320
- function Os(e = {}) {
321
- return H({
322
- id: "identity",
323
- routes: Je.records,
324
- context: Y(Te, { home: e.home ?? "/" }),
325
- holdsExpiredSession: !0,
326
- contributions: [
327
- // Not optional: a shell without a `host` could not ask for the password, and the person would be stuck on a dead page.
328
- { id: "identity.expiry", slot: "host", component: je, scope: "always" },
329
- // Not optional either: acting as somebody else must always be visible.
330
- { id: "identity.impersonation", slot: "banner", component: qe, scope: "authenticated" },
331
- { id: "identity.locale", slot: "host", component: Ie, scope: "authenticated", optional: !0 }
332
- ],
333
- effects: [ie({ renew: Ye })]
334
- });
335
- }
336
- const Z = z({
337
- index: { name: "profile", path: "/profile", component: () => import("./ProfilePage-CQYHj9Ns.js"), meta: { titleKey: "core.profile.title" } }
338
- }), Qe = /* @__PURE__ */ E({
339
- __name: "ProfileMenuItem",
340
- setup(e) {
341
- const { t: s } = C();
342
- return (t, n) => (x(), N(xe, {
343
- label: o(s)("core.profile.menu"),
344
- icon: "user3Line",
345
- to: o(Z).index,
346
- "data-profile-menu-item": ""
347
- }, null, 8, ["label", "to"]));
348
- }
349
- }), [Xe, Is] = I("vue-core.users"), Ze = Symbol("vue-core.users.person"), [Rs, Ks] = I("vue-core.users.personActions"), [Us, $s] = I("vue-core.users.personSessions");
350
- function es(e) {
351
- const s = E({
352
- name: `PersonSection(${e.path})`,
353
- setup() {
354
- const t = Ee(Ze);
355
- return () => t.data.value ? me(e.component, e.props?.(t.data.value) ?? {}) : null;
356
- }
357
- });
358
- return { name: `users.record.${e.path}`, path: e.path, component: s, meta: { ...e.meta } };
359
- }
360
- const W = "iam.user:view", qs = "iam.user:manage", ss = "iam.user.activity:view", ee = z({
361
- index: { name: "users.index", path: "/users", component: () => import("./UsersList-B3hc683r.js"), meta: { access: W, titleKey: "core.users.title" } },
362
- record: {
363
- name: "users.record",
364
- path: "/users/:id",
365
- component: () => import("./UserRecord-C1SzdpKu.js"),
366
- meta: { access: W, titleKey: "core.users.title", remountOnParam: "id" },
367
- children: [
368
- { name: "users.record.general", path: "general", component: () => import("./General-BLbn4BCc.js"), meta: { section: { labelKey: "core.users.sections.general", icon: "user3Line", groupKey: "core.users.section_groups.person" } } },
369
- { name: "users.record.signin", path: "signin", component: () => import("./SignIn-CK9rq8LQ.js"), meta: { section: { labelKey: "core.users.sections.signin", icon: "key2Line", groupKey: "core.users.section_groups.access" } } },
370
- { name: "users.record.sessions", path: "sessions", component: () => import("./Sessions-wEdUsK-U.js"), meta: { section: { labelKey: "core.users.sections.sessions", icon: "deviceLine", groupKey: "core.users.section_groups.access" } } },
371
- { name: "users.record.signins", path: "signins", component: () => import("./SignIns-C-8kVf7I.js"), meta: { section: { labelKey: "core.users.sections.signins", icon: "timeFill", groupKey: "core.users.section_groups.activity" } } },
372
- { name: "users.record.changes", path: "changes", component: () => import("./Changes-BPB8h56i.js"), meta: { section: { labelKey: "core.users.sections.changes", icon: "edit", groupKey: "core.users.section_groups.activity" } } },
373
- { name: "users.record.activity", path: "activity", component: () => import("./Activity-xtkZq4vG.js"), meta: { access: ss, section: { labelKey: "core.users.sections.activity", icon: "listCheck", groupKey: "core.users.section_groups.activity" } } }
374
- ]
375
- }
376
- });
377
- function ts(e) {
378
- return ee.records.map((s) => s.name === "users.record" ? { ...s, children: [...s.children ?? [], ...e.map(es)] } : s);
379
- }
380
- function Ls(e = {}) {
381
- const s = e.people ?? !0, t = e.profile ?? !0, n = e.signInAs ?? "iam.user:impersonate";
382
- return H({
383
- id: "users",
384
- routes: [...s ? ts(e.sections ?? []) : [], ...t ? Z.records : []],
385
- context: Y(Xe, { signInAs: n, activityAreas: e.activityAreas ?? {} }),
386
- navigation: s && e.destination ? [{ destination: e.destination, to: ee.index, within: ["users.record"] }] : [],
387
- // The entry of the account menu; a shell without that menu leaves it out.
388
- contributions: t ? [{ id: "users.profile", slot: "accountMenu", component: Qe, scope: "authenticated", optional: !0, order: -10 }] : [],
389
- requires: s && n !== !1 ? ["identity"] : []
390
- });
391
- }
392
- const zs = /* @__PURE__ */ E({
393
- __name: "SignInAsButton",
394
- props: {
395
- userId: {},
396
- name: {},
397
- permission: {}
398
- },
399
- setup(e) {
400
- const s = e, { t } = C(), n = A(), d = J(), { home: g } = X(), u = P(), r = D(!1), a = b(() => {
401
- const c = q(n.session.state.value);
402
- return c !== null && c.impersonator === void 0 && c.user.id !== s.userId;
403
- });
404
- async function p() {
405
- r.value = !0;
406
- try {
407
- await Ae(n, s.userId), await d.push(g);
408
- } catch (c) {
409
- K(c) || k.error(u(c));
410
- } finally {
411
- r.value = !1;
412
- }
413
- }
414
- return (c, h) => a.value ? (x(), N(o(Se), {
415
- key: 0,
416
- permission: s.permission
417
- }, {
418
- default: T(() => [
419
- _(o(L), {
420
- processing: r.value,
421
- "data-sign-in-as": "",
422
- onClick: p
423
- }, {
424
- default: T(() => [
425
- O(f(o(t)("core.identity.impersonation.sign_in_as", { name: s.name })), 1)
426
- ]),
427
- _: 1
428
- }, 8, ["processing"])
429
- ]),
430
- _: 1
431
- }, 8, ["permission"])) : F("", !0);
432
- }
433
- });
434
- export {
435
- qs as M,
436
- Ze as P,
437
- zs as _,
438
- Le as a,
439
- Ks as b,
440
- Is as c,
441
- K as d,
442
- $s as e,
443
- ee as f,
444
- Rs as g,
445
- Os as h,
446
- w as i,
447
- Cs as j,
448
- He as k,
449
- ke as l,
450
- We as m,
451
- Z as n,
452
- Ce as o,
453
- Us as p,
454
- Ae as q,
455
- Ye as r,
456
- Pe as s,
457
- Ls as t,
458
- X as u
459
- };