sogo/UI/WebServerResources/js/vendor/angular-material.min.js

14 lines
260 KiB
JavaScript
Raw Normal View History

/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
2015-09-15 18:05:37 +02:00
* v0.11.0-master-afc0963
*/
2015-09-15 18:05:37 +02:00
!function(e,t,n){"use strict";!function(){t.module("ngMaterial",["ng","ngAnimate","ngAria","material.core","material.core.gestures","material.core.layout","material.core.theming.palette","material.core.theming","material.core.animate","material.components.autocomplete","material.components.backdrop","material.components.bottomSheet","material.components.button","material.components.card","material.components.checkbox","material.components.chips","material.components.content","material.components.datepicker","material.components.dialog","material.components.divider","material.components.fabActions","material.components.fabShared","material.components.fabSpeedDial","material.components.fabToolbar","material.components.fabTrigger","material.components.gridList","material.components.icon","material.components.input","material.components.list","material.components.menu","material.components.menuBar","material.components.progressCircular","material.components.progressLinear","material.components.radioButton","material.components.select","material.components.sidenav","material.components.slider","material.components.sticky","material.components.subheader","material.components.swipe","material.components.switch","material.components.tabs","material.components.toast","material.components.toolbar","material.components.tooltip","material.components.virtualRepeat","material.components.whiteframe"])}(),function(){function e(e,t){e.decorator("$$rAF",["$delegate",o]),t.theme("default").primaryPalette("indigo").accentPalette("pink").warnPalette("red").backgroundPalette("grey")}function n(e){return{restrict:"A",scope:{template:"=mdTemplate"},link:function(t,n){function o(o){n.html(o),e(n.contents())(t)}t.$watch("template",o)}}}function o(e){return e.throttle=function(t){var n,o,r,i;return function(){n=arguments,i=this,r=t,o||(o=!0,e(function(){r.apply(i,Array.prototype.slice.call(n)),o=!1}))}},e}t.module("material.core",["ngAnimate","material.core.animate","material.core.layout","material.core.gestures","material.core.theming"]).directive("mdTemplate",n).config(e),e.$inject=["$provide","$mdThemingProvider"],n.$inject=["$compile"]}(),function(){function e(e){function t(e){return n?"webkit"+e.charAt(0).toUpperCase()+e.substring(1):e}var n=/webkit/i.test(e.vendorPrefix);return{KEY_CODE:{ENTER:13,ESCAPE:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT_ARROW:37,UP_ARROW:38,RIGHT_ARROW:39,DOWN_ARROW:40,TAB:9,BACKSPACE:8,DELETE:46},CSS:{TRANSITIONEND:"transitionend"+(n?" webkitTransitionEnd":""),ANIMATIONEND:"animationend"+(n?" webkitAnimationEnd":""),TRANSFORM:t("transform"),TRANSFORM_ORIGIN:t("transformOrigin"),TRANSITION:t("transition"),TRANSITION_DURATION:t("transitionDuration"),ANIMATION_PLAY_STATE:t("animationPlayState"),ANIMATION_DURATION:t("animationDuration"),ANIMATION_NAME:t("animationName"),ANIMATION_TIMING:t("animationTimingFunction"),ANIMATION_DIRECTION:t("animationDirection")},MEDIA:{sm:"(max-width: 599px)","gt-sm":"(min-width: 600px)",md:"(min-width: 600px) and (max-width: 959px)","gt-md":"(min-width: 960px)",lg:"(min-width: 960px) and (max-width: 1199px)","gt-lg":"(min-width: 1200px)"},MEDIA_PRIORITY:["gt-lg","lg","gt-md","md","gt-sm","sm"]}}t.module("material.core").factory("$mdConstant",e),e.$inject=["$sniffer"]}(),function(){function e(e,n){function o(){return[].concat(v)}function r(){return v.length}function i(e){return v.length&&e>-1&&e<v.length}function a(e){return e?i(u(e)+1):!1}function d(e){return e?i(u(e)-1):!1}function c(e){return i(e)?v[e]:null}function l(e,t){return v.filter(function(n){return n[e]===t})}function s(e,n){return e?(t.isNumber(n)||(n=v.length),v.splice(n,0,e),u(e)):-1}function m(e){h(e)&&v.splice(u(e),1)}function u(e){return v.indexOf(e)}function h(e){return e&&u(e)>-1}function p(){return v.length?v[0]:null}function f(){return v.length?v[v.length-1]:null}function g(e,o,r,a){r=r||b;for(var d=u(o);;){if(!i(d))return null;var c=d+(e?-1:1),l=null;if(i(c)?l=v[c]:n&&(l=e?f():p(),c=u(l)),null===l||c===a)return null;if(r(l))return l;t.isUndefined(a)&&(a=c),d=c}}var b=function(){return!0};e&&!t.isArray(
var e=this;this.mousedown=!1,this.$mdUtil.nextTick(function(){e.clearRipples()},!1)}},o.prototype.clearRipples=function(){for(var e=0;e<this.ripples.length;e++)this.fadeInComplete(this.ripples[e])},o.prototype.createContainer=function(){var e=t.element('<div class="md-ripple-container"></div>');return this.$element.append(e),e},o.prototype.clearTimeout=function(){this.timeout&&(this.$timeout.cancel(this.timeout),this.timeout=null)},o.prototype.isRippleAllowed=function(){var e=this.$element[0];do{if(!e.tagName||"BODY"===e.tagName)break;if(e&&e.hasAttribute&&e.hasAttribute("disabled"))return!1}while(e=e.parentNode);return!0},o.prototype.createRipple=function(e,n){function o(e){return e?e.replace("rgba","rgb").replace(/,[^\),]+\)/,")"):"rgb(0,0,0)"}function r(e,t,n){return e?Math.max(t,n):Math.sqrt(Math.pow(t,2)+Math.pow(n,2))}if(this.isRippleAllowed()){var a=this,d=t.element('<div class="md-ripple"></div>'),c=this.$element.prop("clientWidth"),l=this.$element.prop("clientHeight"),s=2*Math.max(Math.abs(c-e),e),m=2*Math.max(Math.abs(l-n),n),u=r(this.options.fitRipple,s,m);d.css({left:e+"px",top:n+"px",background:"black",width:u+"px",height:u+"px",backgroundColor:o(this.color),borderColor:o(this.color)}),this.lastRipple=d,this.clearTimeout(),this.timeout=this.$timeout(function(){a.clearTimeout(),a.mousedown||a.fadeInComplete(d)},.35*i,!1),this.options.dimBackground&&this.container.css({backgroundColor:this.background}),this.container.append(d),this.ripples.push(d),d.addClass("md-ripple-placed"),this.$mdUtil.nextTick(function(){d.addClass("md-ripple-scaled md-ripple-active"),a.$timeout(function(){a.clearRipples()},i,!1)},!1)}},o.prototype.fadeInComplete=function(e){this.lastRipple===e?this.timeout||this.mousedown||this.removeRipple(e):this.removeRipple(e)},o.prototype.removeRipple=function(e){var t=this,n=this.ripples.indexOf(e);0>n||(this.ripples.splice(this.ripples.indexOf(e),1),e.removeClass("md-ripple-active"),0===this.ripples.length&&this.container.css({backgroundColor:""}),this.$timeout(function(){t.fadeOutComplete(e)},i,!1))},o.prototype.fadeOutComplete=function(e){e.remove(),this.lastRipple=null}}(),function(){!function(){function e(e){function n(n,o,r){return e.attach(n,o,t.extend({center:!1,dimBackground:!0,outline:!1,rippleSize:"full"},r))}return{attach:n}}t.module("material.core").factory("$mdTabInkRipple",e),e.$inject=["$mdInkRipple"]}()}(),function(){t.module("material.core.theming.palette",[]).constant("$mdColorPalette",{red:{50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000",contrastDefaultColor:"light",contrastDarkColors:"50 100 200 300 A100",contrastStrongLightColors:"400 500 600 700 A200 A400 A700"},pink:{50:"#fce4ec",100:"#f8bbd0",200:"#f48fb1",300:"#f06292",400:"#ec407a",500:"#e91e63",600:"#d81b60",700:"#c2185b",800:"#ad1457",900:"#880e4f",A100:"#ff80ab",A200:"#ff4081",A400:"#f50057",A700:"#c51162",contrastDefaultColor:"light",contrastDarkColors:"50 100 200 A100",contrastStrongLightColors:"500 600 A200 A400 A700"},purple:{50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff",contrastDefaultColor:"light",contrastDarkColors:"50 100 200 A100",contrastStrongLightColors:"300 400 A200 A400 A700"},"deep-purple":{50:"#ede7f6",100:"#d1c4e9",200:"#b39ddb",300:"#9575cd",400:"#7e57c2",500:"#673ab7",600:"#5e35b1",700:"#512da8",800:"#4527a0",900:"#311b92",A100:"#b388ff",A200:"#7c4dff",A400:"#651fff",A700:"#6200ea",contrastDefaultColor:"light",contrastDarkColors:"50 100 200 A100",contrastStrongLightColors:"300 400 A200"},indigo:{50:"#e8eaf6",100:"#c5cae9",200:"#9fa8da",300:"#7986cb",400:"#5c6bc0",500:"#3f51b5",600:"#3949ab",700:"#303f9f",800:"#283593",900:"#1a237e",A100:"#8c9eff",A200:"#536dfe",A400:"#3d5afe",A700:"#304ffe",contrastDefaultColor:"light",contrastDarkColors:"50 100 200 A100",contrastStrongLightColors:"300 400 A200 A400"
},n.prototype.handleKeyEvent=function(e){var t=this;this.$scope.$apply(function(){if(e.which==t.keyCode.ESCAPE||e.which==t.keyCode.TAB)return t.$scope.$emit("md-calendar-close"),void(e.which==t.keyCode.TAB&&e.preventDefault());if(e.which===t.keyCode.ENTER)return t.setNgModelValue(t.displayDate),void e.preventDefault();var n=t.getFocusDateFromKeyEvent(e);n&&(n=t.boundDateByMinAndMax(n),e.preventDefault(),e.stopPropagation(),t.changeDisplayDate(n).then(function(){t.focus(n)}))})},n.prototype.getFocusDateFromKeyEvent=function(e){var t=this.dateUtil,n=this.keyCode;switch(e.which){case n.RIGHT_ARROW:return t.incrementDays(this.displayDate,1);case n.LEFT_ARROW:return t.incrementDays(this.displayDate,-1);case n.DOWN_ARROW:return e.metaKey?t.incrementMonths(this.displayDate,1):t.incrementDays(this.displayDate,7);case n.UP_ARROW:return e.metaKey?t.incrementMonths(this.displayDate,-1):t.incrementDays(this.displayDate,-7);case n.PAGE_DOWN:return t.incrementMonths(this.displayDate,1);case n.PAGE_UP:return t.incrementMonths(this.displayDate,-1);case n.HOME:return t.getFirstDateOfMonth(this.displayDate);case n.END:return t.getLastDateOfMonth(this.displayDate);default:return null}},n.prototype.getSelectedMonthIndex=function(){return this.dateUtil.getMonthDistance(this.firstRenderableDate,this.selectedDate||this.today)},n.prototype.scrollToMonth=function(e){if(this.dateUtil.isValidDate(e)){var t=this.dateUtil.getMonthDistance(this.firstRenderableDate,e);this.calendarScroller.scrollTop=t*o}},n.prototype.setNgModelValue=function(e){this.$scope.$emit("md-calendar-change",e),this.ngModelCtrl.$setViewValue(e),this.ngModelCtrl.$render()},n.prototype.focus=function(e){var t=e||this.selectedDate||this.today,n=this.calendarElement.querySelector(".md-focus");n&&n.classList.remove(a);var o=this.getDateId(t),r=document.getElementById(o);r?(r.classList.add(a),r.focus()):this.focusDate=t},n.prototype.boundDateByMinAndMax=function(e){var t=e;return this.minDate&&e<this.minDate&&(t=new Date(this.minDate.getTime())),this.maxDate&&e>this.maxDate&&(t=new Date(this.maxDate.getTime())),t},n.prototype.changeSelectedDate=function(e){var t=this,n=this.selectedDate;this.selectedDate=e,this.changeDisplayDate(e).then(function(){if(n){var o=document.getElementById(t.getDateId(n));o&&(o.classList.remove(i),o.setAttribute("aria-selected","false"))}if(e){var r=document.getElementById(t.getDateId(e));r&&(r.classList.add(i),r.setAttribute("aria-selected","true"))}})},n.prototype.changeDisplayDate=function(e){if(!this.isInitialized)return this.buildInitialCalendarDisplay(),this.$q.when();if(!this.dateUtil.isValidDate(e)||this.isMonthTransitionInProgress)return this.$q.when();this.isMonthTransitionInProgress=!0;var t=this.animateDateChange(e);this.displayDate=e;var n=this;return t.then(function(){n.isMonthTransitionInProgress=!1}),t},n.prototype.animateDateChange=function(e){return this.scrollToMonth(e),this.$q.when()},n.prototype.buildWeekHeader=function(){for(var e=this.dateLocale.firstDayOfWeek,t=this.dateLocale.shortDays,n=document.createElement("tr"),o=0;7>o;o++){var r=document.createElement("th");r.textContent=t[(o+e)%7],n.appendChild(r)}this.$element.find("thead").append(n)},n.prototype.getDateId=function(e){return["md",this.id,e.getFullYear(),e.getMonth(),e.getDate()].join("-")}}()}(),function(){!function(){function e(){return{require:["^^mdCalendar","mdCalendarMonth"],scope:{offset:"=mdMonthOffset"},controller:n,controllerAs:"mdMonthCtrl",bindToController:!0,link:function(e,t,n,o){var r=o[0],i=o[1];i.calendarCtrl=r,i.generateContent(),e.$watch(function(){return i.offset},function(e,t){e!=t&&i.generateContent()})}}}function n(e,t,n){this.dateUtil=t,this.dateLocale=n,this.$element=e,this.calendarCtrl=null,this.offset,this.focusAfterAppend=null}t.module("material.components.datepicker").directive("mdCalendarMonth",e);var o="md-calendar-date-today",r="md-calendar-selected-date",i="md-focus";n.$inject=["$element","$$mdDateUtil","$mdDateLocale"],n.prototype.generateContent=function(){var e=this.calendarCtrl,t=this.dateUtil.incrementMonths(e.firstRenderableDate,this.o
return"MD-GRID-TILE"==e.tagName})}function b(e){return[].map.call(e,function(e){var n=t.element(e).controller("mdGridTile");return{row:parseInt(i.getResponsiveAttribute(n.$attrs,"md-rowspan"),10)||1,col:parseInt(i.getResponsiveAttribute(n.$attrs,"md-colspan"),10)||1}})}function v(){var e=parseInt(i.getResponsiveAttribute(d,"md-cols"),10);if(isNaN(e))throw"md-grid-list: md-cols attribute was not found, or contained a non-numeric value";return e}function E(){return y(i.getResponsiveAttribute(d,"md-gutter")||1)}function M(){var e=i.getResponsiveAttribute(d,"md-row-height");switch($()){case"fixed":return y(e);case"ratio":var t=e.split(":");return parseFloat(t[0])/parseFloat(t[1]);case"fit":return 0}}function $(){var e=i.getResponsiveAttribute(d,"md-row-height");return"fit"==e?"fit":-1!==e.indexOf(":")?"ratio":"fixed"}function y(e){return/\D$/.test(e)?e:e+"px"}a.attr("role","list"),c.layoutDelegate=u;var C=t.bind(c,c.invalidateLayout),A=l();n.$on("$destroy",s);var T,k=e.startSymbol(),w=e.endSymbol(),x=e(h("share")+"% - ("+h("gutter")+" * "+h("gutterShare")+")"),N=e("calc(("+h("unit")+" + "+h("gutter")+") * "+h("offset")+")"),_=e("calc(("+h("unit")+") * "+h("span")+" + ("+h("span")+" - 1) * "+h("gutter")+")")}return{restrict:"E",controller:n,scope:{mdOnLayout:"&"},link:a}}function n(e){this.layoutInvalidated=!1,this.tilesInvalidated=!1,this.$timeout_=e.nextTick,this.layoutDelegate=t.noop}function o(e){function n(t,n){var o,a,d,c,l,s;return c=e.time(function(){a=r(t,n)}),o={layoutInfo:function(){return a},map:function(t){return l=e.time(function(){var e=o.layoutInfo();d=t(e.positioning,e.rowCount)}),o},reflow:function(t){return s=e.time(function(){var e=t||i;e(d.grid,d.tiles)}),o},performance:function(){return{tileCount:n.length,layoutTime:c,mapTime:l,reflowTime:s,totalTime:c+l+s}}}}function o(e,t){e.element.css(e.style),t.forEach(function(e){e.element.css(e.style)})}function r(e,t){function n(t,n){if(t.col>e)throw"md-grid-list: Tile at position "+n+" has a colspan ("+t.col+") that exceeds the column count ("+e+")";for(var a=0,s=0;s-a<t.col;)d>=e?o():(a=l.indexOf(0,d),-1!==a&&-1!==(s=i(a+1))?d=s+1:(a=s=0,o()));return r(a,t.col,t.row),d=a+t.col,{col:a,row:c}}function o(){d=0,c++,r(0,e,-1)}function r(e,t,n){for(var o=e;e+t>o;o++)l[o]=Math.max(l[o]+n,0)}function i(e){var t;for(t=e;t<l.length;t++)if(0!==l[t])return t;return t===l.length?t:void 0}function a(){for(var t=[],n=0;e>n;n++)t.push(0);return t}var d=0,c=0,l=a();return{positioning:t.map(function(e,t){return{spans:e,position:n(e,t)}}),rowCount:c+Math.max.apply(Math,l)}}var i=o;return n.animateWith=function(e){i=t.isFunction(e)?e:o},n}function r(e){function n(n,o,r,i){o.attr("role","listitem");var a=e.watchResponsiveAttributes(["md-colspan","md-rowspan"],r,t.bind(i,i.invalidateLayout));i.invalidateTiles(),n.$on("$destroy",function(){a(),i.invalidateLayout()}),t.isDefined(n.$parent.$index)&&n.$watch(function(){return n.$parent.$index},function(e,t){e!==t&&i.invalidateTiles()})}return{restrict:"E",require:"^mdGridList",template:"<figure ng-transclude></figure>",transclude:!0,scope:{},controller:["$attrs",function(e){this.$attrs=e}],link:n}}function i(){return{template:"<figcaption ng-transclude></figcaption>",transclude:!0}}t.module("material.components.gridList",["material.core"]).directive("mdGridList",e).directive("mdGridTile",r).directive("mdGridTileFooter",i).directive("mdGridTileHeader",i).factory("$mdGridLayout",o),e.$inject=["$interpolate","$mdConstant","$mdGridLayout","$mdMedia"],n.$inject=["$mdUtil"],n.prototype={invalidateTiles:function(){this.tilesInvalidated=!0,this.invalidateLayout()},invalidateLayout:function(){this.layoutInvalidated||(this.layoutInvalidated=!0,this.$timeout_(t.bind(this,this.layout)))},layout:function(){try{this.layoutDelegate(this.tilesInvalidated)}finally{this.layoutInvalidated=!1,this.tilesInvalidated=!1}}},o.$inject=["$mdUtil"],r.$inject=["$mdMedia"]}(),function(){t.module("material.components.icon",["material.core"])}(),function(){function e(e,t){function n(t,n,o){e(n)}function o(e,n,o){var r=this;r.isErrorGetter=o.mdIsError&&t(o.mdIsError)
bottom:M.bottom-(v.top+v.height)},y=b.width-2*d,C=g.scrollHeight>g.offsetHeight,A=f.querySelector("md-option[selected]"),s=f.getElementsByTagName("md-option"),T=f.getElementsByTagName("md-optgroup"),k=r(o.loadingAsync);m=k?g.firstElementChild||g:A?A:T.length?T[0]:s.length?s[0]:g.firstElementChild||g,g.offsetWidth>y&&(g.style["max-width"]=y+"px"),E&&(g.style["min-width"]=v.width+"px"),C&&f.classList.add("md-overflow");var w=m;"MD-OPTGROUP"===(w.tagName||"").toUpperCase()&&(w=s[0]||g.firstElementChild||g,m=w),o.focusedNode=w;var x=f.getBoundingClientRect(),N=a(m);if(m){var _=l.getComputedStyle(m);N.paddingLeft=parseInt(_.paddingLeft,10)||0,N.paddingRight=parseInt(_.paddingRight,10)||0}if(C){var S=g.offsetHeight/2;g.scrollTop=N.top+N.height/2-S,$.top<S?g.scrollTop=Math.min(N.top,g.scrollTop+S-$.top):$.bottom<S&&(g.scrollTop=Math.max(N.top+N.height-x.height,g.scrollTop-S+$.bottom))}var H,D,O,I;E?(H=v.left,D=v.top+v.height,O="50% 0",D+x.height>M.bottom&&(D=v.top-x.height,O="50% 100%")):(H=v.left+N.left-N.paddingLeft+2,D=Math.floor(v.top+v.height/2-N.height/2-N.top+g.scrollTop)+2,O=N.left+v.width/2+"px "+(N.top+N.height/2-g.scrollTop)+"px 0px",I=v.width+N.paddingLeft+N.paddingRight);var R=u.getBoundingClientRect(),L=Math.round(100*Math.min(v.width/x.width,1))/100,P=Math.round(100*Math.min(v.height/x.height,1))/100;return{container:{element:t.element(u),styles:{left:Math.floor(i(M.left,H,M.right-R.width)),top:Math.floor(i(M.top,D,M.bottom-R.height)),"min-width":I}},dropDown:{element:t.element(f),styles:{transformOrigin:O,transform:o.alreadyOpen?"":c.supplant("scale({0},{1})",[L,P])}}}}var M="$mdSelect.show() expected a target element in options.target but got '{0}'!",$=c.dom.animator;return{parent:"body",themable:!0,onShow:f,onRemove:p,hasBackdrop:!0,disableParentScroll:!0}}function r(e){return e&&t.isFunction(e.then)}function i(e,t,n){return Math.max(e,Math.min(t,n))}function a(e){return e?{left:e.offsetLeft,top:e.offsetTop,width:e.offsetWidth,height:e.offsetHeight}:{left:0,top:0,width:0,height:0}}return o.$inject=["$mdSelect","$mdConstant","$mdUtil","$window","$q","$$rAF","$animateCss","$animate"],e("$mdSelect").setDefaults({methods:["target"],options:o})}var d=8,c=0;t.module("material.components.select",["material.core","material.components.backdrop"]).directive("mdSelect",e).directive("mdSelectMenu",o).directive("mdOption",r).directive("mdOptgroup",i).provider("$mdSelect",a),e.$inject=["$mdSelect","$mdUtil","$mdTheming","$mdAria","$rootElement","$compile","$parse"],o.$inject=["$parse","$mdUtil","$mdTheming"],r.$inject=["$mdButtonInkRipple","$mdUtil"],a.$inject=["$$interimElementProvider"]}(),function(){function e(e,n){return function(o){function r(){return e.when(o).then(function(e){return d=e,e})}var i,a="SideNav '"+o+"' is not available!",d=e.get(o);return d||e.notFoundError(o),i={isOpen:function(){return d&&d.isOpen()},isLockedOpen:function(){return d&&d.isLockedOpen()},toggle:function(){return d?d.toggle():n.reject(a)},open:function(){return d?d.open():n.reject(a)},close:function(){return d?d.close():n.reject(a)},then:function(e){var o=d?n.when(d):r();return o.then(e||t.noop)}}}}function o(){return{restrict:"A",require:"^mdSidenav",link:function(e,t,n,o){}}}function r(e,o,r,i,a,d,c,l,s,m){function u(d,u,h,p){function f(e,t){d.isLockedOpen=e,e===t?u.toggleClass("md-locked-open",!!e):a[e?"addClass":"removeClass"](u,"md-locked-open"),k.toggleClass("md-locked-open",!!e)}function g(e){var t=o.findFocusTarget(u)||o.findFocusTarget(u,"[md-sidenav-focus]")||u,n=u.parent();return n[e?"on":"off"]("keydown",E),k[e?"on":"off"]("click",M),e&&(y=m[0].activeElement),b(e),C=s.all([e?a.enter(k,n):a.leave(k),a[e?"removeClass":"addClass"](u,"md-closed")]).then(function(){d.isOpen&&t&&t.focus()})}function b(e){var o=u.parent();e&&!$?($=o.css("overflow"),o.css("overflow","hidden")):t.isDefined($)&&(o.css("overflow",$),$=n)}function v(e){return d.isOpen==e?s.when(!0):s(function(t){d.isOpen=e,o.nextTick(function(){C.then(function(e){d.isOpen||(y&&y.focus(),y=null),t(e)})})})}function E(e){var t=e.keyCode===r.KEY_CODE.ESCAPE;return t?M(e):s.w
s.pin&&s.pin(re.$.scrollContainer,m))}function b(){e.autofocus&&re.input.focus()}function v(){var n=parseInt(e.delay,10)||0;u.$observe("disabled",function(e){te.isDisabled=e}),u.$observe("required",function(e){te.isRequired=null!==e}),e.$watch("searchText",n?a.debounce(D,n):D),e.$watch("selectedItem",w),t.element(l).on("resize",f),e.$on("$destroy",E)}function E(){if(t.element(l).off("resize",f),re){var e="ul scroller scrollContainer input".split(" ");t.forEach(e,function(e){re.$[e].remove()})}}function M(){re={main:o[0],scrollContainer:o[0].getElementsByClassName("md-virtual-repeat-container")[0],scroller:o[0].getElementsByClassName("md-virtual-repeat-scroller")[0],ul:o.find("ul")[0],input:o.find("input")[0],wrap:o.find("md-autocomplete-wrap")[0],root:document.body},re.li=re.ul.getElementsByTagName("li"),re.snap=$(),re.$=y(re)}function $(){for(var e=o;e.length;e=e.parent())if(t.isDefined(e.attr("md-autocomplete-snap")))return e[0];return re.wrap}function y(e){var n={};for(var o in e)e.hasOwnProperty(o)&&(n[o]=t.element(e[o]));return n}function C(t,n){!t&&n?(f(),re&&a.nextTick(function(){a.disableScrollAround(re.ul)},!1,e)):t&&!n&&a.nextTick(function(){a.enableScrolling()},!1,e)}function A(){ae=!0}function T(){ae=!1,ce||(te.hidden=!0)}function k(){re.input.focus()}function w(t,n){t&&P(t).then(function(o){e.searchText=o,_(t,n)}),t!==n&&x()}function x(){t.isFunction(e.itemChange)&&e.itemChange(F(e.selectedItem))}function N(){t.isFunction(e.textChange)&&e.textChange()}function _(e,t){de.forEach(function(n){n(e,t)})}function S(e){-1==de.indexOf(e)&&de.push(e)}function H(e){var t=de.indexOf(e);-1!=t&&de.splice(t,1)}function D(t,n){te.index=B(),t!==n&&P(e.selectedItem).then(function(o){t!==o&&(e.selectedItem=null,t!==n&&N(),q()?J():(te.loading=!1,te.matches=[],te.hidden=U(),K()))})}function O(){ce=!1,ae||(te.hidden=!0)}function I(){ce=!0,t.isString(e.searchText)||(e.searchText=""),e.minLength>0||(te.hidden=U(),te.hidden||J())}function R(e){switch(e.keyCode){case d.KEY_CODE.DOWN_ARROW:if(te.loading)return;e.stopPropagation(),e.preventDefault(),te.index=Math.min(te.index+1,te.matches.length-1),X(),K();break;case d.KEY_CODE.UP_ARROW:if(te.loading)return;e.stopPropagation(),e.preventDefault(),te.index=te.index<0?te.matches.length-1:Math.max(0,te.index-1),X(),K();break;case d.KEY_CODE.TAB:case d.KEY_CODE.ENTER:if(te.hidden||te.loading||te.index<0||te.matches.length<1)return;e.stopPropagation(),e.preventDefault(),V(te.index);break;case d.KEY_CODE.ESCAPE:e.stopPropagation(),e.preventDefault(),W(),te.matches=[],te.hidden=!0,te.index=B()}}function L(){return t.isNumber(e.minLength)?e.minLength:1}function P(t){function n(t){return t&&e.itemText?e.itemText(F(t)):null}return h.when(n(t)||t)}function F(e){if(!e)return n;var t={};return te.itemName&&(t[te.itemName]=e),t}function B(){return e.autoselect?0:-1}function U(){return q()&&te.matches.length?void 0:!0}function z(){return P(te.matches[te.index])}function q(){return t.isDefined(e.searchText)&&e.searchText.length>=L()}function j(e,t,n){Object.defineProperty(te,e,{get:function(){return n},set:function(e){var o=n;n=e,t(e,o)}})}function V(t){a.nextTick(function(){P(te.matches[t]).then(function(e){var t=re.$.input.controller("ngModel");t.$setViewValue(e),t.$render()})["finally"](function(){e.selectedItem=te.matches[t],te.loading=!1,te.hidden=!0,te.index=0,te.matches=[]})},!1)}function W(){e.searchText="",V(-1);var t=document.createEvent("CustomEvent");t.initCustomEvent("input",!0,!0,{value:e.searchText}),re.input.dispatchEvent(t),re.input.focus()}function Y(n){function o(t){ie[i]=t,n===e.searchText&&(te.matches=t,te.hidden=U(),e.selectOnMatch&&ee(),K(),f())}var r=e.$parent.$eval(oe),i=n.toLowerCase();t.isArray(r)?o(r):r&&a.nextTick(function(){te.loading=!0,r.success&&r.success(o),r.then&&r.then(o),r["finally"]&&r["finally"](function(){te.loading=!1})},!0,e)}function K(){z().then(function(e){te.messages=[G(),e]})}function G(){if(le===te.matches.length)return"";switch(le=te.matches.length,te.matches.length){case 0:return"There are no matches available.";case 1:return"There is 1 match availab
i.$watch(function(){return s.isOpen},function(e){e?(l.setAttribute("aria-expanded","true"),r[0].classList.add("md-open"),t.forEach(s.nestedMenus,function(e){e.classList.remove("md-open")})):(l&&l.setAttribute("aria-expanded","false"),r[0].classList.remove("md-open")),i.$mdMenuIsOpen=s.isOpen}),this.focusMenuContainer=function(){var e=c[0].querySelector("[md-menu-focus-target]");e||(e=c[0].querySelector(".md-button")),e.focus()},this.registerContainerProxy=function(e){this.containerProxy=e},this.triggerContainerProxy=function(e){this.containerProxy&&this.containerProxy(e)},this.close=function(n,o){if(s.isOpen&&(s.isOpen=!1,i.$emit("$mdMenuClose",r),e.hide(null,o),!n)){var a=s.restoreFocusTo||r.find("button")[0];a instanceof t.element&&(a=a[0]),a.focus()}},this.positionMode=function(){var e=(o.mdPositionMode||"target").split(" ");return 1==e.length&&e.push(e[0]),{left:e[0],top:e[1]}},this.offsets=function(){var e=(o.mdOffset||"0 0").split(" ").map(parseFloat);if(2==e.length)return{left:e[0],top:e[1]};if(1==e.length)return{top:e[0],left:e[0]};throw Error("Invalid offsets specified. Please follow format <x, y> or <n>")}}t.module("material.components.menu").controller("mdMenuCtrl",e),e.$inject=["$mdMenu","$attrs","$element","$scope","$mdUtil","$timeout"]}(),function(){function e(e){function o(n){n.addClass("md-menu");var o=n.children()[0];if(o.hasAttribute("ng-click")||(o=o.querySelector("[ng-click],[ng-mouseenter]")||o),!o||"MD-BUTTON"!=o.nodeName&&"BUTTON"!=o.nodeName||o.hasAttribute("type")||o.setAttribute("type","button"),2!=n.children().length)throw Error(i+"Expected two children elements.");o&&o.setAttribute("aria-haspopup","true");var a=n[0].querySelectorAll("md-menu"),d=parseInt(n[0].getAttribute("md-nest-level"),10)||0;return a&&t.forEach(e.nodesToArray(a),function(e){e.hasAttribute("md-position-mode")||e.setAttribute("md-position-mode","cascade"),e.classList.add("md-nested-menu"),e.setAttribute("md-nest-level",d+1),e.setAttribute("role","menu")}),r}function r(e,o,r,i){var a=i[0],d=i[1]!=n,c=t.element('<div class="md-open-menu-container md-whiteframe-z2"></div>'),l=o.children()[1];c.append(l),d&&(o.append(c),c[0].style.display="none"),a.init(c,{isInMenuBar:d}),e.$on("$destroy",function(){c.remove(),a.close()})}var i="Invalid HTML for md-menu: ";return{restrict:"E",require:["mdMenu","?^mdMenuBar"],controller:"mdMenuCtrl",scope:!0,compile:o}}t.module("material.components.menu").directive("mdMenu",e),e.$inject=["$mdUtil"]}(),function(){function e(e){function o(e,o,a,d,c,l,s,m,u,h){function p(n,o,r){return r.nestLevel?t.noop:(r.disableParentScroll&&!e.getClosest(r.target,"MD-DIALOG")?r.restoreScroll=e.disableScrollAround(r.element,r.parent):r.disableParentScroll=!1,r.hasBackdrop&&(r.backdrop=e.createBackdrop(n,"md-menu-backdrop md-click-catcher"),u.enter(r.backdrop,r.parent)),function(){r.backdrop&&(r.backdrop.off("click"),u.leave(r.backdrop,{duration:0})),r.disableParentScroll&&r.restoreScroll()})}function f(e,t,n){return n.cleanupInteraction(),n.cleanupResizing(),n.hideBackdrop(),m(t,{addClass:"md-leave"}).start().then(function(){t.removeClass("md-active"),E(t,n),n.alreadyOpen=!1})}function g(n,r,i){function d(){return i.preserveElement?r[0].style.display="":i.parent.append(r),l(function(e){var t=M(r,i);r.removeClass("md-leave"),m(r,{addClass:"md-active",from:$.toCss(t),to:$.toCss({transform:""})}).start().then(e)})}function u(){if(!i.target)throw Error("$mdMenu.show() expected a target to animate from in options.target");t.extend(i,{alreadyOpen:!1,isRemoved:!1,target:t.element(i.target),parent:t.element(i.parent),menuContentEl:t.element(r[0].querySelector("md-menu-content"))})}function h(){var e=function(e,t){return s.throttle(function(){if(!i.isRemoved){var n=M(e,t);e.css($.toCss(n))}})}(r,i);return c.addEventListener("resize",e),c.addEventListener("orientationchange",e),function(){c.removeEventListener("resize",e),c.removeEventListener("orientationchange",e)}}function f(){function t(t){var n;a.KEY_CODE;switch(t.keyCode){case a.KEY_CODE.ESCAPE:i.mdMenuCtrl.close(!0,{closeAll:!0}),n=!0;break;case a.KEY_CODE.UP_ARROW:
}()}(window,window.angular);