window.zammadChatTemplates||(window.zammadChatTemplates={}),window.zammadChatTemplates.agent=function(e){function t(e){return e&&e.ecoSafe?e:void 0!==e&&null!=e?o(e):""}var s=[],n=(e=e||{}).safe,o=e.escape,o=(e.safe=function(e){if(e&&e.ecoSafe)return e;void 0!==e&&null!=e||(e="");e=new String(e);return e.ecoSafe=!0,e},o||(e.escape=function(e){return(""+e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""")}));return function(){!function(){this.agent.avatar&&(s.push('\n\n')),s.push('\n\n '),s.push(t(this.agent.name)),s.push("\n")}.call(this)}.call(e),e.safe=n,e.escape=o,s.join("")},window.zammadChatTemplates||(window.zammadChatTemplates={}),window.zammadChatTemplates.chat=function(e){function t(e){return e&&e.ecoSafe?e:void 0!==e&&null!=e?o(e):""}var s=[],n=(e=e||{}).safe,o=e.escape,o=(e.safe=function(e){if(e&&e.ecoSafe)return e;void 0!==e&&null!=e||(e="");e=new String(e);return e.ecoSafe=!0,e},o||(e.escape=function(e){return(""+e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""")}));return function(){!function(){s.push('
\n '),this.agent?(t.push("\n "),t.push(this.T("Since you didn't respond in the last %s minutes your conversation with
%s got closed.",this.delay,this.agent))):(t.push("\n "),t.push(this.T("Since you didn't respond in the last %s minutes your conversation got closed.",this.delay))),t.push("\n "),t.push('\n
\n
"),t.push(this.T("Start new conversation")),t.push("
\n
")}.call(this)}.call(e),e.safe=s,e.escape=n,t.join("")};var extend=function(e,t){for(var s in t)hasProp.call(t,s)&&(e[s]=t[s]);function n(){this.constructor=e}return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},hasProp={}.hasOwnProperty,bind=function(e,t){return function(){return e.apply(t,arguments)}},slice=[].slice;!function(C){var s,n,o,e,i,a,r;function l(e){var t,s,n;for(t in this.options={},s=this.defaults)n=s[t],this.options[t]=n;for(t in e)n=e[t],this.options[t]=n}function d(e){d.__super__.constructor.call(this,e),this.log=new n({debug:this.options.debug,logPrefix:this.options.logPrefix||this.logPrefix})}function c(){return this.log=bind(this.log,this),this.error=bind(this.error,this),this.notice=bind(this.notice,this),this.debug=bind(this.debug,this),c.__super__.constructor.apply(this,arguments)}function u(){return this.stop=bind(this.stop,this),this.start=bind(this.start,this),u.__super__.constructor.apply(this,arguments)}function h(){return this.ping=bind(this.ping,this),this.send=bind(this.send,this),this.reconnect=bind(this.reconnect,this),this.close=bind(this.close,this),this.connect=bind(this.connect,this),this.set=bind(this.set,this),h.__super__.constructor.apply(this,arguments)}function m(e){return this.removeAttributes=bind(this.removeAttributes,this),this.startTimeoutObservers=bind(this.startTimeoutObservers,this),this.onCssLoaded=bind(this.onCssLoaded,this),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.destroy=bind(this.destroy,this),this.onScrollHintClick=bind(this.onScrollHintClick,this),this.detectScrolledtoBottom=bind(this.detectScrolledtoBottom,this),this.onLeaveTemporary=bind(this.onLeaveTemporary,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.onWebSocketClose=bind(this.onWebSocketClose,this),this.onCloseAnimationEnd=bind(this.onCloseAnimationEnd,this),this.close=bind(this.close,this),this.toggle=bind(this.toggle,this),this.sessionClose=bind(this.sessionClose,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.onInput=bind(this.onInput,this),this.onReopenSession=bind(this.onReopenSession,this),this.onError=bind(this.onError,this),this.onWebSocketMessage=bind(this.onWebSocketMessage,this),this.send=bind(this.send,this),this.onKeydown=bind(this.onKeydown,this),this.onPaste=bind(this.onPaste,this),this.onDrop=bind(this.onDrop,this),this.render=bind(this.render,this),this.view=bind(this.view,this),this.T=bind(this.T,this),m.__super__.constructor.call(this,e),"undefined"!=typeof jQuery&&this.options.target instanceof jQuery&&(this.log.notice("Chat: target option is a jQuery object. jQuery is not a requirement for the chat any more."),this.options.target=this.options.target.get(0)),this.isFullscreen=C.matchMedia&&C.matchMedia("(max-width: 768px)").matches,this.scrollRoot=this.getScrollRoot(),C.WebSocket&&sessionStorage?this.options.chatId?(this.options.lang||(this.options.lang=document.documentElement.getAttribute("lang")),this.options.lang&&(this.translations[this.options.lang]||(this.log.debug("lang: No "+this.options.lang+" found, try first two letters"),this.options.lang=this.options.lang.replace(/-.+?$/,"")),this.log.debug("lang: "+this.options.lang)),this.options.host||this.detectHost(),this.loadCss(),this.io=new s(this.options),this.io.set({onOpen:this.render,onClose:this.onWebSocketClose,onMessage:this.onWebSocketMessage,onError:this.onError}),void this.io.connect()):(this.state="unsupported",void this.log.error("Chat: need chatId as option!")):(this.state="unsupported",void this.log.notice("Chat: Browser not supported!"))}e=(r=document.getElementsByTagName("script"))[r.length-1],a=C.location.protocol.replace(":",""),e&&e.src&&(i=e.src.match(".*://([^:/]*).*")[1],a=e.src.match("(.*)://[^:/]*.*")[1]),l.prototype.defaults={debug:!1},extend(d,r=l),e=d,extend(c,r),c.prototype.debug=function(){var e=1<=arguments.length?slice.call(arguments,0):[];if(this.options.debug)return this.log("debug",e)},c.prototype.notice=function(){var e=1<=arguments.length?slice.call(arguments,0):[];return this.log("notice",e)},c.prototype.error=function(){var e=1<=arguments.length?slice.call(arguments,0):[];return this.log("error",e)},c.prototype.log=function(e,t){var s,n,o,i;if(t.unshift("||"),t.unshift(e),t.unshift(this.options.logPrefix),console.log.apply(console,t),this.options.debug){for(i="",n=0,o=t.length;n