/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.1.0-master-2b98560
*/
function VirtualRepeatContainerDirective(){return{controller:VirtualRepeatContainerController,template:virtualRepeatContainerTemplate,compile:function(t,e){t.addClass("md-virtual-repeat-container").addClass(e.hasOwnProperty("mdOrientHorizontal")?"md-orient-horizontal":"md-orient-vertical")}}}function virtualRepeatContainerTemplate(t){return'
"}function VirtualRepeatContainerController(t,e,i,r,s,n,o,a){this.$rootScope=r,this.$scope=n,this.$element=o,this.$attrs=a,this.size=0,this.scrollSize=0,this.scrollOffset=0,this.horizontal=this.$attrs.hasOwnProperty("mdOrientHorizontal"),this.repeater=null,this.autoShrink=this.$attrs.hasOwnProperty("mdAutoShrink"),this.autoShrinkMin=parseInt(this.$attrs.mdAutoShrinkMin,10)||0,this.originalSize=null,this.offsetSize=parseInt(this.$attrs.mdOffsetSize,10)||0,this.oldElementSize=null,this.$attrs.mdTopIndex?(this.bindTopIndex=i(this.$attrs.mdTopIndex),this.topIndex=this.bindTopIndex(this.$scope),angular.isDefined(this.topIndex)||(this.topIndex=0,this.bindTopIndex.assign(this.$scope,0)),this.$scope.$watch(this.bindTopIndex,angular.bind(this,function(t){t!==this.topIndex&&this.scrollToIndex(t)}))):this.topIndex=0,this.scroller=o[0].querySelector(".md-virtual-repeat-scroller"),this.sizer=this.scroller.querySelector(".md-virtual-repeat-sizer"),this.offsetter=this.scroller.querySelector(".md-virtual-repeat-offsetter");var l=angular.bind(this,this.updateSize);t(angular.bind(this,function(){l();var t=e.debounce(l,10,null,!1),i=angular.element(s);this.size||t(),i.on("resize",t),n.$on("$destroy",function(){i.off("resize",t)}),n.$emit("$md-resize-enable"),n.$on("$md-resize",l)}))}function VirtualRepeatDirective(t){return{controller:VirtualRepeatController,priority:1e3,require:["mdVirtualRepeat","^^mdVirtualRepeatContainer"],restrict:"A",terminal:!0,transclude:"element",compile:function(e,i){var r=i.mdVirtualRepeat,s=r.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)\s*$/),n=s[1],o=t(s[2]),a=i.mdExtraName&&t(i.mdExtraName);return function(t,e,i,r,s){r[0].link_(r[1],s,n,o,a)}}}}function VirtualRepeatController(t,e,i,r,s,n,o,a){this.$scope=t,this.$element=e,this.$attrs=i,this.$browser=r,this.$document=s,this.$rootScope=n,this.$$rAF=o,this.onDemand=a.parseAttributeBoolean(i.mdOnDemand),this.browserCheckUrlChange=r.$$checkUrlChange,this.newStartIndex=0,this.newEndIndex=0,this.newVisibleEnd=0,this.startIndex=0,this.endIndex=0,this.itemSize=t.$eval(i.mdItemSize)||null,this.isFirstRender=!0,this.isVirtualRepeatUpdating_=!1,this.itemsLength=0,this.unwatchItemSize_=angular.noop,this.blocks={},this.pooledBlocks=[],t.$on("$destroy",angular.bind(this,this.cleanupBlocks_))}function VirtualRepeatModelArrayLike(t){if(!angular.isFunction(t.getItemAtIndex)||!angular.isFunction(t.getLength))throw Error("When md-on-demand is enabled, the Object passed to md-virtual-repeat must implement functions getItemAtIndex() and getLength() ");this.model=t}function abstractMethod(){throw Error("Non-overridden abstract method called.")}goog.provide("ngmaterial.components.virtualRepeat"),goog.require("ngmaterial.components.showHide"),goog.require("ngmaterial.core"),VirtualRepeatContainerController.$inject=["$$rAF","$mdUtil","$parse","$rootScope","$window","$scope","$element","$attrs"],VirtualRepeatController.$inject=["$scope","$element","$attrs","$browser","$document","$rootScope","$$rAF","$mdUtil"],VirtualRepeatDirective.$inject=["$parse"],angular.module("material.components.virtualRepeat",["material.core","material.components.showHide"]).directive("mdVirtualRepeatContainer",VirtualRepeatContainerDirective).directive("mdVirtualRepeat",VirtualRepeatDirective);var MAX_ELEMENT_SIZE=1533917,NUM_EXTRA=3;VirtualRepeatContainerController.prototype.register=function(t){this.repeater=t,angular.element(this.scroller).on("scroll wheel touchmove touchend",angular.bind(this,this.handleScroll_))},VirtualRepeatContainerController.prototype.isHorizontal=function(){return this.horizontal},VirtualRepeatContainerController.prototype.getSize=function(){return this.size},VirtualRepeatContainerController.prototype.setSize_=function(t){var e=this.getDimensionName_();this.size=t,this.$element[0].style[e]=t+"px"},VirtualRepeatContainerController.prototype.unsetSize_=function(){this.$element[0].style[this.getDimensionName_()]=this.oldElementSize,this.oldElementSize=null},VirtualRepeatContainerController.prototype.updateSize=function(){this.originalSize||(this.size=this.isHorizontal()?this.$element[0].clientWidth:this.$element[0].clientHeight,this.handleScroll_(),this.repeater&&this.repeater.containerUpdated())},VirtualRepeatContainerController.prototype.getScrollSize=function(){return this.scrollSize},VirtualRepeatContainerController.prototype.getDimensionName_=function(){return this.isHorizontal()?"width":"height"},VirtualRepeatContainerController.prototype.sizeScroller_=function(t){var e=this.getDimensionName_(),i=this.isHorizontal()?"height":"width";if(this.sizer.innerHTML="",ti&&(t=i-1),this.scrollTo(e*t)},VirtualRepeatContainerController.prototype.resetScroll=function(){this.scrollTo(0)},VirtualRepeatContainerController.prototype.handleScroll_=function(){var t=angular.element(document)[0],e="rtl"!=t.dir&&"rtl"!=t.body.dir;e||this.maxSize||(this.scroller.scrollLeft=this.scrollSize,this.maxSize=this.scroller.scrollLeft);var i=this.isHorizontal()?e?this.scroller.scrollLeft:this.maxSize-this.scroller.scrollLeft:this.scroller.scrollTop;if(!(i===this.scrollOffset||i>this.scrollSize-this.size)){var r=this.repeater.getItemSize();if(r){var s=Math.max(0,Math.floor(i/r)-NUM_EXTRA),n=(this.isHorizontal()?"translateX(":"translateY(")+(!this.isHorizontal()||e?s*r:-(s*r))+"px)";if(this.scrollOffset=i,this.offsetter.style.webkitTransform=n,this.offsetter.style.transform=n,this.bindTopIndex){var o=Math.floor(i/r);o!==this.topIndex&&othis.container.getScrollSize())&&(this.items instanceof VirtualRepeatModelArrayLike&&this.items.$$includeIndexes(this.newStartIndex,this.newEndIndex),this.virtualRepeatUpdate_(this.items,this.items)))):(this.unwatchItemSize_&&this.unwatchItemSize_!==angular.noop&&this.unwatchItemSize_(),this.unwatchItemSize_=this.$scope.$watchCollection(this.repeatListExpression,angular.bind(this,function(t){t&&t.length&&this.readItemSize_()})),void(this.$rootScope.$$phase||this.$scope.$digest()))},VirtualRepeatController.prototype.getItemSize=function(){return this.itemSize},VirtualRepeatController.prototype.getItemCount=function(){return this.itemsLength},VirtualRepeatController.prototype.virtualRepeatUpdate_=function(t,e){this.isVirtualRepeatUpdating_=!0;var i=t&&t.length||0,r=!1;if(this.items&&i=this.newEndIndex)&&this.poolBlock_(e)},this),this.$browser.$$checkUrlChange=angular.noop;var o,a,l=[],h=[];for(o=this.newStartIndex;o