var SV=window.SV||{};SV.StandardLib=SV.StandardLib||{}; !function(g,h,k,l){"function"===typeof moment&&function(a){var b={d:"DD",D:"ddd",j:"D",l:"dddd",N:"E",S:function(){return"["+this.format("Do").replace(/\d*/g,"")+"]"},w:"d",z:function(){return this.format("DDD")-1},W:"W",F:"MMMM",m:"MM",M:"MMM",n:"M",t:function(){return this.daysInMonth()},L:function(){return this.isLeapYear()?1:0},o:"GGGG",Y:"YYYY",y:"YY",a:"a",A:"A",B:function(){var c=this.clone().utc();c=(c.hours()+1)%24+c.minutes()/60+c.seconds()/3600;return Math.floor(1E3*c/24)},g:"h",G:"H", h:"hh",H:"HH",i:"mm",s:"ss",u:"[u]",e:"[e]",I:function(){return this.isDST()?1:0},O:"ZZ",P:"Z",T:"[T]",Z:function(){return 36*parseInt(this.format("ZZ"),10)},c:"YYYY-MM-DD[T]HH:mm:ssZ",r:"ddd, DD MMM YYYY HH:mm:ss ZZ",U:"X"},d=/[dDjlNSwzWFmMntLoYyaABgGhHisueIOPTZcrU]/g;moment.fn.formatPHP=function(c){var e=this;return this.format(c.replace(d,function(f){return"function"===typeof b[f]?b[f].call(e):b[f]}))}}(moment);SV.StandardLib.RelativeTimestamp=XF.Element.newHandler({options:{countUp:!1,timestamp:null, dateFormat:null,timeFormat:null,triggerEvent:null,triggerEventOnSelector:null,maximumDateParts:0},timer:null,init:function(){this.options.timestamp?this.options.dateFormat?this.options.timeFormat?"function"!==typeof moment?console.error("Moment.js not loaded."):this.timer=setInterval(XF.proxy(this,"updateTime"),1E3):console.error("Time format missing."):console.error("Date format missing."):console.error("Timestamp is missing.")},updateTime:function(){var a=1E3*Math.floor(Date.now()/1E3),b=1E3*this.options.timestamp; a<=b?this.handleCountDown(a,b):this.options.countUp?this.handleCoupUp(b,a):this.handleCountDownEnd(b)},handleCountDown:function(a,b){this.handleTimeStrOutput(this.getTimeStr(moment.duration(b-a,"milliseconds")))},handleCoupUp:function(a,b){this.handleTimeStrOutput(this.getTimeStr(moment.duration(b-a,"milliseconds")))},handleCountDownEnd:function(a){this.clearTimer();a=moment.unix(a/1E3);(a=this.getPhrase("date_x_at_time_y",{"{date}":a.formatPHP(this.options.dateFormat),"{time}":a.formatPHP(this.options.timeFormat)}))? this.$target.text(a):console.error("Unable to get full end date.")},handleTimeStrOutput:function(a){"string"===typeof a?this.$target.text()!==a&&this.$target.text(a):this.handleCountDownEnd(1E3*this.options.timestamp)},getTimeStr:function(a){var b=this,d=[],c=this.options.maximumDateParts;g.each("year month day hour minute second".split(" "),function(e,f){c&&d.length>=c||(e=b.getDatePart(a,f),"string"!==typeof e?0