UNPKG

angular-material

Version:

**[Support for legacy AngularJS ended on January 1st, 2022](https://goo.gle/angularjs-end-of-life). [See `@angular/core` for the actively supported Angular](https://npmjs.com/@angular/core).**

7 lines 144 kB
/*! * AngularJS Material Design * https://github.com/angular/material * @license MIT * v1.2.4-master-bfc8ae7 */ !function(f,M,C){"use strict";function e(e,t){if(t.has("$swipe")){e.warn("You are using the ngTouch module. \nAngularJS Material already has mobile click, tap, and swipe support... \nngTouch is not supported with AngularJS Material!")}}function t(e,t){e.decorator("$$rAF",["$delegate",n]),e.decorator("$q",["$delegate",o]),t.theme("default").primaryPalette("indigo").accentPalette("pink").warnPalette("deep-orange").backgroundPalette("grey")}function n(d){return d.throttle=function(e){var t,n,o,r;return function(){t=arguments,r=this,o=e,n||(n=!0,d(function(){o.apply(r,Array.prototype.slice.call(t)),n=!1}))}},d}function o(e){return e.resolve||(e.resolve=e.when),e}function r(d){return{restrict:"A",link:{pre:function(e,t,n){var o=n.mdAutoFocus||n.mdAutofocus||n.mdSidenavFocus;r(d(o)(e)),o&&e.$watch(o,r);function r(e){M.isUndefined(e)&&(e=!0),t.toggleClass("md-autofocus",!!e)}}}}}function d(e,m){function i(){return!0}e&&!M.isArray(e)&&(e=Array.prototype.slice.call(e)),m=!!m;var c=e||[];return{items:function(){return[].concat(c)},count:function(){return c.length},inRange:l,contains:t,indexOf:s,itemAt:function(e){return l(e)?c[e]:null},findBy:function(t,n){return c.filter(function(e){return e[t]===n})},add:function(e,t){if(!e)return-1;M.isNumber(t)||(t=c.length);return c.splice(t,0,e),s(e)},remove:function(e){t(e)&&c.splice(s(e),1)},first:u,last:p,next:M.bind(null,n,!1),previous:M.bind(null,n,!0),hasPrevious:function(e){return!!e&&l(s(e)-1)},hasNext:function(e){return!!e&&l(s(e)+1)}};function l(e){return c.length&&-1<e&&e<c.length}function s(e){return c.indexOf(e)}function t(e){return e&&-1<s(e)}function u(){return c.length?c[0]:null}function p(){return c.length?c[c.length-1]:null}function n(e,t,n,o){n=n||i;for(var r=s(t);;){if(!l(r))return null;var d=r+(e?-1:1),a=null;if(l(d)?a=c[d]:m&&(d=s(a=e?p():u())),null===a||d===o)return null;if(n(a))return a;M.isUndefined(o)&&(o=d),r=d}}}function a(a,t,o){var d={},m={},r={},n={};return e.getResponsiveAttribute=function(e,t){for(var n=0;n<a.MEDIA_PRIORITY.length;n++){var o=a.MEDIA_PRIORITY[n];if(m[d[o]].matches){var r=c(e,t+"-"+o);if(e[r])return e[r]}}return e[c(e,t)]},e.getQuery=function(e){return m[e]},e.watchResponsiveAttributes=function(e,o,r){var d=[];return e.forEach(function(e){var t=c(o,e);for(var n in M.isDefined(o[t])&&d.push(o.$observe(t,M.bind(void 0,r,null))),a.MEDIA)t=c(o,e+"-"+n),M.isDefined(o[t])&&d.push(o.$observe(t,M.bind(void 0,r,n)))}),function(){d.forEach(function(e){e()})}},e;function e(e){var t=d[e];M.isUndefined(t)&&(t=d[e]=function(e){return a.MEDIA[e]||("("!==e.charAt(0)?"("+e+")":e)}(e));var n=r[t];return M.isUndefined(n)&&(n=function(e){var t=m[e];t=t||(m[e]=o.matchMedia(e));return t.addListener(i),r[t.media]=!!t.matches}(t)),n}function i(e){t.$evalAsync(function(){r[e.media]=!!e.matches})}function c(e,t){return n[t]||(n[t]=e.$normalize(t))}}function m(e,t){var o=["data","x"];return e?t?n(e):r(e):{buildList:r,buildSelector:n,hasAttribute:function(e,t){if(!(e=d(e)))return!1;for(var n=r(t),o=0;o<n.length;o++)if(e.hasAttribute(n[o]))return!0;return!1},removeAttribute:function(t,e){if(!(t=d(t)))return;r(e).forEach(function(e){t.removeAttribute(e)})}};function r(n){return(n=M.isArray(n)?n:[n]).forEach(function(t){o.forEach(function(e){n.push(e+"-"+t)})}),n}function n(e){return r(e=M.isArray(e)?e:[e]).map(function(e){return"["+e+"]"}).join(",")}function d(e){if((e=e[0]||e).nodeType)return e}}e.$inject=["$log","$injector"],t.$inject=["$provide","$mdThemingProvider"],n.$inject=["$delegate"],o.$inject=["$delegate"],M.module("material.core",["ngAnimate","material.core.animate","material.core.layout","material.core.interaction","material.core.gestures","material.core.theming"]).config(t).run(e),r.$inject=["$parse"],M.module("material.core").directive("mdAutofocus",r),M.module("material.core").factory("$mdColorUtil",function(){return{rgbaToHex:function(e){return((e=e.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i))&&4===e.length?"#"+("0"+parseInt(e[1],10).toString(16)).slice(-2)+("0"+parseInt(e[2],10).toString(16)).slice(-2)+("0"+parseInt(e[3],10).toString(16)).slice(-2):"").toUpperCase()},hexToRgba:function(e){var t="#"===e[0]?e.substr(1):e,n=t.length/3,o=t.substr(0,n),r=t.substr(n,n),d=t.substr(2*n);return 1==n&&(o+=o,r+=r,d+=d),"rgba("+parseInt(o,16)+","+parseInt(r,16)+","+parseInt(d,16)+",0.1)"},rgbToRgba:function(e){return e.replace(")",", 0.1)").replace("(","a(")},rgbaToRgb:function(e){return e?e.replace("rgba","rgb").replace(/,[^),]+\)/,")"):"rgb(0,0,0)"}}}),M.module("material.core").factory("$mdConstant",function(){var o=document.createElement("div"),r=function(e){var t,n,o=/^(Moz|webkit|ms)(?=[A-Z])/;for(t in e.style)if(n=o.exec(t))return n[0]}(o),e=/webkit/i.test(r),d=/([:\-_]+(.))/g;function t(e){var t=function(e){return e.replace(d,function(e,t,n,o){return o?n.toUpperCase():n})}(r+"-"+e),n=t.charAt(0).toLowerCase()+t.substring(1);return a(o,e)?e:a(o,t)?t:a(o,n)?n:e}function a(e,t){return M.isDefined(e.style[t])}var n={isInputKey:function(e){return 31<=e.keyCode&&e.keyCode<=90},isNumPadKey:function(e){return 3===e.location&&97<=e.keyCode&&e.keyCode<=105},isMetaKey:function(e){return 91<=e.keyCode&&e.keyCode<=93},isFnLockKey:function(e){return 112<=e.keyCode&&e.keyCode<=145},isNavigationKey:function(e){var t=n.KEY_CODE;return-1!=[t.SPACE,t.ENTER,t.UP_ARROW,t.DOWN_ARROW].indexOf(e.keyCode)},hasModifierKey:function(e){return e.ctrlKey||e.metaKey||e.altKey},ELEMENT_MAX_PIXELS:1533917,BEFORE_NG_ARIA:210,KEY_CODE:{COMMA:188,SEMICOLON:186,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"+(e?" webkitTransitionEnd":""),ANIMATIONEND:"animationend"+(e?" 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:{xs:"(max-width: 599px)","gt-xs":"(min-width: 600px)",sm:"(min-width: 600px) and (max-width: 959px)","gt-sm":"(min-width: 960px)",md:"(min-width: 960px) and (max-width: 1279px)","gt-md":"(min-width: 1280px)",lg:"(min-width: 1280px) and (max-width: 1919px)","gt-lg":"(min-width: 1920px)",xl:"(min-width: 1920px)",landscape:"(orientation: landscape)",portrait:"(orientation: portrait)",print:"print"},MEDIA_PRIORITY:["xl","gt-lg","lg","gt-md","md","gt-sm","sm","gt-xs","xs","landscape","portrait","print"]};return n}),M.module("material.core").config(["$provide",function(e){e.decorator("$mdUtil",["$delegate",function(e){return e.iterator=d,e}])}]),a.$inject=["$mdConstant","$rootScope","$window"],M.module("material.core").factory("$mdMedia",a),M.module("material.core").config(["$provide",function(e){e.decorator("$mdUtil",["$delegate",function(e){return e.prefixer=m,e}])}]),c.$inject=["$document","$timeout","$compile","$rootScope","$$mdAnimate","$interpolate","$log","$rootElement","$window","$$rAF"];var g,A,T,v=0;if(f.navigator){var i=f.navigator.userAgent||f.navigator.vendor||f.opera;g=i.match(/ipad|iphone|ipod/i),A=i.match(/android/i),T=i.match(/(firefox|minefield)/i)}function c(i,m,n,a,e,t,d,o,c,s){var r=t.startSymbol(),l=t.endSymbol(),u="{{"===r&&"}}"===l;document.contains||(document.contains=function(e){return document.body.contains(e)});function p(e,t,n){var o=!1;if(e&&e.length){var r=c.getComputedStyle(e[0]);o=M.isDefined(r[t])&&(!n||r[t]==n)}return o}function E(e){return e?function(e){return-1<String(e).indexOf("px")}(e)||function(e){return-1<String(e).indexOf("%")}(e)?e:e+"px":"0"}var h={dom:{},isIos:g,isAndroid:A,now:f.performance&&f.performance.now?M.bind(f.performance,f.performance.now):Date.now||function(){return(new Date).getTime()},getModelOption:function(e,t){if(e.$options){var n=e.$options;return n.getOption?n.getOption(t):n[t]}},isRtl:function(e){switch(M.isDefined(e)&&e.hasOwnProperty("dir")&&e.dir){case"ltr":return!1;case"rtl":return!0}return"rtl"===i[0].dir||"rtl"===i[0].body.dir},bidi:function(e,t,n,o){var r=!this.isRtl();if(0==arguments.length)return r?"ltr":"rtl";var d=M.element(e);r&&M.isDefined(n)?d.css(t,E(n)):!r&&M.isDefined(o)&&d.css(t,E(o))},bidiProperty:function(e,t,n,o){var r=!this.isRtl(),d=M.element(e);r&&M.isDefined(t)?(d.css(t,E(o)),d.css(n,"")):!r&&M.isDefined(n)&&(d.css(n,E(o)),d.css(t,""))},clientRect:function(e,t,n){var o=b(e);t=b(t||o.offsetParent||document.body);var r=o.getBoundingClientRect(),d=n?t.getBoundingClientRect():{left:0,top:0,width:0,height:0};return{left:r.left-d.left,top:r.top-d.top,width:r.width,height:r.height}},offsetRect:function(e,t){return h.clientRect(e,t,!0)},nodesToArray:function(e){var t,n=[];for(e=e||[],t=0;t<e.length;++t)n.push(e.item(t));return n},getViewportTop:function(){return h.disableScrollAround._count&&h.disableScrollAround._viewPortTop?h.disableScrollAround._viewPortTop:c.scrollY||c.pageYOffset||0},findFocusTarget:function(e,t){var n=this.prefixer("md-autofocus",!0);return o(e,t||n)||o(e,n);function o(e,t){var n,o=e[0].querySelectorAll(t);return o&&o.length&&o.length&&M.forEach(o,function(e){(e=M.element(e)).hasClass("md-autofocus")&&(n=e)}),n}},disableScrollAround:function(e,t,n){if(n=n||{},h.disableScrollAround._count=Math.max(0,h.disableScrollAround._count||0),h.disableScrollAround._count++,h.disableScrollAround._restoreScroll)return h.disableScrollAround._restoreScroll;var m=i[0].body,o=function(){var e=i[0].documentElement,t=e.style.cssText||"",n=m.style.cssText||"",o=h.getViewportTop();h.disableScrollAround._viewPortTop=o;var r=m.clientWidth,d=m.scrollHeight>m.clientHeight+1,a=0<e.scrollTop?e:m;d&&M.element(m).css({position:"fixed",width:"100%",top:-o+"px"});m.clientWidth<r&&(m.style.overflow="hidden");return function(){m.style.cssText=n,e.style.cssText=t,a.scrollTop=o}}(),r=function(e,t){var n,o=M.element(e||m);t.disableScrollMask?n=o:(n=M.element('<div class="md-scroll-mask"> <div class="md-scroll-mask-bar"></div></div>'),o.append(n));function r(e){e.preventDefault()}return n.on("wheel touchmove",r),function(){n.off("wheel touchmove",r),!t.disableScrollMask&&n[0].parentNode&&n[0].parentNode.removeChild(n[0])}}(t,n);return h.disableScrollAround._restoreScroll=function(){--h.disableScrollAround._count<=0&&(delete h.disableScrollAround._viewPortTop,o(),r(),delete h.disableScrollAround._restoreScroll)}},enableScrolling:function(){var e=this.disableScrollAround._restoreScroll;e&&e()},floatingScrollbars:function(){if(this.floatingScrollbars.cached===C){var e=M.element("<div><div></div></div>").css({width:"100%","z-index":-1,position:"absolute",height:"35px","overflow-y":"scroll"});e.children().css("height","60px"),i[0].body.appendChild(e[0]),this.floatingScrollbars.cached=e[0].offsetWidth===e[0].childNodes[0].offsetWidth,e.remove()}return this.floatingScrollbars.cached},forceFocus:function(e){var n=e[0]||e;document.addEventListener("click",function e(t){t.target===n&&t.$focus&&(n.focus(),t.stopImmediatePropagation(),t.preventDefault(),n.removeEventListener("click",e))},!0);var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!1,!0,f,{},0,0,0,0,!1,!1,!1,!1,0,null),t.$material=!0,t.$focus=!0,n.dispatchEvent(t)},createBackdrop:function(e,t){return n(h.supplant('<md-backdrop class="{0}">',[t]))(e)},supplant:function(e,d,t){return t=t||/\{([^{}]*)\}/g,e.replace(t,function(t,e){var n=e.split("."),o=d;try{for(var r in n)n.hasOwnProperty(r)&&(o=o[n[r]])}catch(e){o=t}return"string"==typeof o||"number"==typeof o?o:t})},fakeNgModel:function(){return{$fake:!0,$setTouched:M.noop,$setViewValue:function(e){this.$viewValue=e,this.$render(e),this.$viewChangeListeners.forEach(function(e){e()})},$isEmpty:function(e){return 0===(""+e).length},$parsers:[],$formatters:[],$viewChangeListeners:[],$render:M.noop}},debounce:function(n,o,r,d){var a;return function(){var e=r,t=Array.prototype.slice.call(arguments);m.cancel(a),a=m(function(){a=C,n.apply(e,t)},o||10,d)}},throttle:function(n,o){var r;return function(){var e=arguments,t=h.now();(!r||o<t-r)&&(n.apply(this,e),r=t)}},time:function(e){var t=h.now();return e(),h.now()-t},valueOnUse:function(e,t,n){var o=null,r=Array.prototype.slice.call(arguments),d=3<r.length?r.slice(3):[];Object.defineProperty(e,t,{get:function(){return null===o&&(o=n.apply(e,d)),o}})},nextUid:function(){return""+v++},disconnectScope:function(e){if(e&&e.$root!==e&&!e.$$destroyed){var t=e.$parent;e.$$disconnected=!0,t.$$childHead===e&&(t.$$childHead=e.$$nextSibling),t.$$childTail===e&&(t.$$childTail=e.$$prevSibling),e.$$prevSibling&&(e.$$prevSibling.$$nextSibling=e.$$nextSibling),e.$$nextSibling&&(e.$$nextSibling.$$prevSibling=e.$$prevSibling),e.$$nextSibling=e.$$prevSibling=null}},reconnectScope:function(e){if(e&&e.$root!==e&&e.$$disconnected){var t=e,n=t.$parent;t.$$disconnected=!1,t.$$prevSibling=n.$$childTail,n.$$childHead?(n.$$childTail.$$nextSibling=t,n.$$childTail=t):n.$$childHead=n.$$childTail=t}},getSiblings:function(t,e){var n=e.toUpperCase();return t instanceof M.element&&(t=t[0]),Array.prototype.filter.call(t.parentNode.children,function(e){return t!==e&&e.tagName.toUpperCase()===n}).map(function(e){return M.element(e)})},getClosest:function(e,t,n){if(M.isString(t)){var o=t.toUpperCase();t=function(e){return e.nodeName.toUpperCase()===o}}if(e instanceof M.element&&(e=e[0]),n&&(e=e.parentNode),!e)return null;do{if(t(e))return e}while(e=e.parentNode);return null},elementContains:function(t,n){return(f.Node&&f.Node.prototype&&Node.prototype.contains?M.bind(t,t.contains):M.bind(t,function(e){return t===n||!!(16&this.compareDocumentPosition(e))}))(n)},extractElementByName:function(e,o,t,n){var r=m(e);return!r&&n&&d.warn(h.supplant("Unable to find node '{0}' in element '{1}'.",[o,e[0].outerHTML])),M.element(r||e);function m(e){return function(e){if(e)for(var t=0,n=e.length;t<n;t++)if(e[t].nodeName.toLowerCase()===o)return e[t];return null}(e)||(t?function(e){var t;if(e)for(var n=0,o=e.length;n<o;n++){var r=e[n];if(!t)for(var d=0,a=r.childNodes.length;d<a;d++)t=t||m([r.childNodes[d]])}return t}(e):null)}},initOptionalProperties:function(o,r,d){d=d||{},M.forEach(o.$$isolateBindings,function(e,t){if(e.optional&&M.isUndefined(o[t])){var n=M.isDefined(r[e.attrName]);o[t]=M.isDefined(d[t])?d[t]:n}})},nextTick:function(e,t,n){var o=h.nextTick,r=o.timeout,d=o.queue||[];return d.push({scope:n,callback:e}),null==t&&(t=!0),o.digest=o.digest||t,o.queue=d,r||(o.timeout=m(function(){var e=o.queue,t=o.digest;o.queue=[],o.timeout=null,o.digest=!1,e.forEach(function(e){e.scope&&e.scope.$$destroyed||e.callback()}),t&&a.$digest()},0,!1))},processTemplate:function(e){return u?e:e&&M.isString(e)?e.replace(/\{\{/g,r).replace(/}}/g,l):e},getParentWithPointerEvents:function(e){for(var t=e.parent();p(t,"pointer-events","none");)t=t.parent();return t},getNearestContentElement:function(e){for(var t=e.parent()[0];t&&t!==o[0]&&t!==document.body&&"MD-CONTENT"!==t.nodeName.toUpperCase();)t=t.parentNode;return t},checkStickySupport:function(){var e,t=M.element("<div>");i[0].body.appendChild(t[0]);for(var n=["sticky","-webkit-sticky"],o=0;o<n.length;++o)if(t.css({position:n[o],top:0,"z-index":2}),t.css("position")==n[o]){e=n[o];break}return t.remove(),e},parseAttributeBoolean:function(e,t){return""===e||!!e&&(!1===t||"false"!==e&&"0"!==e)},hasComputedStyle:p,isParentFormSubmitted:function(e){var t=h.getClosest(e,"form"),n=t?M.element(t).controller("form"):null;return!!n&&n.$submitted},animateScrollTo:function(r,d,a){var m=r.scrollTop,i=d-m,c=m<d,l=h.now();s(function e(){var t=(n=a||1e3,o=h.now()-l,function(e,t,n,o){if(o<e)return t+n;var r=(e/=o)*e;return t+n*(r*e*-2+3*r)}(o,m,i,n));var n,o;r.scrollTop=t;(c?t<d:d<t)&&s(e)})},uniq:function(e){if(e)return e.filter(function(e,t,n){return n.indexOf(e)===t})},getInnerHTML:function(e){var t=new XMLSerializer;return Array.prototype.map.call(e.childNodes,function(e){return t.serializeToString(e)}).join("")},getOuterHTML:function(e){return(new XMLSerializer).serializeToString(e)},msie:f.document.documentMode,getTouchAction:function(){for(var e=document.createElement("div"),t=["","webkit","Moz","MS","ms","o"],n=0;n<t.length;n++){var o=t[n],r=o?o+"TouchAction":"touchAction";if(M.isDefined(e.style[r]))return r}},getEventPath:function(e){for(var t=[],n=e.target;n;)t.push(n),n=n.parentElement;return-1===t.indexOf(f)&&-1===t.indexOf(document)&&t.push(document),-1===t.indexOf(f)&&t.push(f),t},sanitize:function(e){return e?e.replace(/[\\^$*+?.()|{}[]/g,"\\$&"):e},isDisabled:function(e){return e.hasAttribute("disabled")},isVisible:function(e){return h.hasGeometry(e)&&"visible"===getComputedStyle(e).visibility},isTabbable:function(e){var t=h.getFrameElement(h.getWindow(e));if(t){if(-1===h.getTabIndexValue(t))return!1;if(!h.isVisible(t))return!1}var n=e.nodeName.toLowerCase(),o=h.getTabIndexValue(e);return e.hasAttribute("contenteditable")?-1!==o:"iframe"!==n&&"object"!==n&&(!(g&&!h.isPotentiallyTabbableIOS(e))&&("audio"===n?!!e.hasAttribute("controls")&&-1!==o:"video"===n?-1!==o&&(null!==o||(T||e.hasAttribute("controls"))):0<=e.tabIndex))},isFocusable:function(e){return h.isPotentiallyFocusable(e)&&!h.isDisabled(e)&&h.isVisible(e)},isPotentiallyFocusable:function(e){return!h.isHiddenInput(e)&&(h.isNativeFormElement(e)||h.isAnchorWithHref(e)||e.hasAttribute("contenteditable")||h.hasValidTabIndex(e))},isPotentiallyTabbableIOS:function(e){var t=e.nodeName.toLowerCase(),n="input"===t&&e.type;return"text"===n||"password"===n||"select"===t||"textarea"===t},getTabIndexValue:function(e){if(!h.hasValidTabIndex(e))return null;var t=parseInt(e.getAttribute("tabindex")||"",10);return isNaN(t)?-1:t},hasValidTabIndex:function(e){if(!e.hasAttribute("tabindex")||e.tabIndex===C)return!1;var t=e.getAttribute("tabindex");return"-32768"!=t&&!(!t||isNaN(parseInt(t,10)))},hasGeometry:function(e){return!!(e.offsetWidth||e.offsetHeight||"function"==typeof e.getClientRects&&e.getClientRects().length)},getFrameElement:function(e){try{return e.frameElement}catch(e){return null}},getWindow:function(e){return e.ownerDocument&&e.ownerDocument.defaultView||f},isNativeFormElement:function(e){var t=e.nodeName.toLowerCase();return"input"===t||"select"===t||"button"===t||"textarea"===t},isHiddenInput:function(e){return h.isInputElement(e)&&"hidden"==e.type},isAnchorWithHref:function(e){return h.isAnchorElement(e)&&e.hasAttribute("href")},isInputElement:function(e){return"input"==e.nodeName.toLowerCase()},isAnchorElement:function(e){return"a"==e.nodeName.toLowerCase()},getFirstTabbableElement:function(e){if(h.isFocusable(e)&&h.isTabbable(e))return e;for(var t=e.children||e.childNodes,n=0;n<t.length;n++){var o=t[n].nodeType===i[0].ELEMENT_NODE?h.getFirstTabbableElement(t[n]):null;if(o)return o}return null},getLastTabbableElement:function(e){if(h.isFocusable(e)&&h.isTabbable(e))return e;for(var t=e.children||e.childNodes,n=t.length-1;0<=n;n--){var o=t[n].nodeType===i[0].ELEMENT_NODE?h.getLastTabbableElement(t[n]):null;if(o)return o}return null}};return h.dom.animator=e(h),h;function b(e){return e[0]||e}}function l(o,r,i,d){var a=this.showWarnings;return{expect:m,expectAsync:c,expectWithText:function(e,t){var n=l(e)||"";-1<n.indexOf(d.startSymbol())?c(e,t,function(){return l(e)}):m(e,t,n)},expectWithoutText:function(e,t){var n=l(e);-1<n.indexOf(d.startSymbol())||n||m(e,t,n)},getText:l,hasAriaLabel:s,parentHasAriaLabel:function e(t,n){n=n||1;var o=M.element(t)[0]||t;if(!o.parentNode)return!1;if(r(o.parentNode))return!0;n--;if(n)return e(o.parentNode,n);return!1;function r(e){if(!s(e))return!1;if(e.hasAttribute("role"))switch(e.getAttribute("role").toLowerCase()){case"command":case"definition":case"directory":case"grid":case"list":case"listitem":case"log":case"marquee":case"menu":case"menubar":case"note":case"presentation":case"separator":case"scrollbar":case"status":case"tablist":return!1}switch(e.tagName.toLowerCase()){case"abbr":case"acronym":case"address":case"applet":case"audio":case"b":case"bdi":case"bdo":case"big":case"blockquote":case"br":case"canvas":case"caption":case"center":case"cite":case"code":case"col":case"data":case"dd":case"del":case"dfn":case"dir":case"div":case"dl":case"em":case"embed":case"fieldset":case"figcaption":case"font":case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":case"hgroup":case"html":case"i":case"ins":case"isindex":case"kbd":case"keygen":case"label":case"legend":case"li":case"map":case"mark":case"menu":case"object":case"ol":case"output":case"pre":case"presentation":case"q":case"rt":case"ruby":case"samp":case"small":case"source":case"span":case"status":case"strike":case"strong":case"sub":case"sup":case"svg":case"tbody":case"td":case"th":case"thead":case"time":case"tr":case"track":case"tt":case"ul":case"var":return!1}return!0}}};function m(e,t,n){var o=M.element(e)[0]||e;!o||o.hasAttribute(t)&&0!==o.getAttribute(t).length||function(e,t){var n=e.hasChildNodes(),o=!1;if(n)for(var r=e.childNodes,d=0;d<r.length;d++){var a=r[d];1===a.nodeType&&a.hasAttribute(t)&&"none"!==((m=a).currentStyle?m.currentStyle:i.getComputedStyle(m)).display&&(o=!0)}var m;return o}(o,t)||((n=M.isString(n)?n.trim():"").length?e.attr(t,n):a&&r.warn('ARIA: Attribute "',t,'", required for accessibility, is missing on node:',o))}function c(e,t,n){o(function(){m(e,t,n())})}function l(t){t=t[0]||t;for(var e,n=document.createTreeWalker(t,NodeFilter.SHOW_TEXT,null,!1),o="";e=n.nextNode();)r(e)||(o+=e.textContent);return o.trim()||"";function r(e){for(;e.parentNode&&(e=e.parentNode)!==t;)if(e.getAttribute&&"true"===e.getAttribute("aria-hidden"))return!0}}function s(e){var t=M.element(e)[0]||e;return!!t.hasAttribute&&(t.hasAttribute("aria-label")||t.hasAttribute("aria-labelledby")||t.hasAttribute("aria-describedby"))}}function s(){function d(e,t,n,o,r){this.$q=e,this.$templateRequest=t,this.$injector=n,this.$compile=o,this.$controller=r}this.$get=["$q","$templateRequest","$injector","$compile","$controller",function(e,t,n,o,r){return new d(e,t,n,o,r)}],d.prototype.compile=function(e){return e.contentElement?this._prepareContentElement(e):this._compileTemplate(e)},d.prototype._prepareContentElement=function(e){var t=this._fetchContentElement(e);return this.$q.resolve({element:t.element,cleanup:t.restore,locals:{},link:function(){return t.element}})},d.prototype._compileTemplate=function(o){var r=this,e=o.templateUrl,t=o.template||"",n=M.extend({},o.resolve),d=M.extend({},o.locals),a=o.transformTemplate||M.identity;return M.forEach(n,function(e,t){M.isString(e)?n[t]=r.$injector.get(e):n[t]=r.$injector.invoke(e)}),M.extend(n,d),n.$$ngTemplate=e?this.$templateRequest(e):this.$q.when(t),this.$q.all(n).then(function(e){var t=a(e.$$ngTemplate,o),n=o.element||M.element("<div>").html(t.trim()).contents();return r._compileElement(e,n,o)})},d.prototype._compileElement=function(o,r,d){var a=this,m=this.$compile(r),i={element:r,cleanup:r.remove.bind(r),locals:o,link:function(e){if(o.$scope=e,d.controller){var t=M.extend({},o,{$element:r}),n=a._createController(d,t,o);M.isFunction(n.$onDestroy)&&e.$on("$destroy",function(){M.isFunction(n.$onDestroy)&&n.$onDestroy()}),r.data("$ngControllerController",n),r.children().data("$ngControllerController",n),i.controller=n}return m(e)}};return i},d.prototype._createController=function(e,t,n){var o=this.$controller(e.controller,t);return e.bindToController&&M.extend(o,n),e.controllerAs&&(t.$scope[e.controllerAs]=o),M.isFunction(o.$onInit)&&o.$onInit(),o},d.prototype._fetchContentElement=function(e){var t,n=e.contentElement;return t=M.isString(n)?o(n=document.querySelector(n)):(n=n[0]||n,document.contains(n)?o(n):function(){n.parentNode&&n.parentNode.removeChild(n)}),{element:M.element(n),restore:t};function o(e){var t=e.parentNode,n=e.nextElementSibling;return function(){n?t.insertBefore(e,n):t.appendChild(e)}}}}M.module("material.core").factory("$mdUtil",c),M.element.prototype.focus=M.element.prototype.focus||function(){return this.length&&this[0].focus(),this},M.element.prototype.blur=M.element.prototype.blur||function(){return this.length&&this[0].blur(),this},l.$inject=["$$rAF","$log","$window","$interpolate"],M.module("material.core").provider("$mdAria",function(){var r={showWarnings:!0};return{disableWarnings:function(){r.showWarnings=!1},$get:["$$rAF","$log","$window","$interpolate",function(e,t,n,o){return l.apply(r,arguments)}]}}),M.module("material.core").provider("$mdCompiler",s),s.$inject=["$compileProvider"],W.$inject=["$$MdGestureHandler","$$rAF","$timeout","$mdUtil"];var u,p,E,h,b,_,N,H,y,k,w,$,x,S,D,I,R,O,P={},L=6,j=!(q.$inject=["$mdGesture","$$MdGestureHandler","$mdUtil"]),F=!1,U=null,z=!1;function Y(){}function W(o,e,n,t){var r=t.getTouchAction(),d=void 0!==f.jQuery&&M.element===f.jQuery,a={handler:function(e,t){var n=new o(e);return M.extend(n,t),P[e]=n,a},register:function(e,t,n){var o=P[t.replace(/^\$md./,"")];if(o)return o.registerElement(e,n);throw new Error("Failed to register element with handler "+t+". Available handlers: "+Object.keys(P).join(", "))},isAndroid:t.isAndroid,isIos:t.isIos,isHijackingClicks:(t.isIos||t.isAndroid)&&!d&&!j};function m(n){return function(e,t){t.distance<this.state.options.maxDistance&&this.dispatchEvent(e,n,t)}}return a.isHijackingClicks&&(a.handler("click",{options:{maxDistance:L},onEnd:m("click")}),a.handler("focus",{options:{maxDistance:L},onEnd:function(e,t){t.distance<this.state.options.maxDistance&&Q(e.target)&&(this.dispatchEvent(e,"focus",t),e.target.focus())}}),a.handler("mouseup",{options:{maxDistance:L},onEnd:m("mouseup")}),a.handler("mousedown",{onStart:function(e){this.dispatchEvent(e,"mousedown")}})),a.handler("press",{onStart:function(e,t){this.dispatchEvent(e,"$md.pressdown")},onEnd:function(e,t){this.dispatchEvent(e,"$md.pressup")}}).handler("hold",{options:{maxDistance:6,delay:500},onCancel:function(){n.cancel(this.state.timeout)},onStart:function(e,t){if(!this.state.registeredParent)return this.cancel();this.state.pos={x:t.x,y:t.y},this.state.timeout=n(M.bind(this,function(){this.dispatchEvent(e,"$md.hold"),this.cancel()}),this.state.options.delay,!1)},onMove:function(e,t){r||"touchmove"!==e.type||e.preventDefault();var n=this.state.pos.x-t.x,o=this.state.pos.y-t.y;Math.sqrt(n*n+o*o)>this.options.maxDistance&&this.cancel()},onEnd:function(){this.onCancel()}}).handler("drag",{options:{minDistance:6,horizontal:!0,cancelMultiplier:1.5},onSetup:function(e,t){r&&(this.oldTouchAction=e[0].style[r],e[0].style[r]=t.horizontal?"pan-y":"pan-x")},onCleanup:function(e){this.oldTouchAction?e[0].style[r]=this.oldTouchAction:e[0].style[r]=null},onStart:function(e){this.state.registeredParent||this.cancel()},onMove:function(e,t){var n,o;r||"touchmove"!==e.type||e.preventDefault(),this.state.dragPointer?this.dispatchDragMove(e):(o=this.state.options.horizontal?(n=Math.abs(t.distanceX)>this.state.options.minDistance,Math.abs(t.distanceY)>this.state.options.minDistance*this.state.options.cancelMultiplier):(n=Math.abs(t.distanceY)>this.state.options.minDistance,Math.abs(t.distanceX)>this.state.options.minDistance*this.state.options.cancelMultiplier),n?(this.state.dragPointer=B(e),V(e,this.state.dragPointer),this.dispatchEvent(e,"$md.dragstart",this.state.dragPointer)):o&&this.cancel())},dispatchDragMove:e.throttle(function(e){this.state.isRunning&&(V(e,this.state.dragPointer),this.dispatchEvent(e,"$md.drag",this.state.dragPointer))}),onEnd:function(e,t){this.state.dragPointer&&(V(e,this.state.dragPointer),this.dispatchEvent(e,"$md.dragend",this.state.dragPointer))}}).handler("swipe",{options:{minVelocity:.65,minDistance:10},onEnd:function(e,t){var n;Math.abs(t.velocityX)>this.state.options.minVelocity&&Math.abs(t.distanceX)>this.state.options.minDistance?(n="left"==t.directionX?"$md.swipeleft":"$md.swiperight",this.dispatchEvent(e,n)):Math.abs(t.velocityY)>this.state.options.minVelocity&&Math.abs(t.distanceY)>this.state.options.minDistance&&(n="up"==t.directionY?"$md.swipeup":"$md.swipedown",this.dispatchEvent(e,n))}})}function X(e){this.name=e,this.state={}}function q(e,r,n){if(!F){!z&&e.isHijackingClicks&&(document.addEventListener("click",function(e){var t;t=n.isIos?M.isDefined(e.webkitForce)&&0===e.webkitForce:0===e.clientX&&0===e.clientY;t||e.$material||e.isIonicTap||G(e)?(U=null,"label"===e.target.tagName.toLowerCase()&&(U={x:e.x,y:e.y})):(e.preventDefault(),e.stopPropagation(),U=null)},!0),document.addEventListener("mouseup",t,!0),document.addEventListener("mousedown",t,!0),document.addEventListener("focus",t,!0),z=!0);M.element(document).on("mousedown touchstart pointerdown",function(e){if(u)return;var t=+Date.now();if(p&&!K(e,p)&&t-p.endTime<1500)return;u=B(e),o("start",e)}).on("mousemove touchmove pointermove",function(e){if(!u||!K(e,u))return;V(e,u),o("move",e)}).on("mouseup mouseleave touchend touchcancel pointerup pointercancel",function(e){if(!u||!K(e,u))return;V(e,u),u.endTime=+Date.now(),"pointercancel"!==e.type&&o("end",e);p=u,u=null}).on("$$mdGestureReset",function(){p=u=null})}function t(e){!e.clientX&&!e.clientY||e.$material||e.isIonicTap||G(e)||"mousedown"===e.type&&(Q(e.target)||Q(document.activeElement))||(e.preventDefault(),e.stopPropagation())}function o(e,t){var n;for(var o in P)(n=P[o])instanceof r&&("start"===e&&n.cancel(),n[e](t,u))}}function B(e){var t=Z(e),n={startTime:+Date.now(),target:e.target,type:e.type.charAt(0)};return n.startX=n.x=t.pageX,n.startY=n.y=t.pageY,n}function K(e,t){return e&&t&&e.type.charAt(0)===t.type}function G(e){return U&&U.x===e.x&&U.y===e.y}function V(e,t){var n=Z(e),o=t.x=n.pageX,r=t.y=n.pageY;t.distanceX=o-t.startX,t.distanceY=r-t.startY,t.distance=Math.sqrt(t.distanceX*t.distanceX+t.distanceY*t.distanceY),t.directionX=0<t.distanceX?"right":t.distanceX<0?"left":"",t.directionY=0<t.distanceY?"down":t.distanceY<0?"up":"",t.duration=+Date.now()-t.startTime,t.velocityX=t.distanceX/t.duration,t.velocityY=t.distanceY/t.duration}function Z(e){return(e=e.originalEvent||e).touches&&e.touches[0]||e.changedTouches&&e.changedTouches[0]||e}function Q(e){return!!e&&"-1"!==e.getAttribute("tabindex")&&!e.hasAttribute("disabled")&&(e.hasAttribute("tabindex")||e.hasAttribute("href")||e.isContentEditable||-1!==["INPUT","SELECT","BUTTON","TEXTAREA","VIDEO","AUDIO"].indexOf(e.nodeName))}function J(e,t,n){this.$timeout=e,this.$mdUtil=t,this.$rootScope=n,this.pointerEvent="MSPointerEvent"in f?"MSPointerDown":"PointerEvent"in f?"pointerdown":null,this.bodyElement=M.element(document.body),this.isBuffering=!1,this.bufferTimeout=null,this.lastInteractionType=null,this.lastInteractionTime=null,this.inputHandler=this.onInputEvent.bind(this),this.bufferedInputHandler=this.onBufferInputEvent.bind(this),this.inputEventMap={keydown:"keyboard",mousedown:"mouse",mouseenter:"mouse",touchstart:"touch",pointerdown:"pointer",MSPointerDown:"pointer"},this.iePointerMap={2:"touch",3:"touch",4:"mouse"},this.initializeEvents(),this.$rootScope.$on("$destroy",this.deregister.bind(this))}function ee(e){return e.replace(H,"").replace(y,function(e,t,n,o){return o?n.toUpperCase():n})}function te(){var e=!!document.querySelector("[md-layouts-disabled]");O.enabled=!e}function ne(){return O.enabled=!1,{restrict:"A",priority:"900"}}function oe(o){return["$mdUtil","$interpolate","$log",function(e,t,n){return E=e,h=t,b=n,{restrict:"A",compile:function(e,t){var n;return O.enabled&&(de(o,ie(o,t,""),ae(e,o,t)),r(null,e),n=r),n||M.noop}}}];function r(e,t){t.addClass(o)}}function re(e,t,n,o){var r,d=n[0].nodeName.toLowerCase();switch(e.replace($,"")){case"flex":"md-button"!==d&&"fieldset"!==d||(r="<"+d+" "+e+"></"+d+">","https://github.com/philipwalton/flexbugs#9-some-html-elements-cant-be-flex-containers","Markup '{0}' may not work as expected in IE Browsers. Consult '{1}' for details.",o.warn(E.supplant("Markup '{0}' may not work as expected in IE Browsers. Consult '{1}' for details.",[r,"https://github.com/philipwalton/flexbugs#9-some-html-elements-cant-be-flex-containers"])))}}function de(e,t,n){var o=t;if(!me(t)){switch(e.replace($,"")){case"layout":ce(t,D)||(t=D[0]);break;case"flex":ce(t,S)||isNaN(t)&&(t="");break;case"flex-offset":case"flex-order":t&&!isNaN(+t)||(t="0");break;case"layout-align":var r=function(e){var t,n={main:"start",cross:"stretch"};0!==(e=e||"").indexOf("-")&&0!==e.indexOf(" ")||(e="none"+e);(t=e.toLowerCase().trim().replace(x,"-").split("-")).length&&"space"===t[0]&&(t=[t[0]+"-"+t[1],t[2]]);0<t.length&&(n.main=t[0]||n.main);1<t.length&&(n.cross=t[1]||n.cross);I.indexOf(n.main)<0&&(n.main="start");R.indexOf(n.cross)<0&&(n.cross="stretch");return n}(t);t=E.supplant("{main}-{cross}",r);break;case"layout-padding":case"layout-margin":case"layout-fill":case"layout-wrap":case"layout-nowrap":t=""}t!==o&&(n||M.noop)(t)}return t?t.trim():""}function ae(e,t,n){return function(e){me(e)||(n[n.$normalize(t)]=e)}}function me(e){return-1<(e||"").indexOf(h.startSymbol())}function ie(e,t,n){var o=t.$normalize(e);return t[o]?t[o].trim().replace(x,"-"):n||null}function ce(t,e,n){t=n&&t?t.replace(x,n):t;var o=!1;return t&&e.forEach(function(e){e=n?e.replace(x,n):e,o=o||e===t}),o}function le(e){this._$timeout=e,this._liveElement=this._createLiveElement(),this._announceTimeout=100}function se(n,o){var r,d=[],a={};return r={notFoundError:function(e,t){n.error((t||"")+"No instance found for handle",e)},getInstances:function(){return d},get:function(e){if(!m(e))return null;var t,n,o;for(t=0,n=d.length;t<n;t++)if((o=d[t]).$$mdHandle===e)return o;return null},register:function(t,e){return e?(t.$$mdHandle=e,d.push(t),(n=a[e])&&(n.forEach(function(e){e.resolve(t)}),delete a[e]),function(){var e=d.indexOf(t);-1!==e&&d.splice(e,1)}):M.noop;var n},when:function(e){if(m(e)){var t=o.defer(),n=r.get(e);return n?t.resolve(n):(a[e]===C&&(a[e]=[]),a[e].push(t)),t.promise}return o.reject("Invalid `md-component-id` value.")}};function m(e){return e&&""!==e}}function ue(o){return{attach:function(e,t,n){return n=M.extend(function(e){return e.hasClass("md-icon-button")?{isMenuItem:e.hasClass("md-menu-item"),fitRipple:!0,center:!0}:{isMenuItem:e.hasClass("md-menu-item"),dimBackground:!0}}(t),n),o.attach(e,t,n)}}}function pe(o){return{attach:function(e,t,n){return o.attach(e,t,M.extend({center:!0,dimBackground:!1,fitRipple:!0},n))}}}function Ee(o){return{attach:function(e,t,n){return o.attach(e,t,M.extend({center:!1,dimBackground:!0,outline:!1,rippleSize:"full"},n))}}}M.module("material.core.gestures",[]).provider("$mdGesture",Y).factory("$$MdGestureHandler",function(){var e=void 0!==f.jQuery&&M.element===f.jQuery;return X.prototype={options:{},dispatchEvent:e?function(e,t,n){n=n||u;var o=new M.element.Event(t);o.$material=!0,o.pointer=n,o.srcEvent=e,M.extend(o,{clientX:n.x,clientY:n.y,screenX:n.x,screenY:n.y,pageX:n.x,pageY:n.y,ctrlKey:e.ctrlKey,altKey:e.altKey,shiftKey:e.shiftKey,metaKey:e.metaKey}),M.element(n.target).trigger(o)}:function(e,t,n){var o;n=n||u,"click"===t||"mouseup"===t||"mousedown"===t?"function"==typeof f.MouseEvent?o=new MouseEvent(t,{bubbles:!0,cancelable:!0,screenX:Number(e.screenX),screenY:Number(e.screenY),clientX:Number(n.x),clientY:Number(n.y),ctrlKey:e.ctrlKey,altKey:e.altKey,shiftKey:e.shiftKey,metaKey:e.metaKey,button:e.button,buttons:e.buttons,relatedTarget:e.relatedTarget||null}):(o=document.createEvent("MouseEvents")).initMouseEvent(t,!0,!0,f,e.detail,n.x,n.y,n.x,n.y,e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget||null):"function"==typeof f.CustomEvent?o=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:{}}):(o=document.createEvent("CustomEvent")).initCustomEvent(t,!0,!0,{});o.$material=!0,o.pointer=n,o.srcEvent=e,n.target.dispatchEvent(o)},onSetup:M.noop,onCleanup:M.noop,onStart:M.noop,onMove:M.noop,onEnd:M.noop,onCancel:M.noop,start:function(e,t){if(!this.state.isRunning){var n=this.getNearestParent(e.target),o=n&&n.$mdGesture[this.name]||{};this.state={isRunning:!0,options:M.extend({},this.options,o),registeredParent:n},this.onStart(e,t)}},move:function(e,t){this.state.isRunning&&this.onMove(e,t)},end:function(e,t){this.state.isRunning&&(this.state.isRunning=!1,this.onEnd(e,t))},cancel:function(e,t){this.onCancel(e,t),this.state={}},getNearestParent:function(e){for(var t=e;t;){if((t.$mdGesture||{})[this.name])return t;t=t.parentNode}return null},registerElement:function(e,t){var n=this;return e[0].$mdGesture=e[0].$mdGesture||{},e[0].$mdGesture[this.name]=t||{},e.on("$destroy",o),n.onSetup(e,t||{}),o;function o(){delete e[0].$mdGesture[n.name],e.off("$destroy",o),n.onCleanup(e,t||{})}}},X}).run(q),Y.prototype={disableAll:function(){F=!0},skipClickHijack:function(){return j=!0},setMaxClickDistance:function(e){L=parseInt(e)},$get:["$$MdGestureHandler","$$rAF","$timeout","$mdUtil",function(e,t,n,o){return new W(e,t,n,o)}]},M.module("material.core").provider("$$interimElement",function(){return t.$inject=["$document","$q","$rootScope","$timeout","$rootElement","$animate","$mdUtil","$mdCompiler","$mdTheming","$injector","$exceptionHandler"],e.$get=t,e;function e(r){e.$inject=["$$interimElement","$injector"];var n=["onHide","onShow","onRemove"],d={},c={presets:{}},o={setDefaults:function(e){return c.optionsFactory=e.options,c.methods=(e.methods||[]).concat(n),o},addPreset:function(e,t){if((t=t||{}).methods=t.methods||[],t.options=t.options||function(){return{}},/^cancel|hide|show$/.test(e))throw new Error("Preset '"+e+"' in "+r+" is reserved!");if(-1<t.methods.indexOf("_options"))throw new Error("Method '_options' in "+r+" is reserved!");return c.presets[e]={methods:t.methods.concat(n),optionsFactory:t.options,argOption:t.argOption},o},addMethod:function(e,t){return d[e]=t,o},$get:e};return o.addPreset("build",{methods:["controller","controllerAs","resolve","multiple","template","templateUrl","themable","transformTemplate","parent","contentElement"]}),o;function e(e,o){var a,t,n=e(),m={hide:n.hide,cancel:n.cancel,show:function(e){(e=e||{})._options&&(e=e._options);return n.show(M.extend({},t,e))},destroy:function(e){return n.destroy(e)}};return a=c.methods||[],t=i(c.optionsFactory,{}),M.forEach(d,function(e,t){m[t]=e}),M.forEach(c.presets,function(t,n){var o=i(t.optionsFactory,{}),e=(t.methods||[]).concat(a);function r(e){this._options=M.extend({},o,e)}if(M.extend(o,{$type:n}),M.forEach(e,function(t){r.prototype[t]=function(e){return this._options[t]=e,this}}),t.argOption){var d="show"+n.charAt(0).toUpperCase()+n.slice(1);m[d]=function(e){var t=m[n](e);return m.show(t)}}m[n]=function(e){return arguments.length&&t.argOption&&!M.isObject(e)&&!M.isArray(e)?(new r)[t.argOption](e):new r(e)}}),m;function i(e,t){var n={};return n[r]=m,o.invoke(e||function(){return t},{},n)}}}function t(s,u,t,p,E,o,n,h,b,i,c){return function(){var l,r=[],d=[],a=[];return l={show:function(e){var t=new m((e=e||{})||{}),n=e.multiple?u.resolve():u.all(r);e.multiple||(n=n.then(function(){var e=d.concat(a.map(l.cancel));return u.all(e)}));var o=n.then(function(){return t.show().then(function(){a.push(t)}).catch(function(e){return e}).finally(function(){r.splice(r.indexOf(o),1)})});return r.push(o),t.deferred.promise.catch(function(e){return e instanceof Error&&c(e),e}),t.deferred.promise},hide:e(function(n,o){{if((o=o||{}).closeAll)return u.all(a.slice().reverse().map(e));if(o.closeTo!==C)return u.all(a.slice(o.closeTo).map(e))}return e(a[a.length-1]);function e(e){if(!e)return u.when(n);var t=e.remove(n,!1,o||{}).catch(function(e){return e}).finally(function(){d.splice(d.indexOf(t),1)});return a.splice(a.indexOf(e),1),d.push(t),e.deferred.promise}}),cancel:e(function(e,t){var n=a.pop();if(!n)return u.when(e);var o=n.remove(e,!0,t||{}).catch(function(e){return e}).finally(function(){d.splice(d.indexOf(o),1)});return d.push(o),n.deferred.promise.catch(M.noop)}),destroy:function(e){var t=e?null:a.shift(),n=M.element(e).length&&M.element(e)[0].parentNode;if(n){var o=a.filter(function(e){return e.options.element[0]===n});o.length&&(t=o[0],a.splice(a.indexOf(t),1))}return t?t.remove(!1,!1,{$destroy:!0}):u.when(!1)},$injector_:i};function e(t){return function(){var e=arguments;return a.length?t.apply(l,e):r.length?r[0].finally(function(){return t.apply(l,e)}):u.when("No interim elements currently showing up.")}}function m(d){var a,m,i=u.when(!0);return d=function(e){(e=e||{}).template&&(e.template=n.processTemplate(e.template));return M.extend({preserveScope:!1,cancelAutoHide:M.noop,scope:e.scope||t.$new(e.isolateScope),onShow:function(e,t,n){return o.enter(t,n.parent)},onRemove:function(e,t){return t&&o.leave(t)||u.when()}},e)}(d),a={options:d,deferred:u.defer(),show:function(){return u(function(t,n){function o(e){a.deferred.reject(e),n(e)}d.onCompiling&&d.onCompiling(d),function(t){return(t.skipCompile?null:h.compile(t))||u(function(e){e({locals:{},link:function(){return t.element}})})}(d).then(function(e){m=function(e,t){M.extend(e.locals,t);var n=e.link(t.scope);t.element=n,t.parent=function(e,t){var n,o=t.parent;o=M.isFunction(o)?o(t.scope,e,t):M.isString(o)?M.element(s[0].querySelector(o)):M.element(o);if((o||{}).length)return o;E[0]&&E[0].querySelector&&(n=E[0].querySelector(":not(svg) > body"));n=n||E[0];"#comment"===n.nodeName&&(n=s[0].body);return M.element(n)}(n,t),t.themable&&b(n);return n}(e,d),d.cleanupElement=e.cleanup,i=function(n,o,e){var t=o.onShowing||M.noop,r=o.onComplete||M.noop;try{t(o.scope,n,o,e)}catch(e){return u.reject(e)}return u(function(e,t){try{u.when(o.onShow(o.scope,n,o)).then(function(){r(o.scope,n,o),function(){var e,t=M.noop;d.hideDelay&&(e=p(l.hide,d.hideDelay),t=function(){p.cancel(e)});d.cancelAutoHide=function(){t(),d.cancelAutoHide=C}}(),e(n)},t)}catch(e){t(e.message)}})}(m,d,e.controller).then(t,o)}).catch(o)})},remove:function(e,t,n){if(!m)return u.when(!1);return(d=M.extend(d||{},n||{})).cancelAutoHide&&d.cancelAutoHide(),d.element.triggerHandler("$mdInterimElementRemove"),!0===d.$destroy?c(d.element,d).then(function(){t&&r(e)||o(e)}):(u.when(i).finally(function(){c(d.element,d).then(function(){t?r(e):o(e)},r)}),a.deferred.promise);function o(e){a.deferred.resolve(e)}function r(e){a.deferred.reject(e)}}};function c(o,r){var d=r.onRemoving||M.noop;return u(function(e,t){try{var n=u.when(r.onRemove(r.scope,o,r)||!0);d(o,n),r.$destroy?(e(o),!r.preserveScope&&r.scope&&n.then(function(){r.scope.$destroy()})):n.then(function(){!r.preserveScope&&r.scope&&r.scope.$destroy(),e(o)},t)}catch(e){t(e.message)}})}}}}}),J.$inject=["$timeout","$mdUtil","$rootScope"],M.module("material.core.interaction",[]).service("$mdInteraction",J),J.prototype.deregister=function(){this.bodyElement.off("keydown mousedown",this.inputHandler),"ontouchstart"in document.documentElement&&this.bodyElement.off("touchstart",this.bufferedInputHandler),this.pointerEvent&&this.bodyElement.off(this.pointerEvent,this.inputHandler)},J.prototype.initializeEvents=function(){this.bodyElement.on("keydown mousedown",this.inputHandler),"ontouchstart"in document.documentElement&&this.bodyElement.on("touchstart",this.bufferedInputHandler),this.pointerEvent&&this.bodyElement.on(this.pointerEvent,this.inputHandler)},J.prototype.onInputEvent=function(e){if(!this.isBuffering){var t=this.inputEventMap[e.type];"pointer"===t&&(t=this.iePointerMap[e.pointerType]||e.pointerType),this.lastInteractionType=t,this.lastInteractionTime=this.$mdUtil.now()}},J.prototype.onBufferInputEvent=function(e){this.$timeout.cancel(this.bufferTimeout),this.onInputEvent(e),this.isBuffering=!0,this.bufferTimeout=this.$timeout(function(){this.isBuffering=!1}.bind(this),650,!1)},J.prototype.getLastInteractionType=function(){return this.lastInteractionType},J.prototype.isUserInvoked=function(e){var t=M.isNumber(e)?e:15;return this.lastInteractionTime>=this.$mdUtil.now()-t},$=/(-gt)?-(sm|md|lg|print)/g,x=/\s+/g,S=["grow","initial","auto","none","noshrink","nogrow"],D=["row","column"],I=["","start","center","end","stretch","space-around","space-between"],R=["","start","center","end","stretch"],O={enabled:!0,breakpoints:[]},N=M.module("material.core.layout",["ng"]),H=/^((?:x|data)[:\-_])/i,y=/([:\-_]+(.))/g,k=["layout","flex","flex-order","flex-offset","layout-align"],w=["show","hide","layout-padding","layout-margin"],M.forEach(["","xs","gt-xs","sm","gt-sm","md","gt-md","lg","gt-lg","xl","print"],function(n){M.forEach(k,function(e){var t=n?e+"-"+n:e;N.directive(ee(t),function(d){return["$mdUtil","$interpolate","$log",function(e,t,n){return E=e,h=t,b=n,{restrict:"A",compile:function(e,t){var n;return O.enabled&&(re(d,0,e,b),de(d,ie(d,t,""),ae(0,d,t)),n=o),n||M.noop}}}];function o(e,t,n){var o=function(n,o){var r;return function(e){var t=de(o,e||"");M.isDefined(t)&&(r&&n.removeClass(r),r=t?o+"-"+t.trim().replace(x,"-"):o,n.addClass(r))}}(t,d),r=n.$observe(n.$normalize(d),o);o(ie(d,n,"")),e.$on("$destroy",function(){r()})}}(t))}),M.forEach(w,function(e){var t=n?e+"-"+n:e;N.directive(ee(t),oe(t))})}),N.provider("$$mdLayout",function(){return{$get:M.noop,validateAttributeValue:de,validateAttributeUsage:re,disableLayouts:function(e){O.enabled=!0!==e}}}).directive("mdLayoutCss",ne).directive("ngCloak",(_="ng-cloak",["$timeout",function(n){return{restrict:"A",priority:-10,compile:function(e){return O.enabled?(e.addClass(_),function(e,t){n(function(){t.removeClass(_)},10,!1)}):M.noop}}}])).directive("layoutWrap",oe("layout-wrap")).directive("layoutNowrap",oe("layout-nowrap")).directive("layoutNoWrap",oe("layout-no-wrap")).directive("layoutFill",oe("layout-fill")).config(te),le.$inject=["$timeout"],M.module("material.core").service("$mdLiveAnnouncer",le),le.prototype.announce=function(e,t){t=t||"polite";var n=this;n._liveElement.textContent="",n._liveElement.setAttribute("aria-live",t),n._$timeout(function(){n._liveElement.textContent=e},n._announceTimeout,!1)},le.prototype._createLiveElement=function(){var e=document.createElement("div");return e.classList.add("md-visually-hidden"),e.setAttribute("role","status"),e.setAttribute("aria-atomic","true"),e.setAttribute("aria-live","polite"),document.body.appendChild(e),e},M.module("material.core.meta",[]).provider("$$mdMeta",function(){var o=M.element(document.head),r={};function d(e){if(r[e])return!0;var t=document.getElementsByName(e)[0];return!!t&&(r[e]=M.element(t),!0)}var e={setMeta:function(e,t){if(d(e),r[e])r[e].attr("content",t);else{var n=M.element('<meta name="'+e+'" content="'+t+'"/>');o.append(n),r[e]=n}return function(){r[e].attr("content",""),r[e].remove(),delete r[e]}},getMeta:function(e){if(!d(e))throw Error("$$mdMeta: could not find a meta tag with the name '"+e+"'");return r[e].attr("content")}};return M.extend({},e,{$get:function(){return e}})}),se.$inject=["$log","$q"],M.module("material.core").factory("$mdComponentRegistry",se),ue.$inject=["$mdInkRipple"],M.module("material.core").factory("$mdButtonInkRipple",ue),pe.$inject=["$mdInkRipple"],M.module("material.core").factory("$mdCheckboxInkRipple",pe),Ee.$inject=["$mdInkRipple"],M.module("material.core").factory("$mdListInkRipple",Ee),ve.$inject=["$scope","$element","rippleOptions","$window","$timeout","$mdUtil","$mdColorUtil"],Te.$inject=["$mdButtonInkRipple","$mdCheckboxInkRipple"],M.module("material.core").provider("$mdInkRipple",function(){var r=!1;return{disableInkRipple:function(){r=!0},$get:["$injector",function(o){return{attach:function(e,t,n){return r||t.controller("mdNoInk")?M.noop:o.instantiate(ve,{$scope:e,$element:t,rippleOptions:n})}}}]}}).directive("mdInkRipple",Te).directive("mdNoInk",Ne).directive("mdNoBar",Ne).directive("mdNoStretch",Ne);var he,be,fe,Me,ge,Ae;function Te(o,r){return{controller:M.noop,link:function(e,t,n){n.hasOwnProperty("mdInkRippleCheckbox")?r.attach(e,t):o.attach(e,t)}}}function ve(e,t,n,o,r,d,a){this.$window=o,this.$timeout=r,this.$mdUtil=d,this.$mdColorUtil=a,this.$scope=e,this.$element=t,this.options=n,this.mousedown=!1,this.ripples=[],this.timeout=null,this.lastRipple=null,d.valueOnUse(this,"container",this.createContainer),this.$element.addClass("md-ink-ripple"),(t.controller("mdInkRipple")||{}).createRipple=M.bind(this,this.createRipple),(t.controller("mdInkRipple")||{}).setColor=M.bind(this,this.color),this.bindEvents()}function _e(e,t){(e.mousedown||e.lastRipple)&&(e.mousedown=!1,e.$mdUtil.nextTick(M.bind(e,t),!1))}function Ne(){return{controller:M.noop}}function He(o){return{attach:function(e,t,n){return o.attach(e,t,M.extend({center:!1,dimBackground:!0,outline:!1,rippleSize:"full"},n))}}}function ye(e){return e.replace(/-[a-z]/g,function(e){return e.charAt(1).toUpperCase()})}ve.prototype.color=function(e){var t,n,o=this;return M.isDefined(e)&&(o._color=o._parseColor(e)),o._color||o._parseColor(o.inkRipple())||o._parseColor((t=o.options&&o.options.colorElement?o.options.colorElement:[],(n=t.length?t[0]:o.$element[0])?o.$window.getComputedStyle(n).color:"rgb(0,0,0)"))},ve.prototype.calculateColor=function(){return this.color()},ve.prototype._parseColor=function(e,t){t=t||1;var n=this.$mdColorUtil;if(e)return 0===e.indexOf("rgba")?e.replace(/\d?\.?\d*\s*\)\s*$/,(.1*t).toString()+")"):0===e.indexOf("rgb")?n.rgbToRgba(e):0===e.indexOf("#")?n.hexToRgba(e):void 0},ve.prototype.bindEvents=function(){this.$element.on("mousedown",M.bind(this,this.handleMousedown)),this.$element.on("mouseup touchend",M.bind(this,this.handleMouseup)),this.$element.on("mouseleave",M.bind(this,this.handleMouseup)),this.$element.on("touchmove",M.bind(this,this.handleTouchmove))},ve.prototype.handleMousedown=function(e){if(!this.mousedown)if(e.hasOwnProperty("originalEvent")&&(e=e.originalEvent),this.mousedown=!0,this.options.center)this.createRipple(this.container.prop("clientWidth")/2,this.container.prop("clientWidth")/2);else if(e.srcElement!==this.$element[0]){var t=this.$element[0].getBoundingClientRect(),n=e.clientX-t.left,o=e.clientY-t.top;this.createRipple(n,o)}else this.createRipple(e.offsetX,e.offsetY)},ve.prototype.handleMouseup=function(){this.$timeout(function(){_e(this,this.clearRipples)}.bind(this))},ve.prototype.handleTouchmove=function(){_e(this,this.deleteRipples)},ve.prototype