(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,744444,(e,t,r)=>{let a,l,s;var i=Object.create,n=Object.defineProperty,o=Object.getOwnPropertyDescriptor,p=Object.getOwnPropertyNames,h=Object.getPrototypeOf,d=Object.prototype.hasOwnProperty,u=(e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of p(t))d.call(e,l)||l===r||n(e,l,{get:()=>t[l],enumerable:!(a=o(t,l))||a.enumerable});return e},y=(e,t,r)=>{let a;return(a="symbol"!=typeof t?t+"":t)in e?n(e,a,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[a]=r,r},c={},m={default:()=>T};for(var P in m)n(c,P,{get:m[P],enumerable:!0});t.exports=u(n({},"__esModule",{value:!0}),c);var b=(s=null!=(a=e.r(271645))?i(h(a)):{},u(!l&&a&&a.__esModule?s:n(s,"default",{value:a,enumerable:!0}),a)),g=e.r(762406),v=e.r(933066);class T extends b.Component{constructor(){super(...arguments),y(this,"callPlayer",g.callPlayer),y(this,"playerID",this.props.config.playerId||`twitch-player-${(0,g.randomString)()}`),y(this,"mute",()=>{this.callPlayer("setMuted",!0)}),y(this,"unmute",()=>{this.callPlayer("setMuted",!1)})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e,t){let{playsinline:r,onError:a,config:l,controls:s}=this.props,i=v.MATCH_URL_TWITCH_CHANNEL.test(e),n=i?e.match(v.MATCH_URL_TWITCH_CHANNEL)[1]:e.match(v.MATCH_URL_TWITCH_VIDEO)[1];t?i?this.player.setChannel(n):this.player.setVideo("v"+n):(0,g.getSDK)("https://player.twitch.tv/js/embed/v1.js","Twitch").then(t=>{this.player=new t.Player(this.playerID,{video:i?"":n,channel:i?n:"",height:"100%",width:"100%",playsinline:r,autoplay:this.props.playing,muted:this.props.muted,controls:!!i||s,time:(0,g.parseStartTime)(e),...l.options});let{READY:a,PLAYING:o,PAUSE:p,ENDED:h,ONLINE:d,OFFLINE:u,SEEK:y}=t.Player;this.player.addEventListener(a,this.props.onReady),this.player.addEventListener(o,this.props.onPlay),this.player.addEventListener(p,this.props.onPause),this.player.addEventListener(h,this.props.onEnded),this.player.addEventListener(y,this.props.onSeek),this.player.addEventListener(d,this.props.onLoaded),this.player.addEventListener(u,this.props.onLoaded)},a)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){this.callPlayer("pause")}seekTo(e,t=!0){this.callPlayer("seek",e),t||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}getDuration(){return this.callPlayer("getDuration")}getCurrentTime(){return this.callPlayer("getCurrentTime")}getSecondsLoaded(){return null}render(){return b.default.createElement("div",{style:{width:"100%",height:"100%"},id:this.playerID})}}y(T,"displayName","Twitch"),y(T,"canPlay",v.canPlay.twitch),y(T,"loopOnEnded",!0)}]);