@elliemae/ssf-guest 2.0.0-next.29

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.
Files changed (110) hide show
  1. package/dist/cjs/app.config.json +20 -0
  2. package/dist/cjs/creditService.html +34 -0
  3. package/dist/cjs/guest.js +497 -0
  4. package/dist/cjs/index.html +18 -0
  5. package/dist/cjs/index.js +26 -0
  6. package/dist/cjs/loanValidation.html +18 -0
  7. package/dist/cjs/package.json +4 -0
  8. package/dist/cjs/pricingService.html +69 -0
  9. package/dist/cjs/proxy.js +43 -0
  10. package/dist/cjs/proxyEvent.js +49 -0
  11. package/dist/cjs/tests/constant.js +38 -0
  12. package/dist/cjs/tests/utils.js +107 -0
  13. package/dist/cjs/titleService.html +31 -0
  14. package/dist/cjs/utils.js +73 -0
  15. package/dist/cjs/window.js +16 -0
  16. package/dist/esm/app.config.json +20 -0
  17. package/dist/esm/creditService.html +34 -0
  18. package/dist/esm/guest.js +492 -0
  19. package/dist/esm/index.html +18 -0
  20. package/dist/esm/index.js +6 -0
  21. package/dist/esm/loanValidation.html +18 -0
  22. package/dist/esm/package.json +4 -0
  23. package/dist/esm/pricingService.html +69 -0
  24. package/dist/esm/proxy.js +23 -0
  25. package/dist/esm/proxyEvent.js +29 -0
  26. package/dist/esm/tests/constant.js +18 -0
  27. package/dist/esm/tests/utils.js +92 -0
  28. package/dist/esm/titleService.html +31 -0
  29. package/dist/esm/utils.js +53 -0
  30. package/dist/esm/window.js +0 -0
  31. package/dist/public/app.config.json +20 -0
  32. package/dist/public/businessObjects.js +3 -0
  33. package/dist/public/businessObjects.js.br +0 -0
  34. package/dist/public/businessObjects.js.gz +0 -0
  35. package/dist/public/businessObjects.js.map +1 -0
  36. package/dist/public/creditScoreService.js +3 -0
  37. package/dist/public/creditScoreService.js.br +0 -0
  38. package/dist/public/creditScoreService.js.gz +0 -0
  39. package/dist/public/creditScoreService.js.map +1 -0
  40. package/dist/public/creditService.html +1 -0
  41. package/dist/public/index.html +1 -0
  42. package/dist/public/js/emuiSsfGuest.376046c57fd914219e6b.js +3 -0
  43. package/dist/public/js/emuiSsfGuest.376046c57fd914219e6b.js.br +0 -0
  44. package/dist/public/js/emuiSsfGuest.376046c57fd914219e6b.js.gz +0 -0
  45. package/dist/public/js/emuiSsfGuest.376046c57fd914219e6b.js.map +1 -0
  46. package/dist/public/loanValidation.html +1 -0
  47. package/dist/public/loanValidation.js +3 -0
  48. package/dist/public/loanValidation.js.br +1 -0
  49. package/dist/public/loanValidation.js.gz +0 -0
  50. package/dist/public/loanValidation.js.map +1 -0
  51. package/dist/public/pricingService.html +1 -0
  52. package/dist/public/pricingService.js +3 -0
  53. package/dist/public/pricingService.js.br +0 -0
  54. package/dist/public/pricingService.js.gz +0 -0
  55. package/dist/public/pricingService.js.map +1 -0
  56. package/dist/public/titleService.html +1 -0
  57. package/dist/public/titleService.js +3 -0
  58. package/dist/public/titleService.js.br +2 -0
  59. package/dist/public/titleService.js.gz +0 -0
  60. package/dist/public/titleService.js.map +1 -0
  61. package/dist/public/util.js +3 -0
  62. package/dist/public/util.js.br +0 -0
  63. package/dist/public/util.js.gz +0 -0
  64. package/dist/public/util.js.map +1 -0
  65. package/dist/types/guest.d.ts +99 -0
  66. package/dist/types/index.d.ts +5 -0
  67. package/dist/types/proxy.d.ts +21 -0
  68. package/dist/types/proxyEvent.d.ts +40 -0
  69. package/dist/types/tests/constant.d.ts +8 -0
  70. package/dist/types/tests/guest.test.d.ts +7 -0
  71. package/dist/types/tests/scriptOnlyGuest.test.d.ts +1 -0
  72. package/dist/types/tests/scriptingObject.test.d.ts +7 -0
  73. package/dist/types/tests/utils.d.ts +52 -0
  74. package/dist/types/utils.d.ts +7 -0
  75. package/dist/types/window.d.ts +8 -0
  76. package/dist/umd/app.config.json +20 -0
  77. package/dist/umd/businessObjects.js +3 -0
  78. package/dist/umd/businessObjects.js.br +0 -0
  79. package/dist/umd/businessObjects.js.gz +0 -0
  80. package/dist/umd/businessObjects.js.map +1 -0
  81. package/dist/umd/creditScoreService.js +3 -0
  82. package/dist/umd/creditScoreService.js.br +0 -0
  83. package/dist/umd/creditScoreService.js.gz +0 -0
  84. package/dist/umd/creditScoreService.js.map +1 -0
  85. package/dist/umd/creditService.html +1 -0
  86. package/dist/umd/index.html +1 -0
  87. package/dist/umd/index.js +3 -0
  88. package/dist/umd/index.js.br +0 -0
  89. package/dist/umd/index.js.gz +0 -0
  90. package/dist/umd/index.js.map +1 -0
  91. package/dist/umd/loanValidation.html +1 -0
  92. package/dist/umd/loanValidation.js +3 -0
  93. package/dist/umd/loanValidation.js.br +1 -0
  94. package/dist/umd/loanValidation.js.gz +0 -0
  95. package/dist/umd/loanValidation.js.map +1 -0
  96. package/dist/umd/pricingService.html +1 -0
  97. package/dist/umd/pricingService.js +3 -0
  98. package/dist/umd/pricingService.js.br +0 -0
  99. package/dist/umd/pricingService.js.gz +0 -0
  100. package/dist/umd/pricingService.js.map +1 -0
  101. package/dist/umd/titleService.html +1 -0
  102. package/dist/umd/titleService.js +3 -0
  103. package/dist/umd/titleService.js.br +2 -0
  104. package/dist/umd/titleService.js.gz +0 -0
  105. package/dist/umd/titleService.js.map +1 -0
  106. package/dist/umd/util.js +3 -0
  107. package/dist/umd/util.js.br +0 -0
  108. package/dist/umd/util.js.gz +0 -0
  109. package/dist/umd/util.js.map +1 -0
  110. package/package.json +65 -0
