@wssto2/vue-core 0.9.3 → 0.10.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 (162) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/ActionRow.vue_vue_type_script_setup_true_lang-IpcP3Bjc.js +87 -0
  3. package/dist/Activity-CeAG0ZtJ.js +169 -0
  4. package/dist/{AdaptivePageShell.vue_vue_type_script_setup_true_lang-DdJOodn8.js → AdaptivePageShell.vue_vue_type_script_setup_true_lang-D5i77H6S.js} +147 -159
  5. package/dist/{AsyncSection.vue_vue_type_script_setup_true_lang-BdeOKqz_.js → AsyncSection.vue_vue_type_script_setup_true_lang-DGzQ-Snp.js} +1 -1
  6. package/dist/BottomDockPortal.vue_vue_type_script_setup_true_lang-DmwR-2SP.js +17 -0
  7. package/dist/Button.vue_vue_type_script_setup_true_lang-C74hcb0N.js +123 -0
  8. package/dist/Changes-B9-zpDxG.js +69 -0
  9. package/dist/{CollectionPage.vue_vue_type_script_setup_true_lang-DHcekGNn.js → CollectionPage.vue_vue_type_script_setup_true_lang-Cn0YOWJF.js} +19 -18
  10. package/dist/{DataTable.vue_vue_type_script_setup_true_lang-8kBsNRuq.js → DataTable.vue_vue_type_script_setup_true_lang-BQRG8bpH.js} +1 -1
  11. package/dist/{DateField.vue_vue_type_script_setup_true_lang-BhKdCVFn.js → DateField.vue_vue_type_script_setup_true_lang-CeNwBbJT.js} +1 -1
  12. package/dist/{DeadLetters-Bb5pPlOY.js → DeadLetters-BP03yC4R.js} +5 -6
  13. package/dist/DrawnCheck.vue_vue_type_script_setup_true_lang-9DzDJlIA.js +38 -0
  14. package/dist/FormGroup.vue_vue_type_script_setup_true_lang-D6jYfNjW.js +427 -0
  15. package/dist/{FormView.vue_vue_type_script_setup_true_lang-aaNnMIOi.js → FormView.vue_vue_type_script_setup_true_lang-DvbPEiNQ.js} +2 -2
  16. package/dist/{General-BAG7S6wV.js → General-BDmCJr3H.js} +35 -38
  17. package/dist/{IncidentRecord-D8aOpNHo.js → IncidentRecord-DEhl6AyA.js} +14 -15
  18. package/dist/{IncidentsList-C0cFl0Db.js → IncidentsList-COgRPdk3.js} +3 -3
  19. package/dist/{Modal.vue_vue_type_script_setup_true_lang-BlHhdmMy.js → Modal.vue_vue_type_script_setup_true_lang-DDS0iEnn.js} +9 -8
  20. package/dist/{NewRolePage-C6Iu-EQJ.js → NewRolePage-DhGFwvk3.js} +4 -4
  21. package/dist/{NumberField.vue_vue_type_script_setup_true_lang-TGGAq8J-.js → NumberField.vue_vue_type_script_setup_true_lang-B3UrXNqH.js} +1 -1
  22. package/dist/{PersonAccess.vue_vue_type_script_setup_true_lang-qz1tmYpF.js → PersonAccess.vue_vue_type_script_setup_true_lang-DbGZSNQc.js} +56 -56
  23. package/dist/ProfilePage-BQCK2w8R.js +684 -0
  24. package/dist/ProgressTrack.vue_vue_type_script_setup_true_lang-DrOm8k--.js +30 -0
  25. package/dist/{RecordHeader.vue_vue_type_script_setup_true_lang-B9mN7UxZ.js → RecordHeader.vue_vue_type_script_setup_true_lang-DqGc3Jyo.js} +1 -1
  26. package/dist/{ResourcePage.vue_vue_type_script_setup_true_lang-Cw8mGf_B.js → ResourcePage.vue_vue_type_script_setup_true_lang-DljhsTU4.js} +3 -3
  27. package/dist/{RoleEditor.vue_vue_type_script_setup_true_lang-CJPvOVDV.js → RoleEditor.vue_vue_type_script_setup_true_lang-C0FIotFA.js} +11 -12
  28. package/dist/{RolePage-Dj_ocMnM.js → RolePage-DaNv049g.js} +10 -10
  29. package/dist/{RolesPage-PXrs4O-1.js → RolesPage-6hlzJes_.js} +6 -6
  30. package/dist/SearchInput.vue_vue_type_script_setup_true_lang-w4eAqyZ9.js +32 -0
  31. package/dist/{SectionList.vue_vue_type_script_setup_true_lang-CtdF1zuv.js → SectionList.vue_vue_type_script_setup_true_lang-DR0_NsqC.js} +1 -1
  32. package/dist/{SectionNavigator.vue_vue_type_script_setup_true_lang-B5ove3rM.js → SectionNavigator.vue_vue_type_script_setup_true_lang-Dh3sXUt_.js} +2 -2
  33. package/dist/{SegmentedField.vue_vue_type_script_setup_true_lang-ChfDFAA2.js → SegmentedField.vue_vue_type_script_setup_true_lang-zv_AxpBn.js} +1 -1
  34. package/dist/{SelectField.vue_vue_type_script_setup_true_lang-BP8nAQwo.js → SelectField.vue_vue_type_script_setup_true_lang-BZwdANL3.js} +3 -3
  35. package/dist/{ServiceAccountDialog.vue_vue_type_script_setup_true_lang-aWkKwxNe.js → ServiceAccountDialog.vue_vue_type_script_setup_true_lang-C0OIBrSp.js} +20 -20
  36. package/dist/{ServiceAccountRecord-bxX9yQkC.js → ServiceAccountRecord-gtlhYaAz.js} +37 -37
  37. package/dist/{ServiceAccountsList-BXE6htxk.js → ServiceAccountsList-BM7GGcvw.js} +33 -33
  38. package/dist/{Sessions--Gvc0kxw.js → Sessions-BCDJYuV2.js} +23 -24
  39. package/dist/{SettingsPage-DzDC7gD-.js → SettingsPage-DUhMsYBf.js} +27 -30
  40. package/dist/{SignIn-CTI_699e.js → SignIn-4D7WohI8.js} +9 -10
  41. package/dist/{SignInPage-HKC1bm2E.js → SignInPage-B6B-34GG.js} +4 -4
  42. package/dist/SignIns-CFoe4hpX.js +64 -0
  43. package/dist/StatusLine.vue_vue_type_script_setup_true_lang-DsdQmLq6.js +56 -0
  44. package/dist/{SwitchField.vue_vue_type_script_setup_true_lang-BMA2YXTZ.js → SwitchField.vue_vue_type_script_setup_true_lang-Ds4q0bbl.js} +1 -1
  45. package/dist/{TextField.vue_vue_type_script_setup_true_lang-BFVsqcBX.js → TextField.vue_vue_type_script_setup_true_lang-CWIeeZRE.js} +2 -2
  46. package/dist/{TextareaField.vue_vue_type_script_setup_true_lang-Dyh4Hhyl.js → TextareaField.vue_vue_type_script_setup_true_lang-D2j4s96s.js} +1 -1
  47. package/dist/{TimeField.vue_vue_type_script_setup_true_lang-gGFfQLuK.js → TimeField.vue_vue_type_script_setup_true_lang-D-Em4glH.js} +1 -1
  48. package/dist/UserRecord-Cd1TCpJZ.js +202 -0
  49. package/dist/UsersList-GJU5-CTG.js +74 -0
  50. package/dist/access/index.js +4 -4
  51. package/dist/app/index.js +1 -1
  52. package/dist/{application-BmXW6iW_.js → application-CuzT-0vW.js} +1 -1
  53. package/dist/button/index.js +6 -5
  54. package/dist/collection/PickerModal.vue.d.ts +26 -0
  55. package/dist/collection/definition.d.ts +6 -6
  56. package/dist/collection/http.d.ts +6 -6
  57. package/dist/collection/index.d.ts +5 -1
  58. package/dist/collection/index.js +144 -85
  59. package/dist/collection/picker.d.ts +39 -0
  60. package/dist/collection/types.d.ts +9 -4
  61. package/dist/collection/useCollection.d.ts +5 -5
  62. package/dist/content/ActivityStream.vue.d.ts +62 -0
  63. package/dist/content/CommentThread.vue.d.ts +52 -0
  64. package/dist/content/Composer.vue.d.ts +36 -0
  65. package/dist/content/index.d.ts +3 -0
  66. package/dist/content/index.js +321 -56
  67. package/dist/controls/index.js +28 -54
  68. package/dist/form/index.d.ts +2 -0
  69. package/dist/form/index.js +611 -595
  70. package/dist/form/storableText.d.ts +24 -0
  71. package/dist/format/index.d.ts +1 -0
  72. package/dist/format/index.js +10 -6
  73. package/dist/format/slug.d.ts +8 -0
  74. package/dist/highlight-DnYhLXnu.js +9 -0
  75. package/dist/http-Dm0uXY9O.js +95 -0
  76. package/dist/i18n/index.d.ts +14 -0
  77. package/dist/i18n/index.js +87 -63
  78. package/dist/i18n/plural.d.ts +23 -0
  79. package/dist/identity/embed.d.ts +39 -0
  80. package/dist/identity/index.d.ts +20 -0
  81. package/dist/identity/index.js +40 -21
  82. package/dist/identity/session.d.ts +9 -1
  83. package/dist/identity/shared/ChangeFeed.vue.d.ts +6 -3
  84. package/dist/identity/users/context.d.ts +8 -0
  85. package/dist/identity/users/dialogs.d.ts +10 -0
  86. package/dist/identity/users/ext.d.ts +8 -0
  87. package/dist/identity/users/feature.d.ts +10 -0
  88. package/dist/identity/users/list.d.ts +1 -1
  89. package/dist/identity/users/personSections.d.ts +1 -1
  90. package/dist/identity/users/replace.d.ts +45 -0
  91. package/dist/identity/users/words.d.ts +28 -0
  92. package/dist/incidents/api.d.ts +1 -1
  93. package/dist/incidents/index.js +1 -1
  94. package/dist/{index-Dz0LkLM8.js → index-CTkG-acm.js} +4 -4
  95. package/dist/{index-Dm-sdJJr.js → index-DUs7WSz-.js} +31 -32
  96. package/dist/index-pJ_eRg80.js +1257 -0
  97. package/dist/index.d.ts +1 -1
  98. package/dist/index.js +1 -1
  99. package/dist/modal/index.js +3 -3
  100. package/dist/modules/identity/entities.d.ts +7 -0
  101. package/dist/modules/identity/routes.d.ts +8 -4
  102. package/dist/modules/identity/schemas.d.ts +16 -0
  103. package/dist/{neighbors-DVfU9T0o.js → neighbors-OyvGi233.js} +2 -2
  104. package/dist/notifications/deadletters/list.d.ts +1 -1
  105. package/dist/notifications/index.js +1 -1
  106. package/dist/{options-QuOkMKVZ.js → options-B48UiYsG.js} +2 -2
  107. package/dist/page/index.js +11 -11
  108. package/dist/phone/index.js +1 -1
  109. package/dist/pwa/AndroidInstallBanner.vue.d.ts +18 -0
  110. package/dist/pwa/InstallQrSheet.vue.d.ts +21 -0
  111. package/dist/pwa/IosInstallGuide.vue.d.ts +19 -0
  112. package/dist/pwa/QrCode.vue.d.ts +16 -0
  113. package/dist/pwa/index.d.ts +4 -0
  114. package/dist/pwa/index.js +244 -24
  115. package/dist/resource/index.js +1 -1
  116. package/dist/{rowLayout-CT8vWYgI.js → rowLayout-Il4psyXN.js} +183 -188
  117. package/dist/shell/DarkModeRow.vue.d.ts +15 -0
  118. package/dist/shell/OfflineNotice.vue.d.ts +2 -0
  119. package/dist/shell/QuickSearchButton.vue.d.ts +2 -0
  120. package/dist/shell/QuickSearchPalette.vue.d.ts +12 -0
  121. package/dist/shell/darkMode.d.ts +26 -0
  122. package/dist/shell/index.d.ts +10 -0
  123. package/dist/shell/index.js +963 -580
  124. package/dist/shell/offlineNotice.d.ts +3 -0
  125. package/dist/shell/quickSearch.d.ts +14 -0
  126. package/dist/shell/quickSearchControl.d.ts +66 -0
  127. package/dist/shortcut-DUR6yPWA.js +93 -0
  128. package/dist/state/BackgroundTaskCapsule.vue.d.ts +18 -0
  129. package/dist/state/backgroundTasks.d.ts +58 -0
  130. package/dist/state/index.d.ts +4 -0
  131. package/dist/state/index.js +194 -80
  132. package/dist/state/useCountUp.d.ts +9 -0
  133. package/dist/styles.css +1 -1
  134. package/dist/{suggestions-BVQhoXzS.js → suggestions-q_v3M7G6.js} +1 -1
  135. package/dist/testing/collection.d.ts +1 -1
  136. package/dist/{useCommand-Dc8Lgs9h.js → useCommand-Ch_nx1AQ.js} +4 -4
  137. package/dist/{useGroupSheet-DQ6cVG-z.js → useGroupSheet-CPjHydQV.js} +14 -15
  138. package/dist/{useRecordDialog-BTsbHY38.js → useRecordDialog-DdkauXnU.js} +1 -1
  139. package/dist/{useResourceForm-DJ4Q75pq.js → useResourceForm-Dl6YFYyz.js} +1 -1
  140. package/package.json +3 -2
  141. package/dist/ActionRow.vue_vue_type_script_setup_true_lang-Cg1lhpcA.js +0 -45
  142. package/dist/Activity-29hsZ28j.js +0 -156
  143. package/dist/Button.vue_vue_type_script_setup_true_lang-Dp7OB-eF.js +0 -192
  144. package/dist/Changes-Dxjdkd_5.js +0 -129
  145. package/dist/FormErrors.vue_vue_type_script_setup_true_lang-CIggKPtq.js +0 -295
  146. package/dist/FormGroup.vue_vue_type_script_setup_true_lang-B37dixvJ.js +0 -137
  147. package/dist/PageBar.vue_vue_type_script_setup_true_lang-qI94fjJv.js +0 -47
  148. package/dist/ProfilePage-BnohZIEg.js +0 -764
  149. package/dist/ProgressTrack.vue_vue_type_script_setup_true_lang-B6Prw9hi.js +0 -64
  150. package/dist/SectionIntro.vue_vue_type_script_setup_true_lang-CZtPrmXD.js +0 -23
  151. package/dist/SessionList.vue_vue_type_script_setup_true_lang-Cnyt5V8T.js +0 -133
  152. package/dist/SignIns-BcqBgWgN.js +0 -121
  153. package/dist/UserRecord-CtUPpbCt.js +0 -267
  154. package/dist/UsersList-BMkIgIg8.js +0 -155
  155. package/dist/definition-C7QuyV3i.js +0 -54
  156. package/dist/fieldMessages-B6GHgi40.js +0 -25
  157. package/dist/http-nz92KjdS.js +0 -42
  158. package/dist/index-CdtofdcJ.js +0 -501
  159. package/dist/languages-BShG9LpE.js +0 -10
  160. package/dist/signInEvents-DWShrJox.js +0 -30
  161. package/dist/status-BRA14qwX.js +0 -34
  162. package/dist/useWaitStatus-fsacMl4W.js +0 -24
