/*!
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 e,classCallCheck as t,defineProperty as n,assertThisInitialized as u,createClass as a}from"../../_virtual/_rollupPluginBabelHelpers.js";import{WAITING as m,PLAYING as r,CANPLAY as p,PLAY as o}from"../../events.js";import s from"../../plugin/plugin.js";var l=/* @__PURE__ */function(){i(c,s);var l=e(c);function c(){var i;t(this,c);for(var e=arguments.length,a=new Array(e),m=0;m<e;m++)a[m]=arguments[m];return i=l.call.apply(l,[this].concat(a)),n(u(i),"onWaiting",function(){var e=u(i).config;i.jumpCnt>e.jumpCntMax||i.timer||!1===e.useWaitingTimeoutJump||(i.timer=setTimeout(i.onJump,1e3*e.waitingTime))}),n(u(i),"onJump",function(){var e=u(i),t=e.player,n=e.config;if(clearTimeout(i.timer),i.timer=null,!(i.jumpCnt>n.jumpCntMax||!1===n.useWaitingTimeoutJump||t.media.paused&&0!==t.media.currentTime&&i.hasPlayed)){i.jumpSize=n.jumpSize*(i.jumpCnt+1),i.jumpCnt===n.jumpSize&&i.jumpSize<6&&(i.jumpSize=6);var a=t.currentTime+i.jumpSize;a>t.media.duration||(i.jumpCnt++,t.currentTime=a)}}),i}return a(c,[{key:"afterCreate",value:function(){var i=this,e=this.config,t=e.useWaitingTimeoutJump,n=e.jumpSize;!1!==t&&(this.hasPlayed=!1,this.jumpCnt=0,this.timer=null,this.jumpSize=n,this.on(m,this.onWaiting),this.on([r,p],function(){clearTimeout(i.timer),i.timer=null,i.jumpSize=i.config.jumpSize}),this.on(o,function(){i.hasPlayed=!0}))}}],[{key:"pluginName",get:function(){return"waitingTimeoutJump"}},{key:"defaultConfig",get:function(){return{useWaitingTimeoutJump:!1,waitingTime:15,jumpSize:2,jumpCntMax:4}}}]),c}();export{l as default};