/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.1.2-master-a9ba340
*/
function MenuBarController(e,n,t,o,r,i,a,l){this.$element=t,this.$attrs=o,this.$mdConstant=r,this.$mdUtil=a,this.$document=i,this.$scope=e,this.$rootScope=n,this.$timeout=l;var u=this;angular.forEach(BOUND_MENU_METHODS,function(e){u[e]=angular.bind(u,u[e])})}function MenuBarDirective(e,n){return{restrict:"E",require:"mdMenuBar",controller:"MenuBarController",compile:function(t,o){return o.ariaRole||t[0].setAttribute("role","menubar"),angular.forEach(t[0].children,function(n){if("MD-MENU"==n.nodeName){n.hasAttribute("md-position-mode")||(n.setAttribute("md-position-mode","left bottom"),n.querySelector("button, a, md-button").setAttribute("role","menuitem"));var t=e.nodesToArray(n.querySelectorAll("md-menu-content"));angular.forEach(t,function(e){e.classList.add("md-menu-bar-menu"),e.classList.add("md-dense"),e.hasAttribute("width")||e.setAttribute("width",5)})}}),t.find("md-menu-item").addClass("md-in-menu-bar"),function(e,t,o,r){t.addClass("_md"),n(e,t),r.init()}}}}function MenuDividerDirective(){return{restrict:"E",compile:function(e,n){n.role||e[0].setAttribute("role","separator")}}}function MenuItemController(e,n,t){this.$element=n,this.$attrs=t,this.$scope=e}function MenuItemDirective(e,n,t){return{controller:"MenuItemController",require:["mdMenuItem","?ngModel"],priority:n.BEFORE_NG_ARIA,compile:function(n,o){function r(e,t,o){o=o||n,o instanceof angular.element&&(o=o[0]),o.hasAttribute(e)||o.setAttribute(e,t)}function i(t){var o=e.prefixer(t);angular.forEach(o,function(e){if(n[0].hasAttribute(e)){var t=n[0].getAttribute(e);s[0].setAttribute(e,t),n[0].removeAttribute(e)}})}var a=o.type,l="md-in-menu-bar";if("checkbox"!=a&&"radio"!=a||!n.hasClass(l))r("role","menuitem",n[0].querySelector("md-button, button, a"));else{var u=n[0].textContent,s=angular.element(''),c='';s.html(u),s.attr("tabindex","0"),n.html(""),n.append(angular.element(c)),n.append(s),n.addClass("md-indent").removeClass(l),r("role","checkbox"==a?"menuitemcheckbox":"menuitemradio",s),i("ng-disabled")}return function(e,n,t,o){var r=o[0],i=o[1];r.init(i)}}}}goog.provide("ngmaterial.components.menuBar"),goog.require("ngmaterial.components.icon"),goog.require("ngmaterial.components.menu"),goog.require("ngmaterial.core"),angular.module("material.components.menuBar",["material.core","material.components.icon","material.components.menu"]),MenuBarController.$inject=["$scope","$rootScope","$element","$attrs","$mdConstant","$document","$mdUtil","$timeout"],angular.module("material.components.menuBar").controller("MenuBarController",MenuBarController);var BOUND_MENU_METHODS=["handleKeyDown","handleMenuHover","scheduleOpenHoveredMenu","cancelScheduledOpen"];MenuBarController.prototype.init=function(){var e=this.$element,n=this.$mdUtil,t=this.$scope,o=this,r=[];e.on("keydown",this.handleKeyDown),this.parentToolbar=n.getClosest(e,"MD-TOOLBAR"),r.push(this.$rootScope.$on("$mdMenuOpen",function(n,t){o.getMenus().indexOf(t[0])!=-1&&(e[0].classList.add("md-open"),t[0].classList.add("md-open"),o.currentlyOpenMenu=t.controller("mdMenu"),o.currentlyOpenMenu.registerContainerProxy(o.handleKeyDown),o.enableOpenOnHover())})),r.push(this.$rootScope.$on("$mdMenuClose",function(t,r,i){var a=o.getMenus();if(a.indexOf(r[0])!=-1&&(e[0].classList.remove("md-open"),r[0].classList.remove("md-open")),e[0].contains(r[0])){for(var l=r[0];l&&a.indexOf(l)==-1;)l=n.getClosest(l,"MD-MENU",!0);l&&(i.skipFocus||l.querySelector("button:not([disabled])").focus(),o.currentlyOpenMenu=void 0,o.disableOpenOnHover(),o.setKeyboardMode(!0))}})),t.$on("$destroy",function(){for(o.disableOpenOnHover();r.length;)r.shift()()}),this.setKeyboardMode(!0)},MenuBarController.prototype.setKeyboardMode=function(e){e?this.$element[0].classList.add("md-keyboard-mode"):this.$element[0].classList.remove("md-keyboard-mode")},MenuBarController.prototype.enableOpenOnHover=function(){if(!this.openOnHoverEnabled){var e=this;e.openOnHoverEnabled=!0,e.parentToolbar&&(e.parentToolbar.classList.add("md-has-open-menu"),e.$mdUtil.nextTick(function(){angular.element(e.parentToolbar).on("click",e.handleParentClick)},!1)),angular.element(e.getMenus()).on("mouseenter",e.handleMenuHover)}},MenuBarController.prototype.handleMenuHover=function(e){this.setKeyboardMode(!1),this.openOnHoverEnabled&&this.scheduleOpenHoveredMenu(e)},MenuBarController.prototype.disableOpenOnHover=function(){this.openOnHoverEnabled&&(this.openOnHoverEnabled=!1,this.parentToolbar&&(this.parentToolbar.classList.remove("md-has-open-menu"),angular.element(this.parentToolbar).off("click",this.handleParentClick)),angular.element(this.getMenus()).off("mouseenter",this.handleMenuHover))},MenuBarController.prototype.scheduleOpenHoveredMenu=function(e){var n=angular.element(e.currentTarget),t=n.controller("mdMenu");this.setKeyboardMode(!1),this.scheduleOpenMenu(t)},MenuBarController.prototype.scheduleOpenMenu=function(e){var n=this,t=this.$timeout;e!=n.currentlyOpenMenu&&(t.cancel(n.pendingMenuOpen),n.pendingMenuOpen=t(function(){n.pendingMenuOpen=void 0,n.currentlyOpenMenu&&n.currentlyOpenMenu.close(!0,{closeAll:!0}),e.open()},200,!1))},MenuBarController.prototype.handleKeyDown=function(e){var n=this.$mdConstant.KEY_CODE,t=this.currentlyOpenMenu,o=t&&t.isOpen;this.setKeyboardMode(!0);var r,i,a;switch(e.keyCode){case n.DOWN_ARROW:t?t.focusMenuContainer():this.openFocusedMenu(),r=!0;break;case n.UP_ARROW:t&&t.close(),r=!0;break;case n.LEFT_ARROW:i=this.focusMenu(-1),o&&(a=angular.element(i).controller("mdMenu"),this.scheduleOpenMenu(a)),r=!0;break;case n.RIGHT_ARROW:i=this.focusMenu(1),o&&(a=angular.element(i).controller("mdMenu"),this.scheduleOpenMenu(a)),r=!0}r&&(e&&e.preventDefault&&e.preventDefault(),e&&e.stopImmediatePropagation&&e.stopImmediatePropagation())},MenuBarController.prototype.focusMenu=function(e){var n=this.getMenus(),t=this.getFocusedMenuIndex();t==-1&&(t=this.getOpenMenuIndex());var o=!1;if(t==-1?(t=0,o=!0):(e<0&&t>0||e>0&&t