/*! * Angular Material Design * https://github.com/angular/material * @license MIT * v1.0.5-master-f171fd2 */!function(e,t,n){"use strict";functiono(e,o,r,i,l,a){functiond(l,d){vars=t.element("<md-select-value><span></span></md-select-value>");if(s.append('<span class="_md-select-icon" aria-hidden="true"></span>'),s.addClass("_md-select-value"),s[0].hasAttribute("id")||s.attr("id","select_value_label_"+o.nextUid()),l.find("md-content").length||l.append(t.element("<md-content>").append(l.contents())),d.mdOnOpen&&(l.find("md-content").prepend(t.element('<div> <md-progress-circular md-mode="{{progressMode}}" ng-hide="$$loadingAsyncDone"></md-progress-circular></div>')),l.find("md-option").attr("ng-show","$$loadingAsyncDone")),d.name){varc=t.element('<select class="_md-visually-hidden">');c.attr({name:"."+d.name,"ng-model":d.ngModel,"aria-hidden":"true",tabindex:"-1"});varu=l.find("md-option");t.forEach(u,function(e){varn=t.element("<option>"+e.innerHTML+"</option>");e.hasAttribute("ng-value")?n.attr("ng-value",e.getAttribute("ng-value")):e.hasAttribute("value")&&n.attr("value",e.getAttribute("value")),c.append(n)}),l.parent().append(c)}varp=o.parseAttributeBoolean(d.multiple),f=p?"multiple":"",m='<div class="_md-select-menu-container" aria-hidden="true"><md-select-menu {0}>{1}</md-select-menu></div>';returnm=o.supplant(m,[f,l.html()]),l.empty().append(s),l.append(m),d.tabindex=d.tabindex||"0",function(l,d,s,c){functionu(){vare=d.attr("aria-label")||d.attr("placeholder");!e&&w&&w.label&&(e=w.label.text()),y=e,i.expect(d,"aria-label",e)}functionf(){T&&(E=E||T.find("md-select-menu").controller("mdSelectMenu"),C.setLabelText(E.selectedLabels()))}functionm(){if(y){vare=E.selectedLabels({mode:"aria"});d.attr("aria-label",e.length?y+": "+e:y)}}functionh(){w&&w.setHasValue(E.selectedLabels().length>0||(d[0].validity||{}).badInput)}functiong(){if(T=t.element(d[0].querySelector("._md-select-menu-container")),D=l,s.mdContainerClass){vare=T[0].getAttribute("class")+" "+s.mdContainerClass;T[0].setAttribute("class",e)}E=T.find("md-select-menu").controller("mdSelectMenu"),E.init(M,s.ngModel),d.on("$destroy",function(){T.remove()})}functionv(e){varn=[32,13,38,40];if(-1!=n.indexOf(e.keyCode))e.preventDefault(),b(e);elseif(e.keyCode<=90&&e.keyCode>=31){e.preventDefault();varo=E.optNodeForKeyboardSearch(e);if(!o)return;varr=t.element(o).controller("mdOption");E.isMultiple||E.deselect(Object.keys(E.selected)[0]),E.select(r.hashKey,r.value),E.refreshViewValue()}}functionb(){D.isOpen=!0,d.attr("aria-expanded","true"),e.show({scope:D,preserveScope:!0,skipCompile:!0,element:T,target:d[0],selectCtrl:C,preserveElement:!0,hasBackdrop:!0,loadingAsync:s.mdOnOpen?l.$eval(s.mdOnOpen)||!0:!1})["finally"](function(){D.isOpen=!1,d.focus(),d.attr("aria-expanded","false"),M.$setTouched()})}var$,y,k=!0,w=c[0],C=c[1],M=c[2],x=c[3],S=d.find("md-select-value"),A=t.isDefined(s.readonly);if(w){varO=w.isErrorGetter||function(){returnM.$invalid&&M.$touched};if(w.input)thrownewError("<md-input-container> can only have *one* child <input>, <textarea> or <select> element!");w.input=d,w.label||i.expect(d,"aria-label",d.attr("placeholder")),l.$watch(O,w.setInvalid)}varT,D,E;if(g(),r(d),s.name&&x){var_=d.parent()[0].querySelector('select[name=".'+s.name+'"]');o.nextTick(function(){vare=t.element(_).controller("ngModel");e&&x.$removeControl(e)})}x&&t.isDefined(s.multiple)&&o.nextTick(function(){vare=M.$modelValue||M.$viewValue;e&&x.$setPristine()});varR=M.$render;M.$render=function(){R(),f(),m(),h()},s.$observe("placeholder",M.$render),C.setLabelText=function(e){C.setIsPlaceholder(!e);vart=s.placeholder||(w&&w.label?w.label.text():"");e=e||t||"";varn=S.children().eq(0);n.html(e)},C.setIsPlaceholder=function(e){e?(S.addClass("_md-select-placeholder"),w&&w.label&&w.label.addClass("_md-placeholder")):(S.removeClass("_md-select-placeholder"),w&&w.label&&w.label.removeClass("_md-placeholder"))},A||(d.on("focus",function(e){w&&w.element.hasClass("md-input-has-value")&&w.setFocused(!0)}),o.nextTick(function(){d.on("blur",function(){k&&(k=!1,M.$setUntouched()),D.isOpen||(w&&w.setFocused(!1),h())})})),C.triggerClose=function(){a(s.mdOnClose)(l)},l.$$postDigest(function(){u(),f(),m()}),l.$watch(E.selectedLabels,f);varV;s.$observe("ngMultiple",function(e){V&&V();vart=a(e);V=l.$watch(function(){returnt(l)},function(e,t){e===n&&t===n||(e?d.attr("multiple","multiple"):d.removeAttr("multiple"),d.attr("aria-multiselectable",e?"true":"false"),T&&(E.setMultiple(e),R=M.$render,M.$render=function(){R(),f(),m(),h()},M.$render()))})}),s.$observe("disabled",function(e){t.isString(e)&&(e=!0),$!==n&&$===e||($=e,e?(d.attr({tabindex:-1,"aria-disabled":"true"}),d.off("click",b),d.off("keydown",v)):(d.attr({tabindex:s.tabindex,"aria-disabled":"false"}),d.on("click",b),d.on("keydown",v)))}),s.disabled||s.ngDisabled||(d.attr({tabindex:s.tabindex,"aria-disabled":"false"}),d.on("click",b),d.on("keydown",v));varB={role:"listbox","aria-expanded":"false","aria-multiselectable":p&&!s.ngMultiple?"true":"false"};d[0].hasAttribute("id")||(B.id="select_"+o.nextUid());varL="select_container_"+o.nextUid();T.attr("id",L),B["aria-owns"]=L,d.attr(B),l.$on("$destroy",function(){e.destroy()["finally"](function(){w&&(w.setFocused(!1),w.setHasValue(!1),w.input=null),M.$setTouched()})})}}return{restrict:"E",require:["^?mdInputContainer","mdSelect","ngModel","?^form"],compile:d,controller:function(){}}}functionr(e,o,r){functioni(e,n,i,l){functiona(e){13!=e.keyCode&&32!=e.keyCode||d(e)}functiond(n){varr=o.getClosest(n.target,"md-option"),i=r&&t.element(r).data("$mdOptionController");if(r&&i){if(r.hasAttribute("disabled"))returnn.stopImmediatePropagation(),!1;varl=s.hashGetter(i.value),a=t.isDefined(s.selected[l]);e.$apply(function(){s.isMultiple?a?s.deselect(l):s.select(l,i.value):a||(s.deselect(Object.keys(s.selected)[0]),s.select(l,i.value)),s.refreshViewValue()})}}vars=l[0];r(n),n.on("click",d),n.on("keypress",a)}functionl(r,i,l){functiona(){vare=c.ngModel.$modelValue||c.ngModel.$viewValue||[];if(t.isArray(e)){varn=Object.keys(c.selected),o=e.map(c.hashGetter),r=n.filter(function(e){return-1===o.indexOf(e)});r.forEach(c.deselect),o.forEach(function(t,n){c.select(t,e[n])})}}functiond(){vare=c.ngModel.$viewValue||c.ngModel.$modelValue;Object.keys(c.selected).forEach(c.deselect),c.select(c.hashGetter(e),e)}varc=this;c.isMultiple=t.isDefined(i.multiple),c.selected={},c.options={},r.$watchCollection(function(){returnc.options},function(){c.ngModel.$render()});varu,p;c.setMultiple=function(e){functionn(e,n){returnt.isArray(e||n||[])}varo=c.ngModel;p=p||o.$isEmpty,c.isMultiple=e,u&&u(),c.isMultiple?(o.$validators["md-multiple"]=n,o.$render=a,r.$watchCollection(c.modelBinding,function(e){n(e)&&a(e),c.ngModel.$setPristine()}),o.$isEmpty=function(e){return!e||0===e.length}):(deleteo.$validators["md-multiple"],o.$render=d)};varf,m,h,g="",v=300;c.optNodeForKeyboardSearch=function(e){f&&clearTimeout(f),f=setTimeout(function(){f=n,g="",h=n,m=n},v),g+=String.fromCharCode(e.keyCode);varo=newRegExp("^"+g,"i");m||(m=l.find("md-option"),h=newArray(m.length),t.forEach(m,function(e,t){h[t]=e.textContent.trim()}));for(varr=0;r<h.length;++r)if(o.test(h[r]))returnm[r]},c.init=function(n,o){if(c.ngModel=n,c.modelBinding=o,n.$options&&n.$options.trackBy){vari={},l=e(n.$options.trackBy);c.hashGetter=function(e,t){returni.$value=e,l(t||r,i)}}elsec.hashGetter=function(e){returnt.isObject(e)?"object_"+(e.$$mdSelectId||(e.$$mdSelectId=++s)):e};c.setMultiple(c.isMultiple)},c.selectedLabels=function(e){e=e||{};vart=e.mode||"html",n=o.nodesToArray(l[0].querySelectorAll("md-option[selected]"));if(n.length){varr;return"html"==t?r=function(e){vart=e.innerHTML,n=e.querySelector(".md-ripple-container");returnn?t.replace(n.outerHTML,""):t}:"aria"==t&&(r=function(e){returne.hasAttribute("aria-label")?e.getAttribute("aria-label"):e.textContent}),n.map(r).join(", ")}return""},c.select=function(e,t){varn=c.options[e];n&&n.setSelected(!0),c.selected[e]=t},c.deselect=function(e){vart=c.options[e];t&&t.setSelected(!1),deletec.selected[e]},c.addOption=function(e,n){if(t.isDefined(c.options[e]))thrownewError('Duplicate md-option values are not allowed in a select. Duplicate value "'+n.value+'" found.');c.options[e]=n,t.isDefined(c.selected[e])&&(c.select(e,n.value),c.refreshViewValue())},c.removeOption=function(e){deletec.options[e]},c.refreshViewValue=function(){vare,n=[];for(varoinc.selected)(e=c.options[o])?n.push(e.value):n.push(c.selected[o]);varr=c.ngModel.$options&&c.ngModel.$options.trackBy,i=c.isMultiple?n:n[0],l=c.ngModel.$modelValue;(r?t.equals(l,i):l==i)||(c.ngModel.$setViewValue(i),c.ngModel.$render())}}returnl.$inject=["$scope","$attrs","$element"],{restrict:"E",require:["mdSelectMenu"],scope:!0,controller:l,link:{pre:i}}}functioni(e,n){functiono(e,n){returne.append(t.element('<div class="_md-text">').append(e.contents())),e.attr("tabindex",n.tabindex||"0"),r}functionr(o,r,i,l){functiona(e,t,n){if(!c.hashGetter)returnvoid(n||o.$$postDigest(function(){a(e,t,!0)}));varr=c.hashGetter(t,o),i=c.hashGetter(e,o);s.hashKey=i,s.value=e,c.removeOption(r,s),c.addOption(i,s)}functiond(){vare={role:"option","aria-selected":"false"};r[0].hasAttribute("id")||(e.id="select_option_"+n.nextUid()),r.attr(e)}vars=l[0],c=l[1];t.isDefined(i.ngValue)?o.$watch(i.ngValue,a):t.isDefined(i.value)?a(i.value):o.$watch(function(){returnr.text().trim()},a),i.$observe("disabled",function(e){e?r.attr("tabindex","-1"):r.attr("tabindex","0")}),o.$$postDigest(function(){i.$observe("selected",function(e){t.isDefined(e)&&("string"==typeofe&&(e=!0),e?(c.isMultiple||c.deselect(Object.keys(c.selected)[0]),c.select(s.hashKey,s.value)):c.deselect(s.hashKey),c.refreshViewValue())})}),e.attach(o,r),d(),o.$on("$destroy",function(){c.removeOption(s.hashKey,s)})}functioni(e){this.selected=!1,this.setSelected=function(t){t&&!this.selected?e.attr({selected:"selected","aria-selected":"true"}):!t&&this.selected&&(e.removeAttr("selected"),e.attr("aria-selected","false")),this.selected=t}}returni.$inject=["$element"],{restrict:"E",require:["mdOption","^^mdSelectMenu"],controller:i,compile:o}}functionl(){functione(e,n){varo=e.find("label");o.length||(o=t.element("<label>"),e.prepend(o)),o.addClass("_md-container-ignore"),n.label&&o.text(n.label)}return{restrict:"E",compile:e}}functiona(e){functiono(e,o,s,c,u,p,f,m,h){functiong(e,t,n){functiono(){returnf(t,{addClass:"_md-leave"}).start()}functionr(){t.removeClass("_md-active"),t.attr("aria-hidden","true"),t[0].style.display="none",b(n),!n.$destroy&&n.restoreFocus&&n.target.focus()}returnn=n||{},n.cleanupInteraction(),n.cleanupResizing(),n.hideBackdrop(),n.$destroy===!0?r():o().then(r)}functionv(r,i,l){functiona(e,t,n){returnn.parent.append(t),u(function(e,n){try{f(t,{removeClass:"_md-leave",duration:0}).start().then(d).then(e)}catch(o){n(o)}})}functiond(){returnu(function(e){if(l.isRemoved)returnu.reject(!1);vart=$(r,i,l);t.container.element.css(k.toCss(t.container.styles)),t.dropDown.element.css(k.toCss(t.dropDown.styles)),p(function(){i.addClass("_md-active"),t.dropDown.element.css(k.toCss({transform:""})),v(l.focusedNode),e()})})}functiong(e,t,n){returnn.disableParentScroll&&!s.getClosest(n.target,"MD-DIALOG")?n.restoreScroll=s.disableScrollAround(n.element,n.parent):n.disableParentScroll=!1,n.hasBackdrop&&(n.backdrop=s.createBackdrop(e,"_md-select-backdrop _md-click-catcher"),m.enter(n.backdrop,h[0].body,null,{duration:0})),function(){n.backdrop&&n.backdrop.remove(),n.disableParentScroll&&n.restoreScroll(),deleten.restoreScroll}}functionv(e){e&&!e.hasAttribute("disabled")&&e.focus()}functionb(e,n){varo=i.find("md-select-menu");if(!n.target)thrownewError(s.supplant(y,[n.target]));t.extend(n,{isRemoved:!1,target:t.element(n.target),parent:t.element(n.parent),selectEl:o,contentEl:i.find("md-content"),optionNodes:o[0].getElementsByTagName("md-option")})}functionw(){vare=function(e,t,n){returnfunction(){if(!n.isRemoved){varo=$(e,t,n),r=o.container,i=o.dropDown;r.element.css(k.toCss(r.styles)),i.element.css(k.toCss(i.styles))}}}(r,i,l),n=t.element(c);returnn.on("resize",e),n.on("orientationchange",e),function(){n.off("resize",e),n.off("orientationchange",e)}}functionC(){l.loadingAsync&&!l.isRemoved&&(r.$$loadingAsyncDone=!1,r.progressMode="indeterminate",u.when(l.loadingAsync).then(function(){r.$$loadingAsyncDone=!0,r.progressMode="",deletel.loadingAsync}).then(function(){p(d)}))}functionM(){functiont(t){t.preventDefault(),t.stopPropagation(),l.restoreFocus=!1,s.nextTick(e.hide,!0)}functionr(t){varn=o.KEY_CODE;switch(t.preventDefault(),t.stopPropagation(),t.keyCode){casen.UP_ARROW:returnc();casen.DOWN_ARROW:returnd();casen.SPACE:casen.ENTER:varr=s.getClosest(t.target,"md-option");r&&(p.triggerHandler({type:"click",target:r}),t.preventDefault()),u(t);break;casen.TAB:casen.ESCAPE:t.stopPropagation(),t.preventDefault(),l.restoreFocus=!0,s.nextTick(e.hide,!0);break;default:if(t.keyCode>=31&&t.keyCode<=90){vari=p.controller("mdSelectMenu").optNodeForKeyboardSearch(t);l.focusedNode=i||l.focusedNode,i&&i.focus()}}}functiona(e){vart,o=s.nodesToArray(l.optionNodes),r=o.indexOf(l.focusedNode);do-1===r?r=0:"next"===e&&r<o.length-1?r++:"prev"===e&&r>0&&r--,t=o[r],t.hasAttribute("disabled")&&(t=n);while(!t&&r<o.length-1&&r>0);t&&t.focus(),l.focusedNode=t}functiond(){a("next")}functionc(){a("prev")}functionu(t){functionn(){vare=!1;if(t&&t.currentTarget.children.length>0){varn=t.currentTarget.children[0],o=n.scrollHeight>n.clientHeight;if(o&&n.children.length>0){varr=t.pageX-t.currentTarget.getBoundingClientRect().left;r>n.querySelector("md-option").offsetWidth&&(e=!0)}}returne}if(!(t&&"click"==t.type&&t.currentTarget!=p[0]||n())){varo=s.getClosest(t.target,"md-option");o&&o.hasAttribute&&!o.hasAttribute("disabled")&&(t.preventDefault(),t.stopPropagation(),f.isMultiple||(l.restoreFocus=!0,s.nextTick(function(){e.hide(f.ngModel.$viewValue)},!0)))}}if(!l.isRemoved){varp=l.selectEl,f=p.controller("mdSelectMenu")||{};returni.addClass("_md-clickable"),l.backdrop&&l.backdrop.on("click",t),p.on("keydown",r),p.on("click",u),function(){l.backdrop&&l.backdrop.off("click",t),p.off("keydown",r),p.off("click",u),i.removeClass("_md-clickable"),l.isRemoved=!0}}}returnC(),b(r,l),l.hideBackdrop=g(r,i,l),a(r,i,l).then(function(e){returni.attr("aria-hidden","false"),l.alreadyOpen=!0,l.cleanupInteraction=M(),l.cleanupResizing=w(),e},l.hideBackdrop)}functionb(e){vart=e.selectCtrl;if(t){varn=e.selectEl.controller("mdSelectMenu");t.setLabelText(n.selectedLabels()),t.triggerClose()}}function$(e,n,o){varu,p=n[0],f=o.target[0].children[0],m=h[0].body,g=o.selectEl[0],v=o.contentEl[0],b=m.getBoundingClientRect(),$=f.getBoundingClientRect(),y=!1,k={left:b.left+d,top:d,bottom:b.height-d,right:b.width-d-(s.floatingScrollbars()?16:0)},w={top:$.top-k.top,left:$.left-k.left,right:k.right-($.left+$.width),bottom:k.bottom-($.top+$.height)},C=b.width-2*d,M=g.querySelector("md-option[selected]"),x=g.getElementsByTagName("md-option"),S=g.getElementsByTagName("md-optgroup"),A=a(n,v),O=r(o.loadingAsync);u=O?v.firstElementChild||v:M?M:S.length?S[0]:x.length?x[0]:v.firstElementChild||v,v.offsetWidth>C?v.style["max-width"]=C+"px":v.style.maxWidth=null,y&&(v.style["min-width"]=$.width+"px"),A&&g.classList.add("_md-overflow");varT=u;"MD-OPTGROUP"===(T.tagName||"").toUpperCase()&&(T=x[0]||v.firstElementChild||v,u=T),o.focusedNode=T,p.style.display="block";varD=g.getBoundingClientRect(),E=l(u);if(u){var_=c.getComputedStyle(u);E.paddingLeft=parseInt(_.paddingLeft,10)||0,E.paddingRight=parseInt(_.paddingRight,10)||0}if(A){varR=v.offsetHeight/2;v.scrollTop=E.top+E.height/2-R,w.top<R?v.scrollTop=Math.min(E.top,v.scrollTop+R-w.top):w.bottom<R&&(v.scrollTop=Math.max(E.top+E.height-D.height,v.scrollTop-R+w.bottom))}varV,B,L,P;y?(V=$.left,B=$.top+$.height,L="50% 0",B+D.height>k.bottom&&(B=$.top-D.height,L="50% 100%")):(V=$.left+E.left-E.paddingLeft+2,B=Math.floor($.top+$.height/2-E.height/2-E.top+v.scrollTop)+2,L=E.left+$.width/2+"px "+(E.top+E.height/2-v.scrollTop)+"px 0px",P=Math.min($.width+E.paddingLeft+E.paddingRight,C));varN=p.getBoundingClientRect(),j=Math.round(100*Math.min($.width/D.width,1))/100,I=Math.round(100*Math.min($.height/D.height,1))/100;return{container:{element:t.element(p),styles:{left:Math.floor(i(k.left,V,k.right-N.width)),top:Math.floor(i(k.top,B,k.bottom-N.height)),"min-width":P}},dropDown:{element:t.element(g),styles:{transformOrigin:L,transform:o.alreadyOpen?"":s.supplant("scale({0},{1})",[j,I])}}}}vary="$mdSelect.show() expected a target element in options.target but got '{0}'!",k=s.dom.animator;return{parent:"body",themable:!0,onShow:v,onRemove:g,hasBackdrop:!0,disableParentScroll:!0}}functionr(e){returne&&t.isFunction(e.then)}functioni(e,t,n){returnMath.max(e,Math.min(t,n))}functionl(e){returne?{left:e.offsetLeft,top:e.offsetTop,width:e.offsetWidth,height:e.offsetHeight}:{left:0,top:0,width:0,height:0}}functiona(e,t){varn=!1;try{varo=e[0].style.display;e[0].style.display="block",n=t.scrollHeight>t.offsetHeight,e[0].style.display=o}finally{}returnn}returno.$inject=["$mdSelect","$mdConstant","$mdUtil","$window","$q","$$rAF","$animateCss","$animate","$document"],e("$mdSelect").setDefaults({methods:["target"],options:o})}vard=8,s=0;t.module("material.components.select",["material.core","material.components.backdrop"]).directive("mdSelect",o).directive("mdSelectMenu",r).directive("mdOption",i).directive("mdOptgroup",l).provider("$mdSelect",a),o.$inject=["$mdSelect","$mdUtil","$mdTheming","$mdAria","$compile","$parse"],r.$inject=["$parse","$mdUtil","$mdTheming"],i.$inject=["$mdButtonInkRipple","$mdUtil"],a.$inject=["$$interimElementProvider"]}(window,window.angular);