@wise/dynamic-flow-client-internal 4.37.0 → 5.0.0-experimental-feace93

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.mjs CHANGED
@@ -1,7 +1,11 @@
1
+ var __create = Object.create;
1
2
  var __defProp = Object.defineProperty;
2
3
  var __defProps = Object.defineProperties;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
5
  var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
7
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
8
+ var __getProtoOf = Object.getPrototypeOf;
5
9
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
10
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
11
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
@@ -29,10 +33,97 @@ var __objRest = (source, exclude) => {
29
33
  }
30
34
  return target;
31
35
  };
36
+ var __commonJS = (cb, mod) => function __require() {
37
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
38
+ };
39
+ var __copyProps = (to, from, except, desc) => {
40
+ if (from && typeof from === "object" || typeof from === "function") {
41
+ for (let key of __getOwnPropNames(from))
42
+ if (!__hasOwnProp.call(to, key) && key !== except)
43
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
44
+ }
45
+ return to;
46
+ };
47
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
48
+ // If the importer is in node compatibility mode or this is not an ESM
49
+ // file that has been converted to a CommonJS file using a Babel-
50
+ // compatible transform (i.e. "__esModule" has not been set), then set
51
+ // "default" to the CommonJS "module.exports" for node compatibility.
52
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
53
+ mod
54
+ ));
55
+
56
+ // ../../node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.js
57
+ var require_classnames = __commonJS({
58
+ "../../node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.js"(exports, module) {
59
+ "use strict";
60
+ (function() {
61
+ "use strict";
62
+ var hasOwn = {}.hasOwnProperty;
63
+ function classNames6() {
64
+ var classes = "";
65
+ for (var i = 0; i < arguments.length; i++) {
66
+ var arg = arguments[i];
67
+ if (arg) {
68
+ classes = appendClass(classes, parseValue(arg));
69
+ }
70
+ }
71
+ return classes;
72
+ }
73
+ function parseValue(arg) {
74
+ if (typeof arg === "string" || typeof arg === "number") {
75
+ return arg;
76
+ }
77
+ if (typeof arg !== "object") {
78
+ return "";
79
+ }
80
+ if (Array.isArray(arg)) {
81
+ return classNames6.apply(null, arg);
82
+ }
83
+ if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) {
84
+ return arg.toString();
85
+ }
86
+ var classes = "";
87
+ for (var key in arg) {
88
+ if (hasOwn.call(arg, key) && arg[key]) {
89
+ classes = appendClass(classes, key);
90
+ }
91
+ }
92
+ return classes;
93
+ }
94
+ function appendClass(value, newClass) {
95
+ if (!newClass) {
96
+ return value;
97
+ }
98
+ if (value) {
99
+ return value + " " + newClass;
100
+ }
101
+ return value + newClass;
102
+ }
103
+ if (typeof module !== "undefined" && module.exports) {
104
+ classNames6.default = classNames6;
105
+ module.exports = classNames6;
106
+ } else if (typeof define === "function" && typeof define.amd === "object" && define.amd) {
107
+ define("classnames", [], function() {
108
+ return classNames6;
109
+ });
110
+ } else {
111
+ window.classNames = classNames6;
112
+ }
113
+ })();
114
+ }
115
+ });
32
116
 
33
117
  // src/index.ts
34
118
  import { makeHttpClient } from "@wise/dynamic-flow-client";
35
- import { findRendererPropsByType, isValidSchema, JsonSchemaForm } from "@wise/dynamic-flow-client";
119
+
120
+ // src/dynamicFlow/DynamicFlow.tsx
121
+ import { forwardRef, useCallback, useMemo as useMemo2 } from "react";
122
+ import { useIntl as useIntl15 } from "react-intl";
123
+ import {
124
+ DynamicFlow as DynamicFlowCore,
125
+ DynamicForm as DynamicFormCore
126
+ } from "@wise/dynamic-flow-client";
36
127
 
37
128
  // ../renderers/src/AlertRenderer.tsx
38
129
  import { Alert } from "@transferwise/components";
@@ -86,14 +177,14 @@ var mapCtaToAlertAction = (callToAction) => {
86
177
  return __spreadValues(__spreadValues({
87
178
  text: callToAction.title,
88
179
  "aria-label": callToAction.accessibilityDescription
89
- }, "onClick" in callToAction ? { onClick: callToAction.onClick } : {}), callToAction.type === "link" ? { href: callToAction.href, target: "_blank" } : {});
180
+ }, "onClick" in callToAction ? { onClick: callToAction.onClick } : {}), callToAction.href ? { href: callToAction.href, target: "_blank" } : {});
90
181
  }
91
182
  return void 0;
92
183
  };
93
184
  var AlertRenderer_default = AlertRenderer;
94
185
 
95
186
  // ../renderers/src/BoxRenderer.tsx
96
- import classNames from "classnames";
187
+ var import_classnames = __toESM(require_classnames());
97
188
  import { jsx as jsx2 } from "react/jsx-runtime";