@@ -0,0 +1,99 @@
1
+ import type { IScriptingObjectProxy, Listener, Events } from '@elliemae/pui-scripting-object';
2
+ import type { ConnectParam, GuestSubscribeParam, GuestUnsubscribeParam, EventListeners, ISSFGuest } from '@elliemae/ssf-common';
3
+ import { LogLevels } from '@elliemae/pui-diagnostics';
4
+ export type ListenerInfo = {
5
+ callback: Listener<any, any, any, any>;
6
+ token: string;
7
+ };
8
+ /**
9
+ * options for the guest
10
+ */
11
+ export type GuestOption = {
12
+ /**
13
+ * options for the logger
14
+ */
15
+ logger: {
16
+ /**
17
+ * log to console
18
+ */
19
+ console?: boolean;
20
+ /**
21
+ * url to send logs to
22
+ */
23
+ url?: string;
24
+ /**
25
+ * index to use for logging
26
+ */
27
+ index: string;
28
+ /**
29
+ * app name to use for logging
30
+ */
31
+ appName: string;
32
+ /**
33
+ * team name that owns the app
34
+ */
35
+ team: string;
36
+ };
37
+ };
38
+ /**
39
+ * Creates a new guest that can be used to communicate with the parent host application
40
+ *
41
+ * @typeParm AppEvents - The events that the guest application listens
42
+ */
43
+ export declare class SSFGuest<AppEvents extends EventListeners = Events> implements ISSFGuest<AppEvents> {
44
+ #private;
45
+ /**
46
+ * Create new guest
47
+ *
48
+ * @param {GuestOption} options - options for the guest
49
+ */
50
+ constructor(options: GuestOption);
51
+ /**
52
+ * Initialize guest using script
53
+ *
54
+ * @param scriptUri uri of the script
55
+ * @param containerElement dom element to inject the script at
56
+ */
57
+ addScript: (scriptUri: string, containerElement: HTMLElement) => Promise<void>;
58
+ /**
59
+ * Close the connection to the host
60
+ */
61
+ close: () => void;
62
+ /**
63
+ * Connect to the host
64
+ *
65
+ * @param {ConnectParam} param - reference to the guest window or options
66
+ */
67
+ connect: (param?: ConnectParam) => Promise<void>;
68
+ /**
69
+ * Get scripting object proxy by id
70
+ *
71
+ * @param objectId unique id of the scripting object
72
+ * @returns scripting object proxy
73
+ */
74
+ getObject: (objectId: string) => Promise<IScriptingObjectProxy>;
75
+ /**
76
+ * remove the guest from the host
77
+ */
78
+ removeScript: () => void;
79
+ /**
80
+ * Set the log level
81
+ *
82
+ * @param {LogLevels} logLevel - log level
83
+ * @param level
84
+ */
85
+ setLogLevel: (level: LogLevels) => void;
86
+ /**
87
+ * subscribe to an scripting object event
88
+ *
89
+ * @param {GuestSubscribeParam<EventId, AppEvents[EventId]>} param - parameters for subscribing to an event
90
+ * @returns subscription token
91
+ */
92
+ subscribe: <EventId extends Extract<keyof AppEvents, string>>(param: GuestSubscribeParam<EventId, AppEvents[EventId]>) => string;
93
+ /**
94
+ * unsubscribe from an scripting object event
95
+ *
96
+ * @param {GuestUnsubscribeParam<EventId>} param - parameters for unsubscribing from an event
97
+ */
98
+ unsubscribe: <EventId extends Extract<keyof AppEvents, string>>(param: GuestUnsubscribeParam<EventId>) => void;
99
+ }
@@ -0,0 +1,5 @@
1
+ export { SSFGuest } from './guest.js';
2
+ export type { GuestOption } from './guest.js';
3
+ export type { GuestSubscribeParam as SubscribeParam, GuestUnsubscribeParam as UnsubscribeParam, ConnectParam, } from '@elliemae/ssf-common';
4
+ export { ProxyEvent } from './proxyEvent.js';
5
+ export type { ProxyEventParam } from './proxyEvent.js';
@@ -0,0 +1,21 @@
1
+ import type { IScriptingObjectProxy } from '@elliemae/pui-scripting-object';
2
+ /**
3
+ * Scripting Object Proxy implementation
4
+ */
5
+ export declare class Proxy implements IScriptingObjectProxy {
6
+ /**
7
+ * unique id of scripting object
8
+ */
9
+ readonly id: string;
10
+ /**
11
+ * type of scripting object
12
+ */
13
+ readonly objectType: string;
14
+ /**
15
+ * Creates a new instance of the Scripting Object Proxy
16
+ *
17
+ * @param objectId unique id of scripting object
18
+ * @param objectType type of scripting object
19
+ */
20
+ constructor(objectId: string, objectType: string);
21
+ }
@@ -0,0 +1,40 @@
1
+ import type { Events } from '@elliemae/pui-scripting-object';
2
+ import type { IScriptingObjectProxyEvent, EventListeners } from '@elliemae/ssf-common';
3
+ /**
4
+ * ProxyEvent constructor parameter
5
+ */
6
+ export type ProxyEventParam = {
7
+ /**
8
+ * name of the event
9
+ */
10
+ name: string;
11
+ /**
12
+ * unique id of scripting object
13
+ */
14
+ objectId: string;
15
+ };
16
+ /**
17
+ * Scripting Object Proxy Event implementation
18
+ *
19
+ * @typeParam AppEvents - type of the events that the scripting object supports
20
+ */
21
+ export declare class ProxyEvent<AppEvents extends EventListeners = Events> implements IScriptingObjectProxyEvent<AppEvents> {
22
+ /**
23
+ * unique id of scripting object
24
+ */
25
+ readonly objectId: string;
26
+ /**
27
+ * name of the event
28
+ */
29
+ readonly name: string;
30
+ /**
31
+ * unique id of the event
32
+ */
33
+ readonly id: Extract<keyof AppEvents, string>;
34
+ /**
35
+ * Create a new instance of the Scripting Object Proxy Event
36
+ *
37
+ * @param {ProxyEventParam} param - parameter for the constructor
38
+ */
39
+ constructor(param: ProxyEventParam);
40
+ }
@@ -0,0 +1,8 @@
1
+ export declare const OBJECT_NAME = "AppraisalService";
2
+ export declare const PRE_COMMIT_EVENT_NAME = "onPreCommit";
3
+ export declare const SAVED_EVENT_NAME = "onSaved";
4
+ export declare const UNLOADING_EVENT_NAME = "Unloading";
5
+ export declare const REMOTING = "elli:remoting";
6
+ export declare const REMOTING_RESPONSE = "elli:remoting:response";
7
+ export declare const REMOTING_EXCEPTION = "elli:remoting:exception";
8
+ export declare const EVENT_OBJECT = "object:event";
@@ -0,0 +1,7 @@
1
+ /// <reference types="jest" />
2
+ declare global {
3
+ interface Window {
4
+ onLoanSaved: jest.Mock;
5
+ }
6
+ }
7
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,7 @@
1
+ /// <reference types="jest" />
2
+ declare global {
3
+ interface Window {
4
+ onLoanSaved: jest.Mock;
5
+ }
6
+ }
7
+ export {};
@@ -0,0 +1,52 @@
1
+ import type { IScriptingObjectProxy, IModule, Listener } from '@elliemae/pui-scripting-object';
2
+ import type { IScriptingObjectProxyEvent } from '@elliemae/ssf-common';
3
+ import { SSFGuest } from '../index.js';
4
+ type PostMessageOptions = {
5
+ srcWindow: Window;
6
+ targetWindow: Window;
7
+ message: any;
8
+ };
9
+ export declare const ssfGuest: SSFGuest<AppEvents & import("@elliemae/pui-scripting-object").ApplicationEvents & import("@elliemae/pui-scripting-object").FormEvents & import("@elliemae/pui-scripting-object").GlobalEvents & import("@elliemae/pui-scripting-object").LoanEvents & import("@elliemae/pui-scripting-object").ModuleEvents & import("@elliemae/pui-scripting-object").ViewEvents>;
10
+ export declare const postMessage: ({ srcWindow, targetWindow, message, }: PostMessageOptions) => void;
11
+ export type SSFMessage = {
12
+ data: {
13
+ requestId: number;
14
+ type: string;
15
+ body: {
16
+ eventFeedback: boolean;
17
+ };
18
+ source: string;
19
+ };
20
+ };
21
+ export declare const connectGuest: (hostWindow: Window) => Promise<void>;
22
+ type LoanInfo = {
23
+ loanId: string;
24
+ };
25
+ type LoanEventOptions = {
26
+ allowsFeedback: boolean;
27
+ timeout: number;
28
+ };
29
+ export type AppEvents = {
30
+ 'appraisalservice.onsaved': Listener<AppraisalService, LoanInfo, LoanEventOptions, void>;
31
+ 'appraisalservice.onprecommit': Listener<AppraisalService, LoanInfo, Record<string, unknown>, boolean>;
32
+ };
33
+ export interface AppraisalService extends IScriptingObjectProxy, IModule {
34
+ getLoanDetails: () => Promise<Record<string, any>>;
35
+ setCreditScore: (creditScore: number) => Promise<void>;
36
+ saveLoan: () => Promise<void>;
37
+ commit: () => Promise<void>;
38
+ delete: () => Promise<void>;
39
+ onSaved: IScriptingObjectProxyEvent<AppEvents>;
40
+ onPreCommit: IScriptingObjectProxyEvent<AppEvents>;
41
+ }
42
+ export declare const appraisalServiceObject: {
43
+ object: {
44
+ events: string[];
45
+ functions: string[];
46
+ objectId: string;
47
+ objectType: string;
48
+ };
49
+ type: string;
50
+ };
51
+ export declare const getAppraisalService: (hostWindow: Window) => Promise<AppraisalService>;
52
+ export {};
@@ -0,0 +1,7 @@
1
+ export declare const getOrigin: (url: string) => string;
2
+ export declare const isEmbedded: () => boolean;
3
+ export declare const getComputedStyle: (prop: keyof CSSStyleDeclaration, el?: HTMLBodyElement) => number;
4
+ export declare const getHostDetails: () => Promise<{
5
+ origin: string;
6
+ window: Window;
7
+ }>;
@@ -0,0 +1,8 @@
1
+ declare global {
2
+ interface Window {
3
+ __ICE__: {
4
+ diagnosticsUrl: string;
5
+ };
6
+ }
7
+ }
8
+ export {};
@@ -0,0 +1,20 @@
1
+ {
2
+ "appId": "ssf-guest",
3
+ "activeEnv": "localhost",
4
+ "options": {
5
+ "hostUrl": "http://localhost:4000"
6
+ },
7
+ "env": {
8
+ "localhost": {
9
+ "options": {
10
+ "hostUrl": "http://localhost:4000"
11
+ }
12
+ },
13
+ "dev2": {},
14
+ "qa2": {},
15
+ "qa3": {},
16
+ "int": {},
17
+ "stage": {},
18
+ "prod": {}
19
+ }
20
+ }
@@ -0,0 +1,3 @@
1
+ import{getGuest as o}from"./util.js";let t=null,e=null;const n=o();export const getLoanObject=async()=>(t||(t=await n.getObject("Loan")),t),getPropertyObject=async()=>(e||(e=await n.getObject("Loan")),e);
2
+
3
+ //# sourceMappingURL=businessObjects.js.map
Binary file
Binary file
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["webpack://ice/businessObjects.js"],"sourcesContent":["import { getGuest } from './util.js';\n\nlet loanObj = null;\nlet propertyObj = null;\n\nconst ssfGuest = getGuest();\n\nexport const getLoanObject = async () => {\n if (!loanObj) loanObj = await ssfGuest.getObject('Loan');\n return loanObj;\n};\n\nexport const getPropertyObject = async () => {\n if (!propertyObj) propertyObj = await ssfGuest.getObject('Loan');\n return propertyObj;\n};\n"],"mappings":"AAAA,OAAS,YAAAA,MAAgB,YAEzB,IAAIC,EAAU,KACVC,EAAc,KAElB,MAAMC,EAAWH,EAAS,EAEnB,aAAM,cAAgB,UACtBC,IAASA,EAAU,MAAME,EAAS,UAAU,MAAM,GAChDF,GAGI,kBAAoB,UAC1BC,IAAaA,EAAc,MAAMC,EAAS,UAAU,MAAM,GACxDD","names":["getGuest","loanObj","propertyObj","ssfGuest"],"sourceRoot":"","file":"businessObjects.js"}
@@ -0,0 +1,3 @@
1
+ (async()=>{const t=await window.__ICE__.ssfGuest.getObject("Loan"),{ssn:s}=await t.getLoanDetails();setTimeout(async()=>{const a=s==="123456789"?800:600;await t.setCreditScore(a)},1e3)})();
2
+
3
+ //# sourceMappingURL=creditScoreService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["webpack://ice/creditScoreService.js"],"sourcesContent":["(async () => {\n const loanObj = await window.__ICE__.ssfGuest.getObject('Loan');\n const { ssn } = await loanObj.getLoanDetails();\n setTimeout(async () => {\n const score = ssn === '123456789' ? 800 : 600;\n await loanObj.setCreditScore(score);\n }, 1000);\n})();\n"],"mappings":"CAAC,SAAY,CACX,MAAMA,EAAU,MAAM,OAAO,QAAQ,SAAS,UAAU,MAAM,EACxD,CAAE,IAAAC,CAAI,EAAI,MAAMD,EAAQ,eAAe,EAC7C,WAAW,SAAY,CACrB,MAAME,EAAQD,IAAQ,YAAc,IAAM,IAC1C,MAAMD,EAAQ,eAAeE,CAAK,CACpC,EAAG,GAAI,CACT,GAAG","names":["loanObj","ssn","score"],"sourceRoot":"","file":"creditScoreService.js"}
@@ -0,0 +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>Credit Service</title><style>body{margin:0}</style><script src="https://qa.assets.rd.elliemae.io/pui-diagnostics@3"></script><script>window.addEventListener("DOMContentLoaded",(async()=>{window.__ICE__={diagnosticsUrl:"https://int.api.ellielabs.com/diagnostics/v2/logging"};const e=new URL(window.location),i=e?.searchParams?.get?.("src");window.__ICE__.ssfGuest=new ice.SSFGuest({logger:{index:"creditServiceGuest",team:"ui platform",appName:"credit-service"}}),await window.__ICE__.ssfGuest.create(i,document.body)}))</script><script defer="defer" src="index.js"></script></head><body></body></html>
@@ -0,0 +1 @@
1
+ <!doctype html><html lang="en" style="height:100%"><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>Plugin</title><script src="https://cdn.tailwindcss.com?plugins=forms"></script><script defer="defer" src="index.js"></script></head><body class="px-2 h-full"><main class="h-full"><h1 class="text-md font-bold">Credit Score Service</h1><div class="h-full mt-2"><output id="msg" class="mt-2 p-2"></output></div></main></body></html>
@@ -0,0 +1,3 @@
1
+ (function(J,R){typeof exports=="object"&&typeof module=="object"?module.exports=R(require("emuiDiagnostics")):typeof define=="function"&&define.amd?define(["emuiDiagnostics"],R):typeof exports=="object"?exports.ice=R(require("emuiDiagnostics")):J.ice=R(J.emuiDiagnostics)})(globalThis,fe=>(()=>{"use strict";var J={270:y=>{y.exports=fe}},R={};function M(y){var I=R[y];if(I!==void 0)return I.exports;var k=R[y]={exports:{}};return J[y](k,k.exports,M),k.exports}M.d=(y,I)=>{for(var k in I)M.o(I,k)&&!M.o(y,k)&&Object.defineProperty(y,k,{enumerable:!0,get:I[k]})},M.o=(y,I)=>Object.prototype.hasOwnProperty.call(y,I),M.r=y=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(y,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(y,"__esModule",{value:!0})};var ne={};return(()=>{M.r(ne),M.d(ne,{ProxyEvent:()=>Ie,SSFGuest:()=>Ne});const I={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let k;const qe=new Uint8Array(16);function $e(){if(!k&&(k=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!k))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return k(qe)}const f=[];for(let e=0;e<256;++e)f.push((e+256).toString(16).slice(1));function ve(e,t=0){return(f[e[t+0]]+f[e[t+1]]+f[e[t+2]]+f[e[t+3]]+"-"+f[e[t+4]]+f[e[t+5]]+"-"+f[e[t+6]]+f[e[t+7]]+"-"+f[e[t+8]]+f[e[t+9]]+"-"+f[e[t+10]]+f[e[t+11]]+f[e[t+12]]+f[e[t+13]]+f[e[t+14]]+f[e[t+15]]).toLowerCase()}function Ye(e,t=0){const o=ve(e,t);if(!validate(o))throw TypeError("Stringified UUID is invalid");return o}const Xe=null;function xe(e,t,o){if(I.randomUUID&&!t&&!e)return I.randomUUID();e=e||{};const s=e.random||(e.rng||$e)();if(s[6]=s[6]&15|64,s[8]=s[8]&63|128,t){o=o||0;for(let r=0;r<16;++r)t[o+r]=s[r];return t}return ve(s)}const ee=xe;var Ce=Object.defineProperty,Re=(e,t,o)=>t in e?Ce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,O=(e,t,o)=>(Re(e,typeof t!="symbol"?t+"":t,o),o),be=(e,t,o)=>{if(!t.has(e))throw TypeError("Cannot "+o)},a=(e,t,o)=>(be(e,t,"read from private field"),o?o.call(e):t.get(e)),E=(e,t,o)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,o)},te=(e,t,o,s)=>(be(e,t,"write to private field"),s?s.call(e,o):t.set(e,o),o),A,u,z,q,T,U,oe,re,ae,ie,ce,de,le,F;const _e="elli:remoting",ye="elli:remoting:response",Ee="elli:remoting:exception",V=({messageType:e,messageBody:t,onewayMsg:o=!1})=>({requestId:o?null:ee(),source:_e,type:e,body:t}),ke=e=>{const{targetWin:t,targetOrigin:o,messageType:s,messageBody:r}=e,c=V({messageType:s,messageBody:r});t.postMessage(c,o)};class Te{constructor(t,o){if(E(this,A,void 0),E(this,u,void 0),E(this,z,new Map),E(this,q,new Map),E(this,T,null),E(this,U,new Map),E(this,oe,()=>{const s=Date.now(),r=[];a(this,q).forEach((c,p)=>{const{requestId:v,cancelTime:n}=c;a(this,u).debug(`Checking response timeout for requestId: ${v}) @ ${n??""}`),c.cancelTime&&c.cancelTime<s&&(a(this,u).debug(`Detected response timeout for requestId: ${v}...`),r.push(p),c.resolve(),a(this,u).debug(`Aborted waiting for response to requestid: ${v})`))}),r.forEach(c=>{a(this,u).debug(`removing invocations with requestId ${c} from cache since response time has expired`),a(this,q).delete(c)}),a(this,q).size===0&&(a(this,u).debug("stopping response monitor"),a(this,ae).call(this))}),E(this,re,()=>{a(this,T)===null&&(a(this,u).debug("Staring response timeout evaluator"),te(this,T,window.setInterval(a(this,oe),200)))}),E(this,ae,()=>{a(this,T)!==null&&(window.clearInterval(a(this,T)),te(this,T,null),a(this,u).debug("Stopped response timeout evaluator"))}),E(this,ie,s=>{const r=a(this,q).get(s);return a(this,u).debug(`serving requestId: ${s}`),a(this,q).delete(s),r}),E(this,ce,s=>{const{requestId:r}=s;a(this,u).debug(`Response received for invocation requestId: ${r}`);const c=a(this,ie).call(this,r);return c?(c.resolve(s.body),!0):(a(this,u).warn(`Received response to stale/invalid request with requestId: ${r}`),!1)}),E(this,de,s=>{a(this,u).debug(`Exception received for invocation (requestId = ${s.requestId})`);const r=a(this,ie).call(this,s.requestId);return r?(r.reject(new Error(s.body)),!0):(a(this,u).warn(`Received exception for stale/invalid request (requestId = ${s.requestId})`),!1)}),E(this,le,({sourceWin:s,sourceOrigin:r,message:c})=>{a(this,u).debug(`Received message of type "${c.type}"`);const p=a(this,z).get(c.type);return p?(p.forEach(v=>{a(this,u).debug(`Invoking message handler ${v.name}`),v({sourceWin:s,sourceOrigin:r,requestId:c.requestId,type:c.type,body:c.body})}),!0):!1}),E(this,F,s=>{if(a(this,u).debug(`Remoting: Received message ${JSON.stringify(s.data)}`),a(this,U).size===0||!s.source)return!1;const r=a(this,U).get(s.source);return!r||s?.data?.source!==_e?!1:(s.data.type===ye?a(this,ce).call(this,s.data):s.data.type===Ee?a(this,de).call(this,s.data):a(this,le).call(this,{sourceWin:s.source,sourceOrigin:r,message:s.data}),!0)}),O(this,"addSender",s=>{const{origin:r,window:c}=s;if(!r)throw new Error("origin is required");if(!c)throw new Error("window is required");a(this,U).set(c,r)}),O(this,"initialize",s=>{s.removeEventListener("message",a(this,F)),s.addEventListener("message",a(this,F)),a(this,u).debug(`initialized remoting id: ${a(this,A)}`)}),O(this,"close",()=>{window.removeEventListener("message",a(this,F)),a(this,u).debug(`closed remoting id: ${a(this,A)}`)}),O(this,"invoke",s=>{const{targetWin:r,targetOrigin:c,messageType:p,messageBody:v,responseTimeoutMs:n}=s;return new Promise((h,d)=>{const l=V({messageType:p,messageBody:v});a(this,q).set(l.requestId,{requestId:l.requestId,resolve:h,reject:d,cancelTime:n?Date.now()+Number.parseInt(n,10):null}),r.postMessage(l,c);const{requestId:w}=l;a(this,u).debug(`Posted invocation message of type ${p} requestId: ${w||""}`),n&&(a(this,u).debug(`starting response monitor for requestId: ${w||""} for ${n} ms`),a(this,re).call(this))})}),O(this,"listen",s=>{const{messageType:r,callback:c}=s,p=a(this,z).get(r)||[];p.push(c),a(this,z).set(r,p)}),O(this,"send",s=>{const{targetWin:r,targetOrigin:c,messageType:p,messageBody:v}=s,n=V({messageType:p,messageBody:v,onewayMsg:!0});r.postMessage(n,c),a(this,u).debug(`Posted one-way message of type "${p}"`)}),O(this,"removeSender",s=>{const{window:r}=s;r&&a(this,U).delete(r)}),O(this,"respond",s=>{const{targetWin:r,targetOrigin:c,requestId:p,response:v}=s,n=V({messageType:ye,messageBody:v});n.requestId=p,r.postMessage(n,c),a(this,u).debug(`Response sent to caller for invocation requestId: ${p}`)}),O(this,"raiseException",s=>{const{targetWin:r,targetOrigin:c,requestId:p,ex:v}=s,n=V({messageType:Ee,messageBody:v});n.requestId=p,r.postMessage(n,c),a(this,u).debug(`Exception sent to caller for invocation. requestId: ${p}`)}),!t)throw new Error("logger is required");if(!o)throw new Error("correlationId is required");te(this,A,o),te(this,u,t)}}A=new WeakMap,u=new WeakMap,z=new WeakMap,q=new WeakMap,T=new WeakMap,U=new WeakMap,oe=new WeakMap,re=new WeakMap,ae=new WeakMap,ie=new WeakMap,ce=new WeakMap,de=new WeakMap,le=new WeakMap,F=new WeakMap;var W=(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))(W||{});class Le{scriptingObject;name;objectId;requiresFeedback;id;constructor(t){const{name:o,requiresFeedback:s=!1,so:r}=t;if(!o)throw new Error("Event name is required");if(!r)throw new Error("Scripting object is required");this.scriptingObject=r,this.objectId=r.id,this.name=o,this.id=`${this.objectId}.${this.name}`.toLowerCase(),this.requiresFeedback=s}}const Ke=e=>e instanceof Le,Pe=(e,t)=>`${e.toLowerCase()}.${t.toLowerCase()}`;var he=M(270);class Ge{id;objectType;constructor(t,o){this.id=t,this.objectType=o}}class Ie{objectId;name;id;constructor(t){const{name:o,objectId:s}=t;this.objectId=s,this.name=o,this.id=`${this.objectId}.${this.name}`.toLowerCase()}}const We=e=>{if(e==="about:blank")return"*";const{origin:t}=new URL(e);return t==="null"||!t?e:t},Me=()=>window.self!==window.parent,Oe=(e,t)=>{const o=t||document.body,s=document.defaultView?.getComputedStyle?.(o,null),r=s?s[e]:"0";return parseInt(r,10)},Ue=new RegExp("^https?://(.*.elliemae.io|.*.ellielabs.com|.*.ellieservices.com|.*.encompassloconnect.com|.*.ice.com|localhost:[0-9]+)","i"),De="elli:remoting",He=()=>new Promise(e=>{Me()?e({origin:We(document.referrer||window.parent.location.href),window:window.parent}):window.addEventListener("message",t=>{if(Ue.test(t.origin)){const{source:o,type:s}=t.data||{};if(o===De&&s===W.HandShake){const{origin:r}=t,c=t.source;ke({targetWin:c,targetOrigin:r,messageType:W.HandShakeAck,messageBody:{}}),e({origin:r,window:c})}}})});var Be=Object.defineProperty,Ae=(e,t,o)=>t in e?Be(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,$=(e,t,o)=>(Ae(e,typeof t!="symbol"?t+"":t,o),o),Se=(e,t,o)=>{if(!t.has(e))throw TypeError("Cannot "+o)},i=(e,t,o)=>(Se(e,t,"read from private field"),o?o.call(e):t.get(e)),m=(e,t,o)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,o)},b=(e,t,o,s)=>(Se(e,t,"write to private field"),s?s.call(e,o):t.set(e,o),o),N,g,_,Y,D,H,L,X,K,Q,S,j,x,Z,ue,ge,pe,we,me,ze=(e=>(e.OBJECT="object",e.VALUE="value",e))(ze||{});const Fe={eventFeedback:!0},je=()=>{const{document:e}=window,t=e.body,o=e.documentElement,r={height:t.offsetHeight+Oe("marginTop")+Oe("marginBottom"),width:Math.max(t.scrollWidth,o.scrollWidth)};ke({targetWin:window.parent,targetOrigin:We(e.referrer||window.parent.location.href),messageType:W.GuestResize,messageBody:r}),window.removeEventListener("load",je)};Me()&&window.addEventListener("load",je);const Ve="https://api.ellielabs.com/diagnostics/v2/logging";class Ne{constructor(t){m(this,N,void 0),m(this,g,void 0),m(this,_,void 0),m(this,Y,!1),m(this,D,null),m(this,H,!1),m(this,L,new Map),m(this,X,null),m(this,K,null),m(this,Q,null),m(this,S,null),m(this,j,null),m(this,x,()=>({guestId:i(this,X),guestTitle:i(this,K),guestUrl:i(this,Q)})),m(this,Z,n=>{if(!n||!n.objectId)throw i(this,g).error("Deserialization of scripting object failed. Object does not have an Object ID."),new Error("Cannot deserialize object JSON into proxy.");const h=new Ge(n.objectId,n.objectType);return n.functions&&n.functions.forEach(d=>{Object.defineProperty(h,d,{value:async(...l)=>i(this,ue).call(this,{objectId:h.id,functionName:d,functionParams:[].slice.call(l)}),enumerable:!0})}),n.events&&n.events.forEach(d=>{Object.defineProperty(h,d,{value:new Ie({objectId:h.id,name:d}),enumerable:!0})}),i(this,g).debug(`Created guest proxy for scripting object (id = "${h.id}")`),h}),m(this,ue,async({objectId:n,functionName:h,functionParams:d})=>{i(this,g).debug(`Invoking scripting object method ${n}.${h}()...`);const l=[];if(d)for(let C=0;C<d.length;C+=1){const B=d[C];B instanceof Promise&&l.push(B.then(G=>{d[C]=G}))}await Promise.all(l);const w=await i(this,_).invoke({targetWin:i(this,j),targetOrigin:i(this,S),messageType:W.ObjectInvoke,messageBody:{objectId:n,functionName:h,functionParams:d}}),P=i(this,ge).call(this,w);return i(this,g).audit({message:"Guest proxy invoked Scripting Object method",scriptingObject:n,scriptingMethod:h,...i(this,x).call(this)}),P}),m(this,ge,n=>n?.type==="object"&&"object"in n?i(this,Z).call(this,n.object):n?.type==="value"?n.value:n),m(this,pe,({body:n})=>{n?.logLevel&&(i(this,g).setLogLevel(n.logLevel),i(this,g).debug(`Log level changed by host to ${n.logLevel}`)),b(this,X,n?.guestId??null),b(this,K,n?.guestTitle??null),b(this,Q,n?.guestUrl??null),i(this,g).audit({message:"Received configuration from Host",...i(this,x).call(this)})}),m(this,we,()=>{window.focus()}),m(this,me,async({sourceWin:n,sourceOrigin:h,requestId:d,body:l})=>{const w=i(this,Z).call(this,l.object);if(w){const P=Pe(w.id,l.eventName);i(this,g).debug(`Received event "${P}" from host`);let C;l.eventHandler?C=[{callback:window[l.eventHandler],token:ee()}]:C=i(this,L).get(P)||[];const B=[];if(C.forEach(G=>{if(G?.callback){i(this,g).debug(`Invoking event subscriber ${G.callback.name} for event ${P}`);const se=G.callback({obj:w,eventName:l.eventName,eventParams:l.eventParams,eventOptions:l.eventOptions});se instanceof Promise?B.push(se):typeof se<"u"&&B.push(Promise.resolve(se))}}),d){const G=await Promise.all(B);i(this,_).respond({targetWin:n,targetOrigin:h,requestId:d,response:G}),i(this,g).audit({message:"Guest proxy processed event from host and responded",scriptingEventId:P,scriptingObject:w.id,...i(this,x).call(this)})}else i(this,g).audit({message:"Guest proxy processed event from host",scriptingEventId:P,scriptingObject:w.id,...i(this,x).call(this)})}}),$(this,"addScript",async(n,h)=>{if(!i(this,Y)&&n){await this.connect();const d=document.createElement("script");d.setAttribute("src",n),await new Promise(l=>{const w=()=>{d?.removeEventListener?.("load",w),b(this,Y,!0),l()};d.addEventListener("load",w),b(this,D,h.appendChild(d))})}}),$(this,"close",()=>{i(this,H)&&(i(this,_).send({targetWin:i(this,j),targetOrigin:i(this,S),messageType:W.GuestClose,messageBody:{}}),i(this,_).removeSender({origin:i(this,S),window:i(this,j)}),i(this,_).close(),b(this,H,!1),i(this,g).audit({message:"Guest disconnected from host",...i(this,x).call(this)}),b(this,X,null),b(this,Q,null),b(this,K,null))}),$(this,"connect",async n=>{if(!i(this,H)){let h=window,d={...Fe};if(n){h=n.window||h;const w={...n};delete w.window,d=Object.assign(d,w)}const l=await He();b(this,S,l.origin),b(this,j,l.window),i(this,_).initialize(h),i(this,_).addSender({origin:i(this,S),window:i(this,j)}),i(this,_).listen({messageType:W.ObjectEvent,callback:i(this,me).bind(this)}),i(this,_).listen({messageType:W.HostConfig,callback:i(this,pe).bind(this)}),i(this,_).listen({messageType:W.GuestFocus,callback:i(this,we).bind(this)}),i(this,_).send({targetWin:i(this,j),targetOrigin:i(this,S),messageType:W.GuestReady,messageBody:d}),b(this,H,!0),i(this,g).audit({message:"Guest connected to host",guestUrl:window.location.href})}}),$(this,"getObject",async n=>{i(this,g).debug(`Retrieving scripting object "${n}" from host...`);const h=await i(this,_).invoke({targetWin:i(this,j),targetOrigin:i(this,S),messageType:W.ObjectGet,messageBody:{objectId:n}}),d=i(this,Z).call(this,h.object);return i(this,g).audit({message:"Received scripting object from host",scriptingObject:n,...i(this,x).call(this)}),d}),$(this,"removeScript",()=>{if(i(this,Y)&&i(this,D)){const{parentNode:n}=i(this,D);n?.removeChild?.(i(this,D))}}),$(this,"setLogLevel",n=>{i(this,g).setLogLevel(n),i(this,g).debug(`Log level changed by guest to ${n}`)}),$(this,"subscribe",n=>{const{eventId:h,callback:d}=n;i(this,g).debug(`Registering subscription for event ${h}`);const l=i(this,L).get(h)||[],w=ee();return l.push({callback:d,token:w}),i(this,L).set(h,l),w}),$(this,"unsubscribe",n=>{const{eventId:h,token:d}=n;let l=i(this,L).get(h);l&&(l=l.filter(w=>w.token!==d),i(this,L).set(h,l))});const{console:o=!1,url:s=window.__ICE__?.diagnosticsUrl||Ve,index:r,team:c,appName:p}=t?.logger||{},v=o?(0,he.Console)():(0,he.http)(s);b(this,g,(0,he.logger)({transport:v,index:r,team:c,appName:p})),b(this,N,ee()),b(this,_,new Te(i(this,g),i(this,N))),i(this,g).audit({message:"Guest created",guestUrl:window.location.href,correlationId:i(this,N)})}}N=new WeakMap,g=new WeakMap,_=new WeakMap,Y=new WeakMap,D=new WeakMap,H=new WeakMap,L=new WeakMap,X=new WeakMap,K=new WeakMap,Q=new WeakMap,S=new WeakMap,j=new WeakMap,x=new WeakMap,Z=new WeakMap,ue=new WeakMap,ge=new WeakMap,pe=new WeakMap,we=new WeakMap,me=new WeakMap})(),ne})());
2
+
3
+ //# sourceMappingURL=index.js.map
Binary file
Binary file
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","mappings":"CAAC,SAA0CA,EAAMC,EAAS,CACtD,OAAO,SAAY,UAAY,OAAO,QAAW,SACnD,OAAO,QAAUA,EAAQ,QAAQ,iBAAiB,CAAC,EAC5C,OAAO,QAAW,YAAc,OAAO,IAC9C,OAAO,CAAC,iBAAiB,EAAGA,CAAO,EAC5B,OAAO,SAAY,SAC1B,QAAQ,IAASA,EAAQ,QAAQ,iBAAiB,CAAC,EAEnDD,EAAK,IAASC,EAAQD,EAAK,eAAkB,CAC/C,GAAG,WAAaE,K,iCCThBC,EAAO,QAAUD,E,GCCbE,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,EAAU,CAEtC,IAAIC,EAAeH,EAAyBE,CAAQ,EACpD,GAAIC,IAAiB,OACpB,OAAOA,EAAa,QAGrB,IAAIJ,EAASC,EAAyBE,CAAQ,EAAI,CAGjD,QAAS,CAAC,CACX,EAGA,OAAAE,EAAoBF,CAAQ,EAAEH,EAAQA,EAAO,QAASE,CAAmB,EAGlEF,EAAO,OACf,CCrBAE,EAAoB,EAAI,CAACI,EAASC,IAAe,CAChD,QAAQC,KAAOD,EACXL,EAAoB,EAAEK,EAAYC,CAAG,GAAK,CAACN,EAAoB,EAAEI,EAASE,CAAG,GAC/E,OAAO,eAAeF,EAASE,EAAK,CAAE,WAAY,GAAM,IAAKD,EAAWC,CAAG,CAAE,CAAC,CAGjF,ECPAN,EAAoB,EAAI,CAACO,EAAKC,IAAU,OAAO,UAAU,eAAe,KAAKD,EAAKC,CAAI,ECCtFR,EAAoB,EAAKI,GAAY,CACjC,OAAO,OAAW,KAAe,OAAO,aAC1C,OAAO,eAAeA,EAAS,OAAO,YAAa,CAAE,MAAO,QAAS,CAAC,EAEvE,OAA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cA8CA,eAoDA,eAUA,eAeA,eAIA,c","sources":["webpack://ice/webpack/universalModuleDefinition","webpack://ice/external umd \"emuiDiagnostics\"","webpack://ice/webpack/bootstrap","webpack://ice/webpack/runtime/define property getters","webpack://ice/webpack/runtime/hasOwnProperty shorthand","webpack://ice/webpack/runtime/make namespace object","webpack://ice/../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-browser/native.js","webpack://ice/../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-browser/rng.js","webpack://ice/../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-browser/stringify.js","webpack://ice/../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-browser/v4.js","webpack://ice/../common/dist/esm/remoting.js","webpack://ice/../common/dist/esm/messageType.js","webpack://ice/../common/dist/esm/event.js","webpack://ice/./lib/proxy.ts","webpack://ice/./lib/proxyEvent.ts","webpack://ice/./lib/utils.ts","webpack://ice/./lib/guest.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"emuiDiagnostics\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"emuiDiagnostics\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"ice\"] = factory(require(\"emuiDiagnostics\"));\n\telse\n\t\troot[\"ice\"] = factory(root[\"emuiDiagnostics\"]);\n})(globalThis, (__WEBPACK_EXTERNAL_MODULE__270__) => {\nreturn ","module.exports = __WEBPACK_EXTERNAL_MODULE__270__;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);\nexport default {\n randomUUID\n};","// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\nlet getRandomValues;\nconst rnds8 = new Uint8Array(16);\nexport default function rng() {\n // lazy load so that environments that need to polyfill have a chance to do so\n if (!getRandomValues) {\n // getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation.\n getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);\n\n if (!getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n }\n\n return getRandomValues(rnds8);\n}","import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nconst byteToHex = [];\n\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).slice(1));\n}\n\nexport function unsafeStringify(arr, offset = 0) {\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();\n}\n\nfunction stringify(arr, offset = 0) {\n const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nexport default stringify;","import native from './native.js';\nimport rng from './rng.js';\nimport { unsafeStringify } from './stringify.js';\n\nfunction v4(options, buf, offset) {\n if (native.randomUUID && !buf && !options) {\n return native.randomUUID();\n }\n\n options = options || {};\n const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return unsafeStringify(rnds);\n}\n\nexport default v4;","var __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => {\n __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\n return value;\n};\nvar __accessCheck = (obj, member, msg) => {\n if (!member.has(obj))\n throw TypeError(\"Cannot \" + msg);\n};\nvar __privateGet = (obj, member, getter) => {\n __accessCheck(obj, member, \"read from private field\");\n return getter ? getter.call(obj) : member.get(obj);\n};\nvar __privateAdd = (obj, member, value) => {\n if (member.has(obj))\n throw TypeError(\"Cannot add the same private member more than once\");\n member instanceof WeakSet ? member.add(obj) : member.set(obj, value);\n};\nvar __privateSet = (obj, member, value, setter) => {\n __accessCheck(obj, member, \"write to private field\");\n setter ? setter.call(obj, value) : member.set(obj, value);\n return value;\n};\nvar _correlationId, _logger, _listeners, _invocations, _timeoutMonitorHandle, _allowedSenders, _evaluateTimeouts, _startResponseMonitor, _stopResponseMonitor, _popInvocation, _processResponse, _processException, _receive, _processMessage;\nimport { v4 as uuidv4 } from \"uuid\";\nconst MESSAGE_SOURCE = \"elli:remoting\";\nconst RESPONSE_MESSAGE_TYPE = \"elli:remoting:response\";\nconst EXCEPTION_MESSAGE_TYPE = \"elli:remoting:exception\";\nconst createMessage = ({\n messageType,\n messageBody,\n onewayMsg = false\n}) => ({\n requestId: !onewayMsg ? uuidv4() : null,\n source: MESSAGE_SOURCE,\n type: messageType,\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n body: messageBody\n});\nconst sendMessage = (param) => {\n const { targetWin, targetOrigin, messageType, messageBody } = param;\n const msg = createMessage({ messageType, messageBody });\n targetWin.postMessage(msg, targetOrigin);\n};\nclass Remoting {\n /**\n * Create a new instance of the Remoting class\n *\n * @param logger pui-diagnostic logger\n * @param correlationId unique id for the current session\n */\n constructor(logger, correlationId) {\n __privateAdd(this, _correlationId, void 0);\n __privateAdd(this, _logger, void 0);\n /**\n * set of listeners that are registered\n */\n __privateAdd(this, _listeners, /* @__PURE__ */ new Map());\n /**\n * Represents the set of invocations that are waiting for a response\n */\n __privateAdd(this, _invocations, /* @__PURE__ */ new Map());\n /**\n * The handle to the timeout monitor\n */\n __privateAdd(this, _timeoutMonitorHandle, null);\n /**\n * The set of windows that are allowed to send messages to this window\n */\n __privateAdd(this, _allowedSenders, /* @__PURE__ */ new Map());\n // Evaluates the timeouts on any waiting invocations\n __privateAdd(this, _evaluateTimeouts, () => {\n const ts = Date.now();\n const canceledItems = [];\n __privateGet(this, _invocations).forEach((eventData, key) => {\n const { requestId, cancelTime } = eventData;\n __privateGet(this, _logger).debug(\n `Checking response timeout for requestId: ${requestId}) @ ${cancelTime ?? \"\"}`\n );\n if (eventData.cancelTime && eventData.cancelTime < ts) {\n __privateGet(this, _logger).debug(\n `Detected response timeout for requestId: ${requestId}...`\n );\n canceledItems.push(key);\n eventData.resolve();\n __privateGet(this, _logger).debug(\n `Aborted waiting for response to requestid: ${requestId})`\n );\n }\n });\n canceledItems.forEach((key) => {\n __privateGet(this, _logger).debug(\n `removing invocations with requestId ${key} from cache since response time has expired`\n );\n __privateGet(this, _invocations).delete(key);\n });\n if (__privateGet(this, _invocations).size === 0) {\n __privateGet(this, _logger).debug(`stopping response monitor`);\n __privateGet(this, _stopResponseMonitor).call(this);\n }\n });\n // Set a timer interval to catch any invocations that didn't respond in a timely manner\n __privateAdd(this, _startResponseMonitor, () => {\n if (__privateGet(this, _timeoutMonitorHandle) === null) {\n __privateGet(this, _logger).debug(\"Staring response timeout evaluator\");\n __privateSet(this, _timeoutMonitorHandle, window.setInterval(\n __privateGet(this, _evaluateTimeouts),\n 200\n ));\n }\n });\n // Stops the timeout monitor interval\n __privateAdd(this, _stopResponseMonitor, () => {\n if (__privateGet(this, _timeoutMonitorHandle) !== null) {\n window.clearInterval(__privateGet(this, _timeoutMonitorHandle));\n __privateSet(this, _timeoutMonitorHandle, null);\n __privateGet(this, _logger).debug(\"Stopped response timeout evaluator\");\n }\n });\n // Pops an invocation from the incovation list\n __privateAdd(this, _popInvocation, (requestId) => {\n const e = __privateGet(this, _invocations).get(requestId);\n __privateGet(this, _logger).debug(`serving requestId: ${requestId}`);\n __privateGet(this, _invocations).delete(requestId);\n return e;\n });\n // Handles a response to a prior cross-frame invocation\n __privateAdd(this, _processResponse, (message) => {\n const { requestId } = message;\n __privateGet(this, _logger).debug(\n `Response received for invocation requestId: ${requestId}`\n );\n const eventData = __privateGet(this, _popInvocation).call(this, requestId);\n if (!eventData) {\n __privateGet(this, _logger).warn(\n `Received response to stale/invalid request with requestId: ${requestId}`\n );\n return false;\n }\n eventData.resolve(message.body);\n return true;\n });\n // Handles a response to a prior cross-frame invocation\n __privateAdd(this, _processException, (message) => {\n __privateGet(this, _logger).debug(\n `Exception received for invocation (requestId = ${message.requestId})`\n );\n const eventData = __privateGet(this, _popInvocation).call(this, message.requestId);\n if (!eventData) {\n __privateGet(this, _logger).warn(\n `Received exception for stale/invalid request (requestId = ${message.requestId})`\n );\n return false;\n }\n eventData.reject(new Error(message.body));\n return true;\n });\n // Receives a message from another window and invokes any event handlers\n __privateAdd(this, _receive, ({\n sourceWin,\n sourceOrigin,\n message\n }) => {\n __privateGet(this, _logger).debug(`Received message of type \"${message.type}\"`);\n const callbacks = __privateGet(this, _listeners).get(message.type);\n if (!callbacks)\n return false;\n callbacks.forEach((callback) => {\n __privateGet(this, _logger).debug(`Invoking message handler ${callback.name}`);\n callback({\n sourceWin,\n sourceOrigin,\n requestId: message.requestId,\n type: message.type,\n body: message.body\n });\n });\n return true;\n });\n // Processes a message received thru the window's message event\n __privateAdd(this, _processMessage, (message) => {\n __privateGet(this, _logger).debug(\n `Remoting: Received message ${JSON.stringify(message.data)}`\n );\n if (__privateGet(this, _allowedSenders).size === 0)\n return false;\n if (!message.source)\n return false;\n const senderOrigin = __privateGet(this, _allowedSenders).get(message.source);\n if (!senderOrigin)\n return false;\n if (message?.data?.source !== MESSAGE_SOURCE)\n return false;\n if (message.data.type === RESPONSE_MESSAGE_TYPE)\n __privateGet(this, _processResponse).call(this, message.data);\n else if (message.data.type === EXCEPTION_MESSAGE_TYPE)\n __privateGet(this, _processException).call(this, message.data);\n else\n __privateGet(this, _receive).call(this, {\n sourceWin: message.source,\n sourceOrigin: senderOrigin,\n message: message.data\n });\n return true;\n });\n /**\n * Adds window and its origin list of allowed senders\n *\n * @param {AddSenderParam} param - The sender to add\n */\n __publicField(this, \"addSender\", (param) => {\n const { origin, window: window2 } = param;\n if (!origin)\n throw new Error(\"origin is required\");\n if (!window2)\n throw new Error(\"window is required\");\n __privateGet(this, _allowedSenders).set(window2, origin);\n });\n /**\n * Initializes the remoting service for a window\n *\n * @param win The window to initialize remoting for\n */\n __publicField(this, \"initialize\", (win) => {\n win.removeEventListener(\"message\", __privateGet(this, _processMessage));\n win.addEventListener(\"message\", __privateGet(this, _processMessage));\n __privateGet(this, _logger).debug(`initialized remoting id: ${__privateGet(this, _correlationId)}`);\n });\n /**\n * Closes the remoting service for a window\n */\n __publicField(this, \"close\", () => {\n window.removeEventListener(\"message\", __privateGet(this, _processMessage));\n __privateGet(this, _logger).debug(`closed remoting id: ${__privateGet(this, _correlationId)}`);\n });\n /**\n * Sends an invocation which generates a Promise to be used to get a response\n *\n * @param {InvokeParam} param The parameters for the invocation\n * @returns promisifyed response\n */\n __publicField(this, \"invoke\", (param) => {\n const {\n targetWin,\n targetOrigin,\n messageType,\n messageBody,\n responseTimeoutMs\n } = param;\n return new Promise((resolve, reject) => {\n const msg = createMessage({ messageType, messageBody });\n __privateGet(this, _invocations).set(msg.requestId, {\n requestId: msg.requestId,\n resolve,\n reject,\n cancelTime: responseTimeoutMs ? Date.now() + Number.parseInt(responseTimeoutMs, 10) : null\n });\n targetWin.postMessage(msg, targetOrigin);\n const { requestId } = msg;\n __privateGet(this, _logger).debug(\n `Posted invocation message of type ${messageType} requestId: ${requestId || \"\"}`\n );\n if (responseTimeoutMs) {\n __privateGet(this, _logger).debug(\n `starting response monitor for requestId: ${requestId || \"\"} for ${responseTimeoutMs} ms`\n );\n __privateGet(this, _startResponseMonitor).call(this);\n }\n });\n });\n /**\n * Setup callback for a specific message type\n *\n * @param {ListenParam<T>} param The parameters for the listener\n */\n __publicField(this, \"listen\", (param) => {\n const { messageType, callback } = param;\n const items = __privateGet(this, _listeners).get(messageType) || [];\n items.push(callback);\n __privateGet(this, _listeners).set(messageType, items);\n });\n /**\n * Send a message without any form of response. Fire and forget\n *\n * @param {SendParam} param The parameters for the send\n */\n __publicField(this, \"send\", (param) => {\n const { targetWin, targetOrigin, messageType, messageBody } = param;\n const msg = createMessage({\n messageType,\n messageBody,\n onewayMsg: true\n });\n targetWin.postMessage(msg, targetOrigin);\n __privateGet(this, _logger).debug(`Posted one-way message of type \"${messageType}\"`);\n });\n /**\n * Removes a window from the list of allowed senders\n *\n * @param {AddSenderParam} param - The sender to remove\n */\n __publicField(this, \"removeSender\", (param) => {\n const { window: window2 } = param;\n if (window2)\n __privateGet(this, _allowedSenders).delete(window2);\n });\n /**\n * Send a response message to a window\n *\n * @param {RespondParam} param The parameters for the response\n */\n __publicField(this, \"respond\", (param) => {\n const { targetWin, targetOrigin, requestId, response } = param;\n const msg = createMessage({\n messageType: RESPONSE_MESSAGE_TYPE,\n messageBody: response\n });\n msg.requestId = requestId;\n targetWin.postMessage(msg, targetOrigin);\n __privateGet(this, _logger).debug(\n `Response sent to caller for invocation requestId: ${requestId}`\n );\n });\n /**\n * Send an exception message to a window\n *\n * @param {RaiseExceptionParam} param The parameters for the exception\n */\n __publicField(this, \"raiseException\", (param) => {\n const { targetWin, targetOrigin, requestId, ex } = param;\n const msg = createMessage({\n messageType: EXCEPTION_MESSAGE_TYPE,\n messageBody: ex\n });\n msg.requestId = requestId;\n targetWin.postMessage(msg, targetOrigin);\n __privateGet(this, _logger).debug(\n `Exception sent to caller for invocation. requestId: ${requestId}`\n );\n });\n if (!logger)\n throw new Error(\"logger is required\");\n if (!correlationId)\n throw new Error(\"correlationId is required\");\n __privateSet(this, _correlationId, correlationId);\n __privateSet(this, _logger, logger);\n }\n}\n_correlationId = new WeakMap();\n_logger = new WeakMap();\n_listeners = new WeakMap();\n_invocations = new WeakMap();\n_timeoutMonitorHandle = new WeakMap();\n_allowedSenders = new WeakMap();\n_evaluateTimeouts = new WeakMap();\n_startResponseMonitor = new WeakMap();\n_stopResponseMonitor = new WeakMap();\n_popInvocation = new WeakMap();\n_processResponse = new WeakMap();\n_processException = new WeakMap();\n_receive = new WeakMap();\n_processMessage = new WeakMap();\nexport {\n Remoting,\n sendMessage\n};\n","var MessageType = /* @__PURE__ */ ((MessageType2) => {\n MessageType2[\"GuestReady\"] = \"guest:ready\";\n MessageType2[\"GuestClose\"] = \"guest:close\";\n MessageType2[\"GuestReadyComplete\"] = \"guest:readyComplete\";\n MessageType2[\"GuestResize\"] = \"guest:resize\";\n MessageType2[\"GuestFocus\"] = \"guest:focus\";\n MessageType2[\"HandShake\"] = \"handshake\";\n MessageType2[\"HandShakeAck\"] = \"handshake:ack\";\n MessageType2[\"ObjectInvoke\"] = \"object:invoke\";\n MessageType2[\"ObjectGet\"] = \"object:get\";\n MessageType2[\"ObjectEvent\"] = \"object:event\";\n MessageType2[\"HostConfig\"] = \"host:config\";\n return MessageType2;\n})(MessageType || {});\nexport {\n MessageType\n};\n","class Event {\n /* eslint-enable indent */\n /**\n * scripting object that owns this event\n */\n scriptingObject;\n /**\n * name of the event\n */\n name;\n /**\n * scripting object id that owns this event\n */\n objectId;\n /**\n * flag indicating this event requires feedback from all of the listeners\n */\n requiresFeedback;\n /**\n * unique id of the event\n */\n id;\n /**\n * Create an event object\n *\n * @param {EventParam} param - parameters for creating an event\n */\n constructor(param) {\n const { name, requiresFeedback = false, so } = param;\n if (!name)\n throw new Error(\"Event name is required\");\n if (!so)\n throw new Error(\"Scripting object is required\");\n this.scriptingObject = so;\n this.objectId = so.id;\n this.name = name;\n this.id = `${this.objectId}.${this.name}`.toLowerCase();\n this.requiresFeedback = requiresFeedback;\n }\n}\nconst isEvent = (value) => value instanceof Event;\nconst getEventId = (objectId, eventName) => `${objectId.toLowerCase()}.${eventName.toLowerCase()}`;\nexport {\n Event,\n getEventId,\n isEvent\n};\n","// Defines the class for a Control\nimport type { IScriptingObjectProxy } from '@elliemae/pui-scripting-object';\n\n/**\n * Scripting Object Proxy implementation\n */\nexport class Proxy implements IScriptingObjectProxy {\n /**\n * unique id of scripting object\n */\n public readonly id: string;\n\n /**\n * type of scripting object\n */\n public readonly objectType: string;\n\n /**\n * Creates a new instance of the Scripting Object Proxy\n *\n * @param objectId unique id of scripting object\n * @param objectType type of scripting object\n */\n constructor(objectId: string, objectType: string) {\n this.id = objectId;\n this.objectType = objectType;\n }\n}\n","import type { Events } from '@elliemae/pui-scripting-object';\nimport type {\n IScriptingObjectProxyEvent,\n EventListeners,\n} from '@elliemae/ssf-common';\n\n/**\n * ProxyEvent constructor parameter\n */\nexport type ProxyEventParam = {\n /**\n * name of the event\n */\n name: string;\n /**\n * unique id of scripting object\n */\n objectId: string;\n};\n\n/**\n * Scripting Object Proxy Event implementation\n *\n * @typeParam AppEvents - type of the events that the scripting object supports\n */\n/* eslint-disable indent */\nexport class ProxyEvent<AppEvents extends EventListeners = Events>\n implements IScriptingObjectProxyEvent<AppEvents>\n{\n /* eslint-enable indent */\n /**\n * unique id of scripting object\n */\n public readonly objectId: string;\n\n /**\n * name of the event\n */\n public readonly name: string;\n\n /**\n * unique id of the event\n */\n public readonly id: Extract<keyof AppEvents, string>;\n\n /**\n * Create a new instance of the Scripting Object Proxy Event\n *\n * @param {ProxyEventParam} param - parameter for the constructor\n */\n constructor(param: ProxyEventParam) {\n const { name, objectId } = param;\n this.objectId = objectId;\n this.name = name;\n this.id = `${this.objectId}.${this.name}`.toLowerCase() as Extract<\n keyof AppEvents,\n string\n >;\n }\n}\n","import { MessageType, sendMessage } from '@elliemae/ssf-common';\n\nexport const getOrigin = (url: string) => {\n if (url === 'about:blank') return '*';\n const { origin } = new URL(url);\n return origin === 'null' || !origin ? url : origin;\n};\n\nexport const isEmbedded = () => window.self !== window.parent;\n\nexport const getComputedStyle = (\n prop: keyof CSSStyleDeclaration,\n el?: HTMLBodyElement,\n) => {\n const bodyElement = el || document.body;\n const retVal = document.defaultView?.getComputedStyle?.(bodyElement, null);\n const propValue = retVal ? (retVal[prop] as string) : '0';\n return parseInt(propValue, 10);\n};\n\n// eslint-disable-next-line prefer-regex-literals\nconst originsRegex = new RegExp(\n `^https?://(.*.elliemae.io|.*.ellielabs.com|.*.ellieservices.com|.*.encompassloconnect.com|.*.ice.com|localhost:[0-9]+)`,\n 'i',\n);\nconst MESSAGE_SOURCE = 'elli:remoting';\n\nexport const getHostDetails = () =>\n new Promise<{ origin: string; window: Window }>((resolve) => {\n if (!isEmbedded()) {\n window.addEventListener(\n 'message',\n (event: MessageEvent<{ source: string; type: string }>) => {\n if (originsRegex.test(event.origin)) {\n const { source, type } = event.data || {};\n if (source === MESSAGE_SOURCE && type === MessageType.HandShake) {\n const { origin } = event;\n const window = event.source as Window;\n // send handshake acknoledgement\n sendMessage({\n targetWin: window,\n targetOrigin: origin,\n messageType: MessageType.HandShakeAck,\n messageBody: {},\n });\n resolve({ origin, window });\n }\n }\n },\n );\n } else {\n resolve({\n origin: getOrigin(document.referrer || window.parent.location.href),\n window: window.parent,\n });\n }\n });\n","/* eslint-disable max-lines */\n// Provides functions for proxying objects and functions/events between the parent window\n// and the sandboxed script.\nimport { v4 as uuidv4 } from 'uuid';\nimport type {\n IScriptingObjectProxy,\n RemotingScriptingObject,\n Listener,\n Events,\n} from '@elliemae/pui-scripting-object';\nimport {\n Remoting,\n sendMessage,\n MessageType,\n getEventId,\n} from '@elliemae/ssf-common';\nimport type {\n ListenerCallbackParams,\n RemotingEventMessage,\n ConnectParam,\n GuestSubscribeParam,\n GuestUnsubscribeParam,\n EventListeners,\n ISSFGuest,\n} from '@elliemae/ssf-common';\nimport {\n logger as puiLogger,\n Console,\n http,\n LogLevels,\n Logger,\n} from '@elliemae/pui-diagnostics';\nimport { Proxy } from './proxy.js';\nimport { ProxyEvent } from './proxyEvent.js';\nimport {\n getOrigin,\n isEmbedded,\n getComputedStyle,\n getHostDetails,\n} from './utils.js';\n\nenum ResponseType {\n OBJECT = 'object',\n VALUE = 'value',\n}\n\ntype ObjectResponse = {\n type: ResponseType.OBJECT;\n object: RemotingScriptingObject;\n};\n\ntype ValueResponse = {\n type: ResponseType.VALUE;\n value: any;\n};\n\ntype Response = ObjectResponse | ValueResponse;\ntype Config = {\n logLevel: LogLevels;\n guestId: string;\n guestTitle: string;\n guestUrl: string;\n};\n\nexport type ListenerInfo = {\n callback: Listener<any, any, any, any>;\n token: string;\n};\n\n// Provides a list of capabilities of this version of teh scripting framework\nconst capabilities = {\n eventFeedback: true,\n};\n\nconst onLoad = () => {\n const { document } = window;\n const iframeBody = document.body;\n const iframeHTML = document.documentElement;\n const bodyOffsetHeight =\n iframeBody.offsetHeight +\n getComputedStyle('marginTop') +\n getComputedStyle('marginBottom');\n const size = {\n height: bodyOffsetHeight,\n width: Math.max(iframeBody.scrollWidth, iframeHTML.scrollWidth),\n };\n sendMessage({\n targetWin: window.parent,\n targetOrigin: getOrigin(document.referrer || window.parent.location.href),\n messageType: MessageType.GuestResize,\n messageBody: size,\n });\n window.removeEventListener('load', onLoad);\n};\n\n// if hosted in iframe then wait for load event to send resize message\nif (isEmbedded()) {\n window.addEventListener('load', onLoad);\n}\n\n/**\n * options for the guest\n */\nexport type GuestOption = {\n /**\n * options for the logger\n */\n logger: {\n /**\n * log to console\n */\n console?: boolean;\n /**\n * url to send logs to\n */\n url?: string;\n /**\n * index to use for logging\n */\n index: string;\n /**\n * app name to use for logging\n */\n appName: string;\n /**\n * team name that owns the app\n */\n team: string;\n };\n};\n\nconst DIAGNOSTICS_URL = 'https://api.ellielabs.com/diagnostics/v2/logging';\n\n/**\n * Creates a new guest that can be used to communicate with the parent host application\n *\n * @typeParm AppEvents - The events that the guest application listens\n */\n/* eslint-disable indent */\nexport class SSFGuest<AppEvents extends EventListeners = Events>\n implements ISSFGuest<AppEvents>\n{\n /* eslint-enable indent */\n #correlationId: string;\n\n #logger: Logger;\n\n #remoting: Remoting;\n\n #created = false;\n\n #scriptElement: HTMLScriptElement | null = null;\n\n #isConnected = false;\n\n #eventListeners = new Map<string, ListenerInfo[]>();\n\n #id: string | null = null;\n\n #title: string | null = null;\n\n #url: string | null = null;\n\n #hostOrigin: string | null = null;\n\n #hostWindow: Window | null = null;\n\n /**\n * Create new guest\n *\n * @param {GuestOption} options - options for the guest\n */\n constructor(options: GuestOption) {\n const {\n console: logToConsole = false,\n // eslint-disable-next-line no-underscore-dangle\n url = window.__ICE__?.diagnosticsUrl || DIAGNOSTICS_URL,\n index,\n team,\n appName,\n } = options?.logger || {};\n const transport = logToConsole ? Console() : http(url);\n this.#logger = puiLogger({\n transport,\n index,\n team,\n appName,\n });\n this.#correlationId = uuidv4();\n this.#remoting = new Remoting(this.#logger, this.#correlationId);\n this.#logger.audit({\n message: 'Guest created',\n guestUrl: window.location.href,\n correlationId: this.#correlationId,\n });\n }\n\n #getGuestInfo = () => ({\n guestId: this.#id,\n guestTitle: this.#title,\n guestUrl: this.#url,\n });\n\n /**\n * Marshals scripting object JSON into a proxy object\n *\n * @param soJSON scripting object JSON\n * @returns marshaled proxy object\n */\n #fromJSON = (soJSON: RemotingScriptingObject): IScriptingObjectProxy => {\n // Ensure we have JSON\n if (!soJSON || !soJSON.objectId) {\n this.#logger.error(\n 'Deserialization of scripting object failed. Object does not have an Object ID.',\n );\n throw new Error('Cannot deserialize object JSON into proxy.');\n }\n\n // Create a new object\n const ctrl = new Proxy(soJSON.objectId, soJSON.objectType);\n\n // Dynamically build the function set on the control\n if (soJSON.functions) {\n soJSON.functions.forEach((functionName) => {\n Object.defineProperty(ctrl, functionName, {\n value: async <T>(...args: any[]) =>\n this.#invoke<T>({\n objectId: ctrl.id,\n functionName,\n functionParams: [].slice.call(args),\n }),\n enumerable: true,\n });\n });\n }\n\n // Dynamically create the event proxies\n if (soJSON.events) {\n soJSON.events.forEach((eventName) => {\n Object.defineProperty(ctrl, eventName, {\n value: new ProxyEvent({\n objectId: ctrl.id,\n name: eventName,\n }),\n enumerable: true,\n });\n });\n }\n\n this.#logger.debug(\n `Created guest proxy for scripting object (id = \"${ctrl.id}\")`,\n );\n return ctrl;\n };\n\n #invoke = async <T>({\n objectId,\n functionName,\n functionParams,\n }: {\n objectId: string;\n functionName: string;\n functionParams: Array<any>;\n }) => {\n this.#logger.debug(\n `Invoking scripting object method ${objectId}.${functionName}()...`,\n );\n\n // Find any function params that are promises\n const promises = [];\n if (functionParams) {\n for (let i = 0; i < functionParams.length; i += 1) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n const p = functionParams[i];\n if (p instanceof Promise) {\n promises.push(\n p.then((val) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n functionParams[i] = val;\n }),\n );\n }\n }\n }\n\n // Now wait to resolve all of the promises and then call our invoke\n await Promise.all(promises);\n const response = await this.#remoting.invoke<Response>({\n targetWin: this.#hostWindow!,\n targetOrigin: this.#hostOrigin!,\n messageType: MessageType.ObjectInvoke,\n messageBody: {\n objectId,\n functionName,\n functionParams,\n },\n });\n const retVal = this.#handleResponse<T>(response);\n this.#logger.audit({\n message: 'Guest proxy invoked Scripting Object method',\n scriptingObject: objectId,\n scriptingMethod: functionName,\n ...this.#getGuestInfo(),\n });\n return retVal;\n };\n\n #handleResponse = <T>(response: ObjectResponse | ValueResponse) => {\n if (response?.type === ResponseType.OBJECT && 'object' in response) {\n return this.#fromJSON(response.object);\n }\n if (response?.type === ResponseType.VALUE) {\n return response.value as T;\n }\n return response;\n };\n\n #handleConfigChangeEvent = ({ body }: ListenerCallbackParams<Config>) => {\n // Handle log level changes\n if (body?.logLevel) {\n this.#logger.setLogLevel(body.logLevel);\n this.#logger.debug(`Log level changed by host to ${body.logLevel}`);\n }\n this.#id = body?.guestId ?? null;\n this.#title = body?.guestTitle ?? null;\n this.#url = body?.guestUrl ?? null;\n this.#logger.audit({\n message: 'Received configuration from Host',\n ...this.#getGuestInfo(),\n });\n };\n\n #handleFocusEvent = () => {\n window.focus();\n };\n\n #handleObjectEvent = async ({\n sourceWin,\n sourceOrigin,\n requestId,\n body,\n }: ListenerCallbackParams<RemotingEventMessage>) => {\n // Deserialize the object\n const object = this.#fromJSON(body.object);\n if (object) {\n // Get the listeners for the event\n const eventId = getEventId(object.id, body.eventName);\n this.#logger.debug(`Received event \"${eventId}\" from host`);\n\n // If an event handler is specified in the request body, then we will target\n // the event to that function only.\n let listeners: Array<ListenerInfo>;\n if (body.eventHandler) {\n listeners = [\n {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n callback: (window as { [key: string]: any })[body.eventHandler],\n token: uuidv4(),\n },\n ];\n } else {\n listeners = this.#eventListeners.get(eventId) || [];\n }\n\n // Notify each listener, recording a promise for each response\n const promises: Array<Promise<any>> = [];\n\n listeners.forEach((callbackInfo) => {\n if (callbackInfo?.callback) {\n this.#logger.debug(\n `Invoking event subscriber ${callbackInfo.callback.name} for event ${eventId}`,\n );\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n const retVal = callbackInfo.callback({\n obj: object,\n eventName: body.eventName,\n eventParams: body.eventParams,\n eventOptions: body.eventOptions,\n });\n\n if (retVal instanceof Promise) {\n promises.push(retVal);\n } else if (typeof retVal !== 'undefined') {\n promises.push(Promise.resolve(retVal));\n }\n }\n });\n\n // Resolve all promises and return a response to the calling window\n if (requestId) {\n const values = await Promise.all(promises);\n this.#remoting.respond({\n targetWin: sourceWin,\n targetOrigin: sourceOrigin,\n requestId,\n response: values,\n });\n this.#logger.audit({\n message: 'Guest proxy processed event from host and responded',\n scriptingEventId: eventId,\n scriptingObject: object.id,\n ...this.#getGuestInfo(),\n });\n } else {\n this.#logger.audit({\n message: 'Guest proxy processed event from host',\n scriptingEventId: eventId,\n scriptingObject: object.id,\n ...this.#getGuestInfo(),\n });\n }\n }\n };\n\n /**\n * Initialize guest using script\n *\n * @param scriptUri uri of the script\n * @param containerElement dom element to inject the script at\n */\n addScript = async (scriptUri: string, containerElement: HTMLElement) => {\n if (!this.#created && scriptUri) {\n await this.connect();\n // Load the script and await its load event before signaling that the window is\n // ready to receive events\n const scriptEle = document.createElement('script');\n scriptEle.setAttribute('src', scriptUri);\n await new Promise<void>((resolve) => {\n const onScriptLoad = () => {\n scriptEle?.removeEventListener?.('load', onScriptLoad);\n // Set the created flag\n this.#created = true;\n resolve();\n };\n scriptEle.addEventListener('load', onScriptLoad);\n this.#scriptElement = containerElement.appendChild(scriptEle);\n });\n }\n };\n\n /**\n * Close the connection to the host\n */\n close = () => {\n if (!this.#isConnected) return;\n this.#remoting.send({\n targetWin: this.#hostWindow!,\n targetOrigin: this.#hostOrigin!,\n messageType: MessageType.GuestClose,\n messageBody: {},\n });\n this.#remoting.removeSender({\n origin: this.#hostOrigin!,\n window: this.#hostWindow!,\n });\n this.#remoting.close();\n this.#isConnected = false;\n this.#logger.audit({\n message: 'Guest disconnected from host',\n ...this.#getGuestInfo(),\n });\n this.#id = null;\n this.#url = null;\n this.#title = null;\n };\n\n /**\n * Connect to the host\n *\n * @param {ConnectParam} param - reference to the guest window or options\n */\n connect = async (param?: ConnectParam) => {\n if (!this.#isConnected) {\n let guestWindow: Window = window;\n let guestOptions = { ...capabilities };\n\n if (param) {\n // Pull the guestWindow from the options, if present\n guestWindow = param.window || guestWindow;\n // Clone the guest options and delete the window reference\n const clonedOptions = { ...param };\n delete (clonedOptions as Partial<ConnectParam>).window;\n // Merge into the guest options object\n guestOptions = Object.assign(guestOptions, clonedOptions);\n }\n\n const hostDetails = await getHostDetails();\n this.#hostOrigin = hostDetails.origin;\n this.#hostWindow = hostDetails.window;\n // Initialize messenger\n this.#remoting.initialize(guestWindow);\n this.#remoting.addSender({\n origin: this.#hostOrigin,\n window: this.#hostWindow,\n });\n // Listen for the events the guest knows how to process\n this.#remoting.listen<RemotingEventMessage>({\n messageType: MessageType.ObjectEvent,\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n callback: this.#handleObjectEvent.bind(this),\n });\n this.#remoting.listen<Config>({\n messageType: MessageType.HostConfig,\n callback: this.#handleConfigChangeEvent.bind(this),\n });\n this.#remoting.listen<void>({\n messageType: MessageType.GuestFocus,\n callback: this.#handleFocusEvent.bind(this),\n });\n // Let the host know the guest is ready for events, and send along\n // the guests's capabilities to allow for compatibility with future\n // host versions\n this.#remoting.send({\n targetWin: this.#hostWindow,\n targetOrigin: this.#hostOrigin,\n messageType: MessageType.GuestReady,\n messageBody: guestOptions,\n });\n this.#isConnected = true;\n this.#logger.audit({\n message: 'Guest connected to host',\n guestUrl: window.location.href,\n });\n }\n };\n\n /**\n * Get scripting object proxy by id\n *\n * @param objectId unique id of the scripting object\n * @returns scripting object proxy\n */\n getObject = async (objectId: string) => {\n this.#logger.debug(\n `Retrieving scripting object \"${objectId}\" from host...`,\n );\n const response = await this.#remoting.invoke<ObjectResponse>({\n targetWin: this.#hostWindow!,\n targetOrigin: this.#hostOrigin!,\n messageType: MessageType.ObjectGet,\n messageBody: {\n objectId,\n },\n });\n const obj = this.#fromJSON(response.object);\n this.#logger.audit({\n message: 'Received scripting object from host',\n scriptingObject: objectId,\n ...this.#getGuestInfo(),\n });\n return obj;\n };\n\n /**\n * remove the guest from the host\n */\n removeScript = () => {\n if (!this.#created) return;\n if (this.#scriptElement) {\n const { parentNode } = this.#scriptElement;\n parentNode?.removeChild?.(this.#scriptElement);\n }\n };\n\n /**\n * Set the log level\n *\n * @param {LogLevels} logLevel - log level\n * @param level\n */\n setLogLevel = (level: LogLevels) => {\n this.#logger.setLogLevel(level);\n this.#logger.debug(`Log level changed by guest to ${level}`);\n };\n\n /**\n * subscribe to an scripting object event\n *\n * @param {GuestSubscribeParam<EventId, AppEvents[EventId]>} param - parameters for subscribing to an event\n * @returns subscription token\n */\n subscribe = <EventId extends Extract<keyof AppEvents, string>>(\n param: GuestSubscribeParam<EventId, AppEvents[EventId]>,\n ) => {\n const { eventId, callback } = param;\n this.#logger.debug(`Registering subscription for event ${eventId}`);\n const listeners = this.#eventListeners.get(eventId) || [];\n const token = uuidv4();\n listeners.push({ callback, token });\n this.#eventListeners.set(eventId, listeners);\n return token;\n };\n\n /**\n * unsubscribe from an scripting object event\n *\n * @param {GuestUnsubscribeParam<EventId>} param - parameters for unsubscribing from an event\n */\n unsubscribe = <EventId extends Extract<keyof AppEvents, string>>(\n param: GuestUnsubscribeParam<EventId>,\n ) => {\n const { eventId, token } = param;\n let listeners = this.#eventListeners.get(eventId);\n if (listeners) {\n listeners = listeners.filter(\n (callbackInfo) => callbackInfo.token !== token,\n );\n this.#eventListeners.set(eventId, listeners);\n }\n };\n}\n"],"names":["root","factory","__WEBPACK_EXTERNAL_MODULE__270__","module","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","exports","definition","key","obj","prop","getRandomValues","rnds8","rng","byteToHex","i","unsafeStringify","arr","offset","stringify","uuid","v4","options","buf","rnds","__defProp","__defNormalProp","value","__publicField","__accessCheck","member","msg","__privateGet","getter","__privateAdd","__privateSet","setter","_correlationId","_logger","_listeners","_invocations","_timeoutMonitorHandle","_allowedSenders","_evaluateTimeouts","_startResponseMonitor","_stopResponseMonitor","_popInvocation","_processResponse","_processException","_receive","_processMessage","MESSAGE_SOURCE","RESPONSE_MESSAGE_TYPE","EXCEPTION_MESSAGE_TYPE","createMessage","messageType","messageBody","onewayMsg","sendMessage","param","targetWin","targetOrigin","Remoting","logger","correlationId","ts","canceledItems","eventData","requestId","cancelTime","e","message","sourceWin","sourceOrigin","callbacks","callback","senderOrigin","origin","window2","win","responseTimeoutMs","resolve","reject","items","response","ex","MessageType","MessageType2","Event","name","requiresFeedback","so","isEvent","getEventId","objectId","eventName","Proxy","objectType","ProxyEvent","getOrigin","url","isEmbedded","getComputedStyle","el","bodyElement","retVal","propValue","originsRegex","getHostDetails","event","source","type","window","ResponseType","capabilities","onLoad","document","iframeBody","iframeHTML","size","DIAGNOSTICS_URL","SSFGuest","soJSON","ctrl","functionName","args","functionParams","promises","p","val","body","object","eventId","listeners","callbackInfo","values","scriptUri","containerElement","scriptEle","onScriptLoad","guestWindow","guestOptions","clonedOptions","hostDetails","parentNode","level","token","logToConsole","index","team","appName","transport"],"sourceRoot":""}
@@ -0,0 +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>Loan Validation</title><style>body{margin:0}</style><script src="https://qa.assets.rd.elliemae.io/pui-diagnostics@3"></script><script defer="defer" src="index.js"></script></head><body class="px-2"><script src="./loanValidation.js" type="module"></script></body></html>
@@ -0,0 +1,3 @@
1
+ import{getGuest as n}from"./util.js";import{getLoanObject as o}from"./businessObjects.js";window.addEventListener("DOMContentLoaded",async()=>{const e=n("loanValidationService");await e.connect();const t=await o("Loan");e.subscribe({eventId:t.onPreSave.id,callback:({eventParams:{creditScore:a}})=>a>=800})});
2
+
3
+ //# sourceMappingURL=loanValidation.js.map
@@ -0,0 +1 @@
1
+ `�,��b�w-�J��-��fB��Re$�:�o����3�7AF�`�8�)�E�����X޲.�bwo��,`��B���&�Ϳ�U�f�x����i�ZV��IA���{�%ˈ�و�t��]H�O�*��'��i�Pf�'�Z���~0�#�f��µ�S4�e��0Z���.ASǗ�Fg����+~�:����եgGAgݪ"�ɑ���sX��:.� �����5���,����
Binary file
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["webpack://ice/loanValidation.js"],"sourcesContent":["import { getGuest } from './util.js';\nimport { getLoanObject } from './businessObjects.js';\n\nwindow.addEventListener('DOMContentLoaded', async () => {\n // elli.script.setLogLevel(0);\n const ssfGuest = getGuest('loanValidationService');\n await ssfGuest.connect();\n const loanObj = await getLoanObject('Loan');\n ssfGuest.subscribe({\n eventId: loanObj.onPreSave.id,\n callback: ({ eventParams: { creditScore }}) => creditScore >= 800,\n });\n});\n"],"mappings":"AAAA,OAAS,YAAAA,MAAgB,YACzB,OAAS,iBAAAC,MAAqB,uBAE9B,OAAO,iBAAiB,mBAAoB,SAAY,CAEtD,MAAMC,EAAWF,EAAS,uBAAuB,EACjD,MAAME,EAAS,QAAQ,EACvB,MAAMC,EAAU,MAAMF,EAAc,MAAM,EAC1CC,EAAS,UAAU,CACjB,QAASC,EAAQ,UAAU,GAC3B,SAAU,CAAC,CAAE,YAAa,CAAE,YAAAC,CAAY,CAAC,IAAMA,GAAe,GAChE,CAAC,CACH,CAAC","names":["getGuest","getLoanObject","ssfGuest","loanObj","creditScore"],"sourceRoot":"","file":"loanValidation.js"}
@@ -0,0 +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>Pricing Service</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="index.js"></script></head><body class="px-2"><main><h3 class="text-lg font-medium leading-6 text-gray-900">Mortgage Pricing</h3><div class="mt-5 bg-orange-100 shadow sm:rounded-lg"><div class="px-4 py-5 sm:px-6"><h3 class="text-lg font-medium leading-6 text-gray-900">Average Rates</h3><p class="mt-1 max-w-2xl text-sm text-gray-500">for $<span id="loanAmount"></span>; Term: <span id="term"></span> years; Down Payment: $<span id="downPayment"></span></p></div><div class="border-t border-gray-200"><dl><div class="bg-gray-50 px-4 py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6"><dt class="text-sm font-medium text-gray-500">30-yr fixed</dt><dd id="30yearRate" class="mt-1 text-sm text-gray-900 sm:col-span-2 sm:mt-0">7.01%</dd></div><div class="bg-gray-50 px-4 py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6"><dt class="text-sm font-medium text-gray-500">15-yr fixed</dt><dd id="15yearRate" class="mt-1 text-sm text-gray-900 sm:col-span-2 sm:mt-0">5.61%</dd></div><div class="bg-gray-50 px-4 py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6"><dt class="text-sm font-medium text-gray-500">10/6 ARM</dt><dd id="106ARMRate" class="mt-1 text-sm text-gray-900 sm:col-span-2 sm:mt-0">6.42%</dd></div></dl></div></div></main><script src="./pricingService.js" type="module"></script></body></html>
@@ -0,0 +1,3 @@
1
+ import{getLoanObject as i}from"./businessObjects.js";import{getGuest as s}from"./util.js";const a=document.getElementById("loanAmount"),o=document.getElementById("term"),m=document.getElementById("downPayment");window.addEventListener("DOMContentLoaded",async()=>{const n=s("pricingService");await n.connect();const t=await i("Loan"),{amount:r,term:c,downPayment:d}=await t.getLoanDetails();a.innerText=Intl.NumberFormat().format(r),o.innerText=c,m.innerText=Intl.NumberFormat().format(d),n.subscribe({eventId:t.onLoanAmountChanged.id,callback:({eventParams:{amount:e}})=>{a.innerText=e}}),n.subscribe({eventId:t.onLoanTermChanged.id,callback:({eventParams:{term:e}})=>{o.innerText=e}}),n.subscribe({eventId:t.onDownPaymentChanged.id,callback:({eventParams:{downPayment:e}})=>{m.innerText=e}})});
2
+
3
+ //# sourceMappingURL=pricingService.js.map
Binary file
Binary file
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["webpack://ice/pricingService.js"],"sourcesContent":["import { getLoanObject } from './businessObjects.js';\nimport { getGuest } from './util.js';\n\nconst loanAmountElement = document.getElementById('loanAmount');\nconst termElement = document.getElementById('term');\nconst downPaymentElement = document.getElementById('downPayment');\n\nwindow.addEventListener('DOMContentLoaded', async () => {\n const ssfGuest = getGuest('pricingService');\n await ssfGuest.connect();\n const loanObj = await getLoanObject('Loan');\n const { amount, term, downPayment } = await loanObj.getLoanDetails();\n loanAmountElement.innerText = Intl.NumberFormat().format(amount);\n termElement.innerText = term;\n downPaymentElement.innerText = Intl.NumberFormat().format(downPayment);\n ssfGuest.subscribe({\n eventId: loanObj.onLoanAmountChanged.id,\n callback: ({ eventParams: { amount } }) => {\n loanAmountElement.innerText = amount;\n },\n });\n ssfGuest.subscribe({\n eventId: loanObj.onLoanTermChanged.id,\n callback: ({ eventParams: { term }}) => {\n termElement.innerText = term;\n },\n });\n ssfGuest.subscribe({\n eventId: loanObj.onDownPaymentChanged.id,\n callback: ({ eventParams: { downPayment }}) => {\n downPaymentElement.innerText = downPayment;\n },\n });\n});\n"],"mappings":"AAAA,OAAS,iBAAAA,MAAqB,uBAC9B,OAAS,YAAAC,MAAgB,YAEzB,MAAMC,EAAoB,SAAS,eAAe,YAAY,EACxDC,EAAc,SAAS,eAAe,MAAM,EAC5CC,EAAqB,SAAS,eAAe,aAAa,EAEhE,OAAO,iBAAiB,mBAAoB,SAAY,CACtD,MAAMC,EAAWJ,EAAS,gBAAgB,EAC1C,MAAMI,EAAS,QAAQ,EACvB,MAAMC,EAAU,MAAMN,EAAc,MAAM,EACpC,CAAE,OAAAO,EAAQ,KAAAC,EAAM,YAAAC,CAAY,EAAI,MAAMH,EAAQ,eAAe,EACnEJ,EAAkB,UAAY,KAAK,aAAa,EAAE,OAAOK,CAAM,EAC/DJ,EAAY,UAAYK,EACxBJ,EAAmB,UAAY,KAAK,aAAa,EAAE,OAAOK,CAAW,EACrEJ,EAAS,UAAU,CACjB,QAASC,EAAQ,oBAAoB,GACrC,SAAU,CAAC,CAAE,YAAa,CAAE,OAAAC,CAAO,CAAE,IAAM,CACzCL,EAAkB,UAAYK,CAChC,CACF,CAAC,EACDF,EAAS,UAAU,CACjB,QAASC,EAAQ,kBAAkB,GACnC,SAAU,CAAC,CAAE,YAAa,CAAE,KAAAE,CAAK,CAAC,IAAM,CACtCL,EAAY,UAAYK,CAC1B,CACF,CAAC,EACDH,EAAS,UAAU,CACjB,QAASC,EAAQ,qBAAqB,GACtC,SAAU,CAAC,CAAE,YAAa,CAAE,YAAAG,CAAY,CAAC,IAAM,CAC7CL,EAAmB,UAAYK,CACjC,CACF,CAAC,CACH,CAAC","names":["getLoanObject","getGuest","loanAmountElement","termElement","downPaymentElement","ssfGuest","loanObj","amount","term","downPayment"],"sourceRoot":"","file":"pricingService.js"}
@@ -0,0 +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>Title Service</title><style>body{margin:0}</style><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="index.js"></script></head><body class="px-2"><h3 class="text-lg font-medium leading-6 text-gray-900">Title</h3><div class="mt-5 flex flex-col"><button id="order" 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">Order</button></div><script src="./titleService.js" type="module"></script></body></html>
@@ -0,0 +1,3 @@
1
+ import{getGuest as e}from"./util.js";import{getLoanObject as n}from"./businessObjects.js";window.addEventListener("DOMContentLoaded",async()=>{await e("titleService").connect();const t=await n("Loan");document.getElementById("order").addEventListener("click",async()=>{await t.setServiceOrderStatus("title",!0),window.close()})});
2
+
3
+ //# sourceMappingURL=titleService.js.map
@@ -0,0 +1,2 @@
1
+ s duN�m'�$p<r{���V�����7� �$�؄B�������2
2
+ ���
Binary file
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["webpack://ice/titleService.js"],"sourcesContent":["import { getGuest } from './util.js';\nimport { getLoanObject } from './businessObjects.js';\n\nwindow.addEventListener('DOMContentLoaded', async () => {\n // elli.script.setLogLevel(0);\n const ssfGuest = getGuest('titleService');\n await ssfGuest.connect();\n const loanObj = await getLoanObject('Loan');\n document.getElementById('order').addEventListener('click', async () => {\n await loanObj.setServiceOrderStatus('title', true);\n window.close();\n });\n});\n"],"mappings":"AAAA,OAAS,YAAAA,MAAgB,YACzB,OAAS,iBAAAC,MAAqB,uBAE9B,OAAO,iBAAiB,mBAAoB,SAAY,CAGtD,MADiBD,EAAS,cAAc,EACzB,QAAQ,EACvB,MAAME,EAAU,MAAMD,EAAc,MAAM,EAC1C,SAAS,eAAe,OAAO,EAAE,iBAAiB,QAAS,SAAY,CACrE,MAAMC,EAAQ,sBAAsB,QAAS,EAAI,EACjD,OAAO,MAAM,CACf,CAAC,CACH,CAAC","names":["getGuest","getLoanObject","loanObj"],"sourceRoot":"","file":"titleService.js"}