1import{n as e,t}from"./classPrivateFieldGet2-CFIOuXdl.js";import{t as n}from"./classPrivateFieldSet2-DNfdh3So.js";import{Component as r}from"@theme/component";var i=new WeakMap,a=new WeakMap,o=new WeakMap,s=class extends r{constructor(...t){super(...t),e(this,i,0),e(this,a,void 0),e(this,o,()=>document.hidden?this.pause():this.resume())}connectedCallback(){super.connectedCallback(),this.addEventListener(`mouseenter`,this.suspend),this.addEventListener(`mouseleave`,this.resume),document.addEventListener(`visibilitychange`,t(o,this)),this.current=0,this.dataset.announcementBarReady=`true`,this.play()}next(){this.current+=1}previous(){--this.current}play(e=this.autoplayInterval){this.paused=!1,this.canAutoplay&&n(a,this,setInterval(()=>{this.matches(`:hover`)||document.hidden||this.next()},e))}pause(){this.paused=!0,this.suspend()}get paused(){return this.hasAttribute(`paused`)}set paused(e){this.toggleAttribute(`paused`,e)}suspend(){clearInterval(t(a,this)),n(a,this,void 0)}resume(){!this.autoplay||this.paused||(this.pause(),this.play())}get autoplay(){return!!this.autoplayInterval}get canAutoplay(){let e=this.refs.slides??[];return this.autoplay&&e.length>1}get autoplayInterval(){let e=this.getAttribute(`autoplay`),t=parseInt(`${e}`,10);if(!Number.isNaN(t))return t*1e3}get current(){return t(i,this)}set current(e){n(i,this,e);let t=this.refs.slides??[];if(!t.length)return;let r=e%t.length;r<0&&(r+=t.length),t.forEach((e,t)=>{e.setAttribute(`aria-hidden`,`${t!==r}`)})}};customElements.get(`announcement-bar-component`)||customElements.define(`announcement-bar-component`,s);export{s as AnnouncementBar}; 2//# sourceMappingURL=announcement-bar.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.