(()=>{function e(i,u){var n="ROLE_RETENTION_RULE_ADMIN";function t(e){e.fragmentType=i.isFieldSupportedByRule(e,"fragmentType")?e.fragmentType:"*",e.type=i.isFieldSupportedByRule(e,"type")?e.type:"*",e.source=i.isFieldSupportedByRule(e,"source")?e.source:"*"}return{restrict:"E",link:function(e){var r;e.DATA_TYPES=_.map(i.DATA_TYPES),e.isFieldSupportedByRule=i.isFieldSupportedByRule,e.changeDataType=t,e.isDisabled=!0,r=e,u.current().then(function(e){var i=_.get(r,"rule.id"),t=_.get(r,"rule.editable");_.isUndefined(t)||_.isUndefined(i)?r.isDisabled=!1:r.isDisabled=(i=t,!(u.hasRole(e,n)&&i))})},templateUrl:":::PLUGIN_PATH:::/ui/views/editRetentionRuleDirective.html",scope:{rule:"=ngModel",hideSourceField:"&hideSource"}}}e.$inject=["c8yRetentions","c8yUser"],angular.module("c8y.ui").directive("c8yEditRetentionRule",e)})();