@ory/elements-react 1.0.0-next.16 → 1.0.0-next.18

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 (61) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/api-report/elements-react-client.api.json +144 -16
  3. package/api-report/elements-react-client.api.md +19 -8
  4. package/api-report/elements-react-theme.api.json +197 -0
  5. package/api-report/elements-react-theme.api.md +17 -2
  6. package/api-report/elements-react.api.json +7 -3
  7. package/api-report/elements-react.api.md +4 -2
  8. package/api-report/temp/elements-react-client.api.md +33 -0
  9. package/api-report/temp/elements-react-theme.api.md +149 -0
  10. package/api-report/temp/elements-react.api.md +423 -0
  11. package/dist/client/config.d.mts +21 -0
  12. package/dist/client/config.d.ts +21 -0
  13. package/dist/client/config.js +77 -0
  14. package/dist/client/config.js.map +1 -0
  15. package/dist/client/config.mjs +51 -0
  16. package/dist/client/config.mjs.map +1 -0
  17. package/dist/client/frontendClient.d.mts +3 -1
  18. package/dist/client/frontendClient.d.ts +3 -1
  19. package/dist/client/frontendClient.js +14 -2
  20. package/dist/client/frontendClient.js.map +1 -1
  21. package/dist/client/frontendClient.mjs +14 -2
  22. package/dist/client/frontendClient.mjs.map +1 -1
  23. package/dist/client/index.d.mts +3 -1
  24. package/dist/client/index.d.ts +3 -1
  25. package/dist/client/index.js +4 -0
  26. package/dist/client/index.js.map +1 -1
  27. package/dist/client/index.mjs +5 -0
  28. package/dist/client/index.mjs.map +1 -1
  29. package/dist/client/session-provider.d.mts +62 -0
  30. package/dist/client/session-provider.d.ts +62 -0
  31. package/dist/client/session-provider.js +96 -0
  32. package/dist/client/session-provider.js.map +1 -0
  33. package/dist/client/session-provider.mjs +71 -0
  34. package/dist/client/session-provider.mjs.map +1 -0
  35. package/dist/client/useSession.d.mts +22 -31
  36. package/dist/client/useSession.d.ts +22 -31
  37. package/dist/client/useSession.js +7 -49
  38. package/dist/client/useSession.js.map +1 -1
  39. package/dist/client/useSession.mjs +8 -49
  40. package/dist/client/useSession.mjs.map +1 -1
  41. package/dist/index.d.mts +5 -4
  42. package/dist/index.d.ts +5 -4
  43. package/dist/index.js +148 -62
  44. package/dist/index.js.map +1 -1
  45. package/dist/index.mjs +151 -65
  46. package/dist/index.mjs.map +1 -1
  47. package/dist/theme/default/index.css +358 -251
  48. package/dist/theme/default/index.css.map +1 -1
  49. package/dist/theme/default/index.d.mts +14 -3
  50. package/dist/theme/default/index.d.ts +14 -3
  51. package/dist/theme/default/index.js +932 -837
  52. package/dist/theme/default/index.js.map +1 -1
  53. package/dist/theme/default/index.mjs +815 -715
  54. package/dist/theme/default/index.mjs.map +1 -1
  55. package/jest.config.ts +7 -1
  56. package/package.json +2 -1
  57. package/postcss.config.ts +1 -0
  58. package/tailwind.config.ts +14 -13
  59. package/tsconfig.json +4 -3
  60. package/variables-processed.json +385 -187
  61. package/.eslintrc.js +0 -63
