@wise/dynamic-flow-client-internal 2.8.4 → 2.8.6
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 +760 -756
- package/build/main.min.js +1 -1
- package/package.json +2 -2
package/build/main.js
CHANGED
|
@@ -51,40 +51,40 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
51
51
|
var require_main_min = __commonJS({
|
|
52
52
|
"../core/build/main.min.js"(exports, module2) {
|
|
53
53
|
"use strict";
|
|
54
|
-
var
|
|
55
|
-
var
|
|
56
|
-
var
|
|
57
|
-
var
|
|
58
|
-
var
|
|
59
|
-
var
|
|
54
|
+
var jm = Object.create;
|
|
55
|
+
var Zt = Object.defineProperty;
|
|
56
|
+
var Vm = Object.defineProperties;
|
|
57
|
+
var Um = Object.getOwnPropertyDescriptor;
|
|
58
|
+
var Hm = Object.getOwnPropertyDescriptors;
|
|
59
|
+
var qm = Object.getOwnPropertyNames;
|
|
60
60
|
var rn = Object.getOwnPropertySymbols;
|
|
61
|
-
var
|
|
61
|
+
var Gm = Object.getPrototypeOf;
|
|
62
62
|
var on = Object.prototype.hasOwnProperty;
|
|
63
|
-
var
|
|
64
|
-
var an = (e, t, r) => t in e ?
|
|
63
|
+
var Wm = Object.prototype.propertyIsEnumerable;
|
|
64
|
+
var an = (e, t, r) => t in e ? Zt(e, t, { enumerable: true, configurable: true, writable: true, value: r }) : e[t] = r;
|
|
65
65
|
var s = (e, t) => {
|
|
66
66
|
for (var r in t || (t = {}))
|
|
67
67
|
on.call(t, r) && an(e, r, t[r]);
|
|
68
68
|
if (rn)
|
|
69
69
|
for (var r of rn(t))
|
|
70
|
-
|
|
70
|
+
Wm.call(t, r) && an(e, r, t[r]);
|
|
71
71
|
return e;
|
|
72
72
|
};
|
|
73
|
-
var C = (e, t) =>
|
|
73
|
+
var C = (e, t) => Vm(e, Hm(t));
|
|
74
74
|
var Aa = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports);
|
|
75
|
-
var
|
|
75
|
+
var $m = (e, t) => {
|
|
76
76
|
for (var r in t)
|
|
77
|
-
|
|
77
|
+
Zt(e, r, { get: t[r], enumerable: true });
|
|
78
78
|
};
|
|
79
79
|
var nn = (e, t, r, a) => {
|
|
80
80
|
if (t && typeof t == "object" || typeof t == "function")
|
|
81
|
-
for (let o of
|
|
82
|
-
!on.call(e, o) && o !== r &&
|
|
81
|
+
for (let o of qm(t))
|
|
82
|
+
!on.call(e, o) && o !== r && Zt(e, o, { get: () => t[o], enumerable: !(a = Um(t, o)) || a.enumerable });
|
|
83
83
|
return e;
|
|
84
84
|
};
|
|
85
|
-
var
|
|
86
|
-
var
|
|
87
|
-
var
|
|
85
|
+
var Ee = (e, t, r) => (r = e != null ? jm(Gm(e)) : {}, nn(t || !e || !e.__esModule ? Zt(r, "default", { value: e, enumerable: true }) : r, e));
|
|
86
|
+
var _m = (e) => nn(Zt({}, "__esModule", { value: true }), e);
|
|
87
|
+
var Xe = Aa((nf, Ur) => {
|
|
88
88
|
"use strict";
|
|
89
89
|
(function() {
|
|
90
90
|
"use strict";
|
|
@@ -118,11 +118,11 @@ var require_main_min = __commonJS({
|
|
|
118
118
|
}) : window.classNames = r;
|
|
119
119
|
})();
|
|
120
120
|
});
|
|
121
|
-
var bc = Aa((
|
|
121
|
+
var bc = Aa((hr, jo) => {
|
|
122
122
|
"use strict";
|
|
123
123
|
(function(t, r) {
|
|
124
|
-
typeof
|
|
125
|
-
})(
|
|
124
|
+
typeof hr == "object" && typeof jo == "object" ? jo.exports = r(require("react")) : typeof define == "function" && define.amd ? define(["react"], r) : typeof hr == "object" ? hr.Webcam = r(require("react")) : t.Webcam = r(t.React);
|
|
125
|
+
})(hr, function(e) {
|
|
126
126
|
return function(t) {
|
|
127
127
|
var r = {};
|
|
128
128
|
function a(o) {
|
|
@@ -300,10 +300,10 @@ var require_main_min = __commonJS({
|
|
|
300
300
|
}
|
|
301
301
|
f.onUserMedia(d);
|
|
302
302
|
}, y.prototype.render = function() {
|
|
303
|
-
var u = this, d = this, f = d.state, w = d.props, S = w.audio, F = w.forceScreenshotSourceSize, g = w.disablePictureInPicture, v = w.onUserMedia, O = w.onUserMediaError, x = w.screenshotFormat, M = w.screenshotQuality,
|
|
304
|
-
return o.createElement(o.Fragment, null, o.createElement("video", c({ autoPlay: true, disablePictureInPicture: g, src: f.src, muted: !S, playsInline: true, ref: function(
|
|
305
|
-
u.video =
|
|
306
|
-
}, style: X }, W)), ie && ie(
|
|
303
|
+
var u = this, d = this, f = d.state, w = d.props, S = w.audio, F = w.forceScreenshotSourceSize, g = w.disablePictureInPicture, v = w.onUserMedia, O = w.onUserMediaError, x = w.screenshotFormat, M = w.screenshotQuality, E = w.minScreenshotWidth, P = w.minScreenshotHeight, D = w.audioConstraints, U = w.videoConstraints, ee = w.imageSmoothing, A = w.mirrored, B = w.style, k = B === void 0 ? {} : B, ie = w.children, W = l(w, ["audio", "forceScreenshotSourceSize", "disablePictureInPicture", "onUserMedia", "onUserMediaError", "screenshotFormat", "screenshotQuality", "minScreenshotWidth", "minScreenshotHeight", "audioConstraints", "videoConstraints", "imageSmoothing", "mirrored", "style", "children"]), X = A ? c(c({}, k), { transform: (k.transform || "") + " scaleX(-1)" }) : k, ke = { getScreenshot: this.getScreenshot.bind(this) };
|
|
304
|
+
return o.createElement(o.Fragment, null, o.createElement("video", c({ autoPlay: true, disablePictureInPicture: g, src: f.src, muted: !S, playsInline: true, ref: function(nt) {
|
|
305
|
+
u.video = nt;
|
|
306
|
+
}, style: X }, W)), ie && ie(ke));
|
|
307
307
|
}, y.defaultProps = { audio: false, disablePictureInPicture: false, forceScreenshotSourceSize: false, imageSmoothing: true, mirrored: false, onUserMedia: function() {
|
|
308
308
|
}, onUserMediaError: function() {
|
|
309
309
|
}, screenshotFormat: "image/webp", screenshotQuality: 0.92 }, y;
|
|
@@ -314,11 +314,11 @@ var require_main_min = __commonJS({
|
|
|
314
314
|
} }).default;
|
|
315
315
|
});
|
|
316
316
|
});
|
|
317
|
-
var kc = Aa((zF,
|
|
317
|
+
var kc = Aa((zF, wr) => {
|
|
318
318
|
"use strict";
|
|
319
319
|
(function() {
|
|
320
320
|
"use strict";
|
|
321
|
-
var e = typeof window != "undefined" && typeof window.document != "undefined" ? window.document : {}, t = typeof
|
|
321
|
+
var e = typeof window != "undefined" && typeof window.document != "undefined" ? window.document : {}, t = typeof wr != "undefined" && wr.exports, r = function() {
|
|
322
322
|
for (var n, i = [["requestFullscreen", "exitFullscreen", "fullscreenElement", "fullscreenEnabled", "fullscreenchange", "fullscreenerror"], ["webkitRequestFullscreen", "webkitExitFullscreen", "webkitFullscreenElement", "webkitFullscreenEnabled", "webkitfullscreenchange", "webkitfullscreenerror"], ["webkitRequestFullScreen", "webkitCancelFullScreen", "webkitCurrentFullScreenElement", "webkitCancelFullScreen", "webkitfullscreenchange", "webkitfullscreenerror"], ["mozRequestFullScreen", "mozCancelFullScreen", "mozFullScreenElement", "mozFullScreenEnabled", "mozfullscreenchange", "mozfullscreenerror"], ["msRequestFullscreen", "msExitFullscreen", "msFullscreenElement", "msFullscreenEnabled", "MSFullscreenChange", "MSFullscreenError"]], c = 0, l = i.length, m = {}; c < l; c++)
|
|
323
323
|
if (n = i[c], n && n[1] in e) {
|
|
324
324
|
for (c = 0; c < n.length; c++)
|
|
@@ -362,7 +362,7 @@ var require_main_min = __commonJS({
|
|
|
362
362
|
c && e.removeEventListener(c, i, false);
|
|
363
363
|
}, raw: r };
|
|
364
364
|
if (!r) {
|
|
365
|
-
t ?
|
|
365
|
+
t ? wr.exports = { isEnabled: false } : window.screenfull = { isEnabled: false };
|
|
366
366
|
return;
|
|
367
367
|
}
|
|
368
368
|
Object.defineProperties(o, { isFullscreen: { get: function() {
|
|
@@ -371,24 +371,24 @@ var require_main_min = __commonJS({
|
|
|
371
371
|
return e[r.fullscreenElement];
|
|
372
372
|
} }, isEnabled: { enumerable: true, get: function() {
|
|
373
373
|
return !!e[r.fullscreenEnabled];
|
|
374
|
-
} } }), t ?
|
|
374
|
+
} } }), t ? wr.exports = o : window.screenfull = o;
|
|
375
375
|
})();
|
|
376
376
|
});
|
|
377
|
-
var
|
|
378
|
-
|
|
379
|
-
module2.exports =
|
|
380
|
-
function
|
|
377
|
+
var Lp = {};
|
|
378
|
+
$m(Lp, { DynamicFlow: () => Qo, JsonSchemaForm: () => en, Layout: () => ne, convertStepToLayout: () => Qt, inlineReferences: () => ze, isValidSchema: () => G, makeHttpClient: () => kr, translations: () => Bm });
|
|
379
|
+
module2.exports = _m(Lp);
|
|
380
|
+
function Qt(e, { displayStepTitle: t = true } = {}) {
|
|
381
381
|
if (e.layout)
|
|
382
|
-
return
|
|
382
|
+
return sl(e, t);
|
|
383
383
|
switch (e.type) {
|
|
384
384
|
case "final":
|
|
385
|
-
return
|
|
385
|
+
return Ym(e);
|
|
386
386
|
case "decision":
|
|
387
|
-
return
|
|
387
|
+
return Zm(e);
|
|
388
388
|
case "external":
|
|
389
|
-
return
|
|
389
|
+
return Km(e);
|
|
390
390
|
default:
|
|
391
|
-
return
|
|
391
|
+
return Xm(e);
|
|
392
392
|
}
|
|
393
393
|
}
|
|
394
394
|
function Oa(e) {
|
|
@@ -399,38 +399,38 @@ var require_main_min = __commonJS({
|
|
|
399
399
|
}
|
|
400
400
|
return e.description && t.push(ka(e.description)), t;
|
|
401
401
|
}
|
|
402
|
-
function
|
|
403
|
-
return [...Oa(e),
|
|
402
|
+
function Km(e) {
|
|
403
|
+
return [...Oa(e), Jm(e)];
|
|
404
404
|
}
|
|
405
|
-
function
|
|
405
|
+
function Jm(e) {
|
|
406
406
|
return { type: "external", requestUrl: e.requestUrl, polling: e.polling, responseHandlers: e.responseHandlers, retryTitle: e.retryTitle };
|
|
407
407
|
}
|
|
408
|
-
function
|
|
408
|
+
function Xm(e) {
|
|
409
409
|
let t = Oa(e);
|
|
410
|
-
if (e.reviewFields && t.push(
|
|
411
|
-
let r = e.actions.map(
|
|
410
|
+
if (e.reviewFields && t.push(al(e.reviewFields)), e.schemas && t.push(...nl(e)), e.actions) {
|
|
411
|
+
let r = e.actions.map(Ar);
|
|
412
412
|
t.push(Pa(r, "md"));
|
|
413
413
|
}
|
|
414
414
|
return t;
|
|
415
415
|
}
|
|
416
|
-
function
|
|
416
|
+
function Ym(e) {
|
|
417
417
|
let t = [];
|
|
418
418
|
if (e.details) {
|
|
419
419
|
if (e.details.image) {
|
|
420
|
-
let r =
|
|
420
|
+
let r = rl(e.details.image);
|
|
421
421
|
t.push(r);
|
|
422
422
|
}
|
|
423
423
|
e.details.title && t.push(Ma(e.details.title)), e.details.description && t.push(ka(e.details.description));
|
|
424
424
|
}
|
|
425
425
|
if (e.actions) {
|
|
426
|
-
let r = e.actions.map((a) =>
|
|
426
|
+
let r = e.actions.map((a) => Ar(C(s({}, a), { type: a.type || "primary" })));
|
|
427
427
|
t.push(Pa(r, "md"));
|
|
428
428
|
}
|
|
429
429
|
return t;
|
|
430
430
|
}
|
|
431
|
-
function
|
|
431
|
+
function Zm(e) {
|
|
432
432
|
let t = Oa(e);
|
|
433
|
-
return e.options && t.push(
|
|
433
|
+
return e.options && t.push(el(e.options)), t;
|
|
434
434
|
}
|
|
435
435
|
function Pa(e, t) {
|
|
436
436
|
return { type: "box", width: t || "md", components: e };
|
|
@@ -441,66 +441,66 @@ var require_main_min = __commonJS({
|
|
|
441
441
|
function ka(e) {
|
|
442
442
|
return { type: "paragraph", text: e, align: "center" };
|
|
443
443
|
}
|
|
444
|
-
function
|
|
444
|
+
function Qm(e) {
|
|
445
445
|
return { type: "form", schema: e };
|
|
446
446
|
}
|
|
447
|
-
function
|
|
448
|
-
return { type: "decision", options: e.map(
|
|
447
|
+
function el(e) {
|
|
448
|
+
return { type: "decision", options: e.map(tl) };
|
|
449
449
|
}
|
|
450
|
-
function
|
|
450
|
+
function tl(e) {
|
|
451
451
|
return { title: e.title, description: e.description, action: { title: e.title, method: "GET", url: e.url, disabled: e.disabled } };
|
|
452
452
|
}
|
|
453
453
|
function sn(e) {
|
|
454
454
|
return { type: "image", url: e.url, text: e.text, margin: e.margin || "lg", size: e.size || "md" };
|
|
455
455
|
}
|
|
456
|
-
function
|
|
456
|
+
function rl(e) {
|
|
457
457
|
return typeof e == "string" ? { type: "image", url: e, text: void 0, margin: "lg", size: "md" } : sn(e);
|
|
458
458
|
}
|
|
459
|
-
function
|
|
459
|
+
function Ar(e) {
|
|
460
460
|
return { type: "button", action: C(s({}, e), { title: e.title }) };
|
|
461
461
|
}
|
|
462
|
-
function
|
|
463
|
-
return { type: "review", title: e.title, fields: e.fields.map(
|
|
462
|
+
function al(e) {
|
|
463
|
+
return { type: "review", title: e.title, fields: e.fields.map(ol) };
|
|
464
464
|
}
|
|
465
|
-
function
|
|
465
|
+
function ol(e) {
|
|
466
466
|
return { label: e.title, value: e.value };
|
|
467
467
|
}
|
|
468
|
-
function
|
|
468
|
+
function nl(e) {
|
|
469
469
|
let t = [];
|
|
470
470
|
if (e.schemas && e.schemas[0]) {
|
|
471
|
-
let r = e.schemas[0], a =
|
|
472
|
-
|
|
471
|
+
let r = e.schemas[0], a = Qm(r);
|
|
472
|
+
il() ? t.push(a) : t.push(Pa([a], "md"));
|
|
473
473
|
}
|
|
474
474
|
return t;
|
|
475
475
|
}
|
|
476
|
-
function
|
|
476
|
+
function il() {
|
|
477
477
|
return false;
|
|
478
478
|
}
|
|
479
|
-
function
|
|
479
|
+
function sl(e, t) {
|
|
480
480
|
return [...t && e.title ? [Ma(e.title)] : [], ...e.description ? [ka(e.description)] : [], ...e.layout || []];
|
|
481
481
|
}
|
|
482
482
|
function ze({ layout: e, schemas: t, actions: r, model: a }) {
|
|
483
|
-
return e ? t ? e.map((o) => o.type === "form" ?
|
|
483
|
+
return e ? t ? e.map((o) => o.type === "form" ? cl({ formComponent: o, schemas: t }) : o.type === "decision" ? ml({ decisionComponent: o, actions: r }) : o.type === "button" ? ll({ actionComponent: o, actions: r }) : o.type === "box" ? C(s({}, o), { components: ze({ layout: o.components, schemas: t, actions: r, model: a }) }) : o.type === "modal" ? C(s({}, o), { components: ze({ layout: o.content.components, schemas: t, actions: r, model: a }) }) : o.type === "columns" ? C(s({}, o), { left: ze({ layout: o.left, schemas: t, actions: r, model: a }), right: ze({ layout: o.right, schemas: t, actions: r, model: a }) }) : o) : e : [];
|
|
484
484
|
}
|
|
485
|
-
function
|
|
485
|
+
function cl({ formComponent: e, schemas: t }) {
|
|
486
486
|
if (e.schemaId)
|
|
487
487
|
return { type: "form", margin: e.margin, schema: cn(t, e.schemaId) };
|
|
488
|
-
if (e.schema &&
|
|
488
|
+
if (e.schema && Or(e.schema) && e.schema.$ref)
|
|
489
489
|
return { type: "form", margin: e.margin, schema: cn(t, e.schema.$ref) };
|
|
490
|
-
if (e.schema && !
|
|
490
|
+
if (e.schema && !Or(e.schema))
|
|
491
491
|
return s({}, e);
|
|
492
492
|
throw new Error('Invalid form layout component. Missing "schema" or "schemaId" properties.');
|
|
493
493
|
}
|
|
494
|
-
function
|
|
494
|
+
function ml({ decisionComponent: e, actions: t }) {
|
|
495
495
|
var a;
|
|
496
|
-
let r = (a = e == null ? void 0 : e.options) == null ? void 0 : a.map((o) => o.action &&
|
|
496
|
+
let r = (a = e == null ? void 0 : e.options) == null ? void 0 : a.map((o) => o.action && Or(o.action) ? C(s({}, o), { action: mn(t, o.action.$ref) }) : o);
|
|
497
497
|
return C(s({}, e), { options: r });
|
|
498
498
|
}
|
|
499
|
-
function
|
|
499
|
+
function ll({ actionComponent: e, actions: t }) {
|
|
500
500
|
var r;
|
|
501
|
-
if (e.action &&
|
|
501
|
+
if (e.action && Or(e.action) && ((r = e.action) != null && r.$ref)) {
|
|
502
502
|
let a = mn(t, e.action.$ref);
|
|
503
|
-
return
|
|
503
|
+
return Ar(a);
|
|
504
504
|
}
|
|
505
505
|
return e;
|
|
506
506
|
}
|
|
@@ -516,21 +516,21 @@ var require_main_min = __commonJS({
|
|
|
516
516
|
throw new Error(`Fatal Error. Action not found. $id ${t}`);
|
|
517
517
|
return r;
|
|
518
518
|
}
|
|
519
|
-
function
|
|
519
|
+
function Or(e) {
|
|
520
520
|
return Object.hasOwnProperty.call(e, "$ref");
|
|
521
521
|
}
|
|
522
522
|
var Me = require("react");
|
|
523
523
|
var Sm = require("react-intl");
|
|
524
524
|
var vt = require("react");
|
|
525
|
-
var
|
|
525
|
+
var Pr = require("react");
|
|
526
526
|
function ln() {
|
|
527
|
-
let [e, t] = (0,
|
|
528
|
-
return { addPendingPromise: (0,
|
|
529
|
-
t((o) => o + 1), a.catch(
|
|
527
|
+
let [e, t] = (0, Pr.useState)(0);
|
|
528
|
+
return { addPendingPromise: (0, Pr.useCallback)((a) => {
|
|
529
|
+
t((o) => o + 1), a.catch(ul).finally(() => dl(() => t((o) => Math.max(0, o - 1))));
|
|
530
530
|
}, [t]), pendingPromises: e };
|
|
531
531
|
}
|
|
532
|
-
var
|
|
533
|
-
var
|
|
532
|
+
var dl = (e) => setTimeout(() => e(), 0);
|
|
533
|
+
var ul = () => {
|
|
534
534
|
};
|
|
535
535
|
var yn = require("react/jsx-runtime");
|
|
536
536
|
var dn = { loading: false, registerPersistAsyncPromise: (e) => {
|
|
@@ -540,17 +540,17 @@ var require_main_min = __commonJS({
|
|
|
540
540
|
let { pendingPromises: r, addPendingPromise: a } = ln(), o = (0, vt.useMemo)(() => ({ loading: e || r > 0, registerPersistAsyncPromise: a }), [e, r, a]);
|
|
541
541
|
return (0, yn.jsx)(un.Provider, { value: o, children: t });
|
|
542
542
|
};
|
|
543
|
-
var
|
|
544
|
-
var
|
|
543
|
+
var At = () => (0, vt.useContext)(un) || dn;
|
|
544
|
+
var Ot = require("react");
|
|
545
545
|
var hn = require("react/jsx-runtime");
|
|
546
|
-
var fn = (0,
|
|
546
|
+
var fn = (0, Ot.createContext)({ triggerEvent: () => {
|
|
547
547
|
} });
|
|
548
548
|
function Mr({ metadata: e, children: t, onEvent: r }) {
|
|
549
|
-
let a = (0,
|
|
549
|
+
let a = (0, Ot.useMemo)(() => ({ triggerEvent: Ea(r, e) }), [r, e]);
|
|
550
550
|
return (0, hn.jsx)(fn.Provider, { value: a, children: t });
|
|
551
551
|
}
|
|
552
|
-
function
|
|
553
|
-
let { triggerEvent: e } = (0,
|
|
552
|
+
function re() {
|
|
553
|
+
let { triggerEvent: e } = (0, Ot.useContext)(fn);
|
|
554
554
|
return e;
|
|
555
555
|
}
|
|
556
556
|
var Ea = (e, t) => (r, a = {}) => {
|
|
@@ -561,11 +561,11 @@ var require_main_min = __commonJS({
|
|
|
561
561
|
};
|
|
562
562
|
var ct = require("react");
|
|
563
563
|
var kr = (e, t) => (r, a) => {
|
|
564
|
-
let o =
|
|
564
|
+
let o = pl(r, e || ""), n = yl(a == null ? void 0 : a.headers, t);
|
|
565
565
|
return fetch(o, C(s({}, a != null ? a : {}), { headers: n }));
|
|
566
566
|
};
|
|
567
|
-
var
|
|
568
|
-
var
|
|
567
|
+
var pl = (e, t) => typeof e == "string" && fl(e) ? t + e : e;
|
|
568
|
+
var yl = (e, t) => {
|
|
569
569
|
if (!e && !t)
|
|
570
570
|
return {};
|
|
571
571
|
let r = new Headers(e);
|
|
@@ -573,7 +573,7 @@ var require_main_min = __commonJS({
|
|
|
573
573
|
r.set(a, o);
|
|
574
574
|
return r;
|
|
575
575
|
};
|
|
576
|
-
function
|
|
576
|
+
function fl(e = "") {
|
|
577
577
|
return !["https://", "http://", "data:"].some((t) => e.startsWith(t) && e.length > t.length);
|
|
578
578
|
}
|
|
579
579
|
var Ia = require("react/jsx-runtime");
|
|
@@ -590,7 +590,7 @@ var require_main_min = __commonJS({
|
|
|
590
590
|
return e != null ? e : fetch;
|
|
591
591
|
};
|
|
592
592
|
var wn = () => !!(0, ct.useContext)(Er);
|
|
593
|
-
var
|
|
593
|
+
var Pt = require("react");
|
|
594
594
|
var Sn = require("react/jsx-runtime");
|
|
595
595
|
var mt = (e, t, r = "UNKNOWN-FLOW-ID", a = "UNKNOWN-FLOW-ID") => (o, n, i) => {
|
|
596
596
|
try {
|
|
@@ -598,22 +598,22 @@ var require_main_min = __commonJS({
|
|
|
598
598
|
} catch (c) {
|
|
599
599
|
}
|
|
600
600
|
};
|
|
601
|
-
var Cn = (0,
|
|
601
|
+
var Cn = (0, Pt.createContext)(null);
|
|
602
602
|
function Dr({ flowId: e, stepId: t, children: r, onLog: a }) {
|
|
603
|
-
let o = (0,
|
|
603
|
+
let o = (0, Pt.useMemo)(() => ({ debug: mt("debug", a, e, t), info: mt("info", a, e, t), warning: mt("warning", a, e, t), error: mt("error", a, e, t), critical: mt("critical", a, e, t) }), [a, e, t]);
|
|
604
604
|
return (0, Sn.jsx)(Cn.Provider, { value: o, children: r });
|
|
605
605
|
}
|
|
606
|
-
var
|
|
607
|
-
let e = (0,
|
|
606
|
+
var Mt = () => {
|
|
607
|
+
let e = (0, Pt.useContext)(Cn);
|
|
608
608
|
if (e == null)
|
|
609
609
|
throw new Error("Logging context not found. Did you forget to wrap your component in a <LogProvider />?");
|
|
610
610
|
return e;
|
|
611
611
|
};
|
|
612
612
|
var Da = require("react");
|
|
613
613
|
var bn = require("react/jsx-runtime");
|
|
614
|
-
var
|
|
614
|
+
var hl = (0, Da.createContext)([]);
|
|
615
615
|
function Fn({ features: e, children: t }) {
|
|
616
|
-
return (0, bn.jsx)(
|
|
616
|
+
return (0, bn.jsx)(hl.Provider, { value: e, children: t });
|
|
617
617
|
}
|
|
618
618
|
function xn(e) {
|
|
619
619
|
return e >= 200 && e < 300;
|
|
@@ -627,46 +627,46 @@ var require_main_min = __commonJS({
|
|
|
627
627
|
var L = (e) => typeof e == "string";
|
|
628
628
|
var z = (e) => typeof e == "number" && !Number.isNaN(e);
|
|
629
629
|
var An = (e) => z(e) && Math.floor(e) === e;
|
|
630
|
-
var
|
|
630
|
+
var Ie = (e) => typeof e == "boolean";
|
|
631
631
|
var R = (e) => !I(e) && !Y(e) && (e == null ? void 0 : e.constructor) === Object;
|
|
632
|
-
var
|
|
632
|
+
var j = (e) => Array.isArray(e);
|
|
633
633
|
var I = (e) => e === null;
|
|
634
634
|
var Y = (e) => typeof e == "undefined";
|
|
635
|
-
var
|
|
635
|
+
var kt = (e) => L(e) && e.length === 0 || (R(e) || j(e)) && Object.keys(e).length === 0;
|
|
636
636
|
function On(e, t) {
|
|
637
|
-
return t.oneOf.some((r) =>
|
|
637
|
+
return t.oneOf.some((r) => $e(e, r) === e) ? e : null;
|
|
638
638
|
}
|
|
639
639
|
function Pn(e, t) {
|
|
640
640
|
var a;
|
|
641
|
-
let r = t.oneOf.map((o) =>
|
|
641
|
+
let r = t.oneOf.map((o) => gl(e, o)).filter((o) => o !== null);
|
|
642
642
|
return r.length === 0 ? null : (a = r.find((o) => o.some((n) => n !== null))) != null ? a : r[0];
|
|
643
643
|
}
|
|
644
|
-
function
|
|
645
|
-
return !je(t) || !
|
|
644
|
+
function gl(e, t) {
|
|
645
|
+
return !je(t) || !De(t) ? null : La(e, t);
|
|
646
646
|
}
|
|
647
647
|
function Mn(e) {
|
|
648
|
-
return L(e) && !
|
|
648
|
+
return L(e) && !kt(e) ? e : null;
|
|
649
649
|
}
|
|
650
650
|
function kn(e) {
|
|
651
651
|
return z(e) ? e : null;
|
|
652
652
|
}
|
|
653
653
|
function En(e) {
|
|
654
|
-
return
|
|
654
|
+
return Ie(e) ? e : null;
|
|
655
655
|
}
|
|
656
656
|
function La(e, t) {
|
|
657
|
-
if (!
|
|
657
|
+
if (!j(e) || !De(t))
|
|
658
658
|
return null;
|
|
659
659
|
if (e.length > 0) {
|
|
660
660
|
let r = typeof e[0];
|
|
661
661
|
if (!e.every((a) => typeof a === r))
|
|
662
662
|
return new Array(e.length).fill(null);
|
|
663
663
|
}
|
|
664
|
-
return e.map((r) =>
|
|
664
|
+
return e.map((r) => Et(r, t.items));
|
|
665
665
|
}
|
|
666
666
|
function In(e, t) {
|
|
667
667
|
return Object.keys(t.properties).reduce((r, a) => {
|
|
668
668
|
if (e && !Y(e[a])) {
|
|
669
|
-
let o = e[a], n = t.properties[a], i =
|
|
669
|
+
let o = e[a], n = t.properties[a], i = Et(o, n);
|
|
670
670
|
if (!I(i))
|
|
671
671
|
return C(s({}, r), { [a]: i });
|
|
672
672
|
}
|
|
@@ -688,8 +688,8 @@ var require_main_min = __commonJS({
|
|
|
688
688
|
return $(o) && $(n) ? C(s({}, r), { [a]: Tn(o, n) }) : C(s({}, r), { [a]: t[a] });
|
|
689
689
|
}, s({}, e));
|
|
690
690
|
}
|
|
691
|
-
var
|
|
692
|
-
function
|
|
691
|
+
var Et = (e, t) => $(e) ? ce(e, t) : Ta(e) ? wl(e, t) : $e(e, t);
|
|
692
|
+
function $e(e, t) {
|
|
693
693
|
if (I(e))
|
|
694
694
|
return null;
|
|
695
695
|
if (t.oneOf)
|
|
@@ -711,16 +711,16 @@ var require_main_min = __commonJS({
|
|
|
711
711
|
return null;
|
|
712
712
|
}
|
|
713
713
|
function ce(e, t) {
|
|
714
|
-
return Ve(t) || je(t) || I(e) ? null : t.allOf ? Dn(e, t) : t.oneOf ? Ln(e, t) : !Y(t.const) && e === t.const ? e :
|
|
714
|
+
return Ve(t) || je(t) || I(e) ? null : t.allOf ? Dn(e, t) : t.oneOf ? Ln(e, t) : !Y(t.const) && e === t.const ? e : Le(t) ? In(e, t) : null;
|
|
715
715
|
}
|
|
716
|
-
function
|
|
716
|
+
function wl(e, t) {
|
|
717
717
|
return ge(t) ? Pn(e, t) : je(t) ? La(e, t) : null;
|
|
718
718
|
}
|
|
719
|
-
function
|
|
719
|
+
function er(e, t = false) {
|
|
720
720
|
return !t || !Y(e);
|
|
721
721
|
}
|
|
722
722
|
function Rn(e, t = false) {
|
|
723
|
-
return !t ||
|
|
723
|
+
return !t || j(e);
|
|
724
724
|
}
|
|
725
725
|
function Nn(e, t) {
|
|
726
726
|
return !z(t) || L(e) && e.length >= t;
|
|
@@ -738,12 +738,12 @@ var require_main_min = __commonJS({
|
|
|
738
738
|
return !z(t) && !L(t) || (z(e) || L(e)) && e >= t;
|
|
739
739
|
}
|
|
740
740
|
function jn(e, t) {
|
|
741
|
-
return !z(t) ||
|
|
741
|
+
return !z(t) || j(e) && e.length >= t;
|
|
742
742
|
}
|
|
743
743
|
function Vn(e, t) {
|
|
744
|
-
return !z(t) ||
|
|
744
|
+
return !z(t) || j(e) && e.length <= t;
|
|
745
745
|
}
|
|
746
|
-
function
|
|
746
|
+
function _e(e, t, r) {
|
|
747
747
|
if (t.const)
|
|
748
748
|
return Va(e, t, r);
|
|
749
749
|
if (I(e))
|
|
@@ -758,9 +758,9 @@ var require_main_min = __commonJS({
|
|
|
758
758
|
case "boolean":
|
|
759
759
|
return ja(e, t, r);
|
|
760
760
|
case "array":
|
|
761
|
-
return
|
|
761
|
+
return It(e, t, r);
|
|
762
762
|
case "object":
|
|
763
|
-
return
|
|
763
|
+
return Cl(e, t);
|
|
764
764
|
default:
|
|
765
765
|
return [];
|
|
766
766
|
}
|
|
@@ -771,28 +771,28 @@ var require_main_min = __commonJS({
|
|
|
771
771
|
if (e === "" && r)
|
|
772
772
|
return ["required"];
|
|
773
773
|
let a = [];
|
|
774
|
-
return
|
|
774
|
+
return er(e, r) || a.push("required"), Nn(e, t.minLength) || a.push("minLength"), Bn(e, t.maxLength) || a.push("maxLength"), zn(e, t.pattern) || a.push("pattern"), Na(e, t.minimum) || a.push("minimum"), Ra(e, t.maximum) || a.push("maximum"), a;
|
|
775
775
|
}
|
|
776
776
|
function Tr(e, t, r) {
|
|
777
777
|
if (!z(e) && !I(e))
|
|
778
778
|
return ["type"];
|
|
779
779
|
let a = [];
|
|
780
|
-
return
|
|
780
|
+
return er(e, r) || a.push("required"), Na(e, t.minimum) || a.push("minimum"), Ra(e, t.maximum) || a.push("maximum"), a;
|
|
781
781
|
}
|
|
782
782
|
function za(e, t, r) {
|
|
783
783
|
return An(e) ? Tr(e, t, r) : ["type"];
|
|
784
784
|
}
|
|
785
785
|
function ja(e, t, r) {
|
|
786
|
-
if (!
|
|
786
|
+
if (!Ie(e) && !I(e))
|
|
787
787
|
return ["type"];
|
|
788
788
|
let a = [];
|
|
789
|
-
return
|
|
789
|
+
return er(e, r) || a.push("required"), a;
|
|
790
790
|
}
|
|
791
791
|
function Va(e, t, r) {
|
|
792
|
-
return
|
|
792
|
+
return er(e, r) ? e !== t.const ? ["const"] : [] : ["required"];
|
|
793
793
|
}
|
|
794
|
-
function
|
|
795
|
-
if (!
|
|
794
|
+
function It(e, t, r) {
|
|
795
|
+
if (!j(e) && !I(e))
|
|
796
796
|
return ["type"];
|
|
797
797
|
if (!Rn(e, r))
|
|
798
798
|
return ["required"];
|
|
@@ -802,69 +802,69 @@ var require_main_min = __commonJS({
|
|
|
802
802
|
function Un(e, t) {
|
|
803
803
|
return I(e) ? ["type"] : [];
|
|
804
804
|
}
|
|
805
|
-
function
|
|
806
|
-
return $(e) ?
|
|
805
|
+
function Cl(e, t) {
|
|
806
|
+
return $(e) ? j(t.required) ? t.required.map((a) => typeof e[a] != "undefined").reduce((a, o) => a && o, true) ? [] : ["required"] : [] : ["type"];
|
|
807
807
|
}
|
|
808
|
-
function
|
|
808
|
+
function Sl(e, t) {
|
|
809
809
|
return !Ba(e, t).length;
|
|
810
810
|
}
|
|
811
|
-
function
|
|
811
|
+
function Fl(e, t) {
|
|
812
812
|
return !Tr(e, t).length;
|
|
813
813
|
}
|
|
814
|
-
function
|
|
814
|
+
function bl(e, t) {
|
|
815
815
|
return !za(e, t).length;
|
|
816
816
|
}
|
|
817
|
-
function
|
|
817
|
+
function xl(e, t) {
|
|
818
818
|
return !ja(e, t).length;
|
|
819
819
|
}
|
|
820
|
-
function
|
|
820
|
+
function vl(e, t) {
|
|
821
821
|
return !Va(e, t).length;
|
|
822
822
|
}
|
|
823
|
-
function
|
|
824
|
-
return !R(e) || t.type !== "object" || !R(t.properties) ? false : Object.keys(t.properties).map((r) =>
|
|
823
|
+
function Al(e, t) {
|
|
824
|
+
return !R(e) || t.type !== "object" || !R(t.properties) ? false : Object.keys(t.properties).map((r) => Ol(e[r], t.properties[r], t.required && t.required.includes(r))).every((r) => r);
|
|
825
825
|
}
|
|
826
|
-
function
|
|
826
|
+
function Ol(e, t, r) {
|
|
827
827
|
return t.hidden ? true : typeof e == "undefined" ? !r : G(e, t);
|
|
828
828
|
}
|
|
829
|
+
function Pl(e, t) {
|
|
830
|
+
return t.type !== "array" || !R(t.items) || It(e, t).length > 0 ? false : Array.isArray(e) && De(t) && e.map((r) => G(r, t.items)).every((r) => r);
|
|
831
|
+
}
|
|
829
832
|
function Ml(e, t) {
|
|
830
|
-
return
|
|
833
|
+
return j(t.oneOf) ? t.oneOf.some((r) => G(e, r)) : false;
|
|
831
834
|
}
|
|
832
835
|
function kl(e, t) {
|
|
833
|
-
return
|
|
836
|
+
return j(t.allOf) ? t.allOf.map((r) => G(e, r)).every((r) => r) : false;
|
|
834
837
|
}
|
|
835
838
|
function El(e, t) {
|
|
836
|
-
return V(t.allOf) ? t.allOf.map((r) => G(e, r)).every((r) => r) : false;
|
|
837
|
-
}
|
|
838
|
-
function Il(e, t) {
|
|
839
839
|
return !Un(e, t).length;
|
|
840
840
|
}
|
|
841
841
|
function G(e, t) {
|
|
842
842
|
if (t.oneOf)
|
|
843
|
-
return
|
|
843
|
+
return Ml(e, t);
|
|
844
844
|
if (t.allOf)
|
|
845
|
-
return
|
|
845
|
+
return kl(e, t);
|
|
846
846
|
if (t.const)
|
|
847
|
-
return
|
|
847
|
+
return vl(e, t);
|
|
848
848
|
switch (t.type) {
|
|
849
849
|
case "string":
|
|
850
|
-
return
|
|
850
|
+
return Sl(e, t);
|
|
851
851
|
case "number":
|
|
852
|
-
return
|
|
852
|
+
return Fl(e, t);
|
|
853
853
|
case "integer":
|
|
854
|
-
return
|
|
854
|
+
return bl(e, t);
|
|
855
855
|
case "boolean":
|
|
856
|
-
return
|
|
856
|
+
return xl(e, t);
|
|
857
857
|
case "array":
|
|
858
|
-
return
|
|
858
|
+
return Pl(e, t);
|
|
859
859
|
case "object":
|
|
860
|
-
return
|
|
860
|
+
return Al(e, t);
|
|
861
861
|
case "blob":
|
|
862
|
-
return
|
|
862
|
+
return El(e, t);
|
|
863
863
|
default:
|
|
864
864
|
return false;
|
|
865
865
|
}
|
|
866
866
|
}
|
|
867
|
-
function
|
|
867
|
+
function Il(e) {
|
|
868
868
|
let t = new Date(e), r = String(t.getMonth() + 1), a = String(t.getDate()), o = t.getFullYear(), n = r.length < 2 ? `0${r}` : r, i = a.length < 2 ? `0${a}` : a;
|
|
869
869
|
return [o, n, i].join("-");
|
|
870
870
|
}
|
|
@@ -874,8 +874,8 @@ var require_main_min = __commonJS({
|
|
|
874
874
|
let [t, r, a] = e.split("-").map((o) => parseInt(o, 10));
|
|
875
875
|
return !z(t) || !z(r) || !z(a) ? null : new Date(t, r - 1, a);
|
|
876
876
|
};
|
|
877
|
-
var qn = (e) =>
|
|
878
|
-
var
|
|
877
|
+
var qn = (e) => Il(e);
|
|
878
|
+
var Ke = (e, t) => {
|
|
879
879
|
let r, a, o = () => {
|
|
880
880
|
r && (clearTimeout(r), r = null), a = null;
|
|
881
881
|
}, n = (...i) => {
|
|
@@ -889,10 +889,10 @@ var require_main_min = __commonJS({
|
|
|
889
889
|
r !== null && (e(...a), o());
|
|
890
890
|
}, n;
|
|
891
891
|
};
|
|
892
|
-
var
|
|
893
|
-
var
|
|
892
|
+
var Je = (e, t) => e === t ? true : Array.isArray(e) && Array.isArray(t) ? e.length === t.length && e.every((r, a) => Je(r, t[a])) : !!(Gn(e) && Gn(t) && Dl(e, t));
|
|
893
|
+
var Dl = (e, t) => {
|
|
894
894
|
let r = Object.keys(e), a = Object.keys(t);
|
|
895
|
-
return r.length === a.length && r.every((o) => Object.hasOwnProperty.call(t, o) &&
|
|
895
|
+
return r.length === a.length && r.every((o) => Object.hasOwnProperty.call(t, o) && Je(e[o], t[o]));
|
|
896
896
|
};
|
|
897
897
|
var Gn = (e) => typeof e == "object" && e !== null;
|
|
898
898
|
function Nr(e) {
|
|
@@ -911,20 +911,20 @@ var require_main_min = __commonJS({
|
|
|
911
911
|
}
|
|
912
912
|
return true;
|
|
913
913
|
}
|
|
914
|
-
var
|
|
914
|
+
var Te = (e = "") => `${e ? `${e}-` : ""}${Math.floor(1e8 * Math.random())}`;
|
|
915
915
|
function we(e) {
|
|
916
916
|
return !Y(e == null ? void 0 : e.const);
|
|
917
917
|
}
|
|
918
|
-
function
|
|
918
|
+
function tr(e) {
|
|
919
919
|
return !!e && !we(e);
|
|
920
920
|
}
|
|
921
|
-
var
|
|
922
|
-
var
|
|
923
|
-
var
|
|
921
|
+
var Ll = (e) => !!e.readOnly && Ve(e);
|
|
922
|
+
var Tl = (e) => !!e.oneOf && !!e.promotion;
|
|
923
|
+
var Rl = /* @__PURE__ */ new Set(["string", "number", "integer", "boolean"]);
|
|
924
924
|
function Ve(e) {
|
|
925
|
-
return
|
|
925
|
+
return Rl.has(e.type || "") || "const" in e && e.const !== void 0;
|
|
926
926
|
}
|
|
927
|
-
function
|
|
927
|
+
function Le(e) {
|
|
928
928
|
return e.type === "object";
|
|
929
929
|
}
|
|
930
930
|
function lt(e) {
|
|
@@ -936,13 +936,13 @@ var require_main_min = __commonJS({
|
|
|
936
936
|
function Ua(e) {
|
|
937
937
|
return !!e.allOf;
|
|
938
938
|
}
|
|
939
|
-
function
|
|
939
|
+
function Dt(e) {
|
|
940
940
|
return e.type === "blob";
|
|
941
941
|
}
|
|
942
942
|
function je(e) {
|
|
943
943
|
return e.type === "array";
|
|
944
944
|
}
|
|
945
|
-
function
|
|
945
|
+
function De(e) {
|
|
946
946
|
let t = e.items;
|
|
947
947
|
return !Array.isArray(t);
|
|
948
948
|
}
|
|
@@ -952,48 +952,48 @@ var require_main_min = __commonJS({
|
|
|
952
952
|
function Br(e) {
|
|
953
953
|
return !!e.persistAsync;
|
|
954
954
|
}
|
|
955
|
-
function
|
|
956
|
-
return Br(e) && (
|
|
955
|
+
function Nl(e) {
|
|
956
|
+
return Br(e) && (Dt(e.persistAsync.schema) || Bl(e.persistAsync.schema));
|
|
957
957
|
}
|
|
958
958
|
var Ha = (e) => Ve(e) && !!e.validationAsync;
|
|
959
|
-
function
|
|
959
|
+
function Bl(e) {
|
|
960
960
|
return e.type === "string" && e.format === "base64url";
|
|
961
961
|
}
|
|
962
962
|
function _n(e) {
|
|
963
963
|
return e.type === "string" && e.format === "base64url";
|
|
964
964
|
}
|
|
965
|
-
var Kn = (e) => je(e) &&
|
|
966
|
-
var dt = (e) =>
|
|
967
|
-
var Jn = (e) =>
|
|
968
|
-
var
|
|
969
|
-
var
|
|
965
|
+
var Kn = (e) => je(e) && De(e) && Nl(e.items);
|
|
966
|
+
var dt = (e) => Ll(e) ? "readOnly" : Br(e) ? "persistAsync" : Ha(e) ? "validationAsync" : Le(e) ? "object" : je(e) ? "array" : Tl(e) ? "promotedOneOf" : ge(e) ? "oneOf" : Ua(e) ? "allOf" : Ve(e) ? "basic" : null;
|
|
967
|
+
var Jn = (e) => zl(e) && jl(e) && Vl(e);
|
|
968
|
+
var zl = (e) => !e.type || e.type === "form";
|
|
969
|
+
var jl = (e) => {
|
|
970
970
|
var t;
|
|
971
971
|
return ((t = e == null ? void 0 : e.actions) == null ? void 0 : t.length) === 1;
|
|
972
972
|
};
|
|
973
|
-
var
|
|
973
|
+
var Vl = (e) => {
|
|
974
974
|
if (!e.schemas)
|
|
975
975
|
return false;
|
|
976
976
|
let t = zr(e.schemas);
|
|
977
977
|
if ((t == null ? void 0 : t.length) !== 1)
|
|
978
978
|
return false;
|
|
979
979
|
let r = t[0];
|
|
980
|
-
if (!
|
|
980
|
+
if (!Le(r) || Object.values(r.properties).length !== 1)
|
|
981
981
|
return false;
|
|
982
982
|
let a = Object.values(r.properties)[0];
|
|
983
983
|
return _n(a) ? a.source === "camera" : false;
|
|
984
984
|
};
|
|
985
|
-
var zr = (e) => e.filter((t) =>
|
|
985
|
+
var zr = (e) => e.filter((t) => Le(t) ? Object.values((t == null ? void 0 : t.properties) || {}).find((r) => (r == null ? void 0 : r.hidden) !== true) : (t == null ? void 0 : t.hidden) !== true);
|
|
986
986
|
var $ = (e) => typeof e == "object" && e !== null && e.constructor === Object;
|
|
987
987
|
var qa = (e) => I(e) || $(e);
|
|
988
|
-
var Ga = (e) =>
|
|
988
|
+
var Ga = (e) => Ie(e) || z(e) || L(e) || I(e);
|
|
989
989
|
var jr = (e) => L(e) || I(e);
|
|
990
|
-
var Ta = (e) =>
|
|
990
|
+
var Ta = (e) => j(e) ? e.length === 0 ? true : e.every((t) => typeof t == "string" || typeof t == "number" || typeof t == "boolean" || typeof t == "object") : false;
|
|
991
991
|
var Xn = (e) => I(e) ? true : Ta(e);
|
|
992
|
-
var
|
|
993
|
-
var Yn = () =>
|
|
994
|
-
var
|
|
995
|
-
var
|
|
996
|
-
var
|
|
992
|
+
var rr = (e) => L(e) || I(e);
|
|
993
|
+
var Yn = () => Hl() && (ql() || Ul());
|
|
994
|
+
var Ul = (e = window.navigator.userAgent) => /mobi|\b(iphone|android|blackberry|webos|windows phone)\b/i.test(e);
|
|
995
|
+
var Hl = (e = window.screen.width, t = window.screen.height) => e < 768 || t < 768;
|
|
996
|
+
var ql = (e = window.navigator, t = window.matchMedia) => {
|
|
997
997
|
if ("maxTouchPoints" in e)
|
|
998
998
|
return e.maxTouchPoints > 0;
|
|
999
999
|
let r = t == null ? void 0 : t("(pointer:coarse)");
|
|
@@ -1001,18 +1001,18 @@ var require_main_min = __commonJS({
|
|
|
1001
1001
|
};
|
|
1002
1002
|
var Zn = require("react");
|
|
1003
1003
|
function Qn(e, t) {
|
|
1004
|
-
return (0, Zn.useCallback)(
|
|
1004
|
+
return (0, Zn.useCallback)(Ke(e, t), [e, t]);
|
|
1005
1005
|
}
|
|
1006
|
-
var
|
|
1006
|
+
var ar = require("react");
|
|
1007
1007
|
function ei(e) {
|
|
1008
|
-
let [t, r] = (0,
|
|
1009
|
-
return (0,
|
|
1008
|
+
let [t, r] = (0, ar.useState)(null), [a, o] = (0, ar.useState)(false), n = () => o(true);
|
|
1009
|
+
return (0, ar.useEffect)(() => {
|
|
1010
1010
|
e && (o(false), r(window.open(e, "_blank")));
|
|
1011
1011
|
}, [e]), { requiresManualTrigger: !!(e && !t && !a), dismissConfirmation: n };
|
|
1012
1012
|
}
|
|
1013
|
-
var
|
|
1013
|
+
var or = require("react");
|
|
1014
1014
|
function ti(e, t) {
|
|
1015
|
-
let r = ae(), a = (0,
|
|
1015
|
+
let r = ae(), a = (0, or.useMemo)(() => {
|
|
1016
1016
|
if (e)
|
|
1017
1017
|
return () => r(e.url).then((n) => {
|
|
1018
1018
|
if (n.ok)
|
|
@@ -1026,7 +1026,7 @@ var require_main_min = __commonJS({
|
|
|
1026
1026
|
}).catch((n) => {
|
|
1027
1027
|
throw new Error(n.message === "failed" ? "failed" : "network failed");
|
|
1028
1028
|
});
|
|
1029
|
-
}, [e, r]), o = (0,
|
|
1029
|
+
}, [e, r]), o = (0, or.useCallback)((n) => {
|
|
1030
1030
|
let c = ((e == null ? void 0 : e.responseHandlers) || []).find((l) => l.result === n.result);
|
|
1031
1031
|
if (c != null && c.action) {
|
|
1032
1032
|
let { action: l } = c;
|
|
@@ -1041,37 +1041,37 @@ var require_main_min = __commonJS({
|
|
|
1041
1041
|
}
|
|
1042
1042
|
return true;
|
|
1043
1043
|
}, [e == null ? void 0 : e.responseHandlers, t]);
|
|
1044
|
-
Vr({ asyncFn: a, interval: (e == null ? void 0 : e.interval) || 0, maxAttempts: (e == null ? void 0 : e.maxAttempts) || 0, maxConsecutiveFails: (e == null ? void 0 : e.maxConsecutiveFails) || 0, onPollingResponse: o, onFailure: (0,
|
|
1044
|
+
Vr({ asyncFn: a, interval: (e == null ? void 0 : e.interval) || 0, maxAttempts: (e == null ? void 0 : e.maxAttempts) || 0, maxConsecutiveFails: (e == null ? void 0 : e.maxConsecutiveFails) || 0, onPollingResponse: o, onFailure: (0, or.useCallback)(() => {
|
|
1045
1045
|
e && t(e.onError.action);
|
|
1046
1046
|
}, [t, e]) });
|
|
1047
1047
|
}
|
|
1048
1048
|
var wc = require("react");
|
|
1049
1049
|
var Cc = require("react-intl");
|
|
1050
1050
|
var ri = require("react-intl");
|
|
1051
|
-
var
|
|
1051
|
+
var nr = (0, ri.defineMessages)({ genericError: { id: "dynamicFlows.PersistAsyncSchema.genericError", defaultMessage: "Something went wrong, please try again later!", description: "Generic error message for persist async schema" } });
|
|
1052
1052
|
var bt = require("react");
|
|
1053
1053
|
var pc = require("react-intl");
|
|
1054
1054
|
var ai = { DAY_MONTH_YEAR: "day-month-year", MONTH_YEAR: "month-year" };
|
|
1055
1055
|
var N = { RADIO: "radio", CHECKBOX: "checkbox", SELECT: "select", EMAIL: "email", FILE: "file", DATE: "date", DATETIME: "date-time", DATELOOKUP: "date-lookup", TEL: "tel", NUMERIC: "numeric", NUMBER: "number", HIDDEN: "hidden", PASSWORD: "password", TEXT: "text", TEXTAREA: "textarea", UPLOAD: "upload", TAB: "tab" };
|
|
1056
1056
|
var oi = { SHORT: "short", LONG: "long" };
|
|
1057
1057
|
var ni = { EXTRA_SMALL: "xs", SMALL: "sm", MEDIUM: "md", LARGE: "lg", EXTRA_LARGE: "xl" };
|
|
1058
|
-
var dc =
|
|
1058
|
+
var dc = Ee(Xe());
|
|
1059
1059
|
var de = require("react");
|
|
1060
1060
|
var ui = require("@transferwise/components");
|
|
1061
|
-
var
|
|
1061
|
+
var Tt = require("@transferwise/components");
|
|
1062
1062
|
var si = require("react/jsx-runtime");
|
|
1063
|
-
var
|
|
1063
|
+
var Lt = (e) => Gl(e) || Wl(e);
|
|
1064
|
+
var Gl = (e) => $l.some((t) => e === `flag-${t}`);
|
|
1064
1065
|
var Wl = (e) => _l.some((t) => e === `flag-${t}`);
|
|
1065
|
-
var $l = (e) => Kl.some((t) => e === `flag-${t}`);
|
|
1066
1066
|
var ii = ({ name: e }) => {
|
|
1067
|
-
if (!
|
|
1067
|
+
if (!Lt(e))
|
|
1068
1068
|
return null;
|
|
1069
1069
|
let t = e.substring(5);
|
|
1070
1070
|
return (0, si.jsx)("img", { src: `https://wise.com/web-art/assets/flags/${t}.svg`, alt: "", "data-testid": `img-flag-${t}` });
|
|
1071
1071
|
};
|
|
1072
|
-
var
|
|
1073
|
-
var
|
|
1074
|
-
var ci =
|
|
1072
|
+
var $l = ["aed", "ars", "aud", "bdt", "bgn", "bhd", "bnd", "brl", "bwp", "cad", "chf", "clp", "cny", "cop", "crc", "czk", "dkk", "egp", "eur", "fjd", "gbp", "gel", "ghs", "gtq", "hkd", "hrk", "huf", "idr", "ils", "imp", "inr", "isk", "jmd", "jpy", "kes", "krw", "kwd", "lak", "lkr", "lsl", "mad", "mur", "mxn", "myr", "mzn", "nad", "ngn", "nok", "npr", "nzd", "omr", "pab", "pen", "php", "pkr", "pln", "qar", "ron", "rub", "sar", "sek", "sgd", "thb", "tmt", "try", "twd", "tzs", "uah", "ugx", "usd", "uyu", "vnd", "xof", "zar", "zmw"];
|
|
1073
|
+
var _l = ["ad", "ae", "ar", "at", "au", "bd", "be", "bg", "bh", "bn", "br", "bw", "ca", "ch", "cl", "cn", "co", "cr", "cy", "cz", "de", "dk", "ee", "eg", "es", "eu", "fi", "fj", "fr", "gb", "ge", "gg", "gh", "gp", "gr", "gt", "hk", "hr", "hu", "id", "ie", "il", "im", "in", "is", "it", "je", "jm", "jp", "ke", "kr", "kw", "la", "li", "lk", "ls", "lt", "lu", "lv", "ma", "mc", "mt", "mu", "mx", "my", "mz", "na", "ng", "nl", "no", "np", "nz", "om", "pa", "pe", "ph", "pk", "pl", "pt", "qa", "ro", "ru", "sa", "se", "sg", "si", "sk", "sm", "th", "tm", "tr", "tw", "tz", "ua", "ug", "us", "uy", "va", "vn", "wi", "xo", "za", "zm"];
|
|
1074
|
+
var ci = Ee(require("@transferwise/icons"));
|
|
1075
1075
|
var di = require("react/jsx-runtime");
|
|
1076
1076
|
var Hr = (e) => {
|
|
1077
1077
|
let t = li(e);
|
|
@@ -1083,30 +1083,30 @@ var require_main_min = __commonJS({
|
|
|
1083
1083
|
let t = li(e), r = ci[t];
|
|
1084
1084
|
return (0, di.jsx)(r, { size: 24 });
|
|
1085
1085
|
};
|
|
1086
|
-
var li = (e) => e.split("-").map(
|
|
1087
|
-
var
|
|
1086
|
+
var li = (e) => e.split("-").map(Kl).join("");
|
|
1087
|
+
var Kl = (e) => {
|
|
1088
1088
|
var t;
|
|
1089
1089
|
return `${(t = e[0]) == null ? void 0 : t.toUpperCase()}${e.slice(1)}`;
|
|
1090
1090
|
};
|
|
1091
1091
|
var Wa = require("react/jsx-runtime");
|
|
1092
|
-
var
|
|
1092
|
+
var Jl = ({ type: e }) => Lt(e) ? (0, Wa.jsx)(ii, { name: e }) : Hr(e) ? (0, Wa.jsx)(mi, { name: e }) : null;
|
|
1093
1093
|
function $a(e) {
|
|
1094
|
-
return Hr(e) ||
|
|
1094
|
+
return Hr(e) || Lt(e);
|
|
1095
1095
|
}
|
|
1096
|
-
var
|
|
1097
|
-
var
|
|
1096
|
+
var Ye = Jl;
|
|
1097
|
+
var ir = require("react/jsx-runtime");
|
|
1098
1098
|
var ut = ({ icon: e, image: t }) => {
|
|
1099
1099
|
if (e != null && e.name)
|
|
1100
|
-
return (0,
|
|
1100
|
+
return (0, ir.jsx)(Tt.Avatar, { type: Tt.AvatarType.ICON, children: (0, ir.jsx)(Ye, { type: e.name }) });
|
|
1101
1101
|
if (e != null && e.text)
|
|
1102
|
-
return (0,
|
|
1102
|
+
return (0, ir.jsx)(Tt.Avatar, { type: Tt.AvatarType.INITIALS, children: e.text });
|
|
1103
1103
|
if (t != null && t.url) {
|
|
1104
1104
|
let { url: r, text: a } = t;
|
|
1105
|
-
return (0,
|
|
1105
|
+
return (0, ir.jsx)("img", { src: r, alt: a });
|
|
1106
1106
|
}
|
|
1107
1107
|
return null;
|
|
1108
1108
|
};
|
|
1109
|
-
var
|
|
1109
|
+
var V = (e) => {
|
|
1110
1110
|
switch (e) {
|
|
1111
1111
|
case "xs":
|
|
1112
1112
|
return "m-b-0";
|
|
@@ -1122,7 +1122,7 @@ var require_main_min = __commonJS({
|
|
|
1122
1122
|
return "";
|
|
1123
1123
|
}
|
|
1124
1124
|
};
|
|
1125
|
-
var
|
|
1125
|
+
var Xl = (e) => {
|
|
1126
1126
|
switch (e) {
|
|
1127
1127
|
case "right":
|
|
1128
1128
|
return "text-xs-right";
|
|
@@ -1133,13 +1133,13 @@ var require_main_min = __commonJS({
|
|
|
1133
1133
|
return "";
|
|
1134
1134
|
}
|
|
1135
1135
|
};
|
|
1136
|
-
var Ce = (e) => `${
|
|
1136
|
+
var Ce = (e) => `${Xl(e.align)} ${V(e.margin)}`;
|
|
1137
1137
|
var pi = require("react/jsx-runtime");
|
|
1138
|
-
var
|
|
1138
|
+
var Yl = (e) => {
|
|
1139
1139
|
let t = e.component;
|
|
1140
|
-
return (0, pi.jsx)(ui.Alert, { type:
|
|
1140
|
+
return (0, pi.jsx)(ui.Alert, { type: Ql(Zl(t.context)), className: V(t.margin), message: t.markdown });
|
|
1141
1141
|
};
|
|
1142
|
-
var
|
|
1142
|
+
var Zl = (e) => {
|
|
1143
1143
|
switch (e) {
|
|
1144
1144
|
case "success":
|
|
1145
1145
|
return "positive";
|
|
@@ -1154,15 +1154,15 @@ var require_main_min = __commonJS({
|
|
|
1154
1154
|
return e;
|
|
1155
1155
|
}
|
|
1156
1156
|
};
|
|
1157
|
-
var
|
|
1158
|
-
var se =
|
|
1157
|
+
var Ql = (e) => !e || !["neutral", "warning", "negative", "positive"].includes(e) ? "neutral" : e;
|
|
1158
|
+
var se = Yl;
|
|
1159
1159
|
var pt = require("react/jsx-runtime");
|
|
1160
|
-
var
|
|
1161
|
-
let t = e.component, r =
|
|
1162
|
-
return !t.width || t.width === "xl" ? (0, pt.jsx)("div", { className: r + yi(t.border), children: (0, pt.jsx)(ne, { components: t.components, model: e.model, submitted: e.submitted, errors: e.errors, onModelChange: e.onModelChange, onAction: e.onAction, onPersistAsync: e.onPersistAsync }) }) : (0, pt.jsx)("div", { className: "row", children: (0, pt.jsx)("div", { className: r +
|
|
1160
|
+
var ed = (e) => {
|
|
1161
|
+
let t = e.component, r = V(t.margin || t.border ? "lg" : "xs");
|
|
1162
|
+
return !t.width || t.width === "xl" ? (0, pt.jsx)("div", { className: r + yi(t.border), children: (0, pt.jsx)(ne, { components: t.components, model: e.model, submitted: e.submitted, errors: e.errors, onModelChange: e.onModelChange, onAction: e.onAction, onPersistAsync: e.onPersistAsync }) }) : (0, pt.jsx)("div", { className: "row", children: (0, pt.jsx)("div", { className: r + td(t), children: (0, pt.jsx)("div", { className: yi(t.border), children: (0, pt.jsx)(ne, { components: t.components, model: e.model, submitted: e.submitted, errors: e.errors, onModelChange: e.onModelChange, onAction: e.onAction, onPersistAsync: e.onPersistAsync }) }) }) });
|
|
1163
1163
|
};
|
|
1164
1164
|
var yi = (e) => e ? " well p-b-0" : "";
|
|
1165
|
-
var
|
|
1165
|
+
var td = (e) => {
|
|
1166
1166
|
switch (e.width) {
|
|
1167
1167
|
case "xs":
|
|
1168
1168
|
return " col-md-4 col-md-offset-4";
|
|
@@ -1177,18 +1177,18 @@ var require_main_min = __commonJS({
|
|
|
1177
1177
|
return " col-xs-12";
|
|
1178
1178
|
}
|
|
1179
1179
|
};
|
|
1180
|
-
var _a =
|
|
1180
|
+
var _a = ed;
|
|
1181
1181
|
var wi = require("@transferwise/components");
|
|
1182
|
-
var
|
|
1182
|
+
var rd = { primary: "primary", secondary: "secondary", link: "tertiary", positive: "primary", negative: "primary" };
|
|
1183
1183
|
var fi = (e) => {
|
|
1184
1184
|
var r;
|
|
1185
1185
|
let t = e.action.type;
|
|
1186
|
-
return (r = e.control) != null ? r : t ?
|
|
1186
|
+
return (r = e.control) != null ? r : t ? rd[t] : "secondary";
|
|
1187
1187
|
};
|
|
1188
|
-
var
|
|
1188
|
+
var ad = { primary: "neutral", secondary: "neutral", link: "neutral", positive: "positive", negative: "negative" };
|
|
1189
1189
|
var hi = (e) => {
|
|
1190
1190
|
var a;
|
|
1191
|
-
let t = e.action.type, r = (a = e.context) != null ? a : t ?
|
|
1191
|
+
let t = e.action.type, r = (a = e.context) != null ? a : t ? ad[t] : "neutral";
|
|
1192
1192
|
return r === "neutral" ? "accent" : r;
|
|
1193
1193
|
};
|
|
1194
1194
|
var gi = (e) => {
|
|
@@ -1205,66 +1205,70 @@ var require_main_min = __commonJS({
|
|
|
1205
1205
|
}
|
|
1206
1206
|
};
|
|
1207
1207
|
var Ci = require("react/jsx-runtime");
|
|
1208
|
-
var
|
|
1208
|
+
var od = (e) => {
|
|
1209
1209
|
var l;
|
|
1210
|
-
let { component: t, onAction: r } = e, a = t.action, o = hi(t), n = fi(t), { loading: i } =
|
|
1210
|
+
let { component: t, onAction: r } = e, a = t.action, o = hi(t), n = fi(t), { loading: i } = At(), c = V(t.margin || "md");
|
|
1211
1211
|
return (0, Ci.jsx)(wi.Button, { size: gi(t.size), type: n === "tertiary" ? void 0 : o, priority: n, block: true, className: c, disabled: t.disabled || a.disabled || i, onClick: () => r(a), children: (l = t.title) != null ? l : a.title });
|
|
1212
1212
|
};
|
|
1213
|
-
var Ka =
|
|
1213
|
+
var Ka = od;
|
|
1214
1214
|
var yt = require("react/jsx-runtime");
|
|
1215
|
-
var
|
|
1216
|
-
let t = e.component, { leftWidth: r, rightWidth: a } =
|
|
1217
|
-
return (0, yt.jsxs)("div", { className: `${
|
|
1215
|
+
var nd = (e) => {
|
|
1216
|
+
let t = e.component, { leftWidth: r, rightWidth: a } = id(t.bias);
|
|
1217
|
+
return (0, yt.jsxs)("div", { className: `${V(t.margin || "xs")} row`, children: [(0, yt.jsx)("div", { className: `${r} m-b-0`, children: (0, yt.jsx)(ne, { components: t.left, model: e.model, submitted: e.submitted, errors: e.errors, onModelChange: e.onModelChange, onAction: e.onAction, onPersistAsync: e.onPersistAsync }) }), (0, yt.jsx)("div", { className: `${a} m-b-0`, children: (0, yt.jsx)(ne, { components: t.right, model: e.model, submitted: e.submitted, errors: e.errors, onModelChange: e.onModelChange, onAction: e.onAction, onPersistAsync: e.onPersistAsync }) })] });
|
|
1218
1218
|
};
|
|
1219
|
-
var
|
|
1220
|
-
var Ja =
|
|
1219
|
+
var id = (e) => e === "left" ? { leftWidth: "col-md-8", rightWidth: "col-md-4" } : e === "right" ? { leftWidth: "col-md-4", rightWidth: "col-md-8" } : { leftWidth: "col-md-6", rightWidth: "col-md-6" };
|
|
1220
|
+
var Ja = nd;
|
|
1221
1221
|
var Gr = require("@transferwise/components");
|
|
1222
1222
|
var qr = require("react/jsx-runtime");
|
|
1223
|
-
function
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1223
|
+
function sd({ component: e, onAction: t }) {
|
|
1224
|
+
let { loading: r } = At();
|
|
1225
|
+
return (0, qr.jsx)("div", { className: V(e.margin), children: (0, qr.jsx)(Gr.NavigationOptionsList, { children: e.options.map((a) => {
|
|
1226
|
+
var o;
|
|
1227
|
+
return (0, qr.jsx)(Gr.NavigationOption, { title: a.title, content: a.description, disabled: (o = a.disabled) != null ? o : r, media: ut(a), showMediaCircle: false, showMediaAtAllSizes: true, onClick: () => t(a.action) }, JSON.stringify(a));
|
|
1228
|
+
}) }) });
|
|
1229
|
+
}
|
|
1230
|
+
var Xa = sd;
|
|
1227
1231
|
var Si = require("react/jsx-runtime");
|
|
1228
|
-
var
|
|
1229
|
-
let r = `m-t-0 ${
|
|
1232
|
+
var cd = ({ component: e }) => {
|
|
1233
|
+
let r = `m-t-0 ${V(e.margin)}`;
|
|
1230
1234
|
return (0, Si.jsx)("hr", { className: r });
|
|
1231
1235
|
};
|
|
1232
|
-
var Ya =
|
|
1233
|
-
var
|
|
1236
|
+
var Ya = cd;
|
|
1237
|
+
var Rt = require("@transferwise/components");
|
|
1234
1238
|
var Wr = require("react");
|
|
1235
1239
|
var xi = require("react-intl");
|
|
1236
1240
|
var Fi = require("react-intl");
|
|
1237
1241
|
var bi = (0, Fi.defineMessages)({ retryTitle: { id: "dynamicFlows.DynamicExternal.retryTitle", defaultMessage: "Reopen window", description: "" } });
|
|
1238
|
-
var
|
|
1239
|
-
var
|
|
1242
|
+
var Ze = require("react/jsx-runtime");
|
|
1243
|
+
var md = ({ component: e, onAction: t }) => {
|
|
1240
1244
|
let { requestUrl: r, responseHandlers: a, polling: o, retryTitle: n } = e, i = (0, xi.useIntl)(), c = (0, Wr.useCallback)(() => window.open(r, "df-external-window"), [r]);
|
|
1241
1245
|
(0, Wr.useEffect)(() => {
|
|
1242
1246
|
c();
|
|
1243
1247
|
}, [c]);
|
|
1244
1248
|
let l = o && a ? C(s({}, o), { responseHandlers: a }) : void 0;
|
|
1245
|
-
return ti(l, t), (0,
|
|
1249
|
+
return ti(l, t), (0, Ze.jsxs)(Ze.Fragment, { children: [(0, Ze.jsx)(Rt.Loader, { size: Rt.Size.LARGE, classNames: { "tw-loader": "tw-loader m-x-auto" } }), (0, Ze.jsx)("br", {}), (0, Ze.jsx)(Rt.Button, { priority: "tertiary", block: true, onClick: c, children: n || i.formatMessage(bi.retryTitle) })] });
|
|
1246
1250
|
};
|
|
1247
|
-
var Za =
|
|
1251
|
+
var Za = md;
|
|
1248
1252
|
var Gs = require("react");
|
|
1249
1253
|
var vi = require("@transferwise/components");
|
|
1250
|
-
var Ai =
|
|
1254
|
+
var Ai = Ee(Xe());
|
|
1251
1255
|
var Oi = require("react");
|
|
1252
|
-
var
|
|
1253
|
-
var
|
|
1254
|
-
var
|
|
1255
|
-
var
|
|
1256
|
+
var Re = require("react/jsx-runtime");
|
|
1257
|
+
var ld = (e, t) => t.map((r) => ce(e, r) || {});
|
|
1258
|
+
var dd = (e) => e.reduce((t, r) => s(s({}, r), t), {});
|
|
1259
|
+
var ud = (e) => ({ "col-xs-12": true, "col-sm-6": e === "md", "col-sm-4": e === "sm" });
|
|
1256
1260
|
function Pi(e) {
|
|
1257
1261
|
let t = (o, n) => {
|
|
1258
1262
|
let i = e.schema.allOf[o];
|
|
1259
|
-
r[o] = ce(n.model, i) || {}, a(r), e.onChange(C(s({}, n), { model:
|
|
1260
|
-
}, [r, a] = (0, Oi.useState)(
|
|
1261
|
-
return (0,
|
|
1263
|
+
r[o] = ce(n.model, i) || {}, a(r), e.onChange(C(s({}, n), { model: dd(r) }));
|
|
1264
|
+
}, [r, a] = (0, Oi.useState)(ld(e.model, e.schema.allOf));
|
|
1265
|
+
return (0, Re.jsxs)(Re.Fragment, { children: [e.schema.title && (0, Re.jsx)(vi.Header, { title: e.schema.title }), e.schema.description && (0, Re.jsx)("p", { children: e.schema.description }), (0, Re.jsx)("div", { className: "row", children: e.schema.allOf.map((o, n) => (0, Re.jsx)("div", { className: (0, Ai.default)(ud(o.width)), children: (0, Re.jsx)(me, { schema: o, model: r[n], errors: e.errors, submitted: e.submitted, disabled: e.disabled, onChange: (i) => t(n, C(s({}, i), { model: i.model })), onPersistAsync: e.onPersistAsync }) }, n)) })] });
|
|
1262
1266
|
}
|
|
1263
1267
|
Pi.defaultProps = { disabled: false };
|
|
1264
1268
|
var Qa = Pi;
|
|
1265
1269
|
var _r = require("@transferwise/components");
|
|
1266
|
-
var Ui =
|
|
1267
|
-
var
|
|
1270
|
+
var Ui = Ee(Xe());
|
|
1271
|
+
var sr = require("react");
|
|
1268
1272
|
var $r = require("@transferwise/components");
|
|
1269
1273
|
var eo = require("@transferwise/formatting");
|
|
1270
1274
|
var ki = require("react-intl");
|
|
@@ -1273,11 +1277,11 @@ var require_main_min = __commonJS({
|
|
|
1273
1277
|
var Ue = require("react/jsx-runtime");
|
|
1274
1278
|
function Ei(e) {
|
|
1275
1279
|
var c;
|
|
1276
|
-
let t =
|
|
1280
|
+
let t = pd(e.schema), r = s(s(s({}, t), e.validationMessages), e.schema.validationMessages), a = (e.submitted || !e.changed) && !!e.errors, o = !a && (e.submitted || e.changed && e.blurred) && !!((c = e.validations) != null && c.length), n = e.schema.description && !a && !o, i = !!e.infoMessage;
|
|
1277
1281
|
return (0, Ue.jsxs)("div", { id: e.id, children: [a ? (0, Ue.jsx)($r.InlineAlert, { type: "error", children: e.errors }) : null, o ? (0, Ue.jsx)($r.InlineAlert, { type: "error", children: e.validations.map((l) => (0, Ue.jsx)("div", { children: r[l] }, l)) }) : null, (n || i) && (0, Ue.jsxs)($r.InlineAlert, { type: "info", children: [n && (0, Ue.jsx)("div", { children: e.schema.description }), i && (0, Ue.jsx)("div", { children: e.infoMessage })] })] });
|
|
1278
1282
|
}
|
|
1279
1283
|
Ei.defaultProps = { errors: "", validations: [], validationMessages: {}, validationAsyncSuccessMessage: null };
|
|
1280
|
-
function
|
|
1284
|
+
function pd(e) {
|
|
1281
1285
|
let { formatMessage: t, locale: r } = (0, ki.useIntl)(), a = { type: t(Se.type), minimum: t(Se.minimum, { minimum: e.minimum }), maximum: t(Se.maximum, { maximum: e.maximum }), minLength: t(Se.minLength, { minLength: e.minLength }), maxLength: t(Se.maxLength, { maxLength: e.maxLength }), pattern: t(Se.pattern), required: t(Se.required) };
|
|
1282
1286
|
if (e.format === "date") {
|
|
1283
1287
|
let o = { pattern: t(Se.patternDate), minimum: e.minimum ? t(Se.minimumDate, { minimum: (0, eo.formatDate)(new Date(e.minimum), r, { timeZone: "UTC", dateStyle: "long" }) }) : void 0, maximum: e.maximum ? t(Se.maximumDate, { maximum: (0, eo.formatDate)(new Date(e.maximum), r, { timeZone: "UTC", dateStyle: "long" }) }) : void 0 };
|
|
@@ -1303,7 +1307,7 @@ var require_main_min = __commonJS({
|
|
|
1303
1307
|
return L(e) ? e : void 0;
|
|
1304
1308
|
if (t) {
|
|
1305
1309
|
let o = e;
|
|
1306
|
-
return { id:
|
|
1310
|
+
return { id: Te(), message: o.message };
|
|
1307
1311
|
}
|
|
1308
1312
|
return s({ message: L(e.message) ? e.message : "" }, e);
|
|
1309
1313
|
}
|
|
@@ -1318,14 +1322,14 @@ var require_main_min = __commonJS({
|
|
|
1318
1322
|
}
|
|
1319
1323
|
var ft = require("react/jsx-runtime");
|
|
1320
1324
|
function Hi(e) {
|
|
1321
|
-
var M,
|
|
1322
|
-
let { onChange: t, schema: r } = e, a =
|
|
1325
|
+
var M, E;
|
|
1326
|
+
let { onChange: t, schema: r } = e, a = re(), o = ji(r), n = (0, sr.useMemo)(() => r.$id || Te(), [r.$id]), [i, c] = (0, sr.useState)(false), [l, m] = (0, sr.useState)(() => yd(e.model || [])), p = qi(r.items.persistAsync), h = r.items.persistAsync.schema, y = Dt(h), u = async (P) => {
|
|
1323
1327
|
c(true);
|
|
1324
1328
|
try {
|
|
1325
1329
|
let D = await Ii(P, y);
|
|
1326
1330
|
a("Dynamic Flow - PersistAsync", { status: "pending", schemaId: r.$id });
|
|
1327
|
-
let
|
|
1328
|
-
return a("Dynamic Flow - PersistAsync", { status: "success", schemaId: r.$id }), Di(
|
|
1331
|
+
let U = await p(D);
|
|
1332
|
+
return a("Dynamic Flow - PersistAsync", { status: "success", schemaId: r.$id }), Di(U);
|
|
1329
1333
|
} catch (D) {
|
|
1330
1334
|
return a("Dynamic Flow - PersistAsync", { status: "failure", schemaId: r.$id }), Promise.reject(Li(D));
|
|
1331
1335
|
}
|
|
@@ -1334,28 +1338,28 @@ var require_main_min = __commonJS({
|
|
|
1334
1338
|
if ($n(P, l))
|
|
1335
1339
|
return;
|
|
1336
1340
|
m(P);
|
|
1337
|
-
let
|
|
1338
|
-
t({ model:
|
|
1341
|
+
let U = Vi(P).map((ee) => ee.id);
|
|
1342
|
+
t({ model: U, triggerSchema: r, triggerModel: U });
|
|
1339
1343
|
}
|
|
1340
|
-
let w = Vi(l).map((P) => P.id), S =
|
|
1341
|
-
return (0, ft.jsxs)("div", { className: (0, Ui.default)("form-group", { "has-error": F }), children: [(0, ft.jsx)("label", { className: "d-block control-label", htmlFor: n, children: e.schema.title }), (0, ft.jsx)("div", { "aria-describedby": x, children: (0, ft.jsx)(_r.UploadInput, s({}, O)) }), (0, ft.jsx)(He, { id: x, changed: i, submitted: e.submitted, errors: e.errors, schema: e.schema, validations: S, validationMessages:
|
|
1344
|
+
let w = Vi(l).map((P) => P.id), S = It(w, r, e.required), F = !!e.errors || (i || e.submitted) && !!S.length, g = "accepts" in h && h.accepts, v = "maxSize" in h && h.maxSize, O = C(s(s({ multiple: true, className: "form-control", files: l, fileInputName: n, id: n }, g ? { fileTypes: g } : void 0), v ? { sizeLimit: Nr(v) } : void 0), { sizeLimitErrorMessage: ((M = h.validationMessages) == null ? void 0 : M.maxSize) || o.maxFileSizeErrorMessage, maxFiles: e.schema.maxItems, maxFilesErrorMessage: ((E = e.schema.validationMessages) == null ? void 0 : E.maxItems) || o.maxItemsErrorMessage, uploadButtonTitle: h.title, description: h.description, disabled: e.disabled, onUploadFile: (P) => u(P.get(n)), onFilesChange: d, onDeleteFile: () => Promise.resolve() }), x = `${n}-feedback`;
|
|
1345
|
+
return (0, ft.jsxs)("div", { className: (0, Ui.default)("form-group", { "has-error": F }), children: [(0, ft.jsx)("label", { className: "d-block control-label", htmlFor: n, children: e.schema.title }), (0, ft.jsx)("div", { "aria-describedby": x, children: (0, ft.jsx)(_r.UploadInput, s({}, O)) }), (0, ft.jsx)(He, { id: x, changed: i, submitted: e.submitted, errors: e.errors, schema: e.schema, validations: S, validationMessages: hd(r, !!e.required, o), infoMessage: null, focused: false, blurred: true })] });
|
|
1342
1346
|
}
|
|
1343
1347
|
Hi.defaultProps = { errors: null, required: false };
|
|
1344
1348
|
var to = Hi;
|
|
1345
1349
|
function Vi(e) {
|
|
1346
1350
|
return e.filter((t) => !t.error && t.status === "succeeded");
|
|
1347
1351
|
}
|
|
1348
|
-
function
|
|
1349
|
-
return e.map((t) =>
|
|
1352
|
+
function yd(e) {
|
|
1353
|
+
return e.map((t) => fd(t) ? { id: t, status: _r.Status.SUCCEEDED } : null).filter((t) => t !== null);
|
|
1350
1354
|
}
|
|
1351
|
-
function
|
|
1355
|
+
function fd(e) {
|
|
1352
1356
|
return z(e) || L(e);
|
|
1353
1357
|
}
|
|
1354
|
-
function
|
|
1358
|
+
function hd(e, t, r) {
|
|
1355
1359
|
let { minItems: a, maxItems: o } = e;
|
|
1356
1360
|
return s(s(s({}, t && { required: r.requiredMessage }), a && { minItems: r.minItemsErrorMessage }), o && { maxItems: r.maxItemsErrorMessage });
|
|
1357
1361
|
}
|
|
1358
|
-
var
|
|
1362
|
+
var Bt = require("@transferwise/components");
|
|
1359
1363
|
var Zi = require("@transferwise/icons");
|
|
1360
1364
|
var Xr = require("react");
|
|
1361
1365
|
var Qi = require("react-intl");
|
|
@@ -1366,102 +1370,102 @@ var require_main_min = __commonJS({
|
|
|
1366
1370
|
var ht = (0, _i.defineMessages)({ addItemTitle: { id: "dynamicFlows.ArraySchema.addItemTitle", defaultMessage: "Add Item", description: "Label on the button used to open a form to add an item" }, addItem: { id: "dynamicFlows.ArraySchema.addItem", defaultMessage: "Save", description: "Label on the add button used to submit a form that adds an item" }, editItem: { id: "dynamicFlows.ArraySchema.editItem", defaultMessage: "Save", description: "Label on the edit button used to submit a form that edits an item" }, removeItem: { id: "dynamicFlows.ArraySchema.removeItem", defaultMessage: "Remove", description: "Label on the remove button used to confirm deletion of an item" } });
|
|
1367
1371
|
var Ki = require("react-intl");
|
|
1368
1372
|
var Xi = require("react/jsx-runtime");
|
|
1369
|
-
function
|
|
1373
|
+
function gd({ type: e, schema: t, model: r, errors: a, submitted: o, onModelChange: n, onAction: i }) {
|
|
1370
1374
|
let { formatMessage: c } = (0, Ki.useIntl)(), l = { layout: [{ type: "form", schema: t.items }, { type: "button", control: "primary", action: { url: e, title: c(e === "add" ? ht.addItem : ht.editItem) } }, ...e === "edit" ? [{ type: "button", context: "negative", action: { url: "remove", title: c(ht.removeItem) } }] : []], title: "", actions: [], schemas: [] };
|
|
1371
1375
|
return (0, Xi.jsx)(Kr, { step: l, model: r, stepLayoutOptions: { displayStepTitle: false }, submitted: o, formErrors: a, globalError: null, onAction: (m) => {
|
|
1372
1376
|
i(m.url);
|
|
1373
1377
|
}, onModelChange: n });
|
|
1374
1378
|
}
|
|
1375
|
-
var Ji =
|
|
1379
|
+
var Ji = gd;
|
|
1376
1380
|
var Jr = (e, t) => {
|
|
1377
|
-
let r =
|
|
1381
|
+
let r = cr(e, t);
|
|
1378
1382
|
if (r >= 0)
|
|
1379
1383
|
return r;
|
|
1380
|
-
if (e.oneOf.length === 1 &&
|
|
1384
|
+
if (e.oneOf.length === 1 && tr(e.oneOf[0]))
|
|
1381
1385
|
return 0;
|
|
1382
1386
|
if (we(e.oneOf[0])) {
|
|
1383
|
-
let a =
|
|
1387
|
+
let a = cr(e, e.default);
|
|
1384
1388
|
if (a >= 0)
|
|
1385
1389
|
return a;
|
|
1386
1390
|
}
|
|
1387
|
-
return lt(e) && $(t) && Object.keys(t).length >= 1 ?
|
|
1391
|
+
return lt(e) && $(t) && Object.keys(t).length >= 1 ? Nt(e, t) : lt(e) && !Y(e.default) && $(e.default) && Object.keys(e.default).length >= 1 ? Nt(e, e.default) : null;
|
|
1388
1392
|
};
|
|
1389
|
-
var
|
|
1393
|
+
var cr = (e, t) => {
|
|
1390
1394
|
let r = (a) => !Y(t) && G(t, a);
|
|
1391
1395
|
return e.oneOf.filter(r).length === 1 ? e.oneOf.findIndex(r) : -1;
|
|
1392
1396
|
};
|
|
1393
|
-
function
|
|
1397
|
+
function Nt(e, t) {
|
|
1394
1398
|
if (t == null)
|
|
1395
1399
|
return null;
|
|
1396
|
-
let r = e.oneOf.map((a) =>
|
|
1400
|
+
let r = e.oneOf.map((a) => wd(a).reduce((o, [n, i]) => we(i) && i.const === t[n] ? o + 2 : tr(i) && typeof t[n] != "undefined" ? o + 1 : o, 0));
|
|
1397
1401
|
return r.every((a) => a === r[0]) ? null : r.indexOf(Math.max(...r));
|
|
1398
1402
|
}
|
|
1399
|
-
function
|
|
1403
|
+
function wd(e) {
|
|
1400
1404
|
return e.properties !== null && typeof e.properties == "object" ? Object.entries(e.properties) : [];
|
|
1401
1405
|
}
|
|
1402
1406
|
var ro = (e, t, r = {}) => {
|
|
1403
|
-
let { defaultTitle: a = "", defaultDescription: o = "", defaultIcon: n, defaultImage: i } = r, c =
|
|
1407
|
+
let { defaultTitle: a = "", defaultDescription: o = "", defaultIcon: n, defaultImage: i } = r, c = Qe({ schema: e, model: t, providesProp: "providesTitle", getValueFromSchema: Yi }), l = Qe({ schema: e, model: t, providesProp: "providesDescription", getValueFromSchema: Yi }), m = Qe({ schema: e, model: t, providesProp: "providesIcon", getValueFromSchema: (h) => {
|
|
1404
1408
|
var y;
|
|
1405
1409
|
return (y = h.icon) != null ? y : null;
|
|
1406
|
-
} }), p =
|
|
1410
|
+
} }), p = Qe({ schema: e, model: t, providesProp: "providesImage", getValueFromSchema: (h) => {
|
|
1407
1411
|
var y;
|
|
1408
1412
|
return (y = h.image) != null ? y : null;
|
|
1409
1413
|
} });
|
|
1410
1414
|
return { value: t, title: c || a, description: l || o, icon: m || n, image: p || i };
|
|
1411
1415
|
};
|
|
1412
|
-
var
|
|
1416
|
+
var Qe = (e) => {
|
|
1413
1417
|
let { schema: t, model: r, providesProp: a, getValueFromSchema: o } = e;
|
|
1414
|
-
if (
|
|
1418
|
+
if (bd(t.summary, a))
|
|
1415
1419
|
return o(t, r);
|
|
1416
1420
|
switch (dt(t)) {
|
|
1417
1421
|
case "object":
|
|
1418
|
-
return
|
|
1422
|
+
return Cd(e);
|
|
1419
1423
|
case "oneOf":
|
|
1420
|
-
return
|
|
1424
|
+
return Sd(e);
|
|
1421
1425
|
case "allOf":
|
|
1422
|
-
return
|
|
1426
|
+
return Fd(e);
|
|
1423
1427
|
default:
|
|
1424
1428
|
return null;
|
|
1425
1429
|
}
|
|
1426
1430
|
};
|
|
1427
|
-
var
|
|
1431
|
+
var Cd = (e) => {
|
|
1428
1432
|
let { schema: t, model: r } = e, a = t;
|
|
1429
1433
|
for (let o in a.properties) {
|
|
1430
|
-
let n = a.properties[o], i = $(r) && o in r ? r[o] : null, c =
|
|
1434
|
+
let n = a.properties[o], i = $(r) && o in r ? r[o] : null, c = Qe(C(s({}, e), { schema: n, model: i }));
|
|
1431
1435
|
if (c)
|
|
1432
1436
|
return c;
|
|
1433
1437
|
}
|
|
1434
1438
|
return null;
|
|
1435
1439
|
};
|
|
1436
|
-
var
|
|
1440
|
+
var Sd = (e) => {
|
|
1437
1441
|
let { schema: t, model: r } = e;
|
|
1438
1442
|
if (lt(t)) {
|
|
1439
1443
|
if (!$(r))
|
|
1440
1444
|
return null;
|
|
1441
|
-
let n =
|
|
1445
|
+
let n = Nt(t, r);
|
|
1442
1446
|
if (n === null || n < 0)
|
|
1443
1447
|
return null;
|
|
1444
1448
|
let i = t.oneOf[n];
|
|
1445
|
-
return
|
|
1449
|
+
return Qe(C(s({}, e), { schema: i }));
|
|
1446
1450
|
}
|
|
1447
1451
|
let a = t, o = Jr(a, r);
|
|
1448
|
-
return o === null || o < 0 ? null :
|
|
1452
|
+
return o === null || o < 0 ? null : Qe(C(s({}, e), { schema: a.oneOf[o] }));
|
|
1449
1453
|
};
|
|
1450
|
-
var
|
|
1454
|
+
var Fd = (e) => {
|
|
1451
1455
|
let { schema: t } = e, r = t;
|
|
1452
1456
|
for (let a of r.allOf) {
|
|
1453
|
-
let o =
|
|
1457
|
+
let o = Qe(C(s({}, e), { schema: a }));
|
|
1454
1458
|
if (o)
|
|
1455
1459
|
return o;
|
|
1456
1460
|
}
|
|
1457
1461
|
return null;
|
|
1458
1462
|
};
|
|
1459
1463
|
var Yi = (e, t) => we(e) ? e.title ? e.title : L(e.const) ? e.const : null : jr(t) ? t : null;
|
|
1460
|
-
var
|
|
1464
|
+
var bd = (e, t) => !!e && Object.hasOwnProperty.call(e, t) && !!e[t];
|
|
1461
1465
|
var Fe = require("react/jsx-runtime");
|
|
1462
|
-
var
|
|
1466
|
+
var xd = ({ schema: e, model: t, errors: r, submitted: a, onChange: o }) => {
|
|
1463
1467
|
let [n, i] = (0, Xr.useState)(null), [c, l] = (0, Xr.useState)(() => {
|
|
1464
|
-
if (R(t) && !
|
|
1468
|
+
if (R(t) && !j(t))
|
|
1465
1469
|
throw new Error("RepeatableSchema does not support object models. Ensure your array schema is wrapped inside an object schema.");
|
|
1466
1470
|
return t ? t.map((S) => ro(e.items, S, e == null ? void 0 : e.summary)) : null;
|
|
1467
1471
|
}), [m, p] = (0, Xr.useState)({ item: null, model: null }), h = (S) => {
|
|
@@ -1476,14 +1480,14 @@ var require_main_min = __commonJS({
|
|
|
1476
1480
|
let F = S === "remove" ? null : ro(e.items, m.model, e == null ? void 0 : e.summary);
|
|
1477
1481
|
if (S !== "remove" && !G((v = F == null ? void 0 : F.value) != null ? v : null, e.items))
|
|
1478
1482
|
return;
|
|
1479
|
-
let g =
|
|
1483
|
+
let g = vd(S, { originalItem: m.item, updatedItem: F, itemSummaries: c });
|
|
1480
1484
|
l(g), h(g), p({ item: null, model: null }), i(null);
|
|
1481
1485
|
}, f = () => {
|
|
1482
1486
|
p({ item: null, model: null }), i(null);
|
|
1483
1487
|
}, { formatMessage: w } = (0, Qi.useIntl)();
|
|
1484
|
-
return (0, Fe.jsxs)(Fe.Fragment, { children: [e.title && (0, Fe.jsx)(
|
|
1488
|
+
return (0, Fe.jsxs)(Fe.Fragment, { children: [e.title && (0, Fe.jsx)(Bt.Header, { title: e.title }), c && c.map((S) => (0, Fe.jsx)(Wi, { item: S, onClick: () => u(S) }, JSON.stringify(S))), (0, Fe.jsx)(Bt.NavigationOption, { onClick: y, media: (0, Fe.jsx)(Zi.Plus, {}), title: e.addItemTitle || w(ht.addItemTitle), showMediaAtAllSizes: true }), (0, Fe.jsx)(Bt.Modal, { open: n !== null, onClose: f, title: (n === "add" ? e.addItemTitle : e.editItemTitle) || w(ht.addItemTitle), body: (0, Fe.jsx)(Ji, { type: n != null ? n : "add", schema: e, model: m.model, errors: r, submitted: a, onAction: d, onModelChange: ({ model: S }) => p(C(s({}, m), { model: S })) }) })] });
|
|
1485
1489
|
};
|
|
1486
|
-
var
|
|
1490
|
+
var vd = (e, { originalItem: t, updatedItem: r, itemSummaries: a }) => {
|
|
1487
1491
|
if (e === "remove")
|
|
1488
1492
|
return (a || []).filter((o) => o !== t);
|
|
1489
1493
|
if (!r)
|
|
@@ -1497,13 +1501,13 @@ var require_main_min = __commonJS({
|
|
|
1497
1501
|
return null;
|
|
1498
1502
|
}
|
|
1499
1503
|
};
|
|
1500
|
-
var es =
|
|
1504
|
+
var es = xd;
|
|
1501
1505
|
var ao = require("react/jsx-runtime");
|
|
1502
1506
|
var ts = (e) => {
|
|
1503
1507
|
let { schema: t } = e;
|
|
1504
1508
|
if (Kn(t))
|
|
1505
1509
|
return (0, ao.jsx)(to, C(s({}, e), { schema: t }));
|
|
1506
|
-
if (
|
|
1510
|
+
if (De(t))
|
|
1507
1511
|
return (0, ao.jsx)(es, C(s({}, e), { schema: t }));
|
|
1508
1512
|
throw new Error("Invalid array list schema");
|
|
1509
1513
|
};
|
|
@@ -1512,46 +1516,46 @@ var require_main_min = __commonJS({
|
|
|
1512
1516
|
var os = require("react/jsx-runtime");
|
|
1513
1517
|
var as = (e) => {
|
|
1514
1518
|
let { schema: t } = e;
|
|
1515
|
-
if (
|
|
1519
|
+
if (De(t))
|
|
1516
1520
|
return (0, os.jsx)(rs, s({}, e));
|
|
1517
1521
|
throw new Error("Not implemented");
|
|
1518
1522
|
};
|
|
1519
1523
|
as.defaultProps = { required: false };
|
|
1520
1524
|
var oo = as;
|
|
1521
|
-
var ns =
|
|
1525
|
+
var ns = Ee(Xe());
|
|
1522
1526
|
var Yr = require("react");
|
|
1523
1527
|
var fe = require("react/jsx-runtime");
|
|
1524
|
-
var
|
|
1528
|
+
var Ad = (e) => ({ "col-xs-12": true, "col-sm-6": e === "md", "col-sm-4": e === "sm" });
|
|
1525
1529
|
function is(e) {
|
|
1526
1530
|
let [t, r] = (0, Yr.useState)(() => s({}, ce(e.model, e.schema))), a = (m, p) => {
|
|
1527
1531
|
p.model !== null ? t[m] = p.model : delete t[m], r(t), e.onChange(C(s({}, p), { model: t }));
|
|
1528
1532
|
}, o = (m) => e.schema.required && e.schema.required.includes(m);
|
|
1529
1533
|
(0, Yr.useEffect)(() => {
|
|
1530
1534
|
let m = ce(t, e.schema) || {};
|
|
1531
|
-
r(m),
|
|
1535
|
+
r(m), Je(m, t) || e.onChange({ model: m, triggerSchema: e.schema, triggerModel: m });
|
|
1532
1536
|
}, [e.schema]);
|
|
1533
1537
|
let n = /* @__PURE__ */ new Set([...e.schema.displayOrder || [], ...Object.keys(e.schema.properties)]), i = (m) => typeof e.schema.properties[m] != "undefined", c = Array.from(n).filter(i), l = e.errors;
|
|
1534
|
-
return (0, fe.jsxs)(fe.Fragment, { children: [e.schema.alert && (0, fe.jsx)(se, { component: e.schema.alert }), (0, fe.jsxs)("fieldset", { children: [e.schema.title && !e.hideTitle && (0, fe.jsxs)("legend", { children: [" ", e.schema.title, " "] }), e.schema.description && !e.hideTitle && (0, fe.jsxs)("p", { children: [" ", e.schema.description, " "] }), (0, fe.jsx)("div", { className: "row", children: c.map((m) => (0, fe.jsx)("div", { className: (0, ns.default)(
|
|
1538
|
+
return (0, fe.jsxs)(fe.Fragment, { children: [e.schema.alert && (0, fe.jsx)(se, { component: e.schema.alert }), (0, fe.jsxs)("fieldset", { children: [e.schema.title && !e.hideTitle && (0, fe.jsxs)("legend", { children: [" ", e.schema.title, " "] }), e.schema.description && !e.hideTitle && (0, fe.jsxs)("p", { children: [" ", e.schema.description, " "] }), (0, fe.jsx)("div", { className: "row", children: c.map((m) => (0, fe.jsx)("div", { className: (0, ns.default)(Ad(e.schema.properties[m].width)), children: (0, fe.jsx)(me, { schema: e.schema.properties[m], model: e.model && e.model[m], errors: l == null ? void 0 : l[m], submitted: e.submitted, required: o(m), disabled: e.disabled, onChange: (p) => a(m, p), onPersistAsync: e.onPersistAsync }) }, m)) })] })] });
|
|
1535
1539
|
}
|
|
1536
1540
|
is.defaultProps = { hideTitle: false, disabled: false };
|
|
1537
|
-
var
|
|
1541
|
+
var mr = is;
|
|
1538
1542
|
var Ss = require("@transferwise/components");
|
|
1539
|
-
var Fs =
|
|
1540
|
-
var
|
|
1543
|
+
var Fs = Ee(Xe());
|
|
1544
|
+
var Ne = require("react");
|
|
1541
1545
|
var Zr = require("@transferwise/components");
|
|
1542
1546
|
var ms = require("react-intl");
|
|
1543
1547
|
var ss = require("react-intl");
|
|
1544
1548
|
var cs = (0, ss.defineMessages)({ helpAria: { id: "dynamicFlows.Help.ariaLabel", defaultMessage: "Click here for more info.", description: "Aria label for help." } });
|
|
1545
1549
|
var no = require("react/jsx-runtime");
|
|
1546
|
-
|
|
1550
|
+
function Od(e) {
|
|
1547
1551
|
let t = (0, ms.useIntl)();
|
|
1548
1552
|
return (0, no.jsx)(Zr.Info, { className: "m-l-1", content: (0, no.jsx)(Zr.Markdown, { children: e.help.markdown }), presentation: "POPOVER", size: "sm", "aria-label": t.formatMessage(cs.helpAria) });
|
|
1549
|
-
}
|
|
1550
|
-
var qe =
|
|
1553
|
+
}
|
|
1554
|
+
var qe = Od;
|
|
1551
1555
|
var ws = require("react");
|
|
1552
1556
|
var _ = require("@transferwise/components");
|
|
1553
1557
|
var ys = require("react");
|
|
1554
|
-
var
|
|
1558
|
+
var zt = (e, t = {}) => {
|
|
1555
1559
|
let { coerceValue: r = false } = t;
|
|
1556
1560
|
if (!I(e)) {
|
|
1557
1561
|
if (R(e)) {
|
|
@@ -1590,7 +1594,7 @@ var require_main_min = __commonJS({
|
|
|
1590
1594
|
let { coerceValue: r = false } = t;
|
|
1591
1595
|
if (I(e))
|
|
1592
1596
|
return false;
|
|
1593
|
-
if (!
|
|
1597
|
+
if (!Ie(e)) {
|
|
1594
1598
|
if (r)
|
|
1595
1599
|
return so({ received: typeof e, expected: "boolean" }), !!e;
|
|
1596
1600
|
gt({ received: typeof e, expected: "boolean" });
|
|
@@ -1632,7 +1636,7 @@ var require_main_min = __commonJS({
|
|
|
1632
1636
|
super(r);
|
|
1633
1637
|
this.getAutocompleteValue = () => {
|
|
1634
1638
|
let { autoComplete: r2, autocompleteHint: a } = this.props;
|
|
1635
|
-
return
|
|
1639
|
+
return j(a) ? co(a) : r2 === true ? "on" : "off";
|
|
1636
1640
|
};
|
|
1637
1641
|
this.handleOnChange = (r2) => {
|
|
1638
1642
|
this.props.onChange(r2);
|
|
@@ -1665,7 +1669,7 @@ var require_main_min = __commonJS({
|
|
|
1665
1669
|
}
|
|
1666
1670
|
render() {
|
|
1667
1671
|
var ee;
|
|
1668
|
-
let { name: r, placeholder: a, step: o, countryCode: n, type: i, options: c, disabled: l, readOnly: m, required: p, minLength: h, maxLength: y, min: u, max: d, searchPlaceholder: f, searchValue: w, onSearchChange: S, size: F, uploadProps: g, label: v, monthFormat: O, id: x, minDate: M, maxDate:
|
|
1672
|
+
let { name: r, placeholder: a, step: o, countryCode: n, type: i, options: c, disabled: l, readOnly: m, required: p, minLength: h, maxLength: y, min: u, max: d, searchPlaceholder: f, searchValue: w, onSearchChange: S, size: F, uploadProps: g, label: v, monthFormat: O, id: x, minDate: M, maxDate: E, value: P, mode: D, describedBy: U } = this.props;
|
|
1669
1673
|
switch (i) {
|
|
1670
1674
|
case N.RADIO:
|
|
1671
1675
|
return (0, Z.jsx)(_.RadioGroup, { radios: c.map(this.mapOption), name: r, selectedValue: io(P, { coerceValue: true }), onChange: this.handleOnChange });
|
|
@@ -1674,14 +1678,14 @@ var require_main_min = __commonJS({
|
|
|
1674
1678
|
case N.SELECT: {
|
|
1675
1679
|
let A = c.length >= 20;
|
|
1676
1680
|
return (0, Z.jsx)(_.Select, { id: x, selected: this.getSelectedOption(c), options: c, search: A, required: p, disabled: l, placeholder: a, searchPlaceholder: f, searchValue: w, onChange: (B) => {
|
|
1677
|
-
var
|
|
1678
|
-
this.setState({ selectedOption: B != null ? B : void 0 }), this.props.onChange((
|
|
1681
|
+
var k;
|
|
1682
|
+
this.setState({ selectedOption: B != null ? B : void 0 }), this.props.onChange((k = B == null ? void 0 : B.value) != null ? k : null);
|
|
1679
1683
|
}, onFocus: this.handleOnFocus, onBlur: this.handleOnBlur, onSearchChange: A ? S : void 0 });
|
|
1680
1684
|
}
|
|
1681
1685
|
case N.TAB:
|
|
1682
1686
|
return (0, Z.jsx)(_.Tabs, { selected: ((ee = this.getSelectedOption(c)) == null ? void 0 : ee.value) || 0, tabs: c.map((A) => ({ title: A.label, content: (0, Z.jsx)(Z.Fragment, {}), disabled: A.disabled || false })), name: x, onTabSelect: (A) => {
|
|
1683
1687
|
let B = !!this.state.selectedOption;
|
|
1684
|
-
this.setState({ selectedOption: c.find((
|
|
1688
|
+
this.setState({ selectedOption: c.find((k) => k.value === A) }), this.props.onChange(A, B ? "user" : "init");
|
|
1685
1689
|
} });
|
|
1686
1690
|
case N.NUMERIC:
|
|
1687
1691
|
case N.NUMBER:
|
|
@@ -1689,23 +1693,23 @@ var require_main_min = __commonJS({
|
|
|
1689
1693
|
i === N.NUMERIC ? this.props.onChange(A.target.value) : this.props.onChange(parseFloat(A.target.value));
|
|
1690
1694
|
}, onFocus: this.handleOnFocus, onWheel: (A) => {
|
|
1691
1695
|
A.target instanceof HTMLElement && A.target.blur();
|
|
1692
|
-
}, "aria-describedby":
|
|
1696
|
+
}, "aria-describedby": U });
|
|
1693
1697
|
case N.HIDDEN:
|
|
1694
|
-
return (0, Z.jsx)("input", { type: "hidden", name: r, value:
|
|
1698
|
+
return (0, Z.jsx)("input", { type: "hidden", name: r, value: zt(P, { coerceValue: true }), id: x });
|
|
1695
1699
|
case N.PASSWORD:
|
|
1696
|
-
return (0, Z.jsx)("input", { autoComplete: this.getAutocompleteValue(), className: "form-control", disabled: l, id: x, placeholder: a, readOnly: m, required: p, type: "password", value:
|
|
1700
|
+
return (0, Z.jsx)("input", { autoComplete: this.getAutocompleteValue(), className: "form-control", disabled: l, id: x, placeholder: a, readOnly: m, required: p, type: "password", value: zt(P, { coerceValue: true }), onBlur: this.handleOnBlur, onChange: this.handleInputOnChange, onFocus: this.handleOnFocus, "aria-describedby": U });
|
|
1697
1701
|
case N.DATE:
|
|
1698
1702
|
case N.DATETIME:
|
|
1699
1703
|
return (0, Z.jsx)(_.DateInput, { disabled: l, size: F, value: ds(P), mode: D, monthFormat: O, onBlur: this.handleOnBlur, onChange: this.handleOnChange, onFocus: this.handleOnFocus });
|
|
1700
1704
|
case N.DATELOOKUP:
|
|
1701
|
-
return (0, Z.jsx)(_.DateLookup, { value: us(P), min: M, max:
|
|
1705
|
+
return (0, Z.jsx)(_.DateLookup, { value: us(P), min: M, max: E, placeholder: a, monthFormat: O, disabled: l, onChange: (A) => {
|
|
1702
1706
|
this.handleOnChange(qn(A));
|
|
1703
1707
|
}, onBlur: this.handleOnBlur, onFocus: this.handleOnFocus });
|
|
1704
1708
|
case N.TEL:
|
|
1705
|
-
return (0, Z.jsx)(_.PhoneNumberInput, { disabled: l, countryCode: n, placeholder: a, required: p, searchPlaceholder: f, size: F, initialValue:
|
|
1709
|
+
return (0, Z.jsx)(_.PhoneNumberInput, { disabled: l, countryCode: n, placeholder: a, required: p, searchPlaceholder: f, size: F, initialValue: zt(P), onBlur: this.handleOnBlur, onChange: this.handleOnChange, onFocus: this.handleOnFocus });
|
|
1706
1710
|
case N.TEXTAREA: {
|
|
1707
|
-
let A = { className: "form-control tw-form-control", id: x, name: r, placeholder: a, value:
|
|
1708
|
-
return this.props.displayPattern ? (0, Z.jsx)(_.TextareaWithDisplayFormat, C(s({ displayPattern: this.props.displayPattern }, A), { onChange: this.handleOnChange })) : (0, Z.jsx)("textarea", C(s({}, A), { onChange: this.handleInputOnChange, "aria-describedby":
|
|
1711
|
+
let A = { className: "form-control tw-form-control", id: x, name: r, placeholder: a, value: zt(P, { coerceValue: true }), readOnly: m, required: p, minLength: h, maxLength: y, onFocus: this.handleOnFocus, onBlur: this.handleOnBlur, disabled: l, autoComplete: this.getAutocompleteValue() };
|
|
1712
|
+
return this.props.displayPattern ? (0, Z.jsx)(_.TextareaWithDisplayFormat, C(s({ displayPattern: this.props.displayPattern }, A), { onChange: this.handleOnChange })) : (0, Z.jsx)("textarea", C(s({}, A), { onChange: this.handleInputOnChange, "aria-describedby": U }));
|
|
1709
1713
|
}
|
|
1710
1714
|
case N.FILE:
|
|
1711
1715
|
case N.UPLOAD:
|
|
@@ -1719,32 +1723,32 @@ var require_main_min = __commonJS({
|
|
|
1719
1723
|
case N.TEXT:
|
|
1720
1724
|
case N.EMAIL:
|
|
1721
1725
|
default: {
|
|
1722
|
-
let A = { type: i === N.EMAIL ? "email" : "text", className: "form-control", id: x, name: r, placeholder: a, value:
|
|
1723
|
-
return this.props.displayPattern ? (0, Z.jsx)(_.InputWithDisplayFormat, C(s({ displayPattern: this.props.displayPattern }, A), { onChange: this.handleOnChange })) : (0, Z.jsx)("input", C(s({}, A), { onChange: this.handleInputOnChange, "aria-describedby":
|
|
1726
|
+
let A = { type: i === N.EMAIL ? "email" : "text", className: "form-control", id: x, name: r, placeholder: a, value: zt(P, { coerceValue: true }), readOnly: m, required: p, minLength: h, maxLength: y, onFocus: this.handleOnFocus, onBlur: this.handleOnBlur, disabled: l, autoComplete: this.getAutocompleteValue() };
|
|
1727
|
+
return this.props.displayPattern ? (0, Z.jsx)(_.InputWithDisplayFormat, C(s({ displayPattern: this.props.displayPattern }, A), { onChange: this.handleOnChange })) : (0, Z.jsx)("input", C(s({}, A), { onChange: this.handleInputOnChange, "aria-describedby": U }));
|
|
1724
1728
|
}
|
|
1725
1729
|
}
|
|
1726
1730
|
}
|
|
1727
1731
|
};
|
|
1728
1732
|
be.Type = N, be.Size = ni, be.MonthFormat = oi, be.DateMode = ai, be.defaultProps = { autoComplete: true, countryCode: null, disabled: false, displayPattern: null, id: null, label: "", max: null, maxDate: null, maxLength: null, min: null, minDate: null, minLength: null, mode: be.DateMode.DAY_MONTH_YEAR, monthFormat: be.MonthFormat.LONG, onBlur: null, onFocus: null, onSearchChange: null, options: [], placeholder: null, readOnly: false, required: false, searchPlaceholder: null, searchValue: "", selectedOption: null, size: be.Size.MEDIUM, step: 1, type: be.Type.TEXT, uploadProps: {}, value: null };
|
|
1729
|
-
var
|
|
1730
|
-
var
|
|
1733
|
+
var jt = be;
|
|
1734
|
+
var et = require("@transferwise/components");
|
|
1731
1735
|
var xe = require("react/jsx-runtime");
|
|
1732
1736
|
var fs = (e, t) => {
|
|
1733
1737
|
switch (t) {
|
|
1734
1738
|
case "select":
|
|
1735
|
-
return
|
|
1739
|
+
return Md(e);
|
|
1736
1740
|
case "radio":
|
|
1737
1741
|
default:
|
|
1738
|
-
return
|
|
1742
|
+
return Pd(e);
|
|
1739
1743
|
}
|
|
1740
1744
|
};
|
|
1741
|
-
var
|
|
1742
|
-
var
|
|
1743
|
-
var
|
|
1744
|
-
var
|
|
1745
|
-
var
|
|
1746
|
-
var
|
|
1747
|
-
var Qr = ({ accepts: e }) => s({},
|
|
1745
|
+
var Pd = (e) => s(s(s({ label: e.title, value: e.const }, hs(e.title, e.description)), Vt(e)), gs(e.disabled));
|
|
1746
|
+
var Md = (e) => s(s(s(s(s({ label: e.title, value: e.const }, hs(e.title, e.description)), Id(e.icon)), Ed(e.image)), gs(e.disabled)), kd(e.keywords));
|
|
1747
|
+
var kd = (e) => j(e) ? { searchStrings: e } : {};
|
|
1748
|
+
var Ed = (e) => e != null && e.url ? { icon: (0, xe.jsx)("div", { className: "media", children: (0, xe.jsx)("div", { className: "np-option__no-media-circle", children: (0, xe.jsx)("img", { src: e.url, alt: e.name || "" }) }) }) } : null;
|
|
1749
|
+
var Id = (e) => e != null && e.name && Lt(e.name) ? { currency: e.name.substring(5) } : e != null && e.name && $a(e.name) ? { icon: (0, xe.jsx)(Ye, { type: e.name }) } : e != null && e.text ? { icon: (0, xe.jsx)("span", { children: e.text }) } : null;
|
|
1750
|
+
var Vt = ({ image: e, icon: t }) => e != null && e.url ? { avatar: (0, xe.jsx)(et.Avatar, { type: et.AvatarType.THUMBNAIL, children: (0, xe.jsx)("img", { src: e.url, alt: "" }) }) } : t != null && t.name && $a(t.name) ? { avatar: (0, xe.jsx)(et.Avatar, { type: et.AvatarType.ICON, children: (0, xe.jsx)(Ye, { type: t.name }) }) } : t != null && t.text ? { avatar: (0, xe.jsx)(et.Avatar, { type: et.AvatarType.INITIALS, children: t.text }) } : null;
|
|
1751
|
+
var Qr = ({ accepts: e }) => s({}, j(e) && { usAccept: e.join(",") });
|
|
1748
1752
|
var hs = (e, t) => {
|
|
1749
1753
|
if (e && t)
|
|
1750
1754
|
return { [(e + t).length > 50 ? "secondary" : "note"]: t };
|
|
@@ -1754,97 +1758,97 @@ var require_main_min = __commonJS({
|
|
|
1754
1758
|
return { disabled: e };
|
|
1755
1759
|
};
|
|
1756
1760
|
var mo = require("react/jsx-runtime");
|
|
1757
|
-
var
|
|
1758
|
-
var lo = (e) => ge(e) ? e.control === N.TAB && e.oneOf.length > 3 ? N.SELECT : e.oneOf.length === 2 && !e.control ? N.RADIO : e.control || N.SELECT : Rr(e) ?
|
|
1759
|
-
var
|
|
1760
|
-
var
|
|
1761
|
-
var
|
|
1762
|
-
var
|
|
1761
|
+
var Dd = (e) => e === "string" || e === "number";
|
|
1762
|
+
var lo = (e) => ge(e) ? e.control === N.TAB && e.oneOf.length > 3 ? N.SELECT : e.oneOf.length === 2 && !e.control ? N.RADIO : e.control || N.SELECT : Rr(e) ? Ld(e) : "control" in e && e.control ? e.control : e.type === "boolean" ? "checkbox" : e.type === "integer" ? "number" : e.type;
|
|
1763
|
+
var Ld = ({ format: e, control: t }) => t ? Td[t] || t : e && Rd[e] || "text";
|
|
1764
|
+
var Td = { "date-lookup": "date-lookup", password: "password", textarea: "textarea", email: "email", numeric: "numeric", "phone-number": "tel" };
|
|
1765
|
+
var Rd = { date: "date", email: "email", base64url: "file", password: "password", "phone-number": "tel" };
|
|
1766
|
+
var Nd = (e, t) => e.oneOf ? e.oneOf.map((r) => fs(r, t)) : null;
|
|
1763
1767
|
function Cs(e) {
|
|
1764
|
-
let { id: t, schema: r, value: a, disabled: o, onChange: n, onFocus: i, onBlur: c, onSearchChange: l, describedBy: m } = e, p =
|
|
1765
|
-
n(
|
|
1768
|
+
let { id: t, schema: r, value: a, disabled: o, onChange: n, onFocus: i, onBlur: c, onSearchChange: l, describedBy: m } = e, p = Mt(), h = (F) => Dd(r.type) && (I(F) || Y(F)) ? "" : F, y = (F, g) => {
|
|
1769
|
+
n($e(F, r), g);
|
|
1766
1770
|
}, u = lo(r);
|
|
1767
1771
|
(0, ws.useEffect)(() => {
|
|
1768
|
-
|
|
1772
|
+
Bd(r, p, u);
|
|
1769
1773
|
}, [JSON.stringify(r), p, u]);
|
|
1770
|
-
let d = r.values ||
|
|
1771
|
-
return (0, mo.jsx)("div", { "aria-describedby": m, children: (0, mo.jsx)(
|
|
1774
|
+
let d = r.values || Nd(r, u), f = { onFocus: i, onBlur: c, onSearchChange: l, onChange: y }, w = h(a), S = { id: t, name: t, label: r.title, options: d || [], placeholder: r.placeholder, autoComplete: !r.help, autocompleteHint: r.autocompleteHint, disabled: o || r.disabled, displayPattern: r.displayFormat, uploadProps: Qr(r), describedBy: m };
|
|
1775
|
+
return (0, mo.jsx)("div", { "aria-describedby": m, children: (0, mo.jsx)(jt, s(s({ type: u, value: w }, f), S)) });
|
|
1772
1776
|
}
|
|
1773
1777
|
Cs.defaultProps = { value: null, onFocus: null, onBlur: null, onSearchChange: null, disabled: false };
|
|
1774
|
-
var
|
|
1778
|
+
var Bd = (e, t, r) => {
|
|
1775
1779
|
ge(e) && e.oneOf.length === 2 && !e.control && t.warning("Deprecation warning", 'A oneOf schema with 2 options and no control type currently renders as a "radio" but will be changed to render as a "select". Please specify control radio to retain the existing behaviour.'), r === "file" && t.warning("Deprecation warning", "Please use a persist-async blob schema instead of string with base64url for file uploads. The base64url does not perform well on low end devices. Support for this schema will be removed in a later release."), e.values && t.warning("Deprecated schema", "Schema.values is a legacy approach. Please use oneOf.");
|
|
1776
1780
|
};
|
|
1777
|
-
var
|
|
1781
|
+
var lr = Cs;
|
|
1778
1782
|
var Q = require("react/jsx-runtime");
|
|
1779
1783
|
function bs(e) {
|
|
1780
|
-
let t =
|
|
1784
|
+
let t = re(), [r, a] = (0, Ne.useState)(false), [o, n] = (0, Ne.useState)(false), [i, c] = (0, Ne.useState)(false), l = (0, Ne.useMemo)(() => e.schema.$id || Te(), [e.schema.$id]), [m, p] = (0, Ne.useState)(Jr(e.schema, e.model)), [h, y] = (0, Ne.useState)(Ud(e.model, e.schema.oneOf)), u = Qn(t, 200), d = (M) => {
|
|
1781
1785
|
u("Dynamic Flow - OneOf Searched", { oneOfId: e.schema.analyticsId, searchValueLength: M.length });
|
|
1782
1786
|
};
|
|
1783
|
-
if ((0,
|
|
1784
|
-
let M =
|
|
1785
|
-
M === -1 &&
|
|
1786
|
-
}, [e.schema]), !
|
|
1787
|
+
if ((0, Ne.useEffect)(() => {
|
|
1788
|
+
let M = cr(e.schema, e.model), E = cr(e.schema, e.schema.default);
|
|
1789
|
+
M === -1 && E >= 0 && F(E, "init");
|
|
1790
|
+
}, [e.schema]), !j(e.schema.oneOf))
|
|
1787
1791
|
return console.error("Incorrect format", e.schema), null;
|
|
1788
|
-
let f = (M,
|
|
1789
|
-
y([...h.slice(0, M),
|
|
1792
|
+
let f = (M, E) => {
|
|
1793
|
+
y([...h.slice(0, M), E.model, ...h.slice(M + 1)]), a(true), e.onChange(E);
|
|
1790
1794
|
}, w = () => {
|
|
1791
1795
|
n(true);
|
|
1792
1796
|
}, S = () => {
|
|
1793
1797
|
n(false), c(true);
|
|
1794
|
-
}, F = (M,
|
|
1798
|
+
}, F = (M, E) => {
|
|
1795
1799
|
p(M);
|
|
1796
1800
|
let P = e.schema.oneOf[M];
|
|
1797
1801
|
if (we(P)) {
|
|
1798
1802
|
let D = P.const;
|
|
1799
|
-
e.onChange({ model: D, triggerSchema: e.schema, triggerModel: D, type:
|
|
1803
|
+
e.onChange({ model: D, triggerSchema: e.schema, triggerModel: D, type: E });
|
|
1800
1804
|
} else
|
|
1801
|
-
e.onChange({ model: h[M], triggerSchema: P, triggerModel: h[M], type:
|
|
1802
|
-
|
|
1803
|
-
}, g =
|
|
1804
|
-
return (0, Q.jsxs)(Q.Fragment, { children: [(e.schema.oneOf.length > 1 || we(e.schema.oneOf[0])) && (0, Q.jsxs)(Q.Fragment, { children: [e.schema.alert && (0, Q.jsx)(se, { component: e.schema.alert }), (0, Q.jsxs)("div", { className: (0, Fs.default)(O), children: [
|
|
1805
|
+
e.onChange({ model: h[M], triggerSchema: P, triggerModel: h[M], type: E });
|
|
1806
|
+
E !== "init" && e.schema.analyticsId && t("Dynamic Flow - OneOf Selected", { oneOfId: e.schema.analyticsId, schemaId: P == null ? void 0 : P.analyticsId });
|
|
1807
|
+
}, g = Hd(e.schema), v = jd(e, m), O = { "form-group": true, "has-error": !r && e.errors && !kt(e.errors) || (e.submitted || r && i) && v.length }, x = `${l}-feedback`;
|
|
1808
|
+
return (0, Q.jsxs)(Q.Fragment, { children: [(e.schema.oneOf.length > 1 || we(e.schema.oneOf[0])) && (0, Q.jsxs)(Q.Fragment, { children: [e.schema.alert && (0, Q.jsx)(se, { component: e.schema.alert }), (0, Q.jsxs)("div", { className: (0, Fs.default)(O), children: [zd(e.schema, l), (0, Q.jsx)(lr, { id: l, schema: g, value: m, disabled: e.disabled, describedBy: x, onChange: F, onFocus: w, onBlur: S, onSearchChange: d }), (0, Q.jsx)(He, { id: x, changed: r, focused: o, blurred: i, submitted: e.submitted, errors: Vd(e.errors), schema: e.schema, validations: v, infoMessage: null })] })] }), tr(e.schema.oneOf[m]) && (0, Q.jsx)(me, { schema: e.schema.oneOf[m], model: h[m], errors: e.errors, submitted: e.submitted, hideTitle: true, disabled: e.disabled, onChange: (M) => f(m, M), onPersistAsync: e.onPersistAsync })] });
|
|
1805
1809
|
}
|
|
1806
|
-
function
|
|
1810
|
+
function zd(e, t) {
|
|
1807
1811
|
var o;
|
|
1808
1812
|
let r = e.help ? (0, Q.jsx)(qe, { help: e.help }) : null, a = we(e.oneOf[0]) ? (0, Q.jsx)("div", { className: "m-b-1", children: (0, Q.jsxs)("label", { className: "control-label d-inline", htmlFor: t, children: [e.title, " ", r] }) }) : (0, Q.jsx)(Q.Fragment, { children: r ? (0, Q.jsxs)("h4", { className: "m-b-2", children: [e.title, " ", r] }) : (0, Q.jsx)(Ss.Header, { title: (o = e.title) != null ? o : "" }) });
|
|
1809
1813
|
return e.title ? a : r;
|
|
1810
1814
|
}
|
|
1811
|
-
function
|
|
1815
|
+
function jd(e, t) {
|
|
1812
1816
|
let r = e.schema.oneOf[t != null ? t : -1];
|
|
1813
|
-
return we(r) ?
|
|
1817
|
+
return we(r) ? _e(r.const, e.schema, !!e.required) : t === null || t < 0 ? _e(null, e.schema, !!e.required) : [];
|
|
1814
1818
|
}
|
|
1815
|
-
function
|
|
1819
|
+
function Vd(e) {
|
|
1816
1820
|
return typeof e == "string" ? e : null;
|
|
1817
1821
|
}
|
|
1818
|
-
function
|
|
1819
|
-
return t.map((r) =>
|
|
1822
|
+
function Ud(e, t) {
|
|
1823
|
+
return t.map((r) => Et(e, r));
|
|
1820
1824
|
}
|
|
1821
|
-
function
|
|
1822
|
-
return C(s({}, e), { oneOf: e.oneOf.map(
|
|
1825
|
+
function Hd(e) {
|
|
1826
|
+
return C(s({}, e), { oneOf: e.oneOf.map(qd) });
|
|
1823
1827
|
}
|
|
1824
|
-
function
|
|
1828
|
+
function qd(e, t) {
|
|
1825
1829
|
let { title: r, description: a, disabled: o = false, icon: n, image: i, keywords: c } = e;
|
|
1826
1830
|
return { title: r, description: a, disabled: o, icon: n, image: i, const: t, keywords: c };
|
|
1827
1831
|
}
|
|
1828
1832
|
bs.defaultProps = { required: false, disabled: false };
|
|
1829
1833
|
var uo = bs;
|
|
1830
|
-
var Os =
|
|
1834
|
+
var Os = Ee(Xe());
|
|
1831
1835
|
var wt = require("react");
|
|
1832
1836
|
var ea = require("@transferwise/components");
|
|
1833
1837
|
var xs = require("react");
|
|
1834
1838
|
var As = require("react/jsx-runtime");
|
|
1835
1839
|
function vs(e) {
|
|
1836
|
-
let { id: t, httpClient: r = fetch, httpOptions: a, fileId: o, idProperty: n, usAccept: i, maxSize: c, usPlaceholder: l, onSuccess: m, onFailure: p, onCancel: h } = e, y =
|
|
1840
|
+
let { id: t, httpClient: r = fetch, httpOptions: a, fileId: o, idProperty: n, usAccept: i, maxSize: c, usPlaceholder: l, onSuccess: m, onFailure: p, onCancel: h } = e, y = re(), u = (0, xs.useMemo)(() => o ? [{ id: o, status: ea.Status.SUCCEEDED }] : [], [o]), d = (f) => (y("Dynamic Flow - PersistAsync", { status: "pending", schemaId: t }), r(String(a.url), { method: a.method || "POST", body: f }).then((w) => w.ok ? (m == null || m(w.clone()), w.json().then((S) => ({ id: S[n] }))) : (p == null || p({ response: w }), Promise.reject())));
|
|
1837
1841
|
return (0, As.jsx)(ea.UploadInput, { id: t, fileInputName: a.fileInputName, files: u, uploadButtonTitle: e.usLabel, sizeLimit: c ? Nr(c) : void 0, fileTypes: i, description: l, onUploadFile: d, onDeleteFile: (f) => (h == null || h(), Promise.resolve()) });
|
|
1838
1842
|
}
|
|
1839
|
-
var
|
|
1843
|
+
var Ut = require("react/jsx-runtime");
|
|
1840
1844
|
function Ps(e) {
|
|
1841
|
-
let [t, r] = (0, wt.useState)({}), [a, o] = (0, wt.useState)(null), [n, i] = (0, wt.useState)([]), [c, l] = (0, wt.useState)(false), m = ae(), p =
|
|
1845
|
+
let [t, r] = (0, wt.useState)({}), [a, o] = (0, wt.useState)(null), [n, i] = (0, wt.useState)([]), [c, l] = (0, wt.useState)(false), m = ae(), p = re();
|
|
1842
1846
|
(0, wt.useEffect)(() => {
|
|
1843
|
-
e.submitted && i(
|
|
1847
|
+
e.submitted && i(_e(e.model, e.schema, !!e.required));
|
|
1844
1848
|
}, [e.model, e.submitted]);
|
|
1845
1849
|
let y = async (O, x) => {
|
|
1846
|
-
let M = await O.json(),
|
|
1847
|
-
e.onChange({ model:
|
|
1850
|
+
let M = await O.json(), E = fo(e.schema.persistAsync.idProperty, M);
|
|
1851
|
+
e.onChange({ model: E, triggerSchema: e.schema, triggerModel: E }), l(true), p("Dynamic Flow - PersistAsync", { status: "success", schemaId: e.schema.$id });
|
|
1848
1852
|
}, u = async (O) => {
|
|
1849
1853
|
if (O.response && Lr(O.response.status)) {
|
|
1850
1854
|
let x = await O.response.json();
|
|
@@ -1854,7 +1858,7 @@ var require_main_min = __commonJS({
|
|
|
1854
1858
|
}, d = () => {
|
|
1855
1859
|
o(null), e.onChange({ model: null, triggerSchema: e.schema, triggerModel: null }), l(true);
|
|
1856
1860
|
}, { url: f, method: w } = e.schema.persistAsync, S = a || n, F = { "form-group": true, "has-error": (e.submitted || c) && !!S.length }, g = e.schema.$id || e.schema.persistAsync.schema.$id || e.schema.persistAsync.idProperty, v = `${g}-feedback`;
|
|
1857
|
-
return (0,
|
|
1861
|
+
return (0, Ut.jsxs)("div", { className: (0, Os.default)(F), children: [(0, Ut.jsx)("div", { "aria-describedby": v, children: (0, Ut.jsx)(vs, s({ id: g, fileId: e.model, idProperty: e.schema.persistAsync.idProperty, animationDelay: 0, maxSize: e.schema.persistAsync.schema.maxSize, usLabel: e.schema.title || e.schema.persistAsync.schema.title, usPlaceholder: e.schema.description || e.schema.persistAsync.schema.description, httpOptions: { url: f, method: w, fileInputName: e.schema.persistAsync.param }, httpClient: m, onSuccess: y, onFailure: u, onCancel: d }, Qr(e.schema.persistAsync.schema))) }), (0, Ut.jsx)(He, { id: v, blurred: true, focused: false, changed: c, submitted: e.submitted, errors: e.errors, schema: e.schema, validations: S, validationMessages: s({ required: "Value is required..." }, t), infoMessage: null })] });
|
|
1858
1862
|
}
|
|
1859
1863
|
Ps.defaultProps = { required: false };
|
|
1860
1864
|
var yo = Ps;
|
|
@@ -1867,7 +1871,7 @@ var require_main_min = __commonJS({
|
|
|
1867
1871
|
var go = Ms;
|
|
1868
1872
|
var zs = require("react");
|
|
1869
1873
|
var ks = (e, t) => {
|
|
1870
|
-
let r =
|
|
1874
|
+
let r = Nt(e, t);
|
|
1871
1875
|
return r !== null ? e.oneOf[r].promoted ? "promoted" : "other" : null;
|
|
1872
1876
|
};
|
|
1873
1877
|
var Es = require("@transferwise/components");
|
|
@@ -1881,84 +1885,84 @@ var require_main_min = __commonJS({
|
|
|
1881
1885
|
Is.defaultProps = {};
|
|
1882
1886
|
var Ds = Is;
|
|
1883
1887
|
var Ls = require("@transferwise/components");
|
|
1884
|
-
var
|
|
1888
|
+
var dr = require("react/jsx-runtime");
|
|
1885
1889
|
function Ts(e) {
|
|
1886
1890
|
var l, m;
|
|
1887
|
-
let { id: t, selection: r, setSelection: a, promotion: o, promotedOneOf: n, title: i } = e, c = [s({ value: "promoted", label: ((l = o.promoted) == null ? void 0 : l.title) || n.title, secondary: ((m = o.promoted) == null ? void 0 : m.description) || n.description },
|
|
1888
|
-
return (0,
|
|
1891
|
+
let { id: t, selection: r, setSelection: a, promotion: o, promotedOneOf: n, title: i } = e, c = [s({ value: "promoted", label: ((l = o.promoted) == null ? void 0 : l.title) || n.title, secondary: ((m = o.promoted) == null ? void 0 : m.description) || n.description }, Vt(n)), s({ value: "other", label: o.other.title, secondary: o.other.description }, Vt(o.other))];
|
|
1892
|
+
return (0, dr.jsxs)("div", { className: "form-group", children: [i && (0, dr.jsx)("label", { className: "control-label", htmlFor: t, children: i }), (0, dr.jsx)(Ls.RadioGroup, { name: "promoted-selection", selectedValue: r, radios: c, id: t, onChange: a })] });
|
|
1889
1893
|
}
|
|
1890
1894
|
Ts.defaultProps = { title: void 0 };
|
|
1891
1895
|
var Rs = Ts;
|
|
1892
|
-
var
|
|
1896
|
+
var Ht = require("react/jsx-runtime");
|
|
1893
1897
|
function Ns(e) {
|
|
1894
1898
|
switch (e.promotion.control || "radio") {
|
|
1895
1899
|
case "radio":
|
|
1896
|
-
return (0,
|
|
1900
|
+
return (0, Ht.jsx)(Rs, s({}, e));
|
|
1897
1901
|
case "checkbox":
|
|
1898
|
-
return (0,
|
|
1902
|
+
return (0, Ht.jsx)(Ds, s({}, e));
|
|
1899
1903
|
default:
|
|
1900
|
-
return (0,
|
|
1904
|
+
return (0, Ht.jsx)(Ht.Fragment, {});
|
|
1901
1905
|
}
|
|
1902
1906
|
}
|
|
1903
|
-
Ns.defaultProps = { id:
|
|
1907
|
+
Ns.defaultProps = { id: Te(), title: void 0 };
|
|
1904
1908
|
var Bs = Ns;
|
|
1905
1909
|
var Ge = require("react/jsx-runtime");
|
|
1906
1910
|
var js = (e) => e.promoted === true;
|
|
1907
|
-
var
|
|
1911
|
+
var Gd = (e) => {
|
|
1908
1912
|
var c;
|
|
1909
|
-
let [t, r] = (0, zs.useState)(ks(e.schema, e.model) || ((c = e.schema.promotion) == null ? void 0 : c.default) || "promoted"), a = e.schema.alert, o = e.schema.oneOf.find(js), n =
|
|
1910
|
-
return (0, Ge.jsxs)(Ge.Fragment, { children: [a && (0, Ge.jsx)(se, { component: a }), (0, Ge.jsx)(Bs, { id: e.schema.$id, title: e.schema.title, promotedOneOf: o, promotion: e.schema.promotion, selection: t, setSelection: r }), t === "promoted" && (0, Ge.jsx)(
|
|
1913
|
+
let [t, r] = (0, zs.useState)(ks(e.schema, e.model) || ((c = e.schema.promotion) == null ? void 0 : c.default) || "promoted"), a = e.schema.alert, o = e.schema.oneOf.find(js), n = Wd(o), i = $d(e.schema);
|
|
1914
|
+
return (0, Ge.jsxs)(Ge.Fragment, { children: [a && (0, Ge.jsx)(se, { component: a }), (0, Ge.jsx)(Bs, { id: e.schema.$id, title: e.schema.title, promotedOneOf: o, promotion: e.schema.promotion, selection: t, setSelection: r }), t === "promoted" && (0, Ge.jsx)(mr, C(s({}, e), { schema: n })), t === "other" && (0, Ge.jsx)(me, C(s({}, e), { schema: i }))] });
|
|
1911
1915
|
};
|
|
1912
|
-
function
|
|
1916
|
+
function Wd(e) {
|
|
1913
1917
|
return C(s({}, e), { title: void 0, description: void 0 });
|
|
1914
1918
|
}
|
|
1915
|
-
function
|
|
1919
|
+
function $d(e) {
|
|
1916
1920
|
var a, o, n;
|
|
1917
1921
|
let t = (a = e.promotion) != null && a.displayTwice ? [...e.oneOf] : e.oneOf.filter((i) => !js(i)), r = (n = (o = e.promotion) == null ? void 0 : o.other.heading) == null ? void 0 : n.text;
|
|
1918
1922
|
return t.length === 1 ? C(s({}, t[0]), { title: r }) : t.length > 1 ? { title: r, oneOf: t, control: e.control } : null;
|
|
1919
1923
|
}
|
|
1920
|
-
var Co =
|
|
1924
|
+
var Co = Gd;
|
|
1921
1925
|
var ta = require("@transferwise/components");
|
|
1922
1926
|
var Us = require("react-intl");
|
|
1923
1927
|
var Vs = require("react-intl");
|
|
1924
1928
|
var So = (0, Vs.defineMessages)({ yes: { id: "dynamicFlows.ReadOnlySchema.yes", defaultMessage: "Yes", description: "Yes, used for boolean schemas with a value of true." }, no: { id: "dynamicFlows.ReadOnlySchema.no", defaultMessage: "No", description: "No: used for boolean schemas with a value of false." } });
|
|
1925
|
-
var
|
|
1926
|
-
function
|
|
1927
|
-
let { title: r = "" } = e, { formatMessage: a } = (0, Us.useIntl)(), o =
|
|
1928
|
-
return (0,
|
|
1929
|
+
var qt = require("react/jsx-runtime");
|
|
1930
|
+
function _d({ schema: e, model: t }) {
|
|
1931
|
+
let { title: r = "" } = e, { formatMessage: a } = (0, Us.useIntl)(), o = Kd({ schema: e, model: t, formatMessage: a });
|
|
1932
|
+
return (0, qt.jsx)(ta.DefinitionList, { layout: ta.Layout.VERTICAL_ONE_COLUMN, definitions: [{ title: r, value: o, key: "" }] });
|
|
1929
1933
|
}
|
|
1930
|
-
var Fo =
|
|
1931
|
-
function
|
|
1932
|
-
return Ve(e) ? ge(e) ?
|
|
1934
|
+
var Fo = _d;
|
|
1935
|
+
function Kd({ schema: e, model: t, formatMessage: r }) {
|
|
1936
|
+
return Ve(e) ? ge(e) ? Jd(e, t) : e.type === "boolean" && Ie(t) ? r(t ? So.yes : So.no) : t && t.toString() || "" : "";
|
|
1933
1937
|
}
|
|
1934
|
-
function
|
|
1935
|
-
let r =
|
|
1936
|
-
return r ?
|
|
1938
|
+
function Jd(e, t) {
|
|
1939
|
+
let r = Xd(e, t);
|
|
1940
|
+
return r ? Yd(r) : t;
|
|
1937
1941
|
}
|
|
1938
|
-
function
|
|
1942
|
+
function Xd(e, t) {
|
|
1939
1943
|
return e.oneOf.find((r) => "const" in r ? t === r.const : false);
|
|
1940
1944
|
}
|
|
1941
|
-
function
|
|
1942
|
-
let t = e.title && e.description ? `${e.title} - ${e.description}` : e.title || "", r =
|
|
1943
|
-
return r != null && r.avatar ? (0,
|
|
1945
|
+
function Yd(e) {
|
|
1946
|
+
let t = e.title && e.description ? `${e.title} - ${e.description}` : e.title || "", r = Vt({ icon: e.icon });
|
|
1947
|
+
return r != null && r.avatar ? (0, qt.jsxs)(qt.Fragment, { children: [r.avatar, " ", t] }) : t;
|
|
1944
1948
|
}
|
|
1945
|
-
var
|
|
1949
|
+
var Be = require("react");
|
|
1946
1950
|
var qs = require("react/jsx-runtime");
|
|
1947
1951
|
function Hs(e) {
|
|
1948
|
-
let { schema: t, model: r, required: a, submitted: o, errors: n, onChange: i } = e, [c, l] = (0,
|
|
1949
|
-
(0,
|
|
1952
|
+
let { schema: t, model: r, required: a, submitted: o, errors: n, onChange: i } = e, [c, l] = (0, Be.useState)(r), m = (0, Be.useRef)(null), [p, h] = (0, Be.useState)(null), [y, u] = (0, Be.useState)(null), [d, f] = (0, Be.useState)(false), [w, S] = (0, Be.useState)(null), F = ae(), g = re(), v = Mt();
|
|
1953
|
+
(0, Be.useEffect)(() => {
|
|
1950
1954
|
t.validationAsync.method || v.warning("Invalid schema or model", 'ValidationAsyncSchema without a "method" property would have defaulted to "GET" in previous versions. Now defaults to "POST".', {});
|
|
1951
1955
|
}, [v, t.validationAsync.method]);
|
|
1952
|
-
let O = async (D,
|
|
1953
|
-
let ee = x(), A = { [
|
|
1956
|
+
let O = async (D, U) => {
|
|
1957
|
+
let ee = x(), A = { [U.param]: D };
|
|
1954
1958
|
m.current = D, f(true), g("Dynamic Flow - ValidationAsync", { status: "pending" });
|
|
1955
|
-
let B = await F(
|
|
1959
|
+
let B = await F(U.url, { method: U.method || "POST", headers: { "Content-Type": "application/json" }, body: U.method === "GET" ? void 0 : JSON.stringify(A), signal: ee });
|
|
1956
1960
|
try {
|
|
1957
|
-
let
|
|
1958
|
-
if (!R(
|
|
1961
|
+
let k = await B.json();
|
|
1962
|
+
if (!R(k))
|
|
1959
1963
|
throw new Error("Response body is not an object");
|
|
1960
|
-
g("Dynamic Flow - ValidationAsync", { status: "success" }), B.status === 200 ? h(L(
|
|
1961
|
-
} catch (
|
|
1964
|
+
g("Dynamic Flow - ValidationAsync", { status: "success" }), B.status === 200 ? h(L(k.message) ? k.message : null) : B.status === 422 && u(L(k.message) ? k.message : null);
|
|
1965
|
+
} catch (k) {
|
|
1962
1966
|
g("Dynamic Flow - ValidationAsync", { status: "failure" });
|
|
1963
1967
|
}
|
|
1964
1968
|
}, x = () => {
|
|
@@ -1969,17 +1973,17 @@ var require_main_min = __commonJS({
|
|
|
1969
1973
|
return (0, qs.jsx)(Ct, s({}, { submitted: o || d, model: c, errors: y || n, infoMessage: p, onChange: (D) => {
|
|
1970
1974
|
i(C(s({}, D), { triggerSchema: t, triggerModel: D.model })), u(null), h(null), l(D.model);
|
|
1971
1975
|
}, onBlur: () => {
|
|
1972
|
-
!I(c) && !
|
|
1976
|
+
!I(c) && !Je(c, m.current) && G(c, t) && O(c, t.validationAsync);
|
|
1973
1977
|
}, required: a, schema: t }));
|
|
1974
1978
|
}
|
|
1975
1979
|
Hs.defaultProps = { required: false };
|
|
1976
1980
|
var bo = Hs;
|
|
1977
1981
|
var he = require("react/jsx-runtime");
|
|
1978
1982
|
var Ws = require("react");
|
|
1979
|
-
function
|
|
1980
|
-
let { schema: t, model: r = null, errors: a = null, hideTitle: o = false, disabled: n = false } = e, i = C(s({}, e), { model: r, errors: a, hideTitle: o, disabled: n }), c = dt(t), l =
|
|
1983
|
+
function Zd(e) {
|
|
1984
|
+
let { schema: t, model: r = null, errors: a = null, hideTitle: o = false, disabled: n = false } = e, i = C(s({}, e), { model: r, errors: a, hideTitle: o, disabled: n }), c = dt(t), l = Mt();
|
|
1981
1985
|
switch ((0, Gs.useEffect)(() => {
|
|
1982
|
-
|
|
1986
|
+
Qd(t, r, a) || l.error("Invalid schema or model", `Schema of type ${c || "undefined"} requested, but schema did not pass validation.`);
|
|
1983
1987
|
}, [JSON.stringify(t), JSON.stringify(r), JSON.stringify(a), c, l]), c) {
|
|
1984
1988
|
case "readOnly":
|
|
1985
1989
|
return (0, he.jsx)(Fo, s({}, i));
|
|
@@ -1992,7 +1996,7 @@ var require_main_min = __commonJS({
|
|
|
1992
1996
|
return (0, he.jsx)(Ct, s({}, m));
|
|
1993
1997
|
}
|
|
1994
1998
|
case "object":
|
|
1995
|
-
return (0, Ws.createElement)(
|
|
1999
|
+
return (0, Ws.createElement)(mr, C(s({}, i), { key: JSON.stringify(t) }));
|
|
1996
2000
|
case "array":
|
|
1997
2001
|
return (0, he.jsx)(oo, s({}, i));
|
|
1998
2002
|
case "promotedOneOf":
|
|
@@ -2004,19 +2008,19 @@ var require_main_min = __commonJS({
|
|
|
2004
2008
|
}
|
|
2005
2009
|
return (0, he.jsx)(he.Fragment, {});
|
|
2006
2010
|
}
|
|
2007
|
-
var me =
|
|
2008
|
-
var
|
|
2011
|
+
var me = Zd;
|
|
2012
|
+
var Qd = (e, t, r) => {
|
|
2009
2013
|
switch (dt(e)) {
|
|
2010
2014
|
case "persistAsync":
|
|
2011
|
-
return Br(e) && jr(t) &&
|
|
2015
|
+
return Br(e) && jr(t) && rr(r);
|
|
2012
2016
|
case "validationAsync":
|
|
2013
|
-
return Ha(e) && Ga(t) &&
|
|
2017
|
+
return Ha(e) && Ga(t) && rr(r);
|
|
2014
2018
|
case "basic":
|
|
2015
|
-
return Ve(e) && Ga(t) &&
|
|
2019
|
+
return Ve(e) && Ga(t) && rr(r);
|
|
2016
2020
|
case "object":
|
|
2017
|
-
return
|
|
2021
|
+
return Le(e) && qa(t);
|
|
2018
2022
|
case "array":
|
|
2019
|
-
return je(e) && Xn(t) &&
|
|
2023
|
+
return je(e) && Xn(t) && rr(r);
|
|
2020
2024
|
case "promotedOneOf":
|
|
2021
2025
|
return lt(e) && qa(t);
|
|
2022
2026
|
case "oneOf":
|
|
@@ -2027,21 +2031,21 @@ var require_main_min = __commonJS({
|
|
|
2027
2031
|
return false;
|
|
2028
2032
|
};
|
|
2029
2033
|
var xo = require("react/jsx-runtime");
|
|
2030
|
-
function
|
|
2034
|
+
function eu({ component: e, model: t = null, errors: r = null, submitted: a, onModelChange: o, onPersistAsync: n }) {
|
|
2031
2035
|
let i = e.schema;
|
|
2032
|
-
return (0, xo.jsx)("div", { className:
|
|
2036
|
+
return (0, xo.jsx)("div", { className: V(e.margin || "md"), children: (0, xo.jsx)(me, { schema: i, model: t, errors: r, submitted: a, onChange: (c) => {
|
|
2033
2037
|
o(s({ formSchema: i }, c));
|
|
2034
2038
|
}, onPersistAsync: n }) });
|
|
2035
2039
|
}
|
|
2036
|
-
var vo =
|
|
2040
|
+
var vo = eu;
|
|
2037
2041
|
var ra = require("@transferwise/components");
|
|
2038
|
-
var $s =
|
|
2042
|
+
var $s = Ee(Xe());
|
|
2039
2043
|
var ve = require("react/jsx-runtime");
|
|
2040
|
-
var
|
|
2044
|
+
var tu = (e) => {
|
|
2041
2045
|
let { text: t, size: r = "md", align: a = "left", margin: o = "md", control: n } = e.component, i = (0, $s.default)(Ce({ align: a, margin: o }));
|
|
2042
|
-
return n === "display" ? (0, ve.jsx)(
|
|
2046
|
+
return n === "display" ? (0, ve.jsx)(au, { size: r, text: t, classes: i }) : (0, ve.jsx)(ru, { size: r, text: t, classes: i });
|
|
2043
2047
|
};
|
|
2044
|
-
var
|
|
2048
|
+
var ru = ({ size: e, text: t, classes: r }) => {
|
|
2045
2049
|
switch (e) {
|
|
2046
2050
|
case "xs":
|
|
2047
2051
|
return (0, ve.jsx)("h5", { className: r, children: t });
|
|
@@ -2056,7 +2060,7 @@ var require_main_min = __commonJS({
|
|
|
2056
2060
|
return (0, ve.jsx)("h3", { className: r, children: t });
|
|
2057
2061
|
}
|
|
2058
2062
|
};
|
|
2059
|
-
var
|
|
2063
|
+
var au = ({ size: e, text: t, classes: r }) => {
|
|
2060
2064
|
switch (e) {
|
|
2061
2065
|
case "xs":
|
|
2062
2066
|
case "sm":
|
|
@@ -2069,120 +2073,120 @@ var require_main_min = __commonJS({
|
|
|
2069
2073
|
return (0, ve.jsx)(ra.Display, { type: "display-medium", className: r, children: t });
|
|
2070
2074
|
}
|
|
2071
2075
|
};
|
|
2072
|
-
var Ao =
|
|
2076
|
+
var Ao = tu;
|
|
2073
2077
|
var Oo = require("@transferwise/components");
|
|
2074
|
-
var
|
|
2078
|
+
var ur = require("react/jsx-runtime");
|
|
2075
2079
|
var Po = ({ component: e }) => {
|
|
2076
2080
|
let { content: t, align: r, margin: a } = e;
|
|
2077
|
-
return (0,
|
|
2081
|
+
return (0, ur.jsx)("div", { className: Ce({ align: r, margin: a }), children: (0, ur.jsx)(Oo.Markdown, { config: { link: { target: "_blank" } }, children: t }) });
|
|
2078
2082
|
};
|
|
2079
|
-
var Mo = ({ component: e }) => (0,
|
|
2083
|
+
var Mo = ({ component: e }) => (0, ur.jsx)("div", { className: Ce(e), children: (0, ur.jsx)(Oo.Markdown, { config: { link: { target: "_blank" } }, children: e.markdown }) });
|
|
2080
2084
|
var _s = require("@transferwise/components");
|
|
2081
2085
|
var aa = require("react");
|
|
2082
2086
|
var ko = require("react/jsx-runtime");
|
|
2083
|
-
function
|
|
2087
|
+
function ou({ component: e }) {
|
|
2084
2088
|
let { url: t, size: r, text: a, margin: o, accessibilityDescription: n } = e, i = ae(), [c, l] = (0, aa.useState)("");
|
|
2085
2089
|
(0, aa.useEffect)(() => {
|
|
2086
|
-
|
|
2090
|
+
iu(i, t).then(l);
|
|
2087
2091
|
}, [t, i]);
|
|
2088
2092
|
let m = { alt: n || a || "", src: c, stretch: true, shrink: true };
|
|
2089
|
-
return c ? (0, ko.jsx)("div", { className: `df-image ${r || "md"}`, children: (0, ko.jsx)(_s.Image, s({ className: `img-responsive ${
|
|
2093
|
+
return c ? (0, ko.jsx)("div", { className: `df-image ${r || "md"}`, children: (0, ko.jsx)(_s.Image, s({ className: `img-responsive ${V(o || "md")}` }, m)) }) : null;
|
|
2090
2094
|
}
|
|
2091
|
-
var
|
|
2095
|
+
var nu = (e) => new Promise((t, r) => {
|
|
2092
2096
|
let a = new FileReader();
|
|
2093
2097
|
a.addEventListener("loadend", () => t(a.result)), a.addEventListener("error", (o) => r(o)), a.readAsDataURL(e);
|
|
2094
2098
|
});
|
|
2095
|
-
var
|
|
2099
|
+
var iu = async (e, t) => {
|
|
2096
2100
|
var r;
|
|
2097
2101
|
try {
|
|
2098
2102
|
return vn(t) || t != null && t.startsWith(`${(r = window == null ? void 0 : window.location) == null ? void 0 : r.origin}/`) ? e(t, { method: "GET", headers: { "Content-Type": "image/image" }, credentials: "same-origin" }).then((a) => {
|
|
2099
2103
|
if (a.ok)
|
|
2100
2104
|
return a.blob();
|
|
2101
2105
|
throw new Error("Image fetching failed");
|
|
2102
|
-
}).then(
|
|
2106
|
+
}).then(nu).catch(() => t) : t;
|
|
2103
2107
|
} catch (a) {
|
|
2104
2108
|
return t;
|
|
2105
2109
|
}
|
|
2106
2110
|
};
|
|
2107
|
-
var Eo =
|
|
2111
|
+
var Eo = ou;
|
|
2108
2112
|
var oa = require("@transferwise/components");
|
|
2109
|
-
var
|
|
2110
|
-
var
|
|
2111
|
-
var
|
|
2112
|
-
var
|
|
2113
|
-
let { items: t } = e, r = t.filter((o) =>
|
|
2114
|
-
return (0,
|
|
2115
|
-
};
|
|
2116
|
-
var Io =
|
|
2117
|
-
var
|
|
2113
|
+
var pr = require("react/jsx-runtime");
|
|
2114
|
+
var su = ["positive", "neutral"];
|
|
2115
|
+
var cu = ["warning", "negative"];
|
|
2116
|
+
var mu = ({ component: e }) => {
|
|
2117
|
+
let { items: t } = e, r = t.filter((o) => su.includes(o.context)).map(({ text: o }) => o), a = t.filter((o) => cu.includes(o.context)).map(({ text: o }) => o);
|
|
2118
|
+
return (0, pr.jsxs)("div", { className: V(e.margin || "md"), children: [e.title ? (0, pr.jsx)(oa.Header, { title: e.title }) : null, (0, pr.jsx)(oa.InstructionsList, { dos: r, donts: a })] });
|
|
2119
|
+
};
|
|
2120
|
+
var Io = mu;
|
|
2121
|
+
var H = require("react/jsx-runtime");
|
|
2118
2122
|
var K = (e) => JSON.stringify(e);
|
|
2119
|
-
function
|
|
2123
|
+
function lu(e) {
|
|
2120
2124
|
let { components: t, model: r, submitted: a, errors: o, onModelChange: n, onAction: i, onPersistAsync: c, baseUrl: l } = e, m = (p) => {
|
|
2121
2125
|
switch (p.type) {
|
|
2122
2126
|
case "heading":
|
|
2123
|
-
return (0,
|
|
2127
|
+
return (0, H.jsx)(Ao, { component: p }, K(p));
|
|
2124
2128
|
case "paragraph":
|
|
2125
|
-
return (0,
|
|
2129
|
+
return (0, H.jsx)(Lo, { component: p }, K(p));
|
|
2126
2130
|
case "image":
|
|
2127
|
-
return (0,
|
|
2131
|
+
return (0, H.jsx)(Eo, { component: p }, K(p));
|
|
2128
2132
|
case "alert":
|
|
2129
|
-
return (0,
|
|
2133
|
+
return (0, H.jsx)(se, { component: p }, K(p));
|
|
2130
2134
|
case "review":
|
|
2131
|
-
return (0,
|
|
2135
|
+
return (0, H.jsx)(To, { component: p, onAction: i }, K(p));
|
|
2132
2136
|
case "divider":
|
|
2133
|
-
return (0,
|
|
2137
|
+
return (0, H.jsx)(Ya, { component: p }, K(p));
|
|
2134
2138
|
case "info":
|
|
2135
|
-
return (0,
|
|
2139
|
+
return (0, H.jsx)(Mo, { component: p }, K(p));
|
|
2136
2140
|
case "instructions":
|
|
2137
|
-
return (0,
|
|
2141
|
+
return (0, H.jsx)(Io, { component: p }, K(p));
|
|
2138
2142
|
case "markdown":
|
|
2139
|
-
return (0,
|
|
2143
|
+
return (0, H.jsx)(Po, { component: p }, K(p));
|
|
2140
2144
|
case "columns":
|
|
2141
|
-
return (0,
|
|
2145
|
+
return (0, H.jsx)(Ja, { component: p, model: r, submitted: a, errors: o, onModelChange: n, onAction: i, onPersistAsync: c }, K(p));
|
|
2142
2146
|
case "form":
|
|
2143
|
-
return (0,
|
|
2147
|
+
return (0, H.jsx)(vo, { component: p, model: r, submitted: a, errors: o, onModelChange: n, onPersistAsync: c }, K(C(s({}, p), { errors: o != null ? o : null })));
|
|
2144
2148
|
case "button":
|
|
2145
|
-
return (0,
|
|
2149
|
+
return (0, H.jsx)(Ka, { component: p, onAction: i }, K(p));
|
|
2146
2150
|
case "box":
|
|
2147
|
-
return (0,
|
|
2151
|
+
return (0, H.jsx)(_a, { component: p, model: r, submitted: a, errors: o, onModelChange: n, onAction: i, onPersistAsync: c }, K(p));
|
|
2148
2152
|
case "decision":
|
|
2149
|
-
return (0,
|
|
2153
|
+
return (0, H.jsx)(Xa, { component: p, onAction: i }, K(p));
|
|
2150
2154
|
case "external":
|
|
2151
|
-
return (0,
|
|
2155
|
+
return (0, H.jsx)(Za, { component: p, onAction: i }, K(p));
|
|
2152
2156
|
case "list":
|
|
2153
2157
|
case "status-list":
|
|
2154
|
-
return (0,
|
|
2158
|
+
return (0, H.jsx)(Do, { component: p, onAction: i }, K(p));
|
|
2155
2159
|
case "loading-indicator":
|
|
2156
|
-
return (0,
|
|
2160
|
+
return (0, H.jsx)(yr, { component: p }, K(p));
|
|
2157
2161
|
case "search":
|
|
2158
|
-
return (0,
|
|
2162
|
+
return (0, H.jsx)(Ro, { component: p, onAction: i }, K(p));
|
|
2159
2163
|
case "modal":
|
|
2160
|
-
return (0,
|
|
2164
|
+
return (0, H.jsx)(No, { component: p, model: r, submitted: a, errors: o, onModelChange: n, onAction: i, onPersistAsync: c }, K(p));
|
|
2161
2165
|
default:
|
|
2162
|
-
return (0,
|
|
2166
|
+
return (0, H.jsx)("div", {}, K(p));
|
|
2163
2167
|
}
|
|
2164
2168
|
};
|
|
2165
|
-
return wn() || l == null ? (0,
|
|
2169
|
+
return wn() || l == null ? (0, H.jsx)(H.Fragment, { children: t.map(m) }) : (0, H.jsx)(Ir, { baseUrl: l, children: t.map(m) });
|
|
2166
2170
|
}
|
|
2167
|
-
var ne =
|
|
2171
|
+
var ne = lu;
|
|
2168
2172
|
var na = require("@transferwise/components");
|
|
2169
|
-
var
|
|
2170
|
-
var
|
|
2171
|
-
var
|
|
2172
|
-
let o = s(s({ key: `${e}/${t || ""}`, title: e, description: t }, r != null && r.name ? { icon: (0,
|
|
2173
|
-
return (0,
|
|
2174
|
-
};
|
|
2175
|
-
var
|
|
2176
|
-
var
|
|
2177
|
-
var
|
|
2178
|
-
var Do =
|
|
2173
|
+
var Gt = require("react/jsx-runtime");
|
|
2174
|
+
var du = ({ component: e }) => (0, Gt.jsxs)("div", { className: V(e.margin || "md"), children: [e.title ? (0, Gt.jsx)(na.Header, { title: e.title }) : null, e.items.map(uu)] });
|
|
2175
|
+
var uu = ({ title: e, description: t, icon: r, status: a }) => {
|
|
2176
|
+
let o = s(s({ key: `${e}/${t || ""}`, title: e, description: t }, r != null && r.name ? { icon: (0, Gt.jsx)(Ye, { type: r.name }) } : {}), a ? { status: fu[a] } : {});
|
|
2177
|
+
return (0, Gt.jsx)(na.Summary, s({}, o));
|
|
2178
|
+
};
|
|
2179
|
+
var pu = { done: "done", pending: "pending", "not-done": "notDone" };
|
|
2180
|
+
var yu = { positive: "done", warning: "pending", neutral: "notDone" };
|
|
2181
|
+
var fu = s(s({}, pu), yu);
|
|
2182
|
+
var Do = du;
|
|
2179
2183
|
var Ks = require("@transferwise/components");
|
|
2180
2184
|
var Js = require("react/jsx-runtime");
|
|
2181
|
-
var
|
|
2185
|
+
var hu = ({ component: e }) => {
|
|
2182
2186
|
let { margin: t = "md", size: r = "md" } = e;
|
|
2183
|
-
return (0, Js.jsx)(Ks.Loader, { size: r, classNames: { "tw-loader": `tw-loader m-x-auto ${
|
|
2187
|
+
return (0, Js.jsx)(Ks.Loader, { size: r, classNames: { "tw-loader": `tw-loader m-x-auto ${V(t)}` }, "data-testid": "loading-indicator" });
|
|
2184
2188
|
};
|
|
2185
|
-
var
|
|
2189
|
+
var yr = hu;
|
|
2186
2190
|
var ec = require("@transferwise/components");
|
|
2187
2191
|
var tc = require("react-intl");
|
|
2188
2192
|
var Xs = require("react-intl");
|
|
@@ -2191,35 +2195,39 @@ var require_main_min = __commonJS({
|
|
|
2191
2195
|
var Zs = require("react");
|
|
2192
2196
|
function Qs() {
|
|
2193
2197
|
let e = (0, Zs.useContext)(Ys.SnackbarContext);
|
|
2194
|
-
return e ? e.createSnackbar :
|
|
2198
|
+
return e ? e.createSnackbar : gu;
|
|
2195
2199
|
}
|
|
2196
|
-
function
|
|
2200
|
+
function gu() {
|
|
2197
2201
|
}
|
|
2198
|
-
var
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
+
var tt = require("react/jsx-runtime");
|
|
2203
|
+
function wu({ component: e }) {
|
|
2204
|
+
return e.control === "copyable" ? (0, tt.jsx)(Su, { component: e }) : (0, tt.jsx)(Cu, { component: e });
|
|
2205
|
+
}
|
|
2206
|
+
function Cu({ component: e }) {
|
|
2207
|
+
return (0, tt.jsxs)("p", { className: Ce(e), children: [" ", e.text, " "] });
|
|
2208
|
+
}
|
|
2209
|
+
function Su({ component: e }) {
|
|
2202
2210
|
let { formatMessage: t } = (0, tc.useIntl)(), r = Qs(), { text: a } = e, o = () => {
|
|
2203
2211
|
var i;
|
|
2204
|
-
(i = navigator.clipboard) == null || i.writeText(a).then(() => r({ text: t(Bo.copied) })).catch(
|
|
2205
|
-
}, n = Ce({ align: e.align, margin: "sm" })
|
|
2206
|
-
return (0,
|
|
2207
|
-
};
|
|
2208
|
-
function bu() {
|
|
2212
|
+
(i = navigator.clipboard) == null || i.writeText(a).then(() => r({ text: t(Bo.copied) })).catch(Fu);
|
|
2213
|
+
}, n = `${Ce({ align: e.align, margin: "sm" })} form-control`;
|
|
2214
|
+
return (0, tt.jsxs)("div", { className: Ce(e), children: [(0, tt.jsx)("input", { type: "text", className: n, value: a, readOnly: true, style: { textOverflow: "ellipsis" } }), (0, tt.jsx)(ec.Button, { block: true, onClick: o, children: t(Bo.copy) })] });
|
|
2209
2215
|
}
|
|
2210
|
-
|
|
2216
|
+
function Fu() {
|
|
2217
|
+
}
|
|
2218
|
+
var Lo = wu;
|
|
2211
2219
|
var ia = require("@transferwise/components");
|
|
2212
2220
|
var le = require("react/jsx-runtime");
|
|
2213
|
-
var
|
|
2214
|
-
var
|
|
2215
|
-
var
|
|
2216
|
-
function
|
|
2217
|
-
let t = e.component, r =
|
|
2221
|
+
var bu = (e, t) => t.fields.map(({ label: r, value: a, help: o }, n) => ({ key: String(n), title: r, value: xu(a, o, e) }));
|
|
2222
|
+
var xu = (e, t, r) => t ? r === "HORIZONTAL_RIGHT_ALIGNED" ? (0, le.jsxs)(le.Fragment, { children: [(0, le.jsx)(qe, { help: t }), " ", e] }) : (0, le.jsxs)(le.Fragment, { children: [e, " ", (0, le.jsx)(qe, { help: t })] }) : e;
|
|
2223
|
+
var vu = (e) => (e.control || e.orientation) === "horizontal" ? "HORIZONTAL_RIGHT_ALIGNED" : "VERTICAL_ONE_COLUMN";
|
|
2224
|
+
function Au(e) {
|
|
2225
|
+
let t = e.component, r = V(t.margin || "xs"), a = (c, l) => ({ text: c != null ? c : "", href: l.url, onClick: (m) => {
|
|
2218
2226
|
m.preventDefault(), l && e.onAction(l);
|
|
2219
|
-
} }), o =
|
|
2220
|
-
return (0, le.jsxs)("div", { className: r, children: [t.title && (0, le.jsx)(ia.Header, { title: t.title, action: n || i || void 0 }), (0, le.jsx)("div", { className: r, children: (0, le.jsx)(ia.DefinitionList, { layout: o, definitions:
|
|
2227
|
+
} }), o = vu(t), n = t.callToAction ? a(t.callToAction.title, t.callToAction.action) : null, i = !n && t.action ? a(t.action.title || "", t.action) : null;
|
|
2228
|
+
return (0, le.jsxs)("div", { className: r, children: [t.title && (0, le.jsx)(ia.Header, { title: t.title, action: n || i || void 0 }), (0, le.jsx)("div", { className: r, children: (0, le.jsx)(ia.DefinitionList, { layout: o, definitions: bu(o, t) }) })] });
|
|
2221
2229
|
}
|
|
2222
|
-
var To =
|
|
2230
|
+
var To = Au;
|
|
2223
2231
|
var ma = require("react");
|
|
2224
2232
|
var rc = require("@transferwise/components");
|
|
2225
2233
|
var sa = require("react/jsx-runtime");
|
|
@@ -2227,19 +2235,19 @@ var require_main_min = __commonJS({
|
|
|
2227
2235
|
var ca = require("@transferwise/components");
|
|
2228
2236
|
var nc = require("react-intl");
|
|
2229
2237
|
var oc = require("react-intl");
|
|
2230
|
-
var
|
|
2238
|
+
var Wt = (0, oc.defineMessages)({ errorAlert: { id: "dynamicFlows.ErrorBoundary.errorAlert", defaultMessage: "Oops. Something went wrong...", description: "Generic error message for when something has gone wrong." }, retry: { id: "dynamicFlows.ErrorBoundary.retry", defaultMessage: "Retry", description: "Usually this follows the generic error and contains a link." } });
|
|
2231
2239
|
var St = require("react/jsx-runtime");
|
|
2232
2240
|
var ic = ({ results: e, emptyMessage: t, onSelect: r }) => e.length === 0 ? (0, St.jsx)("p", { className: "m-t-2", children: t }) : (0, St.jsx)(ca.NavigationOptionsList, { children: e.map((a) => (0, St.jsx)(ca.NavigationOption, { title: a.title, content: a.description, media: ut(a), showMediaCircle: false, showMediaAtAllSizes: true, onClick: () => r(a) }, JSON.stringify(a))) });
|
|
2233
2241
|
var sc = ({ onRetrySearch: e }) => {
|
|
2234
2242
|
let t = (0, nc.useIntl)();
|
|
2235
|
-
return (0, St.jsxs)("p", { className: "m-t-2", children: [t.formatMessage(
|
|
2243
|
+
return (0, St.jsxs)("p", { className: "m-t-2", children: [t.formatMessage(Wt.errorAlert), "\xA0", (0, St.jsx)("a", { href: "/", onClick: (r) => {
|
|
2236
2244
|
r.preventDefault(), e();
|
|
2237
|
-
}, children: t.formatMessage(
|
|
2245
|
+
}, children: t.formatMessage(Wt.retry) })] });
|
|
2238
2246
|
};
|
|
2239
|
-
var
|
|
2247
|
+
var $t = require("react");
|
|
2240
2248
|
var cc = { "Content-Type": "application/json" };
|
|
2241
2249
|
var mc = (e) => {
|
|
2242
|
-
let [t, r] = (0,
|
|
2250
|
+
let [t, r] = (0, $t.useState)({ status: "idle" }), a = (0, $t.useRef)(null), o = ae(), n = (0, $t.useCallback)(async (m, { url: p, method: h, param: y } = e) => {
|
|
2243
2251
|
var d;
|
|
2244
2252
|
if ((d = a.current) == null || d.abort(), !m) {
|
|
2245
2253
|
r({ status: "idle" });
|
|
@@ -2249,7 +2257,7 @@ var require_main_min = __commonJS({
|
|
|
2249
2257
|
let { signal: u } = a.current;
|
|
2250
2258
|
r({ status: "loading" });
|
|
2251
2259
|
try {
|
|
2252
|
-
let w = await (h === "GET" ? o(
|
|
2260
|
+
let w = await (h === "GET" ? o(Mu(p, y, m), { method: h, signal: u, headers: cc }) : o(p, { method: h, signal: u, headers: cc, body: JSON.stringify({ [y]: m }) }));
|
|
2253
2261
|
i(w, m);
|
|
2254
2262
|
} catch (f) {
|
|
2255
2263
|
c(f, m);
|
|
@@ -2257,78 +2265,78 @@ var require_main_min = __commonJS({
|
|
|
2257
2265
|
}, [o, JSON.stringify(e)]), i = async (m, p) => {
|
|
2258
2266
|
if (m.ok) {
|
|
2259
2267
|
let h = await m.json().catch(() => null);
|
|
2260
|
-
if (
|
|
2268
|
+
if (Ou(h)) {
|
|
2261
2269
|
r({ status: "success", results: h.results });
|
|
2262
2270
|
return;
|
|
2263
2271
|
}
|
|
2264
2272
|
}
|
|
2265
2273
|
r({ status: "error" });
|
|
2266
2274
|
}, c = (m, p) => {
|
|
2267
|
-
|
|
2275
|
+
Pu(m) || r({ status: "error" });
|
|
2268
2276
|
}, l = t.status === "success" ? t.results : [];
|
|
2269
2277
|
return { status: t.status, results: l, search: n };
|
|
2270
2278
|
};
|
|
2271
|
-
var
|
|
2272
|
-
var
|
|
2273
|
-
var
|
|
2279
|
+
var Ou = (e) => R(e) && "results" in e && j(e.results) && e.results.every((t) => R(t) && "title" in t && "type" in t && "value" in t);
|
|
2280
|
+
var Pu = (e) => e instanceof DOMException && e.name === "AbortError";
|
|
2281
|
+
var Mu = (e, t, r) => {
|
|
2274
2282
|
let [a, o] = e.split("?"), n = new URLSearchParams(o);
|
|
2275
2283
|
return n.set(t, r), `${a}?${n.toString()}`;
|
|
2276
2284
|
};
|
|
2277
2285
|
var Ft = require("react/jsx-runtime");
|
|
2278
|
-
var
|
|
2279
|
-
function
|
|
2280
|
-
let [r, a] = (0, ma.useState)(""), { title: o, margin: n, url: i, method: c, param: l, emptyMessage: m } = e, { status: p, results: h, search: y } = mc({ url: i, method: c, param: l }), u =
|
|
2286
|
+
var ku = 400;
|
|
2287
|
+
function Eu({ component: e, onAction: t }) {
|
|
2288
|
+
let [r, a] = (0, ma.useState)(""), { title: o, margin: n, url: i, method: c, param: l, emptyMessage: m } = e, { status: p, results: h, search: y } = mc({ url: i, method: c, param: l }), u = re(), d = (0, ma.useMemo)(() => Ke(y, ku), [y]), f = () => {
|
|
2281
2289
|
u("Dynamic Flow - Search Started", {});
|
|
2282
2290
|
}, w = (g) => {
|
|
2283
2291
|
a(g), d(g);
|
|
2284
2292
|
}, S = ({ type: g, value: v }) => {
|
|
2285
2293
|
if (g === "action" && (u("Dynamic Flow - Search Result Selected", { type: "action", actionId: v.id || v.$id }), t(v)), g === "search") {
|
|
2286
2294
|
a(v.query);
|
|
2287
|
-
let { url: O, method: x, param: M, query:
|
|
2288
|
-
u("Dynamic Flow - Search Result Selected", { type: "search" }), y(
|
|
2295
|
+
let { url: O, method: x, param: M, query: E } = v;
|
|
2296
|
+
u("Dynamic Flow - Search Result Selected", { type: "search" }), y(E, { url: O, method: x, param: M });
|
|
2289
2297
|
}
|
|
2290
2298
|
}, F = () => {
|
|
2291
2299
|
a(r), y(r);
|
|
2292
2300
|
};
|
|
2293
|
-
return (0, Ft.jsxs)("div", { className:
|
|
2301
|
+
return (0, Ft.jsxs)("div", { className: V(n || "md"), children: [(0, Ft.jsx)(ac, { title: o, value: r, onChange: w, onFocus: f }), p === "loading" && (0, Ft.jsx)(yr, { component: { type: "loading-indicator", size: "sm" } }), p === "error" && (0, Ft.jsx)(sc, { onRetrySearch: F }), p === "success" && (0, Ft.jsx)(ic, { results: h, emptyMessage: m, onSelect: S })] });
|
|
2294
2302
|
}
|
|
2295
|
-
var Ro =
|
|
2303
|
+
var Ro = Eu;
|
|
2296
2304
|
var la = require("@transferwise/components");
|
|
2297
2305
|
var lc = require("react");
|
|
2298
|
-
var
|
|
2299
|
-
var
|
|
2306
|
+
var _t = require("react/jsx-runtime");
|
|
2307
|
+
var Iu = (e) => {
|
|
2300
2308
|
let [t, r] = (0, lc.useState)(false), { component: a, onAction: o } = e, { margin: n = "md" } = a;
|
|
2301
|
-
return (0,
|
|
2309
|
+
return (0, _t.jsxs)("div", { className: Ce({ margin: n }), children: [(0, _t.jsx)(la.Button, { priority: "tertiary", block: true, onClick: () => r(true), children: a.trigger.title }), (0, _t.jsx)(la.Modal, { scroll: "content", onClose: () => r(false), open: t, size: "lg", body: (0, _t.jsx)(ne, C(s({}, e), { components: a.content.components, onAction: o })) })] });
|
|
2302
2310
|
};
|
|
2303
|
-
var No =
|
|
2311
|
+
var No = Iu;
|
|
2304
2312
|
var ue = require("react/jsx-runtime");
|
|
2305
2313
|
var zo = (e) => I(e) || Y(e);
|
|
2306
|
-
var
|
|
2314
|
+
var Du = (e) => e.type === "boolean" && zo(e.default) ? false : e.default;
|
|
2307
2315
|
var uc = (e) => {
|
|
2308
2316
|
var ee, A, B;
|
|
2309
|
-
let t = (
|
|
2310
|
-
y(true), a(o(
|
|
2311
|
-
}, r = (
|
|
2312
|
-
l(
|
|
2313
|
-
let W = r(
|
|
2317
|
+
let t = (k) => {
|
|
2318
|
+
y(true), a(o(k), "user");
|
|
2319
|
+
}, r = (k) => _e(k, e.schema, e.required), a = (k, ie) => {
|
|
2320
|
+
l(k);
|
|
2321
|
+
let W = r(k);
|
|
2314
2322
|
F(W);
|
|
2315
|
-
let X =
|
|
2323
|
+
let X = k;
|
|
2316
2324
|
p(X), X !== m && e.onChange({ model: X, triggerSchema: e.schema, triggerModel: X, lastTriggerModel: m, type: ie });
|
|
2317
|
-
}, o = (
|
|
2325
|
+
}, o = (k) => $e(k, e.schema), n = () => d(true), i = () => {
|
|
2318
2326
|
d(false), w(true), e.onBlur && e.onBlur();
|
|
2319
|
-
}, [c, l] = (0, de.useState)((ee = e.model) != null ? ee : null), [m, p] = (0, de.useState)((A = e.model) != null ? A : null), [h, y] = (0, de.useState)(false), [u, d] = (0, de.useState)(false), [f, w] = (0, de.useState)(false), [S, F] = (0, de.useState)([]), g = (0, de.useMemo)(() => e.schema.$id ||
|
|
2320
|
-
let
|
|
2321
|
-
zo(c) && !zo(
|
|
2327
|
+
}, [c, l] = (0, de.useState)((ee = e.model) != null ? ee : null), [m, p] = (0, de.useState)((A = e.model) != null ? A : null), [h, y] = (0, de.useState)(false), [u, d] = (0, de.useState)(false), [f, w] = (0, de.useState)(false), [S, F] = (0, de.useState)([]), g = (0, de.useMemo)(() => e.schema.$id || Te(), [e.schema.$id]), v = () => {
|
|
2328
|
+
let k = Du(e.schema);
|
|
2329
|
+
zo(c) && !zo(k) && a(k, "init"), e.schema.const && a(e.schema.const, "init");
|
|
2322
2330
|
}, O = () => {
|
|
2323
2331
|
F(r(c));
|
|
2324
2332
|
}, x = e.schema.const, M = e.schema.hidden || x;
|
|
2325
2333
|
(0, de.useEffect)(O, [e.model, e.submitted]), (0, de.useEffect)(v, [e.schema]), (0, de.useEffect)(() => {
|
|
2326
2334
|
var ie;
|
|
2327
|
-
let
|
|
2328
|
-
|
|
2335
|
+
let k = (ie = e.model) != null ? ie : null;
|
|
2336
|
+
k !== c && l(k);
|
|
2329
2337
|
}, [e.model]);
|
|
2330
|
-
let
|
|
2331
|
-
return M ? null : (0, ue.jsxs)(ue.Fragment, { children: [e.schema.alert && (0, ue.jsx)(se, { component: e.schema.alert }), (0, ue.jsxs)("div", { className: (0, dc.default)(
|
|
2338
|
+
let E = { "form-group": true, "has-error": (e.submitted || !h) && !!e.errors || (e.submitted || h && f) && !!S.length, "has-info": !!e.schema.description || !!e.infoMessage }, P = e.schema.format !== "file" && e.schema.type !== "boolean", D = e.schema.help, U = `${g}-feedback`;
|
|
2339
|
+
return M ? null : (0, ue.jsxs)(ue.Fragment, { children: [e.schema.alert && (0, ue.jsx)(se, { component: e.schema.alert }), (0, ue.jsxs)("div", { className: (0, dc.default)(E), children: [P && (0, ue.jsxs)("div", { className: "d-inline-block m-b-1", children: [(0, ue.jsx)("label", { className: "control-label d-inline", htmlFor: g, children: e.schema.title }), !!D && (0, ue.jsx)(qe, { help: D })] }), !P && !!D && (0, ue.jsx)(qe, { help: D }), (0, ue.jsx)(lr, { id: g, schema: e.schema, value: c, disabled: !!e.disabled, onChange: t, onFocus: n, onBlur: i, describedBy: U }), (0, ue.jsx)(He, { id: U, changed: h, focused: u, blurred: f, submitted: e.submitted, errors: (B = e.errors) != null ? B : null, schema: e.schema, validations: S, infoMessage: e.infoMessage })] })] });
|
|
2332
2340
|
};
|
|
2333
2341
|
uc.defaultProps = { required: false, disabled: false, onBlur: null };
|
|
2334
2342
|
var Ct = uc;
|
|
@@ -2338,29 +2346,29 @@ var require_main_min = __commonJS({
|
|
|
2338
2346
|
var r;
|
|
2339
2347
|
return (r = t.validation) == null ? void 0 : r[e];
|
|
2340
2348
|
};
|
|
2341
|
-
var
|
|
2349
|
+
var Lu = /* @__PURE__ */ new Set([N.RADIO, N.SELECT, N.DATELOOKUP, N.FILE, N.UPLOAD]);
|
|
2342
2350
|
function fc(e) {
|
|
2343
|
-
let { schema: t, required: r, submitted: a, errors: o, onChange: n, onPersistAsync: i } = e, c = (0, pc.useIntl)(), l = ae(), m =
|
|
2351
|
+
let { schema: t, required: r, submitted: a, errors: o, onChange: n, onPersistAsync: i } = e, c = (0, pc.useIntl)(), l = ae(), m = re(), [p, h] = (0, bt.useState)(null), y = gc(p), [u, d] = (0, bt.useState)(null), [f, w] = (0, bt.useState)(false), [S, F] = (0, bt.useState)(null);
|
|
2344
2352
|
(0, bt.useEffect)(() => {
|
|
2345
|
-
|
|
2353
|
+
Lu.has(lo(t.persistAsync.schema)) && x();
|
|
2346
2354
|
}, [p]);
|
|
2347
|
-
let g = () => d(c.formatMessage(
|
|
2348
|
-
let
|
|
2355
|
+
let g = () => d(c.formatMessage(nr.genericError)), v = async (P, D) => {
|
|
2356
|
+
let U = O(), ee = { [D.param]: P };
|
|
2349
2357
|
w(true);
|
|
2350
2358
|
try {
|
|
2351
2359
|
m("Dynamic Flow - PersistAsync", { status: "pending", schemaId: t.$id });
|
|
2352
|
-
let A = l(D.url, { method: D.method, headers: { "Content-Type": "application/json" }, body: JSON.stringify(ee), signal:
|
|
2360
|
+
let A = l(D.url, { method: D.method, headers: { "Content-Type": "application/json" }, body: JSON.stringify(ee), signal: U });
|
|
2353
2361
|
i(A);
|
|
2354
|
-
let B = await A,
|
|
2355
|
-
if (!R(
|
|
2362
|
+
let B = await A, k = await B.json();
|
|
2363
|
+
if (!R(k))
|
|
2356
2364
|
throw new Error("Response is not an object");
|
|
2357
2365
|
let { idProperty: ie, param: W } = t.persistAsync;
|
|
2358
2366
|
if (xn(B.status)) {
|
|
2359
|
-
let X = fo(ie,
|
|
2367
|
+
let X = fo(ie, k);
|
|
2360
2368
|
n({ model: X, triggerSchema: t, triggerModel: X });
|
|
2361
2369
|
} else if (Lr(B.status)) {
|
|
2362
|
-
let { validation: X } =
|
|
2363
|
-
d(
|
|
2370
|
+
let { validation: X } = k, ke = R(X) && (X == null ? void 0 : X[W]) || null;
|
|
2371
|
+
d(ke), n({ model: null, triggerSchema: t, triggerModel: null });
|
|
2364
2372
|
} else
|
|
2365
2373
|
g();
|
|
2366
2374
|
m("Dynamic Flow - PersistAsync", { status: "success", schemaId: t.$id });
|
|
@@ -2372,20 +2380,20 @@ var require_main_min = __commonJS({
|
|
|
2372
2380
|
let P = new AbortController();
|
|
2373
2381
|
return F(P), P.signal;
|
|
2374
2382
|
}, x = () => {
|
|
2375
|
-
!I(p) && !
|
|
2383
|
+
!I(p) && !Je(p, y) && v(p, t.persistAsync);
|
|
2376
2384
|
}, M = () => {
|
|
2377
2385
|
x();
|
|
2378
|
-
},
|
|
2386
|
+
}, E = ({ model: P }) => {
|
|
2379
2387
|
d(null), G(P, t.persistAsync.schema) && h(P);
|
|
2380
2388
|
};
|
|
2381
|
-
return (0, hc.jsx)(Ct, { required: r, submitted: a || f, schema: t.persistAsync.schema, errors: u || o, model: null, infoMessage: null, onChange:
|
|
2389
|
+
return (0, hc.jsx)(Ct, { required: r, submitted: a || f, schema: t.persistAsync.schema, errors: u || o, model: null, infoMessage: null, onChange: E, onBlur: M });
|
|
2382
2390
|
}
|
|
2383
2391
|
fc.defaultProps = { required: false };
|
|
2384
2392
|
var po = fc;
|
|
2385
2393
|
var qi = (e) => {
|
|
2386
2394
|
let [t, r] = (0, wc.useState)(null), a = ae(), o = (0, Cc.useIntl)(), { schema: n } = e;
|
|
2387
2395
|
async function i(y) {
|
|
2388
|
-
let u = y instanceof Blob ? !
|
|
2396
|
+
let u = y instanceof Blob ? !Dt(n) : !G(y, n);
|
|
2389
2397
|
return (I(y) || u) && h(), await m(y);
|
|
2390
2398
|
}
|
|
2391
2399
|
let c = () => {
|
|
@@ -2394,7 +2402,7 @@ var require_main_min = __commonJS({
|
|
|
2394
2402
|
return r(y), y.signal;
|
|
2395
2403
|
};
|
|
2396
2404
|
function l(y) {
|
|
2397
|
-
let u =
|
|
2405
|
+
let u = Dt(n), d = c(), f = e.param, w = u ? Tu(f, y) : JSON.stringify({ [f]: y });
|
|
2398
2406
|
return { method: e.method, headers: s({}, !u && { "Content-Type": "application/json" }), body: w, signal: d };
|
|
2399
2407
|
}
|
|
2400
2408
|
async function m(y) {
|
|
@@ -2422,36 +2430,36 @@ var require_main_min = __commonJS({
|
|
|
2422
2430
|
throw new Error(d);
|
|
2423
2431
|
}
|
|
2424
2432
|
}
|
|
2425
|
-
throw new Error(o.formatMessage(
|
|
2433
|
+
throw new Error(o.formatMessage(nr.genericError));
|
|
2426
2434
|
}
|
|
2427
2435
|
let h = (y) => {
|
|
2428
|
-
let u =
|
|
2436
|
+
let u = Ru(y) ? y.message : o.formatMessage(nr.genericError);
|
|
2429
2437
|
throw new Error(u);
|
|
2430
2438
|
};
|
|
2431
2439
|
return i;
|
|
2432
2440
|
};
|
|
2433
|
-
function
|
|
2441
|
+
function Tu(e, t) {
|
|
2434
2442
|
let r = new FormData();
|
|
2435
2443
|
return t !== null && r.append(e, t), r;
|
|
2436
2444
|
}
|
|
2437
|
-
function
|
|
2445
|
+
function Ru(e) {
|
|
2438
2446
|
return R(e) && "message" in e && typeof e.message == "string";
|
|
2439
2447
|
}
|
|
2440
|
-
var
|
|
2448
|
+
var rt = require("react");
|
|
2441
2449
|
function Vr({ asyncFn: e, interval: t, maxAttempts: r, maxConsecutiveFails: a, onPollingResponse: o, onFailure: n }) {
|
|
2442
|
-
let i = (0,
|
|
2443
|
-
(0,
|
|
2450
|
+
let i = (0, rt.useRef)(o), c = (0, rt.useRef)(n), l = (0, rt.useMemo)(() => Nu(e, r, a, (m) => i.current(m), () => c.current()), [e, r, a]);
|
|
2451
|
+
(0, rt.useEffect)(() => {
|
|
2444
2452
|
if (t > 0) {
|
|
2445
2453
|
let m = setInterval(() => {
|
|
2446
2454
|
l();
|
|
2447
2455
|
}, t);
|
|
2448
2456
|
return () => clearInterval(m);
|
|
2449
2457
|
}
|
|
2450
|
-
}, [l, t]), (0,
|
|
2458
|
+
}, [l, t]), (0, rt.useEffect)(() => {
|
|
2451
2459
|
i.current = o, c.current = n;
|
|
2452
2460
|
}, [o, n]);
|
|
2453
2461
|
}
|
|
2454
|
-
function
|
|
2462
|
+
function Nu(e, t, r, a, o) {
|
|
2455
2463
|
let n = true, i = 0, c = 0;
|
|
2456
2464
|
return e ? () => {
|
|
2457
2465
|
n && (c++, e().then((l) => {
|
|
@@ -2471,9 +2479,9 @@ var require_main_min = __commonJS({
|
|
|
2471
2479
|
t.current = e;
|
|
2472
2480
|
}, [e]), t.current;
|
|
2473
2481
|
};
|
|
2474
|
-
var
|
|
2482
|
+
var fr = require("react");
|
|
2475
2483
|
function Sc(e, t) {
|
|
2476
|
-
let r = ae(), a = (0,
|
|
2484
|
+
let r = ae(), a = (0, fr.useMemo)(() => {
|
|
2477
2485
|
if (e)
|
|
2478
2486
|
return () => r(e.url).then((n) => {
|
|
2479
2487
|
if (n.ok)
|
|
@@ -2482,58 +2490,58 @@ var require_main_min = __commonJS({
|
|
|
2482
2490
|
}).catch((n) => {
|
|
2483
2491
|
throw new Error(n.message === "failed" ? "failed" : "network failed");
|
|
2484
2492
|
});
|
|
2485
|
-
}, [e, r]), o = (0,
|
|
2486
|
-
Vr({ asyncFn: a, interval: 1e3 * ((e == null ? void 0 : e.interval) || 0), maxAttempts: (e == null ? void 0 : e.maxAttempts) || 0, maxConsecutiveFails: 1, onPollingResponse: o, onFailure: (0,
|
|
2493
|
+
}, [e, r]), o = (0, fr.useCallback)((n) => n != null && n.action ? (t(n.action), false) : true, [t]);
|
|
2494
|
+
Vr({ asyncFn: a, interval: 1e3 * ((e == null ? void 0 : e.interval) || 0), maxAttempts: (e == null ? void 0 : e.maxAttempts) || 0, maxConsecutiveFails: 1, onPollingResponse: o, onFailure: (0, fr.useCallback)(() => {
|
|
2487
2495
|
e && t(e.onError.action);
|
|
2488
2496
|
}, [t, e]) });
|
|
2489
2497
|
}
|
|
2490
2498
|
var Fc = require("react/jsx-runtime");
|
|
2491
|
-
var
|
|
2499
|
+
var Bu = (e, t) => {
|
|
2492
2500
|
var a;
|
|
2493
|
-
if (
|
|
2501
|
+
if (kt(e))
|
|
2494
2502
|
return [];
|
|
2495
|
-
let r =
|
|
2503
|
+
let r = Qt(e, t);
|
|
2496
2504
|
return ze({ layout: r, schemas: e.schemas || [], actions: e.actions || [], model: (a = e.model) != null ? a : null });
|
|
2497
2505
|
};
|
|
2498
|
-
var
|
|
2499
|
-
let { stepSpecification: t, stepLayoutOptions: r, submitted: a, model: o, formErrors: n, onModelChange: i } = e, c =
|
|
2506
|
+
var zu = (e) => {
|
|
2507
|
+
let { stepSpecification: t, stepLayoutOptions: r, submitted: a, model: o, formErrors: n, onModelChange: i } = e, c = Bu(t, r), { loading: l, registerPersistAsyncPromise: m } = At(), p = re(), h = l ? () => {
|
|
2500
2508
|
p("Dynamic Flow - onAction supressed", { reason: "LayoutStep - loading state" });
|
|
2501
2509
|
} : e.onAction;
|
|
2502
2510
|
return Sc(t.polling, h), (0, Fc.jsx)(ne, { components: c, submitted: a, model: o, errors: n, onAction: h, onModelChange: i, onPersistAsync: m });
|
|
2503
2511
|
};
|
|
2504
|
-
var ua =
|
|
2512
|
+
var ua = zu;
|
|
2505
2513
|
var ga = require("react");
|
|
2506
2514
|
var oe = require("react");
|
|
2507
2515
|
var qc = require("react-intl");
|
|
2508
|
-
var Gc =
|
|
2516
|
+
var Gc = Ee(bc());
|
|
2509
2517
|
var xc = require("react-intl");
|
|
2510
2518
|
var pe = (0, xc.defineMessages)({ reviewSubmit: { id: "dynamicFlows.CameraCapture.reviewSubmit", defaultMessage: "Yes, submit", description: "Accept and submit the image taken with the camera" }, reviewRetry: { id: "dynamicFlows.CameraCapture.reviewRetry", defaultMessage: "No, try again", description: "Image taken with camera is not good, don't submit, and retake the image" }, reviewInstructions: { id: "dynamicFlows.CameraCapture.reviewInstructions", defaultMessage: "Is your picture clear, readable and complete?", description: "After taking an image with the camera, prompt user to review the image" }, cameraNotSupportedTitle: { id: "dynamicFlows.CameraCapture.CameraNotSupported.title", defaultMessage: "Camera not supported", description: "Title of standalone page prompting that camera is not available on users browser" }, cameraNotSupportedParagraph: { id: "dynamicFlows.CameraCapture.CameraNotSupported.paragraph", defaultMessage: "The browser you're using doesn't have support for a camera. Try a different browser, device, or download our mobile app.", description: "Further text of standalone page prompting that camera is not available on user's browser" }, noCameraAccessTitle: { id: "dynamicFlows.CameraCapture.NoCameraAccess.title", defaultMessage: "We can't access your camera", description: "Title of standalone page prompting missing camera permissions" }, noCameraAccessParagraph: { id: "dynamicFlows.CameraCapture.NoCameraAccess.paragraph", defaultMessage: "Enable camera access in your browser's settings to get going again.", description: "Further text of standalone page prompting missing camera permissions" }, noCameraAccessAction: { id: "dynamicFlows.CameraCapture.NoCameraAccess.action", defaultMessage: "Enable camera access", description: "Action to ask for camera permissions again" }, cameraConnectionIssueTitle: { id: "dynamicFlows.CameraCapture.CameraConnectionIssue.title", defaultMessage: "We can't access your camera", description: "Title of standalone page prompting that there was an issue connecting to a camera" }, cameraConnectionIssueParagraph: { id: "dynamicFlows.CameraCapture.CameraConnectionIssue.paragraph", defaultMessage: "Please check if it is connected and try again.", description: "Further text of standalone page prompting that there was an issue connecting to a camera" }, cameraConnectionIssueAction: { id: "dynamicFlows.CameraCapture.CameraConnectionIssue.action", defaultMessage: "Try again", description: "Action to try using camera again" } });
|
|
2511
2519
|
var Oe = require("@transferwise/components");
|
|
2512
2520
|
var vc = require("react-intl");
|
|
2513
2521
|
var Ae = require("react/jsx-runtime");
|
|
2514
|
-
var Vo = ({ onCapture: e }) => (0, Ae.jsx)("div", { className: "bottom-bar", children: (0, Ae.jsx)(
|
|
2522
|
+
var Vo = ({ onCapture: e }) => (0, Ae.jsx)("div", { className: "bottom-bar", children: (0, Ae.jsx)(ju, { onClick: e }) });
|
|
2515
2523
|
var Uo = ({ onSubmit: e, onRetry: t }) => {
|
|
2516
2524
|
let r = (0, vc.useIntl)();
|
|
2517
2525
|
return (0, Ae.jsx)("div", { className: "bottom-bar p-x-2", children: (0, Ae.jsx)("div", { className: "row", children: (0, Ae.jsxs)("div", { className: "col-xs-12 col-md-6 col-md-offset-3", children: [(0, Ae.jsx)(Oe.Button, { className: "m-b-1", block: true, size: Oe.Size.MEDIUM, type: Oe.ControlType.ACCENT, onClick: e, children: r.formatMessage(pe.reviewSubmit) }), (0, Ae.jsx)(Oe.Button, { className: "m-b-2", block: true, size: Oe.Size.MEDIUM, type: Oe.ControlType.ACCENT, priority: Oe.Priority.SECONDARY, onClick: t, children: r.formatMessage(pe.reviewRetry) })] }) }) });
|
|
2518
2526
|
};
|
|
2519
|
-
var
|
|
2527
|
+
var ju = ({ onClick: e }) => (0, Ae.jsx)("button", { type: "button", className: "camera-capture-btn m-b-2", "data-testid": "camera-capture-button", onClick: e, children: (0, Ae.jsx)("span", { className: "camera-capture-btn-inner" }) });
|
|
2520
2528
|
var Pc = require("react-intl");
|
|
2521
2529
|
var Ac = require("react-intl");
|
|
2522
2530
|
var Oc = (0, Ac.defineMessages)({ text: { id: "dynamicFlows.CameraCapture.rotatePhone.text", defaultMessage: "Rotate your phone to portrait view to take a photo", description: "Prompt the user to rotate their phone from landscape to portrait mode when attempting to take a photo" } });
|
|
2523
|
-
var
|
|
2524
|
-
function
|
|
2531
|
+
var gr = require("react/jsx-runtime");
|
|
2532
|
+
function Vu() {
|
|
2525
2533
|
let e = (0, Pc.useIntl)();
|
|
2526
|
-
return (0,
|
|
2534
|
+
return (0, gr.jsxs)("div", { className: "orientation-lock-overlay", children: [(0, gr.jsx)("img", { className: "m-b-3", src: "https://wise.com/public-resources/assets/camera-guidelines/icon-rotate-phone.svg", width: "96", height: "96", alt: "" }), (0, gr.jsx)("p", { className: "text-center m-b-0", children: e.formatMessage(Oc.text) })] });
|
|
2527
2535
|
}
|
|
2528
|
-
var Ho =
|
|
2536
|
+
var Ho = Vu;
|
|
2529
2537
|
var Mc = require("@transferwise/components");
|
|
2530
|
-
var
|
|
2531
|
-
function
|
|
2532
|
-
return (0,
|
|
2538
|
+
var at = require("react/jsx-runtime");
|
|
2539
|
+
function Uu({ title: e, description: t, actionButton: r, onAction: a }) {
|
|
2540
|
+
return (0, at.jsx)("div", { className: "container p-t-5", children: (0, at.jsx)("div", { className: "row", children: (0, at.jsxs)("div", { className: "col-md-6 col-md-offset-3", children: [(0, at.jsx)("h2", { className: "text-xs-center m-b-3", children: e }), (0, at.jsx)("p", { className: "text-xs-center m-b-5", children: t }), a && r && (0, at.jsx)(Mc.Button, { block: true, onClick: a, children: r })] }) }) });
|
|
2533
2541
|
}
|
|
2534
|
-
var qo =
|
|
2535
|
-
var
|
|
2536
|
-
var
|
|
2542
|
+
var qo = Uu;
|
|
2543
|
+
var ot = require("react");
|
|
2544
|
+
var Kt = Ee(kc());
|
|
2537
2545
|
var Ec = (e) => {
|
|
2538
2546
|
var r;
|
|
2539
2547
|
let { facingMode: t } = ((r = pa(e)) == null ? void 0 : r.getSettings()) || {};
|
|
@@ -2572,10 +2580,10 @@ var require_main_min = __commonJS({
|
|
|
2572
2580
|
var t, r;
|
|
2573
2581
|
return (r = (t = pa(e)) == null ? void 0 : t.getCapabilities) == null ? void 0 : r.call(t);
|
|
2574
2582
|
};
|
|
2575
|
-
var ya = (e, t, r) => t == null ? void 0 : t(e, { Error:
|
|
2576
|
-
var
|
|
2577
|
-
var Nc = async (e, t, r) => e == null ? void 0 : e("Dynamic Flow - Camera Feed Started", await
|
|
2578
|
-
var
|
|
2583
|
+
var ya = (e, t, r) => t == null ? void 0 : t(e, { Error: Hu(r) });
|
|
2584
|
+
var Hu = (e) => e instanceof DOMException ? JSON.stringify({ name: e == null ? void 0 : e.name, message: e == null ? void 0 : e.message }) : e;
|
|
2585
|
+
var Nc = async (e, t, r) => e == null ? void 0 : e("Dynamic Flow - Camera Feed Started", await qu(t, r));
|
|
2586
|
+
var qu = async (e, t) => {
|
|
2579
2587
|
var n;
|
|
2580
2588
|
let r = pa(t), a = Go(t), o = (n = r == null ? void 0 : r.getSettings) == null ? void 0 : n.call(r);
|
|
2581
2589
|
return C(s({}, r && { "Available Video Devices (by label)": await Tc(), "Active Video Device (by label)": await Rc(t), "Camera Capabilities": a, "Camera Settings": o }), { "Camera Direction (Asked)": e == null ? void 0 : e.direction });
|
|
@@ -2587,24 +2595,24 @@ var require_main_min = __commonJS({
|
|
|
2587
2595
|
e == null || e("Dynamic Flow - Camera Orientation Locked", {});
|
|
2588
2596
|
};
|
|
2589
2597
|
var jc = (e, t) => {
|
|
2590
|
-
let r = (0,
|
|
2598
|
+
let r = (0, ot.useCallback)(() => {
|
|
2591
2599
|
window.screen.orientation && "lock" in window.screen.orientation && typeof window.screen.orientation.lock == "function" && window.screen.orientation.lock("portrait").then(() => zc(t)).catch(Wo);
|
|
2592
|
-
}, [t]), a = (0,
|
|
2600
|
+
}, [t]), a = (0, ot.useCallback)(() => {
|
|
2593
2601
|
var c, l, m;
|
|
2594
2602
|
return (m = (l = (c = window == null ? void 0 : window.screen) == null ? void 0 : c.orientation) == null ? void 0 : l.unlock) == null ? void 0 : m.call(l);
|
|
2595
|
-
}, []), o = (0,
|
|
2603
|
+
}, []), o = (0, ot.useCallback)(() => {
|
|
2596
2604
|
setTimeout(() => {
|
|
2597
|
-
e && !
|
|
2605
|
+
e && !Kt.default.isFullscreen && Kt.default.isEnabled && Kt.default.request(document.documentElement, { navigationUI: "show" }).then(() => {
|
|
2598
2606
|
r();
|
|
2599
2607
|
}).catch(Wo);
|
|
2600
2608
|
}, 100);
|
|
2601
|
-
}, [e, r]), n = (0,
|
|
2602
|
-
|
|
2603
|
-
}, [a]), i = (0,
|
|
2609
|
+
}, [e, r]), n = (0, ot.useCallback)(() => {
|
|
2610
|
+
Kt.default.isFullscreen && Kt.default.exit().catch(Wo), a();
|
|
2611
|
+
}, [a]), i = (0, ot.useCallback)((c) => {
|
|
2604
2612
|
var l, m;
|
|
2605
2613
|
(l = c == null ? void 0 : c.target) != null && l.type.includes("landscape") && (m = window.screen) != null && m.orientation && Bc(t);
|
|
2606
2614
|
}, [t]);
|
|
2607
|
-
return (0,
|
|
2615
|
+
return (0, ot.useEffect)(() => {
|
|
2608
2616
|
var c, l;
|
|
2609
2617
|
return e && ((l = (c = window.screen) == null ? void 0 : c.orientation) == null || l.addEventListener("change", (m) => i(m))), () => {
|
|
2610
2618
|
var m, p;
|
|
@@ -2632,17 +2640,17 @@ var require_main_min = __commonJS({
|
|
|
2632
2640
|
};
|
|
2633
2641
|
var ha = require("react");
|
|
2634
2642
|
var J = require("react/jsx-runtime");
|
|
2635
|
-
var
|
|
2643
|
+
var Gu = 92;
|
|
2636
2644
|
var Uc = 120;
|
|
2637
|
-
var
|
|
2638
|
-
var
|
|
2639
|
-
var
|
|
2640
|
-
var
|
|
2645
|
+
var Wu = 40;
|
|
2646
|
+
var $u = 32;
|
|
2647
|
+
var _u = 48;
|
|
2648
|
+
var Ku = 40;
|
|
2641
2649
|
var Hc = 800;
|
|
2642
|
-
function
|
|
2650
|
+
function Ju({ overlay: e, outline: t, imageUrl: r, title: a, instructions: o, reviewInstructions: n }) {
|
|
2643
2651
|
let i = (0, ha.useRef)(null);
|
|
2644
2652
|
(0, ha.useEffect)(() => {
|
|
2645
|
-
let y =
|
|
2653
|
+
let y = Ke(() => {
|
|
2646
2654
|
var u;
|
|
2647
2655
|
if ((u = i.current) != null && u.innerHTML) {
|
|
2648
2656
|
let d = i.current;
|
|
@@ -2651,47 +2659,47 @@ var require_main_min = __commonJS({
|
|
|
2651
2659
|
}, 100);
|
|
2652
2660
|
return window.addEventListener("resize", y), () => window.removeEventListener("resize", y);
|
|
2653
2661
|
});
|
|
2654
|
-
let c = (r ?
|
|
2662
|
+
let c = (r ? Wu : 0) + (a ? $u : 0) + (o ? _u : 0), l = (0, J.jsxs)(J.Fragment, { children: [r && (0, J.jsx)("img", { className: "camera-capture-img", src: r, alt: "" }), a && (0, J.jsx)("h4", { className: "camera-capture-title", children: a }), o && (0, J.jsx)("small", { className: "camera-capture-instructions", children: o })] }), m = Gu + c;
|
|
2655
2663
|
if (n) {
|
|
2656
2664
|
c = m - Uc, l = (0, J.jsx)("small", { className: "camera-capture-instructions", children: n });
|
|
2657
|
-
let y = Uc +
|
|
2665
|
+
let y = Uc + Ku;
|
|
2658
2666
|
m < y && (l = (0, J.jsx)(J.Fragment, {}));
|
|
2659
2667
|
}
|
|
2660
2668
|
let p = { x: "50%", y: "5%", width: `min(90%, ${Hc}px)`, height: `calc(90% - ${m}px)`, style: { transform: `translateX(max(-45%, -${Hc / 2}px))` } }, h = { style: { left: "5%", top: `calc(100% - ${m}px - 5%)`, height: `calc(${c}px + 5%)`, width: "90%" } };
|
|
2661
2669
|
return (0, J.jsxs)("svg", { ref: i, xmlns: "http://www.w3.org/2000/svg", children: [(0, J.jsx)("defs", { children: (0, J.jsxs)("mask", { id: "mask", children: [(0, J.jsx)("rect", { width: "100%", height: "100%", fill: "#fff" }), (0, J.jsx)("image", s({ href: e }, p))] }) }), e && (0, J.jsx)("rect", { width: "100%", height: "100%", mask: "url(#mask)", fillOpacity: "0.72" }), t && (0, J.jsx)("image", s({ href: t }, p)), (0, J.jsx)("foreignObject", { width: "100%", height: "100%", children: (0, J.jsx)("div", C(s({ className: "camera-capture-text-and-image-container" }, h), { children: l })) })] });
|
|
2662
2670
|
}
|
|
2663
|
-
var $o =
|
|
2671
|
+
var $o = Ju;
|
|
2664
2672
|
var ye = require("react/jsx-runtime");
|
|
2665
|
-
function
|
|
2666
|
-
let [m, p] = (0, oe.useState)("CAPTURE"), [h, y] = (0, oe.useState)(), [u, d] = (0, oe.useState)(false), [f, w] = (0, oe.useState)(false), [S, F] = (0, oe.useState)(), g = (0, oe.useRef)(null), { videoConstraints: v } = Vc(e), O = (0, oe.useMemo)(() => !!(Yn() && m === "CAPTURE"), [m]), { enterFullScreen: x, exitFullScreen: M } = jc(O, l),
|
|
2667
|
-
var W, X,
|
|
2668
|
-
if ((W = g == null ? void 0 : g.current) != null && W.video && ((
|
|
2669
|
-
(
|
|
2670
|
-
let
|
|
2671
|
-
|
|
2672
|
-
if (
|
|
2673
|
+
function Xu({ direction: e = "back", overlay: t = "", outline: r = "", imageUrl: a = "", title: o = "", instructions: n = "", showReview: i = false, onCapture: c, onEvent: l }) {
|
|
2674
|
+
let [m, p] = (0, oe.useState)("CAPTURE"), [h, y] = (0, oe.useState)(), [u, d] = (0, oe.useState)(false), [f, w] = (0, oe.useState)(false), [S, F] = (0, oe.useState)(), g = (0, oe.useRef)(null), { videoConstraints: v } = Vc(e), O = (0, oe.useMemo)(() => !!(Yn() && m === "CAPTURE"), [m]), { enterFullScreen: x, exitFullScreen: M } = jc(O, l), E = (0, qc.useIntl)(), P = (0, oe.useCallback)(async () => {
|
|
2675
|
+
var W, X, ke, nt, br, xr;
|
|
2676
|
+
if ((W = g == null ? void 0 : g.current) != null && W.video && ((ke = (X = g == null ? void 0 : g.current) == null ? void 0 : X.video) == null ? void 0 : ke.readyState) >= 3) {
|
|
2677
|
+
(br = (nt = g == null ? void 0 : g.current) == null ? void 0 : nt.video) == null || br.pause();
|
|
2678
|
+
let it = await Dc((xr = g == null ? void 0 : g.current) == null ? void 0 : xr.video);
|
|
2679
|
+
it == null || it.toBlob((xt) => {
|
|
2680
|
+
if (xt)
|
|
2673
2681
|
if (i) {
|
|
2674
|
-
let va = window.URL.createObjectURL(
|
|
2675
|
-
F({ source: va, blob:
|
|
2682
|
+
let va = window.URL.createObjectURL(xt);
|
|
2683
|
+
F({ source: va, blob: xt }), p("REVIEW");
|
|
2676
2684
|
} else
|
|
2677
|
-
c(
|
|
2685
|
+
c(xt);
|
|
2678
2686
|
}, "image/jpeg", 0.92);
|
|
2679
2687
|
}
|
|
2680
2688
|
}, [g, i, F, p, c, u]), D = (0, oe.useCallback)((W) => {
|
|
2681
2689
|
if (p("ERROR"), W instanceof DOMException)
|
|
2682
2690
|
switch (W == null ? void 0 : W.name) {
|
|
2683
2691
|
case "NotAllowedError":
|
|
2684
|
-
y({ title:
|
|
2692
|
+
y({ title: E.formatMessage(pe.noCameraAccessTitle), description: E.formatMessage(pe.noCameraAccessParagraph), actionButton: E.formatMessage(pe.noCameraAccessAction), onAction: B }), ya("Dynamic Flow - Camera Permission Denied", l, W);
|
|
2685
2693
|
return;
|
|
2686
2694
|
case "NotFoundError":
|
|
2687
2695
|
case "OverconstrainedError":
|
|
2688
2696
|
case "AbortError":
|
|
2689
2697
|
case "NotReadableError":
|
|
2690
|
-
y({ title:
|
|
2698
|
+
y({ title: E.formatMessage(pe.cameraConnectionIssueTitle), description: E.formatMessage(pe.cameraConnectionIssueParagraph), actionButton: E.formatMessage(pe.cameraConnectionIssueAction), onAction: B }), ya("Dynamic Flow - Camera Not Accessible", l, W);
|
|
2691
2699
|
return;
|
|
2692
2700
|
}
|
|
2693
|
-
y({ title:
|
|
2694
|
-
}, [
|
|
2701
|
+
y({ title: E.formatMessage(pe.cameraNotSupportedTitle), description: E.formatMessage(pe.cameraNotSupportedParagraph) }), ya("Dynamic Flow - Camera Not Supported", l, W);
|
|
2702
|
+
}, [E, l]), U = (0, oe.useCallback)((W) => {
|
|
2695
2703
|
x(), w(true), d(Ec(W)), Nc(l, { direction: e }, W);
|
|
2696
2704
|
}, [d, l, e, x]), ee = () => {
|
|
2697
2705
|
c((S == null ? void 0 : S.blob) || null);
|
|
@@ -2701,49 +2709,49 @@ var require_main_min = __commonJS({
|
|
|
2701
2709
|
(0, oe.useEffect)(() => {
|
|
2702
2710
|
m !== "CAPTURE" && M();
|
|
2703
2711
|
}, [m, M]);
|
|
2704
|
-
let
|
|
2712
|
+
let k = (0, ye.jsxs)("div", { className: "camera-capture", children: [v && (0, ye.jsx)(Gc.default, { ref: g, audio: false, videoConstraints: v, mirrored: u, onUserMediaError: D, onUserMedia: U }), (0, ye.jsx)($o, { overlay: t, outline: r, imageUrl: a, title: o, instructions: n }), O && (0, ye.jsx)(Ho, {}), f && (0, ye.jsx)(Vo, { onCapture: () => {
|
|
2705
2713
|
P();
|
|
2706
|
-
} })] }), ie = (0, ye.jsxs)("div", { className: "camera-capture", children: [(0, ye.jsx)("img", { className: "review-image", src: S == null ? void 0 : S.source, alt: "" }), (0, ye.jsx)($o, { overlay: t, imageUrl: a, title: o, instructions: n, reviewInstructions:
|
|
2707
|
-
return (0, ye.jsxs)("section", { children: [m === "CAPTURE" &&
|
|
2714
|
+
} })] }), ie = (0, ye.jsxs)("div", { className: "camera-capture", children: [(0, ye.jsx)("img", { className: "review-image", src: S == null ? void 0 : S.source, alt: "" }), (0, ye.jsx)($o, { overlay: t, imageUrl: a, title: o, instructions: n, reviewInstructions: E.formatMessage(pe.reviewInstructions) }), (0, ye.jsx)(Uo, { onSubmit: ee, onRetry: A })] });
|
|
2715
|
+
return (0, ye.jsxs)("section", { children: [m === "CAPTURE" && k, m === "REVIEW" && ie, m === "ERROR" && h && (0, ye.jsx)(qo, s({}, h))] });
|
|
2708
2716
|
}
|
|
2709
|
-
var _o =
|
|
2717
|
+
var _o = Xu;
|
|
2710
2718
|
var $c = require("react/jsx-runtime");
|
|
2711
|
-
function
|
|
2719
|
+
function Yu(e) {
|
|
2712
2720
|
return new Promise((t, r) => {
|
|
2713
2721
|
let a = new FileReader();
|
|
2714
2722
|
a.onloadend = () => t(a.result), a.readAsDataURL(e);
|
|
2715
2723
|
});
|
|
2716
2724
|
}
|
|
2717
|
-
function
|
|
2718
|
-
let { step: t, model: r, onModelChange: a, onAction: o } = e, n =
|
|
2725
|
+
function Zu(e) {
|
|
2726
|
+
let { step: t, model: r, onModelChange: a, onAction: o } = e, n = re(), i = Wc(t), c = Qu(t), l = ep(t), { title: m, image: p, cameraConfig: h } = c, { assets: y, direction: u, instructions: d } = h || {}, { overlay: f, outline: w } = y || {}, { url: S } = p || {}, [F, g] = (0, ga.useState)(false);
|
|
2719
2727
|
(0, ga.useEffect)(() => {
|
|
2720
2728
|
F && o(l);
|
|
2721
2729
|
}, [r]);
|
|
2722
2730
|
let v = async (O) => {
|
|
2723
2731
|
let { $id: x } = c;
|
|
2724
2732
|
if (O) {
|
|
2725
|
-
let M = await
|
|
2726
|
-
g(true), a({ model:
|
|
2733
|
+
let M = await Yu(O), E = { [x || ""]: M };
|
|
2734
|
+
g(true), a({ model: E, formSchema: i, triggerModel: M, triggerSchema: c });
|
|
2727
2735
|
}
|
|
2728
2736
|
};
|
|
2729
2737
|
return (0, $c.jsx)(_o, { overlay: f, outline: w, title: m, imageUrl: S, instructions: d, direction: u, onEvent: n, onCapture: (O) => {
|
|
2730
2738
|
v(O);
|
|
2731
2739
|
} });
|
|
2732
2740
|
}
|
|
2733
|
-
var wa =
|
|
2741
|
+
var wa = Zu;
|
|
2734
2742
|
function Wc(e) {
|
|
2735
2743
|
let r = zr(e.schemas || [])[0];
|
|
2736
|
-
if (!r || !
|
|
2744
|
+
if (!r || !Le(r))
|
|
2737
2745
|
throw new Error("The first schema in a camera step is expected to be of type object and have at least one property with a schema...");
|
|
2738
2746
|
return r;
|
|
2739
2747
|
}
|
|
2740
|
-
function
|
|
2748
|
+
function Qu(e) {
|
|
2741
2749
|
let t = Wc(e), r = Object.values(t.properties)[0];
|
|
2742
2750
|
if (!r)
|
|
2743
2751
|
throw new Error("The first schema in a camera step is expected to be of type object and have at least one property with a schema...");
|
|
2744
2752
|
return r;
|
|
2745
2753
|
}
|
|
2746
|
-
function
|
|
2754
|
+
function ep(e) {
|
|
2747
2755
|
var t, r;
|
|
2748
2756
|
if (!e.schemas || ((t = zr(e.schemas)) == null ? void 0 : t.length) !== 1)
|
|
2749
2757
|
throw new Error("camera step expects 1 non-hidden object schema");
|
|
@@ -2753,18 +2761,18 @@ var require_main_min = __commonJS({
|
|
|
2753
2761
|
}
|
|
2754
2762
|
var Jc = require("react-intl");
|
|
2755
2763
|
var _c = require("react-intl");
|
|
2756
|
-
var
|
|
2764
|
+
var Cr = (0, _c.defineMessages)({ title: { id: "dynamicFlows.ExternalConfirmation.title", defaultMessage: "Please confirm", description: "Heading for the confirmation screen." }, description: { id: "dynamicFlows.ExternalConfirmation.description", defaultMessage: "Please confirm you want to open **{origin}** in a new browser tab.", description: "Description for the confirmation screen." }, open: { id: "dynamicFlows.ExternalConfirmation.open", defaultMessage: "Open in new tab", description: "Button text confirming opening a new browser tab." }, cancel: { id: "dynamicFlows.ExternalConfirmation.cancel", defaultMessage: "Cancel", description: "Button text rejecting opening a new browser tab." } });
|
|
2757
2765
|
var Xc = require("react/jsx-runtime");
|
|
2758
2766
|
var Kc = () => {
|
|
2759
2767
|
};
|
|
2760
|
-
var
|
|
2768
|
+
var tp = ({ url: e, onClose: t }) => {
|
|
2761
2769
|
let { formatMessage: r } = (0, Jc.useIntl)();
|
|
2762
|
-
return (0, Xc.jsx)(ne, { components: [{ type: "box", width: "lg", components: [{ type: "heading", text: r(
|
|
2770
|
+
return (0, Xc.jsx)(ne, { components: [{ type: "box", width: "lg", components: [{ type: "heading", text: r(Cr.title), size: "lg", align: "center", margin: "xl" }, { type: "info", markdown: r(Cr.description, { origin: rp(e) }), align: "center", margin: "xl" }, { type: "box", width: "md", components: [{ type: "button", action: { title: r(Cr.open), type: "primary", url: e, exit: true } }, { type: "button", action: { title: r(Cr.cancel), type: "link", url: "", exit: true } }] }] }], submitted: false, onAction: (a) => {
|
|
2763
2771
|
a.url && window.open(a.url, "_blank"), t();
|
|
2764
2772
|
}, onModelChange: Kc, onPersistAsync: Kc });
|
|
2765
2773
|
};
|
|
2766
|
-
var Ca =
|
|
2767
|
-
function
|
|
2774
|
+
var Ca = tp;
|
|
2775
|
+
function rp(e) {
|
|
2768
2776
|
try {
|
|
2769
2777
|
return new URL(e).origin;
|
|
2770
2778
|
} catch (t) {
|
|
@@ -2773,13 +2781,13 @@ var require_main_min = __commonJS({
|
|
|
2773
2781
|
}
|
|
2774
2782
|
var Yc = require("@transferwise/components");
|
|
2775
2783
|
var Zc = require("@transferwise/icons");
|
|
2776
|
-
var
|
|
2777
|
-
function
|
|
2778
|
-
return (0,
|
|
2784
|
+
var Jt = require("react/jsx-runtime");
|
|
2785
|
+
function ap({ title: e, action: t, onAction: r }) {
|
|
2786
|
+
return (0, Jt.jsxs)("a", { href: "/", className: "df-back-btn", "aria-label": e, onClick: (a) => {
|
|
2779
2787
|
a.preventDefault(), r(C(s({}, t), { skipValidation: true }));
|
|
2780
|
-
}, children: [(0,
|
|
2788
|
+
}, children: [(0, Jt.jsx)("span", { className: "sr-only", children: e }), (0, Jt.jsx)(Yc.Avatar, { type: "icon", children: (0, Jt.jsx)(Zc.ArrowLeft, { size: "24" }) })] });
|
|
2781
2789
|
}
|
|
2782
|
-
var Qc =
|
|
2790
|
+
var Qc = ap;
|
|
2783
2791
|
var Pe = require("react/jsx-runtime");
|
|
2784
2792
|
function Kr(e) {
|
|
2785
2793
|
var l, m, p;
|
|
@@ -2787,24 +2795,24 @@ var require_main_min = __commonJS({
|
|
|
2787
2795
|
return t === void 0 ? r ? (0, Pe.jsx)(se, { component: { context: "negative", markdown: r, margin: "lg" } }) : null : o && i ? (0, Pe.jsx)(Ca, { url: o, onClose: c }) : Jn(t) ? (0, Pe.jsx)(wa, C(s({}, e), { step: t })) : (0, Pe.jsxs)(Pe.Fragment, { children: [n && (0, Pe.jsx)(Qc, C(s({}, n), { onAction: a })), r ? (0, Pe.jsx)(se, { component: { context: "negative", markdown: r, margin: "lg" } }) : null, (0, Pe.jsx)(ua, C(s({}, e), { stepSpecification: t }))] });
|
|
2788
2796
|
}
|
|
2789
2797
|
var em = require("react");
|
|
2790
|
-
var
|
|
2798
|
+
var op = 1e3;
|
|
2791
2799
|
function tm(e) {
|
|
2792
2800
|
let t = (0, em.useRef)(/* @__PURE__ */ new Map()), r = (a) => {
|
|
2793
2801
|
if (t.current.has(a))
|
|
2794
2802
|
return t.current.get(a);
|
|
2795
|
-
let o =
|
|
2803
|
+
let o = Ke((n, i, c) => e(n, i, c), op);
|
|
2796
2804
|
return t.current.set(a, o), o;
|
|
2797
2805
|
};
|
|
2798
2806
|
return function(a, o, n, i) {
|
|
2799
2807
|
let c = r(a);
|
|
2800
|
-
c(a, o, n), (!i || !
|
|
2808
|
+
c(a, o, n), (!i || !np(i)) && c.flush();
|
|
2801
2809
|
};
|
|
2802
2810
|
}
|
|
2803
|
-
var
|
|
2804
|
-
var
|
|
2811
|
+
var np = (e) => dt(e) === "basic" && e.type !== "boolean" && e.format !== "base64url";
|
|
2812
|
+
var Xt = require("react");
|
|
2805
2813
|
var om = (e) => {
|
|
2806
2814
|
var u, d;
|
|
2807
|
-
let [t, r] = (0,
|
|
2815
|
+
let [t, r] = (0, Xt.useState)((u = e == null ? void 0 : e.errors) == null ? void 0 : u.validation), [a, o] = (0, Xt.useState)((d = e == null ? void 0 : e.errors) == null ? void 0 : d.error), [n, i] = (0, Xt.useState)({ step: e || void 0, models: e != null && e.model ? rm(e.model, am(e)) : {}, etag: void 0 }), { step: c, models: l, etag: m } = n, p = (f, w) => {
|
|
2808
2816
|
var S, F, g, v;
|
|
2809
2817
|
i((O) => ({ step: f, models: f.model ? rm(f.model, am(f)) : O.models, etag: w })), r((F = (S = f == null ? void 0 : f.errors) == null ? void 0 : S.validation) != null ? F : null), o((v = (g = f == null ? void 0 : f.errors) == null ? void 0 : g.error) != null ? v : null);
|
|
2810
2818
|
}, h = (f, w, S) => {
|
|
@@ -2812,7 +2820,7 @@ var require_main_min = __commonJS({
|
|
|
2812
2820
|
let g = C(s({}, F.models), { [f]: w }), v = { step: F.step, models: g, etag: F.etag };
|
|
2813
2821
|
return S(g), v;
|
|
2814
2822
|
});
|
|
2815
|
-
}, y = (0,
|
|
2823
|
+
}, y = (0, Xt.useMemo)(() => sp(l, ip(c)), [l, c]);
|
|
2816
2824
|
return { formErrors: t, globalError: a, step: c, models: l, etag: m, modelIsValid: y, setFormErrors: r, setGlobalError: o, setStepAndEtag: p, setSchemaModel: h };
|
|
2817
2825
|
};
|
|
2818
2826
|
var rm = (e, t = []) => t.reduce((r, a) => (a.$id || console.warn("Schema without $id property found."), C(s({}, r), { [a.$id || ""]: ce(e, a) || {} })), {});
|
|
@@ -2829,7 +2837,7 @@ var require_main_min = __commonJS({
|
|
|
2829
2837
|
return [];
|
|
2830
2838
|
}
|
|
2831
2839
|
});
|
|
2832
|
-
var
|
|
2840
|
+
var ip = (e) => [...Ko((e == null ? void 0 : e.layout) || []).map((t) => ((e == null ? void 0 : e.schemas) || []).find((r) => r.$id === t)).filter(Boolean), ...Sa((e == null ? void 0 : e.layout) || [])];
|
|
2833
2841
|
var Ko = (e) => e.flatMap((t) => {
|
|
2834
2842
|
switch (t.type) {
|
|
2835
2843
|
case "columns":
|
|
@@ -2837,13 +2845,13 @@ var require_main_min = __commonJS({
|
|
|
2837
2845
|
case "box":
|
|
2838
2846
|
return Ko(t.components);
|
|
2839
2847
|
case "form":
|
|
2840
|
-
return [
|
|
2848
|
+
return [cp(t)];
|
|
2841
2849
|
default:
|
|
2842
2850
|
return [];
|
|
2843
2851
|
}
|
|
2844
2852
|
}).filter(Boolean);
|
|
2845
|
-
var
|
|
2846
|
-
var
|
|
2853
|
+
var sp = (e, t = []) => !(t != null && t.some((r) => (r.$id || console.warn("Schema without $id property found."), !G(e[r.$id || ""] || {}, r))));
|
|
2854
|
+
var cp = (e) => e.schema && !nm(e.schema) ? e.schema.$ref : e.schemaId;
|
|
2847
2855
|
var nm = (e) => e !== void 0 && typeof e == "object" && !Object.hasOwnProperty.call(e, "$ref");
|
|
2848
2856
|
var Fa = require("@transferwise/components");
|
|
2849
2857
|
var im = require("react");
|
|
@@ -2858,10 +2866,10 @@ var require_main_min = __commonJS({
|
|
|
2858
2866
|
var dm = require("react/jsx-runtime");
|
|
2859
2867
|
function lm({ onDismiss: e }) {
|
|
2860
2868
|
let { formatMessage: t } = (0, mm.useIntl)();
|
|
2861
|
-
return (0, dm.jsx)(ba.Alert, { action: { text: t(
|
|
2869
|
+
return (0, dm.jsx)(ba.Alert, { action: { text: t(Wt.retry), href: window.location.href }, message: t(Wt.errorAlert), type: ba.Sentiment.NEGATIVE, className: "m-b-3", onDismiss: e });
|
|
2862
2870
|
}
|
|
2863
|
-
var
|
|
2864
|
-
var
|
|
2871
|
+
var Yt = require("react/jsx-runtime");
|
|
2872
|
+
var mp = () => {
|
|
2865
2873
|
};
|
|
2866
2874
|
var Jo = class extends um.Component {
|
|
2867
2875
|
constructor(r) {
|
|
@@ -2875,12 +2883,12 @@ var require_main_min = __commonJS({
|
|
|
2875
2883
|
return { hasError: true, isFatalError: true };
|
|
2876
2884
|
}
|
|
2877
2885
|
componentDidCatch(r) {
|
|
2878
|
-
let { onError: a =
|
|
2886
|
+
let { onError: a = mp } = this.props;
|
|
2879
2887
|
a(r);
|
|
2880
2888
|
}
|
|
2881
2889
|
render() {
|
|
2882
2890
|
let { children: r } = this.props, { hasError: a, isFatalError: o } = this.state;
|
|
2883
|
-
return (0,
|
|
2891
|
+
return (0, Yt.jsxs)(Yt.Fragment, { children: [a && (0, Yt.jsx)(lm, { onDismiss: this.handleErrorReset }), !o && r] });
|
|
2884
2892
|
}
|
|
2885
2893
|
};
|
|
2886
2894
|
var Xo = Jo;
|
|
@@ -2897,14 +2905,14 @@ var require_main_min = __commonJS({
|
|
|
2897
2905
|
}
|
|
2898
2906
|
};
|
|
2899
2907
|
var ym = async (e) => {
|
|
2900
|
-
let t = await
|
|
2908
|
+
let t = await Sr(e);
|
|
2901
2909
|
if (!R(t))
|
|
2902
2910
|
throw new Error("Incorrect response body in response. Expected an object.");
|
|
2903
2911
|
let r = e.headers.get("etag") || void 0;
|
|
2904
2912
|
return { type: "step", step: t, etag: r };
|
|
2905
2913
|
};
|
|
2906
2914
|
var fm = async (e) => {
|
|
2907
|
-
let t = await
|
|
2915
|
+
let t = await Sr(e);
|
|
2908
2916
|
if (!R(t))
|
|
2909
2917
|
throw new Error("Incorrect response body in response. Expected an object.");
|
|
2910
2918
|
if (!R(t.action))
|
|
@@ -2925,12 +2933,12 @@ var require_main_min = __commonJS({
|
|
|
2925
2933
|
}
|
|
2926
2934
|
if ((o = e.headers) != null && o.has("X-Df-Exit"))
|
|
2927
2935
|
return hm(e);
|
|
2928
|
-
let t = await
|
|
2936
|
+
let t = await Sr(e.clone());
|
|
2929
2937
|
return R(t) && t.action ? fm(e) : ym(e);
|
|
2930
2938
|
};
|
|
2931
2939
|
var wm = async (e) => {
|
|
2932
2940
|
Zo(e);
|
|
2933
|
-
let t = await
|
|
2941
|
+
let t = await Sr(e);
|
|
2934
2942
|
if (!R(t))
|
|
2935
2943
|
throw new Error("Incorrect response body in error response. Expected an object.");
|
|
2936
2944
|
if (!t.refreshFormUrl && !t.refreshUrl && !t.validation && !t.error)
|
|
@@ -2939,10 +2947,10 @@ var require_main_min = __commonJS({
|
|
|
2939
2947
|
};
|
|
2940
2948
|
var Yo = async (e) => {
|
|
2941
2949
|
Zo(e);
|
|
2942
|
-
let t = await
|
|
2950
|
+
let t = await Sr(e);
|
|
2943
2951
|
return R(t) ? t : null;
|
|
2944
2952
|
};
|
|
2945
|
-
var
|
|
2953
|
+
var Sr = async (e) => {
|
|
2946
2954
|
try {
|
|
2947
2955
|
return await e.json();
|
|
2948
2956
|
} catch (t) {
|
|
@@ -2950,50 +2958,46 @@ var require_main_min = __commonJS({
|
|
|
2950
2958
|
}
|
|
2951
2959
|
};
|
|
2952
2960
|
var Zo = (e) => {
|
|
2953
|
-
if (!
|
|
2961
|
+
if (!lp(e))
|
|
2954
2962
|
throw new Error("Incorrect type of response from fetch. Expected object of type Response.");
|
|
2955
2963
|
if (e.bodyUsed)
|
|
2956
2964
|
throw new Error("The body of the provided Response object has already been used. Every request must respond with a new Response object.");
|
|
2957
2965
|
};
|
|
2958
|
-
var
|
|
2966
|
+
var lp = (e) => typeof e == "object" && e !== null && "clone" in e && "bodyUsed" in e;
|
|
2959
2967
|
var We = require("react/jsx-runtime");
|
|
2960
2968
|
var Cm = () => {
|
|
2961
2969
|
};
|
|
2962
|
-
var
|
|
2963
|
-
let { locale: h } = (0, Sm.useIntl)(), { formErrors: y, globalError: u, step: d, models: f, etag: w, modelIsValid: S, setFormErrors: F, setGlobalError: g, setStepAndEtag: v, setSchemaModel: O } = om(a), [x, M] = (0, Me.useState)(false), { isLoading:
|
|
2970
|
+
var dp = ({ flowId: e, httpClient: t, initialAction: r, initialStep: a, loaderConfig: o, displayStepTitle: n = true, features: i, onCompletion: c, onError: l, onEvent: m = Cm, onLog: p = Cm }) => {
|
|
2971
|
+
let { locale: h } = (0, Sm.useIntl)(), { formErrors: y, globalError: u, step: d, models: f, etag: w, modelIsValid: S, setFormErrors: F, setGlobalError: g, setStepAndEtag: v, setSchemaModel: O } = om(a), [x, M] = (0, Me.useState)(false), { isLoading: E, loader: P, setLoadingState: D } = sm(o, a ? "idle" : "initial"), U = mt("critical", p, e, (d == null ? void 0 : d.id) || (d == null ? void 0 : d.key)), ee = (0, Me.useMemo)(() => {
|
|
2964
2972
|
var b;
|
|
2965
2973
|
return s({ flowId: e, stepId: (d == null ? void 0 : d.id) || (d == null ? void 0 : d.key) }, (b = d == null ? void 0 : d.analytics) != null ? b : {});
|
|
2966
|
-
}, [e, d]), A = (0, Me.useMemo)(() => Ea(m, ee), [m, ee]), B = (0, Me.useCallback)(({ action: b, data:
|
|
2967
|
-
let { url:
|
|
2968
|
-
return t(
|
|
2969
|
-
}, [t, h]),
|
|
2974
|
+
}, [e, d]), A = (0, Me.useMemo)(() => Ea(m, ee), [m, ee]), B = (0, Me.useCallback)(({ action: b, data: q, etag: T }) => {
|
|
2975
|
+
let { url: te, method: st = "POST" } = b;
|
|
2976
|
+
return t(te != null ? te : "", { method: st, headers: s({ "accept-language": h, "Content-Type": "application/json" }, T ? { "If-None-Match": T } : {}), credentials: "include", body: st === "GET" ? void 0 : JSON.stringify(q) });
|
|
2977
|
+
}, [t, h]), k = async (b, q = {}) => {
|
|
2970
2978
|
D(d ? "submission" : "initial"), A("Dynamic Flow - Step Submitted", { actionId: b.id || b.$id });
|
|
2971
2979
|
try {
|
|
2972
|
-
let T = await B({ action: b, data:
|
|
2973
|
-
|
|
2980
|
+
let T = await B({ action: b, data: q });
|
|
2981
|
+
if (b.exit && T.ok) {
|
|
2982
|
+
await W(T, b.result);
|
|
2983
|
+
return;
|
|
2984
|
+
}
|
|
2985
|
+
await nt(T, "submission");
|
|
2974
2986
|
} catch (T) {
|
|
2975
|
-
|
|
2987
|
+
it(T, b.exit ? "Error fetching exit result" : "Error fetching next step");
|
|
2976
2988
|
}
|
|
2977
|
-
}, ie = async (b,
|
|
2989
|
+
}, ie = async (b, q, T) => {
|
|
2978
2990
|
D("refresh"), A("Dynamic Flow - Step Refreshed", { status: "pending" });
|
|
2979
2991
|
try {
|
|
2980
|
-
let
|
|
2981
|
-
await
|
|
2982
|
-
} catch (
|
|
2983
|
-
|
|
2984
|
-
}
|
|
2985
|
-
}, W = async (b, j) => {
|
|
2986
|
-
D("submission");
|
|
2987
|
-
try {
|
|
2988
|
-
let T = await B({ action: b, data: j });
|
|
2989
|
-
await X(T, b.result);
|
|
2990
|
-
} catch (T) {
|
|
2991
|
-
Be(T, "Error fetching exit result");
|
|
2992
|
+
let te = await B({ action: { url: b, method: "POST" }, data: q, etag: T });
|
|
2993
|
+
await nt(te, "refresh");
|
|
2994
|
+
} catch (te) {
|
|
2995
|
+
it(te, "Error fetching refresh step");
|
|
2992
2996
|
}
|
|
2993
|
-
},
|
|
2997
|
+
}, W = async (b, q) => {
|
|
2994
2998
|
let T = await Yo(b);
|
|
2995
|
-
|
|
2996
|
-
},
|
|
2999
|
+
ke(s(s({}, T), q));
|
|
3000
|
+
}, X = tm(ie), ke = (0, Me.useCallback)((b) => {
|
|
2997
3001
|
A("Dynamic Flow - Flow Finished", { result: "success" }), c(b);
|
|
2998
3002
|
}, [c, A]);
|
|
2999
3003
|
(0, Me.useEffect)(() => {
|
|
@@ -3001,73 +3005,73 @@ var require_main_min = __commonJS({
|
|
|
3001
3005
|
}, []), (0, Me.useEffect)(() => {
|
|
3002
3006
|
if (!a) {
|
|
3003
3007
|
let b = s({ id: "#initial-step-request", method: "GET" }, r);
|
|
3004
|
-
|
|
3008
|
+
k(b, b.data);
|
|
3005
3009
|
}
|
|
3006
3010
|
}, [t, h, JSON.stringify(a), JSON.stringify(r)]);
|
|
3007
|
-
let
|
|
3011
|
+
let nt = async (b, q) => {
|
|
3008
3012
|
try {
|
|
3009
3013
|
if (b.status === 304) {
|
|
3010
3014
|
D("idle");
|
|
3011
3015
|
return;
|
|
3012
3016
|
}
|
|
3013
3017
|
if (!b.ok) {
|
|
3014
|
-
let
|
|
3015
|
-
|
|
3018
|
+
let te = await wm(b);
|
|
3019
|
+
xr(te);
|
|
3016
3020
|
return;
|
|
3017
3021
|
}
|
|
3018
3022
|
let T = await gm(b);
|
|
3019
|
-
T.type === "action" ?
|
|
3023
|
+
T.type === "action" ? k(T.action, T.action.data) : T.type === "exit" ? ke(T.result) : br(T.step, T.etag, q);
|
|
3020
3024
|
} catch (T) {
|
|
3021
|
-
|
|
3025
|
+
it(T, "Error parsing fetch response", q, b.status);
|
|
3022
3026
|
}
|
|
3023
|
-
},
|
|
3024
|
-
v(b,
|
|
3025
|
-
},
|
|
3026
|
-
let
|
|
3027
|
-
|
|
3028
|
-
},
|
|
3029
|
-
|
|
3030
|
-
},
|
|
3031
|
-
let { model:
|
|
3032
|
-
g(null), $(
|
|
3033
|
-
|
|
3027
|
+
}, br = (b, q, T) => {
|
|
3028
|
+
v(b, q), D("idle"), T === "submission" ? (M(false), A("Dynamic Flow - Step Started", s({ stepId: b.id || b.key }, b == null ? void 0 : b.analytics))) : A("Dynamic Flow - Step Refreshed", { status: "success" });
|
|
3029
|
+
}, xr = async (b) => {
|
|
3030
|
+
let q = b.refreshUrl || b.refreshFormUrl;
|
|
3031
|
+
q && await ie(q, xa(f), w), b.validation && F(b.validation), b.error && g(b.error), D("idle");
|
|
3032
|
+
}, it = (b, q, T, te) => {
|
|
3033
|
+
U("Error fetching", q), T === "refresh" && A("Dynamic Flow - Step Refreshed", { status: "failure" }), A("Dynamic Flow - Flow Finished", { status: "failure" }), l(b, te), D("idle");
|
|
3034
|
+
}, xt = (b) => {
|
|
3035
|
+
let { model: q, formSchema: T } = b, { $id: te = "" } = T;
|
|
3036
|
+
g(null), $(q) || U("Invalid model on change", "onModelChange was called but the model argument is not an object"), O(te, q, (vr) => {
|
|
3037
|
+
va(b, vr);
|
|
3034
3038
|
});
|
|
3035
|
-
},
|
|
3039
|
+
}, va = (b, q) => {
|
|
3036
3040
|
let { triggerSchema: T } = b;
|
|
3037
|
-
if (
|
|
3038
|
-
let
|
|
3039
|
-
|
|
3041
|
+
if (yp(b)) {
|
|
3042
|
+
let te = T.refreshUrl || T.refreshFormUrl, st = (d == null ? void 0 : d.refreshUrl) || (d == null ? void 0 : d.refreshFormUrl), vr = te || st;
|
|
3043
|
+
vr && X(vr, xa(q), w, T);
|
|
3040
3044
|
}
|
|
3041
|
-
},
|
|
3042
|
-
if (
|
|
3045
|
+
}, zm = async (b) => {
|
|
3046
|
+
if (E || b.disabled)
|
|
3043
3047
|
return;
|
|
3044
3048
|
if (b.exit && !b.url) {
|
|
3045
|
-
|
|
3049
|
+
ke(b.result);
|
|
3046
3050
|
return;
|
|
3047
3051
|
}
|
|
3048
|
-
let
|
|
3049
|
-
|
|
3052
|
+
let { data: q, method: T, skipValidation: te } = b, st = s(s({}, xa(f)), q);
|
|
3053
|
+
pp(T) ? (F(null), te || M(true), (S || te) && await k(b, st)) : await k(b);
|
|
3050
3054
|
};
|
|
3051
|
-
return (0, We.jsx)(Dr, { flowId: e, stepId: (d == null ? void 0 : d.id) || (d == null ? void 0 : d.key), onLog: p, children: (0, We.jsx)(Mr, { metadata: ee, onEvent: m, children: (0, We.jsx)(pn, { loading:
|
|
3052
|
-
|
|
3053
|
-
}, onModelChange:
|
|
3055
|
+
return (0, We.jsx)(Dr, { flowId: e, stepId: (d == null ? void 0 : d.id) || (d == null ? void 0 : d.key), onLog: p, children: (0, We.jsx)(Mr, { metadata: ee, onEvent: m, children: (0, We.jsx)(pn, { loading: E, children: (0, We.jsx)(gn, { httpClient: t, children: (0, We.jsx)(Fn, { features: i, children: P !== null ? P : (0, We.jsx)(Kr, { step: d, model: xa(f), submitted: x, globalError: u, formErrors: y, stepLayoutOptions: { displayStepTitle: n }, onAction: (b) => {
|
|
3056
|
+
zm(b);
|
|
3057
|
+
}, onModelChange: xt }) }) }) }) }) });
|
|
3054
3058
|
};
|
|
3055
|
-
function
|
|
3056
|
-
return (0, We.jsx)(Xo, { onError: e.onError, children: (0, We.jsx)(
|
|
3059
|
+
function up(e) {
|
|
3060
|
+
return (0, We.jsx)(Xo, { onError: e.onError, children: (0, We.jsx)(dp, s({}, e)) });
|
|
3057
3061
|
}
|
|
3058
|
-
var Qo =
|
|
3062
|
+
var Qo = up;
|
|
3059
3063
|
var xa = (e) => Object.values(e).reduce((t, r) => s(s({}, t), r), {});
|
|
3060
|
-
var
|
|
3061
|
-
var
|
|
3064
|
+
var pp = (e = "POST") => ["POST", "PUT", "PATCH"].includes(e.toUpperCase());
|
|
3065
|
+
var yp = (e) => {
|
|
3062
3066
|
let { type: t, triggerSchema: r, triggerModel: a, lastTriggerModel: o = null } = e, n = () => G(a, r), i = () => G(o, r), c = (r == null ? void 0 : r.refreshStepOnChange) || (r == null ? void 0 : r.refreshFormOnChange);
|
|
3063
3067
|
return t !== "init" && c && (n() || i());
|
|
3064
3068
|
};
|
|
3065
|
-
var
|
|
3066
|
-
function
|
|
3069
|
+
var Fr = require("react/jsx-runtime");
|
|
3070
|
+
function fp(e) {
|
|
3067
3071
|
let t = s({ model: null, errors: null }, e), { baseUrl: r = "", onEvent: a = Fm, onLog: o = Fm } = e;
|
|
3068
|
-
return (0,
|
|
3072
|
+
return (0, Fr.jsx)(Dr, { flowId: "JsonSchemaForm", stepId: "JsonSchemaForm", onLog: o, children: (0, Fr.jsx)(Mr, { metadata: { flowId: "JsonSchemaForm", stepId: "JsonSchemaForm" }, onEvent: a, children: (0, Fr.jsx)(Ir, { baseUrl: r, children: (0, Fr.jsx)(me, s({}, t)) }) }) });
|
|
3069
3073
|
}
|
|
3070
|
-
var en =
|
|
3074
|
+
var en = fp;
|
|
3071
3075
|
var Fm = () => {
|
|
3072
3076
|
};
|
|
3073
3077
|
var bm = { "dynamicFlows.ArraySchema.addItem": "Speichern", "dynamicFlows.ArraySchema.addItemTitle": "Artikel hinzuf\xFCgen", "dynamicFlows.ArraySchema.editItem": "Speichern", "dynamicFlows.ArraySchema.maxItemsError": "Bitte f\xFCge {maxItems} oder weniger hinzu.", "dynamicFlows.ArraySchema.minItemsError": "Bitte f\xFCge mindestens {minItems} hinzu.", "dynamicFlows.ArraySchema.removeItem": "Entfernen", "dynamicFlows.CameraCapture.CameraConnectionIssue.action": "Erneut versuchen", "dynamicFlows.CameraCapture.CameraConnectionIssue.paragraph": "Bitte pr\xFCfe, ob deine Kamera verbunden ist, und versuche es dann erneut.", "dynamicFlows.CameraCapture.CameraConnectionIssue.title": "Wir k\xF6nnen nicht auf deine Kamera zugreifen", "dynamicFlows.CameraCapture.CameraNotSupported.paragraph": "Der von dir verwendete Browser unterst\xFCtzt keine Kameras. Bitte verwende einen anderen Browser oder ein anderes Ger\xE4t, oder lade unsere App herunter", "dynamicFlows.CameraCapture.CameraNotSupported.title": "Kamera wird nicht unterst\xFCtzt", "dynamicFlows.CameraCapture.NoCameraAccess.action": "Kamerazugriff genehmigen", "dynamicFlows.CameraCapture.NoCameraAccess.paragraph": "Aktiviere den Kamerazugriff in den Einstellungen deines Browsers, um weitermachen zu k\xF6nnen.", "dynamicFlows.CameraCapture.NoCameraAccess.title": "Wir k\xF6nnen nicht auf deine Kamera zugreifen", "dynamicFlows.CameraCapture.reviewInstructions": "Ist das aufgenommene Bild deutlich erkennbar und vollst\xE4ndig?", "dynamicFlows.CameraCapture.reviewRetry": "Nein, erneut versuchen", "dynamicFlows.CameraCapture.reviewSubmit": "Ja, senden", "dynamicFlows.CameraCapture.rotatePhone.text": "Drehe dein Ger\xE4t in die Hochformatansicht, um ein Foto aufzunehmen", "dynamicFlows.ControlFeedback.maxLength": "Bitte gib nicht mehr als {maxLength} Zeichen ein.", "dynamicFlows.ControlFeedback.maximum": "Bitte gib eine Zahl ein, die {maximum} oder weniger betr\xE4gt.", "dynamicFlows.ControlFeedback.maximumDate": "Bitte gib ein Datum ein, das am oder vor dem {maximum} liegt.", "dynamicFlows.ControlFeedback.minLength": "Bitte gib mindestens {minLength} Zeichen ein.", "dynamicFlows.ControlFeedback.minimum": "Bitte gib eine Zahl ein, die {minimum} oder mehr betr\xE4gt.", "dynamicFlows.ControlFeedback.minimumDate": "Bitte gib ein Datum ein, das am oder nach dem {minimum} liegt.", "dynamicFlows.ControlFeedback.pattern": "Bitte gib die Angabe im richtigen Format ein.", "dynamicFlows.ControlFeedback.patternDate": "Bitte gib ein Datum im richtigen Format ein.", "dynamicFlows.ControlFeedback.required": "Bitte f\xFClle dieses Feld aus.", "dynamicFlows.ControlFeedback.type": "Falscher Typ", "dynamicFlows.DefaultErrorMessages.required": "Bitte f\xFClle dieses Feld aus.", "dynamicFlows.DynamicExternal.retryTitle": "Fenster erneut \xF6ffnen", "dynamicFlows.DynamicParagraph.copied": "In Zwischenablage kopiert", "dynamicFlows.DynamicParagraph.copy": "Kopieren", "dynamicFlows.ErrorBoundary.errorAlert": "Hoppla \u2013 da ist was schiefgelaufen...", "dynamicFlows.ErrorBoundary.retry": "Erneut versuchen", "dynamicFlows.ExternalConfirmation.cancel": "Abbrechen", "dynamicFlows.ExternalConfirmation.description": "Bitte best\xE4tige, dass du **{origin}** in einem neuen Browser-Tab \xF6ffnen m\xF6chtest.", "dynamicFlows.ExternalConfirmation.open": "In neuem Tab \xF6ffnen", "dynamicFlows.ExternalConfirmation.title": "Bitte best\xE4tigen", "dynamicFlows.Help.ariaLabel": "Klicke hier f\xFCr mehr Informationen.", "dynamicFlows.MultipleFileUploadSchema.maxFileSizeError": "Diese Datei ist leider zu gro\xDF. Bitte lade eine kleinere Datei hoch.", "dynamicFlows.MultipleFileUploadSchema.maxItemsError": "Bitte lade {maxItems} oder weniger Dateien hoch.", "dynamicFlows.MultipleFileUploadSchema.minItemsError": "Bitte lade mindestens {minItems} Datei(en) hoch.", "dynamicFlows.PersistAsyncSchema.genericError": "Da ist etwas schiefgelaufen. Probiere es bitte sp\xE4ter noch einmal.", "dynamicFlows.ReadOnlySchema.no": "Nein", "dynamicFlows.ReadOnlySchema.yes": "Ja" };
|
|
@@ -3086,8 +3090,8 @@ var require_main_min = __commonJS({
|
|
|
3086
3090
|
var Rm = { "dynamicFlows.ArraySchema.addItem": "Kaydet", "dynamicFlows.ArraySchema.addItemTitle": "\xD6\u011Fe ekle", "dynamicFlows.ArraySchema.editItem": "Kaydet", "dynamicFlows.ArraySchema.maxItemsError": "L\xFCtfen {maxItems} veya daha az ekleme yap\u0131n", "dynamicFlows.ArraySchema.minItemsError": "L\xFCtfen en az {minItems} ekleme yap\u0131n.", "dynamicFlows.ArraySchema.removeItem": "Kald\u0131r", "dynamicFlows.CameraCapture.CameraConnectionIssue.action": "Tekrar deneyin", "dynamicFlows.CameraCapture.CameraConnectionIssue.paragraph": "L\xFCtfen ba\u011Fl\u0131 olup olmad\u0131\u011F\u0131n\u0131 kontrol edip tekrar deneyin.", "dynamicFlows.CameraCapture.CameraConnectionIssue.title": "Kameran\u0131za eri\u015Femiyoruz", "dynamicFlows.CameraCapture.CameraNotSupported.paragraph": "Kulland\u0131\u011F\u0131n\u0131z taray\u0131c\u0131da kamera deste\u011Fi yok. Farkl\u0131 bir taray\u0131c\u0131 / cihaz deneyin veya mobil uygulamam\u0131z\u0131 indirin.", "dynamicFlows.CameraCapture.CameraNotSupported.title": "Kamera desteklenmiyor", "dynamicFlows.CameraCapture.NoCameraAccess.action": "Kamera eri\u015Fimi verin", "dynamicFlows.CameraCapture.NoCameraAccess.paragraph": "Tekrar ba\u015Flamak i\xE7in taray\u0131c\u0131n\u0131z\u0131n ayarlar\u0131nda kamera eri\u015Fimini etkinle\u015Ftirin.", "dynamicFlows.CameraCapture.NoCameraAccess.title": "Kameran\u0131za eri\u015Femiyoruz", "dynamicFlows.CameraCapture.reviewInstructions": "Foto\u011Fraf\u0131n\u0131z net, okunakl\u0131 ve eksiksiz mi?", "dynamicFlows.CameraCapture.reviewRetry": "Hay\u0131r, tekrar dene", "dynamicFlows.CameraCapture.reviewSubmit": "Evet, g\xF6nder", "dynamicFlows.CameraCapture.rotatePhone.text": "Foto\u011Fraf \xE7ekmek i\xE7in telefonunuzu dik pozisyonda tutun", "dynamicFlows.ControlFeedback.maxLength": "L\xFCtfen {maxLength} veya daha az karakter girin.", "dynamicFlows.ControlFeedback.maximum": "L\xFCtfen {maximum} veya daha d\xFC\u015F\xFCk bir say\u0131 girin.", "dynamicFlows.ControlFeedback.maximumDate": "L\xFCtfen {maximum} veya daha erken bir tarih girin.", "dynamicFlows.ControlFeedback.minLength": "En az {minLength} karakter girebilirsiniz.", "dynamicFlows.ControlFeedback.minimum": "L\xFCtfen {minimum} veya daha y\xFCksek bir say\u0131 girin.", "dynamicFlows.ControlFeedback.minimumDate": "L\xFCtfen {minimum} veya daha ge\xE7 bir tarih girin.", "dynamicFlows.ControlFeedback.pattern": "Yanl\u0131\u015F bi\xE7im", "dynamicFlows.ControlFeedback.patternDate": "L\xFCtfen tarihi do\u011Fru bi\xE7imde girin.", "dynamicFlows.ControlFeedback.required": "L\xFCtfen bu alan\u0131 doldurun.", "dynamicFlows.ControlFeedback.type": "Ge\xE7ersiz se\xE7im", "dynamicFlows.DefaultErrorMessages.required": "L\xFCtfen bu alan\u0131 doldurun.", "dynamicFlows.DynamicExternal.retryTitle": "Pencereyi yeniden a\xE7", "dynamicFlows.DynamicParagraph.copied": "Panoya kopyaland\u0131", "dynamicFlows.DynamicParagraph.copy": "Kopyala", "dynamicFlows.ErrorBoundary.errorAlert": "Aman\u0131n! Bir \u015Feyler ters gitti...", "dynamicFlows.ErrorBoundary.retry": "Tekrar dene", "dynamicFlows.ExternalConfirmation.cancel": "\u0130ptal edin", "dynamicFlows.ExternalConfirmation.description": "L\xFCtfen yeni bir taray\u0131c\u0131 sekmesinde **{origin}** a\xE7mak istedi\u011Finizi onaylay\u0131n.", "dynamicFlows.ExternalConfirmation.open": "Yeni sekmede a\xE7", "dynamicFlows.ExternalConfirmation.title": "L\xFCtfen onaylay\u0131n", "dynamicFlows.Help.ariaLabel": "Ayr\u0131nt\u0131lar i\xE7in t\u0131klay\u0131n.", "dynamicFlows.MultipleFileUploadSchema.maxFileSizeError": "\xDCzg\xFCn\xFCz, bu dosya \xE7ok b\xFCy\xFCk. L\xFCtfen daha k\xFC\xE7\xFCk bir dosya y\xFCkleyin.", "dynamicFlows.MultipleFileUploadSchema.maxItemsError": "L\xFCtfen {maxItems} veya daha az dosya y\xFCkleyin.", "dynamicFlows.MultipleFileUploadSchema.minItemsError": "L\xFCtfen en az {minItems} dosya y\xFCkleyin.", "dynamicFlows.PersistAsyncSchema.genericError": "Bir \u015Feyler ters gitti, l\xFCtfen tekrar deneyin", "dynamicFlows.ReadOnlySchema.no": "Hay\u0131r", "dynamicFlows.ReadOnlySchema.yes": "Evet" };
|
|
3087
3091
|
var tn = { "dynamicFlows.ArraySchema.addItem": "\u4FDD\u5B58", "dynamicFlows.ArraySchema.addItemTitle": "\u6DFB\u52A0\u9879\u76EE", "dynamicFlows.ArraySchema.editItem": "\u4FDD\u5B58", "dynamicFlows.ArraySchema.maxItemsError": "\u8BF7\u6DFB\u52A0\u4E0D\u8D85\u8FC7 {maxItems} \u9879\u3002", "dynamicFlows.ArraySchema.minItemsError": "\u8BF7\u81F3\u5C11\u6DFB\u52A0 {minItems} \u9879\u3002", "dynamicFlows.ArraySchema.removeItem": "\u79FB\u9664", "dynamicFlows.CameraCapture.CameraConnectionIssue.action": "\u91CD\u8BD5", "dynamicFlows.CameraCapture.CameraConnectionIssue.paragraph": "Please check if it is connected and try again.", "dynamicFlows.CameraCapture.CameraConnectionIssue.title": "\u6211\u4EEC\u65E0\u6CD5\u8BBF\u95EE\u60A8\u7684\u6444\u50CF\u5934", "dynamicFlows.CameraCapture.CameraNotSupported.paragraph": "\u60A8\u76EE\u524D\u4F7F\u7528\u7684\u6D4F\u89C8\u5668\u4E0D\u652F\u6301\u6444\u50CF\u5934\u3002\u8BF7\u5C1D\u8BD5\u5176\u4ED6\u6D4F\u89C8\u5668\u3001\u8BBE\u5907\u6216\u4E0B\u8F7D\u6211\u4EEC\u7684\u5E94\u7528\u3002", "dynamicFlows.CameraCapture.CameraNotSupported.title": "\u4E0D\u652F\u6301\u6444\u50CF\u5934", "dynamicFlows.CameraCapture.NoCameraAccess.action": "\u5141\u8BB8\u8BBF\u95EE\u6444\u50CF\u5934", "dynamicFlows.CameraCapture.NoCameraAccess.paragraph": "\u5728\u6D4F\u89C8\u5668\u8BBE\u7F6E\u4E2D\u542F\u7528\u76F8\u673A\u8BBF\u95EE\u6743\u9650\uFF0C\u518D\u91CD\u65B0\u5C1D\u8BD5\u3002", "dynamicFlows.CameraCapture.NoCameraAccess.title": "\u6211\u4EEC\u65E0\u6CD5\u8BBF\u95EE\u60A8\u7684\u6444\u50CF\u5934", "dynamicFlows.CameraCapture.reviewInstructions": "\u60A8\u7684\u56FE\u7247\u662F\u5426\u6E05\u6670\u3001\u53EF\u8BFB\u548C\u5B8C\u6574\uFF1F", "dynamicFlows.CameraCapture.reviewRetry": "\u5426\uFF0C\u518D\u8BD5\u4E00\u6B21", "dynamicFlows.CameraCapture.reviewSubmit": "\u662F\uFF0C\u63D0\u4EA4", "dynamicFlows.CameraCapture.rotatePhone.text": "\u5C06\u624B\u673A\u65CB\u8F6C\u5230\u7EB5\u5411\u89C6\u56FE\u4EE5\u62CD\u7167", "dynamicFlows.ControlFeedback.maxLength": "\u8BF7\u8F93\u5165\u4E0D\u8D85\u8FC7 {maxLength} \u4E2A\u5B57\u7B26\u3002", "dynamicFlows.ControlFeedback.maximum": "\u8BF7\u8F93\u5165\u4E00\u4E2A\u5C0F\u4E8E\u6216\u7B49\u4E8E {maximum} \u7684\u6570\u5B57\u3002", "dynamicFlows.ControlFeedback.maximumDate": "\u8BF7\u8F93\u5165 {maximum} \u6216\u4E4B\u524D\u7684\u65E5\u671F", "dynamicFlows.ControlFeedback.minLength": "\u8BF7\u81F3\u5C11\u8F93\u5165 {minLength} \u4E2A\u5B57\u7B26", "dynamicFlows.ControlFeedback.minimum": "\u8BF7\u8F93\u5165\u4E00\u4E2A\u5927\u4E8E\u6216\u7B49\u4E8E {minimum} \u7684\u6570\u5B57", "dynamicFlows.ControlFeedback.minimumDate": "\u8BF7\u8F93\u5165 {minimum} \u6216\u4E4B\u540E\u7684\u65E5\u671F", "dynamicFlows.ControlFeedback.pattern": "\u8BF7\u4EE5\u6B63\u786E\u7684\u683C\u5F0F\u8F93\u5165", "dynamicFlows.ControlFeedback.patternDate": "\u8BF7\u4EE5\u6B63\u786E\u7684\u683C\u5F0F\u8F93\u5165\u65E5\u671F", "dynamicFlows.ControlFeedback.required": "\u8BF7\u586B\u5199\u6B64\u5B57\u6BB5\u3002", "dynamicFlows.ControlFeedback.type": "\u7C7B\u578B\u9519\u8BEF", "dynamicFlows.DefaultErrorMessages.required": "\u8BF7\u586B\u5199\u6B64\u5B57\u6BB5\u3002", "dynamicFlows.DynamicExternal.retryTitle": "\u91CD\u65B0\u6253\u5F00\u7A97\u53E3", "dynamicFlows.DynamicParagraph.copied": "\u5DF2\u590D\u5236\u5230\u526A\u8D34\u677F", "dynamicFlows.DynamicParagraph.copy": "\u590D\u5236", "dynamicFlows.ErrorBoundary.errorAlert": "\u7CDF\u7CD5\u3002\u51FA\u9519\u4E86\u2026", "dynamicFlows.ErrorBoundary.retry": "\u91CD\u8BD5", "dynamicFlows.ExternalConfirmation.cancel": "\u53D6\u6D88", "dynamicFlows.ExternalConfirmation.description": "\u8BF7\u786E\u8BA4\u60A8\u662F\u5426\u8981\u5728\u65B0\u6807\u7B7E\u9875\u4E2D\u6253\u5F00**{origin}**\u3002", "dynamicFlows.ExternalConfirmation.open": "\u5728\u65B0\u6807\u7B7E\u9875\u4E2D\u6253\u5F00", "dynamicFlows.ExternalConfirmation.title": "\u8BF7\u786E\u8BA4", "dynamicFlows.Help.ariaLabel": "\u70B9\u51FB\u6B64\u5904\u83B7\u53D6\u66F4\u591A\u4FE1\u606F\u3002", "dynamicFlows.MultipleFileUploadSchema.maxFileSizeError": "\u62B1\u6B49\uFF0C\u8BE5\u6587\u4EF6\u592A\u5927\u3002\u8BF7\u4E0A\u4F20\u4E00\u4E2A\u66F4\u5C0F\u7684\u6587\u4EF6\u3002", "dynamicFlows.MultipleFileUploadSchema.maxItemsError": "\u8BF7\u4E0A\u4F20\u4E0D\u8D85\u8FC7 {maxItems} \u4E2A\u6587\u4EF6\u3002", "dynamicFlows.MultipleFileUploadSchema.minItemsError": "\u8BF7\u4E0A\u4F20\u81F3\u5C11 {minItems} \u4E2A\u6587\u4EF6\u3002", "dynamicFlows.PersistAsyncSchema.genericError": "\u51FA\u9519\u4E86\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5\uFF01", "dynamicFlows.ReadOnlySchema.no": "\u5426", "dynamicFlows.ReadOnlySchema.yes": "\u662F" };
|
|
3088
3092
|
var Nm = { "dynamicFlows.ArraySchema.addItem": "\u5132\u5B58", "dynamicFlows.ArraySchema.addItemTitle": "\u6DFB\u52A0\u9805\u76EE", "dynamicFlows.ArraySchema.editItem": "\u5132\u5B58", "dynamicFlows.ArraySchema.maxItemsError": "\u8ACB\u6DFB\u52A0\u4E0D\u8D85\u904E{maxItems}\u9805\u3002", "dynamicFlows.ArraySchema.minItemsError": "\u8ACB\u81F3\u5C11\u6DFB\u52A0{minItems}\u9805\u3002", "dynamicFlows.ArraySchema.removeItem": "\u79FB\u9664", "dynamicFlows.CameraCapture.CameraConnectionIssue.action": "\u518D\u8A66\u4E00\u6B21", "dynamicFlows.CameraCapture.CameraConnectionIssue.paragraph": "Please check if it is connected and try again.", "dynamicFlows.CameraCapture.CameraConnectionIssue.title": "\u6211\u5011\u7121\u6CD5\u53D6\u7528\u4F60\u7684\u76F8\u6A5F", "dynamicFlows.CameraCapture.CameraNotSupported.paragraph": "\u4F60\u76EE\u524D\u4F7F\u7528\u7684\u700F\u89BD\u5668\u4E0D\u652F\u6301\u76F8\u6A5F\u3002\u8ACB\u5617\u8A66\u4F7F\u7528\u5176\u4ED6\u700F\u89BD\u5668\u6216\u5176\u4ED6\u88DD\u7F6E\uFF0C\u6216\u8005\u4F60\u53EF\u4EE5\u4E0B\u8F09\u6211\u5011\u7684\u61C9\u7528\u7A0B\u5F0F\u3002", "dynamicFlows.CameraCapture.CameraNotSupported.title": "\u4E0D\u652F\u6301\u76F8\u6A5F", "dynamicFlows.CameraCapture.NoCameraAccess.action": "\u5141\u8A31\u53D6\u7528\u76F8\u6A5F", "dynamicFlows.CameraCapture.NoCameraAccess.paragraph": "\u4F60\u53EF\u4EE5\u5728\u700F\u89BD\u5668\u7684\u8A2D\u5B9A\u4E2D\u958B\u555F\u76F8\u6A5F\u5B58\u53D6\u6B0A\u9650\u3002", "dynamicFlows.CameraCapture.NoCameraAccess.title": "\u6211\u5011\u7121\u6CD5\u53D6\u7528\u4F60\u7684\u76F8\u6A5F", "dynamicFlows.CameraCapture.reviewInstructions": "\u4F60\u7684\u7167\u7247\u662F\u5426\u5B8C\u6574\u3001\u6E05\u6670\u53CA\u53EF\u8B80\uFF1F", "dynamicFlows.CameraCapture.reviewRetry": "\u5426\uFF0C\u518D\u8A66\u4E00\u6B21", "dynamicFlows.CameraCapture.reviewSubmit": "\u662F\uFF0C\u63D0\u4EA4", "dynamicFlows.CameraCapture.rotatePhone.text": "\u5C07\u624B\u6A5F\u65CB\u8F49\u81F3\u5782\u76F4\u756B\u9762\u4EE5\u62CD\u7167", "dynamicFlows.ControlFeedback.maxLength": "\u8ACB\u8F38\u5165\u6700\u591A{maxLength}\u500B\u5B57\u5143\u3002", "dynamicFlows.ControlFeedback.maximum": "\u8ACB\u8F38\u5165\u4E00\u500B\u5C0F\u65BC\u6216\u7B49\u65BC{maximum}\u7684\u6578\u5B57\u3002", "dynamicFlows.ControlFeedback.maximumDate": "\u8ACB\u8F38\u5165{maximum}\u6216\u4E4B\u524D\u7684\u65E5\u671F\u3002", "dynamicFlows.ControlFeedback.minLength": "\u8ACB\u8F38\u5165\u81F3\u5C11{minLength}\u500B\u5B57\u5143\u3002", "dynamicFlows.ControlFeedback.minimum": "\u8ACB\u8F38\u5165\u4E00\u500B\u5927\u65BC\u6216\u7B49\u65BC{minimum}\u7684\u6578\u5B57\u3002", "dynamicFlows.ControlFeedback.minimumDate": "\u8ACB\u8F38\u5165{minimum}\u6216\u4E4B\u5F8C\u7684\u65E5\u671F\u3002", "dynamicFlows.ControlFeedback.pattern": "\u8ACB\u4EE5\u6B63\u78BA\u683C\u5F0F\u8F38\u5165\u5185\u5BB9\u3002", "dynamicFlows.ControlFeedback.patternDate": "\u8ACB\u4EE5\u6B63\u78BA\u683C\u5F0F\u8F38\u5165\u65E5\u671F\u3002", "dynamicFlows.ControlFeedback.required": "\u8ACB\u586B\u5BEB\u6B64\u6B04\u4F4D\u3002", "dynamicFlows.ControlFeedback.type": "\u932F\u8AA4\u7684\u985E\u578B", "dynamicFlows.DefaultErrorMessages.required": "\u8ACB\u586B\u5BEB\u6B64\u6B04\u4F4D\u3002", "dynamicFlows.DynamicExternal.retryTitle": "\u91CD\u65B0\u6253\u958B\u8996\u7A97", "dynamicFlows.DynamicParagraph.copied": "\u8907\u88FD\u5230\u526A\u8CBC\u677F", "dynamicFlows.DynamicParagraph.copy": "\u8907\u88FD", "dynamicFlows.ErrorBoundary.errorAlert": "\u5662\uFF01\u51FA\u4E86\u4E9B\u554F\u984C...", "dynamicFlows.ErrorBoundary.retry": "\u91CD\u8A66", "dynamicFlows.ExternalConfirmation.cancel": "\u53D6\u6D88", "dynamicFlows.ExternalConfirmation.description": "\u8ACB\u78BA\u8A8D\u4F60\u662F\u5426\u8981\u5728\u700F\u89BD\u5668\u7684\u65B0\u5206\u9801\u6253\u958B**{origin}**\u3002", "dynamicFlows.ExternalConfirmation.open": "\u5728\u65B0\u5206\u9801\u4E2D\u958B\u555F", "dynamicFlows.ExternalConfirmation.title": "\u8ACB\u78BA\u8A8D", "dynamicFlows.Help.ariaLabel": "\u6309\u6B64\u67E5\u770B\u8A73\u60C5\u3002", "dynamicFlows.MultipleFileUploadSchema.maxFileSizeError": "\u62B1\u6B49\uFF0C\u8A72\u6A94\u6848\u592A\u5927\u3002\u8ACB\u4E0A\u8F09\u4E00\u500B\u8F03\u5C0F\u7684\u6A94\u6848\u3002", "dynamicFlows.MultipleFileUploadSchema.maxItemsError": "\u8ACB\u4E0D\u8981\u4E0A\u8F09\u8D85\u904E{maxItems}\u500B\u6A94\u6848\u3002", "dynamicFlows.MultipleFileUploadSchema.minItemsError": "\u8ACB\u4E0A\u8F09\u81F3\u5C11{minItems}\u500B\u6A94\u6848\u3002", "dynamicFlows.PersistAsyncSchema.genericError": "\u51FA\u4E86\u4E9B\u554F\u984C\uFF0C\u8ACB\u7A0D\u5F8C\u518D\u8A66\u3002", "dynamicFlows.ReadOnlySchema.no": "\u5426", "dynamicFlows.ReadOnlySchema.yes": "\u662F" };
|
|
3089
|
-
var
|
|
3090
|
-
var Bm =
|
|
3093
|
+
var Dp = { en: xm, de: bm, es: vm, fr: Am, hu: Om, id: Pm, it: Mm, ja: km, pl: Em, pt: Im, ro: Dm, ru: Lm, th: Tm, tr: Rm, zh: tn, "zh-CN": tn, "zh-HK": Nm };
|
|
3094
|
+
var Bm = Dp;
|
|
3091
3095
|
}
|
|
3092
3096
|
});
|
|
3093
3097
|
|