angular.module("c8y.ui").directive("c8yNumber",function(){function r(r,e,t){this.$scope=r,this.$attrs=t,this.ngModel=e.controller("ngModel"),this.validators={}}return r.prototype.validator=function(t,i){var o=this;o.validators[t]&&_.remove(o.ngModel.$parsers,function(r){return r===o.validators[t]}),o.validators[t]=_.bind(function(r){var e=""!==r&&_.isNumber(parseFloat(r))?Number(r):Number(NaN),e=""===r||_.isUndefined(r)?!o.required:!_.isNaN(e)&&i(e);return o.ngModel.$setValidity(t,e),e?r:void 0},o),o.ngModel.$parsers.push(o.validators[t])},{restrict:"A",require:"ngModel",controller:["$scope","$element","$attrs",r],priority:-1}});