package/dist/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
- import { UiNodeGroupEnum, isUiNodeInputAttributes, isUiNodeAnchorAttributes, isUiNodeImageAttributes, isUiNodeScriptAttributes, isUiNodeTextAttributes, FlowType, handleFlowError, loginUrl, handleContinueWith, recoveryUrl, registrationUrl, settingsUrl, isResponseError, verificationUrl, UiNodeInputAttributesTypeEnum, Configuration, FrontendApi } from '@ory/client-fetch';
2
- import { createContext, useContext, useState, useMemo, useReducer, useRef, useEffect } from 'react';
1
+ import { UiNodeGroupEnum, isUiNodeInputAttributes, isUiNodeAnchorAttributes, isUiNodeImageAttributes, isUiNodeScriptAttributes, isUiNodeTextAttributes, UiNodeInputAttributesTypeEnum, FlowType, Configuration, FrontendApi, handleContinueWith, settingsUrl, handleFlowError, isResponseError, loginUrl, instanceOfContinueWithRecoveryUi, recoveryUrl, verificationUrl, registrationUrl } from '@ory/client-fetch';
2
+ import { createContext, useContext, useRef, useEffect, useState, useReducer, useMemo } from 'react';
3
3
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
4
4
  import { useIntl, IntlProvider as IntlProvider$1 } from 'react-intl';
5
- import { useFormContext, useForm, FormProvider } from 'react-hook-form';
5
+ import { useForm, FormProvider, useFormContext } from 'react-hook-form';
6
6
 
7
7
  // src/context/component.tsx
8
8
  var ComponentContext = createContext({
@@ -113,6 +113,7 @@ function findMethodWithMessage(nodes) {
113
113
  });
114
114
  }
