@wise/dynamic-flow-client-internal 4.0.0-experimental-8a78888 → 4.0.0-experimental-ffcedb9

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/build/main.js CHANGED
@@ -143,14 +143,14 @@ var init_clsx = __esm({
143
143
  }
144
144
  });
145
145
 
146
- // ../../node_modules/.pnpm/@wise+art@2.19.0_@transferwise+neptune-css@14.20.1_@types+react@18.3.18_react-dom@18.3.1_reac_mzw7cg6j4wc7ddwlhxck7linn4/node_modules/@wise/art/dist/index-8Fxev6OI.esm.js
147
- var import_react3, import_jsx_runtime12, unknownFlagName, Flag, Sizes, ImageSizes, imageSizes, Assets, RenderMode;
146
+ // ../../node_modules/.pnpm/@wise+art@2.19.0_@transferwise+neptune-css@14.22.0_@types+react@18.3.18_react-dom@18.3.1_reac_62coi6aa7fmdhpcz7p72kf3gum/node_modules/@wise/art/dist/index-8Fxev6OI.esm.js
147
+ var import_react, import_jsx_runtime11, unknownFlagName, Flag, Sizes, ImageSizes, imageSizes, Assets, RenderMode;
148
148
  var init_index_8Fxev6OI_esm = __esm({
149
- "../../node_modules/.pnpm/@wise+art@2.19.0_@transferwise+neptune-css@14.20.1_@types+react@18.3.18_react-dom@18.3.1_reac_mzw7cg6j4wc7ddwlhxck7linn4/node_modules/@wise/art/dist/index-8Fxev6OI.esm.js"() {
149
+ "../../node_modules/.pnpm/@wise+art@2.19.0_@transferwise+neptune-css@14.22.0_@types+react@18.3.18_react-dom@18.3.1_reac_62coi6aa7fmdhpcz7p72kf3gum/node_modules/@wise/art/dist/index-8Fxev6OI.esm.js"() {
150
150
  "use strict";
151
151
  init_clsx();
152
- import_react3 = require("react");
153
- import_jsx_runtime12 = require("react/jsx-runtime");
152
+ import_react = require("react");
153
+ import_jsx_runtime11 = require("react/jsx-runtime");
154
154
  unknownFlagName = "wise";
155
155
  Flag = ({
156
156
  code,
@@ -158,13 +158,13 @@ var init_index_8Fxev6OI_esm = __esm({
158
158
  className = void 0,
159
159
  loading = "lazy"
160
160
  }) => {
161
- const [fallback, setFallback] = (0, import_react3.useState)(null);
162
- (0, import_react3.useEffect)(() => {
161
+ const [fallback, setFallback] = (0, import_react.useState)(null);
162
+ (0, import_react.useEffect)(() => {
163
163
  setFallback(null);
164
164
  }, [code]);
165
165
  const detailed = intrinsicSize >= 150;
166
166
  const name = fallback !== "unknown" ? `${code.toLowerCase()}${fallback == null && detailed ? "-detailed" : ""}` : unknownFlagName;
167
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("img", {
167
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("img", {
168
168
  className: clsx(`wds-flag wds-flag-${name}`, className),
169
169
  src: false ? `${name}.svg` : `https://wise.com/web-art/assets/flags/${name}.svg`,
170
170
  loading,
@@ -274,10 +274,9 @@ var init_index_8Fxev6OI_esm = __esm({
274
274
  // src/index.ts
275
275
  var index_exports = {};
276
276
  __export(index_exports, {
277
- DynamicFlow: () => DynamicFlowLegacy,
278
277
  DynamicFlowLegacy: () => DynamicFlowLegacy,
279
278
  DynamicFlowRevamp: () => DynamicFlowRevamp,
280
- DynamicFragment: () => DynamicFragment,
279
+ DynamicForm: () => DynamicForm,
281
280
  JsonSchemaForm: () => import_dynamic_flow_client4.JsonSchemaForm,
282
281
  isValidSchema: () => import_dynamic_flow_client4.isValidSchema,
283
282
  makeCustomFetch: () => import_dynamic_flow_client3.makeHttpClient,
@@ -880,22 +879,10 @@ var translations = languages.reduce(
880
879
  var i18n_default = translations;
881
880
 
882
881
  // src/dynamicFlow/DynamicFlow.tsx
883
- var import_react16 = require("react");
882
+ var import_react13 = require("react");
884
883
  var import_react_intl16 = require("react-intl");
885
884
  var import_dynamic_flow_client2 = require("@wise/dynamic-flow-client");
886
885
 
887
- // ../renderers/src/contexts/RendererHttpClientContext.tsx
888
- var import_react = require("react");
889
- var import_jsx_runtime = require("react/jsx-runtime");
890
- var HttpClientContext = (0, import_react.createContext)(void 0);
891
- function RendererHttpClientProvider({ httpClient, children }) {
892
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(HttpClientContext.Provider, { value: httpClient, children });
893
- }
894
- var useRendererHttpClient = () => {
895
- const contextFetch = (0, import_react.useContext)(HttpClientContext);
896
- return contextFetch != null ? contextFetch : fetch;
897
- };
898
-
899
886
  // ../renderers/src/AlertRenderer.tsx
900
887
  var import_components = require("@transferwise/components");
901
888
 
@@ -930,10 +917,10 @@ var getTextAlignment = (align) => {
930
917
  var getTextAlignmentAndMargin = (component) => `${getTextAlignment(component.align)} ${getMargin(component.margin)}`;
931
918
 
932
919
  // ../renderers/src/AlertRenderer.tsx
933
- var import_jsx_runtime2 = require("react/jsx-runtime");
920
+ var import_jsx_runtime = require("react/jsx-runtime");
934
921
  var AlertRenderer = {
935
922
  canRenderType: "alert",
936
- render: ({ context, markdown, margin, callToAction }) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
923
+ render: ({ context, markdown, margin, callToAction }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
937
924
  import_components.Alert,
938
925
  {
939
926
  type: context,
@@ -987,14 +974,14 @@ var help_messages_default = (0, import_react_intl.defineMessages)({
987
974
  });
988
975
 
989
976
  // ../renderers/src/components/Help.tsx
990
- var import_jsx_runtime3 = require("react/jsx-runtime");
977
+ var import_jsx_runtime2 = require("react/jsx-runtime");
991
978
  function Help({ help }) {
992
979
  const intl = (0, import_react_intl2.useIntl)();
993
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
980
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
994
981
  import_components2.Info,
995
982
  {
996
983
  className: "m-l-1",
997
- content: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_components2.Markdown, { config: { link: { target: "_blank" } }, children: help }),
984
+ content: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_components2.Markdown, { config: { link: { target: "_blank" } }, children: help }),
998
985
  presentation: "POPOVER",
999
986
  size: "sm",
1000
987
  "aria-label": intl.formatMessage(help_messages_default.helpAria)
@@ -1004,19 +991,19 @@ function Help({ help }) {
1004
991
  var Help_default = Help;
1005
992
 
1006
993
  // ../renderers/src/components/LabelContentWithHelp.tsx
1007
- var import_jsx_runtime4 = require("react/jsx-runtime");
994
+ var import_jsx_runtime3 = require("react/jsx-runtime");
1008
995
  function LabelContentWithHelp({ text, help }) {
1009
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { children: [
996
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { children: [
1010
997
  text,
1011
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Help_default, { help })
998
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Help_default, { help })
1012
999
  ] });
1013
1000
  }
1014
1001
 
1015
1002
  // ../renderers/src/components/FieldInput.tsx
1016
- var import_jsx_runtime5 = require("react/jsx-runtime");
1003
+ var import_jsx_runtime4 = require("react/jsx-runtime");
1017
1004
  function FieldInput({ id, children, label, validation, description, help }) {
1018
- const labelContent = label && help ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(LabelContentWithHelp, { text: label, help }) : label;
1019
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1005
+ const labelContent = label && help ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(LabelContentWithHelp, { text: label, help }) : label;
1006
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1020
1007
  import_components3.Field,
1021
1008
  {
1022
1009
  id,
@@ -1041,7 +1028,7 @@ var FieldInput_default = FieldInput;
1041
1028
 
1042
1029
  // ../renderers/src/CheckboxInputRenderer.tsx
1043
1030
  var import_components4 = require("@transferwise/components");
1044
- var import_jsx_runtime6 = require("react/jsx-runtime");
1031
+ var import_jsx_runtime5 = require("react/jsx-runtime");
1045
1032
  var CheckboxInputRenderer = {
1046
1033
  canRenderType: "input-checkbox",
1047
1034
  render: (props) => {
@@ -1065,20 +1052,20 @@ var CheckboxInputRenderer = {
1065
1052
  "value"
1066
1053
  ]);
1067
1054
  const checkboxProps = __spreadProps(__spreadValues({}, rest), { label: title, secondary: description, checked: value });
1068
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(FieldInput_default, { id, label: "", description: "", validation: validationState, help, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_components4.Checkbox, __spreadValues({ id }, checkboxProps)) });
1055
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(FieldInput_default, { id, label: "", description: "", validation: validationState, help, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_components4.Checkbox, __spreadValues({ id }, checkboxProps)) });
1069
1056
  }
1070
1057
  };
1071
1058
  var CheckboxInputRenderer_default = CheckboxInputRenderer;
1072
1059
 
1073
1060
  // ../renderers/src/BoxRenderer.tsx
1074
1061
  var import_classnames = __toESM(require_classnames());
1075
- var import_jsx_runtime7 = require("react/jsx-runtime");
1062
+ var import_jsx_runtime6 = require("react/jsx-runtime");
1076
1063
  var BoxRenderer = {
1077
1064
  canRenderType: "box",
1078
- render: ({ border, children, control, margin, width }) => {
1065
+ render: ({ children, control, margin, width }) => {
1079
1066
  const hasFixedWidth = width !== "xl";
1080
- const hasBorder = control === "bordered" || control === "bordered-web" || border;
1081
- const contents = /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1067
+ const hasBorder = control === "bordered" || control === "bordered-web";
1068
+ const contents = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1082
1069
  "div",
1083
1070
  {
1084
1071
  className: (0, import_classnames.default)({
@@ -1089,30 +1076,14 @@ var BoxRenderer = {
1089
1076
  children
1090
1077
  }
1091
1078
  );
1092
- return hasFixedWidth ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: (0, import_classnames.default)("df-box-renderer-fixed-width", getMargin(margin)), children: contents }) : contents;
1079
+ return hasFixedWidth ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: (0, import_classnames.default)("df-box-renderer-fixed-width", getMargin(margin)), children: contents }) : contents;
1093
1080
  }
1094
1081
  };
1095
1082
  var BoxRenderer_default = BoxRenderer;
1096
1083
 
1097
1084
  // ../renderers/src/ButtonRenderer.tsx
1098
1085
  var import_components5 = require("@transferwise/components");
1099
-
1100
- // ../renderers/src/step/StepRendererContext.tsx
1101
- var import_react2 = require("react");
1102
- var StepRendererContext = (0, import_react2.createContext)({ loadingState: "idle", trackEvent: () => {
1103
- } });
1104
- var StepRendererContextProvider = StepRendererContext.Provider;
1105
- var useLoadingContext = () => {
1106
- const { loadingState } = (0, import_react2.useContext)(StepRendererContext);
1107
- return { loadingState, isLoading: loadingState !== "idle" };
1108
- };
1109
- var useTrackEvent = () => {
1110
- const { trackEvent } = (0, import_react2.useContext)(StepRendererContext);
1111
- return trackEvent;
1112
- };
1113
-
1114
- // ../renderers/src/ButtonRenderer.tsx
1115
- var import_jsx_runtime8 = require("react/jsx-runtime");
1086
+ var import_jsx_runtime7 = require("react/jsx-runtime");
1116
1087
  var ButtonRenderer = {
1117
1088
  canRenderType: "button",
1118
1089
  render: ButtonRendererComponent
@@ -1124,13 +1095,14 @@ function ButtonRendererComponent({
1124
1095
  margin,
1125
1096
  title,
1126
1097
  size: size2,
1098
+ stepLoadingState,
1127
1099
  onClick
1128
1100
  }) {
1129
1101
  const className = getMargin(margin);
1130
1102
  const priority = mapControl(control);
1131
1103
  const type = priority === "tertiary" ? void 0 : mapContext(context);
1132
- const { isLoading } = useLoadingContext();
1133
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1104
+ const isLoading = stepLoadingState !== "idle";
1105
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1134
1106
  import_components5.Button,
1135
1107
  {
1136
1108
  block: true,
@@ -1182,10 +1154,10 @@ var ButtonRenderer_default = ButtonRenderer;
1182
1154
 
1183
1155
  // ../renderers/src/ColumnsRenderer.tsx
1184
1156
  var import_classnames2 = __toESM(require_classnames());
1185
- var import_jsx_runtime9 = require("react/jsx-runtime");
1157
+ var import_jsx_runtime8 = require("react/jsx-runtime");
1186
1158
  var ColumnsRenderer = {
1187
1159
  canRenderType: "columns",
1188
- render: ({ bias, margin, startChildren, endChildren }) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
1160
+ render: ({ bias, margin, startChildren, endChildren }) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1189
1161
  "div",
1190
1162
  {
1191
1163
  className: (0, import_classnames2.default)("df-columns-renderer-container", getMargin(margin), {
@@ -1193,8 +1165,8 @@ var ColumnsRenderer = {
1193
1165
  "df-columns-renderer-bias-end": bias === "end"
1194
1166
  }),
1195
1167
  children: [
1196
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "df-columns-renderer-column", children: startChildren }),
1197
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "df-columns-renderer-column", children: endChildren })
1168
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "df-columns-renderer-column", children: startChildren }),
1169
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "df-columns-renderer-column", children: endChildren })
1198
1170
  ]
1199
1171
  }
1200
1172
  )
@@ -1233,7 +1205,7 @@ var dateToDateString = (date) => {
1233
1205
  };
1234
1206
 
1235
1207
  // ../renderers/src/components/VariableDateInput.tsx
1236
- var import_jsx_runtime10 = require("react/jsx-runtime");
1208
+ var import_jsx_runtime9 = require("react/jsx-runtime");
1237
1209
  function VariableDateInput({
1238
1210
  control,
1239
1211
  inputProps
@@ -1249,7 +1221,7 @@ function VariableDateInput({
1249
1221
  onFocus
1250
1222
  } = inputProps;
1251
1223
  if (control === "date-lookup") {
1252
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1224
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1253
1225
  import_components6.DateLookup,
1254
1226
  {
1255
1227
  value: dateStringToDateOrNull(inputProps.value),
@@ -1265,7 +1237,7 @@ function VariableDateInput({
1265
1237
  }
1266
1238
  );
1267
1239
  }
1268
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1240
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1269
1241
  import_components6.DateInput,
1270
1242
  __spreadProps(__spreadValues({}, inputProps), {
1271
1243
  dayAutoComplete: getAutocompleteString(autoComplete, "day"),
@@ -1282,7 +1254,7 @@ var getAutocompleteString = (value, suffix) => {
1282
1254
  var VariableDateInput_default = VariableDateInput;
1283
1255
 
1284
1256
  // ../renderers/src/DateInputRenderer.tsx
1285
- var import_jsx_runtime11 = require("react/jsx-runtime");
1257
+ var import_jsx_runtime10 = require("react/jsx-runtime");
1286
1258
  var DateInputRenderer = {
1287
1259
  canRenderType: "input-date",
1288
1260
  render: (props) => {
@@ -1307,7 +1279,7 @@ var DateInputRenderer = {
1307
1279
  ]);
1308
1280
  const value = initialValue != null ? initialValue : "";
1309
1281
  const inputProps = __spreadProps(__spreadValues({}, rest), { value, id });
1310
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1282
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1311
1283
  FieldInput_default,
1312
1284
  {
1313
1285
  id,
@@ -1315,7 +1287,7 @@ var DateInputRenderer = {
1315
1287
  description,
1316
1288
  validation: validationState,
1317
1289
  help,
1318
- children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(VariableDateInput_default, { control, inputProps })
1290
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(VariableDateInput_default, { control, inputProps })
1319
1291
  }
1320
1292
  );
1321
1293
  }
@@ -1325,26 +1297,26 @@ var DateInputRenderer_default = DateInputRenderer;
1325
1297
  // ../renderers/src/DecisionRenderer.tsx
1326
1298
  var import_components8 = require("@transferwise/components");
1327
1299
 
1328
- // ../../node_modules/.pnpm/@wise+art@2.19.0_@transferwise+neptune-css@14.20.1_@types+react@18.3.18_react-dom@18.3.1_reac_mzw7cg6j4wc7ddwlhxck7linn4/node_modules/@wise/art/dist/index.esm.js
1300
+ // ../../node_modules/.pnpm/@wise+art@2.19.0_@transferwise+neptune-css@14.22.0_@types+react@18.3.18_react-dom@18.3.1_reac_62coi6aa7fmdhpcz7p72kf3gum/node_modules/@wise/art/dist/index.esm.js
1329
1301
  init_index_8Fxev6OI_esm();
1330
1302
  init_clsx();
1331
- var import_react4 = require("react");
1332
- var import_jsx_runtime13 = require("react/jsx-runtime");
1303
+ var import_react2 = require("react");
1304
+ var import_jsx_runtime12 = require("react/jsx-runtime");
1333
1305
 
1334
1306
  // ../renderers/src/components/icon/FlagIcon.tsx
1335
- var import_jsx_runtime14 = require("react/jsx-runtime");
1307
+ var import_jsx_runtime13 = require("react/jsx-runtime");
1336
1308
  var isFlagIcon = (name) => name.startsWith("flag-");
1337
1309
  function FlagIcon({ name }) {
1338
1310
  if (!isFlagIcon(name)) {
1339
1311
  return null;
1340
1312
  }
1341
1313
  const code = name.substring(5);
1342
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Flag, { code });
1314
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Flag, { code });
1343
1315
  }
1344
1316
 
1345
1317
  // ../renderers/src/components/icon/NamedIcon.tsx
1346
1318
  var icons = __toESM(require("@transferwise/icons"));
1347
- var import_jsx_runtime15 = require("react/jsx-runtime");
1319
+ var import_jsx_runtime14 = require("react/jsx-runtime");
1348
1320
  var isNamedIcon = (name) => {
1349
1321
  const iconName = toCapitalisedCamelCase(name);
1350
1322
  return Object.keys(icons).includes(iconName);
@@ -1355,19 +1327,19 @@ function NamedIcon({ name }) {
1355
1327
  }
1356
1328
  const iconName = toCapitalisedCamelCase(name);
1357
1329
  const Icon = icons[iconName];
1358
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Icon, { size: 24 });
1330
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Icon, { size: 24 });
1359
1331
  }
1360
1332
  var toCapitalisedCamelCase = (value) => value.split("-").map(capitaliseFirstChar).join("");
1361
1333
  var capitaliseFirstChar = (value) => `${value[0].toUpperCase()}${value.slice(1)}`;
1362
1334
 
1363
1335
  // ../renderers/src/components/icon/DynamicIcon.tsx
1364
- var import_jsx_runtime16 = require("react/jsx-runtime");
1336
+ var import_jsx_runtime15 = require("react/jsx-runtime");
1365
1337
  function DynamicIcon({ name }) {
1366
1338
  if (isFlagIcon(name)) {
1367
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(FlagIcon, { name });
1339
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FlagIcon, { name });
1368
1340
  }
1369
1341
  if (isNamedIcon(name)) {
1370
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(NamedIcon, { name });
1342
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(NamedIcon, { name });
1371
1343
  }
1372
1344
  return null;
1373
1345
  }
@@ -1375,46 +1347,51 @@ var DynamicIcon_default = DynamicIcon;
1375
1347
 
1376
1348
  // ../renderers/src/components/icon/NavigationOptionMedia.tsx
1377
1349
  var import_components7 = require("@transferwise/components");
1378
- var import_jsx_runtime17 = require("react/jsx-runtime");
1350
+ var import_jsx_runtime16 = require("react/jsx-runtime");
1379
1351
  function NavigationOptionMedia({ icon, image }) {
1380
1352
  if (!isNullish(icon)) {
1381
1353
  if ("name" in icon) {
1382
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_components7.Avatar, { type: import_components7.AvatarType.ICON, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DynamicIcon_default, { name: icon.name }) });
1354
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_components7.Avatar, { type: import_components7.AvatarType.ICON, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(DynamicIcon_default, { name: icon.name }) });
1383
1355
  }
1384
1356
  if (icon.text) {
1385
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_components7.Avatar, { type: import_components7.AvatarType.INITIALS, children: icon.text });
1357
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_components7.Avatar, { type: import_components7.AvatarType.INITIALS, children: icon.text });
1386
1358
  }
1387
1359
  }
1388
1360
  if (image) {
1389
1361
  const { accessibilityDescription, uri, url } = image;
1390
1362
  if (uri && !uri.startsWith("urn:")) {
1391
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("img", { src: uri, alt: accessibilityDescription });
1363
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("img", { src: uri, alt: accessibilityDescription });
1392
1364
  }
1393
1365
  if (url) {
1394
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("img", { src: url, alt: accessibilityDescription });
1366
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("img", { src: url, alt: accessibilityDescription });
1395
1367
  }
1396
1368
  }
1397
1369
  return null;
1398
1370
  }
1399
1371
 
1400
1372
  // ../renderers/src/DecisionRenderer.tsx
1401
- var import_jsx_runtime18 = require("react/jsx-runtime");
1373
+ var import_jsx_runtime17 = require("react/jsx-runtime");
1402
1374
  var DecisionRenderer = {
1403
1375
  canRenderType: "decision",
1404
1376
  render: DecisionRendererComponent
1405
1377
  };
1406
1378
  var DecisionRenderer_default = DecisionRenderer;
1407
- function DecisionRendererComponent({ margin, options, title }) {
1408
- const { isLoading } = useLoadingContext();
1409
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: getMargin(margin), children: [
1410
- title && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_components8.Header, { as: "h2", title }),
1411
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_components8.NavigationOptionsList, { children: options.map(({ description, disabled, icon, image, title: itemTitle, onClick }) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1379
+ function DecisionRendererComponent({
1380
+ margin,
1381
+ options,
1382
+ title,
1383
+ stepLoadingState
1384
+ }) {
1385
+ const isLoading = stepLoadingState !== "idle";
1386
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: getMargin(margin), children: [
1387
+ title && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_components8.Header, { as: "h2", title }),
1388
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_components8.NavigationOptionsList, { children: options.map(({ description, disabled, icon, image, title: itemTitle, onClick }) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1412
1389
  import_components8.NavigationOption,
1413
1390
  {
1414
1391
  title: itemTitle,
1415
1392
  content: description,
1416
1393
  disabled: isLoading || disabled,
1417
- media: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(NavigationOptionMedia, { icon, image }),
1394
+ media: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(NavigationOptionMedia, { icon, image }),
1418
1395
  showMediaCircle: false,
1419
1396
  showMediaAtAllSizes: true,
1420
1397
  onClick
@@ -1425,35 +1402,35 @@ function DecisionRendererComponent({ margin, options, title }) {
1425
1402
  }
1426
1403
 
1427
1404
  // ../renderers/src/DividerRenderer.tsx
1428
- var import_jsx_runtime19 = require("react/jsx-runtime");
1405
+ var import_jsx_runtime18 = require("react/jsx-runtime");
1429
1406
  var DividerRenderer = {
1430
1407
  canRenderType: "divider",
1431
- render: ({ margin }) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("hr", { className: `m-t-0 ${getMargin(margin)}` })
1408
+ render: ({ margin }) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("hr", { className: `m-t-0 ${getMargin(margin)}` })
1432
1409
  };
1433
1410
  var DividerRenderer_default = DividerRenderer;
1434
1411
 
1435
1412
  // ../renderers/src/FormRenderer.tsx
1436
- var import_jsx_runtime20 = require("react/jsx-runtime");
1413
+ var import_jsx_runtime19 = require("react/jsx-runtime");
1437
1414
  var FormRenderer = {
1438
1415
  canRenderType: "form",
1439
- render: ({ children, margin }) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: getMargin(margin), children })
1416
+ render: ({ children, margin }) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: getMargin(margin), children })
1440
1417
  };
1441
1418
  var FormRenderer_default = FormRenderer;
1442
1419
 
1443
1420
  // ../renderers/src/FormSectionRenderer.tsx
1444
1421
  var import_components9 = require("@transferwise/components");
1445
- var import_jsx_runtime21 = require("react/jsx-runtime");
1422
+ var import_jsx_runtime20 = require("react/jsx-runtime");
1446
1423
  var FormSectionRenderer = {
1447
1424
  canRenderType: "section",
1448
- render: ({ title, description, children }) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("fieldset", { children: [
1449
- title && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
1425
+ render: ({ title, description, children }) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("fieldset", { children: [
1426
+ title && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1450
1427
  import_components9.Header,
1451
1428
  {
1452
1429
  as: "h2",
1453
1430
  title
1454
1431
  }
1455
1432
  ),
1456
- description && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { children: description }),
1433
+ description && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { children: description }),
1457
1434
  children
1458
1435
  ] })
1459
1436
  };
@@ -1461,32 +1438,32 @@ var FormSectionRenderer_default = FormSectionRenderer;
1461
1438
 
1462
1439
  // ../renderers/src/HeadingRenderer.tsx
1463
1440
  var import_components10 = require("@transferwise/components");
1464
- var import_jsx_runtime22 = require("react/jsx-runtime");
1441
+ var import_jsx_runtime21 = require("react/jsx-runtime");
1465
1442
  var HeadingRenderer = {
1466
1443
  canRenderType: "heading",
1467
- render: (props) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Heading, __spreadValues({}, props))
1444
+ render: (props) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Heading, __spreadValues({}, props))
1468
1445
  };
1469
1446
  function Heading(props) {
1470
1447
  const { text, size: size2, align, margin, control } = props;
1471
1448
  const className = getTextAlignmentAndMargin({ align, margin });
1472
- return control === "display" ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(DisplayHeading, { size: size2, text, className }) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(StandardHeading, { size: size2, text, className });
1449
+ return control === "display" ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DisplayHeading, { size: size2, text, className }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(StandardHeading, { size: size2, text, className });
1473
1450
  }
1474
1451
  function DisplayHeading({ size: size2, text, className }) {
1475
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_components10.Display, { type: getDisplayType(size2), className, children: text });
1452
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_components10.Display, { type: getDisplayType(size2), className, children: text });
1476
1453
  }
1477
1454
  function StandardHeading({ size: size2, text, className }) {
1478
1455
  switch (size2) {
1479
1456
  case "xs":
1480
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h5", { className, children: text });
1457
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h5", { className, children: text });
1481
1458
  case "sm":
1482
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h4", { className, children: text });
1459
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h4", { className, children: text });
1483
1460
  case "lg":
1484
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h2", { className, children: text });
1461
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h2", { className, children: text });
1485
1462
  case "xl":
1486
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h1", { className, children: text });
1463
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h1", { className, children: text });
1487
1464
  case "md":
1488
1465
  default:
1489
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h3", { className, children: text });
1466
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h3", { className, children: text });
1490
1467
  }
1491
1468
  }
1492
1469
  var getDisplayType = (size2) => {
@@ -1506,7 +1483,7 @@ var HeadingRenderer_default = HeadingRenderer;
1506
1483
 
1507
1484
  // ../renderers/src/ImageRenderer.tsx
1508
1485
  var import_components11 = require("@transferwise/components");
1509
- var import_react5 = require("react");
1486
+ var import_react3 = require("react");
1510
1487
 
1511
1488
  // ../renderers/src/utils/api-utils.ts
1512
1489
  function isRelativePath(url = "") {
@@ -1516,10 +1493,10 @@ function isRelativePath(url = "") {
1516
1493
  }
1517
1494
 
1518
1495
  // ../renderers/src/ImageRenderer.tsx
1519
- var import_jsx_runtime23 = require("react/jsx-runtime");
1496
+ var import_jsx_runtime22 = require("react/jsx-runtime");
1520
1497
  var ImageRenderer = {
1521
1498
  canRenderType: "image",
1522
- render: (props) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ImageRendererComponent, __spreadValues({}, props))
1499
+ render: (props) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ImageRendererComponent, __spreadValues({}, props))
1523
1500
  };
1524
1501
  var ImageRenderer_default = ImageRenderer;
1525
1502
  function ImageRendererComponent({
@@ -1527,21 +1504,20 @@ function ImageRendererComponent({
1527
1504
  margin,
1528
1505
  size: size2,
1529
1506
  uri,
1530
- url
1507
+ url,
1508
+ httpClient
1531
1509
  }) {
1532
- const [imageSource, setImageSource] = (0, import_react5.useState)("");
1533
- const httpClient = useRendererHttpClient();
1534
- (0, import_react5.useEffect)(() => {
1510
+ const [imageSource, setImageSource] = (0, import_react3.useState)("");
1511
+ (0, import_react3.useEffect)(() => {
1535
1512
  if (!uri) {
1536
1513
  void getImageSource(httpClient, url).then(setImageSource);
1537
1514
  return;
1538
1515
  }
1539
1516
  if (!uri.startsWith("urn:")) {
1540
1517
  void getImageSource(httpClient, uri).then(setImageSource);
1541
- return;
1542
1518
  }
1543
1519
  }, [uri, url, httpClient]);
1544
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: `df-image ${size2 || "md"}`, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
1520
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: `df-image ${size2 || "md"}`, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
1545
1521
  import_components11.Image,
1546
1522
  {
1547
1523
  className: `img-responsive ${getMargin(margin)}`,
@@ -1586,7 +1562,7 @@ var getImageSource = async (httpClient, imageUrl) => {
1586
1562
 
1587
1563
  // ../renderers/src/InstructionsRenderer.tsx
1588
1564
  var import_components12 = require("@transferwise/components");
1589
- var import_jsx_runtime24 = require("react/jsx-runtime");
1565
+ var import_jsx_runtime23 = require("react/jsx-runtime");
1590
1566
  var doContext = ["positive", "neutral"];
1591
1567
  var dontContext = ["warning", "negative"];
1592
1568
  var InstructionsRenderer = {
@@ -1594,9 +1570,9 @@ var InstructionsRenderer = {
1594
1570
  render: ({ items, margin, title }) => {
1595
1571
  const dos = items.filter((item) => doContext.includes(item.context)).map(({ text }) => text);
1596
1572
  const donts = items.filter((item) => dontContext.includes(item.context)).map(({ text }) => text);
1597
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: getMargin(margin), children: [
1598
- title ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_components12.Header, { title }) : null,
1599
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_components12.InstructionsList, { dos, donts })
1573
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: getMargin(margin), children: [
1574
+ title ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_components12.Header, { title }) : null,
1575
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_components12.InstructionsList, { dos, donts })
1600
1576
  ] });
1601
1577
  }
1602
1578
  };
@@ -1614,11 +1590,11 @@ var onWheel = (event) => {
1614
1590
 
1615
1591
  // ../renderers/src/utils/getIconAvatar.tsx
1616
1592
  var import_components13 = require("@transferwise/components");
1617
- var import_jsx_runtime25 = require("react/jsx-runtime");
1593
+ var import_jsx_runtime24 = require("react/jsx-runtime");
1618
1594
  var size = 24;
1619
1595
  function getIconAvatar({ icon, image }) {
1620
1596
  if (image == null ? void 0 : image.url) {
1621
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
1597
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
1622
1598
  "img",
1623
1599
  {
1624
1600
  src: image.url,
@@ -1629,13 +1605,13 @@ function getIconAvatar({ icon, image }) {
1629
1605
  );
1630
1606
  }
1631
1607
  if (isFlagIcon2(icon)) {
1632
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_components13.Avatar, { type: import_components13.AvatarType.ICON, size, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(DynamicIcon_default, { name: icon.name }) });
1608
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_components13.Avatar, { type: import_components13.AvatarType.ICON, size, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DynamicIcon_default, { name: icon.name }) });
1633
1609
  }
1634
1610
  if (isNamedIcon2(icon)) {
1635
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(DynamicIcon_default, { name: icon.name });
1611
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DynamicIcon_default, { name: icon.name });
1636
1612
  }
1637
1613
  if (icon && "text" in icon) {
1638
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_components13.Avatar, { type: import_components13.AvatarType.ICON, size, children: icon.text });
1614
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_components13.Avatar, { type: import_components13.AvatarType.ICON, size, children: icon.text });
1639
1615
  }
1640
1616
  return null;
1641
1617
  }
@@ -1648,35 +1624,32 @@ var getInputGroupAddonStart = ({ icon, image }) => {
1648
1624
  return content ? { content } : void 0;
1649
1625
  };
1650
1626
 
1627
+ // ../renderers/src/utils/pick.ts
1628
+ function pick(obj, ...keys) {
1629
+ const result = {};
1630
+ keys.forEach((key) => {
1631
+ result[key] = obj[key];
1632
+ });
1633
+ return result;
1634
+ }
1635
+
1651
1636
  // ../renderers/src/IntegerInputRenderer.tsx
1652
- var import_jsx_runtime26 = require("react/jsx-runtime");
1637
+ var import_jsx_runtime25 = require("react/jsx-runtime");
1653
1638
  var IntegerInputRenderer = {
1654
1639
  canRenderType: "input-integer",
1655
1640
  render: (props) => {
1656
- const _a = props, {
1657
- id,
1658
- title,
1659
- description,
1660
- help,
1661
- icon,
1662
- image,
1663
- type,
1664
- validationState,
1665
- value,
1666
- onChange
1667
- } = _a, rest = __objRest(_a, [
1668
- "id",
1669
- "title",
1670
- "description",
1671
- "help",
1672
- "icon",
1673
- "image",
1674
- "type",
1675
- "validationState",
1676
- "value",
1677
- "onChange"
1678
- ]);
1679
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
1641
+ const { id, title, description, help, icon, image, validationState, value, onChange } = props;
1642
+ const commonProps = pick(
1643
+ props,
1644
+ "autoComplete",
1645
+ "disabled",
1646
+ "onBlur",
1647
+ "onFocus",
1648
+ "placeholder",
1649
+ "maximum",
1650
+ "minimum"
1651
+ );
1652
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
1680
1653
  FieldInput_default,
1681
1654
  {
1682
1655
  id,
@@ -1684,7 +1657,7 @@ var IntegerInputRenderer = {
1684
1657
  description,
1685
1658
  validation: validationState,
1686
1659
  help,
1687
- children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_components14.InputGroup, { addonStart: getInputGroupAddonStart({ icon, image }), children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
1660
+ children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_components14.InputGroup, { addonStart: getInputGroupAddonStart({ icon, image }), children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
1688
1661
  import_components14.Input,
1689
1662
  __spreadValues({
1690
1663
  id,
@@ -1698,7 +1671,7 @@ var IntegerInputRenderer = {
1698
1671
  onChange(Number.isNaN(parsedValue) ? null : parsedValue);
1699
1672
  },
1700
1673
  onWheel
1701
- }, rest)
1674
+ }, commonProps)
1702
1675
  ) })
1703
1676
  }
1704
1677
  );
@@ -1708,10 +1681,10 @@ var IntegerInputRenderer_default = IntegerInputRenderer;
1708
1681
 
1709
1682
  // ../renderers/src/LoadingIndicatorRenderer.tsx
1710
1683
  var import_components15 = require("@transferwise/components");
1711
- var import_jsx_runtime27 = require("react/jsx-runtime");
1684
+ var import_jsx_runtime26 = require("react/jsx-runtime");
1712
1685
  var LoadingIndicatorRenderer = {
1713
1686
  canRenderType: "loading-indicator",
1714
- render: ({ margin, size: size2 }) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
1687
+ render: ({ margin, size: size2 }) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
1715
1688
  import_components15.Loader,
1716
1689
  {
1717
1690
  size: size2,
@@ -1724,35 +1697,35 @@ var LoadingIndicatorRenderer_default = LoadingIndicatorRenderer;
1724
1697
 
1725
1698
  // ../renderers/src/MarkdownRenderer.tsx
1726
1699
  var import_components16 = require("@transferwise/components");
1727
- var import_jsx_runtime28 = require("react/jsx-runtime");
1700
+ var import_jsx_runtime27 = require("react/jsx-runtime");
1728
1701
  var MarkdownRenderer = {
1729
1702
  canRenderType: "markdown",
1730
- render: ({ content, align, margin }) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: getTextAlignmentAndMargin({ align, margin }), children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_components16.Markdown, { config: { link: { target: "_blank" } }, children: content }) })
1703
+ render: ({ content, align, margin }) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: getTextAlignmentAndMargin({ align, margin }), children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_components16.Markdown, { config: { link: { target: "_blank" } }, children: content }) })
1731
1704
  };
1732
1705
  var MarkdownRenderer_default = MarkdownRenderer;
1733
1706
 
1734
1707
  // ../renderers/src/ModalRenderer.tsx
1735
1708
  var import_components17 = require("@transferwise/components");
1736
- var import_react6 = require("react");
1737
- var import_jsx_runtime29 = require("react/jsx-runtime");
1709
+ var import_react4 = require("react");
1710
+ var import_jsx_runtime28 = require("react/jsx-runtime");
1738
1711
  var ModalRenderer = {
1739
1712
  canRenderType: "modal",
1740
- render: (props) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(DFModal, __spreadValues({}, props))
1713
+ render: (props) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(DFModal, __spreadValues({}, props))
1741
1714
  };
1742
1715
  var ModalRenderer_default = ModalRenderer;
1743
1716
  function DFModal({ content, margin, trigger }) {
1744
- const [visible, setVisible] = (0, import_react6.useState)(false);
1745
- const { components, title } = content;
1746
- return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: getMargin(margin), children: [
1747
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_components17.Button, { priority: "tertiary", block: true, onClick: () => setVisible(true), children: trigger.title }),
1748
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
1717
+ const [visible, setVisible] = (0, import_react4.useState)(false);
1718
+ const { children, title } = content;
1719
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: getMargin(margin), children: [
1720
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_components17.Button, { priority: "tertiary", block: true, onClick: () => setVisible(true), children: trigger.title }),
1721
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
1749
1722
  import_components17.Modal,
1750
1723
  {
1751
1724
  scroll: "content",
1752
1725
  open: visible,
1753
1726
  size: "lg",
1754
1727
  title,
1755
- body: components,
1728
+ body: children,
1756
1729
  onClose: () => setVisible(false)
1757
1730
  }
1758
1731
  )
@@ -1764,16 +1737,16 @@ var import_components19 = require("@transferwise/components");
1764
1737
 
1765
1738
  // ../renderers/src/SelectInputRenderer/OptionMedia.tsx
1766
1739
  var import_components18 = require("@transferwise/components");
1767
- var import_jsx_runtime30 = require("react/jsx-runtime");
1740
+ var import_jsx_runtime29 = require("react/jsx-runtime");
1768
1741
  function OptionMedia({ icon, image }) {
1769
1742
  if (image == null ? void 0 : image.url) {
1770
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("img", { src: image.url, alt: image.accessibilityDescription || "", width: "64px" });
1743
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("img", { src: image.url, alt: image.accessibilityDescription || "", width: "64px" });
1771
1744
  }
1772
1745
  if (icon && "name" in icon) {
1773
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_components18.Avatar, { type: import_components18.AvatarType.ICON, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(DynamicIcon_default, { name: icon.name }) });
1746
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_components18.Avatar, { type: import_components18.AvatarType.ICON, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(DynamicIcon_default, { name: icon.name }) });
1774
1747
  }
1775
1748
  if (icon && "text" in icon) {
1776
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_components18.Avatar, { type: import_components18.AvatarType.INITIALS, children: icon.text });
1749
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_components18.Avatar, { type: import_components18.AvatarType.INITIALS, children: icon.text });
1777
1750
  }
1778
1751
  return null;
1779
1752
  }
@@ -1792,15 +1765,15 @@ var multi_select_messages_default = (0, import_react_intl3.defineMessages)({
1792
1765
  });
1793
1766
 
1794
1767
  // ../renderers/src/MultiSelectInputRenderer.tsx
1795
- var import_react7 = require("react");
1796
- var import_jsx_runtime31 = require("react/jsx-runtime");
1768
+ var import_react5 = require("react");
1769
+ var import_jsx_runtime30 = require("react/jsx-runtime");
1797
1770
  var MultiSelectInputRenderer = {
1798
1771
  canRenderType: "input-multi-select",
1799
- render: (props) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(MultiSelectInputRendererComponent, __spreadValues({}, props))
1772
+ render: (props) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(MultiSelectInputRendererComponent, __spreadValues({}, props))
1800
1773
  };
1801
1774
  function MultiSelectInputRendererComponent(props) {
1802
1775
  const { formatMessage } = (0, import_react_intl4.useIntl)();
1803
- const [stagedIndices, setStagedIndices] = (0, import_react7.useState)();
1776
+ const [stagedIndices, setStagedIndices] = (0, import_react5.useState)();
1804
1777
  const {
1805
1778
  id,
1806
1779
  autoComplete,
@@ -1838,12 +1811,12 @@ function MultiSelectInputRendererComponent(props) {
1838
1811
  const contentProps = {
1839
1812
  title: option.title,
1840
1813
  description: option.description,
1841
- icon: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(OptionMedia, { icon: option.icon, image: option.image })
1814
+ icon: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(OptionMedia, { icon: option.icon, image: option.image })
1842
1815
  };
1843
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_components19.SelectInputOptionContent, __spreadValues({}, contentProps));
1816
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_components19.SelectInputOptionContent, __spreadValues({}, contentProps));
1844
1817
  };
1845
1818
  const extraProps = { autoComplete };
1846
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
1819
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
1847
1820
  FieldInput_default,
1848
1821
  {
1849
1822
  id,
@@ -1851,7 +1824,7 @@ function MultiSelectInputRendererComponent(props) {
1851
1824
  help,
1852
1825
  description,
1853
1826
  validation: validationState,
1854
- children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
1827
+ children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
1855
1828
  import_components19.SelectInput,
1856
1829
  __spreadValues({
1857
1830
  id,
@@ -1895,7 +1868,7 @@ var import_components21 = require("@transferwise/components");
1895
1868
  // ../renderers/src/components/UploadFieldInput.tsx
1896
1869
  var import_components20 = require("@transferwise/components");
1897
1870
  var import_classnames3 = __toESM(require_classnames());
1898
- var import_jsx_runtime32 = require("react/jsx-runtime");
1871
+ var import_jsx_runtime31 = require("react/jsx-runtime");
1899
1872
  function UploadFieldInput({
1900
1873
  id,
1901
1874
  children,
@@ -1904,18 +1877,18 @@ function UploadFieldInput({
1904
1877
  help,
1905
1878
  validation
1906
1879
  }) {
1907
- const labelContent = label && help ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(LabelContentWithHelp, { text: label, help }) : label;
1880
+ const labelContent = label && help ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(LabelContentWithHelp, { text: label, help }) : label;
1908
1881
  const descriptionId = description ? `${id}-description` : void 0;
1909
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
1882
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
1910
1883
  "div",
1911
1884
  {
1912
1885
  className: (0, import_classnames3.default)("form-group d-block", {
1913
1886
  "has-error": (validation == null ? void 0 : validation.status) === "invalid"
1914
1887
  }),
1915
1888
  children: [
1916
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("label", { htmlFor: id, className: "control-label", children: labelContent }),
1889
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("label", { htmlFor: id, className: "control-label", children: labelContent }),
1917
1890
  children,
1918
- (validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_components20.InlineAlert, { type: "negative", id: descriptionId, children: validation.message })
1891
+ (validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_components20.InlineAlert, { type: "negative", id: descriptionId, children: validation.message })
1919
1892
  ]
1920
1893
  }
1921
1894
  );
@@ -1944,7 +1917,7 @@ var getFileType = (base64Url) => {
1944
1917
  };
1945
1918
 
1946
1919
  // ../renderers/src/MultiUploadInputRenderer.tsx
1947
- var import_jsx_runtime33 = require("react/jsx-runtime");
1920
+ var import_jsx_runtime32 = require("react/jsx-runtime");
1948
1921
  var MultiUploadInputRenderer = {
1949
1922
  canRenderType: "input-upload-multi",
1950
1923
  render: (props) => {
@@ -1969,7 +1942,7 @@ var MultiUploadInputRenderer = {
1969
1942
  };
1970
1943
  const onDeleteFile = async (fileId) => onRemoveFile(value.findIndex((file) => file.id === fileId));
1971
1944
  const descriptionId = description ? `${id}-description` : void 0;
1972
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
1945
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
1973
1946
  UploadFieldInput_default,
1974
1947
  {
1975
1948
  id,
@@ -1977,7 +1950,7 @@ var MultiUploadInputRenderer = {
1977
1950
  description,
1978
1951
  validation: validationState,
1979
1952
  help,
1980
- children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
1953
+ children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
1981
1954
  import_components21.UploadInput,
1982
1955
  {
1983
1956
  id,
@@ -2001,34 +1974,21 @@ var MultiUploadInputRenderer_default = MultiUploadInputRenderer;
2001
1974
 
2002
1975
  // ../renderers/src/NumberInputRenderer.tsx
2003
1976
  var import_components22 = require("@transferwise/components");
2004
- var import_jsx_runtime34 = require("react/jsx-runtime");
1977
+ var import_jsx_runtime33 = require("react/jsx-runtime");
2005
1978
  var NumberInputRenderer = {
2006
1979
  canRenderType: "input-number",
2007
1980
  render: (props) => {
2008
- const _a = props, {
2009
- id,
2010
- title,
2011
- description,
2012
- help,
2013
- icon,
2014
- image,
2015
- type,
2016
- validationState,
2017
- value,
2018
- onChange
2019
- } = _a, rest = __objRest(_a, [
2020
- "id",
2021
- "title",
2022
- "description",
2023
- "help",
2024
- "icon",
2025
- "image",
2026
- "type",
2027
- "validationState",
2028
- "value",
2029
- "onChange"
2030
- ]);
2031
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
1981
+ const { id, title, description, help, icon, image, validationState, value, onChange } = props;
1982
+ const commonProps = pick(
1983
+ props,
1984
+ "disabled",
1985
+ "onBlur",
1986
+ "onFocus",
1987
+ "placeholder",
1988
+ "maximum",
1989
+ "minimum"
1990
+ );
1991
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
2032
1992
  FieldInput_default,
2033
1993
  {
2034
1994
  id,
@@ -2036,7 +1996,7 @@ var NumberInputRenderer = {
2036
1996
  description,
2037
1997
  validation: validationState,
2038
1998
  help,
2039
- children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_components22.InputGroup, { addonStart: getInputGroupAddonStart({ icon, image }), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
1999
+ children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_components22.InputGroup, { addonStart: getInputGroupAddonStart({ icon, image }), children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
2040
2000
  import_components22.Input,
2041
2001
  __spreadValues({
2042
2002
  id,
@@ -2048,7 +2008,7 @@ var NumberInputRenderer = {
2048
2008
  onChange(Number.isNaN(parsedValue) ? null : parsedValue);
2049
2009
  },
2050
2010
  onWheel
2051
- }, rest)
2011
+ }, commonProps)
2052
2012
  ) })
2053
2013
  }
2054
2014
  );
@@ -2061,9 +2021,9 @@ var import_react_intl6 = require("react-intl");
2061
2021
 
2062
2022
  // ../renderers/src/hooks/useSnackBarIfAvailable.ts
2063
2023
  var import_components23 = require("@transferwise/components");
2064
- var import_react8 = require("react");
2024
+ var import_react6 = require("react");
2065
2025
  function useSnackBarIfAvailable() {
2066
- const context = (0, import_react8.useContext)(import_components23.SnackbarContext);
2026
+ const context = (0, import_react6.useContext)(import_components23.SnackbarContext);
2067
2027
  return context ? context.createSnackbar : () => {
2068
2028
  };
2069
2029
  }
@@ -2088,17 +2048,17 @@ var paragraph_messages_default = (0, import_react_intl5.defineMessages)({
2088
2048
  });
2089
2049
 
2090
2050
  // ../renderers/src/ParagraphRenderer.tsx
2091
- var import_jsx_runtime35 = require("react/jsx-runtime");
2051
+ var import_jsx_runtime34 = require("react/jsx-runtime");
2092
2052
  var ParagraphRenderer = {
2093
2053
  canRenderType: "paragraph",
2094
- render: (props) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Paragraph, __spreadValues({}, props))
2054
+ render: (props) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Paragraph, __spreadValues({}, props))
2095
2055
  };
2096
2056
  function Paragraph({ align, control, margin, text }) {
2097
2057
  const className = getTextAlignmentAndMargin({ align, margin });
2098
- return control === "copyable" ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(CopyableParagraph, { className, align, text }) : /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(StandardParagraph, { className, text });
2058
+ return control === "copyable" ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(CopyableParagraph, { className, align, text }) : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(StandardParagraph, { className, text });
2099
2059
  }
2100
2060
  function StandardParagraph({ text, className }) {
2101
- return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: `np-text-body-large ${className}`, children: text });
2061
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: `np-text-body-large ${className}`, children: text });
2102
2062
  }
2103
2063
  function CopyableParagraph({
2104
2064
  text,
@@ -2112,8 +2072,8 @@ function CopyableParagraph({
2112
2072
  });
2113
2073
  };
2114
2074
  const inputAlignmentClasses = getTextAlignmentAndMargin({ align, margin: "sm" });
2115
- return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className, children: [
2116
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
2075
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className, children: [
2076
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
2117
2077
  import_components24.Input,
2118
2078
  {
2119
2079
  type: "text",
@@ -2122,14 +2082,14 @@ function CopyableParagraph({
2122
2082
  className: (0, import_classnames4.default)("text-ellipsis", inputAlignmentClasses)
2123
2083
  }
2124
2084
  ),
2125
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_components24.Button, { block: true, onClick: copy, children: formatMessage(paragraph_messages_default.copy) })
2085
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_components24.Button, { block: true, onClick: copy, children: formatMessage(paragraph_messages_default.copy) })
2126
2086
  ] });
2127
2087
  }
2128
2088
  var ParagraphRenderer_default = ParagraphRenderer;
2129
2089
 
2130
2090
  // ../renderers/src/RepeatableRenderer.tsx
2131
2091
  var import_components25 = require("@transferwise/components");
2132
- var import_react9 = require("react");
2092
+ var import_react7 = require("react");
2133
2093
  var import_icons = require("@transferwise/icons");
2134
2094
  var import_react_intl8 = require("react-intl");
2135
2095
 
@@ -2160,10 +2120,10 @@ var repeatable_messages_default = (0, import_react_intl7.defineMessages)({
2160
2120
 
2161
2121
  // ../renderers/src/RepeatableRenderer.tsx
2162
2122
  var import_classnames5 = __toESM(require_classnames());
2163
- var import_jsx_runtime36 = require("react/jsx-runtime");
2123
+ var import_jsx_runtime35 = require("react/jsx-runtime");
2164
2124
  var RepeatableRenderer = {
2165
2125
  canRenderType: "repeatable",
2166
- render: (props) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Repeatable, __spreadValues({}, props))
2126
+ render: (props) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Repeatable, __spreadValues({}, props))
2167
2127
  };
2168
2128
  function Repeatable(props) {
2169
2129
  const {
@@ -2180,7 +2140,7 @@ function Repeatable(props) {
2180
2140
  onRemove
2181
2141
  } = props;
2182
2142
  const { formatMessage } = (0, import_react_intl8.useIntl)();
2183
- const [openModalType, setOpenModalType] = (0, import_react9.useState)(null);
2143
+ const [openModalType, setOpenModalType] = (0, import_react7.useState)(null);
2184
2144
  const onAddItem = () => {
2185
2145
  onAdd();
2186
2146
  setOpenModalType("add");
@@ -2202,40 +2162,40 @@ function Repeatable(props) {
2202
2162
  const onCancelEdit = () => {
2203
2163
  setOpenModalType(null);
2204
2164
  };
2205
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
2206
- title && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_components25.Header, { title }),
2207
- description && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { children: description }),
2208
- /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
2165
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
2166
+ title && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_components25.Header, { title }),
2167
+ description && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { children: description }),
2168
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
2209
2169
  "div",
2210
2170
  {
2211
2171
  className: (0, import_classnames5.default)("form-group", {
2212
2172
  "has-error": (validationState == null ? void 0 : validationState.status) === "invalid"
2213
2173
  }),
2214
2174
  children: [
2215
- items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ItemSummaryOption, { item, onClick: () => onEditItem(index) }, item.id)),
2216
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
2175
+ items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ItemSummaryOption, { item, onClick: () => onEditItem(index) }, item.id)),
2176
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
2217
2177
  import_components25.NavigationOption,
2218
2178
  {
2219
- media: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_icons.Plus, {}),
2179
+ media: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons.Plus, {}),
2220
2180
  title: addItemTitle || formatMessage(repeatable_messages_default.addItemTitle),
2221
2181
  showMediaAtAllSizes: true,
2222
2182
  onClick: () => onAddItem()
2223
2183
  }
