@elliemae/ssf-host 2.0.0-next.35 → 2.0.0-next.37
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/dist/cjs/guest.js +4 -4
- package/dist/cjs/host.js +33 -22
- package/dist/cjs/tests/serverHandlers.js +1 -1
- package/dist/esm/guest.js +4 -4
- package/dist/esm/host.js +33 -22
- package/dist/public/index.html +1 -1
- package/dist/public/init.js +1 -1
- package/dist/public/init.js.br +0 -0
- package/dist/public/init.js.gz +0 -0
- package/dist/public/init.js.map +1 -1
- package/dist/public/js/emuiSsfHost.442f50c42583d524d78b.js +3 -0
- package/dist/public/js/emuiSsfHost.442f50c42583d524d78b.js.br +0 -0
- package/dist/public/js/emuiSsfHost.442f50c42583d524d78b.js.gz +0 -0
- package/dist/public/js/emuiSsfHost.442f50c42583d524d78b.js.map +1 -0
- package/dist/types/guest.d.ts +4 -4
- package/dist/types/host.d.ts +4 -9
- package/dist/types/ihost.d.ts +8 -9
- package/dist/types/index.d.ts +1 -1
- package/dist/types/types.d.ts +31 -9
- package/dist/umd/index.js +1 -1
- package/dist/umd/index.js.br +0 -0
- package/dist/umd/index.js.gz +0 -0
- package/dist/umd/index.js.map +1 -1
- package/dist/umd/init.js +1 -1
- package/dist/umd/init.js.br +0 -0
- package/dist/umd/init.js.gz +0 -0
- package/dist/umd/init.js.map +1 -1
- package/package.json +6 -8
- package/dist/public/js/emuiSsfHost.876f7fb29815a11b7a6d.js +0 -3
- package/dist/public/js/emuiSsfHost.876f7fb29815a11b7a6d.js.br +0 -0
- package/dist/public/js/emuiSsfHost.876f7fb29815a11b7a6d.js.gz +0 -0
- package/dist/public/js/emuiSsfHost.876f7fb29815a11b7a6d.js.map +0 -1
package/dist/cjs/guest.js
CHANGED
|
@@ -68,9 +68,9 @@ class Guest {
|
|
|
68
68
|
*/
|
|
69
69
|
__publicField(this, "url");
|
|
70
70
|
/**
|
|
71
|
-
*
|
|
71
|
+
* individual query parameters of the guest application's url parameter string
|
|
72
72
|
*/
|
|
73
|
-
__publicField(this, "
|
|
73
|
+
__publicField(this, "searchParams");
|
|
74
74
|
/**
|
|
75
75
|
* iframe element of the guest application
|
|
76
76
|
*/
|
|
@@ -177,7 +177,7 @@ class Guest {
|
|
|
177
177
|
title,
|
|
178
178
|
url,
|
|
179
179
|
window,
|
|
180
|
-
|
|
180
|
+
searchParams = {},
|
|
181
181
|
openMode = import_types.OpenMode.Embed,
|
|
182
182
|
remoting
|
|
183
183
|
} = option;
|
|
@@ -185,7 +185,7 @@ class Guest {
|
|
|
185
185
|
this.title = title;
|
|
186
186
|
this.url = url;
|
|
187
187
|
this.origin = (0, import_utils.getOrigin)(url);
|
|
188
|
-
this.
|
|
188
|
+
this.searchParams = searchParams;
|
|
189
189
|
this.domElement = domElement;
|
|
190
190
|
this.window = window;
|
|
191
191
|
this.openMode = openMode;
|
package/dist/cjs/host.js
CHANGED
|
@@ -474,8 +474,19 @@ class SSFHost {
|
|
|
474
474
|
}, 1e3));
|
|
475
475
|
});
|
|
476
476
|
__privateAdd(this, _openPopupGuest, (param) => {
|
|
477
|
-
const {
|
|
478
|
-
|
|
477
|
+
const {
|
|
478
|
+
url,
|
|
479
|
+
title,
|
|
480
|
+
popupWindowFeatures = {},
|
|
481
|
+
searchParams,
|
|
482
|
+
guestId
|
|
483
|
+
} = param;
|
|
484
|
+
const {
|
|
485
|
+
width = 800,
|
|
486
|
+
height = 600,
|
|
487
|
+
top = 100,
|
|
488
|
+
left = 100
|
|
489
|
+
} = popupWindowFeatures;
|
|
479
490
|
let guest = __privateGet(this, _getGuestForUrl).call(this, url);
|
|
480
491
|
if (guest) {
|
|
481
492
|
if (!guest.window.closed) {
|
|
@@ -485,7 +496,7 @@ class SSFHost {
|
|
|
485
496
|
});
|
|
486
497
|
}
|
|
487
498
|
} else {
|
|
488
|
-
const
|
|
499
|
+
const windowFeatures = [
|
|
489
500
|
{ key: "width", value: width },
|
|
490
501
|
{ key: "height", value: height },
|
|
491
502
|
{ key: "top", value: top },
|
|
@@ -495,11 +506,7 @@ class SSFHost {
|
|
|
495
506
|
acc += ",";
|
|
496
507
|
return cur.value ? `${acc}${cur.key}=${cur.value}` : acc;
|
|
497
508
|
}, "");
|
|
498
|
-
const guestWindow = window.open(
|
|
499
|
-
url,
|
|
500
|
-
title,
|
|
501
|
-
`popup, ${popupWindowFeatures}`
|
|
502
|
-
);
|
|
509
|
+
const guestWindow = window.open(url, title, `popup, ${windowFeatures}`);
|
|
503
510
|
if (!guestWindow)
|
|
504
511
|
throw new Error("Failed to open guest application in popup window");
|
|
505
512
|
guestWindow.opener = null;
|
|
@@ -508,7 +515,7 @@ class SSFHost {
|
|
|
508
515
|
window: guestWindow,
|
|
509
516
|
title,
|
|
510
517
|
url,
|
|
511
|
-
|
|
518
|
+
searchParams,
|
|
512
519
|
openMode: import_types.OpenMode.Popup
|
|
513
520
|
});
|
|
514
521
|
}
|
|
@@ -519,7 +526,7 @@ class SSFHost {
|
|
|
519
526
|
url,
|
|
520
527
|
title,
|
|
521
528
|
targetElement,
|
|
522
|
-
|
|
529
|
+
searchParams,
|
|
523
530
|
guestId,
|
|
524
531
|
options = {}
|
|
525
532
|
} = param;
|
|
@@ -527,7 +534,8 @@ class SSFHost {
|
|
|
527
534
|
const {
|
|
528
535
|
fitToContent = false,
|
|
529
536
|
disableSandbox = false,
|
|
530
|
-
sandboxValues = []
|
|
537
|
+
sandboxValues = [],
|
|
538
|
+
style = ""
|
|
531
539
|
} = options;
|
|
532
540
|
if (!title)
|
|
533
541
|
throw new Error("title is required");
|
|
@@ -538,7 +546,10 @@ class SSFHost {
|
|
|
538
546
|
frame.addEventListener("load", () => {
|
|
539
547
|
__privateGet(this, _logger).debug(`frame loaded for guest with id '${guestId}'`);
|
|
540
548
|
});
|
|
541
|
-
frame.setAttribute(
|
|
549
|
+
frame.setAttribute(
|
|
550
|
+
"style",
|
|
551
|
+
`min-width: 100%; height: 100%; border: 0px; ${style}`
|
|
552
|
+
);
|
|
542
553
|
if (!disableSandbox) {
|
|
543
554
|
frame.setAttribute(
|
|
544
555
|
"sandbox",
|
|
@@ -557,7 +568,7 @@ class SSFHost {
|
|
|
557
568
|
window: guestFrameEle.contentWindow,
|
|
558
569
|
title,
|
|
559
570
|
url,
|
|
560
|
-
|
|
571
|
+
searchParams,
|
|
561
572
|
openMode: import_types.OpenMode.Embed
|
|
562
573
|
});
|
|
563
574
|
});
|
|
@@ -773,21 +784,21 @@ class SSFHost {
|
|
|
773
784
|
url,
|
|
774
785
|
targetElement,
|
|
775
786
|
title,
|
|
776
|
-
|
|
787
|
+
searchParams = {},
|
|
777
788
|
options = {}
|
|
778
789
|
} = param;
|
|
779
|
-
const { openMode = import_types.OpenMode.Embed,
|
|
790
|
+
const { openMode = import_types.OpenMode.Embed, popupWindowFeatures = {} } = options;
|
|
780
791
|
const guestId = `guest-${this.hostId}-sandbox-${__privateGet(this, _nextGuestId)}`;
|
|
781
792
|
__privateSet(this, _nextGuestId, __privateGet(this, _nextGuestId) + 1);
|
|
782
|
-
const srcUrl = __privateGet(this, _getGuestUrl).call(this, url,
|
|
793
|
+
const srcUrl = __privateGet(this, _getGuestUrl).call(this, url, searchParams);
|
|
783
794
|
let guest = null;
|
|
784
795
|
if (openMode === import_types.OpenMode.Popup) {
|
|
785
796
|
guest = __privateGet(this, _openPopupGuest).call(this, {
|
|
786
797
|
guestId,
|
|
787
798
|
url: srcUrl,
|
|
788
799
|
title,
|
|
789
|
-
|
|
790
|
-
|
|
800
|
+
searchParams,
|
|
801
|
+
popupWindowFeatures
|
|
791
802
|
});
|
|
792
803
|
} else if (openMode === import_types.OpenMode.Embed) {
|
|
793
804
|
guest = __privateGet(this, _openEmbedGuest).call(this, {
|
|
@@ -795,7 +806,7 @@ class SSFHost {
|
|
|
795
806
|
url: srcUrl,
|
|
796
807
|
title,
|
|
797
808
|
targetElement,
|
|
798
|
-
|
|
809
|
+
searchParams,
|
|
799
810
|
options
|
|
800
811
|
});
|
|
801
812
|
} else {
|
|
@@ -817,11 +828,11 @@ class SSFHost {
|
|
|
817
828
|
url,
|
|
818
829
|
targetElement,
|
|
819
830
|
title,
|
|
820
|
-
|
|
831
|
+
searchParamsList = [],
|
|
821
832
|
options = {}
|
|
822
833
|
} = param;
|
|
823
|
-
|
|
824
|
-
this.loadGuest({ url, title, targetElement,
|
|
834
|
+
searchParamsList.forEach((searchParams) => {
|
|
835
|
+
this.loadGuest({ url, title, targetElement, searchParams, options });
|
|
825
836
|
}, this);
|
|
826
837
|
});
|
|
827
838
|
/**
|
|
@@ -33,7 +33,7 @@ __export(serverHandlers_exports, {
|
|
|
33
33
|
module.exports = __toCommonJS(serverHandlers_exports);
|
|
34
34
|
var import_msw = require("msw");
|
|
35
35
|
var import_promises = require("fs/promises");
|
|
36
|
-
var import_node_path = __toESM(require("node:path"));
|
|
36
|
+
var import_node_path = __toESM(require("node:path"), 1);
|
|
37
37
|
const serverHandlers = [
|
|
38
38
|
// frame html
|
|
39
39
|
import_msw.rest.get("http://thirdparty.com", async (req, res, ctx) => {
|
package/dist/esm/guest.js
CHANGED
|
@@ -46,9 +46,9 @@ class Guest {
|
|
|
46
46
|
*/
|
|
47
47
|
__publicField(this, "url");
|
|
48
48
|
/**
|
|
49
|
-
*
|
|
49
|
+
* individual query parameters of the guest application's url parameter string
|
|
50
50
|
*/
|
|
51
|
-
__publicField(this, "
|
|
51
|
+
__publicField(this, "searchParams");
|
|
52
52
|
/**
|
|
53
53
|
* iframe element of the guest application
|
|
54
54
|
*/
|
|
@@ -155,7 +155,7 @@ class Guest {
|
|
|
155
155
|
title,
|
|
156
156
|
url,
|
|
157
157
|
window,
|
|
158
|
-
|
|
158
|
+
searchParams = {},
|
|
159
159
|
openMode = OpenMode.Embed,
|
|
160
160
|
remoting
|
|
161
161
|
} = option;
|
|
@@ -163,7 +163,7 @@ class Guest {
|
|
|
163
163
|
this.title = title;
|
|
164
164
|
this.url = url;
|
|
165
165
|
this.origin = getOrigin(url);
|
|
166
|
-
this.
|
|
166
|
+
this.searchParams = searchParams;
|
|
167
167
|
this.domElement = domElement;
|
|
168
168
|
this.window = window;
|
|
169
169
|
this.openMode = openMode;
|
package/dist/esm/host.js
CHANGED
|
@@ -460,8 +460,19 @@ class SSFHost {
|
|
|
460
460
|
}, 1e3));
|
|
461
461
|
});
|
|
462
462
|
__privateAdd(this, _openPopupGuest, (param) => {
|
|
463
|
-
const {
|
|
464
|
-
|
|
463
|
+
const {
|
|
464
|
+
url,
|
|
465
|
+
title,
|
|
466
|
+
popupWindowFeatures = {},
|
|
467
|
+
searchParams,
|
|
468
|
+
guestId
|
|
469
|
+
} = param;
|
|
470
|
+
const {
|
|
471
|
+
width = 800,
|
|
472
|
+
height = 600,
|
|
473
|
+
top = 100,
|
|
474
|
+
left = 100
|
|
475
|
+
} = popupWindowFeatures;
|
|
465
476
|
let guest = __privateGet(this, _getGuestForUrl).call(this, url);
|
|
466
477
|
if (guest) {
|
|
467
478
|
if (!guest.window.closed) {
|
|
@@ -471,7 +482,7 @@ class SSFHost {
|
|
|
471
482
|
});
|
|
472
483
|
}
|
|
473
484
|
} else {
|
|
474
|
-
const
|
|
485
|
+
const windowFeatures = [
|
|
475
486
|
{ key: "width", value: width },
|
|
476
487
|
{ key: "height", value: height },
|
|
477
488
|
{ key: "top", value: top },
|
|
@@ -481,11 +492,7 @@ class SSFHost {
|
|
|
481
492
|
acc += ",";
|
|
482
493
|
return cur.value ? `${acc}${cur.key}=${cur.value}` : acc;
|
|
483
494
|
}, "");
|
|
484
|
-
const guestWindow = window.open(
|
|
485
|
-
url,
|
|
486
|
-
title,
|
|
487
|
-
`popup, ${popupWindowFeatures}`
|
|
488
|
-
);
|
|
495
|
+
const guestWindow = window.open(url, title, `popup, ${windowFeatures}`);
|
|
489
496
|
if (!guestWindow)
|
|
490
497
|
throw new Error("Failed to open guest application in popup window");
|
|
491
498
|
guestWindow.opener = null;
|
|
@@ -494,7 +501,7 @@ class SSFHost {
|
|
|
494
501
|
window: guestWindow,
|
|
495
502
|
title,
|
|
496
503
|
url,
|
|
497
|
-
|
|
504
|
+
searchParams,
|
|
498
505
|
openMode: OpenMode.Popup
|
|
499
506
|
});
|
|
500
507
|
}
|
|
@@ -505,7 +512,7 @@ class SSFHost {
|
|
|
505
512
|
url,
|
|
506
513
|
title,
|
|
507
514
|
targetElement,
|
|
508
|
-
|
|
515
|
+
searchParams,
|
|
509
516
|
guestId,
|
|
510
517
|
options = {}
|
|
511
518
|
} = param;
|
|
@@ -513,7 +520,8 @@ class SSFHost {
|
|
|
513
520
|
const {
|
|
514
521
|
fitToContent = false,
|
|
515
522
|
disableSandbox = false,
|
|
516
|
-
sandboxValues = []
|
|
523
|
+
sandboxValues = [],
|
|
524
|
+
style = ""
|
|
517
525
|
} = options;
|
|
518
526
|
if (!title)
|
|
519
527
|
throw new Error("title is required");
|
|
@@ -524,7 +532,10 @@ class SSFHost {
|
|
|
524
532
|
frame.addEventListener("load", () => {
|
|
525
533
|
__privateGet(this, _logger).debug(`frame loaded for guest with id '${guestId}'`);
|
|
526
534
|
});
|
|
527
|
-
frame.setAttribute(
|
|
535
|
+
frame.setAttribute(
|
|
536
|
+
"style",
|
|
537
|
+
`min-width: 100%; height: 100%; border: 0px; ${style}`
|
|
538
|
+
);
|
|
528
539
|
if (!disableSandbox) {
|
|
529
540
|
frame.setAttribute(
|
|
530
541
|
"sandbox",
|
|
@@ -543,7 +554,7 @@ class SSFHost {
|
|
|
543
554
|
window: guestFrameEle.contentWindow,
|
|
544
555
|
title,
|
|
545
556
|
url,
|
|
546
|
-
|
|
557
|
+
searchParams,
|
|
547
558
|
openMode: OpenMode.Embed
|
|
548
559
|
});
|
|
549
560
|
});
|
|
@@ -759,21 +770,21 @@ class SSFHost {
|
|
|
759
770
|
url,
|
|
760
771
|
targetElement,
|
|
761
772
|
title,
|
|
762
|
-
|
|
773
|
+
searchParams = {},
|
|
763
774
|
options = {}
|
|
764
775
|
} = param;
|
|
765
|
-
const { openMode = OpenMode.Embed,
|
|
776
|
+
const { openMode = OpenMode.Embed, popupWindowFeatures = {} } = options;
|
|
766
777
|
const guestId = `guest-${this.hostId}-sandbox-${__privateGet(this, _nextGuestId)}`;
|
|
767
778
|
__privateSet(this, _nextGuestId, __privateGet(this, _nextGuestId) + 1);
|
|
768
|
-
const srcUrl = __privateGet(this, _getGuestUrl).call(this, url,
|
|
779
|
+
const srcUrl = __privateGet(this, _getGuestUrl).call(this, url, searchParams);
|
|
769
780
|
let guest = null;
|
|
770
781
|
if (openMode === OpenMode.Popup) {
|
|
771
782
|
guest = __privateGet(this, _openPopupGuest).call(this, {
|
|
772
783
|
guestId,
|
|
773
784
|
url: srcUrl,
|
|
774
785
|
title,
|
|
775
|
-
|
|
776
|
-
|
|
786
|
+
searchParams,
|
|
787
|
+
popupWindowFeatures
|
|
777
788
|
});
|
|
778
789
|
} else if (openMode === OpenMode.Embed) {
|
|
779
790
|
guest = __privateGet(this, _openEmbedGuest).call(this, {
|
|
@@ -781,7 +792,7 @@ class SSFHost {
|
|
|
781
792
|
url: srcUrl,
|
|
782
793
|
title,
|
|
783
794
|
targetElement,
|
|
784
|
-
|
|
795
|
+
searchParams,
|
|
785
796
|
options
|
|
786
797
|
});
|
|
787
798
|
} else {
|
|
@@ -803,11 +814,11 @@ class SSFHost {
|
|
|
803
814
|
url,
|
|
804
815
|
targetElement,
|
|
805
816
|
title,
|
|
806
|
-
|
|
817
|
+
searchParamsList = [],
|
|
807
818
|
options = {}
|
|
808
819
|
} = param;
|
|
809
|
-
|
|
810
|
-
this.loadGuest({ url, title, targetElement,
|
|
820
|
+
searchParamsList.forEach((searchParams) => {
|
|
821
|
+
this.loadGuest({ url, title, targetElement, searchParams, options });
|
|
811
822
|
}, this);
|
|
812
823
|
});
|
|
813
824
|
/**
|
package/dist/public/index.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>Host</title><script src="https://cdn.tailwindcss.com?plugins=forms"></script><script src="https://qa.assets.rd.elliemae.io/pui-diagnostics@3"></script><script defer="defer" src="js/emuiSsfHost.
|
|
1
|
+
<!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>Host</title><script src="https://cdn.tailwindcss.com?plugins=forms"></script><script src="https://qa.assets.rd.elliemae.io/pui-diagnostics@3"></script><script defer="defer" src="js/emuiSsfHost.442f50c42583d524d78b.js"></script></head><body><header class="bg-indigo-300 h-10 flex place-items-center"><div class="px-2">ICE Mortgage Product</div></header><main class="mx-auto max-w-7xl px-2 sm:px-6 lg:px-8"><div class="min-w-0 flex-1 mt-4"><h1 class="text-2xl font-bold leading-7 text-gray-900 sm:truncate sm:text-3xl sm:tracking-tight">Loan Application</h1></div><div id="successFeedback" class="hidden rounded-md bg-green-50 p-4"><div class="flex"><div class="flex-shrink-0"><svg class="h-5 w-5 text-green-400" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z" clip-rule="evenodd"/></svg></div><div class="ml-3"><p class="text-sm font-medium text-green-800">Loan Saved Successfully</p></div></div></div><div id="errorFeedback" class="hidden rounded-md bg-red-50 p-4"><div class="flex"><div class="flex-shrink-0"><svg class="h-5 w-5 text-red-400" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.28 7.22a.75.75 0 00-1.06 1.06L8.94 10l-1.72 1.72a.75.75 0 101.06 1.06L10 11.06l1.72 1.72a.75.75 0 101.06-1.06L11.06 10l1.72-1.72a.75.75 0 00-1.06-1.06L10 8.94 8.28 7.22z" clip-rule="evenodd"/></svg></div><div class="ml-3"><h3 class="text-sm font-medium text-red-800">Credit Score is not meeting the requirement</h3></div></div></div><div class="mt-2 sm:grid sm:grid-cols-2 sm:gap-2"><form class="px-2 py-2 space-y-8 divide-y divide-gray-200 bg-gray-50"><div class="space-y-8 divide-y divide-gray-200 sm:space-y-5"><div class="space-y-6 sm:space-y-5"><div><h3 class="text-lg font-medium leading-6 text-gray-900">Personal Information</h3></div><div class="space-y-6 sm:space-y-5"><div class="sm:grid sm:grid-cols-3 sm:items-start sm:gap-4 sm:border-gray-200"><label for="firstName" class="block text-sm font-medium text-gray-700 sm:mt-px sm:pt-2">First name</label><div class="mt-1 sm:col-span-2 sm:mt-0"><input name="firstName" id="firstName" autocomplete="given-name" class="block w-full max-w-lg rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:max-w-xs sm:text-sm" value="John" placeholder="John"/></div></div><div class="sm:grid sm:grid-cols-3 sm:items-start sm:gap-4 sm:border-gray-200"><label for="lastName" class="block text-sm font-medium text-gray-700 sm:mt-px sm:pt-2">Last name</label><div class="mt-1 sm:col-span-2 sm:mt-0"><input name="lastName" id="lastName" autocomplete="family-name" class="block w-full max-w-lg rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:max-w-xs sm:text-sm" value="Doe" placeholder="Doe"/></div></div><div class="sm:grid sm:grid-cols-3 sm:items-start sm:gap-4 sm:border-gray-200"><label for="ssn" class="block text-sm font-medium text-gray-700 sm:mt-px sm:pt-2">SSN</label><div class="mt-1 sm:col-span-2 sm:mt-0"><input type="number" name="ssn" id="ssn" class="block w-full max-w-lg rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:max-w-xs sm:text-sm" value="123456789" placeholder="123456789"/></div></div></div><div><h3 class="text-lg font-medium leading-6 text-gray-900">Loan Information</h3></div><div class="space-y-6 sm:space-y-5"><div class="sm:grid sm:grid-cols-3 sm:items-start sm:gap-4 sm:border-gray-200"><label for="amount" class="block text-sm font-medium text-gray-700 sm:mt-px sm:pt-2">Amount</label><div class="mt-1 sm:col-span-2 sm:mt-0"><input type="number" name="amount" id="amount" class="block w-full max-w-lg rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:max-w-xs sm:text-sm" value="500000" placeholder="500000"/></div></div><div class="sm:grid sm:grid-cols-3 sm:items-start sm:gap-4 sm:border-gray-200"><label for="Term" class="block text-sm font-medium text-gray-700 sm:mt-px sm:pt-2">Term (years)</label><div class="mt-1 sm:col-span-2 sm:mt-0"><input type="number" name="term" id="term" class="block w-full max-w-lg rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:max-w-xs sm:text-sm" value="30" placeholder="30"/></div></div><div class="sm:grid sm:grid-cols-3 sm:items-start sm:gap-4 sm:border-gray-200"><label for="downPayment" class="block text-sm font-medium text-gray-700 sm:mt-px sm:pt-2">Down Payment</label><div class="mt-1 sm:col-span-2 sm:mt-0"><input type="number" name="downPayment" id="downPayment" class="block w-full max-w-lg rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:max-w-xs sm:text-sm" value="50000" placeholder="50000"/></div></div><div><h3 class="text-lg font-medium leading-6 text-gray-900">Order Services</h3></div><div class="sm:grid sm:grid-cols-3 sm:items-start sm:gap-4 sm:border-gray-200"><div class="mt-1 sm:mt-0"><button id="title" type="button" class="inline-flex items-center rounded-md border border-transparent bg-indigo-600 px-4 py-2 text-sm font-medium text-white shadow-sm hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 disabled:opacity-50 disabled:cursor-not-allowed focus:ring-offset-2"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="w-6 h-6"><path fill-rule="evenodd" d="M7.502 6h7.128A3.375 3.375 0 0118 9.375v9.375a3 3 0 003-3V6.108c0-1.505-1.125-2.811-2.664-2.94a48.972 48.972 0 00-.673-.05A3 3 0 0015 1.5h-1.5a3 3 0 00-2.663 1.618c-.225.015-.45.032-.673.05C8.662 3.295 7.554 4.542 7.502 6zM13.5 3A1.5 1.5 0 0012 4.5h4.5A1.5 1.5 0 0015 3h-1.5z" clip-rule="evenodd"/><path fill-rule="evenodd" d="M3 9.375C3 8.339 3.84 7.5 4.875 7.5h9.75c1.036 0 1.875.84 1.875 1.875v11.25c0 1.035-.84 1.875-1.875 1.875h-9.75A1.875 1.875 0 013 20.625V9.375zM6 12a.75.75 0 01.75-.75h.008a.75.75 0 01.75.75v.008a.75.75 0 01-.75.75H6.75a.75.75 0 01-.75-.75V12zm2.25 0a.75.75 0 01.75-.75h3.75a.75.75 0 010 1.5H9a.75.75 0 01-.75-.75zM6 15a.75.75 0 01.75-.75h.008a.75.75 0 01.75.75v.008a.75.75 0 01-.75.75H6.75a.75.75 0 01-.75-.75V15zm2.25 0a.75.75 0 01.75-.75h3.75a.75.75 0 010 1.5H9a.75.75 0 01-.75-.75zM6 18a.75.75 0 01.75-.75h.008a.75.75 0 01.75.75v.008a.75.75 0 01-.75.75H6.75a.75.75 0 01-.75-.75V18zm2.25 0a.75.75 0 01.75-.75h3.75a.75.75 0 010 1.5H9a.75.75 0 01-.75-.75z" clip-rule="evenodd"/></svg> Title</button></div><div class="mt-1 sm:mt-0"><button id="credit" type="button" class="inline-flex items-center rounded-md border border-transparent bg-indigo-600 px-4 py-2 text-sm font-medium text-white shadow-sm hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 disabled:opacity-50 disabled:cursor-not-allowed focus:ring-offset-2"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="w-6 h-6"><path fill-rule="evenodd" d="M2.25 13.5a8.25 8.25 0 018.25-8.25.75.75 0 01.75.75v6.75H18a.75.75 0 01.75.75 8.25 8.25 0 01-16.5 0z" clip-rule="evenodd"/><path fill-rule="evenodd" d="M12.75 3a.75.75 0 01.75-.75 8.25 8.25 0 018.25 8.25.75.75 0 01-.75.75h-7.5a.75.75 0 01-.75-.75V3z" clip-rule="evenodd"/></svg> Credit Score</button></div></div></div></div></div><div class="flex flex-col"><button id="saveLoan" type="button" class="rounded-md border border-transparent bg-indigo-600 px-4 py-2 text-sm font-medium text-white shadow-sm hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2">Save</button></div></form><div id="aside-container" class="flex flex-col gap-4 items-start mt-4 border-2 p-2 rounded-lg border-dashed border-cyan-300 sm:mt-0"></div></div><div id="bottom-container" class="flex flex-col gap-4 items-start mt-4 p-2 sm:mt-0"></div></main><script src="./init.js" type="module"></script></body></html>
|
package/dist/public/init.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{Loan as c}from"./loan-object.js";import{getGuestBaseUrl as o,getHost as i}from"./utils.js";let n=null,s=null;const r=async()=>{const e=await o();document.getElementById("credit").addEventListener("click",()=>{const{id:t}=n.loadGuest({url:new URL("./creditService.html",e).href,title:"Credit Service Corp",
|
|
1
|
+
import{Loan as c}from"./loan-object.js";import{getGuestBaseUrl as o,getHost as i}from"./utils.js";let n=null,s=null;const r=async()=>{const e=await o();document.getElementById("credit").addEventListener("click",()=>{const{id:t}=n.loadGuest({url:new URL("./creditService.html",e).href,title:"Credit Service Corp",searchParams:{src:new URL("./creditScoreService.js",e).href},targetElement:document.getElementById("bottom-container"),options:{fitToContent:!0}})})},l=async()=>{const e=await o(),t={};n.loadGuest({url:new URL("./pricingService.html",e).href,title:"Pricing Service Corp",params:t,targetElement:document.getElementById("aside-container"),options:{fitToContent:!0}})},d=async()=>{const e=await o(),t={};n.loadGuest({url:new URL("./loanValidation.html",e).href,title:"Loan Validation Service Corp",params:t,targetElement:document.getElementById("bottom-container"),options:{fitToContent:!0}})},m=async()=>{const e=await o(),t={};n.loadGuest({url:new URL("./titleService.html",e).href,title:"Title Service Corp",params:t,targetElement:document.getElementById("aside-container"),options:{openMode:ice.OpenMode.Popup}})},u=()=>{s=new c,n.addScriptingObject(s)},p=async()=>{const e=s.getLoanDetails();(await n.dispatchEvent({event:s.onPreSave,eventParams:e,eventOptions:{timeout:1e3}})).some(a=>a===!1)?document.getElementById("errorFeedback").classList.remove("hidden"):document.getElementById("successFeedback").classList.remove("hidden")},v=()=>{n=i(),u();const e=document.getElementById("saveLoan");e&&e.addEventListener("click",p),r(),l(),d(),document.getElementById("title")?.addEventListener?.("click",m)};window.addEventListener("DOMContentLoaded",v);
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=init.js.map
|
package/dist/public/init.js.br
CHANGED
|
Binary file
|
package/dist/public/init.js.gz
CHANGED
|
Binary file
|
package/dist/public/init.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack://ice/init.js"],"sourcesContent":["import { Loan } from './loan-object.js';\nimport { getGuestBaseUrl, getHost } from './utils.js';\n\nlet host = null;\nlet loanObj = null;\n\nconst setupCreditService = async () => {\n const baseUrl = await getGuestBaseUrl();\n document.getElementById('credit').addEventListener('click', () => {\n const { id } = host.loadGuest({\n url: new URL('./creditService.html', baseUrl).href,\n title: 'Credit Service Corp',\n
|
|
1
|
+
{"version":3,"sources":["webpack://ice/init.js"],"sourcesContent":["import { Loan } from './loan-object.js';\nimport { getGuestBaseUrl, getHost } from './utils.js';\n\nlet host = null;\nlet loanObj = null;\n\nconst setupCreditService = async () => {\n const baseUrl = await getGuestBaseUrl();\n document.getElementById('credit').addEventListener('click', () => {\n const { id } = host.loadGuest({\n url: new URL('./creditService.html', baseUrl).href,\n title: 'Credit Service Corp',\n searchParams: { src: new URL('./creditScoreService.js', baseUrl).href },\n targetElement: document.getElementById('bottom-container'),\n options: { fitToContent: true },\n });\n });\n};\n\nconst setupPricingService = async () => {\n const baseUrl = await getGuestBaseUrl();\n const params = {};\n host.loadGuest({\n url: new URL('./pricingService.html', baseUrl).href,\n title: 'Pricing Service Corp',\n params,\n targetElement: document.getElementById('aside-container'),\n options: { fitToContent: true },\n });\n};\n\nconst setupLoanValidationService = async () => {\n const baseUrl = await getGuestBaseUrl();\n const params = {};\n host.loadGuest({\n url: new URL('./loanValidation.html', baseUrl).href,\n title: 'Loan Validation Service Corp',\n params,\n targetElement: document.getElementById('bottom-container'),\n options: { fitToContent: true },\n });\n};\n\nconst setupTitleService = async () => {\n const baseUrl = await getGuestBaseUrl();\n const params = {};\n host.loadGuest({\n url: new URL('./titleService.html', baseUrl).href,\n title: 'Title Service Corp',\n params,\n targetElement: document.getElementById('aside-container'),\n options: { openMode: ice.OpenMode.Popup },\n });\n};\n\nconst setupLoanObject = () => {\n loanObj = new Loan();\n host.addScriptingObject(loanObj);\n};\n\nconst saveLoan = async () => {\n const loanDetails = loanObj.getLoanDetails();\n const results = await host.dispatchEvent({\n event: loanObj.onPreSave,\n eventParams: loanDetails,\n eventOptions: {\n timeout: 1000,\n },\n });\n if (results.some((result) => result === false)) {\n const errorFeedback = document.getElementById('errorFeedback');\n errorFeedback.classList.remove('hidden');\n } else {\n const successFeedback = document.getElementById('successFeedback');\n successFeedback.classList.remove('hidden');\n }\n};\n\nconst init = () => {\n // elli.ssf.setLogLevel(0);\n host = getHost();\n setupLoanObject();\n const saveLoanButton = document.getElementById('saveLoan');\n if (saveLoanButton) saveLoanButton.addEventListener('click', saveLoan);\n setupCreditService();\n setupPricingService();\n setupLoanValidationService();\n document\n .getElementById('title')\n ?.addEventListener?.('click', setupTitleService);\n};\n\nwindow.addEventListener('DOMContentLoaded', init);\n"],"mappings":"AAAA,OAAS,QAAAA,MAAY,mBACrB,OAAS,mBAAAC,EAAiB,WAAAC,MAAe,aAEzC,IAAIC,EAAO,KACPC,EAAU,KAEd,MAAMC,EAAqB,SAAY,CACrC,MAAMC,EAAU,MAAML,EAAgB,EACtC,SAAS,eAAe,QAAQ,EAAE,iBAAiB,QAAS,IAAM,CAChE,KAAM,CAAE,GAAAM,CAAG,EAAIJ,EAAK,UAAU,CAC5B,IAAK,IAAI,IAAI,uBAAwBG,CAAO,EAAE,KAC9C,MAAO,sBACP,aAAc,CAAE,IAAK,IAAI,IAAI,0BAA2BA,CAAO,EAAE,IAAK,EACtE,cAAe,SAAS,eAAe,kBAAkB,EACzD,QAAS,CAAE,aAAc,EAAK,CAChC,CAAC,CACH,CAAC,CACH,EAEME,EAAsB,SAAY,CACtC,MAAMF,EAAU,MAAML,EAAgB,EAChCQ,EAAS,CAAC,EAChBN,EAAK,UAAU,CACb,IAAK,IAAI,IAAI,wBAAyBG,CAAO,EAAE,KAC/C,MAAO,uBACP,OAAAG,EACA,cAAe,SAAS,eAAe,iBAAiB,EACxD,QAAS,CAAE,aAAc,EAAK,CAChC,CAAC,CACH,EAEMC,EAA6B,SAAY,CAC7C,MAAMJ,EAAU,MAAML,EAAgB,EAChCQ,EAAS,CAAC,EAChBN,EAAK,UAAU,CACb,IAAK,IAAI,IAAI,wBAAyBG,CAAO,EAAE,KAC/C,MAAO,+BACP,OAAAG,EACA,cAAe,SAAS,eAAe,kBAAkB,EACzD,QAAS,CAAE,aAAc,EAAK,CAChC,CAAC,CACH,EAEME,EAAoB,SAAY,CACpC,MAAML,EAAU,MAAML,EAAgB,EAChCQ,EAAS,CAAC,EAChBN,EAAK,UAAU,CACb,IAAK,IAAI,IAAI,sBAAuBG,CAAO,EAAE,KAC7C,MAAO,qBACP,OAAAG,EACA,cAAe,SAAS,eAAe,iBAAiB,EACxD,QAAS,CAAE,SAAU,IAAI,SAAS,KAAM,CAC1C,CAAC,CACH,EAEMG,EAAkB,IAAM,CAC5BR,EAAU,IAAIJ,EACdG,EAAK,mBAAmBC,CAAO,CACjC,EAEMS,EAAW,SAAY,CAC3B,MAAMC,EAAcV,EAAQ,eAAe,GAC3B,MAAMD,EAAK,cAAc,CACvC,MAAOC,EAAQ,UACf,YAAaU,EACb,aAAc,CACZ,QAAS,GACX,CACF,CAAC,GACW,KAAMC,GAAWA,IAAW,EAAK,EACrB,SAAS,eAAe,eAAe,EAC/C,UAAU,OAAO,QAAQ,EAEf,SAAS,eAAe,iBAAiB,EACjD,UAAU,OAAO,QAAQ,CAE7C,EAEMC,EAAO,IAAM,CAEjBb,EAAOD,EAAQ,EACfU,EAAgB,EAChB,MAAMK,EAAiB,SAAS,eAAe,UAAU,EACrDA,GAAgBA,EAAe,iBAAiB,QAASJ,CAAQ,EACrER,EAAmB,EACnBG,EAAoB,EACpBE,EAA2B,EAC3B,SACG,eAAe,OAAO,GACrB,mBAAmB,QAASC,CAAiB,CACnD,EAEA,OAAO,iBAAiB,mBAAoBK,CAAI","names":["Loan","getGuestBaseUrl","getHost","host","loanObj","setupCreditService","baseUrl","id","setupPricingService","params","setupLoanValidationService","setupTitleService","setupLoanObject","saveLoan","loanDetails","result","init","saveLoanButton"],"sourceRoot":"","file":"init.js"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
(function(D,P){typeof exports=="object"&&typeof module=="object"?module.exports=P():typeof define=="function"&&define.amd?define([],P):typeof exports=="object"?exports.ice=P():D.ice=P()})(globalThis,()=>(()=>{"use strict";var j={};j.d=(e,i)=>{for(var o in i)j.o(i,o)&&!j.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:i[o]})},j.o=(e,i)=>Object.prototype.hasOwnProperty.call(e,i),j.r=e=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var D={};j.r(D),j.d(D,{Event:()=>P,Guest:()=>Ue,IFrameSandboxValues:()=>G,OpenMode:()=>S,SSFHost:()=>gt,ScriptingObject:()=>Ce});class P{scriptingObject;name;objectId;requiresFeedback;id;constructor(i){const{name:o,requiresFeedback:t=!1,so:s}=i;if(!o)throw new Error("Event name is required");if(!s)throw new Error("Scripting object is required");this.scriptingObject=s,this.objectId=s.id,this.name=o,this.id=`${this.objectId}.${this.name}`.toLowerCase(),this.requiresFeedback=t}}const Xe=e=>e instanceof P,ft=(e,i)=>`${e.toLowerCase()}.${i.toLowerCase()}`;var Ye=Object.defineProperty,Ke=(e,i,o)=>i in e?Ye(e,i,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[i]=o,le=(e,i,o)=>(Ke(e,typeof i!="symbol"?i+"":i,o),o),Ge=(e,i,o)=>{if(!i.has(e))throw TypeError("Cannot "+o)},F=(e,i,o)=>(Ge(e,i,"read from private field"),o?o.call(e):i.get(e)),Ae=(e,i,o)=>{if(i.has(e))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(e):i.set(e,o)},Te=(e,i,o,t)=>(Ge(e,i,"write to private field"),t?t.call(e,o):i.set(e,o),o),B,R;const Qe="function",Ze=(e,i)=>typeof e===Qe&&!!i&&!i.startsWith("_");class Ce{constructor(i,o){Ae(this,B,void 0),Ae(this,R,"Object"),le(this,"_toJSON",()=>{const t=[],s=[];return Object.keys(this).forEach(r=>{const c=this[r];Xe(c)?s.push(r):Ze(c,r)&&t.push(r)}),{objectId:F(this,B),objectType:F(this,R),functions:t,events:s}}),le(this,"_dispose",()=>{}),le(this,"dispose",()=>{}),Te(this,B,i),Te(this,R,o||F(this,R))}get id(){return F(this,B)}get objectType(){return F(this,R)}}B=new WeakMap,R=new WeakMap;var O=(e=>(e.GuestReady="guest:ready",e.GuestClose="guest:close",e.GuestReadyComplete="guest:readyComplete",e.GuestResize="guest:resize",e.GuestFocus="guest:focus",e.HandShake="handshake",e.HandShakeAck="handshake:ack",e.ObjectInvoke="object:invoke",e.ObjectGet="object:get",e.ObjectEvent="object:event",e.HostConfig="host:config",e))(O||{}),S=(e=>(e.Popup="popup",e.Embed="embed",e))(S||{}),G=(e=>(e.AllowDownloadsWithoutUserActivation="allow-downloads-without-user-activation",e.AllowDownloads="allow-downloads",e.AllowForms="allow-forms",e.AllowModals="allow-modals",e.AllowOrientationLock="allow-orientation-lock",e.AllowPointerLock="allow-pointer-lock",e.AllowPopups="allow-popups",e.AllowPopupsToEscapeSandbox="allow-popups-to-escape-sandbox",e.AllowPresentation="allow-presentation",e.AllowSameOrigin="allow-same-origin",e.AllowScripts="allow-scripts",e.AllowStorageAccessByUserActivation="allow-storage-access-by-user-activation",e.AllowTopNavigation="allow-top-navigation",e.AllowTopNavigationByUserActivation="allow-top-navigation-by-user-activation",e))(G||{});const Ve=e=>{if(e==="about:blank")return"*";const{origin:i}=new URL(e);return i==="null"||!i?e:i},qe=(e,i=[])=>{const o=i||[];return e&&e.forEach?e.forEach(t=>{qe(t,o)}):typeof e<"u"&&o.push(e),o},vt=e=>typeof e?._toJSON=="function";function Re(e){return typeof e=="function"}const et=e=>e?.constructor?.name==="Proxy",mt=e=>e?.id??e;var tt=Object.defineProperty,it=(e,i,o)=>i in e?tt(e,i,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[i]=o,_=(e,i,o)=>(it(e,typeof i!="symbol"?i+"":i,o),o),xe=(e,i,o)=>{if(!i.has(e))throw TypeError("Cannot "+o)},x=(e,i,o)=>(xe(e,i,"read from private field"),o?o.call(e):i.get(e)),st=(e,i,o)=>{if(i.has(e))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(e):i.set(e,o)},nt=(e,i,o,t)=>(xe(e,i,"write to private field"),t?t.call(e,o):i.set(e,o),o),$;class Ue{constructor(i){_(this,"id"),_(this,"title"),_(this,"url"),_(this,"searchParams"),_(this,"domElement"),_(this,"window"),_(this,"openMode"),_(this,"origin"),_(this,"initialized",!1),_(this,"ready",!1),_(this,"capabilities"),st(this,$,void 0),_(this,"dispose",()=>{x(this,$).removeSender({origin:this.origin,window:this.window}),this.openMode===S.Popup?this.window.close():this.domElement?.remove?.()}),_(this,"getInfo",()=>({guestId:this.id,guestTitle:this.title,guestUrl:this.url})),_(this,"init",()=>{if(x(this,$).addSender({origin:this.origin,window:this.window}),this.openMode===S.Popup){const p=setInterval(()=>{x(this,$).send({targetWin:this.window,targetOrigin:this.origin,messageType:O.HandShake,messageBody:{}})},1e3);x(this,$).listen({messageType:O.HandShakeAck,callback:()=>{clearInterval(p)}})}}),_(this,"dispatchEvent",(p,m)=>x(this,$).invoke({targetWin:this.window,targetOrigin:this.origin,messageType:O.ObjectEvent,messageBody:p,responseTimeoutMs:m})),_(this,"send",p=>{x(this,$).send({targetWin:this.window,targetOrigin:this.origin,...p})});const{guestId:o,domElement:t=null,title:s,url:r,window:c,searchParams:a={},openMode:h=S.Embed,remoting:g}=i;this.id=o,this.title=s,this.url=r,this.origin=Ve(r),this.searchParams=a,this.domElement=t,this.window=c,this.openMode=h,this.capabilities={},nt(this,$,g)}}$=new WeakMap;const Le={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let Q;const ot=new Uint8Array(16);function rt(){if(!Q&&(Q=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Q))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Q(ot)}const b=[];for(let e=0;e<256;++e)b.push((e+256).toString(16).slice(1));function ze(e,i=0){return(b[e[i+0]]+b[e[i+1]]+b[e[i+2]]+b[e[i+3]]+"-"+b[e[i+4]]+b[e[i+5]]+"-"+b[e[i+6]]+b[e[i+7]]+"-"+b[e[i+8]]+b[e[i+9]]+"-"+b[e[i+10]]+b[e[i+11]]+b[e[i+12]]+b[e[i+13]]+b[e[i+14]]+b[e[i+15]]).toLowerCase()}function yt(e,i=0){const o=ze(e,i);if(!validate(o))throw TypeError("Stringified UUID is invalid");return o}const _t=null;function at(e,i,o){if(Le.randomUUID&&!i&&!e)return Le.randomUUID();e=e||{};const t=e.random||(e.rng||rt)();if(t[6]=t[6]&15|64,t[8]=t[8]&63|128,i){o=o||0;for(let s=0;s<16;++s)i[o+s]=t[s];return i}return ze(t)}const Ne=at;var ct=Object.defineProperty,lt=(e,i,o)=>i in e?ct(e,i,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[i]=o,W=(e,i,o)=>(lt(e,typeof i!="symbol"?i+"":i,o),o),De=(e,i,o)=>{if(!i.has(e))throw TypeError("Cannot "+o)},l=(e,i,o)=>(De(e,i,"read from private field"),o?o.call(e):i.get(e)),k=(e,i,o)=>{if(i.has(e))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(e):i.set(e,o)},Z=(e,i,o,t)=>(De(e,i,"write to private field"),t?t.call(e,o):i.set(e,o),o),H,w,J,A,T,U,he,de,ue,V,pe,ge,we,X;const Fe="elli:remoting",Be="elli:remoting:response",He="elli:remoting:exception",Y=({messageType:e,messageBody:i,onewayMsg:o=!1})=>({requestId:o?null:Ne(),source:Fe,type:e,body:i}),Et=e=>{const{targetWin:i,targetOrigin:o,messageType:t,messageBody:s}=e,r=Y({messageType:t,messageBody:s});i.postMessage(r,o)};class ht{constructor(i,o){if(k(this,H,void 0),k(this,w,void 0),k(this,J,new Map),k(this,A,new Map),k(this,T,null),k(this,U,new Map),k(this,he,()=>{const t=Date.now(),s=[];l(this,A).forEach((r,c)=>{const{requestId:a,cancelTime:h}=r;l(this,w).debug(`Checking response timeout for requestId: ${a}) @ ${h??""}`),r.cancelTime&&r.cancelTime<t&&(l(this,w).debug(`Detected response timeout for requestId: ${a}...`),s.push(c),r.resolve(),l(this,w).debug(`Aborted waiting for response to requestid: ${a})`))}),s.forEach(r=>{l(this,w).debug(`removing invocations with requestId ${r} from cache since response time has expired`),l(this,A).delete(r)}),l(this,A).size===0&&(l(this,w).debug("stopping response monitor"),l(this,ue).call(this))}),k(this,de,()=>{l(this,T)===null&&(l(this,w).debug("Staring response timeout evaluator"),Z(this,T,window.setInterval(l(this,he),200)))}),k(this,ue,()=>{l(this,T)!==null&&(window.clearInterval(l(this,T)),Z(this,T,null),l(this,w).debug("Stopped response timeout evaluator"))}),k(this,V,t=>{const s=l(this,A).get(t);return l(this,w).debug(`serving requestId: ${t}`),l(this,A).delete(t),s}),k(this,pe,t=>{const{requestId:s}=t;l(this,w).debug(`Response received for invocation requestId: ${s}`);const r=l(this,V).call(this,s);return r?(r.resolve(t.body),!0):(l(this,w).warn(`Received response to stale/invalid request with requestId: ${s}`),!1)}),k(this,ge,t=>{l(this,w).debug(`Exception received for invocation (requestId = ${t.requestId})`);const s=l(this,V).call(this,t.requestId);return s?(s.reject(new Error(t.body)),!0):(l(this,w).warn(`Received exception for stale/invalid request (requestId = ${t.requestId})`),!1)}),k(this,we,({sourceWin:t,sourceOrigin:s,message:r})=>{l(this,w).debug(`Received message of type "${r.type}"`);const c=l(this,J).get(r.type);return c?(c.forEach(a=>{l(this,w).debug(`Invoking message handler ${a.name}`),a({sourceWin:t,sourceOrigin:s,requestId:r.requestId,type:r.type,body:r.body})}),!0):!1}),k(this,X,t=>{if(l(this,w).debug(`Remoting: Received message ${JSON.stringify(t.data)}`),l(this,U).size===0||!t.source)return!1;const s=l(this,U).get(t.source);return!s||t?.data?.source!==Fe?!1:(t.data.type===Be?l(this,pe).call(this,t.data):t.data.type===He?l(this,ge).call(this,t.data):l(this,we).call(this,{sourceWin:t.source,sourceOrigin:s,message:t.data}),!0)}),W(this,"addSender",t=>{const{origin:s,window:r}=t;if(!s)throw new Error("origin is required");if(!r)throw new Error("window is required");l(this,U).set(r,s)}),W(this,"initialize",t=>{t.removeEventListener("message",l(this,X)),t.addEventListener("message",l(this,X)),l(this,w).debug(`initialized remoting id: ${l(this,H)}`)}),W(this,"close",()=>{window.removeEventListener("message",l(this,X)),l(this,w).debug(`closed remoting id: ${l(this,H)}`)}),W(this,"invoke",t=>{const{targetWin:s,targetOrigin:r,messageType:c,messageBody:a,responseTimeoutMs:h}=t;return new Promise((g,p)=>{const m=Y({messageType:c,messageBody:a});l(this,A).set(m.requestId,{requestId:m.requestId,resolve:g,reject:p,cancelTime:h?Date.now()+Number.parseInt(h,10):null}),s.postMessage(m,r);const{requestId:E}=m;l(this,w).debug(`Posted invocation message of type ${c} requestId: ${E||""}`),h&&(l(this,w).debug(`starting response monitor for requestId: ${E||""} for ${h} ms`),l(this,de).call(this))})}),W(this,"listen",t=>{const{messageType:s,callback:r}=t,c=l(this,J).get(s)||[];c.push(r),l(this,J).set(s,c)}),W(this,"send",t=>{const{targetWin:s,targetOrigin:r,messageType:c,messageBody:a}=t,h=Y({messageType:c,messageBody:a,onewayMsg:!0});s.postMessage(h,r),l(this,w).debug(`Posted one-way message of type "${c}"`)}),W(this,"removeSender",t=>{const{window:s}=t;s&&l(this,U).delete(s)}),W(this,"respond",t=>{const{targetWin:s,targetOrigin:r,requestId:c,response:a}=t,h=Y({messageType:Be,messageBody:a});h.requestId=c,s.postMessage(h,r),l(this,w).debug(`Response sent to caller for invocation requestId: ${c}`)}),W(this,"raiseException",t=>{const{targetWin:s,targetOrigin:r,requestId:c,ex:a}=t,h=Y({messageType:He,messageBody:a});h.requestId=c,s.postMessage(h,r),l(this,w).debug(`Exception sent to caller for invocation. requestId: ${c}`)}),!i)throw new Error("logger is required");if(!o)throw new Error("correlationId is required");Z(this,H,o),Z(this,w,i)}}H=new WeakMap,w=new WeakMap,J=new WeakMap,A=new WeakMap,T=new WeakMap,U=new WeakMap,he=new WeakMap,de=new WeakMap,ue=new WeakMap,V=new WeakMap,pe=new WeakMap,ge=new WeakMap,we=new WeakMap,X=new WeakMap;var dt=Object.defineProperty,ut=(e,i,o)=>i in e?dt(e,i,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[i]=o,M=(e,i,o)=>(ut(e,typeof i!="symbol"?i+"":i,o),o),Je=(e,i,o)=>{if(!i.has(e))throw TypeError("Cannot "+o)},n=(e,i,o)=>(Je(e,i,"read from private field"),o?o.call(e):i.get(e)),u=(e,i,o)=>{if(i.has(e))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(e):i.set(e,o)},L=(e,i,o,t)=>(Je(e,i,"write to private field"),t?t.call(e,o):i.set(e,o),o),v,z,d,K,I,C,ee,te,ie,q,fe,ve,se,me,ne,be,oe,ye,_e,Ee,ke,Oe,Me,Ie,Se,re,$e,We,je,Pe;const pt=[G.AllowScripts,G.AllowPopups,G.AllowModals,G.AllowForms,G.AllowDownloads,G.AllowSameOrigin].join(" ");class gt{constructor(i,o){if(M(this,"hostId"),u(this,v,void 0),u(this,z,void 0),u(this,d,void 0),u(this,K,1),u(this,I,new Map),u(this,C,new Map),u(this,ee,null),u(this,te,null),u(this,ie,()=>{for(const t of n(this,I).values())t.openMode===S.Popup&&this.unloadGuest(t.id)}),u(this,q,t=>{for(const s of n(this,I).values())if(s.window===t)return s;return null}),u(this,fe,t=>{for(const s of n(this,I).values())if(s.url===t)return s;return null}),u(this,ve,t=>typeof t?._toJSON=="function"),u(this,se,t=>n(this,ve).call(this,t)?(this.addScriptingObject(t),{type:"object",object:t._toJSON()}):{type:"value",value:t}),u(this,me,t=>typeof t=="string"?t:t instanceof Error?t.message:"An unexpected error occurred in the host application"),u(this,ne,t=>{t.ready&&n(this,v).send({targetWin:t.window,targetOrigin:t.origin,messageType:O.HostConfig,messageBody:{logLevel:n(this,d).getLogLevel(),...t.getInfo()}})}),u(this,be,({guest:t,obj:s,functionName:r,functionParams:c})=>{const a=s[r];return Re(a)?(n(this,d).debug(`Invoking host implementation of ${s.id}.${String(r)}()`),new Promise(h=>{Object.prototype.hasOwnProperty.call(a,"callContext")||Object.defineProperty(a,"callContext",{value:{guest:t},enumerable:!0}),h(a(...c))})):(n(this,d).warn(`Attempt to call invalid function on object type ${s.objectType}: ${String(r)}`),Promise.reject(new Error(`Method '${r}' not found in Scripting Object '${s.id}'`)))}),u(this,oe,({sourceWin:t,sourceOrigin:s,requestId:r})=>{var c;const a=n(this,q).call(this,t);if(!a){n(this,d).warn(`Received ready event for unknown guest. requestId: ${r}`);return}if(!a.initialized){n(this,d).warn("Guest must be initialized before it is marked as ready"),n(this,v).raiseException({targetWin:t,targetOrigin:s,requestId:r,ex:"Guest must be initialized before it is marked as ready"});return}a.ready||(a.ready=!0,n(this,ne).call(this,a),(c=n(this,ee))==null||c.call(this,a),n(this,d).audit({message:"Guest is ready",...a.getInfo()}))}),u(this,ye,({sourceWin:t,sourceOrigin:s,requestId:r,body:c})=>{const a=n(this,q).call(this,t);if(!a){n(this,d).warn(`Received ready event for unknown guest. requestid = ${r}`);return}a.initialized||(a.initialized=!0,a.capabilities=c||{},n(this,d).audit({message:"Guest is initialized",...a.getInfo()})),(!c||!c.onReady)&&n(this,oe).call(this,{sourceWin:t,sourceOrigin:s,requestId:r,type:"",body:null})}),u(this,_e,({sourceWin:t})=>{t?.window&&this.unloadGuest(t)}),u(this,Ee,({sourceWin:t,sourceOrigin:s,requestId:r,body:c})=>{const{objectId:a}=c;n(this,d).debug(`Processing getObject request for object ${a}. requestId = ${r}`);const h=n(this,q).call(this,t);if(!h)return n(this,d).warn("Rejected object request from unknown guest window"),n(this,v).raiseException({targetWin:t,targetOrigin:s,requestId:r,ex:"Specified window is not a known guest"}),!1;const g=this.getScriptingObject(a);return g?(n(this,v).respond({targetWin:t,targetOrigin:s,requestId:r,response:n(this,se).call(this,g)}),n(this,d).audit({message:"Scripting Object returned",requestId:r,scriptingObject:a,...h.getInfo()}),!0):(n(this,d).warn(`unknown or unauthorized object ${a} from guest ${h.id}`),n(this,v).raiseException({targetWin:t,targetOrigin:s,requestId:r,ex:`The requested object (${a}) is not available`}),!1)}),u(this,ke,({sourceWin:t,requestId:s,body:r})=>{const c=n(this,q).call(this,t);if(!c){n(this,d).warn(`Received resize event from unknown guest. requestid = ${s}`);return}c.domElement&&(c.domElement.style.height=`${r.height}px`),n(this,d).debug(`Guest ${c.id} resized to ${r.width}x${r.height}`)}),u(this,Oe,({sourceWin:t,sourceOrigin:s,requestId:r,body:c})=>{const{objectId:a}=c,h=n(this,q).call(this,t);if(!h)return n(this,d).warn("Rejected method invocation request from unknown guest window"),n(this,v).raiseException({targetWin:t,targetOrigin:s,requestId:r,ex:"Specified window is not a known guest"}),!1;n(this,d).debug(`Function ${a}.${String(c.functionName)}() called from guest "${h.id}" (requestId = ${r})`);const g=this.getScriptingObject(a);return g?(n(this,be).call(this,{guest:h,obj:g,functionName:c.functionName,functionParams:c.functionParams}).then(p=>{n(this,v).respond({targetWin:t,targetOrigin:s,requestId:r,response:n(this,se).call(this,p)}),n(this,d).audit({message:"Value returned for Scripting Object method call",requestId:r,scriptingObject:a,scriptingMethod:c.functionName,...h.getInfo()})}).catch(p=>{n(this,v).raiseException({targetWin:t,targetOrigin:h.origin,requestId:r,ex:n(this,me).call(this,p)}),n(this,d).audit({message:"Exception thrown for Scripting Object method call",requestId:r,scriptingObject:a,scriptingMethod:c.functionName,...h.getInfo()})}),!0):(n(this,d).warn(`Invocation of unknown or unauthorized object ${a} from guest ${h.id}`),n(this,v).raiseException({targetWin:t,targetOrigin:s,requestId:r,ex:`The requested object (${a}) is not available`}),!1)}),u(this,Me,()=>{n(this,v).listen({messageType:O.GuestResize,callback:n(this,ke)})}),u(this,Ie,()=>{n(this,v).listen({messageType:O.GuestReady,callback:n(this,ye)}),n(this,v).listen({messageType:O.GuestReadyComplete,callback:n(this,oe)}),n(this,v).listen({messageType:O.GuestClose,callback:n(this,_e)}),n(this,v).listen({messageType:O.ObjectGet,callback:n(this,Ee)}),n(this,v).listen({messageType:O.ObjectInvoke,callback:n(this,Oe)}),window.addEventListener("visibilitychange",n(this,ie))}),u(this,Se,t=>t?.constructor?.name==="ProxyEvent"),u(this,re,t=>{const s=new Ue({...t,remoting:n(this,v)});return s.init(),n(this,I).set(t.guestId,s),s}),u(this,$e,()=>{L(this,te,setInterval(()=>{const t=[];n(this,I).forEach(s=>{s.openMode===S.Popup&&s.window.closed&&t.push(s)}),t.forEach(s=>{this.unloadGuest(s.id)})},1e3))}),u(this,We,t=>{const{url:s,title:r,popupWindowFeatures:c={},searchParams:a,guestId:h}=t,{width:g=800,height:p=600,top:m=100,left:E=100}=c;let y=n(this,fe).call(this,s);if(y)y.window.closed||y.send({messageType:O.GuestFocus,messageBody:{}});else{const ae=[{key:"width",value:g},{key:"height",value:p},{key:"top",value:m},{key:"left",value:E}].reduce((N,ce,wt)=>(wt>0&&ce.value&&(N+=","),ce.value?`${N}${ce.key}=${ce.value}`:N),""),f=window.open(s,r,`popup, ${ae}`);if(!f)throw new Error("Failed to open guest application in popup window");f.opener=null,y=n(this,re).call(this,{guestId:h,window:f,title:r,url:s,searchParams:a,openMode:S.Popup})}return y}),u(this,je,t=>{const{url:s,title:r,targetElement:c,searchParams:a,guestId:h,options:g={}}=t,p=c.ownerDocument??document,{fitToContent:m=!1,disableSandbox:E=!1,sandboxValues:y=[],style:ae=""}=g;if(!r)throw new Error("title is required");m&&n(this,Me).call(this);const f=p.createElement("iframe");f.setAttribute("id",h),f.addEventListener("load",()=>{n(this,d).debug(`frame loaded for guest with id '${h}'`)}),f.setAttribute("style",`min-width: 100%; height: 100%; border: 0px; ${ae}`),E||f.setAttribute("sandbox",`${pt} ${y.join(" ")}`),f.setAttribute("title",r),f.setAttribute("src",s),c.appendChild(f);const N=p.getElementById(h);return n(this,re).call(this,{guestId:h,domElement:N,window:N.contentWindow,title:r,url:s,searchParams:a,openMode:S.Embed})}),u(this,Pe,(t,s)=>{let r="";return Object.keys(s).forEach(c=>{r+=`${(r.length?"&":"")+encodeURIComponent(c)}=${encodeURIComponent(s[c])}`}),t+(r?(t.indexOf("?")>=0?"&":"?")+r:"")}),M(this,"addScriptingObject",t=>{if(!t?.id||!t?._toJSON)throw new Error("Object is not derived from ScriptingObject");if(t.id.toLowerCase()==="module")throw new Error("Do not publish the module object. Create a concrete object derived from it.");n(this,C).set(t.id,t)}),M(this,"cloneScriptingObject",(t,s)=>{if(!t)throw new Error("proxy is required");if(!s)throw new Error("guest is required");const r=new Ce(t.id,t.objectType);let c=[];return Object.keys(t).forEach(a=>{const h=t[a];if(n(this,Se).call(this,h)){const g=new P({name:h.name,requiresFeedback:!1,so:r});Object.defineProperty(r,a,{value:g,enumerable:!0});const p=({eventParams:E,eventOptions:y})=>this.dispatchEvent({event:g,eventParams:E,eventOptions:y}),m=s.subscribe({eventId:h.id,callback:p});c.push(()=>{s.unsubscribe({eventId:h.id,token:m})})}else if(Re(h)&&(Object.defineProperty(r,a,{value:async(...g)=>{const p=await h(...g);return et(p)?this.cloneScriptingObject(p,s):p},enumerable:!0}),a==="dispose")){const g=r.dispose;Object.defineProperty(r,a,{value:()=>(r._dispose(),g.apply(r)),enumerable:!0})}}),r._dispose=()=>{c.forEach(a=>{a?.()}),c=[]},r}),M(this,"close",()=>{clearInterval(n(this,te)),n(this,v).close(),window.removeEventListener("visibilitychange",n(this,ie)),n(this,d).debug(`host is closed. hostId: ${this.hostId}, correlationId: ${n(this,z)}`)}),M(this,"dispatchEvent",async t=>{const{event:{id:s,name:r,scriptingObject:c},eventParams:a,eventOptions:h={}}=t,{eventHandler:g=null,timeout:p=null,window:m=null}=h,E={object:c._toJSON(),eventName:r,eventParams:a,eventHandler:g,eventOptions:{allowsFeedback:!1}};p&&!Number.isNaN(p)&&(E.eventOptions={allowsFeedback:!0,timeout:Number(p)});const y=[];return n(this,I).forEach(f=>{(!m||m===f.window)&&(p&&f?.capabilities?.eventFeedback?(y.push(f.dispatchEvent(E,p)),n(this,d).audit({message:"Event dispatched and awaiting feedback",scriptingEventId:s,...f.getInfo()})):(f.send({messageType:O.ObjectEvent,messageBody:E}),n(this,d).audit({message:"Event dispatched",scriptingEventId:s,...f.getInfo()})))}),await Promise.all(y).then(f=>(n(this,d).audit({message:"Event feedback received",scriptingEventId:s}),qe(f))).catch(f=>{throw n(this,d).error({message:"Error processing event",eventId:s,exception:f}),f})}),M(this,"getGuests",()=>{const t=[];return n(this,I).forEach(s=>{t.push(s)}),t}),M(this,"getScriptingObject",t=>n(this,C).has(t)?n(this,C).get(t):null),M(this,"loadGuest",t=>{const{url:s,targetElement:r,title:c,searchParams:a={},options:h={}}=t,{openMode:g=S.Embed,popupWindowFeatures:p={}}=h,m=`guest-${this.hostId}-sandbox-${n(this,K)}`;L(this,K,n(this,K)+1);const E=n(this,Pe).call(this,s,a);let y=null;if(g===S.Popup)y=n(this,We).call(this,{guestId:m,url:E,title:c,searchParams:a,popupWindowFeatures:p});else if(g===S.Embed)y=n(this,je).call(this,{guestId:m,url:E,title:c,targetElement:r,searchParams:a,options:h});else throw new Error(`Invalid openMode: ${g}`);return n(this,d).audit({message:"Guest loaded",...y.getInfo()}),y}),M(this,"loadGuests",t=>{const{url:s,targetElement:r,title:c,searchParamsList:a=[],options:h={}}=t;a.forEach(g=>{this.loadGuest({url:s,title:c,targetElement:r,searchParams:g,options:h})},this)}),M(this,"removeAllScriptingObjects",()=>{Array.from(n(this,C).keys()).forEach(s=>{this.removeScriptingObject(s)})}),M(this,"removeScriptingObject",t=>{const s=this.getScriptingObject(t);s&&(s._dispose&&typeof s._dispose=="function"&&s._dispose(),n(this,C).delete(t))}),M(this,"setLogLevel",t=>{n(this,d).setLogLevel(t),n(this,I).forEach(n(this,ne)),n(this,d).debug("Dispatched config events to all guests")}),M(this,"unloadGuest",t=>{let s=typeof t=="string"?n(this,I).get(t):null;if(!s&&(s=Array.from(n(this,I).values()).find(r=>r.window===t||r.domElement===t),!s))throw new Error("Invalid guestId or guestWindow reference");s.dispose(),n(this,I).delete(s.id),n(this,d).audit({message:"Guest is removed from host",...s.getInfo()})}),this.hostId=i,!o?.logger)throw new Error("Logger is required");if(L(this,d,o.logger),L(this,z,Ne()),L(this,v,new ht(n(this,d),n(this,z))),o?.readyStateCallback&&typeof o?.readyStateCallback!="function")throw new Error("readyStateCallback must be a function");L(this,ee,o?.readyStateCallback||null),n(this,v).initialize(window),n(this,Ie).call(this),n(this,$e).call(this),n(this,d).debug(`host is initialized. hostId: ${this.hostId}, correlationId: ${n(this,z)}`)}}return v=new WeakMap,z=new WeakMap,d=new WeakMap,K=new WeakMap,I=new WeakMap,C=new WeakMap,ee=new WeakMap,te=new WeakMap,ie=new WeakMap,q=new WeakMap,fe=new WeakMap,ve=new WeakMap,se=new WeakMap,me=new WeakMap,ne=new WeakMap,be=new WeakMap,oe=new WeakMap,ye=new WeakMap,_e=new WeakMap,Ee=new WeakMap,ke=new WeakMap,Oe=new WeakMap,Me=new WeakMap,Ie=new WeakMap,Se=new WeakMap,re=new WeakMap,$e=new WeakMap,We=new WeakMap,je=new WeakMap,Pe=new WeakMap,D})());
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=emuiSsfHost.442f50c42583d524d78b.js.map
|
|
Binary file
|
|
Binary file
|