@maveio/components 0.0.169 → 0.0.171
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-L667KKJP.cjs → chunk-26IKHTYO.cjs} +1 -1
- package/dist/chunk-3BAQWQNY.cjs +25 -0
- package/dist/chunk-3UQNIS3L.js +194 -0
- package/dist/chunk-474VILDO.cjs +194 -0
- package/dist/{chunk-OVZCXWUJ.js → chunk-4HURBTSI.js} +141 -165
- package/dist/chunk-5QB22TB5.cjs +1 -0
- package/dist/{chunk-IMY6Z3YA.cjs → chunk-CQU5634L.cjs} +2 -2
- package/dist/chunk-CSURX7CD.js +1 -0
- package/dist/{chunk-KLJGACPT.js → chunk-GWLFO35M.js} +1 -1
- package/dist/chunk-HMVS6DJE.js +186 -0
- package/dist/chunk-KO3CETGD.js +25 -0
- package/dist/chunk-LVGLIRQU.cjs +186 -0
- package/dist/{chunk-P5OWX4UR.js → chunk-NDPOBFNC.js} +1 -1
- package/dist/{chunk-BL2IUHCP.cjs → chunk-PUSIMWBW.cjs} +203 -227
- package/dist/{chunk-MU4WLTQR.cjs → chunk-TJ5F2FGY.cjs} +1 -1
- package/dist/{chunk-GHE5KR7E.js → chunk-TQYBNODL.js} +1 -1
- package/dist/components/audio-track-menu.cjs +1 -1
- package/dist/components/audio-track-menu.js +1 -1
- package/dist/components/captions-menu-button.cjs +1 -0
- package/dist/components/captions-menu-button.d.cts +10 -0
- package/dist/components/captions-menu-button.d.ts +10 -0
- package/dist/components/captions-menu-button.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/list.cjs +1 -1
- package/dist/components/list.js +1 -1
- package/dist/components/player.cjs +1 -1
- package/dist/components/player.d.cts +4 -0
- package/dist/components/player.d.ts +4 -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/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 +204 -28
- package/dist/themes/default.js +204 -28
- package/dist/themes/dolphin.cjs +197 -16
- package/dist/themes/dolphin.js +197 -16
- package/dist/themes/loader.cjs +1 -1
- package/dist/themes/loader.js +1 -1
- package/dist/themes/synthwave.cjs +192 -19
- package/dist/themes/synthwave.js +192 -19
- package/dist/vue.cjs +1 -1
- package/dist/vue.d.cts +1 -1
- package/dist/vue.d.ts +1 -1
- package/dist/vue.js +1 -1
- package/package.json +5 -5
- package/dist/chunk-2EIQ3VMA.cjs +0 -1
- package/dist/chunk-C3CI3U2Z.js +0 -379
- package/dist/chunk-V54NMMTT.cjs +0 -379
- package/dist/chunk-WTS6WHUH.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkCQU5634L_cjs=require('./chunk-CQU5634L.cjs'),chunkTKJYRGEU_cjs=require('./chunk-TKJYRGEU.cjs'),chunkRQN3DXJB_cjs=require('./chunk-RQN3DXJB.cjs'),chunkDL4BV5IH_cjs=require('./chunk-DL4BV5IH.cjs'),chunk2E5GLLOS_cjs=require('./chunk-2E5GLLOS.cjs'),chunkNPP5B5PV_cjs=require('./chunk-NPP5B5PV.cjs'),chunkJHSFSCC2_cjs=require('./chunk-JHSFSCC2.cjs');var n,C,b,h,f,p,u=class extends chunkTKJYRGEU_cjs.a{constructor(){super(...arguments);chunkJHSFSCC2_cjs.e(this,n);this.order="newest";this.embedController=new chunkRQN3DXJB_cjs.b(this,0);}connectedCallback(){super.connectedCallback(),this.embedController.token=this.token;}requestUpdate(e,o){super.requestUpdate(e,o),e==="embed"&&(this.embedController.token=this.token);}get _slottedChildren(){return this.shadowRoot?.querySelector("slot")?.assignedElements({flatten:true})||[]}updated(){this.shadowRoot&&chunkCQU5634L_cjs.b(this.shadowRoot);}refresh(){return this.embedController.refresh()}containsEmbed(e){return this._collection?.videos?.some(o=>o.id===e)}getNextForEmbed(e){let o=chunkJHSFSCC2_cjs.g(this,n,C).call(this),t=o.findIndex(s=>s.id===e);if(t!==-1)return o[t+1]}render(){return chunk2E5GLLOS_cjs.a`
|
|
2
2
|
${this.embedController.render({pending:this.renderPending,error:e=>chunk2E5GLLOS_cjs.a`<p>${e instanceof Error?e.message:chunk2E5GLLOS_cjs.e}</p>`,complete:e=>{if(this._collection=e,!e)return this.renderPending();if(e.error)return console.warn(e.error);let o=this._slottedChildren.map(t=>{function s(){let l;return t.nodeName==="TEMPLATE"?l=t.content.cloneNode(true):l=t.cloneNode(true),l}if(t.getAttribute("name")=="list-title"){let l=s();return l.textContent=this._collection?.name,chunk2E5GLLOS_cjs.a`${l}`}if(t.getAttribute("name")=="mave-list-root"&&this.embedController.embed){let l=s(),i=chunkJHSFSCC2_cjs.g(this,n,f).call(this,l,"root-link");return i&&(i.addEventListener("click",a=>{a.preventDefault(),this.emit(this.EVENT_TYPES.CLICK,{action:"back",embedId:""}),this.embedController.embed="";}),chunkJHSFSCC2_cjs.g(this,n,p).call(this,i)),chunk2E5GLLOS_cjs.a`${l}`}if(t.getAttribute("name")=="mave-list-folder"){let l=this._collection.collections?.map(i=>{let a=s(),m=chunkJHSFSCC2_cjs.g(this,n,f).call(this,a,"folder-link");return [t,m].forEach(d=>{d instanceof Element&&(d.addEventListener("click",g=>{g.preventDefault(),this.emit(this.EVENT_TYPES.CLICK,{action:"show_collection",collectionId:i.id}),this.embedController.embed=i.id;}),chunkJHSFSCC2_cjs.g(this,n,p).call(this,d));}),chunkJHSFSCC2_cjs.g(this,n,h).call(this,a,"folder-title",i.name),typeof i.video_count=="number"&&chunkJHSFSCC2_cjs.g(this,n,h).call(this,a,"folder-count",i.video_count.toString()),chunk2E5GLLOS_cjs.a`${a}`});return chunk2E5GLLOS_cjs.a`${l}`}if(t.getAttribute("name")=="mave-list-item"||!["mave-list-folder","mave-list-item","mave-list-root","list-title"].includes(t.hasAttribute("name")?t.getAttribute("name"):"")&&t.nodeName=="TEMPLATE"){let l=chunkJHSFSCC2_cjs.g(this,n,C).call(this).map((i,a)=>{let m=s(),d=a+1;chunkJHSFSCC2_cjs.g(this,n,h).call(this,m,"item-title",i.name),chunkJHSFSCC2_cjs.g(this,n,h).call(this,m,"item-position",d.toString()),chunkJHSFSCC2_cjs.g(this,n,h).call(this,m,"item-duration",this.durationToTime(i.duration)),chunkJHSFSCC2_cjs.g(this,n,b).call(this,m,"mave-clip",i.id),chunkJHSFSCC2_cjs.g(this,n,b).call(this,m,"mave-player",i.id),chunkJHSFSCC2_cjs.g(this,n,b).call(this,m,"mave-img",i.id);let g=m.querySelector("mave-clip"),S=chunkJHSFSCC2_cjs.g(this,n,f).call(this,m,"item-title"),$=m.querySelector("mave-img");return [g,S,$,m].forEach(P=>{P?.addEventListener("click",x=>{this.emit(this.EVENT_TYPES.CLICK,{action:"show_embed",embedId:i.id,position:d});});}),chunk2E5GLLOS_cjs.a`${m}`});return chunk2E5GLLOS_cjs.a`${l}`}}).filter(t=>t);return chunk2E5GLLOS_cjs.a`${this._stylesheets} ${o}`}})}
|
|
3
3
|
`}renderPending(){return chunk2E5GLLOS_cjs.a`<slot style="display: none"></slot>`}};n=new WeakSet,C=function(){if(!this._collection)return [];let e=this._collection.videos;return this.order=="newest"&&(e=this._collection.videos?.sort((o,t)=>t.created-o.created)),this.order=="oldest"&&(e=this._collection.videos?.sort((o,t)=>o.created-t.created)),this.order=="az"&&(e=this._collection.videos?.sort((o,t)=>o.name.localeCompare(t.name))),this.order=="za"&&(e=this._collection.videos?.sort((o,t)=>t.name.localeCompare(o.name))),e},b=function(e,o,t){let s=e.querySelector(o);s&&(s.setAttribute("embed",t),chunkJHSFSCC2_cjs.g(this,n,p).call(this,s));},h=function(e,o,t){let s=chunkJHSFSCC2_cjs.g(this,n,f).call(this,e,o);s&&(s.textContent=t,chunkJHSFSCC2_cjs.g(this,n,p).call(this,s));},f=function(e,o){return e.querySelector(`[slot="${o}"], [data-slot="${o}"]`)},p=function(e){e&&(e.removeAttribute("slot"),e.removeAttribute("data-slot"));},u.styles=chunkNPP5B5PV_cjs.a`
|
|
4
4
|
:host {
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use strict';var chunk474VILDO_cjs=require('./chunk-474VILDO.cjs'),chunkJHSFSCC2_cjs=require('./chunk-JHSFSCC2.cjs');var M=(t="")=>t.split(/\s+/),A=(t="")=>{let[e,n,o]=t.split(":"),i=o?decodeURIComponent(o):void 0;return {kind:e==="cc"?chunk474VILDO_cjs.g.CAPTIONS:chunk474VILDO_cjs.g.SUBTITLES,language:n,label:i}},T=(t="",e={})=>M(t).map(n=>{let o=A(n);return {...e,...o}}),k=t=>t?Array.isArray(t)?t.map(e=>typeof e=="string"?A(e):e):typeof t=="string"?T(t):[t]:[],y=({kind:t,label:e,language:n}={kind:"subtitles"})=>e?`${t==="captions"?"cc":"sb"}:${n}:${encodeURIComponent(e)}`:n,h=(t=[])=>Array.prototype.map.call(t,y).join(" "),U=(t,e)=>n=>n[t]===e,I=t=>{let e=Object.entries(t).map(([n,o])=>U(n,o));return n=>e.every(o=>o(n))},Z=(t,e=[],n=[])=>{let o=k(n).map(I),i=d=>o.some(x=>x(d));Array.from(e).filter(i).forEach(d=>{d.mode=t;});},$=(t,e=()=>true)=>{if(!t?.textTracks)return [];let n=typeof e=="function"?e:I(e);return Array.from(t.textTracks).filter(n)},L=t=>{var e;return !!((e=t.mediaSubtitlesShowing)!=null&&e.length)||t.hasAttribute(chunk474VILDO_cjs.d.MEDIA_SUBTITLES_SHOWING)};var B=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
2
|
+
<path d="M22.83 5.68a2.58 2.58 0 0 0-2.3-2.5c-3.62-.24-11.44-.24-15.06 0a2.58 2.58 0 0 0-2.3 2.5c-.23 4.21-.23 8.43 0 12.64a2.58 2.58 0 0 0 2.3 2.5c3.62.24 11.44.24 15.06 0a2.58 2.58 0 0 0 2.3-2.5c.23-4.21.23-8.43 0-12.64Zm-11.39 9.45a3.07 3.07 0 0 1-1.91.57 3.06 3.06 0 0 1-2.34-1 3.75 3.75 0 0 1-.92-2.67 3.92 3.92 0 0 1 .92-2.77 3.18 3.18 0 0 1 2.43-1 2.94 2.94 0 0 1 2.13.78c.364.359.62.813.74 1.31l-1.43.35a1.49 1.49 0 0 0-1.51-1.17 1.61 1.61 0 0 0-1.29.58 2.79 2.79 0 0 0-.5 1.89 3 3 0 0 0 .49 1.93 1.61 1.61 0 0 0 1.27.58 1.48 1.48 0 0 0 1-.37 2.1 2.1 0 0 0 .59-1.14l1.4.44a3.23 3.23 0 0 1-1.07 1.69Zm7.22 0a3.07 3.07 0 0 1-1.91.57 3.06 3.06 0 0 1-2.34-1 3.75 3.75 0 0 1-.92-2.67 3.88 3.88 0 0 1 .93-2.77 3.14 3.14 0 0 1 2.42-1 3 3 0 0 1 2.16.82 2.8 2.8 0 0 1 .73 1.31l-1.43.35a1.49 1.49 0 0 0-1.51-1.21 1.61 1.61 0 0 0-1.29.58A2.79 2.79 0 0 0 15 12a3 3 0 0 0 .49 1.93 1.61 1.61 0 0 0 1.27.58 1.44 1.44 0 0 0 1-.37 2.1 2.1 0 0 0 .6-1.15l1.4.44a3.17 3.17 0 0 1-1.1 1.7Z"/>
|
|
3
|
+
</svg>`,D=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
4
|
+
<path d="M17.73 14.09a1.4 1.4 0 0 1-1 .37 1.579 1.579 0 0 1-1.27-.58A3 3 0 0 1 15 12a2.8 2.8 0 0 1 .5-1.85 1.63 1.63 0 0 1 1.29-.57 1.47 1.47 0 0 1 1.51 1.2l1.43-.34A2.89 2.89 0 0 0 19 9.07a3 3 0 0 0-2.14-.78 3.14 3.14 0 0 0-2.42 1 3.91 3.91 0 0 0-.93 2.78 3.74 3.74 0 0 0 .92 2.66 3.07 3.07 0 0 0 2.34 1 3.07 3.07 0 0 0 1.91-.57 3.17 3.17 0 0 0 1.07-1.74l-1.4-.45c-.083.43-.3.822-.62 1.12Zm-7.22 0a1.43 1.43 0 0 1-1 .37 1.58 1.58 0 0 1-1.27-.58A3 3 0 0 1 7.76 12a2.8 2.8 0 0 1 .5-1.85 1.63 1.63 0 0 1 1.29-.57 1.47 1.47 0 0 1 1.51 1.2l1.43-.34a2.81 2.81 0 0 0-.74-1.32 2.94 2.94 0 0 0-2.13-.78 3.18 3.18 0 0 0-2.43 1 4 4 0 0 0-.92 2.78 3.74 3.74 0 0 0 .92 2.66 3.07 3.07 0 0 0 2.34 1 3.07 3.07 0 0 0 1.91-.57 3.23 3.23 0 0 0 1.07-1.74l-1.4-.45a2.06 2.06 0 0 1-.6 1.07Zm12.32-8.41a2.59 2.59 0 0 0-2.3-2.51C18.72 3.05 15.86 3 13 3c-2.86 0-5.72.05-7.53.17a2.59 2.59 0 0 0-2.3 2.51c-.23 4.207-.23 8.423 0 12.63a2.57 2.57 0 0 0 2.3 2.5c1.81.13 4.67.19 7.53.19 2.86 0 5.72-.06 7.53-.19a2.57 2.57 0 0 0 2.3-2.5c.23-4.207.23-8.423 0-12.63Zm-1.49 12.53a1.11 1.11 0 0 1-.91 1.11c-1.67.11-4.45.18-7.43.18-2.98 0-5.76-.07-7.43-.18a1.11 1.11 0 0 1-.91-1.11c-.21-4.14-.21-8.29 0-12.43a1.11 1.11 0 0 1 .91-1.11C7.24 4.56 10 4.49 13 4.49s5.76.07 7.43.18a1.11 1.11 0 0 1 .91 1.11c.21 4.14.21 8.29 0 12.43Z"/>
|
|
5
|
+
</svg>`;function H(){return `
|
|
6
|
+
<style>
|
|
7
|
+
:host([data-captions-enabled="true"]) slot[name=off] {
|
|
8
|
+
display: none !important;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
:host(:not([data-captions-enabled="true"])) slot[name=on] {
|
|
13
|
+
display: none !important;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
:host([aria-expanded="true"]) slot[name=tooltip] {
|
|
17
|
+
display: none;
|
|
18
|
+
}
|
|
19
|
+
</style>
|
|
20
|
+
|
|
21
|
+
<slot name="icon">
|
|
22
|
+
<slot name="on">${B}</slot>
|
|
23
|
+
<slot name="off">${D}</slot>
|
|
24
|
+
</slot>
|
|
25
|
+
`}function w(){return chunk474VILDO_cjs.n("Captions")}var E=t=>{t.setAttribute("data-captions-enabled",L(t).toString());},v=t=>{t.setAttribute("aria-label",chunk474VILDO_cjs.n("closed captions"));},r=class extends chunk474VILDO_cjs.M{static get observedAttributes(){return [...super.observedAttributes,chunk474VILDO_cjs.d.MEDIA_SUBTITLES_LIST,chunk474VILDO_cjs.d.MEDIA_SUBTITLES_SHOWING,chunk474VILDO_cjs.d.MEDIA_LANG]}connectedCallback(){super.connectedCallback(),v(this),E(this);}attributeChangedCallback(e,n,o){super.attributeChangedCallback(e,n,o),e===chunk474VILDO_cjs.d.MEDIA_SUBTITLES_SHOWING?E(this):e===chunk474VILDO_cjs.d.MEDIA_LANG&&v(this);}get invokeTargetElement(){var e;return this.invokeTarget!=null?super.invokeTargetElement:(e=chunk474VILDO_cjs.r(this))==null?void 0:e.querySelector("media-captions-menu")}get mediaSubtitlesList(){return C(this,chunk474VILDO_cjs.d.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){_(this,chunk474VILDO_cjs.d.MEDIA_SUBTITLES_LIST,e);}get mediaSubtitlesShowing(){return C(this,chunk474VILDO_cjs.d.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){_(this,chunk474VILDO_cjs.d.MEDIA_SUBTITLES_SHOWING,e);}};r.getSlotTemplateHTML=H;r.getTooltipContentHTML=w;var C=(t,e)=>{let n=t.getAttribute(e);return n?T(n):[]},_=(t,e,n)=>{if(!n?.length){t.removeAttribute(e);return}let o=h(n);t.getAttribute(e)!==o&&t.setAttribute(e,o);};chunk474VILDO_cjs.o.customElements.get("media-captions-menu-button")||chunk474VILDO_cjs.o.customElements.define("media-captions-menu-button",r);var l,b,u=class extends r{constructor(){super(...arguments);chunkJHSFSCC2_cjs.e(this,l);}connectedCallback(){super.connectedCallback(),chunkJHSFSCC2_cjs.g(this,l,b).call(this);}attributeChangedCallback(n,o,i){super.attributeChangedCallback(n,o,i),chunkJHSFSCC2_cjs.g(this,l,b).call(this);}};l=new WeakSet,b=function(){this.setAttribute("aria-label",chunk474VILDO_cjs.n("Captions"));},u.getTooltipContentHTML=()=>chunk474VILDO_cjs.n("Captions");chunk474VILDO_cjs.o.customElements.get("mave-captions-menu-button")||chunk474VILDO_cjs.o.customElements.define("mave-captions-menu-button",u);exports.a=T;exports.b=k;exports.c=y;exports.d=h;exports.e=Z;exports.f=$;exports.g=L;exports.h=u;
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
var St={MEDIA_PLAY_REQUEST:"mediaplayrequest",MEDIA_PAUSE_REQUEST:"mediapauserequest",MEDIA_MUTE_REQUEST:"mediamuterequest",MEDIA_UNMUTE_REQUEST:"mediaunmuterequest",MEDIA_LOOP_REQUEST:"medialooprequest",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"},p={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},dt={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_LOOP:"mediaLoop",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"},Y=Object.entries(dt),b=Y.reduce((e,[t,o])=>(e[t]=o.toLowerCase(),e),{}),ct={USER_INACTIVE_CHANGE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"},z=Y.reduce((e,[t,o])=>(e[t]=o.toLowerCase(),e),{...ct});Object.entries(z).reduce((e,[t,o])=>{let i=b[t];return i&&(e[o]=i),e},{userinactivechange:"userinactive"});var yt=Object.entries(b).reduce((e,[t,o])=>{let i=z[t];return i&&(e[o]=i),e},{userinactive:"userinactivechange"}),Lt={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},Rt={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var wt={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},Dt={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},kt={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var Ct={INLINE:"inline",FULLSCREEN:"fullscreen",PICTURE_IN_PICTURE:"picture-in-picture"};var j={"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",Loop:"Loop","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 J,x={en:j},U=((J=globalThis.navigator)==null?void 0:J.language)||"en",Nt=e=>{U=e;};var ut=e=>{var t,o,i;let[r]=U.split("-");return ((t=x[U])==null?void 0:t[e])||((o=x[r])==null?void 0:o[e])||((i=x.en)==null?void 0:i[e])||e},Pt=(e,t={})=>ut(e).replace(/\{(\w+)\}/g,(o,i)=>i in t?String(t[i]):`{${i}}`);var M=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return true}},y=class extends M{},L=class extends y{constructor(){super(...arguments),this.role=null;}},N=class{observe(){}unobserve(){}disconnect(){}},Z={createElement:function(){return new I.HTMLElement},createElementNS:function(){return new I.HTMLElement},addEventListener(){},removeEventListener(){},dispatchEvent(e){return false}},I={ResizeObserver:N,document:Z,Node:y,Element:L,HTMLElement:class extends L{constructor(){super(...arguments),this.innerHTML="";}get content(){return new I.DocumentFragment}},DocumentFragment:class extends M{},customElements:{get:function(){},define:function(){},whenDefined:function(){}},localStorage:{getItem(e){return null},setItem(e,t){},removeItem(e){}},CustomEvent:function(){},getComputedStyle:function(){},navigator:{languages:[],get userAgent(){return ""}},matchMedia(e){return {matches:false,media:e}},DOMParser:class{parseFromString(t,o){return {body:{textContent:t}}}}},tt="global"in globalThis&&globalThis?.global===globalThis||typeof window>"u"||typeof window.customElements>"u",et=Object.keys(I).every(e=>e in globalThis),s=tt&&!et?I:globalThis,Qt=tt&&!et?Z:globalThis.document;function R(e){let t={};for(let o of e)t[o.name]=o.value;return t}function ot(e){var t;return (t=pt(e))!=null?t:w(e,"media-controller")}function pt(e){var t;let{MEDIA_CONTROLLER:o}=p,i=e.getAttribute(o);if(i)return (t=P(e))==null?void 0:t.getElementById(i)}var Ft=(e,t,o=".value")=>{let i=e.querySelector(o);i&&(i.textContent=t);},mt=(e,t)=>{let o=`slot[name="${t}"]`,i=e.shadowRoot.querySelector(o);return i?i.children:[]},Kt=(e,t)=>mt(e,t)[0],Et=(e,t)=>!e||!t?false:e?.contains(t)?true:Et(e,t.getRootNode().host),w=(e,t)=>{if(!e)return null;let o=e.closest(t);return o||w(e.getRootNode().host,t)};function ht(e=document){var t;let o=e?.activeElement;return o?(t=ht(o.shadowRoot))!=null?t:o:null}function P(e){var t;let o=(t=e?.getRootNode)==null?void 0:t.call(e);return o instanceof ShadowRoot||o instanceof Document?o:null}function it(e,{depth:t=3,checkOpacity:o=true,checkVisibilityCSS:i=true}={}){if(e.checkVisibility)return e.checkVisibility({checkOpacity:o,checkVisibilityCSS:i});let r=e;for(;r&&t>0;){let a=getComputedStyle(r);if(o&&a.opacity==="0"||i&&a.visibility==="hidden"||a.display==="none")return false;r=r.parentElement,t--;}return true}function $t(e,t,o,i){let r=i.x-o.x,a=i.y-o.y,l=r*r+a*a;if(l===0)return 0;let u=((e-o.x)*r+(t-o.y)*a)/l;return Math.max(0,Math.min(1,u))}function rt(e,t){let o=_t(e,i=>i===t);return o||vt(e,t)}function _t(e,t){var o,i;let r;for(r of (o=e.querySelectorAll("style:not([media])"))!=null?o:[]){let a;try{a=(i=r.sheet)==null?void 0:i.cssRules;}catch{continue}for(let l of a??[])if(t(l.selectorText))return l}}function vt(e,t){var o,i;let r=(o=e.querySelectorAll("style:not([media])"))!=null?o:[],a=r?.[r.length-1];return a?.sheet?(a?.sheet.insertRule(`${t}{}`,a.sheet.cssRules.length),(i=a.sheet.cssRules)==null?void 0:i[a.sheet.cssRules.length-1]):(console.warn("Media Chrome: No style sheet found on style tag of",e),{style:{setProperty:()=>{},removeProperty:()=>"",getPropertyValue:()=>""}})}function ft(e,t,o=Number.NaN){let i=e.getAttribute(t);return i!=null?+i:o}function Xt(e,t,o){let i=+o;if(o==null||Number.isNaN(i)){e.hasAttribute(t)&&e.removeAttribute(t);return}ft(e,t,void 0)!==i&&e.setAttribute(t,`${i}`);}function D(e,t){return e.hasAttribute(t)}function H(e,t,o){if(o==null){e.hasAttribute(t)&&e.removeAttribute(t);return}D(e,t)!=o&&e.toggleAttribute(t,o);}function h(e,t,o=null){var i;return (i=e.getAttribute(t))!=null?i:o}function _(e,t,o){if(o==null){e.hasAttribute(t)&&e.removeAttribute(t);return}let i=`${o}`;h(e,t,void 0)!==i&&e.setAttribute(t,i);}var v={PLACEMENT:"placement",BOUNDS:"bounds"};function At(e){return `
|
|
2
|
+
<style>
|
|
3
|
+
:host {
|
|
4
|
+
--_tooltip-background-color: var(--media-tooltip-background-color, var(--media-secondary-color, rgba(20, 20, 30, .7)));
|
|
5
|
+
--_tooltip-background: var(--media-tooltip-background, var(--_tooltip-background-color));
|
|
6
|
+
--_tooltip-arrow-half-width: calc(var(--media-tooltip-arrow-width, 12px) / 2);
|
|
7
|
+
--_tooltip-arrow-height: var(--media-tooltip-arrow-height, 5px);
|
|
8
|
+
--_tooltip-arrow-background: var(--media-tooltip-arrow-color, var(--_tooltip-background-color));
|
|
9
|
+
position: relative;
|
|
10
|
+
pointer-events: none;
|
|
11
|
+
display: var(--media-tooltip-display, inline-flex);
|
|
12
|
+
justify-content: center;
|
|
13
|
+
align-items: center;
|
|
14
|
+
box-sizing: border-box;
|
|
15
|
+
z-index: var(--media-tooltip-z-index, 1);
|
|
16
|
+
background: var(--_tooltip-background);
|
|
17
|
+
color: var(--media-text-color, var(--media-primary-color, rgb(238 238 238)));
|
|
18
|
+
font: var(--media-font,
|
|
19
|
+
var(--media-font-weight, 400)
|
|
20
|
+
var(--media-font-size, 13px) /
|
|
21
|
+
var(--media-text-content-height, var(--media-control-height, 18px))
|
|
22
|
+
var(--media-font-family, helvetica neue, segoe ui, roboto, arial, sans-serif));
|
|
23
|
+
padding: var(--media-tooltip-padding, .35em .7em);
|
|
24
|
+
border: var(--media-tooltip-border, none);
|
|
25
|
+
border-radius: var(--media-tooltip-border-radius, 5px);
|
|
26
|
+
filter: var(--media-tooltip-filter, drop-shadow(0 0 4px rgba(0, 0, 0, .2)));
|
|
27
|
+
white-space: var(--media-tooltip-white-space, nowrap);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
:host([hidden]) {
|
|
31
|
+
display: none;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
img, svg {
|
|
35
|
+
display: inline-block;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
#arrow {
|
|
39
|
+
position: absolute;
|
|
40
|
+
width: 0px;
|
|
41
|
+
height: 0px;
|
|
42
|
+
border-style: solid;
|
|
43
|
+
display: var(--media-tooltip-arrow-display, block);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
:host(:not([placement])),
|
|
47
|
+
:host([placement="top"]) {
|
|
48
|
+
position: absolute;
|
|
49
|
+
bottom: calc(100% + var(--media-tooltip-distance, 12px));
|
|
50
|
+
left: 50%;
|
|
51
|
+
transform: translate(calc(-50% - var(--media-tooltip-offset-x, 0px)), 0);
|
|
52
|
+
}
|
|
53
|
+
:host(:not([placement])) #arrow,
|
|
54
|
+
:host([placement="top"]) #arrow {
|
|
55
|
+
top: 100%;
|
|
56
|
+
left: 50%;
|
|
57
|
+
border-width: var(--_tooltip-arrow-height) var(--_tooltip-arrow-half-width) 0 var(--_tooltip-arrow-half-width);
|
|
58
|
+
border-color: var(--_tooltip-arrow-background) transparent transparent transparent;
|
|
59
|
+
transform: translate(calc(-50% + var(--media-tooltip-offset-x, 0px)), 0);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
:host([placement="right"]) {
|
|
63
|
+
position: absolute;
|
|
64
|
+
left: calc(100% + var(--media-tooltip-distance, 12px));
|
|
65
|
+
top: 50%;
|
|
66
|
+
transform: translate(0, -50%);
|
|
67
|
+
}
|
|
68
|
+
:host([placement="right"]) #arrow {
|
|
69
|
+
top: 50%;
|
|
70
|
+
right: 100%;
|
|
71
|
+
border-width: var(--_tooltip-arrow-half-width) var(--_tooltip-arrow-height) var(--_tooltip-arrow-half-width) 0;
|
|
72
|
+
border-color: transparent var(--_tooltip-arrow-background) transparent transparent;
|
|
73
|
+
transform: translate(0, -50%);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
:host([placement="bottom"]) {
|
|
77
|
+
position: absolute;
|
|
78
|
+
top: calc(100% + var(--media-tooltip-distance, 12px));
|
|
79
|
+
left: 50%;
|
|
80
|
+
transform: translate(calc(-50% - var(--media-tooltip-offset-x, 0px)), 0);
|
|
81
|
+
}
|
|
82
|
+
:host([placement="bottom"]) #arrow {
|
|
83
|
+
bottom: 100%;
|
|
84
|
+
left: 50%;
|
|
85
|
+
border-width: 0 var(--_tooltip-arrow-half-width) var(--_tooltip-arrow-height) var(--_tooltip-arrow-half-width);
|
|
86
|
+
border-color: transparent transparent var(--_tooltip-arrow-background) transparent;
|
|
87
|
+
transform: translate(calc(-50% + var(--media-tooltip-offset-x, 0px)), 0);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
:host([placement="left"]) {
|
|
91
|
+
position: absolute;
|
|
92
|
+
right: calc(100% + var(--media-tooltip-distance, 12px));
|
|
93
|
+
top: 50%;
|
|
94
|
+
transform: translate(0, -50%);
|
|
95
|
+
}
|
|
96
|
+
:host([placement="left"]) #arrow {
|
|
97
|
+
top: 50%;
|
|
98
|
+
left: 100%;
|
|
99
|
+
border-width: var(--_tooltip-arrow-half-width) 0 var(--_tooltip-arrow-half-width) var(--_tooltip-arrow-height);
|
|
100
|
+
border-color: transparent transparent transparent var(--_tooltip-arrow-background);
|
|
101
|
+
transform: translate(0, -50%);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
:host([placement="none"]) #arrow {
|
|
105
|
+
display: none;
|
|
106
|
+
}
|
|
107
|
+
</style>
|
|
108
|
+
<slot></slot>
|
|
109
|
+
<div id="arrow"></div>
|
|
110
|
+
`}var f=class extends s.HTMLElement{constructor(){if(super(),this.updateXOffset=()=>{var t;if(!it(this,{checkOpacity:false,checkVisibilityCSS:false}))return;let o=this.placement;if(o==="left"||o==="right"){this.style.removeProperty("--media-tooltip-offset-x");return}let i=getComputedStyle(this),r=(t=w(this,"#"+this.bounds))!=null?t:ot(this);if(!r)return;let{x:a,width:l}=r.getBoundingClientRect(),{x:u,width:S}=this.getBoundingClientRect(),st=u+S,lt=a+l,W=i.getPropertyValue("--media-tooltip-offset-x"),G=W?parseFloat(W.replace("px","")):0,F=i.getPropertyValue("--media-tooltip-container-margin"),K=F?parseFloat(F.replace("px","")):0,$=u-a+G-K,X=st-lt+G+K;if($<0){this.style.setProperty("--media-tooltip-offset-x",`${$}px`);return}if(X>0){this.style.setProperty("--media-tooltip-offset-x",`${X}px`);return}this.style.removeProperty("--media-tooltip-offset-x");},!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let t=R(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(t);}if(this.arrowEl=this.shadowRoot.querySelector("#arrow"),Object.prototype.hasOwnProperty.call(this,"placement")){let t=this.placement;delete this.placement,this.placement=t;}}static get observedAttributes(){return [v.PLACEMENT,v.BOUNDS]}get placement(){return h(this,v.PLACEMENT)}set placement(t){_(this,v.PLACEMENT,t);}get bounds(){return h(this,v.BOUNDS)}set bounds(t){_(this,v.BOUNDS,t);}};f.shadowRootOptions={mode:"open"};f.getTemplateHTML=At;s.customElements.get("media-tooltip")||s.customElements.define("media-tooltip",f);var B=f;var q=(e,t,o)=>{if(!t.has(e))throw TypeError("Cannot "+o)},n=(e,t,o)=>(q(e,t,"read from private field"),o?o.call(e):t.get(e)),A=(e,t,o)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,o);},k=(e,t,o,i)=>(q(e,t,"write to private field"),t.set(e,o),o),gt=(e,t,o)=>(q(e,t,"access private method"),o),d,T,E,g,C,V,at,m={TOOLTIP_PLACEMENT:"tooltipplacement",DISABLED:"disabled",NO_TOOLTIP:"notooltip"};function Tt(e,t={}){return `
|
|
111
|
+
<style>
|
|
112
|
+
:host {
|
|
113
|
+
position: relative;
|
|
114
|
+
font: var(--media-font,
|
|
115
|
+
var(--media-font-weight, bold)
|
|
116
|
+
var(--media-font-size, 14px) /
|
|
117
|
+
var(--media-text-content-height, var(--media-control-height, 24px))
|
|
118
|
+
var(--media-font-family, helvetica neue, segoe ui, roboto, arial, sans-serif));
|
|
119
|
+
color: var(--media-text-color, var(--media-primary-color, rgb(238 238 238)));
|
|
120
|
+
background: var(--media-control-background, var(--media-secondary-color, rgb(20 20 30 / .7)));
|
|
121
|
+
padding: var(--media-button-padding, var(--media-control-padding, 10px));
|
|
122
|
+
justify-content: var(--media-button-justify-content, center);
|
|
123
|
+
display: inline-flex;
|
|
124
|
+
align-items: center;
|
|
125
|
+
vertical-align: middle;
|
|
126
|
+
box-sizing: border-box;
|
|
127
|
+
transition: background .15s linear;
|
|
128
|
+
pointer-events: auto;
|
|
129
|
+
cursor: var(--media-cursor, pointer);
|
|
130
|
+
-webkit-tap-highlight-color: transparent;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
:host(:focus-visible) {
|
|
135
|
+
box-shadow: var(--media-focus-box-shadow, inset 0 0 0 2px rgb(27 127 204 / .9));
|
|
136
|
+
outline: 0;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
:host(:where(:focus)) {
|
|
140
|
+
box-shadow: none;
|
|
141
|
+
outline: 0;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
:host(:hover) {
|
|
145
|
+
background: var(--media-control-hover-background, rgba(50 50 70 / .7));
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
svg, img, ::slotted(svg), ::slotted(img) {
|
|
149
|
+
width: var(--media-button-icon-width);
|
|
150
|
+
height: var(--media-button-icon-height, var(--media-control-height, 24px));
|
|
151
|
+
transform: var(--media-button-icon-transform);
|
|
152
|
+
transition: var(--media-button-icon-transition);
|
|
153
|
+
fill: var(--media-icon-color, var(--media-primary-color, rgb(238 238 238)));
|
|
154
|
+
vertical-align: middle;
|
|
155
|
+
max-width: 100%;
|
|
156
|
+
max-height: 100%;
|
|
157
|
+
min-width: 100%;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
media-tooltip {
|
|
161
|
+
|
|
162
|
+
max-width: 0;
|
|
163
|
+
overflow-x: clip;
|
|
164
|
+
opacity: 0;
|
|
165
|
+
transition: opacity .3s, max-width 0s 9s;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
:host(:hover) media-tooltip,
|
|
169
|
+
:host(:focus-visible) media-tooltip {
|
|
170
|
+
max-width: 100vw;
|
|
171
|
+
opacity: 1;
|
|
172
|
+
transition: opacity .3s;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
:host([notooltip]) slot[name="tooltip"] {
|
|
176
|
+
display: none;
|
|
177
|
+
}
|
|
178
|
+
</style>
|
|
179
|
+
|
|
180
|
+
${this.getSlotTemplateHTML(e,t)}
|
|
181
|
+
|
|
182
|
+
<slot name="tooltip">
|
|
183
|
+
<media-tooltip part="tooltip" aria-hidden="true">
|
|
184
|
+
<template shadowrootmode="${B.shadowRootOptions.mode}">
|
|
185
|
+
${B.getTemplateHTML({})}
|
|
186
|
+
</template>
|
|
187
|
+
<slot name="tooltip-content">
|
|
188
|
+
${this.getTooltipContentHTML(e)}
|
|
189
|
+
</slot>
|
|
190
|
+
</media-tooltip>
|
|
191
|
+
</slot>
|
|
192
|
+
`}function bt(e,t){return `
|
|
193
|
+
<slot></slot>
|
|
194
|
+
`}function It(){return ""}var c=class extends s.HTMLElement{constructor(){if(super(),A(this,V),A(this,d,void 0),this.preventClick=false,this.tooltipEl=null,A(this,T,t=>{this.preventClick||this.handleClick(t),setTimeout(n(this,E),0);}),A(this,E,()=>{var t,o;(o=(t=this.tooltipEl)==null?void 0:t.updateXOffset)==null||o.call(t);}),A(this,g,t=>{let{key:o}=t;if(!this.keysUsed.includes(o)){this.removeEventListener("keyup",n(this,g));return}this.preventClick||this.handleClick(t);}),A(this,C,t=>{let{metaKey:o,altKey:i,key:r}=t;if(o||i||!this.keysUsed.includes(r)){this.removeEventListener("keyup",n(this,g));return}this.addEventListener("keyup",n(this,g),{once:true});}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let t=R(this.attributes),o=this.constructor.getTemplateHTML(t);this.shadowRoot.setHTMLUnsafe?this.shadowRoot.setHTMLUnsafe(o):this.shadowRoot.innerHTML=o;}this.tooltipEl=this.shadowRoot.querySelector("media-tooltip");}static get observedAttributes(){return ["disabled",m.TOOLTIP_PLACEMENT,p.MEDIA_CONTROLLER,b.MEDIA_LANG]}enable(){this.addEventListener("click",n(this,T)),this.addEventListener("keydown",n(this,C)),this.tabIndex=0;}disable(){this.removeEventListener("click",n(this,T)),this.removeEventListener("keydown",n(this,C)),this.removeEventListener("keyup",n(this,g)),this.tabIndex=-1;}attributeChangedCallback(t,o,i){var r,a,l,u,S;t===p.MEDIA_CONTROLLER?(o&&((a=(r=n(this,d))==null?void 0:r.unassociateElement)==null||a.call(r,this),k(this,d,null)),i&&this.isConnected&&(k(this,d,(l=this.getRootNode())==null?void 0:l.getElementById(i)),(S=(u=n(this,d))==null?void 0:u.associateElement)==null||S.call(u,this))):t==="disabled"&&i!==o?i==null?this.enable():this.disable():t===m.TOOLTIP_PLACEMENT&&this.tooltipEl&&i!==o?this.tooltipEl.placement=i:t===b.MEDIA_LANG&&(this.shadowRoot.querySelector('slot[name="tooltip-content"]').innerHTML=this.constructor.getTooltipContentHTML()),n(this,E).call(this);}connectedCallback(){var t,o,i;let{style:r}=rt(this.shadowRoot,":host");r.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(p.MEDIA_CONTROLLER);a&&(k(this,d,(t=this.getRootNode())==null?void 0:t.getElementById(a)),(i=(o=n(this,d))==null?void 0:o.associateElement)==null||i.call(o,this)),s.customElements.whenDefined("media-tooltip").then(()=>gt(this,V,at).call(this));}disconnectedCallback(){var t,o;this.disable(),(o=(t=n(this,d))==null?void 0:t.unassociateElement)==null||o.call(t,this),k(this,d,null),this.removeEventListener("mouseenter",n(this,E)),this.removeEventListener("focus",n(this,E)),this.removeEventListener("click",n(this,T));}get keysUsed(){return ["Enter"," "]}get tooltipPlacement(){return h(this,m.TOOLTIP_PLACEMENT)}set tooltipPlacement(t){_(this,m.TOOLTIP_PLACEMENT,t);}get mediaController(){return h(this,p.MEDIA_CONTROLLER)}set mediaController(t){_(this,p.MEDIA_CONTROLLER,t);}get disabled(){return D(this,m.DISABLED)}set disabled(t){H(this,m.DISABLED,t);}get noTooltip(){return D(this,m.NO_TOOLTIP)}set noTooltip(t){H(this,m.NO_TOOLTIP,t);}handleClick(t){}};d=new WeakMap;T=new WeakMap;E=new WeakMap;g=new WeakMap;C=new WeakMap;V=new WeakSet;at=function(){this.addEventListener("mouseenter",n(this,E)),this.addEventListener("focus",n(this,E)),this.addEventListener("click",n(this,T));let e=this.tooltipPlacement;e&&this.tooltipEl&&(this.tooltipEl.placement=e);};c.shadowRootOptions={mode:"open"};c.getTemplateHTML=Tt;c.getSlotTemplateHTML=bt;c.getTooltipContentHTML=It;s.customElements.get("media-chrome-button")||s.customElements.define("media-chrome-button",c);var O=class extends Event{constructor({action:t="auto",relatedTarget:o,...i}){super("invoke",i),this.action=t,this.relatedTarget=o;}},nt=class extends Event{constructor({newState:t,oldState:o,...i}){super("toggle",i),this.newState=t,this.oldState=o;}};var Q=class extends c{connectedCallback(){super.connectedCallback(),this.invokeTargetElement&&this.setAttribute("aria-haspopup","menu");}get invokeTarget(){return this.getAttribute("invoketarget")}set invokeTarget(t){this.setAttribute("invoketarget",`${t}`);}get invokeTargetElement(){var t;return this.invokeTarget?(t=P(this))==null?void 0:t.querySelector(`#${this.invokeTarget}`):null}handleClick(){var t;(t=this.invokeTargetElement)==null||t.dispatchEvent(new O({relatedTarget:this}));}};s.customElements.get("media-chrome-menu-button")||s.customElements.define("media-chrome-menu-button",Q);export{$t as A,rt as B,vt as C,ft as D,Xt as E,D as F,H as G,h as H,_ as I,c as J,O as K,nt as L,Q as M,St as a,p as b,dt as c,b as d,z as e,yt as f,Lt as g,Rt as h,wt as i,Dt as j,kt as k,Ct as l,Nt as m,Pt as n,s as o,Qt as p,R as q,ot as r,pt as s,Ft as t,Kt as u,Et as v,w,ht as x,P as y,it as z};
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
'use strict';var St={MEDIA_PLAY_REQUEST:"mediaplayrequest",MEDIA_PAUSE_REQUEST:"mediapauserequest",MEDIA_MUTE_REQUEST:"mediamuterequest",MEDIA_UNMUTE_REQUEST:"mediaunmuterequest",MEDIA_LOOP_REQUEST:"medialooprequest",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"},p={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},dt={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_LOOP:"mediaLoop",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"},Y=Object.entries(dt),b=Y.reduce((e,[t,o])=>(e[t]=o.toLowerCase(),e),{}),ct={USER_INACTIVE_CHANGE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"},z=Y.reduce((e,[t,o])=>(e[t]=o.toLowerCase(),e),{...ct});Object.entries(z).reduce((e,[t,o])=>{let i=b[t];return i&&(e[o]=i),e},{userinactivechange:"userinactive"});var yt=Object.entries(b).reduce((e,[t,o])=>{let i=z[t];return i&&(e[o]=i),e},{userinactive:"userinactivechange"}),Lt={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},Rt={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var wt={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},Dt={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},kt={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var Ct={INLINE:"inline",FULLSCREEN:"fullscreen",PICTURE_IN_PICTURE:"picture-in-picture"};var j={"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",Loop:"Loop","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 J,x={en:j},U=((J=globalThis.navigator)==null?void 0:J.language)||"en",Nt=e=>{U=e;};var ut=e=>{var t,o,i;let[r]=U.split("-");return ((t=x[U])==null?void 0:t[e])||((o=x[r])==null?void 0:o[e])||((i=x.en)==null?void 0:i[e])||e},Pt=(e,t={})=>ut(e).replace(/\{(\w+)\}/g,(o,i)=>i in t?String(t[i]):`{${i}}`);var M=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return true}},y=class extends M{},L=class extends y{constructor(){super(...arguments),this.role=null;}},N=class{observe(){}unobserve(){}disconnect(){}},Z={createElement:function(){return new I.HTMLElement},createElementNS:function(){return new I.HTMLElement},addEventListener(){},removeEventListener(){},dispatchEvent(e){return false}},I={ResizeObserver:N,document:Z,Node:y,Element:L,HTMLElement:class extends L{constructor(){super(...arguments),this.innerHTML="";}get content(){return new I.DocumentFragment}},DocumentFragment:class extends M{},customElements:{get:function(){},define:function(){},whenDefined:function(){}},localStorage:{getItem(e){return null},setItem(e,t){},removeItem(e){}},CustomEvent:function(){},getComputedStyle:function(){},navigator:{languages:[],get userAgent(){return ""}},matchMedia(e){return {matches:false,media:e}},DOMParser:class{parseFromString(t,o){return {body:{textContent:t}}}}},tt="global"in globalThis&&globalThis?.global===globalThis||typeof window>"u"||typeof window.customElements>"u",et=Object.keys(I).every(e=>e in globalThis),s=tt&&!et?I:globalThis,Qt=tt&&!et?Z:globalThis.document;function R(e){let t={};for(let o of e)t[o.name]=o.value;return t}function ot(e){var t;return (t=pt(e))!=null?t:w(e,"media-controller")}function pt(e){var t;let{MEDIA_CONTROLLER:o}=p,i=e.getAttribute(o);if(i)return (t=P(e))==null?void 0:t.getElementById(i)}var Ft=(e,t,o=".value")=>{let i=e.querySelector(o);i&&(i.textContent=t);},mt=(e,t)=>{let o=`slot[name="${t}"]`,i=e.shadowRoot.querySelector(o);return i?i.children:[]},Kt=(e,t)=>mt(e,t)[0],Et=(e,t)=>!e||!t?false:e?.contains(t)?true:Et(e,t.getRootNode().host),w=(e,t)=>{if(!e)return null;let o=e.closest(t);return o||w(e.getRootNode().host,t)};function ht(e=document){var t;let o=e?.activeElement;return o?(t=ht(o.shadowRoot))!=null?t:o:null}function P(e){var t;let o=(t=e?.getRootNode)==null?void 0:t.call(e);return o instanceof ShadowRoot||o instanceof Document?o:null}function it(e,{depth:t=3,checkOpacity:o=true,checkVisibilityCSS:i=true}={}){if(e.checkVisibility)return e.checkVisibility({checkOpacity:o,checkVisibilityCSS:i});let r=e;for(;r&&t>0;){let a=getComputedStyle(r);if(o&&a.opacity==="0"||i&&a.visibility==="hidden"||a.display==="none")return false;r=r.parentElement,t--;}return true}function $t(e,t,o,i){let r=i.x-o.x,a=i.y-o.y,l=r*r+a*a;if(l===0)return 0;let u=((e-o.x)*r+(t-o.y)*a)/l;return Math.max(0,Math.min(1,u))}function rt(e,t){let o=_t(e,i=>i===t);return o||vt(e,t)}function _t(e,t){var o,i;let r;for(r of (o=e.querySelectorAll("style:not([media])"))!=null?o:[]){let a;try{a=(i=r.sheet)==null?void 0:i.cssRules;}catch{continue}for(let l of a??[])if(t(l.selectorText))return l}}function vt(e,t){var o,i;let r=(o=e.querySelectorAll("style:not([media])"))!=null?o:[],a=r?.[r.length-1];return a?.sheet?(a?.sheet.insertRule(`${t}{}`,a.sheet.cssRules.length),(i=a.sheet.cssRules)==null?void 0:i[a.sheet.cssRules.length-1]):(console.warn("Media Chrome: No style sheet found on style tag of",e),{style:{setProperty:()=>{},removeProperty:()=>"",getPropertyValue:()=>""}})}function ft(e,t,o=Number.NaN){let i=e.getAttribute(t);return i!=null?+i:o}function Xt(e,t,o){let i=+o;if(o==null||Number.isNaN(i)){e.hasAttribute(t)&&e.removeAttribute(t);return}ft(e,t,void 0)!==i&&e.setAttribute(t,`${i}`);}function D(e,t){return e.hasAttribute(t)}function H(e,t,o){if(o==null){e.hasAttribute(t)&&e.removeAttribute(t);return}D(e,t)!=o&&e.toggleAttribute(t,o);}function h(e,t,o=null){var i;return (i=e.getAttribute(t))!=null?i:o}function _(e,t,o){if(o==null){e.hasAttribute(t)&&e.removeAttribute(t);return}let i=`${o}`;h(e,t,void 0)!==i&&e.setAttribute(t,i);}var v={PLACEMENT:"placement",BOUNDS:"bounds"};function At(e){return `
|
|
2
|
+
<style>
|
|
3
|
+
:host {
|
|
4
|
+
--_tooltip-background-color: var(--media-tooltip-background-color, var(--media-secondary-color, rgba(20, 20, 30, .7)));
|
|
5
|
+
--_tooltip-background: var(--media-tooltip-background, var(--_tooltip-background-color));
|
|
6
|
+
--_tooltip-arrow-half-width: calc(var(--media-tooltip-arrow-width, 12px) / 2);
|
|
7
|
+
--_tooltip-arrow-height: var(--media-tooltip-arrow-height, 5px);
|
|
8
|
+
--_tooltip-arrow-background: var(--media-tooltip-arrow-color, var(--_tooltip-background-color));
|
|
9
|
+
position: relative;
|
|
10
|
+
pointer-events: none;
|
|
11
|
+
display: var(--media-tooltip-display, inline-flex);
|
|
12
|
+
justify-content: center;
|
|
13
|
+
align-items: center;
|
|
14
|
+
box-sizing: border-box;
|
|
15
|
+
z-index: var(--media-tooltip-z-index, 1);
|
|
16
|
+
background: var(--_tooltip-background);
|
|
17
|
+
color: var(--media-text-color, var(--media-primary-color, rgb(238 238 238)));
|
|
18
|
+
font: var(--media-font,
|
|
19
|
+
var(--media-font-weight, 400)
|
|
20
|
+
var(--media-font-size, 13px) /
|
|
21
|
+
var(--media-text-content-height, var(--media-control-height, 18px))
|
|
22
|
+
var(--media-font-family, helvetica neue, segoe ui, roboto, arial, sans-serif));
|
|
23
|
+
padding: var(--media-tooltip-padding, .35em .7em);
|
|
24
|
+
border: var(--media-tooltip-border, none);
|
|
25
|
+
border-radius: var(--media-tooltip-border-radius, 5px);
|
|
26
|
+
filter: var(--media-tooltip-filter, drop-shadow(0 0 4px rgba(0, 0, 0, .2)));
|
|
27
|
+
white-space: var(--media-tooltip-white-space, nowrap);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
:host([hidden]) {
|
|
31
|
+
display: none;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
img, svg {
|
|
35
|
+
display: inline-block;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
#arrow {
|
|
39
|
+
position: absolute;
|
|
40
|
+
width: 0px;
|
|
41
|
+
height: 0px;
|
|
42
|
+
border-style: solid;
|
|
43
|
+
display: var(--media-tooltip-arrow-display, block);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
:host(:not([placement])),
|
|
47
|
+
:host([placement="top"]) {
|
|
48
|
+
position: absolute;
|
|
49
|
+
bottom: calc(100% + var(--media-tooltip-distance, 12px));
|
|
50
|
+
left: 50%;
|
|
51
|
+
transform: translate(calc(-50% - var(--media-tooltip-offset-x, 0px)), 0);
|
|
52
|
+
}
|
|
53
|
+
:host(:not([placement])) #arrow,
|
|
54
|
+
:host([placement="top"]) #arrow {
|
|
55
|
+
top: 100%;
|
|
56
|
+
left: 50%;
|
|
57
|
+
border-width: var(--_tooltip-arrow-height) var(--_tooltip-arrow-half-width) 0 var(--_tooltip-arrow-half-width);
|
|
58
|
+
border-color: var(--_tooltip-arrow-background) transparent transparent transparent;
|
|
59
|
+
transform: translate(calc(-50% + var(--media-tooltip-offset-x, 0px)), 0);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
:host([placement="right"]) {
|
|
63
|
+
position: absolute;
|
|
64
|
+
left: calc(100% + var(--media-tooltip-distance, 12px));
|
|
65
|
+
top: 50%;
|
|
66
|
+
transform: translate(0, -50%);
|
|
67
|
+
}
|
|
68
|
+
:host([placement="right"]) #arrow {
|
|
69
|
+
top: 50%;
|
|
70
|
+
right: 100%;
|
|
71
|
+
border-width: var(--_tooltip-arrow-half-width) var(--_tooltip-arrow-height) var(--_tooltip-arrow-half-width) 0;
|
|
72
|
+
border-color: transparent var(--_tooltip-arrow-background) transparent transparent;
|
|
73
|
+
transform: translate(0, -50%);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
:host([placement="bottom"]) {
|
|
77
|
+
position: absolute;
|
|
78
|
+
top: calc(100% + var(--media-tooltip-distance, 12px));
|
|
79
|
+
left: 50%;
|
|
80
|
+
transform: translate(calc(-50% - var(--media-tooltip-offset-x, 0px)), 0);
|
|
81
|
+
}
|
|
82
|
+
:host([placement="bottom"]) #arrow {
|
|
83
|
+
bottom: 100%;
|
|
84
|
+
left: 50%;
|
|
85
|
+
border-width: 0 var(--_tooltip-arrow-half-width) var(--_tooltip-arrow-height) var(--_tooltip-arrow-half-width);
|
|
86
|
+
border-color: transparent transparent var(--_tooltip-arrow-background) transparent;
|
|
87
|
+
transform: translate(calc(-50% + var(--media-tooltip-offset-x, 0px)), 0);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
:host([placement="left"]) {
|
|
91
|
+
position: absolute;
|
|
92
|
+
right: calc(100% + var(--media-tooltip-distance, 12px));
|
|
93
|
+
top: 50%;
|
|
94
|
+
transform: translate(0, -50%);
|
|
95
|
+
}
|
|
96
|
+
:host([placement="left"]) #arrow {
|
|
97
|
+
top: 50%;
|
|
98
|
+
left: 100%;
|
|
99
|
+
border-width: var(--_tooltip-arrow-half-width) 0 var(--_tooltip-arrow-half-width) var(--_tooltip-arrow-height);
|
|
100
|
+
border-color: transparent transparent transparent var(--_tooltip-arrow-background);
|
|
101
|
+
transform: translate(0, -50%);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
:host([placement="none"]) #arrow {
|
|
105
|
+
display: none;
|
|
106
|
+
}
|
|
107
|
+
</style>
|
|
108
|
+
<slot></slot>
|
|
109
|
+
<div id="arrow"></div>
|
|
110
|
+
`}var f=class extends s.HTMLElement{constructor(){if(super(),this.updateXOffset=()=>{var t;if(!it(this,{checkOpacity:false,checkVisibilityCSS:false}))return;let o=this.placement;if(o==="left"||o==="right"){this.style.removeProperty("--media-tooltip-offset-x");return}let i=getComputedStyle(this),r=(t=w(this,"#"+this.bounds))!=null?t:ot(this);if(!r)return;let{x:a,width:l}=r.getBoundingClientRect(),{x:u,width:S}=this.getBoundingClientRect(),st=u+S,lt=a+l,W=i.getPropertyValue("--media-tooltip-offset-x"),G=W?parseFloat(W.replace("px","")):0,F=i.getPropertyValue("--media-tooltip-container-margin"),K=F?parseFloat(F.replace("px","")):0,$=u-a+G-K,X=st-lt+G+K;if($<0){this.style.setProperty("--media-tooltip-offset-x",`${$}px`);return}if(X>0){this.style.setProperty("--media-tooltip-offset-x",`${X}px`);return}this.style.removeProperty("--media-tooltip-offset-x");},!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let t=R(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(t);}if(this.arrowEl=this.shadowRoot.querySelector("#arrow"),Object.prototype.hasOwnProperty.call(this,"placement")){let t=this.placement;delete this.placement,this.placement=t;}}static get observedAttributes(){return [v.PLACEMENT,v.BOUNDS]}get placement(){return h(this,v.PLACEMENT)}set placement(t){_(this,v.PLACEMENT,t);}get bounds(){return h(this,v.BOUNDS)}set bounds(t){_(this,v.BOUNDS,t);}};f.shadowRootOptions={mode:"open"};f.getTemplateHTML=At;s.customElements.get("media-tooltip")||s.customElements.define("media-tooltip",f);var B=f;var q=(e,t,o)=>{if(!t.has(e))throw TypeError("Cannot "+o)},n=(e,t,o)=>(q(e,t,"read from private field"),o?o.call(e):t.get(e)),A=(e,t,o)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,o);},k=(e,t,o,i)=>(q(e,t,"write to private field"),t.set(e,o),o),gt=(e,t,o)=>(q(e,t,"access private method"),o),d,T,E,g,C,V,at,m={TOOLTIP_PLACEMENT:"tooltipplacement",DISABLED:"disabled",NO_TOOLTIP:"notooltip"};function Tt(e,t={}){return `
|
|
111
|
+
<style>
|
|
112
|
+
:host {
|
|
113
|
+
position: relative;
|
|
114
|
+
font: var(--media-font,
|
|
115
|
+
var(--media-font-weight, bold)
|
|
116
|
+
var(--media-font-size, 14px) /
|
|
117
|
+
var(--media-text-content-height, var(--media-control-height, 24px))
|
|
118
|
+
var(--media-font-family, helvetica neue, segoe ui, roboto, arial, sans-serif));
|
|
119
|
+
color: var(--media-text-color, var(--media-primary-color, rgb(238 238 238)));
|
|
120
|
+
background: var(--media-control-background, var(--media-secondary-color, rgb(20 20 30 / .7)));
|
|
121
|
+
padding: var(--media-button-padding, var(--media-control-padding, 10px));
|
|
122
|
+
justify-content: var(--media-button-justify-content, center);
|
|
123
|
+
display: inline-flex;
|
|
124
|
+
align-items: center;
|
|
125
|
+
vertical-align: middle;
|
|
126
|
+
box-sizing: border-box;
|
|
127
|
+
transition: background .15s linear;
|
|
128
|
+
pointer-events: auto;
|
|
129
|
+
cursor: var(--media-cursor, pointer);
|
|
130
|
+
-webkit-tap-highlight-color: transparent;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
:host(:focus-visible) {
|
|
135
|
+
box-shadow: var(--media-focus-box-shadow, inset 0 0 0 2px rgb(27 127 204 / .9));
|
|
136
|
+
outline: 0;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
:host(:where(:focus)) {
|
|
140
|
+
box-shadow: none;
|
|
141
|
+
outline: 0;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
:host(:hover) {
|
|
145
|
+
background: var(--media-control-hover-background, rgba(50 50 70 / .7));
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
svg, img, ::slotted(svg), ::slotted(img) {
|
|
149
|
+
width: var(--media-button-icon-width);
|
|
150
|
+
height: var(--media-button-icon-height, var(--media-control-height, 24px));
|
|
151
|
+
transform: var(--media-button-icon-transform);
|
|
152
|
+
transition: var(--media-button-icon-transition);
|
|
153
|
+
fill: var(--media-icon-color, var(--media-primary-color, rgb(238 238 238)));
|
|
154
|
+
vertical-align: middle;
|
|
155
|
+
max-width: 100%;
|
|
156
|
+
max-height: 100%;
|
|
157
|
+
min-width: 100%;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
media-tooltip {
|
|
161
|
+
|
|
162
|
+
max-width: 0;
|
|
163
|
+
overflow-x: clip;
|
|
164
|
+
opacity: 0;
|
|
165
|
+
transition: opacity .3s, max-width 0s 9s;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
:host(:hover) media-tooltip,
|
|
169
|
+
:host(:focus-visible) media-tooltip {
|
|
170
|
+
max-width: 100vw;
|
|
171
|
+
opacity: 1;
|
|
172
|
+
transition: opacity .3s;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
:host([notooltip]) slot[name="tooltip"] {
|
|
176
|
+
display: none;
|
|
177
|
+
}
|
|
178
|
+
</style>
|
|
179
|
+
|
|
180
|
+
${this.getSlotTemplateHTML(e,t)}
|
|
181
|
+
|
|
182
|
+
<slot name="tooltip">
|
|
183
|
+
<media-tooltip part="tooltip" aria-hidden="true">
|
|
184
|
+
<template shadowrootmode="${B.shadowRootOptions.mode}">
|
|
185
|
+
${B.getTemplateHTML({})}
|
|
186
|
+
</template>
|
|
187
|
+
<slot name="tooltip-content">
|
|
188
|
+
${this.getTooltipContentHTML(e)}
|
|
189
|
+
</slot>
|
|
190
|
+
</media-tooltip>
|
|
191
|
+
</slot>
|
|
192
|
+
`}function bt(e,t){return `
|
|
193
|
+
<slot></slot>
|
|
194
|
+
`}function It(){return ""}var c=class extends s.HTMLElement{constructor(){if(super(),A(this,V),A(this,d,void 0),this.preventClick=false,this.tooltipEl=null,A(this,T,t=>{this.preventClick||this.handleClick(t),setTimeout(n(this,E),0);}),A(this,E,()=>{var t,o;(o=(t=this.tooltipEl)==null?void 0:t.updateXOffset)==null||o.call(t);}),A(this,g,t=>{let{key:o}=t;if(!this.keysUsed.includes(o)){this.removeEventListener("keyup",n(this,g));return}this.preventClick||this.handleClick(t);}),A(this,C,t=>{let{metaKey:o,altKey:i,key:r}=t;if(o||i||!this.keysUsed.includes(r)){this.removeEventListener("keyup",n(this,g));return}this.addEventListener("keyup",n(this,g),{once:true});}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let t=R(this.attributes),o=this.constructor.getTemplateHTML(t);this.shadowRoot.setHTMLUnsafe?this.shadowRoot.setHTMLUnsafe(o):this.shadowRoot.innerHTML=o;}this.tooltipEl=this.shadowRoot.querySelector("media-tooltip");}static get observedAttributes(){return ["disabled",m.TOOLTIP_PLACEMENT,p.MEDIA_CONTROLLER,b.MEDIA_LANG]}enable(){this.addEventListener("click",n(this,T)),this.addEventListener("keydown",n(this,C)),this.tabIndex=0;}disable(){this.removeEventListener("click",n(this,T)),this.removeEventListener("keydown",n(this,C)),this.removeEventListener("keyup",n(this,g)),this.tabIndex=-1;}attributeChangedCallback(t,o,i){var r,a,l,u,S;t===p.MEDIA_CONTROLLER?(o&&((a=(r=n(this,d))==null?void 0:r.unassociateElement)==null||a.call(r,this),k(this,d,null)),i&&this.isConnected&&(k(this,d,(l=this.getRootNode())==null?void 0:l.getElementById(i)),(S=(u=n(this,d))==null?void 0:u.associateElement)==null||S.call(u,this))):t==="disabled"&&i!==o?i==null?this.enable():this.disable():t===m.TOOLTIP_PLACEMENT&&this.tooltipEl&&i!==o?this.tooltipEl.placement=i:t===b.MEDIA_LANG&&(this.shadowRoot.querySelector('slot[name="tooltip-content"]').innerHTML=this.constructor.getTooltipContentHTML()),n(this,E).call(this);}connectedCallback(){var t,o,i;let{style:r}=rt(this.shadowRoot,":host");r.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(p.MEDIA_CONTROLLER);a&&(k(this,d,(t=this.getRootNode())==null?void 0:t.getElementById(a)),(i=(o=n(this,d))==null?void 0:o.associateElement)==null||i.call(o,this)),s.customElements.whenDefined("media-tooltip").then(()=>gt(this,V,at).call(this));}disconnectedCallback(){var t,o;this.disable(),(o=(t=n(this,d))==null?void 0:t.unassociateElement)==null||o.call(t,this),k(this,d,null),this.removeEventListener("mouseenter",n(this,E)),this.removeEventListener("focus",n(this,E)),this.removeEventListener("click",n(this,T));}get keysUsed(){return ["Enter"," "]}get tooltipPlacement(){return h(this,m.TOOLTIP_PLACEMENT)}set tooltipPlacement(t){_(this,m.TOOLTIP_PLACEMENT,t);}get mediaController(){return h(this,p.MEDIA_CONTROLLER)}set mediaController(t){_(this,p.MEDIA_CONTROLLER,t);}get disabled(){return D(this,m.DISABLED)}set disabled(t){H(this,m.DISABLED,t);}get noTooltip(){return D(this,m.NO_TOOLTIP)}set noTooltip(t){H(this,m.NO_TOOLTIP,t);}handleClick(t){}};d=new WeakMap;T=new WeakMap;E=new WeakMap;g=new WeakMap;C=new WeakMap;V=new WeakSet;at=function(){this.addEventListener("mouseenter",n(this,E)),this.addEventListener("focus",n(this,E)),this.addEventListener("click",n(this,T));let e=this.tooltipPlacement;e&&this.tooltipEl&&(this.tooltipEl.placement=e);};c.shadowRootOptions={mode:"open"};c.getTemplateHTML=Tt;c.getSlotTemplateHTML=bt;c.getTooltipContentHTML=It;s.customElements.get("media-chrome-button")||s.customElements.define("media-chrome-button",c);var O=class extends Event{constructor({action:t="auto",relatedTarget:o,...i}){super("invoke",i),this.action=t,this.relatedTarget=o;}},nt=class extends Event{constructor({newState:t,oldState:o,...i}){super("toggle",i),this.newState=t,this.oldState=o;}};var Q=class extends c{connectedCallback(){super.connectedCallback(),this.invokeTargetElement&&this.setAttribute("aria-haspopup","menu");}get invokeTarget(){return this.getAttribute("invoketarget")}set invokeTarget(t){this.setAttribute("invoketarget",`${t}`);}get invokeTargetElement(){var t;return this.invokeTarget?(t=P(this))==null?void 0:t.querySelector(`#${this.invokeTarget}`):null}handleClick(){var t;(t=this.invokeTargetElement)==null||t.dispatchEvent(new O({relatedTarget:this}));}};s.customElements.get("media-chrome-menu-button")||s.customElements.define("media-chrome-menu-button",Q);exports.A=$t;exports.B=rt;exports.C=vt;exports.D=ft;exports.E=Xt;exports.F=D;exports.G=H;exports.H=h;exports.I=_;exports.J=c;exports.K=O;exports.L=nt;exports.M=Q;exports.a=St;exports.b=p;exports.c=dt;exports.d=b;exports.e=z;exports.f=yt;exports.g=Lt;exports.h=Rt;exports.i=wt;exports.j=Dt;exports.k=kt;exports.l=Ct;exports.m=Nt;exports.n=Pt;exports.o=s;exports.p=Qt;exports.q=R;exports.r=ot;exports.s=pt;exports.t=Ft;exports.u=Kt;exports.v=Et;exports.w=w;exports.x=ht;exports.y=P;exports.z=it;
|