2224
2184
  ),
2225
- (validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_components25.InlineAlert, { type: "negative", children: validationState.message })
2185
+ (validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_components25.InlineAlert, { type: "negative", children: validationState.message })
2226
2186
  ]
2227
2187
  }
2228
2188
  ),
2229
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
2189
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
2230
2190
  import_components25.Modal,
2231
2191
  {
2232
2192
  open: openModalType !== null,
2233
2193
  title: (openModalType === "add" ? addItemTitle : editItemTitle) || formatMessage(repeatable_messages_default.addItemTitle),
2234
- body: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
2235
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "m-b-2", children: editableItem }),
2236
- /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { children: [
2237
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_components25.Button, { priority: "primary", block: true, className: "m-b-2", onClick: () => onSaveItem(), children: formatMessage(repeatable_messages_default.addItem) }),
2238
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_components25.Button, { priority: "secondary", type: "negative", block: true, onClick: () => onRemoveItem(), children: formatMessage(repeatable_messages_default.removeItem) })
2194
+ body: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
2195
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "m-b-2", children: editableItem }),
2196
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { children: [
2197
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_components25.Button, { priority: "primary", block: true, className: "m-b-2", onClick: () => onSaveItem(), children: formatMessage(repeatable_messages_default.addItem) }),
2198
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_components25.Button, { priority: "secondary", type: "negative", block: true, onClick: () => onRemoveItem(), children: formatMessage(repeatable_messages_default.removeItem) })
2239
2199
  ] })
