(()=>{function n(a){return{restrict:"A",require:"ngModel",scope:{options:"=c8yHexInput",min:"=ngMin",max:"=ngMax"},link:function(e,n,r,i){function u(n){return/^(0x){0,1}[0-9A-Fa-f]+(h){0,1}$/.test(n)}function t(n){return a(n,e.options)}i.$parsers.push(function(n){return u(n)?parseInt(n.replace(/^0x/,"").replace(/h$/,""),16):null}),i.$formatters.push(t),_.assign(i.$validators,{min:function(n){return!_.isNumber(e.min)||!_.isNumber(n)||e.min<=n},max:function(n){return!_.isNumber(e.max)||!_.isNumber(n)||n<=e.max},hexnumber:function(n,e){return _.isEmpty(e)||u(e)}}),n.bind("blur",function(){i.$valid&&(i.$viewValue=t(i.$modelValue),i.$render())})}}}n.$inject=["hexFilter"],angular.module("c8y.ui").directive("c8yHexInput",n)})();