(function(m){Bangle.btnWatches&&(Bangle.btnWatches.forEach(clearWatch),Bangle.btnWatches=void 0);g.clear(1);g.flip();Bangle.drawWidgets();if(m){var p=g.getWidth()-9;g.getHeight();var e=Object.keys(m),a=m[""];a&&e.splice(e.indexOf(""),1);a instanceof Object||(a={});a.fontHeight=16;a.x=0;a.x2=p-2;a.y=24;a.y2=220;void 0===a.selected&&(a.selected=0);a.fontHeight||(a.fontHeight=6);var q=0|a.x,n=a.x2||g.getWidth()-1,k=0|a.y,u=a.y2||g.getHeight()-1;a.title&&(k+=a.fontHeight+2);var t=require("locale"), d={draw:function(){g.reset();g.setColor(-1);g.setFont("6x8",2).setFontAlign(0,-1,0);a.title&&(g.drawString(a.title,(q+n)/2,k-a.fontHeight-2),g.drawLine(q,k-2,n,k-2));for(var c=0|Math.min((u-k)/a.fontHeight,e.length),b=E.clip(a.selected-(c>>1),0,e.length-c),f=k;c--;){var h=e[b],r=m[h];g.setColor(b!=a.selected||d.selectEdit?7:759);g.fillRect(q,f,n,f+a.fontHeight-1);g.setColor(-1);g.setFontAlign(-1,-1);g.drawString(t.translate(h),q,f);if("object"==typeof r){h=n;var l=r.value;r.format&&(l=r.format(l)); l=t.translate(""+l);d.selectEdit&&b==a.selected&&(h-=25,g.setColor(759),g.fillRect(h-(g.stringWidth(l)+4),f,n,f+a.fontHeight-1),g.setColor(-1),g.drawImage("\f\u0005\u0081\x00 \u0007\x00\u00f9\u00f0\u000e\x00@",h,f+(a.fontHeight-10)/2,{scale:2}));g.setFontAlign(1,-1);g.drawString(l,h-2,f)}g.setColor(-1);f+=a.fontHeight;b++}g.setFontAlign(-1,-1);c=bb.max&&(b.value=b.max); if(b.onchange)b.onchange(b.value)}else a.selected=(c+a.selected)%e.length,0>a.selected&&(a.selected+=e.length);d.draw()}};d.draw();Bangle.btnWatches=[setWatch(function(){d.move(-1)},BTN1,{repeat:1}),setWatch(function(){d.move(1)},BTN3,{repeat:1}),setWatch(function(){d.select()},BTN2,{repeat:1})];return d}})