(function(){window.WorkflowService=function(b,a){this.promiseRoleManager=function(){const d={};const e=[];const c=function(f){return User.get({component:b,userStatesToExclude:["DEACTIVATED"],includeRemoved:true,roles:f}).then(function(g){g.forEach(function(h){let userRoles=d[h.id];if(!userRoles){userRoles=[];d[h.id]=userRoles}userRoles.push(f)})})};for(let roleName in a){a[roleName].name=roleName;e.push(c(roleName))}return sp.promise.whenAllResolved(e).then(function(){return new function(){this.getRolesOfComponentInstance=function(){const f=[];for(let roleName in a){f.push(extendsObject({},a[roleName]))}return f};this.getRolesOfUser=function(f){const g=[];const h=d[f]||[];h.forEach(function(i){g.push(extendsObject({},a[i]))});return g};this.getMatchingRoles=function(f,i){if(f&&i){const g=this.getRolesOfUser(f);const h=this.getRolesOfUser(i);return g.filter(function(j){return h.indexOfElement(j,"name")>=0})}};this.getNotMatchingRoles=function(f,i){if(f&&i){const g=this.getRolesOfUser(f);const h=this.getRolesOfUser(i);return g.filter(function(j){return h.indexOfElement(j,"name")<0})}}}})}}})();