From 6947b649cefb59c4be97f5f06c7ade3f98d2300a Mon Sep 17 00:00:00 2001 From: Remigijus Kiminas Date: Tue, 30 May 2023 06:04:08 -0400 Subject: [PATCH] Alert if error has accoured --- .../js/js_static/54bcce5942dd8e6e1e1e0c29802cfbef.js | 2 +- .../js/js_static/54bcce5942dd8e6e1e1e0c29802cfbef.js.map | 2 +- .../js/js_static/853a6cc8fc98e3350d02c9f99195b422.js | 2 +- .../js/js_static/853a6cc8fc98e3350d02c9f99195b422.js.map | 2 +- .../js/js_static/92c662aef48d161414ff30d7179a89cc.js | 2 +- .../js/js_static/92c662aef48d161414ff30d7179a89cc.js.map | 2 +- lhc_web/design/defaulttheme/js/lh.js | 2 +- lhc_web/design/defaulttheme/js/lh.min.js | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lhc_web/design/defaulttheme/js/js_static/54bcce5942dd8e6e1e1e0c29802cfbef.js b/lhc_web/design/defaulttheme/js/js_static/54bcce5942dd8e6e1e1e0c29802cfbef.js index 6f849b3ed4..ead0c087d5 100644 --- a/lhc_web/design/defaulttheme/js/js_static/54bcce5942dd8e6e1e1e0c29802cfbef.js +++ b/lhc_web/design/defaulttheme/js/js_static/54bcce5942dd8e6e1e1e0c29802cfbef.js @@ -1,2 +1,2 @@ -!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,(function(e,t){"use strict";var n=[],i=Object.getPrototypeOf,a=n.slice,o=n.flat?function(e){return n.flat.call(e)}:function(e){return n.concat.apply([],e)},r=n.push,s=n.indexOf,c={},l=c.toString,u=c.hasOwnProperty,d=u.toString,h=d.call(Object),p={},f=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},m=function(e){return null!=e&&e===e.window},g=e.document,v={type:!0,src:!0,nonce:!0,noModule:!0};function y(e,t,n){var i,a,o=(n=n||g).createElement("script");if(o.text=e,t)for(i in v)(a=t[i]||t.getAttribute&&t.getAttribute(i))&&o.setAttribute(i,a);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?c[l.call(e)]||"object":typeof e}var b="3.6.3",C=function(e,t){return new C.fn.init(e,t)};function x(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!f(e)&&!m(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+O+")"+O+"*"),z=new RegExp(O+"|>"),V=new RegExp(R),U=new RegExp("^"+q+"$"),Q={ID:new RegExp("^#("+q+")"),CLASS:new RegExp("^\\.("+q+")"),TAG:new RegExp("^("+q+"|[*])"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+R),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+O+"*(even|odd|(([+-]|)(\\d*)n|)"+O+"*(?:([+-]|)"+O+"*(\\d+)|))"+O+"*\\)|)","i"),bool:new RegExp("^(?:"+j+")$","i"),needsContext:new RegExp("^"+O+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+O+"*((?:-\\d)?\\d*)"+O+"*\\)|)(?=[^-]|$)","i")},X=/HTML$/i,G=/^(?:input|select|textarea|button)$/i,K=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+O+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},ie=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ae=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){h()},re=be((function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()}),{dir:"parentNode",next:"legend"});try{M.apply(D=H.call(C.childNodes),C.childNodes),D[C.childNodes.length].nodeType}catch(t){M={apply:D.length?function(e,t){N.apply(e,H.call(t))}:function(e,t){for(var n=e.length,i=0;e[n++]=t[i++];);e.length=n-1}}}function se(e,t,i,a){var o,s,l,u,d,f,v,y=t&&t.ownerDocument,C=t?t.nodeType:9;if(i=i||[],"string"!=typeof e||!e||1!==C&&9!==C&&11!==C)return i;if(!a&&(h(t),t=t||p,m)){if(11!==C&&(d=Z.exec(e)))if(o=d[1]){if(9===C){if(!(l=t.getElementById(o)))return i;if(l.id===o)return i.push(l),i}else if(y&&(l=y.getElementById(o))&&w(t,l)&&l.id===o)return i.push(l),i}else{if(d[2])return M.apply(i,t.getElementsByTagName(e)),i;if((o=d[3])&&n.getElementsByClassName&&t.getElementsByClassName)return M.apply(i,t.getElementsByClassName(o)),i}if(n.qsa&&!$[e+" "]&&(!g||!g.test(e))&&(1!==C||"object"!==t.nodeName.toLowerCase())){if(v=e,y=t,1===C&&(z.test(e)||J.test(e))){for((y=ee.test(e)&&ve(t.parentNode)||t)===t&&n.scope||((u=t.getAttribute("id"))?u=u.replace(ie,ae):t.setAttribute("id",u=b)),s=(f=r(e)).length;s--;)f[s]=(u?"#"+u:":scope")+" "+we(f[s]);v=f.join(",")}try{if(n.cssSupportsSelector&&!CSS.supports("selector(:is("+v+"))"))throw new Error;return M.apply(i,y.querySelectorAll(v)),i}catch(t){$(e,!0)}finally{u===b&&t.removeAttribute("id")}}}return c(e.replace(B,"$1"),t,i,a)}function ce(){var e=[];return function t(n,a){return e.push(n+" ")>i.cacheLength&&delete t[e.shift()],t[n+" "]=a}}function le(e){return e[b]=!0,e}function ue(e){var t=p.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function de(e,t){for(var n=e.split("|"),a=n.length;a--;)i.attrHandle[n[a]]=t}function he(e,t){var n=t&&e,i=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(i)return i;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function pe(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function fe(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function me(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&re(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function ge(e){return le((function(t){return t=+t,le((function(n,i){for(var a,o=e([],n.length,t),r=o.length;r--;)n[a=o[r]]&&(n[a]=!(i[a]=n[a]))}))}))}function ve(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=se.support={},o=se.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!X.test(t||n&&n.nodeName||"HTML")},h=se.setDocument=function(e){var t,a,r=e?e.ownerDocument||e:C;return r!=p&&9===r.nodeType&&r.documentElement&&(f=(p=r).documentElement,m=!o(p),C!=p&&(a=p.defaultView)&&a.top!==a&&(a.addEventListener?a.addEventListener("unload",oe,!1):a.attachEvent&&a.attachEvent("onunload",oe)),n.scope=ue((function(e){return f.appendChild(e).appendChild(p.createElement("div")),void 0!==e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length})),n.cssSupportsSelector=ue((function(){return CSS.supports("selector(*)")&&p.querySelectorAll(":is(:jqfake)")&&!CSS.supports("selector(:is(*,:jqfake))")})),n.attributes=ue((function(e){return e.className="i",!e.getAttribute("className")})),n.getElementsByTagName=ue((function(e){return e.appendChild(p.createComment("")),!e.getElementsByTagName("*").length})),n.getElementsByClassName=Y.test(p.getElementsByClassName),n.getById=ue((function(e){return f.appendChild(e).id=b,!p.getElementsByName||!p.getElementsByName(b).length})),n.getById?(i.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},i.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var n=t.getElementById(e);return n?[n]:[]}}):(i.filter.ID=function(e){var t=e.replace(te,ne);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},i.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var n,i,a,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];for(a=t.getElementsByName(e),i=0;o=a[i++];)if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),i.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,i=[],a=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[a++];)1===n.nodeType&&i.push(n);return i}return o},i.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&m)return t.getElementsByClassName(e)},v=[],g=[],(n.qsa=Y.test(p.querySelectorAll))&&(ue((function(e){var t;f.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&g.push("[*^$]="+O+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||g.push("\\["+O+"*(?:value|"+j+")"),e.querySelectorAll("[id~="+b+"-]").length||g.push("~="),(t=p.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||g.push("\\["+O+"*name"+O+"*="+O+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||g.push(":checked"),e.querySelectorAll("a#"+b+"+*").length||g.push(".#.+[+~]"),e.querySelectorAll("\\\f"),g.push("[\\r\\n\\f]")})),ue((function(e){e.innerHTML="";var t=p.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&g.push("name"+O+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&g.push(":enabled",":disabled"),f.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&g.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),g.push(",.*:")}))),(n.matchesSelector=Y.test(y=f.matches||f.webkitMatchesSelector||f.mozMatchesSelector||f.oMatchesSelector||f.msMatchesSelector))&&ue((function(e){n.disconnectedMatch=y.call(e,"*"),y.call(e,"[s!='']:x"),v.push("!=",R)})),n.cssSupportsSelector||g.push(":has"),g=g.length&&new RegExp(g.join("|")),v=v.length&&new RegExp(v.join("|")),t=Y.test(f.compareDocumentPosition),w=t||Y.test(f.contains)?function(e,t){var n=9===e.nodeType&&e.documentElement||e,i=t&&t.parentNode;return e===i||!(!i||1!==i.nodeType||!(n.contains?n.contains(i):e.compareDocumentPosition&&16&e.compareDocumentPosition(i)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},A=t?function(e,t){if(e===t)return d=!0,0;var i=!e.compareDocumentPosition-!t.compareDocumentPosition;return i||(1&(i=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===i?e==p||e.ownerDocument==C&&w(C,e)?-1:t==p||t.ownerDocument==C&&w(C,t)?1:u?I(u,e)-I(u,t):0:4&i?-1:1)}:function(e,t){if(e===t)return d=!0,0;var n,i=0,a=e.parentNode,o=t.parentNode,r=[e],s=[t];if(!a||!o)return e==p?-1:t==p?1:a?-1:o?1:u?I(u,e)-I(u,t):0;if(a===o)return he(e,t);for(n=e;n=n.parentNode;)r.unshift(n);for(n=t;n=n.parentNode;)s.unshift(n);for(;r[i]===s[i];)i++;return i?he(r[i],s[i]):r[i]==C?-1:s[i]==C?1:0}),p},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(h(e),n.matchesSelector&&m&&!$[t+" "]&&(!v||!v.test(t))&&(!g||!g.test(t)))try{var i=y.call(e,t);if(i||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return i}catch(e){$(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return Q.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&V.test(n)&&(t=r(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=S[e+" "];return t||(t=new RegExp("(^|"+O+")"+e+"("+O+"|$)"))&&S(e,(function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")}))},ATTR:function(e,t,n){return function(i){var a=se.attr(i,e);return null==a?"!="===t:!t||(a+="","="===t?a===n:"!="===t?a!==n:"^="===t?n&&0===a.indexOf(n):"*="===t?n&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function L(e,t,n){return f(t)?C.grep(e,(function(e,i){return!!t.call(e,i,e)!==n})):t.nodeType?C.grep(e,(function(e){return e===t!==n})):"string"!=typeof t?C.grep(e,(function(e){return-1)[^>]*|#([\w-]+))$/;(C.fn.init=function(e,t,n){var i,a;if(!e)return this;if(n=n||D,"string"==typeof e){if(!(i="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:E.exec(e))||!i[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(i[1]){if(t=t instanceof C?t[0]:t,C.merge(this,C.parseHTML(i[1],t&&t.nodeType?t.ownerDocument||t:g,!0)),A.test(i[1])&&C.isPlainObject(t))for(i in t)f(this[i])?this[i](t[i]):this.attr(i,t[i]);return this}return(a=g.getElementById(i[2]))&&(this[0]=a,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):f(e)?void 0!==n.ready?n.ready(e):e(C):C.makeArray(e,this)}).prototype=C.fn,D=C(g);var N=/^(?:parents|prev(?:Until|All))/,M={children:!0,contents:!0,next:!0,prev:!0};function H(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}C.fn.extend({has:function(e){var t=C(e,this),n=t.length;return this.filter((function(){for(var e=0;e\x20\t\r\n\f]*)/i,fe=/^$|^module$|\/(?:java|ecma)script/i;ue=g.createDocumentFragment().appendChild(g.createElement("div")),(de=g.createElement("input")).setAttribute("type","radio"),de.setAttribute("checked","checked"),de.setAttribute("name","t"),ue.appendChild(de),p.checkClone=ue.cloneNode(!0).cloneNode(!0).lastChild.checked,ue.innerHTML="",p.noCloneChecked=!!ue.cloneNode(!0).lastChild.defaultValue,ue.innerHTML="",p.option=!!ue.lastChild;var me={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ge(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&$(e,t)?C.merge([e],n):n}function ve(e,t){for(var n=0,i=e.length;n",""]);var ye=/<|&#?\w+;/;function we(e,t,n,i,a){for(var o,r,s,c,l,u,d=t.createDocumentFragment(),h=[],p=0,f=e.length;p\s*$/g;function Le(e,t){return $(e,"table")&&$(11!==t.nodeType?t:t.firstChild,"tr")&&C(e).children("tbody")[0]||e}function De(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Ee(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Ne(e,t){var n,i,a,o,r,s;if(1===t.nodeType){if(X.hasData(e)&&(s=X.get(e).events))for(a in X.remove(t,"handle events"),s)for(n=0,i=s[a].length;n").attr(e.scriptAttrs||{}).prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&a("error"===e.type?404:200,e.type)}),g.head.appendChild(t[0])},abort:function(){n&&n()}}}));var zt,Vt=[],Ut=/(=)\?(?=&|$)|\?\?/;C.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Vt.pop()||C.expando+"_"+Tt.guid++;return this[e]=!0,e}}),C.ajaxPrefilter("json jsonp",(function(t,n,i){var a,o,r,s=!1!==t.jsonp&&(Ut.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ut.test(t.data)&&"data");if(s||"jsonp"===t.dataTypes[0])return a=t.jsonpCallback=f(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,s?t[s]=t[s].replace(Ut,"$1"+a):!1!==t.jsonp&&(t.url+=(St.test(t.url)?"&":"?")+t.jsonp+"="+a),t.converters["script json"]=function(){return r||C.error(a+" was not called"),r[0]},t.dataTypes[0]="json",o=e[a],e[a]=function(){r=arguments},i.always((function(){void 0===o?C(e).removeProp(a):e[a]=o,t[a]&&(t.jsonpCallback=n.jsonpCallback,Vt.push(a)),r&&f(o)&&o(r[0]),r=o=void 0})),"script"})),p.createHTMLDocument=((zt=g.implementation.createHTMLDocument("").body).innerHTML="
",2===zt.childNodes.length),C.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(p.createHTMLDocument?((i=(t=g.implementation.createHTMLDocument("")).createElement("base")).href=g.location.href,t.head.appendChild(i)):t=g),o=!n&&[],(a=A.exec(e))?[t.createElement(a[1])]:(a=we([e],t,o),o&&o.length&&C(o).remove(),C.merge([],a.childNodes)));var i,a,o},C.fn.load=function(e,t,n){var i,a,o,r=this,s=e.indexOf(" ");return-1").append(C.parseHTML(e)).find(i):e)})).always(n&&function(e,t){r.each((function(){n.apply(this,o||[e.responseText,t,e])}))}),this},C.expr.pseudos.animated=function(e){return C.grep(C.timers,(function(t){return e===t.elem})).length},C.offset={setOffset:function(e,t,n){var i,a,o,r,s,c,l=C.css(e,"position"),u=C(e),d={};"static"===l&&(e.style.position="relative"),s=u.offset(),o=C.css(e,"top"),c=C.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+c).indexOf("auto")?(r=(i=u.position()).top,a=i.left):(r=parseFloat(o)||0,a=parseFloat(c)||0),f(t)&&(t=t.call(e,n,C.extend({},s))),null!=t.top&&(d.top=t.top-s.top+r),null!=t.left&&(d.left=t.left-s.left+a),"using"in t?t.using.call(e,d):u.css(d)}},C.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each((function(t){C.offset.setOffset(this,e,t)}));var t,n,i=this[0];return i?i.getClientRects().length?(t=i.getBoundingClientRect(),n=i.ownerDocument.defaultView,{top:t.top+n.pageYOffset,left:t.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,i=this[0],a={top:0,left:0};if("fixed"===C.css(i,"position"))t=i.getBoundingClientRect();else{for(t=this.offset(),n=i.ownerDocument,e=i.offsetParent||n.documentElement;e&&(e===n.body||e===n.documentElement)&&"static"===C.css(e,"position");)e=e.parentNode;e&&e!==i&&1===e.nodeType&&((a=C(e).offset()).top+=C.css(e,"borderTopWidth",!0),a.left+=C.css(e,"borderLeftWidth",!0))}return{top:t.top-a.top-C.css(i,"marginTop",!0),left:t.left-a.left-C.css(i,"marginLeft",!0)}}},offsetParent:function(){return this.map((function(){for(var e=this.offsetParent;e&&"static"===C.css(e,"position");)e=e.offsetParent;return e||ie}))}}),C.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(e,t){var n="pageYOffset"===t;C.fn[e]=function(i){return B(this,(function(e,i,a){var o;if(m(e)?o=e:9===e.nodeType&&(o=e.defaultView),void 0===a)return o?o[t]:e[i];o?o.scrollTo(n?o.pageXOffset:a,n?a:o.pageYOffset):e[i]=a}),e,i,arguments.length)}})),C.each(["top","left"],(function(e,t){C.cssHooks[t]=Fe(p.pixelPosition,(function(e,n){if(n)return n=Be(e,t),Ie.test(n)?C(e).position()[t]+"px":n}))})),C.each({Height:"height",Width:"width"},(function(e,t){C.each({padding:"inner"+e,content:t,"":"outer"+e},(function(n,i){C.fn[i]=function(a,o){var r=arguments.length&&(n||"boolean"!=typeof a),s=n||(!0===a||!0===o?"margin":"border");return B(this,(function(t,n,a){var o;return m(t)?0===i.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(o=t.documentElement,Math.max(t.body["scroll"+e],o["scroll"+e],t.body["offset"+e],o["offset"+e],o["client"+e])):void 0===a?C.css(t,n,s):C.style(t,n,a,s)}),t,r?a:void 0,r)}}))})),C.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],(function(e,t){C.fn[t]=function(e){return this.on(t,e)}})),C.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,i){return this.on(t,e,n,i)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),C.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),(function(e,t){C.fn[t]=function(e,n){return 00||"true"===$("#CSChatMessage-"+e.data.chat_id).attr("edit-vis")&&0===parseInt($(this).attr("data-op-id"))),o={placement:"right",trigger:"manual",animation:!1,html:!0,container:"#chat-id-"+e.data.chat_id,template:'',content:function(){return''+confLH.transLation.quote+""+(a?'
edit'+confLH.transLation.edit+"":"")+'
supervisor_account'+confLH.transLation.ask_help+""+(n?'
content_copy'+confLH.transLation.copy+" (Ctrl+C)":"")+(n?"":'
content_copy'+confLH.transLation.copy+' (Ctrl+C)
content_copy'+confLH.transLation.copy_group+"")+(n?"":'
language'+confLH.transLation.translate+"")}},r=$("#messagesBlock-"+e.data.chat_id+" > #msg-"+i+" > .msg-body");if(0==r.length)return;return ee.emitEvent("quoteActionRight",[o,e.data.chat_id,i]),r.popover(o).popover("show").addClass("popover-copy"),$("#copy-popover-"+e.data.chat_id).click((function(t){t.stopPropagation(),t.preventDefault(),$.getJSON(e.data.that.wwwDir+"chat/quotemessage/"+i,(function(t){t.msg&&e.data.that.insertTextToMessageArea(e.data.chat_id,t.msg),e.data.that.hidePopover()}))})),$("#ask-help-popover-"+e.data.chat_id).click((function(t){t.stopPropagation(),t.preventDefault(),$.getJSON(e.data.that.wwwDir+"chat/quotemessage/"+i,(function(t){$("#private-chat-tab-link-"+e.data.chat_id).attr("private-loaded")?($("#private-chat-tab-link-"+e.data.chat_id).attr("private-loaded",!0).click(),new bootstrap.Tab(document.querySelector("#private-chat-tab-link-"+e.data.chat_id)).show(),ee.emitEvent("groupChatPrefillMessage",[e.data.chat_id,t.msg])):($("#private-chat-tab-link-"+e.data.chat_id).attr("private-loaded",!0).click(),new bootstrap.Tab(document.querySelector("#private-chat-tab-link-"+e.data.chat_id)).show(),ee.emitEvent("privateChatStart",[e.data.chat_id,{default_message:t.msg}])),e.data.that.hidePopover()}))})),!n&&$("#translate-msg-"+e.data.chat_id).click((function(t){t.stopPropagation(),t.preventDefault(),lhc.methodCall("lhc.translation","translateMessageVisitor",{msg_id:i,chat_id:e.data.chat_id}),e.data.that.hidePopover()})),!n&&$("#copy-all-text-popover-"+e.data.chat_id).click((function(t){t.stopPropagation(),t.preventDefault(),$.getJSON(e.data.that.wwwDir+"chat/quotemessage/"+i,(function(t){var n=$("#CSChatMessage-"+e.data.chat_id),i=n.val();n.val(t.msg),n.select(),document.execCommand("copy"),n.val(i),e.data.that.hidePopover()}))})),!n&&$("#copy-group-text-popover-"+e.data.chat_id).click((function(t){t.stopPropagation(),t.preventDefault(),$.getJSON(e.data.that.wwwDir+"chat/quotemessage/"+i+"/(type)/group",(function(t){var n=$("#CSChatMessage-"+e.data.chat_id),i=n.val();n.val(t.msg),n.select(),document.execCommand("copy"),n.val(i),e.data.that.hidePopover()}))})),a&&$("#edit-popover-"+e.data.chat_id).click((function(t){t.stopPropagation(),t.preventDefault(),$.getJSON(e.data.that.wwwDir+"chat/editprevious/"+e.data.chat_id+"/"+i,(function(t){if("f"==t.error){var n=$("#CSChatMessage-"+e.data.chat_id);n.val(t.msg).attr("data-msgid",t.id).addClass("edit-mode"),$("#msg-"+t.id).addClass("edit-mode"),n.focus()}else alert(t.error)})),e.data.that.hidePopover()})),n&&$("#copy-text-popover-"+e.data.chat_id).click((function(t){t.stopPropagation(),t.preventDefault();var n=e.data.that.getSelectedTextPlain(),i=$("#CSChatMessage-"+e.data.chat_id),a=i.val();i.val(n),i.select(),document.execCommand("copy"),i.val(a),e.data.that.hidePopover()})),e.data.that.popoverShown=!0,e.data.that.popoverShownNow=!1,!1}},this.insertTextToMessageArea=function(e,t){var n=$("#CSChatMessage-"+e),i=n.val().replace(/^\s*\n/g,"");n.val((""!=i?i+"[quote]"+t+"[/quote]":"[quote]"+t+"[/quote]")+"\n").focus();var a=n[0];for(a.clientHeight,a.rows;a.scrollHeight>a.clientHeight&&!window.opera&&a.rows<30;)a.style.overflow="hidden",a.rows+=1;a.scrollHeight>a.clientHeight&&(a.style.overflow="auto")},this.mouseClicked=function(e){if(selected=e.data.that.getSelectedText(),$(".popover-copy").popover("dispose"),!selected.text.length||null!==e.data.that.selection&&e.data.that.selection.text===selected.text)e.data.that.selection=null;else{e.data.that.selection=selected;var t={placement:"right",trigger:"manual",animation:!1,html:!0,container:"#chat-id-"+e.data.chat_id,template:'',content:function(){return''+confLH.transLation.quote+""}},n=void 0!==$(this).attr("id")?"#messagesBlock-"+e.data.chat_id+" > #msg-"+$(this).attr("id").replace("msg-","")+" > .msg-body":this,i=$(n);if(0==i.length)return;ee.emitEvent("quoteAction",[t,e.data.chat_id]),i.popover(t).popover("show").addClass("popover-copy"),$("#copy-popover-"+e.data.chat_id).click((function(){lhinst.quateSelection(e.data.chat_id)})),e.data.that.popoverShown=!0,e.data.that.popoverShownNow=!0}},this.addQuateHandler=function(e){this.popoverShown=!1,$("#messagesBlock-"+e+" > .message-row:not([qt])").on("mouseup",{chat_id:e,that:this},lhinst.mouseClicked).on("contextmenu",{chat_id:e,that:this},lhinst.mouseContextMenu).attr("qt",1)},this.getSelectedTextPlain=function(){var e=this.selection.text.replace(/[\uD7AF\uD7C7-\uD7CA\uD7FC-\uF8FF\uFA6E\uFA6F\uFADA]/g,"");return e=(e=(e=(e=e.replace(/^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}(.*)/gm,"")).replace(/^[0-9]{2}:[0-9]{2}:[0-9]{2}(.*)/gm,"")).replace(/^\s*\n/gm,"")).replace(/^ /gm,"")},this.quateSelection=function(e){$(".popover-copy").popover("dispose");var t=this.getSelectedTextPlain();window.textreplace=t,this.insertTextToMessageArea(e,t),this.popoverShown=!1},this.hidePopover=function(){!0===this.popoverShownNow?this.popoverShownNow=!1:!0===this.popoverShown&&(this.popoverShown=!1,$(".popover-copy").popover("dispose"))},this.addTab=function(e,t,n,i,a,o){if(!(e.find("#chat-tab-link-"+i).length>0)){var r=confLH.new_dashboard&&confLH.hide_tabs&&null!==document.getElementById("tabs-dashboard")?" d-none":"",s='';void 0===o||0==parseInt(o)?e.find("> ul").append(s):e.find("> ul > li:eq("+(o-1)+")").after(s),$("#chat-tab-link-"+i).click((function(){lhinst.previous_chat_id>0&&$("#unread-separator-"+lhinst.previous_chat_id).remove(),lhinst.previous_chat_id=i,setTimeout((function(){$("#CSChatMessage-"+i).focus()}),2);var e=$(this);setTimeout((function(){e.find(".msg-nm").remove();var t=!1;e.hasClass("has-pm")&&(t=!0,e.removeClass("has-pm")),1==t&&$("#messagesBlock-"+i).prop("scrollTop",$("#messagesBlock-"+i).prop("scrollHeight"))}),500),ee.emitEvent("chatTabClicked",[i,e])}));var c=window.location.hash.replace("#/","#"),l=this;$.get(t,(function(t){""!=t?(void 0===a||!0===a||c=="#chat-id-"+i?(e.find("> ul > li > a.active").removeClass("active"),e.find("> ul > #chat-tab-li-"+i+" > a").addClass("active"),e.find("> div.tab-content > div.active").removeClass("active"),e.find("> div.tab-content").append('
'),window.location.hash="#/chat-id-"+i,e.addClass("chat-tab-selected")):e.find("> div.tab-content").append('
'),$("#chat-id-"+i).html(t),void 0!==a&&!0!==a&&c!="#chat-id-"+i||$("#CSChatMessage-"+i).focus(),0==l.disableremember&&l.rememberTab(i),l.addQuateHandler(i),l.loadMainData(i),ee.emitEvent("chatTabLoaded",[i])):l.removeDialogTab(i,e,!0)}))}},this.rememberTab=function(e){if(localStorage)try{e=parseInt(e);var t=localStorage.getItem("achat_id"),n=new Array;if(null!==t)n=t.split(",").map(Number);-1===n.indexOf(e)&&n.push(e),localStorage.setItem("achat_id",n.join(","))}catch(e){console.log(e)}},this.forgetChat=function(e,t){if(localStorage)try{e=parseInt(e);var n=localStorage.getItem(t),i=new Array;null!==n&&(i=n.split(",").map(Number)),-1!==i.indexOf(e)&&i.splice(i.indexOf(e),1),localStorage.setItem(t,i.join(","))}catch(e){console.log(e)}},this.attachTabNavigator=function(){$("#tabs > ul.nav > li > a").click((function(){$(this).find(".msg-nm").remove(),$(this).removeClass("has-pm")}))},this.holdAction=function(e,t){if(!$("#CSChatMessage-"+e).is("[readonly]")){var n=this;$.postJSON(this.wwwDir+"chat/holdaction/"+e,{sel:t.hasClass("btn-outline-info"),op:t.attr("data-type")},(function(i){0==i.error?(1==i.hold?(t.addClass("btn-outline-info"),"usr"==t.attr("data-type")?$("#hold-action-"+e).removeClass("btn-outline-info"):$("#hold-action-usr-"+e).removeClass("btn-outline-info")):t.removeClass("btn-outline-info"),""!=i.msg&&$("#messagesBlock-"+e).append(i.msg).scrollTop($("#messagesBlock-"+e).prop("scrollHeight")),n.syncadmincall()):alert(i.msg)}))}},this.copyContent=function(e){var t,n=document.createElement("textarea");n.value=e.attr("data-copy"),n.style.top="0",n.style.left="0",n.style.position="fixed",document.body.appendChild(n),n.focus(),n.select();try{document.execCommand("copy")}catch(e){alert("Oops, unable to copy")}document.body.removeChild(n),e.tooltip({trigger:"click",placement:"top"}),t=e.attr("data-success"),e.tooltip("hide").attr("data-original-title",t).tooltip("show"),setTimeout((function(){e.tooltip("hide")}),1e3)},this.copyMessages=function(e){var t;return $("#chat-copy-messages").select(),document.execCommand("copy"),e.tooltip({trigger:"click",placement:"top"}),t=e.attr("data-success"),e.tooltip("hide").attr("data-original-title",t).tooltip("show"),setTimeout((function(){e.tooltip("hide")}),3e3),!1},this.removeDialogTabGroup=function(e,t){ee.emitEvent("unloadGroupChat",[e]);this.smartTabFocus(t,e)},this.addGroupTab=function(e,t,n,i){if(e.find("#chat-tab-link-"+n).length>0)return e.find("> ul > li > a.active").removeClass("active"),e.find("> ul > li#chat-tab-li-"+n+" > a").addClass("active"),e.find("> div.tab-content > div.active").removeClass("active"),e.find("> div.tab-content > #chat-id-"+n).addClass("active"),void ee.emitEvent("groupChatTabClicked",[n]);var a='";e.find("> ul").append(a);window.location.hash.replace("#/","#");!0!==i?(e.find("> ul > li > a.active").removeClass("active"),e.find("> ul > #chat-tab-li-"+n+" > a").addClass("active"),e.find("> div.tab-content > div.active").removeClass("active"),e.find("> div.tab-content").append('
')):e.find("> div.tab-content").append('
'),ee.emitEvent("groupChatTabLoaded",[n]),$("#chat-tab-link-"+n).click((function(){ee.emitEvent("groupChatTabClicked",[n.replace("gc","")])}))},this.startGroupChat=function(e,t,n,i){this.addGroupTab(t,n,"gc"+e,i)},this.hideShowAction=function(e){var t=$("#messagesBlock-"+e.chat_id),n=t.prop("scrollTop")+t.height()+30>t.prop("scrollHeight"),i=$("#message-more-"+e.id);i.hasClass("hide")?(i.removeClass("hide"),0==e.hide_show?$("#hide-show-action-"+e.id).remove():$("#hide-show-action-"+e.id).text(e.hide_text)):(i.addClass("hide"),1==e.hide_show&&$("#hide-show-action-"+e.id).text(e.show_text)),n&&t.scrollTop(t.prop("scrollHeight"))},this.buttonAction=function(e,t){var n=e.closest(".message-row");$.getJSON(this.wwwDir+"chat/abstractclick/"+n.attr("id").replace("msg-","")+"/"+t,(function(e){if(e.error)alert(e.error);else if(e.replace_id&&e.html){var t=$("#messagesBlock-"+e.chat_id),n=t.prop("scrollTop")+t.height()+30>t.prop("scrollHeight");$(e.replace_id).replaceWith(e.html),lhinst.addQuateHandler(e.chat_id),n&&t.scrollTop(t.prop("scrollHeight"))}else e.modal&&lhc.revealModal({url:WWW_DIR_JAVASCRIPT+e.modal})}))},this.startChat=function(e,t,n,i,a){if(this.removeBackgroundChat(e),this.hideNotification(e),$("#sub-tabs").length>0&&$("#sub-tabs a[href='#sub-tabs-open']").tab("show"),0==this.chatUnderSynchronization(e)){var o=void 0===i||i,r=0==this.disableremember?"/(remember)/true":"";this.addTab(t,this.wwwDir+"chat/adminchat/"+e+r,n,e,o,a);var s=this;setTimeout((function(){s.syncadmininterfacestatic()}),1e3)}else t.find("> ul > li > a.active").removeClass("active"),t.find("> ul > li#chat-tab-li-"+e+" > a").addClass("active"),t.find("> div.tab-content > div.active").removeClass("active"),t.find("> div.tab-content > #chat-id-"+e).addClass("active"),window.location.hash="#/chat-id-"+e;ee.emitEvent("chatStartTab",[e,{name:n,focus:void 0===i||i,position:a}])},this.backgroundChats=[],this.startChatBackground=function(e,t,n,i){if(0==this.chatUnderSynchronization(e)){this.backgroundChats.push(parseInt(e));var a=0==this.disableremember?"/(remember)/true":"";return i||(i="background"),this.addTab(t,this.wwwDir+"chat/adminchat/"+e+a+"/(arg)/"+i,n,e,!1),ee.emitEvent("chatStartBackground",[e,{name:n}]),!0}return!1},this.protectCSFR=function(){$("a.csfr-required").click((function(e){var t=$(this);t.attr("data-secured")||(t.attr("href",t.attr("href")+"/(csfr)/"+confLH.csrf_token),t.attr("data-secured",1)),t.hasClass("csfr-post")&&!t.hasClass("csfr-post-executed")&&(e.preventDefault(),e.stopPropagation(),t.addClass("csfr-post-executed"),!t.attr("data-trans")||confirm(confLH.transLation[t.attr("data-trans")])?$.post(t.attr("href"),(function(){document.location.reload()})).fail((function(){document.location.reload()})):setTimeout((function(){t.removeClass("csfr-post-executed")}),500))}))},this.addSynchroChat=function(e,t){this.chatsSynchronising.push(e),this.chatsSynchronisingMsg.push(e+","+t),LHCCallbacks.addSynchroChat&&LHCCallbacks.addSynchroChat(e,t)},this.removeSynchroChat=function(e,t){for(var n=0;n ul > #chat-tab-li-"+t).index();n||(n={});var a=1==n.up||void 0===n.up?1:-1;n.keep?e.find("> ul > li > a.active").removeClass("active"):(e.find("> ul > #chat-tab-li-"+t).remove(),e.find("#chat-id-"+t).remove());var o=e.find("> ul > li:eq("+(i-a)+")");if(void 0!==o.attr("id"))var r=o.find("> a");else if(linkTabRight=e.find("> ul > li:eq("+i+")"),linkTabRight.length>0)r=linkTabRight.find("> a");else r=o.find("> a");if(!e.find("> ul > li > a.active").length){for(var s=!0;s;)if(r.hasClass("non-focus")){s=!0;var c=r.parent().prev();c.find(" > a").length&&(r=c.find(" > a"))}else s=!1;if(r.tab("show"),void 0!==r.attr("id")){var l=r.attr("href").replace("#chat-id-","");this.removeBackgroundChat(l),this.hideNotification(l),n.keep||ee.emitEvent("chatTabFocused",[l])}}return void 0!==r.attr("href")?r.attr("href").replace("#","#/"):"#"},this.startChatCloseTabNewWindow=function(e,t,n){return window.open(this.wwwDir+"chat/single/"+e,"chatwindow-chat-id-"+e,"menubar=1,resizable=1,width=800,height=650"),this.smartTabFocus(t,e),1==this.closeWindowOnChatCloseDelete&&window.close(),this.removeSynchroChat(e),this.syncadmininterfacestatic(),!1},this.removeDialogTab=function(e,t,n){if(this.channel&&!0===this.chatUnderSynchronization(e)&&this.channel.postMessage({action:"close_chat",args:{chat_id:e}}),0!=$("#CSChatMessage-"+e).length&&($("#CSChatMessage-"+e).unbind("keydown",(function(){})),$("#CSChatMessage-"+e).unbind("keyup",(function(){}))),this.removeSynchroChat(e),1==n){var i=this.smartTabFocus(t,e);setTimeout((function(){window.location.hash=i}),500),1==this.closeWindowOnChatCloseDelete&&window.close()}this.syncadmininterfacestatic()},this.removeActiveDialogTag=function(e){1==this.closeWindowOnChatCloseDelete&&window.close()},this.deleteChat=function(e,t,n){if(confirm(confLH.transLation.delete_confirm)){var i=this;$.postJSON(this.wwwDir+this.deletechatadmin+e,(function(a){if(1==a.error)alert(a.result);else{if(0!=$("#CSChatMessage-"+e).length&&($("#CSChatMessage-"+e).unbind("keydown",(function(){})),$("#CSChatMessage-"+e).unbind("keyup",(function(){}))),i.removeSynchroChat(e),1==n){var o=i.smartTabFocus(t,e);setTimeout((function(){window.location.hash=o}),500),1==i.closeWindowOnChatCloseDelete&&window.close()}LHCCallbacks.chatDeletedCallback&&LHCCallbacks.chatDeletedCallback(e),i.syncadmininterfacestatic()}})).fail((function(e,t,n){console.dir(e),alert("getJSON request failed! "+t+":"+n+":"+e.responseText)}))}},this.rejectPendingChat=function(e,t){var n=this;$.postJSON(this.wwwDir+this.deletechatadmin+e,{},(function(e){n.syncadmininterfacestatic()})).fail((function(e,t,n){console.dir(e),alert("getJSON request failed! "+t+":"+n+":"+e.responseText)}))},this.startChatNewWindowArchive=function(e,t,n){var i=window.open(this.wwwDir+"chatarchive/viewarchivedchat/"+e+"/"+t+"/(mode)/popup","chatwindow-chat-id-"+t,"menubar=1,resizable=1,width=800,height=650");null!==i&&(i.focus(),ee.emitEvent("chatStartOpenWindowArchive",[e,t]))},this.speechToText=function(e){0==this.speechHandler&&(this.speechHandler=new LHCSpeechToText),this.speechHandler.listen({chat_id:e})},this.startChatTransfer=function(e,t,n,i,a){var o=this;$.getJSON(this.wwwDir+this.accepttransfer+i,{},(function(i){0==$("#chat-tab-link-"+e).length?a?(o.removeSynchroChat(e),o.startChatBackground(e,t,n)):o.startChat(e,t,n):o.updateVoteStatus(e),LHCCallbacks.operatorAcceptedTransfer&&LHCCallbacks.operatorAcceptedTransfer(e)})).fail((function(){o.startChat(e,t,n)}))},this.startChatNewWindowTransfer=function(e,t,n){return $.getJSON(this.wwwDir+this.accepttransfer+n,{},(function(t){LHCCallbacks.operatorAcceptedTransfer&&LHCCallbacks.operatorAcceptedTransfer(e)})),this.startChatNewWindow(e,t)},this.startChatNewWindowTransferByTransfer=function(e,t,n){var i=this;return $.ajax({type:"GET",url:this.wwwDir+this.accepttransfer+e+"/(mode)/chat",cache:!1,dataType:"json"}).done((function(e){$("#tabs").length>0?void 0!==n&&!0===n?i.startChatBackground(e.chat_id,$("#tabs"),t):(window.focus(),i.startChat(e.chat_id,$("#tabs"),t)):i.startChatNewWindow(e.chat_id,""),LHCCallbacks.operatorAcceptedTransfer&&LHCCallbacks.operatorAcceptedTransfer(e.chat_id)})),this.syncadmininterfacestatic(),!1},this.switchLang=function(e,t){var n='';return e.append(n),e.submit(),!1},this.sendLinkToMail=function(e,t){var n=window.parent.$("#MailMessage").val();window.parent.$("#MailMessage").val((""!=n?n+"\n":n)+e),$("#embed-button-"+t).addClass("btn-success")},this.sendLinkToEditor=function(e,t,n){var i=window.parent.$("#CSChatMessage-"+e).val();window.parent.$("#CSChatMessage-"+e).val((""!=i?i+"\n":i)+t),$("#embed-button-"+n).addClass("btn-success")},this.sendLinkToGeneralEditor=function(e,t,n){var i=window.parent.$(".embed-into");if(0==i.length&&(i=window.opener.$(".embed-into")),void 0!==n&&void 0!==n.replace&&1==n.replace)i.val(e);else{var a=i.val();i.val((""!=a?a+"\n":a)+e)}$("#embed-button-"+t).addClass("btn-success")},this.hideOnTransferHappen=function(e){var t=this,n=setInterval((function(){parseInt(confLH.user_id)!=parseInt($("#chat-owner-"+e).attr("user-id"))&&($("#tabs").length>0&&(t.removeDialogTab(e,$("#tabs"),!0),t.channel&&t.channel.postMessage({action:"close_chat",args:{chat_id:parseInt(e)}})),clearInterval(n))}),1e3)},this.hideTransferModal=function(e){var t=this;setTimeout((function(){$("#myModal").modal("hide"),$("#tabs").length>0&&t.hideOnTransferHappen(e)}),1e3)},this.transferChat=function(e){var t=this,n=$("[name=TransferTo"+e+"]:checked").val();$.postJSON(this.wwwDir+this.trasnsferuser+e+"/"+n,{type:"user"},(function(n){"false"==n.error&&($("#transfer-block-"+n.chat_id).html(n.result),t.hideTransferModal(e))}))},this.changeOwner=function(e){var t=this,n=$("#id_new_user_id").val();$.postJSON(this.wwwDir+this.trasnsferuser+e+"/"+n,{type:"change_owner"},(function(n){"false"==n.error&&($("#transfer-block-"+n.chat_id).html(n.result),t.hideTransferModal(e))}))},this.changeDep=function(e){var t=this,n=$("#id_new_dep_id").val();$.postJSON(this.wwwDir+this.trasnsferuser+e+"/"+n,{type:"change_dep"},(function(n){"false"==n.error&&($("#transfer-block-"+n.chat_id).html(n.result),$("#myModal").modal("hide"),t.updateVoteStatus(e))}))},this.chooseSurvey=function(e){var t=$("[name=SurveyItem"+e+"]:checked").val();$.postJSON(this.wwwDir+"survey/choosesurvey/"+e+"/"+t,(function(e){"false"==e.error&&$("#survey-block-"+e.chat_id).html(e.result)}))},this.redirectContact=function(e,t){(void 0===t||confirm(t))&&$.postJSON(this.wwwDir+"chat/redirectcontact/"+e,(function(t){lhinst.syncadmininterfacestatic(),LHCCallbacks.userRedirectedContact&&LHCCallbacks.userRedirectedContact(e)}))},this.redirectToURL=function(e){lhc.revealModal({url:WWW_DIR_JAVASCRIPT+"chat/singleaction/"+e+"/redirecttourl"})},this.redirectToURLOnline=function(e,t){var n=prompt(t,"");null!=n&&(lhinst.addRemoteOnlineCommand(e,"lhc_chat_redirect:"+n.replace(new RegExp(":","g"),"__SPLIT__")),lhinst.addExecutionCommand(e,"lhc_cobrowse_multi_command__lhc_chat_redirect:"+n.replace(new RegExp(":","g"),"__SPLIT__")))},this.transferChatDep=function(e){var t=this,n=$("[name=DepartamentID"+e+"]:checked").val();$.postJSON(this.wwwDir+this.trasnsferuser+e+"/"+n,{type:"dep"},(function(n){"false"==n.error&&($("#transfer-block-"+n.chat_id).html(n.result),t.hideTransferModal(e))}))},this.chatTabsOpen=function(){return window.open(this.wwwDir+"chat/chattabs/","chatwindows","menubar=1,resizable=1,width=800,height=650"),!1},this.explicitClose=!1,this.sendCannedMessage=function(e,t){if($("#id_CannedMessage-"+e).val()>0){t.addClass("secondary");var n=1e3*parseInt($("#id_CannedMessage-"+e).find(":selected").attr("data-delay")),i=this.wwwDir,a=this;if(0==a.is_typing?(a.is_typing=!0,clearTimeout(a.typing_timeout),LHCCallbacks.initTypingMonitoringAdminInform&&LHCCallbacks.initTypingMonitoringAdminInform({chat_id:e,status:!0}),$.getJSON(i+"chat/operatortyping/"+e+"/true",{},(function(i){LHCCallbacks.initTypingMonitoringAdmin&&LHCCallbacks.initTypingMonitoringAdmin(e,!0),a.typing_timeout=setTimeout((function(){a.typingStoppedOperator(e),t.removeClass("secondary")}),n>3e3?n:3e3)})).fail((function(){a.typing_timeout=setTimeout((function(){a.typingStoppedOperator(e)}),3e3)}))):(clearTimeout(a.typing_timeout),a.typing_timeout=setTimeout((function(){a.typingStoppedOperator(e)}),3e3),t.removeClass("secondary")),n>0)setTimeout((function(){var t={msg:$("#id_CannedMessage-"+e).find(":selected").attr("data-msg")};$("#CSChatMessage-"+e).attr("mode-write")&&(t.mode_write=$("#CSChatMessage-"+e).attr("mode-write")),$("#CSChatMessage-"+e).val(""),$.postJSON(i+a.addmsgurl+e,t,(function(t){return LHCCallbacks.addmsgadmin&&LHCCallbacks.addmsgadmin(e),ee.emitEvent("chatAddMsgAdmin",[e]),lhinst.syncadmincall(),!0}))}),n);else{var o={msg:$("#id_CannedMessage-"+e).find(":selected").attr("data-msg")};$("#CSChatMessage-"+e).attr("mode-write")&&(o.mode_write=$("#CSChatMessage-"+e).attr("mode-write")),$("#CSChatMessage-"+e).val(""),$.postJSON(this.wwwDir+this.addmsgurl+e,o,(function(t){return LHCCallbacks.addmsgadmin&&LHCCallbacks.addmsgadmin(e),ee.emitEvent("chatAddMsgAdmin",[e]),lhinst.syncadmincall(),!0}))}}return!1},this.theme=null,this.chatStatus=null,this.survey=null,this.isBlinking=!1,this.startBlinking=function(){if(0==this.isBlinking){var e=this;(n=document.title,i="!!! "+document.title,a=function(){document.title=document.title==i?" ":i},o=function(){clearInterval(t),document.title=n,window.onmousemove=null,t=null,e.isBlinking=!1},function(){t||(t=setInterval(a,1e3),window.onmousemove=o)})(),this.isBlinking=!0}var t,n,i,a,o},this.playNewMessageSound=function(){Modernizr.audio&&null!==this.audio&&(this.audio.src=Modernizr.audio.ogg?WWW_DIR_JAVASCRIPT_FILES+"/new_message.ogg?v=3":Modernizr.audio.mp3?WWW_DIR_JAVASCRIPT_FILES+"/new_message.mp3?v=3":WWW_DIR_JAVASCRIPT_FILES+"/new_message.wav?v=3",this.audio.load()),$("textarea[name=ChatMessage]").is(":focus")||this.startBlinking()},this.playInvitationSound=function(){Modernizr.audio&&null!==this.audio&&(this.audio.src=Modernizr.audio.ogg?WWW_DIR_JAVASCRIPT_FILES+"/invitation.ogg":Modernizr.audio.mp3?WWW_DIR_JAVASCRIPT_FILES+"/invitation.mp3":WWW_DIR_JAVASCRIPT_FILES+"/invitation.wav",this.audio.load())},this.playPreloadSound=function(){Modernizr.audio&&null!==this.audio&&(this.audio.src=Modernizr.audio.ogg?WWW_DIR_JAVASCRIPT_FILES+"/silence.ogg":Modernizr.audio.mp3?WWW_DIR_JAVASCRIPT_FILES+"/silence.mp3":WWW_DIR_JAVASCRIPT_FILES+"/silence.wav",this.audio.load())},this.scrollLoading=!1,this.scrollPending=!1,this.loadPreviousMessages=function(e,t){if(0==this.scrollLoading){this.scrollLoading=!0;var n=this;$.getJSON(this.wwwDir+"chat/loadpreviousmessages/"+e.attr("chat-id")+"/"+e.attr("message-id")+"/(initial)/"+e.attr("data-initial")+"/(original)/"+e.attr("chat-original-id"),(function(i){if(0==i.error){e.attr("data-initial",0);var a=$("#messagesBlock-"+e.attr("chat-original-id"));if(a.prepend(i.result),1==e.attr("auto-scroll"))e.attr("auto-scroll",0),a.scrollTop(a.prop("scrollHeight"));else if(!t){var o=document.getElementById("scroll-to-chat-"+e.attr("chat-id")+"-"+e.attr("message-id"));o&&(a[0].scrollTop=o.offsetTop)}1==i.has_messages?(e.attr("message-id",i.message_id),e.attr("chat-id",i.chat_id),n.scrollLoading=!1,1==n.scrollPending&&(n.scrollPending=!1,n.loadPreviousMessages(e,t))):(e.remove(),n.scrollLoading=!1,n.scrollPending=!1)}else n.scrollLoading=!1,n.scrollPending=!1}))}else this.scrollPending=!0},this.hidenicknamesstatus=null,this.onScrollAdmin=function(e){var t=$("#messagesBlock-"+e),n=t.prop("scrollHeight");Math.abs(n-t.prop("scrollTop")-t.prop("clientHeight"))>20?$("#scroll-button-admin-"+e).removeClass("d-none"):$("#scroll-button-admin-"+e).addClass("d-none").find("> button").text($("#scroll-button-admin-"+e+" > button").attr("data-default"))},this.scrollToTheBottomMessage=function(e){var t=$("#unread-separator-"+e);if(t.length>0)t[0].scrollIntoView(),setTimeout((function(){t.remove()}),1e3);else{var n=$("#messagesBlock-"+e);n.scrollTop(n.prop("scrollHeight"))}},this.syncadmincall=function(){this.chatsSynchronising.length>0?0==this.underMessageAdd&&0==this.syncroRequestSend?(this.syncroRequestSend=!0,$.postJSON(this.wwwDir+this.syncadmin,{"chats[]":this.chatsSynchronisingMsg},(function(e){void 0!==e.error_url&&document.location.replace(e.error_url);try{if("false"==e.error){if("false"!=e.result){var t=!1;$.each(e.result,(function(n,i){var a=$("#messagesBlock-"+i.chat_id),o=a.prop("scrollHeight"),r=Math.abs(o-a.prop("scrollTop")-a.prop("clientHeight"));a.find(".pending-storage").slice(0,i.mn).remove();var s=$("#chat-tab-link-"+i.chat_id),c=!focused;if(!s.hasClass("active"))if(s.find("span.msg-nm").length>0){var l=parseInt(s.find("span.msg-nm").attr("rel"))+i.mn;s.find("span.msg-nm").html(" ("+l+")").attr("rel",l)}else c=!0,s.append(' ('+i.mn+")"),s.addClass("has-pm");r>20&&(c=!0,$("#scroll-button-admin-"+i.chat_id+" > button").text($("#scroll-button-admin-"+i.chat_id+" > button").attr("data-new"))),1==c&&null===document.getElementById("unread-separator-"+i.chat_id)&&(i.content=i.content.replace(''+confLH.transLation.new+'0&&$("#msg-"+i.msfrom).attr("data-op-id")!=i.msop&&$("#msg-"+i.msfrom).next().addClass("operator-changes"),ee.emitEvent("eventSyncAdmin",[i,n])})),1==confLH.new_message_sound_admin_enabled&&"false"==e.uw&&1==t&&lhinst.playNewMessageSound()}if("false"!=e.result_status){var n=$("#group-chats-status").hasClass("chat-active");$.each(e.result_status,(function(e,t){var i=$("#user-is-typing-"+t.chat_id);"true"==t.tp?(0==lhinst.nodeJsMode&&i.html(t.tx),"hidden"==i.css("visibility")&&i.css("visibility","visible")):0==lhinst.nodeJsMode&&i.css("visibility","hidden"),$("#last-msg-chat-"+t.chat_id).text(t.lmsg);var a=$("#user-chat-status-"+t.chat_id),o=a.hasClass("icon-user-online");$("#chat-duration-"+t.chat_id).text(t.cdur),a.removeClass("icon-user-online icon-user-away icon-user-pageview"),$("#msg-send-status-"+t.chat_id).removeClass("icon-user-online icon-user-offline"),0==t.us?a.addClass("icon-user-online"):2==t.us?a.addClass("icon-user-away"):3==t.us&&a.addClass("icon-user-pageview"),1==n?1==o&&0!=t.us||lhinst.hidenicknamesstatus!=n&&0!=t.us?$("#ntab-chat-"+t.chat_id).hide():(0==o&&0==t.us||lhinst.hidenicknamesstatus!=n&&0==t.us)&&$("#ntab-chat-"+t.chat_id).show():lhinst.hidenicknamesstatus!=n&&$("#ntab-chat-"+t.chat_id).show();var r=$("#chat-id-"+t.chat_id+"-mds");if(r.attr("data-chat-status")==t.cs&&r.attr("data-chat-user")==t.co||lhinst.updateVoteStatus(t.chat_id),1==t.um?(r.addClass("chat-unread"),$("#msg-send-status-"+t.chat_id).addClass("icon-user-offline")):($("#msg-send-status-"+t.chat_id).addClass("icon-user-online"),r.removeClass("chat-unread")),!1!==t.lp?r.attr("title",t.lp+" s."):r.attr("title",""),void 0!==t.oad&&1==t.oad){$("#lhc_sync_operation").remove();var s=document.getElementsByTagName("head")[0],c=document.createElement("script");c.setAttribute("id","lhc_sync_operation"),c.setAttribute("type","text/javascript"),c.setAttribute("src",WWW_DIR_JAVASCRIPT+"chat/loadoperatorjs/(type)/chat/(id)/"+t.chat_id),s.appendChild(c)}}))}e.cg&&$.each(e.cg,(function(e,t){return lhinst.removeDialogTab(t,$("#tabs"),!0)})),lhinst.hidenicknamesstatus=n,clearTimeout(lhinst.userTimeout),lhinst.userTimeout=setTimeout(chatsyncadmin,confLH.chat_message_sinterval),ee.emitEvent("chatAdminSync",[e])}}catch(e){clearTimeout(lhinst.userTimeout),lhinst.userTimeout=setTimeout(chatsyncadmin,confLH.chat_message_sinterval)}lhinst.setSynchronizationRequestSend(!1),LHCCallbacks.syncadmincall&&LHCCallbacks.syncadmincall(lhinst,e)})).fail((function(){clearTimeout(lhinst.userTimeout),lhinst.userTimeout=setTimeout(chatsyncadmin,confLH.chat_message_sinterval),lhinst.setSynchronizationRequestSend(!1)}))):(clearTimeout(lhinst.userTimeout),lhinst.userTimeout=setTimeout(chatsyncadmin,confLH.chat_message_sinterval)):this.isSinchronizing=!1},this.updateVoteStatus=function(e,t){var n=this;$.getJSON(this.wwwDir+"chat/updatechatstatus/"+e,{},(function(i){$("#main-user-info-tab-"+e).html(i.result),$("#messagesBlock-"+e+" span.vis-tit").each((function(e){var t=$(this).children();$(this).text(" "+i.nick).prepend(t)})),$("#ntab-chat-"+e).text(i.nick),ee.emitEvent("chatTabInfoReload",[e]),!t&&n.channel&&n.channel.postMessage({action:"update_chat",args:{chat_id:parseInt(e)}})}))},this.updateChatLastMessageID=function(e,t){this.chatsSynchronisingMsg[this.getChatIndex(e)]=e+","+t},this.requestNotificationPermission=function(){window.webkitNotifications?window.webkitNotifications.requestPermission():window.Notification?Notification.requestPermission((function(e){})):alert("Notification API in your browser is not supported.")},this.playNewChatAudio=function(e){if(clearTimeout(this.soundIsPlaying),this.soundPlayedTimes++,Modernizr.audio&&null!==this.audio&&(this.audio.src=Modernizr.audio.ogg?WWW_DIR_JAVASCRIPT_FILES+"/"+e+".ogg?v=4":Modernizr.audio.mp3?WWW_DIR_JAVASCRIPT_FILES+"/"+e+".mp3?v=4":WWW_DIR_JAVASCRIPT_FILES+"/"+e+".wav?v=4",this.audio.load(),confLH.repeat_sound>this.soundPlayedTimes)){var t=this;this.soundIsPlaying=setTimeout((function(){t.playNewChatAudio(e)}),1e3*confLH.repeat_sound_delay)}},this.focusChanged=function(e){if(1==confLH.new_message_browser_notification&&1==e&&(window.webkitNotifications||window.Notification)){var t=this;$.each(this.chatsSynchronising,(function(e,n){void 0!==t.notificationsArrayMessages[n]&&(window.webkitNotifications?t.notificationsArrayMessages[n].cancel():t.notificationsArrayMessages[n].close(),delete t.notificationsArrayMessages[n])}))}parseInt(this.chat_id)>0&&this.scheduleSync()},this.notificationsArrayMessages=[],this.showNewMessageNotification=function(e,t,n){try{if(window.Notification&&0==focused&&"granted"==window.Notification.permission){void 0!==this.notificationsArrayMessages[e]&&(this.notificationsArrayMessages[e].close(),delete this.notificationsArrayMessages[e]);var i=new Notification(n,{icon:WWW_DIR_JAVASCRIPT_FILES_NOTIFICATION+"/notification.png",body:t}),a=this;i.onclick=function(){window.focus(),i.close(),delete a.notificationsArrayMessages[e]},i.onclose=function(){void 0!==a.notificationsArrayMessages[e]&&delete a.notificationsArrayMessages[e]},this.notificationsArrayMessages[e]=i,this.scheduleNewMessageClose(i,e)}}catch(e){console.log(e)}},this.scheduleNewMessageClose=function(e,t){var n=this;setTimeout((function(){window.webkitNotifications?e.cancel():e.close(),void 0!==n.notificationsArrayMessages[t]&&delete n.notificationsArrayMessages[t]}),1e4)},this.playSoundNewAction=function(e,t,n,i,a){if(-1==this.backgroundChats.indexOf(parseInt(t))){ee.emitEvent("angularActionHappened",[{type:e,chat_id:t,msg:i,nick:n}]),1!=confLH.new_chat_sound_enabled||1!=confLH.sn_off&&"flash_on"!=$("#online-offline-user").text()||"active_chats"!=e&&"bot_chats"!=e&&"pending_chat"!=e&&"transfer_chat"!=e&&"unread_chat"!=e&&"pending_transfered"!=e||(this.soundPlayedTimes=0,this.playNewChatAudio("active_chats"==e?"alert":"new_chat")),$("textarea[name=ChatMessage]").is(":focus")||1!=confLH.sn_off&&"flash_on"!=$("#online-offline-user").text()||"subject_chats"!=e&&"active_chats"!=e&&"bot_chats"!=e&&"pending_chat"!=e&&"transfer_chat"!=e&&"unread_chat"!=e&&"pending_transfered"!=e||this.startBlinking(),"subject_chats"==e&&(this.soundPlayedTimes=0,this.playNewChatAudio("subject_chat"));var o=this;if(("subject_chats"==e||"active_chats"==e||"pending_chat"==e||"transfer_chat"==e||"unread_chat"==e||"bot_chats"==e||"pending_transfered"==e)&&(1==confLH.sn_off||"flash_on"==$("#online-offline-user").text())&&window.Notification&&"granted"==window.Notification.permission){var r=new Notification(n,{icon:WWW_DIR_JAVASCRIPT_FILES_NOTIFICATION+"/notification.png",body:i,requireInteraction:!0});r.onclick=function(){"subject_chats"==e||"active_chats"==e||"pending_chat"==e||"unread_chat"==e||"pending_transfered"==e||"bot_chats"==e?$("#tabs").length>0?(window.focus(),o.startChat(t,$("#tabs"),a)):o.startChatNewWindow(t,"ChatRequest"):o.startChatNewWindowTransferByTransfer(t,a),r.close()},"pending_transfered"!=e&&("undefined"!==this.notificationsArray[t]&&r.close(),this.notificationsArray[t]=r)}"transfer_chat"==e&&confLH.accept_chats?o.startChatNewWindowTransferByTransfer(t,a,!0):"transfer_chat"==e&&1==confLH.show_alert_transfer&&confirm(confLH.transLation.transfered+"\n\n"+i)&&o.startChatNewWindowTransferByTransfer(t,a),1==confLH.show_alert&&confirm(confLH.transLation.new_chat+"\n\n"+i)&&("pending_chat"==e||"unread_chat"==e||"pending_transfered"==e||"bot_chats"==e?$("#tabs").length>0?(window.focus(),o.startChat(t,$("#tabs"),a)):o.startChatNewWindow(t,"ChatRequest"):o.startChatNewWindowTransferByTransfer(t,a))}},this.syncadmininterfacestatic=function(){try{ee.emitEvent("angularLoadChatList")}catch(e){}},this.addingUserMessage=!1,this.addUserMessageQueue=[],this.addDelayedTimeout=null,this.addmsgadmin=function(e,t){$("#unread-separator-"+e).remove();var n=$("#CSChatMessage-"+e);if(!n.is("[readonly]")){var i={msg:t||n.val()};if(n.attr("meta-msg")&&(i.meta_msg=n.attr("meta-msg"),n.removeAttr("meta-msg")),n.attr("mode-write")&&(i.mode_write=n.attr("mode-write")),""!=i.msg){!1!==this.speechHandler&&this.speechHandler.messageSend(),t||n.val("");var a=n.attr("placeholder");if(n.attr("placeholder",confLH.transLation.sending||"Sending..."),n.hasClass("edit-mode"))i.msgid=n.attr("data-msgid"),$.postJSON(this.wwwDir+"chat/updatemsg/"+e,i,(function(t){if(n.attr("placeholder",a),"f"==t.error)return n.removeClass("edit-mode"),n.removeAttr("data-msgid"),$("#msg-"+i.msgid).replaceWith(t.msg),LHCCallbacks.addmsgadmin&&LHCCallbacks.addmsgadmin(e),ee.emitEvent("chatAddMsgAdmin",[e]),lhinst.addQuateHandler(e),!0}));else{var o=this,r=$("#messagesBlock-"+e);if(t||r.append('
autorenew'+$("
").text(i.msg).html()+"
"),r.scrollTop(r.prop("scrollHeight")),0==this.addingUserMessage){this.addingUserMessage=!0;var s=!1;n.attr("subjects_ids")&&(i.subjects_ids=n.attr("subjects_ids"),n.removeAttr("subjects_ids"),s=!0),n.attr("canned_id")&&(i.canned_id=n.attr("canned_id"),n.removeAttr("canned_id")),n.attr("whisper")&&(i.whisper=1),$.postJSON(this.wwwDir+this.addmsgurl+e,i,(function(t){if(n.removeAttr("readonly").attr("placeholder",a),"false"==t.error)LHCCallbacks.addmsgadmin&&LHCCallbacks.addmsgadmin(e),ee.emitEvent("chatAddMsgAdmin",[e]),""!=t.r&&$("#messagesBlock-"+e).append(t.r).scrollTop($("#messagesBlock-"+e).prop("scrollHeight")).find(".pending-storage").remove(),!0===t.hold_removed?$("#hold-action-"+e).removeClass("btn-outline-info"):!0===t.hold_added&&$("#hold-action-"+e).addClass("btn-outline-info"),1!=s&&!0!==t.update_status||o.updateVoteStatus(e),lhinst.syncadmincall();else{void 0!==t.token&&(confLH.csrf_token=t.token),n.attr("placeholder",a).val((n.val()+" "+i.msg).trim()),$(".pending-storage").first().remove();var r='