document.documentElement.className+=" js_active ",document.documentElement.className+="ontouchstart"in document.documentElement?" vc_mobile ":" vc_desktop ",(()=>{for(var e=["-webkit-","-moz-","-ms-","-o-",""],t=0;t<e.length;t++)e[t]+"transform"in document.documentElement.style&&(document.documentElement.className+=" vc_transform ")})(),(c=>{"function"!=typeof window.vc_js&&(window.vc_js=function(){vc_toggleBehaviour(),vc_tabsBehaviour(),vc_accordionBehaviour(),vc_teaserGrid(),vc_carouselBehaviour(),vc_slidersBehaviour(),vc_prettyPhoto(),vc_pinterest(),vc_progress_bar(),vc_plugin_flexslider(),vc_gridBehaviour(),vc_rowBehaviour(),vc_prepareHoverBox(),vc_googleMapsPointer(),vc_ttaActivation(),vc_ttaToggleBehaviour(),jQuery(document).trigger("vc_js"),window.setTimeout(vc_waypoints,500)}),"function"!=typeof window.vc_plugin_flexslider&&(window.vc_plugin_flexslider=function(e){(e?e.find(".wpb_flexslider"):jQuery(".wpb_flexslider")).each(function(){var e=jQuery(this),t=1e3*parseInt(e.attr("data-interval"),10),i=e.attr("data-flex_fx"),o=0==t?!1:!0;e.is(":visible")&&setTimeout(function(){e.flexslider({animation:i,slideshow:o,slideshowSpeed:t,sliderSpeed:800,smoothHeight:!0})},1)})}),"function"!=typeof window.vc_googleplus&&(window.vc_googleplus=function(){var e,t;0<jQuery(".wpb_googleplus").length&&((e=document.createElement("script")).type="text/javascript",e.async=!0,e.src="https://apis.google.com/js/plusone.js",(t=document.getElementsByTagName("script")[0]).parentNode.insertBefore(e,t))}),"function"!=typeof window.vc_pinterest&&(window.vc_pinterest=function(){var e,t;0<jQuery(".wpb_pinterest").length&&((e=document.createElement("script")).type="text/javascript",e.async=!0,e.src="https://assets.pinterest.com/js/pinit.js",(t=document.getElementsByTagName("script")[0]).parentNode.insertBefore(e,t))}),"function"!=typeof window.vc_progress_bar&&(window.vc_progress_bar=function(){void 0!==jQuery.fn.vcwaypoint&&jQuery(".vc_progress_bar").each(function(){var e=jQuery(this);e.vcwaypoint(function(){e.find(".vc_single_bar").each(function(e){var t=jQuery(this).find(".vc_bar"),i=t.data("percentage-value");setTimeout(function(){t.css({width:i+"%"})},200*e)})},{offset:"85%"})})}),"function"!=typeof window.vc_waypoints&&(window.vc_waypoints=function(){void 0!==jQuery.fn.vcwaypoint&&jQuery(".wpb_animate_when_almost_visible:not(.wpb_start_animation)").each(function(){var e=jQuery(this);e.vcwaypoint(function(){e.addClass("wpb_start_animation animated")},{offset:"85%"})})}),"function"!=typeof window.vc_toggleBehaviour&&(window.vc_toggleBehaviour=function(e){function t(e){e&&e.preventDefault&&e.preventDefault();var t=jQuery(this).closest(".vc_toggle"),e=t.find(".vc_toggle_content");t.hasClass("vc_toggle_active")?e.slideUp({duration:300,complete:function(){t.removeClass("vc_toggle_active")}}):e.slideDown({duration:300,complete:function(){t.addClass("vc_toggle_active")}})}(e?e.hasClass("vc_toggle_title")?e.unbind("click"):e.find(".vc_toggle_title").off("click"):jQuery(".vc_toggle_title").off("click")).on("click",t)}),"function"!=typeof window.vc_ttaToggleBehaviour&&(window.vc_ttaToggleBehaviour=function(e){function t(){var e=jQuery(this);e.toggleClass("wpb-tta-toggle-active"),e.parent().parent().parent().find(".vc_pagination-item").each(function(){if(!c(this).hasClass("vc_active"))return c(this).find("a").click(),!1})}(e?e.find(".wpb-tta-toggle"):jQuery(".wpb-tta-toggle")).off("click").on("click",t),setTimeout(function(){jQuery(".wpb-tta-toggle").each(function(){var e=jQuery(this);e.parent().parent().parent().find(".vc_tta-panels-container .vc_pagination li:first").hasClass("vc_active")||e.addClass("wpb-tta-toggle-active")})},1e3)}),"function"!=typeof window.vc_tabsBehaviour&&(window.vc_tabsBehaviour=function(e){var t,o;jQuery.ui&&(e=e||jQuery(".wpb_tabs, .wpb_tour"),t=jQuery.ui&&jQuery.ui.version?jQuery.ui.version.split("."):"1.10",o=1===parseInt(t[0],10)&&parseInt(t[1],10)<9,e.each(function(){var e=jQuery(this).attr("data-interval"),t=[],i=jQuery(this).find(".wpb_tour_tabs_wrapper").tabs({show:function(e,t){wpb_prepare_tab_content(e,t)},activate:function(e,t){wpb_prepare_tab_content(e,t)}});if(e&&0<e)try{i.tabs("rotate",1e3*e)}catch(e){window.console&&window.console.warn&&console.warn("tabs behaviours error",e)}jQuery(this).find(".wpb_tab").each(function(){t.push(this.id)}),jQuery(this).find(".wpb_tabs_nav li").on("click",function(e){return e&&e.preventDefault&&e.preventDefault(),o?i.tabs("select",jQuery("a",this).attr("href")):i.tabs("option","active",jQuery(this).index()),!1}),jQuery(this).find(".wpb_prev_slide a, .wpb_next_slide a").on("click",function(e){var t;e&&e.preventDefault&&e.preventDefault(),o?(t=i.tabs("option","selected"),jQuery(this).parent().hasClass("wpb_next_slide")?t++:t--,t<0?t=i.tabs("length")-1:t>=i.tabs("length")&&(t=0),i.tabs("select",t)):(t=i.tabs("option","active"),e=i.find(".wpb_tab").length,t=jQuery(this).parent().hasClass("wpb_next_slide")?e<=t+1?0:t+1:t-1<0?e-1:t-1,i.tabs("option","active",t))})}))}),"function"!=typeof window.vc_accordionBehaviour&&(window.vc_accordionBehaviour=function(){jQuery(".wpb_accordion").each(function(){var e=jQuery(this),t=(e.attr("data-interval"),!isNaN(jQuery(this).data("active-tab"))&&0<parseInt(e.data("active-tab"),10)&&parseInt(e.data("active-tab"),10)-1),i=!1===t||"yes"===e.data("collapsible"),t=e.find(".wpb_accordion_wrapper").accordion({header:"> div > h3",autoHeight:!1,heightStyle:"content",active:t,collapsible:i,navigation:!0,activate:vc_accordionActivate,change:function(e,t){void 0!==jQuery.fn.isotope&&t.newContent.find(".isotope").isotope("layout"),vc_carouselBehaviour(t.newPanel)}});!0===e.data("vcDisableKeydown")&&(t.data("uiAccordion")._keydown=function(){})})}),"function"!=typeof window.vc_teaserGrid&&(window.vc_teaserGrid=function(){var o={fitrows:"fitRows",masonry:"masonry"};jQuery(".wpb_grid .teaser_grid_container:not(.wpb_carousel), .wpb_filtered_grid .teaser_grid_container:not(.wpb_carousel)").each(function(){var e=jQuery(this),t=e.find(".wpb_thumbnails"),i=t.attr("data-layout-mode");t.isotope({itemSelector:".isotope-item",layoutMode:void 0===o[i]?"fitRows":o[i]}),e.find(".categories_filter a").data("isotope",t).on("click",function(e){e&&e.preventDefault&&e.preventDefault();e=jQuery(this).data("isotope");jQuery(this).parent().parent().find(".active").removeClass("active"),jQuery(this).parent().addClass("active"),e.isotope({filter:jQuery(this).attr("data-filter")})}),jQuery(window).on("load resize",function(){t.isotope("layout")})})}),"function"!=typeof window.vc_carouselBehaviour&&(window.vc_carouselBehaviour=function(e){(e?e.find(".wpb_carousel"):jQuery(".wpb_carousel")).each(function(){var e=jQuery(this);!0!==e.data("carousel_enabled")&&e.is(":visible")&&(e.data("carousel_enabled",!0),getColumnsCount(jQuery(this)),jQuery(this).hasClass("columns_count_1"),(e=jQuery(this).find(".wpb_thumbnails-fluid li")).css({"margin-right":e.css("margin-left"),"margin-left":0}),(e=jQuery(this).find("ul.wpb_thumbnails-fluid")).width(e.width()+300))})}),"function"!=typeof window.vc_slidersBehaviour&&(window.vc_slidersBehaviour=function(){jQuery(".wpb_gallery_slides").each(function(){var e,t,i=jQuery(this);i.hasClass("wpb_slider_nivo")?(0===(t=1e3*i.attr("data-interval"))&&(t=9999999999),jQuery.fn.nivoSlider&&!i.data("nivo-initialized")&&(i.data("nivo-initialized",!0),i.find(".nivoSlider").nivoSlider({effect:"boxRainGrow,boxRain,boxRainReverse,boxRainGrowReverse",slices:15,boxCols:8,boxRows:4,animSpeed:800,pauseTime:t,startSlide:0,directionNav:!0,directionNavHide:!0,controlNav:!0,keyboardNav:!1,pauseOnHover:!0,manualAdvance:!1,prevText:"Prev",nextText:"Next",afterLoad:function(){var e=c(this),t=e.find(".nivo-main-image");t.length&&e.height(t.height())},afterChange:function(){var e=c(this),t=e.find(".nivo-main-image");t.length&&e.height(t.height())}}))):i.hasClass("wpb_image_grid")&&i.find(".wpb_image_grid_ul")&&i.find(".wpb_image_grid_ul").isotope&&(jQuery.fn.imagesLoaded?e=i.find(".wpb_image_grid_ul").imagesLoaded(function(){e.isotope({itemSelector:".isotope-item",layoutMode:"fitRows",percentPosition:!0})}):i.find(".wpb_image_grid_ul").isotope({itemSelector:".isotope-item",layoutMode:"fitRows",percentPosition:!0}))})}),"function"!=typeof window.vc_prettyPhoto&&(window.vc_prettyPhoto=function(){try{jQuery&&jQuery.fn&&jQuery.fn.prettyPhoto&&jQuery('a.prettyphoto, .gallery-icon a[href*=".jpg"]').prettyPhoto({animationSpeed:"normal",hook:"data-rel",padding:15,opacity:.7,showTitle:!0,allowresize:!0,counter_separator_label:"/",hideflash:!1,deeplinking:!1,modal:!1,callback:function(){-1<location.href.indexOf("#!prettyPhoto")&&(location.hash="")},social_tools:""})}catch(e){window.console&&window.console.warn&&window.console.warn("vc_prettyPhoto initialize error",e)}}),"function"!=typeof window.vc_google_fonts&&(window.vc_google_fonts=function(){return window.console&&window.console.warn&&window.console.warn("function vc_google_fonts is deprecated, no need to use it"),!1}),window.vcParallaxSkroll=!1,"function"!=typeof window.vc_rowBehaviour&&(window.vc_rowBehaviour=function(){var s=window.jQuery;function e(){var e;void 0!==window.wpb_disable_full_width_row_js&&window.wpb_disable_full_width_row_js||(e=s('[data-vc-full-width="true"]'),s.each(e,function(){var e,t,i,o,n,a,r,c=s(this),d=(c.addClass("vc_hidden"),c.next(".vc_row-full-width"));(d=d.length?d:c.parent().next(".vc_row-full-width")).length&&(c.removeAttr("data-vc-full-width-temp"),e=parseInt(c.css("margin-left"),10),t=parseInt(c.css("margin-right"),10),i=0-d.offset().left-e,o=s(window).width(),n={position:"relative",left:i="rtl"===c.css("direction")?(i=i-d.width()+o)+e+t:i,"box-sizing":"border-box",width:o,"max-width":o},c.css(n),c.data("vcStretchContent")||("rtl"===c.css("direction")?((a=i)<0&&(a=0),(r=i)<0&&(r=0)):(r=o-(a=(a=-1*i)<0?0:a)-d.width()+e+t)<0&&(r=0),c.css({"padding-left":a+"px","padding-right":r+"px"})),c.attr("data-vc-full-width-init","true"),c.removeClass("vc_hidden"),s(document).trigger("vc-full-width-row-single",{el:c,offset:i,marginLeft:e,marginRight:t,elFull:d,width:o,maxWidth:o}))}),s(document).trigger("vc-full-width-row",e))}function t(){var e,t,i=s(".vc_row-o-full-height:first");i.length&&(e=s(window).height(),(t=i.offset().top)<e)&&i.css("min-height",100-t/(e/100)+"vh"),s(document).trigger("vc-full-height-row",i)}s(window).off("resize.vcRowBehaviour").on("resize.vcRowBehaviour",e).on("resize.vcRowBehaviour",t),e(),t(),(0<window.navigator.userAgent.indexOf("MSIE ")||navigator.userAgent.match(/Trident.*rv\:11\./))&&s(".vc_row-o-full-height").each(function(){"flex"===s(this).css("display")&&s(this).wrap('<div class="vc_ie-flexbox-fixer"></div>')}),vc_initVideoBackgrounds();var n=!1;if(window.vcParallaxSkroll&&window.vcParallaxSkroll.destroy(),s(".vc_parallax-inner").remove(),s("[data-5p-top-bottom]").removeAttr("data-5p-top-bottom data-30p-top-bottom"),s("[data-vc-parallax]").each(function(){var e,t,i,o;n=!0,"on"===s(this).data("vcParallaxOFade")&&s(this).children().attr("data-5p-top-bottom","opacity:0;").attr("data-30p-top-bottom","opacity:1;"),e=100*s(this).data("vcParallax"),(t=s("<div />").addClass("vc_parallax-inner").appendTo(s(this))).height(e+"%"),i=s(this).data("vcParallaxImage"),(o=vcExtractYoutubeId(i))?insertYoutubeVideoAsBackground(t,o):void 0!==i&&t.css("background-image","url("+i+")"),t.attr("data-bottom-top","top: "+-(e-100)+"%;").attr("data-top-bottom","top: 0%;")}),n&&window.skrollr)window.vcParallaxSkroll=skrollr.init({forceHeight:!1,smoothScrolling:!1,mobileCheck:function(){return!1}}),window.vcParallaxSkroll}),"function"!=typeof window.vc_gridBehaviour&&(window.vc_gridBehaviour=function(){jQuery.fn.vcGrid&&jQuery("[data-vc-grid]").vcGrid()}),"function"!=typeof window.getColumnsCount&&(window.getColumnsCount=function(e){for(var t=!1,i=1;!1===t;){if(e.hasClass("columns_count_"+i))return t=!0,i;i++}}),"function"!=typeof window.wpb_prepare_tab_content&&(window.wpb_prepare_tab_content=function(e,t){var i=t.panel||t.newPanel,o=i.find(".vc_pie_chart:not(.vc_ready)"),n=i.find(".vc_round-chart"),a=i.find(".vc_line-chart"),r=i.find('[data-ride="vc_carousel"]');vc_carouselBehaviour(),vc_plugin_flexslider(i),t.newPanel.find(".vc_masonry_media_grid, .vc_masonry_grid").length&&t.newPanel.find(".vc_masonry_media_grid, .vc_masonry_grid").each(function(){var e=jQuery(this).data("vcGrid");e&&e.gridBuilder&&e.gridBuilder.setMasonry&&e.gridBuilder.setMasonry()}),i.find(".vc_masonry_media_grid, .vc_masonry_grid").length&&i.find(".vc_masonry_media_grid, .vc_masonry_grid").each(function(){var e=jQuery(this).data("vcGrid");e&&e.gridBuilder&&e.gridBuilder.setMasonry&&e.gridBuilder.setMasonry()}),o.length&&jQuery.fn.vcChat&&o.vcChat(),n.length&&jQuery.fn.vcRoundChart&&n.vcRoundChart({reload:!1}),a.length&&jQuery.fn.vcLineChart&&a.vcLineChart({reload:!1}),r.length&&jQuery.fn.carousel&&r.carousel("resizeAction"),t=i.find(".isotope, .wpb_image_grid_ul"),o=i.find(".wpb_gmaps_widget"),0<t.length&&t.isotope("layout"),o.length&&!o.is(".map_ready")&&((n=o.find("iframe")).attr("src",n.attr("src")),o.addClass("map_ready")),i.parents(".isotope").length&&i.parents(".isotope").each(function(){jQuery(this).isotope("layout")}),c(document).trigger("wpb_prepare_tab_content",i)}),"function"!=typeof window.vc_ttaActivation&&(window.vc_ttaActivation=function(){jQuery("[data-vc-accordion]").on("show.vc.accordion",function(e){var t=window.jQuery,i={};i.newPanel=t(this).data("vc.accordion").getTarget(),window.wpb_prepare_tab_content(e,i)})}),"function"!=typeof window.vc_accordionActivate&&(window.vc_accordionActivate=function(e,t){var i,o,n,a;t.newPanel.length&&t.newHeader.length&&(i=t.newPanel.find(".vc_pie_chart:not(.vc_ready)"),o=t.newPanel.find(".vc_round-chart"),n=t.newPanel.find(".vc_line-chart"),a=t.newPanel.find('[data-ride="vc_carousel"]'),void 0!==jQuery.fn.isotope&&t.newPanel.find(".isotope, .wpb_image_grid_ul").isotope("layout"),t.newPanel.find(".vc_masonry_media_grid, .vc_masonry_grid").length&&t.newPanel.find(".vc_masonry_media_grid, .vc_masonry_grid").each(function(){var e=jQuery(this).data("vcGrid");e&&e.gridBuilder&&e.gridBuilder.setMasonry&&e.gridBuilder.setMasonry()}),vc_carouselBehaviour(t.newPanel),vc_plugin_flexslider(t.newPanel),i.length&&jQuery.fn.vcChat&&i.vcChat(),o.length&&jQuery.fn.vcRoundChart&&o.vcRoundChart({reload:!1}),n.length&&jQuery.fn.vcLineChart&&n.vcLineChart({reload:!1}),a.length&&jQuery.fn.carousel&&a.carousel("resizeAction"),t.newPanel.parents(".isotope").length)&&t.newPanel.parents(".isotope").each(function(){jQuery(this).isotope("layout")})}),"function"!=typeof window.initVideoBackgrounds&&(window.initVideoBackgrounds=function(){return window.console&&window.console.warn&&window.console.warn("this function is deprecated use vc_initVideoBackgrounds"),vc_initVideoBackgrounds()}),"function"!=typeof window.vc_initVideoBackgrounds&&(window.vc_initVideoBackgrounds=function(){c(".vc_video-bg").remove(),c("[data-vc-video-bg]").each(function(){var e,i=jQuery(this);i.data("vcVideoBg")?(e=i.data("vcVideoBg"),(e=vcExtractYoutubeId(e))&&(i.find(".vc_video-bg").remove(),insertYoutubeVideoAsBackground(i,e)),jQuery(window).on("grid:items:added",function(e,t){i.has(t).length&&vcResizeVideoBackground(i)})):i.find(".vc_video-bg").remove()})}),"function"!=typeof window.insertYoutubeVideoAsBackground&&(window.insertYoutubeVideoAsBackground=function(e,t,i){if("undefined"==typeof YT||void 0===YT.Player)return 100<(i=void 0===i?0:i)?void console.warn("Too many attempts to load YouTube api"):void setTimeout(function(){insertYoutubeVideoAsBackground(e,t,i++)},100);var o=e.prepend('<div class="vc_video-bg"><div class="inner"></div></div>').find(".inner");new YT.Player(o[0],{width:"100%",height:"100%",videoId:t,playerVars:{playlist:t,iv_load_policy:3,enablejsapi:1,disablekb:1,autoplay:1,controls:0,showinfo:0,rel:0,loop:1,mute:1,wmode:"transparent"},events:{onReady:function(e){e.target.mute().setLoop(!0)}}}),vcResizeVideoBackground(e),jQuery(window).on("resize",function(){vcResizeVideoBackground(e)})}),"function"!=typeof window.vcResizeVideoBackground&&(window.vcResizeVideoBackground=function(e){var t,i,o,n,a=e.innerWidth(),r=e.innerHeight();a/r<16/9?(t=r*(16/9),i=r,o=-Math.round((t-a)/2)+"px",n=-Math.round((i-r)/2)+"px"):(i=(t=a)*(9/16),n=-Math.round((i-r)/2)+"px",o=-Math.round((t-a)/2)+"px"),t+="px",i+="px",e.find(".vc_video-bg iframe").css({maxWidth:"1000%",marginLeft:o,marginTop:n,width:t,height:i})}),"function"!=typeof window.vcExtractYoutubeId&&(window.vcExtractYoutubeId=function(e){return void 0!==e&&null!==(e=e.match(/(?:https?:\/{2})?(?:w{3}\.)?youtu(?:be)?\.(?:com|be)(?:\/watch\?v=|\/)([^\s&]+)/))&&e[1]}),"function"!=typeof window.vc_googleMapsPointer&&(window.vc_googleMapsPointer=function(){var e=window.jQuery,t=e(".wpb_gmaps_widget");t.on("click",function(){e("iframe",this).css("pointer-events","auto")}),t.on("mouseleave",function(){e("iframe",this).css("pointer-events","none")}),e(".wpb_gmaps_widget iframe").css("pointer-events","none")}),"function"!=typeof window.vc_setHoverBoxPerspective&&(window.vc_setHoverBoxPerspective=function(e){e.each(function(){var e=jQuery(this),t=e.width();e.css("perspective",4*t+"px")})}),"function"!=typeof window.vc_setHoverBoxHeight&&(window.vc_setHoverBoxHeight=function(e){e.each(function(){var e=jQuery(this),t=e.find(".vc-hoverbox-inner"),i=(t.css("min-height",0),e.find(".vc-hoverbox-front-inner").outerHeight()),e=e.find(".vc-hoverbox-back-inner").outerHeight(),i=e<i?i:e;t.css("min-height",(i=i<250?250:i)+"px")})}),"function"!=typeof window.vc_prepareHoverBox&&(window.vc_prepareHoverBox=function(){var e=jQuery(".vc-hoverbox");vc_setHoverBoxHeight(e),vc_setHoverBoxPerspective(e)}),jQuery(document).ready(window.vc_prepareHoverBox),jQuery(window).on("resize",window.vc_prepareHoverBox),jQuery(document).ready(function(){window.vc_js()})})(window.jQuery);
(function(factory){
"use strict";
if(typeof define==="function"&&define.amd){
define([
"jquery",
"../ie",
"../version",
"../widget"
], factory);
}else{
factory(jQuery);
}})(function($){
"use strict";
var mouseHandled=false;
$(document).on("mouseup", function(){
mouseHandled=false;
});
return $.widget("ui.mouse", {
version: "1.13.3",
options: {
cancel: "input, textarea, button, select, option",
distance: 1,
delay: 0
},
_mouseInit: function(){
var that=this;
this.element
.on("mousedown." + this.widgetName, function(event){
return that._mouseDown(event);
})
.on("click." + this.widgetName, function(event){
if(true===$.data(event.target, that.widgetName + ".preventClickEvent") ){
$.removeData(event.target, that.widgetName + ".preventClickEvent");
event.stopImmediatePropagation();
return false;
}});
this.started=false;
},
_mouseDestroy: function(){
this.element.off("." + this.widgetName);
if(this._mouseMoveDelegate){
this.document
.off("mousemove." + this.widgetName, this._mouseMoveDelegate)
.off("mouseup." + this.widgetName, this._mouseUpDelegate);
}},
_mouseDown: function(event){
if(mouseHandled){
return;
}
this._mouseMoved=false;
if(this._mouseStarted){
this._mouseUp(event);
}
this._mouseDownEvent=event;
var that=this,
btnIsLeft=(event.which===1),
elIsCancel=(typeof this.options.cancel==="string"&&event.target.nodeName ?
$(event.target).closest(this.options.cancel).length:false);
if(!btnIsLeft||elIsCancel||!this._mouseCapture(event) ){
return true;
}
this.mouseDelayMet = !this.options.delay;
if(!this.mouseDelayMet){
this._mouseDelayTimer=setTimeout(function(){
that.mouseDelayMet=true;
}, this.options.delay);
}
if(this._mouseDistanceMet(event)&&this._mouseDelayMet(event) ){
this._mouseStarted=(this._mouseStart(event)!==false);
if(!this._mouseStarted){
event.preventDefault();
return true;
}}
if(true===$.data(event.target, this.widgetName + ".preventClickEvent") ){
$.removeData(event.target, this.widgetName + ".preventClickEvent");
}
this._mouseMoveDelegate=function(event){
return that._mouseMove(event);
};
this._mouseUpDelegate=function(event){
return that._mouseUp(event);
};
this.document
.on("mousemove." + this.widgetName, this._mouseMoveDelegate)
.on("mouseup." + this.widgetName, this._mouseUpDelegate);
event.preventDefault();
mouseHandled=true;
return true;
},
_mouseMove: function(event){
if(this._mouseMoved){
if($.ui.ie&&(!document.documentMode||document.documentMode < 9) &&
!event.button){
return this._mouseUp(event);
}else if(!event.which){
if(event.originalEvent.altKey||event.originalEvent.ctrlKey ||
event.originalEvent.metaKey||event.originalEvent.shiftKey){
this.ignoreMissingWhich=true;
}else if(!this.ignoreMissingWhich){
return this._mouseUp(event);
}}
}
if(event.which||event.button){
this._mouseMoved=true;
}
if(this._mouseStarted){
this._mouseDrag(event);
return event.preventDefault();
}
if(this._mouseDistanceMet(event)&&this._mouseDelayMet(event) ){
this._mouseStarted =
(this._mouseStart(this._mouseDownEvent, event)!==false);
if(this._mouseStarted){
this._mouseDrag(event);
}else{
this._mouseUp(event);
}}
return !this._mouseStarted;
},
_mouseUp: function(event){
this.document
.off("mousemove." + this.widgetName, this._mouseMoveDelegate)
.off("mouseup." + this.widgetName, this._mouseUpDelegate);
if(this._mouseStarted){
this._mouseStarted=false;
if(event.target===this._mouseDownEvent.target){
$.data(event.target, this.widgetName + ".preventClickEvent", true);
}
this._mouseStop(event);
}
if(this._mouseDelayTimer){
clearTimeout(this._mouseDelayTimer);
delete this._mouseDelayTimer;
}
this.ignoreMissingWhich=false;
mouseHandled=false;
event.preventDefault();
},
_mouseDistanceMet: function(event){
return(Math.max(Math.abs(this._mouseDownEvent.pageX - event.pageX),
Math.abs(this._mouseDownEvent.pageY - event.pageY)
) >=this.options.distance
);
},
_mouseDelayMet: function(){
return this.mouseDelayMet;
},
_mouseStart: function(){},
_mouseDrag: function(){},
_mouseStop: function(){},
_mouseCapture: function(){
return true;
}});
});
(function(factory){
"use strict";
if(typeof define==="function"&&define.amd){
define([
"jquery",
"./mouse",
"../data",
"../plugin",
"../safe-active-element",
"../safe-blur",
"../scroll-parent",
"../version",
"../widget"
], factory);
}else{
factory(jQuery);
}})(function($){
"use strict";
$.widget("ui.draggable", $.ui.mouse, {
version: "1.13.3",
widgetEventPrefix: "drag",
options: {
addClasses: true,
appendTo: "parent",
axis: false,
connectToSortable: false,
containment: false,
cursor: "auto",
cursorAt: false,
grid: false,
handle: false,
helper: "original",
iframeFix: false,
opacity: false,
refreshPositions: false,
revert: false,
revertDuration: 500,
scope: "default",
scroll: true,
scrollSensitivity: 20,
scrollSpeed: 20,
snap: false,
snapMode: "both",
snapTolerance: 20,
stack: false,
zIndex: false,
drag: null,
start: null,
stop: null
},
_create: function(){
if(this.options.helper==="original"){
this._setPositionRelative();
}
if(this.options.addClasses){
this._addClass("ui-draggable");
}
this._setHandleClassName();
this._mouseInit();
},
_setOption: function(key, value){
this._super(key, value);
if(key==="handle"){
this._removeHandleClassName();
this._setHandleClassName();
}},
_destroy: function(){
if(( this.helper||this.element).is(".ui-draggable-dragging") ){
this.destroyOnClear=true;
return;
}
this._removeHandleClassName();
this._mouseDestroy();
},
_mouseCapture: function(event){
var o=this.options;
if(this.helper||o.disabled ||
$(event.target).closest(".ui-resizable-handle").length > 0){
return false;
}
this.handle=this._getHandle(event);
if(!this.handle){
return false;
}
this._blurActiveElement(event);
this._blockFrames(o.iframeFix===true ? "iframe":o.iframeFix);
return true;
},
_blockFrames: function(selector){
this.iframeBlocks=this.document.find(selector).map(function(){
var iframe=$(this);
return $("<div>")
.css("position", "absolute")
.appendTo(iframe.parent())
.outerWidth(iframe.outerWidth())
.outerHeight(iframe.outerHeight())
.offset(iframe.offset())[ 0 ];
});
},
_unblockFrames: function(){
if(this.iframeBlocks){
this.iframeBlocks.remove();
delete this.iframeBlocks;
}},
_blurActiveElement: function(event){
var activeElement=$.ui.safeActiveElement(this.document[ 0 ]),
target=$(event.target);
if(target.closest(activeElement).length){
return;
}
$.ui.safeBlur(activeElement);
},
_mouseStart: function(event){
var o=this.options;
this.helper=this._createHelper(event);
this._addClass(this.helper, "ui-draggable-dragging");
this._cacheHelperProportions();
if($.ui.ddmanager){
$.ui.ddmanager.current=this;
}
this._cacheMargins();
this.cssPosition=this.helper.css("position");
this.scrollParent=this.helper.scrollParent(true);
this.offsetParent=this.helper.offsetParent();
this.hasFixedAncestor=this.helper.parents().filter(function(){
return $(this).css("position")==="fixed";
}).length > 0;
this.positionAbs=this.element.offset();
this._refreshOffsets(event);
this.originalPosition=this.position=this._generatePosition(event, false);
this.originalPageX=event.pageX;
this.originalPageY=event.pageY;
if(o.cursorAt){
this._adjustOffsetFromHelper(o.cursorAt);
}
this._setContainment();
if(this._trigger("start", event)===false){
this._clear();
return false;
}
this._cacheHelperProportions();
if($.ui.ddmanager&&!o.dropBehaviour){
$.ui.ddmanager.prepareOffsets(this, event);
}
this._mouseDrag(event, true);
if($.ui.ddmanager){
$.ui.ddmanager.dragStart(this, event);
}
return true;
},
_refreshOffsets: function(event){
this.offset={
top: this.positionAbs.top - this.margins.top,
left: this.positionAbs.left - this.margins.left,
scroll: false,
parent: this._getParentOffset(),
relative: this._getRelativeOffset()
};
this.offset.click={
left: event.pageX - this.offset.left,
top: event.pageY - this.offset.top
};},
_mouseDrag: function(event, noPropagation){
if(this.hasFixedAncestor){
this.offset.parent=this._getParentOffset();
}
this.position=this._generatePosition(event, true);
this.positionAbs=this._convertPositionTo("absolute");
if(!noPropagation){
var ui=this._uiHash();
if(this._trigger("drag", event, ui)===false){
this._mouseUp(new $.Event("mouseup", event) );
return false;
}
this.position=ui.position;
}
this.helper[ 0 ].style.left=this.position.left + "px";
this.helper[ 0 ].style.top=this.position.top + "px";
if($.ui.ddmanager){
$.ui.ddmanager.drag(this, event);
}
return false;
},
_mouseStop: function(event){
var that=this,
dropped=false;
if($.ui.ddmanager&&!this.options.dropBehaviour){
dropped=$.ui.ddmanager.drop(this, event);
}
if(this.dropped){
dropped=this.dropped;
this.dropped=false;
}
if(( this.options.revert==="invalid"&&!dropped) ||
(this.options.revert==="valid"&&dropped) ||
this.options.revert===true||(typeof this.options.revert==="function" &&
this.options.revert.call(this.element, dropped) )
){
$(this.helper).animate(this.originalPosition,
parseInt(this.options.revertDuration, 10),
function(){
if(that._trigger("stop", event)!==false){
that._clear();
}}
);
}else{
if(this._trigger("stop", event)!==false){
this._clear();
}}
return false;
},
_mouseUp: function(event){
this._unblockFrames();
if($.ui.ddmanager){
$.ui.ddmanager.dragStop(this, event);
}
if(this.handleElement.is(event.target) ){
this.element.trigger("focus");
}
return $.ui.mouse.prototype._mouseUp.call(this, event);
},
cancel: function(){
if(this.helper.is(".ui-draggable-dragging") ){
this._mouseUp(new $.Event("mouseup", { target: this.element[ 0 ] }) );
}else{
this._clear();
}
return this;
},
_getHandle: function(event){
return this.options.handle ?
!!$(event.target).closest(this.element.find(this.options.handle) ).length :
true;
},
_setHandleClassName: function(){
this.handleElement=this.options.handle ?
this.element.find(this.options.handle):this.element;
this._addClass(this.handleElement, "ui-draggable-handle");
},
_removeHandleClassName: function(){
this._removeClass(this.handleElement, "ui-draggable-handle");
},
_createHelper: function(event){
var o=this.options,
helperIsFunction=typeof o.helper==="function",
helper=helperIsFunction ?
$(o.helper.apply(this.element[ 0 ], [ event ]) ) :
(o.helper==="clone" ?
this.element.clone().removeAttr("id") :
this.element);
if(!helper.parents("body").length){
helper.appendTo(( o.appendTo==="parent" ?
this.element[ 0 ].parentNode :
o.appendTo) );
}
if(helperIsFunction&&helper[ 0 ]===this.element[ 0 ]){
this._setPositionRelative();
}
if(helper[ 0 ]!==this.element[ 0 ] &&
!(/(fixed|absolute)/).test(helper.css("position") )){
helper.css("position", "absolute");
}
return helper;
},
_setPositionRelative: function(){
if(!(/^(?:r|a|f)/).test(this.element.css("position") )){
this.element[ 0 ].style.position="relative";
}},
_adjustOffsetFromHelper: function(obj){
if(typeof obj==="string"){
obj=obj.split(" ");
}
if(Array.isArray(obj) ){
obj={ left: +obj[ 0 ], top: +obj[ 1 ]||0 };}
if("left" in obj){
this.offset.click.left=obj.left + this.margins.left;
}
if("right" in obj){
this.offset.click.left=this.helperProportions.width - obj.right + this.margins.left;
}
if("top" in obj){
this.offset.click.top=obj.top + this.margins.top;
}
if("bottom" in obj){
this.offset.click.top=this.helperProportions.height - obj.bottom + this.margins.top;
}},
_isRootNode: function(element){
return(/(html|body)/i).test(element.tagName)||element===this.document[ 0 ];
},
_getParentOffset: function(){
var po=this.offsetParent.offset(),
document=this.document[ 0 ];
if(this.cssPosition==="absolute"&&this.scrollParent[ 0 ]!==document &&
$.contains(this.scrollParent[ 0 ], this.offsetParent[ 0 ]) ){
po.left +=this.scrollParent.scrollLeft();
po.top +=this.scrollParent.scrollTop();
}
if(this._isRootNode(this.offsetParent[ 0 ]) ){
po={ top: 0, left: 0 };}
return {
top: po.top +(parseInt(this.offsetParent.css("borderTopWidth"), 10)||0),
left: po.left +(parseInt(this.offsetParent.css("borderLeftWidth"), 10)||0)
};},
_getRelativeOffset: function(){
if(this.cssPosition!=="relative"){
return { top: 0, left: 0 };}
var p=this.element.position(),
scrollIsRootNode=this._isRootNode(this.scrollParent[ 0 ]);
return {
top: p.top -(parseInt(this.helper.css("top"), 10)||0) +
(!scrollIsRootNode ? this.scrollParent.scrollTop():0),
left: p.left -(parseInt(this.helper.css("left"), 10)||0) +
(!scrollIsRootNode ? this.scrollParent.scrollLeft():0)
};},
_cacheMargins: function(){
this.margins={
left:(parseInt(this.element.css("marginLeft"), 10)||0),
top:(parseInt(this.element.css("marginTop"), 10)||0),
right:(parseInt(this.element.css("marginRight"), 10)||0),
bottom:(parseInt(this.element.css("marginBottom"), 10)||0)
};},
_cacheHelperProportions: function(){
this.helperProportions={
width: this.helper.outerWidth(),
height: this.helper.outerHeight()
};},
_setContainment: function(){
var isUserScrollable, c, ce,
o=this.options,
document=this.document[ 0 ];
this.relativeContainer=null;
if(!o.containment){
this.containment=null;
return;
}
if(o.containment==="window"){
this.containment=[
$(window).scrollLeft() - this.offset.relative.left - this.offset.parent.left,
$(window).scrollTop() - this.offset.relative.top - this.offset.parent.top,
$(window).scrollLeft() + $(window).width() -
this.helperProportions.width - this.margins.left,
$(window).scrollTop() +
($(window).height()||document.body.parentNode.scrollHeight) -
this.helperProportions.height - this.margins.top
];
return;
}
if(o.containment==="document"){
this.containment=[
0,
0,
$(document).width() - this.helperProportions.width - this.margins.left,
($(document).height()||document.body.parentNode.scrollHeight) -
this.helperProportions.height - this.margins.top
];
return;
}
if(o.containment.constructor===Array){
this.containment=o.containment;
return;
}
if(o.containment==="parent"){
o.containment=this.helper[ 0 ].parentNode;
}
c=$(o.containment);
ce=c[ 0 ];
if(!ce){
return;
}
isUserScrollable=/(scroll|auto)/.test(c.css("overflow") );
this.containment=[
(parseInt(c.css("borderLeftWidth"), 10)||0) +
(parseInt(c.css("paddingLeft"), 10)||0),
(parseInt(c.css("borderTopWidth"), 10)||0) +
(parseInt(c.css("paddingTop"), 10)||0),
(isUserScrollable ? Math.max(ce.scrollWidth, ce.offsetWidth):ce.offsetWidth) -
(parseInt(c.css("borderRightWidth"), 10)||0) -
(parseInt(c.css("paddingRight"), 10)||0) -
this.helperProportions.width -
this.margins.left -
this.margins.right,
(isUserScrollable ? Math.max(ce.scrollHeight, ce.offsetHeight):ce.offsetHeight) -
(parseInt(c.css("borderBottomWidth"), 10)||0) -
(parseInt(c.css("paddingBottom"), 10)||0) -
this.helperProportions.height -
this.margins.top -
this.margins.bottom
];
this.relativeContainer=c;
},
_convertPositionTo: function(d, pos){
if(!pos){
pos=this.position;
}
var mod=d==="absolute" ? 1:-1,
scrollIsRootNode=this._isRootNode(this.scrollParent[ 0 ]);
return {
top: (
pos.top	+
this.offset.relative.top * mod +
this.offset.parent.top * mod -
(( this.cssPosition==="fixed" ?
-this.offset.scroll.top :
(scrollIsRootNode ? 0:this.offset.scroll.top) ) * mod)
),
left: (
pos.left +
this.offset.relative.left * mod +
this.offset.parent.left * mod	-
(( this.cssPosition==="fixed" ?
-this.offset.scroll.left :
(scrollIsRootNode ? 0:this.offset.scroll.left) ) * mod)
)
};},
_generatePosition: function(event, constrainPosition){
var containment, co, top, left,
o=this.options,
scrollIsRootNode=this._isRootNode(this.scrollParent[ 0 ]),
pageX=event.pageX,
pageY=event.pageY;
if(!scrollIsRootNode||!this.offset.scroll){
this.offset.scroll={
top: this.scrollParent.scrollTop(),
left: this.scrollParent.scrollLeft()
};}
if(constrainPosition){
if(this.containment){
if(this.relativeContainer){
co=this.relativeContainer.offset();
containment=[
this.containment[ 0 ] + co.left,
this.containment[ 1 ] + co.top,
this.containment[ 2 ] + co.left,
this.containment[ 3 ] + co.top
];
}else{
containment=this.containment;
}
if(event.pageX - this.offset.click.left < containment[ 0 ]){
pageX=containment[ 0 ] + this.offset.click.left;
}
if(event.pageY - this.offset.click.top < containment[ 1 ]){
pageY=containment[ 1 ] + this.offset.click.top;
}
if(event.pageX - this.offset.click.left > containment[ 2 ]){
pageX=containment[ 2 ] + this.offset.click.left;
}
if(event.pageY - this.offset.click.top > containment[ 3 ]){
pageY=containment[ 3 ] + this.offset.click.top;
}}
if(o.grid){
top=o.grid[ 1 ] ? this.originalPageY + Math.round(( pageY -
this.originalPageY) / o.grid[ 1 ]) * o.grid[ 1 ]:this.originalPageY;
pageY=containment ?(( top - this.offset.click.top >=containment[ 1 ] ||
top - this.offset.click.top > containment[ 3 ]) ?
top :
(( top - this.offset.click.top >=containment[ 1 ]) ?
top - o.grid[ 1 ]:top + o.grid[ 1 ]) ):top;
left=o.grid[ 0 ] ? this.originalPageX +
Math.round(( pageX - this.originalPageX) / o.grid[ 0 ]) * o.grid[ 0 ] :
this.originalPageX;
pageX=containment ?(( left - this.offset.click.left >=containment[ 0 ] ||
left - this.offset.click.left > containment[ 2 ]) ?
left :
(( left - this.offset.click.left >=containment[ 0 ]) ?
left - o.grid[ 0 ]:left + o.grid[ 0 ]) ):left;
}
if(o.axis==="y"){
pageX=this.originalPageX;
}
if(o.axis==="x"){
pageY=this.originalPageY;
}}
return {
top: (
pageY -
this.offset.click.top -
this.offset.relative.top -
this.offset.parent.top +
(this.cssPosition==="fixed" ?
-this.offset.scroll.top :
(scrollIsRootNode ? 0:this.offset.scroll.top) )
),
left: (
pageX -
this.offset.click.left -
this.offset.relative.left -
this.offset.parent.left +
(this.cssPosition==="fixed" ?
-this.offset.scroll.left :
(scrollIsRootNode ? 0:this.offset.scroll.left) )
)
};},
_clear: function(){
this._removeClass(this.helper, "ui-draggable-dragging");
if(this.helper[ 0 ]!==this.element[ 0 ]&&!this.cancelHelperRemoval){
this.helper.remove();
}
this.helper=null;
this.cancelHelperRemoval=false;
if(this.destroyOnClear){
this.destroy();
}},
_trigger: function(type, event, ui){
ui=ui||this._uiHash();
$.ui.plugin.call(this, type, [ event, ui, this ], true);
if(/^(drag|start|stop)/.test(type) ){
this.positionAbs=this._convertPositionTo("absolute");
ui.offset=this.positionAbs;
}
return $.Widget.prototype._trigger.call(this, type, event, ui);
},
plugins: {},
_uiHash: function(){
return {
helper: this.helper,
position: this.position,
originalPosition: this.originalPosition,
offset: this.positionAbs
};}});
$.ui.plugin.add("draggable", "connectToSortable", {
start: function(event, ui, draggable){
var uiSortable=$.extend({}, ui, {
item: draggable.element
});
draggable.sortables=[];
$(draggable.options.connectToSortable).each(function(){
var sortable=$(this).sortable("instance");
if(sortable&&!sortable.options.disabled){
draggable.sortables.push(sortable);
sortable.refreshPositions();
sortable._trigger("activate", event, uiSortable);
}});
},
stop: function(event, ui, draggable){
var uiSortable=$.extend({}, ui, {
item: draggable.element
});
draggable.cancelHelperRemoval=false;
$.each(draggable.sortables, function(){
var sortable=this;
if(sortable.isOver){
sortable.isOver=0;
draggable.cancelHelperRemoval=true;
sortable.cancelHelperRemoval=false;
sortable._storedCSS={
position: sortable.placeholder.css("position"),
top: sortable.placeholder.css("top"),
left: sortable.placeholder.css("left")
};
sortable._mouseStop(event);
sortable.options.helper=sortable.options._helper;
}else{
sortable.cancelHelperRemoval=true;
sortable._trigger("deactivate", event, uiSortable);
}});
},
drag: function(event, ui, draggable){
$.each(draggable.sortables, function(){
var innermostIntersecting=false,
sortable=this;
sortable.positionAbs=draggable.positionAbs;
sortable.helperProportions=draggable.helperProportions;
sortable.offset.click=draggable.offset.click;
if(sortable._intersectsWith(sortable.containerCache) ){
innermostIntersecting=true;
$.each(draggable.sortables, function(){
this.positionAbs=draggable.positionAbs;
this.helperProportions=draggable.helperProportions;
this.offset.click=draggable.offset.click;
if(this!==sortable &&
this._intersectsWith(this.containerCache) &&
$.contains(sortable.element[ 0 ], this.element[ 0 ]) ){
innermostIntersecting=false;
}
return innermostIntersecting;
});
}
if(innermostIntersecting){
if(!sortable.isOver){
sortable.isOver=1;
draggable._parent=ui.helper.parent();
sortable.currentItem=ui.helper
.appendTo(sortable.element)
.data("ui-sortable-item", true);
sortable.options._helper=sortable.options.helper;
sortable.options.helper=function(){
return ui.helper[ 0 ];
};
event.target=sortable.currentItem[ 0 ];
sortable._mouseCapture(event, true);
sortable._mouseStart(event, true, true);
sortable.offset.click.top=draggable.offset.click.top;
sortable.offset.click.left=draggable.offset.click.left;
sortable.offset.parent.left -=draggable.offset.parent.left -
sortable.offset.parent.left;
sortable.offset.parent.top -=draggable.offset.parent.top -
sortable.offset.parent.top;
draggable._trigger("toSortable", event);
draggable.dropped=sortable.element;
$.each(draggable.sortables, function(){
this.refreshPositions();
});
draggable.currentItem=draggable.element;
sortable.fromOutside=draggable;
}
if(sortable.currentItem){
sortable._mouseDrag(event);
ui.position=sortable.position;
}}else{
if(sortable.isOver){
sortable.isOver=0;
sortable.cancelHelperRemoval=true;
sortable.options._revert=sortable.options.revert;
sortable.options.revert=false;
sortable._trigger("out", event, sortable._uiHash(sortable) );
sortable._mouseStop(event, true);
sortable.options.revert=sortable.options._revert;
sortable.options.helper=sortable.options._helper;
if(sortable.placeholder){
sortable.placeholder.remove();
}
ui.helper.appendTo(draggable._parent);
draggable._refreshOffsets(event);
ui.position=draggable._generatePosition(event, true);
draggable._trigger("fromSortable", event);
draggable.dropped=false;
$.each(draggable.sortables, function(){
this.refreshPositions();
});
}}
});
}});
$.ui.plugin.add("draggable", "cursor", {
start: function(event, ui, instance){
var t=$("body"),
o=instance.options;
if(t.css("cursor") ){
o._cursor=t.css("cursor");
}
t.css("cursor", o.cursor);
},
stop: function(event, ui, instance){
var o=instance.options;
if(o._cursor){
$("body").css("cursor", o._cursor);
}}
});
$.ui.plugin.add("draggable", "opacity", {
start: function(event, ui, instance){
var t=$(ui.helper),
o=instance.options;
if(t.css("opacity") ){
o._opacity=t.css("opacity");
}
t.css("opacity", o.opacity);
},
stop: function(event, ui, instance){
var o=instance.options;
if(o._opacity){
$(ui.helper).css("opacity", o._opacity);
}}
});
$.ui.plugin.add("draggable", "scroll", {
start: function(event, ui, i){
if(!i.scrollParentNotHidden){
i.scrollParentNotHidden=i.helper.scrollParent(false);
}
if(i.scrollParentNotHidden[ 0 ]!==i.document[ 0 ] &&
i.scrollParentNotHidden[ 0 ].tagName!=="HTML"){
i.overflowOffset=i.scrollParentNotHidden.offset();
}},
drag: function(event, ui, i){
var o=i.options,
scrolled=false,
scrollParent=i.scrollParentNotHidden[ 0 ],
document=i.document[ 0 ];
if(scrollParent!==document&&scrollParent.tagName!=="HTML"){
if(!o.axis||o.axis!=="x"){
if(( i.overflowOffset.top + scrollParent.offsetHeight) - event.pageY <
o.scrollSensitivity){
scrollParent.scrollTop=scrolled=scrollParent.scrollTop + o.scrollSpeed;
}else if(event.pageY - i.overflowOffset.top < o.scrollSensitivity){
scrollParent.scrollTop=scrolled=scrollParent.scrollTop - o.scrollSpeed;
}}
if(!o.axis||o.axis!=="y"){
if(( i.overflowOffset.left + scrollParent.offsetWidth) - event.pageX <
o.scrollSensitivity){
scrollParent.scrollLeft=scrolled=scrollParent.scrollLeft + o.scrollSpeed;
}else if(event.pageX - i.overflowOffset.left < o.scrollSensitivity){
scrollParent.scrollLeft=scrolled=scrollParent.scrollLeft - o.scrollSpeed;
}}
}else{
if(!o.axis||o.axis!=="x"){
if(event.pageY - $(document).scrollTop() < o.scrollSensitivity){
scrolled=$(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
}else if($(window).height() -(event.pageY - $(document).scrollTop()) <
o.scrollSensitivity){
scrolled=$(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
}}
if(!o.axis||o.axis!=="y"){
if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity){
scrolled=$(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed
);
}else if($(window).width() -(event.pageX - $(document).scrollLeft()) <
o.scrollSensitivity){
scrolled=$(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed
);
}}
}
if(scrolled!==false&&$.ui.ddmanager&&!o.dropBehaviour){
$.ui.ddmanager.prepareOffsets(i, event);
}}
});
$.ui.plugin.add("draggable", "snap", {
start: function(event, ui, i){
var o=i.options;
i.snapElements=[];
$(o.snap.constructor!==String ?(o.snap.items||":data(ui-draggable)"):o.snap)
.each(function(){
var $t=$(this),
$o=$t.offset();
if(this!==i.element[ 0 ]){
i.snapElements.push({
item: this,
width: $t.outerWidth(), height: $t.outerHeight(),
top: $o.top, left: $o.left
});
}});
},
drag: function(event, ui, inst){
var ts, bs, ls, rs, l, r, t, b, i, first,
o=inst.options,
d=o.snapTolerance,
x1=ui.offset.left, x2=x1 + inst.helperProportions.width,
y1=ui.offset.top, y2=y1 + inst.helperProportions.height;
for(i=inst.snapElements.length - 1; i >=0; i--){
l=inst.snapElements[ i ].left - inst.margins.left;
r=l + inst.snapElements[ i ].width;
t=inst.snapElements[ i ].top - inst.margins.top;
b=t + inst.snapElements[ i ].height;
if(x2 < l - d||x1 > r + d||y2 < t - d||y1 > b + d ||
!$.contains(inst.snapElements[ i ].item.ownerDocument,
inst.snapElements[ i ].item) ){
if(inst.snapElements[ i ].snapping){
if(inst.options.snap.release){
inst.options.snap.release.call(inst.element,
event,
$.extend(inst._uiHash(), { snapItem: inst.snapElements[ i ].item })
);
}}
inst.snapElements[ i ].snapping=false;
continue;
}
if(o.snapMode!=="inner"){
ts=Math.abs(t - y2) <=d;
bs=Math.abs(b - y1) <=d;
ls=Math.abs(l - x2) <=d;
rs=Math.abs(r - x1) <=d;
if(ts){
ui.position.top=inst._convertPositionTo("relative", {
top: t - inst.helperProportions.height,
left: 0
}).top;
}
if(bs){
ui.position.top=inst._convertPositionTo("relative", {
top: b,
left: 0
}).top;
}
if(ls){
ui.position.left=inst._convertPositionTo("relative", {
top: 0,
left: l - inst.helperProportions.width
}).left;
}
if(rs){
ui.position.left=inst._convertPositionTo("relative", {
top: 0,
left: r
}).left;
}}
first=(ts||bs||ls||rs);
if(o.snapMode!=="outer"){
ts=Math.abs(t - y1) <=d;
bs=Math.abs(b - y2) <=d;
ls=Math.abs(l - x1) <=d;
rs=Math.abs(r - x2) <=d;
if(ts){
ui.position.top=inst._convertPositionTo("relative", {
top: t,
left: 0
}).top;
}
if(bs){
ui.position.top=inst._convertPositionTo("relative", {
top: b - inst.helperProportions.height,
left: 0
}).top;
}
if(ls){
ui.position.left=inst._convertPositionTo("relative", {
top: 0,
left: l
}).left;
}
if(rs){
ui.position.left=inst._convertPositionTo("relative", {
top: 0,
left: r - inst.helperProportions.width
}).left;
}}
if(!inst.snapElements[ i ].snapping&&(ts||bs||ls||rs||first) ){
if(inst.options.snap.snap){
inst.options.snap.snap.call(inst.element,
event,
$.extend(inst._uiHash(), {
snapItem: inst.snapElements[ i ].item
}) );
}}
inst.snapElements[ i ].snapping=(ts||bs||ls||rs||first);
}}
});
$.ui.plugin.add("draggable", "stack", {
start: function(event, ui, instance){
var min,
o=instance.options,
group=$.makeArray($(o.stack) ).sort(function(a, b){
return(parseInt($(a).css("zIndex"), 10)||0) -
(parseInt($(b).css("zIndex"), 10)||0);
});
if(!group.length){
return;
}
min=parseInt($(group[ 0 ]).css("zIndex"), 10)||0;
$(group).each(function(i){
$(this).css("zIndex", min + i);
});
this.css("zIndex",(min + group.length) );
}});
$.ui.plugin.add("draggable", "zIndex", {
start: function(event, ui, instance){
var t=$(ui.helper),
o=instance.options;
if(t.css("zIndex") ){
o._zIndex=t.css("zIndex");
}
t.css("zIndex", o.zIndex);
},
stop: function(event, ui, instance){
var o=instance.options;
if(o._zIndex){
$(ui.helper).css("zIndex", o._zIndex);
}}
});
return $.ui.draggable;
});
(function(factory){
"use strict";
if(typeof define==="function"&&define.amd){
define([
"jquery",
"./mouse",
"../data",
"../ie",
"../scroll-parent",
"../version",
"../widget"
], factory);
}else{
factory(jQuery);
}})(function($){
"use strict";
return $.widget("ui.sortable", $.ui.mouse, {
version: "1.13.3",
widgetEventPrefix: "sort",
ready: false,
options: {
appendTo: "parent",
axis: false,
connectWith: false,
containment: false,
cursor: "auto",
cursorAt: false,
dropOnEmpty: true,
forcePlaceholderSize: false,
forceHelperSize: false,
grid: false,
handle: false,
helper: "original",
items: "> *",
opacity: false,
placeholder: false,
revert: false,
scroll: true,
scrollSensitivity: 20,
scrollSpeed: 20,
scope: "default",
tolerance: "intersect",
zIndex: 1000,
activate: null,
beforeStop: null,
change: null,
deactivate: null,
out: null,
over: null,
receive: null,
remove: null,
sort: null,
start: null,
stop: null,
update: null
},
_isOverAxis: function(x, reference, size){
return(x >=reference)&&(x <(reference + size) );
},
_isFloating: function(item){
return(/left|right/).test(item.css("float") ) ||
(/inline|table-cell/).test(item.css("display") );
},
_create: function(){
this.containerCache={};
this._addClass("ui-sortable");
this.refresh();
this.offset=this.element.offset();
this._mouseInit();
this._setHandleClassName();
this.ready=true;
},
_setOption: function(key, value){
this._super(key, value);
if(key==="handle"){
this._setHandleClassName();
}},
_setHandleClassName: function(){
var that=this;
this._removeClass(this.element.find(".ui-sortable-handle"), "ui-sortable-handle");
$.each(this.items, function(){
that._addClass(this.instance.options.handle ?
this.item.find(this.instance.options.handle) :
this.item,
"ui-sortable-handle"
);
});
},
_destroy: function(){
this._mouseDestroy();
for(var i=this.items.length - 1; i >=0; i--){
this.items[ i ].item.removeData(this.widgetName + "-item");
}
return this;
},
_mouseCapture: function(event, overrideHandle){
var currentItem=null,
validHandle=false,
that=this;
if(this.reverting){
return false;
}
if(this.options.disabled||this.options.type==="static"){
return false;
}
this._refreshItems(event);
$(event.target).parents().each(function(){
if($.data(this, that.widgetName + "-item")===that){
currentItem=$(this);
return false;
}});
if($.data(event.target, that.widgetName + "-item")===that){
currentItem=$(event.target);
}
if(!currentItem){
return false;
}
if(this.options.handle&&!overrideHandle){
$(this.options.handle, currentItem).find("*").addBack().each(function(){
if(this===event.target){
validHandle=true;
}});
if(!validHandle){
return false;
}}
this.currentItem=currentItem;
this._removeCurrentsFromItems();
return true;
},
_mouseStart: function(event, overrideHandle, noActivation){
var i, body,
o=this.options;
this.currentContainer=this;
this.refreshPositions();
this.appendTo=$(o.appendTo!=="parent" ?
o.appendTo :
this.currentItem.parent());
this.helper=this._createHelper(event);
this._cacheHelperProportions();
this._cacheMargins();
this.offset=this.currentItem.offset();
this.offset={
top: this.offset.top - this.margins.top,
left: this.offset.left - this.margins.left
};
$.extend(this.offset, {
click: {
left: event.pageX - this.offset.left,
top: event.pageY - this.offset.top
},
relative: this._getRelativeOffset()
});
this.helper.css("position", "absolute");
this.cssPosition=this.helper.css("position");
if(o.cursorAt){
this._adjustOffsetFromHelper(o.cursorAt);
}
this.domPosition={
prev: this.currentItem.prev()[ 0 ],
parent: this.currentItem.parent()[ 0 ]
};
if(this.helper[ 0 ]!==this.currentItem[ 0 ]){
this.currentItem.hide();
}
this._createPlaceholder();
this.scrollParent=this.placeholder.scrollParent();
$.extend(this.offset, {
parent: this._getParentOffset()
});
if(o.containment){
this._setContainment();
}
if(o.cursor&&o.cursor!=="auto"){
body=this.document.find("body");
this.storedCursor=body.css("cursor");
body.css("cursor", o.cursor);
this.storedStylesheet =
$("<style>*{ cursor: " + o.cursor + " !important; }</style>").appendTo(body);
}
if(o.zIndex){
if(this.helper.css("zIndex") ){
this._storedZIndex=this.helper.css("zIndex");
}
this.helper.css("zIndex", o.zIndex);
}
if(o.opacity){
if(this.helper.css("opacity") ){
this._storedOpacity=this.helper.css("opacity");
}
this.helper.css("opacity", o.opacity);
}
if(this.scrollParent[ 0 ]!==this.document[ 0 ] &&
this.scrollParent[ 0 ].tagName!=="HTML"){
this.overflowOffset=this.scrollParent.offset();
}
this._trigger("start", event, this._uiHash());
if(!this._preserveHelperProportions){
this._cacheHelperProportions();
}
if(!noActivation){
for(i=this.containers.length - 1; i >=0; i--){
this.containers[ i ]._trigger("activate", event, this._uiHash(this) );
}}
if($.ui.ddmanager){
$.ui.ddmanager.current=this;
}
if($.ui.ddmanager&&!o.dropBehaviour){
$.ui.ddmanager.prepareOffsets(this, event);
}
this.dragging=true;
this._addClass(this.helper, "ui-sortable-helper");
if(!this.helper.parent().is(this.appendTo) ){
this.helper.detach().appendTo(this.appendTo);
this.offset.parent=this._getParentOffset();
}
this.position=this.originalPosition=this._generatePosition(event);
this.originalPageX=event.pageX;
this.originalPageY=event.pageY;
this.lastPositionAbs=this.positionAbs=this._convertPositionTo("absolute");
this._mouseDrag(event);
return true;
},
_scroll: function(event){
var o=this.options,
scrolled=false;
if(this.scrollParent[ 0 ]!==this.document[ 0 ] &&
this.scrollParent[ 0 ].tagName!=="HTML"){
if(( this.overflowOffset.top + this.scrollParent[ 0 ].offsetHeight) -
event.pageY < o.scrollSensitivity){
this.scrollParent[ 0 ].scrollTop =
scrolled=this.scrollParent[ 0 ].scrollTop + o.scrollSpeed;
}else if(event.pageY - this.overflowOffset.top < o.scrollSensitivity){
this.scrollParent[ 0 ].scrollTop =
scrolled=this.scrollParent[ 0 ].scrollTop - o.scrollSpeed;
}
if(( this.overflowOffset.left + this.scrollParent[ 0 ].offsetWidth) -
event.pageX < o.scrollSensitivity){
this.scrollParent[ 0 ].scrollLeft=scrolled =
this.scrollParent[ 0 ].scrollLeft + o.scrollSpeed;
}else if(event.pageX - this.overflowOffset.left < o.scrollSensitivity){
this.scrollParent[ 0 ].scrollLeft=scrolled =
this.scrollParent[ 0 ].scrollLeft - o.scrollSpeed;
}}else{
if(event.pageY - this.document.scrollTop() < o.scrollSensitivity){
scrolled=this.document.scrollTop(this.document.scrollTop() - o.scrollSpeed);
}else if(this.window.height() -(event.pageY - this.document.scrollTop()) <
o.scrollSensitivity){
scrolled=this.document.scrollTop(this.document.scrollTop() + o.scrollSpeed);
}
if(event.pageX - this.document.scrollLeft() < o.scrollSensitivity){
scrolled=this.document.scrollLeft(this.document.scrollLeft() - o.scrollSpeed
);
}else if(this.window.width() -(event.pageX - this.document.scrollLeft()) <
o.scrollSensitivity){
scrolled=this.document.scrollLeft(this.document.scrollLeft() + o.scrollSpeed
);
}}
return scrolled;
},
_mouseDrag: function(event){
var i, item, itemElement, intersection,
o=this.options;
this.position=this._generatePosition(event);
this.positionAbs=this._convertPositionTo("absolute");
if(!this.options.axis||this.options.axis!=="y"){
this.helper[ 0 ].style.left=this.position.left + "px";
}
if(!this.options.axis||this.options.axis!=="x"){
this.helper[ 0 ].style.top=this.position.top + "px";
}
if(o.scroll){
if(this._scroll(event)!==false){
this._refreshItemPositions(true);
if($.ui.ddmanager&&!o.dropBehaviour){
$.ui.ddmanager.prepareOffsets(this, event);
}}
}
this.dragDirection={
vertical: this._getDragVerticalDirection(),
horizontal: this._getDragHorizontalDirection()
};
for(i=this.items.length - 1; i >=0; i--){
item=this.items[ i ];
itemElement=item.item[ 0 ];
intersection=this._intersectsWithPointer(item);
if(!intersection){
continue;
}
if(item.instance!==this.currentContainer){
continue;
}
if(itemElement!==this.currentItem[ 0 ] &&
this.placeholder[ intersection===1 ?
"next":"prev" ]()[ 0 ]!==itemElement &&
!$.contains(this.placeholder[ 0 ], itemElement) &&
(this.options.type==="semi-dynamic" ?
!$.contains(this.element[ 0 ], itemElement) :
true
)
){
this.direction=intersection===1 ? "down":"up";
if(this.options.tolerance==="pointer" ||
this._intersectsWithSides(item) ){
this._rearrange(event, item);
}else{
break;
}
this._trigger("change", event, this._uiHash());
break;
}}
this._contactContainers(event);
if($.ui.ddmanager){
$.ui.ddmanager.drag(this, event);
}
this._trigger("sort", event, this._uiHash());
this.lastPositionAbs=this.positionAbs;
return false;
},
_mouseStop: function(event, noPropagation){
if(!event){
return;
}
if($.ui.ddmanager&&!this.options.dropBehaviour){
$.ui.ddmanager.drop(this, event);
}
if(this.options.revert){
var that=this,
cur=this.placeholder.offset(),
axis=this.options.axis,
animation={};
if(!axis||axis==="x"){
animation.left=cur.left - this.offset.parent.left - this.margins.left +
(this.offsetParent[ 0 ]===this.document[ 0 ].body ?
0 :
this.offsetParent[ 0 ].scrollLeft
);
}
if(!axis||axis==="y"){
animation.top=cur.top - this.offset.parent.top - this.margins.top +
(this.offsetParent[ 0 ]===this.document[ 0 ].body ?
0 :
this.offsetParent[ 0 ].scrollTop
);
}
this.reverting=true;
$(this.helper).animate(animation,
parseInt(this.options.revert, 10)||500,
function(){
that._clear(event);
}
);
}else{
this._clear(event, noPropagation);
}
return false;
},
cancel: function(){
if(this.dragging){
this._mouseUp(new $.Event("mouseup", { target: null }) );
if(this.options.helper==="original"){
this.currentItem.css(this._storedCSS);
this._removeClass(this.currentItem, "ui-sortable-helper");
}else{
this.currentItem.show();
}
for(var i=this.containers.length - 1; i >=0; i--){
this.containers[ i ]._trigger("deactivate", null, this._uiHash(this) );
if(this.containers[ i ].containerCache.over){
this.containers[ i ]._trigger("out", null, this._uiHash(this) );
this.containers[ i ].containerCache.over=0;
}}
}
if(this.placeholder){
if(this.placeholder[ 0 ].parentNode){
this.placeholder[ 0 ].parentNode.removeChild(this.placeholder[ 0 ]);
}
if(this.options.helper!=="original"&&this.helper &&
this.helper[ 0 ].parentNode){
this.helper.remove();
}
$.extend(this, {
helper: null,
dragging: false,
reverting: false,
_noFinalSort: null
});
if(this.domPosition.prev){
$(this.domPosition.prev).after(this.currentItem);
}else{
$(this.domPosition.parent).prepend(this.currentItem);
}}
return this;
},
serialize: function(o){
var items=this._getItemsAsjQuery(o&&o.connected),
str=[];
o=o||{};
$(items).each(function(){
var res=($(o.item||this).attr(o.attribute||"id")||"")
.match(o.expression||(/(.+)[\-=_](.+)/) );
if(res){
str.push((o.key||res[ 1 ] + "[]") +
"=" +(o.key&&o.expression ? res[ 1 ]:res[ 2 ]) );
}});
if(!str.length&&o.key){
str.push(o.key + "=");
}
return str.join("&");
},
toArray: function(o){
var items=this._getItemsAsjQuery(o&&o.connected),
ret=[];
o=o||{};
items.each(function(){
ret.push($(o.item||this).attr(o.attribute||"id")||"");
});
return ret;
},
_intersectsWith: function(item){
var x1=this.positionAbs.left,
x2=x1 + this.helperProportions.width,
y1=this.positionAbs.top,
y2=y1 + this.helperProportions.height,
l=item.left,
r=l + item.width,
t=item.top,
b=t + item.height,
dyClick=this.offset.click.top,
dxClick=this.offset.click.left,
isOverElementHeight=(this.options.axis==="x")||(( y1 + dyClick) > t &&
(y1 + dyClick) < b),
isOverElementWidth=(this.options.axis==="y")||(( x1 + dxClick) > l &&
(x1 + dxClick) < r),
isOverElement=isOverElementHeight&&isOverElementWidth;
if(this.options.tolerance==="pointer" ||
this.options.forcePointerForContainers ||
(this.options.tolerance!=="pointer" &&
this.helperProportions[ this.floating ? "width":"height" ] >
item[ this.floating ? "width":"height" ])
){
return isOverElement;
}else{
return(l < x1 +(this.helperProportions.width / 2) &&
x2 -(this.helperProportions.width / 2) < r &&
t < y1 +(this.helperProportions.height / 2) &&
y2 -(this.helperProportions.height / 2) < b);
}},
_intersectsWithPointer: function(item){
var verticalDirection, horizontalDirection,
isOverElementHeight=(this.options.axis==="x") ||
this._isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height),
isOverElementWidth=(this.options.axis==="y") ||
this._isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width),
isOverElement=isOverElementHeight&&isOverElementWidth;
if(!isOverElement){
return false;
}
verticalDirection=this.dragDirection.vertical;
horizontalDirection=this.dragDirection.horizontal;
return this.floating ?
(( horizontalDirection==="right"||verticalDirection==="down") ? 2:1) :
(verticalDirection&&(verticalDirection==="down" ? 2:1) );
},
_intersectsWithSides: function(item){
var isOverBottomHalf=this._isOverAxis(this.positionAbs.top +
this.offset.click.top, item.top +(item.height / 2), item.height),
isOverRightHalf=this._isOverAxis(this.positionAbs.left +
this.offset.click.left, item.left +(item.width / 2), item.width),
verticalDirection=this.dragDirection.vertical,
horizontalDirection=this.dragDirection.horizontal;
if(this.floating&&horizontalDirection){
return(( horizontalDirection==="right"&&isOverRightHalf) ||
(horizontalDirection==="left"&&!isOverRightHalf) );
}else{
return verticalDirection&&(( verticalDirection==="down"&&isOverBottomHalf) ||
(verticalDirection==="up"&&!isOverBottomHalf) );
}},
_getDragVerticalDirection: function(){
var delta=this.positionAbs.top - this.lastPositionAbs.top;
return delta!==0&&(delta > 0 ? "down":"up");
},
_getDragHorizontalDirection: function(){
var delta=this.positionAbs.left - this.lastPositionAbs.left;
return delta!==0&&(delta > 0 ? "right":"left");
},
refresh: function(event){
this._refreshItems(event);
this._setHandleClassName();
this.refreshPositions();
return this;
},
_connectWith: function(){
var options=this.options;
return options.connectWith.constructor===String ?
[ options.connectWith ] :
options.connectWith;
},
_getItemsAsjQuery: function(connected){
var i, j, cur, inst,
items=[],
queries=[],
connectWith=this._connectWith();
if(connectWith&&connected){
for(i=connectWith.length - 1; i >=0; i--){
cur=$(connectWith[ i ], this.document[ 0 ]);
for(j=cur.length - 1; j >=0; j--){
inst=$.data(cur[ j ], this.widgetFullName);
if(inst&&inst!==this&&!inst.options.disabled){
queries.push([ typeof inst.options.items==="function" ?
inst.options.items.call(inst.element) :
$(inst.options.items, inst.element)
.not(".ui-sortable-helper")
.not(".ui-sortable-placeholder"), inst ]);
}}
}}
queries.push([ typeof this.options.items==="function" ?
this.options.items
.call(this.element, null, { options: this.options, item: this.currentItem }) :
$(this.options.items, this.element)
.not(".ui-sortable-helper")
.not(".ui-sortable-placeholder"), this ]);
function addItems(){
items.push(this);
}
for(i=queries.length - 1; i >=0; i--){
queries[ i ][ 0 ].each(addItems);
}
return $(items);
},
_removeCurrentsFromItems: function(){
var list=this.currentItem.find(":data(" + this.widgetName + "-item)");
this.items=$.grep(this.items, function(item){
for(var j=0; j < list.length; j++){
if(list[ j ]===item.item[ 0 ]){
return false;
}}
return true;
});
},
_refreshItems: function(event){
this.items=[];
this.containers=[ this ];
var i, j, cur, inst, targetData, _queries, item, queriesLength,
items=this.items,
queries=[ [ typeof this.options.items==="function" ?
this.options.items.call(this.element[ 0 ], event, { item: this.currentItem }) :
$(this.options.items, this.element), this ] ],
connectWith=this._connectWith();
if(connectWith&&this.ready){
for(i=connectWith.length - 1; i >=0; i--){
cur=$(connectWith[ i ], this.document[ 0 ]);
for(j=cur.length - 1; j >=0; j--){
inst=$.data(cur[ j ], this.widgetFullName);
if(inst&&inst!==this&&!inst.options.disabled){
queries.push([ typeof inst.options.items==="function" ?
inst.options.items
.call(inst.element[ 0 ], event, { item: this.currentItem }) :
$(inst.options.items, inst.element), inst ]);
this.containers.push(inst);
}}
}}
for(i=queries.length - 1; i >=0; i--){
targetData=queries[ i ][ 1 ];
_queries=queries[ i ][ 0 ];
for(j=0, queriesLength=_queries.length; j < queriesLength; j++){
item=$(_queries[ j ]);
item.data(this.widgetName + "-item", targetData);
items.push({
item: item,
instance: targetData,
width: 0, height: 0,
left: 0, top: 0
});
}}
},
_refreshItemPositions: function(fast){
var i, item, t, p;
for(i=this.items.length - 1; i >=0; i--){
item=this.items[ i ];
if(this.currentContainer&&item.instance!==this.currentContainer &&
item.item[ 0 ]!==this.currentItem[ 0 ]){
continue;
}
t=this.options.toleranceElement ?
$(this.options.toleranceElement, item.item) :
item.item;
if(!fast){
item.width=t.outerWidth();
item.height=t.outerHeight();
}
p=t.offset();
item.left=p.left;
item.top=p.top;
}},
refreshPositions: function(fast){
this.floating=this.items.length ?
this.options.axis==="x"||this._isFloating(this.items[ 0 ].item) :
false;
if(this.offsetParent&&this.helper){
this.offset.parent=this._getParentOffset();
}
this._refreshItemPositions(fast);
var i, p;
if(this.options.custom&&this.options.custom.refreshContainers){
this.options.custom.refreshContainers.call(this);
}else{
for(i=this.containers.length - 1; i >=0; i--){
p=this.containers[ i ].element.offset();
this.containers[ i ].containerCache.left=p.left;
this.containers[ i ].containerCache.top=p.top;
this.containers[ i ].containerCache.width =
this.containers[ i ].element.outerWidth();
this.containers[ i ].containerCache.height =
this.containers[ i ].element.outerHeight();
}}
return this;
},
_createPlaceholder: function(that){
that=that||this;
var className, nodeName,
o=that.options;
if(!o.placeholder||o.placeholder.constructor===String){
className=o.placeholder;
nodeName=that.currentItem[ 0 ].nodeName.toLowerCase();
o.placeholder={
element: function(){
var element=$("<" + nodeName + ">", that.document[ 0 ]);
that._addClass(element, "ui-sortable-placeholder",
className||that.currentItem[ 0 ].className)
._removeClass(element, "ui-sortable-helper");
if(nodeName==="tbody"){
that._createTrPlaceholder(that.currentItem.find("tr").eq(0),
$("<tr>", that.document[ 0 ]).appendTo(element)
);
}else if(nodeName==="tr"){
that._createTrPlaceholder(that.currentItem, element);
}else if(nodeName==="img"){
element.attr("src", that.currentItem.attr("src") );
}
if(!className){
element.css("visibility", "hidden");
}
return element;
},
update: function(container, p){
if(className&&!o.forcePlaceholderSize){
return;
}
if(!p.height()||(o.forcePlaceholderSize &&
(nodeName==="tbody"||nodeName==="tr") )){
p.height(that.currentItem.innerHeight() -
parseInt(that.currentItem.css("paddingTop")||0, 10) -
parseInt(that.currentItem.css("paddingBottom")||0, 10) );
}
if(!p.width()){
p.width(that.currentItem.innerWidth() -
parseInt(that.currentItem.css("paddingLeft")||0, 10) -
parseInt(that.currentItem.css("paddingRight")||0, 10) );
}}
};}
that.placeholder=$(o.placeholder.element.call(that.element, that.currentItem) );
that.currentItem.after(that.placeholder);
o.placeholder.update(that, that.placeholder);
},
_createTrPlaceholder: function(sourceTr, targetTr){
var that=this;
sourceTr.children().each(function(){
$("<td>&#160;</td>", that.document[ 0 ])
.attr("colspan", $(this).attr("colspan")||1)
.appendTo(targetTr);
});
},
_contactContainers: function(event){
var i, j, dist, itemWithLeastDistance, posProperty, sizeProperty, cur, nearBottom,
floating, axis,
innermostContainer=null,
innermostIndex=null;
for(i=this.containers.length - 1; i >=0; i--){
if($.contains(this.currentItem[ 0 ], this.containers[ i ].element[ 0 ]) ){
continue;
}
if(this._intersectsWith(this.containers[ i ].containerCache) ){
if(innermostContainer &&
$.contains(this.containers[ i ].element[ 0 ],
innermostContainer.element[ 0 ]) ){
continue;
}
innermostContainer=this.containers[ i ];
innermostIndex=i;
}else{
if(this.containers[ i ].containerCache.over){
this.containers[ i ]._trigger("out", event, this._uiHash(this) );
this.containers[ i ].containerCache.over=0;
}}
}
if(!innermostContainer){
return;
}
if(this.containers.length===1){
if(!this.containers[ innermostIndex ].containerCache.over){
this.containers[ innermostIndex ]._trigger("over", event, this._uiHash(this) );
this.containers[ innermostIndex ].containerCache.over=1;
}}else{
dist=10000;
itemWithLeastDistance=null;
floating=innermostContainer.floating||this._isFloating(this.currentItem);
posProperty=floating ? "left":"top";
sizeProperty=floating ? "width":"height";
axis=floating ? "pageX":"pageY";
for(j=this.items.length - 1; j >=0; j--){
if(!$.contains(this.containers[ innermostIndex ].element[ 0 ], this.items[ j ].item[ 0 ])
){
continue;
}
if(this.items[ j ].item[ 0 ]===this.currentItem[ 0 ]){
continue;
}
cur=this.items[ j ].item.offset()[ posProperty ];
nearBottom=false;
if(event[ axis ] - cur > this.items[ j ][ sizeProperty ] / 2){
nearBottom=true;
}
if(Math.abs(event[ axis ] - cur) < dist){
dist=Math.abs(event[ axis ] - cur);
itemWithLeastDistance=this.items[ j ];
this.direction=nearBottom ? "up":"down";
}}
if(!itemWithLeastDistance&&!this.options.dropOnEmpty){
return;
}
if(this.currentContainer===this.containers[ innermostIndex ]){
if(!this.currentContainer.containerCache.over){
this.containers[ innermostIndex ]._trigger("over", event, this._uiHash());
this.currentContainer.containerCache.over=1;
}
return;
}
if(itemWithLeastDistance){
this._rearrange(event, itemWithLeastDistance, null, true);
}else{
this._rearrange(event, null, this.containers[ innermostIndex ].element, true);
}
this._trigger("change", event, this._uiHash());
this.containers[ innermostIndex ]._trigger("change", event, this._uiHash(this) );
this.currentContainer=this.containers[ innermostIndex ];
this.options.placeholder.update(this.currentContainer, this.placeholder);
this.scrollParent=this.placeholder.scrollParent();
if(this.scrollParent[ 0 ]!==this.document[ 0 ] &&
this.scrollParent[ 0 ].tagName!=="HTML"){
this.overflowOffset=this.scrollParent.offset();
}
this.containers[ innermostIndex ]._trigger("over", event, this._uiHash(this) );
this.containers[ innermostIndex ].containerCache.over=1;
}},
_createHelper: function(event){
var o=this.options,
helper=typeof o.helper==="function" ?
$(o.helper.apply(this.element[ 0 ], [ event, this.currentItem ]) ) :
(o.helper==="clone" ? this.currentItem.clone():this.currentItem);
if(!helper.parents("body").length){
this.appendTo[ 0 ].appendChild(helper[ 0 ]);
}
if(helper[ 0 ]===this.currentItem[ 0 ]){
this._storedCSS={
width: this.currentItem[ 0 ].style.width,
height: this.currentItem[ 0 ].style.height,
position: this.currentItem.css("position"),
top: this.currentItem.css("top"),
left: this.currentItem.css("left")
};}
if(!helper[ 0 ].style.width||o.forceHelperSize){
helper.width(this.currentItem.width());
}
if(!helper[ 0 ].style.height||o.forceHelperSize){
helper.height(this.currentItem.height());
}
return helper;
},
_adjustOffsetFromHelper: function(obj){
if(typeof obj==="string"){
obj=obj.split(" ");
}
if(Array.isArray(obj) ){
obj={ left: +obj[ 0 ], top: +obj[ 1 ]||0 };}
if("left" in obj){
this.offset.click.left=obj.left + this.margins.left;
}
if("right" in obj){
this.offset.click.left=this.helperProportions.width - obj.right + this.margins.left;
}
if("top" in obj){
this.offset.click.top=obj.top + this.margins.top;
}
if("bottom" in obj){
this.offset.click.top=this.helperProportions.height - obj.bottom + this.margins.top;
}},
_getParentOffset: function(){
this.offsetParent=this.helper.offsetParent();
var po=this.offsetParent.offset();
if(this.cssPosition==="absolute"&&this.scrollParent[ 0 ]!==this.document[ 0 ] &&
$.contains(this.scrollParent[ 0 ], this.offsetParent[ 0 ]) ){
po.left +=this.scrollParent.scrollLeft();
po.top +=this.scrollParent.scrollTop();
}
if(this.offsetParent[ 0 ]===this.document[ 0 ].body ||
(this.offsetParent[ 0 ].tagName &&
this.offsetParent[ 0 ].tagName.toLowerCase()==="html"&&$.ui.ie) ){
po={ top: 0, left: 0 };}
return {
top: po.top +(parseInt(this.offsetParent.css("borderTopWidth"), 10)||0),
left: po.left +(parseInt(this.offsetParent.css("borderLeftWidth"), 10)||0)
};},
_getRelativeOffset: function(){
if(this.cssPosition==="relative"){
var p=this.currentItem.position();
return {
top: p.top -(parseInt(this.helper.css("top"), 10)||0) +
this.scrollParent.scrollTop(),
left: p.left -(parseInt(this.helper.css("left"), 10)||0) +
this.scrollParent.scrollLeft()
};}else{
return { top: 0, left: 0 };}},
_cacheMargins: function(){
this.margins={
left:(parseInt(this.currentItem.css("marginLeft"), 10)||0),
top:(parseInt(this.currentItem.css("marginTop"), 10)||0)
};},
_cacheHelperProportions: function(){
this.helperProportions={
width: this.helper.outerWidth(),
height: this.helper.outerHeight()
};},
_setContainment: function(){
var ce, co, over,
o=this.options;
if(o.containment==="parent"){
o.containment=this.helper[ 0 ].parentNode;
}
if(o.containment==="document"||o.containment==="window"){
this.containment=[
0 - this.offset.relative.left - this.offset.parent.left,
0 - this.offset.relative.top - this.offset.parent.top,
o.containment==="document" ?
this.document.width() :
this.window.width() - this.helperProportions.width - this.margins.left,
(o.containment==="document" ?
(this.document.height()||document.body.parentNode.scrollHeight) :
this.window.height()||this.document[ 0 ].body.parentNode.scrollHeight
) - this.helperProportions.height - this.margins.top
];
}
if(!(/^(document|window|parent)$/).test(o.containment) ){
ce=$(o.containment)[ 0 ];
co=$(o.containment).offset();
over=($(ce).css("overflow")!=="hidden");
this.containment=[
co.left +(parseInt($(ce).css("borderLeftWidth"), 10)||0) +
(parseInt($(ce).css("paddingLeft"), 10)||0) - this.margins.left,
co.top +(parseInt($(ce).css("borderTopWidth"), 10)||0) +
(parseInt($(ce).css("paddingTop"), 10)||0) - this.margins.top,
co.left +(over ? Math.max(ce.scrollWidth, ce.offsetWidth):ce.offsetWidth) -
(parseInt($(ce).css("borderLeftWidth"), 10)||0) -
(parseInt($(ce).css("paddingRight"), 10)||0) -
this.helperProportions.width - this.margins.left,
co.top +(over ? Math.max(ce.scrollHeight, ce.offsetHeight):ce.offsetHeight) -
(parseInt($(ce).css("borderTopWidth"), 10)||0) -
(parseInt($(ce).css("paddingBottom"), 10)||0) -
this.helperProportions.height - this.margins.top
];
}},
_convertPositionTo: function(d, pos){
if(!pos){
pos=this.position;
}
var mod=d==="absolute" ? 1:-1,
scroll=this.cssPosition==="absolute" &&
!(this.scrollParent[ 0 ]!==this.document[ 0 ] &&
$.contains(this.scrollParent[ 0 ], this.offsetParent[ 0 ]) ) ?
this.offsetParent :
this.scrollParent,
scrollIsRootNode=(/(html|body)/i).test(scroll[ 0 ].tagName);
return {
top: (
pos.top	+
this.offset.relative.top * mod +
this.offset.parent.top * mod -
(( this.cssPosition==="fixed" ?
-this.scrollParent.scrollTop() :
(scrollIsRootNode ? 0:scroll.scrollTop()) ) * mod)
),
left: (
pos.left +
this.offset.relative.left * mod +
this.offset.parent.left * mod	-
(( this.cssPosition==="fixed" ?
-this.scrollParent.scrollLeft():scrollIsRootNode ? 0 :
scroll.scrollLeft()) * mod)
)
};},
_generatePosition: function(event){
var top, left,
o=this.options,
pageX=event.pageX,
pageY=event.pageY,
scroll=this.cssPosition==="absolute" &&
!(this.scrollParent[ 0 ]!==this.document[ 0 ] &&
$.contains(this.scrollParent[ 0 ], this.offsetParent[ 0 ]) ) ?
this.offsetParent :
this.scrollParent,
scrollIsRootNode=(/(html|body)/i).test(scroll[ 0 ].tagName);
if(this.cssPosition==="relative"&&!(this.scrollParent[ 0 ]!==this.document[ 0 ] &&
this.scrollParent[ 0 ]!==this.offsetParent[ 0 ]) ){
this.offset.relative=this._getRelativeOffset();
}
if(this.originalPosition){
if(this.containment){
if(event.pageX - this.offset.click.left < this.containment[ 0 ]){
pageX=this.containment[ 0 ] + this.offset.click.left;
}
if(event.pageY - this.offset.click.top < this.containment[ 1 ]){
pageY=this.containment[ 1 ] + this.offset.click.top;
}
if(event.pageX - this.offset.click.left > this.containment[ 2 ]){
pageX=this.containment[ 2 ] + this.offset.click.left;
}
if(event.pageY - this.offset.click.top > this.containment[ 3 ]){
pageY=this.containment[ 3 ] + this.offset.click.top;
}}
if(o.grid){
top=this.originalPageY + Math.round(( pageY - this.originalPageY) /
o.grid[ 1 ]) * o.grid[ 1 ];
pageY=this.containment ?
(( top - this.offset.click.top >=this.containment[ 1 ] &&
top - this.offset.click.top <=this.containment[ 3 ]) ?
top :
(( top - this.offset.click.top >=this.containment[ 1 ]) ?
top - o.grid[ 1 ]:top + o.grid[ 1 ]) ) :
top;
left=this.originalPageX + Math.round(( pageX - this.originalPageX) /
o.grid[ 0 ]) * o.grid[ 0 ];
pageX=this.containment ?
(( left - this.offset.click.left >=this.containment[ 0 ] &&
left - this.offset.click.left <=this.containment[ 2 ]) ?
left :
(( left - this.offset.click.left >=this.containment[ 0 ]) ?
left - o.grid[ 0 ]:left + o.grid[ 0 ]) ) :
left;
}}
return {
top: (
pageY -
this.offset.click.top -
this.offset.relative.top -
this.offset.parent.top +
(( this.cssPosition==="fixed" ?
-this.scrollParent.scrollTop() :
(scrollIsRootNode ? 0:scroll.scrollTop()) ))
),
left: (
pageX -
this.offset.click.left -
this.offset.relative.left -
this.offset.parent.left +
(( this.cssPosition==="fixed" ?
-this.scrollParent.scrollLeft() :
scrollIsRootNode ? 0:scroll.scrollLeft()) )
)
};},
_rearrange: function(event, i, a, hardRefresh){
if(a){
a[ 0 ].appendChild(this.placeholder[ 0 ]);
}else{
i.item[ 0 ].parentNode.insertBefore(this.placeholder[ 0 ],
(this.direction==="down" ? i.item[ 0 ]:i.item[ 0 ].nextSibling) );
}
this.counter=this.counter ? ++this.counter:1;
var counter=this.counter;
this._delay(function(){
if(counter===this.counter){
this.refreshPositions(!hardRefresh);
}});
},
_clear: function(event, noPropagation){
this.reverting=false;
var i,
delayedTriggers=[];
if(!this._noFinalSort&&this.currentItem.parent().length){
this.placeholder.before(this.currentItem);
}
this._noFinalSort=null;
if(this.helper[ 0 ]===this.currentItem[ 0 ]){
for(i in this._storedCSS){
if(this._storedCSS[ i ]==="auto"||this._storedCSS[ i ]==="static"){
this._storedCSS[ i ]="";
}}
this.currentItem.css(this._storedCSS);
this._removeClass(this.currentItem, "ui-sortable-helper");
}else{
this.currentItem.show();
}
if(this.fromOutside&&!noPropagation){
delayedTriggers.push(function(event){
this._trigger("receive", event, this._uiHash(this.fromOutside) );
});
}
if(( this.fromOutside ||
this.domPosition.prev!==this.currentItem.prev().not(".ui-sortable-helper")[ 0 ] ||
this.domPosition.parent!==this.currentItem.parent()[ 0 ])&&!noPropagation){
delayedTriggers.push(function(event){
this._trigger("update", event, this._uiHash());
});
}
if(this!==this.currentContainer){
if(!noPropagation){
delayedTriggers.push(function(event){
this._trigger("remove", event, this._uiHash());
});
delayedTriggers.push(( function(c){
return function(event){
c._trigger("receive", event, this._uiHash(this) );
};}).call(this, this.currentContainer) );
delayedTriggers.push(( function(c){
return function(event){
c._trigger("update", event, this._uiHash(this) );
};}).call(this, this.currentContainer) );
}}
function delayEvent(type, instance, container){
return function(event){
container._trigger(type, event, instance._uiHash(instance) );
};}
for(i=this.containers.length - 1; i >=0; i--){
if(!noPropagation){
delayedTriggers.push(delayEvent("deactivate", this, this.containers[ i ]) );
}
if(this.containers[ i ].containerCache.over){
delayedTriggers.push(delayEvent("out", this, this.containers[ i ]) );
this.containers[ i ].containerCache.over=0;
}}
if(this.storedCursor){
this.document.find("body").css("cursor", this.storedCursor);
this.storedStylesheet.remove();
}
if(this._storedOpacity){
this.helper.css("opacity", this._storedOpacity);
}
if(this._storedZIndex){
this.helper.css("zIndex", this._storedZIndex==="auto" ? "":this._storedZIndex);
}
this.dragging=false;
if(!noPropagation){
this._trigger("beforeStop", event, this._uiHash());
}
this.placeholder[ 0 ].parentNode.removeChild(this.placeholder[ 0 ]);
if(!this.cancelHelperRemoval){
if(this.helper[ 0 ]!==this.currentItem[ 0 ]){
this.helper.remove();
}
this.helper=null;
}
if(!noPropagation){
for(i=0; i < delayedTriggers.length; i++){
delayedTriggers[ i ].call(this, event);
}
this._trigger("stop", event, this._uiHash());
}
this.fromOutside=false;
return !this.cancelHelperRemoval;
},
_trigger: function(){
if($.Widget.prototype._trigger.apply(this, arguments)===false){
this.cancel();
}},
_uiHash: function(_inst){
var inst=_inst||this;
return {
helper: inst.helper,
placeholder: inst.placeholder||$([]),
position: inst.position,
originalPosition: inst.originalPosition,
offset: inst.positionAbs,
item: inst.currentItem,
sender: _inst ? _inst.element:null
};}});
});
(function(b){b.support.touch="ontouchend" in document;if(!b.support.touch){return}var c=b.ui.mouse.prototype,e=c._mouseInit,a;function d(g,h){if(g.originalEvent.touches.length>1){return}g.preventDefault();var i=g.originalEvent.changedTouches[0],f=document.createEvent("MouseEvents");f.initMouseEvent(h,true,true,window,1,i.screenX,i.screenY,i.clientX,i.clientY,false,false,false,false,0,null);g.target.dispatchEvent(f)}c._touchStart=function(g){var f=this;if(a||!f._mouseCapture(g.originalEvent.changedTouches[0])){return}a=true;f._touchMoved=false;d(g,"mouseover");d(g,"mousemove");d(g,"mousedown")};c._touchMove=function(f){if(!a){return}this._touchMoved=true;d(f,"mousemove")};c._touchEnd=function(f){if(!a){return}d(f,"mouseup");d(f,"mouseout");if(!this._touchMoved){d(f,"click")}a=false};c._mouseInit=function(){var f=this;f.element.bind("touchstart",b.proxy(f,"_touchStart")).bind("touchmove",b.proxy(f,"_touchMove")).bind("touchend",b.proxy(f,"_touchEnd"));e.call(f)}})(jQuery);
(function(factory){
"use strict";
if(typeof define==="function"&&define.amd){
define([
"jquery",
"../version",
"../keycode"
], factory);
}else{
factory(jQuery);
}})(function($){
"use strict";
$.extend($.ui, { datepicker: { version: "1.13.3" }});
var datepicker_instActive;
function datepicker_getZindex(elem){
var position, value;
while(elem.length&&elem[ 0 ]!==document){
position=elem.css("position");
if(position==="absolute"||position==="relative"||position==="fixed"){
value=parseInt(elem.css("zIndex"), 10);
if(!isNaN(value)&&value!==0){
return value;
}}
elem=elem.parent();
}
return 0;
}
function Datepicker(){
this._curInst=null;
this._keyEvent=false;
this._disabledInputs=[];
this._datepickerShowing=false;
this._inDialog=false;
this._mainDivId="ui-datepicker-div";
this._inlineClass="ui-datepicker-inline";
this._appendClass="ui-datepicker-append";
this._triggerClass="ui-datepicker-trigger";
this._dialogClass="ui-datepicker-dialog";
this._disableClass="ui-datepicker-disabled";
this._unselectableClass="ui-datepicker-unselectable";
this._currentClass="ui-datepicker-current-day";
this._dayOverClass="ui-datepicker-days-cell-over";
this.regional=[];
this.regional[ "" ]={
closeText: "Done",
prevText: "Prev",
nextText: "Next",
currentText: "Today",
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" ],
dayNamesMin: [ "Su", "Mo", "Tu", "We", "Th", "Fr", "Sa" ],
weekHeader: "Wk",
dateFormat: "mm/dd/yy",
firstDay: 0,
isRTL: false,
showMonthAfterYear: false,
yearSuffix: "",
selectMonthLabel: "Select month",
selectYearLabel: "Select year"
};
this._defaults={
showOn: "focus", // "focus" for popup on focus,
showAnim: "fadeIn",
showOptions: {},
defaultDate: null,
appendText: "",
buttonText: "...",
buttonImage: "",
buttonImageOnly: false,
hideIfNoPrevNext: false,
navigationAsDateFormat: false,
gotoCurrent: false,
changeMonth: false,
changeYear: false,
yearRange: "c-10:c+10",
showOtherMonths: false,
selectOtherMonths: false,
showWeek: false,
calculateWeek: this.iso8601Week,
shortYearCutoff: "+10",
minDate: null,
maxDate: null,
duration: "fast",
beforeShowDay: null,
beforeShow: null,
onSelect: null,
onChangeMonthYear: null,
onClose: null,
onUpdateDatepicker: null,
numberOfMonths: 1,
showCurrentAtPos: 0,
stepMonths: 1,
stepBigMonths: 12,
altField: "",
altFormat: "",
constrainInput: true,
showButtonPanel: false,
autoSize: false,
disabled: false
};
$.extend(this._defaults, this.regional[ "" ]);
this.regional.en=$.extend(true, {}, this.regional[ "" ]);
this.regional[ "en-US" ]=$.extend(true, {}, this.regional.en);
this.dpDiv=datepicker_bindHover($("<div id='" + this._mainDivId + "' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>") );
}
$.extend(Datepicker.prototype, {
markerClassName: "hasDatepicker",
maxRows: 4,
_widgetDatepicker: function(){
return this.dpDiv;
},
setDefaults: function(settings){
datepicker_extendRemove(this._defaults, settings||{});
return this;
},
_attachDatepicker: function(target, settings){
var nodeName, inline, inst;
nodeName=target.nodeName.toLowerCase();
inline=(nodeName==="div"||nodeName==="span");
if(!target.id){
this.uuid +=1;
target.id="dp" + this.uuid;
}
inst=this._newInst($(target), inline);
inst.settings=$.extend({}, settings||{});
if(nodeName==="input"){
this._connectDatepicker(target, inst);
}else if(inline){
this._inlineDatepicker(target, inst);
}},
_newInst: function(target, inline){
var id=target[ 0 ].id.replace(/([^A-Za-z0-9_\-])/g, "\\\\$1");
return { id: id, input: target,
selectedDay: 0, selectedMonth: 0, selectedYear: 0,
drawMonth: 0, drawYear: 0,
inline: inline,
dpDiv:(!inline ? this.dpDiv :
datepicker_bindHover($("<div class='" + this._inlineClass + " ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>") )) };},
_connectDatepicker: function(target, inst){
var input=$(target);
inst.append=$([]);
inst.trigger=$([]);
if(input.hasClass(this.markerClassName) ){
return;
}
this._attachments(input, inst);
input.addClass(this.markerClassName).on("keydown", this._doKeyDown).
on("keypress", this._doKeyPress).on("keyup", this._doKeyUp);
this._autoSize(inst);
$.data(target, "datepicker", inst);
if(inst.settings.disabled){
this._disableDatepicker(target);
}},
_attachments: function(input, inst){
var showOn, buttonText, buttonImage,
appendText=this._get(inst, "appendText"),
isRTL=this._get(inst, "isRTL");
if(inst.append){
inst.append.remove();
}
if(appendText){
inst.append=$("<span>")
.addClass(this._appendClass)
.text(appendText);
input[ isRTL ? "before":"after" ](inst.append);
}
input.off("focus", this._showDatepicker);
if(inst.trigger){
inst.trigger.remove();
}
showOn=this._get(inst, "showOn");
if(showOn==="focus"||showOn==="both"){
input.on("focus", this._showDatepicker);
}
if(showOn==="button"||showOn==="both"){
buttonText=this._get(inst, "buttonText");
buttonImage=this._get(inst, "buttonImage");
if(this._get(inst, "buttonImageOnly") ){
inst.trigger=$("<img>")
.addClass(this._triggerClass)
.attr({
src: buttonImage,
alt: buttonText,
title: buttonText
});
}else{
inst.trigger=$("<button type='button'>")
.addClass(this._triggerClass);
if(buttonImage){
inst.trigger.html($("<img>")
.attr({
src: buttonImage,
alt: buttonText,
title: buttonText
})
);
}else{
inst.trigger.text(buttonText);
}}
input[ isRTL ? "before":"after" ](inst.trigger);
inst.trigger.on("click", function(){
if($.datepicker._datepickerShowing&&$.datepicker._lastInput===input[ 0 ]){
$.datepicker._hideDatepicker();
}else if($.datepicker._datepickerShowing&&$.datepicker._lastInput!==input[ 0 ]){
$.datepicker._hideDatepicker();
$.datepicker._showDatepicker(input[ 0 ]);
}else{
$.datepicker._showDatepicker(input[ 0 ]);
}
return false;
});
}},
_autoSize: function(inst){
if(this._get(inst, "autoSize")&&!inst.inline){
var findMax, max, maxI, i,
date=new Date(2009, 12 - 1, 20),
dateFormat=this._get(inst, "dateFormat");
if(dateFormat.match(/[DM]/) ){
findMax=function(names){
max=0;
maxI=0;
for(i=0; i < names.length; i++){
if(names[ i ].length > max){
max=names[ i ].length;
maxI=i;
}}
return maxI;
};
date.setMonth(findMax(this._get(inst,(dateFormat.match(/MM/) ?
"monthNames":"monthNamesShort") )) );
date.setDate(findMax(this._get(inst,(dateFormat.match(/DD/) ?
"dayNames":"dayNamesShort") )) + 20 - date.getDay());
}
inst.input.attr("size", this._formatDate(inst, date).length);
}},
_inlineDatepicker: function(target, inst){
var divSpan=$(target);
if(divSpan.hasClass(this.markerClassName) ){
return;
}
divSpan.addClass(this.markerClassName).append(inst.dpDiv);
$.data(target, "datepicker", inst);
this._setDate(inst, this._getDefaultDate(inst), true);
this._updateDatepicker(inst);
this._updateAlternate(inst);
if(inst.settings.disabled){
this._disableDatepicker(target);
}
inst.dpDiv.css("display", "block");
},
_dialogDatepicker: function(input, date, onSelect, settings, pos){
var id, browserWidth, browserHeight, scrollX, scrollY,
inst=this._dialogInst;
if(!inst){
this.uuid +=1;
id="dp" + this.uuid;
this._dialogInput=$("<input type='text' id='" + id +
"' style='position: absolute; top: -100px; width: 0px;'/>");
this._dialogInput.on("keydown", this._doKeyDown);
$("body").append(this._dialogInput);
inst=this._dialogInst=this._newInst(this._dialogInput, false);
inst.settings={};
$.data(this._dialogInput[ 0 ], "datepicker", inst);
}
datepicker_extendRemove(inst.settings, settings||{});
date=(date&&date.constructor===Date ? this._formatDate(inst, date):date);
this._dialogInput.val(date);
this._pos=(pos ?(pos.length ? pos:[ pos.pageX, pos.pageY ]):null);
if(!this._pos){
browserWidth=document.documentElement.clientWidth;
browserHeight=document.documentElement.clientHeight;
scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;
scrollY=document.documentElement.scrollTop||document.body.scrollTop;
this._pos =
[(browserWidth / 2) - 100 + scrollX,(browserHeight / 2) - 150 + scrollY ];
}
this._dialogInput.css("left",(this._pos[ 0 ] + 20) + "px").css("top", this._pos[ 1 ] + "px");
inst.settings.onSelect=onSelect;
this._inDialog=true;
this.dpDiv.addClass(this._dialogClass);
this._showDatepicker(this._dialogInput[ 0 ]);
if($.blockUI){
$.blockUI(this.dpDiv);
}
$.data(this._dialogInput[ 0 ], "datepicker", inst);
return this;
},
_destroyDatepicker: function(target){
var nodeName,
$target=$(target),
inst=$.data(target, "datepicker");
if(!$target.hasClass(this.markerClassName) ){
return;
}
nodeName=target.nodeName.toLowerCase();
$.removeData(target, "datepicker");
if(nodeName==="input"){
inst.append.remove();
inst.trigger.remove();
$target.removeClass(this.markerClassName).
off("focus", this._showDatepicker).
off("keydown", this._doKeyDown).
off("keypress", this._doKeyPress).
off("keyup", this._doKeyUp);
}else if(nodeName==="div"||nodeName==="span"){
$target.removeClass(this.markerClassName).empty();
}
if(datepicker_instActive===inst){
datepicker_instActive=null;
this._curInst=null;
}},
_enableDatepicker: function(target){
var nodeName, inline,
$target=$(target),
inst=$.data(target, "datepicker");
if(!$target.hasClass(this.markerClassName) ){
return;
}
nodeName=target.nodeName.toLowerCase();
if(nodeName==="input"){
target.disabled=false;
inst.trigger.filter("button").
each(function(){
this.disabled=false;
}).end().
filter("img").css({ opacity: "1.0", cursor: "" });
}else if(nodeName==="div"||nodeName==="span"){
inline=$target.children("." + this._inlineClass);
inline.children().removeClass("ui-state-disabled");
inline.find("select.ui-datepicker-month, select.ui-datepicker-year").
prop("disabled", false);
}
this._disabledInputs=$.map(this._disabledInputs,
function(value){
return(value===target ? null:value);
});
},
_disableDatepicker: function(target){
var nodeName, inline,
$target=$(target),
inst=$.data(target, "datepicker");
if(!$target.hasClass(this.markerClassName) ){
return;
}
nodeName=target.nodeName.toLowerCase();
if(nodeName==="input"){
target.disabled=true;
inst.trigger.filter("button").
each(function(){
this.disabled=true;
}).end().
filter("img").css({ opacity: "0.5", cursor: "default" });
}else if(nodeName==="div"||nodeName==="span"){
inline=$target.children("." + this._inlineClass);
inline.children().addClass("ui-state-disabled");
inline.find("select.ui-datepicker-month, select.ui-datepicker-year").
prop("disabled", true);
}
this._disabledInputs=$.map(this._disabledInputs,
function(value){
return(value===target ? null:value);
});
this._disabledInputs[ this._disabledInputs.length ]=target;
},
_isDisabledDatepicker: function(target){
if(!target){
return false;
}
for(var i=0; i < this._disabledInputs.length; i++){
if(this._disabledInputs[ i ]===target){
return true;
}}
return false;
},
_getInst: function(target){
try {
return $.data(target, "datepicker");
} catch(err){
throw "Missing instance data for this datepicker";
}},
_optionDatepicker: function(target, name, value){
var settings, date, minDate, maxDate,
inst=this._getInst(target);
if(arguments.length===2&&typeof name==="string"){
return(name==="defaults" ? $.extend({}, $.datepicker._defaults) :
(inst ?(name==="all" ? $.extend({}, inst.settings) :
this._get(inst, name) ):null) );
}
settings=name||{};
if(typeof name==="string"){
settings={};
settings[ name ]=value;
}
if(inst){
if(this._curInst===inst){
this._hideDatepicker();
}
date=this._getDateDatepicker(target, true);
minDate=this._getMinMaxDate(inst, "min");
maxDate=this._getMinMaxDate(inst, "max");
datepicker_extendRemove(inst.settings, settings);
if(minDate!==null&&settings.dateFormat!==undefined&&settings.minDate===undefined){
inst.settings.minDate=this._formatDate(inst, minDate);
}
if(maxDate!==null&&settings.dateFormat!==undefined&&settings.maxDate===undefined){
inst.settings.maxDate=this._formatDate(inst, maxDate);
}
if("disabled" in settings){
if(settings.disabled){
this._disableDatepicker(target);
}else{
this._enableDatepicker(target);
}}
this._attachments($(target), inst);
this._autoSize(inst);
this._setDate(inst, date);
this._updateAlternate(inst);
this._updateDatepicker(inst);
}},
_changeDatepicker: function(target, name, value){
this._optionDatepicker(target, name, value);
},
_refreshDatepicker: function(target){
var inst=this._getInst(target);
if(inst){
this._updateDatepicker(inst);
}},
_setDateDatepicker: function(target, date){
var inst=this._getInst(target);
if(inst){
this._setDate(inst, date);
this._updateDatepicker(inst);
this._updateAlternate(inst);
}},
_getDateDatepicker: function(target, noDefault){
var inst=this._getInst(target);
if(inst&&!inst.inline){
this._setDateFromField(inst, noDefault);
}
return(inst ? this._getDate(inst):null);
},
_doKeyDown: function(event){
var onSelect, dateStr, sel,
inst=$.datepicker._getInst(event.target),
handled=true,
isRTL=inst.dpDiv.is(".ui-datepicker-rtl");
inst._keyEvent=true;
if($.datepicker._datepickerShowing){
switch(event.keyCode){
case 9: $.datepicker._hideDatepicker();
handled=false;
break;
case 13: sel=$("td." + $.datepicker._dayOverClass + ":not(." +
$.datepicker._currentClass + ")", inst.dpDiv);
if(sel[ 0 ]){
$.datepicker._selectDay(event.target, inst.selectedMonth, inst.selectedYear, sel[ 0 ]);
}
onSelect=$.datepicker._get(inst, "onSelect");
if(onSelect){
dateStr=$.datepicker._formatDate(inst);
onSelect.apply(( inst.input ? inst.input[ 0 ]:null), [ dateStr, inst ]);
}else{
$.datepicker._hideDatepicker();
}
return false;
case 27: $.datepicker._hideDatepicker();
break;
case 33: $.datepicker._adjustDate(event.target,(event.ctrlKey ?
-$.datepicker._get(inst, "stepBigMonths") :
-$.datepicker._get(inst, "stepMonths") ), "M");
break;
case 34: $.datepicker._adjustDate(event.target,(event.ctrlKey ?
+$.datepicker._get(inst, "stepBigMonths") :
+$.datepicker._get(inst, "stepMonths") ), "M");
break;
case 35: if(event.ctrlKey||event.metaKey){
$.datepicker._clearDate(event.target);
}
handled=event.ctrlKey||event.metaKey;
break;
case 36: if(event.ctrlKey||event.metaKey){
$.datepicker._gotoToday(event.target);
}
handled=event.ctrlKey||event.metaKey;
break;
case 37: if(event.ctrlKey||event.metaKey){
$.datepicker._adjustDate(event.target,(isRTL ? +1:-1), "D");
}
handled=event.ctrlKey||event.metaKey;
if(event.originalEvent.altKey){
$.datepicker._adjustDate(event.target,(event.ctrlKey ?
-$.datepicker._get(inst, "stepBigMonths") :
-$.datepicker._get(inst, "stepMonths") ), "M");
}
break;
case 38: if(event.ctrlKey||event.metaKey){
$.datepicker._adjustDate(event.target, -7, "D");
}
handled=event.ctrlKey||event.metaKey;
break;
case 39: if(event.ctrlKey||event.metaKey){
$.datepicker._adjustDate(event.target,(isRTL ? -1:+1), "D");
}
handled=event.ctrlKey||event.metaKey;
if(event.originalEvent.altKey){
$.datepicker._adjustDate(event.target,(event.ctrlKey ?
+$.datepicker._get(inst, "stepBigMonths") :
+$.datepicker._get(inst, "stepMonths") ), "M");
}
break;
case 40: if(event.ctrlKey||event.metaKey){
$.datepicker._adjustDate(event.target, +7, "D");
}
handled=event.ctrlKey||event.metaKey;
break;
default: handled=false;
}}else if(event.keyCode===36&&event.ctrlKey){
$.datepicker._showDatepicker(this);
}else{
handled=false;
}
if(handled){
event.preventDefault();
event.stopPropagation();
}},
_doKeyPress: function(event){
var chars, chr,
inst=$.datepicker._getInst(event.target);
if($.datepicker._get(inst, "constrainInput") ){
chars=$.datepicker._possibleChars($.datepicker._get(inst, "dateFormat") );
chr=String.fromCharCode(event.charCode==null ? event.keyCode:event.charCode);
return event.ctrlKey||event.metaKey||(chr < " "||!chars||chars.indexOf(chr) > -1);
}},
_doKeyUp: function(event){
var date,
inst=$.datepicker._getInst(event.target);
if(inst.input.val()!==inst.lastVal){
try {
date=$.datepicker.parseDate($.datepicker._get(inst, "dateFormat"),
(inst.input ? inst.input.val():null),
$.datepicker._getFormatConfig(inst) );
if(date){
$.datepicker._setDateFromField(inst);
$.datepicker._updateAlternate(inst);
$.datepicker._updateDatepicker(inst);
}} catch(err){
}}
return true;
},
_showDatepicker: function(input){
input=input.target||input;
if(input.nodeName.toLowerCase()!=="input"){
input=$("input", input.parentNode)[ 0 ];
}
if($.datepicker._isDisabledDatepicker(input)||$.datepicker._lastInput===input){
return;
}
var inst, beforeShow, beforeShowSettings, isFixed,
offset, showAnim, duration;
inst=$.datepicker._getInst(input);
if($.datepicker._curInst&&$.datepicker._curInst!==inst){
$.datepicker._curInst.dpDiv.stop(true, true);
if(inst&&$.datepicker._datepickerShowing){
$.datepicker._hideDatepicker($.datepicker._curInst.input[ 0 ]);
}}
beforeShow=$.datepicker._get(inst, "beforeShow");
beforeShowSettings=beforeShow ? beforeShow.apply(input, [ input, inst ]):{};
if(beforeShowSettings===false){
return;
}
datepicker_extendRemove(inst.settings, beforeShowSettings);
inst.lastVal=null;
$.datepicker._lastInput=input;
$.datepicker._setDateFromField(inst);
if($.datepicker._inDialog){
input.value="";
}
if(!$.datepicker._pos){
$.datepicker._pos=$.datepicker._findPos(input);
$.datepicker._pos[ 1 ] +=input.offsetHeight;
}
isFixed=false;
$(input).parents().each(function(){
isFixed |=$(this).css("position")==="fixed";
return !isFixed;
});
offset={ left: $.datepicker._pos[ 0 ], top: $.datepicker._pos[ 1 ] };
$.datepicker._pos=null;
inst.dpDiv.empty();
inst.dpDiv.css({ position: "absolute", display: "block", top: "-1000px" });
$.datepicker._updateDatepicker(inst);
offset=$.datepicker._checkOffset(inst, offset, isFixed);
inst.dpDiv.css({ position:($.datepicker._inDialog&&$.blockUI ?
"static":(isFixed ? "fixed":"absolute") ), display: "none",
left: offset.left + "px", top: offset.top + "px" });
if(!inst.inline){
showAnim=$.datepicker._get(inst, "showAnim");
duration=$.datepicker._get(inst, "duration");
inst.dpDiv.css("z-index", datepicker_getZindex($(input) ) + 1);
$.datepicker._datepickerShowing=true;
if($.effects&&$.effects.effect[ showAnim ]){
inst.dpDiv.show(showAnim, $.datepicker._get(inst, "showOptions"), duration);
}else{
inst.dpDiv[ showAnim||"show" ](showAnim ? duration:null);
}
if($.datepicker._shouldFocusInput(inst) ){
inst.input.trigger("focus");
}
$.datepicker._curInst=inst;
}},
_updateDatepicker: function(inst){
this.maxRows=4;
datepicker_instActive=inst;
inst.dpDiv.empty().append(this._generateHTML(inst) );
this._attachHandlers(inst);
var origyearshtml,
numMonths=this._getNumberOfMonths(inst),
cols=numMonths[ 1 ],
width=17,
activeCell=inst.dpDiv.find("." + this._dayOverClass + " a"),
onUpdateDatepicker=$.datepicker._get(inst, "onUpdateDatepicker");
if(activeCell.length > 0){
datepicker_handleMouseover.apply(activeCell.get(0) );
}
inst.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");
if(cols > 1){
inst.dpDiv.addClass("ui-datepicker-multi-" + cols).css("width",(width * cols) + "em");
}
inst.dpDiv[(numMonths[ 0 ]!==1||numMonths[ 1 ]!==1 ? "add":"remove") +
"Class" ]("ui-datepicker-multi");
inst.dpDiv[(this._get(inst, "isRTL") ? "add":"remove") +
"Class" ]("ui-datepicker-rtl");
if(inst===$.datepicker._curInst&&$.datepicker._datepickerShowing&&$.datepicker._shouldFocusInput(inst) ){
inst.input.trigger("focus");
}
if(inst.yearshtml){
origyearshtml=inst.yearshtml;
setTimeout(function(){
if(origyearshtml===inst.yearshtml&&inst.yearshtml){
inst.dpDiv.find("select.ui-datepicker-year").first().replaceWith(inst.yearshtml);
}
origyearshtml=inst.yearshtml=null;
}, 0);
}
if(onUpdateDatepicker){
onUpdateDatepicker.apply(( inst.input ? inst.input[ 0 ]:null), [ inst ]);
}},
_shouldFocusInput: function(inst){
return inst.input&&inst.input.is(":visible")&&!inst.input.is(":disabled")&&!inst.input.is(":focus");
},
_checkOffset: function(inst, offset, isFixed){
var dpWidth=inst.dpDiv.outerWidth(),
dpHeight=inst.dpDiv.outerHeight(),
inputWidth=inst.input ? inst.input.outerWidth():0,
inputHeight=inst.input ? inst.input.outerHeight():0,
viewWidth=document.documentElement.clientWidth +(isFixed ? 0:$(document).scrollLeft()),
viewHeight=document.documentElement.clientHeight +(isFixed ? 0:$(document).scrollTop());
offset.left -=(this._get(inst, "isRTL") ?(dpWidth - inputWidth):0);
offset.left -=(isFixed&&offset.left===inst.input.offset().left) ? $(document).scrollLeft():0;
offset.top -=(isFixed&&offset.top===(inst.input.offset().top + inputHeight) ) ? $(document).scrollTop():0;
offset.left -=Math.min(offset.left,(offset.left + dpWidth > viewWidth&&viewWidth > dpWidth) ?
Math.abs(offset.left + dpWidth - viewWidth):0);
offset.top -=Math.min(offset.top,(offset.top + dpHeight > viewHeight&&viewHeight > dpHeight) ?
Math.abs(dpHeight + inputHeight):0);
return offset;
},
_findPos: function(obj){
var position,
inst=this._getInst(obj),
isRTL=this._get(inst, "isRTL");
while(obj&&(obj.type==="hidden"||obj.nodeType!==1||$.expr.pseudos.hidden(obj) )){
obj=obj[ isRTL ? "previousSibling":"nextSibling" ];
}
position=$(obj).offset();
return [ position.left, position.top ];
},
_hideDatepicker: function(input){
var showAnim, duration, postProcess, onClose,
inst=this._curInst;
if(!inst||(input&&inst!==$.data(input, "datepicker") )){
return;
}
if(this._datepickerShowing){
showAnim=this._get(inst, "showAnim");
duration=this._get(inst, "duration");
postProcess=function(){
$.datepicker._tidyDialog(inst);
};
if($.effects&&($.effects.effect[ showAnim ]||$.effects[ showAnim ]) ){
inst.dpDiv.hide(showAnim, $.datepicker._get(inst, "showOptions"), duration, postProcess);
}else{
inst.dpDiv[(showAnim==="slideDown" ? "slideUp" :
(showAnim==="fadeIn" ? "fadeOut":"hide") ) ](( showAnim ? duration:null), postProcess);
}
if(!showAnim){
postProcess();
}
this._datepickerShowing=false;
onClose=this._get(inst, "onClose");
if(onClose){
onClose.apply(( inst.input ? inst.input[ 0 ]:null), [(inst.input ? inst.input.val():""), inst ]);
}
this._lastInput=null;
if(this._inDialog){
this._dialogInput.css({ position: "absolute", left: "0", top: "-100px" });
if($.blockUI){
$.unblockUI();
$("body").append(this.dpDiv);
}}
this._inDialog=false;
}},
_tidyDialog: function(inst){
inst.dpDiv.removeClass(this._dialogClass).off(".ui-datepicker-calendar");
},
_checkExternalClick: function(event){
if(!$.datepicker._curInst){
return;
}
var $target=$(event.target),
inst=$.datepicker._getInst($target[ 0 ]);
if((($target[ 0 ].id!==$.datepicker._mainDivId &&
$target.parents("#" + $.datepicker._mainDivId).length===0 &&
!$target.hasClass($.datepicker.markerClassName) &&
!$target.closest("." + $.datepicker._triggerClass).length &&
$.datepicker._datepickerShowing&&!($.datepicker._inDialog&&$.blockUI) )) ||
($target.hasClass($.datepicker.markerClassName)&&$.datepicker._curInst!==inst) ){
$.datepicker._hideDatepicker();
}},
_adjustDate: function(id, offset, period){
var target=$(id),
inst=this._getInst(target[ 0 ]);
if(this._isDisabledDatepicker(target[ 0 ]) ){
return;
}
this._adjustInstDate(inst, offset, period);
this._updateDatepicker(inst);
},
_gotoToday: function(id){
var date,
target=$(id),
inst=this._getInst(target[ 0 ]);
if(this._get(inst, "gotoCurrent")&&inst.currentDay){
inst.selectedDay=inst.currentDay;
inst.drawMonth=inst.selectedMonth=inst.currentMonth;
inst.drawYear=inst.selectedYear=inst.currentYear;
}else{
date=new Date();
inst.selectedDay=date.getDate();
inst.drawMonth=inst.selectedMonth=date.getMonth();
inst.drawYear=inst.selectedYear=date.getFullYear();
}
this._notifyChange(inst);
this._adjustDate(target);
},
_selectMonthYear: function(id, select, period){
var target=$(id),
inst=this._getInst(target[ 0 ]);
inst[ "selected" +(period==="M" ? "Month":"Year") ] =
inst[ "draw" +(period==="M" ? "Month":"Year") ] =
parseInt(select.options[ select.selectedIndex ].value, 10);
this._notifyChange(inst);
this._adjustDate(target);
},
_selectDay: function(id, month, year, td){
var inst,
target=$(id);
if($(td).hasClass(this._unselectableClass)||this._isDisabledDatepicker(target[ 0 ]) ){
return;
}
inst=this._getInst(target[ 0 ]);
inst.selectedDay=inst.currentDay=parseInt($("a", td).attr("data-date") );
inst.selectedMonth=inst.currentMonth=month;
inst.selectedYear=inst.currentYear=year;
this._selectDate(id, this._formatDate(inst,
inst.currentDay, inst.currentMonth, inst.currentYear) );
},
_clearDate: function(id){
var target=$(id);
this._selectDate(target, "");
},
_selectDate: function(id, dateStr){
var onSelect,
target=$(id),
inst=this._getInst(target[ 0 ]);
dateStr=(dateStr!=null ? dateStr:this._formatDate(inst) );
if(inst.input){
inst.input.val(dateStr);
}
this._updateAlternate(inst);
onSelect=this._get(inst, "onSelect");
if(onSelect){
onSelect.apply(( inst.input ? inst.input[ 0 ]:null), [ dateStr, inst ]);
}else if(inst.input){
inst.input.trigger("change");
}
if(inst.inline){
this._updateDatepicker(inst);
}else{
this._hideDatepicker();
this._lastInput=inst.input[ 0 ];
if(typeof(inst.input[ 0 ])!=="object"){
inst.input.trigger("focus");
}
this._lastInput=null;
}},
_updateAlternate: function(inst){
var altFormat, date, dateStr,
altField=this._get(inst, "altField");
if(altField){
altFormat=this._get(inst, "altFormat")||this._get(inst, "dateFormat");
date=this._getDate(inst);
dateStr=this.formatDate(altFormat, date, this._getFormatConfig(inst) );
$(document).find(altField).val(dateStr);
}},
noWeekends: function(date){
var day=date.getDay();
return [(day > 0&&day < 6), "" ];
},
iso8601Week: function(date){
var time,
checkDate=new Date(date.getTime());
checkDate.setDate(checkDate.getDate() + 4 -(checkDate.getDay()||7) );
time=checkDate.getTime();
checkDate.setMonth(0);
checkDate.setDate(1);
return Math.floor(Math.round(( time - checkDate) / 86400000) / 7) + 1;
},
parseDate: function(format, value, settings){
if(format==null||value==null){
throw "Invalid arguments";
}
value=(typeof value==="object" ? value.toString():value + "");
if(value===""){
return null;
}
var iFormat, dim, extra,
iValue=0,
shortYearCutoffTemp=(settings ? settings.shortYearCutoff:null)||this._defaults.shortYearCutoff,
shortYearCutoff=(typeof shortYearCutoffTemp!=="string" ? shortYearCutoffTemp :
new Date().getFullYear() % 100 + parseInt(shortYearCutoffTemp, 10) ),
dayNamesShort=(settings ? settings.dayNamesShort:null)||this._defaults.dayNamesShort,
dayNames=(settings ? settings.dayNames:null)||this._defaults.dayNames,
monthNamesShort=(settings ? settings.monthNamesShort:null)||this._defaults.monthNamesShort,
monthNames=(settings ? settings.monthNames:null)||this._defaults.monthNames,
year=-1,
month=-1,
day=-1,
doy=-1,
literal=false,
date,
lookAhead=function(match){
var matches=(iFormat + 1 < format.length&&format.charAt(iFormat + 1)===match);
if(matches){
iFormat++;
}
return matches;
},
getNumber=function(match){
var isDoubled=lookAhead(match),
size=(match==="@" ? 14:(match==="!" ? 20 :
(match==="y"&&isDoubled ? 4:(match==="o" ? 3:2) )) ),
minSize=(match==="y" ? size:1),
digits=new RegExp("^\\d{" + minSize + "," + size + "}"),
num=value.substring(iValue).match(digits);
if(!num){
throw "Missing number at position " + iValue;
}
iValue +=num[ 0 ].length;
return parseInt(num[ 0 ], 10);
},
getName=function(match, shortNames, longNames){
var index=-1,
names=$.map(lookAhead(match) ? longNames:shortNames, function(v, k){
return [ [ k, v ] ];
}).sort(function(a, b){
return -(a[ 1 ].length - b[ 1 ].length);
});
$.each(names, function(i, pair){
var name=pair[ 1 ];
if(value.substr(iValue, name.length).toLowerCase()===name.toLowerCase()){
index=pair[ 0 ];
iValue +=name.length;
return false;
}});
if(index!==-1){
return index + 1;
}else{
throw "Unknown name at position " + iValue;
}},
checkLiteral=function(){
if(value.charAt(iValue)!==format.charAt(iFormat) ){
throw "Unexpected literal at position " + iValue;
}
iValue++;
};
for(iFormat=0; iFormat < format.length; iFormat++){
if(literal){
if(format.charAt(iFormat)==="'"&&!lookAhead("'") ){
literal=false;
}else{
checkLiteral();
}}else{
switch(format.charAt(iFormat) ){
case "d":
day=getNumber("d");
break;
case "D":
getName("D", dayNamesShort, dayNames);
break;
case "o":
doy=getNumber("o");
break;
case "m":
month=getNumber("m");
break;
case "M":
month=getName("M", monthNamesShort, monthNames);
break;
case "y":
year=getNumber("y");
break;
case "@":
date=new Date(getNumber("@") );
year=date.getFullYear();
month=date.getMonth() + 1;
day=date.getDate();
break;
case "!":
date=new Date(( getNumber("!") - this._ticksTo1970) / 10000);
year=date.getFullYear();
month=date.getMonth() + 1;
day=date.getDate();
break;
case "'":
if(lookAhead("'") ){
checkLiteral();
}else{
literal=true;
}
break;
default:
checkLiteral();
}}
}
if(iValue < value.length){
extra=value.substr(iValue);
if(!/^\s+/.test(extra) ){
throw "Extra/unparsed characters found in date: " + extra;
}}
if(year===-1){
year=new Date().getFullYear();
}else if(year < 100){
year +=new Date().getFullYear() - new Date().getFullYear() % 100 +
(year <=shortYearCutoff ? 0:-100);
}
if(doy > -1){
month=1;
day=doy;
do {
dim=this._getDaysInMonth(year, month - 1);
if(day <=dim){
break;
}
month++;
day -=dim;
} while(true);
}
date=this._daylightSavingAdjust(new Date(year, month - 1, day) );
if(date.getFullYear()!==year||date.getMonth() + 1!==month||date.getDate()!==day){
throw "Invalid date";
}
return date;
},
ATOM: "yy-mm-dd",
COOKIE: "D, dd M yy",
ISO_8601: "yy-mm-dd",
RFC_822: "D, d M y",
RFC_850: "DD, dd-M-y",
RFC_1036: "D, d M y",
RFC_1123: "D, d M yy",
RFC_2822: "D, d M yy",
RSS: "D, d M y",
TICKS: "!",
TIMESTAMP: "@",
W3C: "yy-mm-dd",
_ticksTo1970:(((1970 - 1) * 365 + Math.floor(1970 / 4) - Math.floor(1970 / 100) +
Math.floor(1970 / 400) ) * 24 * 60 * 60 * 10000000),
formatDate: function(format, date, settings){
if(!date){
return "";
}
var iFormat,
dayNamesShort=(settings ? settings.dayNamesShort:null)||this._defaults.dayNamesShort,
dayNames=(settings ? settings.dayNames:null)||this._defaults.dayNames,
monthNamesShort=(settings ? settings.monthNamesShort:null)||this._defaults.monthNamesShort,
monthNames=(settings ? settings.monthNames:null)||this._defaults.monthNames,
lookAhead=function(match){
var matches=(iFormat + 1 < format.length&&format.charAt(iFormat + 1)===match);
if(matches){
iFormat++;
}
return matches;
},
formatNumber=function(match, value, len){
var num="" + value;
if(lookAhead(match) ){
while(num.length < len){
num="0" + num;
}}
return num;
},
formatName=function(match, value, shortNames, longNames){
return(lookAhead(match) ? longNames[ value ]:shortNames[ value ]);
},
output="",
literal=false;
if(date){
for(iFormat=0; iFormat < format.length; iFormat++){
if(literal){
if(format.charAt(iFormat)==="'"&&!lookAhead("'") ){
literal=false;
}else{
output +=format.charAt(iFormat);
}}else{
switch(format.charAt(iFormat) ){
case "d":
output +=formatNumber("d", date.getDate(), 2);
break;
case "D":
output +=formatName("D", date.getDay(), dayNamesShort, dayNames);
break;
case "o":
output +=formatNumber("o",
Math.round(( new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime() - new Date(date.getFullYear(), 0, 0).getTime()) / 86400000), 3);
break;
case "m":
output +=formatNumber("m", date.getMonth() + 1, 2);
break;
case "M":
output +=formatName("M", date.getMonth(), monthNamesShort, monthNames);
break;
case "y":
output +=(lookAhead("y") ? date.getFullYear() :
(date.getFullYear() % 100 < 10 ? "0":"") + date.getFullYear() % 100);
break;
case "@":
output +=date.getTime();
break;
case "!":
output +=date.getTime() * 10000 + this._ticksTo1970;
break;
case "'":
if(lookAhead("'") ){
output +="'";
}else{
literal=true;
}
break;
default:
output +=format.charAt(iFormat);
}}
}}
return output;
},
_possibleChars: function(format){
var iFormat,
chars="",
literal=false,
lookAhead=function(match){
var matches=(iFormat + 1 < format.length&&format.charAt(iFormat + 1)===match);
if(matches){
iFormat++;
}
return matches;
};
for(iFormat=0; iFormat < format.length; iFormat++){
if(literal){
if(format.charAt(iFormat)==="'"&&!lookAhead("'") ){
literal=false;
}else{
chars +=format.charAt(iFormat);
}}else{
switch(format.charAt(iFormat) ){
case "d": case "m": case "y": case "@":
chars +="0123456789";
break;
case "D": case "M":
return null;
case "'":
if(lookAhead("'") ){
chars +="'";
}else{
literal=true;
}
break;
default:
chars +=format.charAt(iFormat);
}}
}
return chars;
},
_get: function(inst, name){
return inst.settings[ name ]!==undefined ?
inst.settings[ name ]:this._defaults[ name ];
},
_setDateFromField: function(inst, noDefault){
if(inst.input.val()===inst.lastVal){
return;
}
var dateFormat=this._get(inst, "dateFormat"),
dates=inst.lastVal=inst.input ? inst.input.val():null,
defaultDate=this._getDefaultDate(inst),
date=defaultDate,
settings=this._getFormatConfig(inst);
try {
date=this.parseDate(dateFormat, dates, settings)||defaultDate;
} catch(event){
dates=(noDefault ? "":dates);
}
inst.selectedDay=date.getDate();
inst.drawMonth=inst.selectedMonth=date.getMonth();
inst.drawYear=inst.selectedYear=date.getFullYear();
inst.currentDay=(dates ? date.getDate():0);
inst.currentMonth=(dates ? date.getMonth():0);
inst.currentYear=(dates ? date.getFullYear():0);
this._adjustInstDate(inst);
},
_getDefaultDate: function(inst){
return this._restrictMinMax(inst,
this._determineDate(inst, this._get(inst, "defaultDate"), new Date()) );
},
_determineDate: function(inst, date, defaultDate){
var offsetNumeric=function(offset){
var date=new Date();
date.setDate(date.getDate() + offset);
return date;
},
offsetString=function(offset){
try {
return $.datepicker.parseDate($.datepicker._get(inst, "dateFormat"),
offset, $.datepicker._getFormatConfig(inst) );
} catch(e){
}
var date=(offset.toLowerCase().match(/^c/) ?
$.datepicker._getDate(inst):null)||new Date(),
year=date.getFullYear(),
month=date.getMonth(),
day=date.getDate(),
pattern=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,
matches=pattern.exec(offset);
while(matches){
switch(matches[ 2 ]||"d"){
case "d":case "D" :
day +=parseInt(matches[ 1 ], 10); break;
case "w":case "W" :
day +=parseInt(matches[ 1 ], 10) * 7; break;
case "m":case "M" :
month +=parseInt(matches[ 1 ], 10);
day=Math.min(day, $.datepicker._getDaysInMonth(year, month) );
break;
case "y": case "Y" :
year +=parseInt(matches[ 1 ], 10);
day=Math.min(day, $.datepicker._getDaysInMonth(year, month) );
break;
}
matches=pattern.exec(offset);
}
return new Date(year, month, day);
},
newDate=(date==null||date==="" ? defaultDate:(typeof date==="string" ? offsetString(date) :
(typeof date==="number" ?(isNaN(date) ? defaultDate:offsetNumeric(date) ):new Date(date.getTime()) )) );
newDate=(newDate&&newDate.toString()==="Invalid Date" ? defaultDate:newDate);
if(newDate){
newDate.setHours(0);
newDate.setMinutes(0);
newDate.setSeconds(0);
newDate.setMilliseconds(0);
}
return this._daylightSavingAdjust(newDate);
},
_daylightSavingAdjust: function(date){
if(!date){
return null;
}
date.setHours(date.getHours() > 12 ? date.getHours() + 2:0);
return date;
},
_setDate: function(inst, date, noChange){
var clear = !date,
origMonth=inst.selectedMonth,
origYear=inst.selectedYear,
newDate=this._restrictMinMax(inst, this._determineDate(inst, date, new Date()) );
inst.selectedDay=inst.currentDay=newDate.getDate();
inst.drawMonth=inst.selectedMonth=inst.currentMonth=newDate.getMonth();
inst.drawYear=inst.selectedYear=inst.currentYear=newDate.getFullYear();
if(( origMonth!==inst.selectedMonth||origYear!==inst.selectedYear)&&!noChange){
this._notifyChange(inst);
}
this._adjustInstDate(inst);
if(inst.input){
inst.input.val(clear ? "":this._formatDate(inst) );
}},
_getDate: function(inst){
var startDate=(!inst.currentYear||(inst.input&&inst.input.val()==="") ? null :
this._daylightSavingAdjust(new Date(
inst.currentYear, inst.currentMonth, inst.currentDay) ));
return startDate;
},
_attachHandlers: function(inst){
var stepMonths=this._get(inst, "stepMonths"),
id="#" + inst.id.replace(/\\\\/g, "\\");
inst.dpDiv.find("[data-handler]").map(function(){
var handler={
prev: function(){
$.datepicker._adjustDate(id, -stepMonths, "M");
},
next: function(){
$.datepicker._adjustDate(id, +stepMonths, "M");
},
hide: function(){
$.datepicker._hideDatepicker();
},
today: function(){
$.datepicker._gotoToday(id);
},
selectDay: function(){
$.datepicker._selectDay(id, +this.getAttribute("data-month"), +this.getAttribute("data-year"), this);
return false;
},
selectMonth: function(){
$.datepicker._selectMonthYear(id, this, "M");
return false;
},
selectYear: function(){
$.datepicker._selectMonthYear(id, this, "Y");
return false;
}};
$(this).on(this.getAttribute("data-event"), handler[ this.getAttribute("data-handler") ]);
});
},
_generateHTML: function(inst){
var maxDraw, prevText, prev, nextText, next, currentText, gotoDate,
controls, buttonPanel, firstDay, showWeek, dayNames, dayNamesMin,
monthNames, monthNamesShort, beforeShowDay, showOtherMonths,
selectOtherMonths, defaultDate, html, dow, row, group, col, selectedDate,
cornerClass, calender, thead, day, daysInMonth, leadDays, curRows, numRows,
printDate, dRow, tbody, daySettings, otherMonth, unselectable,
tempDate=new Date(),
today=this._daylightSavingAdjust(new Date(tempDate.getFullYear(), tempDate.getMonth(), tempDate.getDate()) ),
isRTL=this._get(inst, "isRTL"),
showButtonPanel=this._get(inst, "showButtonPanel"),
hideIfNoPrevNext=this._get(inst, "hideIfNoPrevNext"),
navigationAsDateFormat=this._get(inst, "navigationAsDateFormat"),
numMonths=this._getNumberOfMonths(inst),
showCurrentAtPos=this._get(inst, "showCurrentAtPos"),
stepMonths=this._get(inst, "stepMonths"),
isMultiMonth=(numMonths[ 0 ]!==1||numMonths[ 1 ]!==1),
currentDate=this._daylightSavingAdjust(( !inst.currentDay ? new Date(9999, 9, 9) :
new Date(inst.currentYear, inst.currentMonth, inst.currentDay) )),
minDate=this._getMinMaxDate(inst, "min"),
maxDate=this._getMinMaxDate(inst, "max"),
drawMonth=inst.drawMonth - showCurrentAtPos,
drawYear=inst.drawYear;
if(drawMonth < 0){
drawMonth +=12;
drawYear--;
}
if(maxDate){
maxDraw=this._daylightSavingAdjust(new Date(maxDate.getFullYear(),
maxDate.getMonth() -(numMonths[ 0 ] * numMonths[ 1 ]) + 1, maxDate.getDate()) );
maxDraw=(minDate&&maxDraw < minDate ? minDate:maxDraw);
while(this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1) ) > maxDraw){
drawMonth--;
if(drawMonth < 0){
drawMonth=11;
drawYear--;
}}
}
inst.drawMonth=drawMonth;
inst.drawYear=drawYear;
prevText=this._get(inst, "prevText");
prevText=(!navigationAsDateFormat ? prevText:this.formatDate(prevText,
this._daylightSavingAdjust(new Date(drawYear, drawMonth - stepMonths, 1) ),
this._getFormatConfig(inst) ));
if(this._canAdjustMonth(inst, -1, drawYear, drawMonth) ){
prev=$("<a>")
.attr({
"class": "ui-datepicker-prev ui-corner-all",
"data-handler": "prev",
"data-event": "click",
title: prevText
})
.append($("<span>")
.addClass("ui-icon ui-icon-circle-triangle-" +
(isRTL ? "e":"w") )
.text(prevText)
)[ 0 ].outerHTML;
}else if(hideIfNoPrevNext){
prev="";
}else{
prev=$("<a>")
.attr({
"class": "ui-datepicker-prev ui-corner-all ui-state-disabled",
title: prevText
})
.append($("<span>")
.addClass("ui-icon ui-icon-circle-triangle-" +
(isRTL ? "e":"w") )
.text(prevText)
)[ 0 ].outerHTML;
}
nextText=this._get(inst, "nextText");
nextText=(!navigationAsDateFormat ? nextText:this.formatDate(nextText,
this._daylightSavingAdjust(new Date(drawYear, drawMonth + stepMonths, 1) ),
this._getFormatConfig(inst) ));
if(this._canAdjustMonth(inst, +1, drawYear, drawMonth) ){
next=$("<a>")
.attr({
"class": "ui-datepicker-next ui-corner-all",
"data-handler": "next",
"data-event": "click",
title: nextText
})
.append($("<span>")
.addClass("ui-icon ui-icon-circle-triangle-" +
(isRTL ? "w":"e") )
.text(nextText)
)[ 0 ].outerHTML;
}else if(hideIfNoPrevNext){
next="";
}else{
next=$("<a>")
.attr({
"class": "ui-datepicker-next ui-corner-all ui-state-disabled",
title: nextText
})
.append($("<span>")
.attr("class", "ui-icon ui-icon-circle-triangle-" +
(isRTL ? "w":"e") )
.text(nextText)
)[ 0 ].outerHTML;
}
currentText=this._get(inst, "currentText");
gotoDate=(this._get(inst, "gotoCurrent")&&inst.currentDay ? currentDate:today);
currentText=(!navigationAsDateFormat ? currentText :
this.formatDate(currentText, gotoDate, this._getFormatConfig(inst) ));
controls="";
if(!inst.inline){
controls=$("<button>")
.attr({
type: "button",
"class": "ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all",
"data-handler": "hide",
"data-event": "click"
})
.text(this._get(inst, "closeText") )[ 0 ].outerHTML;
}
buttonPanel="";
if(showButtonPanel){
buttonPanel=$("<div class='ui-datepicker-buttonpane ui-widget-content'>")
.append(isRTL ? controls:"")
.append(this._isInRange(inst, gotoDate) ?
$("<button>")
.attr({
type: "button",
"class": "ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all",
"data-handler": "today",
"data-event": "click"
})
.text(currentText) :
"")
.append(isRTL ? "":controls)[ 0 ].outerHTML;
}
firstDay=parseInt(this._get(inst, "firstDay"), 10);
firstDay=(isNaN(firstDay) ? 0:firstDay);
showWeek=this._get(inst, "showWeek");
dayNames=this._get(inst, "dayNames");
dayNamesMin=this._get(inst, "dayNamesMin");
monthNames=this._get(inst, "monthNames");
monthNamesShort=this._get(inst, "monthNamesShort");
beforeShowDay=this._get(inst, "beforeShowDay");
showOtherMonths=this._get(inst, "showOtherMonths");
selectOtherMonths=this._get(inst, "selectOtherMonths");
defaultDate=this._getDefaultDate(inst);
html="";
for(row=0; row < numMonths[ 0 ]; row++){
group="";
this.maxRows=4;
for(col=0; col < numMonths[ 1 ]; col++){
selectedDate=this._daylightSavingAdjust(new Date(drawYear, drawMonth, inst.selectedDay) );
cornerClass=" ui-corner-all";
calender="";
if(isMultiMonth){
calender +="<div class='ui-datepicker-group";
if(numMonths[ 1 ] > 1){
switch(col){
case 0: calender +=" ui-datepicker-group-first";
cornerClass=" ui-corner-" +(isRTL ? "right":"left"); break;
case numMonths[ 1 ] - 1: calender +=" ui-datepicker-group-last";
cornerClass=" ui-corner-" +(isRTL ? "left":"right"); break;
default: calender +=" ui-datepicker-group-middle"; cornerClass=""; break;
}}
calender +="'>";
}
calender +="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix" + cornerClass + "'>" +
(/all|left/.test(cornerClass)&&row===0 ?(isRTL ? next:prev):"") +
(/all|right/.test(cornerClass)&&row===0 ?(isRTL ? prev:next):"") +
this._generateMonthYearHeader(inst, drawMonth, drawYear, minDate, maxDate,
row > 0||col > 0, monthNames, monthNamesShort) +
"</div><table class='ui-datepicker-calendar'><thead>" +
"<tr>";
thead=(showWeek ? "<th class='ui-datepicker-week-col'>" + this._get(inst, "weekHeader") + "</th>":"");
for(dow=0; dow < 7; dow++){
day=(dow + firstDay) % 7;
thead +="<th scope='col'" +(( dow + firstDay + 6) % 7 >=5 ? " class='ui-datepicker-week-end'":"") + ">" +
"<span title='" + dayNames[ day ] + "'>" + dayNamesMin[ day ] + "</span></th>";
}
calender +=thead + "</tr></thead><tbody>";
daysInMonth=this._getDaysInMonth(drawYear, drawMonth);
if(drawYear===inst.selectedYear&&drawMonth===inst.selectedMonth){
inst.selectedDay=Math.min(inst.selectedDay, daysInMonth);
}
leadDays=(this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7;
curRows=Math.ceil(( leadDays + daysInMonth) / 7);
numRows=(isMultiMonth ? this.maxRows > curRows ? this.maxRows:curRows:curRows);
this.maxRows=numRows;
printDate=this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1 - leadDays) );
for(dRow=0; dRow < numRows; dRow++){
calender +="<tr>";
tbody=(!showWeek ? "":"<td class='ui-datepicker-week-col'>" +
this._get(inst, "calculateWeek")(printDate) + "</td>");
for(dow=0; dow < 7; dow++){
daySettings=(beforeShowDay ?
beforeShowDay.apply(( inst.input ? inst.input[ 0 ]:null), [ printDate ]):[ true, "" ]);
otherMonth=(printDate.getMonth()!==drawMonth);
unselectable=(otherMonth&&!selectOtherMonths)||!daySettings[ 0 ] ||
(minDate&&printDate < minDate)||(maxDate&&printDate > maxDate);
tbody +="<td class='" +
(( dow + firstDay + 6) % 7 >=5 ? " ui-datepicker-week-end":"") +
(otherMonth ? " ui-datepicker-other-month":"") +
(( printDate.getTime()===selectedDate.getTime()&&drawMonth===inst.selectedMonth&&inst._keyEvent) ||
(defaultDate.getTime()===printDate.getTime()&&defaultDate.getTime()===selectedDate.getTime()) ?
" " + this._dayOverClass:"") +
(unselectable ? " " + this._unselectableClass + " ui-state-disabled":"") +
(otherMonth&&!showOtherMonths ? "":" " + daySettings[ 1 ] +
(printDate.getTime()===currentDate.getTime() ? " " + this._currentClass:"") +
(printDate.getTime()===today.getTime() ? " ui-datepicker-today":"") ) + "'" +
(( !otherMonth||showOtherMonths)&&daySettings[ 2 ] ? " title='" + daySettings[ 2 ].replace(/'/g, "&#39;") + "'":"") +
(unselectable ? "":" data-handler='selectDay' data-event='click' data-month='" + printDate.getMonth() + "' data-year='" + printDate.getFullYear() + "'") + ">" +
(otherMonth&&!showOtherMonths ? "&#xa0;" :
(unselectable ? "<span class='ui-state-default'>" + printDate.getDate() + "</span>":"<a class='ui-state-default" +
(printDate.getTime()===today.getTime() ? " ui-state-highlight":"") +
(printDate.getTime()===currentDate.getTime() ? " ui-state-active":"") +
(otherMonth ? " ui-priority-secondary":"") +
"' href='#' aria-current='" +(printDate.getTime()===currentDate.getTime() ? "true":"false") +
"' data-date='" + printDate.getDate() +
"'>" + printDate.getDate() + "</a>") ) + "</td>";
printDate.setDate(printDate.getDate() + 1);
printDate=this._daylightSavingAdjust(printDate);
}
calender +=tbody + "</tr>";
}
drawMonth++;
if(drawMonth > 11){
drawMonth=0;
drawYear++;
}
calender +="</tbody></table>" +(isMultiMonth ? "</div>" +
(( numMonths[ 0 ] > 0&&col===numMonths[ 1 ] - 1) ? "<div class='ui-datepicker-row-break'></div>":""):"");
group +=calender;
}
html +=group;
}
html +=buttonPanel;
inst._keyEvent=false;
return html;
},
_generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate,
secondary, monthNames, monthNamesShort){
var inMinYear, inMaxYear, month, years, thisYear, determineYear, year, endYear,
changeMonth=this._get(inst, "changeMonth"),
changeYear=this._get(inst, "changeYear"),
showMonthAfterYear=this._get(inst, "showMonthAfterYear"),
selectMonthLabel=this._get(inst, "selectMonthLabel"),
selectYearLabel=this._get(inst, "selectYearLabel"),
html="<div class='ui-datepicker-title'>",
monthHtml="";
if(secondary||!changeMonth){
monthHtml +="<span class='ui-datepicker-month'>" + monthNames[ drawMonth ] + "</span>";
}else{
inMinYear=(minDate&&minDate.getFullYear()===drawYear);
inMaxYear=(maxDate&&maxDate.getFullYear()===drawYear);
monthHtml +="<select class='ui-datepicker-month' aria-label='" + selectMonthLabel + "' data-handler='selectMonth' data-event='change'>";
for(month=0; month < 12; month++){
if(( !inMinYear||month >=minDate.getMonth())&&(!inMaxYear||month <=maxDate.getMonth()) ){
monthHtml +="<option value='" + month + "'" +
(month===drawMonth ? " selected='selected'":"") +
">" + monthNamesShort[ month ] + "</option>";
}}
monthHtml +="</select>";
}
if(!showMonthAfterYear){
html +=monthHtml +(secondary||!(changeMonth&&changeYear) ? "&#xa0;":"");
}
if(!inst.yearshtml){
inst.yearshtml="";
if(secondary||!changeYear){
html +="<span class='ui-datepicker-year'>" + drawYear + "</span>";
}else{
years=this._get(inst, "yearRange").split(":");
thisYear=new Date().getFullYear();
determineYear=function(value){
var year=(value.match(/c[+\-].*/) ? drawYear + parseInt(value.substring(1), 10) :
(value.match(/[+\-].*/) ? thisYear + parseInt(value, 10) :
parseInt(value, 10) ));
return(isNaN(year) ? thisYear:year);
};
year=determineYear(years[ 0 ]);
endYear=Math.max(year, determineYear(years[ 1 ]||"") );
year=(minDate ? Math.max(year, minDate.getFullYear()):year);
endYear=(maxDate ? Math.min(endYear, maxDate.getFullYear()):endYear);
inst.yearshtml +="<select class='ui-datepicker-year' aria-label='" + selectYearLabel + "' data-handler='selectYear' data-event='change'>";
for(; year <=endYear; year++){
inst.yearshtml +="<option value='" + year + "'" +
(year===drawYear ? " selected='selected'":"") +
">" + year + "</option>";
}
inst.yearshtml +="</select>";
html +=inst.yearshtml;
inst.yearshtml=null;
}}
html +=this._get(inst, "yearSuffix");
if(showMonthAfterYear){
html +=(secondary||!(changeMonth&&changeYear) ? "&#xa0;":"") + monthHtml;
}
html +="</div>";
return html;
},
_adjustInstDate: function(inst, offset, period){
var year=inst.selectedYear +(period==="Y" ? offset:0),
month=inst.selectedMonth +(period==="M" ? offset:0),
day=Math.min(inst.selectedDay, this._getDaysInMonth(year, month) ) +(period==="D" ? offset:0),
date=this._restrictMinMax(inst, this._daylightSavingAdjust(new Date(year, month, day) ));
inst.selectedDay=date.getDate();
inst.drawMonth=inst.selectedMonth=date.getMonth();
inst.drawYear=inst.selectedYear=date.getFullYear();
if(period==="M"||period==="Y"){
this._notifyChange(inst);
}},
_restrictMinMax: function(inst, date){
var minDate=this._getMinMaxDate(inst, "min"),
maxDate=this._getMinMaxDate(inst, "max"),
newDate=(minDate&&date < minDate ? minDate:date);
return(maxDate&&newDate > maxDate ? maxDate:newDate);
},
_notifyChange: function(inst){
var onChange=this._get(inst, "onChangeMonthYear");
if(onChange){
onChange.apply(( inst.input ? inst.input[ 0 ]:null),
[ inst.selectedYear, inst.selectedMonth + 1, inst ]);
}},
_getNumberOfMonths: function(inst){
var numMonths=this._get(inst, "numberOfMonths");
return(numMonths==null ? [ 1, 1 ]:(typeof numMonths==="number" ? [ 1, numMonths ]:numMonths) );
},
_getMinMaxDate: function(inst, minMax){
return this._determineDate(inst, this._get(inst, minMax + "Date"), null);
},
_getDaysInMonth: function(year, month){
return 32 - this._daylightSavingAdjust(new Date(year, month, 32) ).getDate();
},
_getFirstDayOfMonth: function(year, month){
return new Date(year, month, 1).getDay();
},
_canAdjustMonth: function(inst, offset, curYear, curMonth){
var numMonths=this._getNumberOfMonths(inst),
date=this._daylightSavingAdjust(new Date(curYear,
curMonth +(offset < 0 ? offset:numMonths[ 0 ] * numMonths[ 1 ]), 1) );
if(offset < 0){
date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth()) );
}
return this._isInRange(inst, date);
},
_isInRange: function(inst, date){
var yearSplit, currentYear,
minDate=this._getMinMaxDate(inst, "min"),
maxDate=this._getMinMaxDate(inst, "max"),
minYear=null,
maxYear=null,
years=this._get(inst, "yearRange");
if(years){
yearSplit=years.split(":");
currentYear=new Date().getFullYear();
minYear=parseInt(yearSplit[ 0 ], 10);
maxYear=parseInt(yearSplit[ 1 ], 10);
if(yearSplit[ 0 ].match(/[+\-].*/) ){
minYear +=currentYear;
}
if(yearSplit[ 1 ].match(/[+\-].*/) ){
maxYear +=currentYear;
}}
return(( !minDate||date.getTime() >=minDate.getTime()) &&
(!maxDate||date.getTime() <=maxDate.getTime()) &&
(!minYear||date.getFullYear() >=minYear) &&
(!maxYear||date.getFullYear() <=maxYear) );
},
_getFormatConfig: function(inst){
var shortYearCutoff=this._get(inst, "shortYearCutoff");
shortYearCutoff=(typeof shortYearCutoff!=="string" ? shortYearCutoff :
new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10) );
return { shortYearCutoff: shortYearCutoff,
dayNamesShort: this._get(inst, "dayNamesShort"), dayNames: this._get(inst, "dayNames"),
monthNamesShort: this._get(inst, "monthNamesShort"), monthNames: this._get(inst, "monthNames") };},
_formatDate: function(inst, day, month, year){
if(!day){
inst.currentDay=inst.selectedDay;
inst.currentMonth=inst.selectedMonth;
inst.currentYear=inst.selectedYear;
}
var date=(day ?(typeof day==="object" ? day :
this._daylightSavingAdjust(new Date(year, month, day) )) :
this._daylightSavingAdjust(new Date(inst.currentYear, inst.currentMonth, inst.currentDay) ));
return this.formatDate(this._get(inst, "dateFormat"), date, this._getFormatConfig(inst) );
}});
function datepicker_bindHover(dpDiv){
var selector="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";
return dpDiv.on("mouseout", selector, function(){
$(this).removeClass("ui-state-hover");
if(this.className.indexOf("ui-datepicker-prev")!==-1){
$(this).removeClass("ui-datepicker-prev-hover");
}
if(this.className.indexOf("ui-datepicker-next")!==-1){
$(this).removeClass("ui-datepicker-next-hover");
}})
.on("mouseover", selector, datepicker_handleMouseover);
}
function datepicker_handleMouseover(){
if(!$.datepicker._isDisabledDatepicker(datepicker_instActive.inline ? datepicker_instActive.dpDiv.parent()[ 0 ]:datepicker_instActive.input[ 0 ]) ){
$(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");
$(this).addClass("ui-state-hover");
if(this.className.indexOf("ui-datepicker-prev")!==-1){
$(this).addClass("ui-datepicker-prev-hover");
}
if(this.className.indexOf("ui-datepicker-next")!==-1){
$(this).addClass("ui-datepicker-next-hover");
}}
}
function datepicker_extendRemove(target, props){
$.extend(target, props);
for(var name in props){
if(props[ name ]==null){
target[ name ]=props[ name ];
}}
return target;
}
$.fn.datepicker=function(options){
if(!this.length){
return this;
}
if(!$.datepicker.initialized){
$(document).on("mousedown", $.datepicker._checkExternalClick);
$.datepicker.initialized=true;
}
if($("#" + $.datepicker._mainDivId).length===0){
$("body").append($.datepicker.dpDiv);
}
var otherArgs=Array.prototype.slice.call(arguments, 1);
if(typeof options==="string"&&(options==="isDisabled"||options==="getDate"||options==="widget") ){
return $.datepicker[ "_" + options + "Datepicker" ].
apply($.datepicker, [ this[ 0 ] ].concat(otherArgs) );
}
if(options==="option"&&arguments.length===2&&typeof arguments[ 1 ]==="string"){
return $.datepicker[ "_" + options + "Datepicker" ].
apply($.datepicker, [ this[ 0 ] ].concat(otherArgs) );
}
return this.each(function(){
if(typeof options==="string"){
$.datepicker[ "_" + options + "Datepicker" ]
.apply($.datepicker, [ this ].concat(otherArgs) );
}else{
$.datepicker._attachDatepicker(this, options);
}});
};
$.datepicker=new Datepicker();
$.datepicker.initialized=false;
$.datepicker.uuid=new Date().getTime();
$.datepicker.version="1.13.3";
return $.datepicker;
});
!function(a,b){"object"==typeof exports&&exports&&"string"!=typeof exports.nodeName?b(exports):"function"==typeof define&&define.amd?define(["exports"],b):(a.Mustache_2={},b(a.Mustache_2))}(this,function(a){function b(a){return"function"==typeof a}function c(a){return p(a)?"array":typeof a}function d(a){return a.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function e(a,b){return null!=a&&"object"==typeof a&&b in a}function f(a,b){return q.call(a,b)}function g(a){return!f(r,a)}function h(a){return String(a).replace(/[&<>"'`=\/]/g,function(a){return s[a]})}function i(b,c){function e(){if(r&&!s)for(;q.length;)delete o[q.pop()];else q=[];r=!1,s=!1}function f(a){if("string"==typeof a&&(a=a.split(u,2)),!p(a)||2!==a.length)throw new Error("Invalid tags: "+a);h=new RegExp(d(a[0])+"\\s*"),i=new RegExp("\\s*"+d(a[1])),m=new RegExp("\\s*"+d("}"+a[1]))}if(!b)return[];var h,i,m,n=[],o=[],q=[],r=!1,s=!1;f(c||a.tags);for(var y,z,A,B,C,D,E=new l(b);!E.eos();){if(y=E.pos,A=E.scanUntil(h))for(var F=0,G=A.length;F<G;++F)B=A.charAt(F),g(B)?q.push(o.length):s=!0,o.push(["text",B,y,y+1]),y+=1,"\n"===B&&e();if(!E.scan(h))break;if(r=!0,z=E.scan(x)||"name",E.scan(t),"="===z?(A=E.scanUntil(v),E.scan(v),E.scanUntil(i)):"{"===z?(A=E.scanUntil(m),E.scan(w),E.scanUntil(i),z="&"):A=E.scanUntil(i),!E.scan(i))throw new Error("Unclosed tag at "+E.pos);if(C=[z,A,y,E.pos],o.push(C),"#"===z||"^"===z)n.push(C);else if("/"===z){if(D=n.pop(),!D)throw new Error('Unopened section "'+A+'" at '+y);if(D[1]!==A)throw new Error('Unclosed section "'+D[1]+'" at '+y)}else"name"===z||"{"===z||"&"===z?s=!0:"="===z&&f(A)}if(D=n.pop())throw new Error('Unclosed section "'+D[1]+'" at '+E.pos);return k(j(o))}function j(a){for(var b,c,d=[],e=0,f=a.length;e<f;++e)b=a[e],b&&("text"===b[0]&&c&&"text"===c[0]?(c[1]+=b[1],c[3]=b[3]):(d.push(b),c=b));return d}function k(a){for(var b,c,d=[],e=d,f=[],g=0,h=a.length;g<h;++g)switch(b=a[g],b[0]){case"#":case"^":e.push(b),f.push(b),e=b[4]=[];break;case"/":c=f.pop(),c[5]=b[2],e=f.length>0?f[f.length-1][4]:d;break;default:e.push(b)}return d}function l(a){this.string=a,this.tail=a,this.pos=0}function m(a,b){this.view=a,this.cache={".":this.view},this.parent=b}function n(){this.cache={}}var o=Object.prototype.toString,p=Array.isArray||function(a){return"[object Array]"===o.call(a)},q=RegExp.prototype.test,r=/\S/,s={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"},t=/\s*/,u=/\s+/,v=/\s*=/,w=/\s*\}/,x=/#|\^|\/|>|\{|&|=|!/;l.prototype.eos=function(){return""===this.tail},l.prototype.scan=function(a){var b=this.tail.match(a);if(!b||0!==b.index)return"";var c=b[0];return this.tail=this.tail.substring(c.length),this.pos+=c.length,c},l.prototype.scanUntil=function(a){var b,c=this.tail.search(a);switch(c){case-1:b=this.tail,this.tail="";break;case 0:b="";break;default:b=this.tail.substring(0,c),this.tail=this.tail.substring(c)}return this.pos+=b.length,b},m.prototype.push=function(a){return new m(a,this)},m.prototype.lookup=function(a){var c,d=this.cache;if(d.hasOwnProperty(a))c=d[a];else{for(var f,g,h=this,i=!1;h;){if(a.indexOf(".")>0)for(c=h.view,f=a.split("."),g=0;null!=c&&g<f.length;)g===f.length-1&&(i=e(c,f[g])),c=c[f[g++]];else c=h.view[a],i=e(h.view,a);if(i)break;h=h.parent}d[a]=c}return b(c)&&(c=c.call(this.view)),c},n.prototype.clearCache=function(){this.cache={}},n.prototype.parse=function(a,b){var c=this.cache,d=c[a];return null==d&&(d=c[a]=i(a,b)),d},n.prototype.render=function(a,b,c){var d=this.parse(a),e=b instanceof m?b:new m(b);return this.renderTokens(d,e,c,a)},n.prototype.renderTokens=function(a,b,c,d){for(var e,f,g,h="",i=0,j=a.length;i<j;++i)g=void 0,e=a[i],f=e[0],"#"===f?g=this.renderSection(e,b,c,d):"^"===f?g=this.renderInverted(e,b,c,d):">"===f?g=this.renderPartial(e,b,c,d):"&"===f?g=this.unescapedValue(e,b):"name"===f?g=this.escapedValue(e,b):"text"===f&&(g=this.rawValue(e)),void 0!==g&&(h+=g);return h},n.prototype.renderSection=function(a,c,d,e){function f(a){return g.render(a,c,d)}var g=this,h="",i=c.lookup(a[1]);if(i){if(p(i))for(var j=0,k=i.length;j<k;++j)h+=this.renderTokens(a[4],c.push(i[j]),d,e);else if("object"==typeof i||"string"==typeof i||"number"==typeof i)h+=this.renderTokens(a[4],c.push(i),d,e);else if(b(i)){if("string"!=typeof e)throw new Error("Cannot use higher-order sections without the original template");i=i.call(c.view,e.slice(a[3],a[5]),f),null!=i&&(h+=i)}else h+=this.renderTokens(a[4],c,d,e);return h}},n.prototype.renderInverted=function(a,b,c,d){var e=b.lookup(a[1]);if(!e||p(e)&&0===e.length)return this.renderTokens(a[4],b,c,d)},n.prototype.renderPartial=function(a,c,d){if(d){var e=b(d)?d(a[1]):d[a[1]];return null!=e?this.renderTokens(this.parse(e),c,d,e):void 0}},n.prototype.unescapedValue=function(a,b){var c=b.lookup(a[1]);if(null!=c)return c},n.prototype.escapedValue=function(b,c){var d=c.lookup(b[1]);if(null!=d)return a.escape(d)},n.prototype.rawValue=function(a){return a[1]},a.name="mustache.js",a.version="2.2.1",a.tags=["{{","}}"];var y=new n;a.clearCache=function(){return y.clearCache()},a.parse=function(a,b){return y.parse(a,b)},a.render=function(a,b,d){if("string"!=typeof a)throw new TypeError('Invalid template! Template should be a "string" but "'+c(a)+'" was given as the first argument for mustache#render(template, view, partials)');return y.render(a,b,d)},a.to_html=function(c,d,e,f){var g=a.render(c,d,e);return b(f)?void f(g):g},a.escape=h,a.Scanner=l,a.Context=m,a.Writer=n}),function(a,b){"object"==typeof exports?module.exports=b(a):"function"==typeof define&&define.amd?define("colors",[],function(){return b(a)}):a.Colors=b(a)}(this,function(a,b){"use strict";function c(a,c,d,f,g){if("string"==typeof c){var c=v.txt2color(c);d=c.type,p[d]=c[d],g=g!==b?g:c.alpha}else if(c)for(var h in c)a[d][h]=k(c[h]/l[d][h][1],0,1);return g!==b&&(a.alpha=k(+g,0,1)),e(d,f?a:b)}function d(a,b,c){var d=o.options.grey,e={};return e.RGB={r:a.r,g:a.g,b:a.b},e.rgb={r:b.r,g:b.g,b:b.b},e.alpha=c,e.equivalentGrey=n(d.r*a.r+d.g*a.g+d.b*a.b),e.rgbaMixBlack=i(b,{r:0,g:0,b:0},c,1),e.rgbaMixWhite=i(b,{r:1,g:1,b:1},c,1),e.rgbaMixBlack.luminance=h(e.rgbaMixBlack,!0),e.rgbaMixWhite.luminance=h(e.rgbaMixWhite,!0),o.options.customBG&&(e.rgbaMixCustom=i(b,o.options.customBG,c,1),e.rgbaMixCustom.luminance=h(e.rgbaMixCustom,!0),o.options.customBG.luminance=h(o.options.customBG,!0)),e}function e(a,b){var c,e,k,q=b||p,r=v,s=o.options,t=l,u=q.RND,w="",x="",y={hsl:"hsv",rgb:a},z=u.rgb;if("alpha"!==a){for(var A in t)if(!t[A][A]){a!==A&&(x=y[A]||"rgb",q[A]=r[x+"2"+A](q[x])),u[A]||(u[A]={}),c=q[A];for(w in c)u[A][w]=n(c[w]*t[A][w][1])}z=u.rgb,q.HEX=r.RGB2HEX(z),q.equivalentGrey=s.grey.r*q.rgb.r+s.grey.g*q.rgb.g+s.grey.b*q.rgb.b,q.webSave=e=f(z,51),q.webSmart=k=f(z,17),q.saveColor=z.r===e.r&&z.g===e.g&&z.b===e.b?"web save":z.r===k.r&&z.g===k.g&&z.b===k.b?"web smart":"",q.hueRGB=v.hue2RGB(q.hsv.h),b&&(q.background=d(z,q.rgb,q.alpha))}var B,C,D,E=q.rgb,F=q.alpha,G="luminance",H=q.background;return B=i(E,{r:0,g:0,b:0},F,1),B[G]=h(B,!0),q.rgbaMixBlack=B,C=i(E,{r:1,g:1,b:1},F,1),C[G]=h(C,!0),q.rgbaMixWhite=C,s.customBG&&(D=i(E,H.rgbaMixCustom,F,1),D[G]=h(D,!0),D.WCAG2Ratio=j(D[G],H.rgbaMixCustom[G]),q.rgbaMixBGMixCustom=D,D.luminanceDelta=m.abs(D[G]-H.rgbaMixCustom[G]),D.hueDelta=g(H.rgbaMixCustom,D,!0)),q.RGBLuminance=h(z),q.HUELuminance=h(q.hueRGB),s.convertCallback&&s.convertCallback(q,a),q}function f(a,b){var c={},d=0,e=b/2;for(var f in a)d=a[f]%b,c[f]=a[f]+(d>e?b-d:-d);return c}function g(a,b,c){return(m.max(a.r-b.r,b.r-a.r)+m.max(a.g-b.g,b.g-a.g)+m.max(a.b-b.b,b.b-a.b))*(c?255:1)/765}function h(a,b){for(var c=b?1:255,d=[a.r/c,a.g/c,a.b/c],e=o.options.luminance,f=d.length;f--;)d[f]=d[f]<=.03928?d[f]/12.92:m.pow((d[f]+.055)/1.055,2.4);return e.r*d[0]+e.g*d[1]+e.b*d[2]}function i(a,c,d,e){var f={},g=d!==b?d:1,h=e!==b?e:1,i=g+h*(1-g);for(var j in a)f[j]=(a[j]*g+c[j]*h*(1-g))/i;return f.a=i,f}function j(a,b){var c=1;return c=a>=b?(a+.05)/(b+.05):(b+.05)/(a+.05),n(100*c)/100}function k(a,b,c){return a>c?c:a<b?b:a}var l={rgb:{r:[0,255],g:[0,255],b:[0,255]},hsv:{h:[0,360],s:[0,100],v:[0,100]},hsl:{h:[0,360],s:[0,100],l:[0,100]},alpha:{alpha:[0,1]},HEX:{HEX:[0,16777215]}},m=a.Math,n=m.round,o={},p={},q={r:.298954,g:.586434,b:.114612},r={r:.2126,g:.7152,b:.0722},s=function(a){this.colors={RND:{}},this.options={color:"rgba(0,0,0,0)",grey:q,luminance:r,valueRanges:l},t(this,a||{})},t=function(a,d){var e,f=a.options;u(a);for(var g in d)d[g]!==b&&(f[g]=d[g]);e=f.customBG,f.customBG="string"==typeof e?v.txt2color(e).rgb:e,p=c(a.colors,f.color,b,!0)},u=function(a){o!==a&&(o=a,p=a.colors)};s.prototype.setColor=function(a,d,f){return u(this),a?c(this.colors,a,d,b,f):(f!==b&&(this.colors.alpha=k(f,0,1)),e(d))},s.prototype.setCustomBackground=function(a){return u(this),this.options.customBG="string"==typeof a?v.txt2color(a).rgb:a,c(this.colors,b,"rgb")},s.prototype.saveAsBackground=function(){return u(this),c(this.colors,b,"rgb",!0)},s.prototype.toString=function(a,b){return v.color2text((a||"rgb").toLowerCase(),this.colors,b)};var v={txt2color:function(a){var b={},c=a.replace(/(?:#|\)|%)/g,"").split("("),d=(c[1]||"").split(/,\s*/),e=c[1]?c[0].substr(0,3):"rgb",f="";if(b.type=e,b[e]={},c[1])for(var g=3;g--;)f=e[g]||e.charAt(g),b[e][f]=+d[g]/l[e][f][1];else b.rgb=v.HEX2rgb(c[0]);return b.alpha=d[3]?+d[3]:1,b},color2text:function(a,b,c){var d=c!==!1&&n(100*b.alpha)/100,e="number"==typeof d&&c!==!1&&(c||1!==d),f=b.RND.rgb,g=b.RND.hsl,h="hex"===a&&e,i="hex"===a&&!h,j="rgb"===a||h,k=j?f.r+", "+f.g+", "+f.b:i?"#"+b.HEX:g.h+", "+g.s+"%, "+g.l+"%";return i?k:(h?"rgb":a)+(e?"a":"")+"("+k+(e?", "+d:"")+")"},RGB2HEX:function(a){return((a.r<16?"0":"")+a.r.toString(16)+(a.g<16?"0":"")+a.g.toString(16)+(a.b<16?"0":"")+a.b.toString(16)).toUpperCase()},HEX2rgb:function(a){return a=a.split(""),{r:+("0x"+a[0]+a[a[3]?1:0])/255,g:+("0x"+a[a[3]?2:1]+(a[3]||a[1]))/255,b:+("0x"+(a[4]||a[2])+(a[5]||a[2]))/255}},hue2RGB:function(a){var b=6*a,c=~~b%6,d=6===b?0:b-c;return{r:n(255*[1,1-d,0,0,d,1][c]),g:n(255*[d,1,1,1-d,0,0][c]),b:n(255*[0,0,d,1,1,1-d][c])}},rgb2hsv:function(a){var b,c,d,e=a.r,f=a.g,g=a.b,h=0;return f<g&&(f=g+(g=f,0),h=-1),c=g,e<f&&(e=f+(f=e,0),h=-2/6-h,c=m.min(f,g)),b=e-c,d=e?b/e:0,{h:d<1e-15?p&&p.hsl&&p.hsl.h||0:b?m.abs(h+(f-g)/(6*b)):0,s:e?b/e:p&&p.hsv&&p.hsv.s||0,v:e}},hsv2rgb:function(a){var b=6*a.h,c=a.s,d=a.v,e=~~b,f=b-e,g=d*(1-c),h=d*(1-f*c),i=d*(1-(1-f)*c),j=e%6;return{r:[d,h,g,g,i,d][j],g:[i,d,d,h,g,g][j],b:[g,g,i,d,d,h][j]}},hsv2hsl:function(a){var b=(2-a.s)*a.v,c=a.s*a.v;return c=a.s?b<1?b?c/b:0:c/(2-b):0,{h:a.h,s:a.v||c?c:p&&p.hsl&&p.hsl.s||0,l:b/2}},rgb2hsl:function(a,b){var c=v.rgb2hsv(a);return v.hsv2hsl(b?c:p.hsv=c)},hsl2rgb:function(a){var b=6*a.h,c=a.s,d=a.l,e=d<.5?d*(1+c):d+c-c*d,f=d+d-e,g=e?(e-f)/e:0,h=~~b,i=b-h,j=e*g*i,k=f+j,l=e-j,m=h%6;return{r:[e,l,f,f,k,e][m],g:[k,e,e,l,f,f][m],b:[f,f,k,e,e,l][m]}}};return s}),function(a,b){"object"==typeof exports?module.exports=b(a,require("jquery"),require("colors")):"function"==typeof define&&define.amd?define(["jquery","colors"],function(c,d){return b(a,c,d)}):b(a,a.jQuery,a.Colors)}(this,function(a,b,c,d){"use strict";function e(a){return a.value||a.getAttribute("value")||b(a).css("background-color")||"#FFF"}function f(a){return a=a.originalEvent&&a.originalEvent.touches?a.originalEvent.touches[0]:a,a.originalEvent?a.originalEvent:a}function g(a){return b(a.find(r.doRender)[0]||a[0])}function h(c){var d=b(this),f=d.offset(),h=b(a),k=r.gap;c?(s=g(d),s._colorMode=s.data("colorMode"),p.$trigger=d,(t||i()).css(r.positionCallback.call(p,d)||{left:(t._left=f.left)-((t._left+=t._width-(h.scrollLeft()+h.width()))+k>0?t._left+k:0),top:(t._top=f.top+d.outerHeight())-((t._top+=t._height-(h.scrollTop()+h.height()))+k>0?t._top+k:0)}).show(r.animationSpeed,function(){c!==!0&&(y.toggle(!!r.opacity)._width=y.width(),v._width=v.width(),v._height=v.height(),u._height=u.height(),q.setColor(e(s[0])),n(!0))}).off(".tcp").on(D,".cp-xy-slider,.cp-z-slider,.cp-alpha",j)):p.$trigger&&b(t).hide(r.animationSpeed,function(){n(!1),p.$trigger=null}).off(".tcp")}function i(){return b("head")[r.cssPrepend?"prepend":"append"]('<style type="text/css" id="tinyColorPickerStyles">'+(r.css||I)+(r.cssAddon||"")+"</style>"),b(H).css({margin:r.margin}).appendTo("body").show(0,function(){p.$UI=t=b(this),F=r.GPU&&t.css("perspective")!==d,u=b(".cp-z-slider",this),v=b(".cp-xy-slider",this),w=b(".cp-xy-cursor",this),x=b(".cp-z-cursor",this),y=b(".cp-alpha",this),z=b(".cp-alpha-cursor",this),r.buildCallback.call(p,t),t.prepend("<div>").children().eq(0).css("width",t.children().eq(0).width()),t._width=this.offsetWidth,t._height=this.offsetHeight}).hide()}function j(a){var c=this.className.replace(/cp-(.*?)(?:\s*|$)/,"$1").replace("-","_");(a.button||a.which)>1||(a.preventDefault&&a.preventDefault(),a.returnValue=!1,s._offset=b(this).offset(),(c="xy_slider"===c?k:"z_slider"===c?l:m)(a),n(),A.on(E,function(a){A.off(".tcp")}).on(C,function(a){c(a),n()}))}function k(a){var b=f(a),c=b.pageX-s._offset.left,d=b.pageY-s._offset.top;q.setColor({s:c/v._width*100,v:100-d/v._height*100},"hsv")}function l(a){var b=f(a).pageY-s._offset.top;q.setColor({h:360-b/u._height*360},"hsv")}function m(a){var b=f(a).pageX-s._offset.left,c=b/y._width;q.setColor({},"rgb",c)}function n(a){var b=q.colors,c=b.hueRGB,e=(b.RND.rgb,b.RND.hsl,r.dark),f=r.light,g=q.toString(s._colorMode,r.forceAlpha),h=b.HUELuminance>.22?e:f,i=b.rgbaMixBlack.luminance>.22?e:f,j=(1-b.hsv.h)*u._height,k=b.hsv.s*v._width,l=(1-b.hsv.v)*v._height,m=b.alpha*y._width,n=F?"translate3d":"",p=s[0].value,t=s[0].hasAttribute("value")&&""===p&&a!==d;v._css={backgroundColor:"rgb("+c.r+","+c.g+","+c.b+")"},w._css={transform:n+"("+k+"px, "+l+"px, 0)",left:F?"":k,top:F?"":l,borderColor:b.RGBLuminance>.22?e:f},x._css={transform:n+"(0, "+j+"px, 0)",top:F?"":j,borderColor:"transparent "+h},y._css={backgroundColor:"#"+b.HEX},z._css={transform:n+"("+m+"px, 0, 0)",left:F?"":m,borderColor:i+" transparent"},s._css={backgroundColor:t?"":g,color:t?"":b.rgbaMixBGMixCustom.luminance>.22?e:f},s.text=t?"":p!==g?g:"",a!==d?o(a):G(o)}function o(a){v.css(v._css),w.css(w._css),x.css(x._css),y.css(y._css),z.css(z._css),r.doRender&&s.css(s._css),s.text&&s.val(s.text),r.renderCallback.call(p,s,"boolean"==typeof a?a:d)}var p,q,r,s,t,u,v,w,x,y,z,A=b(document),B=b(),C="touchmove.tcp mousemove.tcp pointermove.tcp",D="touchstart.tcp mousedown.tcp pointerdown.tcp",E="touchend.tcp mouseup.tcp pointerup.tcp",F=!1,G=a.requestAnimationFrame||a.webkitRequestAnimationFrame||function(a){a()},H='<div class="cp-color-picker"><div class="cp-z-slider"><div class="cp-z-cursor"></div></div><div class="cp-xy-slider"><div class="cp-white"></div><div class="cp-xy-cursor"></div></div><div class="cp-alpha"><div class="cp-alpha-cursor"></div></div></div>',I=".cp-color-picker{position:absolute;overflow:hidden;padding:6px 6px 0;background-color:#444;color:#bbb;font-family:Arial,Helvetica,sans-serif;font-size:12px;font-weight:400;cursor:default;border-radius:5px}.cp-color-picker>div{position:relative;overflow:hidden}.cp-xy-slider{float:left;height:128px;width:128px;margin-bottom:6px;background:linear-gradient(to right,#FFF,rgba(255,255,255,0))}.cp-white{height:100%;width:100%;background:linear-gradient(rgba(0,0,0,0),#000)}.cp-xy-cursor{position:absolute;top:0;width:10px;height:10px;margin:-5px;border:1px solid #fff;border-radius:100%;box-sizing:border-box}.cp-z-slider{float:right;margin-left:6px;height:128px;width:20px;background:linear-gradient(red 0,#f0f 17%,#00f 33%,#0ff 50%,#0f0 67%,#ff0 83%,red 100%)}.cp-z-cursor{position:absolute;margin-top:-4px;width:100%;border:4px solid #fff;border-color:transparent #fff;box-sizing:border-box}.cp-alpha{clear:both;width:100%;height:16px;margin:6px 0;background:linear-gradient(to right,#444,rgba(0,0,0,0))}.cp-alpha-cursor{position:absolute;margin-left:-4px;height:100%;border:4px solid #fff;border-color:#fff transparent;box-sizing:border-box}",J=function(a){q=this.color=new c(a),r=q.options,p=this};J.prototype={render:n,toggle:h},b.fn.colorPicker=function(c){var d=this,f=function(){};return c=b.extend({animationSpeed:150,GPU:!0,doRender:!0,customBG:"#FFF",opacity:!0,renderCallback:f,buildCallback:f,positionCallback:f,body:document.body,scrollResize:!0,gap:4,dark:"#222",light:"#DDD"},c),!p&&c.scrollResize&&b(a).on("resize.tcp scroll.tcp",function(){p.$trigger&&p.toggle.call(p.$trigger[0],!0)}),B=B.add(this),this.colorPicker=p||new J(c),this.options=c,b(c.body).off(".tcp").on(D,function(a){B.add(t).add(b(t).find(a.target)).index(a.target)===-1&&h()}),this.on("focusin.tcp click.tcp",function(a){p.color.options=b.extend(p.color.options,r=d.options),h.call(this,a)}).on("change.tcp",function(){q.setColor(this.value||"#FFF"),d.colorPicker.render(!0)}).each(function(){var a=e(this),d=a.split("("),f=g(b(this));f.data("colorMode",d[1]?d[0].substr(0,3):"HEX").attr("readonly",r.preventFocus),c.doRender&&f.css({"background-color":a,color:function(){return q.setColor(a).rgbaMixBGMixCustom.luminance>.22?c.dark:c.light}})})},b.fn.colorPicker.destroy=function(){b("*").off(".tcp"),p.toggle(!1),B=b()}}),function(a){a.fn.customScrollbar=function(b,c){var d={skin:void 0,hScroll:!0,vScroll:!0,updateOnWindowResize:!1,animationSpeed:300,onCustomScroll:void 0,swipeSpeed:1,wheelSpeed:40,fixedThumbWidth:void 0,fixedThumbHeight:void 0,preventDefaultScroll:!1},e=function(b,c){this.$element=a(b),this.options=c,this.addScrollableClass(),this.addSkinClass(),this.addScrollBarComponents(),this.options.vScroll&&(this.vScrollbar=new f(this,new h)),this.options.hScroll&&(this.hScrollbar=new f(this,new g)),this.$element.data("scrollable",this),this.initKeyboardScrolling(),this.bindEvents()};e.prototype={addScrollableClass:function(){this.$element.hasClass("scrollable")||(this.scrollableAdded=!0,this.$element.addClass("scrollable"))},removeScrollableClass:function(){this.scrollableAdded&&this.$element.removeClass("scrollable")},addSkinClass:function(){"string"!=typeof this.options.skin||this.$element.hasClass(this.options.skin)||(this.skinClassAdded=!0,this.$element.addClass(this.options.skin))},removeSkinClass:function(){this.skinClassAdded&&this.$element.removeClass(this.options.skin)},addScrollBarComponents:function(){this.assignViewPort(),0==this.$viewPort.length&&(this.$element.wrapInner('<div class="viewport" />'),this.assignViewPort(),this.viewPortAdded=!0),this.assignOverview(),0==this.$overview.length&&(this.$viewPort.wrapInner('<div class="overview" />'),this.assignOverview(),this.overviewAdded=!0),this.addScrollBar("vertical","prepend"),this.addScrollBar("horizontal","append")},removeScrollbarComponents:function(){this.removeScrollbar("vertical"),this.removeScrollbar("horizontal"),this.overviewAdded&&this.$element.unwrap(),this.viewPortAdded&&this.$element.unwrap()},removeScrollbar:function(a){this[a+"ScrollbarAdded"]&&this.$element.find(".scroll-bar."+a).remove()},assignViewPort:function(){this.$viewPort=this.$element.find(".viewport")},assignOverview:function(){this.$overview=this.$viewPort.find(".overview")},addScrollBar:function(a,b){0==this.$element.find(".scroll-bar."+a).length&&(this.$element[b]("<div class='scroll-bar "+a+"'><div class='thumb'></div></div>"),this[a+"ScrollbarAdded"]=!0)},resize:function(a){this.vScrollbar&&this.vScrollbar.resize(a),this.hScrollbar&&this.hScrollbar.resize(a)},scrollTo:function(a){this.vScrollbar&&this.vScrollbar.scrollToElement(a),this.hScrollbar&&this.hScrollbar.scrollToElement(a)},scrollToXY:function(a,b){this.scrollToX(a),this.scrollToY(b)},scrollToX:function(a){this.hScrollbar&&this.hScrollbar.scrollOverviewTo(a,!0)},scrollToY:function(a){this.vScrollbar&&this.vScrollbar.scrollOverviewTo(a,!0)},scrollByX:function(a){this.hScrollbar&&this.scrollToX(this.hScrollbar.overviewPosition()+a)},scrollByY:function(a){this.vScrollbar&&this.scrollToY(this.vScrollbar.overviewPosition()+a)},remove:function(){this.removeScrollableClass(),this.removeSkinClass(),this.removeScrollbarComponents(),this.$element.data("scrollable",null),this.removeKeyboardScrolling(),this.vScrollbar&&this.vScrollbar.remove(),this.hScrollbar&&this.hScrollbar.remove()},setAnimationSpeed:function(a){this.options.animationSpeed=a},isInside:function(b,c){var d=a(b),e=a(c),f=d.offset(),g=e.offset();return f.top>=g.top&&f.left>=g.left&&f.top+d.height()<=g.top+e.height()&&f.left+d.width()<=g.left+e.width()},initKeyboardScrolling:function(){var a=this;this.elementKeydown=function(b){document.activeElement===a.$element[0]&&(a.vScrollbar&&a.vScrollbar.keyScroll(b),a.hScrollbar&&a.hScrollbar.keyScroll(b))},this.$element.attr("tabindex","-1").keydown(this.elementKeydown)},removeKeyboardScrolling:function(){this.$element.removeAttr("tabindex").unbind("keydown",this.elementKeydown)},bindEvents:function(){this.options.onCustomScroll&&this.$element.on("customScroll",this.options.onCustomScroll)}};var f=function(a,b){this.scrollable=a,this.sizing=b,this.$scrollBar=this.sizing.scrollBar(this.scrollable.$element),this.$thumb=this.$scrollBar.find(".thumb"),this.setScrollPosition(0,0),this.resize(),this.initMouseMoveScrolling(),this.initMouseWheelScrolling(),this.initTouchScrolling(),this.initMouseClickScrolling(),this.initWindowResize()};f.prototype={resize:function(a){this.overviewSize=this.sizing.size(this.scrollable.$overview),this.calculateViewPortSize(),this.sizing.size(this.scrollable.$viewPort,this.viewPortSize),this.ratio=this.viewPortSize/this.overviewSize,this.sizing.size(this.$scrollBar,this.viewPortSize),this.thumbSize=this.calculateThumbSize(),this.sizing.size(this.$thumb,this.thumbSize),this.maxThumbPosition=this.calculateMaxThumbPosition(),this.maxOverviewPosition=this.calculateMaxOverviewPosition(),this.enabled=this.overviewSize>this.viewPortSize,void 0===this.scrollPercent&&(this.scrollPercent=0),this.enabled?this.rescroll(a):this.setScrollPosition(0,0),this.$scrollBar.toggle(this.enabled)},calculateViewPortSize:function(){var a=this.sizing.size(this.scrollable.$element);if(a>0&&!this.maxSizeUsed)this.viewPortSize=a,this.maxSizeUsed=!1;else{var b=this.sizing.maxSize(this.scrollable.$element);this.viewPortSize=Math.min(b,this.overviewSize),this.maxSizeUsed=!0}},calculateThumbSize:function(){var a,b=this.sizing.fixedThumbSize(this.scrollable.options);return a=b?b:this.ratio*this.viewPortSize,Math.max(a,this.sizing.minSize(this.$thumb))},initMouseMoveScrolling:function(){var b=this;this.$thumb.mousedown(function(a){b.enabled&&b.startMouseMoveScrolling(a)}),this.documentMouseup=function(a){b.stopMouseMoveScrolling(a)},a(document).mouseup(this.documentMouseup),this.documentMousemove=function(a){b.mouseMoveScroll(a)},a(document).mousemove(this.documentMousemove),this.$thumb.click(function(a){a.stopPropagation()})},removeMouseMoveScrolling:function(){this.$thumb.unbind(),a(document).unbind("mouseup",this.documentMouseup),a(document).unbind("mousemove",this.documentMousemove)},initMouseWheelScrolling:function(){var a=this;this.scrollable.$element.mousewheel(function(b,c,d,e){if(a.enabled){var f=a.mouseWheelScroll(d,e);a.stopEventConditionally(b,f)}})},removeMouseWheelScrolling:function(){this.scrollable.$element.unbind("mousewheel")},initTouchScrolling:function(){if(document.addEventListener){var a=this;this.elementTouchstart=function(b){a.enabled&&a.startTouchScrolling(b)},this.scrollable.$element[0].addEventListener("touchstart",this.elementTouchstart),this.documentTouchmove=function(b){a.touchScroll(b)},this.scrollable.$element[0].addEventListener("touchmove",this.documentTouchmove),this.elementTouchend=function(b){a.stopTouchScrolling(b)},this.scrollable.$element[0].addEventListener("touchend",this.elementTouchend)}},removeTouchScrolling:function(){document.addEventListener&&(this.scrollable.$element[0].removeEventListener("touchstart",this.elementTouchstart),document.removeEventListener("touchmove",this.documentTouchmove),this.scrollable.$element[0].removeEventListener("touchend",this.elementTouchend))},initMouseClickScrolling:function(){var a=this;this.scrollBarClick=function(b){a.mouseClickScroll(b)},this.$scrollBar.click(this.scrollBarClick)},removeMouseClickScrolling:function(){this.$scrollBar.unbind("click",this.scrollBarClick)},initWindowResize:function(){if(this.scrollable.options.updateOnWindowResize){var b=this;this.windowResize=function(){b.resize()},a(window).resize(this.windowResize)}},removeWindowResize:function(){a(window).unbind("resize",this.windowResize)},isKeyScrolling:function(a){return null!=this.keyScrollDelta(a)},keyScrollDelta:function(a){for(var b in this.sizing.scrollingKeys)if(b==a)return this.sizing.scrollingKeys[a](this.viewPortSize);return null},startMouseMoveScrolling:function(b){this.mouseMoveScrolling=!0,a("body").addClass("not-selectable"),this.setUnselectable(a("body"),"on"),this.setScrollEvent(b),b.preventDefault()},stopMouseMoveScrolling:function(b){this.mouseMoveScrolling=!1,setTimeout(function(){a("body").removeClass("not-selectable")}),this.setUnselectable(a("body"),null)},setUnselectable:function(a,b){a.attr("unselectable")!=b&&(a.attr("unselectable",b),a.find(":not(input)").attr("unselectable",b))},mouseMoveScroll:function(a){if(this.mouseMoveScrolling){var b=this.sizing.mouseDelta(this.scrollEvent,a);this.scrollThumbBy(b),this.setScrollEvent(a)}},startTouchScrolling:function(a){a.touches&&1==a.touches.length&&(this.setScrollEvent(a.touches[0]),this.touchScrolling=!0,a.stopPropagation())},touchScroll:function(a){if(this.touchScrolling&&a.touches&&1==a.touches.length){var b=-this.sizing.mouseDelta(this.scrollEvent,a.touches[0])*this.scrollable.options.swipeSpeed,c=this.scrollOverviewBy(b);c&&this.setScrollEvent(a.touches[0]),this.stopEventConditionally(a,c)}},stopTouchScrolling:function(a){this.touchScrolling=!1,a.stopPropagation()},mouseWheelScroll:function(a,b){var c=-this.sizing.wheelDelta(a,b)*this.scrollable.options.wheelSpeed;if(0!=c)return this.scrollOverviewBy(c)},mouseClickScroll:function(a){var b=this.viewPortSize-20;a["page"+this.sizing.scrollAxis()]<this.$thumb.offset()[this.sizing.offsetComponent()]&&(b=-b),this.scrollOverviewBy(b)},keyScroll:function(a){var b=a.which;if(this.enabled&&this.isKeyScrolling(b)){var c=this.scrollOverviewBy(this.keyScrollDelta(b));this.stopEventConditionally(a,c)}},scrollThumbBy:function(a){var b=this.thumbPosition();b+=a,b=this.positionOrMax(b,this.maxThumbPosition);var c=this.scrollPercent;if(this.scrollPercent=b/this.maxThumbPosition,c!=this.scrollPercent){var d=b*this.maxOverviewPosition/this.maxThumbPosition;return this.setScrollPosition(d,b),this.triggerCustomScroll(c),!0}return!1},thumbPosition:function(){return this.$thumb.position()[this.sizing.offsetComponent()]},scrollOverviewBy:function(a){var b=this.overviewPosition()+a;return this.scrollOverviewTo(b,!1)},overviewPosition:function(){return-this.scrollable.$overview.position()[this.sizing.offsetComponent()]},scrollOverviewTo:function(a,b){a=this.positionOrMax(a,this.maxOverviewPosition);var c=this.scrollPercent;if(this.scrollPercent=a/this.maxOverviewPosition,c!=this.scrollPercent){var d=this.scrollPercent*this.maxThumbPosition;return b?this.setScrollPositionWithAnimation(a,d):this.setScrollPosition(a,d),this.triggerCustomScroll(c),!0}return!1},positionOrMax:function(a,b){return a<0?0:a>b?b:a},triggerCustomScroll:function(a){this.scrollable.$element.trigger("customScroll",{scrollAxis:this.sizing.scrollAxis(),direction:this.sizing.scrollDirection(a,this.scrollPercent),scrollPercent:100*this.scrollPercent})},rescroll:function(a){if(a){var b=this.positionOrMax(this.overviewPosition(),this.maxOverviewPosition);this.scrollPercent=b/this.maxOverviewPosition;var c=this.scrollPercent*this.maxThumbPosition;this.setScrollPosition(b,c)}else{var c=this.scrollPercent*this.maxThumbPosition,b=this.scrollPercent*this.maxOverviewPosition;this.setScrollPosition(b,c)}},setScrollPosition:function(a,b){this.$thumb.css(this.sizing.offsetComponent(),b+"px"),this.scrollable.$overview.css(this.sizing.offsetComponent(),-a+"px")},setScrollPositionWithAnimation:function(a,b){var c={},d={};c[this.sizing.offsetComponent()]=b+"px",this.$thumb.animate(c,this.scrollable.options.animationSpeed),d[this.sizing.offsetComponent()]=-a+"px",this.scrollable.$overview.animate(d,this.scrollable.options.animationSpeed)},calculateMaxThumbPosition:function(){return Math.max(0,this.sizing.size(this.$scrollBar)-this.thumbSize)},calculateMaxOverviewPosition:function(){return Math.max(0,this.sizing.size(this.scrollable.$overview)-this.sizing.size(this.scrollable.$viewPort))},setScrollEvent:function(a){var b="page"+this.sizing.scrollAxis();this.scrollEvent&&this.scrollEvent[b]==a[b]||(this.scrollEvent={pageX:a.pageX,pageY:a.pageY})},scrollToElement:function(b){var c=a(b);if(this.sizing.isInside(c,this.scrollable.$overview)&&!this.sizing.isInside(c,this.scrollable.$viewPort)){var d=c.offset(),e=this.scrollable.$overview.offset();this.scrollable.$viewPort.offset();this.scrollOverviewTo(d[this.sizing.offsetComponent()]-e[this.sizing.offsetComponent()],!0)}},remove:function(){this.removeMouseMoveScrolling(),this.removeMouseWheelScrolling(),this.removeTouchScrolling(),this.removeMouseClickScrolling(),this.removeWindowResize()},stopEventConditionally:function(a,b){(b||this.scrollable.options.preventDefaultScroll)&&(a.preventDefault(),a.stopPropagation())}};var g=function(){};g.prototype={size:function(a,b){return b?a.width(b):a.width()},minSize:function(a){return parseInt(a.css("min-width"))||0},maxSize:function(a){return parseInt(a.css("max-width"))||0},fixedThumbSize:function(a){return a.fixedThumbWidth},scrollBar:function(a){return a.find(".scroll-bar.horizontal")},mouseDelta:function(a,b){return b.pageX-a.pageX},offsetComponent:function(){return"left"},wheelDelta:function(a,b){return a},scrollAxis:function(){return"X"},scrollDirection:function(a,b){return a<b?"right":"left"},scrollingKeys:{37:function(a){return-10},39:function(a){return 10}},isInside:function(b,c){var d=a(b),e=a(c),f=d.offset(),g=e.offset();return f.left>=g.left&&f.left+d.width()<=g.left+e.width()}};var h=function(){};return h.prototype={size:function(a,b){return b?a.height(b):a.height()},minSize:function(a){return parseInt(a.css("min-height"))||0},maxSize:function(a){return parseInt(a.css("max-height"))||0},fixedThumbSize:function(a){return a.fixedThumbHeight},scrollBar:function(a){return a.find(".scroll-bar.vertical")},mouseDelta:function(a,b){return b.pageY-a.pageY},offsetComponent:function(){return"top"},wheelDelta:function(a,b){return b},scrollAxis:function(){return"Y"},scrollDirection:function(a,b){return a<b?"down":"up"},scrollingKeys:{38:function(a){return-10},40:function(a){return 10},33:function(a){return-(a-20)},34:function(a){return a-20}},isInside:function(b,c){var d=a(b),e=a(c),f=d.offset(),g=e.offset();return f.top>=g.top&&f.top+d.height()<=g.top+e.height()}},this.each(function(){if(void 0==b&&(b=d),"string"==typeof b){var f=a(this).data("scrollable");f&&f[b](c)}else{if("object"!=typeof b)throw"Invalid type of options";b=a.extend(d,b),new e(a(this),b)}})}}(jQuery),function(a){function b(b){var c=b||window.event,d=[].slice.call(arguments,1),e=0,f=0,g=0;return b=a.event.fix(c),b.type="mousewheel",c.wheelDelta&&(e=c.wheelDelta/120),c.detail&&(e=-c.detail/3),g=e,void 0!==c.axis&&c.axis===c.HORIZONTAL_AXIS&&(g=0,f=e),void 0!==c.wheelDeltaY&&(g=c.wheelDeltaY/120),void 0!==c.wheelDeltaX&&(f=c.wheelDeltaX/120),d.unshift(b,e,f,g),(a.event.dispatch||a.event.handle).apply(this,d)}var c=["DOMMouseScroll","mousewheel"];if(a.event.fixHooks)for(var d=c.length;d;)a.event.fixHooks[c[--d]]=a.event.mouseHooks;a.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=c.length;a;)this.addEventListener(c[--a],b,!1);else this.onmousewheel=b},teardown:function(){if(this.removeEventListener)for(var a=c.length;a;)this.removeEventListener(c[--a],b,!1);else this.onmousewheel=null}},a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})}(jQuery);
(function(D){'use strict';function qe(a){if(G(a))u(a.objectMaxDepth)&&(Wb.objectMaxDepth=Xb(a.objectMaxDepth)?a.objectMaxDepth:NaN),u(a.urlErrorParamsEnabled)&&Ga(a.urlErrorParamsEnabled)&&(Wb.urlErrorParamsEnabled=a.urlErrorParamsEnabled);else return Wb}function Xb(a){return aa(a)&&0<a}function L(a,b){b=b||Error;return function(){var d=arguments[0],c;c="["+(a?a+":":"")+d+"] http://errors.angularjs.org/1.7.2/"+(a?a+"/":"")+d;for(d=1;d<arguments.length;d++){c=c+(1==d?"?":"&")+"p"+(d-1)+"=";var e=encodeURIComponent,
f;f=arguments[d];f="function"==typeof f?f.toString().replace(/ \{[\s\S]*$/,""):"undefined"==typeof f?"undefined":"string"!=typeof f?JSON.stringify(f):f;c+=e(f)}return new b(c)}}function ra(a){if(null==a||ab(a))return!1;if(F(a)||B(a)||y&&a instanceof y)return!0;var b="length"in Object(a)&&a.length;return aa(b)&&(0<=b&&b-1 in a||"function"===typeof a.item)}function q(a,b,d){var c,e;if(a)if(z(a))for(c in a)"prototype"!==c&&"length"!==c&&"name"!==c&&a.hasOwnProperty(c)&&b.call(d,a[c],c,a);else if(F(a)||
ra(a)){var f="object"!==typeof a;c=0;for(e=a.length;c<e;c++)(f||c in a)&&b.call(d,a[c],c,a)}else if(a.forEach&&a.forEach!==q)a.forEach(b,d,a);else if(Oc(a))for(c in a)b.call(d,a[c],c,a);else if("function"===typeof a.hasOwnProperty)for(c in a)a.hasOwnProperty(c)&&b.call(d,a[c],c,a);else for(c in a)sa.call(a,c)&&b.call(d,a[c],c,a);return a}function Pc(a,b,d){for(var c=Object.keys(a).sort(),e=0;e<c.length;e++)b.call(d,a[c[e]],c[e]);return c}function Yb(a){return function(b,d){a(d,b)}}function re(){return++rb}
function Zb(a,b,d){for(var c=a.$$hashKey,e=0,f=b.length;e<f;++e){var g=b[e];if(G(g)||z(g))for(var k=Object.keys(g),h=0,l=k.length;h<l;h++){var m=k[h],p=g[m];d&&G(p)?$(p)?a[m]=new Date(p.valueOf()):bb(p)?a[m]=new RegExp(p):p.nodeName?a[m]=p.cloneNode(!0):$b(p)?a[m]=p.clone():(G(a[m])||(a[m]=F(p)?[]:{}),Zb(a[m],[p],!0)):a[m]=p}}c?a.$$hashKey=c:delete a.$$hashKey;return a}function P(a){return Zb(a,ya.call(arguments,1),!1)}function se(a){return Zb(a,ya.call(arguments,1),!0)}function ea(a){return parseInt(a,
10)}function ac(a,b){return P(Object.create(a),b)}function x(){}function Qa(a){return a}function ia(a){return function(){return a}}function bc(a){return z(a.toString)&&a.toString!==ga}function v(a){return"undefined"===typeof a}function u(a){return"undefined"!==typeof a}function G(a){return null!==a&&"object"===typeof a}function Oc(a){return null!==a&&"object"===typeof a&&!Qc(a)}function B(a){return"string"===typeof a}function aa(a){return"number"===typeof a}function $(a){return"[object Date]"===ga.call(a)}
function F(a){return Array.isArray(a)||a instanceof Array}function cc(a){switch(ga.call(a)){case "[object Error]":return!0;case "[object Exception]":return!0;case "[object DOMException]":return!0;default:return a instanceof Error}}function z(a){return"function"===typeof a}function bb(a){return"[object RegExp]"===ga.call(a)}function ab(a){return a&&a.window===a}function cb(a){return a&&a.$evalAsync&&a.$watch}function Ga(a){return"boolean"===typeof a}function te(a){return a&&aa(a.length)&&ue.test(ga.call(a))}
function $b(a){return!(!a||!(a.nodeName||a.prop&&a.attr&&a.find))}function ve(a){var b={};a=a.split(",");var d;for(d=0;d<a.length;d++)b[a[d]]=!0;return b}function ta(a){return O(a.nodeName||a[0]&&a[0].nodeName)}function db(a,b){var d=a.indexOf(b);0<=d&&a.splice(d,1);return d}function za(a,b,d){function c(a,b,c){c--;if(0>c)return"...";var d=b.$$hashKey,f;if(F(a)){f=0;for(var g=a.length;f<g;f++)b.push(e(a[f],c))}else if(Oc(a))for(f in a)b[f]=e(a[f],c);else if(a&&"function"===typeof a.hasOwnProperty)for(f in a)a.hasOwnProperty(f)&&
(b[f]=e(a[f],c));else for(f in a)sa.call(a,f)&&(b[f]=e(a[f],c));d?b.$$hashKey=d:delete b.$$hashKey;return b}function e(a,b){if(!G(a))return a;var d=g.indexOf(a);if(-1!==d)return k[d];if(ab(a)||cb(a))throw Ha("cpws");var d=!1,e=f(a);void 0===e&&(e=F(a)?[]:Object.create(Qc(a)),d=!0);g.push(a);k.push(e);return d?c(a,e,b):e}function f(a){switch(ga.call(a)){case "[object Int8Array]":case "[object Int16Array]":case "[object Int32Array]":case "[object Float32Array]":case "[object Float64Array]":case "[object Uint8Array]":case "[object Uint8ClampedArray]":case "[object Uint16Array]":case "[object Uint32Array]":return new a.constructor(e(a.buffer),
a.byteOffset,a.length);case "[object ArrayBuffer]":if(!a.slice){var b=new ArrayBuffer(a.byteLength);(new Uint8Array(b)).set(new Uint8Array(a));return b}return a.slice(0);case "[object Boolean]":case "[object Number]":case "[object String]":case "[object Date]":return new a.constructor(a.valueOf());case "[object RegExp]":return b=new RegExp(a.source,a.toString().match(/[^/]*$/)[0]),b.lastIndex=a.lastIndex,b;case "[object Blob]":return new a.constructor([a],{type:a.type})}if(z(a.cloneNode))return a.cloneNode(!0)}
var g=[],k=[];d=Xb(d)?d:NaN;if(b){if(te(b)||"[object ArrayBuffer]"===ga.call(b))throw Ha("cpta");if(a===b)throw Ha("cpi");F(b)?b.length=0:q(b,function(a,c){"$$hashKey"!==c&&delete b[c]});g.push(a);k.push(b);return c(a,b,d)}return e(a,d)}function dc(a,b){return a===b||a!==a&&b!==b}function ua(a,b){if(a===b)return!0;if(null===a||null===b)return!1;if(a!==a&&b!==b)return!0;var d=typeof a,c;if(d===typeof b&&"object"===d)if(F(a)){if(!F(b))return!1;if((d=a.length)===b.length){for(c=0;c<d;c++)if(!ua(a[c],
b[c]))return!1;return!0}}else{if($(a))return $(b)?dc(a.getTime(),b.getTime()):!1;if(bb(a))return bb(b)?a.toString()===b.toString():!1;if(cb(a)||cb(b)||ab(a)||ab(b)||F(b)||$(b)||bb(b))return!1;d=U();for(c in a)if("$"!==c.charAt(0)&&!z(a[c])){if(!ua(a[c],b[c]))return!1;d[c]=!0}for(c in b)if(!(c in d)&&"$"!==c.charAt(0)&&u(b[c])&&!z(b[c]))return!1;return!0}return!1}function eb(a,b,d){return a.concat(ya.call(b,d))}function Ra(a,b){var d=2<arguments.length?ya.call(arguments,2):[];return!z(b)||b instanceof
RegExp?b:d.length?function(){return arguments.length?b.apply(a,eb(d,arguments,0)):b.apply(a,d)}:function(){return arguments.length?b.apply(a,arguments):b.call(a)}}function Rc(a,b){var d=b;"string"===typeof a&&"$"===a.charAt(0)&&"$"===a.charAt(1)?d=void 0:ab(b)?d="$WINDOW":b&&D.document===b?d="$DOCUMENT":cb(b)&&(d="$SCOPE");return d}function fb(a,b){if(!v(a))return aa(b)||(b=b?2:null),JSON.stringify(a,Rc,b)}function Sc(a){return B(a)?JSON.parse(a):a}function ec(a,b){a=a.replace(we,"");var d=Date.parse("Jan 01, 1970 00:00:00 "+
a)/6E4;return ha(d)?b:d}function Tc(a,b){a=new Date(a.getTime());a.setMinutes(a.getMinutes()+b);return a}function fc(a,b,d){d=d?-1:1;var c=a.getTimezoneOffset();b=ec(b,c);return Tc(a,d*(b-c))}function Aa(a){a=y(a).clone().empty();var b=y("<div></div>").append(a).html();try{return a[0].nodeType===Ma?O(b):b.match(/^(<[^>]+>)/)[1].replace(/^<([\w-]+)/,function(a,b){return"<"+O(b)})}catch(d){return O(b)}}function Uc(a){try{return decodeURIComponent(a)}catch(b){}}function gc(a){var b={};q((a||"").split("&"),
function(a){var c,e,f;a&&(e=a=a.replace(/\+/g,"%20"),c=a.indexOf("="),-1!==c&&(e=a.substring(0,c),f=a.substring(c+1)),e=Uc(e),u(e)&&(f=u(f)?Uc(f):!0,sa.call(b,e)?F(b[e])?b[e].push(f):b[e]=[b[e],f]:b[e]=f))});return b}function hc(a){var b=[];q(a,function(a,c){F(a)?q(a,function(a){b.push(ka(c,!0)+(!0===a?"":"="+ka(a,!0)))}):b.push(ka(c,!0)+(!0===a?"":"="+ka(a,!0)))});return b.length?b.join("&"):""}function gb(a){return ka(a,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function ka(a,
b){return encodeURIComponent(a).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%20/g,b?"%20":"+")}function xe(a,b){var d,c,e=Ia.length;for(c=0;c<e;++c)if(d=Ia[c]+b,B(d=a.getAttribute(d)))return d;return null}function ye(a,b){var d,c,e={};q(Ia,function(b){b+="app";!d&&a.hasAttribute&&a.hasAttribute(b)&&(d=a,c=a.getAttribute(b))});q(Ia,function(b){b+="app";var e;!d&&(e=a.querySelector("["+b.replace(":","\\:")+"]"))&&(d=e,c=e.getAttribute(b))});
d&&(ze?(e.strictDi=null!==xe(d,"strict-di"),b(d,c?[c]:[],e)):D.console.error("AngularJS: disabling automatic bootstrap. <script>protocol indicates an extension, document.location.href does not match."))}function Vc(a,b,d){G(d)||(d={});d=P({strictDi:!1},d);var c=function(){a=y(a);if(a.injector()){var c=a[0]===D.document?"document":Aa(a);throw Ha("btstrpd",c.replace(/</,"&lt;").replace(/>/,"&gt;"));}b=b||[];b.unshift(["$provide",function(b){b.value("$rootElement",a)}]);d.debugInfoEnabled&&b.push(["$compileProvider",
function(a){a.debugInfoEnabled(!0)}]);b.unshift("ng");c=hb(b,d.strictDi);c.invoke(["$rootScope","$rootElement","$compile","$injector",function(a,b,c,d){a.$apply(function(){b.data("$injector",d);c(b)(a)})}]);return c},e=/^NG_ENABLE_DEBUG_INFO!/,f=/^NG_DEFER_BOOTSTRAP!/;D&&e.test(D.name)&&(d.debugInfoEnabled=!0,D.name=D.name.replace(e,""));if(D&&!f.test(D.name))return c();D.name=D.name.replace(f,"");fa.resumeBootstrap=function(a){q(a,function(a){b.push(a)});return c()};z(fa.resumeDeferredBootstrap)&&
fa.resumeDeferredBootstrap()}function Ae(){D.name="NG_ENABLE_DEBUG_INFO!"+D.name;D.location.reload()}function Be(a){a=fa.element(a).injector();if(!a)throw Ha("test");return a.get("$$testability")}function Wc(a,b){b=b||"_";return a.replace(Ce,function(a,c){return(c?b:"")+a.toLowerCase()})}function De(){var a;if(!Xc){var b=sb();(tb=v(b)?D.jQuery:b?D[b]:void 0)&&tb.fn.on?(y=tb,P(tb.fn,{scope:Sa.scope,isolateScope:Sa.isolateScope,controller:Sa.controller,injector:Sa.injector,inheritedData:Sa.inheritedData})):
y=W;a=y.cleanData;y.cleanData=function(b){for(var c,e=0,f;null!=(f=b[e]);e++)(c=y._data(f).events)&&c.$destroy&&y(f).triggerHandler("$destroy");a(b)};fa.element=y;Xc=!0}}function ib(a,b,d){if(!a)throw Ha("areq",b||"?",d||"required");return a}function ub(a,b,d){d&&F(a)&&(a=a[a.length-1]);ib(z(a),b,"not a function, got "+(a&&"object"===typeof a?a.constructor.name||"Object":typeof a));return a}function Na(a,b){if("hasOwnProperty"===a)throw Ha("badname",b);}function Ee(a,b,d){if(!b)return a;b=b.split(".");
for(var c,e=a,f=b.length,g=0;g<f;g++)c=b[g],a&&(a=(e=a)[c]);return!d&&z(a)?Ra(e,a):a}function vb(a){for(var b=a[0],d=a[a.length-1],c,e=1;b!==d&&(b=b.nextSibling);e++)if(c||a[e]!==b)c||(c=y(ya.call(a,0,e))),c.push(b);return c||a}function U(){return Object.create(null)}function ic(a){if(null==a)return"";switch(typeof a){case "string":break;case "number":a=""+a;break;default:a=!bc(a)||F(a)||$(a)?fb(a):a.toString()}return a}function Fe(a){function b(a,b,c){return a[b]||(a[b]=c())}var d=L("$injector"),
c=L("ng");a=b(a,"angular",Object);a.$$minErr=a.$$minErr||L;return b(a,"module",function(){var a={};return function(f,g,k){var h={};if("hasOwnProperty"===f)throw c("badname","module");g&&a.hasOwnProperty(f)&&(a[f]=null);return b(a,f,function(){function a(b,c,d,f){f||(f=e);return function(){f[d||"push"]([b,c,arguments]);return C}}function b(a,c,d){d||(d=e);return function(b,e){e&&z(e)&&(e.$$moduleName=f);d.push([a,c,arguments]);return C}}if(!g)throw d("nomod",f);var e=[],n=[],t=[],s=a("$injector","invoke",
"push",n),C={_invokeQueue:e,_configBlocks:n,_runBlocks:t,info:function(a){if(u(a)){if(!G(a))throw c("aobj","value");h=a;return this}return h},requires:g,name:f,provider:b("$provide","provider"),factory:b("$provide","factory"),service:b("$provide","service"),value:a("$provide","value"),constant:a("$provide","constant","unshift"),decorator:b("$provide","decorator",n),animation:b("$animateProvider","register"),filter:b("$filterProvider","register"),controller:b("$controllerProvider","register"),directive:b("$compileProvider",
"directive"),component:b("$compileProvider","component"),config:s,run:function(a){t.push(a);return this}};k&&s(k);return C})}})}function ja(a,b){if(F(a)){b=b||[];for(var d=0,c=a.length;d<c;d++)b[d]=a[d]}else if(G(a))for(d in b=b||{},a)if("$"!==d.charAt(0)||"$"!==d.charAt(1))b[d]=a[d];return b||a}function Ge(a,b){var d=[];Xb(b)&&(a=fa.copy(a,null,b));return JSON.stringify(a,function(a,b){b=Rc(a,b);if(G(b)){if(0<=d.indexOf(b))return"...";d.push(b)}return b})}function He(a){P(a,{errorHandlingConfig:qe,
bootstrap:Vc,copy:za,extend:P,merge:se,equals:ua,element:y,forEach:q,injector:hb,noop:x,bind:Ra,toJson:fb,fromJson:Sc,identity:Qa,isUndefined:v,isDefined:u,isString:B,isFunction:z,isObject:G,isNumber:aa,isElement:$b,isArray:F,version:Ie,isDate:$,callbacks:{$$counter:0},getTestability:Be,reloadWithDebugInfo:Ae,$$minErr:L,$$csp:Ba,$$encodeUriSegment:gb,$$encodeUriQuery:ka,$$lowercase:O,$$stringify:ic,$$uppercase:wb});jc=Fe(D);jc("ng",["ngLocale"],["$provide",function(a){a.provider({$$sanitizeUri:Je});
a.provider("$compile",Yc).directive({a:Ke,input:Zc,textarea:Zc,form:Le,script:Me,select:Ne,option:Oe,ngBind:Pe,ngBindHtml:Qe,ngBindTemplate:Re,ngClass:Se,ngClassEven:Te,ngClassOdd:Ue,ngCloak:Ve,ngController:We,ngForm:Xe,ngHide:Ye,ngIf:Ze,ngInclude:$e,ngInit:af,ngNonBindable:bf,ngPluralize:cf,ngRef:df,ngRepeat:ef,ngShow:ff,ngStyle:gf,ngSwitch:hf,ngSwitchWhen:jf,ngSwitchDefault:kf,ngOptions:lf,ngTransclude:mf,ngModel:nf,ngList:of,ngChange:pf,pattern:$c,ngPattern:$c,required:ad,ngRequired:ad,minlength:bd,
ngMinlength:bd,maxlength:cd,ngMaxlength:cd,ngValue:qf,ngModelOptions:rf}).directive({ngInclude:sf}).directive(xb).directive(dd);a.provider({$anchorScroll:tf,$animate:uf,$animateCss:vf,$$animateJs:wf,$$animateQueue:xf,$$AnimateRunner:yf,$$animateAsyncRun:zf,$browser:Af,$cacheFactory:Bf,$controller:Cf,$document:Df,$$isDocumentHidden:Ef,$exceptionHandler:Ff,$filter:ed,$$forceReflow:Gf,$interpolate:Hf,$interval:If,$http:Jf,$httpParamSerializer:Kf,$httpParamSerializerJQLike:Lf,$httpBackend:Mf,$xhrFactory:Nf,
$jsonpCallbacks:Of,$location:Pf,$log:Qf,$parse:Rf,$rootScope:Sf,$q:Tf,$$q:Uf,$sce:Vf,$sceDelegate:Wf,$sniffer:Xf,$templateCache:Yf,$templateRequest:Zf,$$testability:$f,$timeout:ag,$window:bg,$$rAF:cg,$$jqLite:dg,$$Map:eg,$$cookieReader:fg})}]).info({angularVersion:"1.7.2"})}function yb(a,b){return b.toUpperCase()}function zb(a){return a.replace(gg,yb)}function kc(a){a=a.nodeType;return 1===a||!a||9===a}function fd(a,b){var d,c,e=b.createDocumentFragment(),f=[];if(lc.test(a)){d=e.appendChild(b.createElement("div"));
c=(hg.exec(a)||["",""])[1].toLowerCase();c=na[c]||na._default;d.innerHTML=c[1]+a.replace(ig,"<$1></$2>")+c[2];for(c=c[0];c--;)d=d.lastChild;f=eb(f,d.childNodes);d=e.firstChild;d.textContent=""}else f.push(b.createTextNode(a));e.textContent="";e.innerHTML="";q(f,function(a){e.appendChild(a)});return e}function W(a){if(a instanceof W)return a;var b;B(a)&&(a=Q(a),b=!0);if(!(this instanceof W)){if(b&&"<"!==a.charAt(0))throw mc("nosel");return new W(a)}if(b){b=D.document;var d;a=(d=jg.exec(a))?[b.createElement(d[1])]:
(d=fd(a,b))?d.childNodes:[];nc(this,a)}else z(a)?gd(a):nc(this,a)}function oc(a){return a.cloneNode(!0)}function Ab(a,b){!b&&kc(a)&&y.cleanData([a]);a.querySelectorAll&&y.cleanData(a.querySelectorAll("*"))}function hd(a){for(var b in a)return!1;return!0}function id(a){var b=a.ng339,d=b&&Oa[b],c=d&&d.events,d=d&&d.data;d&&!hd(d)||c&&!hd(c)||(delete Oa[b],a.ng339=void 0)}function jd(a,b,d,c){if(u(c))throw mc("offargs");var e=(c=Bb(a))&&c.events,f=c&&c.handle;if(f){if(b){var g=function(b){var c=e[b];
u(d)&&db(c||[],d);u(d)&&c&&0<c.length||(a.removeEventListener(b,f),delete e[b])};q(b.split(" "),function(a){g(a);Cb[a]&&g(Cb[a])})}else for(b in e)"$destroy"!==b&&a.removeEventListener(b,f),delete e[b];id(a)}}function pc(a,b){var d=a.ng339;if(d=d&&Oa[d])b?delete d.data[b]:d.data={},id(a)}function Bb(a,b){var d=a.ng339,d=d&&Oa[d];b&&!d&&(a.ng339=d=++kg,d=Oa[d]={events:{},data:{},handle:void 0});return d}function qc(a,b,d){if(kc(a)){var c,e=u(d),f=!e&&b&&!G(b),g=!b;a=(a=Bb(a,!f))&&a.data;if(e)a[zb(b)]=
d;else{if(g)return a;if(f)return a&&a[zb(b)];for(c in b)a[zb(c)]=b[c]}}}function Db(a,b){return a.getAttribute?-1<(" "+(a.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ").indexOf(" "+b+" "):!1}function Eb(a,b){if(b&&a.setAttribute){var d=(" "+(a.getAttribute("class")||"")+" ").replace(/[\n\t]/g," "),c=d;q(b.split(" "),function(a){a=Q(a);c=c.replace(" "+a+" "," ")});c!==d&&a.setAttribute("class",Q(c))}}function Fb(a,b){if(b&&a.setAttribute){var d=(" "+(a.getAttribute("class")||"")+" ").replace(/[\n\t]/g,
" "),c=d;q(b.split(" "),function(a){a=Q(a);-1===c.indexOf(" "+a+" ")&&(c+=a+" ")});c!==d&&a.setAttribute("class",Q(c))}}function nc(a,b){if(b)if(b.nodeType)a[a.length++]=b;else{var d=b.length;if("number"===typeof d&&b.window!==b){if(d)for(var c=0;c<d;c++)a[a.length++]=b[c]}else a[a.length++]=b}}function kd(a,b){return Gb(a,"$"+(b||"ngController")+"Controller")}function Gb(a,b,d){9===a.nodeType&&(a=a.documentElement);for(b=F(b)?b:[b];a;){for(var c=0,e=b.length;c<e;c++)if(u(d=y.data(a,b[c])))return d;
a=a.parentNode||11===a.nodeType&&a.host}}function ld(a){for(Ab(a,!0);a.firstChild;)a.removeChild(a.firstChild)}function Hb(a,b){b||Ab(a);var d=a.parentNode;d&&d.removeChild(a)}function lg(a,b){b=b||D;if("complete"===b.document.readyState)b.setTimeout(a);else y(b).on("load",a)}function gd(a){function b(){D.document.removeEventListener("DOMContentLoaded",b);D.removeEventListener("load",b);a()}"complete"===D.document.readyState?D.setTimeout(a):(D.document.addEventListener("DOMContentLoaded",b),D.addEventListener("load",
b))}function md(a,b){var d=Ib[b.toLowerCase()];return d&&nd[ta(a)]&&d}function mg(a,b){var d=function(c,d){c.isDefaultPrevented=function(){return c.defaultPrevented};var f=b[d||c.type],g=f?f.length:0;if(g){if(v(c.immediatePropagationStopped)){var k=c.stopImmediatePropagation;c.stopImmediatePropagation=function(){c.immediatePropagationStopped=!0;c.stopPropagation&&c.stopPropagation();k&&k.call(c)}}c.isImmediatePropagationStopped=function(){return!0===c.immediatePropagationStopped};var h=f.specialHandlerWrapper||
ng;1<g&&(f=ja(f));for(var l=0;l<g;l++)c.isImmediatePropagationStopped()||h(a,c,f[l])}};d.elem=a;return d}function ng(a,b,d){d.call(a,b)}function og(a,b,d){var c=b.relatedTarget;c&&(c===a||pg.call(a,c))||d.call(a,b)}function dg(){this.$get=function(){return P(W,{hasClass:function(a,b){a.attr&&(a=a[0]);return Db(a,b)},addClass:function(a,b){a.attr&&(a=a[0]);return Fb(a,b)},removeClass:function(a,b){a.attr&&(a=a[0]);return Eb(a,b)}})}}function Ta(a,b){var d=a&&a.$$hashKey;if(d)return"function"===typeof d&&
(d=a.$$hashKey()),d;d=typeof a;return d="function"===d||"object"===d&&null!==a?a.$$hashKey=d+":"+(b||re)():d+":"+a}function od(){this._keys=[];this._values=[];this._lastKey=NaN;this._lastIndex=-1}function pd(a){a=Function.prototype.toString.call(a).replace(qg,"");return a.match(rg)||a.match(sg)}function tg(a){return(a=pd(a))?"function("+(a[1]||"").replace(/[\s\r\n]+/," ")+")":"fn"}function hb(a,b){function d(a){return function(b,c){if(G(b))q(b,Yb(a));else return a(b,c)}}function c(a,b){Na(a,"service");
if(z(b)||F(b))b=n.instantiate(b);if(!b.$get)throw Ja("pget",a);return p[a+"Provider"]=b}function e(a,b){return function(){var c=C.invoke(b,this);if(v(c))throw Ja("undef",a);return c}}function f(a,b,d){return c(a,{$get:!1!==d?e(a,b):b})}function g(a){ib(v(a)||F(a),"modulesToLoad","not an array");var b=[],c;q(a,function(a){function d(a){var b,c;b=0;for(c=a.length;b<c;b++){var e=a[b],f=n.get(e[0]);f[e[1]].apply(f,e[2])}}if(!m.get(a)){m.set(a,!0);try{B(a)?(c=jc(a),C.modules[a]=c,b=b.concat(g(c.requires)).concat(c._runBlocks),
d(c._invokeQueue),d(c._configBlocks)):z(a)?b.push(n.invoke(a)):F(a)?b.push(n.invoke(a)):ub(a,"module")}catch(e){throw F(a)&&(a=a[a.length-1]),e.message&&e.stack&&-1===e.stack.indexOf(e.message)&&(e=e.message+"\n"+e.stack),Ja("modulerr",a,e.stack||e.message||e);}}});return b}function k(a,c){function d(b,e){if(a.hasOwnProperty(b)){if(a[b]===h)throw Ja("cdep",b+" <- "+l.join(" <- "));return a[b]}try{return l.unshift(b),a[b]=h,a[b]=c(b,e),a[b]}catch(f){throw a[b]===h&&delete a[b],f;}finally{l.shift()}}
function e(a,c,f){var g=[];a=hb.$$annotate(a,b,f);for(var h=0,k=a.length;h<k;h++){var l=a[h];if("string"!==typeof l)throw Ja("itkn",l);g.push(c&&c.hasOwnProperty(l)?c[l]:d(l,f))}return g}return{invoke:function(a,b,c,d){"string"===typeof c&&(d=c,c=null);c=e(a,c,d);F(a)&&(a=a[a.length-1]);d=a;if(Ca||"function"!==typeof d)d=!1;else{var f=d.$$ngIsClass;Ga(f)||(f=d.$$ngIsClass=/^class\b/.test(Function.prototype.toString.call(d)));d=f}return d?(c.unshift(null),new (Function.prototype.bind.apply(a,c))):
a.apply(b,c)},instantiate:function(a,b,c){var d=F(a)?a[a.length-1]:a;a=e(a,b,c);a.unshift(null);return new (Function.prototype.bind.apply(d,a))},get:d,annotate:hb.$$annotate,has:function(b){return p.hasOwnProperty(b+"Provider")||a.hasOwnProperty(b)}}}b=!0===b;var h={},l=[],m=new Jb,p={$provide:{provider:d(c),factory:d(f),service:d(function(a,b){return f(a,["$injector",function(a){return a.instantiate(b)}])}),value:d(function(a,b){return f(a,ia(b),!1)}),constant:d(function(a,b){Na(a,"constant");p[a]=
b;t[a]=b}),decorator:function(a,b){var c=n.get(a+"Provider"),d=c.$get;c.$get=function(){var a=C.invoke(d,c);return C.invoke(b,null,{$delegate:a})}}}},n=p.$injector=k(p,function(a,b){fa.isString(b)&&l.push(b);throw Ja("unpr",l.join(" <- "));}),t={},s=k(t,function(a,b){var c=n.get(a+"Provider",b);return C.invoke(c.$get,c,void 0,a)}),C=s;p.$injectorProvider={$get:ia(s)};C.modules=n.modules=U();var w=g(a),C=s.get("$injector");C.strictDi=b;q(w,function(a){a&&C.invoke(a)});C.loadNewModules=function(a){q(g(a),
function(a){a&&C.invoke(a)})};return C}function tf(){var a=!0;this.disableAutoScrolling=function(){a=!1};this.$get=["$window","$location","$rootScope",function(b,d,c){function e(a){var b=null;Array.prototype.some.call(a,function(a){if("a"===ta(a))return b=a,!0});return b}function f(a){if(a){a.scrollIntoView();var c;c=g.yOffset;z(c)?c=c():$b(c)?(c=c[0],c="fixed"!==b.getComputedStyle(c).position?0:c.getBoundingClientRect().bottom):aa(c)||(c=0);c&&(a=a.getBoundingClientRect().top,b.scrollBy(0,a-c))}else b.scrollTo(0,
0)}function g(a){a=B(a)?a:aa(a)?a.toString():d.hash();var b;a?(b=k.getElementById(a))?f(b):(b=e(k.getElementsByName(a)))?f(b):"top"===a&&f(null):f(null)}var k=b.document;a&&c.$watch(function(){return d.hash()},function(a,b){a===b&&""===a||lg(function(){c.$evalAsync(g)})});return g}]}function jb(a,b){if(!a&&!b)return"";if(!a)return b;if(!b)return a;F(a)&&(a=a.join(" "));F(b)&&(b=b.join(" "));return a+" "+b}function ug(a){B(a)&&(a=a.split(" "));var b=U();q(a,function(a){a.length&&(b[a]=!0)});return b}
function Ka(a){return G(a)?a:{}}function vg(a,b,d,c){function e(a){try{a.apply(null,ya.call(arguments,1))}finally{if(s--,0===s)for(;C.length;)try{C.pop()()}catch(b){d.error(b)}}}function f(){A=null;k()}function g(){w=E();w=v(w)?null:w;ua(w,I)&&(w=I);V=I=w}function k(){var a=V;g();if(K!==h.url()||a!==w)K=h.url(),V=w,q(H,function(a){a(h.url(),w)})}var h=this,l=a.location,m=a.history,p=a.setTimeout,n=a.clearTimeout,t={};h.isMock=!1;var s=0,C=[];h.$$completeOutstandingRequest=e;h.$$incOutstandingRequestCount=
function(){s++};h.notifyWhenNoOutstandingRequests=function(a){0===s?a():C.push(a)};var w,V,K=l.href,ma=b.find("base"),A=null,E=c.history?function(){try{return m.state}catch(a){}}:x;g();h.url=function(b,d,e){v(e)&&(e=null);l!==a.location&&(l=a.location);m!==a.history&&(m=a.history);if(b){var f=V===e;if(K===b&&(!c.history||f))return h;var k=K&&Da(K)===Da(b);K=b;V=e;!c.history||k&&f?(k||(A=b),d?l.replace(b):k?(d=l,e=b.indexOf("#"),e=-1===e?"":b.substr(e),d.hash=e):l.href=b,l.href!==b&&(A=b)):(m[d?"replaceState":
"pushState"](e,"",b),g());A&&(A=b);return h}return A||l.href};h.state=function(){return w};var H=[],la=!1,I=null;h.onUrlChange=function(b){if(!la){if(c.history)y(a).on("popstate",f);y(a).on("hashchange",f);la=!0}H.push(b);return b};h.$$applicationDestroyed=function(){y(a).off("hashchange popstate",f)};h.$$checkUrlChange=k;h.baseHref=function(){var a=ma.attr("href");return a?a.replace(/^(https?:)?\/\/[^/]*/,""):""};h.defer=function(a,b){var c;s++;c=p(function(){delete t[c];e(a)},b||0);t[c]=!0;return c};
h.defer.cancel=function(a){return t[a]?(delete t[a],n(a),e(x),!0):!1}}function Af(){this.$get=["$window","$log","$sniffer","$document",function(a,b,d,c){return new vg(a,c,b,d)}]}function Bf(){this.$get=function(){function a(a,c){function e(a){a!==p&&(n?n===a&&(n=a.n):n=a,f(a.n,a.p),f(a,p),p=a,p.n=null)}function f(a,b){a!==b&&(a&&(a.p=b),b&&(b.n=a))}if(a in b)throw L("$cacheFactory")("iid",a);var g=0,k=P({},c,{id:a}),h=U(),l=c&&c.capacity||Number.MAX_VALUE,m=U(),p=null,n=null;return b[a]={put:function(a,
b){if(!v(b)){if(l<Number.MAX_VALUE){var c=m[a]||(m[a]={key:a});e(c)}a in h||g++;h[a]=b;g>l&&this.remove(n.key);return b}},get:function(a){if(l<Number.MAX_VALUE){var b=m[a];if(!b)return;e(b)}return h[a]},remove:function(a){if(l<Number.MAX_VALUE){var b=m[a];if(!b)return;b===p&&(p=b.p);b===n&&(n=b.n);f(b.n,b.p);delete m[a]}a in h&&(delete h[a],g--)},removeAll:function(){h=U();g=0;m=U();p=n=null},destroy:function(){m=k=h=null;delete b[a]},info:function(){return P({},k,{size:g})}}}var b={};a.info=function(){var a=
{};q(b,function(b,e){a[e]=b.info()});return a};a.get=function(a){return b[a]};return a}}function Yf(){this.$get=["$cacheFactory",function(a){return a("templates")}]}function Yc(a,b){function d(a,b,c){var d=/^([@&]|[=<](\*?))(\??)\s*([\w$]*)$/,e=U();q(a,function(a,f){a=a.trim();if(a in p)e[f]=p[a];else{var g=a.match(d);if(!g)throw ba("iscp",b,f,a,c?"controller bindings definition":"isolate scope definition");e[f]={mode:g[1][0],collection:"*"===g[2],optional:"?"===g[3],attrName:g[4]||f};g[4]&&(p[a]=
e[f])}});return e}function c(a){var b=a.charAt(0);if(!b||b!==O(b))throw ba("baddir",a);if(a!==a.trim())throw ba("baddir",a);}function e(a){var b=a.require||a.controller&&a.name;!F(b)&&G(b)&&q(b,function(a,c){var d=a.match(l);a.substring(d[0].length)||(b[c]=d[0]+c)});return b}var f={},g=/^\s*directive:\s*([\w-]+)\s+(.*)$/,k=/(([\w-]+)(?::([^;]+))?;?)/,h=ve("ngSrc,ngSrcset,src,srcset"),l=/^(?:(\^\^?)?(\?)?(\^\^?)?)?/,m=/^(on[a-z]+|formaction)$/,p=U();this.directive=function K(b,d){ib(b,"name");Na(b,
"directive");B(b)?(c(b),ib(d,"directiveFactory"),f.hasOwnProperty(b)||(f[b]=[],a.factory(b+"Directive",["$injector","$exceptionHandler",function(a,c){var d=[];q(f[b],function(f,g){try{var h=a.invoke(f);z(h)?h={compile:ia(h)}:!h.compile&&h.link&&(h.compile=ia(h.link));h.priority=h.priority||0;h.index=g;h.name=h.name||b;h.require=e(h);var k=h,l=h.restrict;if(l&&(!B(l)||!/[EACM]/.test(l)))throw ba("badrestrict",l,b);k.restrict=l||"EA";h.$$moduleName=f.$$moduleName;d.push(h)}catch(m){c(m)}});return d}])),
f[b].push(d)):q(b,Yb(K));return this};this.component=function ma(a,b){function c(a){function e(b){return z(b)||F(b)?function(c,d){return a.invoke(b,this,{$element:c,$attrs:d})}:b}var f=b.template||b.templateUrl?b.template:"",g={controller:d,controllerAs:wg(b.controller)||b.controllerAs||"$ctrl",template:e(f),templateUrl:e(b.templateUrl),transclude:b.transclude,scope:{},bindToController:b.bindings||{},restrict:"E",require:b.require};q(b,function(a,b){"$"===b.charAt(0)&&(g[b]=a)});return g}if(!B(a))return q(a,
Yb(Ra(this,ma))),this;var d=b.controller||function(){};q(b,function(a,b){"$"===b.charAt(0)&&(c[b]=a,z(d)&&(d[b]=a))});c.$inject=["$injector"];return this.directive(a,c)};this.aHrefSanitizationWhitelist=function(a){return u(a)?(b.aHrefSanitizationWhitelist(a),this):b.aHrefSanitizationWhitelist()};this.imgSrcSanitizationWhitelist=function(a){return u(a)?(b.imgSrcSanitizationWhitelist(a),this):b.imgSrcSanitizationWhitelist()};var n=!0;this.debugInfoEnabled=function(a){return u(a)?(n=a,this):n};var t=
!1;this.strictComponentBindingsEnabled=function(a){return u(a)?(t=a,this):t};var s=10;this.onChangesTtl=function(a){return arguments.length?(s=a,this):s};var C=!0;this.commentDirectivesEnabled=function(a){return arguments.length?(C=a,this):C};var w=!0;this.cssClassDirectivesEnabled=function(a){return arguments.length?(w=a,this):w};this.$get=["$injector","$interpolate","$exceptionHandler","$templateRequest","$parse","$controller","$rootScope","$sce","$animate",function(a,b,c,e,p,I,J,R,M){function Y(){try{if(!--Da)throw ca=
void 0,ba("infchng",s);J.$apply(function(){for(var a=0,b=ca.length;a<b;++a)try{ca[a]()}catch(d){c(d)}ca=void 0})}finally{Da++}}function r(a,b){if(b){var c=Object.keys(b),d,e,f;d=0;for(e=c.length;d<e;d++)f=c[d],this[f]=b[f]}else this.$attr={};this.$$element=a}function va(a,b,c){Ba.innerHTML="<span "+b+">";b=Ba.firstChild.attributes;var d=b[0];b.removeNamedItem(d.name);d.value=c;a.attributes.setNamedItem(d)}function u(a,b){try{a.addClass(b)}catch(c){}}function N(a,b,c,d,e){a instanceof y||(a=y(a));
var f=Z(a,b,a,c,d,e);N.$$addScopeClass(a);var g=null;return function(b,c,d){if(!a)throw ba("multilink");ib(b,"scope");e&&e.needsNewScope&&(b=b.$parent.$new());d=d||{};var h=d.parentBoundTranscludeFn,k=d.transcludeControllers;d=d.futureParentElement;h&&h.$$boundTransclude&&(h=h.$$boundTransclude);g||(g=(d=d&&d[0])?"foreignobject"!==ta(d)&&ga.call(d).match(/SVG/)?"svg":"html":"html");d="html"!==g?y(ia(g,y("<div></div>").append(a).html())):c?Sa.clone.call(a):a;if(k)for(var l in k)d.data("$"+l+"Controller",
k[l].instance);N.$$addScopeInfo(d,b);c&&c(d,b);f&&f(b,d,d,h);c||(a=f=null);return d}}function Z(a,b,c,d,e,f){function g(a,c,d,e){var f,k,l,m,p,n,E;if(H)for(E=Array(c.length),m=0;m<h.length;m+=3)f=h[m],E[f]=c[f];else E=c;m=0;for(p=h.length;m<p;)k=E[h[m++]],c=h[m++],f=h[m++],c?(c.scope?(l=a.$new(),N.$$addScopeInfo(y(k),l)):l=a,n=c.transcludeOnThisElement?La(a,c.transclude,e):!c.templateOnThisElement&&e?e:!e&&b?La(a,b):null,c(f,l,k,d,n)):f&&f(a,k.childNodes,void 0,e)}for(var h=[],k=F(a)||a instanceof
y,l,m,p,n,H,E=0;E<a.length;E++){l=new r;11===Ca&&Ua(a,E,k);m=rc(a[E],[],l,0===E?d:void 0,e);(f=m.length?W(m,a[E],l,b,c,null,[],[],f):null)&&f.scope&&N.$$addScopeClass(l.$$element);l=f&&f.terminal||!(p=a[E].childNodes)||!p.length?null:Z(p,f?(f.transcludeOnThisElement||!f.templateOnThisElement)&&f.transclude:b);if(f||l)h.push(E,f,l),n=!0,H=H||f;f=null}return n?g:null}function Ua(a,b,c){var d=a[b],e=d.parentNode,f;if(d.nodeType===Ma)for(;;){f=e?d.nextSibling:a[b+1];if(!f||f.nodeType!==Ma)break;d.nodeValue+=
f.nodeValue;f.parentNode&&f.parentNode.removeChild(f);c&&f===a[b+1]&&a.splice(b+1,1)}}function La(a,b,c){function d(e,f,g,h,k){e||(e=a.$new(!1,k),e.$$transcluded=!0);return b(e,f,{parentBoundTranscludeFn:c,transcludeControllers:g,futureParentElement:h})}var e=d.$$slots=U(),f;for(f in b.$$slots)e[f]=b.$$slots[f]?La(a,b.$$slots[f],c):null;return d}function rc(a,b,c,d,e){var f=c.$attr,g;switch(a.nodeType){case 1:g=ta(a);T(b,wa(g),"E",d,e);for(var h,l,m,p,n=a.attributes,H=0,E=n&&n.length;H<E;H++){var C=
!1,w=!1;h=n[H];l=h.name;m=h.value;h=wa(l);(p=Na.test(h))&&(l=l.replace(qd,"").substr(8).replace(/_(.)/g,function(a,b){return b.toUpperCase()}));(h=h.match(Oa))&&X(h[1])&&(C=l,w=l.substr(0,l.length-5)+"end",l=l.substr(0,l.length-6));h=wa(l.toLowerCase());f[h]=l;if(p||!c.hasOwnProperty(h))c[h]=m,md(a,h)&&(c[h]=!0);oa(a,b,m,h,p);T(b,h,"A",d,e,C,w)}"input"===g&&"hidden"===a.getAttribute("type")&&a.setAttribute("autocomplete","off");if(!Ka)break;f=a.className;G(f)&&(f=f.animVal);if(B(f)&&""!==f)for(;a=
k.exec(f);)h=wa(a[2]),T(b,h,"C",d,e)&&(c[h]=Q(a[3])),f=f.substr(a.index+a[0].length);break;case Ma:ka(b,a.nodeValue);break;case 8:if(!Ja)break;xa(a,b,c,d,e)}b.sort(fa);return b}function xa(a,b,c,d,e){try{var f=g.exec(a.nodeValue);if(f){var h=wa(f[1]);T(b,h,"M",d,e)&&(c[h]=Q(f[2]))}}catch(k){}}function rd(a,b,c){var d=[],e=0;if(b&&a.hasAttribute&&a.hasAttribute(b)){do{if(!a)throw ba("uterdir",b,c);1===a.nodeType&&(a.hasAttribute(b)&&e++,a.hasAttribute(c)&&e--);d.push(a);a=a.nextSibling}while(0<e)}else d.push(a);
return y(d)}function L(a,b,c){return function(d,e,f,g,h){e=rd(e[0],b,c);return a(d,e,f,g,h)}}function sc(a,b,c,d,e,f){var g;return a?N(b,c,d,e,f):function(){g||(g=N(b,c,d,e,f),b=c=f=null);return g.apply(this,arguments)}}function W(a,b,d,e,f,g,h,k,l){function m(a,b,c,d){if(a){c&&(a=L(a,c,d));a.require=s.require;a.directiveName=J;if(w===s||s.$$isolateScope)a=qa(a,{isolateScope:!0});h.push(a)}if(b){c&&(b=L(b,c,d));b.require=s.require;b.directiveName=J;if(w===s||s.$$isolateScope)b=qa(b,{isolateScope:!0});
k.push(b)}}function p(a,e,f,g,l){function m(a,b,c,d){var e;cb(a)||(d=c,c=b,b=a,a=void 0);la&&(e=A);c||(c=la?J.parent():J);if(d){var f=l.$$slots[d];if(f)return f(a,b,e,c,Y);if(v(f))throw ba("noslot",d,Aa(J));}else return l(a,b,e,c,Y)}var n,s,t,I,ma,A,M,J;b===f?(g=d,J=d.$$element):(J=y(f),g=new r(J,d));ma=e;w?I=e.$new(!0):H&&(ma=e.$parent);l&&(M=m,M.$$boundTransclude=l,M.isSlotFilled=function(a){return!!l.$$slots[a]});C&&(A=aa(J,g,M,C,I,e,w));w&&(N.$$addScopeInfo(J,I,!0,!(R&&(R===w||R===w.$$originalDirective))),
N.$$addScopeClass(J,!0),I.$$isolateBindings=w.$$isolateBindings,s=za(e,g,I,I.$$isolateBindings,w),s.removeWatches&&I.$on("$destroy",s.removeWatches));for(n in A){s=C[n];t=A[n];var xg=s.$$bindings.bindToController;t.instance=t();J.data("$"+s.name+"Controller",t.instance);t.bindingInfo=za(ma,g,t.instance,xg,s)}q(C,function(a,b){var c=a.require;a.bindToController&&!F(c)&&G(c)&&P(A[b].instance,S(b,c,J,A))});q(A,function(a){var b=a.instance;if(z(b.$onChanges))try{b.$onChanges(a.bindingInfo.initialChanges)}catch(d){c(d)}if(z(b.$onInit))try{b.$onInit()}catch(e){c(e)}z(b.$doCheck)&&
(ma.$watch(function(){b.$doCheck()}),b.$doCheck());z(b.$onDestroy)&&ma.$on("$destroy",function(){b.$onDestroy()})});n=0;for(s=h.length;n<s;n++)t=h[n],ra(t,t.isolateScope?I:e,J,g,t.require&&S(t.directiveName,t.require,J,A),M);var Y=e;w&&(w.template||null===w.templateUrl)&&(Y=I);a&&a(Y,f.childNodes,void 0,l);for(n=k.length-1;0<=n;n--)t=k[n],ra(t,t.isolateScope?I:e,J,g,t.require&&S(t.directiveName,t.require,J,A),M);q(A,function(a){a=a.instance;z(a.$postLink)&&a.$postLink()})}l=l||{};for(var n=-Number.MAX_VALUE,
H=l.newScopeDirective,C=l.controllerDirectives,w=l.newIsolateScopeDirective,R=l.templateDirective,t=l.nonTlbTranscludeDirective,ma=!1,A=!1,la=l.hasElementTranscludeDirective,I=d.$$element=y(b),s,J,M,Y=e,va,u=!1,Pa=!1,Z,x=0,B=a.length;x<B;x++){s=a[x];var Ua=s.$$start,La=s.$$end;Ua&&(I=rd(b,Ua,La));M=void 0;if(n>s.priority)break;if(Z=s.scope)s.templateUrl||(G(Z)?($("new/isolated scope",w||H,s,I),w=s):$("new/isolated scope",w,s,I)),H=H||s;J=s.name;if(!u&&(s.replace&&(s.templateUrl||s.template)||s.transclude&&
!s.$$tlb)){for(Z=x+1;u=a[Z++];)if(u.transclude&&!u.$$tlb||u.replace&&(u.templateUrl||u.template)){Pa=!0;break}u=!0}!s.templateUrl&&s.controller&&(C=C||U(),$("'"+J+"' controller",C[J],s,I),C[J]=s);if(Z=s.transclude)if(ma=!0,s.$$tlb||($("transclusion",t,s,I),t=s),"element"===Z)la=!0,n=s.priority,M=I,I=d.$$element=y(N.$$createComment(J,d[J])),b=I[0],ja(f,ya.call(M,0),b),Y=sc(Pa,M,e,n,g&&g.name,{nonTlbTranscludeDirective:t});else{var xa=U();if(G(Z)){M=D.document.createDocumentFragment();var O=U(),T=U();
q(Z,function(a,b){var c="?"===a.charAt(0);a=c?a.substring(1):a;O[a]=b;xa[b]=null;T[b]=c});q(I.contents(),function(a){var b=O[wa(ta(a))];b?(T[b]=!0,xa[b]=xa[b]||D.document.createDocumentFragment(),xa[b].appendChild(a)):M.appendChild(a)});q(T,function(a,b){if(!a)throw ba("reqslot",b);});for(var X in xa)xa[X]&&(xa[X]=sc(Pa,xa[X].childNodes,e));M=M.childNodes}else M=y(oc(b)).contents();I.empty();Y=sc(Pa,M,e,void 0,void 0,{needsNewScope:s.$$isolateScope||s.$$newScope});Y.$$slots=xa}if(s.template)if(A=
!0,$("template",R,s,I),R=s,Z=z(s.template)?s.template(I,d):s.template,Z=Ia(Z),s.replace){g=s;M=lc.test(Z)?sd(ia(s.templateNamespace,Q(Z))):[];b=M[0];if(1!==M.length||1!==b.nodeType)throw ba("tplrt",J,"");ja(f,I,b);B={$attr:{}};Z=rc(b,[],B);var fa=a.splice(x+1,a.length-(x+1));(w||H)&&da(Z,w,H);a=a.concat(Z).concat(fa);ea(d,B);B=a.length}else I.html(Z);if(s.templateUrl)A=!0,$("template",R,s,I),R=s,s.replace&&(g=s),p=ha(a.splice(x,a.length-x),I,d,f,ma&&Y,h,k,{controllerDirectives:C,newScopeDirective:H!==s&&H,newIsolateScopeDirective:w,templateDirective:R,nonTlbTranscludeDirective:t}),B=a.length;else if(s.compile)try{va=s.compile(I,d,Y);var ca=s.$$originalDirective||s;z(va)?m(null,Ra(ca,va),Ua,La):va&&m(Ra(ca,va.pre),Ra(ca,va.post),Ua,La)}catch(ga){c(ga,Aa(I))}s.terminal&&(p.terminal=!0,n=Math.max(n,s.priority))}p.scope=H&&!0===H.scope;p.transcludeOnThisElement=ma;p.templateOnThisElement=A;p.transclude=Y;l.hasElementTranscludeDirective=la;return p}function S(a,b,c,d){var e;if(B(b)){var f=b.match(l);
b=b.substring(f[0].length);var g=f[1]||f[3],f="?"===f[2];"^^"===g?c=c.parent():e=(e=d&&d[b])&&e.instance;if(!e){var h="$"+b+"Controller";e=g?c.inheritedData(h):c.data(h)}if(!e&&!f)throw ba("ctreq",b,a);}else if(F(b))for(e=[],g=0,f=b.length;g<f;g++)e[g]=S(a,b[g],c,d);else G(b)&&(e={},q(b,function(b,f){e[f]=S(a,b,c,d)}));return e||null}function aa(a,b,c,d,e,f,g){var h=U(),k;for(k in d){var l=d[k],m={$scope:l===g||l.$$isolateScope?e:f,$element:a,$attrs:b,$transclude:c},p=l.controller;"@"===p&&(p=b[l.name]);
m=I(p,m,!0,l.controllerAs);h[l.name]=m;a.data("$"+l.name+"Controller",m.instance)}return h}function da(a,b,c){for(var d=0,e=a.length;d<e;d++)a[d]=ac(a[d],{$$isolateScope:b,$$newScope:c})}function T(b,c,e,g,h,k,l){if(c===h)return null;var m=null;if(f.hasOwnProperty(c)){h=a.get(c+"Directive");for(var p=0,n=h.length;p<n;p++)if(c=h[p],(v(g)||g>c.priority)&&-1!==c.restrict.indexOf(e)){k&&(c=ac(c,{$$start:k,$$end:l}));if(!c.$$bindings){var H=m=c,E=c.name,C={isolateScope:null,bindToController:null};G(H.scope)&&
(!0===H.bindToController?(C.bindToController=d(H.scope,E,!0),C.isolateScope={}):C.isolateScope=d(H.scope,E,!1));G(H.bindToController)&&(C.bindToController=d(H.bindToController,E,!0));if(C.bindToController&&!H.controller)throw ba("noctrl",E);m=m.$$bindings=C;G(m.isolateScope)&&(c.$$isolateBindings=m.isolateScope)}b.push(c);m=c}}return m}function X(b){if(f.hasOwnProperty(b))for(var c=a.get(b+"Directive"),d=0,e=c.length;d<e;d++)if(b=c[d],b.multiElement)return!0;return!1}function ea(a,b){var c=b.$attr,
d=a.$attr;q(a,function(d,e){"$"!==e.charAt(0)&&(b[e]&&b[e]!==d&&(d=d.length?d+(("style"===e?";":" ")+b[e]):b[e]),a.$set(e,d,!0,c[e]))});q(b,function(b,e){a.hasOwnProperty(e)||"$"===e.charAt(0)||(a[e]=b,"class"!==e&&"style"!==e&&(d[e]=c[e]))})}function ha(a,b,d,f,g,h,k,l){var m=[],p,n,C=b[0],s=a.shift(),w=ac(s,{templateUrl:null,transclude:null,replace:null,$$originalDirective:s}),t=z(s.templateUrl)?s.templateUrl(b,d):s.templateUrl,R=s.templateNamespace;b.empty();e(t).then(function(c){var e,H;c=Ia(c);
if(s.replace){c=lc.test(c)?sd(ia(R,Q(c))):[];e=c[0];if(1!==c.length||1!==e.nodeType)throw ba("tplrt",s.name,t);c={$attr:{}};ja(f,b,e);var E=rc(e,[],c);G(s.scope)&&da(E,!0);a=E.concat(a);ea(d,c)}else e=C,b.html(c);a.unshift(w);p=W(a,e,d,g,b,s,h,k,l);q(f,function(a,c){a===e&&(f[c]=b[0])});for(n=Z(b[0].childNodes,g);m.length;){c=m.shift();H=m.shift();var I=m.shift(),A=m.shift(),E=b[0];if(!c.$$destroyed){if(H!==C){var J=H.className;l.hasElementTranscludeDirective&&s.replace||(E=oc(e));ja(I,y(H),E);u(y(E),
J)}H=p.transcludeOnThisElement?La(c,p.transclude,A):A;p(n,c,E,f,H)}}m=null}).catch(function(a){cc(a)&&c(a)});return function(a,b,c,d,e){a=e;b.$$destroyed||(m?m.push(b,c,d,a):(p.transcludeOnThisElement&&(a=La(b,p.transclude,e)),p(n,b,c,d,a)))}}function fa(a,b){var c=b.priority-a.priority;return 0!==c?c:a.name!==b.name?a.name<b.name?-1:1:a.index-b.index}function $(a,b,c,d){function e(a){return a?" (module: "+a+")":""}if(b)throw ba("multidir",b.name,e(b.$$moduleName),c.name,e(c.$$moduleName),a,Aa(d));
}function ka(a,c){var d=b(c,!0);d&&a.push({priority:0,compile:function(a){a=a.parent();var b=!!a.length;b&&N.$$addBindingClass(a);return function(a,c){var e=c.parent();b||N.$$addBindingClass(e);N.$$addBindingInfo(e,d.expressions);a.$watch(d,function(a){c[0].nodeValue=a})}}})}function ia(a,b){a=O(a||"html");switch(a){case "svg":case "math":var c=D.document.createElement("div");c.innerHTML="<"+a+">"+b+"</"+a+">";return c.childNodes[0].childNodes;default:return b}}function na(a,b){if("srcdoc"===b)return R.HTML;
var c=ta(a);if("src"===b||"ngSrc"===b)return-1===["img","video","audio","source","track"].indexOf(c)?R.RESOURCE_URL:R.MEDIA_URL;if("xlinkHref"===b)return"image"===c?R.MEDIA_URL:"a"===c?R.URL:R.RESOURCE_URL;if("form"===c&&"action"===b||"base"===c&&"href"===b||"link"===c&&"href"===b)return R.RESOURCE_URL;if("a"===c&&("href"===b||"ngHref"===b))return R.URL}function oa(a,c,d,e,f){var g=na(a,e),k=h[e]||f,l=b(d,!f,g,k);if(l){if("multiple"===e&&"select"===ta(a))throw ba("selmulti",Aa(a));if(m.test(e))throw ba("nodomevents");
c.push({priority:100,compile:function(){return{pre:function(a,c,f){c=f.$$observers||(f.$$observers=U());var h=f[e];h!==d&&(l=h&&b(h,!0,g,k),d=h);l&&(f[e]=l(a),(c[e]||(c[e]=[])).$$inter=!0,(f.$$observers&&f.$$observers[e].$$scope||a).$watch(l,function(a,b){"class"===e&&a!==b?f.$updateClass(a,b):f.$set(e,a)}))}}}})}}function ja(a,b,c){var d=b[0],e=b.length,f=d.parentNode,g,h;if(a)for(g=0,h=a.length;g<h;g++)if(a[g]===d){a[g++]=c;h=g+e-1;for(var k=a.length;g<k;g++,h++)h<k?a[g]=a[h]:delete a[g];a.length-=
e-1;a.context===d&&(a.context=c);break}f&&f.replaceChild(c,d);a=D.document.createDocumentFragment();for(g=0;g<e;g++)a.appendChild(b[g]);y.hasData(d)&&(y.data(c,y.data(d)),y(d).off("$destroy"));y.cleanData(a.querySelectorAll("*"));for(g=1;g<e;g++)delete b[g];b[0]=c;b.length=1}function qa(a,b){return P(function(){return a.apply(null,arguments)},a,b)}function ra(a,b,d,e,f,g){try{a(b,d,e,f,g)}catch(h){c(h,Aa(d))}}function pa(a,b){if(t)throw ba("missingattr",a,b);}function za(a,c,d,e,f){function g(b,c,
e){z(d.$onChanges)&&!dc(c,e)&&(ca||(a.$$postDigest(Y),ca=[]),m||(m={},ca.push(h)),m[b]&&(e=m[b].previousValue),m[b]=new Kb(e,c))}function h(){d.$onChanges(m);m=void 0}var k=[],l={},m;q(e,function(e,h){var m=e.attrName,n=e.optional,H,E,s,C;switch(e.mode){case "@":n||sa.call(c,m)||(pa(m,f.name),d[h]=c[m]=void 0);n=c.$observe(m,function(a){if(B(a)||Ga(a))g(h,a,d[h]),d[h]=a});c.$$observers[m].$$scope=a;H=c[m];B(H)?d[h]=b(H)(a):Ga(H)&&(d[h]=H);l[h]=new Kb(tc,d[h]);k.push(n);break;case "=":if(!sa.call(c,
m)){if(n)break;pa(m,f.name);c[m]=void 0}if(n&&!c[m])break;E=p(c[m]);C=E.literal?ua:dc;s=E.assign||function(){H=d[h]=E(a);throw ba("nonassign",c[m],m,f.name);};H=d[h]=E(a);n=function(b){C(b,d[h])||(C(b,H)?s(a,b=d[h]):d[h]=b);return H=b};n.$stateful=!0;n=e.collection?a.$watchCollection(c[m],n):a.$watch(p(c[m],n),null,E.literal);k.push(n);break;case "<":if(!sa.call(c,m)){if(n)break;pa(m,f.name);c[m]=void 0}if(n&&!c[m])break;E=p(c[m]);var w=E.literal,t=d[h]=E(a);l[h]=new Kb(tc,d[h]);n=a[e.collection?
"$watchCollection":"$watch"](E,function(a,b){if(b===a){if(b===t||w&&ua(b,t))return;b=t}g(h,a,b);d[h]=a});k.push(n);break;case "&":n||sa.call(c,m)||pa(m,f.name);E=c.hasOwnProperty(m)?p(c[m]):x;if(E===x&&n)break;d[h]=function(b){return E(a,b)}}});return{initialChanges:l,removeWatches:k.length&&function(){for(var a=0,b=k.length;a<b;++a)k[a]()}}}var Ha=/^\w/,Ba=D.document.createElement("div"),Ja=C,Ka=w,Da=s,ca;r.prototype={$normalize:wa,$addClass:function(a){a&&0<a.length&&M.addClass(this.$$element,a)},
$removeClass:function(a){a&&0<a.length&&M.removeClass(this.$$element,a)},$updateClass:function(a,b){var c=td(a,b);c&&c.length&&M.addClass(this.$$element,c);(c=td(b,a))&&c.length&&M.removeClass(this.$$element,c)},$set:function(a,b,d,e){var f=md(this.$$element[0],a),g=ud[a],h=a;f?(this.$$element.prop(a,b),e=f):g&&(this[g]=b,h=g);this[a]=b;e?this.$attr[a]=e:(e=this.$attr[a])||(this.$attr[a]=e=Wc(a,"-"));if("img"===ta(this.$$element)&&"srcset"===a&&b){if(!B(b))throw ba("srcset",b.toString());for(var f=
"",g=Q(b),k=/(\s+\d+x\s*,|\s+\d+w\s*,|\s+,|,\s+)/,k=/\s/.test(g)?k:/(,)/,g=g.split(k),k=Math.floor(g.length/2),l=0;l<k;l++)var m=2*l,f=f+R.getTrustedMediaUrl(Q(g[m])),f=f+(" "+Q(g[m+1]));g=Q(g[2*l]).split(/\s/);f+=R.getTrustedMediaUrl(Q(g[0]));2===g.length&&(f+=" "+Q(g[1]));this[a]=b=f}!1!==d&&(null===b||v(b)?this.$$element.removeAttr(e):Ha.test(e)?this.$$element.attr(e,b):va(this.$$element[0],e,b));(a=this.$$observers)&&q(a[h],function(a){try{a(b)}catch(d){c(d)}})},$observe:function(a,b){var c=this,
d=c.$$observers||(c.$$observers=U()),e=d[a]||(d[a]=[]);e.push(b);J.$evalAsync(function(){e.$$inter||!c.hasOwnProperty(a)||v(c[a])||b(c[a])});return function(){db(e,b)}}};var Ea=b.startSymbol(),Fa=b.endSymbol(),Ia="{{"===Ea&&"}}"===Fa?Qa:function(a){return a.replace(/\{\{/g,Ea).replace(/}}/g,Fa)},Na=/^ngAttr[A-Z]/,Oa=/^(.+)Start$/;N.$$addBindingInfo=n?function(a,b){var c=a.data("$binding")||[];F(b)?c=c.concat(b):c.push(b);a.data("$binding",c)}:x;N.$$addBindingClass=n?function(a){u(a,"ng-binding")}:
x;N.$$addScopeInfo=n?function(a,b,c,d){a.data(c?d?"$isolateScopeNoTemplate":"$isolateScope":"$scope",b)}:x;N.$$addScopeClass=n?function(a,b){u(a,b?"ng-isolate-scope":"ng-scope")}:x;N.$$createComment=function(a,b){var c="";n&&(c=" "+(a||"")+": ",b&&(c+=b+" "));return D.document.createComment(c)};return N}]}function Kb(a,b){this.previousValue=a;this.currentValue=b}function wa(a){return a.replace(qd,"").replace(yg,function(a,d,c){return c?d.toUpperCase():d})}function td(a,b){var d="",c=a.split(/\s+/),
e=b.split(/\s+/),f=0;a:for(;f<c.length;f++){for(var g=c[f],k=0;k<e.length;k++)if(g===e[k])continue a;d+=(0<d.length?" ":"")+g}return d}function sd(a){a=y(a);var b=a.length;if(1>=b)return a;for(;b--;){var d=a[b];(8===d.nodeType||d.nodeType===Ma&&""===d.nodeValue.trim())&&zg.call(a,b,1)}return a}function wg(a,b){if(b&&B(b))return b;if(B(a)){var d=vd.exec(a);if(d)return d[3]}}function Cf(){var a={};this.has=function(b){return a.hasOwnProperty(b)};this.register=function(b,d){Na(b,"controller");G(b)?P(a,
b):a[b]=d};this.$get=["$injector",function(b){function d(a,b,d,g){if(!a||!G(a.$scope))throw L("$controller")("noscp",g,b);a.$scope[b]=d}return function(c,e,f,g){var k,h,l;f=!0===f;g&&B(g)&&(l=g);if(B(c)){g=c.match(vd);if(!g)throw wd("ctrlfmt",c);h=g[1];l=l||g[3];c=a.hasOwnProperty(h)?a[h]:Ee(e.$scope,h,!0);if(!c)throw wd("ctrlreg",h);ub(c,h,!0)}if(f)return f=(F(c)?c[c.length-1]:c).prototype,k=Object.create(f||null),l&&d(e,l,k,h||c.name),P(function(){var a=b.invoke(c,k,e,h);a!==k&&(G(a)||z(a))&&(k=
a,l&&d(e,l,k,h||c.name));return k},{instance:k,identifier:l});k=b.instantiate(c,e,h);l&&d(e,l,k,h||c.name);return k}}]}function Df(){this.$get=["$window",function(a){return y(a.document)}]}function Ef(){this.$get=["$document","$rootScope",function(a,b){function d(){e=c.hidden}var c=a[0],e=c&&c.hidden;a.on("visibilitychange",d);b.$on("$destroy",function(){a.off("visibilitychange",d)});return function(){return e}}]}function Ff(){this.$get=["$log",function(a){return function(b,d){a.error.apply(a,arguments)}}]}
function uc(a){return G(a)?$(a)?a.toISOString():fb(a):a}function Kf(){this.$get=function(){return function(a){if(!a)return"";var b=[];Pc(a,function(a,c){null===a||v(a)||z(a)||(F(a)?q(a,function(a){b.push(ka(c)+"="+ka(uc(a)))}):b.push(ka(c)+"="+ka(uc(a))))});return b.join("&")}}}function Lf(){this.$get=function(){return function(a){function b(a,e,f){F(a)?q(a,function(a,c){b(a,e+"["+(G(a)?c:"")+"]")}):G(a)&&!$(a)?Pc(a,function(a,c){b(a,e+(f?"":"[")+c+(f?"":"]"))}):(z(a)&&(a=a()),d.push(ka(e)+"="+(null==a?"":ka(uc(a)))))}if(!a)return"";var d=[];b(a,"",!0);return d.join("&")}}}function vc(a,b){if(B(a)){var d=a.replace(Ag,"").trim();if(d){var c=b("Content-Type"),c=c&&0===c.indexOf(xd),e;(e=c)||(e=(e=d.match(Bg))&&Cg[e[0]].test(d));if(e)try{a=Sc(d)}catch(f){if(!c)return a;throw Lb("baddata",a,f);}}}return a}function yd(a){var b=U(),d;B(a)?q(a.split("\n"),function(a){d=a.indexOf(":");var e=O(Q(a.substr(0,d)));a=Q(a.substr(d+1));e&&(b[e]=b[e]?b[e]+", "+a:a)}):G(a)&&q(a,function(a,d){var f=O(d),g=Q(a);
f&&(b[f]=b[f]?b[f]+", "+g:g)});return b}function zd(a){var b;return function(d){b||(b=yd(a));return d?(d=b[O(d)],void 0===d&&(d=null),d):b}}function Ad(a,b,d,c){if(z(c))return c(a,b,d);q(c,function(c){a=c(a,b,d)});return a}function Jf(){var a=this.defaults={transformResponse:[vc],transformRequest:[function(a){return G(a)&&"[object File]"!==ga.call(a)&&"[object Blob]"!==ga.call(a)&&"[object FormData]"!==ga.call(a)?fb(a):a}],headers:{common:{Accept:"application/json, text/plain, */*"},post:ja(wc),put:ja(wc),
patch:ja(wc)},xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",paramSerializer:"$httpParamSerializer",jsonpCallbackParam:"callback"},b=!1;this.useApplyAsync=function(a){return u(a)?(b=!!a,this):b};var d=this.interceptors=[],c=this.xsrfWhitelistedOrigins=[];this.$get=["$browser","$httpBackend","$$cookieReader","$cacheFactory","$rootScope","$q","$injector","$sce",function(e,f,g,k,h,l,m,p){function n(b){function c(a,b){for(var d=0,e=b.length;d<e;){var f=b[d++],g=b[d++];a=a.then(f,g)}b.length=
0;return a}function d(a,b){var c,e={};q(a,function(a,d){z(a)?(c=a(b),null!=c&&(e[d]=c)):e[d]=a});return e}function f(a){var b=P({},a);b.data=Ad(a.data,a.headers,a.status,g.transformResponse);a=a.status;return 200<=a&&300>a?b:l.reject(b)}if(!G(b))throw L("$http")("badreq",b);if(!B(p.valueOf(b.url)))throw L("$http")("badreq",b.url);var g=P({method:"get",transformRequest:a.transformRequest,transformResponse:a.transformResponse,paramSerializer:a.paramSerializer,jsonpCallbackParam:a.jsonpCallbackParam},
b);g.headers=function(b){var c=a.headers,e=P({},b.headers),f,g,h,c=P({},c.common,c[O(b.method)]);a:for(f in c){g=O(f);for(h in e)if(O(h)===g)continue a;e[f]=c[f]}return d(e,ja(b))}(b);g.method=wb(g.method);g.paramSerializer=B(g.paramSerializer)?m.get(g.paramSerializer):g.paramSerializer;e.$$incOutstandingRequestCount();var h=[],k=[];b=l.resolve(g);q(V,function(a){(a.request||a.requestError)&&h.unshift(a.request,a.requestError);(a.response||a.responseError)&&k.push(a.response,a.responseError)});b=
c(b,h);b=b.then(function(b){var c=b.headers,d=Ad(b.data,zd(c),void 0,b.transformRequest);v(d)&&q(c,function(a,b){"content-type"===O(b)&&delete c[b]});v(b.withCredentials)&&!v(a.withCredentials)&&(b.withCredentials=a.withCredentials);return t(b,d).then(f,f)});b=c(b,k);return b=b.finally(function(){e.$$completeOutstandingRequest(x)})}function t(c,d){function e(a){if(a){var c={};q(a,function(a,d){c[d]=function(c){function d(){a(c)}b?h.$applyAsync(d):h.$$phase?d():h.$apply(d)}});return c}}function k(a,
c,d,e,f){function g(){m(c,a,d,e,f)}Y&&(200<=a&&300>a?Y.put(N,[a,c,yd(d),e,f]):Y.remove(N));b?h.$applyAsync(g):(g(),h.$$phase||h.$apply())}function m(a,b,d,e,f){b=-1<=b?b:0;(200<=b&&300>b?V.resolve:V.reject)({data:a,status:b,headers:zd(d),config:c,statusText:e,xhrStatus:f})}function t(a){m(a.data,a.status,ja(a.headers()),a.statusText,a.xhrStatus)}function J(){var a=n.pendingRequests.indexOf(c);-1!==a&&n.pendingRequests.splice(a,1)}var V=l.defer(),M=V.promise,Y,r,va=c.headers,Pa="jsonp"===O(c.method),
N=c.url;Pa?N=p.getTrustedResourceUrl(N):B(N)||(N=p.valueOf(N));N=s(N,c.paramSerializer(c.params));Pa&&(N=C(N,c.jsonpCallbackParam));n.pendingRequests.push(c);M.then(J,J);!c.cache&&!a.cache||!1===c.cache||"GET"!==c.method&&"JSONP"!==c.method||(Y=G(c.cache)?c.cache:G(a.cache)?a.cache:w);Y&&(r=Y.get(N),u(r)?r&&z(r.then)?r.then(t,t):F(r)?m(r[1],r[0],ja(r[2]),r[3],r[4]):m(r,200,{},"OK","complete"):Y.put(N,M));v(r)&&((r=K(c.url)?g()[c.xsrfCookieName||a.xsrfCookieName]:void 0)&&(va[c.xsrfHeaderName||a.xsrfHeaderName]=
r),f(c.method,N,d,k,va,c.timeout,c.withCredentials,c.responseType,e(c.eventHandlers),e(c.uploadEventHandlers)));return M}function s(a,b){0<b.length&&(a+=(-1===a.indexOf("?")?"?":"&")+b);return a}function C(a,b){var c=a.split("?");if(2<c.length)throw Lb("badjsonp",a);c=gc(c[1]);q(c,function(c,d){if("JSON_CALLBACK"===c)throw Lb("badjsonp",a);if(d===b)throw Lb("badjsonp",b,a);});return a+=(-1===a.indexOf("?")?"?":"&")+b+"=JSON_CALLBACK"}var w=k("$http");a.paramSerializer=B(a.paramSerializer)?m.get(a.paramSerializer):
a.paramSerializer;var V=[];q(d,function(a){V.unshift(B(a)?m.get(a):m.invoke(a))});var K=Dg(c);n.pendingRequests=[];(function(a){q(arguments,function(a){n[a]=function(b,c){return n(P({},c||{},{method:a,url:b}))}})})("get","delete","head","jsonp");(function(a){q(arguments,function(a){n[a]=function(b,c,d){return n(P({},d||{},{method:a,url:b,data:c}))}})})("post","put","patch");n.defaults=a;return n}]}function Nf(){this.$get=function(){return function(){return new D.XMLHttpRequest}}}function Mf(){this.$get=
["$browser","$jsonpCallbacks","$document","$xhrFactory",function(a,b,d,c){return Eg(a,c,a.defer,b,d[0])}]}function Eg(a,b,d,c,e){function f(a,b,d){a=a.replace("JSON_CALLBACK",b);var f=e.createElement("script"),m=null;f.type="text/javascript";f.src=a;f.async=!0;m=function(a){f.removeEventListener("load",m);f.removeEventListener("error",m);e.body.removeChild(f);f=null;var g=-1,t="unknown";a&&("load"!==a.type||c.wasCalled(b)||(a={type:"error"}),t=a.type,g="error"===a.type?404:200);d&&d(g,t)};f.addEventListener("load",
m);f.addEventListener("error",m);e.body.appendChild(f);return m}return function(e,k,h,l,m,p,n,t,s,C){function w(a){E="timeout"===a;r&&r();A&&A.abort()}function V(a,b,c,e,f,g){u(la)&&d.cancel(la);r=A=null;a(b,c,e,f,g)}k=k||a.url();if("jsonp"===O(e))var K=c.createCallback(k),r=f(k,K,function(a,b){var d=200===a&&c.getResponse(K);V(l,a,d,"",b,"complete");c.removeCallback(K)});else{var A=b(e,k),E=!1;A.open(e,k,!0);q(m,function(a,b){u(a)&&A.setRequestHeader(b,a)});A.onload=function(){var a=A.statusText||
"",b="response"in A?A.response:A.responseText,c=1223===A.status?204:A.status;0===c&&(c=b?200:"file"===oa(k).protocol?404:0);V(l,c,b,A.getAllResponseHeaders(),a,"complete")};A.onerror=function(){V(l,-1,null,null,"","error")};A.ontimeout=function(){V(l,-1,null,null,"","timeout")};A.onabort=function(){V(l,-1,null,null,"",E?"timeout":"abort")};q(s,function(a,b){A.addEventListener(b,a)});q(C,function(a,b){A.upload.addEventListener(b,a)});n&&(A.withCredentials=!0);if(t)try{A.responseType=t}catch(H){if("json"!==t)throw H;}A.send(v(h)?null:h)}if(0<p)var la=d(function(){w("timeout")},p);else p&&z(p.then)&&p.then(function(){w(u(p.$$timeoutId)?"timeout":"abort")})}}function Hf(){var a="{{",b="}}";this.startSymbol=function(b){return b?(a=b,this):a};this.endSymbol=function(a){return a?(b=a,this):b};this.$get=["$parse","$exceptionHandler","$sce",function(d,c,e){function f(a){return"\\\\\\"+a}function g(c){return c.replace(p,a).replace(n,b)}function k(a,b,c,d){var e=a.$watch(function(a){e();return d(a)},b,c);return e}
function h(f,h,p,n){function V(a){try{return a=p&&!K?e.getTrusted(p,a):e.valueOf(a),n&&!u(a)?a:ic(a)}catch(b){c(ca.interr(f,b))}}var K=p===e.URL||p===e.MEDIA_URL;if(!f.length||-1===f.indexOf(a)){if(h&&!K)return;h=g(f);K&&(h=e.getTrusted(p,h));h=ia(h);h.exp=f;h.expressions=[];h.$$watchDelegate=k;return h}n=!!n;for(var q,A,E=0,H=[],la,I=f.length,J=[],R=[],M;E<I;)if(-1!==(q=f.indexOf(a,E))&&-1!==(A=f.indexOf(b,q+l)))E!==q&&J.push(g(f.substring(E,q))),E=f.substring(q+l,A),H.push(E),E=A+m,R.push(J.length),
J.push("");else{E!==I&&J.push(g(f.substring(E)));break}M=1===J.length&&1===R.length;var r=K&&M?void 0:V;la=H.map(function(a){return d(a,r)});if(!h||H.length){var y=function(a){for(var b=0,c=H.length;b<c;b++){if(n&&v(a[b]))return;J[R[b]]=a[b]}if(K)return e.getTrusted(p,M?J[0]:J.join(""));p&&1<J.length&&ca.throwNoconcat(f);return J.join("")};return P(function(a){var b=0,d=H.length,e=Array(d);try{for(;b<d;b++)e[b]=la[b](a);return y(e)}catch(g){c(ca.interr(f,g))}},{exp:f,expressions:H,$$watchDelegate:function(a,
b){var c;return a.$watchGroup(la,function(d,e){var f=y(d);b.call(this,f,d!==e?c:f,a);c=f})}})}}var l=a.length,m=b.length,p=new RegExp(a.replace(/./g,f),"g"),n=new RegExp(b.replace(/./g,f),"g");h.startSymbol=function(){return a};h.endSymbol=function(){return b};return h}]}function If(){this.$get=["$rootScope","$window","$q","$$q","$browser",function(a,b,d,c,e){function f(f,h,l,m){function p(){n?f.apply(null,t):f(w)}var n=4<arguments.length,t=n?ya.call(arguments,4):[],s=b.setInterval,C=b.clearInterval,
w=0,V=u(m)&&!m,K=(V?c:d).defer(),q=K.promise;l=u(l)?l:0;q.$$intervalId=s(function(){V?e.defer(p):a.$evalAsync(p);K.notify(w++);0<l&&w>=l&&(K.resolve(w),C(q.$$intervalId),delete g[q.$$intervalId]);V||a.$apply()},h);g[q.$$intervalId]=K;return q}var g={};f.cancel=function(a){if(!a)return!1;if(!a.hasOwnProperty("$$intervalId"))throw Fg("badprom");if(!g.hasOwnProperty(a.$$intervalId))return!1;a=a.$$intervalId;var c=g[a];c.promise.$$state.pur=!0;c.reject("canceled");b.clearInterval(a);delete g[a];return!0};
return f}]}function xc(a){a=a.split("/");for(var b=a.length;b--;)a[b]=gb(a[b].replace(/%2F/g,"/"));return a.join("/")}function Bd(a,b){var d=oa(a);b.$$protocol=d.protocol;b.$$host=d.hostname;b.$$port=ea(d.port)||Gg[d.protocol]||null}function Cd(a,b,d){if(Hg.test(a))throw kb("badpath",a);var c="/"!==a.charAt(0);c&&(a="/"+a);a=oa(a);for(var c=(c&&"/"===a.pathname.charAt(0)?a.pathname.substring(1):a.pathname).split("/"),e=c.length;e--;)c[e]=decodeURIComponent(c[e]),d&&(c[e]=c[e].replace(/\//g,"%2F"));
d=c.join("/");b.$$path=d;b.$$search=gc(a.search);b.$$hash=decodeURIComponent(a.hash);b.$$path&&"/"!==b.$$path.charAt(0)&&(b.$$path="/"+b.$$path)}function yc(a,b){return a.slice(0,b.length)===b}function qa(a,b){if(yc(b,a))return b.substr(a.length)}function Da(a){var b=a.indexOf("#");return-1===b?a:a.substr(0,b)}function lb(a){return a.replace(/(#.+)|#$/,"$1")}function zc(a,b,d){this.$$html5=!0;d=d||"";Bd(a,this);this.$$parse=function(a){var d=qa(b,a);if(!B(d))throw kb("ipthprfx",a,b);Cd(d,this,!0);
this.$$path||(this.$$path="/");this.$$compose()};this.$$compose=function(){var a=hc(this.$$search),d=this.$$hash?"#"+gb(this.$$hash):"";this.$$url=xc(this.$$path)+(a?"?"+a:"")+d;this.$$absUrl=b+this.$$url.substr(1);this.$$urlUpdatedByLocation=!0};this.$$parseLinkUrl=function(c,e){if(e&&"#"===e[0])return this.hash(e.slice(1)),!0;var f,g;u(f=qa(a,c))?(g=f,g=d&&u(f=qa(d,f))?b+(qa("/",f)||f):a+g):u(f=qa(b,c))?g=b+f:b===c+"/"&&(g=b);g&&this.$$parse(g);return!!g}}function Ac(a,b,d){Bd(a,this);this.$$parse=
function(c){var e=qa(a,c)||qa(b,c),f;v(e)||"#"!==e.charAt(0)?this.$$html5?f=e:(f="",v(e)&&(a=c,this.replace())):(f=qa(d,e),v(f)&&(f=e));Cd(f,this,!1);c=this.$$path;var e=a,g=/^\/[A-Z]:(\/.*)/;yc(f,e)&&(f=f.replace(e,""));g.exec(f)||(c=(f=g.exec(c))?f[1]:c);this.$$path=c;this.$$compose()};this.$$compose=function(){var b=hc(this.$$search),e=this.$$hash?"#"+gb(this.$$hash):"";this.$$url=xc(this.$$path)+(b?"?"+b:"")+e;this.$$absUrl=a+(this.$$url?d+this.$$url:"");this.$$urlUpdatedByLocation=!0};this.$$parseLinkUrl=
function(b,d){return Da(a)===Da(b)?(this.$$parse(b),!0):!1}}function Dd(a,b,d){this.$$html5=!0;Ac.apply(this,arguments);this.$$parseLinkUrl=function(c,e){if(e&&"#"===e[0])return this.hash(e.slice(1)),!0;var f,g;a===Da(c)?f=c:(g=qa(b,c))?f=a+d+g:b===c+"/"&&(f=b);f&&this.$$parse(f);return!!f};this.$$compose=function(){var b=hc(this.$$search),e=this.$$hash?"#"+gb(this.$$hash):"";this.$$url=xc(this.$$path)+(b?"?"+b:"")+e;this.$$absUrl=a+d+this.$$url;this.$$urlUpdatedByLocation=!0}}function Mb(a){return function(){return this[a]}}
function Ed(a,b){return function(d){if(v(d))return this[a];this[a]=b(d);this.$$compose();return this}}function Pf(){var a="!",b={enabled:!1,requireBase:!0,rewriteLinks:!0};this.hashPrefix=function(b){return u(b)?(a=b,this):a};this.html5Mode=function(a){if(Ga(a))return b.enabled=a,this;if(G(a)){Ga(a.enabled)&&(b.enabled=a.enabled);Ga(a.requireBase)&&(b.requireBase=a.requireBase);if(Ga(a.rewriteLinks)||B(a.rewriteLinks))b.rewriteLinks=a.rewriteLinks;return this}return b};this.$get=["$rootScope","$browser",
"$sniffer","$rootElement","$window",function(d,c,e,f,g){function k(a,b,d){var e=l.url(),f=l.$$state;try{c.url(a,b,d),l.$$state=c.state()}catch(g){throw l.url(e),l.$$state=f,g;}}function h(a,b){d.$broadcast("$locationChangeSuccess",l.absUrl(),a,l.$$state,b)}var l,m;m=c.baseHref();var p=c.url(),n;if(b.enabled){if(!m&&b.requireBase)throw kb("nobase");n=p.substring(0,p.indexOf("/",p.indexOf("//")+2))+(m||"/");m=e.history?zc:Dd}else n=Da(p),m=Ac;var t=n.substr(0,Da(n).lastIndexOf("/")+1);l=new m(n,t,"#"+
a);l.$$parseLinkUrl(p,p);l.$$state=c.state();var s=/^\s*(javascript|mailto):/i;f.on("click",function(a){var e=b.rewriteLinks;if(e&&!a.ctrlKey&&!a.metaKey&&!a.shiftKey&&2!==a.which&&2!==a.button){for(var g=y(a.target);"a"!==ta(g[0]);)if(g[0]===f[0]||!(g=g.parent())[0])return;if(!B(e)||!v(g.attr(e))){var e=g.prop("href"),h=g.attr("href")||g.attr("xlink:href");G(e)&&"[object SVGAnimatedString]"===e.toString()&&(e=oa(e.animVal).href);s.test(e)||!e||g.attr("target")||a.isDefaultPrevented()||!l.$$parseLinkUrl(e,
h)||(a.preventDefault(),l.absUrl()!==c.url()&&d.$apply())}}});lb(l.absUrl())!==lb(p)&&c.url(l.absUrl(),!0);var C=!0;c.onUrlChange(function(a,b){yc(a,t)?(d.$evalAsync(function(){var c=l.absUrl(),e=l.$$state,f;a=lb(a);l.$$parse(a);l.$$state=b;f=d.$broadcast("$locationChangeStart",a,c,b,e).defaultPrevented;l.absUrl()===a&&(f?(l.$$parse(c),l.$$state=e,k(c,!1,e)):(C=!1,h(c,e)))}),d.$$phase||d.$digest()):g.location.href=a});d.$watch(function(){if(C||l.$$urlUpdatedByLocation){l.$$urlUpdatedByLocation=!1;
var a=lb(c.url()),b=lb(l.absUrl()),f=c.state(),g=l.$$replace,m=a!==b||l.$$html5&&e.history&&f!==l.$$state;if(C||m)C=!1,d.$evalAsync(function(){var b=l.absUrl(),c=d.$broadcast("$locationChangeStart",b,a,l.$$state,f).defaultPrevented;l.absUrl()===b&&(c?(l.$$parse(a),l.$$state=f):(m&&k(b,g,f===l.$$state?null:l.$$state),h(a,f)))})}l.$$replace=!1});return l}]}function Qf(){var a=!0,b=this;this.debugEnabled=function(b){return u(b)?(a=b,this):a};this.$get=["$window",function(d){function c(a){cc(a)&&(a.stack&&
f?a=a.message&&-1===a.stack.indexOf(a.message)?"Error: "+a.message+"\n"+a.stack:a.stack:a.sourceURL&&(a=a.message+"\n"+a.sourceURL+":"+a.line));return a}function e(a){var b=d.console||{},e=b[a]||b.log||x;return function(){var a=[];q(arguments,function(b){a.push(c(b))});return Function.prototype.apply.call(e,b,a)}}var f=Ca||/\bEdge\//.test(d.navigator&&d.navigator.userAgent);return{log:e("log"),info:e("info"),warn:e("warn"),error:e("error"),debug:function(){var c=e("debug");return function(){a&&c.apply(b,
arguments)}}()}}]}function Ig(a){return a+""}function Jg(a,b){return"undefined"!==typeof a?a:b}function Fd(a,b){return"undefined"===typeof a?b:"undefined"===typeof b?a:a+b}function Kg(a,b){switch(a.type){case r.MemberExpression:if(a.computed)return!1;break;case r.UnaryExpression:return 1;case r.BinaryExpression:return"+"!==a.operator?1:!1;case r.CallExpression:return!1}return void 0===b?Gd:b}function S(a,b,d){var c,e,f=a.isPure=Kg(a,d);switch(a.type){case r.Program:c=!0;q(a.body,function(a){S(a.expression,
b,f);c=c&&a.expression.constant});a.constant=c;break;case r.Literal:a.constant=!0;a.toWatch=[];break;case r.UnaryExpression:S(a.argument,b,f);a.constant=a.argument.constant;a.toWatch=a.argument.toWatch;break;case r.BinaryExpression:S(a.left,b,f);S(a.right,b,f);a.constant=a.left.constant&&a.right.constant;a.toWatch=a.left.toWatch.concat(a.right.toWatch);break;case r.LogicalExpression:S(a.left,b,f);S(a.right,b,f);a.constant=a.left.constant&&a.right.constant;a.toWatch=a.constant?[]:[a];break;case r.ConditionalExpression:S(a.test,
b,f);S(a.alternate,b,f);S(a.consequent,b,f);a.constant=a.test.constant&&a.alternate.constant&&a.consequent.constant;a.toWatch=a.constant?[]:[a];break;case r.Identifier:a.constant=!1;a.toWatch=[a];break;case r.MemberExpression:S(a.object,b,f);a.computed&&S(a.property,b,f);a.constant=a.object.constant&&(!a.computed||a.property.constant);a.toWatch=a.constant?[]:[a];break;case r.CallExpression:c=d=a.filter?!b(a.callee.name).$stateful:!1;e=[];q(a.arguments,function(a){S(a,b,f);c=c&&a.constant;e.push.apply(e,
a.toWatch)});a.constant=c;a.toWatch=d?e:[a];break;case r.AssignmentExpression:S(a.left,b,f);S(a.right,b,f);a.constant=a.left.constant&&a.right.constant;a.toWatch=[a];break;case r.ArrayExpression:c=!0;e=[];q(a.elements,function(a){S(a,b,f);c=c&&a.constant;e.push.apply(e,a.toWatch)});a.constant=c;a.toWatch=e;break;case r.ObjectExpression:c=!0;e=[];q(a.properties,function(a){S(a.value,b,f);c=c&&a.value.constant;e.push.apply(e,a.value.toWatch);a.computed&&(S(a.key,b,!1),c=c&&a.key.constant,e.push.apply(e,
a.key.toWatch))});a.constant=c;a.toWatch=e;break;case r.ThisExpression:a.constant=!1;a.toWatch=[];break;case r.LocalsExpression:a.constant=!1,a.toWatch=[]}}function Hd(a){if(1===a.length){a=a[0].expression;var b=a.toWatch;return 1!==b.length?b:b[0]!==a?b:void 0}}function Id(a){return a.type===r.Identifier||a.type===r.MemberExpression}function Jd(a){if(1===a.body.length&&Id(a.body[0].expression))return{type:r.AssignmentExpression,left:a.body[0].expression,right:{type:r.NGValueParameter},operator:"="}}
function Kd(a){this.$filter=a}function Ld(a){this.$filter=a}function Nb(a,b,d){this.ast=new r(a,d);this.astCompiler=d.csp?new Ld(b):new Kd(b)}function Bc(a){return z(a.valueOf)?a.valueOf():Lg.call(a)}function Rf(){var a=U(),b={"true":!0,"false":!1,"null":null,undefined:void 0},d,c;this.addLiteral=function(a,c){b[a]=c};this.setIdentifierFns=function(a,b){d=a;c=b;return this};this.$get=["$filter",function(e){function f(b,c){var d,f;switch(typeof b){case "string":return f=b=b.trim(),d=a[f],d||(d=new Ob(s),
d=(new Nb(d,e,s)).parse(b),a[f]=p(d)),t(d,c);case "function":return t(b,c);default:return t(x,c)}}function g(a,b,c){return null==a||null==b?a===b:"object"!==typeof a||(a=Bc(a),"object"!==typeof a||c)?a===b||a!==a&&b!==b:!1}function k(a,b,c,d,e){var f=d.inputs,h;if(1===f.length){var k=g,f=f[0];return a.$watch(function(a){var b=f(a);g(b,k,f.isPure)||(h=d(a,void 0,void 0,[b]),k=b&&Bc(b));return h},b,c,e)}for(var l=[],m=[],p=0,n=f.length;p<n;p++)l[p]=g,m[p]=null;return a.$watch(function(a){for(var b=
!1,c=0,e=f.length;c<e;c++){var k=f[c](a);if(b||(b=!g(k,l[c],f[c].isPure)))m[c]=k,l[c]=k&&Bc(k)}b&&(h=d(a,void 0,void 0,m));return h},b,c,e)}function h(a,b,c,d,e){function f(){h(m)&&k()}function g(a,b,c,d){m=t&&d?d[0]:n(a,b,c,d);h(m)&&a.$$postDigest(f);return s(m)}var h=d.literal?l:u,k,m,n=d.$$intercepted||d,s=d.$$interceptor||Qa,t=d.inputs&&!n.inputs;g.literal=d.literal;g.constant=d.constant;g.inputs=d.inputs;p(g);return k=a.$watch(g,b,c,e)}function l(a){var b=!0;q(a,function(a){u(a)||(b=!1)});return b}
function m(a,b,c,d){var e=a.$watch(function(a){e();return d(a)},b,c);return e}function p(a){a.constant?a.$$watchDelegate=m:a.oneTime?a.$$watchDelegate=h:a.inputs&&(a.$$watchDelegate=k);return a}function n(a,b){function c(d){return b(a(d))}c.$stateful=a.$stateful||b.$stateful;c.$$pure=a.$$pure&&b.$$pure;return c}function t(a,b){if(!b)return a;a.$$interceptor&&(b=n(a.$$interceptor,b),a=a.$$intercepted);var c=!1,d=function(d,e,f,g){d=c&&g?g[0]:a(d,e,f,g);return b(d)};d.$$intercepted=a;d.$$interceptor=
b;d.literal=a.literal;d.oneTime=a.oneTime;d.constant=a.constant;b.$stateful||(c=!a.inputs,d.inputs=a.inputs?a.inputs:[a],b.$$pure||(d.inputs=d.inputs.map(function(a){return a.isPure===Gd?function(b){return a(b)}:a})));return p(d)}var s={csp:Ba().noUnsafeEval,literals:za(b),isIdentifierStart:z(d)&&d,isIdentifierContinue:z(c)&&c};f.$$getAst=function(a){var b=new Ob(s);return(new Nb(b,e,s)).getAst(a).ast};return f}]}function Tf(){var a=!0;this.$get=["$rootScope","$exceptionHandler",function(b,d){return Md(function(a){b.$evalAsync(a)},
d,a)}];this.errorOnUnhandledRejections=function(b){return u(b)?(a=b,this):a}}function Uf(){var a=!0;this.$get=["$browser","$exceptionHandler",function(b,d){return Md(function(a){b.defer(a)},d,a)}];this.errorOnUnhandledRejections=function(b){return u(b)?(a=b,this):a}}function Md(a,b,d){function c(){return new e}function e(){var a=this.promise=new f;this.resolve=function(b){h(a,b)};this.reject=function(b){m(a,b)};this.notify=function(b){n(a,b)}}function f(){this.$$state={status:0}}function g(){for(;!K&&
u.length;){var a=u.shift();if(!a.pur){a.pur=!0;var c=a.value,c="Possibly unhandled rejection: "+("function"===typeof c?c.toString().replace(/ \{[\s\S]*$/,""):v(c)?"undefined":"string"!==typeof c?Ge(c,void 0):c);cc(a.value)?b(a.value,c):b(c)}}}function k(c){!d||c.pending||2!==c.status||c.pur||(0===K&&0===u.length&&a(g),u.push(c));!c.processScheduled&&c.pending&&(c.processScheduled=!0,++K,a(function(){var e,f,k;k=c.pending;c.processScheduled=!1;c.pending=void 0;try{for(var l=0,p=k.length;l<p;++l){c.pur=
!0;f=k[l][0];e=k[l][c.status];try{z(e)?h(f,e(c.value)):1===c.status?h(f,c.value):m(f,c.value)}catch(n){m(f,n),n&&!0===n.$$passToExceptionHandler&&b(n)}}}finally{--K,d&&0===K&&a(g)}}))}function h(a,b){a.$$state.status||(b===a?p(a,r("qcycle",b)):l(a,b))}function l(a,b){function c(b){g||(g=!0,l(a,b))}function d(b){g||(g=!0,p(a,b))}function e(b){n(a,b)}var f,g=!1;try{if(G(b)||z(b))f=b.then;z(f)?(a.$$state.status=-1,f.call(b,c,d,e)):(a.$$state.value=b,a.$$state.status=1,k(a.$$state))}catch(h){d(h)}}function m(a,
b){a.$$state.status||p(a,b)}function p(a,b){a.$$state.value=b;a.$$state.status=2;k(a.$$state)}function n(c,d){var e=c.$$state.pending;0>=c.$$state.status&&e&&e.length&&a(function(){for(var a,c,f=0,g=e.length;f<g;f++){c=e[f][0];a=e[f][3];try{n(c,z(a)?a(d):d)}catch(h){b(h)}}})}function t(a){var b=new f;m(b,a);return b}function s(a,b,c){var d=null;try{z(c)&&(d=c())}catch(e){return t(e)}return d&&z(d.then)?d.then(function(){return b(a)},t):b(a)}function C(a,b,c,d){var e=new f;h(e,a);return e.then(b,c,
d)}function w(a){if(!z(a))throw r("norslvr",a);var b=new f;a(function(a){h(b,a)},function(a){m(b,a)});return b}var r=L("$q",TypeError),K=0,u=[];P(f.prototype,{then:function(a,b,c){if(v(a)&&v(b)&&v(c))return this;var d=new f;this.$$state.pending=this.$$state.pending||[];this.$$state.pending.push([d,a,b,c]);0<this.$$state.status&&k(this.$$state);return d},"catch":function(a){return this.then(null,a)},"finally":function(a,b){return this.then(function(b){return s(b,A,a)},function(b){return s(b,t,a)},
b)}});var A=C;w.prototype=f.prototype;w.defer=c;w.reject=t;w.when=C;w.resolve=A;w.all=function(a){var b=new f,c=0,d=F(a)?[]:{};q(a,function(a,e){c++;C(a).then(function(a){d[e]=a;--c||h(b,d)},function(a){m(b,a)})});0===c&&h(b,d);return b};w.race=function(a){var b=c();q(a,function(a){C(a).then(b.resolve,b.reject)});return b.promise};return w}function cg(){this.$get=["$window","$timeout",function(a,b){var d=a.requestAnimationFrame||a.webkitRequestAnimationFrame,c=a.cancelAnimationFrame||a.webkitCancelAnimationFrame||
a.webkitCancelRequestAnimationFrame,e=!!d,f=e?function(a){var b=d(a);return function(){c(b)}}:function(a){var c=b(a,16.66,!1);return function(){b.cancel(c)}};f.supported=e;return f}]}function Sf(){function a(a){function b(){this.$$watchers=this.$$nextSibling=this.$$childHead=this.$$childTail=null;this.$$listeners={};this.$$listenerCount={};this.$$watchersCount=0;this.$id=++rb;this.$$ChildScope=null;this.$$suspended=!1}b.prototype=a;return b}var b=10,d=L("$rootScope"),c=null,e=null;this.digestTtl=
function(a){arguments.length&&(b=a);return b};this.$get=["$exceptionHandler","$parse","$browser",function(f,g,k){function h(a){a.currentScope.$$destroyed=!0}function l(a){9===Ca&&(a.$$childHead&&l(a.$$childHead),a.$$nextSibling&&l(a.$$nextSibling));a.$parent=a.$$nextSibling=a.$$prevSibling=a.$$childHead=a.$$childTail=a.$root=a.$$watchers=null}function m(){this.$id=++rb;this.$$phase=this.$parent=this.$$watchers=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=null;this.$root=
this;this.$$suspended=this.$$destroyed=!1;this.$$listeners={};this.$$listenerCount={};this.$$watchersCount=0;this.$$isolateBindings=null}function p(a){if(r.$$phase)throw d("inprog",r.$$phase);r.$$phase=a}function n(a,b){do a.$$watchersCount+=b;while(a=a.$parent)}function t(a,b,c){do a.$$listenerCount[c]-=b,0===a.$$listenerCount[c]&&delete a.$$listenerCount[c];while(a=a.$parent)}function s(){}function C(){for(;A.length;)try{A.shift()()}catch(a){f(a)}e=null}function w(){null===e&&(e=k.defer(function(){r.$apply(C)}))}
m.prototype={constructor:m,$new:function(b,c){var d;c=c||this;b?(d=new m,d.$root=this.$root):(this.$$ChildScope||(this.$$ChildScope=a(this)),d=new this.$$ChildScope);d.$parent=c;d.$$prevSibling=c.$$childTail;c.$$childHead?(c.$$childTail.$$nextSibling=d,c.$$childTail=d):c.$$childHead=c.$$childTail=d;(b||c!==this)&&d.$on("$destroy",h);return d},$watch:function(a,b,d,e){var f=g(a);b=z(b)?b:x;if(f.$$watchDelegate)return f.$$watchDelegate(this,b,d,f,a);var h=this,k=h.$$watchers,l={fn:b,last:s,get:f,exp:e||
a,eq:!!d};c=null;k||(k=h.$$watchers=[],k.$$digestWatchIndex=-1);k.unshift(l);k.$$digestWatchIndex++;n(this,1);return function(){var a=db(k,l);0<=a&&(n(h,-1),a<k.$$digestWatchIndex&&k.$$digestWatchIndex--);c=null}},$watchGroup:function(a,b){function c(){h=!1;try{k?(k=!1,b(e,e,g)):b(e,d,g)}finally{for(var f=0;f<a.length;f++)d[f]=e[f]}}var d=Array(a.length),e=Array(a.length),f=[],g=this,h=!1,k=!0;if(!a.length){var l=!0;g.$evalAsync(function(){l&&b(e,e,g)});return function(){l=!1}}if(1===a.length)return this.$watch(a[0],
function(a,c,f){e[0]=a;d[0]=c;b(e,a===c?e:d,f)});q(a,function(a,b){var d=g.$watch(a,function(a){e[b]=a;h||(h=!0,g.$evalAsync(c))});f.push(d)});return function(){for(;f.length;)f.shift()()}},$watchCollection:function(a,b){function c(a){e=a;var b,d,g,h;if(!v(e)){if(G(e))if(ra(e))for(f!==p&&(f=p,t=f.length=0,l++),a=e.length,t!==a&&(l++,f.length=t=a),b=0;b<a;b++)h=f[b],g=e[b],d=h!==h&&g!==g,d||h===g||(l++,f[b]=g);else{f!==n&&(f=n={},t=0,l++);a=0;for(b in e)sa.call(e,b)&&(a++,g=e[b],h=f[b],b in f?(d=h!==h&&g!==g,d||h===g||(l++,f[b]=g)):(t++,f[b]=g,l++));if(t>a)for(b in l++,f)sa.call(e,b)||(t--,delete f[b])}else f!==e&&(f=e,l++);return l}}c.$$pure=g(a).literal;c.$stateful=!c.$$pure;var d=this,e,f,h,k=1<b.length,l=0,m=g(a,c),p=[],n={},s=!0,t=0;return this.$watch(m,function(){s?(s=!1,b(e,e,d)):b(e,h,d);if(k)if(G(e))if(ra(e)){h=Array(e.length);for(var a=0;a<e.length;a++)h[a]=e[a]}else for(a in h={},e)sa.call(e,a)&&(h[a]=e[a]);else h=e})},$digest:function(){var a,g,h,l,m,n,t,q=b,w,A=K.length?r:this,v=
[],y,x;p("$digest");k.$$checkUrlChange();this===r&&null!==e&&(k.defer.cancel(e),C());c=null;do{t=!1;w=A;for(n=0;n<K.length;n++){try{x=K[n],l=x.fn,l(x.scope,x.locals)}catch(D){f(D)}c=null}K.length=0;a:do{if(n=!w.$$suspended&&w.$$watchers)for(n.$$digestWatchIndex=n.length;n.$$digestWatchIndex--;)try{if(a=n[n.$$digestWatchIndex])if(m=a.get,(g=m(w))!==(h=a.last)&&!(a.eq?ua(g,h):ha(g)&&ha(h)))t=!0,c=a,a.last=a.eq?za(g,null):g,l=a.fn,l(g,h===s?g:h,w),5>q&&(y=4-q,v[y]||(v[y]=[]),v[y].push({msg:z(a.exp)?
"fn: "+(a.exp.name||a.exp.toString()):a.exp,newVal:g,oldVal:h}));else if(a===c){t=!1;break a}}catch(B){f(B)}if(!(n=!w.$$suspended&&w.$$watchersCount&&w.$$childHead||w!==A&&w.$$nextSibling))for(;w!==A&&!(n=w.$$nextSibling);)w=w.$parent}while(w=n);if((t||K.length)&&!q--)throw r.$$phase=null,d("infdig",b,v);}while(t||K.length);for(r.$$phase=null;E<u.length;)try{u[E++]()}catch(G){f(G)}u.length=E=0;k.$$checkUrlChange()},$suspend:function(){this.$$suspended=!0},$isSuspended:function(){return this.$$suspended},
$resume:function(){this.$$suspended=!1},$destroy:function(){if(!this.$$destroyed){var a=this.$parent;this.$broadcast("$destroy");this.$$destroyed=!0;this===r&&k.$$applicationDestroyed();n(this,-this.$$watchersCount);for(var b in this.$$listenerCount)t(this,this.$$listenerCount[b],b);a&&a.$$childHead===this&&(a.$$childHead=this.$$nextSibling);a&&a.$$childTail===this&&(a.$$childTail=this.$$prevSibling);this.$$prevSibling&&(this.$$prevSibling.$$nextSibling=this.$$nextSibling);this.$$nextSibling&&(this.$$nextSibling.$$prevSibling=
this.$$prevSibling);this.$destroy=this.$digest=this.$apply=this.$evalAsync=this.$applyAsync=x;this.$on=this.$watch=this.$watchGroup=function(){return x};this.$$listeners={};this.$$nextSibling=null;l(this)}},$eval:function(a,b){return g(a)(this,b)},$evalAsync:function(a,b){r.$$phase||K.length||k.defer(function(){K.length&&r.$digest()});K.push({scope:this,fn:g(a),locals:b})},$$postDigest:function(a){u.push(a)},$apply:function(a){try{p("$apply");try{return this.$eval(a)}finally{r.$$phase=null}}catch(b){f(b)}finally{try{r.$digest()}catch(c){throw f(c),
c;}}},$applyAsync:function(a){function b(){c.$eval(a)}var c=this;a&&A.push(b);a=g(a);w()},$on:function(a,b){var c=this.$$listeners[a];c||(this.$$listeners[a]=c=[]);c.push(b);var d=this;do d.$$listenerCount[a]||(d.$$listenerCount[a]=0),d.$$listenerCount[a]++;while(d=d.$parent);var e=this;return function(){var d=c.indexOf(b);-1!==d&&(delete c[d],t(e,1,a))}},$emit:function(a,b){var c=[],d,e=this,g=!1,h={name:a,targetScope:e,stopPropagation:function(){g=!0},preventDefault:function(){h.defaultPrevented=
!0},defaultPrevented:!1},k=eb([h],arguments,1),l,m;do{d=e.$$listeners[a]||c;h.currentScope=e;l=0;for(m=d.length;l<m;l++)if(d[l])try{d[l].apply(null,k)}catch(n){f(n)}else d.splice(l,1),l--,m--;if(g)break;e=e.$parent}while(e);h.currentScope=null;return h},$broadcast:function(a,b){var c=this,d=this,e={name:a,targetScope:this,preventDefault:function(){e.defaultPrevented=!0},defaultPrevented:!1};if(!this.$$listenerCount[a])return e;for(var g=eb([e],arguments,1),h,k;c=d;){e.currentScope=c;d=c.$$listeners[a]||
[];h=0;for(k=d.length;h<k;h++)if(d[h])try{d[h].apply(null,g)}catch(l){f(l)}else d.splice(h,1),h--,k--;if(!(d=c.$$listenerCount[a]&&c.$$childHead||c!==this&&c.$$nextSibling))for(;c!==this&&!(d=c.$$nextSibling);)c=c.$parent}e.currentScope=null;return e}};var r=new m,K=r.$$asyncQueue=[],u=r.$$postDigestQueue=[],A=r.$$applyAsyncQueue=[],E=0;return r}]}function Je(){var a=/^\s*(https?|s?ftp|mailto|tel|file):/,b=/^\s*((https?|ftp|file|blob):|data:image\/)/;this.aHrefSanitizationWhitelist=function(b){return u(b)?
(a=b,this):a};this.imgSrcSanitizationWhitelist=function(a){return u(a)?(b=a,this):b};this.$get=function(){return function(d,c){var e=c?b:a,f=oa(d&&d.trim()).href;return""===f||f.match(e)?d:"unsafe:"+f}}}function Mg(a){if("self"===a)return a;if(B(a)){if(-1<a.indexOf("***"))throw pa("iwcard",a);a=Nd(a).replace(/\\\*\\\*/g,".*").replace(/\\\*/g,"[^:/.?&;]*");return new RegExp("^"+a+"$")}if(bb(a))return new RegExp("^"+a.source+"$");throw pa("imatcher");}function Od(a){var b=[];u(a)&&q(a,function(a){b.push(Mg(a))});
return b}function Wf(){this.SCE_CONTEXTS=da;var a=["self"],b=[];this.resourceUrlWhitelist=function(b){arguments.length&&(a=Od(b));return a};this.resourceUrlBlacklist=function(a){arguments.length&&(b=Od(a));return b};this.$get=["$injector","$$sanitizeUri",function(d,c){function e(a,b){var c;"self"===a?(c=Cc(b,Pd))||(D.document.baseURI?c=D.document.baseURI:(Va||(Va=D.document.createElement("a"),Va.href=".",Va=Va.cloneNode(!1)),c=Va.href),c=Cc(b,c)):c=!!a.exec(b.href);return c}function f(a){var b=function(a){this.$$unwrapTrustedValue=
function(){return a}};a&&(b.prototype=new a);b.prototype.valueOf=function(){return this.$$unwrapTrustedValue()};b.prototype.toString=function(){return this.$$unwrapTrustedValue().toString()};return b}var g=function(a){throw pa("unsafe");};d.has("$sanitize")&&(g=d.get("$sanitize"));var k=f(),h={};h[da.HTML]=f(k);h[da.CSS]=f(k);h[da.MEDIA_URL]=f(k);h[da.URL]=f(h[da.MEDIA_URL]);h[da.JS]=f(k);h[da.RESOURCE_URL]=f(h[da.URL]);return{trustAs:function(a,b){var c=h.hasOwnProperty(a)?h[a]:null;if(!c)throw pa("icontext",
a,b);if(null===b||v(b)||""===b)return b;if("string"!==typeof b)throw pa("itype",a);return new c(b)},getTrusted:function(d,f){if(null===f||v(f)||""===f)return f;var k=h.hasOwnProperty(d)?h[d]:null;if(k&&f instanceof k)return f.$$unwrapTrustedValue();z(f.$$unwrapTrustedValue)&&(f=f.$$unwrapTrustedValue());if(d===da.MEDIA_URL||d===da.URL)return c(f,d===da.MEDIA_URL);if(d===da.RESOURCE_URL){var k=oa(f.toString()),n,t,s=!1;n=0;for(t=a.length;n<t;n++)if(e(a[n],k)){s=!0;break}if(s)for(n=0,t=b.length;n<t;n++)if(e(b[n],
k)){s=!1;break}if(s)return f;throw pa("insecurl",f.toString());}if(d===da.HTML)return g(f);throw pa("unsafe");},valueOf:function(a){return a instanceof k?a.$$unwrapTrustedValue():a}}}]}function Vf(){var a=!0;this.enabled=function(b){arguments.length&&(a=!!b);return a};this.$get=["$parse","$sceDelegate",function(b,d){if(a&&8>Ca)throw pa("iequirks");var c=ja(da);c.isEnabled=function(){return a};c.trustAs=d.trustAs;c.getTrusted=d.getTrusted;c.valueOf=d.valueOf;a||(c.trustAs=c.getTrusted=function(a,b){return b},
c.valueOf=Qa);c.parseAs=function(a,d){var e=b(d);return e.literal&&e.constant?e:b(d,function(b){return c.getTrusted(a,b)})};var e=c.parseAs,f=c.getTrusted,g=c.trustAs;q(da,function(a,b){var d=O(b);c[("parse_as_"+d).replace(Dc,yb)]=function(b){return e(a,b)};c[("get_trusted_"+d).replace(Dc,yb)]=function(b){return f(a,b)};c[("trust_as_"+d).replace(Dc,yb)]=function(b){return g(a,b)}});return c}]}function Xf(){this.$get=["$window","$document",function(a,b){var d={},c=!((!a.nw||!a.nw.process)&&a.chrome&&
(a.chrome.app&&a.chrome.app.runtime||!a.chrome.app&&a.chrome.runtime&&a.chrome.runtime.id))&&a.history&&a.history.pushState,e=ea((/android (\d+)/.exec(O((a.navigator||{}).userAgent))||[])[1]),f=/Boxee/i.test((a.navigator||{}).userAgent),g=b[0]||{},k=g.body&&g.body.style,h=!1,l=!1;k&&(h=!!("transition"in k||"webkitTransition"in k),l=!!("animation"in k||"webkitAnimation"in k));return{history:!(!c||4>e||f),hasEvent:function(a){if("input"===a&&Ca)return!1;if(v(d[a])){var b=g.createElement("div");d[a]=
"on"+a in b}return d[a]},csp:Ba(),transitions:h,animations:l,android:e}}]}function Zf(){var a;this.httpOptions=function(b){return b?(a=b,this):a};this.$get=["$exceptionHandler","$templateCache","$http","$q","$sce",function(b,d,c,e,f){function g(k,h){g.totalPendingRequests++;if(!B(k)||v(d.get(k)))k=f.getTrustedResourceUrl(k);var l=c.defaults&&c.defaults.transformResponse;F(l)?l=l.filter(function(a){return a!==vc}):l===vc&&(l=null);return c.get(k,P({cache:d,transformResponse:l},a)).finally(function(){g.totalPendingRequests--}).then(function(a){return d.put(k,
a.data)},function(a){h||(a=Ng("tpload",k,a.status,a.statusText),b(a));return e.reject(a)})}g.totalPendingRequests=0;return g}]}function $f(){this.$get=["$rootScope","$browser","$location",function(a,b,d){return{findBindings:function(a,b,d){a=a.getElementsByClassName("ng-binding");var g=[];q(a,function(a){var c=fa.element(a).data("$binding");c&&q(c,function(c){d?(new RegExp("(^|\\s)"+Nd(b)+"(\\s|\\||$)")).test(c)&&g.push(a):-1!==c.indexOf(b)&&g.push(a)})});return g},findModels:function(a,b,d){for(var g=
["ng-","data-ng-","ng\\:"],k=0;k<g.length;++k){var h=a.querySelectorAll("["+g[k]+"model"+(d?"=":"*=")+'"'+b+'"]');if(h.length)return h}},getLocation:function(){return d.url()},setLocation:function(b){b!==d.url()&&(d.url(b),a.$digest())},whenStable:function(a){b.notifyWhenNoOutstandingRequests(a)}}}]}function ag(){this.$get=["$rootScope","$browser","$q","$$q","$exceptionHandler",function(a,b,d,c,e){function f(f,h,l){z(f)||(l=h,h=f,f=x);var m=ya.call(arguments,3),p=u(l)&&!l,n=(p?c:d).defer(),t=n.promise,
s;s=b.defer(function(){try{n.resolve(f.apply(null,m))}catch(b){n.reject(b),e(b)}finally{delete g[t.$$timeoutId]}p||a.$apply()},h);t.$$timeoutId=s;g[s]=n;return t}var g={};f.cancel=function(a){if(!a)return!1;if(!a.hasOwnProperty("$$timeoutId"))throw Og("badprom");if(!g.hasOwnProperty(a.$$timeoutId))return!1;a=a.$$timeoutId;var c=g[a];c.promise.$$state.pur=!0;c.reject("canceled");delete g[a];return b.defer.cancel(a)};return f}]}function oa(a){if(!B(a))return a;Ca&&(T.setAttribute("href",a),a=T.href);
T.setAttribute("href",a);return{href:T.href,protocol:T.protocol?T.protocol.replace(/:$/,""):"",host:T.host,search:T.search?T.search.replace(/^\?/,""):"",hash:T.hash?T.hash.replace(/^#/,""):"",hostname:T.hostname,port:T.port,pathname:"/"===T.pathname.charAt(0)?T.pathname:"/"+T.pathname}}function Dg(a){var b=[Pd].concat(a.map(oa));return function(a){a=oa(a);return b.some(Cc.bind(null,a))}}function Cc(a,b){a=oa(a);b=oa(b);return a.protocol===b.protocol&&a.host===b.host}function bg(){this.$get=ia(D)}
function Qd(a){function b(a){try{return decodeURIComponent(a)}catch(b){return a}}var d=a[0]||{},c={},e="";return function(){var a,g,k,h,l;try{a=d.cookie||""}catch(m){a=""}if(a!==e)for(e=a,a=e.split("; "),c={},k=0;k<a.length;k++)g=a[k],h=g.indexOf("="),0<h&&(l=b(g.substring(0,h)),v(c[l])&&(c[l]=b(g.substring(h+1))));return c}}function fg(){this.$get=Qd}function ed(a){function b(d,c){if(G(d)){var e={};q(d,function(a,c){e[c]=b(c,a)});return e}return a.factory(d+"Filter",c)}this.register=b;this.$get=
["$injector",function(a){return function(b){return a.get(b+"Filter")}}];b("currency",Rd);b("date",Sd);b("filter",Pg);b("json",Qg);b("limitTo",Rg);b("lowercase",Sg);b("number",Td);b("orderBy",Ud);b("uppercase",Tg)}function Pg(){return function(a,b,d,c){if(!ra(a)){if(null==a)return a;throw L("filter")("notarray",a);}c=c||"$";var e;switch(Ec(b)){case "function":break;case "boolean":case "null":case "number":case "string":e=!0;case "object":b=Ug(b,d,c,e);break;default:return a}return Array.prototype.filter.call(a,
b)}}function Ug(a,b,d,c){var e=G(a)&&d in a;!0===b?b=ua:z(b)||(b=function(a,b){if(v(a))return!1;if(null===a||null===b)return a===b;if(G(b)||G(a)&&!bc(a))return!1;a=O(""+a);b=O(""+b);return-1!==a.indexOf(b)});return function(f){return e&&!G(f)?Ea(f,a[d],b,d,!1):Ea(f,a,b,d,c)}}function Ea(a,b,d,c,e,f){var g=Ec(a),k=Ec(b);if("string"===k&&"!"===b.charAt(0))return!Ea(a,b.substring(1),d,c,e);if(F(a))return a.some(function(a){return Ea(a,b,d,c,e)});switch(g){case "object":var h;if(e){for(h in a)if(h.charAt&&
"$"!==h.charAt(0)&&Ea(a[h],b,d,c,!0))return!0;return f?!1:Ea(a,b,d,c,!1)}if("object"===k){for(h in b)if(f=b[h],!z(f)&&!v(f)&&(g=h===c,!Ea(g?a:a[h],f,d,c,g,g)))return!1;return!0}return d(a,b);case "function":return!1;default:return d(a,b)}}function Ec(a){return null===a?"null":typeof a}function Rd(a){var b=a.NUMBER_FORMATS;return function(a,c,e){v(c)&&(c=b.CURRENCY_SYM);v(e)&&(e=b.PATTERNS[1].maxFrac);var f=c?/\u00A4/g:/\s*\u00A4\s*/g;return null==a?a:Vd(a,b.PATTERNS[1],b.GROUP_SEP,b.DECIMAL_SEP,e).replace(f,
c)}}function Td(a){var b=a.NUMBER_FORMATS;return function(a,c){return null==a?a:Vd(a,b.PATTERNS[0],b.GROUP_SEP,b.DECIMAL_SEP,c)}}function Vg(a){var b=0,d,c,e,f,g;-1<(c=a.indexOf(Wd))&&(a=a.replace(Wd,""));0<(e=a.search(/e/i))?(0>c&&(c=e),c+=+a.slice(e+1),a=a.substring(0,e)):0>c&&(c=a.length);for(e=0;a.charAt(e)===Fc;e++);if(e===(g=a.length))d=[0],c=1;else{for(g--;a.charAt(g)===Fc;)g--;c-=e;d=[];for(f=0;e<=g;e++,f++)d[f]=+a.charAt(e)}c>Xd&&(d=d.splice(0,Xd-1),b=c-1,c=1);return{d:d,e:b,i:c}}function Wg(a,
b,d,c){var e=a.d,f=e.length-a.i;b=v(b)?Math.min(Math.max(d,f),c):+b;d=b+a.i;c=e[d];if(0<d){e.splice(Math.max(a.i,d));for(var g=d;g<e.length;g++)e[g]=0}else for(f=Math.max(0,f),a.i=1,e.length=Math.max(1,d=b+1),e[0]=0,g=1;g<d;g++)e[g]=0;if(5<=c)if(0>d-1){for(c=0;c>d;c--)e.unshift(0),a.i++;e.unshift(1);a.i++}else e[d-1]++;for(;f<Math.max(0,b);f++)e.push(0);if(b=e.reduceRight(function(a,b,c,d){b+=a;d[c]=b%10;return Math.floor(b/10)},0))e.unshift(b),a.i++}function Vd(a,b,d,c,e){if(!B(a)&&!aa(a)||isNaN(a))return"";
var f=!isFinite(a),g=!1,k=Math.abs(a)+"",h="";if(f)h="\u221e";else{g=Vg(k);Wg(g,e,b.minFrac,b.maxFrac);h=g.d;k=g.i;e=g.e;f=[];for(g=h.reduce(function(a,b){return a&&!b},!0);0>k;)h.unshift(0),k++;0<k?f=h.splice(k,h.length):(f=h,h=[0]);k=[];for(h.length>=b.lgSize&&k.unshift(h.splice(-b.lgSize,h.length).join(""));h.length>b.gSize;)k.unshift(h.splice(-b.gSize,h.length).join(""));h.length&&k.unshift(h.join(""));h=k.join(d);f.length&&(h+=c+f.join(""));e&&(h+="e+"+e)}return 0>a&&!g?b.negPre+h+b.negSuf:b.posPre+
h+b.posSuf}function Pb(a,b,d,c){var e="";if(0>a||c&&0>=a)c?a=-a+1:(a=-a,e="-");for(a=""+a;a.length<b;)a=Fc+a;d&&(a=a.substr(a.length-b));return e+a}function X(a,b,d,c,e){d=d||0;return function(f){f=f["get"+a]();if(0<d||f>-d)f+=d;0===f&&-12===d&&(f=12);return Pb(f,b,c,e)}}function mb(a,b,d){return function(c,e){var f=c["get"+a](),g=wb((d?"STANDALONE":"")+(b?"SHORT":"")+a);return e[g][f]}}function Yd(a){var b=(new Date(a,0,1)).getDay();return new Date(a,0,(4>=b?5:12)-b)}function Zd(a){return function(b){var d=
Yd(b.getFullYear());b=+new Date(b.getFullYear(),b.getMonth(),b.getDate()+(4-b.getDay()))-+d;b=1+Math.round(b/6048E5);return Pb(b,a)}}function Gc(a,b){return 0>=a.getFullYear()?b.ERAS[0]:b.ERAS[1]}function Sd(a){function b(a){var b;if(b=a.match(d)){a=new Date(0);var f=0,g=0,k=b[8]?a.setUTCFullYear:a.setFullYear,h=b[8]?a.setUTCHours:a.setHours;b[9]&&(f=ea(b[9]+b[10]),g=ea(b[9]+b[11]));k.call(a,ea(b[1]),ea(b[2])-1,ea(b[3]));f=ea(b[4]||0)-f;g=ea(b[5]||0)-g;k=ea(b[6]||0);b=Math.round(1E3*parseFloat("0."+
(b[7]||0)));h.call(a,f,g,k,b)}return a}var d=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;return function(c,d,f){var g="",k=[],h,l;d=d||"mediumDate";d=a.DATETIME_FORMATS[d]||d;B(c)&&(c=Xg.test(c)?ea(c):b(c));aa(c)&&(c=new Date(c));if(!$(c)||!isFinite(c.getTime()))return c;for(;d;)(l=Yg.exec(d))?(k=eb(k,l,1),d=k.pop()):(k.push(d),d=null);var m=c.getTimezoneOffset();f&&(m=ec(f,m),c=fc(c,f,!0));q(k,function(b){h=Zg[b];g+=h?h(c,a.DATETIME_FORMATS,
m):"''"===b?"'":b.replace(/(^'|'$)/g,"").replace(/''/g,"'")});return g}}function Qg(){return function(a,b){v(b)&&(b=2);return fb(a,b)}}function Rg(){return function(a,b,d){b=Infinity===Math.abs(Number(b))?Number(b):ea(b);if(ha(b))return a;aa(a)&&(a=a.toString());if(!ra(a))return a;d=!d||isNaN(d)?0:ea(d);d=0>d?Math.max(0,a.length+d):d;return 0<=b?Hc(a,d,d+b):0===d?Hc(a,b,a.length):Hc(a,Math.max(0,d+b),d)}}function Hc(a,b,d){return B(a)?a.slice(b,d):ya.call(a,b,d)}function Ud(a){function b(b){return b.map(function(b){var c=
1,d=Qa;if(z(b))d=b;else if(B(b)){if("+"===b.charAt(0)||"-"===b.charAt(0))c="-"===b.charAt(0)?-1:1,b=b.substring(1);if(""!==b&&(d=a(b),d.constant))var e=d(),d=function(a){return a[e]}}return{get:d,descending:c}})}function d(a){switch(typeof a){case "number":case "boolean":case "string":return!0;default:return!1}}function c(a,b){var c=0,d=a.type,h=b.type;if(d===h){var h=a.value,l=b.value;"string"===d?(h=h.toLowerCase(),l=l.toLowerCase()):"object"===d&&(G(h)&&(h=a.index),G(l)&&(l=b.index));h!==l&&(c=
h<l?-1:1)}else c="undefined"===d?1:"undefined"===h?-1:"null"===d?1:"null"===h?-1:d<h?-1:1;return c}return function(a,f,g,k){if(null==a)return a;if(!ra(a))throw L("orderBy")("notarray",a);F(f)||(f=[f]);0===f.length&&(f=["+"]);var h=b(f),l=g?-1:1,m=z(k)?k:c;a=Array.prototype.map.call(a,function(a,b){return{value:a,tieBreaker:{value:b,type:"number",index:b},predicateValues:h.map(function(c){var e=c.get(a);c=typeof e;if(null===e)c="null";else if("object"===c)a:{if(z(e.valueOf)&&(e=e.valueOf(),d(e)))break a;
bc(e)&&(e=e.toString(),d(e))}return{value:e,type:c,index:b}})}});a.sort(function(a,b){for(var d=0,e=h.length;d<e;d++){var f=m(a.predicateValues[d],b.predicateValues[d]);if(f)return f*h[d].descending*l}return(m(a.tieBreaker,b.tieBreaker)||c(a.tieBreaker,b.tieBreaker))*l});return a=a.map(function(a){return a.value})}}function Wa(a){z(a)&&(a={link:a});a.restrict=a.restrict||"AC";return ia(a)}function Qb(a,b,d,c,e){this.$$controls=[];this.$error={};this.$$success={};this.$pending=void 0;this.$name=e(b.name||
b.ngForm||"")(d);this.$dirty=!1;this.$valid=this.$pristine=!0;this.$submitted=this.$invalid=!1;this.$$parentForm=nb;this.$$element=a;this.$$animate=c;$d(this)}function $d(a){a.$$classCache={};a.$$classCache[ae]=!(a.$$classCache[ob]=a.$$element.hasClass(ob))}function be(a){function b(a,b,c){c&&!a.$$classCache[b]?(a.$$animate.addClass(a.$$element,b),a.$$classCache[b]=!0):!c&&a.$$classCache[b]&&(a.$$animate.removeClass(a.$$element,b),a.$$classCache[b]=!1)}function d(a,c,d){c=c?"-"+Wc(c,"-"):"";b(a,ob+
c,!0===d);b(a,ae+c,!1===d)}var c=a.set,e=a.unset;a.clazz.prototype.$setValidity=function(a,g,k){v(g)?(this.$pending||(this.$pending={}),c(this.$pending,a,k)):(this.$pending&&e(this.$pending,a,k),ce(this.$pending)&&(this.$pending=void 0));Ga(g)?g?(e(this.$error,a,k),c(this.$$success,a,k)):(c(this.$error,a,k),e(this.$$success,a,k)):(e(this.$error,a,k),e(this.$$success,a,k));this.$pending?(b(this,"ng-pending",!0),this.$valid=this.$invalid=void 0,d(this,"",null)):(b(this,"ng-pending",!1),this.$valid=
ce(this.$error),this.$invalid=!this.$valid,d(this,"",this.$valid));g=this.$pending&&this.$pending[a]?void 0:this.$error[a]?!1:this.$$success[a]?!0:null;d(this,a,g);this.$$parentForm.$setValidity(a,g,this)}}function ce(a){if(a)for(var b in a)if(a.hasOwnProperty(b))return!1;return!0}function Ic(a){a.$formatters.push(function(b){return a.$isEmpty(b)?b:b.toString()})}function Xa(a,b,d,c,e,f){var g=O(b[0].type);if(!e.android){var k=!1;b.on("compositionstart",function(){k=!0});b.on("compositionupdate",
function(a){if(v(a.data)||""===a.data)k=!1});b.on("compositionend",function(){k=!1;l()})}var h,l=function(a){h&&(f.defer.cancel(h),h=null);if(!k){var e=b.val();a=a&&a.type;"password"===g||d.ngTrim&&"false"===d.ngTrim||(e=Q(e));(c.$viewValue!==e||""===e&&c.$$hasNativeValidators)&&c.$setViewValue(e,a)}};if(e.hasEvent("input"))b.on("input",l);else{var m=function(a,b,c){h||(h=f.defer(function(){h=null;b&&b.value===c||l(a)}))};b.on("keydown",function(a){var b=a.keyCode;91===b||15<b&&19>b||37<=b&&40>=b||
m(a,this,this.value)});if(e.hasEvent("paste"))b.on("paste cut drop",m)}b.on("change",l);if(de[g]&&c.$$hasNativeValidators&&g===d.type)b.on("keydown wheel mousedown",function(a){if(!h){var b=this.validity,c=b.badInput,d=b.typeMismatch;h=f.defer(function(){h=null;b.badInput===c&&b.typeMismatch===d||l(a)})}});c.$render=function(){var a=c.$isEmpty(c.$viewValue)?"":c.$viewValue;b.val()!==a&&b.val(a)}}function Rb(a,b){return function(d,c){var e,f;if($(d))return d;if(B(d)){'"'===d.charAt(0)&&'"'===d.charAt(d.length-
1)&&(d=d.substring(1,d.length-1));if($g.test(d))return new Date(d);a.lastIndex=0;if(e=a.exec(d))return e.shift(),f=c?{yyyy:c.getFullYear(),MM:c.getMonth()+1,dd:c.getDate(),HH:c.getHours(),mm:c.getMinutes(),ss:c.getSeconds(),sss:c.getMilliseconds()/1E3}:{yyyy:1970,MM:1,dd:1,HH:0,mm:0,ss:0,sss:0},q(e,function(a,c){c<b.length&&(f[b[c]]=+a)}),e=new Date(f.yyyy,f.MM-1,f.dd,f.HH,f.mm,f.ss||0,1E3*f.sss||0),100>f.yyyy&&e.setFullYear(f.yyyy),e}return NaN}}function pb(a,b,d,c){return function(e,f,g,k,h,l,m){function p(a){return a&&
!(a.getTime&&a.getTime()!==a.getTime())}function n(a){return u(a)&&!$(a)?t(a)||void 0:a}function t(a,b){var c=k.$options.getOption("timezone");q&&q!==c&&(b=Tc(b,ec(q)));var e=d(a,b);!isNaN(e)&&c&&(e=fc(e,c));return e}Jc(e,f,g,k,a);Xa(e,f,g,k,h,l);var s,q;k.$parsers.push(function(c){if(k.$isEmpty(c))return null;if(b.test(c))return t(c,s);k.$$parserName=a});k.$formatters.push(function(a){if(a&&!$(a))throw qb("datefmt",a);if(p(a)){s=a;var b=k.$options.getOption("timezone");b&&(q=b,s=fc(s,b,!0));return m("date")(a,
c,b)}q=s=null;return""});if(u(g.min)||g.ngMin){var w;k.$validators.min=function(a){return!p(a)||v(w)||d(a)>=w};g.$observe("min",function(a){w=n(a);k.$validate()})}if(u(g.max)||g.ngMax){var r;k.$validators.max=function(a){return!p(a)||v(r)||d(a)<=r};g.$observe("max",function(a){r=n(a);k.$validate()})}}}function Jc(a,b,d,c,e){(c.$$hasNativeValidators=G(b[0].validity))&&c.$parsers.push(function(a){var d=b.prop("validity")||{};if(d.badInput||d.typeMismatch)c.$$parserName=e;else return a})}function ee(a){a.$parsers.push(function(b){if(a.$isEmpty(b))return null;
if(ah.test(b))return parseFloat(b);a.$$parserName="number"});a.$formatters.push(function(b){if(!a.$isEmpty(b)){if(!aa(b))throw qb("numfmt",b);b=b.toString()}return b})}function Ya(a){u(a)&&!aa(a)&&(a=parseFloat(a));return ha(a)?void 0:a}function Kc(a){var b=a.toString(),d=b.indexOf(".");return-1===d?-1<a&&1>a&&(a=/e-(\d+)$/.exec(b))?Number(a[1]):0:b.length-d-1}function fe(a,b,d){a=Number(a);var c=(a|0)!==a,e=(b|0)!==b,f=(d|0)!==d;if(c||e||f){var g=c?Kc(a):0,k=e?Kc(b):0,h=f?Kc(d):0,g=Math.max(g,k,
h),g=Math.pow(10,g);a*=g;b*=g;d*=g;c&&(a=Math.round(a));e&&(b=Math.round(b));f&&(d=Math.round(d))}return 0===(a-b)%d}function ge(a,b,d,c,e){if(u(c)){a=a(c);if(!a.constant)throw qb("constexpr",d,c);return a(b)}return e}function Lc(a,b){function d(a,b){if(!a||!a.length)return[];if(!b||!b.length)return a;var c=[],d=0;a:for(;d<a.length;d++){for(var e=a[d],m=0;m<b.length;m++)if(e===b[m])continue a;c.push(e)}return c}function c(a){var b=a;F(a)?b=a.map(c).join(" "):G(a)&&(b=Object.keys(a).filter(function(b){return a[b]}).join(" "));
return b}a="ngClass"+a;var e;return["$parse",function(f){return{restrict:"AC",link:function(g,k,h){function l(a,b){var c=[];q(a,function(a){if(0<b||p[a])p[a]=(p[a]||0)+b,p[a]===+(0<b)&&c.push(a)});return c.join(" ")}function m(a){if(a===b){var c=t,c=l(c&&c.split(" "),1);h.$addClass(c)}else c=t,c=l(c&&c.split(" "),-1),h.$removeClass(c);n=a}var p=k.data("$classCounts"),n=!0,t;p||(p=U(),k.data("$classCounts",p));"ngClass"!==a&&(e||(e=f("$index",function(a){return a&1})),g.$watch(e,m));g.$watch(f(h[a],
c),function(a){if(n===b){var c=t&&t.split(" "),e=a&&a.split(" "),f=d(c,e),c=d(e,c),f=l(f,-1),c=l(c,1);h.$addClass(c);h.$removeClass(f)}t=a})}}}]}function Sb(a,b,d,c,e,f,g,k,h){this.$modelValue=this.$viewValue=Number.NaN;this.$$rawModelValue=void 0;this.$validators={};this.$asyncValidators={};this.$parsers=[];this.$formatters=[];this.$viewChangeListeners=[];this.$untouched=!0;this.$touched=!1;this.$pristine=!0;this.$dirty=!1;this.$valid=!0;this.$invalid=!1;this.$error={};this.$$success={};this.$pending=
void 0;this.$name=h(d.name||"",!1)(a);this.$$parentForm=nb;this.$options=Tb;this.$$updateEvents="";this.$$updateEventHandler=this.$$updateEventHandler.bind(this);this.$$parsedNgModel=e(d.ngModel);this.$$parsedNgModelAssign=this.$$parsedNgModel.assign;this.$$ngModelGet=this.$$parsedNgModel;this.$$ngModelSet=this.$$parsedNgModelAssign;this.$$pendingDebounce=null;this.$$parserValid=void 0;this.$$parserName="parse";this.$$currentValidationRunId=0;this.$$scope=a;this.$$rootScope=a.$root;this.$$attr=d;
this.$$element=c;this.$$animate=f;this.$$timeout=g;this.$$parse=e;this.$$q=k;this.$$exceptionHandler=b;$d(this);bh(this)}function bh(a){a.$$scope.$watch(function(b){b=a.$$ngModelGet(b);b===a.$modelValue||a.$modelValue!==a.$modelValue&&b!==b||a.$$setModelValue(b);return b})}function Mc(a){this.$$options=a}function he(a,b){q(b,function(b,c){u(a[c])||(a[c]=b)})}function Fa(a,b){a.prop("selected",b);a.attr("selected",b)}var Wb={objectMaxDepth:5,urlErrorParamsEnabled:!0},ch=/^\/(.+)\/([a-z]*)$/,sa=Object.prototype.hasOwnProperty,
O=function(a){return B(a)?a.toLowerCase():a},wb=function(a){return B(a)?a.toUpperCase():a},Ca,y,tb,ya=[].slice,zg=[].splice,dh=[].push,ga=Object.prototype.toString,Qc=Object.getPrototypeOf,Ha=L("ng"),fa=D.angular||(D.angular={}),jc,rb=0;Ca=D.document.documentMode;var ha=Number.isNaN||function(a){return a!==a};x.$inject=[];Qa.$inject=[];var ue=/^\[object (?:Uint8|Uint8Clamped|Uint16|Uint32|Int8|Int16|Int32|Float32|Float64)Array]$/,Q=function(a){return B(a)?a.trim():a},Nd=function(a){return a.replace(/([-()[\]{}+?*.$^|,:#<!\\])/g,
"\\$1").replace(/\x08/g,"\\x08")},Ba=function(){if(!u(Ba.rules)){var a=D.document.querySelector("[ng-csp]")||D.document.querySelector("[data-ng-csp]");if(a){var b=a.getAttribute("ng-csp")||a.getAttribute("data-ng-csp");Ba.rules={noUnsafeEval:!b||-1!==b.indexOf("no-unsafe-eval"),noInlineStyle:!b||-1!==b.indexOf("no-inline-style")}}else{a=Ba;try{new Function(""),b=!1}catch(d){b=!0}a.rules={noUnsafeEval:b,noInlineStyle:!1}}}return Ba.rules},sb=function(){if(u(sb.name_))return sb.name_;var a,b,d=Ia.length,
c,e;for(b=0;b<d;++b)if(c=Ia[b],a=D.document.querySelector("["+c.replace(":","\\:")+"jq]")){e=a.getAttribute(c+"jq");break}return sb.name_=e},we=/:/g,Ia=["ng-","data-ng-","ng:","x-ng-"],ze=function(a){var b=a.currentScript;if(!b)return!0;if(!(b instanceof D.HTMLScriptElement||b instanceof D.SVGScriptElement))return!1;b=b.attributes;return[b.getNamedItem("src"),b.getNamedItem("href"),b.getNamedItem("xlink:href")].every(function(b){if(!b)return!0;if(!b.value)return!1;var c=a.createElement("a");c.href=
b.value;if(a.location.origin===c.origin)return!0;switch(c.protocol){case "http:":case "https:":case "ftp:":case "blob:":case "file:":case "data:":return!0;default:return!1}})}(D.document),Ce=/[A-Z]/g,Xc=!1,Ma=3,Ie={full:"1.7.2",major:1,minor:7,dot:2,codeName:"extreme-compatiplication"};W.expando="ng339";var Oa=W.cache={},kg=1;W._data=function(a){return this.cache[a[this.expando]]||{}};var gg=/-([a-z])/g,eh=/^-ms-/,Cb={mouseleave:"mouseout",mouseenter:"mouseover"},mc=L("jqLite"),jg=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,
lc=/<|&#?\w+;/,hg=/<([\w:-]+)/,ig=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,na={option:[1,'<select multiple="multiple">',"</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};na.optgroup=na.option;na.tbody=na.tfoot=na.colgroup=na.caption=na.thead;na.th=na.td;var pg=D.Node.prototype.contains||function(a){return!!(this.compareDocumentPosition(a)&
16)},Sa=W.prototype={ready:gd,toString:function(){var a=[];q(this,function(b){a.push(""+b)});return"["+a.join(", ")+"]"},eq:function(a){return 0<=a?y(this[a]):y(this[this.length+a])},length:0,push:dh,sort:[].sort,splice:[].splice},Ib={};q("multiple selected checked disabled readOnly required open".split(" "),function(a){Ib[O(a)]=a});var nd={};q("input select option textarea button form details".split(" "),function(a){nd[a]=!0});var ud={ngMinlength:"minlength",ngMaxlength:"maxlength",ngMin:"min",ngMax:"max",
ngPattern:"pattern",ngStep:"step"};q({data:qc,removeData:pc,hasData:function(a){for(var b in Oa[a.ng339])return!0;return!1},cleanData:function(a){for(var b=0,d=a.length;b<d;b++)pc(a[b]),jd(a[b])}},function(a,b){W[b]=a});q({data:qc,inheritedData:Gb,scope:function(a){return y.data(a,"$scope")||Gb(a.parentNode||a,["$isolateScope","$scope"])},isolateScope:function(a){return y.data(a,"$isolateScope")||y.data(a,"$isolateScopeNoTemplate")},controller:kd,injector:function(a){return Gb(a,"$injector")},removeAttr:function(a,
b){a.removeAttribute(b)},hasClass:Db,css:function(a,b,d){b=zb(b.replace(eh,"ms-"));if(u(d))a.style[b]=d;else return a.style[b]},attr:function(a,b,d){var c=a.nodeType;if(c!==Ma&&2!==c&&8!==c&&a.getAttribute){var c=O(b),e=Ib[c];if(u(d))null===d||!1===d&&e?a.removeAttribute(b):a.setAttribute(b,e?c:d);else return a=a.getAttribute(b),e&&null!==a&&(a=c),null===a?void 0:a}},prop:function(a,b,d){if(u(d))a[b]=d;else return a[b]},text:function(){function a(a,d){if(v(d)){var c=a.nodeType;return 1===c||c===Ma?
a.textContent:""}a.textContent=d}a.$dv="";return a}(),val:function(a,b){if(v(b)){if(a.multiple&&"select"===ta(a)){var d=[];q(a.options,function(a){a.selected&&d.push(a.value||a.text)});return d}return a.value}a.value=b},html:function(a,b){if(v(b))return a.innerHTML;Ab(a,!0);a.innerHTML=b},empty:ld},function(a,b){W.prototype[b]=function(b,c){var e,f,g=this.length;if(a!==ld&&v(2===a.length&&a!==Db&&a!==kd?b:c)){if(G(b)){for(e=0;e<g;e++)if(a===qc)a(this[e],b);else for(f in b)a(this[e],f,b[f]);return this}e=
a.$dv;g=v(e)?Math.min(g,1):g;for(f=0;f<g;f++){var k=a(this[f],b,c);e=e?e+k:k}return e}for(e=0;e<g;e++)a(this[e],b,c);return this}});q({removeData:pc,on:function(a,b,d,c){if(u(c))throw mc("onargs");if(kc(a)){c=Bb(a,!0);var e=c.events,f=c.handle;f||(f=c.handle=mg(a,e));c=0<=b.indexOf(" ")?b.split(" "):[b];for(var g=c.length,k=function(b,c,g){var k=e[b];k||(k=e[b]=[],k.specialHandlerWrapper=c,"$destroy"===b||g||a.addEventListener(b,f));k.push(d)};g--;)b=c[g],Cb[b]?(k(Cb[b],og),k(b,void 0,!0)):k(b)}},
off:jd,one:function(a,b,d){a=y(a);a.on(b,function e(){a.off(b,d);a.off(b,e)});a.on(b,d)},replaceWith:function(a,b){var d,c=a.parentNode;Ab(a);q(new W(b),function(b){d?c.insertBefore(b,d.nextSibling):c.replaceChild(b,a);d=b})},children:function(a){var b=[];q(a.childNodes,function(a){1===a.nodeType&&b.push(a)});return b},contents:function(a){return a.contentDocument||a.childNodes||[]},append:function(a,b){var d=a.nodeType;if(1===d||11===d){b=new W(b);for(var d=0,c=b.length;d<c;d++)a.appendChild(b[d])}},
prepend:function(a,b){if(1===a.nodeType){var d=a.firstChild;q(new W(b),function(b){a.insertBefore(b,d)})}},wrap:function(a,b){var d=y(b).eq(0).clone()[0],c=a.parentNode;c&&c.replaceChild(d,a);d.appendChild(a)},remove:Hb,detach:function(a){Hb(a,!0)},after:function(a,b){var d=a,c=a.parentNode;if(c){b=new W(b);for(var e=0,f=b.length;e<f;e++){var g=b[e];c.insertBefore(g,d.nextSibling);d=g}}},addClass:Fb,removeClass:Eb,toggleClass:function(a,b,d){b&&q(b.split(" "),function(b){var e=d;v(e)&&(e=!Db(a,b));
(e?Fb:Eb)(a,b)})},parent:function(a){return(a=a.parentNode)&&11!==a.nodeType?a:null},next:function(a){return a.nextElementSibling},find:function(a,b){return a.getElementsByTagName?a.getElementsByTagName(b):[]},clone:oc,triggerHandler:function(a,b,d){var c,e,f=b.type||b,g=Bb(a);if(g=(g=g&&g.events)&&g[f])c={preventDefault:function(){this.defaultPrevented=!0},isDefaultPrevented:function(){return!0===this.defaultPrevented},stopImmediatePropagation:function(){this.immediatePropagationStopped=!0},isImmediatePropagationStopped:function(){return!0===this.immediatePropagationStopped},stopPropagation:x,type:f,target:a},b.type&&(c=P(c,b)),b=ja(g),e=d?[c].concat(d):[c],q(b,function(b){c.isImmediatePropagationStopped()||b.apply(a,e)})}},function(a,b){W.prototype[b]=function(b,c,e){for(var f,g=0,k=this.length;g<k;g++)v(f)?(f=a(this[g],b,c,e),u(f)&&(f=y(f))):nc(f,a(this[g],b,c,e));return u(f)?f:this}});W.prototype.bind=W.prototype.on;W.prototype.unbind=W.prototype.off;var fh=Object.create(null);od.prototype={_idx:function(a){if(a===this._lastKey)return this._lastIndex;
this._lastKey=a;return this._lastIndex=this._keys.indexOf(a)},_transformKey:function(a){return ha(a)?fh:a},get:function(a){a=this._transformKey(a);a=this._idx(a);if(-1!==a)return this._values[a]},set:function(a,b){a=this._transformKey(a);var d=this._idx(a);-1===d&&(d=this._lastIndex=this._keys.length);this._keys[d]=a;this._values[d]=b},delete:function(a){a=this._transformKey(a);a=this._idx(a);if(-1===a)return!1;this._keys.splice(a,1);this._values.splice(a,1);this._lastKey=NaN;this._lastIndex=-1;return!0}};
var Jb=od,eg=[function(){this.$get=[function(){return Jb}]}],rg=/^([^(]+?)=>/,sg=/^[^(]*\(\s*([^)]*)\)/m,gh=/,/,hh=/^\s*(_?)(\S+?)\1\s*$/,qg=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg,Ja=L("$injector");hb.$$annotate=function(a,b,d){var c;if("function"===typeof a){if(!(c=a.$inject)){c=[];if(a.length){if(b)throw B(d)&&d||(d=a.name||tg(a)),Ja("strictdi",d);b=pd(a);q(b[1].split(gh),function(a){a.replace(hh,function(a,b,d){c.push(d)})})}a.$inject=c}}else F(a)?(b=a.length-1,ub(a[b],"fn"),c=a.slice(0,b)):ub(a,"fn",
!0);return c};var ie=L("$animate"),wf=function(){this.$get=x},xf=function(){var a=new Jb,b=[];this.$get=["$$AnimateRunner","$rootScope",function(d,c){function e(a,b,c){var d=!1;b&&(b=B(b)?b.split(" "):F(b)?b:[],q(b,function(b){b&&(d=!0,a[b]=c)}));return d}function f(){q(b,function(b){var c=a.get(b);if(c){var d=ug(b.attr("class")),e="",f="";q(c,function(a,b){a!==!!d[b]&&(a?e+=(e.length?" ":"")+b:f+=(f.length?" ":"")+b)});q(b,function(a){e&&Fb(a,e);f&&Eb(a,f)});a.delete(b)}});b.length=0}return{enabled:x,
on:x,off:x,pin:x,push:function(g,k,h,l){l&&l();h=h||{};h.from&&g.css(h.from);h.to&&g.css(h.to);if(h.addClass||h.removeClass)if(k=h.addClass,l=h.removeClass,h=a.get(g)||{},k=e(h,k,!0),l=e(h,l,!1),k||l)a.set(g,h),b.push(g),1===b.length&&c.$$postDigest(f);g=new d;g.complete();return g}}}]},uf=["$provide",function(a){var b=this,d=null,c=null;this.$$registeredAnimations=Object.create(null);this.register=function(c,d){if(c&&"."!==c.charAt(0))throw ie("notcsel",c);var g=c+"-animation";b.$$registeredAnimations[c.substr(1)]=
g;a.factory(g,d)};this.customFilter=function(a){1===arguments.length&&(c=z(a)?a:null);return c};this.classNameFilter=function(a){if(1===arguments.length&&(d=a instanceof RegExp?a:null)&&/[(\s|\/)]ng-animate[(\s|\/)]/.test(d.toString()))throw d=null,ie("nongcls","ng-animate");return d};this.$get=["$$animateQueue",function(a){function b(a,c,d){if(d){var e;a:{for(e=0;e<d.length;e++){var f=d[e];if(1===f.nodeType){e=f;break a}}e=void 0}!e||e.parentNode||e.previousElementSibling||(d=null)}d?d.after(a):
c.prepend(a)}return{on:a.on,off:a.off,pin:a.pin,enabled:a.enabled,cancel:function(a){a.cancel&&a.cancel()},enter:function(c,d,h,l){d=d&&y(d);h=h&&y(h);d=d||h.parent();b(c,d,h);return a.push(c,"enter",Ka(l))},move:function(c,d,h,l){d=d&&y(d);h=h&&y(h);d=d||h.parent();b(c,d,h);return a.push(c,"move",Ka(l))},leave:function(b,c){return a.push(b,"leave",Ka(c),function(){b.remove()})},addClass:function(b,c,d){d=Ka(d);d.addClass=jb(d.addclass,c);return a.push(b,"addClass",d)},removeClass:function(b,c,d){d=
Ka(d);d.removeClass=jb(d.removeClass,c);return a.push(b,"removeClass",d)},setClass:function(b,c,d,f){f=Ka(f);f.addClass=jb(f.addClass,c);f.removeClass=jb(f.removeClass,d);return a.push(b,"setClass",f)},animate:function(b,c,d,f,m){m=Ka(m);m.from=m.from?P(m.from,c):c;m.to=m.to?P(m.to,d):d;m.tempClasses=jb(m.tempClasses,f||"ng-inline-animate");return a.push(b,"animate",m)}}}]}],zf=function(){this.$get=["$$rAF",function(a){function b(b){d.push(b);1<d.length||a(function(){for(var a=0;a<d.length;a++)d[a]();
d=[]})}var d=[];return function(){var a=!1;b(function(){a=!0});return function(d){a?d():b(d)}}}]},yf=function(){this.$get=["$q","$sniffer","$$animateAsyncRun","$$isDocumentHidden","$timeout",function(a,b,d,c,e){function f(a){this.setHost(a);var b=d();this._doneCallbacks=[];this._tick=function(a){c()?e(a,0,!1):b(a)};this._state=0}f.chain=function(a,b){function c(){if(d===a.length)b(!0);else a[d](function(a){!1===a?b(!1):(d++,c())})}var d=0;c()};f.all=function(a,b){function c(f){e=e&&f;++d===a.length&&
b(e)}var d=0,e=!0;q(a,function(a){a.done(c)})};f.prototype={setHost:function(a){this.host=a||{}},done:function(a){2===this._state?a():this._doneCallbacks.push(a)},progress:x,getPromise:function(){if(!this.promise){var b=this;this.promise=a(function(a,c){b.done(function(b){!1===b?c():a()})})}return this.promise},then:function(a,b){return this.getPromise().then(a,b)},"catch":function(a){return this.getPromise()["catch"](a)},"finally":function(a){return this.getPromise()["finally"](a)},pause:function(){this.host.pause&&
this.host.pause()},resume:function(){this.host.resume&&this.host.resume()},end:function(){this.host.end&&this.host.end();this._resolve(!0)},cancel:function(){this.host.cancel&&this.host.cancel();this._resolve(!1)},complete:function(a){var b=this;0===b._state&&(b._state=1,b._tick(function(){b._resolve(a)}))},_resolve:function(a){2!==this._state&&(q(this._doneCallbacks,function(b){b(a)}),this._doneCallbacks.length=0,this._state=2)}};return f}]},vf=function(){this.$get=["$$rAF","$q","$$AnimateRunner",
function(a,b,d){return function(b,e){function f(){a(function(){g.addClass&&(b.addClass(g.addClass),g.addClass=null);g.removeClass&&(b.removeClass(g.removeClass),g.removeClass=null);g.to&&(b.css(g.to),g.to=null);k||h.complete();k=!0});return h}var g=e||{};g.$$prepared||(g=za(g));g.cleanupStyles&&(g.from=g.to=null);g.from&&(b.css(g.from),g.from=null);var k,h=new d;return{start:f,end:f}}}]},ba=L("$compile"),tc=new function(){};Yc.$inject=["$provide","$$sanitizeUriProvider"];Kb.prototype.isFirstChange=
function(){return this.previousValue===tc};var qd=/^((?:x|data)[:\-_])/i,yg=/[:\-_]+(.)/g,wd=L("$controller"),vd=/^(\S+)(\s+as\s+([\w$]+))?$/,Gf=function(){this.$get=["$document",function(a){return function(b){b?!b.nodeType&&b instanceof y&&(b=b[0]):b=a[0].body;return b.offsetWidth+1}}]},xd="application/json",wc={"Content-Type":xd+";charset=utf-8"},Bg=/^\[|^\{(?!\{)/,Cg={"[":/]$/,"{":/}$/},Ag=/^\)]\}',?\n/,Lb=L("$http"),ca=fa.$interpolateMinErr=L("$interpolate");ca.throwNoconcat=function(a){throw ca("noconcat",
a);};ca.interr=function(a,b){return ca("interr",a,b.toString())};var Fg=L("$interval"),Of=function(){this.$get=function(){function a(a){var b=function(a){b.data=a;b.called=!0};b.id=a;return b}var b=fa.callbacks,d={};return{createCallback:function(c){c="_"+(b.$$counter++).toString(36);var e="angular.callbacks."+c,f=a(c);d[e]=b[c]=f;return e},wasCalled:function(a){return d[a].called},getResponse:function(a){return d[a].data},removeCallback:function(a){delete b[d[a].id];delete d[a]}}}},ih=/^([^?#]*)(\?([^#]*))?(#(.*))?$/,
Gg={http:80,https:443,ftp:21},kb=L("$location"),Hg=/^\s*[\\/]{2,}/,jh={$$absUrl:"",$$html5:!1,$$replace:!1,absUrl:Mb("$$absUrl"),url:function(a){if(v(a))return this.$$url;var b=ih.exec(a);(b[1]||""===a)&&this.path(decodeURIComponent(b[1]));(b[2]||b[1]||""===a)&&this.search(b[3]||"");this.hash(b[5]||"");return this},protocol:Mb("$$protocol"),host:Mb("$$host"),port:Mb("$$port"),path:Ed("$$path",function(a){a=null!==a?a.toString():"";return"/"===a.charAt(0)?a:"/"+a}),search:function(a,b){switch(arguments.length){case 0:return this.$$search;
case 1:if(B(a)||aa(a))a=a.toString(),this.$$search=gc(a);else if(G(a))a=za(a,{}),q(a,function(b,c){null==b&&delete a[c]}),this.$$search=a;else throw kb("isrcharg");break;default:v(b)||null===b?delete this.$$search[a]:this.$$search[a]=b}this.$$compose();return this},hash:Ed("$$hash",function(a){return null!==a?a.toString():""}),replace:function(){this.$$replace=!0;return this}};q([Dd,Ac,zc],function(a){a.prototype=Object.create(jh);a.prototype.state=function(b){if(!arguments.length)return this.$$state;
if(a!==zc||!this.$$html5)throw kb("nostate");this.$$state=v(b)?null:b;this.$$urlUpdatedByLocation=!0;return this}});var Za=L("$parse"),Lg={}.constructor.prototype.valueOf,Ub=U();q("+ - * / %===!====!=< > <=>= && || ! = |".split(" "),function(a){Ub[a]=!0});var kh={n:"\n",f:"\f",r:"\r",t:"\t",v:"\v","'":"'",'"':'"'},Ob=function(a){this.options=a};Ob.prototype={constructor:Ob,lex:function(a){this.text=a;this.index=0;for(this.tokens=[];this.index<this.text.length;)if(a=this.text.charAt(this.index),
'"'===a||"'"===a)this.readString(a);else if(this.isNumber(a)||"."===a&&this.isNumber(this.peek()))this.readNumber();else if(this.isIdentifierStart(this.peekMultichar()))this.readIdent();else if(this.is(a,"(){}[].,;:?"))this.tokens.push({index:this.index,text:a}),this.index++;else if(this.isWhitespace(a))this.index++;else{var b=a+this.peek(),d=b+this.peek(2),c=Ub[b],e=Ub[d];Ub[a]||c||e?(a=e?d:c?b:a,this.tokens.push({index:this.index,text:a,operator:!0}),this.index+=a.length):this.throwError("Unexpected next character ",
this.index,this.index+1)}return this.tokens},is:function(a,b){return-1!==b.indexOf(a)},peek:function(a){a=a||1;return this.index+a<this.text.length?this.text.charAt(this.index+a):!1},isNumber:function(a){return"0"<=a&&"9">=a&&"string"===typeof a},isWhitespace:function(a){return" "===a||"\r"===a||"\t"===a||"\n"===a||"\v"===a||"\u00a0"===a},isIdentifierStart:function(a){return this.options.isIdentifierStart?this.options.isIdentifierStart(a,this.codePointAt(a)):this.isValidIdentifierStart(a)},isValidIdentifierStart:function(a){return"a"<=
a&&"z">=a||"A"<=a&&"Z">=a||"_"===a||"$"===a},isIdentifierContinue:function(a){return this.options.isIdentifierContinue?this.options.isIdentifierContinue(a,this.codePointAt(a)):this.isValidIdentifierContinue(a)},isValidIdentifierContinue:function(a,b){return this.isValidIdentifierStart(a,b)||this.isNumber(a)},codePointAt:function(a){return 1===a.length?a.charCodeAt(0):(a.charCodeAt(0)<<10)+a.charCodeAt(1)-56613888},peekMultichar:function(){var a=this.text.charAt(this.index),b=this.peek();if(!b)return a;
var d=a.charCodeAt(0),c=b.charCodeAt(0);return 55296<=d&&56319>=d&&56320<=c&&57343>=c?a+b:a},isExpOperator:function(a){return"-"===a||"+"===a||this.isNumber(a)},throwError:function(a,b,d){d=d||this.index;b=u(b)?"s "+b+"-"+this.index+" ["+this.text.substring(b,d)+"]":" "+d;throw Za("lexerr",a,b,this.text);},readNumber:function(){for(var a="",b=this.index;this.index<this.text.length;){var d=O(this.text.charAt(this.index));if("."===d||this.isNumber(d))a+=d;else{var c=this.peek();if("e"===d&&this.isExpOperator(c))a+=
d;else if(this.isExpOperator(d)&&c&&this.isNumber(c)&&"e"===a.charAt(a.length-1))a+=d;else if(!this.isExpOperator(d)||c&&this.isNumber(c)||"e"!==a.charAt(a.length-1))break;else this.throwError("Invalid exponent")}this.index++}this.tokens.push({index:b,text:a,constant:!0,value:Number(a)})},readIdent:function(){var a=this.index;for(this.index+=this.peekMultichar().length;this.index<this.text.length;){var b=this.peekMultichar();if(!this.isIdentifierContinue(b))break;this.index+=b.length}this.tokens.push({index:a,
text:this.text.slice(a,this.index),identifier:!0})},readString:function(a){var b=this.index;this.index++;for(var d="",c=a,e=!1;this.index<this.text.length;){var f=this.text.charAt(this.index),c=c+f;if(e)"u"===f?(e=this.text.substring(this.index+1,this.index+5),e.match(/[\da-f]{4}/i)||this.throwError("Invalid unicode escape [\\u"+e+"]"),this.index+=4,d+=String.fromCharCode(parseInt(e,16))):d+=kh[f]||f,e=!1;else if("\\"===f)e=!0;else{if(f===a){this.index++;this.tokens.push({index:b,text:c,constant:!0,
value:d});return}d+=f}this.index++}this.throwError("Unterminated quote",b)}};var r=function(a,b){this.lexer=a;this.options=b};r.Program="Program";r.ExpressionStatement="ExpressionStatement";r.AssignmentExpression="AssignmentExpression";r.ConditionalExpression="ConditionalExpression";r.LogicalExpression="LogicalExpression";r.BinaryExpression="BinaryExpression";r.UnaryExpression="UnaryExpression";r.CallExpression="CallExpression";r.MemberExpression="MemberExpression";r.Identifier="Identifier";r.Literal=
"Literal";r.ArrayExpression="ArrayExpression";r.Property="Property";r.ObjectExpression="ObjectExpression";r.ThisExpression="ThisExpression";r.LocalsExpression="LocalsExpression";r.NGValueParameter="NGValueParameter";r.prototype={ast:function(a){this.text=a;this.tokens=this.lexer.lex(a);a=this.program();0!==this.tokens.length&&this.throwError("is an unexpected token",this.tokens[0]);return a},program:function(){for(var a=[];;)if(0<this.tokens.length&&!this.peek("}",")",";","]")&&a.push(this.expressionStatement()),
!this.expect(";"))return{type:r.Program,body:a}},expressionStatement:function(){return{type:r.ExpressionStatement,expression:this.filterChain()}},filterChain:function(){for(var a=this.expression();this.expect("|");)a=this.filter(a);return a},expression:function(){return this.assignment()},assignment:function(){var a=this.ternary();if(this.expect("=")){if(!Id(a))throw Za("lval");a={type:r.AssignmentExpression,left:a,right:this.assignment(),operator:"="}}return a},ternary:function(){var a=this.logicalOR(),
b,d;return this.expect("?")&&(b=this.expression(),this.consume(":"))?(d=this.expression(),{type:r.ConditionalExpression,test:a,alternate:b,consequent:d}):a},logicalOR:function(){for(var a=this.logicalAND();this.expect("||");)a={type:r.LogicalExpression,operator:"||",left:a,right:this.logicalAND()};return a},logicalAND:function(){for(var a=this.equality();this.expect("&&");)a={type:r.LogicalExpression,operator:"&&",left:a,right:this.equality()};return a},equality:function(){for(var a=this.relational(),
b;b=this.expect("==","!=","===","!==");)a={type:r.BinaryExpression,operator:b.text,left:a,right:this.relational()};return a},relational:function(){for(var a=this.additive(),b;b=this.expect("<",">","<=",">=");)a={type:r.BinaryExpression,operator:b.text,left:a,right:this.additive()};return a},additive:function(){for(var a=this.multiplicative(),b;b=this.expect("+","-");)a={type:r.BinaryExpression,operator:b.text,left:a,right:this.multiplicative()};return a},multiplicative:function(){for(var a=this.unary(),
b;b=this.expect("*","/","%");)a={type:r.BinaryExpression,operator:b.text,left:a,right:this.unary()};return a},unary:function(){var a;return(a=this.expect("+","-","!"))?{type:r.UnaryExpression,operator:a.text,prefix:!0,argument:this.unary()}:this.primary()},primary:function(){var a;this.expect("(")?(a=this.filterChain(),this.consume(")")):this.expect("[")?a=this.arrayDeclaration():this.expect("{")?a=this.object():this.selfReferential.hasOwnProperty(this.peek().text)?a=za(this.selfReferential[this.consume().text]):
this.options.literals.hasOwnProperty(this.peek().text)?a={type:r.Literal,value:this.options.literals[this.consume().text]}:this.peek().identifier?a=this.identifier():this.peek().constant?a=this.constant():this.throwError("not a primary expression",this.peek());for(var b;b=this.expect("(","[",".");)"("===b.text?(a={type:r.CallExpression,callee:a,arguments:this.parseArguments()},this.consume(")")):"["===b.text?(a={type:r.MemberExpression,object:a,property:this.expression(),computed:!0},this.consume("]")):
"."===b.text?a={type:r.MemberExpression,object:a,property:this.identifier(),computed:!1}:this.throwError("IMPOSSIBLE");return a},filter:function(a){a=[a];for(var b={type:r.CallExpression,callee:this.identifier(),arguments:a,filter:!0};this.expect(":");)a.push(this.expression());return b},parseArguments:function(){var a=[];if(")"!==this.peekToken().text){do a.push(this.filterChain());while(this.expect(","))}return a},identifier:function(){var a=this.consume();a.identifier||this.throwError("is not a valid identifier",
a);return{type:r.Identifier,name:a.text}},constant:function(){return{type:r.Literal,value:this.consume().value}},arrayDeclaration:function(){var a=[];if("]"!==this.peekToken().text){do{if(this.peek("]"))break;a.push(this.expression())}while(this.expect(","))}this.consume("]");return{type:r.ArrayExpression,elements:a}},object:function(){var a=[],b;if("}"!==this.peekToken().text){do{if(this.peek("}"))break;b={type:r.Property,kind:"init"};this.peek().constant?(b.key=this.constant(),b.computed=!1,this.consume(":"),
b.value=this.expression()):this.peek().identifier?(b.key=this.identifier(),b.computed=!1,this.peek(":")?(this.consume(":"),b.value=this.expression()):b.value=b.key):this.peek("[")?(this.consume("["),b.key=this.expression(),this.consume("]"),b.computed=!0,this.consume(":"),b.value=this.expression()):this.throwError("invalid key",this.peek());a.push(b)}while(this.expect(","))}this.consume("}");return{type:r.ObjectExpression,properties:a}},throwError:function(a,b){throw Za("syntax",b.text,a,b.index+
1,this.text,this.text.substring(b.index));},consume:function(a){if(0===this.tokens.length)throw Za("ueoe",this.text);var b=this.expect(a);b||this.throwError("is unexpected, expecting ["+a+"]",this.peek());return b},peekToken:function(){if(0===this.tokens.length)throw Za("ueoe",this.text);return this.tokens[0]},peek:function(a,b,d,c){return this.peekAhead(0,a,b,d,c)},peekAhead:function(a,b,d,c,e){if(this.tokens.length>a){a=this.tokens[a];var f=a.text;if(f===b||f===d||f===c||f===e||!(b||d||c||e))return a}return!1},
expect:function(a,b,d,c){return(a=this.peek(a,b,d,c))?(this.tokens.shift(),a):!1},selfReferential:{"this":{type:r.ThisExpression},$locals:{type:r.LocalsExpression}}};var Gd=2;Kd.prototype={compile:function(a){var b=this;this.state={nextId:0,filters:{},fn:{vars:[],body:[],own:{}},assign:{vars:[],body:[],own:{}},inputs:[]};S(a,b.$filter);var d="",c;this.stage="assign";if(c=Jd(a))this.state.computing="assign",d=this.nextId(),this.recurse(c,d),this.return_(d),d="fn.assign="+this.generateFunction("assign",
"s,v,l");c=Hd(a.body);b.stage="inputs";q(c,function(a,c){var d="fn"+c;b.state[d]={vars:[],body:[],own:{}};b.state.computing=d;var k=b.nextId();b.recurse(a,k);b.return_(k);b.state.inputs.push({name:d,isPure:a.isPure});a.watchId=c});this.state.computing="fn";this.stage="main";this.recurse(a);a='"'+this.USE+" "+this.STRICT+'";\n'+this.filterPrefix()+"var fn="+this.generateFunction("fn","s,l,a,i")+d+this.watchFns()+"return fn;";a=(new Function("$filter","getStringValue","ifDefined","plus",a))(this.$filter,
Ig,Jg,Fd);this.state=this.stage=void 0;return a},USE:"use",STRICT:"strict",watchFns:function(){var a=[],b=this.state.inputs,d=this;q(b,function(b){a.push("var "+b.name+"="+d.generateFunction(b.name,"s"));b.isPure&&a.push(b.name,".isPure="+JSON.stringify(b.isPure)+";")});b.length&&a.push("fn.inputs=["+b.map(function(a){return a.name}).join(",")+"];");return a.join("")},generateFunction:function(a,b){return"function("+b+"){"+this.varsPrefix(a)+this.body(a)+"};"},filterPrefix:function(){var a=[],b=this;
q(this.state.filters,function(d,c){a.push(d+"=$filter("+b.escape(c)+")")});return a.length?"var "+a.join(",")+";":""},varsPrefix:function(a){return this.state[a].vars.length?"var "+this.state[a].vars.join(",")+";":""},body:function(a){return this.state[a].body.join("")},recurse:function(a,b,d,c,e,f){var g,k,h=this,l,m,p;c=c||x;if(!f&&u(a.watchId))b=b||this.nextId(),this.if_("i",this.lazyAssign(b,this.computedMember("i",a.watchId)),this.lazyRecurse(a,b,d,c,e,!0));else switch(a.type){case r.Program:q(a.body,
function(b,c){h.recurse(b.expression,void 0,void 0,function(a){k=a});c!==a.body.length-1?h.current().body.push(k,";"):h.return_(k)});break;case r.Literal:m=this.escape(a.value);this.assign(b,m);c(b||m);break;case r.UnaryExpression:this.recurse(a.argument,void 0,void 0,function(a){k=a});m=a.operator+"("+this.ifDefined(k,0)+")";this.assign(b,m);c(m);break;case r.BinaryExpression:this.recurse(a.left,void 0,void 0,function(a){g=a});this.recurse(a.right,void 0,void 0,function(a){k=a});m="+"===a.operator?
this.plus(g,k):"-"===a.operator?this.ifDefined(g,0)+a.operator+this.ifDefined(k,0):"("+g+")"+a.operator+"("+k+")";this.assign(b,m);c(m);break;case r.LogicalExpression:b=b||this.nextId();h.recurse(a.left,b);h.if_("&&"===a.operator?b:h.not(b),h.lazyRecurse(a.right,b));c(b);break;case r.ConditionalExpression:b=b||this.nextId();h.recurse(a.test,b);h.if_(b,h.lazyRecurse(a.alternate,b),h.lazyRecurse(a.consequent,b));c(b);break;case r.Identifier:b=b||this.nextId();d&&(d.context="inputs"===h.stage?"s":this.assign(this.nextId(),
this.getHasOwnProperty("l",a.name)+"?l:s"),d.computed=!1,d.name=a.name);h.if_("inputs"===h.stage||h.not(h.getHasOwnProperty("l",a.name)),function(){h.if_("inputs"===h.stage||"s",function(){e&&1!==e&&h.if_(h.isNull(h.nonComputedMember("s",a.name)),h.lazyAssign(h.nonComputedMember("s",a.name),"{}"));h.assign(b,h.nonComputedMember("s",a.name))})},b&&h.lazyAssign(b,h.nonComputedMember("l",a.name)));c(b);break;case r.MemberExpression:g=d&&(d.context=this.nextId())||this.nextId();b=b||this.nextId();h.recurse(a.object,
g,void 0,function(){h.if_(h.notNull(g),function(){a.computed?(k=h.nextId(),h.recurse(a.property,k),h.getStringValue(k),e&&1!==e&&h.if_(h.not(h.computedMember(g,k)),h.lazyAssign(h.computedMember(g,k),"{}")),m=h.computedMember(g,k),h.assign(b,m),d&&(d.computed=!0,d.name=k)):(e&&1!==e&&h.if_(h.isNull(h.nonComputedMember(g,a.property.name)),h.lazyAssign(h.nonComputedMember(g,a.property.name),"{}")),m=h.nonComputedMember(g,a.property.name),h.assign(b,m),d&&(d.computed=!1,d.name=a.property.name))},function(){h.assign(b,
"undefined")});c(b)},!!e);break;case r.CallExpression:b=b||this.nextId();a.filter?(k=h.filter(a.callee.name),l=[],q(a.arguments,function(a){var b=h.nextId();h.recurse(a,b);l.push(b)}),m=k+"("+l.join(",")+")",h.assign(b,m),c(b)):(k=h.nextId(),g={},l=[],h.recurse(a.callee,k,g,function(){h.if_(h.notNull(k),function(){q(a.arguments,function(b){h.recurse(b,a.constant?void 0:h.nextId(),void 0,function(a){l.push(a)})});m=g.name?h.member(g.context,g.name,g.computed)+"("+l.join(",")+")":k+"("+l.join(",")+
")";h.assign(b,m)},function(){h.assign(b,"undefined")});c(b)}));break;case r.AssignmentExpression:k=this.nextId();g={};this.recurse(a.left,void 0,g,function(){h.if_(h.notNull(g.context),function(){h.recurse(a.right,k);m=h.member(g.context,g.name,g.computed)+a.operator+k;h.assign(b,m);c(b||m)})},1);break;case r.ArrayExpression:l=[];q(a.elements,function(b){h.recurse(b,a.constant?void 0:h.nextId(),void 0,function(a){l.push(a)})});m="["+l.join(",")+"]";this.assign(b,m);c(b||m);break;case r.ObjectExpression:l=
[];p=!1;q(a.properties,function(a){a.computed&&(p=!0)});p?(b=b||this.nextId(),this.assign(b,"{}"),q(a.properties,function(a){a.computed?(g=h.nextId(),h.recurse(a.key,g)):g=a.key.type===r.Identifier?a.key.name:""+a.key.value;k=h.nextId();h.recurse(a.value,k);h.assign(h.member(b,g,a.computed),k)})):(q(a.properties,function(b){h.recurse(b.value,a.constant?void 0:h.nextId(),void 0,function(a){l.push(h.escape(b.key.type===r.Identifier?b.key.name:""+b.key.value)+":"+a)})}),m="{"+l.join(",")+"}",this.assign(b,
m));c(b||m);break;case r.ThisExpression:this.assign(b,"s");c(b||"s");break;case r.LocalsExpression:this.assign(b,"l");c(b||"l");break;case r.NGValueParameter:this.assign(b,"v"),c(b||"v")}},getHasOwnProperty:function(a,b){var d=a+"."+b,c=this.current().own;c.hasOwnProperty(d)||(c[d]=this.nextId(!1,a+"&&("+this.escape(b)+" in "+a+")"));return c[d]},assign:function(a,b){if(a)return this.current().body.push(a,"=",b,";"),a},filter:function(a){this.state.filters.hasOwnProperty(a)||(this.state.filters[a]=
this.nextId(!0));return this.state.filters[a]},ifDefined:function(a,b){return"ifDefined("+a+","+this.escape(b)+")"},plus:function(a,b){return"plus("+a+","+b+")"},return_:function(a){this.current().body.push("return ",a,";")},if_:function(a,b,d){if(!0===a)b();else{var c=this.current().body;c.push("if(",a,"){");b();c.push("}");d&&(c.push("else{"),d(),c.push("}"))}},not:function(a){return"!("+a+")"},isNull:function(a){return a+"==null"},notNull:function(a){return a+"!=null"},nonComputedMember:function(a,
b){var d=/[^$_a-zA-Z0-9]/g;return/^[$_a-zA-Z][$_a-zA-Z0-9]*$/.test(b)?a+"."+b:a+'["'+b.replace(d,this.stringEscapeFn)+'"]'},computedMember:function(a,b){return a+"["+b+"]"},member:function(a,b,d){return d?this.computedMember(a,b):this.nonComputedMember(a,b)},getStringValue:function(a){this.assign(a,"getStringValue("+a+")")},lazyRecurse:function(a,b,d,c,e,f){var g=this;return function(){g.recurse(a,b,d,c,e,f)}},lazyAssign:function(a,b){var d=this;return function(){d.assign(a,b)}},stringEscapeRegex:/[^ a-zA-Z0-9]/g,
stringEscapeFn:function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)},escape:function(a){if(B(a))return"'"+a.replace(this.stringEscapeRegex,this.stringEscapeFn)+"'";if(aa(a))return a.toString();if(!0===a)return"true";if(!1===a)return"false";if(null===a)return"null";if("undefined"===typeof a)return"undefined";throw Za("esc");},nextId:function(a,b){var d="v"+this.state.nextId++;a||this.current().vars.push(d+(b?"="+b:""));return d},current:function(){return this.state[this.state.computing]}};
Ld.prototype={compile:function(a){var b=this;S(a,b.$filter);var d,c;if(d=Jd(a))c=this.recurse(d);d=Hd(a.body);var e;d&&(e=[],q(d,function(a,c){var d=b.recurse(a);d.isPure=a.isPure;a.input=d;e.push(d);a.watchId=c}));var f=[];q(a.body,function(a){f.push(b.recurse(a.expression))});a=0===a.body.length?x:1===a.body.length?f[0]:function(a,b){var c;q(f,function(d){c=d(a,b)});return c};c&&(a.assign=function(a,b,d){return c(a,d,b)});e&&(a.inputs=e);return a},recurse:function(a,b,d){var c,e,f=this,g;if(a.input)return this.inputs(a.input,
a.watchId);switch(a.type){case r.Literal:return this.value(a.value,b);case r.UnaryExpression:return e=this.recurse(a.argument),this["unary"+a.operator](e,b);case r.BinaryExpression:return c=this.recurse(a.left),e=this.recurse(a.right),this["binary"+a.operator](c,e,b);case r.LogicalExpression:return c=this.recurse(a.left),e=this.recurse(a.right),this["binary"+a.operator](c,e,b);case r.ConditionalExpression:return this["ternary?:"](this.recurse(a.test),this.recurse(a.alternate),this.recurse(a.consequent),
b);case r.Identifier:return f.identifier(a.name,b,d);case r.MemberExpression:return c=this.recurse(a.object,!1,!!d),a.computed||(e=a.property.name),a.computed&&(e=this.recurse(a.property)),a.computed?this.computedMember(c,e,b,d):this.nonComputedMember(c,e,b,d);case r.CallExpression:return g=[],q(a.arguments,function(a){g.push(f.recurse(a))}),a.filter&&(e=this.$filter(a.callee.name)),a.filter||(e=this.recurse(a.callee,!0)),a.filter?function(a,c,d,f){for(var p=[],n=0;n<g.length;++n)p.push(g[n](a,c,
d,f));a=e.apply(void 0,p,f);return b?{context:void 0,name:void 0,value:a}:a}:function(a,c,d,f){var p=e(a,c,d,f),n;if(null!=p.value){n=[];for(var t=0;t<g.length;++t)n.push(g[t](a,c,d,f));n=p.value.apply(p.context,n)}return b?{value:n}:n};case r.AssignmentExpression:return c=this.recurse(a.left,!0,1),e=this.recurse(a.right),function(a,d,f,g){var p=c(a,d,f,g);a=e(a,d,f,g);p.context[p.name]=a;return b?{value:a}:a};case r.ArrayExpression:return g=[],q(a.elements,function(a){g.push(f.recurse(a))}),function(a,
c,d,e){for(var f=[],n=0;n<g.length;++n)f.push(g[n](a,c,d,e));return b?{value:f}:f};case r.ObjectExpression:return g=[],q(a.properties,function(a){a.computed?g.push({key:f.recurse(a.key),computed:!0,value:f.recurse(a.value)}):g.push({key:a.key.type===r.Identifier?a.key.name:""+a.key.value,computed:!1,value:f.recurse(a.value)})}),function(a,c,d,e){for(var f={},n=0;n<g.length;++n)g[n].computed?f[g[n].key(a,c,d,e)]=g[n].value(a,c,d,e):f[g[n].key]=g[n].value(a,c,d,e);return b?{value:f}:f};case r.ThisExpression:return function(a){return b?
{value:a}:a};case r.LocalsExpression:return function(a,c){return b?{value:c}:c};case r.NGValueParameter:return function(a,c,d){return b?{value:d}:d}}},"unary+":function(a,b){return function(d,c,e,f){d=a(d,c,e,f);d=u(d)?+d:0;return b?{value:d}:d}},"unary-":function(a,b){return function(d,c,e,f){d=a(d,c,e,f);d=u(d)?-d:-0;return b?{value:d}:d}},"unary!":function(a,b){return function(d,c,e,f){d=!a(d,c,e,f);return b?{value:d}:d}},"binary+":function(a,b,d){return function(c,e,f,g){var k=a(c,e,f,g);c=b(c,
e,f,g);k=Fd(k,c);return d?{value:k}:k}},"binary-":function(a,b,d){return function(c,e,f,g){var k=a(c,e,f,g);c=b(c,e,f,g);k=(u(k)?k:0)-(u(c)?c:0);return d?{value:k}:k}},"binary*":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)*b(c,e,f,g);return d?{value:c}:c}},"binary/":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)/b(c,e,f,g);return d?{value:c}:c}},"binary%":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)%b(c,e,f,g);return d?{value:c}:c}},"binary===":function(a,b,d){return function(c,
e,f,g){c=a(c,e,f,g)===b(c,e,f,g);return d?{value:c}:c}},"binary!==":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)!==b(c,e,f,g);return d?{value:c}:c}},"binary==":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)==b(c,e,f,g);return d?{value:c}:c}},"binary!=":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)!=b(c,e,f,g);return d?{value:c}:c}},"binary<":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)<b(c,e,f,g);return d?{value:c}:c}},"binary>":function(a,b,d){return function(c,e,
f,g){c=a(c,e,f,g)>b(c,e,f,g);return d?{value:c}:c}},"binary<=":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)<=b(c,e,f,g);return d?{value:c}:c}},"binary>=":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)>=b(c,e,f,g);return d?{value:c}:c}},"binary&&":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)&&b(c,e,f,g);return d?{value:c}:c}},"binary||":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)||b(c,e,f,g);return d?{value:c}:c}},"ternary?:":function(a,b,d,c){return function(e,f,
g,k){e=a(e,f,g,k)?b(e,f,g,k):d(e,f,g,k);return c?{value:e}:e}},value:function(a,b){return function(){return b?{context:void 0,name:void 0,value:a}:a}},identifier:function(a,b,d){return function(c,e,f,g){c=e&&a in e?e:c;d&&1!==d&&c&&null==c[a]&&(c[a]={});e=c?c[a]:void 0;return b?{context:c,name:a,value:e}:e}},computedMember:function(a,b,d,c){return function(e,f,g,k){var h=a(e,f,g,k),l,m;null!=h&&(l=b(e,f,g,k),l+="",c&&1!==c&&h&&!h[l]&&(h[l]={}),m=h[l]);return d?{context:h,name:l,value:m}:m}},nonComputedMember:function(a,
b,d,c){return function(e,f,g,k){e=a(e,f,g,k);c&&1!==c&&e&&null==e[b]&&(e[b]={});f=null!=e?e[b]:void 0;return d?{context:e,name:b,value:f}:f}},inputs:function(a,b){return function(d,c,e,f){return f?f[b]:a(d,c,e)}}};Nb.prototype={constructor:Nb,parse:function(a){a=this.getAst(a);var b=this.astCompiler.compile(a.ast),d=a.ast;b.literal=0===d.body.length||1===d.body.length&&(d.body[0].expression.type===r.Literal||d.body[0].expression.type===r.ArrayExpression||d.body[0].expression.type===r.ObjectExpression);
b.constant=a.ast.constant;b.oneTime=a.oneTime;return b},getAst:function(a){var b=!1;a=a.trim();":"===a.charAt(0)&&":"===a.charAt(1)&&(b=!0,a=a.substring(2));return{ast:this.ast.ast(a),oneTime:b}}};var pa=L("$sce"),da={HTML:"html",CSS:"css",MEDIA_URL:"mediaUrl",URL:"url",RESOURCE_URL:"resourceUrl",JS:"js"},Dc=/_([a-z])/g,Ng=L("$templateRequest"),Og=L("$timeout"),T=D.document.createElement("a"),Pd=oa(D.location.href),Va;Qd.$inject=["$document"];ed.$inject=["$provide"];var Xd=22,Wd=".",Fc="0";Rd.$inject=
["$locale"];Td.$inject=["$locale"];var Zg={yyyy:X("FullYear",4,0,!1,!0),yy:X("FullYear",2,0,!0,!0),y:X("FullYear",1,0,!1,!0),MMMM:mb("Month"),MMM:mb("Month",!0),MM:X("Month",2,1),M:X("Month",1,1),LLLL:mb("Month",!1,!0),dd:X("Date",2),d:X("Date",1),HH:X("Hours",2),H:X("Hours",1),hh:X("Hours",2,-12),h:X("Hours",1,-12),mm:X("Minutes",2),m:X("Minutes",1),ss:X("Seconds",2),s:X("Seconds",1),sss:X("Milliseconds",3),EEEE:mb("Day"),EEE:mb("Day",!0),a:function(a,b){return 12>a.getHours()?b.AMPMS[0]:b.AMPMS[1]},
Z:function(a,b,d){a=-1*d;return a=(0<=a?"+":"")+(Pb(Math[0<a?"floor":"ceil"](a/60),2)+Pb(Math.abs(a%60),2))},ww:Zd(2),w:Zd(1),G:Gc,GG:Gc,GGG:Gc,GGGG:function(a,b){return 0>=a.getFullYear()?b.ERANAMES[0]:b.ERANAMES[1]}},Yg=/((?:[^yMLdHhmsaZEwG']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|L+|d+|H+|h+|m+|s+|a|Z|G+|w+))([\s\S]*)/,Xg=/^-?\d+$/;Sd.$inject=["$locale"];var Sg=ia(O),Tg=ia(wb);Ud.$inject=["$parse"];var Ke=ia({restrict:"E",compile:function(a,b){if(!b.href&&!b.xlinkHref)return function(a,b){if("a"===b[0].nodeName.toLowerCase()){var e=
"[object SVGAnimatedString]"===ga.call(b.prop("href"))?"xlink:href":"href";b.on("click",function(a){b.attr(e)||a.preventDefault()})}}}}),xb={};q(Ib,function(a,b){function d(a,d,e){a.$watch(e[c],function(a){e.$set(b,!!a)})}if("multiple"!==a){var c=wa("ng-"+b),e=d;"checked"===a&&(e=function(a,b,e){e.ngModel!==e[c]&&d(a,b,e)});xb[c]=function(){return{restrict:"A",priority:100,link:e}}}});q(ud,function(a,b){xb[b]=function(){return{priority:100,link:function(a,c,e){if("ngPattern"===b&&"/"===e.ngPattern.charAt(0)&&
(c=e.ngPattern.match(ch))){e.$set("ngPattern",new RegExp(c[1],c[2]));return}a.$watch(e[b],function(a){e.$set(b,a)})}}}});q(["src","srcset","href"],function(a){var b=wa("ng-"+a);xb[b]=function(){return{priority:99,link:function(d,c,e){var f=a,g=a;"href"===a&&"[object SVGAnimatedString]"===ga.call(c.prop("href"))&&(g="xlinkHref",e.$attr[g]="xlink:href",f=null);e.$observe(b,function(b){b?(e.$set(g,b),Ca&&f&&c.prop(f,e[g])):"href"===a&&e.$set(g,null)})}}}});var nb={$addControl:x,$$renameControl:function(a,
b){a.$name=b},$removeControl:x,$setValidity:x,$setDirty:x,$setPristine:x,$setSubmitted:x,$$setSubmitted:x};Qb.$inject=["$element","$attrs","$scope","$animate","$interpolate"];Qb.prototype={$rollbackViewValue:function(){q(this.$$controls,function(a){a.$rollbackViewValue()})},$commitViewValue:function(){q(this.$$controls,function(a){a.$commitViewValue()})},$addControl:function(a){Na(a.$name,"input");this.$$controls.push(a);a.$name&&(this[a.$name]=a);a.$$parentForm=this},$$renameControl:function(a,b){var d=
a.$name;this[d]===a&&delete this[d];this[b]=a;a.$name=b},$removeControl:function(a){a.$name&&this[a.$name]===a&&delete this[a.$name];q(this.$pending,function(b,d){this.$setValidity(d,null,a)},this);q(this.$error,function(b,d){this.$setValidity(d,null,a)},this);q(this.$$success,function(b,d){this.$setValidity(d,null,a)},this);db(this.$$controls,a);a.$$parentForm=nb},$setDirty:function(){this.$$animate.removeClass(this.$$element,$a);this.$$animate.addClass(this.$$element,Vb);this.$dirty=!0;this.$pristine=
!1;this.$$parentForm.$setDirty()},$setPristine:function(){this.$$animate.setClass(this.$$element,$a,Vb+" ng-submitted");this.$dirty=!1;this.$pristine=!0;this.$submitted=!1;q(this.$$controls,function(a){a.$setPristine()})},$setUntouched:function(){q(this.$$controls,function(a){a.$setUntouched()})},$setSubmitted:function(){for(var a=this;a.$$parentForm&&a.$$parentForm!==nb;)a=a.$$parentForm;a.$$setSubmitted()},$$setSubmitted:function(){this.$$animate.addClass(this.$$element,"ng-submitted");this.$submitted=
!0;q(this.$$controls,function(a){a.$$setSubmitted&&a.$$setSubmitted()})}};be({clazz:Qb,set:function(a,b,d){var c=a[b];c?-1===c.indexOf(d)&&c.push(d):a[b]=[d]},unset:function(a,b,d){var c=a[b];c&&(db(c,d),0===c.length&&delete a[b])}});var je=function(a){return["$timeout","$parse",function(b,d){function c(a){return""===a?d('this[""]').assign:d(a).assign||x}return{name:"form",restrict:a?"EAC":"E",require:["form","^^?form"],controller:Qb,compile:function(d,f){d.addClass($a).addClass(ob);var g=f.name?
"name":a&&f.ngForm?"ngForm":!1;return{pre:function(a,d,e,f){var p=f[0];if(!("action"in e)){var n=function(b){a.$apply(function(){p.$commitViewValue();p.$setSubmitted()});b.preventDefault()};d[0].addEventListener("submit",n);d.on("$destroy",function(){b(function(){d[0].removeEventListener("submit",n)},0,!1)})}(f[1]||p.$$parentForm).$addControl(p);var t=g?c(p.$name):x;g&&(t(a,p),e.$observe(g,function(b){p.$name!==b&&(t(a,void 0),p.$$parentForm.$$renameControl(p,b),t=c(p.$name),t(a,p))}));d.on("$destroy",
function(){p.$$parentForm.$removeControl(p);t(a,void 0);P(p,nb)})}}}}}]},Le=je(),Xe=je(!0),$g=/^\d{4,}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+(?:[+-][0-2]\d:[0-5]\d|Z)$/,lh=/^[a-z][a-z\d.+-]*:\/*(?:[^:@]+(?::[^@]+)?@)?(?:[^\s:/?#]+|\[[a-f\d:]+])(?::\d+)?(?:\/[^?#]*)?(?:\?[^#]*)?(?:#.*)?$/i,mh=/^(?=.{1,254}$)(?=.{1,64}@)[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+(\.[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+)*@[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(\.[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*$/,ah=/^\s*(-|\+)?(\d+|(\d*(\.\d*)))([eE][+-]?\d+)?\s*$/,
ke=/^(\d{4,})-(\d{2})-(\d{2})$/,le=/^(\d{4,})-(\d\d)-(\d\d)T(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,Nc=/^(\d{4,})-W(\d\d)$/,me=/^(\d{4,})-(\d\d)$/,ne=/^(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,de=U();q(["date","datetime-local","month","time","week"],function(a){de[a]=!0});var oe={text:function(a,b,d,c,e,f){Xa(a,b,d,c,e,f);Ic(c)},date:pb("date",ke,Rb(ke,["yyyy","MM","dd"]),"yyyy-MM-dd"),"datetime-local":pb("datetimelocal",le,Rb(le,"yyyy MM dd HH mm ss sss".split(" ")),"yyyy-MM-ddTHH:mm:ss.sss"),time:pb("time",
ne,Rb(ne,["HH","mm","ss","sss"]),"HH:mm:ss.sss"),week:pb("week",Nc,function(a,b){if($(a))return a;if(B(a)){Nc.lastIndex=0;var d=Nc.exec(a);if(d){var c=+d[1],e=+d[2],f=d=0,g=0,k=0,h=Yd(c),e=7*(e-1);b&&(d=b.getHours(),f=b.getMinutes(),g=b.getSeconds(),k=b.getMilliseconds());return new Date(c,0,h.getDate()+e,d,f,g,k)}}return NaN},"yyyy-Www"),month:pb("month",me,Rb(me,["yyyy","MM"]),"yyyy-MM"),number:function(a,b,d,c,e,f){Jc(a,b,d,c,"number");ee(c);Xa(a,b,d,c,e,f);var g,k;if(u(d.min)||d.ngMin)c.$validators.min=
function(a,b){return c.$isEmpty(b)||v(g)||b>=g},d.$observe("min",function(a){g=Ya(a);c.$validate()});if(u(d.max)||d.ngMax)c.$validators.max=function(a,b){return c.$isEmpty(b)||v(k)||b<=k},d.$observe("max",function(a){k=Ya(a);c.$validate()});if(u(d.step)||d.ngStep){var h;c.$validators.step=function(a,b){return c.$isEmpty(b)||v(h)||fe(b,g||0,h)};d.$observe("step",function(a){h=Ya(a);c.$validate()})}},url:function(a,b,d,c,e,f){Xa(a,b,d,c,e,f);Ic(c);c.$validators.url=function(a,b){var d=a||b;return c.$isEmpty(d)||
lh.test(d)}},email:function(a,b,d,c,e,f){Xa(a,b,d,c,e,f);Ic(c);c.$validators.email=function(a,b){var d=a||b;return c.$isEmpty(d)||mh.test(d)}},radio:function(a,b,d,c){var e=!d.ngTrim||"false"!==Q(d.ngTrim);v(d.name)&&b.attr("name",++rb);b.on("change",function(a){var g;b[0].checked&&(g=d.value,e&&(g=Q(g)),c.$setViewValue(g,a&&a.type))});c.$render=function(){var a=d.value;e&&(a=Q(a));b[0].checked=a===c.$viewValue};d.$observe("value",c.$render)},range:function(a,b,d,c,e,f){function g(a,c){b.attr(a,d[a]);
d.$observe(a,c)}function k(a){p=Ya(a);ha(c.$modelValue)||(m?(a=b.val(),p>a&&(a=p,b.val(a)),c.$setViewValue(a)):c.$validate())}function h(a){n=Ya(a);ha(c.$modelValue)||(m?(a=b.val(),n<a&&(b.val(n),a=n<p?p:n),c.$setViewValue(a)):c.$validate())}function l(a){t=Ya(a);ha(c.$modelValue)||(m&&c.$viewValue!==b.val()?c.$setViewValue(b.val()):c.$validate())}Jc(a,b,d,c,"range");ee(c);Xa(a,b,d,c,e,f);var m=c.$$hasNativeValidators&&"range"===b[0].type,p=m?0:void 0,n=m?100:void 0,t=m?1:void 0,s=b[0].validity;a=
u(d.min);e=u(d.max);f=u(d.step);var q=c.$render;c.$render=m&&u(s.rangeUnderflow)&&u(s.rangeOverflow)?function(){q();c.$setViewValue(b.val())}:q;a&&(c.$validators.min=m?function(){return!0}:function(a,b){return c.$isEmpty(b)||v(p)||b>=p},g("min",k));e&&(c.$validators.max=m?function(){return!0}:function(a,b){return c.$isEmpty(b)||v(n)||b<=n},g("max",h));f&&(c.$validators.step=m?function(){return!s.stepMismatch}:function(a,b){return c.$isEmpty(b)||v(t)||fe(b,p||0,t)},g("step",l))},checkbox:function(a,
b,d,c,e,f,g,k){var h=ge(k,a,"ngTrueValue",d.ngTrueValue,!0),l=ge(k,a,"ngFalseValue",d.ngFalseValue,!1);b.on("change",function(a){c.$setViewValue(b[0].checked,a&&a.type)});c.$render=function(){b[0].checked=c.$viewValue};c.$isEmpty=function(a){return!1===a};c.$formatters.push(function(a){return ua(a,h)});c.$parsers.push(function(a){return a?h:l})},hidden:x,button:x,submit:x,reset:x,file:x},Zc=["$browser","$sniffer","$filter","$parse",function(a,b,d,c){return{restrict:"E",require:["?ngModel"],link:{pre:function(e,
f,g,k){k[0]&&(oe[O(g.type)]||oe.text)(e,f,g,k[0],b,a,d,c)}}}}],nh=/^(true|false|\d+)$/,qf=function(){function a(a,d,c){var e=u(c)?c:9===Ca?"":null;a.prop("value",e);d.$set("value",c)}return{restrict:"A",priority:100,compile:function(b,d){return nh.test(d.ngValue)?function(b,d,f){b=b.$eval(f.ngValue);a(d,f,b)}:function(b,d,f){b.$watch(f.ngValue,function(b){a(d,f,b)})}}}},Pe=["$compile",function(a){return{restrict:"AC",compile:function(b){a.$$addBindingClass(b);return function(b,c,e){a.$$addBindingInfo(c,
e.ngBind);c=c[0];b.$watch(e.ngBind,function(a){c.textContent=ic(a)})}}}}],Re=["$interpolate","$compile",function(a,b){return{compile:function(d){b.$$addBindingClass(d);return function(c,d,f){c=a(d.attr(f.$attr.ngBindTemplate));b.$$addBindingInfo(d,c.expressions);d=d[0];f.$observe("ngBindTemplate",function(a){d.textContent=v(a)?"":a})}}}}],Qe=["$sce","$parse","$compile",function(a,b,d){return{restrict:"A",compile:function(c,e){var f=b(e.ngBindHtml),g=b(e.ngBindHtml,function(b){return a.valueOf(b)});
d.$$addBindingClass(c);return function(b,c,e){d.$$addBindingInfo(c,e.ngBindHtml);b.$watch(g,function(){var d=f(b);c.html(a.getTrustedHtml(d)||"")})}}}}],pf=ia({restrict:"A",require:"ngModel",link:function(a,b,d,c){c.$viewChangeListeners.push(function(){a.$eval(d.ngChange)})}}),Se=Lc("",!0),Ue=Lc("Odd",0),Te=Lc("Even",1),Ve=Wa({compile:function(a,b){b.$set("ngCloak",void 0);a.removeClass("ng-cloak")}}),We=[function(){return{restrict:"A",scope:!0,controller:"@",priority:500}}],dd={},oh={blur:!0,focus:!0};
q("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste".split(" "),function(a){var b=wa("ng-"+a);dd[b]=["$parse","$rootScope",function(d,c){return{restrict:"A",compile:function(e,f){var g=d(f[b]);return function(b,d){d.on(a,function(d){var e=function(){g(b,{$event:d})};oh[a]&&c.$$phase?b.$evalAsync(e):b.$apply(e)})}}}}]});var Ze=["$animate","$compile",function(a,b){return{multiElement:!0,transclude:"element",priority:600,
terminal:!0,restrict:"A",$$tlb:!0,link:function(d,c,e,f,g){var k,h,l;d.$watch(e.ngIf,function(d){d?h||g(function(d,f){h=f;d[d.length++]=b.$$createComment("end ngIf",e.ngIf);k={clone:d};a.enter(d,c.parent(),c)}):(l&&(l.remove(),l=null),h&&(h.$destroy(),h=null),k&&(l=vb(k.clone),a.leave(l).done(function(a){!1!==a&&(l=null)}),k=null))})}}}],$e=["$templateRequest","$anchorScroll","$animate",function(a,b,d){return{restrict:"ECA",priority:400,terminal:!0,transclude:"element",controller:fa.noop,compile:function(c,
e){var f=e.ngInclude||e.src,g=e.onload||"",k=e.autoscroll;return function(c,e,m,p,n){var t=0,s,q,r,v=function(){q&&(q.remove(),q=null);s&&(s.$destroy(),s=null);r&&(d.leave(r).done(function(a){!1!==a&&(q=null)}),q=r,r=null)};c.$watch(f,function(f){var m=function(a){!1===a||!u(k)||k&&!c.$eval(k)||b()},q=++t;f?(a(f,!0).then(function(a){if(!c.$$destroyed&&q===t){var b=c.$new();p.template=a;a=n(b,function(a){v();d.enter(a,null,e).done(m)});s=b;r=a;s.$emit("$includeContentLoaded",f);c.$eval(g)}},function(){c.$$destroyed||
q!==t||(v(),c.$emit("$includeContentError",f))}),c.$emit("$includeContentRequested",f)):(v(),p.template=null)})}}}}],sf=["$compile",function(a){return{restrict:"ECA",priority:-400,require:"ngInclude",link:function(b,d,c,e){ga.call(d[0]).match(/SVG/)?(d.empty(),a(fd(e.template,D.document).childNodes)(b,function(a){d.append(a)},{futureParentElement:d})):(d.html(e.template),a(d.contents())(b))}}}],af=Wa({priority:450,compile:function(){return{pre:function(a,b,d){a.$eval(d.ngInit)}}}}),of=function(){return{restrict:"A",
priority:100,require:"ngModel",link:function(a,b,d,c){var e=d.ngList||", ",f="false"!==d.ngTrim,g=f?Q(e):e;c.$parsers.push(function(a){if(!v(a)){var b=[];a&&q(a.split(g),function(a){a&&b.push(f?Q(a):a)});return b}});c.$formatters.push(function(a){if(F(a))return a.join(e)});c.$isEmpty=function(a){return!a||!a.length}}}},ob="ng-valid",ae="ng-invalid",$a="ng-pristine",Vb="ng-dirty",qb=L("ngModel");Sb.$inject="$scope $exceptionHandler $attrs $element $parse $animate $timeout $q $interpolate".split(" ");
Sb.prototype={$$initGetterSetters:function(){if(this.$options.getOption("getterSetter")){var a=this.$$parse(this.$$attr.ngModel+"()"),b=this.$$parse(this.$$attr.ngModel+"($$$p)");this.$$ngModelGet=function(b){var c=this.$$parsedNgModel(b);z(c)&&(c=a(b));return c};this.$$ngModelSet=function(a,c){z(this.$$parsedNgModel(a))?b(a,{$$$p:c}):this.$$parsedNgModelAssign(a,c)}}else if(!this.$$parsedNgModel.assign)throw qb("nonassign",this.$$attr.ngModel,Aa(this.$$element));},$render:x,$isEmpty:function(a){return v(a)||
""===a||null===a||a!==a},$$updateEmptyClasses:function(a){this.$isEmpty(a)?(this.$$animate.removeClass(this.$$element,"ng-not-empty"),this.$$animate.addClass(this.$$element,"ng-empty")):(this.$$animate.removeClass(this.$$element,"ng-empty"),this.$$animate.addClass(this.$$element,"ng-not-empty"))},$setPristine:function(){this.$dirty=!1;this.$pristine=!0;this.$$animate.removeClass(this.$$element,Vb);this.$$animate.addClass(this.$$element,$a)},$setDirty:function(){this.$dirty=!0;this.$pristine=!1;this.$$animate.removeClass(this.$$element,
$a);this.$$animate.addClass(this.$$element,Vb);this.$$parentForm.$setDirty()},$setUntouched:function(){this.$touched=!1;this.$untouched=!0;this.$$animate.setClass(this.$$element,"ng-untouched","ng-touched")},$setTouched:function(){this.$touched=!0;this.$untouched=!1;this.$$animate.setClass(this.$$element,"ng-touched","ng-untouched")},$rollbackViewValue:function(){this.$$timeout.cancel(this.$$pendingDebounce);this.$viewValue=this.$$lastCommittedViewValue;this.$render()},$validate:function(){if(!ha(this.$modelValue)){var a=
this.$$lastCommittedViewValue,b=this.$$rawModelValue,d=this.$valid,c=this.$modelValue,e=this.$options.getOption("allowInvalid"),f=this;this.$$runValidators(b,a,function(a){e||d===a||(f.$modelValue=a?b:void 0,f.$modelValue!==c&&f.$$writeModelToScope())})}},$$runValidators:function(a,b,d){function c(){var c=!0;q(h.$validators,function(d,e){var g=Boolean(d(a,b));c=c&&g;f(e,g)});return c?!0:(q(h.$asyncValidators,function(a,b){f(b,null)}),!1)}function e(){var c=[],d=!0;q(h.$asyncValidators,function(e,
g){var h=e(a,b);if(!h||!z(h.then))throw qb("nopromise",h);f(g,void 0);c.push(h.then(function(){f(g,!0)},function(){d=!1;f(g,!1)}))});c.length?h.$$q.all(c).then(function(){g(d)},x):g(!0)}function f(a,b){k===h.$$currentValidationRunId&&h.$setValidity(a,b)}function g(a){k===h.$$currentValidationRunId&&d(a)}this.$$currentValidationRunId++;var k=this.$$currentValidationRunId,h=this;(function(){var a=h.$$parserName;if(v(h.$$parserValid))f(a,null);else return h.$$parserValid||(q(h.$validators,function(a,
b){f(b,null)}),q(h.$asyncValidators,function(a,b){f(b,null)})),f(a,h.$$parserValid),h.$$parserValid;return!0})()?c()?e():g(!1):g(!1)},$commitViewValue:function(){var a=this.$viewValue;this.$$timeout.cancel(this.$$pendingDebounce);if(this.$$lastCommittedViewValue!==a||""===a&&this.$$hasNativeValidators)this.$$updateEmptyClasses(a),this.$$lastCommittedViewValue=a,this.$pristine&&this.$setDirty(),this.$$parseAndValidate()},$$parseAndValidate:function(){var a=this.$$lastCommittedViewValue,b=this;this.$$parserValid=
v(a)?void 0:!0;this.$setValidity(this.$$parserName,null);this.$$parserName="parse";if(this.$$parserValid)for(var d=0;d<this.$parsers.length;d++)if(a=this.$parsers[d](a),v(a)){this.$$parserValid=!1;break}ha(this.$modelValue)&&(this.$modelValue=this.$$ngModelGet(this.$$scope));var c=this.$modelValue,e=this.$options.getOption("allowInvalid");this.$$rawModelValue=a;e&&(this.$modelValue=a,b.$modelValue!==c&&b.$$writeModelToScope());this.$$runValidators(a,this.$$lastCommittedViewValue,function(d){e||(b.$modelValue=
d?a:void 0,b.$modelValue!==c&&b.$$writeModelToScope())})},$$writeModelToScope:function(){this.$$ngModelSet(this.$$scope,this.$modelValue);q(this.$viewChangeListeners,function(a){try{a()}catch(b){this.$$exceptionHandler(b)}},this)},$setViewValue:function(a,b){this.$viewValue=a;this.$options.getOption("updateOnDefault")&&this.$$debounceViewValueCommit(b)},$$debounceViewValueCommit:function(a){var b=this.$options.getOption("debounce");aa(b[a])?b=b[a]:aa(b["default"])&&-1===this.$options.getOption("updateOn").indexOf(a)?
b=b["default"]:aa(b["*"])&&(b=b["*"]);this.$$timeout.cancel(this.$$pendingDebounce);var d=this;0<b?this.$$pendingDebounce=this.$$timeout(function(){d.$commitViewValue()},b):this.$$rootScope.$$phase?this.$commitViewValue():this.$$scope.$apply(function(){d.$commitViewValue()})},$overrideModelOptions:function(a){this.$options=this.$options.createChild(a);this.$$setUpdateOnEvents()},$processModelValue:function(){var a=this.$$format();this.$viewValue!==a&&(this.$$updateEmptyClasses(a),this.$viewValue=
this.$$lastCommittedViewValue=a,this.$render(),this.$$runValidators(this.$modelValue,this.$viewValue,x))},$$format:function(){for(var a=this.$formatters,b=a.length,d=this.$modelValue;b--;)d=a[b](d);return d},$$setModelValue:function(a){this.$modelValue=this.$$rawModelValue=a;this.$$parserValid=void 0;this.$processModelValue()},$$setUpdateOnEvents:function(){this.$$updateEvents&&this.$$element.off(this.$$updateEvents,this.$$updateEventHandler);if(this.$$updateEvents=this.$options.getOption("updateOn"))this.$$element.on(this.$$updateEvents,
this.$$updateEventHandler)},$$updateEventHandler:function(a){this.$$debounceViewValueCommit(a&&a.type)}};be({clazz:Sb,set:function(a,b){a[b]=!0},unset:function(a,b){delete a[b]}});var nf=["$rootScope",function(a){return{restrict:"A",require:["ngModel","^?form","^?ngModelOptions"],controller:Sb,priority:1,compile:function(b){b.addClass($a).addClass("ng-untouched").addClass(ob);return{pre:function(a,b,e,f){var g=f[0];b=f[1]||g.$$parentForm;if(f=f[2])g.$options=f.$options;g.$$initGetterSetters();b.$addControl(g);
e.$observe("name",function(a){g.$name!==a&&g.$$parentForm.$$renameControl(g,a)});a.$on("$destroy",function(){g.$$parentForm.$removeControl(g)})},post:function(b,c,e,f){function g(){k.$setTouched()}var k=f[0];k.$$setUpdateOnEvents();c.on("blur",function(){k.$touched||(a.$$phase?b.$evalAsync(g):b.$apply(g))})}}}}}],Tb,ph=/(\s+|^)default(\s+|$)/;Mc.prototype={getOption:function(a){return this.$$options[a]},createChild:function(a){var b=!1;a=P({},a);q(a,function(d,c){"$inherit"===d?"*"===c?b=!0:(a[c]=
this.$$options[c],"updateOn"===c&&(a.updateOnDefault=this.$$options.updateOnDefault)):"updateOn"===c&&(a.updateOnDefault=!1,a[c]=Q(d.replace(ph,function(){a.updateOnDefault=!0;return" "})))},this);b&&(delete a["*"],he(a,this.$$options));he(a,Tb.$$options);return new Mc(a)}};Tb=new Mc({updateOn:"",updateOnDefault:!0,debounce:0,getterSetter:!1,allowInvalid:!1,timezone:null});var rf=function(){function a(a,d){this.$$attrs=a;this.$$scope=d}a.$inject=["$attrs","$scope"];a.prototype={$onInit:function(){var a=
this.parentCtrl?this.parentCtrl.$options:Tb,d=this.$$scope.$eval(this.$$attrs.ngModelOptions);this.$options=a.createChild(d)}};return{restrict:"A",priority:10,require:{parentCtrl:"?^^ngModelOptions"},bindToController:!0,controller:a}},bf=Wa({terminal:!0,priority:1E3}),qh=L("ngOptions"),rh=/^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+group\s+by\s+([\s\S]+?))?(?:\s+disable\s+when\s+([\s\S]+?))?\s+for\s+(?:([$\w][$\w]*)|(?:\(\s*([$\w][$\w]*)\s*,\s*([$\w][$\w]*)\s*\)))\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?$/,
lf=["$compile","$document","$parse",function(a,b,d){function c(a,b,c){function e(a,b,c,d,f){this.selectValue=a;this.viewValue=b;this.label=c;this.group=d;this.disabled=f}function f(a){var b;if(!q&&ra(a))b=a;else{b=[];for(var c in a)a.hasOwnProperty(c)&&"$"!==c.charAt(0)&&b.push(c)}return b}var p=a.match(rh);if(!p)throw qh("iexp",a,Aa(b));var n=p[5]||p[7],q=p[6];a=/ as /.test(p[0])&&p[1];var s=p[9];b=d(p[2]?p[1]:n);var r=a&&d(a)||b,w=s&&d(s),u=s?function(a,b){return w(c,b)}:function(a){return Ta(a)},
v=function(a,b){return u(a,z(a,b))},y=d(p[2]||p[1]),A=d(p[3]||""),E=d(p[4]||""),H=d(p[8]),x={},z=q?function(a,b){x[q]=b;x[n]=a;return x}:function(a){x[n]=a;return x};return{trackBy:s,getTrackByValue:v,getWatchables:d(H,function(a){var b=[];a=a||[];for(var d=f(a),e=d.length,g=0;g<e;g++){var k=a===d?g:d[g],l=a[k],k=z(l,k),l=u(l,k);b.push(l);if(p[2]||p[1])l=y(c,k),b.push(l);p[4]&&(k=E(c,k),b.push(k))}return b}),getOptions:function(){for(var a=[],b={},d=H(c)||[],g=f(d),k=g.length,n=0;n<k;n++){var p=d===g?n:g[n],q=z(d[p],p),t=r(c,q),p=u(t,q),w=y(c,q),x=A(c,q),q=E(c,q),t=new e(p,t,w,x,q);a.push(t);b[p]=t}return{items:a,selectValueMap:b,getOptionFromViewValue:function(a){return b[v(a)]},getViewValueFromOption:function(a){return s?za(a.viewValue):a.viewValue}}}}}var e=D.document.createElement("option"),f=D.document.createElement("optgroup");return{restrict:"A",terminal:!0,require:["select","ngModel"],link:{pre:function(a,b,c,d){d[0].registerOption=x},post:function(d,k,h,l){function m(a){var b=(a=v.getOptionFromViewValue(a))&&
a.element;b&&!b.selected&&(b.selected=!0);return a}function p(a,b){a.element=b;b.disabled=a.disabled;a.label!==b.label&&(b.label=a.label,b.textContent=a.label);b.value=a.selectValue}var n=l[0],t=l[1],s=h.multiple;l=0;for(var r=k.children(),w=r.length;l<w;l++)if(""===r[l].value){n.hasEmptyOption=!0;n.emptyOption=r.eq(l);break}k.empty();l=!!n.emptyOption;y(e.cloneNode(!1)).val("?");var v,x=c(h.ngOptions,k,d),z=b[0].createDocumentFragment();n.generateUnknownOptionValue=function(a){return"?"};s?(n.writeValue=
function(a){if(v){var b=a&&a.map(m)||[];v.items.forEach(function(a){a.element.selected&&-1===Array.prototype.indexOf.call(b,a)&&(a.element.selected=!1)})}},n.readValue=function(){var a=k.val()||[],b=[];q(a,function(a){(a=v.selectValueMap[a])&&!a.disabled&&b.push(v.getViewValueFromOption(a))});return b},x.trackBy&&d.$watchCollection(function(){if(F(t.$viewValue))return t.$viewValue.map(function(a){return x.getTrackByValue(a)})},function(){t.$render()})):(n.writeValue=function(a){if(v){var b=k[0].options[k[0].selectedIndex],
c=v.getOptionFromViewValue(a);b&&b.removeAttribute("selected");c?(k[0].value!==c.selectValue&&(n.removeUnknownOption(),k[0].value=c.selectValue,c.element.selected=!0),c.element.setAttribute("selected","selected")):n.selectUnknownOrEmptyOption(a)}},n.readValue=function(){var a=v.selectValueMap[k.val()];return a&&!a.disabled?(n.unselectEmptyOption(),n.removeUnknownOption(),v.getViewValueFromOption(a)):null},x.trackBy&&d.$watch(function(){return x.getTrackByValue(t.$viewValue)},function(){t.$render()}));
l&&(a(n.emptyOption)(d),k.prepend(n.emptyOption),8===n.emptyOption[0].nodeType?(n.hasEmptyOption=!1,n.registerOption=function(a,b){""===b.val()&&(n.hasEmptyOption=!0,n.emptyOption=b,n.emptyOption.removeClass("ng-scope"),t.$render(),b.on("$destroy",function(){var a=n.$isEmptyOptionSelected();n.hasEmptyOption=!1;n.emptyOption=void 0;a&&t.$render()}))}):n.emptyOption.removeClass("ng-scope"));d.$watchCollection(x.getWatchables,function(){var a=v&&n.readValue();if(v)for(var b=v.items.length-1;0<=b;b--){var c=
v.items[b];u(c.group)?Hb(c.element.parentNode):Hb(c.element)}v=x.getOptions();var d={};v.items.forEach(function(a){var b;if(u(a.group)){b=d[a.group];b||(b=f.cloneNode(!1),z.appendChild(b),b.label=null===a.group?"null":a.group,d[a.group]=b);var c=e.cloneNode(!1);b.appendChild(c);p(a,c)}else b=e.cloneNode(!1),z.appendChild(b),p(a,b)});k[0].appendChild(z);t.$render();t.$isEmpty(a)||(b=n.readValue(),(x.trackBy||s?ua(a,b):a===b)||(t.$setViewValue(b),t.$render()))})}}}}],cf=["$locale","$interpolate","$log",
function(a,b,d){var c=/{}/g,e=/^when(Minus)?(.+)$/;return{link:function(f,g,k){function h(a){g.text(a||"")}var l=k.count,m=k.$attr.when&&g.attr(k.$attr.when),p=k.offset||0,n=f.$eval(m)||{},t={},s=b.startSymbol(),r=b.endSymbol(),w=s+l+"-"+p+r,u=fa.noop,y;q(k,function(a,b){var c=e.exec(b);c&&(c=(c[1]?"-":"")+O(c[2]),n[c]=g.attr(k.$attr[b]))});q(n,function(a,d){t[d]=b(a.replace(c,w))});f.$watch(l,function(b){var c=parseFloat(b),e=ha(c);e||c in n||(c=a.pluralCat(c-p));c===y||e&&ha(y)||(u(),e=t[c],v(e)?
(null!=b&&d.debug("ngPluralize: no rule defined for '"+c+"' in "+m),u=x,h()):u=f.$watch(e,h),y=c)})}}}],pe=L("ngRef"),df=["$parse",function(a){return{priority:-1,restrict:"A",compile:function(b,d){var c=wa(ta(b)),e=a(d.ngRef),f=e.assign||function(){throw pe("nonassign",d.ngRef);};return function(a,b,h){var l;if(h.hasOwnProperty("ngRefRead"))if("$element"===h.ngRefRead)l=b;else{if(l=b.data("$"+h.ngRefRead+"Controller"),!l)throw pe("noctrl",h.ngRefRead,d.ngRef);}else l=b.data("$"+c+"Controller");l=
l||b;f(a,l);b.on("$destroy",function(){e(a)===l&&f(a,null)})}}}}],ef=["$parse","$animate","$compile",function(a,b,d){var c=L("ngRepeat"),e=function(a,b,c,d,e,m,p){a[c]=d;e&&(a[e]=m);a.$index=b;a.$first=0===b;a.$last=b===p-1;a.$middle=!(a.$first||a.$last);a.$odd=!(a.$even=0===(b&1))};return{restrict:"A",multiElement:!0,transclude:"element",priority:1E3,terminal:!0,$$tlb:!0,compile:function(f,g){var k=g.ngRepeat,h=d.$$createComment("end ngRepeat",k),l=k.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+track\s+by\s+([\s\S]+?))?\s*$/);
if(!l)throw c("iexp",k);var m=l[1],p=l[2],n=l[3],r=l[4],l=m.match(/^(?:(\s*[$\w]+)|\(\s*([$\w]+)\s*,\s*([$\w]+)\s*\))$/);if(!l)throw c("iidexp",m);var s=l[3]||l[1],u=l[2];if(n&&(!/^[$a-zA-Z_][$a-zA-Z0-9_]*$/.test(n)||/^(null|undefined|this|\$index|\$first|\$middle|\$last|\$even|\$odd|\$parent|\$root|\$id)$/.test(n)))throw c("badident",n);var w,v,x,y,A={$id:Ta};r?w=a(r):(x=function(a,b){return Ta(b)},y=function(a){return a});return function(a,d,f,g,l){w&&(v=function(b,c,d){u&&(A[u]=b);A[s]=c;A.$index=
d;return w(a,A)});var m=U();a.$watchCollection(p,function(f){var g,p,r=d[0],t,w=U(),A,z,D,B,G,F,I;n&&(a[n]=f);if(ra(f))G=f,p=v||x;else for(I in p=v||y,G=[],f)sa.call(f,I)&&"$"!==I.charAt(0)&&G.push(I);A=G.length;I=Array(A);for(g=0;g<A;g++)if(z=f===G?g:G[g],D=f[z],B=p(z,D,g),m[B])F=m[B],delete m[B],w[B]=F,I[g]=F;else{if(w[B])throw q(I,function(a){a&&a.scope&&(m[a.id]=a)}),c("dupes",k,B,D);I[g]={id:B,scope:void 0,clone:void 0};w[B]=!0}for(t in m){F=m[t];B=vb(F.clone);b.leave(B);if(B[0].parentNode)for(g=
0,p=B.length;g<p;g++)B[g].$$NG_REMOVED=!0;F.scope.$destroy()}for(g=0;g<A;g++)if(z=f===G?g:G[g],D=f[z],F=I[g],F.scope){t=r;do t=t.nextSibling;while(t&&t.$$NG_REMOVED);F.clone[0]!==t&&b.move(vb(F.clone),null,r);r=F.clone[F.clone.length-1];e(F.scope,g,s,D,u,z,A)}else l(function(a,c){F.scope=c;var d=h.cloneNode(!1);a[a.length++]=d;b.enter(a,null,r);r=d;F.clone=a;w[F.id]=F;e(F.scope,g,s,D,u,z,A)});m=w})}}}}],ff=["$animate",function(a){return{restrict:"A",multiElement:!0,link:function(b,d,c){b.$watch(c.ngShow,
function(b){a[b?"removeClass":"addClass"](d,"ng-hide",{tempClasses:"ng-hide-animate"})})}}}],Ye=["$animate",function(a){return{restrict:"A",multiElement:!0,link:function(b,d,c){b.$watch(c.ngHide,function(b){a[b?"addClass":"removeClass"](d,"ng-hide",{tempClasses:"ng-hide-animate"})})}}}],gf=Wa(function(a,b,d){a.$watchCollection(d.ngStyle,function(a,d){d&&a!==d&&q(d,function(a,c){b.css(c,"")});a&&b.css(a)})}),hf=["$animate","$compile",function(a,b){return{require:"ngSwitch",controller:["$scope",function(){this.cases=
{}}],link:function(d,c,e,f){var g=[],k=[],h=[],l=[],m=function(a,b){return function(c){!1!==c&&a.splice(b,1)}};d.$watch(e.ngSwitch||e.on,function(c){for(var d,e;h.length;)a.cancel(h.pop());d=0;for(e=l.length;d<e;++d){var r=vb(k[d].clone);l[d].$destroy();(h[d]=a.leave(r)).done(m(h,d))}k.length=0;l.length=0;(g=f.cases["!"+c]||f.cases["?"])&&q(g,function(c){c.transclude(function(d,e){l.push(e);var f=c.element;d[d.length++]=b.$$createComment("end ngSwitchWhen");k.push({clone:d});a.enter(d,f.parent(),
f)})})})}}}],jf=Wa({transclude:"element",priority:1200,require:"^ngSwitch",multiElement:!0,link:function(a,b,d,c,e){a=d.ngSwitchWhen.split(d.ngSwitchWhenSeparator).sort().filter(function(a,b,c){return c[b-1]!==a});q(a,function(a){c.cases["!"+a]=c.cases["!"+a]||[];c.cases["!"+a].push({transclude:e,element:b})})}}),kf=Wa({transclude:"element",priority:1200,require:"^ngSwitch",multiElement:!0,link:function(a,b,d,c,e){c.cases["?"]=c.cases["?"]||[];c.cases["?"].push({transclude:e,element:b})}}),sh=L("ngTransclude"),
mf=["$compile",function(a){return{restrict:"EAC",compile:function(b){var d=a(b.contents());b.empty();return function(a,b,f,g,k){function h(){d(a,function(a){b.append(a)})}if(!k)throw sh("orphan",Aa(b));f.ngTransclude===f.$attr.ngTransclude&&(f.ngTransclude="");f=f.ngTransclude||f.ngTranscludeSlot;k(function(a,c){var d;if(d=a.length)a:{d=0;for(var f=a.length;d<f;d++){var g=a[d];if(g.nodeType!==Ma||g.nodeValue.trim()){d=!0;break a}}d=void 0}d?b.append(a):(h(),c.$destroy())},null,f);f&&!k.isSlotFilled(f)&&
h()}}}}],Me=["$templateCache",function(a){return{restrict:"E",terminal:!0,compile:function(b,d){"text/ng-template"===d.type&&a.put(d.id,b[0].text)}}}],th={$setViewValue:x,$render:x},uh=["$element","$scope",function(a,b){function d(){g||(g=!0,b.$$postDigest(function(){g=!1;e.ngModelCtrl.$render()}))}function c(a){k||(k=!0,b.$$postDigest(function(){b.$$destroyed||(k=!1,e.ngModelCtrl.$setViewValue(e.readValue()),a&&e.ngModelCtrl.$render())}))}var e=this,f=new Jb;e.selectValueMap={};e.ngModelCtrl=th;
e.multiple=!1;e.unknownOption=y(D.document.createElement("option"));e.hasEmptyOption=!1;e.emptyOption=void 0;e.renderUnknownOption=function(b){b=e.generateUnknownOptionValue(b);e.unknownOption.val(b);a.prepend(e.unknownOption);Fa(e.unknownOption,!0);a.val(b)};e.updateUnknownOption=function(b){b=e.generateUnknownOptionValue(b);e.unknownOption.val(b);Fa(e.unknownOption,!0);a.val(b)};e.generateUnknownOptionValue=function(a){return"? "+Ta(a)+" ?"};e.removeUnknownOption=function(){e.unknownOption.parent()&&
e.unknownOption.remove()};e.selectEmptyOption=function(){e.emptyOption&&(a.val(""),Fa(e.emptyOption,!0))};e.unselectEmptyOption=function(){e.hasEmptyOption&&Fa(e.emptyOption,!1)};b.$on("$destroy",function(){e.renderUnknownOption=x});e.readValue=function(){var b=a.val(),b=b in e.selectValueMap?e.selectValueMap[b]:b;return e.hasOption(b)?b:null};e.writeValue=function(b){var c=a[0].options[a[0].selectedIndex];c&&Fa(y(c),!1);e.hasOption(b)?(e.removeUnknownOption(),c=Ta(b),a.val(c in e.selectValueMap?
c:b),Fa(y(a[0].options[a[0].selectedIndex]),!0)):e.selectUnknownOrEmptyOption(b)};e.addOption=function(a,b){if(8!==b[0].nodeType){Na(a,'"option value"');""===a&&(e.hasEmptyOption=!0,e.emptyOption=b);var c=f.get(a)||0;f.set(a,c+1);d()}};e.removeOption=function(a){var b=f.get(a);b&&(1===b?(f.delete(a),""===a&&(e.hasEmptyOption=!1,e.emptyOption=void 0)):f.set(a,b-1))};e.hasOption=function(a){return!!f.get(a)};e.$hasEmptyOption=function(){return e.hasEmptyOption};e.$isUnknownOptionSelected=function(){return a[0].options[0]===e.unknownOption[0]};e.$isEmptyOptionSelected=function(){return e.hasEmptyOption&&a[0].options[a[0].selectedIndex]===e.emptyOption[0]};e.selectUnknownOrEmptyOption=function(a){null==a&&e.emptyOption?(e.removeUnknownOption(),e.selectEmptyOption()):e.unknownOption.parent().length?e.updateUnknownOption(a):e.renderUnknownOption(a)};var g=!1,k=!1;e.registerOption=function(a,b,f,g,k){if(f.$attr.ngValue){var q,r=NaN;f.$observe("value",function(a){var d,f=b.prop("selected");u(r)&&(e.removeOption(q),delete e.selectValueMap[r],
d=!0);r=Ta(a);q=a;e.selectValueMap[r]=a;e.addOption(a,b);b.attr("value",r);d&&f&&c()})}else g?f.$observe("value",function(a){e.readValue();var d,f=b.prop("selected");u(q)&&(e.removeOption(q),d=!0);q=a;e.addOption(a,b);d&&f&&c()}):k?a.$watch(k,function(a,d){f.$set("value",a);var g=b.prop("selected");d!==a&&e.removeOption(d);e.addOption(a,b);d&&g&&c()}):e.addOption(f.value,b);f.$observe("disabled",function(a){if("true"===a||a&&b.prop("selected"))e.multiple?c(!0):(e.ngModelCtrl.$setViewValue(null),e.ngModelCtrl.$render())});
b.on("$destroy",function(){var a=e.readValue(),b=f.value;e.removeOption(b);d();(e.multiple&&a&&-1!==a.indexOf(b)||a===b)&&c(!0)})}}],Ne=function(){return{restrict:"E",require:["select","?ngModel"],controller:uh,priority:1,link:{pre:function(a,b,d,c){var e=c[0],f=c[1];if(f){if(e.ngModelCtrl=f,b.on("change",function(){e.removeUnknownOption();a.$apply(function(){f.$setViewValue(e.readValue())})}),d.multiple){e.multiple=!0;e.readValue=function(){var a=[];q(b.find("option"),function(b){b.selected&&!b.disabled&&
(b=b.value,a.push(b in e.selectValueMap?e.selectValueMap[b]:b))});return a};e.writeValue=function(a){q(b.find("option"),function(b){var c=!!a&&(-1!==Array.prototype.indexOf.call(a,b.value)||-1!==Array.prototype.indexOf.call(a,e.selectValueMap[b.value]));c!==b.selected&&Fa(y(b),c)})};var g,k=NaN;a.$watch(function(){k!==f.$viewValue||ua(g,f.$viewValue)||(g=ja(f.$viewValue),f.$render());k=f.$viewValue});f.$isEmpty=function(a){return!a||0===a.length}}}else e.registerOption=x},post:function(a,b,d,c){var e=
c[1];if(e){var f=c[0];e.$render=function(){f.writeValue(e.$viewValue)}}}}}},Oe=["$interpolate",function(a){return{restrict:"E",priority:100,compile:function(b,d){var c,e;u(d.ngValue)||(u(d.value)?c=a(d.value,!0):(e=a(b.text(),!0))||d.$set("value",b.text()));return function(a,b,d){var h=b.parent();(h=h.data("$selectController")||h.parent().data("$selectController"))&&h.registerOption(a,b,d,c,e)}}}}],ad=function(){return{restrict:"A",require:"?ngModel",link:function(a,b,d,c){c&&(d.required=!0,c.$validators.required=
function(a,b){return!d.required||!c.$isEmpty(b)},d.$observe("required",function(){c.$validate()}))}}},$c=function(){return{restrict:"A",require:"?ngModel",link:function(a,b,d,c){if(c){var e,f=d.ngPattern||d.pattern;d.$observe("pattern",function(a){B(a)&&0<a.length&&(a=new RegExp("^"+a+"$"));if(a&&!a.test)throw L("ngPattern")("noregexp",f,a,Aa(b));e=a||void 0;c.$validate()});c.$validators.pattern=function(a,b){return c.$isEmpty(b)||v(e)||e.test(b)}}}}},cd=function(){return{restrict:"A",require:"?ngModel",
link:function(a,b,d,c){if(c){var e=-1;d.$observe("maxlength",function(a){a=ea(a);e=ha(a)?-1:a;c.$validate()});c.$validators.maxlength=function(a,b){return 0>e||c.$isEmpty(b)||b.length<=e}}}}},bd=function(){return{restrict:"A",require:"?ngModel",link:function(a,b,d,c){if(c){var e=0;d.$observe("minlength",function(a){e=ea(a)||0;c.$validate()});c.$validators.minlength=function(a,b){return c.$isEmpty(b)||b.length>=e}}}}};D.angular.bootstrap?D.console&&console.log("WARNING: Tried to load AngularJS more than once."):
(De(),He(fa),fa.module("ngLocale",[],["$provide",function(a){function b(a){a+="";var b=a.indexOf(".");return-1==b?0:a.length-b-1}a.value("$locale",{DATETIME_FORMATS:{AMPMS:["AM","PM"],DAY:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),ERANAMES:["Before Christ","Anno Domini"],ERAS:["BC","AD"],FIRSTDAYOFWEEK:6,MONTH:"January February March April May June July August September October November December".split(" "),SHORTDAY:"Sun Mon Tue Wed Thu Fri Sat".split(" "),SHORTMONTH:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),
STANDALONEMONTH:"January February March April May June July August September October November December".split(" "),WEEKENDRANGE:[5,6],fullDate:"EEEE, MMMM d, y",longDate:"MMMM d, y",medium:"MMM d, y h:mm:ss a",mediumDate:"MMM d, y",mediumTime:"h:mm:ss a","short":"M/d/yy h:mm a",shortDate:"M/d/yy",shortTime:"h:mm a"},NUMBER_FORMATS:{CURRENCY_SYM:"$",DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{gSize:3,lgSize:3,maxFrac:3,minFrac:0,minInt:1,negPre:"-",negSuf:"",posPre:"",posSuf:""},{gSize:3,lgSize:3,maxFrac:2,
minFrac:2,minInt:1,negPre:"-\u00a4",negSuf:"",posPre:"\u00a4",posSuf:""}]},id:"en-us",localeID:"en_US",pluralCat:function(a,c){var e=a|0,f=c;void 0===f&&(f=Math.min(b(a),3));Math.pow(10,f);return 1==e&&0==f?"one":"other"}})}]),y(function(){ye(D.document,Vc)}))})(window);!window.angular.$$csp().noInlineStyle&&window.angular.element(document.head).prepend('<style type="text/css">@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide:not(.ng-hide-animate){display:none !important;}ng\\:form{display:block;}.ng-animate-shim{visibility:hidden;}.ng-anchor{position:absolute;}</style>');
(function(window, angular){'use strict';
var ELEMENT_NODE=1;
var COMMENT_NODE=8;
var ADD_CLASS_SUFFIX='-add';
var REMOVE_CLASS_SUFFIX='-remove';
var EVENT_CLASS_PREFIX='ng-';
var ACTIVE_CLASS_SUFFIX='-active';
var PREPARE_CLASS_SUFFIX='-prepare';
var NG_ANIMATE_CLASSNAME='ng-animate';
var NG_ANIMATE_CHILDREN_DATA='$$ngAnimateChildren';
var CSS_PREFIX='', TRANSITION_PROP, TRANSITIONEND_EVENT, ANIMATION_PROP, ANIMATIONEND_EVENT;
if((window.ontransitionend===undefined)&&(window.onwebkittransitionend!==undefined)){
CSS_PREFIX='-webkit-';
TRANSITION_PROP='WebkitTransition';
TRANSITIONEND_EVENT='webkitTransitionEnd transitionend';
}else{
TRANSITION_PROP='transition';
TRANSITIONEND_EVENT='transitionend';
}
if((window.onanimationend===undefined)&&(window.onwebkitanimationend!==undefined)){
CSS_PREFIX='-webkit-';
ANIMATION_PROP='WebkitAnimation';
ANIMATIONEND_EVENT='webkitAnimationEnd animationend';
}else{
ANIMATION_PROP='animation';
ANIMATIONEND_EVENT='animationend';
}
var DURATION_KEY='Duration';
var PROPERTY_KEY='Property';
var DELAY_KEY='Delay';
var TIMING_KEY='TimingFunction';
var ANIMATION_ITERATION_COUNT_KEY='IterationCount';
var ANIMATION_PLAYSTATE_KEY='PlayState';
var SAFE_FAST_FORWARD_DURATION_VALUE=9999;
var ANIMATION_DELAY_PROP=ANIMATION_PROP + DELAY_KEY;
var ANIMATION_DURATION_PROP=ANIMATION_PROP + DURATION_KEY;
var TRANSITION_DELAY_PROP=TRANSITION_PROP + DELAY_KEY;
var TRANSITION_DURATION_PROP=TRANSITION_PROP + DURATION_KEY;
var ngMinErr=angular.$$minErr('ng');
function assertArg(arg, name, reason){
if(!arg){
throw ngMinErr('areq', 'Argument \'{0}\' is {1}', (name||'?'), (reason||'required'));
}
return arg;
}
function mergeClasses(a,b){
if(!a&&!b) return '';
if(!a) return b;
if(!b) return a;
if(isArray(a)) a=a.join(' ');
if(isArray(b)) b=b.join(' ');
return a + ' ' + b;
}
function packageStyles(options){
var styles={};
if(options&&(options.to||options.from)){
styles.to=options.to;
styles.from=options.from;
}
return styles;
}
function pendClasses(classes, fix, isPrefix){
var className='';
classes=isArray(classes)
? classes
: classes&&isString(classes)&&classes.length
? classes.split(/\s+/)
: [];
forEach(classes, function(klass, i){
if(klass&&klass.length > 0){
className +=(i > 0) ? ' ':'';
className +=isPrefix ? fix + klass
: klass + fix;
}});
return className;
}
function removeFromArray(arr, val){
var index=arr.indexOf(val);
if(val >=0){
arr.splice(index, 1);
}}
function stripCommentsFromElement(element){
if(element instanceof jqLite){
switch (element.length){
case 0:
return element;
case 1:
if(element[0].nodeType===ELEMENT_NODE){
return element;
}
break;
default:
return jqLite(extractElementNode(element));
}}
if(element.nodeType===ELEMENT_NODE){
return jqLite(element);
}}
function extractElementNode(element){
if(!element[0]) return element;
for (var i=0; i < element.length; i++){
var elm=element[i];
if(elm.nodeType===ELEMENT_NODE){
return elm;
}}
}
function $$addClass($$jqLite, element, className){
forEach(element, function(elm){
$$jqLite.addClass(elm, className);
});
}
function $$removeClass($$jqLite, element, className){
forEach(element, function(elm){
$$jqLite.removeClass(elm, className);
});
}
function applyAnimationClassesFactory($$jqLite){
return function(element, options){
if(options.addClass){
$$addClass($$jqLite, element, options.addClass);
options.addClass=null;
}
if(options.removeClass){
$$removeClass($$jqLite, element, options.removeClass);
options.removeClass=null;
}};}
function prepareAnimationOptions(options){
options=options||{};
if(!options.$$prepared){
var domOperation=options.domOperation||noop;
options.domOperation=function(){
options.$$domOperationFired=true;
domOperation();
domOperation=noop;
};
options.$$prepared=true;
}
return options;
}
function applyAnimationStyles(element, options){
applyAnimationFromStyles(element, options);
applyAnimationToStyles(element, options);
}
function applyAnimationFromStyles(element, options){
if(options.from){
element.css(options.from);
options.from=null;
}}
function applyAnimationToStyles(element, options){
if(options.to){
element.css(options.to);
options.to=null;
}}
function mergeAnimationDetails(element, oldAnimation, newAnimation){
var target=oldAnimation.options||{};
var newOptions=newAnimation.options||{};
var toAdd=(target.addClass||'') + ' ' + (newOptions.addClass||'');
var toRemove=(target.removeClass||'') + ' ' + (newOptions.removeClass||'');
var classes=resolveElementClasses(element.attr('class'), toAdd, toRemove);
if(newOptions.preparationClasses){
target.preparationClasses=concatWithSpace(newOptions.preparationClasses, target.preparationClasses);
delete newOptions.preparationClasses;
}
var realDomOperation=target.domOperation!==noop ? target.domOperation:null;
extend(target, newOptions);
if(realDomOperation){
target.domOperation=realDomOperation;
}
if(classes.addClass){
target.addClass=classes.addClass;
}else{
target.addClass=null;
}
if(classes.removeClass){
target.removeClass=classes.removeClass;
}else{
target.removeClass=null;
}
oldAnimation.addClass=target.addClass;
oldAnimation.removeClass=target.removeClass;
return target;
}
function resolveElementClasses(existing, toAdd, toRemove){
var ADD_CLASS=1;
var REMOVE_CLASS=-1;
var flags={};
existing=splitClassesToLookup(existing);
toAdd=splitClassesToLookup(toAdd);
forEach(toAdd, function(value, key){
flags[key]=ADD_CLASS;
});
toRemove=splitClassesToLookup(toRemove);
forEach(toRemove, function(value, key){
flags[key]=flags[key]===ADD_CLASS ? null:REMOVE_CLASS;
});
var classes={
addClass: '',
removeClass: ''
};
forEach(flags, function(val, klass){
var prop, allow;
if(val===ADD_CLASS){
prop='addClass';
allow = !existing[klass]||existing[klass + REMOVE_CLASS_SUFFIX];
}else if(val===REMOVE_CLASS){
prop='removeClass';
allow=existing[klass]||existing[klass + ADD_CLASS_SUFFIX];
}
if(allow){
if(classes[prop].length){
classes[prop] +=' ';
}
classes[prop] +=klass;
}});
function splitClassesToLookup(classes){
if(isString(classes)){
classes=classes.split(' ');
}
var obj={};
forEach(classes, function(klass){
if(klass.length){
obj[klass]=true;
}});
return obj;
}
return classes;
}
function getDomNode(element){
return (element instanceof jqLite) ? element[0]:element;
}
function applyGeneratedPreparationClasses(element, event, options){
var classes='';
if(event){
classes=pendClasses(event, EVENT_CLASS_PREFIX, true);
}
if(options.addClass){
classes=concatWithSpace(classes, pendClasses(options.addClass, ADD_CLASS_SUFFIX));
}
if(options.removeClass){
classes=concatWithSpace(classes, pendClasses(options.removeClass, REMOVE_CLASS_SUFFIX));
}
if(classes.length){
options.preparationClasses=classes;
element.addClass(classes);
}}
function clearGeneratedClasses(element, options){
if(options.preparationClasses){
element.removeClass(options.preparationClasses);
options.preparationClasses=null;
}
if(options.activeClasses){
element.removeClass(options.activeClasses);
options.activeClasses=null;
}}
function blockTransitions(node, duration){
var value=duration ? '-' + duration + 's':'';
applyInlineStyle(node, [TRANSITION_DELAY_PROP, value]);
return [TRANSITION_DELAY_PROP, value];
}
function blockKeyframeAnimations(node, applyBlock){
var value=applyBlock ? 'paused':'';
var key=ANIMATION_PROP + ANIMATION_PLAYSTATE_KEY;
applyInlineStyle(node, [key, value]);
return [key, value];
}
function applyInlineStyle(node, styleTuple){
var prop=styleTuple[0];
var value=styleTuple[1];
node.style[prop]=value;
}
function concatWithSpace(a,b){
if(!a) return b;
if(!b) return a;
return a + ' ' + b;
}
var $$rAFSchedulerFactory=['$$rAF', function($$rAF){
var queue, cancelFn;
function scheduler(tasks){
queue=queue.concat(tasks);
nextTick();
}
queue=scheduler.queue=[];
scheduler.waitUntilQuiet=function(fn){
if(cancelFn) cancelFn();
cancelFn=$$rAF(function(){
cancelFn=null;
fn();
nextTick();
});
};
return scheduler;
function nextTick(){
if(!queue.length) return;
var items=queue.shift();
for (var i=0; i < items.length; i++){
items[i]();
}
if(!cancelFn){
$$rAF(function(){
if(!cancelFn) nextTick();
});
}}
}];
var $$AnimateChildrenDirective=['$interpolate', function($interpolate){
return {
link: function(scope, element, attrs){
var val=attrs.ngAnimateChildren;
if(isString(val)&&val.length===0){
element.data(NG_ANIMATE_CHILDREN_DATA, true);
}else{
setData($interpolate(val)(scope));
attrs.$observe('ngAnimateChildren', setData);
}
function setData(value){
value=value==='on'||value==='true';
element.data(NG_ANIMATE_CHILDREN_DATA, value);
}}
};}];
var ANIMATE_TIMER_KEY='$$animateCss';
/**
* @ngdoc service
* @name $animateCss
* @kind object
*
* @description
* The `$animateCss` service is a useful utility to trigger customized CSS-based transitions/keyframes
* from a JavaScript-based animation or directly from a directive. The purpose of `$animateCss` is NOT
* to side-step how `$animate` and ngAnimate work, but the goal is to allow pre-existing animations or
* directives to create more complex animations that can be purely driven using CSS code.
*
* Note that only browsers that support CSS transitions and/or keyframe animations are capable of
* rendering animations triggered via `$animateCss` (bad news for IE9 and lower).
*
* ## General Use
* Once again, `$animateCss` is designed to be used inside of a registered JavaScript animation that
* is powered by ngAnimate. It is possible to use `$animateCss` directly inside of a directive, however,
* any automatic control over cancelling animations and/or preventing animations from being run on
* child elements will not be handled by AngularJS. For this to work as expected, please use `$animate` to
* trigger the animation and then setup a JavaScript animation that injects `$animateCss` to trigger
* the CSS animation.
*
* The example below shows how we can create a folding animation on an element using `ng-if`:
*
* ```html
* <!-- notice the `fold-animation` CSS class -->
* <div ng-if="onOff" class="fold-animation">
*   This element will go BOOM
* </div>
* <button ng-click="onOff=true">Fold In</button>
* ```
*
* Now we create the **JavaScript animation** that will trigger the CSS transition:
*
* ```js
* ngModule.animation('.fold-animation', ['$animateCss', function($animateCss){
*   return {
*     enter: function(element, doneFn){
*       var height=element[0].offsetHeight;
*       return $animateCss(element, {
*         from: { height:'0px' },
*         to: { height:height + 'px' },
*         duration: 1 
*       });
*     }
*   }
* }]);
* ```
*
* ## More Advanced Uses
*
* `$animateCss` is the underlying code that ngAnimate uses to power **CSS-based animations** behind the scenes. Therefore CSS hooks
* like `.ng-EVENT`, `.ng-EVENT-active`, `.ng-EVENT-stagger` are all features that can be triggered using `$animateCss` via JavaScript code.
*
* This also means that just about any combination of adding classes, removing classes, setting styles, dynamically setting a keyframe animation,
* applying a hardcoded duration or delay value, changing the animation easing or applying a stagger animation are all options that work with
* `$animateCss`. The service itself is smart enough to figure out the combination of options and examine the element styling properties in order
* to provide a working animation that will run in CSS.
*
* The example below showcases a more advanced version of the `.fold-animation` from the example above:
*
* ```js
* ngModule.animation('.fold-animation', ['$animateCss', function($animateCss){
*   return {
*     enter: function(element, doneFn){
*       var height=element[0].offsetHeight;
*       return $animateCss(element, {
*         addClass: 'red large-text pulse-twice',
*         easing: 'ease-out',
*         from: { height:'0px' },
*         to: { height:height + 'px' },
*         duration: 1 
*       });
*     }
*   }
* }]);
* ```
*
* Since we're adding/removing CSS classes then the CSS transition will also pick those up:
*
* ```css
* /&#42; since a hardcoded duration value of 1 was provided in the JavaScript animation code,
* the CSS classes below will be transitioned despite them being defined as regular CSS classes &#42;/
* .red { background:red; }
* .large-text { font-size:20px; }
*
* /&#42; we can also use a keyframe animation and $animateCss will make it work alongside the transition &#42;/
* .pulse-twice {
*   animation: 0.5s pulse linear 2;
*   -webkit-animation: 0.5s pulse linear 2;
* }
*
* @keyframes pulse {
*   from { transform: scale(0.5); }
*   to { transform: scale(1.5); }
* }
*
* @-webkit-keyframes pulse {
*   from { -webkit-transform: scale(0.5); }
*   to { -webkit-transform: scale(1.5); }
* }
* ```
*
* Given this complex combination of CSS classes, styles and options, `$animateCss` will figure everything out and make the animation happen.
*
* ## How the Options are handled
*
* `$animateCss` is very versatile and intelligent when it comes to figuring out what configurations to apply to the element to ensure the animation
* works with the options provided. Say for example we were adding a class that contained a keyframe value and we wanted to also animate some inline
* styles using the `from` and `to` properties.
*
* ```js
* var animator=$animateCss(element, {
*   from: { background:'red' },
*   to: { background:'blue' }
* });
* animator.start();
* ```
*
* ```css
* .rotating-animation {
*   animation:0.5s rotate linear;
*   -webkit-animation:0.5s rotate linear;
* }
*
* @keyframes rotate {
*   from { transform: rotate(0deg); }
*   to { transform: rotate(360deg); }
* }
*
* @-webkit-keyframes rotate {
*   from { -webkit-transform: rotate(0deg); }
*   to { -webkit-transform: rotate(360deg); }
* }
* ```
*
* The missing pieces here are that we do not have a transition set (within the CSS code nor within the `$animateCss` options) and the duration of the animation is
* going to be detected from what the keyframe styles on the CSS class are. In this event, `$animateCss` will automatically create an inline transition
* style matching the duration detected from the keyframe style (which is present in the CSS class that is being added) and then prepare both the transition
* and keyframe animations to run in parallel on the element. Then when the animation is underway the provided `from` and `to` CSS styles will be applied
* and spread across the transition and keyframe animation.
*
* ## What is returned
*
* `$animateCss` works in two stages: a preparation phase and an animation phase. Therefore when `$animateCss` is first called it will NOT actually
* start the animation. All that is going on here is that the element is being prepared for the animation (which means that the generated CSS classes are
* added and removed on the element). Once `$animateCss` is called it will return an object with the following properties:
*
* ```js
* var animator=$animateCss(element, { ... });
* ```
*
* Now what do the contents of our `animator` variable look like:
*
* ```js
* {
*
*   start: Function,
*
*
*   end: Function
* }
* ```
*
* To actually start the animation we need to run `animation.start()` which will then return a promise that we can hook into to detect when the animation ends.
* If we choose not to run the animation then we MUST run `animation.end()` to perform a cleanup on the element (since some CSS classes and styles may have been
* applied to the element during the preparation phase). Note that all other properties such as duration, delay, transitions and keyframes are just properties
* and that changing them will not reconfigure the parameters of the animation.
*
* ### runner.done() vs runner.then()
* It is documented that `animation.start()` will return a promise object and this is true, however, there is also an additional method available on the
* runner called `.done(callbackFn)`. The done method works the same as `.finally(callbackFn)`, however, it does **not trigger a digest to occur**.
* Therefore, for performance reasons, it's always best to use `runner.done(callback)` instead of `runner.then()`, `runner.catch()` or `runner.finally()`
* unless you really need a digest to kick off afterwards.
*
* Keep in mind that, to make this easier, ngAnimate has tweaked the JS animations API to recognize when a runner instance is returned from $animateCss
* (so there is no need to call `runner.done(doneFn)` inside of your JavaScript animation code).
* Check the {@link ngAnimate.$animateCss#usage animation code above} to see how this works.
*
* @param {DOMElement} element the element that will be animated
* @param {object} options the animation-related options that will be applied during the animation
*
* * `event` - The DOM event (e.g. enter, leave, move). When used, a generated CSS class of `ng-EVENT` and `ng-EVENT-active` will be applied
* to the element during the animation. Multiple events can be provided when spaces are used as a separator. (Note that this will not perform any DOM operation.)
* * `structural` - Indicates that the `ng-` prefix will be added to the event class. Setting to `false` or omitting will turn `ng-EVENT` and
* `ng-EVENT-active` in `EVENT` and `EVENT-active`. Unused if `event` is omitted.
* * `easing` - The CSS easing value that will be applied to the transition or keyframe animation (or both).
* * `transitionStyle` - The raw CSS transition style that will be used (e.g. `1s linear all`).
* * `keyframeStyle` - The raw CSS keyframe animation style that will be used (e.g. `1s my_animation linear`).
* * `from` - The starting CSS styles (a key/value object) that will be applied at the start of the animation.
* * `to` - The ending CSS styles (a key/value object) that will be applied across the animation via a CSS transition.
* * `addClass` - A space separated list of CSS classes that will be added to the element and spread across the animation.
* * `removeClass` - A space separated list of CSS classes that will be removed from the element and spread across the animation.
* * `duration` - A number value representing the total duration of the transition and/or keyframe (note that a value of 1 is 1000ms). If a value of `0`
* is provided then the animation will be skipped entirely.
* * `delay` - A number value representing the total delay of the transition and/or keyframe (note that a value of 1 is 1000ms). If a value of `true` is
* used then whatever delay value is detected from the CSS classes will be mirrored on the elements styles (e.g. by setting delay true then the style value
* of the element will be `transition-delay: DETECTED_VALUE`). Using `true` is useful when you want the CSS classes and inline styles to all share the same
* CSS delay value.
* * `stagger` - A numeric time value representing the delay between successively animated elements
* ({@link ngAnimate#css-staggering-animations Click here to learn how CSS-based staggering works in ngAnimate.})
* * `staggerIndex` - The numeric index representing the stagger item (e.g. a value of 5 is equal to the sixth item in the stagger; therefore when a
*   `stagger` option value of `0.1` is used then there will be a stagger delay of `600ms`)
* * `applyClassesEarly` - Whether or not the classes being added or removed will be used when detecting the animation. This is set by `$animate` when enter/leave/move animations are fired to ensure that the CSS classes are resolved in time. (Note that this will prevent any transitions from occurring on the classes being added and removed.)
* * `cleanupStyles` - Whether or not the provided `from` and `to` styles will be removed once
*    the animation is closed. This is useful for when the styles are used purely for the sake of
*    the animation and do not have a lasting visual effect on the element (e.g. a collapse and open animation).
*    By default this value is set to `false`.
*
* @return {object} an object with start and end methods and details about the animation.
*
* * `start` - The method to start the animation. This will return a `Promise` when called.
* * `end` - This method will cancel the animation and remove all applied CSS classes and styles.
*/
var ONE_SECOND=1000;
var ELAPSED_TIME_MAX_DECIMAL_PLACES=3;
var CLOSING_TIME_BUFFER=1.5;
var DETECT_CSS_PROPERTIES={
transitionDuration:      TRANSITION_DURATION_PROP,
transitionDelay:         TRANSITION_DELAY_PROP,
transitionProperty:      TRANSITION_PROP + PROPERTY_KEY,
animationDuration:       ANIMATION_DURATION_PROP,
animationDelay:          ANIMATION_DELAY_PROP,
animationIterationCount: ANIMATION_PROP + ANIMATION_ITERATION_COUNT_KEY
};
var DETECT_STAGGER_CSS_PROPERTIES={
transitionDuration:      TRANSITION_DURATION_PROP,
transitionDelay:         TRANSITION_DELAY_PROP,
animationDuration:       ANIMATION_DURATION_PROP,
animationDelay:          ANIMATION_DELAY_PROP
};
function getCssKeyframeDurationStyle(duration){
return [ANIMATION_DURATION_PROP, duration + 's'];
}
function getCssDelayStyle(delay, isKeyframeAnimation){
var prop=isKeyframeAnimation ? ANIMATION_DELAY_PROP:TRANSITION_DELAY_PROP;
return [prop, delay + 's'];
}
function computeCssStyles($window, element, properties){
var styles=Object.create(null);
var detectedStyles=$window.getComputedStyle(element)||{};
forEach(properties, function(formalStyleName, actualStyleName){
var val=detectedStyles[formalStyleName];
if(val){
var c=val.charAt(0);
if(c==='-'||c==='+'||c >=0){
val=parseMaxTime(val);
}
if(val===0){
val=null;
}
styles[actualStyleName]=val;
}});
return styles;
}
function parseMaxTime(str){
var maxValue=0;
var values=str.split(/\s*,\s*/);
forEach(values, function(value){
if(value.charAt(value.length - 1)==='s'){
value=value.substring(0, value.length - 1);
}
value=parseFloat(value)||0;
maxValue=maxValue ? Math.max(value, maxValue):value;
});
return maxValue;
}
function truthyTimingValue(val){
return val===0||val!=null;
}
function getCssTransitionDurationStyle(duration, applyOnlyDuration){
var style=TRANSITION_PROP;
var value=duration + 's';
if(applyOnlyDuration){
style +=DURATION_KEY;
}else{
value +=' linear all';
}
return [style, value];
}
function createLocalCacheLookup(){
var cache=Object.create(null);
return {
flush: function(){
cache=Object.create(null);
},
count: function(key){
var entry=cache[key];
return entry ? entry.total:0;
},
get: function(key){
var entry=cache[key];
return entry&&entry.value;
},
put: function(key, value){
if(!cache[key]){
cache[key]={ total: 1, value: value };}else{
cache[key].total++;
}}
};}
function registerRestorableStyles(backup, node, properties){
forEach(properties, function(prop){
backup[prop]=isDefined(backup[prop])
? backup[prop]
: node.style.getPropertyValue(prop);
});
}
var $AnimateCssProvider=['$animateProvider',  function($animateProvider){
var gcsLookup=createLocalCacheLookup();
var gcsStaggerLookup=createLocalCacheLookup();
this.$get=['$window', '$$jqLite', '$$AnimateRunner', '$timeout',
'$$forceReflow', '$sniffer', '$$rAFScheduler', '$$animateQueue',
function($window,   $$jqLite,   $$AnimateRunner,   $timeout,
$$forceReflow,   $sniffer,   $$rAFScheduler, $$animateQueue){
var applyAnimationClasses=applyAnimationClassesFactory($$jqLite);
var parentCounter=0;
function gcsHashFn(node, extraClasses){
var KEY='$$ngAnimateParentKey';
var parentNode=node.parentNode;
var parentID=parentNode[KEY]||(parentNode[KEY]=++parentCounter);
return parentID + '-' + node.getAttribute('class') + '-' + extraClasses;
}
function computeCachedCssStyles(node, className, cacheKey, properties){
var timings=gcsLookup.get(cacheKey);
if(!timings){
timings=computeCssStyles($window, node, properties);
if(timings.animationIterationCount==='infinite'){
timings.animationIterationCount=1;
}}
gcsLookup.put(cacheKey, timings);
return timings;
}
function computeCachedCssStaggerStyles(node, className, cacheKey, properties){
var stagger;
if(gcsLookup.count(cacheKey) > 0){
stagger=gcsStaggerLookup.get(cacheKey);
if(!stagger){
var staggerClassName=pendClasses(className, '-stagger');
$$jqLite.addClass(node, staggerClassName);
stagger=computeCssStyles($window, node, properties);
stagger.animationDuration=Math.max(stagger.animationDuration, 0);
stagger.transitionDuration=Math.max(stagger.transitionDuration, 0);
$$jqLite.removeClass(node, staggerClassName);
gcsStaggerLookup.put(cacheKey, stagger);
}}
return stagger||{};}
var rafWaitQueue=[];
function waitUntilQuiet(callback){
rafWaitQueue.push(callback);
$$rAFScheduler.waitUntilQuiet(function(){
gcsLookup.flush();
gcsStaggerLookup.flush();
var pageWidth=$$forceReflow();
for (var i=0; i < rafWaitQueue.length; i++){
rafWaitQueue[i](pageWidth);
}
rafWaitQueue.length=0;
});
}
function computeTimings(node, className, cacheKey){
var timings=computeCachedCssStyles(node, className, cacheKey, DETECT_CSS_PROPERTIES);
var aD=timings.animationDelay;
var tD=timings.transitionDelay;
timings.maxDelay=aD&&tD
? Math.max(aD, tD)
: (aD||tD);
timings.maxDuration=Math.max(timings.animationDuration * timings.animationIterationCount,
timings.transitionDuration);
return timings;
}
return function init(element, initialOptions){
var options=initialOptions||{};
if(!options.$$prepared){
options=prepareAnimationOptions(copy(options));
}
var restoreStyles={};
var node=getDomNode(element);
if(!node
|| !node.parentNode
|| !$$animateQueue.enabled()){
return closeAndReturnNoopAnimator();
}
var temporaryStyles=[];
var classes=element.attr('class');
var styles=packageStyles(options);
var animationClosed;
var animationPaused;
var animationCompleted;
var runner;
var runnerHost;
var maxDelay;
var maxDelayTime;
var maxDuration;
var maxDurationTime;
var startTime;
var events=[];
if(options.duration===0||(!$sniffer.animations&&!$sniffer.transitions)){
return closeAndReturnNoopAnimator();
}
var method=options.event&&isArray(options.event)
? options.event.join(' ')
: options.event;
var isStructural=method&&options.structural;
var structuralClassName='';
var addRemoveClassName='';
if(isStructural){
structuralClassName=pendClasses(method, EVENT_CLASS_PREFIX, true);
}else if(method){
structuralClassName=method;
}
if(options.addClass){
addRemoveClassName +=pendClasses(options.addClass, ADD_CLASS_SUFFIX);
}
if(options.removeClass){
if(addRemoveClassName.length){
addRemoveClassName +=' ';
}
addRemoveClassName +=pendClasses(options.removeClass, REMOVE_CLASS_SUFFIX);
}
if(options.applyClassesEarly&&addRemoveClassName.length){
applyAnimationClasses(element, options);
}
var preparationClasses=[structuralClassName, addRemoveClassName].join(' ').trim();
var fullClassName=classes + ' ' + preparationClasses;
var activeClasses=pendClasses(preparationClasses, ACTIVE_CLASS_SUFFIX);
var hasToStyles=styles.to&&Object.keys(styles.to).length > 0;
var containsKeyframeAnimation=(options.keyframeStyle||'').length > 0;
if(!containsKeyframeAnimation
&& !hasToStyles
&& !preparationClasses){
return closeAndReturnNoopAnimator();
}
var cacheKey, stagger;
if(options.stagger > 0){
var staggerVal=parseFloat(options.stagger);
stagger={
transitionDelay: staggerVal,
animationDelay: staggerVal,
transitionDuration: 0,
animationDuration: 0
};}else{
cacheKey=gcsHashFn(node, fullClassName);
stagger=computeCachedCssStaggerStyles(node, preparationClasses, cacheKey, DETECT_STAGGER_CSS_PROPERTIES);
}
if(!options.$$skipPreparationClasses){
$$jqLite.addClass(element, preparationClasses);
}
var applyOnlyDuration;
if(options.transitionStyle){
var transitionStyle=[TRANSITION_PROP, options.transitionStyle];
applyInlineStyle(node, transitionStyle);
temporaryStyles.push(transitionStyle);
}
if(options.duration >=0){
applyOnlyDuration=node.style[TRANSITION_PROP].length > 0;
var durationStyle=getCssTransitionDurationStyle(options.duration, applyOnlyDuration);
applyInlineStyle(node, durationStyle);
temporaryStyles.push(durationStyle);
}
if(options.keyframeStyle){
var keyframeStyle=[ANIMATION_PROP, options.keyframeStyle];
applyInlineStyle(node, keyframeStyle);
temporaryStyles.push(keyframeStyle);
}
var itemIndex=stagger
? options.staggerIndex >=0
? options.staggerIndex
: gcsLookup.count(cacheKey)
: 0;
var isFirst=itemIndex===0;
if(isFirst&&!options.skipBlocking){
blockTransitions(node, SAFE_FAST_FORWARD_DURATION_VALUE);
}
var timings=computeTimings(node, fullClassName, cacheKey);
var relativeDelay=timings.maxDelay;
maxDelay=Math.max(relativeDelay, 0);
maxDuration=timings.maxDuration;
var flags={};
flags.hasTransitions=timings.transitionDuration > 0;
flags.hasAnimations=timings.animationDuration > 0;
flags.hasTransitionAll=flags.hasTransitions&&timings.transitionProperty==='all';
flags.applyTransitionDuration=hasToStyles&&(
(flags.hasTransitions&&!flags.hasTransitionAll)
|| (flags.hasAnimations&&!flags.hasTransitions));
flags.applyAnimationDuration=options.duration&&flags.hasAnimations;
flags.applyTransitionDelay=truthyTimingValue(options.delay)&&(flags.applyTransitionDuration||flags.hasTransitions);
flags.applyAnimationDelay=truthyTimingValue(options.delay)&&flags.hasAnimations;
flags.recalculateTimingStyles=addRemoveClassName.length > 0;
if(flags.applyTransitionDuration||flags.applyAnimationDuration){
maxDuration=options.duration ? parseFloat(options.duration):maxDuration;
if(flags.applyTransitionDuration){
flags.hasTransitions=true;
timings.transitionDuration=maxDuration;
applyOnlyDuration=node.style[TRANSITION_PROP + PROPERTY_KEY].length > 0;
temporaryStyles.push(getCssTransitionDurationStyle(maxDuration, applyOnlyDuration));
}
if(flags.applyAnimationDuration){
flags.hasAnimations=true;
timings.animationDuration=maxDuration;
temporaryStyles.push(getCssKeyframeDurationStyle(maxDuration));
}}
if(maxDuration===0&&!flags.recalculateTimingStyles){
return closeAndReturnNoopAnimator();
}
if(options.delay!=null){
var delayStyle;
if(typeof options.delay!=='boolean'){
delayStyle=parseFloat(options.delay);
maxDelay=Math.max(delayStyle, 0);
}
if(flags.applyTransitionDelay){
temporaryStyles.push(getCssDelayStyle(delayStyle));
}
if(flags.applyAnimationDelay){
temporaryStyles.push(getCssDelayStyle(delayStyle, true));
}}
if(options.duration==null&&timings.transitionDuration > 0){
flags.recalculateTimingStyles=flags.recalculateTimingStyles||isFirst;
}
maxDelayTime=maxDelay * ONE_SECOND;
maxDurationTime=maxDuration * ONE_SECOND;
if(!options.skipBlocking){
flags.blockTransition=timings.transitionDuration > 0;
flags.blockKeyframeAnimation=timings.animationDuration > 0 &&
stagger.animationDelay > 0 &&
stagger.animationDuration===0;
}
if(options.from){
if(options.cleanupStyles){
registerRestorableStyles(restoreStyles, node, Object.keys(options.from));
}
applyAnimationFromStyles(element, options);
}
if(flags.blockTransition||flags.blockKeyframeAnimation){
applyBlocking(maxDuration);
}else if(!options.skipBlocking){
blockTransitions(node, false);
}
return {
$$willAnimate: true,
end: endFn,
start: function(){
if(animationClosed) return;
runnerHost={
end: endFn,
cancel: cancelFn,
resume: null,
pause: null
};
runner=new $$AnimateRunner(runnerHost);
waitUntilQuiet(start);
return runner;
}};
function endFn(){
close();
}
function cancelFn(){
close(true);
}
function close(rejected){
if(animationClosed||(animationCompleted&&animationPaused)) return;
animationClosed=true;
animationPaused=false;
if(!options.$$skipPreparationClasses){
$$jqLite.removeClass(element, preparationClasses);
}
$$jqLite.removeClass(element, activeClasses);
blockKeyframeAnimations(node, false);
blockTransitions(node, false);
forEach(temporaryStyles, function(entry){
node.style[entry[0]]='';
});
applyAnimationClasses(element, options);
applyAnimationStyles(element, options);
if(Object.keys(restoreStyles).length){
forEach(restoreStyles, function(value, prop){
if(value){
node.style.setProperty(prop, value);
}else{
node.style.removeProperty(prop);
}});
}
if(options.onDone){
options.onDone();
}
if(events&&events.length){
element.off(events.join(' '), onAnimationProgress);
}
var animationTimerData=element.data(ANIMATE_TIMER_KEY);
if(animationTimerData){
$timeout.cancel(animationTimerData[0].timer);
element.removeData(ANIMATE_TIMER_KEY);
}
if(runner){
runner.complete(!rejected);
}}
function applyBlocking(duration){
if(flags.blockTransition){
blockTransitions(node, duration);
}
if(flags.blockKeyframeAnimation){
blockKeyframeAnimations(node, !!duration);
}}
function closeAndReturnNoopAnimator(){
runner=new $$AnimateRunner({
end: endFn,
cancel: cancelFn
});
waitUntilQuiet(noop);
close();
return {
$$willAnimate: false,
start: function(){
return runner;
},
end: endFn
};}
function onAnimationProgress(event){
event.stopPropagation();
var ev=event.originalEvent||event;
if(ev.target!==node){
return;
}
var timeStamp=ev.$manualTimeStamp||Date.now();
var elapsedTime=parseFloat(ev.elapsedTime.toFixed(ELAPSED_TIME_MAX_DECIMAL_PLACES));
if(Math.max(timeStamp - startTime, 0) >=maxDelayTime&&elapsedTime >=maxDuration){
animationCompleted=true;
close();
}}
function start(){
if(animationClosed) return;
if(!node.parentNode){
close();
return;
}
var playPause=function(playAnimation){
if(!animationCompleted){
animationPaused = !playAnimation;
if(timings.animationDuration){
var value=blockKeyframeAnimations(node, animationPaused);
if(animationPaused){
temporaryStyles.push(value);
}else{
removeFromArray(temporaryStyles, value);
}}
}else if(animationPaused&&playAnimation){
animationPaused=false;
close();
}};
var maxStagger=itemIndex > 0
&& ((timings.transitionDuration&&stagger.transitionDuration===0) ||
(timings.animationDuration&&stagger.animationDuration===0))
&& Math.max(stagger.animationDelay, stagger.transitionDelay);
if(maxStagger){
$timeout(triggerAnimationStart,
Math.floor(maxStagger * itemIndex * ONE_SECOND),
false);
}else{
triggerAnimationStart();
}
runnerHost.resume=function(){
playPause(true);
};
runnerHost.pause=function(){
playPause(false);
};
function triggerAnimationStart(){
if(animationClosed) return;
applyBlocking(false);
forEach(temporaryStyles, function(entry){
var key=entry[0];
var value=entry[1];
node.style[key]=value;
});
applyAnimationClasses(element, options);
$$jqLite.addClass(element, activeClasses);
if(flags.recalculateTimingStyles){
fullClassName=node.getAttribute('class') + ' ' + preparationClasses;
cacheKey=gcsHashFn(node, fullClassName);
timings=computeTimings(node, fullClassName, cacheKey);
relativeDelay=timings.maxDelay;
maxDelay=Math.max(relativeDelay, 0);
maxDuration=timings.maxDuration;
if(maxDuration===0){
close();
return;
}
flags.hasTransitions=timings.transitionDuration > 0;
flags.hasAnimations=timings.animationDuration > 0;
}
if(flags.applyAnimationDelay){
relativeDelay=typeof options.delay!=='boolean'&&truthyTimingValue(options.delay)
? parseFloat(options.delay)
: relativeDelay;
maxDelay=Math.max(relativeDelay, 0);
timings.animationDelay=relativeDelay;
delayStyle=getCssDelayStyle(relativeDelay, true);
temporaryStyles.push(delayStyle);
node.style[delayStyle[0]]=delayStyle[1];
}
maxDelayTime=maxDelay * ONE_SECOND;
maxDurationTime=maxDuration * ONE_SECOND;
if(options.easing){
var easeProp, easeVal=options.easing;
if(flags.hasTransitions){
easeProp=TRANSITION_PROP + TIMING_KEY;
temporaryStyles.push([easeProp, easeVal]);
node.style[easeProp]=easeVal;
}
if(flags.hasAnimations){
easeProp=ANIMATION_PROP + TIMING_KEY;
temporaryStyles.push([easeProp, easeVal]);
node.style[easeProp]=easeVal;
}}
if(timings.transitionDuration){
events.push(TRANSITIONEND_EVENT);
}
if(timings.animationDuration){
events.push(ANIMATIONEND_EVENT);
}
startTime=Date.now();
var timerTime=maxDelayTime + CLOSING_TIME_BUFFER * maxDurationTime;
var endTime=startTime + timerTime;
var animationsData=element.data(ANIMATE_TIMER_KEY)||[];
var setupFallbackTimer=true;
if(animationsData.length){
var currentTimerData=animationsData[0];
setupFallbackTimer=endTime > currentTimerData.expectedEndTime;
if(setupFallbackTimer){
$timeout.cancel(currentTimerData.timer);
}else{
animationsData.push(close);
}}
if(setupFallbackTimer){
var timer=$timeout(onAnimationExpired, timerTime, false);
animationsData[0]={
timer: timer,
expectedEndTime: endTime
};
animationsData.push(close);
element.data(ANIMATE_TIMER_KEY, animationsData);
}
if(events.length){
element.on(events.join(' '), onAnimationProgress);
}
if(options.to){
if(options.cleanupStyles){
registerRestorableStyles(restoreStyles, node, Object.keys(options.to));
}
applyAnimationToStyles(element, options);
}}
function onAnimationExpired(){
var animationsData=element.data(ANIMATE_TIMER_KEY);
if(animationsData){
for (var i=1; i < animationsData.length; i++){
animationsData[i]();
}
element.removeData(ANIMATE_TIMER_KEY);
}}
}};}];
}];
var $$AnimateCssDriverProvider=['$$animationProvider',  function($$animationProvider){
$$animationProvider.drivers.push('$$animateCssDriver');
var NG_ANIMATE_SHIM_CLASS_NAME='ng-animate-shim';
var NG_ANIMATE_ANCHOR_CLASS_NAME='ng-anchor';
var NG_OUT_ANCHOR_CLASS_NAME='ng-anchor-out';
var NG_IN_ANCHOR_CLASS_NAME='ng-anchor-in';
function isDocumentFragment(node){
return node.parentNode&&node.parentNode.nodeType===11;
}
this.$get=['$animateCss', '$rootScope', '$$AnimateRunner', '$rootElement', '$sniffer', '$$jqLite', '$document',
function($animateCss,   $rootScope,   $$AnimateRunner,   $rootElement,   $sniffer,   $$jqLite,   $document){
if(!$sniffer.animations&&!$sniffer.transitions) return noop;
var bodyNode=$document[0].body;
var rootNode=getDomNode($rootElement);
var rootBodyElement=jqLite(
isDocumentFragment(rootNode)||bodyNode.contains(rootNode) ? rootNode:bodyNode
);
return function initDriverFn(animationDetails){
return animationDetails.from&&animationDetails.to
? prepareFromToAnchorAnimation(animationDetails.from,
animationDetails.to,
animationDetails.classes,
animationDetails.anchors)
: prepareRegularAnimation(animationDetails);
};
function filterCssClasses(classes){
return classes.replace(/\bng-\S+\b/g, '');
}
function getUniqueValues(a, b){
if(isString(a)) a=a.split(' ');
if(isString(b)) b=b.split(' ');
return a.filter(function(val){
return b.indexOf(val)===-1;
}).join(' ');
}
function prepareAnchoredAnimation(classes, outAnchor, inAnchor){
var clone=jqLite(getDomNode(outAnchor).cloneNode(true));
var startingClasses=filterCssClasses(getClassVal(clone));
outAnchor.addClass(NG_ANIMATE_SHIM_CLASS_NAME);
inAnchor.addClass(NG_ANIMATE_SHIM_CLASS_NAME);
clone.addClass(NG_ANIMATE_ANCHOR_CLASS_NAME);
rootBodyElement.append(clone);
var animatorIn, animatorOut=prepareOutAnimation();
if(!animatorOut){
animatorIn=prepareInAnimation();
if(!animatorIn){
return end();
}}
var startingAnimator=animatorOut||animatorIn;
return {
start: function(){
var runner;
var currentAnimation=startingAnimator.start();
currentAnimation.done(function(){
currentAnimation=null;
if(!animatorIn){
animatorIn=prepareInAnimation();
if(animatorIn){
currentAnimation=animatorIn.start();
currentAnimation.done(function(){
currentAnimation=null;
end();
runner.complete();
});
return currentAnimation;
}}
end();
runner.complete();
});
runner=new $$AnimateRunner({
end: endFn,
cancel: endFn
});
return runner;
function endFn(){
if(currentAnimation){
currentAnimation.end();
}}
}};
function calculateAnchorStyles(anchor){
var styles={};
var coords=getDomNode(anchor).getBoundingClientRect();
forEach(['width','height','top','left'], function(key){
var value=coords[key];
switch (key){
case 'top':
value +=bodyNode.scrollTop;
break;
case 'left':
value +=bodyNode.scrollLeft;
break;
}
styles[key]=Math.floor(value) + 'px';
});
return styles;
}
function prepareOutAnimation(){
var animator=$animateCss(clone, {
addClass: NG_OUT_ANCHOR_CLASS_NAME,
delay: true,
from: calculateAnchorStyles(outAnchor)
});
return animator.$$willAnimate ? animator:null;
}
function getClassVal(element){
return element.attr('class')||'';
}
function prepareInAnimation(){
var endingClasses=filterCssClasses(getClassVal(inAnchor));
var toAdd=getUniqueValues(endingClasses, startingClasses);
var toRemove=getUniqueValues(startingClasses, endingClasses);
var animator=$animateCss(clone, {
to: calculateAnchorStyles(inAnchor),
addClass: NG_IN_ANCHOR_CLASS_NAME + ' ' + toAdd,
removeClass: NG_OUT_ANCHOR_CLASS_NAME + ' ' + toRemove,
delay: true
});
return animator.$$willAnimate ? animator:null;
}
function end(){
clone.remove();
outAnchor.removeClass(NG_ANIMATE_SHIM_CLASS_NAME);
inAnchor.removeClass(NG_ANIMATE_SHIM_CLASS_NAME);
}}
function prepareFromToAnchorAnimation(from, to, classes, anchors){
var fromAnimation=prepareRegularAnimation(from, noop);
var toAnimation=prepareRegularAnimation(to, noop);
var anchorAnimations=[];
forEach(anchors, function(anchor){
var outElement=anchor['out'];
var inElement=anchor['in'];
var animator=prepareAnchoredAnimation(classes, outElement, inElement);
if(animator){
anchorAnimations.push(animator);
}});
if(!fromAnimation&&!toAnimation&&anchorAnimations.length===0) return;
return {
start: function(){
var animationRunners=[];
if(fromAnimation){
animationRunners.push(fromAnimation.start());
}
if(toAnimation){
animationRunners.push(toAnimation.start());
}
forEach(anchorAnimations, function(animation){
animationRunners.push(animation.start());
});
var runner=new $$AnimateRunner({
end: endFn,
cancel: endFn
});
$$AnimateRunner.all(animationRunners, function(status){
runner.complete(status);
});
return runner;
function endFn(){
forEach(animationRunners, function(runner){
runner.end();
});
}}
};}
function prepareRegularAnimation(animationDetails){
var element=animationDetails.element;
var options=animationDetails.options||{};
if(animationDetails.structural){
options.event=animationDetails.event;
options.structural=true;
options.applyClassesEarly=true;
if(animationDetails.event==='leave'){
options.onDone=options.domOperation;
}}
if(options.preparationClasses){
options.event=concatWithSpace(options.event, options.preparationClasses);
}
var animator=$animateCss(element, options);
return animator.$$willAnimate ? animator:null;
}}];
}];
var $$AnimateJsProvider=['$animateProvider',  function($animateProvider){
this.$get=['$injector', '$$AnimateRunner', '$$jqLite',
function($injector,   $$AnimateRunner,   $$jqLite){
var applyAnimationClasses=applyAnimationClassesFactory($$jqLite);
return function(element, event, classes, options){
var animationClosed=false;
if(arguments.length===3&&isObject(classes)){
options=classes;
classes=null;
}
options=prepareAnimationOptions(options);
if(!classes){
classes=element.attr('class')||'';
if(options.addClass){
classes +=' ' + options.addClass;
}
if(options.removeClass){
classes +=' ' + options.removeClass;
}}
var classesToAdd=options.addClass;
var classesToRemove=options.removeClass;
var animations=lookupAnimations(classes);
var before, after;
if(animations.length){
var afterFn, beforeFn;
if(event==='leave'){
beforeFn='leave';
afterFn='afterLeave';
}else{
beforeFn='before' + event.charAt(0).toUpperCase() + event.substr(1);
afterFn=event;
}
if(event!=='enter'&&event!=='move'){
before=packageAnimations(element, event, options, animations, beforeFn);
}
after=packageAnimations(element, event, options, animations, afterFn);
}
if(!before&&!after) return;
function applyOptions(){
options.domOperation();
applyAnimationClasses(element, options);
}
function close(){
animationClosed=true;
applyOptions();
applyAnimationStyles(element, options);
}
var runner;
return {
$$willAnimate: true,
end: function(){
if(runner){
runner.end();
}else{
close();
runner=new $$AnimateRunner();
runner.complete(true);
}
return runner;
},
start: function(){
if(runner){
return runner;
}
runner=new $$AnimateRunner();
var closeActiveAnimations;
var chain=[];
if(before){
chain.push(function(fn){
closeActiveAnimations=before(fn);
});
}
if(chain.length){
chain.push(function(fn){
applyOptions();
fn(true);
});
}else{
applyOptions();
}
if(after){
chain.push(function(fn){
closeActiveAnimations=after(fn);
});
}
runner.setHost({
end: function(){
endAnimations();
},
cancel: function(){
endAnimations(true);
}});
$$AnimateRunner.chain(chain, onComplete);
return runner;
function onComplete(success){
close(success);
runner.complete(success);
}
function endAnimations(cancelled){
if(!animationClosed){
(closeActiveAnimations||noop)(cancelled);
onComplete(cancelled);
}}
}};
function executeAnimationFn(fn, element, event, options, onDone){
var args;
switch (event){
case 'animate':
args=[element, options.from, options.to, onDone];
break;
case 'setClass':
args=[element, classesToAdd, classesToRemove, onDone];
break;
case 'addClass':
args=[element, classesToAdd, onDone];
break;
case 'removeClass':
args=[element, classesToRemove, onDone];
break;
default:
args=[element, onDone];
break;
}
args.push(options);
var value=fn.apply(fn, args);
if(value){
if(isFunction(value.start)){
value=value.start();
}
if(value instanceof $$AnimateRunner){
value.done(onDone);
}else if(isFunction(value)){
return value;
}}
return noop;
}
function groupEventedAnimations(element, event, options, animations, fnName){
var operations=[];
forEach(animations, function(ani){
var animation=ani[fnName];
if(!animation) return;
operations.push(function(){
var runner;
var endProgressCb;
var resolved=false;
var onAnimationComplete=function(rejected){
if(!resolved){
resolved=true;
(endProgressCb||noop)(rejected);
runner.complete(!rejected);
}};
runner=new $$AnimateRunner({
end: function(){
onAnimationComplete();
},
cancel: function(){
onAnimationComplete(true);
}});
endProgressCb=executeAnimationFn(animation, element, event, options, function(result){
var cancelled=result===false;
onAnimationComplete(cancelled);
});
return runner;
});
});
return operations;
}
function packageAnimations(element, event, options, animations, fnName){
var operations=groupEventedAnimations(element, event, options, animations, fnName);
if(operations.length===0){
var a, b;
if(fnName==='beforeSetClass'){
a=groupEventedAnimations(element, 'removeClass', options, animations, 'beforeRemoveClass');
b=groupEventedAnimations(element, 'addClass', options, animations, 'beforeAddClass');
}else if(fnName==='setClass'){
a=groupEventedAnimations(element, 'removeClass', options, animations, 'removeClass');
b=groupEventedAnimations(element, 'addClass', options, animations, 'addClass');
}
if(a){
operations=operations.concat(a);
}
if(b){
operations=operations.concat(b);
}}
if(operations.length===0) return;
return function startAnimation(callback){
var runners=[];
if(operations.length){
forEach(operations, function(animateFn){
runners.push(animateFn());
});
}
if(runners.length){
$$AnimateRunner.all(runners, callback);
}else{
callback();
}
return function endFn(reject){
forEach(runners, function(runner){
if(reject){
runner.cancel();
}else{
runner.end();
}});
};};
}};
function lookupAnimations(classes){
classes=isArray(classes) ? classes:classes.split(' ');
var matches=[], flagMap={};
for (var i=0; i < classes.length; i++){
var klass=classes[i],
animationFactory=$animateProvider.$$registeredAnimations[klass];
if(animationFactory&&!flagMap[klass]){
matches.push($injector.get(animationFactory));
flagMap[klass]=true;
}}
return matches;
}}];
}];
var $$AnimateJsDriverProvider=['$$animationProvider',  function($$animationProvider){
$$animationProvider.drivers.push('$$animateJsDriver');
this.$get=['$$animateJs', '$$AnimateRunner', function($$animateJs, $$AnimateRunner){
return function initDriverFn(animationDetails){
if(animationDetails.from&&animationDetails.to){
var fromAnimation=prepareAnimation(animationDetails.from);
var toAnimation=prepareAnimation(animationDetails.to);
if(!fromAnimation&&!toAnimation) return;
return {
start: function(){
var animationRunners=[];
if(fromAnimation){
animationRunners.push(fromAnimation.start());
}
if(toAnimation){
animationRunners.push(toAnimation.start());
}
$$AnimateRunner.all(animationRunners, done);
var runner=new $$AnimateRunner({
end: endFnFactory(),
cancel: endFnFactory()
});
return runner;
function endFnFactory(){
return function(){
forEach(animationRunners, function(runner){
runner.end();
});
};}
function done(status){
runner.complete(status);
}}
};}else{
return prepareAnimation(animationDetails);
}};
function prepareAnimation(animationDetails){
var element=animationDetails.element;
var event=animationDetails.event;
var options=animationDetails.options;
var classes=animationDetails.classes;
return $$animateJs(element, event, classes, options);
}}];
}];
var NG_ANIMATE_ATTR_NAME='data-ng-animate';
var NG_ANIMATE_PIN_DATA='$ngAnimatePin';
var $$AnimateQueueProvider=['$animateProvider',  function($animateProvider){
var PRE_DIGEST_STATE=1;
var RUNNING_STATE=2;
var ONE_SPACE=' ';
var rules=this.rules={
skip: [],
cancel: [],
join: []
};
function makeTruthyCssClassMap(classString){
if(!classString){
return null;
}
var keys=classString.split(ONE_SPACE);
var map=Object.create(null);
forEach(keys, function(key){
map[key]=true;
});
return map;
}
function hasMatchingClasses(newClassString, currentClassString){
if(newClassString&&currentClassString){
var currentClassMap=makeTruthyCssClassMap(currentClassString);
return newClassString.split(ONE_SPACE).some(function(className){
return currentClassMap[className];
});
}}
function isAllowed(ruleType, currentAnimation, previousAnimation){
return rules[ruleType].some(function(fn){
return fn(currentAnimation, previousAnimation);
});
}
function hasAnimationClasses(animation, and){
var a=(animation.addClass||'').length > 0;
var b=(animation.removeClass||'').length > 0;
return and ? a&&b:a||b;
}
rules.join.push(function(newAnimation, currentAnimation){
return !newAnimation.structural&&hasAnimationClasses(newAnimation);
});
rules.skip.push(function(newAnimation, currentAnimation){
return !newAnimation.structural&&!hasAnimationClasses(newAnimation);
});
rules.skip.push(function(newAnimation, currentAnimation){
return currentAnimation.event==='leave'&&newAnimation.structural;
});
rules.skip.push(function(newAnimation, currentAnimation){
return currentAnimation.structural&&currentAnimation.state===RUNNING_STATE&&!newAnimation.structural;
});
rules.cancel.push(function(newAnimation, currentAnimation){
return currentAnimation.structural&&newAnimation.structural;
});
rules.cancel.push(function(newAnimation, currentAnimation){
return currentAnimation.state===RUNNING_STATE&&newAnimation.structural;
});
rules.cancel.push(function(newAnimation, currentAnimation){
if(currentAnimation.structural) return false;
var nA=newAnimation.addClass;
var nR=newAnimation.removeClass;
var cA=currentAnimation.addClass;
var cR=currentAnimation.removeClass;
if((isUndefined(nA)&&isUndefined(nR))||(isUndefined(cA)&&isUndefined(cR))){
return false;
}
return hasMatchingClasses(nA, cR)||hasMatchingClasses(nR, cA);
});
this.$get=['$$rAF', '$rootScope', '$rootElement', '$document', '$$Map',
'$$animation', '$$AnimateRunner', '$templateRequest', '$$jqLite', '$$forceReflow',
'$$isDocumentHidden',
function($$rAF,   $rootScope,   $rootElement,   $document,   $$Map,
$$animation,   $$AnimateRunner,   $templateRequest,   $$jqLite,   $$forceReflow,
$$isDocumentHidden){
var activeAnimationsLookup=new $$Map();
var disabledElementsLookup=new $$Map();
var animationsEnabled=null;
function postDigestTaskFactory(){
var postDigestCalled=false;
return function(fn){
if(postDigestCalled){
fn();
}else{
$rootScope.$$postDigest(function(){
postDigestCalled=true;
fn();
});
}};}
var deregisterWatch=$rootScope.$watch(
function(){ return $templateRequest.totalPendingRequests===0; },
function(isEmpty){
if(!isEmpty) return;
deregisterWatch();
$rootScope.$$postDigest(function(){
$rootScope.$$postDigest(function(){
if(animationsEnabled===null){
animationsEnabled=true;
}});
});
}
);
var callbackRegistry=Object.create(null);
var customFilter=$animateProvider.customFilter();
var classNameFilter=$animateProvider.classNameFilter();
var returnTrue=function(){ return true; };
var isAnimatableByFilter=customFilter||returnTrue;
var isAnimatableClassName = !classNameFilter ? returnTrue:function(node, options){
var className=[node.getAttribute('class'), options.addClass, options.removeClass].join(' ');
return classNameFilter.test(className);
};
var applyAnimationClasses=applyAnimationClassesFactory($$jqLite);
function normalizeAnimationDetails(element, animation){
return mergeAnimationDetails(element, animation, {});
}
var contains=window.Node.prototype.contains|| function(arg){
return this===arg||!!(this.compareDocumentPosition(arg) & 16);
};
function findCallbacks(targetParentNode, targetNode, event){
var matches=[];
var entries=callbackRegistry[event];
if(entries){
forEach(entries, function(entry){
if(contains.call(entry.node, targetNode)){
matches.push(entry.callback);
}else if(event==='leave'&&contains.call(entry.node, targetParentNode)){
matches.push(entry.callback);
}});
}
return matches;
}
function filterFromRegistry(list, matchContainer, matchCallback){
var containerNode=extractElementNode(matchContainer);
return list.filter(function(entry){
var isMatch=entry.node===containerNode &&
(!matchCallback||entry.callback===matchCallback);
return !isMatch;
});
}
function cleanupEventListeners(phase, node){
if(phase==='close'&&!node.parentNode){
$animate.off(node);
}}
var $animate={
on: function(event, container, callback){
var node=extractElementNode(container);
callbackRegistry[event]=callbackRegistry[event]||[];
callbackRegistry[event].push({
node: node,
callback: callback
});
jqLite(container).on('$destroy', function(){
var animationDetails=activeAnimationsLookup.get(node);
if(!animationDetails){
$animate.off(event, container, callback);
}});
},
off: function(event, container, callback){
if(arguments.length===1&&!isString(arguments[0])){
container=arguments[0];
for (var eventType in callbackRegistry){
callbackRegistry[eventType]=filterFromRegistry(callbackRegistry[eventType], container);
}
return;
}
var entries=callbackRegistry[event];
if(!entries) return;
callbackRegistry[event]=arguments.length===1
? null
: filterFromRegistry(entries, container, callback);
},
pin: function(element, parentElement){
assertArg(isElement(element), 'element', 'not an element');
assertArg(isElement(parentElement), 'parentElement', 'not an element');
element.data(NG_ANIMATE_PIN_DATA, parentElement);
},
push: function(element, event, options, domOperation){
options=options||{};
options.domOperation=domOperation;
return queueAnimation(element, event, options);
},
enabled: function(element, bool){
var argCount=arguments.length;
if(argCount===0){
bool = !!animationsEnabled;
}else{
var hasElement=isElement(element);
if(!hasElement){
bool=animationsEnabled = !!element;
}else{
var node=getDomNode(element);
if(argCount===1){
bool = !disabledElementsLookup.get(node);
}else{
disabledElementsLookup.set(node, !bool);
}}
}
return bool;
}};
return $animate;
function queueAnimation(originalElement, event, initialOptions){
var options=copy(initialOptions);
var element=stripCommentsFromElement(originalElement);
var node=getDomNode(element);
var parentNode=node&&node.parentNode;
options=prepareAnimationOptions(options);
var runner=new $$AnimateRunner();
var runInNextPostDigestOrNow=postDigestTaskFactory();
if(isArray(options.addClass)){
options.addClass=options.addClass.join(' ');
}
if(options.addClass&&!isString(options.addClass)){
options.addClass=null;
}
if(isArray(options.removeClass)){
options.removeClass=options.removeClass.join(' ');
}
if(options.removeClass&&!isString(options.removeClass)){
options.removeClass=null;
}
if(options.from&&!isObject(options.from)){
options.from=null;
}
if(options.to&&!isObject(options.to)){
options.to=null;
}
if(!animationsEnabled ||
!node ||
!isAnimatableByFilter(node, event, initialOptions) ||
!isAnimatableClassName(node, options)){
close();
return runner;
}
var isStructural=['enter', 'move', 'leave'].indexOf(event) >=0;
var documentHidden=$$isDocumentHidden();
var skipAnimations=documentHidden||disabledElementsLookup.get(node);
var existingAnimation=(!skipAnimations&&activeAnimationsLookup.get(node))||{};
var hasExistingAnimation = !!existingAnimation.state;
if(!skipAnimations&&(!hasExistingAnimation||existingAnimation.state!==PRE_DIGEST_STATE)){
skipAnimations = !areAnimationsAllowed(node, parentNode, event);
}
if(skipAnimations){
if(documentHidden) notifyProgress(runner, event, 'start');
close();
if(documentHidden) notifyProgress(runner, event, 'close');
return runner;
}
if(isStructural){
closeChildAnimations(node);
}
var newAnimation={
structural: isStructural,
element: element,
event: event,
addClass: options.addClass,
removeClass: options.removeClass,
close: close,
options: options,
runner: runner
};
if(hasExistingAnimation){
var skipAnimationFlag=isAllowed('skip', newAnimation, existingAnimation);
if(skipAnimationFlag){
if(existingAnimation.state===RUNNING_STATE){
close();
return runner;
}else{
mergeAnimationDetails(element, existingAnimation, newAnimation);
return existingAnimation.runner;
}}
var cancelAnimationFlag=isAllowed('cancel', newAnimation, existingAnimation);
if(cancelAnimationFlag){
if(existingAnimation.state===RUNNING_STATE){
existingAnimation.runner.end();
}else if(existingAnimation.structural){
existingAnimation.close();
}else{
mergeAnimationDetails(element, existingAnimation, newAnimation);
return existingAnimation.runner;
}}else{
var joinAnimationFlag=isAllowed('join', newAnimation, existingAnimation);
if(joinAnimationFlag){
if(existingAnimation.state===RUNNING_STATE){
normalizeAnimationDetails(element, newAnimation);
}else{
applyGeneratedPreparationClasses(element, isStructural ? event:null, options);
event=newAnimation.event=existingAnimation.event;
options=mergeAnimationDetails(element, existingAnimation, newAnimation);
return existingAnimation.runner;
}}
}}else{
normalizeAnimationDetails(element, newAnimation);
}
var isValidAnimation=newAnimation.structural;
if(!isValidAnimation){
isValidAnimation=(newAnimation.event==='animate'&&Object.keys(newAnimation.options.to||{}).length > 0)
|| hasAnimationClasses(newAnimation);
}
if(!isValidAnimation){
close();
clearElementAnimationState(node);
return runner;
}
var counter=(existingAnimation.counter||0) + 1;
newAnimation.counter=counter;
markElementAnimationState(node, PRE_DIGEST_STATE, newAnimation);
$rootScope.$$postDigest(function(){
element=stripCommentsFromElement(originalElement);
var animationDetails=activeAnimationsLookup.get(node);
var animationCancelled = !animationDetails;
animationDetails=animationDetails||{};
var parentElement=element.parent()||[];
var isValidAnimation=parentElement.length > 0
&& (animationDetails.event==='animate'
|| animationDetails.structural
|| hasAnimationClasses(animationDetails));
if(animationCancelled||animationDetails.counter!==counter||!isValidAnimation){
if(animationCancelled){
applyAnimationClasses(element, options);
applyAnimationStyles(element, options);
}
if(animationCancelled||(isStructural&&animationDetails.event!==event)){
options.domOperation();
runner.end();
}
if(!isValidAnimation){
clearElementAnimationState(node);
}
return;
}
event = !animationDetails.structural&&hasAnimationClasses(animationDetails, true)
? 'setClass'
: animationDetails.event;
markElementAnimationState(node, RUNNING_STATE);
var realRunner=$$animation(element, event, animationDetails.options);
runner.setHost(realRunner);
notifyProgress(runner, event, 'start', {});
realRunner.done(function(status){
close(!status);
var animationDetails=activeAnimationsLookup.get(node);
if(animationDetails&&animationDetails.counter===counter){
clearElementAnimationState(node);
}
notifyProgress(runner, event, 'close', {});
});
});
return runner;
function notifyProgress(runner, event, phase, data){
runInNextPostDigestOrNow(function(){
var callbacks=findCallbacks(parentNode, node, event);
if(callbacks.length){
$$rAF(function(){
forEach(callbacks, function(callback){
callback(element, phase, data);
});
cleanupEventListeners(phase, node);
});
}else{
cleanupEventListeners(phase, node);
}});
runner.progress(event, phase, data);
}
function close(reject){
clearGeneratedClasses(element, options);
applyAnimationClasses(element, options);
applyAnimationStyles(element, options);
options.domOperation();
runner.complete(!reject);
}}
function closeChildAnimations(node){
var children=node.querySelectorAll('[' + NG_ANIMATE_ATTR_NAME + ']');
forEach(children, function(child){
var state=parseInt(child.getAttribute(NG_ANIMATE_ATTR_NAME), 10);
var animationDetails=activeAnimationsLookup.get(child);
if(animationDetails){
switch (state){
case RUNNING_STATE:
animationDetails.runner.end();
case PRE_DIGEST_STATE:
activeAnimationsLookup.delete(child);
break;
}}
});
}
function clearElementAnimationState(node){
node.removeAttribute(NG_ANIMATE_ATTR_NAME);
activeAnimationsLookup.delete(node);
}
function areAnimationsAllowed(node, parentNode, event){
var bodyNode=$document[0].body;
var rootNode=getDomNode($rootElement);
var bodyNodeDetected=(node===bodyNode)||node.nodeName==='HTML';
var rootNodeDetected=(node===rootNode);
var parentAnimationDetected=false;
var elementDisabled=disabledElementsLookup.get(node);
var animateChildren;
var parentHost=jqLite.data(node, NG_ANIMATE_PIN_DATA);
if(parentHost){
parentNode=getDomNode(parentHost);
}
while (parentNode){
if(!rootNodeDetected){
rootNodeDetected=(parentNode===rootNode);
}
if(parentNode.nodeType!==ELEMENT_NODE){
break;
}
var details=activeAnimationsLookup.get(parentNode)||{};
if(!parentAnimationDetected){
var parentNodeDisabled=disabledElementsLookup.get(parentNode);
if(parentNodeDisabled===true&&elementDisabled!==false){
elementDisabled=true;
break;
}else if(parentNodeDisabled===false){
elementDisabled=false;
}
parentAnimationDetected=details.structural;
}
if(isUndefined(animateChildren)||animateChildren===true){
var value=jqLite.data(parentNode, NG_ANIMATE_CHILDREN_DATA);
if(isDefined(value)){
animateChildren=value;
}}
if(parentAnimationDetected&&animateChildren===false) break;
if(!bodyNodeDetected){
bodyNodeDetected=(parentNode===bodyNode);
}
if(bodyNodeDetected&&rootNodeDetected){
break;
}
if(!rootNodeDetected){
parentHost=jqLite.data(parentNode, NG_ANIMATE_PIN_DATA);
if(parentHost){
parentNode=getDomNode(parentHost);
continue;
}}
parentNode=parentNode.parentNode;
}
var allowAnimation=(!parentAnimationDetected||animateChildren)&&elementDisabled!==true;
return allowAnimation&&rootNodeDetected&&bodyNodeDetected;
}
function markElementAnimationState(node, state, details){
details=details||{};
details.state=state;
node.setAttribute(NG_ANIMATE_ATTR_NAME, state);
var oldValue=activeAnimationsLookup.get(node);
var newValue=oldValue
? extend(oldValue, details)
: details;
activeAnimationsLookup.set(node, newValue);
}}];
}];
var $$AnimationProvider=['$animateProvider',  function($animateProvider){
var NG_ANIMATE_REF_ATTR='ng-animate-ref';
var drivers=this.drivers=[];
var RUNNER_STORAGE_KEY='$$animationRunner';
function setRunner(element, runner){
element.data(RUNNER_STORAGE_KEY, runner);
}
function removeRunner(element){
element.removeData(RUNNER_STORAGE_KEY);
}
function getRunner(element){
return element.data(RUNNER_STORAGE_KEY);
}
this.$get=['$$jqLite', '$rootScope', '$injector', '$$AnimateRunner', '$$Map', '$$rAFScheduler',
function($$jqLite,   $rootScope,   $injector,   $$AnimateRunner,   $$Map,   $$rAFScheduler){
var animationQueue=[];
var applyAnimationClasses=applyAnimationClassesFactory($$jqLite);
function sortAnimations(animations){
var tree={ children: [] };
var i, lookup=new $$Map();
for (i=0; i < animations.length; i++){
var animation=animations[i];
lookup.set(animation.domNode, animations[i]={
domNode: animation.domNode,
fn: animation.fn,
children: []
});
}
for (i=0; i < animations.length; i++){
processNode(animations[i]);
}
return flatten(tree);
function processNode(entry){
if(entry.processed) return entry;
entry.processed=true;
var elementNode=entry.domNode;
var parentNode=elementNode.parentNode;
lookup.set(elementNode, entry);
var parentEntry;
while (parentNode){
parentEntry=lookup.get(parentNode);
if(parentEntry){
if(!parentEntry.processed){
parentEntry=processNode(parentEntry);
}
break;
}
parentNode=parentNode.parentNode;
}
(parentEntry||tree).children.push(entry);
return entry;
}
function flatten(tree){
var result=[];
var queue=[];
var i;
for (i=0; i < tree.children.length; i++){
queue.push(tree.children[i]);
}
var remainingLevelEntries=queue.length;
var nextLevelEntries=0;
var row=[];
for (i=0; i < queue.length; i++){
var entry=queue[i];
if(remainingLevelEntries <=0){
remainingLevelEntries=nextLevelEntries;
nextLevelEntries=0;
result.push(row);
row=[];
}
row.push(entry.fn);
entry.children.forEach(function(childEntry){
nextLevelEntries++;
queue.push(childEntry);
});
remainingLevelEntries--;
}
if(row.length){
result.push(row);
}
return result;
}}
return function(element, event, options){
options=prepareAnimationOptions(options);
var isStructural=['enter', 'move', 'leave'].indexOf(event) >=0;
var runner=new $$AnimateRunner({
end: function(){ close(); },
cancel: function(){ close(true); }});
if(!drivers.length){
close();
return runner;
}
setRunner(element, runner);
var classes=mergeClasses(element.attr('class'), mergeClasses(options.addClass, options.removeClass));
var tempClasses=options.tempClasses;
if(tempClasses){
classes +=' ' + tempClasses;
options.tempClasses=null;
}
var prepareClassName;
if(isStructural){
prepareClassName='ng-' + event + PREPARE_CLASS_SUFFIX;
$$jqLite.addClass(element, prepareClassName);
}
animationQueue.push({
element: element,
classes: classes,
event: event,
structural: isStructural,
options: options,
beforeStart: beforeStart,
close: close
});
element.on('$destroy', handleDestroyedElement);
if(animationQueue.length > 1) return runner;
$rootScope.$$postDigest(function(){
var animations=[];
forEach(animationQueue, function(entry){
if(getRunner(entry.element)){
animations.push(entry);
}else{
entry.close();
}});
animationQueue.length=0;
var groupedAnimations=groupAnimations(animations);
var toBeSortedAnimations=[];
forEach(groupedAnimations, function(animationEntry){
toBeSortedAnimations.push({
domNode: getDomNode(animationEntry.from ? animationEntry.from.element:animationEntry.element),
fn: function triggerAnimationStart(){
animationEntry.beforeStart();
var startAnimationFn, closeFn=animationEntry.close;
var targetElement=animationEntry.anchors
? (animationEntry.from.element||animationEntry.to.element)
: animationEntry.element;
if(getRunner(targetElement)){
var operation=invokeFirstDriver(animationEntry);
if(operation){
startAnimationFn=operation.start;
}}
if(!startAnimationFn){
closeFn();
}else{
var animationRunner=startAnimationFn();
animationRunner.done(function(status){
closeFn(!status);
});
updateAnimationRunners(animationEntry, animationRunner);
}}
});
});
$$rAFScheduler(sortAnimations(toBeSortedAnimations));
});
return runner;
function getAnchorNodes(node){
var SELECTOR='[' + NG_ANIMATE_REF_ATTR + ']';
var items=node.hasAttribute(NG_ANIMATE_REF_ATTR)
? [node]
: node.querySelectorAll(SELECTOR);
var anchors=[];
forEach(items, function(node){
var attr=node.getAttribute(NG_ANIMATE_REF_ATTR);
if(attr&&attr.length){
anchors.push(node);
}});
return anchors;
}
function groupAnimations(animations){
var preparedAnimations=[];
var refLookup={};
forEach(animations, function(animation, index){
var element=animation.element;
var node=getDomNode(element);
var event=animation.event;
var enterOrMove=['enter', 'move'].indexOf(event) >=0;
var anchorNodes=animation.structural ? getAnchorNodes(node):[];
if(anchorNodes.length){
var direction=enterOrMove ? 'to':'from';
forEach(anchorNodes, function(anchor){
var key=anchor.getAttribute(NG_ANIMATE_REF_ATTR);
refLookup[key]=refLookup[key]||{};
refLookup[key][direction]={
animationID: index,
element: jqLite(anchor)
};});
}else{
preparedAnimations.push(animation);
}});
var usedIndicesLookup={};
var anchorGroups={};
forEach(refLookup, function(operations, key){
var from=operations.from;
var to=operations.to;
if(!from||!to){
var index=from ? from.animationID:to.animationID;
var indexKey=index.toString();
if(!usedIndicesLookup[indexKey]){
usedIndicesLookup[indexKey]=true;
preparedAnimations.push(animations[index]);
}
return;
}
var fromAnimation=animations[from.animationID];
var toAnimation=animations[to.animationID];
var lookupKey=from.animationID.toString();
if(!anchorGroups[lookupKey]){
var group=anchorGroups[lookupKey]={
structural: true,
beforeStart: function(){
fromAnimation.beforeStart();
toAnimation.beforeStart();
},
close: function(){
fromAnimation.close();
toAnimation.close();
},
classes: cssClassesIntersection(fromAnimation.classes, toAnimation.classes),
from: fromAnimation,
to: toAnimation,
anchors: []
};
if(group.classes.length){
preparedAnimations.push(group);
}else{
preparedAnimations.push(fromAnimation);
preparedAnimations.push(toAnimation);
}}
anchorGroups[lookupKey].anchors.push({
'out': from.element, 'in': to.element
});
});
return preparedAnimations;
}
function cssClassesIntersection(a,b){
a=a.split(' ');
b=b.split(' ');
var matches=[];
for (var i=0; i < a.length; i++){
var aa=a[i];
if(aa.substring(0,3)==='ng-') continue;
for (var j=0; j < b.length; j++){
if(aa===b[j]){
matches.push(aa);
break;
}}
}
return matches.join(' ');
}
function invokeFirstDriver(animationDetails){
for (var i=drivers.length - 1; i >=0; i--){
var driverName=drivers[i];
var factory=$injector.get(driverName);
var driver=factory(animationDetails);
if(driver){
return driver;
}}
}
function beforeStart(){
element.addClass(NG_ANIMATE_CLASSNAME);
if(tempClasses){
$$jqLite.addClass(element, tempClasses);
}
if(prepareClassName){
$$jqLite.removeClass(element, prepareClassName);
prepareClassName=null;
}}
function updateAnimationRunners(animation, newRunner){
if(animation.from&&animation.to){
update(animation.from.element);
update(animation.to.element);
}else{
update(animation.element);
}
function update(element){
var runner=getRunner(element);
if(runner) runner.setHost(newRunner);
}}
function handleDestroyedElement(){
var runner=getRunner(element);
if(runner&&(event!=='leave'||!options.$$domOperationFired)){
runner.end();
}}
function close(rejected){
element.off('$destroy', handleDestroyedElement);
removeRunner(element);
applyAnimationClasses(element, options);
applyAnimationStyles(element, options);
options.domOperation();
if(tempClasses){
$$jqLite.removeClass(element, tempClasses);
}
element.removeClass(NG_ANIMATE_CLASSNAME);
runner.complete(!rejected);
}};}];
}];
/**
* @ngdoc directive
* @name ngAnimateSwap
* @restrict A
* @scope
*
* @description
*
* ngAnimateSwap is a animation-oriented directive that allows for the container to
* be removed and entered in whenever the associated expression changes. A
* common usecase for this directive is a rotating banner or slider component which
* contains one image being present at a time. When the active image changes
* then the old image will perform a `leave` animation and the new element
* will be inserted via an `enter` animation.
*
* @animations
* | Animation                        | Occurs                               |
* |----------------------------------|--------------------------------------|
* | {@link ng.$animate#enter enter}  | when the new element is inserted to the DOM  |
* | {@link ng.$animate#leave leave}  | when the old element is removed from the DOM |
*
* @example
* <example name="ngAnimateSwap-directive" module="ngAnimateSwapExample"
*          deps="angular-animate.js"
*          animations="true" fixBase="true">
*   <file name="index.html">
*     <div class="container" ng-controller="AppCtrl">
*       <div ng-animate-swap="number" class="cell swap-animation" ng-class="colorClass(number)">
*         {{ number }}
*       </div>
*     </div>
*   </file>
*   <file name="script.js">
*     angular.module('ngAnimateSwapExample', ['ngAnimate'])
*       .controller('AppCtrl', ['$scope', '$interval', function($scope, $interval){
*         $scope.number=0;
*         $interval(function(){
*           $scope.number++;
*         }, 1000);
*
*         var colors=['red','blue','green','yellow','orange'];
*         $scope.colorClass=function(number){
*           return colors[number % colors.length];
*         };
*       }]);
*   </file>
*  <file name="animations.css">
*  .container {
*    height:250px;
*    width:250px;
*    position:relative;
*    overflow:hidden;
*    border:2px solid black;
*  }
*  .container .cell {
*    font-size:150px;
*    text-align:center;
*    line-height:250px;
*    position:absolute;
*    top:0;
*    left:0;
*    right:0;
*    border-bottom:2px solid black;
*  }
*  .swap-animation.ng-enter, .swap-animation.ng-leave {
*    transition:0.5s linear all;
*  }
*  .swap-animation.ng-enter {
*    top:-250px;
*  }
*  .swap-animation.ng-enter-active {
*    top:0px;
*  }
*  .swap-animation.ng-leave {
*    top:0px;
*  }
*  .swap-animation.ng-leave-active {
*    top:250px;
*  }
*  .red { background:red; }
*  .green { background:green; }
*  .blue { background:blue; }
*  .yellow { background:yellow; }
*  .orange { background:orange; }
*  </file>
* </example>
*/
var ngAnimateSwapDirective=['$animate', '$rootScope', function($animate, $rootScope){
return {
restrict: 'A',
transclude: 'element',
terminal: true,
priority: 600,
link: function(scope, $element, attrs, ctrl, $transclude){
var previousElement, previousScope;
scope.$watchCollection(attrs.ngAnimateSwap||attrs['for'], function(value){
if(previousElement){
$animate.leave(previousElement);
}
if(previousScope){
previousScope.$destroy();
previousScope=null;
}
if(value||value===0){
previousScope=scope.$new();
$transclude(previousScope, function(element){
previousElement=element;
$animate.enter(element, null, $element);
});
}});
}};}];
/**
* @ngdoc module
* @name ngAnimate
* @description
*
* The `ngAnimate` module provides support for CSS-based animations (keyframes and transitions) as well as JavaScript-based animations via
* callback hooks. Animations are not enabled by default, however, by including `ngAnimate` the animation hooks are enabled for an AngularJS app.
*
* ## Usage
* Simply put, there are two ways to make use of animations when ngAnimate is used: by using **CSS** and **JavaScript**. The former works purely based
* using CSS (by using matching CSS selectors/styles) and the latter triggers animations that are registered via `module.animation()`. For
* both CSS and JS animations the sole requirement is to have a matching `CSS class` that exists both in the registered animation and within
* the HTML element that the animation will be triggered on.
*
* ## Directive Support
* The following directives are "animation aware":
*
* | Directive                                                                                                | Supported Animations                                                     |
* |----------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------|
* | {@link ng.directive:ngRepeat#animations ngRepeat}                                                        | enter, leave and move                                                    |
* | {@link ngRoute.directive:ngView#animations ngView}                                                       | enter and leave                                                          |
* | {@link ng.directive:ngInclude#animations ngInclude}                                                      | enter and leave                                                          |
* | {@link ng.directive:ngSwitch#animations ngSwitch}                                                        | enter and leave                                                          |
* | {@link ng.directive:ngIf#animations ngIf}                                                                | enter and leave                                                          |
* | {@link ng.directive:ngClass#animations ngClass}                                                          | add and remove (the CSS class(es) present)                               |
* | {@link ng.directive:ngShow#animations ngShow} & {@link ng.directive:ngHide#animations ngHide}            | add and remove (the ng-hide class value)                                 |
* | {@link ng.directive:form#animations form} & {@link ng.directive:ngModel#animations ngModel}    | add and remove (dirty, pristine, valid, invalid & all other validations) |
* | {@link module:ngMessages#animations ngMessages}                                                          | add and remove (ng-active & ng-inactive)                                 |
* | {@link module:ngMessages#animations ngMessage}                                                           | enter and leave                                                          |
*
* (More information can be found by visiting each the documentation associated with each directive.)
*
* ## CSS-based Animations
*
* CSS-based animations with ngAnimate are unique since they require no JavaScript code at all. By using a CSS class that we reference between our HTML
* and CSS code we can create an animation that will be picked up by AngularJS when an underlying directive performs an operation.
*
* The example below shows how an `enter` animation can be made possible on an element using `ng-if`:
*
* ```html
* <div ng-if="bool" class="fade">
*    Fade me in out
* </div>
* <button ng-click="bool=true">Fade In!</button>
* <button ng-click="bool=false">Fade Out!</button>
* ```
*
* Notice the CSS class **fade**? We can now create the CSS transition code that references this class:
*
* ```css
* /&#42; The starting CSS styles for the enter animation &#42;/
* .fade.ng-enter {
*   transition:0.5s linear all;
*   opacity:0;
* }
*
* /&#42; The finishing CSS styles for the enter animation &#42;/
* .fade.ng-enter.ng-enter-active {
*   opacity:1;
* }
* ```
*
* The key thing to remember here is that, depending on the animation event (which each of the directives above trigger depending on what's going on) two
* generated CSS classes will be applied to the element; in the example above we have `.ng-enter` and `.ng-enter-active`. For CSS transitions, the transition
* code **must** be defined within the starting CSS class (in this case `.ng-enter`). The destination class is what the transition will animate towards.
*
* If for example we wanted to create animations for `leave` and `move` (ngRepeat triggers move) then we can do so using the same CSS naming conventions:
*
* ```css
* /&#42; now the element will fade out before it is removed from the DOM &#42;/
* .fade.ng-leave {
*   transition:0.5s linear all;
*   opacity:1;
* }
* .fade.ng-leave.ng-leave-active {
*   opacity:0;
* }
* ```
*
* We can also make use of **CSS Keyframes** by referencing the keyframe animation within the starting CSS class:
*
* ```css
* /&#42; there is no need to define anything inside of the destination
* CSS class since the keyframe will take charge of the animation &#42;/
* .fade.ng-leave {
*   animation: my_fade_animation 0.5s linear;
*   -webkit-animation: my_fade_animation 0.5s linear;
* }
*
* @keyframes my_fade_animation {
*   from { opacity:1; }
*   to { opacity:0; }
* }
*
* @-webkit-keyframes my_fade_animation {
*   from { opacity:1; }
*   to { opacity:0; }
* }
* ```
*
* Feel free also mix transitions and keyframes together as well as any other CSS classes on the same element.
*
* ### CSS Class-based Animations
*
* Class-based animations (animations that are triggered via `ngClass`, `ngShow`, `ngHide` and some other directives) have a slightly different
* naming convention. Class-based animations are basic enough that a standard transition or keyframe can be referenced on the class being added
* and removed.
*
* For example if we wanted to do a CSS animation for `ngHide` then we place an animation on the `.ng-hide` CSS class:
*
* ```html
* <div ng-show="bool" class="fade">
*   Show and hide me
* </div>
* <button ng-click="bool=!bool">Toggle</button>
*
* <style>
* .fade.ng-hide {
*   transition:0.5s linear all;
*   opacity:0;
* }
* </style>
* ```
*
* All that is going on here with ngShow/ngHide behind the scenes is the `.ng-hide` class is added/removed (when the hidden state is valid). Since
* ngShow and ngHide are animation aware then we can match up a transition and ngAnimate handles the rest.
*
* In addition the addition and removal of the CSS class, ngAnimate also provides two helper methods that we can use to further decorate the animation
* with CSS styles.
*
* ```html
* <div ng-class="{on:onOff}" class="highlight">
*   Highlight this box
* </div>
* <button ng-click="onOff=!onOff">Toggle</button>
*
* <style>
* .highlight {
*   transition:0.5s linear all;
* }
* .highlight.on-add {
*   background:white;
* }
* .highlight.on {
*   background:yellow;
* }
* .highlight.on-remove {
*   background:black;
* }
* </style>
* ```
*
* We can also make use of CSS keyframes by placing them within the CSS classes.
*
*
* ### CSS Staggering Animations
* A Staggering animation is a collection of animations that are issued with a slight delay in between each successive operation resulting in a
* curtain-like effect. The ngAnimate module (versions >=1.2) supports staggering animations and the stagger effect can be
* performed by creating a **ng-EVENT-stagger** CSS class and attaching that class to the base CSS class used for
* the animation. The style property expected within the stagger class can either be a **transition-delay** or an
* **animation-delay** property (or both if your animation contains both transitions and keyframe animations).
*
* ```css
* .my-animation.ng-enter {
*   /&#42; standard transition code &#42;/
*   transition: 1s linear all;
*   opacity:0;
* }
* .my-animation.ng-enter-stagger {
*   /&#42; this will have a 100ms delay between each successive leave animation &#42;/
*   transition-delay: 0.1s;
*
*   /&#42; As of 1.4.4, this must always be set: it signals ngAnimate
*     to not accidentally inherit a delay property from another CSS class &#42;/
*   transition-duration: 0s;
*
*   /&#42; if you are using animations instead of transitions you should configure as follows:
*     animation-delay: 0.1s;
*     animation-duration: 0s; &#42;/
* }
* .my-animation.ng-enter.ng-enter-active {
*   /&#42; standard transition styles &#42;/
*   opacity:1;
* }
* ```
*
* Staggering animations work by default in ngRepeat (so long as the CSS class is defined). Outside of ngRepeat, to use staggering animations
* on your own, they can be triggered by firing multiple calls to the same event on $animate. However, the restrictions surrounding this
* are that each of the elements must have the same CSS className value as well as the same parent element. A stagger operation
* will also be reset if one or more animation frames have passed since the multiple calls to `$animate` were fired.
*
* The following code will issue the **ng-leave-stagger** event on the element provided:
*
* ```js
* var kids=parent.children();
*
* $animate.leave(kids[0]);
* $animate.leave(kids[1]);
* $animate.leave(kids[2]);
* $animate.leave(kids[3]);
* $animate.leave(kids[4]);
*
* window.requestAnimationFrame(function(){
*
*   $animate.leave(kids[5]);
*   $animate.leave(kids[6]);
*
*   $scope.$digest();
* });
* ```
*
* Stagger animations are currently only supported within CSS-defined animations.
*
* ### The `ng-animate` CSS class
*
* When ngAnimate is animating an element it will apply the `ng-animate` CSS class to the element for the duration of the animation.
* This is a temporary CSS class and it will be removed once the animation is over (for both JavaScript and CSS-based animations).
*
* Therefore, animations can be applied to an element using this temporary class directly via CSS.
*
* ```css
* .zipper.ng-animate {
*   transition:0.5s linear all;
* }
* .zipper.ng-enter {
*   opacity:0;
* }
* .zipper.ng-enter.ng-enter-active {
*   opacity:1;
* }
* .zipper.ng-leave {
*   opacity:1;
* }
* .zipper.ng-leave.ng-leave-active {
*   opacity:0;
* }
* ```
*
* (Note that the `ng-animate` CSS class is reserved and it cannot be applied on an element directly since ngAnimate will always remove
* the CSS class once an animation has completed.)
*
*
* ### The `ng-[event]-prepare` class
*
* This is a special class that can be used to prevent unwanted flickering / flash of content before
* the actual animation starts. The class is added as soon as an animation is initialized, but removed
* before the actual animation starts (after waiting for a $digest).
* It is also only added for *structural* animations (`enter`, `move`, and `leave`).
*
* In practice, flickering can appear when nesting elements with structural animations such as `ngIf`
* into elements that have class-based animations such as `ngClass`.
*
* ```html
* <div ng-class="{red: myProp}">
*   <div ng-class="{blue: myProp}">
*     <div class="message" ng-if="myProp"></div>
*   </div>
* </div>
* ```
*
* It is possible that during the `enter` animation, the `.message` div will be briefly visible before it starts animating.
* In that case, you can add styles to the CSS that make sure the element stays hidden before the animation starts:
*
* ```css
* .message.ng-enter-prepare {
*   opacity: 0;
* }
*
* ```
*
* ## JavaScript-based Animations
*
* ngAnimate also allows for animations to be consumed by JavaScript code. The approach is similar to CSS-based animations (where there is a shared
* CSS class that is referenced in our HTML code) but in addition we need to register the JavaScript animation on the module. By making use of the
* `module.animation()` module function we can register the animation.
*
* Let's see an example of a enter/leave animation using `ngRepeat`:
*
* ```html
* <div ng-repeat="item in items" class="slide">
*   {{ item }}
* </div>
* ```
*
* See the **slide** CSS class? Let's use that class to define an animation that we'll structure in our module code by using `module.animation`:
*
* ```js
* myModule.animation('.slide', [function(){
*   return {
*
*
*     enter: function(element, doneFn){
*       jQuery(element).fadeIn(1000, doneFn);
*
*
*
*     },
*
*     move: function(element, doneFn){
*       jQuery(element).fadeIn(1000, doneFn);
*     },
*
*     leave: function(element, doneFn){
*       jQuery(element).fadeOut(1000, doneFn);
*     }
*   }
* }]);
* ```
*
* The nice thing about JS-based animations is that we can inject other services and make use of advanced animation libraries such as
* greensock.js and velocity.js.
*
* If our animation code class-based (meaning that something like `ngClass`, `ngHide` and `ngShow` triggers it) then we can still define
* our animations inside of the same registered animation, however, the function input arguments are a bit different:
*
* ```html
* <div ng-class="color" class="colorful">
*   this box is moody
* </div>
* <button ng-click="color='red'">Change to red</button>
* <button ng-click="color='blue'">Change to blue</button>
* <button ng-click="color='green'">Change to green</button>
* ```
*
* ```js
* myModule.animation('.colorful', [function(){
*   return {
*     addClass: function(element, className, doneFn){
*
*     },
*     removeClass: function(element, className, doneFn){
*
*     },
*     setClass: function(element, addedClass, removedClass, doneFn){
*
*     }
*   }
* }]);
* ```
*
* ## CSS + JS Animations Together
*
* AngularJS 1.4 and higher has taken steps to make the amalgamation of CSS and JS animations more flexible. However, unlike earlier versions of AngularJS,
* defining CSS and JS animations to work off of the same CSS class will not work anymore. Therefore the example below will only result in **JS animations taking
* charge of the animation**:
*
* ```html
* <div ng-if="bool" class="slide">
*   Slide in and out
* </div>
* ```
*
* ```js
* myModule.animation('.slide', [function(){
*   return {
*     enter: function(element, doneFn){
*       jQuery(element).slideIn(1000, doneFn);
*     }
*   }
* }]);
* ```
*
* ```css
* .slide.ng-enter {
*   transition:0.5s linear all;
*   transform:translateY(-100px);
* }
* .slide.ng-enter.ng-enter-active {
*   transform:translateY(0);
* }
* ```
*
* Does this mean that CSS and JS animations cannot be used together? Do JS-based animations always have higher priority? We can make up for the
* lack of CSS animations by using the `$animateCss` service to trigger our own tweaked-out, CSS-based animations directly from
* our own JS-based animation code:
*
* ```js
* myModule.animation('.slide', ['$animateCss', function($animateCss){
*   return {
*     enter: function(element){
*
*       return $animateCss(element, {
*         event: 'enter',
*         structural: true
*       });
*     }
*   }
* }]);
* ```
*
* The nice thing here is that we can save bandwidth by sticking to our CSS-based animation code and we don't need to rely on a 3rd-party animation framework.
*
* The `$animateCss` service is very powerful since we can feed in all kinds of extra properties that will be evaluated and fed into a CSS transition or
* keyframe animation. For example if we wanted to animate the height of an element while adding and removing classes then we can do so by providing that
* data into `$animateCss` directly:
*
* ```js
* myModule.animation('.slide', ['$animateCss', function($animateCss){
*   return {
*     enter: function(element){
*       return $animateCss(element, {
*         event: 'enter',
*         structural: true,
*         addClass: 'maroon-setting',
*         from: { height:0 },
*         to: { height: 200 }
*       });
*     }
*   }
* }]);
* ```
*
* Now we can fill in the rest via our transition CSS code:
*
* ```css
* /&#42; the transition tells ngAnimate to make the animation happen &#42;/
* .slide.ng-enter { transition:0.5s linear all; }
*
* /&#42; this extra CSS class will be absorbed into the transition
* since the $animateCss code is adding the class &#42;/
* .maroon-setting { background:red; }
* ```
*
* And `$animateCss` will figure out the rest. Just make sure to have the `done()` callback fire the `doneFn` function to signal when the animation is over.
*
* To learn more about what's possible be sure to visit the {@link ngAnimate.$animateCss $animateCss service}.
*
* ## Animation Anchoring (via `ng-animate-ref`)
*
* ngAnimate in AngularJS 1.4 comes packed with the ability to cross-animate elements between
* structural areas of an application (like views) by pairing up elements using an attribute
* called `ng-animate-ref`.
*
* Let's say for example we have two views that are managed by `ng-view` and we want to show
* that there is a relationship between two components situated in within these views. By using the
* `ng-animate-ref` attribute we can identify that the two components are paired together and we
* can then attach an animation, which is triggered when the view changes.
*
* Say for example we have the following template code:
*
* ```html
* <!-- index.html -->
* <div ng-view class="view-animation">
* </div>
*
* <!-- home.html -->
* <a href="#/banner-page">
*   <img src="./banner.jpg" class="banner" ng-animate-ref="banner">
* </a>
*
* <!-- banner-page.html -->
* <img src="./banner.jpg" class="banner" ng-animate-ref="banner">
* ```
*
* Now, when the view changes (once the link is clicked), ngAnimate will examine the
* HTML contents to see if there is a match reference between any components in the view
* that is leaving and the view that is entering. It will scan both the view which is being
* removed (leave) and inserted (enter) to see if there are any paired DOM elements that
* contain a matching ref value.
*
* The two images match since they share the same ref value. ngAnimate will now create a
* transport element (which is a clone of the first image element) and it will then attempt
* to animate to the position of the second image element in the next view. For the animation to
* work a special CSS class called `ng-anchor` will be added to the transported element.
*
* We can now attach a transition onto the `.banner.ng-anchor` CSS class and then
* ngAnimate will handle the entire transition for us as well as the addition and removal of
* any changes of CSS classes between the elements:
*
* ```css
* .banner.ng-anchor {
*   /&#42; this animation will last for 1 second since there are
*          two phases to the animation (an `in` and an `out` phase) &#42;/
*   transition:0.5s linear all;
* }
* ```
*
* We also **must** include animations for the views that are being entered and removed
* (otherwise anchoring wouldn't be possible since the new view would be inserted right away).
*
* ```css
* .view-animation.ng-enter, .view-animation.ng-leave {
*   transition:0.5s linear all;
*   position:fixed;
*   left:0;
*   top:0;
*   width:100%;
* }
* .view-animation.ng-enter {
*   transform:translateX(100%);
* }
* .view-animation.ng-leave,
* .view-animation.ng-enter.ng-enter-active {
*   transform:translateX(0%);
* }
* .view-animation.ng-leave.ng-leave-active {
*   transform:translateX(-100%);
* }
* ```
*
* Now we can jump back to the anchor animation. When the animation happens, there are two stages that occur:
* an `out` and an `in` stage. The `out` stage happens first and that is when the element is animated away
* from its origin. Once that animation is over then the `in` stage occurs which animates the
* element to its destination. The reason why there are two animations is to give enough time
* for the enter animation on the new element to be ready.
*
* The example above sets up a transition for both the in and out phases, but we can also target the out or
* in phases directly via `ng-anchor-out` and `ng-anchor-in`.
*
* ```css
* .banner.ng-anchor-out {
*   transition: 0.5s linear all;
*
*   /&#42; the scale will be applied during the out animation,
*          but will be animated away when the in animation runs &#42;/
*   transform: scale(1.2);
* }
*
* .banner.ng-anchor-in {
*   transition: 1s linear all;
* }
* ```
*
*
*
*
* ### Anchoring Demo
*
<example module="anchoringExample"
name="anchoringExample"
id="anchoringExample"
deps="angular-animate.js;angular-route.js"
animations="true">
<file name="index.html">
<a href="#!/">Home</a>
<hr />
<div class="view-container">
<div ng-view class="view"></div>
</div>
</file>
<file name="script.js">
angular.module('anchoringExample', ['ngAnimate', 'ngRoute'])
.config(['$routeProvider', function($routeProvider){
$routeProvider.when('/', {
templateUrl: 'home.html',
controller: 'HomeController as home'
});
$routeProvider.when('/profile/:id', {
templateUrl: 'profile.html',
controller: 'ProfileController as profile'
});
}])
.run(['$rootScope', function($rootScope){
$rootScope.records=[
{ id: 1, title: 'Miss Beulah Roob' },
{ id: 2, title: 'Trent Morissette' },
{ id: 3, title: 'Miss Ava Pouros' },
{ id: 4, title: 'Rod Pouros' },
{ id: 5, title: 'Abdul Rice' },
{ id: 6, title: 'Laurie Rutherford Sr.' },
{ id: 7, title: 'Nakia McLaughlin' },
{ id: 8, title: 'Jordon Blanda DVM' },
{ id: 9, title: 'Rhoda Hand' },
{ id: 10, title: 'Alexandrea Sauer' }
];
}])
.controller('HomeController', [function(){
}])
.controller('ProfileController', ['$rootScope', '$routeParams',
function ProfileController($rootScope, $routeParams){
var index=parseInt($routeParams.id, 10);
var record=$rootScope.records[index - 1];
this.title=record.title;
this.id=record.id;
}]);
</file>
<file name="home.html">
<h2>Welcome to the home page</h1>
<p>Please click on an element</p>
<a class="record"
ng-href="#!/profile/{{ record.id }}"
ng-animate-ref="{{ record.id }}"
ng-repeat="record in records">
{{ record.title }}
</a>
</file>
<file name="profile.html">
<div class="profile record" ng-animate-ref="{{ profile.id }}">
{{ profile.title }}
</div>
</file>
<file name="animations.css">
.record {
display:block;
font-size:20px;
}
.profile {
background:black;
color:white;
font-size:100px;
}
.view-container {
position:relative;
}
.view-container > .view.ng-animate {
position:absolute;
top:0;
left:0;
width:100%;
min-height:500px;
}
.view.ng-enter, .view.ng-leave,
.record.ng-anchor {
transition:0.5s linear all;
}
.view.ng-enter {
transform:translateX(100%);
}
.view.ng-enter.ng-enter-active, .view.ng-leave {
transform:translateX(0%);
}
.view.ng-leave.ng-leave-active {
transform:translateX(-100%);
}
.record.ng-anchor-out {
background:red;
}
</file>
</example>
*
* ### How is the element transported?
*
* When an anchor animation occurs, ngAnimate will clone the starting element and position it exactly where the starting
* element is located on screen via absolute positioning. The cloned element will be placed inside of the root element
* of the application (where ng-app was defined) and all of the CSS classes of the starting element will be applied. The
* element will then animate into the `out` and `in` animations and will eventually reach the coordinates and match
* the dimensions of the destination element. During the entire animation a CSS class of `.ng-animate-shim` will be applied
* to both the starting and destination elements in order to hide them from being visible (the CSS styling for the class
* is: `visibility:hidden`). Once the anchor reaches its destination then it will be removed and the destination element
* will become visible since the shim class will be removed.
*
* ### How is the morphing handled?
*
* CSS Anchoring relies on transitions and keyframes and the internal code is intelligent enough to figure out
* what CSS classes differ between the starting element and the destination element. These different CSS classes
* will be added/removed on the anchor element and a transition will be applied (the transition that is provided
* in the anchor class). Long story short, ngAnimate will figure out what classes to add and remove which will
* make the transition of the element as smooth and automatic as possible. Be sure to use simple CSS classes that
* do not rely on DOM nesting structure so that the anchor element appears the same as the starting element (since
* the cloned element is placed inside of root element which is likely close to the body element).
*
* Note that if the root element is on the `<html>` element then the cloned node will be placed inside of body.
*
*
* ## Using $animate in your directive code
*
* So far we've explored how to feed in animations into an AngularJS application, but how do we trigger animations within our own directives in our application?
* By injecting the `$animate` service into our directive code, we can trigger structural and class-based hooks which can then be consumed by animations. Let's
* imagine we have a greeting box that shows and hides itself when the data changes
*
* ```html
* <greeting-box active="onOrOff">Hi there</greeting-box>
* ```
*
* ```js
* ngModule.directive('greetingBox', ['$animate', function($animate){
*   return function(scope, element, attrs){
*     attrs.$observe('active', function(value){
*       value ? $animate.addClass(element, 'on'):$animate.removeClass(element, 'on');
*     });
*   });
* }]);
* ```
*
* Now the `on` CSS class is added and removed on the greeting box component. Now if we add a CSS class on top of the greeting box element
* in our HTML code then we can trigger a CSS or JS animation to happen.
*
* ```css
* /&#42; normally we would create a CSS class to reference on the element &#42;/
* greeting-box.on { transition:0.5s linear all; background:green; color:white; }
* ```
*
* The `$animate` service contains a variety of other methods like `enter`, `leave`, `animate` and `setClass`. To learn more about what's
* possible be sure to visit the {@link ng.$animate $animate service API page}.
*
*
* ## Callbacks and Promises
*
* When `$animate` is called it returns a promise that can be used to capture when the animation has ended. Therefore if we were to trigger
* an animation (within our directive code) then we can continue performing directive and scope related activities after the animation has
* ended by chaining onto the returned promise that animation method returns.
*
* ```js
*
* $animate.enter(element, parent).then(function(){
*
* });
* ```
*
* (Note that earlier versions of AngularJS prior to v1.4 required the promise code to be wrapped using `$scope.$apply(...)`. This is not the case
* anymore.)
*
* In addition to the animation promise, we can also make use of animation-related callbacks within our directives and controller code by registering
* an event listener using the `$animate` service. Let's say for example that an animation was triggered on our view
* routing controller to hook into that:
*
* ```js
* ngModule.controller('HomePageController', ['$animate', function($animate){
*   $animate.on('enter', ngViewElement, function(element){
*
*   }]);
* }])
* ```
*
* (Note that you will need to trigger a digest within the callback to get AngularJS to notice any scope-related changes.)
*/
var copy;
var extend;
var forEach;
var isArray;
var isDefined;
var isElement;
var isFunction;
var isObject;
var isString;
var isUndefined;
var jqLite;
var noop;
angular.module('ngAnimate', [], function initAngularHelpers(){
noop=angular.noop;
copy=angular.copy;
extend=angular.extend;
jqLite=angular.element;
forEach=angular.forEach;
isArray=angular.isArray;
isString=angular.isString;
isObject=angular.isObject;
isUndefined=angular.isUndefined;
isDefined=angular.isDefined;
isFunction=angular.isFunction;
isElement=angular.isElement;
})
.info({ angularVersion: '1.7.0' })
.directive('ngAnimateSwap', ngAnimateSwapDirective)
.directive('ngAnimateChildren', $$AnimateChildrenDirective)
.factory('$$rAFScheduler', $$rAFSchedulerFactory)
.provider('$$animateQueue', $$AnimateQueueProvider)
.provider('$$animation', $$AnimationProvider)
.provider('$animateCss', $AnimateCssProvider)
.provider('$$animateCssDriver', $$AnimateCssDriverProvider)
.provider('$$animateJs', $$AnimateJsProvider)
.provider('$$animateJsDriver', $$AnimateJsDriverProvider);
})(window, window.angular);
(function(window, angular){'use strict';
var $sanitizeMinErr=angular.$$minErr('$sanitize');
var bind;
var extend;
var forEach;
var isArray;
var isDefined;
var lowercase;
var noop;
var nodeContains;
var htmlParser;
var htmlSanitizeWriter;
/**
* @ngdoc service
* @name $sanitize
* @kind function
*
* @description
*   Sanitizes an html string by stripping all potentially dangerous tokens.
*
*   The input is sanitized by parsing the HTML into tokens. All safe tokens (from a whitelist) are
*   then serialized back to a properly escaped HTML string. This means that no unsafe input can make
*   it into the returned string.
*
*   The whitelist for URL sanitization of attribute values is configured using the functions
*   `aHrefSanitizationWhitelist` and `imgSrcSanitizationWhitelist` of {@link $compileProvider}.
*
*   The input may also contain SVG markup if this is enabled via {@link $sanitizeProvider}.
*
* @param {string} html HTML input.
* @returns {string} Sanitized HTML.
*
* @example
<example module="sanitizeExample" deps="angular-sanitize.js" name="sanitize-service">
<file name="index.html">
<script>angular.module('sanitizeExample', ['ngSanitize'])
.controller('ExampleController', ['$scope', '$sce', function($scope, $sce){
$scope.snippet =
'<p style="color:blue">an html\n' +
'<em onmouseover="this.textContent=\'PWN3D!\'">click here</em>\n' +
'snippet</p>';
$scope.deliberatelyTrustDangerousSnippet=function(){
return $sce.trustAsHtml($scope.snippet);
};}]);</script>
<div ng-controller="ExampleController">
Snippet: <textarea ng-model="snippet" cols="60" rows="3"></textarea>
<table>
<tr>
<td>Directive</td>
<td>How</td>
<td>Source</td>
<td>Rendered</td>
</tr>
<tr id="bind-html-with-sanitize">
<td>ng-bind-html</td>
<td>Automatically uses $sanitize</td>
<td><pre>&lt;div ng-bind-html="snippet"&gt;<br/>&lt;/div&gt;</pre></td>
<td><div ng-bind-html="snippet"></div></td>
</tr>
<tr id="bind-html-with-trust">
<td>ng-bind-html</td>
<td>Bypass $sanitize by explicitly trusting the dangerous value</td>
<td>
<pre>&lt;div ng-bind-html="deliberatelyTrustDangerousSnippet()"&gt;
&lt;/div&gt;</pre>
</td>
<td><div ng-bind-html="deliberatelyTrustDangerousSnippet()"></div></td>
</tr>
<tr id="bind-default">
<td>ng-bind</td>
<td>Automatically escapes</td>
<td><pre>&lt;div ng-bind="snippet"&gt;<br/>&lt;/div&gt;</pre></td>
<td><div ng-bind="snippet"></div></td>
</tr>
</table>
</div>
</file>
<file name="protractor.js" type="protractor">
it('should sanitize the html snippet by default', function(){
expect(element(by.css('#bind-html-with-sanitize div')).getAttribute('innerHTML')).
toBe('<p>an html\n<em>click here</em>\nsnippet</p>');
});
it('should inline raw snippet if bound to a trusted value', function(){
expect(element(by.css('#bind-html-with-trust div')).getAttribute('innerHTML')).
toBe("<p style=\"color:blue\">an html\n" +
"<em onmouseover=\"this.textContent='PWN3D!'\">click here</em>\n" +
"snippet</p>");
});
it('should escape snippet without any filter', function(){
expect(element(by.css('#bind-default div')).getAttribute('innerHTML')).
toBe("&lt;p style=\"color:blue\"&gt;an html\n" +
"&lt;em onmouseover=\"this.textContent='PWN3D!'\"&gt;click here&lt;/em&gt;\n" +
"snippet&lt;/p&gt;");
});
it('should update', function(){
element(by.model('snippet')).clear();
element(by.model('snippet')).sendKeys('new <b onclick="alert(1)">text</b>');
expect(element(by.css('#bind-html-with-sanitize div')).getAttribute('innerHTML')).
toBe('new <b>text</b>');
expect(element(by.css('#bind-html-with-trust div')).getAttribute('innerHTML')).toBe('new <b onclick="alert(1)">text</b>');
expect(element(by.css('#bind-default div')).getAttribute('innerHTML')).toBe("new &lt;b onclick=\"alert(1)\"&gt;text&lt;/b&gt;");
});
</file>
</example>
*/
function $SanitizeProvider(){
var hasBeenInstantiated=false;
var svgEnabled=false;
this.$get=['$$sanitizeUri', function($$sanitizeUri){
hasBeenInstantiated=true;
if(svgEnabled){
extend(validElements, svgElements);
}
return function(html){
var buf=[];
htmlParser(html, htmlSanitizeWriter(buf, function(uri, isImage){
return !/^unsafe:/.test($$sanitizeUri(uri, isImage));
}));
return buf.join('');
};}];
this.enableSvg=function(enableSvg){
if(isDefined(enableSvg)){
svgEnabled=enableSvg;
return this;
}else{
return svgEnabled;
}};
this.addValidElements=function(elements){
if(!hasBeenInstantiated){
if(isArray(elements)){
elements={htmlElements: elements};}
addElementsTo(svgElements, elements.svgElements);
addElementsTo(voidElements, elements.htmlVoidElements);
addElementsTo(validElements, elements.htmlVoidElements);
addElementsTo(validElements, elements.htmlElements);
}
return this;
};
this.addValidAttrs=function(attrs){
if(!hasBeenInstantiated){
extend(validAttrs, arrayToMap(attrs, true));
}
return this;
};
bind=angular.bind;
extend=angular.extend;
forEach=angular.forEach;
isArray=angular.isArray;
isDefined=angular.isDefined;
lowercase=angular.$$lowercase;
noop=angular.noop;
htmlParser=htmlParserImpl;
htmlSanitizeWriter=htmlSanitizeWriterImpl;
nodeContains=window.Node.prototype.contains|| function(arg){
return !!(this.compareDocumentPosition(arg) & 16);
};
var SURROGATE_PAIR_REGEXP=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,
NON_ALPHANUMERIC_REGEXP=/([^#-~ |!])/g;
var voidElements=stringToMap('area,br,col,hr,img,wbr');
var optionalEndTagBlockElements=stringToMap('colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr'),
optionalEndTagInlineElements=stringToMap('rp,rt'),
optionalEndTagElements=extend({},
optionalEndTagInlineElements,
optionalEndTagBlockElements);
var blockElements=extend({}, optionalEndTagBlockElements, stringToMap('address,article,' +
'aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,' +
'h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,section,table,ul'));
var inlineElements=extend({}, optionalEndTagInlineElements, stringToMap('a,abbr,acronym,b,' +
'bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s,' +
'samp,small,span,strike,strong,sub,sup,time,tt,u,var'));
var svgElements=stringToMap('circle,defs,desc,ellipse,font-face,font-face-name,font-face-src,g,glyph,' +
'hkern,image,linearGradient,line,marker,metadata,missing-glyph,mpath,path,polygon,polyline,' +
'radialGradient,rect,stop,svg,switch,text,title,tspan');
var blockedElements=stringToMap('script,style');
var validElements=extend({},
voidElements,
blockElements,
inlineElements,
optionalEndTagElements);
var uriAttrs=stringToMap('background,cite,href,longdesc,src,xlink:href,xml:base');
var htmlAttrs=stringToMap('abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,' +
'color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,' +
'ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,' +
'scope,scrolling,shape,size,span,start,summary,tabindex,target,title,type,' +
'valign,value,vspace,width');
var svgAttrs=stringToMap('accent-height,accumulate,additive,alphabetic,arabic-form,ascent,' +
'baseProfile,bbox,begin,by,calcMode,cap-height,class,color,color-rendering,content,' +
'cx,cy,d,dx,dy,descent,display,dur,end,fill,fill-rule,font-family,font-size,font-stretch,' +
'font-style,font-variant,font-weight,from,fx,fy,g1,g2,glyph-name,gradientUnits,hanging,' +
'height,horiz-adv-x,horiz-origin-x,ideographic,k,keyPoints,keySplines,keyTimes,lang,' +
'marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mathematical,' +
'max,min,offset,opacity,orient,origin,overline-position,overline-thickness,panose-1,' +
'path,pathLength,points,preserveAspectRatio,r,refX,refY,repeatCount,repeatDur,' +
'requiredExtensions,requiredFeatures,restart,rotate,rx,ry,slope,stemh,stemv,stop-color,' +
'stop-opacity,strikethrough-position,strikethrough-thickness,stroke,stroke-dasharray,' +
'stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,' +
'stroke-width,systemLanguage,target,text-anchor,to,transform,type,u1,u2,underline-position,' +
'underline-thickness,unicode,unicode-range,units-per-em,values,version,viewBox,visibility,' +
'width,widths,x,x-height,x1,x2,xlink:actuate,xlink:arcrole,xlink:role,xlink:show,xlink:title,' +
'xlink:type,xml:base,xml:lang,xml:space,xmlns,xmlns:xlink,y,y1,y2,zoomAndPan', true);
var validAttrs=extend({},
uriAttrs,
svgAttrs,
htmlAttrs);
function stringToMap(str, lowercaseKeys){
return arrayToMap(str.split(','), lowercaseKeys);
}
function arrayToMap(items, lowercaseKeys){
var obj={}, i;
for (i=0; i < items.length; i++){
obj[lowercaseKeys ? lowercase(items[i]):items[i]]=true;
}
return obj;
}
function addElementsTo(elementsMap, newElements){
if(newElements&&newElements.length){
extend(elementsMap, arrayToMap(newElements));
}}
var getInertBodyElement /* function(html: string): HTMLBodyElement */=(function(window, document){
var inertDocument;
if(document&&document.implementation){
inertDocument=document.implementation.createHTMLDocument('inert');
}else{
throw $sanitizeMinErr('noinert', 'Can\'t create an inert html document');
}
var inertBodyElement=(inertDocument.documentElement||inertDocument.getDocumentElement()).querySelector('body');
inertBodyElement.innerHTML='<svg><g onload="this.parentNode.remove()"></g></svg>';
if(!inertBodyElement.querySelector('svg')){
return getInertBodyElement_XHR;
}else{
inertBodyElement.innerHTML='<svg><p><style><img src="</style><img src=x onerror=alert(1)//">';
if(inertBodyElement.querySelector('svg img')){
return getInertBodyElement_DOMParser;
}else{
return getInertBodyElement_InertDocument;
}}
function getInertBodyElement_XHR(html){
html='<remove></remove>' + html;
try {
html=encodeURI(html);
} catch (e){
return undefined;
}
var xhr=new window.XMLHttpRequest();
xhr.responseType='document';
xhr.open('GET', 'data:text/html;charset=utf-8,' + html, false);
xhr.send(null);
var body=xhr.response.body;
body.firstChild.remove();
return body;
}
function getInertBodyElement_DOMParser(html){
html='<remove></remove>' + html;
try {
var body=new window.DOMParser().parseFromString(html, 'text/html').body;
body.firstChild.remove();
return body;
} catch (e){
return undefined;
}}
function getInertBodyElement_InertDocument(html){
inertBodyElement.innerHTML=html;
if(document.documentMode){
stripCustomNsAttrs(inertBodyElement);
}
return inertBodyElement;
}})(window, window.document);
/**
* @example
* htmlParser(htmlString, {
*     start: function(tag, attrs){},
*     end: function(tag){},
*     chars: function(text){},
*     comment: function(text){}
* });
*
* @param {string} html string
* @param {object} handler
*/
function htmlParserImpl(html, handler){
if(html===null||html===undefined){
html='';
}else if(typeof html!=='string'){
html='' + html;
}
var inertBodyElement=getInertBodyElement(html);
if(!inertBodyElement) return '';
var mXSSAttempts=5;
do {
if(mXSSAttempts===0){
throw $sanitizeMinErr('uinput', 'Failed to sanitize html because the input is unstable');
}
mXSSAttempts--;
html=inertBodyElement.innerHTML;
inertBodyElement=getInertBodyElement(html);
} while (html!==inertBodyElement.innerHTML);
var node=inertBodyElement.firstChild;
while (node){
switch (node.nodeType){
case 1:
handler.start(node.nodeName.toLowerCase(), attrToMap(node.attributes));
break;
case 3:
handler.chars(node.textContent);
break;
}
var nextNode;
if(!(nextNode=node.firstChild)){
if(node.nodeType===1){
handler.end(node.nodeName.toLowerCase());
}
nextNode=getNonDescendant('nextSibling', node);
if(!nextNode){
while (nextNode==null){
node=getNonDescendant('parentNode', node);
if(node===inertBodyElement) break;
nextNode=getNonDescendant('nextSibling', node);
if(node.nodeType===1){
handler.end(node.nodeName.toLowerCase());
}}
}}
node=nextNode;
}
while ((node=inertBodyElement.firstChild)){
inertBodyElement.removeChild(node);
}}
function attrToMap(attrs){
var map={};
for (var i=0, ii=attrs.length; i < ii; i++){
var attr=attrs[i];
map[attr.name]=attr.value;
}
return map;
}
function encodeEntities(value){
return value.
replace(/&/g, '&amp;').
replace(SURROGATE_PAIR_REGEXP, function(value){
var hi=value.charCodeAt(0);
var low=value.charCodeAt(1);
return '&#' + (((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000) + ';';
}).
replace(NON_ALPHANUMERIC_REGEXP, function(value){
return '&#' + value.charCodeAt(0) + ';';
}).
replace(/</g, '&lt;').
replace(/>/g, '&gt;');
}
/**
* create an HTML/XML writer which writes to buffer
* @param {Array} buf use buf.join('') to get out sanitized html string
* @returns {object} in the form of {
*     start: function(tag, attrs){},
*     end: function(tag){},
*     chars: function(text){},
*     comment: function(text){}
* }
*/
function htmlSanitizeWriterImpl(buf, uriValidator){
var ignoreCurrentElement=false;
var out=bind(buf, buf.push);
return {
start: function(tag, attrs){
tag=lowercase(tag);
if(!ignoreCurrentElement&&blockedElements[tag]){
ignoreCurrentElement=tag;
}
if(!ignoreCurrentElement&&validElements[tag]===true){
out('<');
out(tag);
forEach(attrs, function(value, key){
var lkey=lowercase(key);
var isImage=(tag==='img'&&lkey==='src')||(lkey==='background');
if(validAttrs[lkey]===true &&
(uriAttrs[lkey]!==true||uriValidator(value, isImage))){
out(' ');
out(key);
out('="');
out(encodeEntities(value));
out('"');
}});
out('>');
}},
end: function(tag){
tag=lowercase(tag);
if(!ignoreCurrentElement&&validElements[tag]===true&&voidElements[tag]!==true){
out('</');
out(tag);
out('>');
}
if(tag==ignoreCurrentElement){
ignoreCurrentElement=false;
}},
chars: function(chars){
if(!ignoreCurrentElement){
out(encodeEntities(chars));
}}
};}
function stripCustomNsAttrs(node){
while (node){
if(node.nodeType===window.Node.ELEMENT_NODE){
var attrs=node.attributes;
for (var i=0, l=attrs.length; i < l; i++){
var attrNode=attrs[i];
var attrName=attrNode.name.toLowerCase();
if(attrName==='xmlns:ns1'||attrName.lastIndexOf('ns1:', 0)===0){
node.removeAttributeNode(attrNode);
i--;
l--;
}}
}
var nextNode=node.firstChild;
if(nextNode){
stripCustomNsAttrs(nextNode);
}
node=getNonDescendant('nextSibling', node);
}}
function getNonDescendant(propName, node){
var nextNode=node[propName];
if(nextNode&&nodeContains.call(node, nextNode)){
throw $sanitizeMinErr('elclob', 'Failed to sanitize html because the element is clobbered: {0}', node.outerHTML||node.outerText);
}
return nextNode;
}}
function sanitizeText(chars){
var buf=[];
var writer=htmlSanitizeWriter(buf, noop);
writer.chars(chars);
return buf.join('');
}
angular.module('ngSanitize', [])
.provider('$sanitize', $SanitizeProvider)
.info({ angularVersion: '1.7.0' });
/**
* @ngdoc filter
* @name linky
* @kind function
*
* @description
* Finds links in text input and turns them into html links. Supports `http/https/ftp/sftp/mailto` and
* plain email address links.
*
* Requires the {@link ngSanitize `ngSanitize`} module to be installed.
*
* @param {string} text Input text.
* @param {string} [target] Window (`_blank|_self|_parent|_top`) or named frame to open links in.
* @param {object|function(url)} [attributes] Add custom attributes to the link element.
*
*    Can be one of:
*
*    - `object`: A map of attributes
*    - `function`: Takes the url as a parameter and returns a map of attributes
*
*    If the map of attributes contains a value for `target`, it overrides the value of
*    the target parameter.
*
*
* @returns {string} Html-linkified and {@link $sanitize sanitized} text.
*
* @usage
<span ng-bind-html="linky_expression | linky"></span>
*
* @example
<example module="linkyExample" deps="angular-sanitize.js" name="linky-filter">
<file name="index.html">
<div ng-controller="ExampleController">
Snippet: <textarea ng-model="snippet" cols="60" rows="3"></textarea>
<table>
<tr>
<th>Filter</th>
<th>Source</th>
<th>Rendered</th>
</tr>
<tr id="linky-filter">
<td>linky filter</td>
<td>
<pre>&lt;div ng-bind-html="snippet | linky"&gt;<br>&lt;/div&gt;</pre>
</td>
<td>
<div ng-bind-html="snippet | linky"></div>
</td>
</tr>
<tr id="linky-target">
<td>linky target</td>
<td>
<pre>&lt;div ng-bind-html="snippetWithSingleURL | linky:'_blank'"&gt;<br>&lt;/div&gt;</pre>
</td>
<td>
<div ng-bind-html="snippetWithSingleURL | linky:'_blank'"></div>
</td>
</tr>
<tr id="linky-custom-attributes">
<td>linky custom attributes</td>
<td>
<pre>&lt;div ng-bind-html="snippetWithSingleURL | linky:'_self':{rel: 'nofollow'}"&gt;<br>&lt;/div&gt;</pre>
</td>
<td>
<div ng-bind-html="snippetWithSingleURL | linky:'_self':{rel: 'nofollow'}"></div>
</td>
</tr>
<tr id="escaped-html">
<td>no filter</td>
<td><pre>&lt;div ng-bind="snippet"&gt;<br>&lt;/div&gt;</pre></td>
<td><div ng-bind="snippet"></div></td>
</tr>
</table>
</file>
<file name="script.js">
angular.module('linkyExample', ['ngSanitize'])
.controller('ExampleController', ['$scope', function($scope){
$scope.snippet =
'Pretty text with some links:\n' +
'http://angularjs.org/,\n' +
'mailto:us@somewhere.org,\n' +
'another@somewhere.org,\n' +
'and one more: ftp:
$scope.snippetWithSingleURL='http://angularjs.org/';
}]);
</file>
<file name="protractor.js" type="protractor">
it('should linkify the snippet with urls', function(){
expect(element(by.id('linky-filter')).element(by.binding('snippet | linky')).getText()).
toBe('Pretty text with some links: http://angularjs.org/, us@somewhere.org, ' +
'another@somewhere.org, and one more: ftp:
expect(element.all(by.css('#linky-filter a')).count()).toEqual(4);
});
it('should not linkify snippet without the linky filter', function(){
expect(element(by.id('escaped-html')).element(by.binding('snippet')).getText()).
toBe('Pretty text with some links: http://angularjs.org/, mailto:us@somewhere.org, ' +
'another@somewhere.org, and one more: ftp:
expect(element.all(by.css('#escaped-html a')).count()).toEqual(0);
});
it('should update', function(){
element(by.model('snippet')).clear();
element(by.model('snippet')).sendKeys('new http://link.');
expect(element(by.id('linky-filter')).element(by.binding('snippet | linky')).getText()).
toBe('new http://link.');
expect(element.all(by.css('#linky-filter a')).count()).toEqual(1);
expect(element(by.id('escaped-html')).element(by.binding('snippet')).getText())
.toBe('new http://link.');
});
it('should work with the target property', function(){
expect(element(by.id('linky-target')).
element(by.binding("snippetWithSingleURL | linky:'_blank'")).getText()).
toBe('http://angularjs.org/');
expect(element(by.css('#linky-target a')).getAttribute('target')).toEqual('_blank');
});
it('should optionally add custom attributes', function(){
expect(element(by.id('linky-custom-attributes')).
element(by.binding("snippetWithSingleURL | linky:'_self':{rel: 'nofollow'}")).getText()).
toBe('http://angularjs.org/');
expect(element(by.css('#linky-custom-attributes a')).getAttribute('rel')).toEqual('nofollow');
});
</file>
</example>
*/
angular.module('ngSanitize').filter('linky', ['$sanitize', function($sanitize){
var LINKY_URL_REGEXP =
/((s?ftp|https?):\/\/|(www\.)|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s.;,(){}<>"\u201d\u2019]/i,
MAILTO_REGEXP=/^mailto:/i;
var linkyMinErr=angular.$$minErr('linky');
var isDefined=angular.isDefined;
var isFunction=angular.isFunction;
var isObject=angular.isObject;
var isString=angular.isString;
return function(text, target, attributes){
if(text==null||text==='') return text;
if(!isString(text)) throw linkyMinErr('notstring', 'Expected string but received: {0}', text);
var attributesFn =
isFunction(attributes) ? attributes :
isObject(attributes) ? function getAttributesObject(){return attributes;} :
function getEmptyAttributesObject(){return {};};
var match;
var raw=text;
var html=[];
var url;
var i;
while ((match=raw.match(LINKY_URL_REGEXP))){
url=match[0];
if(!match[2]&&!match[4]){
url=(match[3] ? 'http://':'mailto:') + url;
}
i=match.index;
addText(raw.substr(0, i));
addLink(url, match[0].replace(MAILTO_REGEXP, ''));
raw=raw.substring(i + match[0].length);
}
addText(raw);
return $sanitize(html.join(''));
function addText(text){
if(!text){
return;
}
html.push(sanitizeText(text));
}
function addLink(url, text){
var key, linkAttributes=attributesFn(url);
html.push('<a ');
for (key in linkAttributes){
html.push(key + '="' + linkAttributes[key] + '" ');
}
if(isDefined(target)&&!('target' in linkAttributes)){
html.push('target="',
target,
'" ');
}
html.push('href="',
url.replace(/"/g, '&quot;'),
'">');
addText(text);
html.push('</a>');
}};}]);
})(window, window.angular);