@thunderid/vue 1.11.0 → 1.13.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 (28) hide show
  1. package/dist/api/auth/executeEmbeddedSelfFlow.d.ts +22 -0
  2. package/dist/api/auth/executeEmbeddedSelfFlow.d.ts.map +1 -0
  3. package/dist/cjs/index.cjs +1055 -104
  4. package/dist/components/account/user-profile/BaseUserProfile.d.ts +42 -2
  5. package/dist/components/account/user-profile/BaseUserProfile.d.ts.map +1 -1
  6. package/dist/components/account/user-profile/UserProfile.css.d.ts +1 -1
  7. package/dist/components/account/user-profile/UserProfile.css.d.ts.map +1 -1
  8. package/dist/components/account/user-profile/UserProfile.d.ts.map +1 -1
  9. package/dist/components/account/verify-attribute/BaseVerifyAttribute.d.ts +83 -0
  10. package/dist/components/account/verify-attribute/BaseVerifyAttribute.d.ts.map +1 -0
  11. package/dist/components/account/verify-attribute/VerifyAttribute.css.d.ts +7 -0
  12. package/dist/components/account/verify-attribute/VerifyAttribute.css.d.ts.map +1 -0
  13. package/dist/components/account/verify-attribute/VerifyAttribute.d.ts +23 -0
  14. package/dist/components/account/verify-attribute/VerifyAttribute.d.ts.map +1 -0
  15. package/dist/components/auth/flow/AuthOptionFactory.d.ts +1 -1
  16. package/dist/components/auth/flow/AuthOptionFactory.d.ts.map +1 -1
  17. package/dist/components/auth/flow/AuthOptionFactoryCore.d.ts +5 -0
  18. package/dist/components/auth/flow/AuthOptionFactoryCore.d.ts.map +1 -1
  19. package/dist/components/auth/flow/FieldFactory.d.ts +1 -0
  20. package/dist/components/auth/flow/FieldFactory.d.ts.map +1 -1
  21. package/dist/components/primitives/OtpField/OtpField.css.d.ts +1 -1
  22. package/dist/components/primitives/OtpField/OtpField.css.d.ts.map +1 -1
  23. package/dist/components/primitives/OtpField/OtpField.d.ts.map +1 -1
  24. package/dist/index.d.ts +7 -1
  25. package/dist/index.d.ts.map +1 -1
  26. package/dist/index.js +1030 -106
  27. package/dist/styles/injectStyles.d.ts.map +1 -1
  28. package/package.json +2 -2
@@ -310,7 +310,7 @@ const PACKAGE_NAME = "@thunderid/vue";
310
310
  * Package-level logger for `@thunderid/vue`.
311
311
  * Use this when logging is not tied to a specific component.
312
312
  */
313
- const logger$7 = (0, __thunderid_browser.createPackageLogger)(PACKAGE_NAME);
313
+ const logger$8 = (0, __thunderid_browser.createPackageLogger)(PACKAGE_NAME);
314
314
  /**
315
315
  * Creates a component-scoped logger prefixed with `@thunderid/vue - <component>`.
316
316
  *
@@ -320,7 +320,7 @@ const createVueLogger = (component) => (0, __thunderid_browser.createPackageComp
320
320
 
321
321
  //#endregion
322
322
  //#region src/providers/I18nProvider.ts
323
- const logger$6 = createVueLogger("I18nProvider");
323
+ const logger$7 = createVueLogger("I18nProvider");
324
324
  const DEFAULT_URL_PARAM = "lang";
325
325
  const deriveRootDomain = (hostname) => {
326
326
  const parts = hostname.split(".");
@@ -360,7 +360,7 @@ const createStorageAdapter = (strategy, key, cookieDomain) => {
360
360
  try {
361
361
  window.localStorage.setItem(key, language);
362
362
  } catch {
363
- logger$6.warn("Failed to persist language preference to localStorage.");
363
+ logger$7.warn("Failed to persist language preference to localStorage.");
364
364
  }
365
365
  }
366
366
  };
@@ -487,7 +487,7 @@ const I18nProvider = (0, vue.defineComponent)({
487
487
  };
488
488
  const setLanguage = (language) => {
489
489
  if (mergedBundlesComputed.value[language]) currentLanguage.value = language;
490
- else logger$6.warn(`Language '${language}' is not available. Available languages: ${Object.keys(mergedBundlesComputed.value).join(", ")}`);
490
+ else logger$7.warn(`Language '${language}' is not available. Available languages: ${Object.keys(mergedBundlesComputed.value).join(", ")}`);
491
491
  };
492
492
  (0, vue.provide)(I18N_KEY, {
493
493
  bundles: (0, vue.readonly)(mergedBundlesComputed),
@@ -934,7 +934,7 @@ var ThunderIDVueClient_default = ThunderIDVueClient;
934
934
 
935
935
  //#endregion
936
936
  //#region src/providers/ThunderIDProvider.ts
937
- const logger$5 = createVueLogger("ThunderIDProvider");
937
+ const logger$6 = createVueLogger("ThunderIDProvider");
938
938
  /**
939
939
  * Checks if the current URL contains authentication parameters.
940
940
  */
