@maveio/components 0.0.157 → 0.0.159
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-45FW5DBN.js → chunk-24TUG5TP.js} +1 -1
- package/dist/{chunk-KZOVSI7R.cjs → chunk-2UJ446RI.cjs} +13 -29
- package/dist/{chunk-Z5AM3NST.cjs → chunk-32WXLTTE.cjs} +2 -2
- package/dist/{chunk-4CDE2QCJ.js → chunk-6XR2OUZW.js} +1 -1
- package/dist/chunk-7ZRXZY5C.js +20 -0
- package/dist/{chunk-TVNAG7X4.cjs → chunk-B3QILQEE.cjs} +3 -3
- package/dist/{chunk-6MCTUE3H.js → chunk-CHHWULL2.js} +4 -4
- package/dist/chunk-DITZCOYN.cjs +379 -0
- package/dist/{chunk-MKZYI5TY.cjs → chunk-EOHKHSQ3.cjs} +1 -1
- package/dist/{chunk-KTGL4HLA.cjs → chunk-FUSQ4EZG.cjs} +2 -2
- package/dist/chunk-JHSFSCC2.cjs +1 -0
- package/dist/chunk-KA24PL7V.js +1 -0
- package/dist/{chunk-VZKW2VWI.js → chunk-KNAAIER3.js} +2 -2
- package/dist/{chunk-5KQJTT3P.cjs → chunk-KVMGCTLR.cjs} +1 -1
- package/dist/{chunk-JBRRVOTV.cjs → chunk-MLZIA6JO.cjs} +5 -5
- package/dist/chunk-MSWONVA7.cjs +20 -0
- package/dist/{chunk-4AYP3SUJ.js → chunk-NKEVN7FX.js} +1 -1
- package/dist/{chunk-PLCF3Z5Q.cjs → chunk-OTRPT6Y4.cjs} +4 -4
- package/dist/{chunk-PC26CFMJ.cjs → chunk-PHGKLFNF.cjs} +1 -1
- package/dist/{chunk-2AXZ5ZCT.js → chunk-QNX3YAVY.js} +7 -23
- package/dist/chunk-QSQE5WBN.js +35 -0
- package/dist/chunk-QZSLJNS4.js +7 -0
- package/dist/chunk-STJ6CEFZ.cjs +1468 -0
- package/dist/chunk-T2P4BAWY.js +379 -0
- package/dist/chunk-ULZI6OGL.js +1468 -0
- package/dist/{chunk-CUGRXOA2.js → chunk-XLUB3ATV.js} +1 -1
- package/dist/{chunk-6NWQAHZT.cjs → chunk-ZLS57S3I.cjs} +1 -1
- package/dist/components/audio-track-menu.cjs +1 -0
- package/dist/components/audio-track-menu.d.cts +27 -0
- package/dist/components/audio-track-menu.d.ts +27 -0
- package/dist/components/audio-track-menu.js +1 -0
- package/dist/components/clip.cjs +1 -1
- package/dist/components/clip.js +1 -1
- package/dist/components/files.cjs +1 -1
- package/dist/components/files.js +1 -1
- package/dist/components/img.cjs +1 -1
- package/dist/components/img.js +1 -1
- package/dist/components/list.cjs +1 -1
- package/dist/components/list.js +1 -1
- package/dist/components/player.cjs +1 -1
- package/dist/components/player.d.cts +8 -0
- package/dist/components/player.d.ts +8 -0
- package/dist/components/player.js +1 -1
- package/dist/components/pop.cjs +1 -1
- package/dist/components/pop.js +1 -1
- package/dist/components/text.cjs +1 -1
- package/dist/components/text.js +1 -1
- package/dist/components/upload.cjs +1 -1
- package/dist/components/upload.d.cts +5 -0
- package/dist/components/upload.d.ts +5 -0
- package/dist/components/upload.js +1 -1
- package/dist/config.cjs +1 -1
- package/dist/config.js +1 -1
- package/dist/embed/api.cjs +1 -1
- package/dist/embed/api.d.cts +11 -1
- package/dist/embed/api.d.ts +11 -1
- package/dist/embed/api.js +1 -1
- package/dist/embed/caption.cjs +1 -1
- package/dist/embed/caption.js +1 -1
- package/dist/embed/controller.cjs +1 -1
- package/dist/embed/controller.js +1 -1
- package/dist/embed/socket.cjs +1 -1
- package/dist/embed/socket.d.cts +3 -5
- package/dist/embed/socket.d.ts +3 -5
- package/dist/embed/socket.js +1 -1
- package/dist/generated/locales/de.cjs +1 -1
- package/dist/generated/locales/de.js +1 -1
- package/dist/generated/locales/en.cjs +1 -1
- package/dist/generated/locales/en.js +1 -1
- package/dist/generated/locales/fr.cjs +1 -1
- package/dist/generated/locales/fr.js +1 -1
- package/dist/generated/locales/nl.cjs +1 -1
- package/dist/generated/locales/nl.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/react.cjs +1 -1
- package/dist/react.js +1 -1
- package/dist/themes/default.cjs +53 -1
- package/dist/themes/default.js +53 -1
- package/dist/themes/dolphin.cjs +1 -1
- package/dist/themes/dolphin.js +1 -1
- package/dist/themes/loader.cjs +1 -1
- package/dist/themes/loader.js +1 -1
- package/dist/themes/synthwave.cjs +1 -1
- package/dist/themes/synthwave.js +1 -1
- package/dist/utils/localization.cjs +1 -1
- package/dist/utils/localization.js +1 -1
- package/dist/utils/mave_element.cjs +1 -1
- package/dist/utils/mave_element.js +1 -1
- package/dist/utils/origin.cjs +1 -1
- package/dist/utils/origin.js +1 -1
- package/dist/utils/video_events.cjs +1 -1
- package/dist/utils/video_events.js +1 -1
- package/dist/vue.cjs +1 -1
- package/dist/vue.js +1 -1
- package/package.json +3 -3
- package/dist/chunk-5IPIXU3O.js +0 -1807
- package/dist/chunk-IBTJ5OMP.js +0 -35
- package/dist/chunk-IPA5Q26W.cjs +0 -1
- package/dist/chunk-LGWESJBJ.cjs +0 -20
- package/dist/chunk-NDDFZTBA.js +0 -1
- package/dist/chunk-SRXHXTDF.js +0 -7
- package/dist/chunk-ZMMJMM4X.cjs +0 -1807
- package/dist/chunk-ZT2E4EC7.js +0 -20
- /package/dist/{chunk-NI57YLPL.cjs → chunk-BVMU4ZXD.cjs} +0 -0
- /package/dist/{chunk-EXNM5EV2.js → chunk-DFLPNNA4.js} +0 -0
- /package/dist/{chunk-4GKJNXUA.js → chunk-FRPU6QLJ.js} +0 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {a as a$2}from'./chunk-
|
|
1
|
+
import {b as b$2,a as a$1,c as c$2}from'./chunk-XLUB3ATV.js';import {a as a$3}from'./chunk-MK4VIJT3.js';import {a as a$2}from'./chunk-3R7TX6NC.js';import {b as b$4}from'./chunk-HX6F65VL.js';import {a,b as b$3}from'./chunk-HMISRRKC.js';import {h,i as i$1,c as c$3}from'./chunk-A4GZBQEB.js';import {a as a$4}from'./chunk-JBV2AYRP.js';import {b as b$1,c as c$1,e,g,d}from'./chunk-KA24PL7V.js';var b=b$1(b$2(),1);var i,v,c,u,y,M,p,I,S,T,r=class extends i$1{constructor(){super(...arguments);e(this,i);this.autoplay="lazy";this.quality="auto";this.fallback="placeholder";this._queue=[];this._failedPlay=false;this._intersectionObserver=new a$1(this,{callback:g(this,i,S).bind(this)});this.embedController=new b$4(this);}get embed(){return this._embedId}set embed(t){this._embedId!=t&&(this._embedId=t,this.requestUpdate("embed"),this.embedController.embed=this.embed);}set loop(t){this._loop=(t===""||t=="true"||t==true)??false;}get loop(){return this._loop}get poster(){return this.embedController.embedFile(`${this.fallback}.jpg`)}set poster(t){if(t){let s=this._poster;this._poster=t,this.requestUpdate("poster",s);}}get token(){return this._token}set token(t){this._token!=t&&(this._token=t,this.requestUpdate("token"),this.embedController.token=this._token);}get sources(){let t=this.autoplay==="scroll"?["clip_keyframes"]:["video","clip"],s=this._embed.video.renditions.filter(e=>(this.quality=="auto"?e.size!=="uhd":d(this,i,c).indexOf(e.size)<=d(this,i,c).indexOf(this.quality))&&e.container==="mp4"&&d(this,i,u).includes(e.codec)&&(!e.type||t.includes(e.type))).sort((e,o)=>e.size===o.size?d(this,i,u).indexOf(e.codec)-d(this,i,u).indexOf(o.codec):d(this,i,c).indexOf(o.size)-d(this,i,c).indexOf(e.size)).map(e=>{let o=d(this,i,M).find(g=>g.size===e.size)?.media,m=`${e.codec}_${e.size}${e.type&&e.type!="video"?`_${e.type}`:""}.mp4`;return {media:o,src:this.embedController.embedFile(m),codec:d(this,i,y)[e.codec]??e.codec}}),d$1=this._embed.video.renditions.filter(e=>d(this,i,c).indexOf(e.size)<=d(this,i,c).indexOf("fhd")&&e.container==="mp4"&&d(this,i,u).includes(e.codec)&&(!e.type||t.includes(e.type))).sort((e,o)=>d(this,i,c).indexOf(o.size)-d(this,i,c).indexOf(e.size));if(d$1.length>0){let e=d$1[0],o=`${e.codec}_${e.size}${e.type&&e.type!="video"?`_${e.type}`:""}.mp4`,m={media:void 0,src:this.embedController.embedFile(o),codec:d(this,i,y)[e.codec]??e.codec};s.push(m);}return s}connectedCallback(){super.connectedCallback(),typeof document<"u"&&this.autoplay==="scroll"&&document.addEventListener("scroll",g(this,i,v).bind(this));}disconnectedCallback(){super.disconnectedCallback(),typeof document<"u"&&this.autoplay==="scroll"&&document.removeEventListener("scroll",g(this,i,v).bind(this)),this._metricsInstance?.demonitor();}set muted(t){this._videoElement?this._videoElement.muted=t:this._queue.push(()=>this._videoElement.muted=t);}get muted(){return this._videoElement?.muted||false}get paused(){return this._videoElement?.paused||true}get duration(){return new Promise((t,s)=>{if(this._videoElement&&!isNaN(this._videoElement.duration))return t(this._videoElement.duration);let d=()=>{this._videoElement?.addEventListener("loadedmetadata",()=>{this._videoElement&&t(this._videoElement.duration);}),this._videoElement?.addEventListener("error",e=>{s(new Error("Failed to load video metadata."));});};this._videoElement?d():this.addEventListener("mave:video_element_ready",()=>{d();});})}set currentTime(t){this._videoElement?this._videoElement.currentTime=t:this._queue.push(()=>this._videoElement.currentTime=t);}get currentTime(){return this._videoElement?this._videoElement?.currentTime:0}play(){this._videoElement?g(this,i,p).call(this):this._queue.push(()=>g(this,i,p).call(this));}pause(){this._videoElement?this._videoElement.pause():this._queue.push(()=>this._videoElement?.pause());}render(){return c$3`
|
|
2
2
|
${this.embedController.render({complete:t=>{if(this._embed=t,!!t)return c$3`
|
|
3
3
|
<video
|
|
4
|
-
@click=${
|
|
4
|
+
@click=${g(this,i,T)}
|
|
5
5
|
preload="metadata"
|
|
6
6
|
style=${a$2(this._failedPlay||this.autoplay==="off"?"cursor: pointer":void 0)}
|
|
7
7
|
muted
|
|
8
8
|
playsinline
|
|
9
9
|
poster=${a$2(this._failedPlay?this.poster:void 0)}
|
|
10
|
-
${c$2(
|
|
10
|
+
${c$2(g(this,i,I))}
|
|
11
11
|
?autoplay=${this.autoplay==="always"}
|
|
12
12
|
?loop=${this.loop||true}
|
|
13
13
|
>
|
|
@@ -20,7 +20,7 @@ import {a as a$2}from'./chunk-3R7TX6NC.js';import {b as b$2,a as a$1,c as c$2}fr
|
|
|
20
20
|
`)}
|
|
21
21
|
</video>
|
|
22
22
|
`}})}
|
|
23
|
-
`}};i=new WeakSet,v=function(){if(typeof window>"u")return;let{height:t,top:s,bottom:d}=this.getBoundingClientRect(),e=window.innerHeight;if(this._videoElement){this._videoElement.duration||this._videoElement.load();let o=0;if(s<e&&d>0){let m=t+e;o=(e-s)/m*this._videoElement.duration;}o>=0&&o<=this._videoElement.duration&&(this._videoElement.currentTime=o);}},c=function(){return ["sd","hd","fhd","qhd","uhd"]},u=function(){let t=navigator.userAgent,s=/Edg/.test(t)&&/Mac OS/.test(t),d=/Safari/.test(t)&&!/Chrome/.test(t),e=/Mac OS/.test(t),o=/iPhone|iPad/.test(t);return e&&(d||s)||o?["hevc","h264"]:["av1","h264"]},y=function(){return {av1:"av01.0.08M.08.0.110.01.01.01.0,opus",hevc:"hevc.01.00.78,mp4a.40.2",h264:"avc1.64.00.28,mp4a.40.2"}},M=function(){return [{size:"qhd",media:1280},{size:"fhd",media:1080},{size:"hd",media:720},{size:"sd",media:640}]},p=function(){this._metricsInstance?.monitor(),this._videoElement&&(this._videoElement.muted=true,this._videoElement.play().catch(t=>{this._failedPlay=true;}));},I=function(t){if(this._videoElement||(this._videoElement=t,this.dispatchEvent(new CustomEvent("mave:video_element_ready",{detail:this._videoElement,bubbles:true,composed:true}))),this._intersectionObserver.observe(this._videoElement),this._videoElement&&this._embed){a$3.forEach(d=>{this._videoElement?.addEventListener(d,e=>{!this._canPlay&&this.autoplay==="scroll"&&d==="canplay"&&(this._canPlay=true,
|
|
23
|
+
`}};i=new WeakSet,v=function(){if(typeof window>"u")return;let{height:t,top:s,bottom:d}=this.getBoundingClientRect(),e=window.innerHeight;if(this._videoElement){this._videoElement.duration||this._videoElement.load();let o=0;if(s<e&&d>0){let m=t+e;o=(e-s)/m*this._videoElement.duration;}o>=0&&o<=this._videoElement.duration&&(this._videoElement.currentTime=o);}},c=function(){return ["sd","hd","fhd","qhd","uhd"]},u=function(){let t=navigator.userAgent,s=/Edg/.test(t)&&/Mac OS/.test(t),d=/Safari/.test(t)&&!/Chrome/.test(t),e=/Mac OS/.test(t),o=/iPhone|iPad/.test(t);return e&&(d||s)||o?["hevc","h264"]:["av1","h264"]},y=function(){return {av1:"av01.0.08M.08.0.110.01.01.01.0,opus",hevc:"hevc.01.00.78,mp4a.40.2",h264:"avc1.64.00.28,mp4a.40.2"}},M=function(){return [{size:"qhd",media:1280},{size:"fhd",media:1080},{size:"hd",media:720},{size:"sd",media:640}]},p=function(){this._metricsInstance?.monitor(),this._videoElement&&(this._videoElement.muted=true,this._videoElement.play().catch(t=>{this._failedPlay=true;}));},I=function(t){if(this._videoElement||(this._videoElement=t,this.dispatchEvent(new CustomEvent("mave:video_element_ready",{detail:this._videoElement,bubbles:true,composed:true}))),this._intersectionObserver.observe(this._videoElement),this._videoElement&&this._embed){a$3.forEach(d=>{this._videoElement?.addEventListener(d,e=>{!this._canPlay&&this.autoplay==="scroll"&&d==="canplay"&&(this._canPlay=true,g(this,i,v).call(this)),this.dispatchEvent(new CustomEvent(d,{detail:e,bubbles:true,composed:true}));});});let s={component:"clip",video_id:this._embed.video.id,space_id:this._embed.space_id};b.Metrics.config={socketPath:a$4.metrics.socket,apiKey:this._embed.metrics_key},a$4.metrics.enabled&&(this._metricsInstance=new b.Metrics(this._videoElement,this.embed,s));}this._queue.length&&(this._queue.forEach(s=>s()),this._queue=[]);},S=function(t){for(let{isIntersecting:s}of t){if(this.autoplay==="always")return;s&&(this.autoplay==="lazy"||this.autoplay==="true")?this._videoElement?.paused&&g(this,i,p).call(this):this._videoElement?.paused||this._videoElement?.pause();}},T=function(){(this.autoplay==="off"||this._failedPlay)&&(this._videoElement?.paused?g(this,i,p).call(this):this._videoElement?.pause());},r.styles=h`
|
|
24
24
|
:host {
|
|
25
25
|
display: block;
|
|
26
26
|
position: relative;
|
|
@@ -0,0 +1,379 @@
|
|
|
1
|
+
'use strict';var chunkJHSFSCC2_cjs=require('./chunk-JHSFSCC2.cjs');var ct={MEDIA_PLAY_REQUEST:"mediaplayrequest",MEDIA_PAUSE_REQUEST:"mediapauserequest",MEDIA_MUTE_REQUEST:"mediamuterequest",MEDIA_UNMUTE_REQUEST:"mediaunmuterequest",MEDIA_VOLUME_REQUEST:"mediavolumerequest",MEDIA_SEEK_REQUEST:"mediaseekrequest",MEDIA_AIRPLAY_REQUEST:"mediaairplayrequest",MEDIA_ENTER_FULLSCREEN_REQUEST:"mediaenterfullscreenrequest",MEDIA_EXIT_FULLSCREEN_REQUEST:"mediaexitfullscreenrequest",MEDIA_PREVIEW_REQUEST:"mediapreviewrequest",MEDIA_ENTER_PIP_REQUEST:"mediaenterpiprequest",MEDIA_EXIT_PIP_REQUEST:"mediaexitpiprequest",MEDIA_ENTER_CAST_REQUEST:"mediaentercastrequest",MEDIA_EXIT_CAST_REQUEST:"mediaexitcastrequest",MEDIA_SHOW_TEXT_TRACKS_REQUEST:"mediashowtexttracksrequest",MEDIA_HIDE_TEXT_TRACKS_REQUEST:"mediahidetexttracksrequest",MEDIA_SHOW_SUBTITLES_REQUEST:"mediashowsubtitlesrequest",MEDIA_DISABLE_SUBTITLES_REQUEST:"mediadisablesubtitlesrequest",MEDIA_TOGGLE_SUBTITLES_REQUEST:"mediatogglesubtitlesrequest",MEDIA_PLAYBACK_RATE_REQUEST:"mediaplaybackraterequest",MEDIA_RENDITION_REQUEST:"mediarenditionrequest",MEDIA_AUDIO_TRACK_REQUEST:"mediaaudiotrackrequest",MEDIA_SEEK_TO_LIVE_REQUEST:"mediaseektoliverequest",REGISTER_MEDIA_STATE_RECEIVER:"registermediastatereceiver",UNREGISTER_MEDIA_STATE_RECEIVER:"unregistermediastatereceiver"},E={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},Wt={MEDIA_AIRPLAY_UNAVAILABLE:"mediaAirplayUnavailable",MEDIA_AUDIO_TRACK_ENABLED:"mediaAudioTrackEnabled",MEDIA_AUDIO_TRACK_LIST:"mediaAudioTrackList",MEDIA_AUDIO_TRACK_UNAVAILABLE:"mediaAudioTrackUnavailable",MEDIA_BUFFERED:"mediaBuffered",MEDIA_CAST_UNAVAILABLE:"mediaCastUnavailable",MEDIA_CHAPTERS_CUES:"mediaChaptersCues",MEDIA_CURRENT_TIME:"mediaCurrentTime",MEDIA_DURATION:"mediaDuration",MEDIA_ENDED:"mediaEnded",MEDIA_ERROR:"mediaError",MEDIA_ERROR_CODE:"mediaErrorCode",MEDIA_ERROR_MESSAGE:"mediaErrorMessage",MEDIA_FULLSCREEN_UNAVAILABLE:"mediaFullscreenUnavailable",MEDIA_HAS_PLAYED:"mediaHasPlayed",MEDIA_HEIGHT:"mediaHeight",MEDIA_IS_AIRPLAYING:"mediaIsAirplaying",MEDIA_IS_CASTING:"mediaIsCasting",MEDIA_IS_FULLSCREEN:"mediaIsFullscreen",MEDIA_IS_PIP:"mediaIsPip",MEDIA_LOADING:"mediaLoading",MEDIA_MUTED:"mediaMuted",MEDIA_PAUSED:"mediaPaused",MEDIA_PIP_UNAVAILABLE:"mediaPipUnavailable",MEDIA_PLAYBACK_RATE:"mediaPlaybackRate",MEDIA_PREVIEW_CHAPTER:"mediaPreviewChapter",MEDIA_PREVIEW_COORDS:"mediaPreviewCoords",MEDIA_PREVIEW_IMAGE:"mediaPreviewImage",MEDIA_PREVIEW_TIME:"mediaPreviewTime",MEDIA_RENDITION_LIST:"mediaRenditionList",MEDIA_RENDITION_SELECTED:"mediaRenditionSelected",MEDIA_RENDITION_UNAVAILABLE:"mediaRenditionUnavailable",MEDIA_SEEKABLE:"mediaSeekable",MEDIA_STREAM_TYPE:"mediaStreamType",MEDIA_SUBTITLES_LIST:"mediaSubtitlesList",MEDIA_SUBTITLES_SHOWING:"mediaSubtitlesShowing",MEDIA_TARGET_LIVE_WINDOW:"mediaTargetLiveWindow",MEDIA_TIME_IS_LIVE:"mediaTimeIsLive",MEDIA_VOLUME:"mediaVolume",MEDIA_VOLUME_LEVEL:"mediaVolumeLevel",MEDIA_VOLUME_UNAVAILABLE:"mediaVolumeUnavailable",MEDIA_LANG:"mediaLang",MEDIA_WIDTH:"mediaWidth"},ut=Object.entries(Wt),K=ut.reduce((t,[e,i])=>(t[e]=i.toLowerCase(),t),{}),Bt={USER_INACTIVE_CHANGE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"},ht=ut.reduce((t,[e,i])=>(t[e]=i.toLowerCase(),t),{...Bt});Object.entries(ht).reduce((t,[e,i])=>{let o=K[e];return o&&(t[i]=o),t},{userinactivechange:"userinactive"});var ni=Object.entries(K).reduce((t,[e,i])=>{let o=ht[e];return o&&(t[i]=o),t},{userinactive:"userinactivechange"}),ai={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},ri={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var si={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},li={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},di={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var ci={INLINE:"inline",FULLSCREEN:"fullscreen",PICTURE_IN_PICTURE:"picture-in-picture"};var le=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return true}},de=class extends le{},ce=class extends de{constructor(){super(...arguments),this.role=null;}},xe=class{observe(){}unobserve(){}disconnect(){}},mt={createElement:function(){return new z.HTMLElement},createElementNS:function(){return new z.HTMLElement},addEventListener(){},removeEventListener(){},dispatchEvent(t){return false}},z={ResizeObserver:xe,document:mt,Node:de,Element:ce,HTMLElement:class extends ce{constructor(){super(...arguments),this.innerHTML="";}get content(){return new z.DocumentFragment}},DocumentFragment:class extends le{},customElements:{get:function(){},define:function(){},whenDefined:function(){}},localStorage:{getItem(t){return null},setItem(t,e){},removeItem(t){}},CustomEvent:function(){},getComputedStyle:function(){},navigator:{languages:[],get userAgent(){return ""}},matchMedia(t){return {matches:false,media:t}},DOMParser:class{parseFromString(e,i){return {body:{textContent:e}}}}},pt=typeof window>"u"||typeof window.customElements>"u",ft=Object.keys(z).every(t=>t in globalThis),u=pt&&!ft?z:globalThis,Le=pt&&!ft?mt:globalThis.document;function Et({anchor:t,floating:e,placement:i}){let o=qt({anchor:t,floating:e}),{x:n,y:a}=$t(o,i);return {x:n,y:a}}function qt({anchor:t,floating:e}){return {anchor:Vt(t,e.offsetParent),floating:{x:0,y:0,width:e.offsetWidth,height:e.offsetHeight}}}function Vt(t,e){var i;let o=t.getBoundingClientRect(),n=(i=e?.getBoundingClientRect())!=null?i:{x:0,y:0};return {x:o.x-n.x,y:o.y-n.y,width:o.width,height:o.height}}function $t({anchor:t,floating:e},i){let o=Gt(i)==="x"?"y":"x",n=o==="y"?"height":"width",a=vt(i),r=t.x+t.width/2-e.width/2,h=t.y+t.height/2-e.height/2,c=t[n]/2-e[n]/2,p;switch(a){case "top":p={x:r,y:t.y-e.height};break;case "bottom":p={x:r,y:t.y+t.height};break;case "right":p={x:t.x+t.width,y:h};break;case "left":p={x:t.x-e.width,y:h};break;default:p={x:t.x,y:t.y};}switch(i.split("-")[1]){case "start":p[o]-=c;break;case "end":p[o]+=c;break}return p}function vt(t){return t.split("-")[0]}function Gt(t){return ["top","bottom"].includes(vt(t))?"y":"x"}var gt=new WeakMap,Re=t=>{let e=gt.get(t);return e||gt.set(t,e=new Set),e},bt=new u.ResizeObserver(t=>{for(let e of t)for(let i of Re(e.target))i(e);});function Y(t,e){Re(t).add(e),bt.observe(t);}function X(t,e){let i=Re(t);i.delete(e),i.size||bt.unobserve(t);}var O=class extends Event{constructor({action:e="auto",relatedTarget:i,...o}){super("invoke",o),this.action=e,this.relatedTarget=i;}},ue=class extends Event{constructor({newState:e,oldState:i,...o}){super("toggle",o),this.newState=e,this.oldState=i;}};function P(t){let e={};for(let i of t)e[i.name]=i.value;return e}function he(t){var e;return (e=me(t))!=null?e:N(t,"media-controller")}function me(t){var e;let{MEDIA_CONTROLLER:i}=E,o=t.getAttribute(i);if(o)return (e=Z(t))==null?void 0:e.getElementById(o)}var Ai=(t,e,i=".value")=>{let o=t.querySelector(i);o&&(o.textContent=e);},Qt=(t,e)=>{let i=`slot[name="${e}"]`,o=t.shadowRoot.querySelector(i);return o?o.children:[]},Ti=(t,e)=>Qt(t,e)[0],pe=(t,e)=>!t||!e?false:t?.contains(e)?true:pe(t,e.getRootNode().host),N=(t,e)=>{if(!t)return null;let i=t.closest(e);return i||N(t.getRootNode().host,e)};function De(t=document){var e;let i=t?.activeElement;return i?(e=De(i.shadowRoot))!=null?e:i:null}function Z(t){var e;let i=(e=t?.getRootNode)==null?void 0:e.call(t);return i instanceof ShadowRoot||i instanceof Document?i:null}function _t(t,{depth:e=3,checkOpacity:i=true,checkVisibilityCSS:o=true}={}){if(t.checkVisibility)return t.checkVisibility({checkOpacity:i,checkVisibilityCSS:o});let n=t;for(;n&&e>0;){let a=getComputedStyle(n);if(i&&a.opacity==="0"||o&&a.visibility==="hidden"||a.display==="none")return false;n=n.parentElement,e--;}return true}function yi(t,e,i,o){let n=o.x-i.x,a=o.y-i.y,r=n*n+a*a;if(r===0)return 0;let h=((t-i.x)*n+(e-i.y)*a)/r;return Math.max(0,Math.min(1,h))}function At(t,e){let i=Ft(t,o=>o===e);return i||Ce(t,e)}function Ft(t,e){var i,o;let n;for(n of (i=t.querySelectorAll("style:not([media])"))!=null?i:[]){let a;try{a=(o=n.sheet)==null?void 0:o.cssRules;}catch{continue}for(let r of a??[])if(e(r.selectorText))return r}}function Ce(t,e){var i,o;let n=(i=t.querySelectorAll("style:not([media])"))!=null?i:[],a=n?.[n.length-1];return a?.sheet?(a?.sheet.insertRule(`${e}{}`,a.sheet.cssRules.length),(o=a.sheet.cssRules)==null?void 0:o[a.sheet.cssRules.length-1]):(console.warn("Media Chrome: No style sheet found on style tag of",t),{style:{setProperty:()=>{},removeProperty:()=>"",getPropertyValue:()=>""}})}function Kt(t,e,i=Number.NaN){let o=t.getAttribute(e);return o!=null?+o:i}function ki(t,e,i){let o=+i;if(i==null||Number.isNaN(o)){t.hasAttribute(e)&&t.removeAttribute(e);return}Kt(t,e,void 0)!==o&&t.setAttribute(e,`${o}`);}function fe(t,e){return t.hasAttribute(e)}function Oe(t,e,i){if(i==null){t.hasAttribute(e)&&t.removeAttribute(e);return}fe(t,e)!=i&&t.toggleAttribute(e,i);}function M(t,e,i=null){var o;return (o=t.getAttribute(e))!=null?o:i}function U(t,e,i){if(i==null){t.hasAttribute(e)&&t.removeAttribute(e);return}let o=`${i}`;M(t,e,void 0)!==o&&t.setAttribute(e,o);}var Fe=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},s=(t,e,i)=>(Fe(t,e,"read from private field"),i?i.call(t):e.get(t)),l=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i);},v=(t,e,i,o)=>(Fe(t,e,"write to private field"),e.set(t,i),i),d=(t,e,i)=>(Fe(t,e,"access private method"),i),g,L,S,Ee,ve,R,ee,Pe,Tt,_e,Ke,Ae,ge,Ne,Ue,yt,He,kt,We,St,H,W,B,te,Te,ze,Be,It,Ye,wt,qe,Mt,Xe,xt,Ve,Lt,$e,Rt,J,ye,Ge,Dt,j,ke,be,Qe;function Ct({type:t,text:e,value:i,checked:o}){let n=Le.createElement("media-chrome-menu-item");n.type=t??"",n.part.add("menu-item"),t&&n.part.add(t),n.value=i,n.checked=o;let a=Le.createElement("span");return a.textContent=e,n.append(a),n}function Ot(t,e){let i=t.querySelector(`:scope > [slot="${e}"]`);if(i?.nodeName=="SLOT"&&(i=i.assignedElements({flatten:true})[0]),i)return i=i.cloneNode(true),i;let o=t.shadowRoot.querySelector(`[name="${e}"] > svg`);return o?o.cloneNode(true):""}function zt(t){return `
|
|
2
|
+
<style>
|
|
3
|
+
:host {
|
|
4
|
+
font: var(--media-font,
|
|
5
|
+
var(--media-font-weight, normal)
|
|
6
|
+
var(--media-font-size, 14px) /
|
|
7
|
+
var(--media-text-content-height, var(--media-control-height, 24px))
|
|
8
|
+
var(--media-font-family, helvetica neue, segoe ui, roboto, arial, sans-serif));
|
|
9
|
+
color: var(--media-text-color, var(--media-primary-color, rgb(238 238 238)));
|
|
10
|
+
--_menu-bg: rgb(20 20 30 / .8);
|
|
11
|
+
background: var(--media-menu-background, var(--media-control-background, var(--media-secondary-color, var(--_menu-bg))));
|
|
12
|
+
border-radius: var(--media-menu-border-radius);
|
|
13
|
+
border: var(--media-menu-border, none);
|
|
14
|
+
display: var(--media-menu-display, inline-flex) !important;
|
|
15
|
+
|
|
16
|
+
transition: var(--media-menu-transition-in,
|
|
17
|
+
visibility 0s,
|
|
18
|
+
opacity .2s ease-out,
|
|
19
|
+
transform .15s ease-out,
|
|
20
|
+
left .2s ease-in-out,
|
|
21
|
+
min-width .2s ease-in-out,
|
|
22
|
+
min-height .2s ease-in-out
|
|
23
|
+
) !important;
|
|
24
|
+
|
|
25
|
+
visibility: var(--media-menu-visibility, visible);
|
|
26
|
+
opacity: var(--media-menu-opacity, 1);
|
|
27
|
+
max-height: var(--media-menu-max-height, var(--_menu-max-height, 300px));
|
|
28
|
+
transform: var(--media-menu-transform-in, translateY(0) scale(1));
|
|
29
|
+
flex-direction: column;
|
|
30
|
+
|
|
31
|
+
min-height: 0;
|
|
32
|
+
position: relative;
|
|
33
|
+
bottom: var(--_menu-bottom);
|
|
34
|
+
box-sizing: border-box;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@-moz-document url-prefix() {
|
|
38
|
+
:host{
|
|
39
|
+
--_menu-bg: rgb(20 20 30);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
:host([hidden]) {
|
|
44
|
+
transition: var(--media-menu-transition-out,
|
|
45
|
+
visibility .15s ease-in,
|
|
46
|
+
opacity .15s ease-in,
|
|
47
|
+
transform .15s ease-in
|
|
48
|
+
) !important;
|
|
49
|
+
visibility: var(--media-menu-hidden-visibility, hidden);
|
|
50
|
+
opacity: var(--media-menu-hidden-opacity, 0);
|
|
51
|
+
max-height: var(--media-menu-hidden-max-height,
|
|
52
|
+
var(--media-menu-max-height, var(--_menu-max-height, 300px)));
|
|
53
|
+
transform: var(--media-menu-transform-out, translateY(2px) scale(.99));
|
|
54
|
+
pointer-events: none;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
:host([slot="submenu"]) {
|
|
58
|
+
background: none;
|
|
59
|
+
width: 100%;
|
|
60
|
+
min-height: 100%;
|
|
61
|
+
position: absolute;
|
|
62
|
+
bottom: 0;
|
|
63
|
+
right: -100%;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
#container {
|
|
67
|
+
display: flex;
|
|
68
|
+
flex-direction: column;
|
|
69
|
+
min-height: 0;
|
|
70
|
+
transition: transform .2s ease-out;
|
|
71
|
+
transform: translate(0, 0);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
#container.has-expanded {
|
|
75
|
+
transition: transform .2s ease-in;
|
|
76
|
+
transform: translate(-100%, 0);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
button {
|
|
80
|
+
background: none;
|
|
81
|
+
color: inherit;
|
|
82
|
+
border: none;
|
|
83
|
+
padding: 0;
|
|
84
|
+
font: inherit;
|
|
85
|
+
outline: inherit;
|
|
86
|
+
display: inline-flex;
|
|
87
|
+
align-items: center;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
slot[name="header"][hidden] {
|
|
91
|
+
display: none;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
slot[name="header"] > *,
|
|
95
|
+
slot[name="header"]::slotted(*) {
|
|
96
|
+
padding: .4em .7em;
|
|
97
|
+
border-bottom: 1px solid rgb(255 255 255 / .25);
|
|
98
|
+
cursor: var(--media-cursor, default);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
slot[name="header"] > button[part~="back"],
|
|
102
|
+
slot[name="header"]::slotted(button[part~="back"]) {
|
|
103
|
+
cursor: var(--media-cursor, pointer);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
svg[part~="back"] {
|
|
107
|
+
height: var(--media-menu-icon-height, var(--media-control-height, 24px));
|
|
108
|
+
fill: var(--media-icon-color, var(--media-primary-color, rgb(238 238 238)));
|
|
109
|
+
display: block;
|
|
110
|
+
margin-right: .5ch;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
slot:not([name]) {
|
|
114
|
+
gap: var(--media-menu-gap);
|
|
115
|
+
flex-direction: var(--media-menu-flex-direction, column);
|
|
116
|
+
overflow: var(--media-menu-overflow, hidden auto);
|
|
117
|
+
display: flex;
|
|
118
|
+
min-height: 0;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
:host([role="menu"]) slot:not([name]) {
|
|
122
|
+
padding-block: .4em;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
slot:not([name])::slotted([role="menu"]) {
|
|
126
|
+
background: none;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
media-chrome-menu-item > span {
|
|
130
|
+
margin-right: .5ch;
|
|
131
|
+
max-width: var(--media-menu-item-max-width);
|
|
132
|
+
text-overflow: ellipsis;
|
|
133
|
+
overflow: hidden;
|
|
134
|
+
}
|
|
135
|
+
</style>
|
|
136
|
+
<style id="layout-row" media="width:0">
|
|
137
|
+
|
|
138
|
+
slot[name="header"] > *,
|
|
139
|
+
slot[name="header"]::slotted(*) {
|
|
140
|
+
padding: .4em .5em;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
slot:not([name]) {
|
|
144
|
+
gap: var(--media-menu-gap, .25em);
|
|
145
|
+
flex-direction: var(--media-menu-flex-direction, row);
|
|
146
|
+
padding-inline: .5em;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
media-chrome-menu-item {
|
|
150
|
+
padding: .3em .5em;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
media-chrome-menu-item[aria-checked="true"] {
|
|
154
|
+
background: var(--media-menu-item-checked-background, rgb(255 255 255 / .2));
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
media-chrome-menu-item::part(checked-indicator) {
|
|
159
|
+
display: var(--media-menu-item-checked-indicator-display, none);
|
|
160
|
+
}
|
|
161
|
+
</style>
|
|
162
|
+
<div id="container" part="container">
|
|
163
|
+
<slot name="header" hidden>
|
|
164
|
+
<button part="back button" aria-label="Back to previous menu">
|
|
165
|
+
<slot name="back-icon">
|
|
166
|
+
<svg aria-hidden="true" viewBox="0 0 20 24" part="back indicator">
|
|
167
|
+
<path d="m11.88 17.585.742-.669-4.2-4.665 4.2-4.666-.743-.669-4.803 5.335 4.803 5.334Z"/>
|
|
168
|
+
</svg>
|
|
169
|
+
</slot>
|
|
170
|
+
<slot name="title"></slot>
|
|
171
|
+
</button>
|
|
172
|
+
</slot>
|
|
173
|
+
<slot></slot>
|
|
174
|
+
</div>
|
|
175
|
+
<slot name="checked-indicator" hidden></slot>
|
|
176
|
+
`}var x={STYLE:"style",HIDDEN:"hidden",DISABLED:"disabled",ANCHOR:"anchor"},D=class extends u.HTMLElement{constructor(){if(super(),l(this,Pe),l(this,_e),l(this,ge),l(this,Ue),l(this,He),l(this,We),l(this,B),l(this,Te),l(this,Be),l(this,Ye),l(this,qe),l(this,Xe),l(this,Ve),l(this,$e),l(this,J),l(this,Ge),l(this,j),l(this,be),l(this,g,null),l(this,L,null),l(this,S,null),l(this,Ee,new Set),l(this,ve,void 0),l(this,R,false),l(this,ee,null),l(this,Ae,()=>{let e=s(this,Ee),i=new Set(this.items);for(let o of e)i.has(o)||this.dispatchEvent(new CustomEvent("removemenuitem",{detail:o}));for(let o of i)e.has(o)||this.dispatchEvent(new CustomEvent("addmenuitem",{detail:o}));v(this,Ee,i);}),l(this,H,()=>{d(this,B,te).call(this),d(this,Te,ze).call(this,false);}),l(this,W,()=>{d(this,B,te).call(this);}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=P(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e);}this.container=this.shadowRoot.querySelector("#container"),this.defaultSlot=this.shadowRoot.querySelector("slot:not([name])"),this.shadowRoot.addEventListener("slotchange",this),v(this,ve,new MutationObserver(s(this,Ae))),s(this,ve).observe(this.defaultSlot,{childList:true});}static get observedAttributes(){return [x.DISABLED,x.HIDDEN,x.STYLE,x.ANCHOR,E.MEDIA_CONTROLLER]}static formatMenuItemText(e,i){return e}enable(){this.addEventListener("click",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this),this.addEventListener("invoke",this),this.addEventListener("toggle",this);}disable(){this.removeEventListener("click",this),this.removeEventListener("focusout",this),this.removeEventListener("keyup",this),this.removeEventListener("invoke",this),this.removeEventListener("toggle",this);}handleEvent(e){switch(e.type){case "slotchange":d(this,Pe,Tt).call(this,e);break;case "invoke":d(this,Ue,yt).call(this,e);break;case "click":d(this,Be,It).call(this,e);break;case "toggle":d(this,qe,Mt).call(this,e);break;case "focusout":d(this,Ve,Lt).call(this,e);break;case "keydown":d(this,$e,Rt).call(this,e);break}}connectedCallback(){var e,i;v(this,ee,Ce(this.shadowRoot,":host")),d(this,ge,Ne).call(this),this.hasAttribute("disabled")||this.enable(),this.role||(this.role="menu"),v(this,g,me(this)),(i=(e=s(this,g))==null?void 0:e.associateElement)==null||i.call(e,this),this.hidden||(Y(ie(this),s(this,H)),Y(this,s(this,W))),d(this,_e,Ke).call(this);}disconnectedCallback(){var e,i;X(ie(this),s(this,H)),X(this,s(this,W)),this.disable(),(i=(e=s(this,g))==null?void 0:e.unassociateElement)==null||i.call(e,this),v(this,g,null);}attributeChangedCallback(e,i,o){var n,a,r,h;e===x.HIDDEN&&o!==i?(s(this,R)||v(this,R,true),this.hidden?d(this,We,St).call(this):d(this,He,kt).call(this),this.dispatchEvent(new ue({oldState:this.hidden?"open":"closed",newState:this.hidden?"closed":"open",bubbles:true}))):e===E.MEDIA_CONTROLLER?(i&&((a=(n=s(this,g))==null?void 0:n.unassociateElement)==null||a.call(n,this),v(this,g,null)),o&&this.isConnected&&(v(this,g,me(this)),(h=(r=s(this,g))==null?void 0:r.associateElement)==null||h.call(r,this))):e===x.DISABLED&&o!==i?o==null?this.enable():this.disable():e===x.STYLE&&o!==i&&d(this,ge,Ne).call(this);}formatMenuItemText(e,i){return this.constructor.formatMenuItemText(e,i)}get anchor(){return this.getAttribute("anchor")}set anchor(e){this.setAttribute("anchor",`${e}`);}get anchorElement(){var e;return this.anchor?(e=Z(this))==null?void 0:e.querySelector(`#${this.anchor}`):null}get items(){return this.defaultSlot.assignedElements({flatten:true}).filter(Yt)}get radioGroupItems(){return this.items.filter(e=>e.role==="menuitemradio")}get checkedItems(){return this.items.filter(e=>e.checked)}get value(){var e,i;return (i=(e=this.checkedItems[0])==null?void 0:e.value)!=null?i:""}set value(e){let i=this.items.find(o=>o.value===e);i&&d(this,be,Qe).call(this,i);}focus(){if(v(this,L,De()),this.items.length){d(this,j,ke).call(this,this.items[0]),this.items[0].focus();return}let e=this.querySelector('[autofocus], [tabindex]:not([tabindex="-1"]), [role="menu"]');e?.focus();}handleSelect(e){var i;let o=d(this,J,ye).call(this,e);o&&(d(this,be,Qe).call(this,o,o.type==="checkbox"),s(this,S)&&!this.hidden&&((i=s(this,L))==null||i.focus(),this.hidden=true));}get keysUsed(){return ["Enter","Escape","Tab"," ","ArrowDown","ArrowUp","Home","End"]}handleMove(e){var i,o;let{key:n}=e,a=this.items,r=(o=(i=d(this,J,ye).call(this,e))!=null?i:d(this,Ge,Dt).call(this))!=null?o:a[0],h=a.indexOf(r),c=Math.max(0,h);n==="ArrowDown"?c++:n==="ArrowUp"?c--:e.key==="Home"?c=0:e.key==="End"&&(c=a.length-1),c<0&&(c=a.length-1),c>a.length-1&&(c=0),d(this,j,ke).call(this,a[c]),a[c].focus();}};g=new WeakMap;L=new WeakMap;S=new WeakMap;Ee=new WeakMap;ve=new WeakMap;R=new WeakMap;ee=new WeakMap;Pe=new WeakSet;Tt=function(t){let e=t.target;for(let i of e.assignedNodes({flatten:true}))i.nodeType===3&&i.textContent.trim()===""&&i.remove();["header","title"].includes(e.name)&&d(this,_e,Ke).call(this),e.name||s(this,Ae).call(this);};_e=new WeakSet;Ke=function(){let t=this.shadowRoot.querySelector('slot[name="header"]'),e=this.shadowRoot.querySelector('slot[name="title"]');t.hidden=e.assignedNodes().length===0&&t.assignedNodes().length===0;};Ae=new WeakMap;ge=new WeakSet;Ne=function(){var t;let e=this.shadowRoot.querySelector("#layout-row"),i=(t=getComputedStyle(this).getPropertyValue("--media-menu-layout"))==null?void 0:t.trim();e.setAttribute("media",i==="row"?"":"width:0");};Ue=new WeakSet;yt=function(t){v(this,S,t.relatedTarget),pe(this,t.relatedTarget)||(this.hidden=!this.hidden);};He=new WeakSet;kt=function(){var t;(t=s(this,S))==null||t.setAttribute("aria-expanded","true"),this.addEventListener("transitionend",()=>this.focus(),{once:true}),Y(ie(this),s(this,H)),Y(this,s(this,W));};We=new WeakSet;St=function(){var t;(t=s(this,S))==null||t.setAttribute("aria-expanded","false"),X(ie(this),s(this,H)),X(this,s(this,W));};H=new WeakMap;W=new WeakMap;B=new WeakSet;te=function(t){if(this.hasAttribute("mediacontroller")&&!this.anchor||this.hidden||!this.anchorElement)return;let{x:e,y:i}=Et({anchor:this.anchorElement,floating:this,placement:"top-start"});t??(t=this.offsetWidth);let n=ie(this).getBoundingClientRect(),a=n.width-e-t,r=n.height-i-this.offsetHeight,{style:h}=s(this,ee);h.setProperty("position","absolute"),h.setProperty("right",`${Math.max(0,a)}px`),h.setProperty("--_menu-bottom",`${r}px`);let c=getComputedStyle(this),Me=h.getPropertyValue("--_menu-bottom")===c.bottom?r:parseFloat(c.bottom),se=n.height-Me-parseFloat(c.marginBottom);this.style.setProperty("--_menu-max-height",`${se}px`);};Te=new WeakSet;ze=function(t){let e=this.querySelector('[role="menuitem"][aria-haspopup][aria-expanded="true"]'),i=e?.querySelector('[role="menu"]'),{style:o}=s(this,ee);if(t||o.setProperty("--media-menu-transition-in","none"),i){let n=i.offsetHeight,a=Math.max(i.offsetWidth,e.offsetWidth);this.style.setProperty("min-width",`${a}px`),this.style.setProperty("min-height",`${n}px`),d(this,B,te).call(this,a);}else this.style.removeProperty("min-width"),this.style.removeProperty("min-height"),d(this,B,te).call(this);o.removeProperty("--media-menu-transition-in");};Be=new WeakSet;It=function(t){var e;if(t.stopPropagation(),t.composedPath().includes(s(this,Ye,wt))){(e=s(this,L))==null||e.focus(),this.hidden=true;return}let i=d(this,J,ye).call(this,t);!i||i.hasAttribute("disabled")||(d(this,j,ke).call(this,i),this.handleSelect(t));};Ye=new WeakSet;wt=function(){var t;return (t=this.shadowRoot.querySelector('slot[name="header"]').assignedElements({flatten:true}))==null?void 0:t.find(i=>i.matches('button[part~="back"]'))};qe=new WeakSet;Mt=function(t){if(t.target===this)return;d(this,Xe,xt).call(this);let e=Array.from(this.querySelectorAll('[role="menuitem"][aria-haspopup]'));for(let i of e)i.invokeTargetElement!=t.target&&t.newState=="open"&&i.getAttribute("aria-expanded")=="true"&&!i.invokeTargetElement.hidden&&i.invokeTargetElement.dispatchEvent(new O({relatedTarget:i}));for(let i of e)i.setAttribute("aria-expanded",`${!i.submenuElement.hidden}`);d(this,Te,ze).call(this,true);};Xe=new WeakSet;xt=function(){let e=this.querySelector('[role="menuitem"] > [role="menu"]:not([hidden])');this.container.classList.toggle("has-expanded",!!e);};Ve=new WeakSet;Lt=function(t){var e;pe(this,t.relatedTarget)||(s(this,R)&&((e=s(this,L))==null||e.focus()),s(this,S)&&s(this,S)!==t.relatedTarget&&!this.hidden&&(this.hidden=true));};$e=new WeakSet;Rt=function(t){var e,i,o,n,a;let{key:r,ctrlKey:h,altKey:c,metaKey:p}=t;if(!(h||c||p)&&this.keysUsed.includes(r))if(t.preventDefault(),t.stopPropagation(),r==="Tab"){if(s(this,R)){this.hidden=true;return}t.shiftKey?(i=(e=this.previousElementSibling)==null?void 0:e.focus)==null||i.call(e):(n=(o=this.nextElementSibling)==null?void 0:o.focus)==null||n.call(o),this.blur();}else r==="Escape"?((a=s(this,L))==null||a.focus(),s(this,R)&&(this.hidden=true)):r==="Enter"||r===" "?this.handleSelect(t):this.handleMove(t);};J=new WeakSet;ye=function(t){return t.composedPath().find(e=>["menuitemradio","menuitemcheckbox"].includes(e.role))};Ge=new WeakSet;Dt=function(){return this.items.find(t=>t.tabIndex===0)};j=new WeakSet;ke=function(t){for(let e of this.items)e.tabIndex=e===t?0:-1;};be=new WeakSet;Qe=function(t,e){let i=[...this.checkedItems];t.type==="radio"&&this.radioGroupItems.forEach(o=>o.checked=false),e?t.checked=!t.checked:t.checked=true,this.checkedItems.some((o,n)=>o!=i[n])&&this.dispatchEvent(new Event("change",{bubbles:true,composed:true}));};D.shadowRootOptions={mode:"open"};D.getTemplateHTML=zt;function Yt(t){return ["menuitem","menuitemradio","menuitemcheckbox"].includes(t?.role)}function ie(t){var e;return (e=t.getAttribute("bounds")?N(t,`#${t.getAttribute("bounds")}`):he(t)||t.parentElement)!=null?e:t}u.customElements.get("media-chrome-menu")||u.customElements.define("media-chrome-menu",D);var q={PLACEMENT:"placement",BOUNDS:"bounds"};function Xt(t){return `
|
|
177
|
+
<style>
|
|
178
|
+
:host {
|
|
179
|
+
--_tooltip-background-color: var(--media-tooltip-background-color, var(--media-secondary-color, rgba(20, 20, 30, .7)));
|
|
180
|
+
--_tooltip-background: var(--media-tooltip-background, var(--_tooltip-background-color));
|
|
181
|
+
--_tooltip-arrow-half-width: calc(var(--media-tooltip-arrow-width, 12px) / 2);
|
|
182
|
+
--_tooltip-arrow-height: var(--media-tooltip-arrow-height, 5px);
|
|
183
|
+
--_tooltip-arrow-background: var(--media-tooltip-arrow-color, var(--_tooltip-background-color));
|
|
184
|
+
position: relative;
|
|
185
|
+
pointer-events: none;
|
|
186
|
+
display: var(--media-tooltip-display, inline-flex);
|
|
187
|
+
justify-content: center;
|
|
188
|
+
align-items: center;
|
|
189
|
+
box-sizing: border-box;
|
|
190
|
+
z-index: var(--media-tooltip-z-index, 1);
|
|
191
|
+
background: var(--_tooltip-background);
|
|
192
|
+
color: var(--media-text-color, var(--media-primary-color, rgb(238 238 238)));
|
|
193
|
+
font: var(--media-font,
|
|
194
|
+
var(--media-font-weight, 400)
|
|
195
|
+
var(--media-font-size, 13px) /
|
|
196
|
+
var(--media-text-content-height, var(--media-control-height, 18px))
|
|
197
|
+
var(--media-font-family, helvetica neue, segoe ui, roboto, arial, sans-serif));
|
|
198
|
+
padding: var(--media-tooltip-padding, .35em .7em);
|
|
199
|
+
border: var(--media-tooltip-border, none);
|
|
200
|
+
border-radius: var(--media-tooltip-border-radius, 5px);
|
|
201
|
+
filter: var(--media-tooltip-filter, drop-shadow(0 0 4px rgba(0, 0, 0, .2)));
|
|
202
|
+
white-space: var(--media-tooltip-white-space, nowrap);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
:host([hidden]) {
|
|
206
|
+
display: none;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
img, svg {
|
|
210
|
+
display: inline-block;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
#arrow {
|
|
214
|
+
position: absolute;
|
|
215
|
+
width: 0px;
|
|
216
|
+
height: 0px;
|
|
217
|
+
border-style: solid;
|
|
218
|
+
display: var(--media-tooltip-arrow-display, block);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
:host(:not([placement])),
|
|
222
|
+
:host([placement="top"]) {
|
|
223
|
+
position: absolute;
|
|
224
|
+
bottom: calc(100% + var(--media-tooltip-distance, 12px));
|
|
225
|
+
left: 50%;
|
|
226
|
+
transform: translate(calc(-50% - var(--media-tooltip-offset-x, 0px)), 0);
|
|
227
|
+
}
|
|
228
|
+
:host(:not([placement])) #arrow,
|
|
229
|
+
:host([placement="top"]) #arrow {
|
|
230
|
+
top: 100%;
|
|
231
|
+
left: 50%;
|
|
232
|
+
border-width: var(--_tooltip-arrow-height) var(--_tooltip-arrow-half-width) 0 var(--_tooltip-arrow-half-width);
|
|
233
|
+
border-color: var(--_tooltip-arrow-background) transparent transparent transparent;
|
|
234
|
+
transform: translate(calc(-50% + var(--media-tooltip-offset-x, 0px)), 0);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
:host([placement="right"]) {
|
|
238
|
+
position: absolute;
|
|
239
|
+
left: calc(100% + var(--media-tooltip-distance, 12px));
|
|
240
|
+
top: 50%;
|
|
241
|
+
transform: translate(0, -50%);
|
|
242
|
+
}
|
|
243
|
+
:host([placement="right"]) #arrow {
|
|
244
|
+
top: 50%;
|
|
245
|
+
right: 100%;
|
|
246
|
+
border-width: var(--_tooltip-arrow-half-width) var(--_tooltip-arrow-height) var(--_tooltip-arrow-half-width) 0;
|
|
247
|
+
border-color: transparent var(--_tooltip-arrow-background) transparent transparent;
|
|
248
|
+
transform: translate(0, -50%);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
:host([placement="bottom"]) {
|
|
252
|
+
position: absolute;
|
|
253
|
+
top: calc(100% + var(--media-tooltip-distance, 12px));
|
|
254
|
+
left: 50%;
|
|
255
|
+
transform: translate(calc(-50% - var(--media-tooltip-offset-x, 0px)), 0);
|
|
256
|
+
}
|
|
257
|
+
:host([placement="bottom"]) #arrow {
|
|
258
|
+
bottom: 100%;
|
|
259
|
+
left: 50%;
|
|
260
|
+
border-width: 0 var(--_tooltip-arrow-half-width) var(--_tooltip-arrow-height) var(--_tooltip-arrow-half-width);
|
|
261
|
+
border-color: transparent transparent var(--_tooltip-arrow-background) transparent;
|
|
262
|
+
transform: translate(calc(-50% + var(--media-tooltip-offset-x, 0px)), 0);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
:host([placement="left"]) {
|
|
266
|
+
position: absolute;
|
|
267
|
+
right: calc(100% + var(--media-tooltip-distance, 12px));
|
|
268
|
+
top: 50%;
|
|
269
|
+
transform: translate(0, -50%);
|
|
270
|
+
}
|
|
271
|
+
:host([placement="left"]) #arrow {
|
|
272
|
+
top: 50%;
|
|
273
|
+
left: 100%;
|
|
274
|
+
border-width: var(--_tooltip-arrow-half-width) 0 var(--_tooltip-arrow-half-width) var(--_tooltip-arrow-height);
|
|
275
|
+
border-color: transparent transparent transparent var(--_tooltip-arrow-background);
|
|
276
|
+
transform: translate(0, -50%);
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
:host([placement="none"]) #arrow {
|
|
280
|
+
display: none;
|
|
281
|
+
}
|
|
282
|
+
</style>
|
|
283
|
+
<slot></slot>
|
|
284
|
+
<div id="arrow"></div>
|
|
285
|
+
`}var V=class extends u.HTMLElement{constructor(){if(super(),this.updateXOffset=()=>{var e;if(!_t(this,{checkOpacity:false,checkVisibilityCSS:false}))return;let i=this.placement;if(i==="left"||i==="right"){this.style.removeProperty("--media-tooltip-offset-x");return}let o=getComputedStyle(this),n=(e=N(this,"#"+this.bounds))!=null?e:he(this);if(!n)return;let{x:a,width:r}=n.getBoundingClientRect(),{x:h,width:c}=this.getBoundingClientRect(),p=h+c,Me=a+r,se=o.getPropertyValue("--media-tooltip-offset-x"),at=se?parseFloat(se.replace("px","")):0,rt=o.getPropertyValue("--media-tooltip-container-margin"),st=rt?parseFloat(rt.replace("px","")):0,lt=h-a+at-st,dt=p-Me+at+st;if(lt<0){this.style.setProperty("--media-tooltip-offset-x",`${lt}px`);return}if(dt>0){this.style.setProperty("--media-tooltip-offset-x",`${dt}px`);return}this.style.removeProperty("--media-tooltip-offset-x");},!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=P(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e);}if(this.arrowEl=this.shadowRoot.querySelector("#arrow"),Object.prototype.hasOwnProperty.call(this,"placement")){let e=this.placement;delete this.placement,this.placement=e;}}static get observedAttributes(){return [q.PLACEMENT,q.BOUNDS]}get placement(){return M(this,q.PLACEMENT)}set placement(e){U(this,q.PLACEMENT,e);}get bounds(){return M(this,q.BOUNDS)}set bounds(e){U(this,q.BOUNDS,e);}};V.shadowRootOptions={mode:"open"};V.getTemplateHTML=Xt;u.customElements.get("media-tooltip")||u.customElements.define("media-tooltip",V);var Ze=V;var je=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},m=(t,e,i)=>(je(t,e,"read from private field"),i?i.call(t):e.get(t)),$=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i);},Se=(t,e,i,o)=>(je(t,e,"write to private field"),e.set(t,i),i),Zt=(t,e,i)=>(je(t,e,"access private method"),i),b,Q,w,G,Ie,Je,Pt,I={TOOLTIP_PLACEMENT:"tooltipplacement",DISABLED:"disabled",NO_TOOLTIP:"notooltip"};function Jt(t,e={}){return `
|
|
286
|
+
<style>
|
|
287
|
+
:host {
|
|
288
|
+
position: relative;
|
|
289
|
+
font: var(--media-font,
|
|
290
|
+
var(--media-font-weight, bold)
|
|
291
|
+
var(--media-font-size, 14px) /
|
|
292
|
+
var(--media-text-content-height, var(--media-control-height, 24px))
|
|
293
|
+
var(--media-font-family, helvetica neue, segoe ui, roboto, arial, sans-serif));
|
|
294
|
+
color: var(--media-text-color, var(--media-primary-color, rgb(238 238 238)));
|
|
295
|
+
background: var(--media-control-background, var(--media-secondary-color, rgb(20 20 30 / .7)));
|
|
296
|
+
padding: var(--media-button-padding, var(--media-control-padding, 10px));
|
|
297
|
+
justify-content: var(--media-button-justify-content, center);
|
|
298
|
+
display: inline-flex;
|
|
299
|
+
align-items: center;
|
|
300
|
+
vertical-align: middle;
|
|
301
|
+
box-sizing: border-box;
|
|
302
|
+
transition: background .15s linear;
|
|
303
|
+
pointer-events: auto;
|
|
304
|
+
cursor: var(--media-cursor, pointer);
|
|
305
|
+
-webkit-tap-highlight-color: transparent;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
:host(:focus-visible) {
|
|
310
|
+
box-shadow: var(--media-focus-box-shadow, inset 0 0 0 2px rgb(27 127 204 / .9));
|
|
311
|
+
outline: 0;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
:host(:where(:focus)) {
|
|
315
|
+
box-shadow: none;
|
|
316
|
+
outline: 0;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
:host(:hover) {
|
|
320
|
+
background: var(--media-control-hover-background, rgba(50 50 70 / .7));
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
svg, img, ::slotted(svg), ::slotted(img) {
|
|
324
|
+
width: var(--media-button-icon-width);
|
|
325
|
+
height: var(--media-button-icon-height, var(--media-control-height, 24px));
|
|
326
|
+
transform: var(--media-button-icon-transform);
|
|
327
|
+
transition: var(--media-button-icon-transition);
|
|
328
|
+
fill: var(--media-icon-color, var(--media-primary-color, rgb(238 238 238)));
|
|
329
|
+
vertical-align: middle;
|
|
330
|
+
max-width: 100%;
|
|
331
|
+
max-height: 100%;
|
|
332
|
+
min-width: 100%;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
media-tooltip {
|
|
336
|
+
|
|
337
|
+
max-width: 0;
|
|
338
|
+
overflow-x: clip;
|
|
339
|
+
opacity: 0;
|
|
340
|
+
transition: opacity .3s, max-width 0s 9s;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
:host(:hover) media-tooltip,
|
|
344
|
+
:host(:focus-visible) media-tooltip {
|
|
345
|
+
max-width: 100vw;
|
|
346
|
+
opacity: 1;
|
|
347
|
+
transition: opacity .3s;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
:host([notooltip]) slot[name="tooltip"] {
|
|
351
|
+
display: none;
|
|
352
|
+
}
|
|
353
|
+
</style>
|
|
354
|
+
|
|
355
|
+
${this.getSlotTemplateHTML(t,e)}
|
|
356
|
+
|
|
357
|
+
<slot name="tooltip">
|
|
358
|
+
<media-tooltip part="tooltip" aria-hidden="true">
|
|
359
|
+
<template shadowrootmode="${Ze.shadowRootOptions.mode}">
|
|
360
|
+
${Ze.getTemplateHTML({})}
|
|
361
|
+
</template>
|
|
362
|
+
<slot name="tooltip-content">
|
|
363
|
+
${this.getTooltipContentHTML(t)}
|
|
364
|
+
</slot>
|
|
365
|
+
</media-tooltip>
|
|
366
|
+
</slot>
|
|
367
|
+
`}function jt(t,e){return `
|
|
368
|
+
<slot></slot>
|
|
369
|
+
`}function ei(){return ""}var T=class extends u.HTMLElement{constructor(){if(super(),$(this,Je),$(this,b,void 0),this.preventClick=false,this.tooltipEl=null,$(this,Q,e=>{this.preventClick||this.handleClick(e),setTimeout(m(this,w),0);}),$(this,w,()=>{var e,i;(i=(e=this.tooltipEl)==null?void 0:e.updateXOffset)==null||i.call(e);}),$(this,G,e=>{let{key:i}=e;if(!this.keysUsed.includes(i)){this.removeEventListener("keyup",m(this,G));return}this.preventClick||this.handleClick(e);}),$(this,Ie,e=>{let{metaKey:i,altKey:o,key:n}=e;if(i||o||!this.keysUsed.includes(n)){this.removeEventListener("keyup",m(this,G));return}this.addEventListener("keyup",m(this,G),{once:true});}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=P(this.attributes),i=this.constructor.getTemplateHTML(e);this.shadowRoot.setHTMLUnsafe?this.shadowRoot.setHTMLUnsafe(i):this.shadowRoot.innerHTML=i;}this.tooltipEl=this.shadowRoot.querySelector("media-tooltip");}static get observedAttributes(){return ["disabled",I.TOOLTIP_PLACEMENT,E.MEDIA_CONTROLLER,K.MEDIA_LANG]}enable(){this.addEventListener("click",m(this,Q)),this.addEventListener("keydown",m(this,Ie)),this.tabIndex=0;}disable(){this.removeEventListener("click",m(this,Q)),this.removeEventListener("keydown",m(this,Ie)),this.removeEventListener("keyup",m(this,G)),this.tabIndex=-1;}attributeChangedCallback(e,i,o){var n,a,r,h,c;e===E.MEDIA_CONTROLLER?(i&&((a=(n=m(this,b))==null?void 0:n.unassociateElement)==null||a.call(n,this),Se(this,b,null)),o&&this.isConnected&&(Se(this,b,(r=this.getRootNode())==null?void 0:r.getElementById(o)),(c=(h=m(this,b))==null?void 0:h.associateElement)==null||c.call(h,this))):e==="disabled"&&o!==i?o==null?this.enable():this.disable():e===I.TOOLTIP_PLACEMENT&&this.tooltipEl&&o!==i?this.tooltipEl.placement=o:e===K.MEDIA_LANG&&(this.shadowRoot.querySelector('slot[name="tooltip-content"]').innerHTML=this.constructor.getTooltipContentHTML()),m(this,w).call(this);}connectedCallback(){var e,i,o;let{style:n}=At(this.shadowRoot,":host");n.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),this.hasAttribute("disabled")?this.disable():this.enable(),this.setAttribute("role","button");let a=this.getAttribute(E.MEDIA_CONTROLLER);a&&(Se(this,b,(e=this.getRootNode())==null?void 0:e.getElementById(a)),(o=(i=m(this,b))==null?void 0:i.associateElement)==null||o.call(i,this)),u.customElements.whenDefined("media-tooltip").then(()=>Zt(this,Je,Pt).call(this));}disconnectedCallback(){var e,i;this.disable(),(i=(e=m(this,b))==null?void 0:e.unassociateElement)==null||i.call(e,this),Se(this,b,null),this.removeEventListener("mouseenter",m(this,w)),this.removeEventListener("focus",m(this,w)),this.removeEventListener("click",m(this,Q));}get keysUsed(){return ["Enter"," "]}get tooltipPlacement(){return M(this,I.TOOLTIP_PLACEMENT)}set tooltipPlacement(e){U(this,I.TOOLTIP_PLACEMENT,e);}get mediaController(){return M(this,E.MEDIA_CONTROLLER)}set mediaController(e){U(this,E.MEDIA_CONTROLLER,e);}get disabled(){return fe(this,I.DISABLED)}set disabled(e){Oe(this,I.DISABLED,e);}get noTooltip(){return fe(this,I.NO_TOOLTIP)}set noTooltip(e){Oe(this,I.NO_TOOLTIP,e);}handleClick(e){}};b=new WeakMap;Q=new WeakMap;w=new WeakMap;G=new WeakMap;Ie=new WeakMap;Je=new WeakSet;Pt=function(){this.addEventListener("mouseenter",m(this,w)),this.addEventListener("focus",m(this,w)),this.addEventListener("click",m(this,Q));let t=this.tooltipPlacement;t&&this.tooltipEl&&(this.tooltipEl.placement=t);};T.shadowRootOptions={mode:"open"};T.getTemplateHTML=Jt;T.getSlotTemplateHTML=jt;T.getTooltipContentHTML=ei;u.customElements.get("media-chrome-button")||u.customElements.define("media-chrome-button",T);var oe=class extends T{connectedCallback(){super.connectedCallback(),this.invokeTargetElement&&this.setAttribute("aria-haspopup","menu");}get invokeTarget(){return this.getAttribute("invoketarget")}set invokeTarget(e){this.setAttribute("invoketarget",`${e}`);}get invokeTargetElement(){var e;return this.invokeTarget?(e=Z(this))==null?void 0:e.querySelector(`#${this.invokeTarget}`):null}handleClick(){var e;(e=this.invokeTargetElement)==null||e.dispatchEvent(new O({relatedTarget:this}));}};u.customElements.get("media-chrome-menu-button")||u.customElements.define("media-chrome-menu-button",oe);var Nt={"Start airplay":"Start airplay","Stop airplay":"Stop airplay",Audio:"Audio",Captions:"Captions","Enable captions":"Enable captions","Disable captions":"Disable captions","Start casting":"Start casting","Stop casting":"Stop casting","Enter fullscreen mode":"Enter fullscreen mode","Exit fullscreen mode":"Exit fullscreen mode",Mute:"Mute",Unmute:"Unmute","Enter picture in picture mode":"Enter picture in picture mode","Exit picture in picture mode":"Exit picture in picture mode",Play:"Play",Pause:"Pause","Playback rate":"Playback rate","Playback rate {playbackRate}":"Playback rate {playbackRate}",Quality:"Quality","Seek backward":"Seek backward","Seek forward":"Seek forward",Settings:"Settings",Auto:"Auto","audio player":"audio player","video player":"video player",volume:"volume",seek:"seek","closed captions":"closed captions","current playback rate":"current playback rate","playback time":"playback time","media loading":"media loading",settings:"settings","audio tracks":"audio tracks",quality:"quality",play:"play",pause:"pause",mute:"mute",unmute:"unmute","chapter: {chapterName}":"chapter: {chapterName}",live:"live",Off:"Off","start airplay":"start airplay","stop airplay":"stop airplay","start casting":"start casting","stop casting":"stop casting","enter fullscreen mode":"enter fullscreen mode","exit fullscreen mode":"exit fullscreen mode","enter picture in picture mode":"enter picture in picture mode","exit picture in picture mode":"exit picture in picture mode","seek to live":"seek to live","playing live":"playing live","seek back {seekOffset} seconds":"seek back {seekOffset} seconds","seek forward {seekOffset} seconds":"seek forward {seekOffset} seconds","Network Error":"Network Error","Decode Error":"Decode Error","Source Not Supported":"Source Not Supported","Encryption Error":"Encryption Error","A network error caused the media download to fail.":"A network error caused the media download to fail.","A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.":"A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.","An unsupported error occurred. The server or network failed, or your browser does not support this format.":"An unsupported error occurred. The server or network failed, or your browser does not support this format.","The media is encrypted and there are no keys to decrypt it.":"The media is encrypted and there are no keys to decrypt it."};var Ut,et={en:Nt},tt=((Ut=globalThis.navigator)==null?void 0:Ut.language)||"en",zi=t=>{tt=t;};var ti=t=>{var e,i,o;let[n]=tt.split("-");return ((e=et[tt])==null?void 0:e[t])||((i=et[n])==null?void 0:i[t])||((o=et.en)==null?void 0:o[t])||t},it=(t,e={})=>ti(t).replace(/\{(\w+)\}/g,(i,o)=>o in e?String(e[o]):`{${o}}`);var ii=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
370
|
+
<path d="M11 17H9.5V7H11v10Zm-3-3H6.5v-4H8v4Zm6-5h-1.5v6H14V9Zm3 7h-1.5V8H17v8Z"/>
|
|
371
|
+
<path d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Zm-2 0a8 8 0 1 0-16 0 8 8 0 0 0 16 0Z"/>
|
|
372
|
+
</svg>`,y,_,A,nt,ne,re,ot=class extends D{constructor(){super(...arguments);chunkJHSFSCC2_cjs.e(this,A);chunkJHSFSCC2_cjs.e(this,y,[]);chunkJHSFSCC2_cjs.e(this,_);chunkJHSFSCC2_cjs.e(this,re,()=>{let i=this.value??chunkJHSFSCC2_cjs.d(this,_);i!=null&&(chunkJHSFSCC2_cjs.f(this,_,String(i)),this.dispatchEvent(new u.CustomEvent(ct.MEDIA_AUDIO_TRACK_REQUEST,{detail:chunkJHSFSCC2_cjs.d(this,_),composed:true,bubbles:true})),chunkJHSFSCC2_cjs.g(this,A,ne).call(this));});}get tracks(){return chunkJHSFSCC2_cjs.d(this,y)}set tracks(i){chunkJHSFSCC2_cjs.f(this,y,[...i??[]]),chunkJHSFSCC2_cjs.g(this,A,nt).call(this);}get selected(){return chunkJHSFSCC2_cjs.d(this,_)}set selected(i){chunkJHSFSCC2_cjs.f(this,_,i??void 0),chunkJHSFSCC2_cjs.g(this,A,ne).call(this);}connectedCallback(){super.connectedCallback(),this.addEventListener("change",chunkJHSFSCC2_cjs.d(this,re)),chunkJHSFSCC2_cjs.g(this,A,nt).call(this),chunkJHSFSCC2_cjs.g(this,A,ne).call(this);}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",chunkJHSFSCC2_cjs.d(this,re));}};y=new WeakMap,_=new WeakMap,A=new WeakSet,nt=function(){let i=this.defaultSlot;if(i){i.textContent="";for(let o of chunkJHSFSCC2_cjs.d(this,y)){let n=Ct({type:"radio",text:o.label??o.language??"",value:o.id,checked:!!o.enabled});n.prepend(Ot(this,"checked-indicator")),i.append(n);}chunkJHSFSCC2_cjs.g(this,A,ne).call(this);}},ne=function(){let i=chunkJHSFSCC2_cjs.d(this,y).find(r=>r.enabled)??(chunkJHSFSCC2_cjs.d(this,y).length?chunkJHSFSCC2_cjs.d(this,y)[0]:void 0),o=chunkJHSFSCC2_cjs.d(this,_)??i?.id;chunkJHSFSCC2_cjs.f(this,_,o);let a=this.defaultSlot?.querySelectorAll("media-chrome-menu-item")??this.querySelectorAll("media-chrome-menu-item");for(let r of Array.from(a))"checked"in r&&"value"in r&&(r.checked=r.value===o);o!=null?this.value=o:(this.value="",this.removeAttribute("value"));},re=new WeakMap;var we,Ht,ae=class extends oe{constructor(){super(...arguments);chunkJHSFSCC2_cjs.e(this,we);}connectedCallback(){super.connectedCallback(),chunkJHSFSCC2_cjs.g(this,we,Ht).call(this);}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:this.closest("media-controller, mave-player")?.querySelector("mave-audio-track-menu")??null}};we=new WeakSet,Ht=function(){let i=it("Audio");this.setAttribute("aria-label",i);},ae.getSlotTemplateHTML=()=>`
|
|
373
|
+
<style>
|
|
374
|
+
:host([aria-expanded="true"]) slot[name='tooltip'] {
|
|
375
|
+
display: none;
|
|
376
|
+
}
|
|
377
|
+
</style>
|
|
378
|
+
<slot name="icon">${ii}</slot>
|
|
379
|
+
`,ae.getTooltipContentHTML=()=>it("Audio");u.customElements.get("mave-audio-track-menu")||u.customElements.define("mave-audio-track-menu",ot);u.customElements.get("mave-audio-track-menu-button")||u.customElements.define("mave-audio-track-menu-button",ae);exports.A=_t;exports.B=yi;exports.C=At;exports.D=Kt;exports.E=ki;exports.F=fe;exports.G=Oe;exports.H=M;exports.I=U;exports.J=T;exports.K=O;exports.L=Ct;exports.M=Ot;exports.N=D;exports.O=oe;exports.P=ot;exports.Q=ae;exports.a=ct;exports.b=E;exports.c=Wt;exports.d=K;exports.e=ht;exports.f=ni;exports.g=ai;exports.h=ri;exports.i=si;exports.j=li;exports.k=di;exports.l=ci;exports.m=zi;exports.n=it;exports.o=u;exports.p=Le;exports.q=Y;exports.r=X;exports.s=P;exports.t=he;exports.u=Ai;exports.v=Ti;exports.w=pe;exports.x=N;exports.y=De;exports.z=Z;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var chunkFUBUUA7Y_cjs=require('./chunk-FUBUUA7Y.cjs'),chunk5NSCV6C2_cjs=require('./chunk-5NSCV6C2.cjs'),chunk5STN56TL_cjs=require('./chunk-5STN56TL.cjs'),
|
|
1
|
+
'use strict';var chunkFUBUUA7Y_cjs=require('./chunk-FUBUUA7Y.cjs'),chunk5NSCV6C2_cjs=require('./chunk-5NSCV6C2.cjs'),chunk5STN56TL_cjs=require('./chunk-5STN56TL.cjs'),chunkJHSFSCC2_cjs=require('./chunk-JHSFSCC2.cjs');var s=class extends chunk5NSCV6C2_cjs.i{constructor(){super(...arguments);this.EVENT_TYPES={CLICK:"user_click"};}get embed(){return this._embed}set embed(t){this._embed=t;}get embedId(){return this._embed?.substring(5,this._embed?.length)}get spaceId(){return this.embed?.substring(0,5)}get cdn_root(){return chunk5STN56TL_cjs.a.cdn.endpoint.replace("${this.spaceId}",this.spaceId)}get _stylesheets(){if(typeof document>"u")return chunk5NSCV6C2_cjs.c``;let t=document.querySelectorAll('style, link[rel="stylesheet"]');return chunk5NSCV6C2_cjs.c`${Array.from(t).map(e=>e.cloneNode(true))}`}durationToTime(t){let e=Math.floor(t),n=Math.floor(e/3600),i=Math.floor(e%3600/60),o=e%60;return n>0?`${n}:${i.toString().padStart(2,"0")}:${o.toString().padStart(2,"0")}`:`${i}:${o.toString().padStart(2,"0")}`}emit(t,e){this.dispatchEvent(new CustomEvent(`mave:${t}`,{detail:{...e,eventType:t}})),this.dispatchEvent(new CustomEvent("mave:*",{detail:{...e,eventType:t}}));}};chunkJHSFSCC2_cjs.c([chunkFUBUUA7Y_cjs.a({type:String})],s.prototype,"embed",1);exports.a=s;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
'use strict';var chunk5STN56TL_cjs=require('./chunk-5STN56TL.cjs');var
|
|
2
|
-
`),()=>this.onerror("timeout"),t=>{this.awaitingBatchAck=false,!t||t.status!==200?(this.onerror(t&&t.status),this.closeAndRetry(1011,"internal server error",false)):this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[]);});}close(e,t,i){for(let n of this.reqs)n.abort();this.readyState=f.closed;let s=Object.assign({code:1e3,reason:void 0,wasClean:true},{code:e,reason:t,wasClean:i});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<"u"?this.onclose(new CloseEvent("close",s)):this.onclose(s);}ajax(e,t,i,s,n){let r,h=()=>{this.reqs.delete(r),s();};r=E.request(e,this.endpointURL(),t,i,this.timeout,h,o=>{this.reqs.delete(r),this.isActive()&&n(o);}),this.reqs.add(r);}};var b={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(e,t){if(e.payload.constructor===ArrayBuffer)return t(this.binaryEncode(e));{let i=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(i))}},decode(e,t){if(e.constructor===ArrayBuffer)return t(this.binaryDecode(e));{let[i,s,n,r,h]=JSON.parse(e);return t({join_ref:i,ref:s,topic:n,event:r,payload:h})}},binaryEncode(e){let{join_ref:t,ref:i,event:s,topic:n,payload:r}=e,h=this.META_LENGTH+t.length+i.length+n.length+s.length,o=new ArrayBuffer(this.HEADER_LENGTH+h),a=new DataView(o),l=0;a.setUint8(l++,this.KINDS.push),a.setUint8(l++,t.length),a.setUint8(l++,i.length),a.setUint8(l++,n.length),a.setUint8(l++,s.length),Array.from(t,u=>a.setUint8(l++,u.charCodeAt(0))),Array.from(i,u=>a.setUint8(l++,u.charCodeAt(0))),Array.from(n,u=>a.setUint8(l++,u.charCodeAt(0))),Array.from(s,u=>a.setUint8(l++,u.charCodeAt(0)));var p=new Uint8Array(o.byteLength+r.byteLength);return p.set(new Uint8Array(o),0),p.set(new Uint8Array(r),o.byteLength),p.buffer},binaryDecode(e){let t=new DataView(e),i=t.getUint8(0),s=new TextDecoder;switch(i){case this.KINDS.push:return this.decodePush(e,t,s);case this.KINDS.reply:return this.decodeReply(e,t,s);case this.KINDS.broadcast:return this.decodeBroadcast(e,t,s)}},decodePush(e,t,i){let s=t.getUint8(1),n=t.getUint8(2),r=t.getUint8(3),h=this.HEADER_LENGTH+this.META_LENGTH-1,o=i.decode(e.slice(h,h+s));h=h+s;let a=i.decode(e.slice(h,h+n));h=h+n;let l=i.decode(e.slice(h,h+r));h=h+r;let p=e.slice(h,e.byteLength);return {join_ref:o,ref:null,topic:a,event:l,payload:p}},decodeReply(e,t,i){let s=t.getUint8(1),n=t.getUint8(2),r=t.getUint8(3),h=t.getUint8(4),o=this.HEADER_LENGTH+this.META_LENGTH,a=i.decode(e.slice(o,o+s));o=o+s;let l=i.decode(e.slice(o,o+n));o=o+n;let p=i.decode(e.slice(o,o+r));o=o+r;let u=i.decode(e.slice(o,o+h));o=o+h;let w=e.slice(o,e.byteLength),A={status:u,response:w};return {join_ref:a,ref:l,topic:p,event:d.reply,payload:A}},decodeBroadcast(e,t,i){let s=t.getUint8(1),n=t.getUint8(2),r=this.HEADER_LENGTH+2,h=i.decode(e.slice(r,r+s));r=r+s;let o=i.decode(e.slice(r,r+n));r=r+n;let a=e.slice(r,e.byteLength);return {join_ref:null,ref:null,topic:h,event:o,payload:a}}},j=class{constructor(e,t={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.timeout=t.timeout||H,this.transport=t.transport||g.WebSocket||m,this.primaryPassedHealthCheck=false,this.longPollFallbackMs=t.longPollFallbackMs,this.fallbackTimer=null,this.sessionStore=t.sessionStorage||g&&g.sessionStorage,this.establishedConnections=0,this.defaultEncoder=b.encode.bind(b),this.defaultDecoder=b.decode.bind(b),this.closeWasClean=false,this.disconnecting=false,this.binaryType=t.binaryType||"arraybuffer",this.connectClock=1,this.transport!==m?(this.encode=t.encode||this.defaultEncoder,this.decode=t.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let i=null;T&&T.addEventListener&&(T.addEventListener("pagehide",s=>{this.conn&&(this.disconnect(),i=this.connectClock);}),T.addEventListener("pageshow",s=>{i===this.connectClock&&(i=null,this.connect());})),this.heartbeatIntervalMs=t.heartbeatIntervalMs||3e4,this.rejoinAfterMs=s=>t.rejoinAfterMs?t.rejoinAfterMs(s):[1e3,2e3,5e3][s-1]||1e4,this.reconnectAfterMs=s=>t.reconnectAfterMs?t.reconnectAfterMs(s):[10,50,100,150,200,250,500,1e3,2e3][s-1]||5e3,this.logger=t.logger||null,!this.logger&&t.debug&&(this.logger=(s,n,r)=>{console.log(`${s}: ${n}`,r);}),this.longpollerTimeout=t.longpollerTimeout||2e4,this.params=v(t.params||{}),this.endPoint=`${e}/${k.websocket}`,this.vsn=t.vsn||P,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new S(()=>{this.teardown(()=>this.connect());},this.reconnectAfterMs);}getLongPollTransport(){return m}replaceTransport(e){this.connectClock++,this.closeWasClean=true,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=e;}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let e=E.appendParams(E.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return e.charAt(0)!=="/"?e:e.charAt(1)==="/"?`${this.protocol()}:${e}`:`${this.protocol()}://${location.host}${e}`}disconnect(e,t,i){this.connectClock++,this.disconnecting=true,this.closeWasClean=true,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=false,e&&e();},t,i);}connect(e){e&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=v(e)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==m?this.connectWithFallback(m,this.longPollFallbackMs):this.transportConnect());}log(e,t,i){this.logger&&this.logger(e,t,i);}hasLogger(){return this.logger!==null}onOpen(e){let t=this.makeRef();return this.stateChangeCallbacks.open.push([t,e]),t}onClose(e){let t=this.makeRef();return this.stateChangeCallbacks.close.push([t,e]),t}onError(e){let t=this.makeRef();return this.stateChangeCallbacks.error.push([t,e]),t}onMessage(e){let t=this.makeRef();return this.stateChangeCallbacks.message.push([t,e]),t}ping(e){if(!this.isConnected())return false;let t=this.makeRef(),i=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:t});let s=this.onMessage(n=>{n.ref===t&&(this.off([s]),e(Date.now()-i));});return true}transportConnect(){this.connectClock++,this.closeWasClean=false,this.conn=new this.transport(this.endPointURL()),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=e=>this.onConnError(e),this.conn.onmessage=e=>this.onConnMessage(e),this.conn.onclose=e=>this.onConnClose(e);}getSession(e){return this.sessionStore&&this.sessionStore.getItem(e)}storeSession(e,t){this.sessionStore&&this.sessionStore.setItem(e,t);}connectWithFallback(e,t=2500){clearTimeout(this.fallbackTimer);let i=false,s=true,n,r,h=o=>{this.log("transport",`falling back to ${e.name}...`,o),this.off([n,r]),s=false,this.replaceTransport(e),this.transportConnect();};if(this.getSession(`phx:fallback:${e.name}`))return h("memorized");this.fallbackTimer=setTimeout(h,t),r=this.onError(o=>{this.log("transport","error",o),s&&!i&&(clearTimeout(this.fallbackTimer),h(o));}),this.onOpen(()=>{if(i=true,!s)return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${e.name}`,"true"),this.log("transport",`established ${e.name} fallback`);clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(h,t),this.ping(o=>{this.log("transport","connected to primary after",o),this.primaryPassedHealthCheck=true,clearTimeout(this.fallbackTimer);});}),this.transportConnect();}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer);}onConnOpen(){this.hasLogger()&&this.log("transport",`${this.transport.name} connected to ${this.endPointURL()}`),this.closeWasClean=false,this.disconnecting=false,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.resetHeartbeat(),this.stateChangeCallbacks.open.forEach(([,e])=>e());}heartbeatTimeout(){this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection"),this.triggerChanError(),this.closeWasClean=false,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),B,"heartbeat timeout"));}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs));}teardown(e,t,i){if(!this.conn)return e&&e();let s=this.connectClock;this.waitForBufferDone(()=>{s===this.connectClock&&(this.conn&&(t?this.conn.close(t,i||""):this.conn.close()),this.waitForSocketClosed(()=>{s===this.connectClock&&(this.conn&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),e&&e());}));});}waitForBufferDone(e,t=1){if(t===5||!this.conn||!this.conn.bufferedAmount){e();return}setTimeout(()=>{this.waitForBufferDone(e,t+1);},150*t);}waitForSocketClosed(e,t=1){if(t===5||!this.conn||this.conn.readyState===f.closed){e();return}setTimeout(()=>{this.waitForSocketClosed(e,t+1);},150*t);}onConnClose(e){let t=e&&e.code;this.hasLogger()&&this.log("transport","close",e),this.triggerChanError(),this.clearHeartbeats(),!this.closeWasClean&&t!==1e3&&this.reconnectTimer.scheduleTimeout(),this.stateChangeCallbacks.close.forEach(([,i])=>i(e));}onConnError(e){this.hasLogger()&&this.log("transport",e);let t=this.transport,i=this.establishedConnections;this.stateChangeCallbacks.error.forEach(([,s])=>{s(e,t,i);}),(t===this.transport||i>0)&&this.triggerChanError();}triggerChanError(){this.channels.forEach(e=>{e.isErrored()||e.isLeaving()||e.isClosed()||e.trigger(d.error);});}connectionState(){switch(this.conn&&this.conn.readyState){case f.connecting:return "connecting";case f.open:return "open";case f.closing:return "closing";default:return "closed"}}isConnected(){return this.connectionState()==="open"}remove(e){this.off(e.stateChangeRefs),this.channels=this.channels.filter(t=>t!==e);}off(e){for(let t in this.stateChangeCallbacks)this.stateChangeCallbacks[t]=this.stateChangeCallbacks[t].filter(([i])=>e.indexOf(i)===-1);}channel(e,t={}){let i=new x(e,t,this);return this.channels.push(i),i}push(e){if(this.hasLogger()){let{topic:t,event:i,payload:s,ref:n,join_ref:r}=e;this.log("push",`${t} ${i} (${r}, ${n})`,s);}this.isConnected()?this.encode(e,t=>this.conn.send(t)):this.sendBuffer.push(()=>this.encode(e,t=>this.conn.send(t)));}makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}sendHeartbeat(){this.pendingHeartbeatRef&&!this.isConnected()||(this.pendingHeartbeatRef=this.makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef}),this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs));}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[]);}onConnMessage(e){this.decode(e.data,t=>{let{topic:i,event:s,payload:n,ref:r,join_ref:h}=t;r&&r===this.pendingHeartbeatRef&&(this.clearHeartbeats(),this.pendingHeartbeatRef=null,this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)),this.hasLogger()&&this.log("receive",`${n.status||""} ${i} ${s} ${r&&"("+r+")"||""}`,n);for(let o=0;o<this.channels.length;o++){let a=this.channels[o];a.isMember(i,s,n,h)&&a.trigger(s,n,r,h);}for(let o=0;o<this.stateChangeCallbacks.message.length;o++){let[,a]=this.stateChangeCallbacks.message[o];a(t);}});}leaveOpenTopic(e){let t=this.channels.find(i=>i.topic===e&&(i.isJoined()||i.isJoining()));t&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${e}"`),t.leave());}};var R=class e{constructor(){this.channels=[];}static connect(t){if(typeof window>"u"){let s={on:()=>s,push:()=>s,join:()=>s,leave:()=>Promise.resolve(),off:()=>{}};return {token:t,channel:s}}e.instance||(e.instance=new e,e.instance.socket=new j(chunk5STN56TL_cjs.a.upload.socket,{params:{token:t},reconnectAfterMs:s=>[1e3,3e3,5e3,1e4][s-1]||1e4}),e.instance.socket.connect());let i=e.instance.channels.find(s=>s.token===t);if(i)return i;{let s=e.instance.socket.channel(`embed:${t}`);s.join();let n={token:t,channel:s};return s.on("initiate",({upload_id:r})=>{e.instance.channels.push({...n,upload_id:r});}),n}}};
|
|
1
|
+
'use strict';var chunk5STN56TL_cjs=require('./chunk-5STN56TL.cjs');var C=e=>typeof e=="function"?e:function(){return e},L=typeof self<"u"?self:null,T=typeof window<"u"?window:null,g=L||T||g,_="2.0.0",f={connecting:0,open:1,closing:2,closed:3},P=1e4,H=1e3,c={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},d={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},y={longpoll:"longpoll",websocket:"websocket"},B={complete:4},v=class{constructor(e,t,i,s){this.channel=e,this.event=t,this.payload=i||function(){return {}},this.receivedResp=null,this.timeout=s,this.timeoutTimer=null,this.recHooks=[],this.sent=false;}resend(e){this.timeout=e,this.reset(),this.send();}send(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=true,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}));}receive(e,t){return this.hasReceived(e)&&t(this.receivedResp.response),this.recHooks.push({status:e,callback:t}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=false;}matchReceive({status:e,response:t,_ref:i}){this.recHooks.filter(s=>s.status===e).forEach(s=>s.callback(t));}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent);}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null;}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,e=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=e,this.matchReceive(e);}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{});},this.timeout);}hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}trigger(e,t){this.channel.trigger(this.refEvent,{status:e,response:t});}},S=class{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=null,this.tries=0;}reset(){this.tries=0,clearTimeout(this.timer);}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback();},this.timerCalc(this.tries+1));}},x=class{constructor(e,t,i){this.state=c.closed,this.topic=e,this.params=C(t||{}),this.socket=i,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=false,this.joinPush=new v(this,d.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new S(()=>{this.socket.isConnected()&&this.rejoin();},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin();})),this.joinPush.receive("ok",()=>{this.state=c.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(s=>s.send()),this.pushBuffer=[];}),this.joinPush.receive("error",()=>{this.state=c.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout();}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic} ${this.joinRef()}`),this.state=c.closed,this.socket.remove(this);}),this.onError(s=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,s),this.isJoining()&&this.joinPush.reset(),this.state=c.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout();}),this.joinPush.receive("timeout",()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic} (${this.joinRef()})`,this.joinPush.timeout),new v(this,d.leave,C({}),this.timeout).send(),this.state=c.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout();}),this.on(d.reply,(s,r)=>{this.trigger(this.replyEventName(r),s);});}join(e=this.timeout){if(this.joinedOnce)throw new Error("tried to join multiple times. 'join' can only be called a single time per channel instance");return this.timeout=e,this.joinedOnce=true,this.rejoin(),this.joinPush}onClose(e){this.on(d.close,e);}onError(e){return this.on(d.error,t=>e(t))}on(e,t){let i=this.bindingRef++;return this.bindings.push({event:e,ref:i,callback:t}),i}off(e,t){this.bindings=this.bindings.filter(i=>!(i.event===e&&(typeof t>"u"||t===i.ref)));}canPush(){return this.socket.isConnected()&&this.isJoined()}push(e,t,i=this.timeout){if(t=t||{},!this.joinedOnce)throw new Error(`tried to push '${e}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let s=new v(this,e,function(){return t},i);return this.canPush()?s.send():(s.startTimeout(),this.pushBuffer.push(s)),s}leave(e=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=c.leaving;let t=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(d.close,"leave");},i=new v(this,d.leave,C({}),e);return i.receive("ok",()=>t()).receive("timeout",()=>t()),i.send(),this.canPush()||i.trigger("ok",{}),i}onMessage(e,t,i){return t}isMember(e,t,i,s){return this.topic!==e?false:s&&s!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:e,event:t,payload:i,joinRef:s}),false):true}joinRef(){return this.joinPush.ref}rejoin(e=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=c.joining,this.joinPush.resend(e));}trigger(e,t,i,s){let r=this.onMessage(e,t,i,s);if(t&&!r)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let n=this.bindings.filter(h=>h.event===e);for(let h=0;h<n.length;h++)n[h].callback(r,i,s||this.joinRef());}replyEventName(e){return `chan_reply_${e}`}isClosed(){return this.state===c.closed}isErrored(){return this.state===c.errored}isJoined(){return this.state===c.joined}isJoining(){return this.state===c.joining}isLeaving(){return this.state===c.leaving}},E=class{static request(e,t,i,s,r,n,h){if(g.XDomainRequest){let o=new g.XDomainRequest;return this.xdomainRequest(o,e,t,s,r,n,h)}else {let o=new g.XMLHttpRequest;return this.xhrRequest(o,e,t,i,s,r,n,h)}}static xdomainRequest(e,t,i,s,r,n,h){return e.timeout=r,e.open(t,i),e.onload=()=>{let o=this.parseJSON(e.responseText);h&&h(o);},n&&(e.ontimeout=n),e.onprogress=()=>{},e.send(s),e}static xhrRequest(e,t,i,s,r,n,h,o){return e.open(t,i,true),e.timeout=n,e.setRequestHeader("Content-Type",s),e.onerror=()=>o&&o(null),e.onreadystatechange=()=>{if(e.readyState===B.complete&&o){let a=this.parseJSON(e.responseText);o(a);}},h&&(e.ontimeout=h),e.send(r),e}static parseJSON(e){if(!e||e==="")return null;try{return JSON.parse(e)}catch{return console&&console.log("failed to parse JSON response",e),null}}static serialize(e,t){let i=[];for(var s in e){if(!Object.prototype.hasOwnProperty.call(e,s))continue;let r=t?`${t}[${s}]`:s,n=e[s];typeof n=="object"?i.push(this.serialize(n,r)):i.push(encodeURIComponent(r)+"="+encodeURIComponent(n));}return i.join("&")}static appendParams(e,t){if(Object.keys(t).length===0)return e;let i=e.match(/\?/)?"&":"?";return `${e}${i}${this.serialize(t)}`}},$=e=>{let t="",i=new Uint8Array(e),s=i.byteLength;for(let r=0;r<s;r++)t+=String.fromCharCode(i[r]);return btoa(t)},m=class{constructor(e){this.endPoint=null,this.token=null,this.skipHeartbeat=true,this.reqs=new Set,this.awaitingBatchAck=false,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(e),this.readyState=f.connecting,setTimeout(()=>this.poll(),0);}normalizeEndpoint(e){return e.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+y.websocket),"$1/"+y.longpoll)}endpointURL(){return E.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(e,t,i){this.close(e,t,i),this.readyState=f.connecting;}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",false);}isActive(){return this.readyState===f.open||this.readyState===f.connecting}poll(){this.ajax("GET","application/json",null,()=>this.ontimeout(),e=>{if(e){var{status:t,token:i,messages:s}=e;this.token=i;}else t=0;switch(t){case 200:s.forEach(r=>{setTimeout(()=>this.onmessage({data:r}),0);}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=f.open,this.onopen({}),this.poll();break;case 403:this.onerror(403),this.close(1008,"forbidden",false);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,"internal server error",500);break;default:throw new Error(`unhandled poll status ${t}`)}});}send(e){typeof e!="string"&&(e=$(e)),this.currentBatch?this.currentBatch.push(e):this.awaitingBatchAck?this.batchBuffer.push(e):(this.currentBatch=[e],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null;},0));}batchSend(e){this.awaitingBatchAck=true,this.ajax("POST","application/x-ndjson",e.join(`
|
|
2
|
+
`),()=>this.onerror("timeout"),t=>{this.awaitingBatchAck=false,!t||t.status!==200?(this.onerror(t&&t.status),this.closeAndRetry(1011,"internal server error",false)):this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[]);});}close(e,t,i){for(let r of this.reqs)r.abort();this.readyState=f.closed;let s=Object.assign({code:1e3,reason:void 0,wasClean:true},{code:e,reason:t,wasClean:i});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<"u"?this.onclose(new CloseEvent("close",s)):this.onclose(s);}ajax(e,t,i,s,r){let n,h=()=>{this.reqs.delete(n),s();};n=E.request(e,this.endpointURL(),t,i,this.timeout,h,o=>{this.reqs.delete(n),this.isActive()&&r(o);}),this.reqs.add(n);}};var b={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(e,t){if(e.payload.constructor===ArrayBuffer)return t(this.binaryEncode(e));{let i=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(i))}},decode(e,t){if(e.constructor===ArrayBuffer)return t(this.binaryDecode(e));{let[i,s,r,n,h]=JSON.parse(e);return t({join_ref:i,ref:s,topic:r,event:n,payload:h})}},binaryEncode(e){let{join_ref:t,ref:i,event:s,topic:r,payload:n}=e,h=this.META_LENGTH+t.length+i.length+r.length+s.length,o=new ArrayBuffer(this.HEADER_LENGTH+h),a=new DataView(o),l=0;a.setUint8(l++,this.KINDS.push),a.setUint8(l++,t.length),a.setUint8(l++,i.length),a.setUint8(l++,r.length),a.setUint8(l++,s.length),Array.from(t,u=>a.setUint8(l++,u.charCodeAt(0))),Array.from(i,u=>a.setUint8(l++,u.charCodeAt(0))),Array.from(r,u=>a.setUint8(l++,u.charCodeAt(0))),Array.from(s,u=>a.setUint8(l++,u.charCodeAt(0)));var p=new Uint8Array(o.byteLength+n.byteLength);return p.set(new Uint8Array(o),0),p.set(new Uint8Array(n),o.byteLength),p.buffer},binaryDecode(e){let t=new DataView(e),i=t.getUint8(0),s=new TextDecoder;switch(i){case this.KINDS.push:return this.decodePush(e,t,s);case this.KINDS.reply:return this.decodeReply(e,t,s);case this.KINDS.broadcast:return this.decodeBroadcast(e,t,s)}},decodePush(e,t,i){let s=t.getUint8(1),r=t.getUint8(2),n=t.getUint8(3),h=this.HEADER_LENGTH+this.META_LENGTH-1,o=i.decode(e.slice(h,h+s));h=h+s;let a=i.decode(e.slice(h,h+r));h=h+r;let l=i.decode(e.slice(h,h+n));h=h+n;let p=e.slice(h,e.byteLength);return {join_ref:o,ref:null,topic:a,event:l,payload:p}},decodeReply(e,t,i){let s=t.getUint8(1),r=t.getUint8(2),n=t.getUint8(3),h=t.getUint8(4),o=this.HEADER_LENGTH+this.META_LENGTH,a=i.decode(e.slice(o,o+s));o=o+s;let l=i.decode(e.slice(o,o+r));o=o+r;let p=i.decode(e.slice(o,o+n));o=o+n;let u=i.decode(e.slice(o,o+h));o=o+h;let w=e.slice(o,e.byteLength),A={status:u,response:w};return {join_ref:a,ref:l,topic:p,event:d.reply,payload:A}},decodeBroadcast(e,t,i){let s=t.getUint8(1),r=t.getUint8(2),n=this.HEADER_LENGTH+2,h=i.decode(e.slice(n,n+s));n=n+s;let o=i.decode(e.slice(n,n+r));n=n+r;let a=e.slice(n,e.byteLength);return {join_ref:null,ref:null,topic:h,event:o,payload:a}}},j=class{constructor(e,t={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.timeout=t.timeout||P,this.transport=t.transport||g.WebSocket||m,this.primaryPassedHealthCheck=false,this.longPollFallbackMs=t.longPollFallbackMs,this.fallbackTimer=null,this.sessionStore=t.sessionStorage||g&&g.sessionStorage,this.establishedConnections=0,this.defaultEncoder=b.encode.bind(b),this.defaultDecoder=b.decode.bind(b),this.closeWasClean=false,this.disconnecting=false,this.binaryType=t.binaryType||"arraybuffer",this.connectClock=1,this.transport!==m?(this.encode=t.encode||this.defaultEncoder,this.decode=t.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let i=null;T&&T.addEventListener&&(T.addEventListener("pagehide",s=>{this.conn&&(this.disconnect(),i=this.connectClock);}),T.addEventListener("pageshow",s=>{i===this.connectClock&&(i=null,this.connect());})),this.heartbeatIntervalMs=t.heartbeatIntervalMs||3e4,this.rejoinAfterMs=s=>t.rejoinAfterMs?t.rejoinAfterMs(s):[1e3,2e3,5e3][s-1]||1e4,this.reconnectAfterMs=s=>t.reconnectAfterMs?t.reconnectAfterMs(s):[10,50,100,150,200,250,500,1e3,2e3][s-1]||5e3,this.logger=t.logger||null,!this.logger&&t.debug&&(this.logger=(s,r,n)=>{console.log(`${s}: ${r}`,n);}),this.longpollerTimeout=t.longpollerTimeout||2e4,this.params=C(t.params||{}),this.endPoint=`${e}/${y.websocket}`,this.vsn=t.vsn||_,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new S(()=>{this.teardown(()=>this.connect());},this.reconnectAfterMs);}getLongPollTransport(){return m}replaceTransport(e){this.connectClock++,this.closeWasClean=true,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=e;}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let e=E.appendParams(E.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return e.charAt(0)!=="/"?e:e.charAt(1)==="/"?`${this.protocol()}:${e}`:`${this.protocol()}://${location.host}${e}`}disconnect(e,t,i){this.connectClock++,this.disconnecting=true,this.closeWasClean=true,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=false,e&&e();},t,i);}connect(e){e&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=C(e)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==m?this.connectWithFallback(m,this.longPollFallbackMs):this.transportConnect());}log(e,t,i){this.logger&&this.logger(e,t,i);}hasLogger(){return this.logger!==null}onOpen(e){let t=this.makeRef();return this.stateChangeCallbacks.open.push([t,e]),t}onClose(e){let t=this.makeRef();return this.stateChangeCallbacks.close.push([t,e]),t}onError(e){let t=this.makeRef();return this.stateChangeCallbacks.error.push([t,e]),t}onMessage(e){let t=this.makeRef();return this.stateChangeCallbacks.message.push([t,e]),t}ping(e){if(!this.isConnected())return false;let t=this.makeRef(),i=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:t});let s=this.onMessage(r=>{r.ref===t&&(this.off([s]),e(Date.now()-i));});return true}transportConnect(){this.connectClock++,this.closeWasClean=false,this.conn=new this.transport(this.endPointURL()),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=e=>this.onConnError(e),this.conn.onmessage=e=>this.onConnMessage(e),this.conn.onclose=e=>this.onConnClose(e);}getSession(e){return this.sessionStore&&this.sessionStore.getItem(e)}storeSession(e,t){this.sessionStore&&this.sessionStore.setItem(e,t);}connectWithFallback(e,t=2500){clearTimeout(this.fallbackTimer);let i=false,s=true,r,n,h=o=>{this.log("transport",`falling back to ${e.name}...`,o),this.off([r,n]),s=false,this.replaceTransport(e),this.transportConnect();};if(this.getSession(`phx:fallback:${e.name}`))return h("memorized");this.fallbackTimer=setTimeout(h,t),n=this.onError(o=>{this.log("transport","error",o),s&&!i&&(clearTimeout(this.fallbackTimer),h(o));}),this.onOpen(()=>{if(i=true,!s)return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${e.name}`,"true"),this.log("transport",`established ${e.name} fallback`);clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(h,t),this.ping(o=>{this.log("transport","connected to primary after",o),this.primaryPassedHealthCheck=true,clearTimeout(this.fallbackTimer);});}),this.transportConnect();}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer);}onConnOpen(){this.hasLogger()&&this.log("transport",`${this.transport.name} connected to ${this.endPointURL()}`),this.closeWasClean=false,this.disconnecting=false,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.resetHeartbeat(),this.stateChangeCallbacks.open.forEach(([,e])=>e());}heartbeatTimeout(){this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection"),this.triggerChanError(),this.closeWasClean=false,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),H,"heartbeat timeout"));}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs));}teardown(e,t,i){if(!this.conn)return e&&e();let s=this.connectClock;this.waitForBufferDone(()=>{s===this.connectClock&&(this.conn&&(t?this.conn.close(t,i||""):this.conn.close()),this.waitForSocketClosed(()=>{s===this.connectClock&&(this.conn&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),e&&e());}));});}waitForBufferDone(e,t=1){if(t===5||!this.conn||!this.conn.bufferedAmount){e();return}setTimeout(()=>{this.waitForBufferDone(e,t+1);},150*t);}waitForSocketClosed(e,t=1){if(t===5||!this.conn||this.conn.readyState===f.closed){e();return}setTimeout(()=>{this.waitForSocketClosed(e,t+1);},150*t);}onConnClose(e){let t=e&&e.code;this.hasLogger()&&this.log("transport","close",e),this.triggerChanError(),this.clearHeartbeats(),!this.closeWasClean&&t!==1e3&&this.reconnectTimer.scheduleTimeout(),this.stateChangeCallbacks.close.forEach(([,i])=>i(e));}onConnError(e){this.hasLogger()&&this.log("transport",e);let t=this.transport,i=this.establishedConnections;this.stateChangeCallbacks.error.forEach(([,s])=>{s(e,t,i);}),(t===this.transport||i>0)&&this.triggerChanError();}triggerChanError(){this.channels.forEach(e=>{e.isErrored()||e.isLeaving()||e.isClosed()||e.trigger(d.error);});}connectionState(){switch(this.conn&&this.conn.readyState){case f.connecting:return "connecting";case f.open:return "open";case f.closing:return "closing";default:return "closed"}}isConnected(){return this.connectionState()==="open"}remove(e){this.off(e.stateChangeRefs),this.channels=this.channels.filter(t=>t!==e);}off(e){for(let t in this.stateChangeCallbacks)this.stateChangeCallbacks[t]=this.stateChangeCallbacks[t].filter(([i])=>e.indexOf(i)===-1);}channel(e,t={}){let i=new x(e,t,this);return this.channels.push(i),i}push(e){if(this.hasLogger()){let{topic:t,event:i,payload:s,ref:r,join_ref:n}=e;this.log("push",`${t} ${i} (${n}, ${r})`,s);}this.isConnected()?this.encode(e,t=>this.conn.send(t)):this.sendBuffer.push(()=>this.encode(e,t=>this.conn.send(t)));}makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}sendHeartbeat(){this.pendingHeartbeatRef&&!this.isConnected()||(this.pendingHeartbeatRef=this.makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef}),this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs));}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[]);}onConnMessage(e){this.decode(e.data,t=>{let{topic:i,event:s,payload:r,ref:n,join_ref:h}=t;n&&n===this.pendingHeartbeatRef&&(this.clearHeartbeats(),this.pendingHeartbeatRef=null,this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)),this.hasLogger()&&this.log("receive",`${r.status||""} ${i} ${s} ${n&&"("+n+")"||""}`,r);for(let o=0;o<this.channels.length;o++){let a=this.channels[o];a.isMember(i,s,r,h)&&a.trigger(s,r,n,h);}for(let o=0;o<this.stateChangeCallbacks.message.length;o++){let[,a]=this.stateChangeCallbacks.message[o];a(t);}});}leaveOpenTopic(e){let t=this.channels.find(i=>i.topic===e&&(i.isJoined()||i.isJoining()));t&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${e}"`),t.leave());}};var R=class{static connect(t){if(typeof window>"u"){let n={on:()=>n,push:()=>n,join:()=>n,leave:()=>Promise.resolve(),off:()=>{}};return {token:t,channel:n}}let i=new j(chunk5STN56TL_cjs.a.upload.socket,{params:{token:t},reconnectAfterMs:n=>[1e3,3e3,5e3,1e4][n-1]||1e4});i.connect();let s=i.channel(`embed:${t}`),r={token:t,channel:s,socket:i};return s.on("initiate",({upload_id:n})=>{r.upload_id=n;}),s.join(),r}static async disconnect(t){if(t){try{await t.channel.leave();}catch{}t.socket?.disconnect();}}};
|
|
3
3
|
exports.a=R;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var l=Object.create;var h=Object.defineProperty;var j=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var n=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty;var k=a=>{throw TypeError(a)};var q=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports);var p=(a,b,c,e)=>{if(b&&typeof b=="object"||typeof b=="function")for(let d of m(b))!o.call(a,d)&&d!==c&&h(a,d,{get:()=>b[d],enumerable:!(e=j(b,d))||e.enumerable});return a};var r=(a,b,c)=>(c=a!=null?l(n(a)):{},p(b||!a||!a.__esModule?h(c,"default",{value:a,enumerable:true}):c,a));var s=(a,b,c,e)=>{for(var d=e>1?void 0:e?j(b,c):b,f=a.length-1,g;f>=0;f--)(g=a[f])&&(d=(e?g(b,c,d):g(d))||d);return e&&d&&h(b,c,d),d};var i=(a,b,c)=>b.has(a)||k("Cannot "+c);var t=(a,b,c)=>(i(a,b,"read from private field"),c?c.call(a):b.get(a)),u=(a,b,c)=>b.has(a)?k("Cannot add the same private member more than once"):b instanceof WeakSet?b.add(a):b.set(a,c),v=(a,b,c,e)=>(i(a,b,"write to private field"),e?e.call(a,c):b.set(a,c),c),w=(a,b,c)=>(i(a,b,"access private method"),c);exports.a=q;exports.b=r;exports.c=s;exports.d=t;exports.e=u;exports.f=v;exports.g=w;
|