@@ -0,0 +1,684 @@
1
+ import { defineComponent as V, openBlock as m, createBlock as U, unref as e, withCtx as _, createVNode as n, mergeProps as E, createElementVNode as z, toDisplayString as q, watch as J, createElementBlock as w, Fragment as A, useModel as ve, useId as _e, useTemplateRef as Q, ref as x, onMounted as ge, onBeforeUnmount as ye, computed as D, withModifiers as be, createCommentVNode as H, createTextVNode as O, mergeModels as le, renderList as we, resolveDynamicComponent as re } from "vue";
2
+ import { useI18n as P } from "vue-i18n";
3
+ import { _ as he } from "./AdaptivePageShell.vue_vue_type_script_setup_true_lang-D5i77H6S.js";
4
+ import { u as F } from "./platform-BQOX_Ntw.js";
5
+ import { _ as ee } from "./AsyncSection.vue_vue_type_script_setup_true_lang-DGzQ-Snp.js";
6
+ import { u as te } from "./useLoad-M7V-AVwR.js";
7
+ import { i as S, h as j, k as xe, v as $e, m as ke, g as qe } from "./index-pJ_eRg80.js";
8
+ import { a as K, u as ne, p as Ce } from "./FormGroup.vue_vue_type_script_setup_true_lang-D6jYfNjW.js";
9
+ import { _ as de } from "./FormView.vue_vue_type_script_setup_true_lang-DvbPEiNQ.js";
10
+ import { u as Se, _ as Ee, a as Ve, b as Pe } from "./useGroupSheet-CPjHydQV.js";
11
+ import { t as C } from "./toast-CqSDTWRX.js";
12
+ import { u as T, a as W } from "./ActionRow.vue_vue_type_script_setup_true_lang-IpcP3Bjc.js";
13
+ import { g as Z } from "./options-B48UiYsG.js";
14
+ import { _ as I } from "./TextField.vue_vue_type_script_setup_true_lang-CWIeeZRE.js";
15
+ import { _ as Ne } from "./IconTile.vue_vue_type_script_setup_true_lang-BmxCuUZ9.js";
16
+ import { u as ce } from "./format-D8KUBmbS.js";
17
+ import { a as Y } from "./error-CD7x0Jrz.js";
18
+ import { a as Ae } from "./leaveGuard-Cc8yeLxM.js";
19
+ import { _ as Me } from "./Modal.vue_vue_type_script_setup_true_lang-DDS0iEnn.js";
20
+ import { _ as X } from "./Button.vue_vue_type_script_setup_true_lang-C74hcb0N.js";
21
+ import { u as Re, _ as De } from "./useCommand-Ch_nx1AQ.js";
22
+ import { _ as Ue } from "./AlertDialog.vue_vue_type_script_setup_true_lang-CrFhR9rJ.js";
23
+ import { _ as Ie } from "./ViewTabs.vue_vue_type_script_setup_true_lang-BjdDXE3T.js";
24
+ const Fe = { class: "font-mono" }, ie = /* @__PURE__ */ V({
25
+ __name: "DetailsFields",
26
+ props: {
27
+ bind: { type: Function },
28
+ login: {}
29
+ },
30
+ setup(h) {
31
+ const l = h, { t: p } = P();
32
+ return (t, a) => (m(), U(e(K), {
33
+ group: "details",
34
+ header: e(p)("core.profile.details.title"),
35
+ footer: e(p)("core.profile.details.login_hint")
36
+ }, {
37
+ default: _(() => [
38
+ n(e(I), E(l.bind("name"), {
39
+ label: e(p)("core.users.fields.name"),
40
+ required: "",
41
+ autocomplete: "name"
42
+ }), null, 16, ["label"]),
43
+ n(e(I), E(l.bind("phone"), {
44
+ label: e(p)("core.users.fields.phone"),
45
+ type: "tel",
46
+ autocomplete: "tel"
47
+ }), null, 16, ["label"]),
48
+ n(e(Z), {
49
+ layout: "value",
50
+ label: e(p)("core.users.fields.login"),
51
+ "data-profile-login": ""
52
+ }, {
53
+ default: _(() => [
54
+ z("span", Fe, q(l.login), 1)
55
+ ]),
56
+ _: 1
57
+ }, 8, ["label"])
58
+ ]),
59
+ _: 1
60
+ }, 8, ["header", "footer"]));
61
+ }
62
+ }), Ge = /* @__PURE__ */ V({
63
+ __name: "DetailsGroup",
64
+ props: {
65
+ profile: {}
66
+ },
67
+ emits: ["updated"],
68
+ setup(h, { emit: l }) {
69
+ const p = h, t = l, { t: a } = P(), { http: c } = F(), s = {
70
+ safeParse(u) {
71
+ const { name: g, phone: y } = u;
72
+ return g.trim() === "" ? { success: !1, error: { issues: [{ path: ["name"], message: a("core.account.validation.required") }] } } : { success: !0, data: { name: g, phone: y.trim() === "" ? void 0 : y } };
73
+ }
74
+ }, o = ne({ ...T(), defaults: () => ({ name: "", phone: "" }), validator: s });
75
+ J(() => p.profile, (u) => o.hydrate({ name: u.name, phone: u.phone }), { immediate: !0 });
76
+ const d = {}, i = Ce({ edit: (u) => d[u].present });
77
+ let r = null;
78
+ const b = Se({
79
+ form: o,
80
+ group: "details",
81
+ fields: ["name", "phone"],
82
+ groupOf: i.groupOf,
83
+ save: async (u) => {
84
+ r = (await c.request(S.profileUpdate, { name: u.name, phone: u.phone.trim() === "" ? void 0 : u.phone })).data;
85
+ },
86
+ onSaved: () => {
87
+ C.success(a("core.profile.details.saved")), r && t("updated", r);
88
+ }
89
+ });
90
+ return d.details = b, (u, g) => (m(), w(A, null, [
91
+ n(e(de), {
92
+ editable: !1,
93
+ "data-profile-details": ""
94
+ }, {
95
+ default: _(() => [
96
+ n(ie, {
97
+ bind: e(o).bind,
98
+ login: p.profile.login
99
+ }, null, 8, ["bind", "login"])
100
+ ]),
101
+ _: 1
102
+ }),
103
+ n(e(Ee), {
104
+ sheet: e(b),
105
+ title: e(a)("core.profile.details.title"),
106
+ editable: !0,
107
+ "group-label": () => e(a)("core.profile.details.title")
108
+ }, {
109
+ default: _(() => [
110
+ n(e(Ve), {
111
+ only: "details",
112
+ editable: !0
113
+ }, {
114
+ default: _(() => [
115
+ n(ie, {
116
+ bind: e(o).bind,
117
+ login: p.profile.login
118
+ }, null, 8, ["bind", "login"])
119
+ ]),
120
+ _: 1
121
+ })
122
+ ]),
123
+ _: 1
124
+ }, 8, ["sheet", "title", "group-label"])
125
+ ], 64));
126
+ }
127
+ }), Be = {
128
+ key: 0,
129
+ class: "max-w-sm text-body text-content-muted"
130
+ }, Le = ["id"], Oe = {
131
+ key: 2,
132
+ class: "mt-3 text-footnote text-content-muted",
133
+ "data-verify-expires": ""
134
+ }, je = { class: "mt-6 flex w-full flex-col gap-2" }, ze = /* @__PURE__ */ V({
135
+ __name: "VerifyCode",
136
+ props: /* @__PURE__ */ le({
137
+ description: { default: void 0 },
138
+ length: { default: 6 },
139
+ resendAvailableAt: { default: null },
140
+ expiresAt: { default: null },
141
+ error: { default: "" },
142
+ expired: { type: Boolean, default: !1 },
143
+ verifying: { type: Boolean, default: !1 },
144
+ resending: { type: Boolean, default: !1 }
145
+ }, {
146
+ modelValue: { default: "" },
147
+ modelModifiers: {}
148
+ }),
149
+ emits: /* @__PURE__ */ le(["verify", "resend", "cancel"], ["update:modelValue"]),
150
+ setup(h, { expose: l, emit: p }) {
151
+ const t = h, a = ve(h, "modelValue"), c = p, { t: s } = P(), o = ce(), d = _e(), i = Q("otp"), r = x(Date.now());
152
+ let b;
153
+ ge(() => b = setInterval(() => r.value = Date.now(), 1e3)), ye(() => clearInterval(b));
154
+ const u = D(() => {
155
+ const k = t.resendAvailableAt ? Date.parse(t.resendAvailableAt) : Number.NaN;
156
+ return Number.isNaN(k) ? 0 : Math.max(0, Math.ceil((k - r.value) / 1e3));
157
+ }), g = D(() => `${Math.floor(u.value / 60)}:${String(u.value % 60).padStart(2, "0")}`), y = D(() => t.expiresAt && !t.expired ? o.time(t.expiresAt) : ""), $ = D(() => a.value.length === t.length), G = D(() => t.verifying || t.resending);
158
+ function M(k = a.value) {
159
+ k.length === t.length && !G.value && !t.expired && c("verify", k);
160
+ }
161
+ function B() {
162
+ u.value === 0 && !G.value && c("resend");
163
+ }
164
+ return J(() => t.error, (k) => {
165
+ k && (a.value = "", i.value?.focus());
166
+ }), l({ focus: () => i.value?.focus() }), (k, N) => (m(), w("form", {
167
+ class: "flex flex-col items-center text-center",
168
+ "data-verify-code": "",
169
+ novalidate: "",
170
+ onSubmit: N[2] || (N[2] = be((R) => M(), ["prevent"]))
171
+ }, [
172
+ t.description ? (m(), w("p", Be, q(t.description), 1)) : H("", !0),
173
+ n(e(Pe), {
174
+ ref_key: "otp",
175
+ ref: i,
176
+ modelValue: a.value,
177
+ "onUpdate:modelValue": N[0] || (N[0] = (R) => a.value = R),
178
+ class: "mt-6",
179
+ length: t.length,
180
+ invalid: !!t.error,
181
+ disabled: t.expired || t.verifying,
182
+ "described-by": t.error ? e(d) : void 0,
183
+ autofocus: "",
184
+ onComplete: M
185
+ }, null, 8, ["modelValue", "length", "invalid", "disabled", "described-by"]),
186
+ t.error ? (m(), w("p", {
187
+ key: 1,
188
+ id: e(d),
189
+ role: "alert",
190
+ class: "mt-3 text-footnote text-content-destructive",
191
+ "data-verify-error": ""
192
+ }, q(t.error), 9, Le)) : y.value ? (m(), w("p", Oe, q(e(s)("core.profile.email.valid_until", { time: y.value })), 1)) : H("", !0),
193
+ z("div", je, [
194
+ t.expired ? H("", !0) : (m(), U(e(X), {
195
+ key: 0,
196
+ type: "submit",
197
+ prominence: "primary",
198
+ size: "lg",
199
+ class: "w-full justify-center",
200
+ disabled: !$.value || t.resending,
201
+ processing: t.verifying,
202
+ "data-verify-submit": ""
203
+ }, {
204
+ default: _(() => [
205
+ O(q(e(s)("core.profile.email.verify")), 1)
206
+ ]),
207
+ _: 1
208
+ }, 8, ["disabled", "processing"])),
209
+ n(e(X), {
210
+ prominence: t.expired ? "primary" : "standard",
211
+ size: "lg",
212
+ class: "w-full justify-center",
213
+ disabled: u.value > 0 || t.verifying,
214
+ processing: t.resending,
215
+ "data-verify-resend": "",
216
+ onClick: B
217
+ }, {
218
+ default: _(() => [
219
+ u.value > 0 ? (m(), w(A, { key: 0 }, [
220
+ O(q(e(s)("core.profile.email.resend_in", { time: g.value })), 1)
221
+ ], 64)) : (m(), w(A, { key: 1 }, [
222
+ O(q(t.expired ? e(s)("core.profile.email.request_new") : e(s)("core.profile.email.resend")), 1)
223
+ ], 64))
224
+ ]),
225
+ _: 1
226
+ }, 8, ["prominence", "disabled", "processing"]),
227
+ n(e(X), {
228
+ prominence: "link",
229
+ class: "mt-1 self-center",
230
+ disabled: t.verifying,
231
+ "data-verify-cancel": "",
232
+ onClick: N[1] || (N[1] = (R) => c("cancel"))
233
+ }, {
234
+ default: _(() => [
235
+ O(q(e(s)("core.profile.email.cancel_change")), 1)
236
+ ]),
237
+ _: 1
238
+ }, 8, ["disabled"])
239
+ ])
240
+ ], 32));
241
+ }
242
+ }), Te = { class: "text-body text-content-muted" }, He = {
243
+ key: 1,
244
+ class: "px-2 py-4 sm:px-6"
245
+ }, We = /* @__PURE__ */ V({
246
+ __name: "EmailChangeDialog",
247
+ emits: ["pending", "changed", "cancelled"],
248
+ setup(h, { expose: l, emit: p }) {
249
+ const t = p, { t: a } = P(), { http: c } = F(), s = T(), o = Q("modal"), d = x("request"), i = x(null), r = x(!1), u = ne({ ...s, defaults: () => ({ email: "", password: "" }), validator: {
250
+ safeParse(f) {
251
+ const { email: v, password: L } = f, se = a("core.account.validation.required"), oe = [...v.trim() === "" ? [{ path: ["email"], message: se }] : [], ...L === "" ? [{ path: ["password"], message: se }] : []];
252
+ return oe.length > 0 ? { success: !1, error: { issues: oe } } : { success: !0, data: { email: v.trim(), current_password: L } };
253
+ }
254
+ }, serverField: (f) => f === "current_password" ? "password" : f }), { confirmDiscard: g } = Ae(() => r.value && d.value === "request" && u.dirty.value), y = x(""), $ = x(""), G = x(!1), M = x(!1), B = x(!1), k = x(!1), N = ["identity.code.expired", "identity.code.too_many_attempts", "identity.code.no_pending"];
255
+ function R() {
256
+ y.value = "", $.value = "", G.value = !1;
257
+ }
258
+ function ue(f) {
259
+ i.value = f, d.value = f ? "verify" : "request", u.hydrate({ email: "", password: "" }), R(), o.value?.present();
260
+ }
261
+ async function ae() {
262
+ const f = await u.submit(async (v) => (await c.request(S.profileRequestEmail, v)).data);
263
+ f.status === "saved" && (i.value = f.value, R(), d.value = "verify", t("pending", f.value));
264
+ }
265
+ async function pe(f) {
266
+ if (!M.value) {
267
+ M.value = !0, $.value = "";
268
+ try {
269
+ const v = (await c.request(S.profileConfirmEmail, { code: f })).data;
270
+ t("changed", v), C.success(a("core.profile.email.changed")), o.value?.dismiss();
271
+ } catch (v) {
272
+ if (j(v)) return;
273
+ if (Y(v) && v.fields.email?.[0]) {
274
+ i.value = null, t("pending", null), d.value = "request", u.errors.set({ email: [s.describeFieldError(v.fields.email[0])] });
275
+ return;
276
+ }
277
+ G.value = Y(v) && v.code !== null && N.includes(v.code), $.value = s.sentence(v, a("core.profile.email.verify_failed"));
278
+ } finally {
279
+ M.value = !1;
280
+ }
281
+ }
282
+ }
283
+ async function fe() {
284
+ if (!B.value) {
285
+ B.value = !0;
286
+ try {
287
+ i.value = (await c.request(S.profileResendEmail)).data, R(), t("pending", i.value), C.success(a("core.profile.email.code_sent", { email: i.value.email }));
288
+ } catch (f) {
289
+ if (j(f)) return;
290
+ if (Y(f) && f.code === "identity.code.no_pending") {
291
+ i.value = null, t("pending", null), d.value = "request", C.error(s.sentence(f, a("core.profile.email.resend_failed")));
292
+ return;
293
+ }
294
+ $.value = s.sentence(f, a("core.profile.email.resend_failed"));
295
+ } finally {
296
+ B.value = !1;
297
+ }
298
+ }
299
+ }
300
+ async function me() {
301
+ if (!k.value) {
302
+ k.value = !0;
303
+ try {
304
+ await c.request(S.profileCancelEmail), i.value = null, t("cancelled"), C.success(a("core.profile.email.cancelled")), o.value?.dismiss();
305
+ } catch (f) {
306
+ j(f) || C.error(s.sentence(f, a("core.profile.email.cancel_failed")));
307
+ } finally {
308
+ k.value = !1;
309
+ }
310
+ }
311
+ }
312
+ return l({ present: ue }), (f, v) => (m(), U(e(Me), {
313
+ ref_key: "modal",
314
+ ref: o,
315
+ size: "md",
316
+ title: d.value === "request" ? e(a)("core.profile.email.change_title") : e(a)("core.profile.email.verify_title"),
317
+ "primary-label": d.value === "request" ? e(a)("core.profile.email.send_code") : void 0,
318
+ "without-footer": d.value === "verify",
319
+ status: e(u).submitting.value ? "processing" : "idle",
320
+ "before-dismiss": e(g),
321
+ onPrimary: ae,
322
+ onPresented: v[1] || (v[1] = (L) => r.value = !0),
323
+ onDismissed: v[2] || (v[2] = (L) => r.value = !1)
324
+ }, {
325
+ default: _(() => [
326
+ d.value === "request" ? (m(), U(e(de), {
327
+ key: 0,
328
+ form: e(u),
329
+ onSubmit: ae
330
+ }, {
331
+ default: _(() => [
332
+ z("p", Te, q(e(a)("core.profile.email.request_hint")), 1),
333
+ n(e(I), E(e(u).bind("email"), {
334
+ label: e(a)("core.profile.email.new_email"),
335
+ type: "email",
336
+ required: "",
337
+ autocomplete: "email"
338
+ }), null, 16, ["label"]),
339
+ n(e(I), E(e(u).bind("password"), {
340
+ label: e(a)("core.profile.email.current_password"),
341
+ type: "password",
342
+ required: "",
343
+ autocomplete: "current-password"
344
+ }), null, 16, ["label"])
345
+ ]),
346
+ _: 1
347
+ }, 8, ["form"])) : (m(), w("div", He, [
348
+ n(ze, {
349
+ modelValue: y.value,
350
+ "onUpdate:modelValue": v[0] || (v[0] = (L) => y.value = L),
351
+ description: e(a)("core.profile.email.verify_description", { email: i.value?.email ?? "" }),
352
+ "resend-available-at": i.value?.resend_available_at ?? null,
353
+ "expires-at": i.value?.expires_at ?? null,
354
+ error: $.value,
355
+ expired: G.value,
356
+ verifying: M.value,
357
+ resending: B.value,
358
+ onVerify: pe,
359
+ onResend: fe,
360
+ onCancel: me
361
+ }, null, 8, ["modelValue", "description", "resend-available-at", "expires-at", "error", "expired", "verifying", "resending"])
362
+ ]))
363
+ ]),
364
+ _: 1
365
+ }, 8, ["title", "primary-label", "without-footer", "status", "before-dismiss"]));
366
+ }
367
+ }), Xe = /* @__PURE__ */ V({
368
+ __name: "EmailGroup",
369
+ props: {
370
+ profile: {}
371
+ },
372
+ emits: ["updated"],
373
+ setup(h, { emit: l }) {
374
+ const p = h, t = l, { t: a } = P(), { http: c } = F(), s = ce(), o = T(), d = Q("dialog"), i = x(!1), r = D(() => p.profile.pending_email), b = (g) => t("updated", { ...p.profile, pending_email: g });
375
+ async function u() {
376
+ if (!i.value) {
377
+ i.value = !0;
378
+ try {
379
+ await c.request(S.profileCancelEmail), C.success(a("core.profile.email.cancelled")), b(null);
380
+ } catch (g) {
381
+ j(g) || C.error(o.sentence(g, a("core.profile.email.cancel_failed")));
382
+ } finally {
383
+ i.value = !1;
384
+ }
385
+ }
386
+ }
387
+ return (g, y) => (m(), w(A, null, [
388
+ n(e(K), {
389
+ header: e(a)("core.profile.email.title"),
390
+ "data-profile-email": ""
391
+ }, {
392
+ default: _(() => [
393
+ n(e(Z), {
394
+ layout: "value",
395
+ label: e(a)("core.profile.email.current"),
396
+ "data-profile-email-current": ""
397
+ }, {
398
+ default: _(() => [
399
+ O(q(p.profile.email), 1)
400
+ ]),
401
+ _: 1
402
+ }, 8, ["label"]),
403
+ n(W, {
404
+ label: e(a)("core.profile.email.change"),
405
+ "data-email-change": "",
406
+ onClick: y[0] || (y[0] = ($) => d.value?.present(null))
407
+ }, null, 8, ["label"]),
408
+ r.value ? (m(), w(A, { key: 0 }, [
409
+ n(e(Z), {
410
+ layout: "setting",
411
+ label: e(a)("core.profile.email.pending", { email: r.value.email }),
412
+ sub: e(a)("core.profile.email.valid_until", { time: e(s).time(r.value.expires_at) }),
413
+ "data-email-pending": ""
414
+ }, {
415
+ leading: _(() => [
416
+ n(e(Ne), {
417
+ tone: "neutral",
418
+ icon: "timeLine"
419
+ })
420
+ ]),
421
+ _: 1
422
+ }, 8, ["label", "sub"]),
423
+ n(W, {
424
+ label: e(a)("core.profile.email.enter_code"),
425
+ "data-email-enter-code": "",
426
+ onClick: y[1] || (y[1] = ($) => d.value?.present(r.value))
427
+ }, null, 8, ["label"]),
428
+ n(W, {
429
+ label: e(a)("core.profile.email.cancel_change"),
430
+ tone: "critical",
431
+ disabled: i.value,
432
+ "data-email-cancel": "",
433
+ onClick: u
434
+ }, null, 8, ["label", "disabled"])
435
+ ], 64)) : H("", !0)
436
+ ]),
437
+ _: 1
438
+ }, 8, ["header"]),
439
+ n(We, {
440
+ ref_key: "dialog",
441
+ ref: d,
442
+ onPending: b,
443
+ onChanged: y[2] || (y[2] = ($) => t("updated", $)),
444
+ onCancelled: y[3] || (y[3] = ($) => b(null))
445
+ }, null, 512)
446
+ ], 64));
447
+ }
448
+ }), Je = { class: "flex justify-end" }, Ke = /* @__PURE__ */ V({
449
+ __name: "PasswordGroup",
450
+ setup(h) {
451
+ const { t: l } = P(), { http: p } = F(), t = x(!1), a = {
452
+ safeParse(s) {
453
+ const o = s, d = l("core.account.validation.required"), i = [
454
+ ...o.current === "" ? [{ path: ["current"], message: d }] : [],
455
+ ...o.password === "" ? [{ path: ["password"], message: d }] : [],
456
+ ...o.password !== "" && o.repeat !== o.password ? [{ path: ["repeat"], message: o.repeat === "" ? d : l("core.account.validation.mismatch") }] : []
457
+ ];
458
+ return i.length > 0 ? { success: !1, error: { issues: i } } : { success: !0, data: { current_password: o.current, new_password: o.password, new_password_confirmation: o.repeat } };
459
+ }
460
+ }, c = Re({
461
+ ...T(),
462
+ defaults: () => ({ current: "", password: "", repeat: "" }),
463
+ validator: a,
464
+ // The server names its fields; the draft's are shorter.
465
+ serverField: (s) => ({ current_password: "current", new_password: "password", new_password_confirmation: "repeat" })[s] ?? s,
466
+ run: (s) => p.request(S.profileChangePassword, s),
467
+ done: () => {
468
+ t.value = !1, C.success(l("core.profile.password.changed"));
469
+ }
470
+ });
471
+ return (s, o) => (m(), w(A, null, [
472
+ n(e(K), { "data-profile-password": "" }, {
473
+ default: _(() => [
474
+ n(W, {
475
+ label: e(l)("core.profile.password.submit"),
476
+ sub: e(l)("core.profile.password.row_sub"),
477
+ "data-change-password": "",
478
+ onClick: o[0] || (o[0] = (d) => e(c).present())
479
+ }, null, 8, ["label", "sub"])
480
+ ]),
481
+ _: 1
482
+ }),
483
+ n(e(De), {
484
+ command: e(c),
485
+ title: e(l)("core.profile.password.title"),
486
+ "confirm-label": e(l)("core.profile.password.submit")
487
+ }, {
488
+ default: _(() => [
489
+ n(e(K), { "data-password-dialog": "" }, {
490
+ default: _(() => [
491
+ n(e(I), E(e(c).form.bind("current"), {
492
+ type: t.value ? "text" : "password",
493
+ label: e(l)("core.profile.password.current"),
494
+ required: "",
495
+ autocomplete: "current-password"
496
+ }), null, 16, ["type", "label"]),
497
+ n(e(I), E(e(c).form.bind("password"), {
498
+ type: t.value ? "text" : "password",
499
+ label: e(l)("core.profile.password.new"),
500
+ required: "",
501
+ autocomplete: "new-password"
502
+ }), null, 16, ["type", "label"]),
503
+ n(e(I), E(e(c).form.bind("repeat"), {
504
+ type: t.value ? "text" : "password",
505
+ label: e(l)("core.profile.password.repeat"),
506
+ required: "",
507
+ autocomplete: "new-password"
508
+ }), null, 16, ["type", "label"])
509
+ ]),
510
+ _: 1
511
+ }),
512
+ z("div", Je, [
513
+ n(e(X), E({
514
+ prominence: "link",
515
+ size: "sm",
516
+ icon: t.value ? "eyeOff" : "eye"
517
+ }, { "aria-pressed": t.value }, {
518
+ "data-password-visibility": "",
519
+ onClick: o[1] || (o[1] = (d) => t.value = !t.value)
520
+ }), {
521
+ default: _(() => [
522
+ O(q(t.value ? e(l)("core.profile.password.hide") : e(l)("core.profile.password.show")), 1)
523
+ ]),
524
+ _: 1
525
+ }, 16, ["icon"])
526
+ ])
527
+ ]),
528
+ _: 1
529
+ }, 8, ["command", "title", "confirm-label"])
530
+ ], 64));
531
+ }
532
+ }), Qe = ["details", "email", "password", "sessions", "signins"];
533
+ function Ye(h, l) {
534
+ const p = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), a = [];
535
+ for (const s of h) {
536
+ if (s.visible && !s.visible(l)) continue;
537
+ const o = s.after ?? s.before;
538
+ (o ? s.after ? t.get(o) ?? t.set(o, []).get(o) : p.get(o) ?? p.set(o, []).get(o) : a).push(s);
539
+ }
540
+ const c = (s) => ({ kind: "section", section: s });
541
+ return [
542
+ ...Qe.flatMap((s) => [...(p.get(s) ?? []).map(c), { kind: "panel", id: s }, ...(t.get(s) ?? []).map(c)]),
543
+ ...a.map(c)
544
+ ];
545
+ }
546
+ const Ze = { "data-profile-sessions": "" }, et = /* @__PURE__ */ V({
547
+ __name: "SessionsGroup",
548
+ setup(h) {
549
+ const { t: l } = P(), { http: p } = F(), t = T(), a = te(async ({ signal: i }) => (await p.request(S.profileSessions, void 0, { signal: i })).data), c = D(() => a.data.value?.sessions ?? []), s = Q("dialog"), o = x(null);
550
+ async function d(i) {
551
+ try {
552
+ await p.request(S.profileRevokeSession, { session_id: i.id }), C.success(l("core.account.sessions.ended"));
553
+ } catch (r) {
554
+ j(r) || C.error(t.sentence(r, l("core.account.sessions.end_failed")));
555
+ }
556
+ await a.reload();
557
+ }
558
+ return (i, r) => (m(), w("div", Ze, [
559
+ n(e(ee), {
560
+ state: e(a).state.value,
561
+ "skeleton-rows": 3,
562
+ "is-empty": () => !1,
563
+ onRetry: r[1] || (r[1] = (b) => e(a).reload())
564
+ }, {
565
+ default: _(() => [
566
+ n(xe, {
567
+ sessions: c.value,
568
+ "can-end": "",
569
+ header: e(l)("core.profile.sessions.title"),
570
+ footer: e(l)("core.profile.sessions.footer"),
571
+ onEnd: r[0] || (r[0] = (b) => {
572
+ o.value = b, s.value?.present(b);
573
+ })
574
+ }, null, 8, ["sessions", "header", "footer"])
575
+ ]),
576
+ _: 1
577
+ }, 8, ["state"]),
578
+ n(e(Ue), {
579
+ ref_key: "dialog",
580
+ ref: s,
581
+ tone: "critical",
582
+ icon: "logoutBoxRLine",
583
+ title: e(l)("core.account.sessions.end_title"),
584
+ message: e(l)("core.account.sessions.end_body", { device: o.value?.device || e(l)("core.account.sessions.unknown_device") }),
585
+ "confirm-label": e(l)("core.account.sessions.end"),
586
+ action: d
587
+ }, null, 8, ["title", "message", "confirm-label"])
588
+ ]));
589
+ }
590
+ }), tt = {
591
+ class: "flex min-w-0 flex-col gap-group-gap",
592
+ "data-profile-signins": ""
593
+ }, at = /* @__PURE__ */ V({
594
+ __name: "SignInsGroup",
595
+ setup(h) {
596
+ const { t: l } = P(), { http: p } = F(), t = ["all", "failed"], a = x("all"), c = x(1), s = te(async ({ signal: o }) => (await p.request(S.profileSignins, { view: a.value, page: c.value, per_page: 20 }, { signal: o })).data);
597
+ return J(a, () => {
598
+ c.value = 1, s.reload();
599
+ }), J(c, () => void s.reload()), (o, d) => (m(), w("div", tt, [
600
+ n(e(ee), {
601
+ state: e(s).state.value,
602
+ "skeleton-rows": 4,
603
+ "is-empty": () => !1,
604
+ onRetry: d[2] || (d[2] = (i) => e(s).reload())
605
+ }, {
606
+ default: _(({ value: i }) => [
607
+ n($e, {
608
+ rows: i.data,
609
+ header: e(l)("core.profile.signins.title"),
610
+ footer: e(l)("core.profile.signins.footer")
611
+ }, {
612
+ "header-trailing": _(() => [
613
+ n(Ie, {
614
+ modelValue: a.value,
615
+ "onUpdate:modelValue": d[0] || (d[0] = (r) => a.value = r),
616
+ views: t,
617
+ counts: e(s).data.value?.meta?.views,
618
+ "label-of": (r) => e(l)(`core.account.signins.views.${r}`),
619
+ label: e(l)("core.profile.signins.title")
620
+ }, null, 8, ["modelValue", "counts", "label-of", "label"])
621
+ ]),
622
+ _: 2
623
+ }, 1032, ["rows", "header", "footer"]),
624
+ n(ke, {
625
+ page: c.value,
626
+ "onUpdate:page": d[1] || (d[1] = (r) => c.value = r),
627
+ "last-page": i.last_page,
628
+ total: i.total
629
+ }, null, 8, ["page", "last-page", "total"])
630
+ ]),
631
+ _: 1
632
+ }, 8, ["state"])
633
+ ]));
634
+ }
635
+ }), st = { class: "flex min-w-0 flex-col gap-group-gap" }, ot = ["data-profile-section"], Et = /* @__PURE__ */ V({
636
+ __name: "ProfilePage",
637
+ setup(h) {
638
+ const { t: l } = P(), { http: p, session: t } = F(), { profileSections: a } = qe(), c = te(async ({ signal: r }) => (await p.request(S.profileShow, void 0, { signal: r })).data), s = { details: Ge, email: Xe, password: Ke, sessions: et, signins: at }, o = (r) => r.kind === "panel" ? r.id : `section:${r.section.id}`, d = (r) => r.kind === "section" || ["details", "email"].includes(r.id);
639
+ function i(r) {
640
+ c.update(r), t.refresh();
641
+ }
642
+ return (r, b) => (m(), U(e(he), {
643
+ title: e(l)("core.profile.title"),
644
+ description: e(l)("core.profile.description"),
645
+ width: "readable"
646
+ }, {
647
+ default: _(() => [
648
+ n(e(ee), {
649
+ state: e(c).state.value,
650
+ "skeleton-rows": 6,
651
+ "is-empty": () => !1,
652
+ onRetry: b[0] || (b[0] = (u) => e(c).reload())
653
+ }, {
654
+ default: _(({ value: u }) => [
655
+ z("div", st, [
656
+ (m(!0), w(A, null, we(e(Ye)(e(a), u), (g) => (m(), w(A, {
657
+ key: o(g)
658
+ }, [
659
+ g.kind === "section" ? (m(), w("div", {
660
+ key: 0,
661
+ class: "flex min-w-0 flex-col gap-group-gap",
662
+ "data-profile-section": g.section.id
663
+ }, [
664
+ (m(), U(re(g.section.component), {
665
+ profile: u,
666
+ onUpdated: i
667
+ }, null, 40, ["profile"]))
668
+ ], 8, ot)) : (m(), U(re(s[g.id]), E({
669
+ key: 1,
670
+ ref_for: !0
671
+ }, d(g) ? { profile: u } : {}, { onUpdated: i }), null, 16))
672
+ ], 64))), 128))
673
+ ])
674
+ ]),
675
+ _: 1
676
+ }, 8, ["state"])
677
+ ]),
678
+ _: 1
679
+ }, 8, ["title", "description"]));
680
+ }
681
+ });
682
+ export {
683
+ Et as default
684
+ };