backendless 7.2.0 → 7.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/backendless.d.ts +14 -0
- package/dist/backendless.js +138 -1
- package/dist/backendless.js.map +1 -1
- package/dist/backendless.min.js +2 -2
- package/es/automations/index.js +102 -0
- package/es/index.js +8 -0
- package/es/urls.js +17 -0
- package/lib/automations/index.js +102 -0
- package/lib/index.js +8 -0
- package/lib/urls.js +17 -0
- package/package.json +1 -1
- package/src/automations/index.js +45 -0
- package/src/index.js +5 -0
- package/src/urls.js +14 -0
package/dist/backendless.min.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* ********************************************************************************************************************
|
|
3
|
-
* Backendless SDK for JavaScript. Version: 7.2.
|
|
3
|
+
* Backendless SDK for JavaScript. Version: 7.2.2
|
|
4
4
|
*
|
|
5
5
|
* Copyright 2012-2023 BACKENDLESS.COM. All Rights Reserved.
|
|
6
6
|
*
|
|
@@ -12,4 +12,4 @@
|
|
|
12
12
|
* ********************************************************************************************************************
|
|
13
13
|
*/
|
|
14
14
|
/*! For license information please see backendless.min.js.LICENSE.txt */
|
|
15
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Backendless=t():e.Backendless=t()}(self,()=>(()=>{var e={8435:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isExecutionType=t.ExecutionTypes=t.EXECUTION_TYPE_HEADER=void 0;t.EXECUTION_TYPE_HEADER="bl-execution-type";var r={SYNC:"sync",ASYNC:"async",ASYNC_LOW_PRIORITY:"async-low-priority"};t.ExecutionTypes=r;var n=Object.keys(r).map((function(e){return r[e]}));t.isExecutionType=function(e){return n.includes(e)}},9589:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(4687)),s=n(r(8416)),i=n(r(7156)),a=n(r(6690)),u=n(r(9728)),c=r(8435);function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function f(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(t){(0,s.default)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var p=function(){function e(t){(0,a.default)(this,e),this.app=t}var t;return(0,u.default)(e,[{key:"invoke",value:(t=(0,i.default)(o.default.mark((function e(t,r,n,s){var i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Service Name must be provided and must be a string.");case 2:if(r&&"string"==typeof r){e.next=4;break}throw new Error("Method Name must be provided and must be a string.");case 4:return"string"==typeof s&&(s={executionType:s}),"string"==typeof n&&(0,c.isExecutionType)(n)&&(s={executionType:n},n=void 0),i=f({},(s=s||{}).httpRequestHeaders),s.executionType&&(i[c.EXECUTION_TYPE_HEADER]=s.executionType),e.abrupt("return",this.app.request.post({url:this.app.urls.blServiceMethod(t,r),data:n,headers:i}));case 10:case"end":return e.stop()}}),e,this)}))),function(e,r,n,o){return t.apply(this,arguments)})}]),e}();t.default=p},3084:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(4687)),s=n(r(8698)),i=n(r(7156)),a=n(r(6690)),u=n(r(9728)),c=r(8435),l=function(){function e(t){(0,a.default)(this,e),this.app=t}var t;return(0,u.default)(e,[{key:"dispatch",value:(t=(0,i.default)(o.default.mark((function e(t,r,n){var i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Event Name must be provided and must be a string.");case 2:if("string"==typeof r&&(0,c.isExecutionType)(r)&&(n=r,r=void 0),!r||"object"===(0,s.default)(r)&&!Array.isArray(r)){e.next=5;break}throw new Error("Event Arguments must be an object.");case 5:return i={},n&&(i[c.EXECUTION_TYPE_HEADER]=n),e.abrupt("return",this.app.request.post({url:this.app.urls.blEvent(t),data:r||{},headers:i}));case 8:case"end":return e.stop()}}),e,this)}))),function(e,r,n){return t.apply(this,arguments)})}]),e}();t.default=l},6912:(e,t,r)=>{"use strict";var n=r(4836);t.Z=void 0;var o=n(r(9728)),s=n(r(6690)),i=r(8435),a=n(r(9589)),u=n(r(3084)),c=(0,o.default)((function e(t){(0,s.default)(this,e),this.app=t,this.ExecutionTypes=i.ExecutionTypes,this.CustomServices=new a.default(t),this.Events=new u.default(t)}));t.Z=c},8469:(e,t,r)=>{"use strict";var n=r(4836);t.Z=void 0;var o=n(r(4687)),s=n(r(7156)),i=n(r(6690)),a=n(r(9728)),u=n(r(9853)),c=function(){function e(t){(0,i.default)(this,e),this.app=t,this.parsers={}}var t,r,n,c,l,f;return(0,a.default)(e,[{key:"setObjectFactory",value:function(e,t){this.parsers[e]=t}},{key:"parseItem",value:function(e){var t=e&&e.___class;if(t){var r=this.parsers[t];r&&(e=new r(e))}return e}},{key:"stringifyItem",value:function(e){return u.default.isCustomClassInstance(e)&&(e.___class=e.___class||u.default.getClassName(e)),JSON.stringify(e)}},{key:"put",value:(f=(0,s.default)(o.default.mark((function e(t,r,n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Cache Key must be provided and must be a string.");case 2:if(!n||!("number"!=typeof n||n<0)){e.next=4;break}throw new Error("Cache TimeToLive must be a positive number.");case 4:return e.abrupt("return",this.app.request.put({url:this.app.urls.cacheItem(t),query:{timeout:n},headers:{"Content-Type":"application/json"},data:this.stringifyItem(r)}));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return f.apply(this,arguments)})},{key:"get",value:(l=(0,s.default)(o.default.mark((function e(t){var r=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Cache Key must be provided and must be a string.");case 2:return e.abrupt("return",this.app.request.get({url:this.app.urls.cacheItem(t)}).then((function(e){return r.parseItem(e)})));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"remove",value:(c=(0,s.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Cache Key must be provided and must be a string.");case 2:return e.abrupt("return",this.app.request.delete({url:this.app.urls.cacheItem(t)}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return c.apply(this,arguments)})},{key:"contains",value:(n=(0,s.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Cache Key must be provided and must be a string.");case 2:return e.abrupt("return",this.app.request.get({url:this.app.urls.cacheItemCheck(t)}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"expireIn",value:(r=(0,s.default)(o.default.mark((function e(t,r){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Cache Key must be provided and must be a string.");case 2:if(!("number"!=typeof r||r<=0)){e.next=4;break}throw new Error("Cache Expiration must be provided and must be a number of seconds.");case 4:return e.abrupt("return",this.app.request.put({url:this.app.urls.cacheItemExpireIn(t),query:{timeout:r},data:{}}));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"expireAt",value:(t=(0,s.default)(o.default.mark((function e(t,r){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Cache Key must be provided and must be a string.");case 2:if(!(r instanceof Date)){e.next=6;break}r=r.getTime(),e.next=8;break;case 6:if(!("number"!=typeof r||r<=0)){e.next=8;break}throw new Error("Cache Expiration must be provided and must be a timestamp or an instance of Date.");case 8:return e.abrupt("return",this.app.request.put({url:this.app.urls.cacheItemExpireAt(t),query:{timestamp:r},data:{}}));case 9:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}]),e}();t.Z=c},5165:(e,t,r)=>{"use strict";var n=r(4836);t.Z=void 0;var o=n(r(4687)),s=n(r(7156)),i=n(r(6690)),a=n(r(9728)),u=function(){function e(t){(0,i.default)(this,e),this.app=t}var t,r,n;return(0,a.default)(e,[{key:"validatePlayPurchase",value:(n=(0,s.default)(o.default.mark((function e(t,r,n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Package Name must be provided and must be a string.");case 2:if(r&&"string"==typeof r){e.next=4;break}throw new Error("Product Id must be provided and must be a string.");case 4:if(n&&"string"==typeof n){e.next=6;break}throw new Error("Token must be provided and must be a string.");case 6:return e.abrupt("return",this.app.request.get({url:this.app.urls.commerceValidate(t,r,n)}));case 7:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return n.apply(this,arguments)})},{key:"cancelPlaySubscription",value:(r=(0,s.default)(o.default.mark((function e(t,r,n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Package Name must be provided and must be a string.");case 2:if(r&&"string"==typeof r){e.next=4;break}throw new Error("Subscription Id must be provided and must be a string.");case 4:if(n&&"string"==typeof n){e.next=6;break}throw new Error("Token must be provided and must be a string.");case 6:return e.abrupt("return",this.app.request.post({url:this.app.urls.commerceSubCancel(t,r,n)}));case 7:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return r.apply(this,arguments)})},{key:"getPlaySubscriptionStatus",value:(t=(0,s.default)(o.default.mark((function e(t,r,n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Package Name must be provided and must be a string.");case 2:if(r&&"string"==typeof r){e.next=4;break}throw new Error("Subscription Id must be provided and must be a string.");case 4:if(n&&"string"==typeof n){e.next=6;break}throw new Error("Token must be provided and must be a string.");case 6:return e.abrupt("return",this.app.request.get({url:this.app.urls.commerceSubStatus(t,r,n)}));case 7:case"end":return e.stop()}}),e,this)}))),function(e,r,n){return t.apply(this,arguments)})}]),e}();t.Z=u},5921:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(6690)),s=n(r(9728)),i=function(){function e(t,r){if((0,o.default)(this,e),!t||"string"!=typeof t)throw new Error("Counter Name must be non empty String");this.name=t,this.counters=r}return(0,s.default)(e,[{key:"incrementAndGet",value:function(){return this.counters.incrementAndGet(this.name)}},{key:"getAndIncrement",value:function(){return this.counters.getAndIncrement(this.name)}},{key:"decrementAndGet",value:function(){return this.counters.decrementAndGet(this.name)}},{key:"getAndDecrement",value:function(){return this.counters.getAndDecrement(this.name)}},{key:"reset",value:function(){return this.counters.reset(this.name)}},{key:"get",value:function(){return this.counters.get(this.name)}},{key:"addAndGet",value:function(e){return this.counters.addAndGet(this.name,e)}},{key:"getAndAdd",value:function(e){return this.counters.getAndAdd(this.name,e)}},{key:"compareAndSet",value:function(e,t){return this.counters.compareAndSet(this.name,e,t)}}]),e}();t.default=i},1062:(e,t,r)=>{"use strict";var n=r(4836);t.Z=void 0;var o=n(r(4687)),s=n(r(7156)),i=n(r(6690)),a=n(r(9728)),u=n(r(5921)),c=function(){function e(t){(0,i.default)(this,e),this.app=t}var t,r,n,c,l,f,p,d,h,y;return(0,a.default)(e,[{key:"of",value:function(e){return new u.default(e,this)}},{key:"list",value:(y=(0,s.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null==t||"string"==typeof t){e.next=2;break}throw new Error("Counters Pattern can be a string only");case 2:return e.abrupt("return",this.app.request.get({url:this.app.urls.countersList(t)}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return y.apply(this,arguments)})},{key:"incrementAndGet",value:(h=(0,s.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Counter Name must be provided and must be a string.");case 2:return e.abrupt("return",this.app.request.put({url:this.app.urls.counterIncrementAndGet(t)}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return h.apply(this,arguments)})},{key:"getAndIncrement",value:(d=(0,s.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Counter Name must be provided and must be a string.");case 2:return e.abrupt("return",this.app.request.put({url:this.app.urls.counterGetAndIncrement(t)}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return d.apply(this,arguments)})},{key:"decrementAndGet",value:(p=(0,s.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Counter Name must be provided and must be a string.");case 2:return e.abrupt("return",this.app.request.put({url:this.app.urls.counterDecrementAndGet(t)}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return p.apply(this,arguments)})},{key:"getAndDecrement",value:(f=(0,s.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Counter Name must be provided and must be a string.");case 2:return e.abrupt("return",this.app.request.put({url:this.app.urls.counterGetAndDecrement(t)}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return f.apply(this,arguments)})},{key:"reset",value:(l=(0,s.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Counter Name must be provided and must be a string.");case 2:return e.abrupt("return",this.app.request.put({url:this.app.urls.counterReset(t)}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"get",value:(c=(0,s.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Counter Name must be provided and must be a string.");case 2:return e.abrupt("return",this.app.request.get({url:this.app.urls.counter(t)}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return c.apply(this,arguments)})},{key:"addAndGet",value:(n=(0,s.default)(o.default.mark((function e(t,r){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Counter Name must be provided and must be a string.");case 2:if("number"==typeof r){e.next=4;break}throw new Error("Counter Value must be a number.");case 4:return e.abrupt("return",this.app.request.put({url:this.app.urls.counterAddAndGet(t),query:{value:r}}));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"getAndAdd",value:(r=(0,s.default)(o.default.mark((function e(t,r){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Counter Name must be provided and must be a string.");case 2:if("number"==typeof r){e.next=4;break}throw new Error("Counter Value must be a number.");case 4:return e.abrupt("return",this.app.request.put({url:this.app.urls.counterGetAndAdd(t),query:{value:r}}));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"compareAndSet",value:(t=(0,s.default)(o.default.mark((function e(t,r,n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Counter Name must be provided and must be a string.");case 2:if("number"==typeof r){e.next=4;break}throw new Error("Counter Expected Value must be a number.");case 4:if("number"==typeof n){e.next=6;break}throw new Error("Counter Updated Value must be a number.");case 6:return e.abrupt("return",this.app.request.put({url:this.app.urls.counterCompareAndSet(t),query:{expected:r,updatedvalue:n}}));case 7:case"end":return e.stop()}}),e,this)}))),function(e,r,n){return t.apply(this,arguments)})}]),e}();t.Z=c},3082:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.PAGING_DEFAULTS=void 0;var o=n(r(8416)),s=n(r(6690)),i=n(r(9728)),a=n(r(9853));function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var c={pageSize:10,offset:0};t.PAGING_DEFAULTS=c;var l=function(){function e(){(0,s.default)(this,e),this.offset=c.offset,this.pageSize=c.pageSize,this.sortBy=null,this.groupBy=null,this.properties=null,this.excludeProps=null,this.whereClause=null,this.havingClause=null,this.relations=null,this.relationsDepth=null,this.relationsPageSize=null,this.distinct=!1}return(0,i.default)(e,[{key:"setPageSize",value:function(e){if(e<=0)throw new Error("Page size must be a positive value.");return this.pageSize=e,this}},{key:"getPageSize",value:function(){return this.pageSize}},{key:"setOffset",value:function(e){if(e<0)throw new Error("Offset cannot have a negative value.");return this.offset=e,this}},{key:"getOffset",value:function(){return this.offset}},{key:"prepareNextPage",value:function(){return this.setOffset(this.offset+this.pageSize),this}},{key:"preparePreviousPage",value:function(){return this.setOffset(Math.max(this.offset-this.pageSize,0)),this}},{key:"getProperties",value:function(){return this.properties}},{key:"setProperties",value:function(e){return this.properties=a.default.castArray(e),this}},{key:"addProperty",value:function(e){return this.properties=this.properties||[],this.properties.push(e),this}},{key:"addProperties",value:function(){for(var e=this,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return r.forEach((function(t){a.default.castArray(t).forEach((function(t){return e.addProperty(t)}))})),this}},{key:"addAllProperties",value:function(){return this.addProperty("*"),this}},{key:"excludeProperty",value:function(e){return this.excludeProps=this.excludeProps||[],this.excludeProps.push(e),this}},{key:"excludeProperties",value:function(){for(var e=this,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return r.forEach((function(t){a.default.castArray(t).forEach((function(t){return e.excludeProperty(t)}))})),this}},{key:"getExcludeProperties",value:function(){return this.excludeProps}},{key:"getWhereClause",value:function(){return this.whereClause}},{key:"setWhereClause",value:function(e){return this.whereClause=e,this}},{key:"getHavingClause",value:function(){return this.havingClause}},{key:"setHavingClause",value:function(e){return this.havingClause=e,this}},{key:"getSortBy",value:function(){return this.sortBy}},{key:"setSortBy",value:function(e){return this.sortBy=a.default.castArray(e),this}},{key:"getGroupBy",value:function(){return this.groupBy}},{key:"setGroupBy",value:function(e){return this.groupBy=a.default.castArray(e),this}},{key:"getRelated",value:function(){return this.relations}},{key:"setRelated",value:function(e){return this.relations=a.default.castArray(e),this}},{key:"addRelated",value:function(e){return this.relations=(this.relations||[]).concat(e),this}},{key:"setRelationsDepth",value:function(e){return this.relationsDepth=e,this}},{key:"getRelationsDepth",value:function(){return this.relationsDepth}},{key:"setRelationsPageSize",value:function(e){return this.relationsPageSize=e,this}},{key:"getRelationsPageSize",value:function(){return this.relationsPageSize}},{key:"setDistinct",value:function(e){return this.distinct=!!e,this}},{key:"getDistinct",value:function(){return this.distinct}},{key:"setFileReferencePrefix",value:function(e){return this.fileReferencePrefix=e,this}},{key:"getFileReferencePrefix",value:function(){return this.fileReferencePrefix}},{key:"toJSON",value:function(){return{pageSize:this.pageSize,offset:this.offset,properties:this.properties,excludeProps:this.excludeProps,where:this.whereClause,having:this.havingClause,sortBy:this.sortBy,groupBy:this.groupBy,relations:this.relations,relationsDepth:this.relationsDepth,relationsPageSize:this.relationsPageSize,distinct:this.distinct,fileReferencePrefix:this.fileReferencePrefix}}}],[{key:"create",value:function(){return new this}},{key:"toRequestBody",value:function(t){var r=t instanceof e?t.toJSON():t?function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){(0,o.default)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},t):{};return Object.keys(r).forEach((function(e){Array.isArray(r[e])?"groupPath"!==e&&(r[e]=r[e].join(",")):null==r[e]&&delete r[e]})),r.properties&&(r.props=r.properties,delete r.properties),r.relations&&(r.loadRelations=r.relations,delete r.relations),r}},{key:"toQueryString",value:function(t){if(t){t instanceof e&&(t=t.toJSON());var r=[];return t.pageSize>0&&r.push("pageSize=".concat(t.pageSize)),t.offset>0&&r.push("offset=".concat(t.offset)),Array.isArray(t.properties)&&t.properties.length&&t.properties.map((function(e){r.push("property=".concat(encodeURIComponent(e)))})),Array.isArray(t.excludeProps)&&t.excludeProps.length&&r.push("excludeProps=".concat(f(t.excludeProps))),t.where&&r.push("where=".concat(encodeURIComponent(t.where))),t.having&&r.push("having=".concat(encodeURIComponent(t.having))),t.sortBy&&r.push(Array.isArray(t.sortBy)?"sortBy=".concat(f(t.sortBy)):"sortBy=".concat(encodeURIComponent(t.sortBy))),t.groupBy&&r.push(Array.isArray(t.groupBy)?"groupBy=".concat(f(t.groupBy)):"groupBy=".concat(encodeURIComponent(t.groupBy))),Array.isArray(t.relations)&&r.push(t.relations.length?"loadRelations=".concat(f(t.relations)):"loadRelations=*"),t.relationsDepth>0&&r.push("relationsDepth=".concat(t.relationsDepth)),t.relationsPageSize>0&&r.push("relationsPageSize=".concat(t.relationsPageSize)),t.distinct&&r.push("distinct=".concat(t.distinct)),t.fileReferencePrefix&&r.push("fileReferencePrefix=".concat(encodeURIComponent(t.fileReferencePrefix))),r.join("&")}}}]),e}();function f(e){return e.map((function(e){return encodeURIComponent(e)})).join(",")}t.default=l},8461:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GeoTypes=void 0;t.GeoTypes={POINT:"Point",LINE_STRING:"LineString",POLYGON:"Polygon"}},7130:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.GEO_CLASSES=void 0,t.default=function(e,t){var r=y[e.type];if(t=t||p.default.valueBySRSId(e.srsId),r)return r(e.coordinates,t);throw new Error("There is no constructor for ".concat(e.type))};var o,s=n(r(8416)),i=n(r(1589)),a=n(r(7424)),u=n(r(679)),c=n(r(3228)),l=n(r(2253)),f=r(8461),p=n(r(5599));t.GEO_CLASSES=["com.backendless.persistence.Polygon","com.backendless.persistence.LineString","com.backendless.persistence.Point","com.backendless.persistence.Geometry"];var d=function(e,t){var r=(0,a.default)(e,2),n=r[0],o=r[1];return new u.default(t).setX(n).setY(o)},h=function(e,t){var r=e.map((function(e){return d(e,t)}));return new c.default(r,t)},y=(o={},(0,s.default)(o,f.GeoTypes.POINT,d),(0,s.default)(o,f.GeoTypes.LINE_STRING,h),(0,s.default)(o,f.GeoTypes.POLYGON,(function(e,t){var r=e.map((function(e){return h(e,t)})),n=(0,i.default)(r),o=n[0],s=n.slice(1);return new l.default(o,s,t)})),o)},1738:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(6690)),s=n(r(9728)),i=n(r(7130)),a=function(){function e(t){(0,o.default)(this,e),this.srs=t}return(0,s.default)(e,[{key:"read",value:function(e){return(0,i.default)(e,this.srs)}}]),e}();t.default=a},7705:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(6690)),s=n(r(9728)),i=n(r(5599)),a=n(r(1738)),u=n(r(8048)),c=function(){function e(t){(0,o.default)(this,e),this.srs=t||i.default.DEFAULT}return(0,s.default)(e,[{key:"getSRS",value:function(){return this.srs}},{key:"getGeojsonType",value:function(){}},{key:"getWktType",value:function(){}},{key:"wktCoordinatePairs",value:function(){}},{key:"jsonCoordinatePairs",value:function(){}},{key:"asGeoJSON",value:function(){return{type:this.getGeojsonType(),coordinates:this.jsonCoordinatePairs()}}},{key:"asWKT",value:function(){return this.getWktType()+"("+this.wktCoordinatePairs()+")"}},{key:"toJSON",value:function(){return this.asGeoJSON()}},{key:"toString",value:function(){return"'"+this.asWKT()+"'"}}],[{key:"fromWKT",value:function(e,t){return new u.default(t).read(e)}},{key:"fromGeoJSON",value:function(e,t){return new a.default(t).read(e)}}]),e}();t.default=c},3228:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(6690)),s=n(r(9728)),i=n(r(1655)),a=n(r(4993)),u=n(r(3808)),c=n(r(7705));function l(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,u.default)(e);if(t){var o=(0,u.default)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,a.default)(this,r)}}var f=r(8461).GeoTypes.LINE_STRING,p=f.toUpperCase(),d=function(e){(0,i.default)(r,e);var t=l(r);function r(e,n){var s;return(0,o.default)(this,r),(s=t.call(this,n)).points=e||[],s}return(0,s.default)(r,[{key:"getPoints",value:function(){return this.points}},{key:"setPoints",value:function(e){return this.points=e,this}},{key:"getGeojsonType",value:function(){return f}},{key:"getWktType",value:function(){return p}},{key:"jsonCoordinatePairs",value:function(){var e=[];return this.getPoints().forEach((function(t){e.push([t.getX(),t.getY()])})),e}},{key:"wktCoordinatePairs",value:function(){return this.getPoints().map((function(e){return"".concat(e.getX()," ").concat(e.getY())})).join(",")}}]),r}(c.default);t.default=d},679:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(6690)),s=n(r(9728)),i=n(r(1655)),a=n(r(4993)),u=n(r(3808)),c=n(r(7705));function l(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,u.default)(e);if(t){var o=(0,u.default)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,a.default)(this,r)}}var f=r(8461).GeoTypes.POINT,p=f.toUpperCase(),d=function(e){(0,i.default)(r,e);var t=l(r);function r(e){return(0,o.default)(this,r),t.call(this,e)}return(0,s.default)(r,[{key:"lng",get:function(){return this.getLongitude()},set:function(e){this.setLongitude(e)}},{key:"lat",get:function(){return this.getLatitude()},set:function(e){this.setLatitude(e)}},{key:"getX",value:function(){return this.x}},{key:"getY",value:function(){return this.y}},{key:"getLongitude",value:function(){return this.x}},{key:"getLatitude",value:function(){return this.y}},{key:"setX",value:function(e){return this.x=e,this}},{key:"setY",value:function(e){return this.y=e,this}},{key:"setLongitude",value:function(e){return this.setX(e)}},{key:"setLatitude",value:function(e){return this.setY(e)}},{key:"getGeojsonType",value:function(){return f}},{key:"getWktType",value:function(){return p}},{key:"wktCoordinatePairs",value:function(){return"".concat(this.x," ").concat(this.y)}},{key:"jsonCoordinatePairs",value:function(){return[this.x,this.y]}},{key:"equals",value:function(e){return this===e||e instanceof r&&(Math.abs(e.x-this.x)<1e-9&&Math.abs(e.y-this.y)<1e-9&&this.srs===e.srs)}}]),r}(c.default);t.default=d},2253:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(861)),s=n(r(6690)),i=n(r(9728)),a=n(r(1655)),u=n(r(4993)),c=n(r(3808)),l=n(r(7705)),f=n(r(3228));function p(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,c.default)(e);if(t){var o=(0,c.default)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,u.default)(this,r)}}var d=r(8461).GeoTypes.POLYGON,h=d.toUpperCase(),y=function(e){(0,a.default)(r,e);var t=p(r);function r(e,n,o){var i;return(0,s.default)(this,r),(i=t.call(this,o)).setBoundary(e),i.setHoles(n),i}return(0,i.default)(r,[{key:"getBoundary",value:function(){return this.boundary}},{key:"setBoundary",value:function(e){if(!e)throw new Error("The 'boundary' argument is required.");return e instanceof f.default||(e=new f.default(e,this.srs)),this.boundary=e,this}},{key:"getHoles",value:function(){return this.holes}},{key:"setHoles",value:function(e){return this.holes=e||[],this}},{key:"getGeojsonType",value:function(){return d}},{key:"getWktType",value:function(){return h}},{key:"jsonCoordinatePairs",value:function(){var e=[];this.getBoundary().getPoints().forEach((function(t){e.push([t.getX(),t.getY()])}));var t=this.holes.map((function(e){return e.getPoints().map((function(e){return[e.getX(),e.getY()]}))}));return[e].concat((0,o.default)(t))}},{key:"wktCoordinatePairs",value:function(){var e=[this.getBoundary().wktCoordinatePairs()];this.holes.forEach((function(t){return e.push(t.wktCoordinatePairs())}));return e.map((function(e){return"("+e+")"})).join(",")}}]),r}(l.default);t.default=y},5599:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(6690)),s=n(r(9728)),i=function(){function e(t){var r=t.srsId,n=t.name;(0,o.default)(this,e),this.srsId=r,this.name=n}return(0,s.default)(e,[{key:"getSRSId",value:function(){return this.srsId}},{key:"getName",value:function(){return this.name}},{key:"toString",value:function(){return this.getName()+"("+this.getSRSId()+")"}}]),e}(),a=new i({srsId:0,name:"Cartesian"}),u=new i({srsId:4200,name:"Pulkovo 1995"}),c=new i({srsId:4326,name:"WGS 84"}),l={CARTESIAN:a,PULKOVO_1995:u,WGS84:c,WGS84_PSEUDO_MERCATOR:new i({srsId:3857,name:"WGS 84 / Pseudo-Mercator"}),WGS84_WORLD_MERCATOR:new i({srsId:3395,name:"WGS 84 / World Mercator"}),DEFAULT:c,SRS_MAP:{},valueBySRSId:function(e){return l.SRS_MAP[e]}};Object.keys(l).forEach((function(e){if(l[e]instanceof i){var t=l[e];l.SRS_MAP[t.getSRSId()]=t}}));var f=l;t.default=f},8048:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(6690)),s=n(r(9728)),i=n(r(3734)),a=n(r(7130)),u=function(){function e(t){(0,o.default)(this,e),this.srs=t}return(0,s.default)(e,[{key:"read",value:function(e){var t=(0,i.default)(e);if(!t)throw new Error("WKT string is invalid");return(0,a.default)(t,this.srs)}}]),e}();t.default=u},3734:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(861)),s=r(8461),i=/[-+]?([0-9]*\.[0-9]+|[0-9]+)([eE][-+]?[0-9]+)?/,a=new RegExp("^"+i.source+"(\\s"+i.source+"){1,}"),u=function(e){var t=0,r=function(r){var n=e.substring(t).match(r);return n?(t+=n[0].length,n[0]):null},n=function(){return r(/^\s*/)},i=function(){for(var e,t,s=[];t=r(a)||r(/^(,)/);)","===t?(s.push(e),e=[]):t.split(/\s/g).some(isNaN)||(e||(e=[]),e=[].concat((0,o.default)(e),(0,o.default)(t.split(/\s/g).map(parseFloat)))),n();return e?(s.push(e),s.length?s:null):null};return function(){if(!r(/^(point(\sz)?)/i))return null;if(n(),!r(/^(\()/))return null;n();var e=i();return e&&r(/^(\))/)?{type:s.GeoTypes.POINT,coordinates:e[0]}:null}()||function(){if(!r(/^(linestring(\sz)?)/i))return null;if(n(),!r(/^(\()/))return null;var e=i();return e&&r(/^(\))/)?{type:s.GeoTypes.LINE_STRING,coordinates:e}:null}()||function(){if(!r(/^(polygon(\sz)?)/i))return null;n();var e=function(){n();for(var e,t=0,o=[],s=[o],i=o;e=r(/^(\()/)||r(/^(\))/)||r(/^(,)/)||r(a);){if("("===e)s.push(i),i=[],s[s.length-1].push(i),t++;else if(")"===e){if(0===i.length)return null;if(!(i=s.pop()))return null;if(0===--t)break}else if(","===e)i=[],s[s.length-1].push(i);else{if(e.split(/\s/g).some(isNaN))return null;Array.prototype.push.apply(i,e.split(/\s/g).map(parseFloat))}n()}return 0!==t?null:o}();return e?{type:s.GeoTypes.POLYGON,coordinates:e}:null}()};t.default=u},6820:(e,t,r)=>{"use strict";var n=r(4836),o=r(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var s=n(r(6690)),i=n(r(9728)),a=n(r(1588)),u=n(r(1655)),c=n(r(4993)),l=n(r(3808)),f=n(r(9853)),p=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==o(e)&&"function"!=typeof e)return{default:e};var r=d(t);if(r&&r.has(e))return r.get(e);var n={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var a=s?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=e[i]}n.default=e,r&&r.set(e,n);return n}(r(3082));function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(d=function(e){return e?r:t})(e)}function h(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,l.default)(e);if(t){var o=(0,l.default)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,c.default)(this,r)}}var y=function(e){(0,u.default)(r,e);var t=h(r);function r(){var e;return(0,s.default)(this,r),(e=t.call(this)).groupPageSize=p.PAGING_DEFAULTS.pageSize,e.recordsPageSize=p.PAGING_DEFAULTS.pageSize,e.groupDepth=null,e.groupPath=null,e}return(0,i.default)(r,[{key:"setGroupPageSize",value:function(e){if(e<=0)throw new Error("Group page size must be a positive value.");return this.groupPageSize=e,this}},{key:"getGroupPageSize",value:function(){return this.groupPageSize}},{key:"setRecordsPageSize",value:function(e){if(e<=0)throw new Error("Records page size must be a positive value.");return this.recordsPageSize=e,this}},{key:"getRecordsPageSize",value:function(){return this.recordsPageSize}},{key:"setGroupDepth",value:function(e){if(e<0)throw new Error("Group depth cannot have a negative value.");return this.groupDepth=e,this}},{key:"getGroupDepth",value:function(){return this.groupDepth}},{key:"getGroupPath",value:function(){return this.groupPath}},{key:"addGroupPath",value:function(e){return this.groupPath=(this.groupPath||[]).concat(e),this}},{key:"setGroupPath",value:function(e){return this.groupPath=f.default.castArray(e),this}},{key:"toJSON",value:function(){var e=(0,a.default)((0,l.default)(r.prototype),"toJSON",this).call(this);return e.groupDepth=this.getGroupDepth(),e.groupPath=this.getGroupPath(),e.groupPageSize=this.getGroupPageSize(),e.recordsPageSize=this.getRecordsPageSize(),e}}]),r}(p.default);t.default=y},7607:(e,t,r)=>{"use strict";var n=r(4836);t.Z=void 0;var o=n(r(4687)),s=n(r(7156)),i=n(r(8416)),a=n(r(6690)),u=n(r(9728)),c=n(r(9853)),l=n(r(5602)),f=n(r(9540)),p=n(r(3082)),d=n(r(6820)),h=n(r(3198)),y=n(r(2496)),v=n(r(679)),m=n(r(3228)),b=n(r(2253)),g=n(r(7705)),w=n(r(5599)),k=n(r(8048)),E=n(r(1738)),O=n(r(6064)),S=function(){function e(t){(0,a.default)(this,e),this.app=t,this.classToTableMap=(0,i.default)({},l.default.className,l.default),this.Permissions={FIND:new O.default("FIND",t),REMOVE:new O.default("REMOVE",t),UPDATE:new O.default("UPDATE",t)},this.QueryBuilder=p.default,this.GroupQueryBuilder=d.default,this.LoadRelationsQueryBuilder=h.default,this.JSONUpdateBuilder=y.default,this.Point=v.default,this.LineString=m.default,this.Polygon=b.default,this.Geometry=g.default,this.GeoJSONParser=E.default,this.WKTParser=k.default,this.SpatialReferenceSystem=w.default}var t,r;return(0,u.default)(e,[{key:"of",value:function(e){return new f.default(e,this)}},{key:"describe",value:(r=(0,s.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t="string"==typeof t?t:c.default.getClassName(t),e.abrupt("return",this.app.request.get({url:this.app.urls.dataTableProps(t)}));case 2:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"getTableNameById",value:(t=(0,s.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.app.request.get({url:this.app.urls.dataTableNameById(t)}));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"mapTableToClass",value:function(e,t){if("function"==typeof e&&(t=e,e=c.default.getClassName(t)),!e||"string"!=typeof e)throw new Error("Table Name must be provided and must be a string.");if(!t||"function"!=typeof t)throw new Error("Class must be provided and must be a constructor function.");this.classToTableMap[e]=t}}]),e}();t.Z=S},2496:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(1655)),s=n(r(4993)),i=n(r(3808)),a=n(r(6690)),u=n(r(9728));function c(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,i.default)(e);if(t){var o=(0,i.default)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,s.default)(this,r)}}var l="JSON_SET",f="JSON_INSERT",p="JSON_REPLACE",d="JSON_REMOVE",h="JSON_ARRAY_APPEND",y="JSON_ARRAY_INSERT",v=function(){function e(t){(0,a.default)(this,e),this.operationName=t,this.args={}}return(0,u.default)(e,[{key:"addArgument",value:function(e,t){if(void 0===t)throw new Error("You have to specify function's second argument");return this.args[e]=t,this}},{key:"toJSON",value:function(){return this.validate(),{___operation:this.operationName,args:this.args}}},{key:"create",value:function(){return this.toJSON()}},{key:"validate",value:function(){if(!Object.keys(this.args).length)throw new Error("You have to add at least one argument")}}],[{key:"SET",value:function(){return new e(l)}},{key:"INSERT",value:function(){return new e(f)}},{key:"REPLACE",value:function(){return new e(p)}},{key:"REMOVE",value:function(){return new m}},{key:"ARRAY_APPEND",value:function(){return new e(h)}},{key:"ARRAY_INSERT",value:function(){return new e(y)}}]),e}();t.default=v;var m=function(e){(0,o.default)(r,e);var t=c(r);function r(){var e;return(0,a.default)(this,r),(e=t.call(this,d)).args=[],e}return(0,u.default)(r,[{key:"addArgument",value:function(e){return this.args.push(e),this}},{key:"validate",value:function(){if(!this.args.length)throw new Error("You have to add at least one argument")}}]),r}(v)},3198:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(6690)),s=n(r(9728)),i=n(r(1588)),a=n(r(1655)),u=n(r(4993)),c=n(r(3808));function l(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,c.default)(e);if(t){var o=(0,c.default)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,u.default)(this,r)}}var f=function(e){(0,a.default)(r,e);var t=l(r);function r(e){var n;return(0,o.default)(this,r),(n=t.call(this)).relationModel=e,n.relationName=null,n}return(0,s.default)(r,[{key:"setRelationName",value:function(e){return this.relationName=e,this}},{key:"getRelationName",value:function(){return this.relationName}},{key:"setRelationModel",value:function(e){return this.relationModel=e,this}},{key:"getRelationModel",value:function(){return this.relationModel}},{key:"toJSON",value:function(){var e=(0,i.default)((0,c.default)(r.prototype),"toJSON",this).call(this);return e.relationName=this.getRelationName(),e.relationModel=this.getRelationModel(),e}}],[{key:"of",value:function(e){return new this(e)}}]),r}(n(r(3082)).default);t.default=f},6064:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(6690)),s=n(r(9728)),i=n(r(1655)),a=n(r(4993)),u=n(r(3808)),c=n(r(8416));function l(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,u.default)(e);if(t){var o=(0,u.default)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,a.default)(this,r)}}var f=function(e){(0,i.default)(r,e);var t=l(r);function r(){return(0,o.default)(this,r),t.apply(this,arguments)}return(0,s.default)(r,[{key:"getRequestURL",value:function(e,t){if(!t.___class||!t.objectId)throw new Error('"dataObject.___class" and "dataObject.objectId" need to be specified');return this.app.urls.dataObjectPermission(t.___class,e,t.objectId)}}]),r}(n(r(394)).default);t.default=f,(0,c.default)(f,"BACKWARD_COMPATIBILITY_LABEL","Backendless.Data.Permissions.{FIND|REMOVE|UPDATE}")},9350:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(6690)),s=n(r(9728)),i=n(r(1588)),a=n(r(1655)),u=n(r(4993)),c=n(r(3808)),l=r(9181);function f(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,c.default)(e);if(t){var o=(0,c.default)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,u.default)(this,r)}}var p="created",d="updated",h="deleted",y="upserted",v="bulk-created",m="bulk-updated",b="bulk-deleted",g="bulk-upserted",w="add",k="set",E="delete",O=[p,d,h,y],S=function(e){(0,a.default)(r,e);var t=f(r);function r(e){var n;return(0,o.default)(this,r),(n=t.call(this)).dataStore=e,n.app=e.app,n}return(0,s.default)(r,[{key:"getSubscriptionOptions",value:function(){return{tableName:this.dataStore.className}}},{key:"addCreateListener",value:function(e,t,r){this.addChangesListener(p,e,t,r)}},{key:"removeCreateListeners",value:function(e,t){this.removeChangesListeners(p,e,t)}},{key:"removeCreateListener",value:function(e){if(!e||"function"!=typeof e)throw new Error("Listener Function must be passed.");this.removeCreateListeners(void 0,e)}},{key:"addUpsertListener",value:function(e,t,r){this.addChangesListener(y,e,t,r)}},{key:"removeUpsertListeners",value:function(e,t){this.removeChangesListeners(y,e,t)}},{key:"removeUpsertListener",value:function(e){if(!e||"function"!=typeof e)throw new Error("Listener Function must be passed.");this.removeUpsertListeners(void 0,e)}},{key:"addUpdateListener",value:function(e,t,r){this.addChangesListener(d,e,t,r)}},{key:"removeUpdateListeners",value:function(e,t){this.removeChangesListeners(d,e,t)}},{key:"removeUpdateListener",value:function(e){if(!e||"function"!=typeof e)throw new Error("Listener Function must be passed.");this.removeUpdateListeners(void 0,e)}},{key:"addDeleteListener",value:function(e,t,r){this.addChangesListener(h,e,t,r)}},{key:"removeDeleteListeners",value:function(e,t){this.removeChangesListeners(h,e,t)}},{key:"removeDeleteListener",value:function(e){if(!e||"function"!=typeof e)throw new Error("Listener Function must be passed.");this.removeDeleteListeners(void 0,e)}},{key:"addBulkCreateListener",value:function(e,t,r){this.addChangesListener(v,e,t,r)}},{key:"removeBulkCreateListeners",value:function(){this.removeChangesListeners(v)}},{key:"removeBulkCreateListener",value:function(e){if(!e||"function"!=typeof e)throw new Error("Listener Function must be passed.");this.removeChangesListeners(v,void 0,e)}},{key:"addBulkUpdateListener",value:function(e,t,r){this.addChangesListener(m,e,t,r)}},{key:"removeBulkUpdateListeners",value:function(e,t){this.removeChangesListeners(m,e,t)}},{key:"removeBulkUpdateListener",value:function(e){if(!e||"function"!=typeof e)throw new Error("Listener Function must be passed.");this.removeBulkUpdateListeners(void 0,e)}},{key:"addBulkDeleteListener",value:function(e,t,r){this.addChangesListener(b,e,t,r)}},{key:"removeBulkDeleteListeners",value:function(e,t){this.removeChangesListeners(b,e,t)}},{key:"removeBulkDeleteListener",value:function(e){if(!e||"function"!=typeof e)throw new Error("Listener Function must be passed.");this.removeBulkDeleteListeners(void 0,e)}},{key:"addBulkUpsertListener",value:function(e,t,r){this.addChangesListener(g,e,t,r)}},{key:"removeBulkUpsertListeners",value:function(){this.removeChangesListeners(g)}},{key:"removeBulkUpsertListener",value:function(e){if(!e||"function"!=typeof e)throw new Error("Listener Function must be passed.");this.removeChangesListeners(g,void 0,e)}},{key:"addSetRelationListener",value:function(e,t,r,n){this.addRelationsChangesListener(k,e,t,r,n)}},{key:"removeSetRelationListener",value:function(e){if(!e||"function"!=typeof e)throw new Error("Listener Function must be passed.");this.removeRelationsChangesListeners(k,void 0,e)}},{key:"removeSetRelationListeners",value:function(e,t){this.removeRelationsChangesListeners(k,e,t)}},{key:"addAddRelationListener",value:function(e,t,r,n){this.addRelationsChangesListener(w,e,t,r,n)}},{key:"removeAddRelationListener",value:function(e){if(!e||"function"!=typeof e)throw new Error("Listener Function must be passed.");this.removeRelationsChangesListeners(w,void 0,e)}},{key:"removeAddRelationListeners",value:function(e,t){this.removeRelationsChangesListeners(w,e,t)}},{key:"addDeleteRelationListener",value:function(e,t,r,n){this.addRelationsChangesListener(E,e,t,r,n)}},{key:"removeDeleteRelationListener",value:function(e){if(!e||"function"!=typeof e)throw new Error("Listener Function must be passed.");this.removeRelationsChangesListeners(E,void 0,e)}},{key:"removeDeleteRelationListeners",value:function(e,t){this.removeRelationsChangesListeners(E,e,t)}},{key:"addChangesListener",value:function(e,t,r,n){if("function"==typeof t&&(n=r,r=t,t=void 0),"function"!=typeof r)throw new Error("Listener Function must be passed.");this.addSubscription(e,this.app.RT.subscriptions.onObjectsChanges,{callback:r,onError:n,parser:O.includes(e)?this.parseObjectToInstance.bind(this):void 0,params:{event:e,whereClause:t}})}},{key:"removeChangesListeners",value:function(e,t,r){"function"==typeof t&&(r=t,t=void 0);this.stopSubscription(e,{matcher:function(e){var n=e.params;return t?n.whereClause===t:!r||e.callback===r}})}},{key:"addRelationsChangesListener",value:function(e,t,r,n,o){if(!t||"string"!=typeof t)throw new Error("Relation Column Name must be a string.");if("function"==typeof r&&(o=n,n=r,r=void 0),"function"!=typeof n)throw new Error("Listener Function must be passed.");if(r){if(!Array.isArray(r))throw new Error("Parent Objects must be an array");r=r.map((function(e){return e.objectId||e}))}this.addSubscription(e,this.app.RT.subscriptions.onRelationsChanges,{callback:n,onError:o,params:{event:e,relationColumnName:t,parentObjects:r}})}},{key:"removeRelationsChangesListeners",value:function(e,t,r){"function"==typeof t&&(r=t,t=void 0);this.stopSubscription(e,{matcher:function(e){var n=e.params;return t?n.relationColumnName===t:!r||e.callback===r}})}},{key:"removeAllListeners",value:function(){(0,i.default)((0,c.default)(r.prototype),"removeAllListeners",this).call(this)}},{key:"parseObjectToInstance",value:function(e){return this.dataStore.parseResponse(e)}}]),r}(l.RTListeners);t.default=S},9540:(e,t,r)=>{"use strict";var n=r(4836),o=r(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var s=n(r(7424)),i=n(r(215)),a=n(r(4687)),u=n(r(8698)),c=n(r(7156)),l=n(r(6690)),f=n(r(9728)),p=n(r(8416)),d=n(r(9853)),h=n(r(7738)),y=n(r(9350)),v=n(r(3082)),m=n(r(3198)),b=n(r(2496)),g=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==o(e)&&"function"!=typeof e)return{default:e};var r=E(t);if(r&&r.has(e))return r.get(e);var n={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var a=s?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=e[i]}n.default=e,r&&r.set(e,n);return n}(r(7130)),w=n(r(7705)),k=["relationName","relationModel"];function E(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(E=function(e){return e?r:t})(e)}function O(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function S(e,t){var r=e instanceof v.default?e.toJSON():e?function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?O(Object(r),!0).forEach((function(t){(0,p.default)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e):{};return r.pageSize=1,r.offset=0,r.sortBy||(r.sortBy=["created ".concat(t)]),v.default.toRequestBody(r)}var _=function(){function e(t,r){if((0,l.default)(this,e),this.app=r.app,this.classToTableMap=r.classToTableMap,"string"==typeof t?(this.className=t,this.model=this.classToTableMap[this.className]):(this.className=d.default.getClassName(t),this.model=this.classToTableMap[this.className]||t),!this.className)throw new Error("Class name should be specified")}var t,r,n,o,s,p,h,b,g,w,E,O,_,j,T,P,C,A;return(0,f.default)(e,[{key:"rt",value:function(){return this.rtHandlers=this.rtHandlers||new y.default(this)}},{key:"save",value:(A=(0,c.default)(a.default.mark((function e(t,r){var n,o=this;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r?this.app.urls.dataTableUpsert(this.className):this.app.urls.dataTable(this.className),e.abrupt("return",this.app.request.put({url:n,data:R(t)}).then((function(e){return o.parseResponse(e)})));case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return A.apply(this,arguments)})},{key:"deepSave",value:(C=(0,c.default)(a.default.mark((function e(t){var r=this;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.app.request.put({url:this.app.urls.dataTableDeepSave(this.className),data:R(t)}).then((function(e){return r.parseResponse(e)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return C.apply(this,arguments)})},{key:"remove",value:(P=(0,c.default)(a.default.mark((function e(t){var r;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((r=t&&t.objectId||t)&&("string"==typeof r||"number"==typeof r)){e.next=3;break}throw new Error("Object Id must be provided and must be a string or number.");case 3:return e.abrupt("return",this.app.request.delete({url:this.app.urls.dataTableObject(this.className,r)}));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return P.apply(this,arguments)})},{key:"find",value:(T=(0,c.default)(a.default.mark((function e(t){var r=this;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.app.request.post({url:this.app.urls.dataTableFind(this.className),data:v.default.toRequestBody(t)}).then((function(e){return r.parseResponse(e)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return T.apply(this,arguments)})},{key:"group",value:(j=(0,c.default)(a.default.mark((function e(t){return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.app.request.post({url:this.app.urls.dataGrouping(this.className),data:v.default.toRequestBody(t)}));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return j.apply(this,arguments)})},{key:"countInGroup",value:(_=(0,c.default)(a.default.mark((function e(t){return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.groupPath&&"object"===(0,u.default)(t.groupPath)){e.next=2;break}throw new Error("Group Path must be provided and must be an object.");case 2:return e.abrupt("return",this.app.request.post({url:"".concat(this.app.urls.dataGrouping(this.className),"/count"),data:v.default.toRequestBody(t)}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return _.apply(this,arguments)})},{key:"findById",value:(O=(0,c.default)(a.default.mark((function e(t,r){var n;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t||"object"!==(0,u.default)(t)||Array.isArray(t)){e.next=8;break}if(Object.keys(t).length){e.next=3;break}throw new Error("Provided object must have at least 1 primary keys.");case 3:return e.next=5,this.app.request.get({url:this.app.urls.dataTablePrimaryKey(this.className),query:t});case 5:n=e.sent,e.next=14;break;case 8:if(t&&("string"==typeof t||"number"==typeof t)){e.next=10;break}throw new Error("Object Id must be provided and must be a string or number or an object of primary keys.");case 10:return r&&(r.pageSize=null,r.offset=null),e.next=13,this.app.request.get({url:this.app.urls.dataTableObject(this.className,t),queryString:v.default.toQueryString(r)});case 13:n=e.sent;case 14:return e.abrupt("return",this.parseResponse(n));case 15:case"end":return e.stop()}}),e,this)}))),function(e,t){return O.apply(this,arguments)})},{key:"findFirst",value:(E=(0,c.default)(a.default.mark((function e(t){var r=this;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.app.request.post({url:this.app.urls.dataTableFind(this.className),data:S(t,"asc")}).then((function(e){return r.parseResponse(e[0])})));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return E.apply(this,arguments)})},{key:"findLast",value:(w=(0,c.default)(a.default.mark((function e(t){var r=this;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.app.request.post({url:this.app.urls.dataTableFind(this.className),data:S(t,"desc")}).then((function(e){return r.parseResponse(e[0])})));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return w.apply(this,arguments)})},{key:"getObjectCount",value:(g=(0,c.default)(a.default.mark((function e(t){var r,n;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=void 0,n=void 0,!t){e.next=11;break}if(!(t instanceof v.default)){e.next=9;break}r=t.getDistinct()||void 0,n=t.getGroupBy()||void 0,t=t.getWhereClause()||void 0,e.next=11;break;case 9:if("string"==typeof t){e.next=11;break}throw new Error("Condition must be a string or an instance of DataQueryBuilder.");case 11:return e.abrupt("return",this.app.request.post({url:this.app.urls.dataTableCount(this.className),data:{where:t,distinct:r,groupBy:n}}));case 12:case"end":return e.stop()}}),e,this)}))),function(e){return g.apply(this,arguments)})},{key:"loadRelations",value:(b=(0,c.default)(a.default.mark((function e(t,r){var n,o,s,u,c,l=this;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((n=t&&t.objectId||t)&&("string"==typeof n||"number"==typeof n)){e.next=3;break}throw new Error("Parent Object Id must be provided and must be a string or number.");case 3:if(o=r instanceof m.default?r.toJSON():r,s=o.relationName,u=o.relationModel,c=(0,i.default)(o,k),s&&"string"==typeof s){e.next=6;break}throw new Error("Relation Name must be provided and must be a string.");case 6:return e.abrupt("return",this.app.request.get({url:this.app.urls.dataTableObjectRelation(this.className,n,s),queryString:m.default.toQueryString(c)}).then((function(e){return l.parseRelationsResponse(e,u)})));case 7:case"end":return e.stop()}}),e,this)}))),function(e,t){return b.apply(this,arguments)})},{key:"setRelation",value:(h=(0,c.default)(a.default.mark((function e(t,r,n){return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.changeRelation(this.app.request.Methods.POST,t,r,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return h.apply(this,arguments)})},{key:"addRelation",value:(p=(0,c.default)(a.default.mark((function e(t,r,n){return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.changeRelation(this.app.request.Methods.PUT,t,r,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return p.apply(this,arguments)})},{key:"deleteRelation",value:(s=(0,c.default)(a.default.mark((function e(t,r,n){return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.changeRelation(this.app.request.Methods.DELETE,t,r,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return s.apply(this,arguments)})},{key:"bulkCreate",value:(o=(0,c.default)(a.default.mark((function e(t){var r;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r="Objects must be provided and must be an array of objects.",t&&Array.isArray(t)){e.next=3;break}throw new Error(r);case 3:return t=t.map((function(e){if(!e||"object"!==(0,u.default)(e)||Array.isArray(e))throw new Error(r);return e})),e.abrupt("return",this.app.request.post({url:this.app.urls.dataBulkTable(this.className),data:t}));case 5:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"bulkUpsert",value:(n=(0,c.default)(a.default.mark((function e(t){var r;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r="Objects must be provided and must be an array of objects.",t&&Array.isArray(t)&&t.length){e.next=3;break}throw new Error(r);case 3:return t=t.map((function(e){if(!e||"object"!==(0,u.default)(e)||Array.isArray(e))throw new Error(r);return e})),e.abrupt("return",this.app.request.put({url:this.app.urls.dataBulkTableUpsert(this.className),data:t}));case 5:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"bulkUpdate",value:(r=(0,c.default)(a.default.mark((function e(t,r){return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Condition must be provided and must be a string.");case 2:if(r&&"object"===(0,u.default)(r)&&!Array.isArray(r)){e.next=4;break}throw new Error("Changes must be provided and must be an object.");case 4:return e.abrupt("return",this.app.request.put({url:this.app.urls.dataBulkTable(this.className),query:{where:t},data:r}));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"bulkDelete",value:(t=(0,c.default)(a.default.mark((function e(t){var r,n;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&("string"==typeof t||Array.isArray(t))){e.next=2;break}throw new Error("Condition must be provided and must be a string or a list of objects.");case 2:return r={},"string"==typeof t?r.where=t:(n=t.map((function(e){var t=e&&e.objectId||e;if(!t||"string"!=typeof t&&"number"!=typeof t)throw new Error('Can not transform "objects" to "whereClause". Item must be a string or number or an object with property "objectId" as string.');return"'".concat(t,"'")})),r.where="objectId in (".concat(n.join(","),")")),e.abrupt("return",this.app.request.post({url:this.app.urls.dataBulkTableDelete(this.className),data:r}));case 5:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"parseRelationsResponse",value:function(e,t){return x(e,t,this)}},{key:"parseResponse",value:function(e){return x(e,this.model,this)}},{key:"changeRelation",value:function(e,t,r,n){var o=t&&t.objectId||t;if(!o||"string"!=typeof o&&"number"!=typeof o)throw new Error("Relation Parent must be provided and must be a string or number or an object with objectId property.");if(!r||"string"!=typeof r)throw new Error("Relation Column Name must be provided and must be a string.");if(!n||"string"!=typeof n&&!Array.isArray(n))throw new Error("Relation Children must be provided and must be a string or a list of objects.");var s={};"string"==typeof n?s.whereClause=n:s.childrenIds=n.map((function(e){var t=e&&e.objectId||e;if(!t||"string"!=typeof t&&"number"!=typeof t)throw new Error("Child Id must be provided and must be a string or number.");return t}));var i={};return s.whereClause&&(i.whereClause=s.whereClause),this.app.request.send({method:e,url:this.app.urls.dataTableObjectRelation(this.className,o,r),query:i,data:s.childrenIds})}}]),e}();t.default=_;var R=function(e){return function e(t,r,n){for(var o in r)if(Array.isArray(r[o]))e(t,r[o],n[o]=[]);else if(!r[o]||"object"!==(0,u.default)(r[o])||r[o]instanceof w.default||r[o]instanceof b.default||r[o]instanceof h.default)n[o]=r[o];else if(r[o]instanceof Date)n[o]=r[o].getTime();else if(t.instancesMap.has(r[o])){var s=t.instancesMap.get(r[o]);s.__subID||(s.__subID=d.default.uuid()),n[o]={__originSubID:s.__subID}}else{var i=n[o]={};t.instancesMap.set(r[o],i),e(t,r[o],i)}return n}({instancesMap:new WeakMap},e,{})},x=function(){return function(e,t,n){if(!e)return e;var o={RootModel:t,app:n.app,classToTableMap:n.classToTableMap,subIds:{},postAssign:[]},i=Array.isArray(e)?e.map((function(e){return r(o,e)})):r(o,e);return function(e){e.postAssign.forEach((function(t){var r=(0,s.default)(t,3),n=r[0],o=r[1],i=r[2];n[o]=e.subIds[i]}))}(o),i};function e(e,r,n,o){Array.isArray(r[o])?t(e,r[o],n[o]=[]):r[o]&&"object"===(0,u.default)(r[o])?g.GEO_CLASSES.includes(r[o].___class)?n[o]=(0,g.default)(r[o]):r[o].__originSubID?e.postAssign.push([n,o,r[o].__originSubID]):function(e,r,n,o){var s=r[o].__subID;if(s&&e.subIds[s])n[o]=e.subIds[s],delete r[o].__subID;else{var i=e.classToTableMap[r[o].___class];n[o]=i?new i:{},s&&!e.subIds[s]&&(e.subIds[s]=n[o],delete r[o].__subID),t(e,r[o],n[o])}}(e,r,n,o):n[o]=r[o]}function t(t,r,n){for(var o in r)e(t,r,n,o)}function r(e,r){var n=e.RootModel||e.classToTableMap[r.___class],o=n?new n:{};if(r.__subID){if(e.subIds[r.__subID])return e.subIds[r.__subID];e.subIds[r.__subID]=o,delete r.__subID}return t(e,r,o),o}}()},1318:(e,t,r)=>{"use strict";var n=r(4836);t.Z=void 0;var o=n(r(9728)),s=n(r(6690)),i=(0,o.default)((function e(t){if((0,s.default)(this,e),!(t&&t.uuid&&t.platform&&t.version))throw new Error('Device properties object must consist of fields "uuid", "platform" and "version".');this.uuid=t.uuid,this.platform=t.platform.toUpperCase(),this.version=t.version}));t.Z=i},7738:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(6690)),s=n(r(9728)),i=function(){function e(t){if((0,o.default)(this,e),!t||"string"!=typeof t)throw new Error("The Backendless.Expression class can be initialized with non empty string value only");this.value=t}return(0,s.default)(e,[{key:"toJSON",value:function(){return{___class:"BackendlessExpression",value:this.value}}}]),e}();t.default=i},3011:(e,t,r)=>{"use strict";var n=r(4836);t.Z=void 0;var o=n(r(4687)),s=n(r(7156)),i=n(r(6690)),a=n(r(9728)),u=n(r(4253)),c=n(r(1141)),l=function(){function e(t){(0,i.default)(this,e),this.app=t,this.Permissions={READ:new c.default("READ",t),DELETE:new c.default("DELETE",t),WRITE:new c.default("WRITE",t)}}var t,r,n,l,f,p,d,h,y,v,m,b,g;return(0,a.default)(e,[{key:"saveFile",value:(g=(0,s.default)(o.default.mark((function e(t,r,n,s){var i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error('"filePath" must be provided and must be a string.');case 2:if(r&&"string"==typeof r){e.next=4;break}throw new Error("File Name must be provided and must be a string.");case 4:return e.next=6,u.default.toBase64(n);case 6:return n=e.sent,i={},"boolean"==typeof s&&(i.overwrite=s),t=u.default.trimSlashesInPath(t),r=u.default.sanitizeFileName(r),e.abrupt("return",this.app.request.put({url:"".concat(this.app.urls.fileBinaryPath(t),"/").concat(r),headers:{"Content-Type":"text/plain"},query:i,data:n}));case 12:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n){return g.apply(this,arguments)})},{key:"upload",value:(b=(0,s.default)(o.default.mark((function e(t,r,n){var s,i,a,c;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s={},"boolean"==typeof n&&(s.overwrite=n),r=u.default.trimSlashesInPath(r),(i=u.default.parseFilePath(r)).fileName&&(r=i.filePath,a=i.fileName),"string"!=typeof t){e.next=8;break}return a||(c=u.default.parseFilePath(t),a=c.fileName),e.abrupt("return",this.app.request.post({url:"".concat(this.app.urls.filePath(r),"/").concat(a),query:s,data:{url:t}}));case 8:if(a||(a=u.default.getFileName(t)),a){e.next=11;break}throw new Error("Wrong type of the file source object. Can not get file name");case 11:return a=u.default.sanitizeFileName(a),e.abrupt("return",this.app.request.post({url:"".concat(this.app.urls.filePath(r),"/").concat(a),query:s,form:{file:t}}));case 13:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return b.apply(this,arguments)})},{key:"append",value:(m=(0,s.default)(o.default.mark((function e(t,r,n){var s,i=arguments;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error('"filePath" must be provided and must be a string.');case 2:if(t=u.default.trimSlashesInPath(t),2===i.length&&(n=r,r=void 0,(s=u.default.parseFilePath(t)).fileName&&(t=s.filePath,r=s.fileName)),r){e.next=6;break}throw new Error("Can not resolve target file name");case 6:if(r=u.default.sanitizeFileName(r),"string"!=typeof n){e.next=9;break}return e.abrupt("return",this.app.request.post({url:"".concat(this.app.urls.fileAppendPath(t),"/").concat(r),data:{url:n}}));case 9:if(!u.default.isBytesArray(n)){e.next=14;break}return e.next=12,u.default.toBase64(n);case 12:return n=e.sent,e.abrupt("return",this.app.request.put({url:"".concat(this.app.urls.fileAppendBinaryPath(t),"/").concat(r),headers:{"Content-Type":"text/plain"},data:n}));case 14:return e.abrupt("return",this.app.request.post({url:"".concat(this.app.urls.fileAppendPath(t),"/").concat(r),form:{file:n}}));case 15:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return m.apply(this,arguments)})},{key:"appendText",value:(v=(0,s.default)(o.default.mark((function e(t,r,n){var s,i=arguments;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error('"filePath" must be provided and must be a string.');case 2:if(t=u.default.trimSlashesInPath(t),2===i.length&&(n=r,r=void 0,(s=u.default.parseFilePath(t)).fileName&&(t=s.filePath,r=s.fileName)),r){e.next=6;break}throw new Error("Can not resolve target file name");case 6:if("string"==typeof n){e.next=8;break}throw new Error('"textContent" must be a string');case 8:return r=u.default.sanitizeFileName(r),e.abrupt("return",this.app.request.put({url:"".concat(this.app.urls.fileAppendPath(t),"/").concat(r),headers:{"Content-Type":"text/plain"},data:n}));case 10:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return v.apply(this,arguments)})},{key:"listing",value:(y=(0,s.default)(o.default.mark((function e(t,r,n,s,i){var a;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a={},t&&"string"==typeof t){e.next=3;break}throw new Error('"filePath" must be provided and must be a string.');case 3:return t=u.default.trimSlashesInPath(t),r&&"string"==typeof r&&(a.pattern=r),"boolean"==typeof n&&(a.sub=n),"number"==typeof s&&s>=0&&(a.pagesize=s),"number"==typeof i&&i>=0&&(a.offset=i),e.abrupt("return",this.app.request.get({url:this.app.urls.filePath(t),query:a}));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n,o){return y.apply(this,arguments)})},{key:"renameFile",value:(h=(0,s.default)(o.default.mark((function e(t,r){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error('"oldPathName" must be provided and must be a string.');case 2:if(r&&"string"==typeof r){e.next=4;break}throw new Error("New File Name must be provided and must be a string.");case 4:return e.abrupt("return",this.app.request.put({url:this.app.urls.fileRename(),data:{oldPathName:u.default.ensureSlashInPath(t),newName:r}}));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return h.apply(this,arguments)})},{key:"moveFile",value:(d=(0,s.default)(o.default.mark((function e(t,r){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.app.request.put({url:this.app.urls.fileMove(),data:{sourcePath:u.default.ensureSlashInPath(t),targetPath:u.default.ensureSlashInPath(r)}}));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)})},{key:"copyFile",value:(p=(0,s.default)(o.default.mark((function e(t,r){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.app.request.put({url:this.app.urls.fileCopy(),data:{sourcePath:u.default.ensureSlashInPath(t),targetPath:u.default.ensureSlashInPath(r)}}));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return p.apply(this,arguments)})},{key:"remove",value:(f=(0,s.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error('"filePath" must be provided and must be a string.');case 2:return t.startsWith("http://")||t.startsWith("https://")||(t=this.app.urls.filePath(t)),e.abrupt("return",this.app.request.delete({url:t}));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return f.apply(this,arguments)})},{key:"exists",value:(l=(0,s.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error('"filePath" must be provided and must be a string.');case 2:return t=u.default.trimSlashesInPath(t),e.abrupt("return",this.app.request.get({url:this.app.urls.filePath(t),query:{action:"exists"}}));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"getFileCount",value:(n=(0,s.default)(o.default.mark((function e(t,r,n,s){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error('"filesPath" must be provided and must be a string.');case 2:if(!r||"string"==typeof r){e.next=4;break}throw new Error("Files Pattern must be provided and must be a string.");case 4:return t=u.default.trimSlashesInPath(t),e.abrupt("return",this.app.request.get({url:this.app.urls.filePath(t),query:{action:"count",pattern:r||"*",sub:!!n,countDirectories:!!s}}));case 6:case"end":return e.stop()}}),e,this)}))),function(e,t,r,o){return n.apply(this,arguments)})},{key:"createDirectory",value:(r=(0,s.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error('Directory "path" must be provided and must be a string.');case 2:return t=u.default.trimSlashesInPath(t),e.abrupt("return",this.app.request.post({url:this.app.urls.directoryPath(t)}));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"removeDirectory",value:(t=(0,s.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error('Directory "path" must be provided and must be a string.');case 2:return t=u.default.trimSlashesInPath(t),e.abrupt("return",this.app.request.delete({url:this.app.urls.filePath(t)}));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),e}();t.Z=l},1141:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(6690)),s=n(r(9728)),i=n(r(1655)),a=n(r(4993)),u=n(r(3808)),c=n(r(8416));function l(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,u.default)(e);if(t){var o=(0,u.default)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,a.default)(this,r)}}var f=function(e){(0,i.default)(r,e);var t=l(r);function r(){return(0,o.default)(this,r),t.apply(this,arguments)}return(0,s.default)(r,[{key:"getRequestURL",value:function(e,t){return this.app.urls.filePermission(e,t)}}]),r}(n(r(394)).default);t.default=f,(0,c.default)(f,"BACKWARD_COMPATIBILITY_LABEL","Backendless.Files.Permissions.{READ|DELETE|WRITE}")},4253:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(4687)),s=n(r(7156)),i={isBytesArray:function(e){return"undefined"!=typeof Buffer&&e instanceof Buffer||("undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer||Array.isArray(e))},ensureSlashInPath:function(e){return e.startsWith("/")?e:"/".concat(e)},trimSlashesInPath:function(e){return e&&(e.startsWith("/")&&(e=e.slice(1)),e.endsWith("/")&&(e=e.slice(0,e.length-1))),e},parseFilePath:function(e){var t={filePath:e,fileName:null};if(e){var r=e.split("/");r[r.length-1].includes(".")&&(t.fileName=r.pop(),t.filePath=r.join("/"))}return t},sanitizeFileName:function(e){return encodeURIComponent(e).replace(/'/g,"%27").replace(/"/g,"%22")},getFileName:function(e){if(e.name)return e.name;if(e.path){var t=e.path.split("/");return t[t.length-1]}},toBase64:function(e){return(0,s.default)(o.default.mark((function t(){return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("undefined"==typeof Blob||"undefined"==typeof FileReader){t.next=3;break}return e instanceof Blob||(e=new Blob([e],{type:""})),t.abrupt("return",new Promise((function(t,r){var n=new FileReader;n.onerror=function(e){return r(e)},n.onload=function(e){return t(e.target.result.split(";base64,")[1])},n.readAsDataURL(e)})));case 3:if("undefined"==typeof Buffer){t.next=5;break}return t.abrupt("return",Buffer.from(e).toString("base64"));case 5:return t.abrupt("return",e);case 6:case"end":return t.stop()}}),t)})))()}};t.default=i},2257:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HiveTypes=void 0;t.HiveTypes={KEY_VALUE:"key-value",LIST:"list",MAP:"map",SET:"set",SORTED_SET:"sorted-set"}},8512:(e,t,r)=>{"use strict";var n=r(4836);t.ZP=function(e){function t(t){if(!t||"string"!=typeof t)throw new Error("Hive name must be provided and must be a string.");return new a(t,{app:e})}return t.getNames=function(){return e.request.get({url:e.urls.dataHives()})},t};var o=n(r(6690)),s=n(r(9728)),i=r(5766);var a=function(){function e(t,r){(0,o.default)(this,e),this.hiveName=t,this.app=r.app,this.KeyValueStore=i.KeyValueStore.registerType(this),this.ListStore=i.ListStore.registerType(this),this.MapStore=i.MapStore.registerType(this),this.SetStore=i.SetStore.registerType(this),this.SortedSetStore=i.SortedSetStore.registerType(this)}return(0,s.default)(e,[{key:"create",value:function(){return this.app.request.post({url:this.app.urls.dataHive(this.hiveName)})}},{key:"delete",value:function(){return this.app.request.delete({url:this.app.urls.dataHive(this.hiveName)})}},{key:"rename",value:function(e){if(!e||"string"!=typeof e)throw new Error("New Hive name must be provided and must be a string.");return this.app.request.put({url:this.app.urls.dataHive(this.hiveName),query:{newName:e}})}}]),e}()},9041:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.HiveStore=void 0;var o=n(r(4687)),s=n(r(7156)),i=n(r(6690)),a=n(r(9728)),u=n(r(8416)),c=n(r(9853));function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function f(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(t){(0,u.default)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var p=function(){function e(t,r){if((0,i.default)(this,e),this.TYPE=this.constructor.TYPE,!r||"string"!=typeof r)throw new Error("Store key must be a string.");this.app=t.app,this.hiveName=t.hiveName,this.storeKey=r}var t;return(0,a.default)(e,[{key:"getBaseURL",value:function(){return"".concat(this.app.urls.hiveStore(this.hiveName,this.TYPE),"/").concat(this.storeKey)}},{key:"delete",value:function(){return this.constructor.delete.call(f(f({},this),this.constructor),[this.storeKey])}},{key:"exist",value:(t=(0,s.default)(o.default.mark((function e(){var t;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.constructor.exist.call(f(f({},this),this.constructor),[this.storeKey]);case 2:return t=e.sent,e.abrupt("return",!!t);case 4:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"rename",value:function(e,t){if(!e||"string"!=typeof e)throw new Error("New key name must be provided and must be a string.");if(void 0!==t&&"boolean"!=typeof t)throw new Error("Overwrite must be a boolean.");return this.app.request.put({url:"".concat(this.getBaseURL(),"/rename"),query:{newKey:e,overwrite:t}})}},{key:"getExpiration",value:function(){return this.app.request.get({url:"".concat(this.getBaseURL(),"/get-expiration-ttl")})}},{key:"clearExpiration",value:function(){return this.app.request.put({url:"".concat(this.getBaseURL(),"/clear-expiration")})}},{key:"expireAfter",value:function(e){if(isNaN(e)||"number"!=typeof e)throw new Error("TTL must be a number.");return this.app.request.put({url:"".concat(this.getBaseURL(),"/expire"),query:{ttl:e}})}},{key:"expireAt",value:function(e){if(isNaN(e)||"number"!=typeof e)throw new Error("Expiration time must be a number.");return this.app.request.put({url:"".concat(this.getBaseURL(),"/expire-at"),query:{unixTime:e}})}},{key:"touch",value:function(){return this.constructor.touch.call(f(f({},this),this.constructor),[this.storeKey])}},{key:"secondsSinceLastOperation",value:function(){return this.app.request.get({url:"".concat(this.getBaseURL(),"/seconds-since-last-operation")})}}],[{key:"registerType",value:function(e){var t=this,r=f(f({},this),{},{app:e.app,hiveName:e.hiveName}),n=function(e){return new t(r,e)};return this.STATIC_METHODS.forEach((function(e){n[e]=function(){for(var n=arguments.length,o=new Array(n),s=0;s<n;s++)o[s]=arguments[s];return t[e].apply(r,o)}})),n}},{key:"keys",value:function(e){if(void 0!==e){if(!c.default.isObject(e))throw new Error("Options must be an object.");var t=e.cursor,r=e.pageSize,n=e.filterPattern;if(void 0!==t&&("number"!=typeof t||isNaN(t)))throw new Error("Cursor must be a number.");if(void 0!==r&&("number"!=typeof r||isNaN(r)))throw new Error("Page size must be a number.");if(void 0!==n&&("string"!=typeof n||!n))throw new Error("Filter pattern must be a string.")}return this.app.request.get({url:"".concat(this.app.urls.hiveStore(this.hiveName,this.TYPE),"/keys"),query:e})}},{key:"delete",value:function(e){if(!Array.isArray(e))throw new Error("Keys must be provided and must be a list of strings.");return this.app.request.delete({url:this.app.urls.hiveStore(this.hiveName,this.TYPE),data:e})}},{key:"exist",value:function(e){if(!Array.isArray(e))throw new Error("Keys must be provided and must be a list of strings.");return this.app.request.post({url:"".concat(this.app.urls.hiveStore(this.hiveName,this.TYPE),"/action/exist"),data:e})}},{key:"touch",value:function(e){if(!Array.isArray(e))throw new Error("Keys must be provided and must be a list of strings.");return this.app.request.put({url:"".concat(this.app.urls.hiveStore(this.hiveName,this.TYPE),"/action/touch"),data:e})}}]),e}();t.HiveStore=p,(0,u.default)(p,"STATIC_METHODS",["keys","delete","exist","touch"])},5766:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(3025);Object.keys(n).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===n[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return n[e]}}))}));var o=r(6502);Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))}));var s=r(5076);Object.keys(s).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===s[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return s[e]}}))}));var i=r(5817);Object.keys(i).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===i[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return i[e]}}))}));var a=r(9352);Object.keys(a).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===a[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}}))}))},3025:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.KeyValueStore=void 0;var o=n(r(861)),s=n(r(6690)),i=n(r(9728)),a=n(r(1655)),u=n(r(4993)),c=n(r(3808)),l=n(r(8416)),f=r(2257),p=r(9041),d=n(r(9853)),h=r(9095);function y(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function v(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?y(Object(r),!0).forEach((function(t){(0,l.default)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):y(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function m(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,c.default)(e);if(t){var o=(0,c.default)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,u.default)(this,r)}}var b=function(e){(0,a.default)(r,e);var t=m(r);function r(){return(0,s.default)(this,r),t.apply(this,arguments)}return(0,i.default)(r,[{key:"get",value:function(){return this.app.request.get({url:this.getBaseURL()})}},{key:"set",value:function(e,t){return this.constructor.set.apply(v(v({},this),this.constructor),[this.storeKey,e,t])}},{key:"increment",value:function(e){if(isNaN(e)||"number"!=typeof e)throw new Error("Value must be provided and must be a number.");return this.app.request.put({url:"".concat(this.getBaseURL(),"/increment"),query:{value:e}})}},{key:"decrement",value:function(e){if(isNaN(e)||"number"!=typeof e)throw new Error("Value must be provided and must be a number.");return this.app.request.put({url:"".concat(this.getBaseURL(),"/decrement"),query:{value:e}})}}],[{key:"get",value:function(e){if(!Array.isArray(e))throw new Error("Keys must be provided and must be a list of strings.");return this.app.request.post({url:this.app.urls.hiveStore(this.hiveName,this.TYPE),data:e})}},{key:"set",value:function(e,t,r){if(d.default.isObject(e)){if(!Object.keys(e).length)throw new Error("Provided object must have at least 1 key.");return this.app.request.put({url:this.app.urls.hiveStore(this.hiveName,this.TYPE),data:e})}if(!e||"string"!=typeof e)throw new Error("Key must be provided and must be a string.");if(void 0!==r){if(!d.default.isObject(r))throw new Error("Options must be an object.");var n=r.ttl,o=r.expireAt,s=r.condition;if(void 0!==n&&(isNaN(n)||"number"!=typeof n))throw new Error("TTL in seconds must be a number.");if(void 0!==o&&(isNaN(o)||"number"!=typeof o))throw new Error("ExpireAt timestamp must be a number.");if(void 0!==s&&!["IfExists","IfNotExists","Always"].includes(s))throw new Error("Condition must be one of this values: [IfExists, IfNotExists, Always].")}if(!(0,h.isHiveValueValid)(t))throw new Error("Value must be provided and must be one of types: string, number, boolean, object, array.");return this.app.request.put({url:"".concat(this.app.urls.hiveStore(this.hiveName,this.TYPE),"/").concat(e),data:v({value:t},r)})}}]),r}(p.HiveStore);t.KeyValueStore=b,(0,l.default)(b,"TYPE",f.HiveTypes.KEY_VALUE),(0,l.default)(b,"STATIC_METHODS",[].concat((0,o.default)(p.HiveStore.STATIC_METHODS),["get","set"]))},6502:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.ListStore=void 0;var o=n(r(6690)),s=n(r(9728)),i=n(r(1655)),a=n(r(4993)),u=n(r(3808)),c=n(r(8416)),l=r(2257),f=r(9041),p=r(9095);function d(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,u.default)(e);if(t){var o=(0,u.default)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,a.default)(this,r)}}var h=function(e){(0,i.default)(r,e);var t=d(r);function r(){return(0,o.default)(this,r),t.apply(this,arguments)}return(0,s.default)(r,[{key:"get",value:function(e,t){if(void 0!==t){if(isNaN(t)||"number"!=typeof t)throw new Error("Index To must be a number.");if(isNaN(e)||"number"!=typeof e)throw new Error("Index From must be a number.");return this.app.request.get({url:this.getBaseURL(),query:{from:e,to:t}})}if(void 0!==e){if(isNaN(e)||"number"!=typeof e)throw new Error("Index must be a number.");return this.app.request.get({url:"".concat(this.getBaseURL(),"/").concat(e)})}return this.app.request.get({url:this.getBaseURL()})}},{key:"length",value:function(){return this.app.request.get({url:"".concat(this.getBaseURL(),"/length")})}},{key:"insertBefore",value:function(e,t){return this.insert(e,t,!0)}},{key:"insertAfter",value:function(e,t){return this.insert(e,t,!1)}},{key:"insert",value:function(e,t,r){if(!(0,p.isHiveValueValid)(e))throw new Error("ValueToInsert must be provided and must be one of types: string, number, boolean, object, array.");if(!(0,p.isHiveValueValid)(t))throw new Error("AnchorValue must be provided and must be one of types: string, number, boolean, object, array.");return this.app.request.put({url:"".concat(this.getBaseURL(),"/insert-").concat(r?"before":"after"),data:{valueToInsert:e,anchorValue:t}})}},{key:"deleteValue",value:function(e,t){if(!(0,p.isHiveValueValid)(e))throw new Error("Value must be provided and must be one of types: string, number, boolean, object, array.");if(void 0!==t&&(isNaN(t)||"number"!=typeof t))throw new Error("Count must be a number.");return this.app.request.put({url:"".concat(this.getBaseURL(),"/delete-value"),data:{value:e,count:t}})}},{key:"addFirstValue",value:function(e){if(!(0,p.isHiveValueValid)(e))throw new Error("Value must be provided and must be one of types: string, number, boolean, object, array.");return this.app.request.put({url:"".concat(this.getBaseURL(),"/add-first"),data:[e]})}},{key:"addFirstValues",value:function(e){if(!(e&&Array.isArray(e)&&e.length&&(0,p.isHiveValueValid)(e)))throw new Error("Value must be provided and must be a list of valid JSON items.");return this.app.request.put({url:"".concat(this.getBaseURL(),"/add-first"),data:e})}},{key:"addLastValue",value:function(e){if(!(0,p.isHiveValueValid)(e))throw new Error("Value must be provided and must be one of types: string, number, boolean, object, array.");return this.app.request.put({url:"".concat(this.getBaseURL(),"/add-last"),data:[e]})}},{key:"addLastValues",value:function(e){if(!(e&&Array.isArray(e)&&e.length&&(0,p.isHiveValueValid)(e)))throw new Error("Value must be provided and must be a list of valid JSON items.");return this.app.request.put({url:"".concat(this.getBaseURL(),"/add-last"),data:e})}},{key:"deleteFirst",value:function(e){if(void 0!==e&&(isNaN(e)||"number"!=typeof e))throw new Error("Count must be a number.");return this.app.request.put({url:"".concat(this.getBaseURL(),"/get-first-and-delete"),query:{count:e}})}},{key:"deleteLast",value:function(e){if(void 0!==e&&(isNaN(e)||"number"!=typeof e))throw new Error("Count must be a number.");return this.app.request.put({url:"".concat(this.getBaseURL(),"/get-last-and-delete"),query:{count:e}})}}]),r}(f.HiveStore);t.ListStore=h,(0,c.default)(h,"TYPE",l.HiveTypes.LIST)},5076:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.MapStore=void 0;var o=n(r(6690)),s=n(r(9728)),i=n(r(1655)),a=n(r(4993)),u=n(r(3808)),c=n(r(8416)),l=r(2257),f=r(9041),p=n(r(9853)),d=r(9095);function h(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,u.default)(e);if(t){var o=(0,u.default)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,a.default)(this,r)}}var y=function(e){(0,i.default)(r,e);var t=h(r);function r(){return(0,o.default)(this,r),t.apply(this,arguments)}return(0,s.default)(r,[{key:"get",value:function(e){if(void 0!==e&&"string"!=typeof e&&!Array.isArray(e))throw new Error("Key(s) must be a string or list of strings.");return this.app.request.post({url:this.getBaseURL(),data:p.default.castArray(e)})}},{key:"getValue",value:function(e){if(!e||"string"!=typeof e)throw new Error("Key must be provided and must be a string.");return this.app.request.get({url:"".concat(this.getBaseURL(),"/get/").concat(e)})}},{key:"keyExists",value:function(e){if(!e||"string"!=typeof e)throw new Error("Key must be provided and must be a string.");return this.app.request.get({url:"".concat(this.getBaseURL(),"/exists/").concat(e)})}},{key:"length",value:function(){return this.app.request.get({url:"".concat(this.getBaseURL(),"/length")})}},{key:"keys",value:function(){return this.app.request.get({url:"".concat(this.getBaseURL(),"/keys")})}},{key:"values",value:function(){return this.app.request.get({url:"".concat(this.getBaseURL(),"/values")})}},{key:"set",value:function(e,t){if(!e)throw new Error("First argument must be provided and must be a string or an object.");if(p.default.isObject(e)){if(!Object.keys(e).length)throw new Error("Provided object must have at least 1 key.");return this.app.request.put({url:this.getBaseURL(),data:e})}if("string"!=typeof e)throw new Error("Key must be a string.");if(!(0,d.isHiveValueValid)(t))throw new Error("Value must be provided and must be one of types: string, number, boolean, object, array.");return this.app.request.put({url:"".concat(this.getBaseURL(),"/set/").concat(e),data:{value:t}})}},{key:"setWithOverwrite",value:function(e,t,r){if(!e||"string"!=typeof e)throw new Error("Key must be provided and must be a string.");if(!(0,d.isHiveValueValid)(t))throw new Error("Value must be provided and must be one of types: string, number, boolean, object, array.");if(void 0!==r&&"boolean"!=typeof r)throw new Error("Overwrite must be a boolean.");return this.app.request.put({url:"".concat(this.getBaseURL(),"/set-with-overwrite/").concat(e),data:{value:t,overwrite:r}})}},{key:"increment",value:function(e,t){if(!e||"string"!=typeof e)throw new Error("Key must be provided and must be a string.");if(void 0!==t&&(isNaN(t)||"number"!=typeof t))throw new Error("Count must be a number.");return this.app.request.put({url:"".concat(this.getBaseURL(),"/increment/").concat(e),query:{count:t}})}},{key:"decrement",value:function(e,t){if(!e||"string"!=typeof e)throw new Error("Key must be provided and must be a string.");if(void 0!==t&&(isNaN(t)||"number"!=typeof t))throw new Error("Count must be a number.");return this.app.request.put({url:"".concat(this.getBaseURL(),"/decrement/").concat(e),query:{count:t}})}},{key:"deleteKeys",value:function(e){if(!e||"string"!=typeof e&&!Array.isArray(e))throw new Error("Key(s) must be provided and must be a string or list of strings.");return this.app.request.delete({url:"".concat(this.getBaseURL(),"/by-obj-keys"),data:p.default.castArray(e)})}}]),r}(f.HiveStore);t.MapStore=y,(0,c.default)(y,"TYPE",l.HiveTypes.MAP)},5817:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.SetStore=void 0;var o=n(r(861)),s=n(r(6690)),i=n(r(9728)),a=n(r(1655)),u=n(r(4993)),c=n(r(3808)),l=n(r(8416)),f=r(9041),p=r(2257),d=r(9095);function h(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,c.default)(e);if(t){var o=(0,c.default)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,u.default)(this,r)}}var y=function(e){(0,a.default)(r,e);var t=h(r);function r(){return(0,s.default)(this,r),t.apply(this,arguments)}return(0,i.default)(r,[{key:"get",value:function(){return this.app.request.get({url:this.getBaseURL()})}},{key:"getRandom",value:function(e){if(void 0!==e&&(isNaN(e)||"number"!=typeof e))throw new Error("Count must be a number.");return this.app.request.get({url:"".concat(this.getBaseURL(),"/random"),query:{count:e}})}},{key:"getRandomAndDelete",value:function(e){if(void 0!==e&&(isNaN(e)||"number"!=typeof e))throw new Error("Count must be a number.");return this.app.request.put({url:"".concat(this.getBaseURL(),"/random"),query:{count:e}})}},{key:"addValue",value:function(e){if(!(0,d.isHiveValueValid)(e))throw new Error("Value must be provided and must be one of types: string, number, boolean, object, array.");return this.app.request.put({url:"".concat(this.getBaseURL(),"/add"),data:[e]})}},{key:"addValues",value:function(e){if(!(e&&Array.isArray(e)&&e.length&&(0,d.isHiveValueValid)(e)))throw new Error("Value must be provided and must be a list of valid JSON items.");return this.app.request.put({url:"".concat(this.getBaseURL(),"/add"),data:e})}},{key:"deleteValue",value:function(e){if(!(0,d.isHiveValueValid)(e))throw new Error("Value must be provided and must be one of types: string, number, boolean, object, array.");return this.app.request.delete({url:"".concat(this.getBaseURL(),"/values"),data:[e]})}},{key:"deleteValues",value:function(e){if(!(e&&Array.isArray(e)&&e.length&&(0,d.isHiveValueValid)(e)))throw new Error("Value must be provided and must be a list of valid JSON items.");return this.app.request.delete({url:"".concat(this.getBaseURL(),"/values"),data:e})}},{key:"isValueMember",value:function(e){if(!(0,d.isHiveValueValid)(e))throw new Error("Value must be provided and must be one of types: string, number, boolean, object, array.");return this.app.request.post({url:"".concat(this.getBaseURL(),"/contains"),data:[e]})}},{key:"isValuesMembers",value:function(e){if(!(e&&Array.isArray(e)&&e.length&&(0,d.isHiveValueValid)(e)))throw new Error("Value must be provided and must be a list of valid JSON items.");return this.app.request.post({url:"".concat(this.getBaseURL(),"/contains"),data:e})}},{key:"length",value:function(){return this.app.request.get({url:"".concat(this.getBaseURL(),"/length")})}}],[{key:"difference",value:function(e){if(!Array.isArray(e))throw new Error("Store keys must be provided and must be an array.");return this.app.request.post({url:"".concat(this.app.urls.hiveStore(this.hiveName,this.TYPE),"/action/difference"),data:e})}},{key:"intersection",value:function(e){if(!Array.isArray(e))throw new Error("Store keys must be provided and must be an array.");return this.app.request.post({url:"".concat(this.app.urls.hiveStore(this.hiveName,this.TYPE),"/action/intersection"),data:e})}},{key:"union",value:function(e){if(!Array.isArray(e))throw new Error("Store keys must be provided and must be an array.");return this.app.request.post({url:"".concat(this.app.urls.hiveStore(this.hiveName,this.TYPE),"/action/union"),data:e})}}]),r}(f.HiveStore);t.SetStore=y,(0,l.default)(y,"TYPE",p.HiveTypes.SET),(0,l.default)(y,"STATIC_METHODS",[].concat((0,o.default)(f.HiveStore.STATIC_METHODS),["difference","intersection","union"]))},9352:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.SortedSetStore=void 0;var o=n(r(861)),s=n(r(6690)),i=n(r(9728)),a=n(r(1655)),u=n(r(4993)),c=n(r(3808)),l=n(r(8416)),f=r(9041),p=r(2257),d=n(r(9853)),h=r(5817),y=r(9095);function v(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?v(Object(r),!0).forEach((function(t){(0,l.default)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function b(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,c.default)(e);if(t){var o=(0,c.default)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,u.default)(this,r)}}var g=function(e){(0,a.default)(r,e);var t=b(r);function r(){return(0,s.default)(this,r),t.apply(this,arguments)}return(0,i.default)(r,[{key:"add",value:function(e,t){if(!e||!Array.isArray(e))throw new Error("Items must be provided and must be an array.");if(void 0!==t){if(!d.default.isObject(t))throw new Error("Options must be an object.");var r=t.duplicateBehaviour,n=t.scoreUpdateMode,o=t.resultType;if(void 0!==r&&!["OnlyUpdate","AlwaysAdd"].includes(r))throw new Error("Duplicate Behaviour argument must be one of this values: OnlyUpdate, AlwaysAdd.");if(void 0!==n&&!["Greater","Less"].includes(n))throw new Error("Score Update Mode argument must be one of this values: Greater, Less.");if(void 0!==o&&!["NewAdded","TotalChanged"].includes(o))throw new Error("Result Type must be one of this values: NewAdded, TotalChanged.")}return this.app.request.put({url:"".concat(this.getBaseURL(),"/add"),data:m({items:e},t)})}},{key:"incrementScore",value:function(e,t){if(!(0,y.isHiveValueValid)(e))throw new Error("Value must be provided and must be one of types: string, number, boolean, object, array.");if(isNaN(t)||"number"!=typeof t)throw new Error("ScoreValue must be provided and must be a number.");return this.app.request.put({url:"".concat(this.getBaseURL(),"/increment"),data:{scoreValue:t,value:e}})}},{key:"decrementScore",value:function(e,t){if(!(0,y.isHiveValueValid)(e))throw new Error("Value must be provided and must be one of types: string, number, boolean, object, array.");if(isNaN(t)||"number"!=typeof t)throw new Error("ScoreValue must be provided and must be a number.");return this.app.request.put({url:"".concat(this.getBaseURL(),"/decrement"),data:{scoreValue:t,value:e}})}},{key:"getAndDeleteMaxScore",value:function(e){if(void 0!==e&&(isNaN(e)||"number"!=typeof e))throw new Error("Count must be a number.");return this.app.request.put({url:"".concat(this.getBaseURL(),"/get-with-max-score-and-delete"),query:{count:e}})}},{key:"getAndDeleteMinScore",value:function(e){if(void 0!==e&&(isNaN(e)||"number"!=typeof e))throw new Error("Count must be a number.");return this.app.request.put({url:"".concat(this.getBaseURL(),"/get-with-min-score-and-delete"),query:{count:e}})}},{key:"getRandom",value:function(e){if(void 0!==e){if(!d.default.isObject(e))throw new Error("Options must be an object.");var t=e.count,r=e.withScores;if(void 0!==t&&(isNaN(t)||"number"!=typeof t))throw new Error("Count must be a number.");if(void 0!==r&&"boolean"!=typeof r)throw new Error("With Scores argument must be a boolean.")}return this.app.request.get({url:"".concat(this.getBaseURL(),"/get-random"),query:m({},e)})}},{key:"getScore",value:function(e){if(!(0,y.isHiveValueValid)(e))throw new Error("Value must be provided and must be one of types: string, number, boolean, object, array.");return this.app.request.post({url:"".concat(this.getBaseURL(),"/get-score"),data:{value:e}})}},{key:"getRank",value:function(e,t){if(!(0,y.isHiveValueValid)(e))throw new Error("Value must be provided and must be one of types: string, number, boolean, object, array.");if(void 0!==t&&"boolean"!=typeof t)throw new Error("Reverse argument must be a boolean.");return this.app.request.post({url:"".concat(this.getBaseURL(),"/get-rank"),data:{value:e,reverse:t}})}},{key:"getRangeByRank",value:function(e,t,r){if(isNaN(e)||"number"!=typeof e)throw new Error("Start Rank must be provided and must be a number.");if(isNaN(t)||"number"!=typeof t)throw new Error("Stop Rank must be provided and must be a number.");if(void 0!==r){if(!d.default.isObject(r))throw new Error("Options must be an object.");var n=r.withScores,o=r.reverse;if(void 0!==n&&"boolean"!=typeof n)throw new Error("With Scores argument must be a boolean.");if(void 0!==o&&"boolean"!=typeof o)throw new Error("Reverse argument must be a boolean.")}return this.app.request.get({url:"".concat(this.getBaseURL(),"/get-range-by-rank"),query:m({startRank:e,stopRank:t},r)})}},{key:"getRangeByScore",value:function(e){if(void 0!==e){if(!d.default.isObject(e))throw new Error("Options must be an object.");var t=e.minScore,r=e.maxScore,n=e.minBound,o=e.maxBound,s=e.offset,i=e.pageSize,a=e.withScores,u=e.reverse;if(void 0!==t&&(isNaN(t)||"number"!=typeof t))throw new Error("Minimal Score must be a number.");if(void 0!==r&&(isNaN(r)||"number"!=typeof r))throw new Error("Maximal Score must be a number.");if(void 0!==n&&!["Include","Exclude","Infinity"].includes(n))throw new Error("Minimal bound must be one of this values: Include, Exclude, Infinity.");if(void 0!==o&&!["Include","Exclude","Infinity"].includes(o))throw new Error("Maximal bound must be one of this values: Include, Exclude, Infinity.");if(void 0!==s&&("number"!=typeof s||isNaN(s)))throw new Error("Offset must be a number.");if(void 0!==i&&("number"!=typeof i||isNaN(i)))throw new Error("Page Size must be a number.");if(void 0!==a&&"boolean"!=typeof a)throw new Error("With Scores argument must be a boolean.");if(void 0!==u&&"boolean"!=typeof u)throw new Error("Reverse argument must be a boolean.")}return this.app.request.get({url:"".concat(this.getBaseURL(),"/get-range-by-score"),query:m({},e)})}},{key:"deleteValue",value:function(e){if(!(0,y.isHiveValueValid)(e))throw new Error("Value must be provided and must be one of types: string, number, boolean, object, array.");return this.app.request.delete({url:"".concat(this.getBaseURL(),"/values"),data:[e]})}},{key:"deleteValues",value:function(e){if(!(e&&Array.isArray(e)&&e.length&&(0,y.isHiveValueValid)(e)))throw new Error("Value must be provided and must be a list of JSON items.");return this.app.request.delete({url:"".concat(this.getBaseURL(),"/values"),data:e})}},{key:"deleteValuesByRank",value:function(e,t){if(isNaN(e)||"number"!=typeof e)throw new Error("Start Rank must be provided and must be a number.");if(isNaN(t)||"number"!=typeof t)throw new Error("Stop Rank must be provided and must be a number.");return this.app.request.delete({url:"".concat(this.getBaseURL(),"/delete-by-rank"),query:{startRank:e,stopRank:t}})}},{key:"deleteValuesByScore",value:function(e){if(void 0!==e){if(!d.default.isObject(e))throw new Error("Options must be an object.");var t=e.minScore,r=e.maxScore,n=e.minBound,o=e.maxBound;if(void 0!==t&&(isNaN(t)||"number"!=typeof t))throw new Error("Minimal Score must be a number.");if(void 0!==r&&(isNaN(r)||"number"!=typeof r))throw new Error("Maximal Score must be a number.");if(void 0!==n&&!["Include","Exclude","Infinity"].includes(n))throw new Error("Minimal bound must be one of this values: Include, Exclude, Infinity.");if(void 0!==o&&!["Include","Exclude","Infinity"].includes(o))throw new Error("Maximal bound must be one of this values: Include, Exclude, Infinity.")}return this.app.request.delete({url:"".concat(this.getBaseURL(),"/delete-by-score"),query:m({},e)})}},{key:"length",value:function(){return this.app.request.get({url:"".concat(this.getBaseURL(),"/length")})}},{key:"countBetweenScores",value:function(e){if(void 0!==e){if(!d.default.isObject(e))throw new Error("Options must be an object.");var t=e.minScore,r=e.maxScore,n=e.minBound,o=e.maxBound;if(void 0!==t&&(isNaN(t)||"number"!=typeof t))throw new Error("Minimal Score must be a number.");if(void 0!==r&&(isNaN(r)||"number"!=typeof r))throw new Error("Maximal Score must be a number.");if(void 0!==n&&!["Include","Exclude","Infinity"].includes(n))throw new Error("Minimal bound must be one of this values: Include, Exclude, Infinity.");if(void 0!==o&&!["Include","Exclude","Infinity"].includes(o))throw new Error("Maximal bound must be one of this values: Include, Exclude, Infinity.")}return this.app.request.get({url:"".concat(this.getBaseURL(),"/count"),query:m({},e)})}}],[{key:"intersection",value:function(e){if(!Array.isArray(e))throw new Error("Store keys must be provided and must be an array.");return this.app.request.post({url:"".concat(this.app.urls.hiveStore(this.hiveName,this.TYPE),"/action/intersection"),data:e})}},{key:"union",value:function(e){if(!Array.isArray(e))throw new Error("Store keys must be provided and must be an array.");return this.app.request.post({url:"".concat(this.app.urls.hiveStore(this.hiveName,this.TYPE),"/action/union"),data:e})}}]),r}(f.HiveStore);t.SortedSetStore=g,(0,l.default)(g,"TYPE",p.HiveTypes.SORTED_SET),(0,l.default)(g,"STATIC_METHODS",[].concat((0,o.default)(f.HiveStore.STATIC_METHODS),["difference","intersection","union"])),(0,l.default)(g,"difference",h.SetStore.difference)},9095:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isHiveValueValid=function(e){if(null==e)return!1;try{return!!JSON.stringify(e)}catch(e){return!1}}},5579:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(434)),s=n(r(8416)),i=n(r(6690)),a=n(r(9728)),u=n(r(8698)),c=n(r(3930)),l=n(r(294)),f=n(r(435)),p=n(r(9853)),d=n(r(7738));function h(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var y={appId:null,apiKey:null,serverURL:"https://api.backendless.com",domain:null,apiURI:"/api",debugMode:!1,standalone:!1,XMLHttpRequest:"undefined"!=typeof XMLHttpRequest?XMLHttpRequest:void 0},v=["appId","apiKey","domain"],m="object"===("undefined"==typeof self?"undefined":(0,u.default)(self))&&self.self===self&&self||"object"===(void 0===r.g?"undefined":(0,u.default)(r.g))&&r.g.global===r.g&&r.g,b=m&&m.Backendless,g=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=t[0],o=t[1];return n&&"object"===(0,u.default)(n)?n:"string"!=typeof n||o?{appId:n,apiKey:o}:{domain:n}},w=function(e){if(e.domain&&!e.domain.startsWith("https://")&&!e.domain.startsWith("http://"))throw new Error("When initialize the SDK with a custom domain it should start with http:// or https://, for example: Backendless.initApp('https://foobar.com')")},k={Logging:function(){return r(7776).Z},Counters:function(){return r(1062).Z},Cache:function(){return r(8469).Z},Commerce:function(){return r(5165).Z},Users:function(){return r(9681).Z},BL:function(){return r(6912).Z},Data:function(){return r(7607).Z},Hive:function(){return r(8512).ZP},Messaging:function(){return r(898).Z},Files:function(){return r(3011).Z},RT:function(){return r(9181).default},SharedObject:function(){return r(7578).Z},LocalCache:function(){return r(5703).Z},UnitOfWork:function(){return r(7890).Z},Management:function(){return r(9415).Z}},E=new(function(){function e(t){(0,i.default)(this,e),this.initConfig(t),this.Request=c.default,this.request=new l.default(this),this.urls=new f.default(this)}return(0,a.default)(e,[{key:"initConfig",value:function(e){for(var t in(e=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?h(Object(r),!0).forEach((function(t){(0,s.default)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):h(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e)).domain&&(delete e.appId,delete e.apiKey),y)if(y.hasOwnProperty(t)){var r="__".concat(t);v.includes(t)&&delete this[r];var n=void 0===this[r]?y[t]:this[r];this[r]=void 0===e[t]?n:e[t]}}},{key:"initApp",value:function(){var t=g.apply(void 0,arguments);w(t);var r=t.standalone?new e(this):this;r.initConfig(t),r.resetRT(),r.__removeService("LocalCache");var n=(0,o.default)({loadLevels:!0,globalLevel:"all",levels:{}},t.logging);return r.__hasService("Logging")&&(r.Logging.reset(),r.Logging.setConfig(n)),r.__hasService("Users")&&(r.Users.currentUser=null),delete this.__device,r.loggingConfig=n,r}},{key:"__hasService",value:function(e){return!!this["__".concat(e)]}},{key:"__removeService",value:function(e){delete this["__".concat(e)]}},{key:"__getService",value:function(e){var t="__".concat(e);if(!this[t]){var r=k[e]();this[t]=new r(this)}return this[t]}},{key:"standalone",get:function(){return this.__standalone},set:function(e){throw new Error("Setting value to Backendless.standalone directly is not possible, "+"instead you must use Backendless.initApp({ appId: [APP_ID], apiKey: [API_KEY], standalone: ".concat(e," })"))}},{key:"appId",get:function(){return this.__appId},set:function(e){throw new Error("Setting '".concat(e,"' value to Backendless.appId directly is not possible, ")+"instead you must use Backendless.initApp('".concat(e,"', API_KEY)"))}},{key:"apiKey",get:function(){return this.__apiKey},set:function(e){throw new Error("Setting '".concat(e,"' value to Backendless.apiKey directly is not possible, ")+"instead you must use Backendless.initApp(APP_ID, '".concat(e,"')"))}},{key:"serverURL",get:function(){return this.__serverURL},set:function(e){this.__serverURL=e}},{key:"domain",get:function(){return this.__domain},set:function(e){this.__domain=e}},{key:"apiURI",get:function(){return this.__apiURI},set:function(e){this.__apiURI=e}},{key:"appPath",get:function(){return this.domain?this.domain+this.apiURI:[this.serverURL,this.appId,this.apiKey].join("/")},set:function(e){throw new Error("Setting '".concat(e,"' value to Backendless.appPath directly is not possible, ")+"instead you must use Backendless.initApp(APP_ID, API_KEY) for setup the value")}},{key:"debugMode",get:function(){return this.__debugMode},set:function(e){e=!!e,this.__debugMode!==e&&(this.__debugMode=e,this.__RT&&this.RT.setDebugMode(e))}},{key:"XMLHttpRequest",get:function(){return this.__XMLHttpRequest},set:function(e){this.__XMLHttpRequest=e}},{key:"device",get:function(){if(!this.__device)throw new Error("Device is not defined. Please, run the Backendless.setupDevice");return this.__device},set:function(e){throw new Error("Setting value to Backendless.device directly is not possible, instead you must use Backendless.setupDevice(deviceProperties) for setup the device")}},{key:"setupDevice",value:function(e){var t=r(1318).Z;this.__device=new t(e)}},{key:"Utils",get:function(){return p.default}},{key:"getCurrentUserToken",value:function(){return this.Users.getCurrentUserToken()}},{key:"setCurrentUserToken",value:function(e){this.Users.setCurrentUserToken(e)}},{key:"browser",get:function(){return r(9935).i()}},{key:"noConflict",value:function(){return m&&(m.Backendless=b),this}},{key:"Logging",get:function(){return this.__getService("Logging")}},{key:"Counters",get:function(){return this.__getService("Counters")}},{key:"Cache",get:function(){return this.__getService("Cache")}},{key:"Commerce",get:function(){return this.__getService("Commerce")}},{key:"Users",get:function(){return this.__getService("Users")}},{key:"User",get:function(){return r(5602).default}},{key:"UserService",get:function(){return this.Users}},{key:"BL",get:function(){return this.__getService("BL")}},{key:"CustomServices",get:function(){return this.BL.CustomServices}},{key:"APIServices",get:function(){return this.BL.CustomServices}},{key:"Events",get:function(){return this.BL.Events}},{key:"Data",get:function(){return this.__getService("Data")}},{key:"Hive",get:function(){return this.__getService("Hive")}},{key:"Messaging",get:function(){return this.__getService("Messaging")}},{key:"Files",get:function(){return this.__getService("Files")}},{key:"RT",get:function(){return this.__getService("RT")}},{key:"resetRT",value:function(){this.__RT&&(this.__RT.terminate(),delete this.__RT)}},{key:"SharedObject",get:function(){return this.__getService("SharedObject")}},{key:"LocalCache",get:function(){return this.__getService("LocalCache")}},{key:"UnitOfWork",get:function(){return this.__getService("UnitOfWork")}},{key:"Management",get:function(){return this.__getService("Management")}},{key:"applicationId",get:function(){return this.appId},set:function(e){console.warn("getter/setter for Backendless.applicationId is deprecated, instead use Backendless.appId"),this.appId=e}},{key:"secretKey",get:function(){return console.warn("getter/setter for Backendless.secretKey is deprecated, instead use Backendless.apiKey"),this.apiKey},set:function(e){console.warn("getter/setter for Backendless.secretKey is deprecated, instead use Backendless.apiKey"),this.apiKey=e}},{key:"Persistence",get:function(){return function e(){e.isShown||(console.warn("Backendless.Persistence is deprecated namespace, use Backendless.Data instead"),e.isShown=!0)}(),this.Data}},{key:"DataQueryBuilder",get:function(){return this.Data.QueryBuilder}},{key:"GroupQueryBuilder",get:function(){return this.Data.GroupQueryBuilder}},{key:"JSONUpdateBuilder",get:function(){return this.Data.JSONUpdateBuilder}},{key:"LoadRelationsQueryBuilder",get:function(){return this.Data.LoadRelationsQueryBuilder}},{key:"Bodyparts",get:function(){return this.Messaging.Bodyparts}},{key:"PublishOptions",get:function(){return this.Messaging.PublishOptions}},{key:"DeliveryOptions",get:function(){return this.Messaging.DeliveryOptions}},{key:"PublishOptionsHeaders",get:function(){return this.Messaging.PublishOptionsHeaders}},{key:"EmailEnvelope",get:function(){return this.Messaging.EmailEnvelope}},{key:"Expression",get:function(){return d.default}}]),e}())(y);m&&(m.Backendless=E);var O=E;(t=e.exports=E).default=O},5703:(e,t,r)=>{"use strict";var n=r(4836);t.Z=void 0;var o=n(r(6690)),s=n(r(9728)),i=n(r(9853)),a=n(r(1376)),u=n(r(4770)),c=function(){function e(t){(0,o.default)(this,e),this.app=t,this.storageName=this.app.appId?"".concat("Backendless","_").concat(this.app.appId):"Backendless";var r=i.default.isLocalStorageSupported?u.default:a.default;this.setStorage(r),this.Keys={USER_TOKEN:"user-token",CURRENT_USER_ID:"current-user-id",STAY_LOGGED_IN:"stayLoggedIn"}}return(0,s.default)(e,[{key:"setStorage",value:function(e){this.storage=new e(this.storageName,"Backendless")}},{key:"set",value:function(e,t){this.storage.set(e,t)}},{key:"get",value:function(e){return this.storage.get(e)}},{key:"remove",value:function(e){this.storage.remove(e)}}]),e}();t.Z=c},4770:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(6690)),s=n(r(9728));var i=function(){function e(t,r){(0,o.default)(this,e),this.storageName=t,function(e,t){if(!localStorage.getItem(e.storageName)){var r=localStorage.getItem(t);r&&(localStorage.setItem(e.storageName,r),localStorage.removeItem(t))}}(this,r)}return(0,s.default)(e,[{key:"getStore",value:function(){try{return JSON.parse(localStorage.getItem(this.storageName))||{}}catch(e){console.warn("Could not parse data from LocalStorage",e)}return{}}},{key:"setStore",value:function(e){localStorage.setItem(this.storageName,JSON.stringify(e))}},{key:"get",value:function(e){return this.getStore()[e]}},{key:"set",value:function(e,t){var r=this.getStore();r[e]=t,this.setStore(r)}},{key:"remove",value:function(e){var t=this.getStore();delete t[e],this.setStore(t)}}]),e}();t.default=i},1376:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(6690)),s=n(r(9728)),i=function(){function e(){(0,o.default)(this,e),this.data={}}return(0,s.default)(e,[{key:"get",value:function(e){return this.data[e]}},{key:"set",value:function(e,t){this.data[e]=t}},{key:"remove",value:function(e){delete this.data[e]}}]),e}();t.default=i},7776:(e,t,r)=>{"use strict";var n=r(4836);t.Z=void 0;var o=n(r(4687)),s=n(r(861)),i=n(r(7156)),a=n(r(6690)),u=n(r(9728)),c=n(r(3842)),l=function(){function e(t){(0,a.default)(this,e),this.app=t,this.reset(),t.loggingConfig&&this.setConfig(t.loggingConfig)}var t;return(0,u.default)(e,[{key:"setConfig",value:function(e){e.levels&&(this.levels=e.levels),e.globalLevel&&(this.globalLevel=e.globalLevel),e.loadLevels&&this.loadLoggingLevels()}},{key:"reset",value:function(){this.levels={},this.globalLevel="all",this.loggers={},this.messages=[],this.numOfMessages=10,this.timeFrequency=1,this.messagesLimit=1e3}},{key:"loadLoggingLevels",value:function(){var e=this;this.app.request.get({url:this.app.urls.loggingLevels()}).then((function(t){var r={};t.forEach((function(e){r[e.name]=e.level}));var n=r["Global logger"];e.setConfig({loggers:r,globalLevel:n})})).catch((function(e){console.error("Could not load logging levels: ",e)}))}},{key:"getLogger",value:function(e){if(!e||"string"!=typeof e)throw new Error("Logger Name must be provided and must be a string.");return this.loggers[e]||(this.loggers[e]=new c.default(e,this)),this.loggers[e]}},{key:"flush",value:(t=(0,i.default)(o.default.mark((function e(){var t,r=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return!this.flushRequest&&this.messages.length&&(this.stopFlushInterval(),t=(0,s.default)(this.messages),this.messages=[],this.flushRequest=this.app.request.put({url:this.app.urls.logging(),data:t}).catch((function(e){throw r.messages=[].concat((0,s.default)(t),(0,s.default)(r.messages)),r.checkMessagesLimit(),e})).finally((function(){return delete r.flushRequest}))),e.abrupt("return",this.flushRequest);case 2:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"push",value:function(e,t,r,n){if("string"!=typeof r)throw new Error('"message" must be a string');this.messages.push({logger:e,message:r,exception:n,"log-level":t,timestamp:Date.now()}),this.checkMessagesLen()}},{key:"checkMessagesLen",value:function(){var e=this;this.checkMessagesLenTimer&&clearTimeout(this.checkMessagesLenTimer),this.checkMessagesLenTimer=setTimeout((function(){e.messages.length>=e.numOfMessages?e.flush():e.startFlushInterval()}),0)}},{key:"checkMessagesLimit",value:function(){this.messages.length>this.messagesLimit&&(this.messages=this.messages.slice(this.messages.length-this.messagesLimit))}},{key:"startFlushInterval",value:function(){var e=this;this.flushInterval||(this.flushInterval=setTimeout((function(){return e.flush()}),1e3*this.timeFrequency))}},{key:"stopFlushInterval",value:function(){this.flushInterval&&(clearTimeout(this.flushInterval),delete this.flushInterval)}},{key:"setLogReportingPolicy",value:function(e,t){void 0!==t&&this.timeFrequency!==t&&this.stopFlushInterval(),e>this.messagesLimit&&(this.messagesLimit=e),this.numOfMessages=e,this.timeFrequency=t,this.checkMessagesLen()}},{key:"setMessagesLimit",value:function(e){this.messagesLimit=e,this.checkMessagesLimit()}}]),e}();t.Z=l},3842:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(6690)),s=n(r(9728)),i={off:0,fatal:1,error:2,warn:3,info:4,debug:5,trace:6,all:6},a=function(){function e(t,r){(0,o.default)(this,e),this.name=t,this.logging=r}return(0,s.default)(e,[{key:"debug",value:function(e){return this.log("DEBUG",e)}},{key:"info",value:function(e){return this.log("INFO",e)}},{key:"warn",value:function(e,t){return this.log("WARN",e,t)}},{key:"error",value:function(e,t){return this.log("ERROR",e,t)}},{key:"fatal",value:function(e,t){return this.log("FATAL",e,t)}},{key:"trace",value:function(e){return this.log("TRACE",e)}},{key:"log",value:function(e,t,r){if(this.min(e))return this.logging.push(this.name,e,t,r)}},{key:"min",value:function(e){e=e.toLowerCase();var t=this.logging.globalLevel,r=this.logging.levels[this.name];return!(t&&i[t.toLowerCase()]<i[e])&&(!r||i[r.toLowerCase()]>=i[e])}}]),e}();t.default=a},6496:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(6690)),s=n(r(9728)),i=function(){function e(t){(0,o.default)(this,e),this.app=t}return(0,s.default)(e,[{key:"createTable",value:function(e,t){if(!e||"string"!=typeof e)throw new Error("Table name must be provided and must be a string.");if(!Array.isArray(t))throw new Error("Columns must be a list.");return this.app.request.post({url:this.app.urls.managementDataTable(),data:{name:e,columns:t}})}}]),e}();t.default=i},9415:(e,t,r)=>{"use strict";var n=r(4836);t.Z=void 0;var o=n(r(9728)),s=n(r(6690)),i=n(r(6496)),a=(0,o.default)((function e(t){(0,s.default)(this,e),this.app=t,this.Data=new i.default(t)}));t.Z=a},1127:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o,s,i=n(r(6690)),a=n(r(9728)),u=n(r(1588)),c=n(r(1655)),l=n(r(4993)),f=n(r(3808)),p=n(r(6877)),d=r(9181);function h(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,f.default)(e);if(t){var o=(0,f.default)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,l.default)(this,r)}}var y="MESSAGE",v=(o=d.RTScopeConnector.connectionRequired(),s=function(e){(0,c.default)(r,e);var t=h(r);function r(e,n){var o;return(0,i.default)(this,r),(o=t.call(this,e)).app=n,o.connect(),o}return(0,a.default)(r,[{key:"connectSubscriber",get:function(){return this.app.RT.subscriptions.connectToPubSub}},{key:"usersSubscriber",get:function(){return this.app.RT.subscriptions.onPubSubUserStatus}},{key:"commandSubscriber",get:function(){return this.app.RT.subscriptions.onPubSubCommand}},{key:"commandSender",get:function(){return this.app.RT.methods.sendPubSubCommand}},{key:"getScopeOptions",value:function(){return{channel:this.options.name}}},{key:"connect",value:function(){if(this.app)return(0,u.default)((0,f.default)(r.prototype),"connect",this).call(this)}},{key:"publish",value:function(e,t,r){return this.app.Messaging.publish(this.options.name,e,t,r)}},{key:"addMessageListener",value:function(e,t,r){"function"==typeof e&&(r=t,t=e,e=void 0),this.addSubscription(y,this.app.RT.subscriptions.onPubSubMessage,{callback:t,onError:r,params:{selector:e}})}},{key:"removeMessageListener",value:function(e,t){if("function"==typeof e&&(t=e,e=void 0),e&&"string"!=typeof e)throw new Error("Selector must be a string.");if("function"!=typeof t)throw new Error("Callback must be a function.");this.stopSubscription(y,{matcher:function(r){return e?r.params.selector===e&&r.callback===t:r.callback===t}})}},{key:"removeMessageListeners",value:function(e){if("string"!=typeof e)throw new Error("Selector must be a string.");this.stopSubscription(y,{matcher:function(t){return t.params.selector===e}})}},{key:"removeAllMessageListeners",value:function(){this.stopSubscription(y,{})}},{key:"addCommandListener",value:function(e,t){return(0,u.default)((0,f.default)(r.prototype),"addCommandListener",this).call(this,e,t),this}},{key:"addUserStatusListener",value:function(e,t){return(0,u.default)((0,f.default)(r.prototype),"addUserStatusListener",this).call(this,e,t),this}},{key:"removeCommandListener",value:function(e){return(0,u.default)((0,f.default)(r.prototype),"removeCommandListeners",this).call(this,e),this}},{key:"removeCommandListeners",value:function(e){return(0,u.default)((0,f.default)(r.prototype),"removeCommandListeners",this).call(this,e),this}},{key:"removeUserStatusListeners",value:function(e){return(0,u.default)((0,f.default)(r.prototype),"removeUserStatusListeners",this).call(this,e),this}},{key:"addConnectListener",value:function(e,t){return(0,u.default)((0,f.default)(r.prototype),"addConnectListener",this).call(this,e,t),this}},{key:"removeConnectListeners",value:function(e,t){return(0,u.default)((0,f.default)(r.prototype),"removeConnectListeners",this).call(this,e,t),this}},{key:"removeAllListeners",value:function(){return(0,u.default)((0,f.default)(r.prototype),"removeAllListeners",this).call(this),this}},{key:"send",value:function(e,t){return(0,u.default)((0,f.default)(r.prototype),"send",this).call(this,e,t)}},{key:"join",value:function(){(0,u.default)((0,f.default)(r.prototype),"connect",this).call(this)}},{key:"leave",value:function(){(0,u.default)((0,f.default)(r.prototype),"disconnect",this).call(this)}},{key:"isJoined",value:function(){return(0,u.default)((0,f.default)(r.prototype),"isConnected",this).call(this)}}]),r}(d.RTScopeConnector),(0,p.default)(s.prototype,"addMessageListener",[o],Object.getOwnPropertyDescriptor(s.prototype,"addMessageListener"),s.prototype),s);t.default=v},3695:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(9728)),s=n(r(6690)),i=(0,o.default)((function e(t){(0,s.default)(this,e),t=t||{},this.textmessage=t&&t.textmessage,this.htmlmessage=t&&t.htmlmessage}));t.default=i},7314:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(9728)),s=n(r(6690)),i=(0,o.default)((function e(t){(0,s.default)(this,e),t=t||{},this.publishPolicy=t.publishPolicy||void 0,this.pushBroadcast=t.pushBroadcast||void 0,this.pushSinglecast=t.pushSinglecast||void 0,this.publishAt=t.publishAt||void 0,this.repeatEvery=t.repeatEvery||void 0,this.repeatExpiresAt=t.repeatExpiresAt||void 0}));t.default=i},4595:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(6690)),s=n(r(9728)),i=n(r(9853)),a=function(){function e(t){(0,o.default)(this,e),t=t||{},this.addresses=i.default.castArray(t.addresses),this.ccAddresses=i.default.castArray(t.ccAddresses),this.bccAddresses=i.default.castArray(t.bccAddresses),this.query=t.query||null,this.uniqueEmails=t.uniqueEmails||!1}return(0,s.default)(e,[{key:"setTo",value:function(e){return this.addresses=i.default.castArray(e),this}},{key:"addTo",value:function(e){return this.addresses=this.addresses.concat(i.default.castArray(e)),this}},{key:"getTo",value:function(){return this.addresses}},{key:"setCc",value:function(e){return this.ccAddresses=i.default.castArray(e),this}},{key:"addCc",value:function(e){return this.ccAddresses=this.ccAddresses.concat(i.default.castArray(e)),this}},{key:"getCc",value:function(){return this.ccAddresses}},{key:"setBcc",value:function(e){return this.bccAddresses=i.default.castArray(e),this}},{key:"addBcc",value:function(e){return this.bccAddresses=this.bccAddresses.concat(i.default.castArray(e)),this}},{key:"getBcc",value:function(){return this.bccAddresses}},{key:"setQuery",value:function(e){return this.query=e,this}},{key:"getQuery",value:function(){return this.query}},{key:"setUniqueEmails",value:function(e){return this.uniqueEmails=e,this}},{key:"getUniqueEmails",value:function(){return this.uniqueEmails}},{key:"toJSON",value:function(){var e={};return this.addresses.length>0&&(e.addresses=this.addresses),this.ccAddresses.length>0&&(e["cc-addresses"]=this.ccAddresses),this.bccAddresses.length>0&&(e["bcc-addresses"]=this.bccAddresses),this.query&&(e.criteria=this.query),e.uniqueEmails=this.uniqueEmails,e}}],[{key:"create",value:function(t){return new e(t)}}]),e}();t.default=a},5500:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Bodyparts",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"DeliveryOptions",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"EmailEnvelope",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"PublishOptions",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"PublishOptionsHeaders",{enumerable:!0,get:function(){return o.default}});var o=n(r(2545)),s=n(r(2467)),i=n(r(7314)),a=n(r(3695)),u=n(r(4595))},2545:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r={MESSAGE_TAG:"message",IOS_ALERT_TAG:"ios-alert",IOS_BADGE_TAG:"ios-badge",IOS_SOUND_TAG:"ios-sound",ANDROID_TICKER_TEXT_TAG:"android-ticker-text",ANDROID_CONTENT_TITLE_TAG:"android-content-title",ANDROID_CONTENT_TEXT_TAG:"android-content-text",ANDROID_ACTION_TAG:"android-action",WP_TYPE_TAG:"wp-type",WP_TITLE_TAG:"wp-title",WP_TOAST_SUBTITLE_TAG:"wp-subtitle",WP_TOAST_PARAMETER_TAG:"wp-parameter",WP_TILE_BACKGROUND_IMAGE:"wp-backgroundImage",WP_TILE_COUNT:"wp-count",WP_TILE_BACK_TITLE:"wp-backTitle",WP_TILE_BACK_BACKGROUND_IMAGE:"wp-backImage",WP_TILE_BACK_CONTENT:"wp-backContent",WP_RAW_DATA:"wp-raw"};t.default=r},2467:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(9728)),s=n(r(6690)),i=(0,o.default)((function e(t){(0,s.default)(this,e),t=t||{},this.publisherId=t.publisherId||void 0,this.headers=t.headers||void 0,this.subtopic=t.subtopic||void 0}));t.default=i},898:(e,t,r)=>{"use strict";var n=r(4836);t.Z=void 0;var o=n(r(4687)),s=n(r(434)),i=n(r(8698)),a=n(r(7156)),u=n(r(6690)),c=n(r(9728)),l=n(r(1127)),f=r(5500),p=function(){function e(t){(0,u.default)(this,e),this.app=t,this.Bodyparts=f.Bodyparts,this.PublishOptions=f.PublishOptions,this.DeliveryOptions=f.DeliveryOptions,this.PublishOptionsHeaders=f.PublishOptionsHeaders,this.EmailEnvelope=f.EmailEnvelope}var t,r,n,p,h,y,v,m,b,g;return(0,c.default)(e,[{key:"subscribe",value:function(e){return d(e),new l.default({name:e},this.app)}},{key:"publish",value:(g=(0,a.default)(o.default.mark((function e(t,r,n,a){var u;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(d(t),u={message:r},!n){e.next=6;break}if(!Array.isArray(n)&&"object"===(0,i.default)(n)){e.next=5;break}throw new Error('"publishOptions" argument must be an object.');case 5:(0,s.default)(u,n);case 6:if(!a){e.next=10;break}if(!Array.isArray(a)&&"object"===(0,i.default)(a)){e.next=9;break}throw new Error('"deliveryOptions" argument must be an object.');case 9:(0,s.default)(u,a);case 10:return e.abrupt("return",this.app.request.post({url:this.app.urls.messagingChannel(t),data:u}));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n){return g.apply(this,arguments)})},{key:"pushWithTemplate",value:(b=(0,a.default)(o.default.mark((function e(t,r){var n;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Push Template Name must be provided and must be a string.");case 2:return n={},r&&(n.templateValues=r),e.abrupt("return",this.app.request.post({url:this.app.urls.messagingPushWithTemplate(t),data:n}));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return b.apply(this,arguments)})},{key:"sendEmail",value:(m=(0,a.default)(o.default.mark((function e(t,r,n,s){var a;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Email Subject must be provided and must be a string.");case 2:if(r&&!Array.isArray(r)&&"object"===(0,i.default)(r)){e.next=4;break}throw new Error("BodyParts must be an object");case 4:if(r.textmessage||r.htmlmessage){e.next=6;break}throw new Error("BodyParts must contain at least one property of [ textmessage | htmlmessage ]");case 6:if(Array.isArray(n)&&n.length){e.next=8;break}throw new Error("Recipients must be a non empty array.");case 8:return a={subject:t,bodyparts:r,to:n},Array.isArray(s)&&s.length&&(a.attachment=s),e.abrupt("return",this.app.request.post({url:this.app.urls.messagingEmail(),data:a}));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n){return m.apply(this,arguments)})},{key:"sendEmailFromTemplate",value:(v=(0,a.default)(o.default.mark((function e(t,r,n,s){var i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Email Template Name must be provided and must be a string.");case 2:if(r instanceof f.EmailEnvelope){e.next=4;break}throw new Error("EmailEnvelope is required and should be instance of Backendless.Messaging.EmailEnvelope");case 4:return(i=r.toJSON())["template-name"]=t,n&&!Array.isArray(n)&&(i["template-values"]=n),Array.isArray(n)&&!s&&(s=n),s&&(i.attachment=s),e.abrupt("return",this.app.request.post({url:this.app.urls.emailTemplateSend(),data:i}));case 10:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n){return v.apply(this,arguments)})},{key:"cancel",value:(y=(0,a.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Message ID must be provided and must be a string.");case 2:return e.abrupt("return",this.app.request.delete({url:this.app.urls.messagingMessage(t)}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return y.apply(this,arguments)})},{key:"registerDevice",value:(h=(0,a.default)(o.default.mark((function e(t,r,n){var s,i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=this.app.device,i={deviceToken:t,deviceId:s.uuid,os:s.platform,osVersion:s.version},Array.isArray(r)&&(i.channels=r),"number"==typeof n?i.expiration=n:n instanceof Date&&(i.expiration=n.getTime()/1e3),e.abrupt("return",this.app.request.post({url:this.app.urls.messagingRegistrations(),data:i}));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return h.apply(this,arguments)})},{key:"getRegistrations",value:(p=(0,a.default)(o.default.mark((function e(){var t;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.app.device,e.abrupt("return",this.app.request.get({url:this.app.urls.messagingRegistrationDevice(t.uuid)}));case 2:case"end":return e.stop()}}),e,this)}))),function(){return p.apply(this,arguments)})},{key:"unregisterDevice",value:(n=(0,a.default)(o.default.mark((function e(){var t;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.app.device,e.abrupt("return",this.app.request.delete({url:this.app.urls.messagingRegistrationDevice(t.uuid)}));case 2:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"getMessageStatus",value:(r=(0,a.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Message ID must be provided and must be a string.");case 2:return e.abrupt("return",this.app.request.get({url:this.app.urls.messagingMessage(t)}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"getPushTemplates",value:(t=(0,a.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Device Type must be provided and must be a string.");case 2:return e.abrupt("return",this.app.request.get({url:this.app.urls.messagingPushTemplates(t)}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),e}();function d(e){if(!e||"string"!=typeof e)throw new Error("Channel Name must be provided and must be a string.");if(e.indexOf("/")>=0)throw new Error("Channel Name can not contain slash chars")}t.Z=p},394:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(6690)),s=n(r(9728)),i=n(r(8416)),a="GRANT",u="DENY",c=function(){function e(t,r){(0,o.default)(this,e),this.permission=t,this.app=r,this.grantUser=this.backwardCompatibility("grantForUser","grantUser"),this.denyUser=this.backwardCompatibility("denyForUser","denyUser"),this.grantRole=this.backwardCompatibility("grantForRole","grantRole"),this.denyRole=this.backwardCompatibility("denyForRole","denyRole"),this.grant=this.backwardCompatibility("grantForAllUsers","grant"),this.deny=this.backwardCompatibility("denyForAllUsers","deny")}return(0,s.default)(e,[{key:"backwardCompatibility",value:function(e,t){var r=this,n=this.constructor.BACKWARD_COMPATIBILITY_LABEL;return function(){var o='"'.concat(n,".").concat(t,'" is deprecated and will be removed in the nearest release.'),s='Please use "'.concat(n,".").concat(e,'" instead of.');return console.warn("".concat(o,"\n").concat(s)),r[e].apply(r,arguments)}}},{key:"grantForUser",value:function(e,t){return this.sendRequest(a,t,{userId:e})}},{key:"denyForUser",value:function(e,t){return this.sendRequest(u,t,{userId:e})}},{key:"grantForRole",value:function(e,t){return this.sendRequest(a,t,{roleName:e})}},{key:"denyForRole",value:function(e,t){return this.sendRequest(u,t,{roleName:e})}},{key:"grantForAllUsers",value:function(e){return this.sendRequest(a,e,{userId:"*"})}},{key:"denyForAllUsers",value:function(e){return this.sendRequest(u,e,{userId:"*"})}},{key:"grantForAllRoles",value:function(e){return this.sendRequest(a,e,{roleName:"*"})}},{key:"denyForAllRoles",value:function(e){return this.sendRequest(u,e,{roleName:"*"})}},{key:"sendRequest",value:function(e,t,r){var n=r.userId,o=r.roleName,s={permission:this.permission};return n?s.user=n:o&&(s.role=o),this.app.request.put({url:this.getRequestURL(e,t),data:s})}},{key:"getRequestURL",value:function(){}}]),e}();t.default=c,(0,i.default)(c,"BACKWARD_COMPATIBILITY_LABEL",null)},294:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(8416)),s=n(r(6690)),i=n(r(9728)),a=n(r(3930));function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){(0,o.default)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var l={GET:"GET",POST:"POST",PUT:"PUT",DELETE:"DELETE",PATCH:"PATCH"},f=function(){function e(t){(0,s.default)(this,e),this.app=t,this.Methods=l}return(0,i.default)(e,[{key:"send",value:function(e){a.default.verbose=!!this.app.debugMode,a.default.XMLHttpRequest=this.app.XMLHttpRequest;var t=e.method.toLowerCase(),r=e.headers||{},n=this.app.getCurrentUserToken();return n&&(r["user-token"]=n),e.queryString&&(e.url="".concat(e.url,"?").concat(e.queryString)),a.default[t](e.url,e.data).set(r).query(e.query).form(e.form)}},{key:"get",value:function(e){return this.send(c(c({},e),{},{method:l.GET}))}},{key:"post",value:function(e){return this.send(c(c({},e),{},{method:l.POST}))}},{key:"put",value:function(e){return this.send(c(c({},e),{},{method:l.PUT}))}},{key:"delete",value:function(e){return this.send(c(c({},e),{},{method:l.DELETE}))}}]),e}();t.default=f},5476:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o,s,i,a,u,c,l,f,p,d,h=n(r(861)),y=n(r(6690)),v=n(r(9728)),m=n(r(6115)),b=n(r(1588)),g=n(r(1655)),w=n(r(4993)),k=n(r(3808)),E=n(r(8416)),O=n(r(6877)),S=r(9181);function _(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function R(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_(Object(r),!0).forEach((function(t){(0,E.default)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function x(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,k.default)(e);if(t){var o=(0,k.default)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,w.default)(this,r)}}var j="CHANGES",T="CLEARED",P="INVOKE",C=(o=S.RTScopeConnector.connectionRequired(),s=S.RTScopeConnector.connectionRequired(),i=S.RTScopeConnector.connectionRequired(),a=S.RTScopeConnector.connectionRequired(),u=S.RTScopeConnector.connectionRequired(!0),c=S.RTScopeConnector.connectionRequired(!0),l=S.RTScopeConnector.connectionRequired(!0),f=S.RTScopeConnector.connectionRequired(!0),p=S.RTScopeConnector.connectionRequired(!0),d=function(e){(0,g.default)(r,e);var t=x(r);function r(e,n){var o;return(0,y.default)(this,r),o=t.call(this,e),(0,E.default)((0,m.default)(o),"onInvoke",(function(e){var t,r=e.method,n=e.args;A(o.invocationTarget,r),(t=o.invocationTarget)[r].apply(t,(0,h.default)(n))})),o.app=n,o.invocationTarget=null,o.connect(),o}return(0,v.default)(r,[{key:"connectSubscriber",get:function(){return this.app.RT.subscriptions.connectToRSO}},{key:"usersSubscriber",get:function(){return this.app.RT.subscriptions.onRSOUserStatus}},{key:"commandSubscriber",get:function(){return this.app.RT.subscriptions.onRSOCommand}},{key:"commandSender",get:function(){return this.app.RT.methods.sendRSOCommand}},{key:"setInvocationTarget",value:function(e){this.invocationTarget=e}},{key:"connect",value:function(){if(this.app)return(0,b.default)((0,k.default)(r.prototype),"connect",this).call(this)}},{key:"onConnect",value:function(){(0,b.default)((0,k.default)(r.prototype),"onConnect",this).apply(this,arguments),this.addSubscription(P,this.app.RT.subscriptions.onRSOInvoke,{callback:this.onInvoke})}},{key:"onDisconnect",value:function(){this.stopSubscription(P,{callback:this.onInvoke}),(0,b.default)((0,k.default)(r.prototype),"onDisconnect",this).apply(this,arguments)}},{key:"addChangesListener",value:function(e,t){this.addSubscription(j,this.app.RT.subscriptions.onRSOChanges,{callback:e,onError:t})}},{key:"removeChangesListeners",value:function(e){this.stopSubscription(j,{callback:e})}},{key:"addClearListener",value:function(e,t){this.addSubscription(T,this.app.RT.subscriptions.onRSOClear,{callback:e,onError:t})}},{key:"removeClearListeners",value:function(e){this.stopSubscription(T,{callback:e})}},{key:"addCommandListener",value:function(e,t){return(0,b.default)((0,k.default)(r.prototype),"addCommandListener",this).call(this,e,t),this}},{key:"removeCommandListener",value:function(e){return(0,b.default)((0,k.default)(r.prototype),"removeCommandListeners",this).call(this,e),this}},{key:"removeCommandListeners",value:function(e){return(0,b.default)((0,k.default)(r.prototype),"removeCommandListeners",this).call(this,e),this}},{key:"addUserStatusListener",value:function(e,t){return(0,b.default)((0,k.default)(r.prototype),"addUserStatusListener",this).call(this,e,t),this}},{key:"removeUserStatusListeners",value:function(e){return(0,b.default)((0,k.default)(r.prototype),"removeUserStatusListeners",this).call(this,e),this}},{key:"addConnectListener",value:function(e,t){return(0,b.default)((0,k.default)(r.prototype),"addConnectListener",this).call(this,e,t),this}},{key:"removeConnectListeners",value:function(e,t){return(0,b.default)((0,k.default)(r.prototype),"removeConnectListeners",this).call(this,e,t),this}},{key:"removeAllListeners",value:function(){return(0,b.default)((0,k.default)(r.prototype),"removeAllListeners",this).call(this),this}},{key:"get",value:function(e){return this.app.RT.methods.getRSO(R(R({},this.getScopeOptions()),{},{key:e}))}},{key:"set",value:function(e,t){return this.app.RT.methods.setRSO(R(R({},this.getScopeOptions()),{},{key:e,data:t}))}},{key:"clear",value:function(){return this.app.RT.methods.clearRSO(this.getScopeOptions())}},{key:"invoke",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return this.invokeOn.apply(this,[e,void 0].concat(r))}},{key:"invokeOn",value:function(e,t){for(var r=this,n=arguments.length,o=new Array(n>2?n-2:0),s=2;s<n;s++)o[s-2]=arguments[s];return Promise.resolve().then((function(){return A(r.invocationTarget,e)})).then((function(){return r.app.RT.methods.invokeRSOMethod(R(R({},r.getScopeOptions()),{},{method:e,targets:t,args:o}))}))}}]),r}(S.RTScopeConnector),(0,O.default)(d.prototype,"addChangesListener",[o],Object.getOwnPropertyDescriptor(d.prototype,"addChangesListener"),d.prototype),(0,O.default)(d.prototype,"removeChangesListeners",[s],Object.getOwnPropertyDescriptor(d.prototype,"removeChangesListeners"),d.prototype),(0,O.default)(d.prototype,"addClearListener",[i],Object.getOwnPropertyDescriptor(d.prototype,"addClearListener"),d.prototype),(0,O.default)(d.prototype,"removeClearListeners",[a],Object.getOwnPropertyDescriptor(d.prototype,"removeClearListeners"),d.prototype),(0,O.default)(d.prototype,"get",[u],Object.getOwnPropertyDescriptor(d.prototype,"get"),d.prototype),(0,O.default)(d.prototype,"set",[c],Object.getOwnPropertyDescriptor(d.prototype,"set"),d.prototype),(0,O.default)(d.prototype,"clear",[l],Object.getOwnPropertyDescriptor(d.prototype,"clear"),d.prototype),(0,O.default)(d.prototype,"invoke",[f],Object.getOwnPropertyDescriptor(d.prototype,"invoke"),d.prototype),(0,O.default)(d.prototype,"invokeOn",[p],Object.getOwnPropertyDescriptor(d.prototype,"invokeOn"),d.prototype),d);function A(e,t){if(!e)throw new Error('"invocationTarget" is not specified');if("function"!=typeof e[t])throw new Error('Method "'.concat(t,'" of invocationTarget is not function'))}t.default=C},7578:(e,t,r)=>{"use strict";var n=r(4836);t.Z=void 0;var o=n(r(6690)),s=n(r(9728)),i=n(r(5476)),a=function(){function e(t){(0,o.default)(this,e),this.app=t}return(0,s.default)(e,[{key:"connect",value:function(e){return new i.default({name:e},this.app)}}]),e}();t.Z=a},9181:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.RTScopeConnector=t.RTListeners=void 0;var o=n(r(4687)),s=n(r(7156)),i=n(r(6690)),a=n(r(9728)),u=n(r(1655)),c=n(r(4993)),l=n(r(3808)),f=n(r(3930)),p=n(r(5786)),d=n(r(9853));function h(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,l.default)(e);if(t){var o=(0,l.default)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,c.default)(this,r)}}var y=p.default.Listeners;t.RTListeners=y;var v=p.default.ScopeConnector;function m(e){return f.default.get("".concat(e,"/info"))}t.RTScopeConnector=v;var b=function(e){(0,u.default)(r,e);var t=h(r);function r(e){var n;(0,i.default)(this,r);var a,u=e.appId,c=e.apiKey,l=e.appPath,f=e.debugMode,p=d.default.uuid(),h="".concat(l,"/rt/lookup");return(n=t.call(this,{appId:u||void 0,lookupPath:h,debugMode:f,connectQuery:function(){var t=e.getCurrentUserToken();return{apiKey:c||void 0,clientId:p,userToken:t}},socketConfigTransform:(a=(0,s.default)(o.default.mark((function e(t){var r;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u){e.next=7;break}return e.next=3,m(l);case 3:r=e.sent,t.url="".concat(t.host,"/").concat(r.appId),t.options.path="/".concat(r.appId),t.options.query.apiKey=r.apiKey;case 7:return e.abrupt("return",t);case 8:case"end":return e.stop()}}),e)}))),function(e){return a.apply(this,arguments)})})).app=e,n}return(0,a.default)(r,[{key:"updateUserTokenIfNeeded",value:function(){if(this.session){var e=this.app.getCurrentUserToken();this.methods.setUserToken({userToken:e})}}},{key:"setDebugMode",value:function(e){this.setConfig({debugMode:e})}}]),r}(p.default);t.default=b},4172:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OperationType=t.IsolationLevelEnum=void 0;t.OperationType={CREATE:"CREATE",CREATE_BULK:"CREATE_BULK",UPDATE:"UPDATE",UPDATE_BULK:"UPDATE_BULK",DELETE:"DELETE",DELETE_BULK:"DELETE_BULK",UPSERT:"UPSERT",UPSERT_BULK:"UPSERT_BULK",FIND:"FIND",ADD_RELATION:"ADD_RELATION",SET_RELATION:"SET_RELATION",DELETE_RELATION:"DELETE_RELATION"};t.IsolationLevelEnum={READ_UNCOMMITTED:"READ_UNCOMMITTED",READ_COMMITTED:"READ_COMMITTED",REPEATABLE_READ:"REPEATABLE_READ",SERIALIZABLE:"SERIALIZABLE"}},7890:(e,t,r)=>{"use strict";var n=r(4836);t.Z=function(e){return function(t){(0,f.default)(n,t);var r=S(n);function n(t){return(0,c.default)(this,n),r.call(this,t,e)}return(0,l.default)(n,null,[{key:"initFromJSON",value:function(e){var t=new this(e.transactionIsolation);return e.operations.forEach((function(e){b.OperationJSONAdapter[e.operationType](t,e).setOpResultId(e.opResultId)})),t}}]),n}(x)};var o=n(r(4687)),s=n(r(8698)),i=n(r(7156)),a=n(r(215)),u=n(r(8416)),c=n(r(6690)),l=n(r(9728)),f=n(r(1655)),p=n(r(4993)),d=n(r(3808)),h=n(r(3496)),y=n(r(9853)),v=n(r(3082)),m=r(4172),b=r(5561),g=r(3687),w=r(3106),k=["meta"];function E(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function O(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?E(Object(r),!0).forEach((function(t){(0,u.default)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):E(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function S(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,d.default)(e);if(t){var o=(0,d.default)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,p.default)(this,r)}}var _=function(e){(0,f.default)(r,e);var t=S(r);function r(e,n){var o;return(0,c.default)(this,r),(o=t.call(this,e)).operation=n,o}return(0,l.default)(r,[{key:"toJSON",value:function(){return{message:this.message,operation:this.operation}}}]),r}((0,h.default)(Error)),R=function(){function e(t){var r=t.success,n=t.error,o=t.results;(0,c.default)(this,e),this.success=r,this.error=n,this.results=o}return(0,l.default)(e,[{key:"isSuccess",value:function(){return this.success}},{key:"getError",value:function(){return this.error}},{key:"getResults",value:function(){return this.results}}]),e}(),x=function(){function e(t,r){(0,c.default)(this,e),this.app=r,this.payload={isolationLevelEnum:t,operations:[]},this.usedOpIds={}}var t;return(0,l.default)(e,[{key:"getOpResultById",value:function(e){return this.payload.operations.find((function(t){return t.meta.opResult.getOpResultId()===e})).meta.opResult}},{key:"setIsolationLevel",value:function(e){this.payload.isolationLevelEnum=e}},{key:"getOpStackName",value:function(e,t){return"".concat(e.toLowerCase()).concat(t)}},{key:"getNextOpResultIndex",value:function(e){return this.usedOpIds[e]||(this.usedOpIds[e]=0),++this.usedOpIds[e]}},{key:"addOperations",value:function(e,t,r){Array.isArray(r)?r=r.map((function(e){return delete e.___jsonclass,e})):delete r.___jsonclass;var n=new g.OpResult(this,{operationType:e,table:t,payload:r});return this.payload.operations.push({operationType:e,table:t,payload:r,meta:{opResult:n}}),n}},{key:"composePayload",value:function(){return O(O({},this.payload),{},{operations:this.payload.operations.map((function(e){var t=e.meta;return O(O({},(0,a.default)(e,k)),{},{opResultId:t.opResult.getOpResultId()})}))})}},{key:"execute",value:(t=(0,i.default)(o.default.mark((function e(){var t;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.app.request.post({url:this.app.urls.transactions(),data:this.composePayload()});case 2:return t=e.sent,e.abrupt("return",this.setResult(t));case 4:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"setResult",value:function(e){if(e.results&&this.payload.operations.forEach((function(t){var r=t.meta.opResult.getOpResultId();e.results[r]&&t.meta.opResult.setResult(e.results[r].result)})),e.error){var t=this.payload.operations.find((function(t){return e.error.operation.opResultId===t.meta.opResult.getOpResultId()}));e.error=new _(e.error.message,t.meta.opResult),t.meta.opResult.setError(e.error)}return new R(e)}},{key:"find",value:function(e,t){var r=t instanceof v.default?t.toJSON():t||{};if(!e||"string"!=typeof e)throw new Error("Invalid arguments");if("object"!==(0,s.default)(r)||Array.isArray(r))throw new Error("Invalid arguments");var n={queryOptions:{}};return r.pageSize>0&&(n.pageSize=r.pageSize),r.offset>0&&(n.offset=r.offset),r.properties&&(n.properties=r.properties),r.excludeProps&&(n.excludeProps=r.excludeProps),r.excludeProps&&(n.excludeProps=r.excludeProps),r.where&&(n.whereClause=r.where),r.having&&(n.havingClause=r.having),r.groupBy&&(n.groupBy=r.groupBy),r.sortBy&&(n.queryOptions.sortBy=r.sortBy),r.relations&&(n.queryOptions.related=r.relations),r.relationsDepth&&(n.queryOptions.relationsDepth=r.relationsDepth),r.relationsPageSize>0&&(n.queryOptions.relationsPageSize=r.relationsPageSize),this.addOperations(m.OperationType.FIND,e,n)}},{key:"upsert",value:function(){var e,t;if(1===arguments.length)e=y.default.getClassName(arguments.length<=0?void 0:arguments[0]),t=arguments.length<=0?void 0:arguments[0];else{if(2!==arguments.length)throw new Error("Invalid arguments");e=arguments.length<=0?void 0:arguments[0],t=arguments.length<=1?void 0:arguments[1]}if(!e||"string"!=typeof e)throw new Error("Invalid arguments");if(!t||"object"!==(0,s.default)(t)||Array.isArray(t))throw new Error("Invalid arguments");return this.addOperations(m.OperationType.UPSERT,e,t)}},{key:"create",value:function(){var e,t;if(1===arguments.length)e=y.default.getClassName(arguments.length<=0?void 0:arguments[0]),t=arguments.length<=0?void 0:arguments[0];else{if(2!==arguments.length)throw new Error("Invalid arguments");e=arguments.length<=0?void 0:arguments[0],t=arguments.length<=1?void 0:arguments[1]}if(!e||"string"!=typeof e)throw new Error("Invalid arguments");if(!t||"object"!==(0,s.default)(t)||Array.isArray(t))throw new Error("Invalid arguments");return this.addOperations(m.OperationType.CREATE,e,t)}},{key:"update",value:function(){for(var e,t,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];if(1===n.length)e=y.default.getClassName(n[0]),t=n[0];else if(2===n.length&&"string"==typeof n[0])e=n[0],t=n[1];else{if(!(n[0]instanceof g.OpResult||n[0]instanceof w.OpResultValueReference))throw new Error("Invalid arguments");if(e=n[0].getTableName(),t={objectId:n[0]},3===n.length&&"string"==typeof n[1])t[n[1]]=n[2];else{if(2!==n.length)throw new Error("Invalid arguments");t=O(O({},t),n[1])}}if(!e||"string"!=typeof e)throw new Error("Invalid arguments");return this.addOperations(m.OperationType.UPDATE,e,t)}},{key:"delete",value:function(){for(var e,t,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];if(1===n.length)n[0]instanceof g.OpResult||n[0]instanceof w.OpResultValueReference?(e=n[0].getTableName(),t=n[0]):n[0]&&"object"===(0,s.default)(n[0])&&!Array.isArray(n[0])&&(e=y.default.getClassName(n[0]),t=n[0].objectId);else{if(2!==n.length)throw new Error("Invalid arguments");e=n[0],t=n[1]&&n[1].objectId||n[1]}if(!t||Array.isArray(t)||"string"!=typeof t&&"object"!==(0,s.default)(t))throw new Error("Invalid arguments");if(!e||"string"!=typeof e)throw new Error("Table Name must be a string.");return this.addOperations(m.OperationType.DELETE,e,t)}},{key:"bulkUpsert",value:function(e,t){if(Array.isArray(e)&&(t=e,e=y.default.getClassName(t[0])),!t||!Array.isArray(t))throw new Error("Objects must be an array of objects.");if(!e||"string"!=typeof e)throw new Error("Table Name must be a string.");return this.addOperations(m.OperationType.UPSERT_BULK,e,t)}},{key:"bulkCreate",value:function(e,t){if(Array.isArray(e)&&(t=e,e=y.default.getClassName(t[0])),!t||!Array.isArray(t))throw new Error("Objects must be an array of objects.");if(!e||"string"!=typeof e)throw new Error("Table Name must be a string.");return this.addOperations(m.OperationType.CREATE_BULK,e,t)}},{key:"bulkUpdate",value:function(){for(var e,t={},r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];if(2===n.length)t.changes=n[1],"string"==typeof n[0]?(e=y.default.getClassName(n[1]),t.conditional=n[0]):n[0]instanceof g.OpResult&&(e=n[0].getTableName(),t.unconditional=n[0]);else{if(3!==n.length)throw new Error("Invalid arguments");if(e=n[0],t.changes=n[2],"string"==typeof n[1])t.conditional=n[1];else{if(!Array.isArray(n[1]))throw new Error("Invalid arguments");t.unconditional=n[1].map((function(e){return e.objectId||e}))}}if(!e||"string"!=typeof e)throw new Error("Table Name must be a string.");return this.addOperations(m.OperationType.UPDATE_BULK,e,t)}},{key:"bulkDelete",value:function(){for(var e,t={},r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];if(1===n.length)if(n[0]instanceof g.OpResult)e=n[0].getTableName(),t.unconditional=n[0];else{if(!Array.isArray(n[0]))throw new Error("Invalid arguments");e=y.default.getClassName(n[0][0]),t.unconditional=n[0].map((function(e){return e.objectId}))}else{if(2!==n.length)throw new Error("Invalid arguments");if(e=n[0],"string"==typeof n[1])t.conditional=n[1];else{if(!Array.isArray(n[1]))throw new Error("Invalid arguments");t.unconditional=n[1].map((function(e){return e.objectId||e}))}}if(!e||"string"!=typeof e)throw new Error("Table Name must be a string.");return this.addOperations(m.OperationType.DELETE_BULK,e,t)}},{key:"addToRelation",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.relationsOperation(m.OperationType.ADD_RELATION,t)}},{key:"setRelation",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.relationsOperation(m.OperationType.SET_RELATION,t)}},{key:"deleteRelation",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.relationsOperation(m.OperationType.DELETE_RELATION,t)}},{key:"relationsOperation",value:function(e,t){var r,n,o,i,a,u;if(3===t.length)if(o=t[0],n=t[1],u=t[2],o instanceof g.OpResult||o instanceof w.OpResultValueReference)r=o.getTableName();else{if(!o||"object"!==(0,s.default)(o))throw new Error("Invalid the first argument, it must be an instance of [OpResult|OpResultValueReference|Object]");r=y.default.getClassName(o)}else{if(4!==t.length)throw new Error("Invalid arguments");if(r=t[0],n=t[2],u=t[3],"string"==typeof t[1])o=t[1];else{if(!t[1]||"object"!==(0,s.default)(t[1]))throw new Error("Invalid the second argument, it must be an Object or objectId");o=t[1]}}if(o&&o.objectId&&(o=o.objectId),"string"==typeof u?i=u:u instanceof g.OpResult&&u.isCollectionRef()?a=u:(Array.isArray(u)||(u=[u]),a=u.map((function(e){if(e){if(e instanceof g.OpResult||e instanceof w.OpResultValueReference)return e;if("string"==typeof e)return e;if(e.objectId)return e.objectId}throw new Error("Invalid child argument, it must be an instance of [OpResult|OpResultValueReference|Object] or objectId")}))),!n||"string"!=typeof n)throw new Error('Invalid "relationColumn" parameter, check passed arguments');if(!a&&!i)throw new Error('Neither "unconditional" nor "conditional" parameter is specified, check passed arguments');if(!r||"string"!=typeof r)throw new Error("Table Name must be a string.");var c={parentObject:o,relationColumn:n};return i?c.conditional=i:c.unconditional=a,this.addOperations(e,r,c)}}]),e}();(0,u.default)(x,"IsolationLevelEnum",m.IsolationLevelEnum),(0,u.default)(x,"OpResult",g.OpResult),(0,u.default)(x,"OpResultValueReference",w.OpResultValueReference)},5561:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.OperationJSONAdapter=void 0;var o=n(r(8698)),s=r(4172),i=r(3687);function a(e,t){if(Array.isArray(t))return t.map((function(t){return a(e,t)}));if(t&&"object"===(0,o.default)(t)){if(t.___ref){var r=e.getOpResultById(t.opResultId);return void 0!==t.resultIndex?r.resolveTo(t.resultIndex,t.propName):void 0!==t.propName?r.resolveTo(t.propName):r}var n={};for(var s in t)n[s]=a(e,t[s]);return n}return t}var u={CREATE:function(e,t){var r=t.table,n=t.payload;return e.create.call(e,r,a(e,n))},DELETE:function(e,t){var r=t.table,n=t.payload;return e.delete.call(e,r,a(e,n))},UPDATE:function(e,t){var r=t.table,n=t.payload;return e.update.call(e,r,a(e,n))},UPSERT:function(e,t){var r=t.table,n=t.payload;return e.upsert.call(e,r,a(e,n))},UPDATE_BULK:function(e,t){var r=t.table,n=t.payload,o=c(e,{table:r,payload:n});return o.push(a(e,n.changes)),e.bulkUpdate.apply(e,o)},DELETE_BULK:function(e,t){var r=c(e,{table:t.table,payload:t.payload});return e.bulkDelete.apply(e,r)},CREATE_BULK:function(e,t){var r=t.table,n=t.payload;return e.bulkCreate.call(e,r,a(e,n))},UPSERT_BULK:function(e,t){var r=t.table,n=t.payload;return e.bulkUpsert.call(e,r,a(e,n))},SET_RELATION:function(e,t){return l(e,"setRelation",{table:t.table,payload:t.payload})},DELETE_RELATION:function(e,t){return l(e,"deleteRelation",{table:t.table,payload:t.payload})},ADD_RELATION:function(e,t){return l(e,"addToRelation",{table:t.table,payload:t.payload})},FIND:function(e,t){var r=t.table,n=t.payload;return e.addOperations(s.OperationType.FIND,r,n)}};function c(e,t){var r=t.table,n=t.payload,o=[];if(n.conditional)o.push(r),o.push(n.conditional);else{var s=a(e,n.unconditional);s instanceof i.OpResult||o.push(r),o.push(s)}return o}function l(e,t,r){var n=r.table,o=r.payload,s=[n];return"string"==typeof o.parentObject?s.push({objectId:o.parentObject}):s.push(a(e,o.parentObject)),s.push(o.relationColumn),s.push(o.conditional||a(e,o.unconditional)),e[t].apply(e,s)}t.OperationJSONAdapter=u},3106:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.OpResultValueReference=void 0;var o=n(r(6690)),s=n(r(9728)),i=function(){function e(t,r){var n=r.resultIndex,s=r.propName;(0,o.default)(this,e),this.opResult=t,this.resultIndex=n,this.propName=s}return(0,s.default)(e,[{key:"getTableName",value:function(){return this.opResult.getTableName()}},{key:"toJSON",value:function(){var e=this.opResult.toJSON();return void 0!==this.resultIndex&&(e.resultIndex=this.resultIndex),void 0!==this.propName&&(e.propName=this.propName),!e.propName&&this.opResult.isFindRef()&&(e.propName="objectId"),e}}]),e}();t.OpResultValueReference=i},3687:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.OpResult=void 0;var o=n(r(6690)),s=n(r(9728)),i=r(4172),a=r(3106),u=function(){function e(t,r){var n=r.operationType,s=r.table,i=r.payload;(0,o.default)(this,e),this.uow=t,this.operationType=n,this.table=s,this.payload=i;var a=this.uow.getOpStackName(n,s),u=this.uow.getNextOpResultIndex(a);this.opResultId="".concat(a).concat(u),this.result=null}return(0,s.default)(e,[{key:"setResult",value:function(e){this.result=e}},{key:"getResult",value:function(){return this.result}},{key:"setError",value:function(e){this.error=e}},{key:"getError",value:function(){return this.error}},{key:"getType",value:function(){return this.operationType}},{key:"isFindRef",value:function(){return this.operationType===i.OperationType.FIND}},{key:"isCollectionRef",value:function(){return this.operationType===i.OperationType.FIND||this.operationType===i.OperationType.CREATE_BULK}},{key:"isObjectRef",value:function(){return this.operationType===i.OperationType.CREATE||this.operationType===i.OperationType.UPDATE}},{key:"setOpResultId",value:function(e){return this.opResultId=e,this}},{key:"getOpResultId",value:function(){return this.opResultId}},{key:"getTableName",value:function(){return this.table}},{key:"resolveTo",value:function(e,t){return"string"==typeof e&&(t=e,e=void 0),new a.OpResultValueReference(this,{resultIndex:e,propName:t})}},{key:"toJSON",value:function(){var e={___ref:!0,opResultId:this.opResultId};return this.isObjectRef()&&(e.propName="objectId"),e}}]),e}();t.OpResult=u},435:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(6690)),s=n(r(9728)),i=function(){function e(t){(0,o.default)(this,e),this.app=t}return(0,s.default)(e,[{key:"root",value:function(){return this.app.appPath}},{key:"blServices",value:function(){return"".concat(this.root(),"/services")}},{key:"blServiceMethod",value:function(e,t){return"".concat(this.blServices(),"/").concat(e,"/").concat(t)}},{key:"blEvent",value:function(e){return"".concat(this.root(),"/servercode/events/").concat(e)}},{key:"logging",value:function(){return"".concat(this.root(),"/log")}},{key:"loggingLevels",value:function(){return"".concat(this.logging(),"/logger")}},{key:"cache",value:function(){return"".concat(this.root(),"/cache")}},{key:"cacheItem",value:function(e){return"".concat(this.cache(),"/").concat(e)}},{key:"cacheItemExpireIn",value:function(e){return"".concat(this.cacheItem(e),"/expireIn")}},{key:"cacheItemExpireAt",value:function(e){return"".concat(this.cacheItem(e),"/expireAt")}},{key:"cacheItemCheck",value:function(e){return"".concat(this.cacheItem(e),"/check")}},{key:"counters",value:function(){return"".concat(this.root(),"/counters")}},{key:"countersList",value:function(e){return"".concat(this.counters(),"/").concat(e||"*","/list")}},{key:"counter",value:function(e){return"".concat(this.counters(),"/").concat(e)}},{key:"counterAddAndGet",value:function(e){return"".concat(this.counter(e),"/incrementby/get")}},{key:"counterGetAndAdd",value:function(e){return"".concat(this.counter(e),"/get/incrementby")}},{key:"counterIncrementAndGet",value:function(e){return"".concat(this.counter(e),"/increment/get")}},{key:"counterDecrementAndGet",value:function(e){return"".concat(this.counter(e),"/decrement/get")}},{key:"counterGetAndDecrement",value:function(e){return"".concat(this.counter(e),"/get/decrement")}},{key:"counterGetAndIncrement",value:function(e){return"".concat(this.counter(e),"/get/increment")}},{key:"counterCompareAndSet",value:function(e){return"".concat(this.counter(e),"/get/compareandset")}},{key:"counterReset",value:function(e){return"".concat(this.counter(e),"/reset")}},{key:"data",value:function(){return"".concat(this.root(),"/data")}},{key:"dataGrouping",value:function(e){return"".concat(this.data(),"/data-grouping/").concat(e)}},{key:"dataTable",value:function(e){return"".concat(this.data(),"/").concat(e)}},{key:"dataTableUpsert",value:function(e){return"".concat(this.data(),"/").concat(e,"/upsert")}},{key:"dataTableDeepSave",value:function(e){return"".concat(this.data(),"/").concat(e,"/deep-save")}},{key:"dataTableFind",value:function(e){return"".concat(this.dataTable(e),"/find")}},{key:"dataTablePrimaryKey",value:function(e){return"".concat(this.dataTable(e),"/pk")}},{key:"dataTableObject",value:function(e,t){return"".concat(this.dataTable(e),"/").concat(encodeURIComponent(t))}},{key:"dataTableObjectRelation",value:function(e,t,r){return"".concat(this.dataTableObject(e,t),"/").concat(r)}},{key:"dataTableCount",value:function(e){return"".concat(this.dataTable(e),"/count")}},{key:"dataTableProps",value:function(e){return"".concat(this.dataTable(e),"/properties")}},{key:"dataBulkTable",value:function(e){return"".concat(this.data(),"/bulk/").concat(e)}},{key:"dataBulkTableUpsert",value:function(e){return"".concat(this.data(),"/bulkupsert/").concat(e)}},{key:"dataBulkTableDelete",value:function(e){return"".concat(this.dataBulkTable(e),"/delete")}},{key:"dataObjectPermission",value:function(e,t,r){return"".concat(this.dataTable(e),"/permissions/").concat(t,"/").concat(r)}},{key:"dataTableNameById",value:function(e){return"".concat(this.data(),"/").concat(e,"/table-name")}},{key:"transactions",value:function(){return"".concat(this.root(),"/transaction/unit-of-work")}},{key:"dataHives",value:function(){return"".concat(this.root(),"/hive")}},{key:"dataHive",value:function(e){return"".concat(this.dataHives(),"/").concat(e)}},{key:"hiveStore",value:function(e,t){return"".concat(this.dataHive(e),"/").concat(t)}},{key:"messaging",value:function(){return"".concat(this.root(),"/messaging")}},{key:"messagingPush",value:function(){return"".concat(this.messaging(),"/push")}},{key:"messagingPushTemplates",value:function(e){return"".concat(this.messaging(),"/pushtemplates/").concat(e)}},{key:"messagingPushWithTemplate",value:function(e){return"".concat(this.messagingPush(),"/").concat(e)}},{key:"messagingEmail",value:function(){return"".concat(this.messaging(),"/email")}},{key:"messagingChannel",value:function(e){return"".concat(this.messaging(),"/").concat(e)}},{key:"messagingMessage",value:function(e){return"".concat(this.messaging(),"/").concat(e)}},{key:"messagingRegistrations",value:function(){return"".concat(this.messaging(),"/registrations")}},{key:"messagingRegistrationDevice",value:function(e){return"".concat(this.messagingRegistrations(),"/").concat(e)}},{key:"emailTemplate",value:function(){return"".concat(this.root(),"/emailtemplate")}},{key:"emailTemplateSend",value:function(){return"".concat(this.emailTemplate(),"/send")}},{key:"commerce",value:function(){return"".concat(this.root(),"/commerce/googleplay")}},{key:"commerceValidate",value:function(e,t,r){return"".concat(this.commerce(),"/validate/").concat(e,"/inapp/").concat(t,"/purchases/").concat(r)}},{key:"commerceSubCancel",value:function(e,t,r){return"".concat(this.commerce(),"/").concat(e,"/subscription/").concat(t,"/purchases/").concat(r,"/cancel")}},{key:"commerceSubStatus",value:function(e,t,r){return"".concat(this.commerce(),"/").concat(e,"/subscription/").concat(t,"/purchases/").concat(r)}},{key:"files",value:function(){return"".concat(this.root(),"/files")}},{key:"filePath",value:function(e){return"".concat(this.files(),"/").concat(e)}},{key:"directoryPath",value:function(e){return"".concat(this.files(),"/").concat(e,"/")}},{key:"fileCopy",value:function(){return"".concat(this.files(),"/copy")}},{key:"fileMove",value:function(){return"".concat(this.files(),"/move")}},{key:"fileRename",value:function(){return"".concat(this.files(),"/rename")}},{key:"filePermissions",value:function(){return"".concat(this.files(),"/permissions")}},{key:"filePermission",value:function(e,t){return"".concat(this.filePermissions(),"/").concat(e,"/").concat(encodeURIComponent(t))}},{key:"fileBinaryPath",value:function(e){return"".concat(this.files(),"/binary/").concat(e)}},{key:"fileAppendPath",value:function(e){return"".concat(this.files(),"/append/").concat(e)}},{key:"fileAppendBinaryPath",value:function(e){return"".concat(this.files(),"/append/binary/").concat(e)}},{key:"users",value:function(){return"".concat(this.root(),"/users")}},{key:"userObject",value:function(e){return"".concat(this.users(),"/").concat(e)}},{key:"userRegister",value:function(){return"".concat(this.users(),"/register")}},{key:"userLogin",value:function(){return"".concat(this.users(),"/login")}},{key:"userLogout",value:function(){return"".concat(this.users(),"/logout")}},{key:"userRoles",value:function(e){return"".concat(this.users(),"/userroles").concat(e?"/".concat(e):"")}},{key:"usersRole",value:function(e){return"".concat(this.users(),"/role/").concat(e)}},{key:"userRoleOperation",value:function(e){return"".concat(this.users(),"/").concat(e)}},{key:"userClassProps",value:function(){return"".concat(this.users(),"/userclassprops")}},{key:"userRestorePassword",value:function(e){return"".concat(this.users(),"/restorepassword/").concat(encodeURIComponent(e))}},{key:"userTokenCheck",value:function(e){return"".concat(this.users(),"/isvalidusertoken/").concat(e)}},{key:"userVerifyPassowrd",value:function(){return"".concat(this.users(),"/verifypassowrd")}},{key:"userResendConfirmation",value:function(e){return"".concat(this.users(),"/resendconfirmation/").concat(e)}},{key:"userCreateConfirmationURL",value:function(e){return"".concat(this.users(),"/createEmailConfirmationURL/").concat(e)}},{key:"userSocial",value:function(){return"".concat(this.users(),"/social")}},{key:"userSocialOAuth",value:function(e){return"".concat(this.userSocial(),"/oauth/").concat(e.toLowerCase(),"/request_url")}},{key:"userSocialLogin",value:function(e){return"".concat(this.userSocial(),"/").concat(e.toLowerCase(),"/sdk/login")}},{key:"userOAuthLogin",value:function(e){return"".concat(this.userSocial(),"/").concat(e.toLowerCase(),"/login")}},{key:"userAuthorizationURL",value:function(e){return"".concat(this.users(),"/oauth/").concat(e.toLowerCase(),"/request_url")}},{key:"guestLogin",value:function(){return"".concat(this.users(),"/register/guest")}},{key:"userStatus",value:function(e){return"".concat(this.userObject(e),"/status")}},{key:"management",value:function(){return"".concat(this.root(),"/management")}},{key:"managementData",value:function(){return"".concat(this.management(),"/data")}},{key:"managementDataTable",value:function(){return"".concat(this.managementData(),"/table")}}]),e}();t.default=i},9935:(e,t,r)=>{"use strict";var n=r(4836);t.i=function(){var e="NodeJS";o.default.isBrowser&&(e=navigator.userAgent?navigator.userAgent.toLowerCase():"hybrid-app");var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[],r={browser:t[1]||"",version:t[2]||"0"},n={};r.browser&&(n[r.browser]=!0,n.version=r.version);return n};var o=n(r(9853))},9681:(e,t,r)=>{"use strict";var n=r(4836);t.Z=void 0;var o=n(r(4687)),s=n(r(8416)),i=n(r(7156)),a=n(r(6690)),u=n(r(9728)),c=r(9211),l=n(r(5602)),f=n(r(8332)),p=n(r(1571));function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function h(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach((function(t){(0,s.default)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var y=function(){function e(t){(0,a.default)(this,e),this.app=t,this.roles=new f.default(this),this.social=new p.default(this),this.dataStore=this.app.Data.of(l.default)}var t,r,n,s,d,y,v,m,b,g,w,k,E,O,S,_,R,x,j,T,P,C,A,N,L,I;return(0,u.default)(e,[{key:"Utils",get:function(){return c.UsersUtils}},{key:"register",value:(I=(0,i.default)(o.default.mark((function e(t){var r,n=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(t=h({},t)).blUserLocale||(r=this.Utils.getClientUserLocale())&&(t.blUserLocale=r),e.abrupt("return",this.app.request.post({url:this.app.urls.userRegister(),data:t}).then((function(e){return n.dataStore.parseResponse(e)})));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return I.apply(this,arguments)})},{key:"login",value:(L=(0,i.default)(o.default.mark((function e(t,r,n){var s,i=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s={},"string"==typeof t||"number"==typeof t){e.next=3;break}throw new Error("the first argument must be either a string or a number");case 3:if(t){e.next=5;break}throw new Error("the first argument cannot be an empty value");case 5:if("boolean"==typeof r&&(n=r,r=void 0),"string"!=typeof t||void 0!==r){e.next=10;break}s.objectId=t,e.next=14;break;case 10:if(r){e.next=12;break}throw new Error('the "password" value cannot be an empty value');case 12:s.login=t,s.password=r;case 14:return n=!0===n,e.abrupt("return",this.app.request.post({url:this.app.urls.userLogin(),data:s}).then((function(e){return i.setCurrentUser(e,n)})));case 16:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return L.apply(this,arguments)})},{key:"loginAsGuest",value:(N=(0,i.default)(o.default.mark((function e(t){var r=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=!0===t,e.abrupt("return",this.app.request.post({url:this.app.urls.guestLogin()}).then((function(e){return r.setCurrentUser(e,t)})));case 2:case"end":return e.stop()}}),e,this)}))),function(e){return N.apply(this,arguments)})},{key:"loginWithFacebook",value:(A=(0,i.default)(o.default.mark((function e(t,r,n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.social.loginWithFacebook(t,r,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return A.apply(this,arguments)})},{key:"loginWithFacebookSdk",value:(C=(0,i.default)(o.default.mark((function e(t,r,n,s){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.social.loginWithFacebookSdk(t,r,n,s));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n){return C.apply(this,arguments)})},{key:"loginWithGooglePlus",value:(P=(0,i.default)(o.default.mark((function e(t,r,n,s){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.social.loginWithGooglePlus(t,r,n,s));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n){return P.apply(this,arguments)})},{key:"loginWithGooglePlusSdk",value:(T=(0,i.default)(o.default.mark((function e(t,r,n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.social.loginWithGooglePlusSdk(t,r,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return T.apply(this,arguments)})},{key:"loginWithTwitter",value:(j=(0,i.default)(o.default.mark((function e(t,r){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.social.loginWithTwitter(t,r));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return j.apply(this,arguments)})},{key:"loginWithOauth2",value:(x=(0,i.default)(o.default.mark((function e(t,r,n,s,i){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.social.loginWithOauth2(t,r,n,s,i));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n,o){return x.apply(this,arguments)})},{key:"loginWithOauth1",value:(R=(0,i.default)(o.default.mark((function e(t,r,n,s,i,a){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.social.loginWithOauth1(t,r,n,s,i,a));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n,o,s){return R.apply(this,arguments)})},{key:"logout",value:(_=(0,i.default)(o.default.mark((function e(){var t=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.app.request.get({url:this.app.urls.userLogout()}).then((function(){t.setCurrentUser(null)})).catch((function(e){throw[3023,3064,3090,3091].includes(e.code)&&t.setCurrentUser(null),e})));case 1:case"end":return e.stop()}}),e,this)}))),function(){return _.apply(this,arguments)})},{key:"getCurrentUser",value:(S=(0,i.default)(o.default.mark((function e(t){var r,n=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.currentUser||t){e.next=2;break}return e.abrupt("return",this.currentUser);case 2:if(!this.currentUserRequest){e.next=4;break}return e.abrupt("return",this.currentUserRequest);case 4:if(!(r=this.getCurrentUserId())){e.next=7;break}return e.abrupt("return",this.currentUserRequest=this.dataStore.findById(r).then((function(e){return n.currentUserRequest=null,e["user-token"]=n.currentUser&&n.currentUser["user-token"]||void 0,n.currentUser=e})).catch((function(e){throw n.currentUserRequest=null,e})));case 7:return e.abrupt("return",null);case 8:case"end":return e.stop()}}),e,this)}))),function(e){return S.apply(this,arguments)})},{key:"setCurrentUser",value:function(e,t){return this.app.LocalCache.remove(this.app.LocalCache.Keys.USER_TOKEN),this.app.LocalCache.remove(this.app.LocalCache.Keys.CURRENT_USER_ID),this.app.LocalCache.remove(this.app.LocalCache.Keys.STAY_LOGGED_IN),this.currentUser=e||null,this.currentUser&&(this.currentUser instanceof l.default||(this.currentUser=this.dataStore.parseResponse(this.currentUser)),t&&(this.app.LocalCache.set(this.app.LocalCache.Keys.STAY_LOGGED_IN,!0),this.app.LocalCache.set(this.app.LocalCache.Keys.USER_TOKEN,this.currentUser["user-token"]),this.app.LocalCache.set(this.app.LocalCache.Keys.CURRENT_USER_ID,this.currentUser.objectId))),this.app.__RT&&this.app.RT.updateUserTokenIfNeeded(),this.currentUser}},{key:"isValidLogin",value:(O=(0,i.default)(o.default.mark((function e(){var t;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t=this.getCurrentUserToken())){e.next=3;break}return e.abrupt("return",this.app.request.get({url:this.app.urls.userTokenCheck(t)}));case 3:return e.abrupt("return",!1);case 4:case"end":return e.stop()}}),e,this)}))),function(){return O.apply(this,arguments)})},{key:"verifyPassword",value:(E=(0,i.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Password has to be a non empty string");case 2:if(this.getCurrentUserToken()){e.next=4;break}throw new Error("In order to check password you have to be logged in");case 4:return e.abrupt("return",this.app.request.post({url:this.app.urls.userVerifyPassowrd(),data:{password:t}}).then((function(e){return!(!e||!e.valid)})));case 5:case"end":return e.stop()}}),e,this)}))),function(e){return E.apply(this,arguments)})},{key:"restorePassword",value:(k=(0,i.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Email Address must be provided and must be a string.");case 2:return e.abrupt("return",this.app.request.get({url:this.app.urls.userRestorePassword(t)}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return k.apply(this,arguments)})},{key:"resendEmailConfirmation",value:(w=(0,i.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("string"!=typeof t){e.next=5;break}if(t){e.next=3;break}throw new Error("Identity can not be an empty string.");case 3:e.next=7;break;case 5:if("number"==typeof t){e.next=7;break}throw new Error("Identity must be a string or number.");case 7:return e.abrupt("return",this.app.request.post({url:this.app.urls.userResendConfirmation(t)}));case 8:case"end":return e.stop()}}),e,this)}))),function(e){return w.apply(this,arguments)})},{key:"createEmailConfirmationURL",value:(g=(0,i.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("string"!=typeof t){e.next=5;break}if(t){e.next=3;break}throw new Error("Identity can not be an empty string.");case 3:e.next=7;break;case 5:if("number"==typeof t){e.next=7;break}throw new Error("Identity must be a string or number.");case 7:return e.abrupt("return",this.app.request.post({url:this.app.urls.userCreateConfirmationURL(t)}));case 8:case"end":return e.stop()}}),e,this)}))),function(e){return g.apply(this,arguments)})},{key:"update",value:(b=(0,i.default)(o.default.mark((function e(t){var r=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.app.request.put({url:this.app.urls.userObject(t.objectId),data:t}).then((function(e){return r.dataStore.parseResponse(e)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return b.apply(this,arguments)})},{key:"findByRole",value:(m=(0,i.default)(o.default.mark((function e(t,r,n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.roles.findByRole(t,r,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return m.apply(this,arguments)})},{key:"getUserRoles",value:(v=(0,i.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.roles.getUserRoles(t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return v.apply(this,arguments)})},{key:"assignRole",value:(y=(0,i.default)(o.default.mark((function e(t,r){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.roles.assignRole(t,r));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return y.apply(this,arguments)})},{key:"unassignRole",value:(d=(0,i.default)(o.default.mark((function e(t,r){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.roles.unassignRole(t,r));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)})},{key:"describeUserClass",value:(s=(0,i.default)(o.default.mark((function e(){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.app.request.get({url:this.app.urls.userClassProps()}));case 1:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"enableUser",value:(n=(0,i.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.updateUserStatus(t,"ENABLED"));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"disableUser",value:(r=(0,i.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.updateUserStatus(t,"DISABLED"));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"updateUserStatus",value:(t=(0,i.default)(o.default.mark((function e(t,r){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&("string"==typeof t||"number"==typeof t)){e.next=2;break}throw new Error("User objectId must be non empty string/number");case 2:if(r&&"string"==typeof r){e.next=4;break}throw new Error("User Status must be a valid string");case 4:return e.abrupt("return",this.app.request.put({url:this.app.urls.userStatus(t),data:{userStatus:r}}));case 5:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})},{key:"getAuthorizationUrlLink",value:function(e,t,r,n,o,s){return this.app.request.post({url:this.app.urls.userAuthorizationURL(e),data:{fieldsMapping:t,permissions:r,redirect:n,redirectAfterLoginUrl:o,callbackUrlDomain:s}})}},{key:"loggedInUser",value:function(){return this.getCurrentUserId()}},{key:"getCurrentUserToken",value:function(){return this.currentUser&&this.currentUser["user-token"]?this.currentUser["user-token"]:this.app.LocalCache.get(this.app.LocalCache.Keys.USER_TOKEN)||null}},{key:"setCurrentUserToken",value:function(e){e=e||null,this.currentUser&&(this.currentUser["user-token"]=e),this.app.LocalCache.get("user-token")&&this.app.LocalCache.set("user-token",e),this.app.__RT&&this.app.RT.updateUserTokenIfNeeded()}},{key:"getCurrentUserId",value:function(){return this.currentUser?this.currentUser.objectId:this.app.LocalCache.get(this.app.LocalCache.Keys.CURRENT_USER_ID)||null}},{key:"getLocalCurrentUser",value:function(){return this.currentUser}},{key:"setLocalCurrentUser",value:function(e,t){return this.setCurrentUser(e,t)}}]),e}();t.Z=y},8332:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(4687)),s=n(r(8698)),i=n(r(7156)),a=n(r(6690)),u=n(r(9728)),c=n(r(3082)),l=function(){function e(t){(0,a.default)(this,e),this.users=t,this.app=t.app}var t,r,n,l,f;return(0,u.default)(e,[{key:"findByRole",value:(f=(0,i.default)(o.default.mark((function e(t,r,n){var i,a=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Role Name must be a string and can not be empty");case 2:if(null==r||"boolean"==typeof r){e.next=4;break}throw new Error('The second argument "loadRoles" can be a boolean only');case 4:if(null==n||!Array.isArray(n)&&"object"===(0,s.default)(n)){e.next=6;break}throw new Error('The third argument "query" can be an instance of DataQueryBuilder or a plain object only');case 6:return i=[],"boolean"==typeof r&&i.push("loadRoles=".concat(r)),n&&i.push(c.default.toQueryString(n)),e.abrupt("return",this.app.request.get({url:this.app.urls.usersRole(t),queryString:i.join("&")}).then((function(e){return a.users.dataStore.parseResponse(e)})));case 10:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return f.apply(this,arguments)})},{key:"getUserRoles",value:(l=(0,i.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.app.request.get({url:this.app.urls.userRoles(t)}));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"assignRole",value:(n=(0,i.default)(o.default.mark((function e(t,r){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.changeRole(t,r,"assignRole"));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"unassignRole",value:(r=(0,i.default)(o.default.mark((function e(t,r){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.changeRole(t,r,"unassignRole"));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"changeRole",value:(t=(0,i.default)(o.default.mark((function e(t,r,n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&("string"==typeof t||"number"==typeof t)){e.next=2;break}throw new Error("User identity must be a string or number and can not be empty.");case 2:if(r&&"string"==typeof r){e.next=4;break}throw new Error("Role Name must be a string and can not be empty.");case 4:return e.abrupt("return",this.app.request.post({url:this.app.urls.userRoleOperation(n),data:{user:t,roleName:r}}));case 5:case"end":return e.stop()}}),e,this)}))),function(e,r,n){return t.apply(this,arguments)})}]),e}();t.default=l},870:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.SocialContainer=void 0;var o=n(r(6690)),s=n(r(9728)),i=function(){function e(t,r){(0,o.default)(this,e),this.socialType=t,this.container=r,r?this.processContainer():this.createContainer()}return(0,s.default)(e,[{key:"processContainer",value:function(){var e,t=this,r=this.container[0]||this.container,n=document.createElement("div");n.innerHTML="Loading...",r.appendChild(n),r.style.cursor="wait",this.closeContainer=function(){r.style.cursor="default",r.removeChild(e)},this.removeLoading=function(){r.removeChild(n)},this.doAuthorizationActivity=function(n){t.removeLoading(),(e=document.createElement("iframe")).frameBorder=0,e.width=r.style.width,e.height=r.style.height,e.id="SocialAuthFrame",e.setAttribute("src",n+"&output=embed"),r.appendChild(e),e.onload=function(){r.style.cursor="default"}}}},{key:"createContainer",value:function(){var e=window.open("",this.socialType+" authorization","resizable=yes, scrollbars=yes, titlebar=yes, top=10, left=10");e.document.getElementsByTagName("body")[0].innerHTML="Loading...",e.document.getElementsByTagName("html")[0].style.cursor="wait",this.closeContainer=function(){e.close()},this.doAuthorizationActivity=function(t){e.location.href=t,e.onload=function(){e.document.getElementsByTagName("html")[0].style.cursor="default"}}}}]),e}();t.SocialContainer=i},1571:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(4687)),s=n(r(7156)),i=n(r(6690)),a=n(r(9728)),u=n(r(5602)),c=r(870),l=function(){function e(t){(0,i.default)(this,e),this.users=t,this.app=t.app}var t,r,n,l,d,h,y,v,m;return(0,a.default)(e,[{key:"loginWithFacebook",value:(m=(0,s.default)(o.default.mark((function e(t,r,n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.loginWithContainer("facebook",t,r,null,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return m.apply(this,arguments)})},{key:"loginWithGooglePlus",value:(v=(0,s.default)(o.default.mark((function e(t,r,n,s){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.loginWithContainer("googleplus",t,r,n,s));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n){return v.apply(this,arguments)})},{key:"loginWithTwitter",value:(y=(0,s.default)(o.default.mark((function e(t,r){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.loginWithContainer("twitter",t,null,null,r));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return y.apply(this,arguments)})},{key:"loginWithFacebookSdk",value:(h=(0,s.default)(o.default.mark((function e(t,r,n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.sendWithAccessToken("facebook",t,r,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return h.apply(this,arguments)})},{key:"loginWithGooglePlusSdk",value:(d=(0,s.default)(o.default.mark((function e(t,r,n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.sendWithAccessToken("googleplus",t,r,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return d.apply(this,arguments)})},{key:"sendWithAccessToken",value:(l=(0,s.default)(o.default.mark((function e(t,r,n,s){var i=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r&&"string"==typeof r){e.next=2;break}throw new Error('"accessToken" must be non empty string.');case 2:return"boolean"==typeof n&&(s=n,n=void 0),e.abrupt("return",this.app.request.post({url:this.app.urls.userSocialLogin(t),data:{accessToken:r,fieldsMapping:n}}).then((function(e){return i.users.setCurrentUser(e,s)})));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n){return l.apply(this,arguments)})},{key:"loginWithContainer",value:(n=(0,s.default)(o.default.mark((function e(t,r,n,s,i){var a,u,l=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=new c.SocialContainer(t,s),u=function(){return new Promise((function(e,t){f("message",window,(function r(n){if(n.origin===l.app.serverURL){var o=JSON.parse(n.data);o.fault?t(new Error(o.fault)):e(o),p("message",window,r),a.closeContainer()}}))}))},e.abrupt("return",this.app.request.post({url:this.app.urls.userSocialOAuth(t),data:{fieldsMapping:r||{},permissions:n||[]}}).then((function(e){return a.doAuthorizationActivity(e)})).catch((function(e){throw a.closeContainer(),e})).then(u).then((function(e){return l.users.setCurrentUser(e,i)})));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t,r,o,s){return n.apply(this,arguments)})},{key:"loginWithOauth2",value:(r=(0,s.default)(o.default.mark((function e(t,r,n,s,i){var a=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error('"providerCode" must be non empty string.');case 2:if(r&&"string"==typeof r){e.next=4;break}throw new Error('"accessToken" must be non empty string.');case 4:return!n||n instanceof u.default||(i=s,s=n,n=void 0),"boolean"==typeof s&&(i=s,s=void 0),e.abrupt("return",this.app.request.post({url:this.app.urls.userOAuthLogin(t),data:{accessToken:r,fieldsMapping:s,guestUser:n}}).then((function(e){return a.users.setCurrentUser(e,i)})));case 7:case"end":return e.stop()}}),e,this)}))),function(e,t,n,o,s){return r.apply(this,arguments)})},{key:"loginWithOauth1",value:(t=(0,s.default)(o.default.mark((function e(t,r,n,s,i,a){var c=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error('"providerCode" must be non empty string.');case 2:if(r&&"string"==typeof r){e.next=4;break}throw new Error('"accessToken" must be non empty string.');case 4:if(n&&"string"==typeof n){e.next=6;break}throw new Error('"accessTokenSecret" must be non empty string.');case 6:return!s||s instanceof u.default||(a=i,i=s,s=void 0),"boolean"==typeof i&&(a=i,i=void 0),e.abrupt("return",this.app.request.post({url:this.app.urls.userOAuthLogin(t),data:{accessToken:r,accessTokenSecret:n,fieldsMapping:i,guestUser:s}}).then((function(e){return c.users.setCurrentUser(e,a)})));case 9:case"end":return e.stop()}}),e,this)}))),function(e,r,n,o,s,i){return t.apply(this,arguments)})}]),e}();function f(e,t,r){t.addEventListener?t.addEventListener(e,r,!1):t.attachEvent?t.attachEvent("on"+e,r):t[e]=r}function p(e,t,r){t.removeEventListener?t.removeEventListener(e,r,!1):t.detachEvent&&t.detachEvent("on"+e,r),t[e]=null}t.default=l},5602:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(6690)),s=n(r(9728)),i=function(){function e(t){var r=this;(0,o.default)(this,e),t=t||{},Object.keys(t).map((function(e){r[e]=t[e]})),this.___class=e.className}return(0,s.default)(e,null,[{key:"className",get:function(){return"Users"}}]),e}();t.default=i,i.prototype.___class=i.className},9211:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UsersUtils=void 0;var r={getClientUserLocale:function(){if("undefined"!=typeof navigator){return(navigator.languages&&navigator.languages.length?navigator.languages[0]:navigator.userLanguage||navigator.language||navigator.browserLanguage||navigator.systemLanguage||"").slice(0,2).toLowerCase()}}};t.UsersUtils=r},9853:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(8698)),s={isBrowser:i(),isLocalStorageSupported:function(){try{if(i()&&window.localStorage)return localStorage.setItem("localStorageTest",!0),localStorage.removeItem("localStorageTest"),!0}catch(e){}return!1}(),globalScope:"object"===("undefined"==typeof self?"undefined":(0,o.default)(self))&&self.self===self&&self||"object"===(void 0===r.g?"undefined":(0,o.default)(r.g))&&r.g.global===r.g&&r.g,castArray:function(e){return Array.isArray(e)?e:void 0===e?[]:[e]},isCustomClassInstance:function(e){return!(!e||"object"!==(0,o.default)(e)||Array.isArray(e))&&e.constructor!==Object},getClassName:function(e){if(e&&e.className)return e.className;if("function"==typeof e&&e.name)return e.name;if(e&&"object"===(0,o.default)(e)&&!Array.isArray(e)){if(e.___class)return e.___class;if(e.constructor!==Object)return s.getClassName(e.constructor)}return null},uuid:function(){var e=function(){return Math.random().toString(16).slice(-4).toUpperCase()};return"".concat("".concat(e()).concat(e()),"-").concat(e(),"-").concat(e(),"-").concat(e(),"-").concat("".concat(e()).concat(e()).concat(e()))},isObject:function(e){return null!=e&&"Object"===e.constructor.name}};function i(){return"object"===("undefined"==typeof self?"undefined":(0,o.default)(self))&&self.self===self&&"object"===("undefined"==typeof window?"undefined":(0,o.default)(window))&&window===self}var a=s;t.default=a},3930:function(e,t){var r,n;r="undefined"!=typeof self?self:this,n=function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=3)}([function(e,t,r){"use strict";(function(e){function n(e){return(n="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})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.castArray=void 0,t.getFormData=i,t.isStream=t.isObject=t.isNodeJS=t.isFormData=t.isBrowser=void 0,t.setFormData=function(e){s=e},t.castArray=function(e){return Array.isArray(e)?e:[e]},t.isObject=function(e){return null!=e&&"object"===n(e)},t.isFormData=function(e){return!!e&&(e instanceof i()||e&&e.constructor&&0===e.constructor.toString().trim().indexOf("function FormData"))},t.isStream=function(e){return e instanceof r(6).Stream};var o=t.isNodeJS=function(){return void 0!==e&&null!=e.versions&&null!=e.versions.node},s=(t.isBrowser=function(){return"undefined"!=typeof window&&void 0!==window.document},null);function i(){return s||(o()||"undefined"==typeof FormData?r(7):FormData)}}).call(t,r(5))},function(e,t){throw new Error('This Backendless JS SDK assembly is not intended for Node.js environment. You should use "lib" folder modules instead. For any questions please contact as at http://support.backendless.com/')},function(e,t,r){"use strict";function n(e){return(n="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})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.Request=void 0;var o,s=r(12),i=(o=r(13))&&o.__esModule?o:{default:o},a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var r=l(t);if(r&&r.has(e))return r.get(e);var o={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var a=s?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(o,i,a):o[i]=e[i]}return o.default=e,r&&r.set(e,o),o}(r(14)),u=r(0),c=r(15);function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(l=function(e){return e?r:t})(e)}function f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function p(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?f(Object(r),!0).forEach((function(t){d(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function d(e,t,r){return(t=y(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function h(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,y(n.key),n)}}function y(e){var t=function(e,t){if("object"!==n(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!==n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===n(t)?t:String(t)}function v(e,t){return(v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function m(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=g(e);if(t){var o=g(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return b(this,r)}}function b(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function g(e){return(g=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function w(e){try{return p(p({},e),{},{body:JSON.parse(e.body)})}catch(t){return e}}function k(e){if(e.status>=200&&e.status<300)return e;throw new c.ResponseError(e)}t.Request=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&v(e,t)}(i,e);var t,r,n,o=m(i);function i(e,t,r){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(n=o.call(this)).method=t,n.path=e,n.body=r,n.tags=void 0,n.unwrap=!0,n.cacheTTL=0,n.headers={},n.queryParams={},n.encoding="utf8",n.timeout=0,n.withCredentials=null,n}return t=i,(r=[{key:"set",value:function(e,t){if((0,u.isObject)(e))for(var r in e)this.set(r,e[r]);else void 0!==t&&(this.headers[e]=t);return this}},{key:"cacheTags",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.tags=t,this}},{key:"query",value:function(e){return Object.assign(this.queryParams,e),this}},{key:"form",value:function(e){if(e){var t=i.FormData;if(e instanceof t)this.body=e;else{var r=new t,n=function(t){t&&(0,u.castArray)(e[t]).forEach((function(e){e&&e.hasOwnProperty("value")&&e.hasOwnProperty("options")?r.append(t,e.value,e.options):r.append(t,e)}))};for(var o in e)n(o);this.body=r}}return this}},{key:"useCache",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15e3;return this.cacheTTL=e,this}},{key:"resetCache",value:function(e){return e&&this.tags&&s.cache.deleteByTags(this.tags),this}},{key:"type",value:function(e){return this.set("Content-Type",e),this}},{key:"unwrapBody",value:function(e){return this.unwrap=e,this}},{key:"setEncoding",value:function(e){return this.encoding=e,this}},{key:"setWithCredentials",value:function(e){return this.withCredentials=e,this}},{key:"setTimeout",value:function(e){return this.timeout=e,this}},{key:"send",value:function(e){var t=this;this.emit("request",this);var r=this.path,n=a.stringify(this.queryParams);if(n&&(r+="?"+n),this.cacheTTL){var o=s.cache.get(r);if(void 0!==o)return Promise.resolve(o)}this.headers["Content-Type"]||!(0,u.isObject)(e)||(0,u.isFormData)(e)||this.type("application/json"),e&&(e="application/json"===this.headers["Content-Type"]&&"string"!=typeof e?JSON.stringify(e):e),i.verbose&&console.log(this.method.toUpperCase(),decodeURIComponent(r),e,this.headers);var c="boolean"==typeof this.withCredentials?this.withCredentials:i.withCredentials,l=i.send(r,this.method.toUpperCase(),this.headers,e,this.encoding,this.timeout,c).then(w).then(k).then((function(e){return t.unwrap?e.body:e})).then((function(e){return t.cacheTTL&&s.cache.set(r,e,t.tags,t.cacheTTL),e})).then((function(e){return t.tags&&"get"!==t.method&&s.cache.deleteByTags(t.tags),e}));return l.then((function(e){t.emit("response",e),t.emit("done",null,e)})).catch((function(e){t.emit("error",e),t.emit("done",e)})),l}},{key:"then",value:function(e,t){return this.promise=this.promise||this.send(this.body),this.promise.then(e,t)}},{key:"catch",value:function(e){return this.promise=this.promise||this.send(this.body),this.promise.catch(e)}}])&&h(t.prototype,r),n&&h(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(i.default)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(4),o=r(11),s=r(2),i=r(0);Object.defineProperty(s.Request,"FormData",{get:function(){return(0,i.getFormData)()},set:function(e){(0,i.setFormData)(e)}}),s.Request.XMLHttpRequest="undefined"!=typeof XMLHttpRequest?XMLHttpRequest:void 0,s.Request.send=function(e,t,r,i,a,u,c){return(void 0!==s.Request.XMLHttpRequest?o.sendXmlHttpRequest:n.sendNodeAPIRequest)(e,t,r,i,a,u,c)},s.Request.verbose=!1,s.Request.withCredentials=!1,s.Request.methods=["get","post","put","patch","delete"],s.Request.methods.forEach((function(e){s.Request[e]=function(t,r){return new s.Request(t,e,r)}})),(t=e.exports=s.Request).default=s.Request},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sendNodeAPIRequest=function(e,t,o,s,i,a,u){return new Promise((function(c,l){var f=r(8).parse(e),p=(0,n.isFormData)(s)&&s,d="https:"===f.protocol,h={host:f.hostname,port:f.port||(d?443:80),path:f.pathname+(f.search||""),method:t,headers:o,timeout:a};"boolean"==typeof u&&(h.withCredentials=u);var y=function(){var e=r(1).Buffer,t=r(d?9:10).request(h,(function(t){var r=[],n=[],o=0,s="",a=t.statusCode,u=t.statusMessage,f=t.headers;t.on("data",(function(t){e.isBuffer(t)?t.length&&(o+=t.length,n.push(t)):r.push(t)})),t.on("end",(function(){o?(s=e.concat(n,o),null!=i&&(s=s.toString(i))):r.length&&(s=r.join()),c({status:a,statusText:u,headers:f,body:s})})),t.on("error",l)}));if(t.on("error",l),t.on("timeout",(function(){t.destroy(new Error("Connection aborted due to timeout"))})),s){if((0,n.isStream)(s))return void s.pipe(t);t.write(s)}t.end()};if(p)Object.assign(h.headers,p.getHeaders()),p.getLength((function(e,t){e||isNaN(t)||(h.headers["content-length"]=t),y()}));else{if(s&&!h.headers["content-length"]){var v=r(1).Buffer;h.headers["content-length"]=v.byteLength(s)}y()}}))};var n=r(0)},function(e,t){var r,n,o=e.exports={};function s(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function a(e){if(r===setTimeout)return setTimeout(e,0);if((r===s||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:s}catch(e){r=s}try{n="function"==typeof clearTimeout?clearTimeout:i}catch(e){n=i}}();var u,c=[],l=!1,f=-1;function p(){l&&u&&(l=!1,u.length?c=u.concat(c):f=-1,c.length&&d())}function d(){if(!l){var e=a(p);l=!0;for(var t=c.length;t;){for(u=c,c=[];++f<t;)u&&u[f].run();f=-1,t=c.length}u=null,l=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===i||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function y(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];c.push(new h(e,t)),1!==c.length||l||a(d)},h.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=y,o.addListener=y,o.once=y,o.off=y,o.removeListener=y,o.removeAllListeners=y,o.emit=y,o.prependListener=y,o.prependOnceListener=y,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t){throw new Error('This Backendless JS SDK assembly is not intended for Node.js environment. You should use "lib" folder modules instead. For any questions please contact as at http://support.backendless.com/')},function(e,t){throw new Error('This Backendless JS SDK assembly is not intended for Node.js environment. You should use "lib" folder modules instead. For any questions please contact as at http://support.backendless.com/')},function(e,t){throw new Error('This Backendless JS SDK assembly is not intended for Node.js environment. You should use "lib" folder modules instead. For any questions please contact as at http://support.backendless.com/')},function(e,t){throw new Error('This Backendless JS SDK assembly is not intended for Node.js environment. You should use "lib" folder modules instead. For any questions please contact as at http://support.backendless.com/')},function(e,t){throw new Error('This Backendless JS SDK assembly is not intended for Node.js environment. You should use "lib" folder modules instead. For any questions please contact as at http://support.backendless.com/')},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sendXmlHttpRequest=function(e,t,r,o,s,i,a){return new Promise((function(u,c){var l=new n.Request.XMLHttpRequest;l.timeout=i,s||(l.responseType="arraybuffer"),l.open(t.toUpperCase(),e,!0),"boolean"==typeof a&&(l.withCredentials=a),l.onload=function(){var e,t,r=(e=l.getAllResponseHeaders(),t={},e?(e.split("\n").forEach((function(e){var r=e.indexOf(":"),n=e.substr(0,r).trim(),o=e.substr(r+1).trim();n&&(t[n]=t[n]?t[n]+", "+o:o)})),t):t),n=l,o={status:n.status,statusText:n.statusText,headers:r};"utf8"===s?o.body=l.response||l.responseText:l.response&&(o.body=new Uint8Array(l.response)),u(o),l=null},l.onerror=function(){c(new Error("Network Error")),l=null},l.ontimeout=function(){c(new Error("Connection aborted due to timeout")),l=null},Object.keys(r).forEach((function(e){l.setRequestHeader(e,r[e])})),l.send(o)}))};var n=r(2)},function(e,t,r){"use strict";function n(e){return(n="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})(e)}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,s,i,a=[],u=!0,c=!1;try{if(s=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=s.call(r)).done)&&(a.push(n.value),a.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return a}}(e,t)||i(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=i(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){u=!0,s=e},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}function i(e,t){if(e){if("string"==typeof e)return a(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function u(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,(s=o.key,i=void 0,i=function(e,t){if("object"!==n(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!==n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(s,"string"),"symbol"===n(i)?i:String(i)),o)}var s,i}Object.defineProperty(t,"__esModule",{value:!0}),t.cache=void 0;var c=function(){return(new Date).getTime()},l=function(e,t){return!!e.find((function(e){return t.find((function(t){return function(e,t){var r=e==t;return!r&&e instanceof RegExp&&(r=e.test(t)),!r&&t instanceof RegExp&&(r=t.test(e)),r}(e,t)}))}))},f=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.setFlushInterval(t),this.map=new Map}var t,r,n;return t=e,(r=[{key:"setFlushInterval",value:function(e){this.flushInterval=e,this.flushTimer&&(clearInterval(this.flushTimer),delete this.flushTimer)}},{key:"get",value:function(e){var t=this.map.get(e);if(t){if(t.ttl>c())return t.value;this.map.delete(e)}}},{key:"set",value:function(e,t,r,n){this.map.set(e,function(e,t,r){return{value:e,tags:t,ttl:r}}(t,r,c()+n)),this.flushInterval&&!this.flushTimer&&(this.flushTimer=setInterval(this.flush.bind(this),this.flushInterval),this.flushTimer.unref&&this.flushTimer.unref())}},{key:"delete",value:function(e){this.map.delete(e)}},{key:"deleteAll",value:function(){var e,t=s(this.map);try{for(t.s();!(e=t.n()).done;){var r=o(e.value,1)[0];this.delete(r)}}catch(e){t.e(e)}finally{t.f()}}},{key:"deleteByTags",value:function(e){var t,r=s(this.map);try{for(r.s();!(t=r.n()).done;){var n=o(t.value,2),i=n[0],a=n[1];a.tags&&l(e,a.tags)&&this.delete(i)}}catch(e){r.e(e)}finally{r.f()}}},{key:"flush",value:function(){var e,t=c(),r=s(this.map);try{for(r.s();!(e=r.n()).done;){var n=o(e.value,2),i=n[0];n[1].ttl<t&&this.delete(i)}}catch(e){r.e(e)}finally{r.f()}}}])&&u(t.prototype,r),n&&u(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();t.cache=new f(6e4)},function(e,t,r){"use strict";function n(e){return(n="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})(e)}function o(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,(s=o.key,i=void 0,i=function(e,t){if("object"!==n(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!==n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(s,"string"),"symbol"===n(i)?i:String(i)),o)}var s,i}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.events={}}var t,r,n;return t=e,(r=[{key:"on",value:function(e,t){return this.events[e]=this.events[e]||[],this.events[e].push(t),this}},{key:"off",value:function(e,t){return e?this.events[e]&&(t?this.events[e]=this.events[e].filter((function(e){return e!==t})):delete this.events[e]):this.events={},this}},{key:"emit",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];this.events[e]&&this.events[e].forEach((function(e){return e.apply(void 0,r)}))}}])&&o(t.prototype,r),n&&o(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stringify=void 0;var n=r(0);t.stringify=function(e){var t=[];return Object.keys(e).forEach((function(r){var o=e[r];void 0!==o&&(0,n.castArray)(o).forEach((function(e){t.push("".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(e)))}))})),t.join("&")}},function(e,t,r){"use strict";function n(e){return(n="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})(e)}function o(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,(s=o.key,i=void 0,i=function(e,t){if("object"!==n(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!==n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(s,"string"),"symbol"===n(i)?i:String(i)),o)}var s,i}function s(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function i(e){var t="function"==typeof Map?new Map:void 0;return(i=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return a(e,arguments,l(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),c(n,e)})(e)}function a(e,t,r){return(a=u()?Reflect.construct.bind():function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&c(o,r.prototype),o}).apply(null,arguments)}function u(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function c(e,t){return(c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.ResponseError=void 0,t.ResponseError=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&c(e,t)}(p,e);var t,r,n,i,a,f=(t=p,r=u(),function(){var e,n=l(t);if(r){var o=l(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return s(this,e)});function p(e){var t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,p),t=f.call(this);var r,n=502===(r=e).status?"No connection with server":r.body||"Status Code ".concat(r.status," (").concat(r.statusText,")");return t.message=n.message||n,t.code=n.code,t.status=e.status,t.headers=e.headers,t.body=e.body,t}return n=p,i&&o(n.prototype,i),a&&o(n,a),Object.defineProperty(n,"prototype",{writable:!1}),n}(i(Error))}])},"object"==typeof t&&"object"==typeof e?e.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof t?t.BackendlessRequest=n():r.BackendlessRequest=n()},5786:(e,t)=>{var r,n,o,s;self,s=()=>(()=>{var e={"./node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js":e=>{e.exports=function(e,t,r,n,o){var s={};return Object.keys(n).forEach((function(e){s[e]=n[e]})),s.enumerable=!!s.enumerable,s.configurable=!!s.configurable,("value"in s||s.initializer)&&(s.writable=!0),s=r.slice().reverse().reduce((function(r,n){return n(e,t,r)||r}),s),o&&void 0!==s.initializer&&(s.value=s.initializer?s.initializer.call(o):void 0,s.initializer=void 0),void 0===s.initializer&&(Object.defineProperty(e,t,s),s=null),s},e.exports.__esModule=!0,e.exports.default=e.exports},"./node_modules/@babel/runtime/helpers/assertThisInitialized.js":e=>{e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports},"./node_modules/@babel/runtime/helpers/asyncToGenerator.js":e=>{function t(e,t,r,n,o,s,i){try{var a=e[s](i),u=a.value}catch(e){return void r(e)}a.done?t(u):Promise.resolve(u).then(n,o)}e.exports=function(e){return function(){var r=this,n=arguments;return new Promise((function(o,s){var i=e.apply(r,n);function a(e){t(i,o,s,a,u,"next",e)}function u(e){t(i,o,s,a,u,"throw",e)}a(void 0)}))}},e.exports.__esModule=!0,e.exports.default=e.exports},"./node_modules/@babel/runtime/helpers/classCallCheck.js":e=>{e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},"./node_modules/@babel/runtime/helpers/createClass.js":e=>{function t(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},"./node_modules/@babel/runtime/helpers/defineProperty.js":e=>{e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},"./node_modules/@babel/runtime/helpers/get.js":(e,t,r)=>{var n=r("./node_modules/@babel/runtime/helpers/superPropBase.js");function o(){return"undefined"!=typeof Reflect&&Reflect.get?(e.exports=o=Reflect.get.bind(),e.exports.__esModule=!0,e.exports.default=e.exports):(e.exports=o=function(e,t,r){var o=n(e,t);if(o){var s=Object.getOwnPropertyDescriptor(o,t);return s.get?s.get.call(arguments.length<3?e:r):s.value}},e.exports.__esModule=!0,e.exports.default=e.exports),o.apply(this,arguments)}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},"./node_modules/@babel/runtime/helpers/getPrototypeOf.js":e=>{function t(r){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},"./node_modules/@babel/runtime/helpers/inherits.js":(e,t,r)=>{var n=r("./node_modules/@babel/runtime/helpers/setPrototypeOf.js");e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&n(e,t)},e.exports.__esModule=!0,e.exports.default=e.exports},"./node_modules/@babel/runtime/helpers/interopRequireDefault.js":e=>{e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},"./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js":(e,t,r)=>{var n=r("./node_modules/@babel/runtime/helpers/typeof.js").default,o=r("./node_modules/@babel/runtime/helpers/assertThisInitialized.js");e.exports=function(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return o(e)},e.exports.__esModule=!0,e.exports.default=e.exports},"./node_modules/@babel/runtime/helpers/regeneratorRuntime.js":(e,t,r)=>{var n=r("./node_modules/@babel/runtime/helpers/typeof.js").default;function o(){"use strict";e.exports=o=function(){return t},e.exports.__esModule=!0,e.exports.default=e.exports;var t={},r=Object.prototype,s=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function f(e,t,r,n){var o=t&&t.prototype instanceof h?t:h,s=Object.create(o.prototype),i=new R(n||[]);return s._invoke=function(e,t,r){var n="suspendedStart";return function(o,s){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw s;return{value:void 0,done:!0}}for(r.method=o,r.arg=s;;){var i=r.delegate;if(i){var a=O(i,r);if(a){if(a===d)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=p(e,t,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===d)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(e,r,i),s}function p(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=f;var d={};function h(){}function y(){}function v(){}var m={};l(m,a,(function(){return this}));var b=Object.getPrototypeOf,g=b&&b(b(x([])));g&&g!==r&&s.call(g,a)&&(m=g);var w=v.prototype=h.prototype=Object.create(m);function k(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){var r;this._invoke=function(o,i){function a(){return new t((function(r,a){!function r(o,i,a,u){var c=p(e[o],e,i);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==n(f)&&s.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,a,u)}),(function(e){r("throw",e,a,u)})):t.resolve(f).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,u)}))}u(c.arg)}(o,i,r,a)}))}return r=r?r.then(a,a):a()}}function O(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,O(e,t),"throw"===t.method))return d;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var n=p(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,d;var o=n.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function _(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function R(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function x(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,n=function t(){for(;++r<e.length;)if(s.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return n.next=n}}return{next:j}}function j(){return{value:void 0,done:!0}}return y.prototype=v,l(w,"constructor",v),l(v,"constructor",y),y.displayName=l(v,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,v):(e.__proto__=v,l(e,c,"GeneratorFunction")),e.prototype=Object.create(w),e},t.awrap=function(e){return{__await:e}},k(E.prototype),l(E.prototype,u,(function(){return this})),t.AsyncIterator=E,t.async=function(e,r,n,o,s){void 0===s&&(s=Promise);var i=new E(f(e,r,n,o),s);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},k(w),l(w,c,"Generator"),l(w,a,(function(){return this})),l(w,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=x,R.prototype={constructor:R,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(_),!e)for(var t in this)"t"===t.charAt(0)&&s.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n],i=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var a=s.call(o,"catchLoc"),u=s.call(o,"finallyLoc");if(a&&u){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&s.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),_(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;_(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:x(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},t}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},"./node_modules/@babel/runtime/helpers/setPrototypeOf.js":e=>{function t(r,n){return e.exports=t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r,n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},"./node_modules/@babel/runtime/helpers/superPropBase.js":(e,t,r)=>{var n=r("./node_modules/@babel/runtime/helpers/getPrototypeOf.js");e.exports=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=n(e)););return e},e.exports.__esModule=!0,e.exports.default=e.exports},"./node_modules/@babel/runtime/helpers/typeof.js":e=>{function t(r){return e.exports=t="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},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},"./node_modules/@babel/runtime/regenerator/index.js":(e,t,r)=>{const n=r("./node_modules/@babel/runtime/helpers/regeneratorRuntime.js")();e.exports=n;try{regeneratorRuntime=n}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}},"./node_modules/after/index.js":e=>{function t(){}e.exports=function(e,r,n){var o=!1;return n=n||t,s.count=e,0===e?r():s;function s(e,t){if(s.count<=0)throw new Error("after called too many times");--s.count,e?(o=!0,r(e),r=n):0!==s.count||o||r(null,t)}}},"./node_modules/arraybuffer.slice/index.js":e=>{e.exports=function(e,t,r){var n=e.byteLength;if(t=t||0,r=r||n,e.slice)return e.slice(t,r);if(t<0&&(t+=n),r<0&&(r+=n),r>n&&(r=n),t>=n||t>=r||0===n)return new ArrayBuffer(0);for(var o=new Uint8Array(e),s=new Uint8Array(r-t),i=t,a=0;i<r;i++,a++)s[a]=o[i];return s.buffer}},"./src/client.js":(e,t,r)=>{"use strict";var n=r("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r("./node_modules/@babel/runtime/helpers/classCallCheck.js")),s=n(r("./node_modules/@babel/runtime/helpers/createClass.js")),i=n(r("./node_modules/@babel/runtime/helpers/defineProperty.js")),a=r("./src/constants.js"),u=n(r("./src/config.js")),c=n(r("./src/subscriptions.js")),l=n(r("./src/methods.js")),f=n(r("./src/session.js")),p=[a.NativeSocketEvents.CONNECTING,a.NativeSocketEvents.CONNECT,a.NativeSocketEvents.CONNECT_ERROR,a.NativeSocketEvents.DISCONNECT,a.NativeSocketEvents.RECONNECT_ATTEMPT],d=function(){function e(t){var r=this;(0,o.default)(this,e),(0,i.default)(this,"onConnectError",(function(){r.subscriptions.hasActivity()||r.methods.hasActivity()||(r.disconnect("There are no active subscriptions and methods"),r.connectible=!0)})),(0,i.default)(this,"connectOnMethod",(function(e){return function(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];if(r.connectible){var s=r.provideConnection();r.connected&&s.then((function(t){return t[e].apply(t,n)}))}}})),(0,i.default)(this,"on",this.connectOnMethod("on")),(0,i.default)(this,"emit",this.connectOnMethod("emit")),(0,i.default)(this,"onSessionDisconnect",(function(){r.subscriptions.stop(),r.methods.stop(),delete r.session,r.provideConnection()})),(0,i.default)(this,"emitSocketEventListeners",(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];r.socketEvents[e]&&r.socketEvents[e].forEach((function(e){return e.apply(void 0,n)}))})),(0,i.default)(this,"addConnectingEventListener",(function(e){return r.addSocketEventListener(a.NativeSocketEvents.CONNECTING,e)})),(0,i.default)(this,"removeConnectingEventListener",(function(e){return r.removeSocketEventListener(a.NativeSocketEvents.CONNECTING,e)})),(0,i.default)(this,"addConnectEventListener",(function(e){return r.addSocketEventListener(a.NativeSocketEvents.CONNECT,e)})),(0,i.default)(this,"removeConnectEventListener",(function(e){return r.removeSocketEventListener(a.NativeSocketEvents.CONNECT,e)})),(0,i.default)(this,"addConnectErrorEventListener",(function(e){return r.addSocketEventListener(a.NativeSocketEvents.CONNECT_ERROR,e)})),(0,i.default)(this,"removeConnectErrorEventListener",(function(e){return r.removeSocketEventListener(a.NativeSocketEvents.CONNECT_ERROR,e)})),(0,i.default)(this,"addDisconnectEventListener",(function(e){return r.addSocketEventListener(a.NativeSocketEvents.DISCONNECT,e)})),(0,i.default)(this,"removeDisconnectEventListener",(function(e){return r.removeSocketEventListener(a.NativeSocketEvents.DISCONNECT,e)})),(0,i.default)(this,"addReconnectAttemptEventListener",(function(e){return r.addSocketEventListener(a.NativeSocketEvents.RECONNECT_ATTEMPT,e)})),(0,i.default)(this,"removeReconnectAttemptEventListener",(function(e){return r.removeSocketEventListener(a.NativeSocketEvents.RECONNECT_ATTEMPT,e)})),(0,i.default)(this,"removeConnectionListeners",(function(){p.forEach((function(e){return r.removeSocketEventListener(e)}))})),this.config=new u.default(t),this.resetSocketEvents();var n={onMessage:this.on.bind(this),emitMessage:this.emit.bind(this)};this.subscriptions=new c.default(n),this.methods=new l.default(n),this.connectible=!0,this.connected=!1}return(0,s.default)(e,[{key:"resetSocketEvents",value:function(){this.socketEvents={},this.addConnectErrorEventListener(this.onConnectError)}},{key:"setConfig",value:function(e){this.config.set(e),this.session&&(this.disconnect("Re-config socket connection"),this.connect())}},{key:"provideConnection",value:function(){var e=this;return this.session||(this.session=new f.default(this.config,this.emitSocketEventListeners,this.onSessionDisconnect),this.session.getSocket().then((function(){e.connected=!0,e.methods.initialize(),e.methods.restore(),e.subscriptions.initialize(),e.subscriptions.restore()}))),this.session.getSocket()}},{key:"connect",value:function(){this.connectible=!0,this.provideConnection()}},{key:"disconnect",value:function(e){this.session&&(this.subscriptions.stop(),this.methods.stop(),this.session.terminate(),delete this.session,this.emitSocketEventListeners(a.NativeSocketEvents.DISCONNECT,e||"disconnected by client")),this.connectible=!1,this.connected=!1}},{key:"terminate",value:function(e){this.resetSocketEvents(),this.subscriptions.reset(),this.methods.reset(),this.disconnect(e||"Terminated by client")}},{key:"addSocketEventListener",value:function(e,t){return this.socketEvents[e]=this.socketEvents[e]||[],this.socketEvents[e].push(t),this}},{key:"removeSocketEventListener",value:function(e,t){return this.socketEvents[e]&&(this.socketEvents[e]=t?this.socketEvents[e].filter((function(e){return e!==t})):[],this.socketEvents[e].length||delete this.socketEvents[e]),this}}]),e}();t.default=d},"./src/config.js":(e,t,r)=>{"use strict";var n=r("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r("./node_modules/@babel/runtime/regenerator/index.js")),s=n(r("./node_modules/@babel/runtime/helpers/asyncToGenerator.js")),i=n(r("./node_modules/@babel/runtime/helpers/classCallCheck.js")),a=n(r("./node_modules/@babel/runtime/helpers/createClass.js")),u=n(r("./node_modules/@babel/runtime/helpers/typeof.js")),c=n(r("./node_modules/backendless-request/dist/backendless-request.js")),l=function(e){return void 0===e},f=function(e){return"string"==typeof e},p=function(e){return"function"==typeof e},d=function(e){return"object"===(0,u.default)(e)&&null!==e},h=function(){function e(t){(0,i.default)(this,e),this.appId=null,this.lookupPath=null,this.lookupHeaders={},this.debugMode=!1,this.connectQuery={},this.socketConfigTransform=null,this.socketConfig=null,this.set(t)}var t;return(0,a.default)(e,[{key:"set",value:function(e){if(e){if(!l(e.appId)){if(!f(e.appId))throw new Error('"appId" must be String.');this.appId=e.appId}if(!l(e.lookupPath)){if(!f(e.lookupPath))throw new Error('"lookupPath" must be String.');this.lookupPath=e.lookupPath}if(!l(e.lookupHeaders)){if(!d(e.lookupHeaders))throw new Error('"lookupHeaders" must be Object.');this.lookupHeaders=e.lookupHeaders}if(l(e.debugMode)||(this.debugMode=!!e.debugMode),!l(e.connectQuery))if(p(e.connectQuery))this.getConnectQuery=e.connectQuery;else{if(!d(e.connectQuery))throw new Error('"connectQuery" must be Function or Object.');this.connectQuery=e.connectQuery}if(!l(e.socketConfigTransform)){if(!p(e.socketConfigTransform))throw new Error('"socketConfigTransform" must be Function.');this.socketConfigTransform=e.socketConfigTransform}}}},{key:"getConnectQuery",value:function(){return this.connectQuery}},{key:"prepare",value:(t=(0,s.default)(o.default.mark((function e(){var t,r,n,s,i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(f(this.lookupPath)){e.next=2;break}throw new Error("lookupPath must be String");case 2:return e.next=4,c.default.get(this.lookupPath).set(this.lookupHeaders);case 4:if(t=e.sent,r=this.appId?"".concat(t,"/").concat(this.appId):t,n=this.appId?"/".concat(this.appId):void 0,s=this.getConnectQuery(),this.socketConfig={host:t,url:r,options:{path:n,query:s,forceNew:!0,autoConnect:!1,reconnection:!1}},!this.socketConfigTransform){e.next=14;break}return e.next=12,this.socketConfigTransform(this.socketConfig);case 12:(i=e.sent)&&(this.socketConfig=i);case 14:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"getSocketConfig",value:function(){return this.socketConfig}}]),e}();t.default=h},"./src/constants.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RTSubscriptionTypes=t.RTSocketEvents=t.RTMethodTypes=t.NativeSocketEvents=void 0,t.NativeSocketEvents={CONNECTING:"connecting",CONNECT:"connect",CONNECT_ERROR:"connect_error",CONNECT_TIMEOUT:"connect_timeout",DISCONNECT:"disconnect",RECONNECT:"reconnect",RECONNECT_ATTEMPT:"reconnect_attempt",RECONNECTING:"reconnecting",RECONNECT_ERROR:"reconnect_error",RECONNECT_FAILED:"reconnect_failed",ERROR:"error",PING:"ping",PONG:"pong"},t.RTSocketEvents={SUB_ON:"SUB_ON",SUB_OFF:"SUB_OFF",SUB_RES:"SUB_RES",SUB_READY:"SUB_READY",MET_REQ:"MET_REQ",MET_RES:"MET_RES"},t.RTSubscriptionTypes={OBJECTS_CHANGES:"OBJECTS_CHANGES",RELATIONS_CHANGES:"RELATIONS_CHANGES",PUB_SUB_CONNECT:"PUB_SUB_CONNECT",PUB_SUB_MESSAGES:"PUB_SUB_MESSAGES",PUB_SUB_COMMANDS:"PUB_SUB_COMMANDS",PUB_SUB_USERS:"PUB_SUB_USERS",RSO_CONNECT:"RSO_CONNECT",RSO_CHANGES:"RSO_CHANGES",RSO_CLEARED:"RSO_CLEARED",RSO_COMMANDS:"RSO_COMMANDS",RSO_INVOKE:"RSO_INVOKE",RSO_USERS:"RSO_USERS",LOGGING_MESSAGES:"LOGGING_MESSAGES",CONSOLE_MESSAGES:"CONSOLE_MESSAGES",DEVELOPER_MESSAGES:"DEVELOPER_MESSAGES"},t.RTMethodTypes={SET_USER_TOKEN:"SET_USER_TOKEN",RSO_GET:"RSO_GET",RSO_SET:"RSO_SET",RSO_CLEAR:"RSO_CLEAR",RSO_COMMAND:"RSO_COMMAND",RSO_INVOKE:"RSO_INVOKE",PUB_SUB_COMMAND:"PUB_SUB_COMMAND"}},"./src/index.js":(e,t,r)=>{"use strict";var n=r("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.RTScopeConnector=t.RTListeners=void 0;var o=n(r("./node_modules/@babel/runtime/helpers/typeof.js")),s=n(r("./node_modules/backendless-request/dist/backendless-request.js")),i=n(r("./src/client.js")),a=n(r("./src/listeners.js")),u=n(r("./src/scope-connector.js")),c="object"===("undefined"==typeof self?"undefined":(0,o.default)(self))&&self.self===self&&self||"object"===(void 0===r.g?"undefined":(0,o.default)(r.g))&&r.g.global===r.g&&r.g;i.default.Request=s.default,i.default.Listeners=a.default,i.default.ScopeConnector=u.default,c&&(c.BackendlessRTClient=i.default),e.exports=i.default;var l=i.default;t.default=l;var f=a.default;t.RTListeners=f;var p=u.default;t.RTScopeConnector=p},"./src/listeners.js":(e,t,r)=>{"use strict";var n=r("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r("./node_modules/@babel/runtime/helpers/defineProperty.js")),s=n(r("./node_modules/@babel/runtime/helpers/classCallCheck.js")),i=n(r("./node_modules/@babel/runtime/helpers/createClass.js"));function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){(0,o.default)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var c=function(){function e(){(0,s.default)(this,e),this.subscriptions={},this.simpleListeners={}}return(0,i.default)(e,[{key:"addSubscription",value:function(e,t,r){var n=this,o=r.callback,s=r.onError,i=r.onReady,a=r.parser,c=r.params;this.subscriptions[e]=this.subscriptions[e]||[];var l=t(u(u({},c),this.getSubscriptionOptions()),{parser:a,onData:o,onError:s,onReady:i,onStop:function(){n.subscriptions[e]=n.subscriptions[e].filter((function(e){return e.subscription!==l}))}}),f={callback:o,params:c,subscription:l,stop:function(){return l.stop()}};return this.subscriptions[e].push(f),f}},{key:"getSubscriptionOptions",value:function(){return{}}},{key:"stopSubscription",value:function(e,t){var r=t.callback,n=t.matcher,o=this.subscriptions[e]=this.subscriptions[e]||[];n?o.forEach((function(e){n(e)&&e.subscription.stop()})):o.forEach((function(e){r&&e.callback!==r||e.subscription.stop()}))}},{key:"addSimpleListener",value:function(e,t){(this.simpleListeners[e]=this.simpleListeners[e]||[]).push(t)}},{key:"removeSimpleListener",value:function(e,t){this.simpleListeners[e]&&(this.simpleListeners[e]=t?this.simpleListeners[e].filter((function(e){return e!==t})):[])}},{key:"runSimpleListeners",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];this.simpleListeners[e]&&this.simpleListeners[e].forEach((function(e){return e.apply(void 0,r)}))}},{key:"removeAllListeners",value:function(){var e=this;Object.keys(this.subscriptions).forEach((function(t){e.subscriptions[t].forEach((function(e){return e.subscription.stop()}))})),this.simpleListeners={}}}]),e}();t.default=c},"./src/methods.js":(e,t,r)=>{"use strict";var n=r("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r("./node_modules/@babel/runtime/helpers/classCallCheck.js")),s=n(r("./node_modules/@babel/runtime/helpers/createClass.js")),i=n(r("./node_modules/@babel/runtime/helpers/defineProperty.js")),a=r("./src/constants.js"),u=n(r("./src/utils.js")),c=function(e){return function(t){return this.send(e,t)}},l=function(){function e(t){var r=this,n=t.onMessage,s=t.emitMessage;(0,o.default)(this,e),(0,i.default)(this,"sendRequest",(function(e){r.invocations[e]&&r.emitMessage(a.RTSocketEvents.MET_REQ,r.invocations[e].data)})),(0,i.default)(this,"onResponse",(function(e){var t=e.id,n=e.error,o=e.result;if(r.invocations[t]){var s=r.invocations[t];n?s.reject(n):s.resolve(o),delete r.invocations[t]}})),(0,i.default)(this,"setUserToken",c(a.RTMethodTypes.SET_USER_TOKEN).bind(this)),(0,i.default)(this,"sendPubSubCommand",c(a.RTMethodTypes.PUB_SUB_COMMAND).bind(this)),(0,i.default)(this,"getRSO",c(a.RTMethodTypes.RSO_GET).bind(this)),(0,i.default)(this,"setRSO",c(a.RTMethodTypes.RSO_SET).bind(this)),(0,i.default)(this,"clearRSO",c(a.RTMethodTypes.RSO_CLEAR).bind(this)),(0,i.default)(this,"sendRSOCommand",c(a.RTMethodTypes.RSO_COMMAND).bind(this)),(0,i.default)(this,"invokeRSOMethod",c(a.RTMethodTypes.RSO_INVOKE).bind(this)),this.onMessage=n,this.emitMessage=s,this.invocations={}}return(0,s.default)(e,[{key:"initialize",value:function(){this.onMessage(a.RTSocketEvents.MET_RES,this.onResponse)}},{key:"restore",value:function(){var e=this;Object.keys(this.invocations).forEach((function(t){e.sendRequest(t)}))}},{key:"stop",value:function(){}},{key:"reset",value:function(){this.invocations={}}},{key:"hasActivity",value:function(){return!!Object.keys(this.invocations).length}},{key:"send",value:function(e,t){var r=this,n=u.default.generateUID();return this.invocations[n]={data:{id:n,name:e,options:t}},this.sendRequest(n),new Promise((function(e,t){r.invocations[n].resolve=e,r.invocations[n].reject=t}))}}]),e}();t.default=l},"./src/scope-connector.js":(e,t,r)=>{"use strict";var n=r("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o,s,i,a,u,c,l,f=n(r("./node_modules/@babel/runtime/helpers/classCallCheck.js")),p=n(r("./node_modules/@babel/runtime/helpers/createClass.js")),d=n(r("./node_modules/@babel/runtime/helpers/get.js")),h=n(r("./node_modules/@babel/runtime/helpers/inherits.js")),y=n(r("./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")),v=n(r("./node_modules/@babel/runtime/helpers/getPrototypeOf.js")),m=n(r("./node_modules/@babel/runtime/helpers/defineProperty.js")),b=n(r("./node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js")),g=n(r("./src/listeners.js"));function w(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function k(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?w(Object(r),!0).forEach((function(t){(0,m.default)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):w(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function E(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,v.default)(e);if(t){var o=(0,v.default)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,y.default)(this,r)}}var O="CONNECT",S="ERROR",_="COMMAND",R="USER_STATUS",x=(o=j(),s=j(),i=j(),a=j(),u=j(!0),l=function(e){(0,h.default)(r,e);var t=E(r);function r(e){var n;return(0,f.default)(this,r),(n=t.call(this)).options=e,n.waitConnection=[],n.connect(),n}return(0,p.default)(r,[{key:"connectSubscriber",get:function(){return null}},{key:"commandSubscriber",get:function(){return null}},{key:"usersSubscriber",get:function(){return null}},{key:"commandSender",get:function(){return null}},{key:"connect",value:function(){var e=this;this.isConnected()||(this.connection=this.connectSubscriber(this.getScopeOptions(),{onError:function(t){return e.onError(t)},onReady:function(){return e.onConnect()},onStop:function(){return e.onDisconnect()}}))}},{key:"disconnect",value:function(){this.isConnected()&&this.connection.stop()}},{key:"isConnected",value:function(){return!!this.connection&&this.connection.isReady()}},{key:"getSubscriptionOptions",value:function(){return this.getScopeOptions()}},{key:"getScopeOptions",value:function(){return this.options}},{key:"onConnect",value:function(){this.waitConnection.forEach((function(e){return e()})),this.waitConnection=[],this.runSimpleListeners(O)}},{key:"onError",value:function(e){this.runSimpleListeners(S,e)}},{key:"onDisconnect",value:function(){this.connection=null}},{key:"removeAllListeners",value:function(){return this.waitConnection=[],(0,d.default)((0,v.default)(r.prototype),"removeAllListeners",this).call(this),this}},{key:"addConnectListener",value:function(e,t){return this.addSimpleListener(O,e),t&&this.addSimpleListener(S,t),this}},{key:"removeConnectListeners",value:function(e,t){return this.removeSimpleListener(O,e),t&&this.removeSimpleListener(S,t),this}},{key:"addCommandListener",value:function(e,t){return this.addSubscription(_,this.commandSubscriber,{callback:e,onError:t}),this}},{key:"removeCommandListeners",value:function(e){return this.stopSubscription(_,{callback:e}),this}},{key:"addUserStatusListener",value:function(e,t){return this.addSubscription(R,this.usersSubscriber,{callback:e,onError:t}),this}},{key:"removeUserStatusListeners",value:function(e){return this.stopSubscription(R,{callback:e}),this}},{key:"send",value:function(e,t){return this.commandSender(k(k({},this.getScopeOptions()),{},{type:e,data:t}))}}]),r}(g.default),(0,m.default)(l,"connectionRequired",j),c=l,(0,b.default)(c.prototype,"addCommandListener",[o],Object.getOwnPropertyDescriptor(c.prototype,"addCommandListener"),c.prototype),(0,b.default)(c.prototype,"removeCommandListeners",[s],Object.getOwnPropertyDescriptor(c.prototype,"removeCommandListeners"),c.prototype),(0,b.default)(c.prototype,"addUserStatusListener",[i],Object.getOwnPropertyDescriptor(c.prototype,"addUserStatusListener"),c.prototype),(0,b.default)(c.prototype,"removeUserStatusListeners",[a],Object.getOwnPropertyDescriptor(c.prototype,"removeUserStatusListeners"),c.prototype),(0,b.default)(c.prototype,"send",[u],Object.getOwnPropertyDescriptor(c.prototype,"send"),c.prototype),c);function j(e){return function(t,r,n){var o=n.value;return n.value=function(){var t=arguments,r=this,n=function(){return o.apply(r,t)};return this.isConnected()?n():e?new Promise((function(e,t){return r.waitConnection.push((function(){return n().then(e,t)}))})):(this.waitConnection.push(n),this)},n}}t.default=x},"./src/session.js":(e,t,r)=>{"use strict";var n=r("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r("./node_modules/@babel/runtime/helpers/classCallCheck.js")),s=n(r("./node_modules/@babel/runtime/helpers/createClass.js")),i=r("./src/constants.js"),a=n(r("./src/socket.js")),u=function(){function e(t,r,n){(0,o.default)(this,e),this.config=t,this.dispatch=r,this.onDisconnect=n,this.connectAttempt=0,this.socketPromise=this.connect()}return(0,s.default)(e,[{key:"terminate",value:function(){this.terminated||(this.terminated=!0,this.dispatch=function(){},this.socketPromise.then((function(e){e&&e.close()})))}},{key:"getSocket",value:function(){var e=this;return this.socketPromise.then((function(t){return e.terminated?new Promise((function(){})):t}))}},{key:"connect",value:function(){var e=this;if(!this.terminated){this.connectAttempt=this.connectAttempt+1;var t=this.getNextReconnectionTimeout();return this.onConnecting(),this.connectAttempt>1&&this.onReconnectAttempt(this.connectAttempt-1,t),a.default.connect(this.config,this.onSocketDisconnect.bind(this)).then((function(t){return e.connectAttempt=0,e.onConnect(),t})).catch((function(r){if(e.onConnectError(r),!e.terminated)return(n=t,new Promise((function(e){return setTimeout(e,n)}))).then((function(){return e.connect()}));var n}))}}},{key:"getNextReconnectionTimeout",value:function(){var e=Math.ceil(this.connectAttempt/10),t=200*Math.pow(2,e);return Math.min(t,6e4)}},{key:"onSocketDisconnect",value:function(e){this.dispatch(i.NativeSocketEvents.DISCONNECT,e),this.terminated||(this.terminate(),this.onDisconnect())}},{key:"onConnecting",value:function(){this.dispatch(i.NativeSocketEvents.CONNECTING)}},{key:"onConnect",value:function(){this.dispatch(i.NativeSocketEvents.CONNECT)}},{key:"onConnectError",value:function(e){this.dispatch(i.NativeSocketEvents.CONNECT_ERROR,e&&e.message||e)}},{key:"onReconnectAttempt",value:function(e,t){this.dispatch(i.NativeSocketEvents.RECONNECT_ATTEMPT,e,t)}}]),e}();t.default=u},"./src/socket-parser.js":(e,t,r)=>{"use strict";var n=r("./node_modules/component-emitter/index.js");function o(){}function s(e){var r=""+e.type;return t.BINARY_EVENT!==e.type&&t.BINARY_ACK!==e.type||(r+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(r+=e.nsp+","),null!=e.id&&(r+=e.id),null!=e.data&&(r+=JSON.stringify(e.data)),r}function i(){}function a(){return{type:t.ERROR,data:"parser error"}}t.protocol=4,t.types=["CONNECT","DISCONNECT","EVENT","ACK","ERROR","BINARY_EVENT","BINARY_ACK"],t.CONNECT=0,t.DISCONNECT=1,t.EVENT=2,t.ACK=3,t.ERROR=4,t.BINARY_EVENT=5,t.BINARY_ACK=6,t.Encoder=o,t.Decoder=i,o.prototype.encode=function(e,t){t([s(e)])},n(i.prototype),i.prototype.add=function(e){if("string"!=typeof e)throw new Error("Unknown type: "+e);this.emit("decoded",function(e){var r=0,n={type:Number(e.charAt(0))};if(null==t.types[n.type])return a();if(t.BINARY_EVENT===n.type||t.BINARY_ACK===n.type){for(var o="";"-"!==e.charAt(++r)&&(o+=e.charAt(r),r!=e.length););if(o!=Number(o)||"-"!==e.charAt(r))throw new Error("Illegal attachments");n.attachments=Number(o)}if("/"===e.charAt(r+1))for(n.nsp="";++r&&","!==(i=e.charAt(r))&&(n.nsp+=i,r!==e.length););else n.nsp="/";var s=e.charAt(r+1);if(""!==s&&Number(s)==s){for(n.id="";++r;){var i;if(null==(i=e.charAt(r))||Number(i)!=i){--r;break}if(n.id+=e.charAt(r),r===e.length)break}n.id=Number(n.id)}return e.charAt(++r)&&(n=function(e,t){try{e.data=JSON.parse(t)}catch(e){return a()}return e}(n,e.substr(r))),n}(e))},i.prototype.destroy=function(){}},"./src/socket.js":(e,t,r)=>{"use strict";var n=r("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r("./node_modules/@babel/runtime/helpers/classCallCheck.js")),s=n(r("./node_modules/@babel/runtime/helpers/createClass.js")),i=r("./src/constants.js"),a=function(){function e(t,n){(0,o.default)(this,e);var s=r("./node_modules/socket.io-client/lib/index.js");this.config=t,this.events={};var i=t.getSocketConfig(),a=i.url,u=i.options;this.ioSocket=s(a,u)}return(0,s.default)(e,[{key:"connect",value:function(){this.ioSocket.connect()}},{key:"close",value:function(){this.log("log","close socket"),this.events={},this.ioSocket.off(),this.ioSocket.close()}},{key:"on",value:function(e,t){var r=this;this.events[e]||this.ioSocket.on(e,(function(t){return r.onEvent(e,t)})),this.events[e]=this.events[e]||[],this.events[e].push(t)}},{key:"off",value:function(e,t){this.events[e]=t?this.events[e].filter((function(e){return e!==t})):[],this.events[e].length||delete this.events[e],this.events[e]||this.ioSocket.off(e)}},{key:"onEvent",value:function(e,t){this.logMessage("FROM SERVER",e,t),this.events[e]&&this.events[e].forEach((function(e){return e(t)}))}},{key:"emit",value:function(e,t){this.logMessage("TO SERVER",e,t),this.ioSocket.emit(e,t)}},{key:"log",value:function(e){if(this.config.debugMode){for(var t,r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];(t=console)[e].apply(t,["[RT Client]:"].concat(n))}}},{key:"logMessage",value:function(e,t,r){this.log("log","[".concat(e,"] - [event: ").concat(t,"] - arguments: ").concat(JSON.stringify(r)," "))}}],[{key:"connect",value:function(t,r){return Promise.resolve().then((function(){return t.prepare()})).then((function(){return new Promise((function(r,n){var o=new e(t);function s(e){o.log("error","received one of [CONNECT_ERROR,CONNECT_TIMEOUT] socket event while connecting",e),a(e)}function a(e){o.log("log","close and reject socket with error:",e),o.close(),n(e)}o.on(i.NativeSocketEvents.CONNECT,(function(){o.log("log","socket connected"),r(o)})),o.on(i.NativeSocketEvents.CONNECT_ERROR,s),o.on(i.NativeSocketEvents.CONNECT_TIMEOUT,s),o.on(i.NativeSocketEvents.ERROR,(function(e){o.log("error","received ERROR event while connecting",e),a(e)})),o.connect()}))})).then((function(e){return e.on(i.NativeSocketEvents.DISCONNECT,r),e.on(i.NativeSocketEvents.ERROR,r),e}))}}]),e}();t.default=a},"./src/subscriptions.js":(e,t,r)=>{"use strict";var n=r("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r("./node_modules/@babel/runtime/helpers/classCallCheck.js")),s=n(r("./node_modules/@babel/runtime/helpers/createClass.js")),i=n(r("./node_modules/@babel/runtime/helpers/defineProperty.js")),a=r("./src/constants.js"),u=n(r("./src/utils.js")),c=function(e){return function(t,r){return this.subscribe(e,t,r)}},l=function(){function e(t){var r=t.onMessage,n=t.emitMessage;(0,o.default)(this,e),(0,i.default)(this,"onObjectsChanges",c(a.RTSubscriptionTypes.OBJECTS_CHANGES).bind(this)),(0,i.default)(this,"onRelationsChanges",c(a.RTSubscriptionTypes.RELATIONS_CHANGES).bind(this)),(0,i.default)(this,"connectToPubSub",c(a.RTSubscriptionTypes.PUB_SUB_CONNECT).bind(this)),(0,i.default)(this,"onPubSubMessage",c(a.RTSubscriptionTypes.PUB_SUB_MESSAGES).bind(this)),(0,i.default)(this,"onPubSubCommand",c(a.RTSubscriptionTypes.PUB_SUB_COMMANDS).bind(this)),(0,i.default)(this,"onPubSubUserStatus",c(a.RTSubscriptionTypes.PUB_SUB_USERS).bind(this)),(0,i.default)(this,"connectToRSO",c(a.RTSubscriptionTypes.RSO_CONNECT).bind(this)),(0,i.default)(this,"onRSOChanges",c(a.RTSubscriptionTypes.RSO_CHANGES).bind(this)),(0,i.default)(this,"onRSOClear",c(a.RTSubscriptionTypes.RSO_CLEARED).bind(this)),(0,i.default)(this,"onRSOCommand",c(a.RTSubscriptionTypes.RSO_COMMANDS).bind(this)),(0,i.default)(this,"onRSOInvoke",c(a.RTSubscriptionTypes.RSO_INVOKE).bind(this)),(0,i.default)(this,"onRSOUserStatus",c(a.RTSubscriptionTypes.RSO_USERS).bind(this)),(0,i.default)(this,"onLoggingMessages",c(a.RTSubscriptionTypes.LOGGING_MESSAGES).bind(this)),(0,i.default)(this,"onConsoleMessages",c(a.RTSubscriptionTypes.CONSOLE_MESSAGES).bind(this)),(0,i.default)(this,"onDeveloperMessage",c(a.RTSubscriptionTypes.DEVELOPER_MESSAGES).bind(this)),this.onMessage=r,this.emitMessage=n,this.subscriptions={}}return(0,s.default)(e,[{key:"initialize",value:function(){var e=this;this.onMessage(a.RTSocketEvents.SUB_READY,(function(t){return e.onSubscriptionReady(t)})),this.onMessage(a.RTSocketEvents.SUB_RES,(function(t){return e.onSubscriptionResponse(t)}))}},{key:"stop",value:function(){var e=this;Object.keys(this.subscriptions).forEach((function(t){e.subscriptions[t].ready=!1}))}},{key:"reset",value:function(){var e=this;Object.keys(this.subscriptions).forEach((function(t){return e.stopSubscription(t)}))}},{key:"restore",value:function(){var e=this;Object.keys(this.subscriptions).forEach((function(t){e.startSubscription(t)}))}},{key:"hasActivity",value:function(){return!!Object.keys(this.subscriptions).length}},{key:"subscribe",value:function(e,t,r){var n=this,o=r.parser,s=r.onData,i=r.onError,a=r.onStop,c=r.onReady,l=u.default.generateUID();return this.subscriptions[l]={data:{id:l,name:e,options:t},ready:!1,parser:o,onData:s,onError:i,onStop:a,onReady:c},this.startSubscription(l),{isReady:function(){return!!n.subscriptions[l]&&n.subscriptions[l].ready},stop:function(){n.subscriptions[l]&&n.offSubscription(l)}}}},{key:"startSubscription",value:function(e){var t=this.subscriptions[e];this.emitMessage(a.RTSocketEvents.SUB_ON,t.data)}},{key:"stopSubscription",value:function(e){var t=this.subscriptions[e];t&&(t.onStop&&t.onStop(),delete this.subscriptions[e])}},{key:"offSubscription",value:function(e){this.subscriptions[e]&&(this.emitMessage(a.RTSocketEvents.SUB_OFF,{id:e}),this.stopSubscription(e))}},{key:"onSubscriptionReady",value:function(e){var t=e.id,r=this.subscriptions[t];r&&!r.ready&&(r.ready=!0,r.onReady&&r.onReady())}},{key:"onSubscriptionResponse",value:function(e){var t=e.id,r=e.data,n=e.error,o=this.subscriptions[t];o&&(n?(o.onError&&o.onError(n),this.stopSubscription(t)):(o.ready||(o.ready=!0,o.onReady&&o.onReady()),o.onData&&("function"==typeof o.parser&&(r=o.parser(r)),o.onData(r))))}}]),e}();t.default=l},"./src/utils.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n={generateUID:function(){for(var e="",t=0;t<8;t++)e+=r.charAt(Math.floor(Math.random()*r.length));return e+Date.now()}};t.default=n},"./node_modules/backendless-request/dist/backendless-request.js":function(e,t){var s;"undefined"!=typeof self&&self,s=function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=3)}([function(e,t,r){"use strict";function n(e){return(n="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})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.isStream=t.isObject=t.isFormData=t.castArray=void 0,t.castArray=function(e){return Array.isArray(e)?e:[e]},t.isObject=function(e){return null!=e&&"object"===n(e)},t.isFormData=function(e){return e&&e.constructor&&0===e.constructor.toString().trim().indexOf("function FormData")},t.isStream=function(e){return e instanceof r(5).Stream}},function(e,t){throw new Error('This Backendless JS SDK assembly is not intended for Node.js environment. You should use "lib" folder modules instead. For any questions please contact as at http://support.backendless.com/')},function(e,t,r){"use strict";function n(e){return(n="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})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.Request=void 0;var o,s=r(10),i=(o=r(11))&&o.__esModule?o:{default:o},a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var r=l(t);if(r&&r.has(e))return r.get(e);var o={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var a=s?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(o,i,a):o[i]=e[i]}return o.default=e,r&&r.set(e,o),o}(r(12)),u=r(0),c=r(13);function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(l=function(e){return e?r:t})(e)}function f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function p(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?f(Object(r),!0).forEach((function(t){d(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function d(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function h(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function y(e,t){return(y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function v(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=b(e);if(t){var o=b(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return m(this,r)}}function m(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function b(e){return(b=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var g=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&y(e,t)}(i,e);var t,r,n,o=v(i);function i(e,t,r){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(n=o.call(this)).method=t,n.path=e,n.body=r,n.tags=void 0,n.unwrap=!0,n.cacheTTL=0,n.headers={},n.queryParams={},n.encoding="utf8",n.timeout=0,n}return t=i,(r=[{key:"set",value:function(e,t){if((0,u.isObject)(e))for(var r in e)this.set(r,e[r]);else void 0!==t&&(this.headers[e]=t);return this}},{key:"cacheTags",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.tags=t,this}},{key:"query",value:function(e){return Object.assign(this.queryParams,e),this}},{key:"form",value:function(e){var t=this;if(e){var r=i.FormData;e instanceof r?this.body=e:function(){var n=new r,o=function(t){t&&(0,u.castArray)(e[t]).forEach((function(e){e&&e.hasOwnProperty("value")&&e.hasOwnProperty("options")?n.append(t,e.value,e.options):n.append(t,e)}))};for(var s in e)o(s);t.body=n}()}return this}},{key:"useCache",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15e3;return this.cacheTTL=e,this}},{key:"resetCache",value:function(e){return e&&this.tags&&s.cache.deleteByTags(this.tags),this}},{key:"type",value:function(e){return this.set("Content-Type",e),this}},{key:"unwrapBody",value:function(e){return this.unwrap=e,this}},{key:"setEncoding",value:function(e){return this.encoding=e,this}},{key:"setTimeout",value:function(e){return this.timeout=e,this}},{key:"send",value:function(e){var t=this;this.emit("request",this);var r=this.path,n=a.stringify(this.queryParams);if(n&&(r+="?"+n),this.cacheTTL){var o=s.cache.get(r);if(void 0!==o)return Promise.resolve(o)}this.headers["Content-Type"]||!(0,u.isObject)(e)||(0,u.isFormData)(e)||this.type("application/json"),e&&(e="application/json"===this.headers["Content-Type"]&&"string"!=typeof e?JSON.stringify(e):e),i.verbose&&console.log(this.method.toUpperCase(),decodeURIComponent(r),e,this.headers);var c=i.send(r,this.method.toUpperCase(),this.headers,e,this.encoding,this.timeout).then(w).then(k).then((function(e){return t.unwrap?e.body:e})).then((function(e){return t.cacheTTL&&s.cache.set(r,e,t.tags,t.cacheTTL),e})).then((function(e){return t.tags&&"get"!==t.method&&s.cache.deleteByTags(t.tags),e}));return c.then((function(e){t.emit("response",e),t.emit("done",null,e)})).catch((function(e){t.emit("error",e),t.emit("done",e)})),c}},{key:"then",value:function(e,t){return this.promise=this.promise||this.send(this.body),this.promise.then(e,t)}},{key:"catch",value:function(e){return this.promise=this.promise||this.send(this.body),this.promise.catch(e)}}])&&h(t.prototype,r),n&&h(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(i.default);function w(e){try{return p(p({},e),{},{body:JSON.parse(e.body)})}catch(t){return e}}function k(e){if(e.status>=200&&e.status<300)return e;throw new c.ResponseError(e)}t.Request=g},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(4),o=r(9),s=r(2);Object.defineProperty(s.Request,"FormData",{get:function(){return"undefined"!=typeof FormData?FormData:r(14)}}),s.Request.XMLHttpRequest="undefined"!=typeof XMLHttpRequest?XMLHttpRequest:void 0,s.Request.send=function(e,t,r,i,a,u){return(void 0!==s.Request.XMLHttpRequest?o.sendXmlHttpRequest:n.sendNodeAPIRequest)(e,t,r,i,a,u)},s.Request.verbose=!1,s.Request.methods=["get","post","put","patch","delete"],s.Request.methods.forEach((function(e){s.Request[e]=function(t,r){return new s.Request(t,e,r)}})),t=e.exports=s.Request;var i=s.Request;t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sendNodeAPIRequest=function(e,t,o,s,i,a){return new Promise((function(u,c){var l=r(6).parse(e),f=(0,n.isFormData)(s)&&s,p="https:"===l.protocol,d={host:l.hostname,port:l.port||(p?443:80),path:l.pathname+(l.search||""),method:t,headers:o,timeout:a},h=function(){var e=r(1).Buffer,t=r(p?7:8).request(d,(function(t){var r=[],n=[],o=0,s="",a=t.statusCode,l=t.statusMessage,f=t.headers;t.on("data",(function(t){e.isBuffer(t)?t.length&&(o+=t.length,n.push(t)):r.push(t)})),t.on("end",(function(){o?(s=e.concat(n,o),null!=i&&(s=s.toString(i))):r.length&&(s=r.join()),u({status:a,statusText:l,headers:f,body:s})})),t.on("error",c)}));if(t.on("error",c),t.on("timeout",(function(){t.destroy(new Error("Connection aborted due to timeout"))})),s){if((0,n.isStream)(s))return void s.pipe(t);t.write(s)}t.end()};if(f)Object.assign(d.headers,f.getHeaders()),f.getLength((function(e,t){e||isNaN(t)||(d.headers["content-length"]=t),h()}));else{if(s&&!d.headers["content-length"]){var y=r(1).Buffer;d.headers["content-length"]=y.byteLength(s)}h()}}))};var n=r(0)},function(e,t){throw new Error('This Backendless JS SDK assembly is not intended for Node.js environment. You should use "lib" folder modules instead. For any questions please contact as at http://support.backendless.com/')},function(e,t){throw new Error('This Backendless JS SDK assembly is not intended for Node.js environment. You should use "lib" folder modules instead. For any questions please contact as at http://support.backendless.com/')},function(e,t){throw new Error('This Backendless JS SDK assembly is not intended for Node.js environment. You should use "lib" folder modules instead. For any questions please contact as at http://support.backendless.com/')},function(e,t){throw new Error('This Backendless JS SDK assembly is not intended for Node.js environment. You should use "lib" folder modules instead. For any questions please contact as at http://support.backendless.com/')},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sendXmlHttpRequest=function(e,t,r,o,s,i){return new Promise((function(a,u){var c=new n.Request.XMLHttpRequest;c.timeout=i,s||(c.responseType="arraybuffer"),c.open(t.toUpperCase(),e,!0),c.onload=function(){var e,t,r=(e=c.getAllResponseHeaders(),t={},e?(e.split("\n").forEach((function(e){var r=e.indexOf(":"),n=e.substr(0,r).trim(),o=e.substr(r+1).trim();n&&(t[n]=t[n]?t[n]+", "+o:o)})),t):t),n=c,o={status:n.status,statusText:n.statusText,headers:r};"utf8"===s?o.body=c.response||c.responseText:c.response&&(o.body=new Uint8Array(c.response)),a(o),c=null},c.onerror=function(){u(new Error("Network Error")),c=null},c.ontimeout=function(){u(new Error("Connection aborted due to timeout")),c=null},Object.keys(r).forEach((function(e){c.setRequestHeader(e,r[e])})),c.send(o)}))};var n=r(2)},function(e,t,r){"use strict";function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,s=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(s.push(n.value),!t||s.length!==t);i=!0);}catch(e){a=!0,o=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw o}}return s}}(e,t)||s(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=s(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function s(e,t){if(e){if("string"==typeof e)return i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,t):void 0}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}Object.defineProperty(t,"__esModule",{value:!0}),t.cache=void 0;var u=function(){return(new Date).getTime()},c=function(e,t){return!!e.find((function(e){return t.find((function(t){return function(e,t){var r=e==t;return!r&&e instanceof RegExp&&(r=e.test(t)),!r&&t instanceof RegExp&&(r=t.test(e)),r}(e,t)}))}))},l=new(function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.setFlushInterval(t),this.map=new Map}var t,r,s;return t=e,(r=[{key:"setFlushInterval",value:function(e){this.flushInterval=e,this.flushTimer&&(clearInterval(this.flushTimer),delete this.flushTimer)}},{key:"get",value:function(e){var t=this.map.get(e);if(t){if(t.ttl>u())return t.value;this.map.delete(e)}}},{key:"set",value:function(e,t,r,n){this.map.set(e,function(e,t,r){return{value:e,tags:t,ttl:r}}(t,r,u()+n)),this.flushInterval&&!this.flushTimer&&(this.flushTimer=setInterval(this.flush.bind(this),this.flushInterval),this.flushTimer.unref&&this.flushTimer.unref())}},{key:"delete",value:function(e){this.map.delete(e)}},{key:"deleteAll",value:function(){var e,t=o(this.map);try{for(t.s();!(e=t.n()).done;){var r=n(e.value,1)[0];this.delete(r)}}catch(e){t.e(e)}finally{t.f()}}},{key:"deleteByTags",value:function(e){var t,r=o(this.map);try{for(r.s();!(t=r.n()).done;){var s=n(t.value,2),i=s[0],a=s[1];a.tags&&c(e,a.tags)&&this.delete(i)}}catch(e){r.e(e)}finally{r.f()}}},{key:"flush",value:function(){var e,t=u(),r=o(this.map);try{for(r.s();!(e=r.n()).done;){var s=n(e.value,2),i=s[0];s[1].ttl<t&&this.delete(i)}}catch(e){r.e(e)}finally{r.f()}}}])&&a(t.prototype,r),s&&a(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}())(6e4);t.cache=l},function(e,t,r){"use strict";function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.events={}}var t,r,o;return t=e,(r=[{key:"on",value:function(e,t){return this.events[e]=this.events[e]||[],this.events[e].push(t),this}},{key:"off",value:function(e,t){return e?this.events[e]&&(t?this.events[e]=this.events[e].filter((function(e){return e!==t})):delete this.events[e]):this.events={},this}},{key:"emit",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];this.events[e]&&this.events[e].forEach((function(e){return e.apply(void 0,r)}))}}])&&n(t.prototype,r),o&&n(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stringify=void 0;var n=r(0);t.stringify=function(e){var t=[];return Object.keys(e).forEach((function(r){var o=e[r];void 0!==o&&(0,n.castArray)(o).forEach((function(e){t.push("".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(e)))}))})),t.join("&")}},function(e,t,r){"use strict";function n(e){return(n="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})(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function s(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function i(e){var t="function"==typeof Map?new Map:void 0;return(i=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return a(e,arguments,l(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),c(n,e)})(e)}function a(e,t,r){return(a=u()?Reflect.construct.bind():function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&c(o,r.prototype),o}).apply(null,arguments)}function u(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function c(e,t){return(c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.ResponseError=void 0;var f=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&c(e,t)}(p,e);var t,r,n,i,a,f=(t=p,r=u(),function(){var e,n=l(t);if(r){var o=l(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return s(this,e)});function p(e){var t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,p),t=f.call(this);var r,n=502===(r=e).status?"No connection with server":r.body||"Status Code ".concat(r.status," (").concat(r.statusText,")");return t.message=n.message||n,t.code=n.code,t.status=e.status,t.headers=e.headers,t.body=e.body,t}return n=p,i&&o(n.prototype,i),a&&o(n,a),Object.defineProperty(n,"prototype",{writable:!1}),n}(i(Error));t.ResponseError=f},function(e,t){throw new Error('This Backendless JS SDK assembly is not intended for Node.js environment. You should use "lib" folder modules instead. For any questions please contact as at http://support.backendless.com/')}])},"object"==typeof t&&"object"==typeof e?e.exports=s():(n=[],void 0===(o="function"==typeof(r=s)?r.apply(t,n):r)||(e.exports=o))},"./node_modules/backo2/index.js":e=>{function t(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}e.exports=t,t.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),r=Math.floor(t*this.jitter*e);e=0==(1&Math.floor(10*t))?e-r:e+r}return 0|Math.min(e,this.max)},t.prototype.reset=function(){this.attempts=0},t.prototype.setMin=function(e){this.ms=e},t.prototype.setMax=function(e){this.max=e},t.prototype.setJitter=function(e){this.jitter=e}},"./node_modules/base64-arraybuffer/lib/base64-arraybuffer.js":(e,t)=>{!function(){"use strict";for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=new Uint8Array(256),n=0;n<e.length;n++)r[e.charCodeAt(n)]=n;t.encode=function(t){var r,n=new Uint8Array(t),o=n.length,s="";for(r=0;r<o;r+=3)s+=e[n[r]>>2],s+=e[(3&n[r])<<4|n[r+1]>>4],s+=e[(15&n[r+1])<<2|n[r+2]>>6],s+=e[63&n[r+2]];return o%3==2?s=s.substring(0,s.length-1)+"=":o%3==1&&(s=s.substring(0,s.length-2)+"=="),s},t.decode=function(e){var t,n,o,s,i,a=.75*e.length,u=e.length,c=0;"="===e[e.length-1]&&(a--,"="===e[e.length-2]&&a--);var l=new ArrayBuffer(a),f=new Uint8Array(l);for(t=0;t<u;t+=4)n=r[e.charCodeAt(t)],o=r[e.charCodeAt(t+1)],s=r[e.charCodeAt(t+2)],i=r[e.charCodeAt(t+3)],f[c++]=n<<2|o>>4,f[c++]=(15&o)<<4|s>>2,f[c++]=(3&s)<<6|63&i;return l}}()},"./node_modules/blob/index.js":(e,t,r)=>{var n=r.g.BlobBuilder||r.g.WebKitBlobBuilder||r.g.MSBlobBuilder||r.g.MozBlobBuilder,o=function(){try{return 2===new Blob(["hi"]).size}catch(e){return!1}}(),s=o&&function(){try{return 2===new Blob([new Uint8Array([1,2])]).size}catch(e){return!1}}(),i=n&&n.prototype.append&&n.prototype.getBlob;function a(e){for(var t=0;t<e.length;t++){var r=e[t];if(r.buffer instanceof ArrayBuffer){var n=r.buffer;if(r.byteLength!==n.byteLength){var o=new Uint8Array(r.byteLength);o.set(new Uint8Array(n,r.byteOffset,r.byteLength)),n=o.buffer}e[t]=n}}}function u(e,t){t=t||{};var r=new n;a(e);for(var o=0;o<e.length;o++)r.append(e[o]);return t.type?r.getBlob(t.type):r.getBlob()}function c(e,t){return a(e),new Blob(e,t||{})}e.exports=o?s?r.g.Blob:c:i?u:void 0},"./node_modules/component-bind/index.js":e=>{var t=[].slice;e.exports=function(e,r){if("string"==typeof r&&(r=e[r]),"function"!=typeof r)throw new Error("bind() requires a function");var n=t.call(arguments,2);return function(){return r.apply(e,n.concat(t.call(arguments)))}}},"./node_modules/component-emitter/index.js":e=>{function t(e){if(e)return function(e){for(var r in t.prototype)e[r]=t.prototype[r];return e}(e)}e.exports=t,t.prototype.on=t.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},t.prototype.once=function(e,t){function r(){this.off(e,r),t.apply(this,arguments)}return r.fn=t,this.on(e,r),this},t.prototype.off=t.prototype.removeListener=t.prototype.removeAllListeners=t.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,n=this._callbacks["$"+e];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var o=0;o<n.length;o++)if((r=n[o])===t||r.fn===t){n.splice(o,1);break}return this},t.prototype.emit=function(e){this._callbacks=this._callbacks||{};var t=[].slice.call(arguments,1),r=this._callbacks["$"+e];if(r)for(var n=0,o=(r=r.slice(0)).length;n<o;++n)r[n].apply(this,t);return this},t.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},t.prototype.hasListeners=function(e){return!!this.listeners(e).length}},"./node_modules/component-inherit/index.js":e=>{e.exports=function(e,t){var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},"./node_modules/debug/src/browser.js":(e,t,r)=>{function n(){var e;try{e=t.storage.debug}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e}(t=e.exports=r("./node_modules/debug/src/debug.js")).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},t.formatArgs=function(e){var r=this.useColors;if(e[0]=(r?"%c":"")+this.namespace+(r?" %c":" ")+e[0]+(r?"%c ":" ")+"+"+t.humanize(this.diff),r){var n="color: "+this.color;e.splice(1,0,n,"color: inherit");var o=0,s=0;e[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(o++,"%c"===e&&(s=o))})),e.splice(s,0,n)}},t.save=function(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(e){}},t.load=n,t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},t.enable(n())},"./node_modules/debug/src/debug.js":(e,t,r)=>{var n;function o(e){function r(){if(r.enabled){var e=r,o=+new Date,s=o-(n||o);e.diff=s,e.prev=n,e.curr=o,n=o;for(var i=new Array(arguments.length),a=0;a<i.length;a++)i[a]=arguments[a];i[0]=t.coerce(i[0]),"string"!=typeof i[0]&&i.unshift("%O");var u=0;i[0]=i[0].replace(/%([a-zA-Z%])/g,(function(r,n){if("%%"===r)return r;u++;var o=t.formatters[n];if("function"==typeof o){var s=i[u];r=o.call(e,s),i.splice(u,1),u--}return r})),t.formatArgs.call(e,i);var c=r.log||t.log||console.log.bind(console);c.apply(e,i)}}return r.namespace=e,r.enabled=t.enabled(e),r.useColors=t.useColors(),r.color=function(e){var r,n=0;for(r in e)n=(n<<5)-n+e.charCodeAt(r),n|=0;return t.colors[Math.abs(n)%t.colors.length]}(e),"function"==typeof t.init&&t.init(r),r}(t=e.exports=o.debug=o.default=o).coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){t.enable("")},t.enable=function(e){t.save(e),t.names=[],t.skips=[];for(var r=("string"==typeof e?e:"").split(/[\s,]+/),n=r.length,o=0;o<n;o++)r[o]&&("-"===(e=r[o].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){var r,n;for(r=0,n=t.skips.length;r<n;r++)if(t.skips[r].test(e))return!1;for(r=0,n=t.names.length;r<n;r++)if(t.names[r].test(e))return!0;return!1},t.humanize=r("./node_modules/ms/index.js"),t.names=[],t.skips=[],t.formatters={}},"./node_modules/engine.io-client/lib/index.js":(e,t,r)=>{e.exports=r("./node_modules/engine.io-client/lib/socket.js"),e.exports.parser=r("./node_modules/engine.io-parser/lib/browser.js")},"./node_modules/engine.io-client/lib/socket.js":(e,t,r)=>{var n=r("./node_modules/engine.io-client/lib/transports/index.js"),o=r("./node_modules/component-emitter/index.js"),s=r("./node_modules/debug/src/browser.js")("engine.io-client:socket"),i=r("./node_modules/indexof/index.js"),a=r("./node_modules/engine.io-parser/lib/browser.js"),u=r("./node_modules/parseuri/index.js"),c=r("./node_modules/parseqs/index.js");function l(e,t){if(!(this instanceof l))return new l(e,t);t=t||{},e&&"object"==typeof e&&(t=e,e=null),e?(e=u(e),t.hostname=e.host,t.secure="https"===e.protocol||"wss"===e.protocol,t.port=e.port,e.query&&(t.query=e.query)):t.host&&(t.hostname=u(t.host).host),this.secure=null!=t.secure?t.secure:r.g.location&&"https:"===location.protocol,t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.agent=t.agent||!1,this.hostname=t.hostname||(r.g.location?location.hostname:"localhost"),this.port=t.port||(r.g.location&&location.port?location.port:this.secure?443:80),this.query=t.query||{},"string"==typeof this.query&&(this.query=c.decode(this.query)),this.upgrade=!1!==t.upgrade,this.path=(t.path||"/engine.io").replace(/\/$/,"")+"/",this.forceJSONP=!!t.forceJSONP,this.jsonp=!1!==t.jsonp,this.forceBase64=!!t.forceBase64,this.enablesXDR=!!t.enablesXDR,this.timestampParam=t.timestampParam||"t",this.timestampRequests=t.timestampRequests,this.transports=t.transports||["polling","websocket"],this.transportOptions=t.transportOptions||{},this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.policyPort=t.policyPort||843,this.rememberUpgrade=t.rememberUpgrade||!1,this.binaryType=null,this.onlyBinaryUpgrades=t.onlyBinaryUpgrades,this.perMessageDeflate=!1!==t.perMessageDeflate&&(t.perMessageDeflate||{}),!0===this.perMessageDeflate&&(this.perMessageDeflate={}),this.perMessageDeflate&&null==this.perMessageDeflate.threshold&&(this.perMessageDeflate.threshold=1024),this.pfx=t.pfx||null,this.key=t.key||null,this.passphrase=t.passphrase||null,this.cert=t.cert||null,this.ca=t.ca||null,this.ciphers=t.ciphers||null,this.rejectUnauthorized=void 0===t.rejectUnauthorized||t.rejectUnauthorized,this.forceNode=!!t.forceNode;var n="object"==typeof r.g&&r.g;n.global===n&&(t.extraHeaders&&Object.keys(t.extraHeaders).length>0&&(this.extraHeaders=t.extraHeaders),t.localAddress&&(this.localAddress=t.localAddress)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingIntervalTimer=null,this.pingTimeoutTimer=null,this.open()}e.exports=l,l.priorWebsocketSuccess=!1,o(l.prototype),l.protocol=a.protocol,l.Socket=l,l.Transport=r("./node_modules/engine.io-client/lib/transport.js"),l.transports=r("./node_modules/engine.io-client/lib/transports/index.js"),l.parser=r("./node_modules/engine.io-parser/lib/browser.js"),l.prototype.createTransport=function(e){s('creating transport "%s"',e);var t=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t}(this.query);t.EIO=a.protocol,t.transport=e;var r=this.transportOptions[e]||{};return this.id&&(t.sid=this.id),new n[e]({query:t,socket:this,agent:r.agent||this.agent,hostname:r.hostname||this.hostname,port:r.port||this.port,secure:r.secure||this.secure,path:r.path||this.path,forceJSONP:r.forceJSONP||this.forceJSONP,jsonp:r.jsonp||this.jsonp,forceBase64:r.forceBase64||this.forceBase64,enablesXDR:r.enablesXDR||this.enablesXDR,timestampRequests:r.timestampRequests||this.timestampRequests,timestampParam:r.timestampParam||this.timestampParam,policyPort:r.policyPort||this.policyPort,pfx:r.pfx||this.pfx,key:r.key||this.key,passphrase:r.passphrase||this.passphrase,cert:r.cert||this.cert,ca:r.ca||this.ca,ciphers:r.ciphers||this.ciphers,rejectUnauthorized:r.rejectUnauthorized||this.rejectUnauthorized,perMessageDeflate:r.perMessageDeflate||this.perMessageDeflate,extraHeaders:r.extraHeaders||this.extraHeaders,forceNode:r.forceNode||this.forceNode,localAddress:r.localAddress||this.localAddress,requestTimeout:r.requestTimeout||this.requestTimeout,protocols:r.protocols||void 0})},l.prototype.open=function(){var e;if(this.rememberUpgrade&&l.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))e="websocket";else{if(0===this.transports.length){var t=this;return void setTimeout((function(){t.emit("error","No transports available")}),0)}e=this.transports[0]}this.readyState="opening";try{e=this.createTransport(e)}catch(e){return this.transports.shift(),void this.open()}e.open(),this.setTransport(e)},l.prototype.setTransport=function(e){s("setting transport %s",e.name);var t=this;this.transport&&(s("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=e,e.on("drain",(function(){t.onDrain()})).on("packet",(function(e){t.onPacket(e)})).on("error",(function(e){t.onError(e)})).on("close",(function(){t.onClose("transport close")}))},l.prototype.probe=function(e){s('probing transport "%s"',e);var t=this.createTransport(e,{probe:1}),r=!1,n=this;function o(){if(n.onlyBinaryUpgrades){var o=!this.supportsBinary&&n.transport.supportsBinary;r=r||o}r||(s('probe transport "%s" opened',e),t.send([{type:"ping",data:"probe"}]),t.once("packet",(function(o){if(!r)if("pong"===o.type&&"probe"===o.data){if(s('probe transport "%s" pong',e),n.upgrading=!0,n.emit("upgrading",t),!t)return;l.priorWebsocketSuccess="websocket"===t.name,s('pausing current transport "%s"',n.transport.name),n.transport.pause((function(){r||"closed"!==n.readyState&&(s("changing transport and sending upgrade packet"),p(),n.setTransport(t),t.send([{type:"upgrade"}]),n.emit("upgrade",t),t=null,n.upgrading=!1,n.flush())}))}else{s('probe transport "%s" failed',e);var i=new Error("probe error");i.transport=t.name,n.emit("upgradeError",i)}})))}function i(){r||(r=!0,p(),t.close(),t=null)}function a(r){var o=new Error("probe error: "+r);o.transport=t.name,i(),s('probe transport "%s" failed because of error: %s',e,r),n.emit("upgradeError",o)}function u(){a("transport closed")}function c(){a("socket closed")}function f(e){t&&e.name!==t.name&&(s('"%s" works - aborting "%s"',e.name,t.name),i())}function p(){t.removeListener("open",o),t.removeListener("error",a),t.removeListener("close",u),n.removeListener("close",c),n.removeListener("upgrading",f)}l.priorWebsocketSuccess=!1,t.once("open",o),t.once("error",a),t.once("close",u),this.once("close",c),this.once("upgrading",f),t.open()},l.prototype.onOpen=function(){if(s("socket open"),this.readyState="open",l.priorWebsocketSuccess="websocket"===this.transport.name,this.emit("open"),this.flush(),"open"===this.readyState&&this.upgrade&&this.transport.pause){s("starting upgrade probes");for(var e=0,t=this.upgrades.length;e<t;e++)this.probe(this.upgrades[e])}},l.prototype.onPacket=function(e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(s('socket receive: type "%s", data "%s"',e.type,e.data),this.emit("packet",e),this.emit("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"pong":this.setPing(),this.emit("pong");break;case"error":var t=new Error("server error");t.code=e.data,this.onError(t);break;case"message":this.emit("data",e.data),this.emit("message",e.data)}else s('packet received with socket readyState "%s"',this.readyState)},l.prototype.onHandshake=function(e){this.emit("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.onOpen(),"closed"!==this.readyState&&(this.setPing(),this.removeListener("heartbeat",this.onHeartbeat),this.on("heartbeat",this.onHeartbeat))},l.prototype.onHeartbeat=function(e){clearTimeout(this.pingTimeoutTimer);var t=this;t.pingTimeoutTimer=setTimeout((function(){"closed"!==t.readyState&&t.onClose("ping timeout")}),e||t.pingInterval+t.pingTimeout)},l.prototype.setPing=function(){var e=this;clearTimeout(e.pingIntervalTimer),e.pingIntervalTimer=setTimeout((function(){s("writing ping packet - expecting pong within %sms",e.pingTimeout),e.ping(),e.onHeartbeat(e.pingTimeout)}),e.pingInterval)},l.prototype.ping=function(){var e=this;this.sendPacket("ping",(function(){e.emit("ping")}))},l.prototype.onDrain=function(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emit("drain"):this.flush()},l.prototype.flush=function(){"closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(s("flushing %d packets in socket",this.writeBuffer.length),this.transport.send(this.writeBuffer),this.prevBufferLen=this.writeBuffer.length,this.emit("flush"))},l.prototype.write=l.prototype.send=function(e,t,r){return this.sendPacket("message",e,t,r),this},l.prototype.sendPacket=function(e,t,r,n){if("function"==typeof t&&(n=t,t=void 0),"function"==typeof r&&(n=r,r=null),"closing"!==this.readyState&&"closed"!==this.readyState){(r=r||{}).compress=!1!==r.compress;var o={type:e,data:t,options:r};this.emit("packetCreate",o),this.writeBuffer.push(o),n&&this.once("flush",n),this.flush()}},l.prototype.close=function(){if("opening"===this.readyState||"open"===this.readyState){this.readyState="closing";var e=this;this.writeBuffer.length?this.once("drain",(function(){this.upgrading?n():t()})):this.upgrading?n():t()}function t(){e.onClose("forced close"),s("socket closing - telling transport to close"),e.transport.close()}function r(){e.removeListener("upgrade",r),e.removeListener("upgradeError",r),t()}function n(){e.once("upgrade",r),e.once("upgradeError",r)}return this},l.prototype.onError=function(e){s("socket error %j",e),l.priorWebsocketSuccess=!1,this.emit("error",e),this.onClose("transport error",e)},l.prototype.onClose=function(e,t){"opening"!==this.readyState&&"open"!==this.readyState&&"closing"!==this.readyState||(s('socket close with reason: "%s"',e),clearTimeout(this.pingIntervalTimer),clearTimeout(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),this.readyState="closed",this.id=null,this.emit("close",e,t),this.writeBuffer=[],this.prevBufferLen=0)},l.prototype.filterUpgrades=function(e){for(var t=[],r=0,n=e.length;r<n;r++)~i(this.transports,e[r])&&t.push(e[r]);return t}},"./node_modules/engine.io-client/lib/transport.js":(e,t,r)=>{var n=r("./node_modules/engine.io-parser/lib/browser.js"),o=r("./node_modules/component-emitter/index.js");function s(e){this.path=e.path,this.hostname=e.hostname,this.port=e.port,this.secure=e.secure,this.query=e.query,this.timestampParam=e.timestampParam,this.timestampRequests=e.timestampRequests,this.readyState="",this.agent=e.agent||!1,this.socket=e.socket,this.enablesXDR=e.enablesXDR,this.pfx=e.pfx,this.key=e.key,this.passphrase=e.passphrase,this.cert=e.cert,this.ca=e.ca,this.ciphers=e.ciphers,this.rejectUnauthorized=e.rejectUnauthorized,this.forceNode=e.forceNode,this.extraHeaders=e.extraHeaders,this.localAddress=e.localAddress}e.exports=s,o(s.prototype),s.prototype.onError=function(e,t){var r=new Error(e);return r.type="TransportError",r.description=t,this.emit("error",r),this},s.prototype.open=function(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this},s.prototype.close=function(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this},s.prototype.send=function(e){if("open"!==this.readyState)throw new Error("Transport not open");this.write(e)},s.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},s.prototype.onData=function(e){var t=n.decodePacket(e,this.socket.binaryType);this.onPacket(t)},s.prototype.onPacket=function(e){this.emit("packet",e)},s.prototype.onClose=function(){this.readyState="closed",this.emit("close")}},"./node_modules/engine.io-client/lib/transports/index.js":(e,t,r)=>{var n=r("./node_modules/engine.io-client/lib/xmlhttprequest.js"),o=r("./node_modules/engine.io-client/lib/transports/polling-xhr.js"),s=r("./node_modules/engine.io-client/lib/transports/polling-jsonp.js"),i=r("./node_modules/engine.io-client/lib/transports/websocket.js");t.polling=function(e){var t=!1,i=!1,a=!1!==e.jsonp;if(r.g.location){var u="https:"===location.protocol,c=location.port;c||(c=u?443:80),t=e.hostname!==location.hostname||c!==e.port,i=e.secure!==u}if(e.xdomain=t,e.xscheme=i,"open"in new n(e)&&!e.forceJSONP)return new o(e);if(!a)throw new Error("JSONP disabled");return new s(e)},t.websocket=i},"./node_modules/engine.io-client/lib/transports/polling-jsonp.js":(e,t,r)=>{var n=r("./node_modules/engine.io-client/lib/transports/polling.js"),o=r("./node_modules/component-inherit/index.js");e.exports=c;var s,i=/\n/g,a=/\\n/g;function u(){}function c(e){n.call(this,e),this.query=this.query||{},s||(r.g.___eio||(r.g.___eio=[]),s=r.g.___eio),this.index=s.length;var t=this;s.push((function(e){t.onData(e)})),this.query.j=this.index,r.g.document&&r.g.addEventListener&&r.g.addEventListener("beforeunload",(function(){t.script&&(t.script.onerror=u)}),!1)}o(c,n),c.prototype.supportsBinary=!1,c.prototype.doClose=function(){this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),this.form&&(this.form.parentNode.removeChild(this.form),this.form=null,this.iframe=null),n.prototype.doClose.call(this)},c.prototype.doPoll=function(){var e=this,t=document.createElement("script");this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),t.async=!0,t.src=this.uri(),t.onerror=function(t){e.onError("jsonp poll error",t)};var r=document.getElementsByTagName("script")[0];r?r.parentNode.insertBefore(t,r):(document.head||document.body).appendChild(t),this.script=t,"undefined"!=typeof navigator&&/gecko/i.test(navigator.userAgent)&&setTimeout((function(){var e=document.createElement("iframe");document.body.appendChild(e),document.body.removeChild(e)}),100)},c.prototype.doWrite=function(e,t){var r=this;if(!this.form){var n,o=document.createElement("form"),s=document.createElement("textarea"),u=this.iframeId="eio_iframe_"+this.index;o.className="socketio",o.style.position="absolute",o.style.top="-1000px",o.style.left="-1000px",o.target=u,o.method="POST",o.setAttribute("accept-charset","utf-8"),s.name="d",o.appendChild(s),document.body.appendChild(o),this.form=o,this.area=s}function c(){l(),t()}function l(){if(r.iframe)try{r.form.removeChild(r.iframe)}catch(e){r.onError("jsonp polling iframe removal error",e)}try{var e='<iframe src="javascript:0" name="'+r.iframeId+'">';n=document.createElement(e)}catch(e){(n=document.createElement("iframe")).name=r.iframeId,n.src="javascript:0"}n.id=r.iframeId,r.form.appendChild(n),r.iframe=n}this.form.action=this.uri(),l(),e=e.replace(a,"\\\n"),this.area.value=e.replace(i,"\\n");try{this.form.submit()}catch(e){}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){"complete"===r.iframe.readyState&&c()}:this.iframe.onload=c}},"./node_modules/engine.io-client/lib/transports/polling-xhr.js":(e,t,r)=>{var n=r("./node_modules/engine.io-client/lib/xmlhttprequest.js"),o=r("./node_modules/engine.io-client/lib/transports/polling.js"),s=r("./node_modules/component-emitter/index.js"),i=r("./node_modules/component-inherit/index.js"),a=r("./node_modules/debug/src/browser.js")("engine.io-client:polling-xhr");function u(){}function c(e){if(o.call(this,e),this.requestTimeout=e.requestTimeout,this.extraHeaders=e.extraHeaders,r.g.location){var t="https:"===location.protocol,n=location.port;n||(n=t?443:80),this.xd=e.hostname!==r.g.location.hostname||n!==e.port,this.xs=e.secure!==t}}function l(e){this.method=e.method||"GET",this.uri=e.uri,this.xd=!!e.xd,this.xs=!!e.xs,this.async=!1!==e.async,this.data=void 0!==e.data?e.data:null,this.agent=e.agent,this.isBinary=e.isBinary,this.supportsBinary=e.supportsBinary,this.enablesXDR=e.enablesXDR,this.requestTimeout=e.requestTimeout,this.pfx=e.pfx,this.key=e.key,this.passphrase=e.passphrase,this.cert=e.cert,this.ca=e.ca,this.ciphers=e.ciphers,this.rejectUnauthorized=e.rejectUnauthorized,this.extraHeaders=e.extraHeaders,this.create()}function f(){for(var e in l.requests)l.requests.hasOwnProperty(e)&&l.requests[e].abort()}e.exports=c,e.exports.Request=l,i(c,o),c.prototype.supportsBinary=!0,c.prototype.request=function(e){return(e=e||{}).uri=this.uri(),e.xd=this.xd,e.xs=this.xs,e.agent=this.agent||!1,e.supportsBinary=this.supportsBinary,e.enablesXDR=this.enablesXDR,e.pfx=this.pfx,e.key=this.key,e.passphrase=this.passphrase,e.cert=this.cert,e.ca=this.ca,e.ciphers=this.ciphers,e.rejectUnauthorized=this.rejectUnauthorized,e.requestTimeout=this.requestTimeout,e.extraHeaders=this.extraHeaders,new l(e)},c.prototype.doWrite=function(e,t){var r="string"!=typeof e&&void 0!==e,n=this.request({method:"POST",data:e,isBinary:r}),o=this;n.on("success",t),n.on("error",(function(e){o.onError("xhr post error",e)})),this.sendXhr=n},c.prototype.doPoll=function(){a("xhr poll");var e=this.request(),t=this;e.on("data",(function(e){t.onData(e)})),e.on("error",(function(e){t.onError("xhr poll error",e)})),this.pollXhr=e},s(l.prototype),l.prototype.create=function(){var e={agent:this.agent,xdomain:this.xd,xscheme:this.xs,enablesXDR:this.enablesXDR};e.pfx=this.pfx,e.key=this.key,e.passphrase=this.passphrase,e.cert=this.cert,e.ca=this.ca,e.ciphers=this.ciphers,e.rejectUnauthorized=this.rejectUnauthorized;var t=this.xhr=new n(e),o=this;try{a("xhr open %s: %s",this.method,this.uri),t.open(this.method,this.uri,this.async);try{if(this.extraHeaders)for(var s in t.setDisableHeaderCheck&&t.setDisableHeaderCheck(!0),this.extraHeaders)this.extraHeaders.hasOwnProperty(s)&&t.setRequestHeader(s,this.extraHeaders[s])}catch(e){}if("POST"===this.method)try{this.isBinary?t.setRequestHeader("Content-type","application/octet-stream"):t.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(e){}try{t.setRequestHeader("Accept","*/*")}catch(e){}"withCredentials"in t&&(t.withCredentials=!0),this.requestTimeout&&(t.timeout=this.requestTimeout),this.hasXDR()?(t.onload=function(){o.onLoad()},t.onerror=function(){o.onError(t.responseText)}):t.onreadystatechange=function(){if(2===t.readyState){var e;try{e=t.getResponseHeader("Content-Type")}catch(e){}"application/octet-stream"===e&&(t.responseType="arraybuffer")}4===t.readyState&&(200===t.status||1223===t.status?o.onLoad():setTimeout((function(){o.onError(t.status)}),0))},a("xhr data %s",this.data),t.send(this.data)}catch(e){return void setTimeout((function(){o.onError(e)}),0)}r.g.document&&(this.index=l.requestsCount++,l.requests[this.index]=this)},l.prototype.onSuccess=function(){this.emit("success"),this.cleanup()},l.prototype.onData=function(e){this.emit("data",e),this.onSuccess()},l.prototype.onError=function(e){this.emit("error",e),this.cleanup(!0)},l.prototype.cleanup=function(e){if(void 0!==this.xhr&&null!==this.xhr){if(this.hasXDR()?this.xhr.onload=this.xhr.onerror=u:this.xhr.onreadystatechange=u,e)try{this.xhr.abort()}catch(e){}r.g.document&&delete l.requests[this.index],this.xhr=null}},l.prototype.onLoad=function(){var e;try{var t;try{t=this.xhr.getResponseHeader("Content-Type")}catch(e){}e="application/octet-stream"===t&&this.xhr.response||this.xhr.responseText}catch(e){this.onError(e)}null!=e&&this.onData(e)},l.prototype.hasXDR=function(){return void 0!==r.g.XDomainRequest&&!this.xs&&this.enablesXDR},l.prototype.abort=function(){this.cleanup()},l.requestsCount=0,l.requests={},r.g.document&&(r.g.attachEvent?r.g.attachEvent("onunload",f):r.g.addEventListener&&r.g.addEventListener("beforeunload",f,!1))},"./node_modules/engine.io-client/lib/transports/polling.js":(e,t,r)=>{var n=r("./node_modules/engine.io-client/lib/transport.js"),o=r("./node_modules/parseqs/index.js"),s=r("./node_modules/engine.io-parser/lib/browser.js"),i=r("./node_modules/component-inherit/index.js"),a=r("./node_modules/yeast/index.js"),u=r("./node_modules/debug/src/browser.js")("engine.io-client:polling");e.exports=l;var c=null!=new(r("./node_modules/engine.io-client/lib/xmlhttprequest.js"))({xdomain:!1}).responseType;function l(e){var t=e&&e.forceBase64;c&&!t||(this.supportsBinary=!1),n.call(this,e)}i(l,n),l.prototype.name="polling",l.prototype.doOpen=function(){this.poll()},l.prototype.pause=function(e){var t=this;function r(){u("paused"),t.readyState="paused",e()}if(this.readyState="pausing",this.polling||!this.writable){var n=0;this.polling&&(u("we are currently polling - waiting to pause"),n++,this.once("pollComplete",(function(){u("pre-pause polling complete"),--n||r()}))),this.writable||(u("we are currently writing - waiting to pause"),n++,this.once("drain",(function(){u("pre-pause writing complete"),--n||r()})))}else r()},l.prototype.poll=function(){u("polling"),this.polling=!0,this.doPoll(),this.emit("poll")},l.prototype.onData=function(e){var t=this;u("polling got data %s",e),s.decodePayload(e,this.socket.binaryType,(function(e,r,n){if("opening"===t.readyState&&t.onOpen(),"close"===e.type)return t.onClose(),!1;t.onPacket(e)})),"closed"!==this.readyState&&(this.polling=!1,this.emit("pollComplete"),"open"===this.readyState?this.poll():u('ignoring poll - transport state "%s"',this.readyState))},l.prototype.doClose=function(){var e=this;function t(){u("writing close packet"),e.write([{type:"close"}])}"open"===this.readyState?(u("transport open - closing"),t()):(u("transport not open - deferring close"),this.once("open",t))},l.prototype.write=function(e){var t=this;this.writable=!1;var r=function(){t.writable=!0,t.emit("drain")};s.encodePayload(e,this.supportsBinary,(function(e){t.doWrite(e,r)}))},l.prototype.uri=function(){var e=this.query||{},t=this.secure?"https":"http",r="";return!1!==this.timestampRequests&&(e[this.timestampParam]=a()),this.supportsBinary||e.sid||(e.b64=1),e=o.encode(e),this.port&&("https"===t&&443!==Number(this.port)||"http"===t&&80!==Number(this.port))&&(r=":"+this.port),e.length&&(e="?"+e),t+"://"+(-1!==this.hostname.indexOf(":")?"["+this.hostname+"]":this.hostname)+r+this.path+e}},"./node_modules/engine.io-client/lib/transports/websocket.js":(e,t,r)=>{var n,o=r("./node_modules/engine.io-client/lib/transport.js"),s=r("./node_modules/engine.io-parser/lib/browser.js"),i=r("./node_modules/parseqs/index.js"),a=r("./node_modules/component-inherit/index.js"),u=r("./node_modules/yeast/index.js"),c=r("./node_modules/debug/src/browser.js")("engine.io-client:websocket"),l=r.g.WebSocket||r.g.MozWebSocket;if("undefined"==typeof window)try{n=r("?1bcf")}catch(e){}var f=l;function p(e){e&&e.forceBase64&&(this.supportsBinary=!1),this.perMessageDeflate=e.perMessageDeflate,this.usingBrowserWebSocket=l&&!e.forceNode,this.protocols=e.protocols,this.usingBrowserWebSocket||(f=n),o.call(this,e)}f||"undefined"!=typeof window||(f=n),e.exports=p,a(p,o),p.prototype.name="websocket",p.prototype.supportsBinary=!0,p.prototype.doOpen=function(){if(this.check()){var e=this.uri(),t=this.protocols,r={agent:this.agent,perMessageDeflate:this.perMessageDeflate};r.pfx=this.pfx,r.key=this.key,r.passphrase=this.passphrase,r.cert=this.cert,r.ca=this.ca,r.ciphers=this.ciphers,r.rejectUnauthorized=this.rejectUnauthorized,this.extraHeaders&&(r.headers=this.extraHeaders),this.localAddress&&(r.localAddress=this.localAddress);try{this.ws=this.usingBrowserWebSocket?t?new f(e,t):new f(e):new f(e,t,r)}catch(e){return this.emit("error",e)}void 0===this.ws.binaryType&&(this.supportsBinary=!1),this.ws.supports&&this.ws.supports.binary?(this.supportsBinary=!0,this.ws.binaryType="nodebuffer"):this.ws.binaryType="arraybuffer",this.addEventListeners()}},p.prototype.addEventListeners=function(){var e=this;this.ws.onopen=function(){e.onOpen()},this.ws.onclose=function(){e.onClose()},this.ws.onmessage=function(t){e.onData(t.data)},this.ws.onerror=function(t){e.onError("websocket error",t)}},p.prototype.write=function(e){var t=this;this.writable=!1;for(var n=e.length,o=0,i=n;o<i;o++)!function(e){s.encodePacket(e,t.supportsBinary,(function(o){if(!t.usingBrowserWebSocket){var s={};e.options&&(s.compress=e.options.compress),t.perMessageDeflate&&("string"==typeof o?r.g.Buffer.byteLength(o):o.length)<t.perMessageDeflate.threshold&&(s.compress=!1)}try{t.usingBrowserWebSocket?t.ws.send(o):t.ws.send(o,s)}catch(e){c("websocket closed before onclose event")}--n||(t.emit("flush"),setTimeout((function(){t.writable=!0,t.emit("drain")}),0))}))}(e[o])},p.prototype.onClose=function(){o.prototype.onClose.call(this)},p.prototype.doClose=function(){void 0!==this.ws&&this.ws.close()},p.prototype.uri=function(){var e=this.query||{},t=this.secure?"wss":"ws",r="";return this.port&&("wss"===t&&443!==Number(this.port)||"ws"===t&&80!==Number(this.port))&&(r=":"+this.port),this.timestampRequests&&(e[this.timestampParam]=u()),this.supportsBinary||(e.b64=1),(e=i.encode(e)).length&&(e="?"+e),t+"://"+(-1!==this.hostname.indexOf(":")?"["+this.hostname+"]":this.hostname)+r+this.path+e},p.prototype.check=function(){return!(!f||"__initialize"in f&&this.name===p.prototype.name)}},"./node_modules/engine.io-client/lib/xmlhttprequest.js":(e,t,r)=>{var n=r("./node_modules/has-cors/index.js");e.exports=function(e){var t=e.xdomain,o=e.xscheme,s=e.enablesXDR;try{if("undefined"!=typeof XMLHttpRequest&&(!t||n))return new XMLHttpRequest}catch(e){}try{if("undefined"!=typeof XDomainRequest&&!o&&s)return new XDomainRequest}catch(e){}if(!t)try{return new(r.g[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(e){}}},"./node_modules/engine.io-parser/lib/browser.js":(e,t,r)=>{var n,o=r("./node_modules/engine.io-parser/lib/keys.js"),s=r("./node_modules/has-binary2/index.js"),i=r("./node_modules/arraybuffer.slice/index.js"),a=r("./node_modules/after/index.js"),u=r("./node_modules/engine.io-parser/lib/utf8.js");r.g&&r.g.ArrayBuffer&&(n=r("./node_modules/base64-arraybuffer/lib/base64-arraybuffer.js"));var c="undefined"!=typeof navigator&&/Android/i.test(navigator.userAgent),l="undefined"!=typeof navigator&&/PhantomJS/i.test(navigator.userAgent),f=c||l;t.protocol=3;var p=t.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6},d=o(p),h={type:"error",data:"parser error"},y=r("./node_modules/blob/index.js");function v(e,t,r){for(var n=new Array(e.length),o=a(e.length,r),s=function(e,r,o){t(r,(function(t,r){n[e]=r,o(t,n)}))},i=0;i<e.length;i++)s(i,e[i],o)}t.encodePacket=function(e,n,o,s){"function"==typeof n&&(s=n,n=!1),"function"==typeof o&&(s=o,o=null);var i=void 0===e.data?void 0:e.data.buffer||e.data;if(r.g.ArrayBuffer&&i instanceof ArrayBuffer)return function(e,r,n){if(!r)return t.encodeBase64Packet(e,n);var o=e.data,s=new Uint8Array(o),i=new Uint8Array(1+o.byteLength);i[0]=p[e.type];for(var a=0;a<s.length;a++)i[a+1]=s[a];return n(i.buffer)}(e,n,s);if(y&&i instanceof r.g.Blob)return function(e,r,n){if(!r)return t.encodeBase64Packet(e,n);if(f)return function(e,r,n){if(!r)return t.encodeBase64Packet(e,n);var o=new FileReader;return o.onload=function(){e.data=o.result,t.encodePacket(e,r,!0,n)},o.readAsArrayBuffer(e.data)}(e,r,n);var o=new Uint8Array(1);o[0]=p[e.type];var s=new y([o.buffer,e.data]);return n(s)}(e,n,s);if(i&&i.base64)return function(e,r){var n="b"+t.packets[e.type]+e.data.data;return r(n)}(e,s);var a=p[e.type];return void 0!==e.data&&(a+=o?u.encode(String(e.data),{strict:!1}):String(e.data)),s(""+a)},t.encodeBase64Packet=function(e,n){var o,s="b"+t.packets[e.type];if(y&&e.data instanceof r.g.Blob){var i=new FileReader;return i.onload=function(){var e=i.result.split(",")[1];n(s+e)},i.readAsDataURL(e.data)}try{o=String.fromCharCode.apply(null,new Uint8Array(e.data))}catch(t){for(var a=new Uint8Array(e.data),u=new Array(a.length),c=0;c<a.length;c++)u[c]=a[c];o=String.fromCharCode.apply(null,u)}return s+=r.g.btoa(o),n(s)},t.decodePacket=function(e,r,n){if(void 0===e)return h;if("string"==typeof e){if("b"===e.charAt(0))return t.decodeBase64Packet(e.substr(1),r);if(n&&!1===(e=function(e){try{e=u.decode(e,{strict:!1})}catch(e){return!1}return e}(e)))return h;var o=e.charAt(0);return Number(o)==o&&d[o]?e.length>1?{type:d[o],data:e.substring(1)}:{type:d[o]}:h}o=new Uint8Array(e)[0];var s=i(e,1);return y&&"blob"===r&&(s=new y([s])),{type:d[o],data:s}},t.decodeBase64Packet=function(e,t){var r=d[e.charAt(0)];if(!n)return{type:r,data:{base64:!0,data:e.substr(1)}};var o=n.decode(e.substr(1));return"blob"===t&&y&&(o=new y([o])),{type:r,data:o}},t.encodePayload=function(e,r,n){"function"==typeof r&&(n=r,r=null);var o=s(e);return r&&o?y&&!f?t.encodePayloadAsBlob(e,n):t.encodePayloadAsArrayBuffer(e,n):e.length?void v(e,(function(e,n){t.encodePacket(e,!!o&&r,!1,(function(e){n(null,function(e){return e.length+":"+e}(e))}))}),(function(e,t){return n(t.join(""))})):n("0:")},t.decodePayload=function(e,r,n){if("string"!=typeof e)return t.decodePayloadAsBinary(e,r,n);var o;if("function"==typeof r&&(n=r,r=null),""===e)return n(h,0,1);for(var s,i,a="",u=0,c=e.length;u<c;u++){var l=e.charAt(u);if(":"===l){if(""===a||a!=(s=Number(a)))return n(h,0,1);if(a!=(i=e.substr(u+1,s)).length)return n(h,0,1);if(i.length){if(o=t.decodePacket(i,r,!1),h.type===o.type&&h.data===o.data)return n(h,0,1);if(!1===n(o,u+s,c))return}u+=s,a=""}else a+=l}return""!==a?n(h,0,1):void 0},t.encodePayloadAsArrayBuffer=function(e,r){if(!e.length)return r(new ArrayBuffer(0));v(e,(function(e,r){t.encodePacket(e,!0,!0,(function(e){return r(null,e)}))}),(function(e,t){var n=t.reduce((function(e,t){var r;return e+(r="string"==typeof t?t.length:t.byteLength).toString().length+r+2}),0),o=new Uint8Array(n),s=0;return t.forEach((function(e){var t="string"==typeof e,r=e;if(t){for(var n=new Uint8Array(e.length),i=0;i<e.length;i++)n[i]=e.charCodeAt(i);r=n.buffer}o[s++]=t?0:1;var a=r.byteLength.toString();for(i=0;i<a.length;i++)o[s++]=parseInt(a[i]);for(o[s++]=255,n=new Uint8Array(r),i=0;i<n.length;i++)o[s++]=n[i]})),r(o.buffer)}))},t.encodePayloadAsBlob=function(e,r){v(e,(function(e,r){t.encodePacket(e,!0,!0,(function(e){var t=new Uint8Array(1);if(t[0]=1,"string"==typeof e){for(var n=new Uint8Array(e.length),o=0;o<e.length;o++)n[o]=e.charCodeAt(o);e=n.buffer,t[0]=0}var s=(e instanceof ArrayBuffer?e.byteLength:e.size).toString(),i=new Uint8Array(s.length+1);for(o=0;o<s.length;o++)i[o]=parseInt(s[o]);if(i[s.length]=255,y){var a=new y([t.buffer,i.buffer,e]);r(null,a)}}))}),(function(e,t){return r(new y(t))}))},t.decodePayloadAsBinary=function(e,r,n){"function"==typeof r&&(n=r,r=null);for(var o=e,s=[];o.byteLength>0;){for(var a=new Uint8Array(o),u=0===a[0],c="",l=1;255!==a[l];l++){if(c.length>310)return n(h,0,1);c+=a[l]}o=i(o,2+c.length),c=parseInt(c);var f=i(o,0,c);if(u)try{f=String.fromCharCode.apply(null,new Uint8Array(f))}catch(e){var p=new Uint8Array(f);for(f="",l=0;l<p.length;l++)f+=String.fromCharCode(p[l])}s.push(f),o=i(o,c)}var d=s.length;s.forEach((function(e,o){n(t.decodePacket(e,r,!0),o,d)}))}},"./node_modules/engine.io-parser/lib/keys.js":e=>{e.exports=Object.keys||function(e){var t=[],r=Object.prototype.hasOwnProperty;for(var n in e)r.call(e,n)&&t.push(n);return t}},"./node_modules/engine.io-parser/lib/utf8.js":function(e,t,r){var n;e=r.nmd(e),function(o){var s=(e&&e.exports,"object"==typeof r.g&&r.g);s.global!==s&&s.window;var i,a,u,c=String.fromCharCode;function l(e){for(var t,r,n=[],o=0,s=e.length;o<s;)(t=e.charCodeAt(o++))>=55296&&t<=56319&&o<s?56320==(64512&(r=e.charCodeAt(o++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),o--):n.push(t);return n}function f(e,t){if(e>=55296&&e<=57343){if(t)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function p(e,t){return c(e>>t&63|128)}function d(e,t){if(0==(4294967168&e))return c(e);var r="";return 0==(4294965248&e)?r=c(e>>6&31|192):0==(4294901760&e)?(f(e,t)||(e=65533),r=c(e>>12&15|224),r+=p(e,6)):0==(4292870144&e)&&(r=c(e>>18&7|240),r+=p(e,12),r+=p(e,6)),r+=c(63&e|128)}function h(){if(u>=a)throw Error("Invalid byte index");var e=255&i[u];if(u++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function y(e){var t,r;if(u>a)throw Error("Invalid byte index");if(u==a)return!1;if(t=255&i[u],u++,0==(128&t))return t;if(192==(224&t)){if((r=(31&t)<<6|h())>=128)return r;throw Error("Invalid continuation byte")}if(224==(240&t)){if((r=(15&t)<<12|h()<<6|h())>=2048)return f(r,e)?r:65533;throw Error("Invalid continuation byte")}if(240==(248&t)&&(r=(7&t)<<18|h()<<12|h()<<6|h())>=65536&&r<=1114111)return r;throw Error("Invalid UTF-8 detected")}var v={version:"2.1.2",encode:function(e,t){for(var r=!1!==(t=t||{}).strict,n=l(e),o=n.length,s=-1,i="";++s<o;)i+=d(n[s],r);return i},decode:function(e,t){var r=!1!==(t=t||{}).strict;i=l(e),a=i.length,u=0;for(var n,o=[];!1!==(n=y(r));)o.push(n);return function(e){for(var t,r=e.length,n=-1,o="";++n<r;)(t=e[n])>65535&&(o+=c((t-=65536)>>>10&1023|55296),t=56320|1023&t),o+=c(t);return o}(o)}};void 0===(n=function(){return v}.call(t,r,t,e))||(e.exports=n)}()},"./node_modules/has-binary2/index.js":(e,t,r)=>{var n=r("./node_modules/isarray/index.js"),o=Object.prototype.toString,s="function"==typeof r.g.Blob||"[object BlobConstructor]"===o.call(r.g.Blob),i="function"==typeof r.g.File||"[object FileConstructor]"===o.call(r.g.File);e.exports=function e(t){if(!t||"object"!=typeof t)return!1;if(n(t)){for(var o=0,a=t.length;o<a;o++)if(e(t[o]))return!0;return!1}if("function"==typeof r.g.Buffer&&r.g.Buffer.isBuffer&&r.g.Buffer.isBuffer(t)||"function"==typeof r.g.ArrayBuffer&&t instanceof ArrayBuffer||s&&t instanceof Blob||i&&t instanceof File)return!0;if(t.toJSON&&"function"==typeof t.toJSON&&1===arguments.length)return e(t.toJSON(),!0);for(var u in t)if(Object.prototype.hasOwnProperty.call(t,u)&&e(t[u]))return!0;return!1}},"./node_modules/has-cors/index.js":e=>{try{e.exports="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(t){e.exports=!1}},"./node_modules/indexof/index.js":e=>{var t=[].indexOf;e.exports=function(e,r){if(t)return e.indexOf(r);for(var n=0;n<e.length;++n)if(e[n]===r)return n;return-1}},"./node_modules/isarray/index.js":e=>{var t={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==t.call(e)}},"./node_modules/ms/index.js":e=>{var t=1e3,r=6e4,n=60*r,o=24*n;function s(e,t,r){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+r:Math.ceil(e/t)+" "+r+"s"}e.exports=function(e,i){i=i||{};var a,u=typeof e;if("string"===u&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var s=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(s){var i=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*i;case"days":case"day":case"d":return i*o;case"hours":case"hour":case"hrs":case"hr":case"h":return i*n;case"minutes":case"minute":case"mins":case"min":case"m":return i*r;case"seconds":case"second":case"secs":case"sec":case"s":return i*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return i;default:return}}}}(e);if("number"===u&&!1===isNaN(e))return i.long?s(a=e,o,"day")||s(a,n,"hour")||s(a,r,"minute")||s(a,t,"second")||a+" ms":function(e){return e>=o?Math.round(e/o)+"d":e>=n?Math.round(e/n)+"h":e>=r?Math.round(e/r)+"m":e>=t?Math.round(e/t)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},"./node_modules/parseqs/index.js":(e,t)=>{t.encode=function(e){var t="";for(var r in e)e.hasOwnProperty(r)&&(t.length&&(t+="&"),t+=encodeURIComponent(r)+"="+encodeURIComponent(e[r]));return t},t.decode=function(e){for(var t={},r=e.split("&"),n=0,o=r.length;n<o;n++){var s=r[n].split("=");t[decodeURIComponent(s[0])]=decodeURIComponent(s[1])}return t}},"./node_modules/parseuri/index.js":e=>{var t=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,r=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];e.exports=function(e){var n=e,o=e.indexOf("["),s=e.indexOf("]");-1!=o&&-1!=s&&(e=e.substring(0,o)+e.substring(o,s).replace(/:/g,";")+e.substring(s,e.length));for(var i=t.exec(e||""),a={},u=14;u--;)a[r[u]]=i[u]||"";return-1!=o&&-1!=s&&(a.source=n,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a}},"./node_modules/socket.io-client/lib/index.js":(e,t,r)=>{var n=r("./node_modules/socket.io-client/lib/url.js"),o=r("./src/socket-parser.js"),s=r("./node_modules/socket.io-client/lib/manager.js"),i=r("./node_modules/debug/src/browser.js")("socket.io-client");e.exports=t=u;var a=t.managers={};function u(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var r,o=n(e),u=o.source,c=o.id,l=o.path,f=a[c]&&l in a[c].nsps;return t.forceNew||t["force new connection"]||!1===t.multiplex||f?(i("ignoring socket cache for %s",u),r=s(u,t)):(a[c]||(i("new io instance for %s",u),a[c]=s(u,t)),r=a[c]),o.query&&!t.query&&(t.query=o.query),r.socket(o.path,t)}t.protocol=o.protocol,t.connect=u,t.Manager=r("./node_modules/socket.io-client/lib/manager.js"),t.Socket=r("./node_modules/socket.io-client/lib/socket.js")},"./node_modules/socket.io-client/lib/manager.js":(e,t,r)=>{var n=r("./node_modules/engine.io-client/lib/index.js"),o=r("./node_modules/socket.io-client/lib/socket.js"),s=r("./node_modules/component-emitter/index.js"),i=r("./src/socket-parser.js"),a=r("./node_modules/socket.io-client/lib/on.js"),u=r("./node_modules/component-bind/index.js"),c=r("./node_modules/debug/src/browser.js")("socket.io-client:manager"),l=r("./node_modules/indexof/index.js"),f=r("./node_modules/backo2/index.js"),p=Object.prototype.hasOwnProperty;function d(e,t){if(!(this instanceof d))return new d(e,t);e&&"object"==typeof e&&(t=e,e=void 0),(t=t||{}).path=t.path||"/socket.io",this.nsps={},this.subs=[],this.opts=t,this.reconnection(!1!==t.reconnection),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor(t.randomizationFactor||.5),this.backoff=new f({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==t.timeout?2e4:t.timeout),this.readyState="closed",this.uri=e,this.connecting=[],this.lastPing=null,this.encoding=!1,this.packetBuffer=[];var r=t.parser||i;this.encoder=new r.Encoder,this.decoder=new r.Decoder,this.autoConnect=!1!==t.autoConnect,this.autoConnect&&this.open()}e.exports=d,d.prototype.emitAll=function(){for(var e in this.emit.apply(this,arguments),this.nsps)p.call(this.nsps,e)&&this.nsps[e].emit.apply(this.nsps[e],arguments)},d.prototype.updateSocketIds=function(){for(var e in this.nsps)p.call(this.nsps,e)&&(this.nsps[e].id=this.generateId(e))},d.prototype.generateId=function(e){return("/"===e?"":e+"#")+this.engine.id},s(d.prototype),d.prototype.reconnection=function(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection},d.prototype.reconnectionAttempts=function(e){return arguments.length?(this._reconnectionAttempts=e,this):this._reconnectionAttempts},d.prototype.reconnectionDelay=function(e){return arguments.length?(this._reconnectionDelay=e,this.backoff&&this.backoff.setMin(e),this):this._reconnectionDelay},d.prototype.randomizationFactor=function(e){return arguments.length?(this._randomizationFactor=e,this.backoff&&this.backoff.setJitter(e),this):this._randomizationFactor},d.prototype.reconnectionDelayMax=function(e){return arguments.length?(this._reconnectionDelayMax=e,this.backoff&&this.backoff.setMax(e),this):this._reconnectionDelayMax},d.prototype.timeout=function(e){return arguments.length?(this._timeout=e,this):this._timeout},d.prototype.maybeReconnectOnOpen=function(){!this.reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()},d.prototype.open=d.prototype.connect=function(e,t){if(c("readyState %s",this.readyState),~this.readyState.indexOf("open"))return this;c("opening %s",this.uri),this.engine=n(this.uri,this.opts);var r=this.engine,o=this;this.readyState="opening",this.skipReconnect=!1;var s=a(r,"open",(function(){o.onopen(),e&&e()})),i=a(r,"error",(function(t){if(c("connect_error"),o.cleanup(),o.readyState="closed",o.emitAll("connect_error",t),e){var r=new Error("Connection error");r.data=t,e(r)}else o.maybeReconnectOnOpen()}));if(!1!==this._timeout){var u=this._timeout;c("connect attempt will timeout after %d",u);var l=setTimeout((function(){c("connect attempt timed out after %d",u),s.destroy(),r.close(),r.emit("error","timeout"),o.emitAll("connect_timeout",u)}),u);this.subs.push({destroy:function(){clearTimeout(l)}})}return this.subs.push(s),this.subs.push(i),this},d.prototype.onopen=function(){c("open"),this.cleanup(),this.readyState="open",this.emit("open");var e=this.engine;this.subs.push(a(e,"data",u(this,"ondata"))),this.subs.push(a(e,"ping",u(this,"onping"))),this.subs.push(a(e,"pong",u(this,"onpong"))),this.subs.push(a(e,"error",u(this,"onerror"))),this.subs.push(a(e,"close",u(this,"onclose"))),this.subs.push(a(this.decoder,"decoded",u(this,"ondecoded")))},d.prototype.onping=function(){this.lastPing=new Date,this.emitAll("ping")},d.prototype.onpong=function(){this.emitAll("pong",new Date-this.lastPing)},d.prototype.ondata=function(e){this.decoder.add(e)},d.prototype.ondecoded=function(e){this.emit("packet",e)},d.prototype.onerror=function(e){c("error",e),this.emitAll("error",e)},d.prototype.socket=function(e,t){var r=this.nsps[e];if(!r){r=new o(this,e,t),this.nsps[e]=r;var n=this;r.on("connecting",s),r.on("connect",(function(){r.id=n.generateId(e)})),this.autoConnect&&s()}function s(){~l(n.connecting,r)||n.connecting.push(r)}return r},d.prototype.destroy=function(e){var t=l(this.connecting,e);~t&&this.connecting.splice(t,1),this.connecting.length||this.close()},d.prototype.packet=function(e){c("writing packet %j",e);var t=this;e.query&&0===e.type&&(e.nsp+="?"+e.query),t.encoding?t.packetBuffer.push(e):(t.encoding=!0,this.encoder.encode(e,(function(r){for(var n=0;n<r.length;n++)t.engine.write(r[n],e.options);t.encoding=!1,t.processPacketQueue()})))},d.prototype.processPacketQueue=function(){if(this.packetBuffer.length>0&&!this.encoding){var e=this.packetBuffer.shift();this.packet(e)}},d.prototype.cleanup=function(){c("cleanup");for(var e=this.subs.length,t=0;t<e;t++)this.subs.shift().destroy();this.packetBuffer=[],this.encoding=!1,this.lastPing=null,this.decoder.destroy()},d.prototype.close=d.prototype.disconnect=function(){c("disconnect"),this.skipReconnect=!0,this.reconnecting=!1,"opening"===this.readyState&&this.cleanup(),this.backoff.reset(),this.readyState="closed",this.engine&&this.engine.close()},d.prototype.onclose=function(e){c("onclose"),this.cleanup(),this.backoff.reset(),this.readyState="closed",this.emit("close",e),this._reconnection&&!this.skipReconnect&&this.reconnect()},d.prototype.reconnect=function(){if(this.reconnecting||this.skipReconnect)return this;var e=this;if(this.backoff.attempts>=this._reconnectionAttempts)c("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var t=this.backoff.duration();c("will wait %dms before reconnect attempt",t),this.reconnecting=!0;var r=setTimeout((function(){e.skipReconnect||(c("attempting reconnect"),e.emitAll("reconnect_attempt",e.backoff.attempts),e.emitAll("reconnecting",e.backoff.attempts),e.skipReconnect||e.open((function(t){t?(c("reconnect attempt error"),e.reconnecting=!1,e.reconnect(),e.emitAll("reconnect_error",t.data)):(c("reconnect success"),e.onreconnect())})))}),t);this.subs.push({destroy:function(){clearTimeout(r)}})}},d.prototype.onreconnect=function(){var e=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",e)}},"./node_modules/socket.io-client/lib/on.js":e=>{e.exports=function(e,t,r){return e.on(t,r),{destroy:function(){e.removeListener(t,r)}}}},"./node_modules/socket.io-client/lib/socket.js":(e,t,r)=>{var n=r("./src/socket-parser.js"),o=r("./node_modules/component-emitter/index.js"),s=r("./node_modules/to-array/index.js"),i=r("./node_modules/socket.io-client/lib/on.js"),a=r("./node_modules/component-bind/index.js"),u=r("./node_modules/debug/src/browser.js")("socket.io-client:socket"),c=r("./node_modules/parseqs/index.js");e.exports=p;var l={connect:1,connect_error:1,connect_timeout:1,connecting:1,disconnect:1,error:1,reconnect:1,reconnect_attempt:1,reconnect_failed:1,reconnect_error:1,reconnecting:1,ping:1,pong:1},f=o.prototype.emit;function p(e,t,r){this.io=e,this.nsp=t,this.json=this,this.ids=0,this.acks={},this.receiveBuffer=[],this.sendBuffer=[],this.connected=!1,this.disconnected=!0,r&&r.query&&(this.query=r.query),this.io.autoConnect&&this.open()}o(p.prototype),p.prototype.subEvents=function(){if(!this.subs){var e=this.io;this.subs=[i(e,"open",a(this,"onopen")),i(e,"packet",a(this,"onpacket")),i(e,"close",a(this,"onclose"))]}},p.prototype.open=p.prototype.connect=function(){return this.connected||(this.subEvents(),this.io.open(),"open"===this.io.readyState&&this.onopen(),this.emit("connecting")),this},p.prototype.send=function(){var e=s(arguments);return e.unshift("message"),this.emit.apply(this,e),this},p.prototype.emit=function(e){if(l.hasOwnProperty(e))return f.apply(this,arguments),this;var t=s(arguments),r={type:n.EVENT,data:t,options:{}};return r.options.compress=!this.flags||!1!==this.flags.compress,"function"==typeof t[t.length-1]&&(u("emitting packet with ack id %d",this.ids),this.acks[this.ids]=t.pop(),r.id=this.ids++),this.connected?this.packet(r):this.sendBuffer.push(r),delete this.flags,this},p.prototype.packet=function(e){e.nsp=this.nsp,this.io.packet(e)},p.prototype.onopen=function(){if(u("transport is open - connecting"),"/"!==this.nsp)if(this.query){var e="object"==typeof this.query?c.encode(this.query):this.query;u("sending connect packet with query %s",e),this.packet({type:n.CONNECT,query:e})}else this.packet({type:n.CONNECT})},p.prototype.onclose=function(e){u("close (%s)",e),this.connected=!1,this.disconnected=!0,delete this.id,this.emit("disconnect",e)},p.prototype.onpacket=function(e){if(e.nsp===this.nsp)switch(e.type){case n.CONNECT:this.onconnect();break;case n.EVENT:case n.BINARY_EVENT:this.onevent(e);break;case n.ACK:case n.BINARY_ACK:this.onack(e);break;case n.DISCONNECT:this.ondisconnect();break;case n.ERROR:this.emit("error",e.data)}},p.prototype.onevent=function(e){var t=e.data||[];u("emitting event %j",t),null!=e.id&&(u("attaching ack callback to event"),t.push(this.ack(e.id))),this.connected?f.apply(this,t):this.receiveBuffer.push(t)},p.prototype.ack=function(e){var t=this,r=!1;return function(){if(!r){r=!0;var o=s(arguments);u("sending ack %j",o),t.packet({type:n.ACK,id:e,data:o})}}},p.prototype.onack=function(e){var t=this.acks[e.id];"function"==typeof t?(u("calling ack %s with %j",e.id,e.data),t.apply(this,e.data),delete this.acks[e.id]):u("bad ack %s",e.id)},p.prototype.onconnect=function(){this.connected=!0,this.disconnected=!1,this.emit("connect"),this.emitBuffered()},p.prototype.emitBuffered=function(){var e;for(e=0;e<this.receiveBuffer.length;e++)f.apply(this,this.receiveBuffer[e]);for(this.receiveBuffer=[],e=0;e<this.sendBuffer.length;e++)this.packet(this.sendBuffer[e]);this.sendBuffer=[]},p.prototype.ondisconnect=function(){u("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")},p.prototype.destroy=function(){if(this.subs){for(var e=0;e<this.subs.length;e++)this.subs[e].destroy();this.subs=null}this.io.destroy(this)},p.prototype.close=p.prototype.disconnect=function(){return this.connected&&(u("performing disconnect (%s)",this.nsp),this.packet({type:n.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this},p.prototype.compress=function(e){return this.flags=this.flags||{},this.flags.compress=e,this}},"./node_modules/socket.io-client/lib/url.js":(e,t,r)=>{var n=r("./node_modules/parseuri/index.js"),o=r("./node_modules/debug/src/browser.js")("socket.io-client:url");e.exports=function(e,t){var s=e;t=t||r.g.location,null==e&&(e=t.protocol+"//"+t.host),"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?t.protocol+e:t.host+e),/^(https?|wss?):\/\//.test(e)||(o("protocol-less url %s",e),e=void 0!==t?t.protocol+"//"+e:"https://"+e),o("parse %s",e),s=n(e)),s.port||(/^(http|ws)$/.test(s.protocol)?s.port="80":/^(http|ws)s$/.test(s.protocol)&&(s.port="443")),s.path=s.path||"/";var i=-1!==s.host.indexOf(":")?"["+s.host+"]":s.host;return s.id=s.protocol+"://"+i+":"+s.port,s.href=s.protocol+"://"+i+(t&&t.port===s.port?"":":"+s.port),s}},"./node_modules/to-array/index.js":e=>{e.exports=function(e,t){for(var r=[],n=(t=t||0)||0;n<e.length;n++)r[n-t]=e[n];return r}},"./node_modules/yeast/index.js":e=>{"use strict";var t,r="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),n={},o=0,s=0;function i(e){var t="";do{t=r[e%64]+t,e=Math.floor(e/64)}while(e>0);return t}function a(){var e=i(+new Date);return e!==t?(o=0,t=e):e+"."+i(o++)}for(;s<64;s++)n[r[s]]=s;a.encode=i,a.decode=function(e){var t=0;for(s=0;s<e.length;s++)t=64*t+n[e.charAt(s)];return t},e.exports=a},"?1bcf":()=>{}},t={};function s(r){var n=t[r];if(void 0!==n)return n.exports;var o=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(o.exports,o,o.exports,s),o.loaded=!0,o.exports}return s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),s("./src/index.js")})(),e.exports=s()},6877:e=>{e.exports=function(e,t,r,n,o){var s={};return Object.keys(n).forEach((function(e){s[e]=n[e]})),s.enumerable=!!s.enumerable,s.configurable=!!s.configurable,("value"in s||s.initializer)&&(s.writable=!0),s=r.slice().reverse().reduce((function(r,n){return n(e,t,r)||r}),s),o&&void 0!==s.initializer&&(s.value=s.initializer?s.initializer.call(o):void 0,s.initializer=void 0),void 0===s.initializer&&(Object.defineProperty(e,t,s),s=null),s},e.exports.__esModule=!0,e.exports.default=e.exports},3897:e=>{e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n},e.exports.__esModule=!0,e.exports.default=e.exports},5372:e=>{e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports},3405:(e,t,r)=>{var n=r(3897);e.exports=function(e){if(Array.isArray(e))return n(e)},e.exports.__esModule=!0,e.exports.default=e.exports},6115:e=>{e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports},7156:e=>{function t(e,t,r,n,o,s,i){try{var a=e[s](i),u=a.value}catch(e){return void r(e)}a.done?t(u):Promise.resolve(u).then(n,o)}e.exports=function(e){return function(){var r=this,n=arguments;return new Promise((function(o,s){var i=e.apply(r,n);function a(e){t(i,o,s,a,u,"next",e)}function u(e){t(i,o,s,a,u,"throw",e)}a(void 0)}))}},e.exports.__esModule=!0,e.exports.default=e.exports},6690:e=>{e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},3515:(e,t,r)=>{var n=r(6015),o=r(9617);function s(t,r,i){return o()?(e.exports=s=Reflect.construct.bind(),e.exports.__esModule=!0,e.exports.default=e.exports):(e.exports=s=function(e,t,r){var o=[null];o.push.apply(o,t);var s=new(Function.bind.apply(e,o));return r&&n(s,r.prototype),s},e.exports.__esModule=!0,e.exports.default=e.exports),s.apply(null,arguments)}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports},9728:(e,t,r)=>{var n=r(4062);function o(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,n(o.key),o)}}e.exports=function(e,t,r){return t&&o(e.prototype,t),r&&o(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},8416:(e,t,r)=>{var n=r(4062);e.exports=function(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},434:e=>{function t(){return e.exports=t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},e.exports.__esModule=!0,e.exports.default=e.exports,t.apply(this,arguments)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},1588:(e,t,r)=>{var n=r(1753);function o(){return"undefined"!=typeof Reflect&&Reflect.get?(e.exports=o=Reflect.get.bind(),e.exports.__esModule=!0,e.exports.default=e.exports):(e.exports=o=function(e,t,r){var o=n(e,t);if(o){var s=Object.getOwnPropertyDescriptor(o,t);return s.get?s.get.call(arguments.length<3?e:r):s.value}},e.exports.__esModule=!0,e.exports.default=e.exports),o.apply(this,arguments)}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},3808:e=>{function t(r){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},1655:(e,t,r)=>{var n=r(6015);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&n(e,t)},e.exports.__esModule=!0,e.exports.default=e.exports},4836:e=>{e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},6035:e=>{e.exports=function(e){return-1!==Function.toString.call(e).indexOf("[native code]")},e.exports.__esModule=!0,e.exports.default=e.exports},9617:e=>{e.exports=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}},e.exports.__esModule=!0,e.exports.default=e.exports},9498:e=>{e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.__esModule=!0,e.exports.default=e.exports},8872:e=>{e.exports=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,s,i,a=[],u=!0,c=!1;try{if(s=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=s.call(r)).done)&&(a.push(n.value),a.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return a}},e.exports.__esModule=!0,e.exports.default=e.exports},2218:e=>{e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},2281:e=>{e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},215:(e,t,r)=>{var n=r(7071);e.exports=function(e,t){if(null==e)return{};var r,o,s=n(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)r=i[o],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s},e.exports.__esModule=!0,e.exports.default=e.exports},7071:e=>{e.exports=function(e,t){if(null==e)return{};var r,n,o={},s=Object.keys(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)>=0||(o[r]=e[r]);return o},e.exports.__esModule=!0,e.exports.default=e.exports},4993:(e,t,r)=>{var n=r(8698).default,o=r(6115);e.exports=function(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return o(e)},e.exports.__esModule=!0,e.exports.default=e.exports},7061:(e,t,r)=>{var n=r(8698).default;function o(){"use strict";e.exports=o=function(){return t},e.exports.__esModule=!0,e.exports.default=e.exports;var t={},r=Object.prototype,s=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},u=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof y?t:y,s=Object.create(o.prototype),a=new j(n||[]);return i(s,"_invoke",{value:S(e,r,a)}),s}function d(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var h={};function y(){}function v(){}function m(){}var b={};f(b,u,(function(){return this}));var g=Object.getPrototypeOf,w=g&&g(g(T([])));w&&w!==r&&s.call(w,u)&&(b=w);var k=m.prototype=y.prototype=Object.create(b);function E(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function O(e,t){var r;i(this,"_invoke",{value:function(o,i){function a(){return new t((function(r,a){!function r(o,i,a,u){var c=d(e[o],e,i);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==n(f)&&s.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,a,u)}),(function(e){r("throw",e,a,u)})):t.resolve(f).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,u)}))}u(c.arg)}(o,i,r,a)}))}return r=r?r.then(a,a):a()}})}function S(e,t,r){var n="suspendedStart";return function(o,s){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw s;return P()}for(r.method=o,r.arg=s;;){var i=r.delegate;if(i){var a=_(i,r);if(a){if(a===h)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=d(e,t,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===h)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function _(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,_(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var o=d(n,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,h;var s=o.arg;return s?s.done?(t[e.resultName]=s.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):s:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function R(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(R,this),this.reset(!0)}function T(e){if(e){var t=e[u];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,n=function t(){for(;++r<e.length;)if(s.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return n.next=n}}return{next:P}}function P(){return{value:void 0,done:!0}}return v.prototype=m,i(k,"constructor",{value:m,configurable:!0}),i(m,"constructor",{value:v,configurable:!0}),v.displayName=f(m,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},E(O.prototype),f(O.prototype,c,(function(){return this})),t.AsyncIterator=O,t.async=function(e,r,n,o,s){void 0===s&&(s=Promise);var i=new O(p(e,r,n,o),s);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},E(k),f(k,l,"Generator"),f(k,u,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=T,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!e)for(var t in this)"t"===t.charAt(0)&&s.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n],i=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var a=s.call(o,"catchLoc"),u=s.call(o,"finallyLoc");if(a&&u){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&s.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:T(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},t}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},6015:e=>{function t(r,n){return e.exports=t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r,n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},7424:(e,t,r)=>{var n=r(5372),o=r(8872),s=r(6116),i=r(2218);e.exports=function(e,t){return n(e)||o(e,t)||s(e,t)||i()},e.exports.__esModule=!0,e.exports.default=e.exports},1753:(e,t,r)=>{var n=r(3808);e.exports=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=n(e)););return e},e.exports.__esModule=!0,e.exports.default=e.exports},1589:(e,t,r)=>{var n=r(5372),o=r(9498),s=r(6116),i=r(2218);e.exports=function(e){return n(e)||o(e)||s(e)||i()},e.exports.__esModule=!0,e.exports.default=e.exports},861:(e,t,r)=>{var n=r(3405),o=r(9498),s=r(6116),i=r(2281);e.exports=function(e){return n(e)||o(e)||s(e)||i()},e.exports.__esModule=!0,e.exports.default=e.exports},5036:(e,t,r)=>{var n=r(8698).default;e.exports=function(e,t){if("object"!==n(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!==n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},4062:(e,t,r)=>{var n=r(8698).default,o=r(5036);e.exports=function(e){var t=o(e,"string");return"symbol"===n(t)?t:String(t)},e.exports.__esModule=!0,e.exports.default=e.exports},8698:e=>{function t(r){return e.exports=t="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},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},6116:(e,t,r)=>{var n=r(3897);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports},3496:(e,t,r)=>{var n=r(3808),o=r(6015),s=r(6035),i=r(3515);function a(t){var r="function"==typeof Map?new Map:void 0;return e.exports=a=function(e){if(null===e||!s(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(e))return r.get(e);r.set(e,t)}function t(){return i(e,arguments,n(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),o(t,e)},e.exports.__esModule=!0,e.exports.default=e.exports,a(t)}e.exports=a,e.exports.__esModule=!0,e.exports.default=e.exports},4687:(e,t,r)=>{var n=r(7061)();e.exports=n;try{regeneratorRuntime=n}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={exports:{}};return e[n].call(s.exports,s,s.exports,r),s.exports}return r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r(5579)})());
|
|
15
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Backendless=t():e.Backendless=t()}(self,()=>(()=>{var e={6129:(e,t,r)=>{"use strict";var n=r(4836);t.Z=void 0;var o=n(r(4687)),s=n(r(7156)),i=n(r(6690)),a=n(r(9728)),u=n(r(9853)),c=function(){function e(t){(0,i.default)(this,e),this.app=t}var t,r;return(0,a.default)(e,[{key:"activateFlow",value:(r=(0,s.default)(o.default.mark((function e(t,r){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error('The "flowName" argument must be provided and must be a string.');case 2:if(void 0===r||u.default.isObject(r)){e.next=4;break}throw new Error('The "initialData" argument must be an object with an arbitrary structure.');case 4:return e.abrupt("return",this.app.request.post({url:"".concat(this.app.urls.automationFlow(),"/activate-by-name"),data:{name:t,initialData:r}}));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"activateFlowTrigger",value:(t=(0,s.default)(o.default.mark((function e(t,r,n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error('The "flowName" argument must be provided and must be a string.');case 2:if(r&&"string"==typeof r){e.next=4;break}throw new Error('The "triggerName" argument must be provided and must be a string.');case 4:if(void 0===n||u.default.isObject(n)){e.next=6;break}throw new Error('The "data" argument must be an object with an arbitrary structure.');case 6:return e.abrupt("return",this.app.request.post({url:"".concat(this.app.urls.automationFlowTrigger(),"/activate-by-name"),query:{flowName:t,triggerName:r},data:n||{}}));case 7:case"end":return e.stop()}}),e,this)}))),function(e,r,n){return t.apply(this,arguments)})}]),e}();t.Z=c},8435:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isExecutionType=t.ExecutionTypes=t.EXECUTION_TYPE_HEADER=void 0;t.EXECUTION_TYPE_HEADER="bl-execution-type";var r={SYNC:"sync",ASYNC:"async",ASYNC_LOW_PRIORITY:"async-low-priority"};t.ExecutionTypes=r;var n=Object.keys(r).map((function(e){return r[e]}));t.isExecutionType=function(e){return n.includes(e)}},9589:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(4687)),s=n(r(8416)),i=n(r(7156)),a=n(r(6690)),u=n(r(9728)),c=r(8435);function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function f(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(t){(0,s.default)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var p=function(){function e(t){(0,a.default)(this,e),this.app=t}var t;return(0,u.default)(e,[{key:"invoke",value:(t=(0,i.default)(o.default.mark((function e(t,r,n,s){var i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Service Name must be provided and must be a string.");case 2:if(r&&"string"==typeof r){e.next=4;break}throw new Error("Method Name must be provided and must be a string.");case 4:return"string"==typeof s&&(s={executionType:s}),"string"==typeof n&&(0,c.isExecutionType)(n)&&(s={executionType:n},n=void 0),i=f({},(s=s||{}).httpRequestHeaders),s.executionType&&(i[c.EXECUTION_TYPE_HEADER]=s.executionType),e.abrupt("return",this.app.request.post({url:this.app.urls.blServiceMethod(t,r),data:n,headers:i}));case 10:case"end":return e.stop()}}),e,this)}))),function(e,r,n,o){return t.apply(this,arguments)})}]),e}();t.default=p},3084:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(4687)),s=n(r(8698)),i=n(r(7156)),a=n(r(6690)),u=n(r(9728)),c=r(8435),l=function(){function e(t){(0,a.default)(this,e),this.app=t}var t;return(0,u.default)(e,[{key:"dispatch",value:(t=(0,i.default)(o.default.mark((function e(t,r,n){var i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Event Name must be provided and must be a string.");case 2:if("string"==typeof r&&(0,c.isExecutionType)(r)&&(n=r,r=void 0),!r||"object"===(0,s.default)(r)&&!Array.isArray(r)){e.next=5;break}throw new Error("Event Arguments must be an object.");case 5:return i={},n&&(i[c.EXECUTION_TYPE_HEADER]=n),e.abrupt("return",this.app.request.post({url:this.app.urls.blEvent(t),data:r||{},headers:i}));case 8:case"end":return e.stop()}}),e,this)}))),function(e,r,n){return t.apply(this,arguments)})}]),e}();t.default=l},6912:(e,t,r)=>{"use strict";var n=r(4836);t.Z=void 0;var o=n(r(9728)),s=n(r(6690)),i=r(8435),a=n(r(9589)),u=n(r(3084)),c=(0,o.default)((function e(t){(0,s.default)(this,e),this.app=t,this.ExecutionTypes=i.ExecutionTypes,this.CustomServices=new a.default(t),this.Events=new u.default(t)}));t.Z=c},8469:(e,t,r)=>{"use strict";var n=r(4836);t.Z=void 0;var o=n(r(4687)),s=n(r(7156)),i=n(r(6690)),a=n(r(9728)),u=n(r(9853)),c=function(){function e(t){(0,i.default)(this,e),this.app=t,this.parsers={}}var t,r,n,c,l,f;return(0,a.default)(e,[{key:"setObjectFactory",value:function(e,t){this.parsers[e]=t}},{key:"parseItem",value:function(e){var t=e&&e.___class;if(t){var r=this.parsers[t];r&&(e=new r(e))}return e}},{key:"stringifyItem",value:function(e){return u.default.isCustomClassInstance(e)&&(e.___class=e.___class||u.default.getClassName(e)),JSON.stringify(e)}},{key:"put",value:(f=(0,s.default)(o.default.mark((function e(t,r,n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Cache Key must be provided and must be a string.");case 2:if(!n||!("number"!=typeof n||n<0)){e.next=4;break}throw new Error("Cache TimeToLive must be a positive number.");case 4:return e.abrupt("return",this.app.request.put({url:this.app.urls.cacheItem(t),query:{timeout:n},headers:{"Content-Type":"application/json"},data:this.stringifyItem(r)}));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return f.apply(this,arguments)})},{key:"get",value:(l=(0,s.default)(o.default.mark((function e(t){var r=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Cache Key must be provided and must be a string.");case 2:return e.abrupt("return",this.app.request.get({url:this.app.urls.cacheItem(t)}).then((function(e){return r.parseItem(e)})));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"remove",value:(c=(0,s.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Cache Key must be provided and must be a string.");case 2:return e.abrupt("return",this.app.request.delete({url:this.app.urls.cacheItem(t)}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return c.apply(this,arguments)})},{key:"contains",value:(n=(0,s.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Cache Key must be provided and must be a string.");case 2:return e.abrupt("return",this.app.request.get({url:this.app.urls.cacheItemCheck(t)}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"expireIn",value:(r=(0,s.default)(o.default.mark((function e(t,r){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Cache Key must be provided and must be a string.");case 2:if(!("number"!=typeof r||r<=0)){e.next=4;break}throw new Error("Cache Expiration must be provided and must be a number of seconds.");case 4:return e.abrupt("return",this.app.request.put({url:this.app.urls.cacheItemExpireIn(t),query:{timeout:r},data:{}}));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"expireAt",value:(t=(0,s.default)(o.default.mark((function e(t,r){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Cache Key must be provided and must be a string.");case 2:if(!(r instanceof Date)){e.next=6;break}r=r.getTime(),e.next=8;break;case 6:if(!("number"!=typeof r||r<=0)){e.next=8;break}throw new Error("Cache Expiration must be provided and must be a timestamp or an instance of Date.");case 8:return e.abrupt("return",this.app.request.put({url:this.app.urls.cacheItemExpireAt(t),query:{timestamp:r},data:{}}));case 9:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}]),e}();t.Z=c},5165:(e,t,r)=>{"use strict";var n=r(4836);t.Z=void 0;var o=n(r(4687)),s=n(r(7156)),i=n(r(6690)),a=n(r(9728)),u=function(){function e(t){(0,i.default)(this,e),this.app=t}var t,r,n;return(0,a.default)(e,[{key:"validatePlayPurchase",value:(n=(0,s.default)(o.default.mark((function e(t,r,n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Package Name must be provided and must be a string.");case 2:if(r&&"string"==typeof r){e.next=4;break}throw new Error("Product Id must be provided and must be a string.");case 4:if(n&&"string"==typeof n){e.next=6;break}throw new Error("Token must be provided and must be a string.");case 6:return e.abrupt("return",this.app.request.get({url:this.app.urls.commerceValidate(t,r,n)}));case 7:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return n.apply(this,arguments)})},{key:"cancelPlaySubscription",value:(r=(0,s.default)(o.default.mark((function e(t,r,n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Package Name must be provided and must be a string.");case 2:if(r&&"string"==typeof r){e.next=4;break}throw new Error("Subscription Id must be provided and must be a string.");case 4:if(n&&"string"==typeof n){e.next=6;break}throw new Error("Token must be provided and must be a string.");case 6:return e.abrupt("return",this.app.request.post({url:this.app.urls.commerceSubCancel(t,r,n)}));case 7:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return r.apply(this,arguments)})},{key:"getPlaySubscriptionStatus",value:(t=(0,s.default)(o.default.mark((function e(t,r,n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Package Name must be provided and must be a string.");case 2:if(r&&"string"==typeof r){e.next=4;break}throw new Error("Subscription Id must be provided and must be a string.");case 4:if(n&&"string"==typeof n){e.next=6;break}throw new Error("Token must be provided and must be a string.");case 6:return e.abrupt("return",this.app.request.get({url:this.app.urls.commerceSubStatus(t,r,n)}));case 7:case"end":return e.stop()}}),e,this)}))),function(e,r,n){return t.apply(this,arguments)})}]),e}();t.Z=u},5921:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(6690)),s=n(r(9728)),i=function(){function e(t,r){if((0,o.default)(this,e),!t||"string"!=typeof t)throw new Error("Counter Name must be non empty String");this.name=t,this.counters=r}return(0,s.default)(e,[{key:"incrementAndGet",value:function(){return this.counters.incrementAndGet(this.name)}},{key:"getAndIncrement",value:function(){return this.counters.getAndIncrement(this.name)}},{key:"decrementAndGet",value:function(){return this.counters.decrementAndGet(this.name)}},{key:"getAndDecrement",value:function(){return this.counters.getAndDecrement(this.name)}},{key:"reset",value:function(){return this.counters.reset(this.name)}},{key:"get",value:function(){return this.counters.get(this.name)}},{key:"addAndGet",value:function(e){return this.counters.addAndGet(this.name,e)}},{key:"getAndAdd",value:function(e){return this.counters.getAndAdd(this.name,e)}},{key:"compareAndSet",value:function(e,t){return this.counters.compareAndSet(this.name,e,t)}}]),e}();t.default=i},1062:(e,t,r)=>{"use strict";var n=r(4836);t.Z=void 0;var o=n(r(4687)),s=n(r(7156)),i=n(r(6690)),a=n(r(9728)),u=n(r(5921)),c=function(){function e(t){(0,i.default)(this,e),this.app=t}var t,r,n,c,l,f,p,d,h,y;return(0,a.default)(e,[{key:"of",value:function(e){return new u.default(e,this)}},{key:"list",value:(y=(0,s.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null==t||"string"==typeof t){e.next=2;break}throw new Error("Counters Pattern can be a string only");case 2:return e.abrupt("return",this.app.request.get({url:this.app.urls.countersList(t)}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return y.apply(this,arguments)})},{key:"incrementAndGet",value:(h=(0,s.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Counter Name must be provided and must be a string.");case 2:return e.abrupt("return",this.app.request.put({url:this.app.urls.counterIncrementAndGet(t)}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return h.apply(this,arguments)})},{key:"getAndIncrement",value:(d=(0,s.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Counter Name must be provided and must be a string.");case 2:return e.abrupt("return",this.app.request.put({url:this.app.urls.counterGetAndIncrement(t)}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return d.apply(this,arguments)})},{key:"decrementAndGet",value:(p=(0,s.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Counter Name must be provided and must be a string.");case 2:return e.abrupt("return",this.app.request.put({url:this.app.urls.counterDecrementAndGet(t)}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return p.apply(this,arguments)})},{key:"getAndDecrement",value:(f=(0,s.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Counter Name must be provided and must be a string.");case 2:return e.abrupt("return",this.app.request.put({url:this.app.urls.counterGetAndDecrement(t)}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return f.apply(this,arguments)})},{key:"reset",value:(l=(0,s.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Counter Name must be provided and must be a string.");case 2:return e.abrupt("return",this.app.request.put({url:this.app.urls.counterReset(t)}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"get",value:(c=(0,s.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Counter Name must be provided and must be a string.");case 2:return e.abrupt("return",this.app.request.get({url:this.app.urls.counter(t)}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return c.apply(this,arguments)})},{key:"addAndGet",value:(n=(0,s.default)(o.default.mark((function e(t,r){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Counter Name must be provided and must be a string.");case 2:if("number"==typeof r){e.next=4;break}throw new Error("Counter Value must be a number.");case 4:return e.abrupt("return",this.app.request.put({url:this.app.urls.counterAddAndGet(t),query:{value:r}}));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"getAndAdd",value:(r=(0,s.default)(o.default.mark((function e(t,r){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Counter Name must be provided and must be a string.");case 2:if("number"==typeof r){e.next=4;break}throw new Error("Counter Value must be a number.");case 4:return e.abrupt("return",this.app.request.put({url:this.app.urls.counterGetAndAdd(t),query:{value:r}}));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"compareAndSet",value:(t=(0,s.default)(o.default.mark((function e(t,r,n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Counter Name must be provided and must be a string.");case 2:if("number"==typeof r){e.next=4;break}throw new Error("Counter Expected Value must be a number.");case 4:if("number"==typeof n){e.next=6;break}throw new Error("Counter Updated Value must be a number.");case 6:return e.abrupt("return",this.app.request.put({url:this.app.urls.counterCompareAndSet(t),query:{expected:r,updatedvalue:n}}));case 7:case"end":return e.stop()}}),e,this)}))),function(e,r,n){return t.apply(this,arguments)})}]),e}();t.Z=c},3082:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.PAGING_DEFAULTS=void 0;var o=n(r(8416)),s=n(r(6690)),i=n(r(9728)),a=n(r(9853));function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var c={pageSize:10,offset:0};t.PAGING_DEFAULTS=c;var l=function(){function e(){(0,s.default)(this,e),this.offset=c.offset,this.pageSize=c.pageSize,this.sortBy=null,this.groupBy=null,this.properties=null,this.excludeProps=null,this.whereClause=null,this.havingClause=null,this.relations=null,this.relationsDepth=null,this.relationsPageSize=null,this.distinct=!1}return(0,i.default)(e,[{key:"setPageSize",value:function(e){if(e<=0)throw new Error("Page size must be a positive value.");return this.pageSize=e,this}},{key:"getPageSize",value:function(){return this.pageSize}},{key:"setOffset",value:function(e){if(e<0)throw new Error("Offset cannot have a negative value.");return this.offset=e,this}},{key:"getOffset",value:function(){return this.offset}},{key:"prepareNextPage",value:function(){return this.setOffset(this.offset+this.pageSize),this}},{key:"preparePreviousPage",value:function(){return this.setOffset(Math.max(this.offset-this.pageSize,0)),this}},{key:"getProperties",value:function(){return this.properties}},{key:"setProperties",value:function(e){return this.properties=a.default.castArray(e),this}},{key:"addProperty",value:function(e){return this.properties=this.properties||[],this.properties.push(e),this}},{key:"addProperties",value:function(){for(var e=this,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return r.forEach((function(t){a.default.castArray(t).forEach((function(t){return e.addProperty(t)}))})),this}},{key:"addAllProperties",value:function(){return this.addProperty("*"),this}},{key:"excludeProperty",value:function(e){return this.excludeProps=this.excludeProps||[],this.excludeProps.push(e),this}},{key:"excludeProperties",value:function(){for(var e=this,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return r.forEach((function(t){a.default.castArray(t).forEach((function(t){return e.excludeProperty(t)}))})),this}},{key:"getExcludeProperties",value:function(){return this.excludeProps}},{key:"getWhereClause",value:function(){return this.whereClause}},{key:"setWhereClause",value:function(e){return this.whereClause=e,this}},{key:"getHavingClause",value:function(){return this.havingClause}},{key:"setHavingClause",value:function(e){return this.havingClause=e,this}},{key:"getSortBy",value:function(){return this.sortBy}},{key:"setSortBy",value:function(e){return this.sortBy=a.default.castArray(e),this}},{key:"getGroupBy",value:function(){return this.groupBy}},{key:"setGroupBy",value:function(e){return this.groupBy=a.default.castArray(e),this}},{key:"getRelated",value:function(){return this.relations}},{key:"setRelated",value:function(e){return this.relations=a.default.castArray(e),this}},{key:"addRelated",value:function(e){return this.relations=(this.relations||[]).concat(e),this}},{key:"setRelationsDepth",value:function(e){return this.relationsDepth=e,this}},{key:"getRelationsDepth",value:function(){return this.relationsDepth}},{key:"setRelationsPageSize",value:function(e){return this.relationsPageSize=e,this}},{key:"getRelationsPageSize",value:function(){return this.relationsPageSize}},{key:"setDistinct",value:function(e){return this.distinct=!!e,this}},{key:"getDistinct",value:function(){return this.distinct}},{key:"setFileReferencePrefix",value:function(e){return this.fileReferencePrefix=e,this}},{key:"getFileReferencePrefix",value:function(){return this.fileReferencePrefix}},{key:"toJSON",value:function(){return{pageSize:this.pageSize,offset:this.offset,properties:this.properties,excludeProps:this.excludeProps,where:this.whereClause,having:this.havingClause,sortBy:this.sortBy,groupBy:this.groupBy,relations:this.relations,relationsDepth:this.relationsDepth,relationsPageSize:this.relationsPageSize,distinct:this.distinct,fileReferencePrefix:this.fileReferencePrefix}}}],[{key:"create",value:function(){return new this}},{key:"toRequestBody",value:function(t){var r=t instanceof e?t.toJSON():t?function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){(0,o.default)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},t):{};return Object.keys(r).forEach((function(e){Array.isArray(r[e])?"groupPath"!==e&&(r[e]=r[e].join(",")):null==r[e]&&delete r[e]})),r.properties&&(r.props=r.properties,delete r.properties),r.relations&&(r.loadRelations=r.relations,delete r.relations),r}},{key:"toQueryString",value:function(t){if(t){t instanceof e&&(t=t.toJSON());var r=[];return t.pageSize>0&&r.push("pageSize=".concat(t.pageSize)),t.offset>0&&r.push("offset=".concat(t.offset)),Array.isArray(t.properties)&&t.properties.length&&t.properties.map((function(e){r.push("property=".concat(encodeURIComponent(e)))})),Array.isArray(t.excludeProps)&&t.excludeProps.length&&r.push("excludeProps=".concat(f(t.excludeProps))),t.where&&r.push("where=".concat(encodeURIComponent(t.where))),t.having&&r.push("having=".concat(encodeURIComponent(t.having))),t.sortBy&&r.push(Array.isArray(t.sortBy)?"sortBy=".concat(f(t.sortBy)):"sortBy=".concat(encodeURIComponent(t.sortBy))),t.groupBy&&r.push(Array.isArray(t.groupBy)?"groupBy=".concat(f(t.groupBy)):"groupBy=".concat(encodeURIComponent(t.groupBy))),Array.isArray(t.relations)&&r.push(t.relations.length?"loadRelations=".concat(f(t.relations)):"loadRelations=*"),t.relationsDepth>0&&r.push("relationsDepth=".concat(t.relationsDepth)),t.relationsPageSize>0&&r.push("relationsPageSize=".concat(t.relationsPageSize)),t.distinct&&r.push("distinct=".concat(t.distinct)),t.fileReferencePrefix&&r.push("fileReferencePrefix=".concat(encodeURIComponent(t.fileReferencePrefix))),r.join("&")}}}]),e}();function f(e){return e.map((function(e){return encodeURIComponent(e)})).join(",")}t.default=l},8461:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GeoTypes=void 0;t.GeoTypes={POINT:"Point",LINE_STRING:"LineString",POLYGON:"Polygon"}},7130:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.GEO_CLASSES=void 0,t.default=function(e,t){var r=y[e.type];if(t=t||p.default.valueBySRSId(e.srsId),r)return r(e.coordinates,t);throw new Error("There is no constructor for ".concat(e.type))};var o,s=n(r(8416)),i=n(r(1589)),a=n(r(7424)),u=n(r(679)),c=n(r(3228)),l=n(r(2253)),f=r(8461),p=n(r(5599));t.GEO_CLASSES=["com.backendless.persistence.Polygon","com.backendless.persistence.LineString","com.backendless.persistence.Point","com.backendless.persistence.Geometry"];var d=function(e,t){var r=(0,a.default)(e,2),n=r[0],o=r[1];return new u.default(t).setX(n).setY(o)},h=function(e,t){var r=e.map((function(e){return d(e,t)}));return new c.default(r,t)},y=(o={},(0,s.default)(o,f.GeoTypes.POINT,d),(0,s.default)(o,f.GeoTypes.LINE_STRING,h),(0,s.default)(o,f.GeoTypes.POLYGON,(function(e,t){var r=e.map((function(e){return h(e,t)})),n=(0,i.default)(r),o=n[0],s=n.slice(1);return new l.default(o,s,t)})),o)},1738:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(6690)),s=n(r(9728)),i=n(r(7130)),a=function(){function e(t){(0,o.default)(this,e),this.srs=t}return(0,s.default)(e,[{key:"read",value:function(e){return(0,i.default)(e,this.srs)}}]),e}();t.default=a},7705:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(6690)),s=n(r(9728)),i=n(r(5599)),a=n(r(1738)),u=n(r(8048)),c=function(){function e(t){(0,o.default)(this,e),this.srs=t||i.default.DEFAULT}return(0,s.default)(e,[{key:"getSRS",value:function(){return this.srs}},{key:"getGeojsonType",value:function(){}},{key:"getWktType",value:function(){}},{key:"wktCoordinatePairs",value:function(){}},{key:"jsonCoordinatePairs",value:function(){}},{key:"asGeoJSON",value:function(){return{type:this.getGeojsonType(),coordinates:this.jsonCoordinatePairs()}}},{key:"asWKT",value:function(){return this.getWktType()+"("+this.wktCoordinatePairs()+")"}},{key:"toJSON",value:function(){return this.asGeoJSON()}},{key:"toString",value:function(){return"'"+this.asWKT()+"'"}}],[{key:"fromWKT",value:function(e,t){return new u.default(t).read(e)}},{key:"fromGeoJSON",value:function(e,t){return new a.default(t).read(e)}}]),e}();t.default=c},3228:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(6690)),s=n(r(9728)),i=n(r(1655)),a=n(r(4993)),u=n(r(3808)),c=n(r(7705));function l(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,u.default)(e);if(t){var o=(0,u.default)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,a.default)(this,r)}}var f=r(8461).GeoTypes.LINE_STRING,p=f.toUpperCase(),d=function(e){(0,i.default)(r,e);var t=l(r);function r(e,n){var s;return(0,o.default)(this,r),(s=t.call(this,n)).points=e||[],s}return(0,s.default)(r,[{key:"getPoints",value:function(){return this.points}},{key:"setPoints",value:function(e){return this.points=e,this}},{key:"getGeojsonType",value:function(){return f}},{key:"getWktType",value:function(){return p}},{key:"jsonCoordinatePairs",value:function(){var e=[];return this.getPoints().forEach((function(t){e.push([t.getX(),t.getY()])})),e}},{key:"wktCoordinatePairs",value:function(){return this.getPoints().map((function(e){return"".concat(e.getX()," ").concat(e.getY())})).join(",")}}]),r}(c.default);t.default=d},679:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(6690)),s=n(r(9728)),i=n(r(1655)),a=n(r(4993)),u=n(r(3808)),c=n(r(7705));function l(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,u.default)(e);if(t){var o=(0,u.default)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,a.default)(this,r)}}var f=r(8461).GeoTypes.POINT,p=f.toUpperCase(),d=function(e){(0,i.default)(r,e);var t=l(r);function r(e){return(0,o.default)(this,r),t.call(this,e)}return(0,s.default)(r,[{key:"lng",get:function(){return this.getLongitude()},set:function(e){this.setLongitude(e)}},{key:"lat",get:function(){return this.getLatitude()},set:function(e){this.setLatitude(e)}},{key:"getX",value:function(){return this.x}},{key:"getY",value:function(){return this.y}},{key:"getLongitude",value:function(){return this.x}},{key:"getLatitude",value:function(){return this.y}},{key:"setX",value:function(e){return this.x=e,this}},{key:"setY",value:function(e){return this.y=e,this}},{key:"setLongitude",value:function(e){return this.setX(e)}},{key:"setLatitude",value:function(e){return this.setY(e)}},{key:"getGeojsonType",value:function(){return f}},{key:"getWktType",value:function(){return p}},{key:"wktCoordinatePairs",value:function(){return"".concat(this.x," ").concat(this.y)}},{key:"jsonCoordinatePairs",value:function(){return[this.x,this.y]}},{key:"equals",value:function(e){return this===e||e instanceof r&&(Math.abs(e.x-this.x)<1e-9&&Math.abs(e.y-this.y)<1e-9&&this.srs===e.srs)}}]),r}(c.default);t.default=d},2253:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(861)),s=n(r(6690)),i=n(r(9728)),a=n(r(1655)),u=n(r(4993)),c=n(r(3808)),l=n(r(7705)),f=n(r(3228));function p(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,c.default)(e);if(t){var o=(0,c.default)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,u.default)(this,r)}}var d=r(8461).GeoTypes.POLYGON,h=d.toUpperCase(),y=function(e){(0,a.default)(r,e);var t=p(r);function r(e,n,o){var i;return(0,s.default)(this,r),(i=t.call(this,o)).setBoundary(e),i.setHoles(n),i}return(0,i.default)(r,[{key:"getBoundary",value:function(){return this.boundary}},{key:"setBoundary",value:function(e){if(!e)throw new Error("The 'boundary' argument is required.");return e instanceof f.default||(e=new f.default(e,this.srs)),this.boundary=e,this}},{key:"getHoles",value:function(){return this.holes}},{key:"setHoles",value:function(e){return this.holes=e||[],this}},{key:"getGeojsonType",value:function(){return d}},{key:"getWktType",value:function(){return h}},{key:"jsonCoordinatePairs",value:function(){var e=[];this.getBoundary().getPoints().forEach((function(t){e.push([t.getX(),t.getY()])}));var t=this.holes.map((function(e){return e.getPoints().map((function(e){return[e.getX(),e.getY()]}))}));return[e].concat((0,o.default)(t))}},{key:"wktCoordinatePairs",value:function(){var e=[this.getBoundary().wktCoordinatePairs()];this.holes.forEach((function(t){return e.push(t.wktCoordinatePairs())}));return e.map((function(e){return"("+e+")"})).join(",")}}]),r}(l.default);t.default=y},5599:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(6690)),s=n(r(9728)),i=function(){function e(t){var r=t.srsId,n=t.name;(0,o.default)(this,e),this.srsId=r,this.name=n}return(0,s.default)(e,[{key:"getSRSId",value:function(){return this.srsId}},{key:"getName",value:function(){return this.name}},{key:"toString",value:function(){return this.getName()+"("+this.getSRSId()+")"}}]),e}(),a=new i({srsId:0,name:"Cartesian"}),u=new i({srsId:4200,name:"Pulkovo 1995"}),c=new i({srsId:4326,name:"WGS 84"}),l={CARTESIAN:a,PULKOVO_1995:u,WGS84:c,WGS84_PSEUDO_MERCATOR:new i({srsId:3857,name:"WGS 84 / Pseudo-Mercator"}),WGS84_WORLD_MERCATOR:new i({srsId:3395,name:"WGS 84 / World Mercator"}),DEFAULT:c,SRS_MAP:{},valueBySRSId:function(e){return l.SRS_MAP[e]}};Object.keys(l).forEach((function(e){if(l[e]instanceof i){var t=l[e];l.SRS_MAP[t.getSRSId()]=t}}));var f=l;t.default=f},8048:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(6690)),s=n(r(9728)),i=n(r(3734)),a=n(r(7130)),u=function(){function e(t){(0,o.default)(this,e),this.srs=t}return(0,s.default)(e,[{key:"read",value:function(e){var t=(0,i.default)(e);if(!t)throw new Error("WKT string is invalid");return(0,a.default)(t,this.srs)}}]),e}();t.default=u},3734:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(861)),s=r(8461),i=/[-+]?([0-9]*\.[0-9]+|[0-9]+)([eE][-+]?[0-9]+)?/,a=new RegExp("^"+i.source+"(\\s"+i.source+"){1,}"),u=function(e){var t=0,r=function(r){var n=e.substring(t).match(r);return n?(t+=n[0].length,n[0]):null},n=function(){return r(/^\s*/)},i=function(){for(var e,t,s=[];t=r(a)||r(/^(,)/);)","===t?(s.push(e),e=[]):t.split(/\s/g).some(isNaN)||(e||(e=[]),e=[].concat((0,o.default)(e),(0,o.default)(t.split(/\s/g).map(parseFloat)))),n();return e?(s.push(e),s.length?s:null):null};return function(){if(!r(/^(point(\sz)?)/i))return null;if(n(),!r(/^(\()/))return null;n();var e=i();return e&&r(/^(\))/)?{type:s.GeoTypes.POINT,coordinates:e[0]}:null}()||function(){if(!r(/^(linestring(\sz)?)/i))return null;if(n(),!r(/^(\()/))return null;var e=i();return e&&r(/^(\))/)?{type:s.GeoTypes.LINE_STRING,coordinates:e}:null}()||function(){if(!r(/^(polygon(\sz)?)/i))return null;n();var e=function(){n();for(var e,t=0,o=[],s=[o],i=o;e=r(/^(\()/)||r(/^(\))/)||r(/^(,)/)||r(a);){if("("===e)s.push(i),i=[],s[s.length-1].push(i),t++;else if(")"===e){if(0===i.length)return null;if(!(i=s.pop()))return null;if(0===--t)break}else if(","===e)i=[],s[s.length-1].push(i);else{if(e.split(/\s/g).some(isNaN))return null;Array.prototype.push.apply(i,e.split(/\s/g).map(parseFloat))}n()}return 0!==t?null:o}();return e?{type:s.GeoTypes.POLYGON,coordinates:e}:null}()};t.default=u},6820:(e,t,r)=>{"use strict";var n=r(4836),o=r(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var s=n(r(6690)),i=n(r(9728)),a=n(r(1588)),u=n(r(1655)),c=n(r(4993)),l=n(r(3808)),f=n(r(9853)),p=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==o(e)&&"function"!=typeof e)return{default:e};var r=d(t);if(r&&r.has(e))return r.get(e);var n={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var a=s?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=e[i]}n.default=e,r&&r.set(e,n);return n}(r(3082));function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(d=function(e){return e?r:t})(e)}function h(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,l.default)(e);if(t){var o=(0,l.default)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,c.default)(this,r)}}var y=function(e){(0,u.default)(r,e);var t=h(r);function r(){var e;return(0,s.default)(this,r),(e=t.call(this)).groupPageSize=p.PAGING_DEFAULTS.pageSize,e.recordsPageSize=p.PAGING_DEFAULTS.pageSize,e.groupDepth=null,e.groupPath=null,e}return(0,i.default)(r,[{key:"setGroupPageSize",value:function(e){if(e<=0)throw new Error("Group page size must be a positive value.");return this.groupPageSize=e,this}},{key:"getGroupPageSize",value:function(){return this.groupPageSize}},{key:"setRecordsPageSize",value:function(e){if(e<=0)throw new Error("Records page size must be a positive value.");return this.recordsPageSize=e,this}},{key:"getRecordsPageSize",value:function(){return this.recordsPageSize}},{key:"setGroupDepth",value:function(e){if(e<0)throw new Error("Group depth cannot have a negative value.");return this.groupDepth=e,this}},{key:"getGroupDepth",value:function(){return this.groupDepth}},{key:"getGroupPath",value:function(){return this.groupPath}},{key:"addGroupPath",value:function(e){return this.groupPath=(this.groupPath||[]).concat(e),this}},{key:"setGroupPath",value:function(e){return this.groupPath=f.default.castArray(e),this}},{key:"toJSON",value:function(){var e=(0,a.default)((0,l.default)(r.prototype),"toJSON",this).call(this);return e.groupDepth=this.getGroupDepth(),e.groupPath=this.getGroupPath(),e.groupPageSize=this.getGroupPageSize(),e.recordsPageSize=this.getRecordsPageSize(),e}}]),r}(p.default);t.default=y},7607:(e,t,r)=>{"use strict";var n=r(4836);t.Z=void 0;var o=n(r(4687)),s=n(r(7156)),i=n(r(8416)),a=n(r(6690)),u=n(r(9728)),c=n(r(9853)),l=n(r(5602)),f=n(r(9540)),p=n(r(3082)),d=n(r(6820)),h=n(r(3198)),y=n(r(2496)),v=n(r(679)),m=n(r(3228)),b=n(r(2253)),g=n(r(7705)),w=n(r(5599)),k=n(r(8048)),E=n(r(1738)),O=n(r(6064)),S=function(){function e(t){(0,a.default)(this,e),this.app=t,this.classToTableMap=(0,i.default)({},l.default.className,l.default),this.Permissions={FIND:new O.default("FIND",t),REMOVE:new O.default("REMOVE",t),UPDATE:new O.default("UPDATE",t)},this.QueryBuilder=p.default,this.GroupQueryBuilder=d.default,this.LoadRelationsQueryBuilder=h.default,this.JSONUpdateBuilder=y.default,this.Point=v.default,this.LineString=m.default,this.Polygon=b.default,this.Geometry=g.default,this.GeoJSONParser=E.default,this.WKTParser=k.default,this.SpatialReferenceSystem=w.default}var t,r;return(0,u.default)(e,[{key:"of",value:function(e){return new f.default(e,this)}},{key:"describe",value:(r=(0,s.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t="string"==typeof t?t:c.default.getClassName(t),e.abrupt("return",this.app.request.get({url:this.app.urls.dataTableProps(t)}));case 2:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"getTableNameById",value:(t=(0,s.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.app.request.get({url:this.app.urls.dataTableNameById(t)}));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"mapTableToClass",value:function(e,t){if("function"==typeof e&&(t=e,e=c.default.getClassName(t)),!e||"string"!=typeof e)throw new Error("Table Name must be provided and must be a string.");if(!t||"function"!=typeof t)throw new Error("Class must be provided and must be a constructor function.");this.classToTableMap[e]=t}}]),e}();t.Z=S},2496:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(1655)),s=n(r(4993)),i=n(r(3808)),a=n(r(6690)),u=n(r(9728));function c(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,i.default)(e);if(t){var o=(0,i.default)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,s.default)(this,r)}}var l="JSON_SET",f="JSON_INSERT",p="JSON_REPLACE",d="JSON_REMOVE",h="JSON_ARRAY_APPEND",y="JSON_ARRAY_INSERT",v=function(){function e(t){(0,a.default)(this,e),this.operationName=t,this.args={}}return(0,u.default)(e,[{key:"addArgument",value:function(e,t){if(void 0===t)throw new Error("You have to specify function's second argument");return this.args[e]=t,this}},{key:"toJSON",value:function(){return this.validate(),{___operation:this.operationName,args:this.args}}},{key:"create",value:function(){return this.toJSON()}},{key:"validate",value:function(){if(!Object.keys(this.args).length)throw new Error("You have to add at least one argument")}}],[{key:"SET",value:function(){return new e(l)}},{key:"INSERT",value:function(){return new e(f)}},{key:"REPLACE",value:function(){return new e(p)}},{key:"REMOVE",value:function(){return new m}},{key:"ARRAY_APPEND",value:function(){return new e(h)}},{key:"ARRAY_INSERT",value:function(){return new e(y)}}]),e}();t.default=v;var m=function(e){(0,o.default)(r,e);var t=c(r);function r(){var e;return(0,a.default)(this,r),(e=t.call(this,d)).args=[],e}return(0,u.default)(r,[{key:"addArgument",value:function(e){return this.args.push(e),this}},{key:"validate",value:function(){if(!this.args.length)throw new Error("You have to add at least one argument")}}]),r}(v)},3198:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(6690)),s=n(r(9728)),i=n(r(1588)),a=n(r(1655)),u=n(r(4993)),c=n(r(3808));function l(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,c.default)(e);if(t){var o=(0,c.default)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,u.default)(this,r)}}var f=function(e){(0,a.default)(r,e);var t=l(r);function r(e){var n;return(0,o.default)(this,r),(n=t.call(this)).relationModel=e,n.relationName=null,n}return(0,s.default)(r,[{key:"setRelationName",value:function(e){return this.relationName=e,this}},{key:"getRelationName",value:function(){return this.relationName}},{key:"setRelationModel",value:function(e){return this.relationModel=e,this}},{key:"getRelationModel",value:function(){return this.relationModel}},{key:"toJSON",value:function(){var e=(0,i.default)((0,c.default)(r.prototype),"toJSON",this).call(this);return e.relationName=this.getRelationName(),e.relationModel=this.getRelationModel(),e}}],[{key:"of",value:function(e){return new this(e)}}]),r}(n(r(3082)).default);t.default=f},6064:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(6690)),s=n(r(9728)),i=n(r(1655)),a=n(r(4993)),u=n(r(3808)),c=n(r(8416));function l(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,u.default)(e);if(t){var o=(0,u.default)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,a.default)(this,r)}}var f=function(e){(0,i.default)(r,e);var t=l(r);function r(){return(0,o.default)(this,r),t.apply(this,arguments)}return(0,s.default)(r,[{key:"getRequestURL",value:function(e,t){if(!t.___class||!t.objectId)throw new Error('"dataObject.___class" and "dataObject.objectId" need to be specified');return this.app.urls.dataObjectPermission(t.___class,e,t.objectId)}}]),r}(n(r(394)).default);t.default=f,(0,c.default)(f,"BACKWARD_COMPATIBILITY_LABEL","Backendless.Data.Permissions.{FIND|REMOVE|UPDATE}")},9350:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(6690)),s=n(r(9728)),i=n(r(1588)),a=n(r(1655)),u=n(r(4993)),c=n(r(3808)),l=r(9181);function f(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,c.default)(e);if(t){var o=(0,c.default)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,u.default)(this,r)}}var p="created",d="updated",h="deleted",y="upserted",v="bulk-created",m="bulk-updated",b="bulk-deleted",g="bulk-upserted",w="add",k="set",E="delete",O=[p,d,h,y],S=function(e){(0,a.default)(r,e);var t=f(r);function r(e){var n;return(0,o.default)(this,r),(n=t.call(this)).dataStore=e,n.app=e.app,n}return(0,s.default)(r,[{key:"getSubscriptionOptions",value:function(){return{tableName:this.dataStore.className}}},{key:"addCreateListener",value:function(e,t,r){this.addChangesListener(p,e,t,r)}},{key:"removeCreateListeners",value:function(e,t){this.removeChangesListeners(p,e,t)}},{key:"removeCreateListener",value:function(e){if(!e||"function"!=typeof e)throw new Error("Listener Function must be passed.");this.removeCreateListeners(void 0,e)}},{key:"addUpsertListener",value:function(e,t,r){this.addChangesListener(y,e,t,r)}},{key:"removeUpsertListeners",value:function(e,t){this.removeChangesListeners(y,e,t)}},{key:"removeUpsertListener",value:function(e){if(!e||"function"!=typeof e)throw new Error("Listener Function must be passed.");this.removeUpsertListeners(void 0,e)}},{key:"addUpdateListener",value:function(e,t,r){this.addChangesListener(d,e,t,r)}},{key:"removeUpdateListeners",value:function(e,t){this.removeChangesListeners(d,e,t)}},{key:"removeUpdateListener",value:function(e){if(!e||"function"!=typeof e)throw new Error("Listener Function must be passed.");this.removeUpdateListeners(void 0,e)}},{key:"addDeleteListener",value:function(e,t,r){this.addChangesListener(h,e,t,r)}},{key:"removeDeleteListeners",value:function(e,t){this.removeChangesListeners(h,e,t)}},{key:"removeDeleteListener",value:function(e){if(!e||"function"!=typeof e)throw new Error("Listener Function must be passed.");this.removeDeleteListeners(void 0,e)}},{key:"addBulkCreateListener",value:function(e,t,r){this.addChangesListener(v,e,t,r)}},{key:"removeBulkCreateListeners",value:function(){this.removeChangesListeners(v)}},{key:"removeBulkCreateListener",value:function(e){if(!e||"function"!=typeof e)throw new Error("Listener Function must be passed.");this.removeChangesListeners(v,void 0,e)}},{key:"addBulkUpdateListener",value:function(e,t,r){this.addChangesListener(m,e,t,r)}},{key:"removeBulkUpdateListeners",value:function(e,t){this.removeChangesListeners(m,e,t)}},{key:"removeBulkUpdateListener",value:function(e){if(!e||"function"!=typeof e)throw new Error("Listener Function must be passed.");this.removeBulkUpdateListeners(void 0,e)}},{key:"addBulkDeleteListener",value:function(e,t,r){this.addChangesListener(b,e,t,r)}},{key:"removeBulkDeleteListeners",value:function(e,t){this.removeChangesListeners(b,e,t)}},{key:"removeBulkDeleteListener",value:function(e){if(!e||"function"!=typeof e)throw new Error("Listener Function must be passed.");this.removeBulkDeleteListeners(void 0,e)}},{key:"addBulkUpsertListener",value:function(e,t,r){this.addChangesListener(g,e,t,r)}},{key:"removeBulkUpsertListeners",value:function(){this.removeChangesListeners(g)}},{key:"removeBulkUpsertListener",value:function(e){if(!e||"function"!=typeof e)throw new Error("Listener Function must be passed.");this.removeChangesListeners(g,void 0,e)}},{key:"addSetRelationListener",value:function(e,t,r,n){this.addRelationsChangesListener(k,e,t,r,n)}},{key:"removeSetRelationListener",value:function(e){if(!e||"function"!=typeof e)throw new Error("Listener Function must be passed.");this.removeRelationsChangesListeners(k,void 0,e)}},{key:"removeSetRelationListeners",value:function(e,t){this.removeRelationsChangesListeners(k,e,t)}},{key:"addAddRelationListener",value:function(e,t,r,n){this.addRelationsChangesListener(w,e,t,r,n)}},{key:"removeAddRelationListener",value:function(e){if(!e||"function"!=typeof e)throw new Error("Listener Function must be passed.");this.removeRelationsChangesListeners(w,void 0,e)}},{key:"removeAddRelationListeners",value:function(e,t){this.removeRelationsChangesListeners(w,e,t)}},{key:"addDeleteRelationListener",value:function(e,t,r,n){this.addRelationsChangesListener(E,e,t,r,n)}},{key:"removeDeleteRelationListener",value:function(e){if(!e||"function"!=typeof e)throw new Error("Listener Function must be passed.");this.removeRelationsChangesListeners(E,void 0,e)}},{key:"removeDeleteRelationListeners",value:function(e,t){this.removeRelationsChangesListeners(E,e,t)}},{key:"addChangesListener",value:function(e,t,r,n){if("function"==typeof t&&(n=r,r=t,t=void 0),"function"!=typeof r)throw new Error("Listener Function must be passed.");this.addSubscription(e,this.app.RT.subscriptions.onObjectsChanges,{callback:r,onError:n,parser:O.includes(e)?this.parseObjectToInstance.bind(this):void 0,params:{event:e,whereClause:t}})}},{key:"removeChangesListeners",value:function(e,t,r){"function"==typeof t&&(r=t,t=void 0);this.stopSubscription(e,{matcher:function(e){var n=e.params;return t?n.whereClause===t:!r||e.callback===r}})}},{key:"addRelationsChangesListener",value:function(e,t,r,n,o){if(!t||"string"!=typeof t)throw new Error("Relation Column Name must be a string.");if("function"==typeof r&&(o=n,n=r,r=void 0),"function"!=typeof n)throw new Error("Listener Function must be passed.");if(r){if(!Array.isArray(r))throw new Error("Parent Objects must be an array");r=r.map((function(e){return e.objectId||e}))}this.addSubscription(e,this.app.RT.subscriptions.onRelationsChanges,{callback:n,onError:o,params:{event:e,relationColumnName:t,parentObjects:r}})}},{key:"removeRelationsChangesListeners",value:function(e,t,r){"function"==typeof t&&(r=t,t=void 0);this.stopSubscription(e,{matcher:function(e){var n=e.params;return t?n.relationColumnName===t:!r||e.callback===r}})}},{key:"removeAllListeners",value:function(){(0,i.default)((0,c.default)(r.prototype),"removeAllListeners",this).call(this)}},{key:"parseObjectToInstance",value:function(e){return this.dataStore.parseResponse(e)}}]),r}(l.RTListeners);t.default=S},9540:(e,t,r)=>{"use strict";var n=r(4836),o=r(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var s=n(r(7424)),i=n(r(215)),a=n(r(4687)),u=n(r(8698)),c=n(r(7156)),l=n(r(6690)),f=n(r(9728)),p=n(r(8416)),d=n(r(9853)),h=n(r(7738)),y=n(r(9350)),v=n(r(3082)),m=n(r(3198)),b=n(r(2496)),g=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==o(e)&&"function"!=typeof e)return{default:e};var r=E(t);if(r&&r.has(e))return r.get(e);var n={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var a=s?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=e[i]}n.default=e,r&&r.set(e,n);return n}(r(7130)),w=n(r(7705)),k=["relationName","relationModel"];function E(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(E=function(e){return e?r:t})(e)}function O(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function S(e,t){var r=e instanceof v.default?e.toJSON():e?function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?O(Object(r),!0).forEach((function(t){(0,p.default)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e):{};return r.pageSize=1,r.offset=0,r.sortBy||(r.sortBy=["created ".concat(t)]),v.default.toRequestBody(r)}var _=function(){function e(t,r){if((0,l.default)(this,e),this.app=r.app,this.classToTableMap=r.classToTableMap,"string"==typeof t?(this.className=t,this.model=this.classToTableMap[this.className]):(this.className=d.default.getClassName(t),this.model=this.classToTableMap[this.className]||t),!this.className)throw new Error("Class name should be specified")}var t,r,n,o,s,p,h,b,g,w,E,O,_,j,T,P,C,A;return(0,f.default)(e,[{key:"rt",value:function(){return this.rtHandlers=this.rtHandlers||new y.default(this)}},{key:"save",value:(A=(0,c.default)(a.default.mark((function e(t,r){var n,o=this;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r?this.app.urls.dataTableUpsert(this.className):this.app.urls.dataTable(this.className),e.abrupt("return",this.app.request.put({url:n,data:R(t)}).then((function(e){return o.parseResponse(e)})));case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return A.apply(this,arguments)})},{key:"deepSave",value:(C=(0,c.default)(a.default.mark((function e(t){var r=this;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.app.request.put({url:this.app.urls.dataTableDeepSave(this.className),data:R(t)}).then((function(e){return r.parseResponse(e)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return C.apply(this,arguments)})},{key:"remove",value:(P=(0,c.default)(a.default.mark((function e(t){var r;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((r=t&&t.objectId||t)&&("string"==typeof r||"number"==typeof r)){e.next=3;break}throw new Error("Object Id must be provided and must be a string or number.");case 3:return e.abrupt("return",this.app.request.delete({url:this.app.urls.dataTableObject(this.className,r)}));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return P.apply(this,arguments)})},{key:"find",value:(T=(0,c.default)(a.default.mark((function e(t){var r=this;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.app.request.post({url:this.app.urls.dataTableFind(this.className),data:v.default.toRequestBody(t)}).then((function(e){return r.parseResponse(e)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return T.apply(this,arguments)})},{key:"group",value:(j=(0,c.default)(a.default.mark((function e(t){return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.app.request.post({url:this.app.urls.dataGrouping(this.className),data:v.default.toRequestBody(t)}));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return j.apply(this,arguments)})},{key:"countInGroup",value:(_=(0,c.default)(a.default.mark((function e(t){return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.groupPath&&"object"===(0,u.default)(t.groupPath)){e.next=2;break}throw new Error("Group Path must be provided and must be an object.");case 2:return e.abrupt("return",this.app.request.post({url:"".concat(this.app.urls.dataGrouping(this.className),"/count"),data:v.default.toRequestBody(t)}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return _.apply(this,arguments)})},{key:"findById",value:(O=(0,c.default)(a.default.mark((function e(t,r){var n;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t||"object"!==(0,u.default)(t)||Array.isArray(t)){e.next=8;break}if(Object.keys(t).length){e.next=3;break}throw new Error("Provided object must have at least 1 primary keys.");case 3:return e.next=5,this.app.request.get({url:this.app.urls.dataTablePrimaryKey(this.className),query:t});case 5:n=e.sent,e.next=14;break;case 8:if(t&&("string"==typeof t||"number"==typeof t)){e.next=10;break}throw new Error("Object Id must be provided and must be a string or number or an object of primary keys.");case 10:return r&&(r.pageSize=null,r.offset=null),e.next=13,this.app.request.get({url:this.app.urls.dataTableObject(this.className,t),queryString:v.default.toQueryString(r)});case 13:n=e.sent;case 14:return e.abrupt("return",this.parseResponse(n));case 15:case"end":return e.stop()}}),e,this)}))),function(e,t){return O.apply(this,arguments)})},{key:"findFirst",value:(E=(0,c.default)(a.default.mark((function e(t){var r=this;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.app.request.post({url:this.app.urls.dataTableFind(this.className),data:S(t,"asc")}).then((function(e){return r.parseResponse(e[0])})));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return E.apply(this,arguments)})},{key:"findLast",value:(w=(0,c.default)(a.default.mark((function e(t){var r=this;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.app.request.post({url:this.app.urls.dataTableFind(this.className),data:S(t,"desc")}).then((function(e){return r.parseResponse(e[0])})));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return w.apply(this,arguments)})},{key:"getObjectCount",value:(g=(0,c.default)(a.default.mark((function e(t){var r,n;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=void 0,n=void 0,!t){e.next=11;break}if(!(t instanceof v.default)){e.next=9;break}r=t.getDistinct()||void 0,n=t.getGroupBy()||void 0,t=t.getWhereClause()||void 0,e.next=11;break;case 9:if("string"==typeof t){e.next=11;break}throw new Error("Condition must be a string or an instance of DataQueryBuilder.");case 11:return e.abrupt("return",this.app.request.post({url:this.app.urls.dataTableCount(this.className),data:{where:t,distinct:r,groupBy:n}}));case 12:case"end":return e.stop()}}),e,this)}))),function(e){return g.apply(this,arguments)})},{key:"loadRelations",value:(b=(0,c.default)(a.default.mark((function e(t,r){var n,o,s,u,c,l=this;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((n=t&&t.objectId||t)&&("string"==typeof n||"number"==typeof n)){e.next=3;break}throw new Error("Parent Object Id must be provided and must be a string or number.");case 3:if(o=r instanceof m.default?r.toJSON():r,s=o.relationName,u=o.relationModel,c=(0,i.default)(o,k),s&&"string"==typeof s){e.next=6;break}throw new Error("Relation Name must be provided and must be a string.");case 6:return e.abrupt("return",this.app.request.get({url:this.app.urls.dataTableObjectRelation(this.className,n,s),queryString:m.default.toQueryString(c)}).then((function(e){return l.parseRelationsResponse(e,u)})));case 7:case"end":return e.stop()}}),e,this)}))),function(e,t){return b.apply(this,arguments)})},{key:"setRelation",value:(h=(0,c.default)(a.default.mark((function e(t,r,n){return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.changeRelation(this.app.request.Methods.POST,t,r,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return h.apply(this,arguments)})},{key:"addRelation",value:(p=(0,c.default)(a.default.mark((function e(t,r,n){return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.changeRelation(this.app.request.Methods.PUT,t,r,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return p.apply(this,arguments)})},{key:"deleteRelation",value:(s=(0,c.default)(a.default.mark((function e(t,r,n){return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.changeRelation(this.app.request.Methods.DELETE,t,r,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return s.apply(this,arguments)})},{key:"bulkCreate",value:(o=(0,c.default)(a.default.mark((function e(t){var r;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r="Objects must be provided and must be an array of objects.",t&&Array.isArray(t)){e.next=3;break}throw new Error(r);case 3:return t=t.map((function(e){if(!e||"object"!==(0,u.default)(e)||Array.isArray(e))throw new Error(r);return e})),e.abrupt("return",this.app.request.post({url:this.app.urls.dataBulkTable(this.className),data:t}));case 5:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"bulkUpsert",value:(n=(0,c.default)(a.default.mark((function e(t){var r;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r="Objects must be provided and must be an array of objects.",t&&Array.isArray(t)&&t.length){e.next=3;break}throw new Error(r);case 3:return t=t.map((function(e){if(!e||"object"!==(0,u.default)(e)||Array.isArray(e))throw new Error(r);return e})),e.abrupt("return",this.app.request.put({url:this.app.urls.dataBulkTableUpsert(this.className),data:t}));case 5:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"bulkUpdate",value:(r=(0,c.default)(a.default.mark((function e(t,r){return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Condition must be provided and must be a string.");case 2:if(r&&"object"===(0,u.default)(r)&&!Array.isArray(r)){e.next=4;break}throw new Error("Changes must be provided and must be an object.");case 4:return e.abrupt("return",this.app.request.put({url:this.app.urls.dataBulkTable(this.className),query:{where:t},data:r}));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"bulkDelete",value:(t=(0,c.default)(a.default.mark((function e(t){var r,n;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&("string"==typeof t||Array.isArray(t))){e.next=2;break}throw new Error("Condition must be provided and must be a string or a list of objects.");case 2:return r={},"string"==typeof t?r.where=t:(n=t.map((function(e){var t=e&&e.objectId||e;if(!t||"string"!=typeof t&&"number"!=typeof t)throw new Error('Can not transform "objects" to "whereClause". Item must be a string or number or an object with property "objectId" as string.');return"'".concat(t,"'")})),r.where="objectId in (".concat(n.join(","),")")),e.abrupt("return",this.app.request.post({url:this.app.urls.dataBulkTableDelete(this.className),data:r}));case 5:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"parseRelationsResponse",value:function(e,t){return x(e,t,this)}},{key:"parseResponse",value:function(e){return x(e,this.model,this)}},{key:"changeRelation",value:function(e,t,r,n){var o=t&&t.objectId||t;if(!o||"string"!=typeof o&&"number"!=typeof o)throw new Error("Relation Parent must be provided and must be a string or number or an object with objectId property.");if(!r||"string"!=typeof r)throw new Error("Relation Column Name must be provided and must be a string.");if(!n||"string"!=typeof n&&!Array.isArray(n))throw new Error("Relation Children must be provided and must be a string or a list of objects.");var s={};"string"==typeof n?s.whereClause=n:s.childrenIds=n.map((function(e){var t=e&&e.objectId||e;if(!t||"string"!=typeof t&&"number"!=typeof t)throw new Error("Child Id must be provided and must be a string or number.");return t}));var i={};return s.whereClause&&(i.whereClause=s.whereClause),this.app.request.send({method:e,url:this.app.urls.dataTableObjectRelation(this.className,o,r),query:i,data:s.childrenIds})}}]),e}();t.default=_;var R=function(e){return function e(t,r,n){for(var o in r)if(Array.isArray(r[o]))e(t,r[o],n[o]=[]);else if(!r[o]||"object"!==(0,u.default)(r[o])||r[o]instanceof w.default||r[o]instanceof b.default||r[o]instanceof h.default)n[o]=r[o];else if(r[o]instanceof Date)n[o]=r[o].getTime();else if(t.instancesMap.has(r[o])){var s=t.instancesMap.get(r[o]);s.__subID||(s.__subID=d.default.uuid()),n[o]={__originSubID:s.__subID}}else{var i=n[o]={};t.instancesMap.set(r[o],i),e(t,r[o],i)}return n}({instancesMap:new WeakMap},e,{})},x=function(){return function(e,t,n){if(!e)return e;var o={RootModel:t,app:n.app,classToTableMap:n.classToTableMap,subIds:{},postAssign:[]},i=Array.isArray(e)?e.map((function(e){return r(o,e)})):r(o,e);return function(e){e.postAssign.forEach((function(t){var r=(0,s.default)(t,3),n=r[0],o=r[1],i=r[2];n[o]=e.subIds[i]}))}(o),i};function e(e,r,n,o){Array.isArray(r[o])?t(e,r[o],n[o]=[]):r[o]&&"object"===(0,u.default)(r[o])?g.GEO_CLASSES.includes(r[o].___class)?n[o]=(0,g.default)(r[o]):r[o].__originSubID?e.postAssign.push([n,o,r[o].__originSubID]):function(e,r,n,o){var s=r[o].__subID;if(s&&e.subIds[s])n[o]=e.subIds[s],delete r[o].__subID;else{var i=e.classToTableMap[r[o].___class];n[o]=i?new i:{},s&&!e.subIds[s]&&(e.subIds[s]=n[o],delete r[o].__subID),t(e,r[o],n[o])}}(e,r,n,o):n[o]=r[o]}function t(t,r,n){for(var o in r)e(t,r,n,o)}function r(e,r){var n=e.RootModel||e.classToTableMap[r.___class],o=n?new n:{};if(r.__subID){if(e.subIds[r.__subID])return e.subIds[r.__subID];e.subIds[r.__subID]=o,delete r.__subID}return t(e,r,o),o}}()},1318:(e,t,r)=>{"use strict";var n=r(4836);t.Z=void 0;var o=n(r(9728)),s=n(r(6690)),i=(0,o.default)((function e(t){if((0,s.default)(this,e),!(t&&t.uuid&&t.platform&&t.version))throw new Error('Device properties object must consist of fields "uuid", "platform" and "version".');this.uuid=t.uuid,this.platform=t.platform.toUpperCase(),this.version=t.version}));t.Z=i},7738:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(6690)),s=n(r(9728)),i=function(){function e(t){if((0,o.default)(this,e),!t||"string"!=typeof t)throw new Error("The Backendless.Expression class can be initialized with non empty string value only");this.value=t}return(0,s.default)(e,[{key:"toJSON",value:function(){return{___class:"BackendlessExpression",value:this.value}}}]),e}();t.default=i},3011:(e,t,r)=>{"use strict";var n=r(4836);t.Z=void 0;var o=n(r(4687)),s=n(r(7156)),i=n(r(6690)),a=n(r(9728)),u=n(r(4253)),c=n(r(1141)),l=function(){function e(t){(0,i.default)(this,e),this.app=t,this.Permissions={READ:new c.default("READ",t),DELETE:new c.default("DELETE",t),WRITE:new c.default("WRITE",t)}}var t,r,n,l,f,p,d,h,y,v,m,b,g;return(0,a.default)(e,[{key:"saveFile",value:(g=(0,s.default)(o.default.mark((function e(t,r,n,s){var i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error('"filePath" must be provided and must be a string.');case 2:if(r&&"string"==typeof r){e.next=4;break}throw new Error("File Name must be provided and must be a string.");case 4:return e.next=6,u.default.toBase64(n);case 6:return n=e.sent,i={},"boolean"==typeof s&&(i.overwrite=s),t=u.default.trimSlashesInPath(t),r=u.default.sanitizeFileName(r),e.abrupt("return",this.app.request.put({url:"".concat(this.app.urls.fileBinaryPath(t),"/").concat(r),headers:{"Content-Type":"text/plain"},query:i,data:n}));case 12:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n){return g.apply(this,arguments)})},{key:"upload",value:(b=(0,s.default)(o.default.mark((function e(t,r,n){var s,i,a,c;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s={},"boolean"==typeof n&&(s.overwrite=n),r=u.default.trimSlashesInPath(r),(i=u.default.parseFilePath(r)).fileName&&(r=i.filePath,a=i.fileName),"string"!=typeof t){e.next=8;break}return a||(c=u.default.parseFilePath(t),a=c.fileName),e.abrupt("return",this.app.request.post({url:"".concat(this.app.urls.filePath(r),"/").concat(a),query:s,data:{url:t}}));case 8:if(a||(a=u.default.getFileName(t)),a){e.next=11;break}throw new Error("Wrong type of the file source object. Can not get file name");case 11:return a=u.default.sanitizeFileName(a),e.abrupt("return",this.app.request.post({url:"".concat(this.app.urls.filePath(r),"/").concat(a),query:s,form:{file:t}}));case 13:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return b.apply(this,arguments)})},{key:"append",value:(m=(0,s.default)(o.default.mark((function e(t,r,n){var s,i=arguments;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error('"filePath" must be provided and must be a string.');case 2:if(t=u.default.trimSlashesInPath(t),2===i.length&&(n=r,r=void 0,(s=u.default.parseFilePath(t)).fileName&&(t=s.filePath,r=s.fileName)),r){e.next=6;break}throw new Error("Can not resolve target file name");case 6:if(r=u.default.sanitizeFileName(r),"string"!=typeof n){e.next=9;break}return e.abrupt("return",this.app.request.post({url:"".concat(this.app.urls.fileAppendPath(t),"/").concat(r),data:{url:n}}));case 9:if(!u.default.isBytesArray(n)){e.next=14;break}return e.next=12,u.default.toBase64(n);case 12:return n=e.sent,e.abrupt("return",this.app.request.put({url:"".concat(this.app.urls.fileAppendBinaryPath(t),"/").concat(r),headers:{"Content-Type":"text/plain"},data:n}));case 14:return e.abrupt("return",this.app.request.post({url:"".concat(this.app.urls.fileAppendPath(t),"/").concat(r),form:{file:n}}));case 15:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return m.apply(this,arguments)})},{key:"appendText",value:(v=(0,s.default)(o.default.mark((function e(t,r,n){var s,i=arguments;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error('"filePath" must be provided and must be a string.');case 2:if(t=u.default.trimSlashesInPath(t),2===i.length&&(n=r,r=void 0,(s=u.default.parseFilePath(t)).fileName&&(t=s.filePath,r=s.fileName)),r){e.next=6;break}throw new Error("Can not resolve target file name");case 6:if("string"==typeof n){e.next=8;break}throw new Error('"textContent" must be a string');case 8:return r=u.default.sanitizeFileName(r),e.abrupt("return",this.app.request.put({url:"".concat(this.app.urls.fileAppendPath(t),"/").concat(r),headers:{"Content-Type":"text/plain"},data:n}));case 10:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return v.apply(this,arguments)})},{key:"listing",value:(y=(0,s.default)(o.default.mark((function e(t,r,n,s,i){var a;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a={},t&&"string"==typeof t){e.next=3;break}throw new Error('"filePath" must be provided and must be a string.');case 3:return t=u.default.trimSlashesInPath(t),r&&"string"==typeof r&&(a.pattern=r),"boolean"==typeof n&&(a.sub=n),"number"==typeof s&&s>=0&&(a.pagesize=s),"number"==typeof i&&i>=0&&(a.offset=i),e.abrupt("return",this.app.request.get({url:this.app.urls.filePath(t),query:a}));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n,o){return y.apply(this,arguments)})},{key:"renameFile",value:(h=(0,s.default)(o.default.mark((function e(t,r){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error('"oldPathName" must be provided and must be a string.');case 2:if(r&&"string"==typeof r){e.next=4;break}throw new Error("New File Name must be provided and must be a string.");case 4:return e.abrupt("return",this.app.request.put({url:this.app.urls.fileRename(),data:{oldPathName:u.default.ensureSlashInPath(t),newName:r}}));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return h.apply(this,arguments)})},{key:"moveFile",value:(d=(0,s.default)(o.default.mark((function e(t,r){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.app.request.put({url:this.app.urls.fileMove(),data:{sourcePath:u.default.ensureSlashInPath(t),targetPath:u.default.ensureSlashInPath(r)}}));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)})},{key:"copyFile",value:(p=(0,s.default)(o.default.mark((function e(t,r){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.app.request.put({url:this.app.urls.fileCopy(),data:{sourcePath:u.default.ensureSlashInPath(t),targetPath:u.default.ensureSlashInPath(r)}}));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return p.apply(this,arguments)})},{key:"remove",value:(f=(0,s.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error('"filePath" must be provided and must be a string.');case 2:return t.startsWith("http://")||t.startsWith("https://")||(t=this.app.urls.filePath(t)),e.abrupt("return",this.app.request.delete({url:t}));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return f.apply(this,arguments)})},{key:"exists",value:(l=(0,s.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error('"filePath" must be provided and must be a string.');case 2:return t=u.default.trimSlashesInPath(t),e.abrupt("return",this.app.request.get({url:this.app.urls.filePath(t),query:{action:"exists"}}));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"getFileCount",value:(n=(0,s.default)(o.default.mark((function e(t,r,n,s){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error('"filesPath" must be provided and must be a string.');case 2:if(!r||"string"==typeof r){e.next=4;break}throw new Error("Files Pattern must be provided and must be a string.");case 4:return t=u.default.trimSlashesInPath(t),e.abrupt("return",this.app.request.get({url:this.app.urls.filePath(t),query:{action:"count",pattern:r||"*",sub:!!n,countDirectories:!!s}}));case 6:case"end":return e.stop()}}),e,this)}))),function(e,t,r,o){return n.apply(this,arguments)})},{key:"createDirectory",value:(r=(0,s.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error('Directory "path" must be provided and must be a string.');case 2:return t=u.default.trimSlashesInPath(t),e.abrupt("return",this.app.request.post({url:this.app.urls.directoryPath(t)}));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"removeDirectory",value:(t=(0,s.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error('Directory "path" must be provided and must be a string.');case 2:return t=u.default.trimSlashesInPath(t),e.abrupt("return",this.app.request.delete({url:this.app.urls.filePath(t)}));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),e}();t.Z=l},1141:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(6690)),s=n(r(9728)),i=n(r(1655)),a=n(r(4993)),u=n(r(3808)),c=n(r(8416));function l(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,u.default)(e);if(t){var o=(0,u.default)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,a.default)(this,r)}}var f=function(e){(0,i.default)(r,e);var t=l(r);function r(){return(0,o.default)(this,r),t.apply(this,arguments)}return(0,s.default)(r,[{key:"getRequestURL",value:function(e,t){return this.app.urls.filePermission(e,t)}}]),r}(n(r(394)).default);t.default=f,(0,c.default)(f,"BACKWARD_COMPATIBILITY_LABEL","Backendless.Files.Permissions.{READ|DELETE|WRITE}")},4253:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(4687)),s=n(r(7156)),i={isBytesArray:function(e){return"undefined"!=typeof Buffer&&e instanceof Buffer||("undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer||Array.isArray(e))},ensureSlashInPath:function(e){return e.startsWith("/")?e:"/".concat(e)},trimSlashesInPath:function(e){return e&&(e.startsWith("/")&&(e=e.slice(1)),e.endsWith("/")&&(e=e.slice(0,e.length-1))),e},parseFilePath:function(e){var t={filePath:e,fileName:null};if(e){var r=e.split("/");r[r.length-1].includes(".")&&(t.fileName=r.pop(),t.filePath=r.join("/"))}return t},sanitizeFileName:function(e){return encodeURIComponent(e).replace(/'/g,"%27").replace(/"/g,"%22")},getFileName:function(e){if(e.name)return e.name;if(e.path){var t=e.path.split("/");return t[t.length-1]}},toBase64:function(e){return(0,s.default)(o.default.mark((function t(){return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("undefined"==typeof Blob||"undefined"==typeof FileReader){t.next=3;break}return e instanceof Blob||(e=new Blob([e],{type:""})),t.abrupt("return",new Promise((function(t,r){var n=new FileReader;n.onerror=function(e){return r(e)},n.onload=function(e){return t(e.target.result.split(";base64,")[1])},n.readAsDataURL(e)})));case 3:if("undefined"==typeof Buffer){t.next=5;break}return t.abrupt("return",Buffer.from(e).toString("base64"));case 5:return t.abrupt("return",e);case 6:case"end":return t.stop()}}),t)})))()}};t.default=i},2257:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HiveTypes=void 0;t.HiveTypes={KEY_VALUE:"key-value",LIST:"list",MAP:"map",SET:"set",SORTED_SET:"sorted-set"}},8512:(e,t,r)=>{"use strict";var n=r(4836);t.ZP=function(e){function t(t){if(!t||"string"!=typeof t)throw new Error("Hive name must be provided and must be a string.");return new a(t,{app:e})}return t.getNames=function(){return e.request.get({url:e.urls.dataHives()})},t};var o=n(r(6690)),s=n(r(9728)),i=r(5766);var a=function(){function e(t,r){(0,o.default)(this,e),this.hiveName=t,this.app=r.app,this.KeyValueStore=i.KeyValueStore.registerType(this),this.ListStore=i.ListStore.registerType(this),this.MapStore=i.MapStore.registerType(this),this.SetStore=i.SetStore.registerType(this),this.SortedSetStore=i.SortedSetStore.registerType(this)}return(0,s.default)(e,[{key:"create",value:function(){return this.app.request.post({url:this.app.urls.dataHive(this.hiveName)})}},{key:"delete",value:function(){return this.app.request.delete({url:this.app.urls.dataHive(this.hiveName)})}},{key:"rename",value:function(e){if(!e||"string"!=typeof e)throw new Error("New Hive name must be provided and must be a string.");return this.app.request.put({url:this.app.urls.dataHive(this.hiveName),query:{newName:e}})}}]),e}()},9041:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.HiveStore=void 0;var o=n(r(4687)),s=n(r(7156)),i=n(r(6690)),a=n(r(9728)),u=n(r(8416)),c=n(r(9853));function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function f(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(t){(0,u.default)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var p=function(){function e(t,r){if((0,i.default)(this,e),this.TYPE=this.constructor.TYPE,!r||"string"!=typeof r)throw new Error("Store key must be a string.");this.app=t.app,this.hiveName=t.hiveName,this.storeKey=r}var t;return(0,a.default)(e,[{key:"getBaseURL",value:function(){return"".concat(this.app.urls.hiveStore(this.hiveName,this.TYPE),"/").concat(this.storeKey)}},{key:"delete",value:function(){return this.constructor.delete.call(f(f({},this),this.constructor),[this.storeKey])}},{key:"exist",value:(t=(0,s.default)(o.default.mark((function e(){var t;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.constructor.exist.call(f(f({},this),this.constructor),[this.storeKey]);case 2:return t=e.sent,e.abrupt("return",!!t);case 4:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"rename",value:function(e,t){if(!e||"string"!=typeof e)throw new Error("New key name must be provided and must be a string.");if(void 0!==t&&"boolean"!=typeof t)throw new Error("Overwrite must be a boolean.");return this.app.request.put({url:"".concat(this.getBaseURL(),"/rename"),query:{newKey:e,overwrite:t}})}},{key:"getExpiration",value:function(){return this.app.request.get({url:"".concat(this.getBaseURL(),"/get-expiration-ttl")})}},{key:"clearExpiration",value:function(){return this.app.request.put({url:"".concat(this.getBaseURL(),"/clear-expiration")})}},{key:"expireAfter",value:function(e){if(isNaN(e)||"number"!=typeof e)throw new Error("TTL must be a number.");return this.app.request.put({url:"".concat(this.getBaseURL(),"/expire"),query:{ttl:e}})}},{key:"expireAt",value:function(e){if(isNaN(e)||"number"!=typeof e)throw new Error("Expiration time must be a number.");return this.app.request.put({url:"".concat(this.getBaseURL(),"/expire-at"),query:{unixTime:e}})}},{key:"touch",value:function(){return this.constructor.touch.call(f(f({},this),this.constructor),[this.storeKey])}},{key:"secondsSinceLastOperation",value:function(){return this.app.request.get({url:"".concat(this.getBaseURL(),"/seconds-since-last-operation")})}}],[{key:"registerType",value:function(e){var t=this,r=f(f({},this),{},{app:e.app,hiveName:e.hiveName}),n=function(e){return new t(r,e)};return this.STATIC_METHODS.forEach((function(e){n[e]=function(){for(var n=arguments.length,o=new Array(n),s=0;s<n;s++)o[s]=arguments[s];return t[e].apply(r,o)}})),n}},{key:"keys",value:function(e){if(void 0!==e){if(!c.default.isObject(e))throw new Error("Options must be an object.");var t=e.cursor,r=e.pageSize,n=e.filterPattern;if(void 0!==t&&("number"!=typeof t||isNaN(t)))throw new Error("Cursor must be a number.");if(void 0!==r&&("number"!=typeof r||isNaN(r)))throw new Error("Page size must be a number.");if(void 0!==n&&("string"!=typeof n||!n))throw new Error("Filter pattern must be a string.")}return this.app.request.get({url:"".concat(this.app.urls.hiveStore(this.hiveName,this.TYPE),"/keys"),query:e})}},{key:"delete",value:function(e){if(!Array.isArray(e))throw new Error("Keys must be provided and must be a list of strings.");return this.app.request.delete({url:this.app.urls.hiveStore(this.hiveName,this.TYPE),data:e})}},{key:"exist",value:function(e){if(!Array.isArray(e))throw new Error("Keys must be provided and must be a list of strings.");return this.app.request.post({url:"".concat(this.app.urls.hiveStore(this.hiveName,this.TYPE),"/action/exist"),data:e})}},{key:"touch",value:function(e){if(!Array.isArray(e))throw new Error("Keys must be provided and must be a list of strings.");return this.app.request.put({url:"".concat(this.app.urls.hiveStore(this.hiveName,this.TYPE),"/action/touch"),data:e})}}]),e}();t.HiveStore=p,(0,u.default)(p,"STATIC_METHODS",["keys","delete","exist","touch"])},5766:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(3025);Object.keys(n).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===n[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return n[e]}}))}));var o=r(6502);Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))}));var s=r(5076);Object.keys(s).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===s[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return s[e]}}))}));var i=r(5817);Object.keys(i).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===i[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return i[e]}}))}));var a=r(9352);Object.keys(a).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===a[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}}))}))},3025:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.KeyValueStore=void 0;var o=n(r(861)),s=n(r(6690)),i=n(r(9728)),a=n(r(1655)),u=n(r(4993)),c=n(r(3808)),l=n(r(8416)),f=r(2257),p=r(9041),d=n(r(9853)),h=r(9095);function y(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function v(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?y(Object(r),!0).forEach((function(t){(0,l.default)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):y(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function m(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,c.default)(e);if(t){var o=(0,c.default)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,u.default)(this,r)}}var b=function(e){(0,a.default)(r,e);var t=m(r);function r(){return(0,s.default)(this,r),t.apply(this,arguments)}return(0,i.default)(r,[{key:"get",value:function(){return this.app.request.get({url:this.getBaseURL()})}},{key:"set",value:function(e,t){return this.constructor.set.apply(v(v({},this),this.constructor),[this.storeKey,e,t])}},{key:"increment",value:function(e){if(isNaN(e)||"number"!=typeof e)throw new Error("Value must be provided and must be a number.");return this.app.request.put({url:"".concat(this.getBaseURL(),"/increment"),query:{value:e}})}},{key:"decrement",value:function(e){if(isNaN(e)||"number"!=typeof e)throw new Error("Value must be provided and must be a number.");return this.app.request.put({url:"".concat(this.getBaseURL(),"/decrement"),query:{value:e}})}}],[{key:"get",value:function(e){if(!Array.isArray(e))throw new Error("Keys must be provided and must be a list of strings.");return this.app.request.post({url:this.app.urls.hiveStore(this.hiveName,this.TYPE),data:e})}},{key:"set",value:function(e,t,r){if(d.default.isObject(e)){if(!Object.keys(e).length)throw new Error("Provided object must have at least 1 key.");return this.app.request.put({url:this.app.urls.hiveStore(this.hiveName,this.TYPE),data:e})}if(!e||"string"!=typeof e)throw new Error("Key must be provided and must be a string.");if(void 0!==r){if(!d.default.isObject(r))throw new Error("Options must be an object.");var n=r.ttl,o=r.expireAt,s=r.condition;if(void 0!==n&&(isNaN(n)||"number"!=typeof n))throw new Error("TTL in seconds must be a number.");if(void 0!==o&&(isNaN(o)||"number"!=typeof o))throw new Error("ExpireAt timestamp must be a number.");if(void 0!==s&&!["IfExists","IfNotExists","Always"].includes(s))throw new Error("Condition must be one of this values: [IfExists, IfNotExists, Always].")}if(!(0,h.isHiveValueValid)(t))throw new Error("Value must be provided and must be one of types: string, number, boolean, object, array.");return this.app.request.put({url:"".concat(this.app.urls.hiveStore(this.hiveName,this.TYPE),"/").concat(e),data:v({value:t},r)})}}]),r}(p.HiveStore);t.KeyValueStore=b,(0,l.default)(b,"TYPE",f.HiveTypes.KEY_VALUE),(0,l.default)(b,"STATIC_METHODS",[].concat((0,o.default)(p.HiveStore.STATIC_METHODS),["get","set"]))},6502:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.ListStore=void 0;var o=n(r(6690)),s=n(r(9728)),i=n(r(1655)),a=n(r(4993)),u=n(r(3808)),c=n(r(8416)),l=r(2257),f=r(9041),p=r(9095);function d(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,u.default)(e);if(t){var o=(0,u.default)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,a.default)(this,r)}}var h=function(e){(0,i.default)(r,e);var t=d(r);function r(){return(0,o.default)(this,r),t.apply(this,arguments)}return(0,s.default)(r,[{key:"get",value:function(e,t){if(void 0!==t){if(isNaN(t)||"number"!=typeof t)throw new Error("Index To must be a number.");if(isNaN(e)||"number"!=typeof e)throw new Error("Index From must be a number.");return this.app.request.get({url:this.getBaseURL(),query:{from:e,to:t}})}if(void 0!==e){if(isNaN(e)||"number"!=typeof e)throw new Error("Index must be a number.");return this.app.request.get({url:"".concat(this.getBaseURL(),"/").concat(e)})}return this.app.request.get({url:this.getBaseURL()})}},{key:"length",value:function(){return this.app.request.get({url:"".concat(this.getBaseURL(),"/length")})}},{key:"insertBefore",value:function(e,t){return this.insert(e,t,!0)}},{key:"insertAfter",value:function(e,t){return this.insert(e,t,!1)}},{key:"insert",value:function(e,t,r){if(!(0,p.isHiveValueValid)(e))throw new Error("ValueToInsert must be provided and must be one of types: string, number, boolean, object, array.");if(!(0,p.isHiveValueValid)(t))throw new Error("AnchorValue must be provided and must be one of types: string, number, boolean, object, array.");return this.app.request.put({url:"".concat(this.getBaseURL(),"/insert-").concat(r?"before":"after"),data:{valueToInsert:e,anchorValue:t}})}},{key:"deleteValue",value:function(e,t){if(!(0,p.isHiveValueValid)(e))throw new Error("Value must be provided and must be one of types: string, number, boolean, object, array.");if(void 0!==t&&(isNaN(t)||"number"!=typeof t))throw new Error("Count must be a number.");return this.app.request.put({url:"".concat(this.getBaseURL(),"/delete-value"),data:{value:e,count:t}})}},{key:"addFirstValue",value:function(e){if(!(0,p.isHiveValueValid)(e))throw new Error("Value must be provided and must be one of types: string, number, boolean, object, array.");return this.app.request.put({url:"".concat(this.getBaseURL(),"/add-first"),data:[e]})}},{key:"addFirstValues",value:function(e){if(!(e&&Array.isArray(e)&&e.length&&(0,p.isHiveValueValid)(e)))throw new Error("Value must be provided and must be a list of valid JSON items.");return this.app.request.put({url:"".concat(this.getBaseURL(),"/add-first"),data:e})}},{key:"addLastValue",value:function(e){if(!(0,p.isHiveValueValid)(e))throw new Error("Value must be provided and must be one of types: string, number, boolean, object, array.");return this.app.request.put({url:"".concat(this.getBaseURL(),"/add-last"),data:[e]})}},{key:"addLastValues",value:function(e){if(!(e&&Array.isArray(e)&&e.length&&(0,p.isHiveValueValid)(e)))throw new Error("Value must be provided and must be a list of valid JSON items.");return this.app.request.put({url:"".concat(this.getBaseURL(),"/add-last"),data:e})}},{key:"deleteFirst",value:function(e){if(void 0!==e&&(isNaN(e)||"number"!=typeof e))throw new Error("Count must be a number.");return this.app.request.put({url:"".concat(this.getBaseURL(),"/get-first-and-delete"),query:{count:e}})}},{key:"deleteLast",value:function(e){if(void 0!==e&&(isNaN(e)||"number"!=typeof e))throw new Error("Count must be a number.");return this.app.request.put({url:"".concat(this.getBaseURL(),"/get-last-and-delete"),query:{count:e}})}}]),r}(f.HiveStore);t.ListStore=h,(0,c.default)(h,"TYPE",l.HiveTypes.LIST)},5076:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.MapStore=void 0;var o=n(r(6690)),s=n(r(9728)),i=n(r(1655)),a=n(r(4993)),u=n(r(3808)),c=n(r(8416)),l=r(2257),f=r(9041),p=n(r(9853)),d=r(9095);function h(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,u.default)(e);if(t){var o=(0,u.default)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,a.default)(this,r)}}var y=function(e){(0,i.default)(r,e);var t=h(r);function r(){return(0,o.default)(this,r),t.apply(this,arguments)}return(0,s.default)(r,[{key:"get",value:function(e){if(void 0!==e&&"string"!=typeof e&&!Array.isArray(e))throw new Error("Key(s) must be a string or list of strings.");return this.app.request.post({url:this.getBaseURL(),data:p.default.castArray(e)})}},{key:"getValue",value:function(e){if(!e||"string"!=typeof e)throw new Error("Key must be provided and must be a string.");return this.app.request.get({url:"".concat(this.getBaseURL(),"/get/").concat(e)})}},{key:"keyExists",value:function(e){if(!e||"string"!=typeof e)throw new Error("Key must be provided and must be a string.");return this.app.request.get({url:"".concat(this.getBaseURL(),"/exists/").concat(e)})}},{key:"length",value:function(){return this.app.request.get({url:"".concat(this.getBaseURL(),"/length")})}},{key:"keys",value:function(){return this.app.request.get({url:"".concat(this.getBaseURL(),"/keys")})}},{key:"values",value:function(){return this.app.request.get({url:"".concat(this.getBaseURL(),"/values")})}},{key:"set",value:function(e,t){if(!e)throw new Error("First argument must be provided and must be a string or an object.");if(p.default.isObject(e)){if(!Object.keys(e).length)throw new Error("Provided object must have at least 1 key.");return this.app.request.put({url:this.getBaseURL(),data:e})}if("string"!=typeof e)throw new Error("Key must be a string.");if(!(0,d.isHiveValueValid)(t))throw new Error("Value must be provided and must be one of types: string, number, boolean, object, array.");return this.app.request.put({url:"".concat(this.getBaseURL(),"/set/").concat(e),data:{value:t}})}},{key:"setWithOverwrite",value:function(e,t,r){if(!e||"string"!=typeof e)throw new Error("Key must be provided and must be a string.");if(!(0,d.isHiveValueValid)(t))throw new Error("Value must be provided and must be one of types: string, number, boolean, object, array.");if(void 0!==r&&"boolean"!=typeof r)throw new Error("Overwrite must be a boolean.");return this.app.request.put({url:"".concat(this.getBaseURL(),"/set-with-overwrite/").concat(e),data:{value:t,overwrite:r}})}},{key:"increment",value:function(e,t){if(!e||"string"!=typeof e)throw new Error("Key must be provided and must be a string.");if(void 0!==t&&(isNaN(t)||"number"!=typeof t))throw new Error("Count must be a number.");return this.app.request.put({url:"".concat(this.getBaseURL(),"/increment/").concat(e),query:{count:t}})}},{key:"decrement",value:function(e,t){if(!e||"string"!=typeof e)throw new Error("Key must be provided and must be a string.");if(void 0!==t&&(isNaN(t)||"number"!=typeof t))throw new Error("Count must be a number.");return this.app.request.put({url:"".concat(this.getBaseURL(),"/decrement/").concat(e),query:{count:t}})}},{key:"deleteKeys",value:function(e){if(!e||"string"!=typeof e&&!Array.isArray(e))throw new Error("Key(s) must be provided and must be a string or list of strings.");return this.app.request.delete({url:"".concat(this.getBaseURL(),"/by-obj-keys"),data:p.default.castArray(e)})}}]),r}(f.HiveStore);t.MapStore=y,(0,c.default)(y,"TYPE",l.HiveTypes.MAP)},5817:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.SetStore=void 0;var o=n(r(861)),s=n(r(6690)),i=n(r(9728)),a=n(r(1655)),u=n(r(4993)),c=n(r(3808)),l=n(r(8416)),f=r(9041),p=r(2257),d=r(9095);function h(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,c.default)(e);if(t){var o=(0,c.default)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,u.default)(this,r)}}var y=function(e){(0,a.default)(r,e);var t=h(r);function r(){return(0,s.default)(this,r),t.apply(this,arguments)}return(0,i.default)(r,[{key:"get",value:function(){return this.app.request.get({url:this.getBaseURL()})}},{key:"getRandom",value:function(e){if(void 0!==e&&(isNaN(e)||"number"!=typeof e))throw new Error("Count must be a number.");return this.app.request.get({url:"".concat(this.getBaseURL(),"/random"),query:{count:e}})}},{key:"getRandomAndDelete",value:function(e){if(void 0!==e&&(isNaN(e)||"number"!=typeof e))throw new Error("Count must be a number.");return this.app.request.put({url:"".concat(this.getBaseURL(),"/random"),query:{count:e}})}},{key:"addValue",value:function(e){if(!(0,d.isHiveValueValid)(e))throw new Error("Value must be provided and must be one of types: string, number, boolean, object, array.");return this.app.request.put({url:"".concat(this.getBaseURL(),"/add"),data:[e]})}},{key:"addValues",value:function(e){if(!(e&&Array.isArray(e)&&e.length&&(0,d.isHiveValueValid)(e)))throw new Error("Value must be provided and must be a list of valid JSON items.");return this.app.request.put({url:"".concat(this.getBaseURL(),"/add"),data:e})}},{key:"deleteValue",value:function(e){if(!(0,d.isHiveValueValid)(e))throw new Error("Value must be provided and must be one of types: string, number, boolean, object, array.");return this.app.request.delete({url:"".concat(this.getBaseURL(),"/values"),data:[e]})}},{key:"deleteValues",value:function(e){if(!(e&&Array.isArray(e)&&e.length&&(0,d.isHiveValueValid)(e)))throw new Error("Value must be provided and must be a list of valid JSON items.");return this.app.request.delete({url:"".concat(this.getBaseURL(),"/values"),data:e})}},{key:"isValueMember",value:function(e){if(!(0,d.isHiveValueValid)(e))throw new Error("Value must be provided and must be one of types: string, number, boolean, object, array.");return this.app.request.post({url:"".concat(this.getBaseURL(),"/contains"),data:[e]})}},{key:"isValuesMembers",value:function(e){if(!(e&&Array.isArray(e)&&e.length&&(0,d.isHiveValueValid)(e)))throw new Error("Value must be provided and must be a list of valid JSON items.");return this.app.request.post({url:"".concat(this.getBaseURL(),"/contains"),data:e})}},{key:"length",value:function(){return this.app.request.get({url:"".concat(this.getBaseURL(),"/length")})}}],[{key:"difference",value:function(e){if(!Array.isArray(e))throw new Error("Store keys must be provided and must be an array.");return this.app.request.post({url:"".concat(this.app.urls.hiveStore(this.hiveName,this.TYPE),"/action/difference"),data:e})}},{key:"intersection",value:function(e){if(!Array.isArray(e))throw new Error("Store keys must be provided and must be an array.");return this.app.request.post({url:"".concat(this.app.urls.hiveStore(this.hiveName,this.TYPE),"/action/intersection"),data:e})}},{key:"union",value:function(e){if(!Array.isArray(e))throw new Error("Store keys must be provided and must be an array.");return this.app.request.post({url:"".concat(this.app.urls.hiveStore(this.hiveName,this.TYPE),"/action/union"),data:e})}}]),r}(f.HiveStore);t.SetStore=y,(0,l.default)(y,"TYPE",p.HiveTypes.SET),(0,l.default)(y,"STATIC_METHODS",[].concat((0,o.default)(f.HiveStore.STATIC_METHODS),["difference","intersection","union"]))},9352:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.SortedSetStore=void 0;var o=n(r(861)),s=n(r(6690)),i=n(r(9728)),a=n(r(1655)),u=n(r(4993)),c=n(r(3808)),l=n(r(8416)),f=r(9041),p=r(2257),d=n(r(9853)),h=r(5817),y=r(9095);function v(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?v(Object(r),!0).forEach((function(t){(0,l.default)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function b(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,c.default)(e);if(t){var o=(0,c.default)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,u.default)(this,r)}}var g=function(e){(0,a.default)(r,e);var t=b(r);function r(){return(0,s.default)(this,r),t.apply(this,arguments)}return(0,i.default)(r,[{key:"add",value:function(e,t){if(!e||!Array.isArray(e))throw new Error("Items must be provided and must be an array.");if(void 0!==t){if(!d.default.isObject(t))throw new Error("Options must be an object.");var r=t.duplicateBehaviour,n=t.scoreUpdateMode,o=t.resultType;if(void 0!==r&&!["OnlyUpdate","AlwaysAdd"].includes(r))throw new Error("Duplicate Behaviour argument must be one of this values: OnlyUpdate, AlwaysAdd.");if(void 0!==n&&!["Greater","Less"].includes(n))throw new Error("Score Update Mode argument must be one of this values: Greater, Less.");if(void 0!==o&&!["NewAdded","TotalChanged"].includes(o))throw new Error("Result Type must be one of this values: NewAdded, TotalChanged.")}return this.app.request.put({url:"".concat(this.getBaseURL(),"/add"),data:m({items:e},t)})}},{key:"incrementScore",value:function(e,t){if(!(0,y.isHiveValueValid)(e))throw new Error("Value must be provided and must be one of types: string, number, boolean, object, array.");if(isNaN(t)||"number"!=typeof t)throw new Error("ScoreValue must be provided and must be a number.");return this.app.request.put({url:"".concat(this.getBaseURL(),"/increment"),data:{scoreValue:t,value:e}})}},{key:"decrementScore",value:function(e,t){if(!(0,y.isHiveValueValid)(e))throw new Error("Value must be provided and must be one of types: string, number, boolean, object, array.");if(isNaN(t)||"number"!=typeof t)throw new Error("ScoreValue must be provided and must be a number.");return this.app.request.put({url:"".concat(this.getBaseURL(),"/decrement"),data:{scoreValue:t,value:e}})}},{key:"getAndDeleteMaxScore",value:function(e){if(void 0!==e&&(isNaN(e)||"number"!=typeof e))throw new Error("Count must be a number.");return this.app.request.put({url:"".concat(this.getBaseURL(),"/get-with-max-score-and-delete"),query:{count:e}})}},{key:"getAndDeleteMinScore",value:function(e){if(void 0!==e&&(isNaN(e)||"number"!=typeof e))throw new Error("Count must be a number.");return this.app.request.put({url:"".concat(this.getBaseURL(),"/get-with-min-score-and-delete"),query:{count:e}})}},{key:"getRandom",value:function(e){if(void 0!==e){if(!d.default.isObject(e))throw new Error("Options must be an object.");var t=e.count,r=e.withScores;if(void 0!==t&&(isNaN(t)||"number"!=typeof t))throw new Error("Count must be a number.");if(void 0!==r&&"boolean"!=typeof r)throw new Error("With Scores argument must be a boolean.")}return this.app.request.get({url:"".concat(this.getBaseURL(),"/get-random"),query:m({},e)})}},{key:"getScore",value:function(e){if(!(0,y.isHiveValueValid)(e))throw new Error("Value must be provided and must be one of types: string, number, boolean, object, array.");return this.app.request.post({url:"".concat(this.getBaseURL(),"/get-score"),data:{value:e}})}},{key:"getRank",value:function(e,t){if(!(0,y.isHiveValueValid)(e))throw new Error("Value must be provided and must be one of types: string, number, boolean, object, array.");if(void 0!==t&&"boolean"!=typeof t)throw new Error("Reverse argument must be a boolean.");return this.app.request.post({url:"".concat(this.getBaseURL(),"/get-rank"),data:{value:e,reverse:t}})}},{key:"getRangeByRank",value:function(e,t,r){if(isNaN(e)||"number"!=typeof e)throw new Error("Start Rank must be provided and must be a number.");if(isNaN(t)||"number"!=typeof t)throw new Error("Stop Rank must be provided and must be a number.");if(void 0!==r){if(!d.default.isObject(r))throw new Error("Options must be an object.");var n=r.withScores,o=r.reverse;if(void 0!==n&&"boolean"!=typeof n)throw new Error("With Scores argument must be a boolean.");if(void 0!==o&&"boolean"!=typeof o)throw new Error("Reverse argument must be a boolean.")}return this.app.request.get({url:"".concat(this.getBaseURL(),"/get-range-by-rank"),query:m({startRank:e,stopRank:t},r)})}},{key:"getRangeByScore",value:function(e){if(void 0!==e){if(!d.default.isObject(e))throw new Error("Options must be an object.");var t=e.minScore,r=e.maxScore,n=e.minBound,o=e.maxBound,s=e.offset,i=e.pageSize,a=e.withScores,u=e.reverse;if(void 0!==t&&(isNaN(t)||"number"!=typeof t))throw new Error("Minimal Score must be a number.");if(void 0!==r&&(isNaN(r)||"number"!=typeof r))throw new Error("Maximal Score must be a number.");if(void 0!==n&&!["Include","Exclude","Infinity"].includes(n))throw new Error("Minimal bound must be one of this values: Include, Exclude, Infinity.");if(void 0!==o&&!["Include","Exclude","Infinity"].includes(o))throw new Error("Maximal bound must be one of this values: Include, Exclude, Infinity.");if(void 0!==s&&("number"!=typeof s||isNaN(s)))throw new Error("Offset must be a number.");if(void 0!==i&&("number"!=typeof i||isNaN(i)))throw new Error("Page Size must be a number.");if(void 0!==a&&"boolean"!=typeof a)throw new Error("With Scores argument must be a boolean.");if(void 0!==u&&"boolean"!=typeof u)throw new Error("Reverse argument must be a boolean.")}return this.app.request.get({url:"".concat(this.getBaseURL(),"/get-range-by-score"),query:m({},e)})}},{key:"deleteValue",value:function(e){if(!(0,y.isHiveValueValid)(e))throw new Error("Value must be provided and must be one of types: string, number, boolean, object, array.");return this.app.request.delete({url:"".concat(this.getBaseURL(),"/values"),data:[e]})}},{key:"deleteValues",value:function(e){if(!(e&&Array.isArray(e)&&e.length&&(0,y.isHiveValueValid)(e)))throw new Error("Value must be provided and must be a list of JSON items.");return this.app.request.delete({url:"".concat(this.getBaseURL(),"/values"),data:e})}},{key:"deleteValuesByRank",value:function(e,t){if(isNaN(e)||"number"!=typeof e)throw new Error("Start Rank must be provided and must be a number.");if(isNaN(t)||"number"!=typeof t)throw new Error("Stop Rank must be provided and must be a number.");return this.app.request.delete({url:"".concat(this.getBaseURL(),"/delete-by-rank"),query:{startRank:e,stopRank:t}})}},{key:"deleteValuesByScore",value:function(e){if(void 0!==e){if(!d.default.isObject(e))throw new Error("Options must be an object.");var t=e.minScore,r=e.maxScore,n=e.minBound,o=e.maxBound;if(void 0!==t&&(isNaN(t)||"number"!=typeof t))throw new Error("Minimal Score must be a number.");if(void 0!==r&&(isNaN(r)||"number"!=typeof r))throw new Error("Maximal Score must be a number.");if(void 0!==n&&!["Include","Exclude","Infinity"].includes(n))throw new Error("Minimal bound must be one of this values: Include, Exclude, Infinity.");if(void 0!==o&&!["Include","Exclude","Infinity"].includes(o))throw new Error("Maximal bound must be one of this values: Include, Exclude, Infinity.")}return this.app.request.delete({url:"".concat(this.getBaseURL(),"/delete-by-score"),query:m({},e)})}},{key:"length",value:function(){return this.app.request.get({url:"".concat(this.getBaseURL(),"/length")})}},{key:"countBetweenScores",value:function(e){if(void 0!==e){if(!d.default.isObject(e))throw new Error("Options must be an object.");var t=e.minScore,r=e.maxScore,n=e.minBound,o=e.maxBound;if(void 0!==t&&(isNaN(t)||"number"!=typeof t))throw new Error("Minimal Score must be a number.");if(void 0!==r&&(isNaN(r)||"number"!=typeof r))throw new Error("Maximal Score must be a number.");if(void 0!==n&&!["Include","Exclude","Infinity"].includes(n))throw new Error("Minimal bound must be one of this values: Include, Exclude, Infinity.");if(void 0!==o&&!["Include","Exclude","Infinity"].includes(o))throw new Error("Maximal bound must be one of this values: Include, Exclude, Infinity.")}return this.app.request.get({url:"".concat(this.getBaseURL(),"/count"),query:m({},e)})}}],[{key:"intersection",value:function(e){if(!Array.isArray(e))throw new Error("Store keys must be provided and must be an array.");return this.app.request.post({url:"".concat(this.app.urls.hiveStore(this.hiveName,this.TYPE),"/action/intersection"),data:e})}},{key:"union",value:function(e){if(!Array.isArray(e))throw new Error("Store keys must be provided and must be an array.");return this.app.request.post({url:"".concat(this.app.urls.hiveStore(this.hiveName,this.TYPE),"/action/union"),data:e})}}]),r}(f.HiveStore);t.SortedSetStore=g,(0,l.default)(g,"TYPE",p.HiveTypes.SORTED_SET),(0,l.default)(g,"STATIC_METHODS",[].concat((0,o.default)(f.HiveStore.STATIC_METHODS),["difference","intersection","union"])),(0,l.default)(g,"difference",h.SetStore.difference)},9095:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isHiveValueValid=function(e){if(null==e)return!1;try{return!!JSON.stringify(e)}catch(e){return!1}}},5579:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(434)),s=n(r(8416)),i=n(r(6690)),a=n(r(9728)),u=n(r(8698)),c=n(r(3930)),l=n(r(294)),f=n(r(435)),p=n(r(9853)),d=n(r(7738));function h(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var y={appId:null,apiKey:null,serverURL:"https://api.backendless.com",domain:null,apiURI:"/api",debugMode:!1,standalone:!1,XMLHttpRequest:"undefined"!=typeof XMLHttpRequest?XMLHttpRequest:void 0},v=["appId","apiKey","domain"],m="object"===("undefined"==typeof self?"undefined":(0,u.default)(self))&&self.self===self&&self||"object"===(void 0===r.g?"undefined":(0,u.default)(r.g))&&r.g.global===r.g&&r.g,b=m&&m.Backendless,g=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=t[0],o=t[1];return n&&"object"===(0,u.default)(n)?n:"string"!=typeof n||o?{appId:n,apiKey:o}:{domain:n}},w=function(e){if(e.domain&&!e.domain.startsWith("https://")&&!e.domain.startsWith("http://"))throw new Error("When initialize the SDK with a custom domain it should start with http:// or https://, for example: Backendless.initApp('https://foobar.com')")},k={Logging:function(){return r(7776).Z},Counters:function(){return r(1062).Z},Cache:function(){return r(8469).Z},Commerce:function(){return r(5165).Z},Users:function(){return r(9681).Z},BL:function(){return r(6912).Z},Data:function(){return r(7607).Z},Hive:function(){return r(8512).ZP},Messaging:function(){return r(898).Z},Files:function(){return r(3011).Z},RT:function(){return r(9181).default},SharedObject:function(){return r(7578).Z},LocalCache:function(){return r(5703).Z},UnitOfWork:function(){return r(7890).Z},Management:function(){return r(9415).Z},Automations:function(){return r(6129).Z}},E=new(function(){function e(t){(0,i.default)(this,e),this.initConfig(t),this.Request=c.default,this.request=new l.default(this),this.urls=new f.default(this)}return(0,a.default)(e,[{key:"initConfig",value:function(e){for(var t in(e=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?h(Object(r),!0).forEach((function(t){(0,s.default)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):h(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e)).domain&&(delete e.appId,delete e.apiKey),y)if(y.hasOwnProperty(t)){var r="__".concat(t);v.includes(t)&&delete this[r];var n=void 0===this[r]?y[t]:this[r];this[r]=void 0===e[t]?n:e[t]}}},{key:"initApp",value:function(){var t=g.apply(void 0,arguments);w(t);var r=t.standalone?new e(this):this;r.initConfig(t),r.resetRT(),r.__removeService("LocalCache");var n=(0,o.default)({loadLevels:!0,globalLevel:"all",levels:{}},t.logging);return r.__hasService("Logging")&&(r.Logging.reset(),r.Logging.setConfig(n)),r.__hasService("Users")&&(r.Users.currentUser=null),delete this.__device,r.loggingConfig=n,r}},{key:"__hasService",value:function(e){return!!this["__".concat(e)]}},{key:"__removeService",value:function(e){delete this["__".concat(e)]}},{key:"__getService",value:function(e){var t="__".concat(e);if(!this[t]){var r=k[e]();this[t]=new r(this)}return this[t]}},{key:"standalone",get:function(){return this.__standalone},set:function(e){throw new Error("Setting value to Backendless.standalone directly is not possible, "+"instead you must use Backendless.initApp({ appId: [APP_ID], apiKey: [API_KEY], standalone: ".concat(e," })"))}},{key:"appId",get:function(){return this.__appId},set:function(e){throw new Error("Setting '".concat(e,"' value to Backendless.appId directly is not possible, ")+"instead you must use Backendless.initApp('".concat(e,"', API_KEY)"))}},{key:"apiKey",get:function(){return this.__apiKey},set:function(e){throw new Error("Setting '".concat(e,"' value to Backendless.apiKey directly is not possible, ")+"instead you must use Backendless.initApp(APP_ID, '".concat(e,"')"))}},{key:"serverURL",get:function(){return this.__serverURL},set:function(e){this.__serverURL=e}},{key:"domain",get:function(){return this.__domain},set:function(e){this.__domain=e}},{key:"apiURI",get:function(){return this.__apiURI},set:function(e){this.__apiURI=e}},{key:"appPath",get:function(){return this.domain?this.domain+this.apiURI:[this.serverURL,this.appId,this.apiKey].join("/")},set:function(e){throw new Error("Setting '".concat(e,"' value to Backendless.appPath directly is not possible, ")+"instead you must use Backendless.initApp(APP_ID, API_KEY) for setup the value")}},{key:"debugMode",get:function(){return this.__debugMode},set:function(e){e=!!e,this.__debugMode!==e&&(this.__debugMode=e,this.__RT&&this.RT.setDebugMode(e))}},{key:"XMLHttpRequest",get:function(){return this.__XMLHttpRequest},set:function(e){this.__XMLHttpRequest=e}},{key:"device",get:function(){if(!this.__device)throw new Error("Device is not defined. Please, run the Backendless.setupDevice");return this.__device},set:function(e){throw new Error("Setting value to Backendless.device directly is not possible, instead you must use Backendless.setupDevice(deviceProperties) for setup the device")}},{key:"setupDevice",value:function(e){var t=r(1318).Z;this.__device=new t(e)}},{key:"Utils",get:function(){return p.default}},{key:"getCurrentUserToken",value:function(){return this.Users.getCurrentUserToken()}},{key:"setCurrentUserToken",value:function(e){this.Users.setCurrentUserToken(e)}},{key:"browser",get:function(){return r(9935).i()}},{key:"noConflict",value:function(){return m&&(m.Backendless=b),this}},{key:"Logging",get:function(){return this.__getService("Logging")}},{key:"Counters",get:function(){return this.__getService("Counters")}},{key:"Cache",get:function(){return this.__getService("Cache")}},{key:"Commerce",get:function(){return this.__getService("Commerce")}},{key:"Users",get:function(){return this.__getService("Users")}},{key:"User",get:function(){return r(5602).default}},{key:"UserService",get:function(){return this.Users}},{key:"BL",get:function(){return this.__getService("BL")}},{key:"CustomServices",get:function(){return this.BL.CustomServices}},{key:"APIServices",get:function(){return this.BL.CustomServices}},{key:"Events",get:function(){return this.BL.Events}},{key:"Data",get:function(){return this.__getService("Data")}},{key:"Hive",get:function(){return this.__getService("Hive")}},{key:"Messaging",get:function(){return this.__getService("Messaging")}},{key:"Files",get:function(){return this.__getService("Files")}},{key:"RT",get:function(){return this.__getService("RT")}},{key:"resetRT",value:function(){this.__RT&&(this.__RT.terminate(),delete this.__RT)}},{key:"SharedObject",get:function(){return this.__getService("SharedObject")}},{key:"LocalCache",get:function(){return this.__getService("LocalCache")}},{key:"UnitOfWork",get:function(){return this.__getService("UnitOfWork")}},{key:"Management",get:function(){return this.__getService("Management")}},{key:"Automations",get:function(){return this.__getService("Automations")}},{key:"applicationId",get:function(){return this.appId},set:function(e){console.warn("getter/setter for Backendless.applicationId is deprecated, instead use Backendless.appId"),this.appId=e}},{key:"secretKey",get:function(){return console.warn("getter/setter for Backendless.secretKey is deprecated, instead use Backendless.apiKey"),this.apiKey},set:function(e){console.warn("getter/setter for Backendless.secretKey is deprecated, instead use Backendless.apiKey"),this.apiKey=e}},{key:"Persistence",get:function(){return function e(){e.isShown||(console.warn("Backendless.Persistence is deprecated namespace, use Backendless.Data instead"),e.isShown=!0)}(),this.Data}},{key:"DataQueryBuilder",get:function(){return this.Data.QueryBuilder}},{key:"GroupQueryBuilder",get:function(){return this.Data.GroupQueryBuilder}},{key:"JSONUpdateBuilder",get:function(){return this.Data.JSONUpdateBuilder}},{key:"LoadRelationsQueryBuilder",get:function(){return this.Data.LoadRelationsQueryBuilder}},{key:"Bodyparts",get:function(){return this.Messaging.Bodyparts}},{key:"PublishOptions",get:function(){return this.Messaging.PublishOptions}},{key:"DeliveryOptions",get:function(){return this.Messaging.DeliveryOptions}},{key:"PublishOptionsHeaders",get:function(){return this.Messaging.PublishOptionsHeaders}},{key:"EmailEnvelope",get:function(){return this.Messaging.EmailEnvelope}},{key:"Expression",get:function(){return d.default}}]),e}())(y);m&&(m.Backendless=E);var O=E;(t=e.exports=E).default=O},5703:(e,t,r)=>{"use strict";var n=r(4836);t.Z=void 0;var o=n(r(6690)),s=n(r(9728)),i=n(r(9853)),a=n(r(1376)),u=n(r(4770)),c=function(){function e(t){(0,o.default)(this,e),this.app=t,this.storageName=this.app.appId?"".concat("Backendless","_").concat(this.app.appId):"Backendless";var r=i.default.isLocalStorageSupported?u.default:a.default;this.setStorage(r),this.Keys={USER_TOKEN:"user-token",CURRENT_USER_ID:"current-user-id",STAY_LOGGED_IN:"stayLoggedIn"}}return(0,s.default)(e,[{key:"setStorage",value:function(e){this.storage=new e(this.storageName,"Backendless")}},{key:"set",value:function(e,t){this.storage.set(e,t)}},{key:"get",value:function(e){return this.storage.get(e)}},{key:"remove",value:function(e){this.storage.remove(e)}}]),e}();t.Z=c},4770:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(6690)),s=n(r(9728));var i=function(){function e(t,r){(0,o.default)(this,e),this.storageName=t,function(e,t){if(!localStorage.getItem(e.storageName)){var r=localStorage.getItem(t);r&&(localStorage.setItem(e.storageName,r),localStorage.removeItem(t))}}(this,r)}return(0,s.default)(e,[{key:"getStore",value:function(){try{return JSON.parse(localStorage.getItem(this.storageName))||{}}catch(e){console.warn("Could not parse data from LocalStorage",e)}return{}}},{key:"setStore",value:function(e){localStorage.setItem(this.storageName,JSON.stringify(e))}},{key:"get",value:function(e){return this.getStore()[e]}},{key:"set",value:function(e,t){var r=this.getStore();r[e]=t,this.setStore(r)}},{key:"remove",value:function(e){var t=this.getStore();delete t[e],this.setStore(t)}}]),e}();t.default=i},1376:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(6690)),s=n(r(9728)),i=function(){function e(){(0,o.default)(this,e),this.data={}}return(0,s.default)(e,[{key:"get",value:function(e){return this.data[e]}},{key:"set",value:function(e,t){this.data[e]=t}},{key:"remove",value:function(e){delete this.data[e]}}]),e}();t.default=i},7776:(e,t,r)=>{"use strict";var n=r(4836);t.Z=void 0;var o=n(r(4687)),s=n(r(861)),i=n(r(7156)),a=n(r(6690)),u=n(r(9728)),c=n(r(3842)),l=function(){function e(t){(0,a.default)(this,e),this.app=t,this.reset(),t.loggingConfig&&this.setConfig(t.loggingConfig)}var t;return(0,u.default)(e,[{key:"setConfig",value:function(e){e.levels&&(this.levels=e.levels),e.globalLevel&&(this.globalLevel=e.globalLevel),e.loadLevels&&this.loadLoggingLevels()}},{key:"reset",value:function(){this.levels={},this.globalLevel="all",this.loggers={},this.messages=[],this.numOfMessages=10,this.timeFrequency=1,this.messagesLimit=1e3}},{key:"loadLoggingLevels",value:function(){var e=this;this.app.request.get({url:this.app.urls.loggingLevels()}).then((function(t){var r={};t.forEach((function(e){r[e.name]=e.level}));var n=r["Global logger"];e.setConfig({loggers:r,globalLevel:n})})).catch((function(e){console.error("Could not load logging levels: ",e)}))}},{key:"getLogger",value:function(e){if(!e||"string"!=typeof e)throw new Error("Logger Name must be provided and must be a string.");return this.loggers[e]||(this.loggers[e]=new c.default(e,this)),this.loggers[e]}},{key:"flush",value:(t=(0,i.default)(o.default.mark((function e(){var t,r=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return!this.flushRequest&&this.messages.length&&(this.stopFlushInterval(),t=(0,s.default)(this.messages),this.messages=[],this.flushRequest=this.app.request.put({url:this.app.urls.logging(),data:t}).catch((function(e){throw r.messages=[].concat((0,s.default)(t),(0,s.default)(r.messages)),r.checkMessagesLimit(),e})).finally((function(){return delete r.flushRequest}))),e.abrupt("return",this.flushRequest);case 2:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"push",value:function(e,t,r,n){if("string"!=typeof r)throw new Error('"message" must be a string');this.messages.push({logger:e,message:r,exception:n,"log-level":t,timestamp:Date.now()}),this.checkMessagesLen()}},{key:"checkMessagesLen",value:function(){var e=this;this.checkMessagesLenTimer&&clearTimeout(this.checkMessagesLenTimer),this.checkMessagesLenTimer=setTimeout((function(){e.messages.length>=e.numOfMessages?e.flush():e.startFlushInterval()}),0)}},{key:"checkMessagesLimit",value:function(){this.messages.length>this.messagesLimit&&(this.messages=this.messages.slice(this.messages.length-this.messagesLimit))}},{key:"startFlushInterval",value:function(){var e=this;this.flushInterval||(this.flushInterval=setTimeout((function(){return e.flush()}),1e3*this.timeFrequency))}},{key:"stopFlushInterval",value:function(){this.flushInterval&&(clearTimeout(this.flushInterval),delete this.flushInterval)}},{key:"setLogReportingPolicy",value:function(e,t){void 0!==t&&this.timeFrequency!==t&&this.stopFlushInterval(),e>this.messagesLimit&&(this.messagesLimit=e),this.numOfMessages=e,this.timeFrequency=t,this.checkMessagesLen()}},{key:"setMessagesLimit",value:function(e){this.messagesLimit=e,this.checkMessagesLimit()}}]),e}();t.Z=l},3842:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(6690)),s=n(r(9728)),i={off:0,fatal:1,error:2,warn:3,info:4,debug:5,trace:6,all:6},a=function(){function e(t,r){(0,o.default)(this,e),this.name=t,this.logging=r}return(0,s.default)(e,[{key:"debug",value:function(e){return this.log("DEBUG",e)}},{key:"info",value:function(e){return this.log("INFO",e)}},{key:"warn",value:function(e,t){return this.log("WARN",e,t)}},{key:"error",value:function(e,t){return this.log("ERROR",e,t)}},{key:"fatal",value:function(e,t){return this.log("FATAL",e,t)}},{key:"trace",value:function(e){return this.log("TRACE",e)}},{key:"log",value:function(e,t,r){if(this.min(e))return this.logging.push(this.name,e,t,r)}},{key:"min",value:function(e){e=e.toLowerCase();var t=this.logging.globalLevel,r=this.logging.levels[this.name];return!(t&&i[t.toLowerCase()]<i[e])&&(!r||i[r.toLowerCase()]>=i[e])}}]),e}();t.default=a},6496:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(6690)),s=n(r(9728)),i=function(){function e(t){(0,o.default)(this,e),this.app=t}return(0,s.default)(e,[{key:"createTable",value:function(e,t){if(!e||"string"!=typeof e)throw new Error("Table name must be provided and must be a string.");if(!Array.isArray(t))throw new Error("Columns must be a list.");return this.app.request.post({url:this.app.urls.managementDataTable(),data:{name:e,columns:t}})}}]),e}();t.default=i},9415:(e,t,r)=>{"use strict";var n=r(4836);t.Z=void 0;var o=n(r(9728)),s=n(r(6690)),i=n(r(6496)),a=(0,o.default)((function e(t){(0,s.default)(this,e),this.app=t,this.Data=new i.default(t)}));t.Z=a},1127:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o,s,i=n(r(6690)),a=n(r(9728)),u=n(r(1588)),c=n(r(1655)),l=n(r(4993)),f=n(r(3808)),p=n(r(6877)),d=r(9181);function h(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,f.default)(e);if(t){var o=(0,f.default)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,l.default)(this,r)}}var y="MESSAGE",v=(o=d.RTScopeConnector.connectionRequired(),s=function(e){(0,c.default)(r,e);var t=h(r);function r(e,n){var o;return(0,i.default)(this,r),(o=t.call(this,e)).app=n,o.connect(),o}return(0,a.default)(r,[{key:"connectSubscriber",get:function(){return this.app.RT.subscriptions.connectToPubSub}},{key:"usersSubscriber",get:function(){return this.app.RT.subscriptions.onPubSubUserStatus}},{key:"commandSubscriber",get:function(){return this.app.RT.subscriptions.onPubSubCommand}},{key:"commandSender",get:function(){return this.app.RT.methods.sendPubSubCommand}},{key:"getScopeOptions",value:function(){return{channel:this.options.name}}},{key:"connect",value:function(){if(this.app)return(0,u.default)((0,f.default)(r.prototype),"connect",this).call(this)}},{key:"publish",value:function(e,t,r){return this.app.Messaging.publish(this.options.name,e,t,r)}},{key:"addMessageListener",value:function(e,t,r){"function"==typeof e&&(r=t,t=e,e=void 0),this.addSubscription(y,this.app.RT.subscriptions.onPubSubMessage,{callback:t,onError:r,params:{selector:e}})}},{key:"removeMessageListener",value:function(e,t){if("function"==typeof e&&(t=e,e=void 0),e&&"string"!=typeof e)throw new Error("Selector must be a string.");if("function"!=typeof t)throw new Error("Callback must be a function.");this.stopSubscription(y,{matcher:function(r){return e?r.params.selector===e&&r.callback===t:r.callback===t}})}},{key:"removeMessageListeners",value:function(e){if("string"!=typeof e)throw new Error("Selector must be a string.");this.stopSubscription(y,{matcher:function(t){return t.params.selector===e}})}},{key:"removeAllMessageListeners",value:function(){this.stopSubscription(y,{})}},{key:"addCommandListener",value:function(e,t){return(0,u.default)((0,f.default)(r.prototype),"addCommandListener",this).call(this,e,t),this}},{key:"addUserStatusListener",value:function(e,t){return(0,u.default)((0,f.default)(r.prototype),"addUserStatusListener",this).call(this,e,t),this}},{key:"removeCommandListener",value:function(e){return(0,u.default)((0,f.default)(r.prototype),"removeCommandListeners",this).call(this,e),this}},{key:"removeCommandListeners",value:function(e){return(0,u.default)((0,f.default)(r.prototype),"removeCommandListeners",this).call(this,e),this}},{key:"removeUserStatusListeners",value:function(e){return(0,u.default)((0,f.default)(r.prototype),"removeUserStatusListeners",this).call(this,e),this}},{key:"addConnectListener",value:function(e,t){return(0,u.default)((0,f.default)(r.prototype),"addConnectListener",this).call(this,e,t),this}},{key:"removeConnectListeners",value:function(e,t){return(0,u.default)((0,f.default)(r.prototype),"removeConnectListeners",this).call(this,e,t),this}},{key:"removeAllListeners",value:function(){return(0,u.default)((0,f.default)(r.prototype),"removeAllListeners",this).call(this),this}},{key:"send",value:function(e,t){return(0,u.default)((0,f.default)(r.prototype),"send",this).call(this,e,t)}},{key:"join",value:function(){(0,u.default)((0,f.default)(r.prototype),"connect",this).call(this)}},{key:"leave",value:function(){(0,u.default)((0,f.default)(r.prototype),"disconnect",this).call(this)}},{key:"isJoined",value:function(){return(0,u.default)((0,f.default)(r.prototype),"isConnected",this).call(this)}}]),r}(d.RTScopeConnector),(0,p.default)(s.prototype,"addMessageListener",[o],Object.getOwnPropertyDescriptor(s.prototype,"addMessageListener"),s.prototype),s);t.default=v},3695:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(9728)),s=n(r(6690)),i=(0,o.default)((function e(t){(0,s.default)(this,e),t=t||{},this.textmessage=t&&t.textmessage,this.htmlmessage=t&&t.htmlmessage}));t.default=i},7314:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(9728)),s=n(r(6690)),i=(0,o.default)((function e(t){(0,s.default)(this,e),t=t||{},this.publishPolicy=t.publishPolicy||void 0,this.pushBroadcast=t.pushBroadcast||void 0,this.pushSinglecast=t.pushSinglecast||void 0,this.publishAt=t.publishAt||void 0,this.repeatEvery=t.repeatEvery||void 0,this.repeatExpiresAt=t.repeatExpiresAt||void 0}));t.default=i},4595:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(6690)),s=n(r(9728)),i=n(r(9853)),a=function(){function e(t){(0,o.default)(this,e),t=t||{},this.addresses=i.default.castArray(t.addresses),this.ccAddresses=i.default.castArray(t.ccAddresses),this.bccAddresses=i.default.castArray(t.bccAddresses),this.query=t.query||null,this.uniqueEmails=t.uniqueEmails||!1}return(0,s.default)(e,[{key:"setTo",value:function(e){return this.addresses=i.default.castArray(e),this}},{key:"addTo",value:function(e){return this.addresses=this.addresses.concat(i.default.castArray(e)),this}},{key:"getTo",value:function(){return this.addresses}},{key:"setCc",value:function(e){return this.ccAddresses=i.default.castArray(e),this}},{key:"addCc",value:function(e){return this.ccAddresses=this.ccAddresses.concat(i.default.castArray(e)),this}},{key:"getCc",value:function(){return this.ccAddresses}},{key:"setBcc",value:function(e){return this.bccAddresses=i.default.castArray(e),this}},{key:"addBcc",value:function(e){return this.bccAddresses=this.bccAddresses.concat(i.default.castArray(e)),this}},{key:"getBcc",value:function(){return this.bccAddresses}},{key:"setQuery",value:function(e){return this.query=e,this}},{key:"getQuery",value:function(){return this.query}},{key:"setUniqueEmails",value:function(e){return this.uniqueEmails=e,this}},{key:"getUniqueEmails",value:function(){return this.uniqueEmails}},{key:"toJSON",value:function(){var e={};return this.addresses.length>0&&(e.addresses=this.addresses),this.ccAddresses.length>0&&(e["cc-addresses"]=this.ccAddresses),this.bccAddresses.length>0&&(e["bcc-addresses"]=this.bccAddresses),this.query&&(e.criteria=this.query),e.uniqueEmails=this.uniqueEmails,e}}],[{key:"create",value:function(t){return new e(t)}}]),e}();t.default=a},5500:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Bodyparts",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"DeliveryOptions",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"EmailEnvelope",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"PublishOptions",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"PublishOptionsHeaders",{enumerable:!0,get:function(){return o.default}});var o=n(r(2545)),s=n(r(2467)),i=n(r(7314)),a=n(r(3695)),u=n(r(4595))},2545:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r={MESSAGE_TAG:"message",IOS_ALERT_TAG:"ios-alert",IOS_BADGE_TAG:"ios-badge",IOS_SOUND_TAG:"ios-sound",ANDROID_TICKER_TEXT_TAG:"android-ticker-text",ANDROID_CONTENT_TITLE_TAG:"android-content-title",ANDROID_CONTENT_TEXT_TAG:"android-content-text",ANDROID_ACTION_TAG:"android-action",WP_TYPE_TAG:"wp-type",WP_TITLE_TAG:"wp-title",WP_TOAST_SUBTITLE_TAG:"wp-subtitle",WP_TOAST_PARAMETER_TAG:"wp-parameter",WP_TILE_BACKGROUND_IMAGE:"wp-backgroundImage",WP_TILE_COUNT:"wp-count",WP_TILE_BACK_TITLE:"wp-backTitle",WP_TILE_BACK_BACKGROUND_IMAGE:"wp-backImage",WP_TILE_BACK_CONTENT:"wp-backContent",WP_RAW_DATA:"wp-raw"};t.default=r},2467:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(9728)),s=n(r(6690)),i=(0,o.default)((function e(t){(0,s.default)(this,e),t=t||{},this.publisherId=t.publisherId||void 0,this.headers=t.headers||void 0,this.subtopic=t.subtopic||void 0}));t.default=i},898:(e,t,r)=>{"use strict";var n=r(4836);t.Z=void 0;var o=n(r(4687)),s=n(r(434)),i=n(r(8698)),a=n(r(7156)),u=n(r(6690)),c=n(r(9728)),l=n(r(1127)),f=r(5500),p=function(){function e(t){(0,u.default)(this,e),this.app=t,this.Bodyparts=f.Bodyparts,this.PublishOptions=f.PublishOptions,this.DeliveryOptions=f.DeliveryOptions,this.PublishOptionsHeaders=f.PublishOptionsHeaders,this.EmailEnvelope=f.EmailEnvelope}var t,r,n,p,h,y,v,m,b,g;return(0,c.default)(e,[{key:"subscribe",value:function(e){return d(e),new l.default({name:e},this.app)}},{key:"publish",value:(g=(0,a.default)(o.default.mark((function e(t,r,n,a){var u;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(d(t),u={message:r},!n){e.next=6;break}if(!Array.isArray(n)&&"object"===(0,i.default)(n)){e.next=5;break}throw new Error('"publishOptions" argument must be an object.');case 5:(0,s.default)(u,n);case 6:if(!a){e.next=10;break}if(!Array.isArray(a)&&"object"===(0,i.default)(a)){e.next=9;break}throw new Error('"deliveryOptions" argument must be an object.');case 9:(0,s.default)(u,a);case 10:return e.abrupt("return",this.app.request.post({url:this.app.urls.messagingChannel(t),data:u}));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n){return g.apply(this,arguments)})},{key:"pushWithTemplate",value:(b=(0,a.default)(o.default.mark((function e(t,r){var n;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Push Template Name must be provided and must be a string.");case 2:return n={},r&&(n.templateValues=r),e.abrupt("return",this.app.request.post({url:this.app.urls.messagingPushWithTemplate(t),data:n}));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return b.apply(this,arguments)})},{key:"sendEmail",value:(m=(0,a.default)(o.default.mark((function e(t,r,n,s){var a;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Email Subject must be provided and must be a string.");case 2:if(r&&!Array.isArray(r)&&"object"===(0,i.default)(r)){e.next=4;break}throw new Error("BodyParts must be an object");case 4:if(r.textmessage||r.htmlmessage){e.next=6;break}throw new Error("BodyParts must contain at least one property of [ textmessage | htmlmessage ]");case 6:if(Array.isArray(n)&&n.length){e.next=8;break}throw new Error("Recipients must be a non empty array.");case 8:return a={subject:t,bodyparts:r,to:n},Array.isArray(s)&&s.length&&(a.attachment=s),e.abrupt("return",this.app.request.post({url:this.app.urls.messagingEmail(),data:a}));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n){return m.apply(this,arguments)})},{key:"sendEmailFromTemplate",value:(v=(0,a.default)(o.default.mark((function e(t,r,n,s){var i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Email Template Name must be provided and must be a string.");case 2:if(r instanceof f.EmailEnvelope){e.next=4;break}throw new Error("EmailEnvelope is required and should be instance of Backendless.Messaging.EmailEnvelope");case 4:return(i=r.toJSON())["template-name"]=t,n&&!Array.isArray(n)&&(i["template-values"]=n),Array.isArray(n)&&!s&&(s=n),s&&(i.attachment=s),e.abrupt("return",this.app.request.post({url:this.app.urls.emailTemplateSend(),data:i}));case 10:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n){return v.apply(this,arguments)})},{key:"cancel",value:(y=(0,a.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Message ID must be provided and must be a string.");case 2:return e.abrupt("return",this.app.request.delete({url:this.app.urls.messagingMessage(t)}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return y.apply(this,arguments)})},{key:"registerDevice",value:(h=(0,a.default)(o.default.mark((function e(t,r,n){var s,i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=this.app.device,i={deviceToken:t,deviceId:s.uuid,os:s.platform,osVersion:s.version},Array.isArray(r)&&(i.channels=r),"number"==typeof n?i.expiration=n:n instanceof Date&&(i.expiration=n.getTime()/1e3),e.abrupt("return",this.app.request.post({url:this.app.urls.messagingRegistrations(),data:i}));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return h.apply(this,arguments)})},{key:"getRegistrations",value:(p=(0,a.default)(o.default.mark((function e(){var t;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.app.device,e.abrupt("return",this.app.request.get({url:this.app.urls.messagingRegistrationDevice(t.uuid)}));case 2:case"end":return e.stop()}}),e,this)}))),function(){return p.apply(this,arguments)})},{key:"unregisterDevice",value:(n=(0,a.default)(o.default.mark((function e(){var t;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.app.device,e.abrupt("return",this.app.request.delete({url:this.app.urls.messagingRegistrationDevice(t.uuid)}));case 2:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"getMessageStatus",value:(r=(0,a.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Message ID must be provided and must be a string.");case 2:return e.abrupt("return",this.app.request.get({url:this.app.urls.messagingMessage(t)}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"getPushTemplates",value:(t=(0,a.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Device Type must be provided and must be a string.");case 2:return e.abrupt("return",this.app.request.get({url:this.app.urls.messagingPushTemplates(t)}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),e}();function d(e){if(!e||"string"!=typeof e)throw new Error("Channel Name must be provided and must be a string.");if(e.indexOf("/")>=0)throw new Error("Channel Name can not contain slash chars")}t.Z=p},394:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(6690)),s=n(r(9728)),i=n(r(8416)),a="GRANT",u="DENY",c=function(){function e(t,r){(0,o.default)(this,e),this.permission=t,this.app=r,this.grantUser=this.backwardCompatibility("grantForUser","grantUser"),this.denyUser=this.backwardCompatibility("denyForUser","denyUser"),this.grantRole=this.backwardCompatibility("grantForRole","grantRole"),this.denyRole=this.backwardCompatibility("denyForRole","denyRole"),this.grant=this.backwardCompatibility("grantForAllUsers","grant"),this.deny=this.backwardCompatibility("denyForAllUsers","deny")}return(0,s.default)(e,[{key:"backwardCompatibility",value:function(e,t){var r=this,n=this.constructor.BACKWARD_COMPATIBILITY_LABEL;return function(){var o='"'.concat(n,".").concat(t,'" is deprecated and will be removed in the nearest release.'),s='Please use "'.concat(n,".").concat(e,'" instead of.');return console.warn("".concat(o,"\n").concat(s)),r[e].apply(r,arguments)}}},{key:"grantForUser",value:function(e,t){return this.sendRequest(a,t,{userId:e})}},{key:"denyForUser",value:function(e,t){return this.sendRequest(u,t,{userId:e})}},{key:"grantForRole",value:function(e,t){return this.sendRequest(a,t,{roleName:e})}},{key:"denyForRole",value:function(e,t){return this.sendRequest(u,t,{roleName:e})}},{key:"grantForAllUsers",value:function(e){return this.sendRequest(a,e,{userId:"*"})}},{key:"denyForAllUsers",value:function(e){return this.sendRequest(u,e,{userId:"*"})}},{key:"grantForAllRoles",value:function(e){return this.sendRequest(a,e,{roleName:"*"})}},{key:"denyForAllRoles",value:function(e){return this.sendRequest(u,e,{roleName:"*"})}},{key:"sendRequest",value:function(e,t,r){var n=r.userId,o=r.roleName,s={permission:this.permission};return n?s.user=n:o&&(s.role=o),this.app.request.put({url:this.getRequestURL(e,t),data:s})}},{key:"getRequestURL",value:function(){}}]),e}();t.default=c,(0,i.default)(c,"BACKWARD_COMPATIBILITY_LABEL",null)},294:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(8416)),s=n(r(6690)),i=n(r(9728)),a=n(r(3930));function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){(0,o.default)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var l={GET:"GET",POST:"POST",PUT:"PUT",DELETE:"DELETE",PATCH:"PATCH"},f=function(){function e(t){(0,s.default)(this,e),this.app=t,this.Methods=l}return(0,i.default)(e,[{key:"send",value:function(e){a.default.verbose=!!this.app.debugMode,a.default.XMLHttpRequest=this.app.XMLHttpRequest;var t=e.method.toLowerCase(),r=e.headers||{},n=this.app.getCurrentUserToken();return n&&(r["user-token"]=n),e.queryString&&(e.url="".concat(e.url,"?").concat(e.queryString)),a.default[t](e.url,e.data).set(r).query(e.query).form(e.form)}},{key:"get",value:function(e){return this.send(c(c({},e),{},{method:l.GET}))}},{key:"post",value:function(e){return this.send(c(c({},e),{},{method:l.POST}))}},{key:"put",value:function(e){return this.send(c(c({},e),{},{method:l.PUT}))}},{key:"delete",value:function(e){return this.send(c(c({},e),{},{method:l.DELETE}))}}]),e}();t.default=f},5476:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o,s,i,a,u,c,l,f,p,d,h=n(r(861)),y=n(r(6690)),v=n(r(9728)),m=n(r(6115)),b=n(r(1588)),g=n(r(1655)),w=n(r(4993)),k=n(r(3808)),E=n(r(8416)),O=n(r(6877)),S=r(9181);function _(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function R(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_(Object(r),!0).forEach((function(t){(0,E.default)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function x(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,k.default)(e);if(t){var o=(0,k.default)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,w.default)(this,r)}}var j="CHANGES",T="CLEARED",P="INVOKE",C=(o=S.RTScopeConnector.connectionRequired(),s=S.RTScopeConnector.connectionRequired(),i=S.RTScopeConnector.connectionRequired(),a=S.RTScopeConnector.connectionRequired(),u=S.RTScopeConnector.connectionRequired(!0),c=S.RTScopeConnector.connectionRequired(!0),l=S.RTScopeConnector.connectionRequired(!0),f=S.RTScopeConnector.connectionRequired(!0),p=S.RTScopeConnector.connectionRequired(!0),d=function(e){(0,g.default)(r,e);var t=x(r);function r(e,n){var o;return(0,y.default)(this,r),o=t.call(this,e),(0,E.default)((0,m.default)(o),"onInvoke",(function(e){var t,r=e.method,n=e.args;A(o.invocationTarget,r),(t=o.invocationTarget)[r].apply(t,(0,h.default)(n))})),o.app=n,o.invocationTarget=null,o.connect(),o}return(0,v.default)(r,[{key:"connectSubscriber",get:function(){return this.app.RT.subscriptions.connectToRSO}},{key:"usersSubscriber",get:function(){return this.app.RT.subscriptions.onRSOUserStatus}},{key:"commandSubscriber",get:function(){return this.app.RT.subscriptions.onRSOCommand}},{key:"commandSender",get:function(){return this.app.RT.methods.sendRSOCommand}},{key:"setInvocationTarget",value:function(e){this.invocationTarget=e}},{key:"connect",value:function(){if(this.app)return(0,b.default)((0,k.default)(r.prototype),"connect",this).call(this)}},{key:"onConnect",value:function(){(0,b.default)((0,k.default)(r.prototype),"onConnect",this).apply(this,arguments),this.addSubscription(P,this.app.RT.subscriptions.onRSOInvoke,{callback:this.onInvoke})}},{key:"onDisconnect",value:function(){this.stopSubscription(P,{callback:this.onInvoke}),(0,b.default)((0,k.default)(r.prototype),"onDisconnect",this).apply(this,arguments)}},{key:"addChangesListener",value:function(e,t){this.addSubscription(j,this.app.RT.subscriptions.onRSOChanges,{callback:e,onError:t})}},{key:"removeChangesListeners",value:function(e){this.stopSubscription(j,{callback:e})}},{key:"addClearListener",value:function(e,t){this.addSubscription(T,this.app.RT.subscriptions.onRSOClear,{callback:e,onError:t})}},{key:"removeClearListeners",value:function(e){this.stopSubscription(T,{callback:e})}},{key:"addCommandListener",value:function(e,t){return(0,b.default)((0,k.default)(r.prototype),"addCommandListener",this).call(this,e,t),this}},{key:"removeCommandListener",value:function(e){return(0,b.default)((0,k.default)(r.prototype),"removeCommandListeners",this).call(this,e),this}},{key:"removeCommandListeners",value:function(e){return(0,b.default)((0,k.default)(r.prototype),"removeCommandListeners",this).call(this,e),this}},{key:"addUserStatusListener",value:function(e,t){return(0,b.default)((0,k.default)(r.prototype),"addUserStatusListener",this).call(this,e,t),this}},{key:"removeUserStatusListeners",value:function(e){return(0,b.default)((0,k.default)(r.prototype),"removeUserStatusListeners",this).call(this,e),this}},{key:"addConnectListener",value:function(e,t){return(0,b.default)((0,k.default)(r.prototype),"addConnectListener",this).call(this,e,t),this}},{key:"removeConnectListeners",value:function(e,t){return(0,b.default)((0,k.default)(r.prototype),"removeConnectListeners",this).call(this,e,t),this}},{key:"removeAllListeners",value:function(){return(0,b.default)((0,k.default)(r.prototype),"removeAllListeners",this).call(this),this}},{key:"get",value:function(e){return this.app.RT.methods.getRSO(R(R({},this.getScopeOptions()),{},{key:e}))}},{key:"set",value:function(e,t){return this.app.RT.methods.setRSO(R(R({},this.getScopeOptions()),{},{key:e,data:t}))}},{key:"clear",value:function(){return this.app.RT.methods.clearRSO(this.getScopeOptions())}},{key:"invoke",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return this.invokeOn.apply(this,[e,void 0].concat(r))}},{key:"invokeOn",value:function(e,t){for(var r=this,n=arguments.length,o=new Array(n>2?n-2:0),s=2;s<n;s++)o[s-2]=arguments[s];return Promise.resolve().then((function(){return A(r.invocationTarget,e)})).then((function(){return r.app.RT.methods.invokeRSOMethod(R(R({},r.getScopeOptions()),{},{method:e,targets:t,args:o}))}))}}]),r}(S.RTScopeConnector),(0,O.default)(d.prototype,"addChangesListener",[o],Object.getOwnPropertyDescriptor(d.prototype,"addChangesListener"),d.prototype),(0,O.default)(d.prototype,"removeChangesListeners",[s],Object.getOwnPropertyDescriptor(d.prototype,"removeChangesListeners"),d.prototype),(0,O.default)(d.prototype,"addClearListener",[i],Object.getOwnPropertyDescriptor(d.prototype,"addClearListener"),d.prototype),(0,O.default)(d.prototype,"removeClearListeners",[a],Object.getOwnPropertyDescriptor(d.prototype,"removeClearListeners"),d.prototype),(0,O.default)(d.prototype,"get",[u],Object.getOwnPropertyDescriptor(d.prototype,"get"),d.prototype),(0,O.default)(d.prototype,"set",[c],Object.getOwnPropertyDescriptor(d.prototype,"set"),d.prototype),(0,O.default)(d.prototype,"clear",[l],Object.getOwnPropertyDescriptor(d.prototype,"clear"),d.prototype),(0,O.default)(d.prototype,"invoke",[f],Object.getOwnPropertyDescriptor(d.prototype,"invoke"),d.prototype),(0,O.default)(d.prototype,"invokeOn",[p],Object.getOwnPropertyDescriptor(d.prototype,"invokeOn"),d.prototype),d);function A(e,t){if(!e)throw new Error('"invocationTarget" is not specified');if("function"!=typeof e[t])throw new Error('Method "'.concat(t,'" of invocationTarget is not function'))}t.default=C},7578:(e,t,r)=>{"use strict";var n=r(4836);t.Z=void 0;var o=n(r(6690)),s=n(r(9728)),i=n(r(5476)),a=function(){function e(t){(0,o.default)(this,e),this.app=t}return(0,s.default)(e,[{key:"connect",value:function(e){return new i.default({name:e},this.app)}}]),e}();t.Z=a},9181:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.RTScopeConnector=t.RTListeners=void 0;var o=n(r(4687)),s=n(r(7156)),i=n(r(6690)),a=n(r(9728)),u=n(r(1655)),c=n(r(4993)),l=n(r(3808)),f=n(r(3930)),p=n(r(5786)),d=n(r(9853));function h(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,l.default)(e);if(t){var o=(0,l.default)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,c.default)(this,r)}}var y=p.default.Listeners;t.RTListeners=y;var v=p.default.ScopeConnector;function m(e){return f.default.get("".concat(e,"/info"))}t.RTScopeConnector=v;var b=function(e){(0,u.default)(r,e);var t=h(r);function r(e){var n;(0,i.default)(this,r);var a,u=e.appId,c=e.apiKey,l=e.appPath,f=e.debugMode,p=d.default.uuid(),h="".concat(l,"/rt/lookup");return(n=t.call(this,{appId:u||void 0,lookupPath:h,debugMode:f,connectQuery:function(){var t=e.getCurrentUserToken();return{apiKey:c||void 0,clientId:p,userToken:t}},socketConfigTransform:(a=(0,s.default)(o.default.mark((function e(t){var r;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u){e.next=7;break}return e.next=3,m(l);case 3:r=e.sent,t.url="".concat(t.host,"/").concat(r.appId),t.options.path="/".concat(r.appId),t.options.query.apiKey=r.apiKey;case 7:return e.abrupt("return",t);case 8:case"end":return e.stop()}}),e)}))),function(e){return a.apply(this,arguments)})})).app=e,n}return(0,a.default)(r,[{key:"updateUserTokenIfNeeded",value:function(){if(this.session){var e=this.app.getCurrentUserToken();this.methods.setUserToken({userToken:e})}}},{key:"setDebugMode",value:function(e){this.setConfig({debugMode:e})}}]),r}(p.default);t.default=b},4172:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OperationType=t.IsolationLevelEnum=void 0;t.OperationType={CREATE:"CREATE",CREATE_BULK:"CREATE_BULK",UPDATE:"UPDATE",UPDATE_BULK:"UPDATE_BULK",DELETE:"DELETE",DELETE_BULK:"DELETE_BULK",UPSERT:"UPSERT",UPSERT_BULK:"UPSERT_BULK",FIND:"FIND",ADD_RELATION:"ADD_RELATION",SET_RELATION:"SET_RELATION",DELETE_RELATION:"DELETE_RELATION"};t.IsolationLevelEnum={READ_UNCOMMITTED:"READ_UNCOMMITTED",READ_COMMITTED:"READ_COMMITTED",REPEATABLE_READ:"REPEATABLE_READ",SERIALIZABLE:"SERIALIZABLE"}},7890:(e,t,r)=>{"use strict";var n=r(4836);t.Z=function(e){return function(t){(0,f.default)(n,t);var r=S(n);function n(t){return(0,c.default)(this,n),r.call(this,t,e)}return(0,l.default)(n,null,[{key:"initFromJSON",value:function(e){var t=new this(e.transactionIsolation);return e.operations.forEach((function(e){b.OperationJSONAdapter[e.operationType](t,e).setOpResultId(e.opResultId)})),t}}]),n}(x)};var o=n(r(4687)),s=n(r(8698)),i=n(r(7156)),a=n(r(215)),u=n(r(8416)),c=n(r(6690)),l=n(r(9728)),f=n(r(1655)),p=n(r(4993)),d=n(r(3808)),h=n(r(3496)),y=n(r(9853)),v=n(r(3082)),m=r(4172),b=r(5561),g=r(3687),w=r(3106),k=["meta"];function E(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function O(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?E(Object(r),!0).forEach((function(t){(0,u.default)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):E(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function S(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,d.default)(e);if(t){var o=(0,d.default)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,p.default)(this,r)}}var _=function(e){(0,f.default)(r,e);var t=S(r);function r(e,n){var o;return(0,c.default)(this,r),(o=t.call(this,e)).operation=n,o}return(0,l.default)(r,[{key:"toJSON",value:function(){return{message:this.message,operation:this.operation}}}]),r}((0,h.default)(Error)),R=function(){function e(t){var r=t.success,n=t.error,o=t.results;(0,c.default)(this,e),this.success=r,this.error=n,this.results=o}return(0,l.default)(e,[{key:"isSuccess",value:function(){return this.success}},{key:"getError",value:function(){return this.error}},{key:"getResults",value:function(){return this.results}}]),e}(),x=function(){function e(t,r){(0,c.default)(this,e),this.app=r,this.payload={isolationLevelEnum:t,operations:[]},this.usedOpIds={}}var t;return(0,l.default)(e,[{key:"getOpResultById",value:function(e){return this.payload.operations.find((function(t){return t.meta.opResult.getOpResultId()===e})).meta.opResult}},{key:"setIsolationLevel",value:function(e){this.payload.isolationLevelEnum=e}},{key:"getOpStackName",value:function(e,t){return"".concat(e.toLowerCase()).concat(t)}},{key:"getNextOpResultIndex",value:function(e){return this.usedOpIds[e]||(this.usedOpIds[e]=0),++this.usedOpIds[e]}},{key:"addOperations",value:function(e,t,r){Array.isArray(r)?r=r.map((function(e){return delete e.___jsonclass,e})):delete r.___jsonclass;var n=new g.OpResult(this,{operationType:e,table:t,payload:r});return this.payload.operations.push({operationType:e,table:t,payload:r,meta:{opResult:n}}),n}},{key:"composePayload",value:function(){return O(O({},this.payload),{},{operations:this.payload.operations.map((function(e){var t=e.meta;return O(O({},(0,a.default)(e,k)),{},{opResultId:t.opResult.getOpResultId()})}))})}},{key:"execute",value:(t=(0,i.default)(o.default.mark((function e(){var t;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.app.request.post({url:this.app.urls.transactions(),data:this.composePayload()});case 2:return t=e.sent,e.abrupt("return",this.setResult(t));case 4:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"setResult",value:function(e){if(e.results&&this.payload.operations.forEach((function(t){var r=t.meta.opResult.getOpResultId();e.results[r]&&t.meta.opResult.setResult(e.results[r].result)})),e.error){var t=this.payload.operations.find((function(t){return e.error.operation.opResultId===t.meta.opResult.getOpResultId()}));e.error=new _(e.error.message,t.meta.opResult),t.meta.opResult.setError(e.error)}return new R(e)}},{key:"find",value:function(e,t){var r=t instanceof v.default?t.toJSON():t||{};if(!e||"string"!=typeof e)throw new Error("Invalid arguments");if("object"!==(0,s.default)(r)||Array.isArray(r))throw new Error("Invalid arguments");var n={queryOptions:{}};return r.pageSize>0&&(n.pageSize=r.pageSize),r.offset>0&&(n.offset=r.offset),r.properties&&(n.properties=r.properties),r.excludeProps&&(n.excludeProps=r.excludeProps),r.excludeProps&&(n.excludeProps=r.excludeProps),r.where&&(n.whereClause=r.where),r.having&&(n.havingClause=r.having),r.groupBy&&(n.groupBy=r.groupBy),r.sortBy&&(n.queryOptions.sortBy=r.sortBy),r.relations&&(n.queryOptions.related=r.relations),r.relationsDepth&&(n.queryOptions.relationsDepth=r.relationsDepth),r.relationsPageSize>0&&(n.queryOptions.relationsPageSize=r.relationsPageSize),this.addOperations(m.OperationType.FIND,e,n)}},{key:"upsert",value:function(){var e,t;if(1===arguments.length)e=y.default.getClassName(arguments.length<=0?void 0:arguments[0]),t=arguments.length<=0?void 0:arguments[0];else{if(2!==arguments.length)throw new Error("Invalid arguments");e=arguments.length<=0?void 0:arguments[0],t=arguments.length<=1?void 0:arguments[1]}if(!e||"string"!=typeof e)throw new Error("Invalid arguments");if(!t||"object"!==(0,s.default)(t)||Array.isArray(t))throw new Error("Invalid arguments");return this.addOperations(m.OperationType.UPSERT,e,t)}},{key:"create",value:function(){var e,t;if(1===arguments.length)e=y.default.getClassName(arguments.length<=0?void 0:arguments[0]),t=arguments.length<=0?void 0:arguments[0];else{if(2!==arguments.length)throw new Error("Invalid arguments");e=arguments.length<=0?void 0:arguments[0],t=arguments.length<=1?void 0:arguments[1]}if(!e||"string"!=typeof e)throw new Error("Invalid arguments");if(!t||"object"!==(0,s.default)(t)||Array.isArray(t))throw new Error("Invalid arguments");return this.addOperations(m.OperationType.CREATE,e,t)}},{key:"update",value:function(){for(var e,t,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];if(1===n.length)e=y.default.getClassName(n[0]),t=n[0];else if(2===n.length&&"string"==typeof n[0])e=n[0],t=n[1];else{if(!(n[0]instanceof g.OpResult||n[0]instanceof w.OpResultValueReference))throw new Error("Invalid arguments");if(e=n[0].getTableName(),t={objectId:n[0]},3===n.length&&"string"==typeof n[1])t[n[1]]=n[2];else{if(2!==n.length)throw new Error("Invalid arguments");t=O(O({},t),n[1])}}if(!e||"string"!=typeof e)throw new Error("Invalid arguments");return this.addOperations(m.OperationType.UPDATE,e,t)}},{key:"delete",value:function(){for(var e,t,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];if(1===n.length)n[0]instanceof g.OpResult||n[0]instanceof w.OpResultValueReference?(e=n[0].getTableName(),t=n[0]):n[0]&&"object"===(0,s.default)(n[0])&&!Array.isArray(n[0])&&(e=y.default.getClassName(n[0]),t=n[0].objectId);else{if(2!==n.length)throw new Error("Invalid arguments");e=n[0],t=n[1]&&n[1].objectId||n[1]}if(!t||Array.isArray(t)||"string"!=typeof t&&"object"!==(0,s.default)(t))throw new Error("Invalid arguments");if(!e||"string"!=typeof e)throw new Error("Table Name must be a string.");return this.addOperations(m.OperationType.DELETE,e,t)}},{key:"bulkUpsert",value:function(e,t){if(Array.isArray(e)&&(t=e,e=y.default.getClassName(t[0])),!t||!Array.isArray(t))throw new Error("Objects must be an array of objects.");if(!e||"string"!=typeof e)throw new Error("Table Name must be a string.");return this.addOperations(m.OperationType.UPSERT_BULK,e,t)}},{key:"bulkCreate",value:function(e,t){if(Array.isArray(e)&&(t=e,e=y.default.getClassName(t[0])),!t||!Array.isArray(t))throw new Error("Objects must be an array of objects.");if(!e||"string"!=typeof e)throw new Error("Table Name must be a string.");return this.addOperations(m.OperationType.CREATE_BULK,e,t)}},{key:"bulkUpdate",value:function(){for(var e,t={},r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];if(2===n.length)t.changes=n[1],"string"==typeof n[0]?(e=y.default.getClassName(n[1]),t.conditional=n[0]):n[0]instanceof g.OpResult&&(e=n[0].getTableName(),t.unconditional=n[0]);else{if(3!==n.length)throw new Error("Invalid arguments");if(e=n[0],t.changes=n[2],"string"==typeof n[1])t.conditional=n[1];else{if(!Array.isArray(n[1]))throw new Error("Invalid arguments");t.unconditional=n[1].map((function(e){return e.objectId||e}))}}if(!e||"string"!=typeof e)throw new Error("Table Name must be a string.");return this.addOperations(m.OperationType.UPDATE_BULK,e,t)}},{key:"bulkDelete",value:function(){for(var e,t={},r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];if(1===n.length)if(n[0]instanceof g.OpResult)e=n[0].getTableName(),t.unconditional=n[0];else{if(!Array.isArray(n[0]))throw new Error("Invalid arguments");e=y.default.getClassName(n[0][0]),t.unconditional=n[0].map((function(e){return e.objectId}))}else{if(2!==n.length)throw new Error("Invalid arguments");if(e=n[0],"string"==typeof n[1])t.conditional=n[1];else{if(!Array.isArray(n[1]))throw new Error("Invalid arguments");t.unconditional=n[1].map((function(e){return e.objectId||e}))}}if(!e||"string"!=typeof e)throw new Error("Table Name must be a string.");return this.addOperations(m.OperationType.DELETE_BULK,e,t)}},{key:"addToRelation",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.relationsOperation(m.OperationType.ADD_RELATION,t)}},{key:"setRelation",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.relationsOperation(m.OperationType.SET_RELATION,t)}},{key:"deleteRelation",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.relationsOperation(m.OperationType.DELETE_RELATION,t)}},{key:"relationsOperation",value:function(e,t){var r,n,o,i,a,u;if(3===t.length)if(o=t[0],n=t[1],u=t[2],o instanceof g.OpResult||o instanceof w.OpResultValueReference)r=o.getTableName();else{if(!o||"object"!==(0,s.default)(o))throw new Error("Invalid the first argument, it must be an instance of [OpResult|OpResultValueReference|Object]");r=y.default.getClassName(o)}else{if(4!==t.length)throw new Error("Invalid arguments");if(r=t[0],n=t[2],u=t[3],"string"==typeof t[1])o=t[1];else{if(!t[1]||"object"!==(0,s.default)(t[1]))throw new Error("Invalid the second argument, it must be an Object or objectId");o=t[1]}}if(o&&o.objectId&&(o=o.objectId),"string"==typeof u?i=u:u instanceof g.OpResult&&u.isCollectionRef()?a=u:(Array.isArray(u)||(u=[u]),a=u.map((function(e){if(e){if(e instanceof g.OpResult||e instanceof w.OpResultValueReference)return e;if("string"==typeof e)return e;if(e.objectId)return e.objectId}throw new Error("Invalid child argument, it must be an instance of [OpResult|OpResultValueReference|Object] or objectId")}))),!n||"string"!=typeof n)throw new Error('Invalid "relationColumn" parameter, check passed arguments');if(!a&&!i)throw new Error('Neither "unconditional" nor "conditional" parameter is specified, check passed arguments');if(!r||"string"!=typeof r)throw new Error("Table Name must be a string.");var c={parentObject:o,relationColumn:n};return i?c.conditional=i:c.unconditional=a,this.addOperations(e,r,c)}}]),e}();(0,u.default)(x,"IsolationLevelEnum",m.IsolationLevelEnum),(0,u.default)(x,"OpResult",g.OpResult),(0,u.default)(x,"OpResultValueReference",w.OpResultValueReference)},5561:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.OperationJSONAdapter=void 0;var o=n(r(8698)),s=r(4172),i=r(3687);function a(e,t){if(Array.isArray(t))return t.map((function(t){return a(e,t)}));if(t&&"object"===(0,o.default)(t)){if(t.___ref){var r=e.getOpResultById(t.opResultId);return void 0!==t.resultIndex?r.resolveTo(t.resultIndex,t.propName):void 0!==t.propName?r.resolveTo(t.propName):r}var n={};for(var s in t)n[s]=a(e,t[s]);return n}return t}var u={CREATE:function(e,t){var r=t.table,n=t.payload;return e.create.call(e,r,a(e,n))},DELETE:function(e,t){var r=t.table,n=t.payload;return e.delete.call(e,r,a(e,n))},UPDATE:function(e,t){var r=t.table,n=t.payload;return e.update.call(e,r,a(e,n))},UPSERT:function(e,t){var r=t.table,n=t.payload;return e.upsert.call(e,r,a(e,n))},UPDATE_BULK:function(e,t){var r=t.table,n=t.payload,o=c(e,{table:r,payload:n});return o.push(a(e,n.changes)),e.bulkUpdate.apply(e,o)},DELETE_BULK:function(e,t){var r=c(e,{table:t.table,payload:t.payload});return e.bulkDelete.apply(e,r)},CREATE_BULK:function(e,t){var r=t.table,n=t.payload;return e.bulkCreate.call(e,r,a(e,n))},UPSERT_BULK:function(e,t){var r=t.table,n=t.payload;return e.bulkUpsert.call(e,r,a(e,n))},SET_RELATION:function(e,t){return l(e,"setRelation",{table:t.table,payload:t.payload})},DELETE_RELATION:function(e,t){return l(e,"deleteRelation",{table:t.table,payload:t.payload})},ADD_RELATION:function(e,t){return l(e,"addToRelation",{table:t.table,payload:t.payload})},FIND:function(e,t){var r=t.table,n=t.payload;return e.addOperations(s.OperationType.FIND,r,n)}};function c(e,t){var r=t.table,n=t.payload,o=[];if(n.conditional)o.push(r),o.push(n.conditional);else{var s=a(e,n.unconditional);s instanceof i.OpResult||o.push(r),o.push(s)}return o}function l(e,t,r){var n=r.table,o=r.payload,s=[n];return"string"==typeof o.parentObject?s.push({objectId:o.parentObject}):s.push(a(e,o.parentObject)),s.push(o.relationColumn),s.push(o.conditional||a(e,o.unconditional)),e[t].apply(e,s)}t.OperationJSONAdapter=u},3106:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.OpResultValueReference=void 0;var o=n(r(6690)),s=n(r(9728)),i=function(){function e(t,r){var n=r.resultIndex,s=r.propName;(0,o.default)(this,e),this.opResult=t,this.resultIndex=n,this.propName=s}return(0,s.default)(e,[{key:"getTableName",value:function(){return this.opResult.getTableName()}},{key:"toJSON",value:function(){var e=this.opResult.toJSON();return void 0!==this.resultIndex&&(e.resultIndex=this.resultIndex),void 0!==this.propName&&(e.propName=this.propName),!e.propName&&this.opResult.isFindRef()&&(e.propName="objectId"),e}}]),e}();t.OpResultValueReference=i},3687:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.OpResult=void 0;var o=n(r(6690)),s=n(r(9728)),i=r(4172),a=r(3106),u=function(){function e(t,r){var n=r.operationType,s=r.table,i=r.payload;(0,o.default)(this,e),this.uow=t,this.operationType=n,this.table=s,this.payload=i;var a=this.uow.getOpStackName(n,s),u=this.uow.getNextOpResultIndex(a);this.opResultId="".concat(a).concat(u),this.result=null}return(0,s.default)(e,[{key:"setResult",value:function(e){this.result=e}},{key:"getResult",value:function(){return this.result}},{key:"setError",value:function(e){this.error=e}},{key:"getError",value:function(){return this.error}},{key:"getType",value:function(){return this.operationType}},{key:"isFindRef",value:function(){return this.operationType===i.OperationType.FIND}},{key:"isCollectionRef",value:function(){return this.operationType===i.OperationType.FIND||this.operationType===i.OperationType.CREATE_BULK}},{key:"isObjectRef",value:function(){return this.operationType===i.OperationType.CREATE||this.operationType===i.OperationType.UPDATE}},{key:"setOpResultId",value:function(e){return this.opResultId=e,this}},{key:"getOpResultId",value:function(){return this.opResultId}},{key:"getTableName",value:function(){return this.table}},{key:"resolveTo",value:function(e,t){return"string"==typeof e&&(t=e,e=void 0),new a.OpResultValueReference(this,{resultIndex:e,propName:t})}},{key:"toJSON",value:function(){var e={___ref:!0,opResultId:this.opResultId};return this.isObjectRef()&&(e.propName="objectId"),e}}]),e}();t.OpResult=u},435:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(6690)),s=n(r(9728)),i=function(){function e(t){(0,o.default)(this,e),this.app=t}return(0,s.default)(e,[{key:"root",value:function(){return this.app.appPath}},{key:"automation",value:function(){return"".concat(this.root(),"/automation")}},{key:"automationFlow",value:function(){return"".concat(this.automation(),"/flow")}},{key:"automationFlowTrigger",value:function(){return"".concat(this.automationFlow(),"/trigger")}},{key:"blServices",value:function(){return"".concat(this.root(),"/services")}},{key:"blServiceMethod",value:function(e,t){return"".concat(this.blServices(),"/").concat(e,"/").concat(t)}},{key:"blEvent",value:function(e){return"".concat(this.root(),"/servercode/events/").concat(e)}},{key:"logging",value:function(){return"".concat(this.root(),"/log")}},{key:"loggingLevels",value:function(){return"".concat(this.logging(),"/logger")}},{key:"cache",value:function(){return"".concat(this.root(),"/cache")}},{key:"cacheItem",value:function(e){return"".concat(this.cache(),"/").concat(e)}},{key:"cacheItemExpireIn",value:function(e){return"".concat(this.cacheItem(e),"/expireIn")}},{key:"cacheItemExpireAt",value:function(e){return"".concat(this.cacheItem(e),"/expireAt")}},{key:"cacheItemCheck",value:function(e){return"".concat(this.cacheItem(e),"/check")}},{key:"counters",value:function(){return"".concat(this.root(),"/counters")}},{key:"countersList",value:function(e){return"".concat(this.counters(),"/").concat(e||"*","/list")}},{key:"counter",value:function(e){return"".concat(this.counters(),"/").concat(e)}},{key:"counterAddAndGet",value:function(e){return"".concat(this.counter(e),"/incrementby/get")}},{key:"counterGetAndAdd",value:function(e){return"".concat(this.counter(e),"/get/incrementby")}},{key:"counterIncrementAndGet",value:function(e){return"".concat(this.counter(e),"/increment/get")}},{key:"counterDecrementAndGet",value:function(e){return"".concat(this.counter(e),"/decrement/get")}},{key:"counterGetAndDecrement",value:function(e){return"".concat(this.counter(e),"/get/decrement")}},{key:"counterGetAndIncrement",value:function(e){return"".concat(this.counter(e),"/get/increment")}},{key:"counterCompareAndSet",value:function(e){return"".concat(this.counter(e),"/get/compareandset")}},{key:"counterReset",value:function(e){return"".concat(this.counter(e),"/reset")}},{key:"data",value:function(){return"".concat(this.root(),"/data")}},{key:"dataGrouping",value:function(e){return"".concat(this.data(),"/data-grouping/").concat(e)}},{key:"dataTable",value:function(e){return"".concat(this.data(),"/").concat(e)}},{key:"dataTableUpsert",value:function(e){return"".concat(this.data(),"/").concat(e,"/upsert")}},{key:"dataTableDeepSave",value:function(e){return"".concat(this.data(),"/").concat(e,"/deep-save")}},{key:"dataTableFind",value:function(e){return"".concat(this.dataTable(e),"/find")}},{key:"dataTablePrimaryKey",value:function(e){return"".concat(this.dataTable(e),"/pk")}},{key:"dataTableObject",value:function(e,t){return"".concat(this.dataTable(e),"/").concat(encodeURIComponent(t))}},{key:"dataTableObjectRelation",value:function(e,t,r){return"".concat(this.dataTableObject(e,t),"/").concat(r)}},{key:"dataTableCount",value:function(e){return"".concat(this.dataTable(e),"/count")}},{key:"dataTableProps",value:function(e){return"".concat(this.dataTable(e),"/properties")}},{key:"dataBulkTable",value:function(e){return"".concat(this.data(),"/bulk/").concat(e)}},{key:"dataBulkTableUpsert",value:function(e){return"".concat(this.data(),"/bulkupsert/").concat(e)}},{key:"dataBulkTableDelete",value:function(e){return"".concat(this.dataBulkTable(e),"/delete")}},{key:"dataObjectPermission",value:function(e,t,r){return"".concat(this.dataTable(e),"/permissions/").concat(t,"/").concat(r)}},{key:"dataTableNameById",value:function(e){return"".concat(this.data(),"/").concat(e,"/table-name")}},{key:"transactions",value:function(){return"".concat(this.root(),"/transaction/unit-of-work")}},{key:"dataHives",value:function(){return"".concat(this.root(),"/hive")}},{key:"dataHive",value:function(e){return"".concat(this.dataHives(),"/").concat(e)}},{key:"hiveStore",value:function(e,t){return"".concat(this.dataHive(e),"/").concat(t)}},{key:"messaging",value:function(){return"".concat(this.root(),"/messaging")}},{key:"messagingPush",value:function(){return"".concat(this.messaging(),"/push")}},{key:"messagingPushTemplates",value:function(e){return"".concat(this.messaging(),"/pushtemplates/").concat(e)}},{key:"messagingPushWithTemplate",value:function(e){return"".concat(this.messagingPush(),"/").concat(e)}},{key:"messagingEmail",value:function(){return"".concat(this.messaging(),"/email")}},{key:"messagingChannel",value:function(e){return"".concat(this.messaging(),"/").concat(e)}},{key:"messagingMessage",value:function(e){return"".concat(this.messaging(),"/").concat(e)}},{key:"messagingRegistrations",value:function(){return"".concat(this.messaging(),"/registrations")}},{key:"messagingRegistrationDevice",value:function(e){return"".concat(this.messagingRegistrations(),"/").concat(e)}},{key:"emailTemplate",value:function(){return"".concat(this.root(),"/emailtemplate")}},{key:"emailTemplateSend",value:function(){return"".concat(this.emailTemplate(),"/send")}},{key:"commerce",value:function(){return"".concat(this.root(),"/commerce/googleplay")}},{key:"commerceValidate",value:function(e,t,r){return"".concat(this.commerce(),"/validate/").concat(e,"/inapp/").concat(t,"/purchases/").concat(r)}},{key:"commerceSubCancel",value:function(e,t,r){return"".concat(this.commerce(),"/").concat(e,"/subscription/").concat(t,"/purchases/").concat(r,"/cancel")}},{key:"commerceSubStatus",value:function(e,t,r){return"".concat(this.commerce(),"/").concat(e,"/subscription/").concat(t,"/purchases/").concat(r)}},{key:"files",value:function(){return"".concat(this.root(),"/files")}},{key:"filePath",value:function(e){return"".concat(this.files(),"/").concat(e)}},{key:"directoryPath",value:function(e){return"".concat(this.files(),"/").concat(e,"/")}},{key:"fileCopy",value:function(){return"".concat(this.files(),"/copy")}},{key:"fileMove",value:function(){return"".concat(this.files(),"/move")}},{key:"fileRename",value:function(){return"".concat(this.files(),"/rename")}},{key:"filePermissions",value:function(){return"".concat(this.files(),"/permissions")}},{key:"filePermission",value:function(e,t){return"".concat(this.filePermissions(),"/").concat(e,"/").concat(encodeURIComponent(t))}},{key:"fileBinaryPath",value:function(e){return"".concat(this.files(),"/binary/").concat(e)}},{key:"fileAppendPath",value:function(e){return"".concat(this.files(),"/append/").concat(e)}},{key:"fileAppendBinaryPath",value:function(e){return"".concat(this.files(),"/append/binary/").concat(e)}},{key:"users",value:function(){return"".concat(this.root(),"/users")}},{key:"userObject",value:function(e){return"".concat(this.users(),"/").concat(e)}},{key:"userRegister",value:function(){return"".concat(this.users(),"/register")}},{key:"userLogin",value:function(){return"".concat(this.users(),"/login")}},{key:"userLogout",value:function(){return"".concat(this.users(),"/logout")}},{key:"userRoles",value:function(e){return"".concat(this.users(),"/userroles").concat(e?"/".concat(e):"")}},{key:"usersRole",value:function(e){return"".concat(this.users(),"/role/").concat(e)}},{key:"userRoleOperation",value:function(e){return"".concat(this.users(),"/").concat(e)}},{key:"userClassProps",value:function(){return"".concat(this.users(),"/userclassprops")}},{key:"userRestorePassword",value:function(e){return"".concat(this.users(),"/restorepassword/").concat(encodeURIComponent(e))}},{key:"userTokenCheck",value:function(e){return"".concat(this.users(),"/isvalidusertoken/").concat(e)}},{key:"userVerifyPassowrd",value:function(){return"".concat(this.users(),"/verifypassowrd")}},{key:"userResendConfirmation",value:function(e){return"".concat(this.users(),"/resendconfirmation/").concat(e)}},{key:"userCreateConfirmationURL",value:function(e){return"".concat(this.users(),"/createEmailConfirmationURL/").concat(e)}},{key:"userSocial",value:function(){return"".concat(this.users(),"/social")}},{key:"userSocialOAuth",value:function(e){return"".concat(this.userSocial(),"/oauth/").concat(e.toLowerCase(),"/request_url")}},{key:"userSocialLogin",value:function(e){return"".concat(this.userSocial(),"/").concat(e.toLowerCase(),"/sdk/login")}},{key:"userOAuthLogin",value:function(e){return"".concat(this.userSocial(),"/").concat(e.toLowerCase(),"/login")}},{key:"userAuthorizationURL",value:function(e){return"".concat(this.users(),"/oauth/").concat(e.toLowerCase(),"/request_url")}},{key:"guestLogin",value:function(){return"".concat(this.users(),"/register/guest")}},{key:"userStatus",value:function(e){return"".concat(this.userObject(e),"/status")}},{key:"management",value:function(){return"".concat(this.root(),"/management")}},{key:"managementData",value:function(){return"".concat(this.management(),"/data")}},{key:"managementDataTable",value:function(){return"".concat(this.managementData(),"/table")}}]),e}();t.default=i},9935:(e,t,r)=>{"use strict";var n=r(4836);t.i=function(){var e="NodeJS";o.default.isBrowser&&(e=navigator.userAgent?navigator.userAgent.toLowerCase():"hybrid-app");var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[],r={browser:t[1]||"",version:t[2]||"0"},n={};r.browser&&(n[r.browser]=!0,n.version=r.version);return n};var o=n(r(9853))},9681:(e,t,r)=>{"use strict";var n=r(4836);t.Z=void 0;var o=n(r(4687)),s=n(r(8416)),i=n(r(7156)),a=n(r(6690)),u=n(r(9728)),c=r(9211),l=n(r(5602)),f=n(r(8332)),p=n(r(1571));function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function h(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach((function(t){(0,s.default)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var y=function(){function e(t){(0,a.default)(this,e),this.app=t,this.roles=new f.default(this),this.social=new p.default(this),this.dataStore=this.app.Data.of(l.default)}var t,r,n,s,d,y,v,m,b,g,w,k,E,O,S,_,R,x,j,T,P,C,A,N,L,I;return(0,u.default)(e,[{key:"Utils",get:function(){return c.UsersUtils}},{key:"register",value:(I=(0,i.default)(o.default.mark((function e(t){var r,n=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(t=h({},t)).blUserLocale||(r=this.Utils.getClientUserLocale())&&(t.blUserLocale=r),e.abrupt("return",this.app.request.post({url:this.app.urls.userRegister(),data:t}).then((function(e){return n.dataStore.parseResponse(e)})));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return I.apply(this,arguments)})},{key:"login",value:(L=(0,i.default)(o.default.mark((function e(t,r,n){var s,i=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s={},"string"==typeof t||"number"==typeof t){e.next=3;break}throw new Error("the first argument must be either a string or a number");case 3:if(t){e.next=5;break}throw new Error("the first argument cannot be an empty value");case 5:if("boolean"==typeof r&&(n=r,r=void 0),"string"!=typeof t||void 0!==r){e.next=10;break}s.objectId=t,e.next=14;break;case 10:if(r){e.next=12;break}throw new Error('the "password" value cannot be an empty value');case 12:s.login=t,s.password=r;case 14:return n=!0===n,e.abrupt("return",this.app.request.post({url:this.app.urls.userLogin(),data:s}).then((function(e){return i.setCurrentUser(e,n)})));case 16:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return L.apply(this,arguments)})},{key:"loginAsGuest",value:(N=(0,i.default)(o.default.mark((function e(t){var r=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=!0===t,e.abrupt("return",this.app.request.post({url:this.app.urls.guestLogin()}).then((function(e){return r.setCurrentUser(e,t)})));case 2:case"end":return e.stop()}}),e,this)}))),function(e){return N.apply(this,arguments)})},{key:"loginWithFacebook",value:(A=(0,i.default)(o.default.mark((function e(t,r,n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.social.loginWithFacebook(t,r,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return A.apply(this,arguments)})},{key:"loginWithFacebookSdk",value:(C=(0,i.default)(o.default.mark((function e(t,r,n,s){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.social.loginWithFacebookSdk(t,r,n,s));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n){return C.apply(this,arguments)})},{key:"loginWithGooglePlus",value:(P=(0,i.default)(o.default.mark((function e(t,r,n,s){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.social.loginWithGooglePlus(t,r,n,s));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n){return P.apply(this,arguments)})},{key:"loginWithGooglePlusSdk",value:(T=(0,i.default)(o.default.mark((function e(t,r,n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.social.loginWithGooglePlusSdk(t,r,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return T.apply(this,arguments)})},{key:"loginWithTwitter",value:(j=(0,i.default)(o.default.mark((function e(t,r){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.social.loginWithTwitter(t,r));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return j.apply(this,arguments)})},{key:"loginWithOauth2",value:(x=(0,i.default)(o.default.mark((function e(t,r,n,s,i){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.social.loginWithOauth2(t,r,n,s,i));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n,o){return x.apply(this,arguments)})},{key:"loginWithOauth1",value:(R=(0,i.default)(o.default.mark((function e(t,r,n,s,i,a){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.social.loginWithOauth1(t,r,n,s,i,a));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n,o,s){return R.apply(this,arguments)})},{key:"logout",value:(_=(0,i.default)(o.default.mark((function e(){var t=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.app.request.get({url:this.app.urls.userLogout()}).then((function(){t.setCurrentUser(null)})).catch((function(e){throw[3023,3064,3090,3091].includes(e.code)&&t.setCurrentUser(null),e})));case 1:case"end":return e.stop()}}),e,this)}))),function(){return _.apply(this,arguments)})},{key:"getCurrentUser",value:(S=(0,i.default)(o.default.mark((function e(t){var r,n=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.currentUser||t){e.next=2;break}return e.abrupt("return",this.currentUser);case 2:if(!this.currentUserRequest){e.next=4;break}return e.abrupt("return",this.currentUserRequest);case 4:if(!(r=this.getCurrentUserId())){e.next=7;break}return e.abrupt("return",this.currentUserRequest=this.dataStore.findById(r).then((function(e){return n.currentUserRequest=null,e["user-token"]=n.currentUser&&n.currentUser["user-token"]||void 0,n.currentUser=e})).catch((function(e){throw n.currentUserRequest=null,e})));case 7:return e.abrupt("return",null);case 8:case"end":return e.stop()}}),e,this)}))),function(e){return S.apply(this,arguments)})},{key:"setCurrentUser",value:function(e,t){return this.app.LocalCache.remove(this.app.LocalCache.Keys.USER_TOKEN),this.app.LocalCache.remove(this.app.LocalCache.Keys.CURRENT_USER_ID),this.app.LocalCache.remove(this.app.LocalCache.Keys.STAY_LOGGED_IN),this.currentUser=e||null,this.currentUser&&(this.currentUser instanceof l.default||(this.currentUser=this.dataStore.parseResponse(this.currentUser)),t&&(this.app.LocalCache.set(this.app.LocalCache.Keys.STAY_LOGGED_IN,!0),this.app.LocalCache.set(this.app.LocalCache.Keys.USER_TOKEN,this.currentUser["user-token"]),this.app.LocalCache.set(this.app.LocalCache.Keys.CURRENT_USER_ID,this.currentUser.objectId))),this.app.__RT&&this.app.RT.updateUserTokenIfNeeded(),this.currentUser}},{key:"isValidLogin",value:(O=(0,i.default)(o.default.mark((function e(){var t;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t=this.getCurrentUserToken())){e.next=3;break}return e.abrupt("return",this.app.request.get({url:this.app.urls.userTokenCheck(t)}));case 3:return e.abrupt("return",!1);case 4:case"end":return e.stop()}}),e,this)}))),function(){return O.apply(this,arguments)})},{key:"verifyPassword",value:(E=(0,i.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Password has to be a non empty string");case 2:if(this.getCurrentUserToken()){e.next=4;break}throw new Error("In order to check password you have to be logged in");case 4:return e.abrupt("return",this.app.request.post({url:this.app.urls.userVerifyPassowrd(),data:{password:t}}).then((function(e){return!(!e||!e.valid)})));case 5:case"end":return e.stop()}}),e,this)}))),function(e){return E.apply(this,arguments)})},{key:"restorePassword",value:(k=(0,i.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Email Address must be provided and must be a string.");case 2:return e.abrupt("return",this.app.request.get({url:this.app.urls.userRestorePassword(t)}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return k.apply(this,arguments)})},{key:"resendEmailConfirmation",value:(w=(0,i.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("string"!=typeof t){e.next=5;break}if(t){e.next=3;break}throw new Error("Identity can not be an empty string.");case 3:e.next=7;break;case 5:if("number"==typeof t){e.next=7;break}throw new Error("Identity must be a string or number.");case 7:return e.abrupt("return",this.app.request.post({url:this.app.urls.userResendConfirmation(t)}));case 8:case"end":return e.stop()}}),e,this)}))),function(e){return w.apply(this,arguments)})},{key:"createEmailConfirmationURL",value:(g=(0,i.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("string"!=typeof t){e.next=5;break}if(t){e.next=3;break}throw new Error("Identity can not be an empty string.");case 3:e.next=7;break;case 5:if("number"==typeof t){e.next=7;break}throw new Error("Identity must be a string or number.");case 7:return e.abrupt("return",this.app.request.post({url:this.app.urls.userCreateConfirmationURL(t)}));case 8:case"end":return e.stop()}}),e,this)}))),function(e){return g.apply(this,arguments)})},{key:"update",value:(b=(0,i.default)(o.default.mark((function e(t){var r=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.app.request.put({url:this.app.urls.userObject(t.objectId),data:t}).then((function(e){return r.dataStore.parseResponse(e)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return b.apply(this,arguments)})},{key:"findByRole",value:(m=(0,i.default)(o.default.mark((function e(t,r,n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.roles.findByRole(t,r,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return m.apply(this,arguments)})},{key:"getUserRoles",value:(v=(0,i.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.roles.getUserRoles(t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return v.apply(this,arguments)})},{key:"assignRole",value:(y=(0,i.default)(o.default.mark((function e(t,r){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.roles.assignRole(t,r));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return y.apply(this,arguments)})},{key:"unassignRole",value:(d=(0,i.default)(o.default.mark((function e(t,r){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.roles.unassignRole(t,r));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)})},{key:"describeUserClass",value:(s=(0,i.default)(o.default.mark((function e(){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.app.request.get({url:this.app.urls.userClassProps()}));case 1:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"enableUser",value:(n=(0,i.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.updateUserStatus(t,"ENABLED"));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"disableUser",value:(r=(0,i.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.updateUserStatus(t,"DISABLED"));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"updateUserStatus",value:(t=(0,i.default)(o.default.mark((function e(t,r){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&("string"==typeof t||"number"==typeof t)){e.next=2;break}throw new Error("User objectId must be non empty string/number");case 2:if(r&&"string"==typeof r){e.next=4;break}throw new Error("User Status must be a valid string");case 4:return e.abrupt("return",this.app.request.put({url:this.app.urls.userStatus(t),data:{userStatus:r}}));case 5:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})},{key:"getAuthorizationUrlLink",value:function(e,t,r,n,o,s){return this.app.request.post({url:this.app.urls.userAuthorizationURL(e),data:{fieldsMapping:t,permissions:r,redirect:n,redirectAfterLoginUrl:o,callbackUrlDomain:s}})}},{key:"loggedInUser",value:function(){return this.getCurrentUserId()}},{key:"getCurrentUserToken",value:function(){return this.currentUser&&this.currentUser["user-token"]?this.currentUser["user-token"]:this.app.LocalCache.get(this.app.LocalCache.Keys.USER_TOKEN)||null}},{key:"setCurrentUserToken",value:function(e){e=e||null,this.currentUser&&(this.currentUser["user-token"]=e),this.app.LocalCache.get("user-token")&&this.app.LocalCache.set("user-token",e),this.app.__RT&&this.app.RT.updateUserTokenIfNeeded()}},{key:"getCurrentUserId",value:function(){return this.currentUser?this.currentUser.objectId:this.app.LocalCache.get(this.app.LocalCache.Keys.CURRENT_USER_ID)||null}},{key:"getLocalCurrentUser",value:function(){return this.currentUser}},{key:"setLocalCurrentUser",value:function(e,t){return this.setCurrentUser(e,t)}}]),e}();t.Z=y},8332:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(4687)),s=n(r(8698)),i=n(r(7156)),a=n(r(6690)),u=n(r(9728)),c=n(r(3082)),l=function(){function e(t){(0,a.default)(this,e),this.users=t,this.app=t.app}var t,r,n,l,f;return(0,u.default)(e,[{key:"findByRole",value:(f=(0,i.default)(o.default.mark((function e(t,r,n){var i,a=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Role Name must be a string and can not be empty");case 2:if(null==r||"boolean"==typeof r){e.next=4;break}throw new Error('The second argument "loadRoles" can be a boolean only');case 4:if(null==n||!Array.isArray(n)&&"object"===(0,s.default)(n)){e.next=6;break}throw new Error('The third argument "query" can be an instance of DataQueryBuilder or a plain object only');case 6:return i=[],"boolean"==typeof r&&i.push("loadRoles=".concat(r)),n&&i.push(c.default.toQueryString(n)),e.abrupt("return",this.app.request.get({url:this.app.urls.usersRole(t),queryString:i.join("&")}).then((function(e){return a.users.dataStore.parseResponse(e)})));case 10:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return f.apply(this,arguments)})},{key:"getUserRoles",value:(l=(0,i.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.app.request.get({url:this.app.urls.userRoles(t)}));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"assignRole",value:(n=(0,i.default)(o.default.mark((function e(t,r){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.changeRole(t,r,"assignRole"));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"unassignRole",value:(r=(0,i.default)(o.default.mark((function e(t,r){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.changeRole(t,r,"unassignRole"));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"changeRole",value:(t=(0,i.default)(o.default.mark((function e(t,r,n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&("string"==typeof t||"number"==typeof t)){e.next=2;break}throw new Error("User identity must be a string or number and can not be empty.");case 2:if(r&&"string"==typeof r){e.next=4;break}throw new Error("Role Name must be a string and can not be empty.");case 4:return e.abrupt("return",this.app.request.post({url:this.app.urls.userRoleOperation(n),data:{user:t,roleName:r}}));case 5:case"end":return e.stop()}}),e,this)}))),function(e,r,n){return t.apply(this,arguments)})}]),e}();t.default=l},870:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.SocialContainer=void 0;var o=n(r(6690)),s=n(r(9728)),i=function(){function e(t,r){(0,o.default)(this,e),this.socialType=t,this.container=r,r?this.processContainer():this.createContainer()}return(0,s.default)(e,[{key:"processContainer",value:function(){var e,t=this,r=this.container[0]||this.container,n=document.createElement("div");n.innerHTML="Loading...",r.appendChild(n),r.style.cursor="wait",this.closeContainer=function(){r.style.cursor="default",r.removeChild(e)},this.removeLoading=function(){r.removeChild(n)},this.doAuthorizationActivity=function(n){t.removeLoading(),(e=document.createElement("iframe")).frameBorder=0,e.width=r.style.width,e.height=r.style.height,e.id="SocialAuthFrame",e.setAttribute("src",n+"&output=embed"),r.appendChild(e),e.onload=function(){r.style.cursor="default"}}}},{key:"createContainer",value:function(){var e=window.open("",this.socialType+" authorization","resizable=yes, scrollbars=yes, titlebar=yes, top=10, left=10");e.document.getElementsByTagName("body")[0].innerHTML="Loading...",e.document.getElementsByTagName("html")[0].style.cursor="wait",this.closeContainer=function(){e.close()},this.doAuthorizationActivity=function(t){e.location.href=t,e.onload=function(){e.document.getElementsByTagName("html")[0].style.cursor="default"}}}}]),e}();t.SocialContainer=i},1571:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(4687)),s=n(r(7156)),i=n(r(6690)),a=n(r(9728)),u=n(r(5602)),c=r(870),l=function(){function e(t){(0,i.default)(this,e),this.users=t,this.app=t.app}var t,r,n,l,d,h,y,v,m;return(0,a.default)(e,[{key:"loginWithFacebook",value:(m=(0,s.default)(o.default.mark((function e(t,r,n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.loginWithContainer("facebook",t,r,null,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return m.apply(this,arguments)})},{key:"loginWithGooglePlus",value:(v=(0,s.default)(o.default.mark((function e(t,r,n,s){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.loginWithContainer("googleplus",t,r,n,s));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n){return v.apply(this,arguments)})},{key:"loginWithTwitter",value:(y=(0,s.default)(o.default.mark((function e(t,r){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.loginWithContainer("twitter",t,null,null,r));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return y.apply(this,arguments)})},{key:"loginWithFacebookSdk",value:(h=(0,s.default)(o.default.mark((function e(t,r,n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.sendWithAccessToken("facebook",t,r,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return h.apply(this,arguments)})},{key:"loginWithGooglePlusSdk",value:(d=(0,s.default)(o.default.mark((function e(t,r,n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.sendWithAccessToken("googleplus",t,r,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return d.apply(this,arguments)})},{key:"sendWithAccessToken",value:(l=(0,s.default)(o.default.mark((function e(t,r,n,s){var i=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r&&"string"==typeof r){e.next=2;break}throw new Error('"accessToken" must be non empty string.');case 2:return"boolean"==typeof n&&(s=n,n=void 0),e.abrupt("return",this.app.request.post({url:this.app.urls.userSocialLogin(t),data:{accessToken:r,fieldsMapping:n}}).then((function(e){return i.users.setCurrentUser(e,s)})));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n){return l.apply(this,arguments)})},{key:"loginWithContainer",value:(n=(0,s.default)(o.default.mark((function e(t,r,n,s,i){var a,u,l=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=new c.SocialContainer(t,s),u=function(){return new Promise((function(e,t){f("message",window,(function r(n){if(n.origin===l.app.serverURL){var o=JSON.parse(n.data);o.fault?t(new Error(o.fault)):e(o),p("message",window,r),a.closeContainer()}}))}))},e.abrupt("return",this.app.request.post({url:this.app.urls.userSocialOAuth(t),data:{fieldsMapping:r||{},permissions:n||[]}}).then((function(e){return a.doAuthorizationActivity(e)})).catch((function(e){throw a.closeContainer(),e})).then(u).then((function(e){return l.users.setCurrentUser(e,i)})));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t,r,o,s){return n.apply(this,arguments)})},{key:"loginWithOauth2",value:(r=(0,s.default)(o.default.mark((function e(t,r,n,s,i){var a=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error('"providerCode" must be non empty string.');case 2:if(r&&"string"==typeof r){e.next=4;break}throw new Error('"accessToken" must be non empty string.');case 4:return!n||n instanceof u.default||(i=s,s=n,n=void 0),"boolean"==typeof s&&(i=s,s=void 0),e.abrupt("return",this.app.request.post({url:this.app.urls.userOAuthLogin(t),data:{accessToken:r,fieldsMapping:s,guestUser:n}}).then((function(e){return a.users.setCurrentUser(e,i)})));case 7:case"end":return e.stop()}}),e,this)}))),function(e,t,n,o,s){return r.apply(this,arguments)})},{key:"loginWithOauth1",value:(t=(0,s.default)(o.default.mark((function e(t,r,n,s,i,a){var c=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error('"providerCode" must be non empty string.');case 2:if(r&&"string"==typeof r){e.next=4;break}throw new Error('"accessToken" must be non empty string.');case 4:if(n&&"string"==typeof n){e.next=6;break}throw new Error('"accessTokenSecret" must be non empty string.');case 6:return!s||s instanceof u.default||(a=i,i=s,s=void 0),"boolean"==typeof i&&(a=i,i=void 0),e.abrupt("return",this.app.request.post({url:this.app.urls.userOAuthLogin(t),data:{accessToken:r,accessTokenSecret:n,fieldsMapping:i,guestUser:s}}).then((function(e){return c.users.setCurrentUser(e,a)})));case 9:case"end":return e.stop()}}),e,this)}))),function(e,r,n,o,s,i){return t.apply(this,arguments)})}]),e}();function f(e,t,r){t.addEventListener?t.addEventListener(e,r,!1):t.attachEvent?t.attachEvent("on"+e,r):t[e]=r}function p(e,t,r){t.removeEventListener?t.removeEventListener(e,r,!1):t.detachEvent&&t.detachEvent("on"+e,r),t[e]=null}t.default=l},5602:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(6690)),s=n(r(9728)),i=function(){function e(t){var r=this;(0,o.default)(this,e),t=t||{},Object.keys(t).map((function(e){r[e]=t[e]})),this.___class=e.className}return(0,s.default)(e,null,[{key:"className",get:function(){return"Users"}}]),e}();t.default=i,i.prototype.___class=i.className},9211:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UsersUtils=void 0;var r={getClientUserLocale:function(){if("undefined"!=typeof navigator){return(navigator.languages&&navigator.languages.length?navigator.languages[0]:navigator.userLanguage||navigator.language||navigator.browserLanguage||navigator.systemLanguage||"").slice(0,2).toLowerCase()}}};t.UsersUtils=r},9853:(e,t,r)=>{"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(8698)),s={isBrowser:i(),isLocalStorageSupported:function(){try{if(i()&&window.localStorage)return localStorage.setItem("localStorageTest",!0),localStorage.removeItem("localStorageTest"),!0}catch(e){}return!1}(),globalScope:"object"===("undefined"==typeof self?"undefined":(0,o.default)(self))&&self.self===self&&self||"object"===(void 0===r.g?"undefined":(0,o.default)(r.g))&&r.g.global===r.g&&r.g,castArray:function(e){return Array.isArray(e)?e:void 0===e?[]:[e]},isCustomClassInstance:function(e){return!(!e||"object"!==(0,o.default)(e)||Array.isArray(e))&&e.constructor!==Object},getClassName:function(e){if(e&&e.className)return e.className;if("function"==typeof e&&e.name)return e.name;if(e&&"object"===(0,o.default)(e)&&!Array.isArray(e)){if(e.___class)return e.___class;if(e.constructor!==Object)return s.getClassName(e.constructor)}return null},uuid:function(){var e=function(){return Math.random().toString(16).slice(-4).toUpperCase()};return"".concat("".concat(e()).concat(e()),"-").concat(e(),"-").concat(e(),"-").concat(e(),"-").concat("".concat(e()).concat(e()).concat(e()))},isObject:function(e){return null!=e&&"Object"===e.constructor.name}};function i(){return"object"===("undefined"==typeof self?"undefined":(0,o.default)(self))&&self.self===self&&"object"===("undefined"==typeof window?"undefined":(0,o.default)(window))&&window===self}var a=s;t.default=a},3930:function(e,t){var r,n;r="undefined"!=typeof self?self:this,n=function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=3)}([function(e,t,r){"use strict";(function(e){function n(e){return(n="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})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.castArray=void 0,t.getFormData=i,t.isStream=t.isObject=t.isNodeJS=t.isFormData=t.isBrowser=void 0,t.setFormData=function(e){s=e},t.castArray=function(e){return Array.isArray(e)?e:[e]},t.isObject=function(e){return null!=e&&"object"===n(e)},t.isFormData=function(e){return!!e&&(e instanceof i()||e&&e.constructor&&0===e.constructor.toString().trim().indexOf("function FormData"))},t.isStream=function(e){return e instanceof r(6).Stream};var o=t.isNodeJS=function(){return void 0!==e&&null!=e.versions&&null!=e.versions.node},s=(t.isBrowser=function(){return"undefined"!=typeof window&&void 0!==window.document},null);function i(){return s||(o()||"undefined"==typeof FormData?r(7):FormData)}}).call(t,r(5))},function(e,t){throw new Error('This Backendless JS SDK assembly is not intended for Node.js environment. You should use "lib" folder modules instead. For any questions please contact as at http://support.backendless.com/')},function(e,t,r){"use strict";function n(e){return(n="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})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.Request=void 0;var o,s=r(12),i=(o=r(13))&&o.__esModule?o:{default:o},a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var r=l(t);if(r&&r.has(e))return r.get(e);var o={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var a=s?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(o,i,a):o[i]=e[i]}return o.default=e,r&&r.set(e,o),o}(r(14)),u=r(0),c=r(15);function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(l=function(e){return e?r:t})(e)}function f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function p(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?f(Object(r),!0).forEach((function(t){d(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function d(e,t,r){return(t=y(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function h(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,y(n.key),n)}}function y(e){var t=function(e,t){if("object"!==n(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!==n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===n(t)?t:String(t)}function v(e,t){return(v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function m(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=g(e);if(t){var o=g(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return b(this,r)}}function b(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function g(e){return(g=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function w(e){try{return p(p({},e),{},{body:JSON.parse(e.body)})}catch(t){return e}}function k(e){if(e.status>=200&&e.status<300)return e;throw new c.ResponseError(e)}t.Request=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&v(e,t)}(i,e);var t,r,n,o=m(i);function i(e,t,r){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(n=o.call(this)).method=t,n.path=e,n.body=r,n.tags=void 0,n.unwrap=!0,n.cacheTTL=0,n.headers={},n.queryParams={},n.encoding="utf8",n.timeout=0,n.withCredentials=null,n}return t=i,(r=[{key:"set",value:function(e,t){if((0,u.isObject)(e))for(var r in e)this.set(r,e[r]);else void 0!==t&&(this.headers[e]=t);return this}},{key:"cacheTags",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.tags=t,this}},{key:"query",value:function(e){return Object.assign(this.queryParams,e),this}},{key:"form",value:function(e){if(e){var t=i.FormData;if(e instanceof t)this.body=e;else{var r=new t,n=function(t){t&&(0,u.castArray)(e[t]).forEach((function(e){e&&e.hasOwnProperty("value")&&e.hasOwnProperty("options")?r.append(t,e.value,e.options):r.append(t,e)}))};for(var o in e)n(o);this.body=r}}return this}},{key:"useCache",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15e3;return this.cacheTTL=e,this}},{key:"resetCache",value:function(e){return e&&this.tags&&s.cache.deleteByTags(this.tags),this}},{key:"type",value:function(e){return this.set("Content-Type",e),this}},{key:"unwrapBody",value:function(e){return this.unwrap=e,this}},{key:"setEncoding",value:function(e){return this.encoding=e,this}},{key:"setWithCredentials",value:function(e){return this.withCredentials=e,this}},{key:"setTimeout",value:function(e){return this.timeout=e,this}},{key:"send",value:function(e){var t=this;this.emit("request",this);var r=this.path,n=a.stringify(this.queryParams);if(n&&(r+="?"+n),this.cacheTTL){var o=s.cache.get(r);if(void 0!==o)return Promise.resolve(o)}this.headers["Content-Type"]||!(0,u.isObject)(e)||(0,u.isFormData)(e)||this.type("application/json"),e&&(e="application/json"===this.headers["Content-Type"]&&"string"!=typeof e?JSON.stringify(e):e),i.verbose&&console.log(this.method.toUpperCase(),decodeURIComponent(r),e,this.headers);var c="boolean"==typeof this.withCredentials?this.withCredentials:i.withCredentials,l=i.send(r,this.method.toUpperCase(),this.headers,e,this.encoding,this.timeout,c).then(w).then(k).then((function(e){return t.unwrap?e.body:e})).then((function(e){return t.cacheTTL&&s.cache.set(r,e,t.tags,t.cacheTTL),e})).then((function(e){return t.tags&&"get"!==t.method&&s.cache.deleteByTags(t.tags),e}));return l.then((function(e){t.emit("response",e),t.emit("done",null,e)})).catch((function(e){t.emit("error",e),t.emit("done",e)})),l}},{key:"then",value:function(e,t){return this.promise=this.promise||this.send(this.body),this.promise.then(e,t)}},{key:"catch",value:function(e){return this.promise=this.promise||this.send(this.body),this.promise.catch(e)}}])&&h(t.prototype,r),n&&h(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(i.default)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(4),o=r(11),s=r(2),i=r(0);Object.defineProperty(s.Request,"FormData",{get:function(){return(0,i.getFormData)()},set:function(e){(0,i.setFormData)(e)}}),s.Request.XMLHttpRequest="undefined"!=typeof XMLHttpRequest?XMLHttpRequest:void 0,s.Request.send=function(e,t,r,i,a,u,c){return(void 0!==s.Request.XMLHttpRequest?o.sendXmlHttpRequest:n.sendNodeAPIRequest)(e,t,r,i,a,u,c)},s.Request.verbose=!1,s.Request.withCredentials=!1,s.Request.methods=["get","post","put","patch","delete"],s.Request.methods.forEach((function(e){s.Request[e]=function(t,r){return new s.Request(t,e,r)}})),(t=e.exports=s.Request).default=s.Request},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sendNodeAPIRequest=function(e,t,o,s,i,a,u){return new Promise((function(c,l){var f=r(8).parse(e),p=(0,n.isFormData)(s)&&s,d="https:"===f.protocol,h={host:f.hostname,port:f.port||(d?443:80),path:f.pathname+(f.search||""),method:t,headers:o,timeout:a};"boolean"==typeof u&&(h.withCredentials=u);var y=function(){var e=r(1).Buffer,t=r(d?9:10).request(h,(function(t){var r=[],n=[],o=0,s="",a=t.statusCode,u=t.statusMessage,f=t.headers;t.on("data",(function(t){e.isBuffer(t)?t.length&&(o+=t.length,n.push(t)):r.push(t)})),t.on("end",(function(){o?(s=e.concat(n,o),null!=i&&(s=s.toString(i))):r.length&&(s=r.join()),c({status:a,statusText:u,headers:f,body:s})})),t.on("error",l)}));if(t.on("error",l),t.on("timeout",(function(){t.destroy(new Error("Connection aborted due to timeout"))})),s){if((0,n.isStream)(s))return void s.pipe(t);t.write(s)}t.end()};if(p)Object.assign(h.headers,p.getHeaders()),p.getLength((function(e,t){e||isNaN(t)||(h.headers["content-length"]=t),y()}));else{if(s&&!h.headers["content-length"]){var v=r(1).Buffer;h.headers["content-length"]=v.byteLength(s)}y()}}))};var n=r(0)},function(e,t){var r,n,o=e.exports={};function s(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function a(e){if(r===setTimeout)return setTimeout(e,0);if((r===s||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:s}catch(e){r=s}try{n="function"==typeof clearTimeout?clearTimeout:i}catch(e){n=i}}();var u,c=[],l=!1,f=-1;function p(){l&&u&&(l=!1,u.length?c=u.concat(c):f=-1,c.length&&d())}function d(){if(!l){var e=a(p);l=!0;for(var t=c.length;t;){for(u=c,c=[];++f<t;)u&&u[f].run();f=-1,t=c.length}u=null,l=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===i||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function y(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];c.push(new h(e,t)),1!==c.length||l||a(d)},h.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=y,o.addListener=y,o.once=y,o.off=y,o.removeListener=y,o.removeAllListeners=y,o.emit=y,o.prependListener=y,o.prependOnceListener=y,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t){throw new Error('This Backendless JS SDK assembly is not intended for Node.js environment. You should use "lib" folder modules instead. For any questions please contact as at http://support.backendless.com/')},function(e,t){throw new Error('This Backendless JS SDK assembly is not intended for Node.js environment. You should use "lib" folder modules instead. For any questions please contact as at http://support.backendless.com/')},function(e,t){throw new Error('This Backendless JS SDK assembly is not intended for Node.js environment. You should use "lib" folder modules instead. For any questions please contact as at http://support.backendless.com/')},function(e,t){throw new Error('This Backendless JS SDK assembly is not intended for Node.js environment. You should use "lib" folder modules instead. For any questions please contact as at http://support.backendless.com/')},function(e,t){throw new Error('This Backendless JS SDK assembly is not intended for Node.js environment. You should use "lib" folder modules instead. For any questions please contact as at http://support.backendless.com/')},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sendXmlHttpRequest=function(e,t,r,o,s,i,a){return new Promise((function(u,c){var l=new n.Request.XMLHttpRequest;l.timeout=i,s||(l.responseType="arraybuffer"),l.open(t.toUpperCase(),e,!0),"boolean"==typeof a&&(l.withCredentials=a),l.onload=function(){var e,t,r=(e=l.getAllResponseHeaders(),t={},e?(e.split("\n").forEach((function(e){var r=e.indexOf(":"),n=e.substr(0,r).trim(),o=e.substr(r+1).trim();n&&(t[n]=t[n]?t[n]+", "+o:o)})),t):t),n=l,o={status:n.status,statusText:n.statusText,headers:r};"utf8"===s?o.body=l.response||l.responseText:l.response&&(o.body=new Uint8Array(l.response)),u(o),l=null},l.onerror=function(){c(new Error("Network Error")),l=null},l.ontimeout=function(){c(new Error("Connection aborted due to timeout")),l=null},Object.keys(r).forEach((function(e){l.setRequestHeader(e,r[e])})),l.send(o)}))};var n=r(2)},function(e,t,r){"use strict";function n(e){return(n="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})(e)}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,s,i,a=[],u=!0,c=!1;try{if(s=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=s.call(r)).done)&&(a.push(n.value),a.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return a}}(e,t)||i(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=i(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){u=!0,s=e},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}function i(e,t){if(e){if("string"==typeof e)return a(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function u(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,(s=o.key,i=void 0,i=function(e,t){if("object"!==n(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!==n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(s,"string"),"symbol"===n(i)?i:String(i)),o)}var s,i}Object.defineProperty(t,"__esModule",{value:!0}),t.cache=void 0;var c=function(){return(new Date).getTime()},l=function(e,t){return!!e.find((function(e){return t.find((function(t){return function(e,t){var r=e==t;return!r&&e instanceof RegExp&&(r=e.test(t)),!r&&t instanceof RegExp&&(r=t.test(e)),r}(e,t)}))}))},f=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.setFlushInterval(t),this.map=new Map}var t,r,n;return t=e,(r=[{key:"setFlushInterval",value:function(e){this.flushInterval=e,this.flushTimer&&(clearInterval(this.flushTimer),delete this.flushTimer)}},{key:"get",value:function(e){var t=this.map.get(e);if(t){if(t.ttl>c())return t.value;this.map.delete(e)}}},{key:"set",value:function(e,t,r,n){this.map.set(e,function(e,t,r){return{value:e,tags:t,ttl:r}}(t,r,c()+n)),this.flushInterval&&!this.flushTimer&&(this.flushTimer=setInterval(this.flush.bind(this),this.flushInterval),this.flushTimer.unref&&this.flushTimer.unref())}},{key:"delete",value:function(e){this.map.delete(e)}},{key:"deleteAll",value:function(){var e,t=s(this.map);try{for(t.s();!(e=t.n()).done;){var r=o(e.value,1)[0];this.delete(r)}}catch(e){t.e(e)}finally{t.f()}}},{key:"deleteByTags",value:function(e){var t,r=s(this.map);try{for(r.s();!(t=r.n()).done;){var n=o(t.value,2),i=n[0],a=n[1];a.tags&&l(e,a.tags)&&this.delete(i)}}catch(e){r.e(e)}finally{r.f()}}},{key:"flush",value:function(){var e,t=c(),r=s(this.map);try{for(r.s();!(e=r.n()).done;){var n=o(e.value,2),i=n[0];n[1].ttl<t&&this.delete(i)}}catch(e){r.e(e)}finally{r.f()}}}])&&u(t.prototype,r),n&&u(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();t.cache=new f(6e4)},function(e,t,r){"use strict";function n(e){return(n="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})(e)}function o(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,(s=o.key,i=void 0,i=function(e,t){if("object"!==n(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!==n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(s,"string"),"symbol"===n(i)?i:String(i)),o)}var s,i}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.events={}}var t,r,n;return t=e,(r=[{key:"on",value:function(e,t){return this.events[e]=this.events[e]||[],this.events[e].push(t),this}},{key:"off",value:function(e,t){return e?this.events[e]&&(t?this.events[e]=this.events[e].filter((function(e){return e!==t})):delete this.events[e]):this.events={},this}},{key:"emit",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];this.events[e]&&this.events[e].forEach((function(e){return e.apply(void 0,r)}))}}])&&o(t.prototype,r),n&&o(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stringify=void 0;var n=r(0);t.stringify=function(e){var t=[];return Object.keys(e).forEach((function(r){var o=e[r];void 0!==o&&(0,n.castArray)(o).forEach((function(e){t.push("".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(e)))}))})),t.join("&")}},function(e,t,r){"use strict";function n(e){return(n="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})(e)}function o(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,(s=o.key,i=void 0,i=function(e,t){if("object"!==n(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!==n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(s,"string"),"symbol"===n(i)?i:String(i)),o)}var s,i}function s(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function i(e){var t="function"==typeof Map?new Map:void 0;return(i=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return a(e,arguments,l(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),c(n,e)})(e)}function a(e,t,r){return(a=u()?Reflect.construct.bind():function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&c(o,r.prototype),o}).apply(null,arguments)}function u(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function c(e,t){return(c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.ResponseError=void 0,t.ResponseError=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&c(e,t)}(p,e);var t,r,n,i,a,f=(t=p,r=u(),function(){var e,n=l(t);if(r){var o=l(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return s(this,e)});function p(e){var t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,p),t=f.call(this);var r,n=502===(r=e).status?"No connection with server":r.body||"Status Code ".concat(r.status," (").concat(r.statusText,")");return t.message=n.message||n,t.code=n.code,t.status=e.status,t.headers=e.headers,t.body=e.body,t}return n=p,i&&o(n.prototype,i),a&&o(n,a),Object.defineProperty(n,"prototype",{writable:!1}),n}(i(Error))}])},"object"==typeof t&&"object"==typeof e?e.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof t?t.BackendlessRequest=n():r.BackendlessRequest=n()},5786:(e,t)=>{var r,n,o,s;self,s=()=>(()=>{var e={"./node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js":e=>{e.exports=function(e,t,r,n,o){var s={};return Object.keys(n).forEach((function(e){s[e]=n[e]})),s.enumerable=!!s.enumerable,s.configurable=!!s.configurable,("value"in s||s.initializer)&&(s.writable=!0),s=r.slice().reverse().reduce((function(r,n){return n(e,t,r)||r}),s),o&&void 0!==s.initializer&&(s.value=s.initializer?s.initializer.call(o):void 0,s.initializer=void 0),void 0===s.initializer&&(Object.defineProperty(e,t,s),s=null),s},e.exports.__esModule=!0,e.exports.default=e.exports},"./node_modules/@babel/runtime/helpers/assertThisInitialized.js":e=>{e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports},"./node_modules/@babel/runtime/helpers/asyncToGenerator.js":e=>{function t(e,t,r,n,o,s,i){try{var a=e[s](i),u=a.value}catch(e){return void r(e)}a.done?t(u):Promise.resolve(u).then(n,o)}e.exports=function(e){return function(){var r=this,n=arguments;return new Promise((function(o,s){var i=e.apply(r,n);function a(e){t(i,o,s,a,u,"next",e)}function u(e){t(i,o,s,a,u,"throw",e)}a(void 0)}))}},e.exports.__esModule=!0,e.exports.default=e.exports},"./node_modules/@babel/runtime/helpers/classCallCheck.js":e=>{e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},"./node_modules/@babel/runtime/helpers/createClass.js":e=>{function t(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},"./node_modules/@babel/runtime/helpers/defineProperty.js":e=>{e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},"./node_modules/@babel/runtime/helpers/get.js":(e,t,r)=>{var n=r("./node_modules/@babel/runtime/helpers/superPropBase.js");function o(){return"undefined"!=typeof Reflect&&Reflect.get?(e.exports=o=Reflect.get.bind(),e.exports.__esModule=!0,e.exports.default=e.exports):(e.exports=o=function(e,t,r){var o=n(e,t);if(o){var s=Object.getOwnPropertyDescriptor(o,t);return s.get?s.get.call(arguments.length<3?e:r):s.value}},e.exports.__esModule=!0,e.exports.default=e.exports),o.apply(this,arguments)}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},"./node_modules/@babel/runtime/helpers/getPrototypeOf.js":e=>{function t(r){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},"./node_modules/@babel/runtime/helpers/inherits.js":(e,t,r)=>{var n=r("./node_modules/@babel/runtime/helpers/setPrototypeOf.js");e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&n(e,t)},e.exports.__esModule=!0,e.exports.default=e.exports},"./node_modules/@babel/runtime/helpers/interopRequireDefault.js":e=>{e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},"./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js":(e,t,r)=>{var n=r("./node_modules/@babel/runtime/helpers/typeof.js").default,o=r("./node_modules/@babel/runtime/helpers/assertThisInitialized.js");e.exports=function(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return o(e)},e.exports.__esModule=!0,e.exports.default=e.exports},"./node_modules/@babel/runtime/helpers/regeneratorRuntime.js":(e,t,r)=>{var n=r("./node_modules/@babel/runtime/helpers/typeof.js").default;function o(){"use strict";e.exports=o=function(){return t},e.exports.__esModule=!0,e.exports.default=e.exports;var t={},r=Object.prototype,s=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function f(e,t,r,n){var o=t&&t.prototype instanceof h?t:h,s=Object.create(o.prototype),i=new R(n||[]);return s._invoke=function(e,t,r){var n="suspendedStart";return function(o,s){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw s;return{value:void 0,done:!0}}for(r.method=o,r.arg=s;;){var i=r.delegate;if(i){var a=O(i,r);if(a){if(a===d)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=p(e,t,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===d)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(e,r,i),s}function p(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=f;var d={};function h(){}function y(){}function v(){}var m={};l(m,a,(function(){return this}));var b=Object.getPrototypeOf,g=b&&b(b(x([])));g&&g!==r&&s.call(g,a)&&(m=g);var w=v.prototype=h.prototype=Object.create(m);function k(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){var r;this._invoke=function(o,i){function a(){return new t((function(r,a){!function r(o,i,a,u){var c=p(e[o],e,i);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==n(f)&&s.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,a,u)}),(function(e){r("throw",e,a,u)})):t.resolve(f).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,u)}))}u(c.arg)}(o,i,r,a)}))}return r=r?r.then(a,a):a()}}function O(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,O(e,t),"throw"===t.method))return d;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var n=p(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,d;var o=n.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function _(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function R(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function x(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,n=function t(){for(;++r<e.length;)if(s.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return n.next=n}}return{next:j}}function j(){return{value:void 0,done:!0}}return y.prototype=v,l(w,"constructor",v),l(v,"constructor",y),y.displayName=l(v,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,v):(e.__proto__=v,l(e,c,"GeneratorFunction")),e.prototype=Object.create(w),e},t.awrap=function(e){return{__await:e}},k(E.prototype),l(E.prototype,u,(function(){return this})),t.AsyncIterator=E,t.async=function(e,r,n,o,s){void 0===s&&(s=Promise);var i=new E(f(e,r,n,o),s);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},k(w),l(w,c,"Generator"),l(w,a,(function(){return this})),l(w,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=x,R.prototype={constructor:R,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(_),!e)for(var t in this)"t"===t.charAt(0)&&s.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n],i=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var a=s.call(o,"catchLoc"),u=s.call(o,"finallyLoc");if(a&&u){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&s.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),_(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;_(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:x(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},t}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},"./node_modules/@babel/runtime/helpers/setPrototypeOf.js":e=>{function t(r,n){return e.exports=t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r,n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},"./node_modules/@babel/runtime/helpers/superPropBase.js":(e,t,r)=>{var n=r("./node_modules/@babel/runtime/helpers/getPrototypeOf.js");e.exports=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=n(e)););return e},e.exports.__esModule=!0,e.exports.default=e.exports},"./node_modules/@babel/runtime/helpers/typeof.js":e=>{function t(r){return e.exports=t="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},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},"./node_modules/@babel/runtime/regenerator/index.js":(e,t,r)=>{const n=r("./node_modules/@babel/runtime/helpers/regeneratorRuntime.js")();e.exports=n;try{regeneratorRuntime=n}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}},"./node_modules/after/index.js":e=>{function t(){}e.exports=function(e,r,n){var o=!1;return n=n||t,s.count=e,0===e?r():s;function s(e,t){if(s.count<=0)throw new Error("after called too many times");--s.count,e?(o=!0,r(e),r=n):0!==s.count||o||r(null,t)}}},"./node_modules/arraybuffer.slice/index.js":e=>{e.exports=function(e,t,r){var n=e.byteLength;if(t=t||0,r=r||n,e.slice)return e.slice(t,r);if(t<0&&(t+=n),r<0&&(r+=n),r>n&&(r=n),t>=n||t>=r||0===n)return new ArrayBuffer(0);for(var o=new Uint8Array(e),s=new Uint8Array(r-t),i=t,a=0;i<r;i++,a++)s[a]=o[i];return s.buffer}},"./src/client.js":(e,t,r)=>{"use strict";var n=r("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r("./node_modules/@babel/runtime/helpers/classCallCheck.js")),s=n(r("./node_modules/@babel/runtime/helpers/createClass.js")),i=n(r("./node_modules/@babel/runtime/helpers/defineProperty.js")),a=r("./src/constants.js"),u=n(r("./src/config.js")),c=n(r("./src/subscriptions.js")),l=n(r("./src/methods.js")),f=n(r("./src/session.js")),p=[a.NativeSocketEvents.CONNECTING,a.NativeSocketEvents.CONNECT,a.NativeSocketEvents.CONNECT_ERROR,a.NativeSocketEvents.DISCONNECT,a.NativeSocketEvents.RECONNECT_ATTEMPT],d=function(){function e(t){var r=this;(0,o.default)(this,e),(0,i.default)(this,"onConnectError",(function(){r.subscriptions.hasActivity()||r.methods.hasActivity()||(r.disconnect("There are no active subscriptions and methods"),r.connectible=!0)})),(0,i.default)(this,"connectOnMethod",(function(e){return function(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];if(r.connectible){var s=r.provideConnection();r.connected&&s.then((function(t){return t[e].apply(t,n)}))}}})),(0,i.default)(this,"on",this.connectOnMethod("on")),(0,i.default)(this,"emit",this.connectOnMethod("emit")),(0,i.default)(this,"onSessionDisconnect",(function(){r.subscriptions.stop(),r.methods.stop(),delete r.session,r.provideConnection()})),(0,i.default)(this,"emitSocketEventListeners",(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];r.socketEvents[e]&&r.socketEvents[e].forEach((function(e){return e.apply(void 0,n)}))})),(0,i.default)(this,"addConnectingEventListener",(function(e){return r.addSocketEventListener(a.NativeSocketEvents.CONNECTING,e)})),(0,i.default)(this,"removeConnectingEventListener",(function(e){return r.removeSocketEventListener(a.NativeSocketEvents.CONNECTING,e)})),(0,i.default)(this,"addConnectEventListener",(function(e){return r.addSocketEventListener(a.NativeSocketEvents.CONNECT,e)})),(0,i.default)(this,"removeConnectEventListener",(function(e){return r.removeSocketEventListener(a.NativeSocketEvents.CONNECT,e)})),(0,i.default)(this,"addConnectErrorEventListener",(function(e){return r.addSocketEventListener(a.NativeSocketEvents.CONNECT_ERROR,e)})),(0,i.default)(this,"removeConnectErrorEventListener",(function(e){return r.removeSocketEventListener(a.NativeSocketEvents.CONNECT_ERROR,e)})),(0,i.default)(this,"addDisconnectEventListener",(function(e){return r.addSocketEventListener(a.NativeSocketEvents.DISCONNECT,e)})),(0,i.default)(this,"removeDisconnectEventListener",(function(e){return r.removeSocketEventListener(a.NativeSocketEvents.DISCONNECT,e)})),(0,i.default)(this,"addReconnectAttemptEventListener",(function(e){return r.addSocketEventListener(a.NativeSocketEvents.RECONNECT_ATTEMPT,e)})),(0,i.default)(this,"removeReconnectAttemptEventListener",(function(e){return r.removeSocketEventListener(a.NativeSocketEvents.RECONNECT_ATTEMPT,e)})),(0,i.default)(this,"removeConnectionListeners",(function(){p.forEach((function(e){return r.removeSocketEventListener(e)}))})),this.config=new u.default(t),this.resetSocketEvents();var n={onMessage:this.on.bind(this),emitMessage:this.emit.bind(this)};this.subscriptions=new c.default(n),this.methods=new l.default(n),this.connectible=!0,this.connected=!1}return(0,s.default)(e,[{key:"resetSocketEvents",value:function(){this.socketEvents={},this.addConnectErrorEventListener(this.onConnectError)}},{key:"setConfig",value:function(e){this.config.set(e),this.session&&(this.disconnect("Re-config socket connection"),this.connect())}},{key:"provideConnection",value:function(){var e=this;return this.session||(this.session=new f.default(this.config,this.emitSocketEventListeners,this.onSessionDisconnect),this.session.getSocket().then((function(){e.connected=!0,e.methods.initialize(),e.methods.restore(),e.subscriptions.initialize(),e.subscriptions.restore()}))),this.session.getSocket()}},{key:"connect",value:function(){this.connectible=!0,this.provideConnection()}},{key:"disconnect",value:function(e){this.session&&(this.subscriptions.stop(),this.methods.stop(),this.session.terminate(),delete this.session,this.emitSocketEventListeners(a.NativeSocketEvents.DISCONNECT,e||"disconnected by client")),this.connectible=!1,this.connected=!1}},{key:"terminate",value:function(e){this.resetSocketEvents(),this.subscriptions.reset(),this.methods.reset(),this.disconnect(e||"Terminated by client")}},{key:"addSocketEventListener",value:function(e,t){return this.socketEvents[e]=this.socketEvents[e]||[],this.socketEvents[e].push(t),this}},{key:"removeSocketEventListener",value:function(e,t){return this.socketEvents[e]&&(this.socketEvents[e]=t?this.socketEvents[e].filter((function(e){return e!==t})):[],this.socketEvents[e].length||delete this.socketEvents[e]),this}}]),e}();t.default=d},"./src/config.js":(e,t,r)=>{"use strict";var n=r("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r("./node_modules/@babel/runtime/regenerator/index.js")),s=n(r("./node_modules/@babel/runtime/helpers/asyncToGenerator.js")),i=n(r("./node_modules/@babel/runtime/helpers/classCallCheck.js")),a=n(r("./node_modules/@babel/runtime/helpers/createClass.js")),u=n(r("./node_modules/@babel/runtime/helpers/typeof.js")),c=n(r("./node_modules/backendless-request/dist/backendless-request.js")),l=function(e){return void 0===e},f=function(e){return"string"==typeof e},p=function(e){return"function"==typeof e},d=function(e){return"object"===(0,u.default)(e)&&null!==e},h=function(){function e(t){(0,i.default)(this,e),this.appId=null,this.lookupPath=null,this.lookupHeaders={},this.debugMode=!1,this.connectQuery={},this.socketConfigTransform=null,this.socketConfig=null,this.set(t)}var t;return(0,a.default)(e,[{key:"set",value:function(e){if(e){if(!l(e.appId)){if(!f(e.appId))throw new Error('"appId" must be String.');this.appId=e.appId}if(!l(e.lookupPath)){if(!f(e.lookupPath))throw new Error('"lookupPath" must be String.');this.lookupPath=e.lookupPath}if(!l(e.lookupHeaders)){if(!d(e.lookupHeaders))throw new Error('"lookupHeaders" must be Object.');this.lookupHeaders=e.lookupHeaders}if(l(e.debugMode)||(this.debugMode=!!e.debugMode),!l(e.connectQuery))if(p(e.connectQuery))this.getConnectQuery=e.connectQuery;else{if(!d(e.connectQuery))throw new Error('"connectQuery" must be Function or Object.');this.connectQuery=e.connectQuery}if(!l(e.socketConfigTransform)){if(!p(e.socketConfigTransform))throw new Error('"socketConfigTransform" must be Function.');this.socketConfigTransform=e.socketConfigTransform}}}},{key:"getConnectQuery",value:function(){return this.connectQuery}},{key:"prepare",value:(t=(0,s.default)(o.default.mark((function e(){var t,r,n,s,i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(f(this.lookupPath)){e.next=2;break}throw new Error("lookupPath must be String");case 2:return e.next=4,c.default.get(this.lookupPath).set(this.lookupHeaders);case 4:if(t=e.sent,r=this.appId?"".concat(t,"/").concat(this.appId):t,n=this.appId?"/".concat(this.appId):void 0,s=this.getConnectQuery(),this.socketConfig={host:t,url:r,options:{path:n,query:s,forceNew:!0,autoConnect:!1,reconnection:!1}},!this.socketConfigTransform){e.next=14;break}return e.next=12,this.socketConfigTransform(this.socketConfig);case 12:(i=e.sent)&&(this.socketConfig=i);case 14:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"getSocketConfig",value:function(){return this.socketConfig}}]),e}();t.default=h},"./src/constants.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RTSubscriptionTypes=t.RTSocketEvents=t.RTMethodTypes=t.NativeSocketEvents=void 0,t.NativeSocketEvents={CONNECTING:"connecting",CONNECT:"connect",CONNECT_ERROR:"connect_error",CONNECT_TIMEOUT:"connect_timeout",DISCONNECT:"disconnect",RECONNECT:"reconnect",RECONNECT_ATTEMPT:"reconnect_attempt",RECONNECTING:"reconnecting",RECONNECT_ERROR:"reconnect_error",RECONNECT_FAILED:"reconnect_failed",ERROR:"error",PING:"ping",PONG:"pong"},t.RTSocketEvents={SUB_ON:"SUB_ON",SUB_OFF:"SUB_OFF",SUB_RES:"SUB_RES",SUB_READY:"SUB_READY",MET_REQ:"MET_REQ",MET_RES:"MET_RES"},t.RTSubscriptionTypes={OBJECTS_CHANGES:"OBJECTS_CHANGES",RELATIONS_CHANGES:"RELATIONS_CHANGES",PUB_SUB_CONNECT:"PUB_SUB_CONNECT",PUB_SUB_MESSAGES:"PUB_SUB_MESSAGES",PUB_SUB_COMMANDS:"PUB_SUB_COMMANDS",PUB_SUB_USERS:"PUB_SUB_USERS",RSO_CONNECT:"RSO_CONNECT",RSO_CHANGES:"RSO_CHANGES",RSO_CLEARED:"RSO_CLEARED",RSO_COMMANDS:"RSO_COMMANDS",RSO_INVOKE:"RSO_INVOKE",RSO_USERS:"RSO_USERS",LOGGING_MESSAGES:"LOGGING_MESSAGES",CONSOLE_MESSAGES:"CONSOLE_MESSAGES",DEVELOPER_MESSAGES:"DEVELOPER_MESSAGES"},t.RTMethodTypes={SET_USER_TOKEN:"SET_USER_TOKEN",RSO_GET:"RSO_GET",RSO_SET:"RSO_SET",RSO_CLEAR:"RSO_CLEAR",RSO_COMMAND:"RSO_COMMAND",RSO_INVOKE:"RSO_INVOKE",PUB_SUB_COMMAND:"PUB_SUB_COMMAND"}},"./src/index.js":(e,t,r)=>{"use strict";var n=r("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.RTScopeConnector=t.RTListeners=void 0;var o=n(r("./node_modules/@babel/runtime/helpers/typeof.js")),s=n(r("./node_modules/backendless-request/dist/backendless-request.js")),i=n(r("./src/client.js")),a=n(r("./src/listeners.js")),u=n(r("./src/scope-connector.js")),c="object"===("undefined"==typeof self?"undefined":(0,o.default)(self))&&self.self===self&&self||"object"===(void 0===r.g?"undefined":(0,o.default)(r.g))&&r.g.global===r.g&&r.g;i.default.Request=s.default,i.default.Listeners=a.default,i.default.ScopeConnector=u.default,c&&(c.BackendlessRTClient=i.default),e.exports=i.default;var l=i.default;t.default=l;var f=a.default;t.RTListeners=f;var p=u.default;t.RTScopeConnector=p},"./src/listeners.js":(e,t,r)=>{"use strict";var n=r("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r("./node_modules/@babel/runtime/helpers/defineProperty.js")),s=n(r("./node_modules/@babel/runtime/helpers/classCallCheck.js")),i=n(r("./node_modules/@babel/runtime/helpers/createClass.js"));function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){(0,o.default)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var c=function(){function e(){(0,s.default)(this,e),this.subscriptions={},this.simpleListeners={}}return(0,i.default)(e,[{key:"addSubscription",value:function(e,t,r){var n=this,o=r.callback,s=r.onError,i=r.onReady,a=r.parser,c=r.params;this.subscriptions[e]=this.subscriptions[e]||[];var l=t(u(u({},c),this.getSubscriptionOptions()),{parser:a,onData:o,onError:s,onReady:i,onStop:function(){n.subscriptions[e]=n.subscriptions[e].filter((function(e){return e.subscription!==l}))}}),f={callback:o,params:c,subscription:l,stop:function(){return l.stop()}};return this.subscriptions[e].push(f),f}},{key:"getSubscriptionOptions",value:function(){return{}}},{key:"stopSubscription",value:function(e,t){var r=t.callback,n=t.matcher,o=this.subscriptions[e]=this.subscriptions[e]||[];n?o.forEach((function(e){n(e)&&e.subscription.stop()})):o.forEach((function(e){r&&e.callback!==r||e.subscription.stop()}))}},{key:"addSimpleListener",value:function(e,t){(this.simpleListeners[e]=this.simpleListeners[e]||[]).push(t)}},{key:"removeSimpleListener",value:function(e,t){this.simpleListeners[e]&&(this.simpleListeners[e]=t?this.simpleListeners[e].filter((function(e){return e!==t})):[])}},{key:"runSimpleListeners",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];this.simpleListeners[e]&&this.simpleListeners[e].forEach((function(e){return e.apply(void 0,r)}))}},{key:"removeAllListeners",value:function(){var e=this;Object.keys(this.subscriptions).forEach((function(t){e.subscriptions[t].forEach((function(e){return e.subscription.stop()}))})),this.simpleListeners={}}}]),e}();t.default=c},"./src/methods.js":(e,t,r)=>{"use strict";var n=r("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r("./node_modules/@babel/runtime/helpers/classCallCheck.js")),s=n(r("./node_modules/@babel/runtime/helpers/createClass.js")),i=n(r("./node_modules/@babel/runtime/helpers/defineProperty.js")),a=r("./src/constants.js"),u=n(r("./src/utils.js")),c=function(e){return function(t){return this.send(e,t)}},l=function(){function e(t){var r=this,n=t.onMessage,s=t.emitMessage;(0,o.default)(this,e),(0,i.default)(this,"sendRequest",(function(e){r.invocations[e]&&r.emitMessage(a.RTSocketEvents.MET_REQ,r.invocations[e].data)})),(0,i.default)(this,"onResponse",(function(e){var t=e.id,n=e.error,o=e.result;if(r.invocations[t]){var s=r.invocations[t];n?s.reject(n):s.resolve(o),delete r.invocations[t]}})),(0,i.default)(this,"setUserToken",c(a.RTMethodTypes.SET_USER_TOKEN).bind(this)),(0,i.default)(this,"sendPubSubCommand",c(a.RTMethodTypes.PUB_SUB_COMMAND).bind(this)),(0,i.default)(this,"getRSO",c(a.RTMethodTypes.RSO_GET).bind(this)),(0,i.default)(this,"setRSO",c(a.RTMethodTypes.RSO_SET).bind(this)),(0,i.default)(this,"clearRSO",c(a.RTMethodTypes.RSO_CLEAR).bind(this)),(0,i.default)(this,"sendRSOCommand",c(a.RTMethodTypes.RSO_COMMAND).bind(this)),(0,i.default)(this,"invokeRSOMethod",c(a.RTMethodTypes.RSO_INVOKE).bind(this)),this.onMessage=n,this.emitMessage=s,this.invocations={}}return(0,s.default)(e,[{key:"initialize",value:function(){this.onMessage(a.RTSocketEvents.MET_RES,this.onResponse)}},{key:"restore",value:function(){var e=this;Object.keys(this.invocations).forEach((function(t){e.sendRequest(t)}))}},{key:"stop",value:function(){}},{key:"reset",value:function(){this.invocations={}}},{key:"hasActivity",value:function(){return!!Object.keys(this.invocations).length}},{key:"send",value:function(e,t){var r=this,n=u.default.generateUID();return this.invocations[n]={data:{id:n,name:e,options:t}},this.sendRequest(n),new Promise((function(e,t){r.invocations[n].resolve=e,r.invocations[n].reject=t}))}}]),e}();t.default=l},"./src/scope-connector.js":(e,t,r)=>{"use strict";var n=r("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o,s,i,a,u,c,l,f=n(r("./node_modules/@babel/runtime/helpers/classCallCheck.js")),p=n(r("./node_modules/@babel/runtime/helpers/createClass.js")),d=n(r("./node_modules/@babel/runtime/helpers/get.js")),h=n(r("./node_modules/@babel/runtime/helpers/inherits.js")),y=n(r("./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")),v=n(r("./node_modules/@babel/runtime/helpers/getPrototypeOf.js")),m=n(r("./node_modules/@babel/runtime/helpers/defineProperty.js")),b=n(r("./node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js")),g=n(r("./src/listeners.js"));function w(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function k(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?w(Object(r),!0).forEach((function(t){(0,m.default)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):w(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function E(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,v.default)(e);if(t){var o=(0,v.default)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,y.default)(this,r)}}var O="CONNECT",S="ERROR",_="COMMAND",R="USER_STATUS",x=(o=j(),s=j(),i=j(),a=j(),u=j(!0),l=function(e){(0,h.default)(r,e);var t=E(r);function r(e){var n;return(0,f.default)(this,r),(n=t.call(this)).options=e,n.waitConnection=[],n.connect(),n}return(0,p.default)(r,[{key:"connectSubscriber",get:function(){return null}},{key:"commandSubscriber",get:function(){return null}},{key:"usersSubscriber",get:function(){return null}},{key:"commandSender",get:function(){return null}},{key:"connect",value:function(){var e=this;this.isConnected()||(this.connection=this.connectSubscriber(this.getScopeOptions(),{onError:function(t){return e.onError(t)},onReady:function(){return e.onConnect()},onStop:function(){return e.onDisconnect()}}))}},{key:"disconnect",value:function(){this.isConnected()&&this.connection.stop()}},{key:"isConnected",value:function(){return!!this.connection&&this.connection.isReady()}},{key:"getSubscriptionOptions",value:function(){return this.getScopeOptions()}},{key:"getScopeOptions",value:function(){return this.options}},{key:"onConnect",value:function(){this.waitConnection.forEach((function(e){return e()})),this.waitConnection=[],this.runSimpleListeners(O)}},{key:"onError",value:function(e){this.runSimpleListeners(S,e)}},{key:"onDisconnect",value:function(){this.connection=null}},{key:"removeAllListeners",value:function(){return this.waitConnection=[],(0,d.default)((0,v.default)(r.prototype),"removeAllListeners",this).call(this),this}},{key:"addConnectListener",value:function(e,t){return this.addSimpleListener(O,e),t&&this.addSimpleListener(S,t),this}},{key:"removeConnectListeners",value:function(e,t){return this.removeSimpleListener(O,e),t&&this.removeSimpleListener(S,t),this}},{key:"addCommandListener",value:function(e,t){return this.addSubscription(_,this.commandSubscriber,{callback:e,onError:t}),this}},{key:"removeCommandListeners",value:function(e){return this.stopSubscription(_,{callback:e}),this}},{key:"addUserStatusListener",value:function(e,t){return this.addSubscription(R,this.usersSubscriber,{callback:e,onError:t}),this}},{key:"removeUserStatusListeners",value:function(e){return this.stopSubscription(R,{callback:e}),this}},{key:"send",value:function(e,t){return this.commandSender(k(k({},this.getScopeOptions()),{},{type:e,data:t}))}}]),r}(g.default),(0,m.default)(l,"connectionRequired",j),c=l,(0,b.default)(c.prototype,"addCommandListener",[o],Object.getOwnPropertyDescriptor(c.prototype,"addCommandListener"),c.prototype),(0,b.default)(c.prototype,"removeCommandListeners",[s],Object.getOwnPropertyDescriptor(c.prototype,"removeCommandListeners"),c.prototype),(0,b.default)(c.prototype,"addUserStatusListener",[i],Object.getOwnPropertyDescriptor(c.prototype,"addUserStatusListener"),c.prototype),(0,b.default)(c.prototype,"removeUserStatusListeners",[a],Object.getOwnPropertyDescriptor(c.prototype,"removeUserStatusListeners"),c.prototype),(0,b.default)(c.prototype,"send",[u],Object.getOwnPropertyDescriptor(c.prototype,"send"),c.prototype),c);function j(e){return function(t,r,n){var o=n.value;return n.value=function(){var t=arguments,r=this,n=function(){return o.apply(r,t)};return this.isConnected()?n():e?new Promise((function(e,t){return r.waitConnection.push((function(){return n().then(e,t)}))})):(this.waitConnection.push(n),this)},n}}t.default=x},"./src/session.js":(e,t,r)=>{"use strict";var n=r("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r("./node_modules/@babel/runtime/helpers/classCallCheck.js")),s=n(r("./node_modules/@babel/runtime/helpers/createClass.js")),i=r("./src/constants.js"),a=n(r("./src/socket.js")),u=function(){function e(t,r,n){(0,o.default)(this,e),this.config=t,this.dispatch=r,this.onDisconnect=n,this.connectAttempt=0,this.socketPromise=this.connect()}return(0,s.default)(e,[{key:"terminate",value:function(){this.terminated||(this.terminated=!0,this.dispatch=function(){},this.socketPromise.then((function(e){e&&e.close()})))}},{key:"getSocket",value:function(){var e=this;return this.socketPromise.then((function(t){return e.terminated?new Promise((function(){})):t}))}},{key:"connect",value:function(){var e=this;if(!this.terminated){this.connectAttempt=this.connectAttempt+1;var t=this.getNextReconnectionTimeout();return this.onConnecting(),this.connectAttempt>1&&this.onReconnectAttempt(this.connectAttempt-1,t),a.default.connect(this.config,this.onSocketDisconnect.bind(this)).then((function(t){return e.connectAttempt=0,e.onConnect(),t})).catch((function(r){if(e.onConnectError(r),!e.terminated)return(n=t,new Promise((function(e){return setTimeout(e,n)}))).then((function(){return e.connect()}));var n}))}}},{key:"getNextReconnectionTimeout",value:function(){var e=Math.ceil(this.connectAttempt/10),t=200*Math.pow(2,e);return Math.min(t,6e4)}},{key:"onSocketDisconnect",value:function(e){this.dispatch(i.NativeSocketEvents.DISCONNECT,e),this.terminated||(this.terminate(),this.onDisconnect())}},{key:"onConnecting",value:function(){this.dispatch(i.NativeSocketEvents.CONNECTING)}},{key:"onConnect",value:function(){this.dispatch(i.NativeSocketEvents.CONNECT)}},{key:"onConnectError",value:function(e){this.dispatch(i.NativeSocketEvents.CONNECT_ERROR,e&&e.message||e)}},{key:"onReconnectAttempt",value:function(e,t){this.dispatch(i.NativeSocketEvents.RECONNECT_ATTEMPT,e,t)}}]),e}();t.default=u},"./src/socket-parser.js":(e,t,r)=>{"use strict";var n=r("./node_modules/component-emitter/index.js");function o(){}function s(e){var r=""+e.type;return t.BINARY_EVENT!==e.type&&t.BINARY_ACK!==e.type||(r+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(r+=e.nsp+","),null!=e.id&&(r+=e.id),null!=e.data&&(r+=JSON.stringify(e.data)),r}function i(){}function a(){return{type:t.ERROR,data:"parser error"}}t.protocol=4,t.types=["CONNECT","DISCONNECT","EVENT","ACK","ERROR","BINARY_EVENT","BINARY_ACK"],t.CONNECT=0,t.DISCONNECT=1,t.EVENT=2,t.ACK=3,t.ERROR=4,t.BINARY_EVENT=5,t.BINARY_ACK=6,t.Encoder=o,t.Decoder=i,o.prototype.encode=function(e,t){t([s(e)])},n(i.prototype),i.prototype.add=function(e){if("string"!=typeof e)throw new Error("Unknown type: "+e);this.emit("decoded",function(e){var r=0,n={type:Number(e.charAt(0))};if(null==t.types[n.type])return a();if(t.BINARY_EVENT===n.type||t.BINARY_ACK===n.type){for(var o="";"-"!==e.charAt(++r)&&(o+=e.charAt(r),r!=e.length););if(o!=Number(o)||"-"!==e.charAt(r))throw new Error("Illegal attachments");n.attachments=Number(o)}if("/"===e.charAt(r+1))for(n.nsp="";++r&&","!==(i=e.charAt(r))&&(n.nsp+=i,r!==e.length););else n.nsp="/";var s=e.charAt(r+1);if(""!==s&&Number(s)==s){for(n.id="";++r;){var i;if(null==(i=e.charAt(r))||Number(i)!=i){--r;break}if(n.id+=e.charAt(r),r===e.length)break}n.id=Number(n.id)}return e.charAt(++r)&&(n=function(e,t){try{e.data=JSON.parse(t)}catch(e){return a()}return e}(n,e.substr(r))),n}(e))},i.prototype.destroy=function(){}},"./src/socket.js":(e,t,r)=>{"use strict";var n=r("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r("./node_modules/@babel/runtime/helpers/classCallCheck.js")),s=n(r("./node_modules/@babel/runtime/helpers/createClass.js")),i=r("./src/constants.js"),a=function(){function e(t,n){(0,o.default)(this,e);var s=r("./node_modules/socket.io-client/lib/index.js");this.config=t,this.events={};var i=t.getSocketConfig(),a=i.url,u=i.options;this.ioSocket=s(a,u)}return(0,s.default)(e,[{key:"connect",value:function(){this.ioSocket.connect()}},{key:"close",value:function(){this.log("log","close socket"),this.events={},this.ioSocket.off(),this.ioSocket.close()}},{key:"on",value:function(e,t){var r=this;this.events[e]||this.ioSocket.on(e,(function(t){return r.onEvent(e,t)})),this.events[e]=this.events[e]||[],this.events[e].push(t)}},{key:"off",value:function(e,t){this.events[e]=t?this.events[e].filter((function(e){return e!==t})):[],this.events[e].length||delete this.events[e],this.events[e]||this.ioSocket.off(e)}},{key:"onEvent",value:function(e,t){this.logMessage("FROM SERVER",e,t),this.events[e]&&this.events[e].forEach((function(e){return e(t)}))}},{key:"emit",value:function(e,t){this.logMessage("TO SERVER",e,t),this.ioSocket.emit(e,t)}},{key:"log",value:function(e){if(this.config.debugMode){for(var t,r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];(t=console)[e].apply(t,["[RT Client]:"].concat(n))}}},{key:"logMessage",value:function(e,t,r){this.log("log","[".concat(e,"] - [event: ").concat(t,"] - arguments: ").concat(JSON.stringify(r)," "))}}],[{key:"connect",value:function(t,r){return Promise.resolve().then((function(){return t.prepare()})).then((function(){return new Promise((function(r,n){var o=new e(t);function s(e){o.log("error","received one of [CONNECT_ERROR,CONNECT_TIMEOUT] socket event while connecting",e),a(e)}function a(e){o.log("log","close and reject socket with error:",e),o.close(),n(e)}o.on(i.NativeSocketEvents.CONNECT,(function(){o.log("log","socket connected"),r(o)})),o.on(i.NativeSocketEvents.CONNECT_ERROR,s),o.on(i.NativeSocketEvents.CONNECT_TIMEOUT,s),o.on(i.NativeSocketEvents.ERROR,(function(e){o.log("error","received ERROR event while connecting",e),a(e)})),o.connect()}))})).then((function(e){return e.on(i.NativeSocketEvents.DISCONNECT,r),e.on(i.NativeSocketEvents.ERROR,r),e}))}}]),e}();t.default=a},"./src/subscriptions.js":(e,t,r)=>{"use strict";var n=r("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r("./node_modules/@babel/runtime/helpers/classCallCheck.js")),s=n(r("./node_modules/@babel/runtime/helpers/createClass.js")),i=n(r("./node_modules/@babel/runtime/helpers/defineProperty.js")),a=r("./src/constants.js"),u=n(r("./src/utils.js")),c=function(e){return function(t,r){return this.subscribe(e,t,r)}},l=function(){function e(t){var r=t.onMessage,n=t.emitMessage;(0,o.default)(this,e),(0,i.default)(this,"onObjectsChanges",c(a.RTSubscriptionTypes.OBJECTS_CHANGES).bind(this)),(0,i.default)(this,"onRelationsChanges",c(a.RTSubscriptionTypes.RELATIONS_CHANGES).bind(this)),(0,i.default)(this,"connectToPubSub",c(a.RTSubscriptionTypes.PUB_SUB_CONNECT).bind(this)),(0,i.default)(this,"onPubSubMessage",c(a.RTSubscriptionTypes.PUB_SUB_MESSAGES).bind(this)),(0,i.default)(this,"onPubSubCommand",c(a.RTSubscriptionTypes.PUB_SUB_COMMANDS).bind(this)),(0,i.default)(this,"onPubSubUserStatus",c(a.RTSubscriptionTypes.PUB_SUB_USERS).bind(this)),(0,i.default)(this,"connectToRSO",c(a.RTSubscriptionTypes.RSO_CONNECT).bind(this)),(0,i.default)(this,"onRSOChanges",c(a.RTSubscriptionTypes.RSO_CHANGES).bind(this)),(0,i.default)(this,"onRSOClear",c(a.RTSubscriptionTypes.RSO_CLEARED).bind(this)),(0,i.default)(this,"onRSOCommand",c(a.RTSubscriptionTypes.RSO_COMMANDS).bind(this)),(0,i.default)(this,"onRSOInvoke",c(a.RTSubscriptionTypes.RSO_INVOKE).bind(this)),(0,i.default)(this,"onRSOUserStatus",c(a.RTSubscriptionTypes.RSO_USERS).bind(this)),(0,i.default)(this,"onLoggingMessages",c(a.RTSubscriptionTypes.LOGGING_MESSAGES).bind(this)),(0,i.default)(this,"onConsoleMessages",c(a.RTSubscriptionTypes.CONSOLE_MESSAGES).bind(this)),(0,i.default)(this,"onDeveloperMessage",c(a.RTSubscriptionTypes.DEVELOPER_MESSAGES).bind(this)),this.onMessage=r,this.emitMessage=n,this.subscriptions={}}return(0,s.default)(e,[{key:"initialize",value:function(){var e=this;this.onMessage(a.RTSocketEvents.SUB_READY,(function(t){return e.onSubscriptionReady(t)})),this.onMessage(a.RTSocketEvents.SUB_RES,(function(t){return e.onSubscriptionResponse(t)}))}},{key:"stop",value:function(){var e=this;Object.keys(this.subscriptions).forEach((function(t){e.subscriptions[t].ready=!1}))}},{key:"reset",value:function(){var e=this;Object.keys(this.subscriptions).forEach((function(t){return e.stopSubscription(t)}))}},{key:"restore",value:function(){var e=this;Object.keys(this.subscriptions).forEach((function(t){e.startSubscription(t)}))}},{key:"hasActivity",value:function(){return!!Object.keys(this.subscriptions).length}},{key:"subscribe",value:function(e,t,r){var n=this,o=r.parser,s=r.onData,i=r.onError,a=r.onStop,c=r.onReady,l=u.default.generateUID();return this.subscriptions[l]={data:{id:l,name:e,options:t},ready:!1,parser:o,onData:s,onError:i,onStop:a,onReady:c},this.startSubscription(l),{isReady:function(){return!!n.subscriptions[l]&&n.subscriptions[l].ready},stop:function(){n.subscriptions[l]&&n.offSubscription(l)}}}},{key:"startSubscription",value:function(e){var t=this.subscriptions[e];this.emitMessage(a.RTSocketEvents.SUB_ON,t.data)}},{key:"stopSubscription",value:function(e){var t=this.subscriptions[e];t&&(t.onStop&&t.onStop(),delete this.subscriptions[e])}},{key:"offSubscription",value:function(e){this.subscriptions[e]&&(this.emitMessage(a.RTSocketEvents.SUB_OFF,{id:e}),this.stopSubscription(e))}},{key:"onSubscriptionReady",value:function(e){var t=e.id,r=this.subscriptions[t];r&&!r.ready&&(r.ready=!0,r.onReady&&r.onReady())}},{key:"onSubscriptionResponse",value:function(e){var t=e.id,r=e.data,n=e.error,o=this.subscriptions[t];o&&(n?(o.onError&&o.onError(n),this.stopSubscription(t)):(o.ready||(o.ready=!0,o.onReady&&o.onReady()),o.onData&&("function"==typeof o.parser&&(r=o.parser(r)),o.onData(r))))}}]),e}();t.default=l},"./src/utils.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n={generateUID:function(){for(var e="",t=0;t<8;t++)e+=r.charAt(Math.floor(Math.random()*r.length));return e+Date.now()}};t.default=n},"./node_modules/backendless-request/dist/backendless-request.js":function(e,t){var s;"undefined"!=typeof self&&self,s=function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=3)}([function(e,t,r){"use strict";function n(e){return(n="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})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.isStream=t.isObject=t.isFormData=t.castArray=void 0,t.castArray=function(e){return Array.isArray(e)?e:[e]},t.isObject=function(e){return null!=e&&"object"===n(e)},t.isFormData=function(e){return e&&e.constructor&&0===e.constructor.toString().trim().indexOf("function FormData")},t.isStream=function(e){return e instanceof r(5).Stream}},function(e,t){throw new Error('This Backendless JS SDK assembly is not intended for Node.js environment. You should use "lib" folder modules instead. For any questions please contact as at http://support.backendless.com/')},function(e,t,r){"use strict";function n(e){return(n="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})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.Request=void 0;var o,s=r(10),i=(o=r(11))&&o.__esModule?o:{default:o},a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var r=l(t);if(r&&r.has(e))return r.get(e);var o={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var a=s?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(o,i,a):o[i]=e[i]}return o.default=e,r&&r.set(e,o),o}(r(12)),u=r(0),c=r(13);function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(l=function(e){return e?r:t})(e)}function f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function p(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?f(Object(r),!0).forEach((function(t){d(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function d(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function h(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function y(e,t){return(y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function v(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=b(e);if(t){var o=b(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return m(this,r)}}function m(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function b(e){return(b=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var g=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&y(e,t)}(i,e);var t,r,n,o=v(i);function i(e,t,r){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(n=o.call(this)).method=t,n.path=e,n.body=r,n.tags=void 0,n.unwrap=!0,n.cacheTTL=0,n.headers={},n.queryParams={},n.encoding="utf8",n.timeout=0,n}return t=i,(r=[{key:"set",value:function(e,t){if((0,u.isObject)(e))for(var r in e)this.set(r,e[r]);else void 0!==t&&(this.headers[e]=t);return this}},{key:"cacheTags",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.tags=t,this}},{key:"query",value:function(e){return Object.assign(this.queryParams,e),this}},{key:"form",value:function(e){var t=this;if(e){var r=i.FormData;e instanceof r?this.body=e:function(){var n=new r,o=function(t){t&&(0,u.castArray)(e[t]).forEach((function(e){e&&e.hasOwnProperty("value")&&e.hasOwnProperty("options")?n.append(t,e.value,e.options):n.append(t,e)}))};for(var s in e)o(s);t.body=n}()}return this}},{key:"useCache",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15e3;return this.cacheTTL=e,this}},{key:"resetCache",value:function(e){return e&&this.tags&&s.cache.deleteByTags(this.tags),this}},{key:"type",value:function(e){return this.set("Content-Type",e),this}},{key:"unwrapBody",value:function(e){return this.unwrap=e,this}},{key:"setEncoding",value:function(e){return this.encoding=e,this}},{key:"setTimeout",value:function(e){return this.timeout=e,this}},{key:"send",value:function(e){var t=this;this.emit("request",this);var r=this.path,n=a.stringify(this.queryParams);if(n&&(r+="?"+n),this.cacheTTL){var o=s.cache.get(r);if(void 0!==o)return Promise.resolve(o)}this.headers["Content-Type"]||!(0,u.isObject)(e)||(0,u.isFormData)(e)||this.type("application/json"),e&&(e="application/json"===this.headers["Content-Type"]&&"string"!=typeof e?JSON.stringify(e):e),i.verbose&&console.log(this.method.toUpperCase(),decodeURIComponent(r),e,this.headers);var c=i.send(r,this.method.toUpperCase(),this.headers,e,this.encoding,this.timeout).then(w).then(k).then((function(e){return t.unwrap?e.body:e})).then((function(e){return t.cacheTTL&&s.cache.set(r,e,t.tags,t.cacheTTL),e})).then((function(e){return t.tags&&"get"!==t.method&&s.cache.deleteByTags(t.tags),e}));return c.then((function(e){t.emit("response",e),t.emit("done",null,e)})).catch((function(e){t.emit("error",e),t.emit("done",e)})),c}},{key:"then",value:function(e,t){return this.promise=this.promise||this.send(this.body),this.promise.then(e,t)}},{key:"catch",value:function(e){return this.promise=this.promise||this.send(this.body),this.promise.catch(e)}}])&&h(t.prototype,r),n&&h(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(i.default);function w(e){try{return p(p({},e),{},{body:JSON.parse(e.body)})}catch(t){return e}}function k(e){if(e.status>=200&&e.status<300)return e;throw new c.ResponseError(e)}t.Request=g},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(4),o=r(9),s=r(2);Object.defineProperty(s.Request,"FormData",{get:function(){return"undefined"!=typeof FormData?FormData:r(14)}}),s.Request.XMLHttpRequest="undefined"!=typeof XMLHttpRequest?XMLHttpRequest:void 0,s.Request.send=function(e,t,r,i,a,u){return(void 0!==s.Request.XMLHttpRequest?o.sendXmlHttpRequest:n.sendNodeAPIRequest)(e,t,r,i,a,u)},s.Request.verbose=!1,s.Request.methods=["get","post","put","patch","delete"],s.Request.methods.forEach((function(e){s.Request[e]=function(t,r){return new s.Request(t,e,r)}})),t=e.exports=s.Request;var i=s.Request;t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sendNodeAPIRequest=function(e,t,o,s,i,a){return new Promise((function(u,c){var l=r(6).parse(e),f=(0,n.isFormData)(s)&&s,p="https:"===l.protocol,d={host:l.hostname,port:l.port||(p?443:80),path:l.pathname+(l.search||""),method:t,headers:o,timeout:a},h=function(){var e=r(1).Buffer,t=r(p?7:8).request(d,(function(t){var r=[],n=[],o=0,s="",a=t.statusCode,l=t.statusMessage,f=t.headers;t.on("data",(function(t){e.isBuffer(t)?t.length&&(o+=t.length,n.push(t)):r.push(t)})),t.on("end",(function(){o?(s=e.concat(n,o),null!=i&&(s=s.toString(i))):r.length&&(s=r.join()),u({status:a,statusText:l,headers:f,body:s})})),t.on("error",c)}));if(t.on("error",c),t.on("timeout",(function(){t.destroy(new Error("Connection aborted due to timeout"))})),s){if((0,n.isStream)(s))return void s.pipe(t);t.write(s)}t.end()};if(f)Object.assign(d.headers,f.getHeaders()),f.getLength((function(e,t){e||isNaN(t)||(d.headers["content-length"]=t),h()}));else{if(s&&!d.headers["content-length"]){var y=r(1).Buffer;d.headers["content-length"]=y.byteLength(s)}h()}}))};var n=r(0)},function(e,t){throw new Error('This Backendless JS SDK assembly is not intended for Node.js environment. You should use "lib" folder modules instead. For any questions please contact as at http://support.backendless.com/')},function(e,t){throw new Error('This Backendless JS SDK assembly is not intended for Node.js environment. You should use "lib" folder modules instead. For any questions please contact as at http://support.backendless.com/')},function(e,t){throw new Error('This Backendless JS SDK assembly is not intended for Node.js environment. You should use "lib" folder modules instead. For any questions please contact as at http://support.backendless.com/')},function(e,t){throw new Error('This Backendless JS SDK assembly is not intended for Node.js environment. You should use "lib" folder modules instead. For any questions please contact as at http://support.backendless.com/')},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sendXmlHttpRequest=function(e,t,r,o,s,i){return new Promise((function(a,u){var c=new n.Request.XMLHttpRequest;c.timeout=i,s||(c.responseType="arraybuffer"),c.open(t.toUpperCase(),e,!0),c.onload=function(){var e,t,r=(e=c.getAllResponseHeaders(),t={},e?(e.split("\n").forEach((function(e){var r=e.indexOf(":"),n=e.substr(0,r).trim(),o=e.substr(r+1).trim();n&&(t[n]=t[n]?t[n]+", "+o:o)})),t):t),n=c,o={status:n.status,statusText:n.statusText,headers:r};"utf8"===s?o.body=c.response||c.responseText:c.response&&(o.body=new Uint8Array(c.response)),a(o),c=null},c.onerror=function(){u(new Error("Network Error")),c=null},c.ontimeout=function(){u(new Error("Connection aborted due to timeout")),c=null},Object.keys(r).forEach((function(e){c.setRequestHeader(e,r[e])})),c.send(o)}))};var n=r(2)},function(e,t,r){"use strict";function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,s=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(s.push(n.value),!t||s.length!==t);i=!0);}catch(e){a=!0,o=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw o}}return s}}(e,t)||s(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=s(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function s(e,t){if(e){if("string"==typeof e)return i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,t):void 0}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}Object.defineProperty(t,"__esModule",{value:!0}),t.cache=void 0;var u=function(){return(new Date).getTime()},c=function(e,t){return!!e.find((function(e){return t.find((function(t){return function(e,t){var r=e==t;return!r&&e instanceof RegExp&&(r=e.test(t)),!r&&t instanceof RegExp&&(r=t.test(e)),r}(e,t)}))}))},l=new(function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.setFlushInterval(t),this.map=new Map}var t,r,s;return t=e,(r=[{key:"setFlushInterval",value:function(e){this.flushInterval=e,this.flushTimer&&(clearInterval(this.flushTimer),delete this.flushTimer)}},{key:"get",value:function(e){var t=this.map.get(e);if(t){if(t.ttl>u())return t.value;this.map.delete(e)}}},{key:"set",value:function(e,t,r,n){this.map.set(e,function(e,t,r){return{value:e,tags:t,ttl:r}}(t,r,u()+n)),this.flushInterval&&!this.flushTimer&&(this.flushTimer=setInterval(this.flush.bind(this),this.flushInterval),this.flushTimer.unref&&this.flushTimer.unref())}},{key:"delete",value:function(e){this.map.delete(e)}},{key:"deleteAll",value:function(){var e,t=o(this.map);try{for(t.s();!(e=t.n()).done;){var r=n(e.value,1)[0];this.delete(r)}}catch(e){t.e(e)}finally{t.f()}}},{key:"deleteByTags",value:function(e){var t,r=o(this.map);try{for(r.s();!(t=r.n()).done;){var s=n(t.value,2),i=s[0],a=s[1];a.tags&&c(e,a.tags)&&this.delete(i)}}catch(e){r.e(e)}finally{r.f()}}},{key:"flush",value:function(){var e,t=u(),r=o(this.map);try{for(r.s();!(e=r.n()).done;){var s=n(e.value,2),i=s[0];s[1].ttl<t&&this.delete(i)}}catch(e){r.e(e)}finally{r.f()}}}])&&a(t.prototype,r),s&&a(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}())(6e4);t.cache=l},function(e,t,r){"use strict";function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.events={}}var t,r,o;return t=e,(r=[{key:"on",value:function(e,t){return this.events[e]=this.events[e]||[],this.events[e].push(t),this}},{key:"off",value:function(e,t){return e?this.events[e]&&(t?this.events[e]=this.events[e].filter((function(e){return e!==t})):delete this.events[e]):this.events={},this}},{key:"emit",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];this.events[e]&&this.events[e].forEach((function(e){return e.apply(void 0,r)}))}}])&&n(t.prototype,r),o&&n(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stringify=void 0;var n=r(0);t.stringify=function(e){var t=[];return Object.keys(e).forEach((function(r){var o=e[r];void 0!==o&&(0,n.castArray)(o).forEach((function(e){t.push("".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(e)))}))})),t.join("&")}},function(e,t,r){"use strict";function n(e){return(n="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})(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function s(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function i(e){var t="function"==typeof Map?new Map:void 0;return(i=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return a(e,arguments,l(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),c(n,e)})(e)}function a(e,t,r){return(a=u()?Reflect.construct.bind():function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&c(o,r.prototype),o}).apply(null,arguments)}function u(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function c(e,t){return(c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.ResponseError=void 0;var f=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&c(e,t)}(p,e);var t,r,n,i,a,f=(t=p,r=u(),function(){var e,n=l(t);if(r){var o=l(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return s(this,e)});function p(e){var t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,p),t=f.call(this);var r,n=502===(r=e).status?"No connection with server":r.body||"Status Code ".concat(r.status," (").concat(r.statusText,")");return t.message=n.message||n,t.code=n.code,t.status=e.status,t.headers=e.headers,t.body=e.body,t}return n=p,i&&o(n.prototype,i),a&&o(n,a),Object.defineProperty(n,"prototype",{writable:!1}),n}(i(Error));t.ResponseError=f},function(e,t){throw new Error('This Backendless JS SDK assembly is not intended for Node.js environment. You should use "lib" folder modules instead. For any questions please contact as at http://support.backendless.com/')}])},"object"==typeof t&&"object"==typeof e?e.exports=s():(n=[],void 0===(o="function"==typeof(r=s)?r.apply(t,n):r)||(e.exports=o))},"./node_modules/backo2/index.js":e=>{function t(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}e.exports=t,t.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),r=Math.floor(t*this.jitter*e);e=0==(1&Math.floor(10*t))?e-r:e+r}return 0|Math.min(e,this.max)},t.prototype.reset=function(){this.attempts=0},t.prototype.setMin=function(e){this.ms=e},t.prototype.setMax=function(e){this.max=e},t.prototype.setJitter=function(e){this.jitter=e}},"./node_modules/base64-arraybuffer/lib/base64-arraybuffer.js":(e,t)=>{!function(){"use strict";for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=new Uint8Array(256),n=0;n<e.length;n++)r[e.charCodeAt(n)]=n;t.encode=function(t){var r,n=new Uint8Array(t),o=n.length,s="";for(r=0;r<o;r+=3)s+=e[n[r]>>2],s+=e[(3&n[r])<<4|n[r+1]>>4],s+=e[(15&n[r+1])<<2|n[r+2]>>6],s+=e[63&n[r+2]];return o%3==2?s=s.substring(0,s.length-1)+"=":o%3==1&&(s=s.substring(0,s.length-2)+"=="),s},t.decode=function(e){var t,n,o,s,i,a=.75*e.length,u=e.length,c=0;"="===e[e.length-1]&&(a--,"="===e[e.length-2]&&a--);var l=new ArrayBuffer(a),f=new Uint8Array(l);for(t=0;t<u;t+=4)n=r[e.charCodeAt(t)],o=r[e.charCodeAt(t+1)],s=r[e.charCodeAt(t+2)],i=r[e.charCodeAt(t+3)],f[c++]=n<<2|o>>4,f[c++]=(15&o)<<4|s>>2,f[c++]=(3&s)<<6|63&i;return l}}()},"./node_modules/blob/index.js":(e,t,r)=>{var n=r.g.BlobBuilder||r.g.WebKitBlobBuilder||r.g.MSBlobBuilder||r.g.MozBlobBuilder,o=function(){try{return 2===new Blob(["hi"]).size}catch(e){return!1}}(),s=o&&function(){try{return 2===new Blob([new Uint8Array([1,2])]).size}catch(e){return!1}}(),i=n&&n.prototype.append&&n.prototype.getBlob;function a(e){for(var t=0;t<e.length;t++){var r=e[t];if(r.buffer instanceof ArrayBuffer){var n=r.buffer;if(r.byteLength!==n.byteLength){var o=new Uint8Array(r.byteLength);o.set(new Uint8Array(n,r.byteOffset,r.byteLength)),n=o.buffer}e[t]=n}}}function u(e,t){t=t||{};var r=new n;a(e);for(var o=0;o<e.length;o++)r.append(e[o]);return t.type?r.getBlob(t.type):r.getBlob()}function c(e,t){return a(e),new Blob(e,t||{})}e.exports=o?s?r.g.Blob:c:i?u:void 0},"./node_modules/component-bind/index.js":e=>{var t=[].slice;e.exports=function(e,r){if("string"==typeof r&&(r=e[r]),"function"!=typeof r)throw new Error("bind() requires a function");var n=t.call(arguments,2);return function(){return r.apply(e,n.concat(t.call(arguments)))}}},"./node_modules/component-emitter/index.js":e=>{function t(e){if(e)return function(e){for(var r in t.prototype)e[r]=t.prototype[r];return e}(e)}e.exports=t,t.prototype.on=t.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},t.prototype.once=function(e,t){function r(){this.off(e,r),t.apply(this,arguments)}return r.fn=t,this.on(e,r),this},t.prototype.off=t.prototype.removeListener=t.prototype.removeAllListeners=t.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,n=this._callbacks["$"+e];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var o=0;o<n.length;o++)if((r=n[o])===t||r.fn===t){n.splice(o,1);break}return this},t.prototype.emit=function(e){this._callbacks=this._callbacks||{};var t=[].slice.call(arguments,1),r=this._callbacks["$"+e];if(r)for(var n=0,o=(r=r.slice(0)).length;n<o;++n)r[n].apply(this,t);return this},t.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},t.prototype.hasListeners=function(e){return!!this.listeners(e).length}},"./node_modules/component-inherit/index.js":e=>{e.exports=function(e,t){var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},"./node_modules/debug/src/browser.js":(e,t,r)=>{function n(){var e;try{e=t.storage.debug}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e}(t=e.exports=r("./node_modules/debug/src/debug.js")).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},t.formatArgs=function(e){var r=this.useColors;if(e[0]=(r?"%c":"")+this.namespace+(r?" %c":" ")+e[0]+(r?"%c ":" ")+"+"+t.humanize(this.diff),r){var n="color: "+this.color;e.splice(1,0,n,"color: inherit");var o=0,s=0;e[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(o++,"%c"===e&&(s=o))})),e.splice(s,0,n)}},t.save=function(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(e){}},t.load=n,t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},t.enable(n())},"./node_modules/debug/src/debug.js":(e,t,r)=>{var n;function o(e){function r(){if(r.enabled){var e=r,o=+new Date,s=o-(n||o);e.diff=s,e.prev=n,e.curr=o,n=o;for(var i=new Array(arguments.length),a=0;a<i.length;a++)i[a]=arguments[a];i[0]=t.coerce(i[0]),"string"!=typeof i[0]&&i.unshift("%O");var u=0;i[0]=i[0].replace(/%([a-zA-Z%])/g,(function(r,n){if("%%"===r)return r;u++;var o=t.formatters[n];if("function"==typeof o){var s=i[u];r=o.call(e,s),i.splice(u,1),u--}return r})),t.formatArgs.call(e,i);var c=r.log||t.log||console.log.bind(console);c.apply(e,i)}}return r.namespace=e,r.enabled=t.enabled(e),r.useColors=t.useColors(),r.color=function(e){var r,n=0;for(r in e)n=(n<<5)-n+e.charCodeAt(r),n|=0;return t.colors[Math.abs(n)%t.colors.length]}(e),"function"==typeof t.init&&t.init(r),r}(t=e.exports=o.debug=o.default=o).coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){t.enable("")},t.enable=function(e){t.save(e),t.names=[],t.skips=[];for(var r=("string"==typeof e?e:"").split(/[\s,]+/),n=r.length,o=0;o<n;o++)r[o]&&("-"===(e=r[o].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){var r,n;for(r=0,n=t.skips.length;r<n;r++)if(t.skips[r].test(e))return!1;for(r=0,n=t.names.length;r<n;r++)if(t.names[r].test(e))return!0;return!1},t.humanize=r("./node_modules/ms/index.js"),t.names=[],t.skips=[],t.formatters={}},"./node_modules/engine.io-client/lib/index.js":(e,t,r)=>{e.exports=r("./node_modules/engine.io-client/lib/socket.js"),e.exports.parser=r("./node_modules/engine.io-parser/lib/browser.js")},"./node_modules/engine.io-client/lib/socket.js":(e,t,r)=>{var n=r("./node_modules/engine.io-client/lib/transports/index.js"),o=r("./node_modules/component-emitter/index.js"),s=r("./node_modules/debug/src/browser.js")("engine.io-client:socket"),i=r("./node_modules/indexof/index.js"),a=r("./node_modules/engine.io-parser/lib/browser.js"),u=r("./node_modules/parseuri/index.js"),c=r("./node_modules/parseqs/index.js");function l(e,t){if(!(this instanceof l))return new l(e,t);t=t||{},e&&"object"==typeof e&&(t=e,e=null),e?(e=u(e),t.hostname=e.host,t.secure="https"===e.protocol||"wss"===e.protocol,t.port=e.port,e.query&&(t.query=e.query)):t.host&&(t.hostname=u(t.host).host),this.secure=null!=t.secure?t.secure:r.g.location&&"https:"===location.protocol,t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.agent=t.agent||!1,this.hostname=t.hostname||(r.g.location?location.hostname:"localhost"),this.port=t.port||(r.g.location&&location.port?location.port:this.secure?443:80),this.query=t.query||{},"string"==typeof this.query&&(this.query=c.decode(this.query)),this.upgrade=!1!==t.upgrade,this.path=(t.path||"/engine.io").replace(/\/$/,"")+"/",this.forceJSONP=!!t.forceJSONP,this.jsonp=!1!==t.jsonp,this.forceBase64=!!t.forceBase64,this.enablesXDR=!!t.enablesXDR,this.timestampParam=t.timestampParam||"t",this.timestampRequests=t.timestampRequests,this.transports=t.transports||["polling","websocket"],this.transportOptions=t.transportOptions||{},this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.policyPort=t.policyPort||843,this.rememberUpgrade=t.rememberUpgrade||!1,this.binaryType=null,this.onlyBinaryUpgrades=t.onlyBinaryUpgrades,this.perMessageDeflate=!1!==t.perMessageDeflate&&(t.perMessageDeflate||{}),!0===this.perMessageDeflate&&(this.perMessageDeflate={}),this.perMessageDeflate&&null==this.perMessageDeflate.threshold&&(this.perMessageDeflate.threshold=1024),this.pfx=t.pfx||null,this.key=t.key||null,this.passphrase=t.passphrase||null,this.cert=t.cert||null,this.ca=t.ca||null,this.ciphers=t.ciphers||null,this.rejectUnauthorized=void 0===t.rejectUnauthorized||t.rejectUnauthorized,this.forceNode=!!t.forceNode;var n="object"==typeof r.g&&r.g;n.global===n&&(t.extraHeaders&&Object.keys(t.extraHeaders).length>0&&(this.extraHeaders=t.extraHeaders),t.localAddress&&(this.localAddress=t.localAddress)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingIntervalTimer=null,this.pingTimeoutTimer=null,this.open()}e.exports=l,l.priorWebsocketSuccess=!1,o(l.prototype),l.protocol=a.protocol,l.Socket=l,l.Transport=r("./node_modules/engine.io-client/lib/transport.js"),l.transports=r("./node_modules/engine.io-client/lib/transports/index.js"),l.parser=r("./node_modules/engine.io-parser/lib/browser.js"),l.prototype.createTransport=function(e){s('creating transport "%s"',e);var t=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t}(this.query);t.EIO=a.protocol,t.transport=e;var r=this.transportOptions[e]||{};return this.id&&(t.sid=this.id),new n[e]({query:t,socket:this,agent:r.agent||this.agent,hostname:r.hostname||this.hostname,port:r.port||this.port,secure:r.secure||this.secure,path:r.path||this.path,forceJSONP:r.forceJSONP||this.forceJSONP,jsonp:r.jsonp||this.jsonp,forceBase64:r.forceBase64||this.forceBase64,enablesXDR:r.enablesXDR||this.enablesXDR,timestampRequests:r.timestampRequests||this.timestampRequests,timestampParam:r.timestampParam||this.timestampParam,policyPort:r.policyPort||this.policyPort,pfx:r.pfx||this.pfx,key:r.key||this.key,passphrase:r.passphrase||this.passphrase,cert:r.cert||this.cert,ca:r.ca||this.ca,ciphers:r.ciphers||this.ciphers,rejectUnauthorized:r.rejectUnauthorized||this.rejectUnauthorized,perMessageDeflate:r.perMessageDeflate||this.perMessageDeflate,extraHeaders:r.extraHeaders||this.extraHeaders,forceNode:r.forceNode||this.forceNode,localAddress:r.localAddress||this.localAddress,requestTimeout:r.requestTimeout||this.requestTimeout,protocols:r.protocols||void 0})},l.prototype.open=function(){var e;if(this.rememberUpgrade&&l.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))e="websocket";else{if(0===this.transports.length){var t=this;return void setTimeout((function(){t.emit("error","No transports available")}),0)}e=this.transports[0]}this.readyState="opening";try{e=this.createTransport(e)}catch(e){return this.transports.shift(),void this.open()}e.open(),this.setTransport(e)},l.prototype.setTransport=function(e){s("setting transport %s",e.name);var t=this;this.transport&&(s("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=e,e.on("drain",(function(){t.onDrain()})).on("packet",(function(e){t.onPacket(e)})).on("error",(function(e){t.onError(e)})).on("close",(function(){t.onClose("transport close")}))},l.prototype.probe=function(e){s('probing transport "%s"',e);var t=this.createTransport(e,{probe:1}),r=!1,n=this;function o(){if(n.onlyBinaryUpgrades){var o=!this.supportsBinary&&n.transport.supportsBinary;r=r||o}r||(s('probe transport "%s" opened',e),t.send([{type:"ping",data:"probe"}]),t.once("packet",(function(o){if(!r)if("pong"===o.type&&"probe"===o.data){if(s('probe transport "%s" pong',e),n.upgrading=!0,n.emit("upgrading",t),!t)return;l.priorWebsocketSuccess="websocket"===t.name,s('pausing current transport "%s"',n.transport.name),n.transport.pause((function(){r||"closed"!==n.readyState&&(s("changing transport and sending upgrade packet"),p(),n.setTransport(t),t.send([{type:"upgrade"}]),n.emit("upgrade",t),t=null,n.upgrading=!1,n.flush())}))}else{s('probe transport "%s" failed',e);var i=new Error("probe error");i.transport=t.name,n.emit("upgradeError",i)}})))}function i(){r||(r=!0,p(),t.close(),t=null)}function a(r){var o=new Error("probe error: "+r);o.transport=t.name,i(),s('probe transport "%s" failed because of error: %s',e,r),n.emit("upgradeError",o)}function u(){a("transport closed")}function c(){a("socket closed")}function f(e){t&&e.name!==t.name&&(s('"%s" works - aborting "%s"',e.name,t.name),i())}function p(){t.removeListener("open",o),t.removeListener("error",a),t.removeListener("close",u),n.removeListener("close",c),n.removeListener("upgrading",f)}l.priorWebsocketSuccess=!1,t.once("open",o),t.once("error",a),t.once("close",u),this.once("close",c),this.once("upgrading",f),t.open()},l.prototype.onOpen=function(){if(s("socket open"),this.readyState="open",l.priorWebsocketSuccess="websocket"===this.transport.name,this.emit("open"),this.flush(),"open"===this.readyState&&this.upgrade&&this.transport.pause){s("starting upgrade probes");for(var e=0,t=this.upgrades.length;e<t;e++)this.probe(this.upgrades[e])}},l.prototype.onPacket=function(e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(s('socket receive: type "%s", data "%s"',e.type,e.data),this.emit("packet",e),this.emit("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"pong":this.setPing(),this.emit("pong");break;case"error":var t=new Error("server error");t.code=e.data,this.onError(t);break;case"message":this.emit("data",e.data),this.emit("message",e.data)}else s('packet received with socket readyState "%s"',this.readyState)},l.prototype.onHandshake=function(e){this.emit("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.onOpen(),"closed"!==this.readyState&&(this.setPing(),this.removeListener("heartbeat",this.onHeartbeat),this.on("heartbeat",this.onHeartbeat))},l.prototype.onHeartbeat=function(e){clearTimeout(this.pingTimeoutTimer);var t=this;t.pingTimeoutTimer=setTimeout((function(){"closed"!==t.readyState&&t.onClose("ping timeout")}),e||t.pingInterval+t.pingTimeout)},l.prototype.setPing=function(){var e=this;clearTimeout(e.pingIntervalTimer),e.pingIntervalTimer=setTimeout((function(){s("writing ping packet - expecting pong within %sms",e.pingTimeout),e.ping(),e.onHeartbeat(e.pingTimeout)}),e.pingInterval)},l.prototype.ping=function(){var e=this;this.sendPacket("ping",(function(){e.emit("ping")}))},l.prototype.onDrain=function(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emit("drain"):this.flush()},l.prototype.flush=function(){"closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(s("flushing %d packets in socket",this.writeBuffer.length),this.transport.send(this.writeBuffer),this.prevBufferLen=this.writeBuffer.length,this.emit("flush"))},l.prototype.write=l.prototype.send=function(e,t,r){return this.sendPacket("message",e,t,r),this},l.prototype.sendPacket=function(e,t,r,n){if("function"==typeof t&&(n=t,t=void 0),"function"==typeof r&&(n=r,r=null),"closing"!==this.readyState&&"closed"!==this.readyState){(r=r||{}).compress=!1!==r.compress;var o={type:e,data:t,options:r};this.emit("packetCreate",o),this.writeBuffer.push(o),n&&this.once("flush",n),this.flush()}},l.prototype.close=function(){if("opening"===this.readyState||"open"===this.readyState){this.readyState="closing";var e=this;this.writeBuffer.length?this.once("drain",(function(){this.upgrading?n():t()})):this.upgrading?n():t()}function t(){e.onClose("forced close"),s("socket closing - telling transport to close"),e.transport.close()}function r(){e.removeListener("upgrade",r),e.removeListener("upgradeError",r),t()}function n(){e.once("upgrade",r),e.once("upgradeError",r)}return this},l.prototype.onError=function(e){s("socket error %j",e),l.priorWebsocketSuccess=!1,this.emit("error",e),this.onClose("transport error",e)},l.prototype.onClose=function(e,t){"opening"!==this.readyState&&"open"!==this.readyState&&"closing"!==this.readyState||(s('socket close with reason: "%s"',e),clearTimeout(this.pingIntervalTimer),clearTimeout(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),this.readyState="closed",this.id=null,this.emit("close",e,t),this.writeBuffer=[],this.prevBufferLen=0)},l.prototype.filterUpgrades=function(e){for(var t=[],r=0,n=e.length;r<n;r++)~i(this.transports,e[r])&&t.push(e[r]);return t}},"./node_modules/engine.io-client/lib/transport.js":(e,t,r)=>{var n=r("./node_modules/engine.io-parser/lib/browser.js"),o=r("./node_modules/component-emitter/index.js");function s(e){this.path=e.path,this.hostname=e.hostname,this.port=e.port,this.secure=e.secure,this.query=e.query,this.timestampParam=e.timestampParam,this.timestampRequests=e.timestampRequests,this.readyState="",this.agent=e.agent||!1,this.socket=e.socket,this.enablesXDR=e.enablesXDR,this.pfx=e.pfx,this.key=e.key,this.passphrase=e.passphrase,this.cert=e.cert,this.ca=e.ca,this.ciphers=e.ciphers,this.rejectUnauthorized=e.rejectUnauthorized,this.forceNode=e.forceNode,this.extraHeaders=e.extraHeaders,this.localAddress=e.localAddress}e.exports=s,o(s.prototype),s.prototype.onError=function(e,t){var r=new Error(e);return r.type="TransportError",r.description=t,this.emit("error",r),this},s.prototype.open=function(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this},s.prototype.close=function(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this},s.prototype.send=function(e){if("open"!==this.readyState)throw new Error("Transport not open");this.write(e)},s.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},s.prototype.onData=function(e){var t=n.decodePacket(e,this.socket.binaryType);this.onPacket(t)},s.prototype.onPacket=function(e){this.emit("packet",e)},s.prototype.onClose=function(){this.readyState="closed",this.emit("close")}},"./node_modules/engine.io-client/lib/transports/index.js":(e,t,r)=>{var n=r("./node_modules/engine.io-client/lib/xmlhttprequest.js"),o=r("./node_modules/engine.io-client/lib/transports/polling-xhr.js"),s=r("./node_modules/engine.io-client/lib/transports/polling-jsonp.js"),i=r("./node_modules/engine.io-client/lib/transports/websocket.js");t.polling=function(e){var t=!1,i=!1,a=!1!==e.jsonp;if(r.g.location){var u="https:"===location.protocol,c=location.port;c||(c=u?443:80),t=e.hostname!==location.hostname||c!==e.port,i=e.secure!==u}if(e.xdomain=t,e.xscheme=i,"open"in new n(e)&&!e.forceJSONP)return new o(e);if(!a)throw new Error("JSONP disabled");return new s(e)},t.websocket=i},"./node_modules/engine.io-client/lib/transports/polling-jsonp.js":(e,t,r)=>{var n=r("./node_modules/engine.io-client/lib/transports/polling.js"),o=r("./node_modules/component-inherit/index.js");e.exports=c;var s,i=/\n/g,a=/\\n/g;function u(){}function c(e){n.call(this,e),this.query=this.query||{},s||(r.g.___eio||(r.g.___eio=[]),s=r.g.___eio),this.index=s.length;var t=this;s.push((function(e){t.onData(e)})),this.query.j=this.index,r.g.document&&r.g.addEventListener&&r.g.addEventListener("beforeunload",(function(){t.script&&(t.script.onerror=u)}),!1)}o(c,n),c.prototype.supportsBinary=!1,c.prototype.doClose=function(){this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),this.form&&(this.form.parentNode.removeChild(this.form),this.form=null,this.iframe=null),n.prototype.doClose.call(this)},c.prototype.doPoll=function(){var e=this,t=document.createElement("script");this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),t.async=!0,t.src=this.uri(),t.onerror=function(t){e.onError("jsonp poll error",t)};var r=document.getElementsByTagName("script")[0];r?r.parentNode.insertBefore(t,r):(document.head||document.body).appendChild(t),this.script=t,"undefined"!=typeof navigator&&/gecko/i.test(navigator.userAgent)&&setTimeout((function(){var e=document.createElement("iframe");document.body.appendChild(e),document.body.removeChild(e)}),100)},c.prototype.doWrite=function(e,t){var r=this;if(!this.form){var n,o=document.createElement("form"),s=document.createElement("textarea"),u=this.iframeId="eio_iframe_"+this.index;o.className="socketio",o.style.position="absolute",o.style.top="-1000px",o.style.left="-1000px",o.target=u,o.method="POST",o.setAttribute("accept-charset","utf-8"),s.name="d",o.appendChild(s),document.body.appendChild(o),this.form=o,this.area=s}function c(){l(),t()}function l(){if(r.iframe)try{r.form.removeChild(r.iframe)}catch(e){r.onError("jsonp polling iframe removal error",e)}try{var e='<iframe src="javascript:0" name="'+r.iframeId+'">';n=document.createElement(e)}catch(e){(n=document.createElement("iframe")).name=r.iframeId,n.src="javascript:0"}n.id=r.iframeId,r.form.appendChild(n),r.iframe=n}this.form.action=this.uri(),l(),e=e.replace(a,"\\\n"),this.area.value=e.replace(i,"\\n");try{this.form.submit()}catch(e){}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){"complete"===r.iframe.readyState&&c()}:this.iframe.onload=c}},"./node_modules/engine.io-client/lib/transports/polling-xhr.js":(e,t,r)=>{var n=r("./node_modules/engine.io-client/lib/xmlhttprequest.js"),o=r("./node_modules/engine.io-client/lib/transports/polling.js"),s=r("./node_modules/component-emitter/index.js"),i=r("./node_modules/component-inherit/index.js"),a=r("./node_modules/debug/src/browser.js")("engine.io-client:polling-xhr");function u(){}function c(e){if(o.call(this,e),this.requestTimeout=e.requestTimeout,this.extraHeaders=e.extraHeaders,r.g.location){var t="https:"===location.protocol,n=location.port;n||(n=t?443:80),this.xd=e.hostname!==r.g.location.hostname||n!==e.port,this.xs=e.secure!==t}}function l(e){this.method=e.method||"GET",this.uri=e.uri,this.xd=!!e.xd,this.xs=!!e.xs,this.async=!1!==e.async,this.data=void 0!==e.data?e.data:null,this.agent=e.agent,this.isBinary=e.isBinary,this.supportsBinary=e.supportsBinary,this.enablesXDR=e.enablesXDR,this.requestTimeout=e.requestTimeout,this.pfx=e.pfx,this.key=e.key,this.passphrase=e.passphrase,this.cert=e.cert,this.ca=e.ca,this.ciphers=e.ciphers,this.rejectUnauthorized=e.rejectUnauthorized,this.extraHeaders=e.extraHeaders,this.create()}function f(){for(var e in l.requests)l.requests.hasOwnProperty(e)&&l.requests[e].abort()}e.exports=c,e.exports.Request=l,i(c,o),c.prototype.supportsBinary=!0,c.prototype.request=function(e){return(e=e||{}).uri=this.uri(),e.xd=this.xd,e.xs=this.xs,e.agent=this.agent||!1,e.supportsBinary=this.supportsBinary,e.enablesXDR=this.enablesXDR,e.pfx=this.pfx,e.key=this.key,e.passphrase=this.passphrase,e.cert=this.cert,e.ca=this.ca,e.ciphers=this.ciphers,e.rejectUnauthorized=this.rejectUnauthorized,e.requestTimeout=this.requestTimeout,e.extraHeaders=this.extraHeaders,new l(e)},c.prototype.doWrite=function(e,t){var r="string"!=typeof e&&void 0!==e,n=this.request({method:"POST",data:e,isBinary:r}),o=this;n.on("success",t),n.on("error",(function(e){o.onError("xhr post error",e)})),this.sendXhr=n},c.prototype.doPoll=function(){a("xhr poll");var e=this.request(),t=this;e.on("data",(function(e){t.onData(e)})),e.on("error",(function(e){t.onError("xhr poll error",e)})),this.pollXhr=e},s(l.prototype),l.prototype.create=function(){var e={agent:this.agent,xdomain:this.xd,xscheme:this.xs,enablesXDR:this.enablesXDR};e.pfx=this.pfx,e.key=this.key,e.passphrase=this.passphrase,e.cert=this.cert,e.ca=this.ca,e.ciphers=this.ciphers,e.rejectUnauthorized=this.rejectUnauthorized;var t=this.xhr=new n(e),o=this;try{a("xhr open %s: %s",this.method,this.uri),t.open(this.method,this.uri,this.async);try{if(this.extraHeaders)for(var s in t.setDisableHeaderCheck&&t.setDisableHeaderCheck(!0),this.extraHeaders)this.extraHeaders.hasOwnProperty(s)&&t.setRequestHeader(s,this.extraHeaders[s])}catch(e){}if("POST"===this.method)try{this.isBinary?t.setRequestHeader("Content-type","application/octet-stream"):t.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(e){}try{t.setRequestHeader("Accept","*/*")}catch(e){}"withCredentials"in t&&(t.withCredentials=!0),this.requestTimeout&&(t.timeout=this.requestTimeout),this.hasXDR()?(t.onload=function(){o.onLoad()},t.onerror=function(){o.onError(t.responseText)}):t.onreadystatechange=function(){if(2===t.readyState){var e;try{e=t.getResponseHeader("Content-Type")}catch(e){}"application/octet-stream"===e&&(t.responseType="arraybuffer")}4===t.readyState&&(200===t.status||1223===t.status?o.onLoad():setTimeout((function(){o.onError(t.status)}),0))},a("xhr data %s",this.data),t.send(this.data)}catch(e){return void setTimeout((function(){o.onError(e)}),0)}r.g.document&&(this.index=l.requestsCount++,l.requests[this.index]=this)},l.prototype.onSuccess=function(){this.emit("success"),this.cleanup()},l.prototype.onData=function(e){this.emit("data",e),this.onSuccess()},l.prototype.onError=function(e){this.emit("error",e),this.cleanup(!0)},l.prototype.cleanup=function(e){if(void 0!==this.xhr&&null!==this.xhr){if(this.hasXDR()?this.xhr.onload=this.xhr.onerror=u:this.xhr.onreadystatechange=u,e)try{this.xhr.abort()}catch(e){}r.g.document&&delete l.requests[this.index],this.xhr=null}},l.prototype.onLoad=function(){var e;try{var t;try{t=this.xhr.getResponseHeader("Content-Type")}catch(e){}e="application/octet-stream"===t&&this.xhr.response||this.xhr.responseText}catch(e){this.onError(e)}null!=e&&this.onData(e)},l.prototype.hasXDR=function(){return void 0!==r.g.XDomainRequest&&!this.xs&&this.enablesXDR},l.prototype.abort=function(){this.cleanup()},l.requestsCount=0,l.requests={},r.g.document&&(r.g.attachEvent?r.g.attachEvent("onunload",f):r.g.addEventListener&&r.g.addEventListener("beforeunload",f,!1))},"./node_modules/engine.io-client/lib/transports/polling.js":(e,t,r)=>{var n=r("./node_modules/engine.io-client/lib/transport.js"),o=r("./node_modules/parseqs/index.js"),s=r("./node_modules/engine.io-parser/lib/browser.js"),i=r("./node_modules/component-inherit/index.js"),a=r("./node_modules/yeast/index.js"),u=r("./node_modules/debug/src/browser.js")("engine.io-client:polling");e.exports=l;var c=null!=new(r("./node_modules/engine.io-client/lib/xmlhttprequest.js"))({xdomain:!1}).responseType;function l(e){var t=e&&e.forceBase64;c&&!t||(this.supportsBinary=!1),n.call(this,e)}i(l,n),l.prototype.name="polling",l.prototype.doOpen=function(){this.poll()},l.prototype.pause=function(e){var t=this;function r(){u("paused"),t.readyState="paused",e()}if(this.readyState="pausing",this.polling||!this.writable){var n=0;this.polling&&(u("we are currently polling - waiting to pause"),n++,this.once("pollComplete",(function(){u("pre-pause polling complete"),--n||r()}))),this.writable||(u("we are currently writing - waiting to pause"),n++,this.once("drain",(function(){u("pre-pause writing complete"),--n||r()})))}else r()},l.prototype.poll=function(){u("polling"),this.polling=!0,this.doPoll(),this.emit("poll")},l.prototype.onData=function(e){var t=this;u("polling got data %s",e),s.decodePayload(e,this.socket.binaryType,(function(e,r,n){if("opening"===t.readyState&&t.onOpen(),"close"===e.type)return t.onClose(),!1;t.onPacket(e)})),"closed"!==this.readyState&&(this.polling=!1,this.emit("pollComplete"),"open"===this.readyState?this.poll():u('ignoring poll - transport state "%s"',this.readyState))},l.prototype.doClose=function(){var e=this;function t(){u("writing close packet"),e.write([{type:"close"}])}"open"===this.readyState?(u("transport open - closing"),t()):(u("transport not open - deferring close"),this.once("open",t))},l.prototype.write=function(e){var t=this;this.writable=!1;var r=function(){t.writable=!0,t.emit("drain")};s.encodePayload(e,this.supportsBinary,(function(e){t.doWrite(e,r)}))},l.prototype.uri=function(){var e=this.query||{},t=this.secure?"https":"http",r="";return!1!==this.timestampRequests&&(e[this.timestampParam]=a()),this.supportsBinary||e.sid||(e.b64=1),e=o.encode(e),this.port&&("https"===t&&443!==Number(this.port)||"http"===t&&80!==Number(this.port))&&(r=":"+this.port),e.length&&(e="?"+e),t+"://"+(-1!==this.hostname.indexOf(":")?"["+this.hostname+"]":this.hostname)+r+this.path+e}},"./node_modules/engine.io-client/lib/transports/websocket.js":(e,t,r)=>{var n,o=r("./node_modules/engine.io-client/lib/transport.js"),s=r("./node_modules/engine.io-parser/lib/browser.js"),i=r("./node_modules/parseqs/index.js"),a=r("./node_modules/component-inherit/index.js"),u=r("./node_modules/yeast/index.js"),c=r("./node_modules/debug/src/browser.js")("engine.io-client:websocket"),l=r.g.WebSocket||r.g.MozWebSocket;if("undefined"==typeof window)try{n=r("?1bcf")}catch(e){}var f=l;function p(e){e&&e.forceBase64&&(this.supportsBinary=!1),this.perMessageDeflate=e.perMessageDeflate,this.usingBrowserWebSocket=l&&!e.forceNode,this.protocols=e.protocols,this.usingBrowserWebSocket||(f=n),o.call(this,e)}f||"undefined"!=typeof window||(f=n),e.exports=p,a(p,o),p.prototype.name="websocket",p.prototype.supportsBinary=!0,p.prototype.doOpen=function(){if(this.check()){var e=this.uri(),t=this.protocols,r={agent:this.agent,perMessageDeflate:this.perMessageDeflate};r.pfx=this.pfx,r.key=this.key,r.passphrase=this.passphrase,r.cert=this.cert,r.ca=this.ca,r.ciphers=this.ciphers,r.rejectUnauthorized=this.rejectUnauthorized,this.extraHeaders&&(r.headers=this.extraHeaders),this.localAddress&&(r.localAddress=this.localAddress);try{this.ws=this.usingBrowserWebSocket?t?new f(e,t):new f(e):new f(e,t,r)}catch(e){return this.emit("error",e)}void 0===this.ws.binaryType&&(this.supportsBinary=!1),this.ws.supports&&this.ws.supports.binary?(this.supportsBinary=!0,this.ws.binaryType="nodebuffer"):this.ws.binaryType="arraybuffer",this.addEventListeners()}},p.prototype.addEventListeners=function(){var e=this;this.ws.onopen=function(){e.onOpen()},this.ws.onclose=function(){e.onClose()},this.ws.onmessage=function(t){e.onData(t.data)},this.ws.onerror=function(t){e.onError("websocket error",t)}},p.prototype.write=function(e){var t=this;this.writable=!1;for(var n=e.length,o=0,i=n;o<i;o++)!function(e){s.encodePacket(e,t.supportsBinary,(function(o){if(!t.usingBrowserWebSocket){var s={};e.options&&(s.compress=e.options.compress),t.perMessageDeflate&&("string"==typeof o?r.g.Buffer.byteLength(o):o.length)<t.perMessageDeflate.threshold&&(s.compress=!1)}try{t.usingBrowserWebSocket?t.ws.send(o):t.ws.send(o,s)}catch(e){c("websocket closed before onclose event")}--n||(t.emit("flush"),setTimeout((function(){t.writable=!0,t.emit("drain")}),0))}))}(e[o])},p.prototype.onClose=function(){o.prototype.onClose.call(this)},p.prototype.doClose=function(){void 0!==this.ws&&this.ws.close()},p.prototype.uri=function(){var e=this.query||{},t=this.secure?"wss":"ws",r="";return this.port&&("wss"===t&&443!==Number(this.port)||"ws"===t&&80!==Number(this.port))&&(r=":"+this.port),this.timestampRequests&&(e[this.timestampParam]=u()),this.supportsBinary||(e.b64=1),(e=i.encode(e)).length&&(e="?"+e),t+"://"+(-1!==this.hostname.indexOf(":")?"["+this.hostname+"]":this.hostname)+r+this.path+e},p.prototype.check=function(){return!(!f||"__initialize"in f&&this.name===p.prototype.name)}},"./node_modules/engine.io-client/lib/xmlhttprequest.js":(e,t,r)=>{var n=r("./node_modules/has-cors/index.js");e.exports=function(e){var t=e.xdomain,o=e.xscheme,s=e.enablesXDR;try{if("undefined"!=typeof XMLHttpRequest&&(!t||n))return new XMLHttpRequest}catch(e){}try{if("undefined"!=typeof XDomainRequest&&!o&&s)return new XDomainRequest}catch(e){}if(!t)try{return new(r.g[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(e){}}},"./node_modules/engine.io-parser/lib/browser.js":(e,t,r)=>{var n,o=r("./node_modules/engine.io-parser/lib/keys.js"),s=r("./node_modules/has-binary2/index.js"),i=r("./node_modules/arraybuffer.slice/index.js"),a=r("./node_modules/after/index.js"),u=r("./node_modules/engine.io-parser/lib/utf8.js");r.g&&r.g.ArrayBuffer&&(n=r("./node_modules/base64-arraybuffer/lib/base64-arraybuffer.js"));var c="undefined"!=typeof navigator&&/Android/i.test(navigator.userAgent),l="undefined"!=typeof navigator&&/PhantomJS/i.test(navigator.userAgent),f=c||l;t.protocol=3;var p=t.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6},d=o(p),h={type:"error",data:"parser error"},y=r("./node_modules/blob/index.js");function v(e,t,r){for(var n=new Array(e.length),o=a(e.length,r),s=function(e,r,o){t(r,(function(t,r){n[e]=r,o(t,n)}))},i=0;i<e.length;i++)s(i,e[i],o)}t.encodePacket=function(e,n,o,s){"function"==typeof n&&(s=n,n=!1),"function"==typeof o&&(s=o,o=null);var i=void 0===e.data?void 0:e.data.buffer||e.data;if(r.g.ArrayBuffer&&i instanceof ArrayBuffer)return function(e,r,n){if(!r)return t.encodeBase64Packet(e,n);var o=e.data,s=new Uint8Array(o),i=new Uint8Array(1+o.byteLength);i[0]=p[e.type];for(var a=0;a<s.length;a++)i[a+1]=s[a];return n(i.buffer)}(e,n,s);if(y&&i instanceof r.g.Blob)return function(e,r,n){if(!r)return t.encodeBase64Packet(e,n);if(f)return function(e,r,n){if(!r)return t.encodeBase64Packet(e,n);var o=new FileReader;return o.onload=function(){e.data=o.result,t.encodePacket(e,r,!0,n)},o.readAsArrayBuffer(e.data)}(e,r,n);var o=new Uint8Array(1);o[0]=p[e.type];var s=new y([o.buffer,e.data]);return n(s)}(e,n,s);if(i&&i.base64)return function(e,r){var n="b"+t.packets[e.type]+e.data.data;return r(n)}(e,s);var a=p[e.type];return void 0!==e.data&&(a+=o?u.encode(String(e.data),{strict:!1}):String(e.data)),s(""+a)},t.encodeBase64Packet=function(e,n){var o,s="b"+t.packets[e.type];if(y&&e.data instanceof r.g.Blob){var i=new FileReader;return i.onload=function(){var e=i.result.split(",")[1];n(s+e)},i.readAsDataURL(e.data)}try{o=String.fromCharCode.apply(null,new Uint8Array(e.data))}catch(t){for(var a=new Uint8Array(e.data),u=new Array(a.length),c=0;c<a.length;c++)u[c]=a[c];o=String.fromCharCode.apply(null,u)}return s+=r.g.btoa(o),n(s)},t.decodePacket=function(e,r,n){if(void 0===e)return h;if("string"==typeof e){if("b"===e.charAt(0))return t.decodeBase64Packet(e.substr(1),r);if(n&&!1===(e=function(e){try{e=u.decode(e,{strict:!1})}catch(e){return!1}return e}(e)))return h;var o=e.charAt(0);return Number(o)==o&&d[o]?e.length>1?{type:d[o],data:e.substring(1)}:{type:d[o]}:h}o=new Uint8Array(e)[0];var s=i(e,1);return y&&"blob"===r&&(s=new y([s])),{type:d[o],data:s}},t.decodeBase64Packet=function(e,t){var r=d[e.charAt(0)];if(!n)return{type:r,data:{base64:!0,data:e.substr(1)}};var o=n.decode(e.substr(1));return"blob"===t&&y&&(o=new y([o])),{type:r,data:o}},t.encodePayload=function(e,r,n){"function"==typeof r&&(n=r,r=null);var o=s(e);return r&&o?y&&!f?t.encodePayloadAsBlob(e,n):t.encodePayloadAsArrayBuffer(e,n):e.length?void v(e,(function(e,n){t.encodePacket(e,!!o&&r,!1,(function(e){n(null,function(e){return e.length+":"+e}(e))}))}),(function(e,t){return n(t.join(""))})):n("0:")},t.decodePayload=function(e,r,n){if("string"!=typeof e)return t.decodePayloadAsBinary(e,r,n);var o;if("function"==typeof r&&(n=r,r=null),""===e)return n(h,0,1);for(var s,i,a="",u=0,c=e.length;u<c;u++){var l=e.charAt(u);if(":"===l){if(""===a||a!=(s=Number(a)))return n(h,0,1);if(a!=(i=e.substr(u+1,s)).length)return n(h,0,1);if(i.length){if(o=t.decodePacket(i,r,!1),h.type===o.type&&h.data===o.data)return n(h,0,1);if(!1===n(o,u+s,c))return}u+=s,a=""}else a+=l}return""!==a?n(h,0,1):void 0},t.encodePayloadAsArrayBuffer=function(e,r){if(!e.length)return r(new ArrayBuffer(0));v(e,(function(e,r){t.encodePacket(e,!0,!0,(function(e){return r(null,e)}))}),(function(e,t){var n=t.reduce((function(e,t){var r;return e+(r="string"==typeof t?t.length:t.byteLength).toString().length+r+2}),0),o=new Uint8Array(n),s=0;return t.forEach((function(e){var t="string"==typeof e,r=e;if(t){for(var n=new Uint8Array(e.length),i=0;i<e.length;i++)n[i]=e.charCodeAt(i);r=n.buffer}o[s++]=t?0:1;var a=r.byteLength.toString();for(i=0;i<a.length;i++)o[s++]=parseInt(a[i]);for(o[s++]=255,n=new Uint8Array(r),i=0;i<n.length;i++)o[s++]=n[i]})),r(o.buffer)}))},t.encodePayloadAsBlob=function(e,r){v(e,(function(e,r){t.encodePacket(e,!0,!0,(function(e){var t=new Uint8Array(1);if(t[0]=1,"string"==typeof e){for(var n=new Uint8Array(e.length),o=0;o<e.length;o++)n[o]=e.charCodeAt(o);e=n.buffer,t[0]=0}var s=(e instanceof ArrayBuffer?e.byteLength:e.size).toString(),i=new Uint8Array(s.length+1);for(o=0;o<s.length;o++)i[o]=parseInt(s[o]);if(i[s.length]=255,y){var a=new y([t.buffer,i.buffer,e]);r(null,a)}}))}),(function(e,t){return r(new y(t))}))},t.decodePayloadAsBinary=function(e,r,n){"function"==typeof r&&(n=r,r=null);for(var o=e,s=[];o.byteLength>0;){for(var a=new Uint8Array(o),u=0===a[0],c="",l=1;255!==a[l];l++){if(c.length>310)return n(h,0,1);c+=a[l]}o=i(o,2+c.length),c=parseInt(c);var f=i(o,0,c);if(u)try{f=String.fromCharCode.apply(null,new Uint8Array(f))}catch(e){var p=new Uint8Array(f);for(f="",l=0;l<p.length;l++)f+=String.fromCharCode(p[l])}s.push(f),o=i(o,c)}var d=s.length;s.forEach((function(e,o){n(t.decodePacket(e,r,!0),o,d)}))}},"./node_modules/engine.io-parser/lib/keys.js":e=>{e.exports=Object.keys||function(e){var t=[],r=Object.prototype.hasOwnProperty;for(var n in e)r.call(e,n)&&t.push(n);return t}},"./node_modules/engine.io-parser/lib/utf8.js":function(e,t,r){var n;e=r.nmd(e),function(o){var s=(e&&e.exports,"object"==typeof r.g&&r.g);s.global!==s&&s.window;var i,a,u,c=String.fromCharCode;function l(e){for(var t,r,n=[],o=0,s=e.length;o<s;)(t=e.charCodeAt(o++))>=55296&&t<=56319&&o<s?56320==(64512&(r=e.charCodeAt(o++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),o--):n.push(t);return n}function f(e,t){if(e>=55296&&e<=57343){if(t)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function p(e,t){return c(e>>t&63|128)}function d(e,t){if(0==(4294967168&e))return c(e);var r="";return 0==(4294965248&e)?r=c(e>>6&31|192):0==(4294901760&e)?(f(e,t)||(e=65533),r=c(e>>12&15|224),r+=p(e,6)):0==(4292870144&e)&&(r=c(e>>18&7|240),r+=p(e,12),r+=p(e,6)),r+=c(63&e|128)}function h(){if(u>=a)throw Error("Invalid byte index");var e=255&i[u];if(u++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function y(e){var t,r;if(u>a)throw Error("Invalid byte index");if(u==a)return!1;if(t=255&i[u],u++,0==(128&t))return t;if(192==(224&t)){if((r=(31&t)<<6|h())>=128)return r;throw Error("Invalid continuation byte")}if(224==(240&t)){if((r=(15&t)<<12|h()<<6|h())>=2048)return f(r,e)?r:65533;throw Error("Invalid continuation byte")}if(240==(248&t)&&(r=(7&t)<<18|h()<<12|h()<<6|h())>=65536&&r<=1114111)return r;throw Error("Invalid UTF-8 detected")}var v={version:"2.1.2",encode:function(e,t){for(var r=!1!==(t=t||{}).strict,n=l(e),o=n.length,s=-1,i="";++s<o;)i+=d(n[s],r);return i},decode:function(e,t){var r=!1!==(t=t||{}).strict;i=l(e),a=i.length,u=0;for(var n,o=[];!1!==(n=y(r));)o.push(n);return function(e){for(var t,r=e.length,n=-1,o="";++n<r;)(t=e[n])>65535&&(o+=c((t-=65536)>>>10&1023|55296),t=56320|1023&t),o+=c(t);return o}(o)}};void 0===(n=function(){return v}.call(t,r,t,e))||(e.exports=n)}()},"./node_modules/has-binary2/index.js":(e,t,r)=>{var n=r("./node_modules/isarray/index.js"),o=Object.prototype.toString,s="function"==typeof r.g.Blob||"[object BlobConstructor]"===o.call(r.g.Blob),i="function"==typeof r.g.File||"[object FileConstructor]"===o.call(r.g.File);e.exports=function e(t){if(!t||"object"!=typeof t)return!1;if(n(t)){for(var o=0,a=t.length;o<a;o++)if(e(t[o]))return!0;return!1}if("function"==typeof r.g.Buffer&&r.g.Buffer.isBuffer&&r.g.Buffer.isBuffer(t)||"function"==typeof r.g.ArrayBuffer&&t instanceof ArrayBuffer||s&&t instanceof Blob||i&&t instanceof File)return!0;if(t.toJSON&&"function"==typeof t.toJSON&&1===arguments.length)return e(t.toJSON(),!0);for(var u in t)if(Object.prototype.hasOwnProperty.call(t,u)&&e(t[u]))return!0;return!1}},"./node_modules/has-cors/index.js":e=>{try{e.exports="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(t){e.exports=!1}},"./node_modules/indexof/index.js":e=>{var t=[].indexOf;e.exports=function(e,r){if(t)return e.indexOf(r);for(var n=0;n<e.length;++n)if(e[n]===r)return n;return-1}},"./node_modules/isarray/index.js":e=>{var t={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==t.call(e)}},"./node_modules/ms/index.js":e=>{var t=1e3,r=6e4,n=60*r,o=24*n;function s(e,t,r){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+r:Math.ceil(e/t)+" "+r+"s"}e.exports=function(e,i){i=i||{};var a,u=typeof e;if("string"===u&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var s=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(s){var i=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*i;case"days":case"day":case"d":return i*o;case"hours":case"hour":case"hrs":case"hr":case"h":return i*n;case"minutes":case"minute":case"mins":case"min":case"m":return i*r;case"seconds":case"second":case"secs":case"sec":case"s":return i*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return i;default:return}}}}(e);if("number"===u&&!1===isNaN(e))return i.long?s(a=e,o,"day")||s(a,n,"hour")||s(a,r,"minute")||s(a,t,"second")||a+" ms":function(e){return e>=o?Math.round(e/o)+"d":e>=n?Math.round(e/n)+"h":e>=r?Math.round(e/r)+"m":e>=t?Math.round(e/t)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},"./node_modules/parseqs/index.js":(e,t)=>{t.encode=function(e){var t="";for(var r in e)e.hasOwnProperty(r)&&(t.length&&(t+="&"),t+=encodeURIComponent(r)+"="+encodeURIComponent(e[r]));return t},t.decode=function(e){for(var t={},r=e.split("&"),n=0,o=r.length;n<o;n++){var s=r[n].split("=");t[decodeURIComponent(s[0])]=decodeURIComponent(s[1])}return t}},"./node_modules/parseuri/index.js":e=>{var t=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,r=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];e.exports=function(e){var n=e,o=e.indexOf("["),s=e.indexOf("]");-1!=o&&-1!=s&&(e=e.substring(0,o)+e.substring(o,s).replace(/:/g,";")+e.substring(s,e.length));for(var i=t.exec(e||""),a={},u=14;u--;)a[r[u]]=i[u]||"";return-1!=o&&-1!=s&&(a.source=n,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a}},"./node_modules/socket.io-client/lib/index.js":(e,t,r)=>{var n=r("./node_modules/socket.io-client/lib/url.js"),o=r("./src/socket-parser.js"),s=r("./node_modules/socket.io-client/lib/manager.js"),i=r("./node_modules/debug/src/browser.js")("socket.io-client");e.exports=t=u;var a=t.managers={};function u(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var r,o=n(e),u=o.source,c=o.id,l=o.path,f=a[c]&&l in a[c].nsps;return t.forceNew||t["force new connection"]||!1===t.multiplex||f?(i("ignoring socket cache for %s",u),r=s(u,t)):(a[c]||(i("new io instance for %s",u),a[c]=s(u,t)),r=a[c]),o.query&&!t.query&&(t.query=o.query),r.socket(o.path,t)}t.protocol=o.protocol,t.connect=u,t.Manager=r("./node_modules/socket.io-client/lib/manager.js"),t.Socket=r("./node_modules/socket.io-client/lib/socket.js")},"./node_modules/socket.io-client/lib/manager.js":(e,t,r)=>{var n=r("./node_modules/engine.io-client/lib/index.js"),o=r("./node_modules/socket.io-client/lib/socket.js"),s=r("./node_modules/component-emitter/index.js"),i=r("./src/socket-parser.js"),a=r("./node_modules/socket.io-client/lib/on.js"),u=r("./node_modules/component-bind/index.js"),c=r("./node_modules/debug/src/browser.js")("socket.io-client:manager"),l=r("./node_modules/indexof/index.js"),f=r("./node_modules/backo2/index.js"),p=Object.prototype.hasOwnProperty;function d(e,t){if(!(this instanceof d))return new d(e,t);e&&"object"==typeof e&&(t=e,e=void 0),(t=t||{}).path=t.path||"/socket.io",this.nsps={},this.subs=[],this.opts=t,this.reconnection(!1!==t.reconnection),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor(t.randomizationFactor||.5),this.backoff=new f({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==t.timeout?2e4:t.timeout),this.readyState="closed",this.uri=e,this.connecting=[],this.lastPing=null,this.encoding=!1,this.packetBuffer=[];var r=t.parser||i;this.encoder=new r.Encoder,this.decoder=new r.Decoder,this.autoConnect=!1!==t.autoConnect,this.autoConnect&&this.open()}e.exports=d,d.prototype.emitAll=function(){for(var e in this.emit.apply(this,arguments),this.nsps)p.call(this.nsps,e)&&this.nsps[e].emit.apply(this.nsps[e],arguments)},d.prototype.updateSocketIds=function(){for(var e in this.nsps)p.call(this.nsps,e)&&(this.nsps[e].id=this.generateId(e))},d.prototype.generateId=function(e){return("/"===e?"":e+"#")+this.engine.id},s(d.prototype),d.prototype.reconnection=function(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection},d.prototype.reconnectionAttempts=function(e){return arguments.length?(this._reconnectionAttempts=e,this):this._reconnectionAttempts},d.prototype.reconnectionDelay=function(e){return arguments.length?(this._reconnectionDelay=e,this.backoff&&this.backoff.setMin(e),this):this._reconnectionDelay},d.prototype.randomizationFactor=function(e){return arguments.length?(this._randomizationFactor=e,this.backoff&&this.backoff.setJitter(e),this):this._randomizationFactor},d.prototype.reconnectionDelayMax=function(e){return arguments.length?(this._reconnectionDelayMax=e,this.backoff&&this.backoff.setMax(e),this):this._reconnectionDelayMax},d.prototype.timeout=function(e){return arguments.length?(this._timeout=e,this):this._timeout},d.prototype.maybeReconnectOnOpen=function(){!this.reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()},d.prototype.open=d.prototype.connect=function(e,t){if(c("readyState %s",this.readyState),~this.readyState.indexOf("open"))return this;c("opening %s",this.uri),this.engine=n(this.uri,this.opts);var r=this.engine,o=this;this.readyState="opening",this.skipReconnect=!1;var s=a(r,"open",(function(){o.onopen(),e&&e()})),i=a(r,"error",(function(t){if(c("connect_error"),o.cleanup(),o.readyState="closed",o.emitAll("connect_error",t),e){var r=new Error("Connection error");r.data=t,e(r)}else o.maybeReconnectOnOpen()}));if(!1!==this._timeout){var u=this._timeout;c("connect attempt will timeout after %d",u);var l=setTimeout((function(){c("connect attempt timed out after %d",u),s.destroy(),r.close(),r.emit("error","timeout"),o.emitAll("connect_timeout",u)}),u);this.subs.push({destroy:function(){clearTimeout(l)}})}return this.subs.push(s),this.subs.push(i),this},d.prototype.onopen=function(){c("open"),this.cleanup(),this.readyState="open",this.emit("open");var e=this.engine;this.subs.push(a(e,"data",u(this,"ondata"))),this.subs.push(a(e,"ping",u(this,"onping"))),this.subs.push(a(e,"pong",u(this,"onpong"))),this.subs.push(a(e,"error",u(this,"onerror"))),this.subs.push(a(e,"close",u(this,"onclose"))),this.subs.push(a(this.decoder,"decoded",u(this,"ondecoded")))},d.prototype.onping=function(){this.lastPing=new Date,this.emitAll("ping")},d.prototype.onpong=function(){this.emitAll("pong",new Date-this.lastPing)},d.prototype.ondata=function(e){this.decoder.add(e)},d.prototype.ondecoded=function(e){this.emit("packet",e)},d.prototype.onerror=function(e){c("error",e),this.emitAll("error",e)},d.prototype.socket=function(e,t){var r=this.nsps[e];if(!r){r=new o(this,e,t),this.nsps[e]=r;var n=this;r.on("connecting",s),r.on("connect",(function(){r.id=n.generateId(e)})),this.autoConnect&&s()}function s(){~l(n.connecting,r)||n.connecting.push(r)}return r},d.prototype.destroy=function(e){var t=l(this.connecting,e);~t&&this.connecting.splice(t,1),this.connecting.length||this.close()},d.prototype.packet=function(e){c("writing packet %j",e);var t=this;e.query&&0===e.type&&(e.nsp+="?"+e.query),t.encoding?t.packetBuffer.push(e):(t.encoding=!0,this.encoder.encode(e,(function(r){for(var n=0;n<r.length;n++)t.engine.write(r[n],e.options);t.encoding=!1,t.processPacketQueue()})))},d.prototype.processPacketQueue=function(){if(this.packetBuffer.length>0&&!this.encoding){var e=this.packetBuffer.shift();this.packet(e)}},d.prototype.cleanup=function(){c("cleanup");for(var e=this.subs.length,t=0;t<e;t++)this.subs.shift().destroy();this.packetBuffer=[],this.encoding=!1,this.lastPing=null,this.decoder.destroy()},d.prototype.close=d.prototype.disconnect=function(){c("disconnect"),this.skipReconnect=!0,this.reconnecting=!1,"opening"===this.readyState&&this.cleanup(),this.backoff.reset(),this.readyState="closed",this.engine&&this.engine.close()},d.prototype.onclose=function(e){c("onclose"),this.cleanup(),this.backoff.reset(),this.readyState="closed",this.emit("close",e),this._reconnection&&!this.skipReconnect&&this.reconnect()},d.prototype.reconnect=function(){if(this.reconnecting||this.skipReconnect)return this;var e=this;if(this.backoff.attempts>=this._reconnectionAttempts)c("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var t=this.backoff.duration();c("will wait %dms before reconnect attempt",t),this.reconnecting=!0;var r=setTimeout((function(){e.skipReconnect||(c("attempting reconnect"),e.emitAll("reconnect_attempt",e.backoff.attempts),e.emitAll("reconnecting",e.backoff.attempts),e.skipReconnect||e.open((function(t){t?(c("reconnect attempt error"),e.reconnecting=!1,e.reconnect(),e.emitAll("reconnect_error",t.data)):(c("reconnect success"),e.onreconnect())})))}),t);this.subs.push({destroy:function(){clearTimeout(r)}})}},d.prototype.onreconnect=function(){var e=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",e)}},"./node_modules/socket.io-client/lib/on.js":e=>{e.exports=function(e,t,r){return e.on(t,r),{destroy:function(){e.removeListener(t,r)}}}},"./node_modules/socket.io-client/lib/socket.js":(e,t,r)=>{var n=r("./src/socket-parser.js"),o=r("./node_modules/component-emitter/index.js"),s=r("./node_modules/to-array/index.js"),i=r("./node_modules/socket.io-client/lib/on.js"),a=r("./node_modules/component-bind/index.js"),u=r("./node_modules/debug/src/browser.js")("socket.io-client:socket"),c=r("./node_modules/parseqs/index.js");e.exports=p;var l={connect:1,connect_error:1,connect_timeout:1,connecting:1,disconnect:1,error:1,reconnect:1,reconnect_attempt:1,reconnect_failed:1,reconnect_error:1,reconnecting:1,ping:1,pong:1},f=o.prototype.emit;function p(e,t,r){this.io=e,this.nsp=t,this.json=this,this.ids=0,this.acks={},this.receiveBuffer=[],this.sendBuffer=[],this.connected=!1,this.disconnected=!0,r&&r.query&&(this.query=r.query),this.io.autoConnect&&this.open()}o(p.prototype),p.prototype.subEvents=function(){if(!this.subs){var e=this.io;this.subs=[i(e,"open",a(this,"onopen")),i(e,"packet",a(this,"onpacket")),i(e,"close",a(this,"onclose"))]}},p.prototype.open=p.prototype.connect=function(){return this.connected||(this.subEvents(),this.io.open(),"open"===this.io.readyState&&this.onopen(),this.emit("connecting")),this},p.prototype.send=function(){var e=s(arguments);return e.unshift("message"),this.emit.apply(this,e),this},p.prototype.emit=function(e){if(l.hasOwnProperty(e))return f.apply(this,arguments),this;var t=s(arguments),r={type:n.EVENT,data:t,options:{}};return r.options.compress=!this.flags||!1!==this.flags.compress,"function"==typeof t[t.length-1]&&(u("emitting packet with ack id %d",this.ids),this.acks[this.ids]=t.pop(),r.id=this.ids++),this.connected?this.packet(r):this.sendBuffer.push(r),delete this.flags,this},p.prototype.packet=function(e){e.nsp=this.nsp,this.io.packet(e)},p.prototype.onopen=function(){if(u("transport is open - connecting"),"/"!==this.nsp)if(this.query){var e="object"==typeof this.query?c.encode(this.query):this.query;u("sending connect packet with query %s",e),this.packet({type:n.CONNECT,query:e})}else this.packet({type:n.CONNECT})},p.prototype.onclose=function(e){u("close (%s)",e),this.connected=!1,this.disconnected=!0,delete this.id,this.emit("disconnect",e)},p.prototype.onpacket=function(e){if(e.nsp===this.nsp)switch(e.type){case n.CONNECT:this.onconnect();break;case n.EVENT:case n.BINARY_EVENT:this.onevent(e);break;case n.ACK:case n.BINARY_ACK:this.onack(e);break;case n.DISCONNECT:this.ondisconnect();break;case n.ERROR:this.emit("error",e.data)}},p.prototype.onevent=function(e){var t=e.data||[];u("emitting event %j",t),null!=e.id&&(u("attaching ack callback to event"),t.push(this.ack(e.id))),this.connected?f.apply(this,t):this.receiveBuffer.push(t)},p.prototype.ack=function(e){var t=this,r=!1;return function(){if(!r){r=!0;var o=s(arguments);u("sending ack %j",o),t.packet({type:n.ACK,id:e,data:o})}}},p.prototype.onack=function(e){var t=this.acks[e.id];"function"==typeof t?(u("calling ack %s with %j",e.id,e.data),t.apply(this,e.data),delete this.acks[e.id]):u("bad ack %s",e.id)},p.prototype.onconnect=function(){this.connected=!0,this.disconnected=!1,this.emit("connect"),this.emitBuffered()},p.prototype.emitBuffered=function(){var e;for(e=0;e<this.receiveBuffer.length;e++)f.apply(this,this.receiveBuffer[e]);for(this.receiveBuffer=[],e=0;e<this.sendBuffer.length;e++)this.packet(this.sendBuffer[e]);this.sendBuffer=[]},p.prototype.ondisconnect=function(){u("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")},p.prototype.destroy=function(){if(this.subs){for(var e=0;e<this.subs.length;e++)this.subs[e].destroy();this.subs=null}this.io.destroy(this)},p.prototype.close=p.prototype.disconnect=function(){return this.connected&&(u("performing disconnect (%s)",this.nsp),this.packet({type:n.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this},p.prototype.compress=function(e){return this.flags=this.flags||{},this.flags.compress=e,this}},"./node_modules/socket.io-client/lib/url.js":(e,t,r)=>{var n=r("./node_modules/parseuri/index.js"),o=r("./node_modules/debug/src/browser.js")("socket.io-client:url");e.exports=function(e,t){var s=e;t=t||r.g.location,null==e&&(e=t.protocol+"//"+t.host),"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?t.protocol+e:t.host+e),/^(https?|wss?):\/\//.test(e)||(o("protocol-less url %s",e),e=void 0!==t?t.protocol+"//"+e:"https://"+e),o("parse %s",e),s=n(e)),s.port||(/^(http|ws)$/.test(s.protocol)?s.port="80":/^(http|ws)s$/.test(s.protocol)&&(s.port="443")),s.path=s.path||"/";var i=-1!==s.host.indexOf(":")?"["+s.host+"]":s.host;return s.id=s.protocol+"://"+i+":"+s.port,s.href=s.protocol+"://"+i+(t&&t.port===s.port?"":":"+s.port),s}},"./node_modules/to-array/index.js":e=>{e.exports=function(e,t){for(var r=[],n=(t=t||0)||0;n<e.length;n++)r[n-t]=e[n];return r}},"./node_modules/yeast/index.js":e=>{"use strict";var t,r="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),n={},o=0,s=0;function i(e){var t="";do{t=r[e%64]+t,e=Math.floor(e/64)}while(e>0);return t}function a(){var e=i(+new Date);return e!==t?(o=0,t=e):e+"."+i(o++)}for(;s<64;s++)n[r[s]]=s;a.encode=i,a.decode=function(e){var t=0;for(s=0;s<e.length;s++)t=64*t+n[e.charAt(s)];return t},e.exports=a},"?1bcf":()=>{}},t={};function s(r){var n=t[r];if(void 0!==n)return n.exports;var o=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(o.exports,o,o.exports,s),o.loaded=!0,o.exports}return s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),s("./src/index.js")})(),e.exports=s()},6877:e=>{e.exports=function(e,t,r,n,o){var s={};return Object.keys(n).forEach((function(e){s[e]=n[e]})),s.enumerable=!!s.enumerable,s.configurable=!!s.configurable,("value"in s||s.initializer)&&(s.writable=!0),s=r.slice().reverse().reduce((function(r,n){return n(e,t,r)||r}),s),o&&void 0!==s.initializer&&(s.value=s.initializer?s.initializer.call(o):void 0,s.initializer=void 0),void 0===s.initializer&&(Object.defineProperty(e,t,s),s=null),s},e.exports.__esModule=!0,e.exports.default=e.exports},3897:e=>{e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n},e.exports.__esModule=!0,e.exports.default=e.exports},5372:e=>{e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports},3405:(e,t,r)=>{var n=r(3897);e.exports=function(e){if(Array.isArray(e))return n(e)},e.exports.__esModule=!0,e.exports.default=e.exports},6115:e=>{e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports},7156:e=>{function t(e,t,r,n,o,s,i){try{var a=e[s](i),u=a.value}catch(e){return void r(e)}a.done?t(u):Promise.resolve(u).then(n,o)}e.exports=function(e){return function(){var r=this,n=arguments;return new Promise((function(o,s){var i=e.apply(r,n);function a(e){t(i,o,s,a,u,"next",e)}function u(e){t(i,o,s,a,u,"throw",e)}a(void 0)}))}},e.exports.__esModule=!0,e.exports.default=e.exports},6690:e=>{e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},3515:(e,t,r)=>{var n=r(6015),o=r(9617);function s(t,r,i){return o()?(e.exports=s=Reflect.construct.bind(),e.exports.__esModule=!0,e.exports.default=e.exports):(e.exports=s=function(e,t,r){var o=[null];o.push.apply(o,t);var s=new(Function.bind.apply(e,o));return r&&n(s,r.prototype),s},e.exports.__esModule=!0,e.exports.default=e.exports),s.apply(null,arguments)}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports},9728:(e,t,r)=>{var n=r(4062);function o(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,n(o.key),o)}}e.exports=function(e,t,r){return t&&o(e.prototype,t),r&&o(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},8416:(e,t,r)=>{var n=r(4062);e.exports=function(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},434:e=>{function t(){return e.exports=t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},e.exports.__esModule=!0,e.exports.default=e.exports,t.apply(this,arguments)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},1588:(e,t,r)=>{var n=r(1753);function o(){return"undefined"!=typeof Reflect&&Reflect.get?(e.exports=o=Reflect.get.bind(),e.exports.__esModule=!0,e.exports.default=e.exports):(e.exports=o=function(e,t,r){var o=n(e,t);if(o){var s=Object.getOwnPropertyDescriptor(o,t);return s.get?s.get.call(arguments.length<3?e:r):s.value}},e.exports.__esModule=!0,e.exports.default=e.exports),o.apply(this,arguments)}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},3808:e=>{function t(r){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},1655:(e,t,r)=>{var n=r(6015);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&n(e,t)},e.exports.__esModule=!0,e.exports.default=e.exports},4836:e=>{e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},6035:e=>{e.exports=function(e){return-1!==Function.toString.call(e).indexOf("[native code]")},e.exports.__esModule=!0,e.exports.default=e.exports},9617:e=>{e.exports=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}},e.exports.__esModule=!0,e.exports.default=e.exports},9498:e=>{e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.__esModule=!0,e.exports.default=e.exports},8872:e=>{e.exports=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,s,i,a=[],u=!0,c=!1;try{if(s=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=s.call(r)).done)&&(a.push(n.value),a.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return a}},e.exports.__esModule=!0,e.exports.default=e.exports},2218:e=>{e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},2281:e=>{e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},215:(e,t,r)=>{var n=r(7071);e.exports=function(e,t){if(null==e)return{};var r,o,s=n(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)r=i[o],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s},e.exports.__esModule=!0,e.exports.default=e.exports},7071:e=>{e.exports=function(e,t){if(null==e)return{};var r,n,o={},s=Object.keys(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)>=0||(o[r]=e[r]);return o},e.exports.__esModule=!0,e.exports.default=e.exports},4993:(e,t,r)=>{var n=r(8698).default,o=r(6115);e.exports=function(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return o(e)},e.exports.__esModule=!0,e.exports.default=e.exports},7061:(e,t,r)=>{var n=r(8698).default;function o(){"use strict";e.exports=o=function(){return t},e.exports.__esModule=!0,e.exports.default=e.exports;var t={},r=Object.prototype,s=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},u=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof y?t:y,s=Object.create(o.prototype),a=new j(n||[]);return i(s,"_invoke",{value:S(e,r,a)}),s}function d(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var h={};function y(){}function v(){}function m(){}var b={};f(b,u,(function(){return this}));var g=Object.getPrototypeOf,w=g&&g(g(T([])));w&&w!==r&&s.call(w,u)&&(b=w);var k=m.prototype=y.prototype=Object.create(b);function E(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function O(e,t){var r;i(this,"_invoke",{value:function(o,i){function a(){return new t((function(r,a){!function r(o,i,a,u){var c=d(e[o],e,i);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==n(f)&&s.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,a,u)}),(function(e){r("throw",e,a,u)})):t.resolve(f).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,u)}))}u(c.arg)}(o,i,r,a)}))}return r=r?r.then(a,a):a()}})}function S(e,t,r){var n="suspendedStart";return function(o,s){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw s;return P()}for(r.method=o,r.arg=s;;){var i=r.delegate;if(i){var a=_(i,r);if(a){if(a===h)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=d(e,t,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===h)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function _(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,_(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var o=d(n,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,h;var s=o.arg;return s?s.done?(t[e.resultName]=s.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):s:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function R(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(R,this),this.reset(!0)}function T(e){if(e){var t=e[u];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,n=function t(){for(;++r<e.length;)if(s.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return n.next=n}}return{next:P}}function P(){return{value:void 0,done:!0}}return v.prototype=m,i(k,"constructor",{value:m,configurable:!0}),i(m,"constructor",{value:v,configurable:!0}),v.displayName=f(m,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},E(O.prototype),f(O.prototype,c,(function(){return this})),t.AsyncIterator=O,t.async=function(e,r,n,o,s){void 0===s&&(s=Promise);var i=new O(p(e,r,n,o),s);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},E(k),f(k,l,"Generator"),f(k,u,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=T,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!e)for(var t in this)"t"===t.charAt(0)&&s.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n],i=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var a=s.call(o,"catchLoc"),u=s.call(o,"finallyLoc");if(a&&u){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&s.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:T(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},t}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},6015:e=>{function t(r,n){return e.exports=t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r,n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},7424:(e,t,r)=>{var n=r(5372),o=r(8872),s=r(6116),i=r(2218);e.exports=function(e,t){return n(e)||o(e,t)||s(e,t)||i()},e.exports.__esModule=!0,e.exports.default=e.exports},1753:(e,t,r)=>{var n=r(3808);e.exports=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=n(e)););return e},e.exports.__esModule=!0,e.exports.default=e.exports},1589:(e,t,r)=>{var n=r(5372),o=r(9498),s=r(6116),i=r(2218);e.exports=function(e){return n(e)||o(e)||s(e)||i()},e.exports.__esModule=!0,e.exports.default=e.exports},861:(e,t,r)=>{var n=r(3405),o=r(9498),s=r(6116),i=r(2281);e.exports=function(e){return n(e)||o(e)||s(e)||i()},e.exports.__esModule=!0,e.exports.default=e.exports},5036:(e,t,r)=>{var n=r(8698).default;e.exports=function(e,t){if("object"!==n(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!==n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},4062:(e,t,r)=>{var n=r(8698).default,o=r(5036);e.exports=function(e){var t=o(e,"string");return"symbol"===n(t)?t:String(t)},e.exports.__esModule=!0,e.exports.default=e.exports},8698:e=>{function t(r){return e.exports=t="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},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},6116:(e,t,r)=>{var n=r(3897);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports},3496:(e,t,r)=>{var n=r(3808),o=r(6015),s=r(6035),i=r(3515);function a(t){var r="function"==typeof Map?new Map:void 0;return e.exports=a=function(e){if(null===e||!s(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(e))return r.get(e);r.set(e,t)}function t(){return i(e,arguments,n(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),o(t,e)},e.exports.__esModule=!0,e.exports.default=e.exports,a(t)}e.exports=a,e.exports.__esModule=!0,e.exports.default=e.exports},4687:(e,t,r)=>{var n=r(7061)();e.exports=n;try{regeneratorRuntime=n}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={exports:{}};return e[n].call(s.exports,s,s.exports,r),s.exports}return r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r(5579)})());
|