webcom
Version:
Webcom library
19 lines • 163 kB
JavaScript
/*!
* Webcom. Build realtime apps. Share and sync data instantly between your clients
*
* Module name: Webcom
* Version: 3.10.1
* Created: 2025-11-07T12:55:57.524Z
*
* Copyright (C) <2015-2025> Orange
*
* This software is confidential and proprietary information of Orange.
* You shall not disclose such Confidential Information and shall use it only in
* accordance with the terms of the agreement you entered into.
* Unauthorized copying of this file, via any medium is strictly prohibited.
*
* If you are Orange employee you shall use this software in accordance with
* the Orange Source Charter (http://opensource.itn.ftgroup/index.php/Orange_Source_Charter)
*/(()=>{var e={79:e=>{e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r},e.exports.__esModule=!0,e.exports.default=e.exports},171:(e,t,n)=>{"use strict";n.d(t,{J:()=>r});var r=function(){if("undefined"!=typeof globalThis)return globalThis;return global}()},579:(e,t,n)=>{var r=n(3738).default;e.exports=function(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}throw new TypeError(r(e)+" is not iterable")},e.exports.__esModule=!0,e.exports.default=e.exports},887:(e,t,n)=>{var r=n(6993),i=n(1791);e.exports=function(e,t,n,o,a){return new i(r().w(e,t,n,o),a||Promise)},e.exports.__esModule=!0,e.exports.default=e.exports},1132:(e,t,n)=>{var r=n(5901),i=n(9291),o=n(7122),a=n(1869);e.exports=function(e){return r(e)||i(e)||o(e)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},1133:(e,t,n)=>{"use strict";n.d(t,{Ay:()=>T,MX:()=>p,d1:()=>O,h:()=>P});var r=n(1132),i=n.n(r),o=n(7383),a=n.n(o),s=n(4579),u=n.n(s),c=n(5715),l=n.n(c),h=n(9224),d=n(9170),f=n(8203),v=-1,p=" ",_=!1,g=15,y=[],m={},k={},b={},w="_leaf_";function C(e){return e?e.split("."):[]}function E(e){return{disabledDepth:x(e,b),enabledDepth:x(e,k)}}function S(e,t,n,r){for(var i=0;i<e.length;){var o=e[i++];t.hasOwnProperty(o)||(t[o]={}),t=t[o]}r&&Object.keys(t).forEach(function(e){return delete t[e]}),t[w]=n}function N(e,t){for(var n=0;n<e.length;){var r=e[n++];if(!t.hasOwnProperty(r))return;t=t[r]}delete t[w]}function x(e,t){var n=-1,r=0;do{t.hasOwnProperty(w)&&(n=r)}while(r<e.length&&(t=t[e[r++]]));return n}function D(e,t){Object.entries(e||{}).forEach(function(e){var n=l()(e,2),r=n[0],i=n[1];r===w?t(i):D(i,t)})}function A(e,t){for(var n=[],r=0;t&&r<e.length;)t=t[e[r++]];return D(t,function(e){return n.push(e)}),n}function R(e){_=e,y.forEach(function(e){return e.displayTimestamp=_})}var O="LogManager",T=function(){function e(){a()(this,e)}return u()(e,null,[{key:"enable",value:function(t){(0,f.ar)([O,".enable"],arguments,(0,f.lq)(f.Yj));var n=C(t),r=E(n),i=r.enabledDepth,o=r.disabledDepth;i<=o&&(o<0&&e.disable(),S(n,k,!0,!0),N(n,b),A(n,m).forEach(function(e){return e.setLevel(I)}))}},{key:"disable",value:function(e){(0,f.ar)([O,".disable"],arguments,(0,f.lq)(f.Yj));var t=C(e),n=E(t),r=n.enabledDepth;n.disabledDepth<=r&&(S(t,b,!0,!0),N(t,k),A(t,m).forEach(function(e){return e.setLevel(v)}))}},{key:"showTimestamp",value:function(){(0,f.ar)([O,".showTimestamp"],arguments),R(!0)}},{key:"hideTimestamp",value:function(){(0,f.ar)([O,".hideTimestamp"],arguments),R(!1)}},{key:"setPrefixWidth",value:function(e){(0,f.ar)([O,".setPrefixWidth"],arguments,f.vM),e<0?e=0:e>p.length&&(e=p.length),g=e,y.forEach(function(e){return e.setPrefixWidth(g)})}},{key:"level",get:function(){return I},set:function(e){(0,f.ar)([O,".level"],arguments,f.vM),e>v&&e!==I&&(y.forEach(function(t){return t.updateLevel(e)}),I=e)}},{key:"LOG",get:function(){return 4}},{key:"INFO",get:function(){return 3}},{key:"WARN",get:function(){return 2}},{key:"ERROR",get:function(){return 1}},{key:"NONE",get:function(){return 0}},{key:"debugOnCallback",value:function(e){var t=e&&e.toUpperCase();return function(e,n){return d.k.log("********** UPDATE ".concat(t||e.ref().pathString()," **********"),e.toString(),n?"[<<".concat(n,"]"):"")}}},{key:"debugOnCompletionCallback",value:function(e,t){var n=e&&e.toUpperCase();return function(e){return e?d.k.log("********** REVOKED ".concat(n," **********"),e):d.k.log("********** COMPLETED ".concat(n," **********")),t}}},{key:"debugOnCallbackWithCancel",value:function(t){var n=t&&t.toUpperCase();return[e.debugOnCallback(t),function(e){return d.k.log.apply(d.k,["********** COMPLETE ".concat(n," **********")].concat(i()(e?["FAILED:",e.code,e.message]:["cancelled"])))}]}}])}();function P(e,t){var n=C(e),r=new h.A(n,t||n[n.length-1],_,g);return function(e){var t=e.fqdn;S(t,m,e),y.push(e);var n=E(t),r=n.disabledDepth,i=n.enabledDepth;e.setLevel(i>=r?I:v)}(r),r}var I=T.INFO},1156:e=>{e.exports=function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],u=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);u=!0);}catch(e){c=!0,i=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}},e.exports.__esModule=!0,e.exports.default=e.exports},1791:(e,t,n)=>{var r=n(5172),i=n(5546);e.exports=function e(t,n){function o(e,i,a,s){try{var u=t[e](i),c=u.value;return c instanceof r?n.resolve(c.v).then(function(e){o("next",e,a,s)},function(e){o("throw",e,a,s)}):n.resolve(c).then(function(e){u.value=e,a(u)},function(e){return o("throw",e,a,s)})}catch(e){s(e)}}var a;this.next||(i(e.prototype),i(e.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),i(this,"_invoke",function(e,t,r){function i(){return new n(function(t,n){o(e,r,t,n)})}return a=a?a.then(i,i):i()},!0)},e.exports.__esModule=!0,e.exports.default=e.exports},1869: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},2395:(e,t,n)=>{var r=n(9552);function i(){return e.exports=i="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=r(e,t);if(i){var o=Object.getOwnPropertyDescriptor(i,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},e.exports.__esModule=!0,e.exports.default=e.exports,i.apply(null,arguments)}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},2475: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},2987:e=>{e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports},3072:e=>{function t(n){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(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},3412:(e,t,n)=>{"use strict";n.d(t,{Et:()=>u,Gv:()=>l,Kg:()=>s,Lm:()=>a,Tn:()=>c,yi:()=>h});var r=n(3738),i=n.n(r),o=n(5296);function a(e){return"boolean"==typeof e}function s(e){return"string"==typeof e}function u(e){return"number"==typeof e}function c(e){return"function"==typeof e}function l(e){return"object"===i()(e)}function h(){return o.Ls&&(window.navigator.userAgent.match(/CriOS|Twitter for iPhone|FBAN\/FBIOS|Windows Phone/)||window.navigator.standalone)}},3693:(e,t,n)=>{var r=n(7736);e.exports=function(e,t,n){return(t=r(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports},3738:e=>{function t(n){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(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},4373:e=>{e.exports=function(e){var t=Object(e),n=[];for(var r in t)n.unshift(r);return function e(){for(;n.length;)if((r=n.pop())in t)return e.value=r,e.done=!1,e;return e.done=!0,e}},e.exports.__esModule=!0,e.exports.default=e.exports},4579:(e,t,n)=>{var r=n(7736);function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,r(i.key),i)}}e.exports=function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},4633:(e,t,n)=>{var r=n(5172),i=n(6993),o=n(5869),a=n(887),s=n(1791),u=n(4373),c=n(579);function l(){"use strict";var t=i(),n=t.m(l),h=(Object.getPrototypeOf?Object.getPrototypeOf(n):n.__proto__).constructor;function d(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===h||"GeneratorFunction"===(t.displayName||t.name))}var f={throw:1,return:2,break:3,continue:3};function v(e){var t,n;return function(r){t||(t={stop:function(){return n(r.a,2)},catch:function(){return r.v},abrupt:function(e,t){return n(r.a,f[e],t)},delegateYield:function(e,i,o){return t.resultName=i,n(r.d,c(e),o)},finish:function(e){return n(r.f,e)}},n=function(e,n,i){r.p=t.prev,r.n=t.next;try{return e(n,i)}finally{t.next=r.n}}),t.resultName&&(t[t.resultName]=r.v,t.resultName=void 0),t.sent=r.v,t.next=r.n;try{return e.call(this,t)}finally{r.p=t.prev,r.n=t.next}}}return(e.exports=l=function(){return{wrap:function(e,n,r,i){return t.w(v(e),n,r,i&&i.reverse())},isGeneratorFunction:d,mark:t.m,awrap:function(e,t){return new r(e,t)},AsyncIterator:s,async:function(e,t,n,r,i){return(d(t)?a:o)(v(e),t,n,r,i)},keys:u,values:c}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=l,e.exports.__esModule=!0,e.exports.default=e.exports},4756:(e,t,n)=>{var r=n(4633)();e.exports=r;try{regeneratorRuntime=r}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},5172:e=>{e.exports=function(e,t){this.v=e,this.k=t},e.exports.__esModule=!0,e.exports.default=e.exports},5280:(e,t,n)=>{"use strict";n.d(t,{DJ:()=>u,vG:()=>d,wg:()=>a,yb:()=>l});var r=n(171),i=n(5854),o="setTimeout",a=i.y[o];a||(a=r.J[o]),(0,i.aZ)(o,function(){return a},function(e){return a=e}),r.J[o]||(r.J[o]=a),r.J.setImmediate||(r.J.setImmediate=a);var s="clearTimeout",u=i.y[s];u||(u=r.J[s]),(0,i.aZ)(s,function(){return u},function(e){return u=e}),r.J[s]||(r.J[s]=u),r.J.clearImmediate||(r.J.clearImmediate=u);var c="setInterval",l=i.y[c];l||(l=r.J[c]),(0,i.aZ)(c,function(){return l},function(e){return l=e});var h="clearInterval",d=i.y[h];d||(d=r.J[h]),(0,i.aZ)(h,function(){return d},function(e){return d=e})},5296:(e,t,n)=>{"use strict";n.d(t,{Ls:()=>h,Ov:()=>l,Xb:()=>d});n(171);var r=n(5854),i="browser",o="mobile/",a="node",s="".concat(o,"android"),u="".concat(o,"iOS"),c={};c[i]="b",c[s]="a",c[u]="i",c[a]="n";var l,h=!0,d=!1,f="device",v=r.y[f];v||p(a);function p(e){v=e,h=e===i,d=0===e.indexOf(o),l=(c[e]||"")+"3.10.1"}(0,r.aZ)(f,function(){return v},function(e){return p(e)})},5304:(e,t,n)=>{"use strict";n.d(t,{P2:()=>o,cs:()=>a,lQ:()=>i,si:()=>s});var r=n(5280),i=Function.prototype;function o(e){try{e()}catch(e){(0,r.wg)(function(){throw e})}}function a(e,t){var n=e||i;try{return t(n)}catch(e){n(e)}}function s(e){return new Promise(function(t,n){return e(function(e,r){return e&&n(e)||t(r)})})}},5407:e=>{e.exports=function(e){throw new TypeError('"'+e+'" is read-only')},e.exports.__esModule=!0,e.exports.default=e.exports},5546:e=>{function t(n,r,i,o){var a=Object.defineProperty;try{a({},"",{})}catch(n){a=0}e.exports=t=function(e,n,r,i){function o(n,r){t(e,n,function(e){return this._invoke(n,r,e)})}n?a?a(e,n,{value:r,enumerable:!i,configurable:!i,writable:!i}):e[n]=r:(o("next",0),o("throw",1),o("return",2))},e.exports.__esModule=!0,e.exports.default=e.exports,t(n,r,i,o)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},5636:e=>{function t(n,r){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(n,r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},5715:(e,t,n)=>{var r=n(2987),i=n(1156),o=n(7122),a=n(7752);e.exports=function(e,t){return r(e)||i(e,t)||o(e,t)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},5854:(e,t,n)=>{"use strict";n.d(t,{El:()=>i,aZ:()=>o,y:()=>r});var r=n(171).J.WebcomDependencies||{},i={};function o(e,t,n){Object.defineProperty(i,e,{enumerable:!0,get:t,set:n})}},5869:(e,t,n)=>{var r=n(887);e.exports=function(e,t,n,i,o){var a=r(e,t,n,i,o);return a.next().then(function(e){return e.done?e.value:a.next()})},e.exports.__esModule=!0,e.exports.default=e.exports},5901:(e,t,n)=>{var r=n(79);e.exports=function(e){if(Array.isArray(e))return r(e)},e.exports.__esModule=!0,e.exports.default=e.exports},6749:(e,t,n)=>{"use strict";n.d(t,{n:()=>_});var r=n(5715),i=n.n(r),o=n(7383),a=n.n(o),s=n(4579),u=n.n(s),c=n(7234);const l=require("http");var h=n.n(l);const d=require("https");var f=n.n(d),v=n(3412),p=n(8203),_=u()(function e(){a()(this,e),this.readyState=0,this._headers={},this.status=0},[{key:"open",value:function(e,t){this._method=e,this._href=t}},{key:"setRequestHeader",value:function(e,t){this._headers[e]=t}},{key:"send",value:function(e){(0,v.Tn)(this.onreadystatechange)||(0,p.$8)("NodeXmlHttpRequest","missing onreadystatechange event handler"),e&&(e=Buffer.from(e),this._headers["Content-Length"]=e.length),y.call(this,e)}},{key:"getAllResponseHeaders",value:function(){return Object.entries(this._headers).reduce(function(e,t){var n=i()(t,2),r=n[0],o=n[1];return"".concat(e,"\n").concat(r,": ").concat(o)},"")}}],[{key:"DONE",get:function(){return 4}}]);function g(e){this.responseText=e.message,this._headers={},this.readyState=4,this.onreadystatechange()}function y(e){var t=this,n=(0,c.u)(this._href),r=n.url,i=n.secure,o=n.proxy;if(o)if(i){var a=r.hostname+":443",s=h().request({protocol:o.protocol,hostname:o.hostname,port:o.port,method:"CONNECT",path:a});s.on("connect",function(n,i){if(200===n.statusCode){var o=f().request({host:r.host,path:r.pathname+r.search+r.hash,method:t._method,agent:new(f().Agent)({socket:i})});m.call(t,o,e)}else g.call(t,new Error("Status ".concat(n.statusCode)))}),s.on("error",g.bind(this)),s.setHeader("Host",a),s.end()}else{var u=h().request({protocol:o.protocol,hostname:o.hostname,port:o.port,method:this._method,path:r.href});u.setHeader("Host",r.host),m.call(this,u,e)}else{var l=(i?f():h()).request({protocol:r.protocol,hostname:r.hostname,port:r.port,method:this._method,path:r.pathname+r.search+r.hash});l.setHeader("Host",r.host),m.call(this,l,e)}}function m(e,t){var n=this;Object.entries(this._headers).forEach(function(t){var n=i()(t,2),r=n[0],o=n[1];return e.setHeader(r,o)}),t&&e.write(t),e.on("error",g.bind(this)),e.on("response",function(e){var r=[];e.on("data",function(e){return r.push(e)}),e.on("error",g.bind(n)),e.on("end",function(){n.status=e.statusCode;var i=[301,302,303,307,308].includes(n.status)&&e.headers.location;i?(n._href=i,y.call(n,t)):(n.readyState=4,n.responseText=Buffer.concat(r).toString("utf8"),n._headers=e.headers,n.onreadystatechange())})}),e.end()}},6779:(e,t)=>{"use strict";var n,r={cipher:{},hash:{},keyexchange:{},mode:{},misc:{},codec:{},exception:{corrupt:function(e){this.toString=function(){return"CORRUPT: "+this.message},this.message=e},invalid:function(e){this.toString=function(){return"INVALID: "+this.message},this.message=e},bug:function(e){this.toString=function(){return"BUG: "+this.message},this.message=e},notReady:function(e){this.toString=function(){return"NOT READY: "+this.message},this.message=e}}};r.bitArray={bitSlice:function(e,t,n){return e=r.bitArray._shiftRight(e.slice(t/32),32-(31&t)).slice(1),void 0===n?e:r.bitArray.clamp(e,n-t)},extract:function(e,t,n){var r=Math.floor(-t-n&31);return(-32&(t+n-1^t)?e[t/32|0]<<32-r^e[t/32+1|0]>>>r:e[t/32|0]>>>r)&(1<<n)-1},concat:function(e,t){if(0===e.length||0===t.length)return e.concat(t);var n=e[e.length-1],i=r.bitArray.getPartial(n);return 32===i?e.concat(t):r.bitArray._shiftRight(t,i,0|n,e.slice(0,e.length-1))},bitLength:function(e){var t,n=e.length;return 0===n?0:(t=e[n-1],32*(n-1)+r.bitArray.getPartial(t))},clamp:function(e,t){if(32*e.length<t)return e;var n=(e=e.slice(0,Math.ceil(t/32))).length;return t&=31,n>0&&t&&(e[n-1]=r.bitArray.partial(t,e[n-1]&2147483648>>t-1,1)),e},partial:function(e,t,n){return 32===e?t:(n?0|t:t<<32-e)+1099511627776*e},getPartial:function(e){return Math.round(e/1099511627776)||32},equal:function(e,t){if(r.bitArray.bitLength(e)!==r.bitArray.bitLength(t))return!1;var n,i=0;for(n=0;n<e.length;n++)i|=e[n]^t[n];return 0===i},_shiftRight:function(e,t,n,i){var o,a,s;for(void 0===i&&(i=[]);t>=32;t-=32)i.push(n),n=0;if(0===t)return i.concat(e);for(o=0;o<e.length;o++)i.push(n|e[o]>>>t),n=e[o]<<32-t;return a=e.length?e[e.length-1]:0,s=r.bitArray.getPartial(a),i.push(r.bitArray.partial(t+s&31,t+s>32?n:i.pop(),1)),i},_xor4:function(e,t){return[e[0]^t[0],e[1]^t[1],e[2]^t[2],e[3]^t[3]]},byteswapM:function(e){var t,n;for(t=0;t<e.length;++t)n=e[t],e[t]=n>>>24|n>>>8&65280|(65280&n)<<8|n<<24;return e}},r.codec.utf8String={fromBits:function(e){var t,n,i="",o=r.bitArray.bitLength(e);for(t=0;t<o/8;t++)3&t||(n=e[t/4]),i+=String.fromCharCode(n>>>8>>>8>>>8),n<<=8;return decodeURIComponent(escape(i))},toBits:function(e){e=unescape(encodeURIComponent(e));var t,n=[],i=0;for(t=0;t<e.length;t++)i=i<<8|e.charCodeAt(t),3&~t||(n.push(i),i=0);return 3&t&&n.push(r.bitArray.partial(8*(3&t),i)),n}},r.codec.base64={_chars:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",fromBits:function(e,t,n){var i,o="",a=0,s=r.codec.base64._chars,u=0,c=r.bitArray.bitLength(e);for(n&&(s=s.substr(0,62)+"-_"),i=0;6*o.length<c;)o+=s.charAt((u^e[i]>>>a)>>>26),a<6?(u=e[i]<<6-a,a+=26,i++):(u<<=6,a-=6);for(;3&o.length&&!t;)o+="=";return o},toBits:function(e,t){e=e.replace(/\s|=/g,"");var n,i,o=[],a=0,s=r.codec.base64._chars,u=0;for(t&&(s=s.substr(0,62)+"-_"),n=0;n<e.length;n++){if((i=s.indexOf(e.charAt(n)))<0)throw new r.exception.invalid("this isn't base64!");a>26?(a-=26,o.push(u^i>>>a),u=i<<32-a):u^=i<<32-(a+=6)}return 56&a&&o.push(r.bitArray.partial(56&a,u,1)),o}},r.codec.base64url={fromBits:function(e){return r.codec.base64.fromBits(e,1,1)},toBits:function(e){return r.codec.base64.toBits(e,1)}},r.hash.sha256=function(e){this._key[0]||this._precompute(),e?(this._h=e._h.slice(0),this._buffer=e._buffer.slice(0),this._length=e._length):this.reset()},r.hash.sha256.hash=function(e){return(new r.hash.sha256).update(e).finalize()},r.hash.sha256.prototype={blockSize:512,reset:function(){return this._h=this._init.slice(0),this._buffer=[],this._length=0,this},update:function(e){"string"==typeof e&&(e=r.codec.utf8String.toBits(e));var t,n=this._buffer=r.bitArray.concat(this._buffer,e),i=this._length,o=this._length=i+r.bitArray.bitLength(e);if(o>9007199254740991)throw new r.exception.invalid("Cannot hash more than 2^53 - 1 bits");if("undefined"!=typeof Uint32Array){var a=new Uint32Array(n),s=0;for(t=512+i-(512+i&511);t<=o;t+=512)this._block(a.subarray(16*s,16*(s+1))),s+=1;n.splice(0,16*s)}else for(t=512+i-(512+i&511);t<=o;t+=512)this._block(n.splice(0,16));return this},finalize:function(){var e,t=this._buffer,n=this._h;for(e=(t=r.bitArray.concat(t,[r.bitArray.partial(1,1)])).length+2;15&e;e++)t.push(0);for(t.push(Math.floor(this._length/4294967296)),t.push(0|this._length);t.length;)this._block(t.splice(0,16));return this.reset(),n},_init:[],_key:[],_precompute:function(){var e,t,n=0,r=2;function i(e){return 4294967296*(e-Math.floor(e))|0}for(;n<64;r++){for(t=!0,e=2;e*e<=r;e++)if(r%e===0){t=!1;break}t&&(n<8&&(this._init[n]=i(Math.pow(r,.5))),this._key[n]=i(Math.pow(r,1/3)),n++)}},_block:function(e){var t,n,r,i,o=this._h,a=this._key,s=o[0],u=o[1],c=o[2],l=o[3],h=o[4],d=o[5],f=o[6],v=o[7];for(t=0;t<64;t++)t<16?n=e[t]:(r=e[t+1&15],i=e[t+14&15],n=e[15&t]=(r>>>7^r>>>18^r>>>3^r<<25^r<<14)+(i>>>17^i>>>19^i>>>10^i<<15^i<<13)+e[15&t]+e[t+9&15]|0),n=n+v+(h>>>6^h>>>11^h>>>25^h<<26^h<<21^h<<7)+(f^h&(d^f))+a[t],v=f,f=d,d=h,h=l+n|0,l=c,c=u,s=n+((u=s)&c^l&(u^c))+(u>>>2^u>>>13^u>>>22^u<<30^u<<19^u<<10)|0;o[0]=o[0]+s|0,o[1]=o[1]+u|0,o[2]=o[2]+c|0,o[3]=o[3]+l|0,o[4]=o[4]+h|0,o[5]=o[5]+d|0,o[6]=o[6]+f|0,o[7]=o[7]+v|0}},r.hash.sha1=function(e){e?(this._h=e._h.slice(0),this._buffer=e._buffer.slice(0),this._length=e._length):this.reset()},r.hash.sha1.hash=function(e){return(new r.hash.sha1).update(e).finalize()},r.hash.sha1.prototype={blockSize:512,reset:function(){return this._h=this._init.slice(0),this._buffer=[],this._length=0,this},update:function(e){"string"==typeof e&&(e=r.codec.utf8String.toBits(e));var t,n=this._buffer=r.bitArray.concat(this._buffer,e),i=this._length,o=this._length=i+r.bitArray.bitLength(e);if(o>9007199254740991)throw new r.exception.invalid("Cannot hash more than 2^53 - 1 bits");if("undefined"!=typeof Uint32Array){var a=new Uint32Array(n),s=0;for(t=this.blockSize+i-(this.blockSize+i&this.blockSize-1);t<=o;t+=this.blockSize)this._block(a.subarray(16*s,16*(s+1))),s+=1;n.splice(0,16*s)}else for(t=this.blockSize+i-(this.blockSize+i&this.blockSize-1);t<=o;t+=this.blockSize)this._block(n.splice(0,16));return this},finalize:function(){var e,t=this._buffer,n=this._h;for(e=(t=r.bitArray.concat(t,[r.bitArray.partial(1,1)])).length+2;15&e;e++)t.push(0);for(t.push(Math.floor(this._length/4294967296)),t.push(0|this._length);t.length;)this._block(t.splice(0,16));return this.reset(),n},_init:[1732584193,4023233417,2562383102,271733878,3285377520],_key:[1518500249,1859775393,2400959708,3395469782],_f:function(e,t,n,r){return e<=19?t&n|~t&r:e<=39?t^n^r:e<=59?t&n|t&r|n&r:e<=79?t^n^r:void 0},_S:function(e,t){return t<<e|t>>>32-e},_block:function(e){var t,n,r,i,o,a,s,u,c=this._h;if("undefined"!=typeof Uint32Array){u=Array(80);for(var l=0;l<16;l++)u[l]=e[l]}else u=e;for(r=c[0],i=c[1],o=c[2],a=c[3],s=c[4],t=0;t<=79;t++)t>=16&&(u[t]=this._S(1,u[t-3]^u[t-8]^u[t-14]^u[t-16])),n=this._S(5,r)+this._f(t,i,o,a)+s+u[t]+this._key[Math.floor(t/20)]|0,s=a,a=o,o=this._S(30,i),i=r,r=n;c[0]=c[0]+r|0,c[1]=c[1]+i|0,c[2]=c[2]+o|0,c[3]=c[3]+a|0,c[4]=c[4]+s|0}},e.exports&&(e.exports=r),void 0===(n=function(){return r}.apply(t,[]))||(e.exports=n)},6982:e=>{"use strict";e.exports=require("crypto")},6993:(e,t,n)=>{var r=n(5546);function i(){
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
var t,n,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.toStringTag||"@@toStringTag";function u(e,i,o,a){var s=i&&i.prototype instanceof l?i:l,u=Object.create(s.prototype);return r(u,"_invoke",function(e,r,i){var o,a,s,u=0,l=i||[],h=!1,d={p:0,n:0,v:t,a:f,f:f.bind(t,4),d:function(e,n){return o=e,a=0,s=t,d.n=n,c}};function f(e,r){for(a=e,s=r,n=0;!h&&u&&!i&&n<l.length;n++){var i,o=l[n],f=d.p,v=o[2];e>3?(i=v===r)&&(s=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=t):o[0]<=f&&((i=e<2&&f<o[1])?(a=0,d.v=r,d.n=o[1]):f<v&&(i=e<3||o[0]>r||r>v)&&(o[4]=e,o[5]=r,d.n=v,a=0))}if(i||e>1)return c;throw h=!0,r}return function(i,l,v){if(u>1)throw TypeError("Generator is already running");for(h&&1===l&&f(l,v),a=l,s=v;(n=a<2?t:s)||!h;){o||(a?a<3?(a>1&&(d.n=-1),f(a,s)):d.n=s:d.v=s);try{if(u=2,o){if(a||(i="next"),n=o[i]){if(!(n=n.call(o,s)))throw TypeError("iterator result is not an object");if(!n.done)return n;s=n.value,a<2&&(a=0)}else 1===a&&(n=o.return)&&n.call(o),a<2&&(s=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=t}else if((n=(h=d.n<0)?s:e.call(r,d))!==c)break}catch(e){o=t,a=1,s=e}finally{u=1}}return{value:n,done:h}}}(e,o,a),!0),u}var c={};function l(){}function h(){}function d(){}n=Object.getPrototypeOf;var f=[][a]?n(n([][a]())):(r(n={},a,function(){return this}),n),v=d.prototype=l.prototype=Object.create(f);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,r(e,s,"GeneratorFunction")),e.prototype=Object.create(v),e}return h.prototype=d,r(v,"constructor",d),r(d,"constructor",h),h.displayName="GeneratorFunction",r(d,s,"GeneratorFunction"),r(v),r(v,s,"Generator"),r(v,a,function(){return this}),r(v,"toString",function(){return"[object Generator]"}),(e.exports=i=function(){return{w:u,m:p}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},7122:(e,t,n)=>{var r=n(79);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports},7234:(e,t,n)=>{"use strict";n.d(t,{u:()=>d});var r=n(5854),i="env",o=r.y[i];o||(o=process[i]),(0,r.aZ)(i,function(){return o},function(e){return o=e});var a,s,u,c,l=(0,n(1133).h)("network.nodeProxy");function h(e){try{return new URL(e)}catch(e){return null}}function d(e){var t=new URL(e);switch(t.protocol){case"http:":case"ws:":return a&&c(t)?{url:t,secure:!1,proxy:a}:{url:t,secure:!1};case"https:":case"wss:":return s&&c(t)?{url:t,secure:!0,proxy:s}:{url:t,secure:!0};default:return{url:t,secure:!1}}}!function(){if(a=h(o.http_proxy||o.HTTP_PROXY),s=h(o.https_proxy||o.HTTPS_PROXY),u=o.no_proxy||o.NO_PROXY,l.log("Node.js proxy layer set to: http_proxy='".concat(a,"'; https_proxy='").concat(s,"'; no_proxy=").concat(u)),u){var e=u.split(",");c=e.indexOf("*")<0?function(t){return e.every(function(e){return!t.origin.endsWith(e)})}:function(){return!1}}else c=function(){return!0}}()},7383: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},7550:e=>{function t(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(n){}return(e.exports=t=function(){return!!n},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},7736:(e,t,n)=>{var r=n(3738).default,i=n(9045);e.exports=function(e){var t=i(e,"string");return"symbol"==r(t)?t:t+""},e.exports.__esModule=!0,e.exports.default=e.exports},7752: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},8203:(e,t,n)=>{"use strict";n.d(t,{$8:()=>v,$x:()=>_,Ik:()=>x,Pc:()=>E,WP:()=>A,YD:()=>d,Yj:()=>C,ar:()=>p,b0:()=>c,cK:()=>P,gP:()=>D,gp:()=>k,lq:()=>g,se:()=>f,vA:()=>l,vD:()=>w,vM:()=>N,y:()=>m,yL:()=>R,zB:()=>y,zM:()=>S,zR:()=>u});var r=n(3738),i=n.n(r),o=n(1132),a=n.n(o),s=n(3412),u="Webcom internal error";function c(){v(u,"not (yet) implemented abstract member!")}function l(e,t){e||v(u,t)}var h={values:[]};function d(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];Object.assign(h,{method:e,args:t||[],checkers:r})}function f(e,t,n){h.values.push({name:e,value:t,checker:n})}var v=function(e,t){var n;throw new Error("".concat((n="").concat.apply(n,a()(e)),": ").concat(t))};function p(e,t){if(!h.method){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];d.apply(void 0,[e,t].concat(r))}var o=h.method,a=h.args,s=h.checkers,u=h.values;Object.assign(h,{method:void 0,args:void 0,checkers:void 0,values:[]}),a.length>s.length&&v(o,"too many arguments, ".concat(a.length," instead of ").concat(s.length)),s.forEach(function(e,t){return _(e,a[t],o,function(e){return"argument #".concat(t+1," ").concat(e)})}),u.forEach(function(e){var t=e.name,n=e.value;return _(e.checker,n,o,function(e){return"".concat(t," ").concat(e)})})}function _(e,t,n,r){var i=e(t);i&&v(n,r(i))}function g(e){return function(t){return b("undefined")(t)&&e&&e(t)}}function y(e){return function(t){return null===t?"must not be null":e&&e(t)}}var m=function(e){return void 0===e?"is missing":""};function k(e){return function(t){return!(t instanceof e)&&"must be an instance of ".concat(e.name)}}function b(e){return function(t){return i()(t)!==e&&"must be a ".concat(e)}}var w=b("undefined"),C=b("string"),E=b("function"),S=b("boolean"),N=T(Number.isFinite,"must be a finite number"),x=b("object");function D(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return t.every(function(t){return t(e)})&&"either ".concat(t.map(function(t){return t(e)}).join(" or "))}}function A(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){var n;return t.some(function(t){return n=t(e)})&&n}}function R(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return t.every(function(t){return t!==e})&&"must be either ".concat(t.join(" or "))}}var O="is not valid";function T(e,t){return function(n){return!e(n)&&(t||O)}}T(function(e){return(0,s.Et)(e)&&Math.floor(e)===e},"must be an integer");function P(e,t){return T(function(t){return e.test(t)},t)}},8399:e=>{"use strict";e.exports=require("faye-websocket")},8452:(e,t,n)=>{var r=n(3738).default,i=n(2475);e.exports=function(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return i(e)},e.exports.__esModule=!0,e.exports.default=e.exports},9045:(e,t,n)=>{var r=n(3738).default;e.exports=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},9170:(e,t,n)=>{"use strict";n.d(t,{a:()=>l,k:()=>c});var r=n(1132),i=n.n(r),o=n(171),a=n(5854),s=n(3412),u="console",c=a.y[u],l=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=function(e){return(0,s.Gv)(e)?JSON.stringify(e):(e||"undefined").toString()};if((0,s.Kg)(e)){var a=0;return[e=e.replace(/%(.)/g,function(e,t){switch(t){case"%":return"%";case"s":case"o":case"O":return o(n[a++]);case"d":case"i":case"f":return n[a++];default:return e}})].concat(i()(n.slice(a).map(o))).join(" ")}return[e].concat(n).map(o).join(" ")};function h(e,t,n,r,i){if(!n||!r||!i){var o=t,a=function(e){return function(t){return o("[".concat(e,"] ").concat(t))}};n=n||a("INFO"),r=r||a("WARN"),i=i||a("ERR!"),t=a("LOG ")}return{log:function(){return t.call(e,l.apply(void 0,arguments))},info:function(){return n.call(e,l.apply(void 0,arguments))},warn:function(){return r.call(e,l.apply(void 0,arguments))},error:function(){return i.call(e,l.apply(void 0,arguments))}}}if((0,s.Tn)(c))c=h(o.J,c);else if((0,s.Gv)(c)&&c){var d=c,f=d.log,v=d.info,p=d.warn,_=d.error;c=h(c,f,v,p,_)}else{var g=function(e,t,n){for(var r=arguments.length,i=new Array(r>3?r-3:0),o=3;o<r;o++)i[o-3]=arguments[o];(0,s.Kg)(n)?(n="[".concat(e,"] ")+n,t.apply(void 0,[n].concat(i))):t.apply(void 0,["[".concat(e,"] "),n].concat(i))};c={log:g.bind(void 0,"LOG ",o.J[u].log),info:g.bind(void 0,"INFO",o.J[u].info),warn:g.bind(void 0,"WARN",o.J[u].warn),error:g.bind(void 0,"ERR!",o.J[u].error)}}(0,a.aZ)(u,function(){return c},function(e){return c=e})},9224:(e,t,n)=>{"use strict";n.d(t,{A:()=>y,h:()=>g});var r=n(7383),i=n.n(r),o=n(4579),a=n.n(o),s=n(1132),u=n.n(s),c=n(1133),l=n(9170),h=n(3412),d=n(8203),f=n(5304),v={};function p(e,t){var n=e.length;return n>=t?e.substring(0,t):e+c.MX.substring(0,t-n)}function _(e){return e.map(function(e){return(0,h.Tn)(e)?e():e})}function g(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];(0,d.$8)(d.zR,l.a.apply(void 0,u()(_(t))))}var y=a()(function e(t,n,r,o){i()(this,e),this._fqdn=t,this._prefix=n;var a=t.join(".");this._count=void 0===v[a]?v[a]=0:++v[a],this.displayTimestamp=r,this.setPrefixWidth(o||8),this._log=this._emitLog.bind(this,l.k.log),this._info=this._emitLog.bind(this,l.k.info),this._warn=this._emitLog.bind(this,l.k.warn),this._error=this._emitLog.bind(this,l.k.error),this._enabled=!0},[{key:"fqdn",get:function(){return this._fqdn}},{key:"_emitLog",value:function(e,t){var n=this.displayTimestamp?[(new Date).toISOString()]:[];n.push(this._displayedPrefix);for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];(0,h.Kg)(t)?(n.push(t),t=n.join(" "),e.apply(void 0,[t].concat(u()(_(i))))):e.apply(void 0,n.concat(u()(_([t].concat(i)))))}},{key:"setPrefixWidth",value:function(e){this._displayedPrefix="".concat(p(this._prefix,e)," #").concat(p(this._count.toString(),3))}},{key:"setLevel",value:function(e){this._enabled=e>=0,this.log=e>=c.Ay.LOG?this._log:f.lQ,this.info=e>=c.Ay.INFO?this._info:f.lQ,this.warn=e>=c.Ay.WARN?this._warn:f.lQ,this.error=e>=c.Ay.ERROR?this._error:f.lQ}},{key:"updateLevel",value:function(e){this._enabled&&this.setLevel(e)}}])},9291: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},9293:e=>{function t(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}e.exports=function(e){return function(){var n=this,r=arguments;return new Promise(function(i,o){var a=e.apply(n,r);function s(e){t(a,i,o,s,u,"next",e)}function u(e){t(a,i,o,s,u,"throw",e)}s(void 0)})}},e.exports.__esModule=!0,e.exports.default=e.exports},9511:(e,t,n)=>{var r=n(5636);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&&r(e,t)},e.exports.__esModule=!0,e.exports.default=e.exports},9552:(e,t,n)=>{var r=n(3072);e.exports=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=r(e)););return e},e.exports.__esModule=!0,e.exports.default=e.exports},9646:(e,t,n)=>{var r=n(7550),i=n(5636);e.exports=function(e,t,n){if(r())return Reflect.construct.apply(null,arguments);var o=[null];o.push.apply(o,t);var a=new(e.bind.apply(e,o));return n&&i(a,n.prototype),a},e.exports.__esModule=!0,e.exports.default=e.exports},9896:e=>{"use strict";e.exports=require("fs")}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var r={};(()=>{"use strict";n.d(r,{default:()=>E});var e=n(171),t=n(7383),i=n.n(t),o=n(4579),a=n.n(o),s=n(5715),u=n.n(s),c=n(8203),l=n(1133),h=n(3412),d="WebcomApp",f=a()(function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};i()(this,e),(0,c.ar)(["new ",d],arguments,(0,c.cK)(/^[a-z0-9](?:[-a-z0-9]{0,38}[a-z0-9])?$/),(0,c.lq)((0,c.gP)(c.Ik,c.Yj))),this._logger=(0,l.h)("api.WebcomApp",d),this._services={},this.appId=t,this.config={},(0,h.Kg)(n)&&(n=Object.keys(g).reduce(function(e,t){return e[t]={baseUrl:n},e},{})),this._fillConfig(n),this._logger.log("Initialized %s with options %s",t,JSON.stringify(this.config))},[{key:"dispose",value:function(){(0,c.ar)([d,"#dispose"],arguments),Object.values(this._services).forEach(function(e){return e._dispose()}),this._services={}}},{key:"_fillConfig",value:function(e){v.call(this,e,g)}},{key:"toString",value:function(){return"".concat(this.appId,"{").concat(Object.keys(this._services).join(","),"}")}}]);function v(e,t){var n=this,r=function(e,t,i,o){var a=function(e){return"".concat(d,".Configuration.").concat(o.concat(e).join("."))};t=Object.assign({},t),Object.entries(i).forEach(function(i){var s=u()(i,2),l=s[0],h=s[1];if(h instanceof Object&&!(h instanceof Array))e[l]=e[l]||{},r(e[l],t[l]||{},h,o.concat(l));else{var d=t[l],f=h[1]||function(e){return e};try{e[l]=f(void 0===d?void 0===e[l]?h.length?h[0]:h:e[l]:d)}catch(t){var v=a(l);void 0===t.value?(0,c.$8)(v,t.message):(n._logger.warn("%s: %s",v,t.message),e[l]=t.value)}}delete t[l]}),Object.keys(t).forEach(function(e){return n._logger.warn("%s: unknown config key",a(e))})};r(this.config,e,t,[])}function p(e,t){var n=t.baseUrl;return"/".concat(n.protocol.slice(0,-1),"/").concat(n.host,"/").concat(e.appId,"/")}function _(e,t,n){return"".concat(n.key,":").concat(t,":").concat(p(e,n))}var g={},y=n(5854),m="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz",k=0,b=[];function w(e){for(var t=e.substring(0,8),n=0,r=0;r<8;++r)n=64*n+m.indexOf(t[r]);return n}var C="Webcom",E=a()(function e(){i()(this,e),this._init.apply(this,arguments)},[{key:"_init",value:function(){(0,c.$8)(["new ",C],"this static class cannot be instantiated")}}],[{key:"SDK_VERSION",get:function(){return"3.10.1"}},{key:"Log",get:function(){return l.Ay}},{key:"App",value:function(e,t){return new f(e,t)}},{key:"getUniqueKeyDate",value:function(e){return new Date(w(e))}},{key:"dependencies",get:function(){return y.El}}]),S=(0,l.h)("api.Webcom",C),N=n(1132),x=n.n(N),D=n(5296);function A(e){"http:"===e.protocol&&D.Ls&&"https:"===window.location.protocol&&this._logger.warn("Insecure access to a Webcom service from a secure page. Please setup your service with an https protocol.")}var R=new RegExp("^(?:([^:]+:)//)?(?:[^/@]+@)?([^/:]+(?::\\d+)?)(?:/.*)?$"),O="io.datasync.orange.com";function T(t){if(t&&(e.J.URL&&t instanceof URL||t.href&&t.protocol&&t.host))return t;var n=t?R.exec(t):[O,void 0,O];if(n){var r=u()(n,3),i=r[0],o=r[1],a=r[2];return o||(i="".concat(o="https:","//").concat(i)),{href:i,protocol:o,host:a}}throw new Error("cannot parse base URL: ".concat(t))}function P(e,t){return function(n){var r=e(n);if(r)throw new Error(r);return t?t(n):n}}var I=n(3738),L=n.n(I);function j(e,t,n,r){return F(e.prototype,t,n,r)}function M(e,t,n,r){return q(e,t,{value:n},r)}function F(e,t,n,r){return q(e,t,{get:n},r)}function q(e,t,n,r){return Object.defineProperty(e,t,Object.assign(n,{enumerable:r,configurable:!0}))}var V="some",U="required",W="none",Q=a()(function e(t,n){i()(this,e),(0,c.vA)(t===V||t===U||t===W,"Wrong state value for a new State object: expecting 'some', 'required' or 'none'."),this.state=t,(0,c.vA)(t!==V||n&&n.webcomAuthToken,"Missing details or webcomAuthToken for a new 'some' State"),this.details=n},[{key:"isUnauthenticated",value:function(){return this.state===W}},{key:"isAuthenticated",value:function(){return this.state===V}},{key:"isRequired",value:function(){return this.state===U}},{key:"isSameAs",value:function(e){return this.state===e.state&&(this.state!==V||this.details.webcomAuthToken===e.details.webcomAuthToken)}}]),H=new Q(W),K=new Q(U),J=function(e){return new Q(V,e)};function B(e){try{return new Q(e.state,e.details)}catch(e){return H}}var Y,z="Authentication";function G(e){switch((0,c.ar)([C,".avatarURL"],arguments,c.Ik),e&&e.provider){case"facebook":return"https://graph.facebook.com/".concat(e.providerUid,"/picture?type=large");case"github":return e.providerProfile.avatar_url;case"gitlab":case"google":return e.providerProfile.picture}}g[z]={from:[void 0,P((0,c.lq)((0,c.gp)(f)))],baseUrl:[null,T],storage:[void 0,P((0,c.lq)((0,c.gP)(c.Yj,c.Pc)))],initialState:[void 0,function(e){return e&&JSON.parse(e)}],key:[void 0,P(c.vD,function(){return"auth"})]},j(f,"authentication",function(){var e=this._services[z];if(!e){var t=this.config[z].from;e=t?t.authentication:Y(this),this._services[z]=e}return e});var $=n(5280);function X(e){var t=e.code||"UNKNOWN_ERROR",n=e.message||JSON.stringify(e),r=new Error("".concat(t,"[").concat(n,"]"));return r.code=t,r}var Z=a()(function e(){i()(this,e),this.cache_={}},[{key:"length",get:function(){return Object.keys(this.cache_).length}},{key:"key",value:function(e){var t=Object.keys(this.cache_);return 0<=e&&e<t.length?t[e]:null}},{key:"getItem",value:function(e){return this.cache_.hasOwnProperty(e)?this.cache_[e]:null}},{key:"setItem",value:function(e,t){this.cache_[e]=t}},{key:"removeItem",value:function(e){delete this.cache_[e]}},{key:"clear",value:function(){this.cache_={}}}]),ee="localStorage",te=y.y[ee];te||(te=e.J[ee]||new Z),(0,y.aZ)(ee,function(){return te},function(e){return te=e});var ne="sessionStorage",re=y.y[ne];function ie(e){return"webcom:"+e}re||(re=e.J[ne]||null),(0,y.aZ)(ne,function(){return re},function(e){return re=e});var oe=a()(function e(t,n){i()(this,e);var r=t();if(r){var o=ie("sentinel");r.setItem(o,""),r.removeItem(o)}function a(){return t()||(0,c.$8)("JSONStorage","the ".concat(n," implementation could not be found!"))}this.set=function(e,t){if(null===t)a().removeItem(ie(e));else{var n=JSON.stringify(t);a().setItem(ie(e),"string"==typeof n?n:"null")}},this.get=function(e){var t=a().getItem(ie(e));return t&&JSON.parse(t)},this.remove=function(e){a().removeItem(ie(e))}}),ae=new oe(function(){return te},"localStorage"),se=new oe(function(){return re},"sessionStorage"),ue=n(6779),ce=n.n(ue);function le(e){return decodeURIComponent(e.replace(/\+/g," "))}function he(){var e=2147483648;return Math.floor(Math.random()*e).toString(36)+Math.abs(Math.floor(Math.random()*e)^Date.now()).toString(36)}function de(e){var t={};return e.replace(/^[^?]*\?/,"").split("&").forEach(function(e){var n=e.indexOf("=");if(n<0)t[le(e)]=!0;else{var r=le(e.substring(0,n));t[r]=le(e.substring(n+1))}}),t}function fe(e){if(!e)return"";var t=[];return Object.entries(e).forEach(function(e){var n=u()(e,2),r=n[0],i=n[1];null!=i&&((0,h.Gv)(i)&&(i=JSON.stringify(i)),t.push(encodeURIComponent(r)+"="+encodeURIComponent(i)))}),t.join("&")}function ve(e,t){var n=e.indexOf("?"),r=t?(n<0?"?":"&")+fe(t):"",i=e.indexOf("#");return i<0?e+r:e.substring(0,i)+r+e.substring(i)}function pe(e,t){return ce().codec.base64.fromBits(ce().hash.sha1.hash(e),!1,t)}var _e=n(9646),ge=n.n(_e);var ye="XMLHttpRequest",me=y.y[ye];me||(me=n(6749).n),(0,y.aZ)(ye,function(){return me},function(e){return me=e});var ke=(0,l.h)("network.HttpRequest","HttpRequest"),be="application/x-www-form-urlencoded",we="application/json",Ce="Content-Type",Ee="PUT",Se="PATCH",Ne="POST",xe="DELETE",De="GET",Ae=a()(function e(t,n){i()(this,e),this.name=t,this.value=n}),Re=a()(function e(t,n){i()(this,e);for(var r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];this.url=ve([n].concat(x()(o.filter(function(e){return e&&e.length}).map(function(e){return encodeURIComponent(e)}))).join("/"),{c:D.Ov}),this.method=t.toUpperCase(),this.headers={Accept:"application/json, text/plain"}},[{key:"addQueryParameters",value:function(e){return this.url=ve(this.url,e),this}},{key:"addJson",value:function(e){return this.contentType=we,this.data=e,this}},{key:"addForm",value:function(e){return this.contentType=be,this.data=e,this}},{key:"addHeader",value:function(e){return(0,c.ar)(["HttpRequest","#addHeader"],arguments,(0,c.lq)((0,c.gp)(Ae))),e&&(this.headers[e.name]=e.value),this}},{key:"readResponseHeaders",value:function(){return this.readHeaders=!0,this}},{key:"send",value:function(){var e=this;return new Promise(function(t,n){var r=null;void 0!==e.data&&[Ne,Ee,Se].indexOf(e.method)>=0&&((r=e.contentType===be?fe(e.data):e.contentType===we?JSON.stringify(e.data):e.data)?e.headers[Ce]=e.contentType:delete e.headers[Ce]),ke.log("==> ".concat(e.method," ").concat(e.url)),Object.keys(e.headers).forEach(function(t){return ke.log(" > HEADER ".concat(t,": ").concat(e.headers[t]))}),r&&ke.log(" > DATA: ".concat(r)),e._open(r,t,function(e){ke.log("<== ERROR: ".concat(JSON.stringify(e))),n(X(e))})})}},{key:"_open",value:function(e,t,n){var r=this,i=new me,o="RESPONSE_PAYLOAD_ERROR";i.onreadystatechange=function(){if(4===i.readyState){var e=i.responseText,a=i.status;if(a>=500)n({code:o,message:"HTTP status ".concat(a)});else try{var s=e.length?JSON.parse(e):{};if(a>=400)n(s.error||s);else if(a>=200&&a<300||304===a){var u={body:s},c=u.body.error||null;c?n((0,h.Gv)(c)?c:{code:u.body.status,message:c}):(r.readHeaders&&(u.headers=function(e){var t=e.getAllResponseHeaders().trim().split(/[\r\n]+/),n={};return t.forEach(function(e){var t=e.indexOf(": "),r=e.substring(0,t).toLowerCase();n[r]=e.substring(t+2)}),n}(i)),ke.log("<== ".concat(JSON.stringify(u))),t(u))}else n({code:o,message:"HTTP status ".concat(a)})}catch(e){n({code:o,message:"invalid response payload, not a Json content type"})}}},i.open(this.method,this.url,!0),Object.entries(this.headers).forEach(function(e){var t=u()(e,2),n=t[0],r=t[1];return i.setRequestHeader(n,r)}),i.send(e)}}]);function Oe(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return ge()(Re,[De,e].concat(n))}function Te(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return ge()(Re,[Ee,e].concat(n))}function Pe(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return ge()(Re,[Ne,e].concat(n))}function Ie(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return ge()(Re,[xe,e].concat(n))}function Le(e){if(e)return new Ae("Authorization","Bearer ".concat(e))}var je=a()(function e(t){i()(this,e),M(this,"name",t),this.counters_={}},[{key:"attach",value:function(e){this.counters_=e.counters_}},{key:"incrementCounter",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.counters_[e]=(this.counters_[e]||0)+t}},{key:"get",value:function(){return Object.assign({},this.counters_)}}]),Me=new je("deprecated"),Fe=n(5304);function qe(e,t,n,r){r=r&&r.concat(": ")||"",n=n?"use ".concat(n," instead"):"it should no longer be used",e.warn("".concat(r).concat(t," is deprecated, ").concat(n,".")),Me.incrementCounter(t)}M(l.Ay,"showDeprecations",function(){(0,c.ar)([l.d1,"showDeprecations"],arguments),Ve=qe}),M(l.Ay,"hideDeprecations",function(){(0,c.ar)([l.d1,"hideDeprecations"],arguments),Ve=Fe.lQ});var Ve=qe;M(E,"Authentication",{avatarURL:G}),F(E,"avatarURL",function(){return Ve(S,"Webcom.avatarURL","Webcom.Authentication.avatarURL"),G});var Ue={code:"USER_DENIED",message:"The user aborted authentication"},We={facebook:{height:650,width:680},google:{height:460,width:490},github:{height:760,width:340},gitlab:{height:710,width:800},orange:{height:700,width:1e3},mobileconnectOFR:{height:540,width:700}},Qe={menubar:0,location:0,resizable:0,scrollbars:1,status:0,dialog:1,width:700,height:375};function He(e,t){var n=e.config[z];return(0,h.Kg)(n.storage)?n.storage:_(e,"state",n)+t}function Ke(e,t,n){(0,$.wg)(function(){return e(t,n)})}function Je(){return D.Ls&&(se.get(this._oauthSessionKey)||ae.get(this._oauthSessionKey))}var Be,Ye,ze,Ge=a()(function e(t){i()(this,e),this._logger=(0,l.h)("api.Authentication",z),this._logger.log("Initializing with options ".concat(JSON.stringify(t.config[z]))),this._app=t,this._init(t)},[{key:"_init",value:function(e){var t=e.config[z];A.call(this,t.baseUrl);var n=this._logger._count;this._currentState=B(function(e,t){var n=e.config[z];return n.initialState||((0,h.Tn)(n.storage)?{}:ae.get(He(e,t)))}(e,n)),this._authStateSetter=function(e,t){var n=e.config[z];if((0,h.Tn)(n.storage))return function(e){return n.storage(JSON.stringify(e))};var r=He(e,t);return function(e){return e&&!e.isUnauthenticated()?ae.set(r,e):ae.remove(r)}}(e,n),this._oauthSessionKey=_(e,"ongoing",t)+n,this.isAuthContextual=!1,this._firstSubscriptions=[],this._lastSubscriptions=[],this._authRoute="".concat(t.baseUrl.href,"/auth/v2/").concat(e.appId),this._resumeAuthState(),this._logger.log("Initialized for appId %s",e.appId)}},{key:"_dispose",value:function(){}},{key:"currentState",get:function(){return this._currentState},set:function(e){this._currentState.isSameAs(e)||(this._currentState=function(e){if(e.isAuthenticated()){var t=Object.assign({},e.details);return delete t.extra,J(t)}return e}(e),this._authStateSetter(this._currentState),this._notifyErrorOrAuthStateChanged(null,e))}},{key:"_resumeAuthState",value:function(){var e=this;if(D.Ls)if("popup"===ae.get(this._oauthSessionKey))document.body.style.display="none",ae.set(this._oauthSessionKey,de(location.search).__wcsession),window.close();else{var t=se.get(this._oauthSessionKey);if(t){var n=de(location.search).__wcsession;if(n)return void(this._oauthSessionPromise=this.resumeSession(n,t).finally(function(){delete e._oauthSessionPromise,se.remove(e._oauthSessionKey)}).catch(Fe.lQ));se.remove(this._oauthSessionKey)}}this._logger.info("Authentication state resumed: %s",this.currentState.state),this._logger.log("Authentication details are: %o",this.currentState.details)}},{key:"getAccountDetails",value:function(){var e=[z,"#removeIdentity"];try{(0,c.ar)(e,arguments);var t=this._getCurrentAuthenticationDetails(e);return this._httpGet("accounts",t.uid).addHeader(Le(t.webcomAuthToken)).send().then(function(e){for(var t={},n=0,r=Object.entries(e.body);n<r.length;n++){var i=u()(r[n],2),o=i[0],a=i[1];switch(o){case"providers":for(var s={},c=0,l=Object.entries(a);c<l.length;c++){var h=u()(l[c],2),d=h[0],f=h[1];s[d]=Object.keys(f)}t.identities=s;break;case"createdOn":t[o]=new Date(a);break;default:t[o]=a}}return t})}catch(e){return Promise.reject(e)}}},{key:"subscribe",value:function(e,t){return(0,c.ar)([z,"#subscribe"],arguments,c.Pc,(0,c.lq)(c.zM)),t?this._firstSubscriptions.push(e):this._lastSubscriptions.push(e),Je.call(this)?this._logger.log("Notification not sent, because an OAuth authentication is ongoing."):Ke(e,null,this.currentState),e}},{key:"unsubscribe",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;(0,c.ar)([z,"#unsubscribe