/*!
Copyright (c) 2026 Lenovo SSG BASD. All rights reserved.
@license Proprietary

This software is the confidential and proprietary property of Lenovo SSG BASD.
You shall not disclose such Confidential Information and shall use it only in
accordance with the terms of the license agreement.

--- Build Info ---
Version: 1.1.1
Build Time: 2026/2/26 17:21:00
Build Commit: 81e556ed827e2f043668506dae6fae8dbb9ef395
*/
import{inherits as i,createSuper as t,classCallCheck as e,defineProperty as n,assertThisInitialized as s,createClass as r}from"../../_virtual/_rollupPluginBabelHelpers.js";import l from"../../utils/sniffer.js";import{PLAYNEXT as a}from"../../events.js";import o,{POSITIONS as c}from"../../plugin/plugin.js";import{xgIconTips as u}from"../common/iconTools.js";import p from"../assets/playNext.js";var h=/* @__PURE__ */function(){i(f,o);var h=t(f);function f(i){var t;return e(this,f),t=h.call(this,i),n(s(t),"playNext",function(i){var e=s(t).player;i.preventDefault(),i.stopPropagation(),t.idx+1<t.config.urlList.length?(t.idx++,t.nextHandler(t.config.urlList[t.idx],t.idx),e.emit(a,t.idx+1)):(t.nextHandler(),e.emit(a))}),t.idx=-1,t}return r(f,[{key:"afterCreate",value:function(){this.config.urlList&&0!==this.config.urlList.length&&(this.appendChild(".xgplayer-icon",this.icons.playNext),this.initEvents())}},{key:"registerIcons",value:function(){return{playNext:p}}},{key:"initEvents",value:function(){this.nextHandler=this.hook("nextClick",this.changeSrc);var i="mobile"===l.device?"touchend":"click";this.bind(i,this.playNext),this.show()}},{key:"changeSrc",value:function(i){var t=this.player;i&&(t.pause(),t.currentTime=0,t.switchURL?t.switchURL(i):t.src=i,t.config.url=i,t.play())}},{key:"destroy",value:function(){this.unbind(["touchend","click"],this.playNext)}},{key:"render",value:function(){if(this.config.urlList&&0!==this.config.urlList.length)return'\n     <xg-icon class="xgplayer-playnext">\n      <div class="xgplayer-icon">\n      </div>\n      '.concat(u(this,"PLAYNEXT_TIPS",this.playerConfig.isHideTips),"\n     </xg-icon>\n    ")}}],[{key:"pluginName",get:function(){return"playNext"}},{key:"defaultConfig",get:function(){return{position:c.CONTROLS_LEFT,index:1,url:null,urlList:[]}}}]),f}();export{h as default};