1let isClickLiveChat = false; 2let timeClickLiveChat = 0; 3let checkWidgetTime = 1000; 4let checkTawkTimeout = 0; 5$(function () { 6 try { 7 Tawk_API.onLoad = showHideLiveChat; 8 Tawk_API.onChatMinimized = showHideLiveChat; 9 checkTawkTimeout = setTimeout(checkWidgetTawk, checkWidgetTime); 10 } catch (e) { } 11 try { 12 LiveChatWidget.on('ready', showHideLiveChat); 13 LiveChatWidget.on('visibility_changed', function (data) { 14 if (data.visibility == 'minimized' && (Date.now() - timeClickLiveChat) > checkWidgetTime) showHideLiveChat(); 15 }); 16 } catch (e) { } 17 try { 18 $zopim(function () { 19 $zopim.livechat.window.onHide(showHideLiveChat); 20 }); 21 } catch (e) { } 22 try { 23 window.chaport.on('ready', function () { 24 var state = window.chaport.getWidgetState(); 25 if (state === 'unreadMessage') { 26 window.chaport.showLauncher(); 27 } else { 28 showHideLiveChat(); 29 } 30 window.chaport.on('chat.autoInvitation', function () { 31 window.chaport.showLauncher(); 32 }); 33 window.chaport.on('widget.stateChange', function (widgetstate) { 34 if (widgetstate.toState == 'unreadMessage') { 35 window.chaport.showLauncher(); 36 } else { 37 showHideLiveChat(); 38 } 39 }); 40 }); 41 } catch (e) { } 42 $(window).on('resize', function () { 43 if (!isClickLiveChat) showHideLiveChat(); 44 }); 45}); 46 47function checkWidgetTawk() { 48 try { 49 clearTimeout(checkTawkTimeout); 50 if (!Tawk_API.onLoaded || Tawk_API.isChatMaximized()) checkTawkTimeout = setTimeout(checkWidgetTawk, checkWidgetTime); 51 else if (Tawk_API.onLoaded && Tawk_API.isChatMinimized() && !Tawk_API.isChatHidden()) showHideLiveChat(); 52 } catch (e) { } 53} 54function showHideLiveChat() { 55 try { 56 if (isDesktopView === "True") Tawk_API.showWidget(); 57 else Tawk_API.hideWidget(); 58 isClickLiveChat = false; 59 } catch (e) { } 60 try { 61 if (isDesktopView === "True") LiveChatWidget.call('minimize'); 62 else LiveChatWidget.call('hide'); 63 isClickLiveChat = false; 64 } catch (e) { } 65 try { 66 if (isDesktopView === "True") $zopim.livechat.button.show(); 67 else $zopim.livechat.hideAll(); 68 isClickLiveChat = false; 69 } catch (e) { } 70 try { 71 if (isDesktopView === "True") window.chaport.showLauncher(); 72 else window.chaport.hideLauncher(); 73 isClickLiveChat = false; 74 } catch (e) { } 75} 76function showLiveChat() { 77 try { 78 Tawk_API.showWidget(); 79 Tawk_API.maximize(); 80 checkTawkTimeout = setTimeout(checkWidgetTawk, checkWidgetTime); 81 isClickLiveChat = true; 82 } catch (e) { } 83 try { 84 LiveChatWidget.call('maximize'); 85 isClickLiveChat = true; 86 timeClickLiveChat = Date.now(); 87 } catch (e) { } 88 try { 89 $zopim.livechat.window.show(); 90 isClickLiveChat = true; 91 } catch (e) { } 92 try { 93 window.chaport.open(); 94 isClickLiveChat = true; 95 } catch (e) { } 96}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.