/*!
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 t,createSuper as i,classCallCheck as e,createClass as o}from"../../_virtual/_rollupPluginBabelHelpers.js";import n from"../../utils/util.js";import r from"../../plugin/plugin.js";import s from"../../stateClassMap.js";var l=/* @__PURE__ */function(){t(a,r);var l=i(a);function a(){return e(this,a),l.apply(this,arguments)}return o(a,[{key:"afterCreate",value:function(){var t=this;this.intervalId=0,this.customConfig=null,this.bind(".highlight",["click","touchend"],function(i){(t.config.onClick||t.customOnClick)&&(i.preventDefault(),i.stopPropagation(),t.customOnClick?t.customOnClick(i):t.config.onClick(i))}),this.player.showPrompt=function(){t.showPrompt.apply(t,arguments)},this.player.hidePrompt=function(){t.hide()}}},{key:"setStyle",value:function(t){var i=this;Object.keys(t).map(function(e){i.root.style[e]=t[e]})}},{key:"showPrompt",value:function(t){var i=this,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};if(t){this.customOnClick=o;var r=this.config.interval;if(this.intervalId&&(clearTimeout(this.intervalId),this.intervalId=null),n.addClass(this.root,"show"),"arrow"===e.mode&&n.addClass(this.root,"arrow"),this.find(".xgplayer-prompt-detail").innerHTML="string"==typeof t?t:"".concat(t.text||"")+"".concat(t.highlight?'<i class="highlight">'.concat(t.highlight,"</i>"):""),e.style&&this.setStyle(e.style),"boolean"==typeof e.autoHide?e.autoHide:this.config.autoHide){var s=e.interval||r;this.intervalId=setTimeout(function(){i.hide()},s)}}}},{key:"hide",value:function(){n.removeClass(this.root,"show"),n.removeClass(this.root,"arrow"),this.root.removeAttribute("style"),this.customOnClick=null}},{key:"render",value:function(){return'<xg-prompt class="xgplayer-prompt '.concat(s.CONTROLS_FOLLOW,'">\n    <span class="xgplayer-prompt-detail"></span>\n    </xg-prompt>')}}],[{key:"pluginName",get:function(){return"prompt"}},{key:"defaultConfig",get:function(){return{interval:3e3,style:{},mode:"arrow",autoHide:!0,detail:{text:"",highlight:""},onClick:function(){}}}}]),a}();export{l as default};