globalThis.MediaBehaviors=globalThis.MediaBehaviors||{},globalThis.MediaBehaviors.Video={_sourceIsIframe(e){return"local"!=this.getVideoType(e)},cleanVideoSource(e,t){if("local"!=t&&"string"==typeof e){var i=e.split("?"),o="";if(e=i[0],2==i.length){let e=i[1].split("&"),t=e[0].split("="),r=Array.isArray(e.shift())?e.shift().join(""):e.shift();if("v"==t[0]){let e=void 0!==r&&""!==r?"?"+r:"";o=t[1]+e}}if(-1==e.indexOf("player.vimeo.com")&&-1!=e.indexOf("vimeo.com"))return-1!=e.indexOf("/videos/")&&(e=e.replace("/videos/","/")),e.replace("vimeo.com/","player.vimeo.com/video/");if(-1!=e.indexOf("youtube.com/watch"))return e.replace("youtube.com/watch","youtube.com/embed/")+o;if(-1!=e.indexOf("youtube.com/shorts/"))return e.replace("youtube.com/shorts/","youtube.com/embed/")+o;if(-1!=e.indexOf("youtube-no-cookie.com/"))return e.replace("youtube-no-cookie.com/","youtube.com/")+o;if(-1!=e.indexOf("youtu.be"))return e.replace("youtu.be/","www.youtube.com/embed/")+o;if(-1!=e.indexOf("player.twitch.tv/")){if(i[1])return`${e}?${i[1].replace("&parent=www.example.com","")}`;return`https://player.twitch.tv/?channel=${e.replace("&parent=www.example.com","").split("/").pop()}`}if(-1!=e.indexOf("twitch.tv/videos/")){return`https://player.twitch.tv/?video=${e.replace("&parent=www.example.com","").split("/").pop()}`}if(-1!=e.indexOf("twitch.tv/")){return`https://player.twitch.tv/?channel=${e.replace("&parent=www.example.com","").split("/").pop()}`}if(-1!=e.indexOf("sketchfab.com")&&-1==e.indexOf("/embed"))return e+"/embed"}return e},getVideoType(e){let t=["aac","flac","mov","mp3","mp4","oga","ogg","ogv","wav","webm"],i=!1;if(-1!=e.indexOf("vimeo"))return"vimeo";if(-1!=e.indexOf("youtube")||-1!=e.indexOf("youtu.be"))return"youtube";if(-1!=e.indexOf("sketchfab.com"))return"sketchfab";if(-1!=e.indexOf("twitch.tv"))return"twitch";for(let o=0;o<t.length;o++)!i&&e.toLowerCase().indexOf("."+t[o])>-1&&(i=!0);return i?"local":"external"}};export const MediaBehaviorsVideo=function(e){return class extends e{_sourceIsIframe(e){return"local"!=this.getVideoType(e)}cleanVideoSource(e,t){if("local"!=t){var i=e.split("?"),o="";if(e=i[0],2==i.length){let e=i[1].split("&"),t=e[0].split("="),r=Array.isArray(e.shift())?e.shift().join(""):e.shift();if("v"==t[0]){let e=void 0!==r&&""!==r?"?"+r:"";o=t[1]+e}}if(-1==e.indexOf("player.vimeo.com")&&-1!=e.indexOf("vimeo.com"))return-1!=e.indexOf("/videos/")&&(e=e.replace("/videos/","/")),e.replace("vimeo.com/","player.vimeo.com/video/");if(-1!=e.indexOf("youtube.com/watch"))return e.replace("youtube.com/watch","youtube.com/embed/")+o;if(-1!=e.indexOf("player.twitch.tv/")){if(i[1])return`${e}?${i[1].replace("&parent=www.example.com","")}`;return`https://player.twitch.tv/?channel=${e.replace("&parent=www.example.com","").split("/").pop()}`}if(-1!=e.indexOf("twitch.tv/videos/")){return`https://player.twitch.tv/?video=${e.replace("&parent=www.example.com","").split("/").pop()}`}if(-1!=e.indexOf("twitch.tv/")){return`https://player.twitch.tv/?channel=${e.replace("&parent=www.example.com","").split("/").pop()}`}if(-1!=e.indexOf("youtube-no-cookie.com/"))return e.replace("youtube-no-cookie.com/","youtube.com/")+o;if(-1!=e.indexOf("youtu.be"))return e.replace("youtu.be/","www.youtube.com/embed/")+o;if(-1!=e.indexOf("sketchfab.com")&&-1==e.indexOf("/embed"))return e+"/embed"}return e}getVideoType(e){let t=["aac","flac","mov","mp3","mp4","oga","ogg","ogv","wav","webm"],i=!1;if(-1!=e.indexOf("vimeo"))return"vimeo";if(-1!=e.indexOf("youtube")||-1!=e.indexOf("youtu.be"))return"youtube";if(-1!=e.indexOf("sketchfab.com"))return"sketchfab";if(-1!=e.indexOf("twitch.tv"))return"twitch";for(let o=0;o<t.length;o++)!i&&e.toLowerCase().indexOf("."+t[o])>-1&&(i=!0);return i?"local":"external"}}};