@@ -1208,7 +1208,7 @@ const ThunderIDProvider = (0, vue.defineComponent)({
1208
1208
  try {
1209
1209
  await client.getDiscoveryResponse();
1210
1210
  } catch (error) {
1211
- logger$5.warn("Could not load the OIDC discovery metadata on mount.", error);
1211
+ logger$6.warn("Could not load the OIDC discovery metadata on mount.", error);
1212
1212
  }
1213
1213
  const initializedConfig = await client.getConfiguration();
1214
1214
  if (initializedConfig?.baseUrl) sessionStorage.setItem(`${vendor}_base_url`, initializedConfig.baseUrl);
@@ -2241,6 +2241,87 @@ img.thunderid-user-profile__avatar {
2241
2241
  gap: calc(var(--thunderid-spacing-unit) * 0.5);
2242
2242
  }
2243
2243
 
2244
+ .thunderid-user-profile__verification-status {
2245
+ display: inline-flex;
2246
+ flex-shrink: 0;
2247
+ gap: calc(var(--thunderid-spacing-unit) * 0.5);
2248
+ align-items: center;
2249
+ padding: 0 var(--thunderid-spacing-unit);
2250
+ border-radius: 999px;
2251
+ font-size: 0.75rem;
2252
+ font-weight: 500;
2253
+ line-height: 22px;
2254
+ white-space: nowrap;
2255
+ }
2256
+
2257
+ .thunderid-user-profile__verification-status svg {
2258
+ width: 12px;
2259
+ height: 12px;
2260
+ }
2261
+
2262
+ .thunderid-user-profile__verification-status--verified {
2263
+ color: var(--thunderid-color-success-dark, var(--thunderid-color-success-main));
2264
+ background: color-mix(in srgb, var(--thunderid-color-success-main) 12%, transparent);
2265
+ }
2266
+
2267
+ /* Amber marks an action the user can take. */
2268
+ .thunderid-user-profile__verification-status--unverified {
2269
+ color: var(--thunderid-color-warning-contrastText);
2270
+ background: color-mix(in srgb, var(--thunderid-color-warning-main) 14%, transparent);
2271
+ }
2272
+
2273
+ .thunderid-user-profile__verification {
2274
+ padding: var(--thunderid-spacing-unit) 0;
2275
+ }
2276
+
2277
+ /* Starts where the value column starts: the label's width plus the row gap. */
2278
+ .thunderid-user-profile__verification--inline {
2279
+ margin-inline-start: calc(120px + var(--thunderid-spacing-unit));
2280
+ }
2281
+
2282
+ .thunderid-user-profile__verification-overlay {
2283
+ position: fixed;
2284
+ inset: 0;
2285
+ z-index: 9999;
2286
+ display: flex;
2287
+ align-items: center;
2288
+ justify-content: center;
2289
+ background-color: rgba(0, 0, 0, 0.45);
2290
+ }
2291
+
2292
+ .thunderid-user-profile__verification-dialog {
2293
+ box-sizing: border-box;
2294
+ width: min(448px, calc(100vw - calc(var(--thunderid-spacing-unit) * 4)));
2295
+ max-height: 90vh;
2296
+ overflow-y: auto;
2297
+ padding: calc(var(--thunderid-spacing-unit) * 2);
2298
+ background: var(--thunderid-color-background-surface);
2299
+ border-radius: var(--thunderid-border-radius-large);
2300
+ box-shadow: var(--thunderid-shadow-large);
2301
+ font-family: var(--thunderid-typography-fontFamily);
2302
+ outline: none;
2303
+ }
2304
+
2305
+ .thunderid-user-profile__verification-dialog > .thunderid-user-profile__verification {
2306
+ padding: 0;
2307
+ }
2308
+
2309
+ .thunderid-user-profile__verification-notice {
2310
+ margin-bottom: calc(var(--thunderid-spacing-unit) * 2);
2311
+ }
2312
+
2313
+ .thunderid-user-profile__visually-hidden {
2314
+ position: absolute;
2315
+ width: 1px;
2316
+ height: 1px;
2317
+ padding: 0;
2318
+ margin: -1px;
2319
+ overflow: hidden;
2320
+ clip: rect(0, 0, 0, 0);
2321
+ white-space: nowrap;
2322
+ border: 0;
2323
+ }
2324
+
2244
2325
  .thunderid-user-profile__field-error {
2245
2326
  color: var(--thunderid-color-error, #d32f2f);
2246
2327
  font-size: var(--thunderid-typography-fontSize-xs, 0.8rem);
@@ -2264,6 +2345,83 @@ img.thunderid-user-profile__avatar {
2264
2345
  `;
2265
2346
  var UserProfile_css_default = USER_PROFILE_CSS;
2266
2347
 
2348
+ //#endregion
2349
+ //#region src/components/account/verify-attribute/VerifyAttribute.css.ts
2350
+ /**
2351
+ * Styles for the VerifyAttribute presentation component.
2352
+ * Parity target: `@thunderid/react` BaseVerifyAttribute.styles.ts
2353
+ */
2354
+ const VERIFY_ATTRIBUTE_CSS = `
2355
+ /* ============================================================
2356
+ VerifyAttribute (React Parity)
2357
+ ============================================================ */
2358
+
2359
+ .thunderid-verify-attribute {
2360
+ display: flex;
2361
+ flex-direction: column;
2362
+ gap: calc(var(--thunderid-spacing-unit) * 2);
2363
+ width: 100%;
2364
+ box-sizing: border-box;
2365
+ font-family: var(--thunderid-typography-fontFamily);
2366
+ }
2367
+
2368
+ .thunderid-verify-attribute--outlined {
2369
+ padding: calc(var(--thunderid-spacing-unit) * 2);
2370
+ border: 1px solid var(--thunderid-color-border);
2371
+ border-radius: var(--thunderid-border-radius-medium, 6px);
2372
+ }
2373
+
2374
+ .thunderid-verify-attribute__header {
2375
+ display: flex;
2376
+ flex-direction: column;
2377
+ gap: calc(var(--thunderid-spacing-unit) / 2);
2378
+ }
2379
+
2380
+ .thunderid-verify-attribute__heading {
2381
+ margin: 0;
2382
+ }
2383
+
2384
+ .thunderid-verify-attribute__subheading,
2385
+ .thunderid-verify-attribute__destination {
2386
+ margin: 0;
2387
+ color: var(--thunderid-color-text-secondary);
2388
+ }
2389
+
2390
+ .thunderid-verify-attribute__content {
2391
+ display: flex;
2392
+ flex-direction: column;
2393
+ gap: calc(var(--thunderid-spacing-unit) * 1.5);
2394
+ }
2395
+
2396
+ .thunderid-verify-attribute__content .thunderid-otp-field__inputs {
2397
+ justify-content: flex-start;
2398
+ }
2399
+
2400
+ .thunderid-verify-attribute__content .thunderid-otp-field__digit {
2401
+ flex: 1 1 calc(var(--thunderid-spacing-unit) * 4);
2402
+ max-width: calc(var(--thunderid-spacing-unit) * 6);
2403
+ min-width: 0;
2404
+ }
2405
+
2406
+ .thunderid-verify-attribute__alert {
2407
+ width: 100%;
2408
+ }
2409
+
2410
+ .thunderid-verify-attribute__loading {
2411
+ display: flex;
2412
+ justify-content: center;
2413
+ padding: calc(var(--thunderid-spacing-unit) * 2);
2414
+ }
2415
+
2416
+ .thunderid-verify-attribute__actions {
2417
+ display: flex;
2418
+ align-items: center;
2419
+ justify-content: flex-end;
2420
+ gap: var(--thunderid-spacing-unit);
2421
+ }
2422
+ `;
2423
+ var VerifyAttribute_css_default = VERIFY_ATTRIBUTE_CSS;
2424
+
2267
2425
  //#endregion
2268
2426
  //#region src/components/admin/shared/Admin.css.ts
2269
2427
  /**
@@ -3831,6 +3989,13 @@ const OTP_FIELD_CSS = `
3831
3989
  cursor: not-allowed;
3832
3990
  }
3833
3991
 
3992
+ .thunderid-otp-field__separator {
3993
+ flex: none;
3994
+ color: var(--thunderid-color-text-secondary);
3995
+ font-size: var(--thunderid-typography-fontSize-xl);
3996
+ font-weight: var(--thunderid-typography-fontWeight-medium);
3997
+ }
3998
+
3834
3999
  .thunderid-otp-field__error {
3835
4000
  font-size: var(--thunderid-typography-fontSize-xs);
3836
4001
  color: var(--thunderid-color-error-contrastText);
@@ -4345,7 +4510,8 @@ const STYLES = [
4345
4510
  UserDropdown_css_default,
4346
4511
  UserProfile_css_default,
4347
4512
  Admin_css_default,
4348
- Attribution_css_default
4513
+ Attribution_css_default,
4514
+ VerifyAttribute_css_default
4349
4515
  ].join("\n");
4350
4516
  /**
4351
4517
  * Injects ThunderID Vue component styles into the document `<head>` once.
@@ -4713,7 +4879,7 @@ var useFetchAuthFlows_default = useFetchAuthFlows;
4713
4879
 
4714
4880
  //#endregion
4715
4881
  //#region src/composables/management/useInfiniteOptions.ts
4716
- const logger$4 = (0, __thunderid_browser.createPackageComponentLogger)("@thunderid/vue", "useInfiniteOptions");
4882
+ const logger$5 = (0, __thunderid_browser.createPackageComponentLogger)("@thunderid/vue", "useInfiniteOptions");
4717
4883
  /**
4718
4884
  * Keeps the option list of a `Select` that loads more options when the user asks for them. It owns the cursor,
4719
4885
  * appends each batch without duplicates, and stops at the end of the data. Vue counterpart of the React
@@ -4738,10 +4904,10 @@ const useInfiniteOptions = (args) => {
4738
4904
  cursor,
4739
4905
  options: options.value
4740
4906
  }, batch);
4741
- if (merged.issue === "cursor-stuck") logger$4.warn("A load returned no new options and the same cursor; the list was treated as finished.");
4907
+ if (merged.issue === "cursor-stuck") logger$5.warn("A load returned no new options and the same cursor; the list was treated as finished.");
4742
4908
  else if (merged.issue === "not-a-list" && !nonListLogged) {
4743
4909
  nonListLogged = true;
4744
- logger$4.warn("A load returned something other than a list of options; it was treated as an empty batch.");
4910
+ logger$5.warn("A load returned something other than a list of options; it was treated as an empty batch.");
4745
4911
  }
4746
4912
  const addedNothing = merged.options.length === options.value.length;
4747
4913
  cursor = merged.cursor;
@@ -4770,7 +4936,7 @@ const useInfiniteOptions = (args) => {
4770
4936
  try {
4771
4937
  args.onError?.(failureError);
4772
4938
  } catch (callbackFailure) {
4773
- logger$4.error("The onError callback threw.", callbackFailure);
4939
+ logger$5.error("The onError callback threw.", callbackFailure);
4774
4940
  }
4775
4941
  }
4776
4942
  } finally {
@@ -6273,6 +6439,10 @@ const OtpField = (0, vue.defineComponent)({
6273
6439
  required: {
6274
6440
  default: false,
6275
6441
  type: Boolean
6442
+ },
6443
+ separatorAfter: {
6444
+ default: void 0,
6445
+ type: Number
6276
6446
  }
6277
6447
  },
6278
6448
  emits: ["update:modelValue"],
@@ -6319,20 +6489,35 @@ const OtpField = (0, vue.defineComponent)({
6319
6489
  style: attrs.style
6320
6490
  }, [
6321
6491
  props.label ? (0, vue.h)("label", { class: (0, __thunderid_browser.withVendorCSSClassPrefix)("otp-field__label") }, [props.label, props.required ? (0, vue.h)("span", { class: (0, __thunderid_browser.withVendorCSSClassPrefix)("otp-field__required") }, " *") : null]) : null,
6322
- (0, vue.h)("div", { class: (0, __thunderid_browser.withVendorCSSClassPrefix)("otp-field__inputs") }, Array.from({ length: props.length }, (_, i) => (0, vue.h)("input", {
6492
+ (0, vue.h)("div", {
6493
+ class: (0, __thunderid_browser.withVendorCSSClassPrefix)("otp-field__inputs"),
6494
+ style: props.separatorAfter && props.separatorAfter > 0 && props.separatorAfter < props.length ? {
6495
+ flexWrap: "nowrap",
6496
+ justifyContent: "center",
6497
+ gap: "calc(var(--thunderid-spacing-unit) * 0.5)"
6498
+ } : void 0
6499
+ }, Array.from({ length: props.length }, (_, i) => [(0, vue.h)("input", {
6323
6500
  "aria-label": `Digit ${i + 1}`,
6324
6501
  class: (0, __thunderid_browser.withVendorCSSClassPrefix)("otp-field__digit"),
6325
6502
  disabled: props.disabled,
6326
6503
  inputmode: props.numericOnly ? "numeric" : "text",
6327
- key: i,
6504
+ key: `digit-${i}`,
6328
6505
  maxlength: 1,
6329
6506
  onInput: (e) => handleInput(i, e),
6330
6507
  onKeydown: (e) => handleKeydown(i, e),
6331
6508
  onPaste: (e) => handlePaste(i, e),
6332
6509
  ref: (el) => setRef(el, i),
6510
+ style: props.separatorAfter && props.separatorAfter > 0 && props.separatorAfter < props.length ? {
6511
+ width: "calc(var(--thunderid-spacing-unit) * 3.5)",
6512
+ height: "calc(var(--thunderid-spacing-unit) * 4.5)"
6513
+ } : void 0,
6333
6514
  type: "text",
6334
6515
  value: digits[i]
6335
- }))),
6516
+ }), props.separatorAfter === i + 1 ? (0, vue.h)("span", {
6517
+ "aria-hidden": "true",
6518
+ class: (0, __thunderid_browser.withVendorCSSClassPrefix)("otp-field__separator"),
6519
+ key: "separator"
6520
+ }, "-") : null]).flat()),
6336
6521
  props.error ? (0, vue.h)("span", { class: (0, __thunderid_browser.withVendorCSSClassPrefix)("otp-field__error") }, props.error) : null
6337
6522
  ]);
6338
6523
  };
@@ -6984,7 +7169,7 @@ var SignUpButton_default = SignUpButton;
6984
7169
 
6985
7170
  //#endregion
6986
7171
  //#region src/components/auth/Callback.ts
6987
- const logger$3 = createVueLogger("Callback");
7172
+ const logger$4 = createVueLogger("Callback");
6988
7173
  /**
6989
7174
  * Callback — headless component that handles OAuth callback parameter forwarding.
6990
7175
  *
@@ -7073,7 +7258,7 @@ const Callback = (0, vue.defineComponent)({
7073
7258
  navigate$4(`${returnPath}?${params.toString()}`);
7074
7259
  } catch (err) {
7075
7260
  const errorMessage = err instanceof Error ? err.message : "OAuth callback processing failed";
7076
- logger$3.error("OAuth callback error:", err);
7261
+ logger$4.error("OAuth callback error:", err);
7077
7262
  props.onError?.(err instanceof Error ? err : new Error(errorMessage));
7078
7263
  const params = new URLSearchParams();
7079
7264
  params.set("error", "callback_error");
@@ -7372,7 +7557,7 @@ const validateFieldValue = (value, type, required = false, touched = false) => {
7372
7557
  * Factory function to create form field VNodes based on FieldType.
7373
7558
  */
7374
7559
  const createField = (config) => {
7375
- const { name, type, label, required, value, onChange, onBlur, disabled = false, error, className, options = [], touched = false, placeholder, length, numericOnly = true } = config;
7560
+ const { name, type, label, required, value, onChange, onBlur, disabled = false, error, className, options = [], touched = false, placeholder, length, numericOnly = true, separatorAfter } = config;
7376
7561
  const validationError = error || validateFieldValue(value, type, required, touched);
7377
7562
  const commonProps = {
7378
7563
  class: className,
@@ -7425,6 +7610,7 @@ const createField = (config) => {
7425
7610
  ...commonProps,
7426
7611
  ...length ? { length } : {},
7427
7612
  numericOnly,
7613
+ ...separatorAfter ? { separatorAfter } : {},
7428
7614
  "onUpdate:modelValue": onChange
7429
7615
  });
7430
7616
  case __thunderid_browser.FieldType.Number: return (0, vue.h)(TextField_default, {
@@ -8084,7 +8270,7 @@ var MicrosoftButton_default = MicrosoftButton;
8084
8270
 
8085
8271
  //#endregion
8086
8272
  //#region src/components/auth/flow/AuthOptionFactoryCore.ts
8087
- const logger$2 = createVueLogger("AuthOptionFactory");
8273
+ const logger$3 = createVueLogger("AuthOptionFactory");
8088
8274
  /**
8089
8275
  * Replaces `emoji:` URIs embedded in HTML before DOMPurify sanitization.
8090
8276
  *
@@ -8187,9 +8373,20 @@ const createAuthComponentFromFlow = (component, formValues, touchedFields, formE
8187
8373
  };
8188
8374
  };
8189
8375
  const skipUnsupported = (typeName) => {
8190
- logger$2.warn(`Unsupported component type: ${typeName}. Skipping render.`);
8376
+ logger$3.warn(`Unsupported component type: ${typeName}. Skipping render.`);
8191
8377
  return null;
8192
8378
  };
8379
+ if (component.type === __thunderid_browser.EmbeddedFlowComponentType.Resend && options.renderResend) return (0, vue.h)(Button_default, {
8380
+ class: options.buttonClassName,
8381
+ color: "primary",
8382
+ disabled: isLoading || options.isTimeoutDisabled,
8383
+ fullWidth: true,
8384
+ id: component.id,
8385
+ key,
8386
+ onClick: () => options.onSubmit?.(component, {}, true),
8387
+ type: "button",
8388
+ variant: "text"
8389
+ }, { default: () => resolve(component.label) });
8193
8390
  switch (component.type) {
8194
8391
  case __thunderid_browser.EmbeddedFlowComponentType.TextInput:
8195
8392
  case __thunderid_browser.EmbeddedFlowComponentType.PasswordInput:
@@ -8214,11 +8411,13 @@ const createAuthComponentFromFlow = (component, formValues, touchedFields, formE
8214
8411
  }
8215
8412
  case __thunderid_browser.EmbeddedFlowComponentType.OtpInput: {
8216
8413
  const identifier = component.ref ?? "";
8217
- const value = formValues[identifier] || "";
8414
+ const isDeviceUserCode = identifier === "user_code";
8415
+ const currentValue = formValues[identifier] || "";
8416
+ const value = isDeviceUserCode ? currentValue.replace(/[-\s]/g, "").toUpperCase() : currentValue;
8218
8417
  const error = touchedFields[identifier] || false ? formErrors[identifier] : void 0;
8219
8418
  const reportedLength = Number(options.additionalData?.["otpLength"]);
8220
- const otpLength = Number.isInteger(reportedLength) && reportedLength > 0 ? reportedLength : void 0;
8221
- const numericOnly = options.additionalData?.["otpNumericOnly"] !== "false";
8419
+ const otpLength = isDeviceUserCode ? 8 : Number.isInteger(reportedLength) && reportedLength > 0 ? reportedLength : void 0;
8420
+ const numericOnly = !isDeviceUserCode && options.additionalData?.["otpNumericOnly"] !== "false";
8222
8421
  return createField({
8223
8422
  className: options.inputClassName,
8224
8423
  error,
@@ -8226,6 +8425,7 @@ const createAuthComponentFromFlow = (component, formValues, touchedFields, formE
8226
8425
  length: otpLength,
8227
8426
  name: identifier,
8228
8427
  numericOnly,
8428
+ separatorAfter: isDeviceUserCode ? 4 : void 0,
8229
8429
  onBlur: () => options.onInputBlur?.(identifier),
8230
8430
  onChange: (newValue) => onInputChange(identifier, newValue),
8231
8431
  placeholder: resolve(component.placeholder) || "",
@@ -8439,7 +8639,7 @@ const createAuthComponentFromFlow = (component, formValues, touchedFields, formE
8439
8639
  });
8440
8640
  }
8441
8641
  case __thunderid_browser.EmbeddedFlowComponentType.Icon:
8442
- logger$2.warn(`Icon component type is not yet supported in the Vue SDK. Skipping render.`);
8642
+ logger$3.warn(`Icon component type is not yet supported in the Vue SDK. Skipping render.`);
8443
8643
  return null;
8444
8644
  case __thunderid_browser.EmbeddedFlowComponentType.Stack: {
8445
8645
  const direction = component.direction || "row";
@@ -8505,7 +8705,7 @@ const createAuthComponentFromFlow = (component, formValues, touchedFields, formE
8505
8705
  });
8506
8706
  }
8507
8707
  default:
8508
- logger$2.warn(`Unsupported component type: ${component.type}. Skipping render.`);
8708
+ logger$3.warn(`Unsupported component type: ${component.type}. Skipping render.`);
8509
8709
  return null;
8510
8710
  }
8511
8711
  };
@@ -8525,6 +8725,15 @@ const renderSignUpComponents = (components, formValues, touchedFields, formError
8525
8725
  key: component.id || index
8526
8726
  })).filter((v) => v !== null);
8527
8727
  /**
8728
+ * Processes an array of components and renders them as VNodes for self attribute verification.
8729
+ * Identical to renderSignUpComponents, except that it renders RESEND actions.
8730
+ */
8731
+ const renderVerificationComponents = (components, formValues, touchedFields, formErrors, isLoading, isFormValid, resetForm, onInputChange, options) => components.map((component, index) => createAuthComponentFromFlow(component, formValues, touchedFields, formErrors, isLoading, isFormValid, resetForm, onInputChange, {
8732
+ ...options,
8733
+ key: component.id ?? index,
8734
+ renderResend: true
8735
+ })).filter((v) => v !== null);
8736
+ /**
8528
8737
  * Processes an array of components and renders them as VNodes for invite-user flows.
8529
8738
  * Identical to renderSignInComponents — separated for semantic clarity.
8530
8739
  */
@@ -9874,7 +10083,7 @@ var getAuthComponentHeadings_default = getAuthComponentHeadings;
9874
10083
 
9875
10084
  //#endregion
9876
10085
  //#region src/components/auth/sign-up/BaseSignUp.ts
9877
- const logger$1 = createVueLogger("BaseSignUp");
10086
+ const logger$2 = createVueLogger("BaseSignUp");
9878
10087
  const extractFormFields = (components) => {
9879
10088
  const fields = [];
9880
10089
  const process = (comps) => {
@@ -10101,7 +10310,7 @@ const BaseSignUp = (0, vue.defineComponent)({
10101
10310
  if (reusablePopup) reusablePopup.location.href = redirectUrl;
10102
10311
  const popup = reusablePopup ?? window.open(redirectUrl, "oauth_popup", "width=500,height=600,scrollbars=yes,resizable=yes");
10103
10312
  if (!popup) {
10104
- logger$1.error("Failed to open popup window");
10313
+ logger$2.error("Failed to open popup window");
10105
10314
  return false;
10106
10315
  }
10107
10316
  let hasProcessedCallback = false;
@@ -10177,7 +10386,7 @@ const BaseSignUp = (0, vue.defineComponent)({
10177
10386
  if (!isThisRound(state)) return;
10178
10387
  hasProcessedCallback = true;
10179
10388
  if (error) {
10180
- logger$1.error("OAuth error");
10389
+ logger$2.error("OAuth error");
10181
10390
  popup.close();
10182
10391
  cleanup();
10183
10392
  return;
@@ -10186,7 +10395,7 @@ const BaseSignUp = (0, vue.defineComponent)({
10186
10395
  }
10187
10396
  } catch {}
10188
10397
  } catch {
10189
- logger$1.error("Error monitoring popup");
10398
+ logger$2.error("Error monitoring popup");
10190
10399
  }
10191
10400
  }, 1e3);
10192
10401
  return true;
@@ -10694,7 +10903,8 @@ const FIELDS_TO_SKIP = [
10694
10903
  "preferredMFAOption",
10695
10904
  "attributes",
10696
10905
  "isReadOnly",
10697
- "isReadonly"
10906
+ "isReadonly",
10907
+ __thunderid_browser.AttributeVerificationConstants.VERIFIED_ATTRIBUTES_KEY
10698
10908
  ];
10699
10909
  const READONLY_FIELDS = [
10700
10910
  "username",
@@ -10733,6 +10943,11 @@ const AVATAR_GRADIENTS$1 = [
10733
10943
  "linear-gradient(135deg, #14b8a6 0%, #0ea5e9 100%)",
10734
10944
  "linear-gradient(135deg, #f97316 0%, #ec4899 100%)"
10735
10945
  ];
10946
+ const isVerificationType = (type) => !!type && __thunderid_browser.AttributeVerificationConstants.VERIFIABLE_ATTRIBUTE_TYPES.includes(type.toLowerCase());
10947
+ const isVerifiedAfterSave = (type) => !!type && __thunderid_browser.AttributeVerificationConstants.VERIFY_AFTER_SAVE_ATTRIBUTE_TYPES.includes(type.toLowerCase());
10948
+ const storedValueOf = (user, name) => {
10949
+ return (user?.["attributes"])?.[name] ?? user?.[name];
10950
+ };
10736
10951
  function getAvatarGradient$1(seed) {
10737
10952
  if (!seed) return AVATAR_GRADIENTS$1[0];
10738
10953
  let hash = 0;
@@ -10847,6 +11062,52 @@ const BaseUserProfile = (0, vue.defineComponent)({
10847
11062
  }
10848
11063
  return fallback ?? key;
10849
11064
  };
11065
+ const tp = (key, params = {}) => {
11066
+ const translate = props.t;
11067
+ const res = translate?.(key, params);
11068
+ if (res && res !== key) return res;
11069
+ const fallback = ((0, __thunderid_browser.getDefaultI18nBundles)()["en-US"]?.translations)?.[key];
11070
+ return fallback ? (0, __thunderid_browser.substituteTranslationParams)(fallback, params) : key;
11071
+ };
11072
+ const i18n = (0, vue.inject)(I18N_KEY, null);
11073
+ const verifyingField = (0, vue.ref)(null);
11074
+ const verifiedNotice = (0, vue.ref)(null);
11075
+ const verificationDialogRef = (0, vue.ref)(null);
11076
+ let focusBeforeDialog = null;
11077
+ const openVerification = (name) => {
11078
+ verifiedNotice.value = null;
11079
+ verifyingField.value = name;
11080
+ };
11081
+ (0, vue.watch)(verifyingField, (name, previous) => {
11082
+ if (props.compact) return;
11083
+ if (name && !previous) {
11084
+ focusBeforeDialog = document.activeElement;
11085
+ (0, vue.nextTick)(() => verificationDialogRef.value?.focus());
11086
+ } else if (!name && previous) {
11087
+ focusBeforeDialog?.focus();
11088
+ focusBeforeDialog = null;
11089
+ }
11090
+ });
11091
+ const pendingVerification = (0, vue.ref)(null);
11092
+ const storedUser = () => props.flattenedProfile ?? props.profile ?? null;
11093
+ const reportedVerifiedAttributes = () => (0, __thunderid_browser.getVerifiedAttributes)(props.profile ?? props.flattenedProfile);
11094
+ (0, vue.watch)(() => [
11095
+ props.profile,
11096
+ props.flattenedProfile,
11097
+ props.error
11098
+ ], () => {
11099
+ const pending = pendingVerification.value;
11100
+ if (!pending) return;
11101
+ if (props.error) {
11102
+ pendingVerification.value = null;
11103
+ return;
11104
+ }
11105
+ const storedValue = storedValueOf(storedUser(), pending.name);
11106
+ if (storedValue === pending.previousValue) return;
11107
+ const verified = reportedVerifiedAttributes();
11108
+ if (verified && typeof storedValue === "string" && storedValue.trim() !== "" && !verified[pending.name]) openVerification(pending.name);
11109
+ pendingVerification.value = null;
11110
+ });
10850
11111
  function shouldShowField(fieldName, isSchemaBased = false) {
10851
11112
  if (!isSchemaBased && FIELDS_TO_SKIP.includes(fieldName)) return false;
10852
11113
  if (props.hideFields && props.hideFields.length > 0 && props.hideFields.includes(fieldName)) return false;
@@ -10868,6 +11129,11 @@ const BaseUserProfile = (0, vue.defineComponent)({
10868
11129
  [fieldName]: ""
10869
11130
  };
10870
11131
  }
11132
+ function clearEditedValue(fieldName) {
11133
+ const next = { ...editedValues.value };
11134
+ delete next[fieldName];
11135
+ editedValues.value = next;
11136
+ }
10871
11137
  function cancelEditing(fieldName) {
10872
11138
  const data = props.flattenedProfile ?? props.profile ?? null;
10873
11139
  const originalValue = data?.[fieldName] ?? data?.attributes?.[fieldName] ?? "";
@@ -10919,14 +11185,124 @@ const BaseUserProfile = (0, vue.defineComponent)({
10919
11185
  ...fieldErrors.value,
10920
11186
  [fieldName]: ""
10921
11187
  };
10922
- const payload = buildPatchValue(fieldName, typeof value === "string" ? strVal : value, schema.schemaId, schema.multiValued);
11188
+ const submitVal = typeof value === "string" ? strVal : value;
11189
+ const payload = buildPatchValue(fieldName, submitVal, schema.schemaId, schema.multiValued);
11190
+ const previousValue = storedValueOf(storedUser(), fieldName);
11191
+ pendingVerification.value = slots["verification"] && isVerifiedAfterSave(schema.type) && (0, __thunderid_browser.isVerifiableAttribute)(props.userSchema, fieldName) && typeof submitVal === "string" && submitVal !== "" && submitVal !== previousValue ? {
11192
+ name: fieldName,
11193
+ previousValue
11194
+ } : null;
10923
11195
  try {
10924
11196
  await props.onUpdate(payload);
10925
11197
  editingFields.value = {
10926
11198
  ...editingFields.value,
10927
11199
  [fieldName]: false
10928
11200
  };
10929
- } catch {}
11201
+ clearEditedValue(fieldName);
11202
+ } catch {
11203
+ pendingVerification.value = null;
11204
+ }
11205
+ }
11206
+ function renderVerificationStatus(name) {
11207
+ const verification = reportedVerifiedAttributes()?.[name];
11208
+ let verifiedAtText;
11209
+ if (verification?.verifiedAt) {
11210
+ const verifiedAt = new Date(verification.verifiedAt);
11211
+ verifiedAtText = tp("user.verification.status.verified_at", { date: Number.isNaN(verifiedAt.getTime()) ? verification.verifiedAt : verifiedAt.toLocaleString(i18n?.currentLanguage?.value ?? props.preferences?.i18n?.language) });
11212
+ }
11213
+ const modifier = verification ? "verified" : "unverified";
11214
+ return (0, vue.h)("span", {
11215
+ class: [px("user-profile__verification-status"), px(`user-profile__verification-status--${modifier}`)].join(" "),
11216
+ "data-testid": `thunderid-verification-status-${name}`,
11217
+ title: verifiedAtText
11218
+ }, [
11219
+ (0, vue.h)(verification ? CircleCheckIcon : CircleAlertIcon),
11220
+ tp(`user.verification.status.${modifier}`),
11221
+ verifiedAtText ? (0, vue.h)("span", { class: px("user-profile__visually-hidden") }, ` (${verifiedAtText})`) : null
11222
+ ]);
11223
+ }
11224
+ const verificationStatusOf = (name) => {
11225
+ const verified = reportedVerifiedAttributes();
11226
+ const stored = storedValueOf(storedUser(), name);
11227
+ if (!verified || !(0, __thunderid_browser.isVerifiableAttribute)(props.userSchema, name)) return null;
11228
+ if (typeof stored !== "string" || stored.trim() === "") return null;
11229
+ return verified[name] ? "verified" : "unverified";
11230
+ };
11231
+ const verificationRenderProps = () => {
11232
+ const canVerify = (name) => Boolean(props.editable) && !!slots["verification"] && verificationStatusOf(name) === "unverified";
11233
+ return {
11234
+ canVerify,
11235
+ cancelVerification: () => {
11236
+ verifyingField.value = null;
11237
+ },
11238
+ renderVerification: () => {
11239
+ const name = verifyingField.value;
11240
+ if (!name) return null;
11241
+ return buildVerificationPanel({
11242
+ displayName: props.userSchema?.[name]?.displayName,
11243
+ name
11244
+ });
11245
+ },
11246
+ verificationStatus: verificationStatusOf,
11247
+ verifiedAttributes: reportedVerifiedAttributes(),
11248
+ verify: (name) => {
11249
+ if (canVerify(name)) openVerification(name);
11250
+ },
11251
+ verifyingAttribute: verifyingField.value
11252
+ };
11253
+ };
11254
+ function buildVerificationPanel(schema) {
11255
+ const name = schema.name;
11256
+ if (!slots["verification"] || !name || verifyingField.value !== name) return null;
11257
+ const attributeDisplayName = schema.displayName ?? (0, __thunderid_browser.startCase)(name);
11258
+ return (0, vue.h)("div", { class: [px("user-profile__verification"), props.compact ? px("user-profile__verification--inline") : ""].filter(Boolean).join(" ") }, slots["verification"]({
11259
+ attribute: name,
11260
+ attributeDisplayName,
11261
+ onCancel: () => {
11262
+ verifyingField.value = null;
11263
+ },
11264
+ onComplete: () => {
11265
+ verifyingField.value = null;
11266
+ verifiedNotice.value = attributeDisplayName;
11267
+ }
11268
+ }));
11269
+ }
11270
+ function handleDialogKeydown(event) {
11271
+ if (event.key === "Escape") {
11272
+ event.stopPropagation();
11273
+ verifyingField.value = null;
11274
+ return;
11275
+ }
11276
+ if (event.key !== "Tab" || !verificationDialogRef.value) return;
11277
+ const focusables = Array.from(verificationDialogRef.value.querySelectorAll("button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])"));
11278
+ if (focusables.length === 0) return;
11279
+ const first = focusables[0];
11280
+ const last = focusables[focusables.length - 1];
11281
+ if (event.shiftKey && (document.activeElement === first || document.activeElement === verificationDialogRef.value)) {
11282
+ event.preventDefault();
11283
+ last.focus();
11284
+ } else if (!event.shiftKey && document.activeElement === last) {
11285
+ event.preventDefault();
11286
+ first.focus();
11287
+ }
11288
+ }
11289
+ function renderVerificationPanel(schema) {
11290
+ const panel = buildVerificationPanel(schema);
11291
+ if (!panel || props.compact) return panel;
11292
+ return (0, vue.h)(vue.Teleport, { to: "body" }, [(0, vue.h)("div", {
11293
+ class: px("user-profile__verification-overlay"),
11294
+ onClick: (event) => {
11295
+ if (event.target === event.currentTarget) verifyingField.value = null;
11296
+ }
11297
+ }, [(0, vue.h)("div", {
11298
+ "aria-label": tp("user.verification.heading", { attribute: schema.displayName ?? (0, __thunderid_browser.startCase)(schema.name) }),
11299
+ "aria-modal": "true",
11300
+ class: px("user-profile__verification-dialog"),
11301
+ onKeydown: handleDialogKeydown,
11302
+ ref: verificationDialogRef,
11303
+ role: "dialog",
11304
+ tabindex: -1
11305
+ }, [panel])])]);
10930
11306
  }
10931
11307
  function renderInput(schema) {
10932
11308
  const fieldName = schema.name ?? "";
@@ -10975,6 +11351,9 @@ const BaseUserProfile = (0, vue.defineComponent)({
10975
11351
  const isEditing = Boolean(editingFields.value[name]);
10976
11352
  const hasValue = value !== void 0 && value !== null && value !== "";
10977
11353
  if (!hasValue && !isEditing && !(isEditable && mutability === "READ_WRITE")) return null;
11354
+ const verified = reportedVerifiedAttributes();
11355
+ const showsVerificationStatus = verified !== void 0 && hasValue && !isEditing && isVerificationType(schema.type);
11356
+ const canVerify = Boolean(props.editable) && !!slots["verification"] && showsVerificationStatus && !verified?.[name] && verifyingField.value !== name && (0, __thunderid_browser.isVerifiableAttribute)(props.userSchema, name) && typeof value === "string";
10978
11357
  const editablePlaceholder = isEditable ? (0, vue.h)("span", {
10979
11358
  class: px("user-profile__field-placeholder"),
10980
11359
  onClick: () => startEditing(name, value)
@@ -10983,25 +11362,44 @@ const BaseUserProfile = (0, vue.defineComponent)({
10983
11362
  return (0, vue.h)("div", {
10984
11363
  class: px("user-profile__field"),
10985
11364
  key: name
10986
- }, [(0, vue.h)("div", { class: px("user-profile__field-inner") }, [(0, vue.h)("span", { class: px("user-profile__field-label") }, label), isEditing ? (0, vue.h)("div", { class: px("user-profile__field-edit") }, [renderInput(schema), fieldErrors.value[name] ? (0, vue.h)("div", { class: px("user-profile__field-error") }, fieldErrors.value[name]) : null]) : displayValueNode]), isEditable && !isReadonly ? (0, vue.h)("div", { class: px("user-profile__field-actions") }, [isEditing ? [(0, vue.h)(Button_default, {
10987
- color: "primary",
10988
- onClick: () => saveField(schema),
10989
- size: "small",
10990
- variant: "solid"
10991
- }, () => t("userProfile.actions.save", "Save")), (0, vue.h)(Button_default, {
10992
- color: "secondary",
10993
- onClick: () => cancelEditing(name),
10994
- size: "small",
10995
- variant: "solid"
10996
- }, () => t("userProfile.actions.cancel", "Cancel"))] : hasValue ? (0, vue.h)(Button_default, {
10997
- class: px("user-profile__field-edit-btn"),
10998
- color: "secondary",
10999
- onClick: () => startEditing(name, value),
11000
- size: "small",
11001
- startIcon: (0, vue.h)(PencilIcon),
11002
- title: t("userProfile.actions.edit", "Edit"),
11003
- variant: "ghost"
11004
- }) : null]) : null]);
11365
+ }, [
11366
+ (0, vue.h)("div", { class: px("user-profile__field-inner") }, [
11367
+ (0, vue.h)("span", { class: px("user-profile__field-label") }, label),
11368
+ isEditing ? (0, vue.h)("div", { class: px("user-profile__field-edit") }, [renderInput(schema), fieldErrors.value[name] ? (0, vue.h)("div", { class: px("user-profile__field-error") }, fieldErrors.value[name]) : null]) : displayValueNode,
11369
+ showsVerificationStatus ? renderVerificationStatus(name) : null
11370
+ ]),
11371
+ canVerify ? (0, vue.h)("div", { class: px("user-profile__field-actions") }, [(0, vue.h)(Button_default, {
11372
+ class: px("user-profile__verify-button"),
11373
+ color: "primary",
11374
+ "data-testid": `thunderid-verify-${name}`,
11375
+ onClick: () => openVerification(name),
11376
+ size: "small",
11377
+ variant: "outline"
11378
+ }, () => tp("user.verification.buttons.verify.text"))]) : null,
11379
+ isEditable && !isReadonly ? (0, vue.h)("div", { class: px("user-profile__field-actions") }, [isEditing ? [(0, vue.h)(Button_default, {
11380
+ color: "primary",
11381
+ onClick: () => saveField(schema),
11382
+ size: "small",
11383
+ variant: "solid"
11384
+ }, () => t("userProfile.actions.save", "Save")), (0, vue.h)(Button_default, {
11385
+ color: "secondary",
11386
+ onClick: () => cancelEditing(name),
11387
+ size: "small",
11388
+ variant: "solid"
11389
+ }, () => t("userProfile.actions.cancel", "Cancel"))] : hasValue ? (0, vue.h)(Button_default, {
11390
+ class: px("user-profile__field-edit-btn"),
11391
+ color: "secondary",
11392
+ onClick: () => {
11393
+ if (verifyingField.value === name) verifyingField.value = null;
11394
+ verifiedNotice.value = null;
11395
+ startEditing(name, value);
11396
+ },
11397
+ size: "small",
11398
+ startIcon: (0, vue.h)(PencilIcon),
11399
+ title: t("userProfile.actions.edit", "Edit"),
11400
+ variant: "ghost"
11401
+ }) : null]) : null
11402
+ ]);
11005
11403
  }
11006
11404
  function renderProfileWithoutSchemas() {
11007
11405
  const data = props.flattenedProfile || props.profile;
@@ -11035,12 +11433,14 @@ const BaseUserProfile = (0, vue.defineComponent)({
11035
11433
  if (!data && !props.isLoading) return slots["default"] ? slots["default"]({
11036
11434
  error: props.error,
11037
11435
  isLoading: props.isLoading,
11038
- profile: null
11436
+ profile: null,
11437
+ ...verificationRenderProps()
11039
11438
  }) : null;
11040
11439
  if (slots["default"]) return slots["default"]({
11041
11440
  error: props.error,
11042
11441
  isLoading: props.isLoading,
11043
- profile: data
11442
+ profile: data,
11443
+ ...verificationRenderProps()
11044
11444
  });
11045
11445
  const currentUser = data;
11046
11446
  const schemas = props.schemas ?? [];
@@ -11056,6 +11456,14 @@ const BaseUserProfile = (0, vue.defineComponent)({
11056
11456
  class: px("user-profile__error"),
11057
11457
  severity: "error"
11058
11458
  }, () => props.error));
11459
+ if (verifiedNotice.value) {
11460
+ const attribute = verifiedNotice.value;
11461
+ children.push((0, vue.h)(Alert_default, {
11462
+ class: px("user-profile__verification-notice"),
11463
+ "data-testid": "thunderid-verification-notice",
11464
+ severity: "success"
11465
+ }, () => tp("user.verification.success", { attribute })));
11466
+ }
11059
11467
  if (props.isLoading) children.push((0, vue.h)("div", { class: px("user-profile__loading") }, [(0, vue.h)(Spinner_default)]));
11060
11468
  else if (props.userSchema && typeof props.userSchema === "object" && Object.keys(props.userSchema).length > 0) {
11061
11469
  const fieldRows = Object.entries(props.userSchema).filter(([key, metaAttr]) => {
@@ -11073,7 +11481,11 @@ const BaseUserProfile = (0, vue.defineComponent)({
11073
11481
  type: (metaAttr.type ?? "STRING").toUpperCase(),
11074
11482
  value: val
11075
11483
  };
11076
- }).map((schema) => renderSchemaFieldRow(schema)).filter((node) => node !== null);
11484
+ }).map((schema) => {
11485
+ const row = renderSchemaFieldRow(schema);
11486
+ const panel = row ? renderVerificationPanel(schema) : null;
11487
+ return panel ? (0, vue.h)(vue.Fragment, { key: schema.name }, [row, panel]) : row;
11488
+ }).filter((node) => node !== null);
11077
11489
  children.push((0, vue.h)("div", { class: px("user-profile__fields") }, fieldRows));
11078
11490
  } else if (hasSchemas) {
11079
11491
  const fieldRows = schemas.filter((s) => s.name && shouldShowField(s.name)).sort((a, b) => {
@@ -11124,44 +11536,566 @@ const updateMeProfile = async ({ fetcher, instanceId = 0,...requestConfig }) =>
11124
11536
  var updateMeProfile_default = updateMeProfile;
11125
11537
 
11126
11538
  //#endregion
11127
- //#region src/components/account/user-profile/UserProfile.ts
11128
- const UserProfile = (0, vue.defineComponent)({
11129
- name: "UserProfile",
11539
+ //#region src/components/admin/shared/useAdminTranslation.ts
11540
+ /**
11541
+ * Returns a translation function that honors component-level `preferences.i18n.bundles` over the
11542
+ * provider's bundles, falling back to the configured fallback language and then to the provider.
11543
+ * Reactive when called from a render function, since it reads the current language.
11544
+ *
11545
+ * @param getPreferences - Getter for the component's `preferences` prop.
11546
+ * @returns The translation function.
11547
+ */
11548
+ const useAdminTranslation = (getPreferences) => {
11549
+ const i18n = useI18n_default();
11550
+ return (key, params) => {
11551
+ const bundles = getPreferences()?.i18n?.bundles;
11552
+ if (bundles) {
11553
+ const lookup = (language) => {
11554
+ const bundle = bundles[language];
11555
+ if (!bundle) return;
11556
+ return (0, __thunderid_browser.normalizeTranslations)(bundle.translations)[key];
11557
+ };
11558
+ const translation = lookup(i18n.currentLanguage.value) ?? lookup(i18n.fallbackLanguage);
11559
+ if (translation) return (0, __thunderid_browser.substituteTranslationParams)(translation, params);
11560
+ }
11561
+ return i18n.t(key, params);
11562
+ };
11563
+ };
11564
+ var useAdminTranslation_default = useAdminTranslation;
11565
+
11566
+ //#endregion
11567
+ //#region src/components/account/verify-attribute/BaseVerifyAttribute.ts
11568
+ const collectFlowIds = ({ actions, inputs }) => ({
11569
+ actions: new Set(actions.map((component) => component.id)),
11570
+ fields: new Set(inputs.map((component) => component.ref ?? component.id))
11571
+ });
11572
+ const withFlowTestIds = (node, ids) => {
11573
+ const name = node.props?.["name"];
11574
+ let testId;
11575
+ if (typeof name === "string" && ids.fields.has(name)) testId = `thunderid-field-${name}`;
11576
+ else if (node.key !== null && ids.actions.has(String(node.key))) testId = `thunderid-action-${String(node.key)}`;
11577
+ const children = Array.isArray(node.children) ? node.children.map((child) => (0, vue.isVNode)(child) ? withFlowTestIds(child, ids) : child) : node.children;
11578
+ if (!testId && children === node.children) return node;
11579
+ const tagged = (0, vue.cloneVNode)(node, testId ? { "data-testid": testId } : null);
11580
+ tagged.children = children;
11581
+ return tagged;
11582
+ };
11583
+ /**
11584
+ * BaseVerifyAttribute renders the server-described steps of a self attribute verification flow.
11585
+ * It takes the flow calls as props, so it stays independent of how the request reaches the server.
11586
+ *
11587
+ * It starts the flow once per mount, since starting one sends a message, and never retries a start
11588
+ * that failed.
11589
+ */
11590
+ const BaseVerifyAttribute = (0, vue.defineComponent)({
11591
+ name: "BaseVerifyAttribute",
11130
11592
  props: {
11131
- avatarSize: {
11132
- default: "lg",
11593
+ attributeDisplayName: {
11594
+ default: "",
11133
11595
  type: String
11134
11596
  },
11135
- cardLayout: {
11136
- default: true,
11137
- type: Boolean
11138
- },
11139
- cardVariant: {
11140
- default: "elevated",
11597
+ buttonClassName: {
11598
+ default: "",
11141
11599
  type: String
11142
11600
  },
11143
11601
  className: {
11144
11602
  default: "",
11145
11603
  type: String
11146
11604
  },
11147
- compact: {
11148
- default: false,
11149
- type: Boolean
11605
+ inputClassName: {
11606
+ default: "",
11607
+ type: String
11150
11608
  },
11151
- editable: {
11609
+ isInitialized: {
11152
11610
  default: true,
11153
11611
  type: Boolean
11154
11612
  },
11155
- hideFields: {
11156
- default: () => [],
11157
- type: Array
11613
+ onCancel: {
11614
+ default: void 0,
11615
+ type: Function
11158
11616
  },
11159
- preferences: {
11617
+ onComplete: {
11160
11618
  default: void 0,
11161
- type: Object
11619
+ type: Function
11162
11620
  },
11163
- showAvatar: {
11164
- default: true,
11621
+ onDone: {
11622
+ default: void 0,
11623
+ type: Function
11624
+ },
11625
+ onError: {
11626
+ default: void 0,
11627
+ type: Function
11628
+ },
11629
+ onFlowChange: {
11630
+ default: void 0,
11631
+ type: Function
11632
+ },
11633
+ onInitialize: {
11634
+ default: void 0,
11635
+ type: Function
11636
+ },
11637
+ onSubmit: {
11638
+ default: void 0,
11639
+ type: Function
11640
+ },
11641
+ preferences: {
11642
+ default: void 0,
11643
+ type: Object
11644
+ },
11645
+ showSubtitle: {
11646
+ default: true,
11647
+ type: Boolean
11648
+ },
11649
+ showTitle: {
11650
+ default: true,
11651
+ type: Boolean
11652
+ },
11653
+ size: {
11654
+ default: "medium",
11655
+ type: String
11656
+ },
11657
+ variant: {
11658
+ default: "outlined",
11659
+ type: String
11660
+ }
11661
+ },
11662
+ setup(props, { slots }) {
11663
+ const { meta: flowMetaRef } = useFlowMeta_default();
11664
+ const t = useAdminTranslation_default(() => props.preferences);
11665
+ const state = (0, vue.ref)("loading");
11666
+ const isSubmitting = (0, vue.ref)(false);
11667
+ const currentFlow = (0, vue.ref)(null);
11668
+ const error = (0, vue.ref)(null);
11669
+ const formValues = (0, vue.ref)({});
11670
+ const touchedFields = (0, vue.ref)({});
11671
+ const formErrors = (0, vue.ref)({});
11672
+ const isFormValid = (0, vue.ref)(true);
11673
+ let initializationAttempted = false;
11674
+ let challengeToken = null;
11675
+ const meta = () => flowMetaRef?.value ?? null;
11676
+ const labelParams = () => ({ attribute: props.attributeDisplayName ?? "" });
11677
+ const normalize = (response) => {
11678
+ if (!response?.data || Array.isArray(response.data.components)) return response;
11679
+ const { components } = normalizeFlowResponse(response, t, {
11680
+ defaultErrorKey: "user.verification.error",
11681
+ resolveTranslations: false,
11682
+ throwOnError: false
11683
+ }, meta());
11684
+ return {
11685
+ ...response,
11686
+ data: {
11687
+ ...response.data,
11688
+ components
11689
+ }
11690
+ };
11691
+ };
11692
+ const inputs = () => (0, __thunderid_browser.getFlowStepComponents)(currentFlow.value?.data?.components ?? []).inputs;
11693
+ const validate = () => {
11694
+ const errors = {};
11695
+ const touched = {};
11696
+ inputs().forEach((component) => {
11697
+ const name = component.ref ?? component.id;
11698
+ const value = formValues.value[name] ?? "";
11699
+ const ruleValidator = (0, __thunderid_browser.buildValidatorFromRules)(component.validation);
11700
+ touched[name] = true;
11701
+ if (component.required && value.trim() === "") errors[name] = t("validations.required.field.error");
11702
+ else if (ruleValidator && value) {
11703
+ const ruleMessage = ruleValidator(value);
11704
+ if (ruleMessage) errors[name] = t(ruleMessage);
11705
+ }
11706
+ });
11707
+ touchedFields.value = touched;
11708
+ formErrors.value = errors;
11709
+ isFormValid.value = Object.keys(errors).length === 0;
11710
+ return isFormValid.value;
11711
+ };
11712
+ const resetForm = () => {
11713
+ formValues.value = {};
11714
+ touchedFields.value = {};
11715
+ isFormValid.value = true;
11716
+ const errors = {};
11717
+ const touched = {};
11718
+ (currentFlow.value?.data?.fieldErrors ?? []).forEach((fieldError) => {
11719
+ if (!(fieldError.identifier in errors)) {
11720
+ errors[fieldError.identifier] = fieldError.message;
11721
+ touched[fieldError.identifier] = true;
11722
+ }
11723
+ });
11724
+ formErrors.value = errors;
11725
+ touchedFields.value = touched;
11726
+ };
11727
+ const handleResponse = (rawResponse) => {
11728
+ const response = normalize(rawResponse);
11729
+ props.onFlowChange?.(response);
11730
+ if (response.challengeToken !== void 0) challengeToken = response.challengeToken ?? null;
11731
+ if (response.flowStatus === __thunderid_browser.EmbeddedSelfFlowStatus.Error) {
11732
+ const message = extractErrorMessage(response, t, "user.verification.error");
11733
+ error.value = message;
11734
+ state.value = "failed";
11735
+ props.onError?.(new Error(message));
11736
+ return;
11737
+ }
11738
+ if (response.flowStatus === __thunderid_browser.EmbeddedSelfFlowStatus.Complete) {
11739
+ error.value = null;
11740
+ state.value = "complete";
11741
+ props.onComplete?.(response);
11742
+ return;
11743
+ }
11744
+ const previous = currentFlow.value;
11745
+ currentFlow.value = response.data?.additionalData || !previous?.data?.additionalData ? response : {
11746
+ ...response,
11747
+ data: {
11748
+ ...response.data,
11749
+ additionalData: previous.data.additionalData
11750
+ }
11751
+ };
11752
+ resetForm();
11753
+ error.value = response.error ? extractErrorMessage(response, t, "user.verification.error") : null;
11754
+ state.value = "active";
11755
+ };
11756
+ const handleFailure = (caughtError) => {
11757
+ error.value = t("user.verification.error");
11758
+ state.value = "failed";
11759
+ props.onError?.(caughtError instanceof Error ? caughtError : new Error(String(caughtError)));
11760
+ };
11761
+ (0, vue.watch)(() => props.isInitialized, (initialized) => {
11762
+ if (!initialized || initializationAttempted) return;
11763
+ initializationAttempted = true;
11764
+ (async () => {
11765
+ try {
11766
+ const response = await props.onInitialize?.();
11767
+ if (response) handleResponse(response);
11768
+ } catch (caughtError) {
11769
+ handleFailure(caughtError);
11770
+ }
11771
+ })();
11772
+ }, { immediate: true });
11773
+ const handleInputChange = (name, value) => {
11774
+ formValues.value = {
11775
+ ...formValues.value,
11776
+ [name]: value
11777
+ };
11778
+ if (!isFormValid.value) validate();
11779
+ };
11780
+ const handleInputBlur = (name) => {
11781
+ touchedFields.value = {
11782
+ ...touchedFields.value,
11783
+ [name]: true
11784
+ };
11785
+ };
11786
+ const handleSubmit = async (component, data, skipValidation) => {
11787
+ if (!currentFlow.value || isSubmitting.value) return;
11788
+ if (!skipValidation && !validate()) return;
11789
+ isSubmitting.value = true;
11790
+ error.value = null;
11791
+ try {
11792
+ const stepInputs = Object.fromEntries(Object.entries(data ?? {}).filter(([, value]) => value !== null && value !== void 0 && value !== ""));
11793
+ const response = await props.onSubmit?.({
11794
+ executionId: currentFlow.value.executionId,
11795
+ ...component.id && { action: component.id },
11796
+ ...challengeToken ? { challengeToken } : {},
11797
+ inputs: stepInputs
11798
+ });
11799
+ if (response) handleResponse(response);
11800
+ } catch (caughtError) {
11801
+ handleFailure(caughtError);
11802
+ } finally {
11803
+ isSubmitting.value = false;
11804
+ }
11805
+ };
11806
+ return () => {
11807
+ const additionalData = currentFlow.value?.data?.additionalData ?? {};
11808
+ const maskedDestination = additionalData[__thunderid_browser.AttributeVerificationConstants.MASKED_DESTINATION_KEY];
11809
+ const destination = typeof maskedDestination === "string" && maskedDestination ? maskedDestination : null;
11810
+ const headings = getAuthComponentHeadings_default(currentFlow.value?.data?.components ?? [], void 0, void 0, t("user.verification.heading", labelParams()), t("user.verification.subheading.generic"));
11811
+ const { componentsWithoutHeadings } = headings;
11812
+ const step = (0, __thunderid_browser.getFlowStepComponents)(componentsWithoutHeadings);
11813
+ const flowIds = collectFlowIds(step);
11814
+ const isAwaitingLink = state.value === "active" && inputs().length === 0 && step.actions.length === 0;
11815
+ const title = (0, __thunderid_browser.resolveFlowTemplateLiterals)(headings.title, {
11816
+ meta: meta(),
11817
+ t
11818
+ });
11819
+ let subtitle = (0, __thunderid_browser.resolveFlowTemplateLiterals)(headings.subtitle, {
11820
+ meta: meta(),
11821
+ t
11822
+ });
11823
+ let destinationText = null;
11824
+ if (destination && headings.headingComponents.subheading) destinationText = t("user.verification.destination", { destination });
11825
+ else if (destination) subtitle = t(isAwaitingLink ? "user.verification.subheading.link" : "user.verification.subheading", { destination });
11826
+ const isLoading = state.value === "loading" || isSubmitting.value;
11827
+ const px = __thunderid_browser.withVendorCSSClassPrefix;
11828
+ const containerClass = [
11829
+ px("verify-attribute"),
11830
+ px(`verify-attribute--${props.size}`),
11831
+ px(`verify-attribute--${props.variant}`),
11832
+ props.className
11833
+ ].filter(Boolean).join(" ");
11834
+ if (slots["default"]) {
11835
+ const resend = state.value === "active" ? step.resend : void 0;
11836
+ const renderProps = {
11837
+ additionalData,
11838
+ components: componentsWithoutHeadings,
11839
+ destination,
11840
+ destinationText,
11841
+ error: error.value,
11842
+ fieldErrors: formErrors.value,
11843
+ handleInputChange,
11844
+ handleResend: resend ? () => handleSubmit(resend, void 0, true) : void 0,
11845
+ handleSubmit,
11846
+ isAwaitingLink,
11847
+ isComplete: state.value === "complete",
11848
+ isFailed: state.value === "failed",
11849
+ isLoading,
11850
+ isValid: isFormValid.value,
11851
+ onCancel: props.onCancel,
11852
+ onDone: isAwaitingLink ? props.onDone : void 0,
11853
+ subtitle,
11854
+ successMessage: t("user.verification.success", labelParams()),
11855
+ title,
11856
+ touched: touchedFields.value,
11857
+ values: formValues.value
11858
+ };
11859
+ return (0, vue.h)("div", { class: containerClass }, slots["default"](renderProps));
11860
+ }
11861
+ const showDone = isAwaitingLink && !!props.onDone;
11862
+ return (0, vue.h)("div", {
11863
+ "aria-busy": isLoading,
11864
+ class: containerClass
11865
+ }, [
11866
+ state.value === "active" && (props.showTitle || props.showSubtitle) ? (0, vue.h)("div", { class: px("verify-attribute__header") }, [props.showTitle ? (0, vue.h)(Typography_default, {
11867
+ class: px("verify-attribute__heading"),
11868
+ variant: "h5"
11869
+ }, () => title) : null, props.showSubtitle ? (0, vue.h)(Typography_default, {
11870
+ class: px("verify-attribute__subheading"),
11871
+ variant: "body2"
11872
+ }, () => [subtitle, destinationText ? (0, vue.h)("span", { class: px("verify-attribute__destination") }, ` ${destinationText}`) : null]) : null]) : null,
11873
+ state.value === "loading" ? (0, vue.h)("div", { class: px("verify-attribute__loading") }, [(0, vue.h)(Spinner_default)]) : null,
11874
+ error.value ? (0, vue.h)(Alert_default, {
11875
+ class: px("verify-attribute__alert"),
11876
+ severity: "error"
11877
+ }, () => error.value) : null,
11878
+ state.value === "complete" ? (0, vue.h)(Alert_default, {
11879
+ class: px("verify-attribute__alert"),
11880
+ severity: "success"
11881
+ }, () => t("user.verification.success", labelParams())) : null,
11882
+ state.value === "active" ? (0, vue.h)("div", { class: px("verify-attribute__content") }, renderVerificationComponents(componentsWithoutHeadings, formValues.value, touchedFields.value, formErrors.value, isLoading, isFormValid.value, resetForm, handleInputChange, {
11883
+ additionalData,
11884
+ buttonClassName: [px("verify-attribute__button"), props.buttonClassName].filter(Boolean).join(" "),
11885
+ inputClassName: [px("verify-attribute__input"), props.inputClassName].filter(Boolean).join(" "),
11886
+ meta: meta(),
11887
+ onInputBlur: handleInputBlur,
11888
+ onSubmit: (component, data, skip) => {
11889
+ handleSubmit(component, data, skip);
11890
+ },
11891
+ size: props.size,
11892
+ t,
11893
+ variant: props.variant
11894
+ }).map((node) => withFlowTestIds(node, flowIds))) : null,
11895
+ props.onCancel || showDone ? (0, vue.h)("div", { class: px("verify-attribute__actions") }, [showDone ? (0, vue.h)(Button_default, {
11896
+ color: "primary",
11897
+ "data-testid": "thunderid-action-verificationDone",
11898
+ onClick: () => props.onDone?.(),
11899
+ size: "small",
11900
+ variant: "solid"
11901
+ }, () => t("user.verification.buttons.done.text")) : null, props.onCancel ? (0, vue.h)(Button_default, {
11902
+ color: "secondary",
11903
+ "data-testid": "thunderid-action-verificationCancel",
11904
+ disabled: isSubmitting.value,
11905
+ onClick: () => props.onCancel?.(),
11906
+ size: "small",
11907
+ variant: "outline"
11908
+ }, () => state.value === "active" || state.value === "loading" ? t("user.verification.buttons.cancel.text") : t("user.verification.buttons.close.text")) : null]) : null
11909
+ ]);
11910
+ };
11911
+ }
11912
+ });
11913
+ var BaseVerifyAttribute_default = BaseVerifyAttribute;
11914
+
11915
+ //#endregion
11916
+ //#region src/api/auth/executeEmbeddedSelfFlow.ts
11917
+ /**
11918
+ * Executes one step of a `SELF` flow for the signed-in user, through the authenticated
11919
+ * transport that attaches the access token the flow identifies the user by.
11920
+ *
11921
+ * @param config - Configuration object with URL, payload and optional request config.
11922
+ * @returns A promise that resolves with the flow step.
11923
+ */
11924
+ const executeEmbeddedSelfFlow = async ({ fetcher, instanceId = 0,...requestConfig }) => (0, __thunderid_browser.executeEmbeddedSelfFlow)({
11925
+ ...requestConfig,
11926
+ fetcher: fetcher ?? (0, __thunderid_browser.createHttpClientFetcher)(instanceId)
11927
+ });
11928
+ var executeEmbeddedSelfFlow_default = executeEmbeddedSelfFlow;
11929
+
11930
+ //#endregion
11931
+ //#region src/components/account/verify-attribute/VerifyAttribute.ts
11932
+ const logger$1 = createVueLogger("VerifyAttribute");
11933
+ /**
11934
+ * VerifyAttribute verifies one of the signed-in user's attributes, such as their email address, by
11935
+ * running a self attribute verification flow named by `flowHandle`. The flow picks the email or mobile
11936
+ * path from the attribute's type, sends a code or a link to the attribute's current value, and the
11937
+ * component renders the steps it describes; for a link it shows a Done action. Every request carries
11938
+ * the user's access token. Once the server records the verification, and when the user selects Done,
11939
+ * it re-reads the user's profile so `useUser()` shows the new status.
11940
+ *
11941
+ * It waits for the user schema to load, and refuses an attribute the schema does not declare as an
11942
+ * `email` or `mobile` property, since starting a verification sends a message.
11943
+ *
11944
+ * Mount it with a `key` per attribute: each mount starts a new verification and sends a new code or
11945
+ * link.
11946
+ *
11947
+ * @example
11948
+ * ```vue
11949
+ * <VerifyAttribute attribute="email" @complete="open = false" @cancel="open = false" />
11950
+ * ```
11951
+ */
11952
+ const VerifyAttribute = (0, vue.defineComponent)({
11953
+ name: "VerifyAttribute",
11954
+ props: {
11955
+ attribute: {
11956
+ required: true,
11957
+ type: String
11958
+ },
11959
+ attributeDisplayName: {
11960
+ default: void 0,
11961
+ type: String
11962
+ },
11963
+ className: {
11964
+ default: "",
11965
+ type: String
11966
+ },
11967
+ flowHandle: {
11968
+ default: __thunderid_browser.AttributeVerificationConstants.DEFAULT_FLOW_HANDLE,
11969
+ type: String
11970
+ },
11971
+ onCancel: {
11972
+ default: void 0,
11973
+ type: Function
11974
+ },
11975
+ onComplete: {
11976
+ default: void 0,
11977
+ type: Function
11978
+ },
11979
+ onDone: {
11980
+ default: void 0,
11981
+ type: Function
11982
+ },
11983
+ onError: {
11984
+ default: void 0,
11985
+ type: Function
11986
+ },
11987
+ preferences: {
11988
+ default: void 0,
11989
+ type: Object
11990
+ },
11991
+ showSubtitle: {
11992
+ default: true,
11993
+ type: Boolean
11994
+ },
11995
+ showTitle: {
11996
+ default: true,
11997
+ type: Boolean
11998
+ },
11999
+ size: {
12000
+ default: "medium",
12001
+ type: String
12002
+ },
12003
+ variant: {
12004
+ default: "outlined",
12005
+ type: String
12006
+ }
12007
+ },
12008
+ setup(props, { slots }) {
12009
+ const { baseUrl, endpoints, instanceId, isInitialized, isLoading } = useThunderID_default();
12010
+ const { revalidateProfile, userSchema } = useUser_default();
12011
+ const flowExecuteUrl = (0, __thunderid_browser.resolveResourceEndpoint)("flowExecute", { endpoints }) ?? `${baseUrl}/flow/execute`;
12012
+ const execute = (payload) => executeEmbeddedSelfFlow_default({
12013
+ baseUrl,
12014
+ instanceId,
12015
+ payload,
12016
+ url: flowExecuteUrl
12017
+ });
12018
+ const handleInitialize = () => {
12019
+ if (!(0, __thunderid_browser.isVerifiableAttribute)(userSchema?.value, props.attribute)) return Promise.reject(new __thunderid_browser.ThunderIDRuntimeError(`Attribute "${props.attribute}" is not a verifiable email or mobile attribute.`, "VerifyAttribute-handleInitialize-RuntimeError-001", "vue", "Only a top-level, single-valued email or mobile attribute of the user schema can be verified."));
12020
+ return execute({
12021
+ flowType: __thunderid_browser.EmbeddedFlowType.Self,
12022
+ handle: props.flowHandle,
12023
+ inputs: { [__thunderid_browser.AttributeVerificationConstants.ATTRIBUTE_INPUT]: props.attribute }
12024
+ });
12025
+ };
12026
+ const refreshProfile = async () => {
12027
+ try {
12028
+ await revalidateProfile?.();
12029
+ } catch (caughtError) {
12030
+ logger$1.warn("Failed to re-read the user profile after verification:", caughtError);
12031
+ }
12032
+ };
12033
+ return () => (0, vue.h)(BaseVerifyAttribute_default, {
12034
+ attributeDisplayName: props.attributeDisplayName ?? userSchema?.value?.[props.attribute]?.displayName ?? (0, __thunderid_browser.startCase)(props.attribute),
12035
+ class: (0, __thunderid_browser.withVendorCSSClassPrefix)("verify-attribute--styled"),
12036
+ className: props.className,
12037
+ isInitialized: isInitialized.value && !isLoading.value && !!userSchema?.value,
12038
+ onCancel: props.onCancel,
12039
+ onComplete: (response) => {
12040
+ refreshProfile();
12041
+ props.onComplete?.(response);
12042
+ },
12043
+ onDone: () => {
12044
+ refreshProfile();
12045
+ props.onDone?.();
12046
+ },
12047
+ onError: props.onError,
12048
+ onInitialize: handleInitialize,
12049
+ onSubmit: execute,
12050
+ preferences: props.preferences,
12051
+ showSubtitle: props.showSubtitle,
12052
+ showTitle: props.showTitle,
12053
+ size: props.size,
12054
+ variant: props.variant
12055
+ }, slots);
12056
+ }
12057
+ });
12058
+ var VerifyAttribute_default = VerifyAttribute;
12059
+
12060
+ //#endregion
12061
+ //#region src/components/account/user-profile/UserProfile.ts
12062
+ const UserProfile = (0, vue.defineComponent)({
12063
+ name: "UserProfile",
12064
+ props: {
12065
+ avatarSize: {
12066
+ default: "lg",
12067
+ type: String
12068
+ },
12069
+ cardLayout: {
12070
+ default: true,
12071
+ type: Boolean
12072
+ },
12073
+ cardVariant: {
12074
+ default: "elevated",
12075
+ type: String
12076
+ },
12077
+ className: {
12078
+ default: "",
12079
+ type: String
12080
+ },
12081
+ compact: {
12082
+ default: false,
12083
+ type: Boolean
12084
+ },
12085
+ editable: {
12086
+ default: true,
12087
+ type: Boolean
12088
+ },
12089
+ hideFields: {
12090
+ default: () => [],
12091
+ type: Array
12092
+ },
12093
+ preferences: {
12094
+ default: void 0,
12095
+ type: Object
12096
+ },
12097
+ showAvatar: {
12098
+ default: true,
11165
12099
  type: Boolean
11166
12100
  },
11167
12101
  showFields: {
@@ -11171,6 +12105,10 @@ const UserProfile = (0, vue.defineComponent)({
11171
12105
  title: {
11172
12106
  default: "Profile",
11173
12107
  type: String
12108
+ },
12109
+ verificationFlowHandle: {
12110
+ default: __thunderid_browser.AttributeVerificationConstants.DEFAULT_FLOW_HANDLE,
12111
+ type: String
11174
12112
  }
11175
12113
  },
11176
12114
  setup(props, { slots }) {
@@ -11212,6 +12150,17 @@ const UserProfile = (0, vue.defineComponent)({
11212
12150
  error.value = message;
11213
12151
  }
11214
12152
  }
12153
+ const renderVerification = ({ attribute, attributeDisplayName, onCancel, onComplete }) => (0, vue.h)(VerifyAttribute_default, {
12154
+ attribute,
12155
+ attributeDisplayName,
12156
+ flowHandle: props.verificationFlowHandle,
12157
+ key: attribute,
12158
+ onCancel,
12159
+ onComplete,
12160
+ onDone: onCancel,
12161
+ preferences: resolvedPreferences.value,
12162
+ variant: props.compact ? "outlined" : "flat"
12163
+ });
11215
12164
  return () => (0, vue.h)(BaseUserProfile_default, {
11216
12165
  avatarSize: props.avatarSize,
11217
12166
  cardLayout: props.cardLayout,
@@ -11231,39 +12180,14 @@ const UserProfile = (0, vue.defineComponent)({
11231
12180
  t,
11232
12181
  title: props.title,
11233
12182
  userSchema: userSchema?.value
11234
- }, slots);
12183
+ }, isEditableProfile.value ? {
12184
+ verification: renderVerification,
12185
+ ...slots
12186
+ } : slots);
11235
12187
  }
11236
12188
  });
11237
12189
  var UserProfile_default = UserProfile;
11238
12190
 
11239
- //#endregion
11240
- //#region src/components/admin/shared/useAdminTranslation.ts
11241
- /**
11242
- * Returns a translation function that honors component-level `preferences.i18n.bundles` over the
11243
- * provider's bundles, falling back to the configured fallback language and then to the provider.
11244
- * Reactive when called from a render function, since it reads the current language.
11245
- *
11246
- * @param getPreferences - Getter for the component's `preferences` prop.
11247
- * @returns The translation function.
11248
- */
11249
- const useAdminTranslation = (getPreferences) => {
11250
- const i18n = useI18n_default();
11251
- return (key, params) => {
11252
- const bundles = getPreferences()?.i18n?.bundles;
11253
- if (bundles) {
11254
- const lookup = (language) => {
11255
- const bundle = bundles[language];
11256
- if (!bundle) return;
11257
- return (0, __thunderid_browser.normalizeTranslations)(bundle.translations)[key];
11258
- };
11259
- const translation = lookup(i18n.currentLanguage.value) ?? lookup(i18n.fallbackLanguage);
11260
- if (translation) return (0, __thunderid_browser.substituteTranslationParams)(translation, params);
11261
- }
11262
- return i18n.t(key, params);
11263
- };
11264
- };
11265
- var useAdminTranslation_default = useAdminTranslation;
11266
-
11267
12191
  //#endregion
11268
12192
  //#region src/components/common/attribution/Attribution.ts
11269
12193
  const cls$13 = (suffix) => (0, __thunderid_browser.withVendorCSSClassPrefix)(`attribution${suffix}`);
@@ -17604,6 +18528,12 @@ Object.defineProperty(exports, 'ApplicationQueryKeys', {
17604
18528
  }
17605
18529
  });
17606
18530
  exports.ArrowLeftRightIcon = ArrowLeftRightIcon;
18531
+ Object.defineProperty(exports, 'AttributeVerificationConstants', {
18532
+ enumerable: true,
18533
+ get: function () {
18534
+ return __thunderid_browser.AttributeVerificationConstants;
18535
+ }
18536
+ });
17607
18537
  exports.Attribution = Attribution_default;
17608
18538
  exports.AuthFlowSelect = AuthFlowSelect_default;
17609
18539
  exports.BaseAcceptInvite = BaseAcceptInvite_default;
@@ -17637,6 +18567,7 @@ exports.BaseUserList = BaseUserList_default;
17637
18567
  exports.BaseUserProfile = BaseUserProfile_default;
17638
18568
  exports.BaseUserSelect = BaseUserSelect_default;
17639
18569
  exports.BaseUserTypeSelect = BaseUserTypeSelect_default;
18570
+ exports.BaseVerifyAttribute = BaseVerifyAttribute_default;
17640
18571
  exports.BuildingIcon = BuildingIcon;
17641
18572
  exports.Button = Button_default;
17642
18573
  exports.Callback = Callback_default;
@@ -17678,6 +18609,12 @@ Object.defineProperty(exports, 'EmbeddedFlowTextVariant', {
17678
18609
  return __thunderid_browser.EmbeddedFlowTextVariant;
17679
18610
  }
17680
18611
  });
18612
+ Object.defineProperty(exports, 'EmbeddedSelfFlowStatus', {
18613
+ enumerable: true,
18614
+ get: function () {
18615
+ return __thunderid_browser.EmbeddedSelfFlowStatus;
18616
+ }
18617
+ });
17681
18618
  Object.defineProperty(exports, 'EmbeddedSignInFlowStatus', {
17682
18619
  enumerable: true,
17683
18620
  get: function () {
@@ -17799,6 +18736,7 @@ Object.defineProperty(exports, 'UserQueryKeys', {
17799
18736
  });
17800
18737
  exports.UserSelect = UserSelect_default;
17801
18738
  exports.UserTypeSelect = UserTypeSelect_default;
18739
+ exports.VerifyAttribute = VerifyAttribute_default;
17802
18740
  exports.XIcon = XIcon;
17803
18741
  Object.defineProperty(exports, 'addGroupMembers', {
17804
18742
  enumerable: true,
@@ -18164,6 +19102,7 @@ Object.defineProperty(exports, 'executeAdministrationFlow', {
18164
19102
  return __thunderid_browser.executeAdministrationFlow;
18165
19103
  }
18166
19104
  });
19105
+ exports.executeEmbeddedSelfFlow = executeEmbeddedSelfFlow_default;
18167
19106
  Object.defineProperty(exports, 'exportConfiguration', {
18168
19107
  enumerable: true,
18169
19108
  get: function () {
@@ -18653,6 +19592,12 @@ Object.defineProperty(exports, 'getVariables', {
18653
19592
  return __thunderid_browser.getVariables;
18654
19593
  }
18655
19594
  });
19595
+ Object.defineProperty(exports, 'getVerifiedAttributes', {
19596
+ enumerable: true,
19597
+ get: function () {
19598
+ return __thunderid_browser.getVerifiedAttributes;
19599
+ }
19600
+ });
18656
19601
  exports.handlePasskeyAuthentication = handlePasskeyAuthentication;
18657
19602
  exports.handlePasskeyRegistration = handlePasskeyRegistration;
18658
19603
  Object.defineProperty(exports, 'handleWebAuthnAuthentication', {
@@ -18686,6 +19631,12 @@ Object.defineProperty(exports, 'importConfiguration', {
18686
19631
  }
18687
19632
  });
18688
19633
  exports.initiateOAuthRedirect = initiateOAuthRedirect;
19634
+ Object.defineProperty(exports, 'isVerifiableAttribute', {
19635
+ enumerable: true,
19636
+ get: function () {
19637
+ return __thunderid_browser.isVerifiableAttribute;
19638
+ }
19639
+ });
18689
19640
  Object.defineProperty(exports, 'navigate', {
18690
19641
  enumerable: true,
18691
19642
  get: function () {