/**
 * Framework7 1.4.2 - Custom Build
 * Full Featured Mobile HTML Framework For Building iOS & Android Apps
 *
 *
 * Included modules: searchbar,modals,cards,tabs,smart-select,pull-to-refresh,infinite-scroll,scroll-toolbars,fast-clicks,forms,picker,calendar,modals,modals
 *
 * http://www.idangero.us/framework7
 *
 * Copyright 2016, Vladimir Kharlampidi
 * The iDangero.us
 * http://www.idangero.us/
 *
 * Licensed under MIT
 *
 * Released on: September 24, 2016
 */
!function(){"use strict";window.Framework7=function(a){function t(e){var a=e.replace(/^./,function(e){return e.toUpperCase()});i["onPage"+a]=function(a,t){return i.onPage(e,a,t)}}function n(){i.device.ipad&&(document.body.scrollLeft=0,setTimeout(function(){document.body.scrollLeft=0},0))}function r(){var e,a=s(this),t=a[0].scrollTop,n=a[0].scrollHeight,r=a[0].offsetHeight,i=a[0].getAttribute("data-distance"),o=a.find(".virtual-list"),l=a.hasClass("infinite-scroll-top");if(i||(i=50),"string"==typeof i&&i.indexOf("%")>=0&&(i=parseInt(i,10)/100*r),i>r&&(i=r),l)t<i&&a.trigger("infinite");else if(t+r>=n-i){if(o.length>0&&(e=o[0].f7VirtualList,e&&!e.reachEnd))return;a.trigger("infinite")}}var i=this;i.version="1.4.2",i.params={cache:!0,cacheIgnore:[],cacheIgnoreGetParameters:!1,cacheDuration:6e5,preloadPreviousPage:!0,uniqueHistory:!1,uniqueHistoryIgnoreGetParameters:!1,dynamicPageUrl:"content-{{index}}",allowDuplicateUrls:!1,router:!0,pushState:!1,pushStateRoot:void 0,pushStateNoAnimation:!1,pushStateSeparator:"#!/",pushStateOnLoad:!0,fastClicks:!0,fastClicksDistanceThreshold:10,fastClicksDelayBetweenClicks:50,fastClicksExclude:"",tapHold:!1,tapHoldDelay:750,tapHoldPreventClicks:!0,activeState:!0,activeStateElements:"a, button, label, span",animateNavBackIcon:!1,swipeBackPage:!0,swipeBackPageThreshold:0,swipeBackPageActiveArea:30,swipeBackPageAnimateShadow:!0,swipeBackPageAnimateOpacity:!0,ajaxLinks:void 0,externalLinks:".external",sortable:!0,hideNavbarOnPageScroll:!1,hideToolbarOnPageScroll:!1,hideTabbarOnPageScroll:!1,showBarsOnPageScrollEnd:!0,showBarsOnPageScrollTop:!0,swipeout:!0,swipeoutActionsNoFold:!1,swipeoutNoFollow:!1,smartSelectOpenIn:"page",smartSelectBackText:"Back",smartSelectPopupCloseText:"Close",smartSelectPickerCloseText:"Done",smartSelectSearchbar:!1,smartSelectBackOnSelect:!1,scrollTopOnNavbarClick:!1,scrollTopOnStatusbarClick:!1,swipePanel:!1,swipePanelActiveArea:0,swipePanelCloseOpposite:!0,swipePanelOnlyClose:!1,swipePanelNoFollow:!1,swipePanelThreshold:0,panelsCloseByOutside:!0,modalButtonOk:"OK",modalButtonCancel:"Cancel",modalUsernamePlaceholder:"Username",modalPasswordPlaceholder:"Password",modalTitle:"Framework7",modalCloseByOutside:!1,actionsCloseByOutside:!0,popupCloseByOutside:!0,modalPreloaderTitle:"Loading... ",modalStack:!0,imagesLazyLoadThreshold:0,imagesLazyLoadSequential:!0,viewClass:"view",viewMainClass:"view-main",viewsClass:"views",notificationCloseOnClick:!1,notificationCloseIcon:!0,notificationCloseButtonText:"Close",animatePages:!0,templates:{},template7Data:{},template7Pages:!1,precompileTemplates:!1,material:!1,materialPageLoadDelay:0,materialPreloaderSvg:'<svg xmlns="http://www.w3.org/2000/svg" height="75" width="75" viewbox="0 0 75 75"><circle cx="37.5" cy="37.5" r="33.5" stroke-width="8"/></svg>',materialPreloaderHtml:'<span class="preloader-inner"><span class="preloader-inner-gap"></span><span class="preloader-inner-left"><span class="preloader-inner-half-circle"></span></span><span class="preloader-inner-right"><span class="preloader-inner-half-circle"></span></span></span>',materialRipple:!0,materialRippleElements:".ripple, a.link, a.item-link, .button, .modal-button, .tab-link, .label-radio, .label-checkbox, .actions-modal-button, a.searchbar-clear, a.floating-button, .floating-button > a, .speed-dial-buttons a",init:!0};for(var o in a)i.params[o]=a[o];var s=e,l=Template7;i._compiledTemplates={},i.touchEvents={start:i.support.touch?"touchstart":"mousedown",move:i.support.touch?"touchmove":"mousemove",end:i.support.touch?"touchend":"mouseup"},i.ls=window.localStorage,i.rtl="rtl"===s("body").css("direction"),i.rtl&&s("html").attr("dir","rtl"),"undefined"!=typeof i.params.statusbarOverlay&&(i.params.statusbarOverlay?s("html").addClass("with-statusbar-overlay"):s("html").removeClass("with-statusbar-overlay")),i.views=[];var c=function(e,a){var t,n={dynamicNavbar:!1,domCache:!1,linksView:void 0,reloadPages:!1,uniqueHistory:i.params.uniqueHistory,uniqueHistoryIgnoreGetParameters:i.params.uniqueHistoryIgnoreGetParameters,allowDuplicateUrls:i.params.allowDuplicateUrls,swipeBackPage:i.params.swipeBackPage,swipeBackPageAnimateShadow:i.params.swipeBackPageAnimateShadow,swipeBackPageAnimateOpacity:i.params.swipeBackPageAnimateOpacity,swipeBackPageActiveArea:i.params.swipeBackPageActiveArea,swipeBackPageThreshold:i.params.swipeBackPageThreshold,animatePages:i.params.animatePages,preloadPreviousPage:i.params.preloadPreviousPage};a=a||{},a.dynamicNavbar&&i.params.material&&(a.dynamicNavbar=!1);for(var r in n)"undefined"==typeof a[r]&&(a[r]=n[r]);var o=this;o.params=a,o.selector=e;var l=s(e);if(o.container=l[0],"string"!=typeof e&&(e=(l.attr("id")?"#"+l.attr("id"):"")+(l.attr("class")?"."+l.attr("class").replace(/ /g,".").replace(".active",""):""),o.selector=e),o.main=l.hasClass(i.params.viewMainClass),o.contentCache={},o.pagesCache={},l[0].f7View=o,o.pagesContainer=l.find(".pages")[0],o.initialPages=[],o.initialPagesUrl=[],o.initialNavbars=[],o.params.domCache){var c=l.find(".page");for(t=0;t<c.length;t++)o.initialPages.push(c[t]),o.initialPagesUrl.push("#"+c.eq(t).attr("data-page"));if(o.params.dynamicNavbar){var p=l.find(".navbar-inner");for(t=0;t<p.length;t++)o.initialNavbars.push(p[t])}}o.allowPageChange=!0;var d=document.location.href;o.history=[];var f=d,u=i.params.pushStateSeparator,h=i.params.pushStateRoot;i.params.pushState&&o.main&&(h?f=h:f.indexOf(u)>=0&&f.indexOf(u+"#")<0&&(f=f.split(u)[0]));var m,g;o.activePage||(m=s(o.pagesContainer).find(".page-on-center"),0===m.length&&(m=s(o.pagesContainer).find(".page:not(.cached)"),m=m.eq(m.length-1)),m.length>0&&(g=m[0].f7PageData)),o.params.domCache&&m?(o.url=l.attr("data-url")||o.params.url||"#"+m.attr("data-page"),o.pagesCache[o.url]=m.attr("data-page")):o.url=l.attr("data-url")||o.params.url||f,g&&(g.view=o,g.url=o.url,o.params.domCache&&o.params.dynamicNavbar&&!g.navbarInnerContainer&&(g.navbarInnerContainer=o.initialNavbars[o.initialPages.indexOf(g.container)]),o.activePage=g,m[0].f7PageData=g),o.url&&o.history.push(o.url);var v,b,C,y,w,k,x,T,P,S,O,D=!1,M=!1,N={},E=[],L=[],B=!0,A=[],I=[];if(o.handleTouchStart=function(e){B&&o.params.swipeBackPage&&!D&&!i.swipeoutOpenedEl&&o.allowPageChange&&(M=!1,D=!0,v=void 0,N.x="touchstart"===e.type?e.targetTouches[0].pageX:e.pageX,N.y="touchstart"===e.type?e.targetTouches[0].pageY:e.pageY,y=(new Date).getTime(),P=o.params.dynamicNavbar&&l.find(".navbar-inner").length>1)},o.handleTouchMove=function(e){if(D){var a="touchmove"===e.type?e.targetTouches[0].pageX:e.pageX,t="touchmove"===e.type?e.targetTouches[0].pageY:e.pageY;if("undefined"==typeof v&&(v=!!(v||Math.abs(t-N.y)>Math.abs(a-N.x))),v||e.f7PreventSwipeBack||i.preventSwipeBack)return void(D=!1);if(!M){var n=!1;b=l.width();var r=s(e.target),c=r.hasClass("swipeout")?r:r.parents(".swipeout");c.length>0&&(!i.rtl&&c.find(".swipeout-actions-left").length>0&&(n=!0),i.rtl&&c.find(".swipeout-actions-right").length>0&&(n=!0)),E=r.is(".page")?r:r.parents(".page"),E.hasClass("no-swipeback")&&(n=!0),L=l.find(".page-on-left:not(.cached)");var p=N.x-l.offset().left>o.params.swipeBackPageActiveArea;if(p=i.rtl?N.x<l.offset().left-l[0].scrollLeft+b-o.params.swipeBackPageActiveArea:N.x-l.offset().left>o.params.swipeBackPageActiveArea,p&&(n=!0),0!==L.length&&0!==E.length||(n=!0),n)return void(D=!1);o.params.swipeBackPageAnimateShadow&&!i.device.android&&(S=E.find(".swipeback-page-shadow"),0===S.length&&(S=s('<div class="swipeback-page-shadow"></div>'),E.append(S))),P&&(A=l.find(".navbar-on-center:not(.cached)"),I=l.find(".navbar-on-left:not(.cached)"),w=A.find(".left, .center, .right, .subnavbar, .fading"),k=I.find(".left, .center, .right, .subnavbar, .fading"),i.params.animateNavBackIcon&&(x=A.find(".left.sliding .back .icon"),T=I.find(".left.sliding .back .icon"))),s(".picker-modal.modal-in").length>0&&i.closeModal(s(".picker-modal.modal-in"))}e.f7PreventPanelSwipe=!0,M=!0,e.preventDefault();var d=i.rtl?-1:1;C=(a-N.x-o.params.swipeBackPageThreshold)*d,C<0&&(C=0);var f=C/b,u={percentage:f,activePage:E[0],previousPage:L[0],activeNavbar:A[0],previousNavbar:I[0]};o.params.onSwipeBackMove&&o.params.onSwipeBackMove(u),l.trigger("swipeBackMove",u);var h=C*d,m=(C/5-b/5)*d;if(1===i.device.pixelRatio&&(h=Math.round(h),m=Math.round(m)),E.transform("translate3d("+h+"px,0,0)"),o.params.swipeBackPageAnimateShadow&&!i.device.android&&(S[0].style.opacity=1-1*f),L.transform("translate3d("+m+"px,0,0)"),o.params.swipeBackPageAnimateOpacity&&(L[0].style.opacity=.9+.1*f),P){var g;for(g=0;g<w.length;g++)if(O=s(w[g]),O.is(".subnavbar.sliding")||(O[0].style.opacity=1-1.3*f),O[0].className.indexOf("sliding")>=0){var y=f*O[0].f7NavbarRightOffset;1===i.device.pixelRatio&&(y=Math.round(y)),O.transform("translate3d("+y+"px,0,0)"),i.params.animateNavBackIcon&&O[0].className.indexOf("left")>=0&&x.length>0&&x.transform("translate3d("+-y+"px,0,0)")}for(g=0;g<k.length;g++)if(O=s(k[g]),O.is(".subnavbar.sliding")||(O[0].style.opacity=1.3*f-.3),O[0].className.indexOf("sliding")>=0){var B=O[0].f7NavbarLeftOffset*(1-f);1===i.device.pixelRatio&&(B=Math.round(B)),O.transform("translate3d("+B+"px,0,0)"),i.params.animateNavBackIcon&&O[0].className.indexOf("left")>=0&&T.length>0&&T.transform("translate3d("+-B+"px,0,0)")}}}},o.handleTouchEnd=function(e){if(!D||!M)return D=!1,void(M=!1);if(D=!1,M=!1,0===C)return s([E[0],L[0]]).transform("").css({opacity:"",boxShadow:""}),void(P&&(w.transform("").css({opacity:""}),k.transform("").css({opacity:""}),x&&x.length>0&&x.transform(""),T&&x.length>0&&T.transform("")));var a=(new Date).getTime()-y,t=!1;(a<300&&C>10||a>=300&&C>b/2)&&(E.removeClass("page-on-center").addClass("page-on-right"),L.removeClass("page-on-left").addClass("page-on-center"),P&&(A.removeClass("navbar-on-center").addClass("navbar-on-right"),I.removeClass("navbar-on-left").addClass("navbar-on-center")),t=!0),s([E[0],L[0]]).transform("").css({opacity:"",boxShadow:""}).addClass("page-transitioning"),P&&(w.css({opacity:""}).each(function(){var e=t?this.f7NavbarRightOffset:0,a=s(this);a.transform("translate3d("+e+"px,0,0)"),i.params.animateNavBackIcon&&a.hasClass("left")&&x.length>0&&x.addClass("page-transitioning").transform("translate3d("+-e+"px,0,0)")}).addClass("page-transitioning"),k.transform("").css({opacity:""}).each(function(){var e=t?0:this.f7NavbarLeftOffset,a=s(this);a.transform("translate3d("+e+"px,0,0)"),i.params.animateNavBackIcon&&a.hasClass("left")&&T.length>0&&T.addClass("page-transitioning").transform("translate3d("+-e+"px,0,0)")}).addClass("page-transitioning")),B=!1,o.allowPageChange=!1;var n={activePage:E[0],previousPage:L[0],activeNavbar:A[0],previousNavbar:I[0]};if(t){var r=o.history[o.history.length-2];o.url=r,i.pageBackCallback("before",o,{pageContainer:E[0],url:r,position:"center",newPage:L,oldPage:E,swipeBack:!0}),i.pageAnimCallback("before",o,{pageContainer:L[0],url:r,position:"left",newPage:L,oldPage:E,swipeBack:!0}),o.params.onSwipeBackBeforeChange&&o.params.onSwipeBackBeforeChange(n),l.trigger("swipeBackBeforeChange",n)}else o.params.onSwipeBackBeforeReset&&o.params.onSwipeBackBeforeReset(n),l.trigger("swipeBackBeforeReset",n);E.transitionEnd(function(){s([E[0],L[0]]).removeClass("page-transitioning"),P&&(w.removeClass("page-transitioning").css({opacity:""}),k.removeClass("page-transitioning").css({opacity:""}),x&&x.length>0&&x.removeClass("page-transitioning"),T&&T.length>0&&T.removeClass("page-transitioning")),B=!0,o.allowPageChange=!0,t?(i.params.pushState&&o.main&&history.back(),i.pageBackCallback("after",o,{pageContainer:E[0],url:r,position:"center",newPage:L,oldPage:E,swipeBack:!0}),i.pageAnimCallback("after",o,{pageContainer:L[0],url:r,position:"left",newPage:L,oldPage:E,swipeBack:!0}),i.router.afterBack(o,E,L),o.params.onSwipeBackAfterChange&&o.params.onSwipeBackAfterChange(n),l.trigger("swipeBackAfterChange",n)):(o.params.onSwipeBackAfterReset&&o.params.onSwipeBackAfterReset(n),l.trigger("swipeBackAfterReset",n)),S&&S.length>0&&S.remove()})},o.attachEvents=function(e){var a=e?"off":"on";l[a](i.touchEvents.start,o.handleTouchStart),l[a](i.touchEvents.move,o.handleTouchMove),l[a](i.touchEvents.end,o.handleTouchEnd)},o.detachEvents=function(){o.attachEvents(!0)},o.params.swipeBackPage&&!i.params.material&&o.attachEvents(),i.views.push(o),o.main&&(i.mainView=o),o.router={load:function(e){return i.router.load(o,e)},back:function(e){return i.router.back(o,e)},loadPage:function(e){if(e=e||{},"string"==typeof e){var a=e;e={},a&&0===a.indexOf("#")&&o.params.domCache?e.pageName=a.split("#")[1]:e.url=a}return i.router.load(o,e)},loadContent:function(e){return i.router.load(o,{content:e})},reloadPage:function(e){return i.router.load(o,{url:e,reload:!0})},reloadContent:function(e){return i.router.load(o,{content:e,reload:!0})},reloadPreviousPage:function(e){return i.router.load(o,{url:e,reloadPrevious:!0,reload:!0})},reloadPreviousContent:function(e){return i.router.load(o,{content:e,reloadPrevious:!0,reload:!0})},refreshPage:function(){var e={url:o.url,reload:!0,ignoreCache:!0};return e.url&&0===e.url.indexOf("#")&&(o.params.domCache&&o.pagesCache[e.url]?(e.pageName=o.pagesCache[e.url],e.url=void 0,delete e.url):o.contentCache[e.url]&&(e.content=o.contentCache[e.url],e.url=void 0,delete e.url)),i.router.load(o,e)},refreshPreviousPage:function(){var e={url:o.history[o.history.length-2],reload:!0,reloadPrevious:!0,ignoreCache:!0};return e.url&&0===e.url.indexOf("#")&&o.params.domCache&&o.pagesCache[e.url]&&(e.pageName=o.pagesCache[e.url],e.url=void 0,delete e.url),i.router.load(o,e)}},o.loadPage=o.router.loadPage,o.loadContent=o.router.loadContent,o.reloadPage=o.router.reloadPage,o.reloadContent=o.router.reloadContent,o.reloadPreviousPage=o.router.reloadPreviousPage,o.reloadPreviousContent=o.router.reloadPreviousContent,o.refreshPage=o.router.refreshPage,o.refreshPreviousPage=o.router.refreshPreviousPage,o.back=o.router.back,o.hideNavbar=function(){return i.hideNavbar(l.find(".navbar"))},o.showNavbar=function(){return i.showNavbar(l.find(".navbar"))},o.hideToolbar=function(){return i.hideToolbar(l.find(".toolbar"))},o.showToolbar=function(){return i.showToolbar(l.find(".toolbar"))},i.params.pushState&&i.params.pushStateOnLoad&&o.main){var H,R=d.split(u)[1];h?H=d.split(i.params.pushStateRoot+u)[1]:u&&d.indexOf(u)>=0&&d.indexOf(u+"#")<0&&(H=R);var z=!i.params.pushStateNoAnimation&&void 0,V=history.state;H?H.indexOf("#")>=0&&o.params.domCache&&V&&V.pageName&&"viewIndex"in V?i.router.load(o,{pageName:V.pageName,url:V.url,animatePages:z,pushState:!1}):H.indexOf("#")>=0&&o.params.domCache&&o.initialPagesUrl.indexOf(H)>=0?i.router.load(o,{pageName:H.replace("#",""),animatePages:z,pushState:!1}):i.router.load(o,{url:H,animatePages:z,pushState:!1}):o.params.domCache&&d.indexOf(u+"#")>=0&&(V&&V.pageName&&"viewIndex"in V?i.router.load(o,{pageName:V.pageName,url:V.url,animatePages:z,pushState:!1}):u&&0===R.indexOf("#")&&o.initialPagesUrl.indexOf(R)&&i.router.load(o,{pageName:R.replace("#",""),animatePages:z,pushState:!1}))}return o.destroy=function(){o.detachEvents(),o=void 0},i.pluginHook("addView",o),o};i.addView=function(e,a){return new c(e,a)},i.getCurrentView=function(e){var a=s(".popover.modal-in .view"),t=s(".popup.modal-in .view"),n=s(".panel.active .view"),r=s(".views"),i=r.children(".view");if(i.length>1&&i.hasClass("tab")&&(i=r.children(".view.active")),a.length>0&&a[0].f7View)return a[0].f7View;if(t.length>0&&t[0].f7View)return t[0].f7View;if(n.length>0&&n[0].f7View)return n[0].f7View;if(i.length>0){if(1===i.length&&i[0].f7View)return i[0].f7View;if(i.length>1){for(var o=[],l=0;l<i.length;l++)i[l].f7View&&o.push(i[l].f7View);if(o.length>0&&"undefined"!=typeof e)return o[e];if(o.length>1)return o;if(1===o.length)return o[0];return}}},i.navbarInitCallback=function(e,a,t,n){if(!t&&n&&(t=s(n).parent(".navbar")[0]),!n.f7NavbarInitialized||!e||e.params.domCache){var r={container:t,innerContainer:n},o=a&&a.f7PageData,l={page:o,navbar:r};if(n.f7NavbarInitialized&&(e&&e.params.domCache||!e&&s(t).parents(".popup, .popover, .login-screen, .modal, .actions-modal, .picker-modal").length>0))return i.reinitNavbar(t,n),i.pluginHook("navbarReinit",l),void s(n).trigger("navbarReinit",l);n.f7NavbarInitialized=!0,i.pluginHook("navbarBeforeInit",r,o),s(n).trigger("navbarBeforeInit",l),i.initNavbar(t,n),i.pluginHook("navbarInit",r,o),s(n).trigger("navbarInit",l)}},i.navbarRemoveCallback=function(e,a,t,n){!t&&n&&(t=s(n).parent(".navbar")[0]);var r={container:t,innerContainer:n},o=a.f7PageData,l={page:o,navbar:r};i.pluginHook("navbarBeforeRemove",r,o),s(n).trigger("navbarBeforeRemove",l)},i.initNavbar=function(e,a){i.initSearchbar&&i.initSearchbar(a)},i.reinitNavbar=function(e,a){},i.initNavbarWithCallback=function(e){e=s(e);var a,t=e.parents("."+i.params.viewClass);0!==t.length&&(0===e.parents(".navbar-through").length&&0===t.find(".navbar-through").length||(a=t[0].f7View||void 0,e.find(".navbar-inner").each(function(){var n,r=this;if(s(r).attr("data-page")&&(n=t.find('.page[data-page="'+s(r).attr("data-page")+'"]')[0]),!n){var o=t.find(".page");1===o.length?n=o[0]:t.find(".page").each(function(){this.f7PageData&&this.f7PageData.navbarInnerContainer===r&&(n=this)})}i.navbarInitCallback(a,n,e[0],r)})))},i.sizeNavbars=function(e){if(!i.params.material){var a=e?s(e).find(".navbar .navbar-inner:not(.cached)"):s(".navbar .navbar-inner:not(.cached)");a.each(function(){var e=s(this);if(!e.hasClass("cached")){var a,t,n=i.rtl?e.find(".right"):e.find(".left"),r=i.rtl?e.find(".left"):e.find(".right"),o=e.find(".center"),l=e.find(".subnavbar"),c=0===n.length,p=0===r.length,d=c?0:n.outerWidth(!0),f=p?0:r.outerWidth(!0),u=o.outerWidth(!0),h=e.styles(),m=e[0].offsetWidth-parseInt(h.paddingLeft,10)-parseInt(h.paddingRight,10),g=e.hasClass("navbar-on-left");p&&(a=m-u),c&&(a=0),c||p||(a=(m-f-u+d)/2);var v=(m-u)/2;m-d-f>u?(v<d&&(v=d),v+u>m-f&&(v=m-f-u),t=v-a):t=0;var b=i.rtl?-1:1;if(o.hasClass("sliding")&&(o[0].f7NavbarLeftOffset=-(a+t)*b,o[0].f7NavbarRightOffset=(m-a-t-u)*b,g)){if(i.params.animateNavBackIcon){var C=e.parent().find(".navbar-on-center").find(".left.sliding .back .icon ~ span");C.length>0&&(o[0].f7NavbarLeftOffset+=C[0].offsetLeft)}o.transform("translate3d("+o[0].f7NavbarLeftOffset+"px, 0, 0)")}!c&&n.hasClass("sliding")&&(i.rtl?(n[0].f7NavbarLeftOffset=-(m-n[0].offsetWidth)/2*b,n[0].f7NavbarRightOffset=d*b):(n[0].f7NavbarLeftOffset=-d,n[0].f7NavbarRightOffset=(m-n[0].offsetWidth)/2,i.params.animateNavBackIcon&&n.find(".back .icon").length>0&&(n[0].f7NavbarRightOffset-=n.find(".back .icon")[0].offsetWidth)),g&&n.transform("translate3d("+n[0].f7NavbarLeftOffset+"px, 0, 0)")),!p&&r.hasClass("sliding")&&(i.rtl?(r[0].f7NavbarLeftOffset=-f*b,r[0].f7NavbarRightOffset=(m-r[0].offsetWidth)/2*b):(r[0].f7NavbarLeftOffset=-(m-r[0].offsetWidth)/2,r[0].f7NavbarRightOffset=f),g&&r.transform("translate3d("+r[0].f7NavbarLeftOffset+"px, 0, 0)")),l.length&&l.hasClass("sliding")&&(l[0].f7NavbarLeftOffset=i.rtl?l[0].offsetWidth:-l[0].offsetWidth,l[0].f7NavbarRightOffset=-l[0].f7NavbarLeftOffset);var y=t;i.rtl&&c&&p&&o.length>0&&(y=-y),o.css({left:y+"px"})}})}},i.hideNavbar=function(e){return s(e).addClass("navbar-hidden"),!0},i.showNavbar=function(e){var a=s(e);return a.addClass("navbar-hiding").removeClass("navbar-hidden").transitionEnd(function(){a.removeClass("navbar-hiding")}),!0},i.hideToolbar=function(e){return s(e).addClass("toolbar-hidden"),!0},i.showToolbar=function(e){var a=s(e);a.addClass("toolbar-hiding").removeClass("toolbar-hidden").transitionEnd(function(){a.removeClass("toolbar-hiding")})},i.cache=[],i.removeFromCache=function(e){for(var a=!1,t=0;t<i.cache.length;t++)i.cache[t].url===e&&(a=t);a!==!1&&i.cache.splice(a,1)},i.xhr=!1,i.get=function(e,a,t,n){var r=e;if(i.params.cacheIgnoreGetParameters&&e.indexOf("?")>=0&&(r=e.split("?")[0]),i.params.cache&&!t&&e.indexOf("nocache")<0&&i.params.cacheIgnore.indexOf(r)<0)for(var o=0;o<i.cache.length;o++)if(i.cache[o].url===r&&(new Date).getTime()-i.cache[o].time<i.params.cacheDuration)return n(i.cache[o].content),!1;return i.xhr=s.ajax({url:e,method:"GET",beforeSend:i.params.onAjaxStart,complete:function(e){e.status>=200&&e.status<300||0===e.status?(i.params.cache&&(i.removeFromCache(r),i.cache.push({url:r,time:(new Date).getTime(),content:e.responseText})),n(e.responseText,!1)):n(e.responseText,!0),i.params.onAjaxComplete&&i.params.onAjaxComplete(e)},error:function(e){n(e.responseText,!0),i.params.onAjaxError&&i.params.onAjaxError(e)}}),a&&(a.xhr=i.xhr),i.xhr},i.pageCallbacks={},i.onPage=function(e,a,t){if(a&&a.split(" ").length>1){for(var n=a.split(" "),r=[],o=0;o<n.length;o++)r.push(i.onPage(e,n[o],t));return r.remove=function(){for(var e=0;e<r.length;e++)r[e].remove()},r.trigger=function(){for(var e=0;e<r.length;e++)r[e].trigger()},r}var s=i.pageCallbacks[e][a];return s||(s=i.pageCallbacks[e][a]=[]),i.pageCallbacks[e][a].push(t),{remove:function(){for(var e,a=0;a<s.length;a++)s[a].toString()===t.toString()&&(e=a);"undefined"!=typeof e&&s.splice(e,1)},trigger:t}};for(var p="beforeInit init reinit beforeAnimation afterAnimation back afterBack beforeRemove".split(" "),d=0;d<p.length;d++)i.pageCallbacks[p[d]]={},t(p[d]);i.triggerPageCallbacks=function(e,a,t){var n=i.pageCallbacks[e]["*"];if(n)for(var r=0;r<n.length;r++)n[r](t);var o=i.pageCallbacks[e][a];if(o&&0!==o.length)for(var s=0;s<o.length;s++)o[s](t)},i.pageInitCallback=function(e,a){var t=a.pageContainer;if(!t.f7PageInitialized||!e||e.params.domCache){var n=a.query;n||(n=a.url&&a.url.indexOf("?")>0?s.parseUrlQuery(a.url||""):t.f7PageData&&t.f7PageData.query?t.f7PageData.query:{});var r={container:t,url:a.url,query:n,name:s(t).attr("data-page"),view:e,from:a.position,context:a.context,navbarInnerContainer:a.navbarInnerContainer,fromPage:a.fromPage};if(a.fromPage&&!a.fromPage.navbarInnerContainer&&a.oldNavbarInnerContainer&&(a.fromPage.navbarInnerContainer=a.oldNavbarInnerContainer),t.f7PageInitialized&&(e&&e.params.domCache||!e&&s(t).parents(".popup, .popover, .login-screen, .modal, .actions-modal, .picker-modal").length>0))return i.reinitPage(t),i.pluginHook("pageReinit",r),i.params.onPageReinit&&i.params.onPageReinit(i,r),i.triggerPageCallbacks("reinit",r.name,r),void s(r.container).trigger("pageReinit",{page:r});t.f7PageInitialized=!0,t.f7PageData=r,!e||a.preloadOnly||a.reloadPrevious||(s(e.container).attr("data-page",r.name),e.activePage=r),i.pluginHook("pageBeforeInit",r),i.params.onPageBeforeInit&&i.params.onPageBeforeInit(i,r),i.triggerPageCallbacks("beforeInit",r.name,r),s(r.container).trigger("pageBeforeInit",{page:r}),i.initPage(t),i.pluginHook("pageInit",r),i.params.onPageInit&&i.params.onPageInit(i,r),i.triggerPageCallbacks("init",r.name,r),s(r.container).trigger("pageInit",{page:r})}},i.pageRemoveCallback=function(e,a,t){var n;a.f7PageData&&(n=a.f7PageData.context);var r={container:a,name:s(a).attr("data-page"),view:e,url:a.f7PageData&&a.f7PageData.url,query:a.f7PageData&&a.f7PageData.query,navbarInnerContainer:a.f7PageData&&a.f7PageData.navbarInnerContainer,from:t,context:n};i.pluginHook("pageBeforeRemove",r),i.params.onPageBeforeRemove&&i.params.onPageBeforeRemove(i,r),i.triggerPageCallbacks("beforeRemove",r.name,r),s(r.container).trigger("pageBeforeRemove",{page:r})},i.pageBackCallback=function(e,a,t){var n,r=t.pageContainer;r.f7PageData&&(n=r.f7PageData.context);var o={container:r,name:s(r).attr("data-page"),url:r.f7PageData&&r.f7PageData.url,query:r.f7PageData&&r.f7PageData.query,view:a,from:t.position,context:n,navbarInnerContainer:r.f7PageData&&r.f7PageData.navbarInnerContainer,swipeBack:t.swipeBack};"after"===e&&(i.pluginHook("pageAfterBack",o),i.params.onPageAfterBack&&i.params.onPageAfterBack(i,o),i.triggerPageCallbacks("afterBack",o.name,o),s(r).trigger("pageAfterBack",{page:o})),"before"===e&&(i.pluginHook("pageBack",o),i.params.onPageBack&&i.params.onPageBack(i,o),i.triggerPageCallbacks("back",o.name,o),s(o.container).trigger("pageBack",{page:o}))},i.pageAnimCallback=function(e,a,t){var n,r=t.pageContainer;r.f7PageData&&(n=r.f7PageData.context);var o=t.query;o||(o=t.url&&t.url.indexOf("?")>0?s.parseUrlQuery(t.url||""):r.f7PageData&&r.f7PageData.query?r.f7PageData.query:{});var l={container:r,url:t.url,query:o,name:s(r).attr("data-page"),view:a,from:t.position,context:n,swipeBack:t.swipeBack,navbarInnerContainer:r.f7PageData&&r.f7PageData.navbarInnerContainer,fromPage:t.fromPage},c=t.oldPage,p=t.newPage;if(r.f7PageData=l,"after"===e&&(i.pluginHook("pageAfterAnimation",l),i.params.onPageAfterAnimation&&i.params.onPageAfterAnimation(i,l),i.triggerPageCallbacks("afterAnimation",l.name,l),s(l.container).trigger("pageAfterAnimation",{page:l})),"before"===e){s(a.container).attr("data-page",l.name),a&&(a.activePage=l),p.hasClass("no-navbar")&&!c.hasClass("no-navbar")&&a.hideNavbar(),p.hasClass("no-navbar")||!c.hasClass("no-navbar")&&!c.hasClass("no-navbar-by-scroll")||a.showNavbar(),p.hasClass("no-toolbar")&&!c.hasClass("no-toolbar")&&a.hideToolbar(),p.hasClass("no-toolbar")||!c.hasClass("no-toolbar")&&!c.hasClass("no-toolbar-by-scroll")||a.showToolbar();var d;p.hasClass("no-tabbar")&&!c.hasClass("no-tabbar")&&(d=s(a.container).find(".tabbar"),0===d.length&&(d=s(a.container).parents("."+i.params.viewsClass).find(".tabbar")),i.hideToolbar(d)),p.hasClass("no-tabbar")||!c.hasClass("no-tabbar")&&!c.hasClass("no-tabbar-by-scroll")||(d=s(a.container).find(".tabbar"),0===d.length&&(d=s(a.container).parents("."+i.params.viewsClass).find(".tabbar")),i.showToolbar(d)),c.removeClass("no-navbar-by-scroll no-toolbar-by-scroll"),i.pluginHook("pageBeforeAnimation",l),i.params.onPageBeforeAnimation&&i.params.onPageBeforeAnimation(i,l),i.triggerPageCallbacks("beforeAnimation",l.name,l),s(l.container).trigger("pageBeforeAnimation",{page:l})}},i.initPage=function(e){e=s(e),0!==e.length&&(i.sizeNavbars&&i.sizeNavbars(e.parents("."+i.params.viewClass)[0]),i.initPageMessages&&i.initPageMessages(e),i.initFormsStorage&&i.initFormsStorage(e),i.initSmartSelects&&i.initSmartSelects(e),i.initPageSwiper&&i.initPageSwiper(e),i.initPullToRefresh&&i.initPullToRefresh(e),i.initPageInfiniteScroll&&i.initPageInfiniteScroll(e),i.initSearchbar&&i.initSearchbar(e),i.initPageMessagebar&&i.initPageMessagebar(e),i.initPageScrollToolbars&&i.initPageScrollToolbars(e),i.initImagesLazyLoad&&i.initImagesLazyLoad(e),i.initPageProgressbar&&i.initPageProgressbar(e),i.initPageResizableTextarea&&i.initPageResizableTextarea(e),i.params.material&&i.initPageMaterialPreloader&&i.initPageMaterialPreloader(e),i.params.material&&i.initPageMaterialInputs&&i.initPageMaterialInputs(e),i.params.material&&i.initPageMaterialTabbar&&i.initPageMaterialTabbar(e))},i.reinitPage=function(e){e=s(e),0!==e.length&&(i.sizeNavbars&&i.sizeNavbars(e.parents("."+i.params.viewClass)[0]),i.reinitPageSwiper&&i.reinitPageSwiper(e),i.reinitLazyLoad&&i.reinitLazyLoad(e))},i.initPageWithCallback=function(e){e=s(e);var a=e.parents("."+i.params.viewClass);if(0!==a.length){var t=a[0].f7View||void 0,n=t&&t.url?t.url:void 0;a&&e.attr("data-page")&&a.attr("data-page",e.attr("data-page")),i.pageInitCallback(t,{pageContainer:e[0],url:n,position:"center"})}},i.router={temporaryDom:document.createElement("div"),findElement:function(e,a,t,n){a=s(a),n&&(e+=":not(.cached)");var r=a.find(e);return r.length>1&&("string"==typeof t.selector&&(r=a.find(t.selector+" "+e)),r.length>1&&(r=a.find("."+i.params.viewMainClass+" "+e))),1===r.length?r:(n||(r=i.router.findElement(e,a,t,!0)),r&&1===r.length?r:void 0)},animatePages:function(e,a,t,n){var r="page-on-center page-on-right page-on-left";"to-left"===t&&(e.removeClass(r).addClass("page-from-center-to-left"),a.removeClass(r).addClass("page-from-right-to-center")),"to-right"===t&&(e.removeClass(r).addClass("page-from-left-to-center"),a.removeClass(r).addClass("page-from-center-to-right"))},prepareNavbar:function(e,a,t){s(e).find(".sliding").each(function(){var e=s(this),a="right"===t?this.f7NavbarRightOffset:this.f7NavbarLeftOffset;i.params.animateNavBackIcon&&e.hasClass("left")&&e.find(".back .icon").length>0&&e.find(".back .icon").transform("translate3d("+-a+"px,0,0)"),e.transform("translate3d("+a+"px,0,0)")})},animateNavbars:function(e,a,t,n){var r="navbar-on-right navbar-on-center navbar-on-left";"to-left"===t&&(a.removeClass(r).addClass("navbar-from-right-to-center"),a.find(".sliding").each(function(){var e=s(this);e.transform("translate3d(0px,0,0)"),i.params.animateNavBackIcon&&e.hasClass("left")&&e.find(".back .icon").length>0&&e.find(".back .icon").transform("translate3d(0px,0,0)")}),e.removeClass(r).addClass("navbar-from-center-to-left"),e.find(".sliding").each(function(){var e,t=s(this);i.params.animateNavBackIcon&&(t.hasClass("center")&&a.find(".sliding.left .back .icon").length>0&&(e=a.find(".sliding.left .back span"),e.length>0&&(this.f7NavbarLeftOffset+=e[0].offsetLeft)),t.hasClass("left")&&t.find(".back .icon").length>0&&t.find(".back .icon").transform("translate3d("+-this.f7NavbarLeftOffset+"px,0,0)")),t.transform("translate3d("+this.f7NavbarLeftOffset+"px,0,0)")})),"to-right"===t&&(e.removeClass(r).addClass("navbar-from-left-to-center"),e.find(".sliding").each(function(){var e=s(this);e.transform("translate3d(0px,0,0)"),i.params.animateNavBackIcon&&e.hasClass("left")&&e.find(".back .icon").length>0&&e.find(".back .icon").transform("translate3d(0px,0,0)")}),a.removeClass(r).addClass("navbar-from-center-to-right"),a.find(".sliding").each(function(){var e=s(this);i.params.animateNavBackIcon&&e.hasClass("left")&&e.find(".back .icon").length>0&&e.find(".back .icon").transform("translate3d("+-this.f7NavbarRightOffset+"px,0,0)"),e.transform("translate3d("+this.f7NavbarRightOffset+"px,0,0)")}))},preprocess:function(e,a,t,n){i.pluginHook("routerPreprocess",e,a,t,n),a=i.pluginProcess("preprocess",a),e&&e.params&&e.params.preprocess?(a=e.params.preprocess(a,t,n),"undefined"!=typeof a&&n(a)):i.params.preprocess?(a=i.params.preprocess(a,t,n),"undefined"!=typeof a&&n(a)):n(a)},preroute:function(e,a,t){return t&&(a.isBack=!0),i.pluginHook("routerPreroute",e,a),!!(i.params.preroute&&i.params.preroute(e,a)===!1||e&&e.params.preroute&&e.params.preroute(e,a)===!1)},template7Render:function(e,a){var t,n,r=a.url,o=a.content,c=a.content,p=a.context,d=a.contextName,f=a.template;a.pageName;if("string"==typeof o?r?i.template7Cache[r]&&!a.ignoreCache?n=l.cache[r]:(n=l.compile(o),l.cache[r]=n):n=l.compile(o):f&&(n=f),p)t=p;else{if(d)if(d.indexOf(".")>=0){for(var u=d.split("."),h=l.data[u[0]],m=1;m<u.length;m++)u[m]&&(h=h[u[m]]);t=h}else t=l.data[d];if(!t&&r&&(t=l.data["url:"+r]),!t&&"string"==typeof o&&!f){var g=o.match(/(data-page=["'][^"^']*["'])/);if(g){var v=g[0].split("data-page=")[1].replace(/['"]/g,"");v&&(t=l.data["page:"+v])}}if(!t&&f&&l.templates)for(var b in l.templates)l.templates[b]===f&&(t=l.data[b]);t||(t={})}if(n&&t){if("function"==typeof t&&(t=t()),r){var C=s.parseUrlQuery(r);t.url_query={};for(var y in C)t.url_query[y]=C[y]}c=n(t)}return{content:c,context:t}}},i.router._load=function(e,a){function t(){e.allowPageChange=!0,n.removeClass("page-from-right-to-center page-on-right page-on-left").addClass("page-on-center"),r.removeClass("page-from-center-to-left page-on-center page-on-right").addClass("page-on-left"),f&&(p.removeClass("navbar-from-right-to-center navbar-on-left navbar-on-right").addClass("navbar-on-center"),c.removeClass("navbar-from-center-to-left navbar-on-center navbar-on-right").addClass("navbar-on-left")),i.pageAnimCallback("after",e,{pageContainer:n[0],url:h,position:"right",oldPage:r,newPage:n,query:a.query,fromPage:r&&r.length&&r[0].f7PageData}),i.params.pushState&&e.main&&i.pushStateClearQueue(),e.params.swipeBackPage||e.params.preloadPreviousPage||(e.params.domCache?(r.addClass("cached"),f&&c.addClass("cached")):0===h.indexOf("#")&&0===n.attr("data-page").indexOf("smart-select-")||(i.pageRemoveCallback(e,r[0],"left"),f&&i.navbarRemoveCallback(e,r[0],d[0],c[0]),r.remove(),f&&c.remove())),e.params.uniqueHistory&&M&&e.refreshPreviousPage()}a=a||{};var n,r,o,l,c,p,d,f,u,h=a.url,m=a.content,g={content:a.content},v=a.template,b=a.pageName,C=s(e.container),y=s(e.pagesContainer),w=a.animatePages,k="undefined"==typeof h&&m||v,x=a.pushState;
if("undefined"==typeof w&&(w=e.params.animatePages),i.pluginHook("routerLoad",e,a),(i.params.template7Pages&&"string"==typeof m||v)&&(g=i.router.template7Render(e,a),g.content&&!m&&(m=g.content)),i.router.temporaryDom.innerHTML="",!b)if("string"==typeof m||h&&"string"==typeof m)i.router.temporaryDom.innerHTML=g.content;else if("length"in m&&m.length>1)for(var T=0;T<m.length;T++)s(i.router.temporaryDom).append(m[T]);else s(i.router.temporaryDom).append(m);if(u=a.reload&&(a.reloadPrevious?"left":"center"),n=b?y.find('.page[data-page="'+b+'"]'):i.router.findElement(".page",i.router.temporaryDom,e),!n||0===n.length||b&&e.activePage&&e.activePage.name===b)return void(e.allowPageChange=!0);if(n.addClass(a.reload?"page-on-"+u:"page-on-right"),o=y.children(".page:not(.cached)"),a.reload&&a.reloadPrevious&&1===o.length)return void(e.allowPageChange=!0);if(a.reload)r=o.eq(o.length-1);else{if(o.length>1){for(l=0;l<o.length-2;l++)e.params.domCache?s(o[l]).addClass("cached"):(i.pageRemoveCallback(e,o[l],"left"),s(o[l]).remove());e.params.domCache?s(o[l]).addClass("cached"):(i.pageRemoveCallback(e,o[l],"left"),s(o[l]).remove())}r=y.children(".page:not(.cached)")}if(e.params.domCache&&n.removeClass("cached"),e.params.dynamicNavbar)if(f=!0,p=b?C.find('.navbar-inner[data-page="'+b+'"]'):i.router.findElement(".navbar-inner",i.router.temporaryDom,e),p&&0!==p.length||(f=!1),d=C.find(".navbar"),a.reload)c=d.find(".navbar-inner:not(.cached):last-child");else if(c=d.find(".navbar-inner:not(.cached)"),c.length>0){for(l=0;l<c.length-1;l++)e.params.domCache?s(c[l]).addClass("cached"):(i.navbarRemoveCallback(e,o[l],d[0],c[l]),s(c[l]).remove());p||1!==c.length||(e.params.domCache?s(c[0]).addClass("cached"):(i.navbarRemoveCallback(e,o[0],d[0],c[0]),s(c[0]).remove())),c=d.find(".navbar-inner:not(.cached)")}if(f&&(p.addClass(a.reload?"navbar-on-"+u:"navbar-on-right"),e.params.domCache&&p.removeClass("cached"),n[0].f7RelatedNavbar=p[0],p[0].f7RelatedPage=n[0]),!h){var P=b||n.attr("data-page");h=k?"#"+i.params.dynamicPageUrl.replace(/{{name}}/g,P).replace(/{{index}}/g,e.history.length-(a.reload?1:0)):"#"+P,e.params.domCache||(e.contentCache[h]=m),e.params.domCache&&b&&(e.pagesCache[h]=b)}if(i.params.pushState&&!a.reloadPrevious&&e.main){"undefined"==typeof x&&(x=!0);var S=i.params.pushStateRoot||"",O=a.reload?"replaceState":"pushState";x&&(k||b?k&&m?history[O]({content:"string"==typeof m?m:"",url:h,viewIndex:i.views.indexOf(e)},"",S+i.params.pushStateSeparator+h):b&&history[O]({pageName:b,url:h,viewIndex:i.views.indexOf(e)},"",S+i.params.pushStateSeparator+h):history[O]({url:h,viewIndex:i.views.indexOf(e)},"",S+i.params.pushStateSeparator+h))}if(e.url=h,a.reload){var D=e.history[e.history.length-(a.reloadPrevious?2:1)];D&&0===D.indexOf("#")&&D in e.contentCache&&D!==h&&e.history.indexOf(D)===-1&&(e.contentCache[D]=null,delete e.contentCache[D]),e.history[e.history.length-(a.reloadPrevious?2:1)]=h}else e.history.push(h);var M=!1;if(e.params.uniqueHistory){var N=e.history,E=h;if(e.params.uniqueHistoryIgnoreGetParameters)for(N=[],E=h.split("?")[0],l=0;l<e.history.length;l++)N.push(e.history[l].split("?")[0]);N.indexOf(E)!==N.lastIndexOf(E)&&(e.history=e.history.slice(0,N.indexOf(E)),e.history.push(h),M=!0)}if(a.reloadPrevious?(r=r.prev(".page"),n.insertBefore(r),f&&(c=c.prev(".navbar-inner"),p.insertAfter(c))):(y.append(n[0]),f&&d.append(p[0])),a.reload&&(e.params.domCache&&e.initialPages.indexOf(r[0])>=0?(r.addClass("cached"),f&&c.addClass("cached")):(i.pageRemoveCallback(e,r[0],u),f&&i.navbarRemoveCallback(e,r[0],d[0],c[0]),r.remove(),f&&c.remove())),i.pageInitCallback(e,{pageContainer:n[0],url:h,position:a.reload?u:"right",navbarInnerContainer:f?p&&p[0]:void 0,oldNavbarInnerContainer:f?c&&c[0]:void 0,context:g.context,query:a.query,fromPage:r&&r.length&&r[0].f7PageData,reload:a.reload,reloadPrevious:a.reloadPrevious}),f&&i.navbarInitCallback(e,n[0],d[0],p[0],h,a.reload?u:"right"),a.reload)return e.allowPageChange=!0,void(M&&e.refreshPreviousPage());f&&w&&i.router.prepareNavbar(p,c,"right");n[0].clientLeft;i.pageAnimCallback("before",e,{pageContainer:n[0],url:h,position:"right",oldPage:r,newPage:n,query:a.query,fromPage:r&&r.length&&r[0].f7PageData}),w?(i.params.material&&i.params.materialPageLoadDelay?setTimeout(function(){i.router.animatePages(r,n,"to-left",e)},i.params.materialPageLoadDelay):i.router.animatePages(r,n,"to-left",e),f&&setTimeout(function(){i.router.animateNavbars(c,p,"to-left",e)},0),n.animationEnd(function(e){t()})):(f&&p.find(".sliding, .sliding .back .icon").transform(""),t())},i.router.load=function(e,a){function t(t){i.router.preprocess(e,t,n,function(t){a.content=t,i.router._load(e,a)})}if(a=a||{},i.router.preroute(e,a))return!1;var n=a.url,r=a.content,o=a.pageName;o&&o.indexOf("?")>0&&(a.query=s.parseUrlQuery(o),a.pageName=o=o.split("?")[0]);var l=a.template;return e.params.reloadPages===!0&&(a.reload=!0),!!e.allowPageChange&&(!(n&&e.url===n&&!a.reload&&!e.params.allowDuplicateUrls)&&(e.allowPageChange=!1,i.xhr&&e.xhr&&e.xhr===i.xhr&&(i.xhr.abort(),i.xhr=!1),r||o?void t(r):l?void i.router._load(e,a):a.url&&"#"!==a.url?void i.get(a.url,e,a.ignoreCache,function(a,n){return n?void(e.allowPageChange=!0):void t(a)}):void(e.allowPageChange=!0)))},i.router._back=function(e,a){function t(){i.pageBackCallback("after",e,{pageContainer:l[0],url:m,position:"center",oldPage:l,newPage:c}),i.pageAnimCallback("after",e,{pageContainer:c[0],url:m,position:"left",oldPage:l,newPage:c,query:a.query,fromPage:l&&l.length&&l[0].f7PageData}),i.router.afterBack(e,l[0],c[0])}function n(){i.pageBackCallback("before",e,{pageContainer:l[0],url:m,position:"center",oldPage:l,newPage:c}),i.pageAnimCallback("before",e,{pageContainer:c[0],url:m,position:"left",oldPage:l,newPage:c,query:a.query,fromPage:l&&l.length&&l[0].f7PageData}),C?(i.router.animatePages(c,l,"to-right",e),h&&setTimeout(function(){i.router.animateNavbars(d,p,"to-right",e)},0),c.animationEnd(function(){t()})):(h&&d.find(".sliding, .sliding .back .icon").transform(""),t())}function r(){if(i.router.temporaryDom.innerHTML="","string"==typeof g||m&&"string"==typeof g)i.router.temporaryDom.innerHTML=v.content;else if("length"in g&&g.length>1)for(var a=0;a<g.length;a++)s(i.router.temporaryDom).append(g[a]);else s(i.router.temporaryDom).append(g);c=i.router.findElement(".page",i.router.temporaryDom,e),e.params.dynamicNavbar&&(d=i.router.findElement(".navbar-inner",i.router.temporaryDom,e))}function o(){if(!c||0===c.length)return void(e.allowPageChange=!0);if(e.params.dynamicNavbar&&"undefined"==typeof h&&(h=!(!d||0===d.length)),c.addClass("page-on-left").removeClass("cached"),h&&(f=T.find(".navbar"),u=T.find(".navbar-inner:not(.cached)"),d.addClass("navbar-on-left").removeClass("cached")),k){var t,r;if(t=s(S[S.length-2]),h&&(r=s(t[0]&&t[0].f7RelatedNavbar||u[u.length-2])),e.params.domCache&&e.initialPages.indexOf(t[0])>=0)t.length&&t[0]!==c[0]&&t.addClass("cached"),h&&r.length&&r[0]!==d[0]&&r.addClass("cached");else{var o=h&&r.length;t.length?(i.pageRemoveCallback(e,t[0],"right"),o&&i.navbarRemoveCallback(e,t[0],f[0],r[0]),t.remove(),o&&r.remove()):o&&(i.navbarRemoveCallback(e,t[0],f[0],r[0]),r.remove())}S=P.children(".page:not(.cached)"),h&&(u=T.find(".navbar-inner:not(.cached)")),e.history.indexOf(m)>=0?e.history=e.history.slice(0,e.history.indexOf(m)+2):e.history[[e.history.length-2]]?e.history[e.history.length-2]=m:e.history.unshift(m)}if(l=s(S[S.length-1]),e.params.domCache&&l[0]===c[0]&&(l=P.children(".page.page-on-center"),0===l.length&&e.activePage&&(l=s(e.activePage.container))),h&&!p&&(p=s(u[u.length-1]),e.params.domCache&&(p[0]===d[0]&&(p=f.children(".navbar-inner.navbar-on-center:not(.cached)")),0===p.length&&(p=f.children('.navbar-inner[data-page="'+l.attr("data-page")+'"]'))),0!==p.length&&d[0]!==p[0]||(h=!1)),h&&(O&&d.insertBefore(p),d[0].f7RelatedPage=c[0],c[0].f7RelatedNavbar=d[0]),O&&c.insertBefore(l),i.pageInitCallback(e,{pageContainer:c[0],url:m,position:"left",navbarInnerContainer:h?d[0]:void 0,oldNavbarInnerContainer:h?p&&p[0]:void 0,context:v.context,query:a.query,fromPage:l&&l.length&&l[0].f7PageData,preloadOnly:y}),h&&i.navbarInitCallback(e,c[0],f[0],d[0],m,"right"),h&&d.hasClass("navbar-on-left")&&C&&i.router.prepareNavbar(d,p,"left"),y)return void(e.allowPageChange=!0);e.url=m;c[0].clientLeft;n(),i.params.pushState&&e.main&&("undefined"==typeof w&&(w=!0),!y&&history.state&&w&&history.back())}a=a||{};var l,c,p,d,f,u,h,m=a.url,g=a.content,v={content:a.content},b=a.template,C=a.animatePages,y=a.preloadOnly,w=a.pushState,k=(a.ignoreCache,a.force),x=a.pageName,T=s(e.container),P=s(e.pagesContainer),S=P.children(".page:not(.cached)"),O=!0;return"undefined"==typeof C&&(C=e.params.animatePages),i.pluginHook("routerBack",e,a),(i.params.template7Pages&&"string"==typeof g||b)&&(v=i.router.template7Render(e,a),v.content&&!g&&(g=v.content)),S.length>1&&!k?y?void(e.allowPageChange=!0):(e.url=e.history[e.history.length-2],m=e.url,c=s(S[S.length-2]),l=s(S[S.length-1]),e.params.dynamicNavbar&&(h=!0,u=T.find(".navbar-inner:not(.cached)"),d=s(u[0]),p=s(u[1]),0!==d.length&&0!==p.length&&p[0]!==d[0]||(h=!1)),O=!1,void o()):k?m&&m===e.url||x&&e.activePage&&e.activePage.name===x?void(e.allowPageChange=!0):g?(r(),void o()):x&&e.params.domCache?(x&&(m="#"+x),c=s(T).find('.page[data-page="'+x+'"]'),c[0].f7PageData&&c[0].f7PageData.url&&(m=c[0].f7PageData.url),e.params.dynamicNavbar&&(d=s(T).find('.navbar-inner[data-page="'+x+'"]'),0===d.length&&c[0].f7RelatedNavbar&&(d=s(c[0].f7RelatedNavbar)),0===d.length&&c[0].f7PageData&&(d=s(c[0].f7PageData.navbarInnerContainer))),void o()):void(e.allowPageChange=!0):(y||(e.url=e.history[e.history.length-2],m=e.url),g?(r(),void o()):x?(c=s(T).find('.page[data-page="'+x+'"]'),e.params.dynamicNavbar&&(d=s(T).find('.navbar-inner[data-page="'+x+'"]'),0===d.length&&c[0].f7RelatedNavbar&&(d=s(c[0].f7RelatedNavbar)),0===d.length&&c[0].f7PageData&&(d=s(c[0].f7PageData.navbarInnerContainer))),void o()):void(e.allowPageChange=!0))},i.router.back=function(e,a){function t(t){i.router.preprocess(e,t,n,function(t){a.content=t,i.router._back(e,a)})}if(a=a||{},i.router.preroute(e,a,!0))return!1;var n=a.url,r=a.content,o=a.pageName;o&&o.indexOf("?")>0&&(a.query=s.parseUrlQuery(o),a.pageName=o=o.split("?")[0]);var l=a.force;if(!e.allowPageChange)return!1;e.allowPageChange=!1,i.xhr&&e.xhr&&e.xhr===i.xhr&&(i.xhr.abort(),i.xhr=!1);var c=s(e.pagesContainer).find(".page:not(.cached)");if(c.length>1&&!l)return void i.router._back(e,a);if(l){if(!n&&r)return void t(r);if(!n&&o)return o&&(n="#"+o),void t();if(n)return void i.get(a.url,e,a.ignoreCache,function(a,n){return n?void(e.allowPageChange=!0):void t(a)})}else{if(n=a.url=e.history[e.history.length-2],!n)return void(e.allowPageChange=!0);if(0===n.indexOf("#")&&e.contentCache[n])return void t(e.contentCache[n]);if(0===n.indexOf("#")&&e.params.domCache)return o||(a.pageName=n.split("#")[1]),void t();if(0!==n.indexOf("#"))return void i.get(a.url,e,a.ignoreCache,function(a,n){return n?void(e.allowPageChange=!0):void t(a)})}e.allowPageChange=!0},i.router.afterBack=function(e,a,t){a=s(a),t=s(t),e.params.domCache&&e.initialPages.indexOf(a[0])>=0?a.removeClass("page-from-center-to-right").addClass("cached"):(i.pageRemoveCallback(e,a[0],"right"),a.remove()),t.removeClass("page-from-left-to-center page-on-left").addClass("page-on-center"),e.allowPageChange=!0;var n,r=e.history.pop();if(e.params.dynamicNavbar){var o=s(e.container).find(".navbar-inner:not(.cached)"),l=s(a[0].f7RelatedNavbar||o[1]);e.params.domCache&&e.initialNavbars.indexOf(l[0])>=0?l.removeClass("navbar-from-center-to-right").addClass("cached"):(i.navbarRemoveCallback(e,a[0],void 0,l[0]),l.remove()),n=s(o[0]).removeClass("navbar-on-left navbar-from-left-to-center").addClass("navbar-on-center")}if(e.params.domCache&&s(e.container).find(".page.cached").each(function(){var a=s(this),t=(a.index(),a[0].f7PageData&&a[0].f7PageData.url);t&&e.history.indexOf(t)<0&&e.initialPages.indexOf(this)<0&&(i.pageRemoveCallback(e,a[0],"right"),a[0].f7RelatedNavbar&&e.params.dynamicNavbar&&i.navbarRemoveCallback(e,a[0],void 0,a[0].f7RelatedNavbar),a.remove(),a[0].f7RelatedNavbar&&e.params.dynamicNavbar&&s(a[0].f7RelatedNavbar).remove())}),!e.params.domCache&&r&&r.indexOf("#")>-1&&r in e.contentCache&&e.history.indexOf(r)===-1&&(e.contentCache[r]=null,delete e.contentCache[r]),i.params.pushState&&e.main&&i.pushStateClearQueue(),e.params.preloadPreviousPage)if(e.params.domCache&&e.history.length>1){var c,p,d=e.history[e.history.length-2];d&&e.pagesCache[d]?(c=s(e.container).find('.page[data-page="'+e.pagesCache[d]+'"]'),c.next(".page")[0]!==t[0]&&c.insertBefore(t),n&&(p=s(e.container).find('.navbar-inner[data-page="'+e.pagesCache[d]+'"]'),p&&0!==p.length||(p=n.prev(".navbar-inner.cached")),p.next(".navbar-inner")[0]!==n[0]&&p.insertBefore(n))):(c=t.prev(".page.cached"),n&&(p=n.prev(".navbar-inner.cached"))),c&&c.length>0&&c.removeClass("cached page-on-right page-on-center").addClass("page-on-left"),p&&p.length>0&&p.removeClass("cached navbar-on-right navbar-on-center").addClass("navbar-on-left")}else i.router.back(e,{preloadOnly:!0})},i.initClickEvents=function(){function e(e){var a=s(this),t=s(e.target),n="a"===a[0].nodeName.toLowerCase()||a.parents("a").length>0||"a"===t[0].nodeName.toLowerCase()||t.parents("a").length>0;if(!n){var r;if(i.params.scrollTopOnNavbarClick&&a.is(".navbar .center")){var o=a.parents(".navbar");r=o.parents(".page-content"),0===r.length&&(o.parents(".page").length>0&&(r=o.parents(".page").find(".page-content")),0===r.length&&o.nextAll(".pages").length>0&&(r=o.nextAll(".pages").find(".page:not(.page-on-left):not(.page-on-right):not(.cached)").find(".page-content")))}i.params.scrollTopOnStatusbarClick&&a.is(".statusbar-overlay")&&(r=s(".popup.modal-in").length>0?s(".popup.modal-in").find(".page:not(.page-on-left):not(.page-on-right):not(.cached)").find(".page-content"):s(".panel.active").length>0?s(".panel.active").find(".page:not(.page-on-left):not(.page-on-right):not(.cached)").find(".page-content"):s(".views > .view.active").length>0?s(".views > .view.active").find(".page:not(.page-on-left):not(.page-on-right):not(.cached)").find(".page-content"):s(".views").find(".page:not(.page-on-left):not(.page-on-right):not(.cached)").find(".page-content")),r&&r.length>0&&(r.hasClass("tab")&&(r=r.parent(".tabs").children(".page-content.active")),r.length>0&&r.scrollTop(0,300))}}function a(e){var a=s(this),t=a.attr("href"),n="a"===a[0].nodeName.toLowerCase();if(n&&(a.is(i.params.externalLinks)||t&&t.indexOf("javascript:")>=0))return void(t&&"_system"===a.attr("target")&&(e.preventDefault(),window.open(t,"_system")));var r=a.dataset();if(a.hasClass("smart-select")&&i.smartSelectOpen&&i.smartSelectOpen(a),a.hasClass("open-panel")&&(1===s(".panel").length?s(".panel").hasClass("panel-left")?i.openPanel("left"):i.openPanel("right"):"right"===r.panel?i.openPanel("right"):i.openPanel("left")),a.hasClass("close-panel")&&i.closePanel(),a.hasClass("panel-overlay")&&i.params.panelsCloseByOutside&&i.closePanel(),a.hasClass("open-popover")){var o;o=r.popover?r.popover:".popover",i.popover(o,a)}a.hasClass("close-popover")&&i.closeModal(".popover.modal-in");var p;a.hasClass("open-popup")&&(p=r.popup?r.popup:".popup",i.popup(p)),a.hasClass("close-popup")&&(p=r.popup?r.popup:".popup.modal-in",i.closeModal(p));var d;if(a.hasClass("open-login-screen")&&(d=r.loginScreen?r.loginScreen:".login-screen",i.loginScreen(d)),a.hasClass("close-login-screen")&&i.closeModal(".login-screen.modal-in"),a.hasClass("modal-overlay")&&(s(".modal.modal-in").length>0&&i.params.modalCloseByOutside&&i.closeModal(".modal.modal-in"),s(".actions-modal.modal-in").length>0&&i.params.actionsCloseByOutside&&i.closeModal(".actions-modal.modal-in"),s(".popover.modal-in").length>0&&i.closeModal(".popover.modal-in")),a.hasClass("popup-overlay")&&s(".popup.modal-in").length>0&&i.params.popupCloseByOutside&&i.closeModal(".popup.modal-in"),a.hasClass("picker-modal-overlay")&&s(".picker-modal.modal-in").length>0&&i.closeModal(".picker-modal.modal-in"),a.hasClass("close-picker")){var f=s(".picker-modal.modal-in");f.length>0?i.closeModal(f):(f=s(".popover.modal-in .picker-modal"),f.length>0&&i.closeModal(f.parents(".popover")))}if(a.hasClass("open-picker")){var u;u=r.picker?r.picker:".picker-modal",i.pickerModal(u,a)}var h;if(a.hasClass("tab-link")&&(h=!0,i.showTab(r.tab||a.attr("href"),a)),a.hasClass("swipeout-close")&&i.swipeoutClose(a.parents(".swipeout-opened")),a.hasClass("swipeout-delete"))if(r.confirm){var m=r.confirm,g=r.confirmTitle;g?i.confirm(m,g,function(){i.swipeoutDelete(a.parents(".swipeout"))},function(){r.closeOnCancel&&i.swipeoutClose(a.parents(".swipeout"))}):i.confirm(m,function(){i.swipeoutDelete(a.parents(".swipeout"))},function(){r.closeOnCancel&&i.swipeoutClose(a.parents(".swipeout"))})}else i.swipeoutDelete(a.parents(".swipeout"));if(a.hasClass("toggle-sortable")&&i.sortableToggle(r.sortable),a.hasClass("open-sortable")&&i.sortableOpen(r.sortable),a.hasClass("close-sortable")&&i.sortableClose(r.sortable),a.hasClass("accordion-item-toggle")||a.hasClass("item-link")&&a.parent().hasClass("accordion-item")){var v=a.parent(".accordion-item");0===v.length&&(v=a.parents(".accordion-item")),0===v.length&&(v=a.parents("li")),i.accordionToggle(v)}if(i.params.material&&(a.hasClass("floating-button")&&a.parent().hasClass("speed-dial")&&a.parent().toggleClass("speed-dial-opened"),a.hasClass("close-speed-dial")&&s(".speed-dial-opened").removeClass("speed-dial-opened")),(!i.params.ajaxLinks||a.is(i.params.ajaxLinks))&&n&&i.params.router){n&&e.preventDefault();var b=t&&t.length>0&&"#"!==t&&!h,C=r.template;if(b||a.hasClass("back")||C){var y;if(r.view?y=s(r.view)[0].f7View:(y=a.parents("."+i.params.viewClass)[0]&&a.parents("."+i.params.viewClass)[0].f7View,y&&y.params.linksView&&("string"==typeof y.params.linksView?y=s(y.params.linksView)[0].f7View:y.params.linksView instanceof c&&(y=y.params.linksView))),y||i.mainView&&(y=i.mainView),!y)return;var w;if(C)t=void 0;else{if(0===t.indexOf("#")&&"#"!==t){if(!y.params.domCache)return;w=t.split("#")[1]}if("#"===t&&!a.hasClass("back"))return}var k;"undefined"!=typeof r.animatePages?k=r.animatePages:(a.hasClass("with-animation")&&(k=!0),a.hasClass("no-animation")&&(k=!1));var x={animatePages:k,ignoreCache:r.ignoreCache,force:r.force,reload:r.reload,reloadPrevious:r.reloadPrevious,pageName:w,pushState:r.pushState,url:t};if(i.params.template7Pages){x.contextName=r.contextName;var T=r.context;T&&(x.context=JSON.parse(T))}C&&C in l.templates&&(x.template=l.templates[C]),a.hasClass("back")?y.router.back(x):y.router.load(x)}}}function t(e){e.preventDefault()}s(document).on("click","a, .open-panel, .close-panel, .panel-overlay, .modal-overlay, .popup-overlay, .swipeout-delete, .swipeout-close, .close-popup, .open-popup, .open-popover, .open-login-screen, .close-login-screen .smart-select, .toggle-sortable, .open-sortable, .close-sortable, .accordion-item-toggle, .close-picker, .picker-modal-overlay",a),(i.params.scrollTopOnNavbarClick||i.params.scrollTopOnStatusbarClick)&&s(document).on("click",".statusbar-overlay, .navbar .center",e),i.support.touch&&!i.device.android&&s(document).on(i.params.fastClicks?"touchstart":"touchmove",".panel-overlay, .modal-overlay, .preloader-indicator-overlay, .popup-overlay, .searchbar-overlay",t)},i.initResize=function(){s(window).on("resize",i.resize),s(window).on("orientationchange",i.orientationchange)},i.resize=function(){i.sizeNavbars&&i.sizeNavbars(),n()},i.orientationchange=function(){i.device&&i.device.minimalUi&&(90!==window.orientation&&window.orientation!==-90||(document.body.scrollTop=0)),n()},i.allowPanelOpen=!0,i.openPanel=function(e){function a(){r.transitionEnd(function(e){s(e.target).is(r)?(t.hasClass("active")?t.trigger("opened"):t.trigger("closed"),i.params.material&&s(".panel-overlay").css({display:""}),i.allowPanelOpen=!0):a()})}if(!i.allowPanelOpen)return!1;var t=s(".panel-"+e);if(0===t.length||t.hasClass("active"))return!1;i.closePanel(),i.allowPanelOpen=!1;var n=t.hasClass("panel-reveal")?"reveal":"cover";t.css({display:"block"}).addClass("active"),t.trigger("open"),i.params.material&&s(".panel-overlay").show(),t.find("."+i.params.viewClass).length>0&&i.sizeNavbars&&i.sizeNavbars(t.find("."+i.params.viewClass)[0]);var r=(t[0].clientLeft,"reveal"===n?s("."+i.params.viewsClass):t);return a(),s("body").addClass("with-panel-"+e+"-"+n),!0},i.closePanel=function(){var e=s(".panel.active");if(0===e.length)return!1;var a=e.hasClass("panel-reveal")?"reveal":"cover",t=e.hasClass("panel-left")?"left":"right";e.removeClass("active");var n="reveal"===a?s("."+i.params.viewsClass):e;e.trigger("close"),i.allowPanelOpen=!1,n.transitionEnd(function(){e.hasClass("active")||(e.css({display:""}),e.trigger("closed"),s("body").removeClass("panel-closing"),i.allowPanelOpen=!0)}),s("body").addClass("panel-closing").removeClass("with-panel-"+t+"-"+a)},i.initSwipePanels=function(){function e(e){if(i.allowPanelOpen&&(i.params.swipePanel||i.params.swipePanelOnlyClose)&&!o&&!(s(".modal-in, .photo-browser-in").length>0)&&(i.params.swipePanelCloseOpposite||i.params.swipePanelOnlyClose||!(s(".panel.active").length>0)||n.hasClass("active"))){if(C.x="touchstart"===e.type?e.targetTouches[0].pageX:e.pageX,C.y="touchstart"===e.type?e.targetTouches[0].pageY:e.pageY,i.params.swipePanelCloseOpposite||i.params.swipePanelOnlyClose){if(s(".panel.active").length>0)r=s(".panel.active").hasClass("panel-left")?"left":"right";else{if(i.params.swipePanelOnlyClose)return;r=i.params.swipePanel}if(!r)return}if(n=s(".panel.panel-"+r),h=n.hasClass("active"),i.params.swipePanelActiveArea&&!h){if("left"===r&&C.x>i.params.swipePanelActiveArea)return;if("right"===r&&C.x<window.innerWidth-i.params.swipePanelActiveArea)return}l=!1,o=!0,c=void 0,p=(new Date).getTime(),v=void 0}}function a(e){if(o&&!e.f7PreventPanelSwipe){var a="touchmove"===e.type?e.targetTouches[0].pageX:e.pageX,t="touchmove"===e.type?e.targetTouches[0].pageY:e.pageY;if("undefined"==typeof c&&(c=!!(c||Math.abs(t-C.y)>Math.abs(a-C.x))),c)return void(o=!1);if(!v&&(v=a>C.x?"to-right":"to-left","both"===r&&(r=s(".panel.active").length>0?s(".panel.active").hasClass("panel-left")?"left":"right":"to-right"===v?"left":"right",n=s(".panel.panel-"+r)),"left"===r&&"to-left"===v&&!n.hasClass("active")||"right"===r&&"to-right"===v&&!n.hasClass("active")))return void(o=!1);if(i.params.swipePanelNoFollow){var w=(new Date).getTime()-p;return w<300&&("to-left"===v&&("right"===r&&i.openPanel(r),"left"===r&&n.hasClass("active")&&i.closePanel()),"to-right"===v&&("left"===r&&i.openPanel(r),"right"===r&&n.hasClass("active")&&i.closePanel())),o=!1,void(l=!1)}l||(g=n.hasClass("panel-cover")?"cover":"reveal",h||(n.show(),b.show()),m=n[0].offsetWidth,n.transition(0),n.find("."+i.params.viewClass).length>0&&i.sizeNavbars&&i.sizeNavbars(n.find("."+i.params.viewClass)[0])),l=!0,e.preventDefault();var k=h?0:-i.params.swipePanelThreshold;"right"===r&&(k=-k),d=a-C.x+k,"right"===r?(f=d-(h?m:0),f>0&&(f=0),f<-m&&(f=-m)):(f=d+(h?m:0),f<0&&(f=0),f>m&&(f=m)),"reveal"===g?(y.transform("translate3d("+f+"px,0,0)").transition(0),b.transform("translate3d("+f+"px,0,0)").transition(0),i.pluginHook("swipePanelSetTransform",y[0],n[0],Math.abs(f/m))):(n.transform("translate3d("+f+"px,0,0)").transition(0),i.params.material&&(b.transition(0),u=Math.abs(f/m),b.css({opacity:u})),i.pluginHook("swipePanelSetTransform",y[0],n[0],Math.abs(f/m)))}}function t(e){if(!o||!l)return o=!1,void(l=!1);o=!1,l=!1;var a,t=(new Date).getTime()-p,c=0===f||Math.abs(f)===m;if(a=h?f===-m?"reset":t<300&&Math.abs(f)>=0||t>=300&&Math.abs(f)<=m/2?"left"===r&&f===m?"reset":"swap":"reset":0===f?"reset":t<300&&Math.abs(f)>0||t>=300&&Math.abs(f)>=m/2?"swap":"reset","swap"===a&&(i.allowPanelOpen=!0,h?(i.closePanel(),c&&(n.css({display:""}),s("body").removeClass("panel-closing"))):i.openPanel(r),c&&(i.allowPanelOpen=!0)),"reset"===a)if(h)i.allowPanelOpen=!0,i.openPanel(r);else if(i.closePanel(),c)i.allowPanelOpen=!0,n.css({display:""});else{var d="reveal"===g?y:n;n.trigger("close"),s("body").addClass("panel-closing"),d.transitionEnd(function(){n.trigger("closed"),n.css({display:""}),s("body").removeClass("panel-closing"),i.allowPanelOpen=!0})}"reveal"===g&&(y.transition(""),y.transform("")),n.transition("").transform(""),b.css({display:""}).transform("").transition("").css("opacity","")}var n,r;if(i.params.swipePanel){if(n=s(".panel.panel-"+i.params.swipePanel),r=i.params.swipePanel,0===n.length&&"both"!==r)return}else{if(!i.params.swipePanelOnlyClose)return;if(0===s(".panel").length)return}var o,l,c,p,d,f,u,h,m,g,v,b=s(".panel-overlay"),C={},y=s("."+i.params.viewsClass);s(document).on(i.touchEvents.start,e),s(document).on(i.touchEvents.move,a),s(document).on(i.touchEvents.end,t)},i.initImagesLazyLoad=function(e){function a(e){function t(){e.removeClass("lazy").addClass("lazy-loaded"),n?e.css("background-image","url("+r+")"):e.attr("src",r),i.params.imagesLazyLoadSequential&&(f=!1,d.length>0&&a(d.shift()))}e=s(e);var n=e.attr("data-background"),r=n?n:e.attr("data-src");if(r){if(i.params.imagesLazyLoadSequential&&f)return void(d.indexOf(e[0])<0&&d.push(e[0]));f=!0;var o=new Image;o.onload=t,o.onerror=t,o.src=r}}function t(){l=e.find(".lazy"),l.each(function(e,t){t=s(t),t.parents(".tab:not(.active)").length>0||n(t[0])&&a(t)})}function n(e){var a=e.getBoundingClientRect(),t=i.params.imagesLazyLoadThreshold||0;return a.top>=0-t&&a.left>=0-t&&a.top<=window.innerHeight+t&&a.left<=window.innerWidth+t}function r(a){var n=a?"off":"on";l[n]("lazy",t),l.parents(".tab")[n]("show",t),e[n]("lazy",t),c[n]("lazy",t),c[n]("scroll",t),s(window)[n]("resize",t)}function o(){r(!0)}e=s(e);var l;if(e.hasClass("lazy")?(l=e,e=l.parents(".page")):l=e.find(".lazy"),0!==l.length){var c;if(e.hasClass("page-content")?(c=e,e=e.parents(".page")):c=e.find(".page-content"),0!==c.length){var p="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEXCwsK592mkAAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==";"string"==typeof i.params.imagesLazyLoadPlaceholder&&(p=i.params.imagesLazyLoadPlaceholder),i.params.imagesLazyLoadPlaceholder!==!1&&l.each(function(){s(this).attr("data-src")&&s(this).attr("src",p)});var d=[],f=!1;e[0].f7DestroyImagesLazyLoad=o,r(),e.hasClass("page")&&e.once("pageBeforeRemove",o),t(),e.once("pageAfterAnimation",t)}}},i.destroyImagesLazyLoad=function(e){e=s(e),e.length>0&&e[0].f7DestroyImagesLazyLoad&&e[0].f7DestroyImagesLazyLoad()},i.reinitImagesLazyLoad=function(e){e=s(e),e.length>0&&e.trigger("lazy")},i.initPageMaterialPreloader=function(e){s(e).find(".preloader").each(function(){0===s(this).children().length&&s(this).html(i.params.materialPreloaderHtml)})};var f=function(e,a){function t(e){return e.replace(/[^\u0000-\u007E]/g,function(e){return p[e]||e})}function n(e){e.preventDefault()}var r={input:null,clearButton:null,cancelButton:null,searchList:null,searchIn:".item-title",searchBy:"",found:null,notFound:null,overlay:null,ignore:".searchbar-ignore",customSearch:!1,removeDiacritics:!1,hideDividers:!0,hideGroups:!0};a=a||{};for(var o in r)"undefined"!=typeof a[o]&&null!==a[o]||(a[o]=r[o]);var l=this;l.material=i.params.material,l.params=a,e=s(e),l.container=e,l.active=!1,l.input=l.params.input?s(l.params.input):l.container.find('input[type="search"]'),l.clearButton=l.params.clearButton?s(l.params.clearButton):l.container.find(".searchbar-clear"),l.cancelButton=l.params.cancelButton?s(l.params.cancelButton):l.container.find(".searchbar-cancel"),l.searchList=s(l.params.searchList),l.isVirtualList=l.searchList.hasClass("virtual-list"),l.pageContainer=l.container.parents(".page").eq(0),l.params.overlay?l.overlay=s(l.params.overlay):l.overlay=l.pageContainer.length>0?l.pageContainer.find(".searchbar-overlay"):s(".searchbar-overlay"),l.params.found?l.found=s(l.params.found):l.found=l.pageContainer.length>0?l.pageContainer.find(".searchbar-found"):s(".searchbar-found"),l.params.notFound?l.notFound=s(l.params.notFound):l.notFound=l.pageContainer.length>0?l.pageContainer.find(".searchbar-not-found"):s(".searchbar-not-found");for(var c=[{base:"A",letters:"AⒶＡÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷＢḂḄḆɃƂƁ"},{base:"C",letters:"CⒸＣĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹＤḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"ǱǄ"},{base:"Dz",letters:"ǲǅ"},{base:"E",letters:"EⒺＥÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻＦḞƑꝻ"},{base:"G",letters:"GⒼＧǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽＨĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾＩÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿＪĴɈ"},{base:"K",letters:"KⓀＫḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁＬĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"Ǉ"},{base:"Lj",letters:"ǈ"},{base:"M",letters:"MⓂＭḾṀṂⱮƜ"},{base:"N",letters:"NⓃＮǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"Ǌ"},{base:"Nj",letters:"ǋ"},{base:"O",letters:"OⓄＯÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"OE",letters:"Œ"},{base:"oe",letters:"œ"},{base:"P",letters:"PⓅＰṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆＱꝖꝘɊ"},{base:"R",letters:"RⓇＲŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈＳẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉＴṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊＵÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋＶṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌＷẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍＸẊẌ"},{base:"Y",letters:"YⓎＹỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏＺŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐａẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑｂḃḅḇƀƃɓ"},{base:"c",letters:"cⓒｃćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓｄḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"ǳǆ"},{base:"e",letters:"eⓔｅèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕｆḟƒꝼ"},{base:"g",letters:"gⓖｇǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗｈĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘｉìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙｊĵǰɉ"},{base:"k",letters:"kⓚｋḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛｌŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"ǉ"},{base:"m",letters:"mⓜｍḿṁṃɱɯ"},{base:"n",letters:"nⓝｎǹńñṅňṇņṋṉƞɲŉꞑꞥ"},{base:"nj",letters:"ǌ"},{base:"o",letters:"oⓞｏòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟｐṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠｑɋꝗꝙ"},{base:"r",letters:"rⓡｒŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢｓßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣｔṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤｕùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥｖṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦｗẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧｘẋẍ"},{base:"y",letters:"yⓨｙỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩｚźẑżžẓẕƶȥɀⱬꝣ"}],p={},d=0;d<c.length;d++)for(var f=c[d].letters,u=0;u<f.length;u++)p[f[u]]=c[d].base;var h=i.rtl?"margin-left":"margin-right",m=!1;l.setCancelButtonMargin=function(){l.cancelButton.transition(0).show(),l.cancelButton.css(h,-l.cancelButton[0].offsetWidth+"px");l.cancelButton[0].clientLeft;l.cancelButton.transition(""),m=!0},l.triggerEvent=function(e,a,t){l.container.trigger(e,t),l.searchList.length>0&&l.searchList.trigger(e,t),a&&l.params[a]&&l.params[a](l,t)},l.enable=function(e){function a(){!l.searchList.length&&!l.params.customSearch||l.container.hasClass("searchbar-active")||l.query||l.overlay.addClass("searchbar-overlay-active"),l.container.addClass("searchbar-active"),l.cancelButton.length>0&&!l.material&&(m||l.setCancelButtonMargin(),l.cancelButton.css(h,"0px")),l.triggerEvent("enableSearch","onEnable"),l.active=!0}i.device.ios&&!i.params.material&&e&&"focus"===e.type?setTimeout(function(){a()},400):a()},l.disable=function(){function e(){l.input.blur()}l.input.val("").trigger("change"),l.container.removeClass("searchbar-active searchbar-not-empty"),l.cancelButton.length>0&&!l.material&&l.cancelButton.css(h,-l.cancelButton[0].offsetWidth+"px"),
(l.searchList.length||l.params.customSearch)&&l.overlay.removeClass("searchbar-overlay-active"),l.active=!1,i.device.ios?setTimeout(function(){e()},400):e(),l.triggerEvent("disableSearch","onDisable")},l.clear=function(e){return!l.query&&e&&s(e.target).hasClass("searchbar-clear")?void l.disable():(l.input.val("").trigger("change").focus(),void l.triggerEvent("clearSearch","onClear"))},l.handleInput=function(){setTimeout(function(){var e=l.input.val().trim();(l.searchList.length>0||l.params.customSearch)&&(l.params.searchIn||l.isVirtualList)&&l.search(e,!0)},0)};var g,v="";return l.search=function(e,a){if(e.trim()!==v){if(v=e.trim(),a||(l.active||l.enable(),l.input.val(e)),l.query=l.value=e,0===e.length?(l.container.removeClass("searchbar-not-empty"),l.searchList.length&&l.container.hasClass("searchbar-active")&&l.overlay.addClass("searchbar-overlay-active")):(l.container.addClass("searchbar-not-empty"),l.searchList.length&&l.container.hasClass("searchbar-active")&&l.overlay.removeClass("searchbar-overlay-active")),l.params.customSearch)return void l.triggerEvent("search","onSearch",{query:e});var n=[];if(l.isVirtualList){if(g=l.searchList[0].f7VirtualList,""===e.trim())return g.resetFilter(),l.notFound.hide(),void l.found.show();if(g.params.searchAll)n=g.params.searchAll(e,g.items)||[];else if(g.params.searchByItem)for(var r=0;r<g.items.length;r++)g.params.searchByItem(e,r,g.params.items[r])&&n.push(r)}else{var i;i=l.params.removeDiacritics?t(e.trim().toLowerCase()).split(" "):e.trim().toLowerCase().split(" "),l.searchList.find("li").removeClass("hidden-by-searchbar").each(function(e,a){a=s(a);var r=[];a.find(l.params.searchIn).each(function(){var e=s(this).text().trim().toLowerCase();l.params.removeDiacritics&&(e=t(e)),r.push(e)}),r=r.join(" ");for(var o=0,c=0;c<i.length;c++)r.indexOf(i[c])>=0&&o++;o===i.length||l.params.ignore&&a.is(l.params.ignore)?n.push(a[0]):a.addClass("hidden-by-searchbar")}),l.params.hideDividers&&l.searchList.find(".item-divider, .list-group-title").each(function(){for(var e=s(this),a=e.nextAll("li"),t=!0,n=0;n<a.length;n++){var r=s(a[n]);if(r.hasClass("list-group-title")||r.hasClass("item-divider"))break;r.hasClass("hidden-by-searchbar")||(t=!1)}var i=l.params.ignore&&e.is(l.params.ignore);t&&!i?e.addClass("hidden-by-searchbar"):e.removeClass("hidden-by-searchbar")}),l.params.hideGroups&&l.searchList.find(".list-group").each(function(){var e=s(this),a=l.params.ignore&&e.is(l.params.ignore),t=e.find("li:not(.hidden-by-searchbar)");0!==t.length||a?e.removeClass("hidden-by-searchbar"):e.addClass("hidden-by-searchbar")})}l.triggerEvent("search","onSearch",{query:e,foundItems:n}),0===n.length?(l.notFound.show(),l.found.hide()):(l.notFound.hide(),l.found.show()),l.isVirtualList&&g.filterItems(n)}},l.attachEvents=function(e){var a=e?"off":"on";l.container[a]("submit",n),l.material||l.cancelButton[a]("click",l.disable),l.overlay[a]("click",l.disable),l.input[a]("focus",l.enable),l.input[a]("change keydown keypress keyup",l.handleInput),l.clearButton[a]("click",l.clear)},l.detachEvents=function(){l.attachEvents(!0)},l.init=function(){l.attachEvents()},l.destroy=function(){l&&(l.detachEvents(),l=null)},l.init(),l.container[0].f7Searchbar=l,l};i.searchbar=function(e,a){return new f(e,a)},i.initSearchbar=function(e){function a(){n&&n.destroy()}e=s(e);var t=e.hasClass("searchbar")?e:e.find(".searchbar");if(0!==t.length&&t.hasClass("searchbar-init")){var n=i.searchbar(t,t.dataset());e.hasClass("page")?e.once("pageBeforeRemove",a):e.hasClass("navbar-inner")&&e.once("navbarBeforeRemove",a)}};var u=document.createElement("div");i.modalStack=[],i.modalStackClearQueue=function(){i.modalStack.length&&i.modalStack.shift()()},i.modal=function(e){e=e||{};var a="";if(i.params.modalTemplate)i._compiledTemplates.modal||(i._compiledTemplates.modal=l.compile(i.params.modalTemplate)),a=i._compiledTemplates.modal(e);else{var t="";if(e.buttons&&e.buttons.length>0)for(var n=0;n<e.buttons.length;n++)t+='<span class="modal-button'+(e.buttons[n].bold?" modal-button-bold":"")+'">'+e.buttons[n].text+"</span>";var r=e.title?'<div class="modal-title">'+e.title+"</div>":"",o=e.text?'<div class="modal-text">'+e.text+"</div>":"",c=e.afterText?e.afterText:"",p=e.buttons&&0!==e.buttons.length?"":"modal-no-buttons",d=e.verticalButtons?"modal-buttons-vertical":"",f=e.buttons&&e.buttons.length>0?'<div class="modal-buttons modal-buttons-'+e.buttons.length+" "+d+'">'+t+"</div>":"";a='<div class="modal '+p+" "+(e.cssClass||"")+'"><div class="modal-inner">'+(r+o+c)+"</div>"+f+"</div>"}u.innerHTML=a;var h=s(u).children();return s("body").append(h[0]),h.find(".modal-button").each(function(a,t){s(t).on("click",function(t){e.buttons[a].close!==!1&&i.closeModal(h),e.buttons[a].onClick&&e.buttons[a].onClick(h,t),e.onClick&&e.onClick(h,a)})}),i.openModal(h),h[0]},i.alert=function(e,a,t){return"function"==typeof a&&(t=arguments[1],a=void 0),i.modal({text:e||"",title:"undefined"==typeof a?i.params.modalTitle:a,buttons:[{text:i.params.modalButtonOk,bold:!0,onClick:t}]})},i.confirm=function(e,a,t,n){return"function"==typeof a&&(n=arguments[2],t=arguments[1],a=void 0),i.modal({text:e||"",title:"undefined"==typeof a?i.params.modalTitle:a,buttons:[{text:i.params.modalButtonCancel,onClick:n},{text:i.params.modalButtonOk,bold:!0,onClick:t}]})},i.prompt=function(e,a,t,n){return"function"==typeof a&&(n=arguments[2],t=arguments[1],a=void 0),i.modal({text:e||"",title:"undefined"==typeof a?i.params.modalTitle:a,afterText:'<div class="input-field"><input type="text" class="modal-text-input"></div>',buttons:[{text:i.params.modalButtonCancel},{text:i.params.modalButtonOk,bold:!0}],onClick:function(e,a){0===a&&n&&n(s(e).find(".modal-text-input").val()),1===a&&t&&t(s(e).find(".modal-text-input").val())}})},i.modalLogin=function(e,a,t,n){return"function"==typeof a&&(n=arguments[2],t=arguments[1],a=void 0),i.modal({text:e||"",title:"undefined"==typeof a?i.params.modalTitle:a,afterText:'<div class="input-field modal-input-double"><input type="text" name="modal-username" placeholder="'+i.params.modalUsernamePlaceholder+'" class="modal-text-input"></div><div class="input-field modal-input-double"><input type="password" name="modal-password" placeholder="'+i.params.modalPasswordPlaceholder+'" class="modal-text-input"></div>',buttons:[{text:i.params.modalButtonCancel},{text:i.params.modalButtonOk,bold:!0}],onClick:function(e,a){var r=s(e).find('.modal-text-input[name="modal-username"]').val(),i=s(e).find('.modal-text-input[name="modal-password"]').val();0===a&&n&&n(r,i),1===a&&t&&t(r,i)}})},i.modalPassword=function(e,a,t,n){return"function"==typeof a&&(n=arguments[2],t=arguments[1],a=void 0),i.modal({text:e||"",title:"undefined"==typeof a?i.params.modalTitle:a,afterText:'<div class="input-field"><input type="password" name="modal-password" placeholder="'+i.params.modalPasswordPlaceholder+'" class="modal-text-input"></div>',buttons:[{text:i.params.modalButtonCancel},{text:i.params.modalButtonOk,bold:!0}],onClick:function(e,a){var r=s(e).find('.modal-text-input[name="modal-password"]').val();0===a&&n&&n(r),1===a&&t&&t(r)}})},i.showPreloader=function(e){return i.modal({title:e||i.params.modalPreloaderTitle,text:'<div class="preloader">'+(i.params.material?i.params.materialPreloaderHtml:"")+"</div>",cssClass:"modal-preloader"})},i.hidePreloader=function(){i.closeModal(".modal.modal-in")},i.showIndicator=function(){s("body").append('<div class="preloader-indicator-overlay"></div><div class="preloader-indicator-modal"><span class="preloader preloader-white">'+(i.params.material?i.params.materialPreloaderHtml:"")+"</span></div>")},i.hideIndicator=function(){s(".preloader-indicator-overlay, .preloader-indicator-modal").remove()},i.actions=function(e,a){var t,n,r,o=!1;1===arguments.length?a=e:i.device.ios?i.device.ipad&&(o=!0):s(window).width()>=768&&(o=!0),a=a||[],a.length>0&&!s.isArray(a[0])&&(a=[a]);var c;if(o){var p=i.params.modalActionsToPopoverTemplate||'<div class="popover actions-popover"><div class="popover-inner">{{#each this}}<div class="list-block"><ul>{{#each this}}{{#if label}}<li class="actions-popover-label {{#if color}}color-{{color}}{{/if}} {{#if bold}}actions-popover-bold{{/if}}">{{text}}</li>{{else}}<li><a href="#" class="item-link list-button {{#if color}}color-{{color}}{{/if}} {{#if bg}}bg-{{bg}}{{/if}} {{#if bold}}actions-popover-bold{{/if}} {{#if disabled}}disabled{{/if}}">{{text}}</a></li>{{/if}}{{/each}}</ul></div>{{/each}}</div></div>';i._compiledTemplates.actionsToPopover||(i._compiledTemplates.actionsToPopover=l.compile(p));var d=i._compiledTemplates.actionsToPopover(a);t=s(i.popover(d,e,!0)),n=".list-block ul",r=".list-button"}else{if(i.params.modalActionsTemplate)i._compiledTemplates.actions||(i._compiledTemplates.actions=l.compile(i.params.modalActionsTemplate)),c=i._compiledTemplates.actions(a);else{for(var f="",h=0;h<a.length;h++)for(var m=0;m<a[h].length;m++){0===m&&(f+='<div class="actions-modal-group">');var g=a[h][m],v=g.label?"actions-modal-label":"actions-modal-button";g.bold&&(v+=" actions-modal-button-bold"),g.color&&(v+=" color-"+g.color),g.bg&&(v+=" bg-"+g.bg),g.disabled&&(v+=" disabled"),f+='<div class="'+v+'">'+g.text+"</div>",m===a[h].length-1&&(f+="</div>")}c='<div class="actions-modal">'+f+"</div>"}u.innerHTML=c,t=s(u).children(),s("body").append(t[0]),n=".actions-modal-group",r=".actions-modal-button"}var b=t.find(n);return b.each(function(e,n){var l=e;s(n).children().each(function(e,n){var c,p=e,d=a[l][p];!o&&s(n).is(r)&&(c=s(n)),o&&s(n).find(r).length>0&&(c=s(n).find(r)),c&&c.on("click",function(e){d.close!==!1&&i.closeModal(t),d.onClick&&d.onClick(t,e)})})}),o||i.openModal(t),t[0]},i.popover=function(e,a,t){function n(){e.css({left:"",top:""});var t,n,r,i=e.width(),l=e.height(),c=0;o?e.removeClass("popover-on-left popover-on-right popover-on-top popover-on-bottom").css({left:"",top:""}):(t=e.find(".popover-angle"),c=t.width()/2,t.removeClass("on-left on-right on-top on-bottom").css({left:"",top:""}));var p=a.outerWidth(),d=a.outerHeight(),f=a.offset(),u=a.parents(".page");u.length>0&&(f.top=f.top-u[0].scrollTop);var h=s(window).height(),m=s(window).width(),g=0,v=0,b=0,C=o?"bottom":"top";if(o){if(l<h-f.top-d?(C="bottom",g=f.top):l<f.top?(g=f.top-l+d,C="top"):(C="bottom",g=f.top),g<=0?g=8:g+l>=h&&(g=h-l-8),v=f.left,v+i>=m-8&&(v=f.left+p-i-8),v<8&&(v=8),"top"===C&&e.addClass("popover-on-top"),"bottom"===C&&e.addClass("popover-on-bottom"),a.hasClass("floating-button-to-popover")&&!e.hasClass("modal-in")){e.addClass("popover-floating-button");var y=v+i/2-(f.left+p/2),w=g+l/2-(f.top+d/2);a.addClass("floating-button-to-popover-in").transform("translate3d("+y+"px, "+w+"px,0)").transitionEnd(function(e){a.hasClass("floating-button-to-popover-in")&&a.addClass("floating-button-to-popover-scale").transform("translate3d("+y+"px, "+w+"px,0) scale("+i/p+", "+l/d+")")}),e.once("close",function(){a.removeClass("floating-button-to-popover-in floating-button-to-popover-scale").addClass("floating-button-to-popover-out").transform("").transitionEnd(function(e){a.removeClass("floating-button-to-popover-out")})}),e.once("closed",function(){e.removeClass("popover-floating-button")})}}else l+c<f.top?g=f.top-l-c:l+c<h-f.top-d?(C="bottom",g=f.top+d+c):(C="middle",g=d/2+f.top-l/2,b=g,g<=0?g=5:g+l>=h&&(g=h-l-5),b-=g),"top"===C||"bottom"===C?(v=p/2+f.left-i/2,b=v,v<5&&(v=5),v+i>m&&(v=m-i-5),"top"===C&&t.addClass("on-bottom"),"bottom"===C&&t.addClass("on-top"),b-=v,n=i/2-c+b,n=Math.max(Math.min(n,i-2*c-13),13),t.css({left:n+"px"})):"middle"===C&&(v=f.left-i-c,t.addClass("on-right"),(v<5||v+i>m)&&(v<5&&(v=f.left+p+c),v+i>m&&(v=m-i-5),t.removeClass("on-right").addClass("on-left")),r=l/2-c+b,r=Math.max(Math.min(r,l-2*c-13),13),t.css({top:r+"px"}));e.css({top:g+"px",left:v+"px"})}if("undefined"==typeof t&&(t=!0),"string"==typeof e&&e.indexOf("<")>=0){var r=document.createElement("div");if(r.innerHTML=e.trim(),!(r.childNodes.length>0))return!1;e=r.childNodes[0],t&&e.classList.add("remove-on-close"),s("body").append(e)}if(e=s(e),a=s(a),0===e.length||0===a.length)return!1;0===e.parents("body").length&&(t&&e.addClass("remove-on-close"),s("body").append(e[0])),0!==e.find(".popover-angle").length||i.params.material||e.append('<div class="popover-angle"></div>'),e.show();var o=i.params.material;return n(),s(window).on("resize",n),e.on("close",function(){s(window).off("resize",n)}),i.openModal(e),e[0]},i.popup=function(e,a){if("undefined"==typeof a&&(a=!0),"string"==typeof e&&e.indexOf("<")>=0){var t=document.createElement("div");if(t.innerHTML=e.trim(),!(t.childNodes.length>0))return!1;e=t.childNodes[0],a&&e.classList.add("remove-on-close"),s("body").append(e)}return e=s(e),0!==e.length&&(0===e.parents("body").length&&(a&&e.addClass("remove-on-close"),s("body").append(e[0])),e.show(),i.openModal(e),e[0])},i.pickerModal=function(e,a){if("undefined"==typeof a&&(a=!0),"string"==typeof e&&e.indexOf("<")>=0){if(e=s(e),!(e.length>0))return!1;a&&e.addClass("remove-on-close"),s("body").append(e[0])}return e=s(e),0!==e.length&&(0===e.parents("body").length&&(a&&e.addClass("remove-on-close"),s("body").append(e[0])),s(".picker-modal.modal-in:not(.modal-out)").length>0&&!e.hasClass("modal-in")&&i.closeModal(".picker-modal.modal-in:not(.modal-out)"),e.show(),i.openModal(e),e[0])},i.loginScreen=function(e){return e||(e=".login-screen"),e=s(e),0!==e.length&&(s(".login-screen.modal-in:not(.modal-out)").length>0&&!e.hasClass("modal-in")&&i.closeModal(".login-screen.modal-in:not(.modal-out)"),e.show(),i.openModal(e),e[0])},i.openModal=function(e){e=s(e);var a=e.hasClass("modal");if(s(".modal.modal-in:not(.modal-out)").length&&i.params.modalStack&&a)return void i.modalStack.push(function(){i.openModal(e)});if(!0!==e.data("f7-modal-shown")){e.data("f7-modal-shown",!0),e.once("close",function(){e.removeData("f7-modal-shown")});var t=(e.hasClass("popover"),e.hasClass("popup")),n=e.hasClass("login-screen"),r=e.hasClass("picker-modal");a&&(e.show(),e.css({marginTop:-Math.round(e.outerHeight()/2)+"px"}));var o;n||r||(0!==s(".modal-overlay").length||t||s("body").append('<div class="modal-overlay"></div>'),0===s(".popup-overlay").length&&t&&s("body").append('<div class="popup-overlay"></div>'),o=s(t?".popup-overlay":".modal-overlay")),i.params.material&&r&&e.hasClass("picker-calendar")&&(0!==s(".picker-modal-overlay").length||t||s("body").append('<div class="picker-modal-overlay"></div>'),o=s(".picker-modal-overlay"));e[0].clientLeft;return e.trigger("open"),r&&s("body").addClass("with-picker-modal"),e.find("."+i.params.viewClass).length>0&&(e.find(".page").each(function(){i.initPageWithCallback(this)}),e.find(".navbar").each(function(){i.initNavbarWithCallback(this)})),n||r||o.addClass("modal-overlay-visible"),i.params.material&&r&&o&&o.addClass("modal-overlay-visible"),e.removeClass("modal-out").addClass("modal-in").transitionEnd(function(a){e.hasClass("modal-out")?e.trigger("closed"):e.trigger("opened")}),!0}},i.closeModal=function(e){if(e=s(e||".modal-in"),"undefined"==typeof e||0!==e.length){var a,t=e.hasClass("modal"),n=e.hasClass("popover"),r=e.hasClass("popup"),o=e.hasClass("login-screen"),l=e.hasClass("picker-modal"),c=e.hasClass("remove-on-close");return r?a=s(".popup-overlay"):l&&i.params.material?a=s(".picker-modal-overlay"):l||(a=s(".modal-overlay")),r?e.length===s(".popup.modal-in").length&&a.removeClass("modal-overlay-visible"):a&&a.length>0&&a.removeClass("modal-overlay-visible"),e.trigger("close"),l&&(s("body").removeClass("with-picker-modal"),s("body").addClass("picker-modal-closing")),!n||i.params.material?(e.removeClass("modal-in").addClass("modal-out").transitionEnd(function(a){if(e.hasClass("modal-out"))e.trigger("closed");else if(e.trigger("opened"),n)return;l&&s("body").removeClass("picker-modal-closing"),r||o||l||n?(e.removeClass("modal-out").hide(),c&&e.length>0&&e.remove()):e.remove()}),t&&i.params.modalStack&&i.modalStackClearQueue()):(e.removeClass("modal-in modal-out").trigger("closed").hide(),c&&e.remove()),!0}},i.materialTabbarSetHighlight=function(e,a){e=s(e),a=a||e.find(".tab-link.active");var t,n;e.hasClass("tabbar-scrollable")?(t=a[0].offsetWidth+"px",n=(i.rtl?-a[0].offsetLeft:a[0].offsetLeft)+"px"):(t=1/e.find(".tab-link").length*100+"%",n=100*(i.rtl?-a.index():a.index())+"%"),e.find(".tab-link-highlight").css({width:t}).transform("translate3d("+n+",0,0)")},i.initPageMaterialTabbar=function(e){function a(){i.materialTabbarSetHighlight(t)}e=s(e);var t=s(e).find(".tabbar");t.length>0&&(0===t.find(".tab-link-highlight").length&&t.find(".toolbar-inner").append('<span class="tab-link-highlight"></span>'),a(),s(window).on("resize",a),e.once("pageBeforeRemove",function(){s(window).off("resize",a)}))},i.showTab=function(e,a,t){var n=s(e);if(2===arguments.length&&"boolean"==typeof a&&(t=a),0===n.length)return!1;if(n.hasClass("active"))return t&&n.trigger("show"),!1;var r=n.parent(".tabs");if(0===r.length)return!1;i.allowSwipeout=!0;var o=r.parent().hasClass("tabs-animated-wrap");if(o){var l=100*(i.rtl?n.index():-n.index());r.transform("translate3d("+l+"%,0,0)")}var c,p=r.parent().hasClass("tabs-swipeable-wrap");p&&(c=r.parent()[0].swiper,c.activeIndex!==n.index()&&c.slideTo(n.index(),void 0,!1));var d=r.children(".tab.active").removeClass("active").trigger("hide");if(n.addClass("active"),n.trigger("show"),!o&&!p&&n.find(".navbar").length>0){var f;f=n.hasClass(i.params.viewClass)?n[0]:n.parents("."+i.params.viewClass)[0],i.sizeNavbars(f)}if(a?a=s(a):(a=s("string"==typeof e?'.tab-link[href="'+e+'"]':'.tab-link[href="#'+n.attr("id")+'"]'),(!a||a&&0===a.length)&&s("[data-tab]").each(function(){n.is(s(this).attr("data-tab"))&&(a=s(this))})),0!==a.length){var u;if(d&&d.length>0){var h=d.attr("id");h&&(u=s('.tab-link[href="#'+h+'"]')),(!u||u&&0===u.length)&&s("[data-tab]").each(function(){d.is(s(this).attr("data-tab"))&&(u=s(this))})}if(a&&a.length>0&&(a.addClass("active"),i.params.material)){var m=a.parents(".tabbar");m.length>0&&(0===m.find(".tab-link-highlight").length&&m.find(".toolbar-inner").append('<span class="tab-link-highlight"></span>'),i.materialTabbarSetHighlight(m,a))}return u&&u.length>0&&u.removeClass("active"),!0}},i.initSmartSelects=function(e){e=s(e);var a;a=e.is(".smart-select")?e:e.find(".smart-select"),0!==a.length&&a.each(function(){var e=s(this),a=e.find("select");if(0!==a.length){var t=a[0];if(0!==t.length){for(var n=[],r=0;r<t.length;r++)t[r].selected&&n.push(t[r].textContent.trim());var i=e.find(".item-after");if(0===i.length)e.find(".item-inner").append('<div class="item-after">'+n.join(", ")+"</div>");else{var o=i.text();if(i.hasClass("smart-select-value"))for(r=0;r<t.length;r++)t[r].selected=t[r].textContent.trim()===o.trim();else i.text(n.join(", "))}}}})},i.smartSelectAddOption=function(e,a,t){e=s(e);var n=e.parents(".smart-select");"undefined"==typeof t?e.append(a):s(a).insertBefore(e.find("option").eq(t)),i.initSmartSelects(n);var r=n.find("select").attr("name"),o=s('.page.smart-select-page[data-select-name="'+r+'"]').length>0;o&&i.smartSelectOpen(n,!0)},i.smartSelectOpen=function(e,a){function t(){var a=e.parents(".page-content");if(0!==a.length){var t,n=parseInt(a.css("padding-top"),10),r=parseInt(a.css("padding-bottom"),10),i=a[0].offsetHeight-n-ie.height(),o=a[0].scrollHeight-n-ie.height(),s=e.offset().top-n+e[0].offsetHeight;if(s>i){var l=a.scrollTop()+s-i;l+i>o&&(t=l+i-o+r,i===o&&(t=ie.height()),a.css({"padding-bottom":t+"px"})),a.scrollTop(l,300)}}}function n(a){var t=!0;(a.target===e[0]||s(a.target).parents(e[0]).length>0)&&(t=!1),s(a.target).parents(".picker-modal").length>0&&(t=!1),t&&i.closeModal(".smart-select-picker.modal-in")}function r(e){T.selectedOptions.length>=j?e.find('input[type="checkbox"]').each(function(){this.checked?s(this).parents("li").removeClass("disabled"):s(this).parents("li").addClass("disabled")}):e.find(".disabled").removeClass("disabled")}function o(a){if(a=s(a),y){var t=i.virtualList(a.find(".virtual-list"),{items:z,template:_,height:w||void 0,searchByItem:function(e,a,t){return t.text.toLowerCase().indexOf(e.trim().toLowerCase())>=0}});a.once("popup"===d||"picker"===d?"closed":"pageBeforeRemove",function(){t&&t.destroy&&t.destroy()})}j&&r(a),a.on("change",'input[name="'+F+'"]',function(){var t=this,n=t.value,o=[];if("checkbox"===t.type){for(var s=0;s<T.options.length;s++){var l=T.options[s];l.value===n&&(l.selected=t.checked),l.selected&&o.push(l.textContent.trim())}j&&r(a)}else o=[e.find('option[value="'+n+'"]').text()],T.value=n;P.trigger("change"),e.find(".item-after").text(o.join(", ")),g&&"radio"===q&&("popup"===d?i.closeModal(re):"picker"===d?i.closeModal(ie):p.router.back())})}function c(e){var a=e.detail.page;a.name===te&&o(a.container)}if(e=s(e),0!==e.length){var p=e.parents("."+i.params.viewClass);if(0!==p.length){p=p[0].f7View;var d=e.attr("data-open-in")||i.params.smartSelectOpenIn;if("popup"===d){if(s(".popup.smart-select-popup").length>0)return}else if("picker"===d){if(s(".picker-modal.modal-in").length>0&&!a){if(e[0].f7SmartSelectPicker===s(".picker-modal.modal-in:not(.modal-out)")[0])return;i.closeModal(s(".picker-modal.modal-in:not(.modal-out)"))}}else if(!p)return;var f,u=e.dataset(),h=u.pageTitle||e.find(".item-title").text(),m=u.backText||i.params.smartSelectBackText;f="picker"===d?u.pickerCloseText||u.backText||i.params.smartSelectPickerCloseText:u.popupCloseText||u.backText||i.params.smartSelectPopupCloseText;var g=void 0!==u.backOnSelect?u.backOnSelect:i.params.smartSelectBackOnSelect,v=u.formTheme||i.params.smartSelectFormTheme,b=u.navbarTheme||i.params.smartSelectNavbarTheme,C=u.toolbarTheme||i.params.smartSelectToolbarTheme,y=u.virtualList,w=u.virtualListHeight,k=i.params.material,x=u.pickerHeight||i.params.smartSelectPickerHeight,T=e.find("select")[0],P=s(T),S=P.dataset();if(!(T.disabled||e.hasClass("disabled")||P.hasClass("disabled"))){for(var O,D,M,N,E,L,B,A,I,H,R,z=[],V=(new Date).getTime(),q=T.multiple?"checkbox":"radio",F=q+"-"+V,j=P.attr("maxlength"),Y=T.name,W=0;W<T.length;W++)O=s(T[W]),R=O.dataset(),M=R.optionImage||S.optionImage||u.optionImage,N=R.optionIcon||S.optionIcon||u.optionIcon,D=M||N||"checkbox"===q,k&&(D=M||N),I=R.optionColor,H=R.optionClass,O[0].disabled&&(H+=" disabled"),E=O.parent("optgroup")[0],L=E&&E.label,B=!1,E&&E!==A&&(B=!0,A=E,z.push({groupLabel:L,isLabel:B})),z.push({value:O[0].value,text:O[0].textContent.trim(),selected:O[0].selected,group:E,groupLabel:L,image:M,icon:N,color:I,className:H,disabled:O[0].disabled,inputType:q,id:V,hasMedia:D,checkbox:"checkbox"===q,inputName:F,material:i.params.material});i._compiledTemplates.smartSelectItem||(i._compiledTemplates.smartSelectItem=l.compile(i.params.smartSelectItemTemplate||'{{#if isLabel}}<li class="item-divider">{{groupLabel}}</li>{{else}}<li{{#if className}} class="{{className}}"{{/if}}><label class="label-{{inputType}} item-content"><input type="{{inputType}}" name="{{inputName}}" value="{{value}}" {{#if selected}}checked{{/if}}>{{#if material}}{{#if hasMedia}}<div class="item-media">{{#if icon}}<i class="icon {{icon}}"></i>{{/if}}{{#if image}}<img src="{{image}}">{{/if}}</div><div class="item-inner"><div class="item-title{{#if color}} color-{{color}}{{/if}}">{{text}}</div></div><div class="item-after"><i class="icon icon-form-{{inputType}}"></i></div>{{else}}<div class="item-media"><i class="icon icon-form-{{inputType}}"></i></div><div class="item-inner"><div class="item-title{{#if color}} color-{{color}}{{/if}}">{{text}}</div></div>{{/if}}{{else}}{{#if hasMedia}}<div class="item-media">{{#if checkbox}}<i class="icon icon-form-checkbox"></i>{{/if}}{{#if icon}}<i class="icon {{icon}}"></i>{{/if}}{{#if image}}<img src="{{image}}">{{/if}}</div>{{/if}}<div class="item-inner"><div class="item-title{{#if color}} color-{{color}}{{/if}}">{{text}}</div></div>{{/if}}</label></li>{{/if}}'));var _=i._compiledTemplates.smartSelectItem,U="";if(!y)for(var X=0;X<z.length;X++)U+=_(z[X]);var J,G,Q="",K="",$="",Z="";"picker"===d?(i._compiledTemplates.smartSelectToolbar||(i._compiledTemplates.smartSelectToolbar=l.compile(i.params.smartSelectToolbarTemplate||'<div class="toolbar {{#if toolbarTheme}}theme-{{toolbarTheme}}{{/if}}"><div class="toolbar-inner"><div class="left"></div><div class="right"><a href="#" class="link close-picker"><span>{{closeText}}</span></a></div></div></div>')),Q=i._compiledTemplates.smartSelectToolbar({pageTitle:h,closeText:f,openIn:d,toolbarTheme:C,inPicker:"picker"===d})):(i._compiledTemplates.smartSelectNavbar||(i._compiledTemplates.smartSelectNavbar=l.compile(i.params.smartSelectNavbarTemplate||'<div class="navbar {{#if navbarTheme}}theme-{{navbarTheme}}{{/if}}"><div class="navbar-inner">{{leftTemplate}}<div class="center sliding">{{pageTitle}}</div></div></div>')),J=i._compiledTemplates.smartSelectNavbar({pageTitle:h,backText:m,closeText:f,openIn:d,navbarTheme:b,inPopup:"popup"===d,inPage:"page"===d,leftTemplate:"popup"===d?(i.params.smartSelectPopupCloseTemplate||(k?'<div class="left"><a href="#" class="link close-popup icon-only"><i class="icon icon-back"></i></a></div>':'<div class="left"><a href="#" class="link close-popup"><i class="icon icon-back"></i><span>{{closeText}}</span></a></div>')).replace(/{{closeText}}/g,f):(i.params.smartSelectBackTemplate||(k?'<div class="left"><a href="#" class="back link icon-only"><i class="icon icon-back"></i></a></div>':'<div class="left sliding"><a href="#" class="back link"><i class="icon icon-back"></i><span>{{backText}}</span></a></div>')).replace(/{{backText}}/g,m)}),"page"===d?(G="static",e.parents(".navbar-through").length>0&&(G="through"),e.parents(".navbar-fixed").length>0&&(G="fixed"),$=e.parents(".page").hasClass("no-toolbar")?"no-toolbar":"",K=e.parents(".page").hasClass("no-navbar")?"no-navbar":"navbar-"+G,Z=e.parents(".page").hasClass("no-tabbar")?"no-tabbar":""):G="fixed");var ee,ae,te="smart-select-"+F,ne="undefined"==typeof e.data("searchbar")?i.params.smartSelectSearchbar:"true"===e.data("searchbar");ne&&(ee=e.data("searchbar-placeholder")||"Search",ae=e.data("searchbar-cancel")||"Cancel");var re,ie,oe='<form class="searchbar searchbar-init" data-search-list=".smart-select-list-'+V+'" data-search-in=".item-title"><div class="searchbar-input"><input type="search" placeholder="'+ee+'"><a href="#" class="searchbar-clear"></a></div>'+(k?"":'<a href="#" class="searchbar-cancel">'+ae+"</a>")+'</form><div class="searchbar-overlay"></div>',se=("picker"!==d&&"through"===G?J:"")+'<div class="pages">  <div data-page="'+te+'" data-select-name="'+Y+'" class="page smart-select-page '+K+" "+$+" "+Z+'">'+("picker"!==d&&"fixed"===G?J:"")+(ne?oe:"")+'    <div class="page-content">'+("picker"!==d&&"static"===G?J:"")+'      <div class="list-block '+(y?"virtual-list":"")+" smart-select-list-"+V+" "+(v?"theme-"+v:"")+'">        <ul>'+(y?"":U)+"        </ul>      </div>    </div>  </div></div>";"popup"===d?(a?(re=s(".popup.smart-select-popup .view"),re.html(se)):(re=i.popup('<div class="popup smart-select-popup smart-select-popup-'+F+'"><div class="view navbar-fixed">'+se+"</div></div>"),re=s(re)),i.initPage(re.find(".page")),o(re)):"picker"===d?(a?(ie=s(".picker-modal.smart-select-picker .view"),ie.html(se)):(ie=i.pickerModal('<div class="picker-modal smart-select-picker smart-select-picker-'+F+'"'+(x?' style="height:'+x+'"':"")+">"+Q+'<div class="picker-modal-inner"><div class="view">'+se+"</div></div></div>"),ie=s(ie),t(),s("html").on("click",n),ie.once("close",function(){e[0].f7SmartSelectPicker=void 0,s("html").off("click",n),e.parents(".page-content").css({paddingBottom:""})}),e[0].f7SmartSelectPicker=ie[0]),i.initPage(ie.find(".page")),o(ie)):(s(document).once("pageInit",".smart-select-page",c),p.router.load({content:se,reload:!!a||void 0}))}}}},i.initPullToRefresh=function(e){function a(e){if(p){if("android"!==i.device.os)return;if("targetTouches"in e&&e.targetTouches.length>1)return}m=s(this),m.hasClass("refreshing")||(d=!1,w=!1,p=!0,f=void 0,b=void 0,"touchstart"===e.type&&(c=e.targetTouches[0].identifier),k.x="touchstart"===e.type?e.targetTouches[0].pageX:e.pageX,k.y="touchstart"===e.type?e.targetTouches[0].pageY:e.pageY,h=(new Date).getTime())}function t(e){if(p){var a,t,n;if("touchmove"===e.type){if(c&&e.touches)for(var r=0;r<e.touches.length;r++)e.touches[r].identifier===c&&(n=e.touches[r]);n||(n=e.targetTouches[0]),a=n.pageX,t=n.pageY}else a=e.pageX,t=e.pageY;if(a&&t){if("undefined"==typeof f&&(f=!!(f||Math.abs(t-k.y)>Math.abs(a-k.x))),!f)return void(p=!1);if(v=m[0].scrollTop,"undefined"==typeof b&&0!==v&&(b=!0),!d){if(m.removeClass("transitioning"),v>m[0].offsetHeight)return void(p=!1);y&&(C=m.attr("data-ptr-distance"),C.indexOf("%")>=0&&(C=m[0].offsetHeight*parseInt(C,10)/100)),P=m.hasClass("refreshing")?C:0,T=m[0].scrollHeight===m[0].offsetHeight||"ios"!==i.device.os}return d=!0,u=t-k.y,u>0&&v<=0||v<0?("ios"===i.device.os&&parseInt(i.device.osVersion.split(".")[0],10)>7&&0===v&&!b&&(T=!0),T&&(e.preventDefault(),g=Math.pow(u,.85)+P,m.transform("translate3d(0,"+g+"px,0)")),T&&Math.pow(u,.85)>C||!T&&u>=2*C?(x=!0,m.addClass("pull-up").removeClass("pull-down")):(x=!1,m.removeClass("pull-up").addClass("pull-down")),w||(m.trigger("pullstart"),w=!0),m.trigger("pullmove",{event:e,scrollTop:v,translate:g,touchesDiff:u}),void 0):(w=!1,m.removeClass("pull-up pull-down"),void(x=!1))}}}function n(e){if(!("touchend"===e.type&&e.changedTouches&&e.changedTouches.length>0&&c&&e.changedTouches[0].identifier!==c)){if(!p||!d)return p=!1,void(d=!1);g&&(m.addClass("transitioning"),g=0),m.transform(""),x?(m.addClass("refreshing"),m.trigger("refresh",{done:function(){i.pullToRefreshDone(m)}})):m.removeClass("pull-down"),p=!1,d=!1,w&&m.trigger("pullend")}}function r(){l.off(i.touchEvents.start,a),l.off(i.touchEvents.move,t),l.off(i.touchEvents.end,n)}function o(){r(),S.off("pageBeforeRemove",o)}var l=s(e);if(l.hasClass("pull-to-refresh-content")||(l=l.find(".pull-to-refresh-content")),l&&0!==l.length){var c,p,d,f,u,h,m,g,v,b,C,y,w,k={},x=!1,T=!1,P=0,S=l.hasClass("page")?l:l.parents(".page"),O=!1;(S.find(".navbar").length>0||S.parents(".navbar-fixed, .navbar-through").length>0||S.hasClass("navbar-fixed")||S.hasClass("navbar-through"))&&(O=!0),S.hasClass("no-navbar")&&(O=!1),O||l.addClass("pull-to-refresh-no-navbar"),m=l,m.attr("data-ptr-distance")?y=!0:C=44,l.on(i.touchEvents.start,a),l.on(i.touchEvents.move,t),l.on(i.touchEvents.end,n),0!==S.length&&(l[0].f7DestroyPullToRefresh=r,S.on("pageBeforeRemove",o))}},i.pullToRefreshDone=function(e){e=s(e),0===e.length&&(e=s(".pull-to-refresh-content.refreshing")),e.removeClass("refreshing").addClass("transitioning"),e.transitionEnd(function(){e.removeClass("transitioning pull-up pull-down"),e.trigger("refreshdone")})},i.pullToRefreshTrigger=function(e){e=s(e),0===e.length&&(e=s(".pull-to-refresh-content")),e.hasClass("refreshing")||(e.addClass("transitioning refreshing"),e.trigger("refresh",{done:function(){i.pullToRefreshDone(e)}}))},i.destroyPullToRefresh=function(e){e=s(e);var a=e.hasClass("pull-to-refresh-content")?e:e.find(".pull-to-refresh-content");0!==a.length&&a[0].f7DestroyPullToRefresh&&a[0].f7DestroyPullToRefresh()},i.attachInfiniteScroll=function(e){s(e).on("scroll",r)},i.detachInfiniteScroll=function(e){s(e).off("scroll",r)},i.initPageInfiniteScroll=function(e){function a(){i.detachInfiniteScroll(t),e.off("pageBeforeRemove",a)}e=s(e);var t=e.find(".infinite-scroll");0!==t.length&&(i.attachInfiniteScroll(t),e.on("pageBeforeRemove",a))},i.initPageScrollToolbars=function(e){function a(a){e.hasClass("page-on-left")||(u=t[0].scrollTop,v=t[0].scrollHeight,b=t[0].offsetHeight,C=u+b>=v-S,w=p.hasClass("navbar-hidden"),k=d.hasClass("toolbar-hidden"),x=c&&c.hasClass("toolbar-hidden"),C?i.params.showBarsOnPageScrollEnd&&(y="show"):y=f>u?i.params.showBarsOnPageScrollTop||u<=44?"show":"hide":u>44?"hide":"show","show"===y?(h&&n&&w&&(i.showNavbar(p),e.removeClass("no-navbar-by-scroll"),w=!1),m&&r&&k&&(i.showToolbar(d),e.removeClass("no-toolbar-by-scroll"),k=!1),g&&o&&x&&(i.showToolbar(c),e.removeClass("no-tabbar-by-scroll"),x=!1)):(h&&n&&!w&&(i.hideNavbar(p),e.addClass("no-navbar-by-scroll"),
w=!0),m&&r&&!k&&(i.hideToolbar(d),e.addClass("no-toolbar-by-scroll"),k=!0),g&&o&&!x&&(i.hideToolbar(c),e.addClass("no-tabbar-by-scroll"),x=!0)),f=u)}e=s(e);var t=e.find(".page-content");if(0!==t.length){var n=(i.params.hideNavbarOnPageScroll||t.hasClass("hide-navbar-on-scroll")||t.hasClass("hide-bars-on-scroll"))&&!(t.hasClass("keep-navbar-on-scroll")||t.hasClass("keep-bars-on-scroll")),r=(i.params.hideToolbarOnPageScroll||t.hasClass("hide-toolbar-on-scroll")||t.hasClass("hide-bars-on-scroll"))&&!(t.hasClass("keep-toolbar-on-scroll")||t.hasClass("keep-bars-on-scroll")),o=(i.params.hideTabbarOnPageScroll||t.hasClass("hide-tabbar-on-scroll"))&&!t.hasClass("keep-tabbar-on-scroll");if(n||r||o){var l=t.parents("."+i.params.viewClass);if(0!==l.length){var c,p=l.find(".navbar"),d=l.find(".toolbar");o&&(c=l.find(".tabbar"),0===c.length&&(c=l.parents("."+i.params.viewsClass).find(".tabbar")));var f,u,h=p.length>0,m=d.length>0,g=c&&c.length>0;f=u=t[0].scrollTop;var v,b,C,y,w,k,x,T=m&&r?d[0].offsetHeight:0,P=g&&o?c[0].offsetHeight:0,S=P||T;t.on("scroll",a),t[0].f7ScrollToolbarsHandler=a}}}},i.destroyScrollToolbars=function(e){e=s(e);var a=e.find(".page-content");if(0!==a.length){var t=a[0].f7ScrollToolbarsHandler;t&&a.off("scroll",a[0].f7ScrollToolbarsHandler)}},i.initFastClicks=function(){function e(e){var a,t=s(e),n=t.parents(i.params.activeStateElements);return t.is(i.params.activeStateElements)&&(a=t),n.length>0&&(a=a?a.add(n):n),a?a:t}function a(e){var a=e.parents(".page-content, .panel");return 0!==a.length&&("yes"!==a.prop("scrollHandlerSet")&&(a.on("scroll",function(){clearTimeout(z),clearTimeout(W)}),a.prop("scrollHandlerSet","yes")),!0)}function t(){R&&R.addClass("active-state")}function n(e){R&&(R.removeClass("active-state"),R=null)}function r(e){var a="input select textarea label".split(" ");return!!(e.nodeName&&a.indexOf(e.nodeName.toLowerCase())>=0)}function o(e){var a="button input textarea select".split(" ");return!(!document.activeElement||e===document.activeElement||document.activeElement===document.body)&&!(a.indexOf(e.nodeName.toLowerCase())>=0)}function l(e){var a=s(e);return("input"!==e.nodeName.toLowerCase()||"file"!==e.type)&&(!(a.hasClass("no-fastclick")||a.parents(".no-fastclick").length>0)&&(!i.params.fastClicksExclude||!a.is(i.params.fastClicksExclude)))}function c(e){if(document.activeElement===e)return!1;var a=e.nodeName.toLowerCase(),t="button checkbox file image radio submit".split(" ");return!e.disabled&&!e.readOnly&&("textarea"===a||("select"===a?!i.device.android:"input"===a&&t.indexOf(e.type)<0||void 0))}function p(e){e=s(e);var a=!0;return(e.is("label")||e.parents("label").length>0)&&(a=!i.device.android&&!(!i.device.ios||!e.is("input"))),a}function d(a){e(a.target).addClass("active-state"),"which"in a&&3===a.which&&setTimeout(function(){s(".active-state").removeClass("active-state")},0),i.params.material&&i.params.materialRipple&&(S=a.pageX,O=a.pageY,v(a.target,a.pageX,a.pageY))}function f(e){s(".active-state").removeClass("active-state"),i.params.material&&i.params.materialRipple&&b()}function u(e){s(".active-state").removeClass("active-state"),i.params.material&&i.params.materialRipple&&C()}function h(e){var a=i.params.materialRippleElements,t=s(e);if(t.is(a))return!t.hasClass("no-ripple")&&t;if(t.parents(a).length>0){var n=t.parents(a).eq(0);return!n.hasClass("no-ripple")&&n}return!1}function m(e,a,t){var n=t[0].getBoundingClientRect(),r={x:e-n.left,y:a-n.top},i=n.height,o=n.width,l=Math.max(Math.pow(Math.pow(i,2)+Math.pow(o,2),.5),48);F=s('<div class="ripple-wave" style="width: '+l+"px; height: "+l+"px; margin-top:-"+l/2+"px; margin-left:-"+l/2+"px; left:"+r.x+"px; top:"+r.y+'px;"></div>'),t.prepend(F);F[0].clientLeft;Y="translate3d("+(-r.x+o/2)+"px, "+(-r.y+i/2)+"px, 0) scale(1)",F.transform(Y)}function g(){if(F){var e=F,a=setTimeout(function(){e.remove()},400);F.addClass("ripple-wave-fill").transform(Y.replace("scale(1)","scale(1.01)")).transitionEnd(function(){clearTimeout(a);var e=s(this).addClass("ripple-wave-out").transform(Y.replace("scale(1)","scale(1.01)"));a=setTimeout(function(){e.remove()},700),setTimeout(function(){e.transitionEnd(function(){clearTimeout(a),s(this).remove()})},0)}),F=j=void 0}}function v(e,t,n){return j=h(e),j&&0!==j.length?void(a(j)?W=setTimeout(function(){m(S,O,j)},80):m(S,O,j)):void(j=void 0)}function b(){clearTimeout(W),g()}function C(){F?g():j&&!A?(clearTimeout(W),m(S,O,j),setTimeout(g,0)):g()}function y(e){var a=e.changedTouches[0],t=document.createEvent("MouseEvents"),n="click";i.device.android&&"select"===M.nodeName.toLowerCase()&&(n="mousedown"),t.initMouseEvent(n,!0,!0,window,1,a.screenX,a.screenY,a.clientX,a.clientY,!1,!1,!1,!1,0,null),t.forwardedTouchEvent=!0,M.dispatchEvent(t)}function w(r){if(A=!1,I=!1,r.targetTouches.length>1)return R&&n(),!0;if(r.touches.length>1&&R&&n(),i.params.tapHold&&(H&&clearTimeout(H),H=setTimeout(function(){r&&r.touches&&r.touches.length>1||(I=!0,r.preventDefault(),s(r.target).trigger("taphold"))},i.params.tapHoldDelay)),q&&clearTimeout(q),V=l(r.target),!V)return N=!1,!0;if(i.device.ios){var c=window.getSelection();if(c.rangeCount&&c.focusNode!==document.body&&(!c.isCollapsed||document.activeElement===c.focusNode))return E=!0,!0;E=!1}i.device.android&&o(r.target)&&document.activeElement.blur(),N=!0,M=r.target,D=(new Date).getTime(),S=r.targetTouches[0].pageX,O=r.targetTouches[0].pageY,i.device.ios&&(L=void 0,s(M).parents().each(function(){var e=this;e.scrollHeight>e.offsetHeight&&!L&&(L=e,L.f7ScrollTop=L.scrollTop)})),r.timeStamp-B<i.params.fastClicksDelayBetweenClicks&&r.preventDefault(),i.params.activeState&&(R=e(M),a(R)?z=setTimeout(t,80):t()),i.params.material&&i.params.materialRipple&&v(M,S,O)}function k(e){if(N){var a=!1,t=i.params.fastClicksDistanceThreshold;if(t){var r=e.targetTouches[0].pageX,o=e.targetTouches[0].pageY;(Math.abs(r-S)>t||Math.abs(o-O)>t)&&(a=!0)}else a=!0;a&&(N=!1,M=null,A=!0,i.params.tapHold&&clearTimeout(H),i.params.activeState&&(clearTimeout(z),n()),i.params.material&&i.params.materialRipple&&b())}}function x(e){if(clearTimeout(z),clearTimeout(H),!N)return!E&&V&&(i.device.android&&!e.cancelable||e.preventDefault()),!0;if(document.activeElement===e.target)return i.params.activeState&&n(),i.params.material&&i.params.materialRipple&&C(),!0;if(E||e.preventDefault(),e.timeStamp-B<i.params.fastClicksDelayBetweenClicks)return setTimeout(n,0),!0;if(B=e.timeStamp,N=!1,i.device.ios&&L&&L.scrollTop!==L.f7ScrollTop)return!1;if(i.params.activeState&&(t(),setTimeout(n,0)),i.params.material&&i.params.materialRipple&&C(),c(M)){if(i.device.ios&&i.device.webView)return event.timeStamp-D>159?(M=null,!1):(M.focus(),!1);M.focus()}return document.activeElement&&M!==document.activeElement&&document.activeElement!==document.body&&"label"!==M.nodeName.toLowerCase()&&document.activeElement.blur(),e.preventDefault(),y(e),!1}function T(e){N=!1,M=null,clearTimeout(z),clearTimeout(H),i.params.activeState&&n(),i.params.material&&i.params.materialRipple&&C()}function P(e){var a=!1;return N?(M=null,N=!1,!0):"submit"===e.target.type&&0===e.detail||(M||r(e.target)||(a=!0),V||(a=!0),document.activeElement===M&&(a=!0),e.forwardedTouchEvent&&(a=!0),e.cancelable||(a=!0),i.params.tapHold&&i.params.tapHoldPreventClicks&&I&&(a=!1),a||(e.stopImmediatePropagation(),e.stopPropagation(),M?(p(M)||A)&&e.preventDefault():e.preventDefault(),M=null),q=setTimeout(function(){V=!1},i.device.ios||i.device.androidChrome?100:400),i.params.tapHold&&(H=setTimeout(function(){I=!1},i.device.ios||i.device.androidChrome?100:400)),a)}i.params.activeState&&s("html").addClass("watch-active-state"),i.device.ios&&i.device.webView&&window.addEventListener("touchstart",function(){});var S,O,D,M,N,E,L,B,A,I,H,R,z,V,q,F,j,Y,W;i.support.touch?(document.addEventListener("click",P,!0),document.addEventListener("touchstart",w),document.addEventListener("touchmove",k),document.addEventListener("touchend",x),document.addEventListener("touchcancel",T)):i.params.activeState&&(document.addEventListener("mousedown",d),document.addEventListener("mousemove",f),document.addEventListener("mouseup",u)),i.params.material&&i.params.materialRipple&&document.addEventListener("contextmenu",function(e){R&&n(),C()})},i.formsData={},i.formStoreData=function(e,a){i.formsData[e]=a,i.ls["f7form-"+e]=JSON.stringify(a)},i.formDeleteData=function(e){i.formsData[e]&&(i.formsData[e]="",delete i.formsData[e]),i.ls["f7form-"+e]&&(i.ls["f7form-"+e]="",i.ls.removeItem("f7form-"+e))},i.formGetData=function(e){return i.ls["f7form-"+e]?JSON.parse(i.ls["f7form-"+e]):i.formsData[e]?i.formsData[e]:void 0},i.formToJSON=function(e){if(e=s(e),1!==e.length)return!1;var a={},t=["submit","image","button","file"],n=[];return e.find("input, select, textarea").each(function(){var r=s(this),i=r.attr("name"),o=r.attr("type"),l=this.nodeName.toLowerCase();if(!(t.indexOf(o)>=0)&&!(n.indexOf(i)>=0)&&i)if("select"===l&&r.prop("multiple"))n.push(i),a[i]=[],e.find('select[name="'+i+'"] option').each(function(){this.selected&&a[i].push(this.value)});else switch(o){case"checkbox":n.push(i),a[i]=[],e.find('input[name="'+i+'"]').each(function(){this.checked&&a[i].push(this.value)});break;case"radio":n.push(i),e.find('input[name="'+i+'"]').each(function(){this.checked&&(a[i]=this.value)});break;default:a[i]=r.val()}}),e.trigger("formToJSON",{formData:a}),a},i.formFromJSON=function(e,a){if(e=s(e),1!==e.length)return!1;var t=["submit","image","button","file"],n=[];e.find("input, select, textarea").each(function(){var r=s(this),i=r.attr("name"),o=r.attr("type"),l=this.nodeName.toLowerCase();if(a[i]&&!(t.indexOf(o)>=0)&&!(n.indexOf(i)>=0)&&i)if("select"===l&&r.prop("multiple"))n.push(i),e.find('select[name="'+i+'"] option').each(function(){a[i].indexOf(this.value)>=0?this.selected=!0:this.selected=!1});else switch(o){case"checkbox":n.push(i),e.find('input[name="'+i+'"]').each(function(){a[i].indexOf(this.value)>=0?this.checked=!0:this.checked=!1});break;case"radio":n.push(i),e.find('input[name="'+i+'"]').each(function(){a[i]===this.value?this.checked=!0:this.checked=!1});break;default:r.val(a[i])}}),e.trigger("formFromJSON",{formData:a})},i.initFormsStorage=function(e){function a(){var e=s(this),a=e[0].id;if(a){var t=i.formToJSON(e);t&&(i.formStoreData(a,t),e.trigger("store",{data:t}))}}function t(){n.off("change submit",a),e.off("pageBeforeRemove",t)}e=s(e);var n=e.find("form.store-data");0!==n.length&&(n.each(function(){var e=this.getAttribute("id");if(e){var a=i.formGetData(e);a&&i.formFromJSON(this,a)}}),n.on("change submit",a),e.on("pageBeforeRemove",t))},s(document).on("submit change","form.ajax-submit, form.ajax-submit-onchange",function(e){var a=s(this);if("change"!==e.type||a.hasClass("ajax-submit-onchange")){"submit"===e.type&&e.preventDefault();var t=(a.attr("method")||"GET").toUpperCase(),n=a.prop("enctype")||a.attr("enctype"),r=a.attr("action");if(r){var o;o="POST"===t?new FormData(a[0]):s.serializeObject(i.formToJSON(a[0]));var l=s.ajax({method:t,url:r,contentType:n,data:o,beforeSend:function(e){a.trigger("beforeSubmit",{data:o,xhr:e})},error:function(e){a.trigger("submitError",{data:o,xhr:e})},success:function(e){a.trigger("submitted",{data:e,xhr:l})}})}}}),i.resizeTextarea=function(e){if(e=s(e),e.hasClass("resizable")){e.css({height:""});var a=e[0].offsetHeight,t=a-e[0].clientHeight,n=e[0].scrollHeight;if(n+t>a){var r=n+t;e.css("height",r+"px")}}},i.resizableTextarea=function(e){function a(){clearTimeout(t),t=setTimeout(function(){i.resizeTextarea(e)},0)}if(e=s(e),0!==e.length){var t;return e[0].f7DestroyResizableTextarea=function(){e.off("change keydown keypress keyup paste cut",a)},e.on("change keydown keypress keyup paste cut",a)}},i.destroyResizableTextarea=function(e){e=s(e),e.length>0&&e.is("textarea")&&e[0].f7DestroyResizableTextarea?e[0].f7DestroyResizableTextarea():e.length>0&&e.find("textarea.resiable").each(function(){var e=this;e.f7DestroyResizableTextarea&&e.f7DestroyResizableTextarea()})},i.initPageResizableTextarea=function(e){e=s(e);var a=e.find("textarea.resizable");a.each(function(){i.resizableTextarea(this)})},i.initPageMaterialInputs=function(e){e=s(e);e.find("textarea.resizable");e.find(".item-input").each(function(){var e=s(this),a=["checkbox","button","submit","range","radio","image"];e.find("input, select, textarea").each(function(){var t=s(this);a.indexOf(t.attr("type"))<0&&(e.addClass("item-input-field"),""!==t.val().trim()&&t.parents(".item-input, .input-field").add(t.parents(".item-inner")).addClass("not-empty-state"))}),e.parents(".input-item, .inputs-list").length>0||e.parents(".list-block").eq(0).addClass("inputs-list")})},i.initMaterialWatchInputs=function(){function e(e){var a=s(this),t=a.attr("type");if(!(n.indexOf(t)>=0)){var r=a.add(a.parents(".item-input, .input-field")).add(a.parents(".item-inner").eq(0));r.addClass("focus-state")}}function a(e){var a=s(this),t=a.val(),r=a.attr("type");if(!(n.indexOf(r)>=0)){var i=a.add(a.parents(".item-input, .input-field")).add(a.parents(".item-inner").eq(0));i.removeClass("focus-state"),t&&""!==t.trim()?i.addClass("not-empty-state"):i.removeClass("not-empty-state")}}function t(e){var a=s(this),t=a.val(),r=a.attr("type");if(!(n.indexOf(r)>=0)){var i=a.add(a.parents(".item-input, .input-field")).add(a.parents(".item-inner").eq(0));t&&""!==t.trim()?i.addClass("not-empty-state"):i.removeClass("not-empty-state")}}var n=["checkbox","button","submit","range","radio","image"];s(document).on("change",".item-input input, .item-input select, .item-input textarea, input, textarea, select",t,!0),s(document).on("focus",".item-input input, .item-input select, .item-input textarea, input, textarea, select",e,!0),s(document).on("blur",".item-input input, .item-input select, .item-input textarea, input, textarea, select",a,!0)};var h=function(e){function a(){var e=!1;return c.params.convertToPopover||c.params.onlyInPopover?(!c.inline&&c.params.input&&(c.params.onlyInPopover?e=!0:i.device.ios?e=!!i.device.ipad:s(window).width()>=768&&(e=!0)),e):e}function t(){return!!(c.opened&&c.container&&c.container.length>0&&c.container.parents(".popover").length>0)}function n(){if(c.opened)for(var e=0;e<c.cols.length;e++)c.cols[e].divider||(c.cols[e].calcSize(),c.cols[e].setValue(c.cols[e].value,0,!1))}function r(e){if(e.preventDefault(),!c.opened&&(c.open(),c.params.scrollToInput&&!a())){var t=c.input.parents(".page-content");if(0===t.length)return;var n,r=parseInt(t.css("padding-top"),10),i=parseInt(t.css("padding-bottom"),10),o=t[0].offsetHeight-r-c.container.height(),s=t[0].scrollHeight-r-c.container.height(),l=c.input.offset().top-r+c.input[0].offsetHeight;if(l>o){var p=t.scrollTop()+l-o;p+o>s&&(n=p+o-s+i,o===s&&(n=c.container.height()),t.css({"padding-bottom":n+"px"})),t.scrollTop(p,300)}}}function o(e){t()||(c.input&&c.input.length>0?e.target!==c.input[0]&&0===s(e.target).parents(".picker-modal").length&&c.close():0===s(e.target).parents(".picker-modal").length&&c.close())}function l(){c.opened=!1,c.input&&c.input.length>0&&(c.input.parents(".page-content").css({"padding-bottom":""}),i.params.material&&c.input.trigger("blur")),c.params.onClose&&c.params.onClose(c),c.container.find(".picker-items-col").each(function(){c.destroyPickerCol(this)})}var c=this,p={updateValuesOnMomentum:!1,updateValuesOnTouchmove:!0,rotateEffect:!1,momentumRatio:7,freeMode:!1,closeByOutsideClick:!0,scrollToInput:!0,inputReadOnly:!0,convertToPopover:!0,onlyInPopover:!1,toolbar:!0,toolbarCloseText:"Done",toolbarTemplate:'<div class="toolbar"><div class="toolbar-inner"><div class="left"></div><div class="right"><a href="#" class="link close-picker">{{closeText}}</a></div></div></div>'};e=e||{};for(var d in p)"undefined"==typeof e[d]&&(e[d]=p[d]);c.params=e,c.cols=[],c.initialized=!1,c.inline=!!c.params.container;var f=i.device.ios||navigator.userAgent.toLowerCase().indexOf("safari")>=0&&navigator.userAgent.toLowerCase().indexOf("chrome")<0&&!i.device.android;return c.setValue=function(e,a){var t=0;if(0===c.cols.length)return c.value=e,void c.updateValue(e);for(var n=0;n<c.cols.length;n++)c.cols[n]&&!c.cols[n].divider&&(c.cols[n].setValue(e[t],a),t++)},c.updateValue=function(e){for(var a=e||[],t=[],n=0;n<c.cols.length;n++)c.cols[n].divider||(a.push(c.cols[n].value),t.push(c.cols[n].displayValue));a.indexOf(void 0)>=0||(c.value=a,c.displayValue=t,c.params.onChange&&c.params.onChange(c,c.value,c.displayValue),c.input&&c.input.length>0&&(s(c.input).val(c.params.formatValue?c.params.formatValue(c,c.value,c.displayValue):c.value.join(" ")),s(c.input).trigger("change")))},c.initPickerCol=function(e,a){function t(){C=s.requestAnimationFrame(function(){u.updateItems(void 0,void 0,0),t()})}function n(e){w||y||(e.preventDefault(),y=!0,k=x="touchstart"===e.type?e.targetTouches[0].pageY:e.pageY,T=(new Date).getTime(),L=!0,S=D=s.getTranslate(u.wrapper[0],"y"))}function r(e){if(y){e.preventDefault(),L=!1,x="touchmove"===e.type?e.targetTouches[0].pageY:e.pageY,w||(s.cancelAnimationFrame(C),w=!0,S=D=s.getTranslate(u.wrapper[0],"y"),u.wrapper.transition(0)),e.preventDefault();var a=x-k;D=S+a,O=void 0,D<v&&(D=v-Math.pow(v-D,.8),O="min"),D>b&&(D=b+Math.pow(D-b,.8),O="max"),u.wrapper.transform("translate3d(0,"+D+"px,0)"),u.updateItems(void 0,D,0,c.params.updateValuesOnTouchmove),N=D-M||D,E=(new Date).getTime(),M=D}}function o(e){if(!y||!w)return void(y=w=!1);y=w=!1,u.wrapper.transition(""),O&&("min"===O?u.wrapper.transform("translate3d(0,"+v+"px,0)"):u.wrapper.transform("translate3d(0,"+b+"px,0)")),P=(new Date).getTime();var a,n;P-T>300?n=D:(a=Math.abs(N/(P-E)),n=D+N*c.params.momentumRatio),n=Math.max(Math.min(n,b),v);var r=-Math.floor((n-b)/m);c.params.freeMode||(n=-r*m+b),u.wrapper.transform("translate3d(0,"+parseInt(n,10)+"px,0)"),u.updateItems(r,n,"",!0),c.params.updateValuesOnMomentum&&(t(),u.wrapper.transitionEnd(function(){s.cancelAnimationFrame(C)})),setTimeout(function(){L=!0},100)}function l(e){if(L){s.cancelAnimationFrame(C);var a=s(this).attr("data-picker-value");u.setValue(a)}}var p=s(e),d=p.index(),u=c.cols[d];if(!u.divider){u.container=p,u.wrapper=u.container.find(".picker-items-col-wrapper"),u.items=u.wrapper.find(".picker-item");var h,m,g,v,b;u.replaceValues=function(e,a){u.destroyEvents(),u.values=e,u.displayValues=a;var t=c.columnHTML(u,!0);u.wrapper.html(t),u.items=u.wrapper.find(".picker-item"),u.calcSize(),u.setValue(u.values[0],0,!0),u.initEvents()},u.calcSize=function(){c.params.rotateEffect&&(u.container.removeClass("picker-items-col-absolute"),u.width||u.container.css({width:""}));var e,a;e=0,a=u.container[0].offsetHeight,h=u.wrapper[0].offsetHeight,m=u.items[0].offsetHeight,g=m*u.items.length,v=a/2-g+m/2,b=a/2-m/2,u.width&&(e=u.width,parseInt(e,10)===e&&(e+="px"),u.container.css({width:e})),c.params.rotateEffect&&(u.width||(u.items.each(function(){var a=s(this);a.css({width:"auto"}),e=Math.max(e,a[0].offsetWidth),a.css({width:""})}),u.container.css({width:e+2+"px"})),u.container.addClass("picker-items-col-absolute"))},u.calcSize(),u.wrapper.transform("translate3d(0,"+b+"px,0)").transition(0);var C;u.setValue=function(e,a,n){"undefined"==typeof a&&(a="");var r=u.wrapper.find('.picker-item[data-picker-value="'+e+'"]').index();if("undefined"!=typeof r&&r!==-1){var i=-r*m+b;u.wrapper.transition(a),u.wrapper.transform("translate3d(0,"+i+"px,0)"),c.params.updateValuesOnMomentum&&u.activeIndex&&u.activeIndex!==r&&(s.cancelAnimationFrame(C),u.wrapper.transitionEnd(function(){s.cancelAnimationFrame(C)}),t()),u.updateItems(r,i,a,n)}},u.updateItems=function(e,a,t,n){"undefined"==typeof a&&(a=s.getTranslate(u.wrapper[0],"y")),"undefined"==typeof e&&(e=-Math.round((a-b)/m)),e<0&&(e=0),e>=u.items.length&&(e=u.items.length-1);var r=u.activeIndex;u.activeIndex=e,u.wrapper.find(".picker-selected").removeClass("picker-selected"),u.items.transition(t);var i=u.items.eq(e).addClass("picker-selected").transform("");if(c.params.rotateEffect){(a-(Math.floor((a-b)/m)*m+b))/m;u.items.each(function(){var e=s(this),t=e.index()*m,n=b-a,r=t-n,i=r/m,o=Math.ceil(u.height/m/2)+1,l=-18*i;l>180&&(l=180),l<-180&&(l=-180),Math.abs(i)>o?e.addClass("picker-item-far"):e.removeClass("picker-item-far"),e.transform("translate3d(0, "+(-a+b)+"px, "+(f?-110:0)+"px) rotateX("+l+"deg)")})}(n||"undefined"==typeof n)&&(u.value=i.attr("data-picker-value"),u.displayValue=u.displayValues?u.displayValues[e]:u.value,r!==e&&(u.onChange&&u.onChange(c,u.value,u.displayValue),c.updateValue()))},a&&u.updateItems(0,b,0);var y,w,k,x,T,P,S,O,D,M,N,E,L=!0;u.initEvents=function(e){var a=e?"off":"on";u.container[a](i.touchEvents.start,n),u.container[a](i.touchEvents.move,r),u.container[a](i.touchEvents.end,o),u.items[a]("click",l)},u.destroyEvents=function(){u.initEvents(!0)},u.container[0].f7DestroyPickerCol=function(){u.destroyEvents()},u.initEvents()}},c.destroyPickerCol=function(e){e=s(e),"f7DestroyPickerCol"in e[0]&&e[0].f7DestroyPickerCol()},s(window).on("resize",n),c.columnHTML=function(e,a){var t="",n="";if(e.divider)n+='<div class="picker-items-col picker-items-col-divider '+(e.textAlign?"picker-items-col-"+e.textAlign:"")+" "+(e.cssClass||"")+'">'+e.content+"</div>";else{for(var r=0;r<e.values.length;r++)t+='<div class="picker-item" data-picker-value="'+e.values[r]+'">'+(e.displayValues?e.displayValues[r]:e.values[r])+"</div>";n+='<div class="picker-items-col '+(e.textAlign?"picker-items-col-"+e.textAlign:"")+" "+(e.cssClass||"")+'"><div class="picker-items-col-wrapper">'+t+"</div></div>"}return a?t:n},c.layout=function(){var e,a="",t="";c.cols=[];var n="";for(e=0;e<c.params.cols.length;e++){var r=c.params.cols[e];n+=c.columnHTML(c.params.cols[e]),c.cols.push(r)}t="picker-modal picker-columns "+(c.params.cssClass||"")+(c.params.rotateEffect?" picker-3d":""),a='<div class="'+t+'">'+(c.params.toolbar?c.params.toolbarTemplate.replace(/{{closeText}}/g,c.params.toolbarCloseText):"")+'<div class="picker-modal-inner picker-items">'+n+'<div class="picker-center-highlight"></div></div></div>',c.pickerHTML=a},c.params.input&&(c.input=s(c.params.input),c.input.length>0&&(c.params.inputReadOnly&&c.input.prop("readOnly",!0),c.inline||c.input.on("click",r),c.params.inputReadOnly&&c.input.on("focus mousedown",function(e){e.preventDefault()}))),!c.inline&&c.params.closeByOutsideClick&&s("html").on("click",o),c.opened=!1,c.open=function(){var e=a();c.opened||(c.layout(),e?(c.pickerHTML='<div class="popover popover-picker-columns"><div class="popover-inner">'+c.pickerHTML+"</div></div>",c.popover=i.popover(c.pickerHTML,c.params.input,!0),c.container=s(c.popover).find(".picker-modal"),s(c.popover).on("close",function(){l()})):c.inline?(c.container=s(c.pickerHTML),c.container.addClass("picker-modal-inline"),s(c.params.container).append(c.container)):(c.container=s(i.pickerModal(c.pickerHTML)),s(c.container).on("close",function(){l()})),c.container[0].f7Picker=c,c.container.find(".picker-items-col").each(function(){var e=!0;(!c.initialized&&c.params.value||c.initialized&&c.value)&&(e=!1),c.initPickerCol(this,e)}),c.initialized?c.value&&c.setValue(c.value,0):c.value?c.setValue(c.value,0):c.params.value&&c.setValue(c.params.value,0),c.input&&c.input.length>0&&i.params.material&&c.input.trigger("focus")),c.opened=!0,c.initialized=!0,c.params.onOpen&&c.params.onOpen(c)},c.close=function(){if(c.opened&&!c.inline)return t()?void i.closeModal(c.popover):void i.closeModal(c.container)},c.destroy=function(){c.close(),c.params.input&&c.input.length>0&&c.input.off("click focus",r),s("html").off("click",o),s(window).off("resize",n)},c.inline?c.open():!c.initialized&&c.params.value&&c.setValue(c.params.value),c};i.picker=function(e){return new h(e)};var m=function(e){function a(){var e=!1;return c.params.convertToPopover||c.params.onlyInPopover?(!c.inline&&c.params.input&&(c.params.onlyInPopover?e=!0:i.device.ios?e=!!i.device.ipad:s(window).width()>=768&&(e=!0)),e):e}function t(){return!!(c.opened&&c.container&&c.container.length>0&&c.container.parents(".popover").length>0)}function n(e){e=new Date(e);var a=e.getFullYear(),t=e.getMonth(),n=t+1,r=e.getDate(),i=e.getDay();return c.params.dateFormat.replace(/yyyy/g,a).replace(/yy/g,(a+"").substring(2)).replace(/mm/g,n<10?"0"+n:n).replace(/m(\W+)/g,n+"$1").replace(/MM/g,c.params.monthNames[t]).replace(/M(\W+)/g,c.params.monthNamesShort[t]+"$1").replace(/dd/g,r<10?"0"+r:r).replace(/d(\W+)/g,r+"$1").replace(/DD/g,c.params.dayNames[i]).replace(/D(\W+)/g,c.params.dayNamesShort[i]+"$1")}function r(e){if(e.preventDefault(),!c.opened&&(c.open(),c.params.scrollToInput&&!a()&&!i.params.material)){var t=c.input.parents(".page-content");if(0===t.length)return;var n,r=parseInt(t.css("padding-top"),10),o=parseInt(t.css("padding-bottom"),10),s=t[0].offsetHeight-r-c.container.height(),l=t[0].scrollHeight-r-c.container.height(),p=c.input.offset().top-r+c.input[0].offsetHeight;if(p>s){var d=t.scrollTop()+p-s;d+s>l&&(n=d+s-l+o,s===l&&(n=c.container.height()),t.css({"padding-bottom":n+"px"})),t.scrollTop(d,300)}}}function o(e){t()||(c.input&&c.input.length>0?e.target!==c.input[0]&&0===s(e.target).parents(".picker-modal").length&&c.close():0===s(e.target).parents(".picker-modal").length&&c.close())}function l(){c.opened=!1,c.input&&c.input.length>0&&(c.input.parents(".page-content").css({"padding-bottom":""}),i.params.material&&c.input.trigger("blur")),c.params.onClose&&c.params.onClose(c),c.destroyCalendarEvents()}var c=this,p={monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],firstDay:1,weekendDays:[0,6],multiple:!1,rangePicker:!1,dateFormat:"yyyy-mm-dd",direction:"horizontal",minDate:null,maxDate:null,disabled:null,events:null,rangesClasses:null,touchMove:!0,animate:!0,closeOnSelect:!1,monthPicker:!0,monthPickerTemplate:'<div class="picker-calendar-month-picker"><a href="#" class="link icon-only picker-calendar-prev-month"><i class="icon icon-prev"></i></a><span class="current-month-value"></span><a href="#" class="link icon-only picker-calendar-next-month"><i class="icon icon-next"></i></a></div>',yearPicker:!0,yearPickerTemplate:'<div class="picker-calendar-year-picker"><a href="#" class="link icon-only picker-calendar-prev-year"><i class="icon icon-prev"></i></a><span class="current-year-value"></span><a href="#" class="link icon-only picker-calendar-next-year"><i class="icon icon-next"></i></a></div>',weekHeader:!0,closeByOutsideClick:!0,scrollToInput:!0,inputReadOnly:!0,convertToPopover:!0,onlyInPopover:!1,toolbar:!0,toolbarCloseText:"Done",headerPlaceholder:"Select date",header:i.params.material,footer:i.params.material,toolbarTemplate:'<div class="toolbar"><div class="toolbar-inner">{{monthPicker}}{{yearPicker}}</div></div>',headerTemplate:'<div class="picker-header"><div class="picker-calendar-selected-date">{{placeholder}}</div></div>',footerTemplate:'<div class="picker-footer"><a href="#" class="button close-picker">{{closeText}}</a></div>'};e=e||{};for(var d in p)"undefined"==typeof e[d]&&(e[d]=p[d]);c.params=e,c.initialized=!1,c.inline=!!c.params.container,c.isH="horizontal"===c.params.direction;var f=c.isH&&i.rtl?-1:1;return c.animating=!1,c.addValue=function(e){if(c.params.multiple){c.value||(c.value=[]);for(var a,t=0;t<c.value.length;t++)new Date(e).getTime()===new Date(c.value[t]).getTime()&&(a=t);"undefined"==typeof a?c.value.push(e):c.value.splice(a,1),c.updateValue()}else c.params.rangePicker?(c.value||(c.value=[]),2!==c.value.length&&0!==c.value.length||(c.value=[]),c.value[0]!==e?c.value.push(e):c.value=[],c.value.sort(function(e,a){return e-a}),c.updateValue()):(c.value=[e],c.updateValue())},c.setValue=function(e){c.value=e,c.updateValue()},c.updateValue=function(e){var a,t;if(c.container&&c.container.length>0){c.wrapper.find(".picker-calendar-day-selected").removeClass("picker-calendar-day-selected");var r;if(c.params.rangePicker&&2===c.value.length)for(a=c.value[0];a<=c.value[1];a+=864e5)r=new Date(a),c.wrapper.find('.picker-calendar-day[data-date="'+r.getFullYear()+"-"+r.getMonth()+"-"+r.getDate()+'"]').addClass("picker-calendar-day-selected");else for(a=0;a<c.value.length;a++)r=new Date(c.value[a]),c.wrapper.find('.picker-calendar-day[data-date="'+r.getFullYear()+"-"+r.getMonth()+"-"+r.getDate()+'"]').addClass("picker-calendar-day-selected")}if(c.params.onChange&&c.params.onChange(c,c.value),c.input&&c.input.length>0||i.params.material&&c.params.header){if(c.params.formatValue)t=c.params.formatValue(c,c.value);else{for(t=[],a=0;a<c.value.length;a++)t.push(n(c.value[a]));t=t.join(c.params.rangePicker?" - ":", ")}i.params.material&&c.params.header&&c.container&&c.container.length>0&&c.container.find(".picker-calendar-selected-date").text(t),c.input&&c.input.length>0&&!e&&(s(c.input).val(t),s(c.input).trigger("change"))}},c.initCalendarEvents=function(){function e(e){o||r||(r=!0,l=u="touchstart"===e.type?e.targetTouches[0].pageX:e.pageX,p=u="touchstart"===e.type?e.targetTouches[0].pageY:e.pageY,h=(new Date).getTime(),y=0,x=!0,k=void 0,g=v=c.monthsTranslate)}function a(e){if(r){if(d="touchmove"===e.type?e.targetTouches[0].pageX:e.pageX,u="touchmove"===e.type?e.targetTouches[0].pageY:e.pageY,"undefined"==typeof k&&(k=!!(k||Math.abs(u-p)>Math.abs(d-l))),c.isH&&k)return void(r=!1);if(e.preventDefault(),c.animating)return void(r=!1);x=!1,o||(o=!0,b=c.wrapper[0].offsetWidth,C=c.wrapper[0].offsetHeight,c.wrapper.transition(0)),e.preventDefault(),w=c.isH?d-l:u-p,y=w/(c.isH?b:C),v=100*(c.monthsTranslate*f+y),c.wrapper.transform("translate3d("+(c.isH?v:0)+"%, "+(c.isH?0:v)+"%, 0)")}}function t(e){return r&&o?(r=o=!1,m=(new Date).getTime(),m-h<300?Math.abs(w)<10?c.resetMonth():w>=10?i.rtl?c.nextMonth():c.prevMonth():i.rtl?c.prevMonth():c.nextMonth():y<=-.5?i.rtl?c.prevMonth():c.nextMonth():y>=.5?i.rtl?c.nextMonth():c.prevMonth():c.resetMonth(),void setTimeout(function(){x=!0},100)):void(r=o=!1)}function n(e){if(x){var a=s(e.target).parents(".picker-calendar-day");if(0===a.length&&s(e.target).hasClass("picker-calendar-day")&&(a=s(e.target)),0!==a.length&&(!a.hasClass("picker-calendar-day-selected")||c.params.multiple||c.params.rangePicker)&&!a.hasClass("picker-calendar-day-disabled")){c.params.rangePicker||(a.hasClass("picker-calendar-day-next")&&c.nextMonth(),a.hasClass("picker-calendar-day-prev")&&c.prevMonth());var t=a.attr("data-year"),n=a.attr("data-month"),r=a.attr("data-day");c.params.onDayClick&&c.params.onDayClick(c,a[0],t,n,r),c.addValue(new Date(t,n,r).getTime()),c.params.closeOnSelect&&(c.params.rangePicker&&2===c.value.length||!c.params.rangePicker)&&c.close()}}}var r,o,l,p,d,u,h,m,g,v,b,C,y,w,k,x=!0;c.container.find(".picker-calendar-prev-month").on("click",c.prevMonth),c.container.find(".picker-calendar-next-month").on("click",c.nextMonth),c.container.find(".picker-calendar-prev-year").on("click",c.prevYear),c.container.find(".picker-calendar-next-year").on("click",c.nextYear),c.wrapper.on("click",n),c.params.touchMove&&(c.wrapper.on(i.touchEvents.start,e),c.wrapper.on(i.touchEvents.move,a),c.wrapper.on(i.touchEvents.end,t)),c.container[0].f7DestroyCalendarEvents=function(){c.container.find(".picker-calendar-prev-month").off("click",c.prevMonth),c.container.find(".picker-calendar-next-month").off("click",c.nextMonth),c.container.find(".picker-calendar-prev-year").off("click",c.prevYear),c.container.find(".picker-calendar-next-year").off("click",c.nextYear),c.wrapper.off("click",n),c.params.touchMove&&(c.wrapper.off(i.touchEvents.start,e),c.wrapper.off(i.touchEvents.move,a),c.wrapper.off(i.touchEvents.end,t))}},c.destroyCalendarEvents=function(e){"f7DestroyCalendarEvents"in c.container[0]&&c.container[0].f7DestroyCalendarEvents()},c.dateInRange=function(e,a){var t,n=!1;if(!a)return!1;if(s.isArray(a))for(t=0;t<a.length;t++)a[t].from||a[t].to?a[t].from&&a[t].to?e<=new Date(a[t].to).getTime()&&e>=new Date(a[t].from).getTime()&&(n=!0):a[t].from?e>=new Date(a[t].from).getTime()&&(n=!0):a[t].to&&e<=new Date(a[t].to).getTime()&&(n=!0):e===new Date(a[t]).getTime()&&(n=!0);else a.from||a.to?a.from&&a.to?e<=new Date(a.to).getTime()&&e>=new Date(a.from).getTime()&&(n=!0):a.from?e>=new Date(a.from).getTime()&&(n=!0):a.to&&e<=new Date(a.to).getTime()&&(n=!0):"function"==typeof a&&(n=a(new Date(e)));
return n},c.daysInMonth=function(e){var a=new Date(e);return new Date(a.getFullYear(),a.getMonth()+1,0).getDate()},c.monthHTML=function(e,a){e=new Date(e);var t=e.getFullYear(),n=e.getMonth();e.getDate();"next"===a&&(e=11===n?new Date(t+1,0):new Date(t,n+1,1)),"prev"===a&&(e=0===n?new Date(t-1,11):new Date(t,n-1,1)),"next"!==a&&"prev"!==a||(n=e.getMonth(),t=e.getFullYear());var r=c.daysInMonth(new Date(e.getFullYear(),e.getMonth()).getTime()-864e6),i=c.daysInMonth(e),o=new Date(e.getFullYear(),e.getMonth()).getDay();0===o&&(o=7);var s,l,p,d,f,u,h=[],m=6,g=7,v="",b=0+(c.params.firstDay-1),C=(new Date).setHours(0,0,0,0),y=c.params.minDate?new Date(c.params.minDate).getTime():null,w=c.params.maxDate?new Date(c.params.maxDate).getTime():null;if(c.value&&c.value.length)for(l=0;l<c.value.length;l++)h.push(new Date(c.value[l]).setHours(0,0,0,0));for(l=1;l<=m;l++){var k="";for(p=1;p<=g;p++){var x=p;b++;var T=b-o,P=x-1+c.params.firstDay>6?x-1-7+c.params.firstDay:x-1+c.params.firstDay,S="";if(T<0?(T=r+T+1,S+=" picker-calendar-day-prev",s=new Date(n-1<0?t-1:t,n-1<0?11:n-1,T).getTime()):(T+=1,T>i?(T-=i,S+=" picker-calendar-day-next",s=new Date(n+1>11?t+1:t,n+1>11?0:n+1,T).getTime()):s=new Date(t,n,T).getTime()),s===C&&(S+=" picker-calendar-day-today"),c.params.rangePicker&&2===h.length?s>=h[0]&&s<=h[1]&&(S+=" picker-calendar-day-selected"):h.indexOf(s)>=0&&(S+=" picker-calendar-day-selected"),c.params.weekendDays.indexOf(P)>=0&&(S+=" picker-calendar-day-weekend"),u=!1,c.params.events&&c.dateInRange(s,c.params.events)&&(u=!0),u&&(S+=" picker-calendar-day-has-events"),c.params.rangesClasses)for(d=0;d<c.params.rangesClasses.length;d++)c.dateInRange(s,c.params.rangesClasses[d].range)&&(S+=" "+c.params.rangesClasses[d].cssClass);f=!1,(y&&s<y||w&&s>w)&&(f=!0),c.params.disabled&&c.dateInRange(s,c.params.disabled)&&(f=!0),f&&(S+=" picker-calendar-day-disabled"),s=new Date(s);var O=s.getFullYear(),D=s.getMonth();k+='<div data-year="'+O+'" data-month="'+D+'" data-day="'+T+'" class="picker-calendar-day'+S+'" data-date="'+(O+"-"+D+"-"+T)+'"><span>'+T+"</span></div>"}v+='<div class="picker-calendar-row">'+k+"</div>"}return v='<div class="picker-calendar-month" data-year="'+t+'" data-month="'+n+'">'+v+"</div>"},c.animating=!1,c.updateCurrentMonthYear=function(e){"undefined"==typeof e?(c.currentMonth=parseInt(c.months.eq(1).attr("data-month"),10),c.currentYear=parseInt(c.months.eq(1).attr("data-year"),10)):(c.currentMonth=parseInt(c.months.eq("next"===e?c.months.length-1:0).attr("data-month"),10),c.currentYear=parseInt(c.months.eq("next"===e?c.months.length-1:0).attr("data-year"),10)),c.container.find(".current-month-value").text(c.params.monthNames[c.currentMonth]),c.container.find(".current-year-value").text(c.currentYear)},c.onMonthChangeStart=function(e){c.updateCurrentMonthYear(e),c.months.removeClass("picker-calendar-month-current picker-calendar-month-prev picker-calendar-month-next");var a="next"===e?c.months.length-1:0;c.months.eq(a).addClass("picker-calendar-month-current"),c.months.eq("next"===e?a-1:a+1).addClass("next"===e?"picker-calendar-month-prev":"picker-calendar-month-next"),c.params.onMonthYearChangeStart&&c.params.onMonthYearChangeStart(c,c.currentYear,c.currentMonth)},c.onMonthChangeEnd=function(e,a){c.animating=!1;var t,n,r;c.wrapper.find(".picker-calendar-month:not(.picker-calendar-month-prev):not(.picker-calendar-month-current):not(.picker-calendar-month-next)").remove(),"undefined"==typeof e&&(e="next",a=!0),a?(c.wrapper.find(".picker-calendar-month-next, .picker-calendar-month-prev").remove(),n=c.monthHTML(new Date(c.currentYear,c.currentMonth),"prev"),t=c.monthHTML(new Date(c.currentYear,c.currentMonth),"next")):r=c.monthHTML(new Date(c.currentYear,c.currentMonth),e),("next"===e||a)&&c.wrapper.append(r||t),("prev"===e||a)&&c.wrapper.prepend(r||n),c.months=c.wrapper.find(".picker-calendar-month"),c.setMonthsTranslate(c.monthsTranslate),c.params.onMonthAdd&&c.params.onMonthAdd(c,"next"===e?c.months.eq(c.months.length-1)[0]:c.months.eq(0)[0]),c.params.onMonthYearChangeEnd&&c.params.onMonthYearChangeEnd(c,c.currentYear,c.currentMonth)},c.setMonthsTranslate=function(e){e=e||c.monthsTranslate||0,"undefined"==typeof c.monthsTranslate&&(c.monthsTranslate=e),c.months.removeClass("picker-calendar-month-current picker-calendar-month-prev picker-calendar-month-next");var a=100*-(e+1)*f,t=100*-e*f,n=100*-(e-1)*f;c.months.eq(0).transform("translate3d("+(c.isH?a:0)+"%, "+(c.isH?0:a)+"%, 0)").addClass("picker-calendar-month-prev"),c.months.eq(1).transform("translate3d("+(c.isH?t:0)+"%, "+(c.isH?0:t)+"%, 0)").addClass("picker-calendar-month-current"),c.months.eq(2).transform("translate3d("+(c.isH?n:0)+"%, "+(c.isH?0:n)+"%, 0)").addClass("picker-calendar-month-next")},c.nextMonth=function(e){"undefined"!=typeof e&&"object"!=typeof e||(e="",c.params.animate||(e=0));var a=parseInt(c.months.eq(c.months.length-1).attr("data-month"),10),t=parseInt(c.months.eq(c.months.length-1).attr("data-year"),10),n=new Date(t,a),r=n.getTime(),i=!c.animating;if(c.params.maxDate&&r>new Date(c.params.maxDate).getTime())return c.resetMonth();if(c.monthsTranslate--,a===c.currentMonth){var o=100*-c.monthsTranslate*f,l=s(c.monthHTML(r,"next")).transform("translate3d("+(c.isH?o:0)+"%, "+(c.isH?0:o)+"%, 0)").addClass("picker-calendar-month-next");c.wrapper.append(l[0]),c.months=c.wrapper.find(".picker-calendar-month"),c.params.onMonthAdd&&c.params.onMonthAdd(c,c.months.eq(c.months.length-1)[0])}c.animating=!0,c.onMonthChangeStart("next");var p=100*c.monthsTranslate*f;c.wrapper.transition(e).transform("translate3d("+(c.isH?p:0)+"%, "+(c.isH?0:p)+"%, 0)"),i&&c.wrapper.transitionEnd(function(){c.onMonthChangeEnd("next")}),c.params.animate||c.onMonthChangeEnd("next")},c.prevMonth=function(e){"undefined"!=typeof e&&"object"!=typeof e||(e="",c.params.animate||(e=0));var a=parseInt(c.months.eq(0).attr("data-month"),10),t=parseInt(c.months.eq(0).attr("data-year"),10),n=new Date(t,a+1,(-1)),r=n.getTime(),i=!c.animating;if(c.params.minDate&&r<new Date(c.params.minDate).getTime())return c.resetMonth();if(c.monthsTranslate++,a===c.currentMonth){var o=100*-c.monthsTranslate*f,l=s(c.monthHTML(r,"prev")).transform("translate3d("+(c.isH?o:0)+"%, "+(c.isH?0:o)+"%, 0)").addClass("picker-calendar-month-prev");c.wrapper.prepend(l[0]),c.months=c.wrapper.find(".picker-calendar-month"),c.params.onMonthAdd&&c.params.onMonthAdd(c,c.months.eq(0)[0])}c.animating=!0,c.onMonthChangeStart("prev");var p=100*c.monthsTranslate*f;c.wrapper.transition(e).transform("translate3d("+(c.isH?p:0)+"%, "+(c.isH?0:p)+"%, 0)"),i&&c.wrapper.transitionEnd(function(){c.onMonthChangeEnd("prev")}),c.params.animate||c.onMonthChangeEnd("prev")},c.resetMonth=function(e){"undefined"==typeof e&&(e="");var a=100*c.monthsTranslate*f;c.wrapper.transition(e).transform("translate3d("+(c.isH?a:0)+"%, "+(c.isH?0:a)+"%, 0)")},c.setYearMonth=function(e,a,t){"undefined"==typeof e&&(e=c.currentYear),"undefined"==typeof a&&(a=c.currentMonth),"undefined"!=typeof t&&"object"!=typeof t||(t="",c.params.animate||(t=0));var n;if(n=e<c.currentYear?new Date(e,a+1,(-1)).getTime():new Date(e,a).getTime(),c.params.maxDate&&n>new Date(c.params.maxDate).getTime())return!1;if(c.params.minDate&&n<new Date(c.params.minDate).getTime())return!1;var r=new Date(c.currentYear,c.currentMonth).getTime(),i=n>r?"next":"prev",o=c.monthHTML(new Date(e,a));c.monthsTranslate=c.monthsTranslate||0;var s,l,p=c.monthsTranslate,d=!c.animating;n>r?(c.monthsTranslate--,c.animating||c.months.eq(c.months.length-1).remove(),c.wrapper.append(o),c.months=c.wrapper.find(".picker-calendar-month"),s=100*-(p-1)*f,c.months.eq(c.months.length-1).transform("translate3d("+(c.isH?s:0)+"%, "+(c.isH?0:s)+"%, 0)").addClass("picker-calendar-month-next")):(c.monthsTranslate++,c.animating||c.months.eq(0).remove(),c.wrapper.prepend(o),c.months=c.wrapper.find(".picker-calendar-month"),s=100*-(p+1)*f,c.months.eq(0).transform("translate3d("+(c.isH?s:0)+"%, "+(c.isH?0:s)+"%, 0)").addClass("picker-calendar-month-prev")),c.params.onMonthAdd&&c.params.onMonthAdd(c,"next"===i?c.months.eq(c.months.length-1)[0]:c.months.eq(0)[0]),c.animating=!0,c.onMonthChangeStart(i),l=100*c.monthsTranslate*f,c.wrapper.transition(t).transform("translate3d("+(c.isH?l:0)+"%, "+(c.isH?0:l)+"%, 0)"),d&&c.wrapper.transitionEnd(function(){c.onMonthChangeEnd(i,!0)}),c.params.animate||c.onMonthChangeEnd(i)},c.nextYear=function(){c.setYearMonth(c.currentYear+1)},c.prevYear=function(){c.setYearMonth(c.currentYear-1)},c.layout=function(){var e,a="",t="",n=c.value&&c.value.length?c.value[0]:(new Date).setHours(0,0,0,0),r=c.monthHTML(n,"prev"),i=c.monthHTML(n),o=c.monthHTML(n,"next"),s='<div class="picker-calendar-months"><div class="picker-calendar-months-wrapper">'+(r+i+o)+"</div></div>",l="";if(c.params.weekHeader){for(e=0;e<7;e++){var p=e+c.params.firstDay>6?e-7+c.params.firstDay:e+c.params.firstDay,d=c.params.dayNamesShort[p];l+='<div class="picker-calendar-week-day '+(c.params.weekendDays.indexOf(p)>=0?"picker-calendar-week-day-weekend":"")+'"> '+d+"</div>"}l='<div class="picker-calendar-week-days">'+l+"</div>"}t="picker-modal picker-calendar"+(c.params.rangePicker?" picker-calendar-range":"")+(c.params.cssClass?" "+c.params.cssClass:"");var f=c.params.toolbar?c.params.toolbarTemplate.replace(/{{closeText}}/g,c.params.toolbarCloseText):"";c.params.toolbar&&(f=c.params.toolbarTemplate.replace(/{{closeText}}/g,c.params.toolbarCloseText).replace(/{{monthPicker}}/g,c.params.monthPicker?c.params.monthPickerTemplate:"").replace(/{{yearPicker}}/g,c.params.yearPicker?c.params.yearPickerTemplate:""));var u=c.params.header?c.params.headerTemplate.replace(/{{closeText}}/g,c.params.toolbarCloseText).replace(/{{placeholder}}/g,c.params.headerPlaceholder):"",h=c.params.footer?c.params.footerTemplate.replace(/{{closeText}}/g,c.params.toolbarCloseText):"";a='<div class="'+t+'">'+u+h+f+'<div class="picker-modal-inner">'+l+s+"</div></div>",c.pickerHTML=a},c.params.input&&(c.input=s(c.params.input),c.input.length>0&&(c.params.inputReadOnly&&c.input.prop("readOnly",!0),c.inline||c.input.on("click",r),c.params.inputReadOnly&&c.input.on("focus mousedown",function(e){e.preventDefault()}))),!c.inline&&c.params.closeByOutsideClick&&s("html").on("click",o),c.opened=!1,c.open=function(){var e=a(),t=!1;c.opened||(c.value||c.params.value&&(c.value=c.params.value,t=!0),c.layout(),e?(c.pickerHTML='<div class="popover popover-picker-calendar"><div class="popover-inner">'+c.pickerHTML+"</div></div>",c.popover=i.popover(c.pickerHTML,c.params.input,!0),c.container=s(c.popover).find(".picker-modal"),s(c.popover).on("close",function(){l()})):c.inline?(c.container=s(c.pickerHTML),c.container.addClass("picker-modal-inline"),s(c.params.container).append(c.container)):(c.container=s(i.pickerModal(c.pickerHTML)),s(c.container).on("close",function(){l()})),c.container[0].f7Calendar=c,c.wrapper=c.container.find(".picker-calendar-months-wrapper"),c.months=c.wrapper.find(".picker-calendar-month"),c.updateCurrentMonthYear(),c.monthsTranslate=0,c.setMonthsTranslate(),c.initCalendarEvents(),t?c.updateValue():i.params.material&&c.value&&c.updateValue(!0),c.input&&c.input.length>0&&i.params.material&&c.input.trigger("focus")),c.opened=!0,c.initialized=!0,c.params.onMonthAdd&&c.months.each(function(){c.params.onMonthAdd(c,this)}),c.params.onOpen&&c.params.onOpen(c)},c.close=function(){if(c.opened&&!c.inline)return t()?void i.closeModal(c.popover):void i.closeModal(c.container)},c.destroy=function(){c.close(),c.params.input&&c.input.length>0&&c.input.off("click focus",r),s("html").off("click",o)},c.inline?c.open():!c.initialized&&c.params.value&&c.setValue(c.params.value),c};i.calendar=function(e){return new m(e)},i.initTemplate7Templates=function(){window.Template7&&(Template7.templates=Template7.templates||i.params.templates||{},Template7.data=Template7.data||i.params.template7Data||{},Template7.cache=Template7.cache||{},i.templates=Template7.templates,i.template7Data=Template7.data,i.template7Cache=Template7.cache,i.params.precompileTemplates&&s('script[type="text/template7"]').each(function(){var e=s(this).attr("id");e&&(Template7.templates[e]=Template7.compile(s(this).html()))}))};var g=[];return i.initPlugins=function(){for(var e in i.plugins){var a=i.plugins[e](i,i.params[e]);a&&g.push(a)}},i.pluginHook=function(e){for(var a=0;a<g.length;a++)g[a].hooks&&e in g[a].hooks&&g[a].hooks[e](arguments[1],arguments[2],arguments[3],arguments[4],arguments[5])},i.pluginPrevent=function(e){for(var a=!1,t=0;t<g.length;t++)g[t].prevents&&e in g[t].prevents&&g[t].prevents[e](arguments[1],arguments[2],arguments[3],arguments[4],arguments[5])&&(a=!0);return a},i.pluginProcess=function(e,a){for(var t=a,n=0;n<g.length;n++)g[n].preprocess&&e in g[n].preprocess&&(t=g[n].preprocess[e](a,arguments[2],arguments[3],arguments[4],arguments[5],arguments[6]));return t},i.init=function(){i.initTemplate7Templates&&i.initTemplate7Templates(),i.initPlugins&&i.initPlugins(),i.getDeviceInfo&&i.getDeviceInfo(),i.initFastClicks&&i.params.fastClicks&&i.initFastClicks(),i.initClickEvents&&i.initClickEvents(),s(".page:not(.cached)").each(function(){i.initPageWithCallback(this)}),s(".navbar:not(.cached)").each(function(){i.initNavbarWithCallback(this)}),i.initResize&&i.initResize(),i.initPushState&&i.params.pushState&&i.initPushState(),i.initSwipeout&&i.params.swipeout&&i.initSwipeout(),i.initSortable&&i.params.sortable&&i.initSortable(),i.initSwipePanels&&(i.params.swipePanel||i.params.swipePanelOnlyClose)&&i.initSwipePanels(),i.params.material&&i.initMaterialWatchInputs&&i.initMaterialWatchInputs(),i.params.onAppInit&&i.params.onAppInit(),i.pluginHook("appInit")},i.params.init&&i.init(),i};var e=function(){var e=function(e){var a=this,t=0;for(t=0;t<e.length;t++)a[t]=e[t];return a.length=e.length,this},a=function(a,t){var n=[],r=0;if(a&&!t&&a instanceof e)return a;if(a)if("string"==typeof a){var i,o,s;if(a=s=a.trim(),s.indexOf("<")>=0&&s.indexOf(">")>=0){var l="div";for(0===s.indexOf("<li")&&(l="ul"),0===s.indexOf("<tr")&&(l="tbody"),0!==s.indexOf("<td")&&0!==s.indexOf("<th")||(l="tr"),0===s.indexOf("<tbody")&&(l="table"),0===s.indexOf("<option")&&(l="select"),o=document.createElement(l),o.innerHTML=s,r=0;r<o.childNodes.length;r++)n.push(o.childNodes[r])}else for(i=t||"#"!==a[0]||a.match(/[ .<>:~]/)?(t||document).querySelectorAll(a):[document.getElementById(a.split("#")[1])],r=0;r<i.length;r++)i[r]&&n.push(i[r])}else if(a.nodeType||a===window||a===document)n.push(a);else if(a.length>0&&a[0].nodeType)for(r=0;r<a.length;r++)n.push(a[r]);return new e(n)};e.prototype={addClass:function(e){if("undefined"==typeof e)return this;for(var a=e.split(" "),t=0;t<a.length;t++)for(var n=0;n<this.length;n++)"undefined"!=typeof this[n].classList&&this[n].classList.add(a[t]);return this},removeClass:function(e){for(var a=e.split(" "),t=0;t<a.length;t++)for(var n=0;n<this.length;n++)"undefined"!=typeof this[n].classList&&this[n].classList.remove(a[t]);return this},hasClass:function(e){return!!this[0]&&this[0].classList.contains(e)},toggleClass:function(e){for(var a=e.split(" "),t=0;t<a.length;t++)for(var n=0;n<this.length;n++)"undefined"!=typeof this[n].classList&&this[n].classList.toggle(a[t]);return this},attr:function(e,a){if(1===arguments.length&&"string"==typeof e)return this[0]?this[0].getAttribute(e):void 0;for(var t=0;t<this.length;t++)if(2===arguments.length)this[t].setAttribute(e,a);else for(var n in e)this[t][n]=e[n],this[t].setAttribute(n,e[n]);return this},removeAttr:function(e){for(var a=0;a<this.length;a++)this[a].removeAttribute(e);return this},prop:function(e,a){if(1===arguments.length&&"string"==typeof e)return this[0]?this[0][e]:void 0;for(var t=0;t<this.length;t++)if(2===arguments.length)this[t][e]=a;else for(var n in e)this[t][n]=e[n];return this},data:function(e,a){if("undefined"!=typeof a){for(var t=0;t<this.length;t++){var n=this[t];n.dom7ElementDataStorage||(n.dom7ElementDataStorage={}),n.dom7ElementDataStorage[e]=a}return this}if(this[0]){if(this[0].dom7ElementDataStorage&&e in this[0].dom7ElementDataStorage)return this[0].dom7ElementDataStorage[e];var r=this[0].getAttribute("data-"+e);return r?r:void 0}},removeData:function(e){for(var a=0;a<this.length;a++){var t=this[a];t.dom7ElementDataStorage&&t.dom7ElementDataStorage[e]&&(t.dom7ElementDataStorage[e]=null,delete t.dom7ElementDataStorage[e])}},dataset:function(){var e=this[0];if(e){var t={};if(e.dataset)for(var n in e.dataset)t[n]=e.dataset[n];else for(var r=0;r<e.attributes.length;r++){var i=e.attributes[r];i.name.indexOf("data-")>=0&&(t[a.toCamelCase(i.name.split("data-")[1])]=i.value)}for(var o in t)"false"===t[o]?t[o]=!1:"true"===t[o]?t[o]=!0:parseFloat(t[o])===1*t[o]&&(t[o]=1*t[o]);return t}},val:function(e){if("undefined"==typeof e)return this[0]?this[0].value:void 0;for(var a=0;a<this.length;a++)this[a].value=e;return this},transform:function(e){for(var a=0;a<this.length;a++){var t=this[a].style;t.webkitTransform=t.MsTransform=t.msTransform=t.MozTransform=t.OTransform=t.transform=e}return this},transition:function(e){"string"!=typeof e&&(e+="ms");for(var a=0;a<this.length;a++){var t=this[a].style;t.webkitTransitionDuration=t.MsTransitionDuration=t.msTransitionDuration=t.MozTransitionDuration=t.OTransitionDuration=t.transitionDuration=e}return this},on:function(e,t,n,r){function i(e){var r=e.target;if(a(r).is(t))n.call(r,e);else for(var i=a(r).parents(),o=0;o<i.length;o++)a(i[o]).is(t)&&n.call(i[o],e)}var o,s,l=e.split(" ");for(o=0;o<this.length;o++)if("function"==typeof t||t===!1)for("function"==typeof t&&(n=arguments[1],r=arguments[2]||!1),s=0;s<l.length;s++)this[o].addEventListener(l[s],n,r);else for(s=0;s<l.length;s++)this[o].dom7LiveListeners||(this[o].dom7LiveListeners=[]),this[o].dom7LiveListeners.push({listener:n,liveListener:i}),this[o].addEventListener(l[s],i,r);return this},off:function(e,a,t,n){for(var r=e.split(" "),i=0;i<r.length;i++)for(var o=0;o<this.length;o++)if("function"==typeof a||a===!1)"function"==typeof a&&(t=arguments[1],n=arguments[2]||!1),this[o].removeEventListener(r[i],t,n);else if(this[o].dom7LiveListeners)for(var s=0;s<this[o].dom7LiveListeners.length;s++)this[o].dom7LiveListeners[s].listener===t&&this[o].removeEventListener(r[i],this[o].dom7LiveListeners[s].liveListener,n);return this},once:function(e,a,t,n){function r(o){t.call(o.target,o),i.off(e,a,r,n)}var i=this;return"function"==typeof a&&(t=arguments[1],n=arguments[2],a=!1),i.on(e,a,r,n)},trigger:function(e,a){for(var t=e.split(" "),n=0;n<t.length;n++)for(var r=0;r<this.length;r++){var i;try{i=new CustomEvent(t[n],{detail:a,bubbles:!0,cancelable:!0})}catch(e){i=document.createEvent("Event"),i.initEvent(t[n],!0,!0),i.detail=a}this[r].dispatchEvent(i)}return this},transitionEnd:function(e){function a(i){if(i.target===this)for(e.call(this,i),t=0;t<n.length;t++)r.off(n[t],a)}var t,n=["webkitTransitionEnd","transitionend","oTransitionEnd","MSTransitionEnd","msTransitionEnd"],r=this;if(e)for(t=0;t<n.length;t++)r.on(n[t],a);return this},animationEnd:function(e){function a(i){for(e(i),t=0;t<n.length;t++)r.off(n[t],a)}var t,n=["webkitAnimationEnd","OAnimationEnd","MSAnimationEnd","animationend"],r=this;if(e)for(t=0;t<n.length;t++)r.on(n[t],a);return this},width:function(){return this[0]===window?window.innerWidth:this.length>0?parseFloat(this.css("width")):null},outerWidth:function(e){if(this.length>0){if(e){var a=this.styles();return this[0].offsetWidth+parseFloat(a.getPropertyValue("margin-right"))+parseFloat(a.getPropertyValue("margin-left"))}return this[0].offsetWidth}return null},height:function(){return this[0]===window?window.innerHeight:this.length>0?parseFloat(this.css("height")):null},outerHeight:function(e){if(this.length>0){if(e){var a=this.styles();return this[0].offsetHeight+parseFloat(a.getPropertyValue("margin-top"))+parseFloat(a.getPropertyValue("margin-bottom"))}return this[0].offsetHeight}return null},offset:function(){if(this.length>0){var e=this[0],a=e.getBoundingClientRect(),t=document.body,n=e.clientTop||t.clientTop||0,r=e.clientLeft||t.clientLeft||0,i=window.pageYOffset||e.scrollTop,o=window.pageXOffset||e.scrollLeft;return{top:a.top+i-n,left:a.left+o-r}}return null},hide:function(){for(var e=0;e<this.length;e++)this[e].style.display="none";return this},show:function(){for(var e=0;e<this.length;e++)this[e].style.display="block";return this},styles:function(){return this[0]?window.getComputedStyle(this[0],null):void 0},css:function(e,a){var t;if(1===arguments.length){if("string"!=typeof e){for(t=0;t<this.length;t++)for(var n in e)this[t].style[n]=e[n];return this}if(this[0])return window.getComputedStyle(this[0],null).getPropertyValue(e)}if(2===arguments.length&&"string"==typeof e){for(t=0;t<this.length;t++)this[t].style[e]=a;return this}return this},each:function(e){for(var a=0;a<this.length;a++)e.call(this[a],a,this[a]);return this},filter:function(a){for(var t=[],n=this,r=0;r<n.length;r++)a.call(n[r],r,n[r])&&t.push(n[r]);return new e(t)},html:function(e){if("undefined"==typeof e)return this[0]?this[0].innerHTML:void 0;for(var a=0;a<this.length;a++)this[a].innerHTML=e;return this},text:function(e){if("undefined"==typeof e)return this[0]?this[0].textContent.trim():null;for(var a=0;a<this.length;a++)this[a].textContent=e;return this},is:function(t){if(!this[0]||"undefined"==typeof t)return!1;var n,r;if("string"==typeof t){var i=this[0];if(i===document)return t===document;if(i===window)return t===window;if(i.matches)return i.matches(t);if(i.webkitMatchesSelector)return i.webkitMatchesSelector(t);if(i.mozMatchesSelector)return i.mozMatchesSelector(t);if(i.msMatchesSelector)return i.msMatchesSelector(t);for(n=a(t),r=0;r<n.length;r++)if(n[r]===this[0])return!0;return!1}if(t===document)return this[0]===document;if(t===window)return this[0]===window;if(t.nodeType||t instanceof e){for(n=t.nodeType?[t]:t,r=0;r<n.length;r++)if(n[r]===this[0])return!0;return!1}return!1},indexOf:function(e){for(var a=0;a<this.length;a++)if(this[a]===e)return a},index:function(){if(this[0]){for(var e=this[0],a=0;null!==(e=e.previousSibling);)1===e.nodeType&&a++;return a}},eq:function(a){if("undefined"==typeof a)return this;var t,n=this.length;return a>n-1?new e([]):a<0?(t=n+a,new e(t<0?[]:[this[t]])):new e([this[a]])},append:function(a){var t,n;for(t=0;t<this.length;t++)if("string"==typeof a){var r=document.createElement("div");for(r.innerHTML=a;r.firstChild;)this[t].appendChild(r.firstChild)}else if(a instanceof e)for(n=0;n<a.length;n++)this[t].appendChild(a[n]);else this[t].appendChild(a);return this},appendTo:function(e){return a(e).append(this),this},prepend:function(a){var t,n;for(t=0;t<this.length;t++)if("string"==typeof a){var r=document.createElement("div");for(r.innerHTML=a,n=r.childNodes.length-1;n>=0;n--)this[t].insertBefore(r.childNodes[n],this[t].childNodes[0])}else if(a instanceof e)for(n=0;n<a.length;n++)this[t].insertBefore(a[n],this[t].childNodes[0]);else this[t].insertBefore(a,this[t].childNodes[0]);return this},prependTo:function(e){return a(e).prepend(this),this},insertBefore:function(e){for(var t=a(e),n=0;n<this.length;n++)if(1===t.length)t[0].parentNode.insertBefore(this[n],t[0]);else if(t.length>1)for(var r=0;r<t.length;r++)t[r].parentNode.insertBefore(this[n].cloneNode(!0),t[r])},insertAfter:function(e){for(var t=a(e),n=0;n<this.length;n++)if(1===t.length)t[0].parentNode.insertBefore(this[n],t[0].nextSibling);else if(t.length>1)for(var r=0;r<t.length;r++)t[r].parentNode.insertBefore(this[n].cloneNode(!0),t[r].nextSibling)},next:function(t){return new e(this.length>0?t?this[0].nextElementSibling&&a(this[0].nextElementSibling).is(t)?[this[0].nextElementSibling]:[]:this[0].nextElementSibling?[this[0].nextElementSibling]:[]:[])},nextAll:function(t){var n=[],r=this[0];if(!r)return new e([]);for(;r.nextElementSibling;){var i=r.nextElementSibling;t?a(i).is(t)&&n.push(i):n.push(i),r=i}return new e(n)},prev:function(t){return new e(this.length>0?t?this[0].previousElementSibling&&a(this[0].previousElementSibling).is(t)?[this[0].previousElementSibling]:[]:this[0].previousElementSibling?[this[0].previousElementSibling]:[]:[])},prevAll:function(t){var n=[],r=this[0];if(!r)return new e([]);for(;r.previousElementSibling;){var i=r.previousElementSibling;t?a(i).is(t)&&n.push(i):n.push(i),r=i}return new e(n)},siblings:function(e){return this.nextAll(e).add(this.prevAll(e))},parent:function(e){for(var t=[],n=0;n<this.length;n++)null!==this[n].parentNode&&(e?a(this[n].parentNode).is(e)&&t.push(this[n].parentNode):t.push(this[n].parentNode));return a(a.unique(t))},parents:function(e){for(var t=[],n=0;n<this.length;n++)for(var r=this[n].parentNode;r;)e?a(r).is(e)&&t.push(r):t.push(r),r=r.parentNode;return a(a.unique(t))},closest:function(a){var t=this;return"undefined"==typeof a?new e([]):(t.is(a)||(t=t.parents(a).eq(0)),t)},find:function(a){for(var t=[],n=0;n<this.length;n++)for(var r=this[n].querySelectorAll(a),i=0;i<r.length;i++)t.push(r[i]);return new e(t)},children:function(t){for(var n=[],r=0;r<this.length;r++)for(var i=this[r].childNodes,o=0;o<i.length;o++)t?1===i[o].nodeType&&a(i[o]).is(t)&&n.push(i[o]):1===i[o].nodeType&&n.push(i[o]);return new e(a.unique(n))},remove:function(){for(var e=0;e<this.length;e++)this[e].parentNode&&this[e].parentNode.removeChild(this[e]);return this},detach:function(){return this.remove()},add:function(){var e,t,n=this;for(e=0;e<arguments.length;e++){var r=a(arguments[e]);for(t=0;t<r.length;t++)n[n.length]=r[t],n.length++}return n},empty:function(){for(var e=0;e<this.length;e++){var a=this[e];if(1===a.nodeType){for(var t=0;t<a.childNodes.length;t++)a.childNodes[t].parentNode&&a.childNodes[t].parentNode.removeChild(a.childNodes[t]);a.textContent=""}}return this}},function(){function t(t){e.prototype[t]=function(e,n,i){var o;if("undefined"==typeof e){for(o=0;o<this.length;o++)r.indexOf(t)<0&&(t in this[o]?this[o][t]():a(this[o]).trigger(t));return this}return this.on(t,e,n,i)}}for(var n="click blur focus focusin focusout keyup keydown keypress submit change mousedown mousemove mouseup mouseenter mouseleave mouseout mouseover touchstart touchend touchmove resize scroll".split(" "),r="resize scroll".split(" "),i=0;i<n.length;i++)t(n[i])}(),a.parseUrlQuery=function(e){var a,t,n,e=e||location.href,r={};if("string"==typeof e&&e.length){if(e=e.indexOf("#")>-1?e.split("#")[0]:e,!(e.indexOf("?")>-1))return r;for(e=e.split("?")[1],t=e.split("&"),a=0;a<t.length;a++)n=t[a].split("="),r[n[0]]=n[1]}return r},a.isArray=function(e){return"[object Array]"===Object.prototype.toString.apply(e)},a.each=function(t,n){if("object"==typeof t&&n){var r,i;if(a.isArray(t)||t instanceof e)for(r=0;r<t.length;r++)n(r,t[r]);else for(i in t)t.hasOwnProperty(i)&&n(i,t[i])}},a.unique=function(e){for(var a=[],t=0;t<e.length;t++)a.indexOf(e[t])===-1&&a.push(e[t]);return a},a.serializeObject=a.param=function(e,t){function n(e){if(t.length>0){for(var a="",n=0;n<t.length;n++)a+=0===n?t[n]:"["+encodeURIComponent(t[n])+"]";return a+"["+encodeURIComponent(e)+"]"}return encodeURIComponent(e)}function r(e){return encodeURIComponent(e)}if("string"==typeof e)return e;var i=[],o="&";t=t||[];var s;for(var l in e)if(e.hasOwnProperty(l)){var c;if(a.isArray(e[l])){c=[];for(var p=0;p<e[l].length;p++)a.isArray(e[l][p])||"object"!=typeof e[l][p]?c.push(n(l)+"[]="+r(e[l][p])):(s=t.slice(),s.push(l),s.push(p+""),c.push(a.serializeObject(e[l][p],s)));c.length>0&&i.push(c.join(o))}else"object"==typeof e[l]?(s=t.slice(),s.push(l),c=a.serializeObject(e[l],s),""!==c&&i.push(c)):"undefined"!=typeof e[l]&&""!==e[l]&&i.push(n(l)+"="+r(e[l]))}return i.join(o)},a.toCamelCase=function(e){return e.toLowerCase().replace(/-(.)/g,function(e,a){return a.toUpperCase()})},a.dataset=function(e){return a(e).dataset()},a.getTranslate=function(e,a){var t,n,r,i;return"undefined"==typeof a&&(a="x"),r=window.getComputedStyle(e,null),window.WebKitCSSMatrix?(n=r.transform||r.webkitTransform,n.split(",").length>6&&(n=n.split(", ").map(function(e){return e.replace(",",".")}).join(", ")),i=new WebKitCSSMatrix("none"===n?"":n)):(i=r.MozTransform||r.OTransform||r.MsTransform||r.msTransform||r.transform||r.getPropertyValue("transform").replace("translate(","matrix(1, 0, 0, 1,"),t=i.toString().split(",")),"x"===a&&(n=window.WebKitCSSMatrix?i.m41:16===t.length?parseFloat(t[12]):parseFloat(t[4])),"y"===a&&(n=window.WebKitCSSMatrix?i.m42:16===t.length?parseFloat(t[13]):parseFloat(t[5])),n||0},a.requestAnimationFrame=function(e){return window.requestAnimationFrame?window.requestAnimationFrame(e):window.webkitRequestAnimationFrame?window.webkitRequestAnimationFrame(e):window.mozRequestAnimationFrame?window.mozRequestAnimationFrame(e):window.setTimeout(e,1e3/60)},a.cancelAnimationFrame=function(e){return window.cancelAnimationFrame?window.cancelAnimationFrame(e):window.webkitCancelAnimationFrame?window.webkitCancelAnimationFrame(e):window.mozCancelAnimationFrame?window.mozCancelAnimationFrame(e):window.clearTimeout(e)},a.supportTouch=!!("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch),a.fn=e.prototype,a.fn.scrollTo=function(e,t,n,r,i){return 4===arguments.length&&"function"==typeof r&&(i=r,r=void 0),this.each(function(){function o(e){void 0===e&&(e=(new Date).getTime()),null===b&&(b=e);var t,c=Math.max(Math.min((e-b)/n,1),0),p="linear"===r?c:.5-Math.cos(c*Math.PI)/2;return g&&(u=s+p*(d-s)),v&&(h=l+p*(f-l)),g&&d>s&&u>=d&&(m.scrollTop=d,t=!0),g&&d<s&&u<=d&&(m.scrollTop=d,t=!0),v&&f>l&&h>=f&&(m.scrollLeft=f,t=!0),v&&f<l&&h<=f&&(m.scrollLeft=f,t=!0),t?void(i&&i()):(g&&(m.scrollTop=u),v&&(m.scrollLeft=h),void a.requestAnimationFrame(o))}var s,l,c,p,d,f,u,h,m=this,g=t>0||0===t,v=e>0||0===e;if("undefined"==typeof r&&(r="swing"),g&&(s=m.scrollTop,n||(m.scrollTop=t)),v&&(l=m.scrollLeft,n||(m.scrollLeft=e)),n){g&&(c=m.scrollHeight-m.offsetHeight,d=Math.max(Math.min(t,c),0)),v&&(p=m.scrollWidth-m.offsetWidth,f=Math.max(Math.min(e,p),0));var b=null;g&&d===s&&(g=!1),v&&f===l&&(v=!1),a.requestAnimationFrame(o)}})},a.fn.scrollTop=function(e,a,t,n){3===arguments.length&&"function"==typeof t&&(n=t,t=void 0);var r=this;return"undefined"==typeof e?r.length>0?r[0].scrollTop:null:r.scrollTo(void 0,e,a,t,n)},a.fn.scrollLeft=function(e,a,t,n){3===arguments.length&&"function"==typeof t&&(n=t,t=void 0);var r=this;return"undefined"==typeof e?r.length>0?r[0].scrollLeft:null:r.scrollTo(e,void 0,a,t,n)};var t={};a.ajaxSetup=function(e){e.type&&(e.method=e.type),a.each(e,function(e,a){t[e]=a})};var n=0;return a.ajax=function(e){function r(n,r,i){var o=arguments;n&&a(document).trigger(n,r),i&&(i in t&&t[i](o[3],o[4],o[5],o[6]),e[i]&&e[i](o[3],o[4],o[5],o[6]))}var i={method:"GET",data:!1,async:!0,cache:!0,user:"",password:"",headers:{},xhrFields:{},statusCode:{},processData:!0,dataType:"text",contentType:"application/x-www-form-urlencoded",timeout:0},o=["beforeSend","error","complete","success","statusCode"];e.type&&(e.method=e.type),a.each(t,function(e,a){o.indexOf(e)<0&&(i[e]=a)}),a.each(i,function(a,t){a in e||(e[a]=t)}),e.url||(e.url=window.location.toString());var s=e.url.indexOf("?")>=0?"&":"?",l=e.method.toUpperCase();if(("GET"===l||"HEAD"===l||"OPTIONS"===l||"DELETE"===l)&&e.data){var c;c="string"==typeof e.data?e.data.indexOf("?")>=0?e.data.split("?")[1]:e.data:a.serializeObject(e.data),c.length&&(e.url+=s+c,"?"===s&&(s="&"))}if("json"===e.dataType&&e.url.indexOf("callback=")>=0){var p,d="f7jsonp_"+Date.now()+n++,f=e.url.split("callback="),u=f[0]+"callback="+d;if(f[1].indexOf("&")>=0){var h=f[1].split("&").filter(function(e){return e.indexOf("=")>0}).join("&");h.length>0&&(u+="&"+h)}var m=document.createElement("script");return m.type="text/javascript",m.onerror=function(){clearTimeout(p),r(void 0,void 0,"error",null,"scripterror")},m.src=u,window[d]=function(e){clearTimeout(p),r(void 0,void 0,"success",e),m.parentNode.removeChild(m),m=null,delete window[d]},document.querySelector("head").appendChild(m),void(e.timeout>0&&(p=setTimeout(function(){m.parentNode.removeChild(m),m=null,r(void 0,void 0,"error",null,"timeout")},e.timeout)))}"GET"!==l&&"HEAD"!==l&&"OPTIONS"!==l&&"DELETE"!==l||e.cache===!1&&(e.url+=s+"_nocache="+Date.now());
var g=new XMLHttpRequest;g.requestUrl=e.url,g.requestParameters=e,g.open(l,e.url,e.async,e.user,e.password);var v=null;if(("POST"===l||"PUT"===l||"PATCH"===l)&&e.data)if(e.processData){var b=[ArrayBuffer,Blob,Document,FormData];if(b.indexOf(e.data.constructor)>=0)v=e.data;else{var C="---------------------------"+Date.now().toString(16);"multipart/form-data"===e.contentType?g.setRequestHeader("Content-Type","multipart/form-data; boundary="+C):g.setRequestHeader("Content-Type",e.contentType),v="";var y=a.serializeObject(e.data);if("multipart/form-data"===e.contentType){C="---------------------------"+Date.now().toString(16),y=y.split("&");for(var w=[],k=0;k<y.length;k++)w.push('Content-Disposition: form-data; name="'+y[k].split("=")[0]+'"\r\n\r\n'+y[k].split("=")[1]+"\r\n");v="--"+C+"\r\n"+w.join("--"+C+"\r\n")+"--"+C+"--\r\n"}else v="application/x-www-form-urlencoded"===e.contentType?y:y.replace(/&/g,"\r\n")}}else v=e.data;e.headers&&a.each(e.headers,function(e,a){g.setRequestHeader(e,a)}),"undefined"==typeof e.crossDomain&&(e.crossDomain=/^([\w-]+:)?\/\/([^\/]+)/.test(e.url)&&RegExp.$2!==window.location.host),e.crossDomain||g.setRequestHeader("X-Requested-With","XMLHttpRequest"),e.xhrFields&&a.each(e.xhrFields,function(e,a){g[e]=a});var x;return g.onload=function(a){if(x&&clearTimeout(x),g.status>=200&&g.status<300||0===g.status){var n;if("json"===e.dataType)try{n=JSON.parse(g.responseText),r("ajaxSuccess",{xhr:g},"success",n,g.status,g)}catch(e){r("ajaxError",{xhr:g,parseerror:!0},"error",g,"parseerror")}else n="text"===g.responseType||""===g.responseType?g.responseText:g.response,r("ajaxSuccess",{xhr:g},"success",n,g.status,g)}else r("ajaxError",{xhr:g},"error",g,g.status);e.statusCode&&(t.statusCode&&t.statusCode[g.status]&&t.statusCode[g.status](g),e.statusCode[g.status]&&e.statusCode[g.status](g)),r("ajaxComplete",{xhr:g},"complete",g,g.status)},g.onerror=function(e){x&&clearTimeout(x),r("ajaxError",{xhr:g},"error",g,g.status)},r("ajaxStart",{xhr:g},"start",g),r(void 0,void 0,"beforeSend",g),g.send(v),e.timeout>0&&(g.onabort=function(){x&&clearTimeout(x)},x=setTimeout(function(){g.abort(),r("ajaxError",{xhr:g,timeout:!0},"error",g,"timeout"),r("ajaxComplete",{xhr:g,timeout:!0},"complete",g,"timeout")},e.timeout)),g},function(){function e(e){a[e]=function(t,n,r,i){return a.ajax({url:t,method:"post"===e?"POST":"GET",data:"function"==typeof n?void 0:n,success:"function"==typeof n?n:r,error:"function"==typeof n?r:i,dataType:"getJSON"===e?"json":void 0})}}for(var t="get post getJSON".split(" "),n=0;n<t.length;n++)e(t[n])}(),a}();Framework7.$=e;window.Dom7=e,Framework7.prototype.support=function(){var e={touch:!!("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)};return e}(),Framework7.prototype.device=function(){var a={},t=navigator.userAgent,n=e,r=t.match(/(Android);?[\s\/]+([\d.]+)?/),i=t.match(/(iPad).*OS\s([\d_]+)/),o=t.match(/(iPod)(.*OS\s([\d_]+))?/),s=!i&&t.match(/(iPhone\sOS)\s([\d_]+)/);if(a.ios=a.android=a.iphone=a.ipad=a.androidChrome=!1,r&&(a.os="android",a.osVersion=r[2],a.android=!0,a.androidChrome=t.toLowerCase().indexOf("chrome")>=0),(i||s||o)&&(a.os="ios",a.ios=!0),s&&!o&&(a.osVersion=s[2].replace(/_/g,"."),a.iphone=!0),i&&(a.osVersion=i[2].replace(/_/g,"."),a.ipad=!0),o&&(a.osVersion=o[3]?o[3].replace(/_/g,"."):null,a.iphone=!0),a.ios&&a.osVersion&&t.indexOf("Version/")>=0&&"10"===a.osVersion.split(".")[0]&&(a.osVersion=t.toLowerCase().split("version/")[1].split(" ")[0]),a.webView=(s||i||o)&&t.match(/.*AppleWebKit(?!.*Safari)/i),a.os&&"ios"===a.os){var l=a.osVersion.split(".");a.minimalUi=!a.webView&&(o||s)&&(1*l[0]===7?1*l[1]>=1:1*l[0]>7)&&n('meta[name="viewport"]').length>0&&n('meta[name="viewport"]').attr("content").indexOf("minimal-ui")>=0}var c=n(window).width(),p=n(window).height();a.statusBar=!1,a.webView&&c*p===screen.width*screen.height?a.statusBar=!0:a.statusBar=!1;var d=[];if(a.pixelRatio=window.devicePixelRatio||1,d.push("pixel-ratio-"+Math.floor(a.pixelRatio)),a.pixelRatio>=2&&d.push("retina"),a.os&&(d.push(a.os,a.os+"-"+a.osVersion.split(".")[0],a.os+"-"+a.osVersion.replace(/\./g,"-")),"ios"===a.os))for(var f=parseInt(a.osVersion.split(".")[0],10),u=f-1;u>=6;u--)d.push("ios-gt-"+u);return a.statusBar?d.push("with-statusbar-overlay"):n("html").removeClass("with-statusbar-overlay"),d.length>0&&n("html").addClass(d.join(" ")),a}(),Framework7.prototype.plugins={},window.Template7=function(){function e(e){return"[object Array]"===Object.prototype.toString.apply(e)}function a(e){return"function"==typeof e}function t(e){return"undefined"!=typeof window&&window.escape?window.escape(e):e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function n(e){var a,t,n,r=e.replace(/[{}#}]/g,"").split(" "),s=[];for(t=0;t<r.length;t++){var l,c,p=r[t];if(0===t)s.push(p);else if(0===p.indexOf('"')||0===p.indexOf("'"))if(l=0===p.indexOf('"')?o:i,c=0===p.indexOf('"')?'"':"'",2===p.match(l).length)s.push(p);else{for(a=0,n=t+1;n<r.length;n++)if(p+=" "+r[n],r[n].indexOf(c)>=0){a=n,s.push(p);break}a&&(t=a)}else if(p.indexOf("=")>0){var d=p.split("="),f=d[0],u=d[1];if(2!==u.match(l).length){for(a=0,n=t+1;n<r.length;n++)if(u+=" "+r[n],r[n].indexOf(c)>=0){a=n;break}a&&(t=a)}var h=[f,u.replace(l,"")];s.push(h)}else s.push(p)}return s}function r(a){var t,r,i=[];if(!a)return[];var o=a.split(/({{[^{^}]*}})/);for(t=0;t<o.length;t++){var s=o[t];if(""!==s)if(s.indexOf("{{")<0)i.push({type:"plain",content:s});else{if(s.indexOf("{/")>=0)continue;if(s.indexOf("{#")<0&&s.indexOf(" ")<0&&s.indexOf("else")<0){i.push({type:"variable",contextName:s.replace(/[{}]/g,"")});continue}var l=n(s),c=l[0],p=">"===c,d=[],f={};for(r=1;r<l.length;r++){var u=l[r];e(u)?f[u[0]]="false"!==u[1]&&u[1]:d.push(u)}if(s.indexOf("{#")>=0){var h,m="",g="",v=0,b=!1,C=!1,y=0;for(r=t+1;r<o.length;r++)if(o[r].indexOf("{{#")>=0&&y++,o[r].indexOf("{{/")>=0&&y--,o[r].indexOf("{{#"+c)>=0)m+=o[r],C&&(g+=o[r]),v++;else if(o[r].indexOf("{{/"+c)>=0){if(!(v>0)){h=r,b=!0;break}v--,m+=o[r],C&&(g+=o[r])}else o[r].indexOf("else")>=0&&0===y?C=!0:(C||(m+=o[r]),C&&(g+=o[r]));b&&(h&&(t=h),i.push({type:"helper",helperName:c,contextName:d,content:m,inverseContent:g,hash:f}))}else s.indexOf(" ")>0&&(p&&(c="_partial",d[0]&&(d[0]='"'+d[0].replace(/"|'/g,"")+'"')),i.push({type:"helper",helperName:c,contextName:d,hash:f}))}}return i}var i=new RegExp("'","g"),o=new RegExp('"',"g"),s=function(e,a){function t(e,a){return e.content?s(e.content,a):function(){return""}}function n(e,a){return e.inverseContent?s(e.inverseContent,a):function(){return""}}function i(e,a){var t,n,r=0;if(0===e.indexOf("../")){r=e.split("../").length-1;var i=a.split("_")[1]-r;a="ctx_"+(i>=1?i:1),n=e.split("../")[r].split(".")}else 0===e.indexOf("@global")?(a="Template7.global",n=e.split("@global.")[1].split(".")):0===e.indexOf("@root")?(a="root",n=e.split("@root.")[1].split(".")):n=e.split(".");t=a;for(var o=0;o<n.length;o++){var s=n[o];0===s.indexOf("@")?o>0?t+="[(data && data."+s.replace("@","")+")]":t="(data && data."+e.replace("@","")+")":isFinite(s)?t+="["+s+"]":0===s.indexOf("this")?t=s.replace("this",a):t+="."+s}return t}function o(e,a){for(var t=[],n=0;n<e.length;n++)/^['"]/.test(e[n])?t.push(e[n]):/^(true|false|\d+)$/.test(e[n])?t.push(e[n]):t.push(i(e[n],a));return t.join(", ")}function s(e,a){if(a=a||1,e=e||l.template,"string"!=typeof e)throw new Error("Template7: Template must be a string");var s=r(e);if(0===s.length)return function(){return""};var c="ctx_"+a,p="";p+=1===a?"(function ("+c+", data, root) {\n":"(function ("+c+", data) {\n",1===a&&(p+="function isArray(arr){return Object.prototype.toString.apply(arr) === '[object Array]';}\n",p+="function isFunction(func){return (typeof func === 'function');}\n",p+='function c(val, ctx) {if (typeof val !== "undefined" && val !== null) {if (isFunction(val)) {return val.call(ctx);} else return val;} else return "";}\n',p+="root = root || ctx_1 || {};\n"),p+="var r = '';\n";var d;for(d=0;d<s.length;d++){var f=s[d];if("plain"!==f.type){var u,h;if("variable"===f.type&&(u=i(f.contextName,c),p+="r += c("+u+", "+c+");"),"helper"===f.type)if(f.helperName in l.helpers)h=o(f.contextName,c),p+="r += (Template7.helpers."+f.helperName+").call("+c+", "+(h&&h+", ")+"{hash:"+JSON.stringify(f.hash)+", data: data || {}, fn: "+t(f,a+1)+", inverse: "+n(f,a+1)+", root: root});";else{if(f.contextName.length>0)throw new Error('Template7: Missing helper: "'+f.helperName+'"');u=i(f.helperName,c),p+="if ("+u+") {",p+="if (isArray("+u+")) {",p+="r += (Template7.helpers.each).call("+c+", "+u+", {hash:"+JSON.stringify(f.hash)+", data: data || {}, fn: "+t(f,a+1)+", inverse: "+n(f,a+1)+", root: root});",p+="}else {",p+="r += (Template7.helpers.with).call("+c+", "+u+", {hash:"+JSON.stringify(f.hash)+", data: data || {}, fn: "+t(f,a+1)+", inverse: "+n(f,a+1)+", root: root});",p+="}}"}}else p+="r +='"+f.content.replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/'/g,"\\'")+"';"}return p+="\nreturn r;})",eval.call(window,p)}var l=this;l.template=e,l.compile=function(e){return l.compiled||(l.compiled=s(e)),l.compiled}};s.prototype={options:{},partials:{},helpers:{_partial:function(e,a){var t=s.prototype.partials[e];if(!t||t&&!t.template)return"";t.compiled||(t.compiled=new s(t.template).compile());var n=this;for(var r in a.hash)n[r]=a.hash[r];return t.compiled(n,a.data,a.root)},escape:function(e,a){if("string"!=typeof e)throw new Error('Template7: Passed context to "escape" helper should be a string');return t(e)},if:function(e,t){return a(e)&&(e=e.call(this)),e?t.fn(this,t.data):t.inverse(this,t.data)},unless:function(e,t){return a(e)&&(e=e.call(this)),e?t.inverse(this,t.data):t.fn(this,t.data)},each:function(t,n){var r="",i=0;if(a(t)&&(t=t.call(this)),e(t)){for(n.hash.reverse&&(t=t.reverse()),i=0;i<t.length;i++)r+=n.fn(t[i],{first:0===i,last:i===t.length-1,index:i});n.hash.reverse&&(t=t.reverse())}else for(var o in t)i++,r+=n.fn(t[o],{key:o});return i>0?r:n.inverse(this)},with:function(e,t){return a(e)&&(e=e.call(this)),t.fn(e)},join:function(e,t){return a(e)&&(e=e.call(this)),e.join(t.hash.delimiter||t.hash.delimeter)},js:function(e,a){var t;return t=e.indexOf("return")>=0?"(function(){"+e+"})":"(function(){return ("+e+")})",eval.call(this,t).call(this)},js_compare:function(e,a){var t;t=e.indexOf("return")>=0?"(function(){"+e+"})":"(function(){return ("+e+")})";var n=eval.call(this,t).call(this);return n?a.fn(this,a.data):a.inverse(this,a.data)}}};var l=function(e,a){if(2===arguments.length){var t=new s(e),n=t.compile()(a);return t=null,n}return new s(e)};return l.registerHelper=function(e,a){s.prototype.helpers[e]=a},l.unregisterHelper=function(e){s.prototype.helpers[e]=void 0,delete s.prototype.helpers[e]},l.registerPartial=function(e,a){s.prototype.partials[e]={template:a}},l.unregisterPartial=function(e,a){s.prototype.partials[e]&&(s.prototype.partials[e]=void 0,delete s.prototype.partials[e])},l.compile=function(e,a){var t=new s(e,a);return t.compile()},l.options=s.prototype.options,l.helpers=s.prototype.helpers,l.partials=s.prototype.partials,l}()}();
