UNPKG

webcom

Version:

Webcom library

17 lines 78.3 kB
/*! * Webcom. Build realtime apps. Share and sync data instantly between your clients * * Module name: Webcom * Version: 3.8.0 * Created: 2025-06-26T13:37:19.141Z * * 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 t={228:t=>{t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},t.exports.__esModule=!0,t.exports.default=t.exports},858:t=>{t.exports=function(t){if(Array.isArray(t))return t},t.exports.__esModule=!0,t.exports.default=t.exports},646:(t,e,n)=>{var r=n(228);t.exports=function(t){if(Array.isArray(t))return r(t)},t.exports.__esModule=!0,t.exports.default=t.exports},926:t=>{function e(t,e,n,r,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,i)}t.exports=function(t){return function(){var n=this,r=arguments;return new Promise((function(i,o){var a=t.apply(n,r);function s(t){e(a,i,o,s,u,"next",t)}function u(t){e(a,i,o,s,u,"throw",t)}s(void 0)}))}},t.exports.__esModule=!0,t.exports.default=t.exports},575:t=>{t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports.__esModule=!0,t.exports.default=t.exports},100:(t,e,n)=>{var r=n(489),i=n(67);function o(e,n,a){return i()?(t.exports=o=Reflect.construct,t.exports.__esModule=!0,t.exports.default=t.exports):(t.exports=o=function(t,e,n){var i=[null];i.push.apply(i,e);var o=new(Function.bind.apply(t,i));return n&&r(o,n.prototype),o},t.exports.__esModule=!0,t.exports.default=t.exports),o.apply(null,arguments)}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports},913:t=>{function e(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}t.exports=function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t},t.exports.__esModule=!0,t.exports.default=t.exports},713:t=>{t.exports=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},t.exports.__esModule=!0,t.exports.default=t.exports},67:t=>{t.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(t){return!1}},t.exports.__esModule=!0,t.exports.default=t.exports},860:t=>{t.exports=function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)},t.exports.__esModule=!0,t.exports.default=t.exports},884:t=>{t.exports=function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o=[],a=!0,s=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(o.push(r.value),!e||o.length!==e);a=!0);}catch(t){s=!0,i=t}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}},t.exports.__esModule=!0,t.exports.default=t.exports},521:t=>{t.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.")},t.exports.__esModule=!0,t.exports.default=t.exports},206:t=>{t.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.")},t.exports.__esModule=!0,t.exports.default=t.exports},489:t=>{function e(n,r){return t.exports=e=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},t.exports.__esModule=!0,t.exports.default=t.exports,e(n,r)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},38:(t,e,n)=>{var r=n(858),i=n(884),o=n(379),a=n(521);t.exports=function(t,e){return r(t)||i(t,e)||o(t,e)||a()},t.exports.__esModule=!0,t.exports.default=t.exports},319:(t,e,n)=>{var r=n(646),i=n(860),o=n(379),a=n(206);t.exports=function(t){return r(t)||i(t)||o(t)||a()},t.exports.__esModule=!0,t.exports.default=t.exports},8:t=>{function e(n){return t.exports=e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,e(n)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},379:(t,e,n)=>{var r=n(228);t.exports=function(t,e){if(t){if("string"==typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}},t.exports.__esModule=!0,t.exports.default=t.exports},553:t=>{var e=function(t){"use strict";var e,n=Object.prototype,r=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function c(t,e,n,r){var i=e&&e.prototype instanceof y?e:y,o=Object.create(i.prototype),a=new O(r||[]);return o._invoke=function(t,e,n){var r=l;return function(i,o){if(r===d)throw new Error("Generator is already running");if(r===p){if("throw"===i)throw o;return E()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=A(a,n);if(s){if(s===v)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===l)throw r=p,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=d;var u=h(t,e,n);if("normal"===u.type){if(r=n.done?p:f,u.arg===v)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=p,n.method="throw",n.arg=u.arg)}}}(t,n,a),o}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var l="suspendedStart",f="suspendedYield",d="executing",p="completed",v={};function y(){}function g(){}function _(){}var m={};u(m,o,(function(){return this}));var b=Object.getPrototypeOf,k=b&&b(b(P([])));k&&k!==n&&r.call(k,o)&&(m=k);var w=_.prototype=y.prototype=Object.create(m);function x(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function n(i,o,a,s){var u=h(t[i],t,o);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(l).then((function(t){c.value=t,a(c)}),(function(t){return n("throw",t,a,s)}))}s(u.arg)}var i;this._invoke=function(t,r){function o(){return new e((function(e,i){n(t,r,e,i)}))}return i=i?i.then(o,o):o()}}function A(t,n){var r=t.iterator[n.method];if(r===e){if(n.delegate=null,"throw"===n.method){if(t.iterator.return&&(n.method="return",n.arg=e,A(t,n),"throw"===n.method))return v;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var i=h(r,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var o=i.arg;return o?o.done?(n[t.resultName]=o.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,v):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function R(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function P(t){if(t){var n=t[o];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,a=function n(){for(;++i<t.length;)if(r.call(t,i))return n.value=t[i],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}return{next:E}}function E(){return{value:e,done:!0}}return g.prototype=_,u(w,"constructor",_),u(_,"constructor",g),g.displayName=u(_,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,_):(t.__proto__=_,u(t,s,"GeneratorFunction")),t.prototype=Object.create(w),t},t.awrap=function(t){return{__await:t}},x(S.prototype),u(S.prototype,a,(function(){return this})),t.AsyncIterator=S,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new S(c(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(w),u(w,s,"Generator"),u(w,o,(function(){return this})),u(w,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=P,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(R),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function i(r,i){return s.type="throw",s.arg=t,n.next=r,i&&(n.method="next",n.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),R(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;R(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:P(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),v}},t}(t.exports);try{regeneratorRuntime=e}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}},757:(t,e,n)=>{t.exports=n(553)},722:(t,e,n)=>{"use strict";n.d(e,{Yk:()=>E,ab:()=>B,hu:()=>z,ZP:()=>V});var r=n(319),i=n.n(r),o=n(575),a=n.n(o),s=n(913),u=n.n(s),c=n(38),h=n.n(c),l=n(24),f=n(28),d=n(303),p="console",v=f.sZ.console,y=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];var o=function(t){return(0,d.Kn)(t)?JSON.stringify(t):(t||"undefined").toString()};if((0,d.HD)(t)){var a=0;return[t=t.replace(/%(.)/g,(function(t,e){switch(e){case"%":return"%";case"s":case"o":case"O":return o(n[a++]);case"d":case"i":case"f":return n[a++];default:return t}}))].concat(i()(n.slice(a).map(o))).join(" ")}return[t].concat(n).map(o).join(" ")};function g(t,e,n,r,i){if(!n||!r||!i){var o=e,a=function(t){return function(e){return o("[".concat(t,"] ").concat(e))}};n=n||a("INFO"),r=r||a("WARN"),i=i||a("ERR!"),e=a("LOG ")}return{log:function(){return e.call(t,y.apply(void 0,arguments))},info:function(){return n.call(t,y.apply(void 0,arguments))},warn:function(){return r.call(t,y.apply(void 0,arguments))},error:function(){return i.call(t,y.apply(void 0,arguments))}}}if((0,d.mf)(v))v=g(l.Z,v);else if((0,d.Kn)(v)&&v){var _=v,m=_.log,b=_.info,k=_.warn,w=_.error;v=g(v,m,b,k,w)}else{var x=function(t,e,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,d.HD)(n)?(n="[".concat(t,"] ")+n,e.apply(void 0,[n].concat(i))):e.apply(void 0,["[".concat(t,"] "),n].concat(i))};v={log:x.bind(void 0,"LOG ",l.Z.console.log),info:x.bind(void 0,"INFO",l.Z.console.info),warn:x.bind(void 0,"WARN",l.Z.console.warn),error:x.bind(void 0,"ERR!",l.Z.console.error)}}(0,f.x$)(p,(function(){return v}),(function(t){return v=t}));var S=n(857),A=n(455),T={};function R(t,e){var n=t.length;return n>=e?t.substring(0,e):t+E.substring(0,e-n)}function O(t){return t.map((function(t){return(0,d.mf)(t)?t():t}))}var P=function(){function t(e,n,r,i){a()(this,t),this._fqdn=e,this._prefix=n;var o=e.join(".");this._count=void 0===T[o]?T[o]=0:++T[o],this.displayTimestamp=r,this.setPrefixWidth(i||8),this._log=this._emitLog.bind(this,v.log),this._info=this._emitLog.bind(this,v.info),this._warn=this._emitLog.bind(this,v.warn),this._error=this._emitLog.bind(this,v.error),this._enabled=!0}return u()(t,[{key:"fqdn",get:function(){return this._fqdn}},{key:"_emitLog",value:function(t,e){var n=this.displayTimestamp?[(new Date).toISOString()]:[];n.push(this._displayedPrefix);for(var r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];(0,d.HD)(e)?(n.push(e),e=n.join(" "),t.apply(void 0,[e].concat(i()(O(o))))):t.apply(void 0,n.concat(i()(O([e].concat(o)))))}},{key:"setPrefixWidth",value:function(t){this._displayedPrefix="".concat(R(this._prefix,t)," #").concat(R(this._count.toString(),3))}},{key:"setLevel",value:function(t){this._enabled=t>=0,this.log=t>=V.LOG?this._log:A.ZT,this.info=t>=V.INFO?this._info:A.ZT,this.warn=t>=V.WARN?this._warn:A.ZT,this.error=t>=V.ERROR?this._error:A.ZT}},{key:"updateLevel",value:function(t){this._enabled&&this.setLevel(t)}}]),t}(),E=" ",j=!1,C=15,I=[],L={},N={},D={},H="_leaf_";function Z(t){return t?t.split("."):[]}function F(t){return{disabledDepth:K(t,D),enabledDepth:K(t,N)}}function M(t,e,n,r){for(var i=0;i<t.length;){var o=t[i++];e.hasOwnProperty(o)||(e[o]={}),e=e[o]}r&&Object.keys(e).forEach((function(t){return delete e[t]})),e._leaf_=n}function U(t,e){for(var n=0;n<t.length;){var r=t[n++];if(!e.hasOwnProperty(r))return;e=e[r]}delete e._leaf_}function K(t,e){var n=-1,r=0;do{e.hasOwnProperty(H)&&(n=r)}while(r<t.length&&(e=e[t[r++]]));return n}function W(t,e){Object.entries(t||{}).forEach((function(t){var n=h()(t,2),r=n[0],i=n[1];r===H?e(i):W(i,e)}))}function q(t,e){for(var n=[],r=0;e&&r<t.length;)e=e[t[r++]];return W(e,(function(t){return n.push(t)})),n}function J(t){j=t,I.forEach((function(t){return t.displayTimestamp=j}))}var B="LogManager",V=function(){function t(){a()(this,t)}return u()(t,null,[{key:"enable",value:function(e){(0,S.T2)([B,".enable"],arguments,(0,S.jt)(S.Z_));var n=Z(e),r=F(n),i=r.enabledDepth,o=r.disabledDepth;i<=o&&(o<0&&t.disable(),M(n,N,!0,!0),U(n,D),q(n,L).forEach((function(t){return t.setLevel(G)})))}},{key:"disable",value:function(t){(0,S.T2)([B,".disable"],arguments,(0,S.jt)(S.Z_));var e=Z(t),n=F(e),r=n.enabledDepth,i=n.disabledDepth;i<=r&&(M(e,D,!0,!0),U(e,N),q(e,L).forEach((function(t){return t.setLevel(-1)})))}},{key:"showTimestamp",value:function(){(0,S.T2)([B,".showTimestamp"],arguments),J(!0)}},{key:"hideTimestamp",value:function(){(0,S.T2)([B,".hideTimestamp"],arguments),J(!1)}},{key:"setPrefixWidth",value:function(t){(0,S.T2)([B,".setPrefixWidth"],arguments,S.Dp),t<0?t=0:t>E.length&&(t=E.length),C=t,I.forEach((function(t){return t.setPrefixWidth(C)}))}},{key:"level",get:function(){return G},set:function(t){(0,S.T2)([B,".level"],arguments,S.Dp),t>-1&&t!==G&&(I.forEach((function(e){return e.updateLevel(t)})),G=t)}},{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(t){var e=t&&t.toUpperCase();return function(t,n){return v.log("********** UPDATE ".concat(e||t.ref().pathString()," **********"),t.toString(),n?"[<<".concat(n,"]"):"")}}},{key:"debugOnCompletionCallback",value:function(t,e){var n=t&&t.toUpperCase();return function(t){return t?v.log("********** REVOKED ".concat(n," **********"),t):v.log("********** COMPLETED ".concat(n," **********")),e}}},{key:"debugOnCallbackWithCancel",value:function(e){var n=e&&e.toUpperCase();return[t.debugOnCallback(e),function(t){return v.log.apply(v,["********** COMPLETE ".concat(n," **********")].concat(i()(t?["FAILED:",t.code,t.message]:["cancelled"])))}]}}]),t}();function z(t,e){var n=Z(t),r=new P(n,e||n[n.length-1],j,C);return function(t){var e=t.fqdn;M(e,L,t),I.push(t);var n=F(e),r=n.disabledDepth,i=n.enabledDepth;t.setLevel(i>=r?G:-1)}(r),r}var G=V.INFO},466:(t,e,n)=>{"use strict";n.d(e,{DV:()=>h,RY:()=>l});n(24);var r=n(28),i="browser",o="mobile/",a="node",s="".concat(o,"android"),u="".concat(o,"iOS"),c={browser:"b"};c[s]="a",c[u]="i",c.node="n";var h,l=!0,f="device",d=r.sZ.device;d||p(a);function p(t){d=t,l=t===i,0===t.indexOf(o),h=(c[t]||"")+"3.8.0"}(0,r.x$)(f,(function(){return d}),(function(t){return p(t)}))},28:(t,e,n)=>{"use strict";n.d(e,{HO:()=>i,sZ:()=>r,x$:()=>o});var r=n(24).Z.WebcomDependencies||{},i={};function o(t,e,n){Object.defineProperty(i,t,{enumerable:!0,get:e,set:n})}},618:(t,e,n)=>{"use strict";n.d(e,{Zi:()=>h,cv:()=>f,iK:()=>a});var r=n(24),i=n(28),o="setTimeout",a=i.sZ.setTimeout;a||(a=r.Z.setTimeout),(0,i.x$)(o,(function(){return a}),(function(t){return a=t})),r.Z.setTimeout||(r.Z.setTimeout=a),r.Z.setImmediate||(r.Z.setImmediate=a);var s="clearTimeout",u=i.sZ.clearTimeout;u||(u=r.Z.clearTimeout),(0,i.x$)(s,(function(){return u}),(function(t){return u=t})),r.Z.clearTimeout||(r.Z.clearTimeout=u),r.Z.clearImmediate||(r.Z.clearImmediate=u);var c="setInterval",h=i.sZ.setInterval;h||(h=r.Z.setInterval),(0,i.x$)(c,(function(){return h}),(function(t){return h=t}));var l="clearInterval",f=i.sZ.clearInterval;f||(f=r.Z.clearInterval),(0,i.x$)(l,(function(){return f}),(function(t){return f=t}))},286:(t,e,n)=>{"use strict";n.d(e,{h:()=>S});var r=n(38),i=n.n(r),o=n(575),a=n.n(o),s=n(913),u=n.n(s),c=n(28),h="env",l=c.sZ.env;l||(l=process.env),(0,c.x$)(h,(function(){return l}),(function(t){return l=t}));var f,d,p,v,y=(0,n(722).hu)("network.nodeProxy");function g(t){try{return new URL(t)}catch(t){return null}}!function(){if(f=g(l.http_proxy||l.HTTP_PROXY),d=g(l.https_proxy||l.HTTPS_PROXY),p=l.no_proxy||l.NO_PROXY,y.log("Node.js proxy layer set to: http_proxy='".concat(f,"'; https_proxy='").concat(d,"'; no_proxy=").concat(p)),p){var t=p.split(",");v=t.indexOf("*")<0?function(e){return t.every((function(t){return!e.origin.endsWith(t)}))}:function(){return!1}}else v=function(){return!0}}();const _=require("http");var m=n.n(_);const b=require("https");var k=n.n(b),w=n(303),x=n(857),S=function(){function t(){a()(this,t),this.readyState=0,this._headers={},this.status=0}return u()(t,[{key:"open",value:function(t,e){this._method=t,this._href=e}},{key:"setRequestHeader",value:function(t,e){this._headers[t]=e}},{key:"send",value:function(t){(0,w.mf)(this.onreadystatechange)||(0,x._y)("NodeXmlHttpRequest","missing onreadystatechange event handler"),t&&(t=Buffer.from(t),this._headers["Content-Length"]=t.length),T.call(this,t)}},{key:"getAllResponseHeaders",value:function(){return Object.entries(this._headers).reduce((function(t,e){var n=i()(e,2),r=n[0],o=n[1];return"".concat(t,"\n").concat(r,": ").concat(o)}),"")}}],[{key:"DONE",get:function(){return 4}}]),t}();function A(t){this.responseText=t.message,this._headers={},this.readyState=4,this.onreadystatechange()}function T(t){var e=this,n=function(t){var e=new URL(t);switch(e.protocol){case"http:":case"ws:":return f&&v(e)?{url:e,secure:!1,proxy:f}:{url:e,secure:!1};case"https:":case"wss:":return d&&v(e)?{url:e,secure:!0,proxy:d}:{url:e,secure:!0};default:return{url:e,secure:!1}}}(this._href),r=n.url,i=n.secure,o=n.proxy;if(o)if(i){var a=r.hostname+":443",s=m().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=k().request({host:r.host,path:r.pathname+r.search+r.hash,method:e._method,agent:new(k().Agent)({socket:i})});R.call(e,o,t)}else A.call(e,new Error("Status ".concat(n.statusCode)))})),s.on("error",A.bind(this)),s.setHeader("Host",a),s.end()}else{var u=m().request({protocol:o.protocol,hostname:o.hostname,port:o.port,method:this._method,path:r.href});u.setHeader("Host",r.host),R.call(this,u,t)}else{var c=(i?k():m()).request({protocol:r.protocol,hostname:r.hostname,port:r.port,method:this._method,path:r.pathname+r.search+r.hash});c.setHeader("Host",r.host),R.call(this,c,t)}}function R(t,e){var n=this;Object.entries(this._headers).forEach((function(e){var n=i()(e,2),r=n[0],o=n[1];return t.setHeader(r,o)})),e&&t.write(e),t.on("error",A.bind(this)),t.on("response",(function(t){var r=[];t.on("data",(function(t){return r.push(t)})),t.on("error",A.bind(n)),t.on("end",(function(){n.status=t.statusCode;var i=[301,302,303,307,308].includes(n.status)&&t.headers.location;i?(n._href=i,T.call(n,e)):(n.readyState=4,n.responseText=Buffer.concat(r).toString("utf8"),n._headers=t.headers,n.onreadystatechange())}))})),t.end()}},730:(t,e)=>{"use strict";var n,r={cipher:{},hash:{},keyexchange:{},mode:{},misc:{},codec:{},exception:{corrupt:function(t){this.toString=function(){return"CORRUPT: "+this.message},this.message=t},invalid:function(t){this.toString=function(){return"INVALID: "+this.message},this.message=t},bug:function(t){this.toString=function(){return"BUG: "+this.message},this.message=t},notReady:function(t){this.toString=function(){return"NOT READY: "+this.message},this.message=t}}};r.bitArray={bitSlice:function(t,e,n){return t=r.bitArray._shiftRight(t.slice(e/32),32-(31&e)).slice(1),void 0===n?t:r.bitArray.clamp(t,n-e)},extract:function(t,e,n){var r=Math.floor(-e-n&31);return(-32&(e+n-1^e)?t[e/32|0]<<32-r^t[e/32+1|0]>>>r:t[e/32|0]>>>r)&(1<<n)-1},concat:function(t,e){if(0===t.length||0===e.length)return t.concat(e);var n=t[t.length-1],i=r.bitArray.getPartial(n);return 32===i?t.concat(e):r.bitArray._shiftRight(e,i,0|n,t.slice(0,t.length-1))},bitLength:function(t){var e,n=t.length;return 0===n?0:(e=t[n-1],32*(n-1)+r.bitArray.getPartial(e))},clamp:function(t,e){if(32*t.length<e)return t;var n=(t=t.slice(0,Math.ceil(e/32))).length;return e&=31,n>0&&e&&(t[n-1]=r.bitArray.partial(e,t[n-1]&2147483648>>e-1,1)),t},partial:function(t,e,n){return 32===t?e:(n?0|e:e<<32-t)+1099511627776*t},getPartial:function(t){return Math.round(t/1099511627776)||32},equal:function(t,e){if(r.bitArray.bitLength(t)!==r.bitArray.bitLength(e))return!1;var n,i=0;for(n=0;n<t.length;n++)i|=t[n]^e[n];return 0===i},_shiftRight:function(t,e,n,i){var o,a,s;for(void 0===i&&(i=[]);e>=32;e-=32)i.push(n),n=0;if(0===e)return i.concat(t);for(o=0;o<t.length;o++)i.push(n|t[o]>>>e),n=t[o]<<32-e;return a=t.length?t[t.length-1]:0,s=r.bitArray.getPartial(a),i.push(r.bitArray.partial(e+s&31,e+s>32?n:i.pop(),1)),i},_xor4:function(t,e){return[t[0]^e[0],t[1]^e[1],t[2]^e[2],t[3]^e[3]]},byteswapM:function(t){var e,n;for(e=0;e<t.length;++e)n=t[e],t[e]=n>>>24|n>>>8&65280|(65280&n)<<8|n<<24;return t}},r.codec.utf8String={fromBits:function(t){var e,n,i="",o=r.bitArray.bitLength(t);for(e=0;e<o/8;e++)0==(3&e)&&(n=t[e/4]),i+=String.fromCharCode(n>>>8>>>8>>>8),n<<=8;return decodeURIComponent(escape(i))},toBits:function(t){t=unescape(encodeURIComponent(t));var e,n=[],i=0;for(e=0;e<t.length;e++)i=i<<8|t.charCodeAt(e),3==(3&e)&&(n.push(i),i=0);return 3&e&&n.push(r.bitArray.partial(8*(3&e),i)),n}},r.codec.base64={_chars:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",fromBits:function(t,e,n){var i,o="",a=0,s=r.codec.base64._chars,u=0,c=r.bitArray.bitLength(t);for(n&&(s=s.substr(0,62)+"-_"),i=0;6*o.length<c;)o+=s.charAt((u^t[i]>>>a)>>>26),a<6?(u=t[i]<<6-a,a+=26,i++):(u<<=6,a-=6);for(;3&o.length&&!e;)o+="=";return o},toBits:function(t,e){t=t.replace(/\s|=/g,"");var n,i,o=[],a=0,s=r.codec.base64._chars,u=0;for(e&&(s=s.substr(0,62)+"-_"),n=0;n<t.length;n++){if((i=s.indexOf(t.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(t){return r.codec.base64.fromBits(t,1,1)},toBits:function(t){return r.codec.base64.toBits(t,1)}},r.hash.sha256=function(t){this._key[0]||this._precompute(),t?(this._h=t._h.slice(0),this._buffer=t._buffer.slice(0),this._length=t._length):this.reset()},r.hash.sha256.hash=function(t){return(new r.hash.sha256).update(t).finalize()},r.hash.sha256.prototype={blockSize:512,reset:function(){return this._h=this._init.slice(0),this._buffer=[],this._length=0,this},update:function(t){"string"==typeof t&&(t=r.codec.utf8String.toBits(t));var e,n=this._buffer=r.bitArray.concat(this._buffer,t),i=this._length,o=this._length=i+r.bitArray.bitLength(t);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(e=512+i-(512+i&511);e<=o;e+=512)this._block(a.subarray(16*s,16*(s+1))),s+=1;n.splice(0,16*s)}else for(e=512+i-(512+i&511);e<=o;e+=512)this._block(n.splice(0,16));return this},finalize:function(){var t,e=this._buffer,n=this._h;for(t=(e=r.bitArray.concat(e,[r.bitArray.partial(1,1)])).length+2;15&t;t++)e.push(0);for(e.push(Math.floor(this._length/4294967296)),e.push(0|this._length);e.length;)this._block(e.splice(0,16));return this.reset(),n},_init:[],_key:[],_precompute:function(){var t,e,n=0,r=2;function i(t){return 4294967296*(t-Math.floor(t))|0}for(;n<64;r++){for(e=!0,t=2;t*t<=r;t++)if(r%t==0){e=!1;break}e&&(n<8&&(this._init[n]=i(Math.pow(r,.5))),this._key[n]=i(Math.pow(r,1/3)),n++)}},_block:function(t){var e,n,r,i,o=this._h,a=this._key,s=o[0],u=o[1],c=o[2],h=o[3],l=o[4],f=o[5],d=o[6],p=o[7];for(e=0;e<64;e++)e<16?n=t[e]:(r=t[e+1&15],i=t[e+14&15],n=t[15&e]=(r>>>7^r>>>18^r>>>3^r<<25^r<<14)+(i>>>17^i>>>19^i>>>10^i<<15^i<<13)+t[15&e]+t[e+9&15]|0),n=n+p+(l>>>6^l>>>11^l>>>25^l<<26^l<<21^l<<7)+(d^l&(f^d))+a[e],p=d,d=f,f=l,l=h+n|0,h=c,c=u,s=n+((u=s)&c^h&(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]+h|0,o[4]=o[4]+l|0,o[5]=o[5]+f|0,o[6]=o[6]+d|0,o[7]=o[7]+p|0}},r.hash.sha1=function(t){t?(this._h=t._h.slice(0),this._buffer=t._buffer.slice(0),this._length=t._length):this.reset()},r.hash.sha1.hash=function(t){return(new r.hash.sha1).update(t).finalize()},r.hash.sha1.prototype={blockSize:512,reset:function(){return this._h=this._init.slice(0),this._buffer=[],this._length=0,this},update:function(t){"string"==typeof t&&(t=r.codec.utf8String.toBits(t));var e,n=this._buffer=r.bitArray.concat(this._buffer,t),i=this._length,o=this._length=i+r.bitArray.bitLength(t);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(e=this.blockSize+i-(this.blockSize+i&this.blockSize-1);e<=o;e+=this.blockSize)this._block(a.subarray(16*s,16*(s+1))),s+=1;n.splice(0,16*s)}else for(e=this.blockSize+i-(this.blockSize+i&this.blockSize-1);e<=o;e+=this.blockSize)this._block(n.splice(0,16));return this},finalize:function(){var t,e=this._buffer,n=this._h;for(t=(e=r.bitArray.concat(e,[r.bitArray.partial(1,1)])).length+2;15&t;t++)e.push(0);for(e.push(Math.floor(this._length/4294967296)),e.push(0|this._length);e.length;)this._block(e.splice(0,16));return this.reset(),n},_init:[1732584193,4023233417,2562383102,271733878,3285377520],_key:[1518500249,1859775393,2400959708,3395469782],_f:function(t,e,n,r){return t<=19?e&n|~e&r:t<=39?e^n^r:t<=59?e&n|e&r|n&r:t<=79?e^n^r:void 0},_S:function(t,e){return e<<t|e>>>32-t},_block:function(t){var e,n,r,i,o,a,s,u,c=this._h;if("undefined"!=typeof Uint32Array){u=Array(80);for(var h=0;h<16;h++)u[h]=t[h]}else u=t;for(r=c[0],i=c[1],o=c[2],a=c[3],s=c[4],e=0;e<=79;e++)e>=16&&(u[e]=this._S(1,u[e-3]^u[e-8]^u[e-14]^u[e-16])),n=this._S(5,r)+this._f(e,i,o,a)+s+u[e]+this._key[Math.floor(e/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}},t.exports&&(t.exports=r),void 0===(n=function(){return r}.apply(e,[]))||(t.exports=n)},455:(t,e,n)=>{"use strict";n.d(e,{ZT:()=>r});n(618);var r=Function.prototype},24:(t,e,n)=>{"use strict";n.d(e,{Z:()=>r});var r=function(){if("undefined"!=typeof globalThis)return globalThis;return global}()},303:(t,e,n)=>{"use strict";n.d(e,{HD:()=>s,Kn:()=>h,hj:()=>u,jn:()=>a,lk:()=>l,mf:()=>c});var r=n(8),i=n.n(r),o=n(466);function a(t){return"boolean"==typeof t}function s(t){return"string"==typeof t}function u(t){return"number"==typeof t}function c(t){return"function"==typeof t}function h(t){return"object"===i()(t)}function l(){return o.RY&&(window.navigator.userAgent.match(/CriOS|Twitter for iPhone|FBAN\/FBIOS|Windows Phone/)||window.navigator.standalone)}},857:(t,e,n)=>{"use strict";n.d(e,{Dp:()=>A,Hk:()=>O,O4:()=>u,O7:()=>S,Q3:()=>v,Ry:()=>T,T2:()=>p,Yl:()=>x,Z_:()=>w,_T:()=>f,__:()=>_,_y:()=>d,hu:()=>c,jt:()=>y,l4:()=>m,sR:()=>k,vA:()=>g,wB:()=>E,wE:()=>R});var r=n(8),i=n.n(r),o=n(319),a=n.n(o),s=n(303),u="Webcom internal error";function c(t,e){t||d(u,e)}var h={values:[]};function l(t,e){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:t,args:e||[],checkers:r})}function f(t,e,n){h.values.push({name:t,value:e,checker:n})}var d=function(t,e){var n;throw new Error("".concat((n="").concat.apply(n,a()(t)),": ").concat(e))};function p(t,e){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];l.apply(void 0,[t,e].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&&d(o,"too many arguments, ".concat(a.length," instead of ").concat(s.length)),s.forEach((function(t,e){return v(t,a[e],o,(function(t){return"argument #".concat(e+1," ").concat(t)}))})),u.forEach((function(t){var e=t.name,n=t.value;return v(t.checker,n,o,(function(t){return"".concat(e," ").concat(t)}))}))}function v(t,e,n,r){var i=t(e);i&&d(n,r(i))}function y(t){return function(e){return b("undefined")(e)&&t&&t(e)}}function g(t){return function(e){return null===e?"must not be null":t&&t(e)}}var _=function(t){return void 0===t?"is missing":""};function m(t){return function(e){return!(e instanceof t)&&"must be an instance of ".concat(t.name)}}function b(t){return function(e){return i()(e)!==t&&"must be a ".concat(t)}}var k=b("undefined"),w=b("string"),x=b("function"),S=b("boolean"),A=P(Number.isFinite,"must be a finite number"),T=b("object");function R(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(t){return e.every((function(e){return e(t)}))&&"either ".concat(e.map((function(e){return e(t)})).join(" or "))}}function O(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(t){var n;return e.some((function(e){return n=e(t)}))&&n}}function P(t,e){return function(n){return!t(n)&&(e||"is not valid")}}P((function(t){return(0,s.hj)(t)&&Math.floor(t)===t}),"must be an integer");function E(t,e){return P((function(e){return t.test(e)}),e)}},113:t=>{"use strict";t.exports=require("crypto")},147:t=>{"use strict";t.exports=require("fs")}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var o=e[r]={exports:{}};return t[r](o,o.exports,n),o.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var r={};(()=>{"use strict";n.d(r,{default:()=>k});var t=n(24),e=n(575),i=n.n(e),o=n(913),a=n.n(o),s=n(38),u=n.n(s),c=n(857),h=n(722),l=n(303),f="WebcomApp",d=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};i()(this,t),(0,c.T2)(["new ",f],arguments,(0,c.wB)(/^[a-z0-9](?:[-a-z0-9]{0,38}[a-z0-9])?$/),(0,c.jt)((0,c.wE)(c.Ry,c.Z_))),this._logger=(0,h.hu)("api.WebcomApp",f),this._services={},this.appId=e,this.config={},(0,l.HD)(n)&&(n=Object.keys(y).reduce((function(t,e){return t[e]={baseUrl:n},t}),{})),this._fillConfig(n),this._logger.log("Initialized %s with options %s",e,JSON.stringify(this.config))}return a()(t,[{key:"dispose",value:function(){(0,c.T2)([f,"#dispose"],arguments),Object.values(this._services).forEach((function(t){return t._dispose()})),this._services={}}},{key:"_fillConfig",value:function(t){p.call(this,t,y)}},{key:"toString",value:function(){return"".concat(this.appId,"{").concat(Object.keys(this._services).join(","),"}")}}]),t}();function p(t,e){var n=this;!function t(e,r,i,o){var a=function(t){return"".concat(f,".Configuration.").concat(o.concat(t).join("."))};r=Object.assign({},r),Object.entries(i).forEach((function(i){var s=u()(i,2),h=s[0],l=s[1];if(l instanceof Object&&!(l instanceof Array))e[h]=e[h]||{},t(e[h],r[h]||{},l,o.concat(h));else{var f=r[h],d=l[1]||function(t){return t};try{e[h]=d(void 0===f?void 0===e[h]?l.length?l[0]:l:e[h]:f)}catch(t){var p=a(h);void 0===t.value?(0,c._y)(p,t.message):(n._logger.warn("%s: %s",p,t.message),e[h]=t.value)}}delete r[h]})),Object.keys(r).forEach((function(t){return n._logger.warn("%s: unknown config key",a(t))}))}(this.config,t,e,[])}function v(t,e,n){return"".concat(n.key,":").concat(e,":").concat(function(t,e){var n=e.baseUrl;return"/".concat(n.protocol.slice(0,-1),"/").concat(n.host,"/").concat(t.appId,"/")}(t,n))}var y={},g=n(28),_="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz",m=_.length;var b="Webcom",k=function(){function t(){i()(this,t),this._init.apply(this,arguments)}return a()(t,[{key:"_init",value:function(){(0,c._y)(["new ",b],"this static class cannot be instantiated")}}],[{key:"SDK_VERSION",get:function(){return"3.8.0"}},{key:"Log",get:function(){return h.ZP}},{key:"App",value:function(t,e){return new d(t,e)}},{key:"getUniqueKeyDate",value:function(t){return new Date(function(t){for(var e=t.substring(0,8),n=0,r=0;r<8;++r)n=n*m+_.indexOf(e[r]);return n}(t))}},{key:"dependencies",get:function(){return g.HO}}]),t}(),w=(0,h.hu)("api.Webcom",b),x=n(319),S=n.n(x),A=n(466);function T(t){"http:"===t.protocol&&A.RY&&"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 P(e){if(e&&(t.Z.URL&&e instanceof URL||e.href&&e.protocol&&e.host))return e;var n=e?R.exec(e):[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(e))}function E(t,e){return function(n){var r=t(n);if(r)throw new Error(r);return e?e(n):n}}var j=n(8),C=n.n(j);function I(t,e,n,r){return N(t.prototype,e,n,r)}function L(t,e,n,r){return D(t,e,{value:n},r)}function N(t,e,n,r){return D(t,e,{get:n},r)}function D(t,e,n,r){return Object.defineProperty(t,e,Object.assign(n,{enumerable:r,configurable:!0}))}var H="some",Z="required",F="none",M=function(){function t(e,n){i()(this,t),(0,c.hu)(e===H||e===Z||e===F,"Wrong state value for a new State object: expecting 'some', 'required' or 'none'."),this.state=e,(0,c.hu)(e!==H||n&&n.webcomAuthToken,"Missing details or webcomAuthToken for a new 'some' State"),this.details=n}return a()(t,[{key:"isUnauthenticated",value:function(){return this.state===F}},{key:"isAuthenticated",value:function(){return this.state===H}},{key:"isRequired",value:function(){return this.state===Z}},{key:"isSameAs",value:function(t){return this.state===t.state&&(this.state!==H||this.details.webcomAuthToken===t.details.webcomAuthToken)}}]),t}(),U=new M(F),K=(new M(Z),function(t){return new M(H,t)});var W,q="Authentication";function J(t){switch((0,c.T2)([b,".avatarURL"],arguments,c.Ry),t&&t.provider){case"facebook":return"https://graph.facebook.com/".concat(t.providerUid,"/picture?type=large");case"github":return t.providerProfile.avatar_url;case"gitlab":case"google":return t.providerProfile.picture}}y.Authentication={from:[void 0,E((0,c.jt)((0,c.l4)(d)))],baseUrl:[null,P],storage:[void 0,E((0,c.jt)((0,c.wE)(c.Z_,c.Yl)))],initialState:[void 0,function(t){return t&&JSON.parse(t)}],key:[void 0,E(c.sR,(function(){return"auth"}))]},I(d,"authentication",(function(){var t=this._services.Authentication;if(!t){var e=this.config.Authentication.from;t=e?e.authentication:W(this),this._services.Authentication=t}return t}));var B=n(618);function V(t){var e=t.code||"UNKNOWN_ERROR",n=t.message||JSON.stringify(t),r=new Error("".concat(e,"[").concat(n,"]"));return r.code=e,r}var z=function(){function t(){i()(this,t),this.cache_={}}return a()(t,[{key:"length",get:function(){return Object.keys(this.cache_).length}},{key:"key",value:function(t){var e=Object.keys(this.cache_);return 0<=t&&t<e.length?e[t]:null}},{key:"getItem",value:function(t){return this.cache_.hasOwnProperty(t)?this.cache_[t]:null}},{key:"setItem",value:function(t,e){this.cache_[t]=e}},{key:"removeItem",value:function(t){delete this.cache_[t]}},{key:"clear",value:function(){this.cache_={}}}]),t}(),G="localStorage",Y=g.sZ.localStorage;Y||(Y=t.Z.localStorage||new z),(0,g.x$)(G,(function(){return Y}),(function(t){return Y=t}));var $="sessionStorage",Q=g.sZ.sessionStorage;function X(t){return"webcom:"+t}Q||(Q=t.Z.sessionStorage||null),(0,g.x$)($,(function(){return Q}),(function(t){return Q=t}));var tt=a()((function t(e,n){i()(this,t);var r=e();if(r){var o=X("sentinel");r.setItem(o,""),r.removeItem(o)}function a(){return e()||(0,c._y)("JSONStorage","the ".concat(n," implementation could not be found!"))}this.set=function(t,e){if(null===e)a().removeItem(X(t));else{var n=JSON.stringify(e);a().setItem(X(t),"string"==typeof n?n:"null")}},this.get=function(t){var e=a().getItem(X(t));return e&&JSON.parse(e)},this.remove=function(t){a().removeItem(X(t))}})),et=new tt((function(){return Y}),"localStorage"),nt=new tt((function(){return Q}),"sessionStorage"),rt=n(730),it=n.n(rt);function ot(t){return decodeURIComponent(t.replace(/\+/g," "))}function at(){var t=2147483648;return Math.floor(Math.random()*t).toString(36)+Math.abs(Math.floor(Math.random()*t)^Date.now()).toString(36)}function st(t){var e={};return t.replace(/^[^?]*\?/,"").split("&").forEach((function(t){var n=t.indexOf("=");if(n<0)e[ot(t)]=!0;else{var r=ot(t.substring(0,n));e[r]=ot(t.substring(n+1))}})),e}function ut(t){if(!t)return"";var e=[];return Object.entries(t).forEach((function(t){var n=u()(t,2),r=n[0],i=n[1];null!=i&&((0,l.Kn)(i)&&(i=JSON.stringify(i)),e.push(encodeURIComponent(r)+"="+encodeURIComponent(i)))})),e.join("&")}function ct(t,e){var n=t.indexOf("?"),r=e?(n<0?"?":"&")+ut(e):"",i=t.indexOf("#");return i<0?t+r:t.substring(0,i)+r+t.substring(i)}function ht(t,e){return it().codec.base64.fromBits(it().hash.sha1.hash(t),!1,e)}var lt=n(100),ft=n.n(lt);var dt="XMLHttpRequest",pt=g.sZ.XMLHttpRequest;pt||(pt=n(286).h),(0,g.x$)(dt,(function(){return pt}),(function(t){return pt=t}));var vt=(0,h.hu)("network.HttpRequest","HttpRequest"),yt="application/x-www-form-urlencoded",gt="application/json",_t="Content-Type",mt="PUT",bt="PATCH",kt="POST",wt="DELETE",xt="GET",St=a()((function t(e,n){i()(this,t),this.name=e,this.value=n})),At="HttpRequest",Tt=function(){function t(e,n){i()(this,t);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=ct([n].concat(S()(o.filter((function(t){return t&&t.length})).map((function(t){return encodeURIComponent(t)})))).join("/"),{c:A.DV}),this.method=e.toUpperCase(),this.headers={Accept:"application/json, text/plain"}}return a()(t,[{key:"addQueryParameters",value:function(t){return this.url=ct(this.url,t),this}},{key:"addJson",value:function(t){return this.contentType=gt,this.data=t,this}},{key:"addForm",value:function(t){return this.contentType=yt,this.data=t,this}},{key:"addHeader",value:function(t){return(0,c.T2)([At,"#addHeader"],arguments,(0,c.jt)((0,c.l4)(St))),t&&(this.headers[t.name]=t.value),this}},{key:"readResponseHeaders",value:function(){return this.readHeaders=!0,this}},{key:"send",value:function(){var t=this;return new Promise((function(e,n){var r=null;void 0!==t.data&&[kt,mt,bt].indexOf(t.method)>=0&&((r=t.contentType===yt?ut(t.data):t.contentType===gt?JSON.stringify(t.data):t.data)?t.headers[_t]=t.contentType:delete t.headers[_t]),vt.log("==> ".concat(t.method," ").concat(t.url)),Object.keys(t.headers).forEach((function(e){return vt.log(" > HEADER ".concat(e,": ").concat(t.headers[e]))})),r&&vt.log(" > DATA: ".concat(r)),t._open(r,e,(function(t){vt.log("<== ERROR: ".concat(JSON.stringify(t))),n(V(t))}))}))}},{key:"_open",value:function(t,e,n){var r=this,i=new pt,o="RESPONSE_PAYLOAD_ERROR";i.onreadystatechange=function(){if(4===i.readyState){var t=i.responseText,a=i.status;if(a>=500)n({code:o,message:"HTTP status ".concat(a)});else try{var s=t.length?JSON.parse(t):{};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,l.Kn)(c)?c:{code:u.body.status,message:c}):(r.readHeaders&&(u.headers=function(t){var e=t.getAllResponseHeaders().trim().split(/[\r\n]+/),n={};return e.forEach((function(t){var e=t.indexOf(": "),r=t.substring(0,e).toLowerCase();n[r]=t.substring(e+2)})),n}(i)),vt.log("<== ".concat(JSON.stringify(u))),e(u))}else n({code:o,message:"HTTP status ".concat(a)})}catch(t){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(t){var e=u()(t,2),n=e[0],r=e[1];return i.setRequestHeader(n,r)})),i.send(t)}}]),t}();function Rt(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return ft()(Tt,[xt,t].concat(n))}function Ot(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return ft()(Tt,[mt,t].concat(n))}function Pt(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return ft()(Tt,[kt,t].concat(n))}function Et(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return ft()(Tt,[bt,t].concat(n))}function jt(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return ft()(Tt,[wt,t].concat(n))}function Ct(t){if(t)return new St("Authorization","Bearer ".concat(t))}var It=function(){function t(e){i()(this,t),L(this,"name",e),this.counters_={}}return a()(t,[{key:"attach",value:function(t){this.counters_=t.counters_}},{key:"incrementCounter",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.counters_[t]=(this.counters_[t]||0)+e}},{key:"get",value:function(){return Object.assign({},this.counters_)}}]),t}(),Lt=new It("deprecated"),Nt=n(455);function Dt(t,e,n,r){r=r&&r.concat(": ")||"",n=n?"use ".concat(n," instead"):"it should no longer be used",t.warn("".concat(r).concat(e," is deprecated, ").concat(n,".")),Lt.incrementCounter(e)}L(h.ZP,"showDeprecations",(function(){(0,c.T2)([h.ab,"showDeprecations"],arguments),Ht=Dt})),L(h.ZP,"hideDeprecations",(function(){(0,c.T2)([h.ab,"hideDeprecations"],arguments),Ht=Nt.ZT}));var Ht=Dt;L(k,"Authentication",{avatarURL:J}),N(k,"avatarURL",(function(){return Ht(w,"Webcom.avatarURL","Webcom.Authentication.avatarURL"),J}));var Zt={code:"USER_DENIED",message:"The user aborted authentication"},Ft={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}},Mt={menubar:0,location:0,resizable:0,scrollbars:1,status:0,dialog:1,width:700,height:375};function Ut(t,e){var n=t.config.Authentication;return(0,l.HD)(n.storage)?n.storage:v(t,"state",n)+e}function Kt(t,e,n){(0,B.iK)((function(){return t(e,n)}))}function Wt(){return A.RY&&(nt.get(this._oauthSessionKey)||et.get(this._oauthSessionKey))}var qt,Jt,Bt,Vt=function(){function t(e){i()(this,t),this._logger=(0,h.hu)("api.Authentication",q),this._logger.log("Initializing with options ".concat(JSON.stringify(e.config.Authentication))),this._app=e,this._init(e)}return a()(t,[{key:"_init",value:function(t){var e=t.config.Authentication;T.call(this,e.baseUrl);var n=this._logger._count;this._currentState=function(t){try{return new M(t.state,t.details)}catch(t){return U}}(function(t,e){var n=t.config.Authentication;return n.initialState||((0,l.mf)(n.storage)?{}:et.get(Ut(t,e)))}(t,n)),this._authStateSetter=function(t,e){var n=t.config.Authentication;if((0,l.mf)(n.storage))return function(t){return n.storage(JSON.stringify(t))};var r=Ut(t,e);return function(t){return t&&!t.isUnauthenticated()?et.set(r,t):et.remove(r)}}(t,n),this._oauthSessionKey=v(t,"ongoing",e)+n,this.isAuthContextual=!1,this._firstSubscriptions=[],this._lastSubscriptions=[],this._authRoute="".concat(e.baseUrl.href,"/auth/v2/").concat(t.appId),this._resumeAuthState(),this._logger.log("Initialized for appId %s",t.appId)}},{key:"_dispose",value:function(){}},{key:"currentState",get:function(){return this._currentState},set:function(t){this._currentState.isSameAs(t)||(this._currentState=function(t){if(t.isAuthenticated()){var e=Object.assign({},t.details);return delete e.extra,K(e)}return t}(t),this._authStateSetter(this._currentState),this._notifyErrorOrAuthStateChanged(null,t))}},{key:"_resumeAuthState",value:function(){var t=this;if(A.RY)if("popup"===et.get(this._oauthSessionKey))document.body.style.display="none",et.set(this._oauthSessionKey,st(location.search).__wcsession),window.close();else{var e=nt.get(this._oauthSessionKey);if(e){var n=st(location.search).__wcsession;if(n)return void(this._oauthSessionPromise=this.resumeSession(n,e).finally((function(){delete t._oauthSessionPromise,nt.remove(t._oauthSessionKey)})).catch(Nt.ZT));nt.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 t=[q,"#removeIdentity"];try{(0,c.T2)(t,arguments);var e=this._getCurrentAuthenticationDetails(t);return this._httpGet("accounts",e.uid).addHeader(Ct(e.webcomAuthToken)).send().then((function(t){for(var e={},n=0,r=Object.entries(t.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,h=Object.entries(a);c<h.length;c++){var l=u()(h[c],2),f=l[0],d=l[1];s[f]=Object.keys(d)}e.identities=s;break;case"createdOn":e[o]=new Date(a);break;default:e[o]=a}}return e}))}catch(t){return Promise.reject(t)}}},{key:"subscribe",value:function(t,e){return(0,c.T2)([q,"#subscribe"],arguments,c.Yl,(0,c.jt)(c.O7)),e?this._firstSubscriptions.push(t):this._lastSubscriptions.push(t),Wt.call(this)?this._logger.log("Notification not sent, because an OAuth authentication is ongoing."):Kt(t,null,this.currentState),t}},{key:"unsubscribe",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;(0,c.T2)([q,"#unsubscribe"],arguments,(0,c.jt)(c.Yl),(0,c.jt)(c.O7));var n=this._firstSubscriptions.length+this._lastSubscriptions.length,r=function(e){return t&&t!==e};return!1!==e&&(this._firstSubscriptions=this._firstSubscriptions.filter(r)),!0!==e&&(this._lastSubscriptions=this._lastSubscriptions.filter(r)),n-this._firstSubscriptions.length-this._lastSubscriptions.length}},{key:"_notifyErrorOrAuthStateChanged",value:function(t,e){this._firstSubscriptions.concat(this._lastSubscriptions).forEach((function(n){return Kt(n,t,e)}))}},{key:"authenticationRevoked",value:function(t,e){(0,c.T2)([q,"#authenticationRevoked"],arguments,(0,c.l4)(M),c.Z_);var n=new Error("Authentication was revoked by the server: ".concat(e));n.code="AUTH_REVOKED",this._notifyErrorOrAuthStateChanged(n,null),this.currentState=t}},{key:"resumeSession",value:function(t,e){return(0,c.T2)("AuthenticationImpl#resumeSession",arguments,c.Z_,c.Z_),this._logger.info("fetching authentication state from an ongoing OAuth2 session..."),Pt(this._authRoute,"session").addJson({sessionKey:t,requestKey:e}).send().then(this._updateStateFromHttpResponse(),this._notifyErrorFromHttpResponse.bind(this))}},{key:"_extendHttpRequest",value:function(t){var e=this,n=t;return n.addAuthContext=function(){var n=e._contextAuthToken();return n?t.addHeader(Ct(n)):t},n}},{key:"_httpGet",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this._extendHttpRequest(Rt.apply(void 0,[this._authRoute].concat(e)))}},{key:"_httpPost",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this._extendHttpRequest(Pt.apply(void 0,[this._authRoute].concat(e)))}},{key:"_httpPut",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments