/*!
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 r,createSuper as e,classCallCheck as t,createClass as n}from"../../_virtual/_rollupPluginBabelHelpers.js";import{ERROR as i}from"../../events.js";import s from"../../plugin/plugin.js";var a=/* @__PURE__ */function(){r(o,s);var a=e(o);function o(){return t(this,o),a.apply(this,arguments)}return n(o,[{key:"afterCreate",value:function(){var r=this;this.clickHandler=this.hook("errorRetry",this.errorRetry,{pre:function(r){r.preventDefault(),r.stopPropagation()}}),this.onError=this.hook("showError",this.handleError),this.bind(".xgplayer-error-refresh","click",this.clickHandler),this.on(i,function(e){r.onError(e)})}},{key:"errorRetry",value:function(r){this.emitUserAction(r,"error_retry",{}),this.player.retry()}},{key:"handleError",value:function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.player,t=r.errorType,n=e.errorNote?this.i18n[e.errorNote]:"";if(!n)switch(t){case"decoder":n=this.i18n.MEDIA_ERR_DECODE;break;case"network":n=this.i18n.MEDIA_ERR_NETWORK;break;default:n=this.i18n.MEDIA_ERR_SRC_NOT_SUPPORTED}this.find(".xgplayer-error-text").innerHTML=n,this.find(".xgplayer-error-tips").innerHTML="".concat(this.i18n.REFRESH_TIPS,'<span class="xgplayer-error-refresh">').concat(this.i18n.REFRESH,"</span>")}},{key:"destroy",value:function(){this.unbind(".xgplayer-error-refresh","click",this.clickHandler)}},{key:"render",value:function(){return'<xg-error class="xgplayer-error">\n      <div class="xgplayer-errornote">\n       <span class="xgplayer-error-text"></span>\n       <span class="xgplayer-error-tips"><em class="xgplayer-error-refresh"></em></span>\n      </div>\n    </xg-error>'}}],[{key:"pluginName",get:function(){return"error"}}]),o}();export{a as default};