comprodls-sdk 2.13.5 → 2.16.0

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.
@@ -316,6 +316,7 @@ exports.AUTH_API_URLS = {
316
316
  getParticularClassAPI: '/org/{orgId}/classes/{classId}',
317
317
  getParticularShadowClassAPI: '/org/{orgId}/shadow/classes/{extClassId}',
318
318
  classProductAssociation: '/org/{orgId}/classes/{classId}/associate-product/{productcode}',
319
+ multiClassProductAssociations: '/org/{orgId}/classes/{classId}/associate-product/multi',
319
320
  enrollUsertoClass: '/org/{orgId}/classes/{classId}/enroll-user/{userId}',
320
321
  enrollSelftoClass: '/org/{orgId}/classes/{classId}/enroll-self',
321
322
  enrollMultiUserstoClass: '/org/{orgId}/classes/{classId}/enroll-user/multi',
@@ -422,7 +423,9 @@ exports.ANALYTICS_API_URLS = {
422
423
  //AssignedPaths Related APIs
423
424
  getAllAssignedPathsOfClass: '/{orgId}/class/assigned-paths',
424
425
  getMyAssignedPathsOfClass: '/{orgId}/user/class/assigned-paths',
425
- getAssignedPathAnalytics: '/{orgId}/class/assigned-paths/aggregations'
426
+ getAssignedPathAnalytics: '/{orgId}/class/assigned-paths/aggregations',
427
+
428
+ getTimeseriesAnalytics: '/progress/timeseries'
426
429
  };
427
430
 
428
431
  exports.SISEVENTS_API_URLS = {
@@ -443,7 +446,9 @@ exports.PRODUCT_API_URLS = {
443
446
  getEntitlementsOfAUser: '/accounts/{accountId}/ext-users/{extUserId}/entitlements',
444
447
  getMicroEntitlementsOfAUser: '/accounts/{accountId}/ext-users/{extUserId}/entitlements/micro',
445
448
  getAllBundles: '/accounts/{accountId}/bundles',
446
- getSingleBundle: '/accounts/{accountId}/bundles/{bundleCode}'
449
+ getSingleBundle: '/accounts/{accountId}/bundles/{bundleCode}',
450
+ getAllProductFamilies: '/accounts/{accountId}/families',
451
+ getSingleProductFamily: '/accounts/{accountId}/families/{familyCode}'
447
452
  };
448
453
 
449
454
  exports.XAPI_API_URLS = {
@@ -466,7 +471,11 @@ exports.PUB_API_URLS = {
466
471
  createBundle: '/{orgid}/stage/{stage}/bundles',
467
472
  updateBundle: '/{orgid}/stage/{stage}/bundles/{bundleCode}',
468
473
  getAllBundles: '/{orgid}/bundles',
469
- getSingleBundle: '/{orgid}/bundles/{bundleCode}'
474
+ getSingleBundle: '/{orgid}/bundles/{bundleCode}',
475
+ createProductFamily: '/{orgid}/stage/{stage}/families',
476
+ updateProductFamily: '/{orgid}/stage/{stage}/families/{familyCode}',
477
+ getSingleProductFamily: '/{orgid}/families/{familyCode}',
478
+ getAllProductFamilies: '/{orgid}/families'
470
479
  };
471
480
 
472
481
  exports.PUSHX_API_URLS = {
@@ -771,7 +780,7 @@ function addClassIdQueryParam(url, classId) {
771
780
  function setupAPIToken(request, token) {
772
781
  return request.set('Authorization', token.access_token);
773
782
  };
774
- },{"../../../config":2,"../../../helpers":3,"../errors":7,"./validations":6,"q":89,"string-template":130,"superagent":132}],6:[function(require,module,exports){
783
+ },{"../../../config":2,"../../../helpers":3,"../errors":7,"./validations":6,"q":88,"string-template":129,"superagent":131}],6:[function(require,module,exports){
775
784
  /*************************************************************************
776
785
  *
777
786
  * COMPRO CONFIDENTIAL
@@ -1226,7 +1235,7 @@ function getSingleInvitation(organizationId, options) {
1226
1235
  }
1227
1236
 
1228
1237
 
1229
- },{"../helpers":3,"q":89,"superagent":132}],11:[function(require,module,exports){
1238
+ },{"../helpers":3,"q":88,"superagent":131}],11:[function(require,module,exports){
1230
1239
  /*************************************************************************
1231
1240
  *
1232
1241
  * COMPRO CONFIDENTIAL
@@ -1437,7 +1446,7 @@ Activity.prototype.getQuestionsCount = function () {
1437
1446
  return dfd.promise;
1438
1447
  }
1439
1448
 
1440
- },{"../../helpers":3,"./attempt":12,"extend":66,"q":89,"superagent":132}],12:[function(require,module,exports){
1449
+ },{"../../helpers":3,"./attempt":12,"extend":65,"q":88,"superagent":131}],12:[function(require,module,exports){
1441
1450
  /*************************************************************************
1442
1451
  *
1443
1452
  * COMPRO CONFIDENTIAL
@@ -1870,7 +1879,7 @@ Attempt.prototype.submit = function (userresponse) {
1870
1879
  return dfd.promise;
1871
1880
  };
1872
1881
 
1873
- },{"../../helpers":3,"extend":66,"q":89,"superagent":132}],13:[function(require,module,exports){
1882
+ },{"../../helpers":3,"extend":65,"q":88,"superagent":131}],13:[function(require,module,exports){
1874
1883
  /*************************************************************************
1875
1884
  *
1876
1885
  * COMPRO CONFIDENTIAL
@@ -1976,7 +1985,9 @@ function analytics() {
1976
1985
  getAllAssignedPathsOfClass: getAllAssignedPathsOfClass.bind(this),
1977
1986
  getMyAssignedPathsOfClass: getMyAssignedPathsOfClass.bind(this),
1978
1987
  getAssignedPathAnalytics: getAssignedPathAnalytics.bind(this),
1979
- getMyParticularAssignedPathOfClass: getMyParticularAssignedPathOfClass.bind(this)
1988
+ getMyParticularAssignedPathOfClass: getMyParticularAssignedPathOfClass.bind(this),
1989
+
1990
+ getTimeseriesAnalytics: getTimeseriesAnalytics.bind(this)
1980
1991
  };
1981
1992
  }
1982
1993
 
@@ -3456,8 +3467,50 @@ function getMyParticularAssignedPathOfClass(options) {
3456
3467
  }
3457
3468
  return dfd.promise;
3458
3469
  }
3459
-
3460
- },{"../../helpers":3,"q":89,"superagent":132}],15:[function(require,module,exports){
3470
+
3471
+ /*
3472
+ options = {
3473
+ query: 'string', //mandatory
3474
+ cursor: 'string' //optional
3475
+ }
3476
+ */
3477
+ function getTimeseriesAnalytics(options) {
3478
+ var self = this;
3479
+ var dfd = q.defer();
3480
+ var err;
3481
+
3482
+ if(options && options.query) {
3483
+ //Passed all validations, Construct API url
3484
+ var url = self.config.DEFAULT_HOSTS.ANALYTICS + self.config.ANALYTICS_API_URLS.getTimeseriesAnalytics;
3485
+
3486
+ // Contruct parameters
3487
+ var params = {
3488
+ query: options.query
3489
+ };
3490
+
3491
+ if(options.cursor) { params.cursor = options.cursor; }
3492
+ //Setup request with URL and Params
3493
+ var requestAPI = request.get(url).query(params);
3494
+
3495
+ if(self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
3496
+
3497
+ requestAPI.end(function (error, response) {
3498
+ if(error) {
3499
+ err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, error);
3500
+ dfd.reject(err);
3501
+ }
3502
+ else { dfd.resolve(response.body); }
3503
+ });
3504
+ }
3505
+ else {
3506
+ err = {};
3507
+ err.message = err.description = 'Mandatory params query not found in request options.';
3508
+ err = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, err);
3509
+ dfd.reject(err);
3510
+ }
3511
+ return dfd.promise;
3512
+ }
3513
+ },{"../../helpers":3,"q":88,"superagent":131}],15:[function(require,module,exports){
3461
3514
  /*************************************************************************
3462
3515
  *
3463
3516
  * COMPRO CONFIDENTIAL
@@ -3801,7 +3854,7 @@ function getUserLastAttemptForActivity(options) {
3801
3854
  return dfd.promise;
3802
3855
  }
3803
3856
 
3804
- },{"../../helpers":3,"q":89,"superagent":132}],16:[function(require,module,exports){
3857
+ },{"../../helpers":3,"q":88,"superagent":131}],16:[function(require,module,exports){
3805
3858
  /*************************************************************************
3806
3859
  *
3807
3860
  * COMPRO CONFIDENTIAL
@@ -3871,6 +3924,7 @@ function auth() {
3871
3924
  getParticularShadowClass: getParticularShadowClass.bind(this),
3872
3925
  createClassProductAssociation: createClassProductAssociation.bind(this),
3873
3926
  removeClassProductAssociation: removeClassProductAssociation.bind(this),
3927
+ createMultiClassProductAssociations: createMultiClassProductAssociations.bind(this),
3874
3928
  addItemsToShowcaseOfAClass: addItemsToShowcaseOfAClass.bind(this),
3875
3929
  deleteItemsFromShowcaseOfAClass: deleteItemsFromShowcaseOfAClass.bind(this),
3876
3930
 
@@ -4088,8 +4142,8 @@ function getAllUsers(options) {
4088
4142
  // Call GET ALL USER Api
4089
4143
  requestAPI.end(function(err, response) {
4090
4144
  if(err) {
4091
- var options = { type: helpers.errors.ERROR_TYPES.API_ERROR, err: err };
4092
- var error = converter.convertElasticsearchErrResponse(options);
4145
+ var esErrOptions = { type: helpers.errors.ERROR_TYPES.API_ERROR, err: err };
4146
+ var error = converter.convertElasticsearchErrResponse(esErrOptions);
4093
4147
  dfd.reject(error);
4094
4148
  }
4095
4149
  else {
@@ -4640,8 +4694,8 @@ function getAllClasses(options) {
4640
4694
  //Call GET ALL USER Api
4641
4695
  requestAPI.end(function(err, response) {
4642
4696
  if(err) {
4643
- var options = { type: helpers.errors.ERROR_TYPES.API_ERROR, err: err };
4644
- var error = converter.convertElasticsearchErrResponse(options);
4697
+ var esErrOptions = { type: helpers.errors.ERROR_TYPES.API_ERROR, err: err };
4698
+ var error = converter.convertElasticsearchErrResponse(esErrOptions);
4645
4699
  dfd.reject(error);
4646
4700
  } else {
4647
4701
  var responseObject = { entities: [] };
@@ -4868,6 +4922,62 @@ function removeClassProductAssociation(options) {
4868
4922
  return dfd.promise;
4869
4923
  }
4870
4924
 
4925
+ /**
4926
+ * This function creates multiple class-product associations.
4927
+ * @param options {
4928
+ * *classId : <string>,
4929
+ * *productcodes : [<string>] // Min: 1, Max: 50
4930
+ * }
4931
+ * Note: Fields marked with '*' are mandatory.
4932
+ */
4933
+ function createMultiClassProductAssociations(options) {
4934
+ var deferred = q.defer();
4935
+ var self = this;
4936
+ var error = helpers.validations.isAuthenticated(self.orgId, self.token);
4937
+
4938
+ if (error) {
4939
+ deferred.reject(error);
4940
+ } else if (options && options.classId && options.productcodes) {
4941
+ // Passed all validations, Contruct API url
4942
+ var defaultHostPath = self.config.DEFAULT_HOSTS.AUTH;
4943
+ var bulkCPAssociationAPIPath = self.config.AUTH_API_URLS.multiClassProductAssociations;
4944
+
4945
+ var url = defaultHostPath + bulkCPAssociationAPIPath;
4946
+ var bodyParams = { productcodes: options.productcodes };
4947
+
4948
+ url = helpers.api.constructAPIUrl(url, { orgId: self.orgId, classId: options.classId });
4949
+
4950
+ // Setup request with URL and Params
4951
+ var requestAPI = request.post(url)
4952
+ .set('Content-Type', 'application/json')
4953
+ .set('Accept', 'application/json')
4954
+ .send(bodyParams);
4955
+
4956
+ if (self.traceid) {
4957
+ requestAPI.set('X-Amzn-Trace-Id', self.traceid);
4958
+ }
4959
+
4960
+ // Setup token in Authorization header
4961
+ requestAPI = helpers.api.setupAPIToken(requestAPI, self.token);
4962
+
4963
+ requestAPI.end(function(err, response) {
4964
+ if (err) {
4965
+ error = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, err);
4966
+ deferred.reject(error);
4967
+ } else {
4968
+ deferred.resolve(response.body);
4969
+ }
4970
+ });
4971
+ } else {
4972
+ error = {};
4973
+ error.message = error.description = 'Missing mandaotry fields \'classId\' or \'productcodes\' in request.';
4974
+ error = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, error);
4975
+ deferred.reject(error);
4976
+ }
4977
+
4978
+ return deferred.promise;
4979
+ }
4980
+
4871
4981
  /*options = {
4872
4982
  classid: 'string'
4873
4983
  }*/
@@ -6346,7 +6456,7 @@ function deleteItemsFromShowcaseOfAClass(options){
6346
6456
  return dfd.promise;
6347
6457
  }
6348
6458
 
6349
- },{"../../helpers":3,"../../helpers/lib/api/converter":4,"q":89,"superagent":132}],17:[function(require,module,exports){
6459
+ },{"../../helpers":3,"../../helpers/lib/api/converter":4,"q":88,"superagent":131}],17:[function(require,module,exports){
6350
6460
  /*************************************************************************
6351
6461
  *
6352
6462
  * COMPRO CONFIDENTIAL
@@ -6816,7 +6926,7 @@ function updateConnectionForUser(orgid, token, config, options, action) {
6816
6926
  return dfd.promise;
6817
6927
  }
6818
6928
 
6819
- },{"../../helpers":3,"q":89,"superagent":132}],18:[function(require,module,exports){
6929
+ },{"../../helpers":3,"q":88,"superagent":131}],18:[function(require,module,exports){
6820
6930
  /*************************************************************************
6821
6931
  *
6822
6932
  * COMPRO CONFIDENTIAL
@@ -6962,7 +7072,7 @@ function getAllDocumentsInAFolder(options) {
6962
7072
  return dfd.promise;
6963
7073
  }
6964
7074
 
6965
- },{"../../helpers":3,"q":89,"superagent":132}],19:[function(require,module,exports){
7075
+ },{"../../helpers":3,"q":88,"superagent":131}],19:[function(require,module,exports){
6966
7076
  /*************************************************************************
6967
7077
  *
6968
7078
  * COMPRO CONFIDENTIAL
@@ -7069,8 +7179,8 @@ function queryDataFromSearch(options) {
7069
7179
 
7070
7180
  requestAPI.end(function (err, response) {
7071
7181
  if (err) {
7072
- var options = { type: helpers.errors.ERROR_TYPES.API_ERROR, err: err };
7073
- var error = converter.convertElasticsearchErrResponse(options);
7182
+ var esErrOptions = { type: helpers.errors.ERROR_TYPES.API_ERROR, err: err };
7183
+ var error = converter.convertElasticsearchErrResponse(esErrOptions);
7074
7184
  dfd.reject(error);
7075
7185
  }
7076
7186
  else { dfd.resolve(response.body); }
@@ -7300,7 +7410,7 @@ function publishCustomEvents(options) {
7300
7410
  return deferred.promise;
7301
7411
  }
7302
7412
 
7303
- },{"../../helpers":3,"../../helpers/lib/api/converter":4,"q":89,"superagent":132}],20:[function(require,module,exports){
7413
+ },{"../../helpers":3,"../../helpers/lib/api/converter":4,"q":88,"superagent":131}],20:[function(require,module,exports){
7304
7414
  /*************************************************************************
7305
7415
  *
7306
7416
  * COMPRO CONFIDENTIAL
@@ -7615,7 +7725,7 @@ function resendSingleInvitation(options) {
7615
7725
  return dfd.promise;
7616
7726
  }
7617
7727
 
7618
- },{"../../helpers":3,"q":89,"superagent":132}],21:[function(require,module,exports){
7728
+ },{"../../helpers":3,"q":88,"superagent":131}],21:[function(require,module,exports){
7619
7729
  /*************************************************************************
7620
7730
  *
7621
7731
  * COMPRO CONFIDENTIAL
@@ -8076,7 +8186,7 @@ function createStatement(options) {
8076
8186
  }*/
8077
8187
 
8078
8188
 
8079
- },{"../../helpers":3,"q":89,"tincanjs":133}],22:[function(require,module,exports){
8189
+ },{"../../helpers":3,"q":88,"tincanjs":133}],22:[function(require,module,exports){
8080
8190
  /*************************************************************************
8081
8191
  *
8082
8192
  * COMPRO CONFIDENTIAL
@@ -8107,7 +8217,7 @@ var helpers = require('../../helpers');
8107
8217
  var DLSError = helpers.errors.DLSError;
8108
8218
 
8109
8219
  /*********************************
8110
- * Setting Up Module Entry Point
8220
+ * Setting Up Module Entry Point
8111
8221
  **********************************/
8112
8222
  module.exports = product;
8113
8223
 
@@ -8119,7 +8229,10 @@ function product(accountId) {
8119
8229
  getMicroEntitlementsForAUser: getMicroEntitlementsForAUser.bind(this),
8120
8230
 
8121
8231
  getAllBundles: getAllBundles.bind(this),
8122
- getSingleBundle: getSingleBundle.bind(this)
8232
+ getSingleBundle: getSingleBundle.bind(this),
8233
+
8234
+ getSingleProductFamily: getSingleProductFamily.bind(this),
8235
+ getAllProductFamilies: getAllProductFamilies.bind(this)
8123
8236
  };
8124
8237
  }
8125
8238
 
@@ -8344,8 +8457,84 @@ function getSingleBundle(options) {
8344
8457
 
8345
8458
  return dfd.promise;
8346
8459
  }
8460
+
8461
+ // options= {
8462
+ // stage: "", //stage number
8463
+ // }
8464
+ function getAllProductFamilies(options) {
8465
+ var self = this;
8466
+ var dfd = q.defer();
8467
+
8468
+ //Passed all validations, Construct API url
8469
+ var url = self.config.DEFAULT_HOSTS.PRODUCT + self.config.PRODUCT_API_URLS.getAllProductFamilies;
8470
+
8471
+ url = helpers.api.constructAPIUrl(url, { accountId: self.accountId });
8472
+ //Contruct parameters
8473
+ var params = {};
8474
+ if (options && options.stage) { params.stage = options.stage; }
8475
+
8476
+ //Setup request with URL and Post data
8477
+ var requestAPI = request.get(url).query(params);
8478
+ if (self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
8479
+
8480
+ requestAPI.end(function (err, response) {
8481
+ if (err) {
8482
+ err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, err);
8483
+ dfd.reject(err);
8484
+ } else {
8485
+ dfd.resolve(response.body);
8486
+ }
8487
+ });
8488
+
8489
+ return dfd.promise;
8490
+ }
8491
+
8492
+ // options = {
8493
+ // 'family-code': "", //product-family identifier
8494
+ // stage: "", //stage number
8495
+ // }
8496
+ function getSingleProductFamily(options) {
8497
+ var self = this;
8498
+ var dfd = q.defer();
8499
+ var err;
8500
+
8501
+ if (options && options['family-code']) {
8502
+
8503
+ var url = self.config.DEFAULT_HOSTS.PRODUCT +
8504
+ self.config.PRODUCT_API_URLS.getSingleProductFamily;
8505
+
8506
+ url = helpers.api.constructAPIUrl(url, {
8507
+ accountId: self.accountId, familyCode: options['family-code']
8508
+ });
8509
+
8510
+ //Contruct parameters
8511
+ var params = {};
8512
+ if (options.stage) { params.stage = options.stage; }
8513
+
8514
+ //Setup request with URL and Post data
8515
+ var requestAPI = request.get(url).query(params);
8516
+ if (self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
8517
+
8518
+ requestAPI.end(function (err, response) {
8519
+ if (err) {
8520
+ err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, err);
8521
+ dfd.reject(err);
8522
+ } else {
8523
+ dfd.resolve(response.body);
8524
+ }
8525
+ });
8526
+ }
8527
+ else {
8528
+ err = {};
8529
+ err.message = err.description = 'Required parameter family-code not found in request options';
8530
+ err = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, err);
8531
+ dfd.reject(err);
8532
+ }
8533
+
8534
+ return dfd.promise;
8535
+ }
8347
8536
 
