function handleClickBoxClickable(n){window.location.href=n.currentTarget.getAttribute("data-href")}function OpenMapWindow(n,t){for(var f=[640,800,1024],u=[480,600,768],o=f[0],s=u[0],e,r=1;r<u.length;r++)window.screen.availHeight>u[r]&&window.screen.availWidth>f[r]&&(o=f[r],s=u[r]);e="width="+o+", height="+s+", status=yes, toolbar=no, menubar=no, location=no, resizable=yes, scrollbars=no",window.open(n,t,e)}function OpenObjectChoiceMapWindow(n,t,i){var f=document.getElementById(i+"_txtObject"),e=document.getElementById(i+"_txtVirtListItemCode"),o;f&&(n+="&mask="+encodeURIComponent(f.value)),f&&e&&(o=f.value,e.value.length>0&&(n+="&vListCode="+e.value)),OpenMapWindow(n,t,!0)}function OpenObjectSearchMapWindow(n,t,i,r,u){var e=document.getElementById(i),f;e&&(f=TrimStr(e.value),f.length>0&&(n+="&srcForm=Search&mask="+encodeURIComponent(f)+"&back="+encodeURIComponent(u))),OpenMapWindow(n,t,!0)}function TrimStr(n){for(var r=0,i=0,u=!1,t=0;t<n.length;t++)n.substring(t,t+1)==" "?u||(r=t+1):(u=!0,i=t+1);return r>i&&(i=r),n.substring(r,i)}function IsMapObject(n){return n.length<2?!1:n.substring(0,2)=="m:"?!0:n.substring(0,2)=="M:"?!0:!1}function SetFocus(n){if(typeof $!="undefined"){var t=$("a.selectobject");t.length>0&&(n=t[0].id)}if(oItem=document.getElementById(n),oItem)try{oItem.focus()}catch(i){}}function AjaxDefaultSettings(n){return{type:"POST",contentType:"application/json; charset=utf-8",dataType:"json",beforeSend:function(n){n.setRequestHeader("idoskey",sIDOSKey)},error:function(t,i,r){onAjaxDivFailed(t,i,r,n)}}}function onAjaxDivFailed(n,t,i,r){if(r)try{if(n.status==0)return;t=="timeout"?alert(sTimeOut):(sErr=sNoData1+n.statusText+sNoData2+n.status+")",alert(sErr))}catch(u){HandlerError(u)}}function IsAJAXResultOK(n){if(n==null)return!1;if(n.indexOf("<error>")>=0){for(var t=n.replace(/<inner>/g,"").replace(/<\/inner>/g,"").replace(/<message>/g,"").replace(/<\/message>/g,"").replace(/<error>/g,"").replace(/<\/error>/g,"").replace(/\r\n\r\n/g,"\r\n").replace(/\r\n\r\n/g,"\r\n");t.indexOf("\r\n")==0;)t=t.substr(2);return alert(t),!1}return!0}function HandlerError(){}function ShowInput(n){var r,i;try{r=n.replace("txt",""),$("#cbo"+r).remove(),$("#err"+n).remove(),$("#"+n).removeClass("inv"),$("#"+n).focus(),i=document.getElementById(r+"sel"),i&&(i.style.display="inline")}catch(u){HandlerError(u)}}function CheckLowDeckConnChks(n){var i,t;return n&&n.checked&&(n.name=="chkLowDeckConnTr"?(i=document.getElementById("chkLowDeckConnection"),i&&i.checked&&(i.checked=!1)):n.name=="chkLowDeckConnection"&&(t=document.getElementById("chkLowDeckConnTr"),t&&t.checked&&(t.checked=!1))),!0}function IsEnableClick(){return bDisableClick?!1:(bDisableClick=!0,!0)}function isSelectedTrType(){var t=$("input[name^='ctlTrainTypes']"),n;if(t.length==0)return!0;for(n=0;n<t.length;n++)if(t[n].checked)return!0;return alert(sNoTrType),!1}function StoreAllTxtValue(){var t,n,r;try{for(t="",n=document.getElementsByTagName("input"),i=0;i<n.length;i++)n[i]&&n[i].type=="text"&&(t!=""&&(t+="#|#"),t+=n[i].id+"#*#"+n[i].value);r=$("#txtval")[0],r!=undefined&&(r.value=t)}catch(u){HandlerError(u)}}function LoadAllTxtValue(){var i,r,t,n;try{if(i=$("#txtval")[0],i!=undefined&&(r=i.value,r!=""))for(t=r.split("#|#"),j=0;j<t.length;j++)n=t[j].split("#*#"),n.length==2&&$("#"+n[0]).val(n[1])}catch(u){HandlerError(u)}}function Cookie(n,t,i,r){this.$document=n,this.$name=t,this.$expiration=i?new Date(+new Date+i*36e5):null,this.$path=r?r:null}function diffDuration(n){var e=moment(),f;for(f in n)if(n.hasOwnProperty(f)){var t=n[f],c=moment(t.dataset.zeroDatetime),l=c.diff(e),i=c.diff(e,"days"),h=moment.duration(l),u=h.hours(),r=h.minutes(),a=getNumberAndUnit(i,t.dataset.translationDays),o=getNumberAndUnit(u,t.dataset.translationHours),s=getNumberAndUnit(r,t.dataset.translationMinutes);l<0?setText(t,""):i===0&&u===0&&r===0&&setText(t,t.dataset.translationNow),i>0?setText(t,t.dataset.translationIn+" "+a+" "+t.dataset.translationAnd+" "+o):u>0?setText(t,t.dataset.translationIn+" "+o+" "+t.dataset.translationAnd+" "+s):r>0&&setText(t,t.dataset.translationIn+" "+s)}}function setText(n,t){n.innerHTML!==t&&(n.innerHTML=t)}function getNumberAndUnit(n,t){var i=t.split("|");return n>=5||n===0?n+" "+i[2]:n>=2?n+" "+i[1]:n+" "+i[0]}function isCallable(){if(!arguments.length)return!1;for(var n=0,t=arguments.length;n<t;n++)if("function"!=typeof arguments[n])return!1;return!0}function isDefined(){if(!arguments.length)return!1;for(var n=0,t=arguments.length;n<t;n++)if("undefined"==typeof arguments[n])return!1;return!0}function log(){pb.debug&&window.console&&isCallable(window.console.log)&&(console.log.apply(console,arguments),pb.debugTrace&&console.trace())}function warn(){pb.debug&&window.console&&isCallable(window.console.warn)&&(console.warn.apply(console,arguments),pb.debugTrace&&console.trace())}function info(){pb.debug&&window.console&&isCallable(window.console.info)&&(console.info.apply(console,arguments),pb.debugTrace&&console.trace())}function extend(n,t){var i=function(){};i.prototype=t.prototype,n.superClass_=t.prototype,n.prototype=new i,n.prototype.constructor=n}function toInt(n,t){return parseInt(""+n,t||10)}function getConstructorName(n,t){var i,u,r;t=t||window;for(r in t)if(i=t[r],"function"==typeof i&&i.toString().indexOf("[native code]")===-1){if(n instanceof i&&n.constructor===i)return r;if(u=getConstructorName(n,i))return r+"."+u}else if(i&&i.constructor===Object&&(u=getConstructorName(n,i)))return r+"."+u;return!1}function isPreventClickEvent(n){return n.button||n.ctrlKey||n.shiftKey||n.altKey||n.metaKey}function isInstanceOf(n,t){return!!(isDefined(n)&&"function"==typeof t&&n instanceof t)}function isFlashEnabled(){var n=!1,t;try{t=new ActiveXObject("ShockwaveFlash.ShockwaveFlash"),t&&(n=!0)}catch(i){isDefined(navigator.mimeTypes["application/x-shockwave-flash"])&&(n=!0)}return n}function debounce(n,t,i){var r;return function(){var f=this,u=arguments,o=function(){r=null,i||t.apply(f,u)},e=i&&!r;clearTimeout(r),r=setTimeout(o,n),e&&t.apply(f,u)}}function throttle(n,t,i){var f,e,o,r=null,u=0,s;return i||(i={}),s=function(){u=i.leading===!1?0:+new Date,r=null,o=t.apply(f,e),r||(f=e=null)},function(){var c=+new Date,h;return u||i.leading!==!1||(u=c),h=n-(c-u),f=this,e=arguments,h<=0||h>n?(r&&(clearTimeout(r),r=null),u=c,o=t.apply(f,e),r||(f=e=null)):r||i.trailing===!1||(r=setTimeout(s,h)),o}}function nextTick(n){setTimeout(n,0)}var bDisableClick,goACEOptions,InputObjectManager,pb,app;(function(){if("undefined"!=typeof window&&window.addEventListener){var n=Object.create(null),u,t=function(){clearTimeout(u),u=setTimeout(f,100)},i=function(){},o=function(){if(window.addEventListener("resize",t,!1),window.addEventListener("orientationchange",t,!1),window.MutationObserver){var n=new MutationObserver(t);n.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0}),i=function(){try{n.disconnect(),window.removeEventListener("resize",t,!1),window.removeEventListener("orientationchange",t,!1)}catch(i){}}}else document.documentElement.addEventListener("DOMSubtreeModified",t,!1),i=function(){document.documentElement.removeEventListener("DOMSubtreeModified",t,!1),window.removeEventListener("resize",t,!1),window.removeEventListener("orientationchange",t,!1)}},e=function(n){function i(n){if(void 0!==n.protocol)var t=n;else t=document.createElement("a"),t.href=n;return t.protocol.replace(/:/g,"")+t.host}if(window.XMLHttpRequest){var t=new XMLHttpRequest,r=i(location);n=i(n),t=void 0===t.withCredentials&&""!==n&&n!==r?XDomainRequest||void 0:XMLHttpRequest}return t},f=function(){function a(){--c,0===c&&(i(),o())}function v(t){return function(){!0!==n[t.base]&&(t.useEl.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href","#"+t.hash),t.useEl.hasAttribute("href")&&t.useEl.setAttribute("href","#"+t.hash))}}function p(n){return function(){var i=document.body,t=document.createElement("x");n.onload=null,t.innerHTML=n.responseText,(t=t.getElementsByTagName("svg")[0])&&(t.setAttribute("aria-hidden","true"),t.style.position="absolute",t.style.width=0,t.style.height=0,t.style.overflow="hidden",i.insertBefore(t,i.firstChild)),a()}}function y(n){return function(){n.onerror=null,n.ontimeout=null,a()}}var t,f,c=0,u,s,h,r,l;for(i(),u=document.getElementsByTagName("use"),f=0;f<u.length;f+=1){try{s=u[f].getBoundingClientRect()}catch(w){s=!1}h=(t=u[f].getAttribute("href")||u[f].getAttributeNS("http://www.w3.org/1999/xlink","href")||u[f].getAttribute("xlink:href"))&&t.split?t.split("#"):["",""],r=h[0],h=h[1],l=s&&0===s.left&&0===s.right&&0===s.top&&0===s.bottom,s&&0===s.width&&0===s.height&&!l?(u[f].hasAttribute("href")&&u[f].setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t),r.length&&(t=n[r],!0!==t&&setTimeout(v({useEl:u[f],base:r,hash:h}),0),void 0===t&&(h=e(r),void 0!==h&&(t=new h,n[r]=t,t.onload=p(t),t.onerror=y(t),t.ontimeout=y(t),t.open("GET",r),t.send(),c+=1)))):l?r.length&&n[r]&&setTimeout(v({useEl:u[f],base:r,hash:h}),0):void 0===n[r]?n[r]=!0:n[r].onload&&(n[r].abort(),delete n[r].onload,n[r]=!0)}u="",c+=1,a()},r=function(){window.removeEventListener("load",r,!1),u=setTimeout(f,0)};"complete"!==document.readyState?window.addEventListener("load",r,!1):r()}})(),window.addEventListener("DOMContentLoaded",function(){var t=document.querySelectorAll(".Box-clickable[data-href]"),n;for(n in t)t.hasOwnProperty(n)&&t[n].addEventListener("click",handleClickBoxClickable)}),bDisableClick=!1,BaseParams=function(n,t,i,r,u){try{this._Lang=n,this._sAppPath=t,this._sPageName=i,this._sTTCombID=r,this._sHistKey=u,this._localStorageDisabled=!0}catch(f){alert("Error in BaseParams.new.\n"+f)}try{this._localStorageDisabled=typeof localStorage=="undefined"}catch(f){HandlerError(f)}},BaseParams.prototype={get_Lang:function(){return this._Lang},set_Lang:function(n){this._Lang=n},get_AppPath:function(){return this._sAppPath},get_PageName:function(){return this._sPageName},get_TTCombID:function(){return this._sTTCombID},get_HistKey:function(){return this._sHistKey},get_LocalStorageDisabled:function(){return this._localStorageDisabled},_addParam:function(n,t,i,r){var f=t+"="+i,u=new RegExp(t+"=","i"),e;return n.search(u)>-1?(e=new RegExp(t+"=[^&]*","i"),n=n.replace(e,f)):r&&(u=new RegExp("aspx\\?","i"),n=n.search(u)>-1?n+"&"+f:n+"?"+f),n}},InputObject=function(n,t,i,r,u,f,e,o,s){this._textBoxId=n,this._hiddenId=t,this._serviceUrl=i,this._bindElementId=r,this._selectedTT=u,this._historyDisabled=f,this._bCoor=e,this._bNoImg=o,this._cboCategoryID=s,this._aiTrTypeId=[302,300,301,303,307,100,304,308,309,310,311,305,312,152,153,314],this._asTrTypeIcons=["zastavka-mhd_metro.png","zastavka-mhd_tram.png","zastavka-mhd_bus.png","zastavka-mhd_lanovka.png","zastavka-mhd_lod.png","vlakova-zastavka_PID.png","zastavka-mhd_bus.png","zastavka-mhd_bus.png","zastavka-mhd_tram.png","zastavka-mhd_bus.png","zastavka-mhd_bus.png","zastavka-mhd_bus.png","zastavka-mhd_bus.png","vlakova-zastavka_PID.png","vlakova-zastavka_PID.png","zastavka-mhd_bus.png"]},InputObject.prototype={init:function(){this._initAutocomplete();var n=this;jQuery("#"+this._textBoxId+"s.selectobject").click(function(t){n._openAC(t)})},_initAutocomplete:function(){var n=this,t={selectFirst:!1,dataType:"json",minChars:2,max:20,delay:200,scroll:!0,scrollHeight:800,matchSubset:!1,highlight:!1,cacheLength:0,extraParams:{selectedTT:this._selectedTT,bindElementValue:function(){return n._bindElementId?jQuery("#"+n._bindElementId).val():""},iLang:goBaseParams.get_Lang(),bCoor:this._bCoor,iTrCatSelected:function(){return n._cboCategoryID?jQuery("#"+n._cboCategoryID).val():""}},formatItem:function(t){var e="",s,o;return t.sType!=null&&t.sType!=""&&(e!=""&&(e+=", "),e+=t.sType),t.sState!=null&&t.sState!=""&&(e!=""&&(e+=", "),e+=t.sState),t.sRegion!=null&&t.sRegion!=""&&(e!=""&&(e+=", "),e+=t.sRegion),t.sTrCategory!=null&&t.sTrCategory!=""&&(e!=""&&(e+=", "),e+=t.sTrCategory),t.sLines!=null&&t.sLines!=""&&(e!=""&&(e+=", "),e+=t.sLines.indexOf(",")>-1?sLineLabel:sLineLabel1,e+=' <span class="bold">'+t.sLines+"</span>"),e!=""&&(e='<br /><span class="ac_bottom">'+e+"</span>"),s="",sHTML=n._bNoImg?"<div>"+t.oItem.sName+e+"</div>":'<div class="ac_item" style="'+n._getBgImg(t)+'">'+t.oItem.sName+e+"</div>",o=t.oItem&&typeof t.oItem.bPriorityQueue!="undefined"&&t.oItem.bPriorityQueue,o&&(sHTML='<div class="ac_priorityqueue">'+sHTML+"</div>"),sHTML},parse:function(t){return t&&t.d?n._parse(t.d):[]}};this._historyDisabled||typeof goACEHistory=="undefined"||!goACEHistory||goBaseParams.get_LocalStorageDisabled()||(t.getEmptySelectionData=function(){return n._parse(goACEHistory.GetItems())}),jQuery("#"+this._textBoxId).autocomplete(this._serviceUrl,t),jQuery("#"+this._textBoxId).result(function(t,i){n._hiddenId&&jQuery("#"+n._hiddenId).val(InputObjectManager.GetVLIName(i)+"|"+InputObjectManager.GetVLI_WriteIndex(i.oItem)),n._bCoor&&typeof MapView!="undefined"&&(jQuery("#"+n._textBoxId+"p").remove(),MapView&&i.dCoorX>0&&i.dCoorY>0?(MapView.addPoint(new MapAdr([i])),MapView.generateAdrPOI(),$("#mapMain").css("top","2.3em")):(jQuery('<div class="errmsg" id="'+n._textBoxId+'p"><label class="w100">&nbsp;</label><strong class="red">'+sNoCoor+"</strong></div>").appendTo("#searchBox"),$("#mapMain").css("top","4em")))})},_parse:function(n){var i=[],t;if(n)for(t=0;t<n.length;t++)i[i.length]={data:n[t],value:InputObjectManager.GetVLI_WriteIndex(n[t].oItem),result:InputObjectManager.GetVLIName(n[t])};return i},unautocomplete:function(){jQuery("#"+this._textBoxId).unautocomplete()},_getBgImg:function(n){var t="poi.png";switch(n.ImgID){case 1:t="mesto.png";break;case 2:t="cast-mesta.png";break;case 3:t="vlakova-zastavka.png";break;case 4:t="zastavka-autobusu.png";break;case 5:t=this._getBgImgByType(n);break;case 6:t="souradnice.png";break;case 7:t="souradnice-disabled.png";break;case 8:t="adresa.png";break;case 9:t="adresa-disabled.png";break;case 10:t="ulice.png";break;case 11:t="letiste.png"}return"background:url("+goBaseParams.get_AppPath()+"img/"+t+") no-repeat;"},_getBgImgByType:function(n){if(goBaseParams.get_HistKey()=="ZJR"||typeof n.aiTrTypeID=="undefined"||n.aiTrTypeID==null||n.aiTrTypeID.length==0)return"zastavka-mhd.png";for(i=0;i<this._aiTrTypeId.length;i++)for(j=0;j<n.aiTrTypeID.length;j++)if(this._aiTrTypeId[i]==n.aiTrTypeID[j])return this._asTrTypeIcons[i];return"zastavka-mhd.png"},_openAC:function(n){return jQuery.fn.openAC&&(jQuery("#"+this._textBoxId)[0].focus(),jQuery("#"+this._textBoxId+"p").remove(),jQuery("#mapMain.toperr").removeClass("toperr"),jQuery("#"+this._textBoxId).openAC()),n.preventDefault(),n.stopPropagation(),!1},Reset:function(){$("#"+this._textBoxBaseId+"e").remove(),ShowInput(this._textBoxId,!1),$("#"+this._textBoxId).val("")}},goACEOptions={selectFirst:!1,dataType:"json",minChars:2,max:20,delay:200,scroll:!0,scrollHeight:800,matchSubset:!1,highlight:!1,cacheLength:0},InputLine=function(n,t,i,r,u,f,e,o,s){this._textBoxId=n,this._inputFromID=t,this._inputToID=i,this._serviceUrl=r,this._bindTTIndex=u,this._bindDate=f,this._bindWholeWeek=e,this._selectedTT=o,this._historyDisabled=s,this._textBoxBaseId=this._textBoxId.substring(0,this._textBoxId.length-1)},InputLine.prototype={init:function(){this._initAutocomplete();var n=this;$("#"+this._textBoxBaseId+"e .selectobject").click(function(t){n._openAC(t)})},_initAutocomplete:function(){var n=this,t={minChars:1,extraParams:{selectedTT:this._selectedTT,bindTTIndex:function(){if(!n._bindTTIndex)return"";var t=$("#"+n._bindTTIndex).val();return typeof t=="undefined"?"":t},bindDate:function(){return n._bindDate?$("#"+n._bindDate).val():""},bindWholeWeek:function(){return n._bindWholeWeek?$("#"+n._bindWholeWeek)[0].checked:""},iLang:goBaseParams.get_Lang()},formatItem:function(t){var e="";return t.From!=null&&t.From!=""&&t.To!=null&&t.To!=""?e=t.From+" - "+t.To:t.FromTo&&t.FromTo!=""&&(e=t.FromTo),e!=""&&(e='<br /><span class="ac_bottom">'+e+"</span>"),'<div class="ac_item" style="'+n._getBgImg(t)+'">'+t.FullName+e+"</div>"},parse:function(t){return t&&t.d?n._parse(t.d):[]}};t=$.extend({},goACEOptions,t),this._historyDisabled||typeof goACEHistoryLine=="undefined"||!goACEHistoryLine||goBaseParams.get_LocalStorageDisabled()||(t.getEmptySelectionData=function(){return n._parse(goACEHistoryLine.GetItems())}),$("#"+this._textBoxId).autocomplete(this._serviceUrl,t),$("#"+this._textBoxId).result(function(t,i){var u=[];u[0]=n._textBoxId,InputObjectManager.ResetAll(u),n._inputFromID&&$("#"+n._inputFromID).val(i.From),n._inputToID&&$("#"+n._inputToID).val(i.To)})},_parse:function(n){var i=[],t;if(n)for(t=0;t<n.length;t++)i[i.length]={data:n[t],value:null,result:this._getresult(n[t])};return i},_getresult:function(n){var t="";return n.Type!=null&&n.Type!=""&&(t+=n.Type),t.length>0&&(t+=" "),t+=n.Name},unautocomplete:function(){$("#"+this._textBoxId).unautocomplete()},_getBgImg:function(n){var t="zastavka-mhd.png";switch(n.ImgType){case"train":t="vlakova-zastavka_PID.png";break;case"bus":t="zastavka-mhd_bus.png";break;case"lan":t="zastavka-mhd_lanovka.png";break;case"lod":t="zastavka-mhd_lod.png";break;case"tram":t="zastavka-mhd_tram.png";break;case"metro":t="zastavka-mhd_metro.png"}return"background:url("+goBaseParams._sAppPath+"img/"+t+") no-repeat;"},_openAC:function(n){return $.fn.openAC&&($("#"+this._textBoxId)[0].focus(),$("#"+this._textBoxBaseId+"e").remove(),$("#"+this._textBoxId).openAC()),n.preventDefault(),n.stopPropagation(),!1},Reset:function(){$("#"+this._textBoxBaseId+"e").remove(),$("#"+this._textBoxId).val("")}},InputObjectManagerClass=function(){this._items=[]},InputObjectManagerClass.prototype={add:function(n,t){this._items[n]=t,t.init()},remove:function(n){this._items[n].unautocomplete(),this._items[n]=null},getItem:function(n){return this._items[n]&&this._items[n]._textBoxId==n?this._items[n]:null},GetVLI_WriteIndex:function(n){with(n){if(typeof iVirtListID=="undefined")return null;var sValue=iVirtListID+"|"+iItem;return typeof sName_FX!="undefined"&&sName_FX!=null&&(sValue+="|"+sName_FX),sValue}},GetVLIName:function(n){var t=n.oItem.sName,i=n.sState&&n.sState!="";return(i||n.bRegion)&&(t+="; ",i&&(t+=n.sState),n.bRegion&&(i&&(t+=", "),t+=n.sRegion)),t},ResetAll:function(n){for(var t in this._items)(n==null||n!=null&&jQuery.inArray(t,n)==-1)&&typeof this._items[t].Reset=="function"&&this._items[t].Reset()}},InputObjectManager=new InputObjectManagerClass,ACEHistory=function(){this._key="IDOSPID_ACHi_"+goBaseParams.get_TTCombID()+"_"+goBaseParams.get_HistKey(),this._maxCount=6},ACEHistory.prototype={GetItems:function(){try{if(goBaseParams.get_LocalStorageDisabled())return;var n=localStorage.getItem(this._key);if(n)return JSON.parse(n)}catch(t){HandlerError(t)}return null},AddItems:function(n){try{if(goBaseParams.get_LocalStorageDisabled())return;var r=localStorage.getItem(this._key),t=null;for(t=r?JSON.parse(r):[],i=n.length-1;i>=0;i--)t=this._addItem(t,n[i]);localStorage.setItem(this._key,JSON.stringify(t))}catch(u){HandlerError(u)}},_addItem:function(n,t){var r=[],i,u;if(t.oItem.sName=="")return n;if(i=0,r[0]=t,i++,u=this._indexInHistory(n,t),u>-1)for(j=0;j<n.length;j++)j!=u&&(r[i]=n[j],i++);else for(j=0;j<n.length;j++)i<this._maxCount&&(r[i]=n[j],i++);return r},_indexInHistory:function(n,oTimetableObjectInfo){for(j=0;j<n.length;j++)if(n[j])with(n[j])if(oItem.sName==oTimetableObjectInfo.oItem.sName&&oItem.iVirtListID==oTimetableObjectInfo.oItem.iVirtListID&&sRegion==oTimetableObjectInfo.sRegion)return j;return-1}},ACEHistoryLine=function(n){this._sCityHFID="",this._bLines=n,this._maxCount=6},ACEHistoryLine.prototype={_getKey:function(n){var t="";return typeof n!="undefined"&&n.length>0?t="_"+n:typeof this._sCityHFID!="undefined"&&this._sCityHFID.length!=0&&(t=this._bLines?"_"+$("#"+this._sCityHFID).val():"_"+GetCityName4TTIndex($("#"+this._sCityHFID).val())),"ACHiLine_"+goBaseParams.get_TTCombID()+"_"+goBaseParams._sPageName.toLowerCase()},SetSelTTCityID:function(n){this._sCityHFID=n},GetItems:function(){try{if(goBaseParams.get_LocalStorageDisabled())return;var n=localStorage.getItem(this._getKey());if(n)return JSON.parse(n)}catch(t){HandlerError(t)}return null},AddItem:function(n,t){try{if(goBaseParams.get_LocalStorageDisabled())return;var r=localStorage.getItem(this._getKey(t)),i=null;i=r?JSON.parse(r):[],i=this._addItem(i,n),localStorage.setItem(this._getKey(t),JSON.stringify(i))}catch(u){HandlerError(u)}},_addItem:function(n,t){var r=[],i,u;if(t.sName=="")return n;if(i=0,r[0]=t,i++,u=this._indexInHistory(n,t),u>-1)for(j=0;j<n.length;j++)j!=u&&(r[i]=n[j],i++);else for(j=0;j<n.length;j++)i<this._maxCount&&(r[i]=n[j],i++);return r},_indexInHistory:function(n,oLineItem){for(j=0;j<n.length;j++)if(n[j])with(n[j])if(Name==oLineItem.Name&&From==oLineItem.From&&To==oLineItem.To&&ImgType==oLineItem.ImgType)return j;return-1}},Cookie.prototype.store=function(){var i="",n,t;for(n in this)n.charAt(0)!="$"&&typeof this[n]!="function"&&(i!=""&&(i+="&"),i+=n+":"+decodeURI(this[n]));t=this.$name+"="+i,this.$expiration&&(t+="; expires="+this.$expiration.toGMTString()),this.$path&&(t+="; path="+this.$path),this.$document.cookie=t},Cookie.prototype.load=function(){var i=this.$document.cookie,r,u,f,t,n;if(i==""||(r=i.indexOf(this.$name+"="),r==-1))return!1;for(r+=this.$name.length+1,u=i.indexOf(";",r),u==-1&&(u=i.length),f=i.substring(r,u),t=f.split("&"),n=0;n<t.length;n++)t[n]=t[n].split(":");for(n=0;n<t.length;n++)this[t[n][0]]=encodeURI(t[n][1]);return!0},function(n,t){typeof exports=="object"&&typeof module!="undefined"?module.exports=t():typeof define=="function"&&define.amd?define(t):n.moment=t()}(this,function(){"use strict";function t(){return ue.apply(null,arguments)}function yl(n){ue=n}function st(n){return n instanceof Array||Object.prototype.toString.call(n)==="[object Array]"}function ki(n){return n!=null&&Object.prototype.toString.call(n)==="[object Object]"}function kl(n){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(n).length===0;var t;for(t in n)if(n.hasOwnProperty(t))return!1;return!0}function b(n){return n===void 0}function ti(n){return typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]"}function nu(n){return n instanceof Date||Object.prototype.toString.call(n)==="[object Date]"}function no(n,t){for(var r=[],i=0;i<n.length;++i)r.push(t(n[i],i));return r}function l(n,t){return Object.prototype.hasOwnProperty.call(n,t)}function kt(n,t){for(var i in t)l(t,i)&&(n[i]=t[i]);return l(t,"toString")&&(n.toString=t.toString),l(t,"valueOf")&&(n.valueOf=t.valueOf),n}function ot(n,t,i,r){return ds(n,t,i,r,!0).utc()}function na(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function u(n){return n._pf==null&&(n._pf=na()),n._pf}function rf(n){if(n._isValid==null){var t=u(n),r=gu.call(t.parsedDateParts,function(n){return n!=null}),i=!isNaN(n._d.getTime())&&t.overflow<0&&!t.empty&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&r);if(n._strict&&(i=i&&t.charsLeftOver===0&&t.unusedTokens.length===0&&t.bigHour===undefined),Object.isFrozen!=null&&Object.isFrozen(n))return i;n._isValid=i}return n._isValid}function ur(n){var t=ot(NaN);return n!=null?kt(u(t),n):u(t).userInvalidated=!0,t}function vf(n,t){var i,f,r;if(b(t._isAMomentObject)||(n._isAMomentObject=t._isAMomentObject),b(t._i)||(n._i=t._i),b(t._f)||(n._f=t._f),b(t._l)||(n._l=t._l),b(t._strict)||(n._strict=t._strict),b(t._tzm)||(n._tzm=t._tzm),b(t._isUTC)||(n._isUTC=t._isUTC),b(t._offset)||(n._offset=t._offset),b(t._pf)||(n._pf=u(t)),b(t._locale)||(n._locale=t._locale),ar.length>0)for(i=0;i<ar.length;i++)f=ar[i],r=t[f],b(r)||(n[f]=r);return n}function gi(n){vf(this,n),this._d=new Date(n._d!=null?n._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),rr===!1&&(rr=!0,t.updateOffset(this),rr=!1)}function ht(n){return n instanceof gi||n!=null&&n._isAMomentObject!=null}function d(n){return n<0?Math.ceil(n)||0:Math.floor(n)}function f(n){var t=+n,i=0;return t!==0&&isFinite(t)&&(i=d(t)),i}function ho(n,t,i){for(var e=Math.min(n.length,t.length),o=Math.abs(n.length-t.length),u=0,r=0;r<e;r++)(i&&n[r]!==t[r]||!i&&f(n[r])!==f(t[r]))&&u++;return u+o}function se(n){t.suppressDeprecationWarnings===!1&&typeof console!="undefined"&&console.warn&&console.warn("Deprecation warning: "+n)}function nt(n,i){var r=!0;return kt(function(){var o,u,f,e;if(t.deprecationHandler!=null&&t.deprecationHandler(null,n),r){for(o=[],f=0;f<arguments.length;f++){if(u="",typeof arguments[f]=="object"){u+="\n["+f+"] ";for(e in arguments[0])u+=e+": "+arguments[0][e]+", ";u=u.slice(0,-2)}else u=arguments[f];o.push(u)}se(n+"\nArguments: "+Array.prototype.slice.call(o).join("")+"\n"+(new Error).stack),r=!1}return i.apply(this,arguments)},i)}function ce(n,i){t.deprecationHandler!=null&&t.deprecationHandler(n,i),yf[n]||(se(i),yf[n]=!0)}function et(n){return n instanceof Function||Object.prototype.toString.call(n)==="[object Function]"}function uy(n){var i,t;for(t in n)i=n[t],et(i)?this[t]=i:this["_"+t]=i;this._config=n,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function df(n,t){var r=kt({},n),i;for(i in t)l(t,i)&&(ki(n[i])&&ki(t[i])?(r[i]={},kt(r[i],n[i]),kt(r[i],t[i])):t[i]!=null?r[i]=t[i]:delete r[i]);for(i in n)l(n,i)&&!l(t,i)&&ki(n[i])&&(r[i]=kt({},r[i]));return r}function ou(n){n!=null&&this.set(n)}function ic(n,t,i){var r=this._calendar[n]||this._calendar.sameElse;return et(r)?r.call(t,i):r}function uc(n){var i=this._longDateFormat[n],t=this._longDateFormat[n.toUpperCase()];return i||!t?i:this._longDateFormat[n]=t.replace(/MMMM|MM|DD|dddd/g,function(n){return n.slice(1)})}function kc(){return this._invalidDate}function yh(n){return this._ordinal.replace("%d",n)}function ch(n,t,i,r){var u=this._relativeTime[i];return et(u)?u(n,t,i,r):u.replace(/%d/i,n)}function ka(n,t){var i=this._relativeTime[n>0?"future":"past"];return et(i)?i(t):i.replace(/%s/i,t)}function p(n,t){var i=n.toLowerCase();ai[i]=ai[i+"s"]=ai[t]=n}function g(n){return typeof n=="string"?ai[n]||ai[n.toLowerCase()]:undefined}function ef(n){var r={},i,t;for(t in n)l(n,t)&&(i=g(t),i&&(r[i]=n[t]));return r}function w(n,t){of[n]=t}function vl(n){var i=[],t;for(t in n)i.push({unit:t,priority:of[t]});return i.sort(function(n,t){return n.priority-t.priority}),i}function pt(n,t,i){var r=""+Math.abs(n),f=t-r.length,u=n>=0;return(u?i?"+":"":"-")+Math.pow(10,Math.max(0,f)).toString().substr(1)+r}function r(n,t,i,r){var u=r;typeof r=="string"&&(u=function(){return this[r]()}),n&&(ei[n]=u),t&&(ei[t[0]]=function(){return pt(u.apply(this,arguments),t[1],t[2])}),i&&(ei[i]=function(){return this.localeData().ordinal(u.apply(this,arguments),n)})}function gl(n){return n.match(/\[[\s\S]/)?n.replace(/^\[|\]$/g,""):n.replace(/\\/g,"")}function sl(n){for(var t=n.match(ps),i=0,r=t.length;i<r;i++)t[i]=ei[t[i]]?ei[t[i]]:gl(t[i]);return function(i){for(var f="",u=0;u<r;u++)f+=et(t[u])?t[u].call(i,n):t[u];return f}}function wr(n,t){return n.isValid()?(t=rh(t,n.localeData()),sf[t]=sf[t]||sl(t),sf[t](n)):n.localeData().invalidDate()}function rh(n,t){function r(n){return t.longDateFormat(n)||n}var i=5;for(dr.lastIndex=0;i>=0&&dr.test(n);)n=n.replace(dr,r),dr.lastIndex=0,i-=1;return n}function i(n,t,i){ff[n]=et(t)?t:function(n){return n&&i?i:t}}function hh(n,t){return l(ff,n)?ff[n](t._strict,t._locale):new RegExp(wh(n))}function wh(n){return dt(n.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(n,t,i,r,u){return t||i||r||u}))}function dt(n){return n.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function s(n,t){var i,r=t;for(typeof n=="string"&&(n=[n]),ti(t)&&(r=function(n,i){i[t]=f(n)}),i=0;i<n.length;i++)ir[n[i]]=r}function bi(n,t){s(n,function(n,i,r,u){r._w=r._w||{},t(n,r._w,r,u)})}function oh(n,t,i){t!=null&&l(ir,n)&&ir[n](t,i._a,i,n)}function nr(n){return er(n)?366:365}function er(n){return n%4==0&&n%100!=0||n%400==0}function dp(){return er(this.year())}function ui(n,i){return function(r){return r!=null?(uh(this,n,r),t.updateOffset(this,i),this):hr(this,n)}}function hr(n,t){return n.isValid()?n._d["get"+(n._isUTC?"UTC":"")+t]():NaN}function uh(n,t,i){n.isValid()&&!isNaN(i)&&(t==="FullYear"&&er(n.year())&&n.month()===1&&n.date()===29?n._d["set"+(n._isUTC?"UTC":"")+t](i,n.month(),cr(i,n.month())):n._d["set"+(n._isUTC?"UTC":"")+t](i))}function bp(n){return(n=g(n),et(this[n]))?this[n]():this}function op(n,t){var r,i;if(typeof n=="object")for(n=ef(n),r=vl(n),i=0;i<r.length;i++)this[r[i].unit](n[r[i].unit]);else if(n=g(n),et(this[n]))return this[n](t);return this}function fw(n,t){return(n%t+t)%t}function cr(n,t){if(isNaN(n)||isNaN(t))return NaN;var i=fw(t,12);return n+=(t-i)/12,i===1?er(n)?29:28:31-i%7%2}function gw(n,t){return n?st(this._months)?this._months[n.month()]:this._months[(this._months.isFormat||hu).test(t)?"format":"standalone"][n.month()]:st(this._months)?this._months:this._months.standalone}function nb(n,t){return n?st(this._monthsShort)?this._monthsShort[n.month()]:this._monthsShort[hu.test(t)?"format":"standalone"][n.month()]:st(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function bw(n,t,i){var f,r,e,u=n.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],f=0;f<12;++f)e=ot([2e3,f]),this._shortMonthsParse[f]=this.monthsShort(e,"").toLocaleLowerCase(),this._longMonthsParse[f]=this.months(e,"").toLocaleLowerCase();return i?t==="MMM"?(r=a.call(this._shortMonthsParse,u),r!==-1?r:null):(r=a.call(this._longMonthsParse,u),r!==-1?r:null):t==="MMM"?(r=a.call(this._shortMonthsParse,u),r!==-1)?r:(r=a.call(this._longMonthsParse,u),r!==-1?r:null):(r=a.call(this._longMonthsParse,u),r!==-1)?r:(r=a.call(this._shortMonthsParse,u),r!==-1?r:null)}function kw(n,t,i){var r,u,f;if(this._monthsParseExact)return bw.call(this,n,t,i);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;r<12;r++)if((u=ot([2e3,r]),i&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(u,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(u,"").replace(".","")+"$","i")),i||this._monthsParse[r]||(f="^"+this.months(u,"")+"|^"+this.monthsShort(u,""),this._monthsParse[r]=new RegExp(f.replace(".",""),"i")),i&&t==="MMMM"&&this._longMonthsParse[r].test(n))||i&&t==="MMM"&&this._shortMonthsParse[r].test(n)||!i&&this._monthsParse[r].test(n))return r}function vs(n,t){var i;if(!n.isValid())return n;if(typeof t=="string")if(/^\d+$/.test(t))t=f(t);else if(t=n.localeData().monthsParse(t),!ti(t))return n;return i=Math.min(n.date(),cr(n.year(),t)),n._d["set"+(n._isUTC?"UTC":"")+"Month"](t,i),n}function ss(n){return n!=null?(vs(this,n),t.updateOffset(this,!0),this):hr(this,"Month")}function tb(){return cr(this.year(),this.month())}function lw(n){return this._monthsParseExact?(l(this,"_monthsRegex")||ih.call(this),n?this._monthsShortStrictRegex:this._monthsShortRegex):(l(this,"_monthsShortRegex")||(this._monthsShortRegex=es),this._monthsShortStrictRegex&&n?this._monthsShortStrictRegex:this._monthsShortRegex)}function pw(n){return this._monthsParseExact?(l(this,"_monthsRegex")||ih.call(this),n?this._monthsStrictRegex:this._monthsRegex):(l(this,"_monthsRegex")||(this._monthsRegex=gs),this._monthsStrictRegex&&n?this._monthsStrictRegex:this._monthsRegex)}function ih(){function f(n,t){return t.length-n.length}for(var u=[],r=[],t=[],i,n=0;n<12;n++)i=ot([2e3,n]),u.push(this.monthsShort(i,"")),r.push(this.months(i,"")),t.push(this.months(i,"")),t.push(this.monthsShort(i,""));for(u.sort(f),r.sort(f),t.sort(f),n=0;n<12;n++)u[n]=dt(u[n]),r[n]=dt(r[n]);for(n=0;n<24;n++)t[n]=dt(t[n]);this._monthsRegex=new RegExp("^("+t.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+u.join("|")+")","i")}function ww(n,t,i,r,u,f,e){var o;return n<100&&n>=0?(o=new Date(n+400,t,i,r,u,f,e),isFinite(o.getFullYear())&&o.setFullYear(n)):o=new Date(n,t,i,r,u,f,e),o}function wi(n){var t,i;return n<100&&n>=0?(i=Array.prototype.slice.call(arguments),i[0]=n+400,t=new Date(Date.UTC.apply(null,i)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(n)):t=new Date(Date.UTC.apply(null,arguments)),t}function kr(n,t,i){var r=7+t-i,u=(7+wi(n,0,r).getUTCDay()-t)%7;return-u+r-1}function us(n,t,i,r,u){var s=(7+i-r)%7,h=kr(n,r,u),e=1+7*(t-1)+s+h,f,o;return e<=0?(f=n-1,o=nr(f)+e):e>nr(n)?(f=n+1,o=e-nr(n)):(f=n,o=e),{year:f,dayOfYear:o}}function yi(n,t,i){var e=kr(n.year(),t,i),r=Math.floor((n.dayOfYear()-e-1)/7)+1,f,u;return r<1?(u=n.year()-1,f=r+ri(u,t,i)):r>ri(n.year(),t,i)?(f=r-ri(n.year(),t,i),u=n.year()+1):(u=n.year(),f=r),{week:f,year:u}}function ri(n,t,i){var u=kr(n,t,i),r=kr(n+1,t,i);return(nr(n)-u+r)/7}function yw(n){return yi(n,this._week.dow,this._week.doy).week}function wv(){return this._week.dow}function yv(){return this._week.doy}function bv(n){var t=this.localeData().week(this);return n==null?t:this.add((n-t)*7,"d")}function ny(n){var t=yi(this,1,4).week;return n==null?t:this.add((n-t)*7,"d")}function ty(n,t){return typeof n!="string"?n:isNaN(n)?(n=t.weekdaysParse(n),typeof n=="number")?n:null:parseInt(n,10)}function gv(n,t){return typeof n=="string"?t.weekdaysParse(n)%7||7:isNaN(n)?null:n}function yu(n,t){return n.slice(t,7).concat(n.slice(0,t))}function dv(n,t){var i=st(this._weekdays)?this._weekdays:this._weekdays[n&&n!==!0&&this._weekdays.isFormat.test(t)?"format":"standalone"];return n===!0?yu(i,this._week.dow):n?i[n.day()]:i}function iv(n){return n===!0?yu(this._weekdaysShort,this._week.dow):n?this._weekdaysShort[n.day()]:this._weekdaysShort}function lv(n){return n===!0?yu(this._weekdaysMin,this._week.dow):n?this._weekdaysMin[n.day()]:this._weekdaysMin}function by(n,t,i){var f,r,e,u=n.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],f=0;f<7;++f)e=ot([2e3,1]).day(f),this._minWeekdaysParse[f]=this.weekdaysMin(e,"").toLocaleLowerCase(),this._shortWeekdaysParse[f]=this.weekdaysShort(e,"").toLocaleLowerCase(),this._weekdaysParse[f]=this.weekdays(e,"").toLocaleLowerCase();return i?t==="dddd"?(r=a.call(this._weekdaysParse,u),r!==-1?r:null):t==="ddd"?(r=a.call(this._shortWeekdaysParse,u),r!==-1?r:null):(r=a.call(this._minWeekdaysParse,u),r!==-1?r:null):t==="dddd"?(r=a.call(this._weekdaysParse,u),r!==-1)?r:(r=a.call(this._shortWeekdaysParse,u),r!==-1)?r:(r=a.call(this._minWeekdaysParse,u),r!==-1?r:null):t==="ddd"?(r=a.call(this._shortWeekdaysParse,u),r!==-1)?r:(r=a.call(this._weekdaysParse,u),r!==-1)?r:(r=a.call(this._minWeekdaysParse,u),r!==-1?r:null):(r=a.call(this._minWeekdaysParse,u),r!==-1)?r:(r=a.call(this._weekdaysParse,u),r!==-1)?r:(r=a.call(this._shortWeekdaysParse,u),r!==-1?r:null)}function ky(n,t,i){var r,u,f;if(this._weekdaysParseExact)return by.call(this,n,t,i);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++)if((u=ot([2e3,1]).day(r),i&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(u,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(u,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(u,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[r]||(f="^"+this.weekdays(u,"")+"|^"+this.weekdaysShort(u,"")+"|^"+this.weekdaysMin(u,""),this._weekdaysParse[r]=new RegExp(f.replace(".",""),"i")),i&&t==="dddd"&&this._fullWeekdaysParse[r].test(n))||i&&t==="ddd"&&this._shortWeekdaysParse[r].test(n)||i&&t==="dd"&&this._minWeekdaysParse[r].test(n)||!i&&this._weekdaysParse[r].test(n))return r}function yy(n){if(!this.isValid())return n!=null?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return n!=null?(n=ty(n,this.localeData()),this.add(n-t,"d")):t}function py(n){if(!this.isValid())return n!=null?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return n==null?t:this.add(n-t,"d")}function gy(n){if(!this.isValid())return n!=null?this:NaN;if(n!=null){var t=gv(n,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7}function ey(n){return this._weekdaysParseExact?(l(this,"_weekdaysRegex")||uf.call(this),n?this._weekdaysStrictRegex:this._weekdaysRegex):(l(this,"_weekdaysRegex")||(this._weekdaysRegex=rs),this._weekdaysStrictRegex&&n?this._weekdaysStrictRegex:this._weekdaysRegex)}function ry(n){return this._weekdaysParseExact?(l(this,"_weekdaysRegex")||uf.call(this),n?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(l(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=th),this._weekdaysShortStrictRegex&&n?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function ay(n){return this._weekdaysParseExact?(l(this,"_weekdaysRegex")||uf.call(this),n?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(l(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=fh),this._weekdaysMinStrictRegex&&n?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function uf(){function f(n,t){return t.length-n.length}for(var s=[],i=[],r=[],t=[],u,h,e,o,n=0;n<7;n++)u=ot([2e3,1]).day(n),h=this.weekdaysMin(u,""),e=this.weekdaysShort(u,""),o=this.weekdays(u,""),s.push(h),i.push(e),r.push(o),t.push(h),t.push(e),t.push(o);for(s.sort(f),i.sort(f),r.sort(f),t.sort(f),n=0;n<7;n++)i[n]=dt(i[n]),r[n]=dt(r[n]),t[n]=dt(t[n]);this._weekdaysRegex=new RegExp("^("+t.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+i.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+s.join("|")+")","i")}function nf(){return this.hours()%12||12}function vy(){return this.hours()||24}function ys(n,t){r(n,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function bs(n,t){return t._meridiemParse}function ly(n){return(n+"").toLowerCase().charAt(0)==="p"}function cy(n,t,i){return n>11?i?"pm":"PM":i?"am":"AM"}function oe(n){return n?n.toLowerCase().replace("_","-"):n}function sy(n){for(var u=0,i,t,f,r;u<n.length;){for(r=oe(n[u]).split("-"),i=r.length,t=oe(n[u+1]),t=t?t.split("-"):null;i>0;){if(f=fr(r.slice(0,i).join("-")),f)return f;if(t&&t.length>=i&&ho(r,t,!0)>=i-1)break;i--}u++}return vi}function fr(n){var i=null,t;if(!y[n]&&typeof module!="undefined"&&module&&module.exports)try{i=vi._abbr,t=require,t("./locale/"+n),ci(i)}catch(r){}return y[n]}function ci(n,t){var i;return n&&(i=b(t)?bt(n):kf(n,t),i?vi=i:typeof console!="undefined"&&console.warn&&console.warn("Locale "+n+" not found. Did you forget to load it?")),vi._abbr}function kf(n,t){if(t!==null){var r,i=gf;if(t.abbr=n,y[n]!=null)ce("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),i=y[n]._config;else if(t.parentLocale!=null)if(y[t.parentLocale]!=null)i=y[t.parentLocale]._config;else if(r=fr(t.parentLocale),r!=null)i=r._config;else return pi[t.parentLocale]||(pi[t.parentLocale]=[]),pi[t.parentLocale].push({name:n,config:t}),null;return y[n]=new ou(df(i,t)),pi[n]&&pi[n].forEach(function(n){kf(n.name,n.config)}),ci(n),y[n]}return delete y[n],null}function fy(n,t){if(t!=null){var r,i,u=gf;i=fr(n),i!=null&&(u=i._config),t=df(u,t),r=new ou(t),r.parentLocale=y[n],y[n]=r,ci(n)}else y[n]!=null&&(y[n].parentLocale!=null?y[n]=y[n].parentLocale:y[n]!=null&&delete y[n]);return y[n]}function bt(n){var t;if(n&&n._locale&&n._locale._abbr&&(n=n._locale._abbr),!n)return vi;if(!st(n)){if(t=fr(n),t)return t;n=[n]}return sy(n)}function oy(){return du(y)}function bf(n){var i,t=n._a;return t&&u(n).overflow===-2&&(i=t[vt]<0||t[vt]>11?vt:t[ft]<1||t[ft]>cr(t[tt],t[vt])?ft:t[v]<0||t[v]>24||t[v]===24&&(t[it]!==0||t[at]!==0||t[ii]!==0)?v:t[it]<0||t[it]>59?it:t[at]<0||t[at]>59?at:t[ii]<0||t[ii]>999?ii:-1,u(n)._overflowDayOfYear&&(i<tt||i>ft)&&(i=ft),u(n)._overflowWeeks&&i===-1&&(i=rc),u(n)._overflowWeekday&&i===-1&&(i=kp),u(n).overflow=i),n}function oi(n,t,i){return n!=null?n:t!=null?t:i}function np(n){var i=new Date(t.now());return n._useUTC?[i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate()]:[i.getFullYear(),i.getMonth(),i.getDate()]}function af(n){var t,f,e=[],i,o,r;if(!n._d){for(i=np(n),n._w&&n._a[ft]==null&&n._a[vt]==null&&tp(n),n._dayOfYear!=null&&(r=oi(n._a[tt],i[tt]),(n._dayOfYear>nr(r)||n._dayOfYear===0)&&(u(n)._overflowDayOfYear=!0),f=wi(r,0,n._dayOfYear),n._a[vt]=f.getUTCMonth(),n._a[ft]=f.getUTCDate()),t=0;t<3&&n._a[t]==null;++t)n._a[t]=e[t]=i[t];for(;t<7;t++)n._a[t]=e[t]=n._a[t]==null?t===2?1:0:n._a[t];n._a[v]===24&&n._a[it]===0&&n._a[at]===0&&n._a[ii]===0&&(n._nextDay=!0,n._a[v]=0),n._d=(n._useUTC?wi:ww).apply(null,e),o=n._useUTC?n._d.getUTCDay():n._d.getDay(),n._tzm!=null&&n._d.setUTCMinutes(n._d.getUTCMinutes()-n._tzm),n._nextDay&&(n._a[v]=24),n._w&&typeof n._w.d!="undefined"&&n._w.d!==o&&(u(n).weekdayMismatch=!0)}}function tp(n){var t,s,e,i,r,f,l,o,c;t=n._w,t.GG!=null||t.W!=null||t.E!=null?(r=1,f=4,s=oi(t.GG,n._a[tt],yi(h(),1,4).year),e=oi(t.W,1),i=oi(t.E,1),(i<1||i>7)&&(o=!0)):(r=n._locale._week.dow,f=n._locale._week.doy,c=yi(h(),r,f),s=oi(t.gg,n._a[tt],c.year),e=oi(t.w,c.week),t.d!=null?(i=t.d,(i<0||i>6)&&(o=!0)):t.e!=null?(i=t.e+r,(t.e<0||t.e>6)&&(o=!0)):i=r),e<1||e>ri(s,r,f)?u(n)._overflowWeeks=!0:o!=null?u(n)._overflowWeekday=!0:(l=us(s,e,i,r,f),n._a[tt]=l.year,n._dayOfYear=l.dayOfYear)}function ie(n){var t,f,s=n._i,i=rp.exec(s)||ip.exec(s),h,e,r,o;if(i){for(u(n).iso=!0,t=0,f=lr.length;t<f;t++)if(lr[t][1].exec(i[1])){e=lr[t][0],h=lr[t][2]!==!1;break}if(e==null){n._isValid=!1;return}if(i[3]){for(t=0,f=fu.length;t<f;t++)if(fu[t][1].exec(i[3])){r=(i[2]||" ")+fu[t][0];break}if(r==null){n._isValid=!1;return}}if(!h&&r!=null){n._isValid=!1;return}if(i[4])if(dy.exec(i[4]))o="Z";else{n._isValid=!1;return}n._f=e+(r||"")+(o||""),pu(n)}else n._isValid=!1}function iy(n,t,i,r,u,f){var e=[sv(n),au.indexOf(t),parseInt(i,10),parseInt(r,10),parseInt(u,10)];return f&&e.push(parseInt(f,10)),e}function sv(n){var t=parseInt(n,10);return t<=49?2e3+t:t<=999?1900+t:t}function ov(n){return n.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function hv(n,t,i){if(n){var f=bu.indexOf(n),r=new Date(t[0],t[1],t[2]).getDay();if(f!==r)return u(i).weekdayMismatch=!0,i._isValid=!1,!1}return!0}function cv(n,t,i){if(n)return ee[n];if(t)return 0;var u=parseInt(i,10),r=u%100,f=(u-r)/100;return f*60+r}function fe(n){var t=he.exec(ov(n._i)),i;if(t){if(i=iy(t[4],t[3],t[2],t[5],t[6],t[7]),!hv(t[1],i,n))return;n._a=i,n._tzm=cv(t[8],t[9],t[10]),n._d=wi.apply(null,n._a),n._d.setUTCMinutes(n._d.getUTCMinutes()-n._tzm),u(n).rfc2822=!0}else n._isValid=!1}function ev(n){var i=wy.exec(n._i);if(i!==null){n._d=new Date(+i[1]);return}if(ie(n),n._isValid===!1)delete n._isValid;else return;if(fe(n),n._isValid===!1)delete n._isValid;else return;t.createFromInputFallback(n)}function pu(n){if(n._f===t.ISO_8601){ie(n);return}if(n._f===t.RFC_2822){fe(n);return}n._a=[],u(n).empty=!0;for(var r=""+n._i,i,f,o,c=r.length,h=0,s=rh(n._f,n._locale).match(ps)||[],e=0;e<s.length;e++)f=s[e],i=(r.match(hh(f,n))||[])[0],i&&(o=r.substr(0,r.indexOf(i)),o.length>0&&u(n).unusedInput.push(o),r=r.slice(r.indexOf(i)+i.length),h+=i.length),ei[f]?(i?u(n).empty=!1:u(n).unusedTokens.push(f),oh(f,i,n)):n._strict&&!i&&u(n).unusedTokens.push(f);u(n).charsLeftOver=c-h,r.length>0&&u(n).unusedInput.push(r),n._a[v]<=12&&u(n).bigHour===!0&&n._a[v]>0&&(u(n).bigHour=undefined),u(n).parsedDateParts=n._a.slice(0),u(n).meridiem=n._meridiem,n._a[v]=tv(n._locale,n._a[v],n._meridiem),af(n),bf(n)}function tv(n,t,i){var r;return i==null?t:n.meridiemHour!=null?n.meridiemHour(t,i):n.isPM!=null?(r=n.isPM(i),r&&t<12&&(t+=12),r||t!==12||(t=0),t):t}function rv(n){var t,e,f,r,i;if(n._f.length===0){u(n).invalidFormat=!0,n._d=new Date(NaN);return}for(r=0;r<n._f.length;r++)(i=0,t=vf({},n),n._useUTC!=null&&(t._useUTC=n._useUTC),t._f=n._f[r],pu(t),rf(t))&&(i+=u(t).charsLeftOver,i+=u(t).unusedTokens.length*10,u(t).score=i,(f==null||i<f)&&(f=i,e=t));kt(n,e||t)}function fv(n){if(!n._d){var t=ef(n._i);n._a=no([t.year,t.month,t.day||t.date,t.hour,t.minute,t.second,t.millisecond],function(n){return n&&parseInt(n,10)}),af(n)}}function uv(n){var t=new gi(bf(re(n)));return t._nextDay&&(t.add(1,"d"),t._nextDay=undefined),t}function re(n){var t=n._i,i=n._f;return(n._locale=n._locale||bt(n._l),t===null||i===undefined&&t==="")?ur({nullInput:!0}):(typeof t=="string"&&(n._i=t=n._locale.preparse(t)),ht(t))?new gi(bf(t)):(nu(t)?n._d=t:st(i)?rv(n):i?pu(n):kv(n),rf(n)||(n._d=null),n)}function kv(n){var i=n._i;b(i)?n._d=new Date(t.now()):nu(i)?n._d=new Date(i.valueOf()):typeof i=="string"?ev(n):st(i)?(n._a=no(i.slice(0),function(n){return parseInt(n,10)}),af(n)):ki(i)?fv(n):ti(i)?n._d=new Date(i):t.createFromInputFallback(n)}function ds(n,t,i,r,u){var f={};return(i===!0||i===!1)&&(r=i,i=undefined),(ki(n)&&kl(n)||st(n)&&n.length===0)&&(n=undefined),f._isAMomentObject=!0,f._useUTC=f._isUTC=u,f._l=i,f._i=n,f._f=t,f._strict=r,uv(f)}function h(n,t,i,r){return ds(n,t,i,r,!1)}function le(n,t){var r,i;if(t.length===1&&st(t[0])&&(t=t[0]),!t.length)return h();for(r=t[0],i=1;i<t.length;++i)(!t[i].isValid()||t[i][n](r))&&(r=t[i]);return r}function vv(){var n=[].slice.call(arguments,0);return le("isBefore",n)}function av(){var n=[].slice.call(arguments,0);return le("isAfter",n)}function pv(n){var i,r,t;for(i in n)if(!(a.call(si,i)!==-1&&(n[i]==null||!isNaN(n[i]))))return!1;for(r=!1,t=0;t<si.length;++t)if(n[si[t]]){if(r)return!1;parseFloat(n[si[t]])!==f(n[si[t]])&&(r=!0)}return!0}function vw(){return this._isValid}function aw(){return ut(NaN)}function tu(n){var t=ef(n),s=t.year||0,o=t.quarter||0,c=t.month||0,h=t.week||t.isoWeek||0,e=t.day||0,r=t.hour||0,i=t.minute||0,f=t.second||0,u=t.millisecond||0;this._isValid=pv(t),this._milliseconds=+u+f*1e3+i*6e4+r*36e5,this._days=+e+h*7,this._months=+c+o*3+s*12,this._data={},this._locale=bt(),this._bubble()}function cu(n){return n instanceof tu}function ku(n){return n<0?Math.round(-1*n)*-1:Math.round(n)}function co(n,t){r(n,0,0,function(){var n=this.utcOffset(),i="+";return n<0&&(n=-n,i="-"),i+pt(~~(n/60),2)+t+pt(~~n%60,2)})}function vu(n,t){var u=(t||"").match(n);if(u===null)return null;var e=u[u.length-1]||[],i=(e+"").match(fo)||["-",0,0],r=+(i[1]*60)+f(i[2]);return r===0?0:i[0]==="+"?r:-r}function lu(n,i){var r,u;return i._isUTC?(r=i.clone(),u=(ht(n)||nu(n)?n.valueOf():h(n).valueOf())-r.valueOf(),r._d.setTime(r._d.valueOf()+u),t.updateOffset(r,!1),r):h(n).local()}function su(n){return-Math.round(n._d.getTimezoneOffset()/15)*15}function ow(n,i,r){var f=this._offset||0,u;if(!this.isValid())return n!=null?this:NaN;if(n!=null){if(typeof n=="string"){if(n=vu(tr,n),n===null)return this}else Math.abs(n)<16&&!r&&(n=n*60);return!this._isUTC&&i&&(u=su(this)),this._offset=n,this._isUTC=!0,u!=null&&this.add(u,"m"),f!==n&&(!i||this._changeInProgress?bo(this,ut(n-f,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,t.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?f:su(this)}function ew(n,t){return n!=null?(typeof n!="string"&&(n=-n),this.utcOffset(n,t),this):-this.utcOffset()}function sw(n){return this.utcOffset(0,n)}function cw(n){return this._isUTC&&(this.utcOffset(0,n),this._isUTC=!1,n&&this.subtract(su(this),"m")),this}function hw(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var n=vu(oa,this._i);n!=null?this.utcOffset(n):this.utcOffset(0,!0)}return this}function rb(n){return this.isValid()?(n=n?h(n).utcOffset():0,(this.utcOffset()-n)%60==0):!1}function ib(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function ub(){var n,t;return b(this._isDSTShifted)?(n={},vf(n,this),n=re(n),n._a?(t=n._isUTC?ot(n._a):h(n._a),this._isDSTShifted=this.isValid()&&ho(n._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted):this._isDSTShifted}function eb(){return this.isValid()?!this._isUTC:!1}function fb(){return this.isValid()?this._isUTC:!1}function eo(){return this.isValid()?this._isUTC&&this._offset===0:!1}function ut(n,t){var i=n,r=null,u,o,e;return cu(n)?i={ms:n._milliseconds,d:n._days,M:n._months}:ti(n)?(i={},t?i[t]=n:i.milliseconds=n):(r=oo.exec(n))?(u=r[1]==="-"?-1:1,i={y:0,d:f(r[ft])*u,h:f(r[v])*u,m:f(r[it])*u,s:f(r[at])*u,ms:f(ku(r[ii]*1e3))*u}):(r=lo.exec(n))?(u=r[1]==="-"?-1:1,i={y:gt(r[2],u),M:gt(r[3],u),w:gt(r[4],u),d:gt(r[5],u),h:gt(r[6],u),m:gt(r[7],u),s:gt(r[8],u)}):i==null?i={}:typeof i=="object"&&("from"in i||"to"in i)&&(e=dw(h(i.from),h(i.to)),i={},i.ms=e.milliseconds,i.M=e.months),o=new tu(i),cu(n)&&l(n,"_locale")&&(o._locale=n._locale),o}function gt(n,t){var i=n&&parseFloat(n.replace(",","."));return(isNaN(i)?0:i)*t}function po(n,t){var i={};return i.months=t.month()-n.month()+(t.year()-n.year())*12,n.clone().add(i.months,"M").isAfter(t)&&--i.months,i.milliseconds=+t-+n.clone().add(i.months,"M"),i}function dw(n,t){var i;return n.isValid()&&t.isValid()?(t=lu(t,n),n.isBefore(t)?i=po(n,t):(i=po(t,n),i.milliseconds=-i.milliseconds,i.months=-i.months),i):{milliseconds:0,months:0}}function wo(n,t){return function(i,r){var f,u;return r===null||isNaN(+r)||(ce(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),u=i,i=r,r=u),i=typeof i=="string"?+i:i,f=ut(i,r),bo(this,f,n),this}}function bo(n,i,r,u){var o=i._milliseconds,e=ku(i._days),f=ku(i._months);n.isValid()&&(u=u==null?!0:u,f&&vs(n,hr(n,"Month")+f*r),e&&uh(n,"Date",hr(n,"Date")+e*r),o&&n._d.setTime(n._d.valueOf()+o*r),u&&t.updateOffset(n,e||f))}function lp(n,t){var i=n.diff(t,"days",!0);return i<-6?"sameElse":i<-1?"lastWeek":i<0?"lastDay":i<1?"sameDay":i<2?"nextDay":i<7?"nextWeek":"sameElse"}function cp(n,i){var u=n||h(),e=lu(u,this).startOf("day"),r=t.calendarFormat(this,e)||"sameElse",f=i&&(et(i[r])?i[r].call(this,u):i[r]);return this.format(f||this.localeData().calendar(r,this,h(u)))}function ap(){return new gi(this)}function yp(n,t){var i=ht(n)?n:h(n);return this.isValid()&&i.isValid()?(t=g(t)||"millisecond",t==="millisecond"?this.valueOf()>i.valueOf():i.valueOf()<this.clone().startOf(t).valueOf()):!1}function vp(n,t){var i=ht(n)?n:h(n);return this.isValid()&&i.isValid()?(t=g(t)||"millisecond",t==="millisecond"?this.valueOf()<i.valueOf():this.clone().endOf(t).valueOf()<i.valueOf()):!1}function hp(n,t,i,r){var f=ht(n)?n:h(n),u=ht(t)?t:h(t);return this.isValid()&&f.isValid()&&u.isValid()?(r=r||"()",(r[0]==="("?this.isAfter(f,i):!this.isBefore(f,i))&&(r[1]===")"?this.isBefore(u,i):!this.isAfter(u,i))):!1}function fp(n,t){var r=ht(n)?n:h(n),i;return this.isValid()&&r.isValid()?(t=g(t)||"millisecond",t==="millisecond"?this.valueOf()===r.valueOf():(i=r.valueOf(),this.clone().startOf(t).valueOf()<=i&&i<=this.clone().endOf(t).valueOf())):!1}function up(n,t){return this.isSame(n,t)||this.isAfter(n,t)}function ep(n,t){return this.isSame(n,t)||this.isBefore(n,t)}function sp(n,t,i){var r,f,u;if(!this.isValid())return NaN;if(r=lu(n,this),!r.isValid())return NaN;f=(r.utcOffset()-this.utcOffset())*6e4,t=g(t);switch(t){case"year":u=wu(this,r)/12;break;case"month":u=wu(this,r);break;case"quarter":u=wu(this,r)/3;break;case"second":u=(this-r)/1e3;break;case"minute":u=(this-r)/6e4;break;case"hour":u=(this-r)/36e5;break;case"day":u=(this-r-f)/864e5;break;case"week":u=(this-r-f)/6048e5;break;default:u=this-r}return i?u:d(u)}function wu(n,t){var u=(t.year()-n.year())*12+(t.month()-n.month()),i=n.clone().add(u,"months"),r,f;return t-i<0?(r=n.clone().add(u-1,"months"),f=(t-i)/(i-r)):(r=n.clone().add(u+1,"months"),f=(t-i)/(r-i)),-(u+f)||0}function tw(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function nw(n){if(!this.isValid())return null;var i=n!==!0,t=i?this.clone().utc():this;return t.year()<0||t.year()>9999?wr(t,i?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):et(Date.prototype.toISOString)?i?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*6e4).toISOString().replace("Z",wr(t,"Z")):wr(t,i?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function iw(){var t,n;if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";t="moment",n="",this.isLocal()||(t=this.utcOffset()===0?"moment.utc":"moment.parseZone",n="Z");var u="["+t+'("]',f=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",i="-MM-DD[T]HH:mm:ss.SSS",r=n+'[")]';return this.format(u+f+i+r)}function uw(n){n||(n=this.isUtc()?t.defaultFormatUtc:t.defaultFormat);var i=wr(this,n);return this.localeData().postformat(i)}function rw(n,t){return this.isValid()&&(ht(n)&&n.isValid()||h(n).isValid())?ut({to:this,from:n}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function gp(n){return this.from(h(),n)}function wp(n,t){return this.isValid()&&(ht(n)&&n.isValid()||h(n).isValid())?ut({from:this,to:n}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function pp(n){return this.to(h(),n)}function yo(n){var t;return n===undefined?this._locale._abbr:(t=bt(n),t!=null&&(this._locale=t),this)}function uo(){return this._locale}function li(n,t){return(n%t+t)%t}function we(n,t,i){return n<100&&n>=0?new Date(n+400,t,i)-pe:new Date(n,t,i).valueOf()}function be(n,t,i){return n<100&&n>=0?Date.UTC(n+400,t,i)-pe:Date.UTC(n,t,i)}function ec(n){var i,r;if(n=g(n),n===undefined||n==="millisecond"||!this.isValid())return this;r=this._isUTC?be:we;switch(n){case"year":i=r(this.year(),0,1);break;case"quarter":i=r(this.year(),this.month()-this.month()%3,1);break;case"month":i=r(this.year(),this.month(),1);break;case"week":i=r(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":i=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":i=r(this.year(),this.month(),this.date());break;case"hour":i=this._d.valueOf(),i-=li(i+(this._isUTC?0:this.utcOffset()*hi),or);break;case"minute":i=this._d.valueOf(),i-=li(i,hi);break;case"second":i=this._d.valueOf(),i-=li(i,sr)}return this._d.setTime(i),t.updateOffset(this,!0),this}function fc(n){var i,r;if(n=g(n),n===undefined||n==="millisecond"||!this.isValid())return this;r=this._isUTC?be:we;switch(n){case"year":i=r(this.year()+1,0,1)-1;break;case"quarter":i=r(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":i=r(this.year(),this.month()+1,1)-1;break;case"week":i=r(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":i=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":i=r(this.year(),this.month(),this.date()+1)-1;break;case"hour":i=this._d.valueOf(),i+=or-li(i+(this._isUTC?0:this.utcOffset()*hi),or)-1;break;case"minute":i=this._d.valueOf(),i+=hi-li(i,hi)-1;break;case"second":i=this._d.valueOf(),i+=sr-li(i,sr)-1}return this._d.setTime(i),t.updateOffset(this,!0),this}function tc(){return this._d.valueOf()-(this._offset||0)*6e4}function kh(){return Math.floor(this.valueOf()/1e3)}function bh(){return new Date(this.valueOf())}function dh(){var n=this;return[n.year(),n.month(),n.date(),n.hour(),n.minute(),n.second(),n.millisecond()]}function nc(){var n=this;return{years:n.year(),months:n.month(),date:n.date(),hours:n.hours(),minutes:n.minutes(),seconds:n.seconds(),milliseconds:n.milliseconds()}}function gh(){return this.isValid()?this.toISOString():null}function oc(){return rf(this)}function pc(){return kt({},u(this))}function yc(){return u(this).overflow}function wc(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function vr(n,t){r(0,[n,n.length],0,t)}function bc(n){return ae.call(this,n,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)}function vc(n){return ae.call(this,n,this.isoWeek(),this.isoWeekday(),1,4)}function hc(){return ri(this.year(),1,4)}function sc(){var n=this.localeData()._week;return ri(this.year(),n.dow,n.doy)}function ae(n,t,i,r,u){var f;return n==null?yi(this,r,u).year:(f=ri(n,r,u),t>f&&(t=f),cc.call(this,n,t,i,r,u))}function cc(n,t,i,r,u){var e=us(n,t,i,r,u),f=wi(e.year,0,e.dayOfYear);return this.year(f.getUTCFullYear()),this.month(f.getUTCMonth()),this.date(f.getUTCDate()),this}function ac(n){return n==null?Math.ceil((this.month()+1)/3):this.month((n-1)*3+this.month()%3)}function lc(n){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return n==null?t:this.add(n-t,"d")}function vh(n,t){t[ii]=f(("0."+n)*1e3)}function ph(){return this._isUTC?"UTC":""}function ah(){return this._isUTC?"Coordinated Universal Time":""}function sh(n){return h(n*1e3)}function lh(){return h.apply(null,arguments).parseZone()}function to(n){return n}function yr(n,t,i,r){var f=bt(),u=ot().set(r,t);return f[i](u,n)}function io(n,t,i){if(ti(n)&&(t=n,n=undefined),n=n||"",t!=null)return yr(n,t,i,"month");for(var u=[],r=0;r<12;r++)u[r]=yr(n,r,i,"month");return u}function hf(n,t,i,r){var o,e,u,f;if(typeof n=="boolean"?(ti(t)&&(i=t,t=undefined),t=t||""):(t=n,i=t,n=!1,ti(t)&&(i=t,t=undefined),t=t||""),o=bt(),e=n?o._week.dow:0,i!=null)return yr(t,(i+e)%7,r,"day");for(f=[],u=0;u<7;u++)f[u]=yr(t,(u+e)%7,r,"day");return f}function sa(n,t){return io(n,t,"months")}function ca(n,t){return io(n,t,"monthsShort")}function ha(n,t,i){return hf(n,t,i,"weekdays")}function fa(n,t,i){return hf(n,t,i,"weekdaysShort")}function ta(n,t,i){return hf(n,t,i,"weekdaysMin")}function ia(){var n=this._data;return this._milliseconds=ct(this._milliseconds),this._days=ct(this._days),this._months=ct(this._months),n.milliseconds=ct(n.milliseconds),n.seconds=ct(n.seconds),n.minutes=ct(n.minutes),n.hours=ct(n.hours),n.months=ct(n.months),n.years=ct(n.years),this}function ro(n,t,i,r){var u=ut(t,i);return n._milliseconds+=r*u._milliseconds,n._days+=r*u._days,n._months+=r*u._months,n._bubble()}function ua(n,t){return ro(this,n,t,1)}function ra(n,t){return ro(this,n,t,-1)}function de(n){return n<0?Math.floor(n):Math.ceil(n)}function ba(){var r=this._milliseconds,n=this._days,t=this._months,i=this._data,e,o,u,s,f;return r>=0&&n>=0&&t>=0||r<=0&&n<=0&&t<=0||(r+=de(lf(t)+n)*864e5,n=0,t=0),i.milliseconds=r%1e3,e=d(r/1e3),i.seconds=e%60,o=d(e/60),i.minutes=o%60,u=d(o/60),i.hours=u%24,n+=d(u/24),f=d(ge(n)),t+=f,n-=de(lf(f)),s=d(t/12),t%=12,i.days=n,i.months=t,i.years=s,this}function ge(n){return n*4800/146097}function lf(n){return n*146097/4800}function da(n){if(!this.isValid())return NaN;var t,r,i=this._milliseconds;if(n=g(n),n==="month"||n==="quarter"||n==="year"){t=this._days+i/864e5,r=this._months+ge(t);switch(n){case"month":return r;case"quarter":return r/3;case"year":return r/12}}else{t=this._days+Math.round(lf(this._months));switch(n){case"week":return t/7+i/6048e5;case"day":return t+i/864e5;case"hour":return t*24+i/36e5;case"minute":return t*1440+i/6e4;case"second":return t*86400+i/1e3;case"millisecond":return Math.floor(t*864e5)+i;default:throw new Error("Unknown unit "+n);}}}function nv(){return this.isValid()?this._milliseconds+this._days*864e5+this._months%12*2592e6+f(this._months/12)*31536e6:NaN}function yt(n){return function(){return this.as(n)}}function ol(){return ut(this)}function hl(n){return n=g(n),this.isValid()?this[n+"s"]():NaN}function ni(n){return function(){return this.isValid()?this._data[n]:NaN}}function wl(){return d(this.days()/7)}function dl(n,t,i,r,u){return u.relativeTime(t||1,!!i,n,r)}function pl(n,t,i){var r=ut(n).abs(),f=lt(r.as("s")),o=lt(r.as("m")),s=lt(r.as("h")),h=lt(r.as("d")),e=lt(r.as("M")),c=lt(r.as("y")),u=f<=rt.ss&&["s",f]||f<rt.s&&["ss",f]||o<=1&&["m"]||o<rt.m&&["mm",o]||s<=1&&["h"]||s<rt.h&&["hh",s]||h<=1&&["d"]||h<rt.d&&["dd",h]||e<=1&&["M"]||e<rt.M&&["MM",e]||c<=1&&["y"]||["yy",c];return u[2]=t,u[3]=+n>0,u[4]=i,dl.apply(null,u)}function ll(n){return n===undefined?lt:typeof n=="function"?(lt=n,!0):!1}function cl(n,t){return rt[n]===undefined?!1:t===undefined?rt[n]:(rt[n]=t,n==="s"&&(rt.ss=t-1),!0)}function al(n){if(!this.isValid())return this.localeData().invalidDate();var i=this.localeData(),t=pl(this,!n,i);return n&&(t=i.pastFuture(+this,t)),i.postformat(t)}function fi(n){return(n>0)-(n<0)||+n}function pr(){if(!this.isValid())return this.localeData().invalidDate();var i=gr(this._milliseconds)/1e3,w=gr(this._days),o=gr(this._months),t,v,a;t=d(i/60),v=d(t/60),i%=60,t%=60,a=d(o/12),o%=12;var l=a,s=o,c=w,r=v,e=t,f=i?i.toFixed(3).replace(/\.?0+$/,""):"",n=this.asSeconds();if(!n)return"P0D";var y=n<0?"-":"",h=fi(this._months)!==fi(n)?"-":"",p=fi(this._days)!==fi(n)?"-":"",u=fi(this._milliseconds)!==fi(n)?"-":"";return y+"P"+(l?h+l+"Y":"")+(s?h+s+"M":"")+(c?p+c+"D":"")+(r||e||f?"T":"")+(r?u+r+"H":"")+(e?u+e+"M":"")+(f?u+f+"S":"")}var ue,gu,ar,rr,yf,du,ws,eh,nh,ls,fs,as,ai,of,ir,wf,a,hu,cs,au,es,gs,is,os,bu,ts,rs,th,fh,ko,he,ee,ne,te,so,si,fo,oo,lo,ao,vo,eu,pf,ve,ye,wt,ke,n,o,ct,lt,rt,gr,e;gu=Array.prototype.some?Array.prototype.some:function(n){for(var i=Object(this),r=i.length>>>0,t=0;t<r;t++)if(t in i&&n.call(this,i[t],t,i))return!0;return!1},ar=t.momentProperties=[],rr=!1,yf={},t.suppressDeprecationWarnings=!1,t.deprecationHandler=null,du=Object.keys?Object.keys:function(n){var t,i=[];for(t in n)l(n,t)&&i.push(t);return i},ws={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},eh={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},nh="Invalid date",ls="%d",fs=/\d{1,2}/,as={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ai={},of={};var ps=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,dr=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,sf={},ei={};var go=/\d/,k=/\d\d/,ns=/\d{3}/,cf=/\d{4}/,br=/[+-]?\d{6}/,c=/\d\d?/,hs=/\d\d\d\d?/,ks=/\d\d\d\d\d\d?/,ru=/\d{1,3}/,tf=/\d{1,4}/,iu=/[+-]?\d{1,6}/,ea=/\d+/,uu=/[+-]?\d+/,oa=/Z|[+-]\d\d:?\d\d/gi,tr=/Z|[+-]\d\d(?::?\d\d)?/gi,dc=/[+-]?\d+(\.\d{1,3})?/,di=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,ff={};ir={};var tt=0,vt=1,ft=2,v=3,it=4,at=5,ii=6,rc=7,kp=8;r("Y",0,0,function(){var n=this.year();return n<=9999?""+n:"+"+n}),r(0,["YY",2],0,function(){return this.year()%100}),r(0,["YYYY",4],0,"year"),r(0,["YYYYY",5],0,"year"),r(0,["YYYYYY",6,!0],0,"year"),p("year","y"),w("year",1),i("Y",uu),i("YY",c,k),i("YYYY",tf,cf),i("YYYYY",iu,br),i("YYYYYY",iu,br),s(["YYYYY","YYYYYY"],tt),s("YYYY",function(n,i){i[tt]=n.length===2?t.parseTwoDigitYear(n):f(n)}),s("YY",function(n,i){i[tt]=t.parseTwoDigitYear(n)}),s("Y",function(n,t){t[tt]=parseInt(n,10)}),t.parseTwoDigitYear=function(n){return f(n)+(f(n)>68?1900:2e3)},wf=ui("FullYear",!0),a=Array.prototype.indexOf?Array.prototype.indexOf:function(n){for(var t=0;t<this.length;++t)if(this[t]===n)return t;return-1},r("M",["MM",2],"Mo",function(){return this.month()+1}),r("MMM",0,0,function(n){return this.localeData().monthsShort(this,n)}),r("MMMM",0,0,function(n){return this.localeData().months(this,n)}),p("month","M"),w("month",8),i("M",c),i("MM",c,k),i("MMM",function(n,t){return t.monthsShortRegex(n)}),i("MMMM",function(n,t){return t.monthsRegex(n)}),s(["M","MM"],function(n,t){t[vt]=f(n)-1}),s(["MMM","MMMM"],function(n,t,i,r){var f=i._locale.monthsParse(n,r,i._strict);f!=null?t[vt]=f:u(i).invalidMonth=n}),hu=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,cs="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),au="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),es=di,gs=di,r("w",["ww",2],"wo","week"),r("W",["WW",2],"Wo","isoWeek"),p("week","w"),p("isoWeek","W"),w("week",5),w("isoWeek",5),i("w",c),i("ww",c,k),i("W",c),i("WW",c,k),bi(["w","ww","W","WW"],function(n,t,i,r){t[r.substr(0,1)]=f(n)}),is={dow:0,doy:6},r("d",0,"do","day"),r("dd",0,0,function(n){return this.localeData().weekdaysMin(this,n)}),r("ddd",0,0,function(n){return this.localeData().weekdaysShort(this,n)}),r("dddd",0,0,function(n){return this.localeData().weekdays(this,n)}),r("e",0,0,"weekday"),r("E",0,0,"isoWeekday"),p("day","d"),p("weekday","e"),p("isoWeekday","E"),w("day",11),w("weekday",11),w("isoWeekday",11),i("d",c),i("e",c),i("E",c),i("dd",function(n,t){return t.weekdaysMinRegex(n)}),i("ddd",function(n,t){return t.weekdaysShortRegex(n)}),i("dddd",function(n,t){return t.weekdaysRegex(n)}),bi(["dd","ddd","dddd"],function(n,t,i,r){var f=i._locale.weekdaysParse(n,r,i._strict);f!=null?t.d=f:u(i).invalidWeekday=n}),bi(["d","e","E"],function(n,t,i,r){t[r]=f(n)}),os="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),bu="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),ts="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),rs=di,th=di,fh=di,r("H",["HH",2],0,"hour"),r("h",["hh",2],0,nf),r("k",["kk",2],0,vy),r("hmm",0,0,function(){return""+nf.apply(this)+pt(this.minutes(),2)}),r("hmmss",0,0,function(){return""+nf.apply(this)+pt(this.minutes(),2)+pt(this.seconds(),2)}),r("Hmm",0,0,function(){return""+this.hours()+pt(this.minutes(),2)}),r("Hmmss",0,0,function(){return""+this.hours()+pt(this.minutes(),2)+pt(this.seconds(),2)}),ys("a",!0),ys("A",!1),p("hour","h"),w("hour",13),i("a",bs),i("A",bs),i("H",c),i("h",c),i("k",c),i("HH",c,k),i("hh",c,k),i("kk",c,k),i("hmm",hs),i("hmmss",ks),i("Hmm",hs),i("Hmmss",ks),s(["H","HH"],v),s(["k","kk"],function(n,t){var r=f(n);t[v]=r===24?0:r}),s(["a","A"],function(n,t,i){i._isPm=i._locale.isPM(n),i._meridiem=n}),s(["h","hh"],function(n,t,i){t[v]=f(n),u(i).bigHour=!0}),s("hmm",function(n,t,i){var r=n.length-2;t[v]=f(n.substr(0,r)),t[it]=f(n.substr(r)),u(i).bigHour=!0}),s("hmmss",function(n,t,i){var r=n.length-4,e=n.length-2;t[v]=f(n.substr(0,r)),t[it]=f(n.substr(r,2)),t[at]=f(n.substr(e)),u(i).bigHour=!0}),s("Hmm",function(n,t){var r=n.length-2;t[v]=f(n.substr(0,r)),t[it]=f(n.substr(r))}),s("Hmmss",function(n,t){var r=n.length-4,u=n.length-2;t[v]=f(n.substr(0,r)),t[it]=f(n.substr(r,2)),t[at]=f(n.substr(u))}),ko=/[ap]\.?m?\.?/i;var hy=ui("Hours",!0),gf={calendar:ws,longDateFormat:eh,invalidDate:nh,ordinal:ls,dayOfMonthOrdinalParse:fs,relativeTime:as,months:cs,monthsShort:au,week:is,weekdays:os,weekdaysMin:ts,weekdaysShort:bu,meridiemParse:ko},y={},pi={},vi;var rp=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,ip=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,dy=/Z|[+-]\d\d(?::?\d\d)?/,lr=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],fu=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],wy=/^\/?Date\((\-?\d+)/i;he=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,ee={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480},t.createFromInputFallback=nt("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(n){n._d=new Date(n._i+(n._useUTC?" UTC":""))}),t.ISO_8601=function(){},t.RFC_2822=function(){},ne=nt("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var n=h.apply(null,arguments);return this.isValid()&&n.isValid()?n<this?this:n:ur()}),te=nt("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var n=h.apply(null,arguments);return this.isValid()&&n.isValid()?n>this?this:n:ur()}),so=function(){return Date.now?Date.now():+new Date},si=["year","quarter","month","week","day","hour","minute","second","millisecond"],co("Z",":"),co("ZZ",""),i("Z",tr),i("ZZ",tr),s(["Z","ZZ"],function(n,t,i){i._useUTC=!0,i._tzm=vu(tr,n)}),fo=/([\+\-]|\d\d)/gi,t.updateOffset=function(){},oo=/^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,lo=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,ut.fn=tu.prototype,ut.invalid=aw,ao=wo(1,"add"),vo=wo(-1,"subtract"),t.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",t.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]",eu=nt("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(n){return n===undefined?this.localeData():this.locale(n)});var sr=1e3,hi=60*sr,or=60*hi,pe=3506328*or;for(r(0,["gg",2],0,function(){return this.weekYear()%100}),r(0,["GG",2],0,function(){return this.isoWeekYear()%100}),vr("gggg","weekYear"),vr("ggggg","weekYear"),vr("GGGG","isoWeekYear"),vr("GGGGG","isoWeekYear"),p("weekYear","gg"),p("isoWeekYear","GG"),w("weekYear",1),w("isoWeekYear",1),i("G",uu),i("g",uu),i("GG",c,k),i("gg",c,k),i("GGGG",tf,cf),i("gggg",tf,cf),i("GGGGG",iu,br),i("ggggg",iu,br),bi(["gggg","ggggg","GGGG","GGGGG"],function(n,t,i,r){t[r.substr(0,2)]=f(n)}),bi(["gg","GG"],function(n,i,r,u){i[u]=t.parseTwoDigitYear(n)}),r("Q",0,"Qo","quarter"),p("quarter","Q"),w("quarter",7),i("Q",go),s("Q",function(n,t){t[vt]=(f(n)-1)*3}),r("D",["DD",2],"Do","date"),p("date","D"),w("date",9),i("D",c),i("DD",c,k),i("Do",function(n,t){return n?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),s(["D","DD"],ft),s("Do",function(n,t){t[ft]=f(n.match(c)[0])}),pf=ui("Date",!0),r("DDD",["DDDD",3],"DDDo","dayOfYear"),p("dayOfYear","DDD"),w("dayOfYear",4),i("DDD",ru),i("DDDD",ns),s(["DDD","DDDD"],function(n,t,i){i._dayOfYear=f(n)}),r("m",["mm",2],0,"minute"),p("minute","m"),w("minute",14),i("m",c),i("mm",c,k),s(["m","mm"],it),ve=ui("Minutes",!1),r("s",["ss",2],0,"second"),p("second","s"),w("second",15),i("s",c),i("ss",c,k),s(["s","ss"],at),ye=ui("Seconds",!1),r("S",0,0,function(){return~~(this.millisecond()/100)}),r(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),r(0,["SSS",3],0,"millisecond"),r(0,["SSSS",4],0,function(){return this.millisecond()*10}),r(0,["SSSSS",5],0,function(){return this.millisecond()*100}),r(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),r(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),r(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),r(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),p("millisecond","ms"),w("millisecond",16),i("S",ru,go),i("SS",ru,k),i("SSS",ru,ns),wt="SSSS";wt.length<=9;wt+="S")i(wt,ea);for(wt="S";wt.length<=9;wt+="S")s(wt,vh);ke=ui("Milliseconds",!1),r("z",0,0,"zoneAbbr"),r("zz",0,0,"zoneName"),n=gi.prototype,n.add=ao,n.calendar=cp,n.clone=ap,n.diff=sp,n.endOf=fc,n.format=uw,n.from=rw,n.fromNow=gp,n.to=wp,n.toNow=pp,n.get=bp,n.invalidAt=yc,n.isAfter=yp,n.isBefore=vp,n.isBetween=hp,n.isSame=fp,n.isSameOrAfter=up,n.isSameOrBefore=ep,n.isValid=oc,n.lang=eu,n.locale=yo,n.localeData=uo,n.max=te,n.min=ne,n.parsingFlags=pc,n.set=op,n.startOf=ec,n.subtract=vo,n.toArray=dh,n.toObject=nc,n.toDate=bh,n.toISOString=nw,n.inspect=iw,n.toJSON=gh,n.toString=tw,n.unix=kh,n.valueOf=tc,n.creationData=wc,n.year=wf,n.isLeapYear=dp,n.weekYear=bc,n.isoWeekYear=vc,n.quarter=n.quarters=ac,n.month=ss,n.daysInMonth=tb,n.week=n.weeks=bv,n.isoWeek=n.isoWeeks=ny,n.weeksInYear=sc,n.isoWeeksInYear=hc,n.date=pf,n.day=n.days=yy,n.weekday=py,n.isoWeekday=gy,n.dayOfYear=lc,n.hour=n.hours=hy,n.minute=n.minutes=ve,n.second=n.seconds=ye,n.millisecond=n.milliseconds=ke,n.utcOffset=ow,n.utc=sw,n.local=cw,n.parseZone=hw,n.hasAlignedHourOffset=rb,n.isDST=ib,n.isLocal=eb,n.isUtcOffset=fb,n.isUtc=eo,n.isUTC=eo,n.zoneAbbr=ph,n.zoneName=ah,n.dates=nt("dates accessor is deprecated. Use date instead.",pf),n.months=nt("months accessor is deprecated. Use month instead",ss),n.years=nt("years accessor is deprecated. Use year instead",wf),n.zone=nt("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",ew),n.isDSTShifted=nt("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",ub),o=ou.prototype,o.calendar=ic,o.longDateFormat=uc,o.invalidDate=kc,o.ordinal=yh,o.preparse=to,o.postformat=to,o.relativeTime=ch,o.pastFuture=ka,o.set=uy,o.months=gw,o.monthsShort=nb,o.monthsParse=kw,o.monthsRegex=pw,o.monthsShortRegex=lw,o.week=yw,o.firstDayOfYear=yv,o.firstDayOfWeek=wv,o.weekdays=dv,o.weekdaysMin=lv,o.weekdaysShort=iv,o.weekdaysParse=ky,o.weekdaysRegex=ey,o.weekdaysShortRegex=ry,o.weekdaysMinRegex=ay,o.isPM=ly,o.meridiem=cy,ci("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(n){var t=n%10,i=f(n%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return n+i}}),t.lang=nt("moment.lang is deprecated. Use moment.locale instead.",ci),t.langData=nt("moment.langData is deprecated. Use moment.localeData instead.",bt),ct=Math.abs;var ga=yt("ms"),wa=yt("s"),aa=yt("m"),la=yt("h"),va=yt("d"),pa=yt("w"),ya=yt("M"),el=yt("Q"),fl=yt("y");var ul=ni("milliseconds"),nl=ni("seconds"),gc=ni("minutes"),tl=ni("hours"),rl=ni("days"),il=ni("months"),bl=ni("years");return lt=Math.round,rt={ss:44,s:45,m:45,h:22,d:26,M:11},gr=Math.abs,e=tu.prototype,e.isValid=vw,e.abs=ia,e.add=ua,e.subtract=ra,e.as=da,e.asMilliseconds=ga,e.asSeconds=wa,e.asMinutes=aa,e.asHours=la,e.asDays=va,e.asWeeks=pa,e.asMonths=ya,e.asQuarters=el,e.asYears=fl,e.valueOf=nv,e._bubble=ba,e.clone=ol,e.get=hl,e.milliseconds=ul,e.seconds=nl,e.minutes=gc,e.hours=tl,e.days=rl,e.weeks=wl,e.months=il,e.years=bl,e.humanize=al,e.toISOString=pr,e.toString=pr,e.toJSON=pr,e.locale=yo,e.localeData=uo,e.toIsoString=nt("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",pr),e.lang=eu,r("X",0,0,"unix"),r("x",0,0,"valueOf"),i("x",uu),i("X",dc),s("X",function(n,t,i){i._d=new Date(parseFloat(n,10)*1e3)}),s("x",function(n,t,i){i._d=new Date(f(n))}),t.version="2.24.0",yl(h),t.fn=n,t.min=vv,t.max=av,t.now=so,t.utc=ot,t.unix=sh,t.months=sa,t.isDate=nu,t.locale=ci,t.invalid=ur,t.duration=ut,t.isMoment=ht,t.weekdays=ha,t.parseZone=lh,t.localeData=bt,t.isDuration=cu,t.monthsShort=ca,t.weekdaysMin=ta,t.defineLocale=kf,t.updateLocale=fy,t.locales=oy,t.weekdaysShort=fa,t.normalizeUnits=g,t.relativeTimeRounding=ll,t.relativeTimeThreshold=cl,t.calendarFormat=lp,t.prototype=n,t.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},t}),window.addEventListener("DOMContentLoaded",function(){var n=document.querySelectorAll(".js-countdown");n.length>0&&(diffDuration(n),setInterval(diffDuration.bind(this,n),5e3))}),Function.prototype.bind||(Function.prototype.bind=function(n){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var u=Array.prototype.slice.call(arguments,1),r=this,t=function(){},i=function(){return r.apply(this instanceof t&&n?this:n,u.concat(Array.prototype.slice.call(arguments)))};return t.prototype=this.prototype,i.prototype=new t,i}),!function(n){function i(){var n=arguments[0],t=i.cache;return t[n]&&t.hasOwnProperty(n)||(t[n]=i.parse(n)),i.format.call(null,t[n],arguments)}function u(n){return Object.prototype.toString.call(n).slice(8,-1).toLowerCase()}function f(n,t){return Array(t+1).join(n)}var t={not_string:/[^s]/,number:/[diefg]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijosuxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[\+\-]/},r;i.format=function(n,r){for(var e,l,o,a,w,p,b=1,k=n.length,v="",s=[],y=!0,h="",c=0;k>c;c++)if(v=u(n[c]),"string"===v)s[s.length]=n[c];else if("array"===v){if(o=n[c],o[2])for(e=r[b],l=0;l<o[2].length;l++){if(!e.hasOwnProperty(o[2][l]))throw new Error(i("[sprintf] property '%s' does not exist",o[2][l]));e=e[o[2][l]]}else e=o[1]?r[o[1]]:r[b++];if("function"==u(e)&&(e=e()),t.not_string.test(o[8])&&t.not_json.test(o[8])&&"number"!=u(e)&&isNaN(e))throw new TypeError(i("[sprintf] expecting number but found %s",u(e)));switch(t.number.test(o[8])&&(y=e>=0),o[8]){case"b":e=e.toString(2);break;case"c":e=String.fromCharCode(e);break;case"d":case"i":e=parseInt(e,10);break;case"j":e=JSON.stringify(e,null,o[6]?parseInt(o[6]):0);break;case"e":e=o[7]?e.toExponential(o[7]):e.toExponential();break;case"f":e=o[7]?parseFloat(e).toFixed(o[7]):parseFloat(e);break;case"g":e=o[7]?parseFloat(e).toPrecision(o[7]):parseFloat(e);break;case"o":e=e.toString(8);break;case"s":e=(e=String(e))&&o[7]?e.substring(0,o[7]):e;break;case"u":e>>>=0;break;case"x":e=e.toString(16);break;case"X":e=e.toString(16).toUpperCase()}t.json.test(o[8])?s[s.length]=e:(!t.number.test(o[8])||y&&!o[3]?h="":(h=y?"+":"-",e=e.toString().replace(t.sign,"")),w=o[4]?"0"===o[4]?"0":o[4].charAt(1):" ",p=o[6]-(h+e).length,a=o[6]&&p>0?f(w,p):"",s[s.length]=o[5]?h+e+a:"0"===w?h+a+e:a+h+e)}return s.join("")},i.cache={},i.parse=function(n){for(var e=n,i=[],f=[],s=0;e;){if(null!==(i=t.text.exec(e)))f[f.length]=i[0];else if(null!==(i=t.modulo.exec(e)))f[f.length]="%";else{if(null===(i=t.placeholder.exec(e)))throw new SyntaxError("[sprintf] unexpected placeholder");if(i[2]){s|=1;var r=[],o=i[2],u=[];if(null===(u=t.key.exec(o)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(r[r.length]=u[1];""!==(o=o.substring(u[0].length));)if(null!==(u=t.key_access.exec(o)))r[r.length]=u[1];else{if(null===(u=t.index_access.exec(o)))throw new SyntaxError("[sprintf] failed to parse named argument key");r[r.length]=u[1]}i[2]=r}else s|=2;if(3===s)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");f[f.length]=i}e=e.substring(i[0].length)}return f},r=function(n,t,r){return r=(t||[]).slice(0),r.splice(0,0,n),i.apply(null,r)},"undefined"!=typeof exports?(exports.sprintf=i,exports.vsprintf=r):(n.sprintf=i,n.vsprintf=r,"function"==typeof define&&define.amd&&define(function(){return{sprintf:i,vsprintf:r}}))}("undefined"==typeof window?this:window),$.fn.serializeObject=function(){var n={},t=this.serializeArray();return $.each(t,function(){void 0!==n[this.name]?(n[this.name].push||(n[this.name]=[n[this.name]]),n[this.name].push(this.value||"")):n[this.name]=this.value||""}),n},pb=pb||{},pb.Translator=function(){this.hasMessages=!1},pb.Translator.prototype.add=function(n,t,i){var u;isDefined(this[n])||(this[n]={}),u=this[n];for(var r=t.split("."),e=r.length,f=0;f<e-1;f++)isDefined(u[r[f]])||(u[r[f]]={}),u=u[r[f]];if(isDefined(r[e-1])){if("object"==typeof u[r[e-1]])throw"Klíč '"+t+"' je již definován.";u[r[e-1]]=i.toString(),this.hasMessage=!0}},pb.Translator.prototype.translate=function(n,t,i){var u,r;if(!this.hasMessage)throw"Nejsou dostupné žádné zprávy";for(var f=this[n]||(this[n]={}),e=t.split("."),r=0;r<e.length;r++){if("undefined"==typeof f[e[r]])throw"Klíč '"+t+"' není nastaven pro '"+n+"' lokalizaci.";f=f[e[r]]}if(u=f.toString(),i)for(r=1;r<=i.length;r++)u=u.replace("$"+r,i[r-1]);return u},pb=pb||{},pb.Dependencies=function(){this.list={},this.instances={}},pb.Dependencies.prototype.get=function(n){return this.instances[n]?this.instances[n]:"function"==typeof this.list[n]?this.instantiate_(n):(warn("Závislost s názvem '"+n+"' není registrována v bootstrap.js."),null)},pb.Dependencies.prototype.getConstructor=function(n){return this.list[n]?this.list[n]:(warn("Závislost s názvem '"+n+"' není registrována v bootstrap.js."),null)},pb.Dependencies.prototype.instantiate_=function(n){return this.instances[n]=new this.list[n](this)},pb.Dependencies.prototype.register=function(n,t){if(this.list[n])throw new Error("Název závislosti '"+n+"' je již zaregistrován.");if(!isDefined(t)&&pb.debug)throw new Error("Závislost s názvem '"+n+"' nebyla nalezena.");this.list[n]=t},pb=pb||{},pb.version="RC1.4.0",pb.Application=function(n,t,i,r){this.dependencyFactory=t,this.componentFactory=n,this.request=i,this.template=r,this.guid=0,this.translator=null,this.onStartup=null,this.onError=null,this.lastErrorPopup=null,this.requests=[],this.openPopups=[],this.popupContainerId="pb-popup-container",this.locale=$("html").attr("lang")||null,null===this.locale&&warn("Není nastavena lokalizace."),this.config={},this.checkRequiredDependencies_()},pb.Application.Attributes={COMPONENT:"data-component",AJAX:"data-ajax",SNIPPET:"data-snippet-id"},pb.Application.Events={AJAX_START:"-ajax-start",AJAX_SUCCESS:"-ajax-success",AJAX_ERROR:"-ajax-error",AJAX_COMPLETE:"-ajax-complete"},pb.Application.prototype.initPlugins=function(){},pb.Application.prototype.getPopupContainerId=function(){return this.popupContainerId},pb.Application.prototype.run=function(){try{this.initPlugins(),isCallable(this.onStartup)&&this.onStartup(this),console.groupCollapsed("Načítání komponent"),this.loadComponents(),console.groupEnd()}catch(n){pb.Exception.handle(n)}},pb.Application.prototype.nextGuid=function(){return++this.guid},pb.Application.prototype.loadComponents=function(n){n instanceof $||(n=$(n||document.body));for(var i=n.find("["+pb.Application.Attributes.COMPONENT+"]"),r=i.length,t=0;t<r;t++)this.loadComponent_($(i[t]));0===r&&info("Kontext neobsahuje žádné další komponenty.",n)},pb.Application.prototype.getComponentName_=function(n){return n.attr(pb.Application.Attributes.COMPONENT)},pb.Application.prototype.loadComponent_=function(n){var t=this.getComponentName_(n),i=this.componentFactory.getConstructor(t);return isCallable(i)?n.data("componentInstance")?void(n.data("componentInstance")instanceof i||warn("Element",n," je již svázán s komponentou:",t)):pb.debug&&pb.debugComponents&&$.inArray(t,pb.debugComponents)===-1?void warn("Komponenta '"+t+"' se nebude načítat, z důvodu debugování jiných komponent určených v pb.debugComponents v bootstrap.js."):void this.createComponent(i,n):void warn("Komponenta s názvem '"+t+"' není zaregistrována, zkontroluj bootstrap.js.")},pb.Application.prototype.immediateLoadComponent=function(n){var t;return t=n?$("#"+n):$("script").last().prev("["+pb.Application.Attributes.COMPONENT+"]"),t.length?(info("Okamžité načtení komponenty:"),void this.loadComponent_(t)):void warn("Element, pro který se má okamžitě načíst komponenta neexistuje",t)},pb.Application.prototype.createComponent=function(n,t){var i=new n(t,this.dependencyFactory),r;if(!(i instanceof pb.Component)){r=t.attr(pb.Application.Attributes.COMPONENT);throw Error("Komponenta "+r+" není instancí pb.Component, použij extend() těsně za konstruktorem.");}return i.setApplication(this),i.guid=this.nextGuid(),info("Načítám komponentu:","\n -- instance:",i,"\n -- element:",t),i.attrs=i.element.data(),isCallable(i.prepare)&&i.prepare(),t.data("componentInstance",i),void 0!==i.finish&&i.finish(),i},pb.Application.prototype.updateComponentByName_=function(n,t){var i=this.dependencyFactory.get("component").get($("["+pb.Application.Attributes.COMPONENT+"="+n+"]"));i&&i instanceof pb.Component&&i.redraw(t,!0)},pb.Application.prototype.destroyComponents=function(n){n instanceof $||(n=$(n||document.body));for(var i,r=n.find("["+pb.Application.Attributes.COMPONENT+"]"),u=r.length,t=0;t<u;t++)i=this.dependencyFactory.get("component").get(r[t]),i instanceof pb.Component&&i.destroy()},pb.Application.prototype.replaceOpenedPopups=function(n){var r=$("<div/>").html(n),i=r,t=r.find('[data-component="popup"]');return 0===t.length?n:($.each(t,function(n,t){var u=$(t),f=u.attr("id"),r=$("#"+this.popupContainerId).find("#"+f);r.length>0&&(r.empty().html(u.html()),this.initPlugins(r),console.groupCollapsed("Načítání komponent v popupech"),this.loadComponents(r),console.groupEnd(),i.find("#"+f).remove())}.bind(this)),i.html())},pb.Application.prototype.removeOpenedPopups=function(n){var i=$(n.trim()),t=i.find('[data-component="popup"]');return 0===t.length?n:void $.each(t,function(n,t){var r=$(t),u=r.attr("id"),i=$("#"+this.popupContainerId).find("#"+u);i.length>0&&i.remove()}.bind(this))},pb.Application.prototype.updateSnippet_=function(n,t){var i=this.getSnippet(n),r;i?(this.destroyComponents(i),i.is("["+pb.Application.Attributes.COMPONENT+"]"))?(console.groupCollapsed("Přenačítání snippet komponenty - "+i[0].dataset.snippetId),r=this.dependencyFactory.get("component").get(i),r&&r instanceof pb.Component?(this.initPlugins(i),r.redraw(t,!0),r.setBusy(!1)):warn("Snippet '"+n+"' s komponentou '"+i.attr(pb.Application.Attributes.COMPONENT)+"' má být překreslen, ale na elementu nebyla nalezena instance komponenty.",i),console.groupEnd()):i.data("snippet-append")?(t=$($.trim(t)),this.initPlugins(t),console.groupCollapsed("Načítání komponent snippet-append"),this.loadComponents(t),console.groupEnd(),i.append(t)):(this.removeOpenedPopups(t),i.empty().html(t),this.initPlugins(i),console.groupCollapsed("Přenačítání komponenty - "+i[0].dataset.snippetId),this.loadComponents(i),console.groupEnd()):warn("Snippet '"+n+"' má být aktualizován, ale nebyl nalezen v dokumentu.")},pb.Application.prototype.getSnippet=function(n){var t=$("["+pb.Application.Attributes.SNIPPET+"="+n+"]");return t.length?t:null},pb.Application.prototype.createRequest=function(){var n=new this.request;return this.addRequestSuccesses_(n),this.addRequestErrors_(n),$(n).on(pb.Request.EventTypes.BEFORE_SEND,function(){this.abortRequests_(),this.requests.push(n)}.bind(this)),n},pb.Application.prototype.abortRequests_=function(){return},pb.Application.prototype.addRequestSuccesses_=function(n){var t=this;n.addSuccessCallback(function(n){if(isDefined(n.redirect))return void(window.location.href="self"===n.redirect?document.URL:n.redirect);if(n.snippets)for(var u in n.snippets)n.snippets.hasOwnProperty(u)&&t.updateSnippet_(u,n.snippets[u])})},pb.Application.prototype.addRequestErrors_=function(n){n.addErrorCallback(function(){var n={content:this.request.defaultError};null!==this.lastErrorPopup&&(this.lastErrorPopup.destroy(),this.lastErrorPopup.element.remove()),this.lastErrorPopup=this.createPopup(pb.component.Popup.Templates.BASE_X,n),this.lastErrorPopup.overlayVisibility(!0),this.lastErrorPopup.open()}.bind(this))},pb.Application.prototype.createPopup=function(n,t){if("string"==typeof n){var r=this.template.process(n,t),i=this.template.process(pb.component.Popup.Templates.WRAPPER,{content:r});n=$(i)}else if(!n.length)return warn("Nebyl předán žádný element pro popup.",n),null;return this.createComponent(this.componentFactory.getConstructor("popup"),n)},pb.Application.prototype.createTemplate=function(){return this.template},pb.Application.prototype.saveState=function(){},pb.Application.prototype.restoreState=function(){},pb.Application.prototype.getUrl=function(){return window.location.protocol+"//"+window.location.host},pb.Application.prototype.checkRequiredDependencies_=function(){for(var u=this.dependencyFactory,f=this.componentFactory,i=["component"],r=["overlay","popup"],n=0,t=r.length;n<t;n++)if(null===f.getConstructor(r[n]))throw new Error("Komponenta s nazvem "+r[n]+" je interne pouzivana a musi byt registrována.");for(n=0,t=i.length;n<t;n++)if(null===u.getConstructor(i[n]))throw new Error("Zavislost s nazvem "+i[n]+" je interne pouzivana a musi byt registrována.");},pb.Application.prototype.addConfig=function(n,t){if(isDefined(this.config[n]))throw new Error("Konfigurační název "+n+" je již použitý.");this.config[n]=this.config[n]||{},$.extend(this.config[n],t)},pb.Application.prototype.getConfig=function(n){return this.config[n]},pb.Application.prototype.redirect=function(n){window.location.href=n},pb.Application.prototype.setTranslator=function(n){this.translator=n},pb.Application.prototype.getTranslator=function(){return this.translator||null},pb.Application.prototype.translate=function(n,t,i){var r=this.getTranslator();if(null===r)throw new Error("Není nastavený překladač.");if(i=i||this.getLocale(),null===i)throw new Error("Není definovana lokalizace aplikace.");return r.translate(i,n,t)},pb.Application.prototype.setLocale=function(n){this.locale=n},pb.Application.prototype.getLocale=function(){return this.locale},pb.Application.prototype.readCookie=function(n){for(var t,n=n+"=",r=document.cookie.split(";"),i=0,u=r.length;i<u;i++){for(t=r[i];" "===t.charAt(0);)t=t.substring(1);if(0===t.indexOf(n))return t.substring(n.length,t.length)}return""},pb.Application.prototype.setCookie=function(n,t,i){var r=new Date,u;i=toInt(i)||30,r.setTime(r.getTime()+864e5*i),u="expires="+r.toUTCString(),document.cookie=n+"="+t+"; "+u},pb.Application.prototype.initAjax=function(){var r="["+pb.Application.Attributes.AJAX+"]",n=null,i=this,t=function(t,r,u,f){var e,s,h,o;if(n&&n.abort(),e=i.createRequest(),e.setUrl(t),u&&e.addData(u),s=[],h=function(){for(var n=0,t=s.length;n<t;n++)s[n].data("snippet-append",!1)},f.data("snippet-append"))for(var l=f.attr("data-snippet-append").split(","),c=0,a=l.length;c<a;c++)o=this.getSnippet(l[c]),o&&!o.attr("data-snippet-append")&&(o.data("snippet-append",!0),s.push(o));e.addSuccessCallback(function(t){n=null,h(),f.trigger(pb.Application.Events.AJAX_SUCCESS,t)}),e.addErrorCallback(function(n){h(),f.trigger(pb.Application.Events.AJAX_ERROR,n)}),f.trigger(pb.Application.Events.AJAX_START,e),f.data("ajax-save-history")===!1&&e.setSaveHistory(!1),n="post"===r?e.post():e.get(),n.always(function(n,t,i){f.trigger(pb.Application.Events.AJAX_COMPLETE,[n,t,i])})}.bind(this);$("body").on("click","a"+r,function(n){if(!isPreventClickEvent(n)){var u=$(n.currentTarget),r=u.attr("href")||u.data("href");r&&(r=i.getUrl()+r,n.preventDefault(),t(r,"get",null,u))}}.bind(this)).on("submit","form"+r,function(n){n.preventDefault();var i=$(n.currentTarget),f=i.attr("action"),u=i.attr("method")||"get",r=i.serializeObject();t(f,u,r,i)}.bind(this))},pb=pb||{},pb.Component=function(n){this.element=n,this.busy=!1,this.busyOverlay=null,this.switchToDefaultRedrawType(),this.redrawer=null,this.subscribedEvents=[]},pb.Component.EventType={CLICK:"click"},pb.Component.RedrawType={REPLACE:"-replace",APPEND:"-append"},pb.Component.prototype.prepare=function(){},pb.Component.prototype.setApplication=function(n){this.application=n},pb.Component.prototype.getApplication=function(){return this.application},pb.Component.prototype.createRequest=function(){return this.getApplication().createRequest()},pb.Component.prototype.createTemplate=function(){return this.getApplication().createTemplate()},pb.Component.prototype.createPopup=function(n,t){return this.getApplication().createPopup(n,t)},pb.Component.prototype.redraw=function(n,t){if(t){var i=$($.trim(n));i.is("["+pb.Application.Attributes.COMPONENT+"]")&&(n=i.html())}if(this.destroy(),!this.redrawer||this.redrawer&&this.redrawer(this.element,n)===!1)switch(this.redrawType){case pb.Component.RedrawType.REPLACE:this.element.empty().html(n);break;case pb.Component.RedrawType.APPEND:this.element.append(n)}this.application.loadComponents(this.element)},pb.Component.prototype.setBusy=function(n,t){var i,u,r;this.busy!==n&&(i=this,(this.busy=n,t)&&("string"==typeof t&&(u=$(t).appendTo(this.element),r=this.getApplication().componentFactory.getConstructor("overlay"),t=this.getApplication().createComponent(r,u)),t.show(),this.busyOverlay=t,$(this.busyOverlay).on(pb.component.Overlay.EventTypes.HIDE,function(){i.busyOverlay.remove(),i.busyOverlay=null})),!n&&this.busyOverlay&&this.busyOverlay.hide())},pb.Component.prototype.isBusy=function(){return this.busy},pb.Component.prototype.redirect=function(n){this.getApplication().redirect(n)},pb.Component.prototype.translate=function(n,t,i){return this.getApplication().translate(n,t,i)},pb.Component.prototype.switchToDefaultRedrawType=function(){this.redrawType=pb.Component.RedrawType.REPLACE},pb.Component.prototype.setRedrawType=function(n){this.redrawType=n},pb.Component.prototype.setRedrawer=function(n){this.redrawer=n},pb.Component.prototype.getAttr=function(n){return this.attrs.hasOwnProperty(n)?this.attrs[n]:null},pb.Component.prototype.getAllAttrs=function(){return this.attrs},pb.Component.prototype.observe=function(n,t,i){var u=sprintf("c_%i",this.guid),r=n.subscribe(t,i,u);return this.subscribedEvents.push(r),function(){this.clearObserver(r)}.bind(this)},pb.Component.prototype.clearObserver=function(n){var t=this.subscribedEvents.indexOf(n);t!==-1&&this.subscribedEvents.splice(t,1),n()},pb.Component.prototype.clearComponentObservers=function(){for(var n=this.subscribedEvents.length;n--;)this.clearObserver(this.subscribedEvents[n])},pb.Component.prototype.destroy=function(){this.clearComponentObservers()},pb=pb||{},pb.component=pb.component||{},pb.component.Overlay=function(n){pb.Component.call(this,n||this.getDefaultOverlay())},extend(pb.component.Overlay,pb.Component),pb.component.Overlay.Templates={LOADING:'<div class="pb-overlay pb-overlay--loading"><div class="pb-overlay__text">Načítám, čekejte prosím.</div></div>'},pb.component.Overlay.EventTypes={SHOW:"-show",HIDE:"-hide",CLICK:"-click"},pb.component.Overlay.prototype.prepare=function(){this.element.on("click",function(){$(this).trigger(pb.component.Overlay.EventTypes.CLICK)}.bind(this))},pb.component.Overlay.prototype.show=function(){this.element.addClass("show"),$(this).trigger(pb.component.Overlay.EventTypes.SHOW)},pb.component.Overlay.prototype.hide=function(){this.element.removeClass("show"),$(this).trigger(pb.component.Overlay.EventTypes.HIDE)},pb.component.Overlay.prototype.remove=function(){this.element.remove()},pb.component.Overlay.create=function(n){var t=this.getApplication().componentFactory.getConstructor("overlay");return this.getApplication().createComponent(t,n||t.getDefaultOverlay())},pb.component.Overlay.getDefaultOverlay=pb.component.Overlay.prototype.getDefaultOverlay=function(){var n=null;return $("#pb-overlay").length?n=$("#pb-overlay"):(n=$('<div id="pb-overlay">'),$("body").append(n)),n},pb=pb||{},pb.component=pb.component||{},pb.component.Popup=function(n){pb.Component.call(this,n),this.overlay=null,this.container=null,this.snap=null},extend(pb.component.Popup,pb.Component),pb.component.Popup.prototype.prepare=function(){this.element.on("click",".close",this.handleClose.bind(this)),this.getApplication().initPlugins(this.element)},pb.component.Popup.prototype.hideOnEscape_=!1,pb.component.Popup.prototype.handleClose=function(n){var t=$(n.target);(t.is(this.element)||t.hasClass("close"))&&(n.preventDefault(),this.close())},pb.component.Popup.prototype.getCloseOnEscape=function(){return this.closeOnEscape_},pb.component.Popup.prototype.setCloseOnEscape=function(n){this.closeOnEscape_=n},pb.component.Popup.EventType={BEFORE_OPEN:"beforeopen",BEFORE_CLOSE:"beforeclose",AFTER_OPEN:"afteropen",AFTER_CLOSE:"afterclose"},pb.component.Popup.prototype.show_=function(){this.reposition_(),this.element.show()},pb.component.Popup.prototype.hide_=function(){this.element.hide()},pb.component.Popup.prototype.open=function(){this.isVisible()||this.onBeforeOpen()&&(this.moveToContainer_(),this.closeOnEscape_&&$(document).on("keydown.pbpopup",this.onKeyDown_.bind(this)),this.getApplication().openPopups.length&&this.getApplication().openPopups[this.getApplication().openPopups.length-1].close(),this.overlay&&this.overlay.show(),this.show_(),this.getApplication().openPopups.push(this),$(this).triggerHandler(pb.component.Popup.EventType.AFTER_OPEN))},pb.component.Popup.prototype.close=function(){this.onBeforeClose()&&(this.overlay&&this.overlay.hide(),this.removeOnClose&&this.element.remove(),$(document).unbind(".pbpopup"),this.hide_(),this.getApplication().openPopups.splice($.inArray(this,this.getApplication().openPopups),1),this.getApplication().openPopups.length&&this.getApplication().openPopups[this.getApplication().openPopups.length-1].open(),$(this).trigger(pb.component.Popup.EventType.AFTER_CLOSE))},pb.component.Popup.prototype.isVisible=function(){return this.element.is(":visible")},pb.component.Popup.prototype.overlayVisibility=function(n){if(n&&!this.overlay){var t=this.getApplication().componentFactory.getConstructor("overlay");this.overlay=this.getApplication().createComponent(t,pb.component.Overlay.getDefaultOverlay()),$(this.overlay).on(pb.component.Overlay.EventTypes.SHOW,this.onOverlayShow.bind(this)).on(pb.component.Overlay.EventTypes.HIDE,this.onOverlayHide.bind(this)).on(pb.component.Overlay.EventTypes.CLICK,this.onOverlayClick.bind(this))}else!n&&this.overlay&&$(this.overlay).off()},pb.component.Popup.prototype.onOverlayShow=function(){this.show_()},pb.component.Popup.prototype.onOverlayHide=function(){this.hide_()},pb.component.Popup.prototype.onOverlayClick=function(){this.element.find(".js-default-action").trigger("click")},pb.component.Popup.prototype.onBeforeOpen=function(){var n=$(this).triggerHandler(pb.component.Popup.EventType.BEFORE_OPEN);return n!==!1},pb.component.Popup.prototype.onBeforeClose=function(){var n=$(this).triggerHandler(pb.component.Popup.EventType.BEFORE_CLOSE);return n!==!1},pb.component.Popup.prototype.onKeyDown_=function(n){n.which===pb.Keys.ESC&&this.close()},pb.component.Popup.prototype.moveToContainer_=function(){var n=this.getContainer_();n.append(this.element)},pb.component.Popup.prototype.getContainer_=function(){if(this.container)return this.container;var n=$("#pb-popup-container");return n.length||(n=$("<div id=pb-popup-container>"),$("body").append(n)),this.container=n,n},pb.component.Popup.HorizontalPosition={LEFT:"left",RIGHT:"right",MIDDLE:"middle"},pb.component.Popup.VerticalPosition={TOP:"top",BOTTOM:"bottom"},pb.component.Popup.prototype.setSnapTo=function(n,t,i,r){var u="resize.pb-component-popup";return null===n?(this.snap=null,void $(window).unbind(u)):(r=$.extend({top:0,right:0,bottom:0,left:0},r),this.snap={element:n,horizontal:t,vertical:i,offset:r},$(window).bind(u,function(){this.isVisible()&&this.reposition_()}.bind(this)),void this.reposition_())},pb.component.Popup.prototype.reposition_=function(){if(this.snap){var t,n=this.snap.element;this.snap.horizontal===pb.component.Popup.HorizontalPosition.RIGHT&&this.snap.vertical===pb.component.Popup.VerticalPosition.TOP?t={top:n.offset().top+n.outerHeight(!0)+this.snap.offset.top,left:n.offset().left+n.outerWidth(!0)-this.element.outerWidth(!0)+this.snap.offset.left,bottom:"auto",right:"auto",position:"absolute","margin-left":0}:this.snap.horizontal===pb.component.Popup.HorizontalPosition.LEFT&&this.snap.vertical===pb.component.Popup.VerticalPosition.TOP?t={top:n.offset().top+n.outerHeight(!0)+this.snap.offset.top,left:n.offset().left+this.snap.offset.left,bottom:"auto",right:"auto",position:"absolute","margin-left":0}:this.snap.horizontal===pb.component.Popup.HorizontalPosition.MIDDLE&&this.snap.vertical===pb.component.Popup.VerticalPosition.TOP?t={top:n.offset().top+n.outerHeight(!0)+this.snap.offset.top,left:n.offset().left+n.outerWidth()/2-this.element.outerWidth()/2+this.snap.offset.left,bottom:"auto",right:"auto",position:"absolute","margin-left":0}:this.snap.horizontal===pb.component.Popup.HorizontalPosition.RIGHT&&this.snap.vertical===pb.component.Popup.VerticalPosition.BOTTOM?t={top:n.offset().top-this.element.outerHeight(!0)-this.snap.offset.top,left:n.offset().left+n.outerWidth(!0)-this.element.outerWidth(!0)+this.snap.offset.left,bottom:"auto",right:"auto",position:"absolute","margin-left":0}:this.snap.horizontal===pb.component.Popup.HorizontalPosition.LEFT&&this.snap.vertical===pb.component.Popup.VerticalPosition.BOTTOM?t={top:n.offset().top-this.element.outerHeight(!0)-this.snap.offset.top,left:n.offset().left+this.snap.offset.left,bottom:"auto",right:"auto",position:"absolute","margin-left":0}:this.snap.horizontal===pb.component.Popup.HorizontalPosition.MIDDLE&&this.snap.vertical===pb.component.Popup.VerticalPosition.BOTTOM&&(t={top:n.offset().top-this.element.outerHeight(!0)-this.snap.offset.top,left:n.offset().left+n.outerWidth()/2-this.element.outerWidth()/2+this.snap.offset.left,bottom:"auto",right:"auto",position:"absolute","margin-left":0}),this.element.css(t)}},pb.component.Popup.Templates={WRAPPER:'<div class="pb-popup"><%=content%></div>',BASE:'<div class="pb-popup-content"><%=content%></div>',BASE_X:'<div class="pb-popup-content"><%=content%></div><div class="pb-popup-close close js-default-action"></div>',WITH_HEADING:'<div class="pb-popup-heading"><%=heading%></div><div class="pb-popup-content"><%=content%></div>',WITH_HEADING_X:'<div class="pb-popup-heading"><%=heading%></div><div class="pb-popup-content"><%=content%></div><div class="pb-popup-close close js-default-action"></div></div>'},pb=pb||{},pb.Keys={ENTER:13,ESC:27,ARROW_UP:38,ARROW_DOWN:40,ARROW_LEFT:37,ARROW_RIGHT:39,SPACE:32,DEL:46,TAB:9,BACKSPACE:8},pb=pb||{},pb.Request=function(n,t){this.url=n||document.URL,this.data=t||{},this.options={},this.successCallbacks=[],this.errorCallbacks=[],this.method="get",this.saveHistory=!0,this.xhr=null},pb.Request.EventTypes={BEFORE_SEND:"-beforesend",COMPLETE:"-complete"},pb.Request.defaultError="Při komunikaci se serverem došlo k chybě.",pb.Request.prototype.setUrl=function(n){return this.url=n,this},pb.Request.prototype.getUrl=function(){return this.url},pb.Request.prototype.urlPrefix=function(n){var t=$("html").data("url-prefix");return t&&"/"===t.charAt(0)&&(n=t+n,n=n.replace("//","/")),n},pb.Request.prototype.addSuccessCallback=function(n){return this.successCallbacks.push(n),this},pb.Request.prototype.addErrorCallback=function(n){return this.errorCallbacks.push(n),this},pb.Request.prototype.setSuccess=function(n){return this.addSuccessCallback(n),this},pb.Request.prototype.setError=function(n){return this.addErrorCallback(n),this},pb.Request.prototype.addData=function(n){return $.extend(this.data,n),this},pb.Request.prototype.getData=function(){return this.data},pb.Request.prototype.send=function(n){var u,r,f,i,t;return this.url||warn("URL požadavku nebyla nastavena, bude použitá: "+window.location.href),u=this.urlPrefix(this.url||window.location.href),r=u.split("#")[1]||null,n&&this.setMethod(n),f={dataType:"json",cache:!1},i=$.extend(f,this.options),i.data=this.data,i.type=this.method,t=this,this.successCallbacks.length&&(i.success=function(n,i,u){var e;$(t).trigger(pb.Request.EventTypes.COMPLETE);for(var o=this.url+(null!==r?"#"+r:""),f=0,s=t.successCallbacks.length;f<s;f++)e=t.successCallbacks[f],e(n,i,u,o)}),this.errorCallbacks.length&&(i.error=function(n,i,r){var o,u,e,f;if($(t).trigger(pb.Request.EventTypes.COMPLETE),o=this.url,"abort"!==i)for(u=t.errorCallbacks.length-1;u>=0;u--)if(f=t.errorCallbacks[u],e=f(n,i,r,o),e===!1)break}),$(this).trigger(pb.Request.EventTypes.BEFORE_SEND),this.xhr=$.ajax(u,i),this.xhr},pb.Request.prototype.setOptions=function(n){return this.options=n,this},pb.Request.prototype.getOptions=function(){return this.options||{}},pb.Request.prototype.setMethod=function(n){return n=n.toLowerCase(),"get"===n||"post"===n?this.method=n:(this.method="get",warn("Neplatný argument pro nastavení metody odesílání požadavku, nastavena výchozi get.",n)),this},pb.Request.prototype.getMethod=function(){return this.method},pb.Request.prototype.get=function(){return this.send()},pb.Request.prototype.post=function(){return this.send("post")},pb.Request.prototype.setSaveHistory=function(n){return this.saveHistory=n,this},pb.Request.prototype.getSaveHistory=function(){return this.saveHistory},pb.Request.prototype.getXhr=function(){return this.xhr},pb=pb||{},pb.Template={cache:{}},pb.Template.process=function(n,t){var i=/\W/.test(n)?new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+n.replace(/[\r\t\n]/g," ").split("<%").join("\t").replace(/((^|%>)[^\t]*)'/g,"$1\r").replace(/\t=(.*?)%>/g,"',$1,'").split("\t").join("');").split("%>").join("p.push('").split("\r").join("\\'")+"');}return p.join('');"):pb.Template.cache[n]=pb.Template.cache[n]||pb.Template.process(n);return t?i(t):i},pb.Template.render=function(n,t,i){var r=pb.Template.process($("#template-"+n).html(),t);i&&$(i).html(r)},pb=pb||{},pb.component=pb.component||{},pb.component.PopupOpener=function(n,t){pb.Component.call(this,n,t),this.dependencies={component:t.get("component")}},extend(pb.component.PopupOpener,pb.Component),pb.component.PopupOpener.Types={HTML:"html",AJAX:"ajax"},pb.component.PopupOpener.SourceTypes={SNIPPET:"snippet",CONTENT:"content"},pb.component.PopupOpener.prototype.prepare=function(){this.template=this.element.data("template")||"WITH_HEADING_X",this.snapTo=this.element.data("snap-to"),this.snapHorizontal=this.element.data("snap-horizontal"),this.snapVertical=this.element.data("snap-vertical"),this.popupClass=this.element.data("class")||"",this.element.on("click",this.handleClick.bind(this))},pb.component.PopupOpener.prototype.handleClick=function(n){var r;n.stopPropagation(),n.preventDefault();var i=$(n.currentTarget),t=i.data("href")||i.attr("href")||"",f=this.getType(t),e=i.data("data"),o=this.element.data("ajax-content"),u=i.data("heading");if(pb.component.Popup.Templates[this.template],o)return void this.openPopupWithAjaxContent_(t,e,o,u);switch(f){case pb.component.PopupOpener.Types.HTML:this.openPopupByElement_(t);break;case pb.component.PopupOpener.Types.AJAX:if(r=this.element.attr("data-snippet"),!r)return void warn("Komponenta PopupOpener vyžaduje atribut 'data-snippet', který určí, jaký snippet se otevře do vyskakovacího okna.",this.element);this.openPopupBySnippet_(r,t,e,u);break;default:warn("Nebyl nalezen správný typ vyskakovacího okna.",f)}},pb.component.PopupOpener.prototype.openPopupWithAjaxContent_=function(n,t,i,r){var u=this.createPopup(app.component.Popup.Templates.WRAPPER,{popupClass:this.popupClass,content:""}),f;u&&u instanceof pb.component.Popup&&(f=this.createTemplate().process(pb.component.Popup.Templates.WITH_HEADING_X,{heading:r,content:this.translate("app.loading")}),u.redraw(f,!0),this.openPopup_(u),this.ajaxRequest_(u,n,t,i,pb.component.PopupOpener.SourceTypes.CONTENT,r))},pb.component.PopupOpener.prototype.openPopupBySnippet_=function(n,t,i,r){var u=this.createPopup(app.component.Popup.Templates.WRAPPER,{popupClass:this.popupClass,content:""}),f;u&&u instanceof pb.component.Popup&&(f=this.createTemplate().process(pb.component.Popup.Templates.WITH_HEADING_X,{heading:r,content:this.translate("app.loading")}),u.redraw(f,!0),this.openPopup_(u),this.ajaxRequest_(u,t,i,n,pb.component.PopupOpener.SourceTypes.SNIPPET,r))},pb.component.PopupOpener.prototype.openPopup_=function(n){if(n&&n instanceof pb.component.Popup){var i=this.element.attr("data-popup-class"),t=$(this.element.attr("data-popup-preload-id")).html();t&&n.redraw(t),i&&n.element.addClass(i),n.setCloseOnEscape(!0),this.snapTo?(n.setSnapTo(this.element,pb.component.Popup.HorizontalPosition[this.snapHorizontal],pb.component.Popup.VerticalPosition[this.snapVertical]),n.overlayVisibility(!1)):n.overlayVisibility(!0),n.open()}},pb.component.PopupOpener.prototype.openPopupByElement_=function(n){var t=this.dependencies.component.get($(n));this.openPopup_(t)},pb.component.PopupOpener.prototype.ajaxRequest_=function(n,t,i,r,u,f){var e=this.createRequest();u=u||pb.component.PopupOpener.SourceTypes.SNIPPET,u===pb.component.PopupOpener.SourceTypes.SNIPPET?i=$.extend(i,{snp:[r]}):u===pb.component.PopupOpener.SourceTypes.CONTENT&&(i=$.extend(i,{cnt:[r]})),e.setSaveHistory(!1),e.setUrl(t),e.addSuccessCallback(function(t){var e,o,i;u===pb.component.PopupOpener.SourceTypes.SNIPPET?(e=this.getApplication().getSnippet(r),e.length?(i=this.createTemplate().process(pb.component.Popup.Templates[this.template],{heading:f,content:e.html()}),n.redraw(i)):warn("Snippet '"+r+"' nebyl nalezen v dokumentu, vyskakovací okno nebylo aktualizováno.")):u===pb.component.PopupOpener.SourceTypes.CONTENT&&(o=t.contents[r],i=this.createTemplate().process(pb.component.Popup.Templates[this.template],{heading:f,content:o}),n.redraw(i))}.bind(this)),e.addErrorCallback(function(){var i=this.createTemplate().process(pb.component.Popup.Templates.BASE_X,{content:this.translate("app.server.error")});return n.redraw(i,!0),!1}.bind(this)),i&&e.addData(i),e.send()},pb.component.PopupOpener.prototype.getType=function(n){return"#"===n[0]?pb.component.PopupOpener.Types.HTML:pb.component.PopupOpener.Types.AJAX},pb=pb||{},pb.component=pb.component||{},pb.component.Paging=function(n){pb.Component.call(this,n)},extend(pb.component.Paging,pb.Component),pb.component.Paging.prototype.prepare=function(){this.element.on("click","a",this.handleClick.bind(this))},pb.component.Paging.prototype.handleClick=function(n){n.preventDefault();var f=$(n.currentTarget),t=this.element.data("scrollTo"),r=this.element.data("scrollToOn")||"complete",i=this.createRequest(),u=this.getApplication().getUrl()+f.attr("href");t&&("before"===r?this.scrollToElement_($(t)):"complete"===r&&i.addSuccessCallback(function(){this.scrollToElement_($(t))}.bind(this))),i.setUrl(u).send()},pb.component.Paging.prototype.scrollToElement_=function(n){n.length&&$("html, body").animate({scrollTop:n.offset().top-15},"slow")},pb.component.Paging.prototype.redraw=function(n,t){pb.Component.prototype.redraw.call(this,n,t),n&&this.element.children().length>0?this.element.show():this.element.hide();var i=this.element.parent().offset().top;$(window).scrollTop()>i&&$("html, body").animate({scrollTop:i})},pb=pb||{},pb.Service=function(){this.events={}},pb.Service.prototype.registerEvent=function(n){return!0===this.isEventRegistered(n)?void warn(sprintf('Service: event "%s" already registered',n)):(this.events[n]={handlers:[]},n)},pb.Service.prototype.subscribe=function(n,t){var i,r=!1;return!1===this.isEventRegistered(n)?void warn(sprintf('PubSub: attempted to subscribe non registered event "%s"',n)):(i=this.events[n].handlers,i.push(t),function(){if(!r){var n=i.indexOf(t);i.splice(n,1),r=!0}})},pb.Service.prototype.publish=function(n,t){var r,i,u=t||[];if(!1===this.isEventRegistered(n))return void warn(sprintf('PubSub: attempted to publish non registered event "%s"',n));for(r=this.events[n].handlers,i=r.length;i--;)this.callHandler(r[i],u)},pb.Service.prototype.callHandler=function(n,t){try{n.apply(this,t)}catch(i){pb.Exception.handle(i)}},pb.Service.prototype.isEventRegistered=function(n){return this.events.hasOwnProperty(n)},pb=pb||{},pb.service=pb.service||{},pb.service.Component=function(){},pb.service.Component.prototype.get=function(n){return n instanceof jQuery||(n=$(n)),n.data("componentInstance")},pb=pb||{},pb.service=pb.service||{},pb.service.Browser=function(){pb.Service.call(this);var n=$(window),r=$(document),u=$("body"),t=$("html, body"),i=$("html");this.getWindow=function(){return n},this.getDocument=function(){return r},this.getBody=function(){return u},this.getView=function(){return t},this.getHtml=function(){return i},this.windowDimensions={width:this.getBrowserWidth(),height:this.getBrowserHeight()},this.config={BODY_SCROLL_DISABLE_CLASS:"Body--scrollDisabled",BODY_SCROLL_CLASS:"Body--isScrolling",CAPABLE_TRANSFORM_CLASS:"csstransforms",CAPABLE_TOUCH_CLASS:"touchevents",CAPABLE_VIDEO_CLASS:"video"},this.EVENT={SCROLL:this.registerEvent("scroll"),RESIZE:this.registerEvent("resize"),LOAD:this.registerEvent("load")},this.analyzeUserBrowser(),n.on("scroll",this.broadcastScroll.bind(this)),n.on("resize",this.broadcastResize.bind(this)),n.on("load",this.broadcastLoad.bind(this)),this.scrollingTimeout=null,this.subscribe(this.EVENT.SCROLL,this.setDocumentScrolling.bind(this),"self")},extend(pb.service.Browser,pb.Service),pb.service.Browser.prototype.analyzeUserBrowser=function(){this.capable={TRANSFORM:this.getHtml().hasClass(this.config.CAPABLE_TRANSFORM_CLASS),TOUCH:this.getHtml().hasClass(this.config.CAPABLE_TOUCH_CLASS),VIDEO:this.getHtml().hasClass(this.config.CAPABLE_VIDEO_CLASS)}},pb.service.Browser.prototype.getBrowserWidth=function(){return this.getWindow().outerWidth()},pb.service.Browser.prototype.getBrowserHeight=function(){return this.getWindow().height()},pb.service.Browser.prototype.setDocumentScrolling=function(){clearTimeout(this.scrollingTimeout),this.getBody().hasClass(this.config.BODY_SCROLL_CLASS)||this.getBody().addClass(this.config.BODY_SCROLL_CLASS),this.scrollingTimeout=setTimeout(function(){this.getBody().removeClass(this.config.BODY_SCROLL_CLASS)}.bind(this),500)},pb.service.Browser.prototype.scrollTo=function(n,t,i,r,u){function e(){u&&u(),this.enableScroll()}var f=n,i="undefined"==typeof i?250:i;n instanceof $&&n.length&&(f=n.offset().top),r||this.disableScroll(),this.getView().animate({scrollTop:f+(t||0)},i,e.bind(this))},pb.service.Browser.prototype.broadcastScroll=function(){this.publish(this.EVENT.SCROLL,[this.getDocument().scrollTop()])},pb.service.Browser.prototype.broadcastResize=function(){var i=0,t=0;this.windowDimensions.width>this.getBrowserWidth()?i=-1:this.windowDimensions.width<this.getBrowserWidth()&&(i=1),this.windowDimensions.height>this.getBrowserHeight()?t=-1:this.windowDimensions.height<this.getBrowserHeight()&&(t=1),0===i&&0===t||(this.windowDimensions.width=this.getBrowserWidth(),this.windowDimensions.height=this.getBrowserHeight(),this.publish(this.EVENT.RESIZE,[this.getBrowserWidth(),this.getBrowserHeight(),i,t]))},pb.service.Browser.prototype.broadcastLoad=function(){this.publish(this.EVENT.LOAD,[])},pb.service.Browser.prototype.preventDefault=function(n){n.preventDefault()},pb.service.Browser.prototype.stopPropagation=function(n){n.stopPropagation()},pb.service.Browser.prototype.stopImmediatePropagation=function(n){n.stopImmediatePropagation()},pb.service.Browser.prototype.preventKeyScroll=function(n){for(var t=pb.KeySet.SCROLL_KEYS.length;t--;)if(n.keyCode===pb.KeySet.SCROLL_KEYS[t])return void n.preventDefault()},pb.service.Browser.prototype.disableScroll=function(){this.getWindow().on("DOMMouseScroll.pbbrowser mousewheel.pbbrowser",this.preventDefault.bind(this)).on("keyup.pbbrowser",this.preventKeyScroll.bind(this))},pb.service.Browser.prototype.enableScroll=function(){this.getWindow().off("DOMMouseScroll.pbbrowser").off("mousewheel.pbbrowser").off("keyup.pbbrowser")},pb.service.Browser.prototype.disableDocumentScroll=function(){this.getBody().addClass(this.config.BODY_SCROLL_DISABLE_CLASS)},pb.service.Browser.prototype.enableDocumentScroll=function(){this.getBody().removeClass(this.config.BODY_SCROLL_DISABLE_CLASS)},pb.service.Browser.prototype.getElementViewportPosition=function(n){return n instanceof $&&(n=n[0]),n.getBoundingClientRect()},pb.service.Browser.prototype.getCursorPositionRelativeToElement=function(n,t){return{x:t.pageX-n.offset().left,y:t.pageY-n.offset().top}},pb.service.Browser.prototype.getScrollbarWidth=function(){var n=document.createElement("div"),r,t,i;return n.style.visibility="hidden",n.style.width="100px",n.style.msOverflowStyle="scrollbar",document.body.appendChild(n),r=n.offsetWidth,n.style.overflow="scroll",t=document.createElement("div"),t.style.width="100%",n.appendChild(t),i=t.offsetWidth,n.parentNode.removeChild(n),r-i},function(n){var t=new pb.Translator,i="cs";t.add(i,"branches.h1-title","Seznam prodejních automatů"),t.add(i,"branches.meta-title","Seznam prodejních automatů | Dopravní podnik hl. m. Prahy, akciová společnost"),t.add(i,"test","Testovací zpráva s parametrem '$1'"),t.add(i,"phoneVerify.ok","Na Vámi zadané telefonní číslo byl odeslán ověřovací kód"),t.add(i,"phoneVerify.codeok","Telefonní číslo bylo úspěšně ověřeno"),t.add(i,"phoneVerify.codenotvalid","Chybně zadaný bezpečnostní kód. Vložte prosím kód znovu."),t.add(i,"phoneVerify.error","Nastala chyba!"),t.add(i,"phoneVerify.exist","Telefonní číslo je již použito"),t.add(i,"editStations.ok","Stanice jsou v pořádku uloženy"),t.add(i,"editStations.error","Nastala chyba!"),t.add(i,"app.loading","Načítám, čekejte prosím"),t.add(i,"app.loadingShort","Načítám"),t.add(i,"app.close","Zavřít"),t.add(i,"app.remove","Odebrat"),t.add(i,"app.sending","Odesílám požadavek"),t.add(i,"app.product.loading","Načítám detail produktu, prosím čekejte"),t.add(i,"app.product.error","Nastala chyba na serveru, prosím opakujte později"),t.add(i,"app.product.error.grid","V tomto zobrazení není možné zobrazit Rychlý detail."),t.add(i,"app.product.error.url","Nastala chyba v URL adrese detailu produktu."),t.add(i,"app.server.error","Nastala chyba na serveru, prosím opakujte později <a class='button h43 red close' href='#'>zavřít</a>"),t.add(i,"app.form.validate.error.remote","Tato e-mailová adresa je již použita"),t.add(i,"app.form.validate.error.minLenght","Minimální délka řetezce je $1"),t.add(i,"app.form.validate.error.rangeLength","Platná délka řetezce je $1 až $2"),t.add(i,"app.form.validate.error.passwordEqual","Hesla se musí shodovat"),t.add(i,"popup.products.basket.add.title","Přidání produktu do košíku"),t.add(i,"app.form.validate.error.number","Neplatný formát telefonního čísla"),t.add(i,"app.form.validate.error.phoneCZ","Prosím, zadejte platný telefon"),t.add(i,"app.form.validate.error.zipCZ","Prosím, zadejte platné PSČ"),t.add(i,"app.form.validate.error.time","Prosím, zadejte čas ve formátu HH:MM"),n.translator=t}(window),app=app||{},app.service=app.service||{},app.service.Document=function(){this.document=$(document),this.height=this.document.height(),this.scrollTop=this.document.scrollTop(),this.window=$(window),this.windowSize={},this.windowSize.width=this.window.width(),this.windowSize.height=this.window.height(),this.lastWindowSize={},this.lastWindowSize.width=this.window.width(),this.lastWindowSize.height=this.window.height(),this.document.on("ready",this.handleReadyEvent.bind(this)),this.document.on("scroll",this.handleScrollEvent.bind(this)).trigger("scroll"),this.window.on("resize",this.handleResizeEvent.bind(this)).trigger("resize")},app.service.Document.EventTypes={SCROLL:"-scroll",RESIZE:"-resize",READY:"-ready",UPDATE:"-update"},app.service.Document.prototype.handleReadyEvent=function(){this.height=this.document.height(),$(this).trigger(app.service.Document.EventTypes.READY)},app.service.Document.prototype.handleScrollEvent=function(){this.scrollTop=this.document.scrollTop(),this.height=this.document.height(),$(this).trigger(app.service.Document.EventTypes.SCROLL,this.scrollTop)},app.service.Document.prototype.handleResizeEvent=function(){this.windowSize.width=this.window.width(),this.windowSize.height=this.window.height(),this.height=this.document.height(),this.windowSize.width==this.lastWindowSize.width&&this.windowSize.height==this.lastWindowSize.height||(this.lastWindowSize.width=this.windowSize.width,this.lastWindowSize.height=this.windowSize.height,$(this).trigger(app.service.Document.EventTypes.RESIZE,this.windowSize))},app.service.Document.prototype.handleUpdateEvent=function(){$(this).trigger(app.service.Document.EventTypes.UPDATE)},app=app||{},app.component=app.component||{},app.component.Form=function(n){pb.Component.call(this,n)},extend(app.component.Form,pb.Component),app.component.Form.prototype.prepare=function(){this.initDatepickers()},app.component.Form.prototype.initDatepickers=function(){!function(n){n(jQuery.datepicker)}(function(n){return n.regional.cs={closeText:"Zavřít",prevText:"&#x3C;Dříve",nextText:"Později&#x3E;",currentText:"Nyní",monthNames:["Leden","Únor","Březen","Duben","Květen","Červen","Červenec","Srpen","Září","Říjen","Listopad","Prosinec"],monthNamesShort:["led","úno","bře","dub","kvě","čer","čvc","srp","zář","říj","lis","pro"],dayNames:["neděle","pondělí","úterý","středa","čtvrtek","pátek","sobota"],dayNamesShort:["Ne","Po","Út","St","Čt","Pá","So"],dayNamesMin:["Ne","Po","Út","St","Čt","Pá","So"],weekHeader:"Týd",dateFormat:"dd.mm.yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},n.setDefaults(n.regional.cs),n.regional.cs}),$.datepicker.setDefaults($.extend($.datepicker.regional.cs)),this.element.find(".js-datepicker").datepicker({inline:!0})},app=app||{},app.component=app.component||{},app.component.Dropdown=function(n){pb.Component.call(this,n),this.DropdownElement=null},extend(app.component.Dropdown,pb.Component),app.component.Dropdown.prototype.prepare=function(){this.element.on("click",".js-dropdown-switch",this._handleClick.bind(this)),$("body").on("click",this._checkOutsideClick.bind(this)),this.customLabel=this.element.find(".js-checked-checkboxes"),this.customDefault=this.customLabel.text(),this.customCheckbox=this.element.find(".js-checkbox"),this.customCheckbox.on("change",this.selectedCheckbox.bind(this))},app.component.Dropdown.prototype.selectedCheckbox=function(){var t="";this.customCheckbox.each(function(){$(this).find("input").prop("checked")&&(t+=""==t?$(this).text().trim():", "+$(this).text().trim())}),""==t&&(t=this.customDefault),this.customLabel.text(t)},app.component.Dropdown.prototype._handleClick=function(n){n.preventDefault(),this.element.hasClass("is-active")?(this.hideDropdown(),this.element.removeClass("is-active")):(this.hideDropdown(),this.element.addClass("is-active")),this.hideTimePicker()},app.component.Dropdown.prototype._checkOutsideClick=function(){var t=$(event.target);t.parents(".js-dropdown-component").length||t.hasClass("ui-icon")||t.hasClass("ui-datepicker-next")||this.hideDropdown()},app.component.Dropdown.prototype.hideDropdown=function(){$(".js-dropdown-component.is-active").removeClass("is-active")},app.component.Dropdown.prototype.hideTimePicker=function(){$(".js-timepicker-component.is-focus").removeClass("is-focus")},app.component.Dropdown.prototype.init=function(){},app=app||{},app.component=app.component||{},app.component.InputDatepicker=function(n){pb.Component.call(this,n)},extend(app.component.InputDatepicker,pb.Component),app.component.InputDatepicker.prototype.prepare=function(){this.input=this.element.find(".js-set-datepicker"),this.label=this.element.find(".js-label-datepicker"),this.element.on("click",".js-setdate-2daysago",this._handleClick2daysAgo.bind(this)),this.element.on("click",".js-setdate-1dayago",this._handleClick1dayAgo.bind(this)),this.element.on("click",".js-setdate-today",this._handleClickToday.bind(this)),this.element.on("click",".js-setdate-tomorow",this._handleClickTomorow.bind(this)),this.element.on("click",".js-setdate-nextweek",this._handleClickNextWeek.bind(this)),this.initDatepicker()},app.component.InputDatepicker.prototype.initDatepicker=function(){var f=this,n=this.element.find(".js-input-datepicker"),o=n.data("min-date"),e=n.data("max-date"),u=n.data("change-month")||!1,t=n.data("change-year")||!1,i=n.data("year-range"),r;"now"==o&&"now"==e||"now"==o||("now"!=e||i?"now"==e&&i?n.datepicker({maxDate:new Date,inline:!0,changeMonth:u,changeYear:t,yearRange:i,onSelect:function(n){var i=n;$(this).datepicker("getDate"),f.setInput(i)}}):n.datepicker({inline:!0,changeMonth:u,changeYear:t,onSelect:function(n){var i=n;$(this).datepicker("getDate"),f.setInput(i)}}):n.datepicker({maxDate:new Date,inline:!0,changeMonth:u,changeYear:t,onSelect:function(n){var i=n;$(this).datepicker("getDate"),f.setInput(i)}})),r=this.element.find(".js-set-datepicker").val(),r&&n.datepicker("setDate",r)},app.component.InputDatepicker.prototype.getDate=function(n){var r,i=new Date,t=i;"2daysago"==n?t=new Date(i.getTime()-1728e5):"yesterday"==n?t=new Date(i.getTime()-864e5):"tomorow"==n?t=new Date(i.getTime()+864e5):"nextweek"==n&&(r=8-i.getDay(),t=new Date(i.getTime()+864e5*r)),String.prototype.padStart||(String.prototype.padStart=function(n,t){return n>>=0,t=String("undefined"!=typeof t?t:" "),this.length>n?String(this):(n-=this.length,n>t.length&&(t+=t.repeat(n/t.length)),t.slice(0,n)+String(this))});var e=String(t.getDate()).padStart(2,"0"),f=String(t.getMonth()+1).padStart(2,"0"),u=t.getFullYear();return e+"."+f+"."+u},app.component.InputDatepicker.prototype._handleClick2daysAgo=function(n){n.preventDefault(),this.setInput(this.getDate("2daysago")),this.element.find(".js-input-datepicker").datepicker("setDate",-2)},app.component.InputDatepicker.prototype._handleClick1dayAgo=function(n){n.preventDefault(),this.setInput(this.getDate("yesterday")),this.element.find(".js-input-datepicker").datepicker("setDate",-1)},app.component.InputDatepicker.prototype._handleClickToday=function(n){n.preventDefault(),this.setInput(this.getDate("today")),this.element.find(".js-input-datepicker").datepicker("setDate",0)},app.component.InputDatepicker.prototype._handleClickTomorow=function(n){n.preventDefault(),this.setInput(this.getDate("tomorow")),this.element.find(".js-input-datepicker").datepicker("setDate",1)},app.component.InputDatepicker.prototype._handleClickNextWeek=function(n){n.preventDefault(),this.setInput(this.getDate("nextweek"));var t=this.getDate("nextweek");this.element.find(".js-input-datepicker").datepicker("setDate",t)},app.component.InputDatepicker.prototype.setInput=function(n){this.input.val(n),this.label.text(n)},app=app||{},app.component=app.component||{},app.component.InputTimepicker=function(n,t){pb.Component.call(this,n),this.dependencies={component:t.get("component")}},extend(app.component.InputTimepicker,pb.Component),app.component.InputTimepicker.prototype.prepare=function(){this.input=this.element.find(".js-set-datepicker"),this.label=this.element.find(".js-label-datepicker"),this.initTimepicker()},app.component.InputTimepicker.prototype.initTimepicker=function(){this.element.on("click",".js-timepicker-prev",this.timePrev.bind(this)),this.element.on("click",".js-timepicker-next",this.timeNext.bind(this)),this.element.on("click",".js-timepicker-hour-prev",this.hourChangeMinus.bind(this)),this.element.on("click",".js-timepicker-hour-next",this.hourChangePlus.bind(this)),this.element.on("click",".js-timepicker-min-prev",this.minChangeMinus.bind(this)),this.element.on("click",".js-timepicker-min-next",this.minChangePlus.bind(this)),this.element.on("click",".js-settime-custom",this.timeCustom.bind(this)),this.element.on("click",".js-settime-now",this.setTimeNow.bind(this)),this.element.on("click",".ui-timepicker-hour",this.focusTime.bind(this)),this.element.on("click",".ui-timepicker-min",this.focusTime.bind(this)),this.debouncedSetInputTime=debounce(500,function(){this.setInputTime()}.bind(this)),this.element.on("keyup",".ui-timepicker-hour",this.debouncedSetInputTime.bind(this)),this.element.on("keyup",".ui-timepicker-min",this.debouncedSetInputTime.bind(this)),this.element.on("change",".ui-timepicker-hour",this.setInputTime.bind(this)),this.element.on("change",".ui-timepicker-min",this.setInputTime.bind(this)),this.setTimeNow()},app.component.InputTimepicker.prototype.timePrev=function(n){n.stopPropagation();var i=this.getHour(),t=this.getMin();"00"==t||t>45?(t=45,i=1*i-1):t>30?t=30:t>15?t=15:t>0&&(t="00"),i==-1&&(i=23),this.setHour(i),this.setMin(t),this.setTime(i,t)},app.component.InputTimepicker.prototype.timeNext=function(n){n.stopPropagation();var i=this.getHour(),t=this.getMin();t<15?t=15:t<30?t=30:t<45?t=45:t<60&&(t="00",i=1*i+1),24==i&&(i=0),this.setHour(i),this.setMin(t),this.setTime(i,t)},app.component.InputTimepicker.prototype.hourChangeMinus=function(n){n.stopPropagation();var t=this.getHour(),i=this.getMin();t=parseInt(t)-1,t<0&&(t=0),this.setHour(t),this.setMin(i),this.setTime(t,i)},app.component.InputTimepicker.prototype.hourChangePlus=function(n){n.stopPropagation();var t=this.getHour(),i=this.getMin();t=parseInt(t)+1,t>23&&(t=23),this.setHour(t),this.setMin(i),this.setTime(t,i)},app.component.InputTimepicker.prototype.minChangeMinus=function(n){function r(n){return n%5?n-n%5+5:n}n.stopPropagation();var i=this.getHour(),t=this.getMin();t=parseInt(t)-5,t<0&&(t=0),t=r(t),t=t<10?"0"+t:t,this.setHour(i),this.setMin(t),this.setTime(i,t)},app.component.InputTimepicker.prototype.minChangePlus=function(n){function r(n){return n%5?n-n%5:n}n.stopPropagation();var i=this.getHour(),t=this.getMin();t=parseInt(t)+5,t>59&&(t=59),t=r(t),t=t<10?"0"+t:t,this.setHour(i),this.setMin(t),this.setTime(i,t)},app.component.InputTimepicker.prototype.focusTime=function(n){n.stopPropagation();var t=$(n.currentTarget);t.select()},app.component.InputTimepicker.prototype.validTime=function(n,t,i){return mun=parseInt(n),n=n>i?i:n<t?t:n>=t&&n<=i?n:t},app.component.InputTimepicker.prototype.setInputTime=function(){var t=this.getHour(),n=this.getMin();t=parseFloat(this.validTime(t,0,23)),n=parseFloat(this.validTime(n,0,59)),n=n<10?"0"+n:n,this.setHour(t),this.setMin(n),this.setTime(t,n)},app.component.InputTimepicker.prototype.setTimeNow=function(n){var f=this.element.data("set-time-now"),r,i;if("undefined"!=typeof n||f===!0){var i=new Date,u=i.getHours(),t=i.getMinutes();t=t<10?"0"+t:t,this.setHour(u),this.setMin(t),this.setTime(u,t)}else r=this.element.find(".js-set-timepicker").val()?this.element.find(".js-set-timepicker").val():"00:00",i=r.split(":"),this.setHour(i[0]),this.setMin(i[1]);return!1},app.component.InputTimepicker.prototype.timeCustom=function(n){n.stopPropagation();var r=$(n.currentTarget),t=r.data("hour"),i=r.data("min");return t&&i&&(this.setHour(t),this.setMin(i),this.setTime(t,i)),!1},app.component.InputTimepicker.prototype.getHour=function(){return this.element.find(".ui-timepicker-hour").val()},app.component.InputTimepicker.prototype.getMin=function(){return this.element.find(".ui-timepicker-min").val()},app.component.InputTimepicker.prototype.setTime=function(n,t){this.element.find(".js-set-timepicker").val(n+":"+t),this.element.find(".js-label-timepicker").html(n+":"+t)},app.component.InputTimepicker.prototype.setHour=function(n){this.element.find(".ui-timepicker-hour").val(n)},app.component.InputTimepicker.prototype.setMin=function(n){this.element.find(".ui-timepicker-min").val(n)},app=app||{},!function(n,t,i,r){var e,u,f;t.debug=!!r("html").attr("debug"),t.debugTrace=!1,e=new t.Dependencies,e.register("component",t.service.Component),e.register("browser",t.service.Browser),e.register("document",i.service.Document),u=new t.Dependencies,u.register("overlay",t.component.Overlay),u.register("popup",t.component.Popup),u.register("component",t.Component),u.register("form",i.component.Form),u.register("dropdown",i.component.Dropdown),u.register("inputDatepicker",i.component.InputDatepicker),u.register("inputTimepicker",i.component.InputTimepicker),f=new t.Application(u,e,i.Request,t.Template),f.setTranslator(n.translator),f.onStartup=function(){},f.initPlugins=function(){},r(function(){f.run()}),n.application=f}(window,pb,app,jQuery);var sNoData1="Data se nepodařilo převzít.\r\n",sNoData2="\r\n(kód služby: HTTP",sTimeOut="Data se nepodařilo převzít. Vypršel časový limit.",sLineLabel="linky",sLineLabel1="linka",sNoCoor="Souřadnice nejsou k dispozici.",sSelectPoint="Vybrat tento bod",sSelectText="Vybrat",sNoOpener="Cílové okno pro nastavení souřadnice již není k dispozici.\nBylo již pravděpodobně zavřeno.",sNodeTitle="uzel",sNoTrType="Musí být vybrán alespoň jeden dopravní prostředek."