angular.module("c8y.ui").provider("c8yBreadcrumbs",function(){var n,c={};function u(r){return _.find(c,function(e){return e.regexp.test(r)})}function t(e,r){n=_.isObjectLike(r)?r:{id:r},e.$emit("preferredBreadcrumbChanged")}function d(){return n}return{addBreadcrumbs:function(e,r){var n,u,t;n=e,u=_.get(window,"C8Y_APP.C8Y_INSTANCE_OPTIONS.breadcrumbs"),t=_.some(["/device/:deviceId","/group/:groupId"],function(e){return n.includes(e)}),!u&&t||(c[e]=r,c[e].regexp=new RegExp(e.replace(/:[^/]+/g,"(.+)").replace(/\//g,"\\/")))},$get:["$rootScope",function(e){var e=e.$new(!0),r=[];return e.get=u,e.setPreferredBreadcrumb=_.partial(t,e),e.getPreferredBreadcrumb=d,e.addLiveBreadcrumbsController=function(e){r.push(e)},e.removeLiveBreadcrumbsController=function(e){_.pull(r,e)},e.getLiveBreadcrumbs=function(){return _.invokeMap(r,"getBreadcrumbs")},e}]}});