(()=>{function e(t,c,s,i){var r=this;function o(){return c.getLicenses().then(function(e){r.licenses=_.flatMap(e,function(e,n){return{key:n,value:e}})})}_.assign(r,{$onInit:function(){o()},remove:function(e){return c.removeLicenseKey(e.key).then(function(){t.success(s("License key deleted."))}).then(o)},save:function(n){return c.updateLicenseKey(r.licenseKey).then(function(){var e;t.success(s("License key added.")),e=n,r.licenseKey="",e.$setPristine(),e.$setUntouched(),o()},function(e){t.danger(i.getResErrorMessage(e))})}})}e.$inject=["c8yAlert","c8yLicense","gettext","c8yBase"],angular.module("c8y.tenantLicenses").component("c8yLicenseManagement",{templateUrl:":::PLUGIN_PATH:::/licenseManagement.html",controller:e,controllerAs:"vm"})})();