98
189
  var BoxRenderer = {
99
190
  canRenderType: "box",
@@ -103,7 +194,7 @@ var BoxRenderer = {
103
194
  const contents = /* @__PURE__ */ jsx2(
104
195
  "div",
105
196
  {
106
- className: classNames({
197
+ className: (0, import_classnames.default)({
107
198
  "df-box-renderer-border": hasBorder,
108
199
  [`df-box-renderer-width-${width}`]: hasFixedWidth,
109
200
  [getMargin(margin)]: !hasFixedWidth
@@ -111,7 +202,7 @@ var BoxRenderer = {
111
202
  children
112
203
  }
113
204
  );
114
- return hasFixedWidth ? /* @__PURE__ */ jsx2("div", { className: classNames("df-box-renderer-fixed-width", getMargin(margin)), children: contents }) : contents;
205
+ return hasFixedWidth ? /* @__PURE__ */ jsx2("div", { className: (0, import_classnames.default)("df-box-renderer-fixed-width", getMargin(margin)), children: contents }) : contents;
115
206
  }
116
207
  };
117
208
  var BoxRenderer_default = BoxRenderer;
@@ -171,7 +262,10 @@ var AddressValidationButtonRenderer_default = AddressValidationButtonRenderer;
171
262
 
172
263
  // ../renderers/src/ButtonRenderer/ButtonRenderer.tsx
173
264
  import { Button as Button2 } from "@transferwise/components";
174
- import { useEffect as useEffect2, useState as useState2 } from "react";
265
+
266
+ // ../renderers/src/utils/isButtonPriority.ts
267
+ var validPriorities = ["primary", "secondary", "secondary-neutral", "tertiary"];
268
+ var isButtonPriority = (control) => validPriorities.includes(control);
175
269
 
176
270
  // ../renderers/src/ButtonRenderer/mapButtonSize.tsx
177
271
  var mapButtonSize = (size) => {
@@ -192,6 +286,7 @@ var mapButtonSize = (size) => {
192
286
  };
193
287
 
194
288
  // ../renderers/src/ButtonRenderer/ButtonRenderer.tsx
289
+ import { useEffect as useEffect2, useState as useState2 } from "react";
195
290
  import { jsx as jsx4 } from "react/jsx-runtime";
196
291
  var ButtonRenderer = {
197
292
  canRenderType: "button",
@@ -205,19 +300,18 @@ function ButtonComponent(props) {
205
300
  setSpinny(false);
206
301
  }
207
302
  }, [stepLoadingState]);
208
- const priority = getPriority(control);
209
- const type = getButtonType(context, priority);
210
303
  const loading = spinny && stepLoadingState !== "idle";
211
304
  return /* @__PURE__ */ jsx4(
212
305
  Button2,
213
306
  {
307
+ v2: true,
214
308
  block: true,
215
309
  className: getMargin(margin),
216
310
  disabled,
217
- priority,
218
- size: mapButtonSize(size),
311
+ priority: getPriority(control),
219
312
  loading,
220
- type,
313
+ size: mapButtonSize(size),
314
+ sentiment: getSentiment(context),
221
315
  onClick: () => {
222
316
  setSpinny(true);
223
317
  onClick();
@@ -226,27 +320,8 @@ function ButtonComponent(props) {
226
320
  }
227
321
  );
228
322
  }
229
- var getPriority = (control) => {
230
- switch (control) {
231
- case "primary":
232
- case "tertiary":
233
- return control;
234
- default:
235
- return "secondary";
236
- }
237
- };
238
- var getButtonType = (context, priority) => {
239
- if (priority === "tertiary") {
240
- return void 0;
241
- }
242
- switch (context) {
243
- case "neutral":
244
- case "warning":
245
- return "accent";
246
- default:
247
- return context;
248
- }
249
- };
323
+ var getSentiment = (context) => context === "negative" ? "negative" : "default";
324
+ var getPriority = (control) => control && isButtonPriority(control) ? control : "secondary";
250
325
 
251
326
  // ../renderers/src/components/FieldInput.tsx
252
327
  import { Field } from "@transferwise/components";
@@ -319,7 +394,7 @@ var mapStatusToSentiment = (validation) => {
319
394
  var FieldInput_default = FieldInput;
320
395
 
321
396
  // ../renderers/src/CheckboxInputRenderer.tsx
322
- import { Checkbox, ListItem } from "@transferwise/components";
397
+ import { Checkbox, ListItem as ListItem3 } from "@transferwise/components";
323
398
 
324
399
  // ../renderers/src/utils/UrnFlag.tsx
325
400
  import { Flag } from "@wise/art";
@@ -608,15 +683,45 @@ function OptionMedia(props) {
608
683
  import { jsx as jsx18 } from "react/jsx-runtime";
609
684
  var getInlineMedia = (media) => media ? /* @__PURE__ */ jsx18(Media, { media, preferAvatar: false, size: 24 }) : null;
610
685
 
611
- // ../renderers/src/NewListItem/getMedia.tsx
686
+ // ../renderers/src/utils/listItem/getMedia.tsx
612
687
  import { jsx as jsx19 } from "react/jsx-runtime";
613
688
  var getMedia = (media, preferAvatar) => media ? /* @__PURE__ */ jsx19(OptionMedia, { media, preferAvatar }) : void 0;
614
689
 
615
- // ../renderers/src/CheckboxInputRenderer.tsx
690
+ // ../renderers/src/utils/listItem/getAdditionalText.tsx
691
+ import { ListItem } from "@transferwise/components";
616
692
  import { jsx as jsx20 } from "react/jsx-runtime";
693
+ var getAdditionalText = (additionalText) => {
694
+ if (!additionalText) {
695
+ return void 0;
696
+ }
697
+ return /* @__PURE__ */ jsx20(ListItem.AdditionalInfo, { children: additionalText });
698
+ };
699
+
700
+ // ../renderers/src/utils/listItem/getSupportingValues.ts
701
+ var getSupportingValues = (supportingValues) => {
702
+ return __spreadValues(__spreadValues({}, (supportingValues == null ? void 0 : supportingValues.value) ? { valueTitle: supportingValues.value } : {}), (supportingValues == null ? void 0 : supportingValues.subvalue) ? { valueSubtitle: supportingValues.subvalue } : {});
703
+ };
704
+
705
+ // ../renderers/src/utils/listItem/getInlineAlert.tsx
706
+ import { ListItem as ListItem2 } from "@transferwise/components";
707
+ import { jsx as jsx21 } from "react/jsx-runtime";
708
+ var getInlineAlert = (inlineAlert) => inlineAlert ? /* @__PURE__ */ jsx21(ListItem2.Prompt, { sentiment: inlineAlert == null ? void 0 : inlineAlert.context, children: inlineAlert.content }) : void 0;
709
+
710
+ // ../renderers/src/CheckboxInputRenderer.tsx
711
+ import { jsx as jsx22 } from "react/jsx-runtime";
617
712
  var CheckboxInputRenderer = {
618
713
  canRenderType: "input-checkbox",
619
- render: (props) => props.control === "switch-item" ? /* @__PURE__ */ jsx20(SwitchComponent, __spreadValues({}, props)) : /* @__PURE__ */ jsx20(CheckboxComponent, __spreadValues({}, props))
714
+ render: (props) => {
715
+ switch (props.control) {
716
+ case "switch-item":
717
+ return /* @__PURE__ */ jsx22(SwitchItemComponent, __spreadValues({}, props));
718
+ case "checkbox-item":
719
+ return /* @__PURE__ */ jsx22(CheckboxItemComponent, __spreadValues({}, props));
720
+ case "checkbox":
721
+ default:
722
+ return /* @__PURE__ */ jsx22(CheckboxComponent, __spreadValues({}, props));
723
+ }
724
+ }
620
725
  };
621
726
  var CheckboxComponent = (props) => {
622
727
  const _a = props, {
@@ -639,39 +744,83 @@ var CheckboxComponent = (props) => {
639
744
  "value"
640
745
  ]);
641
746
  const checkboxProps = __spreadProps(__spreadValues({}, rest), { label: title, secondary: description, checked: value });
642
- return /* @__PURE__ */ jsx20(FieldInput_default, { id, label: "", description: "", validation: validationState, help, children: /* @__PURE__ */ jsx20(Checkbox, __spreadValues({ id }, checkboxProps)) });
747
+ return /* @__PURE__ */ jsx22(FieldInput_default, { id, label: "", description: "", validation: validationState, help, children: /* @__PURE__ */ jsx22(Checkbox, __spreadValues({ id }, checkboxProps)) });
643
748
  };
644
- var SwitchComponent = (props) => {
645
- const { title, description, disabled, media, validationState, value, onChange } = props;
646
- return /* @__PURE__ */ jsx20(
647
- ListItem,
648
- {
749
+ var CheckboxItemComponent = (props) => {
750
+ const {
751
+ additionalText,
752
+ description,
753
+ disabled,
754
+ inlineAlert,
755
+ media,
756
+ supportingValues,
757
+ title,
758
+ validationState,
759
+ value,
760
+ onChange
761
+ } = props;
762
+ return /* @__PURE__ */ jsx22(
763
+ ListItem3,
764
+ __spreadValues({
649
765
  title,
650
766
  subtitle: description,
767
+ additionalInfo: getAdditionalText(additionalText),
651
768
  media: getMedia(media, false),
652
769
  disabled,
653
- prompt: validationState && validationState.status === "invalid" ? /* @__PURE__ */ jsx20(ListItem.Prompt, { sentiment: "negative", children: validationState.message }) : void 0,
654
- control: /* @__PURE__ */ jsx20(ListItem.Switch, { checked: value, onClick: () => onChange(!value) })
655
- }
770
+ prompt: getInlineAlertOrValidation(validationState, inlineAlert),
771
+ control: /* @__PURE__ */ jsx22(ListItem3.Checkbox, { checked: value, onChange: () => onChange(!value) })
772
+ }, getSupportingValues(supportingValues))
773
+ );
774
+ };
775
+ var SwitchItemComponent = (props) => {
776
+ const {
777
+ additionalText,
778
+ description,
779
+ disabled,
780
+ inlineAlert,
781
+ media,
782
+ supportingValues,
783
+ title,
784
+ validationState,
785
+ value,
786
+ onChange
787
+ } = props;
788
+ return /* @__PURE__ */ jsx22(
789
+ ListItem3,
790
+ __spreadValues({
791
+ title,
792
+ subtitle: description,
793
+ additionalInfo: getAdditionalText(additionalText),
794
+ media: getMedia(media, false),
795
+ disabled,
796
+ prompt: getInlineAlertOrValidation(validationState, inlineAlert),
797
+ control: /* @__PURE__ */ jsx22(ListItem3.Switch, { checked: value, onClick: () => onChange(!value) })
798
+ }, getSupportingValues(supportingValues))
656
799
  );
657
800
  };
801
+ var getInlineAlertOrValidation = (validationState, inlineAlert) => {
802
+ if (validationState && validationState.status === "invalid") {
803
+ return /* @__PURE__ */ jsx22(ListItem3.Prompt, { sentiment: "negative", children: validationState.message });
804
+ }
805
+ return getInlineAlert(inlineAlert);
806
+ };
658
807
  var CheckboxInputRenderer_default = CheckboxInputRenderer;
659
808
 
660
809
  // ../renderers/src/ColumnsRenderer.tsx
661
- import classNames2 from "classnames";
662
- import { jsx as jsx21, jsxs as jsxs3 } from "react/jsx-runtime";
810
+ var import_classnames2 = __toESM(require_classnames());
811
+ import { jsx as jsx23, jsxs as jsxs3 } from "react/jsx-runtime";
663
812
  var ColumnsRenderer = {
664
813
  canRenderType: "columns",
665
814
  render: ({ bias, margin, startChildren, endChildren }) => /* @__PURE__ */ jsxs3(
666
815
  "div",
667
816
  {
668
- className: classNames2("df-columns-renderer-container", getMargin(margin), {
817
+ className: (0, import_classnames2.default)("df-columns-renderer-container", getMargin(margin), {
669
818
  "df-columns-renderer-bias-start": bias === "start",
670
819
  "df-columns-renderer-bias-end": bias === "end"
671
820
  }),
672
821
  children: [
673
- /* @__PURE__ */ jsx21("div", { className: "df-columns-renderer-column", children: startChildren }),
674
- /* @__PURE__ */ jsx21("div", { className: "df-columns-renderer-column", children: endChildren })
822
+ /* @__PURE__ */ jsx23("div", { className: "df-columns-renderer-column", children: startChildren }),
823
+ /* @__PURE__ */ jsx23("div", { className: "df-columns-renderer-column", children: endChildren })
675
824
  ]
676
825
  }
677
826
  )
@@ -706,7 +855,7 @@ var dateToDateString = (date) => {
706
855
  };
707
856
 
708
857
  // ../renderers/src/components/VariableDateInput.tsx
709
- import { jsx as jsx22 } from "react/jsx-runtime";
858
+ import { jsx as jsx24 } from "react/jsx-runtime";
710
859
  function VariableDateInput({
711
860
  control,
712
861
  inputProps
@@ -722,7 +871,7 @@ function VariableDateInput({
722
871
  onFocus
723
872
  } = inputProps;
724
873
  if (control === "date-lookup") {
725
- return /* @__PURE__ */ jsx22(
874
+ return /* @__PURE__ */ jsx24(
726
875
  DateLookup,
727
876
  {
728
877
  value: dateStringToDateOrNull(inputProps.value),
@@ -738,7 +887,7 @@ function VariableDateInput({
738
887
  }
739
888
  );
740
889
  }
741
- return /* @__PURE__ */ jsx22(
890
+ return /* @__PURE__ */ jsx24(
742
891
  DateInput,
743
892
  __spreadProps(__spreadValues({}, inputProps), {
744
893
  dayAutoComplete: getAutocompleteString(autoComplete, "day"),
@@ -755,7 +904,7 @@ var getAutocompleteString = (value, suffix) => {
755
904
  var VariableDateInput_default = VariableDateInput;
756
905
 
757
906
  // ../renderers/src/DateInputRenderer.tsx
758
- import { jsx as jsx23 } from "react/jsx-runtime";
907
+ import { jsx as jsx25 } from "react/jsx-runtime";
759
908
  var DateInputRenderer = {
760
909
  canRenderType: "input-date",
761
910
  render: (props) => {
@@ -780,7 +929,7 @@ var DateInputRenderer = {
780
929
  ]);
781
930
  const value = initialValue != null ? initialValue : "";
782
931
  const inputProps = __spreadProps(__spreadValues({}, rest), { value, id });
783
- return /* @__PURE__ */ jsx23(
932
+ return /* @__PURE__ */ jsx25(
784
933
  FieldInput_default,
785
934
  {
786
935
  id,
@@ -788,360 +937,147 @@ var DateInputRenderer = {
788
937
  description,
789
938
  validation: validationState,
790
939
  help,
791
- children: /* @__PURE__ */ jsx23(VariableDateInput_default, { control, inputProps })
940
+ children: /* @__PURE__ */ jsx25(VariableDateInput_default, { control, inputProps })
792
941
  }
793
942
  );
794
943
  }
795
944
  };
796
945
  var DateInputRenderer_default = DateInputRenderer;
797
946
 
798
- // ../renderers/src/DecisionRenderer/DecisionRenderer.tsx
799
- import { NavigationOption, NavigationOptionsList } from "@transferwise/components";
947
+ // ../renderers/src/DividerRenderer.tsx
948
+ import { Divider } from "@transferwise/components";
949
+ import { jsx as jsx26 } from "react/jsx-runtime";
950
+ var mapControlToLevel = (control) => {
951
+ switch (control) {
952
+ case "section":
953
+ return "section";
954
+ case "content":
955
+ return "content";
956
+ default:
957
+ return "subsection";
958
+ }
959
+ };
960
+ var DividerRenderer = {
961
+ canRenderType: "divider",
962
+ render: ({ margin, control }) => /* @__PURE__ */ jsx26(Divider, { className: `m-t-0 d-block ${getMargin(margin)}`, level: mapControlToLevel(control) })
963
+ };
964
+ var DividerRenderer_default = DividerRenderer;
800
965
 
801
- // ../renderers/src/DecisionRenderer/DecisionWrapper.tsx
802
- import { Header as Header2, SearchInput } from "@transferwise/components";
803
- import { useState as useState3 } from "react";
804
- import { useIntl as useIntl4 } from "react-intl";
966
+ // ../renderers/src/ExternalConfirmationRenderer.tsx
967
+ import { Button as Button3, Markdown as Markdown2, Modal } from "@transferwise/components";
805
968
 
806
- // ../renderers/src/messages/filter.messages.ts
969
+ // ../renderers/src/messages/external-confirmation.messages.ts
807
970
  import { defineMessages as defineMessages3 } from "react-intl";
808
- var filter_messages_default = defineMessages3({
809
- placeholder: {
810
- id: "df.wise.filter.placeholder",
811
- defaultMessage: "Start typing to search",
812
- description: "Placeholder for the filter input"
971
+ var external_confirmation_messages_default = defineMessages3({
972
+ title: {
973
+ id: "df.wise.ExternalConfirmation.title",
974
+ defaultMessage: "Please confirm",
975
+ description: "Heading for the confirmation screen."
813
976
  },
814
- results: {
815
- id: "df.wise.filter.results",
816
- defaultMessage: "Search results",
817
- description: "Label for the results section"
977
+ description: {
978
+ id: "df.wise.ExternalConfirmation.description",
979
+ defaultMessage: "Please confirm you want to open **{origin}** in a new browser tab.",
980
+ description: "Description for the confirmation screen."
818
981
  },
819
- noResults: {
820
- id: "df.wise.filter.noResults",
821
- defaultMessage: "No results",
822
- description: "Message for if there are no results"
982
+ open: {
983
+ id: "df.wise.ExternalConfirmation.open",
984
+ defaultMessage: "Open in new tab",
985
+ description: "Button text confirming opening a new browser tab."
986
+ },
987
+ cancel: {
988
+ id: "df.wise.ExternalConfirmation.cancel",
989
+ defaultMessage: "Cancel",
990
+ description: "Button text rejecting opening a new browser tab."
823
991
  }
824
992
  });
825
993
 
826
- // ../renderers/src/DecisionRenderer/filter-and-sort-decision-options.ts
827
- function filterAndSortDecisionOptions(selectOptions, query) {
828
- const upperQuery = normalizeAndRemoveAccents(query);
829
- const filteredItems = selectOptions.filter((option) => {
830
- var _a, _b, _c, _d;
831
- const searchableWords = [
832
- option.title,
833
- option.description,
834
- option.additionalText,
835
- (_a = option.supportingValues) == null ? void 0 : _a.value,
836
- (_b = option.supportingValues) == null ? void 0 : _b.subvalue,
837
- ...(_c = option.keywords) != null ? _c : []
838
- ];
839
- return (_d = searchableWords.some(
840
- (word) => word && normalizeAndRemoveAccents(word).includes(upperQuery)
841
- )) != null ? _d : false;
842
- });
843
- return [...filteredItems].sort((a, b) => {
844
- if (a.disabled && !b.disabled) {
845
- return 1;
846
- }
847
- if (!a.disabled && b.disabled) {
848
- return -1;
849
- }
850
- const aTitleUpper = a.title.toUpperCase();
851
- const bTitleUpper = b.title.toUpperCase();
852
- const aTitleStarts = aTitleUpper.startsWith(upperQuery);
853
- const bTitleStarts = bTitleUpper.startsWith(upperQuery);
854
- if (aTitleStarts && !bTitleStarts) {
855
- return -1;
856
- }
857
- if (!aTitleStarts && bTitleStarts) {
858
- return 1;
859
- }
860
- const aWordStarts = aTitleUpper.split(" ").some((word) => word.startsWith(upperQuery));
861
- const bWordStarts = bTitleUpper.split(" ").some((word) => word.startsWith(upperQuery));
862
- if (aWordStarts && !bWordStarts) {
863
- return -1;
994
+ // ../renderers/src/ExternalConfirmationRenderer.tsx
995
+ import { useIntl as useIntl3 } from "react-intl";
996
+ import { useEffect as useEffect3 } from "react";
997
+ import { Fragment, jsx as jsx27, jsxs as jsxs4 } from "react/jsx-runtime";
998
+ var ExternalConfirmationRenderer = {
999
+ canRenderType: "external-confirmation",
1000
+ render: ExternalConfirmationRendererComponent
1001
+ };
1002
+ function ExternalConfirmationRendererComponent({
1003
+ url,
1004
+ status,
1005
+ onSuccess,
1006
+ onFailure,
1007
+ onCancel
1008
+ }) {
1009
+ const { formatMessage } = useIntl3();
1010
+ useEffect3(() => {
1011
+ if (url) {
1012
+ const w = window.open(url, "_blank");
1013
+ if (w) {
1014
+ onSuccess();
1015
+ } else {
1016
+ onFailure();
1017
+ }
864
1018
  }
865
- if (!aWordStarts && bWordStarts) {
866
- return 1;
1019
+ }, []);
1020
+ return /* @__PURE__ */ jsx27(
1021
+ Modal,
1022
+ {
1023
+ open: status === "failure",
1024
+ title: formatMessage(external_confirmation_messages_default.title),
1025
+ body: /* @__PURE__ */ jsxs4(Fragment, { children: [
1026
+ /* @__PURE__ */ jsx27(Markdown2, { config: { link: { target: "_blank" } }, className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.description, { origin: getOrigin(url) }) }),
1027
+ /* @__PURE__ */ jsx27("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ jsxs4("div", { className: "df-box-renderer-width-lg", children: [
1028
+ /* @__PURE__ */ jsx27(
1029
+ Button3,
1030
+ {
1031
+ v2: true,
1032
+ block: true,
1033
+ className: "m-b-2",
1034
+ priority: "primary",
1035
+ size: "md",
1036
+ onClick: () => {
1037
+ window.open(url);
1038
+ onCancel();
1039
+ },
1040
+ children: formatMessage(external_confirmation_messages_default.open)
1041
+ }
1042
+ ),
1043
+ /* @__PURE__ */ jsx27(Button3, { v2: true, block: true, className: "m-b-2", priority: "tertiary", size: "md", onClick: onCancel, children: formatMessage(external_confirmation_messages_default.cancel) })
1044
+ ] }) })
1045
+ ] }),
1046
+ onClose: onCancel
867
1047
  }
868
- return a.title.localeCompare(b.title);
869
- });
1048
+ );
870
1049
  }
871
- var normalizeAndRemoveAccents = (text) => text.trim().toLowerCase().normalize("NFKD").replace(new RegExp("\\p{Diacritic}", "gu"), "");
1050
+ function getOrigin(url) {
1051
+ try {
1052
+ return new URL(url).origin;
1053
+ } catch (e) {
1054
+ return url;
1055
+ }
1056
+ }
1057
+ var ExternalConfirmationRenderer_default = ExternalConfirmationRenderer;
872
1058
 
873
- // ../renderers/src/DecisionRenderer/GroupedDecisionList.tsx
874
- import { Header, Section } from "@transferwise/components";
875
- import { useIntl as useIntl3 } from "react-intl";
876
-
877
- // ../renderers/src/messages/group.messages.ts
878
- import { defineMessages as defineMessages4 } from "react-intl";
879
- var group_messages_default = defineMessages4({
880
- all: {
881
- id: "df.wise.group.all",
882
- defaultMessage: "All",
883
- description: "Label for the group of options that encompasses all options"
884
- },
885
- popular: {
886
- id: "df.wise.group.popular",
887
- defaultMessage: "Popular",
888
- description: "Label for the group of options that are tagged as popular"
889
- },
890
- recent: {
891
- id: "df.wise.group.recent",
892
- defaultMessage: "Recent",
893
- description: "Label for the group of options that are tagged as recent"
894
- },
895
- "currencies-with-account-details": {
896
- id: "df.wise.group.currencies-with-account-details",
897
- defaultMessage: "Currencies with account details",
898
- description: "Label for the group of options that are tagged as currencies with account details"
899
- }
900
- });
901
-
902
- // ../renderers/src/utils/grouping-utils.ts
903
- var getGroupsFromTags = (knownTags, items) => {
904
- return knownTags.map((tag) => {
905
- return { tag, items: items.filter((item) => {
906
- var _a;
907
- return (_a = item.tags) == null ? void 0 : _a.includes(tag);
908
- }) };
909
- }).filter((group) => group.items.length > 0);
910
- };
911
-
912
- // ../renderers/src/DecisionRenderer/GroupedDecisionList.tsx
913
- import { Fragment, jsx as jsx24, jsxs as jsxs4 } from "react/jsx-runtime";
914
- var groupingTags = Object.keys(group_messages_default).filter((key) => key !== "all");
915
- var isGroupedDecision = (options) => {
916
- return getGroupsFromTags(groupingTags, options).length > 0;
917
- };
918
- var GroupedDecisionList = (_a) => {
919
- var _b = _a, { renderDecisionList: renderDecisionList3 } = _b, rest = __objRest(_b, ["renderDecisionList"]);
920
- const { formatMessage } = useIntl3();
921
- const { options } = rest;
922
- const itemsByTag = [...getGroupsFromTags(groupingTags, options), { tag: "all", items: options }];
923
- return /* @__PURE__ */ jsx24(Fragment, { children: itemsByTag.map(({ tag, items }) => /* @__PURE__ */ jsxs4(Section, { children: [
924
- /* @__PURE__ */ jsx24(
925
- Header,
926
- {
927
- as: "h2",
928
- title: tag in group_messages_default ? formatMessage(group_messages_default[tag]) : tag
929
- }
930
- ),
931
- renderDecisionList3(__spreadProps(__spreadValues({}, rest), { options: items }))
932
- ] }, tag)) });
933
- };
934
-
935
- // ../renderers/src/DecisionRenderer/DecisionWrapper.tsx
936
- import { Fragment as Fragment2, jsx as jsx25, jsxs as jsxs5 } from "react/jsx-runtime";
937
- var DecisionWrapper = (props) => {
938
- return /* @__PURE__ */ jsxs5("div", { className: getMargin(props.margin), children: [
939
- props.title && /* @__PURE__ */ jsx25(Header2, { as: "h2", title: props.title }),
940
- props.control === "filtered" ? /* @__PURE__ */ jsx25(FilteredDecisionList, __spreadValues({}, props)) : /* @__PURE__ */ jsx25(UnfilteredDecisionList, __spreadValues({}, props))
941
- ] });
942
- };
943
- var UnfilteredDecisionList = (_a) => {
944
- var _b = _a, { renderDecisionList: renderDecisionList3 } = _b, rest = __objRest(_b, ["renderDecisionList"]);
945
- return isGroupedDecision(rest.options) ? /* @__PURE__ */ jsx25(GroupedDecisionList, __spreadProps(__spreadValues({}, rest), { renderDecisionList: renderDecisionList3 })) : renderDecisionList3(rest);
946
- };
947
- var FilteredDecisionList = (props) => {
948
- const { formatMessage } = useIntl4();
949
- const [query, setQuery] = useState3("");
950
- const { control, options, renderDecisionList: renderDecisionList3 } = props;
951
- const filteredOptions = (query == null ? void 0 : query.length) > 0 ? filterAndSortDecisionOptions(options, query) : options;
952
- const isGrouped = isGroupedDecision(options);
953
- return /* @__PURE__ */ jsxs5(Fragment2, { children: [
954
- /* @__PURE__ */ jsx25(
955
- SearchInput,
956
- {
957
- placeholder: formatMessage(filter_messages_default.placeholder),
958
- value: query,
959
- className: "m-b-2",
960
- onChange: (e) => {
961
- var _a;
962
- return setQuery((_a = e.target.value) != null ? _a : "");
963
- }
964
- }
965
- ),
966
- isGrouped && query.length === 0 ? /* @__PURE__ */ jsx25(GroupedDecisionList, __spreadValues({}, props)) : /* @__PURE__ */ jsxs5(Fragment2, { children: [
967
- query.length > 0 && /* @__PURE__ */ jsx25(Header2, { as: "h2", title: formatMessage(filter_messages_default.results), className: "m-t-4" }),
968
- filteredOptions.length > 0 ? renderDecisionList3({
969
- control,
970
- className: query.length === 0 ? "m-t-3" : "",
971
- options: filteredOptions
972
- }) : /* @__PURE__ */ jsx25("p", { children: formatMessage(filter_messages_default.noResults) })
973
- ] })
974
- ] });
975
- };
976
-
977
- // ../renderers/src/DecisionRenderer/DecisionRenderer.tsx
978
- import { jsx as jsx26 } from "react/jsx-runtime";
979
- var DecisionRenderer = {
980
- canRenderType: "decision",
981
- render: (props) => {
982
- return /* @__PURE__ */ jsx26(DecisionWrapper, __spreadProps(__spreadValues({}, props), { renderDecisionList }));
983
- }
984
- };
985
- var renderDecisionList = ({ options, className, control }) => {
986
- return /* @__PURE__ */ jsx26("div", { className, children: /* @__PURE__ */ jsx26(NavigationOptionsList, { children: options.map((option) => {
987
- const { description, disabled, media, title: itemTitle, tag, onClick } = option;
988
- return /* @__PURE__ */ jsx26(
989
- NavigationOption,
990
- {
991
- title: itemTitle,
992
- content: description,
993
- disabled,
994
- media: media ? /* @__PURE__ */ jsx26(
995
- OptionMedia,
996
- {
997
- media,
998
- preferAvatar: control === "with-avatar" || tag === "with-avatar"
999
- }
1000
- ) : null,
1001
- showMediaCircle: false,
1002
- showMediaAtAllSizes: true,
1003
- onClick
1004
- },
1005
- JSON.stringify(option)
1006
- );
1007
- }) }) });
1008
- };
1009
- var DecisionRenderer_default = DecisionRenderer;
1010
-
1011
- // ../renderers/src/DividerRenderer.tsx
1012
- import { Divider } from "@transferwise/components";
1013
- import { jsx as jsx27 } from "react/jsx-runtime";
1014
- var mapControlToLevel = (control) => {
1015
- switch (control) {
1016
- case "section":
1017
- return "section";
1018
- case "content":
1019
- return "content";
1020
- default:
1021
- return "subsection";
1022
- }
1023
- };
1024
- var DividerRenderer = {
1025
- canRenderType: "divider",
1026
- render: ({ margin, control }) => /* @__PURE__ */ jsx27(Divider, { className: `m-t-0 d-block ${getMargin(margin)}`, level: mapControlToLevel(control) })
1027
- };
1028
- var DividerRenderer_default = DividerRenderer;
1029
-
1030
- // ../renderers/src/ExternalConfirmationRenderer.tsx
1031
- import { Button as Button3, Markdown as Markdown2, Modal } from "@transferwise/components";
1032
-
1033
- // ../renderers/src/messages/external-confirmation.messages.ts
1034
- import { defineMessages as defineMessages5 } from "react-intl";
1035
- var external_confirmation_messages_default = defineMessages5({
1036
- title: {
1037
- id: "df.wise.ExternalConfirmation.title",
1038
- defaultMessage: "Please confirm",
1039
- description: "Heading for the confirmation screen."
1040
- },
1041
- description: {
1042
- id: "df.wise.ExternalConfirmation.description",
1043
- defaultMessage: "Please confirm you want to open **{origin}** in a new browser tab.",
1044
- description: "Description for the confirmation screen."
1045
- },
1046
- open: {
1047
- id: "df.wise.ExternalConfirmation.open",
1048
- defaultMessage: "Open in new tab",
1049
- description: "Button text confirming opening a new browser tab."
1050
- },
1051
- cancel: {
1052
- id: "df.wise.ExternalConfirmation.cancel",
1053
- defaultMessage: "Cancel",
1054
- description: "Button text rejecting opening a new browser tab."
1055
- }
1056
- });
1057
-
1058
- // ../renderers/src/ExternalConfirmationRenderer.tsx
1059
- import { useIntl as useIntl5 } from "react-intl";
1060
- import { useEffect as useEffect3 } from "react";
1061
- import { Fragment as Fragment3, jsx as jsx28, jsxs as jsxs6 } from "react/jsx-runtime";
1062
- var ExternalConfirmationRenderer = {
1063
- canRenderType: "external-confirmation",
1064
- render: ExternalConfirmationRendererComponent
1065
- };
1066
- function ExternalConfirmationRendererComponent({
1067
- url,
1068
- status,
1069
- onSuccess,
1070
- onFailure,
1071
- onCancel
1072
- }) {
1073
- const { formatMessage } = useIntl5();
1074
- useEffect3(() => {
1075
- if (url) {
1076
- const w = window.open(url, "_blank");
1077
- if (w) {
1078
- onSuccess();
1079
- } else {
1080
- onFailure();
1081
- }
1082
- }
1083
- }, []);
1084
- return /* @__PURE__ */ jsx28(
1085
- Modal,
1086
- {
1087
- open: status === "failure",
1088
- title: formatMessage(external_confirmation_messages_default.title),
1089
- body: /* @__PURE__ */ jsxs6(Fragment3, { children: [
1090
- /* @__PURE__ */ jsx28(Markdown2, { config: { link: { target: "_blank" } }, className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.description, { origin: getOrigin(url) }) }),
1091
- /* @__PURE__ */ jsx28("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ jsxs6("div", { className: "df-box-renderer-width-lg", children: [
1092
- /* @__PURE__ */ jsx28(
1093
- Button3,
1094
- {
1095
- v2: true,
1096
- block: true,
1097
- className: "m-b-2",
1098
- priority: "primary",
1099
- size: "md",
1100
- onClick: () => {
1101
- window.open(url);
1102
- onCancel();
1103
- },
1104
- children: formatMessage(external_confirmation_messages_default.open)
1105
- }
1106
- ),
1107
- /* @__PURE__ */ jsx28(Button3, { v2: true, block: true, className: "m-b-2", priority: "tertiary", size: "md", onClick: onCancel, children: formatMessage(external_confirmation_messages_default.cancel) })
1108
- ] }) })
1109
- ] }),
1110
- onClose: onCancel
1111
- }
1112
- );
1113
- }
1114
- function getOrigin(url) {
1115
- try {
1116
- return new URL(url).origin;
1117
- } catch (e) {
1118
- return url;
1119
- }
1120
- }
1121
- var ExternalConfirmationRenderer_default = ExternalConfirmationRenderer;
1122
-
1123
- // ../renderers/src/FormRenderer.tsx
1124
- import { jsx as jsx29 } from "react/jsx-runtime";
1125
- var FormRenderer = {
1126
- canRenderType: "form",
1127
- render: ({ children, margin }) => /* @__PURE__ */ jsx29("div", { className: getMargin(margin), children })
1128
- };
1129
- var FormRenderer_default = FormRenderer;
1059
+ // ../renderers/src/FormRenderer.tsx
1060
+ import { jsx as jsx28 } from "react/jsx-runtime";
1061
+ var FormRenderer = {
1062
+ canRenderType: "form",
1063
+ render: ({ children, margin }) => /* @__PURE__ */ jsx28("div", { className: getMargin(margin), children })
1064
+ };
1065
+ var FormRenderer_default = FormRenderer;
1130
1066
 
1131
1067
  // ../renderers/src/FormSectionRenderer.tsx
1132
- import { Header as Header3 } from "@transferwise/components";
1133
- import { jsx as jsx30, jsxs as jsxs7 } from "react/jsx-runtime";
1068
+ import { Header } from "@transferwise/components";
1069
+ import { jsx as jsx29, jsxs as jsxs5 } from "react/jsx-runtime";
1134
1070
  var FormSectionRenderer = {
1135
1071
  canRenderType: "form-section",
1136
- render: ({ title, description, children }) => /* @__PURE__ */ jsxs7("fieldset", { children: [
1137
- title && /* @__PURE__ */ jsx30(
1138
- Header3,
1072
+ render: ({ title, description, children }) => /* @__PURE__ */ jsxs5("fieldset", { children: [
1073
+ title && /* @__PURE__ */ jsx29(
1074
+ Header,
1139
1075
  {
1140
1076
  as: "h2",
1141
1077
  title
1142
1078
  }
1143
1079
  ),
1144
- description && /* @__PURE__ */ jsx30("p", { children: description }),
1080
+ description && /* @__PURE__ */ jsx29("p", { children: description }),
1145
1081
  children
1146
1082
  ] })
1147
1083
  };
@@ -1149,18 +1085,18 @@ var FormSectionRenderer_default = FormSectionRenderer;
1149
1085
 
1150
1086
  // ../renderers/src/HeadingRenderer.tsx
1151
1087
  import { Display, Title } from "@transferwise/components";
1152
- import { jsx as jsx31 } from "react/jsx-runtime";
1088
+ import { jsx as jsx30 } from "react/jsx-runtime";
1153
1089
  var HeadingRenderer = {
1154
1090
  canRenderType: "heading",
1155
- render: (props) => /* @__PURE__ */ jsx31(Heading, __spreadValues({}, props))
1091
+ render: (props) => /* @__PURE__ */ jsx30(Heading, __spreadValues({}, props))
1156
1092
  };
1157
1093
  function Heading(props) {
1158
1094
  const { text, size, align, margin, control } = props;
1159
1095
  const className = getTextAlignmentAndMargin({ align, margin });
1160
- return control === "display" ? /* @__PURE__ */ jsx31(DisplayHeading, { size, text, className }) : /* @__PURE__ */ jsx31(StandardHeading, { size, text, className });
1096
+ return control === "display" ? /* @__PURE__ */ jsx30(DisplayHeading, { size, text, className }) : /* @__PURE__ */ jsx30(StandardHeading, { size, text, className });
1161
1097
  }
1162
1098
  function DisplayHeading({ size, text, className }) {
1163
- return /* @__PURE__ */ jsx31(Display, { type: getDisplayType(size), className, children: text });
1099
+ return /* @__PURE__ */ jsx30(Display, { type: getDisplayType(size), className, children: text });
1164
1100
  }
1165
1101
  var getDisplayType = (size) => {
1166
1102
  switch (size) {
@@ -1176,7 +1112,7 @@ var getDisplayType = (size) => {
1176
1112
  }
1177
1113
  };
1178
1114
  function StandardHeading({ size, text, className }) {
1179
- return /* @__PURE__ */ jsx31(Title, { type: getTitleTypeBySize(size), className, children: text });
1115
+ return /* @__PURE__ */ jsx30(Title, { type: getTitleTypeBySize(size), className, children: text });
1180
1116
  }
1181
1117
  var getTitleTypeBySize = (size) => {
1182
1118
  var _a;
@@ -1193,7 +1129,7 @@ var HeadingRenderer_default = HeadingRenderer;
1193
1129
 
1194
1130
  // ../renderers/src/ImageRenderer/UrlImage.tsx
1195
1131
  import { Image } from "@transferwise/components";
1196
- import { useEffect as useEffect4, useState as useState4 } from "react";
1132
+ import { useEffect as useEffect4, useState as useState3 } from "react";
1197
1133
 
1198
1134
  // ../renderers/src/utils/api-utils.ts
1199
1135
  function isRelativePath(url = "") {
@@ -1203,7 +1139,7 @@ function isRelativePath(url = "") {
1203
1139
  }
1204
1140
 
1205
1141
  // ../renderers/src/ImageRenderer/UrlImage.tsx
1206
- import { jsx as jsx32 } from "react/jsx-runtime";
1142
+ import { jsx as jsx31 } from "react/jsx-runtime";
1207
1143
  function UrlImage({
1208
1144
  accessibilityDescription,
1209
1145
  align,
@@ -1212,13 +1148,13 @@ function UrlImage({
1212
1148
  uri,
1213
1149
  httpClient
1214
1150
  }) {
1215
- const [imageSource, setImageSource] = useState4("");
1151
+ const [imageSource, setImageSource] = useState3("");
1216
1152
  useEffect4(() => {
1217
1153
  if (!uri.startsWith("urn:")) {
1218
1154
  void getImageSource(httpClient, uri).then(setImageSource);
1219
1155
  }
1220
1156
  }, [uri, httpClient]);
1221
- return /* @__PURE__ */ jsx32("div", { className: `df-image ${align} ${size || "md"}`, children: /* @__PURE__ */ jsx32(
1157
+ return /* @__PURE__ */ jsx31("div", { className: `df-image ${align} ${size || "md"}`, children: /* @__PURE__ */ jsx31(
1222
1158
  Image,
1223
1159
  {
1224
1160
  className: `img-responsive ${getMargin(margin)}`,
@@ -1262,7 +1198,7 @@ var getImageSource = async (httpClient, imageUrl) => {
1262
1198
  };
1263
1199
 
1264
1200
  // ../renderers/src/ImageRenderer/UrnFlagImage.tsx
1265
- import { jsx as jsx33 } from "react/jsx-runtime";
1201
+ import { jsx as jsx32 } from "react/jsx-runtime";
1266
1202
  var maxFlagSize = 600;
1267
1203
  function UrnFlagImage({
1268
1204
  accessibilityDescription,
@@ -1271,7 +1207,7 @@ function UrnFlagImage({
1271
1207
  size,
1272
1208
  uri
1273
1209
  }) {
1274
- return /* @__PURE__ */ jsx33("div", { className: `df-image ${align} ${size || "md"} ${getMargin(margin)}`, children: /* @__PURE__ */ jsx33(UrnFlag, { size: maxFlagSize, urn: uri, accessibilityDescription }) });
1210
+ return /* @__PURE__ */ jsx32("div", { className: `df-image ${align} ${size || "md"} ${getMargin(margin)}`, children: /* @__PURE__ */ jsx32(UrnFlag, { size: maxFlagSize, urn: uri, accessibilityDescription }) });
1275
1211
  }
1276
1212
 
1277
1213
  // ../renderers/src/ImageRenderer/UrnIllustration.tsx
@@ -1279,7 +1215,7 @@ import {
1279
1215
  Illustration,
1280
1216
  isIllustrationSupport3D
1281
1217
  } from "@wise/art";
1282
- import { useState as useState5 } from "react";
1218
+ import { useState as useState4 } from "react";
1283
1219
 
1284
1220
  // ../renderers/src/ImageRenderer/isAnimated.ts
1285
1221
  var isAnimated = (uri) => {
@@ -1290,7 +1226,7 @@ var isAnimated = (uri) => {
1290
1226
  // ../renderers/src/ImageRenderer/SafeIllustration3D.tsx
1291
1227
  import { Illustration3D } from "@wise/art";
1292
1228
  import { Component } from "react";
1293
- import { jsx as jsx34 } from "react/jsx-runtime";
1229
+ import { jsx as jsx33 } from "react/jsx-runtime";
1294
1230
  var Illustration3DErrorBoundary = class extends Component {
1295
1231
  constructor(props) {
1296
1232
  super(props);
@@ -1314,12 +1250,12 @@ var SafeIllustration3D = ({
1314
1250
  size,
1315
1251
  onError
1316
1252
  }) => {
1317
- return /* @__PURE__ */ jsx34(Illustration3DErrorBoundary, { onError, children: /* @__PURE__ */ jsx34(Illustration3D, { name, size }) });
1253
+ return /* @__PURE__ */ jsx33(Illustration3DErrorBoundary, { onError, children: /* @__PURE__ */ jsx33(Illustration3D, { name, size }) });
1318
1254
  };
1319
1255
  var SafeIllustration3D_default = SafeIllustration3D;
1320
1256
 
1321
1257
  // ../renderers/src/ImageRenderer/UrnIllustration.tsx
1322
- import { jsx as jsx35 } from "react/jsx-runtime";
1258
+ import { jsx as jsx34 } from "react/jsx-runtime";
1323
1259
  var urnPrefix = "urn:wise:illustrations:";
1324
1260
  var isUrnIllustration = (uri) => uri.startsWith(urnPrefix);
1325
1261
  function UrnIllustration({
@@ -1329,12 +1265,12 @@ function UrnIllustration({
1329
1265
  size,
1330
1266
  uri
1331
1267
  }) {
1332
- const [has3DFailed, setHas3DFailed] = useState5(false);
1268
+ const [has3DFailed, setHas3DFailed] = useState4(false);
1333
1269
  const illustrationSize = getIllustrationSize(size);
1334
1270
  const illustrationName = getIllustrationName(uri);
1335
1271
  const illustration3DName = getIllustration3DName(uri);
1336
1272
  if (illustration3DName && isAnimated(uri) && !has3DFailed) {
1337
- return /* @__PURE__ */ jsx35("div", { className: `df-image ${align} ${getMargin(margin)}`, children: /* @__PURE__ */ jsx35(
1273
+ return /* @__PURE__ */ jsx34("div", { className: `df-image ${align} ${getMargin(margin)}`, children: /* @__PURE__ */ jsx34(
1338
1274
  SafeIllustration3D_default,
1339
1275
  {
1340
1276
  name: illustration3DName,
@@ -1343,7 +1279,7 @@ function UrnIllustration({
1343
1279
  }
1344
1280
  ) });
1345
1281
  }
1346
- return /* @__PURE__ */ jsx35("div", { className: `df-image ${align} ${getMargin(margin)}`, children: /* @__PURE__ */ jsx35(
1282
+ return /* @__PURE__ */ jsx34("div", { className: `df-image ${align} ${getMargin(margin)}`, children: /* @__PURE__ */ jsx34(
1347
1283
  Illustration,
1348
1284
  {
1349
1285
  className: "df-illustration",
@@ -1363,32 +1299,32 @@ var getIllustration3DName = (uri) => {
1363
1299
  };
1364
1300
 
1365
1301
  // ../renderers/src/ImageRenderer/UrnImage.tsx
1366
- import { jsx as jsx36 } from "react/jsx-runtime";
1302
+ import { jsx as jsx35 } from "react/jsx-runtime";
1367
1303
  var isUrnImage = (uri) => uri.startsWith("urn:");
1368
1304
  function UrnImage(props) {
1369
1305
  const { uri } = props;
1370
1306
  if (isUrnIllustration(uri)) {
1371
- return /* @__PURE__ */ jsx36(UrnIllustration, __spreadValues({}, props));
1307
+ return /* @__PURE__ */ jsx35(UrnIllustration, __spreadValues({}, props));
1372
1308
  }
1373
1309
  if (isUrnFlag(uri)) {
1374
- return /* @__PURE__ */ jsx36(UrnFlagImage, __spreadValues({}, props));
1310
+ return /* @__PURE__ */ jsx35(UrnFlagImage, __spreadValues({}, props));
1375
1311
  }
1376
1312
  return null;
1377
1313
  }
1378
1314
 
1379
1315
  // ../renderers/src/ImageRenderer/ImageRenderer.tsx
1380
- import { jsx as jsx37 } from "react/jsx-runtime";
1316
+ import { jsx as jsx36 } from "react/jsx-runtime";
1381
1317
  var ImageRenderer = {
1382
1318
  canRenderType: "image",
1383
- render: (props) => isUrnImage(props.uri) ? /* @__PURE__ */ jsx37(UrnImage, __spreadValues({}, props)) : /* @__PURE__ */ jsx37(UrlImage, __spreadValues({}, props))
1319
+ render: (props) => isUrnImage(props.uri) ? /* @__PURE__ */ jsx36(UrnImage, __spreadValues({}, props)) : /* @__PURE__ */ jsx36(UrlImage, __spreadValues({}, props))
1384
1320
  };
1385
1321
 
1386
1322
  // ../renderers/src/ImageRenderer/index.tsx
1387
1323
  var ImageRenderer_default = ImageRenderer;
1388
1324
 
1389
1325
  // ../renderers/src/InstructionsRenderer.tsx
1390
- import { Header as Header4, InstructionsList } from "@transferwise/components";
1391
- import { jsx as jsx38, jsxs as jsxs8 } from "react/jsx-runtime";
1326
+ import { Header as Header2, InstructionsList } from "@transferwise/components";
1327
+ import { jsx as jsx37, jsxs as jsxs6 } from "react/jsx-runtime";
1392
1328
  var doContext = ["positive", "neutral"];
1393
1329
  var dontContext = ["warning", "negative"];
1394
1330
  var InstructionsRenderer = {
@@ -1396,9 +1332,9 @@ var InstructionsRenderer = {
1396
1332
  render: ({ items, margin, title }) => {
1397
1333
  const dos = items.filter((item) => doContext.includes(item.context)).map(({ text }) => text);
1398
1334
  const donts = items.filter((item) => dontContext.includes(item.context)).map(({ text }) => text);
1399
- return /* @__PURE__ */ jsxs8("div", { className: getMargin(margin), children: [
1400
- title ? /* @__PURE__ */ jsx38(Header4, { title }) : null,
1401
- /* @__PURE__ */ jsx38(InstructionsList, { dos, donts })
1335
+ return /* @__PURE__ */ jsxs6("div", { className: getMargin(margin), children: [
1336
+ title ? /* @__PURE__ */ jsx37(Header2, { title }) : null,
1337
+ /* @__PURE__ */ jsx37(InstructionsList, { dos, donts })
1402
1338
  ] });
1403
1339
  }
1404
1340
  };
@@ -1430,7 +1366,7 @@ function pick(obj, ...keys) {
1430
1366
  }
1431
1367
 
1432
1368
  // ../renderers/src/IntegerInputRenderer.tsx
1433
- import { jsx as jsx39 } from "react/jsx-runtime";
1369
+ import { jsx as jsx38 } from "react/jsx-runtime";
1434
1370
  var IntegerInputRenderer = {
1435
1371
  canRenderType: "input-integer",
1436
1372
  render: (props) => {
@@ -1445,7 +1381,7 @@ var IntegerInputRenderer = {
1445
1381
  "maximum",
1446
1382
  "minimum"
1447
1383
  );
1448
- return /* @__PURE__ */ jsx39(
1384
+ return /* @__PURE__ */ jsx38(
1449
1385
  FieldInput_default,
1450
1386
  {
1451
1387
  id,
@@ -1453,7 +1389,7 @@ var IntegerInputRenderer = {
1453
1389
  description,
1454
1390
  validation: validationState,
1455
1391
  help,
1456
- children: /* @__PURE__ */ jsx39(InputGroup, { addonStart: getInputGroupAddonStart(media), children: /* @__PURE__ */ jsx39(
1392
+ children: /* @__PURE__ */ jsx38(InputGroup, { addonStart: getInputGroupAddonStart(media), children: /* @__PURE__ */ jsx38(
1457
1393
  Input,
1458
1394
  __spreadValues({
1459
1395
  id,
@@ -1475,84 +1411,12 @@ var IntegerInputRenderer = {
1475
1411
  };
1476
1412
  var IntegerInputRenderer_default = IntegerInputRenderer;
1477
1413
 
1478
- // ../renderers/src/ListRenderer.tsx
1479
- import { Body, Header as Header5 } from "@transferwise/components";
1480
- import classNames3 from "classnames";
1481
- import { jsx as jsx40, jsxs as jsxs9 } from "react/jsx-runtime";
1482
- var ListRenderer = {
1483
- canRenderType: "list",
1484
- render: ({ callToAction, control, margin, items, title }) => /* @__PURE__ */ jsxs9("div", { className: getMargin(margin), children: [
1485
- (title || callToAction) && /* @__PURE__ */ jsx40(Header5, { as: "h2", title: title != null ? title : "", action: getListAction(callToAction) }),
1486
- items.map((props) => /* @__PURE__ */ jsx40(DesignSystemListItem, __spreadProps(__spreadValues({}, props), { control }), props.title))
1487
- ] })
1488
- };
1489
- var DesignSystemListItem = ({
1490
- title,
1491
- description,
1492
- supportingValues,
1493
- icon,
1494
- image,
1495
- media,
1496
- control,
1497
- tag
1498
- }) => /* @__PURE__ */ jsx40(
1499
- "label",
1500
- {
1501
- className: classNames3("np-option p-a-2", {
1502
- "np-option__sm-media": true,
1503
- "np-option__container-aligned": true
1504
- }),
1505
- children: /* @__PURE__ */ jsxs9("div", { className: "media", children: [
1506
- icon || image || media ? /* @__PURE__ */ jsx40("div", { className: "media-left", children: /* @__PURE__ */ jsx40(
1507
- ListItemMedia,
1508
- {
1509
- icon,
1510
- media,
1511
- preferAvatar: control === "with-avatar" || tag === "with-avatar"
1512
- }
1513
- ) }) : null,
1514
- /* @__PURE__ */ jsxs9("div", { className: "media-body", children: [
1515
- /* @__PURE__ */ jsxs9("div", { className: "d-flex justify-content-between", children: [
1516
- /* @__PURE__ */ jsx40("h4", { className: "np-text-body-large-bold text-primary np-option__title", children: title }),
1517
- /* @__PURE__ */ jsx40("h4", { className: "np-text-body-large-bold text-primary np-option__title", children: supportingValues == null ? void 0 : supportingValues.value })
1518
- ] }),
1519
- /* @__PURE__ */ jsxs9("div", { className: "d-flex justify-content-between", children: [
1520
- /* @__PURE__ */ jsx40(Body, { className: "d-block np-option__body", children: description }),
1521
- /* @__PURE__ */ jsx40(Body, { className: "d-block np-option__body", children: supportingValues == null ? void 0 : supportingValues.subvalue })
1522
- ] })
1523
- ] })
1524
- ] })
1525
- },
1526
- title
1527
- );
1528
- var ListItemMedia = ({
1529
- icon,
1530
- media,
1531
- preferAvatar
1532
- }) => {
1533
- if (icon) {
1534
- return /* @__PURE__ */ jsx40("div", { className: "circle circle-sm text-primary circle-inverse", children: /* @__PURE__ */ jsx40(OptionMedia, { media, preferAvatar }) });
1535
- }
1536
- return /* @__PURE__ */ jsx40("div", { className: "np-option__no-media-circle", children: /* @__PURE__ */ jsx40(OptionMedia, { media, preferAvatar }) });
1537
- };
1538
- var getListAction = (callToAction) => {
1539
- if (callToAction) {
1540
- return __spreadValues({
1541
- "aria-label": callToAction.accessibilityDescription,
1542
- text: callToAction.title,
1543
- onClick: callToAction.onClick
1544
- }, callToAction.type === "link" ? { href: callToAction.href, target: "_blank" } : {});
1545
- }
1546
- return void 0;
1547
- };
1548
- var ListRenderer_default = ListRenderer;
1549
-
1550
1414
  // ../renderers/src/LoadingIndicatorRenderer.tsx
1551
1415
  import { Loader } from "@transferwise/components";
1552
- import { jsx as jsx41 } from "react/jsx-runtime";
1416
+ import { jsx as jsx39 } from "react/jsx-runtime";
1553
1417
  var LoadingIndicatorRenderer = {
1554
1418
  canRenderType: "loading-indicator",
1555
- render: ({ margin, size }) => /* @__PURE__ */ jsx41(
1419
+ render: ({ margin, size }) => /* @__PURE__ */ jsx39(
1556
1420
  Loader,
1557
1421
  {
1558
1422
  size,
@@ -1565,10 +1429,10 @@ var LoadingIndicatorRenderer_default = LoadingIndicatorRenderer;
1565
1429
 
1566
1430
  // ../renderers/src/MarkdownRenderer.tsx
1567
1431
  import { Markdown as Markdown3 } from "@transferwise/components";
1568
- import { jsx as jsx42 } from "react/jsx-runtime";
1432
+ import { jsx as jsx40 } from "react/jsx-runtime";
1569
1433
  var MarkdownRenderer = {
1570
1434
  canRenderType: "markdown",
1571
- render: ({ content, align, margin, size }) => /* @__PURE__ */ jsx42("div", { className: getTextAlignmentAndMargin({ align, margin }), children: /* @__PURE__ */ jsx42(
1435
+ render: ({ content, align, margin, size }) => /* @__PURE__ */ jsx40("div", { className: getTextAlignmentAndMargin({ align, margin }), children: /* @__PURE__ */ jsx40(
1572
1436
  Markdown3,
1573
1437
  {
1574
1438
  className: ["xs", "sm"].includes(size) ? "np-text-body-default" : "np-text-body-large",
@@ -1581,19 +1445,19 @@ var MarkdownRenderer_default = MarkdownRenderer;
1581
1445
 
1582
1446
  // ../renderers/src/ModalLayoutRenderer.tsx
1583
1447
  import { Button as Button4, Modal as Modal2 } from "@transferwise/components";
1584
- import { useState as useState6 } from "react";
1585
- import { jsx as jsx43, jsxs as jsxs10 } from "react/jsx-runtime";
1448
+ import { useState as useState5 } from "react";
1449
+ import { jsx as jsx41, jsxs as jsxs7 } from "react/jsx-runtime";
1586
1450
  var ModalLayoutRenderer = {
1587
1451
  canRenderType: "modal-layout",
1588
- render: (props) => /* @__PURE__ */ jsx43(DFModal, __spreadValues({}, props))
1452
+ render: (props) => /* @__PURE__ */ jsx41(DFModal, __spreadValues({}, props))
1589
1453
  };
1590
1454
  var ModalLayoutRenderer_default = ModalLayoutRenderer;
1591
1455
  function DFModal({ content, margin, trigger }) {
1592
- const [visible, setVisible] = useState6(false);
1456
+ const [visible, setVisible] = useState5(false);
1593
1457
  const { children, title } = content;
1594
- return /* @__PURE__ */ jsxs10("div", { className: getMargin(margin), children: [
1595
- /* @__PURE__ */ jsx43(Button4, { v2: true, priority: "tertiary", block: true, onClick: () => setVisible(true), children: trigger.title }),
1596
- /* @__PURE__ */ jsx43(
1458
+ return /* @__PURE__ */ jsxs7("div", { className: getMargin(margin), children: [
1459
+ /* @__PURE__ */ jsx41(Button4, { v2: true, priority: "tertiary", block: true, onClick: () => setVisible(true), children: trigger.title }),
1460
+ /* @__PURE__ */ jsx41(
1597
1461
  Modal2,
1598
1462
  {
1599
1463
  scroll: "content",
@@ -1609,25 +1473,64 @@ function DFModal({ content, margin, trigger }) {
1609
1473
 
1610
1474
  // ../renderers/src/ModalRenderer.tsx
1611
1475
  import { Modal as Modal3 } from "@transferwise/components";
1612
- import { jsx as jsx44 } from "react/jsx-runtime";
1476
+ import { jsx as jsx42 } from "react/jsx-runtime";
1613
1477
  var ModalRenderer = {
1614
1478
  canRenderType: "modal",
1615
1479
  render: ({ title, children, open, onClose }) => {
1616
- return /* @__PURE__ */ jsx44(Modal3, { open, title, body: children, onClose });
1480
+ return /* @__PURE__ */ jsx42(Modal3, { open, title, body: children, onClose });
1617
1481
  }
1618
1482
  };
1619
1483
 
1620
1484
  // ../renderers/src/MoneyInputRenderer.tsx
1621
1485
  import { MoneyInput } from "@transferwise/components";
1622
1486
  import { useEffect as useEffect5 } from "react";
1623
- import { useIntl as useIntl6 } from "react-intl";
1624
- import { jsx as jsx45 } from "react/jsx-runtime";
1625
- var groupingTags2 = Object.keys(group_messages_default).filter((key) => key !== "all");
1626
- var MoneyInputRenderer = {
1627
- canRenderType: "money-input",
1628
- render: MoneyInputRendererComponent
1487
+
1488
+ // ../renderers/src/utils/grouping-utils.ts
1489
+ var getGroupsFromTags = (knownTags, items) => {
1490
+ return knownTags.map((tag) => {
1491
+ return { tag, items: items.filter((item) => {
1492
+ var _a;
1493
+ return (_a = item.tags) == null ? void 0 : _a.includes(tag);
1494
+ }) };
1495
+ }).filter((group) => group.items.length > 0);
1629
1496
  };
1630
- function MoneyInputRendererComponent(props) {
1497
+
1498
+ // ../renderers/src/MoneyInputRenderer.tsx
1499
+ import { useIntl as useIntl4 } from "react-intl";
1500
+
1501
+ // ../renderers/src/messages/group.messages.ts
1502
+ import { defineMessages as defineMessages4 } from "react-intl";
1503
+ var group_messages_default = defineMessages4({
1504
+ all: {
1505
+ id: "df.wise.group.all",
1506
+ defaultMessage: "All",
1507
+ description: "Label for the group of options that encompasses all options"
1508
+ },
1509
+ popular: {
1510
+ id: "df.wise.group.popular",
1511
+ defaultMessage: "Popular",
1512
+ description: "Label for the group of options that are tagged as popular"
1513
+ },
1514
+ recent: {
1515
+ id: "df.wise.group.recent",
1516
+ defaultMessage: "Recent",
1517
+ description: "Label for the group of options that are tagged as recent"
1518
+ },
1519
+ "currencies-with-account-details": {
1520
+ id: "df.wise.group.currencies-with-account-details",
1521
+ defaultMessage: "Currencies with account details",
1522
+ description: "Label for the group of options that are tagged as currencies with account details"
1523
+ }
1524
+ });
1525
+
1526
+ // ../renderers/src/MoneyInputRenderer.tsx
1527
+ import { jsx as jsx43 } from "react/jsx-runtime";
1528
+ var groupingTags = Object.keys(group_messages_default).filter((key) => key !== "all");
1529
+ var MoneyInputRenderer = {
1530
+ canRenderType: "money-input",
1531
+ render: MoneyInputRendererComponent
1532
+ };
1533
+ function MoneyInputRendererComponent(props) {
1631
1534
  var _a;
1632
1535
  const {
1633
1536
  uid,
@@ -1647,8 +1550,8 @@ function MoneyInputRendererComponent(props) {
1647
1550
  onCurrencyChange(0);
1648
1551
  }
1649
1552
  }, [selectedCurrencyIndex, onCurrencyChange, currencies.length]);
1650
- const { formatMessage } = useIntl6();
1651
- return /* @__PURE__ */ jsx45(
1553
+ const { formatMessage } = useIntl4();
1554
+ return /* @__PURE__ */ jsx43(
1652
1555
  FieldInput_default,
1653
1556
  {
1654
1557
  id: uid,
@@ -1656,7 +1559,7 @@ function MoneyInputRendererComponent(props) {
1656
1559
  description,
1657
1560
  validation: validationState,
1658
1561
  help,
1659
- children: /* @__PURE__ */ jsx45(
1562
+ children: /* @__PURE__ */ jsx43(
1660
1563
  MoneyInput,
1661
1564
  {
1662
1565
  amount: parseFloatOrNull(amountValue),
@@ -1685,7 +1588,7 @@ var parseFloatOrNull = (value) => {
1685
1588
  return Number.isNaN(parsed) ? null : parsed;
1686
1589
  };
1687
1590
  var mapCurrencies = (options, formatMessage) => {
1688
- const groupsFromTags = getGroupsFromTags(groupingTags2, options);
1591
+ const groupsFromTags = getGroupsFromTags(groupingTags, options);
1689
1592
  if (groupsFromTags.length > 0) {
1690
1593
  return [...groupsFromTags, { tag: "all", items: options }].flatMap(({ tag, items }) => {
1691
1594
  return [
@@ -1719,12 +1622,12 @@ function assertCurrencyCodeIsString(currencyCode) {
1719
1622
 
1720
1623
  // ../renderers/src/MultiSelectInputRenderer.tsx
1721
1624
  import { SelectInput, SelectInputOptionContent } from "@transferwise/components";
1722
- import { useState as useState7 } from "react";
1723
- import { useIntl as useIntl7 } from "react-intl";
1625
+ import { useState as useState6 } from "react";
1626
+ import { useIntl as useIntl5 } from "react-intl";
1724
1627
 
1725
1628
  // ../renderers/src/messages/multi-select.messages.ts
1726
- import { defineMessages as defineMessages6 } from "react-intl";
1727
- var multi_select_messages_default = defineMessages6({
1629
+ import { defineMessages as defineMessages5 } from "react-intl";
1630
+ var multi_select_messages_default = defineMessages5({
1728
1631
  summary: {
1729
1632
  id: "df.wise.MultiSelect.summary",
1730
1633
  defaultMessage: "{first} and {count} more",
@@ -1733,14 +1636,14 @@ var multi_select_messages_default = defineMessages6({
1733
1636
  });
1734
1637
 
1735
1638
  // ../renderers/src/MultiSelectInputRenderer.tsx
1736
- import { jsx as jsx46 } from "react/jsx-runtime";
1639
+ import { jsx as jsx44 } from "react/jsx-runtime";
1737
1640
  var MultiSelectInputRenderer = {
1738
1641
  canRenderType: "input-multi-select",
1739
- render: (props) => /* @__PURE__ */ jsx46(MultiSelectInputRendererComponent, __spreadValues({}, props))
1642
+ render: (props) => /* @__PURE__ */ jsx44(MultiSelectInputRendererComponent, __spreadValues({}, props))
1740
1643
  };
1741
1644
  function MultiSelectInputRendererComponent(props) {
1742
- const { formatMessage } = useIntl7();
1743
- const [stagedIndices, setStagedIndices] = useState7();
1645
+ const { formatMessage } = useIntl5();
1646
+ const [stagedIndices, setStagedIndices] = useState6();
1744
1647
  const {
1745
1648
  id,
1746
1649
  autoComplete,
@@ -1778,12 +1681,12 @@ function MultiSelectInputRendererComponent(props) {
1778
1681
  const contentProps = {
1779
1682
  title: option.title,
1780
1683
  description: option.description,
1781
- icon: /* @__PURE__ */ jsx46(OptionMedia, { media: option.media, preferAvatar: false })
1684
+ icon: /* @__PURE__ */ jsx44(OptionMedia, { media: option.media, preferAvatar: false })
1782
1685
  };
1783
- return /* @__PURE__ */ jsx46(SelectInputOptionContent, __spreadValues({}, contentProps));
1686
+ return /* @__PURE__ */ jsx44(SelectInputOptionContent, __spreadValues({}, contentProps));
1784
1687
  };
1785
1688
  const extraProps = { autoComplete };
1786
- return /* @__PURE__ */ jsx46(
1689
+ return /* @__PURE__ */ jsx44(
1787
1690
  FieldInput_default,
1788
1691
  {
1789
1692
  id,
@@ -1791,7 +1694,7 @@ function MultiSelectInputRendererComponent(props) {
1791
1694
  help,
1792
1695
  description,
1793
1696
  validation: validationState,
1794
- children: /* @__PURE__ */ jsx46(
1697
+ children: /* @__PURE__ */ jsx44(
1795
1698
  SelectInput,
1796
1699
  __spreadValues({
1797
1700
  id,
@@ -1834,9 +1737,9 @@ var MultiSelectInputRenderer_default = MultiSelectInputRenderer;
1834
1737
  import { Status, UploadInput } from "@transferwise/components";
1835
1738
 
1836
1739
  // ../renderers/src/components/UploadFieldInput.tsx
1740
+ var import_classnames3 = __toESM(require_classnames());
1837
1741
  import { InlineAlert as InlineAlert2 } from "@transferwise/components";
1838
- import classNames4 from "classnames";
1839
- import { jsx as jsx47, jsxs as jsxs11 } from "react/jsx-runtime";
1742
+ import { jsx as jsx45, jsxs as jsxs8 } from "react/jsx-runtime";
1840
1743
  function UploadFieldInput({
1841
1744
  id,
1842
1745
  children,
@@ -1845,18 +1748,18 @@ function UploadFieldInput({
1845
1748
  help,
1846
1749
  validation
1847
1750
  }) {
1848
- const labelContent = label && help ? /* @__PURE__ */ jsx47(LabelContentWithHelp, { text: label, help }) : label;
1751
+ const labelContent = label && help ? /* @__PURE__ */ jsx45(LabelContentWithHelp, { text: label, help }) : label;
1849
1752
  const descriptionId = description ? `${id}-description` : void 0;
1850
- return /* @__PURE__ */ jsxs11(
1753
+ return /* @__PURE__ */ jsxs8(
1851
1754
  "div",
1852
1755
  {
1853
- className: classNames4("form-group d-block", {
1756
+ className: (0, import_classnames3.default)("form-group d-block", {
1854
1757
  "has-error": (validation == null ? void 0 : validation.status) === "invalid"
1855
1758
  }),
1856
1759
  children: [
1857
- /* @__PURE__ */ jsx47("label", { htmlFor: id, className: "control-label", children: labelContent }),
1760
+ /* @__PURE__ */ jsx45("label", { htmlFor: id, className: "control-label", children: labelContent }),
1858
1761
  children,
1859
- (validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */ jsx47(InlineAlert2, { type: "negative", id: descriptionId, children: validation.message })
1762
+ (validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */ jsx45(InlineAlert2, { type: "negative", id: descriptionId, children: validation.message })
1860
1763
  ]
1861
1764
  }
1862
1765
  );
@@ -1891,7 +1794,7 @@ var getSizeLimit = (maxSize) => {
1891
1794
  };
1892
1795
 
1893
1796
  // ../renderers/src/MultiUploadInputRenderer.tsx
1894
- import { jsx as jsx48 } from "react/jsx-runtime";
1797
+ import { jsx as jsx46 } from "react/jsx-runtime";
1895
1798
  var MultiUploadInputRenderer = {
1896
1799
  canRenderType: "input-upload-multi",
1897
1800
  render: (props) => {
@@ -1916,7 +1819,7 @@ var MultiUploadInputRenderer = {
1916
1819
  };
1917
1820
  const onDeleteFile = async (fileId) => onRemoveFile(value.findIndex((file) => file.id === fileId));
1918
1821
  const descriptionId = description ? `${id}-description` : void 0;
1919
- return /* @__PURE__ */ jsx48(
1822
+ return /* @__PURE__ */ jsx46(
1920
1823
  UploadFieldInput_default,
1921
1824
  {
1922
1825
  id,
@@ -1924,7 +1827,7 @@ var MultiUploadInputRenderer = {
1924
1827
  description,
1925
1828
  validation: validationState,
1926
1829
  help,
1927
- children: /* @__PURE__ */ jsx48(
1830
+ children: /* @__PURE__ */ jsx46(
1928
1831
  UploadInput,
1929
1832
  {
1930
1833
  id,
@@ -1953,7 +1856,7 @@ var MultiUploadInputRenderer_default = MultiUploadInputRenderer;
1953
1856
 
1954
1857
  // ../renderers/src/NumberInputRenderer.tsx
1955
1858
  import { Input as Input2, InputGroup as InputGroup2 } from "@transferwise/components";
1956
- import { jsx as jsx49 } from "react/jsx-runtime";
1859
+ import { jsx as jsx47 } from "react/jsx-runtime";
1957
1860
  var NumberInputRenderer = {
1958
1861
  canRenderType: "input-number",
1959
1862
  render: (props) => {
@@ -1967,7 +1870,7 @@ var NumberInputRenderer = {
1967
1870
  "maximum",
1968
1871
  "minimum"
1969
1872
  );
1970
- return /* @__PURE__ */ jsx49(
1873
+ return /* @__PURE__ */ jsx47(
1971
1874
  FieldInput_default,
1972
1875
  {
1973
1876
  id,
@@ -1975,7 +1878,7 @@ var NumberInputRenderer = {
1975
1878
  description,
1976
1879
  validation: validationState,
1977
1880
  help,
1978
- children: /* @__PURE__ */ jsx49(InputGroup2, { addonStart: getInputGroupAddonStart(media), children: /* @__PURE__ */ jsx49(
1881
+ children: /* @__PURE__ */ jsx47(InputGroup2, { addonStart: getInputGroupAddonStart(media), children: /* @__PURE__ */ jsx47(
1979
1882
  Input2,
1980
1883
  __spreadValues({
1981
1884
  id,
@@ -1996,7 +1899,7 @@ var NumberInputRenderer = {
1996
1899
  var NumberInputRenderer_default = NumberInputRenderer;
1997
1900
 
1998
1901
  // ../renderers/src/ParagraphRenderer.tsx
1999
- import { useIntl as useIntl8 } from "react-intl";
1902
+ import { useIntl as useIntl6 } from "react-intl";
2000
1903
 
2001
1904
  // ../renderers/src/hooks/useSnackBarIfAvailable.ts
2002
1905
  import { SnackbarContext } from "@transferwise/components";
@@ -2008,12 +1911,12 @@ function useSnackBarIfAvailable() {
2008
1911
  }
2009
1912
 
2010
1913
  // ../renderers/src/ParagraphRenderer.tsx
1914
+ var import_classnames4 = __toESM(require_classnames());
2011
1915
  import { Button as Button5, Input as Input3 } from "@transferwise/components";
2012
- import classNames5 from "classnames";
2013
1916
 
2014
1917
  // ../renderers/src/messages/paragraph.messages.ts
2015
- import { defineMessages as defineMessages7 } from "react-intl";
2016
- var paragraph_messages_default = defineMessages7({
1918
+ import { defineMessages as defineMessages6 } from "react-intl";
1919
+ var paragraph_messages_default = defineMessages6({
2017
1920
  copy: {
2018
1921
  id: "df.wise.DynamicParagraph.copy",
2019
1922
  defaultMessage: "Copy",
@@ -2027,14 +1930,14 @@ var paragraph_messages_default = defineMessages7({
2027
1930
  });
2028
1931
 
2029
1932
  // ../renderers/src/ParagraphRenderer.tsx
2030
- import { jsx as jsx50, jsxs as jsxs12 } from "react/jsx-runtime";
1933
+ import { jsx as jsx48, jsxs as jsxs9 } from "react/jsx-runtime";
2031
1934
  var ParagraphRenderer = {
2032
1935
  canRenderType: "paragraph",
2033
- render: (props) => /* @__PURE__ */ jsx50(Paragraph, __spreadValues({}, props))
1936
+ render: (props) => /* @__PURE__ */ jsx48(Paragraph, __spreadValues({}, props))
2034
1937
  };
2035
1938
  function Paragraph({ align, control, margin, size, text }) {
2036
1939
  const className = getTextAlignmentAndMargin({ align, margin });
2037
- return control === "copyable" ? /* @__PURE__ */ jsx50(CopyableParagraph, { className, align, text }) : /* @__PURE__ */ jsx50(
1940
+ return control === "copyable" ? /* @__PURE__ */ jsx48(CopyableParagraph, { className, align, text }) : /* @__PURE__ */ jsx48(
2038
1941
  "p",
2039
1942
  {
2040
1943
  className: `${["xs", "sm"].includes(size) ? "np-text-body-default" : "np-text-body-large"} ${className}`,
@@ -2047,38 +1950,38 @@ function CopyableParagraph({
2047
1950
  align,
2048
1951
  className
2049
1952
  }) {
2050
- const { formatMessage } = useIntl8();
1953
+ const { formatMessage } = useIntl6();
2051
1954
  const createSnackbar = useSnackBarIfAvailable();
2052
1955
  const copy = () => {
2053
1956
  navigator.clipboard.writeText(text).then(() => createSnackbar({ text: formatMessage(paragraph_messages_default.copied) })).catch(() => {
2054
1957
  });
2055
1958
  };
2056
1959
  const inputAlignmentClasses = getTextAlignmentAndMargin({ align, margin: "sm" });
2057
- return /* @__PURE__ */ jsxs12("div", { className, children: [
2058
- /* @__PURE__ */ jsx50(
1960
+ return /* @__PURE__ */ jsxs9("div", { className, children: [
1961
+ /* @__PURE__ */ jsx48(
2059
1962
  Input3,
2060
1963
  {
2061
1964
  type: "text",
2062
1965
  value: text,
2063
1966
  readOnly: true,
2064
- className: classNames5("text-ellipsis", inputAlignmentClasses)
1967
+ className: (0, import_classnames4.default)("text-ellipsis", inputAlignmentClasses)
2065
1968
  }
2066
1969
  ),
2067
- /* @__PURE__ */ jsx50(Button5, { v2: true, block: true, onClick: copy, children: formatMessage(paragraph_messages_default.copy) })
1970
+ /* @__PURE__ */ jsx48(Button5, { v2: true, block: true, onClick: copy, children: formatMessage(paragraph_messages_default.copy) })
2068
1971
  ] });
2069
1972
  }
2070
1973
  var ParagraphRenderer_default = ParagraphRenderer;
2071
1974
 
2072
1975
  // ../renderers/src/RepeatableRenderer.tsx
2073
- import { Button as Button6, Header as Header6, InlineAlert as InlineAlert3, Modal as Modal4, NavigationOption as NavigationOption2 } from "@transferwise/components";
1976
+ var import_classnames5 = __toESM(require_classnames());
1977
+ import { Button as Button6, Header as Header3, InlineAlert as InlineAlert3, Modal as Modal4, NavigationOption } from "@transferwise/components";
2074
1978
  import { Plus } from "@transferwise/icons";
2075
- import classNames6 from "classnames";
2076
- import { useState as useState8 } from "react";
2077
- import { useIntl as useIntl9 } from "react-intl";
1979
+ import { useState as useState7 } from "react";
1980
+ import { useIntl as useIntl7 } from "react-intl";
2078
1981
 
2079
1982
  // ../renderers/src/messages/repeatable.messages.ts
2080
- import { defineMessages as defineMessages8 } from "react-intl";
2081
- var repeatable_messages_default = defineMessages8({
1983
+ import { defineMessages as defineMessages7 } from "react-intl";
1984
+ var repeatable_messages_default = defineMessages7({
2082
1985
  addItemTitle: {
2083
1986
  id: "df.wise.ArraySchema.addItemTitle",
2084
1987
  defaultMessage: "Add Item",
@@ -2102,10 +2005,10 @@ var repeatable_messages_default = defineMessages8({
2102
2005
  });
2103
2006
 
2104
2007
  // ../renderers/src/RepeatableRenderer.tsx
2105
- import { Fragment as Fragment4, jsx as jsx51, jsxs as jsxs13 } from "react/jsx-runtime";
2008
+ import { Fragment as Fragment2, jsx as jsx49, jsxs as jsxs10 } from "react/jsx-runtime";
2106
2009
  var RepeatableRenderer = {
2107
2010
  canRenderType: "repeatable",
2108
- render: (props) => /* @__PURE__ */ jsx51(Repeatable, __spreadValues({}, props))
2011
+ render: (props) => /* @__PURE__ */ jsx49(Repeatable, __spreadValues({}, props))
2109
2012
  };
2110
2013
  function Repeatable(props) {
2111
2014
  const {
@@ -2121,8 +2024,8 @@ function Repeatable(props) {
2121
2024
  onSave,
2122
2025
  onRemove
2123
2026
  } = props;
2124
- const { formatMessage } = useIntl9();
2125
- const [openModalType, setOpenModalType] = useState8(null);
2027
+ const { formatMessage } = useIntl7();
2028
+ const [openModalType, setOpenModalType] = useState7(null);
2126
2029
  const onAddItem = () => {
2127
2030
  onAdd();
2128
2031
  setOpenModalType("add");
@@ -2144,40 +2047,40 @@ function Repeatable(props) {
2144
2047
  const onCancelEdit = () => {
2145
2048
  setOpenModalType(null);
2146
2049
  };
2147
- return /* @__PURE__ */ jsxs13(Fragment4, { children: [
2148
- title && /* @__PURE__ */ jsx51(Header6, { title }),
2149
- description && /* @__PURE__ */ jsx51("p", { children: description }),
2150
- /* @__PURE__ */ jsxs13(
2050
+ return /* @__PURE__ */ jsxs10(Fragment2, { children: [
2051
+ title && /* @__PURE__ */ jsx49(Header3, { title }),
2052
+ description && /* @__PURE__ */ jsx49("p", { children: description }),
2053
+ /* @__PURE__ */ jsxs10(
2151
2054
  "div",
2152
2055
  {
2153
- className: classNames6("form-group", {
2056
+ className: (0, import_classnames5.default)("form-group", {
2154
2057
  "has-error": (validationState == null ? void 0 : validationState.status) === "invalid"
2155
2058
  }),
2156
2059
  children: [
2157
- items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ jsx51(ItemSummaryOption, { item, onClick: () => onEditItem(index) }, item.id)),
2158
- /* @__PURE__ */ jsx51(
2159
- NavigationOption2,
2060
+ items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ jsx49(ItemSummaryOption, { item, onClick: () => onEditItem(index) }, item.id)),
2061
+ /* @__PURE__ */ jsx49(
2062
+ NavigationOption,
2160
2063
  {
2161
- media: /* @__PURE__ */ jsx51(Plus, {}),
2064
+ media: /* @__PURE__ */ jsx49(Plus, {}),
2162
2065
  title: addItemTitle || formatMessage(repeatable_messages_default.addItemTitle),
2163
2066
  showMediaAtAllSizes: true,
2164
2067
  onClick: () => onAddItem()
2165
2068
  }
2166
2069
  ),
2167
- (validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ jsx51(InlineAlert3, { type: "negative", children: validationState.message })
2070
+ (validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ jsx49(InlineAlert3, { type: "negative", children: validationState.message })
2168
2071
  ]
2169
2072
  }
2170
2073
  ),
2171
- /* @__PURE__ */ jsx51(
2074
+ /* @__PURE__ */ jsx49(
2172
2075
  Modal4,
2173
2076
  {
2174
2077
  open: openModalType !== null,
2175
2078
  title: (openModalType === "add" ? addItemTitle : editItemTitle) || formatMessage(repeatable_messages_default.addItemTitle),
2176
- body: /* @__PURE__ */ jsxs13(Fragment4, { children: [
2177
- /* @__PURE__ */ jsx51("div", { className: "m-b-2", children: editableItem }),
2178
- /* @__PURE__ */ jsxs13("div", { children: [
2179
- /* @__PURE__ */ jsx51(Button6, { priority: "primary", block: true, className: "m-b-2", onClick: () => onSaveItem(), children: formatMessage(repeatable_messages_default.addItem) }),
2180
- /* @__PURE__ */ jsx51(
2079
+ body: /* @__PURE__ */ jsxs10(Fragment2, { children: [
2080
+ /* @__PURE__ */ jsx49("div", { className: "m-b-2", children: editableItem }),
2081
+ /* @__PURE__ */ jsxs10("div", { children: [
2082
+ /* @__PURE__ */ jsx49(Button6, { priority: "primary", block: true, className: "m-b-2", onClick: () => onSaveItem(), children: formatMessage(repeatable_messages_default.addItem) }),
2083
+ /* @__PURE__ */ jsx49(
2181
2084
  Button6,
2182
2085
  {
2183
2086
  v2: true,
@@ -2199,10 +2102,10 @@ function ItemSummaryOption({
2199
2102
  item,
2200
2103
  onClick
2201
2104
  }) {
2202
- return /* @__PURE__ */ jsx51(
2203
- NavigationOption2,
2105
+ return /* @__PURE__ */ jsx49(
2106
+ NavigationOption,
2204
2107
  {
2205
- media: /* @__PURE__ */ jsx51(OptionMedia, { media: item.media, preferAvatar: false }),
2108
+ media: /* @__PURE__ */ jsx49(OptionMedia, { media: item.media, preferAvatar: false }),
2206
2109
  title: item.title,
2207
2110
  content: item.description,
2208
2111
  showMediaAtAllSizes: true,
@@ -2213,96 +2116,14 @@ function ItemSummaryOption({
2213
2116
  }
2214
2117
  var RepeatableRenderer_default = RepeatableRenderer;
2215
2118
 
2216
- // ../renderers/src/ReviewRenderer.tsx
2217
- import { DefinitionList } from "@transferwise/components";
2218
-
2219
- // ../renderers/src/components/Header.tsx
2220
- import { Header as DSHeader } from "@transferwise/components";
2221
- import { jsx as jsx52 } from "react/jsx-runtime";
2222
- var Header7 = ({ title, callToAction }) => (title || callToAction) && /* @__PURE__ */ jsx52(DSHeader, { title: title != null ? title : "", action: getHeaderAction(callToAction) });
2223
- var getHeaderAction = (callToAction) => {
2224
- if (!callToAction) {
2225
- return void 0;
2226
- }
2227
- const { accessibilityDescription, href, title, onClick } = callToAction;
2228
- return href ? {
2229
- "aria-label": accessibilityDescription,
2230
- text: title,
2231
- href,
2232
- target: "_blank"
2233
- } : {
2234
- "aria-label": accessibilityDescription,
2235
- text: title,
2236
- onClick: (event) => {
2237
- event.preventDefault();
2238
- onClick();
2239
- }
2240
- };
2241
- };
2242
-
2243
- // ../renderers/src/ReviewRenderer.tsx
2244
- import { Fragment as Fragment5, jsx as jsx53, jsxs as jsxs14 } from "react/jsx-runtime";
2245
- var ReviewRenderer = {
2246
- canRenderType: "review",
2247
- render: ({ callToAction, control, fields, margin, title, trackEvent }) => {
2248
- const orientation = mapControlToDefinitionListLayout(control);
2249
- return /* @__PURE__ */ jsxs14("div", { className: getMargin(margin), children: [
2250
- /* @__PURE__ */ jsx53(Header7, { title, callToAction }),
2251
- /* @__PURE__ */ jsx53("div", { className: margin, children: /* @__PURE__ */ jsx53(
2252
- DefinitionList,
2253
- {
2254
- layout: orientation,
2255
- definitions: fields.map(
2256
- ({ label, value, help, analyticsId: fieldAnalyticsId }, index) => ({
2257
- key: String(index),
2258
- value,
2259
- title: getFieldLabel(
2260
- label,
2261
- help,
2262
- () => trackEvent("Help Pressed", { layoutItemId: fieldAnalyticsId })
2263
- )
2264
- })
2265
- )
2266
- }
2267
- ) })
2268
- ] });
2269
- }
2270
- };
2271
- var ReviewRenderer_default = ReviewRenderer;
2272
- var mapControlToDefinitionListLayout = (control) => {
2273
- switch (control) {
2274
- case "horizontal":
2275
- case "horizontal-end-aligned":
2276
- return "HORIZONTAL_RIGHT_ALIGNED";
2277
- case "horizontal-start-aligned":
2278
- return "HORIZONTAL_LEFT_ALIGNED";
2279
- case "vertical-two-column":
2280
- return "VERTICAL_TWO_COLUMN";
2281
- case "vertical":
2282
- case "vertical-one-column":
2283
- default:
2284
- return "VERTICAL_ONE_COLUMN";
2285
- }
2286
- };
2287
- var getFieldLabel = (label, help, onClick) => {
2288
- if (help) {
2289
- return /* @__PURE__ */ jsxs14(Fragment5, { children: [
2290
- label,
2291
- " ",
2292
- /* @__PURE__ */ jsx53(Help_default, { help, onClick })
2293
- ] });
2294
- }
2295
- return label;
2296
- };
2297
-
2298
2119
  // ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
2299
- import { Input as Input4, Markdown as Markdown4, NavigationOption as NavigationOption3, NavigationOptionsList as NavigationOptionsList2 } from "@transferwise/components";
2300
- import { useState as useState9 } from "react";
2301
- import { useIntl as useIntl11 } from "react-intl";
2120
+ import { Input as Input4, Markdown as Markdown4, NavigationOption as NavigationOption2, NavigationOptionsList } from "@transferwise/components";
2121
+ import { useState as useState8 } from "react";
2122
+ import { useIntl as useIntl9 } from "react-intl";
2302
2123
 
2303
2124
  // ../renderers/src/messages/search.messages.ts
2304
- import { defineMessages as defineMessages9 } from "react-intl";
2305
- var search_messages_default = defineMessages9({
2125
+ import { defineMessages as defineMessages8 } from "react-intl";
2126
+ var search_messages_default = defineMessages8({
2306
2127
  loading: {
2307
2128
  id: "df.wise.SearchLayout.loading",
2308
2129
  defaultMessage: "Loading...",
@@ -2311,11 +2132,11 @@ var search_messages_default = defineMessages9({
2311
2132
  });
2312
2133
 
2313
2134
  // ../renderers/src/SearchRenderer/ErrorResult.tsx
2314
- import { useIntl as useIntl10 } from "react-intl";
2135
+ import { useIntl as useIntl8 } from "react-intl";
2315
2136
 
2316
2137
  // ../renderers/src/messages/generic-error.messages.ts
2317
- import { defineMessages as defineMessages10 } from "react-intl";
2318
- var generic_error_messages_default = defineMessages10({
2138
+ import { defineMessages as defineMessages9 } from "react-intl";
2139
+ var generic_error_messages_default = defineMessages9({
2319
2140
  genericErrorRetryHint: {
2320
2141
  id: "df.wise.PersistAsyncSchema.genericError",
2321
2142
  defaultMessage: "Something went wrong, please try again.",
@@ -2335,18 +2156,18 @@ var generic_error_messages_default = defineMessages10({
2335
2156
 
2336
2157
  // ../renderers/src/SearchRenderer/ErrorResult.tsx
2337
2158
  import { Link } from "@transferwise/components";
2338
- import { jsx as jsx54, jsxs as jsxs15 } from "react/jsx-runtime";
2159
+ import { jsx as jsx50, jsxs as jsxs11 } from "react/jsx-runtime";
2339
2160
  function ErrorResult({ state }) {
2340
- const intl = useIntl10();
2341
- return /* @__PURE__ */ jsxs15("p", { className: "m-t-2", children: [
2161
+ const intl = useIntl8();
2162
+ return /* @__PURE__ */ jsxs11("p", { className: "m-t-2", children: [
2342
2163
  intl.formatMessage(generic_error_messages_default.genericError),
2343
2164
  "\xA0",
2344
- /* @__PURE__ */ jsx54(Link, { onClick: () => state.onRetry(), children: intl.formatMessage(generic_error_messages_default.retry) })
2165
+ /* @__PURE__ */ jsx50(Link, { onClick: () => state.onRetry(), children: intl.formatMessage(generic_error_messages_default.retry) })
2345
2166
  ] });
2346
2167
  }
2347
2168
 
2348
2169
  // ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
2349
- import { jsx as jsx55, jsxs as jsxs16 } from "react/jsx-runtime";
2170
+ import { jsx as jsx51, jsxs as jsxs12 } from "react/jsx-runtime";
2350
2171
  function BlockSearchRendererComponent({
2351
2172
  id,
2352
2173
  isLoading,
@@ -2357,10 +2178,10 @@ function BlockSearchRendererComponent({
2357
2178
  trackEvent,
2358
2179
  onChange
2359
2180
  }) {
2360
- const [hasSearched, setHasSearched] = useState9(false);
2361
- const { formatMessage } = useIntl11();
2362
- return /* @__PURE__ */ jsxs16("div", { className: getMargin(margin), children: [
2363
- /* @__PURE__ */ jsx55(FieldInput_default, { id, description: "", validation: void 0, help: "", label: title, children: /* @__PURE__ */ jsx55(
2181
+ const [hasSearched, setHasSearched] = useState8(false);
2182
+ const { formatMessage } = useIntl9();
2183
+ return /* @__PURE__ */ jsxs12("div", { className: getMargin(margin), children: [
2184
+ /* @__PURE__ */ jsx51(FieldInput_default, { id, description: "", validation: void 0, help: "", label: title, children: /* @__PURE__ */ jsx51(
2364
2185
  Input4,
2365
2186
  {
2366
2187
  id,
@@ -2377,7 +2198,7 @@ function BlockSearchRendererComponent({
2377
2198
  }
2378
2199
  }
2379
2200
  ) }),
2380
- isLoading ? /* @__PURE__ */ jsx55("span", { children: formatMessage(search_messages_default.loading) }) : /* @__PURE__ */ jsx55(SearchResultContent, { state, trackEvent })
2201
+ isLoading ? /* @__PURE__ */ jsx51("span", { children: formatMessage(search_messages_default.loading) }) : /* @__PURE__ */ jsx51(SearchResultContent, { state, trackEvent })
2381
2202
  ] });
2382
2203
  }
2383
2204
  function SearchResultContent({
@@ -2386,31 +2207,31 @@ function SearchResultContent({
2386
2207
  }) {
2387
2208
  switch (state.type) {
2388
2209
  case "error":
2389
- return /* @__PURE__ */ jsx55(ErrorResult, { state });
2210
+ return /* @__PURE__ */ jsx51(ErrorResult, { state });
2390
2211
  case "results":
2391
- return /* @__PURE__ */ jsx55(SearchResults, { state, trackEvent });
2212
+ return /* @__PURE__ */ jsx51(SearchResults, { state, trackEvent });
2392
2213
  case "noResults":
2393
- return /* @__PURE__ */ jsx55(EmptySearchResult, { state });
2214
+ return /* @__PURE__ */ jsx51(EmptySearchResult, { state });
2394
2215
  case "pending":
2395
2216
  default:
2396
2217
  return null;
2397
2218
  }
2398
2219
  }
2399
2220
  function EmptySearchResult({ state }) {
2400
- return /* @__PURE__ */ jsx55(Markdown4, { className: "m-t-2", config: { link: { target: "_blank" } }, children: state.message });
2221
+ return /* @__PURE__ */ jsx51(Markdown4, { className: "m-t-2", config: { link: { target: "_blank" } }, children: state.message });
2401
2222
  }
2402
2223
  function SearchResults({
2403
2224
  state,
2404
2225
  trackEvent
2405
2226
  }) {
2406
- return /* @__PURE__ */ jsx55(NavigationOptionsList2, { children: state.results.map((result) => {
2227
+ return /* @__PURE__ */ jsx51(NavigationOptionsList, { children: state.results.map((result) => {
2407
2228
  const { media } = result;
2408
- return /* @__PURE__ */ jsx55(
2409
- NavigationOption3,
2229
+ return /* @__PURE__ */ jsx51(
2230
+ NavigationOption2,
2410
2231
  {
2411
2232
  title: result.title,
2412
2233
  content: result.description,
2413
- media: media ? /* @__PURE__ */ jsx55(OptionMedia, { media, preferAvatar: false }) : void 0,
2234
+ media: media ? /* @__PURE__ */ jsx51(OptionMedia, { media, preferAvatar: false }) : void 0,
2414
2235
  showMediaCircle: false,
2415
2236
  showMediaAtAllSizes: true,
2416
2237
  onClick: () => {
@@ -2429,9 +2250,9 @@ var BlockSearchRendererComponent_default = BlockSearchRendererComponent;
2429
2250
  // ../renderers/src/SearchRenderer/InlineSearchRendererComponent.tsx
2430
2251
  import { Markdown as Markdown5, Typeahead } from "@transferwise/components";
2431
2252
  import { Search } from "@transferwise/icons";
2432
- import { useState as useState10 } from "react";
2433
- import { useIntl as useIntl12 } from "react-intl";
2434
- import { jsx as jsx56 } from "react/jsx-runtime";
2253
+ import { useState as useState9 } from "react";
2254
+ import { useIntl as useIntl10 } from "react-intl";
2255
+ import { jsx as jsx52 } from "react/jsx-runtime";
2435
2256
  function InlineSearchRenderer({
2436
2257
  id,
2437
2258
  isLoading,
@@ -2441,9 +2262,9 @@ function InlineSearchRenderer({
2441
2262
  title,
2442
2263
  trackEvent
2443
2264
  }) {
2444
- const [hasSearched, setHasSearched] = useState10(false);
2445
- const intl = useIntl12();
2446
- return /* @__PURE__ */ jsx56("div", { className: getMargin(margin), children: /* @__PURE__ */ jsx56(FieldInput_default, { id, description: "", validation: void 0, help: "", label: title, children: /* @__PURE__ */ jsx56(
2265
+ const [hasSearched, setHasSearched] = useState9(false);
2266
+ const intl = useIntl10();
2267
+ return /* @__PURE__ */ jsx52("div", { className: getMargin(margin), children: /* @__PURE__ */ jsx52(FieldInput_default, { id, description: "", validation: void 0, help: "", label: title, children: /* @__PURE__ */ jsx52(
2447
2268
  Typeahead,
2448
2269
  {
2449
2270
  id: "typeahead-input-id",
@@ -2451,10 +2272,10 @@ function InlineSearchRenderer({
2451
2272
  name: "typeahead-input-name",
2452
2273
  size: "md",
2453
2274
  maxHeight: 100,
2454
- footer: /* @__PURE__ */ jsx56(TypeaheadFooter, { state, isLoading }),
2275
+ footer: /* @__PURE__ */ jsx52(TypeaheadFooter, { state, isLoading }),
2455
2276
  multiple: false,
2456
2277
  clearable: false,
2457
- addon: /* @__PURE__ */ jsx56(Search, { size: 24 }),
2278
+ addon: /* @__PURE__ */ jsx52(Search, { size: 24 }),
2458
2279
  options: state.type === "results" ? state.results.map(mapResultToTypeaheadOption) : [],
2459
2280
  minQueryLength: 1,
2460
2281
  onChange: (values) => {
@@ -2489,33 +2310,33 @@ function mapResultToTypeaheadOption(result) {
2489
2310
  };
2490
2311
  }
2491
2312
  function TypeaheadFooter({ state, isLoading }) {
2492
- const { formatMessage } = useIntl12();
2313
+ const { formatMessage } = useIntl10();
2493
2314
  if (state.type === "noResults") {
2494
- return /* @__PURE__ */ jsx56(Markdown5, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: state.message });
2315
+ return /* @__PURE__ */ jsx52(Markdown5, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: state.message });
2495
2316
  }
2496
2317
  if (state.type === "error") {
2497
- return /* @__PURE__ */ jsx56("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ jsx56(ErrorResult, { state }) });
2318
+ return /* @__PURE__ */ jsx52("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ jsx52(ErrorResult, { state }) });
2498
2319
  }
2499
2320
  if (state.type === "pending" || isLoading) {
2500
- return /* @__PURE__ */ jsx56("p", { className: "m-t-2 m-x-2", children: formatMessage(search_messages_default.loading) });
2321
+ return /* @__PURE__ */ jsx52("p", { className: "m-t-2 m-x-2", children: formatMessage(search_messages_default.loading) });
2501
2322
  }
2502
2323
  return null;
2503
2324
  }
2504
2325
  var InlineSearchRendererComponent_default = InlineSearchRenderer;
2505
2326
 
2506
2327
  // ../renderers/src/SearchRenderer/SearchRenderer.tsx
2507
- import { jsx as jsx57 } from "react/jsx-runtime";
2328
+ import { jsx as jsx53 } from "react/jsx-runtime";
2508
2329
  var SearchRenderer = {
2509
2330
  canRenderType: "search",
2510
- render: (props) => props.control === "inline" ? /* @__PURE__ */ jsx57(InlineSearchRendererComponent_default, __spreadValues({}, props)) : /* @__PURE__ */ jsx57(BlockSearchRendererComponent_default, __spreadValues({}, props))
2331
+ render: (props) => props.control === "inline" ? /* @__PURE__ */ jsx53(InlineSearchRendererComponent_default, __spreadValues({}, props)) : /* @__PURE__ */ jsx53(BlockSearchRendererComponent_default, __spreadValues({}, props))
2511
2332
  };
2512
2333
  var SearchRenderer_default = SearchRenderer;
2513
2334
 
2514
2335
  // ../renderers/src/SectionRenderer.tsx
2515
- import { Header as Header8 } from "@transferwise/components";
2336
+ import { Header as Header4 } from "@transferwise/components";
2516
2337
 
2517
2338
  // ../renderers/src/utils/getHeaderAction.tsx
2518
- var getHeaderAction2 = (callToAction) => {
2339
+ var getHeaderAction = (callToAction) => {
2519
2340
  if (!callToAction) {
2520
2341
  return void 0;
2521
2342
  }
@@ -2536,12 +2357,12 @@ var getHeaderAction2 = (callToAction) => {
2536
2357
  };
2537
2358
 
2538
2359
  // ../renderers/src/SectionRenderer.tsx
2539
- import { jsx as jsx58, jsxs as jsxs17 } from "react/jsx-runtime";
2360
+ import { jsx as jsx54, jsxs as jsxs13 } from "react/jsx-runtime";
2540
2361
  var SectionRenderer = {
2541
2362
  canRenderType: "section",
2542
2363
  render: ({ children, callToAction, margin, title }) => {
2543
- return /* @__PURE__ */ jsxs17("section", { className: getMargin(margin), children: [
2544
- (title || callToAction) && /* @__PURE__ */ jsx58(Header8, { title: title != null ? title : "", action: getHeaderAction2(callToAction) }),
2364
+ return /* @__PURE__ */ jsxs13("section", { className: getMargin(margin), children: [
2365
+ (title || callToAction) && /* @__PURE__ */ jsx54(Header4, { title: title != null ? title : "", action: getHeaderAction(callToAction) }),
2545
2366
  children
2546
2367
  ] });
2547
2368
  }
@@ -2550,7 +2371,7 @@ var SectionRenderer_default = SectionRenderer;
2550
2371
 
2551
2372
  // ../renderers/src/SelectInputRenderer/RadioInputRendererComponent.tsx
2552
2373
  import { RadioGroup } from "@transferwise/components";
2553
- import { Fragment as Fragment6, jsx as jsx59, jsxs as jsxs18 } from "react/jsx-runtime";
2374
+ import { Fragment as Fragment3, jsx as jsx55, jsxs as jsxs14 } from "react/jsx-runtime";
2554
2375
  function RadioInputRendererComponent(props) {
2555
2376
  const {
2556
2377
  id,
@@ -2564,8 +2385,8 @@ function RadioInputRendererComponent(props) {
2564
2385
  validationState,
2565
2386
  onSelect
2566
2387
  } = props;
2567
- return /* @__PURE__ */ jsxs18(Fragment6, { children: [
2568
- /* @__PURE__ */ jsx59(
2388
+ return /* @__PURE__ */ jsxs14(Fragment3, { children: [
2389
+ /* @__PURE__ */ jsx55(
2569
2390
  FieldInput_default,
2570
2391
  {
2571
2392
  id,
@@ -2573,7 +2394,7 @@ function RadioInputRendererComponent(props) {
2573
2394
  help,
2574
2395
  description,
2575
2396
  validation: validationState,
2576
- children: /* @__PURE__ */ jsx59("span", { children: /* @__PURE__ */ jsx59(
2397
+ children: /* @__PURE__ */ jsx55("span", { children: /* @__PURE__ */ jsx55(
2577
2398
  RadioGroup,
2578
2399
  {
2579
2400
  name: id,
@@ -2582,7 +2403,7 @@ function RadioInputRendererComponent(props) {
2582
2403
  value: index,
2583
2404
  secondary: option.description,
2584
2405
  disabled: option.disabled || disabled,
2585
- avatar: /* @__PURE__ */ jsx59(OptionMedia, { media: option.media, preferAvatar: false })
2406
+ avatar: /* @__PURE__ */ jsx55(OptionMedia, { media: option.media, preferAvatar: false })
2586
2407
  })),
2587
2408
  selectedValue: selectedIndex != null ? selectedIndex : void 0,
2588
2409
  onChange: onSelect
@@ -2598,7 +2419,7 @@ function RadioInputRendererComponent(props) {
2598
2419
  // ../renderers/src/SelectInputRenderer/TabInputRendererComponent.tsx
2599
2420
  import { Tabs } from "@transferwise/components";
2600
2421
  import { useEffect as useEffect6 } from "react";
2601
- import { Fragment as Fragment7, jsx as jsx60, jsxs as jsxs19 } from "react/jsx-runtime";
2422
+ import { Fragment as Fragment4, jsx as jsx56, jsxs as jsxs15 } from "react/jsx-runtime";
2602
2423
  function TabInputRendererComponent(props) {
2603
2424
  const {
2604
2425
  id,
@@ -2617,8 +2438,8 @@ function TabInputRendererComponent(props) {
2617
2438
  onSelect(0);
2618
2439
  }
2619
2440
  }, [selectedIndex, onSelect, options.length]);
2620
- return /* @__PURE__ */ jsxs19(Fragment7, { children: [
2621
- /* @__PURE__ */ jsx60(
2441
+ return /* @__PURE__ */ jsxs15(Fragment4, { children: [
2442
+ /* @__PURE__ */ jsx56(
2622
2443
  FieldInput_default,
2623
2444
  {
2624
2445
  id,
@@ -2626,7 +2447,7 @@ function TabInputRendererComponent(props) {
2626
2447
  help,
2627
2448
  description,
2628
2449
  validation: validationState,
2629
- children: /* @__PURE__ */ jsx60(
2450
+ children: /* @__PURE__ */ jsx56(
2630
2451
  Tabs,
2631
2452
  {
2632
2453
  name: id,
@@ -2635,7 +2456,7 @@ function TabInputRendererComponent(props) {
2635
2456
  title: option.title,
2636
2457
  // if we pass null, we get some props-types console errors
2637
2458
  // eslint-disable-next-line react/jsx-no-useless-fragment
2638
- content: /* @__PURE__ */ jsx60(Fragment7, {}),
2459
+ content: /* @__PURE__ */ jsx56(Fragment4, {}),
2639
2460
  disabled: option.disabled || disabled
2640
2461
  })),
2641
2462
  onTabSelect: onSelect
@@ -2650,7 +2471,7 @@ var isValidIndex2 = (index, options) => index !== null && index >= 0 && index <
2650
2471
 
2651
2472
  // ../renderers/src/SelectInputRenderer/SelectInputRendererComponent.tsx
2652
2473
  import { SelectInput as SelectInput2, SelectInputOptionContent as SelectInputOptionContent2 } from "@transferwise/components";
2653
- import { Fragment as Fragment8, jsx as jsx61, jsxs as jsxs20 } from "react/jsx-runtime";
2474
+ import { Fragment as Fragment5, jsx as jsx57, jsxs as jsxs16 } from "react/jsx-runtime";
2654
2475
  function SelectInputRendererComponent(props) {
2655
2476
  const {
2656
2477
  id,
@@ -2690,13 +2511,13 @@ function SelectInputRendererComponent(props) {
2690
2511
  } : {
2691
2512
  title: option.title,
2692
2513
  description: option.description,
2693
- icon: /* @__PURE__ */ jsx61(OptionMedia, { media: option.media, preferAvatar: false })
2514
+ icon: /* @__PURE__ */ jsx57(OptionMedia, { media: option.media, preferAvatar: false })
2694
2515
  };
2695
- return /* @__PURE__ */ jsx61(SelectInputOptionContent2, __spreadValues({}, contentProps));
2516
+ return /* @__PURE__ */ jsx57(SelectInputOptionContent2, __spreadValues({}, contentProps));
2696
2517
  };
2697
2518
  const extraProps = { autoComplete };
2698
- return /* @__PURE__ */ jsxs20(Fragment8, { children: [
2699
- /* @__PURE__ */ jsx61(
2519
+ return /* @__PURE__ */ jsxs16(Fragment5, { children: [
2520
+ /* @__PURE__ */ jsx57(
2700
2521
  FieldInput_default,
2701
2522
  {
2702
2523
  id,
@@ -2704,7 +2525,7 @@ function SelectInputRendererComponent(props) {
2704
2525
  help,
2705
2526
  description,
2706
2527
  validation: validationState,
2707
- children: /* @__PURE__ */ jsx61(
2528
+ children: /* @__PURE__ */ jsx57(
2708
2529
  SelectInput2,
2709
2530
  __spreadValues({
2710
2531
  name: id,
@@ -2727,7 +2548,7 @@ function SelectInputRendererComponent(props) {
2727
2548
  // ../renderers/src/SelectInputRenderer/SegmentedInputRendererComponent.tsx
2728
2549
  import { useEffect as useEffect7 } from "react";
2729
2550
  import { SegmentedControl } from "@transferwise/components";
2730
- import { Fragment as Fragment9, jsx as jsx62, jsxs as jsxs21 } from "react/jsx-runtime";
2551
+ import { Fragment as Fragment6, jsx as jsx58, jsxs as jsxs17 } from "react/jsx-runtime";
2731
2552
  function SegmentedInputRendererComponent(props) {
2732
2553
  const {
2733
2554
  id,
@@ -2745,8 +2566,8 @@ function SegmentedInputRendererComponent(props) {
2745
2566
  onSelect(0);
2746
2567
  }
2747
2568
  }, [selectedIndex, onSelect, options.length]);
2748
- return /* @__PURE__ */ jsxs21(Fragment9, { children: [
2749
- /* @__PURE__ */ jsx62(
2569
+ return /* @__PURE__ */ jsxs17(Fragment6, { children: [
2570
+ /* @__PURE__ */ jsx58(
2750
2571
  FieldInput_default,
2751
2572
  {
2752
2573
  id,
@@ -2754,7 +2575,7 @@ function SegmentedInputRendererComponent(props) {
2754
2575
  help,
2755
2576
  description,
2756
2577
  validation: validationState,
2757
- children: /* @__PURE__ */ jsx62(
2578
+ children: /* @__PURE__ */ jsx58(
2758
2579
  SegmentedControl,
2759
2580
  {
2760
2581
  name: `${id}-segmented-control`,
@@ -2771,78 +2592,85 @@ function SegmentedInputRendererComponent(props) {
2771
2592
  )
2772
2593
  }
2773
2594
  ),
2774
- /* @__PURE__ */ jsx62("div", { id: `${id}-children`, children })
2595
+ /* @__PURE__ */ jsx58("div", { id: `${id}-children`, children })
2775
2596
  ] });
2776
2597
  }
2777
2598
  var isValidIndex3 = (index, options) => index !== null && index >= 0 && index < options;
2778
2599
 
2600
+ // ../renderers/src/SelectInputRenderer/RadioItemRendererComponent.tsx
2601
+ import { Header as Header5, InlineAlert as InlineAlert4, List, ListItem as ListItem4 } from "@transferwise/components";
2602
+ import { Fragment as Fragment7, jsx as jsx59, jsxs as jsxs18 } from "react/jsx-runtime";
2603
+ function RadioItemRendererComponent(props) {
2604
+ const {
2605
+ id,
2606
+ children,
2607
+ description: rootDescription,
2608
+ disabled: rootDisabled,
2609
+ help,
2610
+ title: rootTitle,
2611
+ options,
2612
+ selectedIndex,
2613
+ validationState,
2614
+ onSelect
2615
+ } = props;
2616
+ return /* @__PURE__ */ jsxs18(Fragment7, { children: [
2617
+ rootTitle && /* @__PURE__ */ jsx59(
2618
+ Header5,
2619
+ {
2620
+ as: "h2",
2621
+ title: help ? /* @__PURE__ */ jsx59(LabelContentWithHelp, { text: rootTitle, help }) : rootTitle
2622
+ }
2623
+ ),
2624
+ rootDescription && /* @__PURE__ */ jsx59("p", { children: rootDescription }),
2625
+ /* @__PURE__ */ jsx59(List, { children: options.map(
2626
+ ({ title, description, additionalText, inlineAlert, disabled, media, supportingValues }, index) => /* @__PURE__ */ jsx59(
2627
+ ListItem4,
2628
+ __spreadValues({
2629
+ title,
2630
+ subtitle: description,
2631
+ control: /* @__PURE__ */ jsx59(
2632
+ ListItem4.Radio,
2633
+ {
2634
+ name: title,
2635
+ checked: selectedIndex === index,
2636
+ onChange: () => onSelect(index)
2637
+ }
2638
+ ),
2639
+ additionalInfo: getAdditionalText(additionalText),
2640
+ disabled: disabled || rootDisabled,
2641
+ prompt: getInlineAlert(inlineAlert),
2642
+ media: getMedia(media, false)
2643
+ }, getSupportingValues(supportingValues)),
2644
+ title
2645
+ )
2646
+ ) }, `${id}-${selectedIndex}`),
2647
+ (validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ jsx59(InlineAlert4, { type: "negative", children: validationState.message }),
2648
+ children
2649
+ ] });
2650
+ }
2651
+
2779
2652
  // ../renderers/src/SelectInputRenderer/SelectInputRenderer.tsx
2780
- import { jsx as jsx63 } from "react/jsx-runtime";
2653
+ import { jsx as jsx60 } from "react/jsx-runtime";
2781
2654
  var SelectInputRenderer = {
2782
2655
  canRenderType: "input-select",
2783
2656
  render: (props) => {
2784
2657
  switch (props.control) {
2785
2658
  case "radio":
2786
- return /* @__PURE__ */ jsx63(RadioInputRendererComponent, __spreadValues({}, props));
2659
+ return /* @__PURE__ */ jsx60(RadioInputRendererComponent, __spreadValues({}, props));
2660
+ case "radio-item":
2661
+ return /* @__PURE__ */ jsx60(RadioItemRendererComponent, __spreadValues({}, props));
2787
2662
  case "tab":
2788
- return props.options.length > 3 ? /* @__PURE__ */ jsx63(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ jsx63(TabInputRendererComponent, __spreadValues({}, props));
2663
+ return props.options.length > 3 ? /* @__PURE__ */ jsx60(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ jsx60(TabInputRendererComponent, __spreadValues({}, props));
2789
2664
  case "segmented":
2790
- return props.options.length > 3 ? /* @__PURE__ */ jsx63(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ jsx63(SegmentedInputRendererComponent, __spreadValues({}, props));
2665
+ return props.options.length > 3 ? /* @__PURE__ */ jsx60(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ jsx60(SegmentedInputRendererComponent, __spreadValues({}, props));
2791
2666
  case "select":
2792
2667
  default:
2793
- return /* @__PURE__ */ jsx63(SelectInputRendererComponent, __spreadValues({}, props));
2668
+ return /* @__PURE__ */ jsx60(SelectInputRendererComponent, __spreadValues({}, props));
2794
2669
  }
2795
2670
  }
2796
2671
  };
2797
2672
  var SelectInputRenderer_default = SelectInputRenderer;
2798
2673
 
2799
- // ../renderers/src/StatusListRenderer.tsx
2800
- import { Header as Header9, Summary } from "@transferwise/components";
2801
- import { jsx as jsx64, jsxs as jsxs22 } from "react/jsx-runtime";
2802
- var StatusListRenderer = {
2803
- canRenderType: "status-list",
2804
- render: ({ margin, items, title }) => /* @__PURE__ */ jsxs22("div", { className: getMargin(margin), children: [
2805
- title ? /* @__PURE__ */ jsx64(Header9, { title, className: "m-b-2" }) : null,
2806
- items.map(({ callToAction, description, icon, status, title: itemTitle }) => /* @__PURE__ */ jsx64(
2807
- Summary,
2808
- {
2809
- title: itemTitle,
2810
- description,
2811
- icon: icon && "name" in icon ? /* @__PURE__ */ jsx64(DynamicIcon_default, { name: icon.name }) : null,
2812
- status: mapStatus(status),
2813
- action: getSummaryAction(callToAction)
2814
- },
2815
- `${itemTitle}/${description || ""}`
2816
- ))
2817
- ] })
2818
- };
2819
- var StatusListRenderer_default = StatusListRenderer;
2820
- var getSummaryAction = (callToAction) => {
2821
- if (!callToAction) {
2822
- return void 0;
2823
- }
2824
- const { accessibilityDescription, href, title, onClick } = callToAction;
2825
- if (!href) {
2826
- return {
2827
- "aria-label": accessibilityDescription,
2828
- text: title,
2829
- onClick
2830
- };
2831
- }
2832
- return {
2833
- "aria-label": accessibilityDescription,
2834
- href,
2835
- target: "_blank",
2836
- text: title
2837
- };
2838
- };
2839
- var mapStatus = (status) => {
2840
- if (status === "not-done") {
2841
- return "notDone";
2842
- }
2843
- return status;
2844
- };
2845
-
2846
2674
  // ../renderers/src/utils/useCustomTheme.ts
2847
2675
  import { useTheme } from "@wise/components-theming";
2848
2676
  import { useEffect as useEffect8, useMemo } from "react";
@@ -2862,11 +2690,11 @@ var useCustomTheme = (theme, trackEvent) => {
2862
2690
  // ../renderers/src/step/topbar/BackButton.tsx
2863
2691
  import { IconButton } from "@transferwise/components";
2864
2692
  import { ArrowLeft } from "@transferwise/icons";
2865
- import { useIntl as useIntl13 } from "react-intl";
2693
+ import { useIntl as useIntl11 } from "react-intl";
2866
2694
 
2867
2695
  // ../renderers/src/messages/back.messages.ts
2868
- import { defineMessages as defineMessages11 } from "react-intl";
2869
- var back_messages_default = defineMessages11({
2696
+ import { defineMessages as defineMessages10 } from "react-intl";
2697
+ var back_messages_default = defineMessages10({
2870
2698
  back: {
2871
2699
  id: "df.wise.back.label",
2872
2700
  defaultMessage: "Back",
@@ -2875,30 +2703,30 @@ var back_messages_default = defineMessages11({
2875
2703
  });
2876
2704
 
2877
2705
  // ../renderers/src/step/topbar/BackButton.tsx
2878
- import { jsx as jsx65, jsxs as jsxs23 } from "react/jsx-runtime";
2706
+ import { jsx as jsx61, jsxs as jsxs19 } from "react/jsx-runtime";
2879
2707
  function BackButton({ title, onClick }) {
2880
- const { formatMessage } = useIntl13();
2881
- return /* @__PURE__ */ jsxs23(IconButton, { className: "df-back-button", priority: "tertiary", onClick, children: [
2882
- /* @__PURE__ */ jsx65("span", { className: "sr-only", children: title != null ? title : formatMessage(back_messages_default.back) }),
2883
- /* @__PURE__ */ jsx65(ArrowLeft, {})
2708
+ const { formatMessage } = useIntl11();
2709
+ return /* @__PURE__ */ jsxs19(IconButton, { className: "df-back-button", priority: "tertiary", onClick, children: [
2710
+ /* @__PURE__ */ jsx61("span", { className: "sr-only", children: title != null ? title : formatMessage(back_messages_default.back) }),
2711
+ /* @__PURE__ */ jsx61(ArrowLeft, {})
2884
2712
  ] });
2885
2713
  }
2886
2714
 
2887
2715
  // ../renderers/src/step/topbar/Toolbar.tsx
2888
2716
  import { Button as Button7, IconButton as IconButton2 } from "@transferwise/components";
2889
- import { jsx as jsx66, jsxs as jsxs24 } from "react/jsx-runtime";
2717
+ import { jsx as jsx62, jsxs as jsxs20 } from "react/jsx-runtime";
2890
2718
  var Toolbar = ({ items }) => {
2891
- return (items == null ? void 0 : items.length) > 0 ? /* @__PURE__ */ jsx66("div", { className: "df-toolbar", children: items.map((item, index) => /* @__PURE__ */ jsx66(ToolbarButton, __spreadValues({}, item), `${item.type}-${index}-${item.title}`)) }) : null;
2719
+ return (items == null ? void 0 : items.length) > 0 ? /* @__PURE__ */ jsx62("div", { className: "df-toolbar", children: items.map((item, index) => /* @__PURE__ */ jsx62(ToolbarButton, __spreadValues({}, item), `${item.type}-${index}-${item.title}`)) }) : null;
2892
2720
  };
2893
2721
  function ToolbarButton(props) {
2894
- return prefersMedia(props.control) ? /* @__PURE__ */ jsx66(MediaToolbarButton, __spreadValues({}, props)) : /* @__PURE__ */ jsx66(TextToolbarButton, __spreadValues({}, props));
2722
+ return prefersMedia(props.control) ? /* @__PURE__ */ jsx62(MediaToolbarButton, __spreadValues({}, props)) : /* @__PURE__ */ jsx62(TextToolbarButton, __spreadValues({}, props));
2895
2723
  }
2896
2724
  function MediaToolbarButton(props) {
2897
2725
  var _a;
2898
2726
  const { context, control, media, accessibilityDescription, disabled, onClick } = props;
2899
2727
  const priority = getIconButtonPriority(control);
2900
- const type = getSentiment(context);
2901
- return /* @__PURE__ */ jsxs24(
2728
+ const type = getSentiment2(context);
2729
+ return /* @__PURE__ */ jsxs20(
2902
2730
  IconButton2,
2903
2731
  {
2904
2732
  className: "df-toolbar-button",
@@ -2908,7 +2736,7 @@ function MediaToolbarButton(props) {
2908
2736
  type,
2909
2737
  onClick,
2910
2738
  children: [
2911
- accessibilityDescription ? /* @__PURE__ */ jsx66("span", { className: "sr-only", children: accessibilityDescription }) : null,
2739
+ accessibilityDescription ? /* @__PURE__ */ jsx62("span", { className: "sr-only", children: accessibilityDescription }) : null,
2912
2740
  media ? (_a = getAddonStart(media)) == null ? void 0 : _a.value : null
2913
2741
  ]
2914
2742
  }
@@ -2918,8 +2746,8 @@ function TextToolbarButton(props) {
2918
2746
  const { context, control, title, media, disabled, onClick } = props;
2919
2747
  const addonStart = media ? getAddonStart(media) : void 0;
2920
2748
  const priority = getPriority2(control);
2921
- const sentiment = getSentiment(context);
2922
- return /* @__PURE__ */ jsx66(
2749
+ const sentiment = getSentiment2(context);
2750
+ return /* @__PURE__ */ jsx62(
2923
2751
  Button7,
2924
2752
  {
2925
2753
  v2: true,
@@ -2955,7 +2783,7 @@ var prefersMedia = (control) => {
2955
2783
  };
2956
2784
  var knownControls = ["primary", "secondary", "secondary-neutral"];
2957
2785
  var isKnownControl = (control) => control !== void 0 && knownControls.includes(control);
2958
- var getSentiment = (context) => {
2786
+ var getSentiment2 = (context) => {
2959
2787
  return "default";
2960
2788
  };
2961
2789
  var getIconButtonPriority = (control) => {
@@ -2964,16 +2792,16 @@ var getIconButtonPriority = (control) => {
2964
2792
  };
2965
2793
 
2966
2794
  // ../renderers/src/step/topbar/TopBar.tsx
2967
- import { jsx as jsx67, jsxs as jsxs25 } from "react/jsx-runtime";
2795
+ import { jsx as jsx63, jsxs as jsxs21 } from "react/jsx-runtime";
2968
2796
  function TopBar({ back, toolbar }) {
2969
- return back || toolbar ? /* @__PURE__ */ jsxs25("div", { className: "d-flex m-b-2", children: [
2970
- back ? /* @__PURE__ */ jsx67(BackButton, __spreadValues({}, back)) : null,
2971
- toolbar ? /* @__PURE__ */ jsx67(Toolbar, __spreadValues({}, toolbar)) : null
2797
+ return back || toolbar ? /* @__PURE__ */ jsxs21("div", { className: "d-flex m-b-2", children: [
2798
+ back ? /* @__PURE__ */ jsx63(BackButton, __spreadValues({}, back)) : null,
2799
+ toolbar ? /* @__PURE__ */ jsx63(Toolbar, __spreadValues({}, toolbar)) : null
2972
2800
  ] }) : null;
2973
2801
  }
2974
2802
 
2975
2803
  // ../renderers/src/step/SplashCelebrationStepRenderer.tsx
2976
- import { jsx as jsx68, jsxs as jsxs26 } from "react/jsx-runtime";
2804
+ import { jsx as jsx64, jsxs as jsxs22 } from "react/jsx-runtime";
2977
2805
  var SplashCelebrationStepRenderer = {
2978
2806
  canRenderType: "step",
2979
2807
  canRender: ({ control }) => control === "splash-celebration",
@@ -2983,15 +2811,15 @@ function SplashCelebrationStepRendererComponent(props) {
2983
2811
  const { back, toolbar, children, footer, trackEvent } = props;
2984
2812
  const hasFooter = footer && Array.isArray(footer) && footer.length > 0;
2985
2813
  useCustomTheme("forest-green", trackEvent);
2986
- return /* @__PURE__ */ jsxs26("div", { className: "splash-screen m-t-5", children: [
2987
- /* @__PURE__ */ jsx68(TopBar, { back, toolbar }),
2814
+ return /* @__PURE__ */ jsxs22("div", { className: "splash-screen m-t-5", children: [
2815
+ /* @__PURE__ */ jsx64(TopBar, { back, toolbar }),
2988
2816
  children,
2989
- hasFooter ? /* @__PURE__ */ jsx68("div", { className: "df-step-fixed__footer", children: footer }) : void 0
2817
+ hasFooter ? /* @__PURE__ */ jsx64("div", { className: "df-step-fixed__footer", children: footer }) : void 0
2990
2818
  ] });
2991
2819
  }
2992
2820
 
2993
2821
  // ../renderers/src/step/SplashStepRenderer.tsx
2994
- import { jsx as jsx69, jsxs as jsxs27 } from "react/jsx-runtime";
2822
+ import { jsx as jsx65, jsxs as jsxs23 } from "react/jsx-runtime";
2995
2823
  var SplashStepRenderer = {
2996
2824
  canRenderType: "step",
2997
2825
  canRender: ({ control }) => control === "splash",
@@ -3000,16 +2828,16 @@ var SplashStepRenderer = {
3000
2828
  function SplashStepRendererComponent(props) {
3001
2829
  const { back, toolbar, children, footer } = props;
3002
2830
  const hasFooter = footer && Array.isArray(footer) && footer.length > 0;
3003
- return /* @__PURE__ */ jsxs27("div", { className: "splash-screen m-t-5", children: [
3004
- /* @__PURE__ */ jsx69(TopBar, { back, toolbar }),
2831
+ return /* @__PURE__ */ jsxs23("div", { className: "splash-screen m-t-5", children: [
2832
+ /* @__PURE__ */ jsx65(TopBar, { back, toolbar }),
3005
2833
  children,
3006
- hasFooter ? /* @__PURE__ */ jsx69("div", { className: "df-step-fixed__footer", children: footer }) : void 0
2834
+ hasFooter ? /* @__PURE__ */ jsx65("div", { className: "df-step-fixed__footer", children: footer }) : void 0
3007
2835
  ] });
3008
2836
  }
3009
2837
 
3010
2838
  // ../renderers/src/step/StepRenderer.tsx
3011
2839
  import { Alert as Alert2, Title as Title2 } from "@transferwise/components";
3012
- import { Fragment as Fragment10, jsx as jsx70, jsxs as jsxs28 } from "react/jsx-runtime";
2840
+ import { Fragment as Fragment8, jsx as jsx66, jsxs as jsxs24 } from "react/jsx-runtime";
3013
2841
  var StepRenderer = {
3014
2842
  canRenderType: "step",
3015
2843
  render: StepRendererComponent
@@ -3017,19 +2845,19 @@ var StepRenderer = {
3017
2845
  function StepRendererComponent(props) {
3018
2846
  const { back, description, error, title, children, toolbar, footer, tags } = props;
3019
2847
  const hasFooter = footer && Array.isArray(footer) && footer.length > 0;
3020
- return /* @__PURE__ */ jsxs28("div", { children: [
3021
- /* @__PURE__ */ jsx70(TopBar, { back, toolbar }),
3022
- title || description ? /* @__PURE__ */ jsx70("div", { className: "m-b-4", children: /* @__PURE__ */ jsx70(Header10, { title, description, tags }) }) : void 0,
3023
- error ? /* @__PURE__ */ jsx70(Alert2, { type: "negative", className: "m-b-2", message: error }) : null,
2848
+ return /* @__PURE__ */ jsxs24("div", { children: [
2849
+ /* @__PURE__ */ jsx66(TopBar, { back, toolbar }),
2850
+ title || description ? /* @__PURE__ */ jsx66("div", { className: "m-b-4", children: /* @__PURE__ */ jsx66(Header6, { title, description, tags }) }) : void 0,
2851
+ error ? /* @__PURE__ */ jsx66(Alert2, { type: "negative", className: "m-b-2", message: error }) : null,
3024
2852
  children,
3025
- hasFooter ? /* @__PURE__ */ jsx70("div", { className: "df-step-fixed__footer", children: footer }) : void 0
2853
+ hasFooter ? /* @__PURE__ */ jsx66("div", { className: "df-step-fixed__footer", children: footer }) : void 0
3026
2854
  ] });
3027
2855
  }
3028
- var Header10 = ({ title, description, tags }) => {
2856
+ var Header6 = ({ title, description, tags }) => {
3029
2857
  const { titleType, alignmentClassName } = getHeaderStyle(tags);
3030
- return /* @__PURE__ */ jsxs28(Fragment10, { children: [
3031
- title ? /* @__PURE__ */ jsx70(Title2, { as: "h1", type: titleType, className: `${alignmentClassName} m-b-2`, children: title }) : void 0,
3032
- description ? /* @__PURE__ */ jsx70("p", { className: `${alignmentClassName} np-text-body-large`, children: description }) : void 0
2858
+ return /* @__PURE__ */ jsxs24(Fragment8, { children: [
2859
+ title ? /* @__PURE__ */ jsx66(Title2, { as: "h1", type: titleType, className: `${alignmentClassName} m-b-2`, children: title }) : void 0,
2860
+ description ? /* @__PURE__ */ jsx66("p", { className: `${alignmentClassName} np-text-body-large`, children: description }) : void 0
3033
2861
  ] });
3034
2862
  };
3035
2863
  var getHeaderStyle = (tags) => {
@@ -3041,27 +2869,27 @@ var getHeaderStyle = (tags) => {
3041
2869
 
3042
2870
  // ../renderers/src/TabsRenderer.tsx
3043
2871
  import { Chips, SegmentedControl as SegmentedControl2, Tabs as Tabs2 } from "@transferwise/components";
3044
- import { useState as useState11 } from "react";
3045
- import { jsx as jsx71, jsxs as jsxs29 } from "react/jsx-runtime";
2872
+ import { useState as useState10 } from "react";
2873
+ import { jsx as jsx67, jsxs as jsxs25 } from "react/jsx-runtime";
3046
2874
  var TabsRenderer = {
3047
2875
  canRenderType: "tabs",
3048
2876
  render: (props) => {
3049
2877
  switch (props.control) {
3050
2878
  case "segmented":
3051
2879
  if (props.tabs.length > 3) {
3052
- return /* @__PURE__ */ jsx71(TabsRendererComponent, __spreadValues({}, props));
2880
+ return /* @__PURE__ */ jsx67(TabsRendererComponent, __spreadValues({}, props));
3053
2881
  }
3054
- return /* @__PURE__ */ jsx71(SegmentedTabsRendererComponent, __spreadValues({}, props));
2882
+ return /* @__PURE__ */ jsx67(SegmentedTabsRendererComponent, __spreadValues({}, props));
3055
2883
  case "chips":
3056
- return /* @__PURE__ */ jsx71(ChipsTabsRendererComponent, __spreadValues({}, props));
2884
+ return /* @__PURE__ */ jsx67(ChipsTabsRendererComponent, __spreadValues({}, props));
3057
2885
  default:
3058
- return /* @__PURE__ */ jsx71(TabsRendererComponent, __spreadValues({}, props));
2886
+ return /* @__PURE__ */ jsx67(TabsRendererComponent, __spreadValues({}, props));
3059
2887
  }
3060
2888
  }
3061
2889
  };
3062
2890
  function TabsRendererComponent({ uid, margin, tabs }) {
3063
- const [selectedIndex, setSelectedIndex] = useState11(0);
3064
- return /* @__PURE__ */ jsx71("div", { className: getMargin(margin), children: /* @__PURE__ */ jsx71(
2891
+ const [selectedIndex, setSelectedIndex] = useState10(0);
2892
+ return /* @__PURE__ */ jsx67("div", { className: getMargin(margin), children: /* @__PURE__ */ jsx67(
3065
2893
  Tabs2,
3066
2894
  {
3067
2895
  name: uid,
@@ -3069,7 +2897,7 @@ function TabsRendererComponent({ uid, margin, tabs }) {
3069
2897
  tabs: tabs.map((option) => ({
3070
2898
  title: option.title,
3071
2899
  disabled: false,
3072
- content: /* @__PURE__ */ jsxs29("div", { className: "m-t-2", children: [
2900
+ content: /* @__PURE__ */ jsxs25("div", { className: "m-t-2", children: [
3073
2901
  " ",
3074
2902
  option.children,
3075
2903
  " "
@@ -3081,9 +2909,9 @@ function TabsRendererComponent({ uid, margin, tabs }) {
3081
2909
  }
3082
2910
  function SegmentedTabsRendererComponent({ uid, margin, tabs }) {
3083
2911
  var _a;
3084
- const [selectedIndex, setSelectedIndex] = useState11(0);
3085
- return /* @__PURE__ */ jsxs29("div", { className: getMargin(margin), children: [
3086
- /* @__PURE__ */ jsx71(
2912
+ const [selectedIndex, setSelectedIndex] = useState10(0);
2913
+ return /* @__PURE__ */ jsxs25("div", { className: getMargin(margin), children: [
2914
+ /* @__PURE__ */ jsx67(
3087
2915
  SegmentedControl2,
3088
2916
  {
3089
2917
  name: uid,
@@ -3098,14 +2926,14 @@ function SegmentedTabsRendererComponent({ uid, margin, tabs }) {
3098
2926
  onChange: (value) => setSelectedIndex(Number(value))
3099
2927
  }
3100
2928
  ),
3101
- /* @__PURE__ */ jsx71("div", { id: `${uid}-children`, className: "m-t-2", children: (_a = tabs[selectedIndex]) == null ? void 0 : _a.children })
2929
+ /* @__PURE__ */ jsx67("div", { id: `${uid}-children`, className: "m-t-2", children: (_a = tabs[selectedIndex]) == null ? void 0 : _a.children })
3102
2930
  ] });
3103
2931
  }
3104
2932
  function ChipsTabsRendererComponent({ margin, tabs }) {
3105
2933
  var _a;
3106
- const [selectedIndex, setSelectedIndex] = useState11(0);
3107
- return /* @__PURE__ */ jsxs29("div", { className: getMargin(margin), children: [
3108
- /* @__PURE__ */ jsx71("div", { className: "chips-container", children: /* @__PURE__ */ jsx71(
2934
+ const [selectedIndex, setSelectedIndex] = useState10(0);
2935
+ return /* @__PURE__ */ jsxs25("div", { className: getMargin(margin), children: [
2936
+ /* @__PURE__ */ jsx67("div", { className: "chips-container", children: /* @__PURE__ */ jsx67(
3109
2937
  Chips,
3110
2938
  {
3111
2939
  chips: tabs.map((tab, index) => ({ label: tab.title, value: index })),
@@ -3113,7 +2941,7 @@ function ChipsTabsRendererComponent({ margin, tabs }) {
3113
2941
  onChange: ({ selectedValue }) => setSelectedIndex(Number(selectedValue))
3114
2942
  }
3115
2943
  ) }),
3116
- /* @__PURE__ */ jsx71("div", { className: "m-t-2", children: (_a = tabs[selectedIndex]) == null ? void 0 : _a.children })
2944
+ /* @__PURE__ */ jsx67("div", { className: "m-t-2", children: (_a = tabs[selectedIndex]) == null ? void 0 : _a.children })
3117
2945
  ] });
3118
2946
  }
3119
2947
 
@@ -3128,7 +2956,7 @@ import {
3128
2956
  TextArea,
3129
2957
  TextareaWithDisplayFormat
3130
2958
  } from "@transferwise/components";
3131
- import { jsx as jsx72 } from "react/jsx-runtime";
2959
+ import { jsx as jsx68 } from "react/jsx-runtime";
3132
2960
  var commonKeys = [
3133
2961
  "autoComplete",
3134
2962
  "autoCapitalize",
@@ -3147,12 +2975,12 @@ function VariableTextInput(inputProps) {
3147
2975
  const commonProps = __spreadProps(__spreadValues({}, pick(inputProps, ...commonKeys)), { name: id });
3148
2976
  switch (control) {
3149
2977
  case "email":
3150
- return /* @__PURE__ */ jsx72(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "email", onChange }));
2978
+ return /* @__PURE__ */ jsx68(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "email", onChange }));
3151
2979
  case "password":
3152
- return /* @__PURE__ */ jsx72(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "password", onChange }));
2980
+ return /* @__PURE__ */ jsx68(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "password", onChange }));
3153
2981
  case "numeric": {
3154
2982
  const numericProps = __spreadProps(__spreadValues({}, commonProps), { type: "number", onWheel });
3155
- return /* @__PURE__ */ jsx72(
2983
+ return /* @__PURE__ */ jsx68(
3156
2984
  TextInput,
3157
2985
  __spreadProps(__spreadValues({}, numericProps), {
3158
2986
  onChange: (newValue) => {
@@ -3163,9 +2991,9 @@ function VariableTextInput(inputProps) {
3163
2991
  );
3164
2992
  }
3165
2993
  case "phone-number":
3166
- return /* @__PURE__ */ jsx72(PhoneNumberInput, __spreadProps(__spreadValues({ initialValue: value }, commonProps), { onChange }));
2994
+ return /* @__PURE__ */ jsx68(PhoneNumberInput, __spreadProps(__spreadValues({ initialValue: value }, commonProps), { onChange }));
3167
2995
  default: {
3168
- return /* @__PURE__ */ jsx72(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "text", onChange }));
2996
+ return /* @__PURE__ */ jsx68(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "text", onChange }));
3169
2997
  }
3170
2998
  }
3171
2999
  }
@@ -3173,11 +3001,11 @@ function TextInput(props) {
3173
3001
  const _a = props, { control, displayFormat, onChange } = _a, commonProps = __objRest(_a, ["control", "displayFormat", "onChange"]);
3174
3002
  const InputWithPattern = control === "textarea" ? TextareaWithDisplayFormat : InputWithDisplayFormat;
3175
3003
  const InputWithoutPattern = control === "textarea" ? TextArea : Input5;
3176
- return displayFormat ? /* @__PURE__ */ jsx72(InputWithPattern, __spreadProps(__spreadValues({ displayPattern: displayFormat }, commonProps), { onChange })) : /* @__PURE__ */ jsx72(InputWithoutPattern, __spreadProps(__spreadValues({}, commonProps), { onChange: (e) => onChange(e.target.value) }));
3004
+ return displayFormat ? /* @__PURE__ */ jsx68(InputWithPattern, __spreadProps(__spreadValues({ displayPattern: displayFormat }, commonProps), { onChange })) : /* @__PURE__ */ jsx68(InputWithoutPattern, __spreadProps(__spreadValues({}, commonProps), { onChange: (e) => onChange(e.target.value) }));
3177
3005
  }
3178
3006
 
3179
3007
  // ../renderers/src/TextInputRenderer.tsx
3180
- import { jsx as jsx73 } from "react/jsx-runtime";
3008
+ import { jsx as jsx69 } from "react/jsx-runtime";
3181
3009
  var TextInputRenderer = {
3182
3010
  canRenderType: "input-text",
3183
3011
  render: (props) => {
@@ -3210,7 +3038,7 @@ var TextInputRenderer = {
3210
3038
  }
3211
3039
  }
3212
3040
  });
3213
- return /* @__PURE__ */ jsx73(
3041
+ return /* @__PURE__ */ jsx69(
3214
3042
  FieldInput_default,
3215
3043
  {
3216
3044
  id,
@@ -3218,7 +3046,7 @@ var TextInputRenderer = {
3218
3046
  description,
3219
3047
  validation: validationState,
3220
3048
  help,
3221
- children: /* @__PURE__ */ jsx73(InputGroup3, { addonStart: getInputGroupAddonStart(media), children: /* @__PURE__ */ jsx73(VariableTextInput, __spreadValues({}, inputProps)) })
3049
+ children: /* @__PURE__ */ jsx69(InputGroup3, { addonStart: getInputGroupAddonStart(media), children: /* @__PURE__ */ jsx69(VariableTextInput, __spreadValues({}, inputProps)) })
3222
3050
  }
3223
3051
  );
3224
3052
  }
@@ -3232,7 +3060,7 @@ import { Status as Status2, Upload, UploadInput as UploadInput2 } from "@transfe
3232
3060
  var getRandomId = () => Math.random().toString(36).substring(2);
3233
3061
 
3234
3062
  // ../renderers/src/UploadInputRenderer.tsx
3235
- import { jsx as jsx74 } from "react/jsx-runtime";
3063
+ import { jsx as jsx70 } from "react/jsx-runtime";
3236
3064
  var UploadInputRenderer = {
3237
3065
  canRenderType: "input-upload",
3238
3066
  render: (props) => {
@@ -3248,14 +3076,14 @@ var UploadInputRenderer = {
3248
3076
  };
3249
3077
  return (
3250
3078
  // We don't pass help here as there is no sensible place to display it
3251
- /* @__PURE__ */ jsx74(
3079
+ /* @__PURE__ */ jsx70(
3252
3080
  UploadFieldInput_default,
3253
3081
  {
3254
3082
  id,
3255
3083
  label: void 0,
3256
3084
  description: void 0,
3257
3085
  validation: validationState,
3258
- children: /* @__PURE__ */ jsx74(
3086
+ children: /* @__PURE__ */ jsx70(
3259
3087
  UploadInput2,
3260
3088
  {
3261
3089
  id,
@@ -3321,7 +3149,7 @@ var LargeUploadRenderer = {
3321
3149
  };
3322
3150
  const filetypes = acceptsToFileTypes(accepts);
3323
3151
  const usAccept = filetypes === "*" ? "*" : filetypes.join(",");
3324
- return /* @__PURE__ */ jsx74(
3152
+ return /* @__PURE__ */ jsx70(
3325
3153
  FieldInput_default,
3326
3154
  {
3327
3155
  id,
@@ -3329,7 +3157,7 @@ var LargeUploadRenderer = {
3329
3157
  description,
3330
3158
  validation: validationState,
3331
3159
  help,
3332
- children: /* @__PURE__ */ jsx74(
3160
+ children: /* @__PURE__ */ jsx70(
3333
3161
  Upload,
3334
3162
  __spreadProps(__spreadValues({}, uploadProps), {
3335
3163
  usAccept,
@@ -3344,89 +3172,85 @@ var LargeUploadRenderer = {
3344
3172
  }
3345
3173
  };
3346
3174
 
3347
- // ../renderers/src/NewListItem/NewDecisionRenderer.tsx
3348
- import { ListItem as ListItem4 } from "@transferwise/components";
3349
-
3350
- // ../renderers/src/NewListItem/getInlineAlert.tsx
3351
- import { ListItem as ListItem2 } from "@transferwise/components";
3352
- import { jsx as jsx75 } from "react/jsx-runtime";
3353
- var getInlineAlert = (inlineAlert) => inlineAlert ? /* @__PURE__ */ jsx75(ListItem2.Prompt, { sentiment: inlineAlert == null ? void 0 : inlineAlert.context, children: inlineAlert.content }) : void 0;
3354
-
3355
- // ../renderers/src/NewListItem/getAdditionalInfo.tsx
3356
- import { ListItem as ListItem3 } from "@transferwise/components";
3357
- import { jsx as jsx76 } from "react/jsx-runtime";
3358
- var getAdditionalInfo = (additionalInfo) => {
3359
- if (!additionalInfo) {
3360
- return void 0;
3361
- }
3362
- const { href, text, onClick } = additionalInfo;
3363
- if (href || onClick) {
3364
- return /* @__PURE__ */ jsx76(
3365
- ListItem3.AdditionalInfo,
3175
+ // ../renderers/src/ProgressRenderer.tsx
3176
+ import { ProgressBar } from "@transferwise/components";
3177
+ import { jsx as jsx71 } from "react/jsx-runtime";
3178
+ var ProgressRenderer = {
3179
+ canRenderType: "progress",
3180
+ render: ({ uid, title, help, progress, progressText, margin, description }) => {
3181
+ return /* @__PURE__ */ jsx71(
3182
+ ProgressBar,
3366
3183
  {
3367
- action: {
3368
- label: text,
3369
- href,
3370
- onClick,
3371
- target: "_blank"
3372
- }
3373
- }
3184
+ id: uid,
3185
+ className: getMargin(margin),
3186
+ title: title && help ? /* @__PURE__ */ jsx71(LabelContentWithHelp, { text: title, help }) : title,
3187
+ description,
3188
+ progress: {
3189
+ max: 1,
3190
+ value: progress
3191
+ },
3192
+ textEnd: progressText
3193
+ }
3374
3194
  );
3375
3195
  }
3376
- return /* @__PURE__ */ jsx76(ListItem3.AdditionalInfo, { children: additionalInfo == null ? void 0 : additionalInfo.text });
3377
3196
  };
3378
3197
 
3379
- // ../renderers/src/NewListItem/shouldUseAvatar.ts
3380
- var shouldUseAvatar = (control, tags) => {
3381
- var _a;
3382
- return control === "with-avatar" || ((_a = tags == null ? void 0 : tags.includes("with-avatar")) != null ? _a : false);
3383
- };
3198
+ // ../renderers/src/ReviewRenderer.tsx
3199
+ import { ListItem as ListItem7, Markdown as Markdown6, Popover } from "@transferwise/components";
3200
+ import { QuestionMarkCircle } from "@transferwise/icons";
3201
+ import { useIntl as useIntl12 } from "react-intl";
3384
3202
 
3385
- // ../renderers/src/NewListItem/NewDecisionRenderer.tsx
3386
- import { Fragment as Fragment11, jsx as jsx77 } from "react/jsx-runtime";
3387
- var DecisionRenderer2 = {
3388
- canRenderType: "decision",
3389
- render: (props) => /* @__PURE__ */ jsx77(DecisionWrapper, __spreadProps(__spreadValues({}, props), { renderDecisionList: renderDecisionList2 }))
3203
+ // ../renderers/src/components/Header.tsx
3204
+ import { Header as DSHeader } from "@transferwise/components";
3205
+ import { jsx as jsx72 } from "react/jsx-runtime";
3206
+ var Header7 = ({ title, callToAction }) => (title || callToAction) && /* @__PURE__ */ jsx72(DSHeader, { title: title != null ? title : "", action: getHeaderAction2(callToAction) });
3207
+ var getHeaderAction2 = (callToAction) => {
3208
+ if (!callToAction) {
3209
+ return void 0;
3210
+ }
3211
+ const { accessibilityDescription, href, title, onClick } = callToAction;
3212
+ return href ? {
3213
+ "aria-label": accessibilityDescription,
3214
+ text: title,
3215
+ href,
3216
+ target: "_blank"
3217
+ } : {
3218
+ "aria-label": accessibilityDescription,
3219
+ text: title,
3220
+ onClick: (event) => {
3221
+ event.preventDefault();
3222
+ onClick();
3223
+ }
3224
+ };
3390
3225
  };
3391
- var renderDecisionList2 = ({ options, control }) => {
3392
- return /* @__PURE__ */ jsx77(Fragment11, { children: options.map((_a) => {
3393
- var _b = _a, { disabled, onClick } = _b, rest = __objRest(_b, ["disabled", "onClick"]);
3394
- const {
3395
- description,
3396
- media,
3397
- title: itemTitle,
3398
- href,
3399
- additionalText,
3400
- inlineAlert,
3401
- supportingValues,
3402
- tags
3403
- } = rest;
3404
- return /* @__PURE__ */ jsx77(
3405
- ListItem4,
3226
+
3227
+ // ../renderers/src/utils/listItem/getAdditionalInfo.tsx
3228
+ import { ListItem as ListItem5 } from "@transferwise/components";
3229
+ import { jsx as jsx73 } from "react/jsx-runtime";
3230
+ var getAdditionalInfo = (additionalInfo) => {
3231
+ if (!additionalInfo) {
3232
+ return void 0;
3233
+ }
3234
+ const { href, text, onClick } = additionalInfo;
3235
+ if (href || onClick) {
3236
+ return /* @__PURE__ */ jsx73(
3237
+ ListItem5.AdditionalInfo,
3406
3238
  {
3407
- title: itemTitle,
3408
- subtitle: description,
3409
- spotlight: control === "spotlight" ? (tags == null ? void 0 : tags.includes("spotlight-active")) ? "active" : "inactive" : void 0,
3410
- disabled,
3411
- valueTitle: supportingValues == null ? void 0 : supportingValues.value,
3412
- valueSubtitle: supportingValues == null ? void 0 : supportingValues.subvalue,
3413
- media: getMedia(media, shouldUseAvatar(control, tags)),
3414
- prompt: getInlineAlert(inlineAlert),
3415
- additionalInfo: additionalText ? getAdditionalInfo({ text: additionalText }) : void 0,
3416
- control: href ? /* @__PURE__ */ jsx77(ListItem4.Navigation, { href, target: "_blank" }) : /* @__PURE__ */ jsx77(ListItem4.Navigation, { onClick })
3417
- },
3418
- JSON.stringify(rest)
3239
+ action: {
3240
+ label: text,
3241
+ href,
3242
+ onClick,
3243
+ target: "_blank"
3244
+ }
3245
+ }
3419
3246
  );
3420
- }) });
3247
+ }
3248
+ return /* @__PURE__ */ jsx73(ListItem5.AdditionalInfo, { children: additionalInfo == null ? void 0 : additionalInfo.text });
3421
3249
  };
3422
- var NewDecisionRenderer_default = DecisionRenderer2;
3423
3250
 
3424
- // ../renderers/src/NewListItem/NewListRenderer.tsx
3251
+ // ../renderers/src/utils/listItem/getCTAControl.tsx
3425
3252
  import { ListItem as ListItem6 } from "@transferwise/components";
3426
-
3427
- // ../renderers/src/NewListItem/getCTAControl.tsx
3428
- import { ListItem as ListItem5 } from "@transferwise/components";
3429
- import { jsx as jsx78 } from "react/jsx-runtime";
3253
+ import { jsx as jsx74 } from "react/jsx-runtime";
3430
3254
  var getCTAControl = (callToAction, { ctaSecondary, fullyInteractive }) => {
3431
3255
  if (!callToAction) {
3432
3256
  return void 0;
@@ -3434,8 +3258,8 @@ var getCTAControl = (callToAction, { ctaSecondary, fullyInteractive }) => {
3434
3258
  const { accessibilityDescription, href, title, onClick } = callToAction;
3435
3259
  const priority = ctaSecondary ? "secondary" : "secondary-neutral";
3436
3260
  if (href) {
3437
- return /* @__PURE__ */ jsx78(
3438
- ListItem5.Button,
3261
+ return /* @__PURE__ */ jsx74(
3262
+ ListItem6.Button,
3439
3263
  {
3440
3264
  href,
3441
3265
  partiallyInteractive: !fullyInteractive,
@@ -3445,8 +3269,8 @@ var getCTAControl = (callToAction, { ctaSecondary, fullyInteractive }) => {
3445
3269
  }
3446
3270
  );
3447
3271
  }
3448
- return /* @__PURE__ */ jsx78(
3449
- ListItem5.Button,
3272
+ return /* @__PURE__ */ jsx74(
3273
+ ListItem6.Button,
3450
3274
  {
3451
3275
  "aria-description": accessibilityDescription,
3452
3276
  partiallyInteractive: !fullyInteractive,
@@ -3457,62 +3281,37 @@ var getCTAControl = (callToAction, { ctaSecondary, fullyInteractive }) => {
3457
3281
  );
3458
3282
  };
3459
3283
 
3460
- // ../renderers/src/NewListItem/NewListRenderer.tsx
3461
- import { jsx as jsx79, jsxs as jsxs30 } from "react/jsx-runtime";
3462
- var ListRenderer2 = {
3463
- canRenderType: "list",
3464
- render: ({ callToAction, control, margin, items, tags, title }) => /* @__PURE__ */ jsxs30("div", { className: getMargin(margin), children: [
3465
- /* @__PURE__ */ jsx79(Header7, { title, callToAction }),
3466
- items.map((item) => {
3467
- var _a, _b;
3468
- const {
3469
- title: itemTitle,
3470
- description,
3471
- supportingValues,
3472
- media,
3473
- additionalInfo,
3474
- inlineAlert,
3475
- callToAction: itemCallToAction,
3476
- tags: itemTags
3477
- } = item;
3478
- const controlOptions = {
3479
- ctaSecondary: (_a = itemTags == null ? void 0 : itemTags.includes("cta-secondary")) != null ? _a : false,
3480
- fullyInteractive: (_b = (tags == null ? void 0 : tags.includes("fully-interactive")) && (additionalInfo == null ? void 0 : additionalInfo.onClick) == null) != null ? _b : false
3481
- };
3482
- return /* @__PURE__ */ jsx79(
3483
- ListItem6,
3484
- {
3485
- title: itemTitle,
3486
- subtitle: description,
3487
- valueTitle: supportingValues == null ? void 0 : supportingValues.value,
3488
- valueSubtitle: supportingValues == null ? void 0 : supportingValues.subvalue,
3489
- media: getMedia(media, shouldUseAvatar(control, itemTags)),
3490
- prompt: getInlineAlert(inlineAlert),
3491
- additionalInfo: getAdditionalInfo(additionalInfo),
3492
- control: getCTAControl(itemCallToAction, controlOptions)
3493
- },
3494
- itemTitle
3495
- );
3496
- })
3497
- ] })
3284
+ // ../renderers/src/utils/listItem/shouldUseAvatar.ts
3285
+ var shouldUseAvatar = (control, tags) => {
3286
+ var _a;
3287
+ return control === "with-avatar" || ((_a = tags == null ? void 0 : tags.includes("with-avatar")) != null ? _a : false);
3498
3288
  };
3499
- var NewListRenderer_default = ListRenderer2;
3500
3289
 
3501
- // ../renderers/src/NewListItem/NewReviewRenderer.tsx
3502
- import { ListItem as ListItem7, Markdown as Markdown6, Popover } from "@transferwise/components";
3503
- import { QuestionMarkCircle } from "@transferwise/icons";
3504
- import { jsx as jsx80, jsxs as jsxs31 } from "react/jsx-runtime";
3290
+ // ../renderers/src/ReviewRenderer.tsx
3291
+ import { jsx as jsx75, jsxs as jsxs26 } from "react/jsx-runtime";
3505
3292
  var IGNORED_CONTROLS = [
3506
3293
  "horizontal",
3507
3294
  "horizontal-end-aligned",
3508
3295
  "horizontal-start-aligned",
3509
3296
  "vertical-two-column"
3510
3297
  ];
3511
- var ReviewRenderer2 = {
3298
+ var ReviewRenderer = {
3512
3299
  canRenderType: "review",
3513
3300
  canRender: ({ control }) => control ? !IGNORED_CONTROLS.includes(control) : true,
3514
- render: ({ callToAction, control, margin, fields, tags, title }) => /* @__PURE__ */ jsxs31("div", { className: getMargin(margin), children: [
3515
- /* @__PURE__ */ jsx80(Header7, { title, callToAction }),
3301
+ render: (props) => /* @__PURE__ */ jsx75(Review, __spreadValues({}, props))
3302
+ };
3303
+ var Review = ({
3304
+ callToAction,
3305
+ control,
3306
+ margin,
3307
+ fields,
3308
+ tags,
3309
+ title,
3310
+ trackEvent
3311
+ }) => {
3312
+ const intl = useIntl12();
3313
+ return /* @__PURE__ */ jsxs26("div", { className: getMargin(margin), children: [
3314
+ /* @__PURE__ */ jsx75(Header7, { title, callToAction }),
3516
3315
  fields.map((field) => {
3517
3316
  var _a, _b, _c;
3518
3317
  const {
@@ -3522,6 +3321,7 @@ var ReviewRenderer2 = {
3522
3321
  additionalInfo,
3523
3322
  inlineAlert,
3524
3323
  help,
3324
+ analyticsId,
3525
3325
  callToAction: itemCallToAction,
3526
3326
  tags: itemTags
3527
3327
  } = field;
@@ -3529,199 +3329,579 @@ var ReviewRenderer2 = {
3529
3329
  ctaSecondary: (_a = itemTags == null ? void 0 : itemTags.includes("cta-secondary")) != null ? _a : false,
3530
3330
  fullyInteractive: (_b = (tags == null ? void 0 : tags.includes("fully-interactive")) && (additionalInfo == null ? void 0 : additionalInfo.onClick) == null) != null ? _b : false
3531
3331
  };
3532
- return /* @__PURE__ */ jsx80(
3332
+ return /* @__PURE__ */ jsx75(
3533
3333
  ListItem7,
3534
3334
  {
3535
3335
  title: value,
3536
3336
  subtitle: label,
3537
3337
  inverted: true,
3538
3338
  media: getMedia(media, shouldUseAvatar(control, itemTags)),
3539
- control: (_c = getCTAControl(itemCallToAction, controlOptions)) != null ? _c : getHelpControl(help),
3339
+ control: (_c = getCTAControl(itemCallToAction, controlOptions)) != null ? _c : help ? getHelpControl(
3340
+ help,
3341
+ intl.formatMessage(help_messages_default.helpAria),
3342
+ () => trackEvent("Help Pressed", { layoutItemId: analyticsId })
3343
+ ) : void 0,
3540
3344
  prompt: getInlineAlert(inlineAlert),
3541
3345
  additionalInfo: getAdditionalInfo(additionalInfo)
3542
3346
  },
3543
3347
  JSON.stringify(field)
3544
3348
  );
3545
3349
  })
3546
- ] })
3350
+ ] });
3547
3351
  };
3548
- var getHelpControl = (help) => {
3549
- if (!help) {
3550
- return void 0;
3551
- }
3552
- return /* @__PURE__ */ jsx80(Popover, { content: /* @__PURE__ */ jsx80(Markdown6, { config: { link: { target: "_blank" } }, children: help }), children: /* @__PURE__ */ jsx80(ListItem7.IconButton, { partiallyInteractive: true, children: /* @__PURE__ */ jsx80(QuestionMarkCircle, {}) }) });
3352
+ var getHelpControl = (help, ariaLabel, onClick) => {
3353
+ return /* @__PURE__ */ jsx75(Popover, { content: /* @__PURE__ */ jsx75(Markdown6, { config: { link: { target: "_blank" } }, children: help }), children: /* @__PURE__ */ jsx75(ListItem7.IconButton, { partiallyInteractive: true, "aria-label": ariaLabel, onClick, children: /* @__PURE__ */ jsx75(QuestionMarkCircle, {}) }) });
3553
3354
  };
3554
- var NewReviewRenderer_default = ReviewRenderer2;
3355
+ var ReviewRenderer_default = ReviewRenderer;
3555
3356
 
3556
- // ../renderers/src/NewListItem/NewStatusListRenderer.tsx
3557
- import { AvatarView as AvatarView4, Header as Header11, ListItem as ListItem8 } from "@transferwise/components";
3558
- import { jsx as jsx81, jsxs as jsxs32 } from "react/jsx-runtime";
3559
- var NewStatusListRenderer = {
3560
- canRenderType: "status-list",
3561
- render: ({ margin, items, title }) => /* @__PURE__ */ jsxs32("div", { className: getMargin(margin), children: [
3562
- title ? /* @__PURE__ */ jsx81(Header11, { title }) : null,
3563
- items.map((item) => {
3564
- const { callToAction, description, icon, status, title: itemTitle } = item;
3565
- return /* @__PURE__ */ jsx81(
3566
- ListItem8,
3567
- {
3568
- title: itemTitle,
3569
- subtitle: description,
3570
- media: icon && "name" in icon ? /* @__PURE__ */ jsx81(AvatarView4, { badge: { status: mapStatus2(status) }, children: /* @__PURE__ */ jsx81(DynamicIcon_default, { name: icon.name }) }) : void 0,
3571
- additionalInfo: callToAction ? /* @__PURE__ */ jsx81(
3572
- ListItem8.AdditionalInfo,
3573
- {
3574
- action: {
3575
- href: callToAction.href,
3576
- onClick: callToAction.href ? void 0 : callToAction.onClick,
3577
- label: callToAction.title,
3578
- target: "_blank"
3579
- }
3580
- }
3581
- ) : void 0
3582
- },
3583
- JSON.stringify(item)
3584
- );
3585
- })
3586
- ] })
3587
- };
3588
- var mapStatus2 = (status) => {
3589
- switch (status) {
3590
- case "done":
3591
- return "positive";
3592
- case "pending":
3593
- return "pending";
3594
- default:
3595
- return void 0;
3596
- }
3597
- };
3598
- var NewStatusListRenderer_default = NewStatusListRenderer;
3357
+ // ../renderers/src/DecisionRenderer/DecisionRenderer.tsx
3358
+ import { ListItem as ListItem8 } from "@transferwise/components";
3599
3359
 
3600
- // ../renderers/src/ButtonRenderer/ButtonRendererV2.tsx
3601
- import { Button as Button8 } from "@transferwise/components";
3360
+ // ../renderers/src/DecisionRenderer/DecisionWrapper.tsx
3361
+ import { Header as Header9, SearchInput } from "@transferwise/components";
3362
+ import { useState as useState11 } from "react";
3363
+ import { useIntl as useIntl14 } from "react-intl";
3602
3364
 
3603
- // ../renderers/src/utils/isButtonPriority.ts
3604
- var validPriorities = ["primary", "secondary", "secondary-neutral", "tertiary"];
3605
- var isButtonPriority = (control) => validPriorities.includes(control);
3365
+ // ../renderers/src/messages/filter.messages.ts
3366
+ import { defineMessages as defineMessages11 } from "react-intl";
3367
+ var filter_messages_default = defineMessages11({
3368
+ placeholder: {
3369
+ id: "df.wise.filter.placeholder",
3370
+ defaultMessage: "Start typing to search",
3371
+ description: "Placeholder for the filter input"
3372
+ },
3373
+ results: {
3374
+ id: "df.wise.filter.results",
3375
+ defaultMessage: "Search results",
3376
+ description: "Label for the results section"
3377
+ },
3378
+ noResults: {
3379
+ id: "df.wise.filter.noResults",
3380
+ defaultMessage: "No results",
3381
+ description: "Message for if there are no results"
3382
+ }
3383
+ });
3606
3384
 
3607
- // ../renderers/src/ButtonRenderer/ButtonRendererV2.tsx
3608
- import { useEffect as useEffect9, useState as useState12 } from "react";
3609
- import { jsx as jsx82 } from "react/jsx-runtime";
3610
- var ButtonRendererV2 = {
3611
- canRenderType: "button",
3612
- render: ButtonComponent2
3613
- };
3614
- function ButtonComponent2(props) {
3615
- const { control, context, disabled, margin, title, size, stepLoadingState, onClick } = props;
3616
- const [spinny, setSpinny] = useState12(false);
3617
- useEffect9(() => {
3618
- if (stepLoadingState === "idle") {
3619
- setSpinny(false);
3385
+ // ../renderers/src/DecisionRenderer/filter-and-sort-decision-options.ts
3386
+ function filterAndSortDecisionOptions(selectOptions, query) {
3387
+ const upperQuery = normalizeAndRemoveAccents(query);
3388
+ const filteredItems = selectOptions.filter((option) => {
3389
+ var _a, _b, _c, _d;
3390
+ const searchableWords = [
3391
+ option.title,
3392
+ option.description,
3393
+ option.additionalText,
3394
+ (_a = option.supportingValues) == null ? void 0 : _a.value,
3395
+ (_b = option.supportingValues) == null ? void 0 : _b.subvalue,
3396
+ ...(_c = option.keywords) != null ? _c : []
3397
+ ];
3398
+ return (_d = searchableWords.some(
3399
+ (word) => word && normalizeAndRemoveAccents(word).includes(upperQuery)
3400
+ )) != null ? _d : false;
3401
+ });
3402
+ return [...filteredItems].sort((a, b) => {
3403
+ if (a.disabled && !b.disabled) {
3404
+ return 1;
3620
3405
  }
3621
- }, [stepLoadingState]);
3622
- const loading = spinny && stepLoadingState !== "idle";
3623
- return /* @__PURE__ */ jsx82(
3624
- Button8,
3625
- {
3626
- v2: true,
3627
- block: true,
3628
- className: getMargin(margin),
3629
- disabled,
3630
- priority: getPriority3(control),
3631
- loading,
3632
- size: mapButtonSize(size),
3633
- sentiment: getSentiment2(context),
3634
- onClick: () => {
3635
- setSpinny(true);
3636
- onClick();
3637
- },
3638
- children: title
3406
+ if (!a.disabled && b.disabled) {
3407
+ return -1;
3639
3408
  }
3640
- );
3641
- }
3642
- var getSentiment2 = (context) => context === "negative" ? "negative" : "default";
3643
- var getPriority3 = (control) => control && isButtonPriority(control) ? control : "secondary";
3644
-
3645
- // ../renderers/src/ProgressRenderer.tsx
3646
- import { ProgressBar } from "@transferwise/components";
3647
- import { jsx as jsx83 } from "react/jsx-runtime";
3648
- var ProgressRenderer = {
3649
- canRenderType: "progress",
3650
- render: ({ uid, title, help, progress, progressText, margin, description }) => {
3651
- return /* @__PURE__ */ jsx83(
3652
- ProgressBar,
3653
- {
3654
- id: uid,
3655
- className: getMargin(margin),
3656
- title: title && help ? /* @__PURE__ */ jsx83(LabelContentWithHelp, { text: title, help }) : title,
3657
- description,
3658
- progress: {
3659
- max: 1,
3660
- value: progress
3661
- },
3662
- textEnd: progressText
3409
+ const aTitleUpper = a.title.toUpperCase();
3410
+ const bTitleUpper = b.title.toUpperCase();
3411
+ const aTitleStarts = aTitleUpper.startsWith(upperQuery);
3412
+ const bTitleStarts = bTitleUpper.startsWith(upperQuery);
3413
+ if (aTitleStarts && !bTitleStarts) {
3414
+ return -1;
3415
+ }
3416
+ if (!aTitleStarts && bTitleStarts) {
3417
+ return 1;
3418
+ }
3419
+ const aWordStarts = aTitleUpper.split(" ").some((word) => word.startsWith(upperQuery));
3420
+ const bWordStarts = bTitleUpper.split(" ").some((word) => word.startsWith(upperQuery));
3421
+ if (aWordStarts && !bWordStarts) {
3422
+ return -1;
3423
+ }
3424
+ if (!aWordStarts && bWordStarts) {
3425
+ return 1;
3426
+ }
3427
+ return a.title.localeCompare(b.title);
3428
+ });
3429
+ }
3430
+ var normalizeAndRemoveAccents = (text) => text.trim().toLowerCase().normalize("NFKD").replace(new RegExp("\\p{Diacritic}", "gu"), "");
3431
+
3432
+ // ../renderers/src/DecisionRenderer/GroupedDecisionList.tsx
3433
+ import { Header as Header8, Section } from "@transferwise/components";
3434
+ import { useIntl as useIntl13 } from "react-intl";
3435
+ import { Fragment as Fragment9, jsx as jsx76, jsxs as jsxs27 } from "react/jsx-runtime";
3436
+ var groupingTags2 = Object.keys(group_messages_default).filter((key) => key !== "all");
3437
+ var isGroupedDecision = (options) => {
3438
+ return getGroupsFromTags(groupingTags2, options).length > 0;
3439
+ };
3440
+ var GroupedDecisionList = (_a) => {
3441
+ var _b = _a, { renderDecisionList: renderDecisionList2 } = _b, rest = __objRest(_b, ["renderDecisionList"]);
3442
+ const { formatMessage } = useIntl13();
3443
+ const { options } = rest;
3444
+ const itemsByTag = [...getGroupsFromTags(groupingTags2, options), { tag: "all", items: options }];
3445
+ return /* @__PURE__ */ jsx76(Fragment9, { children: itemsByTag.map(({ tag, items }) => /* @__PURE__ */ jsxs27(Section, { children: [
3446
+ /* @__PURE__ */ jsx76(
3447
+ Header8,
3448
+ {
3449
+ as: "h2",
3450
+ title: tag in group_messages_default ? formatMessage(group_messages_default[tag]) : tag
3451
+ }
3452
+ ),
3453
+ renderDecisionList2(__spreadProps(__spreadValues({}, rest), { options: items }))
3454
+ ] }, tag)) });
3455
+ };
3456
+
3457
+ // ../renderers/src/DecisionRenderer/DecisionWrapper.tsx
3458
+ import { Fragment as Fragment10, jsx as jsx77, jsxs as jsxs28 } from "react/jsx-runtime";
3459
+ var DecisionWrapper = (props) => {
3460
+ return /* @__PURE__ */ jsxs28("div", { className: getMargin(props.margin), children: [
3461
+ props.title && /* @__PURE__ */ jsx77(Header9, { as: "h2", title: props.title }),
3462
+ props.control === "filtered" ? /* @__PURE__ */ jsx77(FilteredDecisionList, __spreadValues({}, props)) : /* @__PURE__ */ jsx77(UnfilteredDecisionList, __spreadValues({}, props))
3463
+ ] });
3464
+ };
3465
+ var UnfilteredDecisionList = (_a) => {
3466
+ var _b = _a, { renderDecisionList: renderDecisionList2 } = _b, rest = __objRest(_b, ["renderDecisionList"]);
3467
+ return isGroupedDecision(rest.options) ? /* @__PURE__ */ jsx77(GroupedDecisionList, __spreadProps(__spreadValues({}, rest), { renderDecisionList: renderDecisionList2 })) : renderDecisionList2(rest);
3468
+ };
3469
+ var FilteredDecisionList = (props) => {
3470
+ const { formatMessage } = useIntl14();
3471
+ const [query, setQuery] = useState11("");
3472
+ const { control, options, renderDecisionList: renderDecisionList2 } = props;
3473
+ const filteredOptions = (query == null ? void 0 : query.length) > 0 ? filterAndSortDecisionOptions(options, query) : options;
3474
+ const isGrouped = isGroupedDecision(options);
3475
+ return /* @__PURE__ */ jsxs28(Fragment10, { children: [
3476
+ /* @__PURE__ */ jsx77(
3477
+ SearchInput,
3478
+ {
3479
+ placeholder: formatMessage(filter_messages_default.placeholder),
3480
+ value: query,
3481
+ className: "m-b-2",
3482
+ onChange: (e) => {
3483
+ var _a;
3484
+ return setQuery((_a = e.target.value) != null ? _a : "");
3485
+ }
3486
+ }
3487
+ ),
3488
+ isGrouped && query.length === 0 ? /* @__PURE__ */ jsx77(GroupedDecisionList, __spreadValues({}, props)) : /* @__PURE__ */ jsxs28(Fragment10, { children: [
3489
+ query.length > 0 && /* @__PURE__ */ jsx77(Header9, { as: "h2", title: formatMessage(filter_messages_default.results), className: "m-t-4" }),
3490
+ filteredOptions.length > 0 ? renderDecisionList2({
3491
+ control,
3492
+ className: query.length === 0 ? "m-t-3" : "",
3493
+ options: filteredOptions
3494
+ }) : /* @__PURE__ */ jsx77("p", { children: formatMessage(filter_messages_default.noResults) })
3495
+ ] })
3496
+ ] });
3497
+ };
3498
+
3499
+ // ../renderers/src/DecisionRenderer/DecisionRenderer.tsx
3500
+ import { Fragment as Fragment11, jsx as jsx78 } from "react/jsx-runtime";
3501
+ var DecisionRenderer = {
3502
+ canRenderType: "decision",
3503
+ render: (props) => /* @__PURE__ */ jsx78(DecisionWrapper, __spreadProps(__spreadValues({}, props), { renderDecisionList }))
3504
+ };
3505
+ var renderDecisionList = ({ options, control }) => {
3506
+ return /* @__PURE__ */ jsx78(Fragment11, { children: options.map((_a) => {
3507
+ var _b = _a, { disabled, onClick } = _b, rest = __objRest(_b, ["disabled", "onClick"]);
3508
+ const {
3509
+ description,
3510
+ media,
3511
+ title: itemTitle,
3512
+ href,
3513
+ additionalText,
3514
+ inlineAlert,
3515
+ supportingValues,
3516
+ tags
3517
+ } = rest;
3518
+ return /* @__PURE__ */ jsx78(
3519
+ ListItem8,
3520
+ {
3521
+ title: itemTitle,
3522
+ subtitle: description,
3523
+ spotlight: control === "spotlight" ? (tags == null ? void 0 : tags.includes("spotlight-active")) ? "active" : "inactive" : void 0,
3524
+ disabled,
3525
+ valueTitle: supportingValues == null ? void 0 : supportingValues.value,
3526
+ valueSubtitle: supportingValues == null ? void 0 : supportingValues.subvalue,
3527
+ media: getMedia(media, shouldUseAvatar(control, tags)),
3528
+ prompt: getInlineAlert(inlineAlert),
3529
+ additionalInfo: additionalText ? getAdditionalInfo({ text: additionalText }) : void 0,
3530
+ control: href ? /* @__PURE__ */ jsx78(ListItem8.Navigation, { href, target: "_blank" }) : /* @__PURE__ */ jsx78(ListItem8.Navigation, { onClick })
3531
+ },
3532
+ JSON.stringify(rest)
3533
+ );
3534
+ }) });
3535
+ };
3536
+ var DecisionRenderer_default = DecisionRenderer;
3537
+
3538
+ // ../renderers/src/ListRenderer.tsx
3539
+ import { ListItem as ListItem9 } from "@transferwise/components";
3540
+ import { jsx as jsx79, jsxs as jsxs29 } from "react/jsx-runtime";
3541
+ var ListRenderer = {
3542
+ canRenderType: "list",
3543
+ render: ({ callToAction, control, margin, items, tags, title }) => /* @__PURE__ */ jsxs29("div", { className: getMargin(margin), children: [
3544
+ /* @__PURE__ */ jsx79(Header7, { title, callToAction }),
3545
+ items.map((item) => {
3546
+ var _a, _b;
3547
+ const {
3548
+ title: itemTitle,
3549
+ description,
3550
+ supportingValues,
3551
+ media,
3552
+ additionalInfo,
3553
+ inlineAlert,
3554
+ callToAction: itemCallToAction,
3555
+ tags: itemTags
3556
+ } = item;
3557
+ const controlOptions = {
3558
+ ctaSecondary: (_a = itemTags == null ? void 0 : itemTags.includes("cta-secondary")) != null ? _a : false,
3559
+ fullyInteractive: (_b = (tags == null ? void 0 : tags.includes("fully-interactive")) && (additionalInfo == null ? void 0 : additionalInfo.onClick) == null) != null ? _b : false
3560
+ };
3561
+ return /* @__PURE__ */ jsx79(
3562
+ ListItem9,
3563
+ {
3564
+ title: itemTitle,
3565
+ subtitle: description,
3566
+ valueTitle: supportingValues == null ? void 0 : supportingValues.value,
3567
+ valueSubtitle: supportingValues == null ? void 0 : supportingValues.subvalue,
3568
+ media: getMedia(media, shouldUseAvatar(control, itemTags)),
3569
+ prompt: getInlineAlert(inlineAlert),
3570
+ additionalInfo: getAdditionalInfo(additionalInfo),
3571
+ control: getCTAControl(itemCallToAction, controlOptions)
3572
+ },
3573
+ itemTitle
3574
+ );
3575
+ })
3576
+ ] })
3577
+ };
3578
+ var ListRenderer_default = ListRenderer;
3579
+
3580
+ // ../renderers/src/StatusListRenderer.tsx
3581
+ import { AvatarView as AvatarView4, Header as Header10, ListItem as ListItem10 } from "@transferwise/components";
3582
+ import { jsx as jsx80, jsxs as jsxs30 } from "react/jsx-runtime";
3583
+ var StatusListRenderer = {
3584
+ canRenderType: "status-list",
3585
+ render: ({ margin, items, title }) => /* @__PURE__ */ jsxs30("div", { className: getMargin(margin), children: [
3586
+ title ? /* @__PURE__ */ jsx80(Header10, { title }) : null,
3587
+ items.map((item) => {
3588
+ const { callToAction, description, icon, status, title: itemTitle } = item;
3589
+ return /* @__PURE__ */ jsx80(
3590
+ ListItem10,
3591
+ {
3592
+ title: itemTitle,
3593
+ subtitle: description,
3594
+ media: icon && "name" in icon ? /* @__PURE__ */ jsx80(AvatarView4, { badge: { status: mapStatus(status) }, children: /* @__PURE__ */ jsx80(DynamicIcon_default, { name: icon.name }) }) : void 0,
3595
+ additionalInfo: callToAction ? /* @__PURE__ */ jsx80(
3596
+ ListItem10.AdditionalInfo,
3597
+ {
3598
+ action: {
3599
+ href: callToAction.href,
3600
+ onClick: callToAction.href ? void 0 : callToAction.onClick,
3601
+ label: callToAction.title,
3602
+ target: "_blank"
3603
+ }
3604
+ }
3605
+ ) : void 0
3606
+ },
3607
+ JSON.stringify(item)
3608
+ );
3609
+ })
3610
+ ] })
3611
+ };
3612
+ var mapStatus = (status) => {
3613
+ switch (status) {
3614
+ case "done":
3615
+ return "positive";
3616
+ case "pending":
3617
+ return "pending";
3618
+ default:
3619
+ return void 0;
3620
+ }
3621
+ };
3622
+ var StatusListRenderer_default = StatusListRenderer;
3623
+
3624
+ // ../renderers/src/ReviewLegacyRenderer.tsx
3625
+ import { DefinitionList } from "@transferwise/components";
3626
+ import { Fragment as Fragment12, jsx as jsx81, jsxs as jsxs31 } from "react/jsx-runtime";
3627
+ var ReviewRenderer2 = {
3628
+ canRenderType: "review",
3629
+ render: ({ callToAction, control, fields, margin, title, trackEvent }) => {
3630
+ const orientation = mapControlToDefinitionListLayout(control);
3631
+ return /* @__PURE__ */ jsxs31("div", { className: getMargin(margin), children: [
3632
+ /* @__PURE__ */ jsx81(Header7, { title, callToAction }),
3633
+ /* @__PURE__ */ jsx81("div", { className: margin, children: /* @__PURE__ */ jsx81(
3634
+ DefinitionList,
3635
+ {
3636
+ layout: orientation,
3637
+ definitions: fields.map(
3638
+ ({ label, value, help, analyticsId: fieldAnalyticsId }, index) => ({
3639
+ key: String(index),
3640
+ value,
3641
+ title: getFieldLabel(
3642
+ label,
3643
+ help,
3644
+ () => trackEvent("Help Pressed", { layoutItemId: fieldAnalyticsId })
3645
+ )
3646
+ })
3647
+ )
3648
+ }
3649
+ ) })
3650
+ ] });
3651
+ }
3652
+ };
3653
+ var ReviewLegacyRenderer_default = ReviewRenderer2;
3654
+ var mapControlToDefinitionListLayout = (control) => {
3655
+ switch (control) {
3656
+ case "horizontal":
3657
+ case "horizontal-end-aligned":
3658
+ return "HORIZONTAL_RIGHT_ALIGNED";
3659
+ case "horizontal-start-aligned":
3660
+ return "HORIZONTAL_LEFT_ALIGNED";
3661
+ case "vertical-two-column":
3662
+ return "VERTICAL_TWO_COLUMN";
3663
+ case "vertical":
3664
+ case "vertical-one-column":
3665
+ default:
3666
+ return "VERTICAL_ONE_COLUMN";
3667
+ }
3668
+ };
3669
+ var getFieldLabel = (label, help, onClick) => {
3670
+ if (help) {
3671
+ return /* @__PURE__ */ jsxs31(Fragment12, { children: [
3672
+ label,
3673
+ " ",
3674
+ /* @__PURE__ */ jsx81(Help_default, { help, onClick })
3675
+ ] });
3676
+ }
3677
+ return label;
3678
+ };
3679
+
3680
+ // ../renderers/src/getWiseRenderers.ts
3681
+ var getWiseRenderers = () => [
3682
+ AddressValidationButtonRenderer_default,
3683
+ AlertRenderer_default,
3684
+ CheckboxInputRenderer_default,
3685
+ BoxRenderer_default,
3686
+ ButtonRenderer,
3687
+ ColumnsRenderer_default,
3688
+ DateInputRenderer_default,
3689
+ DecisionRenderer_default,
3690
+ DividerRenderer_default,
3691
+ ExternalConfirmationRenderer_default,
3692
+ FormRenderer_default,
3693
+ FormSectionRenderer_default,
3694
+ HeadingRenderer_default,
3695
+ ImageRenderer_default,
3696
+ InstructionsRenderer_default,
3697
+ IntegerInputRenderer_default,
3698
+ LargeUploadRenderer,
3699
+ ListRenderer_default,
3700
+ LoadingIndicatorRenderer_default,
3701
+ MarkdownRenderer_default,
3702
+ ModalRenderer,
3703
+ ModalLayoutRenderer_default,
3704
+ MoneyInputRenderer,
3705
+ MultiSelectInputRenderer_default,
3706
+ MultiUploadInputRenderer_default,
3707
+ NumberInputRenderer_default,
3708
+ ParagraphRenderer_default,
3709
+ ProgressRenderer,
3710
+ RepeatableRenderer_default,
3711
+ ReviewRenderer_default,
3712
+ SearchRenderer_default,
3713
+ SelectInputRenderer_default,
3714
+ SectionRenderer_default,
3715
+ StatusListRenderer_default,
3716
+ TabsRenderer,
3717
+ TextInputRenderer_default,
3718
+ UploadInputRenderer,
3719
+ SplashStepRenderer,
3720
+ SplashCelebrationStepRenderer,
3721
+ StepRenderer,
3722
+ // Legacy renderer must come afterwards
3723
+ ReviewLegacyRenderer_default
3724
+ ];
3725
+
3726
+ // src/dynamicFlow/telemetry/app-version.ts
3727
+ var appVersion = (
3728
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
3729
+ typeof process !== "undefined" ? "4.38.0" : "0.0.0"
3730
+ );
3731
+
3732
+ // src/dynamicFlow/telemetry/getLogEvent.ts
3733
+ var getLogEvent = (onLog) => (level, message, extra) => {
3734
+ const extraWithVersion = __spreadProps(__spreadValues({}, extra), {
3735
+ dfWiseVersion: appVersion
3736
+ });
3737
+ if (level !== "info" && onLog) {
3738
+ if (onLog) {
3739
+ onLog(level, message, extraWithVersion);
3740
+ } else {
3741
+ logToRollbar(level, message, extraWithVersion);
3742
+ }
3743
+ }
3744
+ };
3745
+ var logToRollbar = (level, message, extra) => {
3746
+ try {
3747
+ const rollbar = typeof window.Rollbar !== "undefined" ? window.Rollbar : void 0;
3748
+ rollbar == null ? void 0 : rollbar[level](message, extra);
3749
+ } catch (error) {
3750
+ console.error("Failed to log to Rollbar", error);
3751
+ }
3752
+ };
3753
+
3754
+ // src/dynamicFlow/telemetry/getTrackEvent.ts
3755
+ import { isThemeModern } from "@wise/components-theming";
3756
+ var getTrackEvent = (onEvent, onAnalytics, onThemeChange) => (name, properties) => {
3757
+ onEvent == null ? void 0 : onEvent(name, properties);
3758
+ if (name.includes(ThemeRequiredEventName)) {
3759
+ const { theme } = properties != null ? properties : { theme: "personal" };
3760
+ if (theme && isThemeModern(theme)) {
3761
+ onThemeChange == null ? void 0 : onThemeChange(theme);
3762
+ }
3763
+ } else {
3764
+ onAnalytics == null ? void 0 : onAnalytics(name, properties);
3765
+ }
3766
+ };
3767
+
3768
+ // src/dynamicFlow/messages.ts
3769
+ import { defineMessages as defineMessages12 } from "react-intl";
3770
+ var messages_default = defineMessages12({
3771
+ copied: {
3772
+ id: "df.wise.CopyFeedback.copy",
3773
+ defaultMessage: "Copied to clipboard",
3774
+ description: "Appears in a snackbar when the copy operation succeeds."
3775
+ },
3776
+ copyFailed: {
3777
+ id: "df.wise.CopyFeedback.copyFailed",
3778
+ defaultMessage: "Failed to copy to clipboard",
3779
+ description: "Appears in a snackbar when the copy operation fails."
3780
+ }
3781
+ });
3782
+
3783
+ // src/dynamicFlow/DynamicFlow.tsx
3784
+ import { jsx as jsx82 } from "react/jsx-runtime";
3785
+ var wiseRenderers = getWiseRenderers();
3786
+ function DynamicFlow(props) {
3787
+ const {
3788
+ className = "",
3789
+ customFetch = globalThis.fetch,
3790
+ renderers,
3791
+ displayStepTitle = true,
3792
+ features = {},
3793
+ onAnalytics,
3794
+ onEvent,
3795
+ onLog,
3796
+ onLink = openLinkInNewTab,
3797
+ onThemeChange
3798
+ } = props;
3799
+ const { formatMessage } = useIntl15();
3800
+ const createSnackBar = useSnackBarIfAvailable();
3801
+ const httpClient = useWiseHttpClient(customFetch);
3802
+ const mergedRenderers = useMemo2(() => [...renderers != null ? renderers : [], ...wiseRenderers], [renderers]);
3803
+ const logEvent = useMemo2(() => getLogEvent(onLog), [onLog]);
3804
+ const trackEvent = useMemo2(
3805
+ () => getTrackEvent(onEvent, onAnalytics, onThemeChange),
3806
+ [onEvent, onAnalytics, onThemeChange]
3807
+ );
3808
+ const onCopy = (copiedContent) => {
3809
+ if (copiedContent) {
3810
+ createSnackBar({ text: formatMessage(messages_default.copied) });
3811
+ } else {
3812
+ createSnackBar({ text: formatMessage(messages_default.copyFailed) });
3813
+ }
3814
+ };
3815
+ const coreProps = __spreadProps(__spreadValues({}, props), {
3816
+ features: __spreadValues({ hideStepTitle: !displayStepTitle }, features),
3817
+ httpClient,
3818
+ renderers: mergedRenderers,
3819
+ onEvent: trackEvent,
3820
+ onLog: logEvent,
3821
+ onLink,
3822
+ onCopy
3823
+ });
3824
+ return /* @__PURE__ */ jsx82("div", { className, children: /* @__PURE__ */ jsx82(DynamicFlowCore, __spreadValues({}, coreProps)) });
3825
+ }
3826
+ var DynamicForm = forwardRef(function DynamicForm2(props, ref) {
3827
+ const {
3828
+ className = "",
3829
+ customFetch = globalThis.fetch,
3830
+ renderers,
3831
+ displayStepTitle = true,
3832
+ features = {},
3833
+ onAnalytics,
3834
+ onEvent,
3835
+ onLog,
3836
+ onLink = openLinkInNewTab,
3837
+ onThemeChange
3838
+ } = props;
3839
+ const { formatMessage } = useIntl15();
3840
+ const createSnackBar = useSnackBarIfAvailable();
3841
+ const httpClient = useWiseHttpClient(customFetch);
3842
+ const mergedRenderers = useMemo2(() => [...renderers != null ? renderers : [], ...wiseRenderers], [renderers]);
3843
+ const logEvent = useMemo2(() => getLogEvent(onLog), [onLog]);
3844
+ const trackEvent = useMemo2(
3845
+ () => getTrackEvent(onEvent, onAnalytics, onThemeChange),
3846
+ [onEvent, onAnalytics, onThemeChange]
3847
+ );
3848
+ const onCopy = (copiedContent) => {
3849
+ if (copiedContent) {
3850
+ createSnackBar({ text: formatMessage(messages_default.copied) });
3851
+ } else {
3852
+ createSnackBar({ text: formatMessage(messages_default.copyFailed) });
3853
+ }
3854
+ };
3855
+ const coreProps = __spreadProps(__spreadValues({}, props), {
3856
+ httpClient,
3857
+ renderers: mergedRenderers,
3858
+ features: __spreadValues({ hideStepTitle: !displayStepTitle }, features),
3859
+ onEvent: trackEvent,
3860
+ onLog: logEvent,
3861
+ onLink,
3862
+ onCopy
3863
+ });
3864
+ return /* @__PURE__ */ jsx82("div", { className, children: /* @__PURE__ */ jsx82(DynamicFormCore, __spreadProps(__spreadValues({}, coreProps), { ref })) });
3865
+ });
3866
+ var useWiseHttpClient = (httpClient) => {
3867
+ const { locale } = useIntl15();
3868
+ return useCallback(
3869
+ async (input, init = {}) => {
3870
+ const headers = new Headers(init.headers);
3871
+ headers.set("accept-language", locale);
3872
+ const timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone || void 0;
3873
+ if (timeZone) {
3874
+ headers.set("time-zone", timeZone);
3663
3875
  }
3664
- );
3876
+ const requestInit = __spreadProps(__spreadValues({}, init), { credentials: "include", headers });
3877
+ return httpClient(input, requestInit).catch(handleRejection);
3878
+ },
3879
+ [httpClient, locale]
3880
+ );
3881
+ };
3882
+ var handleRejection = (error) => {
3883
+ if (error instanceof Error && error.message === "SCA_MODAL_CLOSED") {
3884
+ return new Response(JSON.stringify({ validation: {} }), { status: 400 });
3885
+ }
3886
+ throw error;
3887
+ };
3888
+ var openLinkInNewTab = (url) => {
3889
+ var _a;
3890
+ try {
3891
+ const w = (_a = window == null ? void 0 : window.open) == null ? void 0 : _a.call(window, url, "_blank");
3892
+ return Boolean(w);
3893
+ } catch (e) {
3894
+ return false;
3665
3895
  }
3666
3896
  };
3667
3897
 
3668
- // ../renderers/src/getWiseRenderers.ts
3669
- var getListItemRenderers = () => [
3670
- NewDecisionRenderer_default,
3671
- NewListRenderer_default,
3672
- NewReviewRenderer_default,
3673
- NewStatusListRenderer_default
3674
- ];
3675
- var getButtonV2Renderers = () => [ButtonRendererV2];
3676
- var getWiseRenderers = () => [
3677
- AddressValidationButtonRenderer_default,
3678
- AlertRenderer_default,
3679
- CheckboxInputRenderer_default,
3680
- BoxRenderer_default,
3681
- ButtonRenderer,
3682
- ColumnsRenderer_default,
3683
- DateInputRenderer_default,
3684
- DecisionRenderer_default,
3685
- DividerRenderer_default,
3686
- ExternalConfirmationRenderer_default,
3687
- FormRenderer_default,
3688
- FormSectionRenderer_default,
3689
- HeadingRenderer_default,
3690
- ImageRenderer_default,
3691
- InstructionsRenderer_default,
3692
- IntegerInputRenderer_default,
3693
- LargeUploadRenderer,
3694
- ListRenderer_default,
3695
- LoadingIndicatorRenderer_default,
3696
- MarkdownRenderer_default,
3697
- ModalRenderer,
3698
- ModalLayoutRenderer_default,
3699
- MoneyInputRenderer,
3700
- MultiSelectInputRenderer_default,
3701
- MultiUploadInputRenderer_default,
3702
- NumberInputRenderer_default,
3703
- ParagraphRenderer_default,
3704
- ProgressRenderer,
3705
- RepeatableRenderer_default,
3706
- ReviewRenderer_default,
3707
- SearchRenderer_default,
3708
- SelectInputRenderer_default,
3709
- SectionRenderer_default,
3710
- StatusListRenderer_default,
3711
- TabsRenderer,
3712
- TextInputRenderer_default,
3713
- UploadInputRenderer,
3714
- SplashStepRenderer,
3715
- SplashCelebrationStepRenderer,
3716
- StepRenderer
3717
- ];
3898
+ // src/index.ts
3899
+ import { findRendererPropsByType } from "@wise/dynamic-flow-client";
3718
3900
 
3719
3901
  // src/dynamicFlow/renderers.ts
3720
- var Header12 = Header7;
3902
+ var Header11 = Header7;
3721
3903
  var Media2 = Media;
3722
3904
  var getMargin2 = getMargin;
3723
- var getListItemRenderers2 = getListItemRenderers;
3724
- var getButtonV2Renderers2 = getButtonV2Renderers;
3725
3905
 
3726
3906
  // src/i18n/index.ts
3727
3907
  import { translations as coreTranslations } from "@wise/dynamic-flow-client";
@@ -4584,198 +4764,22 @@ var translations = languages.reduce(
4584
4764
  {}
4585
4765
  );
4586
4766
  var i18n_default = translations;
4587
-
4588
- // src/dynamicFlow/DynamicFlow.tsx
4589
- import { forwardRef, useCallback, useMemo as useMemo2 } from "react";
4590
- import { useIntl as useIntl14 } from "react-intl";
4591
- import {
4592
- DynamicFlow as DynamicFlowCoreLegacy,
4593
- DynamicFlowCoreRevamp,
4594
- DynamicFormCore
4595
- } from "@wise/dynamic-flow-client";
4596
-
4597
- // src/dynamicFlow/telemetry/app-version.ts
4598
- var appVersion = (
4599
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
4600
- typeof process !== "undefined" ? "4.37.0" : "0.0.0"
4601
- );
4602
-
4603
- // src/dynamicFlow/telemetry/getLogEvent.ts
4604
- var getLogEvent = (onLog) => (level, message, extra) => {
4605
- const extraWithVersion = __spreadProps(__spreadValues({}, extra), {
4606
- dfWiseVersion: appVersion
4607
- });
4608
- if (level !== "info" && onLog) {
4609
- if (onLog) {
4610
- onLog(level, message, extraWithVersion);
4611
- } else {
4612
- logToRollbar(level, message, extraWithVersion);
4613
- }
4614
- }
4615
- };
4616
- var logToRollbar = (level, message, extra) => {
4617
- try {
4618
- const rollbar = typeof window.Rollbar !== "undefined" ? window.Rollbar : void 0;
4619
- rollbar == null ? void 0 : rollbar[level](message, extra);
4620
- } catch (error) {
4621
- console.error("Failed to log to Rollbar", error);
4622
- }
4623
- };
4624
-
4625
- // src/dynamicFlow/telemetry/getTrackEvent.ts
4626
- import { isThemeModern } from "@wise/components-theming";
4627
- var getTrackEvent = (onEvent, onAnalytics, onThemeChange) => (name, properties) => {
4628
- onEvent == null ? void 0 : onEvent(name, properties);
4629
- if (name.includes(ThemeRequiredEventName)) {
4630
- const { theme } = properties != null ? properties : { theme: "personal" };
4631
- if (theme && isThemeModern(theme)) {
4632
- onThemeChange == null ? void 0 : onThemeChange(theme);
4633
- }
4634
- } else {
4635
- onAnalytics == null ? void 0 : onAnalytics(name, properties);
4636
- }
4637
- };
4638
-
4639
- // src/dynamicFlow/messages.ts
4640
- import { defineMessages as defineMessages12 } from "react-intl";
4641
- var messages_default = defineMessages12({
4642
- copied: {
4643
- id: "df.wise.CopyFeedback.copy",
4644
- defaultMessage: "Copied to clipboard",
4645
- description: "Appears in a snackbar when the copy operation succeeds."
4646
- },
4647
- copyFailed: {
4648
- id: "df.wise.CopyFeedback.copyFailed",
4649
- defaultMessage: "Failed to copy to clipboard",
4650
- description: "Appears in a snackbar when the copy operation fails."
4651
- }
4652
- });
4653
-
4654
- // src/dynamicFlow/DynamicFlow.tsx
4655
- import { jsx as jsx84 } from "react/jsx-runtime";
4656
- var wiseRenderers = getWiseRenderers();
4657
- function DynamicFlowLegacy(props) {
4658
- const { customFetch = globalThis.fetch } = props;
4659
- const coreProps = __spreadProps(__spreadValues({}, props), { httpClient: customFetch });
4660
- return /* @__PURE__ */ jsx84(DynamicFlowCoreLegacy, __spreadValues({}, coreProps));
4661
- }
4662
- function DynamicFlowRevamp(props) {
4663
- const {
4664
- className = "",
4665
- customFetch = globalThis.fetch,
4666
- renderers,
4667
- onAnalytics,
4668
- onEvent,
4669
- onLog,
4670
- onLink = openLinkInNewTab,
4671
- onThemeChange
4672
- } = props;
4673
- const { formatMessage } = useIntl14();
4674
- const createSnackBar = useSnackBarIfAvailable();
4675
- const httpClient = useWiseHttpClient(customFetch);
4676
- const mergedRenderers = useMemo2(() => [...renderers != null ? renderers : [], ...wiseRenderers], [renderers]);
4677
- const logEvent = useMemo2(() => getLogEvent(onLog), [onLog]);
4678
- const trackEvent = useMemo2(
4679
- () => getTrackEvent(onEvent, onAnalytics, onThemeChange),
4680
- [onEvent, onAnalytics, onThemeChange]
4681
- );
4682
- const onCopy = (copiedContent) => {
4683
- if (copiedContent) {
4684
- createSnackBar({ text: formatMessage(messages_default.copied) });
4685
- } else {
4686
- createSnackBar({ text: formatMessage(messages_default.copyFailed) });
4687
- }
4688
- };
4689
- const coreProps = __spreadProps(__spreadValues({}, props), {
4690
- httpClient,
4691
- renderers: mergedRenderers,
4692
- onEvent: trackEvent,
4693
- onLog: logEvent,
4694
- onLink,
4695
- onCopy
4696
- });
4697
- return /* @__PURE__ */ jsx84("div", { className, children: /* @__PURE__ */ jsx84(DynamicFlowCoreRevamp, __spreadValues({}, coreProps)) });
4698
- }
4699
- var DynamicForm = forwardRef(function DynamicForm2(props, ref) {
4700
- const {
4701
- className = "",
4702
- customFetch = globalThis.fetch,
4703
- renderers,
4704
- onAnalytics,
4705
- onEvent,
4706
- onLog,
4707
- onLink = openLinkInNewTab,
4708
- onThemeChange
4709
- } = props;
4710
- const { formatMessage } = useIntl14();
4711
- const createSnackBar = useSnackBarIfAvailable();
4712
- const httpClient = useWiseHttpClient(customFetch);
4713
- const mergedRenderers = useMemo2(() => [...renderers != null ? renderers : [], ...wiseRenderers], [renderers]);
4714
- const logEvent = useMemo2(() => getLogEvent(onLog), [onLog]);
4715
- const trackEvent = useMemo2(
4716
- () => getTrackEvent(onEvent, onAnalytics, onThemeChange),
4717
- [onEvent, onAnalytics, onThemeChange]
4718
- );
4719
- const onCopy = (copiedContent) => {
4720
- if (copiedContent) {
4721
- createSnackBar({ text: formatMessage(messages_default.copied) });
4722
- } else {
4723
- createSnackBar({ text: formatMessage(messages_default.copyFailed) });
4724
- }
4725
- };
4726
- const coreProps = __spreadProps(__spreadValues({}, props), {
4727
- httpClient,
4728
- renderers: mergedRenderers,
4729
- onEvent: trackEvent,
4730
- onLog: logEvent,
4731
- onLink,
4732
- onCopy
4733
- });
4734
- return /* @__PURE__ */ jsx84("div", { className, children: /* @__PURE__ */ jsx84(DynamicFormCore, __spreadProps(__spreadValues({}, coreProps), { ref })) });
4735
- });
4736
- var useWiseHttpClient = (httpClient) => {
4737
- const { locale } = useIntl14();
4738
- return useCallback(
4739
- async (input, init = {}) => {
4740
- const headers = new Headers(init.headers);
4741
- headers.set("accept-language", locale);
4742
- const timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone || void 0;
4743
- if (timeZone) {
4744
- headers.set("time-zone", timeZone);
4745
- }
4746
- const requestInit = __spreadProps(__spreadValues({}, init), { credentials: "include", headers });
4747
- return httpClient(input, requestInit).catch(handleRejection);
4748
- },
4749
- [httpClient, locale]
4750
- );
4751
- };
4752
- var handleRejection = (error) => {
4753
- if (error instanceof Error && error.message === "SCA_MODAL_CLOSED") {
4754
- return new Response(JSON.stringify({ validation: {} }), { status: 400 });
4755
- }
4756
- throw error;
4757
- };
4758
- var openLinkInNewTab = (url) => {
4759
- var _a;
4760
- try {
4761
- const w = (_a = window == null ? void 0 : window.open) == null ? void 0 : _a.call(window, url, "_blank");
4762
- return Boolean(w);
4763
- } catch (e) {
4764
- return false;
4765
- }
4766
- };
4767
4767
  export {
4768
- DynamicFlowLegacy,
4769
- DynamicFlowRevamp,
4768
+ DynamicFlow,
4770
4769
  DynamicForm,
4771
- Header12 as Header,
4772
- JsonSchemaForm,
4770
+ Header11 as Header,
4773
4771
  Media2 as Media,
4774
4772
  findRendererPropsByType,
4775
- getButtonV2Renderers2 as getButtonV2Renderers,
4776
- getListItemRenderers2 as getListItemRenderers,
4777
4773
  getMargin2 as getMargin,
4778
- isValidSchema,
4779
4774
  makeHttpClient as makeCustomFetch,
4780
4775
  i18n_default as translations
4781
4776
  };
4777
+ /*! Bundled license information:
4778
+
4779
+ classnames/index.js:
4780
+ (*!
4781
+ Copyright (c) 2018 Jed Watson.
4782
+ Licensed under the MIT License (MIT), see
4783
+ http://jedwatson.github.io/classnames
4784
+ *)
4785
+ */