115
115
  function parseStateFromFlow(flow) {
116
+ var _a;
116
117
  switch (flow.flowType) {
117
118
  case FlowType.Registration:
118
119
  case FlowType.Login: {
@@ -123,10 +124,12 @@ function parseStateFromFlow(flow) {
123
124
  return { current: "method_active", method: "code" };
124
125
  } else if (methodWithMessage) {
125
126
  return { current: "method_active", method: methodWithMessage.group };
126
- } else if (flow.flow.active && !["default", "identifier_first"].includes(flow.flow.active)) {
127
+ } else if (flow.flow.active && !["default", "identifier_first", "oidc"].includes(flow.flow.active)) {
127
128
  return { current: "method_active", method: flow.flow.active };
128
129
  } else if (isChoosingMethod(flow.flow.ui.nodes)) {
129
130
  return { current: "select_method" };
131
+ } else if ((_a = flow.flow.ui.messages) == null ? void 0 : _a.some((m) => m.id === 1010016)) {
132
+ return { current: "select_method" };
130
133
  }
131
134
  return { current: "provide_identifier" };
132
135
  }
@@ -436,7 +439,8 @@ var en_default = {
436
439
  "settings.passkey.title": "Manage Passkeys",
437
440
  "settings.passkey.description": "Manage your passkey settings",
438
441
  "settings.passkey.info": "Manage your passkey settings",
439
- "card.footer.select-another-method": "Select another method"
442
+ "card.footer.select-another-method": "Select another method",
443
+ "account-linking.title": "Link account"
440
444
  };
441
445
 
442
446
  // src/locales/de.json
@@ -682,7 +686,8 @@ var de_default = {
682
686
  "settings.title-totp": "Verwalten Sie die 2FA TOTP Authenticator-App",
683
687
  "settings.title-webauthn": "Hardware-Token verwalten",
684
688
  "settings.webauthn.info": "Hardware-Tokens werden f\xFCr die Zweitfaktor-Authentifizierung oder als Erstfaktor-Authentifizierung mit Passkeys verwendet",
685
- "card.footer.select-another-method": "Eine andere Methode verwenden"
689
+ "card.footer.select-another-method": "Eine andere Methode verwenden",
690
+ "account-linking.title": "Account Verbinden"
686
691
  };
687
692
 
688
693
  // src/locales/es.json
@@ -928,7 +933,8 @@ var es_default = {
928
933
  "settings.title-totp": "",
929
934
  "settings.title-webauthn": "",
930
935
  "settings.webauthn.info": "",
931
- "card.footer.select-another-method": ""
936
+ "card.footer.select-another-method": "",
937
+ "account-linking.title": ""
932
938
  };
933
939
 
934
940
  // src/locales/fr.json
@@ -1174,7 +1180,8 @@ var fr_default = {
1174
1180
  "settings.webauthn.description": "",
1175
1181
  "settings.webauthn.info": "",
1176
1182
  "settings.webauthn.title": "",
1177
- "card.footer.select-another-method": ""
1183
+ "card.footer.select-another-method": "",
1184
+ "account-linking.title": ""
1178
1185
  };
1179
1186
 
1180
1187
  // src/locales/nl.json
@@ -1420,7 +1427,8 @@ var nl_default = {
1420
1427
  "settings.webauthn.description": "",
1421
1428
  "settings.webauthn.info": "",
1422
1429
  "settings.webauthn.title": "",
1423
- "card.footer.select-another-method": ""
1430
+ "card.footer.select-another-method": "",
1431
+ "account-linking.title": ""
1424
1432
  };
1425
1433
 
1426
1434
  // src/locales/pl.json
@@ -1666,7 +1674,8 @@ var pl_default = {
1666
1674
  "settings.webauthn.description": "",
1667
1675
  "settings.webauthn.info": "",
1668
1676
  "settings.webauthn.title": "",
1669
- "card.footer.select-another-method": ""
1677
+ "card.footer.select-another-method": "",
1678
+ "account-linking.title": ""
1670
1679
  };
1671
1680
 
1672
1681
  // src/locales/pt.json
@@ -1912,7 +1921,8 @@ var pt_default = {
1912
1921
  "settings.webauthn.description": "",
1913
1922
  "settings.webauthn.info": "",
1914
1923
  "settings.webauthn.title": "",
1915
- "card.footer.select-another-method": ""
1924
+ "card.footer.select-another-method": "",
1925
+ "account-linking.title": ""
1916
1926
  };
1917
1927
 
1918
1928
  // src/locales/sv.json
@@ -2158,7 +2168,8 @@ var sv_default = {
2158
2168
  "settings.webauthn.description": "Hantera inst\xE4llningarna f\xF6r din maskinvarutoken",
2159
2169
  "settings.webauthn.info": "H\xE5rdvarutokens anv\xE4nds f\xF6r andrafaktorsautentisering eller som f\xF6rstafaktor med l\xF6senordsnycklar",
2160
2170
  "settings.webauthn.title": "Hantera maskinvarutokens",
2161
- "card.footer.select-another-method": "V\xE4lj en annan metod"
2171
+ "card.footer.select-another-method": "V\xE4lj en annan metod",
2172
+ "account-linking.title": "L\xE4nka ditt konto"
2162
2173
  };
2163
2174
 
2164
2175
  // src/locales/index.ts
@@ -2246,7 +2257,8 @@ async function onSubmitLogin({ config, flow }, {
2246
2257
  updateLoginFlowBody: body
2247
2258
  }).then(() => {
2248
2259
  var _a2;
2249
- window.location.href = (_a2 = flow.return_to) != null ? _a2 : config.sdk.url + "/self-service/login/browser";
2260
+ window.location.href = // eslint-disable-next-line promise/always-return
2261
+ (_a2 = flow.return_to) != null ? _a2 : config.sdk.url + "/self-service/login/browser";
2250
2262
  }).catch(
2251
2263
  handleFlowError({
2252
2264
  onRestartFlow: () => {
@@ -2296,16 +2308,34 @@ async function onSubmitRecovery({ config, flow }, {
2296
2308
  onRedirect(recoveryUrl(config), true);
2297
2309
  },
2298
2310
  onValidationError: (body2) => {
2299
- setFlowContainer({
2300
- flow: body2,
2301
- flowType: FlowType.Recovery,
2302
- config
2303
- });
2311
+ if ("error" in body2) {
2312
+ handleContinueWithRecoveryUIError(body2.error, config, onRedirect);
2313
+ return;
2314
+ } else {
2315
+ setFlowContainer({
2316
+ flow: body2,
2317
+ flowType: FlowType.Recovery,
2318
+ config
2319
+ });
2320
+ }
2304
2321
  },
2305
2322
  onRedirect
2306
2323
  })
2307
2324
  );
2308
2325
  }
2326
+ function handleContinueWithRecoveryUIError(error, config, onRedirect) {
2327
+ if ("continue_with" in error.details && Array.isArray(error.details.continue_with)) {
2328
+ const continueWithRecovery = error.details.continue_with.find(instanceOfContinueWithRecoveryUi);
2329
+ if ((continueWithRecovery == null ? void 0 : continueWithRecovery.action) === "show_recovery_ui") {
2330
+ onRedirect(
2331
+ config.project.recovery_ui_url + "?flow=" + (continueWithRecovery == null ? void 0 : continueWithRecovery.flow.id),
2332
+ false
2333
+ );
2334
+ return;
2335
+ }
2336
+ }
2337
+ onRedirect(recoveryUrl(config), true);
2338
+ }
2309
2339
  async function onSubmitRegistration({ config, flow }, {
2310
2340
  setFlowContainer,
2311
2341
  body,
@@ -2436,20 +2466,25 @@ function computeDefaultValues(nodes) {
2436
2466
  return nodes.reduce((acc, node) => {
2437
2467
  const attrs = node.attributes;
2438
2468
  if (isUiNodeInputAttributes(attrs)) {
2439
- if (attrs.name === "method" || attrs.type === "submit" || typeof attrs.value === "undefined")
2469
+ if (attrs.type === "checkbox" && typeof attrs.value === "undefined") {
2470
+ attrs.value = false;
2471
+ }
2472
+ if (attrs.name === "method" || attrs.type === "submit" || typeof attrs.value === "undefined") {
2440
2473
  return acc;
2441
- const unrolled = unrollTrait({
2442
- name: attrs.name,
2443
- value: attrs.value
2444
- });
2445
- Object.assign(acc, unrolled != null ? unrolled : { [attrs.name]: attrs.value });
2474
+ }
2475
+ return unrollTrait(
2476
+ {
2477
+ name: attrs.name,
2478
+ value: attrs.value
2479
+ },
2480
+ acc
2481
+ );
2446
2482
  }
2447
2483
  return acc;
2448
2484
  }, {});
2449
2485
  }
2450
2486
  function unrollTrait(input, output = {}) {
2451
2487
  const keys = input.name.split(".");
2452
- if (!keys.length) return void 0;
2453
2488
  let current = output;
2454
2489
  keys.forEach((key, index) => {
2455
2490
  if (!key) return;
@@ -2486,19 +2521,19 @@ function triggerToWindowCall(trigger) {
2486
2521
  }
2487
2522
  function triggerToFunction(trigger) {
2488
2523
  if (typeof window === "undefined") {
2489
- console.error(
2524
+ console.debug(
2490
2525
  "The Ory SDK is missing a required function: window is undefined."
2491
2526
  );
2492
2527
  return void 0;
2493
2528
  }
2494
2529
  const typedWindow = window;
2495
2530
  if (!(trigger in typedWindow) || !typedWindow[trigger]) {
2496
- console.error(`The Ory SDK is missing a required function: ${trigger}.`);
2531
+ console.debug(`The Ory SDK is missing a required function: ${trigger}.`);
2497
2532
  return void 0;
2498
2533
  }
2499
2534
  const triggerFn = typedWindow[trigger];
2500
2535
  if (typeof triggerFn !== "function") {
2501
- console.error(
2536
+ console.debug(
2502
2537
  `The Ory SDK is missing a required function: ${trigger}. It is not a function.`
2503
2538
  );
2504
2539
  return void 0;
@@ -2545,8 +2580,10 @@ var NodeInput = ({
2545
2580
  //
2546
2581
  ...attrs
2547
2582
  } = attributes;
2583
+ const isResendNode = ((_a = node.meta.label) == null ? void 0 : _a.id) === 1070008;
2584
+ const isScreenSelectionNode = "name" in node.attributes && node.attributes.name === "screen";
2548
2585
  const setFormValue = () => {
2549
- if (attrs.value) {
2586
+ if (attrs.value && !(isResendNode || isScreenSelectionNode)) {
2550
2587
  setValue(attrs.name, attrs.value);
2551
2588
  }
2552
2589
  };
@@ -2571,8 +2608,6 @@ var NodeInput = ({
2571
2608
  };
2572
2609
  const isSocial = (attrs.name === "provider" || attrs.name === "link") && node.group === "oidc";
2573
2610
  const isPinCodeInput = attrs.name === "code" && node.group === "code" || attrs.name === "totp_code" && node.group === "totp";
2574
- const isResendNode = ((_a = node.meta.label) == null ? void 0 : _a.id) === 1070008;
2575
- const isScreenSelectionNode = "name" in node.attributes && node.attributes.name === "screen";
2576
2611
  switch (attributes.type) {
2577
2612
  case UiNodeInputAttributesTypeEnum.Submit:
2578
2613
  case UiNodeInputAttributesTypeEnum.Button:
@@ -2644,6 +2679,51 @@ function OryFormGroups({ children, groups }) {
2644
2679
  return /* @__PURE__ */ jsx(Node, { node }, k);
2645
2680
  }) });
2646
2681
  }
2682
+
2683
+ // src/components/form/form-resolver.ts
2684
+ function isCodeResendRequest(data) {
2685
+ var _a;
2686
+ return (_a = data.email) != null ? _a : data.resend;
2687
+ }
2688
+ function useOryFormResolver() {
2689
+ const flowContainer = useOryFlow();
2690
+ return (data) => {
2691
+ if (flowContainer.formState.current === "method_active") {
2692
+ if (data.method === "code" && !data.code && !isCodeResendRequest(data)) {
2693
+ return {
2694
+ values: data,
2695
+ errors: {
2696
+ code: {
2697
+ id: 4000002,
2698
+ context: {
2699
+ property: "code"
2700
+ },
2701
+ type: "error",
2702
+ text: "Property code is missing"
2703
+ }
2704
+ }
2705
+ };
2706
+ }
2707
+ }
2708
+ return {
2709
+ values: data,
2710
+ errors: {}
2711
+ };
2712
+ };
2713
+ }
2714
+ function OryFormProvider({
2715
+ children,
2716
+ nodes
2717
+ }) {
2718
+ const flowContainer = useOryFlow();
2719
+ const defaultNodes = nodes ? flowContainer.flow.ui.nodes.filter((node) => node.group === UiNodeGroupEnum.Default).concat(nodes) : flowContainer.flow.ui.nodes;
2720
+ const methods = useForm({
2721
+ // TODO: Generify this, so we have typesafety in the submit handler.
2722
+ defaultValues: computeDefaultValues(defaultNodes),
2723
+ resolver: useOryFormResolver()
2724
+ });
2725
+ return /* @__PURE__ */ jsx(FormProvider, { ...methods, children });
2726
+ }
2647
2727
  function OryFormOidcButtons({
2648
2728
  children,
2649
2729
  hideDivider
@@ -2689,7 +2769,7 @@ function OryFormSocialButtonsForm() {
2689
2769
  if (filteredNodes.length === 0) {
2690
2770
  return null;
2691
2771
  }
2692
- return /* @__PURE__ */ jsx(OryForm, { children: /* @__PURE__ */ jsx(OryFormOidcButtons, {}) });
2772
+ return /* @__PURE__ */ jsx(OryFormProvider, { children: /* @__PURE__ */ jsx(OryForm, { children: /* @__PURE__ */ jsx(OryFormOidcButtons, {}) }) });
2693
2773
  }
2694
2774
  function OryForm({ children, onAfterSubmit }) {
2695
2775
  var _a;
@@ -2839,7 +2919,7 @@ function OryForm({ children, onAfterSubmit }) {
2839
2919
  }
2840
2920
  );
2841
2921
  }
2842
- var messageIdsToHide = [1040009, 1060003, 1080003, 1010014, 1040005];
2922
+ var messageIdsToHide = [1040009, 1060003, 1080003, 1010014, 1040005, 1010016];
2843
2923
  function OryCardValidationMessages({ ...props }) {
2844
2924
  var _a;
2845
2925
  const { flow } = useOryFlow();
@@ -2852,18 +2932,6 @@ function OryCardValidationMessages({ ...props }) {
2852
2932
  }
2853
2933
  return /* @__PURE__ */ jsx(Message.Root, { ...props, children: messages == null ? void 0 : messages.map((message) => /* @__PURE__ */ jsx(Message.Content, { message }, message.id)) });
2854
2934
  }
2855
- function OryFormProvider({
2856
- children,
2857
- nodes
2858
- }) {
2859
- const flowContainer = useOryFlow();
2860
- const defaultNodes = nodes ? flowContainer.flow.ui.nodes.filter((node) => node.group === UiNodeGroupEnum.Default).concat(nodes) : flowContainer.flow.ui.nodes;
2861
- const methods = useForm({
2862
- // TODO: Generify this, so we have typesafety in the submit handler.
2863
- defaultValues: computeDefaultValues(defaultNodes)
2864
- });
2865
- return /* @__PURE__ */ jsx(FormProvider, { ...methods, children });
2866
- }
2867
2935
  function OryFormSection({ children, nodes }) {
2868
2936
  const { Card } = useComponents();
2869
2937
  return /* @__PURE__ */ jsx(OryFormProvider, { nodes, children: /* @__PURE__ */ jsx(OryForm, { children: /* @__PURE__ */ jsx(Card.SettingsSection, { children }) }) });
@@ -3039,7 +3107,12 @@ function OrySettingsOidc({ nodes }) {
3039
3107
  )
3040
3108
  }
3041
3109
  ),
3042
- /* @__PURE__ */ jsx(Card.SettingsSectionFooter, { children: /* @__PURE__ */ jsx("span", { children: intl.formatMessage({ id: "settings.oidc.info" }) }) })
3110
+ /* @__PURE__ */ jsx(
3111
+ Card.SettingsSectionFooter,
3112
+ {
3113
+ text: intl.formatMessage({ id: "settings.oidc.info" })
3114
+ }
3115
+ )
3043
3116
  ] });
3044
3117
  }
3045
3118
  var getTriggerNode = (nodes) => nodes.find(
@@ -3096,7 +3169,12 @@ function OrySettingsPasskey({ nodes }) {
3096
3169
  ]
3097
3170
  }
3098
3171
  ),
3099
- /* @__PURE__ */ jsx(Card.SettingsSectionFooter, { children: /* @__PURE__ */ jsx("span", { children: intl.formatMessage({ id: "settings.passkey.info" }) }) })
3172
+ /* @__PURE__ */ jsx(
3173
+ Card.SettingsSectionFooter,
3174
+ {
3175
+ text: intl.formatMessage({ id: "settings.passkey.info" })
3176
+ }
3177
+ )
3100
3178
  ] });
3101
3179
  }
3102
3180
  var getRegenerateNode = (nodes) => nodes.find(
@@ -3181,16 +3259,19 @@ function OrySettingsTotp({ nodes }) {
3181
3259
  children: content
3182
3260
  }
3183
3261
  ),
3184
- /* @__PURE__ */ jsxs(Card.SettingsSectionFooter, { children: [
3185
- /* @__PURE__ */ jsx("span", { children: totpUnlink ? intl.formatMessage({ id: "settings.totp.info.linked" }) : intl.formatMessage({ id: "settings.totp.info.not-linked" }) }),
3186
- totpLinkButton && /* @__PURE__ */ jsx(
3187
- Node2.Button,
3188
- {
3189
- node: totpLinkButton,
3190
- attributes: totpLinkButton.attributes
3191
- }
3192
- )
3193
- ] })
3262
+ /* @__PURE__ */ jsx(
3263
+ Card.SettingsSectionFooter,
3264
+ {
3265
+ text: totpUnlink ? intl.formatMessage({ id: "settings.totp.info.linked" }) : intl.formatMessage({ id: "settings.totp.info.not-linked" }),
3266
+ children: totpLinkButton && /* @__PURE__ */ jsx(
3267
+ Node2.Button,
3268
+ {
3269
+ node: totpLinkButton,
3270
+ attributes: totpLinkButton.attributes
3271
+ }
3272
+ )
3273
+ }
3274
+ )
3194
3275
  ] });
