@ory/elements-react 0.0.0-pr.4a28a8f → 0.0.0-pr.6b3fe62

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -189,13 +189,16 @@ function nodesToAuthMethodGroups(nodes, excludeAuthMethods = []) {
189
189
  ].includes(group)
190
190
  );
191
191
  }
192
- function useNodesGroups(nodes) {
192
+ function useNodesGroups(nodes, { omit } = {}) {
193
193
  const groupSorter = useGroupSorter();
194
194
  const groups = react.useMemo(() => {
195
195
  var _a;
196
196
  const groups2 = {};
197
197
  for (const node of nodes) {
198
- if (node.type === "script") {
198
+ if ((omit == null ? void 0 : omit.includes("script")) && clientFetch.isUiNodeScriptAttributes(node.attributes)) {
199
+ continue;
200
+ }
201
+ if ((omit == null ? void 0 : omit.includes("input_hidden")) && clientFetch.isUiNodeInputAttributes(node.attributes) && node.attributes.type === "hidden") {
199
202
  continue;
200
203
  }
201
204
  const groupNodes = (_a = groups2[node.group]) != null ? _a : [];
@@ -263,6 +266,8 @@ function parseStateFromFlow(flow) {
263
266
  break;
264
267
  case clientFetch.FlowType.Settings:
265
268
  return { current: "settings" };
269
+ case clientFetch.FlowType.OAuth2Consent:
270
+ return { current: "method_active", method: "oauth2_consent" };
266
271
  }
267
272
  console.warn(
268
273
  `[Ory/Elements React] Encountered an unknown form state on ${flow.flowType} flow with ID ${flow.flow.id}`
@@ -376,6 +381,22 @@ function computeDefaultValues(nodes) {
376
381
  if (attrs.name === "method" || attrs.type === "submit" || typeof attrs.value === "undefined") {
377
382
  return acc;
378
383
  }
384
+ if (attrs.name.startsWith("grant_scope")) {
385
+ const scope = attrs.value;
386
+ if (Array.isArray(acc.grant_scope)) {
387
+ return {
388
+ ...acc,
389
+ // We want to have all scopes accepted by default, so that the user has to actively uncheck them.
390
+ grant_scope: [...acc.grant_scope, scope]
391
+ };
392
+ } else if (!acc.grant_scope) {
393
+ return {
394
+ ...acc,
395
+ grant_scope: [scope]
396
+ };
397
+ }
398
+ return acc;
399
+ }
379
400
  return unrollTrait(
380
401
  {
381
402
  name: attrs.name,
@@ -825,6 +846,19 @@ function useOryFormSubmit(onAfterSubmit) {
825
846
  });
826
847
  break;
827
848
  }
849
+ case clientFetch.FlowType.OAuth2Consent: {
850
+ const response = await fetch(flowContainer.flow.ui.action, {
851
+ method: "POST",
852
+ body: JSON.stringify(data),
853
+ headers: {
854
+ "Content-Type": "application/json"
855
+ }
856
+ });
857
+ const oauth2Success = await response.json();
858
+ if (oauth2Success.redirect_to && typeof oauth2Success.redirect_to === "string") {
859
+ onRedirect(oauth2Success.redirect_to);
860
+ }
861
+ }
828
862
  }
829
863
  if ("password" in data) {
830
864
  methods.setValue("password", "");
@@ -839,7 +873,11 @@ function useOryFormSubmit(onAfterSubmit) {
839
873
  };
840
874
  return onSubmit;
841
875
  }
842
- function OryForm({ children, onAfterSubmit }) {
876
+ function OryForm({
877
+ children,
878
+ onAfterSubmit,
879
+ "data-testid": dataTestId
880
+ }) {
843
881
  const { Form } = useComponents();
844
882
  const flowContainer = useOryFlow();
845
883
  const methods = reactHookForm.useFormContext();
@@ -867,7 +905,7 @@ function OryForm({ children, onAfterSubmit }) {
867
905
  }),
868
906
  type: "error"
869
907
  };
870
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
908
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-testid": dataTestId, children: [
871
909
  /* @__PURE__ */ jsxRuntime.jsx(Message.Root, { children: /* @__PURE__ */ jsxRuntime.jsx(Message.Content, { message: m }, m.id) }),
872
910
  /* @__PURE__ */ jsxRuntime.jsx(OryCardFooter, {})
873
911
  ] });
@@ -878,6 +916,7 @@ function OryForm({ children, onAfterSubmit }) {
878
916
  return /* @__PURE__ */ jsxRuntime.jsx(
879
917
  Form.Root,
880
918
  {
919
+ "data-testid": dataTestId,
881
920
  action: flowContainer.flow.ui.action,
882
921
  method: flowContainer.flow.ui.method,
883
922
  onSubmit: (e) => void methods.handleSubmit(onSubmit)(e),
@@ -912,7 +951,7 @@ var NodeInput = ({
912
951
  }) => {
913
952
  var _a;
914
953
  const { Node: Node2 } = useComponents();
915
- const { setValue } = reactHookForm.useFormContext();
954
+ const { setValue, watch } = reactHookForm.useFormContext();
916
955
  const {
917
956
  onloadTrigger,
918
957
  onclickTrigger,
@@ -925,7 +964,10 @@ var NodeInput = ({
925
964
  const isResendNode = ((_a = node.meta.label) == null ? void 0 : _a.id) === 1070008;
926
965
  const isScreenSelectionNode = "name" in node.attributes && node.attributes.name === "screen";
927
966
  const setFormValue = () => {
928
- if (attrs.value && !(isResendNode || isScreenSelectionNode)) {
967
+ if (isResendNode || isScreenSelectionNode || node.group === clientFetch.UiNodeGroupEnum.Oauth2Consent) {
968
+ return;
969
+ }
970
+ if (attrs.value !== void 0) {
929
971
  setValue(attrs.name, attrs.value);
930
972
  }
931
973
  };
@@ -950,6 +992,19 @@ var NodeInput = ({
950
992
  };
951
993
  const isSocial = (attrs.name === "provider" || attrs.name === "link") && (node.group === clientFetch.UiNodeGroupEnum.Oidc || node.group === clientFetch.UiNodeGroupEnum.Saml);
952
994
  const isPinCodeInput = attrs.name === "code" && node.group === "code" || attrs.name === "totp_code" && node.group === "totp";
995
+ const handleScopeChange = (checked) => {
996
+ const scopes = watch("grant_scope");
997
+ if (Array.isArray(scopes)) {
998
+ if (checked) {
999
+ setValue("grant_scope", Array.from(/* @__PURE__ */ new Set([...scopes, attrs.value])));
1000
+ } else {
1001
+ setValue(
1002
+ "grant_scope",
1003
+ scopes.filter((scope) => scope !== attrs.value)
1004
+ );
1005
+ }
1006
+ }
1007
+ };
953
1008
  switch (attributes.type) {
954
1009
  case clientFetch.UiNodeInputAttributesTypeEnum.Submit:
955
1010
  case clientFetch.UiNodeInputAttributesTypeEnum.Button:
@@ -959,6 +1014,9 @@ var NodeInput = ({
959
1014
  if (isResendNode || isScreenSelectionNode) {
960
1015
  return null;
961
1016
  }
1017
+ if (node.group === "oauth2_consent") {
1018
+ return null;
1019
+ }
962
1020
  return /* @__PURE__ */ jsxRuntime.jsx(
963
1021
  Node2.Label,
964
1022
  {
@@ -970,6 +1028,21 @@ var NodeInput = ({
970
1028
  case clientFetch.UiNodeInputAttributesTypeEnum.DatetimeLocal:
971
1029
  throw new Error("Not implemented");
972
1030
  case clientFetch.UiNodeInputAttributesTypeEnum.Checkbox:
1031
+ if (node.group === "oauth2_consent" && node.attributes.node_type === "input") {
1032
+ switch (node.attributes.name) {
1033
+ case "grant_scope":
1034
+ return /* @__PURE__ */ jsxRuntime.jsx(
1035
+ Node2.ConsentScopeCheckbox,
1036
+ {
1037
+ attributes: attrs,
1038
+ node,
1039
+ onCheckedChange: handleScopeChange
1040
+ }
1041
+ );
1042
+ default:
1043
+ return null;
1044
+ }
1045
+ }
973
1046
  return /* @__PURE__ */ jsxRuntime.jsx(
974
1047
  Node2.Label,
975
1048
  {
@@ -1058,11 +1131,13 @@ function OryFormSocialButtonsForm() {
1058
1131
  const {
1059
1132
  flow: { ui }
1060
1133
  } = useOryFlow();
1061
- const filteredNodes = ui.nodes.filter((node) => node.group === clientFetch.UiNodeGroupEnum.Saml || node.group === clientFetch.UiNodeGroupEnum.Oidc);
1134
+ const filteredNodes = ui.nodes.filter(
1135
+ (node) => node.group === clientFetch.UiNodeGroupEnum.Saml || node.group === clientFetch.UiNodeGroupEnum.Oidc
1136
+ );
1062
1137
  if (filteredNodes.length === 0) {
1063
1138
  return null;
1064
1139
  }
1065
- return /* @__PURE__ */ jsxRuntime.jsx(OryFormProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(OryForm, { children: /* @__PURE__ */ jsxRuntime.jsx(OryFormOidcButtons, {}) }) });
1140
+ return /* @__PURE__ */ jsxRuntime.jsx(OryFormProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(OryForm, { "data-testid": `ory/form/methods/oidc-saml`, children: /* @__PURE__ */ jsxRuntime.jsx(OryFormOidcButtons, {}) }) });
1066
1141
  }
1067
1142
  function isUINodeGroupEnum(method) {
1068
1143
  return Object.values(clientFetch.UiNodeGroupEnum).includes(method);
@@ -1074,11 +1149,14 @@ function OryTwoStepCard() {
1074
1149
  const { ui } = flow;
1075
1150
  const nodeSorter = useNodeSorter();
1076
1151
  const sortNodes = (a, b) => nodeSorter(a, b, { flowType });
1077
- const uniqueGroups = useNodesGroups(ui.nodes);
1078
- const options = Object.fromEntries(
1152
+ const groupsToShow = useNodesGroups(ui.nodes, {
1153
+ // We only want to render groups that have visible elements.
1154
+ omit: ["script", "input_hidden"]
1155
+ });
1156
+ const authMethodBlocks = Object.fromEntries(
1079
1157
  Object.values(clientFetch.UiNodeGroupEnum).filter((group) => {
1080
1158
  var _a2;
1081
- return (_a2 = uniqueGroups.groups[group]) == null ? void 0 : _a2.length;
1159
+ return (_a2 = groupsToShow.groups[group]) == null ? void 0 : _a2.length;
1082
1160
  }).filter(
1083
1161
  (group) => ![
1084
1162
  clientFetch.UiNodeGroupEnum.Oidc,
@@ -1090,7 +1168,17 @@ function OryTwoStepCard() {
1090
1168
  ].includes(group)
1091
1169
  ).map((g) => [g, {}])
1092
1170
  );
1093
- if (clientFetch.UiNodeGroupEnum.Code in options) {
1171
+ const authMethodAdditionalNodes = ui.nodes.filter(
1172
+ ({ group }) => [
1173
+ clientFetch.UiNodeGroupEnum.Oidc,
1174
+ clientFetch.UiNodeGroupEnum.Saml,
1175
+ clientFetch.UiNodeGroupEnum.Default,
1176
+ clientFetch.UiNodeGroupEnum.IdentifierFirst,
1177
+ clientFetch.UiNodeGroupEnum.Profile,
1178
+ clientFetch.UiNodeGroupEnum.Captcha
1179
+ ].includes(group)
1180
+ );
1181
+ if (clientFetch.UiNodeGroupEnum.Code in authMethodBlocks) {
1094
1182
  let identifier = (_b = (_a = findNode(ui.nodes, {
1095
1183
  group: "identifier_first",
1096
1184
  node_type: "input",
@@ -1102,7 +1190,7 @@ function OryTwoStepCard() {
1102
1190
  name: "address"
1103
1191
  })) == null ? void 0 : _c.attributes) == null ? void 0 : _d.value);
1104
1192
  if (identifier) {
1105
- options[clientFetch.UiNodeGroupEnum.Code] = {
1193
+ authMethodBlocks[clientFetch.UiNodeGroupEnum.Code] = {
1106
1194
  title: {
1107
1195
  id: "identities.messages.1010023",
1108
1196
  values: { address: identifier }
@@ -1111,7 +1199,7 @@ function OryTwoStepCard() {
1111
1199
  }
1112
1200
  }
1113
1201
  const nonSsoNodes = removeSsoNodes(ui.nodes);
1114
- const finalNodes = formState.current === "method_active" ? getFinalNodes(uniqueGroups.groups, formState.method) : [];
1202
+ const finalNodes = formState.current === "method_active" ? getFinalNodes(groupsToShow.groups, formState.method) : [];
1115
1203
  const handleAfterFormSubmit = (method) => {
1116
1204
  if (typeof method !== "string" || !isUINodeGroupEnum(method)) {
1117
1205
  return;
@@ -1140,39 +1228,49 @@ function OryTwoStepCard() {
1140
1228
  /* @__PURE__ */ jsxRuntime.jsxs(OryCardContent, { children: [
1141
1229
  /* @__PURE__ */ jsxRuntime.jsx(OryCardValidationMessages, {}),
1142
1230
  showSso && /* @__PURE__ */ jsxRuntime.jsx(OryFormSocialButtonsForm, {}),
1143
- /* @__PURE__ */ jsxRuntime.jsxs(OryForm, { onAfterSubmit: handleAfterFormSubmit, children: [
1144
- /* @__PURE__ */ jsxRuntime.jsxs(Form.Group, { children: [
1145
- formState.current === "provide_identifier" && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1146
- showSsoDivider && /* @__PURE__ */ jsxRuntime.jsx(Card.Divider, {}),
1147
- nonSsoNodes.sort(sortNodes).map((node, k) => /* @__PURE__ */ jsxRuntime.jsx(Node, { node }, k))
1148
- ] }),
1149
- formState.current === "select_method" && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1150
- /* @__PURE__ */ jsxRuntime.jsx(Card.Divider, {}),
1151
- /* @__PURE__ */ jsxRuntime.jsx(
1152
- AuthMethodList,
1153
- {
1154
- options,
1155
- setSelectedGroup: (group) => dispatchFormState({
1156
- type: "action_select_method",
1157
- method: group
1158
- })
1159
- }
1160
- ),
1161
- ui.nodes.filter((n) => n.group === clientFetch.UiNodeGroupEnum.Captcha).map((node, k) => /* @__PURE__ */ jsxRuntime.jsx(Node, { node }, k))
1162
- ] }),
1163
- formState.current === "method_active" && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1164
- ui.nodes.filter((n) => n.type === "script").map((node, k) => /* @__PURE__ */ jsxRuntime.jsx(Node, { node }, k)),
1165
- finalNodes.sort(sortNodes).map((node, k) => /* @__PURE__ */ jsxRuntime.jsx(Node, { node }, k))
1166
- ] })
1167
- ] }),
1168
- /* @__PURE__ */ jsxRuntime.jsx(OryCardFooter, {})
1169
- ] })
1231
+ /* @__PURE__ */ jsxRuntime.jsxs(
1232
+ OryForm,
1233
+ {
1234
+ "data-testid": `ory/form/methods/local`,
1235
+ onAfterSubmit: handleAfterFormSubmit,
1236
+ children: [
1237
+ formState.current === "provide_identifier" && /* @__PURE__ */ jsxRuntime.jsxs(Form.Group, { children: [
1238
+ showSsoDivider && /* @__PURE__ */ jsxRuntime.jsx(Card.Divider, {}),
1239
+ nonSsoNodes.sort(sortNodes).map((node, k) => /* @__PURE__ */ jsxRuntime.jsx(Node, { node }, k))
1240
+ ] }),
1241
+ formState.current === "select_method" && /* @__PURE__ */ jsxRuntime.jsxs(Form.Group, { children: [
1242
+ Object.entries(authMethodBlocks).length > 0 && /* @__PURE__ */ jsxRuntime.jsx(Card.Divider, {}),
1243
+ Object.entries(authMethodBlocks).length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
1244
+ AuthMethodList,
1245
+ {
1246
+ options: authMethodBlocks,
1247
+ setSelectedGroup: (group) => dispatchFormState({
1248
+ type: "action_select_method",
1249
+ method: group
1250
+ })
1251
+ }
1252
+ ),
1253
+ authMethodAdditionalNodes.sort(sortNodes).map((node, k) => /* @__PURE__ */ jsxRuntime.jsx(Node, { node }, k))
1254
+ ] }),
1255
+ formState.current === "method_active" && /* @__PURE__ */ jsxRuntime.jsxs(Form.Group, { children: [
1256
+ ui.nodes.filter(
1257
+ (n) => clientFetch.isUiNodeScriptAttributes(n.attributes) || n.group === clientFetch.UiNodeGroupEnum.Captcha
1258
+ ).map((node, k) => /* @__PURE__ */ jsxRuntime.jsx(Node, { node }, k)),
1259
+ finalNodes.sort(sortNodes).map((node, k) => /* @__PURE__ */ jsxRuntime.jsx(Node, { node }, k))
1260
+ ] }),
1261
+ /* @__PURE__ */ jsxRuntime.jsx(OryCardFooter, {})
1262
+ ]
1263
+ }
1264
+ )
1170
1265
  ] })
1171
1266
  ] });
1172
1267
  }
1173
1268
  function AuthMethodList({ options, setSelectedGroup }) {
1174
1269
  const { Card } = useComponents();
1175
1270
  const { setValue, getValues } = reactHookForm.useFormContext();
1271
+ if (Object.entries(options).length === 0) {
1272
+ return null;
1273
+ }
1176
1274
  const handleClick = (group, options2) => {
1177
1275
  var _a, _b, _c, _d;
1178
1276
  if (isGroupImmediateSubmit(group)) {
@@ -1232,6 +1330,19 @@ function OryFormSectionInner({
1232
1330
  }
1233
1331
  );
1234
1332
  }
1333
+ function OryConsentCard() {
1334
+ const { Form, Card } = useComponents();
1335
+ const flow = useOryFlow();
1336
+ return /* @__PURE__ */ jsxRuntime.jsxs(OryCard, { children: [
1337
+ /* @__PURE__ */ jsxRuntime.jsx(OryCardHeader, {}),
1338
+ /* @__PURE__ */ jsxRuntime.jsx(OryCardContent, { children: /* @__PURE__ */ jsxRuntime.jsxs(OryForm, { children: [
1339
+ /* @__PURE__ */ jsxRuntime.jsx(Card.Divider, {}),
1340
+ /* @__PURE__ */ jsxRuntime.jsx(Form.Group, { children: flow.flow.ui.nodes.map((node, k) => /* @__PURE__ */ jsxRuntime.jsx(Node, { node }, k)) }),
1341
+ /* @__PURE__ */ jsxRuntime.jsx(Card.Divider, {}),
1342
+ /* @__PURE__ */ jsxRuntime.jsx(OryCardFooter, {})
1343
+ ] }) })
1344
+ ] });
1345
+ }
1235
1346
  function OryFormGroupDivider() {
1236
1347
  const { Card } = useComponents();
1237
1348
  const {
@@ -1585,16 +1696,19 @@ function SettingsSectionContent({ group, nodes }) {
1585
1696
  const { Card } = useComponents();
1586
1697
  const intl = reactIntl.useIntl();
1587
1698
  const { flow } = useOryFlow();
1588
- const uniqueGroups = useNodesGroups(flow.ui.nodes);
1699
+ const groupedNodes = useNodesGroups(flow.ui.nodes, {
1700
+ // Script nodes are already handled by the parent component.
1701
+ omit: ["script"]
1702
+ });
1589
1703
  if (group === clientFetch.UiNodeGroupEnum.Totp) {
1590
1704
  return /* @__PURE__ */ jsxRuntime.jsxs(
1591
1705
  OryFormSection,
1592
1706
  {
1593
- nodes: uniqueGroups.groups.totp,
1707
+ nodes: groupedNodes.groups.totp,
1594
1708
  "data-testid": "ory/screen/settings/group/totp",
1595
1709
  children: [
1596
- /* @__PURE__ */ jsxRuntime.jsx(OrySettingsTotp, { nodes: (_a = uniqueGroups.groups.totp) != null ? _a : [] }),
1597
- (_b = uniqueGroups.groups.default) == null ? void 0 : _b.map((node, k) => /* @__PURE__ */ jsxRuntime.jsx(Node, { node }, k))
1710
+ /* @__PURE__ */ jsxRuntime.jsx(OrySettingsTotp, { nodes: (_a = groupedNodes.groups.totp) != null ? _a : [] }),
1711
+ (_b = groupedNodes.groups.default) == null ? void 0 : _b.map((node, k) => /* @__PURE__ */ jsxRuntime.jsx(Node, { node }, k))
1598
1712
  ]
1599
1713
  }
1600
1714
  );
@@ -1603,16 +1717,16 @@ function SettingsSectionContent({ group, nodes }) {
1603
1717
  return /* @__PURE__ */ jsxRuntime.jsxs(
1604
1718
  OryFormSection,
1605
1719
  {
1606
- nodes: uniqueGroups.groups.lookup_secret,
1720
+ nodes: groupedNodes.groups.lookup_secret,
1607
1721
  "data-testid": "ory/screen/settings/group/lookup_secret",
1608
1722
  children: [
1609
1723
  /* @__PURE__ */ jsxRuntime.jsx(
1610
1724
  OrySettingsRecoveryCodes,
1611
1725
  {
1612
- nodes: (_c = uniqueGroups.groups.lookup_secret) != null ? _c : []
1726
+ nodes: (_c = groupedNodes.groups.lookup_secret) != null ? _c : []
1613
1727
  }
1614
1728
  ),
1615
- (_d = uniqueGroups.groups.default) == null ? void 0 : _d.map((node, k) => /* @__PURE__ */ jsxRuntime.jsx(Node, { node }, k))
1729
+ (_d = groupedNodes.groups.default) == null ? void 0 : _d.map((node, k) => /* @__PURE__ */ jsxRuntime.jsx(Node, { node }, k))
1616
1730
  ]
1617
1731
  }
1618
1732
  );
@@ -1621,11 +1735,11 @@ function SettingsSectionContent({ group, nodes }) {
1621
1735
  return /* @__PURE__ */ jsxRuntime.jsxs(
1622
1736
  OryFormSection,
1623
1737
  {
1624
- nodes: uniqueGroups.groups.oidc,
1738
+ nodes: groupedNodes.groups.oidc,
1625
1739
  "data-testid": "ory/screen/settings/group/oidc",
1626
1740
  children: [
1627
- /* @__PURE__ */ jsxRuntime.jsx(OrySettingsOidc, { nodes: (_e = uniqueGroups.groups.oidc) != null ? _e : [] }),
1628
- (_f = uniqueGroups.groups.default) == null ? void 0 : _f.map((node, k) => /* @__PURE__ */ jsxRuntime.jsx(Node, { node }, k))
1741
+ /* @__PURE__ */ jsxRuntime.jsx(OrySettingsOidc, { nodes: (_e = groupedNodes.groups.oidc) != null ? _e : [] }),
1742
+ (_f = groupedNodes.groups.default) == null ? void 0 : _f.map((node, k) => /* @__PURE__ */ jsxRuntime.jsx(Node, { node }, k))
1629
1743
  ]
1630
1744
  }
1631
1745
  );
@@ -1634,11 +1748,11 @@ function SettingsSectionContent({ group, nodes }) {
1634
1748
  return /* @__PURE__ */ jsxRuntime.jsxs(
1635
1749
  OryFormSection,
1636
1750
  {
1637
- nodes: uniqueGroups.groups.webauthn,
1751
+ nodes: groupedNodes.groups.webauthn,
1638
1752
  "data-testid": "ory/screen/settings/group/webauthn",
1639
1753
  children: [
1640
- /* @__PURE__ */ jsxRuntime.jsx(OrySettingsWebauthn, { nodes: (_g = uniqueGroups.groups.webauthn) != null ? _g : [] }),
1641
- (_h = uniqueGroups.groups.default) == null ? void 0 : _h.map((node, k) => /* @__PURE__ */ jsxRuntime.jsx(Node, { node }, k))
1754
+ /* @__PURE__ */ jsxRuntime.jsx(OrySettingsWebauthn, { nodes: (_g = groupedNodes.groups.webauthn) != null ? _g : [] }),
1755
+ (_h = groupedNodes.groups.default) == null ? void 0 : _h.map((node, k) => /* @__PURE__ */ jsxRuntime.jsx(Node, { node }, k))
1642
1756
  ]
1643
1757
  }
1644
1758
  );
@@ -1647,11 +1761,11 @@ function SettingsSectionContent({ group, nodes }) {
1647
1761
  return /* @__PURE__ */ jsxRuntime.jsxs(
1648
1762
  OryFormSection,
1649
1763
  {
1650
- nodes: uniqueGroups.groups.passkey,
1764
+ nodes: groupedNodes.groups.passkey,
1651
1765
  "data-testid": "ory/screen/settings/group/passkey",
1652
1766
  children: [
1653
- /* @__PURE__ */ jsxRuntime.jsx(OrySettingsPasskey, { nodes: (_i = uniqueGroups.groups.passkey) != null ? _i : [] }),
1654
- (_j = uniqueGroups.groups.default) == null ? void 0 : _j.map((node, k) => /* @__PURE__ */ jsxRuntime.jsx(Node, { node }, k))
1767
+ /* @__PURE__ */ jsxRuntime.jsx(OrySettingsPasskey, { nodes: (_i = groupedNodes.groups.passkey) != null ? _i : [] }),
1768
+ (_j = groupedNodes.groups.default) == null ? void 0 : _j.map((node, k) => /* @__PURE__ */ jsxRuntime.jsx(Node, { node }, k))
1655
1769
  ]
1656
1770
  }
1657
1771
  );
@@ -1672,7 +1786,7 @@ function SettingsSectionContent({ group, nodes }) {
1672
1786
  id: `settings.${group}.description`
1673
1787
  }),
1674
1788
  children: [
1675
- (_k = uniqueGroups.groups.default) == null ? void 0 : _k.map((node, k) => /* @__PURE__ */ jsxRuntime.jsx(Node, { node }, k)),
1789
+ (_k = groupedNodes.groups.default) == null ? void 0 : _k.map((node, k) => /* @__PURE__ */ jsxRuntime.jsx(Node, { node }, k)),
1676
1790
  nodes.filter(
1677
1791
  (node) => "type" in node.attributes && node.attributes.type !== "submit"
1678
1792
  ).map((node, k) => /* @__PURE__ */ jsxRuntime.jsx(Node, { node }, k))
@@ -1686,16 +1800,16 @@ function SettingsSectionContent({ group, nodes }) {
1686
1800
  }
1687
1801
  );
1688
1802
  }
1689
- var getScriptNode = (nodes) => nodes.find(
1690
- (node) => "id" in node.attributes && node.attributes.id === "webauthn_script"
1803
+ var onlyScriptNodes = (nodes) => nodes.filter(
1804
+ (node) => clientFetch.isUiNodeScriptAttributes(node.attributes) && node.attributes.id === "webauthn_script"
1691
1805
  );
1692
1806
  function OrySettingsCard() {
1693
1807
  const { flow } = useOryFlow();
1694
- const uniqueGroups = useNodesGroups(flow.ui.nodes);
1695
- const scriptNode = getScriptNode(flow.ui.nodes);
1808
+ const uniqueGroups = useNodesGroups(flow.ui.nodes, { omit: ["script"] });
1809
+ const scriptNodes = onlyScriptNodes(flow.ui.nodes);
1696
1810
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1697
1811
  /* @__PURE__ */ jsxRuntime.jsx(OryCardValidationMessages, {}),
1698
- scriptNode && /* @__PURE__ */ jsxRuntime.jsx(Node, { node: scriptNode }),
1812
+ scriptNodes.map((n) => /* @__PURE__ */ jsxRuntime.jsx(Node, { node: n })),
1699
1813
  uniqueGroups.entries.map(([group, nodes]) => {
1700
1814
  if (group === clientFetch.UiNodeGroupEnum.Default) {
1701
1815
  return null;
@@ -2031,6 +2145,20 @@ var en_default = {
2031
2145
  "property.username": "username",
2032
2146
  "property.identifier": "identifier",
2033
2147
  "property.code": "code",
2148
+ "consent.title": "Authorize {party}",
2149
+ "consent.subtitle": "A third party application wants to access information associated with your account {identifier}.",
2150
+ "consent.scope.openid.title": "Identity",
2151
+ "consent.scope.openid.description": "Allows the application to verify your identity. This is required for authentication and a trusted login experience.",
2152
+ "consent.scope.offline_access.title": "Offline Access",
2153
+ "consent.scope.offline_access.description": "Allows this application to keep you signed in even when you're not actively using it.",
2154
+ "consent.scope.profile.title": "Profile Information",
2155
+ "consent.scope.profile.description": "Allows access to your basic profile details, including your username, first name, and last name.",
2156
+ "consent.scope.email.title": "Email Address",
2157
+ "consent.scope.email.description": "Retrieve your email address and its verification status.",
2158
+ "consent.scope.address.title": "Physical Address",
2159
+ "consent.scope.address.description": "Access your postal address.",
2160
+ "consent.scope.phone.title": "Phone Number",
2161
+ "consent.scope.phone.description": "Retrieve your phone number and its verification status.",
2034
2162
  "error.title.what-happened": "What happened?",
2035
2163
  "error.title.what-can-i-do": "What can I do?",
2036
2164
  "error.instructions": "Please try again in a few minutes or contact the website operator.",
@@ -2207,7 +2335,7 @@ var de_default = {
2207
2335
  "two-step.code.description": "Ein Best\xE4tigungscode wird an Ihre E-Mail gesendet.",
2208
2336
  "two-step.code.title": "E-Mail-Code",
2209
2337
  "two-step.passkey.description": "Verwenden Sie die Fingerabdruck- oder Gesichtserkennung Ihres Ger\xE4ts",
2210
- "two-step.passkey.title": "Passwort (empfohlen)",
2338
+ "two-step.passkey.title": "Passkey (empfohlen)",
2211
2339
  "two-step.password.description": "Geben Sie Ihr Passwort ein, das mit Ihrem Konto verkn\xFCpft ist",
2212
2340
  "two-step.password.title": "Passwort",
2213
2341
  "two-step.webauthn.title": "Sicherheitsschl\xFCssel",
@@ -2302,6 +2430,20 @@ var de_default = {
2302
2430
  "property.phone": "Telefon",
2303
2431
  "property.code": "Code",
2304
2432
  "property.username": "Benutzername",
2433
+ "consent.title": "Autorisieren {party}",
2434
+ "consent.subtitle": "Eine Drittanbieteranwendung m\xF6chte auf Informationen zugreifen, die mit Ihrem Konto {identifier} verkn\xFCpft sind.",
2435
+ "consent.scope.openid.title": "Identit\xE4t",
2436
+ "consent.scope.openid.description": "Erm\xF6glicht der Anwendung, Ihre Identit\xE4t zu \xFCberpr\xFCfen. Dies ist f\xFCr die Authentifizierung und eine vertrauensw\xFCrdige Login-Erfahrung erforderlich.",
2437
+ "consent.scope.offline_access.title": "Offline-Zugriff",
2438
+ "consent.scope.offline_access.description": "Erm\xF6glicht dieser Anwendung, Sie angemeldet zu lassen, auch wenn Sie sie nicht aktiv nutzen.",
2439
+ "consent.scope.profile.title": "Profilinformationen",
2440
+ "consent.scope.profile.description": "Erm\xF6glicht den Zugriff auf Ihre grundlegenden Profildetails, einschlie\xDFlich Ihres Benutzernamens, Vornamens und Nachnamens.",
2441
+ "consent.scope.email.title": "E-Mail-Adresse",
2442
+ "consent.scope.email.description": "Erm\xF6glicht den Abruf Ihrer E-Mail-Adresse und deren \xDCberpr\xFCfungsstatus.",
2443
+ "consent.scope.address.title": "Physische Adresse",
2444
+ "consent.scope.address.description": "Erm\xF6glicht den Zugriff auf Ihre Postanschrift.",
2445
+ "consent.scope.phone.title": "Telefonnummer",
2446
+ "consent.scope.phone.description": "Erm\xF6glicht den Abruf Ihrer Telefonnummer und deren \xDCberpr\xFCfungsstatus.",
2305
2447
  "error.title.what-happened": "Was ist passiert?",
2306
2448
  "error.footer.copy": "Kopieren",
2307
2449
  "error.footer.text": "Bitte f\xFCgen Sie bei der Meldung dieses Fehlers die folgenden Informationen hinzu:",
@@ -2573,6 +2715,20 @@ var es_default = {
2573
2715
  "property.password": "",
2574
2716
  "property.phone": "",
2575
2717
  "property.username": "",
2718
+ "consent.title": "Autorizar {party}",
2719
+ "consent.subtitle": "Una aplicaci\xF3n de terceros quiere acceder a la informaci\xF3n asociada a su cuenta {identifier}.",
2720
+ "consent.scope.openid.title": "Identidad",
2721
+ "consent.scope.openid.description": "Permite que la aplicaci\xF3n verifique su identidad. Esto es necesario para la autenticaci\xF3n y una experiencia de inicio de sesi\xF3n confiable.",
2722
+ "consent.scope.offline_access.title": "Acceso sin conexi\xF3n",
2723
+ "consent.scope.offline_access.description": "Permite que esta aplicaci\xF3n le mantenga conectado incluso cuando no la est\xE9 utilizando activamente.",
2724
+ "consent.scope.profile.title": "Informaci\xF3n del perfil",
2725
+ "consent.scope.profile.description": "Permite el acceso a los detalles b\xE1sicos de su perfil, incluyendo su nombre de usuario, nombre y apellido.",
2726
+ "consent.scope.email.title": "Direcci\xF3n de correo electr\xF3nico",
2727
+ "consent.scope.email.description": "Recupere su direcci\xF3n de correo electr\xF3nico y su estado de verificaci\xF3n.",
2728
+ "consent.scope.address.title": "Direcci\xF3n f\xEDsica",
2729
+ "consent.scope.address.description": "Acceda a su direcci\xF3n postal.",
2730
+ "consent.scope.phone.title": "N\xFAmero de tel\xE9fono",
2731
+ "consent.scope.phone.description": "Recupere su n\xFAmero de tel\xE9fono y su estado de verificaci\xF3n.",
2576
2732
  "error.action.go-back": "",
2577
2733
  "error.footer.copy": "",
2578
2734
  "error.footer.text": "",
@@ -2844,6 +3000,20 @@ var fr_default = {
2844
3000
  "property.password": "",
2845
3001
  "property.phone": "",
2846
3002
  "property.username": "",
3003
+ "consent.title": "Autoriser {party}",
3004
+ "consent.subtitle": "Une application tierce souhaite acc\xE9der aux informations associ\xE9es \xE0 votre compte {identifier}.",
3005
+ "consent.scope.openid.title": "Identit\xE9",
3006
+ "consent.scope.openid.description": "Permet \xE0 l'application de v\xE9rifier votre identit\xE9. Cela est n\xE9cessaire pour l'authentification et une exp\xE9rience de connexion fiable.",
3007
+ "consent.scope.offline_access.title": "Acc\xE8s hors ligne",
3008
+ "consent.scope.offline_access.description": "Permet \xE0 cette application de vous maintenir connect\xE9 m\xEAme lorsque vous ne l'utilisez pas activement.",
3009
+ "consent.scope.profile.title": "Informations de profil",
3010
+ "consent.scope.profile.description": "Permet l'acc\xE8s aux d\xE9tails de base de votre profil, y compris votre nom d'utilisateur, pr\xE9nom et nom.",
3011
+ "consent.scope.email.title": "Adresse e-mail",
3012
+ "consent.scope.email.description": "R\xE9cup\xE8re votre adresse e-mail et son statut de v\xE9rification.",
3013
+ "consent.scope.address.title": "Adresse physique",
3014
+ "consent.scope.address.description": "Acc\xE8de \xE0 votre adresse postale.",
3015
+ "consent.scope.phone.title": "Num\xE9ro de t\xE9l\xE9phone",
3016
+ "consent.scope.phone.description": "R\xE9cup\xE8re votre num\xE9ro de t\xE9l\xE9phone et son statut de v\xE9rification.",
2847
3017
  "error.action.go-back": "",
2848
3018
  "error.footer.copy": "",
2849
3019
  "error.footer.text": "",
@@ -3115,6 +3285,20 @@ var nl_default = {
3115
3285
  "property.password": "",
3116
3286
  "property.phone": "",
3117
3287
  "property.username": "",
3288
+ "consent.title": "Autoriseren {party}",
3289
+ "consent.subtitle": "Een derde partij applicatie wil toegang tot informatie die aan uw account {identifier} is gekoppeld.",
3290
+ "consent.scope.openid.title": "Identiteit",
3291
+ "consent.scope.openid.description": "Stelt de applicatie in staat uw identiteit te verifi\xEBren. Dit is vereist voor authenticatie en een betrouwbare inlogervaring.",
3292
+ "consent.scope.offline_access.title": "Offline toegang",
3293
+ "consent.scope.offline_access.description": "Stelt deze applicatie in staat u ingelogd te houden, zelfs wanneer u deze niet actief gebruikt.",
3294
+ "consent.scope.profile.title": "Profielinformatie",
3295
+ "consent.scope.profile.description": "Geeft toegang tot uw basisprofielgegevens, inclusief uw gebruikersnaam, voornaam en achternaam.",
3296
+ "consent.scope.email.title": "E-mailadres",
3297
+ "consent.scope.email.description": "Haal uw e-mailadres en de verificatiestatus ervan op.",
3298
+ "consent.scope.address.title": "Fysiek adres",
3299
+ "consent.scope.address.description": "Toegang tot uw postadres.",
3300
+ "consent.scope.phone.title": "Telefoonnummer",
3301
+ "consent.scope.phone.description": "Haal uw telefoonnummer en de verificatiestatus ervan op.",
3118
3302
  "error.action.go-back": "",
3119
3303
  "error.footer.copy": "",
3120
3304
  "error.footer.text": "",
@@ -3386,6 +3570,20 @@ var pl_default = {
3386
3570
  "property.phone": "",
3387
3571
  "property.username": "",
3388
3572
  "property.identifier": "",
3573
+ "consent.title": "Autoryzuj {party}",
3574
+ "consent.subtitle": "Aplikacja trzeciej strony chce uzyska\u0107 dost\u0119p do informacji powi\u0105zanych z Twoim kontem {identifier}.",
3575
+ "consent.scope.openid.title": "To\u017Csamo\u015B\u0107",
3576
+ "consent.scope.openid.description": "Pozwala aplikacji zweryfikowa\u0107 Twoj\u0105 to\u017Csamo\u015B\u0107. Jest to wymagane do uwierzytelniania i zapewnienia zaufanej sesji logowania.",
3577
+ "consent.scope.offline_access.title": "Dost\u0119p offline",
3578
+ "consent.scope.offline_access.description": "Pozwala aplikacji utrzyma\u0107 Twoje logowanie, nawet gdy nie korzystasz z niej aktywnie.",
3579
+ "consent.scope.profile.title": "Informacje profilowe",
3580
+ "consent.scope.profile.description": "Pozwala na dost\u0119p do podstawowych danych profilowych, w tym nazwy u\u017Cytkownika, imienia i nazwiska.",
3581
+ "consent.scope.email.title": "Adres e-mail",
3582
+ "consent.scope.email.description": "Pobierz sw\xF3j adres e-mail oraz status jego weryfikacji.",
3583
+ "consent.scope.address.title": "Adres fizyczny",
3584
+ "consent.scope.address.description": "Dost\u0119p do Twojego adresu pocztowego.",
3585
+ "consent.scope.phone.title": "Numer telefonu",
3586
+ "consent.scope.phone.description": "Pobierz sw\xF3j numer telefonu oraz status jego weryfikacji.",
3389
3587
  "error.action.go-back": "",
3390
3588
  "error.footer.copy": "",
3391
3589
  "error.footer.text": "",
@@ -3657,6 +3855,20 @@ var pt_default = {
3657
3855
  "property.password": "",
3658
3856
  "property.phone": "",
3659
3857
  "property.username": "",
3858
+ "consent.title": "Autorizar {party}",
3859
+ "consent.subtitle": "Um aplicativo de terceiros deseja acessar as informa\xE7\xF5es associadas \xE0 sua conta {identifier}.",
3860
+ "consent.scope.openid.title": "Identidade",
3861
+ "consent.scope.openid.description": "Permite que a aplica\xE7\xE3o verifique sua identidade. Isso \xE9 necess\xE1rio para a autentica\xE7\xE3o e uma experi\xEAncia de login confi\xE1vel.",
3862
+ "consent.scope.offline_access.title": "Acesso Offline",
3863
+ "consent.scope.offline_access.description": "Permite que este aplicativo mantenha voc\xEA conectado mesmo quando n\xE3o estiver usando-o ativamente.",
3864
+ "consent.scope.profile.title": "Informa\xE7\xF5es do Perfil",
3865
+ "consent.scope.profile.description": "Permite o acesso aos detalhes b\xE1sicos do seu perfil, incluindo seu nome de usu\xE1rio, primeiro nome e sobrenome.",
3866
+ "consent.scope.email.title": "Endere\xE7o de E-mail",
3867
+ "consent.scope.email.description": "Recupere seu endere\xE7o de e-mail e seu status de verifica\xE7\xE3o.",
3868
+ "consent.scope.address.title": "Endere\xE7o F\xEDsico",
3869
+ "consent.scope.address.description": "Acesse seu endere\xE7o postal.",
3870
+ "consent.scope.phone.title": "N\xFAmero de Telefone",
3871
+ "consent.scope.phone.description": "Recupere seu n\xFAmero de telefone e seu status de verifica\xE7\xE3o.",
3660
3872
  "error.action.go-back": "",
3661
3873
  "error.footer.copy": "",
3662
3874
  "error.footer.text": "",
@@ -3928,6 +4140,20 @@ var sv_default = {
3928
4140
  "property.username": "anv\xE4ndarnamn",
3929
4141
  "property.identifier": "identifier",
3930
4142
  "property.code": "kod",
4143
+ "consent.title": "Auktorisera {party}",
4144
+ "consent.subtitle": "En tredjepartsapplikation vill f\xE5 tillg\xE5ng till information kopplad till ditt konto {identifier}.",
4145
+ "consent.scope.openid.title": "Identitet",
4146
+ "consent.scope.openid.description": "G\xF6r det m\xF6jligt f\xF6r applikationen att verifiera din identitet. Detta kr\xE4vs f\xF6r autentisering och en p\xE5litlig inloggningsupplevelse.",
4147
+ "consent.scope.offline_access.title": "Offline-\xE5tkomst",
4148
+ "consent.scope.offline_access.description": "G\xF6r det m\xF6jligt f\xF6r denna applikation att h\xE5lla dig inloggad \xE4ven n\xE4r du inte aktivt anv\xE4nder den.",
4149
+ "consent.scope.profile.title": "Profilinformation",
4150
+ "consent.scope.profile.description": "Ger tillg\xE5ng till dina grundl\xE4ggande profiluppgifter, inklusive ditt anv\xE4ndarnamn, f\xF6rnamn och efternamn.",
4151
+ "consent.scope.email.title": "E-postadress",
4152
+ "consent.scope.email.description": "H\xE4mta din e-postadress och dess verifieringsstatus.",
4153
+ "consent.scope.address.title": "Fysisk adress",
4154
+ "consent.scope.address.description": "F\xE5 \xE5tkomst till din postadress.",
4155
+ "consent.scope.phone.title": "Telefonnummer",
4156
+ "consent.scope.phone.description": "H\xE4mta ditt telefonnummer och dess verifieringsstatus.",
3931
4157
  "error.action.go-back": "",
3932
4158
  "error.footer.copy": "",
3933
4159
  "error.footer.text": "",
@@ -3954,6 +4180,7 @@ exports.OryCardContent = OryCardContent;
3954
4180
  exports.OryCardFooter = OryCardFooter;
3955
4181
  exports.OryCardHeader = OryCardHeader;
3956
4182
  exports.OryCardValidationMessages = OryCardValidationMessages;
4183
+ exports.OryConsentCard = OryConsentCard;
3957
4184
  exports.OryForm = OryForm;
3958
4185
  exports.OryFormGroupDivider = OryFormGroupDivider;
3959
4186
  exports.OryFormGroups = OryFormGroups;