(()=>{function t(t,e,n,l){var i=this,s=t.localStorage,a=n.createEnum([{name:"AUTO",value:"auto",label:l("Auto"),default:!0,getListClass:function(){var t=a.GRID;return(t=12<i.listLength?a.LIST:t).getListClass()}},{name:"GRID",value:"grid",label:l("Grid"),getListClass:function(){return"interact-grid"}},{name:"LIST",value:"list",label:l("List"),getListClass:function(){return"interact-list"}}]);function o(){return"list-display-option[".concat(i.listKey||e.path(),"]")}function u(){i.selectedOption=r({value:s[o()]})||r({default:!0}),i.onListClassChange({listClass:i.selectedOption.getListClass()})}function r(t){return _.find(a.values(),t)}_.assign(i,{options:a.values(),optionOrder:function(t){return"".concat(t.default?"A":"Z").concat(t.label)},selectOption:function(t){t.default?s.removeItem(o()):s[o()]=t.value;u()},$onInit:u,$onChanges:u})}t.$inject=["$window","$location","c8yBase","gettext"],angular.module("c8y.ui").component("c8yListDisplayControl",{bindings:{listKey:"<?",listLength:"<?",onListClassChange:"&"},templateUrl:":::PLUGIN_PATH:::/ui/lists/list-display-control.html",controller:t,controllerAs:"vm"})})();