(this["webpackJsonpmr-julyedu"]=this["webpackJsonpmr-julyedu"]||[]).push([[43],{1665:function(e,t,s){"use strict";s.r(t);var i=s(0),n=s.n(i),r=s(128);s(208),s(1666);class o extends i.Component{constructor(){super(...arguments),this.count=0,this.state={showNotices:!0},this.initializeSwiper=()=>{const e=this;this.swiper=new r.a(".sys-bullet-screen-swiper-container",{allowTouchMove:!1,direction:"vertical",loop:!0,on:{init(){Array.from(this.slides).forEach(t=>{t.querySelector("span").addEventListener("transitionend",e.transitionEnd)})},slideChangeTransitionEnd(){e.slideHorizontal(this)},transitionEnd(){const e=this.slides[this.previousIndex].querySelector("span");e.style.transition="unset",e.style.transform="translate3d(0,0,0)"}}})},this.slideHorizontal=e=>{let t=e.slides[e.activeIndex],s=t.querySelector("span"),i=s.offsetWidth,n=t.clientWidth;if(i>n)s.style.transition=`transform ${i/131.25}s linear`,setTimeout(()=>{s.style.transform=`translate3d(${-(i-n)-10}px,0,0)`},1e3);else{const{bullets:t}=this.props,s=3*t.length;setTimeout(()=>{++this.count===s&&(this.sysNotice.style.height="0px"),e&&!e.destroyed&&e.slideNext()},3e3)}},this.transitionEnd=()=>{const{bullets:e}=this.props,t=3*e.length;++this.count===t?setTimeout(()=>{this.sysNotice.style.height="0px"},2e3):setTimeout(()=>{this.swiper&&this.swiper.slideNext()},1e3)},this.removeSystemNotices=e=>{e.persist(),e.target===this.sysNotice&&this.setState({showNotices:!1})}}componentDidMount(){this.initializeSwiper()}componentWillUnmount(){this.swiper&&this.swiper.destroy()}render(){const{bullets:e}=this.props;return this.state.showNotices&&n.a.createElement("div",{id:"system-bullet-screen",onTransitionEnd:this.removeSystemNotices,ref:e=>this.sysNotice=e},n.a.createElement("img",{className:"avatar",src:"https://cdn.julyedu.com/newyear20/system-notice-icon.png",alt:""}),n.a.createElement("div",{className:"sys-bullet-screen-swiper-container"},n.a.createElement("ul",{className:"swiper-wrapper"},e&&e.length?e.map((e,t)=>n.a.createElement("li",{className:"swiper-slide",key:t},n.a.createElement("span",null,e))):null)))}}t.default=o},1666:function(e,t,s){}}]);
//# sourceMappingURL=system-notices.40d38d94.chunk.js.map