/*!
* AngularJS Material Design
* https://github.com/angular/material
* @license MIT
* v1.1.18-master-97a1616
*/
!function(t,l){"use strict";p.$inject=["presets","$rootElement","$rootScope","$injector","$window"],l.module("material.components.panel",["material.core","material.components.backdrop"]).provider("$mdPanel",function(){return{definePreset:e,getAllPresets:o,clearPresets:r,$get:["$rootElement","$rootScope","$injector","$window",function(t,e,n,o){return new p(i,t,e,n,o)}]}});var s=80,a="_md-panel-hidden",n=l.element('
e.maxOpen}return!1},p.prototype._closeFirstOpenedPanel=function(t){this._groups[t].openPanels[0].close()},p.prototype._wrapTemplate=function(t){return'"},p.prototype._wrapContentElement=function(t){var e=l.element('');return t.addClass("md-panel _md-panel-offscreen"),e.append(t),e},h.interceptorTypes={CLOSE:"onClose"},h.prototype.open=function(){var i=this;return this._$q(function(t,e){var n=i._done(t,i),o=i._simpleBind(i.show,i);i.attach().then(o).then(function(){i.config.groupName&&l.forEach(i.config.groupName,function(t){i._$mdPanel._openCountExceedsMaxOpen(t)&&i._$mdPanel._closeFirstOpenedPanel(t)})}).then(n).catch(e)})},h.prototype.close=function(s){var a=this;return this._$q(function(o,i){a._callInterceptors(h.interceptorTypes.CLOSE).then(function(){var t=a._done(o,a),e=a._simpleBind(a.detach,a),n=a.config.onCloseSuccess||l.noop;n=l.bind(a,n,a,s),a.hide().then(e).then(t).then(n).catch(i)},i)})},h.prototype.attach=function(){if(this.isAttached&&this.panelEl)return this._$q.when(this);var i=this;return this._$q(function(t,e){var n=i._done(t,i),o=i.config.onDomAdded||l.noop;i._$q.all([i._createBackdrop(),i._createPanel().then(function(t){return i.isAttached=!0,i._addEventListeners(),t}).catch(e)]).then(o).then(n).catch(e)})},h.prototype.detach=function(){if(!this.isAttached)return this._$q.when(this);var o=this,i=o.config.onDomRemoved||l.noop;return this._restoreScroll&&(this._restoreScroll(),this._restoreScroll=null),this._$q(function(t,e){var n=o._done(t,o);o._$q.all([(o._removeEventListeners(),o._topFocusTrap&&o._topFocusTrap.parentNode&&o._topFocusTrap.parentNode.removeChild(o._topFocusTrap),o._bottomFocusTrap&&o._bottomFocusTrap.parentNode&&o._bottomFocusTrap.parentNode.removeChild(o._bottomFocusTrap),o._restoreCache.classes&&(o.panelEl[0].className=o._restoreCache.classes),o.panelEl[0].style.cssText=o._restoreCache.styles||"",o._compilerCleanup(),o.panelContainer.remove(),o.isAttached=!1,o._$q.when(o)),!o._backdropRef||o._backdropRef.detach()]).then(i).then(n).catch(e)})},h.prototype.destroy=function(){var e=this;this.config.groupName&&l.forEach(this.config.groupName,function(t){e.removeFromGroup(t)}),this.config.scope.$destroy(),this.config.locals=null,this.config.onDomAdded=null,this.config.onDomRemoved=null,this.config.onRemoving=null,this.config.onOpenComplete=null,this._interceptors=null},h.prototype.show=function(){if(!this.panelContainer)return this._$q(function(t,e){e("mdPanel: Panel does not exist yet. Call open() or attach().")});if(!this.panelContainer.hasClass(a))return this._$q.when(this);var i=this;return this._$q(function(t,e){var n=i._done(t,i),o=i.config.onOpenComplete||l.noop;i._$q.all([i._backdropRef?i._backdropRef.show():i,(i.panelContainer.removeClass(a),i._animateOpen()).then(function(){i._focusOnOpen()},e)]).then(o).then(function(){i.config.groupName&&l.forEach(i.config.groupName,function(t){i._$mdPanel._groups[t].openPanels.push(i)})}).then(n).catch(e)})},h.prototype.hide=function(){if(!this.panelContainer)return this._$q(function(t,e){e("mdPanel: Panel does not exist yet. Call open() or attach().")});if(this.panelContainer.hasClass(a))return this._$q.when(this);var i=this;return this._$q(function(t,e){var n=i._done(t,i),o=i.config.onRemoving||l.noop;i._$q.all([i._backdropRef?i._backdropRef.hide():i,i._animateClose().then(o).then(function(){i.panelContainer.addClass(a)}).then(function(){var e;i.config.groupName&&l.forEach(i.config.groupName,function(t){t=i._$mdPanel._groups[t],-1<(e=t.openPanels.indexOf(i))&&t.openPanels.splice(e,1)})}).then(function(){var t=i.config.origin;t&&u(t).focus()}).catch(e)]).then(n,e)})},h.prototype.addClass=function(t,e){if(this._$log.warn("mdPanel: The addClass method is in the process of being deprecated. Full deprecation is scheduled for the AngularJS Material 1.2 release. To achieve the same results, use the panelContainer or panelEl JQLite elements that are referenced in MdPanelRef."),!this.panelContainer)throw new Error("mdPanel: Panel does not exist yet. Call open() or attach().");e||this.panelContainer.hasClass(t)?e&&!this.panelEl.hasClass(t)&&this.panelEl.addClass(t):this.panelContainer.addClass(t)},h.prototype.removeClass=function(t,e){if(this._$log.warn("mdPanel: The removeClass method is in the process of being deprecated. Full deprecation is scheduled for the AngularJS Material 1.2 release. To achieve the same results, use the panelContainer or panelEl JQLite elements that are referenced in MdPanelRef."),!this.panelContainer)throw new Error("mdPanel: Panel does not exist yet. Call open() or attach().");!e&&this.panelContainer.hasClass(t)?this.panelContainer.removeClass(t):e&&this.panelEl.hasClass(t)&&this.panelEl.removeClass(t)},h.prototype.toggleClass=function(t,e){if(this._$log.warn("mdPanel: The toggleClass method is in the process of being deprecated. Full deprecation is scheduled for the AngularJS Material 1.2 release. To achieve the same results, use the panelContainer or panelEl JQLite elements that are referenced in MdPanelRef."),!this.panelContainer)throw new Error("mdPanel: Panel does not exist yet. Call open() or attach().");e?this.panelEl.toggleClass(t):this.panelContainer.toggleClass(t)},h.prototype._compile=function(){var o=this;return o._$mdCompiler.compile(o.config).then(function(t){var e=o.config;if(e.contentElement){var n=t.element;o._restoreCache.styles=n[0].style.cssText,o._restoreCache.classes=n[0].className,o.panelContainer=o._$mdPanel._wrapContentElement(n),o.panelEl=n}else o.panelContainer=t.link(e.scope),o.panelEl=l.element(o.panelContainer[0].querySelector(".md-panel"));return o._compilerCleanup=t.cleanup,u(o.config.attachTo).append(o.panelContainer),o})},h.prototype._createPanel=function(){var n=this;return this._$q(function(t,e){n.config.locals||(n.config.locals={}),(n.config.locals.mdPanelRef=n)._compile().then(function(){n.config.disableParentScroll&&(n._restoreScroll=n._$mdUtil.disableScrollAround(null,n.panelContainer,{disableScrollMask:!0})),n.config.panelClass&&n.panelEl.addClass(n.config.panelClass),n.config.propagateContainerEvents&&(n.panelContainer.css("pointer-events","none"),n.panelEl.css("pointer-events","all")),n._$animate.pin&&n._$animate.pin(n.panelContainer,u(n.config.attachTo)),n._configureTrapFocus(),n._addStyles().then(function(){t(n)},e)},e)})},h.prototype._addStyles=function(){var n=this;return this._$q(function(t){n.panelContainer.css("z-index",n.config.zIndex),n.panelEl.css("z-index",n.config.zIndex+1);function e(){n._setTheming(),n.panelEl.removeClass("_md-panel-offscreen"),n.panelContainer.addClass(a),t(n)}if(n.config.fullscreen)return n.panelEl.addClass("_md-panel-fullscreen"),void e();n.config.position?n._$rootScope.$$postDigest(function(){n._updatePosition(!0),n._setTheming(),t(n)}):e()})},h.prototype._setTheming=function(){this._$mdTheming(this.panelEl),this._$mdTheming(this.panelContainer)},h.prototype.updatePosition=function(t){if(!this.panelContainer)throw new Error("mdPanel: Panel does not exist yet. Call open() or attach().");this.config.position=t,this._updatePosition()},h.prototype._updatePosition=function(t){var e=this.config.position;e&&(e._setPanelPosition(this.panelEl),t&&(this.panelEl.removeClass("_md-panel-offscreen"),this.panelContainer.addClass(a)),this.panelEl.css(d.absPosition.TOP,e.getTop()),this.panelEl.css(d.absPosition.BOTTOM,e.getBottom()),this.panelEl.css(d.absPosition.LEFT,e.getLeft()),this.panelEl.css(d.absPosition.RIGHT,e.getRight()))},h.prototype._focusOnOpen=function(){if(this.config.focusOnOpen){var t=this;this._$rootScope.$$postDigest(function(){(t._$mdUtil.findFocusTarget(t.panelEl)||t.panelEl).focus()})}},h.prototype._createBackdrop=function(){if(this.config.hasBackdrop){if(!this._backdropRef){var t=this._$mdPanel.newPanelAnimation().openFrom(this.config.attachTo).withAnimation({open:"_md-opaque-enter",close:"_md-opaque-leave"});this.config.animation&&t.duration(this.config.animation._rawDuration);var e={animation:t,attachTo:this.config.attachTo,focusOnOpen:!1,panelClass:"_md-panel-backdrop",zIndex:this.config.zIndex-1};this._backdropRef=this._$mdPanel.create(e)}if(!this._backdropRef.isAttached)return this._backdropRef.attach()}},h.prototype._addEventListeners=function(){this._configureEscapeToClose(),this._configureClickOutsideToClose(),this._configureScrollListener()},h.prototype._removeEventListeners=function(){this._removeListeners&&this._removeListeners.forEach(function(t){t()}),this._removeListeners=[]},h.prototype._configureEscapeToClose=function(){if(this.config.escapeToClose){var t=u(this.config.attachTo),e=this,n=function(t){t.keyCode===e._$mdConstant.KEY_CODE.ESCAPE&&(t.stopPropagation(),t.preventDefault(),e.close(h.closeReasons.ESCAPE))};this.panelContainer.on("keydown",n),t.on("keydown",n),this._removeListeners.push(function(){e.panelContainer.off("keydown",n),t.off("keydown",n)})}},h.prototype._configureClickOutsideToClose=function(){if(this.config.clickOutsideToClose){var e,n=this.config.propagateContainerEvents?l.element(document.body):this.panelContainer,t=function(t){e=t.target},o=this,i=function(t){o.config.propagateContainerEvents?e===o.panelEl[0]||o.panelEl[0].contains(e)||o.close():e===n[0]&&t.target===n[0]&&(t.stopPropagation(),t.preventDefault(),o.close(h.closeReasons.CLICK_OUTSIDE))};n.on("mousedown",t),n.on("mouseup",i),this._removeListeners.push(function(){n.off("mousedown",t),n.off("mouseup",i)})}},h.prototype._configureScrollListener=function(){if(!this.config.disableParentScroll){var t=l.bind(this,this._updatePosition),e=this._$$rAF.throttle(t),n=this,o=function(){e()};this._$window.addEventListener("scroll",o,!0),this._removeListeners.push(function(){n._$window.removeEventListener("scroll",o,!0)})}},h.prototype._configureTrapFocus=function(){if(this.panelEl.attr("tabIndex","-1"),this.config.trapFocus){var t=this.panelEl;this._topFocusTrap=n.clone()[0],this._bottomFocusTrap=n.clone()[0];var e=function(){t.focus()};this._topFocusTrap.addEventListener("focus",e),this._bottomFocusTrap.addEventListener("focus",e),this._removeListeners.push(this._simpleBind(function(){this._topFocusTrap.removeEventListener("focus",e),this._bottomFocusTrap.removeEventListener("focus",e)},this)),t[0].parentNode.insertBefore(this._topFocusTrap,t[0]),t.after(this._bottomFocusTrap)}},h.prototype.updateAnimation=function(t){this.config.animation=t,this._backdropRef&&this._backdropRef.config.animation.duration(t._rawDuration)},h.prototype._animateOpen=function(){this.panelContainer.addClass("md-panel-is-showing");var n=this.config.animation;if(!n)return this.panelContainer.addClass("_md-panel-shown"),this._$q.when(this);var o=this;return this._$q(function(t){var e=o._done(t,o);n.animateOpen(o.panelEl).then(e,function(){o._$log.warn("mdPanel: MdPanel Animations failed. Showing panel without animating."),e()})})},h.prototype._animateClose=function(){var n=this.config.animation;if(!n)return this.panelContainer.removeClass("md-panel-is-showing"),this.panelContainer.removeClass("_md-panel-shown"),this._$q.when(this);var o=this;return this._$q(function(t){function e(){o.panelContainer.removeClass("md-panel-is-showing"),t(o)}n.animateClose(o.panelEl).then(e,function(){o._$log.warn("mdPanel: MdPanel Animations failed. Hiding panel without animating."),e()})})},h.prototype.registerInterceptor=function(t,e){var n=null;if(l.isString(t)?l.isFunction(e)||(n="Interceptor callback must be a function, instead got "+typeof e):n="Interceptor type must be a string, instead got "+typeof t,n)throw new Error("MdPanel: "+n);var o=this._interceptors[t]=this._interceptors[t]||[];return-1===o.indexOf(e)&&o.push(e),this},h.prototype.removeInterceptor=function(t,e){var n=this._interceptors[t]?this._interceptors[t].indexOf(e):-1;return-1