!function(e){var t="Result",r=e.Core.newType("hafasModule");e.Core.registerType(t,"hafasResult",(function(){this.id=null,this.prevResultId=null,this.data=null,this.requestingModule=null,this.added=new Date,this.expires=null}));var n=0,u={};function a(){return e.Core.extend(!0,{},u)}r.getResult=function(e,t){if(u.hasOwnProperty(e)){if(u[e].hasOwnProperty(t)){if(null!=u[e][t].expires){var r=new Date;return!(u[e][t].expires-r<0)&&u[e][t]}return u[e][t]}return!1}return!1},r.addResult=function(t,r,a,i){var s=!0;try{var d=e.Core.newType("hafasResult");d.id=++n,d.data=a,u.hasOwnProperty(t)||(u[t]={}),"undefined"==i||isNaN(i)||(d.expires=new Date(d.added.getTime()+6e4*i)),u[t][r]=d}catch(t){e.logger.warn(e.logger.ERROR_TYPES.JS,"result.addResult","",t),s=!1}return s},r.addRequirements=function(e){e.addModule("HCI")},r.init=function(e,t){!0===e.debug&&(r.showResultCache=a)},e.Core.registerModule(t,r)}(window.Hafas=window.Hafas||{});