@wise/dynamic-flow-client 3.6.2 → 3.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/main.mjs
CHANGED
|
@@ -34,9 +34,6 @@ var __objRest = (source, exclude) => {
|
|
|
34
34
|
}
|
|
35
35
|
return target;
|
|
36
36
|
};
|
|
37
|
-
var __esm = (fn, res) => function __init() {
|
|
38
|
-
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
39
|
-
};
|
|
40
37
|
var __commonJS = (cb, mod) => function __require() {
|
|
41
38
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
42
39
|
};
|
|
@@ -118,152 +115,6 @@ var require_classnames = __commonJS({
|
|
|
118
115
|
}
|
|
119
116
|
});
|
|
120
117
|
|
|
121
|
-
// ../../node_modules/.pnpm/clsx@2.0.0/node_modules/clsx/dist/clsx.mjs
|
|
122
|
-
function r(e) {
|
|
123
|
-
var t, f, n = "";
|
|
124
|
-
if ("string" == typeof e || "number" == typeof e)
|
|
125
|
-
n += e;
|
|
126
|
-
else if ("object" == typeof e)
|
|
127
|
-
if (Array.isArray(e))
|
|
128
|
-
for (t = 0; t < e.length; t++)
|
|
129
|
-
e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
130
|
-
else
|
|
131
|
-
for (t in e)
|
|
132
|
-
e[t] && (n && (n += " "), n += t);
|
|
133
|
-
return n;
|
|
134
|
-
}
|
|
135
|
-
function clsx() {
|
|
136
|
-
for (var e, t, f = 0, n = ""; f < arguments.length; )
|
|
137
|
-
(e = arguments[f++]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
138
|
-
return n;
|
|
139
|
-
}
|
|
140
|
-
var init_clsx = __esm({
|
|
141
|
-
"../../node_modules/.pnpm/clsx@2.0.0/node_modules/clsx/dist/clsx.mjs"() {
|
|
142
|
-
"use strict";
|
|
143
|
-
}
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
// ../../node_modules/.pnpm/@wise+art@2.10.0_@transferwise+neptune-css@14.9.6_@types+react@18.0.29_react-dom@18.2.0_react@18.2.0/node_modules/@wise/art/dist/index-d9418379.esm.js
|
|
147
|
-
import { useState as useState5, useEffect as useEffect3, forwardRef, Suspense, lazy } from "react";
|
|
148
|
-
import { jsx as jsx20, jsxs as jsxs6, Fragment as Fragment3 } from "react/jsx-runtime";
|
|
149
|
-
var unknownFlagName, Flag, Sizes, ImageSizes, imageSizes, Assets, RenderMode;
|
|
150
|
-
var init_index_d9418379_esm = __esm({
|
|
151
|
-
"../../node_modules/.pnpm/@wise+art@2.10.0_@transferwise+neptune-css@14.9.6_@types+react@18.0.29_react-dom@18.2.0_react@18.2.0/node_modules/@wise/art/dist/index-d9418379.esm.js"() {
|
|
152
|
-
"use strict";
|
|
153
|
-
init_clsx();
|
|
154
|
-
unknownFlagName = "wise";
|
|
155
|
-
Flag = ({
|
|
156
|
-
code,
|
|
157
|
-
intrinsicSize = 64,
|
|
158
|
-
className = void 0
|
|
159
|
-
}) => {
|
|
160
|
-
const [fallback, setFallback] = useState5(null);
|
|
161
|
-
useEffect3(() => {
|
|
162
|
-
setFallback(null);
|
|
163
|
-
}, [code]);
|
|
164
|
-
const detailed = intrinsicSize >= 150;
|
|
165
|
-
const name = fallback !== "unknown" ? `${code.toLowerCase()}${fallback == null && detailed ? "-detailed" : ""}` : unknownFlagName;
|
|
166
|
-
return /* @__PURE__ */ jsx20("img", {
|
|
167
|
-
className: clsx(`wds-flag wds-flag-${name}`, className),
|
|
168
|
-
src: `https://wise.com/web-art/assets/flags/${name}.svg`,
|
|
169
|
-
alt: "",
|
|
170
|
-
width: intrinsicSize,
|
|
171
|
-
height: intrinsicSize,
|
|
172
|
-
onError: () => {
|
|
173
|
-
setFallback((prev) => prev == null && detailed ? "simple" : "unknown");
|
|
174
|
-
}
|
|
175
|
-
});
|
|
176
|
-
};
|
|
177
|
-
(function(Sizes2) {
|
|
178
|
-
Sizes2["SMALL"] = "small";
|
|
179
|
-
Sizes2["MEDIUM"] = "medium";
|
|
180
|
-
Sizes2["LARGE"] = "large";
|
|
181
|
-
})(Sizes || (Sizes = {}));
|
|
182
|
-
ImageSizes = {
|
|
183
|
-
[Sizes.SMALL]: 200,
|
|
184
|
-
[Sizes.MEDIUM]: 300,
|
|
185
|
-
[Sizes.LARGE]: 500
|
|
186
|
-
};
|
|
187
|
-
imageSizes = {
|
|
188
|
-
[Sizes.SMALL]: 200,
|
|
189
|
-
[Sizes.MEDIUM]: 300,
|
|
190
|
-
[Sizes.LARGE]: 500
|
|
191
|
-
};
|
|
192
|
-
(function(Assets2) {
|
|
193
|
-
Assets2["BELL"] = "bell";
|
|
194
|
-
Assets2["BRIEFCASE"] = "briefcase";
|
|
195
|
-
Assets2["BUSINESS_CARD"] = "business-card";
|
|
196
|
-
Assets2["CALENDAR"] = "calendar";
|
|
197
|
-
Assets2["CHECK_MARK"] = "check-mark";
|
|
198
|
-
Assets2["CLOSED_WINDOW"] = "closed-window";
|
|
199
|
-
Assets2["COIN_PILE_DOWN"] = "coin-pile-down";
|
|
200
|
-
Assets2["COIN_PILE_UP"] = "coin-pile-up";
|
|
201
|
-
Assets2["CONFETTI"] = "confetti";
|
|
202
|
-
Assets2["CONSTRUCTION_FENCE"] = "construction-fence";
|
|
203
|
-
Assets2["CONVERT"] = "convert";
|
|
204
|
-
Assets2["COOKIE"] = "cookie";
|
|
205
|
-
Assets2["DIGITAL_CARD_2"] = "digital-card-2";
|
|
206
|
-
Assets2["DIGITAL_CARD"] = "digital-card";
|
|
207
|
-
Assets2["DOCUMENTS"] = "documents";
|
|
208
|
-
Assets2["DOOR"] = "door";
|
|
209
|
-
Assets2["ECO_CARD"] = "eco-card";
|
|
210
|
-
Assets2["ELECTRIC_PLUG"] = "electric-plug";
|
|
211
|
-
Assets2["EMAIL_SUCCESS"] = "email-success";
|
|
212
|
-
Assets2["EMAIL"] = "email";
|
|
213
|
-
Assets2["EXCLAMATION_MARK"] = "exclamation-mark";
|
|
214
|
-
Assets2["FLAG"] = "flag";
|
|
215
|
-
Assets2["FLOWER"] = "flower";
|
|
216
|
-
Assets2["GEAR"] = "gear";
|
|
217
|
-
Assets2["GLOBE"] = "globe";
|
|
218
|
-
Assets2["GRAPH"] = "graph";
|
|
219
|
-
Assets2["HEART_2"] = "heart-2";
|
|
220
|
-
Assets2["HEART_3"] = "heart-3";
|
|
221
|
-
Assets2["HEART_4"] = "heart-4";
|
|
222
|
-
Assets2["HEART_5"] = "heart-5";
|
|
223
|
-
Assets2["HEART"] = "heart";
|
|
224
|
-
Assets2["HOUSE"] = "house";
|
|
225
|
-
Assets2["ID_CARD"] = "id-card";
|
|
226
|
-
Assets2["INFINITE"] = "infinite";
|
|
227
|
-
Assets2["INVITE_LETTER"] = "invite-letter";
|
|
228
|
-
Assets2["JARS"] = "jars";
|
|
229
|
-
Assets2["KEY"] = "key";
|
|
230
|
-
Assets2["LIGHT_BULB"] = "light-bulb";
|
|
231
|
-
Assets2["LOCK"] = "lock";
|
|
232
|
-
Assets2["MAGNIFYING_GLASS"] = "magnifying-glass";
|
|
233
|
-
Assets2["MAP"] = "map";
|
|
234
|
-
Assets2["MARBLE_CARD_BUSINESS"] = "marble-card-business";
|
|
235
|
-
Assets2["MARBLE_CARD"] = "marble-card";
|
|
236
|
-
Assets2["MARBLE"] = "marble";
|
|
237
|
-
Assets2["MEGAPHONE"] = "megaphone";
|
|
238
|
-
Assets2["MULTI_CURRENCY"] = "multi-currency";
|
|
239
|
-
Assets2["ONE_INVITE_LETTER_OPENED"] = "one-invite-letter-opened";
|
|
240
|
-
Assets2["PALM_TREE"] = "palm-tree";
|
|
241
|
-
Assets2["PERCENTAGE"] = "percentage";
|
|
242
|
-
Assets2["PERSONAL_CARD"] = "personal-card";
|
|
243
|
-
Assets2["PHONES"] = "phones";
|
|
244
|
-
Assets2["PIE_CHART"] = "pie-chart";
|
|
245
|
-
Assets2["PLANE_2"] = "plane-2";
|
|
246
|
-
Assets2["PLANE"] = "plane";
|
|
247
|
-
Assets2["PUZZLE_PIECES"] = "puzzle-pieces";
|
|
248
|
-
Assets2["QUESTION_MARK"] = "question-mark";
|
|
249
|
-
Assets2["RECEIVE"] = "receive";
|
|
250
|
-
Assets2["REMINDER_LETTER"] = "reminder-letter";
|
|
251
|
-
Assets2["SAND_TIMER"] = "sand-timer";
|
|
252
|
-
Assets2["SHOPPING_BAG"] = "shopping-bag";
|
|
253
|
-
Assets2["SKIP_AUTHENTICATION"] = "skip-authentication";
|
|
254
|
-
Assets2["SPEECH_BUBBLE"] = "speech-bubble";
|
|
255
|
-
Assets2["TOOL"] = "tool";
|
|
256
|
-
Assets2["TWO_INVITE_LETTERS_OPENED"] = "two-invite-letters-opened";
|
|
257
|
-
Assets2["WALLET"] = "wallet";
|
|
258
|
-
})(Assets || (Assets = {}));
|
|
259
|
-
(function(RenderMode2) {
|
|
260
|
-
RenderMode2[RenderMode2["INIT"] = 0] = "INIT";
|
|
261
|
-
RenderMode2[RenderMode2["FALLBACK"] = 1] = "FALLBACK";
|
|
262
|
-
RenderMode2[RenderMode2["ASSET_3D"] = 2] = "ASSET_3D";
|
|
263
|
-
})(RenderMode || (RenderMode = {}));
|
|
264
|
-
}
|
|
265
|
-
});
|
|
266
|
-
|
|
267
118
|
// ../../node_modules/.pnpm/screenfull@5.2.0/node_modules/screenfull/dist/screenfull.js
|
|
268
119
|
var require_screenfull = __commonJS({
|
|
269
120
|
"../../node_modules/.pnpm/screenfull@5.2.0/node_modules/screenfull/dist/screenfull.js"(exports, module) {
|
|
@@ -1342,6 +1193,7 @@ var debounce = (callback, waitMs) => {
|
|
|
1342
1193
|
clearTimer();
|
|
1343
1194
|
}
|
|
1344
1195
|
};
|
|
1196
|
+
debouncedFn.isPending = () => timeoutId !== null;
|
|
1345
1197
|
return debouncedFn;
|
|
1346
1198
|
};
|
|
1347
1199
|
|
|
@@ -1787,212 +1639,124 @@ import { Alert } from "@transferwise/components";
|
|
|
1787
1639
|
// src/legacy/layout/utils/getNavigationOptionMedia.tsx
|
|
1788
1640
|
import { Avatar, AvatarType } from "@transferwise/components";
|
|
1789
1641
|
|
|
1642
|
+
// ../../node_modules/.pnpm/@wise+art@2.7.0_react-dom@18.2.0_react@18.2.0/node_modules/@wise/art/dist/index.esm.js
|
|
1643
|
+
import { useState as useState3, useEffect as useEffect2, forwardRef } from "react";
|
|
1644
|
+
import { jsx as jsx6, jsxs, Fragment } from "react/jsx-runtime";
|
|
1645
|
+
var unknownFlagName = "wise";
|
|
1646
|
+
var Flag = ({
|
|
1647
|
+
code,
|
|
1648
|
+
intrinsicSize = 64
|
|
1649
|
+
}) => {
|
|
1650
|
+
const [fallback, setFallback] = useState3(null);
|
|
1651
|
+
useEffect2(() => {
|
|
1652
|
+
setFallback(null);
|
|
1653
|
+
}, [code]);
|
|
1654
|
+
const detailed = intrinsicSize >= 150;
|
|
1655
|
+
const name = fallback !== "unknown" ? `${code.toLowerCase()}${fallback == null && detailed ? "-detailed" : ""}` : unknownFlagName;
|
|
1656
|
+
return /* @__PURE__ */ jsx6("img", {
|
|
1657
|
+
src: `https://wise.com/web-art/assets/flags/${name}.svg`,
|
|
1658
|
+
alt: "",
|
|
1659
|
+
width: intrinsicSize,
|
|
1660
|
+
height: intrinsicSize,
|
|
1661
|
+
onError: () => {
|
|
1662
|
+
setFallback((prev) => prev == null && detailed ? "simple" : "unknown");
|
|
1663
|
+
}
|
|
1664
|
+
});
|
|
1665
|
+
};
|
|
1666
|
+
var Sizes;
|
|
1667
|
+
(function(Sizes2) {
|
|
1668
|
+
Sizes2["SMALL"] = "small";
|
|
1669
|
+
Sizes2["MEDIUM"] = "medium";
|
|
1670
|
+
Sizes2["LARGE"] = "large";
|
|
1671
|
+
})(Sizes || (Sizes = {}));
|
|
1672
|
+
var imageSizes = {
|
|
1673
|
+
[Sizes.SMALL]: 200,
|
|
1674
|
+
[Sizes.MEDIUM]: 300,
|
|
1675
|
+
[Sizes.LARGE]: 500
|
|
1676
|
+
};
|
|
1677
|
+
var Assets;
|
|
1678
|
+
(function(Assets2) {
|
|
1679
|
+
Assets2["BELL"] = "bell";
|
|
1680
|
+
Assets2["BRIEFCASE"] = "briefcase";
|
|
1681
|
+
Assets2["BUSINESS_CARD"] = "business-card";
|
|
1682
|
+
Assets2["CALENDAR"] = "calendar";
|
|
1683
|
+
Assets2["CHECK_MARK"] = "check-mark";
|
|
1684
|
+
Assets2["CLOSED_WINDOW"] = "closed-window";
|
|
1685
|
+
Assets2["COIN_PILE_DOWN"] = "coin-pile-down";
|
|
1686
|
+
Assets2["COIN_PILE_UP"] = "coin-pile-up";
|
|
1687
|
+
Assets2["CONFETTI"] = "confetti";
|
|
1688
|
+
Assets2["CONSTRUCTION_FENCE"] = "construction-fence";
|
|
1689
|
+
Assets2["CONVERT"] = "convert";
|
|
1690
|
+
Assets2["COOKIE"] = "cookie";
|
|
1691
|
+
Assets2["DIGITAL_CARD_2"] = "digital-card-2";
|
|
1692
|
+
Assets2["DIGITAL_CARD"] = "digital-card";
|
|
1693
|
+
Assets2["DOCUMENTS"] = "documents";
|
|
1694
|
+
Assets2["DOOR"] = "door";
|
|
1695
|
+
Assets2["ECO_CARD"] = "eco-card";
|
|
1696
|
+
Assets2["ELECTRIC_PLUG"] = "electric-plug";
|
|
1697
|
+
Assets2["EMAIL_SUCCESS"] = "email-success";
|
|
1698
|
+
Assets2["EMAIL"] = "email";
|
|
1699
|
+
Assets2["EXCLAMATION_MARK"] = "exclamation-mark";
|
|
1700
|
+
Assets2["FLAG"] = "flag";
|
|
1701
|
+
Assets2["FLOWER"] = "flower";
|
|
1702
|
+
Assets2["GEAR"] = "gear";
|
|
1703
|
+
Assets2["GLOBE"] = "globe";
|
|
1704
|
+
Assets2["GRAPH"] = "graph";
|
|
1705
|
+
Assets2["HEART_2"] = "heart-2";
|
|
1706
|
+
Assets2["HEART_3"] = "heart-3";
|
|
1707
|
+
Assets2["HEART_4"] = "heart-4";
|
|
1708
|
+
Assets2["HEART_5"] = "heart-5";
|
|
1709
|
+
Assets2["HEART"] = "heart";
|
|
1710
|
+
Assets2["HOUSE"] = "house";
|
|
1711
|
+
Assets2["ID_CARD"] = "id-card";
|
|
1712
|
+
Assets2["INFINITE"] = "infinite";
|
|
1713
|
+
Assets2["INVITE_LETTER"] = "invite-letter";
|
|
1714
|
+
Assets2["JARS"] = "jars";
|
|
1715
|
+
Assets2["KEY"] = "key";
|
|
1716
|
+
Assets2["LIGHT_BULB"] = "light-bulb";
|
|
1717
|
+
Assets2["LOCK"] = "lock";
|
|
1718
|
+
Assets2["MAGNIFYING_GLASS"] = "magnifying-glass";
|
|
1719
|
+
Assets2["MAP"] = "map";
|
|
1720
|
+
Assets2["MARBLE_CARD_BUSINESS"] = "marble-card-business";
|
|
1721
|
+
Assets2["MARBLE_CARD"] = "marble-card";
|
|
1722
|
+
Assets2["MARBLE"] = "marble";
|
|
1723
|
+
Assets2["MEGAPHONE"] = "megaphone";
|
|
1724
|
+
Assets2["MULTI_CURRENCY"] = "multi-currency";
|
|
1725
|
+
Assets2["ONE_INVITE_LETTER_OPENED"] = "one-invite-letter-opened";
|
|
1726
|
+
Assets2["PALM_TREE"] = "palm-tree";
|
|
1727
|
+
Assets2["PERCENTAGE"] = "percentage";
|
|
1728
|
+
Assets2["PERSONAL_CARD"] = "personal-card";
|
|
1729
|
+
Assets2["PHONES"] = "phones";
|
|
1730
|
+
Assets2["PIE_CHART"] = "pie-chart";
|
|
1731
|
+
Assets2["PLANE_2"] = "plane-2";
|
|
1732
|
+
Assets2["PLANE"] = "plane";
|
|
1733
|
+
Assets2["PUZZLE_PIECES"] = "puzzle-pieces";
|
|
1734
|
+
Assets2["QUESTION_MARK"] = "question-mark";
|
|
1735
|
+
Assets2["RECEIVE"] = "receive";
|
|
1736
|
+
Assets2["REMINDER_LETTER"] = "reminder-letter";
|
|
1737
|
+
Assets2["SAND_TIMER"] = "sand-timer";
|
|
1738
|
+
Assets2["SHOPPING_BAG"] = "shopping-bag";
|
|
1739
|
+
Assets2["SKIP_AUTHENTICATION"] = "skip-authentication";
|
|
1740
|
+
Assets2["SPEECH_BUBBLE"] = "speech-bubble";
|
|
1741
|
+
Assets2["TOOL"] = "tool";
|
|
1742
|
+
Assets2["TWO_INVITE_LETTERS_OPENED"] = "two-invite-letters-opened";
|
|
1743
|
+
Assets2["WALLET"] = "wallet";
|
|
1744
|
+
})(Assets || (Assets = {}));
|
|
1745
|
+
|
|
1790
1746
|
// src/legacy/layout/icon/FlagIcon.tsx
|
|
1791
|
-
import { jsx as
|
|
1792
|
-
var isFlagIcon = (name) =>
|
|
1793
|
-
var isCurrencyFlagIcon = (name) => currencyCodes.some((currencyCode) => name === `flag-${currencyCode}`);
|
|
1794
|
-
var isCountryFlagIcon = (name) => countryCodes.some((countryCode) => name === `flag-${countryCode}`);
|
|
1747
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
1748
|
+
var isFlagIcon = (name) => name.startsWith("flag-");
|
|
1795
1749
|
function FlagIcon({ name }) {
|
|
1796
1750
|
if (!isFlagIcon(name)) {
|
|
1797
1751
|
return null;
|
|
1798
1752
|
}
|
|
1799
1753
|
const code = name.substring(5);
|
|
1800
|
-
return /* @__PURE__ */
|
|
1801
|
-
"img",
|
|
1802
|
-
{
|
|
1803
|
-
src: `https://wise.com/web-art/assets/flags/${code}.svg`,
|
|
1804
|
-
alt: "",
|
|
1805
|
-
"data-testid": `img-flag-${code}`,
|
|
1806
|
-
width: "24px"
|
|
1807
|
-
}
|
|
1808
|
-
);
|
|
1754
|
+
return /* @__PURE__ */ jsx7(Flag, { intrinsicSize: 24, code });
|
|
1809
1755
|
}
|
|
1810
|
-
var currencyCodes = [
|
|
1811
|
-
"aed",
|
|
1812
|
-
"ars",
|
|
1813
|
-
"aud",
|
|
1814
|
-
"bdt",
|
|
1815
|
-
"bgn",
|
|
1816
|
-
"bhd",
|
|
1817
|
-
"bnd",
|
|
1818
|
-
"brl",
|
|
1819
|
-
"bwp",
|
|
1820
|
-
"cad",
|
|
1821
|
-
"chf",
|
|
1822
|
-
"clp",
|
|
1823
|
-
"cny",
|
|
1824
|
-
"cop",
|
|
1825
|
-
"crc",
|
|
1826
|
-
"czk",
|
|
1827
|
-
"dkk",
|
|
1828
|
-
"egp",
|
|
1829
|
-
"eur",
|
|
1830
|
-
"fjd",
|
|
1831
|
-
"gbp",
|
|
1832
|
-
"gel",
|
|
1833
|
-
"ghs",
|
|
1834
|
-
"gtq",
|
|
1835
|
-
"hkd",
|
|
1836
|
-
"hrk",
|
|
1837
|
-
"huf",
|
|
1838
|
-
"idr",
|
|
1839
|
-
"ils",
|
|
1840
|
-
"imp",
|
|
1841
|
-
"inr",
|
|
1842
|
-
"isk",
|
|
1843
|
-
"jmd",
|
|
1844
|
-
"jpy",
|
|
1845
|
-
"kes",
|
|
1846
|
-
"krw",
|
|
1847
|
-
"kwd",
|
|
1848
|
-
"lak",
|
|
1849
|
-
"lkr",
|
|
1850
|
-
"lsl",
|
|
1851
|
-
"mad",
|
|
1852
|
-
"mur",
|
|
1853
|
-
"mxn",
|
|
1854
|
-
"myr",
|
|
1855
|
-
"mzn",
|
|
1856
|
-
"nad",
|
|
1857
|
-
"ngn",
|
|
1858
|
-
"nok",
|
|
1859
|
-
"npr",
|
|
1860
|
-
"nzd",
|
|
1861
|
-
"omr",
|
|
1862
|
-
"pab",
|
|
1863
|
-
"pen",
|
|
1864
|
-
"php",
|
|
1865
|
-
"pkr",
|
|
1866
|
-
"pln",
|
|
1867
|
-
"qar",
|
|
1868
|
-
"ron",
|
|
1869
|
-
"rub",
|
|
1870
|
-
"sar",
|
|
1871
|
-
"sek",
|
|
1872
|
-
"sgd",
|
|
1873
|
-
"thb",
|
|
1874
|
-
"tmt",
|
|
1875
|
-
"try",
|
|
1876
|
-
"twd",
|
|
1877
|
-
"tzs",
|
|
1878
|
-
"uah",
|
|
1879
|
-
"ugx",
|
|
1880
|
-
"usd",
|
|
1881
|
-
"uyu",
|
|
1882
|
-
"vnd",
|
|
1883
|
-
"xof",
|
|
1884
|
-
"zar",
|
|
1885
|
-
"zmw"
|
|
1886
|
-
];
|
|
1887
|
-
var countryCodes = [
|
|
1888
|
-
"ad",
|
|
1889
|
-
"ae",
|
|
1890
|
-
"ar",
|
|
1891
|
-
"at",
|
|
1892
|
-
"au",
|
|
1893
|
-
"bd",
|
|
1894
|
-
"be",
|
|
1895
|
-
"bg",
|
|
1896
|
-
"bh",
|
|
1897
|
-
"bn",
|
|
1898
|
-
"br",
|
|
1899
|
-
"bw",
|
|
1900
|
-
"ca",
|
|
1901
|
-
"ch",
|
|
1902
|
-
"cl",
|
|
1903
|
-
"cn",
|
|
1904
|
-
"co",
|
|
1905
|
-
"cr",
|
|
1906
|
-
"cy",
|
|
1907
|
-
"cz",
|
|
1908
|
-
"de",
|
|
1909
|
-
"dk",
|
|
1910
|
-
"ee",
|
|
1911
|
-
"eg",
|
|
1912
|
-
"es",
|
|
1913
|
-
"eu",
|
|
1914
|
-
"fi",
|
|
1915
|
-
"fj",
|
|
1916
|
-
"fr",
|
|
1917
|
-
"gb",
|
|
1918
|
-
"ge",
|
|
1919
|
-
"gg",
|
|
1920
|
-
"gh",
|
|
1921
|
-
"gp",
|
|
1922
|
-
"gr",
|
|
1923
|
-
"gt",
|
|
1924
|
-
"hk",
|
|
1925
|
-
"hr",
|
|
1926
|
-
"hu",
|
|
1927
|
-
"id",
|
|
1928
|
-
"ie",
|
|
1929
|
-
"il",
|
|
1930
|
-
"im",
|
|
1931
|
-
"in",
|
|
1932
|
-
"is",
|
|
1933
|
-
"it",
|
|
1934
|
-
"je",
|
|
1935
|
-
"jm",
|
|
1936
|
-
"jp",
|
|
1937
|
-
"ke",
|
|
1938
|
-
"kr",
|
|
1939
|
-
"kw",
|
|
1940
|
-
"la",
|
|
1941
|
-
"li",
|
|
1942
|
-
"lk",
|
|
1943
|
-
"ls",
|
|
1944
|
-
"lt",
|
|
1945
|
-
"lu",
|
|
1946
|
-
"lv",
|
|
1947
|
-
"ma",
|
|
1948
|
-
"mc",
|
|
1949
|
-
"mt",
|
|
1950
|
-
"mu",
|
|
1951
|
-
"mx",
|
|
1952
|
-
"my",
|
|
1953
|
-
"mz",
|
|
1954
|
-
"na",
|
|
1955
|
-
"ng",
|
|
1956
|
-
"nl",
|
|
1957
|
-
"no",
|
|
1958
|
-
"np",
|
|
1959
|
-
"nz",
|
|
1960
|
-
"om",
|
|
1961
|
-
"pa",
|
|
1962
|
-
"pe",
|
|
1963
|
-
"ph",
|
|
1964
|
-
"pk",
|
|
1965
|
-
"pl",
|
|
1966
|
-
"pt",
|
|
1967
|
-
"qa",
|
|
1968
|
-
"ro",
|
|
1969
|
-
"ru",
|
|
1970
|
-
"sa",
|
|
1971
|
-
"se",
|
|
1972
|
-
"sg",
|
|
1973
|
-
"si",
|
|
1974
|
-
"sk",
|
|
1975
|
-
"sm",
|
|
1976
|
-
"th",
|
|
1977
|
-
"tm",
|
|
1978
|
-
"tr",
|
|
1979
|
-
"tw",
|
|
1980
|
-
"tz",
|
|
1981
|
-
"ua",
|
|
1982
|
-
"ug",
|
|
1983
|
-
"us",
|
|
1984
|
-
"uy",
|
|
1985
|
-
"va",
|
|
1986
|
-
"vn",
|
|
1987
|
-
"wi",
|
|
1988
|
-
"xo",
|
|
1989
|
-
"za",
|
|
1990
|
-
"zm"
|
|
1991
|
-
];
|
|
1992
1756
|
|
|
1993
1757
|
// src/legacy/layout/icon/NamedIcon.tsx
|
|
1994
1758
|
import * as icons from "@transferwise/icons";
|
|
1995
|
-
import { jsx as
|
|
1759
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
1996
1760
|
var isNamedIcon = (name) => {
|
|
1997
1761
|
const iconName = toCapitalisedCamelCase(name);
|
|
1998
1762
|
return Object.keys(icons).includes(iconName);
|
|
@@ -2003,19 +1767,19 @@ function NamedIcon({ name }) {
|
|
|
2003
1767
|
}
|
|
2004
1768
|
const iconName = toCapitalisedCamelCase(name);
|
|
2005
1769
|
const Icon = icons[iconName];
|
|
2006
|
-
return /* @__PURE__ */
|
|
1770
|
+
return /* @__PURE__ */ jsx8(Icon, { size: 24 });
|
|
2007
1771
|
}
|
|
2008
1772
|
var toCapitalisedCamelCase = (value) => value.split("-").map(capitaliseFirstChar).join("");
|
|
2009
1773
|
var capitaliseFirstChar = (value) => `${value[0].toUpperCase()}${value.slice(1)}`;
|
|
2010
1774
|
|
|
2011
1775
|
// src/legacy/layout/icon/DynamicIcon.tsx
|
|
2012
|
-
import { jsx as
|
|
1776
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
2013
1777
|
function DynamicIcon({ type }) {
|
|
2014
1778
|
if (isFlagIcon(type)) {
|
|
2015
|
-
return /* @__PURE__ */
|
|
1779
|
+
return /* @__PURE__ */ jsx9(FlagIcon, { name: type });
|
|
2016
1780
|
}
|
|
2017
1781
|
if (isNamedIcon(type)) {
|
|
2018
|
-
return /* @__PURE__ */
|
|
1782
|
+
return /* @__PURE__ */ jsx9(NamedIcon, { name: type });
|
|
2019
1783
|
}
|
|
2020
1784
|
return null;
|
|
2021
1785
|
}
|
|
@@ -2025,17 +1789,17 @@ function isValidIconName(name) {
|
|
|
2025
1789
|
var DynamicIcon_default = DynamicIcon;
|
|
2026
1790
|
|
|
2027
1791
|
// src/legacy/layout/utils/getNavigationOptionMedia.tsx
|
|
2028
|
-
import { jsx as
|
|
1792
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
2029
1793
|
var getNavigationOptionMedia = ({ icon, image }) => {
|
|
2030
1794
|
if (icon == null ? void 0 : icon.name) {
|
|
2031
|
-
return /* @__PURE__ */
|
|
1795
|
+
return /* @__PURE__ */ jsx10(Avatar, { type: AvatarType.ICON, children: /* @__PURE__ */ jsx10(DynamicIcon_default, { type: icon.name }) });
|
|
2032
1796
|
}
|
|
2033
1797
|
if (icon == null ? void 0 : icon.text) {
|
|
2034
|
-
return /* @__PURE__ */
|
|
1798
|
+
return /* @__PURE__ */ jsx10(Avatar, { type: AvatarType.INITIALS, children: icon.text });
|
|
2035
1799
|
}
|
|
2036
1800
|
if (image == null ? void 0 : image.url) {
|
|
2037
1801
|
const { url, text } = image;
|
|
2038
|
-
return /* @__PURE__ */
|
|
1802
|
+
return /* @__PURE__ */ jsx10("img", { src: url, alt: text });
|
|
2039
1803
|
}
|
|
2040
1804
|
return null;
|
|
2041
1805
|
};
|
|
@@ -2071,10 +1835,10 @@ var getTextAlignment = (align) => {
|
|
|
2071
1835
|
var getTextAlignmentAndMargin = (component) => `${getTextAlignment(component.align)} ${getMargin(component.margin)}`;
|
|
2072
1836
|
|
|
2073
1837
|
// src/legacy/layout/alert/DynamicAlert.tsx
|
|
2074
|
-
import { jsx as
|
|
1838
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
2075
1839
|
var DynamicAlert = (props) => {
|
|
2076
1840
|
const alert = props.component;
|
|
2077
|
-
return /* @__PURE__ */
|
|
1841
|
+
return /* @__PURE__ */ jsx11(
|
|
2078
1842
|
Alert,
|
|
2079
1843
|
{
|
|
2080
1844
|
type: mapContextToAlertType(legacy_mapContext(alert.context)),
|
|
@@ -2107,12 +1871,12 @@ var mapContextToAlertType = (context) => {
|
|
|
2107
1871
|
var DynamicAlert_default = DynamicAlert;
|
|
2108
1872
|
|
|
2109
1873
|
// src/legacy/layout/box/DynamicBox.tsx
|
|
2110
|
-
import { jsx as
|
|
1874
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
2111
1875
|
var DynamicBox = (props) => {
|
|
2112
1876
|
const box = props.component;
|
|
2113
1877
|
const margin = getMargin(box.margin || box.border ? "lg" : "xs");
|
|
2114
1878
|
if (!box.width || box.width === "xl") {
|
|
2115
|
-
return /* @__PURE__ */
|
|
1879
|
+
return /* @__PURE__ */ jsx12("div", { className: margin + getBorderClass(box.border), children: /* @__PURE__ */ jsx12(
|
|
2116
1880
|
DynamicLayout_default,
|
|
2117
1881
|
{
|
|
2118
1882
|
components: box.components,
|
|
@@ -2125,7 +1889,7 @@ var DynamicBox = (props) => {
|
|
|
2125
1889
|
}
|
|
2126
1890
|
) });
|
|
2127
1891
|
}
|
|
2128
|
-
return /* @__PURE__ */
|
|
1892
|
+
return /* @__PURE__ */ jsx12("div", { className: "row", children: /* @__PURE__ */ jsx12("div", { className: margin + getBoxWidthClasses(box), children: /* @__PURE__ */ jsx12("div", { className: getBorderClass(box.border), children: /* @__PURE__ */ jsx12(
|
|
2129
1893
|
DynamicLayout_default,
|
|
2130
1894
|
{
|
|
2131
1895
|
components: box.components,
|
|
@@ -2209,7 +1973,7 @@ var getButtonSize = (size) => {
|
|
|
2209
1973
|
};
|
|
2210
1974
|
|
|
2211
1975
|
// src/legacy/layout/button/DynamicButton.tsx
|
|
2212
|
-
import { jsx as
|
|
1976
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
2213
1977
|
function DynamicButton(props) {
|
|
2214
1978
|
var _a;
|
|
2215
1979
|
const { component, onAction } = props;
|
|
@@ -2218,7 +1982,7 @@ function DynamicButton(props) {
|
|
|
2218
1982
|
const priority = getButtonPriority(component);
|
|
2219
1983
|
const { loading } = useDynamicFlow();
|
|
2220
1984
|
const className = getMargin(component.margin || "md");
|
|
2221
|
-
return /* @__PURE__ */
|
|
1985
|
+
return /* @__PURE__ */ jsx13(
|
|
2222
1986
|
Button,
|
|
2223
1987
|
{
|
|
2224
1988
|
size: getButtonSize(component.size),
|
|
@@ -2235,12 +1999,12 @@ function DynamicButton(props) {
|
|
|
2235
1999
|
var DynamicButton_default = DynamicButton;
|
|
2236
2000
|
|
|
2237
2001
|
// src/legacy/layout/columns/DynamicColumns.tsx
|
|
2238
|
-
import { jsx as
|
|
2002
|
+
import { jsx as jsx14, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
2239
2003
|
var DynamicColumns = (props) => {
|
|
2240
2004
|
const columns = props.component;
|
|
2241
2005
|
const { leftWidth, rightWidth } = getWidth(columns.bias);
|
|
2242
|
-
return /* @__PURE__ */
|
|
2243
|
-
/* @__PURE__ */
|
|
2006
|
+
return /* @__PURE__ */ jsxs2("div", { className: `${getMargin(columns.margin || "xs")} row`, children: [
|
|
2007
|
+
/* @__PURE__ */ jsx14("div", { className: `${leftWidth} m-b-0`, children: /* @__PURE__ */ jsx14(
|
|
2244
2008
|
DynamicLayout_default,
|
|
2245
2009
|
{
|
|
2246
2010
|
components: columns.left,
|
|
@@ -2252,7 +2016,7 @@ var DynamicColumns = (props) => {
|
|
|
2252
2016
|
onPersistAsync: props.onPersistAsync
|
|
2253
2017
|
}
|
|
2254
2018
|
) }),
|
|
2255
|
-
/* @__PURE__ */
|
|
2019
|
+
/* @__PURE__ */ jsx14("div", { className: `${rightWidth} m-b-0`, children: /* @__PURE__ */ jsx14(
|
|
2256
2020
|
DynamicLayout_default,
|
|
2257
2021
|
{
|
|
2258
2022
|
components: columns.right,
|
|
@@ -2288,10 +2052,10 @@ var DynamicColumns_default = DynamicColumns;
|
|
|
2288
2052
|
|
|
2289
2053
|
// src/legacy/layout/decision/DynamicDecision.tsx
|
|
2290
2054
|
import { NavigationOption, NavigationOptionsList } from "@transferwise/components";
|
|
2291
|
-
import { jsx as
|
|
2055
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
2292
2056
|
function DynamicDecision({ component, onAction }) {
|
|
2293
2057
|
const { loading } = useDynamicFlow();
|
|
2294
|
-
return /* @__PURE__ */
|
|
2058
|
+
return /* @__PURE__ */ jsx15("div", { className: getMargin(component.margin), children: /* @__PURE__ */ jsx15(NavigationOptionsList, { children: component.options.map((option) => /* @__PURE__ */ jsx15(
|
|
2295
2059
|
NavigationOption,
|
|
2296
2060
|
{
|
|
2297
2061
|
title: option.title,
|
|
@@ -2308,17 +2072,17 @@ function DynamicDecision({ component, onAction }) {
|
|
|
2308
2072
|
var DynamicDecision_default = DynamicDecision;
|
|
2309
2073
|
|
|
2310
2074
|
// src/legacy/layout/divider/DynamicDivider.tsx
|
|
2311
|
-
import { jsx as
|
|
2075
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
2312
2076
|
var DynamicDivider = ({ component }) => {
|
|
2313
2077
|
const margin = getMargin(component.margin);
|
|
2314
2078
|
const className = `m-t-0 ${margin}`;
|
|
2315
|
-
return /* @__PURE__ */
|
|
2079
|
+
return /* @__PURE__ */ jsx16("hr", { className });
|
|
2316
2080
|
};
|
|
2317
2081
|
var DynamicDivider_default = DynamicDivider;
|
|
2318
2082
|
|
|
2319
2083
|
// src/legacy/layout/external/DynamicExternal.tsx
|
|
2320
2084
|
import { Button as Button2, Loader, Size as Size2 } from "@transferwise/components";
|
|
2321
|
-
import { useCallback as useCallback4, useEffect as
|
|
2085
|
+
import { useCallback as useCallback4, useEffect as useEffect3 } from "react";
|
|
2322
2086
|
import { useIntl } from "react-intl";
|
|
2323
2087
|
|
|
2324
2088
|
// src/legacy/layout/external/DynamicExternal.messages.ts
|
|
@@ -2332,7 +2096,7 @@ var DynamicExternal_messages_default = defineMessages2({
|
|
|
2332
2096
|
});
|
|
2333
2097
|
|
|
2334
2098
|
// src/legacy/layout/external/DynamicExternal.tsx
|
|
2335
|
-
import { Fragment, jsx as
|
|
2099
|
+
import { Fragment as Fragment2, jsx as jsx17, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
2336
2100
|
var DynamicExternal = ({ component, onAction }) => {
|
|
2337
2101
|
const { requestUrl, responseHandlers, polling, retryTitle } = component;
|
|
2338
2102
|
const intl = useIntl();
|
|
@@ -2340,17 +2104,17 @@ var DynamicExternal = ({ component, onAction }) => {
|
|
|
2340
2104
|
() => window.open(requestUrl, "df-external-window"),
|
|
2341
2105
|
[requestUrl]
|
|
2342
2106
|
);
|
|
2343
|
-
|
|
2107
|
+
useEffect3(() => {
|
|
2344
2108
|
openExternalUrl();
|
|
2345
2109
|
}, [openExternalUrl]);
|
|
2346
2110
|
const pollingConfiguration = polling && responseHandlers ? __spreadProps(__spreadValues({}, polling), {
|
|
2347
2111
|
responseHandlers
|
|
2348
2112
|
}) : void 0;
|
|
2349
2113
|
useExternalStepPolling(pollingConfiguration, onAction);
|
|
2350
|
-
return /* @__PURE__ */
|
|
2351
|
-
/* @__PURE__ */
|
|
2352
|
-
/* @__PURE__ */
|
|
2353
|
-
/* @__PURE__ */
|
|
2114
|
+
return /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
2115
|
+
/* @__PURE__ */ jsx17(Loader, { size: Size2.LARGE, classNames: { "tw-loader": "tw-loader m-x-auto" } }),
|
|
2116
|
+
/* @__PURE__ */ jsx17("br", {}),
|
|
2117
|
+
/* @__PURE__ */ jsx17(Button2, { priority: "tertiary", block: true, onClick: openExternalUrl, children: retryTitle || intl.formatMessage(DynamicExternal_messages_default.retryTitle) })
|
|
2354
2118
|
] });
|
|
2355
2119
|
};
|
|
2356
2120
|
var DynamicExternal_default = DynamicExternal;
|
|
@@ -2361,8 +2125,8 @@ import { useEffect as useEffect10 } from "react";
|
|
|
2361
2125
|
// src/legacy/jsonSchemaForm/allOfSchema/AllOfSchema.tsx
|
|
2362
2126
|
var import_classnames = __toESM(require_classnames());
|
|
2363
2127
|
import { Header } from "@transferwise/components";
|
|
2364
|
-
import { useState as
|
|
2365
|
-
import { Fragment as
|
|
2128
|
+
import { useState as useState4 } from "react";
|
|
2129
|
+
import { Fragment as Fragment3, jsx as jsx18, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
2366
2130
|
var splitModel = (model, schemas) => schemas.map((schema) => getValidObjectModelParts(model, schema) || {});
|
|
2367
2131
|
var combineModels = (models) => models.reduce((current, combined) => __spreadValues(__spreadValues({}, combined), current), {});
|
|
2368
2132
|
var getSchemaColumnClasses = (width) => ({
|
|
@@ -2377,13 +2141,13 @@ function AllOfSchema(props) {
|
|
|
2377
2141
|
setModels(models);
|
|
2378
2142
|
props.onChange(__spreadProps(__spreadValues({}, onChangeProps), { model: combineModels(models) }));
|
|
2379
2143
|
};
|
|
2380
|
-
const [models, setModels] =
|
|
2381
|
-
return /* @__PURE__ */
|
|
2382
|
-
props.schema.title && /* @__PURE__ */
|
|
2383
|
-
props.schema.description && /* @__PURE__ */
|
|
2384
|
-
/* @__PURE__ */
|
|
2144
|
+
const [models, setModels] = useState4(splitModel(props.model, props.schema.allOf));
|
|
2145
|
+
return /* @__PURE__ */ jsxs4(Fragment3, { children: [
|
|
2146
|
+
props.schema.title && /* @__PURE__ */ jsx18(Header, { title: props.schema.title }),
|
|
2147
|
+
props.schema.description && /* @__PURE__ */ jsx18("p", { children: props.schema.description }),
|
|
2148
|
+
/* @__PURE__ */ jsx18("div", { className: "row", children: props.schema.allOf.map((schema, index) => (
|
|
2385
2149
|
// eslint-disable-next-line react/no-array-index-key
|
|
2386
|
-
/* @__PURE__ */
|
|
2150
|
+
/* @__PURE__ */ jsx18("div", { className: (0, import_classnames.default)(getSchemaColumnClasses(schema.width)), children: /* @__PURE__ */ jsx18(
|
|
2387
2151
|
GenericSchema_default,
|
|
2388
2152
|
{
|
|
2389
2153
|
schema,
|
|
@@ -2412,7 +2176,7 @@ import {
|
|
|
2412
2176
|
Status,
|
|
2413
2177
|
UploadInput
|
|
2414
2178
|
} from "@transferwise/components";
|
|
2415
|
-
import { useMemo as useMemo6, useState as
|
|
2179
|
+
import { useMemo as useMemo6, useState as useState5 } from "react";
|
|
2416
2180
|
|
|
2417
2181
|
// src/legacy/jsonSchemaForm/controlFeedback/ControlFeedback.tsx
|
|
2418
2182
|
import { InlineAlert } from "@transferwise/components";
|
|
@@ -2490,7 +2254,7 @@ var validation_messages_default = defineMessages4({
|
|
|
2490
2254
|
});
|
|
2491
2255
|
|
|
2492
2256
|
// src/legacy/jsonSchemaForm/controlFeedback/ControlFeedback.tsx
|
|
2493
|
-
import { jsx as
|
|
2257
|
+
import { jsx as jsx19, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
2494
2258
|
function ControlFeedback(props) {
|
|
2495
2259
|
var _a;
|
|
2496
2260
|
const defaultValidationMessages = useDefaultValidationMessages(props.schema);
|
|
@@ -2499,12 +2263,12 @@ function ControlFeedback(props) {
|
|
|
2499
2263
|
const isValidationVisible = !isErrorVisible && (props.submitted || props.changed && props.blurred) && Boolean((_a = props.validations) == null ? void 0 : _a.length);
|
|
2500
2264
|
const isDescriptionVisible = props.schema.type !== "boolean" && props.schema.description && !isErrorVisible && !isValidationVisible;
|
|
2501
2265
|
const hasInfoMessage = Boolean(props.infoMessage);
|
|
2502
|
-
return /* @__PURE__ */
|
|
2503
|
-
isErrorVisible ? /* @__PURE__ */
|
|
2504
|
-
isValidationVisible ? /* @__PURE__ */
|
|
2505
|
-
(isDescriptionVisible || hasInfoMessage) && /* @__PURE__ */
|
|
2506
|
-
isDescriptionVisible && /* @__PURE__ */
|
|
2507
|
-
hasInfoMessage && /* @__PURE__ */
|
|
2266
|
+
return /* @__PURE__ */ jsxs5("div", { id: props.id, children: [
|
|
2267
|
+
isErrorVisible ? /* @__PURE__ */ jsx19(InlineAlert, { type: "error", children: props.errors }) : null,
|
|
2268
|
+
isValidationVisible ? /* @__PURE__ */ jsx19(InlineAlert, { type: "error", children: props.validations.map((validation) => /* @__PURE__ */ jsx19("div", { children: validationMessages[validation] }, validation)) }) : null,
|
|
2269
|
+
(isDescriptionVisible || hasInfoMessage) && /* @__PURE__ */ jsxs5(InlineAlert, { type: "info", children: [
|
|
2270
|
+
isDescriptionVisible && /* @__PURE__ */ jsx19("div", { children: props.schema.description }),
|
|
2271
|
+
hasInfoMessage && /* @__PURE__ */ jsx19("div", { children: props.infoMessage })
|
|
2508
2272
|
] })
|
|
2509
2273
|
] });
|
|
2510
2274
|
}
|
|
@@ -2650,15 +2414,15 @@ function useFormattedDefaultErrorMessages({
|
|
|
2650
2414
|
}
|
|
2651
2415
|
|
|
2652
2416
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.tsx
|
|
2653
|
-
import { jsx as
|
|
2417
|
+
import { jsx as jsx20, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
2654
2418
|
function MultipleFileUploadSchema(props) {
|
|
2655
2419
|
var _a, _b;
|
|
2656
2420
|
const { onChange, schema } = props;
|
|
2657
2421
|
const onEvent = useEventDispatcher();
|
|
2658
2422
|
const defaultErrorMessages = useFormattedDefaultErrorMessages(schema);
|
|
2659
2423
|
const uid = useMemo6(() => schema.$id || generateRandomId(), [schema.$id]);
|
|
2660
|
-
const [inputChanged, setInputChanged] =
|
|
2661
|
-
const [files, setFiles] =
|
|
2424
|
+
const [inputChanged, setInputChanged] = useState5(false);
|
|
2425
|
+
const [files, setFiles] = useState5(() => convertFileIdsToComponentFileObjects(props.model || []));
|
|
2662
2426
|
const performPersistAsync = usePersistAsync(schema.items.persistAsync);
|
|
2663
2427
|
const fileSchemaDescriptor = schema.items.persistAsync.schema;
|
|
2664
2428
|
const isBlob = isBlobSchema(fileSchemaDescriptor);
|
|
@@ -2712,10 +2476,10 @@ function MultipleFileUploadSchema(props) {
|
|
|
2712
2476
|
onDeleteFile: () => Promise.resolve()
|
|
2713
2477
|
});
|
|
2714
2478
|
const feedbackId = `${uid}-feedback`;
|
|
2715
|
-
return /* @__PURE__ */
|
|
2716
|
-
/* @__PURE__ */
|
|
2717
|
-
/* @__PURE__ */
|
|
2718
|
-
/* @__PURE__ */
|
|
2479
|
+
return /* @__PURE__ */ jsxs6("div", { className: (0, import_classnames2.default)("form-group", { "has-error": showError }), children: [
|
|
2480
|
+
/* @__PURE__ */ jsx20("label", { className: "d-block control-label", htmlFor: uid, children: props.schema.title }),
|
|
2481
|
+
/* @__PURE__ */ jsx20("div", { "aria-describedby": feedbackId, children: /* @__PURE__ */ jsx20(UploadInput, __spreadValues({}, uploadInputProps)) }),
|
|
2482
|
+
/* @__PURE__ */ jsx20(
|
|
2719
2483
|
ControlFeedback_default,
|
|
2720
2484
|
{
|
|
2721
2485
|
id: feedbackId,
|
|
@@ -2763,14 +2527,6 @@ import { useIntl as useIntl4 } from "react-intl";
|
|
|
2763
2527
|
|
|
2764
2528
|
// src/legacy/jsonSchemaForm/schemaFormControl/utils/mapping-utils.tsx
|
|
2765
2529
|
import { Avatar as Avatar2, AvatarType as AvatarType2 } from "@transferwise/components";
|
|
2766
|
-
|
|
2767
|
-
// ../../node_modules/.pnpm/@wise+art@2.10.0_@transferwise+neptune-css@14.9.6_@types+react@18.0.29_react-dom@18.2.0_react@18.2.0/node_modules/@wise/art/dist/index.esm.js
|
|
2768
|
-
init_index_d9418379_esm();
|
|
2769
|
-
init_clsx();
|
|
2770
|
-
import "react";
|
|
2771
|
-
import "react/jsx-runtime";
|
|
2772
|
-
|
|
2773
|
-
// src/legacy/jsonSchemaForm/schemaFormControl/utils/mapping-utils.tsx
|
|
2774
2530
|
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
2775
2531
|
var mapConstSchemaToOption = (schema, controlType) => {
|
|
2776
2532
|
switch (controlType) {
|
|
@@ -3917,7 +3673,8 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
3917
3673
|
SelectInputOptionContent2,
|
|
3918
3674
|
{
|
|
3919
3675
|
title: label2,
|
|
3920
|
-
note: note != null ? note : secondary,
|
|
3676
|
+
note: withinTrigger ? note != null ? note : secondary : note,
|
|
3677
|
+
description: withinTrigger ? void 0 : secondary,
|
|
3921
3678
|
icon: withinTrigger && hideIconInTrigger ? void 0 : icon
|
|
3922
3679
|
}
|
|
3923
3680
|
),
|
|
@@ -4052,7 +3809,7 @@ var _FormControl = class _FormControl extends PureComponent {
|
|
|
4052
3809
|
monthFormat,
|
|
4053
3810
|
disabled,
|
|
4054
3811
|
onChange: (date) => {
|
|
4055
|
-
this.handleOnChange(dateToDateString(date));
|
|
3812
|
+
this.handleOnChange(date !== null ? dateToDateString(date) : null);
|
|
4056
3813
|
},
|
|
4057
3814
|
onBlur: this.handleOnBlur,
|
|
4058
3815
|
onFocus: this.handleOnFocus
|
|
@@ -6993,13 +6750,22 @@ function useDebouncedRefresh(fetchRefresh) {
|
|
|
6993
6750
|
map.current.set(key, debouncedFetchRefresh);
|
|
6994
6751
|
return debouncedFetchRefresh;
|
|
6995
6752
|
};
|
|
6996
|
-
|
|
6753
|
+
const debouncedRefresh = (url, data, etag, schema) => {
|
|
6997
6754
|
const debouncedFetchRefresh = retrieveOrCreate(url);
|
|
6998
6755
|
debouncedFetchRefresh(url, data, etag);
|
|
6999
6756
|
if (!schema || !shouldDebounceSchema(schema)) {
|
|
7000
6757
|
debouncedFetchRefresh.flush();
|
|
7001
6758
|
}
|
|
7002
6759
|
};
|
|
6760
|
+
const cancelPendingRefreshes = () => {
|
|
6761
|
+
map.current.forEach((debouncedFetchRefresh) => {
|
|
6762
|
+
debouncedFetchRefresh.cancel();
|
|
6763
|
+
});
|
|
6764
|
+
};
|
|
6765
|
+
const isDebouncing = Array.from(map.current.values()).some(
|
|
6766
|
+
(debouncedFunction) => debouncedFunction.isPending()
|
|
6767
|
+
);
|
|
6768
|
+
return { debouncedRefresh, isDebouncing, cancelPendingRefreshes };
|
|
7003
6769
|
}
|
|
7004
6770
|
var shouldDebounceSchema = (schema) => getSchemaType(schema) === "basic" && schema.type !== "boolean" && schema.format !== "base64url";
|
|
7005
6771
|
|
|
@@ -7358,6 +7124,7 @@ var DynamicFlowComponent = ({
|
|
|
7358
7124
|
[httpClient, locale]
|
|
7359
7125
|
);
|
|
7360
7126
|
const performAction = async (action, data = {}) => {
|
|
7127
|
+
cancelPendingRefreshes();
|
|
7361
7128
|
setLoadingState(!step ? "initial" : "submission");
|
|
7362
7129
|
dispatchEvent("Dynamic Flow - Step Submitted", { actionId: action.id || action.$id });
|
|
7363
7130
|
try {
|
|
@@ -7375,6 +7142,7 @@ var DynamicFlowComponent = ({
|
|
|
7375
7142
|
}
|
|
7376
7143
|
};
|
|
7377
7144
|
const performRefresh = async (url, data, etag2) => {
|
|
7145
|
+
cancelPendingRefreshes();
|
|
7378
7146
|
setLoadingState("refresh");
|
|
7379
7147
|
dispatchEvent("Dynamic Flow - Step Refreshed", { status: "pending" });
|
|
7380
7148
|
try {
|
|
@@ -7388,7 +7156,7 @@ var DynamicFlowComponent = ({
|
|
|
7388
7156
|
const exitResult = await getJsonObjectOrNull(response);
|
|
7389
7157
|
dispatchEventAndComplete(__spreadValues(__spreadValues({}, exitResult), actionResult));
|
|
7390
7158
|
};
|
|
7391
|
-
const debouncedRefresh = useDebouncedRefresh(performRefresh);
|
|
7159
|
+
const { debouncedRefresh, isDebouncing, cancelPendingRefreshes } = useDebouncedRefresh(performRefresh);
|
|
7392
7160
|
const dispatchEventAndComplete = useCallback9(
|
|
7393
7161
|
(result) => {
|
|
7394
7162
|
dispatchEvent("Dynamic Flow - Flow Finished", { result: "success" });
|
|
@@ -7496,7 +7264,7 @@ var DynamicFlowComponent = ({
|
|
|
7496
7264
|
}
|
|
7497
7265
|
};
|
|
7498
7266
|
const onAction = async (action) => {
|
|
7499
|
-
if (isLoading || action.disabled) {
|
|
7267
|
+
if (isLoading || isDebouncing || action.disabled) {
|
|
7500
7268
|
return;
|
|
7501
7269
|
}
|
|
7502
7270
|
if (action.exit && !action.url) {
|
|
@@ -7517,7 +7285,7 @@ var DynamicFlowComponent = ({
|
|
|
7517
7285
|
await performAction(action);
|
|
7518
7286
|
}
|
|
7519
7287
|
};
|
|
7520
|
-
return /* @__PURE__ */ jsx72(LogProvider, { flowId, stepId: (step == null ? void 0 : step.id) || (step == null ? void 0 : step.key), onLog, children: /* @__PURE__ */ jsx72(EventsContextProvider, { metadata: analyticsMetadata, onEvent, children: /* @__PURE__ */ jsx72(DynamicFlowProvider, { loading: isLoading, children: /* @__PURE__ */ jsx72(HttpClientProvider, { httpClient, children: /* @__PURE__ */ jsx72(FeatureContextProvider, { features, children: loader !== null ? loader : /* @__PURE__ */ jsx72(
|
|
7288
|
+
return /* @__PURE__ */ jsx72(LogProvider, { flowId, stepId: (step == null ? void 0 : step.id) || (step == null ? void 0 : step.key), onLog, children: /* @__PURE__ */ jsx72(EventsContextProvider, { metadata: analyticsMetadata, onEvent, children: /* @__PURE__ */ jsx72(DynamicFlowProvider, { loading: isLoading || isDebouncing, children: /* @__PURE__ */ jsx72(HttpClientProvider, { httpClient, children: /* @__PURE__ */ jsx72(FeatureContextProvider, { features, children: loader !== null ? loader : /* @__PURE__ */ jsx72(
|
|
7521
7289
|
DynamicFlowStep,
|
|
7522
7290
|
{
|
|
7523
7291
|
step,
|
|
@@ -8462,7 +8230,7 @@ function $1746a345f3d73bb7$export$f680877a34711e37(deterministicId) {
|
|
|
8462
8230
|
return deterministicId || (id ? `radix-${id}` : "");
|
|
8463
8231
|
}
|
|
8464
8232
|
|
|
8465
|
-
// ../../node_modules/.pnpm/@wise+forms@0.3.4_@transferwise+components@46.
|
|
8233
|
+
// ../../node_modules/.pnpm/@wise+forms@0.3.4_@transferwise+components@46.27.0_@types+react@18.0.29_react@18.2.0/node_modules/@wise/forms/dist/index.mjs
|
|
8466
8234
|
var import_classnames11 = __toESM(require_classnames(), 1);
|
|
8467
8235
|
import { InlineAlert as InlineAlert2, Sentiment as Sentiment2, Input as Input2, TextArea } from "@transferwise/components";
|
|
8468
8236
|
import { createContext as createContext6, useContext as useContext7, forwardRef as forwardRef2 } from "react";
|
|
@@ -8755,7 +8523,7 @@ function VariableDateInput({
|
|
|
8755
8523
|
placeholder,
|
|
8756
8524
|
disabled,
|
|
8757
8525
|
onChange: (date) => {
|
|
8758
|
-
onChange(dateToDateString2(date));
|
|
8526
|
+
onChange(date !== null ? dateToDateString2(date) : null);
|
|
8759
8527
|
},
|
|
8760
8528
|
onBlur,
|
|
8761
8529
|
onFocus
|
|
@@ -8802,205 +8570,14 @@ import { NavigationOptionsList as NavigationOptionsList3, NavigationOption as Na
|
|
|
8802
8570
|
|
|
8803
8571
|
// src/revamp/wise/renderers/components/icon/FlagIcon.tsx
|
|
8804
8572
|
import { jsx as jsx85 } from "react/jsx-runtime";
|
|
8805
|
-
var isFlagIcon2 = (name) =>
|
|
8806
|
-
var isCurrencyFlagIcon2 = (name) => currencyCodes2.some((currencyCode) => name === `flag-${currencyCode}`);
|
|
8807
|
-
var isCountryFlagIcon2 = (name) => countryCodes2.some((countryCode) => name === `flag-${countryCode}`);
|
|
8573
|
+
var isFlagIcon2 = (name) => name.startsWith("flag-");
|
|
8808
8574
|
function FlagIcon2({ name }) {
|
|
8809
8575
|
if (!isFlagIcon2(name)) {
|
|
8810
8576
|
return null;
|
|
8811
8577
|
}
|
|
8812
8578
|
const code = name.substring(5);
|
|
8813
|
-
return /* @__PURE__ */ jsx85(
|
|
8814
|
-
"img",
|
|
8815
|
-
{
|
|
8816
|
-
src: `https://wise.com/web-art/assets/flags/${code}.svg`,
|
|
8817
|
-
alt: "",
|
|
8818
|
-
"data-testid": `img-flag-${code}`
|
|
8819
|
-
}
|
|
8820
|
-
);
|
|
8579
|
+
return /* @__PURE__ */ jsx85(Flag, { code });
|
|
8821
8580
|
}
|
|
8822
|
-
var currencyCodes2 = [
|
|
8823
|
-
"aed",
|
|
8824
|
-
"ars",
|
|
8825
|
-
"aud",
|
|
8826
|
-
"bdt",
|
|
8827
|
-
"bgn",
|
|
8828
|
-
"bhd",
|
|
8829
|
-
"bnd",
|
|
8830
|
-
"brl",
|
|
8831
|
-
"bwp",
|
|
8832
|
-
"cad",
|
|
8833
|
-
"chf",
|
|
8834
|
-
"clp",
|
|
8835
|
-
"cny",
|
|
8836
|
-
"cop",
|
|
8837
|
-
"crc",
|
|
8838
|
-
"czk",
|
|
8839
|
-
"dkk",
|
|
8840
|
-
"egp",
|
|
8841
|
-
"eur",
|
|
8842
|
-
"fjd",
|
|
8843
|
-
"gbp",
|
|
8844
|
-
"gel",
|
|
8845
|
-
"ghs",
|
|
8846
|
-
"gtq",
|
|
8847
|
-
"hkd",
|
|
8848
|
-
"hrk",
|
|
8849
|
-
"huf",
|
|
8850
|
-
"idr",
|
|
8851
|
-
"ils",
|
|
8852
|
-
"imp",
|
|
8853
|
-
"inr",
|
|
8854
|
-
"isk",
|
|
8855
|
-
"jmd",
|
|
8856
|
-
"jpy",
|
|
8857
|
-
"kes",
|
|
8858
|
-
"krw",
|
|
8859
|
-
"kwd",
|
|
8860
|
-
"lak",
|
|
8861
|
-
"lkr",
|
|
8862
|
-
"lsl",
|
|
8863
|
-
"mad",
|
|
8864
|
-
"mur",
|
|
8865
|
-
"mxn",
|
|
8866
|
-
"myr",
|
|
8867
|
-
"mzn",
|
|
8868
|
-
"nad",
|
|
8869
|
-
"ngn",
|
|
8870
|
-
"nok",
|
|
8871
|
-
"npr",
|
|
8872
|
-
"nzd",
|
|
8873
|
-
"omr",
|
|
8874
|
-
"pab",
|
|
8875
|
-
"pen",
|
|
8876
|
-
"php",
|
|
8877
|
-
"pkr",
|
|
8878
|
-
"pln",
|
|
8879
|
-
"qar",
|
|
8880
|
-
"ron",
|
|
8881
|
-
"rub",
|
|
8882
|
-
"sar",
|
|
8883
|
-
"sek",
|
|
8884
|
-
"sgd",
|
|
8885
|
-
"thb",
|
|
8886
|
-
"tmt",
|
|
8887
|
-
"try",
|
|
8888
|
-
"twd",
|
|
8889
|
-
"tzs",
|
|
8890
|
-
"uah",
|
|
8891
|
-
"ugx",
|
|
8892
|
-
"usd",
|
|
8893
|
-
"uyu",
|
|
8894
|
-
"vnd",
|
|
8895
|
-
"xof",
|
|
8896
|
-
"zar",
|
|
8897
|
-
"zmw"
|
|
8898
|
-
];
|
|
8899
|
-
var countryCodes2 = [
|
|
8900
|
-
"ad",
|
|
8901
|
-
"ae",
|
|
8902
|
-
"ar",
|
|
8903
|
-
"at",
|
|
8904
|
-
"au",
|
|
8905
|
-
"bd",
|
|
8906
|
-
"be",
|
|
8907
|
-
"bg",
|
|
8908
|
-
"bh",
|
|
8909
|
-
"bn",
|
|
8910
|
-
"br",
|
|
8911
|
-
"bw",
|
|
8912
|
-
"ca",
|
|
8913
|
-
"ch",
|
|
8914
|
-
"cl",
|
|
8915
|
-
"cn",
|
|
8916
|
-
"co",
|
|
8917
|
-
"cr",
|
|
8918
|
-
"cy",
|
|
8919
|
-
"cz",
|
|
8920
|
-
"de",
|
|
8921
|
-
"dk",
|
|
8922
|
-
"ee",
|
|
8923
|
-
"eg",
|
|
8924
|
-
"es",
|
|
8925
|
-
"eu",
|
|
8926
|
-
"fi",
|
|
8927
|
-
"fj",
|
|
8928
|
-
"fr",
|
|
8929
|
-
"gb",
|
|
8930
|
-
"ge",
|
|
8931
|
-
"gg",
|
|
8932
|
-
"gh",
|
|
8933
|
-
"gp",
|
|
8934
|
-
"gr",
|
|
8935
|
-
"gt",
|
|
8936
|
-
"hk",
|
|
8937
|
-
"hr",
|
|
8938
|
-
"hu",
|
|
8939
|
-
"id",
|
|
8940
|
-
"ie",
|
|
8941
|
-
"il",
|
|
8942
|
-
"im",
|
|
8943
|
-
"in",
|
|
8944
|
-
"is",
|
|
8945
|
-
"it",
|
|
8946
|
-
"je",
|
|
8947
|
-
"jm",
|
|
8948
|
-
"jp",
|
|
8949
|
-
"ke",
|
|
8950
|
-
"kr",
|
|
8951
|
-
"kw",
|
|
8952
|
-
"la",
|
|
8953
|
-
"li",
|
|
8954
|
-
"lk",
|
|
8955
|
-
"ls",
|
|
8956
|
-
"lt",
|
|
8957
|
-
"lu",
|
|
8958
|
-
"lv",
|
|
8959
|
-
"ma",
|
|
8960
|
-
"mc",
|
|
8961
|
-
"mt",
|
|
8962
|
-
"mu",
|
|
8963
|
-
"mx",
|
|
8964
|
-
"my",
|
|
8965
|
-
"mz",
|
|
8966
|
-
"na",
|
|
8967
|
-
"ng",
|
|
8968
|
-
"nl",
|
|
8969
|
-
"no",
|
|
8970
|
-
"np",
|
|
8971
|
-
"nz",
|
|
8972
|
-
"om",
|
|
8973
|
-
"pa",
|
|
8974
|
-
"pe",
|
|
8975
|
-
"ph",
|
|
8976
|
-
"pk",
|
|
8977
|
-
"pl",
|
|
8978
|
-
"pt",
|
|
8979
|
-
"qa",
|
|
8980
|
-
"ro",
|
|
8981
|
-
"ru",
|
|
8982
|
-
"sa",
|
|
8983
|
-
"se",
|
|
8984
|
-
"sg",
|
|
8985
|
-
"si",
|
|
8986
|
-
"sk",
|
|
8987
|
-
"sm",
|
|
8988
|
-
"th",
|
|
8989
|
-
"tm",
|
|
8990
|
-
"tr",
|
|
8991
|
-
"tw",
|
|
8992
|
-
"tz",
|
|
8993
|
-
"ua",
|
|
8994
|
-
"ug",
|
|
8995
|
-
"us",
|
|
8996
|
-
"uy",
|
|
8997
|
-
"va",
|
|
8998
|
-
"vn",
|
|
8999
|
-
"wi",
|
|
9000
|
-
"xo",
|
|
9001
|
-
"za",
|
|
9002
|
-
"zm"
|
|
9003
|
-
];
|
|
9004
8581
|
|
|
9005
8582
|
// src/revamp/wise/renderers/components/icon/NamedIcon.tsx
|
|
9006
8583
|
import * as icons2 from "@transferwise/icons";
|