@ibm-aspera/sdk 0.2.6 → 0.2.7

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 (46) hide show
  1. package/.eslintrc.js +3 -0
  2. package/.github/workflows/documentation.yml +1 -1
  3. package/CHANGELOG.md +13 -0
  4. package/README.md +3 -0
  5. package/dist/commonjs/helpers/client/safari-client.d.ts +4 -2
  6. package/dist/commonjs/helpers/client/safari-client.js +22 -10
  7. package/dist/commonjs/index.d.ts +2 -2
  8. package/dist/commonjs/index.js +2 -1
  9. package/dist/commonjs/models/aspera-sdk.model.d.ts +16 -1
  10. package/dist/commonjs/models/aspera-sdk.model.js +32 -2
  11. package/dist/js/aspera-sdk.js +1 -1
  12. package/dist/js/aspera-sdk.js.LICENSE.txt +2 -2
  13. package/dist/js/aspera-sdk.js.map +1 -1
  14. package/example/README.md +7 -0
  15. package/example/index.html +14 -0
  16. package/example/package-lock.json +2847 -0
  17. package/example/package.json +29 -0
  18. package/example/public/404.html +5 -0
  19. package/example/public/sdk-code.js +334 -0
  20. package/example/src/App/App.scss +40 -0
  21. package/example/src/App/index.tsx +174 -0
  22. package/example/src/Views/AllTogether.tsx +26 -0
  23. package/example/src/Views/DragDrop.tsx +23 -0
  24. package/example/src/Views/Home.tsx +10 -0
  25. package/example/src/Views/Initialize.tsx +21 -0
  26. package/example/src/Views/Installer.tsx +119 -0
  27. package/example/src/Views/MonitorTransfers.tsx +88 -0
  28. package/example/src/Views/Other.tsx +25 -0
  29. package/example/src/Views/SelectItems.tsx +46 -0
  30. package/example/src/Views/StartTransfer.tsx +32 -0
  31. package/example/src/Views/Test.tsx +20 -0
  32. package/example/src/Views/Views.scss +111 -0
  33. package/example/src/helpers/index.ts +19 -0
  34. package/example/src/index.scss +47 -0
  35. package/example/src/main.tsx +17 -0
  36. package/example/src/vite-env.d.ts +2 -0
  37. package/example/tsconfig.json +30 -0
  38. package/example/vite.config.ts +22 -0
  39. package/package.json +4 -3
  40. package/src/helpers/client/safari-client.ts +26 -10
  41. package/src/index.ts +1 -0
  42. package/src/models/aspera-sdk.model.ts +37 -2
  43. package/tsconfig.json +4 -1
  44. package/tsconfig.module.json +1 -0
  45. package/webpack.config.js +1 -19
  46. package/src/index.html +0 -404