2240
2200
  ] }),
2241
2201
  onClose: () => onCancelEdit()
@@ -2247,10 +2207,10 @@ function ItemSummaryOption({
2247
2207
  item,
2248
2208
  onClick
2249
2209
  }) {
2250
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
2210
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
2251
2211
  import_components25.NavigationOption,
2252
2212
  {
2253
- media: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(NavigationOptionMedia, __spreadValues({}, item)),
2213
+ media: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(NavigationOptionMedia, __spreadValues({}, item)),
2254
2214
  title: item.title,
2255
2215
  content: item.description,
2256
2216
  showMediaAtAllSizes: true,
@@ -2262,13 +2222,25 @@ var RepeatableRenderer_default = RepeatableRenderer;
2262
2222
 
2263
2223
  // ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
2264
2224
  var import_components27 = require("@transferwise/components");
2225
+ var import_react8 = require("react");
2226
+ var import_react_intl12 = require("react-intl");
2227
+
2228
+ // ../renderers/src/messages/search.messages.ts
2229
+ var import_react_intl9 = require("react-intl");
2230
+ var search_messages_default = (0, import_react_intl9.defineMessages)({
2231
+ loading: {
2232
+ id: "df.wise.SearchLayout.loading",
2233
+ defaultMessage: "Loading...",
2234
+ description: "A message shown to the user while their search is being processed, before results appear."
2235
+ }
2236
+ });
2265
2237
 
2266
2238
  // ../renderers/src/SearchRenderer/ErrorResult.tsx
2267
- var import_react_intl10 = require("react-intl");
2239
+ var import_react_intl11 = require("react-intl");
2268
2240
 
2269
2241
  // ../renderers/src/messages/generic-error.messages.ts
2270
- var import_react_intl9 = require("react-intl");
2271
- var generic_error_messages_default = (0, import_react_intl9.defineMessages)({
2242
+ var import_react_intl10 = require("react-intl");
2243
+ var generic_error_messages_default = (0, import_react_intl10.defineMessages)({
2272
2244
  genericErrorRetryHint: {
2273
2245
  id: "df.wise.PersistAsyncSchema.genericError",
2274
2246
  defaultMessage: "Something went wrong, please try again.",
@@ -2288,18 +2260,18 @@ var generic_error_messages_default = (0, import_react_intl9.defineMessages)({
2288
2260
 
2289
2261
  // ../renderers/src/SearchRenderer/ErrorResult.tsx
2290
2262
  var import_components26 = require("@transferwise/components");
2291
- var import_jsx_runtime37 = require("react/jsx-runtime");
2263
+ var import_jsx_runtime36 = require("react/jsx-runtime");
2292
2264
  function ErrorResult({ state }) {
2293
- const intl = (0, import_react_intl10.useIntl)();
2265
+ const intl = (0, import_react_intl11.useIntl)();
2294
2266
  const buttonVisualProps = {
2295
2267
  priority: "tertiary",
2296
2268
  size: "sm",
2297
2269
  style: { marginTop: "-2px", padding: "0", width: "auto", display: "inline" }
2298
2270
  };
2299
- return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("p", { className: "m-t-2", children: [
2271
+ return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("p", { className: "m-t-2", children: [
2300
2272
  intl.formatMessage(generic_error_messages_default.genericError),
2301
2273
  "\xA0",
2302
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
2274
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
2303
2275
  import_components26.Button,
2304
2276
  __spreadProps(__spreadValues({}, buttonVisualProps), {
2305
2277
  onClick: () => {
@@ -2312,35 +2284,21 @@ function ErrorResult({ state }) {
2312
2284
  }
2313
2285
 
2314
2286
  // ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
2315
- var import_react10 = require("react");
2316
-
2317
- // ../renderers/src/messages/search.messages.ts
2318
- var import_react_intl11 = require("react-intl");
2319
- var search_messages_default = (0, import_react_intl11.defineMessages)({
2320
- loading: {
2321
- id: "df.wise.SearchLayout.loading",
2322
- defaultMessage: "Loading...",
2323
- description: "A message shown to the user while their search is being processed, before results appear."
2324
- }
2325
- });
2326
-
2327
- // ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
2328
- var import_react_intl12 = require("react-intl");
2329
- var import_jsx_runtime38 = require("react/jsx-runtime");
2287
+ var import_jsx_runtime37 = require("react/jsx-runtime");
2330
2288
  function BlockSearchRendererComponent({
2331
2289
  id,
2332
2290
  isLoading,
2333
2291
  margin,
2334
- onChange,
2335
2292
  query,
2336
2293
  state,
2337
- title
2294
+ title,
2295
+ trackEvent,
2296
+ onChange
2338
2297
  }) {
2339
- const [hasSearched, setHasSearched] = (0, import_react10.useState)(false);
2340
- const trackEvent = useTrackEvent();
2298
+ const [hasSearched, setHasSearched] = (0, import_react8.useState)(false);
2341
2299
  const { formatMessage } = (0, import_react_intl12.useIntl)();
2342
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: getMargin(margin), children: [
2343
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(FieldInput_default, { id, description: "", validation: void 0, help: "", label: title, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
2300
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: getMargin(margin), children: [
2301
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(FieldInput_default, { id, description: "", validation: void 0, help: "", label: title, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
2344
2302
  import_components27.Input,
2345
2303
  {
2346
2304
  id,
@@ -2357,35 +2315,35 @@ function BlockSearchRendererComponent({
2357
2315
  }
2358
2316
  }
2359
2317
  ) }),
2360
- isLoading ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_jsx_runtime38.Fragment, { children: formatMessage(search_messages_default.loading) }) : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(SearchResultContent, { state, onChange })
2318
+ isLoading ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_jsx_runtime37.Fragment, { children: formatMessage(search_messages_default.loading) }) : /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(SearchResultContent, { state, trackEvent })
2361
2319
  ] });
2362
2320
  }
2363
2321
  function SearchResultContent({
2364
2322
  state,
2365
- onChange
2323
+ trackEvent
2366
2324
  }) {
2367
2325
  switch (state.type) {
2368
2326
  case "error":
2369
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ErrorResult, { state });
2327
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ErrorResult, { state });
2370
2328
  case "results":
2371
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(SearchResults, { state, onChange });
2329
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(SearchResults, { state, trackEvent });
2372
2330
  case "noResults":
2373
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(EmptySearchResult, { state });
2331
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(EmptySearchResult, { state });
2374
2332
  case "pending":
2375
2333
  default:
2376
2334
  return null;
2377
2335
  }
2378
2336
  }
2379
2337
  function EmptySearchResult({ state }) {
2380
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_components27.Markdown, { className: "m-t-2", config: { link: { target: "_blank" } }, children: state.message });
2338
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_components27.Markdown, { className: "m-t-2", config: { link: { target: "_blank" } }, children: state.message });
2381
2339
  }
2382
2340
  function SearchResults({
2383
- state
2341
+ state,
2342
+ trackEvent
2384
2343
  }) {
2385
- const trackEvent = useTrackEvent();
2386
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_components27.NavigationOptionsList, { children: state.results.map((result) => {
2344
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_components27.NavigationOptionsList, { children: state.results.map((result) => {
2387
2345
  const { icon, image } = result;
2388
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
2346
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
2389
2347
  import_components27.NavigationOption,
2390
2348
  {
2391
2349
  title: result.title,
@@ -2409,21 +2367,21 @@ var BlockSearchRendererComponent_default = BlockSearchRendererComponent;
2409
2367
  // ../renderers/src/SearchRenderer/InlineSearchRendererComponent.tsx
2410
2368
  var import_components28 = require("@transferwise/components");
2411
2369
  var import_icons2 = require("@transferwise/icons");
2412
- var import_react11 = require("react");
2370
+ var import_react9 = require("react");
2413
2371
  var import_react_intl13 = require("react-intl");
2414
- var import_jsx_runtime39 = require("react/jsx-runtime");
2372
+ var import_jsx_runtime38 = require("react/jsx-runtime");
2415
2373
  function InlineSearchRenderer({
2416
2374
  id,
2417
2375
  isLoading,
2418
2376
  margin,
2419
2377
  onChange,
2420
2378
  state,
2421
- title
2379
+ title,
2380
+ trackEvent
2422
2381
  }) {
2423
- const [hasSearched, setHasSearched] = (0, import_react11.useState)(false);
2424
- const trackEvent = useTrackEvent();
2382
+ const [hasSearched, setHasSearched] = (0, import_react9.useState)(false);
2425
2383
  const intl = (0, import_react_intl13.useIntl)();
2426
- return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: getMargin(margin), children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(FieldInput_default, { id, description: "", validation: void 0, help: "", label: title, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
2384
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: getMargin(margin), children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(FieldInput_default, { id, description: "", validation: void 0, help: "", label: title, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
2427
2385
  import_components28.Typeahead,
2428
2386
  {
2429
2387
  id: "typeahead-input-id",
@@ -2431,10 +2389,10 @@ function InlineSearchRenderer({
2431
2389
  name: "typeahead-input-name",
2432
2390
  size: "md",
2433
2391
  maxHeight: 100,
2434
- footer: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TypeaheadFooter, { state, isLoading }),
2392
+ footer: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(TypeaheadFooter, { state, isLoading }),
2435
2393
  multiple: false,
2436
2394
  clearable: false,
2437
- addon: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_icons2.Search, { size: 24 }),
2395
+ addon: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_icons2.Search, { size: 24 }),
2438
2396
  options: state.type === "results" ? state.results.map(mapResultToTypeaheadOption) : [],
2439
2397
  minQueryLength: 1,
2440
2398
  onChange: (values) => {
@@ -2471,29 +2429,29 @@ function mapResultToTypeaheadOption(result) {
2471
2429
  function TypeaheadFooter({ state, isLoading }) {
2472
2430
  const { formatMessage } = (0, import_react_intl13.useIntl)();
2473
2431
  if (state.type === "noResults") {
2474
- return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_components28.Markdown, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: state.message });
2432
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_components28.Markdown, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: state.message });
2475
2433
  }
2476
2434
  if (state.type === "error") {
2477
- return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ErrorResult, { state }) });
2435
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ErrorResult, { state }) });
2478
2436
  }
2479
2437
  if (state.type === "pending" || isLoading) {
2480
- return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("p", { className: "m-t-2 m-x-2", children: formatMessage(search_messages_default.loading) });
2438
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: "m-t-2 m-x-2", children: formatMessage(search_messages_default.loading) });
2481
2439
  }
2482
2440
  return null;
2483
2441
  }
2484
2442
  var InlineSearchRendererComponent_default = InlineSearchRenderer;
2485
2443
 
2486
2444
  // ../renderers/src/SearchRenderer/SearchRenderer.tsx
2487
- var import_jsx_runtime40 = require("react/jsx-runtime");
2445
+ var import_jsx_runtime39 = require("react/jsx-runtime");
2488
2446
  var SearchRenderer = {
2489
2447
  canRenderType: "search",
2490
- render: (props) => props.control === "inline" ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(InlineSearchRendererComponent_default, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(BlockSearchRendererComponent_default, __spreadValues({}, props))
2448
+ render: (props) => props.control === "inline" ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(InlineSearchRendererComponent_default, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(BlockSearchRendererComponent_default, __spreadValues({}, props))
2491
2449
  };
2492
2450
  var SearchRenderer_default = SearchRenderer;
2493
2451
 
2494
2452
  // ../renderers/src/SelectInputRenderer/RadioInputRendererComponent.tsx
2495
2453
  var import_components29 = require("@transferwise/components");
2496
- var import_jsx_runtime41 = require("react/jsx-runtime");
2454
+ var import_jsx_runtime40 = require("react/jsx-runtime");
2497
2455
  function RadioInputRendererComponent(props) {
2498
2456
  const {
2499
2457
  id,
@@ -2507,8 +2465,8 @@ function RadioInputRendererComponent(props) {
2507
2465
  validationState,
2508
2466
  onSelect
2509
2467
  } = props;
2510
- return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_jsx_runtime41.Fragment, { children: [
2511
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
2468
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
2469
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
2512
2470
  FieldInput_default,
2513
2471
  {
2514
2472
  id,
@@ -2516,7 +2474,7 @@ function RadioInputRendererComponent(props) {
2516
2474
  help,
2517
2475
  description,
2518
2476
  validation: validationState,
2519
- children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
2477
+ children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
2520
2478
  import_components29.RadioGroup,
2521
2479
  {
2522
2480
  name: id,
@@ -2525,7 +2483,7 @@ function RadioInputRendererComponent(props) {
2525
2483
  value: index,
2526
2484
  secondary: option.description,
2527
2485
  disabled: option.disabled || disabled,
2528
- avatar: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(OptionMedia, { icon: option.icon, image: option.image })
2486
+ avatar: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(OptionMedia, { icon: option.icon, image: option.image })
2529
2487
  })),
2530
2488
  selectedValue: selectedIndex != null ? selectedIndex : void 0,
2531
2489
  onChange: onSelect
@@ -2540,8 +2498,8 @@ function RadioInputRendererComponent(props) {
2540
2498
 
2541
2499
  // ../renderers/src/SelectInputRenderer/TabInputRendererComponent.tsx
2542
2500
  var import_components30 = require("@transferwise/components");
2543
- var import_react12 = require("react");
2544
- var import_jsx_runtime42 = require("react/jsx-runtime");
2501
+ var import_react10 = require("react");
2502
+ var import_jsx_runtime41 = require("react/jsx-runtime");
2545
2503
  function TabInputRendererComponent(props) {
2546
2504
  const {
2547
2505
  id,
@@ -2555,13 +2513,13 @@ function TabInputRendererComponent(props) {
2555
2513
  validationState,
2556
2514
  onSelect
2557
2515
  } = props;
2558
- (0, import_react12.useEffect)(() => {
2516
+ (0, import_react10.useEffect)(() => {
2559
2517
  if (!isValidIndex(selectedIndex, options.length)) {
2560
2518
  onSelect(0);
2561
2519
  }
2562
2520
  }, [selectedIndex, onSelect, options.length]);
2563
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_jsx_runtime42.Fragment, { children: [
2564
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
2521
+ return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_jsx_runtime41.Fragment, { children: [
2522
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
2565
2523
  FieldInput_default,
2566
2524
  {
2567
2525
  id,
@@ -2569,7 +2527,7 @@ function TabInputRendererComponent(props) {
2569
2527
  help,
2570
2528
  description,
2571
2529
  validation: validationState,
2572
- children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
2530
+ children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
2573
2531
  import_components30.Tabs,
2574
2532
  {
2575
2533
  name: id,
@@ -2578,7 +2536,7 @@ function TabInputRendererComponent(props) {
2578
2536
  title: option.title,
2579
2537
  // if we pass null, we get some props-types console errors
2580
2538
  // eslint-disable-next-line react/jsx-no-useless-fragment
2581
- content: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_jsx_runtime42.Fragment, {}),
2539
+ content: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_jsx_runtime41.Fragment, {}),
2582
2540
  disabled: option.disabled || disabled
2583
2541
  })),
2584
2542
  onTabSelect: onSelect
@@ -2593,7 +2551,7 @@ var isValidIndex = (index, options) => index !== null && index >= 0 && index < o
2593
2551
 
2594
2552
  // ../renderers/src/SelectInputRenderer/SelectInputRendererComponent.tsx
2595
2553
  var import_components31 = require("@transferwise/components");
2596
- var import_jsx_runtime43 = require("react/jsx-runtime");
2554
+ var import_jsx_runtime42 = require("react/jsx-runtime");
2597
2555
  function SelectInputRendererComponent(props) {
2598
2556
  const {
2599
2557
  id,
@@ -2633,13 +2591,13 @@ function SelectInputRendererComponent(props) {
2633
2591
  } : {
2634
2592
  title: option.title,
2635
2593
  description: option.description,
2636
- icon: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(OptionMedia, { icon: option.icon, image: option.image })
2594
+ icon: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(OptionMedia, { icon: option.icon, image: option.image })
2637
2595
  };
2638
- return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_components31.SelectInputOptionContent, __spreadValues({}, contentProps));
2596
+ return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_components31.SelectInputOptionContent, __spreadValues({}, contentProps));
2639
2597
  };
2640
2598
  const extraProps = { autoComplete };
2641
- return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_jsx_runtime43.Fragment, { children: [
2642
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
2599
+ return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_jsx_runtime42.Fragment, { children: [
2600
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
2643
2601
  FieldInput_default,
2644
2602
  {
2645
2603
  id,
@@ -2647,7 +2605,7 @@ function SelectInputRendererComponent(props) {
2647
2605
  help,
2648
2606
  description,
2649
2607
  validation: validationState,
2650
- children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
2608
+ children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
2651
2609
  import_components31.SelectInput,
2652
2610
  __spreadValues({
2653
2611
  name: id,
@@ -2668,9 +2626,9 @@ function SelectInputRendererComponent(props) {
2668
2626
  }
2669
2627
 
2670
2628
  // ../renderers/src/SelectInputRenderer/SegmentedInputRendererComponent.tsx
2671
- var import_react13 = require("react");
2629
+ var import_react11 = require("react");
2672
2630
  var import_components32 = require("@transferwise/components");
2673
- var import_jsx_runtime44 = require("react/jsx-runtime");
2631
+ var import_jsx_runtime43 = require("react/jsx-runtime");
2674
2632
  function SegmentedInputRendererComponent(props) {
2675
2633
  const {
2676
2634
  id,
@@ -2683,13 +2641,13 @@ function SegmentedInputRendererComponent(props) {
2683
2641
  validationState,
2684
2642
  onSelect
2685
2643
  } = props;
2686
- (0, import_react13.useEffect)(() => {
2644
+ (0, import_react11.useEffect)(() => {
2687
2645
  if (!isValidIndex2(selectedIndex, options.length)) {
2688
2646
  onSelect(0);
2689
2647
  }
2690
2648
  }, [selectedIndex, onSelect, options.length]);
2691
- return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_jsx_runtime44.Fragment, { children: [
2692
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
2649
+ return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_jsx_runtime43.Fragment, { children: [
2650
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
2693
2651
  FieldInput_default,
2694
2652
  {
2695
2653
  id,
@@ -2697,7 +2655,7 @@ function SegmentedInputRendererComponent(props) {
2697
2655
  help,
2698
2656
  description,
2699
2657
  validation: validationState,
2700
- children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
2658
+ children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
2701
2659
  import_components32.SegmentedControl,
2702
2660
  {
2703
2661
  name: `${id}-segmented-control`,
@@ -2714,26 +2672,26 @@ function SegmentedInputRendererComponent(props) {
2714
2672
  )
2715
2673
  }
2716
2674
  ),
2717
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { id: `${id}-children`, children })
2675
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { id: `${id}-children`, children })
2718
2676
  ] });
2719
2677
  }
2720
2678
  var isValidIndex2 = (index, options) => index !== null && index >= 0 && index < options;
2721
2679
 
2722
2680
  // ../renderers/src/SelectInputRenderer/SelectInputRenderer.tsx
2723
- var import_jsx_runtime45 = require("react/jsx-runtime");
2681
+ var import_jsx_runtime44 = require("react/jsx-runtime");
2724
2682
  var SelectInputRenderer = {
2725
2683
  canRenderType: "input-select",
2726
2684
  render: (props) => {
2727
2685
  switch (props.control) {
2728
2686
  case "radio":
2729
- return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(RadioInputRendererComponent, __spreadValues({}, props));
2687
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(RadioInputRendererComponent, __spreadValues({}, props));
2730
2688
  case "tab":
2731
- return props.options.length > 3 ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(TabInputRendererComponent, __spreadValues({}, props));
2689
+ return props.options.length > 3 ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(TabInputRendererComponent, __spreadValues({}, props));
2732
2690
  case "segmented":
2733
- return props.options.length > 3 ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(SegmentedInputRendererComponent, __spreadValues({}, props));
2691
+ return props.options.length > 3 ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(SegmentedInputRendererComponent, __spreadValues({}, props));
2734
2692
  case "select":
2735
2693
  default:
2736
- return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(SelectInputRendererComponent, __spreadValues({}, props));
2694
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(SelectInputRendererComponent, __spreadValues({}, props));
2737
2695
  }
2738
2696
  }
2739
2697
  };
@@ -2741,17 +2699,17 @@ var SelectInputRenderer_default = SelectInputRenderer;
2741
2699
 
2742
2700
  // ../renderers/src/StatusListRenderer.tsx
2743
2701
  var import_components33 = require("@transferwise/components");
2744
- var import_jsx_runtime46 = require("react/jsx-runtime");
2702
+ var import_jsx_runtime45 = require("react/jsx-runtime");
2745
2703
  var StatusListRenderer = {
2746
2704
  canRenderType: "status-list",
2747
- render: ({ margin, items, title }) => /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: getMargin(margin), children: [
2748
- title ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_components33.Header, { title, className: "m-b-2" }) : null,
2749
- items.map(({ callToAction, description, icon, status, title: itemTitle }) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
2705
+ render: ({ margin, items, title }) => /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: getMargin(margin), children: [
2706
+ title ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_components33.Header, { title, className: "m-b-2" }) : null,
2707
+ items.map(({ callToAction, description, icon, status, title: itemTitle }) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
2750
2708
  import_components33.Summary,
2751
2709
  {
2752
2710
  title: itemTitle,
2753
2711
  description,
2754
- icon: icon && "name" in icon ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(DynamicIcon_default, { name: icon.name }) : null,
2712
+ icon: icon && "name" in icon ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(DynamicIcon_default, { name: icon.name }) : null,
2755
2713
  status: mapStatus(status),
2756
2714
  action: getSummaryAction(callToAction)
2757
2715
  },
@@ -2791,105 +2749,73 @@ var import_components35 = require("@transferwise/components");
2791
2749
 
2792
2750
  // ../renderers/src/components/VariableTextInput.tsx
2793
2751
  var import_components34 = require("@transferwise/components");
2794
- var import_jsx_runtime47 = require("react/jsx-runtime");
2795
- function VariableTextInput({
2796
- control,
2797
- inputProps
2798
- }) {
2752
+ var import_jsx_runtime46 = require("react/jsx-runtime");
2753
+ var commonKeys = [
2754
+ "autoComplete",
2755
+ "autoCapitalize",
2756
+ "placeholder",
2757
+ "control",
2758
+ "disabled",
2759
+ "displayFormat",
2760
+ "id",
2761
+ "onBlur",
2762
+ "onFocus",
2763
+ "placeholder",
2764
+ "value"
2765
+ ];
2766
+ function VariableTextInput(inputProps) {
2767
+ const { id, value, control, onChange } = inputProps;
2768
+ const commonProps = __spreadProps(__spreadValues({}, pick(inputProps, ...commonKeys)), { name: id });
2799
2769
  switch (control) {
2800
- case "password":
2801
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TextInput, __spreadValues({ type: "password" }, inputProps));
2802
2770
  case "email":
2803
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TextInput, __spreadValues({ type: "email" }, inputProps));
2804
- case "textarea":
2805
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TextAreaInput, __spreadValues({}, inputProps));
2806
- case "numeric":
2807
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(NumericInput, __spreadValues({ type: "number" }, inputProps));
2771
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "email", onChange }));
2772
+ case "password":
2773
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "password", onChange }));
2774
+ case "numeric": {
2775
+ const numericProps = __spreadProps(__spreadValues({}, commonProps), { type: "number", onWheel });
2776
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
2777
+ TextInput,
2778
+ __spreadProps(__spreadValues({}, numericProps), {
2779
+ onChange: (newValue) => onChange(numericValueOrNull(newValue))
2780
+ })
2781
+ );
2782
+ }
2808
2783
  case "phone-number":
2809
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(PhoneNumberInput, __spreadValues({}, inputProps));
2810
- default:
2811
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TextInput, __spreadValues({ type: "text" }, inputProps));
2812
- }
2813
- }
2814
- function TextInput(_a) {
2815
- var _b = _a, { id, displayFormat, onChange } = _b, rest = __objRest(_b, ["id", "displayFormat", "onChange"]);
2816
- if (typeof displayFormat === "string") {
2817
- const inputProps = __spreadValues({ id, name: id, className: "form-control" }, rest);
2818
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
2819
- import_components34.InputWithDisplayFormat,
2820
- __spreadValues({
2821
- displayPattern: displayFormat,
2822
- onChange: (newValue) => onChange(newValue)
2823
- }, inputProps)
2824
- );
2784
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_components34.PhoneNumberInput, __spreadProps(__spreadValues({ initialValue: value }, commonProps), { onChange }));
2785
+ default: {
2786
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "text", onChange }));
2787
+ }
2825
2788
  }
2826
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_components34.Input, __spreadValues({ id, name: id, onChange: (e) => onChange(e.target.value) }, rest));
2827
- }
2828
- function TextAreaInput(_a) {
2829
- var _b = _a, { id, displayFormat, onChange } = _b, rest = __objRest(_b, ["id", "displayFormat", "onChange"]);
2830
- const textAreaProps = __spreadValues({ id, name: id }, rest);
2831
- return typeof displayFormat === "string" ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
2832
- import_components34.TextareaWithDisplayFormat,
2833
- __spreadValues({
2834
- displayPattern: displayFormat,
2835
- onChange: (newValue) => onChange(newValue)
2836
- }, textAreaProps)
2837
- ) : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_components34.TextArea, __spreadValues({ onChange: (e) => onChange(e.target.value) }, textAreaProps));
2838
- }
2839
- function NumericInput(_a) {
2840
- var _b = _a, { id, displayFormat, onChange } = _b, rest = __objRest(_b, ["id", "displayFormat", "onChange"]);
2841
- const numericProps = __spreadValues({ id, name: id, onWheel }, rest);
2842
- return typeof displayFormat === "string" ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
2843
- import_components34.InputWithDisplayFormat,
2844
- __spreadValues({
2845
- displayPattern: displayFormat,
2846
- onChange: (newValue) => onChange(numericValueOrNull(newValue))
2847
- }, numericProps)
2848
- ) : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
2849
- import_components34.Input,
2850
- __spreadValues({
2851
- onChange: ({ target: { value: newValue } }) => onChange(numericValueOrNull(newValue))
2852
- }, numericProps)
2853
- );
2854
2789
  }
2855
- function PhoneNumberInput(_a) {
2856
- var _b = _a, { value } = _b, rest = __objRest(_b, ["value"]);
2857
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_components34.PhoneNumberInput, __spreadValues({ initialValue: value }, rest));
2790
+ function TextInput(props) {
2791
+ const _a = props, { control, displayFormat, onChange } = _a, commonProps = __objRest(_a, ["control", "displayFormat", "onChange"]);
2792
+ const InputWithPattern = control === "textarea" ? import_components34.TextareaWithDisplayFormat : import_components34.InputWithDisplayFormat;
2793
+ const InputWithoutPattern = control === "textarea" ? import_components34.TextArea : import_components34.Input;
2794
+ return displayFormat ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(InputWithPattern, __spreadProps(__spreadValues({ displayPattern: displayFormat }, commonProps), { onChange })) : /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(InputWithoutPattern, __spreadProps(__spreadValues({}, commonProps), { onChange: (e) => onChange(e.target.value) }));
2858
2795
  }
2859
- var VariableTextInput_default = VariableTextInput;
2860
2796
 
2861
2797
  // ../renderers/src/TextInputRenderer.tsx
2862
- var import_jsx_runtime48 = require("react/jsx-runtime");
2798
+ var import_jsx_runtime47 = require("react/jsx-runtime");
2863
2799
  var TextInputRenderer = {
2864
2800
  canRenderType: "input-text",
2865
2801
  render: (props) => {
2866
2802
  const _a = props, {
2867
2803
  id,
2868
- control,
2869
2804
  title,
2870
2805
  description,
2871
2806
  help,
2872
- error,
2873
2807
  icon,
2874
2808
  image,
2875
- maxLength,
2876
- minLength,
2877
- type,
2878
2809
  validationState,
2879
2810
  value: initialValue,
2880
2811
  onChange
2881
2812
  } = _a, rest = __objRest(_a, [
2882
2813
  "id",
2883
- "control",
2884
2814
  "title",
2885
2815
  "description",
2886
2816
  "help",
2887
- "error",
2888
2817
  "icon",
2889
2818
  "image",
2890
- "maxLength",
2891
- "minLength",
2892
- "type",
2893
2819
  "validationState",
2894
2820
  "value",
2895
2821
  "onChange"
@@ -2904,7 +2830,7 @@ var TextInputRenderer = {
2904
2830
  }
2905
2831
  }
2906
2832
  });
2907
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
2833
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
2908
2834
  FieldInput_default,
2909
2835
  {
2910
2836
  id,
@@ -2912,7 +2838,7 @@ var TextInputRenderer = {
2912
2838
  description,
2913
2839
  validation: validationState,
2914
2840
  help,
2915
- children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_components35.InputGroup, { addonStart: getInputGroupAddonStart({ icon, image }), children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(VariableTextInput_default, { control, inputProps }) })
2841
+ children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_components35.InputGroup, { addonStart: getInputGroupAddonStart({ icon, image }), children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(VariableTextInput, __spreadValues({}, inputProps)) })
2916
2842
  }
2917
2843
  );
2918
2844
  }
@@ -2926,7 +2852,7 @@ var import_components36 = require("@transferwise/components");
2926
2852
  var getRandomId = () => Math.random().toString(36).substring(2);
2927
2853
 
2928
2854
  // ../renderers/src/UploadInputRenderer.tsx
2929
- var import_jsx_runtime49 = require("react/jsx-runtime");
2855
+ var import_jsx_runtime48 = require("react/jsx-runtime");
2930
2856
  var UploadInputRenderer = {
2931
2857
  canRenderType: "input-upload",
2932
2858
  render: (props) => {
@@ -2942,14 +2868,14 @@ var UploadInputRenderer = {
2942
2868
  };
2943
2869
  return (
2944
2870
  // We don't pass help here as there is no sensible place to display it
2945
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
2871
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
2946
2872
  UploadFieldInput_default,
2947
2873
  {
2948
2874
  id,
2949
2875
  label: void 0,
2950
2876
  description: void 0,
2951
2877
  validation: validationState,
2952
- children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
2878
+ children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
2953
2879
  import_components36.UploadInput,
2954
2880
  {
2955
2881
  id,
@@ -3006,7 +2932,7 @@ var LargeUploadRenderer = {
3006
2932
  throw e;
3007
2933
  }
3008
2934
  };
3009
- return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
2935
+ return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
3010
2936
  FieldInput_default,
3011
2937
  {
3012
2938
  id,
@@ -3014,7 +2940,7 @@ var LargeUploadRenderer = {
3014
2940
  description,
3015
2941
  validation: validationState,
3016
2942
  help,
3017
- children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
2943
+ children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
3018
2944
  import_components36.Upload,
3019
2945
  __spreadProps(__spreadValues({}, uploadProps), {
3020
2946
  usAccept: getAcceptsString(accepts),
@@ -3031,14 +2957,14 @@ var LargeUploadRenderer = {
3031
2957
 
3032
2958
  // ../renderers/src/ReviewRenderer.tsx
3033
2959
  var import_components37 = require("@transferwise/components");
3034
- var import_jsx_runtime50 = require("react/jsx-runtime");
2960
+ var import_jsx_runtime49 = require("react/jsx-runtime");
3035
2961
  var ReviewRenderer = {
3036
2962
  canRenderType: "review",
3037
2963
  render: ({ callToAction, control, fields, margin, title }) => {
3038
2964
  const orientation = mapControlToDefinitionListLayout(control);
3039
- return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: getMargin(margin), children: [
3040
- (title || callToAction) && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_components37.Header, { title: title != null ? title : "", action: getReviewAction(callToAction) }),
3041
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: margin, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
2965
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: getMargin(margin), children: [
2966
+ (title || callToAction) && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_components37.Header, { title: title != null ? title : "", action: getReviewAction(callToAction) }),
2967
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: margin, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
3042
2968
  import_components37.DefinitionList,
3043
2969
  {
3044
2970
  layout: orientation,
@@ -3070,14 +2996,14 @@ var mapControlToDefinitionListLayout = (control) => {
3070
2996
  };
3071
2997
  var getFieldValue = (value, help, orientation) => {
3072
2998
  if (help) {
3073
- return orientation === "HORIZONTAL_RIGHT_ALIGNED" ? /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_jsx_runtime50.Fragment, { children: [
3074
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Help_default, { help }),
2999
+ return orientation === "HORIZONTAL_RIGHT_ALIGNED" ? /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_jsx_runtime49.Fragment, { children: [
3000
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Help_default, { help }),
3075
3001
  " ",
3076
3002
  value
3077
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_jsx_runtime50.Fragment, { children: [
3003
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_jsx_runtime49.Fragment, { children: [
3078
3004
  value,
3079
3005
  " ",
3080
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Help_default, { help })
3006
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Help_default, { help })
3081
3007
  ] });
3082
3008
  }
3083
3009
  return value;
@@ -3106,7 +3032,29 @@ var getReviewAction = (callToAction) => {
3106
3032
  };
3107
3033
 
3108
3034
  // ../renderers/src/step/StepRenderer.tsx
3109
- var import_react15 = require("react");
3035
+ var import_components40 = require("@transferwise/components");
3036
+
3037
+ // ../renderers/src/step/BackButton.tsx
3038
+ var import_components38 = require("@transferwise/components");
3039
+ var import_icons3 = require("@transferwise/icons");
3040
+ var import_jsx_runtime50 = require("react/jsx-runtime");
3041
+ function BackButton({ title, onClick }) {
3042
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "m-b-2", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
3043
+ "button",
3044
+ {
3045
+ type: "button",
3046
+ className: "df-back-btn",
3047
+ title,
3048
+ "aria-label": title,
3049
+ onClick,
3050
+ children: [
3051
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "sr-only", children: title }),
3052
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_components38.Avatar, { type: "icon", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_icons3.ArrowLeft, { size: "24" }) })
3053
+ ]
3054
+ }
3055
+ ) });
3056
+ }
3057
+ var BackButton_default = BackButton;
3110
3058
 
3111
3059
  // ../renderers/src/step/ExternalConfirmationDialog.tsx
3112
3060
  var import_react_intl15 = require("react-intl");
@@ -3137,7 +3085,7 @@ var external_confirmation_messages_default = (0, import_react_intl14.defineMessa
3137
3085
  });
3138
3086
 
3139
3087
  // ../renderers/src/step/ExternalConfirmationDialog.tsx
3140
- var import_components38 = require("@transferwise/components");
3088
+ var import_components39 = require("@transferwise/components");
3141
3089
  var import_jsx_runtime51 = require("react/jsx-runtime");
3142
3090
  function ExternalConfirmationDialog({
3143
3091
  external,
@@ -3146,10 +3094,10 @@ function ExternalConfirmationDialog({
3146
3094
  const { formatMessage } = (0, import_react_intl15.useIntl)();
3147
3095
  return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "df-box-renderer-width-lg", children: [
3148
3096
  /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("h2", { className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.title) }),
3149
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_components38.Markdown, { config: { link: { target: "_blank" } }, className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.description, { origin: getOrigin(external.url) }) }),
3097
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_components39.Markdown, { config: { link: { target: "_blank" } }, className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.description, { origin: getOrigin(external.url) }) }),
3150
3098
  /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "df-box-renderer-width-lg", children: [
3151
3099
  /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
3152
- import_components38.Button,
3100
+ import_components39.Button,
3153
3101
  {
3154
3102
  block: true,
3155
3103
  className: "m-b-2",
@@ -3162,7 +3110,7 @@ function ExternalConfirmationDialog({
3162
3110
  children: formatMessage(external_confirmation_messages_default.open)
3163
3111
  }
3164
3112
  ),
3165
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_components38.Button, { block: true, className: "m-b-2", priority: "tertiary", size: "md", onClick: onClose, children: formatMessage(external_confirmation_messages_default.cancel) })
3113
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_components39.Button, { block: true, className: "m-b-2", priority: "tertiary", size: "md", onClick: onClose, children: formatMessage(external_confirmation_messages_default.cancel) })
3166
3114
  ] }) })
3167
3115
  ] }) });
3168
3116
  }
@@ -3175,12 +3123,12 @@ function getOrigin(url) {
3175
3123
  }
3176
3124
 
3177
3125
  // ../renderers/src/step/useExternal.tsx
3178
- var import_react14 = require("react");
3126
+ var import_react12 = require("react");
3179
3127
  function useExternal(url) {
3180
- const [externalWindow, setExternalWindow] = (0, import_react14.useState)(null);
3181
- const [hasDismissed, setHasDismissed] = (0, import_react14.useState)(false);
3128
+ const [externalWindow, setExternalWindow] = (0, import_react12.useState)(null);
3129
+ const [hasDismissed, setHasDismissed] = (0, import_react12.useState)(false);
3182
3130
  const dismissConfirmation = () => setHasDismissed(true);
3183
- (0, import_react14.useEffect)(() => {
3131
+ (0, import_react12.useEffect)(() => {
3184
3132
  if (url) {
3185
3133
  setHasDismissed(false);
3186
3134
  setExternalWindow(window.open(url, "_blank"));
@@ -3190,49 +3138,25 @@ function useExternal(url) {
3190
3138
  return { requiresUserConfirmation, dismissConfirmation };
3191
3139
  }
3192
3140
 
3193
- // ../renderers/src/step/BackButton.tsx
3194
- var import_components39 = require("@transferwise/components");
3195
- var import_icons3 = require("@transferwise/icons");
3196
- var import_jsx_runtime52 = require("react/jsx-runtime");
3197
- function BackButton({ title, onClick }) {
3198
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "m-b-2", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
3199
- "button",
3200
- {
3201
- type: "button",
3202
- className: "df-back-btn",
3203
- title,
3204
- "aria-label": title,
3205
- onClick,
3206
- children: [
3207
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "sr-only", children: title }),
3208
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_components39.Avatar, { type: "icon", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_icons3.ArrowLeft, { size: "24" }) })
3209
- ]
3210
- }
3211
- ) });
3212
- }
3213
- var BackButton_default = BackButton;
3214
-
3215
3141
  // ../renderers/src/step/StepRenderer.tsx
3216
- var import_components40 = require("@transferwise/components");
3217
- var import_jsx_runtime53 = require("react/jsx-runtime");
3142
+ var import_jsx_runtime52 = require("react/jsx-runtime");
3218
3143
  var StepRenderer = {
3219
3144
  canRenderType: "step",
3220
3145
  render: StepRendererComponent
3221
3146
  };
3222
3147
  function StepRendererComponent(props) {
3223
- const { back, description, error, external, loadingState, title, trackEvent, children } = props;
3224
- const value = (0, import_react15.useMemo)(() => ({ loadingState, trackEvent }), [loadingState, trackEvent]);
3148
+ const { back, description, error, external, title, children } = props;
3225
3149
  const { requiresUserConfirmation, dismissConfirmation } = useExternal(external == null ? void 0 : external.url);
3226
3150
  if ((external == null ? void 0 : external.url) && requiresUserConfirmation) {
3227
- return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ExternalConfirmationDialog, { external, onClose: dismissConfirmation });
3151
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(ExternalConfirmationDialog, { external, onClose: dismissConfirmation });
3228
3152
  }
3229
- return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(StepRendererContextProvider, { value, children: [
3230
- back ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(BackButton_default, __spreadValues({}, back)) : null,
3231
- title || description ? /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "m-b-4", children: [
3232
- title ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_components40.Title, { as: "h1", type: "title-section", className: "text-xs-center m-b-2", children: title }) : void 0,
3233
- description ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { className: "text-xs-center np-text-body-large", children: description }) : void 0
3153
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_jsx_runtime52.Fragment, { children: [
3154
+ back ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(BackButton_default, __spreadValues({}, back)) : null,
3155
+ title || description ? /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "m-b-4", children: [
3156
+ title ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_components40.Title, { as: "h1", type: "title-section", className: "text-xs-center m-b-2", children: title }) : void 0,
3157
+ description ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { className: "text-xs-center np-text-body-large", children: description }) : void 0
3234
3158
  ] }) : void 0,
3235
- error ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_components40.Alert, { type: "negative", className: "m-b-2", message: error }) : void 0,
3159
+ error ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_components40.Alert, { type: "negative", className: "m-b-2", message: error }) : void 0,
3236
3160
  children
3237
3161
  ] });
3238
3162
  }
@@ -3240,31 +3164,31 @@ function StepRendererComponent(props) {
3240
3164
  // ../renderers/src/ListRenderer.tsx
3241
3165
  var import_components41 = require("@transferwise/components");
3242
3166
  var import_classnames6 = __toESM(require_classnames());
3243
- var import_jsx_runtime54 = require("react/jsx-runtime");
3167
+ var import_jsx_runtime53 = require("react/jsx-runtime");
3244
3168
  var ListRenderer = {
3245
3169
  canRenderType: "list",
3246
- render: ({ callToAction, margin, items, title }) => /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: getMargin(margin), children: [
3247
- title && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_components41.Header, { as: "h2", title, action: getListAction(callToAction) }),
3248
- items.map((props) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(DesignSystemListItem, __spreadValues({}, props), props.title))
3170
+ render: ({ callToAction, margin, items, title }) => /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: getMargin(margin), children: [
3171
+ (title || callToAction) && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_components41.Header, { as: "h2", title: title != null ? title : "", action: getListAction(callToAction) }),
3172
+ items.map((props) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(DesignSystemListItem, __spreadValues({}, props), props.title))
3249
3173
  ] })
3250
3174
  };
3251
- var DesignSystemListItem = ({ title, subtitle, value, subvalue, icon, image }) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
3175
+ var DesignSystemListItem = ({ title, subtitle, value, subvalue, icon, image }) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
3252
3176
  "label",
3253
3177
  {
3254
3178
  className: (0, import_classnames6.default)("np-option p-a-2", {
3255
3179
  "np-option__sm-media": true,
3256
3180
  "np-option__container-aligned": true
3257
3181
  }),
3258
- children: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "media", children: [
3259
- icon || image ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "media-left", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(ListItemMedia, { image, icon }) }) : null,
3260
- /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "media-body", children: [
3261
- /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "d-flex justify-content-between", children: [
3262
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("h4", { className: "np-text-body-large-bold text-primary np-option__title", children: title }),
3263
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("h4", { className: "np-text-body-large-bold text-primary np-option__title", children: value })
3182
+ children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "media", children: [
3183
+ icon || image ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "media-left", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ListItemMedia, { image, icon }) }) : null,
3184
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "media-body", children: [
3185
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "d-flex justify-content-between", children: [
3186
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("h4", { className: "np-text-body-large-bold text-primary np-option__title", children: title }),
3187
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("h4", { className: "np-text-body-large-bold text-primary np-option__title", children: value })
3264
3188
  ] }),
3265
- /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "d-flex justify-content-between", children: [
3266
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_components41.Body, { className: "d-block np-option__body", children: subtitle }),
3267
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_components41.Body, { className: "d-block np-option__body", children: subvalue })
3189
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "d-flex justify-content-between", children: [
3190
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_components41.Body, { className: "d-block np-option__body", children: subtitle }),
3191
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_components41.Body, { className: "d-block np-option__body", children: subvalue })
3268
3192
  ] })
3269
3193
  ] })
