VYPR
Moderate severityNVD Advisory· Published Dec 16, 2021· Updated Aug 3, 2024

Cross-Site Request Forgery (CSRF) in livehelperchat/livehelperchat

CVE-2021-4123

Description

livehelperchat is vulnerable to Cross-Site Request Forgery (CSRF)

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

LiveHelperChat is vulnerable to CSRF, allowing attackers to perform unauthorized actions on behalf of authenticated users.

Vulnerability

LiveHelperChat is vulnerable to Cross-Site Request Forgery (CSRF) due to the use of GET requests for state-changing operations, such as modifying user settings via the user/setsettingajax endpoint. This affects versions prior to commit 2a98c69 [2][3]. The vulnerability was reported on huntr.dev [4].

Exploitation

An attacker can craft a malicious web page or email that, when visited by an authenticated LiveHelperChat administrator, triggers unauthorized GET requests to the vulnerable endpoint. The victim does not need to interact beyond viewing the page, as the requests execute in the context of their session [2].

Impact

Successful exploitation allows an attacker to alter user settings, such as chat sound preferences, without the victim's knowledge or consent. The scope is limited to settings that could be changed via GET requests, but it demonstrates a CSRF weakness that could potentially enable more harmful actions if other endpoints are similarly vulnerable [3][4].

Mitigation

The fix, introduced in commit 2a98c69 [3], changes the vulnerable GET requests to POST requests, which are not automatically executed by browsers. Users should update to a version including this commit. As of the publication date (2021-12-16), no specific patched release is mentioned, but applying the commit is recommended [2].

AI Insight generated on May 21, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
remdex/livehelperchatPackagist
<= 3.90

Affected products

3

Patches

1
2a98c69cf889

