/**
 * Bundled by jsDelivr using Rollup v2.79.2 and Terser v5.39.0.
 * Original file: /npm/media-chrome@4.16.1/dist/media-theme-element.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
const e=Object.entries({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"}),t=e.reduce(((e,[t,n])=>(e[t]=n.toLowerCase(),e)),{}),n=e.reduce(((e,[t,n])=>(e[t]=n.toLowerCase(),e)),{USER_INACTIVE_CHANGE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"});Object.entries(n).reduce(((e,[n,i])=>{const a=t[n];return a&&(e[i]=a),e}),{userinactivechange:"userinactive"}),Object.entries(t).reduce(((e,[t,i])=>{const a=n[t];return a&&(e[i]=a),e}),{userinactive:"userinactivechange"});class i{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}}class a extends i{}class s extends a{constructor(){super(...arguments),this.role=null}}const r={createElement:function(){return new o.HTMLElement},createElementNS:function(){return new o.HTMLElement},addEventListener(){},removeEventListener(){},dispatchEvent:e=>!1},o={ResizeObserver:class{observe(){}unobserve(){}disconnect(){}},document:r,Node:a,Element:s,HTMLElement:class extends s{constructor(){super(...arguments),this.innerHTML=""}get content(){return new o.DocumentFragment}},DocumentFragment:class extends i{},customElements:{get:function(){},define:function(){},whenDefined:function(){}},localStorage:{getItem:e=>null,setItem(e,t){},removeItem(e){}},CustomEvent:function(){},getComputedStyle:function(){},navigator:{languages:[],get userAgent(){return""}},matchMedia:e=>({matches:!1,media:e}),DOMParser:class{parseFromString(e,t){return{body:{textContent:e}}}}},l="global"in globalThis&&(null==globalThis?void 0:globalThis.global)===globalThis||"undefined"==typeof window||void 0===window.customElements,u=Object.keys(o).every((e=>e in globalThis)),d=l&&!u?o:globalThis,c=l&&!u?r:globalThis.document;var h,m,p,E,f,v,A,b,g,I,M,_=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},T=(e,t,n)=>(_(e,t,"read from private field"),n?n.call(e):t.get(e)),w=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},D=(e,t,n,i)=>(_(e,t,"write to private field"),i?i.call(e,n):t.set(e,n),n);const L={processCallback(e,t,n){if(n)for(const[e,i]of t)if(e in n){const t=n[e];"boolean"==typeof t&&i instanceof x&&"boolean"==typeof i.element[i.attributeName]?i.booleanValue=t:"function"==typeof t&&i instanceof x?i.element[i.attributeName]=t:i.value=t}}};class S extends d.DocumentFragment{constructor(e,t,n=L){var i;super(),w(this,h,void 0),w(this,m,void 0),this.append(e.content.cloneNode(!0)),D(this,h,k(this)),D(this,m,n),null==(i=n.createCallback)||i.call(n,this,T(this,h),t),n.processCallback(this,T(this,h),t)}update(e){T(this,m).processCallback(this,T(this,h),e)}}h=new WeakMap,m=new WeakMap;const k=(e,t=[])=>{let n,i;for(const a of e.attributes||[])if(a.value.includes("{{")){const s=new O;for([n,i]of R(a.value))if(n){const n=new x(e,a.name,a.namespaceURI);s.append(n),t.push([i,n])}else s.append(i);a.value=s.toString()}for(const a of e.childNodes)if(1!==a.nodeType||a instanceof HTMLTemplateElement){const s=a.data;if(1===a.nodeType||s.includes("{{")){const r=[];if(s)for([n,i]of R(s))if(n){const n=new U(e);r.push(n),t.push([i,n])}else r.push(new Text(i));else if(a instanceof HTMLTemplateElement){const n=new W(e,a);r.push(n),t.push([n.expression,n])}a.replaceWith(...r.flatMap((e=>e.replacementNodes||[e])))}}else k(a,t);return t},N={},R=e=>{let t,n="",i=0,a=N[e],s=0;if(a)return a;for(a=[];t=e[s];s++)"{"===t&&"{"===e[s+1]&&"\\"!==e[s-1]&&e[s+2]&&1==++i?(n&&a.push([0,n]),n="",s++):"}"!==t||"}"!==e[s+1]||"\\"===e[s-1]||--i?n+=t||"":(a.push([1,n.trim()]),n="",s++);return n&&a.push([0,(i>0?"{{":"")+n]),N[e]=a};class C{get value(){return""}set value(e){}toString(){return this.value}}const y=new WeakMap;class O{constructor(){w(this,p,[])}[Symbol.iterator](){return T(this,p).values()}get length(){return T(this,p).length}item(e){return T(this,p)[e]}append(...e){for(const t of e)t instanceof x&&y.set(t,this),T(this,p).push(t)}toString(){return T(this,p).join("")}}p=new WeakMap;class x extends C{constructor(e,t,n){super(),w(this,b),w(this,E,""),w(this,f,void 0),w(this,v,void 0),w(this,A,void 0),D(this,f,e),D(this,v,t),D(this,A,n)}get attributeName(){return T(this,v)}get attributeNamespace(){return T(this,A)}get element(){return T(this,f)}get value(){return T(this,E)}set value(e){T(this,E)!==e&&(D(this,E,e),T(this,b,g)&&1!==T(this,b,g).length?T(this,f).setAttributeNS(T(this,A),T(this,v),T(this,b,g).toString()):null==e?T(this,f).removeAttributeNS(T(this,A),T(this,v)):T(this,f).setAttributeNS(T(this,A),T(this,v),e))}get booleanValue(){return T(this,f).hasAttributeNS(T(this,A),T(this,v))}set booleanValue(e){if(T(this,b,g)&&1!==T(this,b,g).length)throw new DOMException("Value is not fully templatized");this.value=e?"":null}}E=new WeakMap,f=new WeakMap,v=new WeakMap,A=new WeakMap,b=new WeakSet,g=function(){return y.get(this)};class U extends C{constructor(e,t){super(),w(this,I,void 0),w(this,M,void 0),D(this,I,e),D(this,M,t?[...t]:[new Text])}get replacementNodes(){return T(this,M)}get parentNode(){return T(this,I)}get nextSibling(){return T(this,M)[T(this,M).length-1].nextSibling}get previousSibling(){return T(this,M)[0].previousSibling}get value(){return T(this,M).map((e=>e.textContent)).join("")}set value(e){this.replace(e)}replace(...e){const t=e.flat().flatMap((e=>null==e?[new Text]:e.forEach?[...e]:11===e.nodeType?[...e.childNodes]:e.nodeType?[e]:[new Text(e)]));t.length||t.push(new Text),D(this,M,function(e,t,n,i=null){let a,s,r,o=0,l=n.length,u=t.length;for(;o<l&&o<u&&t[o]==n[o];)o++;for(;o<l&&o<u&&n[l-1]==t[u-1];)i=n[(--u,--l)];if(o==u)for(;o<l;)e.insertBefore(n[o++],i);if(o==l)for(;o<u;)e.removeChild(t[o++]);else{for(a=t[o];o<l;)r=n[o++],s=a?a.nextSibling:i,a==r?a=s:o<l&&n[o]==s?(e.replaceChild(r,a),a=s):e.insertBefore(r,a);for(;a!=i;)s=a.nextSibling,e.removeChild(a),a=s}return n}(T(this,M)[0].parentNode,T(this,M),t,this.nextSibling))}}I=new WeakMap,M=new WeakMap;class W extends U{constructor(e,t){const n=t.getAttribute("directive")||t.getAttribute("type");let i=t.getAttribute("expression")||t.getAttribute(n)||"";i.startsWith("{{")&&(i=i.trim().slice(2,-2).trim()),super(e),this.expression=i,this.template=t,this.directive=n}}function P(e){return e.replace(/[-_]([a-z])/g,((e,t)=>t.toUpperCase()))}function V(e){return"string"==typeof e&&(!isNaN(e)&&!isNaN(parseFloat(e)))}const H={string:e=>String(e)};class B{constructor(e){this.template=e,this.state=void 0}}const F=new WeakMap,G=new WeakMap,j={partial:(e,t)=>{t[e.expression]=new B(e.template)},if:(e,t)=>{var n;if($(e.expression,t))if(F.get(e)!==e.template){F.set(e,e.template);const n=new S(e.template,t,z);e.replace(n),G.set(e,n)}else null==(n=G.get(e))||n.update(t);else e.replace(""),F.delete(e),G.delete(e)}},K=Object.keys(j),z={processCallback(e,t,n){var i,a;if(n)for(const[e,s]of t){if(s instanceof W){if(!s.directive){const e=K.find((e=>s.template.hasAttribute(e)));e&&(s.directive=e,s.expression=s.template.getAttribute(e))}null==(i=j[s.directive])||i.call(j,s,n);continue}let t=$(e,n);t instanceof B?F.get(s)!==t.template?(F.set(s,t.template),t=new S(t.template,t.state,z),s.value=t,G.set(s,t)):null==(a=G.get(s))||a.update(t.state):t?(s instanceof x&&s.attributeName.startsWith("aria-")&&(t=String(t)),s instanceof x?"boolean"==typeof t?s.booleanValue=t:"function"==typeof t?s.element[s.attributeName]=t:s.value=t:(s.value=t,F.delete(s),G.delete(s))):s instanceof x?s.value=void 0:(s.value=void 0,F.delete(s),G.delete(s))}}},Y={"!":e=>!e,"!!":e=>!!e,"==":(e,t)=>e==t,"!=":(e,t)=>e!=t,">":(e,t)=>e>t,">=":(e,t)=>e>=t,"<":(e,t)=>e<t,"<=":(e,t)=>e<=t,"??":(e,t)=>null!=e?e:t,"|":(e,t)=>{var n;return null==(n=H[t])?void 0:n.call(H,e)}};function $(e,t={}){var n,i,a,s,r,o,l;const u=function(e){return function(e,t){let n,i,a;const s=[];for(;e;){a=null,n=e.length;for(const s in t)i=t[s].exec(e),i&&i.index<n&&(a={token:i[0],type:s,matches:i.slice(1)},n=i.index);n&&s.push({token:e.substr(0,n),type:void 0}),a&&s.push(a),e=e.substr(n+(a?a.token.length:0))}return s}(e,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><][=!]?|\?\?|\|/,ws:/\s+/,param:/[$a-z_][$\w]*/i}).filter((({type:e})=>"ws"!==e))}(e);if(0===u.length||u.some((({type:e})=>!e)))return q(e);if(">"===(null==(n=u[0])?void 0:n.token)){const n=t[null==(i=u[1])?void 0:i.token];if(!n)return q(e);const o={...t};n.state=o;const l=u.slice(2);for(let e=0;e<l.length;e+=3){const n=null==(a=l[e])?void 0:a.token,i=null==(s=l[e+1])?void 0:s.token,u=null==(r=l[e+2])?void 0:r.token;n&&"="===i&&(o[n]=Q(u,t))}return n}if(1===u.length)return J(u[0])?Q(u[0].token,t):q(e);if(2===u.length){const n=null==(o=u[0])?void 0:o.token,i=Y[n];if(!i||!J(u[1]))return q(e);return i(Q(u[1].token,t))}if(3===u.length){const n=null==(l=u[1])?void 0:l.token,i=Y[n];if(!i||!J(u[0])||!J(u[2]))return q(e);const a=Q(u[0].token,t);if("|"===n)return i(a,u[2].token);return i(a,Q(u[2].token,t))}}function q(e){return console.warn(`Warning: invalid expression \`${e}\``),!1}function J({type:e}){return["number","boolean","string","param"].includes(e)}function Q(e,t){const n=e[0],i=e.slice(-1);return"true"===e||"false"===e?"true"===e:n===i&&["'",'"'].includes(n)?e.slice(1,-1):V(e)?parseFloat(e):t[e]}var X,Z,ee,te,ne,ie,ae,se=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},re=(e,t,n)=>(se(e,t,"read from private field"),n?n.call(e):t.get(e)),oe=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},le=(e,t,n,i)=>(se(e,t,"write to private field"),i?i.call(e,n):t.set(e,n),n),ue=(e,t,n)=>(se(e,t,"access private method"),n);const de={mediatargetlivewindow:"targetlivewindow",mediastreamtype:"streamtype"},ce=c.createElement("template");ce.innerHTML="\n  <style>\n    :host {\n      display: inline-block;\n      line-height: 0;\n    }\n\n    media-controller {\n      width: 100%;\n      height: 100%;\n    }\n\n    media-captions-button:not([mediasubtitleslist]),\n    media-captions-menu:not([mediasubtitleslist]),\n    media-captions-menu-button:not([mediasubtitleslist]),\n    media-audio-track-menu[mediaaudiotrackunavailable],\n    media-audio-track-menu-button[mediaaudiotrackunavailable],\n    media-rendition-menu[mediarenditionunavailable],\n    media-rendition-menu-button[mediarenditionunavailable],\n    media-volume-range[mediavolumeunavailable],\n    media-airplay-button[mediaairplayunavailable],\n    media-fullscreen-button[mediafullscreenunavailable],\n    media-cast-button[mediacastunavailable],\n    media-pip-button[mediapipunavailable] {\n      display: none;\n    }\n  </style>\n";class he extends d.HTMLElement{constructor(){super(),oe(this,te),oe(this,ie),oe(this,X,void 0),oe(this,Z,void 0),oe(this,ee,void 0),this.shadowRoot?this.renderRoot=this.shadowRoot:(this.renderRoot=this.attachShadow({mode:"open"}),this.createRenderer());const e=new MutationObserver((e=>{var t;this.mediaController&&!(null==(t=this.mediaController)?void 0:t.breakpointsComputed)||e.some((e=>{const t=e.target;return t===this||"media-controller"===t.localName&&(!!de[e.attributeName]||!!e.attributeName.startsWith("breakpoint"))}))&&this.render()}));e.observe(this,{attributes:!0}),e.observe(this.renderRoot,{attributes:!0,subtree:!0}),this.addEventListener(n.BREAKPOINTS_COMPUTED,this.render),ue(this,te,ne).call(this,"template")}get mediaController(){return this.renderRoot.querySelector("media-controller")}get template(){var e;return null!=(e=re(this,X))?e:this.constructor.template}set template(e){null!==e?"string"==typeof e?this.setAttribute("template",e):e instanceof HTMLTemplateElement&&(le(this,X,e),le(this,ee,null),this.createRenderer()):this.removeAttribute("template")}get props(){var e,t,n;const i=[...Array.from(null!=(t=null==(e=this.mediaController)?void 0:e.attributes)?t:[]).filter((({name:e})=>de[e]||e.startsWith("breakpoint"))),...Array.from(this.attributes)],a={};for(const e of i){const t=null!=(n=de[e.name])?n:P(e.name);let{value:i}=e;null!=i?(V(i)&&(i=parseFloat(i)),a[t]=""===i||i):a[t]=!1}return a}attributeChangedCallback(e,t,n){"template"===e&&t!=n&&ue(this,ie,ae).call(this)}connectedCallback(){ue(this,ie,ae).call(this)}createRenderer(){this.template instanceof HTMLTemplateElement&&this.template!==re(this,Z)&&(le(this,Z,this.template),this.renderer=new S(this.template,this.props,this.constructor.processor),this.renderRoot.textContent="",this.renderRoot.append(ce.content.cloneNode(!0),this.renderer))}render(){var e;null==(e=this.renderer)||e.update(this.props)}}X=new WeakMap,Z=new WeakMap,ee=new WeakMap,te=new WeakSet,ne=function(e){if(Object.prototype.hasOwnProperty.call(this,e)){const t=this[e];delete this[e],this[e]=t}},ie=new WeakSet,ae=function(){var e;const t=this.getAttribute("template");if(!t||t===re(this,ee))return;const n=this.getRootNode(),i=null==(e=null==n?void 0:n.getElementById)?void 0:e.call(n,t);if(i)return le(this,ee,t),le(this,X,i),void this.createRenderer();(function(e){if(!/^(\/|\.\/|https?:\/\/)/.test(e))return!1;const t=/^https?:\/\//.test(e)?void 0:location.origin;try{new URL(e,t)}catch(e){return!1}return!0})(t)&&(le(this,ee,t),async function(e){const t=await fetch(e);if(200!==t.status)throw new Error(`Failed to load resource: the server responded with a status of ${t.status}`);return t.text()}(t).then((e=>{const t=c.createElement("template");t.innerHTML=e,le(this,X,t),this.createRenderer()})).catch(console.error))},he.observedAttributes=["template"],he.processor=z,d.customElements.get("media-theme")||d.customElements.define("media-theme",he);export{x as AttrPart,O as AttrPartList,U as ChildNodePart,W as InnerTemplatePart,he as MediaThemeElement,C as Part,S as TemplateInstance,L as defaultProcessor,k as parse,R as tokenize};export default null;
//# sourceMappingURL=/sm/64b9c695cb559aeee4fef13a6eedfe1bcb550c9736ab8079a5f3bde4e2aa3572.map