3270
3194
  ] })
@@ -3273,10 +3197,10 @@ var DesignSystemListItem = ({ title, subtitle, value, subvalue, icon, image }) =
3273
3197
  );
3274
3198
  var ListItemMedia = ({ icon, image }) => {
3275
3199
  if (icon) {
3276
- return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "circle circle-sm text-primary", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(NavigationOptionMedia, { icon, image }) });
3200
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "circle circle-sm text-primary", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(NavigationOptionMedia, { icon, image }) });
3277
3201
  }
3278
3202
  if (image) {
3279
- return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "np-option__no-media-circle", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(NavigationOptionMedia, { icon, image }) });
3203
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "np-option__no-media-circle", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(NavigationOptionMedia, { icon, image }) });
3280
3204
  }
3281
3205
  };
3282
3206
  var getListAction = (callToAction) => {
@@ -3339,17 +3263,17 @@ var getWiseRenderers = () => [
3339
3263
  ];
3340
3264
 
3341
3265
  // src/dynamicFlow/DynamicFlow.tsx
3342
- var import_jsx_runtime55 = require("react/jsx-runtime");
3266
+ var import_jsx_runtime54 = require("react/jsx-runtime");
3343
3267
  var wiseRenderers = getWiseRenderers();
3344
3268
  function DynamicFlowLegacy(props) {
3345
3269
  const { customFetch = globalThis.fetch } = props;
3346
3270
  const coreProps = __spreadProps(__spreadValues({}, props), { httpClient: customFetch });
3347
- return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_dynamic_flow_client2.DynamicFlow, __spreadValues({}, coreProps));
3271
+ return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_dynamic_flow_client2.DynamicFlow, __spreadValues({}, coreProps));
3348
3272
  }
