@wise/dynamic-flow-client-internal 2.8.14 → 2.8.15
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 +350 -350
- package/build/main.min.js +1 -1
- package/package.json +2 -2
package/build/main.js
CHANGED
|
@@ -163,8 +163,8 @@ var require_main_min = __commonJS({
|
|
|
163
163
|
return h = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(l, f) {
|
|
164
164
|
l.__proto__ = f;
|
|
165
165
|
} || function(l, f) {
|
|
166
|
-
for (var
|
|
167
|
-
f.hasOwnProperty(
|
|
166
|
+
for (var g in f)
|
|
167
|
+
f.hasOwnProperty(g) && (l[g] = f[g]);
|
|
168
168
|
}, h(y, u);
|
|
169
169
|
};
|
|
170
170
|
return function(y, u) {
|
|
@@ -222,8 +222,8 @@ var require_main_min = __commonJS({
|
|
|
222
222
|
l.onUserMediaError("getUserMedia not supported");
|
|
223
223
|
return;
|
|
224
224
|
}
|
|
225
|
-
var f = JSON.stringify(u.audioConstraints) !== JSON.stringify(l.audioConstraints),
|
|
226
|
-
(
|
|
225
|
+
var f = JSON.stringify(u.audioConstraints) !== JSON.stringify(l.audioConstraints), g = JSON.stringify(u.videoConstraints) !== JSON.stringify(l.videoConstraints), C = u.minScreenshotWidth !== l.minScreenshotWidth, F = u.minScreenshotHeight !== l.minScreenshotHeight;
|
|
226
|
+
(g || C || F) && (this.canvas = null, this.ctx = null), (f || g) && (this.stopAndCleanup(), this.requestUserMedia());
|
|
227
227
|
}, y.prototype.componentWillUnmount = function() {
|
|
228
228
|
this.unmounted = true, this.stopAndCleanup();
|
|
229
229
|
}, y.stopMediaStream = function(u) {
|
|
@@ -236,32 +236,32 @@ var require_main_min = __commonJS({
|
|
|
236
236
|
var u = this.state;
|
|
237
237
|
u.hasUserMedia && (y.stopMediaStream(this.stream), u.src && window.URL.revokeObjectURL(u.src));
|
|
238
238
|
}, y.prototype.getScreenshot = function(u) {
|
|
239
|
-
var l = this, f = l.state,
|
|
239
|
+
var l = this, f = l.state, g = l.props;
|
|
240
240
|
if (!f.hasUserMedia)
|
|
241
241
|
return null;
|
|
242
242
|
var C = this.getCanvas(u);
|
|
243
|
-
return C && C.toDataURL(
|
|
243
|
+
return C && C.toDataURL(g.screenshotFormat, g.screenshotQuality);
|
|
244
244
|
}, y.prototype.getCanvas = function(u) {
|
|
245
|
-
var l = this, f = l.state,
|
|
245
|
+
var l = this, f = l.state, g = l.props;
|
|
246
246
|
if (!this.video || !f.hasUserMedia || !this.video.videoHeight)
|
|
247
247
|
return null;
|
|
248
248
|
if (!this.ctx) {
|
|
249
249
|
var C = this.video.videoWidth, F = this.video.videoHeight;
|
|
250
250
|
if (!this.props.forceScreenshotSourceSize) {
|
|
251
|
-
var
|
|
252
|
-
C =
|
|
251
|
+
var w = C / F;
|
|
252
|
+
C = g.minScreenshotWidth || this.video.clientWidth, F = C / w, g.minScreenshotHeight && F < g.minScreenshotHeight && (F = g.minScreenshotHeight, C = F * w);
|
|
253
253
|
}
|
|
254
254
|
this.canvas = document.createElement("canvas"), this.canvas.width = (u == null ? void 0 : u.width) || C, this.canvas.height = (u == null ? void 0 : u.height) || F, this.ctx = this.canvas.getContext("2d");
|
|
255
255
|
}
|
|
256
|
-
var
|
|
257
|
-
return
|
|
256
|
+
var A = this, M = A.ctx, x = A.canvas;
|
|
257
|
+
return M && x && (x.width = (u == null ? void 0 : u.width) || x.width, x.height = (u == null ? void 0 : u.height) || x.height, g.mirrored && (M.translate(x.width, 0), M.scale(-1, 1)), M.imageSmoothingEnabled = g.imageSmoothing, M.drawImage(this.video, 0, 0, (u == null ? void 0 : u.width) || x.width, (u == null ? void 0 : u.height) || x.height), g.mirrored && (M.scale(-1, 1), M.translate(-x.width, 0))), x;
|
|
258
258
|
}, y.prototype.requestUserMedia = function() {
|
|
259
|
-
var u = this, l = this.props, f = function(F,
|
|
260
|
-
var
|
|
261
|
-
l.audio && (
|
|
262
|
-
var
|
|
263
|
-
navigator.mediaDevices.getUserMedia(
|
|
264
|
-
u.unmounted ||
|
|
259
|
+
var u = this, l = this.props, f = function(F, w) {
|
|
260
|
+
var A = { video: typeof w != "undefined" ? w : true };
|
|
261
|
+
l.audio && (A.audio = typeof F != "undefined" ? F : true), u.requestUserMediaId++;
|
|
262
|
+
var M = u.requestUserMediaId;
|
|
263
|
+
navigator.mediaDevices.getUserMedia(A).then(function(x) {
|
|
264
|
+
u.unmounted || M !== u.requestUserMediaId ? y.stopMediaStream(x) : u.handleUserMedia(null, x);
|
|
265
265
|
}).catch(function(x) {
|
|
266
266
|
u.handleUserMedia(x);
|
|
267
267
|
});
|
|
@@ -269,21 +269,21 @@ var require_main_min = __commonJS({
|
|
|
269
269
|
if ("mediaDevices" in navigator)
|
|
270
270
|
f(l.audioConstraints, l.videoConstraints);
|
|
271
271
|
else {
|
|
272
|
-
var
|
|
272
|
+
var g = function(F) {
|
|
273
273
|
return { optional: [{ sourceId: F }] };
|
|
274
274
|
}, C = function(F) {
|
|
275
|
-
var
|
|
276
|
-
return typeof
|
|
275
|
+
var w = F.deviceId;
|
|
276
|
+
return typeof w == "string" ? w : Array.isArray(w) && w.length > 0 ? w[0] : typeof w == "object" && w.ideal ? w.ideal : null;
|
|
277
277
|
};
|
|
278
278
|
MediaStreamTrack.getSources(function(F) {
|
|
279
|
-
var
|
|
280
|
-
F.forEach(function(
|
|
281
|
-
|
|
279
|
+
var w = null, A = null;
|
|
280
|
+
F.forEach(function(k) {
|
|
281
|
+
k.kind === "audio" ? w = k.id : k.kind === "video" && (A = k.id);
|
|
282
282
|
});
|
|
283
|
-
var
|
|
284
|
-
|
|
283
|
+
var M = C(l.audioConstraints);
|
|
284
|
+
M && (w = M);
|
|
285
285
|
var x = C(l.videoConstraints);
|
|
286
|
-
x && (
|
|
286
|
+
x && (A = x), f(g(w), g(A));
|
|
287
287
|
});
|
|
288
288
|
}
|
|
289
289
|
}, y.prototype.handleUserMedia = function(u, l) {
|
|
@@ -295,15 +295,15 @@ var require_main_min = __commonJS({
|
|
|
295
295
|
this.stream = l;
|
|
296
296
|
try {
|
|
297
297
|
this.video && (this.video.srcObject = l), this.setState({ hasUserMedia: true });
|
|
298
|
-
} catch (
|
|
298
|
+
} catch (g) {
|
|
299
299
|
this.setState({ hasUserMedia: true, src: window.URL.createObjectURL(l) });
|
|
300
300
|
}
|
|
301
301
|
f.onUserMedia(l);
|
|
302
302
|
}, y.prototype.render = function() {
|
|
303
|
-
var u = this, l = this, f = l.state,
|
|
304
|
-
return o.createElement(o.Fragment, null, o.createElement("video", c({ autoPlay: true, disablePictureInPicture:
|
|
303
|
+
var u = this, l = this, f = l.state, g = l.props, C = g.audio, F = g.forceScreenshotSourceSize, w = g.disablePictureInPicture, A = g.onUserMedia, M = g.onUserMediaError, x = g.screenshotFormat, k = g.screenshotQuality, I = g.minScreenshotWidth, O = g.minScreenshotHeight, P = g.audioConstraints, B = g.videoConstraints, _ = g.imageSmoothing, v = g.mirrored, z = g.style, E = z === void 0 ? {} : z, ie = g.children, $ = d(g, ["audio", "forceScreenshotSourceSize", "disablePictureInPicture", "onUserMedia", "onUserMediaError", "screenshotFormat", "screenshotQuality", "minScreenshotWidth", "minScreenshotHeight", "audioConstraints", "videoConstraints", "imageSmoothing", "mirrored", "style", "children"]), Y = v ? c(c({}, E), { transform: (E.transform || "") + " scaleX(-1)" }) : E, ke = { getScreenshot: this.getScreenshot.bind(this) };
|
|
304
|
+
return o.createElement(o.Fragment, null, o.createElement("video", c({ autoPlay: true, disablePictureInPicture: w, src: f.src, muted: !C, playsInline: true, ref: function(nt) {
|
|
305
305
|
u.video = nt;
|
|
306
|
-
}, style:
|
|
306
|
+
}, style: Y }, $)), 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;
|
|
@@ -591,14 +591,14 @@ var require_main_min = __commonJS({
|
|
|
591
591
|
return e === 422;
|
|
592
592
|
}
|
|
593
593
|
var L = (e) => typeof e == "string";
|
|
594
|
-
var
|
|
595
|
-
var vn = (e) =>
|
|
594
|
+
var j = (e) => typeof e == "number" && !Number.isNaN(e);
|
|
595
|
+
var vn = (e) => j(e) && Math.floor(e) === e;
|
|
596
596
|
var Ie = (e) => typeof e == "boolean";
|
|
597
|
-
var R = (e) => !
|
|
598
|
-
var
|
|
599
|
-
var
|
|
600
|
-
var
|
|
601
|
-
var kt = (e) => L(e) && e.length === 0 || (R(e) ||
|
|
597
|
+
var R = (e) => !D(e) && !Z(e) && (e == null ? void 0 : e.constructor) === Object;
|
|
598
|
+
var V = (e) => Array.isArray(e);
|
|
599
|
+
var D = (e) => e === null;
|
|
600
|
+
var Z = (e) => typeof e == "undefined";
|
|
601
|
+
var kt = (e) => L(e) && e.length === 0 || (R(e) || V(e)) && Object.keys(e).length === 0;
|
|
602
602
|
function An(e, t) {
|
|
603
603
|
return t.oneOf.some((r) => We(e, r) === e) ? e : null;
|
|
604
604
|
}
|
|
@@ -614,13 +614,13 @@ var require_main_min = __commonJS({
|
|
|
614
614
|
return L(e) && !kt(e) ? e : null;
|
|
615
615
|
}
|
|
616
616
|
function Mn(e) {
|
|
617
|
-
return
|
|
617
|
+
return j(e) ? e : null;
|
|
618
618
|
}
|
|
619
619
|
function kn(e) {
|
|
620
620
|
return Ie(e) ? e : null;
|
|
621
621
|
}
|
|
622
622
|
function Ta(e, t) {
|
|
623
|
-
if (!
|
|
623
|
+
if (!V(e) || !De(t))
|
|
624
624
|
return null;
|
|
625
625
|
if (e.length > 0) {
|
|
626
626
|
let r = typeof e[0];
|
|
@@ -631,9 +631,9 @@ var require_main_min = __commonJS({
|
|
|
631
631
|
}
|
|
632
632
|
function En(e, t) {
|
|
633
633
|
return Object.keys(t.properties).reduce((r, a) => {
|
|
634
|
-
if (e && !
|
|
634
|
+
if (e && !Z(e[a])) {
|
|
635
635
|
let o = e[a], n = t.properties[a], i = Et(o, n);
|
|
636
|
-
if (!
|
|
636
|
+
if (!D(i))
|
|
637
637
|
return S(s({}, r), { [a]: i });
|
|
638
638
|
}
|
|
639
639
|
return r;
|
|
@@ -646,7 +646,7 @@ var require_main_min = __commonJS({
|
|
|
646
646
|
}, {});
|
|
647
647
|
}
|
|
648
648
|
function Dn(e, t) {
|
|
649
|
-
return t.oneOf.map((r) => ce(e, r)).reduce((r, a) =>
|
|
649
|
+
return t.oneOf.map((r) => ce(e, r)).reduce((r, a) => D(r) ? a : W(r) && W(a) ? Ln(r, a) : D(a) ? r : a, null);
|
|
650
650
|
}
|
|
651
651
|
function Ln(e, t) {
|
|
652
652
|
return Object.keys(t).reduce((r, a) => {
|
|
@@ -656,11 +656,11 @@ var require_main_min = __commonJS({
|
|
|
656
656
|
}
|
|
657
657
|
var Et = (e, t) => W(e) ? ce(e, t) : Ra(e) ? fl(e, t) : We(e, t);
|
|
658
658
|
function We(e, t) {
|
|
659
|
-
if (
|
|
659
|
+
if (D(e))
|
|
660
660
|
return null;
|
|
661
661
|
if (t.oneOf)
|
|
662
662
|
return An(e, t);
|
|
663
|
-
if (!
|
|
663
|
+
if (!Z(t.const) && e === t.const)
|
|
664
664
|
return e;
|
|
665
665
|
if (t.type)
|
|
666
666
|
switch (t.type) {
|
|
@@ -677,42 +677,42 @@ var require_main_min = __commonJS({
|
|
|
677
677
|
return null;
|
|
678
678
|
}
|
|
679
679
|
function ce(e, t) {
|
|
680
|
-
return Ve(t) || je(t) ||
|
|
680
|
+
return Ve(t) || je(t) || D(e) ? null : t.allOf ? In(e, t) : t.oneOf ? Dn(e, t) : !Z(t.const) && e === t.const ? e : Le(t) ? En(e, t) : null;
|
|
681
681
|
}
|
|
682
682
|
function fl(e, t) {
|
|
683
683
|
return ge(t) ? On(e, t) : je(t) ? Ta(e, t) : null;
|
|
684
684
|
}
|
|
685
685
|
function er(e, t = false) {
|
|
686
|
-
return !t || !
|
|
686
|
+
return !t || !Z(e);
|
|
687
687
|
}
|
|
688
688
|
function Tn(e, t = false) {
|
|
689
|
-
return !t ||
|
|
689
|
+
return !t || V(e);
|
|
690
690
|
}
|
|
691
691
|
function Rn(e, t) {
|
|
692
|
-
return !
|
|
692
|
+
return !j(t) || L(e) && e.length >= t;
|
|
693
693
|
}
|
|
694
694
|
function Nn(e, t) {
|
|
695
|
-
return !
|
|
695
|
+
return !j(t) || L(e) && e.length <= t;
|
|
696
696
|
}
|
|
697
697
|
function Bn(e, t) {
|
|
698
698
|
return t === void 0 ? true : e == null ? false : !!new RegExp(t).test(e);
|
|
699
699
|
}
|
|
700
700
|
function Na(e, t) {
|
|
701
|
-
return !
|
|
701
|
+
return !j(t) && !L(t) || (j(e) || L(e)) && e <= t;
|
|
702
702
|
}
|
|
703
703
|
function Ba(e, t) {
|
|
704
|
-
return !
|
|
704
|
+
return !j(t) && !L(t) || (j(e) || L(e)) && e >= t;
|
|
705
705
|
}
|
|
706
706
|
function zn(e, t) {
|
|
707
|
-
return !
|
|
707
|
+
return !j(t) || V(e) && e.length >= t;
|
|
708
708
|
}
|
|
709
709
|
function jn(e, t) {
|
|
710
|
-
return !
|
|
710
|
+
return !j(t) || V(e) && e.length <= t;
|
|
711
711
|
}
|
|
712
712
|
function _e(e, t, r) {
|
|
713
713
|
if (t.const)
|
|
714
714
|
return Ua(e, t, r);
|
|
715
|
-
if (
|
|
715
|
+
if (D(e))
|
|
716
716
|
return r ? ["required"] : [];
|
|
717
717
|
if (Dr(t))
|
|
718
718
|
return za(e, t, r);
|
|
@@ -732,7 +732,7 @@ var require_main_min = __commonJS({
|
|
|
732
732
|
}
|
|
733
733
|
}
|
|
734
734
|
function za(e, t, r) {
|
|
735
|
-
if (!L(e) && !
|
|
735
|
+
if (!L(e) && !D(e))
|
|
736
736
|
return ["type"];
|
|
737
737
|
if (e === "" && r)
|
|
738
738
|
return ["required"];
|
|
@@ -740,7 +740,7 @@ var require_main_min = __commonJS({
|
|
|
740
740
|
return er(e, r) || a.push("required"), Rn(e, t.minLength) || a.push("minLength"), Nn(e, t.maxLength) || a.push("maxLength"), Bn(e, t.pattern) || a.push("pattern"), Ba(e, t.minimum) || a.push("minimum"), Na(e, t.maximum) || a.push("maximum"), a;
|
|
741
741
|
}
|
|
742
742
|
function Ir(e, t, r) {
|
|
743
|
-
if (!
|
|
743
|
+
if (!j(e) && !D(e))
|
|
744
744
|
return ["type"];
|
|
745
745
|
let a = [];
|
|
746
746
|
return er(e, r) || a.push("required"), Ba(e, t.minimum) || a.push("minimum"), Na(e, t.maximum) || a.push("maximum"), a;
|
|
@@ -749,7 +749,7 @@ var require_main_min = __commonJS({
|
|
|
749
749
|
return vn(e) ? Ir(e, t, r) : ["type"];
|
|
750
750
|
}
|
|
751
751
|
function Va(e, t, r) {
|
|
752
|
-
if (!Ie(e) && !
|
|
752
|
+
if (!Ie(e) && !D(e))
|
|
753
753
|
return ["type"];
|
|
754
754
|
let a = [];
|
|
755
755
|
return er(e, r) || a.push("required"), a;
|
|
@@ -758,7 +758,7 @@ var require_main_min = __commonJS({
|
|
|
758
758
|
return er(e, r) ? e !== t.const ? ["const"] : [] : ["required"];
|
|
759
759
|
}
|
|
760
760
|
function It(e, t, r) {
|
|
761
|
-
if (!
|
|
761
|
+
if (!V(e) && !D(e))
|
|
762
762
|
return ["type"];
|
|
763
763
|
if (!Tn(e, r))
|
|
764
764
|
return ["required"];
|
|
@@ -766,10 +766,10 @@ var require_main_min = __commonJS({
|
|
|
766
766
|
return zn(e, t.minItems) || a.push("minItems"), jn(e, t.maxItems) || a.push("maxItems"), a;
|
|
767
767
|
}
|
|
768
768
|
function Vn(e, t) {
|
|
769
|
-
return
|
|
769
|
+
return D(e) ? ["type"] : [];
|
|
770
770
|
}
|
|
771
771
|
function hl(e, t) {
|
|
772
|
-
return W(e) ?
|
|
772
|
+
return W(e) ? V(t.required) ? t.required.map((a) => typeof e[a] != "undefined").reduce((a, o) => a && o, true) ? [] : ["required"] : [] : ["type"];
|
|
773
773
|
}
|
|
774
774
|
function gl(e, t) {
|
|
775
775
|
return !za(e, t).length;
|
|
@@ -796,10 +796,10 @@ var require_main_min = __commonJS({
|
|
|
796
796
|
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);
|
|
797
797
|
}
|
|
798
798
|
function Al(e, t) {
|
|
799
|
-
return
|
|
799
|
+
return V(t.oneOf) ? t.oneOf.some((r) => G(e, r)) : false;
|
|
800
800
|
}
|
|
801
801
|
function Ol(e, t) {
|
|
802
|
-
return
|
|
802
|
+
return V(t.allOf) ? t.allOf.map((r) => G(e, r)).every((r) => r) : false;
|
|
803
803
|
}
|
|
804
804
|
function Pl(e, t) {
|
|
805
805
|
return !Vn(e, t).length;
|
|
@@ -838,7 +838,7 @@ var require_main_min = __commonJS({
|
|
|
838
838
|
if (!e)
|
|
839
839
|
return null;
|
|
840
840
|
let [t, r, a] = e.split("-").map((o) => parseInt(o, 10));
|
|
841
|
-
return !
|
|
841
|
+
return !j(t) || !j(r) || !j(a) ? null : new Date(t, r - 1, a);
|
|
842
842
|
};
|
|
843
843
|
var Hn = (e) => Ml(e);
|
|
844
844
|
var Ke = (e, t) => {
|
|
@@ -879,7 +879,7 @@ var require_main_min = __commonJS({
|
|
|
879
879
|
}
|
|
880
880
|
var Te = (e = "") => `${e ? `${e}-` : ""}${Math.floor(1e8 * Math.random())}`;
|
|
881
881
|
function we(e) {
|
|
882
|
-
return !
|
|
882
|
+
return !Z(e == null ? void 0 : e.const);
|
|
883
883
|
}
|
|
884
884
|
function tr(e) {
|
|
885
885
|
return !!e && !we(e);
|
|
@@ -950,12 +950,12 @@ var require_main_min = __commonJS({
|
|
|
950
950
|
};
|
|
951
951
|
var Rr = (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);
|
|
952
952
|
var W = (e) => typeof e == "object" && e !== null && e.constructor === Object;
|
|
953
|
-
var Ga = (e) =>
|
|
954
|
-
var $a = (e) => Ie(e) ||
|
|
955
|
-
var Nr = (e) => L(e) ||
|
|
956
|
-
var Ra = (e) =>
|
|
957
|
-
var Jn = (e) =>
|
|
958
|
-
var rr = (e) => L(e) ||
|
|
953
|
+
var Ga = (e) => D(e) || W(e);
|
|
954
|
+
var $a = (e) => Ie(e) || j(e) || L(e) || D(e);
|
|
955
|
+
var Nr = (e) => L(e) || D(e);
|
|
956
|
+
var Ra = (e) => V(e) ? e.length === 0 ? true : e.every((t) => typeof t == "string" || typeof t == "number" || typeof t == "boolean" || typeof t == "object") : false;
|
|
957
|
+
var Jn = (e) => D(e) ? true : Ra(e);
|
|
958
|
+
var rr = (e) => L(e) || D(e);
|
|
959
959
|
var Xn = () => jl() && (Vl() || zl());
|
|
960
960
|
var zl = (e = window.navigator.userAgent) => /mobi|\b(iphone|android|blackberry|webos|windows phone)\b/i.test(e);
|
|
961
961
|
var jl = (e = window.screen.width, t = window.screen.height) => e < 768 || t < 768;
|
|
@@ -1102,7 +1102,7 @@ var require_main_min = __commonJS({
|
|
|
1102
1102
|
}
|
|
1103
1103
|
return null;
|
|
1104
1104
|
};
|
|
1105
|
-
var
|
|
1105
|
+
var U = (e) => {
|
|
1106
1106
|
switch (e) {
|
|
1107
1107
|
case "xs":
|
|
1108
1108
|
return "m-b-0";
|
|
@@ -1129,11 +1129,11 @@ var require_main_min = __commonJS({
|
|
|
1129
1129
|
return "";
|
|
1130
1130
|
}
|
|
1131
1131
|
};
|
|
1132
|
-
var Se = (e) => `${Jl(e.align)} ${
|
|
1132
|
+
var Se = (e) => `${Jl(e.align)} ${U(e.margin)}`;
|
|
1133
1133
|
var yi = require("react/jsx-runtime");
|
|
1134
1134
|
var Xl = (e) => {
|
|
1135
1135
|
let t = e.component;
|
|
1136
|
-
return (0, yi.jsx)(pi.Alert, { type: Zl(Yl(t.context)), className:
|
|
1136
|
+
return (0, yi.jsx)(pi.Alert, { type: Zl(Yl(t.context)), className: U(t.margin), message: t.markdown });
|
|
1137
1137
|
};
|
|
1138
1138
|
var Yl = (e) => {
|
|
1139
1139
|
switch (e) {
|
|
@@ -1154,7 +1154,7 @@ var require_main_min = __commonJS({
|
|
|
1154
1154
|
var se = Xl;
|
|
1155
1155
|
var pt = require("react/jsx-runtime");
|
|
1156
1156
|
var Ql = (e) => {
|
|
1157
|
-
let t = e.component, r =
|
|
1157
|
+
let t = e.component, r = U(t.margin || t.border ? "lg" : "xs");
|
|
1158
1158
|
return !t.width || t.width === "xl" ? (0, pt.jsx)("div", { className: r + fi(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 + ed(t), children: (0, pt.jsx)("div", { className: fi(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 }) }) }) });
|
|
1159
1159
|
};
|
|
1160
1160
|
var fi = (e) => e ? " well p-b-0" : "";
|
|
@@ -1205,14 +1205,14 @@ var require_main_min = __commonJS({
|
|
|
1205
1205
|
var Ci = require("react/jsx-runtime");
|
|
1206
1206
|
function od(e) {
|
|
1207
1207
|
var d;
|
|
1208
|
-
let { component: t, onAction: r } = e, a = t.action, o = gi(t), n = hi(t), { loading: i } = At(), c =
|
|
1208
|
+
let { component: t, onAction: r } = e, a = t.action, o = gi(t), n = hi(t), { loading: i } = At(), c = U(t.margin || "md");
|
|
1209
1209
|
return (0, Ci.jsx)(Si.Button, { size: wi(t.size), type: n === "tertiary" ? void 0 : o, priority: n, block: true, className: c, disabled: i || t.disabled || a.disabled, onClick: () => r(a), children: (d = t.title) != null ? d : a.title });
|
|
1210
1210
|
}
|
|
1211
1211
|
var Xa = od;
|
|
1212
1212
|
var yt = require("react/jsx-runtime");
|
|
1213
1213
|
var nd = (e) => {
|
|
1214
1214
|
let t = e.component, { leftWidth: r, rightWidth: a } = id(t.bias);
|
|
1215
|
-
return (0, yt.jsxs)("div", { className: `${
|
|
1215
|
+
return (0, yt.jsxs)("div", { className: `${U(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 }) })] });
|
|
1216
1216
|
};
|
|
1217
1217
|
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" };
|
|
1218
1218
|
var Ya = nd;
|
|
@@ -1220,12 +1220,12 @@ var require_main_min = __commonJS({
|
|
|
1220
1220
|
var Gr = require("react/jsx-runtime");
|
|
1221
1221
|
function sd({ component: e, onAction: t }) {
|
|
1222
1222
|
let { loading: r } = At();
|
|
1223
|
-
return (0, Gr.jsx)("div", { className:
|
|
1223
|
+
return (0, Gr.jsx)("div", { className: U(e.margin), children: (0, Gr.jsx)($r.NavigationOptionsList, { children: e.options.map((a) => (0, Gr.jsx)($r.NavigationOption, { title: a.title, content: a.description, disabled: r || a.disabled, media: ut(a), showMediaCircle: false, showMediaAtAllSizes: true, onClick: () => t(a.action) }, JSON.stringify(a))) }) });
|
|
1224
1224
|
}
|
|
1225
1225
|
var Za = sd;
|
|
1226
1226
|
var Fi = require("react/jsx-runtime");
|
|
1227
1227
|
var cd = ({ component: e }) => {
|
|
1228
|
-
let r = `m-t-0 ${
|
|
1228
|
+
let r = `m-t-0 ${U(e.margin)}`;
|
|
1229
1229
|
return (0, Fi.jsx)("hr", { className: r });
|
|
1230
1230
|
};
|
|
1231
1231
|
var Qa = cd;
|
|
@@ -1317,27 +1317,27 @@ var require_main_min = __commonJS({
|
|
|
1317
1317
|
}
|
|
1318
1318
|
var ft = require("react/jsx-runtime");
|
|
1319
1319
|
function qi(e) {
|
|
1320
|
-
var
|
|
1321
|
-
let { onChange: t, schema: r } = e, a = re(), o = Vi(r), n = (0, sr.useMemo)(() => r.$id || Te(), [r.$id]), [i, c] = (0, sr.useState)(false), [d, m] = (0, sr.useState)(() => yd(e.model || [])), p = Gi(r.items.persistAsync), h = r.items.persistAsync.schema, y = Dt(h), u = async (
|
|
1320
|
+
var k, I;
|
|
1321
|
+
let { onChange: t, schema: r } = e, a = re(), o = Vi(r), n = (0, sr.useMemo)(() => r.$id || Te(), [r.$id]), [i, c] = (0, sr.useState)(false), [d, m] = (0, sr.useState)(() => yd(e.model || [])), p = Gi(r.items.persistAsync), h = r.items.persistAsync.schema, y = Dt(h), u = async (O) => {
|
|
1322
1322
|
c(true);
|
|
1323
1323
|
try {
|
|
1324
|
-
let
|
|
1324
|
+
let P = await Di(O, y);
|
|
1325
1325
|
a("Dynamic Flow - PersistAsync", { status: "pending", schemaId: r.$id });
|
|
1326
|
-
let
|
|
1327
|
-
return a("Dynamic Flow - PersistAsync", { status: "success", schemaId: r.$id }), Li(
|
|
1328
|
-
} catch (
|
|
1329
|
-
return a("Dynamic Flow - PersistAsync", { status: "failure", schemaId: r.$id }), Promise.reject(Ti(
|
|
1326
|
+
let B = await p(P);
|
|
1327
|
+
return a("Dynamic Flow - PersistAsync", { status: "success", schemaId: r.$id }), Li(B);
|
|
1328
|
+
} catch (P) {
|
|
1329
|
+
return a("Dynamic Flow - PersistAsync", { status: "failure", schemaId: r.$id }), Promise.reject(Ti(P));
|
|
1330
1330
|
}
|
|
1331
1331
|
};
|
|
1332
|
-
function l(
|
|
1333
|
-
if ($n(
|
|
1332
|
+
function l(O) {
|
|
1333
|
+
if ($n(O, d))
|
|
1334
1334
|
return;
|
|
1335
|
-
m(
|
|
1336
|
-
let
|
|
1337
|
-
t({ model:
|
|
1335
|
+
m(O);
|
|
1336
|
+
let B = Ui(O).map((_) => _.id);
|
|
1337
|
+
t({ model: B, triggerSchema: r, triggerModel: B });
|
|
1338
1338
|
}
|
|
1339
|
-
let
|
|
1340
|
-
return (0, ft.jsxs)("div", { className: (0, Hi.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)(Kr.UploadInput, s({},
|
|
1339
|
+
let g = Ui(d).map((O) => O.id), C = It(g, r, e.required), F = !!e.errors || (i || e.submitted) && !!C.length, w = "accepts" in h && h.accepts, A = "maxSize" in h && h.maxSize, M = S(s(s({ multiple: true, className: "form-control", files: d, fileInputName: n, id: n }, w ? { fileTypes: w } : void 0), A ? { sizeLimit: Lr(A) } : void 0), { sizeLimitErrorMessage: ((k = h.validationMessages) == null ? void 0 : k.maxSize) || o.maxFileSizeErrorMessage, maxFiles: e.schema.maxItems, maxFilesErrorMessage: ((I = e.schema.validationMessages) == null ? void 0 : I.maxItems) || o.maxItemsErrorMessage, uploadButtonTitle: h.title, description: h.description, disabled: e.disabled, onUploadFile: (O) => u(O.get(n)), onFilesChange: l, onDeleteFile: () => Promise.resolve() }), x = `${n}-feedback`;
|
|
1340
|
+
return (0, ft.jsxs)("div", { className: (0, Hi.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)(Kr.UploadInput, s({}, M)) }), (0, ft.jsx)(He, { id: x, changed: i, submitted: e.submitted, errors: e.errors, schema: e.schema, validations: C, validationMessages: hd(r, !!e.required, o), infoMessage: null, focused: false, blurred: true })] });
|
|
1341
1341
|
}
|
|
1342
1342
|
qi.defaultProps = { errors: null, required: false };
|
|
1343
1343
|
var ao = qi;
|
|
@@ -1348,7 +1348,7 @@ var require_main_min = __commonJS({
|
|
|
1348
1348
|
return e.map((t) => fd(t) ? { id: t, status: Kr.Status.SUCCEEDED } : null).filter((t) => t !== null);
|
|
1349
1349
|
}
|
|
1350
1350
|
function fd(e) {
|
|
1351
|
-
return
|
|
1351
|
+
return j(e) || L(e);
|
|
1352
1352
|
}
|
|
1353
1353
|
function hd(e, t, r) {
|
|
1354
1354
|
let { minItems: a, maxItems: o } = e;
|
|
@@ -1383,10 +1383,10 @@ var require_main_min = __commonJS({
|
|
|
1383
1383
|
if (a >= 0)
|
|
1384
1384
|
return a;
|
|
1385
1385
|
}
|
|
1386
|
-
return mt(e) && W(t) && Object.keys(t).length >= 1 ? Nt(e, t) : mt(e) && !
|
|
1386
|
+
return mt(e) && W(t) && Object.keys(t).length >= 1 ? Nt(e, t) : mt(e) && !Z(e.default) && W(e.default) && Object.keys(e.default).length >= 1 ? Nt(e, e.default) : null;
|
|
1387
1387
|
};
|
|
1388
1388
|
var cr = (e, t) => {
|
|
1389
|
-
let r = (a) => !
|
|
1389
|
+
let r = (a) => !Z(t) && G(t, a);
|
|
1390
1390
|
return e.oneOf.filter(r).length === 1 ? e.oneOf.findIndex(r) : -1;
|
|
1391
1391
|
};
|
|
1392
1392
|
function Nt(e, t) {
|
|
@@ -1460,27 +1460,27 @@ var require_main_min = __commonJS({
|
|
|
1460
1460
|
var Fe = require("react/jsx-runtime");
|
|
1461
1461
|
function xd({ schema: e, model: t, errors: r, submitted: a, onChange: o }) {
|
|
1462
1462
|
let [n, i] = (0, Yr.useState)(null), [c, d] = (0, Yr.useState)(() => {
|
|
1463
|
-
if (R(t) && !
|
|
1463
|
+
if (R(t) && !V(t))
|
|
1464
1464
|
throw new Error("RepeatableSchema does not support object models. Ensure your array schema is wrapped inside an object schema.");
|
|
1465
1465
|
return t ? t.map((C) => oo(e.items, C, e == null ? void 0 : e.summary)) : null;
|
|
1466
1466
|
}), [m, p] = (0, Yr.useState)({ item: null, model: null }), h = (C) => {
|
|
1467
|
-
let F = C ? C.map(({ value:
|
|
1467
|
+
let F = C ? C.map(({ value: w }) => w) : null;
|
|
1468
1468
|
o({ model: F, triggerSchema: e.items, triggerModel: F });
|
|
1469
1469
|
}, y = () => {
|
|
1470
1470
|
i("add");
|
|
1471
1471
|
}, u = (C) => {
|
|
1472
1472
|
p({ item: C, model: C.value }), i("edit");
|
|
1473
1473
|
}, l = (C) => {
|
|
1474
|
-
var
|
|
1474
|
+
var A;
|
|
1475
1475
|
let F = C === "remove" ? null : oo(e.items, m.model, e == null ? void 0 : e.summary);
|
|
1476
|
-
if (C !== "remove" && !G((
|
|
1476
|
+
if (C !== "remove" && !G((A = F == null ? void 0 : F.value) != null ? A : null, e.items))
|
|
1477
1477
|
return;
|
|
1478
|
-
let
|
|
1479
|
-
d(
|
|
1478
|
+
let w = vd(C, { originalItem: m.item, updatedItem: F, itemSummaries: c });
|
|
1479
|
+
d(w), h(w), p({ item: null, model: null }), i(null);
|
|
1480
1480
|
}, f = () => {
|
|
1481
1481
|
p({ item: null, model: null }), i(null);
|
|
1482
|
-
}, { formatMessage:
|
|
1483
|
-
return (0, Fe.jsxs)(Fe.Fragment, { children: [e.title && (0, Fe.jsx)(Bt.Header, { title: e.title }), c && c.map((C) => (0, Fe.jsx)(Wi, { item: C, onClick: () => u(C) }, JSON.stringify(C))), (0, Fe.jsx)(Bt.NavigationOption, { media: (0, Fe.jsx)(Qi.Plus, {}), title: e.addItemTitle ||
|
|
1482
|
+
}, { formatMessage: g } = (0, es.useIntl)();
|
|
1483
|
+
return (0, Fe.jsxs)(Fe.Fragment, { children: [e.title && (0, Fe.jsx)(Bt.Header, { title: e.title }), c && c.map((C) => (0, Fe.jsx)(Wi, { item: C, onClick: () => u(C) }, JSON.stringify(C))), (0, Fe.jsx)(Bt.NavigationOption, { media: (0, Fe.jsx)(Qi.Plus, {}), title: e.addItemTitle || g(ht.addItemTitle), showMediaAtAllSizes: true, onClick: y }), (0, Fe.jsx)(Bt.Modal, { open: n !== null, title: (n === "add" ? e.addItemTitle : e.editItemTitle) || g(ht.addItemTitle), body: (0, Fe.jsx)(Xi, { type: n != null ? n : "add", schema: e, model: m.model, errors: r, submitted: a, onAction: l, onModelChange: ({ model: C }) => p(S(s({}, m), { model: C })) }), onClose: f })] });
|
|
1484
1484
|
}
|
|
1485
1485
|
var vd = (e, { originalItem: t, updatedItem: r, itemSummaries: a }) => {
|
|
1486
1486
|
if (e === "remove")
|
|
@@ -1549,11 +1549,11 @@ var require_main_min = __commonJS({
|
|
|
1549
1549
|
}
|
|
1550
1550
|
var qe = Od;
|
|
1551
1551
|
var ws = require("react");
|
|
1552
|
-
var
|
|
1552
|
+
var K = require("@transferwise/components");
|
|
1553
1553
|
var fs = require("react");
|
|
1554
1554
|
var zt = (e, t = {}) => {
|
|
1555
1555
|
let { coerceValue: r = false } = t;
|
|
1556
|
-
if (!
|
|
1556
|
+
if (!D(e)) {
|
|
1557
1557
|
if (R(e)) {
|
|
1558
1558
|
gt({ received: "object", expected: "string" });
|
|
1559
1559
|
return;
|
|
@@ -1569,9 +1569,9 @@ var require_main_min = __commonJS({
|
|
|
1569
1569
|
};
|
|
1570
1570
|
var co = (e, t = {}) => {
|
|
1571
1571
|
let { coerceValue: r = false } = t;
|
|
1572
|
-
if (
|
|
1572
|
+
if (D(e))
|
|
1573
1573
|
return;
|
|
1574
|
-
if (
|
|
1574
|
+
if (j(e))
|
|
1575
1575
|
return e;
|
|
1576
1576
|
let a = { received: typeof e, expected: "string or number" };
|
|
1577
1577
|
if (R(e)) {
|
|
@@ -1588,7 +1588,7 @@ var require_main_min = __commonJS({
|
|
|
1588
1588
|
};
|
|
1589
1589
|
var ds = (e, t = {}) => {
|
|
1590
1590
|
let { coerceValue: r = false } = t;
|
|
1591
|
-
if (
|
|
1591
|
+
if (D(e))
|
|
1592
1592
|
return false;
|
|
1593
1593
|
if (!Ie(e)) {
|
|
1594
1594
|
if (r)
|
|
@@ -1599,7 +1599,7 @@ var require_main_min = __commonJS({
|
|
|
1599
1599
|
return e;
|
|
1600
1600
|
};
|
|
1601
1601
|
var us = (e) => {
|
|
1602
|
-
if (!
|
|
1602
|
+
if (!D(e)) {
|
|
1603
1603
|
if (!(e instanceof Date) && !L(e)) {
|
|
1604
1604
|
gt({ received: typeof e, expected: "string or Date" });
|
|
1605
1605
|
return;
|
|
@@ -1608,7 +1608,7 @@ var require_main_min = __commonJS({
|
|
|
1608
1608
|
}
|
|
1609
1609
|
};
|
|
1610
1610
|
var ps = (e) => {
|
|
1611
|
-
if (
|
|
1611
|
+
if (D(e))
|
|
1612
1612
|
return null;
|
|
1613
1613
|
if (!L(e))
|
|
1614
1614
|
return gt({ received: typeof e, expected: "string", fallback: "null" }), null;
|
|
@@ -1626,13 +1626,13 @@ var require_main_min = __commonJS({
|
|
|
1626
1626
|
return t.length === 0 ? "off" : t.map((r) => ys[r]).join(" ");
|
|
1627
1627
|
};
|
|
1628
1628
|
var ys = { on: "on", name: "name", "name-prefix": "honorific-prefix", "given-name": "given-name", "additional-name": "additional-name", "family-name": "family-name", "name-suffix": "honorific-suffix", nickname: "nickname", email: "email", "new-username": "username", username: "username", "new-password": "new-password", password: "current-password", "one-time-code": "one-time-code", "job-title": "organization-title", "organization-name": "organization", "full-street-address": "street-address", "street-address-line-1": "address-line1", "street-address-line-2": "address-line2", "street-address-line-3": "address-line3", "address-level-1": "address-level1", "address-level-2": "address-level2", "address-level-3": "address-level3", "address-level-4": "address-level4", "country-code": "country", "country-name": "country-name", "postal-code": "postal-code", "credit-card-name": "cc-name", "credit-card-given-name": "cc-given-name", "credit-card-middle-name": "cc-additional-name", "credit-card-family-name": "cc-family-name", "credit-card-number": "cc-number", "credit-card-expiration": "cc-exp", "credit-card-expiration-month": "cc-exp-month", "credit-card-expiration-year": "cc-exp-year", "credit-card-security-code": "cc-csc", "credit-card-type": "cc-type", "transaction-currency": "transaction-currency", "transaction-amount": "transaction-amount", language: "language", birthdate: "bday", "birthdate-day": "bday-day", "birthdate-month": "bday-month", "birthdate-year": "bday-year", gender: "sex", "phone-number": "tel", "phone-country-code": "tel-country-code", "phone-national": "tel-national", "phone-area-code": "tel-area-code", "phone-local": "tel-local", "phone-local-prefix": "tel-local-prefix", "phone-local-suffix": "tel-local-suffix", "phone-extension": "tel-extension", url: "url", photo: "photo", impp: "impp", shipping: "shipping", billing: "billing", home: "home", work: "work", mobile: "mobile", fax: "fax", pager: "pager" };
|
|
1629
|
-
var
|
|
1629
|
+
var Q = require("react/jsx-runtime");
|
|
1630
1630
|
var be = class be extends fs.PureComponent {
|
|
1631
1631
|
constructor(r) {
|
|
1632
1632
|
super(r);
|
|
1633
1633
|
this.getAutocompleteValue = () => {
|
|
1634
1634
|
let { autoComplete: r2, autocompleteHint: a } = this.props;
|
|
1635
|
-
return
|
|
1635
|
+
return V(a) ? lo(a) : r2 === true ? "on" : "off";
|
|
1636
1636
|
};
|
|
1637
1637
|
this.handleOnChange = (r2) => {
|
|
1638
1638
|
this.props.onChange(r2);
|
|
@@ -1657,60 +1657,60 @@ var require_main_min = __commonJS({
|
|
|
1657
1657
|
if (this.props.value !== null && typeof this.props.value != "undefined")
|
|
1658
1658
|
return r2.find((a) => this.props.value === a.value);
|
|
1659
1659
|
};
|
|
1660
|
-
this.mapOption = (r2) => S(s({}, r2), { value:
|
|
1660
|
+
this.mapOption = (r2) => S(s({}, r2), { value: j(r2.value) || L(r2.value) ? r2.value : void 0, secondary: r2.note, disabled: r2.disabled || this.props.disabled, readOnly: this.props.readOnly });
|
|
1661
1661
|
this.state = { selectedOption: r.selectedOption, touched: false, prevValue: r.value };
|
|
1662
1662
|
}
|
|
1663
1663
|
static getDerivedStateFromProps(r, a) {
|
|
1664
1664
|
return a.prevValue !== r.value ? { prevValue: r.value, value: r.value } : null;
|
|
1665
1665
|
}
|
|
1666
1666
|
render() {
|
|
1667
|
-
var
|
|
1668
|
-
let { name: r, placeholder: a, step: o, countryCode: n, type: i, options: c, disabled: d, readOnly: m, required: p, minLength: h, maxLength: y, min: u, max: l, searchPlaceholder: f, searchValue:
|
|
1667
|
+
var _;
|
|
1668
|
+
let { name: r, placeholder: a, step: o, countryCode: n, type: i, options: c, disabled: d, readOnly: m, required: p, minLength: h, maxLength: y, min: u, max: l, searchPlaceholder: f, searchValue: g, onSearchChange: C, size: F, uploadProps: w, label: A, monthFormat: M, id: x, minDate: k, maxDate: I, value: O, mode: P, describedBy: B } = this.props;
|
|
1669
1669
|
switch (i) {
|
|
1670
1670
|
case N.RADIO:
|
|
1671
|
-
return (0,
|
|
1671
|
+
return (0, Q.jsx)(K.RadioGroup, { radios: c.map(this.mapOption), name: r, selectedValue: co(O, { coerceValue: true }), onChange: this.handleOnChange });
|
|
1672
1672
|
case N.CHECKBOX:
|
|
1673
|
-
return (0,
|
|
1673
|
+
return (0, Q.jsx)(K.Checkbox, { checked: ds(O, { coerceValue: true }), disabled: d, label: A, required: p, readOnly: m, onChange: this.handleOnChange, onBlur: this.handleOnBlur, onFocus: this.handleOnFocus });
|
|
1674
1674
|
case N.SELECT: {
|
|
1675
|
-
let
|
|
1676
|
-
return (0,
|
|
1677
|
-
var
|
|
1678
|
-
this.setState({ selectedOption:
|
|
1679
|
-
}, onFocus: this.handleOnFocus, onBlur: this.handleOnBlur, onSearchChange:
|
|
1675
|
+
let v = c.length >= 20;
|
|
1676
|
+
return (0, Q.jsx)(K.Select, { id: x, selected: this.getSelectedOption(c), options: c, search: v, required: p, disabled: d, placeholder: a, searchPlaceholder: f, searchValue: g, onChange: (z) => {
|
|
1677
|
+
var E;
|
|
1678
|
+
this.setState({ selectedOption: z != null ? z : void 0 }), this.props.onChange((E = z == null ? void 0 : z.value) != null ? E : null);
|
|
1679
|
+
}, onFocus: this.handleOnFocus, onBlur: this.handleOnBlur, onSearchChange: v ? C : void 0 });
|
|
1680
1680
|
}
|
|
1681
1681
|
case N.TAB:
|
|
1682
|
-
return (0,
|
|
1683
|
-
let
|
|
1684
|
-
this.setState({ selectedOption: c.find((
|
|
1682
|
+
return (0, Q.jsx)(K.Tabs, { selected: ((_ = this.getSelectedOption(c)) == null ? void 0 : _.value) || 0, tabs: c.map((v) => ({ title: v.label, content: (0, Q.jsx)(Q.Fragment, {}), disabled: v.disabled || false })), name: x, onTabSelect: (v) => {
|
|
1683
|
+
let z = !!this.state.selectedOption;
|
|
1684
|
+
this.setState({ selectedOption: c.find((E) => E.value === v) }), this.props.onChange(v, z ? "user" : "init");
|
|
1685
1685
|
} });
|
|
1686
1686
|
case N.NUMERIC:
|
|
1687
1687
|
case N.NUMBER:
|
|
1688
|
-
return (0,
|
|
1689
|
-
i === N.NUMERIC ? this.props.onChange(
|
|
1690
|
-
}, onFocus: this.handleOnFocus, onWheel: (
|
|
1691
|
-
|
|
1692
|
-
}, "aria-describedby":
|
|
1688
|
+
return (0, Q.jsx)("input", { autoComplete: this.getAutocompleteValue(), className: "form-control", disabled: d, id: x, max: l, min: u, placeholder: a, readOnly: m, required: p, step: o, type: "number", value: co(O, { coerceValue: true }), onBlur: this.handleOnBlur, onChange: (v) => {
|
|
1689
|
+
i === N.NUMERIC ? this.props.onChange(v.target.value) : this.props.onChange(parseFloat(v.target.value));
|
|
1690
|
+
}, onFocus: this.handleOnFocus, onWheel: (v) => {
|
|
1691
|
+
v.target instanceof HTMLElement && v.target.blur();
|
|
1692
|
+
}, "aria-describedby": B });
|
|
1693
1693
|
case N.HIDDEN:
|
|
1694
|
-
return (0,
|
|
1694
|
+
return (0, Q.jsx)("input", { type: "hidden", name: r, value: zt(O, { coerceValue: true }), id: x });
|
|
1695
1695
|
case N.PASSWORD:
|
|
1696
|
-
return (0,
|
|
1696
|
+
return (0, Q.jsx)("input", { autoComplete: this.getAutocompleteValue(), className: "form-control", disabled: d, id: x, placeholder: a, readOnly: m, required: p, type: "password", value: zt(O, { coerceValue: true }), onBlur: this.handleOnBlur, onChange: this.handleInputOnChange, onFocus: this.handleOnFocus, "aria-describedby": B });
|
|
1697
1697
|
case N.DATE:
|
|
1698
1698
|
case N.DATETIME:
|
|
1699
|
-
return (0,
|
|
1699
|
+
return (0, Q.jsx)(K.DateInput, { disabled: d, size: F, value: us(O), mode: P, monthFormat: M, onBlur: this.handleOnBlur, onChange: this.handleOnChange, onFocus: this.handleOnFocus });
|
|
1700
1700
|
case N.DATELOOKUP:
|
|
1701
|
-
return (0,
|
|
1702
|
-
this.handleOnChange(Hn(
|
|
1701
|
+
return (0, Q.jsx)(K.DateLookup, { value: ps(O), min: k, max: I, placeholder: a, monthFormat: M, disabled: d, onChange: (v) => {
|
|
1702
|
+
this.handleOnChange(Hn(v));
|
|
1703
1703
|
}, onBlur: this.handleOnBlur, onFocus: this.handleOnFocus });
|
|
1704
1704
|
case N.TEL:
|
|
1705
|
-
return (0,
|
|
1705
|
+
return (0, Q.jsx)(K.PhoneNumberInput, { disabled: d, countryCode: n, placeholder: a, required: p, searchPlaceholder: f, size: F, initialValue: zt(O), onBlur: this.handleOnBlur, onChange: this.handleOnChange, onFocus: this.handleOnFocus });
|
|
1706
1706
|
case N.TEXTAREA: {
|
|
1707
|
-
let
|
|
1708
|
-
return this.props.displayPattern ? (0,
|
|
1707
|
+
let v = { className: "form-control tw-form-control", id: x, name: r, placeholder: a, value: zt(O, { coerceValue: true }), readOnly: m, required: p, minLength: h, maxLength: y, onFocus: this.handleOnFocus, onBlur: this.handleOnBlur, disabled: d, autoComplete: this.getAutocompleteValue() };
|
|
1708
|
+
return this.props.displayPattern ? (0, Q.jsx)(K.TextareaWithDisplayFormat, S(s({ displayPattern: this.props.displayPattern }, v), { onChange: this.handleOnChange })) : (0, Q.jsx)("textarea", S(s({}, v), { onChange: this.handleInputOnChange, "aria-describedby": B }));
|
|
1709
1709
|
}
|
|
1710
1710
|
case N.FILE:
|
|
1711
1711
|
case N.UPLOAD:
|
|
1712
|
-
return (0,
|
|
1713
|
-
this.handleOnChange(
|
|
1712
|
+
return (0, Q.jsx)(K.Upload, S(s({}, w), { usAccept: w.usAccept || "*", usDisabled: w.usDisabled || d, onSuccess: (v) => {
|
|
1713
|
+
this.handleOnChange(v);
|
|
1714
1714
|
}, onFailure: () => {
|
|
1715
1715
|
this.handleOnChange(null);
|
|
1716
1716
|
}, onCancel: () => {
|
|
@@ -1719,8 +1719,8 @@ var require_main_min = __commonJS({
|
|
|
1719
1719
|
case N.TEXT:
|
|
1720
1720
|
case N.EMAIL:
|
|
1721
1721
|
default: {
|
|
1722
|
-
let
|
|
1723
|
-
return this.props.displayPattern ? (0,
|
|
1722
|
+
let v = { type: i === N.EMAIL ? "email" : "text", className: "form-control", id: x, name: r, placeholder: a, value: zt(O, { coerceValue: true }), readOnly: m, required: p, minLength: h, maxLength: y, onFocus: this.handleOnFocus, onBlur: this.handleOnBlur, disabled: d, autoComplete: this.getAutocompleteValue() };
|
|
1723
|
+
return this.props.displayPattern ? (0, Q.jsx)(K.InputWithDisplayFormat, S(s({ displayPattern: this.props.displayPattern }, v), { onChange: this.handleOnChange })) : (0, Q.jsx)("input", S(s({}, v), { onChange: this.handleInputOnChange, "aria-describedby": B }));
|
|
1724
1724
|
}
|
|
1725
1725
|
}
|
|
1726
1726
|
}
|
|
@@ -1740,11 +1740,11 @@ var require_main_min = __commonJS({
|
|
|
1740
1740
|
};
|
|
1741
1741
|
var Pd = (e) => s(s(s({ label: e.title, value: e.const }, Ld(e.title, e.description)), Vt(e)), gs(e.disabled));
|
|
1742
1742
|
var Md = (e) => s(s(s(s(s({ label: e.title, value: e.const }, Dd(e.title, e.description)), Id(e.icon)), Ed(e.image)), gs(e.disabled)), kd(e.keywords));
|
|
1743
|
-
var kd = (e) =>
|
|
1743
|
+
var kd = (e) => V(e) ? { searchStrings: e } : {};
|
|
1744
1744
|
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;
|
|
1745
1745
|
var Id = (e) => e != null && e.name && Lt(e.name) ? { currency: e.name.substring(5) } : e != null && e.name && Ka(e.name) ? { icon: (0, xe.jsx)(Ye, { type: e.name }) } : e != null && e.text ? { icon: (0, xe.jsx)("span", { children: e.text }) } : null;
|
|
1746
1746
|
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 && Ka(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;
|
|
1747
|
-
var ta = ({ accepts: e }) => s({},
|
|
1747
|
+
var ta = ({ accepts: e }) => s({}, V(e) && { usAccept: e.join(",") });
|
|
1748
1748
|
var Dd = (e, t) => {
|
|
1749
1749
|
if (e && t)
|
|
1750
1750
|
return { [(e + t).length > 50 ? "secondary" : "note"]: t };
|
|
@@ -1754,7 +1754,7 @@ var require_main_min = __commonJS({
|
|
|
1754
1754
|
return { note: t };
|
|
1755
1755
|
};
|
|
1756
1756
|
var gs = (e) => {
|
|
1757
|
-
if (!
|
|
1757
|
+
if (!Z(e) && !D(e))
|
|
1758
1758
|
return { disabled: e };
|
|
1759
1759
|
};
|
|
1760
1760
|
var uo = require("react/jsx-runtime");
|
|
@@ -1765,51 +1765,51 @@ var require_main_min = __commonJS({
|
|
|
1765
1765
|
var Bd = { date: "date", email: "email", base64url: "file", password: "password", "phone-number": "tel" };
|
|
1766
1766
|
var zd = (e, t) => e.oneOf ? e.oneOf.map((r) => hs(r, t)) : null;
|
|
1767
1767
|
function Ss(e) {
|
|
1768
|
-
let { id: t, schema: r, value: a, disabled: o, onChange: n, onFocus: i, onBlur: c, onSearchChange: d, describedBy: m } = e, p = Mt(), h = (F) => Td(r.type) && (
|
|
1769
|
-
n(We(F, r),
|
|
1768
|
+
let { id: t, schema: r, value: a, disabled: o, onChange: n, onFocus: i, onBlur: c, onSearchChange: d, describedBy: m } = e, p = Mt(), h = (F) => Td(r.type) && (D(F) || Z(F)) ? "" : F, y = (F, w) => {
|
|
1769
|
+
n(We(F, r), w);
|
|
1770
1770
|
}, u = po(r);
|
|
1771
1771
|
(0, ws.useEffect)(() => {
|
|
1772
1772
|
jd(r, p, u);
|
|
1773
1773
|
}, [JSON.stringify(r), p, u]);
|
|
1774
|
-
let l = r.values || zd(r, u), f = { onFocus: i, onBlur: c, onSearchChange: d, onChange: y },
|
|
1775
|
-
return (0, uo.jsx)("div", { "aria-describedby": m, children: (0, uo.jsx)(jt, s(s({ type: u, value:
|
|
1774
|
+
let l = r.values || zd(r, u), f = { onFocus: i, onBlur: c, onSearchChange: d, onChange: y }, g = h(a), C = { id: t, name: t, label: r.title, options: l || [], placeholder: r.placeholder, autoComplete: !r.help, autocompleteHint: r.autocompleteHint, disabled: o || r.disabled, displayPattern: r.displayFormat, uploadProps: ta(r), describedBy: m };
|
|
1775
|
+
return (0, uo.jsx)("div", { "aria-describedby": m, children: (0, uo.jsx)(jt, s(s({ type: u, value: g }, f), C)) });
|
|
1776
1776
|
}
|
|
1777
1777
|
Ss.defaultProps = { value: null, onFocus: null, onBlur: null, onSearchChange: null, disabled: false };
|
|
1778
1778
|
var jd = (e, t, r) => {
|
|
1779
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.");
|
|
1780
1780
|
};
|
|
1781
1781
|
var lr = Ss;
|
|
1782
|
-
var
|
|
1782
|
+
var ee = require("react/jsx-runtime");
|
|
1783
1783
|
function bs(e) {
|
|
1784
|
-
let t = re(), [r, a] = (0, Ne.useState)(false), [o, n] = (0, Ne.useState)(false), [i, c] = (0, Ne.useState)(false), d = (0, Ne.useMemo)(() => e.schema.$id || Te(), [e.schema.$id]), [m, p] = (0, Ne.useState)(Xr(e.schema, e.model)), [h, y] = (0, Ne.useState)(qd(e.model, e.schema.oneOf)), u = Zn(t, 200), l = (
|
|
1785
|
-
u("Dynamic Flow - OneOf Searched", { oneOfId: e.schema.analyticsId, searchValueLength:
|
|
1784
|
+
let t = re(), [r, a] = (0, Ne.useState)(false), [o, n] = (0, Ne.useState)(false), [i, c] = (0, Ne.useState)(false), d = (0, Ne.useMemo)(() => e.schema.$id || Te(), [e.schema.$id]), [m, p] = (0, Ne.useState)(Xr(e.schema, e.model)), [h, y] = (0, Ne.useState)(qd(e.model, e.schema.oneOf)), u = Zn(t, 200), l = (k) => {
|
|
1785
|
+
u("Dynamic Flow - OneOf Searched", { oneOfId: e.schema.analyticsId, searchValueLength: k.length });
|
|
1786
1786
|
};
|
|
1787
1787
|
if ((0, Ne.useEffect)(() => {
|
|
1788
|
-
let
|
|
1789
|
-
|
|
1790
|
-
}, [e.schema]), !
|
|
1788
|
+
let k = cr(e.schema, e.model), I = cr(e.schema, e.schema.default);
|
|
1789
|
+
k === -1 && I >= 0 && F(I, "init");
|
|
1790
|
+
}, [e.schema]), !V(e.schema.oneOf))
|
|
1791
1791
|
return console.error("Incorrect format", e.schema), null;
|
|
1792
|
-
let f = (
|
|
1793
|
-
y([...h.slice(0,
|
|
1794
|
-
},
|
|
1792
|
+
let f = (k, I) => {
|
|
1793
|
+
y([...h.slice(0, k), I.model, ...h.slice(k + 1)]), a(true), e.onChange(I);
|
|
1794
|
+
}, g = () => {
|
|
1795
1795
|
n(true);
|
|
1796
1796
|
}, C = () => {
|
|
1797
1797
|
n(false), c(true);
|
|
1798
|
-
}, F = (
|
|
1799
|
-
p(
|
|
1800
|
-
let
|
|
1801
|
-
if (we(
|
|
1802
|
-
let
|
|
1803
|
-
e.onChange({ model:
|
|
1798
|
+
}, F = (k, I) => {
|
|
1799
|
+
p(k);
|
|
1800
|
+
let O = e.schema.oneOf[k];
|
|
1801
|
+
if (we(O)) {
|
|
1802
|
+
let P = O.const;
|
|
1803
|
+
e.onChange({ model: P, triggerSchema: e.schema, triggerModel: P, type: I });
|
|
1804
1804
|
} else
|
|
1805
|
-
e.onChange({ model: h[
|
|
1806
|
-
|
|
1807
|
-
},
|
|
1808
|
-
return (0,
|
|
1805
|
+
e.onChange({ model: h[k], triggerSchema: O, triggerModel: h[k], type: I });
|
|
1806
|
+
I !== "init" && e.schema.analyticsId && t("Dynamic Flow - OneOf Selected", { oneOfId: e.schema.analyticsId, schemaId: O == null ? void 0 : O.analyticsId });
|
|
1807
|
+
}, w = Gd(e.schema), A = Ud(e, m), M = { "form-group": true, "has-error": !r && e.errors && !kt(e.errors) || (e.submitted || r && i) && A.length }, x = `${d}-feedback`;
|
|
1808
|
+
return (0, ee.jsxs)(ee.Fragment, { children: [(e.schema.oneOf.length > 1 || we(e.schema.oneOf[0])) && (0, ee.jsxs)(ee.Fragment, { children: [e.schema.alert && (0, ee.jsx)(se, { component: e.schema.alert }), (0, ee.jsxs)("div", { className: (0, Fs.default)(M), children: [Vd(e.schema, d), (0, ee.jsx)(lr, { id: d, schema: w, value: m, disabled: e.disabled, describedBy: x, onChange: F, onFocus: g, onBlur: C, onSearchChange: l }), (0, ee.jsx)(He, { id: x, changed: r, focused: o, blurred: i, submitted: e.submitted, errors: Hd(e.errors), schema: e.schema, validations: A, infoMessage: null })] })] }), tr(e.schema.oneOf[m]) && (0, ee.jsx)(me, { schema: e.schema.oneOf[m], model: h[m], errors: e.errors, submitted: e.submitted, hideTitle: true, disabled: e.disabled, onChange: (k) => f(m, k), onPersistAsync: e.onPersistAsync })] });
|
|
1809
1809
|
}
|
|
1810
1810
|
function Vd(e, t) {
|
|
1811
1811
|
var o;
|
|
1812
|
-
let r = e.help ? (0,
|
|
1812
|
+
let r = e.help ? (0, ee.jsx)(qe, { help: e.help }) : null, a = we(e.oneOf[0]) ? (0, ee.jsx)("div", { className: "m-b-1", children: (0, ee.jsxs)("label", { className: "control-label d-inline", htmlFor: t, children: [e.title, " ", r] }) }) : (0, ee.jsx)(ee.Fragment, { children: r ? (0, ee.jsxs)("h4", { className: "m-b-2", children: [e.title, " ", r] }) : (0, ee.jsx)(Cs.Header, { title: (o = e.title) != null ? o : "" }) });
|
|
1813
1813
|
return e.title ? a : r;
|
|
1814
1814
|
}
|
|
1815
1815
|
function Ud(e, t) {
|
|
@@ -1837,28 +1837,28 @@ var require_main_min = __commonJS({
|
|
|
1837
1837
|
var xs = require("react");
|
|
1838
1838
|
var As = require("react/jsx-runtime");
|
|
1839
1839
|
function vs(e) {
|
|
1840
|
-
let { id: t, httpClient: r = fetch, httpOptions: a, fileId: o, idProperty: n, usAccept: i, maxSize: c, usPlaceholder: d, onSuccess: m, onFailure: p, onCancel: h } = e, y = re(), u = (0, xs.useMemo)(() => o ? [{ id: o, status: ra.Status.SUCCEEDED }] : [], [o]), l = (f) => (y("Dynamic Flow - PersistAsync", { status: "pending", schemaId: t }), r(String(a.url), { method: a.method || "POST", body: f }).then((
|
|
1840
|
+
let { id: t, httpClient: r = fetch, httpOptions: a, fileId: o, idProperty: n, usAccept: i, maxSize: c, usPlaceholder: d, onSuccess: m, onFailure: p, onCancel: h } = e, y = re(), u = (0, xs.useMemo)(() => o ? [{ id: o, status: ra.Status.SUCCEEDED }] : [], [o]), l = (f) => (y("Dynamic Flow - PersistAsync", { status: "pending", schemaId: t }), r(String(a.url), { method: a.method || "POST", body: f }).then((g) => g.ok ? (m == null || m(g.clone()), g.json().then((C) => ({ id: C[n] }))) : (p == null || p({ response: g }), Promise.reject())));
|
|
1841
1841
|
return (0, As.jsx)(ra.UploadInput, { id: t, fileInputName: a.fileInputName, files: u, uploadButtonTitle: e.usLabel, sizeLimit: c ? Lr(c) : void 0, fileTypes: i, description: d, onUploadFile: l, onDeleteFile: (f) => (h == null || h(), Promise.resolve()) });
|
|
1842
1842
|
}
|
|
1843
1843
|
var Ut = require("react/jsx-runtime");
|
|
1844
1844
|
function Ps(e) {
|
|
1845
|
-
let
|
|
1845
|
+
let { model: t, schema: r, submitted: a, required: o, errors: n, onChange: i } = e, [c, d] = (0, wt.useState)({}), [m, p] = (0, wt.useState)(null), [h, y] = (0, wt.useState)([]), [u, l] = (0, wt.useState)(false), f = ae(), g = re();
|
|
1846
1846
|
(0, wt.useEffect)(() => {
|
|
1847
|
-
|
|
1848
|
-
}, [
|
|
1849
|
-
let
|
|
1850
|
-
let
|
|
1851
|
-
|
|
1852
|
-
},
|
|
1853
|
-
if (
|
|
1854
|
-
let
|
|
1855
|
-
|
|
1847
|
+
y(a ? _e(t, r, !!o) : []);
|
|
1848
|
+
}, [t, r, a, o]);
|
|
1849
|
+
let C = async (P, B) => {
|
|
1850
|
+
let _ = await P.json(), v = go(r.persistAsync.idProperty, _);
|
|
1851
|
+
i({ model: v, triggerSchema: r, triggerModel: v }), l(true), g("Dynamic Flow - PersistAsync", { status: "success", schemaId: r.$id });
|
|
1852
|
+
}, F = async (P) => {
|
|
1853
|
+
if (P.response && Er(P.response.status)) {
|
|
1854
|
+
let B = await P.response.json();
|
|
1855
|
+
d(B.validation || {}), p([r.persistAsync.param]);
|
|
1856
1856
|
}
|
|
1857
|
-
|
|
1858
|
-
},
|
|
1859
|
-
|
|
1860
|
-
}, { url:
|
|
1861
|
-
return (0, Ut.jsxs)("div", { className: (0, Os.default)(
|
|
1857
|
+
i({ model: null, triggerSchema: r, triggerModel: null }), l(true), g("Dynamic Flow - PersistAsync", { status: "failure", schemaId: r.$id });
|
|
1858
|
+
}, w = () => {
|
|
1859
|
+
p(null), i({ model: null, triggerSchema: r, triggerModel: null }), l(true);
|
|
1860
|
+
}, { url: A, method: M } = r.persistAsync, x = m || h, k = { "form-group": true, "has-error": (a || u) && !!x.length }, I = r.$id || r.persistAsync.schema.$id || r.persistAsync.idProperty, O = `${I}-feedback`;
|
|
1861
|
+
return (0, Ut.jsxs)("div", { className: (0, Os.default)(k), children: [(0, Ut.jsx)("div", { "aria-describedby": O, children: (0, Ut.jsx)(vs, s({ id: I, fileId: t, idProperty: r.persistAsync.idProperty, animationDelay: 0, maxSize: r.persistAsync.schema.maxSize, usLabel: r.title || r.persistAsync.schema.title, usPlaceholder: r.description || r.persistAsync.schema.description, httpOptions: { url: A, method: M, fileInputName: r.persistAsync.param }, httpClient: f, onSuccess: C, onFailure: F, onCancel: w }, ta(r.persistAsync.schema))) }), (0, Ut.jsx)(He, { id: O, blurred: true, focused: false, changed: u, submitted: a, errors: n, schema: r, validations: x, validationMessages: s({ required: "Value is required..." }, c), infoMessage: null })] });
|
|
1862
1862
|
}
|
|
1863
1863
|
Ps.defaultProps = { required: false };
|
|
1864
1864
|
var ho = Ps;
|
|
@@ -1949,31 +1949,31 @@ var require_main_min = __commonJS({
|
|
|
1949
1949
|
var Be = require("react");
|
|
1950
1950
|
var qs = require("react/jsx-runtime");
|
|
1951
1951
|
function Hs(e) {
|
|
1952
|
-
let { schema: t, model: r, required: a, submitted: o, errors: n, onChange: i } = e, [c, d] = (0, Be.useState)(r), m = (0, Be.useRef)(null), [p, h] = (0, Be.useState)(null), [y, u] = (0, Be.useState)(null), [l, f] = (0, Be.useState)(false), [
|
|
1952
|
+
let { schema: t, model: r, required: a, submitted: o, errors: n, onChange: i } = e, [c, d] = (0, Be.useState)(r), m = (0, Be.useRef)(null), [p, h] = (0, Be.useState)(null), [y, u] = (0, Be.useState)(null), [l, f] = (0, Be.useState)(false), [g, C] = (0, Be.useState)(null), F = ae(), w = re(), A = Mt();
|
|
1953
1953
|
(0, Be.useEffect)(() => {
|
|
1954
|
-
t.validationAsync.method ||
|
|
1955
|
-
}, [
|
|
1956
|
-
let
|
|
1957
|
-
let
|
|
1958
|
-
m.current =
|
|
1959
|
-
let
|
|
1954
|
+
t.validationAsync.method || A.warning("Invalid schema or model", 'ValidationAsyncSchema without a "method" property would have defaulted to "GET" in previous versions. Now defaults to "POST".', {});
|
|
1955
|
+
}, [A, t.validationAsync.method]);
|
|
1956
|
+
let M = async (P, B) => {
|
|
1957
|
+
let _ = x(), v = { [B.param]: P };
|
|
1958
|
+
m.current = P, f(true), w("Dynamic Flow - ValidationAsync", { status: "pending" });
|
|
1959
|
+
let z = await F(B.url, { method: B.method || "POST", headers: { "Content-Type": "application/json" }, body: B.method === "GET" ? void 0 : JSON.stringify(v), signal: _ });
|
|
1960
1960
|
try {
|
|
1961
|
-
let
|
|
1962
|
-
if (!R(
|
|
1961
|
+
let E = await z.json();
|
|
1962
|
+
if (!R(E))
|
|
1963
1963
|
throw new Error("Response body is not an object");
|
|
1964
|
-
|
|
1965
|
-
} catch (
|
|
1966
|
-
|
|
1964
|
+
w("Dynamic Flow - ValidationAsync", { status: "success" }), z.status === 200 ? h(L(E.message) ? E.message : null) : z.status === 422 && u(L(E.message) ? E.message : null);
|
|
1965
|
+
} catch (E) {
|
|
1966
|
+
w("Dynamic Flow - ValidationAsync", { status: "failure" });
|
|
1967
1967
|
}
|
|
1968
1968
|
}, x = () => {
|
|
1969
|
-
|
|
1970
|
-
let
|
|
1971
|
-
return C(
|
|
1969
|
+
g && g.abort();
|
|
1970
|
+
let P = new AbortController();
|
|
1971
|
+
return C(P), P.signal;
|
|
1972
1972
|
};
|
|
1973
|
-
return (0, qs.jsx)(St, s({}, { submitted: o || l, model: c, errors: y || n, infoMessage: p, onChange: (
|
|
1974
|
-
i(S(s({},
|
|
1973
|
+
return (0, qs.jsx)(St, s({}, { submitted: o || l, model: c, errors: y || n, infoMessage: p, onChange: (P) => {
|
|
1974
|
+
i(S(s({}, P), { triggerSchema: t, triggerModel: P.model })), u(null), h(null), d(P.model);
|
|
1975
1975
|
}, onBlur: () => {
|
|
1976
|
-
!
|
|
1976
|
+
!D(c) && !Je(c, m.current) && G(c, t) && M(c, t.validationAsync);
|
|
1977
1977
|
}, required: a, schema: t }));
|
|
1978
1978
|
}
|
|
1979
1979
|
Hs.defaultProps = { required: false };
|
|
@@ -2033,7 +2033,7 @@ var require_main_min = __commonJS({
|
|
|
2033
2033
|
var Ao = require("react/jsx-runtime");
|
|
2034
2034
|
function ru({ component: e, model: t = null, errors: r = null, submitted: a, onModelChange: o, onPersistAsync: n }) {
|
|
2035
2035
|
let i = e.schema;
|
|
2036
|
-
return (0, Ao.jsx)("div", { className:
|
|
2036
|
+
return (0, Ao.jsx)("div", { className: U(e.margin || "md"), children: (0, Ao.jsx)(me, { schema: i, model: t, errors: r, submitted: a, onChange: (c) => {
|
|
2037
2037
|
o(s({ formSchema: i }, c));
|
|
2038
2038
|
}, onPersistAsync: n }) });
|
|
2039
2039
|
}
|
|
@@ -2090,7 +2090,7 @@ var require_main_min = __commonJS({
|
|
|
2090
2090
|
cu(i, t).then(d);
|
|
2091
2091
|
}, [t, i]);
|
|
2092
2092
|
let m = { alt: n || a || "", src: c, stretch: true, shrink: true };
|
|
2093
|
-
return c ? (0, Io.jsx)("div", { className: `df-image ${r || "md"}`, children: (0, Io.jsx)(_s.Image, s({ className: `img-responsive ${
|
|
2093
|
+
return c ? (0, Io.jsx)("div", { className: `df-image ${r || "md"}`, children: (0, Io.jsx)(_s.Image, s({ className: `img-responsive ${U(o || "md")}` }, m)) }) : null;
|
|
2094
2094
|
}
|
|
2095
2095
|
var su = (e) => new Promise((t, r) => {
|
|
2096
2096
|
let a = new FileReader();
|
|
@@ -2115,55 +2115,55 @@ var require_main_min = __commonJS({
|
|
|
2115
2115
|
var lu = ["warning", "negative"];
|
|
2116
2116
|
var du = ({ component: e }) => {
|
|
2117
2117
|
let { items: t } = e, r = t.filter((o) => mu.includes(o.context)).map(({ text: o }) => o), a = t.filter((o) => lu.includes(o.context)).map(({ text: o }) => o);
|
|
2118
|
-
return (0, pr.jsxs)("div", { className:
|
|
2118
|
+
return (0, pr.jsxs)("div", { className: U(e.margin || "md"), children: [e.title ? (0, pr.jsx)(ia.Header, { title: e.title }) : null, (0, pr.jsx)(ia.InstructionsList, { dos: r, donts: a })] });
|
|
2119
2119
|
};
|
|
2120
2120
|
var Lo = du;
|
|
2121
2121
|
var H = require("react/jsx-runtime");
|
|
2122
|
-
var
|
|
2122
|
+
var J = (e) => JSON.stringify(e);
|
|
2123
2123
|
function uu(e) {
|
|
2124
2124
|
let { components: t, model: r, submitted: a, errors: o, onModelChange: n, onAction: i, onPersistAsync: c, baseUrl: d } = e, m = (p) => {
|
|
2125
2125
|
switch (p.type) {
|
|
2126
2126
|
case "heading":
|
|
2127
|
-
return (0, H.jsx)(Po, { component: p },
|
|
2127
|
+
return (0, H.jsx)(Po, { component: p }, J(p));
|
|
2128
2128
|
case "paragraph":
|
|
2129
|
-
return (0, H.jsx)(Ro, { component: p },
|
|
2129
|
+
return (0, H.jsx)(Ro, { component: p }, J(p));
|
|
2130
2130
|
case "image":
|
|
2131
|
-
return (0, H.jsx)(Do, { component: p },
|
|
2131
|
+
return (0, H.jsx)(Do, { component: p }, J(p));
|
|
2132
2132
|
case "alert":
|
|
2133
|
-
return (0, H.jsx)(se, { component: p },
|
|
2133
|
+
return (0, H.jsx)(se, { component: p }, J(p));
|
|
2134
2134
|
case "review":
|
|
2135
|
-
return (0, H.jsx)(No, { component: p, onAction: i },
|
|
2135
|
+
return (0, H.jsx)(No, { component: p, onAction: i }, J(p));
|
|
2136
2136
|
case "divider":
|
|
2137
|
-
return (0, H.jsx)(Qa, { component: p },
|
|
2137
|
+
return (0, H.jsx)(Qa, { component: p }, J(p));
|
|
2138
2138
|
case "info":
|
|
2139
|
-
return (0, H.jsx)(Eo, { component: p },
|
|
2139
|
+
return (0, H.jsx)(Eo, { component: p }, J(p));
|
|
2140
2140
|
case "instructions":
|
|
2141
|
-
return (0, H.jsx)(Lo, { component: p },
|
|
2141
|
+
return (0, H.jsx)(Lo, { component: p }, J(p));
|
|
2142
2142
|
case "markdown":
|
|
2143
|
-
return (0, H.jsx)(ko, { component: p },
|
|
2143
|
+
return (0, H.jsx)(ko, { component: p }, J(p));
|
|
2144
2144
|
case "columns":
|
|
2145
|
-
return (0, H.jsx)(Ya, { component: p, model: r, submitted: a, errors: o, onModelChange: n, onAction: i, onPersistAsync: c },
|
|
2145
|
+
return (0, H.jsx)(Ya, { component: p, model: r, submitted: a, errors: o, onModelChange: n, onAction: i, onPersistAsync: c }, J(p));
|
|
2146
2146
|
case "form":
|
|
2147
|
-
return (0, H.jsx)(Oo, { component: p, model: r, submitted: a, errors: o, onModelChange: n, onPersistAsync: c },
|
|
2147
|
+
return (0, H.jsx)(Oo, { component: p, model: r, submitted: a, errors: o, onModelChange: n, onPersistAsync: c }, J(S(s({}, p), { errors: o != null ? o : null })));
|
|
2148
2148
|
case "button":
|
|
2149
|
-
return (0, H.jsx)(Xa, { component: p, onAction: i },
|
|
2149
|
+
return (0, H.jsx)(Xa, { component: p, onAction: i }, J(p));
|
|
2150
2150
|
case "box":
|
|
2151
|
-
return (0, H.jsx)(Ja, { component: p, model: r, submitted: a, errors: o, onModelChange: n, onAction: i, onPersistAsync: c },
|
|
2151
|
+
return (0, H.jsx)(Ja, { component: p, model: r, submitted: a, errors: o, onModelChange: n, onAction: i, onPersistAsync: c }, J(p));
|
|
2152
2152
|
case "decision":
|
|
2153
|
-
return (0, H.jsx)(Za, { component: p, onAction: i },
|
|
2153
|
+
return (0, H.jsx)(Za, { component: p, onAction: i }, J(p));
|
|
2154
2154
|
case "external":
|
|
2155
|
-
return (0, H.jsx)(eo, { component: p, onAction: i },
|
|
2155
|
+
return (0, H.jsx)(eo, { component: p, onAction: i }, J(p));
|
|
2156
2156
|
case "list":
|
|
2157
2157
|
case "status-list":
|
|
2158
|
-
return (0, H.jsx)(To, { component: p, onAction: i },
|
|
2158
|
+
return (0, H.jsx)(To, { component: p, onAction: i }, J(p));
|
|
2159
2159
|
case "loading-indicator":
|
|
2160
|
-
return (0, H.jsx)(yr, { component: p },
|
|
2160
|
+
return (0, H.jsx)(yr, { component: p }, J(p));
|
|
2161
2161
|
case "search":
|
|
2162
|
-
return (0, H.jsx)(Bo, { component: p, onAction: i },
|
|
2162
|
+
return (0, H.jsx)(Bo, { component: p, onAction: i }, J(p));
|
|
2163
2163
|
case "modal":
|
|
2164
|
-
return (0, H.jsx)(zo, { component: p, model: r, submitted: a, errors: o, onModelChange: n, onAction: i, onPersistAsync: c },
|
|
2164
|
+
return (0, H.jsx)(zo, { component: p, model: r, submitted: a, errors: o, onModelChange: n, onAction: i, onPersistAsync: c }, J(p));
|
|
2165
2165
|
default:
|
|
2166
|
-
return (0, H.jsx)("div", {},
|
|
2166
|
+
return (0, H.jsx)("div", {}, J(p));
|
|
2167
2167
|
}
|
|
2168
2168
|
};
|
|
2169
2169
|
return ti() || d == null ? (0, H.jsx)(H.Fragment, { children: t.map(m) }) : (0, H.jsx)(Vr, { baseUrl: d, children: t.map(m) });
|
|
@@ -2171,7 +2171,7 @@ var require_main_min = __commonJS({
|
|
|
2171
2171
|
var ne = uu;
|
|
2172
2172
|
var sa = require("@transferwise/components");
|
|
2173
2173
|
var Gt = require("react/jsx-runtime");
|
|
2174
|
-
var pu = ({ component: e }) => (0, Gt.jsxs)("div", { className:
|
|
2174
|
+
var pu = ({ component: e }) => (0, Gt.jsxs)("div", { className: U(e.margin || "md"), children: [e.title ? (0, Gt.jsx)(sa.Header, { title: e.title }) : null, e.items.map(yu)] });
|
|
2175
2175
|
var yu = ({ title: e, description: t, icon: r, status: a }) => {
|
|
2176
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: gu[a] } : {});
|
|
2177
2177
|
return (0, Gt.jsx)(sa.Summary, s({}, o));
|
|
@@ -2184,7 +2184,7 @@ var require_main_min = __commonJS({
|
|
|
2184
2184
|
var Js = require("react/jsx-runtime");
|
|
2185
2185
|
var wu = ({ component: e }) => {
|
|
2186
2186
|
let { margin: t = "md", size: r = "md" } = e;
|
|
2187
|
-
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 ${U(t)}` }, "data-testid": "loading-indicator" });
|
|
2188
2188
|
};
|
|
2189
2189
|
var yr = wu;
|
|
2190
2190
|
var ec = require("@transferwise/components");
|
|
@@ -2222,7 +2222,7 @@ var require_main_min = __commonJS({
|
|
|
2222
2222
|
var Au = (e, t, r) => t ? r === "HORIZONTAL_RIGHT_ALIGNED" ? (0, de.jsxs)(de.Fragment, { children: [(0, de.jsx)(qe, { help: t }), " ", e] }) : (0, de.jsxs)(de.Fragment, { children: [e, " ", (0, de.jsx)(qe, { help: t })] }) : e;
|
|
2223
2223
|
var Ou = (e) => (e.control || e.orientation) === "horizontal" ? "HORIZONTAL_RIGHT_ALIGNED" : "VERTICAL_ONE_COLUMN";
|
|
2224
2224
|
function Pu(e) {
|
|
2225
|
-
let t = e.component, r =
|
|
2225
|
+
let t = e.component, r = U(t.margin || "xs"), a = (c, d) => ({ text: c != null ? c : "", href: d.url, onClick: (m) => {
|
|
2226
2226
|
m.preventDefault(), d && e.onAction(d);
|
|
2227
2227
|
} }), o = Ou(t), n = t.callToAction ? a(t.callToAction.title, t.callToAction.action) : null, i = !n && t.action ? a(t.action.title || "", t.action) : null;
|
|
2228
2228
|
return (0, de.jsxs)("div", { className: r, children: [t.title && (0, de.jsx)(ca.Header, { title: t.title, action: n || i || void 0 }), (0, de.jsx)("div", { className: r, children: (0, de.jsx)(ca.DefinitionList, { layout: o, definitions: vu(o, t) }) })] });
|
|
@@ -2257,8 +2257,8 @@ var require_main_min = __commonJS({
|
|
|
2257
2257
|
let { signal: u } = a.current;
|
|
2258
2258
|
r({ status: "loading" });
|
|
2259
2259
|
try {
|
|
2260
|
-
let
|
|
2261
|
-
i(
|
|
2260
|
+
let g = await (h === "GET" ? o(Eu(p, y, m), { method: h, signal: u, headers: cc }) : o(p, { method: h, signal: u, headers: cc, body: JSON.stringify({ [y]: m }) }));
|
|
2261
|
+
i(g, m);
|
|
2262
2262
|
} catch (f) {
|
|
2263
2263
|
c(f, m);
|
|
2264
2264
|
}
|
|
@@ -2276,7 +2276,7 @@ var require_main_min = __commonJS({
|
|
|
2276
2276
|
}, d = t.status === "success" ? t.results : [];
|
|
2277
2277
|
return { status: t.status, results: d, search: n };
|
|
2278
2278
|
};
|
|
2279
|
-
var Mu = (e) => R(e) && "results" in e &&
|
|
2279
|
+
var Mu = (e) => R(e) && "results" in e && V(e.results) && e.results.every((t) => R(t) && "title" in t && "type" in t && "value" in t);
|
|
2280
2280
|
var ku = (e) => e instanceof DOMException && e.name === "AbortError";
|
|
2281
2281
|
var Eu = (e, t, r) => {
|
|
2282
2282
|
let [a, o] = e.split("?"), n = new URLSearchParams(o);
|
|
@@ -2287,18 +2287,18 @@ var require_main_min = __commonJS({
|
|
|
2287
2287
|
function Du({ component: e, onAction: t }) {
|
|
2288
2288
|
let [r, a] = (0, da.useState)(""), { title: o, margin: n, url: i, method: c, param: d, emptyMessage: m } = e, { status: p, results: h, search: y } = mc({ url: i, method: c, param: d }), u = re(), l = (0, da.useMemo)(() => Ke(y, Iu), [y]), f = () => {
|
|
2289
2289
|
u("Dynamic Flow - Search Started", {});
|
|
2290
|
-
},
|
|
2291
|
-
a(
|
|
2292
|
-
}, C = ({ type:
|
|
2293
|
-
if (
|
|
2294
|
-
a(
|
|
2295
|
-
let { url:
|
|
2296
|
-
u("Dynamic Flow - Search Result Selected", { type: "search" }), y(
|
|
2290
|
+
}, g = (w) => {
|
|
2291
|
+
a(w), l(w);
|
|
2292
|
+
}, C = ({ type: w, value: A }) => {
|
|
2293
|
+
if (w === "action" && (u("Dynamic Flow - Search Result Selected", { type: "action", actionId: A.id || A.$id }), t(A)), w === "search") {
|
|
2294
|
+
a(A.query);
|
|
2295
|
+
let { url: M, method: x, param: k, query: I } = A;
|
|
2296
|
+
u("Dynamic Flow - Search Result Selected", { type: "search" }), y(I, { url: M, method: x, param: k });
|
|
2297
2297
|
}
|
|
2298
2298
|
}, F = () => {
|
|
2299
2299
|
a(r), y(r);
|
|
2300
2300
|
};
|
|
2301
|
-
return (0, Ft.jsxs)("div", { className:
|
|
2301
|
+
return (0, Ft.jsxs)("div", { className: U(n || "md"), children: [(0, Ft.jsx)(ac, { title: o, value: r, onChange: g, 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: C })] });
|
|
2302
2302
|
}
|
|
2303
2303
|
var Bo = Du;
|
|
2304
2304
|
var ua = require("@transferwise/components");
|
|
@@ -2310,33 +2310,33 @@ var require_main_min = __commonJS({
|
|
|
2310
2310
|
};
|
|
2311
2311
|
var zo = Lu;
|
|
2312
2312
|
var pe = require("react/jsx-runtime");
|
|
2313
|
-
var Vo = (e) =>
|
|
2313
|
+
var Vo = (e) => D(e) || Z(e);
|
|
2314
2314
|
var Tu = (e) => e.type === "boolean" && Vo(e.default) ? false : e.default;
|
|
2315
2315
|
var uc = (e) => {
|
|
2316
|
-
var
|
|
2317
|
-
let t = (
|
|
2318
|
-
y(true), a(o(
|
|
2319
|
-
}, r = (
|
|
2320
|
-
d(
|
|
2321
|
-
let $ = r(
|
|
2316
|
+
var _, v, z;
|
|
2317
|
+
let t = (E) => {
|
|
2318
|
+
y(true), a(o(E), "user");
|
|
2319
|
+
}, r = (E) => _e(E, e.schema, e.required), a = (E, ie) => {
|
|
2320
|
+
d(E);
|
|
2321
|
+
let $ = r(E);
|
|
2322
2322
|
F($);
|
|
2323
|
-
let
|
|
2324
|
-
p(
|
|
2325
|
-
}, o = (
|
|
2326
|
-
l(false),
|
|
2327
|
-
}, [c, d] = (0, ue.useState)((
|
|
2328
|
-
let
|
|
2329
|
-
Vo(c) && !Vo(
|
|
2330
|
-
},
|
|
2323
|
+
let Y = E;
|
|
2324
|
+
p(Y), Y !== m && e.onChange({ model: Y, triggerSchema: e.schema, triggerModel: Y, lastTriggerModel: m, type: ie });
|
|
2325
|
+
}, o = (E) => We(E, e.schema), n = () => l(true), i = () => {
|
|
2326
|
+
l(false), g(true), e.onBlur && e.onBlur();
|
|
2327
|
+
}, [c, d] = (0, ue.useState)((_ = e.model) != null ? _ : null), [m, p] = (0, ue.useState)((v = e.model) != null ? v : null), [h, y] = (0, ue.useState)(false), [u, l] = (0, ue.useState)(false), [f, g] = (0, ue.useState)(false), [C, F] = (0, ue.useState)([]), w = (0, ue.useMemo)(() => e.schema.$id || Te(), [e.schema.$id]), A = () => {
|
|
2328
|
+
let E = Tu(e.schema);
|
|
2329
|
+
Vo(c) && !Vo(E) && a(E, "init"), e.schema.const && a(e.schema.const, "init");
|
|
2330
|
+
}, M = () => {
|
|
2331
2331
|
F(r(c));
|
|
2332
|
-
}, x = e.schema.const,
|
|
2333
|
-
(0, ue.useEffect)(
|
|
2332
|
+
}, x = e.schema.const, k = e.schema.hidden || x;
|
|
2333
|
+
(0, ue.useEffect)(M, [e.model, e.submitted]), (0, ue.useEffect)(A, [e.schema]), (0, ue.useEffect)(() => {
|
|
2334
2334
|
var ie;
|
|
2335
|
-
let
|
|
2336
|
-
|
|
2335
|
+
let E = (ie = e.model) != null ? ie : null;
|
|
2336
|
+
E !== c && d(E);
|
|
2337
2337
|
}, [e.model]);
|
|
2338
|
-
let
|
|
2339
|
-
return
|
|
2338
|
+
let I = { "form-group": true, "has-error": (e.submitted || !h) && !!e.errors || (e.submitted || h && f) && !!C.length, "has-info": !!e.schema.description || !!e.infoMessage }, O = e.schema.format !== "file" && e.schema.type !== "boolean", P = e.schema.help, B = `${w}-feedback`;
|
|
2339
|
+
return k ? null : (0, pe.jsxs)(pe.Fragment, { children: [e.schema.alert && (0, pe.jsx)(se, { component: e.schema.alert }), (0, pe.jsxs)("div", { className: (0, dc.default)(I), children: [O && (0, pe.jsxs)("div", { className: "d-inline-block m-b-1", children: [(0, pe.jsx)("label", { className: "control-label d-inline", htmlFor: w, children: e.schema.title }), !!P && (0, pe.jsx)(qe, { help: P })] }), !O && !!P && (0, pe.jsx)(qe, { help: P }), (0, pe.jsx)(lr, { id: w, schema: e.schema, value: c, disabled: !!e.disabled, onChange: t, onFocus: n, onBlur: i, describedBy: B }), (0, pe.jsx)(He, { id: B, changed: h, focused: u, blurred: f, submitted: e.submitted, errors: (z = e.errors) != null ? z : null, schema: e.schema, validations: C, infoMessage: e.infoMessage })] })] });
|
|
2340
2340
|
};
|
|
2341
2341
|
uc.defaultProps = { required: false, disabled: false, onBlur: null };
|
|
2342
2342
|
var St = uc;
|
|
@@ -2348,45 +2348,45 @@ var require_main_min = __commonJS({
|
|
|
2348
2348
|
};
|
|
2349
2349
|
var Ru = /* @__PURE__ */ new Set([N.RADIO, N.SELECT, N.DATELOOKUP, N.FILE, N.UPLOAD]);
|
|
2350
2350
|
function fc(e) {
|
|
2351
|
-
let { schema: t, required: r, submitted: a, errors: o, onChange: n, onPersistAsync: i } = e, c = (0, pc.useIntl)(), d = ae(), m = re(), [p, h] = (0, bt.useState)(null), y = gc(p), [u, l] = (0, bt.useState)(null), [f,
|
|
2351
|
+
let { schema: t, required: r, submitted: a, errors: o, onChange: n, onPersistAsync: i } = e, c = (0, pc.useIntl)(), d = ae(), m = re(), [p, h] = (0, bt.useState)(null), y = gc(p), [u, l] = (0, bt.useState)(null), [f, g] = (0, bt.useState)(false), [C, F] = (0, bt.useState)(null);
|
|
2352
2352
|
(0, bt.useEffect)(() => {
|
|
2353
2353
|
Ru.has(po(t.persistAsync.schema)) && x();
|
|
2354
2354
|
}, [p]);
|
|
2355
|
-
let
|
|
2356
|
-
let
|
|
2357
|
-
|
|
2355
|
+
let w = () => l(c.formatMessage(nr.genericError)), A = async (O, P) => {
|
|
2356
|
+
let B = M(), _ = { [P.param]: O };
|
|
2357
|
+
g(true);
|
|
2358
2358
|
try {
|
|
2359
2359
|
m("Dynamic Flow - PersistAsync", { status: "pending", schemaId: t.$id });
|
|
2360
|
-
let
|
|
2361
|
-
i(
|
|
2362
|
-
let
|
|
2363
|
-
if (!R(
|
|
2360
|
+
let v = d(P.url, { method: P.method, headers: { "Content-Type": "application/json" }, body: JSON.stringify(_), signal: B });
|
|
2361
|
+
i(v);
|
|
2362
|
+
let z = await v, E = await z.json();
|
|
2363
|
+
if (!R(E))
|
|
2364
2364
|
throw new Error("Response is not an object");
|
|
2365
2365
|
let { idProperty: ie, param: $ } = t.persistAsync;
|
|
2366
|
-
if (xn(
|
|
2367
|
-
let
|
|
2368
|
-
n({ model:
|
|
2369
|
-
} else if (Er(
|
|
2370
|
-
let { validation:
|
|
2366
|
+
if (xn(z.status)) {
|
|
2367
|
+
let Y = go(ie, E);
|
|
2368
|
+
n({ model: Y, triggerSchema: t, triggerModel: Y });
|
|
2369
|
+
} else if (Er(z.status)) {
|
|
2370
|
+
let { validation: Y } = E, ke = R(Y) && (Y == null ? void 0 : Y[$]) || null;
|
|
2371
2371
|
l(ke), n({ model: null, triggerSchema: t, triggerModel: null });
|
|
2372
2372
|
} else
|
|
2373
|
-
|
|
2373
|
+
w();
|
|
2374
2374
|
m("Dynamic Flow - PersistAsync", { status: "success", schemaId: t.$id });
|
|
2375
|
-
} catch (
|
|
2376
|
-
m("Dynamic Flow - PersistAsync", { status: "failure", schemaId: t.$id }),
|
|
2375
|
+
} catch (v) {
|
|
2376
|
+
m("Dynamic Flow - PersistAsync", { status: "failure", schemaId: t.$id }), w();
|
|
2377
2377
|
}
|
|
2378
|
-
},
|
|
2378
|
+
}, M = () => {
|
|
2379
2379
|
C && C.abort();
|
|
2380
|
-
let
|
|
2381
|
-
return F(
|
|
2380
|
+
let O = new AbortController();
|
|
2381
|
+
return F(O), O.signal;
|
|
2382
2382
|
}, x = () => {
|
|
2383
|
-
!
|
|
2384
|
-
},
|
|
2383
|
+
!D(p) && !Je(p, y) && A(p, t.persistAsync);
|
|
2384
|
+
}, k = () => {
|
|
2385
2385
|
x();
|
|
2386
|
-
},
|
|
2387
|
-
l(null), G(
|
|
2386
|
+
}, I = ({ model: O }) => {
|
|
2387
|
+
l(null), G(O, t.persistAsync.schema) && h(O);
|
|
2388
2388
|
};
|
|
2389
|
-
return (0, hc.jsx)(St, { required: r, submitted: a || f, schema: t.persistAsync.schema, errors: u || o, model: null, infoMessage: null, onChange:
|
|
2389
|
+
return (0, hc.jsx)(St, { required: r, submitted: a || f, schema: t.persistAsync.schema, errors: u || o, model: null, infoMessage: null, onChange: I, onBlur: k });
|
|
2390
2390
|
}
|
|
2391
2391
|
fc.defaultProps = { required: false };
|
|
2392
2392
|
var fo = fc;
|
|
@@ -2394,7 +2394,7 @@ var require_main_min = __commonJS({
|
|
|
2394
2394
|
let [t, r] = (0, wc.useState)(null), a = ae(), o = (0, Sc.useIntl)(), { schema: n } = e;
|
|
2395
2395
|
async function i(y) {
|
|
2396
2396
|
let u = y instanceof Blob ? !Dt(n) : !G(y, n);
|
|
2397
|
-
return (
|
|
2397
|
+
return (D(y) || u) && h(), await m(y);
|
|
2398
2398
|
}
|
|
2399
2399
|
let c = () => {
|
|
2400
2400
|
t && t.abort();
|
|
@@ -2402,8 +2402,8 @@ var require_main_min = __commonJS({
|
|
|
2402
2402
|
return r(y), y.signal;
|
|
2403
2403
|
};
|
|
2404
2404
|
function d(y) {
|
|
2405
|
-
let u = Dt(n), l = c(), f = e.param,
|
|
2406
|
-
return { method: e.method, headers: s({}, !u && { "Content-Type": "application/json" }), body:
|
|
2405
|
+
let u = Dt(n), l = c(), f = e.param, g = u ? Nu(f, y) : JSON.stringify({ [f]: y });
|
|
2406
|
+
return { method: e.method, headers: s({}, !u && { "Content-Type": "application/json" }), body: g, signal: l };
|
|
2407
2407
|
}
|
|
2408
2408
|
async function m(y) {
|
|
2409
2409
|
try {
|
|
@@ -2413,7 +2413,7 @@ var require_main_min = __commonJS({
|
|
|
2413
2413
|
let l = await u.json();
|
|
2414
2414
|
if (R(l)) {
|
|
2415
2415
|
let f = l[e.idProperty];
|
|
2416
|
-
if (L(f) ||
|
|
2416
|
+
if (L(f) || j(f))
|
|
2417
2417
|
return { data: f };
|
|
2418
2418
|
}
|
|
2419
2419
|
return h();
|
|
@@ -2639,7 +2639,7 @@ var require_main_min = __commonJS({
|
|
|
2639
2639
|
return { videoConstraints: t };
|
|
2640
2640
|
};
|
|
2641
2641
|
var wa = require("react");
|
|
2642
|
-
var
|
|
2642
|
+
var X = require("react/jsx-runtime");
|
|
2643
2643
|
var Wu = 92;
|
|
2644
2644
|
var Uc = 120;
|
|
2645
2645
|
var _u = 40;
|
|
@@ -2659,23 +2659,23 @@ var require_main_min = __commonJS({
|
|
|
2659
2659
|
}, 100);
|
|
2660
2660
|
return window.addEventListener("resize", y), () => window.removeEventListener("resize", y);
|
|
2661
2661
|
});
|
|
2662
|
-
let c = (r ? _u : 0) + (a ? Ku : 0) + (o ? Ju : 0), d = (0,
|
|
2662
|
+
let c = (r ? _u : 0) + (a ? Ku : 0) + (o ? Ju : 0), d = (0, X.jsxs)(X.Fragment, { children: [r && (0, X.jsx)("img", { className: "camera-capture-img", src: r, alt: "" }), a && (0, X.jsx)("h4", { className: "camera-capture-title", children: a }), o && (0, X.jsx)("small", { className: "camera-capture-instructions", children: o })] }), m = Wu + c;
|
|
2663
2663
|
if (n) {
|
|
2664
|
-
c = m - Uc, d = (0,
|
|
2664
|
+
c = m - Uc, d = (0, X.jsx)("small", { className: "camera-capture-instructions", children: n });
|
|
2665
2665
|
let y = Uc + Xu;
|
|
2666
|
-
m < y && (d = (0,
|
|
2666
|
+
m < y && (d = (0, X.jsx)(X.Fragment, {}));
|
|
2667
2667
|
}
|
|
2668
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%" } };
|
|
2669
|
-
return (0,
|
|
2669
|
+
return (0, X.jsxs)("svg", { ref: i, xmlns: "http://www.w3.org/2000/svg", children: [(0, X.jsx)("defs", { children: (0, X.jsxs)("mask", { id: "mask", children: [(0, X.jsx)("rect", { width: "100%", height: "100%", fill: "#fff" }), (0, X.jsx)("image", s({ href: e }, p))] }) }), e && (0, X.jsx)("rect", { width: "100%", height: "100%", mask: "url(#mask)", fillOpacity: "0.72" }), t && (0, X.jsx)("image", s({ href: t }, p)), (0, X.jsx)("foreignObject", { width: "100%", height: "100%", children: (0, X.jsx)("div", S(s({ className: "camera-capture-text-and-image-container" }, h), { children: d })) })] });
|
|
2670
2670
|
}
|
|
2671
2671
|
var Ko = Yu;
|
|
2672
2672
|
var fe = require("react/jsx-runtime");
|
|
2673
2673
|
function Zu({ direction: e = "back", overlay: t = "", outline: r = "", imageUrl: a = "", title: o = "", instructions: n = "", showReview: i = false, onCapture: c, onEvent: d }) {
|
|
2674
|
-
let [m, p] = (0, oe.useState)("CAPTURE"), [h, y] = (0, oe.useState)(), [u, l] = (0, oe.useState)(false), [f,
|
|
2675
|
-
var $,
|
|
2676
|
-
if (($ =
|
|
2677
|
-
(br = (nt =
|
|
2678
|
-
let it = await Dc((xr =
|
|
2674
|
+
let [m, p] = (0, oe.useState)("CAPTURE"), [h, y] = (0, oe.useState)(), [u, l] = (0, oe.useState)(false), [f, g] = (0, oe.useState)(false), [C, F] = (0, oe.useState)(), w = (0, oe.useRef)(null), { videoConstraints: A } = Vc(e), M = (0, oe.useMemo)(() => !!(Xn() && m === "CAPTURE"), [m]), { enterFullScreen: x, exitFullScreen: k } = jc(M, d), I = (0, qc.useIntl)(), O = (0, oe.useCallback)(async () => {
|
|
2675
|
+
var $, Y, ke, nt, br, xr;
|
|
2676
|
+
if (($ = w == null ? void 0 : w.current) != null && $.video && ((ke = (Y = w == null ? void 0 : w.current) == null ? void 0 : Y.video) == null ? void 0 : ke.readyState) >= 3) {
|
|
2677
|
+
(br = (nt = w == null ? void 0 : w.current) == null ? void 0 : nt.video) == null || br.pause();
|
|
2678
|
+
let it = await Dc((xr = w == null ? void 0 : w.current) == null ? void 0 : xr.video);
|
|
2679
2679
|
it == null || it.toBlob((xt) => {
|
|
2680
2680
|
if (xt)
|
|
2681
2681
|
if (i) {
|
|
@@ -2685,34 +2685,34 @@ var require_main_min = __commonJS({
|
|
|
2685
2685
|
c(xt);
|
|
2686
2686
|
}, "image/jpeg", 0.92);
|
|
2687
2687
|
}
|
|
2688
|
-
}, [
|
|
2688
|
+
}, [w, i, F, p, c, u]), P = (0, oe.useCallback)(($) => {
|
|
2689
2689
|
if (p("ERROR"), $ instanceof DOMException)
|
|
2690
2690
|
switch ($ == null ? void 0 : $.name) {
|
|
2691
2691
|
case "NotAllowedError":
|
|
2692
|
-
y({ title:
|
|
2692
|
+
y({ title: I.formatMessage(ye.noCameraAccessTitle), description: I.formatMessage(ye.noCameraAccessParagraph), actionButton: I.formatMessage(ye.noCameraAccessAction), onAction: z }), ha("Dynamic Flow - Camera Permission Denied", d, $);
|
|
2693
2693
|
return;
|
|
2694
2694
|
case "NotFoundError":
|
|
2695
2695
|
case "OverconstrainedError":
|
|
2696
2696
|
case "AbortError":
|
|
2697
2697
|
case "NotReadableError":
|
|
2698
|
-
y({ title:
|
|
2698
|
+
y({ title: I.formatMessage(ye.cameraConnectionIssueTitle), description: I.formatMessage(ye.cameraConnectionIssueParagraph), actionButton: I.formatMessage(ye.cameraConnectionIssueAction), onAction: z }), ha("Dynamic Flow - Camera Not Accessible", d, $);
|
|
2699
2699
|
return;
|
|
2700
2700
|
}
|
|
2701
|
-
y({ title:
|
|
2702
|
-
}, [
|
|
2703
|
-
x(),
|
|
2704
|
-
}, [l, d, e, x]),
|
|
2701
|
+
y({ title: I.formatMessage(ye.cameraNotSupportedTitle), description: I.formatMessage(ye.cameraNotSupportedParagraph) }), ha("Dynamic Flow - Camera Not Supported", d, $);
|
|
2702
|
+
}, [I, d]), B = (0, oe.useCallback)(($) => {
|
|
2703
|
+
x(), g(true), l(Ec($)), Nc(d, { direction: e }, $);
|
|
2704
|
+
}, [l, d, e, x]), _ = () => {
|
|
2705
2705
|
c((C == null ? void 0 : C.blob) || null);
|
|
2706
|
-
},
|
|
2706
|
+
}, v = () => {
|
|
2707
2707
|
p("CAPTURE"), F(void 0);
|
|
2708
|
-
},
|
|
2708
|
+
}, z = () => p("CAPTURE");
|
|
2709
2709
|
(0, oe.useEffect)(() => {
|
|
2710
|
-
m !== "CAPTURE" &&
|
|
2711
|
-
}, [m,
|
|
2712
|
-
let
|
|
2713
|
-
|
|
2714
|
-
} })] }), ie = (0, fe.jsxs)("div", { className: "camera-capture", children: [(0, fe.jsx)("img", { className: "review-image", src: C == null ? void 0 : C.source, alt: "" }), (0, fe.jsx)(Ko, { overlay: t, imageUrl: a, title: o, instructions: n, reviewInstructions:
|
|
2715
|
-
return (0, fe.jsxs)("section", { children: [m === "CAPTURE" &&
|
|
2710
|
+
m !== "CAPTURE" && k();
|
|
2711
|
+
}, [m, k]);
|
|
2712
|
+
let E = (0, fe.jsxs)("div", { className: "camera-capture", children: [A && (0, fe.jsx)(Gc.default, { ref: w, audio: false, videoConstraints: A, mirrored: u, onUserMediaError: P, onUserMedia: B }), (0, fe.jsx)(Ko, { overlay: t, outline: r, imageUrl: a, title: o, instructions: n }), M && (0, fe.jsx)(Go, {}), f && (0, fe.jsx)(Ho, { onCapture: () => {
|
|
2713
|
+
O();
|
|
2714
|
+
} })] }), ie = (0, fe.jsxs)("div", { className: "camera-capture", children: [(0, fe.jsx)("img", { className: "review-image", src: C == null ? void 0 : C.source, alt: "" }), (0, fe.jsx)(Ko, { overlay: t, imageUrl: a, title: o, instructions: n, reviewInstructions: I.formatMessage(ye.reviewInstructions) }), (0, fe.jsx)(qo, { onSubmit: _, onRetry: v })] });
|
|
2715
|
+
return (0, fe.jsxs)("section", { children: [m === "CAPTURE" && E, m === "REVIEW" && ie, m === "ERROR" && h && (0, fe.jsx)($o, s({}, h))] });
|
|
2716
2716
|
}
|
|
2717
2717
|
var Jo = Zu;
|
|
2718
2718
|
var Wc = require("react/jsx-runtime");
|
|
@@ -2723,19 +2723,19 @@ var require_main_min = __commonJS({
|
|
|
2723
2723
|
});
|
|
2724
2724
|
}
|
|
2725
2725
|
function ep(e) {
|
|
2726
|
-
let { step: t, model: r, onModelChange: a, onAction: o } = e, n = re(), i = $c(t), c = tp(t), d = rp(t), { title: m, image: p, cameraConfig: h } = c, { assets: y, direction: u, instructions: l } = h || {}, { overlay: f, outline:
|
|
2726
|
+
let { step: t, model: r, onModelChange: a, onAction: o } = e, n = re(), i = $c(t), c = tp(t), d = rp(t), { title: m, image: p, cameraConfig: h } = c, { assets: y, direction: u, instructions: l } = h || {}, { overlay: f, outline: g } = y || {}, { url: C } = p || {}, [F, w] = (0, Sa.useState)(false);
|
|
2727
2727
|
(0, Sa.useEffect)(() => {
|
|
2728
2728
|
F && o(d);
|
|
2729
2729
|
}, [r]);
|
|
2730
|
-
let
|
|
2730
|
+
let A = async (M) => {
|
|
2731
2731
|
let { $id: x } = c;
|
|
2732
|
-
if (
|
|
2733
|
-
let
|
|
2734
|
-
|
|
2732
|
+
if (M) {
|
|
2733
|
+
let k = await Qu(M), I = { [x || ""]: k };
|
|
2734
|
+
w(true), a({ model: I, formSchema: i, triggerModel: k, triggerSchema: c });
|
|
2735
2735
|
}
|
|
2736
2736
|
};
|
|
2737
|
-
return (0, Wc.jsx)(Jo, { overlay: f, outline:
|
|
2738
|
-
|
|
2737
|
+
return (0, Wc.jsx)(Jo, { overlay: f, outline: g, title: m, imageUrl: C, instructions: l, direction: u, onEvent: n, onCapture: (M) => {
|
|
2738
|
+
A(M);
|
|
2739
2739
|
} });
|
|
2740
2740
|
}
|
|
2741
2741
|
var Ca = ep;
|
|
@@ -2812,13 +2812,13 @@ var require_main_min = __commonJS({
|
|
|
2812
2812
|
var Xt = require("react");
|
|
2813
2813
|
var om = (e) => {
|
|
2814
2814
|
var u, l;
|
|
2815
|
-
let [t, r] = (0, Xt.useState)((u = e == null ? void 0 : e.errors) == null ? void 0 : u.validation), [a, o] = (0, Xt.useState)((l = e == null ? void 0 : e.errors) == null ? void 0 : l.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: d, etag: m } = n, p = (f,
|
|
2816
|
-
var C, F,
|
|
2817
|
-
i((
|
|
2818
|
-
}, h = (f,
|
|
2815
|
+
let [t, r] = (0, Xt.useState)((u = e == null ? void 0 : e.errors) == null ? void 0 : u.validation), [a, o] = (0, Xt.useState)((l = e == null ? void 0 : e.errors) == null ? void 0 : l.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: d, etag: m } = n, p = (f, g) => {
|
|
2816
|
+
var C, F, w, A;
|
|
2817
|
+
i((M) => ({ step: f, models: f.model ? rm(f.model, am(f)) : M.models, etag: g })), r((F = (C = f == null ? void 0 : f.errors) == null ? void 0 : C.validation) != null ? F : null), o((A = (w = f == null ? void 0 : f.errors) == null ? void 0 : w.error) != null ? A : null);
|
|
2818
|
+
}, h = (f, g, C) => {
|
|
2819
2819
|
i((F) => {
|
|
2820
|
-
let
|
|
2821
|
-
return C(
|
|
2820
|
+
let w = S(s({}, F.models), { [f]: g }), A = { step: F.step, models: w, etag: F.etag };
|
|
2821
|
+
return C(w), A;
|
|
2822
2822
|
});
|
|
2823
2823
|
}, y = (0, Xt.useMemo)(() => mp(d, cp(c)), [d, c]);
|
|
2824
2824
|
return { formErrors: t, globalError: a, step: c, models: d, etag: m, modelIsValid: y, setFormErrors: r, setGlobalError: o, setStepAndEtag: p, setSchemaModel: h };
|
|
@@ -2968,16 +2968,16 @@ var require_main_min = __commonJS({
|
|
|
2968
2968
|
var Sm = () => {
|
|
2969
2969
|
};
|
|
2970
2970
|
var pp = ({ flowId: e, httpClient: t, initialAction: r, initialStep: a, loaderConfig: o, displayStepTitle: n = true, features: i, onCompletion: c, onError: d, onEvent: m = Sm, onLog: p = Sm }) => {
|
|
2971
|
-
let { locale: h } = (0, Cm.useIntl)(), { formErrors: y, globalError: u, step: l, models: f, etag:
|
|
2971
|
+
let { locale: h } = (0, Cm.useIntl)(), { formErrors: y, globalError: u, step: l, models: f, etag: g, modelIsValid: C, setFormErrors: F, setGlobalError: w, setStepAndEtag: A, setSchemaModel: M } = om(a), [x, k] = (0, Me.useState)(false), { isLoading: I, loader: O, setLoadingState: P } = sm(o, a ? "idle" : "initial"), B = ct("critical", p, e, (l == null ? void 0 : l.id) || (l == null ? void 0 : l.key)), _ = (0, Me.useMemo)(() => {
|
|
2972
2972
|
var b;
|
|
2973
2973
|
return s({ flowId: e, stepId: (l == null ? void 0 : l.id) || (l == null ? void 0 : l.key) }, (b = l == null ? void 0 : l.analytics) != null ? b : {});
|
|
2974
|
-
}, [e, l]),
|
|
2974
|
+
}, [e, l]), v = (0, Me.useMemo)(() => Da(m, _), [m, _]), z = (0, Me.useCallback)(({ action: b, data: q, etag: T }) => {
|
|
2975
2975
|
let { url: te, method: st = "POST" } = b;
|
|
2976
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]),
|
|
2978
|
-
|
|
2977
|
+
}, [t, h]), E = async (b, q = {}) => {
|
|
2978
|
+
P(l ? "submission" : "initial"), v("Dynamic Flow - Step Submitted", { actionId: b.id || b.$id });
|
|
2979
2979
|
try {
|
|
2980
|
-
let T = await
|
|
2980
|
+
let T = await z({ action: b, data: q });
|
|
2981
2981
|
if (b.exit && T.ok) {
|
|
2982
2982
|
await $(T, b.result);
|
|
2983
2983
|
return;
|
|
@@ -2987,9 +2987,9 @@ var require_main_min = __commonJS({
|
|
|
2987
2987
|
it(T, b.exit ? "Error fetching exit result" : "Error fetching next step");
|
|
2988
2988
|
}
|
|
2989
2989
|
}, ie = async (b, q, T) => {
|
|
2990
|
-
|
|
2990
|
+
P("refresh"), v("Dynamic Flow - Step Refreshed", { status: "pending" });
|
|
2991
2991
|
try {
|
|
2992
|
-
let te = await
|
|
2992
|
+
let te = await z({ action: { url: b, method: "POST" }, data: q, etag: T });
|
|
2993
2993
|
await nt(te, "refresh");
|
|
2994
2994
|
} catch (te) {
|
|
2995
2995
|
it(te, "Error fetching refresh step");
|
|
@@ -2997,21 +2997,21 @@ var require_main_min = __commonJS({
|
|
|
2997
2997
|
}, $ = async (b, q) => {
|
|
2998
2998
|
let T = await Qo(b);
|
|
2999
2999
|
ke(s(s({}, T), q));
|
|
3000
|
-
},
|
|
3001
|
-
|
|
3002
|
-
}, [c,
|
|
3000
|
+
}, Y = tm(ie), ke = (0, Me.useCallback)((b) => {
|
|
3001
|
+
v("Dynamic Flow - Flow Finished", { result: "success" }), c(b);
|
|
3002
|
+
}, [c, v]);
|
|
3003
3003
|
(0, Me.useEffect)(() => {
|
|
3004
|
-
|
|
3004
|
+
v("Dynamic Flow - Flow Started", {});
|
|
3005
3005
|
}, []), (0, Me.useEffect)(() => {
|
|
3006
3006
|
if (!a) {
|
|
3007
3007
|
let b = s({ id: "#initial-step-request", method: "GET" }, r);
|
|
3008
|
-
|
|
3008
|
+
E(b, b.data);
|
|
3009
3009
|
}
|
|
3010
3010
|
}, [t, h, JSON.stringify(a), JSON.stringify(r)]);
|
|
3011
3011
|
let nt = async (b, q) => {
|
|
3012
3012
|
try {
|
|
3013
3013
|
if (b.status === 304) {
|
|
3014
|
-
|
|
3014
|
+
P("idle");
|
|
3015
3015
|
return;
|
|
3016
3016
|
}
|
|
3017
3017
|
if (!b.ok) {
|
|
@@ -3020,39 +3020,39 @@ var require_main_min = __commonJS({
|
|
|
3020
3020
|
return;
|
|
3021
3021
|
}
|
|
3022
3022
|
let T = await gm(b);
|
|
3023
|
-
T.type === "action" ?
|
|
3023
|
+
T.type === "action" ? E(T.action, T.action.data) : T.type === "exit" ? ke(T.result) : br(T.step, T.etag, q);
|
|
3024
3024
|
} catch (T) {
|
|
3025
3025
|
it(T, "Error parsing fetch response", q, b.status);
|
|
3026
3026
|
}
|
|
3027
3027
|
}, br = (b, q, T) => {
|
|
3028
|
-
|
|
3028
|
+
A(b, q), P("idle"), T === "submission" ? (k(false), v("Dynamic Flow - Step Started", s({ stepId: b.id || b.key }, b == null ? void 0 : b.analytics))) : v("Dynamic Flow - Step Refreshed", { status: "success" });
|
|
3029
3029
|
}, xr = async (b) => {
|
|
3030
3030
|
let q = b.refreshUrl || b.refreshFormUrl;
|
|
3031
|
-
q && await ie(q, Aa(f),
|
|
3031
|
+
q && await ie(q, Aa(f), g), b.validation && F(b.validation), b.error && w(b.error), P("idle");
|
|
3032
3032
|
}, it = (b, q, T, te) => {
|
|
3033
|
-
|
|
3033
|
+
B("Error fetching", q), T === "refresh" && v("Dynamic Flow - Step Refreshed", { status: "failure" }), v("Dynamic Flow - Flow Finished", { status: "failure" }), d(b, te), P("idle");
|
|
3034
3034
|
}, xt = (b) => {
|
|
3035
3035
|
let { model: q, formSchema: T } = b, { $id: te = "" } = T;
|
|
3036
|
-
|
|
3036
|
+
w(null), W(q) || B("Invalid model on change", "onModelChange was called but the model argument is not an object"), M(te, q, (vr) => {
|
|
3037
3037
|
Oa(b, vr);
|
|
3038
3038
|
});
|
|
3039
3039
|
}, Oa = (b, q) => {
|
|
3040
3040
|
let { triggerSchema: T } = b;
|
|
3041
3041
|
if (hp(b)) {
|
|
3042
3042
|
let te = T.refreshUrl || T.refreshFormUrl, st = (l == null ? void 0 : l.refreshUrl) || (l == null ? void 0 : l.refreshFormUrl), vr = te || st;
|
|
3043
|
-
vr &&
|
|
3043
|
+
vr && Y(vr, Aa(q), g, T);
|
|
3044
3044
|
}
|
|
3045
3045
|
}, zm = async (b) => {
|
|
3046
|
-
if (
|
|
3046
|
+
if (I || b.disabled)
|
|
3047
3047
|
return;
|
|
3048
3048
|
if (b.exit && !b.url) {
|
|
3049
3049
|
ke(b.result);
|
|
3050
3050
|
return;
|
|
3051
3051
|
}
|
|
3052
3052
|
let { data: q, method: T, skipValidation: te } = b, st = s(s({}, Aa(f)), q);
|
|
3053
|
-
fp(T) ? (F(null), te ||
|
|
3053
|
+
fp(T) ? (F(null), te || k(true), (C || te) && await E(b, st)) : await E(b);
|
|
3054
3054
|
};
|
|
3055
|
-
return (0, $e.jsx)(kr, { flowId: e, stepId: (l == null ? void 0 : l.id) || (l == null ? void 0 : l.key), onLog: p, children: (0, $e.jsx)(Mr, { metadata:
|
|
3055
|
+
return (0, $e.jsx)(kr, { flowId: e, stepId: (l == null ? void 0 : l.id) || (l == null ? void 0 : l.key), onLog: p, children: (0, $e.jsx)(Mr, { metadata: _, onEvent: m, children: (0, $e.jsx)(fn, { loading: I, children: (0, $e.jsx)(ei, { httpClient: t, children: (0, $e.jsx)(Fn, { features: i, children: O !== null ? O : (0, $e.jsx)(Jr, { step: l, model: Aa(f), submitted: x, globalError: u, formErrors: y, stepLayoutOptions: { displayStepTitle: n }, onAction: (b) => {
|
|
3056
3056
|
zm(b);
|
|
3057
3057
|
}, onModelChange: xt }) }) }) }) }) });
|
|
3058
3058
|
};
|