package/.eslintrc.js CHANGED
@@ -10,6 +10,9 @@ module.exports = {
10
10
  "plugins": [
11
11
  "@typescript-eslint",
12
12
  ],
13
+ "ignorePatterns": [
14
+ "example"
15
+ ],
13
16
  "rules": {
14
17
  "@typescript-eslint/consistent-type-definitions": "error",
15
18
  "@typescript-eslint/dot-notation": "off",
@@ -36,7 +36,7 @@ jobs:
36
36
  - name: Upload Artifact
37
37
  uses: actions/upload-pages-artifact@v3
38
38
  with:
39
- path: dist/js
39
+ path: dist
40
40
 
41
41
  - name: Deploy to GitHub Pages
42
42
  id: deployment
package/CHANGELOG.md CHANGED
@@ -2,6 +2,19 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [0.2.7](https://github.com/IBM/aspera-sdk-js/compare/v0.2.6...v0.2.7) (2025-04-11)
6
+
7
+
8
+ ### Features
9
+
10
+ * **#54:** handle isAlive safari extension events ([#57](https://github.com/IBM/aspera-sdk-js/issues/57)) ([266a649](https://github.com/IBM/aspera-sdk-js/commit/266a649643ee4d07f4546054807d901c3edbe444)), closes [#54](https://github.com/IBM/aspera-sdk-js/issues/54)
11
+ * example app ([#58](https://github.com/IBM/aspera-sdk-js/issues/58)) ([a29728f](https://github.com/IBM/aspera-sdk-js/commit/a29728f357b374cafa0667e87e92f8bea804bdfe))
12
+
13
+
14
+ ### Bug Fixes
15
+
16
+ * add base to build ([9c1e1ea](https://github.com/IBM/aspera-sdk-js/commit/9c1e1ea20e5b22669eb742cd35aa33ee4b797d96))
17
+
5
18
  ### [0.2.6](https://github.com/IBM/aspera-sdk-js/compare/v0.2.5...v0.2.6) (2024-11-27)
6
19
 
7
20
 
package/README.md CHANGED
@@ -23,3 +23,6 @@ or copied to a web server for hosting.
23
23
 
24
24
  ## Development
25
25
  To get started with development, take a look [here](https://github.com/IBM/aspera-sdk-js/blob/main/docs/DEVELOPMENT.md).
26
+
27
+ ## Code Example and test application
28
+ You can run the test appp by running `npm run start:example` which will launch the browser to the test app.
@@ -10,10 +10,8 @@ export interface PromiseExecutor {
10
10
  * Handles communication with the Safari extension using JSON-RPC over custom events.
11
11
  */
12
12
  export declare class SafariClient implements Client {
13
- private statusInterval;
14
13
  private keepAliveInterval;
15
14
  private promiseExecutors;
16
- private isFirstPing;
17
15
  private lastPing;
18
16
  private lastPong;
19
17
  private safariExtensionEnabled;
@@ -73,6 +71,10 @@ export declare class SafariClient implements Client {
73
71
  * Listens for 'AsperaDesktop.Status' events.
74
72
  */
75
73
  private listenStatusEvents;
74
+ /**
75
+ * Listens for 'isAppAlive' events. This was introduced in version 1.0.9.
76
+ */
77
+ private listenClientStatusEvents;
76
78
  /**
77
79
  * Listens for 'AsperaDesktop.Pong' events.
78
80
  */
@@ -26,9 +26,7 @@ var SafariClient = /** @class */ (function () {
26
26
  */
27
27
  function SafariClient() {
28
28
  var _this = this;
29
- this.statusInterval = 100;
30
29
  this.keepAliveInterval = 1000;
31
- this.isFirstPing = true;
32
30
  this.lastPing = null;
33
31
  this.lastPong = null;
34
32
  this.safariExtensionEnabled = false;
@@ -47,6 +45,7 @@ var SafariClient = /** @class */ (function () {
47
45
  this.listenResponseEvents();
48
46
  this.listenTransferActivityEvents();
49
47
  this.listenStatusEvents();
48
+ this.listenClientStatusEvents();
50
49
  this.listenPongEvents();
51
50
  if (keepAliveTimeout) {
52
51
  clearTimeout(keepAliveTimeout);
@@ -152,6 +151,9 @@ var SafariClient = /** @class */ (function () {
152
151
  SafariClient.prototype.listenResponseEvents = function () {
153
152
  var _this = this;
154
153
  document.addEventListener('AsperaDesktop.Response', function (event) {
154
+ if (!event.detail) {
155
+ return;
156
+ }
155
157
  _this.handleResponse(event.detail);
156
158
  });
157
159
  };
@@ -160,6 +162,9 @@ var SafariClient = /** @class */ (function () {
160
162
  */
161
163
  SafariClient.prototype.listenTransferActivityEvents = function () {
162
164
  document.addEventListener('AsperaDesktop.TransferActivity', function (event) {
165
+ if (!event.detail) {
166
+ return;
167
+ }
163
168
  index_1.asperaSdk.activityTracking.handleTransferActivity(event.detail);
164
169
  });
165
170
  };
@@ -168,9 +173,24 @@ var SafariClient = /** @class */ (function () {
168
173
  */
169
174
  SafariClient.prototype.listenStatusEvents = function () {
170
175
  document.addEventListener('AsperaDesktop.Status', function (event) {
176
+ if (!event.detail) {
177
+ return;
178
+ }
171
179
  index_1.asperaSdk.activityTracking.handleWebSocketEvents(event.detail);
172
180
  });
173
181
  };
182
+ /**
183
+ * Listens for 'isAppAlive' events. This was introduced in version 1.0.9.
184
+ */
185
+ SafariClient.prototype.listenClientStatusEvents = function () {
186
+ document.addEventListener('isAppAlive', function (event) {
187
+ var _a;
188
+ if (!((_a = event.detail) === null || _a === void 0 ? void 0 : _a.running)) {
189
+ return;
190
+ }
191
+ index_1.asperaSdk.activityTracking.handleClientEvents(event.detail.running);
192
+ });
193
+ };
174
194
  /**
175
195
  * Listens for 'AsperaDesktop.Pong' events.
176
196
  */
@@ -188,14 +208,6 @@ var SafariClient = /** @class */ (function () {
188
208
  var _this = this;
189
209
  this.lastPing = Date.now();
190
210
  this.dispatchEvent(SafariExtensionEventType.Ping);
191
- if (this.isFirstPing) {
192
- this.isFirstPing = false;
193
- }
194
- else {
195
- setTimeout(function () {
196
- _this.checkSafariExtensionStatus();
197
- }, this.statusInterval);
198
- }
199
211
  keepAliveTimeout = setTimeout(function () {
200
212
  _this.keepAlive();
201
213
  }, this.keepAliveInterval);
@@ -1,8 +1,8 @@
1
1
  import { AsperaSdk } from './models/aspera-sdk.model';
2
- import { createDropzone, deregisterActivityCallback, deregisterRemovedCallback, deregisterSafariExtensionStatusCallback, deregisterStatusCallback, getAllTransfers, getInfo, getTransfer, init, modifyTransfer, registerActivityCallback, registerRemovedCallback, registerSafariExtensionStatusCallback, registerStatusCallback, removeDropzone, removeTransfer, resumeTransfer, setBranding, showDirectory, showPreferences, showSelectFileDialog, showSelectFolderDialog, startTransfer, stopTransfer, testConnection } from './app/core';
2
+ import { createDropzone, deregisterActivityCallback, deregisterRemovedCallback, deregisterSafariExtensionStatusCallback, deregisterStatusCallback, getAllTransfers, getInfo, getTransfer, init, initDragDrop, modifyTransfer, registerActivityCallback, registerRemovedCallback, registerSafariExtensionStatusCallback, registerStatusCallback, removeDropzone, removeTransfer, resumeTransfer, setBranding, showDirectory, showPreferences, showSelectFileDialog, showSelectFolderDialog, startTransfer, stopTransfer, testConnection } from './app/core';
3
3
  import { getInstallerInfo } from './app/installer';
4
4
  import { getInstallerUrls, isSafari } from './helpers/helpers';
5
5
  export declare const asperaSdk: AsperaSdk;
6
6
  declare const launch: () => void;
7
- export { isSafari, init, testConnection, startTransfer, launch, registerActivityCallback, deregisterActivityCallback, removeTransfer, showDirectory, stopTransfer, resumeTransfer, getAllTransfers, getTransfer, registerRemovedCallback, deregisterRemovedCallback, showSelectFileDialog, showSelectFolderDialog, showPreferences, modifyTransfer, createDropzone, removeDropzone, getInstallerInfo, registerStatusCallback, deregisterStatusCallback, registerSafariExtensionStatusCallback, deregisterSafariExtensionStatusCallback, setBranding, getInfo, getInstallerUrls, };
7
+ export { isSafari, init, testConnection, startTransfer, launch, registerActivityCallback, deregisterActivityCallback, removeTransfer, showDirectory, stopTransfer, resumeTransfer, getAllTransfers, getTransfer, registerRemovedCallback, deregisterRemovedCallback, showSelectFileDialog, showSelectFolderDialog, showPreferences, modifyTransfer, createDropzone, removeDropzone, initDragDrop, getInstallerInfo, registerStatusCallback, deregisterStatusCallback, registerSafariExtensionStatusCallback, deregisterSafariExtensionStatusCallback, setBranding, getInfo, getInstallerUrls, };
8
8
  export default asperaSdk;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getInstallerUrls = exports.getInfo = exports.setBranding = exports.deregisterSafariExtensionStatusCallback = exports.registerSafariExtensionStatusCallback = exports.deregisterStatusCallback = exports.registerStatusCallback = exports.getInstallerInfo = exports.removeDropzone = exports.createDropzone = exports.modifyTransfer = exports.showPreferences = exports.showSelectFolderDialog = exports.showSelectFileDialog = exports.deregisterRemovedCallback = exports.registerRemovedCallback = exports.getTransfer = exports.getAllTransfers = exports.resumeTransfer = exports.stopTransfer = exports.showDirectory = exports.removeTransfer = exports.deregisterActivityCallback = exports.registerActivityCallback = exports.launch = exports.startTransfer = exports.testConnection = exports.init = exports.isSafari = exports.asperaSdk = void 0;
3
+ exports.getInstallerUrls = exports.getInfo = exports.setBranding = exports.deregisterSafariExtensionStatusCallback = exports.registerSafariExtensionStatusCallback = exports.deregisterStatusCallback = exports.registerStatusCallback = exports.getInstallerInfo = exports.initDragDrop = exports.removeDropzone = exports.createDropzone = exports.modifyTransfer = exports.showPreferences = exports.showSelectFolderDialog = exports.showSelectFileDialog = exports.deregisterRemovedCallback = exports.registerRemovedCallback = exports.getTransfer = exports.getAllTransfers = exports.resumeTransfer = exports.stopTransfer = exports.showDirectory = exports.removeTransfer = exports.deregisterActivityCallback = exports.registerActivityCallback = exports.launch = exports.startTransfer = exports.testConnection = exports.init = exports.isSafari = exports.asperaSdk = void 0;
4
4
  var aspera_sdk_model_1 = require("./models/aspera-sdk.model");
5
5
  var core_1 = require("./app/core");
6
6
  Object.defineProperty(exports, "createDropzone", { enumerable: true, get: function () { return core_1.createDropzone; } });
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "getAllTransfers", { enumerable: true, get: funct
12
12
  Object.defineProperty(exports, "getInfo", { enumerable: true, get: function () { return core_1.getInfo; } });
13
13
  Object.defineProperty(exports, "getTransfer", { enumerable: true, get: function () { return core_1.getTransfer; } });
14
14
  Object.defineProperty(exports, "init", { enumerable: true, get: function () { return core_1.init; } });
15
+ Object.defineProperty(exports, "initDragDrop", { enumerable: true, get: function () { return core_1.initDragDrop; } });
15
16
  Object.defineProperty(exports, "modifyTransfer", { enumerable: true, get: function () { return core_1.modifyTransfer; } });
16
17
  Object.defineProperty(exports, "registerActivityCallback", { enumerable: true, get: function () { return core_1.registerActivityCallback; } });
17
18
  Object.defineProperty(exports, "registerRemovedCallback", { enumerable: true, get: function () { return core_1.registerRemovedCallback; } });
@@ -53,6 +53,8 @@ export declare class ActivityTracking {
53
53
  private safari_extension_callbacks;
54
54
  /** Keep track of the last WebSocket event **/
55
55
  private lastWebSocketEvent;
56
+ /** Keep track of the last notified WebSocket event **/
57
+ private lastNotifiedWebSocketEvent;
56
58
  /** Keep track of the last Safari extension event **/
57
59
  private lastSafariExtensionEvent;
58
60
  /**
@@ -62,12 +64,25 @@ export declare class ActivityTracking {
62
64
  */
63
65
  handleTransferActivity(message: ActivityMessage): void;
64
66
  /**
65
- * Notify all consumers when a connection webSocketEvent occurs. For example, when the SDK
67
+ * Handle and notify if needed when a connection webSocketEvent occurs. For example, when the SDK
66
68
  * websocket connection to IBM Aspera App is closed or reconnected.
67
69
  *
68
70
  * @param webSocketEvent the event type.
69
71
  */
70
72
  handleWebSocketEvents(webSocketEvent: WebsocketEvent): void;
73
+ /**
74
+ * Notify all consumers when a connection webSocketEvent occurs.
75
+ *
76
+ * @param webSocketEvent the event type.
77
+ */
78
+ private notifyWebSocketEvent;
79
+ /**
80
+ * Notify all consumers when the client changes status. For example, when
81
+ * IBM Aspera App is launched or closed.
82
+ *
83
+ * @param running whether the client is running or not.
84
+ */
85
+ handleClientEvents(running: boolean): void;
71
86
  /**
72
87
  * Notify all consumers when a Safari extension safariExtensionEvent occurs (enabled/disabled).
73
88
  *
@@ -79,6 +79,8 @@ var ActivityTracking = /** @class */ (function () {
79
79
  this.safari_extension_callbacks = new Map();
80
80
  /** Keep track of the last WebSocket event **/
81
81
  this.lastWebSocketEvent = 'CLOSED';
82
+ /** Keep track of the last notified WebSocket event **/
83
+ this.lastNotifiedWebSocketEvent = undefined;
82
84
  /** Keep track of the last Safari extension event **/
83
85
  this.lastSafariExtensionEvent = 'DISABLED';
84
86
  }
@@ -104,7 +106,7 @@ var ActivityTracking = /** @class */ (function () {
104
106
  }
105
107
  };
106
108
  /**
107
- * Notify all consumers when a connection webSocketEvent occurs. For example, when the SDK
109
+ * Handle and notify if needed when a connection webSocketEvent occurs. For example, when the SDK
108
110
  * websocket connection to IBM Aspera App is closed or reconnected.
109
111
  *
110
112
  * @param webSocketEvent the event type.
@@ -113,12 +115,40 @@ var ActivityTracking = /** @class */ (function () {
113
115
  if (this.lastWebSocketEvent === webSocketEvent) {
114
116
  return;
115
117
  }
118
+ this.lastWebSocketEvent = webSocketEvent;
119
+ this.notifyWebSocketEvent(webSocketEvent);
120
+ };
121
+ /**
122
+ * Notify all consumers when a connection webSocketEvent occurs.
123
+ *
124
+ * @param webSocketEvent the event type.
125
+ */
126
+ ActivityTracking.prototype.notifyWebSocketEvent = function (webSocketEvent) {
127
+ if (this.lastNotifiedWebSocketEvent === webSocketEvent) {
128
+ return;
129
+ }
130
+ this.lastNotifiedWebSocketEvent = webSocketEvent;
116
131
  this.event_callbacks.forEach(function (callback) {
117
132
  if (typeof callback === 'function') {
118
133
  callback(webSocketEvent);
119
134
  }
120
135
  });
121
- this.lastWebSocketEvent = webSocketEvent;
136
+ };
137
+ /**
138
+ * Notify all consumers when the client changes status. For example, when
139
+ * IBM Aspera App is launched or closed.
140
+ *
141
+ * @param running whether the client is running or not.
142
+ */
143
+ ActivityTracking.prototype.handleClientEvents = function (running) {
144
+ var webSocketEvent;
145
+ if (!running) {
146
+ webSocketEvent = 'CLOSED';
147
+ }
148
+ else {
149
+ webSocketEvent = this.lastWebSocketEvent;
150
+ }
151
+ this.notifyWebSocketEvent(webSocketEvent);
122
152
  };
123
153
  /**
124
154
  * Notify all consumers when a Safari extension safariExtensionEvent occurs (enabled/disabled).
@@ -1,3 +1,3 @@
1
1
  /*! For license information please see aspera-sdk.js.LICENSE.txt */
2
- (()=>{"use strict";var e={94:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.JSONRPCClient=void 0;var i=n(287),s=n(616),a=function(){function e(e,t){this._send=e,this.createID=t,this.idToResolveMap=new Map,this.id=0}return e.prototype._createID=function(){return this.createID?this.createID():++this.id},e.prototype.timeout=function(e,t){var n=this;void 0===t&&(t=function(e){return(0,i.createJSONRPCErrorResponse)(e,s.DefaultErrorCode,"Request timeout")});var r=function(r,o){var i=setTimeout((function(){r.forEach((function(e){var r=n.idToResolveMap.get(e);r&&(n.idToResolveMap.delete(e),r(t(e)))}))}),e);return o().then((function(e){return clearTimeout(i),e}),(function(e){return clearTimeout(i),Promise.reject(e)}))};return{request:function(e,t,o){var i=n._createID();return r([i],(function(){return n.requestWithID(e,t,o,i)}))},requestAdvanced:function(e,t){return function(e,t){var o=(Array.isArray(e)?e:[e]).map((function(e){return e.id})).filter(c);return r(o,(function(){return n.requestAdvanced(e,t)}))}(e,t)}}},e.prototype.request=function(e,t,n){return this.requestWithID(e,t,n,this._createID())},e.prototype.requestWithID=function(e,t,n,s){return r(this,void 0,void 0,(function(){var r,a;return o(this,(function(o){switch(o.label){case 0:return r=(0,i.createJSONRPCRequest)(s,e,t),[4,this.requestAdvanced(r,n)];case 1:return void 0===(a=o.sent()).result||a.error?void 0===a.result&&a.error?[2,Promise.reject(new i.JSONRPCErrorException(a.error.message,a.error.code,a.error.data))]:[2,Promise.reject(new Error("An unexpected error occurred"))]:[2,a.result]}}))}))},e.prototype.requestAdvanced=function(e,t){var n=this,r=Array.isArray(e);Array.isArray(e)||(e=[e]);var o=e.filter((function(e){return c(e.id)})),a=o.map((function(e){return new Promise((function(t){return n.idToResolveMap.set(e.id,t)}))})),u=Promise.all(a).then((function(e){return r||!e.length?e:e[0]}));return this.send(r?e:e[0],t).then((function(){return u}),(function(e){return o.forEach((function(t){n.receive((0,i.createJSONRPCErrorResponse)(t.id,s.DefaultErrorCode,e&&e.message||"Failed to send a request"))})),u}))},e.prototype.notify=function(e,t,n){var r=(0,i.createJSONRPCNotification)(e,t);this.send(r,n).then(void 0,(function(){}))},e.prototype.send=function(e,t){return r(this,void 0,void 0,(function(){return o(this,(function(n){return[2,this._send(e,t)]}))}))},e.prototype.rejectAllPendingRequests=function(e){this.idToResolveMap.forEach((function(t,n){return t((0,i.createJSONRPCErrorResponse)(n,s.DefaultErrorCode,e))})),this.idToResolveMap.clear()},e.prototype.receive=function(e){var t=this;Array.isArray(e)||(e=[e]),e.forEach((function(e){var n=t.idToResolveMap.get(e.id);n&&(t.idToResolveMap.delete(e.id),n(e))}))},e}();t.JSONRPCClient=a;var c=function(e){return null!=e}},773:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(94),t),o(n(989),t),o(n(287),t),o(n(490),t),o(n(556),t)},989:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},616:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DefaultErrorCode=void 0,t.DefaultErrorCode=0},287:function(e,t){var n,r=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.createJSONRPCNotification=t.createJSONRPCRequest=t.createJSONRPCSuccessResponse=t.createJSONRPCErrorResponse=t.JSONRPCErrorCode=t.JSONRPCErrorException=t.isJSONRPCResponses=t.isJSONRPCResponse=t.isJSONRPCRequests=t.isJSONRPCRequest=t.isJSONRPCID=t.JSONRPC=void 0,t.JSONRPC="2.0",t.isJSONRPCID=function(e){return"string"==typeof e||"number"==typeof e||null===e},t.isJSONRPCRequest=function(e){return e.jsonrpc===t.JSONRPC&&void 0!==e.method&&void 0===e.result&&void 0===e.error},t.isJSONRPCRequests=function(e){return Array.isArray(e)&&e.every(t.isJSONRPCRequest)},t.isJSONRPCResponse=function(e){return e.jsonrpc===t.JSONRPC&&void 0!==e.id&&(void 0!==e.result||void 0!==e.error)},t.isJSONRPCResponses=function(e){return Array.isArray(e)&&e.every(t.isJSONRPCResponse)};var o,i=function(e,t,n){var r={code:e,message:t};return null!=n&&(r.data=n),r},s=function(e){function t(n,r,o){var i=e.call(this,n)||this;return Object.setPrototypeOf(i,t.prototype),i.code=r,i.data=o,i}return r(t,e),t.prototype.toObject=function(){return i(this.code,this.message,this.data)},t}(Error);t.JSONRPCErrorException=s,(o=t.JSONRPCErrorCode||(t.JSONRPCErrorCode={}))[o.ParseError=-32700]="ParseError",o[o.InvalidRequest=-32600]="InvalidRequest",o[o.MethodNotFound=-32601]="MethodNotFound",o[o.InvalidParams=-32602]="InvalidParams",o[o.InternalError=-32603]="InternalError",t.createJSONRPCErrorResponse=function(e,n,r,o){return{jsonrpc:t.JSONRPC,id:e,error:i(n,r,o)}},t.createJSONRPCSuccessResponse=function(e,n){return{jsonrpc:t.JSONRPC,id:e,result:null!=n?n:null}},t.createJSONRPCRequest=function(e,n,r){return{jsonrpc:t.JSONRPC,id:e,method:n,params:r}},t.createJSONRPCNotification=function(e,n){return{jsonrpc:t.JSONRPC,method:e,params:n}}},556:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.JSONRPCServerAndClient=void 0;var i=n(287),s=function(){function e(e,t,n){var r;void 0===n&&(n={}),this.server=e,this.client=t,this.errorListener=null!==(r=n.errorListener)&&void 0!==r?r:console.warn}return e.prototype.applyServerMiddleware=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];(e=this.server).applyMiddleware.apply(e,t)},e.prototype.hasMethod=function(e){return this.server.hasMethod(e)},e.prototype.addMethod=function(e,t){this.server.addMethod(e,t)},e.prototype.addMethodAdvanced=function(e,t){this.server.addMethodAdvanced(e,t)},e.prototype.timeout=function(e){return this.client.timeout(e)},e.prototype.request=function(e,t,n){return this.client.request(e,t,n)},e.prototype.requestAdvanced=function(e,t){return this.client.requestAdvanced(e,t)},e.prototype.notify=function(e,t,n){this.client.notify(e,t,n)},e.prototype.rejectAllPendingRequests=function(e){this.client.rejectAllPendingRequests(e)},e.prototype.receiveAndSend=function(e,t,n){return r(this,void 0,void 0,(function(){var r,s;return o(this,(function(o){switch(o.label){case 0:return(0,i.isJSONRPCResponse)(e)||(0,i.isJSONRPCResponses)(e)?(this.client.receive(e),[3,4]):[3,1];case 1:return(0,i.isJSONRPCRequest)(e)||(0,i.isJSONRPCRequests)(e)?[4,this.server.receive(e,t)]:[3,3];case 2:return(r=o.sent())?[2,this.client.send(r,n)]:[3,4];case 3:return s="Received an invalid JSON-RPC message",this.errorListener(s,e),[2,Promise.reject(new Error(s))];case 4:return[2]}}))}))},e}();t.JSONRPCServerAndClient=s},490:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},s=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.JSONRPCServer=void 0;var a=n(287),c=n(616),u=function(e){return(0,a.createJSONRPCErrorResponse)((0,a.isJSONRPCID)(e.id)?e.id:null,a.JSONRPCErrorCode.InvalidRequest,"Invalid Request")},l=function(){function e(e){var t;void 0===e&&(e={}),this.mapErrorToJSONRPCErrorResponse=h,this.nameToMethodDictionary={},this.middleware=null,this.errorListener=null!==(t=e.errorListener)&&void 0!==t?t:console.warn}return e.prototype.hasMethod=function(e){return!!this.nameToMethodDictionary[e]},e.prototype.addMethod=function(e,t){this.addMethodAdvanced(e,this.toJSONRPCMethod(t))},e.prototype.toJSONRPCMethod=function(e){return function(t,n){var r=e(t.params,n);return Promise.resolve(r).then((function(e){return d(t.id,e)}))}},e.prototype.addMethodAdvanced=function(e,t){var n;this.nameToMethodDictionary=r(r({},this.nameToMethodDictionary),((n={})[e]=t,n))},e.prototype.receiveJSON=function(e,t){var n=this.tryParseRequestJSON(e);return n?this.receive(n,t):Promise.resolve((0,a.createJSONRPCErrorResponse)(null,a.JSONRPCErrorCode.ParseError,"Parse error"))},e.prototype.tryParseRequestJSON=function(e){try{return JSON.parse(e)}catch(e){return null}},e.prototype.receive=function(e,t){return Array.isArray(e)?this.receiveMultiple(e,t):this.receiveSingle(e,t)},e.prototype.receiveMultiple=function(e,t){return o(this,void 0,void 0,(function(){var n,r=this;return i(this,(function(o){switch(o.label){case 0:return[4,Promise.all(e.map((function(e){return r.receiveSingle(e,t)})))];case 1:return 1===(n=o.sent().filter(f)).length?[2,n[0]]:n.length?[2,n]:[2,null]}}))}))},e.prototype.receiveSingle=function(e,t){return o(this,void 0,void 0,(function(){var n,r;return i(this,(function(o){switch(o.label){case 0:return n=this.nameToMethodDictionary[e.method],(0,a.isJSONRPCRequest)(e)?[3,1]:[2,u(e)];case 1:return[4,this.callMethod(n,e,t)];case 2:return r=o.sent(),[2,v(e,r)]}}))}))},e.prototype.applyMiddleware=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.middleware?this.middleware=this.combineMiddlewares(s([this.middleware],e,!0)):this.middleware=this.combineMiddlewares(e)},e.prototype.combineMiddlewares=function(e){return e.length?e.reduce(this.middlewareReducer):null},e.prototype.middlewareReducer=function(e,t){return function(n,r,o){return e((function(e,r){return t(n,e,r)}),r,o)}},e.prototype.callMethod=function(e,t,n){var r=this,o=function(e){return r.errorListener('An unexpected error occurred while executing "'.concat(t.method,'" JSON-RPC method:'),e),Promise.resolve(r.mapErrorToJSONRPCErrorResponseIfNecessary(t.id,e))};try{return(this.middleware||p)((function(t,n){return e?e(t,n):void 0!==t.id?Promise.resolve((r=t.id,(0,a.createJSONRPCErrorResponse)(r,a.JSONRPCErrorCode.MethodNotFound,"Method not found"))):Promise.resolve(null);var r}),t,n).then(void 0,o)}catch(e){return o(e)}},e.prototype.mapErrorToJSONRPCErrorResponseIfNecessary=function(e,t){return void 0!==e?this.mapErrorToJSONRPCErrorResponse(e,t):null},e}();t.JSONRPCServer=l;var f=function(e){return null!==e},p=function(e,t,n){return e(t,n)},d=function(e,t){return void 0!==e?(0,a.createJSONRPCSuccessResponse)(e,t):null},h=function(e,t){var n,r,o=null!==(n=null==t?void 0:t.message)&&void 0!==n?n:"An unexpected error occurred",i=c.DefaultErrorCode;return t instanceof a.JSONRPCErrorException&&(i=t.code,r=t.data),(0,a.createJSONRPCErrorResponse)(e,i,o,r)},v=function(e,t){return t||(void 0!==e.id?(0,a.createJSONRPCErrorResponse)(e.id,a.JSONRPCErrorCode.InternalError,"Internal error"):null)}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.d({},{z7:()=>B});var r,o,i="aspera://",s="https://downloads.ibmaspera.com/downloads/desktop",a="".concat(s,"/latest/stable"),c="The provided callback is not a function",u="Unable to initialize drag-drop",l="Unable to generate IFRAME for download. Using new window",f="Unable to get latest installers",p="Unable to get all transfers",d="Unable to get transfer",h="Unable to modify transfer",v="Unable to remove transfer",y="Unable to resume transfer",b="Unable to connect to IBM Aspera for Desktop server",m="IBM Aspera SDK has not been verified. Run test or init first",g="Unable to set custom branding",S="Unable to show transfer directory",R="Unable to show select file dialog",E="Unable to show select folder dialog",P="Unable to show preferences",w="Unable to stop transfer",C="The transfer failed to initiate",k=function(){var e,t;return{promise:new Promise((function(n,r){e=n,t=r})),resolver:e,rejecter:t}},O=function(e,t){t&&t.code&&t.message&&(t={code:t.code,message:t.message,data:t.data}),"object"==typeof window&&(Array.isArray(window.asperaSdkLogs)||(window.asperaSdkLogs=[]),window.asperaSdkLogs.push({message:e,debugData:t})),console.warn("Aspera SDK: ".concat(e),t)},_=function(e,t){var n={error:!0,message:e};return t&&t.code&&t.message&&(n.debugData={code:t.code,message:t.message,data:t.data}),n},x=function(){var e;return(null===(e=window.crypto)||void 0===e?void 0:e.randomUUID)?window.crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=Number((((new Date).getTime()+16)*Math.random()).toFixed())%16;return"x"!==e&&(t=3&t|8),t.toString(16)}))},N=function(e,t){return O(e,t),new Promise((function(n,r){r(_(e,t))}))},A=function(e){try{return new URL(e),!0}catch(e){return!1}},T=function(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&!window.MSStream};!function(e){e.Monitor="Monitor",e.Ping="Ping",e.Request="Request"}(r||(r={}));var J=new(function(){function e(){var e=this;this.statusInterval=100,this.keepAliveInterval=1e3,this.isFirstPing=!0,this.lastPing=null,this.lastPong=null,this.safariExtensionEnabled=!1,this.subscribedTransferActivity=!1,this.request=function(t,n){return void 0===n&&(n={}),e.dispatchPromiseEvent(r.Request,t,n)},this.promiseExecutors=new Map,this.listenResponseEvents(),this.listenTransferActivityEvents(),this.listenStatusEvents(),this.listenPongEvents(),o&&clearTimeout(o),this.keepAlive()}return e.prototype.monitorTransferActivity=function(){var e=this,t=function(){return e.dispatchPromiseEvent(r.Monitor,"subscribe_transfer_activity",[B.globals.appId]).then((function(){e.subscribedTransferActivity=!0}))};return this.safariExtensionEnabled?t():new Promise((function(n,r){var o=setInterval((function(){e.safariExtensionEnabled&&(t().then(n).catch(r),clearInterval(o))}),1e3)}))},e.prototype.buildRPCRequest=function(e,t){return{jsonrpc:"2.0",method:e,params:t,id:x()}},e.prototype.dispatchEvent=function(e,t){var n={detail:null!=t?t:{}};document.dispatchEvent(new CustomEvent("AsperaDesktop.".concat(e),n))},e.prototype.dispatchPromiseEvent=function(e,t,n){var r=this,o=this.buildRPCRequest(t,n);return new Promise((function(t,n){r.safariExtensionEnabled?(r.promiseExecutors.set(o.id,{resolve:t,reject:n}),r.dispatchEvent(e,o)):(console.warn("The Safari extension is disabled or unresponsive (dispatch event)"),console.warn("Failed event: ".concat(JSON.stringify(o))),n("The Safari extension is disabled or unresponsive (dispatch event)"))}))},e.prototype.handleResponse=function(e){var t=e.id,n=this.promiseExecutors.get(t);if(!n)return console.warn("Unable to find a promise executor for ".concat(t)),void console.warn("Response: ".concat(e));this.promiseExecutors.delete(t),e.error?n.reject(e.error):n.resolve(e.result)},e.prototype.listenResponseEvents=function(){var e=this;document.addEventListener("AsperaDesktop.Response",(function(t){e.handleResponse(t.detail)}))},e.prototype.listenTransferActivityEvents=function(){document.addEventListener("AsperaDesktop.TransferActivity",(function(e){B.activityTracking.handleTransferActivity(e.detail)}))},e.prototype.listenStatusEvents=function(){document.addEventListener("AsperaDesktop.Status",(function(e){B.activityTracking.handleWebSocketEvents(e.detail)}))},e.prototype.listenPongEvents=function(){var e=this;document.addEventListener("AsperaDesktop.Pong",(function(){e.lastPong=Date.now(),e.safariExtensionStatusChanged(!0)}))},e.prototype.keepAlive=function(){var e=this;this.lastPing=Date.now(),this.dispatchEvent(r.Ping),this.isFirstPing?this.isFirstPing=!1:setTimeout((function(){e.checkSafariExtensionStatus()}),this.statusInterval),o=setTimeout((function(){e.keepAlive()}),this.keepAliveInterval)},e.prototype.safariExtensionStatusChanged=function(e){var t=this;if(e!==this.safariExtensionEnabled){if(this.safariExtensionEnabled=e,e){if(this.subscribedTransferActivity){var n=function(){t.monitorTransferActivity().catch((function(){console.error("Failed to resume transfer activity, will try again in 1s"),setTimeout((function(){n()}),1e3)}))};n()}}else B.activityTracking.handleWebSocketEvents("CLOSED"),this.promiseExecutors.forEach((function(e){e.reject("The Safari extension is disabled or unresponsive (extension status)")})),this.promiseExecutors.clear();B.activityTracking.handleSafariExtensionEvents(this.safariExtensionEnabled?"ENABLED":"DISABLED")}},e.prototype.checkSafariExtensionStatus=function(){var e=this.lastPong-this.lastPing;(null==this.lastPong||e<0||e>500)&&this.safariExtensionStatusChanged(!1)},e}()),M=new(function(){function e(){var e=this;this.sockets=new Map,this.isConnected=!1,this.initPromise=k(),this.handleOpen=function(){!e.isConnected&&e.joinChannel()&&(e.isConnected=!0,e.updateRpcPort(),e.notifyEvent("RECONNECT"))},this.handleClose=function(){e.isConnected&&(e.isConnected=!1,e.notifyEvent("CLOSED")),e.globalSocket?e.reconnect():e.handleNotReady()},this.handleError=function(){O("The websocket was closed due to an error")},this.handleMessage=function(t){var n;try{n=JSON.parse(t.data)}catch(e){O("Unable to parse Websocket message",{error:e,message:t})}if(n&&1===n.id)e.initPromise.resolver(n);else{var r=e.sockets.get(n.method);r&&n.params&&r(n.params)}}}return e.prototype.handleNotReady=function(){O("The websocket is not ready. Run init first")},e.prototype.joinChannel=function(){return this.globalSocket?(this.globalSocket.send(JSON.stringify({jsonrpc:"2.0",method:"subscribe_transfer_activity",params:[B.globals.appId],id:1})),!0):(this.handleNotReady(),!1)},e.prototype.registerMessage=function(e,t){this.sockets.get(e)||this.sockets.set(e,(function(e){t(e.result)}))},e.prototype.registerEvent=function(e){this.eventListener=e,this.eventListener(this.isConnected?"RECONNECT":"CLOSED")},e.prototype.init=function(){return this.connect(),this.initPromise.promise},e.prototype.connect=function(){var e=this;this.getWebSocketConnection(33024,B.globals.supportMultipleUsers?33029:33024).then((function(t){e.globalSocket=t,e.globalSocket.onerror=e.handleError,e.globalSocket.onclose=e.handleClose,e.globalSocket.onopen=e.handleOpen,e.globalSocket.onmessage=e.handleMessage,e.handleOpen()})).catch((function(){e.reconnect()}))},e.prototype.reconnect=function(){var e=this;this.globalSocket&&this.globalSocket.close(),setTimeout((function(){e.connect()}),1e3)},e.prototype.getWebSocketConnection=function(e,t){var n=function(e){var t;0===e.indexOf("http:")?t="ws":0===e.indexOf("https:")&&(t="wss");var n=e.replace("http://","//").replace("https://","//");return"".concat(t,":").concat(n)}(B.globals.asperaAppUrl);return new Promise((function(r,o){var i=function(e){if(e>t)return o("No available WebSocket connection found");(function(e){return new Promise((function(t,r){var o=new WebSocket("".concat(n,":").concat(e));o.onopen=function(){t(o)},o.onerror=function(){r("Connection failed on port ".concat(e))}}))})(e).then((function(e){return r(e)})).catch((function(t){i(e+1)}))};i(e)}))},e.prototype.notifyEvent=function(e){"function"==typeof this.eventListener&&this.eventListener(e)},e.prototype.updateRpcPort=function(){if(this.globalSocket){var e=new URL(this.globalSocket.url);B.globals.rpcPort=Number(e.port)}},e}()),j=function(){function e(){this.asperaAppUrl="http://127.0.0.1",this.rpcPort=33024,this.installerUrl=a,this.asperaAppVerified=!1,this.supportMultipleUsers=!1,this.dropZonesCreated=new Map}return e.prototype.backupLaunchMethod=function(e){window.alert("Launching IBM Aspera for Desktop"),window.location.href=e},e.prototype.launch=function(){var e=this;try{var t=document.createElement("iframe");t.src=i,t.onerror=function(t){O(l,t),e.backupLaunchMethod(i)},t.setAttribute("style","\n display: none !important;\n width: 1px !important;\n height: 1px !important;\n position: fixed !important;\n z-index: -99 !important;\n bottom: 0px !important;\n right: 0px !important;\n"),document.body.appendChild(t)}catch(e){O(l,e),this.backupLaunchMethod(i)}},e}(),q=function(){function e(){this.activity_callbacks=new Map,this.removed_callbacks=new Map,this.event_callbacks=new Map,this.safari_extension_callbacks=new Map,this.lastWebSocketEvent="CLOSED",this.lastSafariExtensionEvent="DISABLED"}return e.prototype.handleTransferActivity=function(e){"transferUpdated"===e.type&&this.activity_callbacks.forEach((function(t){"function"==typeof t&&t(e.data)})),"transferRemoved"===e.type&&this.removed_callbacks.forEach((function(t){"function"==typeof t&&t(e.data)}))},e.prototype.handleWebSocketEvents=function(e){this.lastWebSocketEvent!==e&&(this.event_callbacks.forEach((function(t){"function"==typeof t&&t(e)})),this.lastWebSocketEvent=e)},e.prototype.handleSafariExtensionEvents=function(e){this.lastSafariExtensionEvent!==e&&(this.safari_extension_callbacks.forEach((function(t){"function"==typeof t&&t(e)})),this.lastSafariExtensionEvent=e)},e.prototype.setup=function(){var e=this;return B.globals.sessionId&&this.registerDesktopAppSession(),T()?J.monitorTransferActivity():M.init().then((function(){M.registerMessage("transfer_activity",(function(t){return e.handleTransferActivity(t)})),M.registerEvent((function(t){return e.handleWebSocketEvents(t)}))}))},e.prototype.setCallback=function(e){if("function"==typeof e){var t="callback-".concat(this.activity_callbacks.size+1);return this.activity_callbacks.set(t,e),t}O(c)},e.prototype.removeCallback=function(e){this.activity_callbacks.delete(e)},e.prototype.setRemovedCallback=function(e){if("function"==typeof e){var t="callback-".concat(this.removed_callbacks.size+1);return this.removed_callbacks.set(t,e),t}O(c)},e.prototype.removeRemovedCallback=function(e){this.removed_callbacks.delete(e)},e.prototype.setWebSocketEventCallback=function(e){if("function"==typeof e){var t="callback-".concat(this.event_callbacks.size+1);return this.event_callbacks.set(t,e),e(this.lastWebSocketEvent),t}O(c)},e.prototype.removeWebSocketEventCallback=function(e){this.event_callbacks.delete(e)},e.prototype.setSafariExtensionEventCallback=function(e){if("function"==typeof e){var t="callback-".concat(this.safari_extension_callbacks.size+1);return this.safari_extension_callbacks.set(t,e),e(this.lastSafariExtensionEvent),t}O(c)},e.prototype.removeSafariExtensionEventCallback=function(e){this.safari_extension_callbacks.delete(e)},e.prototype.registerDesktopAppSession=function(){var e=document.createElement("iframe");e.style.display="none",e.src="aspera://initialize?app_id=".concat(B.globals.appId,"&session_id=").concat(B.globals.sessionId),document.body.appendChild(e),setTimeout((function(){document.body.removeChild(e)}),1e3)},e}(),D=function(){function e(){this.globals=new j,this.activityTracking=new q}return Object.defineProperty(e.prototype,"isReady",{get:function(){return this.globals.asperaAppVerified&&""!==this.globals.appId},enumerable:!1,configurable:!0}),e}(),I=n(773),U=function(){var e=this;this.handleRequest=function(t){var n={method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)},r="".concat(B.globals.asperaAppUrl,":").concat(B.globals.rpcPort);return fetch(r,n).then((function(n){if(n.ok)return n.json().then((function(t){return e.client.receive(t)}));if(void 0!==t.id)throw Promise.reject(n.statusText)}))},this.request=function(t,n){return e.client.request(t,n)},this.client=new I.JSONRPCClient(this.handleRequest)},L=new function(){var e=this;this.request=function(t,n){return void 0===n&&(n={}),r=e.httpClient.request(t,n),o=k(),r.then((function(e){o.resolver(e)}),(function(e){o.rejecter(e)})),o.promise;var r,o},this.httpClient=new U},W=T()?J:L,F=function(){return W.request("get_info").then((function(e){return B.globals.AsperaSdkInfo=e,B.globals.asperaAppVerified=!0,e}))},z=function(){if(!B.isReady)return N(m);var e=k();return W.request("init_drag_drop").then((function(t){return e.resolver(t)})).catch((function(t){O(u,t),e.rejecter(_(u,t))})),e.promise},B=new D;B.init=function(e){var t,n,r=null!==(t=null==e?void 0:e.appId)&&void 0!==t?t:x(),o=null!==(n=null==e?void 0:e.supportMultipleUsers)&&void 0!==n&&n;return B.globals.appId=r,o&&(B.globals.supportMultipleUsers=!0,B.globals.sessionId=x()),B.activityTracking.setup().then((function(){return F()})).then((function(){return z()})).catch((function(e){throw O(b,e),B.globals.asperaAppVerified=!1,_(b,e)}))},B.testConnection=F,B.startTransfer=function(e,t){if(!B.isReady)return N(m);if(!function(e){return!(!e||"object"!=typeof e||"string"!=typeof e.direction||"string"!=typeof e.remote_host||!Array.isArray(e.paths))}(e))return N("The supplied transferSpec is not valid",{transferSpec:e});var n=k(),r={transfer_spec:e,desktop_spec:t,app_id:B.globals.appId};return W.request("start_transfer",r).then((function(e){return n.resolver(e)})).catch((function(e){O(C,e),n.rejecter(_(C,e))})),n.promise},B.registerActivityCallback=function(e){return B.activityTracking.setCallback(e)},B.deregisterActivityCallback=function(e){B.activityTracking.removeCallback(e)},B.removeTransfer=function(e){if(!B.isReady)return N(m);var t=k(),n={transfer_id:e};return W.request("remove_transfer",n).then((function(e){return t.resolver(e)})).catch((function(e){O(v,e),t.rejecter(_(v,e))})),t.promise},B.showDirectory=function(e){if(!B.isReady)return N(m);var t=k(),n={transfer_id:e};return W.request("show_directory",n).then((function(e){return t.resolver(e)})).catch((function(e){O(S,e),t.rejecter(_(S,e))})),t.promise},B.stopTransfer=function(e){if(!B.isReady)return N(m);var t=k(),n={transfer_id:e};return W.request("stop_transfer",n).then((function(e){return t.resolver(e)})).catch((function(e){O(w,e),t.rejecter(_(w,e))})),t.promise},B.resumeTransfer=function(e,t){if(!B.isReady)return N(m);var n=k(),r={transfer_id:e,transfer_spec:t};return W.request("resume_transfer",r).then((function(e){return n.resolver(e)})).catch((function(e){O(y,e),n.rejecter(_(y,e))})),n.promise},B.getAllTransfers=function(){if(!B.isReady)return N(m);var e=k(),t={app_id:B.globals.appId};return W.request("get_all_transfers",t).then((function(t){return e.resolver(t)})).catch((function(t){O(p,t),e.rejecter(_(p,t))})),e.promise},B.getTransfer=function(e){if(!B.isReady)return N(m);var t=k(),n={transfer_id:e};return W.request("get_transfer",n).then((function(e){return t.resolver(e)})).catch((function(e){O(d,e),t.rejecter(_(d,e))})),t.promise},B.registerRemovedCallback=function(e){return B.activityTracking.setRemovedCallback(e)},B.deregisterRemovedCallback=function(e){B.activityTracking.removeRemovedCallback(e)},B.showSelectFileDialog=function(e){if(!B.isReady)return N(m);var t=k(),n={options:e||{},app_id:B.globals.appId};return W.request("show_file_dialog",n).then((function(e){return t.resolver(e)})).catch((function(e){O(R,e),t.rejecter(_(R,e))})),t.promise},B.showSelectFolderDialog=function(e){if(!B.isReady)return N(m);var t=k(),n={options:e||{},app_id:B.globals.appId};return W.request("show_folder_dialog",n).then((function(e){return t.resolver(e)})).catch((function(e){O(E,e),t.rejecter(_(E,e))})),t.promise},B.showPreferences=function(){if(!B.isReady)return N(m);var e=k();return W.request("open_preferences").then((function(t){return e.resolver(t)})).catch((function(t){O(P,t),e.rejecter(_(P,t))})),e.promise},B.modifyTransfer=function(e,t){if(!B.isReady)return N(m);var n=k(),r={transfer_id:e,transfer_spec:t};return W.request("modify_transfer",r).then((function(e){return n.resolver(e)})).catch((function(e){O(h,e),n.rejecter(_(h,e))})),n.promise},B.createDropzone=function(e,t){var n=document.querySelectorAll(t);if(n&&n.length){var r=function(e){e.preventDefault()},o=function(t){t.preventDefault();var n=[];if(t.dataTransfer&&t.dataTransfer.files&&t.dataTransfer.files.length&&t.dataTransfer.files[0]){for(var r=0;r<t.dataTransfer.files.length;r++){var o=t.dataTransfer.files[r];n.push({lastModified:o.lastModified,name:o.name,size:o.size,type:o.type})}var i={files:n,app_id:B.globals.appId};W.request("dropped_files",i).then((function(n){return e({event:t,files:n})})).catch((function(e){O("The dropped item could not be parsed. Please try selecting via the select file/folder option",e)}))}};n.forEach((function(e){e.addEventListener("dragover",r),e.addEventListener("drop",o),B.globals.dropZonesCreated.set(t,[{event:"dragover",callback:r},{event:"drop",callback:o}])}))}else O("Unable to find the element on the current page")},B.removeDropzone=function(e){var t=B.globals.dropZonesCreated.get(e);t&&t.forEach((function(t){var n=document.querySelectorAll(e);n&&n.length&&n.forEach((function(e){e.removeEventListener(t.event,t.callback)}))}))},B.getInstallerInfo=function(e){void 0===e&&(e={});var t=e.endpoint||B.globals.installerUrl;if(t.endsWith("/latest.json")&&(t=t.replace("/latest.json","")),!A(t))return N("The specified endpoint is not a valid URL",{url:t});var n=k();return function(e){return t=fetch(e,{headers:{"Content-Type":"application/json"}}),n=k(),t.then((function(e){return e.ok?n.resolver(e):n.rejecter(e),e})).catch((function(e){n.rejecter(e)})),n.promise;var t,n}("".concat(t,"/latest.json")).then((function(t){t.json().then((function(t){if(e.endpoint)for(var r=0,o=t.entries;r<o.length;r++){var i=o[r];A(i.url)||(i.url="".concat(e.endpoint,"/").concat(i.url))}if(e.all)n.resolver(t);else{var s=(a=navigator.userAgent,/Mac/.test(a)?"macos":/Win/.test(a)?"windows":/Linux/.test(a)?"linux":"unknown");t.entries=t.entries.filter((function(e){return e.platform===s})),n.resolver(t)}var a}))})).catch((function(e){O(f,e),n.rejecter(_(f,e))})),n.promise},B.registerStatusCallback=function(e){return B.activityTracking.setWebSocketEventCallback(e)},B.deregisterStatusCallback=function(e){B.activityTracking.removeWebSocketEventCallback(e)},B.registerSafariExtensionStatusCallback=function(e){return B.activityTracking.setSafariExtensionEventCallback(e)},B.deregisterSafariExtensionStatusCallback=function(e){B.activityTracking.removeSafariExtensionEventCallback(e)},B.initDragDrop=z,B.setBranding=function(e,t){if(!B.isReady)return N(m);var n=k(),r={branding:{id:e,name:t.name,theme:t.theme}};return W.request("update_branding",r).then((function(e){return n.resolver(e)})).catch((function(e){O(g,e),n.rejecter(_(g,e))})),n.promise},B.getInfo=function(){return B.isReady?new Promise((function(e,t){e(B.globals.AsperaSdkInfo)})):N(m)},B.isSafari=T,B.getInstallerUrls=function(){return{base:s,latest:a}};var V=B.globals.launch;B.launch=V,"object"==typeof window&&(window.asperaSdk=B)})();
2
+ (()=>{"use strict";var e={94:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.JSONRPCClient=void 0;var i=n(287),s=n(616),a=function(){function e(e,t){this._send=e,this.createID=t,this.idToResolveMap=new Map,this.id=0}return e.prototype._createID=function(){return this.createID?this.createID():++this.id},e.prototype.timeout=function(e,t){var n=this;void 0===t&&(t=function(e){return(0,i.createJSONRPCErrorResponse)(e,s.DefaultErrorCode,"Request timeout")});var r=function(r,o){var i=setTimeout((function(){r.forEach((function(e){var r=n.idToResolveMap.get(e);r&&(n.idToResolveMap.delete(e),r(t(e)))}))}),e);return o().then((function(e){return clearTimeout(i),e}),(function(e){return clearTimeout(i),Promise.reject(e)}))};return{request:function(e,t,o){var i=n._createID();return r([i],(function(){return n.requestWithID(e,t,o,i)}))},requestAdvanced:function(e,t){return function(e,t){var o=(Array.isArray(e)?e:[e]).map((function(e){return e.id})).filter(c);return r(o,(function(){return n.requestAdvanced(e,t)}))}(e,t)}}},e.prototype.request=function(e,t,n){return this.requestWithID(e,t,n,this._createID())},e.prototype.requestWithID=function(e,t,n,s){return r(this,void 0,void 0,(function(){var r,a;return o(this,(function(o){switch(o.label){case 0:return r=(0,i.createJSONRPCRequest)(s,e,t),[4,this.requestAdvanced(r,n)];case 1:return void 0===(a=o.sent()).result||a.error?void 0===a.result&&a.error?[2,Promise.reject(new i.JSONRPCErrorException(a.error.message,a.error.code,a.error.data))]:[2,Promise.reject(new Error("An unexpected error occurred"))]:[2,a.result]}}))}))},e.prototype.requestAdvanced=function(e,t){var n=this,r=Array.isArray(e);Array.isArray(e)||(e=[e]);var o=e.filter((function(e){return c(e.id)})),a=o.map((function(e){return new Promise((function(t){return n.idToResolveMap.set(e.id,t)}))})),u=Promise.all(a).then((function(e){return r||!e.length?e:e[0]}));return this.send(r?e:e[0],t).then((function(){return u}),(function(e){return o.forEach((function(t){n.receive((0,i.createJSONRPCErrorResponse)(t.id,s.DefaultErrorCode,e&&e.message||"Failed to send a request"))})),u}))},e.prototype.notify=function(e,t,n){var r=(0,i.createJSONRPCNotification)(e,t);this.send(r,n).then(void 0,(function(){}))},e.prototype.send=function(e,t){return r(this,void 0,void 0,(function(){return o(this,(function(n){return[2,this._send(e,t)]}))}))},e.prototype.rejectAllPendingRequests=function(e){this.idToResolveMap.forEach((function(t,n){return t((0,i.createJSONRPCErrorResponse)(n,s.DefaultErrorCode,e))})),this.idToResolveMap.clear()},e.prototype.receive=function(e){var t=this;Array.isArray(e)||(e=[e]),e.forEach((function(e){var n=t.idToResolveMap.get(e.id);n&&(t.idToResolveMap.delete(e.id),n(e))}))},e}();t.JSONRPCClient=a;var c=function(e){return null!=e}},773:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(94),t),o(n(989),t),o(n(287),t),o(n(490),t),o(n(556),t)},989:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},616:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DefaultErrorCode=void 0,t.DefaultErrorCode=0},287:function(e,t){var n,r=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.createJSONRPCNotification=t.createJSONRPCRequest=t.createJSONRPCSuccessResponse=t.createJSONRPCErrorResponse=t.JSONRPCErrorCode=t.JSONRPCErrorException=t.isJSONRPCResponses=t.isJSONRPCResponse=t.isJSONRPCRequests=t.isJSONRPCRequest=t.isJSONRPCID=t.JSONRPC=void 0,t.JSONRPC="2.0",t.isJSONRPCID=function(e){return"string"==typeof e||"number"==typeof e||null===e},t.isJSONRPCRequest=function(e){return e.jsonrpc===t.JSONRPC&&void 0!==e.method&&void 0===e.result&&void 0===e.error},t.isJSONRPCRequests=function(e){return Array.isArray(e)&&e.every(t.isJSONRPCRequest)},t.isJSONRPCResponse=function(e){return e.jsonrpc===t.JSONRPC&&void 0!==e.id&&(void 0!==e.result||void 0!==e.error)},t.isJSONRPCResponses=function(e){return Array.isArray(e)&&e.every(t.isJSONRPCResponse)};var o,i=function(e,t,n){var r={code:e,message:t};return null!=n&&(r.data=n),r},s=function(e){function t(n,r,o){var i=e.call(this,n)||this;return Object.setPrototypeOf(i,t.prototype),i.code=r,i.data=o,i}return r(t,e),t.prototype.toObject=function(){return i(this.code,this.message,this.data)},t}(Error);t.JSONRPCErrorException=s,(o=t.JSONRPCErrorCode||(t.JSONRPCErrorCode={}))[o.ParseError=-32700]="ParseError",o[o.InvalidRequest=-32600]="InvalidRequest",o[o.MethodNotFound=-32601]="MethodNotFound",o[o.InvalidParams=-32602]="InvalidParams",o[o.InternalError=-32603]="InternalError",t.createJSONRPCErrorResponse=function(e,n,r,o){return{jsonrpc:t.JSONRPC,id:e,error:i(n,r,o)}},t.createJSONRPCSuccessResponse=function(e,n){return{jsonrpc:t.JSONRPC,id:e,result:null!=n?n:null}},t.createJSONRPCRequest=function(e,n,r){return{jsonrpc:t.JSONRPC,id:e,method:n,params:r}},t.createJSONRPCNotification=function(e,n){return{jsonrpc:t.JSONRPC,method:e,params:n}}},556:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.JSONRPCServerAndClient=void 0;var i=n(287),s=function(){function e(e,t,n){var r;void 0===n&&(n={}),this.server=e,this.client=t,this.errorListener=null!==(r=n.errorListener)&&void 0!==r?r:console.warn}return e.prototype.applyServerMiddleware=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];(e=this.server).applyMiddleware.apply(e,t)},e.prototype.hasMethod=function(e){return this.server.hasMethod(e)},e.prototype.addMethod=function(e,t){this.server.addMethod(e,t)},e.prototype.addMethodAdvanced=function(e,t){this.server.addMethodAdvanced(e,t)},e.prototype.timeout=function(e){return this.client.timeout(e)},e.prototype.request=function(e,t,n){return this.client.request(e,t,n)},e.prototype.requestAdvanced=function(e,t){return this.client.requestAdvanced(e,t)},e.prototype.notify=function(e,t,n){this.client.notify(e,t,n)},e.prototype.rejectAllPendingRequests=function(e){this.client.rejectAllPendingRequests(e)},e.prototype.receiveAndSend=function(e,t,n){return r(this,void 0,void 0,(function(){var r,s;return o(this,(function(o){switch(o.label){case 0:return(0,i.isJSONRPCResponse)(e)||(0,i.isJSONRPCResponses)(e)?(this.client.receive(e),[3,4]):[3,1];case 1:return(0,i.isJSONRPCRequest)(e)||(0,i.isJSONRPCRequests)(e)?[4,this.server.receive(e,t)]:[3,3];case 2:return(r=o.sent())?[2,this.client.send(r,n)]:[3,4];case 3:return s="Received an invalid JSON-RPC message",this.errorListener(s,e),[2,Promise.reject(new Error(s))];case 4:return[2]}}))}))},e}();t.JSONRPCServerAndClient=s},490:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},s=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.JSONRPCServer=void 0;var a=n(287),c=n(616),u=function(e){return(0,a.createJSONRPCErrorResponse)((0,a.isJSONRPCID)(e.id)?e.id:null,a.JSONRPCErrorCode.InvalidRequest,"Invalid Request")},l=function(){function e(e){var t;void 0===e&&(e={}),this.mapErrorToJSONRPCErrorResponse=h,this.nameToMethodDictionary={},this.middleware=null,this.errorListener=null!==(t=e.errorListener)&&void 0!==t?t:console.warn}return e.prototype.hasMethod=function(e){return!!this.nameToMethodDictionary[e]},e.prototype.addMethod=function(e,t){this.addMethodAdvanced(e,this.toJSONRPCMethod(t))},e.prototype.toJSONRPCMethod=function(e){return function(t,n){var r=e(t.params,n);return Promise.resolve(r).then((function(e){return d(t.id,e)}))}},e.prototype.addMethodAdvanced=function(e,t){var n;this.nameToMethodDictionary=r(r({},this.nameToMethodDictionary),((n={})[e]=t,n))},e.prototype.receiveJSON=function(e,t){var n=this.tryParseRequestJSON(e);return n?this.receive(n,t):Promise.resolve((0,a.createJSONRPCErrorResponse)(null,a.JSONRPCErrorCode.ParseError,"Parse error"))},e.prototype.tryParseRequestJSON=function(e){try{return JSON.parse(e)}catch(e){return null}},e.prototype.receive=function(e,t){return Array.isArray(e)?this.receiveMultiple(e,t):this.receiveSingle(e,t)},e.prototype.receiveMultiple=function(e,t){return o(this,void 0,void 0,(function(){var n,r=this;return i(this,(function(o){switch(o.label){case 0:return[4,Promise.all(e.map((function(e){return r.receiveSingle(e,t)})))];case 1:return 1===(n=o.sent().filter(f)).length?[2,n[0]]:n.length?[2,n]:[2,null]}}))}))},e.prototype.receiveSingle=function(e,t){return o(this,void 0,void 0,(function(){var n,r;return i(this,(function(o){switch(o.label){case 0:return n=this.nameToMethodDictionary[e.method],(0,a.isJSONRPCRequest)(e)?[3,1]:[2,u(e)];case 1:return[4,this.callMethod(n,e,t)];case 2:return r=o.sent(),[2,v(e,r)]}}))}))},e.prototype.applyMiddleware=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.middleware?this.middleware=this.combineMiddlewares(s([this.middleware],e,!0)):this.middleware=this.combineMiddlewares(e)},e.prototype.combineMiddlewares=function(e){return e.length?e.reduce(this.middlewareReducer):null},e.prototype.middlewareReducer=function(e,t){return function(n,r,o){return e((function(e,r){return t(n,e,r)}),r,o)}},e.prototype.callMethod=function(e,t,n){var r=this,o=function(e){return r.errorListener('An unexpected error occurred while executing "'.concat(t.method,'" JSON-RPC method:'),e),Promise.resolve(r.mapErrorToJSONRPCErrorResponseIfNecessary(t.id,e))};try{return(this.middleware||p)((function(t,n){return e?e(t,n):void 0!==t.id?Promise.resolve((r=t.id,(0,a.createJSONRPCErrorResponse)(r,a.JSONRPCErrorCode.MethodNotFound,"Method not found"))):Promise.resolve(null);var r}),t,n).then(void 0,o)}catch(e){return o(e)}},e.prototype.mapErrorToJSONRPCErrorResponseIfNecessary=function(e,t){return void 0!==e?this.mapErrorToJSONRPCErrorResponse(e,t):null},e}();t.JSONRPCServer=l;var f=function(e){return null!==e},p=function(e,t,n){return e(t,n)},d=function(e,t){return void 0!==e?(0,a.createJSONRPCSuccessResponse)(e,t):null},h=function(e,t){var n,r,o=null!==(n=null==t?void 0:t.message)&&void 0!==n?n:"An unexpected error occurred",i=c.DefaultErrorCode;return t instanceof a.JSONRPCErrorException&&(i=t.code,r=t.data),(0,a.createJSONRPCErrorResponse)(e,i,o,r)},v=function(e,t){return t||(void 0!==e.id?(0,a.createJSONRPCErrorResponse)(e.id,a.JSONRPCErrorCode.InternalError,"Internal error"):null)}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.d({},{z7:()=>B});var r,o,i="aspera://",s="https://downloads.ibmaspera.com/downloads/desktop",a="".concat(s,"/latest/stable"),c="The provided callback is not a function",u="Unable to initialize drag-drop",l="Unable to generate IFRAME for download. Using new window",f="Unable to get latest installers",p="Unable to get all transfers",d="Unable to get transfer",h="Unable to modify transfer",v="Unable to remove transfer",y="Unable to resume transfer",b="Unable to connect to IBM Aspera for Desktop server",m="IBM Aspera SDK has not been verified. Run test or init first",g="Unable to set custom branding",S="Unable to show transfer directory",E="Unable to show select file dialog",R="Unable to show select folder dialog",C="Unable to show preferences",w="Unable to stop transfer",P="The transfer failed to initiate",k=function(){var e,t;return{promise:new Promise((function(n,r){e=n,t=r})),resolver:e,rejecter:t}},O=function(e,t){t&&t.code&&t.message&&(t={code:t.code,message:t.message,data:t.data}),"object"==typeof window&&(Array.isArray(window.asperaSdkLogs)||(window.asperaSdkLogs=[]),window.asperaSdkLogs.push({message:e,debugData:t})),console.warn("Aspera SDK: ".concat(e),t)},_=function(e,t){var n={error:!0,message:e};return t&&t.code&&t.message&&(n.debugData={code:t.code,message:t.message,data:t.data}),n},x=function(){var e;return(null===(e=window.crypto)||void 0===e?void 0:e.randomUUID)?window.crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=Number((((new Date).getTime()+16)*Math.random()).toFixed())%16;return"x"!==e&&(t=3&t|8),t.toString(16)}))},N=function(e,t){return O(e,t),new Promise((function(n,r){r(_(e,t))}))},A=function(e){try{return new URL(e),!0}catch(e){return!1}},T=function(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&!window.MSStream};!function(e){e.Monitor="Monitor",e.Ping="Ping",e.Request="Request"}(r||(r={}));var J=new(function(){function e(){var e=this;this.keepAliveInterval=1e3,this.lastPing=null,this.lastPong=null,this.safariExtensionEnabled=!1,this.subscribedTransferActivity=!1,this.request=function(t,n){return void 0===n&&(n={}),e.dispatchPromiseEvent(r.Request,t,n)},this.promiseExecutors=new Map,this.listenResponseEvents(),this.listenTransferActivityEvents(),this.listenStatusEvents(),this.listenClientStatusEvents(),this.listenPongEvents(),o&&clearTimeout(o),this.keepAlive()}return e.prototype.monitorTransferActivity=function(){var e=this,t=function(){return e.dispatchPromiseEvent(r.Monitor,"subscribe_transfer_activity",[B.globals.appId]).then((function(){e.subscribedTransferActivity=!0}))};return this.safariExtensionEnabled?t():new Promise((function(n,r){var o=setInterval((function(){e.safariExtensionEnabled&&(t().then(n).catch(r),clearInterval(o))}),1e3)}))},e.prototype.buildRPCRequest=function(e,t){return{jsonrpc:"2.0",method:e,params:t,id:x()}},e.prototype.dispatchEvent=function(e,t){var n={detail:null!=t?t:{}};document.dispatchEvent(new CustomEvent("AsperaDesktop.".concat(e),n))},e.prototype.dispatchPromiseEvent=function(e,t,n){var r=this,o=this.buildRPCRequest(t,n);return new Promise((function(t,n){r.safariExtensionEnabled?(r.promiseExecutors.set(o.id,{resolve:t,reject:n}),r.dispatchEvent(e,o)):(console.warn("The Safari extension is disabled or unresponsive (dispatch event)"),console.warn("Failed event: ".concat(JSON.stringify(o))),n("The Safari extension is disabled or unresponsive (dispatch event)"))}))},e.prototype.handleResponse=function(e){var t=e.id,n=this.promiseExecutors.get(t);if(!n)return console.warn("Unable to find a promise executor for ".concat(t)),void console.warn("Response: ".concat(e));this.promiseExecutors.delete(t),e.error?n.reject(e.error):n.resolve(e.result)},e.prototype.listenResponseEvents=function(){var e=this;document.addEventListener("AsperaDesktop.Response",(function(t){t.detail&&e.handleResponse(t.detail)}))},e.prototype.listenTransferActivityEvents=function(){document.addEventListener("AsperaDesktop.TransferActivity",(function(e){e.detail&&B.activityTracking.handleTransferActivity(e.detail)}))},e.prototype.listenStatusEvents=function(){document.addEventListener("AsperaDesktop.Status",(function(e){e.detail&&B.activityTracking.handleWebSocketEvents(e.detail)}))},e.prototype.listenClientStatusEvents=function(){document.addEventListener("isAppAlive",(function(e){var t;(null===(t=e.detail)||void 0===t?void 0:t.running)&&B.activityTracking.handleClientEvents(e.detail.running)}))},e.prototype.listenPongEvents=function(){var e=this;document.addEventListener("AsperaDesktop.Pong",(function(){e.lastPong=Date.now(),e.safariExtensionStatusChanged(!0)}))},e.prototype.keepAlive=function(){var e=this;this.lastPing=Date.now(),this.dispatchEvent(r.Ping),o=setTimeout((function(){e.keepAlive()}),this.keepAliveInterval)},e.prototype.safariExtensionStatusChanged=function(e){var t=this;if(e!==this.safariExtensionEnabled){if(this.safariExtensionEnabled=e,e){if(this.subscribedTransferActivity){var n=function(){t.monitorTransferActivity().catch((function(){console.error("Failed to resume transfer activity, will try again in 1s"),setTimeout((function(){n()}),1e3)}))};n()}}else B.activityTracking.handleWebSocketEvents("CLOSED"),this.promiseExecutors.forEach((function(e){e.reject("The Safari extension is disabled or unresponsive (extension status)")})),this.promiseExecutors.clear();B.activityTracking.handleSafariExtensionEvents(this.safariExtensionEnabled?"ENABLED":"DISABLED")}},e.prototype.checkSafariExtensionStatus=function(){var e=this.lastPong-this.lastPing;(null==this.lastPong||e<0||e>500)&&this.safariExtensionStatusChanged(!1)},e}()),M=new(function(){function e(){var e=this;this.sockets=new Map,this.isConnected=!1,this.initPromise=k(),this.handleOpen=function(){!e.isConnected&&e.joinChannel()&&(e.isConnected=!0,e.updateRpcPort(),e.notifyEvent("RECONNECT"))},this.handleClose=function(){e.isConnected&&(e.isConnected=!1,e.notifyEvent("CLOSED")),e.globalSocket?e.reconnect():e.handleNotReady()},this.handleError=function(){O("The websocket was closed due to an error")},this.handleMessage=function(t){var n;try{n=JSON.parse(t.data)}catch(e){O("Unable to parse Websocket message",{error:e,message:t})}if(n&&1===n.id)e.initPromise.resolver(n);else{var r=e.sockets.get(n.method);r&&n.params&&r(n.params)}}}return e.prototype.handleNotReady=function(){O("The websocket is not ready. Run init first")},e.prototype.joinChannel=function(){return this.globalSocket?(this.globalSocket.send(JSON.stringify({jsonrpc:"2.0",method:"subscribe_transfer_activity",params:[B.globals.appId],id:1})),!0):(this.handleNotReady(),!1)},e.prototype.registerMessage=function(e,t){this.sockets.get(e)||this.sockets.set(e,(function(e){t(e.result)}))},e.prototype.registerEvent=function(e){this.eventListener=e,this.eventListener(this.isConnected?"RECONNECT":"CLOSED")},e.prototype.init=function(){return this.connect(),this.initPromise.promise},e.prototype.connect=function(){var e=this;this.getWebSocketConnection(33024,B.globals.supportMultipleUsers?33029:33024).then((function(t){e.globalSocket=t,e.globalSocket.onerror=e.handleError,e.globalSocket.onclose=e.handleClose,e.globalSocket.onopen=e.handleOpen,e.globalSocket.onmessage=e.handleMessage,e.handleOpen()})).catch((function(){e.reconnect()}))},e.prototype.reconnect=function(){var e=this;this.globalSocket&&this.globalSocket.close(),setTimeout((function(){e.connect()}),1e3)},e.prototype.getWebSocketConnection=function(e,t){var n=function(e){var t;0===e.indexOf("http:")?t="ws":0===e.indexOf("https:")&&(t="wss");var n=e.replace("http://","//").replace("https://","//");return"".concat(t,":").concat(n)}(B.globals.asperaAppUrl);return new Promise((function(r,o){var i=function(e){if(e>t)return o("No available WebSocket connection found");(function(e){return new Promise((function(t,r){var o=new WebSocket("".concat(n,":").concat(e));o.onopen=function(){t(o)},o.onerror=function(){r("Connection failed on port ".concat(e))}}))})(e).then((function(e){return r(e)})).catch((function(t){i(e+1)}))};i(e)}))},e.prototype.notifyEvent=function(e){"function"==typeof this.eventListener&&this.eventListener(e)},e.prototype.updateRpcPort=function(){if(this.globalSocket){var e=new URL(this.globalSocket.url);B.globals.rpcPort=Number(e.port)}},e}()),j=function(){function e(){this.asperaAppUrl="http://127.0.0.1",this.rpcPort=33024,this.installerUrl=a,this.asperaAppVerified=!1,this.supportMultipleUsers=!1,this.dropZonesCreated=new Map}return e.prototype.backupLaunchMethod=function(e){window.alert("Launching IBM Aspera for Desktop"),window.location.href=e},e.prototype.launch=function(){var e=this;try{var t=document.createElement("iframe");t.src=i,t.onerror=function(t){O(l,t),e.backupLaunchMethod(i)},t.setAttribute("style","\n display: none !important;\n width: 1px !important;\n height: 1px !important;\n position: fixed !important;\n z-index: -99 !important;\n bottom: 0px !important;\n right: 0px !important;\n"),document.body.appendChild(t)}catch(e){O(l,e),this.backupLaunchMethod(i)}},e}(),q=function(){function e(){this.activity_callbacks=new Map,this.removed_callbacks=new Map,this.event_callbacks=new Map,this.safari_extension_callbacks=new Map,this.lastWebSocketEvent="CLOSED",this.lastNotifiedWebSocketEvent=void 0,this.lastSafariExtensionEvent="DISABLED"}return e.prototype.handleTransferActivity=function(e){"transferUpdated"===e.type&&this.activity_callbacks.forEach((function(t){"function"==typeof t&&t(e.data)})),"transferRemoved"===e.type&&this.removed_callbacks.forEach((function(t){"function"==typeof t&&t(e.data)}))},e.prototype.handleWebSocketEvents=function(e){this.lastWebSocketEvent!==e&&(this.lastWebSocketEvent=e,this.notifyWebSocketEvent(e))},e.prototype.notifyWebSocketEvent=function(e){this.lastNotifiedWebSocketEvent!==e&&(this.lastNotifiedWebSocketEvent=e,this.event_callbacks.forEach((function(t){"function"==typeof t&&t(e)})))},e.prototype.handleClientEvents=function(e){var t;t=e?this.lastWebSocketEvent:"CLOSED",this.notifyWebSocketEvent(t)},e.prototype.handleSafariExtensionEvents=function(e){this.lastSafariExtensionEvent!==e&&(this.safari_extension_callbacks.forEach((function(t){"function"==typeof t&&t(e)})),this.lastSafariExtensionEvent=e)},e.prototype.setup=function(){var e=this;return B.globals.sessionId&&this.registerDesktopAppSession(),T()?J.monitorTransferActivity():M.init().then((function(){M.registerMessage("transfer_activity",(function(t){return e.handleTransferActivity(t)})),M.registerEvent((function(t){return e.handleWebSocketEvents(t)}))}))},e.prototype.setCallback=function(e){if("function"==typeof e){var t="callback-".concat(this.activity_callbacks.size+1);return this.activity_callbacks.set(t,e),t}O(c)},e.prototype.removeCallback=function(e){this.activity_callbacks.delete(e)},e.prototype.setRemovedCallback=function(e){if("function"==typeof e){var t="callback-".concat(this.removed_callbacks.size+1);return this.removed_callbacks.set(t,e),t}O(c)},e.prototype.removeRemovedCallback=function(e){this.removed_callbacks.delete(e)},e.prototype.setWebSocketEventCallback=function(e){if("function"==typeof e){var t="callback-".concat(this.event_callbacks.size+1);return this.event_callbacks.set(t,e),e(this.lastWebSocketEvent),t}O(c)},e.prototype.removeWebSocketEventCallback=function(e){this.event_callbacks.delete(e)},e.prototype.setSafariExtensionEventCallback=function(e){if("function"==typeof e){var t="callback-".concat(this.safari_extension_callbacks.size+1);return this.safari_extension_callbacks.set(t,e),e(this.lastSafariExtensionEvent),t}O(c)},e.prototype.removeSafariExtensionEventCallback=function(e){this.safari_extension_callbacks.delete(e)},e.prototype.registerDesktopAppSession=function(){var e=document.createElement("iframe");e.style.display="none",e.src="aspera://initialize?app_id=".concat(B.globals.appId,"&session_id=").concat(B.globals.sessionId),document.body.appendChild(e),setTimeout((function(){document.body.removeChild(e)}),1e3)},e}(),D=function(){function e(){this.globals=new j,this.activityTracking=new q}return Object.defineProperty(e.prototype,"isReady",{get:function(){return this.globals.asperaAppVerified&&""!==this.globals.appId},enumerable:!1,configurable:!0}),e}(),I=n(773),L=function(){var e=this;this.handleRequest=function(t){var n={method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)},r="".concat(B.globals.asperaAppUrl,":").concat(B.globals.rpcPort);return fetch(r,n).then((function(n){if(n.ok)return n.json().then((function(t){return e.client.receive(t)}));if(void 0!==t.id)throw Promise.reject(n.statusText)}))},this.request=function(t,n){return e.client.request(t,n)},this.client=new I.JSONRPCClient(this.handleRequest)},U=new function(){var e=this;this.request=function(t,n){return void 0===n&&(n={}),r=e.httpClient.request(t,n),o=k(),r.then((function(e){o.resolver(e)}),(function(e){o.rejecter(e)})),o.promise;var r,o},this.httpClient=new L},W=T()?J:U,z=function(){return W.request("get_info").then((function(e){return B.globals.AsperaSdkInfo=e,B.globals.asperaAppVerified=!0,e}))},F=function(){if(!B.isReady)return N(m);var e=k();return W.request("init_drag_drop").then((function(t){return e.resolver(t)})).catch((function(t){O(u,t),e.rejecter(_(u,t))})),e.promise},B=new D;B.init=function(e){var t,n,r=null!==(t=null==e?void 0:e.appId)&&void 0!==t?t:x(),o=null!==(n=null==e?void 0:e.supportMultipleUsers)&&void 0!==n&&n;return B.globals.appId=r,o&&(B.globals.supportMultipleUsers=!0,B.globals.sessionId=x()),B.activityTracking.setup().then((function(){return z()})).then((function(){return F()})).catch((function(e){throw O(b,e),B.globals.asperaAppVerified=!1,_(b,e)}))},B.testConnection=z,B.startTransfer=function(e,t){if(!B.isReady)return N(m);if(!function(e){return!(!e||"object"!=typeof e||"string"!=typeof e.direction||"string"!=typeof e.remote_host||!Array.isArray(e.paths))}(e))return N("The supplied transferSpec is not valid",{transferSpec:e});var n=k(),r={transfer_spec:e,desktop_spec:t,app_id:B.globals.appId};return W.request("start_transfer",r).then((function(e){return n.resolver(e)})).catch((function(e){O(P,e),n.rejecter(_(P,e))})),n.promise},B.registerActivityCallback=function(e){return B.activityTracking.setCallback(e)},B.deregisterActivityCallback=function(e){B.activityTracking.removeCallback(e)},B.removeTransfer=function(e){if(!B.isReady)return N(m);var t=k(),n={transfer_id:e};return W.request("remove_transfer",n).then((function(e){return t.resolver(e)})).catch((function(e){O(v,e),t.rejecter(_(v,e))})),t.promise},B.showDirectory=function(e){if(!B.isReady)return N(m);var t=k(),n={transfer_id:e};return W.request("show_directory",n).then((function(e){return t.resolver(e)})).catch((function(e){O(S,e),t.rejecter(_(S,e))})),t.promise},B.stopTransfer=function(e){if(!B.isReady)return N(m);var t=k(),n={transfer_id:e};return W.request("stop_transfer",n).then((function(e){return t.resolver(e)})).catch((function(e){O(w,e),t.rejecter(_(w,e))})),t.promise},B.resumeTransfer=function(e,t){if(!B.isReady)return N(m);var n=k(),r={transfer_id:e,transfer_spec:t};return W.request("resume_transfer",r).then((function(e){return n.resolver(e)})).catch((function(e){O(y,e),n.rejecter(_(y,e))})),n.promise},B.getAllTransfers=function(){if(!B.isReady)return N(m);var e=k(),t={app_id:B.globals.appId};return W.request("get_all_transfers",t).then((function(t){return e.resolver(t)})).catch((function(t){O(p,t),e.rejecter(_(p,t))})),e.promise},B.getTransfer=function(e){if(!B.isReady)return N(m);var t=k(),n={transfer_id:e};return W.request("get_transfer",n).then((function(e){return t.resolver(e)})).catch((function(e){O(d,e),t.rejecter(_(d,e))})),t.promise},B.registerRemovedCallback=function(e){return B.activityTracking.setRemovedCallback(e)},B.deregisterRemovedCallback=function(e){B.activityTracking.removeRemovedCallback(e)},B.showSelectFileDialog=function(e){if(!B.isReady)return N(m);var t=k(),n={options:e||{},app_id:B.globals.appId};return W.request("show_file_dialog",n).then((function(e){return t.resolver(e)})).catch((function(e){O(E,e),t.rejecter(_(E,e))})),t.promise},B.showSelectFolderDialog=function(e){if(!B.isReady)return N(m);var t=k(),n={options:e||{},app_id:B.globals.appId};return W.request("show_folder_dialog",n).then((function(e){return t.resolver(e)})).catch((function(e){O(R,e),t.rejecter(_(R,e))})),t.promise},B.showPreferences=function(){if(!B.isReady)return N(m);var e=k();return W.request("open_preferences").then((function(t){return e.resolver(t)})).catch((function(t){O(C,t),e.rejecter(_(C,t))})),e.promise},B.modifyTransfer=function(e,t){if(!B.isReady)return N(m);var n=k(),r={transfer_id:e,transfer_spec:t};return W.request("modify_transfer",r).then((function(e){return n.resolver(e)})).catch((function(e){O(h,e),n.rejecter(_(h,e))})),n.promise},B.createDropzone=function(e,t){var n=document.querySelectorAll(t);if(n&&n.length){var r=function(e){e.preventDefault()},o=function(t){t.preventDefault();var n=[];if(t.dataTransfer&&t.dataTransfer.files&&t.dataTransfer.files.length&&t.dataTransfer.files[0]){for(var r=0;r<t.dataTransfer.files.length;r++){var o=t.dataTransfer.files[r];n.push({lastModified:o.lastModified,name:o.name,size:o.size,type:o.type})}var i={files:n,app_id:B.globals.appId};W.request("dropped_files",i).then((function(n){return e({event:t,files:n})})).catch((function(e){O("The dropped item could not be parsed. Please try selecting via the select file/folder option",e)}))}};n.forEach((function(e){e.addEventListener("dragover",r),e.addEventListener("drop",o),B.globals.dropZonesCreated.set(t,[{event:"dragover",callback:r},{event:"drop",callback:o}])}))}else O("Unable to find the element on the current page")},B.removeDropzone=function(e){var t=B.globals.dropZonesCreated.get(e);t&&t.forEach((function(t){var n=document.querySelectorAll(e);n&&n.length&&n.forEach((function(e){e.removeEventListener(t.event,t.callback)}))}))},B.getInstallerInfo=function(e){void 0===e&&(e={});var t=e.endpoint||B.globals.installerUrl;if(t.endsWith("/latest.json")&&(t=t.replace("/latest.json","")),!A(t))return N("The specified endpoint is not a valid URL",{url:t});var n=k();return function(e){return t=fetch(e,{headers:{"Content-Type":"application/json"}}),n=k(),t.then((function(e){return e.ok?n.resolver(e):n.rejecter(e),e})).catch((function(e){n.rejecter(e)})),n.promise;var t,n}("".concat(t,"/latest.json")).then((function(t){t.json().then((function(t){if(e.endpoint)for(var r=0,o=t.entries;r<o.length;r++){var i=o[r];A(i.url)||(i.url="".concat(e.endpoint,"/").concat(i.url))}if(e.all)n.resolver(t);else{var s=(a=navigator.userAgent,/Mac/.test(a)?"macos":/Win/.test(a)?"windows":/Linux/.test(a)?"linux":"unknown");t.entries=t.entries.filter((function(e){return e.platform===s})),n.resolver(t)}var a}))})).catch((function(e){O(f,e),n.rejecter(_(f,e))})),n.promise},B.registerStatusCallback=function(e){return B.activityTracking.setWebSocketEventCallback(e)},B.deregisterStatusCallback=function(e){B.activityTracking.removeWebSocketEventCallback(e)},B.registerSafariExtensionStatusCallback=function(e){return B.activityTracking.setSafariExtensionEventCallback(e)},B.deregisterSafariExtensionStatusCallback=function(e){B.activityTracking.removeSafariExtensionEventCallback(e)},B.initDragDrop=F,B.setBranding=function(e,t){if(!B.isReady)return N(m);var n=k(),r={branding:{id:e,name:t.name,theme:t.theme}};return W.request("update_branding",r).then((function(e){return n.resolver(e)})).catch((function(e){O(g,e),n.rejecter(_(g,e))})),n.promise},B.getInfo=function(){return B.isReady?new Promise((function(e,t){e(B.globals.AsperaSdkInfo)})):N(m)},B.isSafari=T,B.getInstallerUrls=function(){return{base:s,latest:a}};var V=B.globals.launch;B.launch=V,"object"==typeof window&&(window.asperaSdk=B)})();
3
3
  //# sourceMappingURL=aspera-sdk.js.map
@@ -1,7 +1,7 @@
1
1
  /*!
2
- * IBM Aspera SDK v0.2.6
2
+ * IBM Aspera SDK v0.2.7
3
3
  * Licensed Materials – Property of IBM
4
- * © Copyright IBM Corp. 2024
4
+ * © Copyright IBM Corp. 2024, 2025
5
5
  * U.S. Government Users Restricted Rights: Use, duplication or disclosure restricted by
6
6
  * GSA ADP Schedule Contract with IBM Corp.
7
7
  */