(function(b,a,c){b.define("Navigator",{options:{content:null,event:"click"},template:{list:"<ul>",item:'<li><a<% if( href ) { %> href="<%= href %>"<% } %>><%= text %></a></li>'},_create:function(){var i=this,h=i._options,g=i.getEl(),e=g.find("ul").first(),d="ui-"+i.widgetName,j,f;if(!e.length&&h.content){e=a(i.tpl2html("list"));j=i.tpl2html("item");f="";h.content.forEach(function(k){k=a.extend({href:"",text:""},typeof k==="string"?{text:k}:k);f+=j(k)});e.append(f).appendTo(g)}else{if(g.is("ul, ol")){e=g.wrap("<div>");g=g.parent()}if(h.index===c){h.index=e.find(".ui-state-active").index();~h.index||(h.index=0)}}i.$list=e.addClass(d+"-list");i.trigger("done.dom",g.addClass(d),h);e.highlight("ui-state-hover","li");e.on(h.event+i.eventNs,"li:not(.ui-state-disable)>a",function(k){i._switchTo(a(this).parent().index(),k)});i.index=-1;i.switchTo(h.index)},_switchTo:function(j,h){if(j===this.index){return}var f=this,g=f.$list.children(),d=b.Event("beforeselect",h),i;f.trigger(d,g.get(j));if(d.isDefaultPrevented()){return}i=g.removeClass("ui-state-active").eq(j).addClass("ui-state-active");f.index=j;return f.trigger("select",j,i[0])},switchTo:function(d){return this._switchTo(~~d)},unselect:function(){this.index=-1;this.$list.children().removeClass("ui-state-active")},getIndex:function(){return this.index}})})(gmu,gmu.$);