!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/forms"),require("@angular/common")):"function"==typeof define&&define.amd?define("ngx-bootstrap/rating",["exports","@angular/core","@angular/forms","@angular/common"],t):t(((e=e||self)["ngx-bootstrap"]=e["ngx-bootstrap"]||{},e["ngx-bootstrap"].rating={}),e.ng.core,e.ng.forms,e.ng.common)}(this,function(e,t,n,o){"use strict";var r={provide:n.NG_VALUE_ACCESSOR,useExisting:t.forwardRef(function(){return i}),multi:!0},i=function(){function e(e){this.changeDetection=e,this.max=5,this.onHover=new t.EventEmitter,this.onLeave=new t.EventEmitter,this.onChange=Function.prototype,this.onTouched=Function.prototype}return e.prototype.onKeydown=function(e){if(-1!==[37,38,39,40].indexOf(e.which)){e.preventDefault(),e.stopPropagation();var t=38===e.which||39===e.which?1:-1;this.rate(this.value+t)}},e.prototype.ngOnInit=function(){this.max=void 0!==this.max?this.max:5,this.titles=void 0!==this.titles&&this.titles.length>0?this.titles:[],this.range=this.buildTemplateObjects(this.max)},e.prototype.writeValue=function(e){if(e%1!==e)return this.value=Math.round(e),this.preValue=e,void this.changeDetection.markForCheck();this.preValue=e,this.value=e,this.changeDetection.markForCheck()},e.prototype.enter=function(e){this.readonly||(this.value=e,this.changeDetection.markForCheck(),this.onHover.emit(e))},e.prototype.reset=function(){this.value=this.preValue,this.changeDetection.markForCheck(),this.onLeave.emit(this.value)},e.prototype.registerOnChange=function(e){this.onChange=e},e.prototype.registerOnTouched=function(e){this.onTouched=e},e.prototype.rate=function(e){!this.readonly&&e>=0&&e<=this.range.length&&(this.writeValue(e),this.onChange(e))},e.prototype.buildTemplateObjects=function(e){for(var t=[],n=0;n\n {{ index < value ? \'★\' : \'☆\' }}\n \n ({{ index < value ? \'*\' : \' \' }})\n \n \n \n \n \n\n',providers:[r],changeDetection:t.ChangeDetectionStrategy.OnPush}]}],e.ctorParameters=function(){return[{type:t.ChangeDetectorRef}]},e.propDecorators={max:[{type:t.Input}],readonly:[{type:t.Input}],titles:[{type:t.Input}],customTemplate:[{type:t.Input}],onHover:[{type:t.Output}],onLeave:[{type:t.Output}],onKeydown:[{type:t.HostListener,args:["keydown",["$event"]]}]},e}(),a=function(){function e(){}return e.forRoot=function(){return{ngModule:e,providers:[]}},e.decorators=[{type:t.NgModule,args:[{imports:[o.CommonModule],declarations:[i],exports:[i]}]}],e}();e.RatingComponent=i,e.RatingModule=a,e.ɵa=r,Object.defineProperty(e,"__esModule",{value:!0})}); //# sourceMappingURL=ngx-bootstrap-rating.umd.min.js.map