"use strict";(self["momentum-web-components-[id]"]=self["momentum-web-components-[id]"]||[]).push([[4781,7162],{4781(e,t,s){s.d(t,{I:()=>o}),s(7161);var r=s(429),d=s(2364),l=s(608),n=function(e,t,s,r){var d,l=arguments.length,n=l<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,s):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,s,r);else for(var o=e.length-1;o>=0;o--)(d=e[o])&&(n=(l<3?d(n):l>3?d(t,s,n):d(t,s))||n);return l>3&&n&&Object.defineProperty(t,s,n),n};const o=e=>{if((0,d.V)(o,e))return e;class t extends((0,l.T)(e)){constructor(){super(...arguments),this._selected=0,this.rovingPreventFocus=!1}get selected(){return this._selected}set selected(e){this.updateSelectedIndex(e)}get selectedIndex(){return this._selected}set selectedIndex(e){this.updateSelectedIndex(e)}updateSelectedIndex(e){const t=this._selected;if(this.slotted[t]&&(this.slotted[this._selected].tabIndex=-1),this.slotted[e]){const t=this.slotted[e];t.tabIndex=0,this.rovingPreventFocus||t.focus()}this._selected=e,this.requestUpdate("selected",t)}isFocusable(e){return!e.hasAttribute("disabled")&&!e.hasAttribute("hidden")}slottedChanged(){var e;super.slottedChanged&&super.slottedChanged();const t=this.getAvailableSelectedIndex(null!==(e=this.selected)&&void 0!==e?e:0,1);-1!==t&&(this.selected=t)}getAvailableSelectedIndex(e,t=1){const s=this.slotted.length;for(let r=0,d=e;r<s;r+=1,d+=t){d<0?d=s-1:d>=s&&(d=0);const e=this.slotted[d];if(this.isFocusable(e))return d}return-1}}return n([(0,r.property)({type:Boolean,reflect:!0,attribute:"roving-prevent-focus"})],t.prototype,"rovingPreventFocus",void 0),n([(0,r.property)({type:Number,reflect:!0})],t.prototype,"selected",null),n([(0,r.property)({type:Number,reflect:!0,attribute:"selected-index"})],t.prototype,"selectedIndex",null),(0,d.B)(o,t),t}}}]);