if (!window.zammadChatTemplates) { window.zammadChatTemplates = {}; } window.zammadChatTemplates["agent"] = function (__obj) { if (!__obj) __obj = {}; var __out = [], __capture = function(callback) { var out = __out, result; __out = []; callback.call(this); result = __out.join(''); __out = out; return __safe(result); }, __sanitize = function(value) { if (value && value.ecoSafe) { return value; } else if (typeof value !== 'undefined' && value != null) { return __escape(value); } else { return ''; } }, __safe, __objSafe = __obj.safe, __escape = __obj.escape; __safe = __obj.safe = function(value) { if (value && value.ecoSafe) { return value; } else { if (!(typeof value !== 'undefined' && value != null)) value = ''; var result = new String(value); result.ecoSafe = true; return result; } }; if (!__escape) { __escape = __obj.escape = function(value) { return ('' + value) .replace(/&/g, '&') .replace(//g, '>') .replace(/"/g, '"'); }; } (function() { (function() { if (this.agent.avatar) { __out.push('\n\n'); } __out.push('\n\n '); __out.push(__sanitize(this.agent.name)); __out.push('\n'); }).call(this); }).call(__obj); __obj.safe = __objSafe, __obj.escape = __escape; return __out.join(''); }; var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, slice = [].slice; (function($, window) { var ZammadChat, myScript, scriptHost, scripts; scripts = document.getElementsByTagName('script'); myScript = scripts[scripts.length - 1]; scriptHost = myScript.src.match(".*://([^:/]*).*")[1]; ZammadChat = (function() { ZammadChat.prototype.defaults = { show: true, target: $('body'), host: '', port: 6042, debug: false, fontSize: void 0, buttonSelector: '.open-zammad-chat', hiddenButtonClass: 'is-inactive', title: 'Chat with us!' }; ZammadChat.prototype._messageCount = 0; ZammadChat.prototype.isOpen = true; ZammadChat.prototype.blinkOnlineInterval = null; ZammadChat.prototype.stopBlinOnlineStateTimeout = null; ZammadChat.prototype.showTimeEveryXMinutes = 1; ZammadChat.prototype.lastTimestamp = null; ZammadChat.prototype.lastAddedType = null; ZammadChat.prototype.inputTimeout = null; ZammadChat.prototype.isTyping = false; ZammadChat.prototype.state = 'offline'; ZammadChat.prototype.initialQueueDelay = 10000; ZammadChat.prototype.wsReconnectEnable = true; ZammadChat.prototype.strings = { 'Online': 'Online', 'Offline': 'Offline', 'Connecting': 'Verbinden', 'Connection re-established': 'Verbindung wiederhergestellt', 'Today': 'Heute', 'Send': 'Senden', 'Compose your message...': 'Ihre Nachricht...', 'All colleges are busy.': 'Alle Kollegen sind belegt.', 'You are on waiting list position %s.': 'Sie sind in der Warteliste an der Position %s.', 'Start new conversation': 'Neue Konversation starten', 'Since you didn\'t respond in the last %s your conversation with %s got closed.': 'Da sie in den letzten %s nichts geschrieben haben wurde ihre Konversation mit %s geschlossen.', 'minutes': 'Minuten' }; ZammadChat.prototype.sessionId = void 0; ZammadChat.prototype.T = function() { var i, item, items, len, string, translation; string = arguments[0], items = 2 <= arguments.length ? slice.call(arguments, 1) : []; if (!this.strings[string]) { this.log('notice', "Translation needed for '" + string + "'"); } translation = this.strings[string] || string; if (items) { for (i = 0, len = items.length; i < len; i++) { item = items[i]; translation = translation.replace(/%s/, item); } } return translation; }; ZammadChat.prototype.log = function() { var level, string; level = arguments[0], string = 2 <= arguments.length ? slice.call(arguments, 1) : []; if (!this.options.debug && level === 'debug') { return; } string.unshift(level); return console.log.apply(console, string); }; ZammadChat.prototype.view = function(name) { return (function(_this) { return function(options) { if (!options) { options = {}; } options.T = _this.T; options.background = _this.options.background; options.flat = _this.options.flat; options.fontSize = _this.options.fontSize; return window.zammadChatTemplates[name](options); }; })(this); }; function ZammadChat(options) { this.setAgentOnlineState = bind(this.setAgentOnlineState, this); this.onConnectionEstablished = bind(this.onConnectionEstablished, this); this.setSessionId = bind(this.setSessionId, this); this.onConnectionReestablished = bind(this.onConnectionReestablished, this); this.reconnect = bind(this.reconnect, this); this.onWebSocketOpen = bind(this.onWebSocketOpen, this); this.wsReconnect = bind(this.wsReconnect, this); this.wsClose = bind(this.wsClose, this); this.wsConnect = bind(this.wsConnect, this); this.onAgentTypingEnd = bind(this.onAgentTypingEnd, this); this.onAgentTypingStart = bind(this.onAgentTypingStart, this); this.onQueue = bind(this.onQueue, this); this.onQueueScreen = bind(this.onQueueScreen, this); this.onCloseAnimationEnd = bind(this.onCloseAnimationEnd, this); this.closeWindow = bind(this.closeWindow, this); this.close = bind(this.close, this); this.onOpenAnimationEnd = bind(this.onOpenAnimationEnd, this); this.open = bind(this.open, this); this.renderMessage = bind(this.renderMessage, this); this.receiveMessage = bind(this.receiveMessage, this); this.onSubmit = bind(this.onSubmit, this); this.onTypingEnd = bind(this.onTypingEnd, this); this.onInput = bind(this.onInput, this); this.reopenSession = bind(this.reopenSession, this); this.onError = bind(this.onError, this); this.onReady = bind(this.onReady, this); this.onWebSocketMessage = bind(this.onWebSocketMessage, this); this.send = bind(this.send, this); this.checkForEnter = bind(this.checkForEnter, this); this.view = bind(this.view, this); this.log = bind(this.log, this); this.T = bind(this.T, this); if (!window.WebSocket || !sessionStorage) { this.state = 'unsupported'; this.log('notice', 'Chat: Browser not supported!'); return; } this.options = $.extend({}, this.defaults, options); this.el = $(this.view('chat')({ title: this.options.title })); this.options.target.append(this.el); this.input = this.el.find('.zammad-chat-input'); this.el.find('.js-chat-open').click(this.open); this.el.find('.js-chat-close').click(this.close); this.el.find('.zammad-chat-controls').on('submit', this.onSubmit); this.input.on({ keydown: this.checkForEnter, input: this.onInput }); this.wsConnect(); } ZammadChat.prototype.checkForEnter = function(event) { if (!event.shiftKey && event.keyCode === 13) { event.preventDefault(); return this.sendMessage(); } }; ZammadChat.prototype.send = function(event, data) { var pipe; this.log('debug', 'ws:send', event, data); pipe = JSON.stringify({ event: event, data: data }); return this.ws.send(pipe); }; ZammadChat.prototype.onWebSocketMessage = function(e) { var i, len, pipe, pipes; pipes = JSON.parse(e.data); for (i = 0, len = pipes.length; i < len; i++) { pipe = pipes[i]; this.log('debug', 'ws:onmessage', pipe); switch (pipe.event) { case 'chat_session_message': if (pipe.data.self_written) { return; } this.receiveMessage(pipe.data); break; case 'chat_session_typing': if (pipe.data.self_written) { return; } this.onAgentTypingStart(); break; case 'chat_session_start': this.onConnectionEstablished(pipe.data); break; case 'chat_session_queue': this.onQueueScreen(pipe.data); break; case 'chat_session_closed': this.onSessionClosed(pipe.data); break; case 'chat_session_left': this.onSessionClosed(pipe.data); break; case 'chat_status_customer': switch (pipe.data.state) { case 'online': this.sessionId = void 0; this.onReady(); this.log('debug', 'Zammad Chat: ready'); break; case 'offline': this.onError('Zammad Chat: No agent online'); this.state = 'off'; this.hide(); this.wsClose(); break; case 'chat_disabled': this.onError('Zammad Chat: Chat is disabled'); this.state = 'off'; this.hide(); this.wsClose(); break; case 'no_seats_available': this.onError('Zammad Chat: Too many clients in queue. Clients in queue: ', pipe.data.queue); this.state = 'off'; this.hide(); this.wsClose(); break; case 'reconnect': this.log('debug', 'old messages', pipe.data.session); this.reopenSession(pipe.data); } } } }; ZammadChat.prototype.onReady = function() { $(this.options.buttonSelector).click(this.open).removeClass(this.hiddenButtonClass); if (this.options.show) { return this.show(); } }; ZammadChat.prototype.onError = function(message) { this.log('debug', message); return $(this.options.buttonSelector).hide(); }; ZammadChat.prototype.reopenSession = function(data) { var i, len, message, ref, unfinishedMessage; unfinishedMessage = sessionStorage.getItem('unfinished_message'); if (data.agent) { this.onConnectionEstablished(data); ref = data.session; for (i = 0, len = ref.length; i < len; i++) { message = ref[i]; this.renderMessage({ message: message.content, id: message.id, from: message.created_by_id ? 'agent' : 'customer' }); } if (unfinishedMessage) { this.input.val(unfinishedMessage); } } if (data.position) { this.onQueue(data); } this.show(); this.open(); this.scrollToBottom(); if (unfinishedMessage) { return this.input.focus(); } }; ZammadChat.prototype.onInput = function() { this.el.find('.zammad-chat-message--unread').removeClass('zammad-chat-message--unread'); sessionStorage.setItem('unfinished_message', this.input.val()); return this.onTypingStart(); }; ZammadChat.prototype.onTypingStart = function() { if (this.isTypingTimeout) { clearTimeout(this.isTypingTimeout); } this.isTypingTimeout = setTimeout(this.onTypingEnd, 1500); if (!this.isTyping) { this.isTyping = true; return this.send('chat_session_typing', { session_id: this.sessionId }); } }; ZammadChat.prototype.onTypingEnd = function() { return this.isTyping = false; }; ZammadChat.prototype.onSubmit = function(event) { event.preventDefault(); return this.sendMessage(); }; ZammadChat.prototype.sendMessage = function() { var message, messageElement; message = this.input.val(); if (!message) { return; } sessionStorage.removeItem('unfinished_message'); messageElement = this.view('message')({ message: message, from: 'customer', id: this._messageCount++ }); this.maybeAddTimestamp(); if (this.el.find('.zammad-chat-message--typing').size()) { this.lastAddedType = 'typing-placeholder'; this.el.find('.zammad-chat-message--typing').before(messageElement); } else { this.lastAddedType = 'message--customer'; this.el.find('.zammad-chat-body').append(messageElement); } this.input.val(''); this.scrollToBottom(); this.isTyping = false; return this.send('chat_session_message', { content: message, id: this._messageCount, session_id: this.sessionId }); }; ZammadChat.prototype.receiveMessage = function(data) { this.onAgentTypingEnd(); this.maybeAddTimestamp(); return this.renderMessage({ message: data.message.content, id: data.id, from: 'agent' }); }; ZammadChat.prototype.renderMessage = function(data) { var ref, unread; this.lastAddedType = "message--" + data.from; unread = (ref = document.hidden) != null ? ref : { " zammad-chat-message--unread": "" }; this.el.find('.zammad-chat-body').append(this.view('message')(data)); return this.scrollToBottom(); }; ZammadChat.prototype.open = function() { if (this.isOpen) { this.show(); } if (!this.sessionId) { this.showLoader(); } this.el.addClass('zammad-chat-is-open'); if (!this.sessionId) { this.el.animate({ bottom: 0 }, 500, this.onOpenAnimationEnd); } else { this.el.css('bottom', 0); this.onOpenAnimationEnd(); } this.isOpen = true; if (!this.sessionId) { return this.session_init(); } }; ZammadChat.prototype.onOpenAnimationEnd = function() {}; ZammadChat.prototype.close = function(event) { if (this.state === 'off' || this.state === 'unsupported') { return this.state; } if (event) { event.stopPropagation(); } if (!this.sessionId) { return; } if (this.onInitialQueueDelayId) { clearTimeout(this.onInitialQueueDelayId); } return this.closeWindow(); }; ZammadChat.prototype.closeWindow = function() { var remainerHeight; remainerHeight = this.el.height() - this.el.find('.zammad-chat-header').outerHeight(); return this.el.animate({ bottom: -remainerHeight }, 500, this.onCloseAnimationEnd); }; ZammadChat.prototype.onCloseAnimationEnd = function() { this.el.removeClass('zammad-chat-is-open'); this.disconnect(); this.isOpen = false; this.send('chat_session_close', { session_id: this.sessionId }); this.setSessionId(void 0); sessionStorage.removeItem('unfinished_message'); return this.onWebSocketOpen(); }; ZammadChat.prototype.hide = function() { return this.el.removeClass('zammad-chat-is-visible'); }; ZammadChat.prototype.show = function() { var remainerHeight; if (this.state === 'off' || this.state === 'unsupported') { return this.state; } this.el.addClass('zammad-chat-is-visible'); if (!this.inputInitialized) { this.inputInitialized = true; this.input.autoGrow({ extraLine: false }); } remainerHeight = this.el.height() - this.el.find('.zammad-chat-header').outerHeight(); return this.el.css('bottom', -remainerHeight); }; ZammadChat.prototype.disableInput = function() { this.input.prop('disabled', true); return this.el.find('.zammad-chat-send').prop('disabled', true); }; ZammadChat.prototype.enableInput = function() { this.input.prop('disabled', false); return this.el.find('.zammad-chat-send').prop('disabled', false); }; ZammadChat.prototype.onQueueScreen = function(data) { var show; this.setSessionId(data.session_id); show = (function(_this) { return function() { return _this.onQueue(data); }; })(this); if (this.initialQueueDelay && !this.onInitialQueueDelayId) { this.onInitialQueueDelayId = setTimeout(show, this.initialQueueDelay); return; } if (this.onInitialQueueDelayId) { clearTimeout(this.onInitialQueueDelayId); } return show(); }; ZammadChat.prototype.onQueue = function(data) { this.log('notice', 'onQueue', data.position); this.inQueue = true; return this.el.find('.zammad-chat-body').html(this.view('waiting')({ position: data.position })); }; ZammadChat.prototype.onAgentTypingStart = function() { if (this.stopTypingId) { clearTimeout(this.stopTypingId); } this.stopTypingId = setTimeout(this.onAgentTypingEnd, 3000); if (this.el.find('.zammad-chat-message--typing').size()) { return; } this.maybeAddTimestamp(); this.el.find('.zammad-chat-body').append(this.view('typingIndicator')()); return this.scrollToBottom(); }; ZammadChat.prototype.onAgentTypingEnd = function() { return this.el.find('.zammad-chat-message--typing').remove(); }; ZammadChat.prototype.maybeAddTimestamp = function() { var label, time, timestamp; timestamp = Date.now(); if (!this.lastTimestamp || (timestamp - this.lastTimestamp) > this.showTimeEveryXMinutes * 60000) { label = this.T('Today'); time = new Date().toTimeString().substr(0, 5); if (this.lastAddedType === 'timestamp') { this.updateLastTimestamp(label, time); return this.lastTimestamp = timestamp; } else { this.el.find('.zammad-chat-body').append(this.view('timestamp')({ label: label, time: time })); this.lastTimestamp = timestamp; this.lastAddedType = 'timestamp'; return this.scrollToBottom(); } } }; ZammadChat.prototype.updateLastTimestamp = function(label, time) { return this.el.find('.zammad-chat-body').find('.zammad-chat-timestamp').last().replaceWith(this.view('timestamp')({ label: label, time: time })); }; ZammadChat.prototype.addStatus = function(status) { this.maybeAddTimestamp(); this.el.find('.zammad-chat-body').append(this.view('status')({ status: status })); return this.scrollToBottom(); }; ZammadChat.prototype.scrollToBottom = function() { return this.el.find('.zammad-chat-body').scrollTop($('.zammad-chat-body').prop('scrollHeight')); }; ZammadChat.prototype.session_init = function() { return this.send('chat_session_init'); }; ZammadChat.prototype.detectHost = function() { return this.options.host = "ws://" + scriptHost; }; ZammadChat.prototype.wsConnect = function() { if (!this.options.host) { this.detectHost(); } this.log('notice', "Connecting to " + this.options.host + ":" + this.options.port); this.ws = new window.WebSocket(this.options.host + ":" + this.options.port); this.ws.onopen = this.onWebSocketOpen; this.ws.onmessage = this.onWebSocketMessage; this.ws.onclose = (function(_this) { return function(e) { _this.log('debug', 'close websocket connection'); if (_this.wsReconnectEnable) { return _this.reconnect(); } }; })(this); return this.ws.onerror = (function(_this) { return function(e) { return _this.log('debug', 'ws:onerror', e); }; })(this); }; ZammadChat.prototype.wsClose = function() { this.wsReconnectEnable = false; return this.ws.close(); }; ZammadChat.prototype.wsReconnect = function() { if (this.reconnectDelayId) { clearTimeout(this.reconnectDelayId); } return this.reconnectDelayId = setTimeout(this.wsConnect, 5000); }; ZammadChat.prototype.onWebSocketOpen = function() { this.sessionId = sessionStorage.getItem('sessionId'); this.log('debug', 'ws connected'); this.send('chat_status_customer', { session_id: this.sessionId }); return this.setAgentOnlineState('online'); }; ZammadChat.prototype.reconnect = function() { this.log('notice', 'reconnecting'); this.disableInput(); this.lastAddedType = 'status'; this.setAgentOnlineState('connecting'); this.addStatus(this.T('Connection lost')); return this.wsReconnect(); }; ZammadChat.prototype.onConnectionReestablished = function() { this.lastAddedType = 'status'; this.setAgentOnlineState('online'); return this.addStatus(this.T('Connection re-established')); }; ZammadChat.prototype.onSessionClosed = function(data) { this.addStatus(this.T('Chat closed by %s', data.realname)); return this.disableInput(); }; ZammadChat.prototype.disconnect = function() { this.showLoader(); this.el.find('.zammad-chat-welcome').removeClass('zammad-chat-is-hidden'); this.el.find('.zammad-chat-agent').addClass('zammad-chat-is-hidden'); return this.el.find('.zammad-chat-agent-status').addClass('zammad-chat-is-hidden'); }; ZammadChat.prototype.setSessionId = function(id) { this.sessionId = id; if (id === void 0) { return sessionStorage.removeItem('sessionId'); } else { return sessionStorage.setItem('sessionId', id); } }; ZammadChat.prototype.onConnectionEstablished = function(data) { if (this.onInitialQueueDelayId) { clearTimeout(this.onInitialQueueDelayId); } this.inQueue = false; if (data.agent) { this.agent = data.agent; } if (data.session_id) { this.setSessionId(data.session_id); } this.el.find('.zammad-chat-agent').html(this.view('agent')({ agent: this.agent })); this.enableInput(); this.el.find('.zammad-chat-body').empty(); this.el.find('.zammad-chat-welcome').addClass('zammad-chat-is-hidden'); this.el.find('.zammad-chat-agent').removeClass('zammad-chat-is-hidden'); this.el.find('.zammad-chat-agent-status').removeClass('zammad-chat-is-hidden'); return this.input.focus(); }; ZammadChat.prototype.showTimeout = function() { return this.el.find('.zammad-chat-body').html(this.view('timeout')({ agent: this.agent.name, delay: 10, unit: this.T('minutes') })); }; ZammadChat.prototype.showLoader = function() { return this.el.find('.zammad-chat-body').html(this.view('loader')()); }; ZammadChat.prototype.setAgentOnlineState = function(state) { var capitalizedState; this.state = state; capitalizedState = state.charAt(0).toUpperCase() + state.slice(1); return this.el.find('.zammad-chat-agent-status').attr('data-status', state).text(this.T(capitalizedState)); }; return ZammadChat; })(); return window.ZammadChat = ZammadChat; })(window.jQuery, window); /*! * ---------------------------------------------------------------------------- * "THE BEER-WARE LICENSE" (Revision 42): * wrote this file. As long as you retain this notice you * can do whatever you want with this stuff. If we meet some day, and you think * this stuff is worth it, you can buy me a beer in return. Jevin O. Sewaruth * ---------------------------------------------------------------------------- * * Autogrow Textarea Plugin Version v3.0 * http://www.technoreply.com/autogrow-textarea-plugin-3-0 * * THIS PLUGIN IS DELIVERD ON A PAY WHAT YOU WHANT BASIS. IF THE PLUGIN WAS USEFUL TO YOU, PLEASE CONSIDER BUYING THE PLUGIN HERE : * https://sites.fastspring.com/technoreply/instant/autogrowtextareaplugin * * Date: October 15, 2012 */ jQuery.fn.autoGrow = function(options) { return this.each(function() { var settings = jQuery.extend({ extraLine: true, }, options); var createMirror = function(textarea) { jQuery(textarea).after('
'); return jQuery(textarea).next('.autogrow-textarea-mirror')[0]; } var sendContentToMirror = function (textarea) { mirror.innerHTML = String(textarea.value) .replace(/&/g, '&') .replace(/"/g, '"') .replace(/'/g, ''') .replace(//g, '>') .replace(/ /g, ' ') .replace(/\n/g, '
') + (settings.extraLine? '.
.' : '') ; if (jQuery(textarea).height() != jQuery(mirror).height()) jQuery(textarea).height(jQuery(mirror).height()); } var growTextarea = function () { sendContentToMirror(this); } // Create a mirror var mirror = createMirror(this); // Style the mirror mirror.style.display = 'none'; mirror.style.wordWrap = 'break-word'; mirror.style.whiteSpace = 'normal'; mirror.style.padding = jQuery(this).css('paddingTop') + ' ' + jQuery(this).css('paddingRight') + ' ' + jQuery(this).css('paddingBottom') + ' ' + jQuery(this).css('paddingLeft'); mirror.style.width = jQuery(this).css('width'); mirror.style.fontFamily = jQuery(this).css('font-family'); mirror.style.fontSize = jQuery(this).css('font-size'); mirror.style.lineHeight = jQuery(this).css('line-height'); // Style the textarea this.style.overflow = "hidden"; this.style.minHeight = this.rows+"em"; // Bind the textarea's event this.onkeyup = growTextarea; // Fire the event for text already present sendContentToMirror(this); }); }; if (!window.zammadChatTemplates) { window.zammadChatTemplates = {}; } window.zammadChatTemplates["chat"] = function (__obj) { if (!__obj) __obj = {}; var __out = [], __capture = function(callback) { var out = __out, result; __out = []; callback.call(this); result = __out.join(''); __out = out; return __safe(result); }, __sanitize = function(value) { if (value && value.ecoSafe) { return value; } else if (typeof value !== 'undefined' && value != null) { return __escape(value); } else { return ''; } }, __safe, __objSafe = __obj.safe, __escape = __obj.escape; __safe = __obj.safe = function(value) { if (value && value.ecoSafe) { return value; } else { if (!(typeof value !== 'undefined' && value != null)) value = ''; var result = new String(value); result.ecoSafe = true; return result; } }; if (!__escape) { __escape = __obj.escape = function(value) { return ('' + value) .replace(/&/g, '&') .replace(//g, '>') .replace(/"/g, '"'); }; } (function() { (function() { __out.push('
\n
\n
\n \n \n \n \n \n
\n
\n
\n
\n \n '); __out.push(this.title); __out.push('\n
\n
\n
\n
\n \n \n
\n
'); }).call(this); }).call(__obj); __obj.safe = __objSafe, __obj.escape = __escape; return __out.join(''); }; if (!window.zammadChatTemplates) { window.zammadChatTemplates = {}; } window.zammadChatTemplates["loader"] = function (__obj) { if (!__obj) __obj = {}; var __out = [], __capture = function(callback) { var out = __out, result; __out = []; callback.call(this); result = __out.join(''); __out = out; return __safe(result); }, __sanitize = function(value) { if (value && value.ecoSafe) { return value; } else if (typeof value !== 'undefined' && value != null) { return __escape(value); } else { return ''; } }, __safe, __objSafe = __obj.safe, __escape = __obj.escape; __safe = __obj.safe = function(value) { if (value && value.ecoSafe) { return value; } else { if (!(typeof value !== 'undefined' && value != null)) value = ''; var result = new String(value); result.ecoSafe = true; return result; } }; if (!__escape) { __escape = __obj.escape = function(value) { return ('' + value) .replace(/&/g, '&') .replace(//g, '>') .replace(/"/g, '"'); }; } (function() { (function() { __out.push('
\n \n \n \n \n \n '); __out.push(__sanitize(this.T('Connecting'))); __out.push('\n
'); }).call(this); }).call(__obj); __obj.safe = __objSafe, __obj.escape = __escape; return __out.join(''); }; if (!window.zammadChatTemplates) { window.zammadChatTemplates = {}; } window.zammadChatTemplates["message"] = function (__obj) { if (!__obj) __obj = {}; var __out = [], __capture = function(callback) { var out = __out, result; __out = []; callback.call(this); result = __out.join(''); __out = out; return __safe(result); }, __sanitize = function(value) { if (value && value.ecoSafe) { return value; } else if (typeof value !== 'undefined' && value != null) { return __escape(value); } else { return ''; } }, __safe, __objSafe = __obj.safe, __escape = __obj.escape; __safe = __obj.safe = function(value) { if (value && value.ecoSafe) { return value; } else { if (!(typeof value !== 'undefined' && value != null)) value = ''; var result = new String(value); result.ecoSafe = true; return result; } }; if (!__escape) { __escape = __obj.escape = function(value) { return ('' + value) .replace(/&/g, '&') .replace(//g, '>') .replace(/"/g, '"'); }; } (function() { (function() { __out.push('
\n '); __out.push(this.message); __out.push('\n
'); }).call(this); }).call(__obj); __obj.safe = __objSafe, __obj.escape = __escape; return __out.join(''); }; if (!window.zammadChatTemplates) { window.zammadChatTemplates = {}; } window.zammadChatTemplates["status"] = function (__obj) { if (!__obj) __obj = {}; var __out = [], __capture = function(callback) { var out = __out, result; __out = []; callback.call(this); result = __out.join(''); __out = out; return __safe(result); }, __sanitize = function(value) { if (value && value.ecoSafe) { return value; } else if (typeof value !== 'undefined' && value != null) { return __escape(value); } else { return ''; } }, __safe, __objSafe = __obj.safe, __escape = __obj.escape; __safe = __obj.safe = function(value) { if (value && value.ecoSafe) { return value; } else { if (!(typeof value !== 'undefined' && value != null)) value = ''; var result = new String(value); result.ecoSafe = true; return result; } }; if (!__escape) { __escape = __obj.escape = function(value) { return ('' + value) .replace(/&/g, '&') .replace(//g, '>') .replace(/"/g, '"'); }; } (function() { (function() { __out.push('
'); __out.push(this.status); __out.push('
'); }).call(this); }).call(__obj); __obj.safe = __objSafe, __obj.escape = __escape; return __out.join(''); }; if (!window.zammadChatTemplates) { window.zammadChatTemplates = {}; } window.zammadChatTemplates["timeout"] = function (__obj) { if (!__obj) __obj = {}; var __out = [], __capture = function(callback) { var out = __out, result; __out = []; callback.call(this); result = __out.join(''); __out = out; return __safe(result); }, __sanitize = function(value) { if (value && value.ecoSafe) { return value; } else if (typeof value !== 'undefined' && value != null) { return __escape(value); } else { return ''; } }, __safe, __objSafe = __obj.safe, __escape = __obj.escape; __safe = __obj.safe = function(value) { if (value && value.ecoSafe) { return value; } else { if (!(typeof value !== 'undefined' && value != null)) value = ''; var result = new String(value); result.ecoSafe = true; return result; } }; if (!__escape) { __escape = __obj.escape = function(value) { return ('' + value) .replace(/&/g, '&') .replace(//g, '>') .replace(/"/g, '"'); }; } (function() { (function() { __out.push('
\n
\n '); __out.push(this.T('Since you didn\'t respond in the last %s your conversation with %s got closed.', this.delay + " " + this.unit, this.agent)); __out.push('
\n
'); __out.push(__sanitize(this.T('Start new conversation'))); __out.push('
\n
\n
'); }).call(this); }).call(__obj); __obj.safe = __objSafe, __obj.escape = __escape; return __out.join(''); }; if (!window.zammadChatTemplates) { window.zammadChatTemplates = {}; } window.zammadChatTemplates["timestamp"] = function (__obj) { if (!__obj) __obj = {}; var __out = [], __capture = function(callback) { var out = __out, result; __out = []; callback.call(this); result = __out.join(''); __out = out; return __safe(result); }, __sanitize = function(value) { if (value && value.ecoSafe) { return value; } else if (typeof value !== 'undefined' && value != null) { return __escape(value); } else { return ''; } }, __safe, __objSafe = __obj.safe, __escape = __obj.escape; __safe = __obj.safe = function(value) { if (value && value.ecoSafe) { return value; } else { if (!(typeof value !== 'undefined' && value != null)) value = ''; var result = new String(value); result.ecoSafe = true; return result; } }; if (!__escape) { __escape = __obj.escape = function(value) { return ('' + value) .replace(/&/g, '&') .replace(//g, '>') .replace(/"/g, '"'); }; } (function() { (function() { __out.push('
'); __out.push(__sanitize(this.label)); __out.push(' '); __out.push(__sanitize(this.time)); __out.push('
'); }).call(this); }).call(__obj); __obj.safe = __objSafe, __obj.escape = __escape; return __out.join(''); }; if (!window.zammadChatTemplates) { window.zammadChatTemplates = {}; } window.zammadChatTemplates["typingIndicator"] = function (__obj) { if (!__obj) __obj = {}; var __out = [], __capture = function(callback) { var out = __out, result; __out = []; callback.call(this); result = __out.join(''); __out = out; return __safe(result); }, __sanitize = function(value) { if (value && value.ecoSafe) { return value; } else if (typeof value !== 'undefined' && value != null) { return __escape(value); } else { return ''; } }, __safe, __objSafe = __obj.safe, __escape = __obj.escape; __safe = __obj.safe = function(value) { if (value && value.ecoSafe) { return value; } else { if (!(typeof value !== 'undefined' && value != null)) value = ''; var result = new String(value); result.ecoSafe = true; return result; } }; if (!__escape) { __escape = __obj.escape = function(value) { return ('' + value) .replace(/&/g, '&') .replace(//g, '>') .replace(/"/g, '"'); }; } (function() { (function() { __out.push('
\n \n \n \n \n \n \n \n
'); }).call(this); }).call(__obj); __obj.safe = __objSafe, __obj.escape = __escape; return __out.join(''); }; if (!window.zammadChatTemplates) { window.zammadChatTemplates = {}; } window.zammadChatTemplates["waiting"] = function (__obj) { if (!__obj) __obj = {}; var __out = [], __capture = function(callback) { var out = __out, result; __out = []; callback.call(this); result = __out.join(''); __out = out; return __safe(result); }, __sanitize = function(value) { if (value && value.ecoSafe) { return value; } else if (typeof value !== 'undefined' && value != null) { return __escape(value); } else { return ''; } }, __safe, __objSafe = __obj.safe, __escape = __obj.escape; __safe = __obj.safe = function(value) { if (value && value.ecoSafe) { return value; } else { if (!(typeof value !== 'undefined' && value != null)) value = ''; var result = new String(value); result.ecoSafe = true; return result; } }; if (!__escape) { __escape = __obj.escape = function(value) { return ('' + value) .replace(/&/g, '&') .replace(//g, '>') .replace(/"/g, '"'); }; } (function() { (function() { __out.push('
\n
\n \n \n \n \n \n '); __out.push(this.T('All colleges are busy.')); __out.push('
\n '); __out.push(this.T('You are on waiting list position %s.', this.position)); __out.push('\n
\n
'); }).call(this); }).call(__obj); __obj.safe = __objSafe, __obj.escape = __escape; return __out.join(''); };