@elliemae/ssf-host 2.9.4 → 2.16.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/host.js +96 -42
- package/dist/cjs/index.html +1 -1
- package/dist/cjs/index.js +3 -3
- package/dist/cjs/tests/scriptingObjects/appObjects.js +13 -1
- package/dist/cjs/tests/scriptingObjects/appraisalServiceModule.js +8 -8
- package/dist/cjs/tests/scriptingObjects/floodServiceModule.js +6 -4
- package/dist/cjs/utils.js +0 -5
- package/dist/cjs/v1-guest-v2-host.html +1 -1
- package/dist/cjs/v2-host-v1-guest.html +1 -1
- package/dist/esm/host.js +99 -44
- package/dist/esm/index.html +1 -1
- package/dist/esm/tests/scriptingObjects/appObjects.js +13 -1
- package/dist/esm/tests/scriptingObjects/appraisalServiceModule.js +8 -8
- package/dist/esm/tests/scriptingObjects/floodServiceModule.js +6 -4
- package/dist/esm/utils.js +0 -5
- package/dist/esm/v1-guest-v2-host.html +1 -1
- package/dist/esm/v2-host-v1-guest.html +1 -1
- package/dist/public/analytics-object-v1.js +1 -1
- package/dist/public/analytics-object-v1.js.br +0 -0
- package/dist/public/analytics-object-v1.js.gz +0 -0
- package/dist/public/analytics-object-v1.js.map +1 -1
- package/dist/public/analytics-object-v2.js +1 -1
- package/dist/public/analytics-object-v2.js.br +0 -0
- package/dist/public/analytics-object-v2.js.gz +0 -0
- package/dist/public/analytics-object-v2.js.map +1 -1
- package/dist/public/application-object-v1.js +1 -1
- package/dist/public/application-object-v1.js.br +0 -0
- package/dist/public/application-object-v1.js.gz +0 -0
- package/dist/public/application-object-v1.js.map +1 -1
- package/dist/public/application-object-v2.js +1 -1
- package/dist/public/application-object-v2.js.br +0 -0
- package/dist/public/application-object-v2.js.gz +0 -0
- package/dist/public/application-object-v2.js.map +1 -1
- package/dist/public/index.html +1 -1
- package/dist/public/js/emuiSsfHost.5339b0bc88e73c59c58d.js +3 -0
- package/dist/public/js/emuiSsfHost.5339b0bc88e73c59c58d.js.br +0 -0
- package/dist/public/js/emuiSsfHost.5339b0bc88e73c59c58d.js.gz +0 -0
- package/dist/public/js/emuiSsfHost.5339b0bc88e73c59c58d.js.map +1 -0
- package/dist/public/loan-object.js +1 -1
- package/dist/public/loan-object.js.br +0 -0
- package/dist/public/loan-object.js.gz +0 -0
- package/dist/public/loan-object.js.map +1 -1
- package/dist/public/v1-guest-v2-host.html +1 -1
- package/dist/public/v2-host-v1-guest.html +1 -1
- package/dist/types/lib/host.d.ts +13 -6
- package/dist/types/lib/ihost.d.ts +15 -4
- package/dist/types/lib/index.d.ts +1 -1
- package/dist/types/lib/tests/scriptingObjects/appObjects.d.ts +10 -0
- package/dist/types/lib/tests/scriptingObjects/appraisalServiceModule.d.ts +2 -1
- package/dist/types/lib/tests/scriptingObjects/floodServiceModule.d.ts +2 -1
- package/dist/types/lib/types.d.ts +4 -24
- package/dist/types/lib/utils.d.ts +1 -2
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dist/umd/analytics-object-v1.js +1 -1
- package/dist/umd/analytics-object-v1.js.br +0 -0
- package/dist/umd/analytics-object-v1.js.gz +0 -0
- package/dist/umd/analytics-object-v1.js.map +1 -1
- package/dist/umd/analytics-object-v2.js +1 -1
- package/dist/umd/analytics-object-v2.js.br +0 -0
- package/dist/umd/analytics-object-v2.js.gz +0 -0
- package/dist/umd/analytics-object-v2.js.map +1 -1
- package/dist/umd/application-object-v1.js +1 -1
- package/dist/umd/application-object-v1.js.br +0 -0
- package/dist/umd/application-object-v1.js.gz +0 -0
- package/dist/umd/application-object-v1.js.map +1 -1
- package/dist/umd/application-object-v2.js +1 -1
- package/dist/umd/application-object-v2.js.br +0 -0
- package/dist/umd/application-object-v2.js.gz +0 -0
- package/dist/umd/application-object-v2.js.map +1 -1
- package/dist/umd/index.html +1 -1
- 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/loan-object.js +1 -1
- package/dist/umd/loan-object.js.br +0 -0
- package/dist/umd/loan-object.js.gz +0 -0
- package/dist/umd/loan-object.js.map +1 -1
- package/dist/umd/v1-guest-v2-host.html +1 -1
- package/dist/umd/v2-host-v1-guest.html +1 -1
- package/package.json +7 -7
- package/dist/public/js/emuiSsfHost.ed1648532a780f393d2d.js +0 -3
- package/dist/public/js/emuiSsfHost.ed1648532a780f393d2d.js.br +0 -0
- package/dist/public/js/emuiSsfHost.ed1648532a780f393d2d.js.gz +0 -0
- package/dist/public/js/emuiSsfHost.ed1648532a780f393d2d.js.map +0 -1
package/dist/esm/host.js
CHANGED
|
@@ -5,14 +5,15 @@ import {
|
|
|
5
5
|
MessageType,
|
|
6
6
|
Event,
|
|
7
7
|
ScriptingObjectManager,
|
|
8
|
-
ProxyEvent
|
|
8
|
+
ProxyEvent,
|
|
9
|
+
isScriptingObjectProxy
|
|
9
10
|
} from "@elliemae/microfe-common";
|
|
10
11
|
import {
|
|
11
12
|
IFrameSandboxValues,
|
|
12
13
|
OpenMode
|
|
13
14
|
} from "./types.js";
|
|
14
15
|
import { Guest } from "./guest.js";
|
|
15
|
-
import { flatten, isFunction
|
|
16
|
+
import { flatten, isFunction } from "./utils.js";
|
|
16
17
|
const SANDBOX_DEFAULT = [
|
|
17
18
|
IFrameSandboxValues.AllowScripts,
|
|
18
19
|
IFrameSandboxValues.AllowPopups,
|
|
@@ -47,6 +48,10 @@ class SSFHost {
|
|
|
47
48
|
* list of guests
|
|
48
49
|
*/
|
|
49
50
|
#guests = /* @__PURE__ */ new Map();
|
|
51
|
+
/**
|
|
52
|
+
* list of callbacks for guest close.
|
|
53
|
+
*/
|
|
54
|
+
#guestCloseCallbackList = /* @__PURE__ */ new Map();
|
|
50
55
|
/**
|
|
51
56
|
* scripting object manager
|
|
52
57
|
*/
|
|
@@ -184,7 +189,9 @@ class SSFHost {
|
|
|
184
189
|
if (!Object.prototype.hasOwnProperty.call(func, "callContext")) {
|
|
185
190
|
Object.defineProperty(func, "callContext", {
|
|
186
191
|
value: { guest },
|
|
187
|
-
|
|
192
|
+
configurable: true,
|
|
193
|
+
enumerable: true,
|
|
194
|
+
writable: true
|
|
188
195
|
});
|
|
189
196
|
}
|
|
190
197
|
resolve(func(...functionParams));
|
|
@@ -274,6 +281,35 @@ class SSFHost {
|
|
|
274
281
|
}
|
|
275
282
|
}
|
|
276
283
|
};
|
|
284
|
+
// Handles list objects requests from the remote automation framework
|
|
285
|
+
#handleListObjects = ({
|
|
286
|
+
sourceWin,
|
|
287
|
+
sourceOrigin,
|
|
288
|
+
requestId
|
|
289
|
+
}) => {
|
|
290
|
+
this.#logger.debug(
|
|
291
|
+
`Processing listObjects request. requestId = ${requestId}`
|
|
292
|
+
);
|
|
293
|
+
const guest = this.#getGuestForWindow(sourceWin);
|
|
294
|
+
if (!guest) {
|
|
295
|
+
this.#logger.warn("Rejected object request from unknown guest window");
|
|
296
|
+
return false;
|
|
297
|
+
}
|
|
298
|
+
const objects = this.#soManager.listScriptingObjects(guest.id);
|
|
299
|
+
this.#remoting.respond({
|
|
300
|
+
targetWin: sourceWin,
|
|
301
|
+
targetOrigin: sourceOrigin,
|
|
302
|
+
requestId,
|
|
303
|
+
response: objects
|
|
304
|
+
});
|
|
305
|
+
this.#logger.audit({
|
|
306
|
+
message: `name of scripting objects returned`,
|
|
307
|
+
requestId,
|
|
308
|
+
objects,
|
|
309
|
+
...guest.getInfo()
|
|
310
|
+
});
|
|
311
|
+
return true;
|
|
312
|
+
};
|
|
277
313
|
// Handles object get requests from the remote automation framework
|
|
278
314
|
#handleObjectGet = ({
|
|
279
315
|
sourceWin,
|
|
@@ -288,12 +324,6 @@ class SSFHost {
|
|
|
288
324
|
const guest = this.#getGuestForWindow(sourceWin);
|
|
289
325
|
if (!guest) {
|
|
290
326
|
this.#logger.warn("Rejected object request from unknown guest window");
|
|
291
|
-
this.#remoting.raiseException({
|
|
292
|
-
targetWin: sourceWin,
|
|
293
|
-
targetOrigin: sourceOrigin,
|
|
294
|
-
requestId,
|
|
295
|
-
ex: "Specified window is not a known guest"
|
|
296
|
-
});
|
|
297
327
|
return false;
|
|
298
328
|
}
|
|
299
329
|
const obj = this.getScriptingObject(objectId, { guest });
|
|
@@ -356,18 +386,12 @@ class SSFHost {
|
|
|
356
386
|
this.#logger.warn(
|
|
357
387
|
"Rejected method invocation request from unknown guest window"
|
|
358
388
|
);
|
|
359
|
-
this.#remoting.raiseException({
|
|
360
|
-
targetWin: sourceWin,
|
|
361
|
-
targetOrigin: sourceOrigin,
|
|
362
|
-
requestId,
|
|
363
|
-
ex: "Specified window is not a known guest"
|
|
364
|
-
});
|
|
365
389
|
return false;
|
|
366
390
|
}
|
|
367
391
|
this.#logger.debug(
|
|
368
392
|
`Function ${objectId}.${String(body.functionName)}() called from guest "${guest.id}" (requestId = ${requestId})`
|
|
369
393
|
);
|
|
370
|
-
const obj = this.getScriptingObject(objectId);
|
|
394
|
+
const obj = this.getScriptingObject(objectId, { guest });
|
|
371
395
|
if (!obj) {
|
|
372
396
|
this.#logger.warn(
|
|
373
397
|
`Invocation of unknown or unauthorized object ${objectId} from guest ${guest.id}`
|
|
@@ -455,6 +479,10 @@ class SSFHost {
|
|
|
455
479
|
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
456
480
|
callback: this.#handleGuestClose
|
|
457
481
|
});
|
|
482
|
+
this.#remoting.listen({
|
|
483
|
+
messageType: MessageType.ListObjects,
|
|
484
|
+
callback: this.#handleListObjects
|
|
485
|
+
});
|
|
458
486
|
this.#remoting.listen({
|
|
459
487
|
messageType: MessageType.ObjectGet,
|
|
460
488
|
callback: this.#handleObjectGet
|
|
@@ -513,7 +541,13 @@ class SSFHost {
|
|
|
513
541
|
}
|
|
514
542
|
});
|
|
515
543
|
guestsToRemove.forEach((guest) => {
|
|
516
|
-
|
|
544
|
+
const { id } = guest;
|
|
545
|
+
this.unloadGuest(id);
|
|
546
|
+
const callbacks = this.#guestCloseCallbackList.get(id);
|
|
547
|
+
callbacks?.forEach((callback) => {
|
|
548
|
+
callback().catch(() => {
|
|
549
|
+
});
|
|
550
|
+
});
|
|
517
551
|
});
|
|
518
552
|
}, 1e3);
|
|
519
553
|
};
|
|
@@ -578,7 +612,8 @@ class SSFHost {
|
|
|
578
612
|
fitToContent = false,
|
|
579
613
|
disableSandbox = false,
|
|
580
614
|
sandboxValues = [],
|
|
581
|
-
style = ""
|
|
615
|
+
style = "",
|
|
616
|
+
permissionPolicy = ""
|
|
582
617
|
} = options;
|
|
583
618
|
if (!title) throw new Error("title is required");
|
|
584
619
|
if (fitToContent) this.#subscribeToGuestResizeEvent();
|
|
@@ -601,6 +636,7 @@ class SSFHost {
|
|
|
601
636
|
}
|
|
602
637
|
frame.setAttribute("title", title);
|
|
603
638
|
frame.setAttribute("src", url);
|
|
639
|
+
if (permissionPolicy) frame.setAttribute("allow", permissionPolicy);
|
|
604
640
|
targetElement.appendChild(frame);
|
|
605
641
|
const guestFrameEle = targetElementDocument.getElementById(
|
|
606
642
|
guestId
|
|
@@ -628,7 +664,12 @@ class SSFHost {
|
|
|
628
664
|
* @param {AddScriptingObjectParams} params params to add scripting object
|
|
629
665
|
*/
|
|
630
666
|
addScriptingObject = (so, params) => {
|
|
631
|
-
|
|
667
|
+
if (isScriptingObjectProxy(so)) {
|
|
668
|
+
const clonedSo = this.cloneScriptingObject(so);
|
|
669
|
+
this.#soManager.addScriptingObject(clonedSo, params);
|
|
670
|
+
} else {
|
|
671
|
+
this.#soManager.addScriptingObject(so, params);
|
|
672
|
+
}
|
|
632
673
|
};
|
|
633
674
|
/**
|
|
634
675
|
* Clone parent host's scripting object for exposing to grand children
|
|
@@ -636,29 +677,22 @@ class SSFHost {
|
|
|
636
677
|
* @param guest - reference to the ssf guest
|
|
637
678
|
* @returns cloned version of the scripting object
|
|
638
679
|
*/
|
|
639
|
-
cloneScriptingObject = (proxy
|
|
680
|
+
cloneScriptingObject = (proxy) => {
|
|
640
681
|
if (!proxy) throw new Error("proxy is required");
|
|
641
|
-
if (!guest) throw new Error("guest is required");
|
|
642
682
|
const so = new ScriptingObject(proxy.id, proxy.objectType);
|
|
643
683
|
let unsubscribers = [];
|
|
644
684
|
Object.keys(proxy).forEach((propName) => {
|
|
645
685
|
const propValue = proxy[propName];
|
|
646
686
|
if (this.#isProxyEvent(propValue)) {
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
requiresFeedback: false,
|
|
652
|
-
so
|
|
653
|
-
});
|
|
654
|
-
} else {
|
|
655
|
-
event = new automation.Event();
|
|
656
|
-
}
|
|
687
|
+
const event = new Event({
|
|
688
|
+
name: propValue.name || propName,
|
|
689
|
+
objectId: so.id
|
|
690
|
+
});
|
|
657
691
|
Object.defineProperty(so, propName, {
|
|
658
692
|
value: event,
|
|
659
693
|
enumerable: true
|
|
660
694
|
});
|
|
661
|
-
if (
|
|
695
|
+
if (propValue instanceof ProxyEvent) {
|
|
662
696
|
const listener = ({
|
|
663
697
|
eventParams,
|
|
664
698
|
eventOptions
|
|
@@ -669,13 +703,11 @@ class SSFHost {
|
|
|
669
703
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
670
704
|
eventOptions
|
|
671
705
|
});
|
|
672
|
-
const token =
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
callback: listener
|
|
676
|
-
});
|
|
706
|
+
const token = propValue.subscribe(
|
|
707
|
+
listener
|
|
708
|
+
);
|
|
677
709
|
unsubscribers.push(() => {
|
|
678
|
-
|
|
710
|
+
propValue.unsubscribe(token);
|
|
679
711
|
});
|
|
680
712
|
} else {
|
|
681
713
|
const token = propValue.subscribe?.(
|
|
@@ -695,7 +727,7 @@ class SSFHost {
|
|
|
695
727
|
Object.defineProperty(so, propName, {
|
|
696
728
|
value: async (...args) => {
|
|
697
729
|
const retVal = await propValue(...args);
|
|
698
|
-
return
|
|
730
|
+
return isScriptingObjectProxy(retVal) ? this.cloneScriptingObject(retVal) : retVal;
|
|
699
731
|
},
|
|
700
732
|
enumerable: true
|
|
701
733
|
});
|
|
@@ -733,20 +765,31 @@ class SSFHost {
|
|
|
733
765
|
};
|
|
734
766
|
/**
|
|
735
767
|
* dispatch event to guest application(s)
|
|
736
|
-
* @param {EventDetail}
|
|
768
|
+
* @param {EventDetail} params details of the event to be dispatched
|
|
737
769
|
* @returns promise that resolves to an array with result from each guest application
|
|
738
770
|
*/
|
|
739
|
-
dispatchEvent = async (
|
|
771
|
+
dispatchEvent = async (params) => {
|
|
740
772
|
const {
|
|
741
|
-
event: { id, name
|
|
773
|
+
event: { id, name },
|
|
742
774
|
eventParams,
|
|
743
775
|
eventOptions = {}
|
|
744
|
-
} =
|
|
776
|
+
} = params;
|
|
745
777
|
const {
|
|
746
778
|
eventHandler = null,
|
|
747
779
|
timeout = null,
|
|
748
|
-
window: targetWindow = null
|
|
780
|
+
window: targetWindow = null,
|
|
781
|
+
guestId
|
|
749
782
|
} = eventOptions;
|
|
783
|
+
const objectId = id.split(".")[0];
|
|
784
|
+
const guestIdorWnd = guestId || targetWindow;
|
|
785
|
+
const targetGuest = guestIdorWnd ? this.#findGuest(guestIdorWnd) : null;
|
|
786
|
+
const scriptingObject = targetGuest ? this.getScriptingObject(objectId, { guest: targetGuest }) : this.getScriptingObject(objectId);
|
|
787
|
+
if (!scriptingObject) {
|
|
788
|
+
this.#logger.warn(
|
|
789
|
+
`Attempt to dispatch event ${name} on unknown object ${objectId}`
|
|
790
|
+
);
|
|
791
|
+
return Promise.resolve([]);
|
|
792
|
+
}
|
|
750
793
|
const eventObj = {
|
|
751
794
|
// eslint-disable-next-line no-underscore-dangle
|
|
752
795
|
object: scriptingObject._toJSON(),
|
|
@@ -953,6 +996,18 @@ class SSFHost {
|
|
|
953
996
|
});
|
|
954
997
|
}
|
|
955
998
|
};
|
|
999
|
+
/**
|
|
1000
|
+
* monitors guest window close action and executes the callback from host.
|
|
1001
|
+
* @param callback host callback method
|
|
1002
|
+
* @param id unique id of the guest application
|
|
1003
|
+
* @param param
|
|
1004
|
+
*/
|
|
1005
|
+
onGuestClose = (param) => {
|
|
1006
|
+
const { id, guestCloseCallback } = param;
|
|
1007
|
+
const callbacks = this.#guestCloseCallbackList.get(id) || [];
|
|
1008
|
+
callbacks.push(guestCloseCallback);
|
|
1009
|
+
this.#guestCloseCallbackList.set(id, callbacks);
|
|
1010
|
+
};
|
|
956
1011
|
}
|
|
957
1012
|
export {
|
|
958
1013
|
SSFHost
|
package/dist/esm/index.html
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
8
8
|
<title>Host</title>
|
|
9
9
|
<script src="https://cdn.tailwindcss.com?plugins=forms"></script>
|
|
10
|
-
<script src="https://
|
|
10
|
+
<script src="https://cdn.qa1.ice.com/pui-diagnostics@3"></script>
|
|
11
11
|
</head>
|
|
12
12
|
|
|
13
13
|
<body>
|
|
@@ -30,6 +30,7 @@ const applicationScriptingObject = {
|
|
|
30
30
|
type: "object"
|
|
31
31
|
};
|
|
32
32
|
const APPLICATION_SERVICE_OBJECT = "application";
|
|
33
|
+
const MODULE_OBJECT = "module";
|
|
33
34
|
const authScriptingObject = {
|
|
34
35
|
object: {
|
|
35
36
|
events: [],
|
|
@@ -39,8 +40,19 @@ const authScriptingObject = {
|
|
|
39
40
|
},
|
|
40
41
|
type: "object"
|
|
41
42
|
};
|
|
43
|
+
const moduleScriptingObject = {
|
|
44
|
+
object: {
|
|
45
|
+
events: [],
|
|
46
|
+
functions: ["getParameters", "getCapabilities", "log", "unload"],
|
|
47
|
+
objectId: "module",
|
|
48
|
+
objectType: "Object"
|
|
49
|
+
},
|
|
50
|
+
type: "object"
|
|
51
|
+
};
|
|
42
52
|
export {
|
|
43
53
|
APPLICATION_SERVICE_OBJECT,
|
|
54
|
+
MODULE_OBJECT,
|
|
44
55
|
applicationScriptingObject,
|
|
45
|
-
authScriptingObject
|
|
56
|
+
authScriptingObject,
|
|
57
|
+
moduleScriptingObject
|
|
46
58
|
};
|
|
@@ -10,23 +10,19 @@ class AppraisalService extends ScriptingObject {
|
|
|
10
10
|
#creditScore;
|
|
11
11
|
Close = new Event({
|
|
12
12
|
name: "Close",
|
|
13
|
-
|
|
14
|
-
so: this
|
|
13
|
+
objectId: this.constructor.name
|
|
15
14
|
});
|
|
16
15
|
Unloading = new Event({
|
|
17
16
|
name: "Unloading",
|
|
18
|
-
|
|
19
|
-
so: this
|
|
17
|
+
objectId: this.constructor.name
|
|
20
18
|
});
|
|
21
19
|
onPreCommit = new Event({
|
|
22
20
|
name: "onPreCommit",
|
|
23
|
-
|
|
24
|
-
so: this
|
|
21
|
+
objectId: this.constructor.name
|
|
25
22
|
});
|
|
26
23
|
onSaved = new Event({
|
|
27
24
|
name: "onSaved",
|
|
28
|
-
|
|
29
|
-
so: this
|
|
25
|
+
objectId: this.constructor.name
|
|
30
26
|
});
|
|
31
27
|
constructor({
|
|
32
28
|
loanId,
|
|
@@ -62,6 +58,10 @@ class AppraisalService extends ScriptingObject {
|
|
|
62
58
|
delete = () => {
|
|
63
59
|
throw new Error("Not implemented");
|
|
64
60
|
};
|
|
61
|
+
log = async (message, level) => {
|
|
62
|
+
console.log(message, level);
|
|
63
|
+
return Promise.resolve();
|
|
64
|
+
};
|
|
65
65
|
unload = async () => {
|
|
66
66
|
};
|
|
67
67
|
}
|
|
@@ -5,13 +5,11 @@ class FloodService extends ScriptingObject {
|
|
|
5
5
|
lastName;
|
|
6
6
|
Close = new Event({
|
|
7
7
|
name: "Close",
|
|
8
|
-
|
|
9
|
-
so: this
|
|
8
|
+
objectId: this.constructor.name
|
|
10
9
|
});
|
|
11
10
|
Unloading = new Event({
|
|
12
11
|
name: "Unloading",
|
|
13
|
-
|
|
14
|
-
so: this
|
|
12
|
+
objectId: this.constructor.name
|
|
15
13
|
});
|
|
16
14
|
constructor() {
|
|
17
15
|
super("FloodService");
|
|
@@ -26,6 +24,10 @@ class FloodService extends ScriptingObject {
|
|
|
26
24
|
getParameters = () => Promise.resolve({
|
|
27
25
|
moduleId: "floodService"
|
|
28
26
|
});
|
|
27
|
+
log = async (message, level) => {
|
|
28
|
+
console.log(message, level);
|
|
29
|
+
return Promise.resolve();
|
|
30
|
+
};
|
|
29
31
|
unload = () => Promise.resolve();
|
|
30
32
|
_dispose = () => {
|
|
31
33
|
};
|
package/dist/esm/utils.js
CHANGED
|
@@ -26,16 +26,11 @@ const isScriptingObject = (value) => (
|
|
|
26
26
|
function isFunction(value) {
|
|
27
27
|
return typeof value === "function";
|
|
28
28
|
}
|
|
29
|
-
const isProxy = (value) => (
|
|
30
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
31
|
-
value?.constructor?.name === "Proxy"
|
|
32
|
-
);
|
|
33
29
|
const getObjectId = (elementOrId) => elementOrId?.id ?? elementOrId;
|
|
34
30
|
export {
|
|
35
31
|
flatten,
|
|
36
32
|
getObjectId,
|
|
37
33
|
getOrigin,
|
|
38
34
|
isFunction,
|
|
39
|
-
isProxy,
|
|
40
35
|
isScriptingObject
|
|
41
36
|
};
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
height: 100%;
|
|
22
22
|
}
|
|
23
23
|
</style>
|
|
24
|
-
<script src="https://
|
|
24
|
+
<script src="https://cdn.qa1.ice.com/pui-diagnostics@3"></script>
|
|
25
25
|
<script src="https://cdn.elliemae.io/elliemae/core/ssf/1.0/elli.ssf.guest.js"></script>
|
|
26
26
|
</head>
|
|
27
27
|
<body>
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export class Analytics extends elli.ssf.ScriptingObject{constructor(){super("Analytics")}sendBAEvent
|
|
1
|
+
export class Analytics extends elli.ssf.ScriptingObject{constructor(){super("Analytics")}sendBAEvent=e=>Promise.resolve();startTiming=(e,r)=>Promise.resolve(performance.mark(e,{detail:r}));endTiming=(e,r)=>(performance.measure(e,{detail:r,start:e}),Promise.resolve())}
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=analytics-object-v1.js.map
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack://ice.host/analytics-object-v1.js"],"sourcesContent":["export class Analytics extends elli.ssf.ScriptingObject {\n constructor() {\n super('Analytics');\n }\n\n sendBAEvent(event) {\n return Promise.resolve();\n }\n\n startTiming(name, options) {\n return Promise.resolve(performance.mark(name, { detail: options }));\n }\n\n endTiming(start, options) {\n performance.measure(start, {\n detail: options,\n start: start,\n });\n return Promise.resolve();\n }\n}\n"],"mappings":"AAAO,aAAM,kBAAkB,KAAK,IAAI,eAAgB,CACtD,aAAc,CACZ,MAAM,WAAW,CACnB,CAEA,
|
|
1
|
+
{"version":3,"sources":["webpack://ice.host/analytics-object-v1.js"],"sourcesContent":["export class Analytics extends elli.ssf.ScriptingObject {\n constructor() {\n super('Analytics');\n }\n\n sendBAEvent = (event) => {\n return Promise.resolve();\n }\n\n startTiming = (name, options) => {\n return Promise.resolve(performance.mark(name, { detail: options }));\n }\n\n endTiming = (start, options) => {\n performance.measure(start, {\n detail: options,\n start: start,\n });\n return Promise.resolve();\n }\n}\n"],"mappings":"AAAO,aAAM,kBAAkB,KAAK,IAAI,eAAgB,CACtD,aAAc,CACZ,MAAM,WAAW,CACnB,CAEA,YAAeA,GACN,QAAQ,QAAQ,EAGzB,YAAc,CAACC,EAAMC,IACZ,QAAQ,QAAQ,YAAY,KAAKD,EAAM,CAAE,OAAQC,CAAQ,CAAC,CAAC,EAGpE,UAAY,CAACC,EAAOD,KAClB,YAAY,QAAQC,EAAO,CACzB,OAAQD,EACR,MAAOC,CACT,CAAC,EACM,QAAQ,QAAQ,EAE3B","names":["event","name","options","start"],"sourceRoot":"","file":"analytics-object-v1.js"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export class Analytics extends ice.host.ScriptingObject{constructor(){super("Analytics")}sendBAEvent
|
|
1
|
+
export class Analytics extends ice.host.ScriptingObject{constructor(){super("Analytics")}sendBAEvent=e=>Promise.resolve();startTiming=(e,r)=>Promise.resolve(performance.mark(e,{detail:r}));endTiming=(e,r)=>(performance.measure(e,{detail:r,start:e}),Promise.resolve())}
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=analytics-object-v2.js.map
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack://ice.host/analytics-object-v2.js"],"sourcesContent":["export class Analytics extends ice.host.ScriptingObject {\n constructor() {\n super('Analytics');\n }\n\n sendBAEvent(event) {\n return Promise.resolve();\n }\n\n startTiming(name, options) {\n return Promise.resolve(performance.mark(name, { detail: options }));\n }\n\n endTiming(start, options) {\n performance.measure(start, {\n detail: options,\n start: start,\n });\n return Promise.resolve();\n }\n}\n"],"mappings":"AAAO,aAAM,kBAAkB,IAAI,KAAK,eAAgB,CACtD,aAAc,CACZ,MAAM,WAAW,CACnB,CAEA,
|
|
1
|
+
{"version":3,"sources":["webpack://ice.host/analytics-object-v2.js"],"sourcesContent":["export class Analytics extends ice.host.ScriptingObject {\n constructor() {\n super('Analytics');\n }\n\n sendBAEvent = (event) => {\n return Promise.resolve();\n }\n\n startTiming = (name, options) => {\n return Promise.resolve(performance.mark(name, { detail: options }));\n }\n\n endTiming = (start, options) => {\n performance.measure(start, {\n detail: options,\n start: start,\n });\n return Promise.resolve();\n }\n}\n"],"mappings":"AAAO,aAAM,kBAAkB,IAAI,KAAK,eAAgB,CACtD,aAAc,CACZ,MAAM,WAAW,CACnB,CAEA,YAAeA,GACN,QAAQ,QAAQ,EAGzB,YAAc,CAACC,EAAMC,IACZ,QAAQ,QAAQ,YAAY,KAAKD,EAAM,CAAE,OAAQC,CAAQ,CAAC,CAAC,EAGpE,UAAY,CAACC,EAAOD,KAClB,YAAY,QAAQC,EAAO,CACzB,OAAQD,EACR,MAAOC,CACT,CAAC,EACM,QAAQ,QAAQ,EAE3B","names":["event","name","options","start"],"sourceRoot":"","file":"analytics-object-v2.js"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export class Application extends elli.ssf.ScriptingObject{constructor(){super("Application")}keepSessionAlive()
|
|
1
|
+
export class Application extends elli.ssf.ScriptingObject{constructor(){super("Application")}keepSessionAlive=()=>Promise.resolve()}
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=application-object-v1.js.map
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack://ice.host/application-object-v1.js"],"sourcesContent":["export class Application extends elli.ssf.ScriptingObject {\n constructor() {\n super('Application');\n }\n\n keepSessionAlive() {\n return Promise.resolve();\n }\n}\n"],"mappings":"AAAO,aAAM,oBAAoB,KAAK,IAAI,eAAgB,CACxD,aAAc,CACZ,MAAM,aAAa,CACrB,CAEA,
|
|
1
|
+
{"version":3,"sources":["webpack://ice.host/application-object-v1.js"],"sourcesContent":["export class Application extends elli.ssf.ScriptingObject {\n constructor() {\n super('Application');\n }\n\n keepSessionAlive = () => {\n return Promise.resolve();\n }\n}\n"],"mappings":"AAAO,aAAM,oBAAoB,KAAK,IAAI,eAAgB,CACxD,aAAc,CACZ,MAAM,aAAa,CACrB,CAEA,iBAAmB,IACV,QAAQ,QAAQ,CAE3B","names":[],"sourceRoot":"","file":"application-object-v1.js"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export class Application extends ice.host.ScriptingObject{constructor(){super("Application")}keepSessionAlive()
|
|
1
|
+
export class Application extends ice.host.ScriptingObject{constructor(){super("Application")}keepSessionAlive=()=>Promise.resolve()}
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=application-object-v2.js.map
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack://ice.host/application-object-v2.js"],"sourcesContent":["export class Application extends ice.host.ScriptingObject {\n constructor() {\n super('Application');\n }\n\n keepSessionAlive() {\n return Promise.resolve();\n }\n}\n"],"mappings":"AAAO,aAAM,oBAAoB,IAAI,KAAK,eAAgB,CACxD,aAAc,CACZ,MAAM,aAAa,CACrB,CAEA,
|
|
1
|
+
{"version":3,"sources":["webpack://ice.host/application-object-v2.js"],"sourcesContent":["export class Application extends ice.host.ScriptingObject {\n constructor() {\n super('Application');\n }\n\n keepSessionAlive = () => {\n return Promise.resolve();\n }\n}\n"],"mappings":"AAAO,aAAM,oBAAoB,IAAI,KAAK,eAAgB,CACxD,aAAc,CACZ,MAAM,aAAa,CACrB,CAEA,iBAAmB,IACV,QAAQ,QAAQ,CAE3B","names":[],"sourceRoot":"","file":"application-object-v2.js"}
|
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://
|
|
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://cdn.qa1.ice.com/pui-diagnostics@3"></script><script defer="defer" src="js/emuiSsfHost.5339b0bc88e73c59c58d.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>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
(function(O,y){typeof exports=="object"&&typeof module=="object"?module.exports=y():typeof define=="function"&&define.amd?define([],y):typeof exports=="object"?exports.ice=y():(O.ice=O.ice||{},O.ice.host=y())})(globalThis,()=>(()=>{"use strict";var v={};v.d=(n,e)=>{for(var t in e)v.o(e,t)&&!v.o(n,t)&&Object.defineProperty(n,t,{enumerable:!0,get:e[t]})},v.o=(n,e)=>Object.prototype.hasOwnProperty.call(n,e),v.r=n=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})};var O={};v.r(O),v.d(O,{Event:()=>y,Guest:()=>T,IFrameSandboxValues:()=>j,OpenMode:()=>f,SSFHost:()=>Z,ScriptingObject:()=>P});class y{name;objectId;id;constructor(e){const{name:t,objectId:i}=e;if(!t)throw new Error("Event name is required");if(!i)throw new Error("Scripting object id is required");this.objectId=i,this.name=t,this.id=`${this.objectId}.${this.name}`.toLowerCase()}}class k{static[Symbol.hasInstance](e){return e.getType?.()==="ProxyEvent"}#e;objectId;name;id;getType(){return"ProxyEvent"}constructor(e){const{name:t,objectId:i,eventSrc:s}=e;this.objectId=i,this.name=t,this.#e=s,this.id=`${this.objectId}.${this.name}`.toLowerCase()}subscribe=e=>this.#e.subscribe({eventId:this.id,callback:e});unsubscribe=e=>{this.#e.unsubscribe({eventId:this.id,token:e})}}const N=n=>n instanceof y,V=(n,e)=>`${n.toLowerCase()}.${e.toLowerCase()}`,D="function",B=(n,e)=>typeof n===D&&!!e&&!e.startsWith("_");class P{#e;#t="Object";constructor(e,t){this.#e=e,this.#t=t||this.#t}get id(){return this.#e}get objectType(){return this.#t}_toJSON=()=>{const e=[],t=[];return Object.keys(this).forEach(i=>{const s=this[i];N(s)?t.push(i):B(s,i)&&e.push(i)}),{objectId:this.#e,objectType:this.#t,functions:e,events:t}};_dispose=()=>{};dispose=()=>{}}var g=(n=>(n.GuestClose="guest:close",n.GuestFocus="guest:focus",n.GuestReady="guest:ready",n.GuestReadyComplete="guest:readyComplete",n.GuestResize="guest:resize",n.HandShake="handshake",n.HandShakeAck="handshake:ack",n.HostClose="host:close",n.HostConfig="host:config",n.ListObjects="list:objects",n.ObjectEvent="object:event",n.ObjectGet="object:get",n.ObjectInvoke="object:invoke",n))(g||{}),f=(n=>(n.Popup="popup",n.Embed="embed",n))(f||{}),j=(n=>(n.AllowDownloadsWithoutUserActivation="allow-downloads-without-user-activation",n.AllowDownloads="allow-downloads",n.AllowForms="allow-forms",n.AllowModals="allow-modals",n.AllowOrientationLock="allow-orientation-lock",n.AllowPointerLock="allow-pointer-lock",n.AllowPopups="allow-popups",n.AllowPopupsToEscapeSandbox="allow-popups-to-escape-sandbox",n.AllowPresentation="allow-presentation",n.AllowSameOrigin="allow-same-origin",n.AllowScripts="allow-scripts",n.AllowStorageAccessByUserActivation="allow-storage-access-by-user-activation",n.AllowTopNavigation="allow-top-navigation",n.AllowTopNavigationByUserActivation="allow-top-navigation-by-user-activation",n))(j||{});const H=n=>{if(n==="about:blank")return"*";try{const{origin:e}=new URL(n);return e==="null"||!e?n:e}catch{const{origin:t}=new URL(n,document.baseURI);return t}},A=(n,e=[])=>{const t=e||[];return n&&n.forEach?n.forEach(i=>{A(i,t)}):typeof n<"u"&&t.push(n),t},ee=n=>typeof n?._toJSON=="function";function G(n){return typeof n=="function"}const te=n=>n?.id??n;class T{id;title;url;searchParams;domElement;window;openMode;origin;initialized=!1;ready=!1;capabilities;#e;#t;constructor(e){const{guestId:t,domElement:i=null,title:s,url:o,window:r,searchParams:c={},openMode:a=f.Embed,remoting:d,analyticsObj:l}=e;this.id=t,this.title=s,this.url=o,this.origin=H(o),this.searchParams=c,this.domElement=i,this.window=r,this.openMode=a,this.capabilities={},this.#t=l,this.#e=d}dispose=()=>{if(this.openMode===f.Popup&&!this.window.closed)try{this.window.document,this.window.close()}catch{this.#e.send({targetWin:this.window,targetOrigin:this.origin,messageType:g.HostClose,messageBody:{}})}else this.domElement?.remove?.();this.#e.removeSender({origin:this.origin,window:this.window})};getInfo=()=>({guestId:this.id,guestTitle:this.title,guestUrl:this.url});handShake=()=>new Promise(e=>{let t=0;const i=5,s=setInterval(()=>{t>=i?(clearInterval(s),e(!1)):(this.#e.send({targetWin:this.window,targetOrigin:this.origin,messageType:g.HandShake,messageBody:{}}),t+=1)},1e3);this.#e.listen({messageType:g.HandShakeAck,callback:()=>{clearInterval(s),e(!0)}})});init=()=>{this.#e.addSender({origin:this.origin,window:this.window}),this.openMode===f.Popup&&this.handShake().catch(()=>{})};dispatchEvent=(e,t)=>(this.#t.startTiming(`ScriptingObject.Event.${e.object.objectId}.${e.eventName}`,{appId:this.id,appUrl:this.url}).catch(()=>{}),this.#e.invoke({targetWin:this.window,targetOrigin:this.origin,messageType:g.ObjectEvent,messageBody:e,responseTimeoutMs:t}).finally(()=>{this.#t.endTiming(`ScriptingObject.Event.${e.object.objectId}.${e.eventName}`,{appId:this.id,appUrl:this.url}).catch(()=>{})}));send=e=>{this.#e.send({targetWin:this.window,targetOrigin:this.origin,...e})}}const R={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let $;const W=new Uint8Array(16);function F(){if(!$&&($=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!$))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return $(W)}const u=[];for(let n=0;n<256;++n)u.push((n+256).toString(16).slice(1));function _(n,e=0){return u[n[e+0]]+u[n[e+1]]+u[n[e+2]]+u[n[e+3]]+"-"+u[n[e+4]]+u[n[e+5]]+"-"+u[n[e+6]]+u[n[e+7]]+"-"+u[n[e+8]]+u[n[e+9]]+"-"+u[n[e+10]]+u[n[e+11]]+u[n[e+12]]+u[n[e+13]]+u[n[e+14]]+u[n[e+15]]}function se(n,e=0){const t=_(n,e);if(!validate(t))throw TypeError("Stringified UUID is invalid");return t}const ne=null;function J(n,e,t){if(R.randomUUID&&!e&&!n)return R.randomUUID();n=n||{};const i=n.random||(n.rng||F)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,e){t=t||0;for(let s=0;s<16;++s)e[t+s]=i[s];return e}return _(i)}const U=J,q="elli:remoting",C="elli:remoting:response",L="elli:remoting:exception",I=({messageType:n,messageBody:e,onewayMsg:t=!1})=>({requestId:t?null:U(),source:q,type:n,body:e}),oe=n=>{const{targetWin:e,targetOrigin:t,messageType:i,messageBody:s}=n,o=I({messageType:i,messageBody:s});e.postMessage(o,t)};class Y{#e;#t;#i=new Map;#n=new Map;#s=null;#o=new Map;constructor(e,t){if(!e)throw new Error("logger is required");if(!t)throw new Error("correlationId is required");this.#e=t,this.#t=e}#c=()=>{const e=Date.now(),t=[];this.#n.forEach((i,s)=>{const{requestId:o,cancelTime:r}=i;this.#t.debug(`Checking response timeout for requestId: ${o}) @ ${r??""}`),i.cancelTime&&i.cancelTime<e&&(this.#t.debug(`Detected response timeout for requestId: ${o}...`),t.push(s),i.resolve(),this.#t.debug(`Aborted waiting for response to requestid: ${o})`))}),t.forEach(i=>{this.#t.debug(`removing invocations with requestId ${i} from cache since response time has expired`),this.#n.delete(i)}),this.#n.size===0&&(this.#t.debug("stopping response monitor"),this.#h())};#u=()=>{this.#s===null&&(this.#t.debug("Staring response timeout evaluator"),this.#s=window.setInterval(this.#c,200))};#h=()=>{this.#s!==null&&(window.clearInterval(this.#s),this.#s=null,this.#t.debug("Stopped response timeout evaluator"))};#g=e=>{const t=this.#n.get(e);return this.#t.debug(`serving requestId: ${e}`),this.#n.delete(e),t};#a=e=>{const{requestId:t}=e;this.#t.debug(`Response received for invocation requestId: ${t}`);const i=this.#g(t);return i?(i.resolve(e.body),!0):(this.#t.warn(`Received response to stale/invalid request with requestId: ${t}`),!1)};#d=e=>{this.#t.debug(`Exception received for invocation (requestId = ${e.requestId})`);const t=this.#g(e.requestId);return t?(t.reject(new Error(e.body)),!0):(this.#t.warn(`Received exception for stale/invalid request (requestId = ${e.requestId})`),!1)};#l=({sourceWin:e,sourceOrigin:t,message:i})=>{this.#t.debug(`Received message of type "${i.type}"`);const s=this.#i.get(i.type);return s?(s.forEach(o=>{this.#t.debug(`Invoking message handler ${o.name}`),o({sourceWin:e,sourceOrigin:t,requestId:i.requestId,type:i.type,body:i.body})}),!0):!1};#r=e=>{if(this.#t.debug(`Remoting: Received message ${JSON.stringify(e.data)}`),this.#o.size===0||!e.source)return!1;const t=this.#o.get(e.source);return!t||e?.data?.source!==q?!1:(e.data.type===C?this.#a(e.data):e.data.type===L?this.#d(e.data):this.#l({sourceWin:e.source,sourceOrigin:t,message:e.data}),!0)};addSender=e=>{const{origin:t,window:i}=e;if(!t)throw new Error("origin is required");if(!i)throw new Error("window is required");this.#o.set(i,t)};initialize=e=>{e.removeEventListener("message",this.#r),e.addEventListener("message",this.#r),this.#t.debug(`initialized remoting id: ${this.#e}`)};close=()=>{window.removeEventListener("message",this.#r),this.#t.debug(`closed remoting id: ${this.#e}`)};invoke=e=>{const{targetWin:t,targetOrigin:i,messageType:s,messageBody:o,responseTimeoutMs:r}=e;return new Promise((c,a)=>{const d=I({messageType:s,messageBody:o});this.#n.set(d.requestId,{requestId:d.requestId,resolve:c,reject:a,cancelTime:r?Date.now()+Number.parseInt(r,10):null}),t.postMessage(d,i);const{requestId:l}=d;this.#t.debug(`Posted invocation message of type ${s} requestId: ${l||""}`),r&&(this.#t.debug(`starting response monitor for requestId: ${l||""} for ${r} ms`),this.#u())})};listen=e=>{const{messageType:t,callback:i}=e,s=this.#i.get(t)||[];s.push(i),this.#i.set(t,s)};send=e=>{const{targetWin:t,targetOrigin:i,messageType:s,messageBody:o}=e,r=I({messageType:s,messageBody:o,onewayMsg:!0});t.postMessage(r,i),this.#t.debug(`Posted one-way message of type "${s}"`)};removeSender=e=>{const{window:t}=e;t&&this.#o.delete(t)};respond=e=>{const{targetWin:t,targetOrigin:i,requestId:s,response:o}=e,r=I({messageType:C,messageBody:o});r.requestId=s,t.postMessage(r,i),this.#t.debug(`Response sent to caller for invocation requestId: ${s}`)};raiseException=e=>{const{targetWin:t,targetOrigin:i,requestId:s,ex:o}=e,r=I({messageType:L,messageBody:o});r.requestId=s,t.postMessage(r,i),this.#t.debug(`Exception sent to caller for invocation. requestId: ${s}`)}}const M="module";var X=(n=>(n.USER="USER",n.PARTNER="PARTNER",n))(X||{});class K{#e=new Map;#t=new Map;#i=e=>{const{so:t,guestId:i}=e,s=t.id.toLowerCase(),o=this.#t.get(i);if(!o)this.#t.set(i,new Map([[s,e]]));else{if(o.has(s))throw new Error(`Scripting Object ${t.id} already exists for guest ${i}`);o.set(s,e)}};#n=({so:e})=>{e._dispose&&typeof e._dispose=="function"&&e._dispose()};#s=({objectId:e,guestId:t})=>{if(e===M&&!t)for(const[,s]of this.#t){const o=s.get(e);if(o)return o}const i=t?this.#t.get(t):null;return i?i.get(e)??null:null};#o=({objectId:e,guestId:t}={})=>{if(t){if(!e){const s=this.#t.get(t);s&&s.forEach(this.#n),this.#t.delete(t);return}const i=this.#t.get(t);if(i){const s=i.get(e);s&&this.#n(s),i.delete(e)}}else e&&this.#t.forEach(i=>{const s=i.get(e);s&&this.#n(s),i.delete(e)})};addScriptingObject=(e,t)=>{const{guestId:i}=t||{};if(!e?.id||!e?._toJSON)throw new Error("Object is not derived from ScriptingObject");const s=e.id.toLowerCase();if(s.trim().toLowerCase()===M&&!i)throw new Error("Guest id is required to add Module scripting object");if(i){this.#i({so:e,...t,guestId:i});return}if(this.#e.has(s))throw new Error(`Scripting Object ${e.id} already exists`);this.#e.set(s,{so:e,...t})};getObject=(e,t)=>{const i=e.trim().toLowerCase();let s=this.#s({objectId:i,guestId:t?.id});s=s??this.#e.get(i)??null;const{so:o}=s||{};return o||null};listScriptingObjects=e=>{let t=Array.from(this.#e.keys());const i=this.#t.get(e);return t=i?t.concat(Array.from(i.keys())):t,Array.from(new Set(t))};removeScriptingObject=(e,t)=>{const i=e.toLowerCase();if(t)this.#o({objectId:i,guestId:t});else{this.#o({objectId:i});const s=this.#e.get(i);s&&this.#n(s),this.#e.delete(i)}};removeAllScriptingObjects=e=>{e?this.#o({guestId:e}):(this.#e.forEach(this.#n),this.#e.clear())}}class re{__TYPE__="Proxy";id;objectType;constructor(e,t){this.id=e,this.objectType=t}}const x=n=>n?.constructor?.name==="Proxy"||n?.constructor?.name==="ScriptingObjectProxy"||n?.__TYPE__==="Proxy",Q=[j.AllowScripts,j.AllowPopups,j.AllowModals,j.AllowForms,j.AllowDownloads,j.AllowSameOrigin].join(" ");class Z{hostId;#e;#t;#i;#n;#s=new Map;#o=new Map;#c;#u=null;#h=null;constructor(e,t){if(this.hostId=e,!t?.logger)throw new Error("Logger is required");if(!t?.analyticsObj)throw new Error("Analytics object is required");if(this.#i=t.logger,this.#n=t.analyticsObj,this.#t=U(),this.#e=new Y(this.#i,this.#t),t?.readyStateCallback&&typeof t?.readyStateCallback!="function")throw new Error("readyStateCallback must be a function");this.#u=t?.readyStateCallback||null,this.#c=new K,this.#e.initialize(window),this.#A(),window.addEventListener("beforeunload",this.#l),this.#T(),this.#i.debug(`host is initialized. hostId: ${this.hostId}, correlationId: ${this.#t}`)}#g=(e,t)=>{const i={event:e,...t};this.#n.sendBAEvent(i).catch(()=>{})};#a=(e,t)=>{this.#n.startTiming(e,t).catch(()=>{})};#d=(e,t)=>{this.#n.endTiming(e,t).catch(()=>{})};#l=()=>{for(const e of this.#s.values())e.openMode===f.Popup&&this.unloadGuest(e.id)};#r=e=>Array.from(this.#s.values()).find(t=>t.window===e);#v=e=>{for(const t of this.#s.values())if(t.url===e)return t;return null};#y=e=>typeof e?._toJSON=="function";#f=e=>this.#y(e)?{type:"object",object:e._toJSON()}:{type:"value",value:e};#q=e=>typeof e=="string"?e:e instanceof Error?e.message:"An unexpected error occurred in the host application";#b=e=>{e.ready&&this.#e.send({targetWin:e.window,targetOrigin:e.origin,messageType:g.HostConfig,messageBody:{logLevel:this.#i.getLogLevel(),...e.getInfo()}})};#j=({guest:e,obj:t,functionName:i,functionParams:s})=>{const o=t[i];return G(o)?(this.#i.debug(`Invoking host implementation of ${t.id}.${String(i)}()`),new Promise(r=>{Object.prototype.hasOwnProperty.call(o,"callContext")||Object.defineProperty(o,"callContext",{value:{guest:e},configurable:!0,enumerable:!0,writable:!0}),r(o(...s))})):(this.#i.warn(`Attempt to call invalid function on object type ${t.objectType}: ${String(i)}`),Promise.reject(new Error(`Method '${i}' not found in Scripting Object '${t.id}'`)))};#w=({sourceWin:e,sourceOrigin:t,requestId:i})=>{const s=this.#r(e);if(!s){this.#i.warn(`Received ready event for unknown guest. requestId: ${i}`);return}if(!s.initialized){this.#i.warn("Guest must be initialized before it is marked as ready"),this.#e.raiseException({targetWin:e,targetOrigin:t,requestId:i,ex:"Guest must be initialized before it is marked as ready"});return}if(!s.ready){s.ready=!0;const o=s.getInfo();this.#d("SSF.Guest.Load",{appId:o.guestId,appUrl:o.guestUrl}),this.#b(s),this.#u?.(s),this.#i.audit({message:"Guest is ready",...o})}};#E=({sourceWin:e,sourceOrigin:t,requestId:i,body:s})=>{const o=this.#r(e);if(!o){this.#i.warn(`Received ready event for unknown guest. requestid = ${i}`);return}o.initialized||(o.initialized=!0,o.capabilities=s||{},this.#i.audit({message:"Guest is initialized",...o.getInfo()})),(!s||!s.onReady)&&this.#w({sourceWin:e,sourceOrigin:t,requestId:i,type:"",body:null})};#O=async({sourceWin:e})=>{if(e?.window){const t=this.#p(e);t&&!await t.handShake()&&this.unloadGuest(e)}};#S=({sourceWin:e,sourceOrigin:t,requestId:i})=>{this.#i.debug(`Processing listObjects request. requestId = ${i}`);const s=this.#r(e);if(!s)return this.#i.warn("Rejected object request from unknown guest window"),!1;const o=this.#c.listScriptingObjects(s.id);return this.#e.respond({targetWin:e,targetOrigin:t,requestId:i,response:o}),this.#i.audit({message:"name of scripting objects returned",requestId:i,objects:o,...s.getInfo()}),!0};#I=({sourceWin:e,sourceOrigin:t,requestId:i,body:s})=>{const{objectId:o}=s;this.#i.debug(`Processing getObject request for object ${o}. requestId = ${i}`);const r=this.#r(e);if(!r)return this.#i.warn("Rejected object request from unknown guest window"),!1;const c=this.getScriptingObject(o,{guest:r});return c?(this.#e.respond({targetWin:e,targetOrigin:t,requestId:i,response:this.#f(c)}),this.#i.audit({message:"Scripting Object returned",requestId:i,scriptingObject:o,...r.getInfo()}),!0):(this.#i.warn(`unknown or unauthorized object ${o} from guest ${r.id}`),this.#e.raiseException({targetWin:e,targetOrigin:t,requestId:i,ex:`The requested object (${o}) is not available`}),!1)};#$=({sourceWin:e,requestId:t,body:i})=>{const s=this.#r(e);if(!s){this.#i.warn(`Received resize event from unknown guest. requestid = ${t}`);return}s.domElement&&(s.domElement.style.height=`${i.height}px`),this.#i.debug(`Guest ${s.id} resized to ${i.width}x${i.height}`)};#k=({sourceWin:e,sourceOrigin:t,requestId:i,body:s})=>{const{objectId:o}=s,r=this.#r(e);if(!r)return this.#i.warn("Rejected method invocation request from unknown guest window"),!1;this.#i.debug(`Function ${o}.${String(s.functionName)}() called from guest "${r.id}" (requestId = ${i})`);const c=this.getScriptingObject(o,{guest:r});if(!c)return this.#i.warn(`Invocation of unknown or unauthorized object ${o} from guest ${r.id}`),this.#e.raiseException({targetWin:e,targetOrigin:t,requestId:i,ex:`The requested object (${o}) is not available`}),!1;const a=r.getInfo();return this.#a(`ScriptingObject.API.${o}.${s.functionName}`,{appId:a.guestId,appUrl:a.guestUrl}),this.#j({guest:r,obj:c,functionName:s.functionName,functionParams:s.functionParams}).then(d=>{this.#e.respond({targetWin:e,targetOrigin:t,requestId:i,response:this.#f(d)}),this.#i.audit({message:"Value returned for Scripting Object method call",requestId:i,scriptingObject:o,scriptingMethod:s.functionName,...a})}).catch(d=>{this.#e.raiseException({targetWin:e,targetOrigin:r.origin,requestId:i,ex:d}),this.#i.audit({message:"Exception thrown for Scripting Object method call",requestId:i,scriptingObject:o,scriptingMethod:s.functionName,...a})}).finally(()=>{this.#d(`ScriptingObject.API.${o}.${s.functionName}`,{appId:a.guestId,appUrl:a.guestUrl})}),!0};#P=()=>{this.#e.listen({messageType:g.GuestResize,callback:this.#$})};#A=()=>{this.#e.listen({messageType:g.GuestReady,callback:this.#E}),this.#e.listen({messageType:g.GuestReadyComplete,callback:this.#w}),this.#e.listen({messageType:g.GuestClose,callback:this.#O}),this.#e.listen({messageType:g.ListObjects,callback:this.#S}),this.#e.listen({messageType:g.ObjectGet,callback:this.#I}),this.#e.listen({messageType:g.ObjectInvoke,callback:this.#k})};#G=e=>e instanceof k||typeof e?.subscribe=="function";#m=e=>{const t=new T({...e,remoting:this.#e,analyticsObj:this.#n});return t.init(),this.#s.set(e.guestId,t),t};#p=e=>{let t=typeof e=="string"?this.#s.get(e):null;return t||(t=Array.from(this.#s.values()).find(i=>i.window===e||i.domElement===e)),t};#T=()=>{this.#h=setInterval(()=>{const e=[];this.#s.forEach(t=>{t.openMode===f.Popup&&t.window.closed&&e.push(t)}),e.forEach(t=>{const{id:i}=t;this.unloadGuest(i),this.#o.get(i)?.forEach(o=>{o().catch(()=>{})})})},1e3)};#R=e=>{const{url:t,title:i,popupWindowFeatures:s={},searchParams:o,guestId:r}=e,{width:c=800,height:a=600,top:d=100,left:l=100}=s;let p=this.#v(t);if(p)p.window.closed||p.send({messageType:g.GuestFocus,messageBody:{}});else{const S=[{key:"width",value:c},{key:"height",value:a},{key:"top",value:d},{key:"left",value:l}].reduce((h,w,E)=>(E>0&&w.value&&(h+=","),w.value?`${h}${w.key}=${w.value}`:h),""),b=window.open(t,i,`popup, ${S}`);if(!b)throw new Error("Failed to open guest application in popup window");b.opener=null,p=this.#m({guestId:r,window:b,title:i,url:t,searchParams:o,openMode:f.Popup})}return p};#_=e=>{const{url:t,title:i,targetElement:s,searchParams:o,guestId:r,options:c={}}=e,a=s.ownerDocument??document,{fitToContent:d=!1,disableSandbox:l=!1,sandboxValues:p=[],style:S="",permissionPolicy:b=""}=c;if(!i)throw new Error("title is required");d&&this.#P();const h=a.createElement("iframe");h.setAttribute("id",r);const w=()=>{this.#i.debug(`frame loaded for guest with id '${r}'`),h.removeEventListener("load",w)};h.addEventListener("load",w),h.setAttribute("style",`min-width: 100%; height: 100%; border: 0px; ${S}`),l||h.setAttribute("sandbox",`${Q} ${p.join(" ")}`),h.setAttribute("title",i),h.setAttribute("src",t),b&&h.setAttribute("allow",b),s.appendChild(h);const E=a.getElementById(r);return this.#m({guestId:r,domElement:E,window:E.contentWindow,title:i,url:t,searchParams:o,openMode:f.Embed})};#U=(e,t)=>{let i="";return Object.keys(t).forEach(s=>{i+=`${(i.length?"&":"")+encodeURIComponent(s)}=${encodeURIComponent(t[s])}`}),e+(i?(e.indexOf("?")>=0?"&":"?")+i:"")};addScriptingObject=(e,t)=>{if(x(e)){const i=this.cloneScriptingObject(e);this.#c.addScriptingObject(i,t)}else this.#c.addScriptingObject(e,t)};cloneScriptingObject=e=>{if(!e)throw new Error("proxy is required");const t=new P(e.id,e.objectType);let i=[];return Object.keys(e).forEach(s=>{const o=e[s];if(this.#G(o)){const r=new y({name:o.name||s,objectId:t.id});if(Object.defineProperty(t,s,{value:r,enumerable:!0}),o instanceof k){const c=({eventParams:d,eventOptions:l})=>this.dispatchEvent({event:r,eventParams:d,eventOptions:l}),a=o.subscribe(c);i.push(()=>{o.unsubscribe(a)})}else{const c=o.subscribe?.((a,d,l)=>this.dispatchEvent({event:r,eventParams:d,eventOptions:l}));i.push(()=>{o.unsubscribe?.(c)})}}else if(G(o)&&(Object.defineProperty(t,s,{value:async(...r)=>{const c=await o(...r);return x(c)?this.cloneScriptingObject(c):c},enumerable:!0}),s==="dispose")){const r=t.dispose;Object.defineProperty(t,s,{value:()=>(t._dispose(),r.apply(t)),enumerable:!0})}}),t._dispose=()=>{i.forEach(s=>{s?.()}),i=[]},t};close=()=>{clearInterval(this.#h),this.#l(),this.#e.close(),window.removeEventListener("beforeunload",this.#l),this.#i.debug(`host is closed. hostId: ${this.hostId}, correlationId: ${this.#t}`)};dispatchEvent=async e=>{const{event:{id:t,name:i},eventParams:s,eventOptions:o={}}=e,{eventHandler:r=null,timeout:c=null,window:a=null,guestId:d}=o,l=t.split(".")[0],p=d||a,S=p?this.#p(p):null,b=S?this.getScriptingObject(l,{guest:S}):this.getScriptingObject(l);if(!b)return this.#i.warn(`Attempt to dispatch event ${i} on unknown object ${l}`),Promise.resolve([]);const h={object:b._toJSON(),eventName:i,eventParams:s,eventHandler:r,eventOptions:{allowsFeedback:!1}};c&&!Number.isNaN(c)&&(h.eventOptions={allowsFeedback:!0,timeout:Number(c)});const w=[];let E=!1;return this.#s.forEach(m=>{const z=m.getInfo();(!a||a===m.window)&&(c&&m?.capabilities?.eventFeedback?(w.push(m.dispatchEvent(h,c)),E||(this.#a(`ScriptingObject.Event.${b.id}.${i}`,{appId:this.hostId,appUrl:window.location.href}),E=!0),this.#i.audit({message:"Event dispatched and awaiting feedback",scriptingEventId:t,...z})):(m.send({messageType:g.ObjectEvent,messageBody:h}),this.#i.audit({message:"Event dispatched",scriptingEventId:t,...z})))}),await Promise.all(w).then(m=>(this.#i.audit({message:"Event feedback received",scriptingEventId:t}),A(m))).catch(m=>{throw this.#i.error({message:"Error processing event",eventId:t,exception:m}),m}).finally(()=>{E&&this.#d(`ScriptingObject.Event.${b.id}.${i}`,{appId:this.hostId,appUrl:window.location.href})})};getGuests=()=>{const e=[];return this.#s.forEach(t=>{e.push(t)}),e};getScriptingObject=(e,t)=>this.#c.getObject(e,t?.guest);loadGuest=e=>{const{id:t,url:i,targetElement:s,title:o,searchParams:r={},options:c={}}=e;if(!t)throw new Error("id for guest application is required");const{openMode:a=f.Embed,popupWindowFeatures:d={}}=c,l=this.#U(i,r);let p=null;if(this.#a("SSF.Guest.Load",{appId:t,appUrl:l}),a===f.Popup)p=this.#R({guestId:t,url:l,title:o,searchParams:r,popupWindowFeatures:d});else if(a===f.Embed)p=this.#_({guestId:t,url:l,title:o,targetElement:s,searchParams:r,options:c});else throw new Error(`Invalid openMode: ${a}`);return this.#i.audit({message:"Guest loaded",...p.getInfo()}),p};loadGuests=e=>{const{id:t,url:i,targetElement:s,title:o,searchParamsList:r=[],options:c={}}=e;r.forEach((a,d)=>{this.loadGuest({id:`${t}-${d}`,url:i,title:o,targetElement:s,searchParams:a,options:c})},this)};removeAllScriptingObjects=e=>{this.#c.removeAllScriptingObjects(e)};removeScriptingObject=(e,t)=>{this.#c.removeScriptingObject(e,t)};setLogLevel=e=>{this.#i.setLogLevel(e),this.#s.forEach(this.#b),this.#i.debug("Dispatched config events to all guests")};unloadGuest=e=>{const t=this.#p(e);t&&(t.dispose(),this.#s.delete(t.id),this.#i.audit({message:"Guest is removed from host",...t.getInfo()}))};onGuestClose=e=>{const{id:t,guestCloseCallback:i}=e,s=this.#o.get(t)||[];s.push(i),this.#o.set(t,s)}}return O})());
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=emuiSsfHost.5339b0bc88e73c59c58d.js.map
|
|
Binary file
|
|
Binary file
|