(()=>{function e(u,n){var r="c8y_GroupTypesConfig",e={type:r,pageSize:1};return{save:function(e){return e.type=r,u.save(e)},get:t,getLookup:function(e){return(e?n.when(e):t()).then(_.partial(p,{}))},getDeviceGroupType:a,getDeviceSubgroupType:function(){return{type:"c8y_DeviceSubgroup",name:"Default Subgroup",namePlural:"Default Subgroups",showInNavigator:!1,groups:[]}},getEmptyGroupType:function(){return{name:"",namePlural:"",type:"",showInNavigator:!1,groups:[]}}};function t(){return u.list(e).then(o)}function o(e){return 0<e.length?e[0]:{type:r,groups:[a()]}}function p(e,u){var n=e||{};return _.forEach(u.groups||{},function(e){n[e.type]=e,n=p(n,e)}),n}function a(){return{type:"c8y_DeviceGroup",name:"Default Group",namePlural:"Default Groups",showInNavigator:!0,groups:[]}}}e.$inject=["c8yInventory","$q"],angular.module("c8y.core").factory("c8yGroupTypesConfig",e)})();