3349
3273
  function DynamicFlowRevamp(props) {
3350
3274
  const { customFetch = globalThis.fetch, renderers, onLog, onLink = openLinkInNewTab } = props;
3351
3275
  const httpClient = useWiseHttpClient(customFetch);
3352
- const mergedRenderers = (0, import_react16.useMemo)(() => [...renderers != null ? renderers : [], ...wiseRenderers], [renderers]);
3276
+ const mergedRenderers = (0, import_react13.useMemo)(() => [...renderers != null ? renderers : [], ...wiseRenderers], [renderers]);
3353
3277
  const filteredOnLog = useFilteredOnLog(onLog);
3354
3278
  const coreProps = __spreadProps(__spreadValues({}, props), {
3355
3279
  httpClient,
@@ -3357,12 +3281,12 @@ function DynamicFlowRevamp(props) {
3357
3281
  onLink,
3358
3282
  onLog: filteredOnLog
3359
3283
  });
3360
- return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(RendererHttpClientProvider, { httpClient, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_dynamic_flow_client2.DynamicFlowCoreRevamp, __spreadValues({}, coreProps)) });
3284
+ return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_dynamic_flow_client2.DynamicFlowCoreRevamp, __spreadValues({}, coreProps));
3361
3285
  }
3362
- var DynamicFragment = (0, import_react16.forwardRef)(function DynamicFragment2(props, ref) {
3286
+ var DynamicForm = (0, import_react13.forwardRef)(function DynamicForm2(props, ref) {
3363
3287
  const { customFetch = globalThis.fetch, renderers, onLog, onLink = openLinkInNewTab } = props;
3364
3288
  const httpClient = useWiseHttpClient(customFetch);
3365
- const mergedRenderers = (0, import_react16.useMemo)(() => [...renderers != null ? renderers : [], ...wiseRenderers], [renderers]);
3289
+ const mergedRenderers = (0, import_react13.useMemo)(() => [...renderers != null ? renderers : [], ...wiseRenderers], [renderers]);
3366
3290
  const filteredOnLog = useFilteredOnLog(onLog);
3367
3291
  const coreProps = __spreadProps(__spreadValues({}, props), {
3368
3292
  httpClient,
@@ -3370,11 +3294,11 @@ var DynamicFragment = (0, import_react16.forwardRef)(function DynamicFragment2(p
3370
3294
  onLink,
3371
3295
  onLog: filteredOnLog
3372
3296
  });
3373
- return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(RendererHttpClientProvider, { httpClient, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_dynamic_flow_client2.DynamicFragmentCore, __spreadProps(__spreadValues({}, coreProps), { ref })) });
3297
+ return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_dynamic_flow_client2.DynamicFormCore, __spreadProps(__spreadValues({}, coreProps), { ref }));
3374
3298
  });
3375
3299
  var useWiseHttpClient = (httpClient) => {
3376
3300
  const { locale } = (0, import_react_intl16.useIntl)();
3377
- return (0, import_react16.useCallback)(
3301
+ return (0, import_react13.useCallback)(
3378
3302
  async (input, init = {}) => {
3379
3303
  const headers = new Headers(init.headers);
3380
3304
  headers.set("accept-language", locale);
@@ -3392,7 +3316,7 @@ var openLinkInNewTab = (url) => {
3392
3316
  return false;
3393
3317
  }
3394
3318
  };
3395
- var useFilteredOnLog = (onLog) => (0, import_react16.useMemo)(() => {
3319
+ var useFilteredOnLog = (onLog) => (0, import_react13.useMemo)(() => {
3396
3320
  return (level, message, extra) => {
3397
3321
  if (level !== "info") {
3398
3322
  onLog == null ? void 0 : onLog(level, message, extra);