3195
3276
  }
3196
3277
  var getInputNode = (nodes) => nodes.find(
@@ -3202,9 +3283,6 @@ var getTriggerNode2 = (nodes) => nodes.find(
3202
3283
  var getRemoveButtons = (nodes) => nodes.filter(
3203
3284
  (node) => "name" in node.attributes && node.attributes.name === "webauthn_remove"
3204
3285
  );
3205
- var getScriptNode = (nodes) => nodes.find(
3206
- (node) => "id" in node.attributes && node.attributes.id === "webauthn_script"
3207
- );
3208
3286
  var getRegisterNode = (nodes) => nodes.find(
3209
3287
  (node) => "name" in node.attributes && node.attributes.name === "webauthn_register"
3210
3288
  );
@@ -3217,7 +3295,6 @@ function OrySettingsWebauthn({ nodes }) {
3217
3295
  const triggerButton = getTriggerNode2(nodes);
3218
3296
  const inputNode = getInputNode(nodes);
3219
3297
  const removeButtons = getRemoveButtons(nodes);
3220
- const scriptNode = getScriptNode(nodes);
3221
3298
  const registerNode = getRegisterNode(nodes);
3222
3299
  if (!inputNode || !triggerButton) {
3223
3300
  return null;
@@ -3240,8 +3317,6 @@ function OrySettingsWebauthn({ nodes }) {
3240
3317
  }),
3241
3318
  children: [
3242
3319
  (_a = groups.default) == null ? void 0 : _a.map((node, i) => /* @__PURE__ */ jsx(Node, { node }, `webauthn-default-${i}`)),
3243
- scriptNode && /* @__PURE__ */ jsx(Node, { node: scriptNode }),
3244
- registerNode && /* @__PURE__ */ jsx(Node, { node: registerNode }),
3245
3320
  /* @__PURE__ */ jsx(
3246
3321
  Form.WebauthnSettings,
3247
3322
  {
@@ -3253,11 +3328,17 @@ function OrySettingsWebauthn({ nodes }) {
3253
3328
  },
3254
3329
  removeButtons
3255
3330
  }
3256
- )
3331
+ ),
3332
+ registerNode && /* @__PURE__ */ jsx(Node, { node: registerNode })
3257
3333
  ]
3258
3334
  }
3259
3335
  ),
