@wise/dynamic-flow-client 3.14.0-export-map-experimental-58f00fb → 3.14.0-updated-deps-experimental-a924101
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/main.js +831 -918
- package/build/main.min.js +1 -1
- package/build/main.mjs +745 -832
- package/package.json +4 -4
package/build/main.js
CHANGED
|
@@ -67,7 +67,7 @@ var require_classnames = __commonJS({
|
|
|
67
67
|
(function() {
|
|
68
68
|
"use strict";
|
|
69
69
|
var hasOwn = {}.hasOwnProperty;
|
|
70
|
-
function
|
|
70
|
+
function classNames16() {
|
|
71
71
|
var classes = "";
|
|
72
72
|
for (var i = 0; i < arguments.length; i++) {
|
|
73
73
|
var arg = arguments[i];
|
|
@@ -85,7 +85,7 @@ var require_classnames = __commonJS({
|
|
|
85
85
|
return "";
|
|
86
86
|
}
|
|
87
87
|
if (Array.isArray(arg)) {
|
|
88
|
-
return
|
|
88
|
+
return classNames16.apply(null, arg);
|
|
89
89
|
}
|
|
90
90
|
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) {
|
|
91
91
|
return arg.toString();
|
|
@@ -108,14 +108,14 @@ var require_classnames = __commonJS({
|
|
|
108
108
|
return value + newClass;
|
|
109
109
|
}
|
|
110
110
|
if (typeof module2 !== "undefined" && module2.exports) {
|
|
111
|
-
|
|
112
|
-
module2.exports =
|
|
111
|
+
classNames16.default = classNames16;
|
|
112
|
+
module2.exports = classNames16;
|
|
113
113
|
} else if (typeof define === "function" && typeof define.amd === "object" && define.amd) {
|
|
114
114
|
define("classnames", [], function() {
|
|
115
|
-
return
|
|
115
|
+
return classNames16;
|
|
116
116
|
});
|
|
117
117
|
} else {
|
|
118
|
-
window.classNames =
|
|
118
|
+
window.classNames = classNames16;
|
|
119
119
|
}
|
|
120
120
|
})();
|
|
121
121
|
}
|
|
@@ -10669,7 +10669,7 @@ function DynamicFlowCore(props) {
|
|
|
10669
10669
|
}
|
|
10670
10670
|
|
|
10671
10671
|
// src/revamp/DynamicFlowWise.tsx
|
|
10672
|
-
var
|
|
10672
|
+
var import_react19 = require("react");
|
|
10673
10673
|
|
|
10674
10674
|
// ../renderers/src/contexts/RendererHttpClientContext.tsx
|
|
10675
10675
|
var import_react5 = require("react");
|
|
@@ -10724,98 +10724,11 @@ var AlertRenderer = {
|
|
|
10724
10724
|
};
|
|
10725
10725
|
var AlertRenderer_default = AlertRenderer;
|
|
10726
10726
|
|
|
10727
|
-
//
|
|
10728
|
-
var
|
|
10729
|
-
|
|
10730
|
-
// ../../node_modules/.pnpm/@radix-ui+react-use-layout-effect@1.0.1_@types+react@18.3.3_react@18.3.1/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
|
|
10731
|
-
var import_react6 = require("react");
|
|
10732
|
-
var $9f79659886946c16$export$e5c5a5f917a5871c = Boolean(globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) ? import_react6.useLayoutEffect : () => {
|
|
10733
|
-
};
|
|
10734
|
-
|
|
10735
|
-
// ../../node_modules/.pnpm/@radix-ui+react-id@1.0.1_@types+react@18.3.3_react@18.3.1/node_modules/@radix-ui/react-id/dist/index.mjs
|
|
10736
|
-
var $1746a345f3d73bb7$var$useReactId = $2AODx$react["useId".toString()] || (() => void 0);
|
|
10737
|
-
var $1746a345f3d73bb7$var$count = 0;
|
|
10738
|
-
function $1746a345f3d73bb7$export$f680877a34711e37(deterministicId) {
|
|
10739
|
-
const [id, setId] = $2AODx$react.useState($1746a345f3d73bb7$var$useReactId());
|
|
10740
|
-
$9f79659886946c16$export$e5c5a5f917a5871c(() => {
|
|
10741
|
-
if (!deterministicId)
|
|
10742
|
-
setId(
|
|
10743
|
-
(reactId) => reactId !== null && reactId !== void 0 ? reactId : String($1746a345f3d73bb7$var$count++)
|
|
10744
|
-
);
|
|
10745
|
-
}, [
|
|
10746
|
-
deterministicId
|
|
10747
|
-
]);
|
|
10748
|
-
return deterministicId || (id ? `radix-${id}` : "");
|
|
10749
|
-
}
|
|
10750
|
-
|
|
10751
|
-
// ../../node_modules/.pnpm/@wise+forms@0.3.4_@transferwise+components@46.37.0_@transferwise+icons@3.13.0_react@18.3.1__@_lhivqbosx5xdelixwbny3eajv4/node_modules/@wise/forms/dist/index.mjs
|
|
10752
|
-
var import_components3 = require("@transferwise/components");
|
|
10753
|
-
var import_classnames = __toESM(require_classnames(), 1);
|
|
10754
|
-
var import_react7 = require("react");
|
|
10755
|
-
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
10756
|
-
var InputIdContext = /* @__PURE__ */ (0, import_react7.createContext)(void 0);
|
|
10757
|
-
var InputIdContextProvider = InputIdContext.Provider;
|
|
10758
|
-
var FormControlDescribedByContext = /* @__PURE__ */ (0, import_react7.createContext)(void 0);
|
|
10759
|
-
var FormControlDescribedByProvider = FormControlDescribedByContext.Provider;
|
|
10760
|
-
var FormControlInvalidContext = /* @__PURE__ */ (0, import_react7.createContext)(void 0);
|
|
10761
|
-
var FormControlInvalidProvider = FormControlInvalidContext.Provider;
|
|
10762
|
-
var Label = ({
|
|
10763
|
-
id,
|
|
10764
|
-
htmlFor,
|
|
10765
|
-
className,
|
|
10766
|
-
children
|
|
10767
|
-
}) => {
|
|
10768
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("label", {
|
|
10769
|
-
id,
|
|
10770
|
-
htmlFor,
|
|
10771
|
-
className: (0, import_classnames.default)("control-label d-flex flex-column gap-y-1 m-b-0", className),
|
|
10772
|
-
children
|
|
10773
|
-
});
|
|
10774
|
-
};
|
|
10775
|
-
var Field = ({
|
|
10776
|
-
id,
|
|
10777
|
-
label,
|
|
10778
|
-
hint,
|
|
10779
|
-
error,
|
|
10780
|
-
className,
|
|
10781
|
-
children
|
|
10782
|
-
}) => {
|
|
10783
|
-
const hasError = Boolean(error);
|
|
10784
|
-
const hasHint = Boolean(hint) && !hasError;
|
|
10785
|
-
const fallbackInputId = $1746a345f3d73bb7$export$f680877a34711e37();
|
|
10786
|
-
const inputId = id !== null ? id != null ? id : fallbackInputId : void 0;
|
|
10787
|
-
const descriptionId = $1746a345f3d73bb7$export$f680877a34711e37();
|
|
10788
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(InputIdContextProvider, {
|
|
10789
|
-
value: inputId,
|
|
10790
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(FormControlDescribedByProvider, {
|
|
10791
|
-
value: hasError || hasHint ? descriptionId : void 0,
|
|
10792
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(FormControlInvalidProvider, {
|
|
10793
|
-
value: hasError,
|
|
10794
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", {
|
|
10795
|
-
className: (0, import_classnames.default)("form-group d-block", {
|
|
10796
|
-
"has-error": hasError,
|
|
10797
|
-
"has-info": hasHint
|
|
10798
|
-
}, className),
|
|
10799
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(Label, {
|
|
10800
|
-
htmlFor: inputId,
|
|
10801
|
-
children: [label, children]
|
|
10802
|
-
}), hasHint && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_components3.InlineAlert, {
|
|
10803
|
-
type: import_components3.Sentiment.NEUTRAL,
|
|
10804
|
-
id: descriptionId,
|
|
10805
|
-
children: hint
|
|
10806
|
-
}), hasError && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_components3.InlineAlert, {
|
|
10807
|
-
type: import_components3.Sentiment.NEGATIVE,
|
|
10808
|
-
id: descriptionId,
|
|
10809
|
-
children: error
|
|
10810
|
-
})]
|
|
10811
|
-
})
|
|
10812
|
-
})
|
|
10813
|
-
})
|
|
10814
|
-
});
|
|
10815
|
-
};
|
|
10727
|
+
// ../renderers/src/components/FieldInput.tsx
|
|
10728
|
+
var import_components4 = require("@transferwise/components");
|
|
10816
10729
|
|
|
10817
10730
|
// ../renderers/src/components/Help.tsx
|
|
10818
|
-
var
|
|
10731
|
+
var import_components3 = require("@transferwise/components");
|
|
10819
10732
|
var import_react_intl8 = require("react-intl");
|
|
10820
10733
|
|
|
10821
10734
|
// ../renderers/src/messages/help.messages.ts
|
|
@@ -10829,14 +10742,14 @@ var help_messages_default = (0, import_react_intl7.defineMessages)({
|
|
|
10829
10742
|
});
|
|
10830
10743
|
|
|
10831
10744
|
// ../renderers/src/components/Help.tsx
|
|
10832
|
-
var
|
|
10745
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
10833
10746
|
function Help({ help }) {
|
|
10834
10747
|
const intl = (0, import_react_intl8.useIntl)();
|
|
10835
|
-
return /* @__PURE__ */ (0,
|
|
10836
|
-
|
|
10748
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
10749
|
+
import_components3.Info,
|
|
10837
10750
|
{
|
|
10838
10751
|
className: "m-l-1",
|
|
10839
|
-
content: /* @__PURE__ */ (0,
|
|
10752
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_components3.Markdown, { config: { link: { target: "_blank" } }, children: help }),
|
|
10840
10753
|
presentation: "POPOVER",
|
|
10841
10754
|
size: "sm",
|
|
10842
10755
|
"aria-label": intl.formatMessage(help_messages_default.helpAria)
|
|
@@ -10846,46 +10759,46 @@ function Help({ help }) {
|
|
|
10846
10759
|
var Help_default = Help;
|
|
10847
10760
|
|
|
10848
10761
|
// ../renderers/src/components/LabelContentWithHelp.tsx
|
|
10849
|
-
var
|
|
10762
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
10850
10763
|
function LabelContentWithHelp({ text, help }) {
|
|
10851
|
-
return /* @__PURE__ */ (0,
|
|
10764
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
|
|
10852
10765
|
text,
|
|
10853
|
-
/* @__PURE__ */ (0,
|
|
10766
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Help_default, { help })
|
|
10854
10767
|
] });
|
|
10855
10768
|
}
|
|
10856
10769
|
|
|
10857
10770
|
// ../renderers/src/components/FieldInput.tsx
|
|
10858
|
-
var
|
|
10771
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
10859
10772
|
function FieldInput({ id, children, label, error, description, help }) {
|
|
10860
|
-
const labelContent = label && help ? /* @__PURE__ */ (0,
|
|
10861
|
-
return /* @__PURE__ */ (0,
|
|
10773
|
+
const labelContent = label && help ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(LabelContentWithHelp, { text: label, help }) : label;
|
|
10774
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_components4.Field, { id, label: labelContent, hint: description, error, children });
|
|
10862
10775
|
}
|
|
10863
10776
|
var FieldInput_default = FieldInput;
|
|
10864
10777
|
|
|
10865
10778
|
// ../renderers/src/BooleanInputRenderer.tsx
|
|
10866
10779
|
var import_components5 = require("@transferwise/components");
|
|
10867
|
-
var
|
|
10780
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
10868
10781
|
var BooleanInputRenderer = {
|
|
10869
10782
|
canRenderType: "input-boolean",
|
|
10870
10783
|
render: (props) => {
|
|
10871
10784
|
const _a = props, { id, control, label = "", description, help, error, type, value } = _a, rest = __objRest(_a, ["id", "control", "label", "description", "help", "error", "type", "value"]);
|
|
10872
10785
|
const checkboxProps = __spreadProps(__spreadValues({}, rest), { label, secondary: description, checked: value });
|
|
10873
|
-
return /* @__PURE__ */ (0,
|
|
10786
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(FieldInput_default, { id, label: "", description: "", error, help, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_components5.Checkbox, __spreadValues({ id }, checkboxProps)) });
|
|
10874
10787
|
}
|
|
10875
10788
|
};
|
|
10876
10789
|
var BooleanInputRenderer_default = BooleanInputRenderer;
|
|
10877
10790
|
|
|
10878
10791
|
// ../renderers/src/BoxRenderer.tsx
|
|
10879
|
-
var
|
|
10880
|
-
var
|
|
10792
|
+
var import_classnames = __toESM(require_classnames());
|
|
10793
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
10881
10794
|
var BoxRenderer = {
|
|
10882
10795
|
canRenderType: "box",
|
|
10883
10796
|
render: ({ border, children, margin, width }) => {
|
|
10884
10797
|
const hasFixedWidth = width !== "xl";
|
|
10885
|
-
const contents = /* @__PURE__ */ (0,
|
|
10798
|
+
const contents = /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
10886
10799
|
"div",
|
|
10887
10800
|
{
|
|
10888
|
-
className: (0,
|
|
10801
|
+
className: (0, import_classnames.default)({
|
|
10889
10802
|
"df-box-renderer-border": border,
|
|
10890
10803
|
[`df-box-renderer-width-${width}`]: hasFixedWidth,
|
|
10891
10804
|
[getMargin(margin)]: !hasFixedWidth
|
|
@@ -10893,7 +10806,7 @@ var BoxRenderer = {
|
|
|
10893
10806
|
children
|
|
10894
10807
|
}
|
|
10895
10808
|
);
|
|
10896
|
-
return hasFixedWidth ? /* @__PURE__ */ (0,
|
|
10809
|
+
return hasFixedWidth ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: (0, import_classnames.default)("df-box-renderer-fixed-width", getMargin(margin)), children: contents }) : contents;
|
|
10897
10810
|
}
|
|
10898
10811
|
};
|
|
10899
10812
|
var BoxRenderer_default = BoxRenderer;
|
|
@@ -10902,21 +10815,21 @@ var BoxRenderer_default = BoxRenderer;
|
|
|
10902
10815
|
var import_components6 = require("@transferwise/components");
|
|
10903
10816
|
|
|
10904
10817
|
// ../renderers/src/step/StepRendererContext.tsx
|
|
10905
|
-
var
|
|
10906
|
-
var StepRendererContext = (0,
|
|
10818
|
+
var import_react6 = require("react");
|
|
10819
|
+
var StepRendererContext = (0, import_react6.createContext)({ loadingState: "idle", trackEvent: () => {
|
|
10907
10820
|
} });
|
|
10908
10821
|
var StepRendererContextProvider = StepRendererContext.Provider;
|
|
10909
10822
|
var useLoadingContext = () => {
|
|
10910
|
-
const { loadingState } = (0,
|
|
10823
|
+
const { loadingState } = (0, import_react6.useContext)(StepRendererContext);
|
|
10911
10824
|
return { loadingState, isLoading: loadingState !== "idle" };
|
|
10912
10825
|
};
|
|
10913
10826
|
var useTrackEvent = () => {
|
|
10914
|
-
const { trackEvent } = (0,
|
|
10827
|
+
const { trackEvent } = (0, import_react6.useContext)(StepRendererContext);
|
|
10915
10828
|
return trackEvent;
|
|
10916
10829
|
};
|
|
10917
10830
|
|
|
10918
10831
|
// ../renderers/src/ButtonRenderer.tsx
|
|
10919
|
-
var
|
|
10832
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
10920
10833
|
var ButtonRenderer = {
|
|
10921
10834
|
canRenderType: "button",
|
|
10922
10835
|
render: ButtonRendererComponent
|
|
@@ -10934,7 +10847,7 @@ function ButtonRendererComponent({
|
|
|
10934
10847
|
const priority = mapControl(control);
|
|
10935
10848
|
const type = priority === "tertiary" ? void 0 : mapContext(context);
|
|
10936
10849
|
const { isLoading } = useLoadingContext();
|
|
10937
|
-
return /* @__PURE__ */ (0,
|
|
10850
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
10938
10851
|
import_components6.Button,
|
|
10939
10852
|
{
|
|
10940
10853
|
block: true,
|
|
@@ -10985,20 +10898,20 @@ var mapSize = (size) => {
|
|
|
10985
10898
|
var ButtonRenderer_default = ButtonRenderer;
|
|
10986
10899
|
|
|
10987
10900
|
// ../renderers/src/ColumnsRenderer.tsx
|
|
10988
|
-
var
|
|
10989
|
-
var
|
|
10901
|
+
var import_classnames2 = __toESM(require_classnames());
|
|
10902
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
10990
10903
|
var ColumnsRenderer = {
|
|
10991
10904
|
canRenderType: "columns",
|
|
10992
|
-
render: ({ bias, margin, startChildren, endChildren }) => /* @__PURE__ */ (0,
|
|
10905
|
+
render: ({ bias, margin, startChildren, endChildren }) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
10993
10906
|
"div",
|
|
10994
10907
|
{
|
|
10995
|
-
className: (0,
|
|
10908
|
+
className: (0, import_classnames2.default)("df-columns-renderer-container", getMargin(margin), {
|
|
10996
10909
|
"df-columns-renderer-bias-start": bias === "start",
|
|
10997
10910
|
"df-columns-renderer-bias-end": bias === "end"
|
|
10998
10911
|
}),
|
|
10999
10912
|
children: [
|
|
11000
|
-
/* @__PURE__ */ (0,
|
|
11001
|
-
/* @__PURE__ */ (0,
|
|
10913
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "df-columns-renderer-column", children: startChildren }),
|
|
10914
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "df-columns-renderer-column", children: endChildren })
|
|
11002
10915
|
]
|
|
11003
10916
|
}
|
|
11004
10917
|
)
|
|
@@ -11037,7 +10950,7 @@ var dateToDateString = (date) => {
|
|
|
11037
10950
|
};
|
|
11038
10951
|
|
|
11039
10952
|
// ../renderers/src/components/VariableDateInput.tsx
|
|
11040
|
-
var
|
|
10953
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
11041
10954
|
function VariableDateInput({
|
|
11042
10955
|
control,
|
|
11043
10956
|
inputProps
|
|
@@ -11053,7 +10966,7 @@ function VariableDateInput({
|
|
|
11053
10966
|
onFocus
|
|
11054
10967
|
} = inputProps;
|
|
11055
10968
|
if (control === "date-lookup") {
|
|
11056
|
-
return /* @__PURE__ */ (0,
|
|
10969
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
11057
10970
|
import_components7.DateLookup,
|
|
11058
10971
|
{
|
|
11059
10972
|
value: dateStringToDateOrNull(inputProps.value),
|
|
@@ -11069,7 +10982,7 @@ function VariableDateInput({
|
|
|
11069
10982
|
}
|
|
11070
10983
|
);
|
|
11071
10984
|
}
|
|
11072
|
-
return /* @__PURE__ */ (0,
|
|
10985
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
11073
10986
|
import_components7.DateInput,
|
|
11074
10987
|
__spreadProps(__spreadValues({}, inputProps), {
|
|
11075
10988
|
dayAutoComplete: getAutocompleteString2(autoComplete, "day"),
|
|
@@ -11086,7 +10999,7 @@ var getAutocompleteString2 = (value, suffix) => {
|
|
|
11086
10999
|
var VariableDateInput_default = VariableDateInput;
|
|
11087
11000
|
|
|
11088
11001
|
// ../renderers/src/DateInputRenderer.tsx
|
|
11089
|
-
var
|
|
11002
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
11090
11003
|
var DateInputRenderer = {
|
|
11091
11004
|
canRenderType: "input-date",
|
|
11092
11005
|
render: (props) => {
|
|
@@ -11111,7 +11024,7 @@ var DateInputRenderer = {
|
|
|
11111
11024
|
]);
|
|
11112
11025
|
const value = initialValue != null ? initialValue : "";
|
|
11113
11026
|
const inputProps = __spreadProps(__spreadValues({}, rest), { value, id });
|
|
11114
|
-
return /* @__PURE__ */ (0,
|
|
11027
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(VariableDateInput_default, { control, inputProps }) });
|
|
11115
11028
|
}
|
|
11116
11029
|
};
|
|
11117
11030
|
var DateInputRenderer_default = DateInputRenderer;
|
|
@@ -11120,20 +11033,20 @@ var DateInputRenderer_default = DateInputRenderer;
|
|
|
11120
11033
|
var import_components9 = require("@transferwise/components");
|
|
11121
11034
|
|
|
11122
11035
|
// ../../node_modules/.pnpm/@wise+art@2.7.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wise/art/dist/index.esm.js
|
|
11123
|
-
var
|
|
11124
|
-
var
|
|
11036
|
+
var import_react7 = require("react");
|
|
11037
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
11125
11038
|
var unknownFlagName = "wise";
|
|
11126
11039
|
var Flag = ({
|
|
11127
11040
|
code,
|
|
11128
11041
|
intrinsicSize = 64
|
|
11129
11042
|
}) => {
|
|
11130
|
-
const [fallback, setFallback] = (0,
|
|
11131
|
-
(0,
|
|
11043
|
+
const [fallback, setFallback] = (0, import_react7.useState)(null);
|
|
11044
|
+
(0, import_react7.useEffect)(() => {
|
|
11132
11045
|
setFallback(null);
|
|
11133
11046
|
}, [code]);
|
|
11134
11047
|
const detailed = intrinsicSize >= 150;
|
|
11135
11048
|
const name = fallback !== "unknown" ? `${code.toLowerCase()}${fallback == null && detailed ? "-detailed" : ""}` : unknownFlagName;
|
|
11136
|
-
return /* @__PURE__ */ (0,
|
|
11049
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("img", {
|
|
11137
11050
|
src: `https://wise.com/web-art/assets/flags/${name}.svg`,
|
|
11138
11051
|
alt: "",
|
|
11139
11052
|
width: intrinsicSize,
|
|
@@ -11224,19 +11137,19 @@ var Assets;
|
|
|
11224
11137
|
})(Assets || (Assets = {}));
|
|
11225
11138
|
|
|
11226
11139
|
// ../renderers/src/components/icon/FlagIcon.tsx
|
|
11227
|
-
var
|
|
11140
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
11228
11141
|
var isFlagIcon = (name) => name.startsWith("flag-");
|
|
11229
11142
|
function FlagIcon({ name }) {
|
|
11230
11143
|
if (!isFlagIcon(name)) {
|
|
11231
11144
|
return null;
|
|
11232
11145
|
}
|
|
11233
11146
|
const code = name.substring(5);
|
|
11234
|
-
return /* @__PURE__ */ (0,
|
|
11147
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Flag, { code });
|
|
11235
11148
|
}
|
|
11236
11149
|
|
|
11237
11150
|
// ../renderers/src/components/icon/NamedIcon.tsx
|
|
11238
11151
|
var icons = __toESM(require("@transferwise/icons"));
|
|
11239
|
-
var
|
|
11152
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
11240
11153
|
var isNamedIcon = (name) => {
|
|
11241
11154
|
const iconName = toCapitalisedCamelCase(name);
|
|
11242
11155
|
return Object.keys(icons).includes(iconName);
|
|
@@ -11247,19 +11160,19 @@ function NamedIcon({ name }) {
|
|
|
11247
11160
|
}
|
|
11248
11161
|
const iconName = toCapitalisedCamelCase(name);
|
|
11249
11162
|
const Icon = icons[iconName];
|
|
11250
|
-
return /* @__PURE__ */ (0,
|
|
11163
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Icon, { size: 24 });
|
|
11251
11164
|
}
|
|
11252
11165
|
var toCapitalisedCamelCase = (value) => value.split("-").map(capitaliseFirstChar).join("");
|
|
11253
11166
|
var capitaliseFirstChar = (value) => `${value[0].toUpperCase()}${value.slice(1)}`;
|
|
11254
11167
|
|
|
11255
11168
|
// ../renderers/src/components/icon/DynamicIcon.tsx
|
|
11256
|
-
var
|
|
11169
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
11257
11170
|
function DynamicIcon({ name }) {
|
|
11258
11171
|
if (isFlagIcon(name)) {
|
|
11259
|
-
return /* @__PURE__ */ (0,
|
|
11172
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(FlagIcon, { name });
|
|
11260
11173
|
}
|
|
11261
11174
|
if (isNamedIcon(name)) {
|
|
11262
|
-
return /* @__PURE__ */ (0,
|
|
11175
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(NamedIcon, { name });
|
|
11263
11176
|
}
|
|
11264
11177
|
return null;
|
|
11265
11178
|
}
|
|
@@ -11267,25 +11180,25 @@ var DynamicIcon_default = DynamicIcon;
|
|
|
11267
11180
|
|
|
11268
11181
|
// ../renderers/src/components/icon/NavigationOptionMedia.tsx
|
|
11269
11182
|
var import_components8 = require("@transferwise/components");
|
|
11270
|
-
var
|
|
11183
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
11271
11184
|
function NavigationOptionMedia({ icon, image }) {
|
|
11272
11185
|
if (!isNullish2(icon)) {
|
|
11273
11186
|
if ("name" in icon) {
|
|
11274
|
-
return /* @__PURE__ */ (0,
|
|
11187
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_components8.Avatar, { type: import_components8.AvatarType.ICON, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DynamicIcon_default, { name: icon.name }) });
|
|
11275
11188
|
}
|
|
11276
11189
|
if (icon.text) {
|
|
11277
|
-
return /* @__PURE__ */ (0,
|
|
11190
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_components8.Avatar, { type: import_components8.AvatarType.INITIALS, children: icon.text });
|
|
11278
11191
|
}
|
|
11279
11192
|
}
|
|
11280
11193
|
if (image == null ? void 0 : image.url) {
|
|
11281
11194
|
const { url, accessibilityDescription } = image;
|
|
11282
|
-
return /* @__PURE__ */ (0,
|
|
11195
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("img", { src: url, alt: accessibilityDescription });
|
|
11283
11196
|
}
|
|
11284
11197
|
return null;
|
|
11285
11198
|
}
|
|
11286
11199
|
|
|
11287
11200
|
// ../renderers/src/DecisionRenderer.tsx
|
|
11288
|
-
var
|
|
11201
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
11289
11202
|
var DecisionRenderer = {
|
|
11290
11203
|
canRenderType: "decision",
|
|
11291
11204
|
render: DecisionRendererComponent
|
|
@@ -11293,13 +11206,13 @@ var DecisionRenderer = {
|
|
|
11293
11206
|
var DecisionRenderer_default = DecisionRenderer;
|
|
11294
11207
|
function DecisionRendererComponent({ margin, options }) {
|
|
11295
11208
|
const { isLoading } = useLoadingContext();
|
|
11296
|
-
return /* @__PURE__ */ (0,
|
|
11209
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: getMargin(margin), children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_components9.NavigationOptionsList, { children: options.map(({ description, disabled, icon, image, title, onClick }) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
11297
11210
|
import_components9.NavigationOption,
|
|
11298
11211
|
{
|
|
11299
11212
|
title,
|
|
11300
11213
|
content: description,
|
|
11301
11214
|
disabled: isLoading || disabled,
|
|
11302
|
-
media: /* @__PURE__ */ (0,
|
|
11215
|
+
media: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(NavigationOptionMedia, { icon, image }),
|
|
11303
11216
|
showMediaCircle: false,
|
|
11304
11217
|
showMediaAtAllSizes: true,
|
|
11305
11218
|
onClick
|
|
@@ -11309,36 +11222,36 @@ function DecisionRendererComponent({ margin, options }) {
|
|
|
11309
11222
|
}
|
|
11310
11223
|
|
|
11311
11224
|
// ../renderers/src/DividerRenderer.tsx
|
|
11312
|
-
var
|
|
11225
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
11313
11226
|
var DividerRenderer = {
|
|
11314
11227
|
canRenderType: "divider",
|
|
11315
|
-
render: ({ margin }) => /* @__PURE__ */ (0,
|
|
11228
|
+
render: ({ margin }) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("hr", { className: `m-t-0 ${getMargin(margin)}` })
|
|
11316
11229
|
};
|
|
11317
11230
|
var DividerRenderer_default = DividerRenderer;
|
|
11318
11231
|
|
|
11319
11232
|
// ../renderers/src/FormRenderer.tsx
|
|
11320
|
-
var
|
|
11233
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
11321
11234
|
var FormRenderer = {
|
|
11322
11235
|
canRenderType: "form",
|
|
11323
|
-
render: ({ children, margin }) => /* @__PURE__ */ (0,
|
|
11236
|
+
render: ({ children, margin }) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: getMargin(margin), children })
|
|
11324
11237
|
};
|
|
11325
11238
|
var FormRenderer_default = FormRenderer;
|
|
11326
11239
|
|
|
11327
11240
|
// ../renderers/src/FormSectionRenderer.tsx
|
|
11328
11241
|
var import_components10 = require("@transferwise/components");
|
|
11329
|
-
var
|
|
11242
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
11330
11243
|
var FormSectionRenderer = {
|
|
11331
11244
|
canRenderType: "form-section",
|
|
11332
|
-
render: ({ title, description, children }) => /* @__PURE__ */ (0,
|
|
11245
|
+
render: ({ title, description, children }) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("fieldset", { children: [
|
|
11333
11246
|
title && // TODO - once section headers support help, we could show help in here
|
|
11334
|
-
/* @__PURE__ */ (0,
|
|
11247
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
11335
11248
|
import_components10.Header,
|
|
11336
11249
|
{
|
|
11337
11250
|
as: "h2",
|
|
11338
11251
|
title
|
|
11339
11252
|
}
|
|
11340
11253
|
),
|
|
11341
|
-
description && /* @__PURE__ */ (0,
|
|
11254
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { children: description }),
|
|
11342
11255
|
children
|
|
11343
11256
|
] })
|
|
11344
11257
|
};
|
|
@@ -11346,32 +11259,32 @@ var FormSectionRenderer_default = FormSectionRenderer;
|
|
|
11346
11259
|
|
|
11347
11260
|
// ../renderers/src/HeadingRenderer.tsx
|
|
11348
11261
|
var import_components11 = require("@transferwise/components");
|
|
11349
|
-
var
|
|
11262
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
11350
11263
|
var HeadingRenderer = {
|
|
11351
11264
|
canRenderType: "heading",
|
|
11352
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
11265
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Heading, __spreadValues({}, props))
|
|
11353
11266
|
};
|
|
11354
11267
|
function Heading(props) {
|
|
11355
11268
|
const { text, size, align, margin, control } = props;
|
|
11356
11269
|
const className = getTextAlignmentAndMargin({ align, margin });
|
|
11357
|
-
return control === "display" ? /* @__PURE__ */ (0,
|
|
11270
|
+
return control === "display" ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(DisplayHeading, { size, text, className }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(StandardHeading, { size, text, className });
|
|
11358
11271
|
}
|
|
11359
11272
|
function DisplayHeading({ size, text, className }) {
|
|
11360
|
-
return /* @__PURE__ */ (0,
|
|
11273
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_components11.Display, { type: getDisplayType(size), className, children: text });
|
|
11361
11274
|
}
|
|
11362
11275
|
function StandardHeading({ size, text, className }) {
|
|
11363
11276
|
switch (size) {
|
|
11364
11277
|
case "xs":
|
|
11365
|
-
return /* @__PURE__ */ (0,
|
|
11278
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("h5", { className, children: text });
|
|
11366
11279
|
case "sm":
|
|
11367
|
-
return /* @__PURE__ */ (0,
|
|
11280
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("h4", { className, children: text });
|
|
11368
11281
|
case "lg":
|
|
11369
|
-
return /* @__PURE__ */ (0,
|
|
11282
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("h2", { className, children: text });
|
|
11370
11283
|
case "xl":
|
|
11371
|
-
return /* @__PURE__ */ (0,
|
|
11284
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("h1", { className, children: text });
|
|
11372
11285
|
case "md":
|
|
11373
11286
|
default:
|
|
11374
|
-
return /* @__PURE__ */ (0,
|
|
11287
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("h3", { className, children: text });
|
|
11375
11288
|
}
|
|
11376
11289
|
}
|
|
11377
11290
|
var getDisplayType = (size) => {
|
|
@@ -11391,7 +11304,7 @@ var HeadingRenderer_default = HeadingRenderer;
|
|
|
11391
11304
|
|
|
11392
11305
|
// ../renderers/src/ImageRenderer.tsx
|
|
11393
11306
|
var import_components12 = require("@transferwise/components");
|
|
11394
|
-
var
|
|
11307
|
+
var import_react8 = require("react");
|
|
11395
11308
|
|
|
11396
11309
|
// ../renderers/src/utils/api-utils.ts
|
|
11397
11310
|
function isRelativePath2(url = "") {
|
|
@@ -11401,10 +11314,10 @@ function isRelativePath2(url = "") {
|
|
|
11401
11314
|
}
|
|
11402
11315
|
|
|
11403
11316
|
// ../renderers/src/ImageRenderer.tsx
|
|
11404
|
-
var
|
|
11317
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
11405
11318
|
var ImageRenderer = {
|
|
11406
11319
|
canRenderType: "image",
|
|
11407
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
11320
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ImageRendererComponent, __spreadValues({}, props))
|
|
11408
11321
|
};
|
|
11409
11322
|
var ImageRenderer_default = ImageRenderer;
|
|
11410
11323
|
function ImageRendererComponent({
|
|
@@ -11413,12 +11326,12 @@ function ImageRendererComponent({
|
|
|
11413
11326
|
size,
|
|
11414
11327
|
url
|
|
11415
11328
|
}) {
|
|
11416
|
-
const [imageSource, setImageSource] = (0,
|
|
11329
|
+
const [imageSource, setImageSource] = (0, import_react8.useState)("");
|
|
11417
11330
|
const httpClient = useRendererHttpClient();
|
|
11418
|
-
(0,
|
|
11331
|
+
(0, import_react8.useEffect)(() => {
|
|
11419
11332
|
void getImageSource(httpClient, url).then(setImageSource);
|
|
11420
11333
|
}, [url, httpClient]);
|
|
11421
|
-
return /* @__PURE__ */ (0,
|
|
11334
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: `df-image ${size || "md"}`, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
11422
11335
|
import_components12.Image,
|
|
11423
11336
|
{
|
|
11424
11337
|
className: `img-responsive ${getMargin(margin)}`,
|
|
@@ -11463,7 +11376,7 @@ var getImageSource = async (httpClient, imageUrl) => {
|
|
|
11463
11376
|
|
|
11464
11377
|
// ../renderers/src/InstructionsRenderer.tsx
|
|
11465
11378
|
var import_components13 = require("@transferwise/components");
|
|
11466
|
-
var
|
|
11379
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
11467
11380
|
var doContext = ["positive", "neutral"];
|
|
11468
11381
|
var dontContext = ["warning", "negative"];
|
|
11469
11382
|
var InstructionsRenderer = {
|
|
@@ -11471,9 +11384,9 @@ var InstructionsRenderer = {
|
|
|
11471
11384
|
render: ({ items, margin, title }) => {
|
|
11472
11385
|
const dos = items.filter((item) => doContext.includes(item.context)).map(({ text }) => text);
|
|
11473
11386
|
const donts = items.filter((item) => dontContext.includes(item.context)).map(({ text }) => text);
|
|
11474
|
-
return /* @__PURE__ */ (0,
|
|
11475
|
-
title ? /* @__PURE__ */ (0,
|
|
11476
|
-
/* @__PURE__ */ (0,
|
|
11387
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: getMargin(margin), children: [
|
|
11388
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_components13.Header, { title }) : null,
|
|
11389
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_components13.InstructionsList, { dos, donts })
|
|
11477
11390
|
] });
|
|
11478
11391
|
}
|
|
11479
11392
|
};
|
|
@@ -11490,12 +11403,12 @@ var onWheel = (event) => {
|
|
|
11490
11403
|
};
|
|
11491
11404
|
|
|
11492
11405
|
// ../renderers/src/IntegerInputRenderer.tsx
|
|
11493
|
-
var
|
|
11406
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
11494
11407
|
var IntegerInputRenderer = {
|
|
11495
11408
|
canRenderType: "input-integer",
|
|
11496
11409
|
render: (props) => {
|
|
11497
11410
|
const _a = props, { id, label, error, description, help, type, value, onChange } = _a, rest = __objRest(_a, ["id", "label", "error", "description", "help", "type", "value", "onChange"]);
|
|
11498
|
-
return /* @__PURE__ */ (0,
|
|
11411
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
11499
11412
|
import_components14.Input,
|
|
11500
11413
|
__spreadValues({
|
|
11501
11414
|
id,
|
|
@@ -11517,10 +11430,10 @@ var IntegerInputRenderer_default = IntegerInputRenderer;
|
|
|
11517
11430
|
|
|
11518
11431
|
// ../renderers/src/LoadingIndicatorRenderer.tsx
|
|
11519
11432
|
var import_components15 = require("@transferwise/components");
|
|
11520
|
-
var
|
|
11433
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
11521
11434
|
var LoadingIndicatorRenderer = {
|
|
11522
11435
|
canRenderType: "loading-indicator",
|
|
11523
|
-
render: ({ margin, size }) => /* @__PURE__ */ (0,
|
|
11436
|
+
render: ({ margin, size }) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
11524
11437
|
import_components15.Loader,
|
|
11525
11438
|
{
|
|
11526
11439
|
size,
|
|
@@ -11533,27 +11446,27 @@ var LoadingIndicatorRenderer_default = LoadingIndicatorRenderer;
|
|
|
11533
11446
|
|
|
11534
11447
|
// ../renderers/src/MarkdownRenderer.tsx
|
|
11535
11448
|
var import_components16 = require("@transferwise/components");
|
|
11536
|
-
var
|
|
11449
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
11537
11450
|
var MarkdownRenderer = {
|
|
11538
11451
|
canRenderType: "markdown",
|
|
11539
|
-
render: ({ content, align, margin }) => /* @__PURE__ */ (0,
|
|
11452
|
+
render: ({ content, align, margin }) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: getTextAlignmentAndMargin({ align, margin }), children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_components16.Markdown, { config: { link: { target: "_blank" } }, children: content }) })
|
|
11540
11453
|
};
|
|
11541
11454
|
var MarkdownRenderer_default = MarkdownRenderer;
|
|
11542
11455
|
|
|
11543
11456
|
// ../renderers/src/ModalRenderer.tsx
|
|
11544
11457
|
var import_components17 = require("@transferwise/components");
|
|
11545
|
-
var
|
|
11546
|
-
var
|
|
11458
|
+
var import_react9 = require("react");
|
|
11459
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
11547
11460
|
var ModalRenderer = {
|
|
11548
11461
|
canRenderType: "modal",
|
|
11549
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
11462
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(DFModal, __spreadValues({}, props))
|
|
11550
11463
|
};
|
|
11551
11464
|
var ModalRenderer_default = ModalRenderer;
|
|
11552
11465
|
function DFModal({ content, margin, trigger }) {
|
|
11553
|
-
const [visible, setVisible] = (0,
|
|
11554
|
-
return /* @__PURE__ */ (0,
|
|
11555
|
-
/* @__PURE__ */ (0,
|
|
11556
|
-
/* @__PURE__ */ (0,
|
|
11466
|
+
const [visible, setVisible] = (0, import_react9.useState)(false);
|
|
11467
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: getMargin(margin), children: [
|
|
11468
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_components17.Button, { priority: "tertiary", block: true, onClick: () => setVisible(true), children: trigger.title }),
|
|
11469
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
11557
11470
|
import_components17.Modal,
|
|
11558
11471
|
{
|
|
11559
11472
|
scroll: "content",
|
|
@@ -11571,16 +11484,16 @@ var import_components19 = require("@transferwise/components");
|
|
|
11571
11484
|
|
|
11572
11485
|
// ../renderers/src/SelectInputRenderer/OptionMedia.tsx
|
|
11573
11486
|
var import_components18 = require("@transferwise/components");
|
|
11574
|
-
var
|
|
11487
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
11575
11488
|
function OptionMedia({ icon, image }) {
|
|
11576
11489
|
if (image == null ? void 0 : image.url) {
|
|
11577
|
-
return /* @__PURE__ */ (0,
|
|
11490
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("img", { src: image.url, alt: image.accessibilityDescription || "", width: "64px" });
|
|
11578
11491
|
}
|
|
11579
11492
|
if (icon && "name" in icon) {
|
|
11580
|
-
return /* @__PURE__ */ (0,
|
|
11493
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_components18.Avatar, { type: import_components18.AvatarType.ICON, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(DynamicIcon_default, { name: icon.name }) });
|
|
11581
11494
|
}
|
|
11582
11495
|
if (icon && "text" in icon) {
|
|
11583
|
-
return /* @__PURE__ */ (0,
|
|
11496
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_components18.Avatar, { type: import_components18.AvatarType.INITIALS, children: icon.text });
|
|
11584
11497
|
}
|
|
11585
11498
|
return null;
|
|
11586
11499
|
}
|
|
@@ -11599,15 +11512,15 @@ var multi_select_messages_default = (0, import_react_intl9.defineMessages)({
|
|
|
11599
11512
|
});
|
|
11600
11513
|
|
|
11601
11514
|
// ../renderers/src/MultiSelectInputRenderer.tsx
|
|
11602
|
-
var
|
|
11603
|
-
var
|
|
11515
|
+
var import_react10 = require("react");
|
|
11516
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
11604
11517
|
var MultiSelectInputRenderer = {
|
|
11605
11518
|
canRenderType: "input-multi-select",
|
|
11606
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
11519
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(MultiSelectInputRendererComponent, __spreadValues({}, props))
|
|
11607
11520
|
};
|
|
11608
11521
|
function MultiSelectInputRendererComponent(props) {
|
|
11609
11522
|
const { formatMessage } = (0, import_react_intl10.useIntl)();
|
|
11610
|
-
const [stagedIndices, setStagedIndices] = (0,
|
|
11523
|
+
const [stagedIndices, setStagedIndices] = (0, import_react10.useState)();
|
|
11611
11524
|
const {
|
|
11612
11525
|
id,
|
|
11613
11526
|
description,
|
|
@@ -11644,11 +11557,11 @@ function MultiSelectInputRendererComponent(props) {
|
|
|
11644
11557
|
const contentProps = {
|
|
11645
11558
|
title: option.title,
|
|
11646
11559
|
description: option.description,
|
|
11647
|
-
icon: /* @__PURE__ */ (0,
|
|
11560
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(OptionMedia, { icon: option.icon, image: option.image })
|
|
11648
11561
|
};
|
|
11649
|
-
return /* @__PURE__ */ (0,
|
|
11562
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_components19.SelectInputOptionContent, __spreadValues({}, contentProps));
|
|
11650
11563
|
};
|
|
11651
|
-
return /* @__PURE__ */ (0,
|
|
11564
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
11652
11565
|
import_components19.SelectInput,
|
|
11653
11566
|
{
|
|
11654
11567
|
id,
|
|
@@ -11689,8 +11602,8 @@ var import_components21 = require("@transferwise/components");
|
|
|
11689
11602
|
|
|
11690
11603
|
// ../renderers/src/components/UploadFieldInput.tsx
|
|
11691
11604
|
var import_components20 = require("@transferwise/components");
|
|
11692
|
-
var
|
|
11693
|
-
var
|
|
11605
|
+
var import_classnames3 = __toESM(require_classnames());
|
|
11606
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
11694
11607
|
function UploadFieldInput({
|
|
11695
11608
|
id,
|
|
11696
11609
|
children,
|
|
@@ -11699,18 +11612,18 @@ function UploadFieldInput({
|
|
|
11699
11612
|
error,
|
|
11700
11613
|
help
|
|
11701
11614
|
}) {
|
|
11702
|
-
const labelContent = label && help ? /* @__PURE__ */ (0,
|
|
11615
|
+
const labelContent = label && help ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(LabelContentWithHelp, { text: label, help }) : label;
|
|
11703
11616
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
11704
|
-
return /* @__PURE__ */ (0,
|
|
11617
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
11705
11618
|
"div",
|
|
11706
11619
|
{
|
|
11707
|
-
className: (0,
|
|
11620
|
+
className: (0, import_classnames3.default)("form-group d-block", {
|
|
11708
11621
|
"has-error": !!error
|
|
11709
11622
|
}),
|
|
11710
11623
|
children: [
|
|
11711
|
-
/* @__PURE__ */ (0,
|
|
11624
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("label", { htmlFor: id, className: "control-label", children: labelContent }),
|
|
11712
11625
|
children,
|
|
11713
|
-
error && /* @__PURE__ */ (0,
|
|
11626
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_components20.InlineAlert, { type: "negative", id: descriptionId, children: error })
|
|
11714
11627
|
]
|
|
11715
11628
|
}
|
|
11716
11629
|
);
|
|
@@ -11742,7 +11655,7 @@ var getFileType = (base64Url) => {
|
|
|
11742
11655
|
var getRandomId = () => Math.random().toString(36).substring(2);
|
|
11743
11656
|
|
|
11744
11657
|
// ../renderers/src/MultiUploadInputRenderer.tsx
|
|
11745
|
-
var
|
|
11658
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
11746
11659
|
var MultiUploadInputRenderer = {
|
|
11747
11660
|
canRenderType: "input-upload-multi",
|
|
11748
11661
|
render: (props) => {
|
|
@@ -11769,7 +11682,7 @@ var MultiUploadInputRenderer = {
|
|
|
11769
11682
|
};
|
|
11770
11683
|
const onDeleteFile = async (fileId) => onDelete(String(fileId));
|
|
11771
11684
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
11772
|
-
return /* @__PURE__ */ (0,
|
|
11685
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(UploadFieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
11773
11686
|
import_components21.UploadInput,
|
|
11774
11687
|
{
|
|
11775
11688
|
id,
|
|
@@ -11792,12 +11705,12 @@ var MultiUploadInputRenderer_default = MultiUploadInputRenderer;
|
|
|
11792
11705
|
|
|
11793
11706
|
// ../renderers/src/NumberInputRenderer.tsx
|
|
11794
11707
|
var import_components22 = require("@transferwise/components");
|
|
11795
|
-
var
|
|
11708
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
11796
11709
|
var NumberInputRenderer = {
|
|
11797
11710
|
canRenderType: "input-number",
|
|
11798
11711
|
render: (props) => {
|
|
11799
11712
|
const _a = props, { id, label, error, description, help, type, value, onChange } = _a, rest = __objRest(_a, ["id", "label", "error", "description", "help", "type", "value", "onChange"]);
|
|
11800
|
-
return /* @__PURE__ */ (0,
|
|
11713
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
11801
11714
|
import_components22.Input,
|
|
11802
11715
|
__spreadValues({
|
|
11803
11716
|
id,
|
|
@@ -11820,16 +11733,16 @@ var import_react_intl12 = require("react-intl");
|
|
|
11820
11733
|
|
|
11821
11734
|
// ../renderers/src/hooks/useSnackBarIfAvailable.ts
|
|
11822
11735
|
var import_components23 = require("@transferwise/components");
|
|
11823
|
-
var
|
|
11736
|
+
var import_react11 = require("react");
|
|
11824
11737
|
function useSnackBarIfAvailable() {
|
|
11825
|
-
const context = (0,
|
|
11738
|
+
const context = (0, import_react11.useContext)(import_components23.SnackbarContext);
|
|
11826
11739
|
return context ? context.createSnackbar : () => {
|
|
11827
11740
|
};
|
|
11828
11741
|
}
|
|
11829
11742
|
|
|
11830
11743
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
11831
11744
|
var import_components24 = require("@transferwise/components");
|
|
11832
|
-
var
|
|
11745
|
+
var import_classnames4 = __toESM(require_classnames());
|
|
11833
11746
|
|
|
11834
11747
|
// ../renderers/src/messages/paragraph.messages.ts
|
|
11835
11748
|
var import_react_intl11 = require("react-intl");
|
|
@@ -11847,17 +11760,17 @@ var paragraph_messages_default = (0, import_react_intl11.defineMessages)({
|
|
|
11847
11760
|
});
|
|
11848
11761
|
|
|
11849
11762
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
11850
|
-
var
|
|
11763
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
11851
11764
|
var ParagraphRenderer = {
|
|
11852
11765
|
canRenderType: "paragraph",
|
|
11853
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
11766
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Paragraph, __spreadValues({}, props))
|
|
11854
11767
|
};
|
|
11855
11768
|
function Paragraph({ align, control, margin, text }) {
|
|
11856
11769
|
const className = getTextAlignmentAndMargin({ align, margin });
|
|
11857
|
-
return control === "copyable" ? /* @__PURE__ */ (0,
|
|
11770
|
+
return control === "copyable" ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(CopyableParagraph, { className, align, text }) : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(StandardParagraph, { className, text });
|
|
11858
11771
|
}
|
|
11859
11772
|
function StandardParagraph({ text, className }) {
|
|
11860
|
-
return /* @__PURE__ */ (0,
|
|
11773
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className, children: text });
|
|
11861
11774
|
}
|
|
11862
11775
|
function CopyableParagraph({
|
|
11863
11776
|
text,
|
|
@@ -11871,24 +11784,24 @@ function CopyableParagraph({
|
|
|
11871
11784
|
});
|
|
11872
11785
|
};
|
|
11873
11786
|
const inputAlignmentClasses = getTextAlignmentAndMargin({ align, margin: "sm" });
|
|
11874
|
-
return /* @__PURE__ */ (0,
|
|
11875
|
-
/* @__PURE__ */ (0,
|
|
11787
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className, children: [
|
|
11788
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
11876
11789
|
import_components24.Input,
|
|
11877
11790
|
{
|
|
11878
11791
|
type: "text",
|
|
11879
11792
|
value: text,
|
|
11880
11793
|
readOnly: true,
|
|
11881
|
-
className: (0,
|
|
11794
|
+
className: (0, import_classnames4.default)("text-ellipsis", inputAlignmentClasses)
|
|
11882
11795
|
}
|
|
11883
11796
|
),
|
|
11884
|
-
/* @__PURE__ */ (0,
|
|
11797
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_components24.Button, { block: true, onClick: copy, children: formatMessage(paragraph_messages_default.copy) })
|
|
11885
11798
|
] });
|
|
11886
11799
|
}
|
|
11887
11800
|
var ParagraphRenderer_default = ParagraphRenderer;
|
|
11888
11801
|
|
|
11889
11802
|
// ../renderers/src/RepeatableRenderer.tsx
|
|
11890
11803
|
var import_components25 = require("@transferwise/components");
|
|
11891
|
-
var
|
|
11804
|
+
var import_react12 = require("react");
|
|
11892
11805
|
var import_icons = require("@transferwise/icons");
|
|
11893
11806
|
var import_react_intl14 = require("react-intl");
|
|
11894
11807
|
|
|
@@ -11918,11 +11831,11 @@ var repeatable_messages_default = (0, import_react_intl13.defineMessages)({
|
|
|
11918
11831
|
});
|
|
11919
11832
|
|
|
11920
11833
|
// ../renderers/src/RepeatableRenderer.tsx
|
|
11921
|
-
var
|
|
11922
|
-
var
|
|
11834
|
+
var import_classnames5 = __toESM(require_classnames());
|
|
11835
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
11923
11836
|
var RepeatableRenderer = {
|
|
11924
11837
|
canRenderType: "repeatable",
|
|
11925
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
11838
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Repeatable, __spreadValues({}, props))
|
|
11926
11839
|
};
|
|
11927
11840
|
function Repeatable(props) {
|
|
11928
11841
|
const {
|
|
@@ -11939,7 +11852,7 @@ function Repeatable(props) {
|
|
|
11939
11852
|
onRemove
|
|
11940
11853
|
} = props;
|
|
11941
11854
|
const { formatMessage } = (0, import_react_intl14.useIntl)();
|
|
11942
|
-
const [openModalType, setOpenModalType] = (0,
|
|
11855
|
+
const [openModalType, setOpenModalType] = (0, import_react12.useState)(null);
|
|
11943
11856
|
const onAddItem = () => {
|
|
11944
11857
|
onAdd();
|
|
11945
11858
|
setOpenModalType("add");
|
|
@@ -11961,40 +11874,40 @@ function Repeatable(props) {
|
|
|
11961
11874
|
const onCancelEdit = () => {
|
|
11962
11875
|
setOpenModalType(null);
|
|
11963
11876
|
};
|
|
11964
|
-
return /* @__PURE__ */ (0,
|
|
11965
|
-
title && /* @__PURE__ */ (0,
|
|
11966
|
-
description && /* @__PURE__ */ (0,
|
|
11967
|
-
/* @__PURE__ */ (0,
|
|
11877
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_jsx_runtime39.Fragment, { children: [
|
|
11878
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_components25.Header, { title }),
|
|
11879
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("p", { children: description }),
|
|
11880
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
11968
11881
|
"div",
|
|
11969
11882
|
{
|
|
11970
|
-
className: (0,
|
|
11883
|
+
className: (0, import_classnames5.default)("form-group", {
|
|
11971
11884
|
"has-error": error
|
|
11972
11885
|
}),
|
|
11973
11886
|
children: [
|
|
11974
|
-
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ (0,
|
|
11975
|
-
/* @__PURE__ */ (0,
|
|
11887
|
+
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ItemSummaryOption, { item, onClick: () => onEditItem(index) }, item.id)),
|
|
11888
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
11976
11889
|
import_components25.NavigationOption,
|
|
11977
11890
|
{
|
|
11978
|
-
media: /* @__PURE__ */ (0,
|
|
11891
|
+
media: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_icons.Plus, {}),
|
|
11979
11892
|
title: addItemTitle || formatMessage(repeatable_messages_default.addItemTitle),
|
|
11980
11893
|
showMediaAtAllSizes: true,
|
|
11981
11894
|
onClick: () => onAddItem()
|
|
11982
11895
|
}
|
|
11983
11896
|
),
|
|
11984
|
-
error && /* @__PURE__ */ (0,
|
|
11897
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_components25.InlineAlert, { type: "negative", children: error })
|
|
11985
11898
|
]
|
|
11986
11899
|
}
|
|
11987
11900
|
),
|
|
11988
|
-
/* @__PURE__ */ (0,
|
|
11901
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
11989
11902
|
import_components25.Modal,
|
|
11990
11903
|
{
|
|
11991
11904
|
open: openModalType !== null,
|
|
11992
11905
|
title: (openModalType === "add" ? addItemTitle : editItemTitle) || formatMessage(repeatable_messages_default.addItemTitle),
|
|
11993
|
-
body: /* @__PURE__ */ (0,
|
|
11994
|
-
/* @__PURE__ */ (0,
|
|
11995
|
-
/* @__PURE__ */ (0,
|
|
11996
|
-
/* @__PURE__ */ (0,
|
|
11997
|
-
/* @__PURE__ */ (0,
|
|
11906
|
+
body: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_jsx_runtime39.Fragment, { children: [
|
|
11907
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "m-b-2", children: editableItem }),
|
|
11908
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { children: [
|
|
11909
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_components25.Button, { priority: "primary", block: true, className: "m-b-2", onClick: () => onSaveItem(), children: formatMessage(repeatable_messages_default.addItem) }),
|
|
11910
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_components25.Button, { priority: "secondary", type: "negative", block: true, onClick: () => onRemoveItem(), children: formatMessage(repeatable_messages_default.removeItem) })
|
|
11998
11911
|
] })
|
|
11999
11912
|
] }),
|
|
12000
11913
|
onClose: () => onCancelEdit()
|
|
@@ -12006,10 +11919,10 @@ function ItemSummaryOption({
|
|
|
12006
11919
|
item,
|
|
12007
11920
|
onClick
|
|
12008
11921
|
}) {
|
|
12009
|
-
return /* @__PURE__ */ (0,
|
|
11922
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
12010
11923
|
import_components25.NavigationOption,
|
|
12011
11924
|
{
|
|
12012
|
-
media: /* @__PURE__ */ (0,
|
|
11925
|
+
media: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(NavigationOptionMedia, __spreadValues({}, item)),
|
|
12013
11926
|
title: item.title,
|
|
12014
11927
|
content: item.description,
|
|
12015
11928
|
showMediaAtAllSizes: true,
|
|
@@ -12046,13 +11959,13 @@ var generic_error_messages_default2 = (0, import_react_intl15.defineMessages)({
|
|
|
12046
11959
|
});
|
|
12047
11960
|
|
|
12048
11961
|
// ../renderers/src/SearchRenderer/ErrorResult.tsx
|
|
12049
|
-
var
|
|
11962
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
12050
11963
|
function ErrorResult({ state }) {
|
|
12051
11964
|
const intl = (0, import_react_intl16.useIntl)();
|
|
12052
|
-
return /* @__PURE__ */ (0,
|
|
11965
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("p", { className: "m-t-2", children: [
|
|
12053
11966
|
intl.formatMessage(generic_error_messages_default2.genericError),
|
|
12054
11967
|
"\xA0",
|
|
12055
|
-
/* @__PURE__ */ (0,
|
|
11968
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
12056
11969
|
"a",
|
|
12057
11970
|
{
|
|
12058
11971
|
href: "/",
|
|
@@ -12067,8 +11980,8 @@ function ErrorResult({ state }) {
|
|
|
12067
11980
|
}
|
|
12068
11981
|
|
|
12069
11982
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
12070
|
-
var
|
|
12071
|
-
var
|
|
11983
|
+
var import_react13 = require("react");
|
|
11984
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
12072
11985
|
function BlockSearchRendererComponent({
|
|
12073
11986
|
id,
|
|
12074
11987
|
isLoading,
|
|
@@ -12078,10 +11991,10 @@ function BlockSearchRendererComponent({
|
|
|
12078
11991
|
state,
|
|
12079
11992
|
title
|
|
12080
11993
|
}) {
|
|
12081
|
-
const [hasSearched, setHasSearched] = (0,
|
|
11994
|
+
const [hasSearched, setHasSearched] = (0, import_react13.useState)(false);
|
|
12082
11995
|
const trackEvent = useTrackEvent();
|
|
12083
|
-
return /* @__PURE__ */ (0,
|
|
12084
|
-
/* @__PURE__ */ (0,
|
|
11996
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: getMargin(margin), children: [
|
|
11997
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(FieldInput_default, { id, description: "", error: "", help: "", label: title, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
12085
11998
|
import_components26.Input,
|
|
12086
11999
|
{
|
|
12087
12000
|
id,
|
|
@@ -12098,7 +12011,7 @@ function BlockSearchRendererComponent({
|
|
|
12098
12011
|
}
|
|
12099
12012
|
}
|
|
12100
12013
|
) }),
|
|
12101
|
-
isLoading ? /* @__PURE__ */ (0,
|
|
12014
|
+
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_jsx_runtime41.Fragment, { children: "Loading..." }) : /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(SearchResultContent, { state, onChange })
|
|
12102
12015
|
] });
|
|
12103
12016
|
}
|
|
12104
12017
|
function SearchResultContent({
|
|
@@ -12107,29 +12020,29 @@ function SearchResultContent({
|
|
|
12107
12020
|
}) {
|
|
12108
12021
|
switch (state.type) {
|
|
12109
12022
|
case "error":
|
|
12110
|
-
return /* @__PURE__ */ (0,
|
|
12023
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ErrorResult, { state });
|
|
12111
12024
|
case "results":
|
|
12112
|
-
return /* @__PURE__ */ (0,
|
|
12025
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(SearchResults, { state, onChange });
|
|
12113
12026
|
case "noResults":
|
|
12114
|
-
return /* @__PURE__ */ (0,
|
|
12027
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(EmptySearchResult, { state });
|
|
12115
12028
|
case "pending":
|
|
12116
12029
|
default:
|
|
12117
12030
|
return null;
|
|
12118
12031
|
}
|
|
12119
12032
|
}
|
|
12120
12033
|
function EmptySearchResult({ state }) {
|
|
12121
|
-
return /* @__PURE__ */ (0,
|
|
12034
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_components26.Markdown, { className: "m-t-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
12122
12035
|
}
|
|
12123
12036
|
function SearchResults({
|
|
12124
12037
|
state
|
|
12125
12038
|
}) {
|
|
12126
12039
|
const trackEvent = useTrackEvent();
|
|
12127
|
-
return /* @__PURE__ */ (0,
|
|
12040
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_components26.NavigationOptionsList, { children: state.results.map((result) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
12128
12041
|
import_components26.NavigationOption,
|
|
12129
12042
|
{
|
|
12130
12043
|
title: result.title,
|
|
12131
12044
|
content: result.description,
|
|
12132
|
-
media: /* @__PURE__ */ (0,
|
|
12045
|
+
media: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(NavigationOptionMedia, __spreadValues({}, result)),
|
|
12133
12046
|
showMediaCircle: false,
|
|
12134
12047
|
showMediaAtAllSizes: true,
|
|
12135
12048
|
onClick: () => {
|
|
@@ -12147,8 +12060,8 @@ var BlockSearchRendererComponent_default = BlockSearchRendererComponent;
|
|
|
12147
12060
|
// ../renderers/src/SearchRenderer/InlineSearchRendererComponent.tsx
|
|
12148
12061
|
var import_components27 = require("@transferwise/components");
|
|
12149
12062
|
var import_icons2 = require("@transferwise/icons");
|
|
12150
|
-
var
|
|
12151
|
-
var
|
|
12063
|
+
var import_react14 = require("react");
|
|
12064
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
12152
12065
|
function InlineSearchRenderer({
|
|
12153
12066
|
id,
|
|
12154
12067
|
isLoading,
|
|
@@ -12157,21 +12070,21 @@ function InlineSearchRenderer({
|
|
|
12157
12070
|
state,
|
|
12158
12071
|
title
|
|
12159
12072
|
}) {
|
|
12160
|
-
const [hasSearched, setHasSearched] = (0,
|
|
12073
|
+
const [hasSearched, setHasSearched] = (0, import_react14.useState)(false);
|
|
12161
12074
|
const trackEvent = useTrackEvent();
|
|
12162
|
-
return /* @__PURE__ */ (0,
|
|
12075
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: getMargin(margin), children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(FieldInput_default, { id, description: "", error: "", help: "", label: title, children: [
|
|
12163
12076
|
id,
|
|
12164
|
-
/* @__PURE__ */ (0,
|
|
12077
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
12165
12078
|
import_components27.Typeahead,
|
|
12166
12079
|
{
|
|
12167
12080
|
id: "typeahead-input-id",
|
|
12168
12081
|
name: "typeahead-input-name",
|
|
12169
12082
|
size: "md",
|
|
12170
12083
|
maxHeight: 100,
|
|
12171
|
-
footer: /* @__PURE__ */ (0,
|
|
12084
|
+
footer: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(TypeaheadFooter, { state, isLoading }),
|
|
12172
12085
|
multiple: false,
|
|
12173
12086
|
clearable: false,
|
|
12174
|
-
addon: /* @__PURE__ */ (0,
|
|
12087
|
+
addon: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_icons2.Search, { size: 24 }),
|
|
12175
12088
|
options: state.type === "results" ? state.results.map(mapResultToTypeaheadOption) : [],
|
|
12176
12089
|
minQueryLength: 1,
|
|
12177
12090
|
onChange: (values) => {
|
|
@@ -12208,29 +12121,29 @@ function mapResultToTypeaheadOption(result) {
|
|
|
12208
12121
|
}
|
|
12209
12122
|
function TypeaheadFooter({ state, isLoading }) {
|
|
12210
12123
|
if (state.type === "noResults") {
|
|
12211
|
-
return /* @__PURE__ */ (0,
|
|
12124
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_components27.Markdown, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
12212
12125
|
}
|
|
12213
12126
|
if (state.type === "error") {
|
|
12214
|
-
return /* @__PURE__ */ (0,
|
|
12127
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(ErrorResult, { state }) });
|
|
12215
12128
|
}
|
|
12216
12129
|
if (state.type === "pending" || isLoading) {
|
|
12217
|
-
return /* @__PURE__ */ (0,
|
|
12130
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "m-t-2 m-x-2", children: "Loading..." });
|
|
12218
12131
|
}
|
|
12219
12132
|
return null;
|
|
12220
12133
|
}
|
|
12221
12134
|
var InlineSearchRendererComponent_default = InlineSearchRenderer;
|
|
12222
12135
|
|
|
12223
12136
|
// ../renderers/src/SearchRenderer/SearchRenderer.tsx
|
|
12224
|
-
var
|
|
12137
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
12225
12138
|
var SearchRenderer = {
|
|
12226
12139
|
canRenderType: "search",
|
|
12227
|
-
render: (props) => props.control === "inline" ? /* @__PURE__ */ (0,
|
|
12140
|
+
render: (props) => props.control === "inline" ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(InlineSearchRendererComponent_default, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(BlockSearchRendererComponent_default, __spreadValues({}, props))
|
|
12228
12141
|
};
|
|
12229
12142
|
var SearchRenderer_default = SearchRenderer;
|
|
12230
12143
|
|
|
12231
12144
|
// ../renderers/src/SelectInputRenderer/RadioInputRendererComponent.tsx
|
|
12232
12145
|
var import_components28 = require("@transferwise/components");
|
|
12233
|
-
var
|
|
12146
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
12234
12147
|
function RadioInputRendererComponent(props) {
|
|
12235
12148
|
const {
|
|
12236
12149
|
id,
|
|
@@ -12244,8 +12157,8 @@ function RadioInputRendererComponent(props) {
|
|
|
12244
12157
|
selectedIndex,
|
|
12245
12158
|
onSelect
|
|
12246
12159
|
} = props;
|
|
12247
|
-
return /* @__PURE__ */ (0,
|
|
12248
|
-
/* @__PURE__ */ (0,
|
|
12160
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_jsx_runtime44.Fragment, { children: [
|
|
12161
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
12249
12162
|
import_components28.RadioGroup,
|
|
12250
12163
|
{
|
|
12251
12164
|
name: id,
|
|
@@ -12254,7 +12167,7 @@ function RadioInputRendererComponent(props) {
|
|
|
12254
12167
|
value: index,
|
|
12255
12168
|
secondary: option.description,
|
|
12256
12169
|
disabled: option.disabled || disabled,
|
|
12257
|
-
avatar: /* @__PURE__ */ (0,
|
|
12170
|
+
avatar: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(OptionMedia, { icon: option.icon, image: option.image })
|
|
12258
12171
|
})),
|
|
12259
12172
|
selectedValue: selectedIndex != null ? selectedIndex : void 0,
|
|
12260
12173
|
onChange: onSelect
|
|
@@ -12267,8 +12180,8 @@ function RadioInputRendererComponent(props) {
|
|
|
12267
12180
|
|
|
12268
12181
|
// ../renderers/src/SelectInputRenderer/TabInputRendererComponent.tsx
|
|
12269
12182
|
var import_components29 = require("@transferwise/components");
|
|
12270
|
-
var
|
|
12271
|
-
var
|
|
12183
|
+
var import_react15 = require("react");
|
|
12184
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
12272
12185
|
function TabInputRendererComponent(props) {
|
|
12273
12186
|
const {
|
|
12274
12187
|
id,
|
|
@@ -12282,13 +12195,13 @@ function TabInputRendererComponent(props) {
|
|
|
12282
12195
|
selectedIndex,
|
|
12283
12196
|
onSelect
|
|
12284
12197
|
} = props;
|
|
12285
|
-
(0,
|
|
12198
|
+
(0, import_react15.useEffect)(() => {
|
|
12286
12199
|
if (!isValidIndex(selectedIndex, options.length)) {
|
|
12287
12200
|
onSelect(0);
|
|
12288
12201
|
}
|
|
12289
12202
|
}, [selectedIndex, onSelect, options.length]);
|
|
12290
|
-
return /* @__PURE__ */ (0,
|
|
12291
|
-
/* @__PURE__ */ (0,
|
|
12203
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_jsx_runtime45.Fragment, { children: [
|
|
12204
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12292
12205
|
import_components29.Tabs,
|
|
12293
12206
|
{
|
|
12294
12207
|
name: id,
|
|
@@ -12297,7 +12210,7 @@ function TabInputRendererComponent(props) {
|
|
|
12297
12210
|
title: option.title,
|
|
12298
12211
|
// if we pass null, we get some props-types console errors
|
|
12299
12212
|
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
12300
|
-
content: /* @__PURE__ */ (0,
|
|
12213
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_jsx_runtime45.Fragment, {}),
|
|
12301
12214
|
disabled: option.disabled || disabled
|
|
12302
12215
|
})),
|
|
12303
12216
|
onTabSelect: onSelect
|
|
@@ -12313,22 +12226,22 @@ var import_components31 = require("@transferwise/components");
|
|
|
12313
12226
|
|
|
12314
12227
|
// ../renderers/src/SelectInputRenderer/SelectTriggerMedia.tsx
|
|
12315
12228
|
var import_components30 = require("@transferwise/components");
|
|
12316
|
-
var
|
|
12229
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
12317
12230
|
function SelectTriggerMedia({ icon, image }) {
|
|
12318
12231
|
if (image == null ? void 0 : image.url) {
|
|
12319
12232
|
return null;
|
|
12320
12233
|
}
|
|
12321
12234
|
if (icon && "name" in icon) {
|
|
12322
|
-
return /* @__PURE__ */ (0,
|
|
12235
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_components30.Avatar, { type: import_components30.AvatarType.ICON, size: 24, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(DynamicIcon_default, { name: icon.name }) });
|
|
12323
12236
|
}
|
|
12324
12237
|
if (icon && "text" in icon) {
|
|
12325
|
-
return /* @__PURE__ */ (0,
|
|
12238
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_components30.Avatar, { type: import_components30.AvatarType.ICON, size: 24, children: icon.text });
|
|
12326
12239
|
}
|
|
12327
12240
|
return null;
|
|
12328
12241
|
}
|
|
12329
12242
|
|
|
12330
12243
|
// ../renderers/src/SelectInputRenderer/SelectInputRendererComponent.tsx
|
|
12331
|
-
var
|
|
12244
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
12332
12245
|
function SelectInputRendererComponent(props) {
|
|
12333
12246
|
const {
|
|
12334
12247
|
id,
|
|
@@ -12363,16 +12276,16 @@ function SelectInputRendererComponent(props) {
|
|
|
12363
12276
|
const contentProps = withinTrigger ? {
|
|
12364
12277
|
title: option.title,
|
|
12365
12278
|
note: option.description,
|
|
12366
|
-
icon: /* @__PURE__ */ (0,
|
|
12279
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(SelectTriggerMedia, { icon: option.icon, image: option.image })
|
|
12367
12280
|
} : {
|
|
12368
12281
|
title: option.title,
|
|
12369
12282
|
description: option.description,
|
|
12370
|
-
icon: /* @__PURE__ */ (0,
|
|
12283
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(OptionMedia, { icon: option.icon, image: option.image })
|
|
12371
12284
|
};
|
|
12372
|
-
return /* @__PURE__ */ (0,
|
|
12285
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_components31.SelectInputOptionContent, __spreadValues({}, contentProps));
|
|
12373
12286
|
};
|
|
12374
|
-
return /* @__PURE__ */ (0,
|
|
12375
|
-
/* @__PURE__ */ (0,
|
|
12287
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_jsx_runtime47.Fragment, { children: [
|
|
12288
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
12376
12289
|
import_components31.SelectInput,
|
|
12377
12290
|
{
|
|
12378
12291
|
name: id,
|
|
@@ -12391,18 +12304,18 @@ function SelectInputRendererComponent(props) {
|
|
|
12391
12304
|
}
|
|
12392
12305
|
|
|
12393
12306
|
// ../renderers/src/SelectInputRenderer/SegmentedInputRendererComponent.tsx
|
|
12394
|
-
var
|
|
12307
|
+
var import_react16 = require("react");
|
|
12395
12308
|
var import_components32 = require("@transferwise/components");
|
|
12396
|
-
var
|
|
12309
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
12397
12310
|
function SegmentedInputRendererComponent(props) {
|
|
12398
12311
|
const { id, children, description, error, help, label, options, selectedIndex, onSelect } = props;
|
|
12399
|
-
(0,
|
|
12312
|
+
(0, import_react16.useEffect)(() => {
|
|
12400
12313
|
if (!isValidIndex2(selectedIndex, options.length)) {
|
|
12401
12314
|
onSelect(0);
|
|
12402
12315
|
}
|
|
12403
12316
|
}, [selectedIndex, onSelect, options.length]);
|
|
12404
|
-
return /* @__PURE__ */ (0,
|
|
12405
|
-
/* @__PURE__ */ (0,
|
|
12317
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_jsx_runtime48.Fragment, { children: [
|
|
12318
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
12406
12319
|
import_components32.SegmentedControl,
|
|
12407
12320
|
{
|
|
12408
12321
|
name: `${id}-segmented-control`,
|
|
@@ -12417,26 +12330,26 @@ function SegmentedInputRendererComponent(props) {
|
|
|
12417
12330
|
onChange: (value) => onSelect(Number(value))
|
|
12418
12331
|
}
|
|
12419
12332
|
) }),
|
|
12420
|
-
/* @__PURE__ */ (0,
|
|
12333
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { id: `${id}-children`, children })
|
|
12421
12334
|
] });
|
|
12422
12335
|
}
|
|
12423
12336
|
var isValidIndex2 = (index, options) => index !== null && index >= 0 && index < options;
|
|
12424
12337
|
|
|
12425
12338
|
// ../renderers/src/SelectInputRenderer/SelectInputRenderer.tsx
|
|
12426
|
-
var
|
|
12339
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
12427
12340
|
var SelectInputRenderer = {
|
|
12428
12341
|
canRenderType: "input-select",
|
|
12429
12342
|
render: (props) => {
|
|
12430
12343
|
switch (props.control) {
|
|
12431
12344
|
case "radio":
|
|
12432
|
-
return /* @__PURE__ */ (0,
|
|
12345
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(RadioInputRendererComponent, __spreadValues({}, props));
|
|
12433
12346
|
case "tab":
|
|
12434
|
-
return props.options.length > 3 ? /* @__PURE__ */ (0,
|
|
12347
|
+
return props.options.length > 3 ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(TabInputRendererComponent, __spreadValues({}, props));
|
|
12435
12348
|
case "segmented":
|
|
12436
|
-
return props.options.length > 3 ? /* @__PURE__ */ (0,
|
|
12349
|
+
return props.options.length > 3 ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(SegmentedInputRendererComponent, __spreadValues({}, props));
|
|
12437
12350
|
case "select":
|
|
12438
12351
|
default:
|
|
12439
|
-
return /* @__PURE__ */ (0,
|
|
12352
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(SelectInputRendererComponent, __spreadValues({}, props));
|
|
12440
12353
|
}
|
|
12441
12354
|
}
|
|
12442
12355
|
};
|
|
@@ -12444,17 +12357,17 @@ var SelectInputRenderer_default = SelectInputRenderer;
|
|
|
12444
12357
|
|
|
12445
12358
|
// ../renderers/src/StatusListRenderer.tsx
|
|
12446
12359
|
var import_components33 = require("@transferwise/components");
|
|
12447
|
-
var
|
|
12360
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
12448
12361
|
var StatusListRenderer = {
|
|
12449
12362
|
canRenderType: "status-list",
|
|
12450
|
-
render: ({ margin, items, title }) => /* @__PURE__ */ (0,
|
|
12451
|
-
title ? /* @__PURE__ */ (0,
|
|
12452
|
-
items.map(({ description, icon, status, title: itemTitle }) => /* @__PURE__ */ (0,
|
|
12363
|
+
render: ({ margin, items, title }) => /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: getMargin(margin), children: [
|
|
12364
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_components33.Header, { title }) : null,
|
|
12365
|
+
items.map(({ description, icon, status, title: itemTitle }) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
12453
12366
|
import_components33.Summary,
|
|
12454
12367
|
{
|
|
12455
12368
|
title: itemTitle,
|
|
12456
12369
|
description,
|
|
12457
|
-
icon: icon && "name" in icon ? /* @__PURE__ */ (0,
|
|
12370
|
+
icon: icon && "name" in icon ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(DynamicIcon_default, { name: icon.name }) : null,
|
|
12458
12371
|
status: mapStatus(status)
|
|
12459
12372
|
},
|
|
12460
12373
|
`${title}/${description || ""}`
|
|
@@ -12471,31 +12384,31 @@ var mapStatus = (status) => {
|
|
|
12471
12384
|
|
|
12472
12385
|
// ../renderers/src/components/VariableTextInput.tsx
|
|
12473
12386
|
var import_components34 = require("@transferwise/components");
|
|
12474
|
-
var
|
|
12387
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
12475
12388
|
function VariableTextInput({
|
|
12476
12389
|
control,
|
|
12477
12390
|
inputProps
|
|
12478
12391
|
}) {
|
|
12479
12392
|
switch (control) {
|
|
12480
12393
|
case "password":
|
|
12481
|
-
return /* @__PURE__ */ (0,
|
|
12394
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(TextInput, __spreadValues({ type: "password" }, inputProps));
|
|
12482
12395
|
case "email":
|
|
12483
|
-
return /* @__PURE__ */ (0,
|
|
12396
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(TextInput, __spreadValues({ type: "email" }, inputProps));
|
|
12484
12397
|
case "textarea":
|
|
12485
|
-
return /* @__PURE__ */ (0,
|
|
12398
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(TextAreaInput, __spreadValues({}, inputProps));
|
|
12486
12399
|
case "numeric":
|
|
12487
|
-
return /* @__PURE__ */ (0,
|
|
12400
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(NumericInput, __spreadValues({ type: "number" }, inputProps));
|
|
12488
12401
|
case "phone-number":
|
|
12489
|
-
return /* @__PURE__ */ (0,
|
|
12402
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(PhoneNumberInput, __spreadValues({}, inputProps));
|
|
12490
12403
|
default:
|
|
12491
|
-
return /* @__PURE__ */ (0,
|
|
12404
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(TextInput, __spreadValues({ type: "text" }, inputProps));
|
|
12492
12405
|
}
|
|
12493
12406
|
}
|
|
12494
12407
|
function TextInput(_a) {
|
|
12495
12408
|
var _b = _a, { id, displayFormat, onChange } = _b, rest = __objRest(_b, ["id", "displayFormat", "onChange"]);
|
|
12496
12409
|
if (typeof displayFormat === "string") {
|
|
12497
12410
|
const inputProps = __spreadValues({ id, name: id, className: "form-control" }, rest);
|
|
12498
|
-
return /* @__PURE__ */ (0,
|
|
12411
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
12499
12412
|
import_components34.InputWithDisplayFormat,
|
|
12500
12413
|
__spreadValues({
|
|
12501
12414
|
displayPattern: displayFormat,
|
|
@@ -12503,29 +12416,29 @@ function TextInput(_a) {
|
|
|
12503
12416
|
}, inputProps)
|
|
12504
12417
|
);
|
|
12505
12418
|
}
|
|
12506
|
-
return /* @__PURE__ */ (0,
|
|
12419
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_components34.Input, __spreadValues({ id, name: id, onChange: (e) => onChange(e.target.value) }, rest));
|
|
12507
12420
|
}
|
|
12508
12421
|
function TextAreaInput(_a) {
|
|
12509
12422
|
var _b = _a, { id, displayFormat, onChange } = _b, rest = __objRest(_b, ["id", "displayFormat", "onChange"]);
|
|
12510
12423
|
const textAreaProps = __spreadValues({ id, name: id }, rest);
|
|
12511
|
-
return typeof displayFormat === "string" ? /* @__PURE__ */ (0,
|
|
12424
|
+
return typeof displayFormat === "string" ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
12512
12425
|
import_components34.TextareaWithDisplayFormat,
|
|
12513
12426
|
__spreadValues({
|
|
12514
12427
|
displayPattern: displayFormat,
|
|
12515
12428
|
onChange: (newValue) => onChange(newValue)
|
|
12516
12429
|
}, textAreaProps)
|
|
12517
|
-
) : /* @__PURE__ */ (0,
|
|
12430
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_components34.TextArea, __spreadValues({ onChange: (e) => onChange(e.target.value) }, textAreaProps));
|
|
12518
12431
|
}
|
|
12519
12432
|
function NumericInput(_a) {
|
|
12520
12433
|
var _b = _a, { id, displayFormat, onChange } = _b, rest = __objRest(_b, ["id", "displayFormat", "onChange"]);
|
|
12521
12434
|
const numericProps = __spreadValues({ id, name: id, onWheel }, rest);
|
|
12522
|
-
return typeof displayFormat === "string" ? /* @__PURE__ */ (0,
|
|
12435
|
+
return typeof displayFormat === "string" ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
12523
12436
|
import_components34.InputWithDisplayFormat,
|
|
12524
12437
|
__spreadValues({
|
|
12525
12438
|
displayPattern: displayFormat,
|
|
12526
12439
|
onChange: (newValue) => onChange(numericValueOrNull(newValue))
|
|
12527
12440
|
}, numericProps)
|
|
12528
|
-
) : /* @__PURE__ */ (0,
|
|
12441
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
12529
12442
|
import_components34.Input,
|
|
12530
12443
|
__spreadValues({
|
|
12531
12444
|
onChange: ({ target: { value: newValue } }) => onChange(numericValueOrNull(newValue))
|
|
@@ -12534,12 +12447,12 @@ function NumericInput(_a) {
|
|
|
12534
12447
|
}
|
|
12535
12448
|
function PhoneNumberInput(_a) {
|
|
12536
12449
|
var _b = _a, { value } = _b, rest = __objRest(_b, ["value"]);
|
|
12537
|
-
return /* @__PURE__ */ (0,
|
|
12450
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_components34.PhoneNumberInput, __spreadValues({ initialValue: value }, rest));
|
|
12538
12451
|
}
|
|
12539
12452
|
var VariableTextInput_default = VariableTextInput;
|
|
12540
12453
|
|
|
12541
12454
|
// ../renderers/src/TextInputRenderer.tsx
|
|
12542
|
-
var
|
|
12455
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
12543
12456
|
var TextInputRenderer = {
|
|
12544
12457
|
canRenderType: "input-text",
|
|
12545
12458
|
render: (props) => {
|
|
@@ -12564,14 +12477,14 @@ var TextInputRenderer = {
|
|
|
12564
12477
|
]);
|
|
12565
12478
|
const value = initialValue != null ? initialValue : "";
|
|
12566
12479
|
const inputProps = __spreadProps(__spreadValues({}, rest), { value, id });
|
|
12567
|
-
return /* @__PURE__ */ (0,
|
|
12480
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(VariableTextInput_default, { control, inputProps }) });
|
|
12568
12481
|
}
|
|
12569
12482
|
};
|
|
12570
12483
|
var TextInputRenderer_default = TextInputRenderer;
|
|
12571
12484
|
|
|
12572
12485
|
// ../renderers/src/UploadInputRenderer.tsx
|
|
12573
12486
|
var import_components35 = require("@transferwise/components");
|
|
12574
|
-
var
|
|
12487
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
12575
12488
|
var UploadInputRenderer = {
|
|
12576
12489
|
canRenderType: "input-upload",
|
|
12577
12490
|
render: (props) => {
|
|
@@ -12587,7 +12500,7 @@ var UploadInputRenderer = {
|
|
|
12587
12500
|
};
|
|
12588
12501
|
return (
|
|
12589
12502
|
// We don't pass help here as there is no sensible place to display it
|
|
12590
|
-
/* @__PURE__ */ (0,
|
|
12503
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(UploadFieldInput_default, { id, label: void 0, description: void 0, error, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
12591
12504
|
import_components35.UploadInput,
|
|
12592
12505
|
{
|
|
12593
12506
|
id,
|
|
@@ -12642,7 +12555,7 @@ var LargeUploadRenderer = {
|
|
|
12642
12555
|
throw e;
|
|
12643
12556
|
}
|
|
12644
12557
|
};
|
|
12645
|
-
return /* @__PURE__ */ (0,
|
|
12558
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
12646
12559
|
import_components35.Upload,
|
|
12647
12560
|
__spreadProps(__spreadValues({}, uploadProps), {
|
|
12648
12561
|
usAccept: getAcceptsString(accepts),
|
|
@@ -12657,7 +12570,7 @@ var LargeUploadRenderer = {
|
|
|
12657
12570
|
|
|
12658
12571
|
// ../renderers/src/ReviewRenderer.tsx
|
|
12659
12572
|
var import_components36 = require("@transferwise/components");
|
|
12660
|
-
var
|
|
12573
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
12661
12574
|
var ReviewRenderer = {
|
|
12662
12575
|
canRenderType: "review",
|
|
12663
12576
|
render: ({ callToAction, control, fields, margin, title }) => {
|
|
@@ -12669,9 +12582,9 @@ var ReviewRenderer = {
|
|
|
12669
12582
|
callToAction.onClick();
|
|
12670
12583
|
}
|
|
12671
12584
|
} : void 0;
|
|
12672
|
-
return /* @__PURE__ */ (0,
|
|
12673
|
-
(title || callToAction) && /* @__PURE__ */ (0,
|
|
12674
|
-
/* @__PURE__ */ (0,
|
|
12585
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: getMargin(margin), children: [
|
|
12586
|
+
(title || callToAction) && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_components36.Header, { title: title != null ? title : "", action }),
|
|
12587
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: margin, children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
12675
12588
|
import_components36.DefinitionList,
|
|
12676
12589
|
{
|
|
12677
12590
|
layout: orientation,
|
|
@@ -12703,21 +12616,21 @@ var mapControlToDefinitionListLayout = (control) => {
|
|
|
12703
12616
|
};
|
|
12704
12617
|
var getFieldValue = (value, help, orientation) => {
|
|
12705
12618
|
if (help) {
|
|
12706
|
-
return orientation === "HORIZONTAL_RIGHT_ALIGNED" ? /* @__PURE__ */ (0,
|
|
12707
|
-
/* @__PURE__ */ (0,
|
|
12619
|
+
return orientation === "HORIZONTAL_RIGHT_ALIGNED" ? /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(import_jsx_runtime54.Fragment, { children: [
|
|
12620
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Help_default, { help }),
|
|
12708
12621
|
" ",
|
|
12709
12622
|
value
|
|
12710
|
-
] }) : /* @__PURE__ */ (0,
|
|
12623
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(import_jsx_runtime54.Fragment, { children: [
|
|
12711
12624
|
value,
|
|
12712
12625
|
" ",
|
|
12713
|
-
/* @__PURE__ */ (0,
|
|
12626
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Help_default, { help })
|
|
12714
12627
|
] });
|
|
12715
12628
|
}
|
|
12716
12629
|
return value;
|
|
12717
12630
|
};
|
|
12718
12631
|
|
|
12719
12632
|
// ../renderers/src/step/StepRenderer.tsx
|
|
12720
|
-
var
|
|
12633
|
+
var import_react18 = require("react");
|
|
12721
12634
|
|
|
12722
12635
|
// ../renderers/src/step/ExternalConfirmationDialog.tsx
|
|
12723
12636
|
var import_react_intl18 = require("react-intl");
|
|
@@ -12749,17 +12662,17 @@ var external_confirmation_messages_default = (0, import_react_intl17.defineMessa
|
|
|
12749
12662
|
|
|
12750
12663
|
// ../renderers/src/step/ExternalConfirmationDialog.tsx
|
|
12751
12664
|
var import_components37 = require("@transferwise/components");
|
|
12752
|
-
var
|
|
12665
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
12753
12666
|
function ExternalConfirmationDialog({
|
|
12754
12667
|
external,
|
|
12755
12668
|
onClose
|
|
12756
12669
|
}) {
|
|
12757
12670
|
const { formatMessage } = (0, import_react_intl18.useIntl)();
|
|
12758
|
-
return /* @__PURE__ */ (0,
|
|
12759
|
-
/* @__PURE__ */ (0,
|
|
12760
|
-
/* @__PURE__ */ (0,
|
|
12761
|
-
/* @__PURE__ */ (0,
|
|
12762
|
-
/* @__PURE__ */ (0,
|
|
12671
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "df-box-renderer-width-lg", children: [
|
|
12672
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("h2", { className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.title) }),
|
|
12673
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_components37.Markdown, { config: { link: { target: "_blank" } }, className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.description, { origin: getOrigin(external.url) }) }),
|
|
12674
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "df-box-renderer-width-lg", children: [
|
|
12675
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
12763
12676
|
import_components37.Button,
|
|
12764
12677
|
{
|
|
12765
12678
|
block: true,
|
|
@@ -12773,7 +12686,7 @@ function ExternalConfirmationDialog({
|
|
|
12773
12686
|
children: formatMessage(external_confirmation_messages_default.open)
|
|
12774
12687
|
}
|
|
12775
12688
|
),
|
|
12776
|
-
/* @__PURE__ */ (0,
|
|
12689
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_components37.Button, { block: true, className: "m-b-2", priority: "tertiary", size: "md", onClick: onClose, children: formatMessage(external_confirmation_messages_default.cancel) })
|
|
12777
12690
|
] }) })
|
|
12778
12691
|
] }) });
|
|
12779
12692
|
}
|
|
@@ -12786,12 +12699,12 @@ function getOrigin(url) {
|
|
|
12786
12699
|
}
|
|
12787
12700
|
|
|
12788
12701
|
// ../renderers/src/step/useExternal.tsx
|
|
12789
|
-
var
|
|
12702
|
+
var import_react17 = require("react");
|
|
12790
12703
|
function useExternal(url) {
|
|
12791
|
-
const [externalWindow, setExternalWindow] = (0,
|
|
12792
|
-
const [hasDismissed, setHasDismissed] = (0,
|
|
12704
|
+
const [externalWindow, setExternalWindow] = (0, import_react17.useState)(null);
|
|
12705
|
+
const [hasDismissed, setHasDismissed] = (0, import_react17.useState)(false);
|
|
12793
12706
|
const dismissConfirmation = () => setHasDismissed(true);
|
|
12794
|
-
(0,
|
|
12707
|
+
(0, import_react17.useEffect)(() => {
|
|
12795
12708
|
if (url) {
|
|
12796
12709
|
setHasDismissed(false);
|
|
12797
12710
|
setExternalWindow(window.open(url, "_blank"));
|
|
@@ -12804,9 +12717,9 @@ function useExternal(url) {
|
|
|
12804
12717
|
// ../renderers/src/step/BackButton.tsx
|
|
12805
12718
|
var import_components38 = require("@transferwise/components");
|
|
12806
12719
|
var import_icons3 = require("@transferwise/icons");
|
|
12807
|
-
var
|
|
12720
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
12808
12721
|
function BackButton({ title, onClick }) {
|
|
12809
|
-
return /* @__PURE__ */ (0,
|
|
12722
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
12810
12723
|
"a",
|
|
12811
12724
|
{
|
|
12812
12725
|
href: "/",
|
|
@@ -12817,8 +12730,8 @@ function BackButton({ title, onClick }) {
|
|
|
12817
12730
|
onClick();
|
|
12818
12731
|
},
|
|
12819
12732
|
children: [
|
|
12820
|
-
/* @__PURE__ */ (0,
|
|
12821
|
-
/* @__PURE__ */ (0,
|
|
12733
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "sr-only", children: title }),
|
|
12734
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_components38.Avatar, { type: "icon", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_icons3.ArrowLeft, { size: "24" }) })
|
|
12822
12735
|
]
|
|
12823
12736
|
}
|
|
12824
12737
|
);
|
|
@@ -12827,23 +12740,23 @@ var BackButton_default = BackButton;
|
|
|
12827
12740
|
|
|
12828
12741
|
// ../renderers/src/step/StepRenderer.tsx
|
|
12829
12742
|
var import_components39 = require("@transferwise/components");
|
|
12830
|
-
var
|
|
12743
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
12831
12744
|
var StepRenderer = {
|
|
12832
12745
|
canRenderType: "step",
|
|
12833
12746
|
render: StepRendererComponent
|
|
12834
12747
|
};
|
|
12835
12748
|
function StepRendererComponent(props) {
|
|
12836
12749
|
const { back, description, error, external, loadingState, title, trackEvent, children } = props;
|
|
12837
|
-
const value = (0,
|
|
12750
|
+
const value = (0, import_react18.useMemo)(() => ({ loadingState, trackEvent }), [loadingState, trackEvent]);
|
|
12838
12751
|
const { requiresUserConfirmation, dismissConfirmation } = useExternal(external == null ? void 0 : external.url);
|
|
12839
12752
|
if ((external == null ? void 0 : external.url) && requiresUserConfirmation) {
|
|
12840
|
-
return /* @__PURE__ */ (0,
|
|
12753
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(ExternalConfirmationDialog, { external, onClose: dismissConfirmation });
|
|
12841
12754
|
}
|
|
12842
|
-
return /* @__PURE__ */ (0,
|
|
12843
|
-
back ? /* @__PURE__ */ (0,
|
|
12844
|
-
title ? /* @__PURE__ */ (0,
|
|
12845
|
-
description ? /* @__PURE__ */ (0,
|
|
12846
|
-
error ? /* @__PURE__ */ (0,
|
|
12755
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(StepRendererContextProvider, { value, children: [
|
|
12756
|
+
back ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(BackButton_default, __spreadValues({}, back)) : null,
|
|
12757
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("h2", { className: "text-xs-center m-b-2", children: title }) : void 0,
|
|
12758
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("p", { className: "text-xs-center m-b-2", children: description }) : void 0,
|
|
12759
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_components39.Alert, { type: "negative", className: "m-b-2", message: error }) : void 0,
|
|
12847
12760
|
children
|
|
12848
12761
|
] });
|
|
12849
12762
|
}
|
|
@@ -12883,46 +12796,46 @@ var getWiseRenderers = () => [
|
|
|
12883
12796
|
];
|
|
12884
12797
|
|
|
12885
12798
|
// src/revamp/DynamicFlowWise.tsx
|
|
12886
|
-
var
|
|
12799
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
12887
12800
|
var wiseRenderers = getWiseRenderers();
|
|
12888
12801
|
function DynamicFlowWise(props) {
|
|
12889
12802
|
const { httpClient, renderers } = props;
|
|
12890
|
-
const mergedRenderers = (0,
|
|
12891
|
-
return /* @__PURE__ */ (0,
|
|
12803
|
+
const mergedRenderers = (0, import_react19.useMemo)(() => [...renderers != null ? renderers : [], ...wiseRenderers], [renderers]);
|
|
12804
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(RendererHttpClientProvider, { httpClient, children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(DynamicFlowCore, __spreadProps(__spreadValues({}, props), { renderers: mergedRenderers })) });
|
|
12892
12805
|
}
|
|
12893
12806
|
var DynamicFlowWise_default = DynamicFlowWise;
|
|
12894
12807
|
|
|
12895
12808
|
// src/revamp/DynamicFragmentWise.tsx
|
|
12896
|
-
var
|
|
12809
|
+
var import_react21 = require("react");
|
|
12897
12810
|
|
|
12898
12811
|
// src/common/httpClientContext/HttpClientContext.tsx
|
|
12899
|
-
var
|
|
12900
|
-
var
|
|
12901
|
-
var HttpClientContext2 = (0,
|
|
12812
|
+
var import_react20 = require("react");
|
|
12813
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
12814
|
+
var HttpClientContext2 = (0, import_react20.createContext)(void 0);
|
|
12902
12815
|
function HttpClientProvider({ httpClient, children }) {
|
|
12903
|
-
return /* @__PURE__ */ (0,
|
|
12816
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(HttpClientContext2.Provider, { value: httpClient, children });
|
|
12904
12817
|
}
|
|
12905
12818
|
function HttpClientProviderFromBaseUrl({ baseUrl, children }) {
|
|
12906
|
-
const httpClient = (0,
|
|
12907
|
-
return /* @__PURE__ */ (0,
|
|
12819
|
+
const httpClient = (0, import_react20.useMemo)(() => makeHttpClient(baseUrl), [baseUrl]);
|
|
12820
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(HttpClientContext2.Provider, { value: httpClient, children });
|
|
12908
12821
|
}
|
|
12909
12822
|
var useHttpClient = () => {
|
|
12910
|
-
const contextFetch = (0,
|
|
12823
|
+
const contextFetch = (0, import_react20.useContext)(HttpClientContext2);
|
|
12911
12824
|
return contextFetch != null ? contextFetch : fetch;
|
|
12912
12825
|
};
|
|
12913
12826
|
var useHasHttpClientProvider = () => {
|
|
12914
|
-
const context = (0,
|
|
12827
|
+
const context = (0, import_react20.useContext)(HttpClientContext2);
|
|
12915
12828
|
return Boolean(context);
|
|
12916
12829
|
};
|
|
12917
12830
|
|
|
12918
12831
|
// src/revamp/DynamicFragmentWise.tsx
|
|
12919
|
-
var
|
|
12832
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
12920
12833
|
var wiseRenderers2 = getWiseRenderers();
|
|
12921
|
-
var DynamicFragmentWise = (0,
|
|
12834
|
+
var DynamicFragmentWise = (0, import_react21.forwardRef)(function DynamicFragmentWise2(props, ref) {
|
|
12922
12835
|
const { httpClient, onEvent, onError, renderers } = props;
|
|
12923
|
-
const mergedRenderers = (0,
|
|
12836
|
+
const mergedRenderers = (0, import_react21.useMemo)(() => [...renderers != null ? renderers : [], ...wiseRenderers2], [renderers]);
|
|
12924
12837
|
const { stepComponentRef } = useDynamicFlowCore(props);
|
|
12925
|
-
(0,
|
|
12838
|
+
(0, import_react21.useImperativeHandle)(
|
|
12926
12839
|
ref,
|
|
12927
12840
|
() => ({
|
|
12928
12841
|
getValue: async () => {
|
|
@@ -12937,30 +12850,30 @@ var DynamicFragmentWise = (0, import_react23.forwardRef)(function DynamicFragmen
|
|
|
12937
12850
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
12938
12851
|
[]
|
|
12939
12852
|
);
|
|
12940
|
-
const render = (0,
|
|
12853
|
+
const render = (0, import_react21.useMemo)(
|
|
12941
12854
|
() => getRenderFunction([CoreContainerRenderer, ...mergedRenderers, StepRenderer]),
|
|
12942
12855
|
[mergedRenderers]
|
|
12943
12856
|
);
|
|
12944
|
-
return /* @__PURE__ */ (0,
|
|
12857
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
12945
12858
|
ErrorBoundary_default,
|
|
12946
12859
|
{
|
|
12947
12860
|
onError: (error) => {
|
|
12948
12861
|
onEvent == null ? void 0 : onEvent("Dynamic Flow - Failed");
|
|
12949
12862
|
onError(error);
|
|
12950
12863
|
},
|
|
12951
|
-
children: /* @__PURE__ */ (0,
|
|
12864
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(HttpClientProvider, { httpClient, children: stepComponentRef.current ? render(stepComponentRef.current) : null })
|
|
12952
12865
|
}
|
|
12953
12866
|
);
|
|
12954
12867
|
});
|
|
12955
12868
|
var DynamicFragmentWise_default = DynamicFragmentWise;
|
|
12956
12869
|
|
|
12957
12870
|
// src/revamp/DynamicFragmentCore.tsx
|
|
12958
|
-
var
|
|
12959
|
-
var
|
|
12960
|
-
var DynamicFragmentCore = (0,
|
|
12871
|
+
var import_react22 = require("react");
|
|
12872
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
12873
|
+
var DynamicFragmentCore = (0, import_react22.forwardRef)(function DynamicFragmentCore2(props, ref) {
|
|
12961
12874
|
const { onEvent, onError, renderers } = props;
|
|
12962
12875
|
const { stepComponentRef } = useDynamicFlowCore(props);
|
|
12963
|
-
(0,
|
|
12876
|
+
(0, import_react22.useImperativeHandle)(
|
|
12964
12877
|
ref,
|
|
12965
12878
|
() => ({
|
|
12966
12879
|
getValue: async () => {
|
|
@@ -12975,11 +12888,11 @@ var DynamicFragmentCore = (0, import_react24.forwardRef)(function DynamicFragmen
|
|
|
12975
12888
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
12976
12889
|
[]
|
|
12977
12890
|
);
|
|
12978
|
-
const render = (0,
|
|
12891
|
+
const render = (0, import_react22.useMemo)(
|
|
12979
12892
|
() => getRenderFunction([CoreContainerRenderer, ...renderers]),
|
|
12980
12893
|
[renderers]
|
|
12981
12894
|
);
|
|
12982
|
-
return /* @__PURE__ */ (0,
|
|
12895
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
12983
12896
|
ErrorBoundary_default,
|
|
12984
12897
|
{
|
|
12985
12898
|
onError: (error) => {
|
|
@@ -13296,17 +13209,17 @@ function isReference(block) {
|
|
|
13296
13209
|
}
|
|
13297
13210
|
|
|
13298
13211
|
// src/legacy/dynamicFlow/DynamicFlow.tsx
|
|
13299
|
-
var
|
|
13212
|
+
var import_react66 = require("react");
|
|
13300
13213
|
var import_react_intl46 = require("react-intl");
|
|
13301
13214
|
|
|
13302
13215
|
// src/legacy/common/contexts/dynamicFlowContexts/DynamicFlowContexts.tsx
|
|
13303
|
-
var
|
|
13216
|
+
var import_react24 = require("react");
|
|
13304
13217
|
|
|
13305
13218
|
// src/legacy/common/contexts/dynamicFlowContexts/usePendingPromiseCounter.ts
|
|
13306
|
-
var
|
|
13219
|
+
var import_react23 = require("react");
|
|
13307
13220
|
function usePendingPromiseCounter() {
|
|
13308
|
-
const [count, setCount] = (0,
|
|
13309
|
-
const addPendingPromise = (0,
|
|
13221
|
+
const [count, setCount] = (0, import_react23.useState)(0);
|
|
13222
|
+
const addPendingPromise = (0, import_react23.useCallback)(
|
|
13310
13223
|
(promise) => {
|
|
13311
13224
|
setCount((c) => c + 1);
|
|
13312
13225
|
promise.catch(noop2).finally(() => delayUntilNextCycle(() => setCount((c) => Math.max(0, c - 1))));
|
|
@@ -13320,44 +13233,44 @@ var noop2 = () => {
|
|
|
13320
13233
|
};
|
|
13321
13234
|
|
|
13322
13235
|
// src/legacy/common/contexts/dynamicFlowContexts/DynamicFlowContexts.tsx
|
|
13323
|
-
var
|
|
13236
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
13324
13237
|
var defaultContextValue = {
|
|
13325
13238
|
loading: false,
|
|
13326
13239
|
registerPersistAsyncPromise: (promise) => {
|
|
13327
13240
|
}
|
|
13328
13241
|
};
|
|
13329
|
-
var DFContext = (0,
|
|
13242
|
+
var DFContext = (0, import_react24.createContext)(defaultContextValue);
|
|
13330
13243
|
var DynamicFlowProvider = ({ loading, children }) => {
|
|
13331
13244
|
const { pendingPromises, addPendingPromise } = usePendingPromiseCounter();
|
|
13332
|
-
const providerValue = (0,
|
|
13245
|
+
const providerValue = (0, import_react24.useMemo)(() => {
|
|
13333
13246
|
return {
|
|
13334
13247
|
loading: loading || pendingPromises > 0,
|
|
13335
13248
|
registerPersistAsyncPromise: addPendingPromise
|
|
13336
13249
|
};
|
|
13337
13250
|
}, [loading, pendingPromises, addPendingPromise]);
|
|
13338
|
-
return /* @__PURE__ */ (0,
|
|
13251
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(DFContext.Provider, { value: providerValue, children });
|
|
13339
13252
|
};
|
|
13340
13253
|
var useDynamicFlow = () => {
|
|
13341
|
-
const context = (0,
|
|
13254
|
+
const context = (0, import_react24.useContext)(DFContext);
|
|
13342
13255
|
return context || defaultContextValue;
|
|
13343
13256
|
};
|
|
13344
13257
|
|
|
13345
13258
|
// src/legacy/common/contexts/eventsContext/EventsContext.tsx
|
|
13346
|
-
var
|
|
13347
|
-
var
|
|
13348
|
-
var EventsContext = (0,
|
|
13259
|
+
var import_react25 = require("react");
|
|
13260
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
13261
|
+
var EventsContext = (0, import_react25.createContext)({
|
|
13349
13262
|
triggerEvent: () => {
|
|
13350
13263
|
}
|
|
13351
13264
|
});
|
|
13352
13265
|
function EventsContextProvider({ metadata, children, onEvent }) {
|
|
13353
|
-
const value = (0,
|
|
13266
|
+
const value = (0, import_react25.useMemo)(
|
|
13354
13267
|
() => ({ triggerEvent: getEventDispatcher(onEvent, metadata) }),
|
|
13355
13268
|
[onEvent, metadata]
|
|
13356
13269
|
);
|
|
13357
|
-
return /* @__PURE__ */ (0,
|
|
13270
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(EventsContext.Provider, { value, children });
|
|
13358
13271
|
}
|
|
13359
13272
|
function useEventDispatcher() {
|
|
13360
|
-
const { triggerEvent } = (0,
|
|
13273
|
+
const { triggerEvent } = (0, import_react25.useContext)(EventsContext);
|
|
13361
13274
|
return triggerEvent;
|
|
13362
13275
|
}
|
|
13363
13276
|
var getEventDispatcher = (onEvent, metadata) => (eventName, properties = {}) => {
|
|
@@ -13368,8 +13281,8 @@ var getEventDispatcher = (onEvent, metadata) => (eventName, properties = {}) =>
|
|
|
13368
13281
|
};
|
|
13369
13282
|
|
|
13370
13283
|
// src/legacy/common/contexts/logContext/LogContext.tsx
|
|
13371
|
-
var
|
|
13372
|
-
var
|
|
13284
|
+
var import_react26 = require("react");
|
|
13285
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
13373
13286
|
var getLogger = (level, onLog, flowId = "UNKNOWN-FLOW-ID", stepId = "UNKNOWN-FLOW-ID") => (title, description, extra) => {
|
|
13374
13287
|
try {
|
|
13375
13288
|
onLog(level, `Dynamic Flow ${level} - ${title} - ${description}`, __spreadValues({
|
|
@@ -13379,9 +13292,9 @@ var getLogger = (level, onLog, flowId = "UNKNOWN-FLOW-ID", stepId = "UNKNOWN-FLO
|
|
|
13379
13292
|
} catch (e) {
|
|
13380
13293
|
}
|
|
13381
13294
|
};
|
|
13382
|
-
var LogContext = (0,
|
|
13295
|
+
var LogContext = (0, import_react26.createContext)(null);
|
|
13383
13296
|
function LogProvider({ flowId, stepId, children, onLog }) {
|
|
13384
|
-
const value = (0,
|
|
13297
|
+
const value = (0, import_react26.useMemo)(
|
|
13385
13298
|
() => ({
|
|
13386
13299
|
debug: getLogger("debug", onLog, flowId, stepId),
|
|
13387
13300
|
info: getLogger("info", onLog, flowId, stepId),
|
|
@@ -13391,10 +13304,10 @@ function LogProvider({ flowId, stepId, children, onLog }) {
|
|
|
13391
13304
|
}),
|
|
13392
13305
|
[onLog, flowId, stepId]
|
|
13393
13306
|
);
|
|
13394
|
-
return /* @__PURE__ */ (0,
|
|
13307
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(LogContext.Provider, { value, children });
|
|
13395
13308
|
}
|
|
13396
13309
|
var useLogger = () => {
|
|
13397
|
-
const logging = (0,
|
|
13310
|
+
const logging = (0, import_react26.useContext)(LogContext);
|
|
13398
13311
|
if (logging == null) {
|
|
13399
13312
|
throw new Error(
|
|
13400
13313
|
"Logging context not found. Did you forget to wrap your component in a <LogProvider />?"
|
|
@@ -13404,11 +13317,11 @@ var useLogger = () => {
|
|
|
13404
13317
|
};
|
|
13405
13318
|
|
|
13406
13319
|
// src/legacy/common/contexts/featureContext/FeatureContext.tsx
|
|
13407
|
-
var
|
|
13408
|
-
var
|
|
13409
|
-
var FeatureContext = (0,
|
|
13320
|
+
var import_react27 = require("react");
|
|
13321
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
13322
|
+
var FeatureContext = (0, import_react27.createContext)([]);
|
|
13410
13323
|
function FeatureContextProvider({ features, children }) {
|
|
13411
|
-
return /* @__PURE__ */ (0,
|
|
13324
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(FeatureContext.Provider, { value: features, children });
|
|
13412
13325
|
}
|
|
13413
13326
|
|
|
13414
13327
|
// src/common/cameraCapture/utils/mobile-utils.ts
|
|
@@ -14138,18 +14051,18 @@ var filterHiddenSchemas = (schemas) => schemas.filter((schema) => {
|
|
|
14138
14051
|
});
|
|
14139
14052
|
|
|
14140
14053
|
// src/legacy/common/hooks/useDebouncedFunction/useDebouncedFunction.tsx
|
|
14141
|
-
var
|
|
14054
|
+
var import_react28 = require("react");
|
|
14142
14055
|
function useDebouncedFunction(callback, waitMs) {
|
|
14143
|
-
return (0,
|
|
14056
|
+
return (0, import_react28.useCallback)(debounce2(callback, waitMs), [callback, waitMs]);
|
|
14144
14057
|
}
|
|
14145
14058
|
|
|
14146
14059
|
// src/legacy/common/hooks/useExternal/useExternal.tsx
|
|
14147
|
-
var
|
|
14060
|
+
var import_react29 = require("react");
|
|
14148
14061
|
function useExternal2(url) {
|
|
14149
|
-
const [externalWindow, setExternalWindow] = (0,
|
|
14150
|
-
const [hasManuallyTriggered, setHasManuallyTriggered] = (0,
|
|
14062
|
+
const [externalWindow, setExternalWindow] = (0, import_react29.useState)(null);
|
|
14063
|
+
const [hasManuallyTriggered, setHasManuallyTriggered] = (0, import_react29.useState)(false);
|
|
14151
14064
|
const dismissConfirmation = () => setHasManuallyTriggered(true);
|
|
14152
|
-
(0,
|
|
14065
|
+
(0, import_react29.useEffect)(() => {
|
|
14153
14066
|
if (url) {
|
|
14154
14067
|
setHasManuallyTriggered(false);
|
|
14155
14068
|
setExternalWindow(window.open(url, "_blank"));
|
|
@@ -14160,10 +14073,10 @@ function useExternal2(url) {
|
|
|
14160
14073
|
}
|
|
14161
14074
|
|
|
14162
14075
|
// src/legacy/common/hooks/useExternalStepPolling/useExternalStepPolling.tsx
|
|
14163
|
-
var
|
|
14076
|
+
var import_react30 = require("react");
|
|
14164
14077
|
function useExternalStepPolling(polling, onAction) {
|
|
14165
14078
|
const httpClient = useHttpClient();
|
|
14166
|
-
const asyncFn = (0,
|
|
14079
|
+
const asyncFn = (0, import_react30.useMemo)(() => {
|
|
14167
14080
|
if (polling) {
|
|
14168
14081
|
return () => httpClient(polling.url).then((response) => {
|
|
14169
14082
|
if (response.ok) {
|
|
@@ -14181,7 +14094,7 @@ function useExternalStepPolling(polling, onAction) {
|
|
|
14181
14094
|
}
|
|
14182
14095
|
return void 0;
|
|
14183
14096
|
}, [polling, httpClient]);
|
|
14184
|
-
const onPollingResponse = (0,
|
|
14097
|
+
const onPollingResponse = (0, import_react30.useCallback)(
|
|
14185
14098
|
(pollingResponse) => {
|
|
14186
14099
|
const responseHandlers = (polling == null ? void 0 : polling.responseHandlers) || [];
|
|
14187
14100
|
const responseHandler = responseHandlers.find(
|
|
@@ -14208,7 +14121,7 @@ function useExternalStepPolling(polling, onAction) {
|
|
|
14208
14121
|
maxAttempts: (polling == null ? void 0 : polling.maxAttempts) || 0,
|
|
14209
14122
|
maxConsecutiveFails: (polling == null ? void 0 : polling.maxConsecutiveFails) || 0,
|
|
14210
14123
|
onPollingResponse,
|
|
14211
|
-
onFailure: (0,
|
|
14124
|
+
onFailure: (0, import_react30.useCallback)(() => {
|
|
14212
14125
|
if (polling) {
|
|
14213
14126
|
onAction(polling.onError.action);
|
|
14214
14127
|
}
|
|
@@ -14217,11 +14130,11 @@ function useExternalStepPolling(polling, onAction) {
|
|
|
14217
14130
|
}
|
|
14218
14131
|
|
|
14219
14132
|
// src/legacy/common/hooks/usePersistAsync/usePersistAsync.ts
|
|
14220
|
-
var
|
|
14133
|
+
var import_react54 = require("react");
|
|
14221
14134
|
var import_react_intl37 = require("react-intl");
|
|
14222
14135
|
|
|
14223
14136
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.tsx
|
|
14224
|
-
var
|
|
14137
|
+
var import_react53 = require("react");
|
|
14225
14138
|
var import_react_intl36 = require("react-intl");
|
|
14226
14139
|
|
|
14227
14140
|
// src/legacy/common/constants/DateMode.ts
|
|
@@ -14269,8 +14182,8 @@ var Size = {
|
|
|
14269
14182
|
};
|
|
14270
14183
|
|
|
14271
14184
|
// src/legacy/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.tsx
|
|
14272
|
-
var
|
|
14273
|
-
var
|
|
14185
|
+
var import_classnames15 = __toESM(require_classnames());
|
|
14186
|
+
var import_react52 = require("react");
|
|
14274
14187
|
|
|
14275
14188
|
// src/legacy/layout/alert/DynamicAlert.tsx
|
|
14276
14189
|
var import_components41 = require("@transferwise/components");
|
|
@@ -14279,19 +14192,19 @@ var import_components41 = require("@transferwise/components");
|
|
|
14279
14192
|
var import_components40 = require("@transferwise/components");
|
|
14280
14193
|
|
|
14281
14194
|
// src/legacy/layout/icon/FlagIcon.tsx
|
|
14282
|
-
var
|
|
14195
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
14283
14196
|
var isFlagIcon2 = (name) => name.startsWith("flag-");
|
|
14284
14197
|
function FlagIcon2({ name }) {
|
|
14285
14198
|
if (!isFlagIcon2(name)) {
|
|
14286
14199
|
return null;
|
|
14287
14200
|
}
|
|
14288
14201
|
const code = name.substring(5);
|
|
14289
|
-
return /* @__PURE__ */ (0,
|
|
14202
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Flag, { intrinsicSize: 24, code });
|
|
14290
14203
|
}
|
|
14291
14204
|
|
|
14292
14205
|
// src/legacy/layout/icon/NamedIcon.tsx
|
|
14293
14206
|
var icons2 = __toESM(require("@transferwise/icons"));
|
|
14294
|
-
var
|
|
14207
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
14295
14208
|
var isNamedIcon2 = (name) => {
|
|
14296
14209
|
const iconName = toCapitalisedCamelCase2(name);
|
|
14297
14210
|
return Object.keys(icons2).includes(iconName);
|
|
@@ -14302,19 +14215,19 @@ function NamedIcon2({ name }) {
|
|
|
14302
14215
|
}
|
|
14303
14216
|
const iconName = toCapitalisedCamelCase2(name);
|
|
14304
14217
|
const Icon = icons2[iconName];
|
|
14305
|
-
return /* @__PURE__ */ (0,
|
|
14218
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Icon, { size: 24 });
|
|
14306
14219
|
}
|
|
14307
14220
|
var toCapitalisedCamelCase2 = (value) => value.split("-").map(capitaliseFirstChar2).join("");
|
|
14308
14221
|
var capitaliseFirstChar2 = (value) => `${value[0].toUpperCase()}${value.slice(1)}`;
|
|
14309
14222
|
|
|
14310
14223
|
// src/legacy/layout/icon/DynamicIcon.tsx
|
|
14311
|
-
var
|
|
14224
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
14312
14225
|
function DynamicIcon2({ type }) {
|
|
14313
14226
|
if (isFlagIcon2(type)) {
|
|
14314
|
-
return /* @__PURE__ */ (0,
|
|
14227
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(FlagIcon2, { name: type });
|
|
14315
14228
|
}
|
|
14316
14229
|
if (isNamedIcon2(type)) {
|
|
14317
|
-
return /* @__PURE__ */ (0,
|
|
14230
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(NamedIcon2, { name: type });
|
|
14318
14231
|
}
|
|
14319
14232
|
return null;
|
|
14320
14233
|
}
|
|
@@ -14324,17 +14237,17 @@ function isValidIconName(name) {
|
|
|
14324
14237
|
var DynamicIcon_default2 = DynamicIcon2;
|
|
14325
14238
|
|
|
14326
14239
|
// src/legacy/layout/utils/getNavigationOptionMedia.tsx
|
|
14327
|
-
var
|
|
14240
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
14328
14241
|
var getNavigationOptionMedia = ({ icon, image }) => {
|
|
14329
14242
|
if (icon == null ? void 0 : icon.name) {
|
|
14330
|
-
return /* @__PURE__ */ (0,
|
|
14243
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_components40.Avatar, { type: import_components40.AvatarType.ICON, children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(DynamicIcon_default2, { type: icon.name }) });
|
|
14331
14244
|
}
|
|
14332
14245
|
if (icon == null ? void 0 : icon.text) {
|
|
14333
|
-
return /* @__PURE__ */ (0,
|
|
14246
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_components40.Avatar, { type: import_components40.AvatarType.INITIALS, children: icon.text });
|
|
14334
14247
|
}
|
|
14335
14248
|
if (image == null ? void 0 : image.url) {
|
|
14336
14249
|
const { url, text } = image;
|
|
14337
|
-
return /* @__PURE__ */ (0,
|
|
14250
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("img", { src: url, alt: text });
|
|
14338
14251
|
}
|
|
14339
14252
|
return null;
|
|
14340
14253
|
};
|
|
@@ -14370,10 +14283,10 @@ var getTextAlignment2 = (align) => {
|
|
|
14370
14283
|
var getTextAlignmentAndMargin2 = (component) => `${getTextAlignment2(component.align)} ${getMargin2(component.margin)}`;
|
|
14371
14284
|
|
|
14372
14285
|
// src/legacy/layout/alert/DynamicAlert.tsx
|
|
14373
|
-
var
|
|
14286
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
14374
14287
|
var DynamicAlert = (props) => {
|
|
14375
14288
|
const alert = props.component;
|
|
14376
|
-
return /* @__PURE__ */ (0,
|
|
14289
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
14377
14290
|
import_components41.Alert,
|
|
14378
14291
|
{
|
|
14379
14292
|
type: mapContextToAlertType(legacy_mapContext(alert.context)),
|
|
@@ -14406,12 +14319,12 @@ var mapContextToAlertType = (context) => {
|
|
|
14406
14319
|
var DynamicAlert_default = DynamicAlert;
|
|
14407
14320
|
|
|
14408
14321
|
// src/legacy/layout/box/DynamicBox.tsx
|
|
14409
|
-
var
|
|
14322
|
+
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
14410
14323
|
var DynamicBox = (props) => {
|
|
14411
14324
|
const box = props.component;
|
|
14412
14325
|
const margin = getMargin2(box.margin || box.border ? "lg" : "xs");
|
|
14413
14326
|
if (!box.width || box.width === "xl") {
|
|
14414
|
-
return /* @__PURE__ */ (0,
|
|
14327
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("div", { className: margin + getBorderClass(box.border), children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
14415
14328
|
DynamicLayout_default,
|
|
14416
14329
|
{
|
|
14417
14330
|
components: box.components,
|
|
@@ -14424,7 +14337,7 @@ var DynamicBox = (props) => {
|
|
|
14424
14337
|
}
|
|
14425
14338
|
) });
|
|
14426
14339
|
}
|
|
14427
|
-
return /* @__PURE__ */ (0,
|
|
14340
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("div", { className: "row", children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("div", { className: margin + getBoxWidthClasses(box), children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("div", { className: getBorderClass(box.border), children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
14428
14341
|
DynamicLayout_default,
|
|
14429
14342
|
{
|
|
14430
14343
|
components: box.components,
|
|
@@ -14508,7 +14421,7 @@ var getButtonSize = (size) => {
|
|
|
14508
14421
|
};
|
|
14509
14422
|
|
|
14510
14423
|
// src/legacy/layout/button/DynamicButton.tsx
|
|
14511
|
-
var
|
|
14424
|
+
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
14512
14425
|
function DynamicButton(props) {
|
|
14513
14426
|
var _a;
|
|
14514
14427
|
const { component, onAction } = props;
|
|
@@ -14517,7 +14430,7 @@ function DynamicButton(props) {
|
|
|
14517
14430
|
const priority = getButtonPriority(component);
|
|
14518
14431
|
const { loading } = useDynamicFlow();
|
|
14519
14432
|
const className = getMargin2(component.margin || "md");
|
|
14520
|
-
return /* @__PURE__ */ (0,
|
|
14433
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
14521
14434
|
import_components42.Button,
|
|
14522
14435
|
{
|
|
14523
14436
|
size: getButtonSize(component.size),
|
|
@@ -14534,12 +14447,12 @@ function DynamicButton(props) {
|
|
|
14534
14447
|
var DynamicButton_default = DynamicButton;
|
|
14535
14448
|
|
|
14536
14449
|
// src/legacy/layout/columns/DynamicColumns.tsx
|
|
14537
|
-
var
|
|
14450
|
+
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
14538
14451
|
var DynamicColumns = (props) => {
|
|
14539
14452
|
const columns = props.component;
|
|
14540
14453
|
const { leftWidth, rightWidth } = getWidth(columns.bias);
|
|
14541
|
-
return /* @__PURE__ */ (0,
|
|
14542
|
-
/* @__PURE__ */ (0,
|
|
14454
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: `${getMargin2(columns.margin || "xs")} row`, children: [
|
|
14455
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { className: `${leftWidth} m-b-0`, children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
14543
14456
|
DynamicLayout_default,
|
|
14544
14457
|
{
|
|
14545
14458
|
components: columns.left,
|
|
@@ -14551,7 +14464,7 @@ var DynamicColumns = (props) => {
|
|
|
14551
14464
|
onPersistAsync: props.onPersistAsync
|
|
14552
14465
|
}
|
|
14553
14466
|
) }),
|
|
14554
|
-
/* @__PURE__ */ (0,
|
|
14467
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { className: `${rightWidth} m-b-0`, children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
14555
14468
|
DynamicLayout_default,
|
|
14556
14469
|
{
|
|
14557
14470
|
components: columns.right,
|
|
@@ -14587,10 +14500,10 @@ var DynamicColumns_default = DynamicColumns;
|
|
|
14587
14500
|
|
|
14588
14501
|
// src/legacy/layout/decision/DynamicDecision.tsx
|
|
14589
14502
|
var import_components43 = require("@transferwise/components");
|
|
14590
|
-
var
|
|
14503
|
+
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
14591
14504
|
function DynamicDecision({ component, onAction }) {
|
|
14592
14505
|
const { loading } = useDynamicFlow();
|
|
14593
|
-
return /* @__PURE__ */ (0,
|
|
14506
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: getMargin2(component.margin), children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_components43.NavigationOptionsList, { children: component.options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
14594
14507
|
import_components43.NavigationOption,
|
|
14595
14508
|
{
|
|
14596
14509
|
title: option.title,
|
|
@@ -14607,17 +14520,17 @@ function DynamicDecision({ component, onAction }) {
|
|
|
14607
14520
|
var DynamicDecision_default = DynamicDecision;
|
|
14608
14521
|
|
|
14609
14522
|
// src/legacy/layout/divider/DynamicDivider.tsx
|
|
14610
|
-
var
|
|
14523
|
+
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
14611
14524
|
var DynamicDivider = ({ component }) => {
|
|
14612
14525
|
const margin = getMargin2(component.margin);
|
|
14613
14526
|
const className = `m-t-0 ${margin}`;
|
|
14614
|
-
return /* @__PURE__ */ (0,
|
|
14527
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("hr", { className });
|
|
14615
14528
|
};
|
|
14616
14529
|
var DynamicDivider_default = DynamicDivider;
|
|
14617
14530
|
|
|
14618
14531
|
// src/legacy/layout/external/DynamicExternal.tsx
|
|
14619
14532
|
var import_components44 = require("@transferwise/components");
|
|
14620
|
-
var
|
|
14533
|
+
var import_react31 = require("react");
|
|
14621
14534
|
var import_react_intl20 = require("react-intl");
|
|
14622
14535
|
|
|
14623
14536
|
// src/legacy/layout/external/DynamicExternal.messages.ts
|
|
@@ -14631,37 +14544,37 @@ var DynamicExternal_messages_default = (0, import_react_intl19.defineMessages)({
|
|
|
14631
14544
|
});
|
|
14632
14545
|
|
|
14633
14546
|
// src/legacy/layout/external/DynamicExternal.tsx
|
|
14634
|
-
var
|
|
14547
|
+
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
14635
14548
|
var DynamicExternal = ({ component, onAction }) => {
|
|
14636
14549
|
const { requestUrl, responseHandlers, polling, retryTitle } = component;
|
|
14637
14550
|
const intl = (0, import_react_intl20.useIntl)();
|
|
14638
|
-
const openExternalUrl = (0,
|
|
14551
|
+
const openExternalUrl = (0, import_react31.useCallback)(
|
|
14639
14552
|
() => window.open(requestUrl, "df-external-window"),
|
|
14640
14553
|
[requestUrl]
|
|
14641
14554
|
);
|
|
14642
|
-
(0,
|
|
14555
|
+
(0, import_react31.useEffect)(() => {
|
|
14643
14556
|
openExternalUrl();
|
|
14644
14557
|
}, [openExternalUrl]);
|
|
14645
14558
|
const pollingConfiguration = polling && responseHandlers ? __spreadProps(__spreadValues({}, polling), {
|
|
14646
14559
|
responseHandlers
|
|
14647
14560
|
}) : void 0;
|
|
14648
14561
|
useExternalStepPolling(pollingConfiguration, onAction);
|
|
14649
|
-
return /* @__PURE__ */ (0,
|
|
14650
|
-
/* @__PURE__ */ (0,
|
|
14651
|
-
/* @__PURE__ */ (0,
|
|
14652
|
-
/* @__PURE__ */ (0,
|
|
14562
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(import_jsx_runtime76.Fragment, { children: [
|
|
14563
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_components44.Loader, { size: import_components44.Size.LARGE, classNames: { "tw-loader": "tw-loader m-x-auto" } }),
|
|
14564
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)("br", {}),
|
|
14565
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_components44.Button, { priority: "tertiary", block: true, onClick: openExternalUrl, children: retryTitle || intl.formatMessage(DynamicExternal_messages_default.retryTitle) })
|
|
14653
14566
|
] });
|
|
14654
14567
|
};
|
|
14655
14568
|
var DynamicExternal_default = DynamicExternal;
|
|
14656
14569
|
|
|
14657
14570
|
// src/legacy/jsonSchemaForm/genericSchema/GenericSchema.tsx
|
|
14658
|
-
var
|
|
14571
|
+
var import_react45 = require("react");
|
|
14659
14572
|
|
|
14660
14573
|
// src/legacy/jsonSchemaForm/allOfSchema/AllOfSchema.tsx
|
|
14661
14574
|
var import_components45 = require("@transferwise/components");
|
|
14662
|
-
var
|
|
14663
|
-
var
|
|
14664
|
-
var
|
|
14575
|
+
var import_classnames6 = __toESM(require_classnames());
|
|
14576
|
+
var import_react32 = require("react");
|
|
14577
|
+
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
14665
14578
|
var splitModel = (model, schemas) => schemas.map((schema) => getValidObjectModelParts(model, schema) || {});
|
|
14666
14579
|
var combineModels = (models) => models.reduce((current, combined) => __spreadValues(__spreadValues({}, combined), current), {});
|
|
14667
14580
|
var getSchemaColumnClasses = (width) => ({
|
|
@@ -14676,13 +14589,13 @@ function AllOfSchema(props) {
|
|
|
14676
14589
|
setModels(models);
|
|
14677
14590
|
props.onChange(__spreadProps(__spreadValues({}, onChangeProps), { model: combineModels(models) }));
|
|
14678
14591
|
};
|
|
14679
|
-
const [models, setModels] = (0,
|
|
14680
|
-
return /* @__PURE__ */ (0,
|
|
14681
|
-
props.schema.title && /* @__PURE__ */ (0,
|
|
14682
|
-
props.schema.description && /* @__PURE__ */ (0,
|
|
14683
|
-
/* @__PURE__ */ (0,
|
|
14592
|
+
const [models, setModels] = (0, import_react32.useState)(splitModel(props.model, props.schema.allOf));
|
|
14593
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(import_jsx_runtime77.Fragment, { children: [
|
|
14594
|
+
props.schema.title && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_components45.Header, { title: props.schema.title }),
|
|
14595
|
+
props.schema.description && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("p", { children: props.schema.description }),
|
|
14596
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "row", children: props.schema.allOf.map((schema, index) => (
|
|
14684
14597
|
// eslint-disable-next-line react/no-array-index-key
|
|
14685
|
-
/* @__PURE__ */ (0,
|
|
14598
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: (0, import_classnames6.default)(getSchemaColumnClasses(schema.width)), children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
14686
14599
|
GenericSchema_default,
|
|
14687
14600
|
{
|
|
14688
14601
|
schema,
|
|
@@ -14707,14 +14620,14 @@ var AllOfSchema_default = AllOfSchema;
|
|
|
14707
14620
|
|
|
14708
14621
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.tsx
|
|
14709
14622
|
var import_components47 = require("@transferwise/components");
|
|
14710
|
-
var
|
|
14711
|
-
var
|
|
14623
|
+
var import_classnames7 = __toESM(require_classnames());
|
|
14624
|
+
var import_react33 = require("react");
|
|
14712
14625
|
|
|
14713
14626
|
// src/legacy/jsonSchemaForm/controlFeedback/ControlFeedback.tsx
|
|
14714
14627
|
var import_components46 = require("@transferwise/components");
|
|
14715
14628
|
var import_formatting2 = require("@transferwise/formatting");
|
|
14716
14629
|
var import_react_intl21 = require("react-intl");
|
|
14717
|
-
var
|
|
14630
|
+
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
14718
14631
|
function ControlFeedback(props) {
|
|
14719
14632
|
var _a;
|
|
14720
14633
|
const defaultValidationMessages = useDefaultValidationMessages(props.schema);
|
|
@@ -14723,12 +14636,12 @@ function ControlFeedback(props) {
|
|
|
14723
14636
|
const isValidationVisible = !isErrorVisible && (props.submitted || props.changed && props.blurred) && Boolean((_a = props.validations) == null ? void 0 : _a.length);
|
|
14724
14637
|
const isDescriptionVisible = props.schema.type !== "boolean" && props.schema.description && !isErrorVisible && !isValidationVisible;
|
|
14725
14638
|
const hasInfoMessage = Boolean(props.infoMessage);
|
|
14726
|
-
return /* @__PURE__ */ (0,
|
|
14727
|
-
isErrorVisible ? /* @__PURE__ */ (0,
|
|
14728
|
-
isValidationVisible ? /* @__PURE__ */ (0,
|
|
14729
|
-
(isDescriptionVisible || hasInfoMessage) && /* @__PURE__ */ (0,
|
|
14730
|
-
isDescriptionVisible && /* @__PURE__ */ (0,
|
|
14731
|
-
hasInfoMessage && /* @__PURE__ */ (0,
|
|
14639
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { id: props.id, children: [
|
|
14640
|
+
isErrorVisible ? /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_components46.InlineAlert, { type: "error", children: props.errors }) : null,
|
|
14641
|
+
isValidationVisible ? /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_components46.InlineAlert, { type: "error", children: props.validations.map((validation) => /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { children: validationMessages[validation] }, validation)) }) : null,
|
|
14642
|
+
(isDescriptionVisible || hasInfoMessage) && /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(import_components46.InlineAlert, { type: "info", children: [
|
|
14643
|
+
isDescriptionVisible && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { children: props.schema.description }),
|
|
14644
|
+
hasInfoMessage && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { children: props.infoMessage })
|
|
14732
14645
|
] })
|
|
14733
14646
|
] });
|
|
14734
14647
|
}
|
|
@@ -14854,15 +14767,15 @@ function useFormattedDefaultErrorMessages({
|
|
|
14854
14767
|
}
|
|
14855
14768
|
|
|
14856
14769
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.tsx
|
|
14857
|
-
var
|
|
14770
|
+
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
14858
14771
|
function MultipleFileUploadSchema(props) {
|
|
14859
14772
|
var _a, _b;
|
|
14860
14773
|
const { onChange, schema } = props;
|
|
14861
14774
|
const onEvent = useEventDispatcher();
|
|
14862
14775
|
const defaultErrorMessages = useFormattedDefaultErrorMessages(schema);
|
|
14863
|
-
const uid = (0,
|
|
14864
|
-
const [inputChanged, setInputChanged] = (0,
|
|
14865
|
-
const [files, setFiles] = (0,
|
|
14776
|
+
const uid = (0, import_react33.useMemo)(() => schema.$id || generateRandomId(), [schema.$id]);
|
|
14777
|
+
const [inputChanged, setInputChanged] = (0, import_react33.useState)(false);
|
|
14778
|
+
const [files, setFiles] = (0, import_react33.useState)(() => convertFileIdsToComponentFileObjects(props.model || []));
|
|
14866
14779
|
const performPersistAsync = usePersistAsync(schema.items.persistAsync);
|
|
14867
14780
|
const fileSchemaDescriptor = schema.items.persistAsync.schema;
|
|
14868
14781
|
const isBlob = isBlobSchema2(fileSchemaDescriptor);
|
|
@@ -14916,10 +14829,10 @@ function MultipleFileUploadSchema(props) {
|
|
|
14916
14829
|
onDeleteFile: () => Promise.resolve()
|
|
14917
14830
|
});
|
|
14918
14831
|
const feedbackId = `${uid}-feedback`;
|
|
14919
|
-
return /* @__PURE__ */ (0,
|
|
14920
|
-
/* @__PURE__ */ (0,
|
|
14921
|
-
/* @__PURE__ */ (0,
|
|
14922
|
-
/* @__PURE__ */ (0,
|
|
14832
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { className: (0, import_classnames7.default)("form-group", { "has-error": showError }), children: [
|
|
14833
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("label", { className: "d-block control-label", htmlFor: uid, children: props.schema.title }),
|
|
14834
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { "aria-describedby": feedbackId, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_components47.UploadInput, __spreadValues({}, uploadInputProps)) }),
|
|
14835
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
14923
14836
|
ControlFeedback_default,
|
|
14924
14837
|
{
|
|
14925
14838
|
id: feedbackId,
|
|
@@ -14961,13 +14874,13 @@ function getValidationMessages(schema, required, defaultErrorMessages) {
|
|
|
14961
14874
|
|
|
14962
14875
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multiSelectSchema/MultiSelectSchema.tsx
|
|
14963
14876
|
var import_components49 = require("@transferwise/components");
|
|
14964
|
-
var
|
|
14965
|
-
var
|
|
14877
|
+
var import_classnames8 = __toESM(require_classnames());
|
|
14878
|
+
var import_react34 = require("react");
|
|
14966
14879
|
var import_react_intl25 = require("react-intl");
|
|
14967
14880
|
|
|
14968
14881
|
// src/legacy/jsonSchemaForm/schemaFormControl/utils/mapping-utils.tsx
|
|
14969
14882
|
var import_components48 = require("@transferwise/components");
|
|
14970
|
-
var
|
|
14883
|
+
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
14971
14884
|
var mapConstSchemaToOption = (schema, controlType) => {
|
|
14972
14885
|
switch (controlType) {
|
|
14973
14886
|
case "select":
|
|
@@ -14991,7 +14904,7 @@ var mapKeywordsToSearchStrings = (searchStrings) => isArray2(searchStrings) ? {
|
|
|
14991
14904
|
var mapImage = (image) => {
|
|
14992
14905
|
if (image == null ? void 0 : image.url) {
|
|
14993
14906
|
return {
|
|
14994
|
-
icon: /* @__PURE__ */ (0,
|
|
14907
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: "media", children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: "np-option__no-media-circle", children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("img", { src: image.url, alt: image.name || "" }) }) }),
|
|
14995
14908
|
hideIconInTrigger: true
|
|
14996
14909
|
};
|
|
14997
14910
|
}
|
|
@@ -15000,17 +14913,17 @@ var mapImage = (image) => {
|
|
|
15000
14913
|
var getIconPropertyForSelectOption = (icon) => {
|
|
15001
14914
|
if ((icon == null ? void 0 : icon.name) && isFlagIcon2(icon.name)) {
|
|
15002
14915
|
return {
|
|
15003
|
-
icon: /* @__PURE__ */ (0,
|
|
14916
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Flag, { code: icon.name.substring(5), intrinsicSize: 24 })
|
|
15004
14917
|
};
|
|
15005
14918
|
}
|
|
15006
14919
|
if ((icon == null ? void 0 : icon.name) && isValidIconName(icon.name)) {
|
|
15007
14920
|
return {
|
|
15008
|
-
icon: /* @__PURE__ */ (0,
|
|
14921
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(DynamicIcon_default2, { type: icon.name })
|
|
15009
14922
|
};
|
|
15010
14923
|
}
|
|
15011
14924
|
if (icon == null ? void 0 : icon.text) {
|
|
15012
14925
|
return {
|
|
15013
|
-
icon: /* @__PURE__ */ (0,
|
|
14926
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("span", { children: icon.text })
|
|
15014
14927
|
};
|
|
15015
14928
|
}
|
|
15016
14929
|
return null;
|
|
@@ -15018,17 +14931,17 @@ var getIconPropertyForSelectOption = (icon) => {
|
|
|
15018
14931
|
var getAvatarPropertyForRadioOption = ({ image, icon }) => {
|
|
15019
14932
|
if (image == null ? void 0 : image.url) {
|
|
15020
14933
|
return {
|
|
15021
|
-
avatar: /* @__PURE__ */ (0,
|
|
14934
|
+
avatar: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_components48.Avatar, { type: import_components48.AvatarType.THUMBNAIL, children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("img", { src: image.url, alt: "" }) })
|
|
15022
14935
|
};
|
|
15023
14936
|
}
|
|
15024
14937
|
if ((icon == null ? void 0 : icon.name) && isValidIconName(icon.name)) {
|
|
15025
14938
|
return {
|
|
15026
|
-
avatar: /* @__PURE__ */ (0,
|
|
14939
|
+
avatar: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_components48.Avatar, { type: import_components48.AvatarType.ICON, children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(DynamicIcon_default2, { type: icon.name }) })
|
|
15027
14940
|
};
|
|
15028
14941
|
}
|
|
15029
14942
|
if (icon == null ? void 0 : icon.text) {
|
|
15030
14943
|
return {
|
|
15031
|
-
avatar: /* @__PURE__ */ (0,
|
|
14944
|
+
avatar: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_components48.Avatar, { type: import_components48.AvatarType.INITIALS, children: icon.text })
|
|
15032
14945
|
};
|
|
15033
14946
|
}
|
|
15034
14947
|
return null;
|
|
@@ -15067,7 +14980,7 @@ var multi_select_messages_default2 = (0, import_react_intl24.defineMessages)({
|
|
|
15067
14980
|
});
|
|
15068
14981
|
|
|
15069
14982
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multiSelectSchema/MultiSelectSchema.tsx
|
|
15070
|
-
var
|
|
14983
|
+
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
15071
14984
|
function MultiSelectSchema({
|
|
15072
14985
|
schema,
|
|
15073
14986
|
model,
|
|
@@ -15079,10 +14992,10 @@ function MultiSelectSchema({
|
|
|
15079
14992
|
const { formatMessage, locale } = (0, import_react_intl25.useIntl)();
|
|
15080
14993
|
const { disabled, items, validationMessages, placeholder } = schema;
|
|
15081
14994
|
const options = items.oneOf.map((item) => mapConstSchemaToOption(item, "select"));
|
|
15082
|
-
const id = (0,
|
|
15083
|
-
const [changed, setChanged] = (0,
|
|
15084
|
-
const [selected, setSelected] = (0,
|
|
15085
|
-
(0,
|
|
14995
|
+
const id = (0, import_react34.useMemo)(() => schema.$id || generateRandomId(), [schema.$id]);
|
|
14996
|
+
const [changed, setChanged] = (0, import_react34.useState)(false);
|
|
14997
|
+
const [selected, setSelected] = (0, import_react34.useState)(getInitialModelIndices2(model, options));
|
|
14998
|
+
(0, import_react34.useEffect)(
|
|
15086
14999
|
() => {
|
|
15087
15000
|
if (selected) {
|
|
15088
15001
|
broadcastModelChange(selected);
|
|
@@ -15119,9 +15032,9 @@ function MultiSelectSchema({
|
|
|
15119
15032
|
const formGroupClasses = {
|
|
15120
15033
|
"has-error": shouldShowInitialError || shouldShowValidationError
|
|
15121
15034
|
};
|
|
15122
|
-
return /* @__PURE__ */ (0,
|
|
15123
|
-
schema.title ? /* @__PURE__ */ (0,
|
|
15124
|
-
/* @__PURE__ */ (0,
|
|
15035
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: (0, import_classnames8.default)("d-flex flex-column", formGroupClasses), children: [
|
|
15036
|
+
schema.title ? /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("label", { htmlFor: id, children: schema.title }) : void 0,
|
|
15037
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
15125
15038
|
import_components49.SelectInput,
|
|
15126
15039
|
{
|
|
15127
15040
|
id,
|
|
@@ -15147,12 +15060,12 @@ function MultiSelectSchema({
|
|
|
15147
15060
|
if (withinTrigger) {
|
|
15148
15061
|
return selected && index === selected[0] ? getFormattedMessage() : void 0;
|
|
15149
15062
|
}
|
|
15150
|
-
return /* @__PURE__ */ (0,
|
|
15063
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_components49.SelectInputOptionContent, { title: label, note: note != null ? note : secondary, icon });
|
|
15151
15064
|
},
|
|
15152
15065
|
onChange: broadcastModelChange
|
|
15153
15066
|
}
|
|
15154
15067
|
),
|
|
15155
|
-
/* @__PURE__ */ (0,
|
|
15068
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
15156
15069
|
ControlFeedback_default,
|
|
15157
15070
|
{
|
|
15158
15071
|
id: `${id}-feedback`,
|
|
@@ -15179,14 +15092,14 @@ var getInitialModelIndices2 = (model, options) => {
|
|
|
15179
15092
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchema.tsx
|
|
15180
15093
|
var import_components51 = require("@transferwise/components");
|
|
15181
15094
|
var import_icons4 = require("@transferwise/icons");
|
|
15182
|
-
var
|
|
15095
|
+
var import_react36 = require("react");
|
|
15183
15096
|
var import_react_intl28 = require("react-intl");
|
|
15184
15097
|
|
|
15185
15098
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/ItemSummary.tsx
|
|
15186
15099
|
var import_components50 = require("@transferwise/components");
|
|
15187
|
-
var
|
|
15100
|
+
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
15188
15101
|
function ItemSummaryOption2({ item, onClick }) {
|
|
15189
|
-
return /* @__PURE__ */ (0,
|
|
15102
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
15190
15103
|
import_components50.NavigationOption,
|
|
15191
15104
|
{
|
|
15192
15105
|
media: getNavigationOptionMedia(item),
|
|
@@ -15224,9 +15137,9 @@ var repeatable_messages_default2 = (0, import_react_intl26.defineMessages)({
|
|
|
15224
15137
|
});
|
|
15225
15138
|
|
|
15226
15139
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchemaStep.tsx
|
|
15227
|
-
var
|
|
15140
|
+
var import_react35 = require("react");
|
|
15228
15141
|
var import_react_intl27 = require("react-intl");
|
|
15229
|
-
var
|
|
15142
|
+
var import_jsx_runtime83 = require("react/jsx-runtime");
|
|
15230
15143
|
function RepeatableSchemaStep({
|
|
15231
15144
|
type,
|
|
15232
15145
|
schema,
|
|
@@ -15237,7 +15150,7 @@ function RepeatableSchemaStep({
|
|
|
15237
15150
|
onAction
|
|
15238
15151
|
}) {
|
|
15239
15152
|
const { formatMessage } = (0, import_react_intl27.useIntl)();
|
|
15240
|
-
const [filename, setFilename] = (0,
|
|
15153
|
+
const [filename, setFilename] = (0, import_react35.useState)(void 0);
|
|
15241
15154
|
const step = {
|
|
15242
15155
|
layout: [
|
|
15243
15156
|
{
|
|
@@ -15274,7 +15187,7 @@ function RepeatableSchemaStep({
|
|
|
15274
15187
|
}
|
|
15275
15188
|
onModelChange(__spreadProps(__spreadValues({}, modelChangeProps), { model: model2 }));
|
|
15276
15189
|
};
|
|
15277
|
-
return /* @__PURE__ */ (0,
|
|
15190
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
15278
15191
|
DynamicFlowStep,
|
|
15279
15192
|
{
|
|
15280
15193
|
step,
|
|
@@ -15479,8 +15392,8 @@ var schemaSummaryProvides = (summary, providesProp) => (
|
|
|
15479
15392
|
);
|
|
15480
15393
|
|
|
15481
15394
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchema.tsx
|
|
15482
|
-
var
|
|
15483
|
-
var
|
|
15395
|
+
var import_classnames9 = __toESM(require_classnames());
|
|
15396
|
+
var import_jsx_runtime84 = require("react/jsx-runtime");
|
|
15484
15397
|
function RepeatableSchema({
|
|
15485
15398
|
schema,
|
|
15486
15399
|
model,
|
|
@@ -15490,9 +15403,9 @@ function RepeatableSchema({
|
|
|
15490
15403
|
onChange
|
|
15491
15404
|
}) {
|
|
15492
15405
|
var _a;
|
|
15493
|
-
const [openModalType, setOpenModalType] = (0,
|
|
15494
|
-
const [changed, setChanged] = (0,
|
|
15495
|
-
const [itemSummaries, setItemSummaries] = (0,
|
|
15406
|
+
const [openModalType, setOpenModalType] = (0, import_react36.useState)(null);
|
|
15407
|
+
const [changed, setChanged] = (0, import_react36.useState)(false);
|
|
15408
|
+
const [itemSummaries, setItemSummaries] = (0, import_react36.useState)(() => {
|
|
15496
15409
|
if (isObject2(model) && !isArray2(model)) {
|
|
15497
15410
|
throw new Error(
|
|
15498
15411
|
"RepeatableSchema does not support object models. Ensure your array schema is wrapped inside an object schema."
|
|
@@ -15500,8 +15413,8 @@ function RepeatableSchema({
|
|
|
15500
15413
|
}
|
|
15501
15414
|
return model ? model.map((item) => getItemSummaryFromSchema(schema.items, item, schema == null ? void 0 : schema.summary)) : null;
|
|
15502
15415
|
});
|
|
15503
|
-
const [editableItem, setEditableItem] = (0,
|
|
15504
|
-
const id = (0,
|
|
15416
|
+
const [editableItem, setEditableItem] = (0, import_react36.useState)({ item: null, model: null });
|
|
15417
|
+
const id = (0, import_react36.useMemo)(() => schema.$id || generateRandomId(), [schema.$id]);
|
|
15505
15418
|
const broadcastModelChange = (updatedItems) => {
|
|
15506
15419
|
const updatedModel = updatedItems ? updatedItems.map(({ value }) => value) : null;
|
|
15507
15420
|
onChange({
|
|
@@ -15557,9 +15470,9 @@ function RepeatableSchema({
|
|
|
15557
15470
|
const formGroupClasses = {
|
|
15558
15471
|
"has-error": (_a = errors && !isEmpty(errors)) != null ? _a : submitted && validations.length
|
|
15559
15472
|
};
|
|
15560
|
-
return /* @__PURE__ */ (0,
|
|
15561
|
-
schema.title && /* @__PURE__ */ (0,
|
|
15562
|
-
itemSummaries == null ? void 0 : itemSummaries.map((itemSummary) => /* @__PURE__ */ (0,
|
|
15473
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { id, className: (0, import_classnames9.default)(formGroupClasses), children: [
|
|
15474
|
+
schema.title && /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_components51.Header, { title: schema.title }),
|
|
15475
|
+
itemSummaries == null ? void 0 : itemSummaries.map((itemSummary) => /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
15563
15476
|
ItemSummaryOption2,
|
|
15564
15477
|
{
|
|
15565
15478
|
item: itemSummary,
|
|
@@ -15567,21 +15480,21 @@ function RepeatableSchema({
|
|
|
15567
15480
|
},
|
|
15568
15481
|
JSON.stringify(itemSummary)
|
|
15569
15482
|
)),
|
|
15570
|
-
/* @__PURE__ */ (0,
|
|
15483
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
15571
15484
|
import_components51.NavigationOption,
|
|
15572
15485
|
{
|
|
15573
|
-
media: /* @__PURE__ */ (0,
|
|
15486
|
+
media: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_icons4.Plus, {}),
|
|
15574
15487
|
title: schema.addItemTitle || formatMessage(repeatable_messages_default2.addItemTitle),
|
|
15575
15488
|
showMediaAtAllSizes: true,
|
|
15576
15489
|
onClick: onAddItem
|
|
15577
15490
|
}
|
|
15578
15491
|
),
|
|
15579
|
-
/* @__PURE__ */ (0,
|
|
15492
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
15580
15493
|
import_components51.Modal,
|
|
15581
15494
|
{
|
|
15582
15495
|
open: openModalType !== null,
|
|
15583
15496
|
title: (openModalType === "add" ? schema.addItemTitle : schema.editItemTitle) || formatMessage(repeatable_messages_default2.addItemTitle),
|
|
15584
|
-
body: /* @__PURE__ */ (0,
|
|
15497
|
+
body: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
15585
15498
|
RepeatableSchemaStep_default,
|
|
15586
15499
|
{
|
|
15587
15500
|
type: openModalType != null ? openModalType : "add",
|
|
@@ -15596,7 +15509,7 @@ function RepeatableSchema({
|
|
|
15596
15509
|
onClose: onCancelEdit
|
|
15597
15510
|
}
|
|
15598
15511
|
),
|
|
15599
|
-
/* @__PURE__ */ (0,
|
|
15512
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
15600
15513
|
ControlFeedback_default,
|
|
15601
15514
|
{
|
|
15602
15515
|
id: `${id}-feedback`,
|
|
@@ -15638,17 +15551,17 @@ var getUpdatedItemSummaries = (action, {
|
|
|
15638
15551
|
var RepeatableSchema_default = RepeatableSchema;
|
|
15639
15552
|
|
|
15640
15553
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.tsx
|
|
15641
|
-
var
|
|
15554
|
+
var import_jsx_runtime85 = require("react/jsx-runtime");
|
|
15642
15555
|
function ArrayListSchema(props) {
|
|
15643
15556
|
const { schema } = props;
|
|
15644
15557
|
if (isMultipleFileUploadSchema(schema)) {
|
|
15645
|
-
return /* @__PURE__ */ (0,
|
|
15558
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(MultipleFileUploadSchema_default, __spreadProps(__spreadValues({}, props), { schema }));
|
|
15646
15559
|
}
|
|
15647
15560
|
if (isMultiSelectConstSchema(schema)) {
|
|
15648
|
-
return /* @__PURE__ */ (0,
|
|
15561
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(MultiSelectSchema, __spreadProps(__spreadValues({}, props), { schema }));
|
|
15649
15562
|
}
|
|
15650
15563
|
if (isListArraySchema(schema)) {
|
|
15651
|
-
return /* @__PURE__ */ (0,
|
|
15564
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(RepeatableSchema_default, __spreadProps(__spreadValues({}, props), { schema }));
|
|
15652
15565
|
}
|
|
15653
15566
|
throw new Error("Invalid array list schema");
|
|
15654
15567
|
}
|
|
@@ -15659,11 +15572,11 @@ ArrayListSchema.defaultProps = {
|
|
|
15659
15572
|
var ArrayListSchema_default = ArrayListSchema;
|
|
15660
15573
|
|
|
15661
15574
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/ArraySchema.tsx
|
|
15662
|
-
var
|
|
15575
|
+
var import_jsx_runtime86 = require("react/jsx-runtime");
|
|
15663
15576
|
var ArraySchema = (props) => {
|
|
15664
15577
|
const { schema } = props;
|
|
15665
15578
|
if (isListArraySchema(schema)) {
|
|
15666
|
-
return /* @__PURE__ */ (0,
|
|
15579
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(ArrayListSchema_default, __spreadValues({}, props));
|
|
15667
15580
|
}
|
|
15668
15581
|
throw new Error("Not implemented");
|
|
15669
15582
|
};
|
|
@@ -15674,16 +15587,16 @@ var ArraySchema_default = ArraySchema;
|
|
|
15674
15587
|
|
|
15675
15588
|
// src/legacy/jsonSchemaForm/objectSchema/ObjectSchema.tsx
|
|
15676
15589
|
var import_components52 = require("@transferwise/components");
|
|
15677
|
-
var
|
|
15678
|
-
var
|
|
15679
|
-
var
|
|
15590
|
+
var import_classnames10 = __toESM(require_classnames());
|
|
15591
|
+
var import_react37 = require("react");
|
|
15592
|
+
var import_jsx_runtime87 = require("react/jsx-runtime");
|
|
15680
15593
|
var getSchemaColumnClasses2 = (width) => ({
|
|
15681
15594
|
"col-xs-12": true,
|
|
15682
15595
|
"col-sm-6": width === "md",
|
|
15683
15596
|
"col-sm-4": width === "sm"
|
|
15684
15597
|
});
|
|
15685
15598
|
function ObjectSchema(props) {
|
|
15686
|
-
const [model, setModel] = (0,
|
|
15599
|
+
const [model, setModel] = (0, import_react37.useState)(() => __spreadValues({}, getValidObjectModelParts(props.model, props.schema)));
|
|
15687
15600
|
const onChangeProperty = (propertyName, onChangeProps) => {
|
|
15688
15601
|
if (onChangeProps.model !== null) {
|
|
15689
15602
|
model[propertyName] = onChangeProps.model;
|
|
@@ -15694,7 +15607,7 @@ function ObjectSchema(props) {
|
|
|
15694
15607
|
props.onChange(__spreadProps(__spreadValues({}, onChangeProps), { model }));
|
|
15695
15608
|
};
|
|
15696
15609
|
const isRequired = (propertyName) => props.schema.required && props.schema.required.includes(propertyName);
|
|
15697
|
-
(0,
|
|
15610
|
+
(0, import_react37.useEffect)(() => {
|
|
15698
15611
|
const newModel = getValidObjectModelParts(model, props.schema) || {};
|
|
15699
15612
|
setModel(newModel);
|
|
15700
15613
|
if (!isEqual(newModel, model)) {
|
|
@@ -15712,22 +15625,22 @@ function ObjectSchema(props) {
|
|
|
15712
15625
|
const isPropertyDefined = (propertyName) => typeof props.schema.properties[propertyName] !== "undefined";
|
|
15713
15626
|
const orderedPropertyNames = Array.from(allorderedPropertiesSet).filter(isPropertyDefined);
|
|
15714
15627
|
const propsErrors = props.errors;
|
|
15715
|
-
return /* @__PURE__ */ (0,
|
|
15716
|
-
props.schema.alert && /* @__PURE__ */ (0,
|
|
15717
|
-
/* @__PURE__ */ (0,
|
|
15718
|
-
props.schema.title && !props.hideTitle && /* @__PURE__ */ (0,
|
|
15719
|
-
props.schema.description && !props.hideTitle && /* @__PURE__ */ (0,
|
|
15628
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(import_jsx_runtime87.Fragment, { children: [
|
|
15629
|
+
props.schema.alert && /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(DynamicAlert_default, { component: props.schema.alert }),
|
|
15630
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("fieldset", { children: [
|
|
15631
|
+
props.schema.title && !props.hideTitle && /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_components52.Header, { title: props.schema.title, as: "legend" }),
|
|
15632
|
+
props.schema.description && !props.hideTitle && /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("p", { children: [
|
|
15720
15633
|
" ",
|
|
15721
15634
|
props.schema.description,
|
|
15722
15635
|
" "
|
|
15723
15636
|
] }),
|
|
15724
|
-
/* @__PURE__ */ (0,
|
|
15637
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "row", children: orderedPropertyNames.map((propertyName) => /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
15725
15638
|
"div",
|
|
15726
15639
|
{
|
|
15727
|
-
className: (0,
|
|
15640
|
+
className: (0, import_classnames10.default)(
|
|
15728
15641
|
getSchemaColumnClasses2(props.schema.properties[propertyName].width)
|
|
15729
15642
|
),
|
|
15730
|
-
children: /* @__PURE__ */ (0,
|
|
15643
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
15731
15644
|
GenericSchema_default,
|
|
15732
15645
|
{
|
|
15733
15646
|
schema: props.schema.properties[propertyName],
|
|
@@ -15754,8 +15667,8 @@ var ObjectSchema_default = ObjectSchema;
|
|
|
15754
15667
|
|
|
15755
15668
|
// src/legacy/jsonSchemaForm/oneOfSchema/OneOfSchema.tsx
|
|
15756
15669
|
var import_components55 = require("@transferwise/components");
|
|
15757
|
-
var
|
|
15758
|
-
var
|
|
15670
|
+
var import_classnames11 = __toESM(require_classnames());
|
|
15671
|
+
var import_react40 = require("react");
|
|
15759
15672
|
|
|
15760
15673
|
// src/legacy/jsonSchemaForm/help/Help.tsx
|
|
15761
15674
|
var import_components53 = require("@transferwise/components");
|
|
@@ -15772,14 +15685,14 @@ var help_messages_default2 = (0, import_react_intl29.defineMessages)({
|
|
|
15772
15685
|
});
|
|
15773
15686
|
|
|
15774
15687
|
// src/legacy/jsonSchemaForm/help/Help.tsx
|
|
15775
|
-
var
|
|
15688
|
+
var import_jsx_runtime88 = require("react/jsx-runtime");
|
|
15776
15689
|
function Help2(props) {
|
|
15777
15690
|
const intl = (0, import_react_intl30.useIntl)();
|
|
15778
|
-
return /* @__PURE__ */ (0,
|
|
15691
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
15779
15692
|
import_components53.Info,
|
|
15780
15693
|
{
|
|
15781
15694
|
className: "m-l-1",
|
|
15782
|
-
content: /* @__PURE__ */ (0,
|
|
15695
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_components53.Markdown, { config: { link: { target: "_blank" } }, children: props.help.markdown }),
|
|
15783
15696
|
presentation: "POPOVER",
|
|
15784
15697
|
size: "sm",
|
|
15785
15698
|
"aria-label": intl.formatMessage(help_messages_default2.helpAria)
|
|
@@ -15789,11 +15702,11 @@ function Help2(props) {
|
|
|
15789
15702
|
var Help_default2 = Help2;
|
|
15790
15703
|
|
|
15791
15704
|
// src/legacy/jsonSchemaForm/schemaFormControl/SchemaFormControl.tsx
|
|
15792
|
-
var
|
|
15705
|
+
var import_react39 = require("react");
|
|
15793
15706
|
|
|
15794
15707
|
// src/legacy/formControl/FormControl.tsx
|
|
15795
15708
|
var import_components54 = require("@transferwise/components");
|
|
15796
|
-
var
|
|
15709
|
+
var import_react38 = require("react");
|
|
15797
15710
|
|
|
15798
15711
|
// src/legacy/formControl/utils/value-utils.ts
|
|
15799
15712
|
var getSafeStringValue = (value, options = {}) => {
|
|
@@ -15979,8 +15892,8 @@ var autocompleteTokenMap2 = {
|
|
|
15979
15892
|
};
|
|
15980
15893
|
|
|
15981
15894
|
// src/legacy/formControl/FormControl.tsx
|
|
15982
|
-
var
|
|
15983
|
-
var _FormControl = class _FormControl extends
|
|
15895
|
+
var import_jsx_runtime89 = require("react/jsx-runtime");
|
|
15896
|
+
var _FormControl = class _FormControl extends import_react38.PureComponent {
|
|
15984
15897
|
constructor(props) {
|
|
15985
15898
|
super(props);
|
|
15986
15899
|
this.getAutocompleteValue = ({ prefix = "", suffix = "" } = {}) => {
|
|
@@ -16067,7 +15980,7 @@ var _FormControl = class _FormControl extends import_react40.PureComponent {
|
|
|
16067
15980
|
} = this.props;
|
|
16068
15981
|
switch (type) {
|
|
16069
15982
|
case FormControlType.RADIO:
|
|
16070
|
-
return /* @__PURE__ */ (0,
|
|
15983
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
16071
15984
|
import_components54.RadioGroup,
|
|
16072
15985
|
{
|
|
16073
15986
|
radios: options.map(this.mapOption),
|
|
@@ -16077,7 +15990,7 @@ var _FormControl = class _FormControl extends import_react40.PureComponent {
|
|
|
16077
15990
|
}
|
|
16078
15991
|
);
|
|
16079
15992
|
case FormControlType.CHECKBOX:
|
|
16080
|
-
return /* @__PURE__ */ (0,
|
|
15993
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
16081
15994
|
import_components54.Checkbox,
|
|
16082
15995
|
{
|
|
16083
15996
|
checked: getSafeBooleanValue(value, { coerceValue: true }),
|
|
@@ -16095,7 +16008,7 @@ var _FormControl = class _FormControl extends import_react40.PureComponent {
|
|
|
16095
16008
|
const search = options.length >= 8;
|
|
16096
16009
|
const items = options;
|
|
16097
16010
|
const selected = this.getSelectedOption(options);
|
|
16098
|
-
return /* @__PURE__ */ (0,
|
|
16011
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: "d-flex flex-column", children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
16099
16012
|
import_components54.SelectInput,
|
|
16100
16013
|
{
|
|
16101
16014
|
id,
|
|
@@ -16105,7 +16018,7 @@ var _FormControl = class _FormControl extends import_react40.PureComponent {
|
|
|
16105
16018
|
disabled: value2.disabled
|
|
16106
16019
|
})),
|
|
16107
16020
|
value: selected != null ? selected : null,
|
|
16108
|
-
renderValue: ({ hideIconInTrigger, icon, label: label2, note, secondary }, withinTrigger) => /* @__PURE__ */ (0,
|
|
16021
|
+
renderValue: ({ hideIconInTrigger, icon, label: label2, note, secondary }, withinTrigger) => /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
16109
16022
|
import_components54.SelectInputOptionContent,
|
|
16110
16023
|
{
|
|
16111
16024
|
title: label2,
|
|
@@ -16134,13 +16047,13 @@ var _FormControl = class _FormControl extends import_react40.PureComponent {
|
|
|
16134
16047
|
) });
|
|
16135
16048
|
}
|
|
16136
16049
|
case FormControlType.TAB:
|
|
16137
|
-
return /* @__PURE__ */ (0,
|
|
16050
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
16138
16051
|
import_components54.Tabs,
|
|
16139
16052
|
{
|
|
16140
16053
|
selected: ((_a = this.getSelectedOption(options)) == null ? void 0 : _a.value) || 0,
|
|
16141
16054
|
tabs: options.map((option) => ({
|
|
16142
16055
|
title: option.label,
|
|
16143
|
-
content: /* @__PURE__ */ (0,
|
|
16056
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_jsx_runtime89.Fragment, {}),
|
|
16144
16057
|
disabled: option.disabled || false
|
|
16145
16058
|
})),
|
|
16146
16059
|
name: id,
|
|
@@ -16155,7 +16068,7 @@ var _FormControl = class _FormControl extends import_react40.PureComponent {
|
|
|
16155
16068
|
);
|
|
16156
16069
|
case FormControlType.NUMERIC:
|
|
16157
16070
|
case FormControlType.NUMBER: {
|
|
16158
|
-
return /* @__PURE__ */ (0,
|
|
16071
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
16159
16072
|
"input",
|
|
16160
16073
|
{
|
|
16161
16074
|
autoComplete: this.getAutocompleteValue(),
|
|
@@ -16189,7 +16102,7 @@ var _FormControl = class _FormControl extends import_react40.PureComponent {
|
|
|
16189
16102
|
);
|
|
16190
16103
|
}
|
|
16191
16104
|
case FormControlType.HIDDEN:
|
|
16192
|
-
return /* @__PURE__ */ (0,
|
|
16105
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
16193
16106
|
"input",
|
|
16194
16107
|
{
|
|
16195
16108
|
type: "hidden",
|
|
@@ -16199,7 +16112,7 @@ var _FormControl = class _FormControl extends import_react40.PureComponent {
|
|
|
16199
16112
|
}
|
|
16200
16113
|
);
|
|
16201
16114
|
case FormControlType.PASSWORD:
|
|
16202
|
-
return /* @__PURE__ */ (0,
|
|
16115
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
16203
16116
|
"input",
|
|
16204
16117
|
{
|
|
16205
16118
|
autoComplete: this.getAutocompleteValue(),
|
|
@@ -16219,7 +16132,7 @@ var _FormControl = class _FormControl extends import_react40.PureComponent {
|
|
|
16219
16132
|
);
|
|
16220
16133
|
case FormControlType.DATE:
|
|
16221
16134
|
case FormControlType.DATETIME:
|
|
16222
|
-
return /* @__PURE__ */ (0,
|
|
16135
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
16223
16136
|
import_components54.DateInput,
|
|
16224
16137
|
{
|
|
16225
16138
|
dayAutoComplete: this.getAutocompleteValue({ suffix: "-day" }),
|
|
@@ -16235,7 +16148,7 @@ var _FormControl = class _FormControl extends import_react40.PureComponent {
|
|
|
16235
16148
|
}
|
|
16236
16149
|
);
|
|
16237
16150
|
case FormControlType.DATELOOKUP: {
|
|
16238
|
-
return /* @__PURE__ */ (0,
|
|
16151
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
16239
16152
|
import_components54.DateLookup,
|
|
16240
16153
|
{
|
|
16241
16154
|
value: getSafeDateStringValue(value),
|
|
@@ -16253,7 +16166,7 @@ var _FormControl = class _FormControl extends import_react40.PureComponent {
|
|
|
16253
16166
|
);
|
|
16254
16167
|
}
|
|
16255
16168
|
case FormControlType.TEL:
|
|
16256
|
-
return /* @__PURE__ */ (0,
|
|
16169
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
16257
16170
|
import_components54.PhoneNumberInput,
|
|
16258
16171
|
{
|
|
16259
16172
|
disabled,
|
|
@@ -16285,7 +16198,7 @@ var _FormControl = class _FormControl extends import_react40.PureComponent {
|
|
|
16285
16198
|
autoComplete: this.getAutocompleteValue()
|
|
16286
16199
|
};
|
|
16287
16200
|
if (this.props.displayPattern) {
|
|
16288
|
-
return /* @__PURE__ */ (0,
|
|
16201
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
16289
16202
|
import_components54.TextareaWithDisplayFormat,
|
|
16290
16203
|
__spreadProps(__spreadValues({
|
|
16291
16204
|
displayPattern: this.props.displayPattern
|
|
@@ -16294,7 +16207,7 @@ var _FormControl = class _FormControl extends import_react40.PureComponent {
|
|
|
16294
16207
|
})
|
|
16295
16208
|
);
|
|
16296
16209
|
}
|
|
16297
|
-
return /* @__PURE__ */ (0,
|
|
16210
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
16298
16211
|
"textarea",
|
|
16299
16212
|
__spreadProps(__spreadValues({}, textareaProps), {
|
|
16300
16213
|
"aria-describedby": describedBy,
|
|
@@ -16307,7 +16220,7 @@ var _FormControl = class _FormControl extends import_react40.PureComponent {
|
|
|
16307
16220
|
return (
|
|
16308
16221
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
16309
16222
|
// @ts-expect-error - TODO: Remove this once Upload is migrated to TypeScript
|
|
16310
|
-
/* @__PURE__ */ (0,
|
|
16223
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
16311
16224
|
import_components54.Upload,
|
|
16312
16225
|
__spreadProps(__spreadValues({}, uploadProps), {
|
|
16313
16226
|
usAccept: uploadProps.usAccept || "*",
|
|
@@ -16345,7 +16258,7 @@ var _FormControl = class _FormControl extends import_react40.PureComponent {
|
|
|
16345
16258
|
autoComplete: this.getAutocompleteValue()
|
|
16346
16259
|
};
|
|
16347
16260
|
if (this.props.displayPattern) {
|
|
16348
|
-
return /* @__PURE__ */ (0,
|
|
16261
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
16349
16262
|
import_components54.InputWithDisplayFormat,
|
|
16350
16263
|
__spreadProps(__spreadValues({
|
|
16351
16264
|
displayPattern: this.props.displayPattern
|
|
@@ -16354,7 +16267,7 @@ var _FormControl = class _FormControl extends import_react40.PureComponent {
|
|
|
16354
16267
|
})
|
|
16355
16268
|
);
|
|
16356
16269
|
}
|
|
16357
|
-
return /* @__PURE__ */ (0,
|
|
16270
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
16358
16271
|
"input",
|
|
16359
16272
|
__spreadProps(__spreadValues({}, inputProps), {
|
|
16360
16273
|
"aria-describedby": describedBy,
|
|
@@ -16403,7 +16316,7 @@ _FormControl.defaultProps = {
|
|
|
16403
16316
|
var FormControl = _FormControl;
|
|
16404
16317
|
|
|
16405
16318
|
// src/legacy/jsonSchemaForm/schemaFormControl/SchemaFormControl.tsx
|
|
16406
|
-
var
|
|
16319
|
+
var import_jsx_runtime90 = require("react/jsx-runtime");
|
|
16407
16320
|
var isNativeInput = (propsSchemaType) => propsSchemaType === "string" || propsSchemaType === "number";
|
|
16408
16321
|
var getControlType = (schema) => {
|
|
16409
16322
|
if (isOneOfSchema2(schema)) {
|
|
@@ -16482,7 +16395,7 @@ function SchemaFormControl(props) {
|
|
|
16482
16395
|
onChange(getValidBasicModelOrNull(value2, schema), type, metadata);
|
|
16483
16396
|
};
|
|
16484
16397
|
const controlType = getControlType(schema);
|
|
16485
|
-
(0,
|
|
16398
|
+
(0, import_react39.useEffect)(() => {
|
|
16486
16399
|
warnIfInvalidSchema(schema, log, controlType);
|
|
16487
16400
|
}, [JSON.stringify(schema), log, controlType]);
|
|
16488
16401
|
const options = schema.values || getOptions(schema, controlType);
|
|
@@ -16509,7 +16422,7 @@ function SchemaFormControl(props) {
|
|
|
16509
16422
|
describedBy,
|
|
16510
16423
|
required
|
|
16511
16424
|
};
|
|
16512
|
-
return /* @__PURE__ */ (0,
|
|
16425
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { "aria-describedby": describedBy, children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(FormControl, __spreadValues(__spreadValues({ type: controlType, value: safeValue }, events), controlProps)) });
|
|
16513
16426
|
}
|
|
16514
16427
|
SchemaFormControl.defaultProps = {
|
|
16515
16428
|
value: null,
|
|
@@ -16538,17 +16451,17 @@ var warnIfInvalidSchema = (schema, log, controlType) => {
|
|
|
16538
16451
|
var SchemaFormControl_default = SchemaFormControl;
|
|
16539
16452
|
|
|
16540
16453
|
// src/legacy/jsonSchemaForm/oneOfSchema/OneOfSchema.tsx
|
|
16541
|
-
var
|
|
16454
|
+
var import_jsx_runtime91 = require("react/jsx-runtime");
|
|
16542
16455
|
function OneOfSchema(props) {
|
|
16543
16456
|
const onEvent = useEventDispatcher();
|
|
16544
|
-
const [changed, setChanged] = (0,
|
|
16545
|
-
const [focused, setFocused] = (0,
|
|
16546
|
-
const [blurred, setBlurred] = (0,
|
|
16547
|
-
const id = (0,
|
|
16548
|
-
const [schemaIndex, setSchemaIndex] = (0,
|
|
16457
|
+
const [changed, setChanged] = (0, import_react40.useState)(false);
|
|
16458
|
+
const [focused, setFocused] = (0, import_react40.useState)(false);
|
|
16459
|
+
const [blurred, setBlurred] = (0, import_react40.useState)(false);
|
|
16460
|
+
const id = (0, import_react40.useMemo)(() => props.schema.$id || generateRandomId(), [props.schema.$id]);
|
|
16461
|
+
const [schemaIndex, setSchemaIndex] = (0, import_react40.useState)(
|
|
16549
16462
|
getActiveSchemaIndex(props.schema, props.model)
|
|
16550
16463
|
);
|
|
16551
|
-
const [models, setModels] = (0,
|
|
16464
|
+
const [models, setModels] = (0, import_react40.useState)(getModelPartsForSchemas(props.model, props.schema.oneOf));
|
|
16552
16465
|
const debouncedTrackEvent = useDebouncedFunction(onEvent, 200);
|
|
16553
16466
|
const onSearchChange = (searchValue) => {
|
|
16554
16467
|
debouncedTrackEvent("Dynamic Flow - OneOf Searched", {
|
|
@@ -16556,7 +16469,7 @@ function OneOfSchema(props) {
|
|
|
16556
16469
|
searchValueLength: searchValue.length
|
|
16557
16470
|
});
|
|
16558
16471
|
};
|
|
16559
|
-
(0,
|
|
16472
|
+
(0, import_react40.useEffect)(() => {
|
|
16560
16473
|
const modelIndex = getValidIndexFromValue(props.schema, props.model);
|
|
16561
16474
|
const defaultIndex = getValidIndexFromValue(props.schema, props.schema.default);
|
|
16562
16475
|
if (modelIndex === -1 && defaultIndex >= 0) {
|
|
@@ -16614,12 +16527,12 @@ function OneOfSchema(props) {
|
|
|
16614
16527
|
"has-error": !changed && props.errors && !isEmpty(props.errors) || (props.submitted || changed && blurred) && validations.length
|
|
16615
16528
|
};
|
|
16616
16529
|
const feedbackId = `${id}-feedback`;
|
|
16617
|
-
return /* @__PURE__ */ (0,
|
|
16618
|
-
(props.schema.oneOf.length > 1 || isConstSchema2(props.schema.oneOf[0])) && /* @__PURE__ */ (0,
|
|
16619
|
-
props.schema.alert && /* @__PURE__ */ (0,
|
|
16620
|
-
/* @__PURE__ */ (0,
|
|
16530
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(import_jsx_runtime91.Fragment, { children: [
|
|
16531
|
+
(props.schema.oneOf.length > 1 || isConstSchema2(props.schema.oneOf[0])) && /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(import_jsx_runtime91.Fragment, { children: [
|
|
16532
|
+
props.schema.alert && /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(DynamicAlert_default, { component: props.schema.alert }),
|
|
16533
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("div", { className: (0, import_classnames11.default)(formGroupClasses), children: [
|
|
16621
16534
|
getTitleAndHelp(props.schema, id),
|
|
16622
|
-
/* @__PURE__ */ (0,
|
|
16535
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
16623
16536
|
SchemaFormControl_default,
|
|
16624
16537
|
{
|
|
16625
16538
|
id,
|
|
@@ -16634,7 +16547,7 @@ function OneOfSchema(props) {
|
|
|
16634
16547
|
onSearchChange
|
|
16635
16548
|
}
|
|
16636
16549
|
),
|
|
16637
|
-
/* @__PURE__ */ (0,
|
|
16550
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
16638
16551
|
ControlFeedback_default,
|
|
16639
16552
|
{
|
|
16640
16553
|
id: feedbackId,
|
|
@@ -16650,7 +16563,7 @@ function OneOfSchema(props) {
|
|
|
16650
16563
|
)
|
|
16651
16564
|
] })
|
|
16652
16565
|
] }),
|
|
16653
|
-
isNoNConstSchema(props.schema.oneOf[schemaIndex]) && /* @__PURE__ */ (0,
|
|
16566
|
+
isNoNConstSchema(props.schema.oneOf[schemaIndex]) && /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
16654
16567
|
GenericSchema_default,
|
|
16655
16568
|
{
|
|
16656
16569
|
schema: props.schema.oneOf[schemaIndex],
|
|
@@ -16667,16 +16580,16 @@ function OneOfSchema(props) {
|
|
|
16667
16580
|
}
|
|
16668
16581
|
function getTitleAndHelp(schema, forId) {
|
|
16669
16582
|
var _a;
|
|
16670
|
-
const helpElement = schema.help ? /* @__PURE__ */ (0,
|
|
16671
|
-
const titleElement = isConstSchema2(schema.oneOf[0]) ? /* @__PURE__ */ (0,
|
|
16583
|
+
const helpElement = schema.help ? /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Help_default2, { help: schema.help }) : null;
|
|
16584
|
+
const titleElement = isConstSchema2(schema.oneOf[0]) ? /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { className: "m-b-1", children: /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("label", { className: "control-label d-inline", htmlFor: forId, children: [
|
|
16672
16585
|
schema.title,
|
|
16673
16586
|
" ",
|
|
16674
16587
|
helpElement
|
|
16675
|
-
] }) }) : /* @__PURE__ */ (0,
|
|
16588
|
+
] }) }) : /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_jsx_runtime91.Fragment, { children: helpElement ? /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("h4", { className: "m-b-2", children: [
|
|
16676
16589
|
schema.title,
|
|
16677
16590
|
" ",
|
|
16678
16591
|
helpElement
|
|
16679
|
-
] }) : /* @__PURE__ */ (0,
|
|
16592
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_components55.Header, { title: (_a = schema.title) != null ? _a : "" }) });
|
|
16680
16593
|
return schema.title ? titleElement : helpElement;
|
|
16681
16594
|
}
|
|
16682
16595
|
function getValidations(props, schemaIndex) {
|
|
@@ -16712,13 +16625,13 @@ OneOfSchema.defaultProps = {
|
|
|
16712
16625
|
var OneOfSchema_default = OneOfSchema;
|
|
16713
16626
|
|
|
16714
16627
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.tsx
|
|
16715
|
-
var
|
|
16716
|
-
var
|
|
16628
|
+
var import_classnames12 = __toESM(require_classnames());
|
|
16629
|
+
var import_react42 = require("react");
|
|
16717
16630
|
|
|
16718
16631
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.tsx
|
|
16719
16632
|
var import_components56 = require("@transferwise/components");
|
|
16720
|
-
var
|
|
16721
|
-
var
|
|
16633
|
+
var import_react41 = require("react");
|
|
16634
|
+
var import_jsx_runtime92 = require("react/jsx-runtime");
|
|
16722
16635
|
function UploadInputAdapter(props) {
|
|
16723
16636
|
const {
|
|
16724
16637
|
id,
|
|
@@ -16734,7 +16647,7 @@ function UploadInputAdapter(props) {
|
|
|
16734
16647
|
onCancel
|
|
16735
16648
|
} = props;
|
|
16736
16649
|
const onEvent = useEventDispatcher();
|
|
16737
|
-
const files = (0,
|
|
16650
|
+
const files = (0, import_react41.useMemo)(() => fileId ? [{ id: fileId, status: import_components56.Status.SUCCEEDED }] : [], [fileId]);
|
|
16738
16651
|
const uploadFile = (formData) => {
|
|
16739
16652
|
onEvent("Dynamic Flow - PersistAsync", { status: "pending", schemaId: id });
|
|
16740
16653
|
return httpClient(String(httpOptions.url), {
|
|
@@ -16751,7 +16664,7 @@ function UploadInputAdapter(props) {
|
|
|
16751
16664
|
return Promise.reject();
|
|
16752
16665
|
});
|
|
16753
16666
|
};
|
|
16754
|
-
return /* @__PURE__ */ (0,
|
|
16667
|
+
return /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
|
|
16755
16668
|
import_components56.UploadInput,
|
|
16756
16669
|
{
|
|
16757
16670
|
id,
|
|
@@ -16771,16 +16684,16 @@ function UploadInputAdapter(props) {
|
|
|
16771
16684
|
}
|
|
16772
16685
|
|
|
16773
16686
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.tsx
|
|
16774
|
-
var
|
|
16687
|
+
var import_jsx_runtime93 = require("react/jsx-runtime");
|
|
16775
16688
|
function PersistAsyncBlobSchema(props) {
|
|
16776
16689
|
const { model, schema, submitted, required, errors, onChange } = props;
|
|
16777
|
-
const [persistAsyncValidationMessages, setPersistAsyncValidationMessages] = (0,
|
|
16778
|
-
const [persistAsyncValidations, setPersistAsyncValidations] = (0,
|
|
16779
|
-
const [validations, setValidations] = (0,
|
|
16780
|
-
const [changed, setChanged] = (0,
|
|
16690
|
+
const [persistAsyncValidationMessages, setPersistAsyncValidationMessages] = (0, import_react42.useState)({});
|
|
16691
|
+
const [persistAsyncValidations, setPersistAsyncValidations] = (0, import_react42.useState)(null);
|
|
16692
|
+
const [validations, setValidations] = (0, import_react42.useState)([]);
|
|
16693
|
+
const [changed, setChanged] = (0, import_react42.useState)(false);
|
|
16781
16694
|
const httpClient = useHttpClient();
|
|
16782
16695
|
const onEvent = useEventDispatcher();
|
|
16783
|
-
(0,
|
|
16696
|
+
(0, import_react42.useEffect)(() => {
|
|
16784
16697
|
if (submitted) {
|
|
16785
16698
|
setValidations(getValidationFailures(model, schema, Boolean(required)));
|
|
16786
16699
|
} else {
|
|
@@ -16817,8 +16730,8 @@ function PersistAsyncBlobSchema(props) {
|
|
|
16817
16730
|
};
|
|
16818
16731
|
const id = schema.$id || schema.persistAsync.schema.$id || schema.persistAsync.idProperty;
|
|
16819
16732
|
const feedbackId = `${id}-feedback`;
|
|
16820
|
-
return /* @__PURE__ */ (0,
|
|
16821
|
-
/* @__PURE__ */ (0,
|
|
16733
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: (0, import_classnames12.default)(formGroupClasses), children: [
|
|
16734
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { "aria-describedby": feedbackId, children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
16822
16735
|
UploadInputAdapter,
|
|
16823
16736
|
__spreadValues({
|
|
16824
16737
|
id,
|
|
@@ -16835,7 +16748,7 @@ function PersistAsyncBlobSchema(props) {
|
|
|
16835
16748
|
onCancel
|
|
16836
16749
|
}, mapSchemaToUploadOptions(schema.persistAsync.schema))
|
|
16837
16750
|
) }),
|
|
16838
|
-
/* @__PURE__ */ (0,
|
|
16751
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
16839
16752
|
ControlFeedback_default,
|
|
16840
16753
|
{
|
|
16841
16754
|
id: feedbackId,
|
|
@@ -16860,17 +16773,17 @@ PersistAsyncBlobSchema.defaultProps = {
|
|
|
16860
16773
|
var PersistAsyncBlobSchema_default = PersistAsyncBlobSchema;
|
|
16861
16774
|
|
|
16862
16775
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.tsx
|
|
16863
|
-
var
|
|
16776
|
+
var import_jsx_runtime94 = require("react/jsx-runtime");
|
|
16864
16777
|
function PersistAsyncSchema(props) {
|
|
16865
16778
|
const { schema } = props;
|
|
16866
16779
|
const persistAsyncSchemaType = schema.persistAsync.schema.type;
|
|
16867
16780
|
if (persistAsyncSchemaType === "blob") {
|
|
16868
|
-
return /* @__PURE__ */ (0,
|
|
16781
|
+
return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
16869
16782
|
PersistAsyncBlobSchema_default,
|
|
16870
16783
|
__spreadValues({}, props)
|
|
16871
16784
|
);
|
|
16872
16785
|
}
|
|
16873
|
-
return /* @__PURE__ */ (0,
|
|
16786
|
+
return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(PersistAsyncBasicSchema_default, __spreadValues({}, props));
|
|
16874
16787
|
}
|
|
16875
16788
|
PersistAsyncSchema.defaultProps = {
|
|
16876
16789
|
required: false
|
|
@@ -16878,7 +16791,7 @@ PersistAsyncSchema.defaultProps = {
|
|
|
16878
16791
|
var PersistAsyncSchema_default = PersistAsyncSchema;
|
|
16879
16792
|
|
|
16880
16793
|
// src/legacy/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.tsx
|
|
16881
|
-
var
|
|
16794
|
+
var import_react43 = require("react");
|
|
16882
16795
|
|
|
16883
16796
|
// src/legacy/jsonSchemaForm/promotedOneOfSchema/promoted-one-of-utils.ts
|
|
16884
16797
|
var getSelectionFromModel = (schema, model) => {
|
|
@@ -16891,7 +16804,7 @@ var getSelectionFromModel = (schema, model) => {
|
|
|
16891
16804
|
|
|
16892
16805
|
// src/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.tsx
|
|
16893
16806
|
var import_components57 = require("@transferwise/components");
|
|
16894
|
-
var
|
|
16807
|
+
var import_jsx_runtime95 = require("react/jsx-runtime");
|
|
16895
16808
|
var PromotedOneOfCheckboxControl = (props) => {
|
|
16896
16809
|
const { id, selection, setSelection } = props;
|
|
16897
16810
|
const { promoted, other, checkedMeans } = props.promotion;
|
|
@@ -16902,14 +16815,14 @@ var PromotedOneOfCheckboxControl = (props) => {
|
|
|
16902
16815
|
const toggleSelection = () => {
|
|
16903
16816
|
setSelection(checked ? selectionWhenUnchecked : selectionWhenChecked);
|
|
16904
16817
|
};
|
|
16905
|
-
return /* @__PURE__ */ (0,
|
|
16818
|
+
return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { className: "form-group", children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_components57.Checkbox, { id, label: title, checked, onChange: toggleSelection }) });
|
|
16906
16819
|
};
|
|
16907
16820
|
PromotedOneOfCheckboxControl.defaultProps = {};
|
|
16908
16821
|
var PromotedOneOfCheckboxControl_default = PromotedOneOfCheckboxControl;
|
|
16909
16822
|
|
|
16910
16823
|
// src/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.tsx
|
|
16911
16824
|
var import_components58 = require("@transferwise/components");
|
|
16912
|
-
var
|
|
16825
|
+
var import_jsx_runtime96 = require("react/jsx-runtime");
|
|
16913
16826
|
function PromotedOneOfRadioControl(props) {
|
|
16914
16827
|
var _a, _b;
|
|
16915
16828
|
const { id, selection, setSelection, promotion, promotedOneOf, title } = props;
|
|
@@ -16926,9 +16839,9 @@ function PromotedOneOfRadioControl(props) {
|
|
|
16926
16839
|
secondary: promotion.other.description
|
|
16927
16840
|
}, getAvatarPropertyForRadioOption(promotion.other))
|
|
16928
16841
|
];
|
|
16929
|
-
return /* @__PURE__ */ (0,
|
|
16930
|
-
title && /* @__PURE__ */ (0,
|
|
16931
|
-
/* @__PURE__ */ (0,
|
|
16842
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)("div", { className: "form-group", children: [
|
|
16843
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("label", { className: "control-label", htmlFor: id, children: title }),
|
|
16844
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
16932
16845
|
import_components58.RadioGroup,
|
|
16933
16846
|
{
|
|
16934
16847
|
name: "promoted-selection",
|
|
@@ -16946,16 +16859,16 @@ PromotedOneOfRadioControl.defaultProps = {
|
|
|
16946
16859
|
var PromotedOneOfRadioControl_default = PromotedOneOfRadioControl;
|
|
16947
16860
|
|
|
16948
16861
|
// src/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfControl.tsx
|
|
16949
|
-
var
|
|
16862
|
+
var import_jsx_runtime97 = require("react/jsx-runtime");
|
|
16950
16863
|
function PromotedOneOfControl(props) {
|
|
16951
16864
|
const controlType = props.promotion.control || "radio";
|
|
16952
16865
|
switch (controlType) {
|
|
16953
16866
|
case "radio":
|
|
16954
|
-
return /* @__PURE__ */ (0,
|
|
16867
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(PromotedOneOfRadioControl_default, __spreadValues({}, props));
|
|
16955
16868
|
case "checkbox":
|
|
16956
|
-
return /* @__PURE__ */ (0,
|
|
16869
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(PromotedOneOfCheckboxControl_default, __spreadValues({}, props));
|
|
16957
16870
|
default:
|
|
16958
|
-
return /* @__PURE__ */ (0,
|
|
16871
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_jsx_runtime97.Fragment, {});
|
|
16959
16872
|
}
|
|
16960
16873
|
}
|
|
16961
16874
|
PromotedOneOfControl.defaultProps = {
|
|
@@ -16965,20 +16878,20 @@ PromotedOneOfControl.defaultProps = {
|
|
|
16965
16878
|
var PromotedOneOfControl_default = PromotedOneOfControl;
|
|
16966
16879
|
|
|
16967
16880
|
// src/legacy/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.tsx
|
|
16968
|
-
var
|
|
16881
|
+
var import_jsx_runtime98 = require("react/jsx-runtime");
|
|
16969
16882
|
var isPromoted = (schema) => schema.promoted === true;
|
|
16970
16883
|
var PromotedOneOfSchema = (props) => {
|
|
16971
16884
|
var _a;
|
|
16972
|
-
const [selection, setSelection] = (0,
|
|
16885
|
+
const [selection, setSelection] = (0, import_react43.useState)(
|
|
16973
16886
|
getSelectionFromModel(props.schema, props.model) || ((_a = props.schema.promotion) == null ? void 0 : _a.default) || "promoted"
|
|
16974
16887
|
);
|
|
16975
16888
|
const promotedAlert = props.schema.alert;
|
|
16976
16889
|
const promotedOneOf = props.schema.oneOf.find(isPromoted);
|
|
16977
16890
|
const promotedObjectSchema = getPromotedObjectSchema(promotedOneOf);
|
|
16978
16891
|
const otherOneOf = getOtherOneOf(props.schema);
|
|
16979
|
-
return /* @__PURE__ */ (0,
|
|
16980
|
-
promotedAlert && /* @__PURE__ */ (0,
|
|
16981
|
-
/* @__PURE__ */ (0,
|
|
16892
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(import_jsx_runtime98.Fragment, { children: [
|
|
16893
|
+
promotedAlert && /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(DynamicAlert_default, { component: promotedAlert }),
|
|
16894
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
16982
16895
|
PromotedOneOfControl_default,
|
|
16983
16896
|
{
|
|
16984
16897
|
id: props.schema.$id,
|
|
@@ -16989,8 +16902,8 @@ var PromotedOneOfSchema = (props) => {
|
|
|
16989
16902
|
setSelection
|
|
16990
16903
|
}
|
|
16991
16904
|
),
|
|
16992
|
-
selection === "promoted" && /* @__PURE__ */ (0,
|
|
16993
|
-
selection === "other" && /* @__PURE__ */ (0,
|
|
16905
|
+
selection === "promoted" && /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(ObjectSchema_default, __spreadProps(__spreadValues({}, props), { schema: promotedObjectSchema })),
|
|
16906
|
+
selection === "other" && /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(GenericSchema_default, __spreadProps(__spreadValues({}, props), { schema: otherOneOf }))
|
|
16994
16907
|
] });
|
|
16995
16908
|
};
|
|
16996
16909
|
function getPromotedObjectSchema(promotedSchema) {
|
|
@@ -17039,12 +16952,12 @@ var ReadOnlySchema_messages_default = (0, import_react_intl31.defineMessages)({
|
|
|
17039
16952
|
});
|
|
17040
16953
|
|
|
17041
16954
|
// src/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.tsx
|
|
17042
|
-
var
|
|
16955
|
+
var import_jsx_runtime99 = require("react/jsx-runtime");
|
|
17043
16956
|
function ReadOnlySchema({ schema, model }) {
|
|
17044
16957
|
const { title = "" } = schema;
|
|
17045
16958
|
const { formatMessage } = (0, import_react_intl32.useIntl)();
|
|
17046
16959
|
const value = getValueForSchema({ schema, model, formatMessage });
|
|
17047
|
-
return /* @__PURE__ */ (0,
|
|
16960
|
+
return /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(import_components59.DefinitionList, { layout: import_components59.Layout.VERTICAL_ONE_COLUMN, definitions: [{ title, value, key: "" }] });
|
|
17048
16961
|
}
|
|
17049
16962
|
var ReadOnlySchema_default = ReadOnlySchema;
|
|
17050
16963
|
function getValueForSchema({
|
|
@@ -17077,7 +16990,7 @@ function getSelectedOneOf(schema, model) {
|
|
|
17077
16990
|
function getValueFromOption(option) {
|
|
17078
16991
|
const text = option.title && option.description ? `${option.title} - ${option.description}` : option.title || "";
|
|
17079
16992
|
const icon = getAvatarPropertyForRadioOption({ icon: option.icon });
|
|
17080
|
-
return (icon == null ? void 0 : icon.avatar) ? /* @__PURE__ */ (0,
|
|
16993
|
+
return (icon == null ? void 0 : icon.avatar) ? /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)(import_jsx_runtime99.Fragment, { children: [
|
|
17081
16994
|
icon.avatar,
|
|
17082
16995
|
" ",
|
|
17083
16996
|
text
|
|
@@ -17085,22 +16998,22 @@ function getValueFromOption(option) {
|
|
|
17085
16998
|
}
|
|
17086
16999
|
|
|
17087
17000
|
// src/legacy/jsonSchemaForm/validationAsyncSchema/ValidationAsyncSchema.tsx
|
|
17088
|
-
var
|
|
17089
|
-
var
|
|
17001
|
+
var import_react44 = require("react");
|
|
17002
|
+
var import_jsx_runtime100 = require("react/jsx-runtime");
|
|
17090
17003
|
function ValidationAsyncSchema(props) {
|
|
17091
17004
|
const { schema, model, required, submitted, errors, onChange } = props;
|
|
17092
|
-
const [validationAsyncModel, setValidationAsyncModel] = (0,
|
|
17093
|
-
const previousRequestedModelReference = (0,
|
|
17094
|
-
const [validationAsyncSuccessMessage, setValidationAsyncSuccessMessage] = (0,
|
|
17005
|
+
const [validationAsyncModel, setValidationAsyncModel] = (0, import_react44.useState)(model);
|
|
17006
|
+
const previousRequestedModelReference = (0, import_react44.useRef)(null);
|
|
17007
|
+
const [validationAsyncSuccessMessage, setValidationAsyncSuccessMessage] = (0, import_react44.useState)(
|
|
17095
17008
|
null
|
|
17096
17009
|
);
|
|
17097
|
-
const [validationAsyncErrors, setValidationAsyncErrors] = (0,
|
|
17098
|
-
const [fieldSubmitted, setFieldSubmitted] = (0,
|
|
17099
|
-
const [abortController, setAbortController] = (0,
|
|
17010
|
+
const [validationAsyncErrors, setValidationAsyncErrors] = (0, import_react44.useState)(null);
|
|
17011
|
+
const [fieldSubmitted, setFieldSubmitted] = (0, import_react44.useState)(false);
|
|
17012
|
+
const [abortController, setAbortController] = (0, import_react44.useState)(null);
|
|
17100
17013
|
const httpClient = useHttpClient();
|
|
17101
17014
|
const onEvent = useEventDispatcher();
|
|
17102
17015
|
const log = useLogger();
|
|
17103
|
-
(0,
|
|
17016
|
+
(0, import_react44.useEffect)(() => {
|
|
17104
17017
|
if (!schema.validationAsync.method) {
|
|
17105
17018
|
log.warning(
|
|
17106
17019
|
"Invalid schema or model",
|
|
@@ -17170,20 +17083,20 @@ function ValidationAsyncSchema(props) {
|
|
|
17170
17083
|
required,
|
|
17171
17084
|
schema
|
|
17172
17085
|
};
|
|
17173
|
-
return /* @__PURE__ */ (0,
|
|
17086
|
+
return /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(BasicTypeSchema_default, __spreadValues({}, basicTypeSchemaProps));
|
|
17174
17087
|
}
|
|
17175
17088
|
ValidationAsyncSchema.defaultProps = { required: false };
|
|
17176
17089
|
var ValidationAsyncSchema_default = ValidationAsyncSchema;
|
|
17177
17090
|
|
|
17178
17091
|
// src/legacy/jsonSchemaForm/genericSchema/GenericSchema.tsx
|
|
17179
|
-
var
|
|
17180
|
-
var
|
|
17092
|
+
var import_jsx_runtime101 = require("react/jsx-runtime");
|
|
17093
|
+
var import_react46 = require("react");
|
|
17181
17094
|
function GenericSchemaForm(props) {
|
|
17182
17095
|
const { schema, model = null, errors = null, hideTitle = false, disabled = false } = props;
|
|
17183
17096
|
const schemaProps = __spreadProps(__spreadValues({}, props), { model, errors, hideTitle, disabled });
|
|
17184
17097
|
const type = getSchemaType(schema);
|
|
17185
17098
|
const log = useLogger();
|
|
17186
|
-
(0,
|
|
17099
|
+
(0, import_react45.useEffect)(() => {
|
|
17187
17100
|
if (!isValidGenericSchema(schema, model, errors)) {
|
|
17188
17101
|
log.error(
|
|
17189
17102
|
"Invalid schema or model",
|
|
@@ -17193,29 +17106,29 @@ function GenericSchemaForm(props) {
|
|
|
17193
17106
|
}, [JSON.stringify(schema), JSON.stringify(model), JSON.stringify(errors), type, log]);
|
|
17194
17107
|
switch (type) {
|
|
17195
17108
|
case "readOnly":
|
|
17196
|
-
return /* @__PURE__ */ (0,
|
|
17109
|
+
return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(ReadOnlySchema_default, __spreadValues({}, schemaProps));
|
|
17197
17110
|
case "persistAsync":
|
|
17198
|
-
return /* @__PURE__ */ (0,
|
|
17111
|
+
return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(PersistAsyncSchema_default, __spreadValues({}, schemaProps));
|
|
17199
17112
|
case "validationAsync":
|
|
17200
|
-
return /* @__PURE__ */ (0,
|
|
17113
|
+
return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(ValidationAsyncSchema_default, __spreadValues({}, schemaProps));
|
|
17201
17114
|
case "basic": {
|
|
17202
17115
|
const basicTypeProps = __spreadValues({
|
|
17203
17116
|
infoMessage: null
|
|
17204
17117
|
}, schemaProps);
|
|
17205
|
-
return /* @__PURE__ */ (0,
|
|
17118
|
+
return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(BasicTypeSchema_default, __spreadValues({}, basicTypeProps));
|
|
17206
17119
|
}
|
|
17207
17120
|
case "object":
|
|
17208
|
-
return /* @__PURE__ */ (0,
|
|
17121
|
+
return /* @__PURE__ */ (0, import_react46.createElement)(ObjectSchema_default, __spreadProps(__spreadValues({}, schemaProps), { key: JSON.stringify(schema) }));
|
|
17209
17122
|
case "array":
|
|
17210
|
-
return /* @__PURE__ */ (0,
|
|
17123
|
+
return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(ArraySchema_default, __spreadValues({}, schemaProps));
|
|
17211
17124
|
case "promotedOneOf":
|
|
17212
|
-
return /* @__PURE__ */ (0,
|
|
17125
|
+
return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(PromotedOneOfSchema_default, __spreadValues({}, schemaProps));
|
|
17213
17126
|
case "oneOf":
|
|
17214
|
-
return /* @__PURE__ */ (0,
|
|
17127
|
+
return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(OneOfSchema_default, __spreadValues({}, schemaProps));
|
|
17215
17128
|
case "allOf":
|
|
17216
|
-
return /* @__PURE__ */ (0,
|
|
17129
|
+
return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(AllOfSchema_default, __spreadValues({}, schemaProps));
|
|
17217
17130
|
}
|
|
17218
|
-
return /* @__PURE__ */ (0,
|
|
17131
|
+
return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(import_jsx_runtime101.Fragment, {});
|
|
17219
17132
|
}
|
|
17220
17133
|
var GenericSchema_default = GenericSchemaForm;
|
|
17221
17134
|
var isValidGenericSchema = (schema, model, errors) => {
|
|
@@ -17242,7 +17155,7 @@ var isValidGenericSchema = (schema, model, errors) => {
|
|
|
17242
17155
|
};
|
|
17243
17156
|
|
|
17244
17157
|
// src/legacy/layout/form/DynamicForm.tsx
|
|
17245
|
-
var
|
|
17158
|
+
var import_jsx_runtime102 = require("react/jsx-runtime");
|
|
17246
17159
|
function DynamicForm({
|
|
17247
17160
|
component,
|
|
17248
17161
|
model = null,
|
|
@@ -17252,7 +17165,7 @@ function DynamicForm({
|
|
|
17252
17165
|
onPersistAsync
|
|
17253
17166
|
}) {
|
|
17254
17167
|
const formSchema = component.schema;
|
|
17255
|
-
return /* @__PURE__ */ (0,
|
|
17168
|
+
return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("div", { className: getMargin2(component.margin || "md"), children: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
|
|
17256
17169
|
GenericSchema_default,
|
|
17257
17170
|
{
|
|
17258
17171
|
schema: formSchema,
|
|
@@ -17270,63 +17183,63 @@ var DynamicForm_default = DynamicForm;
|
|
|
17270
17183
|
|
|
17271
17184
|
// src/legacy/layout/heading/DynamicHeading.tsx
|
|
17272
17185
|
var import_components60 = require("@transferwise/components");
|
|
17273
|
-
var
|
|
17274
|
-
var
|
|
17186
|
+
var import_classnames13 = __toESM(require_classnames());
|
|
17187
|
+
var import_jsx_runtime103 = require("react/jsx-runtime");
|
|
17275
17188
|
var DynamicHeading = (props) => {
|
|
17276
17189
|
const { text, size = "md", align = "left", margin = "md", control } = props.component;
|
|
17277
|
-
const classes = (0,
|
|
17278
|
-
return control === "display" ? /* @__PURE__ */ (0,
|
|
17190
|
+
const classes = (0, import_classnames13.default)(getTextAlignmentAndMargin2({ align, margin }));
|
|
17191
|
+
return control === "display" ? /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(DisplayHeading2, { size, text, classes }) : /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(StandardHeading2, { size, text, classes });
|
|
17279
17192
|
};
|
|
17280
17193
|
var StandardHeading2 = ({ size, text, classes }) => {
|
|
17281
17194
|
switch (size) {
|
|
17282
17195
|
case "xs":
|
|
17283
|
-
return /* @__PURE__ */ (0,
|
|
17196
|
+
return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)("h5", { className: classes, children: text });
|
|
17284
17197
|
case "sm":
|
|
17285
|
-
return /* @__PURE__ */ (0,
|
|
17198
|
+
return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)("h4", { className: classes, children: text });
|
|
17286
17199
|
case "lg":
|
|
17287
|
-
return /* @__PURE__ */ (0,
|
|
17200
|
+
return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)("h2", { className: classes, children: text });
|
|
17288
17201
|
case "xl":
|
|
17289
|
-
return /* @__PURE__ */ (0,
|
|
17202
|
+
return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)("h1", { className: classes, children: text });
|
|
17290
17203
|
case "md":
|
|
17291
17204
|
default:
|
|
17292
|
-
return /* @__PURE__ */ (0,
|
|
17205
|
+
return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)("h3", { className: classes, children: text });
|
|
17293
17206
|
}
|
|
17294
17207
|
};
|
|
17295
17208
|
var DisplayHeading2 = ({ size, text, classes }) => {
|
|
17296
17209
|
switch (size) {
|
|
17297
17210
|
case "xs":
|
|
17298
17211
|
case "sm":
|
|
17299
|
-
return /* @__PURE__ */ (0,
|
|
17212
|
+
return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(import_components60.Display, { type: "display-small", className: classes, children: text });
|
|
17300
17213
|
case "xl":
|
|
17301
17214
|
case "lg":
|
|
17302
|
-
return /* @__PURE__ */ (0,
|
|
17215
|
+
return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(import_components60.Display, { type: "display-large", className: classes, children: text });
|
|
17303
17216
|
case "md":
|
|
17304
17217
|
default:
|
|
17305
|
-
return /* @__PURE__ */ (0,
|
|
17218
|
+
return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(import_components60.Display, { type: "display-medium", className: classes, children: text });
|
|
17306
17219
|
}
|
|
17307
17220
|
};
|
|
17308
17221
|
var DynamicHeading_default = DynamicHeading;
|
|
17309
17222
|
|
|
17310
17223
|
// src/legacy/layout/markdown/DynamicMarkdown.tsx
|
|
17311
17224
|
var import_components61 = require("@transferwise/components");
|
|
17312
|
-
var
|
|
17225
|
+
var import_jsx_runtime104 = require("react/jsx-runtime");
|
|
17313
17226
|
var DynamicMarkdown = ({ component }) => {
|
|
17314
17227
|
const { content, align, margin } = component;
|
|
17315
|
-
return /* @__PURE__ */ (0,
|
|
17228
|
+
return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("div", { className: getTextAlignmentAndMargin2({ align, margin }), children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_components61.Markdown, { config: { link: { target: "_blank" } }, children: content }) });
|
|
17316
17229
|
};
|
|
17317
17230
|
var DynamicInfo = ({ component }) => {
|
|
17318
|
-
return /* @__PURE__ */ (0,
|
|
17231
|
+
return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("div", { className: getTextAlignmentAndMargin2(component), children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_components61.Markdown, { config: { link: { target: "_blank" } }, children: component.markdown }) });
|
|
17319
17232
|
};
|
|
17320
17233
|
|
|
17321
17234
|
// src/legacy/layout/image/DynamicImage.tsx
|
|
17322
17235
|
var import_components62 = require("@transferwise/components");
|
|
17323
|
-
var
|
|
17324
|
-
var
|
|
17236
|
+
var import_react47 = require("react");
|
|
17237
|
+
var import_jsx_runtime105 = require("react/jsx-runtime");
|
|
17325
17238
|
function DynamicImage({ component: image }) {
|
|
17326
17239
|
const { url, size, text, margin, accessibilityDescription } = image;
|
|
17327
17240
|
const httpClient = useHttpClient();
|
|
17328
|
-
const [imageSource, setImageSource] = (0,
|
|
17329
|
-
(0,
|
|
17241
|
+
const [imageSource, setImageSource] = (0, import_react47.useState)("");
|
|
17242
|
+
(0, import_react47.useEffect)(() => {
|
|
17330
17243
|
void getImageSource2(httpClient, url).then(setImageSource);
|
|
17331
17244
|
}, [url, httpClient]);
|
|
17332
17245
|
const imageProps = {
|
|
@@ -17338,7 +17251,7 @@ function DynamicImage({ component: image }) {
|
|
|
17338
17251
|
if (!imageSource) {
|
|
17339
17252
|
return null;
|
|
17340
17253
|
}
|
|
17341
|
-
return /* @__PURE__ */ (0,
|
|
17254
|
+
return /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: `df-image ${size || "md"}`, children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_components62.Image, __spreadValues({ className: `img-responsive ${getMargin2(margin || "md")}` }, imageProps)) });
|
|
17342
17255
|
}
|
|
17343
17256
|
var readImageBlobAsDataURL2 = (imageBlob) => (
|
|
17344
17257
|
// we can safely assume the type of reader.result is string
|
|
@@ -17375,47 +17288,47 @@ var DynamicImage_default = DynamicImage;
|
|
|
17375
17288
|
|
|
17376
17289
|
// src/legacy/layout/instructions/DynamicInstructions.tsx
|
|
17377
17290
|
var import_components63 = require("@transferwise/components");
|
|
17378
|
-
var
|
|
17291
|
+
var import_jsx_runtime106 = require("react/jsx-runtime");
|
|
17379
17292
|
var doContext2 = ["positive", "neutral"];
|
|
17380
17293
|
var dontContext2 = ["warning", "negative"];
|
|
17381
17294
|
var DynamicInstructions = ({ component }) => {
|
|
17382
17295
|
const { items } = component;
|
|
17383
17296
|
const dos = items.filter((item) => doContext2.includes(item.context)).map(({ text }) => text);
|
|
17384
17297
|
const donts = items.filter((item) => dontContext2.includes(item.context)).map(({ text }) => text);
|
|
17385
|
-
return /* @__PURE__ */ (0,
|
|
17386
|
-
component.title ? /* @__PURE__ */ (0,
|
|
17387
|
-
/* @__PURE__ */ (0,
|
|
17298
|
+
return /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)("div", { className: getMargin2(component.margin || "md"), children: [
|
|
17299
|
+
component.title ? /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(import_components63.Header, { title: component.title }) : null,
|
|
17300
|
+
/* @__PURE__ */ (0, import_jsx_runtime106.jsx)(import_components63.InstructionsList, { dos, donts })
|
|
17388
17301
|
] });
|
|
17389
17302
|
};
|
|
17390
17303
|
var DynamicInstructions_default = DynamicInstructions;
|
|
17391
17304
|
|
|
17392
17305
|
// src/legacy/layout/DynamicLayout.tsx
|
|
17393
|
-
var
|
|
17306
|
+
var import_jsx_runtime107 = require("react/jsx-runtime");
|
|
17394
17307
|
var getKey = (component) => JSON.stringify(component);
|
|
17395
17308
|
function DynamicLayout(props) {
|
|
17396
17309
|
const { components, model, submitted, errors, onModelChange, onAction, onPersistAsync, baseUrl } = props;
|
|
17397
17310
|
const renderComponent = (component) => {
|
|
17398
17311
|
switch (component.type) {
|
|
17399
17312
|
case "heading":
|
|
17400
|
-
return /* @__PURE__ */ (0,
|
|
17313
|
+
return /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(DynamicHeading_default, { component }, getKey(component));
|
|
17401
17314
|
case "paragraph":
|
|
17402
|
-
return /* @__PURE__ */ (0,
|
|
17315
|
+
return /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(DynamicParagraph_default, { component }, getKey(component));
|
|
17403
17316
|
case "image":
|
|
17404
|
-
return /* @__PURE__ */ (0,
|
|
17317
|
+
return /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(DynamicImage_default, { component }, getKey(component));
|
|
17405
17318
|
case "alert":
|
|
17406
|
-
return /* @__PURE__ */ (0,
|
|
17319
|
+
return /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(DynamicAlert_default, { component }, getKey(component));
|
|
17407
17320
|
case "review":
|
|
17408
|
-
return /* @__PURE__ */ (0,
|
|
17321
|
+
return /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(DynamicReview_default, { component, onAction }, getKey(component));
|
|
17409
17322
|
case "divider":
|
|
17410
|
-
return /* @__PURE__ */ (0,
|
|
17323
|
+
return /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(DynamicDivider_default, { component }, getKey(component));
|
|
17411
17324
|
case "info":
|
|
17412
|
-
return /* @__PURE__ */ (0,
|
|
17325
|
+
return /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(DynamicInfo, { component }, getKey(component));
|
|
17413
17326
|
case "instructions":
|
|
17414
|
-
return /* @__PURE__ */ (0,
|
|
17327
|
+
return /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(DynamicInstructions_default, { component }, getKey(component));
|
|
17415
17328
|
case "markdown":
|
|
17416
|
-
return /* @__PURE__ */ (0,
|
|
17329
|
+
return /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(DynamicMarkdown, { component }, getKey(component));
|
|
17417
17330
|
case "columns":
|
|
17418
|
-
return /* @__PURE__ */ (0,
|
|
17331
|
+
return /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
|
|
17419
17332
|
DynamicColumns_default,
|
|
17420
17333
|
{
|
|
17421
17334
|
component,
|
|
@@ -17429,7 +17342,7 @@ function DynamicLayout(props) {
|
|
|
17429
17342
|
getKey(component)
|
|
17430
17343
|
);
|
|
17431
17344
|
case "form":
|
|
17432
|
-
return /* @__PURE__ */ (0,
|
|
17345
|
+
return /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
|
|
17433
17346
|
DynamicForm_default,
|
|
17434
17347
|
{
|
|
17435
17348
|
component,
|
|
@@ -17442,9 +17355,9 @@ function DynamicLayout(props) {
|
|
|
17442
17355
|
getKey(__spreadProps(__spreadValues({}, component), { errors: errors != null ? errors : null }))
|
|
17443
17356
|
);
|
|
17444
17357
|
case "button":
|
|
17445
|
-
return /* @__PURE__ */ (0,
|
|
17358
|
+
return /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(DynamicButton_default, { component, onAction }, getKey(component));
|
|
17446
17359
|
case "box":
|
|
17447
|
-
return /* @__PURE__ */ (0,
|
|
17360
|
+
return /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
|
|
17448
17361
|
DynamicBox_default,
|
|
17449
17362
|
{
|
|
17450
17363
|
component,
|
|
@@ -17458,18 +17371,18 @@ function DynamicLayout(props) {
|
|
|
17458
17371
|
getKey(component)
|
|
17459
17372
|
);
|
|
17460
17373
|
case "decision":
|
|
17461
|
-
return /* @__PURE__ */ (0,
|
|
17374
|
+
return /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(DynamicDecision_default, { component, onAction }, getKey(component));
|
|
17462
17375
|
case "external":
|
|
17463
|
-
return /* @__PURE__ */ (0,
|
|
17376
|
+
return /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(DynamicExternal_default, { component, onAction }, getKey(component));
|
|
17464
17377
|
case "list":
|
|
17465
17378
|
case "status-list":
|
|
17466
|
-
return /* @__PURE__ */ (0,
|
|
17379
|
+
return /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(DynamicStatusList_default, { component, onAction }, getKey(component));
|
|
17467
17380
|
case "loading-indicator":
|
|
17468
|
-
return /* @__PURE__ */ (0,
|
|
17381
|
+
return /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(DynamicLoadingIndicator_default, { component }, getKey(component));
|
|
17469
17382
|
case "search":
|
|
17470
|
-
return /* @__PURE__ */ (0,
|
|
17383
|
+
return /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(DynamicSearch_default, { component, onAction }, getKey(component));
|
|
17471
17384
|
case "modal":
|
|
17472
|
-
return /* @__PURE__ */ (0,
|
|
17385
|
+
return /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
|
|
17473
17386
|
DynamicModal_default,
|
|
17474
17387
|
{
|
|
17475
17388
|
component,
|
|
@@ -17483,22 +17396,22 @@ function DynamicLayout(props) {
|
|
|
17483
17396
|
getKey(component)
|
|
17484
17397
|
);
|
|
17485
17398
|
default:
|
|
17486
|
-
return /* @__PURE__ */ (0,
|
|
17399
|
+
return /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("div", {}, getKey(component));
|
|
17487
17400
|
}
|
|
17488
17401
|
};
|
|
17489
17402
|
if (useHasHttpClientProvider() || baseUrl == null) {
|
|
17490
|
-
return /* @__PURE__ */ (0,
|
|
17403
|
+
return /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_jsx_runtime107.Fragment, { children: components.map(renderComponent) });
|
|
17491
17404
|
}
|
|
17492
|
-
return /* @__PURE__ */ (0,
|
|
17405
|
+
return /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(HttpClientProviderFromBaseUrl, { baseUrl, children: components.map(renderComponent) });
|
|
17493
17406
|
}
|
|
17494
17407
|
var DynamicLayout_default = DynamicLayout;
|
|
17495
17408
|
|
|
17496
17409
|
// src/legacy/layout/list/DynamicStatusList.tsx
|
|
17497
17410
|
var import_components64 = require("@transferwise/components");
|
|
17498
|
-
var
|
|
17411
|
+
var import_jsx_runtime108 = require("react/jsx-runtime");
|
|
17499
17412
|
var DynamicStatusList = ({ component }) => {
|
|
17500
|
-
return /* @__PURE__ */ (0,
|
|
17501
|
-
component.title ? /* @__PURE__ */ (0,
|
|
17413
|
+
return /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("div", { className: getMargin2(component.margin || "md"), children: [
|
|
17414
|
+
component.title ? /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_components64.Header, { title: component.title }) : null,
|
|
17502
17415
|
component.items.map(mapListItemToSummary)
|
|
17503
17416
|
] });
|
|
17504
17417
|
};
|
|
@@ -17507,8 +17420,8 @@ var mapListItemToSummary = ({ title, description, icon, status }) => {
|
|
|
17507
17420
|
key: `${title}/${description || ""}`,
|
|
17508
17421
|
title,
|
|
17509
17422
|
description
|
|
17510
|
-
}, (icon == null ? void 0 : icon.name) ? { icon: /* @__PURE__ */ (0,
|
|
17511
|
-
return /* @__PURE__ */ (0,
|
|
17423
|
+
}, (icon == null ? void 0 : icon.name) ? { icon: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(DynamicIcon_default2, { type: icon.name }) } : {}), status ? { status: statusMap[status] } : {});
|
|
17424
|
+
return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_components64.Summary, __spreadValues({}, props));
|
|
17512
17425
|
};
|
|
17513
17426
|
var statusListMap = {
|
|
17514
17427
|
done: "done",
|
|
@@ -17525,10 +17438,10 @@ var DynamicStatusList_default = DynamicStatusList;
|
|
|
17525
17438
|
|
|
17526
17439
|
// src/legacy/layout/loadingIndicator/DynamicLoadingIndicator.tsx
|
|
17527
17440
|
var import_components65 = require("@transferwise/components");
|
|
17528
|
-
var
|
|
17441
|
+
var import_jsx_runtime109 = require("react/jsx-runtime");
|
|
17529
17442
|
var DynamicLoadingIndicator = ({ component }) => {
|
|
17530
17443
|
const { margin = "md", size = "md" } = component;
|
|
17531
|
-
return /* @__PURE__ */ (0,
|
|
17444
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
17532
17445
|
import_components65.Loader,
|
|
17533
17446
|
{
|
|
17534
17447
|
size,
|
|
@@ -17562,21 +17475,21 @@ var paragraph_messages_default2 = (0, import_react_intl33.defineMessages)({
|
|
|
17562
17475
|
|
|
17563
17476
|
// src/legacy/layout/paragraph/useSnackBarIfAvailable.ts
|
|
17564
17477
|
var import_components66 = require("@transferwise/components");
|
|
17565
|
-
var
|
|
17478
|
+
var import_react48 = require("react");
|
|
17566
17479
|
function useSnackBarIfAvailable2() {
|
|
17567
|
-
const context = (0,
|
|
17480
|
+
const context = (0, import_react48.useContext)(import_components66.SnackbarContext);
|
|
17568
17481
|
return context ? context.createSnackbar : noop3;
|
|
17569
17482
|
}
|
|
17570
17483
|
function noop3() {
|
|
17571
17484
|
}
|
|
17572
17485
|
|
|
17573
17486
|
// src/legacy/layout/paragraph/DynamicParagraph.tsx
|
|
17574
|
-
var
|
|
17487
|
+
var import_jsx_runtime110 = require("react/jsx-runtime");
|
|
17575
17488
|
function DynamicParagraph({ component }) {
|
|
17576
|
-
return component.control === "copyable" ? /* @__PURE__ */ (0,
|
|
17489
|
+
return component.control === "copyable" ? /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(CopyableDynamicParagraph, { component }) : /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(BasicDynamicParagraph, { component });
|
|
17577
17490
|
}
|
|
17578
17491
|
function BasicDynamicParagraph({ component }) {
|
|
17579
|
-
return /* @__PURE__ */ (0,
|
|
17492
|
+
return /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)("p", { className: getTextAlignmentAndMargin2(component), children: [
|
|
17580
17493
|
" ",
|
|
17581
17494
|
component.text,
|
|
17582
17495
|
" "
|
|
@@ -17590,22 +17503,22 @@ function CopyableDynamicParagraph({ component }) {
|
|
|
17590
17503
|
var _a;
|
|
17591
17504
|
(_a = navigator.clipboard) == null ? void 0 : _a.writeText(text).then(() => createSnackbar({ text: formatMessage(paragraph_messages_default2.copied) })).catch(noop4);
|
|
17592
17505
|
};
|
|
17593
|
-
const
|
|
17506
|
+
const classNames16 = `${getTextAlignmentAndMargin2({
|
|
17594
17507
|
align: component.align,
|
|
17595
17508
|
margin: "sm"
|
|
17596
17509
|
})} form-control`;
|
|
17597
|
-
return /* @__PURE__ */ (0,
|
|
17598
|
-
/* @__PURE__ */ (0,
|
|
17510
|
+
return /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)("div", { className: getTextAlignmentAndMargin2(component), children: [
|
|
17511
|
+
/* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
|
|
17599
17512
|
"input",
|
|
17600
17513
|
{
|
|
17601
17514
|
type: "text",
|
|
17602
|
-
className:
|
|
17515
|
+
className: classNames16,
|
|
17603
17516
|
value: text,
|
|
17604
17517
|
readOnly: true,
|
|
17605
17518
|
style: { textOverflow: "ellipsis" }
|
|
17606
17519
|
}
|
|
17607
17520
|
),
|
|
17608
|
-
/* @__PURE__ */ (0,
|
|
17521
|
+
/* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_components67.Button, { block: true, onClick: copy, children: formatMessage(paragraph_messages_default2.copy) })
|
|
17609
17522
|
] });
|
|
17610
17523
|
}
|
|
17611
17524
|
function noop4() {
|
|
@@ -17614,7 +17527,7 @@ var DynamicParagraph_default = DynamicParagraph;
|
|
|
17614
17527
|
|
|
17615
17528
|
// src/legacy/layout/review/DynamicReview.tsx
|
|
17616
17529
|
var import_components68 = require("@transferwise/components");
|
|
17617
|
-
var
|
|
17530
|
+
var import_jsx_runtime111 = require("react/jsx-runtime");
|
|
17618
17531
|
var getDefinitions = (orientation, review) => review.fields.map(({ label, value, help }, index) => ({
|
|
17619
17532
|
key: String(index),
|
|
17620
17533
|
title: label,
|
|
@@ -17622,14 +17535,14 @@ var getDefinitions = (orientation, review) => review.fields.map(({ label, value,
|
|
|
17622
17535
|
}));
|
|
17623
17536
|
var getFieldValue2 = (value, help, orientation) => {
|
|
17624
17537
|
if (help) {
|
|
17625
|
-
return orientation === "HORIZONTAL_RIGHT_ALIGNED" ? /* @__PURE__ */ (0,
|
|
17626
|
-
/* @__PURE__ */ (0,
|
|
17538
|
+
return orientation === "HORIZONTAL_RIGHT_ALIGNED" ? /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(import_jsx_runtime111.Fragment, { children: [
|
|
17539
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)(Help_default2, { help }),
|
|
17627
17540
|
" ",
|
|
17628
17541
|
value
|
|
17629
|
-
] }) : /* @__PURE__ */ (0,
|
|
17542
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(import_jsx_runtime111.Fragment, { children: [
|
|
17630
17543
|
value,
|
|
17631
17544
|
" ",
|
|
17632
|
-
/* @__PURE__ */ (0,
|
|
17545
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)(Help_default2, { help })
|
|
17633
17546
|
] });
|
|
17634
17547
|
}
|
|
17635
17548
|
return value;
|
|
@@ -17666,24 +17579,24 @@ function DynamicReview(props) {
|
|
|
17666
17579
|
const orientation = getDefinitionListLayout(review);
|
|
17667
17580
|
const callToAction = review.callToAction ? getReviewAction2(review.callToAction.title, review.callToAction.action) : null;
|
|
17668
17581
|
const legacyCallToAction = !callToAction && review.action ? getReviewAction2(review.action.title || "", review.action) : null;
|
|
17669
|
-
return /* @__PURE__ */ (0,
|
|
17670
|
-
review.title && /* @__PURE__ */ (0,
|
|
17671
|
-
/* @__PURE__ */ (0,
|
|
17582
|
+
return /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)("div", { className: margin, children: [
|
|
17583
|
+
review.title && /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_components68.Header, { title: review.title, action: callToAction || legacyCallToAction || void 0 }),
|
|
17584
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)("div", { className: margin, children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_components68.DefinitionList, { layout: orientation, definitions: getDefinitions(orientation, review) }) })
|
|
17672
17585
|
] });
|
|
17673
17586
|
}
|
|
17674
17587
|
var DynamicReview_default = DynamicReview;
|
|
17675
17588
|
|
|
17676
17589
|
// src/legacy/layout/search/DynamicSearch.tsx
|
|
17677
|
-
var
|
|
17590
|
+
var import_react50 = require("react");
|
|
17678
17591
|
var import_icons5 = require("@transferwise/icons");
|
|
17679
17592
|
|
|
17680
17593
|
// src/legacy/layout/search/SearchInput.tsx
|
|
17681
17594
|
var import_components69 = require("@transferwise/components");
|
|
17682
|
-
var
|
|
17595
|
+
var import_jsx_runtime112 = require("react/jsx-runtime");
|
|
17683
17596
|
var SearchInput = ({ title, value, onFocus, onChange }) => {
|
|
17684
|
-
return /* @__PURE__ */ (0,
|
|
17597
|
+
return /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)("label", { className: "control-label d-inline", children: [
|
|
17685
17598
|
title,
|
|
17686
|
-
/* @__PURE__ */ (0,
|
|
17599
|
+
/* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
|
|
17687
17600
|
import_components69.Input,
|
|
17688
17601
|
{
|
|
17689
17602
|
type: "text",
|
|
@@ -17699,12 +17612,12 @@ var SearchInput = ({ title, value, onFocus, onChange }) => {
|
|
|
17699
17612
|
// src/legacy/layout/search/SearchResults.tsx
|
|
17700
17613
|
var import_components70 = require("@transferwise/components");
|
|
17701
17614
|
var import_react_intl35 = require("react-intl");
|
|
17702
|
-
var
|
|
17615
|
+
var import_jsx_runtime113 = require("react/jsx-runtime");
|
|
17703
17616
|
function SearchResults2({ results, emptyMessage, onSelect }) {
|
|
17704
17617
|
if (results.length === 0) {
|
|
17705
|
-
return /* @__PURE__ */ (0,
|
|
17618
|
+
return /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("p", { className: "m-t-2", children: emptyMessage });
|
|
17706
17619
|
}
|
|
17707
|
-
return /* @__PURE__ */ (0,
|
|
17620
|
+
return /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_components70.NavigationOptionsList, { children: results.map((result) => /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
17708
17621
|
import_components70.NavigationOption,
|
|
17709
17622
|
{
|
|
17710
17623
|
title: result.title,
|
|
@@ -17719,10 +17632,10 @@ function SearchResults2({ results, emptyMessage, onSelect }) {
|
|
|
17719
17632
|
}
|
|
17720
17633
|
function ErrorResult2({ onRetrySearch }) {
|
|
17721
17634
|
const intl = (0, import_react_intl35.useIntl)();
|
|
17722
|
-
return /* @__PURE__ */ (0,
|
|
17635
|
+
return /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("p", { className: "m-t-2", children: [
|
|
17723
17636
|
intl.formatMessage(generic_error_messages_default.genericError),
|
|
17724
17637
|
"\xA0",
|
|
17725
|
-
/* @__PURE__ */ (0,
|
|
17638
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
17726
17639
|
"a",
|
|
17727
17640
|
{
|
|
17728
17641
|
href: "/",
|
|
@@ -17737,15 +17650,15 @@ function ErrorResult2({ onRetrySearch }) {
|
|
|
17737
17650
|
}
|
|
17738
17651
|
|
|
17739
17652
|
// src/legacy/layout/search/useSearch.tsx
|
|
17740
|
-
var
|
|
17653
|
+
var import_react49 = require("react");
|
|
17741
17654
|
var headers = { "Content-Type": "application/json" };
|
|
17742
17655
|
var useSearch = (defaultSearchConfig) => {
|
|
17743
|
-
const [state, setState] = (0,
|
|
17656
|
+
const [state, setState] = (0, import_react49.useState)({
|
|
17744
17657
|
status: "idle"
|
|
17745
17658
|
});
|
|
17746
|
-
const abortControllerRef = (0,
|
|
17659
|
+
const abortControllerRef = (0, import_react49.useRef)(null);
|
|
17747
17660
|
const httpClient = useHttpClient();
|
|
17748
|
-
const search = (0,
|
|
17661
|
+
const search = (0, import_react49.useCallback)(
|
|
17749
17662
|
async (query, { url, method, param } = defaultSearchConfig) => {
|
|
17750
17663
|
var _a;
|
|
17751
17664
|
(_a = abortControllerRef.current) == null ? void 0 : _a.abort();
|
|
@@ -17807,15 +17720,15 @@ var addQueryParameter2 = (url, key, value) => {
|
|
|
17807
17720
|
|
|
17808
17721
|
// src/legacy/layout/search/DynamicSearch.tsx
|
|
17809
17722
|
var import_components71 = require("@transferwise/components");
|
|
17810
|
-
var
|
|
17811
|
-
var
|
|
17723
|
+
var import_classnames14 = __toESM(require_classnames());
|
|
17724
|
+
var import_jsx_runtime114 = require("react/jsx-runtime");
|
|
17812
17725
|
var DEBOUNCE_TIME2 = 400;
|
|
17813
17726
|
function DynamicSearch({ component, onAction }) {
|
|
17814
|
-
const [query, setQuery] = (0,
|
|
17727
|
+
const [query, setQuery] = (0, import_react50.useState)("");
|
|
17815
17728
|
const { control, title, margin, url, method, param, emptyMessage } = component;
|
|
17816
17729
|
const { status, results, search } = useSearch({ url, method, param });
|
|
17817
17730
|
const onEvent = useEventDispatcher();
|
|
17818
|
-
const debouncedSearch = (0,
|
|
17731
|
+
const debouncedSearch = (0, import_react50.useMemo)(() => debounce2(search, DEBOUNCE_TIME2), [search]);
|
|
17819
17732
|
const onSearchStart = () => {
|
|
17820
17733
|
onEvent("Dynamic Flow - Search Started", {});
|
|
17821
17734
|
};
|
|
@@ -17844,16 +17757,16 @@ function DynamicSearch({ component, onAction }) {
|
|
|
17844
17757
|
void search(query);
|
|
17845
17758
|
};
|
|
17846
17759
|
if (control === "inline") {
|
|
17847
|
-
return /* @__PURE__ */ (0,
|
|
17760
|
+
return /* @__PURE__ */ (0, import_jsx_runtime114.jsx)("div", { className: (0, import_classnames14.default)(getMargin2(margin != null ? margin : "md"), "df-search-typeahead"), children: /* @__PURE__ */ (0, import_jsx_runtime114.jsxs)("label", { className: "control-label d-inline", children: [
|
|
17848
17761
|
title,
|
|
17849
|
-
/* @__PURE__ */ (0,
|
|
17762
|
+
/* @__PURE__ */ (0, import_jsx_runtime114.jsx)("div", { className: "m-t-1", children: /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
|
|
17850
17763
|
import_components71.Typeahead,
|
|
17851
17764
|
{
|
|
17852
17765
|
id: "typeahead-input-id",
|
|
17853
17766
|
name: "typeahead-input-name",
|
|
17854
17767
|
size: "md",
|
|
17855
17768
|
maxHeight: 100,
|
|
17856
|
-
footer: /* @__PURE__ */ (0,
|
|
17769
|
+
footer: /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
|
|
17857
17770
|
TypeaheadFooter2,
|
|
17858
17771
|
{
|
|
17859
17772
|
state: status,
|
|
@@ -17864,7 +17777,7 @@ function DynamicSearch({ component, onAction }) {
|
|
|
17864
17777
|
),
|
|
17865
17778
|
multiple: false,
|
|
17866
17779
|
clearable: false,
|
|
17867
|
-
addon: /* @__PURE__ */ (0,
|
|
17780
|
+
addon: /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_icons5.Search, { size: 24 }),
|
|
17868
17781
|
options: results.map(mapResultToTypeaheadOption2),
|
|
17869
17782
|
onChange: (values) => {
|
|
17870
17783
|
if (values.length > 0) {
|
|
@@ -17879,11 +17792,11 @@ function DynamicSearch({ component, onAction }) {
|
|
|
17879
17792
|
) })
|
|
17880
17793
|
] }) });
|
|
17881
17794
|
}
|
|
17882
|
-
return /* @__PURE__ */ (0,
|
|
17883
|
-
/* @__PURE__ */ (0,
|
|
17884
|
-
status === "loading" && /* @__PURE__ */ (0,
|
|
17885
|
-
status === "error" && /* @__PURE__ */ (0,
|
|
17886
|
-
status === "success" && /* @__PURE__ */ (0,
|
|
17795
|
+
return /* @__PURE__ */ (0, import_jsx_runtime114.jsxs)("div", { className: getMargin2(margin != null ? margin : "md"), children: [
|
|
17796
|
+
/* @__PURE__ */ (0, import_jsx_runtime114.jsx)(SearchInput, { title, value: query, onChange, onFocus: onSearchStart }),
|
|
17797
|
+
status === "loading" && /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(DynamicLoadingIndicator_default, { component: { type: "loading-indicator", size: "sm" } }),
|
|
17798
|
+
status === "error" && /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(ErrorResult2, { onRetrySearch }),
|
|
17799
|
+
status === "success" && /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(SearchResults2, { results, emptyMessage, onSelect: onResultSelected })
|
|
17887
17800
|
] });
|
|
17888
17801
|
}
|
|
17889
17802
|
function mapResultToTypeaheadOption2(result) {
|
|
@@ -17902,13 +17815,13 @@ function TypeaheadFooter2({
|
|
|
17902
17815
|
emptyMessage
|
|
17903
17816
|
}) {
|
|
17904
17817
|
if (state === "success" && results.length === 0) {
|
|
17905
|
-
return /* @__PURE__ */ (0,
|
|
17818
|
+
return /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_components71.Markdown, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: emptyMessage });
|
|
17906
17819
|
}
|
|
17907
17820
|
if (state === "error" && results.length === 0) {
|
|
17908
|
-
return /* @__PURE__ */ (0,
|
|
17821
|
+
return /* @__PURE__ */ (0, import_jsx_runtime114.jsx)("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(ErrorResult2, { onRetrySearch }) });
|
|
17909
17822
|
}
|
|
17910
17823
|
if (state === "loading" || results.length === 0) {
|
|
17911
|
-
return /* @__PURE__ */ (0,
|
|
17824
|
+
return /* @__PURE__ */ (0, import_jsx_runtime114.jsx)("p", { className: "m-t-2 m-x-2", children: "Loading..." });
|
|
17912
17825
|
}
|
|
17913
17826
|
return null;
|
|
17914
17827
|
}
|
|
@@ -17916,21 +17829,21 @@ var DynamicSearch_default = DynamicSearch;
|
|
|
17916
17829
|
|
|
17917
17830
|
// src/legacy/layout/modal/DynamicModal.tsx
|
|
17918
17831
|
var import_components72 = require("@transferwise/components");
|
|
17919
|
-
var
|
|
17920
|
-
var
|
|
17832
|
+
var import_react51 = require("react");
|
|
17833
|
+
var import_jsx_runtime115 = require("react/jsx-runtime");
|
|
17921
17834
|
function DynamicModal(props) {
|
|
17922
|
-
const [visible, isVisible] = (0,
|
|
17835
|
+
const [visible, isVisible] = (0, import_react51.useState)(false);
|
|
17923
17836
|
const { component, onAction } = props;
|
|
17924
17837
|
const { margin = "md" } = component;
|
|
17925
|
-
return /* @__PURE__ */ (0,
|
|
17926
|
-
/* @__PURE__ */ (0,
|
|
17927
|
-
/* @__PURE__ */ (0,
|
|
17838
|
+
return /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)("div", { className: getTextAlignmentAndMargin2({ margin }), children: [
|
|
17839
|
+
/* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_components72.Button, { priority: "tertiary", block: true, onClick: () => isVisible(true), children: component.trigger.title }),
|
|
17840
|
+
/* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
|
|
17928
17841
|
import_components72.Modal,
|
|
17929
17842
|
{
|
|
17930
17843
|
scroll: "content",
|
|
17931
17844
|
open: visible,
|
|
17932
17845
|
size: "lg",
|
|
17933
|
-
body: /* @__PURE__ */ (0,
|
|
17846
|
+
body: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
|
|
17934
17847
|
DynamicLayout_default,
|
|
17935
17848
|
__spreadProps(__spreadValues({}, props), {
|
|
17936
17849
|
components: component.content.components,
|
|
@@ -17948,7 +17861,7 @@ function DynamicModal(props) {
|
|
|
17948
17861
|
var DynamicModal_default = DynamicModal;
|
|
17949
17862
|
|
|
17950
17863
|
// src/legacy/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.tsx
|
|
17951
|
-
var
|
|
17864
|
+
var import_jsx_runtime116 = require("react/jsx-runtime");
|
|
17952
17865
|
var isNullish3 = (value) => isNull3(value) || isUndefined3(value);
|
|
17953
17866
|
var getDefaultValue = (schema) => {
|
|
17954
17867
|
return schema.type === "boolean" && isNullish3(schema.default) ? false : schema.default;
|
|
@@ -17986,13 +17899,13 @@ var BasicTypeSchema = (props) => {
|
|
|
17986
17899
|
props.onBlur();
|
|
17987
17900
|
}
|
|
17988
17901
|
};
|
|
17989
|
-
const [model, setModel] = (0,
|
|
17990
|
-
const [lastModel, setLastModel] = (0,
|
|
17991
|
-
const [changed, setChanged] = (0,
|
|
17992
|
-
const [focused, setFocused] = (0,
|
|
17993
|
-
const [blurred, setBlurred] = (0,
|
|
17994
|
-
const [validations, setValidations] = (0,
|
|
17995
|
-
const id = (0,
|
|
17902
|
+
const [model, setModel] = (0, import_react52.useState)((_a = props.model) != null ? _a : null);
|
|
17903
|
+
const [lastModel, setLastModel] = (0, import_react52.useState)((_b = props.model) != null ? _b : null);
|
|
17904
|
+
const [changed, setChanged] = (0, import_react52.useState)(false);
|
|
17905
|
+
const [focused, setFocused] = (0, import_react52.useState)(false);
|
|
17906
|
+
const [blurred, setBlurred] = (0, import_react52.useState)(false);
|
|
17907
|
+
const [validations, setValidations] = (0, import_react52.useState)([]);
|
|
17908
|
+
const id = (0, import_react52.useMemo)(() => props.schema.$id || generateRandomId(), [props.schema.$id]);
|
|
17996
17909
|
const onSchemaChange = () => {
|
|
17997
17910
|
const defaultValue = getDefaultValue(props.schema);
|
|
17998
17911
|
if (isNullish3(model) && !isNullish3(defaultValue)) {
|
|
@@ -18007,9 +17920,9 @@ var BasicTypeSchema = (props) => {
|
|
|
18007
17920
|
};
|
|
18008
17921
|
const isConst = props.schema.const;
|
|
18009
17922
|
const isHidden = props.schema.hidden || isConst;
|
|
18010
|
-
(0,
|
|
18011
|
-
(0,
|
|
18012
|
-
(0,
|
|
17923
|
+
(0, import_react52.useEffect)(refreshValidations, [props.model, props.submitted]);
|
|
17924
|
+
(0, import_react52.useEffect)(onSchemaChange, [props.schema]);
|
|
17925
|
+
(0, import_react52.useEffect)(() => {
|
|
18013
17926
|
var _a2;
|
|
18014
17927
|
const newModel = (_a2 = props.model) != null ? _a2 : null;
|
|
18015
17928
|
if (newModel !== model) {
|
|
@@ -18024,15 +17937,15 @@ var BasicTypeSchema = (props) => {
|
|
|
18024
17937
|
const showLabel = props.schema.format !== "file" && props.schema.type !== "boolean";
|
|
18025
17938
|
const schemaHelp = props.schema.help;
|
|
18026
17939
|
const feedbackId = `${id}-feedback`;
|
|
18027
|
-
return !isHidden ? /* @__PURE__ */ (0,
|
|
18028
|
-
props.schema.alert && /* @__PURE__ */ (0,
|
|
18029
|
-
/* @__PURE__ */ (0,
|
|
18030
|
-
showLabel && /* @__PURE__ */ (0,
|
|
18031
|
-
/* @__PURE__ */ (0,
|
|
18032
|
-
!!schemaHelp && /* @__PURE__ */ (0,
|
|
17940
|
+
return !isHidden ? /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)(import_jsx_runtime116.Fragment, { children: [
|
|
17941
|
+
props.schema.alert && /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(DynamicAlert_default, { component: props.schema.alert }),
|
|
17942
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsxs)("div", { className: (0, import_classnames15.default)(formGroupClasses), children: [
|
|
17943
|
+
showLabel && /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)("div", { className: "d-inline-block m-b-1", children: [
|
|
17944
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)("label", { className: "control-label d-inline", htmlFor: id, children: props.schema.title }),
|
|
17945
|
+
!!schemaHelp && /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(Help_default2, { help: schemaHelp })
|
|
18033
17946
|
] }),
|
|
18034
|
-
!showLabel && !!schemaHelp && /* @__PURE__ */ (0,
|
|
18035
|
-
/* @__PURE__ */ (0,
|
|
17947
|
+
!showLabel && !!schemaHelp && /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(Help_default2, { help: schemaHelp }),
|
|
17948
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
|
|
18036
17949
|
SchemaFormControl_default,
|
|
18037
17950
|
{
|
|
18038
17951
|
id,
|
|
@@ -18045,7 +17958,7 @@ var BasicTypeSchema = (props) => {
|
|
|
18045
17958
|
describedBy: feedbackId
|
|
18046
17959
|
}
|
|
18047
17960
|
),
|
|
18048
|
-
/* @__PURE__ */ (0,
|
|
17961
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
|
|
18049
17962
|
ControlFeedback_default,
|
|
18050
17963
|
{
|
|
18051
17964
|
id: feedbackId,
|
|
@@ -18070,7 +17983,7 @@ BasicTypeSchema.defaultProps = {
|
|
|
18070
17983
|
var BasicTypeSchema_default = BasicTypeSchema;
|
|
18071
17984
|
|
|
18072
17985
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.tsx
|
|
18073
|
-
var
|
|
17986
|
+
var import_jsx_runtime117 = require("react/jsx-runtime");
|
|
18074
17987
|
var getIdFromResponse = (idProperty, response) => response[idProperty];
|
|
18075
17988
|
var getErrorFromResponse = (errorProperty, response) => {
|
|
18076
17989
|
var _a;
|
|
@@ -18088,12 +18001,12 @@ function PersistAsyncBasicSchema(props) {
|
|
|
18088
18001
|
const intl = (0, import_react_intl36.useIntl)();
|
|
18089
18002
|
const httpClient = useHttpClient();
|
|
18090
18003
|
const onEvent = useEventDispatcher();
|
|
18091
|
-
const [persistAsyncModel, setPersistAsyncModel] = (0,
|
|
18004
|
+
const [persistAsyncModel, setPersistAsyncModel] = (0, import_react53.useState)(null);
|
|
18092
18005
|
const previousPersistAsyncModel = usePrevious(persistAsyncModel);
|
|
18093
|
-
const [persistAsyncError, setPersistAsyncError] = (0,
|
|
18094
|
-
const [fieldSubmitted, setFieldSubmitted] = (0,
|
|
18095
|
-
const [abortController, setAbortController] = (0,
|
|
18096
|
-
(0,
|
|
18006
|
+
const [persistAsyncError, setPersistAsyncError] = (0, import_react53.useState)(null);
|
|
18007
|
+
const [fieldSubmitted, setFieldSubmitted] = (0, import_react53.useState)(false);
|
|
18008
|
+
const [abortController, setAbortController] = (0, import_react53.useState)(null);
|
|
18009
|
+
(0, import_react53.useEffect)(() => {
|
|
18097
18010
|
if (controlTypesWithPersistOnChange.has(
|
|
18098
18011
|
// TODO: LOW avoid type assertion below -- control type may be nullish. consider ?? ''
|
|
18099
18012
|
getControlType(schema.persistAsync.schema)
|
|
@@ -18160,7 +18073,7 @@ function PersistAsyncBasicSchema(props) {
|
|
|
18160
18073
|
setPersistAsyncModel(newPersistAsyncModel);
|
|
18161
18074
|
}
|
|
18162
18075
|
};
|
|
18163
|
-
return /* @__PURE__ */ (0,
|
|
18076
|
+
return /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
18164
18077
|
BasicTypeSchema_default,
|
|
18165
18078
|
{
|
|
18166
18079
|
required,
|
|
@@ -18181,7 +18094,7 @@ var PersistAsyncBasicSchema_default = PersistAsyncBasicSchema;
|
|
|
18181
18094
|
|
|
18182
18095
|
// src/legacy/common/hooks/usePersistAsync/usePersistAsync.ts
|
|
18183
18096
|
var usePersistAsync = (persistAsync) => {
|
|
18184
|
-
const [abortController, setAbortController] = (0,
|
|
18097
|
+
const [abortController, setAbortController] = (0, import_react54.useState)(null);
|
|
18185
18098
|
const httpClient = useHttpClient();
|
|
18186
18099
|
const intl = (0, import_react_intl37.useIntl)();
|
|
18187
18100
|
const { schema } = persistAsync;
|
|
@@ -18260,7 +18173,7 @@ function hasStringMessage(value) {
|
|
|
18260
18173
|
}
|
|
18261
18174
|
|
|
18262
18175
|
// src/legacy/common/hooks/usePolling/usePolling.tsx
|
|
18263
|
-
var
|
|
18176
|
+
var import_react55 = require("react");
|
|
18264
18177
|
function usePolling({
|
|
18265
18178
|
asyncFn,
|
|
18266
18179
|
interval,
|
|
@@ -18269,9 +18182,9 @@ function usePolling({
|
|
|
18269
18182
|
onPollingResponse,
|
|
18270
18183
|
onFailure
|
|
18271
18184
|
}) {
|
|
18272
|
-
const onPollingResponseReference = (0,
|
|
18273
|
-
const onFailureReference = (0,
|
|
18274
|
-
const poll = (0,
|
|
18185
|
+
const onPollingResponseReference = (0, import_react55.useRef)(onPollingResponse);
|
|
18186
|
+
const onFailureReference = (0, import_react55.useRef)(onFailure);
|
|
18187
|
+
const poll = (0, import_react55.useMemo)(
|
|
18275
18188
|
() => createPollingClosure(
|
|
18276
18189
|
asyncFn,
|
|
18277
18190
|
maxAttempts,
|
|
@@ -18281,7 +18194,7 @@ function usePolling({
|
|
|
18281
18194
|
),
|
|
18282
18195
|
[asyncFn, maxAttempts, maxConsecutiveFails]
|
|
18283
18196
|
);
|
|
18284
|
-
(0,
|
|
18197
|
+
(0, import_react55.useEffect)(() => {
|
|
18285
18198
|
if (interval > 0) {
|
|
18286
18199
|
const intervalReference = setInterval(() => {
|
|
18287
18200
|
poll();
|
|
@@ -18289,7 +18202,7 @@ function usePolling({
|
|
|
18289
18202
|
return () => clearInterval(intervalReference);
|
|
18290
18203
|
}
|
|
18291
18204
|
}, [poll, interval]);
|
|
18292
|
-
(0,
|
|
18205
|
+
(0, import_react55.useEffect)(() => {
|
|
18293
18206
|
onPollingResponseReference.current = onPollingResponse;
|
|
18294
18207
|
onFailureReference.current = onFailure;
|
|
18295
18208
|
}, [onPollingResponse, onFailure]);
|
|
@@ -18320,20 +18233,20 @@ function createPollingClosure(asyncFn, maxAttempts, maxConsecutiveFails, onPolli
|
|
|
18320
18233
|
}
|
|
18321
18234
|
|
|
18322
18235
|
// src/legacy/common/hooks/usePrevious/usePrevious.js
|
|
18323
|
-
var
|
|
18236
|
+
var import_react56 = require("react");
|
|
18324
18237
|
var usePrevious = (value) => {
|
|
18325
|
-
const reference = (0,
|
|
18326
|
-
(0,
|
|
18238
|
+
const reference = (0, import_react56.useRef)();
|
|
18239
|
+
(0, import_react56.useEffect)(() => {
|
|
18327
18240
|
reference.current = value;
|
|
18328
18241
|
}, [value]);
|
|
18329
18242
|
return reference.current;
|
|
18330
18243
|
};
|
|
18331
18244
|
|
|
18332
18245
|
// src/legacy/common/hooks/useStepPolling/useStepPolling.tsx
|
|
18333
|
-
var
|
|
18246
|
+
var import_react57 = require("react");
|
|
18334
18247
|
function useStepPolling(polling, onAction) {
|
|
18335
18248
|
const httpClient = useHttpClient();
|
|
18336
|
-
const asyncFn = (0,
|
|
18249
|
+
const asyncFn = (0, import_react57.useMemo)(() => {
|
|
18337
18250
|
if (polling) {
|
|
18338
18251
|
return () => httpClient(polling.url).then((response) => {
|
|
18339
18252
|
if (response.ok) {
|
|
@@ -18346,7 +18259,7 @@ function useStepPolling(polling, onAction) {
|
|
|
18346
18259
|
}
|
|
18347
18260
|
return void 0;
|
|
18348
18261
|
}, [polling, httpClient]);
|
|
18349
|
-
const onPollingResponse = (0,
|
|
18262
|
+
const onPollingResponse = (0, import_react57.useCallback)(
|
|
18350
18263
|
(pollingResponse) => {
|
|
18351
18264
|
if (pollingResponse == null ? void 0 : pollingResponse.action) {
|
|
18352
18265
|
onAction(pollingResponse.action);
|
|
@@ -18362,7 +18275,7 @@ function useStepPolling(polling, onAction) {
|
|
|
18362
18275
|
maxAttempts: (polling == null ? void 0 : polling.maxAttempts) || 0,
|
|
18363
18276
|
maxConsecutiveFails: 1,
|
|
18364
18277
|
onPollingResponse,
|
|
18365
|
-
onFailure: (0,
|
|
18278
|
+
onFailure: (0, import_react57.useCallback)(() => {
|
|
18366
18279
|
if (polling) {
|
|
18367
18280
|
onAction(polling.onError.action);
|
|
18368
18281
|
}
|
|
@@ -18371,7 +18284,7 @@ function useStepPolling(polling, onAction) {
|
|
|
18371
18284
|
}
|
|
18372
18285
|
|
|
18373
18286
|
// src/legacy/step/layoutStep/LayoutStep.tsx
|
|
18374
|
-
var
|
|
18287
|
+
var import_jsx_runtime118 = require("react/jsx-runtime");
|
|
18375
18288
|
var getComponents = (step, options) => {
|
|
18376
18289
|
var _a;
|
|
18377
18290
|
if (isEmpty(step)) {
|
|
@@ -18394,7 +18307,7 @@ var LayoutStep = (props) => {
|
|
|
18394
18307
|
onEvent("Dynamic Flow - onAction supressed", { reason: "LayoutStep - loading state" });
|
|
18395
18308
|
};
|
|
18396
18309
|
useStepPolling(stepSpecification.polling, onAction);
|
|
18397
|
-
return /* @__PURE__ */ (0,
|
|
18310
|
+
return /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
|
|
18398
18311
|
DynamicLayout_default,
|
|
18399
18312
|
{
|
|
18400
18313
|
components,
|
|
@@ -18410,10 +18323,10 @@ var LayoutStep = (props) => {
|
|
|
18410
18323
|
var LayoutStep_default = LayoutStep;
|
|
18411
18324
|
|
|
18412
18325
|
// src/legacy/step/cameraStep/CameraStep.tsx
|
|
18413
|
-
var
|
|
18326
|
+
var import_react62 = require("react");
|
|
18414
18327
|
|
|
18415
18328
|
// src/common/cameraCapture/CameraCapture.tsx
|
|
18416
|
-
var
|
|
18329
|
+
var import_react61 = require("react");
|
|
18417
18330
|
var import_react_intl42 = require("react-intl");
|
|
18418
18331
|
var import_react_webcam = __toESM(require("react-webcam"));
|
|
18419
18332
|
|
|
@@ -18480,15 +18393,15 @@ var CameraCapture_messages_default = (0, import_react_intl38.defineMessages)({
|
|
|
18480
18393
|
// src/common/cameraCapture/components/bottomBar/BottomBar.tsx
|
|
18481
18394
|
var import_components73 = require("@transferwise/components");
|
|
18482
18395
|
var import_react_intl39 = require("react-intl");
|
|
18483
|
-
var
|
|
18484
|
-
var CaptureBottomBar = ({ onCapture }) => /* @__PURE__ */ (0,
|
|
18396
|
+
var import_jsx_runtime119 = require("react/jsx-runtime");
|
|
18397
|
+
var CaptureBottomBar = ({ onCapture }) => /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("div", { className: "bottom-bar", children: /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(CaptureButton, { onClick: onCapture }) });
|
|
18485
18398
|
var ReviewBottomBar = ({
|
|
18486
18399
|
onSubmit,
|
|
18487
18400
|
onRetry
|
|
18488
18401
|
}) => {
|
|
18489
18402
|
const intl = (0, import_react_intl39.useIntl)();
|
|
18490
|
-
return /* @__PURE__ */ (0,
|
|
18491
|
-
/* @__PURE__ */ (0,
|
|
18403
|
+
return /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("div", { className: "bottom-bar p-x-2", children: /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("div", { className: "row", children: /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)("div", { className: "col-xs-12 col-md-6 col-md-offset-3", children: [
|
|
18404
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
18492
18405
|
import_components73.Button,
|
|
18493
18406
|
{
|
|
18494
18407
|
className: "m-b-1",
|
|
@@ -18499,7 +18412,7 @@ var ReviewBottomBar = ({
|
|
|
18499
18412
|
children: intl.formatMessage(CameraCapture_messages_default.reviewSubmit)
|
|
18500
18413
|
}
|
|
18501
18414
|
),
|
|
18502
|
-
/* @__PURE__ */ (0,
|
|
18415
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
18503
18416
|
import_components73.Button,
|
|
18504
18417
|
{
|
|
18505
18418
|
className: "m-b-2",
|
|
@@ -18513,14 +18426,14 @@ var ReviewBottomBar = ({
|
|
|
18513
18426
|
)
|
|
18514
18427
|
] }) }) });
|
|
18515
18428
|
};
|
|
18516
|
-
var CaptureButton = ({ onClick }) => /* @__PURE__ */ (0,
|
|
18429
|
+
var CaptureButton = ({ onClick }) => /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
18517
18430
|
"button",
|
|
18518
18431
|
{
|
|
18519
18432
|
type: "button",
|
|
18520
18433
|
className: "camera-capture-btn m-b-2",
|
|
18521
18434
|
"data-testid": "camera-capture-button",
|
|
18522
18435
|
onClick,
|
|
18523
|
-
children: /* @__PURE__ */ (0,
|
|
18436
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("span", { className: "camera-capture-btn-inner" })
|
|
18524
18437
|
}
|
|
18525
18438
|
);
|
|
18526
18439
|
|
|
@@ -18538,11 +18451,11 @@ var OrientationLockOverlay_messages_default = (0, import_react_intl40.defineMess
|
|
|
18538
18451
|
});
|
|
18539
18452
|
|
|
18540
18453
|
// src/common/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.tsx
|
|
18541
|
-
var
|
|
18454
|
+
var import_jsx_runtime120 = require("react/jsx-runtime");
|
|
18542
18455
|
function OrientationLockOverlay() {
|
|
18543
18456
|
const intl = (0, import_react_intl41.useIntl)();
|
|
18544
|
-
return /* @__PURE__ */ (0,
|
|
18545
|
-
/* @__PURE__ */ (0,
|
|
18457
|
+
return /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { className: "orientation-lock-overlay", children: [
|
|
18458
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
18546
18459
|
"img",
|
|
18547
18460
|
{
|
|
18548
18461
|
className: "m-b-3",
|
|
@@ -18552,13 +18465,13 @@ function OrientationLockOverlay() {
|
|
|
18552
18465
|
alt: ""
|
|
18553
18466
|
}
|
|
18554
18467
|
),
|
|
18555
|
-
/* @__PURE__ */ (0,
|
|
18468
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)("p", { className: "text-center m-b-0", children: intl.formatMessage(OrientationLockOverlay_messages_default.text) })
|
|
18556
18469
|
] });
|
|
18557
18470
|
}
|
|
18558
18471
|
var OrientationLockOverlay_default = OrientationLockOverlay;
|
|
18559
18472
|
|
|
18560
18473
|
// src/common/cameraCapture/hooks/useFullScreenOrientationLock.ts
|
|
18561
|
-
var
|
|
18474
|
+
var import_react58 = require("react");
|
|
18562
18475
|
var import_screenfull = __toESM(require_screenfull());
|
|
18563
18476
|
|
|
18564
18477
|
// src/common/cameraCapture/utils/index.ts
|
|
@@ -18637,7 +18550,7 @@ var trackCameraOrientationLocked = (onEvent) => {
|
|
|
18637
18550
|
|
|
18638
18551
|
// src/common/cameraCapture/hooks/useFullScreenOrientationLock.ts
|
|
18639
18552
|
var useFullScreenOrientationLock = (shouldLockOrientation, onEvent) => {
|
|
18640
|
-
const lockOrientation = (0,
|
|
18553
|
+
const lockOrientation = (0, import_react58.useCallback)(() => {
|
|
18641
18554
|
if (window.screen.orientation && "lock" in window.screen.orientation && typeof window.screen.orientation.lock === "function") {
|
|
18642
18555
|
const lockPromise = window.screen.orientation.lock("portrait");
|
|
18643
18556
|
if (lockPromise instanceof Promise) {
|
|
@@ -18645,11 +18558,11 @@ var useFullScreenOrientationLock = (shouldLockOrientation, onEvent) => {
|
|
|
18645
18558
|
}
|
|
18646
18559
|
}
|
|
18647
18560
|
}, [onEvent]);
|
|
18648
|
-
const unlockOrientation = (0,
|
|
18561
|
+
const unlockOrientation = (0, import_react58.useCallback)(() => {
|
|
18649
18562
|
var _a, _b, _c;
|
|
18650
18563
|
return (_c = (_b = (_a = window == null ? void 0 : window.screen) == null ? void 0 : _a.orientation) == null ? void 0 : _b.unlock) == null ? void 0 : _c.call(_b);
|
|
18651
18564
|
}, []);
|
|
18652
|
-
const enterFullScreen = (0,
|
|
18565
|
+
const enterFullScreen = (0, import_react58.useCallback)(() => {
|
|
18653
18566
|
setTimeout(() => {
|
|
18654
18567
|
if (shouldLockOrientation && !import_screenfull.default.isFullscreen && import_screenfull.default.isEnabled) {
|
|
18655
18568
|
import_screenfull.default.request(document.documentElement, { navigationUI: "show" }).then(() => {
|
|
@@ -18658,13 +18571,13 @@ var useFullScreenOrientationLock = (shouldLockOrientation, onEvent) => {
|
|
|
18658
18571
|
}
|
|
18659
18572
|
}, 100);
|
|
18660
18573
|
}, [shouldLockOrientation, lockOrientation]);
|
|
18661
|
-
const exitFullScreen = (0,
|
|
18574
|
+
const exitFullScreen = (0, import_react58.useCallback)(() => {
|
|
18662
18575
|
if (import_screenfull.default.isFullscreen) {
|
|
18663
18576
|
import_screenfull.default.exit().catch(noop5);
|
|
18664
18577
|
}
|
|
18665
18578
|
unlockOrientation();
|
|
18666
18579
|
}, [unlockOrientation]);
|
|
18667
|
-
const handleOrientationChange = (0,
|
|
18580
|
+
const handleOrientationChange = (0, import_react58.useCallback)(
|
|
18668
18581
|
(event) => {
|
|
18669
18582
|
var _a, _b;
|
|
18670
18583
|
if ((_a = event == null ? void 0 : event.target) == null ? void 0 : _a.type.includes("landscape")) {
|
|
@@ -18675,7 +18588,7 @@ var useFullScreenOrientationLock = (shouldLockOrientation, onEvent) => {
|
|
|
18675
18588
|
},
|
|
18676
18589
|
[onEvent]
|
|
18677
18590
|
);
|
|
18678
|
-
(0,
|
|
18591
|
+
(0, import_react58.useEffect)(() => {
|
|
18679
18592
|
var _a, _b;
|
|
18680
18593
|
if (shouldLockOrientation) {
|
|
18681
18594
|
(_b = (_a = window.screen) == null ? void 0 : _a.orientation) == null ? void 0 : _b.addEventListener(
|
|
@@ -18698,10 +18611,10 @@ var noop5 = () => {
|
|
|
18698
18611
|
};
|
|
18699
18612
|
|
|
18700
18613
|
// src/common/cameraCapture/hooks/useVideoConstraints.ts
|
|
18701
|
-
var
|
|
18614
|
+
var import_react59 = require("react");
|
|
18702
18615
|
var useVideoConstraints = (direction) => {
|
|
18703
|
-
const [videoConstraints, setVideoConstraints] = (0,
|
|
18704
|
-
(0,
|
|
18616
|
+
const [videoConstraints, setVideoConstraints] = (0, import_react59.useState)();
|
|
18617
|
+
(0, import_react59.useEffect)(() => {
|
|
18705
18618
|
void getVideoConstraints(direction).then(setVideoConstraints);
|
|
18706
18619
|
}, [direction]);
|
|
18707
18620
|
return { videoConstraints };
|
|
@@ -18726,8 +18639,8 @@ var getVideoConstraints = async (dir) => {
|
|
|
18726
18639
|
};
|
|
18727
18640
|
|
|
18728
18641
|
// src/common/cameraCapture/overlay/Overlay.tsx
|
|
18729
|
-
var
|
|
18730
|
-
var
|
|
18642
|
+
var import_react60 = require("react");
|
|
18643
|
+
var import_jsx_runtime121 = require("react/jsx-runtime");
|
|
18731
18644
|
var captureButtonHeight = 92;
|
|
18732
18645
|
var reviewButtonsHeight = 120;
|
|
18733
18646
|
var imageHeight = 40;
|
|
@@ -18736,8 +18649,8 @@ var instructionsHeight = 48;
|
|
|
18736
18649
|
var reviewInstructionsHeight = 40;
|
|
18737
18650
|
var overlayMaxWidth = 800;
|
|
18738
18651
|
function Overlay({ overlay, outline, imageUrl, title, instructions, reviewInstructions }) {
|
|
18739
|
-
const svgReference = (0,
|
|
18740
|
-
(0,
|
|
18652
|
+
const svgReference = (0, import_react60.useRef)(null);
|
|
18653
|
+
(0, import_react60.useEffect)(() => {
|
|
18741
18654
|
const listener = debounce2(() => {
|
|
18742
18655
|
var _a;
|
|
18743
18656
|
if ((_a = svgReference.current) == null ? void 0 : _a.innerHTML) {
|
|
@@ -18749,18 +18662,18 @@ function Overlay({ overlay, outline, imageUrl, title, instructions, reviewInstru
|
|
|
18749
18662
|
return () => window.removeEventListener("resize", listener);
|
|
18750
18663
|
});
|
|
18751
18664
|
let helperBoxHeight = (imageUrl ? imageHeight : 0) + (title ? titleHeight : 0) + (instructions ? instructionsHeight : 0);
|
|
18752
|
-
let helperBox = /* @__PURE__ */ (0,
|
|
18753
|
-
imageUrl && /* @__PURE__ */ (0,
|
|
18754
|
-
title && /* @__PURE__ */ (0,
|
|
18755
|
-
instructions && /* @__PURE__ */ (0,
|
|
18665
|
+
let helperBox = /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)(import_jsx_runtime121.Fragment, { children: [
|
|
18666
|
+
imageUrl && /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("img", { className: "camera-capture-img", src: imageUrl, alt: "" }),
|
|
18667
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("h4", { className: "camera-capture-title", children: title }),
|
|
18668
|
+
instructions && /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("small", { className: "camera-capture-instructions", children: instructions })
|
|
18756
18669
|
] });
|
|
18757
18670
|
const frameBottomMargin = captureButtonHeight + helperBoxHeight;
|
|
18758
18671
|
if (reviewInstructions) {
|
|
18759
18672
|
helperBoxHeight = frameBottomMargin - reviewButtonsHeight;
|
|
18760
|
-
helperBox = /* @__PURE__ */ (0,
|
|
18673
|
+
helperBox = /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("small", { className: "camera-capture-instructions", children: reviewInstructions });
|
|
18761
18674
|
const frameWithReviewInstructionsMinBottomMargin = reviewButtonsHeight + reviewInstructionsHeight;
|
|
18762
18675
|
if (frameBottomMargin < frameWithReviewInstructionsMinBottomMargin) {
|
|
18763
|
-
helperBox = /* @__PURE__ */ (0,
|
|
18676
|
+
helperBox = /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(import_jsx_runtime121.Fragment, {});
|
|
18764
18677
|
}
|
|
18765
18678
|
}
|
|
18766
18679
|
const framePosition = {
|
|
@@ -18778,32 +18691,32 @@ function Overlay({ overlay, outline, imageUrl, title, instructions, reviewInstru
|
|
|
18778
18691
|
width: "90%"
|
|
18779
18692
|
}
|
|
18780
18693
|
};
|
|
18781
|
-
return /* @__PURE__ */ (0,
|
|
18782
|
-
/* @__PURE__ */ (0,
|
|
18783
|
-
/* @__PURE__ */ (0,
|
|
18784
|
-
/* @__PURE__ */ (0,
|
|
18694
|
+
return /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)("svg", { ref: svgReference, xmlns: "http://www.w3.org/2000/svg", children: [
|
|
18695
|
+
/* @__PURE__ */ (0, import_jsx_runtime121.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)("mask", { id: "mask", children: [
|
|
18696
|
+
/* @__PURE__ */ (0, import_jsx_runtime121.jsx)("rect", { width: "100%", height: "100%", fill: "#fff" }),
|
|
18697
|
+
/* @__PURE__ */ (0, import_jsx_runtime121.jsx)("image", __spreadValues({ href: overlay }, framePosition))
|
|
18785
18698
|
] }) }),
|
|
18786
|
-
overlay && /* @__PURE__ */ (0,
|
|
18787
|
-
outline && /* @__PURE__ */ (0,
|
|
18788
|
-
/* @__PURE__ */ (0,
|
|
18699
|
+
overlay && /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("rect", { width: "100%", height: "100%", mask: "url(#mask)", fillOpacity: "0.72" }),
|
|
18700
|
+
outline && /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("image", __spreadValues({ href: outline }, framePosition)),
|
|
18701
|
+
/* @__PURE__ */ (0, import_jsx_runtime121.jsx)("foreignObject", { width: "100%", height: "100%", children: /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("div", __spreadProps(__spreadValues({ className: "camera-capture-text-and-image-container" }, helperBoxPosition), { children: helperBox })) })
|
|
18789
18702
|
] });
|
|
18790
18703
|
}
|
|
18791
18704
|
var Overlay_default = Overlay;
|
|
18792
18705
|
|
|
18793
18706
|
// src/common/cameraCapture/screens/cameraErrorScreen/CameraErrorScreen.tsx
|
|
18794
18707
|
var import_components74 = require("@transferwise/components");
|
|
18795
|
-
var
|
|
18708
|
+
var import_jsx_runtime122 = require("react/jsx-runtime");
|
|
18796
18709
|
function CameraErrorScreen({ title, description, actionButton, onAction }) {
|
|
18797
|
-
return /* @__PURE__ */ (0,
|
|
18798
|
-
/* @__PURE__ */ (0,
|
|
18799
|
-
/* @__PURE__ */ (0,
|
|
18800
|
-
onAction && actionButton && /* @__PURE__ */ (0,
|
|
18710
|
+
return /* @__PURE__ */ (0, import_jsx_runtime122.jsx)("div", { className: "container p-t-5", children: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)("div", { className: "row", children: /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)("div", { className: "col-md-6 col-md-offset-3", children: [
|
|
18711
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)("h2", { className: "text-xs-center m-b-3", children: title }),
|
|
18712
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)("p", { className: "text-xs-center m-b-5", children: description }),
|
|
18713
|
+
onAction && actionButton && /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(import_components74.Button, { block: true, onClick: onAction, children: actionButton })
|
|
18801
18714
|
] }) }) });
|
|
18802
18715
|
}
|
|
18803
18716
|
var CameraErrorScreen_default = CameraErrorScreen;
|
|
18804
18717
|
|
|
18805
18718
|
// src/common/cameraCapture/CameraCapture.tsx
|
|
18806
|
-
var
|
|
18719
|
+
var import_jsx_runtime123 = require("react/jsx-runtime");
|
|
18807
18720
|
function CameraCapture({
|
|
18808
18721
|
direction = "back",
|
|
18809
18722
|
overlay = "",
|
|
@@ -18815,14 +18728,14 @@ function CameraCapture({
|
|
|
18815
18728
|
onCapture,
|
|
18816
18729
|
onEvent
|
|
18817
18730
|
}) {
|
|
18818
|
-
const [mode, setMode] = (0,
|
|
18819
|
-
const [cameraError, setCameraError] = (0,
|
|
18820
|
-
const [isVideoMirrored, setIsVideoMirrored] = (0,
|
|
18821
|
-
const [ready, setReady] = (0,
|
|
18822
|
-
const [reviewImage, setReviewImage] = (0,
|
|
18823
|
-
const webcamReference = (0,
|
|
18731
|
+
const [mode, setMode] = (0, import_react61.useState)("CAPTURE" /* CAPTURE */);
|
|
18732
|
+
const [cameraError, setCameraError] = (0, import_react61.useState)();
|
|
18733
|
+
const [isVideoMirrored, setIsVideoMirrored] = (0, import_react61.useState)(false);
|
|
18734
|
+
const [ready, setReady] = (0, import_react61.useState)(false);
|
|
18735
|
+
const [reviewImage, setReviewImage] = (0, import_react61.useState)();
|
|
18736
|
+
const webcamReference = (0, import_react61.useRef)(null);
|
|
18824
18737
|
const { videoConstraints } = useVideoConstraints(direction);
|
|
18825
|
-
const shouldLockOrientation = (0,
|
|
18738
|
+
const shouldLockOrientation = (0, import_react61.useMemo)(
|
|
18826
18739
|
() => !!(isMobile() && mode === "CAPTURE" /* CAPTURE */),
|
|
18827
18740
|
[mode]
|
|
18828
18741
|
);
|
|
@@ -18831,7 +18744,7 @@ function CameraCapture({
|
|
|
18831
18744
|
onEvent
|
|
18832
18745
|
);
|
|
18833
18746
|
const intl = (0, import_react_intl42.useIntl)();
|
|
18834
|
-
const handleCapture = (0,
|
|
18747
|
+
const handleCapture = (0, import_react61.useCallback)(async () => {
|
|
18835
18748
|
var _a, _b, _c, _d, _e, _f;
|
|
18836
18749
|
if (((_a = webcamReference == null ? void 0 : webcamReference.current) == null ? void 0 : _a.video) && ((_c = (_b = webcamReference == null ? void 0 : webcamReference.current) == null ? void 0 : _b.video) == null ? void 0 : _c.readyState) >= 3) {
|
|
18837
18750
|
(_e = (_d = webcamReference == null ? void 0 : webcamReference.current) == null ? void 0 : _d.video) == null ? void 0 : _e.pause();
|
|
@@ -18853,7 +18766,7 @@ function CameraCapture({
|
|
|
18853
18766
|
);
|
|
18854
18767
|
}
|
|
18855
18768
|
}, [webcamReference, showReview, setReviewImage, setMode, onCapture, isVideoMirrored]);
|
|
18856
|
-
const handleUserMediaError = (0,
|
|
18769
|
+
const handleUserMediaError = (0, import_react61.useCallback)(
|
|
18857
18770
|
(error) => {
|
|
18858
18771
|
setMode("ERROR" /* ERROR */);
|
|
18859
18772
|
if (error instanceof DOMException) {
|
|
@@ -18889,7 +18802,7 @@ function CameraCapture({
|
|
|
18889
18802
|
},
|
|
18890
18803
|
[intl, onEvent]
|
|
18891
18804
|
);
|
|
18892
|
-
const handleUserMedia = (0,
|
|
18805
|
+
const handleUserMedia = (0, import_react61.useCallback)(
|
|
18893
18806
|
(stream) => {
|
|
18894
18807
|
enterFullScreen();
|
|
18895
18808
|
setReady(true);
|
|
@@ -18906,13 +18819,13 @@ function CameraCapture({
|
|
|
18906
18819
|
setReviewImage(void 0);
|
|
18907
18820
|
};
|
|
18908
18821
|
const handleRetryCameraAccess = () => setMode("CAPTURE" /* CAPTURE */);
|
|
18909
|
-
(0,
|
|
18822
|
+
(0, import_react61.useEffect)(() => {
|
|
18910
18823
|
if (mode !== "CAPTURE" /* CAPTURE */) {
|
|
18911
18824
|
exitFullScreen();
|
|
18912
18825
|
}
|
|
18913
18826
|
}, [mode, exitFullScreen]);
|
|
18914
|
-
const captureScreen = /* @__PURE__ */ (0,
|
|
18915
|
-
videoConstraints && /* @__PURE__ */ (0,
|
|
18827
|
+
const captureScreen = /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)("div", { className: "camera-capture", children: [
|
|
18828
|
+
videoConstraints && /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
|
|
18916
18829
|
import_react_webcam.default,
|
|
18917
18830
|
{
|
|
18918
18831
|
ref: webcamReference,
|
|
@@ -18923,7 +18836,7 @@ function CameraCapture({
|
|
|
18923
18836
|
onUserMedia: handleUserMedia
|
|
18924
18837
|
}
|
|
18925
18838
|
),
|
|
18926
|
-
/* @__PURE__ */ (0,
|
|
18839
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
|
|
18927
18840
|
Overlay_default,
|
|
18928
18841
|
{
|
|
18929
18842
|
overlay,
|
|
@@ -18933,8 +18846,8 @@ function CameraCapture({
|
|
|
18933
18846
|
instructions
|
|
18934
18847
|
}
|
|
18935
18848
|
),
|
|
18936
|
-
shouldLockOrientation && /* @__PURE__ */ (0,
|
|
18937
|
-
ready && /* @__PURE__ */ (0,
|
|
18849
|
+
shouldLockOrientation && /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(OrientationLockOverlay_default, {}),
|
|
18850
|
+
ready && /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
|
|
18938
18851
|
CaptureBottomBar,
|
|
18939
18852
|
{
|
|
18940
18853
|
onCapture: () => {
|
|
@@ -18943,9 +18856,9 @@ function CameraCapture({
|
|
|
18943
18856
|
}
|
|
18944
18857
|
)
|
|
18945
18858
|
] });
|
|
18946
|
-
const reviewScreen = /* @__PURE__ */ (0,
|
|
18947
|
-
/* @__PURE__ */ (0,
|
|
18948
|
-
/* @__PURE__ */ (0,
|
|
18859
|
+
const reviewScreen = /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)("div", { className: "camera-capture", children: [
|
|
18860
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)("img", { className: "review-image", src: reviewImage == null ? void 0 : reviewImage.source, alt: "" }),
|
|
18861
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
|
|
18949
18862
|
Overlay_default,
|
|
18950
18863
|
{
|
|
18951
18864
|
overlay,
|
|
@@ -18955,18 +18868,18 @@ function CameraCapture({
|
|
|
18955
18868
|
reviewInstructions: intl.formatMessage(CameraCapture_messages_default.reviewInstructions)
|
|
18956
18869
|
}
|
|
18957
18870
|
),
|
|
18958
|
-
/* @__PURE__ */ (0,
|
|
18871
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)(ReviewBottomBar, { onSubmit: handleReviewSubmit, onRetry: handleReviewRetry })
|
|
18959
18872
|
] });
|
|
18960
|
-
return /* @__PURE__ */ (0,
|
|
18873
|
+
return /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)("section", { children: [
|
|
18961
18874
|
mode === "CAPTURE" /* CAPTURE */ && captureScreen,
|
|
18962
18875
|
mode === "REVIEW" /* REVIEW */ && reviewScreen,
|
|
18963
|
-
mode === "ERROR" /* ERROR */ && cameraError && /* @__PURE__ */ (0,
|
|
18876
|
+
mode === "ERROR" /* ERROR */ && cameraError && /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(CameraErrorScreen_default, __spreadValues({}, cameraError))
|
|
18964
18877
|
] });
|
|
18965
18878
|
}
|
|
18966
18879
|
var CameraCapture_default = CameraCapture;
|
|
18967
18880
|
|
|
18968
18881
|
// src/legacy/step/cameraStep/CameraStep.tsx
|
|
18969
|
-
var
|
|
18882
|
+
var import_jsx_runtime124 = require("react/jsx-runtime");
|
|
18970
18883
|
function blobToBase64(blob) {
|
|
18971
18884
|
return new Promise((resolve, _) => {
|
|
18972
18885
|
const reader = new FileReader();
|
|
@@ -18984,8 +18897,8 @@ function CameraStep(props) {
|
|
|
18984
18897
|
const { assets, direction, instructions } = cameraConfig || {};
|
|
18985
18898
|
const { overlay, outline } = assets || {};
|
|
18986
18899
|
const { url: imageUrl } = image || {};
|
|
18987
|
-
const [captureClicked, setCaptureClicked] = (0,
|
|
18988
|
-
(0,
|
|
18900
|
+
const [captureClicked, setCaptureClicked] = (0, import_react62.useState)(false);
|
|
18901
|
+
(0, import_react62.useEffect)(() => {
|
|
18989
18902
|
if (captureClicked) {
|
|
18990
18903
|
onAction(action);
|
|
18991
18904
|
}
|
|
@@ -19004,7 +18917,7 @@ function CameraStep(props) {
|
|
|
19004
18917
|
});
|
|
19005
18918
|
}
|
|
19006
18919
|
};
|
|
19007
|
-
return /* @__PURE__ */ (0,
|
|
18920
|
+
return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
19008
18921
|
CameraCapture_default,
|
|
19009
18922
|
{
|
|
19010
18923
|
overlay,
|
|
@@ -19081,12 +18994,12 @@ var external_confirmation_messages_default2 = (0, import_react_intl43.defineMess
|
|
|
19081
18994
|
});
|
|
19082
18995
|
|
|
19083
18996
|
// src/legacy/step/externalConfirmationStep/ExternalConfirmationStep.tsx
|
|
19084
|
-
var
|
|
18997
|
+
var import_jsx_runtime125 = require("react/jsx-runtime");
|
|
19085
18998
|
var noop6 = () => {
|
|
19086
18999
|
};
|
|
19087
19000
|
function ExternalConfirmationStep({ url, onClose }) {
|
|
19088
19001
|
const { formatMessage } = (0, import_react_intl44.useIntl)();
|
|
19089
|
-
return /* @__PURE__ */ (0,
|
|
19002
|
+
return /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
|
|
19090
19003
|
DynamicLayout_default,
|
|
19091
19004
|
{
|
|
19092
19005
|
components: [
|
|
@@ -19153,9 +19066,9 @@ function getOrigin2(url) {
|
|
|
19153
19066
|
// src/legacy/dynamicFlow/BackButton.tsx
|
|
19154
19067
|
var import_components76 = require("@transferwise/components");
|
|
19155
19068
|
var import_icons6 = require("@transferwise/icons");
|
|
19156
|
-
var
|
|
19069
|
+
var import_jsx_runtime126 = require("react/jsx-runtime");
|
|
19157
19070
|
function BackButton2({ title, action, onAction }) {
|
|
19158
|
-
return /* @__PURE__ */ (0,
|
|
19071
|
+
return /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)(
|
|
19159
19072
|
"a",
|
|
19160
19073
|
{
|
|
19161
19074
|
href: "/",
|
|
@@ -19166,8 +19079,8 @@ function BackButton2({ title, action, onAction }) {
|
|
|
19166
19079
|
onAction(__spreadProps(__spreadValues({}, action), { skipValidation: true }));
|
|
19167
19080
|
},
|
|
19168
19081
|
children: [
|
|
19169
|
-
/* @__PURE__ */ (0,
|
|
19170
|
-
/* @__PURE__ */ (0,
|
|
19082
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)("span", { className: "sr-only", children: title }),
|
|
19083
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_components76.Avatar, { type: "icon", children: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_icons6.ArrowLeft, { size: "24" }) })
|
|
19171
19084
|
]
|
|
19172
19085
|
}
|
|
19173
19086
|
);
|
|
@@ -19175,7 +19088,7 @@ function BackButton2({ title, action, onAction }) {
|
|
|
19175
19088
|
var BackButton_default2 = BackButton2;
|
|
19176
19089
|
|
|
19177
19090
|
// src/legacy/dynamicFlow/DynamicFlowStep.tsx
|
|
19178
|
-
var
|
|
19091
|
+
var import_jsx_runtime127 = require("react/jsx-runtime");
|
|
19179
19092
|
function DynamicFlowStep(props) {
|
|
19180
19093
|
var _a, _b, _c;
|
|
19181
19094
|
const { step, globalError, onAction } = props;
|
|
@@ -19184,28 +19097,28 @@ function DynamicFlowStep(props) {
|
|
|
19184
19097
|
const { requiresManualTrigger, dismissConfirmation } = useExternal2(externalUrl);
|
|
19185
19098
|
if (step === void 0) {
|
|
19186
19099
|
if (globalError) {
|
|
19187
|
-
return /* @__PURE__ */ (0,
|
|
19100
|
+
return /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(DynamicAlert_default, { component: { context: "negative", markdown: globalError, margin: "lg" } });
|
|
19188
19101
|
}
|
|
19189
19102
|
return null;
|
|
19190
19103
|
}
|
|
19191
19104
|
if (externalUrl && requiresManualTrigger) {
|
|
19192
|
-
return /* @__PURE__ */ (0,
|
|
19105
|
+
return /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(ExternalConfirmationStep_default, { url: externalUrl, onClose: dismissConfirmation });
|
|
19193
19106
|
}
|
|
19194
19107
|
if (isCameraStep(step)) {
|
|
19195
|
-
return /* @__PURE__ */ (0,
|
|
19108
|
+
return /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(CameraStep_default, __spreadProps(__spreadValues({}, props), { step }));
|
|
19196
19109
|
}
|
|
19197
|
-
return /* @__PURE__ */ (0,
|
|
19198
|
-
backButton && /* @__PURE__ */ (0,
|
|
19199
|
-
globalError ? /* @__PURE__ */ (0,
|
|
19200
|
-
/* @__PURE__ */ (0,
|
|
19110
|
+
return /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(import_jsx_runtime127.Fragment, { children: [
|
|
19111
|
+
backButton && /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(BackButton_default2, __spreadProps(__spreadValues({}, backButton), { onAction })),
|
|
19112
|
+
globalError ? /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(DynamicAlert_default, { component: { context: "negative", markdown: globalError, margin: "lg" } }) : null,
|
|
19113
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)(LayoutStep_default, __spreadProps(__spreadValues({}, props), { stepSpecification: step }))
|
|
19201
19114
|
] });
|
|
19202
19115
|
}
|
|
19203
19116
|
|
|
19204
19117
|
// src/legacy/dynamicFlow/utils/useDebouncedRefresh/useDebouncedRefresh.ts
|
|
19205
|
-
var
|
|
19118
|
+
var import_react63 = require("react");
|
|
19206
19119
|
var DEBOUNCE_DELAY = 1e3;
|
|
19207
19120
|
function useDebouncedRefresh(fetchRefresh) {
|
|
19208
|
-
const map = (0,
|
|
19121
|
+
const map = (0, import_react63.useRef)(/* @__PURE__ */ new Map());
|
|
19209
19122
|
const retrieveOrCreate = (key) => {
|
|
19210
19123
|
if (map.current.has(key)) {
|
|
19211
19124
|
return map.current.get(key);
|
|
@@ -19237,12 +19150,12 @@ function useDebouncedRefresh(fetchRefresh) {
|
|
|
19237
19150
|
var shouldDebounceSchema = (schema) => getSchemaType(schema) === "basic" && schema.type !== "boolean" && schema.format !== "base64url";
|
|
19238
19151
|
|
|
19239
19152
|
// src/legacy/dynamicFlow/utils/useDynamicFlowState.ts
|
|
19240
|
-
var
|
|
19153
|
+
var import_react64 = require("react");
|
|
19241
19154
|
var useDynamicFlowState = (initialStep) => {
|
|
19242
19155
|
var _a, _b;
|
|
19243
|
-
const [formErrors, setFormErrors] = (0,
|
|
19244
|
-
const [globalError, setGlobalError] = (0,
|
|
19245
|
-
const [stepAndModels, setStepAndModels] = (0,
|
|
19156
|
+
const [formErrors, setFormErrors] = (0, import_react64.useState)((_a = initialStep == null ? void 0 : initialStep.errors) == null ? void 0 : _a.validation);
|
|
19157
|
+
const [globalError, setGlobalError] = (0, import_react64.useState)((_b = initialStep == null ? void 0 : initialStep.errors) == null ? void 0 : _b.error);
|
|
19158
|
+
const [stepAndModels, setStepAndModels] = (0, import_react64.useState)({
|
|
19246
19159
|
step: initialStep || void 0,
|
|
19247
19160
|
models: (initialStep == null ? void 0 : initialStep.model) ? buildInitialModels(initialStep.model, getAllSchemas(initialStep)) : {},
|
|
19248
19161
|
etag: void 0
|
|
@@ -19272,7 +19185,7 @@ var useDynamicFlowState = (initialStep) => {
|
|
|
19272
19185
|
return updatedState;
|
|
19273
19186
|
});
|
|
19274
19187
|
};
|
|
19275
|
-
const modelIsValid = (0,
|
|
19188
|
+
const modelIsValid = (0, import_react64.useMemo)(
|
|
19276
19189
|
() => areModelsValid(models, getAllValidatableSchemas(step)),
|
|
19277
19190
|
[models, step]
|
|
19278
19191
|
);
|
|
@@ -19345,17 +19258,17 @@ var isInlineSchema = (schema) => schema !== void 0 && typeof schema === "object"
|
|
|
19345
19258
|
|
|
19346
19259
|
// src/legacy/dynamicFlow/utils/useLoader.tsx
|
|
19347
19260
|
var import_components77 = require("@transferwise/components");
|
|
19348
|
-
var
|
|
19349
|
-
var
|
|
19261
|
+
var import_react65 = require("react");
|
|
19262
|
+
var import_jsx_runtime128 = require("react/jsx-runtime");
|
|
19350
19263
|
function useLoader(loaderConfig, initialState) {
|
|
19351
19264
|
const config = __spreadValues({
|
|
19352
19265
|
size: import_components77.Size.EXTRA_LARGE,
|
|
19353
19266
|
initial: true,
|
|
19354
19267
|
submission: false
|
|
19355
19268
|
}, loaderConfig);
|
|
19356
|
-
const [loadingState, setLoadingState] = (0,
|
|
19269
|
+
const [loadingState, setLoadingState] = (0, import_react65.useState)(initialState);
|
|
19357
19270
|
const shouldDisplayLoader = config.initial && loadingState === "initial" || config.submission && loadingState === "submission";
|
|
19358
|
-
const loader = shouldDisplayLoader ? /* @__PURE__ */ (0,
|
|
19271
|
+
const loader = shouldDisplayLoader ? /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
19359
19272
|
import_components77.Loader,
|
|
19360
19273
|
{
|
|
19361
19274
|
size: config.size,
|
|
@@ -19475,7 +19388,7 @@ var useErrorResponse = () => {
|
|
|
19475
19388
|
};
|
|
19476
19389
|
|
|
19477
19390
|
// src/legacy/dynamicFlow/DynamicFlow.tsx
|
|
19478
|
-
var
|
|
19391
|
+
var import_jsx_runtime129 = require("react/jsx-runtime");
|
|
19479
19392
|
var noop7 = () => {
|
|
19480
19393
|
};
|
|
19481
19394
|
var DynamicFlowComponent = ({
|
|
@@ -19503,7 +19416,7 @@ var DynamicFlowComponent = ({
|
|
|
19503
19416
|
setStepAndEtag,
|
|
19504
19417
|
setSchemaModel
|
|
19505
19418
|
} = useDynamicFlowState(initialStep);
|
|
19506
|
-
const [submitted, setSubmitted] = (0,
|
|
19419
|
+
const [submitted, setSubmitted] = (0, import_react66.useState)(false);
|
|
19507
19420
|
const { locale } = (0, import_react_intl46.useIntl)();
|
|
19508
19421
|
const { isLoading, loader, setLoadingState } = useLoader(
|
|
19509
19422
|
loaderConfig,
|
|
@@ -19522,18 +19435,18 @@ var DynamicFlowComponent = ({
|
|
|
19522
19435
|
);
|
|
19523
19436
|
}
|
|
19524
19437
|
};
|
|
19525
|
-
const analyticsMetadata = (0,
|
|
19438
|
+
const analyticsMetadata = (0, import_react66.useMemo)(
|
|
19526
19439
|
() => {
|
|
19527
19440
|
var _a;
|
|
19528
19441
|
return __spreadValues({ flowId, stepId: (step == null ? void 0 : step.id) || (step == null ? void 0 : step.key) }, (_a = step == null ? void 0 : step.analytics) != null ? _a : {});
|
|
19529
19442
|
},
|
|
19530
19443
|
[flowId, step]
|
|
19531
19444
|
);
|
|
19532
|
-
const dispatchEvent = (0,
|
|
19445
|
+
const dispatchEvent = (0, import_react66.useMemo)(
|
|
19533
19446
|
() => getEventDispatcher(onEvent, analyticsMetadata),
|
|
19534
19447
|
[onEvent, analyticsMetadata]
|
|
19535
19448
|
);
|
|
19536
|
-
const dfHttpClient = (0,
|
|
19449
|
+
const dfHttpClient = (0, import_react66.useCallback)(
|
|
19537
19450
|
({
|
|
19538
19451
|
action,
|
|
19539
19452
|
data,
|
|
@@ -19586,17 +19499,17 @@ var DynamicFlowComponent = ({
|
|
|
19586
19499
|
dispatchEventAndComplete(__spreadValues(__spreadValues({}, exitResult), actionResult));
|
|
19587
19500
|
};
|
|
19588
19501
|
const { debouncedRefresh, isDebouncing, cancelPendingRefreshes } = useDebouncedRefresh(performRefresh);
|
|
19589
|
-
const dispatchEventAndComplete = (0,
|
|
19502
|
+
const dispatchEventAndComplete = (0, import_react66.useCallback)(
|
|
19590
19503
|
(result) => {
|
|
19591
19504
|
dispatchEvent("Dynamic Flow - Flow Finished", { result: "success" });
|
|
19592
19505
|
onCompletion(result);
|
|
19593
19506
|
},
|
|
19594
19507
|
[onCompletion, dispatchEvent]
|
|
19595
19508
|
);
|
|
19596
|
-
(0,
|
|
19509
|
+
(0, import_react66.useEffect)(() => {
|
|
19597
19510
|
dispatchEvent("Dynamic Flow - Flow Started", {});
|
|
19598
19511
|
}, []);
|
|
19599
|
-
(0,
|
|
19512
|
+
(0, import_react66.useEffect)(() => {
|
|
19600
19513
|
if (!initialStep) {
|
|
19601
19514
|
const action = __spreadValues({
|
|
19602
19515
|
id: "#initial-step-request",
|
|
@@ -19718,7 +19631,7 @@ var DynamicFlowComponent = ({
|
|
|
19718
19631
|
await performAction(action);
|
|
19719
19632
|
}
|
|
19720
19633
|
};
|
|
19721
|
-
return /* @__PURE__ */ (0,
|
|
19634
|
+
return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(LogProvider, { flowId, stepId: (step == null ? void 0 : step.id) || (step == null ? void 0 : step.key), onLog, children: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(EventsContextProvider, { metadata: analyticsMetadata, onEvent, children: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(DynamicFlowProvider, { loading: isLoading || isDebouncing, children: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(HttpClientProvider, { httpClient, children: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(FeatureContextProvider, { features, children: loader !== null ? loader : /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
|
|
19722
19635
|
DynamicFlowStep,
|
|
19723
19636
|
{
|
|
19724
19637
|
step,
|
|
@@ -19735,7 +19648,7 @@ var DynamicFlowComponent = ({
|
|
|
19735
19648
|
) }) }) }) }) });
|
|
19736
19649
|
};
|
|
19737
19650
|
function DynamicFlow(props) {
|
|
19738
|
-
return /* @__PURE__ */ (0,
|
|
19651
|
+
return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(ErrorBoundary_default, { onError: props.onError, children: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(DynamicFlowComponent, __spreadValues({}, props)) });
|
|
19739
19652
|
}
|
|
19740
19653
|
var DynamicFlow_default = DynamicFlow;
|
|
19741
19654
|
var combineModels2 = (formModels) => Object.values(formModels).reduce((previous, model) => __spreadValues(__spreadValues({}, previous), model), {});
|
|
@@ -19752,19 +19665,19 @@ var shouldTriggerRefresh = (props) => {
|
|
|
19752
19665
|
};
|
|
19753
19666
|
|
|
19754
19667
|
// src/legacy/jsonSchemaForm/JsonSchemaForm.tsx
|
|
19755
|
-
var
|
|
19668
|
+
var import_jsx_runtime130 = require("react/jsx-runtime");
|
|
19756
19669
|
function JsonSchemaForm(props) {
|
|
19757
19670
|
const schemaProps = __spreadValues({
|
|
19758
19671
|
model: null,
|
|
19759
19672
|
errors: null
|
|
19760
19673
|
}, props);
|
|
19761
19674
|
const { baseUrl = "", onEvent = noop8, onLog = noop8 } = props;
|
|
19762
|
-
return /* @__PURE__ */ (0,
|
|
19675
|
+
return /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(LogProvider, { flowId: "JsonSchemaForm", stepId: "JsonSchemaForm", onLog, children: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
19763
19676
|
EventsContextProvider,
|
|
19764
19677
|
{
|
|
19765
19678
|
metadata: { flowId: "JsonSchemaForm", stepId: "JsonSchemaForm" },
|
|
19766
19679
|
onEvent,
|
|
19767
|
-
children: /* @__PURE__ */ (0,
|
|
19680
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(HttpClientProviderFromBaseUrl, { baseUrl, children: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(GenericSchema_default, __spreadValues({}, schemaProps)) })
|
|
19768
19681
|
}
|
|
19769
19682
|
) });
|
|
19770
19683
|
}
|