CSRF minor fixes (#1726)

https://github.com/livehelperchat/livehelperchatRemigijus KiminasDec 15, 2021via ghsa
41 files changed · +102 135
  • lhc_web/design/defaulttheme/js/js_static/54bcce5942dd8e6e1e1e0c29802cfbef.js+1 1 modified
  • lhc_web/design/defaulttheme/js/js_static/54bcce5942dd8e6e1e1e0c29802cfbef.js.map+1 1 modified
  • lhc_web/design/defaulttheme/js/js_static/7eb59706c7a02fa801134f7307266524.js+1 1 modified
  • lhc_web/design/defaulttheme/js/js_static/7eb59706c7a02fa801134f7307266524.js.map+1 1 modified
  • lhc_web/design/defaulttheme/js/js_static/d2012e174bb7dc98cdfd4c4a1a12008c.js+1 1 modified
  • lhc_web/design/defaulttheme/js/js_static/d2012e174bb7dc98cdfd4c4a1a12008c.js.map+1 1 modified
  • lhc_web/design/defaulttheme/js/lh.js+13 9 modified
    @@ -3394,11 +3394,11 @@ function lh(){
             }
     
         	if (inst.text() == 'volume_off'){
    -    		$.get(this.wwwDir+  'user/setsettingajax/chat_message/1');
    +    		$.post(this.wwwDir + 'user/setsettingajax/chat_message/1');
         		confLH.new_message_sound_admin_enabled = 1;
         		inst.text('volume_up');
         	} else {
    -    		$.get(this.wwwDir+  'user/setsettingajax/chat_message/0');
    +    		$.post(this.wwwDir + 'user/setsettingajax/chat_message/0');
         		confLH.new_message_sound_admin_enabled = 0;
         		inst.text('volume_off');
         	}
    @@ -3412,23 +3412,23 @@ function lh(){
             }
     
         	if (inst.text() == 'volume_off'){
    -    		$.get(this.wwwDir+  'user/setsettingajax/new_chat_sound/1');
    +    		$.post(this.wwwDir+  'user/setsettingajax/new_chat_sound/1');
         		confLH.new_chat_sound_enabled = 1;
         		inst.text('volume_up');
         	} else {
    -    		$.get(this.wwwDir+  'user/setsettingajax/new_chat_sound/0');
    +    		$.post(this.wwwDir+  'user/setsettingajax/new_chat_sound/0');
         		confLH.new_chat_sound_enabled = 0;
         		inst.text('volume_off');
         	}
         	return false;
         };
     
         this.changeUserSettings = function(attr,value){
    -    	$.get(this.wwwDir+  'user/setsettingajax/'+attr+'/'+value);
    +    	$.post(this.wwwDir+  'user/setsettingajax/'+attr+'/'+value);
         };
     
    -    this.changeUserSettingsIndifferent = function(attr,value){
    -    	$.get(this.wwwDir+  'user/setsettingajax/'+attr+'/'+encodeURIComponent(value)+'/(indifferent)/true');
    +    this.changeUserSettingsIndifferent = function(attr,value) {
    +    	$.post(this.wwwDir+  'user/setsettingajax/'+attr+'/'+encodeURIComponent(value)+'/(indifferent)/true');
         };
     
     	this.switchToOfflineForm = function(){
    @@ -3468,11 +3468,11 @@ function lh(){
         this.disableChatSoundUser = function(inst)
         {
         	if (inst.find('> i').text() == 'volume_off') {
    -    		$.get(this.wwwDir+  'user/setsettingajax/chat_message/1');
    +    		$.post(this.wwwDir+  'user/setsettingajax/chat_message/1');
         		confLH.new_message_sound_user_enabled = 1;
         		inst.find('> i').text('volume_up');
         	} else {
    -    		$.get(this.wwwDir+  'user/setsettingajax/chat_message/0');
    +    		$.post(this.wwwDir+  'user/setsettingajax/chat_message/0');
         		confLH.new_message_sound_user_enabled = 0;
         		inst.find('> i').text('volume_off');
         	};
    @@ -4561,6 +4561,10 @@ window.onfocus = window.onblur = function(e) {
     
     window.lhcSelector = null;
     
    +$( document ).ready(function() {
    +    lhinst.protectCSFR();
    +})
    +
     /*Helper functions*/
     function chatsyncuser()
     {
    
  • lhc_web/design/defaulttheme/js/lh.min.js+1 1 modified
  • lhc_web/design/defaulttheme/js/widgetv2/1.76e60b1aab09f2ea2bea.ie.js+0 9 removed
    @@ -1,9 +0,0 @@
    -(window.webpackJsonpLHCReactAPP=window.webpackJsonpLHCReactAPP||[]).push([[1],{482:function(t,e,r){var n=r(493),o=function(){return!this}();function i(t,e){this.name="AuthTokenExpiredError",this.message=t,this.expiry=e,Error.captureStackTrace&&!o?Error.captureStackTrace(this,arguments.callee):this.stack=(new Error).stack}function s(t){this.name="AuthTokenInvalidError",this.message=t,Error.captureStackTrace&&!o?Error.captureStackTrace(this,arguments.callee):this.stack=(new Error).stack}function a(t,e){this.name="AuthTokenNotBeforeError",this.message=t,this.date=e,Error.captureStackTrace&&!o?Error.captureStackTrace(this,arguments.callee):this.stack=(new Error).stack}function c(t){this.name="AuthTokenError",this.message=t,Error.captureStackTrace&&!o?Error.captureStackTrace(this,arguments.callee):this.stack=(new Error).stack}function h(t){this.name="AuthError",this.message=t,Error.captureStackTrace&&!o?Error.captureStackTrace(this,arguments.callee):this.stack=(new Error).stack}function u(t,e){this.name="SilentMiddlewareBlockedError",this.message=t,this.type=e,Error.captureStackTrace&&!o?Error.captureStackTrace(this,arguments.callee):this.stack=(new Error).stack}function p(t){this.name="InvalidActionError",this.message=t,Error.captureStackTrace&&!o?Error.captureStackTrace(this,arguments.callee):this.stack=(new Error).stack}function l(t){this.name="InvalidArgumentsError",this.message=t,Error.captureStackTrace&&!o?Error.captureStackTrace(this,arguments.callee):this.stack=(new Error).stack}function f(t){this.name="InvalidOptionsError",this.message=t,Error.captureStackTrace&&!o?Error.captureStackTrace(this,arguments.callee):this.stack=(new Error).stack}function d(t){this.name="InvalidMessageError",this.message=t,Error.captureStackTrace&&!o?Error.captureStackTrace(this,arguments.callee):this.stack=(new Error).stack}function y(t,e){this.name="SocketProtocolError",this.message=t,this.code=e,Error.captureStackTrace&&!o?Error.captureStackTrace(this,arguments.callee):this.stack=(new Error).stack}function g(t){this.name="ServerProtocolError",this.message=t,Error.captureStackTrace&&!o?Error.captureStackTrace(this,arguments.callee):this.stack=(new Error).stack}function m(t){this.name="HTTPServerError",this.message=t,Error.captureStackTrace&&!o?Error.captureStackTrace(this,arguments.callee):this.stack=(new Error).stack}function b(t){this.name="ResourceLimitError",this.message=t,Error.captureStackTrace&&!o?Error.captureStackTrace(this,arguments.callee):this.stack=(new Error).stack}function v(t){this.name="TimeoutError",this.message=t,Error.captureStackTrace&&!o?Error.captureStackTrace(this,arguments.callee):this.stack=(new Error).stack}function E(t,e){this.name="BadConnectionError",this.message=t,this.type=e,Error.captureStackTrace&&!o?Error.captureStackTrace(this,arguments.callee):this.stack=(new Error).stack}function T(t){this.name="BrokerError",this.message=t,Error.captureStackTrace&&!o?Error.captureStackTrace(this,arguments.callee):this.stack=(new Error).stack}function S(t,e){this.name="ProcessExitError",this.message=t,this.code=e,Error.captureStackTrace&&!o?Error.captureStackTrace(this,arguments.callee):this.stack=(new Error).stack}function w(t){this.name="UnknownError",this.message=t,Error.captureStackTrace&&!o?Error.captureStackTrace(this,arguments.callee):this.stack=(new Error).stack}i.prototype=Object.create(Error.prototype),s.prototype=Object.create(Error.prototype),a.prototype=Object.create(Error.prototype),c.prototype=Object.create(Error.prototype),h.prototype=Object.create(Error.prototype),u.prototype=Object.create(Error.prototype),p.prototype=Object.create(Error.prototype),l.prototype=Object.create(Error.prototype),f.prototype=Object.create(Error.prototype),d.prototype=Object.create(Error.prototype),y.prototype=Object.create(Error.prototype),g.prototype=Object.create(Error.prototype),m.prototype=Object.create(Error.prototype),b.prototype=Object.create(Error.prototype),v.prototype=Object.create(Error.prototype),E.prototype=Object.create(Error.prototype),T.prototype=Object.create(Error.prototype),S.prototype=Object.create(Error.prototype),w.prototype=Object.create(Error.prototype),t.exports={AuthTokenExpiredError:i,AuthTokenInvalidError:s,AuthTokenNotBeforeError:a,AuthTokenError:c,AuthError:h,SilentMiddlewareBlockedError:u,InvalidActionError:p,InvalidArgumentsError:l,InvalidOptionsError:f,InvalidMessageError:d,SocketProtocolError:y,ServerProtocolError:g,HTTPServerError:m,ResourceLimitError:b,TimeoutError:v,BadConnectionError:E,BrokerError:T,ProcessExitError:S,UnknownError:w},t.exports.socketProtocolErrorStatuses={1001:"Socket was disconnected",1002:"A WebSocket protocol error was encountered",1003:"Server terminated socket because it received invalid data",1005:"Socket closed without status code",1006:"Socket hung up",1007:"Message format was incorrect",1008:"Encountered a policy violation",1009:"Message was too big to process",1010:"Client ended the connection because the server did not comply with extension requirements",1011:"Server encountered an unexpected fatal condition",4e3:"Server ping timed out",4001:"Client pong timed out",4002:"Server failed to sign auth token",4003:"Failed to complete handshake",4004:"Client failed to save auth token",4005:"Did not receive #handshake from client before timeout",4006:"Failed to bind socket to message broker",4007:"Client connection establishment timed out",4008:"Server rejected handshake from client",4009:"Server received a message before the client handshake"},t.exports.socketProtocolIgnoreStatuses={1e3:"Socket closed normally",1001:"Socket hung up"};var k={domain:1,domainEmitter:1,domainThrown:1};t.exports.dehydrateError=function(t,e){var r;if(t&&"object"==typeof t)for(var o in r={message:t.message},e&&(r.stack=t.stack),t)k[o]||(r[o]=t[o]);else r="function"==typeof t?"[function "+(t.name||"anonymous")+"]":t;return n(r)},t.exports.hydrateError=function(t){var e=null;if(null!=t)if("object"==typeof t)for(var r in e=new Error(t.message),t)t.hasOwnProperty(r)&&(e[r]=t[r]);else e=t;return e},t.exports.decycle=n},483:function(t,e,r){function n(t){if(t)return function(t){for(var e in n.prototype)t[e]=n.prototype[e];return t}(t)}t.exports=n,n.prototype.on=n.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},n.prototype.once=function(t,e){function r(){this.off(t,r),e.apply(this,arguments)}return r.fn=e,this.on(t,r),this},n.prototype.off=n.prototype.removeListener=n.prototype.removeAllListeners=n.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,n=this._callbacks["$"+t];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var o=0;o<n.length;o++)if((r=n[o])===e||r.fn===e){n.splice(o,1);break}return this},n.prototype.emit=function(t){this._callbacks=this._callbacks||{};var e=[].slice.call(arguments,1),r=this._callbacks["$"+t];if(r)for(var n=0,o=(r=r.slice(0)).length;n<o;++n)r[n].apply(this,e);return this},n.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},n.prototype.hasListeners=function(t){return!!this.listeners(t).length}},484:function(t,e,r){(function(e){var n=r(483),o=r(491).SCChannel,i=(r(485).Response,r(494).AuthEngine),s=r(495),a=r(496).SCTransport,c=r(486),h=r(500),u=r(487).Buffer,p=r(505),l=r(482),f=l.InvalidArgumentsError,d=l.InvalidMessageError,y=l.InvalidActionError,g=l.SocketProtocolError,m=l.TimeoutError,b=l.BadConnectionError,v="undefined"!=typeof window,E=function(t){var r=this;n.call(this),this.id=null,this.state=this.CLOSED,this.authState=this.UNAUTHENTICATED,this.signedAuthToken=null,this.authToken=null,this.pendingReconnect=!1,this.pendingReconnectTimeout=null,this.preparingPendingSubscriptions=!1,this.clientId=t.clientId,this.connectTimeout=t.connectTimeout,this.ackTimeout=t.ackTimeout,this.channelPrefix=t.channelPrefix||null,this.disconnectOnUnload=null==t.disconnectOnUnload||t.disconnectOnUnload,this.authTokenName=t.authTokenName,this.pingTimeout=this.ackTimeout,this.pingTimeoutDisabled=!!t.pingTimeoutDisabled,this.active=!0,this._clientMap=t.clientMap||{};var o=Math.pow(2,31)-1,a=function(t){if(r[t]>o)throw new f("The "+t+" value provided exceeded the maximum amount allowed")};if(a("connectTimeout"),a("ackTimeout"),this._localEvents={connect:1,connectAbort:1,close:1,disconnect:1,message:1,error:1,raw:1,kickOut:1,subscribe:1,unsubscribe:1,subscribeStateChange:1,authStateChange:1,authenticate:1,deauthenticate:1,removeAuthToken:1,subscribeRequest:1},this.connectAttempts=0,this._emitBuffer=new h,this.channels={},this.options=t,this._cid=1,this.options.callIdGenerator=function(){return r._cid++},this.options.autoReconnect){null==this.options.autoReconnectOptions&&(this.options.autoReconnectOptions={});var u=this.options.autoReconnectOptions;null==u.initialDelay&&(u.initialDelay=1e4),null==u.randomness&&(u.randomness=1e4),null==u.multiplier&&(u.multiplier=1.5),null==u.maxDelay&&(u.maxDelay=6e4)}if(null==this.options.subscriptionRetryOptions&&(this.options.subscriptionRetryOptions={}),this.options.authEngine?this.auth=this.options.authEngine:this.auth=new i,this.options.codecEngine?this.codec=this.options.codecEngine:this.codec=s,this.options.protocol){var p=new f('The "protocol" option does not affect socketcluster-client. If you want to utilize SSL/TLS - use "secure" option instead');this._onSCError(p)}this.options.path=this.options.path.replace(/\/$/,"")+"/",this.options.query=t.query||{},"string"==typeof this.options.query&&(this.options.query=c.parse(this.options.query)),this._channelEmitter=new n,this._unloadHandler=function(){r.disconnect()},v&&this.disconnectOnUnload&&e.addEventListener&&e.addEventListener("beforeunload",this._unloadHandler,!1),this._clientMap[this.clientId]=this,this.options.autoConnect&&this.connect()};E.prototype=Object.create(n.prototype),E.CONNECTING=E.prototype.CONNECTING=a.prototype.CONNECTING,E.OPEN=E.prototype.OPEN=a.prototype.OPEN,E.CLOSED=E.prototype.CLOSED=a.prototype.CLOSED,E.AUTHENTICATED=E.prototype.AUTHENTICATED="authenticated",E.UNAUTHENTICATED=E.prototype.UNAUTHENTICATED="unauthenticated",E.PENDING=E.prototype.PENDING="pending",E.ignoreStatuses=l.socketProtocolIgnoreStatuses,E.errorStatuses=l.socketProtocolErrorStatuses,E.prototype._privateEventHandlerMap={"#publish":function(t){var e=this._undecorateChannelName(t.channel);this.isSubscribed(e,!0)&&this._channelEmitter.emit(e,t.data)},"#kickOut":function(t){var e=this._undecorateChannelName(t.channel),r=this.channels[e];r&&(n.prototype.emit.call(this,"kickOut",t.message,e),r.emit("kickOut",t.message,e),this._triggerChannelUnsubscribe(r))},"#setAuthToken":function(t,e){var r=this;if(t){this.auth.saveToken(this.authTokenName,t.token,{},(function(n){n?(e.error(n),r._onSCError(n)):(r._changeToAuthenticatedState(t.token),e.end())}))}else e.error(new d("No token data provided by #setAuthToken event"))},"#removeAuthToken":function(t,e){var r=this;this.auth.removeToken(this.authTokenName,(function(t,o){t?(e.error(t),r._onSCError(t)):(n.prototype.emit.call(r,"removeAuthToken",o),r._changeToUnauthenticatedStateAndClearTokens(),e.end())}))},"#disconnect":function(t){this.transport.close(t.code,t.data)}},E.prototype.getState=function(){return this.state},E.prototype.getBytesReceived=function(){return this.transport.getBytesReceived()},E.prototype.deauthenticate=function(t){var e=this;this.auth.removeToken(this.authTokenName,(function(r,o){r?e._onSCError(r):(n.prototype.emit.call(e,"removeAuthToken",o),e.state!==e.CLOSED&&e.emit("#removeAuthToken"),e._changeToUnauthenticatedStateAndClearTokens()),t&&t(r)}))},E.prototype.connect=E.prototype.open=function(){var t=this;if(this.active)this.state===this.CLOSED&&(this.pendingReconnect=!1,this.pendingReconnectTimeout=null,clearTimeout(this._reconnectTimeoutRef),this.state=this.CONNECTING,n.prototype.emit.call(this,"connecting"),this.transport&&this.transport.off(),this.transport=new a(this.auth,this.codec,this.options),this.transport.on("open",(function(e){t.state=t.OPEN,t._onSCOpen(e)})),this.transport.on("error",(function(e){t._onSCError(e)})),this.transport.on("close",(function(e,r){t.state=t.CLOSED,t._onSCClose(e,r)})),this.transport.on("openAbort",(function(e,r){t.state=t.CLOSED,t._onSCClose(e,r,!0)})),this.transport.on("event",(function(e,r,n){t._onSCEvent(e,r,n)})));else{var e=new y("Cannot connect a destroyed client");this._onSCError(e)}},E.prototype.reconnect=function(t,e){this.disconnect(t,e),this.connect()},E.prototype.disconnect=function(t,e){if("number"!=typeof(t=t||1e3))throw new f("If specified, the code argument must be a number");this.state===this.OPEN||this.state===this.CONNECTING?this.transport.close(t,e):(this.pendingReconnect=!1,this.pendingReconnectTimeout=null,clearTimeout(this._reconnectTimeoutRef))},E.prototype.destroy=function(t,r){v&&e.removeEventListener&&e.removeEventListener("beforeunload",this._unloadHandler,!1),this.active=!1,this.disconnect(t,r),delete this._clientMap[this.clientId]},E.prototype._changeToUnauthenticatedStateAndClearTokens=function(){if(this.authState!==this.UNAUTHENTICATED){var t=this.authState,e=this.signedAuthToken;this.authState=this.UNAUTHENTICATED,this.signedAuthToken=null,this.authToken=null;var r={oldState:t,newState:this.authState};n.prototype.emit.call(this,"authStateChange",r),n.prototype.emit.call(this,"deauthenticate",e)}},E.prototype._changeToAuthenticatedState=function(t){if(this.signedAuthToken=t,this.authToken=this._extractAuthTokenData(t),this.authState!==this.AUTHENTICATED){var e=this.authState;this.authState=this.AUTHENTICATED;var r={oldState:e,newState:this.authState,signedAuthToken:t,authToken:this.authToken};this.preparingPendingSubscriptions||this.processPendingSubscriptions(),n.prototype.emit.call(this,"authStateChange",r)}n.prototype.emit.call(this,"authenticate",t)},E.prototype.decodeBase64=function(t){return u.from(t,"base64").toString("utf8")},E.prototype.encodeBase64=function(t){return u.from(t,"utf8").toString("base64")},E.prototype._extractAuthTokenData=function(t){var e=(t||"").split(".")[1];if(null!=e){var r=e;try{return r=this.decodeBase64(r),JSON.parse(r)}catch(t){return r}}return null},E.prototype.getAuthToken=function(){return this.authToken},E.prototype.getSignedAuthToken=function(){return this.signedAuthToken},E.prototype.authenticate=function(t,e){var r=this;this.emit("#authenticate",t,(function(n,o){o&&null!=o.isAuthenticated?o.authError&&(o.authError=l.hydrateError(o.authError)):o={isAuthenticated:r.authState,authError:null},n?("BadConnectionError"!==n.name&&"TimeoutError"!==n.name&&r._changeToUnauthenticatedStateAndClearTokens(),e&&e(n,o)):r.auth.saveToken(r.authTokenName,t,{},(function(n){n&&r._onSCError(n),o.isAuthenticated?r._changeToAuthenticatedState(t):r._changeToUnauthenticatedStateAndClearTokens(),e&&e(n,o)}))}))},E.prototype._tryReconnect=function(t){var e,r=this,n=this.connectAttempts++,o=this.options.autoReconnectOptions;if(null==t||n>0){var i=Math.round(o.initialDelay+(o.randomness||0)*Math.random());e=Math.round(i*Math.pow(o.multiplier,n))}else e=t;e>o.maxDelay&&(e=o.maxDelay),clearTimeout(this._reconnectTimeoutRef),this.pendingReconnect=!0,this.pendingReconnectTimeout=e,this._reconnectTimeoutRef=setTimeout((function(){r.connect()}),e)},E.prototype._onSCOpen=function(t){var e=this;this.preparingPendingSubscriptions=!0,t?(this.id=t.id,this.pingTimeout=t.pingTimeout,this.transport.pingTimeout=this.pingTimeout,t.isAuthenticated?this._changeToAuthenticatedState(t.authToken):this._changeToUnauthenticatedStateAndClearTokens()):this._changeToUnauthenticatedStateAndClearTokens(),this.connectAttempts=0,this.options.autoSubscribeOnConnect&&this.processPendingSubscriptions(),n.prototype.emit.call(this,"connect",t,(function(){e.processPendingSubscriptions()})),this.state===this.OPEN&&this._flushEmitBuffer()},E.prototype._onSCError=function(t){var e=this;setTimeout((function(){if(e.listeners("error").length<1)throw t;n.prototype.emit.call(e,"error",t)}),0)},E.prototype._suspendSubscriptions=function(){var t,e;for(var r in this.channels)this.channels.hasOwnProperty(r)&&(e=(t=this.channels[r]).state===t.SUBSCRIBED||t.state===t.PENDING?t.PENDING:t.UNSUBSCRIBED,this._triggerChannelUnsubscribe(t,e))},E.prototype._abortAllPendingEventsDueToBadConnection=function(t){for(var e,r=this._emitBuffer.head;r;){e=r.next;var n=r.data;clearTimeout(n.timeout),delete n.timeout,r.detach(),r=e;var o=n.callback;if(o){delete n.callback;var i="Event '"+n.event+"' was aborted due to a bad connection",s=new b(i,t);o.call(n,s,n)}n.cid&&this.transport.cancelPendingResponse(n.cid)}},E.prototype._onSCClose=function(t,e,r){if(this.id=null,this.transport&&this.transport.off(),this.pendingReconnect=!1,this.pendingReconnectTimeout=null,clearTimeout(this._reconnectTimeoutRef),this._suspendSubscriptions(),this._abortAllPendingEventsDueToBadConnection(r?"connectAbort":"disconnect"),this.options.autoReconnect&&(4e3===t||4001===t||1005===t?this._tryReconnect(0):1e3!==t&&t<4500&&this._tryReconnect()),r?n.prototype.emit.call(this,"connectAbort",t,e):n.prototype.emit.call(this,"disconnect",t,e),n.prototype.emit.call(this,"close",t,e),!E.ignoreStatuses[t]){var o;o=e?"Socket connection closed with status code "+t+" and reason: "+e:"Socket connection closed with status code "+t;var i=new g(E.errorStatuses[t]||o,t);this._onSCError(i)}},E.prototype._onSCEvent=function(t,e,r){var o=this._privateEventHandlerMap[t];o?o.call(this,e,r):n.prototype.emit.call(this,t,e,(function(){r&&r.callback.apply(r,arguments)}))},E.prototype.decode=function(t){return this.transport.decode(t)},E.prototype.encode=function(t){return this.transport.encode(t)},E.prototype._flushEmitBuffer=function(){for(var t,e=this._emitBuffer.head;e;){t=e.next;var r=e.data;e.detach(),this.transport.emitObject(r),e=t}},E.prototype._handleEventAckTimeout=function(t,e){e&&e.detach(),delete t.timeout;var r=t.callback;if(r){delete t.callback;var n=new m("Event response for '"+t.event+"' timed out");r.call(t,n,t)}t.cid&&this.transport.cancelPendingResponse(t.cid)},E.prototype._emit=function(t,e,r){var n=this;this.state===this.CLOSED&&this.connect();var o={event:t,callback:r},i=new h.Item;this.options.cloneData?o.data=p(e):o.data=e,i.data=o,o.timeout=setTimeout((function(){n._handleEventAckTimeout(o,i)}),this.ackTimeout),this._emitBuffer.append(i),this.state===this.OPEN&&this._flushEmitBuffer()},E.prototype.send=function(t){this.transport.send(t)},E.prototype.emit=function(t,e,r){if(null==this._localEvents[t])this._emit(t,e,r);else if("error"===t)n.prototype.emit.call(this,t,e);else{var o=new y('The "'+t+'" event is reserved and cannot be emitted on a client socket');this._onSCError(o)}},E.prototype.publish=function(t,e,r){var n={channel:this._decorateChannelName(t),data:e};this.emit("#publish",n,r)},E.prototype._triggerChannelSubscribe=function(t,e){var r=t.name;if(t.state!==t.SUBSCRIBED){var o=t.state;t.state=t.SUBSCRIBED;var i={channel:r,oldState:o,newState:t.state,subscriptionOptions:e};t.emit("subscribeStateChange",i),t.emit("subscribe",r,e),n.prototype.emit.call(this,"subscribeStateChange",i),n.prototype.emit.call(this,"subscribe",r,e)}},E.prototype._triggerChannelSubscribeFail=function(t,e,r){var o=e.name,i=!e.waitForAuth||this.authState===this.AUTHENTICATED;e.state!==e.UNSUBSCRIBED&&i&&(e.state=e.UNSUBSCRIBED,e.emit("subscribeFail",t,o,r),n.prototype.emit.call(this,"subscribeFail",t,o,r))},E.prototype._cancelPendingSubscribeCallback=function(t){null!=t._pendingSubscriptionCid&&(this.transport.cancelPendingResponse(t._pendingSubscriptionCid),delete t._pendingSubscriptionCid)},E.prototype._decorateChannelName=function(t){return this.channelPrefix&&(t=this.channelPrefix+t),t},E.prototype._undecorateChannelName=function(t){return this.channelPrefix&&0===t.indexOf(this.channelPrefix)?t.replace(this.channelPrefix,""):t},E.prototype._trySubscribe=function(t){var e=this,r=!t.waitForAuth||this.authState===this.AUTHENTICATED;if(this.state===this.OPEN&&!this.preparingPendingSubscriptions&&null==t._pendingSubscriptionCid&&r){var o={noTimeout:!0},i={channel:this._decorateChannelName(t.name)};t.waitForAuth&&(o.waitForAuth=!0,i.waitForAuth=o.waitForAuth),t.data&&(i.data=t.data),t.batch&&(o.batch=!0,i.batch=!0),t._pendingSubscriptionCid=this.transport.emit("#subscribe",i,o,(function(r){delete t._pendingSubscriptionCid,r?e._triggerChannelSubscribeFail(r,t,i):e._triggerChannelSubscribe(t,i)})),n.prototype.emit.call(this,"subscribeRequest",t.name,i)}},E.prototype.subscribe=function(t,e){var r=this.channels[t];return r?e&&r.setOptions(e):(r=new o(t,this,e),this.channels[t]=r),r.state===r.UNSUBSCRIBED&&(r.state=r.PENDING,this._trySubscribe(r)),r},E.prototype._triggerChannelUnsubscribe=function(t,e){var r=t.name,o=t.state;if(t.state=e||t.UNSUBSCRIBED,this._cancelPendingSubscribeCallback(t),o===t.SUBSCRIBED){var i={channel:r,oldState:o,newState:t.state};t.emit("subscribeStateChange",i),t.emit("unsubscribe",r),n.prototype.emit.call(this,"subscribeStateChange",i),n.prototype.emit.call(this,"unsubscribe",r)}},E.prototype._tryUnsubscribe=function(t){if(this.state===this.OPEN){var e={noTimeout:!0};t.batch&&(e.batch=!0),this._cancelPendingSubscribeCallback(t);var r=this._decorateChannelName(t.name);this.transport.emit("#unsubscribe",r,e)}},E.prototype.unsubscribe=function(t){var e=this.channels[t];e&&e.state!==e.UNSUBSCRIBED&&(this._triggerChannelUnsubscribe(e),this._tryUnsubscribe(e))},E.prototype.channel=function(t,e){var r=this.channels[t];return r||(r=new o(t,this,e),this.channels[t]=r),r},E.prototype.destroyChannel=function(t){var e=this.channels[t];e&&(e.unwatch(),e.unsubscribe(),delete this.channels[t])},E.prototype.subscriptions=function(t){var e,r=[];for(var n in this.channels)this.channels.hasOwnProperty(n)&&(e=this.channels[n],(t?e&&(e.state===e.SUBSCRIBED||e.state===e.PENDING):e&&e.state===e.SUBSCRIBED)&&r.push(n));return r},E.prototype.isSubscribed=function(t,e){var r=this.channels[t];return e?!!r&&(r.state===r.SUBSCRIBED||r.state===r.PENDING):!!r&&r.state===r.SUBSCRIBED},E.prototype.processPendingSubscriptions=function(){var t=this;this.preparingPendingSubscriptions=!1;var e=[];for(var r in this.channels)if(this.channels.hasOwnProperty(r)){var n=this.channels[r];n.state===n.PENDING&&e.push(n)}e.sort((function(t,e){var r=t.priority||0,n=e.priority||0;return r>n?-1:r<n?1:0})),e.forEach((function(e){t._trySubscribe(e)}))},E.prototype.watch=function(t,e){if("function"!=typeof e)throw new f("No handler function was provided");this._channelEmitter.on(t,e)},E.prototype.unwatch=function(t,e){e?this._channelEmitter.removeListener(t,e):this._channelEmitter.removeAllListeners(t)},E.prototype.watchers=function(t){return this._channelEmitter.listeners(t)},t.exports=E}).call(this,r(66))},485:function(t,e,r){var n=r(482),o=n.InvalidActionError,i=function(t,e){this.socket=t,this.id=e,this.sent=!1};i.prototype._respond=function(t){if(this.sent)throw new o("Response "+this.id+" has already been sent");this.sent=!0,this.socket.send(this.socket.encode(t))},i.prototype.end=function(t){if(this.id){var e={rid:this.id};void 0!==t&&(e.data=t),this._respond(e)}},i.prototype.error=function(t,e){if(this.id){var r=n.dehydrateError(t),o={rid:this.id,error:r};void 0!==e&&(o.data=e),this._respond(o)}},i.prototype.callback=function(t,e){t?this.error(t,e):this.end(e)},t.exports.Response=i},486:function(t,e,r){"use strict";e.decode=e.parse=r(497),e.encode=e.stringify=r(498)},487:function(t,e,r){"use strict";(function(t){
    -/*!
    - * The buffer module from node.js, for the browser.
    - *
    - * @author   Feross Aboukhadijeh <http://feross.org>
    - * @license  MIT
    - */
    -var n=r(502),o=r(503),i=r(504);function s(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(s()<e)throw new RangeError("Invalid typed array length");return c.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=c.prototype:(null===t&&(t=new c(e)),t.length=e),t}function c(t,e,r){if(!(c.TYPED_ARRAY_SUPPORT||this instanceof c))return new c(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return p(this,t)}return h(this,t,e,r)}function h(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n);c.TYPED_ARRAY_SUPPORT?(t=e).__proto__=c.prototype:t=l(t,e);return t}(t,e,r,n):"string"==typeof e?function(t,e,r){"string"==typeof r&&""!==r||(r="utf8");if(!c.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|d(e,r),o=(t=a(t,n)).write(e,r);o!==n&&(t=t.slice(0,o));return t}(t,e,r):function(t,e){if(c.isBuffer(e)){var r=0|f(e.length);return 0===(t=a(t,r)).length||e.copy(t,0,0,r),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?a(t,0):l(t,e);if("Buffer"===e.type&&i(e.data))return l(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function u(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function p(t,e){if(u(e),t=a(t,e<0?0:0|f(e)),!c.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function l(t,e){var r=e.length<0?0:0|f(e.length);t=a(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function f(t){if(t>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function d(t,e){if(c.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return Y(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(t).length;default:if(n)return Y(t).length;e=(""+e).toLowerCase(),n=!0}}function y(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return R(this,e,r);case"utf8":case"utf-8":return A(this,e,r);case"ascii":return C(this,e,r);case"latin1":case"binary":return O(this,e,r);case"base64":return _(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function g(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function m(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=c.from(e,n)),c.isBuffer(e))return 0===e.length?-1:b(t,e,r,n,o);if("number"==typeof e)return e&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):b(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function b(t,e,r,n,o){var i,s=1,a=t.length,c=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,c/=2,r/=2}function h(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(o){var u=-1;for(i=r;i<a;i++)if(h(t,i)===h(e,-1===u?0:i-u)){if(-1===u&&(u=i),i-u+1===c)return u*s}else-1!==u&&(i-=i-u),u=-1}else for(r+c>a&&(r=a-c),i=r;i>=0;i--){for(var p=!0,l=0;l<c;l++)if(h(t,i+l)!==h(e,l)){p=!1;break}if(p)return i}return-1}function v(t,e,r,n){r=Number(r)||0;var o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i=e.length;if(i%2!=0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var s=0;s<n;++s){var a=parseInt(e.substr(2*s,2),16);if(isNaN(a))return s;t[r+s]=a}return s}function E(t,e,r,n){return F(Y(e,t.length-r),t,r,n)}function T(t,e,r,n){return F(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function S(t,e,r,n){return T(t,e,r,n)}function w(t,e,r,n){return F(G(e),t,r,n)}function k(t,e,r,n){return F(function(t,e){for(var r,n,o,i=[],s=0;s<t.length&&!((e-=2)<0);++s)r=t.charCodeAt(s),n=r>>8,o=r%256,i.push(o),i.push(n);return i}(e,t.length-r),t,r,n)}function _(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function A(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var i,s,a,c,h=t[o],u=null,p=h>239?4:h>223?3:h>191?2:1;if(o+p<=r)switch(p){case 1:h<128&&(u=h);break;case 2:128==(192&(i=t[o+1]))&&(c=(31&h)<<6|63&i)>127&&(u=c);break;case 3:i=t[o+1],s=t[o+2],128==(192&i)&&128==(192&s)&&(c=(15&h)<<12|(63&i)<<6|63&s)>2047&&(c<55296||c>57343)&&(u=c);break;case 4:i=t[o+1],s=t[o+2],a=t[o+3],128==(192&i)&&128==(192&s)&&128==(192&a)&&(c=(15&h)<<18|(63&i)<<12|(63&s)<<6|63&a)>65535&&c<1114112&&(u=c)}null===u?(u=65533,p=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|1023&u),n.push(u),o+=p}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return r}(n)}e.Buffer=c,e.SlowBuffer=function(t){+t!=t&&(t=0);return c.alloc(+t)},e.INSPECT_MAX_BYTES=50,c.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=s(),c.poolSize=8192,c._augment=function(t){return t.__proto__=c.prototype,t},c.from=function(t,e,r){return h(null,t,e,r)},c.TYPED_ARRAY_SUPPORT&&(c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0})),c.alloc=function(t,e,r){return function(t,e,r,n){return u(e),e<=0?a(t,e):void 0!==r?"string"==typeof n?a(t,e).fill(r,n):a(t,e).fill(r):a(t,e)}(null,t,e,r)},c.allocUnsafe=function(t){return p(null,t)},c.allocUnsafeSlow=function(t){return p(null,t)},c.isBuffer=function(t){return!(null==t||!t._isBuffer)},c.compare=function(t,e){if(!c.isBuffer(t)||!c.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,o=0,i=Math.min(r,n);o<i;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0},c.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(t,e){if(!i(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return c.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=c.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){var s=t[r];if(!c.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(n,o),o+=s.length}return n},c.byteLength=d,c.prototype._isBuffer=!0,c.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)g(this,e,e+1);return this},c.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)g(this,e,e+3),g(this,e+1,e+2);return this},c.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)g(this,e,e+7),g(this,e+1,e+6),g(this,e+2,e+5),g(this,e+3,e+4);return this},c.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?A(this,0,t):y.apply(this,arguments)},c.prototype.equals=function(t){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===c.compare(this,t)},c.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},c.prototype.compare=function(t,e,r,n,o){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),a=Math.min(i,s),h=this.slice(n,o),u=t.slice(e,r),p=0;p<a;++p)if(h[p]!==u[p]){i=h[p],s=u[p];break}return i<s?-1:s<i?1:0},c.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},c.prototype.indexOf=function(t,e,r){return m(this,t,e,r,!0)},c.prototype.lastIndexOf=function(t,e,r){return m(this,t,e,r,!1)},c.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return v(this,t,e,r);case"utf8":case"utf-8":return E(this,t,e,r);case"ascii":return T(this,t,e,r);case"latin1":case"binary":return S(this,t,e,r);case"base64":return w(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function C(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}function O(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}function R(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=e;i<r;++i)o+=M(t[i]);return o}function P(t,e,r){for(var n=t.slice(e,r),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function B(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function I(t,e,r,n,o,i){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<i)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function N(t,e,r,n){e<0&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-r,2);o<i;++o)t[r+o]=(e&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function U(t,e,r,n){e<0&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-r,4);o<i;++o)t[r+o]=e>>>8*(n?o:3-o)&255}function D(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function x(t,e,r,n,i){return i||D(t,0,r,4),o.write(t,e,r,n,23,4),r+4}function j(t,e,r,n,i){return i||D(t,0,r,8),o.write(t,e,r,n,52,8),r+8}c.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),c.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=c.prototype;else{var o=e-t;r=new c(o,void 0);for(var i=0;i<o;++i)r[i]=this[i+t]}return r},c.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||B(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n},c.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||B(t,e,this.length);for(var n=this[t+--e],o=1;e>0&&(o*=256);)n+=this[t+--e]*o;return n},c.prototype.readUInt8=function(t,e){return e||B(t,1,this.length),this[t]},c.prototype.readUInt16LE=function(t,e){return e||B(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUInt16BE=function(t,e){return e||B(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUInt32LE=function(t,e){return e||B(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUInt32BE=function(t,e){return e||B(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||B(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*e)),n},c.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||B(t,e,this.length);for(var n=e,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},c.prototype.readInt8=function(t,e){return e||B(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function(t,e){e||B(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(t,e){e||B(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(t,e){return e||B(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,e){return e||B(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readFloatLE=function(t,e){return e||B(t,4,this.length),o.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,e){return e||B(t,4,this.length),o.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,e){return e||B(t,8,this.length),o.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,e){return e||B(t,8,this.length),o.read(this,t,!1,52,8)},c.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||I(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[e]=255&t;++i<r&&(o*=256);)this[e+i]=t/o&255;return e+r},c.prototype.writeUIntBE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||I(this,t,e,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+r},c.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,1,255,0),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},c.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):N(this,t,e,!0),e+2},c.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):N(this,t,e,!1),e+2},c.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):U(this,t,e,!0),e+4},c.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):U(this,t,e,!1),e+4},c.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);I(this,t,e,r,o-1,-o)}var i=0,s=1,a=0;for(this[e]=255&t;++i<r&&(s*=256);)t<0&&0===a&&0!==this[e+i-1]&&(a=1),this[e+i]=(t/s>>0)-a&255;return e+r},c.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);I(this,t,e,r,o-1,-o)}var i=r-1,s=1,a=0;for(this[e+i]=255&t;--i>=0&&(s*=256);)t<0&&0===a&&0!==this[e+i+1]&&(a=1),this[e+i]=(t/s>>0)-a&255;return e+r},c.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,1,127,-128),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},c.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):N(this,t,e,!0),e+2},c.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):N(this,t,e,!1),e+2},c.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):U(this,t,e,!0),e+4},c.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):U(this,t,e,!1),e+4},c.prototype.writeFloatLE=function(t,e,r){return x(this,t,e,!0,r)},c.prototype.writeFloatBE=function(t,e,r){return x(this,t,e,!1,r)},c.prototype.writeDoubleLE=function(t,e,r){return j(this,t,e,!0,r)},c.prototype.writeDoubleBE=function(t,e,r){return j(this,t,e,!1,r)},c.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var o,i=n-r;if(this===t&&r<e&&e<n)for(o=i-1;o>=0;--o)t[o+e]=this[o+r];else if(i<1e3||!c.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+i),e);return i},c.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var o=t.charCodeAt(0);o<256&&(t=o)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var i;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{var s=c.isBuffer(t)?t:Y(new c(t,n).toString()),a=s.length;for(i=0;i<r-e;++i)this[i+e]=s[i%a]}return this};var L=/[^+\/0-9A-Za-z-_]/g;function M(t){return t<16?"0"+t.toString(16):t.toString(16)}function Y(t,e){var r;e=e||1/0;for(var n=t.length,o=null,i=[],s=0;s<n;++s){if((r=t.charCodeAt(s))>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function G(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(L,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function F(t,e,r,n){for(var o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}}).call(this,r(66))},488:function(t,e){var r="undefined"!=typeof crypto&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&msCrypto.getRandomValues.bind(msCrypto);if(r){var n=new Uint8Array(16);t.exports=function(){return r(n),n}}else{var o=new Array(16);t.exports=function(){for(var t,e=0;e<16;e++)0==(3&e)&&(t=4294967296*Math.random()),o[e]=t>>>((3&e)<<3)&255;return o}}},489:function(t,e){for(var r=[],n=0;n<256;++n)r[n]=(n+256).toString(16).substr(1);t.exports=function(t,e){var n=e||0,o=r;return o[t[n++]]+o[t[n++]]+o[t[n++]]+o[t[n++]]+"-"+o[t[n++]]+o[t[n++]]+"-"+o[t[n++]]+o[t[n++]]+"-"+o[t[n++]]+o[t[n++]]+"-"+o[t[n++]]+o[t[n++]]+o[t[n++]]+o[t[n++]]+o[t[n++]]+o[t[n++]]}},490:function(t,e,r){var n=r(484),o=r(506);t.exports.factory=o,t.exports.SCClientSocket=n,t.exports.Emitter=r(483),t.exports.create=function(t){return o.create(t)},t.exports.connect=t.exports.create,t.exports.destroy=function(t){return o.destroy(t)},t.exports.clients=o.clients,t.exports.version="14.3.1"},491:function(t,e,r){var n=r(492),o=function(t,e,r){n.call(this),this.PENDING="pending",this.SUBSCRIBED="subscribed",this.UNSUBSCRIBED="unsubscribed",this.name=t,this.state=this.UNSUBSCRIBED,this.client=e,this.options=r||{},this.setOptions(this.options)};(o.prototype=Object.create(n.prototype)).setOptions=function(t){t||(t={}),this.waitForAuth=t.waitForAuth||!1,this.batch=t.batch||!1,void 0!==t.data&&(this.data=t.data)},o.prototype.getState=function(){return this.state},o.prototype.subscribe=function(t){this.client.subscribe(this.name,t)},o.prototype.unsubscribe=function(){this.client.unsubscribe(this.name)},o.prototype.isSubscribed=function(t){return this.client.isSubscribed(this.name,t)},o.prototype.publish=function(t,e){this.client.publish(this.name,t,e)},o.prototype.watch=function(t){this.client.watch(this.name,t)},o.prototype.unwatch=function(t){this.client.unwatch(this.name,t)},o.prototype.watchers=function(){return this.client.watchers(this.name)},o.prototype.destroy=function(){this.client.destroyChannel(this.name)},t.exports.SCChannel=o},492:function(t,e,r){function n(t){if(t)return function(t){for(var e in n.prototype)t[e]=n.prototype[e];return t}(t)}t.exports=n,n.prototype.on=n.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},n.prototype.once=function(t,e){function r(){this.off(t,r),e.apply(this,arguments)}return r.fn=e,this.on(t,r),this},n.prototype.off=n.prototype.removeListener=n.prototype.removeAllListeners=n.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,n=this._callbacks["$"+t];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var o=0;o<n.length;o++)if((r=n[o])===e||r.fn===e){n.splice(o,1);break}return this},n.prototype.emit=function(t){this._callbacks=this._callbacks||{};var e=[].slice.call(arguments,1),r=this._callbacks["$"+t];if(r)for(var n=0,o=(r=r.slice(0)).length;n<o;++n)r[n].apply(this,e);return this},n.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},n.prototype.hasListeners=function(t){return!!this.listeners(t).length}},493:function(t,e){t.exports=function(t){var e=[],r=[];return function t(n,o){var i,s,a;if(!("object"!=typeof n||null===n||n instanceof Boolean||n instanceof Date||n instanceof Number||n instanceof RegExp||n instanceof String)){for(i=0;i<e.length;i+=1)if(e[i]===n)return{$ref:r[i]};if(e.push(n),r.push(o),"[object Array]"===Object.prototype.toString.apply(n))for(a=[],i=0;i<n.length;i+=1)a[i]=t(n[i],o+"["+i+"]");else for(s in a={},n)Object.prototype.hasOwnProperty.call(n,s)&&(a[s]=t(n[s],o+"["+JSON.stringify(s)+"]"));return a}return n}(t,"$")}},494:function(t,e,r){(function(e){var r=function(){this._internalStorage={},this.isLocalStorageEnabled=this._checkLocalStorageEnabled()};r.prototype._checkLocalStorageEnabled=function(){var t;try{e.localStorage,e.localStorage.setItem("__scLocalStorageTest",1),e.localStorage.removeItem("__scLocalStorageTest")}catch(e){t=e}return!t},r.prototype.saveToken=function(t,r,n,o){this.isLocalStorageEnabled&&e.localStorage?e.localStorage.setItem(t,r):this._internalStorage[t]=r,o&&o(null,r)},r.prototype.removeToken=function(t,r){var n;this.loadToken(t,(function(t,e){n=e})),this.isLocalStorageEnabled&&e.localStorage?e.localStorage.removeItem(t):delete this._internalStorage[t],r&&r(null,n)},r.prototype.loadToken=function(t,r){r(null,this.isLocalStorageEnabled&&e.localStorage?e.localStorage.getItem(t):this._internalStorage[t]||null)},t.exports.AuthEngine=r}).call(this,r(66))},495:function(t,e,r){(function(e){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=/^[ \n\r\t]*[{\[]/,o=function(t){for(var e=new Uint8Array(t),n=e.length,o="",i=0;i<n;i+=3)o+=r[e[i]>>2],o+=r[(3&e[i])<<4|e[i+1]>>4],o+=r[(15&e[i+1])<<2|e[i+2]>>6],o+=r[63&e[i+2]];return n%3==2?o=o.substring(0,o.length-1)+"=":n%3==1&&(o=o.substring(0,o.length-2)+"=="),o},i=function(t,r){if(e.ArrayBuffer&&r instanceof e.ArrayBuffer)return{base64:!0,data:o(r)};if(e.Buffer){if(r instanceof e.Buffer)return{base64:!0,data:r.toString("base64")};if(r&&"Buffer"===r.type&&Array.isArray(r.data))return{base64:!0,data:(e.Buffer.from?e.Buffer.from(r.data):new e.Buffer(r.data)).toString("base64")}}return r};t.exports.decode=function(t){if(null==t)return null;if("#1"===t||"#2"===t)return t;var e=t.toString();if(!n.test(e))return e;try{return JSON.parse(e)}catch(t){}return e},t.exports.encode=function(t){return"#1"===t||"#2"===t?t:JSON.stringify(t,i)}}).call(this,r(66))},496:function(t,e,r){(function(e){var n,o,i=r(483),s=r(485).Response,a=r(486);e.WebSocket?(n=e.WebSocket,o=function(t,e){return new n(t)}):(n=r(499),o=function(t,e){return new n(t,null,e)});var c=r(482),h=c.TimeoutError,u=c.BadConnectionError,p=function(t,e,r){var n=this;this.state=this.CLOSED,this.auth=t,this.codec=e,this.options=r,this.connectTimeout=r.connectTimeout,this.pingTimeout=r.ackTimeout,this.pingTimeoutDisabled=!!r.pingTimeoutDisabled,this.callIdGenerator=r.callIdGenerator,this.authTokenName=r.authTokenName,this._pingTimeoutTicker=null,this._callbackMap={},this._batchSendList=[],this.state=this.CONNECTING;var i=this.uri(),s=o(i,this.options);s.binaryType=this.options.binaryType,this.socket=s,s.onopen=function(){n._onOpen()},s.onclose=function(t){var e;e=null==t.code?1005:t.code,n._onClose(e,t.reason)},s.onmessage=function(t,e){n._onMessage(t.data)},s.onerror=function(t){n.state===n.CONNECTING&&n._onClose(1006)},this._connectTimeoutRef=setTimeout((function(){n._onClose(4007),n.socket.close(4007)}),this.connectTimeout)};p.prototype=Object.create(i.prototype),p.CONNECTING=p.prototype.CONNECTING="connecting",p.OPEN=p.prototype.OPEN="open",p.CLOSED=p.prototype.CLOSED="closed",p.prototype.uri=function(){var t,e=this.options.query||{},r=this.options.secure?"wss":"ws";if(this.options.timestampRequests&&(e[this.options.timestampParam]=(new Date).getTime()),(e=a.encode(e)).length&&(e="?"+e),this.options.host)t=this.options.host;else{var n="";this.options.port&&("wss"===r&&443!==this.options.port||"ws"===r&&80!==this.options.port)&&(n=":"+this.options.port),t=this.options.hostname+n}return r+"://"+t+this.options.path+e},p.prototype._onOpen=function(){var t=this;clearTimeout(this._connectTimeoutRef),this._resetPingTimeout(),this._handshake((function(e,r){var n;e?(n=r&&r.code?r.code:4003,t._onError(e),t._onClose(n,e.toString()),t.socket.close(n)):(t.state=t.OPEN,i.prototype.emit.call(t,"open",r),t._resetPingTimeout())}))},p.prototype._handshake=function(t){var e=this;this.auth.loadToken(this.authTokenName,(function(r,n){if(r)t(r);else{e.emit("#handshake",{authToken:n},{force:!0},(function(e,r){r&&(r.authToken=n,r.authError&&(r.authError=c.hydrateError(r.authError))),t(e,r)}))}}))},p.prototype._abortAllPendingEventsDueToBadConnection=function(t){for(var e in this._callbackMap)if(this._callbackMap.hasOwnProperty(e)){var r=this._callbackMap[e];delete this._callbackMap[e],clearTimeout(r.timeout),delete r.timeout;var n="Event '"+r.event+"' was aborted due to a bad connection",o=new u(n,t),i=r.callback;delete r.callback,i.call(r,o,r)}},p.prototype._onClose=function(t,e){delete this.socket.onopen,delete this.socket.onclose,delete this.socket.onmessage,delete this.socket.onerror,clearTimeout(this._connectTimeoutRef),clearTimeout(this._pingTimeoutTicker),clearTimeout(this._batchTimeout),this.state===this.OPEN?(this.state=this.CLOSED,i.prototype.emit.call(this,"close",t,e),this._abortAllPendingEventsDueToBadConnection("disconnect")):this.state===this.CONNECTING&&(this.state=this.CLOSED,i.prototype.emit.call(this,"openAbort",t,e),this._abortAllPendingEventsDueToBadConnection("connectAbort"))},p.prototype._handleEventObject=function(t,e){if(t&&null!=t.event){var r=new s(this,t.cid);i.prototype.emit.call(this,"event",t.event,t.data,r)}else if(t&&null!=t.rid){var n=this._callbackMap[t.rid];if(n&&(clearTimeout(n.timeout),delete n.timeout,delete this._callbackMap[t.rid],n.callback)){var o=c.hydrateError(t.error);n.callback(o,t.data)}}else i.prototype.emit.call(this,"event","raw",e)},p.prototype._onMessage=function(t){i.prototype.emit.call(this,"event","message",t);var e=this.decode(t);if("#1"===e)this._resetPingTimeout(),this.socket.readyState===this.socket.OPEN&&this.sendObject("#2");else if(Array.isArray(e))for(var r=e.length,n=0;n<r;n++)this._handleEventObject(e[n],t);else this._handleEventObject(e,t)},p.prototype._onError=function(t){i.prototype.emit.call(this,"error",t)},p.prototype._resetPingTimeout=function(){if(!this.pingTimeoutDisabled){var t=this;(new Date).getTime();clearTimeout(this._pingTimeoutTicker),this._pingTimeoutTicker=setTimeout((function(){t._onClose(4e3),t.socket.close(4e3)}),this.pingTimeout)}},p.prototype.getBytesReceived=function(){return this.socket.bytesReceived},p.prototype.close=function(t,e){if(t=t||1e3,this.state===this.OPEN){var r={code:t,data:e};this.emit("#disconnect",r),this._onClose(t,e),this.socket.close(t)}else this.state===this.CONNECTING&&(this._onClose(t,e),this.socket.close(t))},p.prototype.emitObject=function(t,e){var r={event:t.event,data:t.data};return t.callback&&(r.cid=t.cid=this.callIdGenerator(),this._callbackMap[t.cid]=t),this.sendObject(r,e),t.cid||null},p.prototype._handleEventAckTimeout=function(t){t.cid&&delete this._callbackMap[t.cid],delete t.timeout;var e=t.callback;if(e){delete t.callback;var r=new h("Event response for '"+t.event+"' timed out");e.call(t,r,t)}},p.prototype.emit=function(t,e,r,n){var o,i,s=this;n?(i=r,o=n):r instanceof Function?(i={},o=r):i=r;var a={event:t,data:e,callback:o};o&&!i.noTimeout&&(a.timeout=setTimeout((function(){s._handleEventAckTimeout(a)}),this.options.ackTimeout));var c=null;return(this.state===this.OPEN||i.force)&&(c=this.emitObject(a,i)),c},p.prototype.cancelPendingResponse=function(t){delete this._callbackMap[t]},p.prototype.decode=function(t){return this.codec.decode(t)},p.prototype.encode=function(t){return this.codec.encode(t)},p.prototype.send=function(t){this.socket.readyState!==this.socket.OPEN?this._onClose(1005):this.socket.send(t)},p.prototype.serializeObject=function(t){var e,r;try{e=this.encode(t)}catch(t){r=t,this._onError(r)}return r?null:e},p.prototype.sendObjectBatch=function(t){var e=this;this._batchSendList.push(t),this._batchTimeout||(this._batchTimeout=setTimeout((function(){if(delete e._batchTimeout,e._batchSendList.length){var t=e.serializeObject(e._batchSendList);null!=t&&e.send(t),e._batchSendList=[]}}),this.options.pubSubBatchDuration||0))},p.prototype.sendObjectSingle=function(t){var e=this.serializeObject(t);null!=e&&this.send(e)},p.prototype.sendObject=function(t,e){e&&e.batch?this.sendObjectBatch(t):this.sendObjectSingle(t)},t.exports.SCTransport=p}).call(this,r(66))},497:function(t,e,r){"use strict";function n(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.exports=function(t,e,r,i){e=e||"&",r=r||"=";var s={};if("string"!=typeof t||0===t.length)return s;var a=/\+/g;t=t.split(e);var c=1e3;i&&"number"==typeof i.maxKeys&&(c=i.maxKeys);var h=t.length;c>0&&h>c&&(h=c);for(var u=0;u<h;++u){var p,l,f,d,y=t[u].replace(a,"%20"),g=y.indexOf(r);g>=0?(p=y.substr(0,g),l=y.substr(g+1)):(p=y,l=""),f=decodeURIComponent(p),d=decodeURIComponent(l),n(s,f)?o(s[f])?s[f].push(d):s[f]=[s[f],d]:s[f]=d}return s};var o=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},498:function(t,e,r){"use strict";var n=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};t.exports=function(t,e,r,a){return e=e||"&",r=r||"=",null===t&&(t=void 0),"object"==typeof t?i(s(t),(function(s){var a=encodeURIComponent(n(s))+r;return o(t[s])?i(t[s],(function(t){return a+encodeURIComponent(n(t))})).join(e):a+encodeURIComponent(n(t[s]))})).join(e):a?encodeURIComponent(n(a))+r+encodeURIComponent(n(t)):""};var o=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function i(t,e){if(t.map)return t.map(e);for(var r=[],n=0;n<t.length;n++)r.push(e(t[n],n));return r}var s=Object.keys||function(t){var e=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.push(r);return e}},499:function(t,e){var r,n=(r="undefined"!=typeof WorkerGlobalScope?self:"undefined"!=typeof window&&window||function(){return this}()).WebSocket||r.MozWebSocket;function o(t,e,r){return e?new n(t,e):new n(t)}n&&(o.prototype=n.prototype),t.exports=n?o:null},500:function(t,e,r){"use strict";t.exports=r(501)},501:function(t,e,r){"use strict";var n,o;function i(){if(arguments.length)return i.from(arguments)}function s(){}n="An argument without append, prepend, or detach methods was given to `List",o=i.prototype,i.of=function(){return i.from.call(this,arguments)},i.from=function(t){var e,r,n,o=new this;if(t&&(e=t.length))for(r=-1;++r<e;)null!=(n=t[r])&&o.append(n);return o},o.head=null,o.tail=null,o.toArray=function(){for(var t=this.head,e=[];t;)e.push(t),t=t.next;return e},o.prepend=function(t){if(!t)return!1;if(!t.append||!t.prepend||!t.detach)throw new Error(n+"#prepend`.");var e;return this,(e=this.head)?e.prepend(t):(t.detach(),t.list=this,this.head=t,t)},o.append=function(t){if(!t)return!1;if(!t.append||!t.prepend||!t.detach)throw new Error(n+"#append`.");var e,r;return this,(r=this.tail)?r.append(t):(e=this.head)?e.append(t):(t.detach(),t.list=this,this.head=t,t)},i.Item=s;var a=s.prototype;a.next=null,a.prev=null,a.list=null,a.detach=function(){var t=this.list,e=this.prev,r=this.next;return t?(t.tail===this&&(t.tail=e),t.head===this&&(t.head=r),t.tail===t.head&&(t.tail=null),e&&(e.next=r),r&&(r.prev=e),this.prev=this.next=this.list=null,this):this},a.prepend=function(t){if(!(t&&t.append&&t.prepend&&t.detach))throw new Error(n+"Item#prepend`.");var e=this.list,r=this.prev;return!!e&&(t.detach(),r&&(t.prev=r,r.next=t),t.next=this,t.list=e,this.prev=t,this===e.head&&(e.head=t),e.tail||(e.tail=this),t)},a.append=function(t){if(!(t&&t.append&&t.prepend&&t.detach))throw new Error(n+"Item#append`.");var e=this.list,r=this.next;return!!e&&(t.detach(),r&&(t.next=r,r.prev=t),t.prev=this,t.list=e,this.next=t,this!==e.tail&&e.tail||(e.tail=t),t)},t.exports=i},502:function(t,e,r){"use strict";e.byteLength=function(t){var e=h(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,n=h(t),s=n[0],a=n[1],c=new i(function(t,e,r){return 3*(e+r)/4-r}(0,s,a)),u=0,p=a>0?s-4:s;for(r=0;r<p;r+=4)e=o[t.charCodeAt(r)]<<18|o[t.charCodeAt(r+1)]<<12|o[t.charCodeAt(r+2)]<<6|o[t.charCodeAt(r+3)],c[u++]=e>>16&255,c[u++]=e>>8&255,c[u++]=255&e;2===a&&(e=o[t.charCodeAt(r)]<<2|o[t.charCodeAt(r+1)]>>4,c[u++]=255&e);1===a&&(e=o[t.charCodeAt(r)]<<10|o[t.charCodeAt(r+1)]<<4|o[t.charCodeAt(r+2)]>>2,c[u++]=e>>8&255,c[u++]=255&e);return c},e.fromByteArray=function(t){for(var e,r=t.length,o=r%3,i=[],s=0,a=r-o;s<a;s+=16383)i.push(u(t,s,s+16383>a?a:s+16383));1===o?(e=t[r-1],i.push(n[e>>2]+n[e<<4&63]+"==")):2===o&&(e=(t[r-2]<<8)+t[r-1],i.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return i.join("")};for(var n=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,c=s.length;a<c;++a)n[a]=s[a],o[s.charCodeAt(a)]=a;function h(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function u(t,e,r){for(var o,i,s=[],a=e;a<r;a+=3)o=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),s.push(n[(i=o)>>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return s.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},503:function(t,e){e.read=function(t,e,r,n,o){var i,s,a=8*o-n-1,c=(1<<a)-1,h=c>>1,u=-7,p=r?o-1:0,l=r?-1:1,f=t[e+p];for(p+=l,i=f&(1<<-u)-1,f>>=-u,u+=a;u>0;i=256*i+t[e+p],p+=l,u-=8);for(s=i&(1<<-u)-1,i>>=-u,u+=n;u>0;s=256*s+t[e+p],p+=l,u-=8);if(0===i)i=1-h;else{if(i===c)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,n),i-=h}return(f?-1:1)*s*Math.pow(2,i-n)},e.write=function(t,e,r,n,o,i){var s,a,c,h=8*i-o-1,u=(1<<h)-1,p=u>>1,l=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:i-1,d=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=u):(s=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-s))<1&&(s--,c*=2),(e+=s+p>=1?l/c:l*Math.pow(2,1-p))*c>=2&&(s++,c/=2),s+p>=u?(a=0,s=u):s+p>=1?(a=(e*c-1)*Math.pow(2,o),s+=p):(a=e*Math.pow(2,p-1)*Math.pow(2,o),s=0));o>=8;t[r+f]=255&a,f+=d,a/=256,o-=8);for(s=s<<o|a,h+=o;h>0;t[r+f]=255&s,f+=d,s/=256,h-=8);t[r+f-d]|=128*y}},504:function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},505:function(t,e,r){(function(e){var r=function(){"use strict";function t(t,e){return null!=e&&t instanceof e}var r,n,o;try{r=Map}catch(t){r=function(){}}try{n=Set}catch(t){n=function(){}}try{o=Promise}catch(t){o=function(){}}function i(s,c,h,u,p){"object"==typeof c&&(h=c.depth,u=c.prototype,p=c.includeNonEnumerable,c=c.circular);var l=[],f=[],d=void 0!==e;return void 0===c&&(c=!0),void 0===h&&(h=1/0),function s(h,y){if(null===h)return null;if(0===y)return h;var g,m;if("object"!=typeof h)return h;if(t(h,r))g=new r;else if(t(h,n))g=new n;else if(t(h,o))g=new o((function(t,e){h.then((function(e){t(s(e,y-1))}),(function(t){e(s(t,y-1))}))}));else if(i.__isArray(h))g=[];else if(i.__isRegExp(h))g=new RegExp(h.source,a(h)),h.lastIndex&&(g.lastIndex=h.lastIndex);else if(i.__isDate(h))g=new Date(h.getTime());else{if(d&&e.isBuffer(h))return g=new e(h.length),h.copy(g),g;t(h,Error)?g=Object.create(h):void 0===u?(m=Object.getPrototypeOf(h),g=Object.create(m)):(g=Object.create(u),m=u)}if(c){var b=l.indexOf(h);if(-1!=b)return f[b];l.push(h),f.push(g)}for(var v in t(h,r)&&h.forEach((function(t,e){var r=s(e,y-1),n=s(t,y-1);g.set(r,n)})),t(h,n)&&h.forEach((function(t){var e=s(t,y-1);g.add(e)})),h){var E;m&&(E=Object.getOwnPropertyDescriptor(m,v)),E&&null==E.set||(g[v]=s(h[v],y-1))}if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(h);for(v=0;v<T.length;v++){var S=T[v];(!(k=Object.getOwnPropertyDescriptor(h,S))||k.enumerable||p)&&(g[S]=s(h[S],y-1),k.enumerable||Object.defineProperty(g,S,{enumerable:!1}))}}if(p){var w=Object.getOwnPropertyNames(h);for(v=0;v<w.length;v++){var k,_=w[v];(k=Object.getOwnPropertyDescriptor(h,_))&&k.enumerable||(g[_]=s(h[_],y-1),Object.defineProperty(g,_,{enumerable:!1}))}}return g}(s,h)}function s(t){return Object.prototype.toString.call(t)}function a(t){var e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),e}return i.clonePrototype=function(t){if(null===t)return null;var e=function(){};return e.prototype=t,new e},i.__objToStr=s,i.__isDate=function(t){return"object"==typeof t&&"[object Date]"===s(t)},i.__isArray=function(t){return"object"==typeof t&&"[object Array]"===s(t)},i.__isRegExp=function(t){return"object"==typeof t&&"[object RegExp]"===s(t)},i.__getRegExpFlags=a,i}();t.exports&&(t.exports=r)}).call(this,r(487).Buffer)},506:function(t,e,r){(function(e){var n=r(484),o=r(482),i=r(507),s=o.InvalidArgumentsError,a={};function c(t,r){var n=null==t.secure?r:t.secure;return t.port||(e.location&&location.port?location.port:n?443:80)}t.exports={create:function(t){if((t=t||{}).host&&!t.host.match(/[^:]+:\d{2,5}/))throw new s('The host option should include both the hostname and the port number in the format "hostname:port"');if(t.host&&t.hostname)throw new s('The host option should already include the hostname and the port number in the format "hostname:port" - Because of this, you should never use host and hostname options together');if(t.host&&t.port)throw new s('The host option should already include the hostname and the port number in the format "hostname:port" - Because of this, you should never use host and port options together');var r=e.location&&"https:"===location.protocol,o={port:c(t,r),hostname:e.location&&location.hostname||"localhost",path:"/socketcluster/",secure:r,autoConnect:!0,autoReconnect:!0,autoSubscribeOnConnect:!0,connectTimeout:2e4,ackTimeout:1e4,timestampRequests:!1,timestampParam:"t",authEngine:null,authTokenName:"socketCluster.authToken",binaryType:"arraybuffer",multiplex:!0,pubSubBatchDuration:null,cloneData:!1};for(var h in t)t.hasOwnProperty(h)&&(o[h]=t[h]);if(o.clientMap=a,!1===o.multiplex){o.clientId=i.v4();var u=new n(o);return a[o.clientId]=u,u}return o.clientId=function(t){var e=t.secure?"https://":"http://",r="";if(t.query)if("string"==typeof t.query)r=t.query;else{var n=[],o=t.query;for(var i in o)o.hasOwnProperty(i)&&n.push(i+"="+o[i]);n.length&&(r="?"+n.join("&"))}return e+(t.host?t.host:t.hostname+":"+t.port)+t.path+r}(o),a[o.clientId]?o.autoConnect&&a[o.clientId].connect():a[o.clientId]=new n(o),a[o.clientId]},destroy:function(t){t.destroy()},clients:a}}).call(this,r(66))},507:function(t,e,r){var n=r(508),o=r(509),i=o;i.v1=n,i.v4=o,t.exports=i},508:function(t,e,r){var n,o,i=r(488),s=r(489),a=0,c=0;t.exports=function(t,e,r){var h=e&&r||0,u=e||[],p=(t=t||{}).node||n,l=void 0!==t.clockseq?t.clockseq:o;if(null==p||null==l){var f=i();null==p&&(p=n=[1|f[0],f[1],f[2],f[3],f[4],f[5]]),null==l&&(l=o=16383&(f[6]<<8|f[7]
    ... [truncated]
    
  • lhc_web/design/defaulttheme/js/widgetv2/1.76e60b1aab09f2ea2bea.ie.js.map+0 1 removed
  • lhc_web/design/defaulttheme/js/widgetv2/2.90658096bc82c95d6b4b.ie.js+0 2 removed
    @@ -1,2 +0,0 @@
    -(window.webpackJsonpLHCReactAPP=window.webpackJsonpLHCReactAPP||[]).push([[2],{513:function(e,t,a){"use strict";a.r(t);var n=a(6),l=a.n(n),c=a(7),o=a.n(c),s=a(9),i=a.n(s),r=a(10),m=a.n(r),d=a(3),u=a.n(d),p=a(11),h=a.n(p),b=a(12),f=a.n(b),g=a(0),E=a.n(g),v=(a(20),a(25)),N=function(e){function t(e){var a;return l()(this,t),a=i()(this,m()(t).call(this,e)),f()(u()(a),"state",{mail:null,success:"",errors:null,sending:!1}),f()(u()(a),"dismissModal",(function(){a.props.toggle()})),a.changeFont=a.changeFont.bind(u()(a)),a.emailRef=E.a.createRef(),a}return h()(t,e),o()(t,[{key:"changeFont",value:function(e){this.props.changeFont(e)}},{key:"componentDidMount",value:function(){}},{key:"render",value:function(){var e=this;this.props.t;return E.a.createElement(E.a.Fragment,null,E.a.createElement("div",{role:"dialog",id:"dialog-content","aria-modal":"true",className:"fade modal show d-block p-1 pt-0 pb-0",tabIndex:"-1",style:{top:"auto",bottom:"0",height:"auto"}},E.a.createElement("div",{className:"modal-content radius-0 border-0"},E.a.createElement("div",{className:"modal-body pl-2 pr-2 pt-0 pb-0"},E.a.createElement("div",{className:"mb-0"},E.a.createElement("div",{className:"row"},E.a.createElement("div",{className:"col-5 mr-0 pr-1 text-center"},E.a.createElement("a",{href:"#",onClick:function(){return e.changeFont(!1)},className:"d-block font-weight-bold font-button"},"-",E.a.createElement("i",{className:"material-icons chat-setting-item"},""))),E.a.createElement("div",{className:"col-5 ml-0 pl-1 pr-1 text-center"},E.a.createElement("a",{href:"#",onClick:function(){return e.changeFont(!0)},className:"d-block font-weight-bold font-button"},"+",E.a.createElement("i",{className:"material-icons chat-setting-item"},""))),E.a.createElement("div",{className:"col-2 pl-1"},E.a.createElement("button",{type:"button",className:"close w-100 text-success","data-dismiss":"modal",onClick:this.dismissModal,"aria-label":"Close"},E.a.createElement("span",{"aria-hidden":"true"},"✓")))))))))}}]),t}(g.PureComponent);t.default=Object(v.b)()(N)}}]);
    -//# sourceMappingURL=2.90658096bc82c95d6b4b.ie.js.map
    \ No newline at end of file
    
  • lhc_web/design/defaulttheme/js/widgetv2/2.90658096bc82c95d6b4b.ie.js.map+0 1 removed
    @@ -1 +0,0 @@
    -{"version":3,"sources":["webpack://LHCReactAPP/./src/components/FontSizeModal.js"],"names":["FontSizeModal","props","mail","success","errors","sending","toggle","changeFont","bind","emailRef","React","createRef","increase","this","t","Fragment","role","id","aria-modal","className","tabIndex","style","top","bottom","height","href","onClick","type","data-dismiss","dismissModal","aria-label","aria-hidden","PureComponent","withTranslation"],"mappings":"8QAIMA,E,YASF,WAAYC,GAAO,yBACf,4BAAMA,IADS,mBAPX,CACJC,KAAM,KACNC,QAAS,GACTC,OAAQ,KACRC,SAAS,IAGM,2BAcJ,WACX,EAAKJ,MAAMK,YAbX,EAAKC,WAAa,EAAKA,WAAWC,KAAhB,QAClB,EAAKC,SAAWC,IAAMC,YAHP,E,wDAMRC,GACPC,KAAKZ,MAAMM,WAAWK,K,4EAYjB,WACSC,KAAKZ,MAAXa,EAQR,OAEO,kBAAC,IAAMC,SAAP,KACK,yBAAKC,KAAK,SAASC,GAAG,iBAAiBC,aAAW,OAAOC,UAAU,wCAAwCC,SAAS,KAAKC,MATvH,CACVC,IAAK,OACLC,OAAQ,IACRC,OAAQ,SAOI,yBAAKL,UAAU,mCACX,yBAAKA,UAAU,kCACX,yBAAKA,UAAU,QACX,yBAAKA,UAAU,OACX,yBAAKA,UAAU,+BACX,uBAAGM,KAAK,IAAIC,QAAS,kBAAM,EAAKnB,YAAW,IAAQY,UAAU,wCAA7D,IACK,uBAAGA,UAAU,oCAAb,OAGT,yBAAKA,UAAU,oCACX,uBAAGM,KAAK,IAAIC,QAAS,kBAAM,EAAKnB,YAAW,IAAOY,UAAU,wCAA5D,IAAoG,uBAAGA,UAAU,oCAAb,OAGxG,yBAAKA,UAAU,cACX,4BAAQQ,KAAK,SAASR,UAAU,2BAA2BS,eAAa,QAAQF,QAASb,KAAKgB,aAAcC,aAAW,SAAQ,0BAAMC,cAAY,QAAlB,iB,GAvD/IC,iBAqEbC,wBAAkBjC","file":"2.90658096bc82c95d6b4b.ie.js","sourcesContent":["import React, { PureComponent } from 'react';\nimport axios from \"axios\";\nimport { withTranslation } from 'react-i18next';\n\nclass FontSizeModal extends PureComponent {\n\n    state = {\n        mail: null,\n        success: '',\n        errors: null,\n        sending: false\n    };\n\n    constructor(props) {\n        super(props);\n        this.changeFont = this.changeFont.bind(this);\n        this.emailRef = React.createRef();\n    }\n\n    changeFont(increase) {\n        this.props.changeFont(increase);\n    }\n\n    componentDidMount() {\n\n    }\n\n    dismissModal = () => {\n        this.props.toggle()\n    }\n\n\n    render() {\n        const { t } = this.props;\n\n        const style = {\n            top: 'auto',\n            bottom: '0',\n            height: 'auto'\n        };\n\n        return (\n\n               <React.Fragment>\n                    <div role=\"dialog\" id=\"dialog-content\" aria-modal=\"true\" className=\"fade modal show d-block p-1 pt-0 pb-0\" tabIndex=\"-1\" style={style}>\n                        <div className=\"modal-content radius-0 border-0\">\n                            <div className=\"modal-body pl-2 pr-2 pt-0 pb-0\">\n                                <div className=\"mb-0\">\n                                    <div className=\"row\">\n                                        <div className=\"col-5 mr-0 pr-1 text-center\">\n                                            <a href=\"#\" onClick={() => this.changeFont(false)} className=\"d-block font-weight-bold font-button\">\n                                                -<i className=\"material-icons chat-setting-item\">&#xf11d;</i>\n                                            </a>\n                                        </div>\n                                        <div className=\"col-5 ml-0 pl-1 pr-1 text-center\">\n                                            <a href=\"#\" onClick={() => this.changeFont(true)} className=\"d-block font-weight-bold font-button\">+<i className=\"material-icons chat-setting-item\">&#xf11d;</i>\n                                            </a>\n                                        </div>\n                                        <div className=\"col-2 pl-1\">\n                                            <button type=\"button\" className=\"close w-100 text-success\" data-dismiss=\"modal\" onClick={this.dismissModal} aria-label=\"Close\"><span aria-hidden=\"true\">&#x2713;</span></button>\n                                        </div>\n                                    </div>\n                                </div>\n                            </div>\n                        </div>\n                    </div>\n\n                </React.Fragment>\n\n        )\n    }\n}\n\nexport default withTranslation()(FontSizeModal);\n"],"sourceRoot":""}
    \ No newline at end of file
    
  • lhc_web/design/defaulttheme/js/widgetv2/3.ebd2630847bc8173025f.ie.js+0 2 removed
    @@ -1,2 +0,0 @@
    -(window.webpackJsonpLHCReactAPP=window.webpackJsonpLHCReactAPP||[]).push([[3],{512:function(e,t,a){"use strict";a.r(t);var n=a(6),s=a.n(n),l=a(7),i=a.n(l),r=a(9),o=a.n(r),c=a(10),m=a.n(c),d=a(3),u=a.n(d),h=a(11),p=a.n(h),b=a(12),f=a.n(b),g=a(0),v=a.n(g),E=a(20),w=a.n(E),N=a(25),y=function(e){function t(e){var a;return s()(this,t),a=o()(this,m()(t).call(this,e)),f()(u()(a),"state",{mail:null,success:"",errors:null,sending:!1}),f()(u()(a),"dismissModal",(function(){a.props.toggle()})),a.sendMail=a.sendMail.bind(u()(a)),a.emailRef=v.a.createRef(),a}return p()(t,e),i()(t,[{key:"sendMail",value:function(e){var t=this;this.setState({sending:!0}),w.a.post(window.lhcChat.base_url+"widgetrestapi/sendmailsettings/"+this.props.chatId+"/"+this.props.chatHash+"/(action)/send",{email:this.state.mail},{headers:{"Content-Type":"application/x-www-form-urlencoded"}}).then((function(e){0==e.data.error?t.props.toggle():(t.setState({sending:!1}),t.setState({errors:e.data.result}))})),e&&e.preventDefault()}},{key:"componentDidMount",value:function(){var e=this;w.a.get(window.lhcChat.base_url+"widgetrestapi/sendmailsettings/"+this.props.chatId+"/"+this.props.chatHash).then((function(t){e.setState({mail:t.data}),e.emailRef.current&&e.emailRef.current.focus()})).catch((function(e){console.log(e)}))}},{key:"render",value:function(){var e=this,t=this.props.t;return v.a.createElement(v.a.Fragment,null,null!==this.state.mail&&v.a.createElement(v.a.Fragment,null,v.a.createElement("div",{className:"fade modal-backdrop show"}),v.a.createElement("div",{role:"dialog",id:"dialog-content","aria-modal":"true",className:"fade modal show d-block",tabIndex:"-1"},v.a.createElement("div",{className:"modal-dialog modal-lg"},v.a.createElement("div",{className:"modal-content"},v.a.createElement("div",{className:"modal-header pt-1 pb-1 pl-2 pr-2"}," ",v.a.createElement("h4",{className:"modal-title",id:"myModalLabel"},v.a.createElement("span",{className:"material-icons"},""),t("button.mail")),v.a.createElement("button",{type:"button",className:"close float-right","data-dismiss":"modal",onClick:this.dismissModal,"aria-label":"Close"},v.a.createElement("span",{"aria-hidden":"true"},"×"))),v.a.createElement("div",{className:"modal-body"},v.a.createElement("div",{className:"row"},v.a.createElement("div",{className:"col-12"},this.state.errors&&v.a.createElement("div",{className:"mb-0",dangerouslySetInnerHTML:{__html:this.state.errors}}),v.a.createElement("div",{className:"mb-0"},v.a.createElement("form",{onSubmit:this.sendMail},v.a.createElement("input",{className:"form-control form-group form-control-sm",ref:this.emailRef,required:"required",type:"email",defaultValue:this.state.mail,onChange:function(t){return e.setState({mail:t.target.value})},placeholder:t("chat.enter_email"),title:t("chat.enter_email")}),v.a.createElement("div",{className:"btn-group",role:"group","aria-label":"..."},v.a.createElement("button",{type:"submit",disabled:this.state.sending,className:"btn btn-secondary btn-sm"},t("button.send")),v.a.createElement("button",{type:"button",className:"btn btn-secondary btn-sm",onClick:this.dismissModal},t("button.cancel")))))))))))))}}]),t}(g.PureComponent);t.default=Object(N.b)()(y)}}]);
    -//# sourceMappingURL=3.ebd2630847bc8173025f.ie.js.map
    \ No newline at end of file
    
  • lhc_web/design/defaulttheme/js/widgetv2/3.ebd2630847bc8173025f.ie.js.map+0 1 removed
    @@ -1 +0,0 @@
    -{"version":3,"sources":["webpack://LHCReactAPP/./src/components/MailModal.js"],"names":["MailModal","props","mail","success","errors","sending","toggle","sendMail","bind","emailRef","React","createRef","event","this","setState","axios","post","window","lhcChat","chatId","chatHash","email","state","headers","then","response","data","error","result","preventDefault","get","current","focus","err","console","log","t","Fragment","className","role","id","aria-modal","tabIndex","type","data-dismiss","onClick","dismissModal","aria-label","aria-hidden","dangerouslySetInnerHTML","__html","onSubmit","ref","required","defaultValue","onChange","e","target","value","placeholder","title","disabled","PureComponent","withTranslation"],"mappings":"uRAIMA,E,YASF,WAAYC,GAAO,yBACf,4BAAMA,IADS,mBAPX,CACJC,KAAM,KACNC,QAAS,GACTC,OAAQ,KACRC,SAAS,IAGM,2BAoCJ,WACX,EAAKJ,MAAMK,YAnCX,EAAKC,SAAW,EAAKA,SAASC,KAAd,QAChB,EAAKC,SAAWC,IAAMC,YAHP,E,sDAMVC,GAAO,WAEZC,KAAKC,SAAS,CAAC,SAAY,IAE3BC,IAAMC,KAAKC,OAAOC,QAAP,SAA6B,kCAAoCL,KAAKZ,MAAMkB,OAAS,IAAMN,KAAKZ,MAAMmB,SAAW,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KvC,KAAKJ,SAAU4C,SAAS,WAAWV,KAAK,QAAQW,aAAczC,KAAKS,MAAMpB,KAAMqD,SAAU,SAACC,GAAD,OAAO,EAAK1C,SAAS,CAAC,KAAS0C,EAAEC,OAAOC,SAASC,YAAavB,EAAE,oBAAqBwB,MAAOxB,EAAE,sBACvP,yBAAKE,UAAU,YAAYC,KAAK,QAAQQ,aAAW,OAC/C,4BAAQJ,KAAK,SAASkB,SAAUhD,KAAKS,MAAMjB,QAASiC,UAAU,4BAA4BF,EAAE,gBAC5F,4BAAQO,KAAK,SAASL,UAAU,2BAA2BO,QAAShC,KAAKiC,cAAeV,EAAE,iC,GAvEtH0B,iBAuFTC,wBAAkB/D","file":"3.ebd2630847bc8173025f.ie.js","sourcesContent":["import React, { PureComponent } from 'react';\nimport axios from \"axios\";\nimport { withTranslation } from 'react-i18next';\n\nclass MailModal extends PureComponent {\n\n    state = {\n        mail: null,\n        success: '',\n        errors: null,\n        sending: false\n    };\n\n    constructor(props) {\n        super(props);\n        this.sendMail = this.sendMail.bind(this);\n        this.emailRef = React.createRef();\n    }\n\n    sendMail(event) {\n\n        this.setState({'sending' : true});\n\n        axios.post(window.lhcChat['base_url'] + \"widgetrestapi/sendmailsettings/\" + this.props.chatId + '/' + this.props.chatHash + '/(action)/send', {email:this.state.mail}, {headers : {'Content-Type': 'application/x-www-form-urlencoded'}}).then((response) => {\n            if (response.data.error == false) {\n                this.props.toggle();\n            } else {\n                this.setState({'sending' : false});\n                this.setState({'errors' : response.data.result});\n            }\n        });\n\n        if (event)\n            event.preventDefault();\n    }\n\n    componentDidMount() {\n        axios.get(window.lhcChat['base_url'] + 'widgetrestapi/sendmailsettings/' + this.props.chatId + '/' + this.props.chatHash)\n        .then((response) => {\n            this.setState({'mail' : response.data});\n            if (this.emailRef.current) {\n                this.emailRef.current.focus();\n            }\n        })\n        .catch((err) => {\n            console.log(err);\n        });\n    }\n\n    dismissModal = () => {\n        this.props.toggle()\n    }\n\n    render() {\n        const { t } = this.props;\n\n        return (\n            <React.Fragment>\n                {this.state.mail !== null && <React.Fragment>\n                <div className=\"fade modal-backdrop show\"></div>\n                <div role=\"dialog\" id=\"dialog-content\" aria-modal=\"true\" className=\"fade modal show d-block\" tabIndex=\"-1\">\n                    <div className=\"modal-dialog modal-lg\">\n                        <div className=\"modal-content\">\n                            <div className=\"modal-header pt-1 pb-1 pl-2 pr-2\"> <h4 className=\"modal-title\" id=\"myModalLabel\"><span className=\"material-icons\">&#xf11a;</span>{t('button.mail')}</h4>\n                                <button type=\"button\" className=\"close float-right\" data-dismiss=\"modal\" onClick={this.dismissModal} aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button>\n                            </div>\n                            <div className=\"modal-body\">\n                                <div className=\"row\">\n                                    <div className=\"col-12\">\n                                        {this.state.errors && <div className=\"mb-0\" dangerouslySetInnerHTML={{__html:this.state.errors}}></div>}\n                                        <div className=\"mb-0\">\n                                            <form onSubmit={this.sendMail}>\n                                                <input className=\"form-control form-group form-control-sm\" ref={this.emailRef} required=\"required\" type=\"email\" defaultValue={this.state.mail} onChange={(e) => this.setState({'mail' : e.target.value})} placeholder={t('chat.enter_email')} title={t('chat.enter_email')} />\n                                                <div className=\"btn-group\" role=\"group\" aria-label=\"...\">\n                                                    <button type=\"submit\" disabled={this.state.sending} className=\"btn btn-secondary btn-sm\">{t('button.send')}</button>\n                                                    <button type=\"button\" className=\"btn btn-secondary btn-sm\" onClick={this.dismissModal}>{t('button.cancel')}</button>\n                                                </div>\n                                            </form>\n                                        </div>\n                                    </div>\n                                </div>\n                            </div>\n                        </div>\n                    </div>\n               </div>\n               </React.Fragment>}\n            </React.Fragment>\n        )\n    }\n}\n\nexport default withTranslation()(MailModal);\n"],"sourceRoot":""}
    \ No newline at end of file
    
  • lhc_web/design/defaulttheme/js/widgetv2/4.80f011fffa0f91545942.ie.js+0 2 removed
    @@ -1,2 +0,0 @@
    -(window.webpackJsonpLHCReactAPP=window.webpackJsonpLHCReactAPP||[]).push([[4],{510:function(t,e,a){"use strict";a.r(e);var i,n=a(12),s=a.n(n),r=a(6),o=a.n(r),p=a(7),h=a.n(p),c=a(9),d=a.n(c),l=a(10),g=a.n(l),f=a(3),u=a.n(f),m=a(11),w=a.n(m),_=a(0),b=a.n(_),v=a(24),I=a(140),y=(a(199),a(25)),C=a(5),E=a(2),D=a(195);function O(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,i)}return a}var S=Object(v.b)((function(t){return{chatwidget:t.chatwidget}}))(i=function(t){function e(t){var a;return o()(this,e),(a=d()(this,g()(e).call(this,t))).state={},a.initOfflineFormCall(),a.handleSubmit=a.handleSubmit.bind(u()(a)),a.handleContentChange=a.handleContentChange.bind(u()(a)),a.handleContentChangeCustom=a.handleContentChangeCustom.bind(u()(a)),a.goToChat=a.goToChat.bind(u()(a)),a}return w()(e,t),h()(e,[{key:"initOfflineFormCall",value:function(t){this.props.dispatch(Object(C.h)({department:this.props.chatwidget.get("department"),theme:this.props.chatwidget.get("theme"),mode:this.props.chatwidget.get("mode"),bot_id:this.props.chatwidget.get("bot_id"),trigger_id:this.props.chatwidget.get("trigger_id"),online:0,dep_default:t||this.props.chatwidget.get("departmentDefault")||0}))}},{key:"handleSubmit",value:function(t){var e=this.state,a=!1,i=new FormData;void 0!==e.File&&(a=!0,i.append("File",e.File,e.File.name)),e.jsvar=this.props.chatwidget.get("jsVars"),e["captcha_"+this.props.chatwidget.getIn(["captcha","hash"])]=this.props.chatwidget.getIn(["captcha","ts"]),e.tscaptcha=this.props.chatwidget.getIn(["captcha","ts"]),e.user_timezone=E.a.getTimeZone(),e.URLRefer=window.location.href.substring(window.location.protocol.length),e.r=this.props.chatwidget.get("ses_ref"),""!=this.props.chatwidget.get("operator")&&(e.operator=this.props.chatwidget.get("operator")),null!==this.props.chatwidget.get("priority")&&(e.priority=this.props.chatwidget.get("priority"));var n=E.a.getCustomFieldsSubmit(this.props.chatwidget.getIn(["customData","fields"]));null!==n&&(e=function(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?O(Object(a),!0).forEach((function(e){s()(t,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):O(Object(a)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))}))}return t}({},e,{},n));var r={department:this.props.chatwidget.get("department"),theme:this.props.chatwidget.get("theme"),mode:this.props.chatwidget.get("mode"),vid:this.props.chatwidget.get("vid"),fields:e};a&&i.append("document",JSON.stringify(r)),this.props.dispatch(Object(C.o)(a?i:r)),t.preventDefault()}},{key:"handleContentChange",value:function(t){var e=this,a=this.state;a[t.id]=t.value,this.setState(a),"DepartamentID"==t.id&&this.props.chatwidget.getIn(["offlineData","department","departments"]).size>0&&this.props.chatwidget.getIn(["offlineData","department","departments"]).map((function(a){a.get("value")==t.value&&(1==a.get("online")&&(e.props.dispatch({type:"dep_default",data:t.value}),e.props.dispatch({type:"onlineStatus",data:!0})),e.props.chatwidget.getIn(["onlineData","dep_forms"])!=t.value&&e.initOfflineFormCall(t.value))}))}},{key:"componentDidMount",value:function(){E.a.prefillFields(this)}},{key:"handleContentChangeCustom",value:function(t){this.props.dispatch({type:"CUSTOM_FIELDS_ITEM",data:{id:t.field.get("index"),value:t.value}})}},{key:"goToChat",value:function(){this.props.dispatch({type:"attr_set",attr:["isOfflineMode"],data:!1})}},{key:"componentDidUpdate",value:function(t,e,a){if(document.getElementById("id-container-fluid")){var i=0;document.getElementById("widget-header-content")&&(i=document.getElementById("widget-header-content").offsetHeight),E.a.sendMessageParent("widgetHeight",[{height:document.getElementById("id-container-fluid").offsetHeight+i+10}])}}},{key:"render",value:function(){var t=this,e=this.props.t;if(!0===this.props.chatwidget.getIn(["offlineData","fetched"])&&!0===this.props.chatwidget.getIn(["offlineData","disabled"]))return b.a.createElement("div",{className:"alert alert-danger m-2",role:"alert"},e("start_chat.cant_start_a_chat"));if(!1===this.props.chatwidget.getIn(["offlineData","fetched"]))return null;if(this.props.chatwidget.getIn(["offlineData","fields"]).size>0)var a=this.props.chatwidget.getIn(["offlineData","fields"]).map((function(e){return b.a.createElement(I.a,{chatUI:t.props.chatwidget.get("chat_ui"),isInvalid:t.props.chatwidget.hasIn(["validationErrors",e.get("identifier")]),attrPrefill:{attr_prefill_admin:t.props.chatwidget.get("attr_prefill_admin"),attr_prefill:t.props.chatwidget.get("attr_prefill")},defaultValueField:t.state[e.get("name")]||e.get("value"),onChangeContent:t.handleContentChange,field:e})}));else a="";if(this.props.chatwidget.getIn(["customData","fields"]).size>0)var i=this.props.chatwidget.getIn(["customData","fields"]).map((function(e){return b.a.createElement(I.a,{chatUI:t.props.chatwidget.get("chat_ui"),key:e.get("identifier"),isInvalid:t.props.chatwidget.hasIn(["validationErrors",e.get("identifier")]),defaultValueField:e.get("value"),onChangeContent:t.handleContentChangeCustom,field:e})}));else i="";return 0==this.props.chatwidget.get("processStatus")||1==this.props.chatwidget.get("processStatus")?b.a.createElement("div",{id:"id-container-fluid"},this.props.chatwidget.get("leave_message")&&this.props.chatwidget.hasIn(["chat_ui","operator_profile"])&&""!=this.props.chatwidget.getIn(["chat_ui","operator_profile"])&&b.a.createElement("div",{className:"py-2 px-3 offline-intro-operator",dangerouslySetInnerHTML:{__html:this.props.chatwidget.getIn(["chat_ui","operator_profile"])}}),this.props.chatwidget.get("leave_message")&&this.props.chatwidget.hasIn(["chat_ui","offline_intro"])&&""!=this.props.chatwidget.getIn(["chat_ui","offline_intro"])&&b.a.createElement("p",{className:"pb-1 mb-0 pt-2 px-3 font-weight-bold offline-intro",dangerouslySetInnerHTML:{__html:this.props.chatwidget.getIn(["chat_ui","offline_intro"])}}),!this.props.chatwidget.get("leave_message")&&b.a.createElement("p",{className:"pb-1 mb-0 pt-2 px-3 font-weight-bold offline-intro"},this.props.chatwidget.getIn(["chat_ui","chat_unavailable"])),this.props.chatwidget.get("leave_message")&&b.a.createElement("div",{className:"container-fluid"},b.a.createElement("form",{onSubmit:this.handleSubmit,className:"offline-form"},b.a.createElement("div",{className:"row pt-2"},a,i,this.props.chatwidget.hasIn(["offlineData","department"])&&b.a.createElement(D.a,{defaultValueField:this.state.DepartamentID,setDefaultValue:this.props.chatwidget.get("departmentDefault"),onChangeContent:this.handleContentChange,isInvalid:this.props.chatwidget.hasIn(["validationErrors","department"]),departments:this.props.chatwidget.getIn(["offlineData","department"])})),(!this.props.chatwidget.hasIn(["chat_ui","hstr_btn"])||""!==i||""!==a)&&b.a.createElement("div",{className:"row"},b.a.createElement("div",{className:"col-12 pb-2"},b.a.createElement("button",{type:"submit",disabled:1==this.props.chatwidget.get("processStatus"),className:"btn btn-secondary btn-sm"},1==this.props.chatwidget.get("processStatus")&&b.a.createElement("i",{className:"material-icons"},""),this.props.chatwidget.getIn(["chat_ui","custom_start_button"])||e("start_chat.leave_a_message")),!0===this.props.chatwidget.get("isOnline")&&!0===this.props.chatwidget.get("isOfflineMode")&&b.a.createElement("button",{type:"button",onClick:this.goToChat,className:"float-right btn btn-sm btn-link text-muted"},"« ",e("button.back_to_chat"))))))):2==this.props.chatwidget.get("processStatus")?b.a.createElement("div",{id:"id-container-fluid"},this.props.chatwidget.hasIn(["chat_ui","operator_profile"])&&""!=this.props.chatwidget.getIn(["chat_ui","operator_profile"])&&b.a.createElement("div",{className:"py-2 px-3 offline-intro-operator",dangerouslySetInnerHTML:{__html:this.props.chatwidget.getIn(["chat_ui","operator_profile"])}}),this.props.chatwidget.hasIn(["chat_ui","offline_intro"])&&""!=this.props.chatwidget.getIn(["chat_ui","offline_intro"])&&b.a.createElement("p",{className:"pb-1 mb-0 pt-2 px-3 font-weight-bold offline-intro",dangerouslySetInnerHTML:{__html:this.props.chatwidget.getIn(["chat_ui","offline_intro"])}}),b.a.createElement("div",{className:"container-fluid"},b.a.createElement("div",{className:"row"},b.a.createElement("div",{className:"col-12"},b.a.createElement("p",{className:"pt-2"},this.props.chatwidget.getIn(["chat_ui","thank_feedback"])||e("start_chat.thank_you_for_feedback")))))):void 0}}]),e}(_.Component))||i;e.default=Object(y.b)()(S)}}]);
    -//# sourceMappingURL=4.80f011fffa0f91545942.ie.js.map
    \ No newline at end of file
    
  • lhc_web/design/defaulttheme/js/widgetv2/4.80f011fffa0f91545942.ie.js.map+0 1 removed
    @@ -1 +0,0 @@
    -{"version":3,"sources":["webpack://LHCReactAPP/./src/components/OfflineChat.js"],"names":["OfflineChat","connect","store","chatwidget","props","state","initOfflineFormCall","handleSubmit","bind","handleContentChange","handleContentChangeCustom","goToChat","dep_default","this","dispatch","initOfflineForm","get","event","fields","hasFile","formData","FormData","append","name","getIn","helperFunctions","getTimeZone","window","location","href","substring","protocol","length","customFields","getCustomFieldsSubmit","submitData","JSON","stringify","submitOfflineForm","preventDefault","obj","currentState","id","value","setState","size","map","dep","data","prefillFields","field","type","attr","prevProps","prevState","snapshot","document","getElementById","headerContent","offsetHeight","sendMessageParent","t","className","role","mappedFields","chatUI","isInvalid","hasIn","attrPrefill","defaultValueField","onChangeContent","mappedFieldsCustom","key","dangerouslySetInnerHTML","__html","onSubmit","setDefaultValue","departments","disabled","onClick","Component","withTranslation"],"mappings":"2hBAeMA,EANLC,aAAQ,SAACC,GACN,MAAO,CACHC,WAAYD,EAAMC,c,eAMtB,WAAYC,GAAO,0BACf,4BAAMA,KAEDC,MAAQ,GAEb,EAAKC,sBAEL,EAAKC,aAAe,EAAKA,aAAaC,KAAlB,QACpB,EAAKC,oBAAsB,EAAKA,oBAAoBD,KAAzB,QAC3B,EAAKE,0BAA4B,EAAKA,0BAA0BF,KAA/B,QACjC,EAAKG,SAAW,EAAKA,SAASH,KAAd,QAVD,E,iEAaCI,GAEhBC,KAAKT,MAAMU,SAASC,YAAgB,CAChC,WAAaF,KAAKT,MAAMD,WAAWa,IAAI,cACvC,MAAUH,KAAKT,MAAMD,WAAWa,IAAI,SACpC,KAASH,KAAKT,MAAMD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wD,GAA9CjE,KAAKT,MAAMD,WAAWa,IAAI,iBAAuB8C,UAAU,4BAA0E,GAA9CjD,KAAKT,MAAMD,WAAWa,IAAI,kBAAyB,uBAAG8C,UAAU,kBAAb,KAA4CjD,KAAKT,MAAMD,WAAWqB,MAAM,CAAC,UAAU,yBAA2BqC,EAAE,gCAC/O,IAA1ChD,KAAKT,MAAMD,WAAWa,IAAI,cAAuE,IAA/CH,KAAKT,MAAMD,WAAWa,IAAI,kBAA6B,4BAAQmC,KAAK,SAAS4B,QAASlE,KAAKF,SAAUmD,UAAU,8CAAxD,KAA8GD,EAAE,6BAS7L,GAA9ChD,KAAKT,MAAMD,WAAWa,IAAI,iBAE7B,yBAAK0B,GAAG,sBAEP7B,KAAKT,MAAMD,WAAWgE,MAAM,CAAC,UAAU,sBAAuF,IAA/DtD,KAAKT,MAAMD,WAAWqB,MAAM,CAAC,UAAU,sBAA8B,yBAAKsC,UAAU,mCAAmCW,wBAAyB,CAACC,OAAO7D,KAAKT,MAAMD,WAAWqB,MAAM,CAAC,UAAU,wBAE9PX,KAAKT,MAAMD,WAAWgE,MAAM,CAAC,UAAU,mBAAiF,IAA5DtD,KAAKT,MAAMD,WAAWqB,MAAM,CAAC,UAAU,mBAA2B,uBAAGsC,UAAU,qDAAqDW,wBAAyB,CAACC,OAAO7D,KAAKT,MAAMD,WAAWqB,MAAM,CAAC,UAAU,qBAErQ,yBAAKsC,UAAU,mBACX,yBAAKA,UAAU,OACX,yBAAKA,UAAU,UACX,uBAAGA,UAAU,QAAQjD,KAAKT,MAAMD,WAAWqB,MAAM,CAAC,UAAU,oBAAsBqC,EAAE,+CAXrG,M,GAzLWmB,e,EA+MXC,wBAAkBjF","file":"4.80f011fffa0f91545942.ie.js","sourcesContent":["import React, { Component } from 'react';\nimport { connect } from \"react-redux\";\nimport ChatField from './ChatField';\nimport StartChat from './StartChat';\nimport { withTranslation } from 'react-i18next';\nimport { initOfflineForm, submitOfflineForm } from \"../actions/chatActions\"\nimport { helperFunctions } from \"../lib/helperFunctions\";\nimport ChatDepartment from './ChatDepartment';\n\n@connect((store) => {\n    return {\n        chatwidget: store.chatwidget\n    };\n})\n\nclass OfflineChat extends Component {\n\n    constructor(props) {\n        super(props);\n\n        this.state = {};\n        \n        this.initOfflineFormCall();\n\n        this.handleSubmit = this.handleSubmit.bind(this);\n        this.handleContentChange = this.handleContentChange.bind(this);\n        this.handleContentChangeCustom = this.handleContentChangeCustom.bind(this);\n        this.goToChat = this.goToChat.bind(this);\n    }\n\n    initOfflineFormCall(dep_default){\n        // Init offline form with all attributes\n        this.props.dispatch(initOfflineForm({\n            'department':this.props.chatwidget.get('department'),\n            'theme' : this.props.chatwidget.get('theme'),\n            'mode' : this.props.chatwidget.get('mode'),\n            'bot_id' : this.props.chatwidget.get('bot_id'),\n            'trigger_id' : this.props.chatwidget.get('trigger_id'),\n            'online' : 0,\n            'dep_default' : (dep_default || this.props.chatwidget.get('departmentDefault') || 0),\n        }));\n    }\n\n    handleSubmit(event) {\n\n        var fields = this.state;\n        var hasFile = false;\n        const formData = new FormData();\n\n        if (typeof fields['File'] !== 'undefined') {\n            hasFile = true;\n            formData.append(\"File\", fields['File'], fields['File'].name);\n        }\n\n        fields['jsvar'] = this.props.chatwidget.get('jsVars');\n        fields['captcha_' + this.props.chatwidget.getIn(['captcha','hash'])] = this.props.chatwidget.getIn(['captcha','ts']);\n        fields['tscaptcha'] = this.props.chatwidget.getIn(['captcha','ts']);\n        fields['user_timezone'] = helperFunctions.getTimeZone();\n        fields['URLRefer'] = window.location.href.substring(window.location.protocol.length);\n        fields['r'] = this.props.chatwidget.get('ses_ref');\n\n        if (this.props.chatwidget.get('operator') != '') {\n            fields['operator'] = this.props.chatwidget.get('operator');\n        }\n        \n        if (this.props.chatwidget.get('priority') !== null) {\n            fields['priority'] = this.props.chatwidget.get('priority');\n        }\n\n        const customFields = helperFunctions.getCustomFieldsSubmit(this.props.chatwidget.getIn(['customData','fields']));\n        if (customFields !== null) {\n            fields = {...fields, ...customFields};\n        }\n\n        let submitData = {\n            'department': this.props.chatwidget.get('department'),\n            'theme' : this.props.chatwidget.get('theme'),\n            'mode' : this.props.chatwidget.get('mode'),\n            'vid' : this.props.chatwidget.get('vid'),\n            'fields' : fields\n        };\n\n        if (hasFile) {\n            formData.append('document', JSON.stringify(submitData));\n        }\n\n        this.props.dispatch(submitOfflineForm(hasFile ? formData : submitData));\n        event.preventDefault();\n    }\n\n    handleContentChange(obj) {\n        var currentState = this.state;\n        currentState[obj.id] = obj.value;\n        this.setState(currentState);\n\n        if (obj.id == 'DepartamentID') {\n            if (this.props.chatwidget.getIn(['offlineData','department','departments']).size > 0){\n                this.props.chatwidget.getIn(['offlineData','department','departments']).map(dep => {\n                    if (dep.get('value') == obj.value) {\n                        if (dep.get('online') == true) {\n                            this.props.dispatch({'type' : 'dep_default', data : obj.value});\n                            this.props.dispatch({'type' : 'onlineStatus', data : true});\n                        }\n\n                        // Update online fields settings if different department\n                        if (this.props.chatwidget.getIn(['onlineData','dep_forms']) != obj.value) {\n                            this.initOfflineFormCall(obj.value);\n                        }\n\n                    }\n                })\n            }\n        }\n    }\n\n    componentDidMount() {\n        helperFunctions.prefillFields(this);\n    }\n\n    handleContentChangeCustom(obj) {\n        this.props.dispatch({'type' : 'CUSTOM_FIELDS_ITEM', data : {id : obj.field.get('index'), value : obj.value}});\n    }\n\n    goToChat() {\n        this.props.dispatch({type : 'attr_set', attr : ['isOfflineMode'], data: false});\n    }\n\n    componentDidUpdate(prevProps, prevState, snapshot) {\n        if (document.getElementById('id-container-fluid')) {\n\n            var headerContent = 0;\n\n            if (document.getElementById('widget-header-content')){\n                headerContent = document.getElementById('widget-header-content').offsetHeight;\n            }\n\n            helperFunctions.sendMessageParent('widgetHeight', [{\n                'height' : document.getElementById('id-container-fluid').offsetHeight + headerContent + 10\n            }]);\n        }\n    }\n    \n    render() {\n\n        const { t } = this.props;\n\n        if (this.props.chatwidget.getIn(['offlineData','fetched']) === true && this.props.chatwidget.getIn(['offlineData','disabled']) === true) {\n            return (\n                <div className=\"alert alert-danger m-2\" role=\"alert\">\n                    {t('start_chat.cant_start_a_chat')}\n                </div>\n            )\n        }\n\n        if (this.props.chatwidget.getIn(['offlineData','fetched']) === false)\n        {\n            return null;\n        }\n\n        if (this.props.chatwidget.getIn(['offlineData','fields']).size > 0) {\n            var mappedFields = this.props.chatwidget.getIn(['offlineData','fields']).map(field =><ChatField chatUI={this.props.chatwidget.get('chat_ui')} isInvalid={this.props.chatwidget.hasIn(['validationErrors',field.get('identifier')])} attrPrefill={{'attr_prefill_admin' : this.props.chatwidget.get('attr_prefill_admin'), 'attr_prefill' : this.props.chatwidget.get('attr_prefill')}} defaultValueField={this.state[field.get('name')] || field.get('value')} onChangeContent={this.handleContentChange} field={field} />);\n        } else {\n            var mappedFields = \"\";\n        }\n\n        if (this.props.chatwidget.getIn(['customData','fields']).size > 0) {\n            var mappedFieldsCustom = this.props.chatwidget.getIn(['customData','fields']).map(field =><ChatField chatUI={this.props.chatwidget.get('chat_ui')} key={field.get('identifier')} isInvalid={this.props.chatwidget.hasIn(['validationErrors',field.get('identifier')])} defaultValueField={field.get('value')} onChangeContent={this.handleContentChangeCustom} field={field} />);\n        } else {\n            var mappedFieldsCustom = \"\";\n        }\n\n        if (this.props.chatwidget.get('processStatus') == 0 || this.props.chatwidget.get('processStatus') == 1) {\n            return (\n                  <div id=\"id-container-fluid\">\n                    {this.props.chatwidget.get('leave_message') && this.props.chatwidget.hasIn(['chat_ui','operator_profile']) && this.props.chatwidget.getIn(['chat_ui','operator_profile']) != '' && <div className=\"py-2 px-3 offline-intro-operator\" dangerouslySetInnerHTML={{__html:this.props.chatwidget.getIn(['chat_ui','operator_profile'])}}></div>}\n\n                    {this.props.chatwidget.get('leave_message') && this.props.chatwidget.hasIn(['chat_ui','offline_intro']) && this.props.chatwidget.getIn(['chat_ui','offline_intro']) != '' && <p className=\"pb-1 mb-0 pt-2 px-3 font-weight-bold offline-intro\" dangerouslySetInnerHTML={{__html:this.props.chatwidget.getIn(['chat_ui','offline_intro'])}}></p>}\n\n                    {!this.props.chatwidget.get('leave_message') && <p className=\"pb-1 mb-0 pt-2 px-3 font-weight-bold offline-intro\">{this.props.chatwidget.getIn(['chat_ui','chat_unavailable'])}</p>}\n\n                    {this.props.chatwidget.get('leave_message') &&\n                    <div className=\"container-fluid\" >\n                        <form onSubmit={this.handleSubmit} className=\"offline-form\">\n                            <div className=\"row pt-2\">\n                                {mappedFields}\n                                {mappedFieldsCustom}\n                                {this.props.chatwidget.hasIn(['offlineData','department']) && <ChatDepartment defaultValueField={this.state['DepartamentID']} setDefaultValue={this.props.chatwidget.get('departmentDefault')} onChangeContent={this.handleContentChange} isInvalid={this.props.chatwidget.hasIn(['validationErrors','department'])} departments={this.props.chatwidget.getIn(['offlineData','department'])} />}\n                            </div>\n                            {(!this.props.chatwidget.hasIn(['chat_ui','hstr_btn']) || mappedFieldsCustom !== \"\" || mappedFields !== \"\") && <div className=\"row\">\n                                <div className=\"col-12 pb-2\">\n                                    <button type=\"submit\" disabled={this.props.chatwidget.get('processStatus') == 1} className=\"btn btn-secondary btn-sm\">{this.props.chatwidget.get('processStatus') == 1 && <i className=\"material-icons\">&#xf113;</i>}{this.props.chatwidget.getIn(['chat_ui','custom_start_button']) || t('start_chat.leave_a_message')}</button>\n                                    {this.props.chatwidget.get('isOnline') === true && this.props.chatwidget.get('isOfflineMode') === true && <button type=\"button\" onClick={this.goToChat} className=\"float-right btn btn-sm btn-link text-muted\">&laquo; {t('button.back_to_chat')}</button>}\n                                </div>\n                            </div>}\n                        </form>\n                    </div>}\n                      \n                      \n                  </div>\n            )\n        } else if (this.props.chatwidget.get('processStatus') == 2) {\n            return (\n                <div id=\"id-container-fluid\">\n\n                {this.props.chatwidget.hasIn(['chat_ui','operator_profile']) && this.props.chatwidget.getIn(['chat_ui','operator_profile']) != '' && <div className=\"py-2 px-3 offline-intro-operator\" dangerouslySetInnerHTML={{__html:this.props.chatwidget.getIn(['chat_ui','operator_profile'])}}></div>}\n\n                {this.props.chatwidget.hasIn(['chat_ui','offline_intro']) && this.props.chatwidget.getIn(['chat_ui','offline_intro']) != '' && <p className=\"pb-1 mb-0 pt-2 px-3 font-weight-bold offline-intro\" dangerouslySetInnerHTML={{__html:this.props.chatwidget.getIn(['chat_ui','offline_intro'])}}></p>}\n\n                    <div className=\"container-fluid\">\n                        <div className=\"row\">\n                            <div className=\"col-12\">\n                                <p className=\"pt-2\">{this.props.chatwidget.getIn(['chat_ui','thank_feedback']) || t('start_chat.thank_you_for_feedback')}</p>\n                            </div>\n                        </div>\n                    </div>\n\n                </div>\n            )\n        }\n    }\n}\n\nexport default withTranslation()(OfflineChat);\n"],"sourceRoot":""}
    \ No newline at end of file
    
  • lhc_web/design/defaulttheme/js/widgetv2/5.1bd04e3cb154d7fc49cd.ie.js+0 2 removed
    @@ -1,2 +0,0 @@
    -(window.webpackJsonpLHCReactAPP=window.webpackJsonpLHCReactAPP||[]).push([[5],{511:function(t,e,a){"use strict";a.r(e);var i,s=a(6),o=a.n(s),n=a(7),p=a.n(n),r=a(9),c=a.n(r),d=a(10),h=a.n(d),g=a(3),l=a.n(g),m=a(11),v=a.n(m),w=a(12),u=a.n(w),I=a(0),_=a.n(I),f=a(24),b=a(5),E=a(2),y=a(86),N=Object(f.b)((function(t){return{chatwidget:t.chatwidget}}))(i=function(t){function e(t){var a;return o()(this,e),a=c()(this,h()(e).call(this,t)),u()(l()(a),"state",{shown:!1}),a.hideInvitation=a.hideInvitation.bind(l()(a)),a.fullInvitation=a.fullInvitation.bind(l()(a)),a.setBotPayload=a.setBotPayload.bind(l()(a)),a}return v()(e,t),p()(e,[{key:"componentDidMount",value:function(){var t=this;E.a.sendMessageParent("showInvitation",[{name:this.props.chatwidget.getIn(["proactive","data","invitation_name"])}]),this.props.chatwidget.getIn(["proactive","data","play_sound"])&&E.a.emitEvent("play_sound",[{type:"new_invitation",sound_on:!0===this.props.chatwidget.getIn(["proactive","data","play_sound"]),widget_open:this.props.chatwidget.get("shown")&&"widget"==this.props.chatwidget.get("mode")||document.hasFocus()}]),this.props.chatwidget.hasIn(["proactive","data","full_widget"])&&!this.props.chatwidget.get("isMobile")||document.getElementById("id-invitation-height")&&setTimeout((function(){document.getElementById("id-invitation-height")&&(E.a.sendMessageParent("widgetHeight",[{force_width:t.props.chatwidget.hasIn(["proactive","data","message_width"])?t.props.chatwidget.getIn(["proactive","data","message_width"])+40:240,force_height:document.getElementById("id-invitation-height").offsetHeight+20,force_bottom:t.props.chatwidget.hasIn(["proactive","data","message_bottom"])?t.props.chatwidget.getIn(["proactive","data","message_bottom"]):75,force_right:t.props.chatwidget.hasIn(["proactive","data","message_right"])?t.props.chatwidget.getIn(["proactive","data","message_right"]):75}]),t.setState({shown:!0}))}),50)}},{key:"componentWillUnmount",value:function(){E.a.sendMessageParent("widgetHeight",[{reset_height:!0}])}},{key:"hideInvitation",value:function(t){this.props.dispatch(Object(b.f)()),t.preventDefault(),t.stopPropagation()}},{key:"fullInvitation",value:function(){E.a.sendMessageParentDirect("hideInvitation",[{full:!0,name:this.props.chatwidget.getIn(["proactive","data","invitation_name"])}]),this.props.dispatch({type:"FULL_INVITATION"})}},{key:"setBotPayload",value:function(t){this.props.setBotPayload(t),this.fullInvitation()}},{key:"render",value:function(){var t=this;this.props.chatwidget.hasIn(["proactive","data","full_widget"])&&!this.props.chatwidget.get("isMobile")&&this.fullInvitation();var e="";return!1===this.state.shown?e+=" invisible":e+=" fade-in",_.a.createElement("div",{id:"id-invitation-height",className:e},this.props.chatwidget.hasIn(["proactive","data","close_above_msg"])&&_.a.createElement("div",{className:"text-right"},_.a.createElement("button",{title:"Close",onClick:function(e){return t.hideInvitation(e)},id:"invitation-close-btn",className:"btn btn-sm rounded"},_.a.createElement("i",{className:"material-icons mr-0"},""))),_.a.createElement("div",{className:"p-2 pointer clearfix proactive-need-help",id:"proactive-wrapper",style:{width:this.props.chatwidget.hasIn(["proactive","data","message_width"])?this.props.chatwidget.getIn(["proactive","data","message_width"]):200},onClick:this.fullInvitation},!this.props.chatwidget.hasIn(["proactive","data","close_above_msg"])&&_.a.createElement("button",{title:"Close",onClick:function(e){return t.hideInvitation(e)},id:"invitation-close-btn",className:"float-right btn btn-sm rounded"},_.a.createElement("i",{className:"material-icons mr-0"},"")),this.props.chatwidget.hasIn(["proactive","data","photo_left_column"])&&this.props.chatwidget.getIn(["proactive","data","photo"])&&_.a.createElement("div",{className:"d-flex"},_.a.createElement("div",{className:"proactive-image"},_.a.createElement("img",{width:"30",alt:this.props.chatwidget.getIn(["proactive","data","name_support"])||this.props.chatwidget.getIn(["proactive","data","extra_profile"]),title:this.props.chatwidget.getIn(["proactive","data","name_support"])||this.props.chatwidget.getIn(["proactive","data","extra_profile"]),className:"mr-2 rounded",src:this.props.chatwidget.getIn(["proactive","data","photo"])})),_.a.createElement("div",{className:"flex-grow-1"},!this.props.chatwidget.hasIn(["proactive","data","hide_op_name"])&&_.a.createElement("div",{className:"fs14"},_.a.createElement("b",null,this.props.chatwidget.getIn(["proactive","data","name_support"])||this.props.chatwidget.getIn(["proactive","data","extra_profile"]))),_.a.createElement("div",{id:"inv-msg-wrapper"},_.a.createElement("p",{className:"fs13 mb-0 inv-msg-cnt",dangerouslySetInnerHTML:{__html:this.props.chatwidget.getIn(["proactive","data","message"])}}),this.props.chatwidget.hasIn(["proactive","data","bot_intro"])&&_.a.createElement(y.a,{setBotPayload:this.setBotPayload,content:this.props.chatwidget.getIn(["proactive","data","message_full"])})))),(!this.props.chatwidget.hasIn(["proactive","data","photo_left_column"])||!this.props.chatwidget.getIn(["proactive","data","photo"]))&&_.a.createElement("div",null,_.a.createElement("div",{className:"fs14"},this.props.chatwidget.getIn(["proactive","data","photo"])&&_.a.createElement("img",{width:"30",height:"30",alt:this.props.chatwidget.getIn(["proactive","data","name_support"])||this.props.chatwidget.getIn(["proactive","data","extra_profile"]),title:this.props.chatwidget.getIn(["proactive","data","name_support"])||this.props.chatwidget.getIn(["proactive","data","extra_profile"]),className:"mr-2 rounded",src:this.props.chatwidget.getIn(["proactive","data","photo"])}),!this.props.chatwidget.hasIn(["proactive","data","hide_op_name"])&&_.a.createElement("b",null,this.props.chatwidget.getIn(["proactive","data","name_support"])||this.props.chatwidget.getIn(["proactive","data","extra_profile"]))),_.a.createElement("div",{id:"inv-msg-wrapper"},_.a.createElement("p",{className:"fs13 mb-0 inv-msg-cnt",dangerouslySetInnerHTML:{__html:this.props.chatwidget.getIn(["proactive","data","message"])}}),this.props.chatwidget.hasIn(["proactive","data","bot_intro"])&&_.a.createElement(y.a,{setBotPayload:this.setBotPayload,content:this.props.chatwidget.getIn(["proactive","data","message_full"])})))))}}]),e}(I.Component))||i;e.default=N}}]);
    -//# sourceMappingURL=5.1bd04e3cb154d7fc49cd.ie.js.map
    \ No newline at end of file
    
  • lhc_web/design/defaulttheme/js/widgetv2/5.1bd04e3cb154d7fc49cd.ie.js.map+0 1 removed
    @@ -1 +0,0 @@
    -{"version":3,"sources":["webpack://LHCReactAPP/./src/components/ProactiveInvitation.js"],"names":["ProactiveInvitation","connect","store","chatwidget","props","shown","hideInvitation","bind","fullInvitation","setBotPayload","helperFunctions","sendMessageParent","name","this","getIn","emitEvent","get","document","hasFocus","hasIn","getElementById","setTimeout","offsetHeight","setState","e","dispatch","preventDefault","stopPropagation","sendMessageParentDirect","params","className","state","id","title","onClick","style","width","alt","src","dangerouslySetInnerHTML","__html","content","height","Component"],"mappings":"8RAYMA,EANLC,aAAQ,SAACC,GACN,MAAO,CACHC,WAAYD,EAAMC,c,eAUtB,WAAYC,GAAO,yBACf,4BAAMA,IADS,mBAJX,CACJC,OAAO,IAKP,EAAKC,eAAiB,EAAKA,eAAeC,KAApB,QACtB,EAAKC,eAAiB,EAAKA,eAAeD,KAApB,QACtB,EAAKE,cAAgB,EAAKA,cAAcF,KAAnB,QAJN,E,iEAOC,WAChBG,IAAgBC,kBAAkB,iBAAkB,CAAC,CAACC,KAAMC,KAAKT,MAAMD,WAAWW,MAAM,CAAC,YAAY,OAAO,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,OAAO,kBAAoB,2BAAIN,KAAKT,MAAMD,WAAWW,MAAM,CAAC,YAAa,OAAQ,kBAAoBD,KAAKT,MAAMD,WAAWW,MAAM,CAAC,YAAa,OAAQ,oBAEtM,yBAAKkB,GAAG,mBACJ,uBAAGF,UAAU,wBAAwBS,wBAAyB,CAACC,OAAQ3B,KAAKT,MAAMD,WAAWW,MAAM,CAAC,YAAa,OAAQ,eACxHD,KAAKT,MAAMD,WAAWgB,MAAM,CAAC,YAAY,OAAO,eAAiB,kBAAC,IAAD,CAAqBV,cAAeI,KAAKJ,cAAegC,QAAS5B,KAAKT,MAAMD,WAAWW,MAAM,CAAC,YAAa,OAAQ,2B,GA5HvL6B,e,EAwInB3C","file":"5.1bd04e3cb154d7fc49cd.ie.js","sourcesContent":["import React, { Component } from 'react';\nimport { connect } from \"react-redux\";\nimport { hideInvitation } from \"../actions/chatActions\"\nimport { helperFunctions } from \"../lib/helperFunctions\";\nimport ChatBotIntroMessage from './ChatBotIntroMessage';\n\n@connect((store) => {\n    return {\n        chatwidget: store.chatwidget\n    };\n})\n\nclass ProactiveInvitation extends Component {\n\n    state = {\n        shown: false\n    }\n\n    constructor(props) {\n        super(props);\n        this.hideInvitation = this.hideInvitation.bind(this);\n        this.fullInvitation = this.fullInvitation.bind(this);\n        this.setBotPayload = this.setBotPayload.bind(this);\n    }\n\n    componentDidMount() {\n        helperFunctions.sendMessageParent('showInvitation', [{name: this.props.chatwidget.getIn(['proactive','data','invitation_name'])}]);\n\n        if (this.props.chatwidget.getIn(['proactive','data','play_sound'])) {\n            helperFunctions.emitEvent('play_sound', [{'type' : 'new_invitation', 'sound_on' : (this.props.chatwidget.getIn(['proactive','data','play_sound']) === true), 'widget_open' : ((this.props.chatwidget.get('shown') && this.props.chatwidget.get('mode') == 'widget') || document.hasFocus())}]);\n        }\n\n        if (!(this.props.chatwidget.hasIn(['proactive','data','full_widget']) && !this.props.chatwidget.get('isMobile'))) {\n            if (document.getElementById('id-invitation-height')) {\n                setTimeout(()=> {\n                    if (document.getElementById('id-invitation-height')) {\n                        helperFunctions.sendMessageParent('widgetHeight', [{\n                            'force_width' : (this.props.chatwidget.hasIn(['proactive','data','message_width']) ? this.props.chatwidget.getIn(['proactive','data','message_width']) + 40 : 240),\n                            'force_height' : document.getElementById('id-invitation-height').offsetHeight + 20,\n                            'force_bottom' : (this.props.chatwidget.hasIn(['proactive','data','message_bottom']) ? this.props.chatwidget.getIn(['proactive','data','message_bottom']) : 75),\n                            'force_right' : (this.props.chatwidget.hasIn(['proactive','data','message_right']) ? this.props.chatwidget.getIn(['proactive','data','message_right']) : 75),\n                        }]);\n                        this.setState({shown : true});\n                    }\n                 }, 50);\n            }\n        }\n    }\n\n    componentWillUnmount() {\n        helperFunctions.sendMessageParent('widgetHeight', [{'reset_height' : true}]);\n    }\n\n    hideInvitation(e) {\n        this.props.dispatch(hideInvitation());\n        e.preventDefault();\n        e.stopPropagation();\n    }\n\n    fullInvitation() {\n        helperFunctions.sendMessageParentDirect('hideInvitation', [{'full' : true, name: this.props.chatwidget.getIn(['proactive','data','invitation_name'])}]);\n        this.props.dispatch({\n            'type' : 'FULL_INVITATION'\n        });\n    }\n\n    setBotPayload(params) {\n        // Set payload parameter\n        this.props.setBotPayload(params);\n\n        // Set auto start\n        // This way it's faster just user might see blank screen while submiting\n        // So just decided to show full invitation and submit in the background.\n        /*this.props.dispatch({\n            'type' : 'attr_set',\n            'attr' : ['chat_ui','auto_start'],\n            'data' : true,\n        });*/\n\n        // Show full invitation show auto submit will work\n        this.fullInvitation();\n    }\n\n    render() {\n\n        if (this.props.chatwidget.hasIn(['proactive','data','full_widget']) && !this.props.chatwidget.get('isMobile')) {\n            this.fullInvitation();\n        }\n\n        let className = \"\";\n        if (this.state.shown === false) {\n            className += \" invisible\";\n        } else {\n            className += \" fade-in\";\n        }\n\n        return (\n                <div id=\"id-invitation-height\" className={className} >\n\n                    {this.props.chatwidget.hasIn(['proactive','data','close_above_msg']) && <div className=\"text-right\"><button title=\"Close\" onClick={(e) => this.hideInvitation(e)} id=\"invitation-close-btn\" className=\"btn btn-sm rounded\"><i className=\"material-icons mr-0\">&#xf10a;</i></button></div>}\n\n                    <div className=\"p-2 pointer clearfix proactive-need-help\" id=\"proactive-wrapper\" style={{width:(this.props.chatwidget.hasIn(['proactive','data','message_width']) ? this.props.chatwidget.getIn(['proactive','data','message_width']) : 200)}} onClick={this.fullInvitation}>\n\n                        {!this.props.chatwidget.hasIn(['proactive','data','close_above_msg']) && <button title=\"Close\" onClick={(e) => this.hideInvitation(e)} id=\"invitation-close-btn\" className=\"float-right btn btn-sm rounded\"><i className=\"material-icons mr-0\">&#xf10a;</i></button>}\n\n                        {this.props.chatwidget.hasIn(['proactive','data','photo_left_column']) && this.props.chatwidget.getIn(['proactive','data','photo']) && <div className=\"d-flex\">\n\n                            <div className=\"proactive-image\">\n                                <img width=\"30\" alt={this.props.chatwidget.getIn(['proactive','data','name_support']) || this.props.chatwidget.getIn(['proactive','data','extra_profile'])} title={this.props.chatwidget.getIn(['proactive','data','name_support']) || this.props.chatwidget.getIn(['proactive','data','extra_profile'])} className=\"mr-2 rounded\" src={this.props.chatwidget.getIn(['proactive','data','photo'])} />\n                            </div>\n\n                            <div className=\"flex-grow-1\">\n                                {!this.props.chatwidget.hasIn(['proactive','data','hide_op_name']) && <div className=\"fs14\">\n                                    <b>{this.props.chatwidget.getIn(['proactive','data','name_support']) || this.props.chatwidget.getIn(['proactive','data','extra_profile'])}</b>\n                                </div>}\n                                <div id=\"inv-msg-wrapper\">\n                                    <p className=\"fs13 mb-0 inv-msg-cnt\" dangerouslySetInnerHTML={{__html:this.props.chatwidget.getIn(['proactive','data','message'])}}></p>\n                                    {this.props.chatwidget.hasIn(['proactive','data','bot_intro']) && <ChatBotIntroMessage setBotPayload={this.setBotPayload} content={this.props.chatwidget.getIn(['proactive','data','message_full'])} />}\n                                </div>\n                            </div>\n\n                        </div>}\n\n                        {(!this.props.chatwidget.hasIn(['proactive', 'data', 'photo_left_column']) || !this.props.chatwidget.getIn(['proactive', 'data', 'photo'])) &&\n                            <div>\n                                <div className=\"fs14\">\n                                    {this.props.chatwidget.getIn(['proactive', 'data', 'photo']) && <img width=\"30\" height=\"30\"\n                                                                                                     alt={this.props.chatwidget.getIn(['proactive', 'data', 'name_support']) || this.props.chatwidget.getIn(['proactive', 'data', 'extra_profile'])}\n                                                                                                     title={this.props.chatwidget.getIn(['proactive', 'data', 'name_support']) || this.props.chatwidget.getIn(['proactive', 'data', 'extra_profile'])}\n                                                                                                     className=\"mr-2 rounded\"\n                                                                                                     src={this.props.chatwidget.getIn(['proactive', 'data', 'photo'])}/>}\n\n                                    {!this.props.chatwidget.hasIn(['proactive','data','hide_op_name']) && <b>{this.props.chatwidget.getIn(['proactive', 'data', 'name_support']) || this.props.chatwidget.getIn(['proactive', 'data', 'extra_profile'])}</b>}\n                                </div>\n                                <div id=\"inv-msg-wrapper\">\n                                    <p className=\"fs13 mb-0 inv-msg-cnt\" dangerouslySetInnerHTML={{__html: this.props.chatwidget.getIn(['proactive', 'data', 'message'])}}></p>\n                                    {this.props.chatwidget.hasIn(['proactive','data','bot_intro']) && <ChatBotIntroMessage setBotPayload={this.setBotPayload} content={this.props.chatwidget.getIn(['proactive', 'data', 'message_full'])} />}\n                                </div>\n                            </div>\n                        }\n\n\n                    </div>\n                </div>\n        );\n    }\n}\n\nexport default ProactiveInvitation;\n"],"sourceRoot":""}
    \ No newline at end of file
    
  • lhc_web/design/defaulttheme/js/widgetv2/6.5e9f23d9c05330e9214e.ie.js+0 2 removed
    @@ -1,2 +0,0 @@
    -(window.webpackJsonpLHCReactAPP=window.webpackJsonpLHCReactAPP||[]).push([[6],{514:function(e,t,i){"use strict";i.r(t);var a=i(141),s=i.n(a),n=i(198),r=i.n(n),o=i(6),c=i.n(o),l=i(7),u=i.n(l),d=i(9),h=i.n(d),p=i(10),m=i.n(p),f=i(3),g=i.n(f),v=i(11),w=i.n(v),b=i(12),y=i.n(b),R=i(0),k=i.n(R);function U(){function e(e,t){return new Promise((i,a)=>{const s=new XMLHttpRequest;s.open("GET",e),s.responseType="arraybuffer",s.onload=()=>{i(WebAssembly.instantiate(s.response,t))},s.onerror=a,s.send()})}let t=null,i=5242880;function a(e){const t=i;return i+=e,t}function s(e){postMessage({type:"internal-error",data:e})}let n=null,r=null,o=null;onmessage=i=>{const c=i.data;switch(c.type){case"init":const{wasmURL:i,shimURL:u}=c.data;Promise.resolve().then(()=>(self.WebAssembly&&!function(){const e=new Uint8Array([0,97,115,109,1,0,0,0,1,6,1,96,1,127,1,127,3,2,1,0,5,3,1,0,1,7,8,1,4,116,101,115,116,0,0,10,16,1,14,0,32,0,65,1,54,2,0,32,0,40,2,0,11]),t=new WebAssembly.Module(e);return 0!==new WebAssembly.Instance(t,{}).exports.test(4)}()&&delete self.WebAssembly,self.WebAssembly||importScripts(u),t=new WebAssembly.Memory({initial:256,maximum:256}),{memory:t,pow:Math.pow,exit:s,powf:Math.pow,exp:Math.exp,sqrtf:Math.sqrt,cos:Math.cos,log:Math.log,sin:Math.sin,sbrk:a})).then(t=>function(t,i){if(!WebAssembly.instantiateStreaming)return e(t,i);const a=fetch(t,{credentials:"same-origin"});return WebAssembly.instantiateStreaming(a,i).catch(a=>{if(a.message&&a.message.indexOf("Argument 0 must be provided and must be a Response")>0)return e(t,i);throw a})}(i,{env:t})).then(e=>{n=e.instance.exports,postMessage({type:"init",data:null})}).catch(e=>{postMessage({type:"init-error",data:e.toString()})});break;case"start":if(!function(e){if(r=n.vmsg_init(e),!r)return!1;const i=new Uint32Array(t.buffer,r,1)[0];return o=new Float32Array(t.buffer,i),!0}(c.data))return postMessage({type:"error",data:"vmsg_init"});break;case"data":if(l=c.data,o.set(l),!(n.vmsg_encode(r,l.length)>=0))return postMessage({type:"error",data:"vmsg_encode"});break;case"stop":const d=function(){if(n.vmsg_flush(r)<0)return null;const e=new Uint32Array(t.buffer,r+4,1)[0],i=new Uint32Array(t.buffer,r+8,1)[0],a=new Uint8Array(t.buffer,e,i),s=new Blob([a],{type:"audio/mpeg"});return n.vmsg_free(r),r=null,o=null,s}();if(!d)return postMessage({type:"error",data:"vmsg_flush"});postMessage({type:"stop",data:d})}var l}}class L{constructor(e={},t=null){this.wasmURL=new URL(e.wasmURL||"/static/js/vmsg.wasm",location).href,this.shimURL=new URL(e.shimURL||"/static/js/wasm-polyfill.js",location).href,this.onStop=t,this.pitch=e.pitch||0,this.stream=null,this.audioCtx=null,this.gainNode=null,this.pitchFX=null,this.encNode=null,this.worker=null,this.workerURL=null,this.blob=null,this.blobURL=null,this.resolve=null,this.reject=null,Object.seal(this)}close(){this.encNode&&this.encNode.disconnect(),this.encNode&&(this.encNode.onaudioprocess=null),this.stream&&this.stopTracks(),this.audioCtx&&this.audioCtx.close(),this.worker&&this.worker.terminate(),this.workerURL&&URL.revokeObjectURL(this.workerURL),this.blobURL&&URL.revokeObjectURL(this.blobURL)}initAudio(){return(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia?function(e){return navigator.mediaDevices.getUserMedia(e)}:function(e){const t=navigator.webkitGetUserMedia||navigator.mozGetUserMedia;return t?new Promise((function(i,a){t.call(navigator,e,i,a)})):Promise.reject(new Error("getUserMedia is not implemented in this browser"))})({audio:!0}).then(e=>{this.stream=e;const t=this.audioCtx=new(window.AudioContext||window.webkitAudioContext),i=t.createMediaStreamSource(e),a=this.gainNode=(t.createGain||t.createGainNode).call(t);a.gain.value=1,i.connect(a);const s=this.pitchFX=new N(t);s.setPitchOffset(this.pitch);const n=this.encNode=(t.createScriptProcessor||t.createJavaScriptNode).call(t,0,1,1);s.output.connect(n),a.connect(0===this.pitch?n:s.input)})}initWorker(){if(!this.stream)throw new Error("missing audio initialization");const e=new Blob(["(",U.toString(),")()"],{type:"application/javascript"}),t=this.workerURL=URL.createObjectURL(e),i=this.worker=new Worker(t),{wasmURL:a,shimURL:s}=this;return i.postMessage({type:"init",data:{wasmURL:a,shimURL:s}}),new Promise((e,t)=>{i.onmessage=i=>{const a=i.data;switch(a.type){case"init":e();break;case"init-error":t(new Error(a.data));break;case"error":case"internal-error":console.error("Worker error:",a.data),this.reject&&this.reject(a.data);break;case"stop":this.blob=a.data,this.blobURL=URL.createObjectURL(a.data),this.onStop&&this.onStop(),this.resolve&&this.resolve(this.blob)}}})}init(){return this.initAudio().then(this.initWorker.bind(this))}startRecording(){if(!this.stream)throw new Error("missing audio initialization");if(!this.worker)throw new Error("missing worker initialization");this.blob=null,this.blobURL&&URL.revokeObjectURL(this.blobURL),this.blobURL=null,this.resolve=null,this.reject=null,this.worker.postMessage({type:"start",data:this.audioCtx.sampleRate}),this.encNode.onaudioprocess=e=>{const t=e.inputBuffer.getChannelData(0);this.worker.postMessage({type:"data",data:t})},this.encNode.connect(this.audioCtx.destination)}stopRecording(){if(!this.stream)throw new Error("missing audio initialization");if(!this.worker)throw new Error("missing worker initialization");return this.encNode.disconnect(),this.encNode.onaudioprocess=null,this.stopTracks(),this.worker.postMessage({type:"stop",data:null}),new Promise((e,t)=>{this.resolve=e,this.reject=t})}stopTracks(){this.stream.getTracks&&this.stream.getTracks().forEach(e=>e.stop())}}var G=L;function x(e,t,i,a){for(var s=t*e.sampleRate,n=s+(t-2*i)*e.sampleRate,r=e.createBuffer(1,n,e.sampleRate),o=r.getChannelData(0),c=0;c<s;++c)o[c]=a?(s-c)/n:c/s;for(c=s;c<n;++c)o[c]=0;return r}function N(e){this.context=e;var t=(e.createGain||e.createGainNode).call(e),i=(e.createGain||e.createGainNode).call(e);this.input=t,this.output=i;var a=e.createBufferSource(),s=e.createBufferSource(),n=e.createBufferSource(),r=e.createBufferSource();this.shiftDownBuffer=x(e,.1,.05,!1),this.shiftUpBuffer=x(e,.1,.05,!0),a.buffer=this.shiftDownBuffer,s.buffer=this.shiftDownBuffer,n.buffer=this.shiftUpBuffer,r.buffer=this.shiftUpBuffer,a.loop=!0,s.loop=!0,n.loop=!0,r.loop=!0;var o=(e.createGain||e.createGainNode).call(e),c=(e.createGain||e.createGainNode).call(e),l=(e.createGain||e.createGainNode).call(e);l.gain.value=0;var u=(e.createGain||e.createGainNode).call(e);u.gain.value=0,a.connect(o),s.connect(c),n.connect(l),r.connect(u);var d=(e.createGain||e.createGainNode).call(e),h=(e.createGain||e.createGainNode).call(e),p=(e.createDelay||e.createDelayNode).call(e),m=(e.createDelay||e.createDelayNode).call(e);o.connect(d),c.connect(h),l.connect(d),u.connect(h),d.connect(p.delayTime),h.connect(m.delayTime);var f=e.createBufferSource(),g=e.createBufferSource(),v=function(e,t,i){for(var a=t*e.sampleRate,s=a+(t-2*i)*e.sampleRate,n=e.createBuffer(1,s,e.sampleRate),r=n.getChannelData(0),o=i*e.sampleRate,c=o,l=a-o,u=0;u<a;++u){var d;d=u<c?Math.sqrt(u/o):u>=l?Math.sqrt(1-(u-l)/o):1,r[u]=d}for(u=a;u<s;++u)r[u]=0;return n}(e,.1,.05);f.buffer=v,g.buffer=v,f.loop=!0,g.loop=!0;var w=(e.createGain||e.createGainNode).call(e),b=(e.createGain||e.createGainNode).call(e);w.gain.value=0,b.gain.value=0,f.connect(w.gain),g.connect(b.gain),t.connect(p),t.connect(m),p.connect(w),m.connect(b),w.connect(i),b.connect(i);var y=e.currentTime+.05,R=y+.1-.05;a.start(y),s.start(R),n.start(y),r.start(R),f.start(y),g.start(R),this.mod1=a,this.mod2=s,this.mod1Gain=o,this.mod2Gain=c,this.mod3Gain=l,this.mod4Gain=u,this.modGain1=d,this.modGain2=h,this.fade1=f,this.fade2=g,this.mix1=w,this.mix2=b,this.delay1=p,this.delay2=m,this.setDelay(.1)}N.prototype.setDelay=function(e){this.modGain1.gain.setTargetAtTime(.5*e,0,.01),this.modGain2.gain.setTargetAtTime(.5*e,0,.01)},N.prototype.setPitchOffset=function(e){e>0?(this.mod1Gain.gain.value=0,this.mod2Gain.gain.value=0,this.mod3Gain.gain.value=1,this.mod4Gain.gain.value=1):(this.mod1Gain.gain.value=1,this.mod2Gain.gain.value=1,this.mod3Gain.gain.value=0,this.mod4Gain.gain.value=0),this.setDelay(.1*Math.abs(e))};var M=i(25),S=new G({wasmURL:window.lhcChat.staticJS.chunk_js+"/vmsg.8c4a15f2.wasm",shimURL:"https://unpkg.com/wasm-polyfill.js@0.2.0/wasm-polyfill.js"}),P=function(e){function t(e){var i;return c()(this,t),i=h()(this,m()(t).call(this,e)),y()(g()(i),"state",{isLoading:!1,isRecording:!1,isPlaying:!1,recording:null,audioDuration:0,currentTime:0}),i.startRecording=i.startRecording.bind(g()(i)),i.stopRecording=i.stopRecording.bind(g()(i)),i.playRecord=i.playRecord.bind(g()(i)),i.stopPlayRecord=i.stopPlayRecord.bind(g()(i)),i.sendRecord=i.sendRecord.bind(g()(i)),i.durationInterval=null,i.playInterval=null,i}var i,a;return w()(t,e),u()(t,[{key:"startRecording",value:(a=r()(s.a.mark((function e(){var t=this;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.stopPlayRecord(),this.setState({isLoading:!0,audioDuration:0,recording:null,isPlaying:!1,currentTime:0}),e.prev=2,e.next=5,S.initAudio();case 5:return e.next=7,S.initWorker();case 7:S.startRecording(),this.setState({isLoading:!1,isRecording:!0}),this.durationInterval=setInterval((function(){t.setState({audioDuration:t.state.audioDuration+1}),t.state.audioDuration>=t.props.maxSeconds&&t.stopRecording()}),1e3),e.next=16;break;case 12:e.prev=12,e.t0=e.catch(2),alert("Sorry but voice messages are not supported on your browser!"),this.setState({isLoading:!1});case 16:case"end":return e.stop()}}),e,this,[[2,12]])}))),function(){return a.apply(this,arguments)})},{key:"stopRecording",value:(i=r()(s.a.mark((function e(){var t;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,S.stopRecording();case 2:t=e.sent,this.audio=new Audio,this.audio.src=URL.createObjectURL(t),this.setState({isLoading:!1,isRecording:!1,recording:t}),clearInterval(this.durationInterval);case 7:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"playRecord",value:function(){var e=this;this.audio.currentTime=0,this.audio.play(),this.setState({isPlaying:!0}),this.playInterval=setInterval((function(){e.setState({currentTime:Math.round(e.audio.currentTime)}),(e.audio.ended||e.audio.paused)&&e.stopPlayRecord()}),1e3)}},{key:"stopPlayRecord",value:function(){this.state.isPlaying&&(clearInterval(this.playInterval),this.audio.currentTime=0,this.audio.pause(),this.setState({isPlaying:!1,currentTime:0}))}},{key:"sendRecord",value:function(){var e=this,t=this.props.t;this.props.progress(t("file.uploading"));var i=new XMLHttpRequest,a=new FormData;a.append("files",this.state.recording,"record.mp3"),i.open("POST",this.props.base_url+"/file/uploadfile/"+this.props.chat_id+"/"+this.props.hash),i.upload.addEventListener("load",(function(t){e.props.progress("100%"),e.props.onCompletion(),e.props.cancel()})),i.send(a)}},{key:"componentDidMount",value:function(){}},{key:"componentWillUnmount",value:function(){this.stopPlayRecord(),this.state.isRecording&&S.stopRecording()}},{key:"pad",value:function(e){return e<10?"0"+e:e}},{key:"render",value:function(){var e=this,t=this.state,i=(t.isLoading,t.isRecording),a=t.recording,s=t.isPlaying,n=this.props.t;return k.a.createElement("div",{className:"text-nowrap"},k.a.createElement("i",{className:"material-icons pointer text-danger fs25",title:n("voice.cancel_voice_message"),onClick:function(){return e.props.cancel()}},""),!i&&k.a.createElement("i",{className:"material-icons fs25 pointer text-danger mr-0",title:n("voice.record_voice_message"),onClick:this.startRecording},""),i&&k.a.createElement("i",{className:"material-icons fs25 pointer text-danger mr-0",title:n("voice.stop_recording"),onClick:this.stopRecording},""),a&&!1===s&&k.a.createElement("i",{className:"material-icons pointer text-success mr-0 fs25",title:n("voice.play_recorded"),onClick:this.playRecord},""),a&&!0===s&&k.a.createElement("i",{className:"material-icons pointer text-success mr-0 fs25",title:n("voice.stop_playing_recorded"),onClick:this.stopPlayRecord},""),k.a.createElement("span",{className:"fs12 px-1"},i?"":s?this.pad(this.state.currentTime)+":":"",i||!a?this.props.maxSeconds-this.state.audioDuration+" s.":this.pad(this.state.audioDuration)+(s?"":"s.")),a&&k.a.createElement("i",{className:"material-icons pointer text-success mr-0 fs25",title:n("voice.send"),onClick:this.sendRecord},""))}}]),t}(R.PureComponent);t.default=Object(M.b)()(P)}}]);
    -//# sourceMappingURL=6.5e9f23d9c05330e9214e.ie.js.map
    \ No newline at end of file
    
  • lhc_web/design/defaulttheme/js/widgetv2/6.5e9f23d9c05330e9214e.ie.js.map+0 1 removed
    @@ -1 +0,0 @@
    -{"version":3,"sources":["webpack://LHCReactAPP/./node_modules/vmsg/vmsg.js","webpack://LHCReactAPP/./src/components/VoiceMessage.js"],"names":["inlineWorker","fetchAndInstantiateFallback","url","imports","Promise","resolve","reject","req","XMLHttpRequest","open","responseType","onload","WebAssembly","instantiate","response","onerror","send","memory","dynamicTop","sbrk","increment","oldDynamicTop","exit","status","postMessage","type","data","FFI","ref","pcm_l","onmessage","e","msg","wasmURL","shimURL","then","self","bin","Uint8Array","mod","Module","Instance","exports","test","testSafariWebAssemblyBug","importScripts","Memory","initial","TOTAL_MEMORY","maximum","pow","Math","powf","exp","sqrtf","sqrt","cos","log","sin","Runtime","instantiateStreaming","fetch","credentials","catch","err","message","indexOf","fetchAndInstantiate","env","wasm","instance","toString","rate","vmsg_init","pcm_l_ref","Uint32Array","buffer","Float32Array","set","vmsg_encode","length","blob","vmsg_flush","mp3_ref","size","mp3","Blob","vmsg_free","Recorder","opts","onStop","this","URL","location","href","pitch","stream","audioCtx","gainNode","pitchFX","encNode","worker","workerURL","blobURL","Object","seal","disconnect","onaudioprocess","stopTracks","close","terminate","revokeObjectURL","navigator","mediaDevices","getUserMedia","constraints","oldGetUserMedia","webkitGetUserMedia","mozGetUserMedia","call","Error","audio","window","AudioContext","webkitAudioContext","sourceNode","createMediaStreamSource","createGain","createGainNode","gain","value","connect","Jungle","setPitchOffset","createScriptProcessor","createJavaScriptNode","output","input","createObjectURL","Worker","console","error","initAudio","initWorker","bind","sampleRate","samples","inputBuffer","getChannelData","destination","getTracks","forEach","track","stop","createDelayTimeBuffer","context","activeTime","fadeTime","shiftUp","length1","createBuffer","p","i","mod1","createBufferSource","mod2","mod3","mod4","shiftDownBuffer","shiftUpBuffer","loop","mod1Gain","mod2Gain","mod3Gain","mod4Gain","modGain1","modGain2","delay1","createDelay","createDelayNode","delay2","delayTime","fade1","fade2","fadeBuffer","fadeLength","fadeIndex1","fadeIndex2","createFadeBuffer","mix1","mix2","t","currentTime","t2","start","setDelay","prototype","setTargetAtTime","mult","abs","recorder","vmsg","lhcChat","VoiceMessage","props","isLoading","isRecording","isPlaying","recording","audioDuration","startRecording","stopRecording","playRecord","stopPlayRecord","sendRecord","durationInterval","playInterval","setState","setInterval","state","maxSeconds","alert","Audio","src","clearInterval","play","round","ended","paused","pause","progress","formData","FormData","append","base_url","chat_id","hash","upload","addEventListener","event","onCompletion","cancel","n","className","title","onClick","pad","PureComponent","withTranslation"],"mappings":"kSAOA,SAASA,IAkBP,SAASC,EAA4BC,EAAKC,GACxC,OAAO,IAAIC,QAAQ,CAACC,EAASC,KAC3B,MAAMC,EAAM,IAAIC,eAChBD,EAAIE,KAAK,MAAOP,GAChBK,EAAIG,aAAe,cACnBH,EAAII,OAAS,KACXN,EAAQO,YAAYC,YAAYN,EAAIO,SAAUX,KAEhDI,EAAIQ,QAAUT,EACdC,EAAIS,SAQR,IAAIC,EAAS,KACTC,EAJgB,QAMpB,SAASC,EAAKC,GACZ,MAAMC,EAAgBH,EAEtB,OADAA,GAAcE,EACPC,EAKT,SAASC,EAAKC,GACZC,YAAY,CAACC,KAAM,iBAAkBC,KAAMH,IAG7C,IAAII,EAAM,KACNC,EAAM,KACNC,EAAQ,KAkCZC,UAAaC,IACX,MAAMC,EAAMD,EAAEL,KACd,OAAQM,EAAIP,MACZ,IAAK,OACH,MAAM,QAAEQ,EAAO,QAAEC,GAAYF,EAAIN,KACjCtB,QAAQC,UAAU8B,KAAK,KACjBC,KAAKxB,cAff,WACE,MAAMyB,EAAM,IAAIC,WAAW,CAAC,EAAE,GAAG,IAAI,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,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yH,YAA5G,KAEpCJ,IAA2B,IAAdD,GAAsB,uBAAGoC,UAAU,gDAAgDC,MAAOrD,EAAE,+BAAgCsD,QAAS1J,KAAK0H,gBAApH,KAEpC,0BAAM8B,UAAU,aAAarC,EAAc,GAAMC,EAAYpH,KAAK2J,IAAI3J,KAAKgI,MAAM3B,aAAe,IAAM,GAAKc,IAAgBE,EAAarH,KAAKiH,MAAMgB,WAAajI,KAAKgI,MAAMV,cAAiB,MAAQtH,KAAK2J,IAAI3J,KAAKgI,MAAMV,gBAAmBF,EAAmB,GAAP,OAEtPC,GAAa,uBAAGmC,UAAU,gDAAgDC,MAAOrD,EAAE,cAAesD,QAAS1J,KAAK2H,YAAnG,U,GA7ICiC,iBAmJZC,wBAAkB7C","file":"6.5e9f23d9c05330e9214e.ie.js","sourcesContent":["/* eslint-disable */\n\nfunction pad2(n) {\n  n |= 0;\n  return n < 10 ? `0${n}` : `${Math.min(n, 99)}`;\n}\n\nfunction inlineWorker() {\n  // TODO(Kagami): Cache compiled module in IndexedDB? It works in FF\n  // and Edge, see: https://github.com/mdn/webassembly-examples/issues/4\n  // Though gzipped WASM module currently weights ~70kb so it should be\n  // perfectly cached by the browser itself.\n  function fetchAndInstantiate(url, imports) {\n    if (!WebAssembly.instantiateStreaming) return fetchAndInstantiateFallback(url, imports);\n    const req = fetch(url, {credentials: \"same-origin\"});\n    return WebAssembly.instantiateStreaming(req, imports).catch(err => {\n      // https://github.com/Kagami/vmsg/issues/11\n      if (err.message && err.message.indexOf(\"Argument 0 must be provided and must be a Response\") > 0) {\n        return fetchAndInstantiateFallback(url, imports);\n      } else {\n        throw err;\n      }\n    });\n  }\n\n  function fetchAndInstantiateFallback(url, imports) {\n    return new Promise((resolve, reject) => {\n      const req = new XMLHttpRequest();\n      req.open(\"GET\", url);\n      req.responseType = \"arraybuffer\";\n      req.onload = () => {\n        resolve(WebAssembly.instantiate(req.response, imports));\n      };\n      req.onerror = reject;\n      req.send();\n    });\n  }\n\n  // Must be in sync with emcc settings!\n  const TOTAL_STACK = 5 * 1024 * 1024;\n  const TOTAL_MEMORY = 16 * 1024 * 1024;\n  const WASM_PAGE_SIZE = 64 * 1024;\n  let memory = null;\n  let dynamicTop = TOTAL_STACK;\n  // TODO(Kagami): Grow memory?\n  function sbrk(increment) {\n    const oldDynamicTop = dynamicTop;\n    dynamicTop += increment;\n    return oldDynamicTop;\n  }\n  // TODO(Kagami): LAME calls exit(-1) on internal error. Would be nice\n  // to provide custom DEBUGF/ERRORF for easier debugging. Currenty\n  // those functions do nothing.\n  function exit(status) {\n    postMessage({type: \"internal-error\", data: status});\n  }\n\n  let FFI = null;\n  let ref = null;\n  let pcm_l = null;\n  function vmsg_init(rate) {\n    ref = FFI.vmsg_init(rate);\n    if (!ref) return false;\n    const pcm_l_ref = new Uint32Array(memory.buffer, ref, 1)[0];\n    pcm_l = new Float32Array(memory.buffer, pcm_l_ref);\n    return true;\n  }\n  function vmsg_encode(data) {\n    pcm_l.set(data);\n    return FFI.vmsg_encode(ref, data.length) >= 0;\n  }\n  function vmsg_flush() {\n    if (FFI.vmsg_flush(ref) < 0) return null;\n    const mp3_ref = new Uint32Array(memory.buffer, ref + 4, 1)[0];\n    const size = new Uint32Array(memory.buffer, ref + 8, 1)[0];\n    const mp3 = new Uint8Array(memory.buffer, mp3_ref, size);\n    const blob = new Blob([mp3], {type: \"audio/mpeg\"});\n    FFI.vmsg_free(ref);\n    ref = null;\n    pcm_l = null;\n    return blob;\n  }\n\n  // https://github.com/brion/min-wasm-fail\n  function testSafariWebAssemblyBug() {\n    const bin = new Uint8Array([0,97,115,109,1,0,0,0,1,6,1,96,1,127,1,127,3,2,1,0,5,3,1,0,1,7,8,1,4,116,101,115,116,0,0,10,16,1,14,0,32,0,65,1,54,2,0,32,0,40,2,0,11]);\n    const mod = new WebAssembly.Module(bin);\n    const inst = new WebAssembly.Instance(mod, {});\n    // test storing to and loading from a non-zero location via a parameter.\n    // Safari on iOS 11.2.5 returns 0 unexpectedly at non-zero locations\n    return (inst.exports.test(4) !== 0);\n  }\n\n  onmessage = (e) => {\n    const msg = e.data;\n    switch (msg.type) {\n    case \"init\":\n      const { wasmURL, shimURL } = msg.data;\n      Promise.resolve().then(() => {\n        if (self.WebAssembly && !testSafariWebAssemblyBug()) {\n          delete self.WebAssembly;\n        }\n        if (!self.WebAssembly) {\n          importScripts(shimURL);\n        }\n        memory = new WebAssembly.Memory({\n          initial: TOTAL_MEMORY / WASM_PAGE_SIZE,\n          maximum: TOTAL_MEMORY / WASM_PAGE_SIZE,\n        });\n        return {\n          memory: memory,\n          pow: Math.pow,\n          exit: exit,\n          powf: Math.pow,\n          exp: Math.exp,\n          sqrtf: Math.sqrt,\n          cos: Math.cos,\n          log: Math.log,\n          sin: Math.sin,\n          sbrk: sbrk,\n        };\n      }).then(Runtime => {\n        return fetchAndInstantiate(wasmURL, {env: Runtime})\n      }).then(wasm => {\n        FFI = wasm.instance.exports;\n        postMessage({type: \"init\", data: null});\n      }).catch(err => {\n        postMessage({type: \"init-error\", data: err.toString()});\n      });\n      break;\n    case \"start\":\n      if (!vmsg_init(msg.data)) return postMessage({type: \"error\", data: \"vmsg_init\"});\n      break;\n    case \"data\":\n      if (!vmsg_encode(msg.data)) return postMessage({type: \"error\", data: \"vmsg_encode\"});\n      break;\n    case \"stop\":\n      const blob = vmsg_flush();\n      if (!blob) return postMessage({type: \"error\", data: \"vmsg_flush\"});\n      postMessage({type: \"stop\", data: blob});\n      break;\n    }\n  };\n}\n\nexport class Recorder {\n  constructor(opts = {}, onStop = null) {\n    // Can't use relative URL in blob worker, see:\n    // https://stackoverflow.com/a/22582695\n    this.wasmURL = new URL(opts.wasmURL || \"/static/js/vmsg.wasm\", location).href;\n    this.shimURL = new URL(opts.shimURL || \"/static/js/wasm-polyfill.js\", location).href;\n    this.onStop = onStop;\n    this.pitch = opts.pitch || 0;\n    this.stream = null;\n    this.audioCtx = null;\n    this.gainNode = null;\n    this.pitchFX = null;\n    this.encNode = null;\n    this.worker = null;\n    this.workerURL = null;\n    this.blob = null;\n    this.blobURL = null;\n    this.resolve = null;\n    this.reject = null;\n    Object.seal(this);\n  }\n\n  close() {\n    if (this.encNode) this.encNode.disconnect();\n    if (this.encNode) this.encNode.onaudioprocess = null;\n    if (this.stream) this.stopTracks();\n    if (this.audioCtx) this.audioCtx.close();\n    if (this.worker) this.worker.terminate();\n    if (this.workerURL) URL.revokeObjectURL(this.workerURL);\n    if (this.blobURL) URL.revokeObjectURL(this.blobURL);\n  }\n\n  // Without pitch shift:\n  //   [sourceNode] -> [gainNode] -> [encNode] -> [audioCtx.destination]\n  //                                     |\n  //                                     -> [worker]\n  // With pitch shift:\n  //   [sourceNode] -> [gainNode] -> [pitchFX] -> [encNode] -> [audioCtx.destination]\n  //                                                  |\n  //                                                  -> [worker]\n  initAudio() {\n    const getUserMedia = navigator.mediaDevices && navigator.mediaDevices.getUserMedia\n      ? function(constraints) {\n          return navigator.mediaDevices.getUserMedia(constraints);\n        }\n      : function(constraints) {\n          const oldGetUserMedia = navigator.webkitGetUserMedia || navigator.mozGetUserMedia;\n          if (!oldGetUserMedia) {\n            return Promise.reject(new Error(\"getUserMedia is not implemented in this browser\"));\n          }\n          return new Promise(function(resolve, reject) {\n            oldGetUserMedia.call(navigator, constraints, resolve, reject);\n          });\n        };\n\n    return getUserMedia({audio: true}).then((stream) => {\n      this.stream = stream;\n      const audioCtx = this.audioCtx = new (window.AudioContext\n        || window.webkitAudioContext)();\n\n      const sourceNode = audioCtx.createMediaStreamSource(stream);\n      const gainNode = this.gainNode = (audioCtx.createGain\n        || audioCtx.createGainNode).call(audioCtx);\n      gainNode.gain.value = 1;\n      sourceNode.connect(gainNode);\n\n      const pitchFX = this.pitchFX = new Jungle(audioCtx);\n      pitchFX.setPitchOffset(this.pitch);\n\n      const encNode = this.encNode = (audioCtx.createScriptProcessor\n        || audioCtx.createJavaScriptNode).call(audioCtx, 0, 1, 1);\n      pitchFX.output.connect(encNode);\n\n      gainNode.connect(this.pitch === 0 ? encNode : pitchFX.input);\n    });\n  }\n\n  initWorker() {\n    if (!this.stream) throw new Error(\"missing audio initialization\");\n    // https://stackoverflow.com/a/19201292\n    const blob = new Blob(\n      [\"(\", inlineWorker.toString(), \")()\"],\n      {type: \"application/javascript\"});\n    const workerURL = this.workerURL = URL.createObjectURL(blob);\n    const worker = this.worker = new Worker(workerURL);\n    const { wasmURL, shimURL } = this;\n    worker.postMessage({type: \"init\", data: {wasmURL, shimURL}});\n    return new Promise((resolve, reject) => {\n      worker.onmessage = (e) => {\n        const msg = e.data;\n        switch (msg.type) {\n        case \"init\":\n          resolve();\n          break;\n        case \"init-error\":\n          reject(new Error(msg.data));\n          break;\n        // TODO(Kagami): Error handling.\n        case \"error\":\n        case \"internal-error\":\n          console.error(\"Worker error:\", msg.data);\n          if (this.reject) this.reject(msg.data);\n          break;\n        case \"stop\":\n          this.blob = msg.data;\n          this.blobURL = URL.createObjectURL(msg.data);\n          if (this.onStop) this.onStop();\n          if (this.resolve) this.resolve(this.blob);\n          break;\n        }\n      }\n    });\n  }\n\n  init() {\n    return this.initAudio().then(this.initWorker.bind(this));\n  }\n\n  startRecording() {\n    if (!this.stream) throw new Error(\"missing audio initialization\");\n    if (!this.worker) throw new Error(\"missing worker initialization\");\n    this.blob = null;\n    if (this.blobURL) URL.revokeObjectURL(this.blobURL);\n    this.blobURL = null;\n    this.resolve = null;\n    this.reject = null;\n    this.worker.postMessage({type: \"start\", data: this.audioCtx.sampleRate});\n    this.encNode.onaudioprocess = (e) => {\n      const samples = e.inputBuffer.getChannelData(0);\n      this.worker.postMessage({type: \"data\", data: samples});\n    };\n    this.encNode.connect(this.audioCtx.destination);\n  }\n\n  stopRecording() {\n    if (!this.stream) throw new Error(\"missing audio initialization\");\n    if (!this.worker) throw new Error(\"missing worker initialization\");\n    this.encNode.disconnect();\n    this.encNode.onaudioprocess = null;\n    this.stopTracks();\n    this.worker.postMessage({type: \"stop\", data: null});\n    return new Promise((resolve, reject) => {\n      this.resolve = resolve;\n      this.reject = reject;\n    });\n  }\n\n  stopTracks() {\n    // Might be missed in Safari and old FF/Chrome per MDN.\n    if (this.stream.getTracks) {\n      // Hide browser's recording indicator.\n      this.stream.getTracks().forEach((track) => track.stop());\n    }\n  }\n}\n\nexport class Form {\n  constructor(opts = {}, resolve, reject) {\n    this.recorder = new Recorder(opts, this.onStop.bind(this));\n    this.resolve = resolve;\n    this.reject = reject;\n    this.backdrop = null;\n    this.popup = null;\n    this.recordBtn = null;\n    this.stopBtn = null;\n    this.timer = null;\n    this.audio = null;\n    this.saveBtn = null;\n    this.tid = 0;\n    this.start = 0;\n    Object.seal(this);\n\n    this.recorder.initAudio()\n      .then(() => this.drawInit())\n      .then(() => this.recorder.initWorker())\n      .then(() => this.drawAll())\n      .catch((err) => this.drawError(err));\n  }\n\n  drawInit() {\n    if (this.backdrop) return;\n    const backdrop = this.backdrop = document.createElement(\"div\");\n    backdrop.className = \"vmsg-backdrop\";\n    backdrop.addEventListener(\"click\", () => this.close(null));\n\n    const popup = this.popup = document.createElement(\"div\");\n    popup.className = \"vmsg-popup\";\n    popup.addEventListener(\"click\", (e) => e.stopPropagation());\n\n    const progress = document.createElement(\"div\");\n    progress.className = \"vmsg-progress\";\n    for (let i = 0; i < 3; i++) {\n      const progressDot = document.createElement(\"div\");\n      progressDot.className = \"vmsg-progress-dot\";\n      progress.appendChild(progressDot);\n    }\n    popup.appendChild(progress);\n\n    backdrop.appendChild(popup);\n    document.body.appendChild(backdrop);\n  }\n\n  drawTime(msecs) {\n    const secs = Math.round(msecs / 1000);\n    this.timer.textContent = pad2(secs / 60) + \":\" + pad2(secs % 60);\n  }\n\n  drawAll() {\n    this.drawInit();\n    this.clearAll();\n\n    const recordRow = document.createElement(\"div\");\n    recordRow.className = \"vmsg-record-row\";\n    this.popup.appendChild(recordRow);\n\n    const recordBtn = this.recordBtn = document.createElement(\"button\");\n    recordBtn.className = \"vmsg-button vmsg-record-button\";\n    recordBtn.textContent = \"●\";\n    recordBtn.addEventListener(\"click\", () => this.startRecording());\n    recordRow.appendChild(recordBtn);\n\n    const stopBtn = this.stopBtn = document.createElement(\"button\");\n    stopBtn.className = \"vmsg-button vmsg-stop-button\";\n    stopBtn.style.display = \"none\";\n    stopBtn.textContent = \"■\";\n    stopBtn.addEventListener(\"click\", () => this.stopRecording());\n    recordRow.appendChild(stopBtn);\n\n    const audio = this.audio = new Audio();\n    audio.autoplay = true;\n\n    const timer = this.timer = document.createElement(\"span\");\n    timer.className = \"vmsg-timer\";\n    timer.addEventListener(\"click\", () => {\n      if (audio.paused) {\n        if (this.recorder.blobURL) {\n          audio.src = this.recorder.blobURL;\n        }\n      } else {\n        audio.pause();\n      }\n    });\n    this.drawTime(0);\n    recordRow.appendChild(timer);\n\n    const saveBtn = this.saveBtn = document.createElement(\"button\");\n    saveBtn.className = \"vmsg-button vmsg-save-button\";\n    saveBtn.textContent = \"✓\";\n    saveBtn.disabled = true;\n    saveBtn.addEventListener(\"click\", () => this.close(this.recorder.blob));\n    recordRow.appendChild(saveBtn);\n\n    const gainWrapper = document.createElement(\"div\");\n    gainWrapper.className = \"vmsg-slider-wrapper vmsg-gain-slider-wrapper\";\n    const gainSlider = document.createElement(\"input\");\n    gainSlider.className = \"vmsg-slider vmsg-gain-slider\";\n    gainSlider.setAttribute(\"type\", \"range\");\n    gainSlider.min = 0;\n    gainSlider.max = 2;\n    gainSlider.step = 0.2;\n    gainSlider.value = 1;\n    gainSlider.onchange = () => {\n      const gain = +gainSlider.value;\n      this.recorder.gainNode.gain.value = gain;\n    };\n    gainWrapper.appendChild(gainSlider);\n    this.popup.appendChild(gainWrapper);\n\n    const pitchWrapper = document.createElement(\"div\");\n    pitchWrapper.className = \"vmsg-slider-wrapper vmsg-pitch-slider-wrapper\";\n    const pitchSlider = document.createElement(\"input\");\n    pitchSlider.className = \"vmsg-slider vmsg-pitch-slider\";\n    pitchSlider.setAttribute(\"type\", \"range\");\n    pitchSlider.min = -1;\n    pitchSlider.max = 1;\n    pitchSlider.step = 0.2;\n    pitchSlider.value = this.recorder.pitch;\n    pitchSlider.onchange = () => {\n      const pitch = +pitchSlider.value;\n      this.recorder.pitchFX.setPitchOffset(pitch);\n      this.recorder.gainNode.disconnect();\n      this.recorder.gainNode.connect(\n        pitch === 0 ? this.recorder.encNode : this.recorder.pitchFX.input\n      );\n    };\n    pitchWrapper.appendChild(pitchSlider);\n    this.popup.appendChild(pitchWrapper);\n  }\n\n  drawError(err) {\n    console.error(err);\n    this.drawInit();\n    this.clearAll();\n    const error = document.createElement(\"div\");\n    error.className = \"vmsg-error\";\n    error.textContent = err.toString();\n    this.popup.appendChild(error);\n  }\n\n  clearAll() {\n    if (!this.popup) return;\n    this.popup.innerHTML = \"\";\n  }\n\n  close(blob) {\n    if (this.audio) this.audio.pause();\n    if (this.tid) clearTimeout(this.tid);\n    this.recorder.close();\n    this.backdrop.remove();\n    if (blob) {\n      this.resolve(blob);\n    } else {\n      this.reject(new Error(\"No record made\"));\n    }\n  }\n\n  onStop() {\n    this.recordBtn.style.display = \"\";\n    this.stopBtn.style.display = \"none\";\n    this.stopBtn.disabled = false;\n    this.saveBtn.disabled = false;\n  }\n\n  startRecording() {\n    this.audio.pause();\n    this.start = Date.now();\n    this.updateTime();\n    this.recordBtn.style.display = \"none\";\n    this.stopBtn.style.display = \"\";\n    this.saveBtn.disabled = true;\n    this.recorder.startRecording();\n  }\n\n  stopRecording() {\n    clearTimeout(this.tid);\n    this.tid = 0;\n    this.stopBtn.disabled = true;\n    this.recorder.stopRecording();\n  }\n\n  updateTime() {\n    // NOTE(Kagami): We can do this in `onaudioprocess` but that would\n    // run too often and create unnecessary DOM updates.\n    this.drawTime(Date.now() - this.start);\n    this.tid = setTimeout(() => this.updateTime(), 300);\n  }\n}\n\nlet shown = false;\n\n/**\n * Record a new voice message.\n *\n * @param {Object=} opts - Options\n * @param {string=} opts.wasmURL - URL of the module\n *                                 (\"/static/js/vmsg.wasm\" by default)\n * @param {string=} opts.shimURL - URL of the WebAssembly polyfill\n *                                 (\"/static/js/wasm-polyfill.js\" by default)\n * @param {number=} opts.pitch - Initial pitch shift ([-1, 1], 0 by default)\n * @return {Promise.<Blob>} A promise that contains recorded blob when fulfilled.\n */\nexport function record(opts) {\n  return new Promise((resolve, reject) => {\n    if (shown) throw new Error(\"Record form is already opened\");\n    shown = true;\n    new Form(opts, resolve, reject);\n  // Use `.finally` once it's available in Safari and Edge.\n  }).then(result => {\n    shown = false;\n    return result;\n  }, err => {\n    shown = false;\n    throw err;\n  });\n}\n\n/**\n * All available public items.\n */\nexport default { Recorder, Form, record };\n\n// Borrowed from and slightly modified:\n// https://github.com/cwilso/Audio-Input-Effects/blob/master/js/jungle.js\n\n// Copyright 2012, Google Inc.\n// All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nconst delayTime = 0.100;\nconst fadeTime = 0.050;\nconst bufferTime = 0.100;\n\nfunction createFadeBuffer(context, activeTime, fadeTime) {\n  var length1 = activeTime * context.sampleRate;\n  var length2 = (activeTime - 2*fadeTime) * context.sampleRate;\n  var length = length1 + length2;\n  var buffer = context.createBuffer(1, length, context.sampleRate);\n  var p = buffer.getChannelData(0);\n\n  var fadeLength = fadeTime * context.sampleRate;\n\n  var fadeIndex1 = fadeLength;\n  var fadeIndex2 = length1 - fadeLength;\n\n  // 1st part of cycle\n  for (var i = 0; i < length1; ++i) {\n    var value;\n\n    if (i < fadeIndex1) {\n        value = Math.sqrt(i / fadeLength);\n    } else if (i >= fadeIndex2) {\n        value = Math.sqrt(1 - (i - fadeIndex2) / fadeLength);\n    } else {\n        value = 1;\n    }\n\n    p[i] = value;\n  }\n\n  // 2nd part\n  for (var i = length1; i < length; ++i) {\n    p[i] = 0;\n  }\n\n  return buffer;\n}\n\nfunction createDelayTimeBuffer(context, activeTime, fadeTime, shiftUp) {\n  var length1 = activeTime * context.sampleRate;\n  var length2 = (activeTime - 2*fadeTime) * context.sampleRate;\n  var length = length1 + length2;\n  var buffer = context.createBuffer(1, length, context.sampleRate);\n  var p = buffer.getChannelData(0);\n\n  // 1st part of cycle\n  for (var i = 0; i < length1; ++i) {\n    if (shiftUp)\n      // This line does shift-up transpose\n      p[i] = (length1-i)/length;\n    else\n      // This line does shift-down transpose\n      p[i] = i / length1;\n  }\n\n  // 2nd part\n  for (var i = length1; i < length; ++i) {\n    p[i] = 0;\n  }\n\n  return buffer;\n}\n\nfunction Jungle(context) {\n  this.context = context;\n  // Create nodes for the input and output of this \"module\".\n  var input = (context.createGain || context.createGainNode).call(context);\n  var output = (context.createGain || context.createGainNode).call(context);\n  this.input = input;\n  this.output = output;\n\n  // Delay modulation.\n  var mod1 = context.createBufferSource();\n  var mod2 = context.createBufferSource();\n  var mod3 = context.createBufferSource();\n  var mod4 = context.createBufferSource();\n  this.shiftDownBuffer = createDelayTimeBuffer(context, bufferTime, fadeTime, false);\n  this.shiftUpBuffer = createDelayTimeBuffer(context, bufferTime, fadeTime, true);\n  mod1.buffer = this.shiftDownBuffer;\n  mod2.buffer = this.shiftDownBuffer;\n  mod3.buffer = this.shiftUpBuffer;\n  mod4.buffer = this.shiftUpBuffer;\n  mod1.loop = true;\n  mod2.loop = true;\n  mod3.loop = true;\n  mod4.loop = true;\n\n  // for switching between oct-up and oct-down\n  var mod1Gain = (context.createGain || context.createGainNode).call(context);\n  var mod2Gain = (context.createGain || context.createGainNode).call(context);\n  var mod3Gain = (context.createGain || context.createGainNode).call(context);\n  mod3Gain.gain.value = 0;\n  var mod4Gain = (context.createGain || context.createGainNode).call(context);\n  mod4Gain.gain.value = 0;\n\n  mod1.connect(mod1Gain);\n  mod2.connect(mod2Gain);\n  mod3.connect(mod3Gain);\n  mod4.connect(mod4Gain);\n\n  // Delay amount for changing pitch.\n  var modGain1 = (context.createGain || context.createGainNode).call(context);\n  var modGain2 = (context.createGain || context.createGainNode).call(context);\n\n  var delay1 = (context.createDelay || context.createDelayNode).call(context);\n  var delay2 = (context.createDelay || context.createDelayNode).call(context);\n  mod1Gain.connect(modGain1);\n  mod2Gain.connect(modGain2);\n  mod3Gain.connect(modGain1);\n  mod4Gain.connect(modGain2);\n  modGain1.connect(delay1.delayTime);\n  modGain2.connect(delay2.delayTime);\n\n  // Crossfading.\n  var fade1 = context.createBufferSource();\n  var fade2 = context.createBufferSource();\n  var fadeBuffer = createFadeBuffer(context, bufferTime, fadeTime);\n  fade1.buffer = fadeBuffer\n  fade2.buffer = fadeBuffer;\n  fade1.loop = true;\n  fade2.loop = true;\n\n  var mix1 = (context.createGain || context.createGainNode).call(context);\n  var mix2 = (context.createGain || context.createGainNode).call(context);\n  mix1.gain.value = 0;\n  mix2.gain.value = 0;\n\n  fade1.connect(mix1.gain);\n  fade2.connect(mix2.gain);\n\n  // Connect processing graph.\n  input.connect(delay1);\n  input.connect(delay2);\n  delay1.connect(mix1);\n  delay2.connect(mix2);\n  mix1.connect(output);\n  mix2.connect(output);\n\n  // Start\n  var t = context.currentTime + 0.050;\n  var t2 = t + bufferTime - fadeTime;\n  mod1.start(t);\n  mod2.start(t2);\n  mod3.start(t);\n  mod4.start(t2);\n  fade1.start(t);\n  fade2.start(t2);\n\n  this.mod1 = mod1;\n  this.mod2 = mod2;\n  this.mod1Gain = mod1Gain;\n  this.mod2Gain = mod2Gain;\n  this.mod3Gain = mod3Gain;\n  this.mod4Gain = mod4Gain;\n  this.modGain1 = modGain1;\n  this.modGain2 = modGain2;\n  this.fade1 = fade1;\n  this.fade2 = fade2;\n  this.mix1 = mix1;\n  this.mix2 = mix2;\n  this.delay1 = delay1;\n  this.delay2 = delay2;\n\n  this.setDelay(delayTime);\n}\n\nJungle.prototype.setDelay = function(delayTime) {\n  this.modGain1.gain.setTargetAtTime(0.5*delayTime, 0, 0.010);\n  this.modGain2.gain.setTargetAtTime(0.5*delayTime, 0, 0.010);\n};\n\nJungle.prototype.setPitchOffset = function(mult) {\n  if (mult>0) { // pitch up\n    this.mod1Gain.gain.value = 0;\n    this.mod2Gain.gain.value = 0;\n    this.mod3Gain.gain.value = 1;\n    this.mod4Gain.gain.value = 1;\n  } else { // pitch down\n    this.mod1Gain.gain.value = 1;\n    this.mod2Gain.gain.value = 1;\n    this.mod3Gain.gain.value = 0;\n    this.mod4Gain.gain.value = 0;\n  }\n  this.setDelay(delayTime*Math.abs(mult));\n};\n","import React, { PureComponent } from 'react';\nimport vmsg from \"vmsg\";\nimport { withTranslation } from 'react-i18next';\n\nconst recorder = new vmsg.Recorder({\n    wasmURL: window.lhcChat['staticJS']['chunk_js']+ \"/\" + 'vmsg.8c4a15f2.wasm',\n    shimURL: \"https://unpkg.com/wasm-polyfill.js@0.2.0/wasm-polyfill.js\"\n});\n\nclass VoiceMessage extends PureComponent {\n\n    state = {\n        isLoading: false,\n        isRecording: false,\n        isPlaying: false,\n        recording: null,\n        audioDuration: 0,\n        currentTime: 0\n    };\n\n    constructor(props) {\n        super(props);\n        this.startRecording = this.startRecording.bind(this);\n        this.stopRecording = this.stopRecording.bind(this);\n        this.playRecord = this.playRecord.bind(this);\n        this.stopPlayRecord = this.stopPlayRecord.bind(this);\n        this.sendRecord = this.sendRecord.bind(this);\n\n        // Intervals\n        this.durationInterval = null;\n        this.playInterval = null;\n    }\n\n    async startRecording() {\n        this.stopPlayRecord();\n        this.setState({ isLoading: true, audioDuration : 0, recording: null, isPlaying: false, currentTime : 0});\n        try {\n            await recorder.initAudio();\n            await recorder.initWorker();\n            recorder.startRecording();\n            this.setState({ isLoading: false, isRecording: true });\n            this.durationInterval = setInterval(() => {\n                this.setState({ audioDuration: this.state.audioDuration + 1 });\n\n                // Do not allow to record longer message than defined messages length.\n                if (this.state.audioDuration >= this.props.maxSeconds) {\n                    this.stopRecording();\n                }\n\n            }, 1000);\n        } catch (e) {\n            alert('Sorry but voice messages are not supported on your browser!');\n            this.setState({ isLoading: false });\n        }\n    }\n\n    async stopRecording(){\n        const blob = await recorder.stopRecording();\n\n        this.audio = new Audio();\n        this.audio.src = URL.createObjectURL(blob);\n\n        this.setState({\n            isLoading: false,\n            isRecording: false,\n            recording: blob\n        });\n\n        clearInterval(this.durationInterval);\n    }\n\n    playRecord() {\n        this.audio.currentTime = 0;\n        this.audio.play();\n        this.setState({isPlaying : true});\n\n        this.playInterval = setInterval(\n            () => {\n                this.setState({currentTime: Math.round(this.audio.currentTime)});\n                if (this.audio.ended || this.audio.paused) {\n                    this.stopPlayRecord();\n                }\n            },\n        1000);\n    }\n\n    stopPlayRecord() {\n        if (this.state.isPlaying) {\n            clearInterval(this.playInterval);\n            this.audio.currentTime = 0;\n            this.audio.pause();\n            this.setState({isPlaying : false, currentTime: 0});\n        }\n    }\n\n    sendRecord() {\n        const { t } = this.props;\n\n        this.props.progress(t('file.uploading'));\n\n        const req = new XMLHttpRequest();\n        const formData = new FormData();\n        formData.append(\"files\", this.state.recording, \"record.mp3\");\n        req.open(\"POST\", this.props.base_url + '/file/uploadfile/' + this.props.chat_id + '/' + this.props.hash);\n        req.upload.addEventListener(\"load\", event => {\n            this.props.progress('100%');\n            this.props.onCompletion();\n            this.props.cancel();\n        });\n        req.send(formData);\n    }\n\n    componentDidMount() {\n\n    }\n\n    componentWillUnmount() {\n\n        // Stop playing if anything is playing\n        this.stopPlayRecord();\n\n        // Stop recordng if it's recording\n        if (this.state.isRecording) {\n            recorder.stopRecording();\n        }\n    }\n\n    pad(n) {\n        return (n < 10) ? (\"0\" + n) : n;\n    }\n\n    render() {\n\n        const {isLoading, isRecording, recording, isPlaying } = this.state;\n\n        const { t } = this.props;\n\n        return <div className=\"text-nowrap\">\n            <i className=\"material-icons pointer text-danger fs25\" title={t('voice.cancel_voice_message')} onClick={() => this.props.cancel()}>&#xf10a;</i>\n\n            {!isRecording && <i className=\"material-icons fs25 pointer text-danger mr-0\" title={t('voice.record_voice_message')} onClick={this.startRecording}>&#xf10f;</i>}\n\n            {isRecording && <i className=\"material-icons fs25 pointer text-danger mr-0\" title={t('voice.stop_recording')} onClick={this.stopRecording}>&#xf112;</i>}\n\n            {recording && isPlaying === false && <i className=\"material-icons pointer text-success mr-0 fs25\" title={t('voice.play_recorded')} onClick={this.playRecord}>&#xf111;</i>}\n\n            {recording && isPlaying === true && <i className=\"material-icons pointer text-success mr-0 fs25\" title={t('voice.stop_playing_recorded')} onClick={this.stopPlayRecord}>&#xf112;</i>}\n\n            <span className=\"fs12 px-1\">{isRecording ? '' : (isPlaying ? this.pad(this.state.currentTime) + ':' : '')}{isRecording || !recording ? (this.props.maxSeconds - this.state.audioDuration) + \" s.\" : this.pad(this.state.audioDuration) + (!isPlaying ? 's.' : '')}</span>\n\n            {recording && <i className=\"material-icons pointer text-success mr-0 fs25\" title={t('voice.send')} onClick={this.sendRecord}>&#xf107;</i>}\n\n        </div>;\n    }\n}\n\nexport default withTranslation()(VoiceMessage);"],"sourceRoot":""}
    \ No newline at end of file
    
  • lhc_web/design/defaulttheme/js/widgetv2/7.24e095ac1eddde957959.ie.js+0 2 removed
    @@ -1,2 +0,0 @@
    -(window.webpackJsonpLHCReactAPP=window.webpackJsonpLHCReactAPP||[]).push([[7],{481:function(t,e,a){"use strict";a.r(e),a.d(e,"nodeJSChat",(function(){return d}));var n=a(6),i=a.n(n),s=a(7),c=a.n(s),h=a(2),o=a(5),d=new(function(){function t(){var e=this;i()(this,t),this.socket=null,h.a.eventEmitter.addListener("endedChat",(function(){null!==e.socket&&e.socket.destroy()}))}return c()(t,[{key:"bootstrap",value:function(t,e,n){var i=n(),s=i.chatwidget.getIn(["chatData","id"]),c=(i.chatwidget.getIn(["chatData","hash"]),i.chatwidget.getIn(["chat_ui","sync_interval"])),d={hostname:t.hostname,path:t.path,autoReconnectOptions:{initialDelay:5e3,randomness:5e3}};""!=t.port&&(d.port=parseInt(t.port)),1==t.secure&&(d.secure=!0),t.instance_id>0&&t.instance_id;var r=a(490),g=this.socket=r.connect(d),_=null;function l(e){1==e.status?t.instance_id>0?g.publish("chat_"+t.instance_id+"_"+s,{op:"vt",msg:e.msg}):g.publish("chat_"+s,{op:"vt",msg:e.msg}):t.instance_id>0?g.publish("chat_"+t.instance_id+"_"+s,{op:"vts"}):g.publish("chat_"+s,{op:"vts"})}function u(e){t.instance_id>0?g.publish("chat_"+t.instance_id+"_"+s,{op:"vt",msg:"✉️ "+e.msg}):g.publish("chat_"+s,{op:"vt",msg:"✉️ "+e.msg})}function p(e){t.instance_id>0?g.publish("chat_"+t.instance_id+"_"+s,{op:"vt",msg:"📕️ error happened while sending visitor message, please inform your administrator!"}):g.publish("chat_"+s,{op:"vt",msg:"📕️ error happened while sending visitor message, please inform your administrator!"})}function m(){if(null!==_)try{_.destroy()}catch(t){}h.a.eventEmitter.removeListener("visitorTyping",l),h.a.eventEmitter.removeListener("messageSend",u),h.a.eventEmitter.removeListener("messageSendError",p),e({type:"CHAT_UI_UPDATE",data:{sync_interval:c}}),e({type:"CHAT_REMOVE_OVERRIDE",data:"typing"})}function w(){(_=t.instance_id>0?g.subscribe("chat_"+t.instance_id+"_"+s):g.subscribe("chat_"+s)).on("subscribeFail",(function(t){console.error("Failed to subscribe to the sample channel due to error: "+t)})),_.on("subscribe",(function(){g.publish(t.instance_id>0?"chat_"+t.instance_id+"_"+s:"chat_"+s,{op:"vi_online",status:!0})})),_.watch((function(a){if("ot"==a.op)1==a.data.status?e({type:"chat_status_changed",data:{text:a.data.ttx}}):e({type:"chat_status_changed",data:{text:""}});else if("cmsg"==a.op||"schange"==a.op){var i=n();i.chatwidget.hasIn(["chatData","id"])&&e(Object(o.d)({chat_id:i.chatwidget.getIn(["chatData","id"]),hash:i.chatwidget.getIn(["chatData","hash"]),lmgsid:i.chatwidget.getIn(["chatLiveData","lmsgid"]),theme:i.chatwidget.get("theme")}))}else if("umsg"==a.op){var s=n();s.chatwidget.hasIn(["chatData","id"])&&Object(o.s)({msg_id:a.msid,id:s.chatwidget.getIn(["chatData","id"]),hash:s.chatwidget.getIn(["chatData","hash"])})(e,n)}else if("schange"==a.op||"cclose"==a.op){var c=n();c.chatwidget.hasIn(["chatData","id"])&&e(Object(o.b)({chat_id:c.chatwidget.getIn(["chatData","id"]),hash:c.chatwidget.getIn(["chatData","hash"]),mode:c.chatwidget.get("mode"),theme:c.chatwidget.get("theme")}))}else if("vo"==a.op){var h=n();h.chatwidget.hasIn(["chatData","id"])&&g.publish(t.instance_id>0?"chat_"+t.instance_id+"_"+h.chatwidget.getIn(["chatData","id"]):"chat_"+h.chatwidget.getIn(["chatData","id"]),{op:"vi_online",status:!0})}})),h.a.eventEmitter.addListener("visitorTyping",l),h.a.eventEmitter.addListener("messageSend",u),h.a.eventEmitter.addListener("messageSendError",p),e({type:"CHAT_UI_UPDATE",data:{sync_interval:1e4}}),e({type:"CHAT_ADD_OVERRIDE",data:"typing"})}g.on("error",(function(t){console.error(t)})),g.on("close",(function(){m()})),g.on("deauthenticate",(function(){var e=n(),a=e.chatwidget.getIn(["chatData","id"]);window.lhcAxios.post(window.lhcChat.base_url+"nodejshelper/tokenvisitor/"+a+"/"+e.chatwidget.getIn(["chatData","hash"]),null,{headers:{"Content-Type":"application/x-www-form-urlencoded"}}).then((function(e){g.emit("login",{hash:e.data,chanelName:t.instance_id>0?"chat_"+t.instance_id+"_"+a:"chat_"+a},(function(t){t&&(console.log(t),m())}))}))})),g.on("connect",(function(e){if(e.isAuthenticated&&s>0)w();else{var a=n(),i=a.chatwidget.getIn(["chatData","id"]);window.lhcAxios.post(window.lhcChat.base_url+"nodejshelper/tokenvisitor/"+i+"/"+a.chatwidget.getIn(["chatData","hash"]),null,{headers:{"Content-Type":"application/x-www-form-urlencoded"}}).then((function(e){g.emit("login",{hash:e.data,chanelName:t.instance_id>0?"chat_"+t.instance_id+"_"+i:"chat_"+i},(function(t){t?(console.log(t),g.destroy()):w()}))}))}}))}}]),t}())}}]);
    -//# sourceMappingURL=7.24e095ac1eddde957959.ie.js.map
    \ No newline at end of file
    
  • lhc_web/design/defaulttheme/js/widgetv2/7.24e095ac1eddde957959.ie.js.map+0 1 removed
    @@ -1 +0,0 @@
    -{"version":3,"sources":["webpack://LHCReactAPP/./src/extensions/nodejs/nodeJSChat.js"],"names":["nodeJSChat","this","socket","helperFunctions","eventEmitter","addListener","destroy","params","dispatch","getState","state","chatId","chatwidget","getIn","syncDefault","socketOptions","hostname","path","autoReconnectOptions","initialDelay","randomness","port","parseInt","secure","instance_id","socketCluster","require","connect","sampleChannel","visitorTypingListener","data","status","publish","msg","messageSend","messageSendError","disconnect","e","removeListener","sync_interval","connectVisitor","subscribe","on","err","console","error","watch","op","text","ttx","hasIn","fetchMessages","get","updateMessage","msid","checkChatStatus","chat_id","window","lhcAxios","post","lhcChat","headers","then","response","emit","hash","chanelName","log","isAuthenticated"],"mappings":"o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WACfN,OA+EJlC,EAAOwC,GAAG,kBAAkB,WACxB,IAAMhC,EAAQD,IACV+C,EAAU9C,EAAME,WAAWC,MAAM,CAAC,WAAW,OACjD4C,OAAOC,SAASC,KAAKF,OAAOG,QAAP,SAA6B,6BAA6BJ,EAAQ,IAAI9C,EAAME,WAAWC,MAAM,CAAC,WAAW,SAAU,KAAM,CAACgD,QAAU,CAAC,eAAgB,uCAAuCC,MAAK,SAACC,GACnN7D,EAAO8D,KAAK,QAAS,CAACC,KAAKF,EAASjC,KAAMoC,WAAa3D,EAAOiB,YAAc,EAAK,QAAQjB,EAAOiB,YAAY,IAAIgC,EAAY,QAAQA,IAAa,SAAUb,GACnJA,IACAC,QAAQuB,IAAIxB,GACZP,cAMhBlC,EAAOwC,GAAG,WAAW,SAAUX,GAC3B,GAAIA,EAAOqC,iBAAmBzD,EAAS,EACnC6B,QACG,CACH,IAAM9B,EAAQD,IACV+C,EAAU9C,EAAME,WAAWC,MAAM,CAAC,WAAW,OACjD4C,OAAOC,SAASC,KAAKF,OAAOG,QAAP,SAA6B,6BAA6BJ,EAAQ,IAAI9C,EAAME,WAAWC,MAAM,CAAC,WAAW,SAAU,KAAM,CAACgD,QAAU,CAAC,eAAgB,uCAAuCC,MAAK,SAACC,GACnN7D,EAAO8D,KAAK,QAAS,CAACC,KAAMF,EAASjC,KAAMoC,WAAa3D,EAAOiB,YAAc,EAAK,QAAQjB,EAAOiB,YAAY,IAAIgC,EAAY,QAAQA,IAAa,SAAUb,GACpJA,GACAC,QAAQuB,IAAIxB,GACZzC,EAAOI,WAEPkC,kB","file":"7.24e095ac1eddde957959.ie.js","sourcesContent":["import { helperFunctions } from \"../../lib/helperFunctions\";\nimport { fetchMessages, checkChatStatus, updateMessage } from \"../../actions/chatActions\"\n\nclass _nodeJSChat {\n    constructor() {\n        this.socket = null;\n\n        // On chat close event close connection\n        helperFunctions.eventEmitter.addListener('endedChat', () => {\n            if (this.socket !== null) {\n                this.socket.destroy();\n            }\n        });\n    }\n\n    bootstrap(params, dispatch, getState) {\n\n        const state = getState();\n        const chatId = state.chatwidget.getIn(['chatData','id']);\n        const chatHash = state.chatwidget.getIn(['chatData','hash']);\n        const syncDefault = state.chatwidget.getIn(['chat_ui','sync_interval']);\n\n        var socketOptions = {\n            hostname: params.hostname,\n            path: params.path,\n            autoReconnectOptions: {initialDelay: 5000, randomness: 5000}\n        }\n\n        if (params.port != '') {\n            socketOptions.port = parseInt(params.port);\n        }\n\n        if (params.secure == 1) {\n            socketOptions.secure = true;\n        }\n\n        var chanelName;\n\n        if (params.instance_id > 0) {\n            chanelName = ('chat_'+params.instance_id+'_'+chatId);\n        } else{\n            chanelName = ('chat_'+chatId);\n        }\n\n        var socketCluster = require('socketcluster-client');\n\n        var socket = this.socket = socketCluster.connect(socketOptions);\n        \n        var sampleChannel = null;\n        \n        socket.on('error', function (err) {\n            console.error(err);\n        });\n\n       function visitorTypingListener(data)\n       {\n            if (data.status == true){\n                if (params.instance_id > 0) {\n                    socket.publish('chat_'+params.instance_id+'_'+chatId,{'op':'vt','msg':data.msg});\n                } else {\n                    socket.publish('chat_'+chatId,{'op':'vt','msg':data.msg});\n                }\n            } else {\n                if (params.instance_id > 0) {\n                    socket.publish('chat_'+params.instance_id+'_'+chatId,{'op':'vts'});\n                } else {\n                    socket.publish('chat_'+chatId,{'op':'vts'});\n                }\n            }\n       }\n\n       function messageSend(data)\n       {\n            if (params.instance_id > 0) {\n                socket.publish('chat_'+params.instance_id+'_'+chatId, {'op':'vt','msg':'✉️ ' + data.msg});\n            } else {\n                socket.publish('chat_'+chatId,{'op':'vt', 'msg':'✉️ ' + data.msg});\n            }\n        }\n\n       function messageSendError(data)\n       {\n            if (params.instance_id > 0) {\n                socket.publish('chat_'+params.instance_id+'_'+chatId,{'op':'vt','msg':'📕️ error happened while sending visitor message, please inform your administrator!'});\n            } else {\n                socket.publish('chat_'+chatId, {'op':'vt','msg':'📕️ error happened while sending visitor message, please inform your administrator!'});\n            }\n        }\n\n        function disconnect() {\n            if (sampleChannel !== null) {\n                try {\n                    sampleChannel.destroy();\n                } catch (e) {\n\n                }\n            }\n\n            helperFunctions.eventEmitter.removeListener('visitorTyping', visitorTypingListener);\n            helperFunctions.eventEmitter.removeListener('messageSend', messageSend);\n            helperFunctions.eventEmitter.removeListener('messageSendError', messageSendError);\n\n            dispatch({\n                'type': 'CHAT_UI_UPDATE',\n                'data': {sync_interval: syncDefault}\n            });\n\n            dispatch({\n                'type': 'CHAT_REMOVE_OVERRIDE',\n                'data': \"typing\"\n            });\n        }\n\n        socket.on('close', function() {\n            disconnect();\n        });\n\n        function connectVisitor(){\n            if (params.instance_id > 0) {\n                sampleChannel = socket.subscribe('chat_'+params.instance_id+'_'+chatId);\n            } else {\n                sampleChannel = socket.subscribe('chat_' + chatId);\n            }\n\n            sampleChannel.on('subscribeFail', function (err) {\n                console.error('Failed to subscribe to the sample channel due to error: ' + err);\n            });\n\n            sampleChannel.on('subscribe', function () {\n                socket.publish((params.instance_id > 0 ? 'chat_'+params.instance_id+'_'+chatId : 'chat_'+chatId), {'op':'vi_online', status: true});\n            });\n\n            sampleChannel.watch(function (op) {\n                if (op.op == 'ot') { // Operator Typing Message\n                    if (op.data.status == true) {\n                        dispatch({\n                            'type': 'chat_status_changed',\n                            'data': {text: op.data.ttx}\n                        });\n                    } else {\n                        dispatch({\n                            'type': 'chat_status_changed',\n                            'data': {text: ''}\n                        });\n                    }\n                } else if (op.op == 'cmsg' || op.op == 'schange') {\n                    const state = getState();\n                    if (state.chatwidget.hasIn(['chatData','id'])){\n                        dispatch(fetchMessages({\n                            'chat_id': state.chatwidget.getIn(['chatData','id']),\n                            'hash' : state.chatwidget.getIn(['chatData','hash']),\n                            'lmgsid' : state.chatwidget.getIn(['chatLiveData','lmsgid']),\n                            'theme' : state.chatwidget.get('theme')\n                        }));\n                    }\n                } else if (op.op == 'umsg') {\n                    const state = getState();\n                    if (state.chatwidget.hasIn(['chatData','id'])) {\n                        updateMessage({'msg_id' :  op.msid,'id' : state.chatwidget.getIn(['chatData','id']), 'hash' : state.chatwidget.getIn(['chatData','hash'])})(dispatch, getState);\n                    }\n                } else if (op.op == 'schange' || op.op == 'cclose') {\n                    const state = getState();\n                    if (state.chatwidget.hasIn(['chatData','id'])){\n                        dispatch(checkChatStatus({\n                            'chat_id': state.chatwidget.getIn(['chatData','id']),\n                            'hash' : state.chatwidget.getIn(['chatData','hash']),\n                            'mode' : state.chatwidget.get('mode'),\n                            'theme' : state.chatwidget.get('theme')\n                        }));\n                    }\n                } else if (op.op == 'vo') {\n                    const state = getState();\n                    if (state.chatwidget.hasIn(['chatData','id'])) {\n                        socket.publish((params.instance_id > 0 ? 'chat_'+params.instance_id+'_'+state.chatwidget.getIn(['chatData','id']) : 'chat_'+state.chatwidget.getIn(['chatData','id'])) ,{'op':'vi_online', status: true});\n                    }\n                }\n            });\n\n            helperFunctions.eventEmitter.addListener('visitorTyping', visitorTypingListener);\n            helperFunctions.eventEmitter.addListener('messageSend', messageSend);\n            helperFunctions.eventEmitter.addListener('messageSendError', messageSendError);\n\n            dispatch({\n                'type': 'CHAT_UI_UPDATE',\n                'data': {sync_interval: 10000}\n            });\n\n            dispatch({\n                'type': 'CHAT_ADD_OVERRIDE',\n                'data': \"typing\"\n            });\n        }\n\n        socket.on('deauthenticate', function(){\n            const state = getState();\n            let chat_id = state.chatwidget.getIn(['chatData','id']);\n            window.lhcAxios.post(window.lhcChat['base_url'] + \"nodejshelper/tokenvisitor/\"+chat_id+\"/\"+state.chatwidget.getIn(['chatData','hash']), null, {headers : {'Content-Type': 'application/x-www-form-urlencoded'}}).then((response) => {\n                socket.emit('login', {hash:response.data, chanelName: (params.instance_id > 0 ? ('chat_'+params.instance_id+'_'+chat_id) : ('chat_'+chat_id)) }, function (err) {\n                    if (err) {\n                        console.log(err);\n                        disconnect();\n                    }\n                });\n            });\n        });\n\n        socket.on('connect', function (status) {\n            if (status.isAuthenticated && chatId > 0) {\n                connectVisitor();\n            } else {\n                const state = getState();\n                let chat_id = state.chatwidget.getIn(['chatData','id']);\n                window.lhcAxios.post(window.lhcChat['base_url'] + \"nodejshelper/tokenvisitor/\"+chat_id+\"/\"+state.chatwidget.getIn(['chatData','hash']), null, {headers : {'Content-Type': 'application/x-www-form-urlencoded'}}).then((response) => {\n                    socket.emit('login', {hash: response.data, chanelName: (params.instance_id > 0 ? ('chat_'+params.instance_id+'_'+chat_id) : ('chat_'+chat_id)) }, function (err) {\n                        if (err) {\n                            console.log(err);\n                            socket.destroy();\n                        } else {\n                            connectVisitor();\n                        }\n                    });\n                });\n            }\n        });\n    }\n}\n\nconst nodeJSChat = new _nodeJSChat();\nexport { nodeJSChat };"],"sourceRoot":""}
    \ No newline at end of file
    
  • lhc_web/design/defaulttheme/js/widgetv2/react.app.ie.js+0 66 removed
  • lhc_web/design/defaulttheme/js/widgetv2/react.app.ie.js.map+0 1 removed
  • lhc_web/design/defaulttheme/js/widgetv2/vendor.ie.js+0 0 removed
  • lhc_web/design/defaulttheme/tpl/lhchat/lists/open_active_chat_tab.tpl.php+4 4 modified
    @@ -6,9 +6,9 @@
                     <a class="dropdown-item" href="#" ng-click="lhc.appendActiveChats()" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('front/default', 'Open last 10 my active chats')?>"><i class="material-icons chat-active">chat</i> <?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('front/default', 'Open my active chats'); ?></a>
                     <a class="dropdown-item" href="#" ng-click="lhc.toggleWidget('track_open_chats')" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('front/default', 'Last 10 your active chats will be always visible')?>"><i class="material-icons" ng-class="{'chat-active': lhc.toggleWidgetData['track_open_chats'] === true, 'chat-closed': lhc.toggleWidgetData['track_open_chats'] !== true}">done</i> <?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('front/default', 'Keep my active chats'); ?></a>
                     <a class="dropdown-item" href="#" ng-click="lhc.toggleWidget('group_offline_chats')" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('front/default', 'Hide nicknames for offline chats')?>"><i class="material-icons" id="group-chats-status" ng-class="{'chat-active': lhc.toggleWidgetData['group_offline_chats'] === true, 'chat-closed': lhc.toggleWidgetData['group_offline_chats'] !== true}">done</i> <?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('front/default', 'Hide nicknames for offline chats'); ?></a>
    -                <a class="dropdown-item" href="<?php echo erLhcoreClassDesign::baseurl('front/settings')?>/(action)/reset" ><i class="material-icons">search_off</i><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('front/default', 'Reset widget filters'); ?></a>
    +                <a class="dropdown-item csfr-required" href="<?php echo erLhcoreClassDesign::baseurl('front/settings')?>/(action)/reset" ><i class="material-icons">search_off</i><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('front/default', 'Reset widget filters'); ?></a>
                     <?php if ($currentUser->hasAccessTo('lhfront','switch_dashboard')) : ?>
    -                <a class="dropdown-item" href="<?php echo erLhcoreClassDesign::baseurl('front/switchdashboard')?>" >
    +                <a class="dropdown-item csfr-required" href="<?php echo erLhcoreClassDesign::baseurl('front/switchdashboard')?>" >
                             <i class="material-icons">home</i>
                             <?php if ((int)erLhcoreClassModelUserSetting::getSetting('new_dashboard',1) == 1) : ?>
                                 <?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('front/default', 'Old dashboard'); ?>
    @@ -19,8 +19,8 @@
                     <?php endif; ?>
     
                     <?php if ((int)erLhcoreClassModelUserSetting::getSetting('new_dashboard',1) == 1) : ?>
    -                    <a class="dropdown-item" href="<?php echo erLhcoreClassDesign::baseurl('front/switchdashboard')?>/(action)/tabs"><i class="material-icons">chat</i> <?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('front/default', 'Hide/Show chat tabs'); ?></a>
    -                    <a class="dropdown-item" href="<?php echo erLhcoreClassDesign::baseurl('front/switchdashboard')?>/(action)/left_list"><i class="material-icons">widgets</i> <?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('front/default', 'Tabs/List in left column'); ?></a>
    +                    <a class="dropdown-item csfr-required" href="<?php echo erLhcoreClassDesign::baseurl('front/switchdashboard')?>/(action)/tabs"><i class="material-icons">chat</i> <?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('front/default', 'Hide/Show chat tabs'); ?></a>
    +                    <a class="dropdown-item csfr-required" href="<?php echo erLhcoreClassDesign::baseurl('front/switchdashboard')?>/(action)/left_list"><i class="material-icons">widgets</i> <?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('front/default', 'Tabs/List in left column'); ?></a>
                     <?php endif; ?>
                     <?php include(erLhcoreClassDesign::designtpl('lhchat/lists/open_active_chat_tab_multiinclude.tpl.php'));?>
                     <div class="dropdown-item">
    
  • lhc_web/design/defaulttheme/tpl/lhuser/setopstatus.tpl.php+2 0 modified
    @@ -20,6 +20,8 @@
     
                 <form action="<?php echo erLhcoreClassDesign::baseurl('user/setopstatus')?>/<?php echo $user->id ?>" method="post" onsubmit="return lhinst.submitModalForm($(this))">
     
    +                <?php include(erLhcoreClassDesign::designtpl('lhkernel/csfr_token.tpl.php'));?>
    +
                     <div class="form-group">
                         <p><b><?php echo htmlspecialchars($user->name_official);?></b> <?php echo  erTranslationClassLhTranslation::getInstance()->getTranslation('chat/dashboardwidgets','online status')?><br></p>
                         <label><input type="radio" name="onlineStatus" value="0" <?php $user->hide_online == 1 ? print 'checked="checked"' : ''?>> <?php echo  erTranslationClassLhTranslation::getInstance()->getTranslation('pagelayout/pagelayout','Offline')?></label><br>
    
  • lhc_web/design/defaulttheme/tpl/pagelayouts/parts/user_box.tpl.php+6 6 modified
    @@ -27,10 +27,10 @@
                     </div>
                 <?php endif; ?>
                 <div class="col-6">
    -                <a title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/user_settings','Toggle between dark and white themes');?>" href="<?php echo erLhcoreClassDesign::baseurl('front/switchdashboard')?>/(action)/mode" class="dropdown-item pl-2"><span class="material-icons">settings_brightness</span><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('pagelayout/pagelayout','Dark/bright');?></a>
    +                <a title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/user_settings','Toggle between dark and white themes');?>" href="<?php echo erLhcoreClassDesign::baseurl('front/switchdashboard')?>/(action)/mode" class="csfr-required dropdown-item pl-2"><span class="material-icons">settings_brightness</span><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('pagelayout/pagelayout','Dark/bright');?></a>
                 </div>
                 <div class="col-6">
    -                <a class="dropdown-item pl-2" onclick="$(this).attr('href',$(this).attr('href')+'/(csfr)/'+confLH.csrf_token)" href="<?php echo erLhcoreClassDesign::baseurl('user/logout')?>" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('pagelayout/pagelayout','Logout');?>"><i class="material-icons">exit_to_app</i><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('pagelayout/pagelayout','Logout');?></a>
    +                <a class="dropdown-item pl-2 csfr-required" href="<?php echo erLhcoreClassDesign::baseurl('user/logout')?>" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('pagelayout/pagelayout','Logout');?>"><i class="material-icons">exit_to_app</i><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('pagelayout/pagelayout','Logout');?></a>
                 </div>
             </div>
     
    @@ -76,16 +76,16 @@
             <?php if ($currentUser->hasAccessTo('lhchat','use') ) : ?>
                 <div class="row">
                     <div class="col-12">
    -                    <a href="<?php echo erLhcoreClassDesign::baseurl('user/setsetting')?>/auto_uppercase/<?php echo erLhcoreClassModelUserSetting::getSetting('auto_uppercase',1) == 0 ? 1 : 0?>" class="dropdown-item pl-2"><span class="material-icons"><?php erLhcoreClassModelUserSetting::getSetting('auto_uppercase',1) ? print 'check' : print 'remove_done'?></span><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('user/account','Auto uppercase sentences');?></a>
    +                    <a href="<?php echo erLhcoreClassDesign::baseurl('user/setsetting')?>/auto_uppercase/<?php echo erLhcoreClassModelUserSetting::getSetting('auto_uppercase',1) == 0 ? 1 : 0?>" class="csfr-required dropdown-item pl-2"><span class="material-icons"><?php erLhcoreClassModelUserSetting::getSetting('auto_uppercase',1) ? print 'check' : print 'remove_done'?></span><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('user/account','Auto uppercase sentences');?></a>
                     </div>
                     <div class="col-12">
    -                    <a href="<?php echo erLhcoreClassDesign::baseurl('user/setsetting')?>/no_scroll_bottom/<?php echo erLhcoreClassModelUserSetting::getSetting('no_scroll_bottom',0) == 0 ? 1 : 0?>" class="dropdown-item pl-2"><span class="material-icons"><?php erLhcoreClassModelUserSetting::getSetting('no_scroll_bottom',0) ? print 'check' : print 'remove_done'?></span><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('user/account','Do not scroll to the bottom on chat open');?></a>
    +                    <a href="<?php echo erLhcoreClassDesign::baseurl('user/setsetting')?>/no_scroll_bottom/<?php echo erLhcoreClassModelUserSetting::getSetting('no_scroll_bottom',0) == 0 ? 1 : 0?>" class="csfr-required dropdown-item pl-2"><span class="material-icons"><?php erLhcoreClassModelUserSetting::getSetting('no_scroll_bottom',0) ? print 'check' : print 'remove_done'?></span><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('user/account','Do not scroll to the bottom on chat open');?></a>
                     </div>
                     <div class="col-12">
    -                    <a href="<?php echo erLhcoreClassDesign::baseurl('user/setsetting')?>/auto_preload/<?php echo erLhcoreClassModelUserSetting::getSetting('auto_preload',0) == 0 ? 1 : 0?>" class="dropdown-item pl-2"><span class="material-icons"><?php erLhcoreClassModelUserSetting::getSetting('auto_preload',0) ? print 'check' : print 'remove_done'?></span><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('user/account','Auto preload previous visitor chat messages');?></a>
    +                    <a href="<?php echo erLhcoreClassDesign::baseurl('user/setsetting')?>/auto_preload/<?php echo erLhcoreClassModelUserSetting::getSetting('auto_preload',0) == 0 ? 1 : 0?>" class="csfr-required dropdown-item pl-2"><span class="material-icons"><?php erLhcoreClassModelUserSetting::getSetting('auto_preload',0) ? print 'check' : print 'remove_done'?></span><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('user/account','Auto preload previous visitor chat messages');?></a>
                     </div>
                     <div class="col-12">
    -                    <a href="<?php echo erLhcoreClassDesign::baseurl('user/setsetting')?>/scroll_load/<?php echo erLhcoreClassModelUserSetting::getSetting('scroll_load',1) == 0 ? 1 : 0?>" class="dropdown-item pl-2"><span class="material-icons"><?php erLhcoreClassModelUserSetting::getSetting('scroll_load',1) ? print 'check' : print 'remove_done'?></span><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('user/account','Load previous message on scroll');?></a>
    +                    <a href="<?php echo erLhcoreClassDesign::baseurl('user/setsetting')?>/scroll_load/<?php echo erLhcoreClassModelUserSetting::getSetting('scroll_load',1) == 0 ? 1 : 0?>" class="csfr-required dropdown-item pl-2"><span class="material-icons"><?php erLhcoreClassModelUserSetting::getSetting('scroll_load',1) ? print 'check' : print 'remove_done'?></span><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('user/account','Load previous message on scroll');?></a>
                     </div>
                     <div class="col-6">
                         <a href="#" class="dropdown-item pl-2" onclick="lhinst.disableChatSoundAdmin($(this));event.stopPropagation()" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/user_settings','Enable/Disable sound about new messages from users');?>"><i class="material-icons" ><?php $soundMessageEnabled == 0 ? print 'volume_off' : print 'volume_up'?></i><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('pagelayout/pagelayout','New messages');?></a>
    
  • lhc_web/modules/lhchat/dashboardwidgets.php+6 0 modified
    @@ -58,6 +58,12 @@
     erLhcoreClassChatEventDispatcher::getInstance()->dispatch('chat.dashboardwidgets',array('supported_widgets' => & $supportedWidgets));
     
     if (ezcInputForm::hasPostData()) {
    +
    +    if (!isset($_SERVER['HTTP_X_CSRFTOKEN']) || !$currentUser->validateCSFRToken($_SERVER['HTTP_X_CSRFTOKEN'])) {
    +        die('Invalid CSRF Token');
    +        exit;
    +    }
    +
         $definition = array(
             'WidgetsUser' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw', null, FILTER_REQUIRE_ARRAY),
             'ColumnNumber' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'int'),
    
  • lhc_web/modules/lhfront/module.php+3 3 modified
    @@ -12,7 +12,7 @@
     
     $ViewList['settings'] = array(
         'params' => array(),
    -    'uparams' => array('action'),
    +    'uparams' => array('action','csfr'),
         'functions' => array( 'use' )
     );
     
    @@ -25,8 +25,8 @@
     
     $ViewList['switchdashboard'] = array(
         'params' => array(),
    -    'uparams' => array('action'),
    -    'functions' => array('use'),
    +    'uparams' => array('action','csfr'),
    +    'functions' => array('use')
     );
     
     $FunctionList['use'] = array('explain' => 'General frontpage use permission');  
    
  • lhc_web/modules/lhfront/settings.php+11 0 modified
    @@ -1,11 +1,22 @@
     <?php
     
     if ($Params['user_parameters_unordered']['action'] == 'reset') {
    +
    +    if (!$currentUser->validateCSFRToken($Params['user_parameters_unordered']['csfr'])) {
    +        die('Invalid CSFR Token');
    +        exit;
    +    }
    +
         erLhcoreClassModelUserSetting::setSetting('dw_filters', '{}', false, true);
         header('Location: ' . $_SERVER['HTTP_REFERER']);
         exit;
     }
     
    +if (!isset($_SERVER['HTTP_X_CSRFTOKEN']) || !$currentUser->validateCSFRToken($_SERVER['HTTP_X_CSRFTOKEN'])) {
    +    echo json_encode(true);
    +    exit;
    +}
    +
     erLhcoreClassRestAPIHandler::setHeaders();
     
     $payload = json_decode(file_get_contents('php://input'),true);
    
  • lhc_web/modules/lhfront/switchdashboard.php+5 0 modified
    @@ -1,5 +1,10 @@
     <?php
     
    +if (!$currentUser->validateCSFRToken($Params['user_parameters_unordered']['csfr'])) {
    +    die('Invalid CSFR Token');
    +    exit;
    +}
    +
     $identifier = 'new_dashboard';
     $defaultValue = 1;
     
    
  • lhc_web/modules/lhuser/module.php+4 3 modified
    @@ -119,12 +119,13 @@
     );
     
     $ViewList['setsetting'] = array (
    -		'params' => array('identifier','value')
    +		'params' => array('identifier','value'),
    +        'uparams' => array('csfr')
     );
     
     $ViewList['setsettingajax'] = array (
    -		'params' => array('identifier','value'),
    -		'uparams' => array('indifferent')
    +        'params' => array('identifier','value'),
    +        'uparams' => array('indifferent')
     );
     
     $ViewList['setsettingajaxraw'] = array (
    
  • lhc_web/modules/lhuser/setalwaysonline.php+4 0 modified
    @@ -6,6 +6,10 @@
     try {
         $db->beginTransaction();
     
    +    if (!isset($_SERVER['HTTP_X_CSRFTOKEN']) || !$currentUser->validateCSFRToken($_SERVER['HTTP_X_CSRFTOKEN'])) {
    +        throw new Exception('Invalid CSFR Token');
    +    }
    +
         $currentUser = erLhcoreClassUser::instance();
         $userData = $currentUser->getUserData(true);
     
    
  • lhc_web/modules/lhuser/setinactive.php+5 0 modified
    @@ -3,6 +3,11 @@
     $currentUser = erLhcoreClassUser::instance();
     $userData = $currentUser->getUserData(true);
     
    +if (!isset($_SERVER['HTTP_X_CSRFTOKEN']) || !$currentUser->validateCSFRToken($_SERVER['HTTP_X_CSRFTOKEN'])) {
    +    echo json_encode(array('error' => true, 'active' => true));
    +    exit;
    +}
    +
     // We have to check is operator really inactive or it's just a tab trying to set inactive mode
     if ($Params['user_parameters']['status'] == 'true') {
         $activityTimeout = erLhcoreClassModelUserSetting::getSetting('trackactivitytimeout',-1);
    
  • lhc_web/modules/lhuser/setinvisible.php+5 0 modified
    @@ -2,6 +2,11 @@
     
    
     header('Content-Type: application/json');
    
     
    
    +if (!isset($_SERVER['HTTP_X_CSRFTOKEN']) || !$currentUser->validateCSFRToken($_SERVER['HTTP_X_CSRFTOKEN'])) {
    
    +    echo json_encode(array('error' => true));
    
    +    exit;
    
    +}
    
    +
    
     $currentUser = erLhcoreClassUser::instance();
    
     $userData = $currentUser->getUserData(true);
    
     
    
    
  • lhc_web/modules/lhuser/setoffline.php+5 0 modified
    @@ -7,6 +7,11 @@
         $db->beginTransaction();
     
         $currentUser = erLhcoreClassUser::instance();
    +
    +    if (!isset($_SERVER['HTTP_X_CSRFTOKEN']) || !$currentUser->validateCSFRToken($_SERVER['HTTP_X_CSRFTOKEN'])) {
    +        throw new Exception('Invalid CSFR Token');
    +    }
    +
         $userData = $currentUser->getUserData(true);
     
         if ($Params['user_parameters']['status'] == 'false') {
    
  • lhc_web/modules/lhuser/setopstatus.php+5 0 modified
    @@ -4,6 +4,7 @@
     $user = erLhcoreClassModelUser::fetch($Params['user_parameters']['user_id']);
     
     if (ezcInputForm::hasPostData()) {
    +
         $definition = array(
             'onlineStatus' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'int')
         );
    @@ -22,6 +23,10 @@
         try {
             $db->beginTransaction();
     
    +        if (!isset($_POST['csfr_token']) || !$currentUser->validateCSFRToken($_POST['csfr_token'])) {
    +            throw new Exception('CSFR Token is missing');
    +        }
    +
             $user->hide_online = $status;
     
             erLhcoreClassUser::getSession()->update($user);
    
  • lhc_web/modules/lhuser/setsettingajax.php+7 2 modified
    @@ -3,8 +3,13 @@
     // Make sure that we support variable which is setting now
     // It was possible in another portal to cheat, and overload server without this type of checking
     try {
    -	// Start session if required only
    -	$currentUser = erLhcoreClassUser::instance();
    +
    +    // Start session if required only
    +    $currentUser = erLhcoreClassUser::instance();
    +
    +    if ($currentUser->isLogged() && (!isset($_SERVER['HTTP_X_CSRFTOKEN']) || !$currentUser->validateCSFRToken($_SERVER['HTTP_X_CSRFTOKEN']))) {
    +        throw new Exception('Invalid CSFR Token');
    +    }
     
     	if ($Params['user_parameters']['identifier'] != 'online_connected') {
             $settingHandler = erLhcoreClassModelUserSettingOption::fetch($Params['user_parameters']['identifier']);
    
  • lhc_web/modules/lhuser/setsettingajaxraw.php+5 6 modified
    @@ -5,20 +5,19 @@
     try {
         // Start session if required only
         $currentUser = erLhcoreClassUser::instance();
    -    
    -    if (!isset($_SERVER['HTTP_X_CSRFTOKEN']) || !$currentUser->validateCSFRToken($_SERVER['HTTP_X_CSRFTOKEN'])) {
    -        echo json_encode(array('error' => 'true', 'result' => 'Invalid CSRF Token' ));
    -        exit;
    +
    +    if ($currentUser->isLogged() && (!isset($_SERVER['HTTP_X_CSRFTOKEN']) || !$currentUser->validateCSFRToken($_SERVER['HTTP_X_CSRFTOKEN']))) {
    +        throw new Exception('Invalid CSFR Token');
         }
    -	
    +
         $settingHandler = erLhcoreClassModelUserSettingOption::fetch($Params['user_parameters']['identifier']);
         
         // Never trust user input    
         erLhcoreClassModelUserSetting::setSetting($Params['user_parameters']['identifier'],(string)$_POST['value']);
         exit;
         
     } catch (Exception $e){
    -	print_r($e);
    +
     }
     
     exit;
    
  • lhc_web/modules/lhuser/setsetting.php+5 0 modified
    @@ -6,6 +6,11 @@
     	// Start session if required only
     	$currentUser = erLhcoreClassUser::instance();
     
    +    if (!$currentUser->validateCSFRToken($Params['user_parameters_unordered']['csfr'])) {
    +        die('Invalid CSFR Token');
    +        exit;
    +    }
    +
         $userSetting = erLhcoreClassModelUserSetting::findOne(array('filter' => array('user_id' => $currentUser->getUserID(), 'identifier' => $Params['user_parameters']['identifier'])));
     
         $supportedValue = false;
    

Vulnerability mechanics

Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

4

News mentions

0

No linked articles in our index yet.