8348
- },{"../../helpers":3,"q":89,"superagent":132}],23:[function(require,module,exports){
8537
+ },{"../../helpers":3,"q":88,"superagent":131}],23:[function(require,module,exports){
8349
8538
  /*************************************************************************
8350
8539
  *
8351
8540
  * COMPRO CONFIDENTIAL
@@ -8389,7 +8578,11 @@ function pub() {
8389
8578
  "createBundle": createBundle.bind(this),
8390
8579
  "updateBundle": updateBundle.bind(this),
8391
8580
  "getAllBundles": getAllBundles.bind(this),
8392
- "getSingleBundle": getSingleBundle.bind(this)
8581
+ "getSingleBundle": getSingleBundle.bind(this),
8582
+ "createProductFamily": createProductFamily.bind(this),
8583
+ "updateProductFamily": updateProductFamily.bind(this),
8584
+ "getSingleProductFamily": getSingleProductFamily.bind(this),
8585
+ "getAllProductFamilies": getAllProductFamilies.bind(this)
8393
8586
  };
8394
8587
  }
8395
8588
 
@@ -8753,8 +8946,187 @@ function getSingleBundle(options) {
8753
8946
 
8754
8947
  return dfd.promise;
8755
8948
  }
8949
+
8950
+ // options = {
8951
+ // "stage": <>, // Mandatory
8952
+ // "body": {
8953
+ // "family-code": "string", // Mandatory
8954
+ // "ext_user_id": "string", // Optional
8955
+ // "assets": { // Optional
8956
+ // "branchref": "string", // Mandatory
8957
+ // "bucket": "string" // Mandatory
8958
+ // },
8959
+ // "externalrefid": "string", // Optional
8960
+ // "data": {... } // Optional
8961
+ // }
8962
+ // }
8963
+ function createProductFamily(options) {
8964
+ var self = this;
8965
+ //Initializing promise
8966
+ var dfd = q.defer();
8967
+ var err;
8968
+ //Validations
8969
+ if (options && options.stage && options.body && options.body['family-code'])
8970
+ {
8971
+ //Passed all validations, Construct API url
8972
+ var url = self.config.DEFAULT_HOSTS['PUB'] + self.config.PUB_API_URLS.createProductFamily;
8973
+ url = helpers.api.constructAPIUrl(url, { orgid: self.orgId, stage: options.stage });
8974
+
8975
+ //Setup request with URL and Post data
8976
+ var requestAPI = request.post(url).send(options.body);
8977
+
8978
+ if(self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
8979
+
8980
+ requestAPI.end(function (err, response) {
8981
+ if(err) {
8982
+ err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, err);
8983
+ dfd.reject(err);
8984
+ } else {
8985
+ dfd.resolve(response.body);
8986
+ }
8987
+ });
8988
+ }
8989
+ else {
8990
+ err = {};
8991
+ err.message = err.description = 'Required parameter stage or family-code ' +
8992
+ 'not found in request options';
8993
+ err = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, err);
8994
+ dfd.reject(err);
8995
+ }
8996
+ return dfd.promise;
8997
+ }
8998
+
8999
+ // options = {
9000
+ // "stage": <>, // Mandatory
9001
+ // "family-code": <>, // Mandatory
9002
+ // "body": {
9003
+ // "ext_user_id": "string", // Optional
9004
+ // "assets": { // Optional
9005
+ // "branchref": "string", // Mandatory
9006
+ // "bucket": "string" // Mandatory
9007
+ // },
9008
+ // "externalrefid": "string", // Optional
9009
+ // "data": {... } // Optional
9010
+ // }
9011
+ // }
9012
+ function updateProductFamily(options) {
9013
+ var self = this;
9014
+
9015
+ //Initializing promise
9016
+ var dfd = q.defer();
9017
+ var err;
9018
+
9019
+ //Validations
9020
+ if (options && options.stage && options['family-code']) {
9021
+ //Passed all validations, Construct API url
9022
+ var url = self.config.DEFAULT_HOSTS['PUB'] + self.config.PUB_API_URLS.updateProductFamily;
9023
+ url = helpers.api.constructAPIUrl(url, {
9024
+ orgid: self.orgId, stage: options.stage, familyCode: options['family-code']
9025
+ });
9026
+
9027
+ //Setup request with URL and Post data
9028
+ var requestAPI = request.put(url).send(options.body);
9029
+
9030
+ if(self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
9031
+ requestAPI.end(function (err, response) {
9032
+ if(err) {
9033
+ err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, err);
9034
+ dfd.reject(err);
9035
+ } else {
9036
+ dfd.resolve(response.body);
9037
+ }
9038
+ });
9039
+ }
9040
+ else {
9041
+ err = {};
9042
+ err.message = err.description = 'Required parameter stage or family-code ' +
9043
+ 'not found in request options';
9044
+ err = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, err);
9045
+ dfd.reject(err);
9046
+ }
9047
+ return dfd.promise;
9048
+ }
9049
+
9050
+ /**
9051
+ * options = {
9052
+ * "family-code": "", //product family identifier, Mandatory
9053
+ * "stage" : "", //stage number
9054
+ * }
9055
+ */
9056
+ function getSingleProductFamily(options) {
9057
+ var self = this;
9058
+ var dfd = q.defer();
9059
+
9060
+ //Validations
9061
+ var err;
9062
+ if(options && options['family-code']) {
9063
+ //Passed all validations, Construct API url
9064
+ var url = self.config.DEFAULT_HOSTS['PUB'] + self.config.PUB_API_URLS.getSingleProductFamily;
9065
+ url = helpers.api.constructAPIUrl(url, {
9066
+ orgid: self.orgId, familyCode: options['family-code']
9067
+ });
9068
+
9069
+ //Contruct parameters
9070
+ var params = {};
9071
+ if(options.stage) { params.stage = options.stage; }
9072
+
9073
+ //Setup request with URL and Post data
9074
+ var requestAPI = request.get(url).query(params);
9075
+ if(self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
9076
+
9077
+ requestAPI.end(function (err, response) {
9078
+ if(err) {
9079
+ err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, err);
9080
+ dfd.reject(err);
9081
+ } else {
9082
+ dfd.resolve(response.body);
9083
+ }
9084
+ });
9085
+ }
9086
+ else {
9087
+ err = {};
9088
+ err.message = err.description = 'Required parameter family-code not found in request options';
9089
+ err = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, err);
9090
+ dfd.reject(err);
9091
+ }
9092
+
9093
+ return dfd.promise;
9094
+ }
9095
+
9096
+ /**
9097
+ * options = {
9098
+ * "stage": <>, // Optional
9099
+ * }
9100
+ */
9101
+ function getAllProductFamilies(options) {
9102
+ var self = this;
9103
+ //Initializing promise
9104
+ var dfd = q.defer();
9105
+
9106
+ //Construct API url
9107
+ var url = self.config.DEFAULT_HOSTS['PUB'] + self.config.PUB_API_URLS.getAllProductFamilies;
9108
+
9109
+ url = helpers.api.constructAPIUrl(url, { orgid: self.orgId, });
9110
+ //Contruct parameters
9111
+ var params = {};
9112
+ if(options && options.stage) { params.stage = options.stage; }
9113
+
9114
+ //Setup request with URL and Post data
9115
+ var requestAPI = request.get(url).query(params);
9116
+
9117
+ if(self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
9118
+ requestAPI.end(function (err, response) {
9119
+ if(err) {
9120
+ err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, err);
9121
+ dfd.reject(err);
9122
+ } else {
9123
+ dfd.resolve(response.body);
9124
+ }
9125
+ });
9126
+ return dfd.promise;
9127
+ }
8756
9128
 
8757
- },{"../../helpers":3,"q":89,"superagent":132}],24:[function(require,module,exports){
9129
+ },{"../../helpers":3,"q":88,"superagent":131}],24:[function(require,module,exports){
8758
9130
  /*************************************************************************
8759
9131
  *
8760
9132
  * COMPRO CONFIDENTIAL
@@ -8946,7 +9318,7 @@ function grantByAccountIdOnExtUserId(options) {
8946
9318
  }
8947
9319
 
8948
9320
 
8949
- },{"../../helpers":3,"./pubnubClientWrapper":25,"q":89,"superagent":132}],25:[function(require,module,exports){
9321
+ },{"../../helpers":3,"./pubnubClientWrapper":25,"q":88,"superagent":131}],25:[function(require,module,exports){
8950
9322
  var pubNub = require("pubnub");
8951
9323
  var EventEmitter = require("events").EventEmitter;
8952
9324
  var helpers = require('../../helpers');
@@ -9159,7 +9531,7 @@ module.exports = function () {
9159
9531
 
9160
9532
  }; //End of Client Wrapper module
9161
9533
 
9162
- },{"../../helpers":3,"events":65,"pubnub":87}],26:[function(require,module,exports){
9534
+ },{"../../helpers":3,"events":64,"pubnub":86}],26:[function(require,module,exports){
9163
9535
  /*************************************************************************
9164
9536
  *
9165
9537
  * COMPRO CONFIDENTIAL
@@ -9348,7 +9720,7 @@ function _setup(orgId, userId) {
9348
9720
  return dfd.promise;
9349
9721
  }
9350
9722
 
9351
- },{"../../helpers":3,"events":65,"q":89,"socket.io-client":108}],27:[function(require,module,exports){
9723
+ },{"../../helpers":3,"events":64,"q":88,"socket.io-client":107}],27:[function(require,module,exports){
9352
9724
  /*************************************************************************
9353
9725
  *
9354
9726
  * COMPRO CONFIDENTIAL
@@ -9463,7 +9835,7 @@ function postSISEvent(options) {
9463
9835
  return dfd.promise;
9464
9836
  }
9465
9837
 
9466
- },{"../../helpers":3,"q":89,"superagent":132,"underscore":135}],28:[function(require,module,exports){
9838
+ },{"../../helpers":3,"q":88,"superagent":131,"underscore":135}],28:[function(require,module,exports){
9467
9839
  /*************************************************************************
9468
9840
  *
9469
9841
  * COMPRO CONFIDENTIAL
@@ -10452,7 +10824,7 @@ function getInvitationsByEmail(options) {
10452
10824
  return dfd.promise;
10453
10825
  }
10454
10826
 
10455
- },{"../../helpers":3,"q":89,"superagent":132}],29:[function(require,module,exports){
10827
+ },{"../../helpers":3,"q":88,"superagent":131}],29:[function(require,module,exports){
10456
10828
  /*************************************************************************
10457
10829
  *
10458
10830
  * COMPRO CONFIDENTIAL
@@ -10629,7 +11001,7 @@ function provisionSpacesToSuperAdmin(options) {
10629
11001
  return dfd.promise;
10630
11002
  }
10631
11003
 
10632
- },{"../../helpers":3,"q":89,"superagent":132}],30:[function(require,module,exports){
11004
+ },{"../../helpers":3,"q":88,"superagent":131}],30:[function(require,module,exports){
10633
11005
  /*************************************************************************
10634
11006
  *
10635
11007
  * COMPRO CONFIDENTIAL
@@ -11095,7 +11467,7 @@ function updateWorkflowRequest(options) {
11095
11467
  }
11096
11468
  return dfd.promise;
11097
11469
  }
11098
- },{"./../../helpers":3,"q":89,"superagent":132}],31:[function(require,module,exports){
11470
+ },{"./../../helpers":3,"q":88,"superagent":131}],31:[function(require,module,exports){
11099
11471
  /*************************************************************************
11100
11472
  *
11101
11473
  * COMPRO CONFIDENTIAL
@@ -11329,7 +11701,7 @@ function postExternalStatements(options) {
11329
11701
  return dfd.promise;
11330
11702
  }
11331
11703
 
11332
- },{"../../helpers":3,"q":89,"superagent":132}],32:[function(require,module,exports){
11704
+ },{"../../helpers":3,"q":88,"superagent":131}],32:[function(require,module,exports){
11333
11705
  /*************************************************************************
11334
11706
  *
11335
11707
  * COMPRO CONFIDENTIAL
@@ -11445,7 +11817,7 @@ function authWithToken(organizationId, token, options) {
11445
11817
  return dfd.promise;
11446
11818
  };
11447
11819
 
11448
- },{"../helpers":3,"./validations":33,"q":89,"superagent":132}],33:[function(require,module,exports){
11820
+ },{"../helpers":3,"./validations":33,"q":88,"superagent":131}],33:[function(require,module,exports){
11449
11821
  /*************************************************************************
11450
11822
  *
11451
11823
  * COMPRO CONFIDENTIAL
@@ -11977,7 +12349,7 @@ module.exports = (function() {
11977
12349
  /*!
11978
12350
  * The buffer module from node.js, for the browser.
11979
12351
  *
11980
- * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
12352
+ * @author Feross Aboukhadijeh <http://feross.org>
11981
12353
  * @license MIT
11982
12354
  */
11983
12355
  /* eslint-disable no-proto */
@@ -13524,7 +13896,7 @@ function blitBuffer (src, dst, offset, length) {
13524
13896
  }
13525
13897
 
13526
13898
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
13527
- },{"base64-js":38,"ieee754":72,"isarray":76}],42:[function(require,module,exports){
13899
+ },{"base64-js":38,"ieee754":71,"isarray":75}],42:[function(require,module,exports){
13528
13900
  module.exports = {
13529
13901
  "100": "Continue",
13530
13902
  "101": "Switching Protocols",
@@ -13611,171 +13983,6 @@ module.exports = function(obj, fn){
13611
13983
  };
13612
13984
 
13613
13985
  },{}],44:[function(require,module,exports){
13614
-
13615
- /**
13616
- * Expose `Emitter`.
13617
- */
13618
-
13619
- if (typeof module !== 'undefined') {
13620
- module.exports = Emitter;
13621
- }
13622
-
13623
- /**
13624
- * Initialize a new `Emitter`.
13625
- *
13626
- * @api public
13627
- */
13628
-
13629
- function Emitter(obj) {
13630
- if (obj) return mixin(obj);
13631
- };
13632
-
13633
- /**
13634
- * Mixin the emitter properties.
13635
- *
13636
- * @param {Object} obj
13637
- * @return {Object}
13638
- * @api private
13639
- */
13640
-
13641
- function mixin(obj) {
13642
- for (var key in Emitter.prototype) {
13643
- obj[key] = Emitter.prototype[key];
13644
- }
13645
- return obj;
13646
- }
13647
-
13648
- /**
13649
- * Listen on the given `event` with `fn`.
13650
- *
13651
- * @param {String} event
13652
- * @param {Function} fn
13653
- * @return {Emitter}
13654
- * @api public
13655
- */
13656
-
13657
- Emitter.prototype.on =
13658
- Emitter.prototype.addEventListener = function(event, fn){
13659
- this._callbacks = this._callbacks || {};
13660
- (this._callbacks['$' + event] = this._callbacks['$' + event] || [])
13661
- .push(fn);
13662
- return this;
13663
- };
13664
-
13665
- /**
13666
- * Adds an `event` listener that will be invoked a single
13667
- * time then automatically removed.
13668
- *
13669
- * @param {String} event
13670
- * @param {Function} fn
13671
- * @return {Emitter}
13672
- * @api public
13673
- */
13674
-
13675
- Emitter.prototype.once = function(event, fn){
13676
- function on() {
13677
- this.off(event, on);
13678
- fn.apply(this, arguments);
13679
- }
13680
-
13681
- on.fn = fn;
13682
- this.on(event, on);
13683
- return this;
13684
- };
13685
-
13686
- /**
13687
- * Remove the given callback for `event` or all
13688
- * registered callbacks.
13689
- *
13690
- * @param {String} event
13691
- * @param {Function} fn
13692
- * @return {Emitter}
13693
- * @api public
13694
- */
13695
-
13696
- Emitter.prototype.off =
13697
- Emitter.prototype.removeListener =
13698
- Emitter.prototype.removeAllListeners =
13699
- Emitter.prototype.removeEventListener = function(event, fn){
13700
- this._callbacks = this._callbacks || {};
13701
-
13702
- // all
13703
- if (0 == arguments.length) {
13704
- this._callbacks = {};
13705
- return this;
13706
- }
13707
-
13708
- // specific event
13709
- var callbacks = this._callbacks['$' + event];
13710
- if (!callbacks) return this;
13711
-
13712
- // remove all handlers
13713
- if (1 == arguments.length) {
13714
- delete this._callbacks['$' + event];
13715
- return this;
13716
- }
13717
-
13718
- // remove specific handler
13719
- var cb;
13720
- for (var i = 0; i < callbacks.length; i++) {
13721
- cb = callbacks[i];
13722
- if (cb === fn || cb.fn === fn) {
13723
- callbacks.splice(i, 1);
13724
- break;
13725
- }
13726
- }
13727
- return this;
13728
- };
13729
-
13730
- /**
13731
- * Emit `event` with the given args.
13732
- *
13733
- * @param {String} event
13734
- * @param {Mixed} ...
13735
- * @return {Emitter}
13736
- */
13737
-
13738
- Emitter.prototype.emit = function(event){
13739
- this._callbacks = this._callbacks || {};
13740
- var args = [].slice.call(arguments, 1)
13741
- , callbacks = this._callbacks['$' + event];
13742
-
13743
- if (callbacks) {
13744
- callbacks = callbacks.slice(0);
13745
- for (var i = 0, len = callbacks.length; i < len; ++i) {
13746
- callbacks[i].apply(this, args);
13747
- }
13748
- }
13749
-
13750
- return this;
13751
- };
13752
-
13753
- /**
13754
- * Return array of callbacks for `event`.
13755
- *
13756
- * @param {String} event
13757
- * @return {Array}
13758
- * @api public
13759
- */
13760
-
13761
- Emitter.prototype.listeners = function(event){
13762
- this._callbacks = this._callbacks || {};
13763
- return this._callbacks['$' + event] || [];
13764
- };
13765
-
13766
- /**
13767
- * Check if this emitter has `event` handlers.
13768
- *
13769
- * @param {String} event
13770
- * @return {Boolean}
13771
- * @api public
13772
- */
13773
-
13774
- Emitter.prototype.hasListeners = function(event){
13775
- return !! this.listeners(event).length;
13776
- };
13777
-
13778
- },{}],45:[function(require,module,exports){
13779
13986
 
13780
13987
  module.exports = function(a, b){
13781
13988
  var fn = function(){};
@@ -13783,7 +13990,7 @@ module.exports = function(a, b){
13783
13990
  a.prototype = new fn;
13784
13991
  a.prototype.constructor = a;
13785
13992
  };
13786
- },{}],46:[function(require,module,exports){
13993
+ },{}],45:[function(require,module,exports){
13787
13994
  (function (Buffer){
13788
13995
  // Copyright Joyent, Inc. and other Node contributors.
13789
13996
  //
@@ -13894,11 +14101,11 @@ function objectToString(o) {
13894
14101
  }
13895
14102
 
13896
14103
  }).call(this,{"isBuffer":require("../../is-buffer/index.js")})
13897
- },{"../../is-buffer/index.js":75}],47:[function(require,module,exports){
14104
+ },{"../../is-buffer/index.js":74}],46:[function(require,module,exports){
13898
14105
 
13899
14106
  module.exports = require('./lib/');
13900
14107
 
13901
- },{"./lib/":48}],48:[function(require,module,exports){
14108
+ },{"./lib/":47}],47:[function(require,module,exports){
13902
14109
 
13903
14110
  module.exports = require('./socket');
13904
14111
 
@@ -13910,7 +14117,7 @@ module.exports = require('./socket');
13910
14117
  */
13911
14118
  module.exports.parser = require('engine.io-parser');
13912
14119
 
13913
- },{"./socket":49,"engine.io-parser":61}],49:[function(require,module,exports){
14120
+ },{"./socket":48,"engine.io-parser":60}],48:[function(require,module,exports){
13914
14121
  (function (global){
13915
14122
  /**
13916
14123
  * Module dependencies.
@@ -14642,7 +14849,7 @@ Socket.prototype.filterUpgrades = function (upgrades) {
14642
14849
  };
14643
14850
 
14644
14851
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
14645
- },{"./transport":50,"./transports":51,"component-emitter":57,"debug":58,"engine.io-parser":61,"indexof":73,"parsejson":82,"parseqs":83,"parseuri":84}],50:[function(require,module,exports){
14852
+ },{"./transport":49,"./transports":50,"component-emitter":56,"debug":57,"engine.io-parser":60,"indexof":72,"parsejson":81,"parseqs":82,"parseuri":83}],49:[function(require,module,exports){
14646
14853
  /**
14647
14854
  * Module dependencies.
14648
14855
  */
@@ -14799,7 +15006,7 @@ Transport.prototype.onClose = function () {
14799
15006
  this.emit('close');
14800
15007
  };
14801
15008
 
14802
- },{"component-emitter":57,"engine.io-parser":61}],51:[function(require,module,exports){
15009
+ },{"component-emitter":56,"engine.io-parser":60}],50:[function(require,module,exports){
14803
15010
  (function (global){
14804
15011
  /**
14805
15012
  * Module dependencies
@@ -14856,7 +15063,7 @@ function polling(opts){
14856
15063
  }
14857
15064
 
14858
15065
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
14859
- },{"./polling-jsonp":52,"./polling-xhr":53,"./websocket":55,"xmlhttprequest-ssl":56}],52:[function(require,module,exports){
15066
+ },{"./polling-jsonp":51,"./polling-xhr":52,"./websocket":54,"xmlhttprequest-ssl":55}],51:[function(require,module,exports){
14860
15067
  (function (global){
14861
15068
 
14862
15069
  /**
@@ -15098,7 +15305,7 @@ JSONPPolling.prototype.doWrite = function (data, fn) {
15098
15305
  };
15099
15306
 
15100
15307
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
15101
- },{"./polling":54,"component-inherit":45}],53:[function(require,module,exports){
15308
+ },{"./polling":53,"component-inherit":44}],52:[function(require,module,exports){
15102
15309
  (function (global){
15103
15310
  /**
15104
15311
  * Module requirements.
@@ -15514,7 +15721,7 @@ function unloadHandler() {
15514
15721
  }
15515
15722
 
15516
15723
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
15517
- },{"./polling":54,"component-emitter":57,"component-inherit":45,"debug":58,"xmlhttprequest-ssl":56}],54:[function(require,module,exports){
15724
+ },{"./polling":53,"component-emitter":56,"component-inherit":44,"debug":57,"xmlhttprequest-ssl":55}],53:[function(require,module,exports){
15518
15725
  /**
15519
15726
  * Module dependencies.
15520
15727
  */
@@ -15763,7 +15970,7 @@ Polling.prototype.uri = function(){
15763
15970
  return schema + '://' + (ipv6 ? '[' + this.hostname + ']' : this.hostname) + port + this.path + query;
15764
15971
  };
15765
15972
 
15766
- },{"../transport":50,"component-inherit":45,"debug":58,"engine.io-parser":61,"parseqs":83,"xmlhttprequest-ssl":56,"yeast":142}],55:[function(require,module,exports){
15973
+ },{"../transport":49,"component-inherit":44,"debug":57,"engine.io-parser":60,"parseqs":82,"xmlhttprequest-ssl":55,"yeast":142}],54:[function(require,module,exports){
15767
15974
  (function (global){
15768
15975
  /**
15769
15976
  * Module dependencies.
@@ -16055,7 +16262,7 @@ WS.prototype.check = function(){
16055
16262
  };
16056
16263
 
16057
16264
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
16058
- },{"../transport":50,"component-inherit":45,"debug":58,"engine.io-parser":61,"parseqs":83,"ws":40,"yeast":142}],56:[function(require,module,exports){
16265
+ },{"../transport":49,"component-inherit":44,"debug":57,"engine.io-parser":60,"parseqs":82,"ws":40,"yeast":142}],55:[function(require,module,exports){
16059
16266
  // browser shim for xmlhttprequest module
16060
16267
  var hasCORS = require('has-cors');
16061
16268
 
@@ -16093,7 +16300,7 @@ module.exports = function(opts) {
16093
16300
  }
16094
16301
  }
16095
16302
 
16096
- },{"has-cors":70}],57:[function(require,module,exports){
16303
+ },{"has-cors":69}],56:[function(require,module,exports){
16097
16304
 
16098
16305
  /**
16099
16306
  * Expose `Emitter`.
@@ -16259,7 +16466,7 @@ Emitter.prototype.hasListeners = function(event){
16259
16466
  return !! this.listeners(event).length;
16260
16467
  };
16261
16468
 
16262
- },{}],58:[function(require,module,exports){
16469
+ },{}],57:[function(require,module,exports){
16263
16470
 
16264
16471
  /**
16265
16472
  * This is the web browser implementation of `debug()`.
@@ -16429,7 +16636,7 @@ function localstorage(){
16429
16636
  } catch (e) {}
16430
16637
  }
16431
16638
 
16432
- },{"./debug":59}],59:[function(require,module,exports){
16639
+ },{"./debug":58}],58:[function(require,module,exports){
16433
16640
 
16434
16641
  /**
16435
16642
  * This is the common logic for both the Node.js and web browser
@@ -16628,7 +16835,7 @@ function coerce(val) {
16628
16835
  return val;
16629
16836
  }
16630
16837
 
16631
- },{"ms":60}],60:[function(require,module,exports){
16838
+ },{"ms":59}],59:[function(require,module,exports){
16632
16839
  /**
16633
16840
  * Helpers.
16634
16841
  */
@@ -16755,7 +16962,7 @@ function plural(ms, n, name) {
16755
16962
  return Math.ceil(ms / n) + ' ' + name + 's';
16756
16963
  }
16757
16964
 
16758
- },{}],61:[function(require,module,exports){
16965
+ },{}],60:[function(require,module,exports){
16759
16966
  (function (global){
16760
16967
  /**
16761
16968
  * Module dependencies.
@@ -17353,7 +17560,7 @@ exports.decodePayloadAsBinary = function (data, binaryType, callback) {
17353
17560
  };
17354
17561
 
17355
17562
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
17356
- },{"./keys":62,"after":34,"arraybuffer.slice":35,"base64-arraybuffer":37,"blob":39,"has-binary":63,"utf8":137}],62:[function(require,module,exports){
17563
+ },{"./keys":61,"after":34,"arraybuffer.slice":35,"base64-arraybuffer":37,"blob":39,"has-binary":62,"utf8":137}],61:[function(require,module,exports){
17357
17564
 
17358
17565
  /**
17359
17566
  * Gets the keys for an object.
@@ -17374,7 +17581,7 @@ module.exports = Object.keys || function keys (obj){
17374
17581
  return arr;
17375
17582
  };
17376
17583
 
17377
- },{}],63:[function(require,module,exports){
17584
+ },{}],62:[function(require,module,exports){
17378
17585
  (function (global){
17379
17586
 
17380
17587
  /*
@@ -17436,12 +17643,12 @@ function hasBinary(data) {
17436
17643
  }
17437
17644
 
17438
17645
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
17439
- },{"isarray":64}],64:[function(require,module,exports){
17646
+ },{"isarray":63}],63:[function(require,module,exports){
17440
17647
  module.exports = Array.isArray || function (arr) {
17441
17648
  return Object.prototype.toString.call(arr) == '[object Array]';
17442
17649
  };
17443
17650
 
17444
- },{}],65:[function(require,module,exports){
17651
+ },{}],64:[function(require,module,exports){
17445
17652
  // Copyright Joyent, Inc. and other Node contributors.
17446
17653
  //
17447
17654
  // Permission is hereby granted, free of charge, to any person obtaining a
@@ -17744,7 +17951,7 @@ function isUndefined(arg) {
17744
17951
  return arg === void 0;
17745
17952
  }
17746
17953
 
17747
- },{}],66:[function(require,module,exports){
17954
+ },{}],65:[function(require,module,exports){
17748
17955
  var hasOwn = Object.prototype.hasOwnProperty;
17749
17956
  var toStr = Object.prototype.toString;
17750
17957
  var defineProperty = Object.defineProperty;
@@ -17865,7 +18072,7 @@ module.exports = function extend() {
17865
18072
  return target;
17866
18073
  };
17867
18074
 
17868
- },{}],67:[function(require,module,exports){
18075
+ },{}],66:[function(require,module,exports){
17869
18076
 
17870
18077
  var hasOwn = Object.prototype.hasOwnProperty;
17871
18078
  var toString = Object.prototype.toString;
@@ -17889,7 +18096,7 @@ module.exports = function forEach (obj, fn, ctx) {
17889
18096
  };
17890
18097
 
17891
18098
 
17892
- },{}],68:[function(require,module,exports){
18099
+ },{}],67:[function(require,module,exports){
17893
18100
  (function (global){
17894
18101
 
17895
18102
  /*
@@ -17952,9 +18159,9 @@ function hasBinary(data) {
17952
18159
  }
17953
18160
 
17954
18161
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
17955
- },{"isarray":69}],69:[function(require,module,exports){
17956
- arguments[4][64][0].apply(exports,arguments)
17957
- },{"dup":64}],70:[function(require,module,exports){
18162
+ },{"isarray":68}],68:[function(require,module,exports){
18163
+ arguments[4][63][0].apply(exports,arguments)
18164
+ },{"dup":63}],69:[function(require,module,exports){
17958
18165
 
17959
18166
  /**
17960
18167
  * Module exports.
@@ -17973,7 +18180,7 @@ try {
17973
18180
  module.exports = false;
17974
18181
  }
17975
18182
 
17976
- },{}],71:[function(require,module,exports){
18183
+ },{}],70:[function(require,module,exports){
17977
18184
  var http = require('http');
17978
18185
 
17979
18186
  var https = module.exports;
@@ -17989,7 +18196,8 @@ https.request = function (params, cb) {
17989
18196
  return http.request.call(this, params, cb);
17990
18197
  }
17991
18198
 
17992
- },{"http":126}],72:[function(require,module,exports){
18199
+ },{"http":125}],71:[function(require,module,exports){
18200
+ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
17993
18201
  exports.read = function (buffer, offset, isLE, mLen, nBytes) {
17994
18202
  var e, m
17995
18203
  var eLen = (nBytes * 8) - mLen - 1
@@ -18075,7 +18283,7 @@ exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
18075
18283
  buffer[offset + i - d] |= s * 128
18076
18284
  }
18077
18285
 
18078
- },{}],73:[function(require,module,exports){
18286
+ },{}],72:[function(require,module,exports){
18079
18287
 
18080
18288
  var indexOf = [].indexOf;
18081
18289
 
@@ -18086,32 +18294,36 @@ module.exports = function(arr, obj){
18086
18294
  }
18087
18295
  return -1;
18088
18296
  };
18089
- },{}],74:[function(require,module,exports){
18297
+ },{}],73:[function(require,module,exports){
18090
18298
  if (typeof Object.create === 'function') {
18091
18299
  // implementation from standard node.js 'util' module
18092
18300
  module.exports = function inherits(ctor, superCtor) {
18093
- ctor.super_ = superCtor
18094
- ctor.prototype = Object.create(superCtor.prototype, {
18095
- constructor: {
18096
- value: ctor,
18097
- enumerable: false,
18098
- writable: true,
18099
- configurable: true
18100
- }
18101
- });
18301
+ if (superCtor) {
18302
+ ctor.super_ = superCtor
18303
+ ctor.prototype = Object.create(superCtor.prototype, {
18304
+ constructor: {
18305
+ value: ctor,
18306
+ enumerable: false,
18307
+ writable: true,
18308
+ configurable: true
18309
+ }
18310
+ })
18311
+ }
18102
18312
  };
18103
18313
  } else {
18104
18314
  // old school shim for old browsers
18105
18315
  module.exports = function inherits(ctor, superCtor) {
18106
- ctor.super_ = superCtor
18107
- var TempCtor = function () {}
18108
- TempCtor.prototype = superCtor.prototype
18109
- ctor.prototype = new TempCtor()
18110
- ctor.prototype.constructor = ctor
18316
+ if (superCtor) {
18317
+ ctor.super_ = superCtor
18318
+ var TempCtor = function () {}
18319
+ TempCtor.prototype = superCtor.prototype
18320
+ ctor.prototype = new TempCtor()
18321
+ ctor.prototype.constructor = ctor
18322
+ }
18111
18323
  }
18112
18324
  }
18113
18325
 
18114
- },{}],75:[function(require,module,exports){
18326
+ },{}],74:[function(require,module,exports){
18115
18327
  /*!
18116
18328
  * Determine if an object is a Buffer
18117
18329
  *
@@ -18134,14 +18346,14 @@ function isSlowBuffer (obj) {
18134
18346
  return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))
18135
18347
  }
18136
18348
 
18137
- },{}],76:[function(require,module,exports){
18349
+ },{}],75:[function(require,module,exports){
18138
18350
  var toString = {}.toString;
18139
18351
 
18140
18352
  module.exports = Array.isArray || function (arr) {
18141
18353
  return toString.call(arr) == '[object Array]';
18142
18354
  };
18143
18355
 
18144
- },{}],77:[function(require,module,exports){
18356
+ },{}],76:[function(require,module,exports){
18145
18357
  (function (global){
18146
18358
  /*! JSON v3.3.2 | http://bestiejs.github.io/json3 | Copyright 2012-2014, Kit Cambridge | http://kit.mit-license.org */
18147
18359
  ;(function () {
@@ -19047,7 +19259,7 @@ module.exports = Array.isArray || function (arr) {
19047
19259
  }).call(this);
19048
19260
 
19049
19261
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
19050
- },{}],78:[function(require,module,exports){
19262
+ },{}],77:[function(require,module,exports){
19051
19263
  'use strict';
19052
19264
 
19053
19265
  var keysShim;
@@ -19081,6 +19293,8 @@ if (!Object.keys) {
19081
19293
  $frames: true,
19082
19294
  $innerHeight: true,
19083
19295
  $innerWidth: true,
19296
+ $onmozfullscreenchange: true,
19297
+ $onmozfullscreenerror: true,
19084
19298
  $outerHeight: true,
19085
19299
  $outerWidth: true,
19086
19300
  $pageXOffset: true,
@@ -19169,7 +19383,7 @@ if (!Object.keys) {
19169
19383
  }
19170
19384
  module.exports = keysShim;
19171
19385
 
19172
- },{"./isArguments":80}],79:[function(require,module,exports){
19386
+ },{"./isArguments":79}],78:[function(require,module,exports){
19173
19387
  'use strict';
19174
19388
 
19175
19389
  var slice = Array.prototype.slice;
@@ -19203,7 +19417,7 @@ keysShim.shim = function shimObjectKeys() {
19203
19417
 
19204
19418
  module.exports = keysShim;
19205
19419
 
19206
- },{"./implementation":78,"./isArguments":80}],80:[function(require,module,exports){
19420
+ },{"./implementation":77,"./isArguments":79}],79:[function(require,module,exports){
19207
19421
  'use strict';
19208
19422
 
19209
19423
  var toStr = Object.prototype.toString;
@@ -19222,7 +19436,7 @@ module.exports = function isArguments(value) {
19222
19436
  return isArgs;
19223
19437
  };
19224
19438
 
19225
- },{}],81:[function(require,module,exports){
19439
+ },{}],80:[function(require,module,exports){
19226
19440
  exports.endianness = function () { return 'LE' };
19227
19441
 
19228
19442
  exports.hostname = function () {
@@ -19269,7 +19483,7 @@ exports.tmpdir = exports.tmpDir = function () {
19269
19483
 
19270
19484
  exports.EOL = '\n';
19271
19485
 
19272
- },{}],82:[function(require,module,exports){
19486
+ },{}],81:[function(require,module,exports){
19273
19487
  (function (global){
19274
19488
  /**
19275
19489
  * JSON parse.
@@ -19304,7 +19518,7 @@ module.exports = function parsejson(data) {
19304
19518
  }
19305
19519
  };
19306
19520
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
19307
- },{}],83:[function(require,module,exports){
19521
+ },{}],82:[function(require,module,exports){
19308
19522
  /**
19309
19523
  * Compiles a querystring
19310
19524
  * Returns string representation of the object
@@ -19343,7 +19557,7 @@ exports.decode = function(qs){
19343
19557
  return qry;
19344
19558
  };
19345
19559
 
19346
- },{}],84:[function(require,module,exports){
19560
+ },{}],83:[function(require,module,exports){
19347
19561
  /**
19348
19562
  * Parses an URI
19349
19563
  *
@@ -19384,11 +19598,12 @@ module.exports = function parseuri(str) {
19384
19598
  return uri;
19385
19599
  };
19386
19600
 
19387
- },{}],85:[function(require,module,exports){
19601
+ },{}],84:[function(require,module,exports){
19388
19602
  (function (process){
19389
19603
  'use strict';
19390
19604
 
19391
- if (!process.version ||
19605
+ if (typeof process === 'undefined' ||
19606
+ !process.version ||
19392
19607
  process.version.indexOf('v0.') === 0 ||
19393
19608
  process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) {
19394
19609
  module.exports = { nextTick: nextTick };
@@ -19432,7 +19647,7 @@ function nextTick(fn, arg1, arg2, arg3) {
19432
19647
 
19433
19648
 
19434
19649
  }).call(this,require('_process'))
19435
- },{"_process":86}],86:[function(require,module,exports){
19650
+ },{"_process":85}],85:[function(require,module,exports){
19436
19651
  // shim for using process in browser
19437
19652
  var process = module.exports = {};
19438
19653
 
@@ -19618,11 +19833,11 @@ process.chdir = function (dir) {
19618
19833
  };
19619
19834
  process.umask = function() { return 0; };
19620
19835
 
19621
- },{}],87:[function(require,module,exports){
19836
+ },{}],86:[function(require,module,exports){
19622
19837
  !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.PubNub=t():e.PubNub=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function a(e){if(!navigator||!navigator.sendBeacon)return!1;navigator.sendBeacon(e)}Object.defineProperty(t,"__esModule",{value:!0});var u=n(1),c=r(u),l=n(40),h=r(l),f=n(41),p=r(f),d=n(42),y=(n(5),function(e){function t(e){i(this,t);var n=e.listenToBrowserNetworkEvents,r=void 0===n||n;e.db=p.default,e.sdkFamily="Web",e.networking=new h.default({del:d.del,get:d.get,post:d.post,sendBeacon:a});var o=s(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return r&&(window.addEventListener("offline",function(){o.networkDownDetected()}),window.addEventListener("online",function(){o.networkUpDetected()})),o}return o(t,e),t}(c.default));t.default=y,e.exports=t.default},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(2),u=i(a),c=n(6),l=i(c),h=n(8),f=i(h),p=n(9),d=i(p),y=n(16),g=i(y),b=n(17),v=r(b),_=n(18),m=r(_),k=n(19),P=r(k),O=n(20),T=r(O),S=n(21),w=r(S),C=n(22),M=r(C),E=n(23),x=r(E),N=n(24),R=r(N),A=n(25),D=r(A),K=n(26),j=r(K),G=n(27),U=r(G),I=n(28),H=r(I),B=n(29),L=r(B),q=n(30),F=r(q),z=n(31),X=r(z),W=n(32),J=r(W),V=n(33),$=r(V),Q=n(34),Y=r(Q),Z=n(35),ee=r(Z),te=n(36),ne=r(te),re=n(37),ie=r(re),se=n(38),oe=r(se),ae=n(12),ue=r(ae),ce=n(39),le=r(ce),he=n(13),fe=i(he),pe=n(10),de=i(pe),ye=(n(5),n(3)),ge=i(ye),be=function(){function e(t){var n=this;s(this,e);var r=t.db,i=t.networking,o=this._config=new u.default({setup:t,db:r}),a=new l.default({config:o});i.init(o);var c={config:o,networking:i,crypto:a},h=g.default.bind(this,c,ue),p=g.default.bind(this,c,j),y=g.default.bind(this,c,H),b=g.default.bind(this,c,F),_=g.default.bind(this,c,le),k=this._listenerManager=new d.default,O=new f.default({timeEndpoint:h,leaveEndpoint:p,heartbeatEndpoint:y,setStateEndpoint:b,subscribeEndpoint:_,crypto:c.crypto,config:c.config,listenerManager:k});this.addListener=k.addListener.bind(k),this.removeListener=k.removeListener.bind(k),this.removeAllListeners=k.removeAllListeners.bind(k),this.channelGroups={listGroups:g.default.bind(this,c,T),listChannels:g.default.bind(this,c,w),addChannels:g.default.bind(this,c,v),removeChannels:g.default.bind(this,c,m),deleteGroup:g.default.bind(this,c,P)},this.push={addChannels:g.default.bind(this,c,M),removeChannels:g.default.bind(this,c,x),deleteDevice:g.default.bind(this,c,D),listChannels:g.default.bind(this,c,R)},this.hereNow=g.default.bind(this,c,X),this.whereNow=g.default.bind(this,c,U),this.getState=g.default.bind(this,c,L),this.setState=O.adaptStateChange.bind(O),this.grant=g.default.bind(this,c,$),this.audit=g.default.bind(this,c,J),this.publish=g.default.bind(this,c,Y),this.fire=function(e,t){return e.replicate=!1,e.storeInHistory=!1,n.publish(e,t)},this.history=g.default.bind(this,c,ee),this.deleteMessages=g.default.bind(this,c,ne),this.messageCounts=g.default.bind(this,c,ie),this.fetchMessages=g.default.bind(this,c,oe),this.time=h,this.subscribe=O.adaptSubscribeChange.bind(O),this.presence=O.adaptPresenceChange.bind(O),this.unsubscribe=O.adaptUnsubscribeChange.bind(O),this.disconnect=O.disconnect.bind(O),this.reconnect=O.reconnect.bind(O),this.destroy=function(e){O.unsubscribeAll(e),O.disconnect()},this.stop=this.destroy,this.unsubscribeAll=O.unsubscribeAll.bind(O),this.getSubscribedChannels=O.getSubscribedChannels.bind(O),this.getSubscribedChannelGroups=O.getSubscribedChannelGroups.bind(O),this.encrypt=a.encrypt.bind(a),this.decrypt=a.decrypt.bind(a),this.getAuthKey=c.config.getAuthKey.bind(c.config),this.setAuthKey=c.config.setAuthKey.bind(c.config),this.setCipherKey=c.config.setCipherKey.bind(c.config),this.getUUID=c.config.getUUID.bind(c.config),this.setUUID=c.config.setUUID.bind(c.config),this.getFilterExpression=c.config.getFilterExpression.bind(c.config),this.setFilterExpression=c.config.setFilterExpression.bind(c.config),this.setHeartbeatInterval=c.config.setHeartbeatInterval.bind(c.config),i.hasModule("proxy")&&(this.setProxy=function(e){c.config.setProxy(e),n.reconnect()})}return o(e,[{key:"getVersion",value:function(){return this._config.getVersion()}},{key:"networkDownDetected",value:function(){this._listenerManager.announceNetworkDown(),this._config.restore?this.disconnect():this.destroy(!0)}},{key:"networkUpDetected",value:function(){this._listenerManager.announceNetworkUp(),this.reconnect()}}],[{key:"generateUUID",value:function(){return ge.default.createUUID()}}]),e}();be.OPERATIONS=fe.default,be.CATEGORIES=de.default,t.default=be,e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(3),o=function(e){return e&&e.__esModule?e:{default:e}}(s),a=(n(5),function(){function e(t){var n=t.setup,i=t.db;r(this,e),this._db=i,this.instanceId="pn-"+o.default.createUUID(),this.secretKey=n.secretKey||n.secret_key,this.subscribeKey=n.subscribeKey||n.subscribe_key,this.publishKey=n.publishKey||n.publish_key,this.sdkName=n.sdkName,this.sdkFamily=n.sdkFamily,this.partnerId=n.partnerId,this.setAuthKey(n.authKey),this.setCipherKey(n.cipherKey),this.setFilterExpression(n.filterExpression),this.origin=n.origin||"ps.pndsn.com",this.secure=n.ssl||!1,this.restore=n.restore||!1,this.proxy=n.proxy,this.keepAlive=n.keepAlive,this.keepAliveSettings=n.keepAliveSettings,this.autoNetworkDetection=n.autoNetworkDetection||!1,this.dedupeOnSubscribe=n.dedupeOnSubscribe||!1,this.maximumCacheSize=n.maximumCacheSize||100,this.customEncrypt=n.customEncrypt,this.customDecrypt=n.customDecrypt,"undefined"!=typeof location&&"https:"===location.protocol&&(this.secure=!0),this.logVerbosity=n.logVerbosity||!1,this.suppressLeaveEvents=n.suppressLeaveEvents||!1,this.announceFailedHeartbeats=n.announceFailedHeartbeats||!0,this.announceSuccessfulHeartbeats=n.announceSuccessfulHeartbeats||!1,this.useInstanceId=n.useInstanceId||!1,this.useRequestId=n.useRequestId||!1,this.requestMessageCountThreshold=n.requestMessageCountThreshold,this.setTransactionTimeout(n.transactionalRequestTimeout||15e3),this.setSubscribeTimeout(n.subscribeRequestTimeout||31e4),this.setSendBeaconConfig(n.useSendBeacon||!0),this.setPresenceTimeout(n.presenceTimeout||300),null!=n.heartbeatInterval&&this.setHeartbeatInterval(n.heartbeatInterval),this.setUUID(this._decideUUID(n.uuid))}return i(e,[{key:"getAuthKey",value:function(){return this.authKey}},{key:"setAuthKey",value:function(e){return this.authKey=e,this}},{key:"setCipherKey",value:function(e){return this.cipherKey=e,this}},{key:"getUUID",value:function(){return this.UUID}},{key:"setUUID",value:function(e){return this._db&&this._db.set&&this._db.set(this.subscribeKey+"uuid",e),this.UUID=e,this}},{key:"getFilterExpression",value:function(){return this.filterExpression}},{key:"setFilterExpression",value:function(e){return this.filterExpression=e,this}},{key:"getPresenceTimeout",value:function(){return this._presenceTimeout}},{key:"setPresenceTimeout",value:function(e){return this._presenceTimeout=e,this.setHeartbeatInterval(this._presenceTimeout/2-1),this}},{key:"setProxy",value:function(e){this.proxy=e}},{key:"getHeartbeatInterval",value:function(){return this._heartbeatInterval}},{key:"setHeartbeatInterval",value:function(e){return this._heartbeatInterval=e,this}},{key:"getSubscribeTimeout",value:function(){return this._subscribeRequestTimeout}},{key:"setSubscribeTimeout",value:function(e){return this._subscribeRequestTimeout=e,this}},{key:"getTransactionTimeout",value:function(){return this._transactionalRequestTimeout}},{key:"setTransactionTimeout",value:function(e){return this._transactionalRequestTimeout=e,this}},{key:"isSendBeaconEnabled",value:function(){return this._useSendBeacon}},{key:"setSendBeaconConfig",value:function(e){return this._useSendBeacon=e,this}},{key:"getVersion",value:function(){return"4.24.2"}},{key:"_decideUUID",value:function(e){return e||(this._db&&this._db.get&&this._db.get(this.subscribeKey+"uuid")?this._db.get(this.subscribeKey+"uuid"):"pn-"+o.default.createUUID())}}]),e}());t.default=a,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4),i=function(e){return e&&e.__esModule?e:{default:e}}(r);t.default={createUUID:function(){return i.default.uuid?i.default.uuid():(0,i.default)()}},e.exports=t.default},function(e,t,n){var r,i,s;!function(n,o){i=[t],r=o,void 0!==(s="function"==typeof r?r.apply(t,i):r)&&(e.exports=s)}(0,function(e){function t(){var e,t,n="";for(e=0;e<32;e++)t=16*Math.random()|0,8!==e&&12!==e&&16!==e&&20!==e||(n+="-"),n+=(12===e?4:16===e?3&t|8:t).toString(16);return n}function n(e,t){var n=r[t||"all"];return n&&n.test(e)||!1}var r={3:/^[0-9A-F]{8}-[0-9A-F]{4}-3[0-9A-F]{3}-[0-9A-F]{4}-[0-9A-F]{12}$/i,4:/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,5:/^[0-9A-F]{8}-[0-9A-F]{4}-5[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,all:/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i};t.isUUID=n,t.VERSION="0.1.0",e.uuid=t,e.isUUID=n})},function(e,t){"use strict";e.exports={}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(2),a=(r(o),n(7)),u=r(a),c=function(){function e(t){var n=t.config;i(this,e),this._config=n,this._iv="0123456789012345",this._allowedKeyEncodings=["hex","utf8","base64","binary"],this._allowedKeyLengths=[128,256],this._allowedModes=["ecb","cbc"],this._defaultOptions={encryptKey:!0,keyEncoding:"utf8",keyLength:256,mode:"cbc"}}return s(e,[{key:"HMACSHA256",value:function(e){return u.default.HmacSHA256(e,this._config.secretKey).toString(u.default.enc.Base64)}},{key:"SHA256",value:function(e){return u.default.SHA256(e).toString(u.default.enc.Hex)}},{key:"_parseOptions",value:function(e){var t=e||{};return t.hasOwnProperty("encryptKey")||(t.encryptKey=this._defaultOptions.encryptKey),t.hasOwnProperty("keyEncoding")||(t.keyEncoding=this._defaultOptions.keyEncoding),t.hasOwnProperty("keyLength")||(t.keyLength=this._defaultOptions.keyLength),t.hasOwnProperty("mode")||(t.mode=this._defaultOptions.mode),-1===this._allowedKeyEncodings.indexOf(t.keyEncoding.toLowerCase())&&(t.keyEncoding=this._defaultOptions.keyEncoding),-1===this._allowedKeyLengths.indexOf(parseInt(t.keyLength,10))&&(t.keyLength=this._defaultOptions.keyLength),-1===this._allowedModes.indexOf(t.mode.toLowerCase())&&(t.mode=this._defaultOptions.mode),t}},{key:"_decodeKey",value:function(e,t){return"base64"===t.keyEncoding?u.default.enc.Base64.parse(e):"hex"===t.keyEncoding?u.default.enc.Hex.parse(e):e}},{key:"_getPaddedKey",value:function(e,t){return e=this._decodeKey(e,t),t.encryptKey?u.default.enc.Utf8.parse(this.SHA256(e).slice(0,32)):e}},{key:"_getMode",value:function(e){return"ecb"===e.mode?u.default.mode.ECB:u.default.mode.CBC}},{key:"_getIV",value:function(e){return"cbc"===e.mode?u.default.enc.Utf8.parse(this._iv):null}},{key:"encrypt",value:function(e,t,n){return this._config.customEncrypt?this._config.customEncrypt(e):this.pnEncrypt(e,t,n)}},{key:"decrypt",value:function(e,t,n){return this._config.customDecrypt?this._config.customDecrypt(e):this.pnDecrypt(e,t,n)}},{key:"pnEncrypt",value:function(e,t,n){if(!t&&!this._config.cipherKey)return e;n=this._parseOptions(n);var r=this._getIV(n),i=this._getMode(n),s=this._getPaddedKey(t||this._config.cipherKey,n);return u.default.AES.encrypt(e,s,{iv:r,mode:i}).ciphertext.toString(u.default.enc.Base64)||e}},{key:"pnDecrypt",value:function(e,t,n){if(!t&&!this._config.cipherKey)return e;n=this._parseOptions(n);var r=this._getIV(n),i=this._getMode(n),s=this._getPaddedKey(t||this._config.cipherKey,n);try{var o=u.default.enc.Base64.parse(e),a=u.default.AES.decrypt({ciphertext:o},s,{iv:r,mode:i}).toString(u.default.enc.Utf8);return JSON.parse(a)}catch(e){return null}}}]),e}();t.default=c,e.exports=t.default},function(e,t){"use strict";var n=n||function(e,t){var n={},r=n.lib={},i=function(){},s=r.Base={extend:function(e){i.prototype=this;var t=new i;return e&&t.mixIn(e),t.hasOwnProperty("init")||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},o=r.WordArray=s.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=void 0!=t?t:4*e.length},toString:function(e){return(e||u).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes;if(e=e.sigBytes,this.clamp(),r%4)for(var i=0;i<e;i++)t[r+i>>>2]|=(n[i>>>2]>>>24-i%4*8&255)<<24-(r+i)%4*8;else if(65535<n.length)for(i=0;i<e;i+=4)t[r+i>>>2]=n[i>>>2];else t.push.apply(t,n);return this.sigBytes+=e,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=s.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var n=[],r=0;r<t;r+=4)n.push(4294967296*e.random()|0);return new o.init(n,t)}}),a=n.enc={},u=a.Hex={stringify:function(e){var t=e.words;e=e.sigBytes;for(var n=[],r=0;r<e;r++){var i=t[r>>>2]>>>24-r%4*8&255;n.push((i>>>4).toString(16)),n.push((15&i).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n[r>>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new o.init(n,t/2)}},c=a.Latin1={stringify:function(e){var t=e.words;e=e.sigBytes;for(var n=[],r=0;r<e;r++)n.push(String.fromCharCode(t[r>>>2]>>>24-r%4*8&255));return n.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r>>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new o.init(n,t)}},l=a.Utf8={stringify:function(e){try{return decodeURIComponent(escape(c.stringify(e)))}catch(e){throw Error("Malformed UTF-8 data")}},parse:function(e){return c.parse(unescape(encodeURIComponent(e)))}},h=r.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new o.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=l.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n=this._data,r=n.words,i=n.sigBytes,s=this.blockSize,a=i/(4*s),a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0);if(t=a*s,i=e.min(4*t,i),t){for(var u=0;u<t;u+=s)this._doProcessBlock(r,u);u=r.splice(0,t),n.sigBytes-=i}return new o.init(u,i)},clone:function(){var e=s.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});r.Hasher=h.extend({cfg:s.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){h.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new f.HMAC.init(e,n).finalize(t)}}});var f=n.algo={};return n}(Math);!function(e){for(var t=n,r=t.lib,i=r.WordArray,s=r.Hasher,r=t.algo,o=[],a=[],u=function(e){return 4294967296*(e-(0|e))|0},c=2,l=0;64>l;){var h;e:{h=c;for(var f=e.sqrt(h),p=2;p<=f;p++)if(!(h%p)){h=!1;break e}h=!0}h&&(8>l&&(o[l]=u(e.pow(c,.5))),a[l]=u(e.pow(c,1/3)),l++),c++}var d=[],r=r.SHA256=s.extend({_doReset:function(){this._hash=new i.init(o.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],s=n[2],o=n[3],u=n[4],c=n[5],l=n[6],h=n[7],f=0;64>f;f++){if(16>f)d[f]=0|e[t+f];else{var p=d[f-15],y=d[f-2];d[f]=((p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3)+d[f-7]+((y<<15|y>>>17)^(y<<13|y>>>19)^y>>>10)+d[f-16]}p=h+((u<<26|u>>>6)^(u<<21|u>>>11)^(u<<7|u>>>25))+(u&c^~u&l)+a[f]+d[f],y=((r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22))+(r&i^r&s^i&s),h=l,l=c,c=u,u=o+p|0,o=s,s=i,i=r,r=p+y|0}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+s|0,n[3]=n[3]+o|0,n[4]=n[4]+u|0,n[5]=n[5]+c|0,n[6]=n[6]+l|0,n[7]=n[7]+h|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;return n[i>>>5]|=128<<24-i%32,n[14+(i+64>>>9<<4)]=e.floor(r/4294967296),n[15+(i+64>>>9<<4)]=r,t.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=s.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=s._createHelper(r),t.HmacSHA256=s._createHmacHelper(r)}(Math),function(){var e=n,t=e.enc.Utf8;e.algo.HMAC=e.lib.Base.extend({init:function(e,n){e=this._hasher=new e.init,"string"==typeof n&&(n=t.parse(n));var r=e.blockSize,i=4*r;n.sigBytes>i&&(n=e.finalize(n)),n.clamp();for(var s=this._oKey=n.clone(),o=this._iKey=n.clone(),a=s.words,u=o.words,c=0;c<r;c++)a[c]^=1549556828,u[c]^=909522486;s.sigBytes=o.sigBytes=i,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher;return e=t.finalize(e),t.reset(),t.finalize(this._oKey.clone().concat(e))}})}(),function(){var e=n,t=e.lib.WordArray;e.enc.Base64={stringify:function(e){var t=e.words,n=e.sigBytes,r=this._map;e.clamp(),e=[];for(var i=0;i<n;i+=3)for(var s=(t[i>>>2]>>>24-i%4*8&255)<<16|(t[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|t[i+2>>>2]>>>24-(i+2)%4*8&255,o=0;4>o&&i+.75*o<n;o++)e.push(r.charAt(s>>>6*(3-o)&63));if(t=r.charAt(64))for(;e.length%4;)e.push(t);return e.join("")},parse:function(e){var n=e.length,r=this._map,i=r.charAt(64);i&&-1!=(i=e.indexOf(i))&&(n=i);for(var i=[],s=0,o=0;o<n;o++)if(o%4){var a=r.indexOf(e.charAt(o-1))<<o%4*2,u=r.indexOf(e.charAt(o))>>>6-o%4*2;i[s>>>2]|=(a|u)<<24-s%4*8,s++}return t.create(i,s)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),function(e){function t(e,t,n,r,i,s,o){return((e=e+(t&n|~t&r)+i+o)<<s|e>>>32-s)+t}function r(e,t,n,r,i,s,o){return((e=e+(t&r|n&~r)+i+o)<<s|e>>>32-s)+t}function i(e,t,n,r,i,s,o){return((e=e+(t^n^r)+i+o)<<s|e>>>32-s)+t}function s(e,t,n,r,i,s,o){return((e=e+(n^(t|~r))+i+o)<<s|e>>>32-s)+t}for(var o=n,a=o.lib,u=a.WordArray,c=a.Hasher,a=o.algo,l=[],h=0;64>h;h++)l[h]=4294967296*e.abs(e.sin(h+1))|0;a=a.MD5=c.extend({_doReset:function(){this._hash=new u.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,n){for(var o=0;16>o;o++){var a=n+o,u=e[a];e[a]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}var o=this._hash.words,a=e[n+0],u=e[n+1],c=e[n+2],h=e[n+3],f=e[n+4],p=e[n+5],d=e[n+6],y=e[n+7],g=e[n+8],b=e[n+9],v=e[n+10],_=e[n+11],m=e[n+12],k=e[n+13],P=e[n+14],O=e[n+15],T=o[0],S=o[1],w=o[2],C=o[3],T=t(T,S,w,C,a,7,l[0]),C=t(C,T,S,w,u,12,l[1]),w=t(w,C,T,S,c,17,l[2]),S=t(S,w,C,T,h,22,l[3]),T=t(T,S,w,C,f,7,l[4]),C=t(C,T,S,w,p,12,l[5]),w=t(w,C,T,S,d,17,l[6]),S=t(S,w,C,T,y,22,l[7]),T=t(T,S,w,C,g,7,l[8]),C=t(C,T,S,w,b,12,l[9]),w=t(w,C,T,S,v,17,l[10]),S=t(S,w,C,T,_,22,l[11]),T=t(T,S,w,C,m,7,l[12]),C=t(C,T,S,w,k,12,l[13]),w=t(w,C,T,S,P,17,l[14]),S=t(S,w,C,T,O,22,l[15]),T=r(T,S,w,C,u,5,l[16]),C=r(C,T,S,w,d,9,l[17]),w=r(w,C,T,S,_,14,l[18]),S=r(S,w,C,T,a,20,l[19]),T=r(T,S,w,C,p,5,l[20]),C=r(C,T,S,w,v,9,l[21]),w=r(w,C,T,S,O,14,l[22]),S=r(S,w,C,T,f,20,l[23]),T=r(T,S,w,C,b,5,l[24]),C=r(C,T,S,w,P,9,l[25]),w=r(w,C,T,S,h,14,l[26]),S=r(S,w,C,T,g,20,l[27]),T=r(T,S,w,C,k,5,l[28]),C=r(C,T,S,w,c,9,l[29]),w=r(w,C,T,S,y,14,l[30]),S=r(S,w,C,T,m,20,l[31]),T=i(T,S,w,C,p,4,l[32]),C=i(C,T,S,w,g,11,l[33]),w=i(w,C,T,S,_,16,l[34]),S=i(S,w,C,T,P,23,l[35]),T=i(T,S,w,C,u,4,l[36]),C=i(C,T,S,w,f,11,l[37]),w=i(w,C,T,S,y,16,l[38]),S=i(S,w,C,T,v,23,l[39]),T=i(T,S,w,C,k,4,l[40]),C=i(C,T,S,w,a,11,l[41]),w=i(w,C,T,S,h,16,l[42]),S=i(S,w,C,T,d,23,l[43]),T=i(T,S,w,C,b,4,l[44]),C=i(C,T,S,w,m,11,l[45]),w=i(w,C,T,S,O,16,l[46]),S=i(S,w,C,T,c,23,l[47]),T=s(T,S,w,C,a,6,l[48]),C=s(C,T,S,w,y,10,l[49]),w=s(w,C,T,S,P,15,l[50]),S=s(S,w,C,T,p,21,l[51]),T=s(T,S,w,C,m,6,l[52]),C=s(C,T,S,w,h,10,l[53]),w=s(w,C,T,S,v,15,l[54]),S=s(S,w,C,T,u,21,l[55]),T=s(T,S,w,C,g,6,l[56]),C=s(C,T,S,w,O,10,l[57]),w=s(w,C,T,S,d,15,l[58]),S=s(S,w,C,T,k,21,l[59]),T=s(T,S,w,C,f,6,l[60]),C=s(C,T,S,w,_,10,l[61]),w=s(w,C,T,S,c,15,l[62]),S=s(S,w,C,T,b,21,l[63]);o[0]=o[0]+T|0,o[1]=o[1]+S|0,o[2]=o[2]+w|0,o[3]=o[3]+C|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;n[i>>>5]|=128<<24-i%32;var s=e.floor(r/4294967296);for(n[15+(i+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),n[14+(i+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),t.sigBytes=4*(n.length+1),this._process(),t=this._hash,n=t.words,r=0;4>r;r++)i=n[r],n[r]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8);return t},clone:function(){var e=c.clone.call(this);return e._hash=this._hash.clone(),e}}),o.MD5=c._createHelper(a),o.HmacMD5=c._createHmacHelper(a)}(Math),function(){var e=n,t=e.lib,r=t.Base,i=t.WordArray,t=e.algo,s=t.EvpKDF=r.extend({cfg:r.extend({keySize:4,hasher:t.MD5,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n=this.cfg,r=n.hasher.create(),s=i.create(),o=s.words,a=n.keySize,n=n.iterations;o.length<a;){u&&r.update(u);var u=r.update(e).finalize(t);r.reset();for(var c=1;c<n;c++)u=r.finalize(u),r.reset();s.concat(u)}return s.sigBytes=4*a,s}});e.EvpKDF=function(e,t,n){return s.create(n).compute(e,t)}}(),n.lib.Cipher||function(e){var t=n,r=t.lib,i=r.Base,s=r.WordArray,o=r.BufferedBlockAlgorithm,a=t.enc.Base64,u=t.algo.EvpKDF,c=r.Cipher=o.extend({cfg:i.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,n){this.cfg=this.cfg.extend(n),this._xformMode=e,this._key=t,this.reset()},reset:function(){o.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(e){return{encrypt:function(t,n,r){return("string"==typeof n?y:d).encrypt(e,t,n,r)},decrypt:function(t,n,r){return("string"==typeof n?y:d).decrypt(e,t,n,r)}}}});r.StreamCipher=c.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var l=t.mode={},h=function(e,t,n){var r=this._iv;r?this._iv=void 0:r=this._prevBlock;for(var i=0;i<n;i++)e[t+i]^=r[i]},f=(r.BlockCipherMode=i.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}})).extend();f.Encryptor=f.extend({processBlock:function(e,t){var n=this._cipher,r=n.blockSize;h.call(this,e,t,r),n.encryptBlock(e,t),this._prevBlock=e.slice(t,t+r)}}),f.Decryptor=f.extend({processBlock:function(e,t){var n=this._cipher,r=n.blockSize,i=e.slice(t,t+r);n.decryptBlock(e,t),h.call(this,e,t,r),this._prevBlock=i}}),l=l.CBC=f,f=(t.pad={}).Pkcs7={pad:function(e,t){for(var n=4*t,n=n-e.sigBytes%n,r=n<<24|n<<16|n<<8|n,i=[],o=0;o<n;o+=4)i.push(r);n=s.create(i,n),e.concat(n)},unpad:function(e){e.sigBytes-=255&e.words[e.sigBytes-1>>>2]}},r.BlockCipher=c.extend({cfg:c.cfg.extend({mode:l,padding:f}),reset:function(){c.reset.call(this);var e=this.cfg,t=e.iv,e=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var n=e.createEncryptor;else n=e.createDecryptor,this._minBufferSize=1;this._mode=n.call(e,this,t&&t.words)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else t=this._process(!0),e.unpad(t);return t},blockSize:4});var p=r.CipherParams=i.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),l=(t.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext;return e=e.salt,(e?s.create([1398893684,1701076831]).concat(e).concat(t):t).toString(a)},parse:function(e){e=a.parse(e);var t=e.words;if(1398893684==t[0]&&1701076831==t[1]){var n=s.create(t.slice(2,4));t.splice(0,4),e.sigBytes-=16}return p.create({ciphertext:e,salt:n})}},d=r.SerializableCipher=i.extend({cfg:i.extend({format:l}),encrypt:function(e,t,n,r){r=this.cfg.extend(r);var i=e.createEncryptor(n,r);return t=i.finalize(t),i=i.cfg,p.create({ciphertext:t,key:n,iv:i.iv,algorithm:e,mode:i.mode,padding:i.padding,blockSize:e.blockSize,formatter:r.format})},decrypt:function(e,t,n,r){return r=this.cfg.extend(r),t=this._parse(t,r.format),e.createDecryptor(n,r).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),t=(t.kdf={}).OpenSSL={execute:function(e,t,n,r){return r||(r=s.random(8)),e=u.create({keySize:t+n}).compute(e,r),n=s.create(e.words.slice(t),4*n),e.sigBytes=4*t,p.create({key:e,iv:n,salt:r})}},y=r.PasswordBasedCipher=d.extend({cfg:d.cfg.extend({kdf:t}),encrypt:function(e,t,n,r){return r=this.cfg.extend(r),n=r.kdf.execute(n,e.keySize,e.ivSize),r.iv=n.iv,e=d.encrypt.call(this,e,t,n.key,r),e.mixIn(n),e},decrypt:function(e,t,n,r){return r=this.cfg.extend(r),t=this._parse(t,r.format),n=r.kdf.execute(n,e.keySize,e.ivSize,t.salt),r.iv=n.iv,d.decrypt.call(this,e,t,n.key,r)}})}(),function(){for(var e=n,t=e.lib.BlockCipher,r=e.algo,i=[],s=[],o=[],a=[],u=[],c=[],l=[],h=[],f=[],p=[],d=[],y=0;256>y;y++)d[y]=128>y?y<<1:y<<1^283;for(var g=0,b=0,y=0;256>y;y++){var v=b^b<<1^b<<2^b<<3^b<<4,v=v>>>8^255&v^99;i[g]=v,s[v]=g;var _=d[g],m=d[_],k=d[m],P=257*d[v]^16843008*v;o[g]=P<<24|P>>>8,a[g]=P<<16|P>>>16,u[g]=P<<8|P>>>24,c[g]=P,P=16843009*k^65537*m^257*_^16843008*g,l[v]=P<<24|P>>>8,h[v]=P<<16|P>>>16,f[v]=P<<8|P>>>24,p[v]=P,g?(g=_^d[d[d[k^_]]],b^=d[d[b]]):g=b=1}var O=[0,1,2,4,8,16,32,64,128,27,54],r=r.AES=t.extend({_doReset:function(){for(var e=this._key,t=e.words,n=e.sigBytes/4,e=4*((this._nRounds=n+6)+1),r=this._keySchedule=[],s=0;s<e;s++)if(s<n)r[s]=t[s];else{var o=r[s-1];s%n?6<n&&4==s%n&&(o=i[o>>>24]<<24|i[o>>>16&255]<<16|i[o>>>8&255]<<8|i[255&o]):(o=o<<8|o>>>24,o=i[o>>>24]<<24|i[o>>>16&255]<<16|i[o>>>8&255]<<8|i[255&o],o^=O[s/n|0]<<24),r[s]=r[s-n]^o}for(t=this._invKeySchedule=[],n=0;n<e;n++)s=e-n,o=n%4?r[s]:r[s-4],t[n]=4>n||4>=s?o:l[i[o>>>24]]^h[i[o>>>16&255]]^f[i[o>>>8&255]]^p[i[255&o]]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,o,a,u,c,i)},decryptBlock:function(e,t){var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n,this._doCryptBlock(e,t,this._invKeySchedule,l,h,f,p,s),n=e[t+1],e[t+1]=e[t+3],e[t+3]=n},_doCryptBlock:function(e,t,n,r,i,s,o,a){for(var u=this._nRounds,c=e[t]^n[0],l=e[t+1]^n[1],h=e[t+2]^n[2],f=e[t+3]^n[3],p=4,d=1;d<u;d++)var y=r[c>>>24]^i[l>>>16&255]^s[h>>>8&255]^o[255&f]^n[p++],g=r[l>>>24]^i[h>>>16&255]^s[f>>>8&255]^o[255&c]^n[p++],b=r[h>>>24]^i[f>>>16&255]^s[c>>>8&255]^o[255&l]^n[p++],f=r[f>>>24]^i[c>>>16&255]^s[l>>>8&255]^o[255&h]^n[p++],c=y,l=g,h=b;y=(a[c>>>24]<<24|a[l>>>16&255]<<16|a[h>>>8&255]<<8|a[255&f])^n[p++],g=(a[l>>>24]<<24|a[h>>>16&255]<<16|a[f>>>8&255]<<8|a[255&c])^n[p++],b=(a[h>>>24]<<24|a[f>>>16&255]<<16|a[c>>>8&255]<<8|a[255&l])^n[p++],f=(a[f>>>24]<<24|a[c>>>16&255]<<16|a[l>>>8&255]<<8|a[255&h])^n[p++],e[t]=y,e[t+1]=g,e[t+2]=b,e[t+3]=f},keySize:8});e.AES=t._createHelper(r)}(),n.mode.ECB=function(){var e=n.lib.BlockCipherMode.extend();return e.Encryptor=e.extend({processBlock:function(e,t){this._cipher.encryptBlock(e,t)}}),e.Decryptor=e.extend({processBlock:function(e,t){this._cipher.decryptBlock(e,t)}}),e}(),e.exports=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(6),a=(r(o),n(2)),u=(r(a),n(9)),c=(r(u),n(11)),l=r(c),h=n(14),f=r(h),p=n(15),d=r(p),y=(n(5),n(10)),g=r(y),b=function(){function e(t){var n=t.subscribeEndpoint,r=t.leaveEndpoint,s=t.heartbeatEndpoint,o=t.setStateEndpoint,a=t.timeEndpoint,u=t.config,c=t.crypto,h=t.listenerManager;i(this,e),this._listenerManager=h,this._config=u,this._leaveEndpoint=r,this._heartbeatEndpoint=s,this._setStateEndpoint=o,this._subscribeEndpoint=n,this._crypto=c,this._channels={},this._presenceChannels={},this._heartbeatChannels={},this._heartbeatChannelGroups={},this._channelGroups={},this._presenceChannelGroups={},this._pendingChannelSubscriptions=[],this._pendingChannelGroupSubscriptions=[],this._currentTimetoken=0,this._lastTimetoken=0,this._storedTimetoken=null,this._subscriptionStatusAnnounced=!1,this._isOnline=!0,this._reconnectionManager=new l.default({timeEndpoint:a}),this._dedupingManager=new f.default({config:u})}return s(e,[{key:"adaptStateChange",value:function(e,t){var n=this,r=e.state,i=e.channels,s=void 0===i?[]:i,o=e.channelGroups,a=void 0===o?[]:o;return s.forEach(function(e){e in n._channels&&(n._channels[e].state=r)}),a.forEach(function(e){e in n._channelGroups&&(n._channelGroups[e].state=r)}),this._setStateEndpoint({state:r,channels:s,channelGroups:a},t)}},{key:"adaptPresenceChange",value:function(e){var t=this,n=e.connected,r=e.channels,i=void 0===r?[]:r,s=e.channelGroups,o=void 0===s?[]:s;n?(i.forEach(function(e){t._heartbeatChannels[e]={state:{}}}),o.forEach(function(e){t._heartbeatChannelGroups[e]={state:{}}})):(i.forEach(function(e){e in t._heartbeatChannels&&delete t._heartbeatChannels[e]}),o.forEach(function(e){e in t._heartbeatChannelGroups&&delete t._heartbeatChannelGroups[e]}),!1===this._config.suppressLeaveEvents&&this._leaveEndpoint({channels:i,channelGroups:o},function(e){t._listenerManager.announceStatus(e)})),this.reconnect()}},{key:"adaptSubscribeChange",value:function(e){var t=this,n=e.timetoken,r=e.channels,i=void 0===r?[]:r,s=e.channelGroups,o=void 0===s?[]:s,a=e.withPresence,u=void 0!==a&&a,c=e.withHeartbeats,l=void 0!==c&&c;if(!this._config.subscribeKey||""===this._config.subscribeKey)return void(console&&console.log&&console.log("subscribe key missing; aborting subscribe"));n&&(this._lastTimetoken=this._currentTimetoken,
19623
19838
  this._currentTimetoken=n),"0"!==this._currentTimetoken&&0!==this._currentTimetoken&&(this._storedTimetoken=this._currentTimetoken,this._currentTimetoken=0),i.forEach(function(e){t._channels[e]={state:{}},u&&(t._presenceChannels[e]={}),l&&(t._heartbeatChannels[e]={}),t._pendingChannelSubscriptions.push(e)}),o.forEach(function(e){t._channelGroups[e]={state:{}},u&&(t._presenceChannelGroups[e]={}),l&&(t._heartbeatChannelGroups[e]={}),t._pendingChannelGroupSubscriptions.push(e)}),this._subscriptionStatusAnnounced=!1,this.reconnect()}},{key:"adaptUnsubscribeChange",value:function(e,t){var n=this,r=e.channels,i=void 0===r?[]:r,s=e.channelGroups,o=void 0===s?[]:s,a=[],u=[];i.forEach(function(e){e in n._channels&&(delete n._channels[e],a.push(e),e in n._heartbeatChannels&&delete n._heartbeatChannels[e]),e in n._presenceChannels&&(delete n._presenceChannels[e],a.push(e))}),o.forEach(function(e){e in n._channelGroups&&(delete n._channelGroups[e],u.push(e),e in n._heartbeatChannelGroups&&delete n._heartbeatChannelGroups[e]),e in n._presenceChannelGroups&&(delete n._channelGroups[e],u.push(e))}),0===a.length&&0===u.length||(!1!==this._config.suppressLeaveEvents||t||this._leaveEndpoint({channels:a,channelGroups:u},function(e){e.affectedChannels=a,e.affectedChannelGroups=u,e.currentTimetoken=n._currentTimetoken,e.lastTimetoken=n._lastTimetoken,n._listenerManager.announceStatus(e)}),0===Object.keys(this._channels).length&&0===Object.keys(this._presenceChannels).length&&0===Object.keys(this._channelGroups).length&&0===Object.keys(this._presenceChannelGroups).length&&(this._lastTimetoken=0,this._currentTimetoken=0,this._storedTimetoken=null,this._region=null,this._reconnectionManager.stopPolling()),this.reconnect())}},{key:"unsubscribeAll",value:function(e){this.adaptUnsubscribeChange({channels:this.getSubscribedChannels(),channelGroups:this.getSubscribedChannelGroups()},e)}},{key:"getHeartbeatChannels",value:function(){return Object.keys(this._heartbeatChannels)}},{key:"getHeartbeatChannelGroups",value:function(){return Object.keys(this._heartbeatChannelGroups)}},{key:"getSubscribedChannels",value:function(){return Object.keys(this._channels)}},{key:"getSubscribedChannelGroups",value:function(){return Object.keys(this._channelGroups)}},{key:"reconnect",value:function(){this._startSubscribeLoop(),this._registerHeartbeatTimer()}},{key:"disconnect",value:function(){this._stopSubscribeLoop(),this._stopHeartbeatTimer(),this._reconnectionManager.stopPolling()}},{key:"_registerHeartbeatTimer",value:function(){this._stopHeartbeatTimer(),0!==this._config.getHeartbeatInterval()&&(this._performHeartbeatLoop(),this._heartbeatTimer=setInterval(this._performHeartbeatLoop.bind(this),1e3*this._config.getHeartbeatInterval()))}},{key:"_stopHeartbeatTimer",value:function(){this._heartbeatTimer&&(clearInterval(this._heartbeatTimer),this._heartbeatTimer=null)}},{key:"_performHeartbeatLoop",value:function(){var e=this,t=this.getHeartbeatChannels(),n=this.getHeartbeatChannelGroups(),r={};if(0!==t.length||0!==n.length){this.getSubscribedChannels().forEach(function(t){var n=e._channels[t].state;Object.keys(n).length&&(r[t]=n)}),this.getSubscribedChannelGroups().forEach(function(t){var n=e._channelGroups[t].state;Object.keys(n).length&&(r[t]=n)});var i=function(t){t.error&&e._config.announceFailedHeartbeats&&e._listenerManager.announceStatus(t),t.error&&e._config.autoNetworkDetection&&e._isOnline&&(e._isOnline=!1,e.disconnect(),e._listenerManager.announceNetworkDown(),e.reconnect()),!t.error&&e._config.announceSuccessfulHeartbeats&&e._listenerManager.announceStatus(t)};this._heartbeatEndpoint({channels:t,channelGroups:n,state:r},i.bind(this))}}},{key:"_startSubscribeLoop",value:function(){var e=this;this._stopSubscribeLoop();var t={},n=[],r=[];if(Object.keys(this._channels).forEach(function(r){var i=e._channels[r].state;Object.keys(i).length&&(t[r]=i),n.push(r)}),Object.keys(this._presenceChannels).forEach(function(e){n.push(e+"-pnpres")}),Object.keys(this._channelGroups).forEach(function(n){var i=e._channelGroups[n].state;Object.keys(i).length&&(t[n]=i),r.push(n)}),Object.keys(this._presenceChannelGroups).forEach(function(e){r.push(e+"-pnpres")}),0!==n.length||0!==r.length){var i={channels:n,channelGroups:r,state:t,timetoken:this._currentTimetoken,filterExpression:this._config.filterExpression,region:this._region};this._subscribeCall=this._subscribeEndpoint(i,this._processSubscribeResponse.bind(this))}}},{key:"_processSubscribeResponse",value:function(e,t){var n=this;if(e.error)return void(e.category===g.default.PNTimeoutCategory?this._startSubscribeLoop():e.category===g.default.PNNetworkIssuesCategory?(this.disconnect(),e.error&&this._config.autoNetworkDetection&&this._isOnline&&(this._isOnline=!1,this._listenerManager.announceNetworkDown()),this._reconnectionManager.onReconnection(function(){n._config.autoNetworkDetection&&!n._isOnline&&(n._isOnline=!0,n._listenerManager.announceNetworkUp()),n.reconnect(),n._subscriptionStatusAnnounced=!0;var t={category:g.default.PNReconnectedCategory,operation:e.operation,lastTimetoken:n._lastTimetoken,currentTimetoken:n._currentTimetoken};n._listenerManager.announceStatus(t)}),this._reconnectionManager.startPolling(),this._listenerManager.announceStatus(e)):e.category===g.default.PNBadRequestCategory?(this._stopHeartbeatTimer(),this._listenerManager.announceStatus(e)):this._listenerManager.announceStatus(e));if(this._storedTimetoken?(this._currentTimetoken=this._storedTimetoken,this._storedTimetoken=null):(this._lastTimetoken=this._currentTimetoken,this._currentTimetoken=t.metadata.timetoken),!this._subscriptionStatusAnnounced){var r={};r.category=g.default.PNConnectedCategory,r.operation=e.operation,r.affectedChannels=this._pendingChannelSubscriptions,r.subscribedChannels=this.getSubscribedChannels(),r.affectedChannelGroups=this._pendingChannelGroupSubscriptions,r.lastTimetoken=this._lastTimetoken,r.currentTimetoken=this._currentTimetoken,this._subscriptionStatusAnnounced=!0,this._listenerManager.announceStatus(r),this._pendingChannelSubscriptions=[],this._pendingChannelGroupSubscriptions=[]}var i=t.messages||[],s=this._config,o=s.requestMessageCountThreshold,a=s.dedupeOnSubscribe;if(o&&i.length>=o){var u={};u.category=g.default.PNRequestMessageCountExceededCategory,u.operation=e.operation,this._listenerManager.announceStatus(u)}i.forEach(function(e){var t=e.channel,r=e.subscriptionMatch,i=e.publishMetaData;if(t===r&&(r=null),a){if(n._dedupingManager.isDuplicate(e))return;n._dedupingManager.addEntry(e)}if(d.default.endsWith(e.channel,"-pnpres")){var s={};s.channel=null,s.subscription=null,s.actualChannel=null!=r?t:null,s.subscribedChannel=null!=r?r:t,t&&(s.channel=t.substring(0,t.lastIndexOf("-pnpres"))),r&&(s.subscription=r.substring(0,r.lastIndexOf("-pnpres"))),s.action=e.payload.action,s.state=e.payload.data,s.timetoken=i.publishTimetoken,s.occupancy=e.payload.occupancy,s.uuid=e.payload.uuid,s.timestamp=e.payload.timestamp,e.payload.join&&(s.join=e.payload.join),e.payload.leave&&(s.leave=e.payload.leave),e.payload.timeout&&(s.timeout=e.payload.timeout),n._listenerManager.announcePresence(s)}else{var o={};o.channel=null,o.subscription=null,o.actualChannel=null!=r?t:null,o.subscribedChannel=null!=r?r:t,o.channel=t,o.subscription=r,o.timetoken=i.publishTimetoken,o.publisher=e.issuingClientId,e.userMetadata&&(o.userMetadata=e.userMetadata),n._config.cipherKey?o.message=n._crypto.decrypt(e.payload):o.message=e.payload,n._listenerManager.announceMessage(o)}}),this._region=t.metadata.region,this._startSubscribeLoop()}},{key:"_stopSubscribeLoop",value:function(){this._subscribeCall&&("function"==typeof this._subscribeCall.abort&&this._subscribeCall.abort(),this._subscribeCall=null)}}]),e}();t.default=b,e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=(n(5),n(10)),o=function(e){return e&&e.__esModule?e:{default:e}}(s),a=function(){function e(){r(this,e),this._listeners=[]}return i(e,[{key:"addListener",value:function(e){this._listeners.push(e)}},{key:"removeListener",value:function(e){var t=[];this._listeners.forEach(function(n){n!==e&&t.push(n)}),this._listeners=t}},{key:"removeAllListeners",value:function(){this._listeners=[]}},{key:"announcePresence",value:function(e){this._listeners.forEach(function(t){t.presence&&t.presence(e)})}},{key:"announceStatus",value:function(e){this._listeners.forEach(function(t){t.status&&t.status(e)})}},{key:"announceMessage",value:function(e){this._listeners.forEach(function(t){t.message&&t.message(e)})}},{key:"announceNetworkUp",value:function(){var e={};e.category=o.default.PNNetworkUpCategory,this.announceStatus(e)}},{key:"announceNetworkDown",value:function(){var e={};e.category=o.default.PNNetworkDownCategory,this.announceStatus(e)}}]),e}();t.default=a,e.exports=t.default},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={PNNetworkUpCategory:"PNNetworkUpCategory",PNNetworkDownCategory:"PNNetworkDownCategory",PNNetworkIssuesCategory:"PNNetworkIssuesCategory",PNTimeoutCategory:"PNTimeoutCategory",PNBadRequestCategory:"PNBadRequestCategory",PNAccessDeniedCategory:"PNAccessDeniedCategory",PNUnknownCategory:"PNUnknownCategory",PNReconnectedCategory:"PNReconnectedCategory",PNConnectedCategory:"PNConnectedCategory",PNRequestMessageCountExceededCategory:"PNRequestMessageCountExceededCategory"},e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(12),o=(function(e){e&&e.__esModule}(s),n(5),function(){function e(t){var n=t.timeEndpoint;r(this,e),this._timeEndpoint=n}return i(e,[{key:"onReconnection",value:function(e){this._reconnectionCallback=e}},{key:"startPolling",value:function(){this._timeTimer=setInterval(this._performTimeLoop.bind(this),3e3)}},{key:"stopPolling",value:function(){clearInterval(this._timeTimer)}},{key:"_performTimeLoop",value:function(){var e=this;this._timeEndpoint(function(t){t.error||(clearInterval(e._timeTimer),e._reconnectionCallback())})}}]),e}());t.default=o,e.exports=t.default},function(e,t,n){"use strict";function r(){return h.default.PNTimeOperation}function i(){return"/time/0"}function s(e){return e.config.getTransactionTimeout()}function o(){return{}}function a(){return!1}function u(e,t){return{timetoken:t[0]}}function c(){}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=r,t.getURL=i,t.getRequestTimeout=s,t.prepareParams=o,t.isAuthSupported=a,t.handleResponse=u,t.validateParams=c;var l=(n(5),n(13)),h=function(e){return e&&e.__esModule?e:{default:e}}(l)},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={PNTimeOperation:"PNTimeOperation",PNHistoryOperation:"PNHistoryOperation",PNDeleteMessagesOperation:"PNDeleteMessagesOperation",PNFetchMessagesOperation:"PNFetchMessagesOperation",PNMessageCounts:"PNMessageCountsOperation",PNSubscribeOperation:"PNSubscribeOperation",PNUnsubscribeOperation:"PNUnsubscribeOperation",PNPublishOperation:"PNPublishOperation",PNPushNotificationEnabledChannelsOperation:"PNPushNotificationEnabledChannelsOperation",PNRemoveAllPushNotificationsOperation:"PNRemoveAllPushNotificationsOperation",PNWhereNowOperation:"PNWhereNowOperation",PNSetStateOperation:"PNSetStateOperation",PNHereNowOperation:"PNHereNowOperation",PNGetStateOperation:"PNGetStateOperation",PNHeartbeatOperation:"PNHeartbeatOperation",PNChannelGroupsOperation:"PNChannelGroupsOperation",PNRemoveGroupOperation:"PNRemoveGroupOperation",PNChannelsForGroupOperation:"PNChannelsForGroupOperation",PNAddChannelsToGroupOperation:"PNAddChannelsToGroupOperation",PNRemoveChannelsFromGroupOperation:"PNRemoveChannelsFromGroupOperation",PNAccessManagerGrant:"PNAccessManagerGrant",PNAccessManagerAudit:"PNAccessManagerAudit"},e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(2),o=(function(e){e&&e.__esModule}(s),n(5),function(e){var t=0;if(0===e.length)return t;for(var n=0;n<e.length;n+=1){t=(t<<5)-t+e.charCodeAt(n),t&=t}return t}),a=function(){function e(t){var n=t.config;r(this,e),this.hashHistory=[],this._config=n}return i(e,[{key:"getKey",value:function(e){var t=o(JSON.stringify(e.payload)).toString();return e.publishMetaData.publishTimetoken+"-"+t}},{key:"isDuplicate",value:function(e){return this.hashHistory.includes(this.getKey(e))}},{key:"addEntry",value:function(e){this.hashHistory.length>=this._config.maximumCacheSize&&this.hashHistory.shift(),this.hashHistory.push(this.getKey(e))}},{key:"clearHistory",value:function(){this.hashHistory=[]}}]),e}();t.default=a,e.exports=t.default},function(e,t){"use strict";function n(e){var t=[];return Object.keys(e).forEach(function(e){return t.push(e)}),t}function r(e){return encodeURIComponent(e).replace(/[!~*'()]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}function i(e){return n(e).sort()}function s(e){return i(e).map(function(t){return t+"="+r(e[t])}).join("&")}function o(e,t){return-1!==e.indexOf(t,this.length-t.length)}function a(){var e=void 0,t=void 0;return{promise:new Promise(function(n,r){e=n,t=r}),reject:t,fulfill:e}}e.exports={signPamFromParams:s,endsWith:o,createPromise:a,encodeString:r}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function a(e,t){return e.type=t,e.error=!0,e}function u(e){return a({message:e},"validationError")}function c(e,t,n){return e.usePost&&e.usePost(t,n)?e.postURL(t,n):e.getURL(t,n)}function l(e){if(e.sdkName)return e.sdkName;var t="PubNub-JS-"+e.sdkFamily;return e.partnerId&&(t+="-"+e.partnerId),t+="/"+e.getVersion()}function h(e,t,n){var r=e.config,i=e.crypto;n.timestamp=Math.floor((new Date).getTime()/1e3);var s=r.subscribeKey+"\n"+r.publishKey+"\n"+t+"\n";s+=y.default.signPamFromParams(n);var o=i.HMACSHA256(s);o=o.replace(/\+/g,"-"),o=o.replace(/\//g,"_"),n.signature=o}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=e.networking,r=e.config,i=null,s=null,o={};t.getOperation()===v.default.PNTimeOperation||t.getOperation()===v.default.PNChannelGroupsOperation?i=arguments.length<=2?void 0:arguments[2]:(o=arguments.length<=2?void 0:arguments[2],i=arguments.length<=3?void 0:arguments[3]),"undefined"==typeof Promise||i||(s=y.default.createPromise());var a=t.validateParams(e,o);if(!a){var f=t.prepareParams(e,o),d=c(t,e,o),g=void 0,b={url:d,operation:t.getOperation(),timeout:t.getRequestTimeout(e)};f.uuid=r.UUID,f.pnsdk=l(r),r.useInstanceId&&(f.instanceid=r.instanceId),r.useRequestId&&(f.requestid=p.default.createUUID()),t.isAuthSupported()&&r.getAuthKey()&&(f.auth=r.getAuthKey()),r.secretKey&&h(e,d,f);var m=function(n,r){if(n.error)return void(i?i(n):s&&s.reject(new _("PubNub call failed, check status for details",n)));var a=t.handleResponse(e,r,o);i?i(n,a):s&&s.fulfill(a)};if(t.usePost&&t.usePost(e,o)){var k=t.postPayload(e,o);g=n.POST(f,k,b,m)}else g=t.useDelete&&t.useDelete()?n.DELETE(f,b,m):n.GET(f,b,m);return t.getOperation()===v.default.PNSubscribeOperation?g:s?s.promise:void 0}return i?i(u(a)):s?(s.reject(new _("Validation failed, check status for details",u(a))),s.promise):void 0};var f=n(3),p=r(f),d=(n(5),n(15)),y=r(d),g=n(2),b=(r(g),n(13)),v=r(b),_=function(e){function t(e,n){i(this,t);var r=s(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return r.name=r.constructor.name,r.status=n,r.message=e,r}return o(t,e),t}(Error);e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(){return f.default.PNAddChannelsToGroupOperation}function s(e,t){var n=t.channels,r=t.channelGroup,i=e.config;return r?n&&0!==n.length?i.subscribeKey?void 0:"Missing Subscribe Key":"Missing Channels":"Missing Channel Group"}function o(e,t){var n=t.channelGroup;return"/v1/channel-registration/sub-key/"+e.config.subscribeKey+"/channel-group/"+d.default.encodeString(n)}function a(e){return e.config.getTransactionTimeout()}function u(){return!0}function c(e,t){var n=t.channels;return{add:(void 0===n?[]:n).join(",")}}function l(){return{}}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=i,t.validateParams=s,t.getURL=o,t.getRequestTimeout=a,t.isAuthSupported=u,t.prepareParams=c,t.handleResponse=l;var h=(n(5),n(13)),f=r(h),p=n(15),d=r(p)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(){return f.default.PNRemoveChannelsFromGroupOperation}function s(e,t){var n=t.channels,r=t.channelGroup,i=e.config;return r?n&&0!==n.length?i.subscribeKey?void 0:"Missing Subscribe Key":"Missing Channels":"Missing Channel Group"}function o(e,t){var n=t.channelGroup;return"/v1/channel-registration/sub-key/"+e.config.subscribeKey+"/channel-group/"+d.default.encodeString(n)}function a(e){return e.config.getTransactionTimeout()}function u(){return!0}function c(e,t){var n=t.channels;return{remove:(void 0===n?[]:n).join(",")}}function l(){return{}}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=i,t.validateParams=s,t.getURL=o,t.getRequestTimeout=a,t.isAuthSupported=u,t.prepareParams=c,t.handleResponse=l;var h=(n(5),n(13)),f=r(h),p=n(15),d=r(p)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(){return f.default.PNRemoveGroupOperation}function s(e,t){var n=t.channelGroup,r=e.config;return n?r.subscribeKey?void 0:"Missing Subscribe Key":"Missing Channel Group"}function o(e,t){var n=t.channelGroup;return"/v1/channel-registration/sub-key/"+e.config.subscribeKey+"/channel-group/"+d.default.encodeString(n)+"/remove"}function a(){return!0}function u(e){return e.config.getTransactionTimeout()}function c(){return{}}function l(){return{}}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=i,t.validateParams=s,t.getURL=o,t.isAuthSupported=a,t.getRequestTimeout=u,t.prepareParams=c,t.handleResponse=l;var h=(n(5),n(13)),f=r(h),p=n(15),d=r(p)},function(e,t,n){"use strict";function r(){return h.default.PNChannelGroupsOperation}function i(e){if(!e.config.subscribeKey)return"Missing Subscribe Key"}function s(e){return"/v1/channel-registration/sub-key/"+e.config.subscribeKey+"/channel-group"}function o(e){return e.config.getTransactionTimeout()}function a(){return!0}function u(){return{}}function c(e,t){return{groups:t.payload.groups}}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=r,t.validateParams=i,t.getURL=s,t.getRequestTimeout=o,t.isAuthSupported=a,t.prepareParams=u,t.handleResponse=c;var l=(n(5),n(13)),h=function(e){return e&&e.__esModule?e:{default:e}}(l)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(){return f.default.PNChannelsForGroupOperation}function s(e,t){var n=t.channelGroup,r=e.config;return n?r.subscribeKey?void 0:"Missing Subscribe Key":"Missing Channel Group"}function o(e,t){var n=t.channelGroup;return"/v1/channel-registration/sub-key/"+e.config.subscribeKey+"/channel-group/"+d.default.encodeString(n)}function a(e){return e.config.getTransactionTimeout()}function u(){return!0}function c(){return{}}function l(e,t){return{channels:t.payload.channels}}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=i,t.validateParams=s,t.getURL=o,t.getRequestTimeout=a,t.isAuthSupported=u,t.prepareParams=c,t.handleResponse=l;var h=(n(5),n(13)),f=r(h),p=n(15),d=r(p)},function(e,t,n){"use strict";function r(){return h.default.PNPushNotificationEnabledChannelsOperation}function i(e,t){var n=t.device,r=t.pushGateway,i=t.channels,s=e.config;return n?r?i&&0!==i.length?s.subscribeKey?void 0:"Missing Subscribe Key":"Missing Channels":"Missing GW Type (pushGateway: gcm or apns)":"Missing Device ID (device)"}function s(e,t){var n=t.device;return"/v1/push/sub-key/"+e.config.subscribeKey+"/devices/"+n}function o(e){return e.config.getTransactionTimeout()}function a(){return!0}function u(e,t){var n=t.pushGateway,r=t.channels;return{type:n,add:(void 0===r?[]:r).join(",")}}function c(){return{}}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=r,t.validateParams=i,t.getURL=s,t.getRequestTimeout=o,t.isAuthSupported=a,t.prepareParams=u,t.handleResponse=c;var l=(n(5),n(13)),h=function(e){return e&&e.__esModule?e:{default:e}}(l)},function(e,t,n){"use strict";function r(){return h.default.PNPushNotificationEnabledChannelsOperation}function i(e,t){var n=t.device,r=t.pushGateway,i=t.channels,s=e.config;return n?r?i&&0!==i.length?s.subscribeKey?void 0:"Missing Subscribe Key":"Missing Channels":"Missing GW Type (pushGateway: gcm or apns)":"Missing Device ID (device)"}function s(e,t){var n=t.device;return"/v1/push/sub-key/"+e.config.subscribeKey+"/devices/"+n}function o(e){return e.config.getTransactionTimeout()}function a(){return!0}function u(e,t){var n=t.pushGateway,r=t.channels;return{type:n,remove:(void 0===r?[]:r).join(",")}}function c(){return{}}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=r,t.validateParams=i,t.getURL=s,t.getRequestTimeout=o,t.isAuthSupported=a,t.prepareParams=u,t.handleResponse=c;var l=(n(5),n(13)),h=function(e){return e&&e.__esModule?e:{default:e}}(l)},function(e,t,n){"use strict";function r(){return h.default.PNPushNotificationEnabledChannelsOperation}function i(e,t){var n=t.device,r=t.pushGateway,i=e.config;return n?r?i.subscribeKey?void 0:"Missing Subscribe Key":"Missing GW Type (pushGateway: gcm or apns)":"Missing Device ID (device)"}function s(e,t){var n=t.device;return"/v1/push/sub-key/"+e.config.subscribeKey+"/devices/"+n}function o(e){return e.config.getTransactionTimeout()}function a(){return!0}function u(e,t){return{type:t.pushGateway}}function c(e,t){return{channels:t}}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=r,t.validateParams=i,t.getURL=s,t.getRequestTimeout=o,t.isAuthSupported=a,t.prepareParams=u,t.handleResponse=c;var l=(n(5),n(13)),h=function(e){return e&&e.__esModule?e:{default:e}}(l)},function(e,t,n){"use strict";function r(){return h.default.PNRemoveAllPushNotificationsOperation}function i(e,t){var n=t.device,r=t.pushGateway,i=e.config;return n?r?i.subscribeKey?void 0:"Missing Subscribe Key":"Missing GW Type (pushGateway: gcm or apns)":"Missing Device ID (device)"}function s(e,t){var n=t.device;return"/v1/push/sub-key/"+e.config.subscribeKey+"/devices/"+n+"/remove"}function o(e){return e.config.getTransactionTimeout()}function a(){return!0}function u(e,t){return{type:t.pushGateway}}function c(){return{}}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=r,t.validateParams=i,t.getURL=s,t.getRequestTimeout=o,t.isAuthSupported=a,t.prepareParams=u,t.handleResponse=c;var l=(n(5),n(13)),h=function(e){return e&&e.__esModule?e:{default:e}}(l)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(){return f.default.PNUnsubscribeOperation}function s(e){if(!e.config.subscribeKey)return"Missing Subscribe Key"}function o(e,t){var n=e.config,r=t.channels,i=void 0===r?[]:r,s=i.length>0?i.join(","):",";return"/v2/presence/sub-key/"+n.subscribeKey+"/channel/"+d.default.encodeString(s)+"/leave"}function a(e){return e.config.getTransactionTimeout()}function u(){return!0}function c(e,t){var n=t.channelGroups,r=void 0===n?[]:n,i={};return r.length>0&&(i["channel-group"]=r.join(",")),i}function l(){return{}}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=i,t.validateParams=s,t.getURL=o,t.getRequestTimeout=a,t.isAuthSupported=u,t.prepareParams=c,t.handleResponse=l;var h=(n(5),n(13)),f=r(h),p=n(15),d=r(p)},function(e,t,n){"use strict";function r(){return h.default.PNWhereNowOperation}function i(e){if(!e.config.subscribeKey)return"Missing Subscribe Key"}function s(e,t){var n=e.config,r=t.uuid,i=void 0===r?n.UUID:r;return"/v2/presence/sub-key/"+n.subscribeKey+"/uuid/"+i}function o(e){return e.config.getTransactionTimeout()}function a(){return!0}function u(){return{}}function c(e,t){return t.payload?{channels:t.payload.channels}:{channels:[]}}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=r,t.validateParams=i,t.getURL=s,t.getRequestTimeout=o,t.isAuthSupported=a,t.prepareParams=u,t.handleResponse=c;var l=(n(5),n(13)),h=function(e){return e&&e.__esModule?e:{default:e}}(l)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(){return f.default.PNHeartbeatOperation}function s(e){if(!e.config.subscribeKey)return"Missing Subscribe Key"}function o(e,t){var n=e.config,r=t.channels,i=void 0===r?[]:r,s=i.length>0?i.join(","):",";return"/v2/presence/sub-key/"+n.subscribeKey+"/channel/"+d.default.encodeString(s)+"/heartbeat"}function a(){return!0}function u(e){return e.config.getTransactionTimeout()}function c(e,t){var n=t.channelGroups,r=void 0===n?[]:n,i=t.state,s=void 0===i?{}:i,o=e.config,a={};return r.length>0&&(a["channel-group"]=r.join(",")),a.state=JSON.stringify(s),a.heartbeat=o.getPresenceTimeout(),a}function l(){return{}}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=i,t.validateParams=s,t.getURL=o,t.isAuthSupported=a,t.getRequestTimeout=u,t.prepareParams=c,t.handleResponse=l;var h=(n(5),n(13)),f=r(h),p=n(15),d=r(p)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(){return f.default.PNGetStateOperation}function s(e){if(!e.config.subscribeKey)return"Missing Subscribe Key"}function o(e,t){var n=e.config,r=t.uuid,i=void 0===r?n.UUID:r,s=t.channels,o=void 0===s?[]:s,a=o.length>0?o.join(","):",";return"/v2/presence/sub-key/"+n.subscribeKey+"/channel/"+d.default.encodeString(a)+"/uuid/"+i}function a(e){return e.config.getTransactionTimeout()}function u(){return!0}function c(e,t){var n=t.channelGroups,r=void 0===n?[]:n,i={};return r.length>0&&(i["channel-group"]=r.join(",")),i}function l(e,t,n){var r=n.channels,i=void 0===r?[]:r,s=n.channelGroups,o=void 0===s?[]:s,a={};return 1===i.length&&0===o.length?a[i[0]]=t.payload:a=t.payload,{channels:a}}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=i,t.validateParams=s,t.getURL=o,t.getRequestTimeout=a,t.isAuthSupported=u,t.prepareParams=c,t.handleResponse=l;var h=(n(5),n(13)),f=r(h),p=n(15),d=r(p)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(){return f.default.PNSetStateOperation}function s(e,t){var n=e.config,r=t.state,i=t.channels,s=void 0===i?[]:i,o=t.channelGroups,a=void 0===o?[]:o;return r?n.subscribeKey?0===s.length&&0===a.length?"Please provide a list of channels and/or channel-groups":void 0:"Missing Subscribe Key":"Missing State"}function o(e,t){var n=e.config,r=t.channels,i=void 0===r?[]:r,s=i.length>0?i.join(","):",";return"/v2/presence/sub-key/"+n.subscribeKey+"/channel/"+d.default.encodeString(s)+"/uuid/"+n.UUID+"/data"}function a(e){return e.config.getTransactionTimeout()}function u(){return!0}function c(e,t){var n=t.state,r=t.channelGroups,i=void 0===r?[]:r,s={};return s.state=JSON.stringify(n),i.length>0&&(s["channel-group"]=i.join(",")),s}function l(e,t){return{state:t.payload}}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=i,t.validateParams=s,t.getURL=o,t.getRequestTimeout=a,t.isAuthSupported=u,t.prepareParams=c,t.handleResponse=l;var h=(n(5),n(13)),f=r(h),p=n(15),d=r(p)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(){return f.default.PNHereNowOperation}function s(e){if(!e.config.subscribeKey)return"Missing Subscribe Key"}function o(e,t){var n=e.config,r=t.channels,i=void 0===r?[]:r,s=t.channelGroups,o=void 0===s?[]:s,a="/v2/presence/sub-key/"+n.subscribeKey;if(i.length>0||o.length>0){var u=i.length>0?i.join(","):",";a+="/channel/"+d.default.encodeString(u)}return a}function a(e){return e.config.getTransactionTimeout()}function u(){return!0}function c(e,t){var n=t.channelGroups,r=void 0===n?[]:n,i=t.includeUUIDs,s=void 0===i||i,o=t.includeState,a=void 0!==o&&o,u={};return s||(u.disable_uuids=1),a&&(u.state=1),r.length>0&&(u["channel-group"]=r.join(",")),u}function l(e,t,n){var r=n.channels,i=void 0===r?[]:r,s=n.channelGroups,o=void 0===s?[]:s,a=n.includeUUIDs,u=void 0===a||a,c=n.includeState,l=void 0!==c&&c;return i.length>1||o.length>0||0===o.length&&0===i.length?function(){var e={};return e.totalChannels=t.payload.total_channels,e.totalOccupancy=t.payload.total_occupancy,e.channels={},Object.keys(t.payload.channels).forEach(function(n){var r=t.payload.channels[n],i=[];return e.channels[n]={occupants:i,name:n,occupancy:r.occupancy},u&&r.uuids.forEach(function(e){l?i.push({state:e.state,uuid:e.uuid}):i.push({state:null,uuid:e})}),e}),e}():function(){var e={},n=[];return e.totalChannels=1,e.totalOccupancy=t.occupancy,e.channels={},e.channels[i[0]]={occupants:n,name:i[0],occupancy:t.occupancy},u&&t.uuids&&t.uuids.forEach(function(e){l?n.push({state:e.state,uuid:e.uuid}):n.push({state:null,uuid:e})}),e}()}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=i,t.validateParams=s,t.getURL=o,t.getRequestTimeout=a,t.isAuthSupported=u,t.prepareParams=c,t.handleResponse=l;var h=(n(5),n(13)),f=r(h),p=n(15),d=r(p)},function(e,t,n){"use strict";function r(){return h.default.PNAccessManagerAudit}function i(e){if(!e.config.subscribeKey)return"Missing Subscribe Key"}function s(e){return"/v2/auth/audit/sub-key/"+e.config.subscribeKey}function o(e){return e.config.getTransactionTimeout()}function a(){return!1}function u(e,t){var n=t.channel,r=t.channelGroup,i=t.authKeys,s=void 0===i?[]:i,o={};return n&&(o.channel=n),r&&(o["channel-group"]=r),s.length>0&&(o.auth=s.join(",")),o}function c(e,t){return t.payload}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=r,t.validateParams=i,t.getURL=s,t.getRequestTimeout=o,t.isAuthSupported=a,t.prepareParams=u,t.handleResponse=c;var l=(n(5),n(13)),h=function(e){return e&&e.__esModule?e:{default:e}}(l)},function(e,t,n){"use strict";function r(){return h.default.PNAccessManagerGrant}function i(e){var t=e.config;return t.subscribeKey?t.publishKey?t.secretKey?void 0:"Missing Secret Key":"Missing Publish Key":"Missing Subscribe Key"}function s(e){return"/v2/auth/grant/sub-key/"+e.config.subscribeKey}function o(e){return e.config.getTransactionTimeout()}function a(){return!1}function u(e,t){var n=t.channels,r=void 0===n?[]:n,i=t.channelGroups,s=void 0===i?[]:i,o=t.ttl,a=t.read,u=void 0!==a&&a,c=t.write,l=void 0!==c&&c,h=t.manage,f=void 0!==h&&h,p=t.authKeys,d=void 0===p?[]:p,y={};return y.r=u?"1":"0",y.w=l?"1":"0",y.m=f?"1":"0",r.length>0&&(y.channel=r.join(",")),s.length>0&&(y["channel-group"]=s.join(",")),
19624
19839
  d.length>0&&(y.auth=d.join(",")),(o||0===o)&&(y.ttl=o),y}function c(){return{}}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=r,t.validateParams=i,t.getURL=s,t.getRequestTimeout=o,t.isAuthSupported=a,t.prepareParams=u,t.handleResponse=c;var l=(n(5),n(13)),h=function(e){return e&&e.__esModule?e:{default:e}}(l)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var n=e.crypto,r=e.config,i=JSON.stringify(t);return r.cipherKey&&(i=n.encrypt(i),i=JSON.stringify(i)),i}function s(){return b.default.PNPublishOperation}function o(e,t){var n=e.config,r=t.message;return t.channel?r?n.subscribeKey?void 0:"Missing Subscribe Key":"Missing Message":"Missing Channel"}function a(e,t){var n=t.sendByPost;return void 0!==n&&n}function u(e,t){var n=e.config,r=t.channel,s=t.message,o=i(e,s);return"/publish/"+n.publishKey+"/"+n.subscribeKey+"/0/"+_.default.encodeString(r)+"/0/"+_.default.encodeString(o)}function c(e,t){var n=e.config,r=t.channel;return"/publish/"+n.publishKey+"/"+n.subscribeKey+"/0/"+_.default.encodeString(r)+"/0"}function l(e){return e.config.getTransactionTimeout()}function h(){return!0}function f(e,t){return i(e,t.message)}function p(e,t){var n=t.meta,r=t.replicate,i=void 0===r||r,s=t.storeInHistory,o=t.ttl,a={};return null!=s&&(a.store=s?"1":"0"),o&&(a.ttl=o),!1===i&&(a.norep="true"),n&&"object"===(void 0===n?"undefined":y(n))&&(a.meta=JSON.stringify(n)),a}function d(e,t){return{timetoken:t[2]}}Object.defineProperty(t,"__esModule",{value:!0});var y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.getOperation=s,t.validateParams=o,t.usePost=a,t.getURL=u,t.postURL=c,t.getRequestTimeout=l,t.isAuthSupported=h,t.postPayload=f,t.prepareParams=p,t.handleResponse=d;var g=(n(5),n(13)),b=r(g),v=n(15),_=r(v)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var n=e.config,r=e.crypto;if(!n.cipherKey)return t;try{return r.decrypt(t)}catch(e){return t}}function s(){return p.default.PNHistoryOperation}function o(e,t){var n=t.channel,r=e.config;return n?r.subscribeKey?void 0:"Missing Subscribe Key":"Missing channel"}function a(e,t){var n=t.channel;return"/v2/history/sub-key/"+e.config.subscribeKey+"/channel/"+y.default.encodeString(n)}function u(e){return e.config.getTransactionTimeout()}function c(){return!0}function l(e,t){var n=t.start,r=t.end,i=t.reverse,s=t.count,o=void 0===s?100:s,a=t.stringifiedTimeToken,u=void 0!==a&&a,c={include_token:"true"};return c.count=o,n&&(c.start=n),r&&(c.end=r),u&&(c.string_message_token="true"),null!=i&&(c.reverse=i.toString()),c}function h(e,t){var n={messages:[],startTimeToken:t[1],endTimeToken:t[2]};return t[0].forEach(function(t){var r={timetoken:t.timetoken,entry:i(e,t.message)};n.messages.push(r)}),n}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=s,t.validateParams=o,t.getURL=a,t.getRequestTimeout=u,t.isAuthSupported=c,t.prepareParams=l,t.handleResponse=h;var f=(n(5),n(13)),p=r(f),d=n(15),y=r(d)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(){return p.default.PNDeleteMessagesOperation}function s(e,t){var n=t.channel,r=e.config;return n?r.subscribeKey?void 0:"Missing Subscribe Key":"Missing channel"}function o(){return!0}function a(e,t){var n=t.channel;return"/v3/history/sub-key/"+e.config.subscribeKey+"/channel/"+y.default.encodeString(n)}function u(e){return e.config.getTransactionTimeout()}function c(){return!0}function l(e,t){var n=t.start,r=t.end,i={};return n&&(i.start=n),r&&(i.end=r),i}function h(e,t){return t.payload}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=i,t.validateParams=s,t.useDelete=o,t.getURL=a,t.getRequestTimeout=u,t.isAuthSupported=c,t.prepareParams=l,t.handleResponse=h;var f=(n(5),n(13)),p=r(f),d=n(15),y=r(d)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(){return p.default.PNMessageCounts}function s(e,t){var n=t.channels,r=t.timetoken,i=t.channelTimetokens,s=e.config;return n?r&&i?"timetoken and channelTimetokens are incompatible together":r&&i&&i.length>1&&n.length!==i.length?"Length of channelTimetokens and channels do not match":s.subscribeKey?void 0:"Missing Subscribe Key":"Missing channel"}function o(e,t){var n=t.channels,r=e.config,i=n.join(",");return"/v3/history/sub-key/"+r.subscribeKey+"/message-counts/"+y.default.encodeString(i)}function a(e){return e.config.getTransactionTimeout()}function u(){return!0}function c(e,t){var n=t.timetoken,r=t.channelTimetokens,i={};if(r&&1===r.length){var s=h(r,1),o=s[0];i.timetoken=o}else r?i.channelsTimetoken=r.join(","):n&&(i.timetoken=n);return i}function l(e,t){return{channels:t.channels}}Object.defineProperty(t,"__esModule",{value:!0});var h=function(){function e(e,t){var n=[],r=!0,i=!1,s=void 0;try{for(var o,a=e[Symbol.iterator]();!(r=(o=a.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,s=e}finally{try{!r&&a.return&&a.return()}finally{if(i)throw s}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();t.getOperation=i,t.validateParams=s,t.getURL=o,t.getRequestTimeout=a,t.isAuthSupported=u,t.prepareParams=c,t.handleResponse=l;var f=n(13),p=r(f),d=n(15),y=r(d)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var n=e.config,r=e.crypto;if(!n.cipherKey)return t;try{return r.decrypt(t)}catch(e){return t}}function s(){return p.default.PNFetchMessagesOperation}function o(e,t){var n=t.channels,r=e.config;return n&&0!==n.length?r.subscribeKey?void 0:"Missing Subscribe Key":"Missing channels"}function a(e,t){var n=t.channels,r=void 0===n?[]:n,i=e.config,s=r.length>0?r.join(","):",";return"/v3/history/sub-key/"+i.subscribeKey+"/channel/"+y.default.encodeString(s)}function u(e){return e.config.getTransactionTimeout()}function c(){return!0}function l(e,t){var n=t.start,r=t.end,i=t.count,s=t.stringifiedTimeToken,o=void 0!==s&&s,a={};return i&&(a.max=i),n&&(a.start=n),r&&(a.end=r),o&&(a.string_message_token="true"),a}function h(e,t){var n={channels:{}};return Object.keys(t.channels||{}).forEach(function(r){n.channels[r]=[],(t.channels[r]||[]).forEach(function(t){var s={};s.channel=r,s.subscription=null,s.timetoken=t.timetoken,s.message=i(e,t.message),n.channels[r].push(s)})}),n}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=s,t.validateParams=o,t.getURL=a,t.getRequestTimeout=u,t.isAuthSupported=c,t.prepareParams=l,t.handleResponse=h;var f=(n(5),n(13)),p=r(f),d=n(15),y=r(d)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(){return f.default.PNSubscribeOperation}function s(e){if(!e.config.subscribeKey)return"Missing Subscribe Key"}function o(e,t){var n=e.config,r=t.channels,i=void 0===r?[]:r,s=i.length>0?i.join(","):",";return"/v2/subscribe/"+n.subscribeKey+"/"+d.default.encodeString(s)+"/0"}function a(e){return e.config.getSubscribeTimeout()}function u(){return!0}function c(e,t){var n=e.config,r=t.state,i=t.channelGroups,s=void 0===i?[]:i,o=t.timetoken,a=t.filterExpression,u=t.region,c={heartbeat:n.getPresenceTimeout()};return s.length>0&&(c["channel-group"]=s.join(",")),a&&a.length>0&&(c["filter-expr"]=a),Object.keys(r).length&&(c.state=JSON.stringify(r)),o&&(c.tt=o),u&&(c.tr=u),c}function l(e,t){var n=[];t.m.forEach(function(e){var t={publishTimetoken:e.p.t,region:e.p.r},r={shard:parseInt(e.a,10),subscriptionMatch:e.b,channel:e.c,payload:e.d,flags:e.f,issuingClientId:e.i,subscribeKey:e.k,originationTimetoken:e.o,userMetadata:e.u,publishMetaData:t};n.push(r)});var r={timetoken:t.t.t,region:t.t.r};return{messages:n,metadata:r}}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=i,t.validateParams=s,t.getURL=o,t.getRequestTimeout=a,t.isAuthSupported=u,t.prepareParams=c,t.handleResponse=l;var h=(n(5),n(13)),f=r(h),p=n(15),d=r(p)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(2),a=(r(o),n(10)),u=r(a),c=(n(5),function(){function e(t){var n=this;i(this,e),this._modules={},Object.keys(t).forEach(function(e){n._modules[e]=t[e].bind(n)})}return s(e,[{key:"init",value:function(e){this._config=e,this._maxSubDomain=20,this._currentSubDomain=Math.floor(Math.random()*this._maxSubDomain),this._providedFQDN=(this._config.secure?"https://":"http://")+this._config.origin,this._coreParams={},this.shiftStandardOrigin()}},{key:"nextOrigin",value:function(){if(-1===this._providedFQDN.indexOf("ps."))return this._providedFQDN;var e=void 0;return this._currentSubDomain=this._currentSubDomain+1,this._currentSubDomain>=this._maxSubDomain&&(this._currentSubDomain=1),e=this._currentSubDomain.toString(),this._providedFQDN.replace("ps.","ps"+e+".")}},{key:"hasModule",value:function(e){return e in this._modules}},{key:"shiftStandardOrigin",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this._standardOrigin=this.nextOrigin(e),this._standardOrigin}},{key:"getStandardOrigin",value:function(){return this._standardOrigin}},{key:"POST",value:function(e,t,n,r){return this._modules.post(e,t,n,r)}},{key:"GET",value:function(e,t,n){return this._modules.get(e,t,n)}},{key:"DELETE",value:function(e,t,n){return this._modules.del(e,t,n)}},{key:"_detectErrorCategory",value:function(e){if("ENOTFOUND"===e.code)return u.default.PNNetworkIssuesCategory;if("ECONNREFUSED"===e.code)return u.default.PNNetworkIssuesCategory;if("ECONNRESET"===e.code)return u.default.PNNetworkIssuesCategory;if("EAI_AGAIN"===e.code)return u.default.PNNetworkIssuesCategory;if(0===e.status||e.hasOwnProperty("status")&&void 0===e.status)return u.default.PNNetworkIssuesCategory;if(e.timeout)return u.default.PNTimeoutCategory;if("ETIMEDOUT"===e.code)return u.default.PNNetworkIssuesCategory;if(e.response){if(e.response.badRequest)return u.default.PNBadRequestCategory;if(e.response.forbidden)return u.default.PNAccessDeniedCategory}return u.default.PNUnknownCategory}}]),e}());t.default=c,e.exports=t.default},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={get:function(e){try{return localStorage.getItem(e)}catch(e){return null}},set:function(e,t){try{return localStorage.setItem(e,t)}catch(e){return null}}},e.exports=t.default},function(e,t,n){"use strict";function r(e){var t=(new Date).getTime(),n=(new Date).toISOString(),r=function(){return console&&console.log?console:window&&window.console&&window.console.log?window.console:console}();r.log("<<<<<"),r.log("["+n+"]","\n",e.url,"\n",e.qs),r.log("-----"),e.on("response",function(n){var i=(new Date).getTime(),s=i-t,o=(new Date).toISOString();r.log(">>>>>>"),r.log("["+o+" / "+s+"]","\n",e.url,"\n",e.qs,"\n",n.text),r.log("-----")})}function i(e,t,n){var i=this;return this._config.logVerbosity&&(e=e.use(r)),this._config.proxy&&this._modules.proxy&&(e=this._modules.proxy.call(this,e)),this._config.keepAlive&&this._modules.keepAlive&&(e=this._modules.keepAlive(e)),e.timeout(t.timeout).end(function(e,r){var s=void 0,o={};if(o.error=null!==e,o.operation=t.operation,r&&r.status&&(o.statusCode=r.status),e){if(e.response&&e.response.text&&!i._config.logVerbosity)try{o.errorData=JSON.parse(e.response.text)}catch(t){o.errorData=e}else o.errorData=e;return o.category=i._detectErrorCategory(e),n(o,null)}try{s=JSON.parse(r.text)}catch(e){return o.errorData=r,o.error=!0,n(o,null)}return s.error&&1===s.error&&s.status&&s.message&&s.service?(o.errorData=s,o.statusCode=s.status,o.error=!0,o.category=i._detectErrorCategory(o),n(o,null)):n(o,s)})}function s(e,t,n){var r=c.default.get(this.getStandardOrigin()+t.url).query(e);return i.call(this,r,t,n)}function o(e,t,n,r){var s=c.default.post(this.getStandardOrigin()+n.url).query(e).send(t);return i.call(this,s,n,r)}function a(e,t,n){var r=c.default.delete(this.getStandardOrigin()+t.url).query(e);return i.call(this,r,t,n)}Object.defineProperty(t,"__esModule",{value:!0}),t.get=s,t.post=o,t.del=a;var u=n(43),c=function(e){return e&&e.__esModule?e:{default:e}}(u);n(5)},function(e,t,n){function r(){}function i(e){if(!y(e))return e;var t=[];for(var n in e)s(t,n,e[n]);return t.join("&")}function s(e,t,n){if(null!=n)if(Array.isArray(n))n.forEach(function(n){s(e,t,n)});else if(y(n))for(var r in n)s(e,t+"["+r+"]",n[r]);else e.push(encodeURIComponent(t)+"="+encodeURIComponent(n));else null===n&&e.push(encodeURIComponent(t))}function o(e){for(var t,n,r={},i=e.split("&"),s=0,o=i.length;s<o;++s)t=i[s],n=t.indexOf("="),-1==n?r[decodeURIComponent(t)]="":r[decodeURIComponent(t.slice(0,n))]=decodeURIComponent(t.slice(n+1));return r}function a(e){for(var t,n,r,i,s=e.split(/\r?\n/),o={},a=0,u=s.length;a<u;++a)n=s[a],-1!==(t=n.indexOf(":"))&&(r=n.slice(0,t).toLowerCase(),i=_(n.slice(t+1)),o[r]=i);return o}function u(e){return/[\/+]json($|[^-\w])/.test(e)}function c(e){this.req=e,this.xhr=this.req.xhr,this.text="HEAD"!=this.req.method&&(""===this.xhr.responseType||"text"===this.xhr.responseType)||void 0===this.xhr.responseType?this.xhr.responseText:null,this.statusText=this.req.xhr.statusText;var t=this.xhr.status;1223===t&&(t=204),this._setStatusProperties(t),this.header=this.headers=a(this.xhr.getAllResponseHeaders()),this.header["content-type"]=this.xhr.getResponseHeader("content-type"),this._setHeaderProperties(this.header),null===this.text&&e._responseType?this.body=this.xhr.response:this.body="HEAD"!=this.req.method?this._parseBody(this.text?this.text:this.xhr.response):null}function l(e,t){var n=this;this._query=this._query||[],this.method=e,this.url=t,this.header={},this._header={},this.on("end",function(){var e=null,t=null;try{t=new c(n)}catch(t){return e=new Error("Parser is unable to parse the response"),e.parse=!0,e.original=t,n.xhr?(e.rawResponse=void 0===n.xhr.responseType?n.xhr.responseText:n.xhr.response,e.status=n.xhr.status?n.xhr.status:null,e.statusCode=e.status):(e.rawResponse=null,e.status=null),n.callback(e)}n.emit("response",t);var r;try{n._isResponseOK(t)||(r=new Error(t.statusText||"Unsuccessful HTTP response"))}catch(e){r=e}r?(r.original=e,r.response=t,r.status=t.status,n.callback(r,t)):n.callback(null,t)})}function h(e,t,n){var r=v("DELETE",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r}var f;"undefined"!=typeof window?f=window:"undefined"!=typeof self?f=self:(console.warn("Using browser-only version of superagent in non-browser environment"),f=this);var p=n(44),d=n(45),y=n(46),g=n(47),b=n(49),v=t=e.exports=function(e,n){return"function"==typeof n?new t.Request("GET",e).end(n):1==arguments.length?new t.Request("GET",e):new t.Request(e,n)};t.Request=l,v.getXHR=function(){if(!(!f.XMLHttpRequest||f.location&&"file:"==f.location.protocol&&f.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(e){}throw Error("Browser-only version of superagent could not find XHR")};var _="".trim?function(e){return e.trim()}:function(e){return e.replace(/(^\s*|\s*$)/g,"")};v.serializeObject=i,v.parseString=o,v.types={html:"text/html",json:"application/json",xml:"text/xml",urlencoded:"application/x-www-form-urlencoded",form:"application/x-www-form-urlencoded","form-data":"application/x-www-form-urlencoded"},v.serialize={"application/x-www-form-urlencoded":i,"application/json":JSON.stringify},v.parse={"application/x-www-form-urlencoded":o,"application/json":JSON.parse},g(c.prototype),c.prototype._parseBody=function(e){var t=v.parse[this.type];return this.req._parser?this.req._parser(this,e):(!t&&u(this.type)&&(t=v.parse["application/json"]),t&&e&&(e.length||e instanceof Object)?t(e):null)},c.prototype.toError=function(){var e=this.req,t=e.method,n=e.url,r="cannot "+t+" "+n+" ("+this.status+")",i=new Error(r);return i.status=this.status,i.method=t,i.url=n,i},v.Response=c,p(l.prototype),d(l.prototype),l.prototype.type=function(e){return this.set("Content-Type",v.types[e]||e),this},l.prototype.accept=function(e){return this.set("Accept",v.types[e]||e),this},l.prototype.auth=function(e,t,n){1===arguments.length&&(t=""),"object"==typeof t&&null!==t&&(n=t,t=""),n||(n={type:"function"==typeof btoa?"basic":"auto"});var r=function(e){if("function"==typeof btoa)return btoa(e);throw new Error("Cannot use basic auth, btoa is not a function")};return this._auth(e,t,n,r)},l.prototype.query=function(e){return"string"!=typeof e&&(e=i(e)),e&&this._query.push(e),this},l.prototype.attach=function(e,t,n){if(t){if(this._data)throw Error("superagent can't mix .send() and .attach()");this._getFormData().append(e,t,n||t.name)}return this},l.prototype._getFormData=function(){return this._formData||(this._formData=new f.FormData),this._formData},l.prototype.callback=function(e,t){if(this._shouldRetry(e,t))return this._retry();var n=this._callback;this.clearTimeout(),e&&(this._maxRetries&&(e.retries=this._retries-1),this.emit("error",e)),n(e,t)},l.prototype.crossDomainError=function(){var e=new Error("Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.");e.crossDomain=!0,e.status=this.status,e.method=this.method,e.url=this.url,this.callback(e)},l.prototype.buffer=l.prototype.ca=l.prototype.agent=function(){return console.warn("This is not supported in browser version of superagent"),this},l.prototype.pipe=l.prototype.write=function(){throw Error("Streaming is not supported in browser version of superagent")},l.prototype._isHost=function(e){return e&&"object"==typeof e&&!Array.isArray(e)&&"[object Object]"!==Object.prototype.toString.call(e)},l.prototype.end=function(e){return this._endCalled&&console.warn("Warning: .end() was called twice. This is not supported in superagent"),this._endCalled=!0,this._callback=e||r,this._finalizeQueryString(),this._end()},l.prototype._end=function(){var e=this,t=this.xhr=v.getXHR(),n=this._formData||this._data;this._setTimeouts(),t.onreadystatechange=function(){var n=t.readyState;if(n>=2&&e._responseTimeoutTimer&&clearTimeout(e._responseTimeoutTimer),4==n){var r;try{r=t.status}catch(e){r=0}if(!r){if(e.timedout||e._aborted)return;return e.crossDomainError()}e.emit("end")}};var r=function(t,n){n.total>0&&(n.percent=n.loaded/n.total*100),n.direction=t,e.emit("progress",n)};if(this.hasListeners("progress"))try{t.onprogress=r.bind(null,"download"),t.upload&&(t.upload.onprogress=r.bind(null,"upload"))}catch(e){}try{this.username&&this.password?t.open(this.method,this.url,!0,this.username,this.password):t.open(this.method,this.url,!0)}catch(e){return this.callback(e)}if(this._withCredentials&&(t.withCredentials=!0),!this._formData&&"GET"!=this.method&&"HEAD"!=this.method&&"string"!=typeof n&&!this._isHost(n)){var i=this._header["content-type"],s=this._serializer||v.serialize[i?i.split(";")[0]:""];!s&&u(i)&&(s=v.serialize["application/json"]),s&&(n=s(n))}for(var o in this.header)null!=this.header[o]&&this.header.hasOwnProperty(o)&&t.setRequestHeader(o,this.header[o]);return this._responseType&&(t.responseType=this._responseType),this.emit("request",this),t.send(void 0!==n?n:null),this},v.agent=function(){return new b},["GET","POST","OPTIONS","PATCH","PUT","DELETE"].forEach(function(e){b.prototype[e.toLowerCase()]=function(t,n){var r=new v.Request(e,t);return this._setDefaults(r),n&&r.end(n),r}}),b.prototype.del=b.prototype.delete,v.get=function(e,t,n){var r=v("GET",e);return"function"==typeof t&&(n=t,t=null),t&&r.query(t),n&&r.end(n),r},v.head=function(e,t,n){var r=v("HEAD",e);return"function"==typeof t&&(n=t,t=null),t&&r.query(t),n&&r.end(n),r},v.options=function(e,t,n){var r=v("OPTIONS",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},v.del=h,v.delete=h,v.patch=function(e,t,n){var r=v("PATCH",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},v.post=function(e,t,n){var r=v("POST",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},v.put=function(e,t,n){var r=v("PUT",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r}},function(e,t,n){function r(e){if(e)return i(e)}function i(e){for(var t in r.prototype)e[t]=r.prototype[t];return e}e.exports=r,r.prototype.on=r.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},r.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},r.prototype.off=r.prototype.removeListener=r.prototype.removeAllListeners=r.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var r,i=0;i<n.length;i++)if((r=n[i])===t||r.fn===t){n.splice(i,1);break}return this},r.prototype.emit=function(e){this._callbacks=this._callbacks||{};var t=[].slice.call(arguments,1),n=this._callbacks["$"+e];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this},r.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},r.prototype.hasListeners=function(e){return!!this.listeners(e).length}},function(e,t,n){"use strict";function r(e){if(e)return i(e)}function i(e){for(var t in r.prototype)e[t]=r.prototype[t];return e}var s=n(46);e.exports=r,r.prototype.clearTimeout=function(){return clearTimeout(this._timer),clearTimeout(this._responseTimeoutTimer),delete this._timer,delete this._responseTimeoutTimer,this},r.prototype.parse=function(e){return this._parser=e,this},r.prototype.responseType=function(e){return this._responseType=e,this},r.prototype.serialize=function(e){return this._serializer=e,this},r.prototype.timeout=function(e){if(!e||"object"!=typeof e)return this._timeout=e,this._responseTimeout=0,this;for(var t in e)switch(t){case"deadline":this._timeout=e.deadline;break;case"response":this._responseTimeout=e.response;break;default:console.warn("Unknown timeout option",t)}return this},r.prototype.retry=function(e,t){return 0!==arguments.length&&!0!==e||(e=1),e<=0&&(e=0),this._maxRetries=e,this._retries=0,this._retryCallback=t,this};var o=["ECONNRESET","ETIMEDOUT","EADDRINFO","ESOCKETTIMEDOUT"];r.prototype._shouldRetry=function(e,t){if(!this._maxRetries||this._retries++>=this._maxRetries)return!1;if(this._retryCallback)try{var n=this._retryCallback(e,t);if(!0===n)return!0;if(!1===n)return!1}catch(e){console.error(e)}if(t&&t.status&&t.status>=500&&501!=t.status)return!0;if(e){if(e.code&&~o.indexOf(e.code))return!0;if(e.timeout&&"ECONNABORTED"==e.code)return!0;if(e.crossDomain)return!0}return!1},r.prototype._retry=function(){return this.clearTimeout(),this.req&&(this.req=null,this.req=this.request()),this._aborted=!1,this.timedout=!1,this._end()},r.prototype.then=function(e,t){if(!this._fullfilledPromise){var n=this;this._endCalled&&console.warn("Warning: superagent request was sent twice, because both .end() and .then() were called. Never call .end() if you use promises"),this._fullfilledPromise=new Promise(function(e,t){n.end(function(n,r){n?t(n):e(r)})})}return this._fullfilledPromise.then(e,t)},r.prototype.catch=function(e){return this.then(void 0,e)},r.prototype.use=function(e){return e(this),this},r.prototype.ok=function(e){if("function"!=typeof e)throw Error("Callback required");return this._okCallback=e,this},r.prototype._isResponseOK=function(e){return!!e&&(this._okCallback?this._okCallback(e):e.status>=200&&e.status<300)},r.prototype.get=function(e){return this._header[e.toLowerCase()]},r.prototype.getHeader=r.prototype.get,r.prototype.set=function(e,t){if(s(e)){for(var n in e)this.set(n,e[n]);return this}return this._header[e.toLowerCase()]=t,this.header[e]=t,this},r.prototype.unset=function(e){return delete this._header[e.toLowerCase()],delete this.header[e],this},r.prototype.field=function(e,t){if(null===e||void 0===e)throw new Error(".field(name, val) name can not be empty");if(this._data&&console.error(".field() can't be used if .send() is used. Please use only .send() or only .field() & .attach()"),s(e)){for(var n in e)this.field(n,e[n]);return this}if(Array.isArray(t)){for(var r in t)this.field(e,t[r]);return this}if(null===t||void 0===t)throw new Error(".field(name, val) val can not be empty");return"boolean"==typeof t&&(t=""+t),this._getFormData().append(e,t),this},r.prototype.abort=function(){return this._aborted?this:(this._aborted=!0,this.xhr&&this.xhr.abort(),this.req&&this.req.abort(),this.clearTimeout(),this.emit("abort"),this)},r.prototype._auth=function(e,t,n,r){switch(n.type){case"basic":this.set("Authorization","Basic "+r(e+":"+t));break;case"auto":this.username=e,this.password=t;break;case"bearer":this.set("Authorization","Bearer "+e)}return this},r.prototype.withCredentials=function(e){return void 0==e&&(e=!0),this._withCredentials=e,this},r.prototype.redirects=function(e){return this._maxRedirects=e,this},r.prototype.maxResponseSize=function(e){if("number"!=typeof e)throw TypeError("Invalid argument");return this._maxResponseSize=e,this},r.prototype.toJSON=function(){return{method:this.method,url:this.url,data:this._data,headers:this._header}},r.prototype.send=function(e){var t=s(e),n=this._header["content-type"];if(this._formData&&console.error(".send() can't be used if .attach() or .field() is used. Please use only .send() or only .field() & .attach()"),t&&!this._data)Array.isArray(e)?this._data=[]:this._isHost(e)||(this._data={});else if(e&&this._data&&this._isHost(this._data))throw Error("Can't merge these send calls");if(t&&s(this._data))for(var r in e)this._data[r]=e[r];else"string"==typeof e?(n||this.type("form"),n=this._header["content-type"],this._data="application/x-www-form-urlencoded"==n?this._data?this._data+"&"+e:e:(this._data||"")+e):this._data=e;return!t||this._isHost(e)?this:(n||this.type("json"),this)},r.prototype.sortQuery=function(e){return this._sort=void 0===e||e,this},r.prototype._finalizeQueryString=function(){var e=this._query.join("&");if(e&&(this.url+=(this.url.indexOf("?")>=0?"&":"?")+e),this._query.length=0,this._sort){var t=this.url.indexOf("?");if(t>=0){var n=this.url.substring(t+1).split("&");"function"==typeof this._sort?n.sort(this._sort):n.sort(),this.url=this.url.substring(0,t)+"?"+n.join("&")}}},r.prototype._appendQueryString=function(){console.trace("Unsupported")},r.prototype._timeoutError=function(e,t,n){if(!this._aborted){var r=new Error(e+t+"ms exceeded");r.timeout=t,r.code="ECONNABORTED",r.errno=n,this.timedout=!0,this.abort(),this.callback(r)}},r.prototype._setTimeouts=function(){var e=this;this._timeout&&!this._timer&&(this._timer=setTimeout(function(){e._timeoutError("Timeout of ",e._timeout,"ETIME")},this._timeout)),this._responseTimeout&&!this._responseTimeoutTimer&&(this._responseTimeoutTimer=setTimeout(function(){e._timeoutError("Response timeout of ",e._responseTimeout,"ETIMEDOUT")},this._responseTimeout))}},function(e,t){"use strict";function n(e){return null!==e&&"object"==typeof e}e.exports=n},function(e,t,n){"use strict";function r(e){if(e)return i(e)}function i(e){for(var t in r.prototype)e[t]=r.prototype[t];return e}var s=n(48);e.exports=r,r.prototype.get=function(e){return this.header[e.toLowerCase()]},r.prototype._setHeaderProperties=function(e){var t=e["content-type"]||"";this.type=s.type(t);var n=s.params(t);for(var r in n)this[r]=n[r];this.links={};try{e.link&&(this.links=s.parseLinks(e.link))}catch(e){}},r.prototype._setStatusProperties=function(e){var t=e/100|0;this.status=this.statusCode=e,this.statusType=t,this.info=1==t,this.ok=2==t,this.redirect=3==t,this.clientError=4==t,this.serverError=5==t,this.error=(4==t||5==t)&&this.toError(),this.created=201==e,this.accepted=202==e,this.noContent=204==e,this.badRequest=400==e,this.unauthorized=401==e,this.notAcceptable=406==e,this.forbidden=403==e,this.notFound=404==e,this.unprocessableEntity=422==e}},function(e,t){"use strict";t.type=function(e){return e.split(/ *; */).shift()},t.params=function(e){return e.split(/ *; */).reduce(function(e,t){var n=t.split(/ *= */),r=n.shift(),i=n.shift();return r&&i&&(e[r]=i),e},{})},t.parseLinks=function(e){return e.split(/ *, */).reduce(function(e,t){var n=t.split(/ *; */),r=n[0].slice(1,-1);return e[n[1].split(/ *= */)[1].slice(1,-1)]=r,e},{})},t.cleanHeader=function(e,t){return delete e["content-type"],delete e["content-length"],delete e["transfer-encoding"],delete e.host,t&&(delete e.authorization,delete e.cookie),e}},function(e,t){function n(){this._defaults=[]}["use","on","once","set","query","type","accept","auth","withCredentials","sortQuery","retry","ok","redirects","timeout","buffer","serialize","parse","ca","key","pfx","cert"].forEach(function(e){n.prototype[e]=function(){return this._defaults.push({fn:e,arguments:arguments}),this}}),n.prototype._setDefaults=function(e){this._defaults.forEach(function(t){e[t.fn].apply(e,t.arguments)})},e.exports=n}])});
19625
- },{}],88:[function(require,module,exports){
19840
+ },{}],87:[function(require,module,exports){
19626
19841
  (function (global){
19627
19842
  /*! https://mths.be/punycode v1.4.1 by @mathias */
19628
19843
  ;(function(root) {
@@ -20159,7 +20374,7 @@ d.length>0&&(y.auth=d.join(",")),(o||0===o)&&(y.ttl=o),y}function c(){return{}}O
20159
20374
  }(this));
20160
20375
 
20161
20376
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
20162
- },{}],89:[function(require,module,exports){
20377
+ },{}],88:[function(require,module,exports){
20163
20378
  (function (process){
20164
20379
  // vim:ts=4:sts=4:sw=4:
20165
20380
  /*!
@@ -22211,7 +22426,7 @@ return Q;
22211
22426
  });
22212
22427
 
22213
22428
  }).call(this,require('_process'))
22214
- },{"_process":86}],90:[function(require,module,exports){
22429
+ },{"_process":85}],89:[function(require,module,exports){
22215
22430
  // Copyright Joyent, Inc. and other Node contributors.
22216
22431
  //
22217
22432
  // Permission is hereby granted, free of charge, to any person obtaining a
@@ -22297,7 +22512,7 @@ var isArray = Array.isArray || function (xs) {
22297
22512
  return Object.prototype.toString.call(xs) === '[object Array]';
22298
22513
  };
22299
22514
 
22300
- },{}],91:[function(require,module,exports){
22515
+ },{}],90:[function(require,module,exports){
22301
22516
  // Copyright Joyent, Inc. and other Node contributors.
22302
22517
  //
22303
22518
  // Permission is hereby granted, free of charge, to any person obtaining a
@@ -22384,16 +22599,16 @@ var objectKeys = Object.keys || function (obj) {
22384
22599
  return res;
22385
22600
  };
22386
22601
 
22387
- },{}],92:[function(require,module,exports){
22602
+ },{}],91:[function(require,module,exports){
22388
22603
  'use strict';
22389
22604
 
22390
22605
  exports.decode = exports.parse = require('./decode');
22391
22606
  exports.encode = exports.stringify = require('./encode');
22392
22607
 
22393
- },{"./decode":90,"./encode":91}],93:[function(require,module,exports){
22608
+ },{"./decode":89,"./encode":90}],92:[function(require,module,exports){
22394
22609
  module.exports = require('./lib/_stream_duplex.js');
22395
22610
 
22396
- },{"./lib/_stream_duplex.js":94}],94:[function(require,module,exports){
22611
+ },{"./lib/_stream_duplex.js":93}],93:[function(require,module,exports){
22397
22612
  // Copyright Joyent, Inc. and other Node contributors.
22398
22613
  //
22399
22614
  // Permission is hereby granted, free of charge, to any person obtaining a
@@ -22439,7 +22654,7 @@ var objectKeys = Object.keys || function (obj) {
22439
22654
  module.exports = Duplex;
22440
22655
 
22441
22656
  /*<replacement>*/
22442
- var util = require('core-util-is');
22657
+ var util = Object.create(require('core-util-is'));
22443
22658
  util.inherits = require('inherits');
22444
22659
  /*</replacement>*/
22445
22660
 
@@ -22525,7 +22740,7 @@ Duplex.prototype._destroy = function (err, cb) {
22525
22740
 
22526
22741
  pna.nextTick(cb, err);
22527
22742
  };
22528
- },{"./_stream_readable":96,"./_stream_writable":98,"core-util-is":46,"inherits":74,"process-nextick-args":85}],95:[function(require,module,exports){
22743
+ },{"./_stream_readable":95,"./_stream_writable":97,"core-util-is":45,"inherits":73,"process-nextick-args":84}],94:[function(require,module,exports){
22529
22744
  // Copyright Joyent, Inc. and other Node contributors.
22530
22745
  //
22531
22746
  // Permission is hereby granted, free of charge, to any person obtaining a
@@ -22558,7 +22773,7 @@ module.exports = PassThrough;
22558
22773
  var Transform = require('./_stream_transform');
22559
22774
 
22560
22775
  /*<replacement>*/
22561
- var util = require('core-util-is');
22776
+ var util = Object.create(require('core-util-is'));
22562
22777
  util.inherits = require('inherits');
22563
22778
  /*</replacement>*/
22564
22779
 
@@ -22573,7 +22788,7 @@ function PassThrough(options) {
22573
22788
  PassThrough.prototype._transform = function (chunk, encoding, cb) {
22574
22789
  cb(null, chunk);
22575
22790
  };
22576
- },{"./_stream_transform":97,"core-util-is":46,"inherits":74}],96:[function(require,module,exports){
22791
+ },{"./_stream_transform":96,"core-util-is":45,"inherits":73}],95:[function(require,module,exports){
22577
22792
  (function (process,global){
22578
22793
  // Copyright Joyent, Inc. and other Node contributors.
22579
22794
  //
@@ -22641,7 +22856,7 @@ function _isUint8Array(obj) {
22641
22856
  /*</replacement>*/
22642
22857
 
22643
22858
  /*<replacement>*/
22644
- var util = require('core-util-is');
22859
+ var util = Object.create(require('core-util-is'));
22645
22860
  util.inherits = require('inherits');
22646
22861
  /*</replacement>*/
22647
22862
 
@@ -23595,7 +23810,7 @@ function indexOf(xs, x) {
23595
23810
  return -1;
23596
23811
  }
23597
23812
  }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
23598
- },{"./_stream_duplex":94,"./internal/streams/BufferList":99,"./internal/streams/destroy":100,"./internal/streams/stream":101,"_process":86,"core-util-is":46,"events":65,"inherits":74,"isarray":76,"process-nextick-args":85,"safe-buffer":107,"string_decoder/":131,"util":40}],97:[function(require,module,exports){
23813
+ },{"./_stream_duplex":93,"./internal/streams/BufferList":98,"./internal/streams/destroy":99,"./internal/streams/stream":100,"_process":85,"core-util-is":45,"events":64,"inherits":73,"isarray":75,"process-nextick-args":84,"safe-buffer":106,"string_decoder/":130,"util":40}],96:[function(require,module,exports){
23599
23814
  // Copyright Joyent, Inc. and other Node contributors.
23600
23815
  //
23601
23816
  // Permission is hereby granted, free of charge, to any person obtaining a
@@ -23666,7 +23881,7 @@ module.exports = Transform;
23666
23881
  var Duplex = require('./_stream_duplex');
23667
23882
 
23668
23883
  /*<replacement>*/
23669
- var util = require('core-util-is');
23884
+ var util = Object.create(require('core-util-is'));
23670
23885
  util.inherits = require('inherits');
23671
23886
  /*</replacement>*/
23672
23887
 
@@ -23810,7 +24025,7 @@ function done(stream, er, data) {
23810
24025
 
23811
24026
  return stream.push(null);
23812
24027
  }
23813
- },{"./_stream_duplex":94,"core-util-is":46,"inherits":74}],98:[function(require,module,exports){
24028
+ },{"./_stream_duplex":93,"core-util-is":45,"inherits":73}],97:[function(require,module,exports){
23814
24029
  (function (process,global){
23815
24030
  // Copyright Joyent, Inc. and other Node contributors.
23816
24031
  //
@@ -23878,7 +24093,7 @@ var Duplex;
23878
24093
  Writable.WritableState = WritableState;
23879
24094
 
23880
24095
  /*<replacement>*/
23881
- var util = require('core-util-is');
24096
+ var util = Object.create(require('core-util-is'));
23882
24097
  util.inherits = require('inherits');
23883
24098
  /*</replacement>*/
23884
24099
 
@@ -24500,7 +24715,7 @@ Writable.prototype._destroy = function (err, cb) {
24500
24715
  cb(err);
24501
24716
  };
24502
24717
  }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
24503
- },{"./_stream_duplex":94,"./internal/streams/destroy":100,"./internal/streams/stream":101,"_process":86,"core-util-is":46,"inherits":74,"process-nextick-args":85,"safe-buffer":107,"util-deprecate":138}],99:[function(require,module,exports){
24718
+ },{"./_stream_duplex":93,"./internal/streams/destroy":99,"./internal/streams/stream":100,"_process":85,"core-util-is":45,"inherits":73,"process-nextick-args":84,"safe-buffer":106,"util-deprecate":138}],98:[function(require,module,exports){
24504
24719
  'use strict';
24505
24720
 
24506
24721
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
@@ -24580,7 +24795,7 @@ if (util && util.inspect && util.inspect.custom) {
24580
24795
  return this.constructor.name + ' ' + obj;
24581
24796
  };
24582
24797
  }
24583
- },{"safe-buffer":107,"util":40}],100:[function(require,module,exports){
24798
+ },{"safe-buffer":106,"util":40}],99:[function(require,module,exports){
24584
24799
  'use strict';
24585
24800
 
24586
24801
  /*<replacement>*/
@@ -24655,13 +24870,13 @@ module.exports = {
24655
24870
  destroy: destroy,
24656
24871
  undestroy: undestroy
24657
24872
  };
24658
- },{"process-nextick-args":85}],101:[function(require,module,exports){
24873
+ },{"process-nextick-args":84}],100:[function(require,module,exports){
24659
24874
  module.exports = require('events').EventEmitter;
24660
24875
 
24661
- },{"events":65}],102:[function(require,module,exports){
24876
+ },{"events":64}],101:[function(require,module,exports){
24662
24877
  module.exports = require('./readable').PassThrough
24663
24878
 
24664
- },{"./readable":103}],103:[function(require,module,exports){
24879
+ },{"./readable":102}],102:[function(require,module,exports){
24665
24880
  exports = module.exports = require('./lib/_stream_readable.js');
24666
24881
  exports.Stream = exports;
24667
24882
  exports.Readable = exports;
@@ -24670,13 +24885,13 @@ exports.Duplex = require('./lib/_stream_duplex.js');
24670
24885
  exports.Transform = require('./lib/_stream_transform.js');
24671
24886
  exports.PassThrough = require('./lib/_stream_passthrough.js');
24672
24887
 
24673
- },{"./lib/_stream_duplex.js":94,"./lib/_stream_passthrough.js":95,"./lib/_stream_readable.js":96,"./lib/_stream_transform.js":97,"./lib/_stream_writable.js":98}],104:[function(require,module,exports){
24888
+ },{"./lib/_stream_duplex.js":93,"./lib/_stream_passthrough.js":94,"./lib/_stream_readable.js":95,"./lib/_stream_transform.js":96,"./lib/_stream_writable.js":97}],103:[function(require,module,exports){
24674
24889
  module.exports = require('./readable').Transform
24675
24890
 
24676
- },{"./readable":103}],105:[function(require,module,exports){
24891
+ },{"./readable":102}],104:[function(require,module,exports){
24677
24892
  module.exports = require('./lib/_stream_writable.js');
24678
24893
 
24679
- },{"./lib/_stream_writable.js":98}],106:[function(require,module,exports){
24894
+ },{"./lib/_stream_writable.js":97}],105:[function(require,module,exports){
24680
24895
 
24681
24896
  /**
24682
24897
  * Reduce `arr` with `fn`.
@@ -24701,7 +24916,7 @@ module.exports = function(arr, fn, initial){
24701
24916
 
24702
24917
  return curr;
24703
24918
  };
24704
- },{}],107:[function(require,module,exports){
24919
+ },{}],106:[function(require,module,exports){
24705
24920
  /* eslint-disable node/no-deprecated-api */
24706
24921
  var buffer = require('buffer')
24707
24922
  var Buffer = buffer.Buffer
@@ -24765,7 +24980,7 @@ SafeBuffer.allocUnsafeSlow = function (size) {
24765
24980
  return buffer.SlowBuffer(size)
24766
24981
  }
24767
24982
 
24768
- },{"buffer":41}],108:[function(require,module,exports){
24983
+ },{"buffer":41}],107:[function(require,module,exports){
24769
24984
 
24770
24985
  /**
24771
24986
  * Module dependencies.
@@ -24859,7 +25074,7 @@ exports.connect = lookup;
24859
25074
  exports.Manager = require('./manager');
24860
25075
  exports.Socket = require('./socket');
24861
25076
 
24862
- },{"./manager":109,"./socket":111,"./url":112,"debug":114,"socket.io-parser":118}],109:[function(require,module,exports){
25077
+ },{"./manager":108,"./socket":110,"./url":111,"debug":113,"socket.io-parser":117}],108:[function(require,module,exports){
24863
25078
 
24864
25079
  /**
24865
25080
  * Module dependencies.
@@ -25418,7 +25633,7 @@ Manager.prototype.onreconnect = function(){
25418
25633
  this.emitAll('reconnect', attempt);
25419
25634
  };
25420
25635
 
25421
- },{"./on":110,"./socket":111,"backo2":36,"component-bind":43,"component-emitter":113,"debug":114,"engine.io-client":47,"indexof":73,"socket.io-parser":118}],110:[function(require,module,exports){
25636
+ },{"./on":109,"./socket":110,"backo2":36,"component-bind":43,"component-emitter":112,"debug":113,"engine.io-client":46,"indexof":72,"socket.io-parser":117}],109:[function(require,module,exports){
25422
25637
 
25423
25638
  /**
25424
25639
  * Module exports.
@@ -25444,7 +25659,7 @@ function on(obj, ev, fn) {
25444
25659
  };
25445
25660
  }
25446
25661
 
25447
- },{}],111:[function(require,module,exports){
25662
+ },{}],110:[function(require,module,exports){
25448
25663
 
25449
25664
  /**
25450
25665
  * Module dependencies.
@@ -25858,7 +26073,7 @@ Socket.prototype.compress = function(compress){
25858
26073
  return this;
25859
26074
  };
25860
26075
 
25861
- },{"./on":110,"component-bind":43,"component-emitter":113,"debug":114,"has-binary":68,"socket.io-parser":118,"to-array":134}],112:[function(require,module,exports){
26076
+ },{"./on":109,"component-bind":43,"component-emitter":112,"debug":113,"has-binary":67,"socket.io-parser":117,"to-array":134}],111:[function(require,module,exports){
25862
26077
  (function (global){
25863
26078
 
25864
26079
  /**
@@ -25938,7 +26153,7 @@ function url(uri, loc){
25938
26153
  }
25939
26154
 
25940
26155
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
25941
- },{"debug":114,"parseuri":84}],113:[function(require,module,exports){
26156
+ },{"debug":113,"parseuri":83}],112:[function(require,module,exports){
25942
26157
 
25943
26158
  /**
25944
26159
  * Expose `Emitter`.
@@ -26101,13 +26316,13 @@ Emitter.prototype.hasListeners = function(event){
26101
26316
  return !! this.listeners(event).length;
26102
26317
  };
26103
26318
 
26104
- },{}],114:[function(require,module,exports){
26319
+ },{}],113:[function(require,module,exports){
26320
+ arguments[4][57][0].apply(exports,arguments)
26321
+ },{"./debug":114,"dup":57}],114:[function(require,module,exports){
26105
26322
  arguments[4][58][0].apply(exports,arguments)
26106
- },{"./debug":115,"dup":58}],115:[function(require,module,exports){
26323
+ },{"dup":58,"ms":115}],115:[function(require,module,exports){
26107
26324
  arguments[4][59][0].apply(exports,arguments)
26108
- },{"dup":59,"ms":116}],116:[function(require,module,exports){
26109
- arguments[4][60][0].apply(exports,arguments)
26110
- },{"dup":60}],117:[function(require,module,exports){
26325
+ },{"dup":59}],116:[function(require,module,exports){
26111
26326
  (function (global){
26112
26327
  /*global Blob,File*/
26113
26328
 
@@ -26252,7 +26467,7 @@ exports.removeBlobs = function(data, callback) {
26252
26467
  };
26253
26468
 
26254
26469
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
26255
- },{"./is-buffer":119,"isarray":123}],118:[function(require,module,exports){
26470
+ },{"./is-buffer":118,"isarray":122}],117:[function(require,module,exports){
26256
26471
 
26257
26472
  /**
26258
26473
  * Module dependencies.
@@ -26654,7 +26869,7 @@ function error(data){
26654
26869
  };
26655
26870
  }
26656
26871
 
26657
- },{"./binary":117,"./is-buffer":119,"component-emitter":120,"debug":121,"isarray":123,"json3":77}],119:[function(require,module,exports){
26872
+ },{"./binary":116,"./is-buffer":118,"component-emitter":119,"debug":120,"isarray":122,"json3":76}],118:[function(require,module,exports){
26658
26873
  (function (global){
26659
26874
 
26660
26875
  module.exports = isBuf;
@@ -26671,17 +26886,17 @@ function isBuf(obj) {
26671
26886
  }
26672
26887
 
26673
26888
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
26674
- },{}],120:[function(require,module,exports){
26889
+ },{}],119:[function(require,module,exports){
26890
+ arguments[4][56][0].apply(exports,arguments)
26891
+ },{"dup":56}],120:[function(require,module,exports){
26675
26892
  arguments[4][57][0].apply(exports,arguments)
26676
- },{"dup":57}],121:[function(require,module,exports){
26893
+ },{"./debug":121,"dup":57}],121:[function(require,module,exports){
26677
26894
  arguments[4][58][0].apply(exports,arguments)
26678
- },{"./debug":122,"dup":58}],122:[function(require,module,exports){
26895
+ },{"dup":58,"ms":123}],122:[function(require,module,exports){
26896
+ arguments[4][63][0].apply(exports,arguments)
26897
+ },{"dup":63}],123:[function(require,module,exports){
26679
26898
  arguments[4][59][0].apply(exports,arguments)
26680
- },{"dup":59,"ms":124}],123:[function(require,module,exports){
26681
- arguments[4][64][0].apply(exports,arguments)
26682
- },{"dup":64}],124:[function(require,module,exports){
26683
- arguments[4][60][0].apply(exports,arguments)
26684
- },{"dup":60}],125:[function(require,module,exports){
26899
+ },{"dup":59}],124:[function(require,module,exports){
26685
26900
  // Copyright Joyent, Inc. and other Node contributors.
26686
26901
  //
26687
26902
  // Permission is hereby granted, free of charge, to any person obtaining a
@@ -26810,7 +27025,7 @@ Stream.prototype.pipe = function(dest, options) {
26810
27025
  return dest;
26811
27026
  };
26812
27027
 
26813
- },{"events":65,"inherits":74,"readable-stream/duplex.js":93,"readable-stream/passthrough.js":102,"readable-stream/readable.js":103,"readable-stream/transform.js":104,"readable-stream/writable.js":105}],126:[function(require,module,exports){
27028
+ },{"events":64,"inherits":73,"readable-stream/duplex.js":92,"readable-stream/passthrough.js":101,"readable-stream/readable.js":102,"readable-stream/transform.js":103,"readable-stream/writable.js":104}],125:[function(require,module,exports){
26814
27029
  var ClientRequest = require('./lib/request')
26815
27030
  var extend = require('xtend')
26816
27031
  var statusCodes = require('builtin-status-codes')
@@ -26885,7 +27100,7 @@ http.METHODS = [
26885
27100
  'UNLOCK',
26886
27101
  'UNSUBSCRIBE'
26887
27102
  ]
26888
- },{"./lib/request":128,"builtin-status-codes":42,"url":136,"xtend":141}],127:[function(require,module,exports){
27103
+ },{"./lib/request":127,"builtin-status-codes":42,"url":136,"xtend":141}],126:[function(require,module,exports){
26889
27104
  (function (global){
26890
27105
  exports.fetch = isFunction(global.fetch) && isFunction(global.ReadableByteStream)
26891
27106
 
@@ -26929,7 +27144,7 @@ function isFunction (value) {
26929
27144
  xhr = null // Help gc
26930
27145
 
26931
27146
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
26932
- },{}],128:[function(require,module,exports){
27147
+ },{}],127:[function(require,module,exports){
26933
27148
  (function (process,global,Buffer){
26934
27149
  // var Base64 = require('Base64')
26935
27150
  var capability = require('./capability')
@@ -27211,7 +27426,7 @@ var unsafeHeaders = [
27211
27426
  ]
27212
27427
 
27213
27428
  }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("buffer").Buffer)
27214
- },{"./capability":127,"./response":129,"_process":86,"buffer":41,"foreach":67,"indexof":73,"inherits":74,"object-keys":79,"stream":125}],129:[function(require,module,exports){
27429
+ },{"./capability":126,"./response":128,"_process":85,"buffer":41,"foreach":66,"indexof":72,"inherits":73,"object-keys":78,"stream":124}],128:[function(require,module,exports){
27215
27430
  (function (process,global,Buffer){
27216
27431
  var capability = require('./capability')
27217
27432
  var foreach = require('foreach')
@@ -27388,7 +27603,7 @@ IncomingMessage.prototype._onXHRProgress = function () {
27388
27603
  }
27389
27604
 
27390
27605
  }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("buffer").Buffer)
27391
- },{"./capability":127,"_process":86,"buffer":41,"foreach":67,"inherits":74,"stream":125}],130:[function(require,module,exports){
27606
+ },{"./capability":126,"_process":85,"buffer":41,"foreach":66,"inherits":73,"stream":124}],129:[function(require,module,exports){
27392
27607
  var nargs = /\{([0-9a-zA-Z_]+)\}/g
27393
27608
 
27394
27609
  module.exports = template
@@ -27426,7 +27641,7 @@ function template(string) {
27426
27641
  })
27427
27642
  }
27428
27643
 
27429
- },{}],131:[function(require,module,exports){
27644
+ },{}],130:[function(require,module,exports){
27430
27645
  // Copyright Joyent, Inc. and other Node contributors.
27431
27646
  //
27432
27647
  // Permission is hereby granted, free of charge, to any person obtaining a
@@ -27723,7 +27938,7 @@ function simpleWrite(buf) {
27723
27938
  function simpleEnd(buf) {
27724
27939
  return buf && buf.length ? this.write(buf) : '';
27725
27940
  }
27726
- },{"safe-buffer":107}],132:[function(require,module,exports){
27941
+ },{"safe-buffer":106}],131:[function(require,module,exports){
27727
27942
  /**
27728
27943
  * Module dependencies.
27729
27944
  */
@@ -28916,7 +29131,172 @@ request.put = function(url, data, fn){
28916
29131
 
28917
29132
  module.exports = request;
28918
29133
 
28919
- },{"emitter":44,"reduce":106}],133:[function(require,module,exports){
29134
+ },{"emitter":132,"reduce":105}],132:[function(require,module,exports){
29135
+
29136
+ /**
29137
+ * Expose `Emitter`.
29138
+ */
29139
+
29140
+ if (typeof module !== 'undefined') {
29141
+ module.exports = Emitter;
29142
+ }
29143
+
29144
+ /**
29145
+ * Initialize a new `Emitter`.
29146
+ *
29147
+ * @api public
29148
+ */
29149
+
29150
+ function Emitter(obj) {
29151
+ if (obj) return mixin(obj);
29152
+ };
29153
+
29154
+ /**
29155
+ * Mixin the emitter properties.
29156
+ *
29157
+ * @param {Object} obj
29158
+ * @return {Object}
29159
+ * @api private
29160
+ */
29161
+
29162
+ function mixin(obj) {
29163
+ for (var key in Emitter.prototype) {
29164
+ obj[key] = Emitter.prototype[key];
29165
+ }
29166
+ return obj;
29167
+ }
29168
+
29169
+ /**
29170
+ * Listen on the given `event` with `fn`.
29171
+ *
29172
+ * @param {String} event
29173
+ * @param {Function} fn
29174
+ * @return {Emitter}
29175
+ * @api public
29176
+ */
29177
+
29178
+ Emitter.prototype.on =
29179
+ Emitter.prototype.addEventListener = function(event, fn){
29180
+ this._callbacks = this._callbacks || {};
29181
+ (this._callbacks['$' + event] = this._callbacks['$' + event] || [])
29182
+ .push(fn);
29183
+ return this;
29184
+ };
29185
+
29186
+ /**
29187
+ * Adds an `event` listener that will be invoked a single
29188
+ * time then automatically removed.
29189
+ *
29190
+ * @param {String} event
29191
+ * @param {Function} fn
29192
+ * @return {Emitter}
29193
+ * @api public
29194
+ */
29195
+
29196
+ Emitter.prototype.once = function(event, fn){
29197
+ function on() {
29198
+ this.off(event, on);
29199
+ fn.apply(this, arguments);
29200
+ }
29201
+
29202
+ on.fn = fn;
29203
+ this.on(event, on);
29204
+ return this;
29205
+ };
29206
+
29207
+ /**
29208
+ * Remove the given callback for `event` or all
29209
+ * registered callbacks.
29210
+ *
29211
+ * @param {String} event
29212
+ * @param {Function} fn
29213
+ * @return {Emitter}
29214
+ * @api public
29215
+ */
29216
+
29217
+ Emitter.prototype.off =
29218
+ Emitter.prototype.removeListener =
29219
+ Emitter.prototype.removeAllListeners =
29220
+ Emitter.prototype.removeEventListener = function(event, fn){
29221
+ this._callbacks = this._callbacks || {};
29222
+
29223
+ // all
29224
+ if (0 == arguments.length) {
29225
+ this._callbacks = {};
29226
+ return this;
29227
+ }
29228
+
29229
+ // specific event
29230
+ var callbacks = this._callbacks['$' + event];
29231
+ if (!callbacks) return this;
29232
+
29233
+ // remove all handlers
29234
+ if (1 == arguments.length) {
29235
+ delete this._callbacks['$' + event];
29236
+ return this;
29237
+ }
29238
+
29239
+ // remove specific handler
29240
+ var cb;
29241
+ for (var i = 0; i < callbacks.length; i++) {
29242
+ cb = callbacks[i];
29243
+ if (cb === fn || cb.fn === fn) {
29244
+ callbacks.splice(i, 1);
29245
+ break;
29246
+ }
29247
+ }
29248
+ return this;
29249
+ };
29250
+
29251
+ /**
29252
+ * Emit `event` with the given args.
29253
+ *
29254
+ * @param {String} event
29255
+ * @param {Mixed} ...
29256
+ * @return {Emitter}
29257
+ */
29258
+
29259
+ Emitter.prototype.emit = function(event){
29260
+ this._callbacks = this._callbacks || {};
29261
+ var args = [].slice.call(arguments, 1)
29262
+ , callbacks = this._callbacks['$' + event];
29263
+
29264
+ if (callbacks) {
29265
+ callbacks = callbacks.slice(0);
29266
+ for (var i = 0, len = callbacks.length; i < len; ++i) {
29267
+ callbacks[i].apply(this, args);
29268
+ }
29269
+ }
29270
+
29271
+ return this;
29272
+ };
29273
+
29274
+ /**
29275
+ * Return array of callbacks for `event`.
29276
+ *
29277
+ * @param {String} event
29278
+ * @return {Array}
29279
+ * @api public
29280
+ */
29281
+
29282
+ Emitter.prototype.listeners = function(event){
29283
+ this._callbacks = this._callbacks || {};
29284
+ return this._callbacks['$' + event] || [];
29285
+ };
29286
+
29287
+ /**
29288
+ * Check if this emitter has `event` handlers.
29289
+ *
29290
+ * @param {String} event
29291
+ * @return {Boolean}
29292
+ * @api public
29293
+ */
29294
+
29295
+ Emitter.prototype.hasListeners = function(event){
29296
+ return !! this.listeners(event).length;
29297
+ };
29298
+
29299
+ },{}],133:[function(require,module,exports){
28920
29300
  (function (Buffer){
28921
29301
  "0.50.0";
28922
29302
  /*
@@ -37113,7 +37493,7 @@ TinCan client library
37113
37493
  }());
37114
37494
 
37115
37495
  }).call(this,require("buffer").Buffer)
37116
- },{"buffer":41,"querystring":92,"xhr2":140}],134:[function(require,module,exports){
37496
+ },{"buffer":41,"querystring":91,"xhr2":140}],134:[function(require,module,exports){
37117
37497
  module.exports = toArray
37118
37498
 
37119
37499
  function toArray(list, index) {
@@ -39387,7 +39767,7 @@ function isNullOrUndefined(arg) {
39387
39767
  return arg == null;
39388
39768
  }
39389
39769
 
39390
- },{"punycode":88,"querystring":92}],137:[function(require,module,exports){
39770
+ },{"punycode":87,"querystring":91}],137:[function(require,module,exports){
39391
39771
  (function (global){
39392
39772
  /*! https://mths.be/utf8js v2.0.0 by @mathias */
39393
39773
  ;(function(root) {
@@ -41632,7 +42012,7 @@ function config (name) {
41632
42012
  }).call(this);
41633
42013
 
41634
42014
  }).call(this,require('_process'),require("buffer").Buffer)
41635
- },{"_process":86,"buffer":41,"http":126,"https":71,"os":81,"url":136}],141:[function(require,module,exports){
42015
+ },{"_process":85,"buffer":41,"http":125,"https":70,"os":80,"url":136}],141:[function(require,module,exports){
41636
42016
  module.exports = extend
41637
42017
 
41638
42018
  var hasOwnProperty = Object.prototype.hasOwnProperty;