(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,164597,(e,t,a)=>{let l,s,r;var o=Object.create,i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,y=Object.getOwnPropertyNames,p=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,u=(e,t,a,l)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let s of y(t))c.call(e,s)||s===a||i(e,s,{get:()=>t[s],enumerable:!(l=n(t,s))||l.enumerable});return e},h=(e,t,a)=>{let l;return(l="symbol"!=typeof t?t+"":t)in e?i(e,l,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[l]=a,a},d={},P={default:()=>k};for(var m in P)i(d,m,{get:P[m],enumerable:!0});t.exports=u(i({},"__esModule",{value:!0}),d);var g=(r=null!=(l=e.r(271645))?o(p(l)):{},u(!s&&l&&l.__esModule?r:i(r,"default",{value:l,enumerable:!0}),l)),b=e.r(762406),f=e.r(933066);let T=/[?&](?:list|channel)=([a-zA-Z0-9_-]+)/,w=/user\/([a-zA-Z0-9_-]+)\/?/,v=/youtube-nocookie\.com/;class k extends g.Component{constructor(){super(...arguments),h(this,"callPlayer",b.callPlayer),h(this,"parsePlaylist",e=>{if(e instanceof Array)return{listType:"playlist",playlist:e.map(this.getID).join(",")};if(T.test(e)){let[,t]=e.match(T);return{listType:"playlist",list:t.replace(/^UC/,"UU")}}if(w.test(e)){let[,t]=e.match(w);return{listType:"user_uploads",list:t}}return{}}),h(this,"onStateChange",e=>{let{data:t}=e,{onPlay:a,onPause:l,onBuffer:s,onBufferEnd:r,onEnded:o,onReady:i,loop:n,config:{playerVars:y,onUnstarted:p}}=this.props,{UNSTARTED:c,PLAYING:u,PAUSED:h,BUFFERING:d,ENDED:P,CUED:m}=window.YT.PlayerState;if(t===c&&p(),t===u&&(a(),r()),t===h&&l(),t===d&&s(),t===P){let e=!!this.callPlayer("getPlaylist");n&&!e&&(y.start?this.seekTo(y.start):this.play()),o()}t===m&&i()}),h(this,"mute",()=>{this.callPlayer("mute")}),h(this,"unmute",()=>{this.callPlayer("unMute")}),h(this,"ref",e=>{this.container=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}getID(e){return!e||e instanceof Array||T.test(e)?null:e.match(f.MATCH_URL_YOUTUBE)[1]}load(e,t){let{playing:a,muted:l,playsinline:s,controls:r,loop:o,config:i,onError:n}=this.props,{playerVars:y,embedOptions:p}=i,c=this.getID(e);t?T.test(e)||w.test(e)||e instanceof Array?this.player.loadPlaylist(this.parsePlaylist(e)):this.player.cueVideoById({videoId:c,startSeconds:(0,b.parseStartTime)(e)||y.start,endSeconds:(0,b.parseEndTime)(e)||y.end}):((0,b.getSDK)("https://www.youtube.com/iframe_api","YT","onYouTubeIframeAPIReady",e=>e.loaded).then(t=>{this.container&&(this.player=new t.Player(this.container,{width:"100%",height:"100%",videoId:c,playerVars:{autoplay:+!!a,mute:+!!l,controls:+!!r,start:(0,b.parseStartTime)(e),end:(0,b.parseEndTime)(e),origin:window.location.origin,playsinline:+!!s,...this.parsePlaylist(e),...y},events:{onReady:()=>{o&&this.player.setLoop(!0),this.props.onReady()},onPlaybackRateChange:e=>this.props.onPlaybackRateChange(e.data),onPlaybackQualityChange:e=>this.props.onPlaybackQualityChange(e),onStateChange:this.onStateChange,onError:e=>n(e.data)},host:v.test(e)?"https://www.youtube-nocookie.com":void 0,...p}))},n),p.events&&console.warn("Using `embedOptions.events` will likely break things. Use ReactPlayer’s callback props instead, eg onReady, onPlay, onPause"))}play(){this.callPlayer("playVideo")}pause(){this.callPlayer("pauseVideo")}stop(){document.body.contains(this.callPlayer("getIframe"))&&this.callPlayer("stopVideo")}seekTo(e,t=!1){this.callPlayer("seekTo",e),t||this.props.playing||this.pause()}setVolume(e){this.callPlayer("setVolume",100*e)}setPlaybackRate(e){this.callPlayer("setPlaybackRate",e)}setLoop(e){this.callPlayer("setLoop",e)}getDuration(){return this.callPlayer("getDuration")}getCurrentTime(){return this.callPlayer("getCurrentTime")}getSecondsLoaded(){return this.callPlayer("getVideoLoadedFraction")*this.getDuration()}render(){let{display:e}=this.props;return g.default.createElement("div",{style:{width:"100%",height:"100%",display:e}},g.default.createElement("div",{ref:this.ref}))}}h(k,"displayName","YouTube"),h(k,"canPlay",f.canPlay.youtube)}]);