3260
- /* @__PURE__ */ jsx(Card.SettingsSectionFooter, { children: /* @__PURE__ */ jsx("span", { children: intl.formatMessage({ id: "settings.webauthn.info" }) }) })
3336
+ /* @__PURE__ */ jsx(
3337
+ Card.SettingsSectionFooter,
3338
+ {
3339
+ text: intl.formatMessage({ id: "settings.webauthn.info" })
3340
+ }
3341
+ )
3261
3342
  ] });
3262
3343
  }
3263
3344
  function SettingsSectionContent({ group, nodes }) {
@@ -3309,11 +3390,16 @@ function SettingsSectionContent({ group, nodes }) {
3309
3390
  ).map((node, k) => /* @__PURE__ */ jsx(Node, { node }, k)) })
3310
3391
  ] });
3311
3392
  }
3393
+ var getScriptNode = (nodes) => nodes.find(
3394
+ (node) => "id" in node.attributes && node.attributes.id === "webauthn_script"
3395
+ );
3312
3396
  function OrySettingsCard() {
3313
3397
  const { flow } = useOryFlow();
3314
3398
  const uniqueGroups = useNodesGroups(flow.ui.nodes);
3399
+ const scriptNode = getScriptNode(flow.ui.nodes);
3315
3400
  return /* @__PURE__ */ jsxs(Fragment, { children: [
3316
3401
  /* @__PURE__ */ jsx(OryCardValidationMessages, {}),
3402
+ scriptNode && /* @__PURE__ */ jsx(Node, { node: scriptNode }),
3317
3403
  uniqueGroups.entries.map(([group, nodes]) => {
3318
3404
  if (group === UiNodeGroupEnum.Default) {
3319
3405
  return null;