/*!
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
*/
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../../_virtual/_rollupPluginBabelHelpers.js"),t=require("../../utils/util.js"),r=require("../../events.js");function i(e){return e?"background:".concat(e,";"):""}var n=function(n){e.inherits(a,n);var s=e.createSuper(a);function a(){var r;e.classCallCheck(this,a);for(var i=arguments.length,n=new Array(i),o=0;o<i;o++)n[o]=arguments[o];return r=s.call.apply(s,[this].concat(n)),e.defineProperty(e.assertThisInitialized(r),"onTimeupdate",function(){var i=r.player.ended,n=e.assertThisInitialized(r).offsetDuration,s=r.currentTime;s=t.default.adjustTimeByDuration(s,n,i),r.update({played:s},n)}),r}return e.createClass(a,[{key:"offsetDuration",get:function(){return this.playerConfig.customDuration||this.player.offsetDuration||this.player.duration}},{key:"currentTime",get:function(){var e=this.player,t=e.offsetCurrentTime,r=e.currentTime;return t>=0?t:r}},{key:"afterCreate",value:function(){var e=this;this.root&&(this.on(r.TIME_UPDATE,this.onTimeupdate),this.on(r.EMPTIED,function(){e.reset()}))}},{key:"reset",value:function(){this.update({played:0,cached:0},0)}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{cached:0,played:0},t=arguments.length>1?arguments[1]:void 0;t&&this.root&&(e.cached&&(this.find("xg-mini-progress-cache").style.width="".concat(e.cached/t*100,"%")),e.played&&(this.find("xg-mini-progress-played").style.width="".concat(e.played/t*100,"%")))}},{key:"render",value:function(){var e=this.playerConfig,t=e.commonStyle;if(e.miniprogress){var r=this.config,n=r.mode,s=r.height,a={cached:i(t.cachedColor),played:i(t.playedColor),progress:i(t.progressColor),height:s>0&&2!==s?"height: ".concat(s,"px;"):""};return'<xg-mini-progress class="xg-mini-progress '.concat("show"===n?"xg-mini-progress-show":"",'" style="').concat(a.progress," ").concat(a.height,'">\n    <xg-mini-progress-cache class="xg-mini-progress-cache" style="').concat(a.cached,'"></xg-mini-progress-cache>\n    <xg-mini-progress-played class="xg-mini-progress-played" style="').concat(a.played,'"></xg-mini-progress-played>\n    </xg-mini-progress>')}}}],[{key:"pluginName",get:function(){return"MiniProgress"}},{key:"defaultConfig",get:function(){return{mode:"auto",height:2}}}]),a}(require("../../plugin/plugin.js").default);exports.default=n;